diff -Nru openvswitch-2.3.1/acinclude.m4 openvswitch-2.4.0~git20150623/acinclude.m4 --- openvswitch-2.3.1/acinclude.m4 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/acinclude.m4 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ # -*- autoconf -*- -# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. +# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ [], [enable_Werror=no]) AC_CONFIG_COMMANDS_PRE( [if test "X$enable_Werror" = Xyes; then - CFLAGS="$CFLAGS -Werror" + OVS_CFLAGS="$OVS_CFLAGS -Werror" fi])]) dnl OVS_CHECK_LINUX @@ -133,12 +133,14 @@ fi AC_MSG_RESULT([$kversion]) - if test "$version" -ge 3; then - if test "$version" = 3 && test "$patchlevel" -le 14; then - : # Linux 3.x + if test "$version" -ge 4; then + if test "$version" = 4 && test "$patchlevel" -le 0; then + : # Linux 4.x else - AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.14.x is not supported (please refer to the FAQ for advice)]) + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.0.x is not supported (please refer to the FAQ for advice)]) fi + elif test "$version" = 3; then + : # Linux 3.x else if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 2.6.32 or later is required]) @@ -170,12 +172,57 @@ DPDK_INCLUDE=$RTE_SDK/include DPDK_LIB_DIR=$RTE_SDK/lib - DPDK_LIBS="$DPDK_LIB_DIR/libintel_dpdk.a" - - LIBS="$DPDK_LIBS $LIBS" - CPPFLAGS="-I$DPDK_INCLUDE $CPPFLAGS" + DPDK_LIB="-lintel_dpdk" + DPDK_EXTRA_LIB="-lfuse" + ovs_save_CFLAGS="$CFLAGS" + ovs_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$DPDK_LIB_DIR" + CFLAGS="$CFLAGS -I$DPDK_INCLUDE" + + # On some systems we have to add -ldl to link with dpdk + # + # This code, at first, tries to link without -ldl (""), + # then adds it and tries again. + # Before each attempt the search cache must be unset, + # otherwise autoconf will stick with the old result + + found=false + save_LIBS=$LIBS + for extras in "" "-ldl"; do + LIBS="$DPDK_LIB $extras $save_LIBS $DPDK_EXTRA_LIB" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include + #include ], + [int rte_argc; char ** rte_argv; + rte_eal_init(rte_argc, rte_argv);])], + [found=true]) + if $found; then + break + fi + done + if $found; then :; else + AC_MSG_ERROR([cannot link with dpdk]) + fi + CFLAGS="$ovs_save_CFLAGS" + LDFLAGS="$ovs_save_LDFLAGS" + OVS_LDFLAGS="$OVS_LDFLAGS -L$DPDK_LIB_DIR" + OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE -mssse3" + + # DPDK pmd drivers are not linked unless --whole-archive is used. + # + # This happens because the rest of the DPDK code doesn't use any symbol in + # the pmd driver objects, and the drivers register themselves using an + # __attribute__((constructor)) function. + # + # These options are specified inside a single -Wl directive to prevent + # autotools from reordering them. + DPDK_vswitchd_LDFLAGS=-Wl,--whole-archive,$DPDK_LIB,--no-whole-archive + AC_SUBST([DPDK_vswitchd_LDFLAGS]) AC_DEFINE([DPDK_NETDEV], [1], [System uses the DPDK module.]) + + OVS_GREP_IFELSE([$RTE_SDK/include/rte_config.h], [define RTE_LIBRTE_VHOST_USER 1], + [], [AC_DEFINE([VHOST_CUSE], [1], [DPDK vhost-cuse support enabled, vhost-user disabled.])]) else RTE_SDK= fi @@ -212,6 +259,37 @@ fi ]) +dnl OVS_FIND_FIELD_IFELSE(FILE, STRUCTURE, REGEX, [IF-MATCH], [IF-NO-MATCH]) +dnl +dnl Looks for STRUCTURE in FILE. If it is found, greps for REGEX within the +dnl structure definition. If this is successful, runs IF-MATCH, otherwise +dnl IF_NO_MATCH. If IF-MATCH is empty then it defines to +dnl OVS_DEFINE(HAVE__WITH_), with and +dnl translated to uppercase. +AC_DEFUN([OVS_FIND_FIELD_IFELSE], [ + AC_MSG_CHECKING([whether $2 has member $3 in $1]) + if test -f $1; then + awk '/$2.{/,/^}/' $1 2>/dev/null | grep '$3' + status=$? + case $status in + 0) + AC_MSG_RESULT([yes]) + m4_if([$4], [], [OVS_DEFINE([HAVE_]m4_toupper([$2])[_WITH_]m4_toupper([$3]))], [$4]) + ;; + 1) + AC_MSG_RESULT([no]) + $5 + ;; + *) + AC_MSG_ERROR([grep exited with status $status]) + ;; + esac + else + AC_MSG_RESULT([file not found]) + $5 + fi +]) + dnl OVS_DEFINE(NAME) dnl dnl Defines NAME to 1 in kcompat.h. @@ -219,16 +297,6 @@ echo '#define $1 1' >> datapath/linux/kcompat.h.new ]) -AC_DEFUN([OVS_CHECK_LOG2_H], [ - AC_MSG_CHECKING([for $KSRC/include/linux/log2.h]) - if test -e $KSRC/include/linux/log2.h; then - AC_MSG_RESULT([yes]) - OVS_DEFINE([HAVE_LOG2_H]) - else - AC_MSG_RESULT([no]) - fi -]) - dnl OVS_CHECK_LINUX_COMPAT dnl dnl Runs various Autoconf checks on the Linux 2.6 kernel source in @@ -242,7 +310,7 @@ [OVS_DEFINE([HAVE_CSUM_COPY_DBG])]) OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [ERR_CAST]) - OVS_GREP_IFELSE([$KSRC/include/linux/hash.h], [fast_hash_ops]) + OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [IS_ERR_OR_NULL]) OVS_GREP_IFELSE([$KSRC/include/linux/etherdevice.h], [eth_hw_addr_random]) OVS_GREP_IFELSE([$KSRC/include/linux/etherdevice.h], [ether_addr_copy]) @@ -252,6 +320,8 @@ OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast]) OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry], [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])]) + OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [inet_get_local_port_range.*net], + [OVS_DEFINE([HAVE_INET_GET_LOCAL_PORT_RANGE_USING_NET])]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats]) @@ -260,6 +330,8 @@ OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [can_checksum_protocol]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [netdev_features_t]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [pcpu_sw_netstats]) + OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hookfn.*nf_hook_ops], + [OVS_DEFINE([HAVE_NF_HOOKFN_ARG_OPS])]) OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32]) @@ -275,6 +347,7 @@ # quoting rules. OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [[[^@]]proto_data_valid], [OVS_DEFINE([HAVE_PROTO_DATA_VALID])]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [kfree_skb_list]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [rxhash]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u16.*rxhash], [OVS_DEFINE([HAVE_U16_RXHASH])]) @@ -303,6 +376,9 @@ OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [int.skb_zerocopy(], [OVS_DEFINE([HAVE_SKB_ZEROCOPY])]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [l4_rxhash]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_ensure_writable]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_vlan_pop]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_vlan_push]) OVS_GREP_IFELSE([$KSRC/include/linux/types.h], [bool], [OVS_DEFINE([HAVE_BOOL_TYPE])]) @@ -314,33 +390,55 @@ OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_replace4]) OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_unfold]) + OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genl_has_listeners]) + OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [mcgrp_offset]) OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [parallel_ops]) OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genlmsg_new_unicast]) + OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [netlink_has_listeners(net->genl_sock], + [OVS_DEFINE([HAVE_GENL_HAS_LISTENERS_TAKES_NET])]) + OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genlmsg_parse]) + OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genl_notify.*family], + [OVS_DEFINE([HAVE_GENL_NOTIFY_TAKES_FAMILY])]) + + OVS_FIND_FIELD_IFELSE([$KSRC/include/net/genetlink.h], + [genl_multicast_group], [id]) + OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [gre_cisco_register]) - OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [gre_handle_offloads]) - OVS_GREP_IFELSE([$KSRC/include/net/ip_tunnels.h], [iptunnel_xmit.*net], - [OVS_DEFINE([HAVE_IPTUNNEL_XMIT_NET])]) OVS_GREP_IFELSE([$KSRC/include/net/ipv6.h], [IP6_FH_F_SKIP_RH]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_get_be16]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be16]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be32]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be64]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_find_nested]) - OVS_GREP_IFELSE([$KSRC/include/net/vxlan.h], [vxlan_xmit_skb]) + OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_is_last]) OVS_GREP_IFELSE([$KSRC/include/net/sctp/checksum.h], [sctp_compute_cksum]) OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD], [OVS_DEFINE([HAVE_VLAN_BUG_WORKAROUND])]) + OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_insert_tag_set_proto]) + OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [__vlan_insert_tag]) - OVS_GREP_IFELSE([$KSRC/include/linux/percpu.h], [this_cpu_ptr]) OVS_GREP_IFELSE([$KSRC/include/linux/u64_stats_sync.h], [u64_stats_fetch_begin_irq]) OVS_GREP_IFELSE([$KSRC/include/linux/openvswitch.h], [openvswitch_handle_frame_hook], [OVS_DEFINE([HAVE_RHEL_OVS_HOOK])]) - - OVS_CHECK_LOG2_H + OVS_GREP_IFELSE([$KSRC/include/net/vxlan.h], [struct vxlan_metadata], + [OVS_DEFINE([HAVE_VXLAN_METADATA])]) + OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [udp_flow_src_port], + [OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [inet_get_local_port_range(net], + [OVS_DEFINE([HAVE_UDP_FLOW_SRC_PORT])])]) + OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [udp_v4_check]) + OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [udp_set_csum]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [ignore_df:1], + [OVS_DEFINE([HAVE_IGNORE_DF_RENAME])]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [SKB_GSO_GRE_CSUM], + [OVS_DEFINE([HAVE_SKB_GSO_GRE_CSUM])]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [SKB_GSO_UDP_TUNNEL_CSUM], + [OVS_DEFINE([HAVE_SKB_GSO_UDP_TUNNEL_CSUM])]) + OVS_GREP_IFELSE([$KSRC/include/uapi/linux/netdevice.h], [NET_NAME_UNKNOWN], + [OVS_DEFINE([HAVE_NET_NAME_UNKNOWN])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then @@ -392,7 +490,13 @@ [AC_LANG_PROGRAM([#include #include ], - [[char string[] = ":::"; + [[#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 + /* Assume bug is present, because relatively minor + changes in compiler settings (e.g. optimization + level) can make it crop up. */ + return 1; + #else + char string[] = ":::"; char *save_ptr = (char *) 0xc0ffee; char *token1, *token2; token1 = strtok_r(string, ":", &save_ptr); @@ -400,6 +504,7 @@ freopen ("/dev/null", "w", stdout); printf ("%s %s\n", token1, token2); return 0; + #endif ]])], [ovs_cv_strtok_r_bug=no], [ovs_cv_strtok_r_bug=yes], @@ -418,15 +523,23 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([_OVS_CHECK_CC_OPTION], [dnl - m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-], [_])])dnl + m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-=], [__])])dnl AC_CACHE_CHECK([whether $CC accepts $1], [ovs_cv_name], [ovs_save_CFLAGS="$CFLAGS" dnl Include -Werror in the compiler options, because without -Werror dnl clang's GCC-compatible compiler driver does not return a failure dnl exit status even though it complains about options it does not dnl understand. + dnl + dnl Also, check stderr as gcc exits with status 0 for options + dnl rejected at getopt level. + dnl % touch /tmp/a.c + dnl % gcc -g -c -Werror -Qunused-arguments /tmp/a.c; echo $? + dnl gcc: unrecognized option '-Qunused-arguments' + dnl 0 + dnl % CFLAGS="$CFLAGS $WERROR $1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], [ovs_cv_name[]=yes], [ovs_cv_name[]=no]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], [if test -s conftest.err && grep "unrecognized option" conftest.err; then ovs_cv_name[]=no; else ovs_cv_name[]=yes; fi], [ovs_cv_name[]=no]) CFLAGS="$ovs_save_CFLAGS"]) if test $ovs_cv_name = yes; then m4_if([$2], [], [:], [$2]) diff -Nru openvswitch-2.3.1/aclocal.m4 openvswitch-2.4.0~git20150623/aclocal.m4 --- openvswitch-2.3.1/aclocal.m4 2014-12-04 05:59:41.000000000 +0000 +++ openvswitch-2.4.0~git20150623/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,1024 +0,0 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) - -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 9 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 10 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 5 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 16 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) - -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# (`yes' being less verbose, `no' or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], -[ --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0')]) -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([m4/absolute-header.m4]) -m4_include([m4/ax_check_openssl.m4]) -m4_include([m4/ax_func_posix_memalign.m4]) -m4_include([m4/include_next.m4]) -m4_include([m4/libtool.m4]) -m4_include([m4/ltoptions.m4]) -m4_include([m4/ltsugar.m4]) -m4_include([m4/ltversion.m4]) -m4_include([m4/lt~obsolete.m4]) -m4_include([m4/openvswitch.m4]) -m4_include([acinclude.m4]) diff -Nru openvswitch-2.3.1/appveyor.yml openvswitch-2.4.0~git20150623/appveyor.yml --- openvswitch-2.3.1/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/appveyor.yml 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,43 @@ +version: 1.0.{build} +branches: + only: + - master +clone_folder: C:\openvswitch +init: +- ps: >- + mkdir C:\pthreads-win32 + + mkdir C:\ovs-build-downloads + + $source = "ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip" + + $destination = "C:\pthreads-win32\pthreads-win32.zip" + + Invoke-WebRequest $source -OutFile $destination + + $source = "https://slproweb.com/download/Win32OpenSSL-1_0_2a.exe" + + $destination = "C:\ovs-build-downloads\Win32OpenSSL-1_0_2a.exe" + + Invoke-WebRequest $source -OutFile $destination + + cd C:\pthreads-win32 + + 7z x C:\pthreads-win32\pthreads-win32.zip + + cd C:\ovs-build-downloads + + .\Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes + + Start-Sleep -s 30 + + cd C:\openvswitch + +build_script: +- '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd"' +- C:\MinGW\msys\1.0\bin\bash -lc "echo \"C:/MinGW /mingw\" > /etc/fstab" +- C:\MinGW\msys\1.0\bin\bash -lc "cp /c/pthreads-win32/Pre-built.2/dll/x86/*.dll /c/openvswitch/." +- C:\MinGW\msys\1.0\bin\bash -lc "mv /bin/link.exe /bin/link_copy.exe" +- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./boot.sh" +- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./configure CC=build-aux/cccl LD=\"`which link`\" LIBS=\"-lws2_32 -liphlpapi\" --with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 --with-vstudiotarget=\"Debug\"" +- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && make" diff -Nru openvswitch-2.3.1/AUTHORS openvswitch-2.4.0~git20150623/AUTHORS --- openvswitch-2.3.1/AUTHORS 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/AUTHORS 2015-06-23 18:46:21.000000000 +0000 @@ -1,34 +1,43 @@ -The following people, in alphabetical order, have either authored or -signed off on commits in the Open vSwitch version control repository. +The following people authored or signed off on commits in the Open +vSwitch source code or webpage version control repository. Aaron Rosen arosen@clemson.edu Alexandru Copot alex.mihai.c@gmail.com Alexei Starovoitov ast@plumgrid.com -Alexey I. Froloff raorn@altlinux.org +Alexey I. Froloff raorn@raorn.name Alex Wang alexw@nicira.com Alfredo Finelli alf@computationes.de Alin Serdean aserdean@cloudbasesolutions.com +Amit Bose bose@noironetworks.com Andrew Evans aevans@nicira.com +Andrew Kampjes a.kampjes@gmail.com Andrew Lambeth wal@nicira.com Andy Hill hillad@gmail.com Andy Southgate andy.southgate@citrix.com Andy Zhou azhou@nicira.com +Ankur Sharma ankursharma@vmware.com Anoob Soman anoob.soman@citrix.com Ansis Atteka aatteka@nicira.com Anupam Chanda achanda@nicira.com +Ariel Tubaltsev atubaltsev@vmware.com Arun Sharma arun.sharma@calsoftinc.com Aryan TaheriMonfared aryan.taherimonfared@uis.no Ashwin Swaminathan ashwinds@arista.com Ben Pfaff blp@nicira.com +Billy O'Mahony billy.o.mahony@intel.com Brian Kruger bkruger+ovsdev@gmail.com Bruce Davie bsd@nicira.com Bryan Phillippe bp@toroki.com Casey Barker crbarker@google.com +Christoph Jaeger cj@linux.com Chris Wright chrisw@sous-sol.org Chuck Short zulcss@ubuntu.com +Cong Wang amwang@redhat.com Damien Millescamps damien.millescamps@6wind.com Dan Carpenter dan.carpenter@oracle.com +Dan McGregor dan.mcgregor@usask.ca Dan Wendlandt dan@nicira.com +Daniel Borkmann dborkman@redhat.com Daniel Hiltgen daniel@netkine.com Daniel Roman droman@nicira.com Daniele Di Proietto daniele.di.proietto@gmail.com @@ -39,17 +48,24 @@ David S. Miller davem@davemloft.net David Yang davidy@vmware.com Devendra Naga devendra.aaru@gmail.com +Dmitry Krivenok krivenok.dmitry@gmail.com Dominic Curran dominic.curran@citrix.com +Dongdong dongdong1@huawei.com Duffie Cooley dcooley@nicira.com Ed Maste emaste at freebsd.org +Ed Swierk eswierk@skyportsystems.com Edouard Bourguignon madko@linuxed.net Edward Tomasz Napierała trasz@freebsd.org +Eitan Eliahu eliahue@vmware.com +Eohyung Lee liquidnuker@gmail.com +Eric Sesterhenn eric.sesterhenn@lsexperts.de Ethan Jackson ethan@nicira.com Flavio Leitner fbl@redhat.com Francesco Fusco ffusco@redhat.com FUJITA Tomonori fujita.tomonori@lab.ntt.co.jp Gaetano Catalli gaetano.catalli@gmail.com Geoffrey Wossum gwossum@acm.org +Gianluca Merlo gianluca.merlo@gmail.com Giuseppe Lettieri g.lettieri@iet.unipi.it Glen Gibb grg@stanford.edu Guolin Yang gyang@nicira.com @@ -61,6 +77,7 @@ Isaku Yamahata yamahata@valinux.co.jp James P. roampune@gmail.com James Page james.page@ubuntu.com +Jan Vansteenkiste jan@vstone.eu Jarno Rajahalme jrajahalme@nicira.com Jason Kölker jason@koelker.net Jasper Capel jasper@capel.tv @@ -70,64 +87,101 @@ Jing Ai jinga@google.com Joe Perches joe@perches.com Joe Stringer joestringer@nicira.com +Jonathan Vestin jonavest@kau.se Jun Nakajima jun.nakajima@intel.com Justin Pettit jpettit@nicira.com Keith Amidon keith@nicira.com Ken Ajiro ajiro@mxw.nes.nec.co.jp +Kenneth Duda kduda@arista.com +Kentaro Ebisawa ebiken.g@gmail.com +Kevin Lo kevlo@FreeBSD.org +Kevin Traynor kevin.traynor@intel.com Kmindg G kmindg@gmail.com Krishna Kondaka kkondaka@vmware.com -Kyle Mestery kmestery@cisco.com +Kyle Mestery mestery@mestery.com +Lars Kellogg-Stedman lars@redhat.com Leo Alterman lalterman@nicira.com +Lilijun jerry.lilijun@huawei.com Linda Sun lsun@vmware.com Lior Neudorfer lior@guardicore.com Lorand Jakab lojakab@cisco.com Luca Giraudo lgiraudo@nicira.com +Lucian Petrut lpetrut@cloudbasesolutions.com Luigi Rizzo rizzo@iet.unipi.it +Madhu Challa challa@noironetworks.com +Mark D. Gray mark.d.gray@intel.com Mark Hamilton mhamilton@nicira.com +Mark Kavanagh mark.b.kavanagh@intel.com +Mark Maglana mmaglana@gmail.com Martin Casado casado@nicira.com +Martino Fornasa mf@fornasa.it +Maryam Tahhan maryam.tahhan@intel.com Mehak Mahajan mmahajan@nicira.com +Mijo Safradin mijo@linux.vnet.ibm.com Murphy McCauley murphy.mccauley@gmail.com Natasha Gude natasha@nicira.com Neil McKee neil.mckee@inmon.com Neil Zhu zhuj@centecnetworks.com +Nithin Raju nithin@vmware.com Padmanabhan Krishnan kprad1@yahoo.com Paraneetharan Chandrasekaran paraneetharanc@gmail.com Paul Fazzone pfazzone@nicira.com Paul Ingram paul@nicira.com +Paul-Emmanuel Raoul skyper@skyplabs.net Pavithra Ramesh paramesh@vmware.com Philippe Jung phil.jung@free.fr +Pim van den Berg pim@nethuis.nl pritesh pritesh.kothari@cisco.com Pravin B Shelar pshelar@nicira.com Raju Subramanian rsubramanian@nicira.com Rami Rosen ramirose@gmail.com +Randall Sharo andall.sharo@navy.mil Ravi Kerur Ravi.Kerur@telekom.com Reid Price reid@nicira.com Remko Tronçon git@el-tramo.be Rich Lane rlane@bigswitch.com +Rishi Bamba rishi.bamba@tcs.com +Rob Adams readams@readams.net +Robert Åkerblom-Andersson Robert.nr1@gmail.com Rob Hoes rob.hoes@citrix.com Romain Lenglet romain.lenglet@berabera.info +Russell Bryant rbryant@redhat.com +Ryan Wilson wryan@nicira.com Sajjad Lateef slateef@nicira.com +Samuel Ghinet sghinet@cloudbasesolutions.com Sanjay Sane ssane@nicira.com Saurabh Shah ssaurabh@nicira.com +Scott Lowe scott.lowe@scottlowe.org +Scott Mann sdmnix@gmail.com +Selvamuthukumar smkumar@merunetworks.com Shan Wei davidshan@tencent.com Shih-Hao Li shli@nicira.com +Shu Shen shu.shen@radisys.com Simon Horman horms@verge.net.au +Simon Horman simon.horman@netronome.com +Sorin Vinturis svinturis@cloudbasesolutions.com Stephane A. Sezer sas@cd80.net +Stephen Finucane stephen.finucane@intel.com SUGYO Kazushi sugyo.org@gmail.com Tadaaki Nagao nagao@stratosphere.co.jp +Terry Wilson twilson@redhat.com Tetsuo NAKAGAWA nakagawa@mxc.nes.nec.co.jp +Thadeu Lima de Souza Cascardo cascardo@redhat.com +Thomas F. Herbert thomasfherbert@gmail.com Thomas Goirand zigo@debian.org -Thomas Graf tgraf@redhat.com +Thomas Graf tgraf@noironetworks.com Thomas Lacroix thomas.lacroix@citrix.com Todd Deshane deshantm@gmail.com Tom Everman teverman@google.com Tsvi Slonim tsvi@toroki.com +Tuan Nguyen tuan.nguyen@veriksystems.com Tyler Coumbes coumbes@gmail.com Valient Gough vgough@pobox.com Vivien Bernet-Rollande vbr@soprive.net +Wang Sheng-Hui shhuiw@gmail.com Wei Yongjun yjwei@cn.fujitsu.com William Fulton -YAMAMOTO Takashi yamamoto@valinux.co.jp +YAMAMOTO Takashi yamamoto@midokura.com Yasuhito Takamiya yasuhito@gmail.com yinpeijun yinpeijun@huawei.com Yu Zhiguo yuzg@cn.fujitsu.com @@ -153,12 +207,15 @@ André Ruß andre.russ@hybris.com Andreas Beckmann debian@abeckmann.de Andrei Andone andrei.andone@softvision.ro +Andrey Korolyov andrey@xdel.ru Anshuman Manral anshuman.manral@outlook.com Anton Matsiuk anton.matsiuk@gmail.com Anup Khadka khadka.py@gmail.com Anuprem Chalvadi achalvadi@vmware.com Ariel Tubaltsev atubaltsev@vmware.com +Arkajit Ghosh arkajit.ghosh@tcs.com Atzm Watanabe atzm@stratosphere.co.jp +Aurélien Poulain aurepoulain@viacesi.fr Bastian Blank waldi@debian.org Ben Basler bbasler@nicira.com Bob Ball bob.ball@citrix.com @@ -166,23 +223,29 @@ Brandon Heller brandonh@stanford.edu Brendan Kelley bkelley@nicira.com Brent Salisbury brent.salisbury@gmail.com +Brian Field Brian_Field@cable.comcast.com Bryan Fulton bryan@nicira.com Bryan Osoro bosoro@nicira.com Cedric Hobbs cedric@nicira.com Chris Hydon chydon@aristanetworks.com Christian Stigen Larsen cslarsen@gmail.com Christopher Paggen cpaggen@cisco.com +Chunhe Li lichunhe@huawei.com +Ciara Loftus ciara.loftus@intel.com +Daniel Badea daniel.badea@windriver.com Dave Walker DaveWalker@ubuntu.com +David Evans davidjoshuaevans@gmail.com David Palma palma@onesource.pt Derek Cormier derek.cormier@lab.ntt.co.jp Dhaval Badiani dbadiani@vmware.com DK Moon dkmoon@nicira.com -Edwin Chiu echiu@nicira.com +Edwin Chiu echiu@vmware.com Eivind Bulie Haanaes Eric Lopez elopez@nicira.com Frido Roose fr.roose@gmail.com Gaetano Catalli gaetano.catalli@gmail.com George Shuklin amarao@desunote.ru +Gerald Rogers gerald.rogers@intel.com Ghanem Bahri bahri.ghanem@gmail.com Giuseppe de Candia giuseppe.decandia@gmail.com Gordon Good ggood@nicira.com @@ -190,12 +253,15 @@ Gregor Schaffrath grsch@net.t-labs.tu-berlin.de Guolin Yang gyang@vmware.com Gur Stavi gstavi@mrv.com +Hari Sasank Bhamidipalli hbhamidi@cisco.com Hassan Khan hassan.khan@seecs.edu.pk Hector Oron hector.oron@gmail.com +Hemanth Kumar Mantri mantri@nutanix.com Henrik Amren henrik@nicira.com Hiroshi Tanaka htanaka@nicira.com Hiroshi Miyata miyahiro.dazu@gmail.com Hyojoon Kim joonk@gatech.edu +Ian Stokes ian.stokes@intel.com Igor Ganichev iganichev@nicira.com Igor Sever igor@xorops.com Jacob Cherkas jcherkas@nicira.com @@ -213,9 +279,12 @@ John Darrington john@darrington.wattle.id.au John Galgay john@galgay.net John Hurley john.hurley@netronome.com +Keith Holleman hollemanietf@gmail.com +K 華 k940545@hotmail.com Kevin Mancuso kevin.mancuso@rackspace.com Kiran Shanbhog kiran@vmware.com Kirill Kabardin +Kirkland Spector kspector@salesforce.com Koichi Yagishita yagishita.koichi@jrc.co.jp Konstantin Khorenko khorenko@openvz.org Kris zhang zhang.kris@gmail.com @@ -225,9 +294,13 @@ Luca Falavigna dktrkranz@debian.org Luiz Henrique Ozaki luiz.ozaki@gmail.com Marco d'Itri md@Linux.IT +Martin Vizvary vizvary@ics.muni.cz +Marvin Pascual marvin@pascual.com.ph Maxime Brun m.brun@alphalink.fr +Madhu Venugopal mavenugo@gmail.com Michael A. Collins mike.a.collins@ark-net.org Michael Hu mhu@nicira.com +Michael J. Smalley michaeljsmalley@gmail.com Michael Mao mmao@nicira.com Michael Shigorin mike@osdn.org.ua Mihir Gangar gangarm@vmware.com @@ -235,6 +308,7 @@ Mike Kruze mkruze@nicira.com Min Chen ustcer.tonychan@gmail.com Mikael Doverhag mdoverhag@nicira.com +Mrinmoy Das mrdas@ixiacom.com Nagi Reddy Jonnala njonnala@Brocade.com Niels van Adrichem N.L.M.vanAdrichem@tudelft.nl Niklas Andersson nandersson@nicira.com @@ -242,6 +316,7 @@ Pasi Kärkkäinen pasik@iki.fi Paulo Cravero pcravero@as2594.net Pawan Shukla shuklap@vmware.com +Peter Amidon peter@picnicpark.org Peter Balland peter@nicira.com Peter Phaal peter.phaal@inmon.com Prabina Pattnaik Prabina.Pattnaik@nechclst.in @@ -250,10 +325,15 @@ Ram Jothikumar rjothikumar@nicira.com Ramana Reddy gtvrreddy@gmail.com Rob Sherwood rob.sherwood@bigswitch.com +Robert Strickler anomalyst@gmail.com Roger Leigh rleigh@codelibre.net Rogério Vinhal Nunes Roman Sokolkov rsokolkov@gmail.com +Ronaldo A. Ferreira ronaldof@CS.Princeton.EDU +Ronny L. Bull bullrl@clarkson.edu +Sander Eikelenboom linux@eikelenboom.it Saul St. John sstjohn@cs.wisc.edu +Saurabh Shrivastava (सौरभ श्रीवास्तव) saurabh@gmail.com Scott Hendricks shendricks@nicira.com Sean Brady sbrady@gtfservices.com Sebastian Andrzej Siewior sebastian@breakpoint.cc @@ -262,8 +342,10 @@ Spiro Kourtessis spiro@vmware.com Sridhar Samudrala samudrala.sridhar@gmail.com Srini Seetharaman seethara@stanford.edu +Sabyasachi Sengupta Sabyasachi.Sengupta@alcatel-lucent.com +Salvatore Cambria salvatore.cambria@citrix.com +Soner Sevinc sevincs@vmware.com Stephen Hemminger shemminger@vyatta.com -Stephen Finucane stephen.finucane@intel.com Suganya Ramachandran suganyar@vmware.com Takayuki HAMA t-hama@cb.jp.nec.com Teemu Koponen koponen@nicira.com @@ -279,6 +361,9 @@ Yeming Zhao zhaoyeming@gmail.com Ying Chen yingchen@vmware.com Yongqiang Liu liuyq7809@gmail.com +Zhangguanghui zhang.guanghui@h3c.com +Ziyou Wang ziyouw@vmware.com +Zoltán Balogh zoltan.balogh@ericsson.com ankur dwivedi ankurengg2003@gmail.com chen zhang 3zhangchen9211@gmail.com kk yap yapkke@stanford.edu @@ -286,6 +371,7 @@ rahim entezari rahim.entezari@gmail.com 冯全树(Crab) fqs888@126.com 胡靖飞 hujingfei914@msn.com +张伟 zhangwqh@126.com Thanks to all Open vSwitch contributors. If you are not listed above but believe that you should be, please write to dev@openvswitch.org. diff -Nru openvswitch-2.3.1/build-aux/cccl openvswitch-2.4.0~git20150623/build-aux/cccl --- openvswitch-2.3.1/build-aux/cccl 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/cccl 2015-06-23 18:46:21.000000000 +0000 @@ -45,7 +45,7 @@ # We'll assume cl to start out prog=cl # opts specifies the command line to pass to the MSVC program -clopt="${slash}nologo" +clopt="${slash}nologo ${slash}FS" linkopt="${slash}nologo" # gotparam is 0 if we didn't ever see a param, in which case we show usage() gotparam= @@ -89,6 +89,14 @@ linkopt="$linkopt ${slash}DEBUG" ;; + -O0) + clopt="$clopt ${slash}Od ${slash}D_DEBUG" + ;; + + -O2) + clopt="$clopt ${slash}O2" + ;; + -L*) path=`echo "$1" | sed 's/-L//'` linkopt="$linkopt ${slash}LIBPATH:$path" @@ -140,6 +148,14 @@ #ignore warnings ;; + -Q*) + #ignore link warnings + ;; + + -fno-strict-aliasing*) + #ignore aliasing + ;; + -isystem) shift clopt="$clopt -I$1" @@ -190,6 +206,8 @@ opts=$linkopt fi -echo "$prog $opts" +if test x$V = x1 ; then + echo "$prog $opts" +fi exec $prog $opts exit 0 diff -Nru openvswitch-2.3.1/build-aux/check-structs openvswitch-2.4.0~git20150623/build-aux/check-structs --- openvswitch-2.3.1/build-aux/check-structs 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/check-structs 2015-06-23 18:46:21.000000000 +0000 @@ -20,7 +20,7 @@ line = "" idRe = "[a-zA-Z_][a-zA-Z_0-9]*" tokenRe = "#?" + idRe + "|[0-9]+|." -includeRe = re.compile(r'\s*#include\s+"(openflow/[^#]+)"') +includeRe = re.compile(r'\s*#include\s+<(openflow/[^#]+)>') includePath = '' inComment = False inDirective = False diff -Nru openvswitch-2.3.1/build-aux/compile openvswitch-2.4.0~git20150623/build-aux/compile --- openvswitch-2.3.1/build-aux/compile 2014-12-04 05:59:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/compile 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2009-10-06.20; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software -# Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; -esac - -ofile= -cfile= -eat= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we strip `-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use `[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff -Nru openvswitch-2.3.1/build-aux/config.guess openvswitch-2.4.0~git20150623/build-aux/config.guess --- openvswitch-2.3.1/build-aux/config.guess 2014-12-04 05:59:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/config.guess 1970-01-01 00:00:00.000000000 +0000 @@ -1,1517 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. - -timestamp='2011-05-11' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru openvswitch-2.3.1/build-aux/config.sub openvswitch-2.4.0~git20150623/build-aux/config.sub --- openvswitch-2.3.1/build-aux/config.sub 2014-12-04 05:59:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/config.sub 1970-01-01 00:00:00.000000000 +0000 @@ -1,1760 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. - -timestamp='2011-03-23' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 \ - | ns16k | ns32k \ - | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; - tile*) - basic_machine=tile-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru openvswitch-2.3.1/build-aux/depcomp openvswitch-2.4.0~git20150623/build-aux/depcomp --- openvswitch-2.3.1/build-aux/depcomp 2014-12-04 05:59:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/depcomp 1970-01-01 00:00:00.000000000 +0000 @@ -1,630 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" - depmode=msvisualcpp -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" - echo >> "$depfile" - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff -Nru openvswitch-2.3.1/build-aux/dist-docs openvswitch-2.4.0~git20150623/build-aux/dist-docs --- openvswitch-2.3.1/build-aux/dist-docs 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/dist-docs 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,153 @@ +#! /bin/sh + +set -e + +# Check command line. +if test ! -d "$1" || test $# -lt 2; then + cat <&2 "$0: $1 not found in \$PATH, please install and try again" + exit 1 +} +search_path man +search_path markdown +search_path ps2pdf + +# Create dist-docs directory. +distdir=dist-docs +abs_distdir=`pwd`/dist-docs +rm -rf $distdir +mkdir $distdir + +# Install manpages. +make install-man mandir="$abs_distdir"/man +(cd $distdir && mv `find man -type f` . && rm -rf man) +manpages=`cd $distdir && echo *` + +# Start writing index.html. +exec 3>$distdir/index.html +cat >&3 < + + + Open vSwitch $VERSION Documentation + +

Open vSwitch $VERSION Documentation

+

Documents

+ +EOF + +# Add top-level documentation to index.html, giving it .txt extensions so +# that the webserver doesn't serve it as Markdown and make your web browser +# try to invoke some kind of external helper you don't have installed. +# +# Also translate documentation to HTML. +for file +do + title=`head -1 "$srcdir/$file"` + dir=$distdir/`dirname $file`; test -d "$dir" || mkdir "$dir" + cp "$srcdir/$file" "$distdir/$file.txt" + (cat < + + + $file (Open vSwitch $VERSION) + +EOF + markdown "$distdir/$file.txt" + echo "") > "$distdir/$file.html" + cat < + + + + +EOF +done >&3 + +# Add header for manpages to index.html. +cat >&3 < +

Manpages

+
$file$titleHTML, plain text
+EOF + +# Add manpages to index.html, translating them into PDF, HTML, and plain text. +# The HTML is just slightly marked up from the plain text version; although +# groff supports better HTML output, on my system some of the OVS manpages +# cause the groff HTML output engine to segfault (!). +(cd $distdir + for manpage in $manpages; do + man -l -Tps $manpage | ps2pdf - > $manpage.pdf + man -l -Tutf8 $manpage | sed 's/.//g' > $manpage.txt + (echo '
'
+      man -l -Tutf8 $manpage | sed '
+s/&/&/g
+s//>/g
+s,\(.\)\1,\1,g
+s,_\(.\),\1,g'
+      echo '
' + ) > $manpage.html + + name=`echo $manpage | sed 's/\.\([0-9]\)$/(\1)/'` + echo " " + done +) >&3 +cat >&3 < + +EOF + +# Create CSS style file. +cat >$distdir/style.css <<'EOF' +div { vertical-align:top; } +p { + vertical-align:baseline; +} +a { + text-decoration: none; + font-weight: 700; +} +a:hover { + color:#444; +} +a:visited { + color:#447099; +} +a:link { + color:#447099; +} + +body { + font-family: Arial,Helvetica,sans-serif; + font-size: 14px; + line-height: 1.5em; + color: #444; + background-color:#f5f5f5; +} +EOF diff -Nru openvswitch-2.3.1/build-aux/extract-odp-netlink-h openvswitch-2.4.0~git20150623/build-aux/extract-odp-netlink-h --- openvswitch-2.3.1/build-aux/extract-odp-netlink-h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/extract-odp-netlink-h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,42 @@ +# This is a "sed" script that transforms into a +# form that is suitable for inclusion within the Open vSwitch tree on +# both Linux and non-Linux systems. + +# Add a header warning that this is a generated file. It might save somebody +# some frustration (maybe even me!). +1i\ +/* -*- mode: c; buffer-read-only: t -*- */\ +/* Generated automatically from -- do not modify! */\ +\ +\ + + +# Avoid using reserved names in header guards. +s/_LINUX_OPENVSWITCH_H/ODP_NETLINK_H/ + +# Include platform extensions header file on Win32. +$i\ +#ifdef _WIN32\ +#include "OvsDpInterfaceExt.h"\ +#endif\ + + +# Transform most Linux-specific __u types into C99 uint_t types, +# and most Linux-specific __be into Open vSwitch ovs_be, +# and use the appropriate userspace header. +s,,"openvswitch/types.h", +s/__u32/uint32_t/g +s/__u16/uint16_t/g +s/__u8/uint8_t/g +s/__be32/ovs_be32/g +s/__be16/ovs_be16/g + +# Transform 64-bit Linux-specific types into Open vSwitch specialized +# types for 64-bit numbers that might only be aligned on a 32-bit +# boundary. +s/__u64/ovs_32aligned_u64/g +s/__be64/ovs_32aligned_be64/g + +# Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN. +s,,"packets.h", +s/ETH_ALEN/ETH_ADDR_LEN/ diff -Nru openvswitch-2.3.1/build-aux/extract-odp-netlink-windows-dp-h openvswitch-2.4.0~git20150623/build-aux/extract-odp-netlink-windows-dp-h --- openvswitch-2.3.1/build-aux/extract-odp-netlink-windows-dp-h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/extract-odp-netlink-windows-dp-h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,24 @@ +# This is a "sed" script that transforms into a +# form that is suitable for inclusion within the Open vSwitch tree on +# windows system. The transformed header file can be included by windows +# driver modules. + +# Add a header warning that this is a generated file. +1i\ +/* -*- mode: c; buffer-read-only: t -*- */\ +/* Generated automatically from -- do not modify! */\ +\ +\ + +# Avoid using reserved names in header guards. +s/_LINUX_OPENVSWITCH_H/__OVS_DP_INTERFACE_H_/ + +# and use the appropriate userspace header. +s,,"Types.h", + +# Add ETH_ADDR_LEN macro to avoid including userspace packet.h +s,#include ,\n#ifndef ETH_ADDR_LEN \ +#define ETH_ADDR_LEN 6 \n#endif, + +# Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN. +s/ETH_ALEN/ETH_ADDR_LEN/ diff -Nru openvswitch-2.3.1/build-aux/extract-ofp-actions openvswitch-2.4.0~git20150623/build-aux/extract-ofp-actions --- openvswitch-2.3.1/build-aux/extract-ofp-actions 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/extract-ofp-actions 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,377 @@ +#! /usr/bin/python + +import sys +import os.path +import re + +OFP_ACTION_ALIGN = 8 + +# Map from OpenFlow version number to version ID used in ofp_header. +version_map = {"1.0": 0x01, + "1.1": 0x02, + "1.2": 0x03, + "1.3": 0x04, + "1.4": 0x05, + "1.5": 0x06} +version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems()) + +# Map from vendor name to the length of the action header. +vendor_map = {"OF": (0x00000000, 4), + "ONF": (0x4f4e4600, 10), + "NX": (0x00002320, 10)} + +# Basic types used in action arguments. +types = {} +types['uint8_t'] = {"size": 1, "align": 1, "ntoh": None, "hton": None} +types['ovs_be16'] = {"size": 2, "align": 2, "ntoh": "ntohs", "hton": "htons"} +types['ovs_be32'] = {"size": 4, "align": 4, "ntoh": "ntohl", "hton": "htonl"} +types['ovs_be64'] = {"size": 8, "align": 8, "ntoh": "ntohll", "hton": "htonll"} +types['uint16_t'] = {"size": 2, "align": 2, "ntoh": None, "hton": None} +types['uint32_t'] = {"size": 4, "align": 4, "ntoh": None, "hton": None} +types['uint64_t'] = {"size": 8, "align": 8, "ntoh": None, "hton": None} + +line = "" + +arg_structs = set() + +def round_up(x, y): + return (x + (y - 1)) / y * y + +def open_file(fn): + global file_name + global input_file + global line_number + file_name = fn + input_file = open(file_name) + line_number = 0 + +def get_line(): + global input_file + global line + global line_number + line = input_file.readline() + line_number += 1 + if line == "": + fatal("unexpected end of input") + return line + +n_errors = 0 +def error(msg): + global n_errors + sys.stderr.write("%s:%d: %s\n" % (file_name, line_number, msg)) + n_errors += 1 + +def fatal(msg): + error(msg) + sys.exit(1) + +def usage(): + argv0 = os.path.basename(sys.argv[0]) + print ('''\ +%(argv0)s, for extracting OpenFlow action data +usage: %(argv0)s OFP_ACTIONS.C [--prototypes | --definitions] + +This program reads ofp-actions.c to obtain information about OpenFlow +actions. With --prototypes, it outputs on stdout a set of prototypes to +#include early in ofp-actions.c. With --definitions, it outputs on stdout +a set of definitions to #include late in ofp-actions.c + +OFP_ACTIONS.C should point to lib/ofp-actions.c.\ +''' % {"argv0": argv0}) + sys.exit(0) + +def extract_ofp_actions(fn, definitions): + error_types = {} + + comments = [] + names = [] + domain = {} + for code, size in vendor_map.values(): + domain[code] = {} + enums = {} + + n_errors = 0 + + open_file(fn) + + while True: + get_line() + if re.match('enum ofp_raw_action_type {', line): + break + + while True: + get_line() + if line.startswith('/*') or not line or line.isspace(): + continue + elif re.match('}', line): + break + + if not line.lstrip().startswith('/*'): + fatal("unexpected syntax between actions") + + comment = line.lstrip()[2:].strip() + while not comment.endswith('*/'): + get_line() + if line.startswith('/*') or not line or line.isspace(): + fatal("unexpected syntax within action") + comment += ' %s' % line.lstrip('* \t').rstrip(' \t\r\n') + comment = re.sub('\[[^]]*\]', '', comment) + comment = comment[:-2].rstrip() + + m = re.match('([^:]+):\s+(.*)$', comment) + if not m: + fatal("unexpected syntax between actions") + + dsts = m.group(1) + argtype = m.group(2).strip().replace('.', '', 1) + + get_line() + m = re.match(r'\s+(([A-Z]+)_RAW([0-9]*)_([A-Z0-9_]+)),?', line) + if not m: + fatal("syntax error expecting enum value") + + enum = m.group(1) + if enum in names: + fatal("%s specified twice" % enum) + + names.append(enum) + + for dst in dsts.split(', '): + m = re.match(r'([A-Z]+)([0-9.]+)(\+|-[0-9.]+)?(?:\((\d+)\))(?: is deprecated \(([^)]+)\))?$', dst) + if not m: + fatal("%r: syntax error in destination" % dst) + vendor_name = m.group(1) + version1_name = m.group(2) + version2_name = m.group(3) + type_ = int(m.group(4)) + deprecation = m.group(5) + + if vendor_name not in vendor_map: + fatal("%s: unknown vendor" % vendor_name) + vendor = vendor_map[vendor_name][0] + + if version1_name not in version_map: + fatal("%s: unknown OpenFlow version" % version1_name) + v1 = version_map[version1_name] + + if version2_name is None: + v2 = v1 + elif version2_name == "+": + v2 = max(version_map.values()) + elif version2_name[1:] not in version_map: + fatal("%s: unknown OpenFlow version" % version2_name[1:]) + else: + v2 = version_map[version2_name[1:]] + + if v2 < v1: + fatal("%s%s: %s precedes %s" + % (version1_name, version2_name, + version2_name, version1_name)) + + for version in range(v1, v2 + 1): + domain[vendor].setdefault(type_, {}) + if version in domain[vendor][type_]: + v = domain[vendor][type_][version] + msg = "%#x,%d in OF%s means both %s and %s" % ( + vendor, type_, version_reverse_map[version], + v["enum"], enum) + error("%s: %s." % (dst, msg)) + sys.stderr.write("%s:%d: %s: Here is the location " + "of the previous definition.\n" + % (v["file_name"], v["line_number"], + dst)) + n_errors += 1 + else: + header_len = vendor_map[vendor_name][1] + + base_argtype = argtype.replace(', ..', '', 1) + if base_argtype in types: + arg_align = types[base_argtype]['align'] + arg_len = types[base_argtype]['size'] + arg_ofs = round_up(header_len, arg_align) + min_length = round_up(arg_ofs + arg_len, + OFP_ACTION_ALIGN) + elif base_argtype == 'void': + min_length = round_up(header_len, OFP_ACTION_ALIGN) + arg_len = 0 + arg_ofs = 0 + elif re.match(r'struct [a-zA-Z0-9_]+$', base_argtype): + min_length = 'sizeof(%s)' % base_argtype + arg_structs.add(base_argtype) + arg_len = 0 + arg_ofs = 0 + # should also emit OFP_ACTION_ALIGN assertion + else: + fatal("bad argument type %s" % argtype) + + ellipsis = argtype != base_argtype + if ellipsis: + max_length = '65536 - OFP_ACTION_ALIGN' + else: + max_length = min_length + + info = {"enum": enum, # 0 + "deprecation": deprecation, # 1 + "file_name": file_name, # 2 + "line_number": line_number, # 3 + "min_length": min_length, # 4 + "max_length": max_length, # 5 + "arg_ofs": arg_ofs, # 6 + "arg_len": arg_len, # 7 + "base_argtype": base_argtype, # 8 + "version": version, # 9 + "type": type_} # 10 + domain[vendor][type_][version] = info + + enums.setdefault(enum, []) + enums[enum].append(info) + + input_file.close() + + if n_errors: + sys.exit(1) + + print """\ +/* Generated automatically; do not modify! -*- buffer-read-only: t -*- */ +""" + + if definitions: + print "/* Verify that structs used as actions are reasonable sizes. */" + for s in sorted(arg_structs): + print "BUILD_ASSERT_DECL(sizeof(%s) %% OFP_ACTION_ALIGN == 0);" % s + + print "\nstatic struct ofpact_raw_instance all_raw_instances[] = {" + for vendor in domain: + for type_ in domain[vendor]: + for version in domain[vendor][type_]: + d = domain[vendor][type_][version] + print " { { 0x%08x, %2d, 0x%02x }, " % ( + vendor, type_, version) + print " %s," % d["enum"] + print " HMAP_NODE_NULL_INITIALIZER," + print " HMAP_NODE_NULL_INITIALIZER," + print " %s," % d["min_length"] + print " %s," % d["max_length"] + print " %s," % d["arg_ofs"] + print " %s," % d["arg_len"] + print " \"%s\"," % re.sub('_RAW[0-9]*', '', d["enum"], 1) + if d["deprecation"]: + print " \"%s\"," % re.sub(r'(["\\])', r'\\\1', d["deprecation"]) + else: + print " NULL," + print " }," + print "};"; + + for versions in enums.values(): + need_ofp_version = False + for v in versions: + assert v["arg_len"] == versions[0]["arg_len"] + assert v["base_argtype"] == versions[0]["base_argtype"] + if (v["min_length"] != versions[0]["min_length"] or + v["arg_ofs"] != versions[0]["arg_ofs"] or + v["type"] != versions[0]["type"]): + need_ofp_version = True + base_argtype = versions[0]["base_argtype"] + + decl = "static inline " + if base_argtype.startswith('struct'): + decl += "%s *" %base_argtype + else: + decl += "void" + decl += "\nput_%s(struct ofpbuf *openflow" % versions[0]["enum"].replace('_RAW', '', 1) + if need_ofp_version: + decl += ", enum ofp_version version" + if base_argtype != 'void' and not base_argtype.startswith('struct'): + decl += ", %s arg" % base_argtype + decl += ")" + if definitions: + decl += "{\n" + decl += " " + if base_argtype.startswith('struct'): + decl += "return " + decl += "ofpact_put_raw(openflow, " + if need_ofp_version: + decl += "version" + else: + decl += "%s" % versions[0]["version"] + decl += ", %s, " % versions[0]["enum"] + if base_argtype.startswith('struct') or base_argtype == 'void': + decl += "0" + else: + ntoh = types[base_argtype]['ntoh'] + if ntoh: + decl += "%s(arg)" % ntoh + else: + decl += "arg" + decl += ");\n" + decl += "}" + else: + decl += ";" + print decl + print + + if definitions: + print """\ +static enum ofperr +ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, + uint64_t arg, struct ofpbuf *out) +{ + switch (raw) {\ +""" + for versions in enums.values(): + enum = versions[0]["enum"] + print " case %s:" % enum + base_argtype = versions[0]["base_argtype"] + if base_argtype == 'void': + print " return decode_%s(out);" % enum + else: + if base_argtype.startswith('struct'): + arg = "ALIGNED_CAST(const %s *, a)" % base_argtype + else: + hton = types[base_argtype]['hton'] + if hton: + arg = "%s(arg)" % hton + else: + arg = "arg" + print " return decode_%s(%s, out);" % (enum, arg) + print + print """\ + default: + OVS_NOT_REACHED(); + } +}\ +""" + else: + for versions in enums.values(): + enum = versions[0]["enum"] + prototype = "static enum ofperr decode_%s(" % enum + base_argtype = versions[0]["base_argtype"] + if base_argtype != 'void': + if base_argtype.startswith('struct'): + prototype += "const %s *, " % base_argtype + else: + prototype += "%s, " % base_argtype + prototype += "struct ofpbuf *);" + print prototype + + print """ +static enum ofperr ofpact_decode(const struct ofp_action_header *, + enum ofp_raw_action_type raw, + uint64_t arg, struct ofpbuf *out); +""" + +if __name__ == '__main__': + if '--help' in sys.argv: + usage() + elif len(sys.argv) != 3: + sys.stderr.write("exactly two arguments required; " + "use --help for help\n") + sys.exit(1) + elif sys.argv[2] == '--prototypes': + extract_ofp_actions(sys.argv[1], False) + elif sys.argv[2] == '--definitions': + extract_ofp_actions(sys.argv[1], True) + else: + sys.stderr.write("invalid arguments; use --help for help\n") + sys.exit(1) + diff -Nru openvswitch-2.3.1/build-aux/extract-ofp-errors openvswitch-2.4.0~git20150623/build-aux/extract-ofp-errors --- openvswitch-2.3.1/build-aux/extract-ofp-errors 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/extract-ofp-errors 2015-06-23 18:46:21.000000000 +0000 @@ -300,14 +300,34 @@ % (version1_name, version2_name, version2_name, version1_name)) - if vendor == vendor_map['NX']: + if vendor == vendor_map['OF']: + # All standard OpenFlow errors have a type and a code. + if code is None: + fatal("%s: %s domain requires code" % (dst, vendor_name)) + elif vendor == vendor_map['NX']: + # Before OpenFlow 1.2, OVS used a Nicira extension to + # define errors that included a type and a code. + # + # In OpenFlow 1.2 and later, Nicira extension errors + # are defined using the OpenFlow experimenter error + # mechanism that includes a type but not a code. + if v1 < version_map['1.2'] or v2 < version_map['1.2']: + if code is None: + fatal("%s: NX1.0 and NX1.1 domains require code" + % (dst, vendor_name)) if v1 >= version_map['1.2'] or v2 >= version_map['1.2']: if code is not None: fatal("%s: NX1.2+ domains do not have codes" % dst) - code = 0 - elif vendor != vendor_map['OF']: + else: + # Experimenter extension error for OF1.2+ only. + if v1 < version_map['1.2']: + fatal("%s: %s domain not supported before OF1.2" + % (dst, vendor_name)) if code is not None: - fatal("%s: %s domains do not have codes" % vendor_name) + fatal("%s: %s domains do not have codes" + % (dst, vendor_name)) + if code is None: + code = 0 for version in range(v1, v2 + 1): domain[version].setdefault(vendor, {}) @@ -376,8 +396,6 @@ if enum not in map: continue vendor, type_, code = map[enum] - if code is None: - continue value = (vendor << 32) | (type_ << 16) | code if value in found: continue diff -Nru openvswitch-2.3.1/build-aux/extract-ofp-fields openvswitch-2.4.0~git20150623/build-aux/extract-ofp-fields --- openvswitch-2.3.1/build-aux/extract-ofp-fields 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/extract-ofp-fields 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,522 @@ +#! /usr/bin/python + +import sys +import os.path +import re + +line = "" + +# Maps from user-friendly version number to its protocol encoding. +VERSION = {"1.0": 0x01, + "1.1": 0x02, + "1.2": 0x03, + "1.3": 0x04, + "1.4": 0x05, + "1.5": 0x06} + +TYPES = {"u8": 1, + "be16": 2, + "be32": 4, + "MAC": 6, + "be64": 8, + "IPv6": 16} + +FORMATTING = {"decimal": ("MFS_DECIMAL", 1, 8), + "hexadecimal": ("MFS_HEXADECIMAL", 1, 127), + "Ethernet": ("MFS_ETHERNET", 6, 6), + "IPv4": ("MFS_IPV4", 4, 4), + "IPv6": ("MFS_IPV6", 16, 16), + "OpenFlow 1.0 port": ("MFS_OFP_PORT", 2, 2), + "OpenFlow 1.1+ port": ("MFS_OFP_PORT_OXM", 4, 4), + "frag": ("MFS_FRAG", 1, 1), + "tunnel flags": ("MFS_TNL_FLAGS", 2, 2), + "TCP flags": ("MFS_TCP_FLAGS", 2, 2)} + +PREREQS = {"none": "MFP_NONE", + "ARP": "MFP_ARP", + "VLAN VID": "MFP_VLAN_VID", + "IPv4": "MFP_IPV4", + "IPv6": "MFP_IPV6", + "IPv4/IPv6": "MFP_IP_ANY", + "MPLS": "MFP_MPLS", + "TCP": "MFP_TCP", + "UDP": "MFP_UDP", + "SCTP": "MFP_SCTP", + "ICMPv4": "MFP_ICMPV4", + "ICMPv6": "MFP_ICMPV6", + "ND": "MFP_ND", + "ND solicit": "MFP_ND_SOLICIT", + "ND advert": "MFP_ND_ADVERT"} + +# Maps a name prefix into an (experimenter ID, class) pair, so: +# +# - Standard OXM classes are written as (0, ) +# +# - Experimenter OXM classes are written as (, 0xffff) +# +# If a name matches more than one prefix, the longest one is used. +OXM_CLASSES = {"NXM_OF_": (0, 0x0000), + "NXM_NX_": (0, 0x0001), + "OXM_OF_": (0, 0x8000), + "OXM_OF_PKT_REG": (0, 0x8001), + "ONFOXM_ET_": (0x4f4e4600, 0xffff), + + # This is the experimenter OXM class for Nicira, which is the + # one that OVS would be using instead of NXM_OF_ and NXM_NX_ + # if OVS didn't have those grandfathered in. It is currently + # used only to test support for experimenter OXM, since there + # are barely any real uses of experimenter OXM in the wild. + "NXOXM_ET_": (0x00002320, 0xffff)} + + +def oxm_name_to_class(name): + prefix = '' + class_ = None + for p, c in OXM_CLASSES.items(): + if name.startswith(p) and len(p) > len(prefix): + prefix = p + class_ = c + return class_ + + +def decode_version_range(range): + if range in VERSION: + return (VERSION[range], VERSION[range]) + elif range.endswith('+'): + return (VERSION[range[:-1]], max(VERSION.values())) + else: + a, b = re.match(r'^([^-]+)-([^-]+)$', range).groups() + return (VERSION[a], VERSION[b]) + + +def get_line(): + global line + global line_number + line = input_file.readline() + line_number += 1 + if line == "": + fatal("unexpected end of input") + + +n_errors = 0 + + +def error(msg): + global n_errors + sys.stderr.write("%s:%d: %s\n" % (file_name, line_number, msg)) + n_errors += 1 + + +def fatal(msg): + error(msg) + sys.exit(1) + + +def usage(): + argv0 = os.path.basename(sys.argv[0]) + print('''\ +%(argv0)s, for extracting OpenFlow field properties from meta-flow.h +usage: %(argv0)s INPUT [--meta-flow | --nx-match] + where INPUT points to lib/meta-flow.h in the source directory. +Depending on the option given, the output written to stdout is intended to be +saved either as lib/meta-flow.inc or lib/nx-match.inc for the respective C +file to #include.\ +''' % {"argv0": argv0}) + sys.exit(0) + + +def make_sizeof(s): + m = re.match(r'(.*) up to (.*)', s) + if m: + struct, member = m.groups() + return "offsetof(%s, %s)" % (struct, member) + else: + return "sizeof(%s)" % s + + +def parse_oxms(s, prefix, n_bytes): + if s == 'none': + return () + + return tuple(parse_oxm(s2.strip(), prefix, n_bytes) for s2 in s.split(',')) + + +match_types = dict() + + +def parse_oxm(s, prefix, n_bytes): + global match_types + + m = re.match('([A-Z0-9_]+)\(([0-9]+)\) since(?: OF(1\.[0-9]+) and)? v([12]\.[0-9]+)$', s) + if not m: + fatal("%s: syntax error parsing %s" % (s, prefix)) + + name, oxm_type, of_version, ovs_version = m.groups() + + class_ = oxm_name_to_class(name) + if class_ is None: + fatal("unknown OXM class for %s" % name) + oxm_vendor, oxm_class = class_ + + if class_ in match_types: + if oxm_type in match_types[class_]: + fatal("duplicate match type for %s (conflicts with %s)" % + (name, match_types[class_][oxm_type])) + else: + match_types[class_] = dict() + match_types[class_][oxm_type] = name + + # Normally the oxm_length is the size of the field, but for experimenter + # OXMs oxm_length also includes the 4-byte experimenter ID. + oxm_length = n_bytes + if oxm_class == 0xffff: + oxm_length += 4 + + header = ("NXM_HEADER(0x%x,0x%x,%s,0,%d)" + % (oxm_vendor, oxm_class, oxm_type, oxm_length)) + + if of_version: + if of_version not in VERSION: + fatal("%s: unknown OpenFlow version %s" % (name, of_version)) + of_version_nr = VERSION[of_version] + if of_version_nr < VERSION['1.2']: + fatal("%s: claimed version %s predates OXM" % (name, of_version)) + else: + of_version_nr = 0 + + return (header, name, of_version_nr, ovs_version) + + +def parse_field(mff, comment): + f = {'mff': mff} + + # First line of comment is the field name. + m = re.match(r'"([^"]+)"(?:\s+\(aka "([^"]+)"\))?(?:\s+\(.*\))?\.', comment[0]) + if not m: + fatal("%s lacks field name" % mff) + f['name'], f['extra_name'] = m.groups() + + # Find the last blank line the comment. The field definitions + # start after that. + blank = None + for i in range(len(comment)): + if not comment[i]: + blank = i + if not blank: + fatal("%s: missing blank line in comment" % mff) + + d = {} + for key in ("Type", "Maskable", "Formatting", "Prerequisites", + "Access", "Prefix lookup member", + "OXM", "NXM", "OF1.0", "OF1.1"): + d[key] = None + for fline in comment[blank + 1:]: + m = re.match(r'([^:]+):\s+(.*)\.$', fline) + if not m: + fatal("%s: syntax error parsing key-value pair as part of %s" + % (fline, mff)) + key, value = m.groups() + if key not in d: + fatal("%s: unknown key" % key) + elif key == 'Code point': + d[key] += [value] + elif d[key] is not None: + fatal("%s: duplicate key" % key) + d[key] = value + for key, value in d.items(): + if not value and key not in ("OF1.0", "OF1.1", + "Prefix lookup member", "Notes"): + fatal("%s: missing %s" % (mff, key)) + + m = re.match(r'([a-zA-Z0-9]+)(?: \(low ([0-9]+) bits\))?$', d['Type']) + if not m: + fatal("%s: syntax error in type" % mff) + type_ = m.group(1) + if type_ not in TYPES: + fatal("%s: unknown type %s" % (mff, d['Type'])) + f['n_bytes'] = TYPES[type_] + if m.group(2): + f['n_bits'] = int(m.group(2)) + if f['n_bits'] > f['n_bytes'] * 8: + fatal("%s: more bits (%d) than field size (%d)" + % (mff, f['n_bits'], 8 * f['n_bytes'])) + else: + f['n_bits'] = 8 * f['n_bytes'] + + if d['Maskable'] == 'no': + f['mask'] = 'MFM_NONE' + elif d['Maskable'] == 'bitwise': + f['mask'] = 'MFM_FULLY' + else: + fatal("%s: unknown maskable %s" % (mff, d['Maskable'])) + + fmt = FORMATTING.get(d['Formatting']) + if not fmt: + fatal("%s: unknown format %s" % (mff, d['Formatting'])) + if f['n_bytes'] < fmt[1] or f['n_bytes'] > fmt[2]: + fatal("%s: %d-byte field can't be formatted as %s" + % (mff, f['n_bytes'], d['Formatting'])) + f['string'] = fmt[0] + + f['prereqs'] = PREREQS.get(d['Prerequisites']) + if not f['prereqs']: + fatal("%s: unknown prerequisites %s" % (mff, d['Prerequisites'])) + + if d['Access'] == 'read-only': + f['writable'] = False + elif d['Access'] == 'read/write': + f['writable'] = True + else: + fatal("%s: unknown access %s" % (mff, d['Access'])) + + f['OF1.0'] = d['OF1.0'] + if not d['OF1.0'] in (None, 'exact match', 'CIDR mask'): + fatal("%s: unknown OF1.0 match type %s" % (mff, d['OF1.0'])) + + f['OF1.1'] = d['OF1.1'] + if not d['OF1.1'] in (None, 'exact match', 'bitwise mask'): + fatal("%s: unknown OF1.1 match type %s" % (mff, d['OF1.1'])) + + f['OXM'] = (parse_oxms(d['OXM'], 'OXM', f['n_bytes']) + + parse_oxms(d['NXM'], 'NXM', f['n_bytes'])) + + f['prefix'] = d["Prefix lookup member"] + + return f + + +def protocols_to_c(protocols): + if protocols == set(['of10', 'of11', 'oxm']): + return 'OFPUTIL_P_ANY' + elif protocols == set(['of11', 'oxm']): + return 'OFPUTIL_P_NXM_OF11_UP' + elif protocols == set(['oxm']): + return 'OFPUTIL_P_NXM_OXM_ANY' + elif protocols == set([]): + return 'OFPUTIL_P_NONE' + else: + assert False + + +def make_meta_flow(fields): + output = [] + for f in fields: + output += ["{"] + output += [" %s," % f['mff']] + if f['extra_name']: + output += [" \"%s\", \"%s\"," % (f['name'], f['extra_name'])] + else: + output += [" \"%s\", NULL," % f['name']] + output += [" %d, %d," % (f['n_bytes'], f['n_bits'])] + + if f['writable']: + rw = 'true' + else: + rw = 'false' + output += [" %s, %s, %s, %s," + % (f['mask'], f['string'], f['prereqs'], rw)] + + oxm = f['OXM'] + of10 = f['OF1.0'] + of11 = f['OF1.1'] + if f['mff'] in ('MFF_DL_VLAN', 'MFF_DL_VLAN_PCP'): + # MFF_DL_VLAN and MFF_DL_VLAN_PCP don't exactly correspond to + # OF1.1, nor do they have NXM or OXM assignments, but their + # meanings can be expressed in every protocol, which is the goal of + # this member. + protocols = set(["of10", "of11", "oxm"]) + else: + protocols = set([]) + if of10: + protocols |= set(["of10"]) + if of11: + protocols |= set(["of11"]) + if oxm: + protocols |= set(["oxm"]) + + if f['mask'] == 'MFM_FULLY': + cidr_protocols = protocols.copy() + bitwise_protocols = protocols.copy() + + if of10 == 'exact match': + bitwise_protocols -= set(['of10']) + cidr_protocols -= set(['of10']) + elif of10 == 'CIDR mask': + bitwise_protocols -= set(['of10']) + else: + assert of10 is None + + if of11 == 'exact match': + bitwise_protocols -= set(['of11']) + cidr_protocols -= set(['of11']) + else: + assert of11 in (None, 'bitwise mask') + else: + assert f['mask'] == 'MFM_NONE' + cidr_protocols = set([]) + bitwise_protocols = set([]) + + output += [" %s," % protocols_to_c(protocols)] + output += [" %s," % protocols_to_c(cidr_protocols)] + output += [" %s," % protocols_to_c(bitwise_protocols)] + + if f['prefix']: + output += [" FLOW_U32OFS(%s)," % f['prefix']] + else: + output += [" -1, /* not usable for prefix lookup */"] + + output += ["},"] + return output + + +def make_nx_match(fields): + output = [] + print("static struct nxm_field_index all_nxm_fields[] = {") + for f in fields: + # Sort by OpenFlow version number (nx-match.c depends on this). + for oxm in sorted(f['OXM'], key=lambda x: x[2]): + print("""{ .nf = { %s, %d, "%s", %s } },""" % ( + oxm[0], oxm[2], oxm[1], f['mff'])) + print("};") + return output + + +def extract_ofp_fields(mode): + global line + + fields = [] + + while True: + get_line() + if re.match('enum.*mf_field_id', line): + break + + while True: + get_line() + first_line_number = line_number + here = '%s:%d' % (file_name, line_number) + if (line.startswith('/*') + or line.startswith(' *') + or line.startswith('#') + or not line + or line.isspace()): + continue + elif re.match('}', line) or re.match('\s+MFF_N_IDS', line): + break + + # Parse the comment preceding an MFF_ constant into 'comment', + # one line to an array element. + line = line.strip() + if not line.startswith('/*'): + fatal("unexpected syntax between fields") + line = line[1:] + comment = [] + end = False + while not end: + line = line.strip() + if line.startswith('*/'): + get_line() + break + if not line.startswith('*'): + fatal("unexpected syntax within field") + + line = line[1:] + if line.startswith(' '): + line = line[1:] + if line.startswith(' ') and comment: + continuation = True + line = line.lstrip() + else: + continuation = False + + if line.endswith('*/'): + line = line[:-2].rstrip() + end = True + else: + end = False + + if continuation: + comment[-1] += " " + line + else: + comment += [line] + get_line() + + # Drop blank lines at each end of comment. + while comment and not comment[0]: + comment = comment[1:] + while comment and not comment[-1]: + comment = comment[:-1] + + # Parse the MFF_ constant(s). + mffs = [] + while True: + m = re.match('\s+(MFF_[A-Z0-9_]+),?\s?$', line) + if not m: + break + mffs += [m.group(1)] + get_line() + if not mffs: + fatal("unexpected syntax looking for MFF_ constants") + + if len(mffs) > 1 or '' in comment[0]: + for mff in mffs: + # Extract trailing integer. + m = re.match('.*[^0-9]([0-9]+)$', mff) + if not m: + fatal("%s lacks numeric suffix in register group" % mff) + n = m.group(1) + + # Search-and-replace within the comment, + # and drop lines that have for x != n. + instance = [] + for x in comment: + y = x.replace('', n) + if re.search('<[0-9]+>', y): + if ('<%s>' % n) not in y: + continue + y = re.sub('<[0-9]+>', '', y) + instance += [y.strip()] + fields += [parse_field(mff, instance)] + else: + fields += [parse_field(mffs[0], comment)] + continue + + input_file.close() + + if n_errors: + sys.exit(1) + + print("""\ +/* Generated automatically; do not modify! "-*- buffer-read-only: t -*- */ +""") + + if mode == '--meta-flow': + output = make_meta_flow(fields) + elif mode == '--nx-match': + output = make_nx_match(fields) + else: + assert False + + return output + + +if __name__ == '__main__': + if '--help' in sys.argv: + usage() + elif len(sys.argv) != 3: + sys.stderr.write("exactly two arguments required; " + "use --help for help\n") + sys.exit(1) + elif sys.argv[2] in ('--meta-flow', '--nx-match'): + global file_name + global input_file + global line_number + file_name = sys.argv[1] + input_file = open(file_name) + line_number = 0 + + for oline in extract_ofp_fields(sys.argv[2]): + print(oline) + else: + sys.stderr.write("invalid arguments; use --help for help\n") + sys.exit(1) diff -Nru openvswitch-2.3.1/build-aux/extract-ofp-msgs openvswitch-2.4.0~git20150623/build-aux/extract-ofp-msgs --- openvswitch-2.3.1/build-aux/extract-ofp-msgs 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/extract-ofp-msgs 2015-06-23 18:46:21.000000000 +0000 @@ -15,6 +15,7 @@ "1.5": 0x06} NX_VENDOR_ID = 0x00002320 +ONF_VENDOR_ID = 0x4f4e4600 OFPT_VENDOR = 4 OFPT10_STATS_REQUEST = 16 @@ -103,7 +104,7 @@ while not comment.endswith('*/'): get_line() if line.startswith('/*') or not line or line.isspace(): - fatal("unexpected syntax within error") + fatal("unexpected syntax within message") comment += ' %s' % line.lstrip('* \t').rstrip(' \t\r\n') comment = comment[:-2].rstrip() @@ -160,6 +161,22 @@ hdrs = (version, OFPT10_STATS_REPLY, number, 0, 0) else: hdrs = (version, OFPT11_STATS_REPLY, number, 0, 0) + elif type_ == 'ONF': + hdrs = (version, OFPT_VENDOR, 0, ONF_VENDOR_ID, number) + elif type_ == 'ONFST' and name.endswith('_REQUEST'): + if version == VERSION["1.0"]: + hdrs = (version, OFPT10_STATS_REQUEST, OFPST_VENDOR, + ONF_VENDOR_ID, number) + else: + hdrs = (version, OFPT11_STATS_REQUEST, OFPST_VENDOR, + ONF_VENDOR_ID, number) + elif type_ == 'ONFST' and name.endswith('_REPLY'): + if version == VERSION["1.0"]: + hdrs = (version, OFPT10_STATS_REPLY, OFPST_VENDOR, + ONF_VENDOR_ID, number) + else: + hdrs = (version, OFPT11_STATS_REPLY, OFPST_VENDOR, + ONF_VENDOR_ID, number) elif type_ == 'NXT': hdrs = (version, OFPT_VENDOR, 0, NX_VENDOR_ID, number) elif type_ == 'NXST' and name.endswith('_REQUEST'): @@ -339,7 +356,7 @@ if '--help' in sys.argv: usage() elif len(sys.argv) != 3: - sys.stderr.write("exactly one non-option arguments required; " + sys.stderr.write("exactly two non-option arguments required; " "use --help for help\n") sys.exit(1) else: diff -Nru openvswitch-2.3.1/build-aux/.gitignore openvswitch-2.4.0~git20150623/build-aux/.gitignore --- openvswitch-2.3.1/build-aux/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,7 @@ +/compile +/config.guess +/config.sub +/depcomp +/install-sh +/ltmain.sh +/missing diff -Nru openvswitch-2.3.1/build-aux/install-sh openvswitch-2.4.0~git20150623/build-aux/install-sh --- openvswitch-2.3.1/build-aux/install-sh 2014-12-04 05:59:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/install-sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff -Nru openvswitch-2.3.1/build-aux/ltmain.sh openvswitch-2.4.0~git20150623/build-aux/ltmain.sh --- openvswitch-2.3.1/build-aux/ltmain.sh 2014-12-04 05:59:39.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/ltmain.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,9642 +0,0 @@ - -# libtool (GNU libtool) 2.4 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 Debian-2.4-2ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . - -PROGRAM=libtool -PACKAGE=libtool -VERSION="2.4 Debian-2.4-2ubuntu1" -TIMESTAMP="" -package_revision=1.3293 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation - -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation - - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation - - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} - - - - -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - func_append verstring ":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" - else - odir="$dir/$objdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" - - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case "$opt_mode" in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$opt_mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff -Nru openvswitch-2.3.1/build-aux/missing openvswitch-2.4.0~git20150623/build-aux/missing --- openvswitch-2.3.1/build-aux/missing 2014-12-04 05:59:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/missing 1970-01-01 00:00:00.000000000 +0000 @@ -1,376 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; - - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff -Nru openvswitch-2.3.1/build-aux/xml2nroff openvswitch-2.4.0~git20150623/build-aux/xml2nroff --- openvswitch-2.3.1/build-aux/xml2nroff 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/build-aux/xml2nroff 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,123 @@ +#! /usr/bin/python + +# Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from datetime import date +import getopt +import os +import sys +import xml.dom.minidom + +from build.nroff import * + +argv0 = sys.argv[0] + +def usage(): + print """\ +%(argv0)s: XML to nroff converter +Converts the XML format supplied as input into an nroff-formatted manpage. +usage: %(argv0)s [OPTIONS] INPUT.XML +where INPUT.XML is a manpage in an OVS-specific XML format. + +The following options are also available: + --version=VERSION use VERSION to display on document footer + -h, --help display this help message\ +""" % {'argv0': argv0} + sys.exit(0) + +def manpage_to_nroff(xml_file, version=None): + doc = xml.dom.minidom.parse(xml_file).documentElement + d = date.fromtimestamp(os.stat(xml_file).st_mtime) + + if version == None: + version = "UNKNOWN" + program = doc.attributes['program'].nodeValue + title = doc.attributes['title'].nodeValue + section = doc.attributes['section'].nodeValue + + # Putting '\" p as the first line tells "man" that the manpage + # needs to be preprocessed by "pic". + s = r''''\" p +.\" -*- nroff -*- +.TH "%s" %s "%s" "Open vSwitch %s" "Open vSwitch Manual" +.fp 5 L CR \\" Make fixed-width font available as \\fL. +.de TQ +. br +. ns +. TP "\\$1" +.. +.de ST +. PP +. RS -0.15in +. I "\\$1" +. RE +.. +''' % (textToNroff(program), textToNroff(section), textToNroff(title), textToNroff(version)) + + s += blockXmlToNroff(doc.childNodes) + "\n" + + return s + +def usage(): + print """\ +%(argv0)s: converts XML in a somewhat HTML-like format to nroff +usage: %(argv0)s [OPTIONS] XML +where XML is documentation in a somewhat HTML-like XML format. +The manpage, in nroff "man" format, is output on stdout. + +The following options are also available: + --version=VERSION use VERSION to display on document footer + -h, --help display this help message\ +""" % {'argv0': argv0} + sys.exit(0) + +if __name__ == "__main__": + try: + options, args = getopt.gnu_getopt(sys.argv[1:], 'hV', + ['version=', 'help']) + except getopt.GetoptError, geo: + sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) + sys.exit(1) + + er_diagram = None + title = None + version = None + for key, value in options: + if key == '--version': + version = value + elif key in ['-h', '--help']: + usage() + else: + sys.exit(0) + + if len(args) != 1: + sys.stderr.write("%s: exactly 1 non-option arguments required " + "(use --help for help)\n" % argv0) + sys.exit(1) + + try: + s = manpage_to_nroff(args[0], version) + except error.Error, e: + sys.stderr.write("%s: %s\n" % (argv0, e.msg)) + sys.exit(1) + for line in s.splitlines(): + line = line.strip() + if line: + print line + + +# Local variables: +# mode: python +# End: diff -Nru openvswitch-2.3.1/BUILD.Windows openvswitch-2.4.0~git20150623/BUILD.Windows --- openvswitch-2.3.1/BUILD.Windows 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/BUILD.Windows 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -Open vSwitch support on Windows is a work in progress. This file describes -the planned build system to compile Open vSwitch on Windows. Once the work -is complete, this file will be replaced by a INSTALL.Windows file. - -Autoconf, Automake and Visual C++: ---------------------------------- -Open vSwitch on Linux uses autoconf and automake for generating Makefiles. -It will be useful to maintain the same build system while compiling on Windows -too. One approach is to compile Open vSwitch in a MinGW environment that -contains autoconf and automake utilities and then use Visual C++ as a compiler -and linker. - -The following explains the steps in some detail. -* Install Mingw on a Windows machine by following the instructions at: -http://www.mingw.org/wiki/Getting_Started - -This should install mingw at C:\Mingw and msys at C:\Mingw\msys. -Add "C:\MinGW\bin" and "C:\Mingw\msys\1.0\bin" to PATH environment variable -of Windows. - -You can either use the MinGW installer or the command line utility 'mingw-get' -to install both the base packages and additional packages like automake and -autoconf(version 2.68). - -* Install the latest Python 2.x from python.org and verify that its path is -part of Windows' PATH environment variable. - -* It is important to get the Visual Studio related environment variables and -to have the $PATH inside the bash to point to the proper compiler and linker. -One easy way to achieve this is to get into the "Developer Command prompt for -visual studio" and through it enter into the bash shell available from msys. - -If after the above step, a 'which link' inside MSYS's bash says, -"/bin/link.exe", rename /bin/link.exe to something else so that the -Visual studio's linker is used. - -* For pthread support, install the library, dll and includes of pthreads-win32 -project from -ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release to a -directory (e.g.: C:/pthread). - -* Get the Open vSwitch sources from either cloning the repo using git -or from a distribution tar ball. - -* If you pulled the sources directly from an Open vSwitch Git tree, - run boot.sh in the top source directory: - - % ./boot.sh - -* In the top source directory, configure the package by running the - configure script. You should provide some configure options to choose - the right compiler, linker, libraries, Open vSwitch component installation - directories, etc. For example, - - % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \ - --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \ - --sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread" - -* Run make for the ported executables in the top source directory, e.g.: - - % make lib/vswitch-idl.h lib/vtep-idl.h ofproto/ipfix-entities.def - % make ovsdb/ovsdb-server.exe ovsdb/ovsdb-tool.exe ovsdb/ovsdb-client.exe \ - utilities/ovs-vsctl.exe utilities/ovs-ofctl.exe \ - utilities/ovs-dpctl.exe vswitchd/ovs-vswitchd.exe \ - utilities/ovs-appctl.exe - -OpenSSL, Open vSwitch and Visual C++ ------------------------------------- -To get SSL support for Open vSwitch on Windows, do the following: - -* Install OpenSSL for Windows as suggested at -http://www.openssl.org/related/binaries.html. -The link as of this writing suggests to download it from -http://slproweb.com/products/Win32OpenSSL.html and the latest version is -"Win32 OpenSSL v1.0.1f". - -Note down the directory where OpenSSL is installed (e.g.: C:/OpenSSL-Win32). - -* While configuring the package, specify the OpenSSL directory path. -For example, - - % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32 ..." \ - --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \ - --sysconfdir="C:/openvswitch/etc" --enable-ssl \ - --with-openssl="C:/OpenSSL-Win32" - -* Run make for the ported executables. diff -Nru openvswitch-2.3.1/CodingStyle openvswitch-2.4.0~git20150623/CodingStyle --- openvswitch-2.3.1/CodingStyle 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/CodingStyle 1970-01-01 00:00:00.000000000 +0000 @@ -1,553 +0,0 @@ - Open vSwitch Coding Style - ========================= - -This file describes the coding style used in most C files in the Open -vSwitch distribution. However, Linux kernel code datapath directory -follows the Linux kernel's established coding conventions. - -BASICS - - Limit lines to 79 characters. - - Use form feeds (control+L) to divide long source files into logical -pieces. A form feed should appear as the only character on a line. - - Do not use tabs for indentation. - - Avoid trailing spaces on lines. - - -NAMING - - Use names that explain the purpose of a function or object. - - Use underscores to separate words in an identifier: multi_word_name. - - Use lowercase for most names. Use uppercase for macros, macro -parameters, and members of enumerations. - - Give arrays names that are plural. - - Pick a unique name prefix (ending with an underscore) for each -module, and apply that prefix to all of that module's externally -visible names. Names of macro parameters, struct and union members, -and parameters in function prototypes are not considered externally -visible for this purpose. - - Do not use names that begin with _. If you need a name for -"internal use only", use __ as a suffix instead of a prefix. - - Avoid negative names: "found" is a better name than "not_found". - - In names, a "size" is a count of bytes, a "length" is a count of -characters. A buffer has size, but a string has length. The length -of a string does not include the null terminator, but the size of the -buffer that contains the string does. - - -COMMENTS - - Comments should be written as full sentences that start with a -capital letter and end with a period. Put two spaces between -sentences. - - Write block comments as shown below. You may put the /* and */ on -the same line as comment text if you prefer. - - /* - * We redirect stderr to /dev/null because we often want to remove all - * traffic control configuration on a port so its in a known state. If - * this done when there is no such configuration, tc complains, so we just - * always ignore it. - */ - - Each function and each variable declared outside a function, and -each struct, union, and typedef declaration should be preceded by a -comment. See FUNCTION DEFINITIONS below for function comment -guidelines. - - Each struct and union member should each have an inline comment that -explains its meaning. structs and unions with many members should be -additionally divided into logical groups of members by block comments, -e.g.: - - /* An event that will wake the following call to poll_block(). */ - struct poll_waiter { - /* Set when the waiter is created. */ - struct list node; /* Element in global waiters list. */ - int fd; /* File descriptor. */ - short int events; /* Events to wait for (POLLIN, POLLOUT). */ - poll_fd_func *function; /* Callback function, if any, or null. */ - void *aux; /* Argument to callback function. */ - struct backtrace *backtrace; /* Event that created waiter, or null. */ - - /* Set only when poll_block() is called. */ - struct pollfd *pollfd; /* Pointer to element of the pollfds array - (null if added from a callback). */ - }; - - Use XXX or FIXME comments to mark code that needs work. - - Don't use // comments. - - Don't comment out or #if 0 out code. Just remove it. The code that -was there will still be in version control history. - - -FUNCTIONS - - Put the return type, function name, and the braces that surround the -function's code on separate lines, all starting in column 0. - - Before each function definition, write a comment that describes the -function's purpose, including each parameter, the return value, and -side effects. References to argument names should be given in -single-quotes, e.g. 'arg'. The comment should not include the -function name, nor need it follow any formal structure. The comment -does not need to describe how a function does its work, unless this -information is needed to use the function correctly (this is often -better done with comments *inside* the function). - - Simple static functions do not need a comment. - - Within a file, non-static functions should come first, in the order -that they are declared in the header file, followed by static -functions. Static functions should be in one or more separate pages -(separated by form feed characters) in logical groups. A commonly -useful way to divide groups is by "level", with high-level functions -first, followed by groups of progressively lower-level functions. -This makes it easy for the program's reader to see the top-down -structure by reading from top to bottom. - - All function declarations and definitions should include a -prototype. Empty parentheses, e.g. "int foo();", do not include a -prototype (they state that the function's parameters are unknown); -write "void" in parentheses instead, e.g. "int foo(void);". - - Prototypes for static functions should either all go at the top of -the file, separated into groups by blank lines, or they should appear -at the top of each page of functions. Don't comment individual -prototypes, but a comment on each group of prototypes is often -appropriate. - - In the absence of good reasons for another order, the following -parameter order is preferred. One notable exception is that data -parameters and their corresponding size parameters should be paired. - - 1. The primary object being manipulated, if any (equivalent to the - "this" pointer in C++). - 2. Input-only parameters. - 3. Input/output parameters. - 4. Output-only parameters. - 5. Status parameter. - - Example: - - /* Stores the features supported by 'netdev' into each of '*current', - * '*advertised', '*supported', and '*peer' that are non-null. Each value - * is a bitmap of "enum ofp_port_features" bits, in host byte order. - * Returns 0 if successful, otherwise a positive errno value. On failure, - * all of the passed-in values are set to 0. */ - int - netdev_get_features(struct netdev *netdev, - uint32_t *current, uint32_t *advertised, - uint32_t *supported, uint32_t *peer) - { - ... - } - -Functions that destroy an instance of a dynamically-allocated type -should accept and ignore a null pointer argument. Code that calls -such a function (including the C standard library function free()) -should omit a null-pointer check. We find that this usually makes -code easier to read. - - -FUNCTION PROTOTYPES - - Put the return type and function name on the same line in a function -prototype: - - static const struct option_class *get_option_class(int code); - - - Omit parameter names from function prototypes when the names do not -give useful information, e.g.: - - int netdev_get_mtu(const struct netdev *, int *mtup); - - -STATEMENTS - - Indent each level of code with 4 spaces. Use BSD-style brace -placement: - - if (a()) { - b(); - d(); - } - - Put a space between "if", "while", "for", etc. and the expressions -that follow them. - - Enclose single statements in braces: - - if (a > b) { - return a; - } else { - return b; - } - - Use comments and blank lines to divide long functions into logical -groups of statements. - - Avoid assignments inside "if" and "while" conditions. - - Do not put gratuitous parentheses around the expression in a return -statement, that is, write "return 0;" and not "return(0);" - - Write only one statement per line. - - Indent "switch" statements like this: - - switch (conn->state) { - case S_RECV: - error = run_connection_input(conn); - break; - - case S_PROCESS: - error = 0; - break; - - case S_SEND: - error = run_connection_output(conn); - break; - - default: - OVS_NOT_REACHED(); - } - - "switch" statements with very short, uniform cases may use an -abbreviated style: - - switch (code) { - case 200: return "OK"; - case 201: return "Created"; - case 202: return "Accepted"; - case 204: return "No Content"; - default: return "Unknown"; - } - - Use "for (;;)" to write an infinite loop. - - In an if/else construct where one branch is the "normal" or "common" -case and the other branch is the "uncommon" or "error" case, put the -common case after the "if", not the "else". This is a form of -documentation. It also places the most important code in sequential -order without forcing the reader to visually skip past less important -details. (Some compilers also assume that the "if" branch is the more -common case, so this can be a real form of optimization as well.) - - -RETURN VALUES - - For functions that return a success or failure indication, prefer -one of the following return value conventions: - - * An "int" where 0 indicates success and a positive errno value - indicates a reason for failure. - - * A "bool" where true indicates success and false indicates - failure. - - -MACROS - - Don't define an object-like macro if an enum can be used instead. - - Don't define a function-like macro if a "static inline" function -can be used instead. - - If a macro's definition contains multiple statements, enclose them -with "do { ... } while (0)" to allow them to work properly in all -syntactic circumstances. - - Do use macros to eliminate the need to update different parts of a -single file in parallel, e.g. a list of enums and an array that gives -the name of each enum. For example: - - /* Logging importance levels. */ - #define VLOG_LEVELS \ - VLOG_LEVEL(EMER, LOG_ALERT) \ - VLOG_LEVEL(ERR, LOG_ERR) \ - VLOG_LEVEL(WARN, LOG_WARNING) \ - VLOG_LEVEL(INFO, LOG_NOTICE) \ - VLOG_LEVEL(DBG, LOG_DEBUG) - enum vlog_level { - #define VLOG_LEVEL(NAME, SYSLOG_LEVEL) VLL_##NAME, - VLOG_LEVELS - #undef VLOG_LEVEL - VLL_N_LEVELS - }; - - /* Name for each logging level. */ - static const char *level_names[VLL_N_LEVELS] = { - #define VLOG_LEVEL(NAME, SYSLOG_LEVEL) #NAME, - VLOG_LEVELS - #undef VLOG_LEVEL - }; - - -THREAD SAFETY ANNOTATIONS - - Use the macros in lib/compiler.h to annotate locking requirements. -For example: - - static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; - static struct ovs_rwlock rwlock = OVS_RWLOCK_INITIALIZER; - - void function_require_plain_mutex(void) OVS_REQUIRES(mutex); - void function_require_rwlock(void) OVS_REQ_RDLOCK(rwlock); - - Pass lock objects, not their addresses, to the annotation macros. -(Thus we have OVS_REQUIRES(mutex) above, not OVS_REQUIRES(&mutex).) - - -SOURCE FILES - - Each source file should state its license in a comment at the very -top, followed by a comment explaining the purpose of the code that is -in that file. The comment should explain how the code in the file -relates to code in other files. The goal is to allow a programmer to -quickly figure out where a given module fits into the larger system. - - The first non-comment line in a .c source file should be: - - #include - -#include directives should appear in the following order: - - 1. #include - - 2. The module's own headers, if any. Including this before any - other header (besides ) ensures that the module's - header file is self-contained (see HEADER FILES) below. - - 3. Standard C library headers and other system headers, preferably - in alphabetical order. (Occasionally one encounters a set of - system headers that must be included in a particular order, in - which case that order must take precedence.) - - 4. Open vSwitch headers, in alphabetical order. Use "", not <>, - to specify Open vSwitch header names. - - -HEADER FILES - - Each header file should start with its license, as described under -SOURCE FILES above, followed by a "header guard" to make the header -file idempotent, like so: - - #ifndef NETDEV_H - #define NETDEV_H 1 - - ... - - #endif /* netdev.h */ - - Header files should be self-contained; that is, they should #include -whatever additional headers are required, without requiring the client -to #include them for it. - - Don't define the members of a struct or union in a header file, -unless client code is actually intended to access them directly or if -the definition is otherwise actually needed (e.g. inline functions -defined in the header need them). - - Similarly, don't #include a header file just for the declaration of -a struct or union tag (e.g. just for "struct ;"). Just declare -the tag yourself. This reduces the number of header file -dependencies. - - -TYPES - - Use typedefs sparingly. Code is clearer if the actual type is -visible at the point of declaration. Do not, in general, declare a -typedef for a struct, union, or enum. Do not declare a typedef for a -pointer type, because this can be very confusing to the reader. - - A function type is a good use for a typedef because it can clarify -code. The type should be a function type, not a pointer-to-function -type. That way, the typedef name can be used to declare function -prototypes. (It cannot be used for function definitions, because that -is explicitly prohibited by C89 and C99.) - - You may assume that "char" is exactly 8 bits and that "int" and -"long" are at least 32 bits. - - Don't assume that "long" is big enough to hold a pointer. If you -need to cast a pointer to an integer, use "intptr_t" or "uintptr_t" -from . - - Use the int_t and uint_t types from for exact-width -integer types. Use the PRId, PRIu, and PRIx macros from - for formatting them with printf() and related functions. - - For compatibility with antique printf() implementations: - - - Instead of "%zu", use "%"PRIuSIZE. - - - Instead of "%td", use "%"PRIdPTR. - - - Instead of "%ju", use "%"PRIuMAX. - -Other variants exist for different radixes. For example, use -"%"PRIxSIZE instead of "%zx" or "%x" instead of "%hhx". - - Also, instead of "%hhd", use "%d". Be cautious substituting "%u", -"%x", and "%o" for the corresponding versions with "hh": cast the -argument to unsigned char if necessary, because printf("%hhu", -1) -prints 255 but printf("%u", -1) prints 4294967295. - - Use bit-fields sparingly. Do not use bit-fields for layout of -network protocol fields or in other circumstances where the exact -format is important. - - Declare bit-fields to be type "unsigned int" or "signed int". Do -*not* declare bit-fields of type "int": C89 allows these to be either -signed or unsigned according to the compiler's whim. (A 1-bit -bit-field of type "int" may have a range of -1...0!) Do not declare -bit-fields of type _Bool or enum or any other type, because these are -not portable. - - Try to order structure members such that they pack well on a system -with 2-byte "short", 4-byte "int", and 4- or 8-byte "long" and pointer -types. Prefer clear organization over size optimization unless you -are convinced there is a size or speed benefit. - - Pointer declarators bind to the variable name, not the type name. -Write "int *x", not "int* x" and definitely not "int * x". - - -EXPRESSIONS - - Put one space on each side of infix binary and ternary operators: - - * / % - + - - << >> - < <= > >= - == != - & - ^ - | - && - || - ?: - = += -= *= /= %= &= ^= |= <<= >>= - - Avoid comma operators. - - Do not put any white space around postfix, prefix, or grouping -operators: - - () [] -> . - ! ~ ++ -- + - * & - -Exception 1: Put a space after (but not before) the "sizeof" keyword. -Exception 2: Put a space between the () used in a cast and the -expression whose type is cast: (void *) 0. - - Break long lines before the ternary operators ? and :, rather than -after them, e.g. - - return (out_port != VIGP_CONTROL_PATH - ? alpheus_output_port(dp, skb, out_port) - : alpheus_output_control(dp, skb, fwd_save_skb(skb), - VIGR_ACTION)); - - - Do not parenthesize the operands of && and || unless operator -precedence makes it necessary, or unless the operands are themselves -expressions that use && and ||. Thus: - - if (!isdigit((unsigned char)s[0]) - || !isdigit((unsigned char)s[1]) - || !isdigit((unsigned char)s[2])) { - printf("string %s does not start with 3-digit code\n", s); - } - -but - - if (rule && (!best || rule->priority > best->priority)) { - best = rule; - } - - Do parenthesize a subexpression that must be split across more than -one line, e.g.: - - *idxp = ((l1_idx << PORT_ARRAY_L1_SHIFT) - | (l2_idx << PORT_ARRAY_L2_SHIFT) - | (l3_idx << PORT_ARRAY_L3_SHIFT)); - - Try to avoid casts. Don't cast the return value of malloc(). - - The "sizeof" operator is unique among C operators in that it accepts -two very different kinds of operands: an expression or a type. In -general, prefer to specify an expression, e.g. "int *x = -xmalloc(sizeof *x);". When the operand of sizeof is an expression, -there is no need to parenthesize that operand, and please don't. - - Use the ARRAY_SIZE macro from lib/util.h to calculate the number of -elements in an array. - - When using a relational operator like "<" or "==", put an expression -or variable argument on the left and a constant argument on the -right, e.g. "x == 0", *not* "0 == x". - - -BLANK LINES - - Put one blank line between top-level definitions of functions and -global variables. - - -C DIALECT - - Some C99 features are OK because they are widely implemented: - - * Flexible array members (e.g. struct { int foo[]; }). - - * "static inline" functions (but no other forms of "inline", for - which GCC and C99 have differing interpretations). - - * "long long" - - * and . - - * bool and , but don't assume that bool or _Bool can - only take on the values 0 or 1, because this behavior can't be - simulated on C89 compilers. - - * Designated initializers (e.g. "struct foo foo = {.a = 1};" and - "int a[] = {[2] = 5};"). - - Don't use other C99 features that are not widely implemented in -older compilers: - - * Don't mix declarations and code within a block. - - * Don't use declarations in iteration statements (e.g. don't write - "for (int i = 0; i < 10; i++)"). - - * Don't put a trailing comma in an enum declaration (e.g. don't - write "enum { x = 1, };"). - - As a matter of style, avoid // comments. - - Avoid using GCC or Clang extensions unless you also add a fallback -for other compilers. You can, however, use C99 features or GCC -extensions also supported by Clang in code that compiles only on -GNU/Linux (such as lib/netdev-linux.c), because GCC is the system -compiler there. diff -Nru openvswitch-2.3.1/CodingStyle.md openvswitch-2.4.0~git20150623/CodingStyle.md --- openvswitch-2.3.1/CodingStyle.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/CodingStyle.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,578 @@ +Open vSwitch Coding Style +========================= + +This file describes the coding style used in most C files in the Open +vSwitch distribution. However, Linux kernel code datapath directory +follows the Linux kernel's established coding conventions. For the +Windows kernel datapath code, use the coding style described in +datapath-windows/CodingStyle. + +The following GNU indent options approximate this style: + + -npro -bad -bap -bbb -br -blf -brs -cdw -ce -fca -cli0 -npcs -i4 -l79 \ + -lc79 -nbfda -nut -saf -sai -saw -sbi4 -sc -sob -st -ncdb -pi4 -cs -bs \ + -di1 -lp -il0 -hnl + + +## BASICS + + Limit lines to 79 characters. + + Use form feeds (control+L) to divide long source files into logical +pieces. A form feed should appear as the only character on a line. + + Do not use tabs for indentation. + + Avoid trailing spaces on lines. + + +## NAMING + + - Use names that explain the purpose of a function or object. + + - Use underscores to separate words in an identifier: multi_word_name. + + - Use lowercase for most names. Use uppercase for macros, macro + parameters, and members of enumerations. + + - Give arrays names that are plural. + + - Pick a unique name prefix (ending with an underscore) for each + module, and apply that prefix to all of that module's externally + visible names. Names of macro parameters, struct and union members, + and parameters in function prototypes are not considered externally + visible for this purpose. + + - Do not use names that begin with _. If you need a name for + "internal use only", use __ as a suffix instead of a prefix. + + - Avoid negative names: "found" is a better name than "not_found". + + - In names, a "size" is a count of bytes, a "length" is a count of + characters. A buffer has size, but a string has length. The length + of a string does not include the null terminator, but the size of the + buffer that contains the string does. + + +## COMMENTS + + Comments should be written as full sentences that start with a +capital letter and end with a period. Put two spaces between +sentences. + + Write block comments as shown below. You may put the /* and */ on +the same line as comment text if you prefer. + + /* + * We redirect stderr to /dev/null because we often want to remove all + * traffic control configuration on a port so its in a known state. If + * this done when there is no such configuration, tc complains, so we just + * always ignore it. + */ + + Each function and each variable declared outside a function, and +each struct, union, and typedef declaration should be preceded by a +comment. See FUNCTION DEFINITIONS below for function comment +guidelines. + + Each struct and union member should each have an inline comment that +explains its meaning. structs and unions with many members should be +additionally divided into logical groups of members by block comments, +e.g.: + + /* An event that will wake the following call to poll_block(). */ + struct poll_waiter { + /* Set when the waiter is created. */ + struct ovs_list node; /* Element in global waiters list. */ + int fd; /* File descriptor. */ + short int events; /* Events to wait for (POLLIN, POLLOUT). */ + poll_fd_func *function; /* Callback function, if any, or null. */ + void *aux; /* Argument to callback function. */ + struct backtrace *backtrace; /* Event that created waiter, or null. */ + + /* Set only when poll_block() is called. */ + struct pollfd *pollfd; /* Pointer to element of the pollfds array + (null if added from a callback). */ + }; + + Use XXX or FIXME comments to mark code that needs work. + + Don't use `//` comments. + + Don't comment out or #if 0 out code. Just remove it. The code that +was there will still be in version control history. + + +## FUNCTIONS + + Put the return type, function name, and the braces that surround the +function's code on separate lines, all starting in column 0. + + Before each function definition, write a comment that describes the +function's purpose, including each parameter, the return value, and +side effects. References to argument names should be given in +single-quotes, e.g. 'arg'. The comment should not include the +function name, nor need it follow any formal structure. The comment +does not need to describe how a function does its work, unless this +information is needed to use the function correctly (this is often +better done with comments *inside* the function). + + Simple static functions do not need a comment. + + Within a file, non-static functions should come first, in the order +that they are declared in the header file, followed by static +functions. Static functions should be in one or more separate pages +(separated by form feed characters) in logical groups. A commonly +useful way to divide groups is by "level", with high-level functions +first, followed by groups of progressively lower-level functions. +This makes it easy for the program's reader to see the top-down +structure by reading from top to bottom. + + All function declarations and definitions should include a +prototype. Empty parentheses, e.g. "int foo();", do not include a +prototype (they state that the function's parameters are unknown); +write "void" in parentheses instead, e.g. "int foo(void);". + + Prototypes for static functions should either all go at the top of +the file, separated into groups by blank lines, or they should appear +at the top of each page of functions. Don't comment individual +prototypes, but a comment on each group of prototypes is often +appropriate. + + In the absence of good reasons for another order, the following +parameter order is preferred. One notable exception is that data +parameters and their corresponding size parameters should be paired. + + 1. The primary object being manipulated, if any (equivalent to the + "this" pointer in C++). + 2. Input-only parameters. + 3. Input/output parameters. + 4. Output-only parameters. + 5. Status parameter. + + Example: + + ``` + /* Stores the features supported by 'netdev' into each of '*current', + * '*advertised', '*supported', and '*peer' that are non-null. Each value + * is a bitmap of "enum ofp_port_features" bits, in host byte order. + * Returns 0 if successful, otherwise a positive errno value. On failure, + * all of the passed-in values are set to 0. */ + int + netdev_get_features(struct netdev *netdev, + uint32_t *current, uint32_t *advertised, + uint32_t *supported, uint32_t *peer) + { + ... + } + ``` + +Functions that destroy an instance of a dynamically-allocated type +should accept and ignore a null pointer argument. Code that calls +such a function (including the C standard library function free()) +should omit a null-pointer check. We find that this usually makes +code easier to read. + +Functions in .c files should not normally be marked "inline", because +it does not usually help code generation and it does suppress +compilers warnings about unused functions. (Functions defined in .h +usually should be marked inline.) + + +## FUNCTION PROTOTYPES + + Put the return type and function name on the same line in a function +prototype: + + static const struct option_class *get_option_class(int code); + + + Omit parameter names from function prototypes when the names do not +give useful information, e.g.: + + int netdev_get_mtu(const struct netdev *, int *mtup); + + +## STATEMENTS + + Indent each level of code with 4 spaces. Use BSD-style brace +placement: + + if (a()) { + b(); + d(); + } + + Put a space between "if", "while", "for", etc. and the expressions +that follow them. + + Enclose single statements in braces: + + if (a > b) { + return a; + } else { + return b; + } + + Use comments and blank lines to divide long functions into logical +groups of statements. + + Avoid assignments inside "if" and "while" conditions. + + Do not put gratuitous parentheses around the expression in a return +statement, that is, write "return 0;" and not "return(0);" + + Write only one statement per line. + + Indent "switch" statements like this: + + switch (conn->state) { + case S_RECV: + error = run_connection_input(conn); + break; + + case S_PROCESS: + error = 0; + break; + + case S_SEND: + error = run_connection_output(conn); + break; + + default: + OVS_NOT_REACHED(); + } + + "switch" statements with very short, uniform cases may use an +abbreviated style: + + switch (code) { + case 200: return "OK"; + case 201: return "Created"; + case 202: return "Accepted"; + case 204: return "No Content"; + default: return "Unknown"; + } + + Use "for (;;)" to write an infinite loop. + + In an if/else construct where one branch is the "normal" or "common" +case and the other branch is the "uncommon" or "error" case, put the +common case after the "if", not the "else". This is a form of +documentation. It also places the most important code in sequential +order without forcing the reader to visually skip past less important +details. (Some compilers also assume that the "if" branch is the more +common case, so this can be a real form of optimization as well.) + + +## RETURN VALUES + + For functions that return a success or failure indication, prefer +one of the following return value conventions: + +* An "int" where 0 indicates success and a positive errno value + indicates a reason for failure. + +* A "bool" where true indicates success and false indicates + failure. + + +## MACROS + + Don't define an object-like macro if an enum can be used instead. + + Don't define a function-like macro if a "static inline" function +can be used instead. + + If a macro's definition contains multiple statements, enclose them +with "do { ... } while (0)" to allow them to work properly in all +syntactic circumstances. + + Do use macros to eliminate the need to update different parts of a +single file in parallel, e.g. a list of enums and an array that gives +the name of each enum. For example: + + /* Logging importance levels. */ + #define VLOG_LEVELS \ + VLOG_LEVEL(EMER, LOG_ALERT) \ + VLOG_LEVEL(ERR, LOG_ERR) \ + VLOG_LEVEL(WARN, LOG_WARNING) \ + VLOG_LEVEL(INFO, LOG_NOTICE) \ + VLOG_LEVEL(DBG, LOG_DEBUG) + enum vlog_level { + #define VLOG_LEVEL(NAME, SYSLOG_LEVEL) VLL_##NAME, + VLOG_LEVELS + #undef VLOG_LEVEL + VLL_N_LEVELS + }; + + /* Name for each logging level. */ + static const char *level_names[VLL_N_LEVELS] = { + #define VLOG_LEVEL(NAME, SYSLOG_LEVEL) #NAME, + VLOG_LEVELS + #undef VLOG_LEVEL + }; + + +## THREAD SAFETY ANNOTATIONS + + Use the macros in lib/compiler.h to annotate locking requirements. +For example: + + static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; + static struct ovs_rwlock rwlock = OVS_RWLOCK_INITIALIZER; + + void function_require_plain_mutex(void) OVS_REQUIRES(mutex); + void function_require_rwlock(void) OVS_REQ_RDLOCK(rwlock); + + Pass lock objects, not their addresses, to the annotation macros. +(Thus we have OVS_REQUIRES(mutex) above, not OVS_REQUIRES(&mutex).) + + +## SOURCE FILES + + Each source file should state its license in a comment at the very +top, followed by a comment explaining the purpose of the code that is +in that file. The comment should explain how the code in the file +relates to code in other files. The goal is to allow a programmer to +quickly figure out where a given module fits into the larger system. + + The first non-comment line in a .c source file should be: + + #include + +`#include` directives should appear in the following order: + +1. `#include ` + +2. The module's own headers, if any. Including this before any + other header (besides ) ensures that the module's + header file is self-contained (see HEADER FILES) below. + +3. Standard C library headers and other system headers, preferably + in alphabetical order. (Occasionally one encounters a set of + system headers that must be included in a particular order, in + which case that order must take precedence.) + +4. Open vSwitch headers, in alphabetical order. Use "", not <>, + to specify Open vSwitch header names. + + +## HEADER FILES + + Each header file should start with its license, as described under +SOURCE FILES above, followed by a "header guard" to make the header +file idempotent, like so: + + #ifndef NETDEV_H + #define NETDEV_H 1 + + ... + + #endif /* netdev.h */ + + Header files should be self-contained; that is, they should #include +whatever additional headers are required, without requiring the client +to #include them for it. + + Don't define the members of a struct or union in a header file, +unless client code is actually intended to access them directly or if +the definition is otherwise actually needed (e.g. inline functions +defined in the header need them). + + Similarly, don't #include a header file just for the declaration of +a struct or union tag (e.g. just for "struct ;"). Just declare +the tag yourself. This reduces the number of header file +dependencies. + + +## TYPES + + Use typedefs sparingly. Code is clearer if the actual type is +visible at the point of declaration. Do not, in general, declare a +typedef for a struct, union, or enum. Do not declare a typedef for a +pointer type, because this can be very confusing to the reader. + + A function type is a good use for a typedef because it can clarify +code. The type should be a function type, not a pointer-to-function +type. That way, the typedef name can be used to declare function +prototypes. (It cannot be used for function definitions, because that +is explicitly prohibited by C89 and C99.) + + You may assume that "char" is exactly 8 bits and that "int" and +"long" are at least 32 bits. + + Don't assume that "long" is big enough to hold a pointer. If you +need to cast a pointer to an integer, use "intptr_t" or "uintptr_t" +from . + + Use the int_t and uint_t types from for exact-width +integer types. Use the PRId, PRIu, and PRIx macros from + for formatting them with printf() and related functions. + + For compatibility with antique printf() implementations: + + - Instead of "%zu", use "%"PRIuSIZE. + + - Instead of "%td", use "%"PRIdPTR. + + - Instead of "%ju", use "%"PRIuMAX. + +Other variants exist for different radixes. For example, use +"%"PRIxSIZE instead of "%zx" or "%x" instead of "%hhx". + + Also, instead of "%hhd", use "%d". Be cautious substituting "%u", +"%x", and "%o" for the corresponding versions with "hh": cast the +argument to unsigned char if necessary, because printf("%hhu", -1) +prints 255 but printf("%u", -1) prints 4294967295. + + Use bit-fields sparingly. Do not use bit-fields for layout of +network protocol fields or in other circumstances where the exact +format is important. + + Declare bit-fields to be signed or unsigned integer types or _Bool +(aka bool). Do *not* declare bit-fields of type "int": C99 allows +these to be either signed or unsigned according to the compiler's +whim. (A 1-bit bit-field of type "int" may have a range of -1...0!) + + Try to order structure members such that they pack well on a system +with 2-byte "short", 4-byte "int", and 4- or 8-byte "long" and pointer +types. Prefer clear organization over size optimization unless you +are convinced there is a size or speed benefit. + + Pointer declarators bind to the variable name, not the type name. +Write "int *x", not "int* x" and definitely not "int * x". + + +## EXPRESSIONS + + Put one space on each side of infix binary and ternary operators: + + * / % + + - + << >> + < <= > >= + == != + & + ^ + | + && + || + ?: + = += -= *= /= %= &= ^= |= <<= >>= + + Avoid comma operators. + + Do not put any white space around postfix, prefix, or grouping +operators: + + () [] -> . + ! ~ ++ -- + - * & + +Exception 1: Put a space after (but not before) the "sizeof" keyword. +Exception 2: Put a space between the () used in a cast and the +expression whose type is cast: (void *) 0. + + Break long lines before the ternary operators ? and :, rather than +after them, e.g. + + return (out_port != VIGP_CONTROL_PATH + ? alpheus_output_port(dp, skb, out_port) + : alpheus_output_control(dp, skb, fwd_save_skb(skb), + VIGR_ACTION)); + + + Do not parenthesize the operands of && and || unless operator +precedence makes it necessary, or unless the operands are themselves +expressions that use && and ||. Thus: + + if (!isdigit((unsigned char)s[0]) + || !isdigit((unsigned char)s[1]) + || !isdigit((unsigned char)s[2])) { + printf("string %s does not start with 3-digit code\n", s); + } + +but + + if (rule && (!best || rule->priority > best->priority)) { + best = rule; + } + + Do parenthesize a subexpression that must be split across more than +one line, e.g.: + + *idxp = ((l1_idx << PORT_ARRAY_L1_SHIFT) + | (l2_idx << PORT_ARRAY_L2_SHIFT) + | (l3_idx << PORT_ARRAY_L3_SHIFT)); + + Try to avoid casts. Don't cast the return value of malloc(). + + The "sizeof" operator is unique among C operators in that it accepts +two very different kinds of operands: an expression or a type. In +general, prefer to specify an expression, e.g. "int *x = +xmalloc(sizeof *x);". When the operand of sizeof is an expression, +there is no need to parenthesize that operand, and please don't. + + Use the ARRAY_SIZE macro from lib/util.h to calculate the number of +elements in an array. + + When using a relational operator like "<" or "==", put an expression +or variable argument on the left and a constant argument on the +right, e.g. "x == 0", *not* "0 == x". + + +## BLANK LINES + + Put one blank line between top-level definitions of functions and +global variables. + + +## C DIALECT + + Most C99 features are OK because they are widely implemented: + + * Flexible array members (e.g. struct { int foo[]; }). + + * "static inline" functions (but no other forms of "inline", for + which GCC and C99 have differing interpretations). + + * "long long" + + * and . + + * bool and , but don't assume that bool or _Bool can + only take on the values 0 or 1, because this behavior can't be + simulated on C89 compilers. + Also, don't assume that a conversion to bool or _Bool follows + C99 semantics. I.e. use "(bool)(some_value != 0)" rather than + "(bool)some_value". The latter might produce unexpected results + on non-C99 environments. For example, if bool is implemented as + a typedef of char and some_value = 0x10000000. + + * Designated initializers (e.g. "struct foo foo = {.a = 1};" and + "int a[] = {[2] = 5};"). + + * Mixing of declarations and code within a block. Please use this + judiciously; keep declarations nicely grouped together in the + beginning of a block if possible. + + * Use of declarations in iteration statements (e.g. + "for (int i = 0; i < 10; i++)"). + + * Use of a trailing comma in an enum declaration (e.g. + "enum { x = 1, };"). + + As a matter of style, avoid // comments. + + Avoid using GCC or Clang extensions unless you also add a fallback +for other compilers. You can, however, use C99 features or GCC +extensions also supported by Clang in code that compiles only on +GNU/Linux (such as lib/netdev-linux.c), because GCC is the system +compiler there. + +## PYTHON + +When introducing new Python code, try to follow Python's +[PEP 8](http://www.python.org/dev/peps/pep-0008/) style. +Consider running the `pep8` or `flake8` tool against your +code to find issues. diff -Nru openvswitch-2.3.1/config.h.in openvswitch-2.4.0~git20150623/config.h.in --- openvswitch-2.3.1/config.h.in 2014-12-04 05:59:42.000000000 +0000 +++ openvswitch-2.4.0~git20150623/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,264 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - -/* If the C compiler is GCC 4.7 or later, define to the return value of - __atomic_always_lock_free(1, 0). If the C compiler is not GCC or is an - older version of GCC, the value does not matter. */ -#undef ATOMIC_ALWAYS_LOCK_FREE_1B - -/* If the C compiler is GCC 4.7 or later, define to the return value of - __atomic_always_lock_free(2, 0). If the C compiler is not GCC or is an - older version of GCC, the value does not matter. */ -#undef ATOMIC_ALWAYS_LOCK_FREE_2B - -/* If the C compiler is GCC 4.7 or later, define to the return value of - __atomic_always_lock_free(4, 0). If the C compiler is not GCC or is an - older version of GCC, the value does not matter. */ -#undef ATOMIC_ALWAYS_LOCK_FREE_4B - -/* If the C compiler is GCC 4.7 or later, define to the return value of - __atomic_always_lock_free(8, 0). If the C compiler is not GCC or is an - older version of GCC, the value does not matter. */ -#undef ATOMIC_ALWAYS_LOCK_FREE_8B - -/* System uses the DPDK module. */ -#undef DPDK_NETDEV - -/* Define to 1 if building on ESX. */ -#undef ESX - -/* Define to 1 if you have backtrace(3). */ -#undef HAVE_BACKTRACE - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR_R - -/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you - don't. */ -#undef HAVE_DECL_SYS_SIGLIST - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if the C compiler and linker supports the GCC 4.0+ atomic - built-ins. */ -#undef HAVE_GCC4_ATOMICS - -/* Define to 1 if you have the `getloadavg' function. */ -#undef HAVE_GETLOADAVG - -/* Define to 1 if you have the `getmntent_r' function. */ -#undef HAVE_GETMNTENT_R - -/* Define to 1 if pthread_setname_np() is available and takes 2 parameters - (like glibc). */ -#undef HAVE_GLIBC_PTHREAD_SETNAME_NP - -/* Define to 1 if net/if_dl.h is available. */ -#undef HAVE_IF_DL - -/* Define to 1 if net/if_packet.h is available. */ -#undef HAVE_IF_PACKET - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IF_ETHER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_TYPES_H - -/* Define to 1 if you have __malloc_hook, __realloc_hook, and __free_hook in - . */ -#undef HAVE_MALLOC_HOOKS - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mlockall' function. */ -#undef HAVE_MLOCKALL - -/* Define to 1 if you have the header file. */ -#undef HAVE_MNTENT_H - -/* Define to 1 if pthread_setname_np() is available and takes 3 parameters - (like NetBSD). */ -#undef HAVE_NETBSD_PTHREAD_SETNAME_NP - -/* Define to 1 if Netlink protocol is available. */ -#undef HAVE_NETLINK - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_MIB_H - -/* Define to 1 if OpenSSL is installed. */ -#undef HAVE_OPENSSL - -/* Define to 1 if `posix_memalign' works. */ -#undef HAVE_POSIX_MEMALIGN - -/* Define to 1 if you have the `pthread_set_name_np' function. */ -#undef HAVE_PTHREAD_SET_NAME_NP - -/* Define to 1 if you have the `statvfs' function. */ -#undef HAVE_STATVFS - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDATOMIC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strnlen' function. */ -#undef HAVE_STRNLEN - -/* Define if strtok_r macro segfaults on some inputs */ -#undef HAVE_STRTOK_R_BUG - -/* Define to 1 if `ifr_flagshigh' is a member of `struct ifreq'. */ -#undef HAVE_STRUCT_IFREQ_IFR_FLAGSHIGH - -/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_MTIMENSEC - -/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STATVFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if the C compiler and linker supports the C11 thread_local - matcro defined in . */ -#undef HAVE_THREAD_LOCAL - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_VALGRIND_H - -/* Define to 1 if the C compiler and linker supports the GCC __thread - extenions. */ -#undef HAVE___THREAD - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if strerror_r returns char *. */ -#undef STRERROR_R_CHAR_P - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if building on WIN32. */ -#undef WIN32 - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - -#ifdef WIN32 -#include "include/windows/windefs.h" -#endif diff -Nru openvswitch-2.3.1/configure openvswitch-2.4.0~git20150623/configure --- openvswitch-2.3.1/configure 2014-12-04 05:59:42.000000000 +0000 +++ openvswitch-2.4.0~git20150623/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,19740 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for openvswitch 2.3.1. -# -# Report bugs to . -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: bugs@openvswitch.org about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='openvswitch' -PACKAGE_TARNAME='openvswitch' -PACKAGE_VERSION='2.3.1' -PACKAGE_STRING='openvswitch 2.3.1' -PACKAGE_BUGREPORT='bugs@openvswitch.org' -PACKAGE_URL='' - -ac_unique_file="datapath/datapath.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_header_list= -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -DPDK_NETDEV_FALSE -DPDK_NETDEV_TRUE -LINUX_ENABLED_FALSE -LINUX_ENABLED_TRUE -KBUILD -KARCH -SPARSE -CGCCFLAGS -SPARSEFLAGS -HAVE_WNO_UNUSED_PARAMETER_FALSE -HAVE_WNO_UNUSED_PARAMETER_TRUE -HAVE_WNO_UNUSED_FALSE -HAVE_WNO_UNUSED_TRUE -WARNING_FLAGS -NEXT_AS_FIRST_DIRECTIVE_STRING_H -NEXT_STRING_H -NEXT_AS_FIRST_DIRECTIVE_STDIO_H -NEXT_STDIO_H -PRAGMA_COLUMNS -PRAGMA_SYSTEM_HEADER -INCLUDE_NEXT_AS_FIRST_DIRECTIVE -INCLUDE_NEXT -LINUX_FALSE -LINUX_TRUE -HAVE_POSIX_AIO_FALSE -HAVE_POSIX_AIO_TRUE -GNU_MAKE_FALSE -GNU_MAKE_TRUE -HAVE_GROFF_FALSE -HAVE_GROFF_TRUE -DBDIR -RUNDIR -PKIDIR -HAVE_IF_DL_FALSE -HAVE_IF_DL_TRUE -HAVE_IF_PACKET_FALSE -HAVE_IF_PACKET_TRUE -HAVE_DOT_FALSE -HAVE_DOT_TRUE -INCLUDE_PYTHON_COMPAT_FALSE -INCLUDE_PYTHON_COMPAT_TRUE -HAVE_PYTHON_FALSE -HAVE_PYTHON_TRUE -PYTHON -HAVE_PYTHON -LOGDIR -HAVE_OPENSSL_FALSE -HAVE_OPENSSL_TRUE -HAVE_OPENSSL -SSL_LDFLAGS -SSL_LIBS -SSL_INCLUDES -PKG_CONFIG -HAVE_NETLINK_FALSE -HAVE_NETLINK_TRUE -NDEBUG_FALSE -NDEBUG_TRUE -PTHREAD_LIBS -PTHREAD_LDFLAGS -PTHREAD_INCLUDES -WIN32_FALSE -WIN32_TRUE -ESX_FALSE -ESX_TRUE -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -DLLTOOL -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -SED -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL -AUTOM4TE -PERL -EGREP -FGREP -GREP -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -SPARSE_EXTRA_INCLUDES' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_dependency_tracking -enable_largefile -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -with_sysroot -enable_libtool_lock -with_pthread -enable_coverage -enable_ndebug -enable_ssl -with_openssl -with_logdir -with_pkidir -with_rundir -with_dbdir -enable_Werror -with_linux -with_linux_source -with_l26 -with_l26_source -with_dpdk -enable_silent_rules -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -PERL -KARCH' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures openvswitch 2.3.1 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/openvswitch] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of openvswitch 2.3.1:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --disable-largefile omit support for large files - --enable-shared[=PKGS] build shared libraries [default=no] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-coverage Enable gcov coverage tool. - --enable-ndebug Disable debugging features for max performance - --disable-ssl Disable OpenSSL support - --enable-Werror Add -Werror to CFLAGS - --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0') - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - --with-pthread=DIR root of the pthread-win32 directory - --with-openssl=DIR root of the OpenSSL directory - --with-logdir=DIR directory used for logs - [[LOCALSTATEDIR/log/PACKAGE]] - --with-pkidir=DIR PKI hierarchy directory - [[LOCALSTATEDIR/lib/openvswitch/pki]] - --with-rundir=DIR directory used for pidfiles - [[LOCALSTATEDIR/run/openvswitch]] - --with-dbdir=DIR directory used for conf.db [[SYSCONFDIR/PACKAGE]] - --with-linux=/path/to/linux - Specify the Linux kernel build directory - --with-linux-source=/path/to/linux-source - Specify the Linux kernel source directory (usually - figured out automatically from build directory) - - --with-dpdk=/path/to/dpdk - Specify the DPDK build directory - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - PERL path to Perl interpreter - KARCH Kernel Architecture String - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -openvswitch configure 2.3.1 -generated by GNU Autoconf 2.68 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------- ## -## Report this to bugs@openvswitch.org ## -## ----------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by openvswitch $as_me 2.3.1, which was -generated by GNU Autoconf 2.68. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -as_fn_append ac_header_list " stdio.h" -as_fn_append ac_header_list " string.h" -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - -ac_aux_dir= -for ac_dir in build-aux "$srcdir"/build-aux; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -ac_config_headers="$ac_config_headers config.h" - -ac_config_commands="$ac_config_commands tests/atconfig" - -am__api_version='1.11' - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='openvswitch' - VERSION='2.3.1' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - - -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" - ;; -esac -fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test "$PERL" = no; then - as_fn_error $? "Perl interpreter not found in $PATH or $PERL." "$LINENO" 5 -fi - - -AUTOM4TE=${AUTOM4TE-"${am_missing_run}autom4te"} - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h - - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - if ac_fn_c_try_compile "$LINENO"; then : - break -fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_largefile_CC=' -n32'; break -fi -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=1; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* - fi -fi - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4' -macro_revision='1.3293' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=no -fi - - - - - - - - - - - enable_dlopen=no - - - enable_win32_dll=no - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - link_all_deplibs=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pow" >&5 -$as_echo_n "checking for library containing pow... " >&6; } -if ${ac_cv_search_pow+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -for ac_lib in '' m; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_pow=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_pow+:} false; then : - break -fi -done -if ${ac_cv_search_pow+:} false; then : - -else - ac_cv_search_pow=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pow" >&5 -$as_echo "$ac_cv_search_pow" >&6; } -ac_res=$ac_cv_search_pow -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (); -int -main () -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : - break -fi -done -if ${ac_cv_search_clock_gettime+:} false; then : - -else - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing timer_create" >&5 -$as_echo_n "checking for library containing timer_create... " >&6; } -if ${ac_cv_search_timer_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char timer_create (); -int -main () -{ -return timer_create (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_timer_create=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_timer_create+:} false; then : - break -fi -done -if ${ac_cv_search_timer_create+:} false; then : - -else - ac_cv_search_timer_create=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_create" >&5 -$as_echo "$ac_cv_search_timer_create" >&6; } -ac_res=$ac_cv_search_timer_create -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_sigmask" >&5 -$as_echo_n "checking for library containing pthread_sigmask... " >&6; } -if ${ac_cv_search_pthread_sigmask+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_sigmask (); -int -main () -{ -return pthread_sigmask (); - ; - return 0; -} -_ACEOF -for ac_lib in '' pthread; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_pthread_sigmask=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_pthread_sigmask+:} false; then : - break -fi -done -if ${ac_cv_search_pthread_sigmask+:} false; then : - -else - ac_cv_search_pthread_sigmask=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_sigmask" >&5 -$as_echo "$ac_cv_search_pthread_sigmask" >&6; } -ac_res=$ac_cv_search_pthread_sigmask -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" -if test "x$ac_cv_have_decl_strerror_r" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R $ac_have_decl -_ACEOF - -for ac_func in strerror_r -do : - ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" -if test "x$ac_cv_func_strerror_r" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_R 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 -$as_echo_n "checking whether strerror_r returns char *... " >&6; } -if ${ac_cv_func_strerror_r_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ac_cv_func_strerror_r_char_p=no - if test $ac_cv_have_decl_strerror_r = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - char *p = strerror_r (0, buf, sizeof buf); - return !p || x; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - return ! isalpha (x); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 -$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } -if test $ac_cv_func_strerror_r_char_p = yes; then - -$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_mongrel "$LINENO" "vmware.h" "ac_cv_header_vmware_h" "$ac_includes_default" -if test "x$ac_cv_header_vmware_h" = xyes; then : - ESX=yes -else - ESX=no -fi - - - if test "$ESX" = yes; then - ESX_TRUE= - ESX_FALSE='#' -else - ESX_TRUE='#' - ESX_FALSE= -fi - - if test "$ESX" = yes; then - -$as_echo "#define ESX 1" >>confdefs.h - - fi -ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" -if test "x$ac_cv_header_windows_h" = xyes; then : - WIN32=yes -else - WIN32=no -fi - - - if test "$WIN32" = yes; then - WIN32_TRUE= - WIN32_FALSE='#' -else - WIN32_TRUE='#' - WIN32_FALSE= -fi - - if test "$WIN32" = yes; then - -# Check whether --with-pthread was given. -if test "${with_pthread+set}" = set; then : - withval=$with_pthread; - case "$withval" in - "" | y | ye | yes | n | no) - as_fn_error $? "Invalid --with-pthread value" "$LINENO" 5 - ;; - *) - PTHREAD_INCLUDES="-I$withval/include" - PTHREAD_LDFLAGS="-L$withval/lib/x86" - PTHREAD_LIBS="-lpthreadVC2" - - - - ;; - esac - -else - - as_fn_error $? "pthread directory not specified" "$LINENO" 5 - - -fi - - -$as_echo "#define WIN32 1" >>confdefs.h - - - fi - - # Check whether --enable-coverage was given. -if test "${enable_coverage+set}" = set; then : - enableval=$enable_coverage; case "${enableval}" in - (yes) coverage=true ;; - (no) coverage=false ;; - (*) as_fn_error $? "bad value ${enableval} for --enable-coverage" "$LINENO" 5 ;; - esac -else - coverage=false -fi - - if $coverage; then - CFLAGS="$CFLAGS -O0 --coverage" - LDFLAGS="$LDFLAGS --coverage" - fi -# Check whether --enable-ndebug was given. -if test "${enable_ndebug+set}" = set; then : - enableval=$enable_ndebug; case "${enableval}" in - (yes) ndebug=true ;; - (no) ndebug=false ;; - (*) as_fn_error $? "bad value ${enableval} for --enable-ndebug" "$LINENO" 5 ;; - esac -else - ndebug=false -fi - - if test x$ndebug = xtrue; then - NDEBUG_TRUE= - NDEBUG_FALSE='#' -else - NDEBUG_TRUE='#' - NDEBUG_FALSE= -fi - -ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_netlink_h" "#include - -" -if test "x$ac_cv_header_linux_netlink_h" = xyes; then : - HAVE_NETLINK=yes -else - HAVE_NETLINK=no -fi - - - if test "$HAVE_NETLINK" = yes; then - HAVE_NETLINK_TRUE= - HAVE_NETLINK_FALSE='#' -else - HAVE_NETLINK_TRUE='#' - HAVE_NETLINK_FALSE= -fi - - if test "$HAVE_NETLINK" = yes; then - -$as_echo "#define HAVE_NETLINK 1" >>confdefs.h - - fi -# Check whether --enable-ssl was given. -if test "${enable_ssl+set}" = set; then : - enableval=$enable_ssl; case "${enableval}" in - (yes) ssl=true ;; - (no) ssl=false ;; - (*) as_fn_error $? "bad value ${enableval} for --enable-ssl" "$LINENO" 5 ;; - esac -else - ssl=check -fi - - - if test "$ssl" != false; then - - found=false - -# Check whether --with-openssl was given. -if test "${with_openssl+set}" = set; then : - withval=$with_openssl; - case "$withval" in - "" | y | ye | yes | n | no) - as_fn_error $? "Invalid --with-openssl value" "$LINENO" 5 - ;; - *) ssldirs="$withval" - ;; - esac - -else - - # if pkg-config is installed and openssl has installed a .pc file, - # then use that information and don't search ssldirs - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test x"$PKG_CONFIG" != x""; then - SSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` - if test $? = 0; then - SSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` - SSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` - found=true - fi - fi - - # no such luck; use some default ssldirs - if ! $found; then - ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" - fi - - -fi - - - - # note that we #include , so the OpenSSL headers have to be in - # an 'openssl' subdirectory - - if ! $found; then - SSL_INCLUDES= - for ssldir in $ssldirs; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 -$as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; } - if test -f "$ssldir/include/openssl/ssl.h"; then - SSL_INCLUDES="-I$ssldir/include" - SSL_LDFLAGS="-L$ssldir/lib" - if test "$WIN32" = "yes"; then - SSL_LIBS="-lssleay32 -llibeay32" - else - SSL_LIBS="-lssl -lcrypto" - fi - found=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - break - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - done - - # if the file wasn't found, well, go ahead and try the link anyway -- maybe - # it will just work! - fi - - # try the preprocessor and linker with our new flags, - # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 -$as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; } - echo "Trying link with SSL_LDFLAGS=$SSL_LDFLAGS;" \ - "SSL_LIBS=$SSL_LIBS; SSL_INCLUDES=$SSL_INCLUDES" >&5 - - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - save_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$LDFLAGS $SSL_LDFLAGS" - LIBS="$SSL_LIBS $LIBS" - CPPFLAGS="$SSL_INCLUDES $CPPFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -SSL_CTX *ctx=NULL;SSL_new(ctx) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_OPENSSL=yes - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - HAVE_OPENSSL=no - if test "$ssl" = check; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find openssl: - -$SSL_PKG_ERRORS - -OpenFlow connections over SSL will not be supported. -(You may use --disable-ssl to suppress this warning.)" >&5 -$as_echo "$as_me: WARNING: Cannot find openssl: - -$SSL_PKG_ERRORS - -OpenFlow connections over SSL will not be supported. -(You may use --disable-ssl to suppress this warning.)" >&2;} - else - as_fn_error $? "Cannot find openssl (use --disable-ssl to configure without SSL support)" "$LINENO" 5 - fi - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - - - - - - else - HAVE_OPENSSL=no - fi - - if test "$HAVE_OPENSSL" = yes; then - HAVE_OPENSSL_TRUE= - HAVE_OPENSSL_FALSE='#' -else - HAVE_OPENSSL_TRUE='#' - HAVE_OPENSSL_FALSE= -fi - - if test "$HAVE_OPENSSL" = yes; then - -$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h - - fi - -# Check whether --with-logdir was given. -if test "${with_logdir+set}" = set; then : - withval=$with_logdir; LOGDIR=$withval -else - LOGDIR='${localstatedir}/log/${PACKAGE}' -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 2.x for x >= 4" >&5 -$as_echo_n "checking for Python 2.x for x >= 4... " >&6; } -if ${ovs_cv_python+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PYTHON"; then - ovs_cv_python=$PYTHON - else - ovs_cv_python=no - for binary in python python2.4 python2.5; do - ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for dir in $PATH; do - IFS=$ovs_save_IFS - test -z "$dir" && dir=. - if test -x "$dir"/"$binary" && "$dir"/"$binary" -c 'import sys -if sys.hexversion >= 0x02040000 and sys.hexversion < 0x03000000: - sys.exit(0) -else: - sys.exit(1)'; then - ovs_cv_python=$dir/$binary - break 2 - fi - done - done - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_python" >&5 -$as_echo "$ovs_cv_python" >&6; } - - -PYTHON=${PYTHON-"${am_missing_run}python"} - - if test $ovs_cv_python != no; then - PYTHON=$ovs_cv_python - HAVE_PYTHON=yes - else - HAVE_PYTHON=no - fi - if test "$HAVE_PYTHON" = yes; then - HAVE_PYTHON_TRUE= - HAVE_PYTHON_FALSE='#' -else - HAVE_PYTHON_TRUE='#' - HAVE_PYTHON_FALSE= -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid Python module" >&5 -$as_echo_n "checking for uuid Python module... " >&6; } -if ${ovs_cv_py_uuid+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_cv_py_uuid=no - if test $HAVE_PYTHON = yes; then - $as_echo "running $PYTHON -c 'import uuid -import sys -sys.exit(0)'..." >&5 2>&1 - if $PYTHON -c 'import uuid -import sys -sys.exit(0)' >&5 2>&1; then - ovs_cv_py_uuid=yes - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_py_uuid" >&5 -$as_echo "$ovs_cv_py_uuid" >&6; } - if test $ovs_cv_py_uuid = yes; then - INCLUDE_PYTHON_COMPAT=no - else - INCLUDE_PYTHON_COMPAT=yes - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add python/compat to PYTHONPATH" >&5 -$as_echo_n "checking whether to add python/compat to PYTHONPATH... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INCLUDE_PYTHON_COMPAT" >&5 -$as_echo "$INCLUDE_PYTHON_COMPAT" >&6; } - if test $INCLUDE_PYTHON_COMPAT = yes; then - INCLUDE_PYTHON_COMPAT_TRUE= - INCLUDE_PYTHON_COMPAT_FALSE='#' -else - INCLUDE_PYTHON_COMPAT_TRUE='#' - INCLUDE_PYTHON_COMPAT_FALSE= -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dot" >&5 -$as_echo_n "checking for dot... " >&6; } -if ${ovs_cv_dot+:} false; then : - $as_echo_n "(cached) " >&6 -else - if (dot -V) 2>&1 | grep '^dot - [gG]raphviz version' >/dev/null 2>&1; then - ovs_cv_dot=yes - else - ovs_cv_dot=no - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_dot" >&5 -$as_echo "$ovs_cv_dot" >&6; } - if test "$ovs_cv_dot" = yes; then - HAVE_DOT_TRUE= - HAVE_DOT_FALSE='#' -else - HAVE_DOT_TRUE='#' - HAVE_DOT_FALSE= -fi - -ac_fn_c_check_header_mongrel "$LINENO" "net/if_packet.h" "ac_cv_header_net_if_packet_h" "$ac_includes_default" -if test "x$ac_cv_header_net_if_packet_h" = xyes; then : - HAVE_IF_PACKET=yes -else - HAVE_IF_PACKET=no -fi - - - if test "$HAVE_IF_PACKET" = yes; then - HAVE_IF_PACKET_TRUE= - HAVE_IF_PACKET_FALSE='#' -else - HAVE_IF_PACKET_TRUE='#' - HAVE_IF_PACKET_FALSE= -fi - - if test "$HAVE_IF_PACKET" = yes; then - -$as_echo "#define HAVE_IF_PACKET 1" >>confdefs.h - - fi -ac_fn_c_check_header_mongrel "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "$ac_includes_default" -if test "x$ac_cv_header_net_if_dl_h" = xyes; then : - HAVE_IF_DL=yes -else - HAVE_IF_DL=no -fi - - - if test "$HAVE_IF_DL" = yes; then - HAVE_IF_DL_TRUE= - HAVE_IF_DL_FALSE='#' -else - HAVE_IF_DL_TRUE='#' - HAVE_IF_DL_FALSE= -fi - - if test "$HAVE_IF_DL" = yes; then - -$as_echo "#define HAVE_IF_DL 1" >>confdefs.h - - - # On these platforms we use libpcap to access network devices. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pcap_open_live" >&5 -$as_echo_n "checking for library containing pcap_open_live... " >&6; } -if ${ac_cv_search_pcap_open_live+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pcap_open_live (); -int -main () -{ -return pcap_open_live (); - ; - return 0; -} -_ACEOF -for ac_lib in '' pcap; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_pcap_open_live=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_pcap_open_live+:} false; then : - break -fi -done -if ${ac_cv_search_pcap_open_live+:} false; then : - -else - ac_cv_search_pcap_open_live=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pcap_open_live" >&5 -$as_echo "$ac_cv_search_pcap_open_live" >&6; } -ac_res=$ac_cv_search_pcap_open_live -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r macro segfaults on some inputs" >&5 -$as_echo_n "checking whether strtok_r macro segfaults on some inputs... " >&6; } -if ${ovs_cv_strtok_r_bug+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ovs_cv_strtok_r_bug=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -char string[] = ":::"; - char *save_ptr = (char *) 0xc0ffee; - char *token1, *token2; - token1 = strtok_r(string, ":", &save_ptr); - token2 = strtok_r(NULL, ":", &save_ptr); - freopen ("/dev/null", "w", stdout); - printf ("%s %s\n", token1, token2); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ovs_cv_strtok_r_bug=no -else - ovs_cv_strtok_r_bug=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_strtok_r_bug" >&5 -$as_echo "$ovs_cv_strtok_r_bug" >&6; } - if test $ovs_cv_strtok_r_bug = yes; then - -$as_echo "#define HAVE_STRTOK_R_BUG 1" >>confdefs.h - - fi - -ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include -" -if test "x$ac_cv_have_decl_sys_siglist" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_SIGLIST $ac_have_decl -_ACEOF - -ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim.tv_nsec" "ac_cv_member_struct_stat_st_mtim_tv_nsec" "#include -" -if test "x$ac_cv_member_struct_stat_st_mtim_tv_nsec" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 -_ACEOF - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimensec" "ac_cv_member_struct_stat_st_mtimensec" "#include -" -if test "x$ac_cv_member_struct_stat_st_mtimensec" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_MTIMENSEC 1 -_ACEOF - - -fi - -ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_flagshigh" "ac_cv_member_struct_ifreq_ifr_flagshigh" "#include -" -if test "x$ac_cv_member_struct_ifreq_ifr_flagshigh" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_IFREQ_IFR_FLAGSHIGH 1 -_ACEOF - - -fi - -for ac_func in mlockall strnlen getloadavg statvfs getmntent_r -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_header in mntent.h sys/statvfs.h linux/types.h linux/if_ether.h stdatomic.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in net/if_mib.h -do : - ac_fn_c_check_header_compile "$LINENO" "net/if_mib.h" "ac_cv_header_net_if_mib_h" "#include -#include -" -if test "x$ac_cv_header_net_if_mib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_IF_MIB_H 1 -_ACEOF - -fi - -done - - - -# Check whether --with-pkidir was given. -if test "${with_pkidir+set}" = set; then : - withval=$with_pkidir; PKIDIR=$withval -else - PKIDIR='${localstatedir}/lib/openvswitch/pki' -fi - - - -# Check whether --with-rundir was given. -if test "${with_rundir+set}" = set; then : - withval=$with_rundir; RUNDIR=$withval -else - RUNDIR='${localstatedir}/run/openvswitch' -fi - - - -# Check whether --with-dbdir was given. -if test "${with_dbdir+set}" = set; then : - withval=$with_dbdir; DBDIR=$withval -else - DBDIR='${sysconfdir}/${PACKAGE}' -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace" >&5 -$as_echo_n "checking for library containing backtrace... " >&6; } -if ${ac_cv_search_backtrace+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char backtrace (); -int -main () -{ -return backtrace (); - ; - return 0; -} -_ACEOF -for ac_lib in '' execinfo ubacktrace; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_backtrace=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_backtrace+:} false; then : - break -fi -done -if ${ac_cv_search_backtrace+:} false; then : - -else - ac_cv_search_backtrace=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace" >&5 -$as_echo "$ac_cv_search_backtrace" >&6; } -ac_res=$ac_cv_search_backtrace -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -$as_echo "#define HAVE_BACKTRACE 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libc supports hooks for malloc and related functions" >&5 -$as_echo_n "checking whether libc supports hooks for malloc and related functions... " >&6; } -if ${ovs_cv_malloc_hooks+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -(void) __malloc_hook; - (void) __realloc_hook; - (void) __free_hook; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv_malloc_hooks=yes -else - ovs_cv_malloc_hooks=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_malloc_hooks" >&5 -$as_echo "$ovs_cv_malloc_hooks" >&6; } - if test $ovs_cv_malloc_hooks = yes; then - -$as_echo "#define HAVE_MALLOC_HOOKS 1" >>confdefs.h - - fi -for ac_header in valgrind/valgrind.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" -if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VALGRIND_VALGRIND_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 -$as_echo_n "checking for connect in -lsocket... " >&6; } -if ${ac_cv_lib_socket_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char connect (); -int -main () -{ -return connect (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_socket_connect=yes -else - ac_cv_lib_socket_connect=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 -$as_echo "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF - - LIBS="-lsocket $LIBS" - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 -$as_echo_n "checking for library containing gethostbyname... " >&6; } -if ${ac_cv_search_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -for ac_lib in '' resolv; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_gethostbyname=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gethostbyname+:} false; then : - break -fi -done -if ${ac_cv_search_gethostbyname+:} false; then : - -else - ac_cv_search_gethostbyname=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 -$as_echo "$ac_cv_search_gethostbyname" >&6; } -ac_res=$ac_cv_search_gethostbyname -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking XenServer release" >&5 -$as_echo_n "checking XenServer release... " >&6; } -if ${ovs_cv_xsversion+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -e /etc/redhat-release; then - ovs_cv_xsversion=`sed -n 's/^XenServer DDK release \([^-]*\)-.*/\1/p' /etc/redhat-release` - fi - if test -z "$ovs_cv_xsversion"; then - ovs_cv_xsversion=none - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_xsversion" >&5 -$as_echo "$ovs_cv_xsversion" >&6; } - case $ovs_cv_xsversion in - none) - ;; - - [1-9][0-9]* | [6-9]* | 5.[7-9]* | 5.6.[1-9][0-9][0-9][0-9]* | 5.6.[2-9][0-9][0-9]* | 5.6.1[0-9][0-9]) ;; - - *) - as_fn_error $? "This appears to be XenServer $ovs_cv_xsversion, but only XenServer 5.6.100 or later is supported. (If you are really using a supported version of XenServer, you may override this error message by specifying 'ovs_cv_xsversion=5.6.100' on the \"configure\" command line.)" "$LINENO" 5 - ;; - esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for groff" >&5 -$as_echo_n "checking for groff... " >&6; } -if ${ovs_cv_groff+:} false; then : - $as_echo_n "(cached) " >&6 -else - if (groff -v) >/dev/null 2>&1; then - ovs_cv_groff=yes - else - ovs_cv_groff=no - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_groff" >&5 -$as_echo "$ovs_cv_groff" >&6; } - if test "$ovs_cv_groff" = yes; then - HAVE_GROFF_TRUE= - HAVE_GROFF_FALSE='#' -else - HAVE_GROFF_TRUE='#' - HAVE_GROFF_FALSE= -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} is GNU make" >&5 -$as_echo_n "checking whether ${MAKE-make} is GNU make... " >&6; } -if ${ovs_cv_gnu_make+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f conftest.out - $as_echo "$as_me:$LINENO: invoking ${MAKE-make} --version:" >&5 2>&1 - ${MAKE-make} --version >conftest.out 2>&1 - cat conftest.out >&5 2>&1 - result=`cat conftest.out` - rm -f conftest.mk conftest.out - - case $result in # ( - GNU*) ovs_cv_gnu_make=yes ;; # ( - *) ovs_cv_gnu_make=no ;; - esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_gnu_make" >&5 -$as_echo "$ovs_cv_gnu_make" >&6; } - if test $ovs_cv_gnu_make = yes; then - GNU_MAKE_TRUE= - GNU_MAKE_FALSE='#' -else - GNU_MAKE_TRUE='#' - GNU_MAKE_FALSE= -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC has that supports thread_local" >&5 -$as_echo_n "checking whether $CC has that supports thread_local... " >&6; } -if ${ovs_cv_thread_local+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -static thread_local int var; -int -main () -{ -return var; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ovs_cv_thread_local=yes -else - ovs_cv_thread_local=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_thread_local" >&5 -$as_echo "$ovs_cv_thread_local" >&6; } - if test $ovs_cv_thread_local = yes; then - -$as_echo "#define HAVE_THREAD_LOCAL 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __thread" >&5 -$as_echo_n "checking whether $CC supports __thread... " >&6; } -if ${ovs_cv___thread+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -static __thread int var; -int -main () -{ -return var; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ovs_cv___thread=yes -else - ovs_cv___thread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv___thread" >&5 -$as_echo "$ovs_cv___thread" >&6; } - if test $ovs_cv___thread = yes; then - -$as_echo "#define HAVE___THREAD 1" >>confdefs.h - - fi - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing __atomic_load_8" >&5 -$as_echo_n "checking for library containing __atomic_load_8... " >&6; } -if ${ac_cv_search___atomic_load_8+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char __atomic_load_8 (); -int -main () -{ -return __atomic_load_8 (); - ; - return 0; -} -_ACEOF -for ac_lib in '' atomic; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search___atomic_load_8=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search___atomic_load_8+:} false; then : - break -fi -done -if ${ac_cv_search___atomic_load_8+:} false; then : - -else - ac_cv_search___atomic_load_8=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search___atomic_load_8" >&5 -$as_echo "$ac_cv_search___atomic_load_8" >&6; } -ac_res=$ac_cv_search___atomic_load_8 -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports GCC 4.0+ atomic built-ins" >&5 -$as_echo_n "checking whether $CC supports GCC 4.0+ atomic built-ins... " >&6; } -if ${ovs_cv_gcc4_atomics+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -#define ovs_assert(expr) if (!(expr)) abort(); -#define TEST_ATOMIC_TYPE(TYPE) \ - { \ - TYPE x = 1; \ - TYPE orig; \ - \ - __sync_synchronize(); \ - ovs_assert(x == 1); \ - \ - __sync_synchronize(); \ - x = 3; \ - __sync_synchronize(); \ - ovs_assert(x == 3); \ - \ - orig = __sync_fetch_and_add(&x, 1); \ - ovs_assert(orig == 3); \ - __sync_synchronize(); \ - ovs_assert(x == 4); \ - \ - orig = __sync_fetch_and_sub(&x, 2); \ - ovs_assert(orig == 4); \ - __sync_synchronize(); \ - ovs_assert(x == 2); \ - \ - orig = __sync_fetch_and_or(&x, 6); \ - ovs_assert(orig == 2); \ - __sync_synchronize(); \ - ovs_assert(x == 6); \ - \ - orig = __sync_fetch_and_and(&x, 10); \ - ovs_assert(orig == 6); \ - __sync_synchronize(); \ - ovs_assert(x == 2); \ - \ - orig = __sync_fetch_and_xor(&x, 10); \ - ovs_assert(orig == 2); \ - __sync_synchronize(); \ - ovs_assert(x == 8); \ - } -int -main () -{ -TEST_ATOMIC_TYPE(char); -TEST_ATOMIC_TYPE(unsigned char); -TEST_ATOMIC_TYPE(signed char); -TEST_ATOMIC_TYPE(short); -TEST_ATOMIC_TYPE(unsigned short); -TEST_ATOMIC_TYPE(int); -TEST_ATOMIC_TYPE(unsigned int); -TEST_ATOMIC_TYPE(long int); -TEST_ATOMIC_TYPE(unsigned long int); -TEST_ATOMIC_TYPE(long long int); -TEST_ATOMIC_TYPE(unsigned long long int); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ovs_cv_gcc4_atomics=yes -else - ovs_cv_gcc4_atomics=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_gcc4_atomics" >&5 -$as_echo "$ovs_cv_gcc4_atomics" >&6; } - if test $ovs_cv_gcc4_atomics = yes; then - -$as_echo "#define HAVE_GCC4_ATOMICS 1" >>confdefs.h - - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of __atomic_always_lock_free(1)" >&5 -$as_echo_n "checking value of __atomic_always_lock_free(1)... " >&6; } -if ${ovs_cv_atomic_always_lock_free_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "__atomic_always_lock_free(1, 0)" "ovs_cv_atomic_always_lock_free_1" ""; then : - -else - ovs_cv_atomic_always_lock_free_1=unsupported -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_atomic_always_lock_free_1" >&5 -$as_echo "$ovs_cv_atomic_always_lock_free_1" >&6; } - if test ovs_cv_atomic_always_lock_free_1 != unsupported; then - -cat >>confdefs.h <<_ACEOF -#define ATOMIC_ALWAYS_LOCK_FREE_1B $ovs_cv_atomic_always_lock_free_1 -_ACEOF - - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of __atomic_always_lock_free(2)" >&5 -$as_echo_n "checking value of __atomic_always_lock_free(2)... " >&6; } -if ${ovs_cv_atomic_always_lock_free_2+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "__atomic_always_lock_free(2, 0)" "ovs_cv_atomic_always_lock_free_2" ""; then : - -else - ovs_cv_atomic_always_lock_free_2=unsupported -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_atomic_always_lock_free_2" >&5 -$as_echo "$ovs_cv_atomic_always_lock_free_2" >&6; } - if test ovs_cv_atomic_always_lock_free_2 != unsupported; then - -cat >>confdefs.h <<_ACEOF -#define ATOMIC_ALWAYS_LOCK_FREE_2B $ovs_cv_atomic_always_lock_free_2 -_ACEOF - - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of __atomic_always_lock_free(4)" >&5 -$as_echo_n "checking value of __atomic_always_lock_free(4)... " >&6; } -if ${ovs_cv_atomic_always_lock_free_4+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "__atomic_always_lock_free(4, 0)" "ovs_cv_atomic_always_lock_free_4" ""; then : - -else - ovs_cv_atomic_always_lock_free_4=unsupported -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_atomic_always_lock_free_4" >&5 -$as_echo "$ovs_cv_atomic_always_lock_free_4" >&6; } - if test ovs_cv_atomic_always_lock_free_4 != unsupported; then - -cat >>confdefs.h <<_ACEOF -#define ATOMIC_ALWAYS_LOCK_FREE_4B $ovs_cv_atomic_always_lock_free_4 -_ACEOF - - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of __atomic_always_lock_free(8)" >&5 -$as_echo_n "checking value of __atomic_always_lock_free(8)... " >&6; } -if ${ovs_cv_atomic_always_lock_free_8+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "__atomic_always_lock_free(8, 0)" "ovs_cv_atomic_always_lock_free_8" ""; then : - -else - ovs_cv_atomic_always_lock_free_8=unsupported -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_atomic_always_lock_free_8" >&5 -$as_echo "$ovs_cv_atomic_always_lock_free_8" >&6; } - if test ovs_cv_atomic_always_lock_free_8 != unsupported; then - -cat >>confdefs.h <<_ACEOF -#define ATOMIC_ALWAYS_LOCK_FREE_8B $ovs_cv_atomic_always_lock_free_8 -_ACEOF - - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing aio_write" >&5 -$as_echo_n "checking for library containing aio_write... " >&6; } -if ${ac_cv_search_aio_write+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char aio_write (); -int -main () -{ -return aio_write (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_aio_write=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_aio_write+:} false; then : - break -fi -done -if ${ac_cv_search_aio_write+:} false; then : - -else - ac_cv_search_aio_write=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_aio_write" >&5 -$as_echo "$ac_cv_search_aio_write" >&6; } -ac_res=$ac_cv_search_aio_write -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - if test "$ac_cv_search_aio_write" != no; then - HAVE_POSIX_AIO_TRUE= - HAVE_POSIX_AIO_FALSE='#' -else - HAVE_POSIX_AIO_TRUE='#' - HAVE_POSIX_AIO_FALSE= -fi - -for ac_func in pthread_set_name_np -do : - ac_fn_c_check_func "$LINENO" "pthread_set_name_np" "ac_cv_func_pthread_set_name_np" -if test "x$ac_cv_func_pthread_set_name_np" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_SET_NAME_NP 1 -_ACEOF - -fi -done - - if test $ac_cv_func_pthread_set_name_np != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np() variant" >&5 -$as_echo_n "checking for pthread_setname_np() variant... " >&6; } -if ${ovs_cv_pthread_setname_np+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -pthread_setname_np(pthread_self(), "name"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ovs_cv_pthread_setname_np=glibc -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -pthread_setname_np(pthread_self(), "%s", "name"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ovs_cv_pthread_setname_np=netbsd -else - ovs_cv_pthread_setname_np=none -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_pthread_setname_np" >&5 -$as_echo "$ovs_cv_pthread_setname_np" >&6; } - case $ovs_cv_pthread_setname_np in # ( - glibc) - -$as_echo "#define HAVE_GLIBC_PTHREAD_SETNAME_NP 1" >>confdefs.h - - ;; # ( - netbsd) - -$as_echo "#define HAVE_NETBSD_PTHREAD_SETNAME_NP 1" >>confdefs.h - - ;; - esac - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __linux__ is defined" >&5 -$as_echo_n "checking whether __linux__ is defined... " >&6; } -if ${ovs_cv_linux+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -enum { LINUX = __linux__}; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv_linux=true -else - ovs_cv_linux=false -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_linux" >&5 -$as_echo "$ovs_cv_linux" >&6; } - if $ovs_cv_linux; then - LINUX_TRUE= - LINUX_FALSE='#' -else - LINUX_TRUE='#' - LINUX_FALSE= -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working posix_memalign" >&5 -$as_echo_n "checking for working posix_memalign... " >&6; } -if ${ax_cv_func_posix_memalign_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ax_cv_func_posix_memalign_works=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include - -int -main () -{ - void *buffer; - - /* Some versions of glibc incorrectly perform the alignment check on - * the size word. */ - exit (posix_memalign (&buffer, sizeof(void *), 123) != 0); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_func_posix_memalign_works=yes -else - ax_cv_func_posix_memalign_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_func_posix_memalign_works" >&5 -$as_echo "$ax_cv_func_posix_memalign_works" >&6; } -if test "$ax_cv_func_posix_memalign_works" = "yes" ; then - -$as_echo "#define HAVE_POSIX_MEMALIGN 1" >>confdefs.h - -fi - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 -$as_echo_n "checking whether the preprocessor supports include_next... " >&6; } -if ${gl_cv_have_include_next+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -rf conftestd1a conftestd1b conftestd2 - mkdir conftestd1a conftestd1b conftestd2 - cat < conftestd1a/conftest.h -#define DEFINED_IN_CONFTESTD1 -#include_next -#ifdef DEFINED_IN_CONFTESTD2 -int foo; -#else -#error "include_next doesn't work" -#endif -EOF - cat < conftestd1b/conftest.h -#define DEFINED_IN_CONFTESTD1 -#include -#include_next -#ifdef DEFINED_IN_CONFTESTD2 -int foo; -#else -#error "include_next doesn't work" -#endif -EOF - cat < conftestd2/conftest.h -#ifndef DEFINED_IN_CONFTESTD1 -#error "include_next test doesn't work" -#endif -#define DEFINED_IN_CONFTESTD2 -EOF - gl_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_have_include_next=yes -else - CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_have_include_next=buggy -else - gl_cv_have_include_next=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$gl_save_CPPFLAGS" - rm -rf conftestd1a conftestd1b conftestd2 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 -$as_echo "$gl_cv_have_include_next" >&6; } - PRAGMA_SYSTEM_HEADER= - if test $gl_cv_have_include_next = yes; then - INCLUDE_NEXT=include_next - INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next - if test -n "$GCC"; then - PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' - fi - else - if test $gl_cv_have_include_next = buggy; then - INCLUDE_NEXT=include - INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next - else - INCLUDE_NEXT=include - INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include - fi - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 -$as_echo_n "checking whether system header files limit the line length... " >&6; } -if ${gl_cv_pragma_columns+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef __TANDEM -choke me -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "choke me" >/dev/null 2>&1; then : - gl_cv_pragma_columns=yes -else - gl_cv_pragma_columns=no -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 -$as_echo "$gl_cv_pragma_columns" >&6; } - if test $gl_cv_pragma_columns = yes; then - PRAGMA_COLUMNS="#pragma COLUMNS 10000" - else - PRAGMA_COLUMNS= - fi - - - - - - - - - - - - - - - - - for ac_header in $ac_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - - - - - - - if test $gl_cv_have_include_next = yes; then - gl_cv_next_stdio_h='<'stdio.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_stdio_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test $ac_cv_header_stdio_h = yes; then - - - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'stdio.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - - gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` - - gl_header=$gl_cv_absolute_stdio_h - gl_cv_next_stdio_h='"'$gl_header'"' - else - gl_cv_next_stdio_h='<'stdio.h'>' - fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 -$as_echo "$gl_cv_next_stdio_h" >&6; } - fi - NEXT_STDIO_H=$gl_cv_next_stdio_h - - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'stdio.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_stdio_h - fi - NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive - - - if test $gl_cv_have_include_next = yes; then - gl_cv_next_string_h='<'string.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_string_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test $ac_cv_header_string_h = yes; then - - - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'string.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - - gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` - - gl_header=$gl_cv_absolute_string_h - gl_cv_next_string_h='"'$gl_header'"' - else - gl_cv_next_string_h='<'string.h'>' - fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 -$as_echo "$gl_cv_next_string_h" >&6; } - fi - NEXT_STRING_H=$gl_cv_next_string_h - - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'string.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_string_h - fi - NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive - - - - -ac_config_files="$ac_config_files lib/stdio.h lib/string.h" - - -WERROR= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Werror" >&5 -$as_echo_n "checking whether $CC accepts -Werror... " >&6; } -if ${ovs_cv__Werror+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Werror=yes -else - ovs_cv__Werror=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Werror" >&5 -$as_echo "$ovs_cv__Werror" >&6; } - if test $ovs_cv__Werror = yes; then - WERROR=-Werror - else - : - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wall" >&5 -$as_echo_n "checking whether $CC accepts -Wall... " >&6; } -if ${ovs_cv__Wall+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wall" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wall=yes -else - ovs_cv__Wall=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wall" >&5 -$as_echo "$ovs_cv__Wall" >&6; } - if test $ovs_cv__Wall = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wall" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wextra" >&5 -$as_echo_n "checking whether $CC accepts -Wextra... " >&6; } -if ${ovs_cv__Wextra+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wextra" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wextra=yes -else - ovs_cv__Wextra=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wextra" >&5 -$as_echo "$ovs_cv__Wextra" >&6; } - if test $ovs_cv__Wextra = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wextra" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wno-sign-compare" >&5 -$as_echo_n "checking whether $CC accepts -Wno-sign-compare... " >&6; } -if ${ovs_cv__Wno_sign_compare+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wno-sign-compare" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wno_sign_compare=yes -else - ovs_cv__Wno_sign_compare=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wno_sign_compare" >&5 -$as_echo "$ovs_cv__Wno_sign_compare" >&6; } - if test $ovs_cv__Wno_sign_compare = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wno-sign-compare" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wpointer-arith" >&5 -$as_echo_n "checking whether $CC accepts -Wpointer-arith... " >&6; } -if ${ovs_cv__Wpointer_arith+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wpointer-arith" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wpointer_arith=yes -else - ovs_cv__Wpointer_arith=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wpointer_arith" >&5 -$as_echo "$ovs_cv__Wpointer_arith" >&6; } - if test $ovs_cv__Wpointer_arith = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wpointer-arith" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wdeclaration-after-statement" >&5 -$as_echo_n "checking whether $CC accepts -Wdeclaration-after-statement... " >&6; } -if ${ovs_cv__Wdeclaration_after_statement+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wdeclaration-after-statement" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wdeclaration_after_statement=yes -else - ovs_cv__Wdeclaration_after_statement=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wdeclaration_after_statement" >&5 -$as_echo "$ovs_cv__Wdeclaration_after_statement" >&6; } - if test $ovs_cv__Wdeclaration_after_statement = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wdeclaration-after-statement" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wformat-security" >&5 -$as_echo_n "checking whether $CC accepts -Wformat-security... " >&6; } -if ${ovs_cv__Wformat_security+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wformat-security" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wformat_security=yes -else - ovs_cv__Wformat_security=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wformat_security" >&5 -$as_echo "$ovs_cv__Wformat_security" >&6; } - if test $ovs_cv__Wformat_security = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wformat-security" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wno-format-zero-length" >&5 -$as_echo_n "checking whether $CC accepts -Wno-format-zero-length... " >&6; } -if ${ovs_cv__Wno_format_zero_length+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wno-format-zero-length" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wno_format_zero_length=yes -else - ovs_cv__Wno_format_zero_length=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wno_format_zero_length" >&5 -$as_echo "$ovs_cv__Wno_format_zero_length" >&6; } - if test $ovs_cv__Wno_format_zero_length = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wno-format-zero-length" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wswitch-enum" >&5 -$as_echo_n "checking whether $CC accepts -Wswitch-enum... " >&6; } -if ${ovs_cv__Wswitch_enum+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wswitch-enum" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wswitch_enum=yes -else - ovs_cv__Wswitch_enum=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wswitch_enum" >&5 -$as_echo "$ovs_cv__Wswitch_enum" >&6; } - if test $ovs_cv__Wswitch_enum = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wswitch-enum" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wunused-parameter" >&5 -$as_echo_n "checking whether $CC accepts -Wunused-parameter... " >&6; } -if ${ovs_cv__Wunused_parameter+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wunused-parameter" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wunused_parameter=yes -else - ovs_cv__Wunused_parameter=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wunused_parameter" >&5 -$as_echo "$ovs_cv__Wunused_parameter" >&6; } - if test $ovs_cv__Wunused_parameter = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wunused-parameter" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wstrict-aliasing" >&5 -$as_echo_n "checking whether $CC accepts -Wstrict-aliasing... " >&6; } -if ${ovs_cv__Wstrict_aliasing+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wstrict-aliasing" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wstrict_aliasing=yes -else - ovs_cv__Wstrict_aliasing=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wstrict_aliasing" >&5 -$as_echo "$ovs_cv__Wstrict_aliasing" >&6; } - if test $ovs_cv__Wstrict_aliasing = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wstrict-aliasing" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wbad-function-cast" >&5 -$as_echo_n "checking whether $CC accepts -Wbad-function-cast... " >&6; } -if ${ovs_cv__Wbad_function_cast+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wbad-function-cast" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wbad_function_cast=yes -else - ovs_cv__Wbad_function_cast=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wbad_function_cast" >&5 -$as_echo "$ovs_cv__Wbad_function_cast" >&6; } - if test $ovs_cv__Wbad_function_cast = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wbad-function-cast" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wcast-align" >&5 -$as_echo_n "checking whether $CC accepts -Wcast-align... " >&6; } -if ${ovs_cv__Wcast_align+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wcast-align" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wcast_align=yes -else - ovs_cv__Wcast_align=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wcast_align" >&5 -$as_echo "$ovs_cv__Wcast_align" >&6; } - if test $ovs_cv__Wcast_align = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wcast-align" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wstrict-prototypes" >&5 -$as_echo_n "checking whether $CC accepts -Wstrict-prototypes... " >&6; } -if ${ovs_cv__Wstrict_prototypes+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wstrict-prototypes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wstrict_prototypes=yes -else - ovs_cv__Wstrict_prototypes=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wstrict_prototypes" >&5 -$as_echo "$ovs_cv__Wstrict_prototypes" >&6; } - if test $ovs_cv__Wstrict_prototypes = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wstrict-prototypes" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wold-style-definition" >&5 -$as_echo_n "checking whether $CC accepts -Wold-style-definition... " >&6; } -if ${ovs_cv__Wold_style_definition+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wold-style-definition" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wold_style_definition=yes -else - ovs_cv__Wold_style_definition=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wold_style_definition" >&5 -$as_echo "$ovs_cv__Wold_style_definition" >&6; } - if test $ovs_cv__Wold_style_definition = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wold-style-definition" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wmissing-prototypes" >&5 -$as_echo_n "checking whether $CC accepts -Wmissing-prototypes... " >&6; } -if ${ovs_cv__Wmissing_prototypes+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wmissing-prototypes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wmissing_prototypes=yes -else - ovs_cv__Wmissing_prototypes=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wmissing_prototypes" >&5 -$as_echo "$ovs_cv__Wmissing_prototypes" >&6; } - if test $ovs_cv__Wmissing_prototypes = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wmissing-prototypes" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wmissing-field-initializers" >&5 -$as_echo_n "checking whether $CC accepts -Wmissing-field-initializers... " >&6; } -if ${ovs_cv__Wmissing_field_initializers+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wmissing-field-initializers" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wmissing_field_initializers=yes -else - ovs_cv__Wmissing_field_initializers=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wmissing_field_initializers" >&5 -$as_echo "$ovs_cv__Wmissing_field_initializers" >&6; } - if test $ovs_cv__Wmissing_field_initializers = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wmissing-field-initializers" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wthread-safety" >&5 -$as_echo_n "checking whether $CC accepts -Wthread-safety... " >&6; } -if ${ovs_cv__Wthread_safety+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wthread-safety" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wthread_safety=yes -else - ovs_cv__Wthread_safety=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wthread_safety" >&5 -$as_echo "$ovs_cv__Wthread_safety" >&6; } - if test $ovs_cv__Wthread_safety = yes; then - WARNING_FLAGS="$WARNING_FLAGS -Wthread-safety" - else - : - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wno-unused" >&5 -$as_echo_n "checking whether $CC accepts -Wno-unused... " >&6; } -if ${ovs_cv__Wno_unused+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wno-unused" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wno_unused=yes -else - ovs_cv__Wno_unused=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wno_unused" >&5 -$as_echo "$ovs_cv__Wno_unused" >&6; } - if test $ovs_cv__Wno_unused = yes; then - ovs_have_cc_option=yes - else - ovs_have_cc_option=no - fi - - if test $ovs_have_cc_option = yes; then - HAVE_WNO_UNUSED_TRUE= - HAVE_WNO_UNUSED_FALSE='#' -else - HAVE_WNO_UNUSED_TRUE='#' - HAVE_WNO_UNUSED_FALSE= -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wno-unused-parameter" >&5 -$as_echo_n "checking whether $CC accepts -Wno-unused-parameter... " >&6; } -if ${ovs_cv__Wno_unused_parameter+:} false; then : - $as_echo_n "(cached) " >&6 -else - ovs_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $WERROR -Wno-unused-parameter" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ovs_cv__Wno_unused_parameter=yes -else - ovs_cv__Wno_unused_parameter=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ovs_save_CFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv__Wno_unused_parameter" >&5 -$as_echo "$ovs_cv__Wno_unused_parameter" >&6; } - if test $ovs_cv__Wno_unused_parameter = yes; then - ovs_have_cc_option=yes - else - ovs_have_cc_option=no - fi - - if test $ovs_have_cc_option = yes; then - HAVE_WNO_UNUSED_PARAMETER_TRUE= - HAVE_WNO_UNUSED_PARAMETER_FALSE='#' -else - HAVE_WNO_UNUSED_PARAMETER_TRUE='#' - HAVE_WNO_UNUSED_PARAMETER_FALSE= -fi - -# Check whether --enable-Werror was given. -if test "${enable_Werror+set}" = set; then : - enableval=$enable_Werror; -else - enable_Werror=no -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target hint for cgcc" >&5 -$as_echo_n "checking target hint for cgcc... " >&6; } -if ${ac_cv_sparse_target+:} false; then : - $as_echo_n "(cached) " >&6 -else - case `$CC -dumpmachine 2>/dev/null` in #( - i?86-* | athlon-*) : - ac_cv_sparse_target=x86 ;; #( - x86_64-*) : - ac_cv_sparse_target=x86_64 ;; #( - *) : - ac_cv_sparse_target=other ;; -esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sparse_target" >&5 -$as_echo "$ac_cv_sparse_target" >&6; } - case $ac_cv_sparse_target in #( - x86) : - SPARSEFLAGS= CGCCFLAGS=-target=i86 ;; #( - x86_64) : - SPARSEFLAGS=-m64 CGCCFLAGS=-target=x86_64 ;; #( - *) : - SPARSEFLAGS= CGCCFLAGS= ;; -esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} has GNU make \$(if) extension" >&5 -$as_echo_n "checking whether ${MAKE-make} has GNU make \$(if) extension... " >&6; } -if ${ovs_cv_gnu_make_if+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat <<'EOF' > conftest.mk -conftest.out: - echo $(if x,y,z) > conftest.out -.PHONY: all -EOF - rm -f conftest.out - $as_echo "$as_me:$LINENO: invoking ${MAKE-make} -f conftest.mk all:" >&5 2>&1 - ${MAKE-make} -f conftest.mk conftest.out >&5 2>&1 - $as_echo "$as_me:$LINENO: conftest.out contains:" >&5 2>&1 - cat conftest.out >&5 2>&1 - result=`cat conftest.out` - rm -f conftest.mk conftest.out - if test "X$result" = "Xy"; then - ovs_cv_gnu_make_if=yes - else - ovs_cv_gnu_make_if=no - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ovs_cv_gnu_make_if" >&5 -$as_echo "$ovs_cv_gnu_make_if" >&6; } -SPARSE_EXTRA_INCLUDES=`$CC -v -E - &1 >/dev/null | sed -n -e '/^#include.*search.*starts.*here:/,/^End.*of.*search.*list\./s/^ \(.*\)/-I \1/p' |grep -v /usr/lib | grep -x -v '\-I /usr/include' | tr \\\n ' ' ` - - - - - : ${SPARSE=sparse} - - - - - - - -# Check whether --with-linux was given. -if test "${with_linux+set}" = set; then : - withval=$with_linux; -fi - - -# Check whether --with-linux-source was given. -if test "${with_linux_source+set}" = set; then : - withval=$with_linux_source; -fi - - - # Deprecated equivalents to --with-linux, --with-linux-source. - -# Check whether --with-l26 was given. -if test "${with_l26+set}" = set; then : - withval=$with_l26; -fi - - -# Check whether --with-l26-source was given. -if test "${with_l26_source+set}" = set; then : - withval=$with_l26_source; -fi - - - if test X"$with_linux" != X; then - KBUILD=$with_linux - elif test X"$with_l26" != X; then - KBUILD=$with_l26 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-l26 is deprecated, please use --with-linux instead" >&5 -$as_echo "$as_me: WARNING: --with-l26 is deprecated, please use --with-linux instead" >&2;} - else - KBUILD= - fi - - if test X"$KBUILD" != X; then - if test X"$with_linux_source" != X; then - KSRC=$with_linux_source - elif test X"$with_l26_source" != X; then - KSRC=$with_l26_source - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-l26-source is deprecated, please use --with-linux-source instead" >&5 -$as_echo "$as_me: WARNING: --with-l26-source is deprecated, please use --with-linux-source instead" >&2;} - else - KSRC= - fi - elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then - as_fn_error $? "Linux source directory may not be specified without Linux build directory" "$LINENO" 5 - fi - - if test -n "$KBUILD"; then - KBUILD=`eval echo "$KBUILD"` - case $KBUILD in - /*) ;; - *) KBUILD=`pwd`/$KBUILD ;; - esac - - # The build directory is what the user provided. - # Make sure that it exists. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux build directory" >&5 -$as_echo_n "checking for Linux build directory... " >&6; } - if test -d "$KBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KBUILD" >&5 -$as_echo "$KBUILD" >&6; } - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "source dir $KBUILD doesn't exist" "$LINENO" 5 - fi - - # Debian breaks kernel headers into "source" header and "build" headers. - # We want the source headers, but $KBUILD gives us the "build" headers. - # Use heuristics to find the source headers. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux source directory" >&5 -$as_echo_n "checking for Linux source directory... " >&6; } - if test -n "$KSRC"; then - KSRC=`eval echo "$KSRC"` - case $KSRC in - /*) ;; - *) KSRC=`pwd`/$KSRC ;; - esac - if test ! -e $KSRC/include/linux/kernel.h; then - as_fn_error $? "$KSRC is not a kernel source directory" "$LINENO" 5 - fi - else - KSRC=$KBUILD - if test ! -e $KSRC/include/linux/kernel.h; then - # Debian kernel build Makefiles tend to include a line of the form: - # MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common O=/usr/src/linux-headers-3.2.0-1-486 - # First try to extract the source directory from this line. - KSRC=`sed -n 's/.*-C \([^ ]*\).*/\1/p' "$KBUILD"/Makefile` - if test ! -e "$KSRC"/include/linux/kernel.h; then - # Didn't work. Fall back to name-based heuristics that used to work. - case `echo "$KBUILD" | sed 's,/*$,,'` in # ( - */build) - KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'` - ;; # ( - *) - KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[^-]*$,-common,'` - ;; - esac - fi - fi - if test ! -e "$KSRC"/include/linux/kernel.h; then - as_fn_error $? "cannot find source directory (please use --with-linux-source)" "$LINENO" 5 - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KSRC" >&5 -$as_echo "$KSRC" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel version" >&5 -$as_echo_n "checking for kernel version... " >&6; } - version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"` - patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"` - sublevel=`sed -n 's/^SUBLEVEL = //p' "$KSRC/Makefile"` - if test X"$version" = X || test X"$patchlevel" = X; then - as_fn_error $? "cannot determine kernel version" "$LINENO" 5 - elif test X"$sublevel" = X; then - kversion=$version.$patchlevel - else - kversion=$version.$patchlevel.$sublevel - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kversion" >&5 -$as_echo "$kversion" >&6; } - - if test "$version" -ge 3; then - if test "$version" = 3 && test "$patchlevel" -le 14; then - : # Linux 3.x - else - as_fn_error $? "Linux kernel in $KBUILD is version $kversion, but version newer than 3.14.x is not supported (please refer to the FAQ for advice)" "$LINENO" 5 - fi - else - if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then - as_fn_error $? "Linux kernel in $KBUILD is version $kversion, but version 2.6.32 or later is required" "$LINENO" 5 - else - : # Linux 2.6.x - fi - fi - if (test ! -e "$KBUILD"/include/linux/version.h && \ - test ! -e "$KBUILD"/include/generated/uapi/linux/version.h)|| \ - (test ! -e "$KBUILD"/include/linux/autoconf.h && \ - test ! -e "$KBUILD"/include/generated/autoconf.h); then - as_fn_error $? "Linux kernel source in $KBUILD is not configured" "$LINENO" 5 - fi - - rm -f datapath/linux/kcompat.h.new - mkdir -p datapath/linux - : > datapath/linux/kcompat.h.new - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether src_err, matches in $KSRC/arch/x86/include/asm/checksum_32.h" >&5 -$as_echo_n "checking whether src_err, matches in $KSRC/arch/x86/include/asm/checksum_32.h... " >&6; } - if test -f $KSRC/arch/x86/include/asm/checksum_32.h; then - grep 'src_err,' $KSRC/arch/x86/include/asm/checksum_32.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_CSUM_COPY_DBG 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ERR_CAST matches in $KSRC/include/linux/err.h" >&5 -$as_echo_n "checking whether ERR_CAST matches in $KSRC/include/linux/err.h... " >&6; } - if test -f $KSRC/include/linux/err.h; then - grep 'ERR_CAST' $KSRC/include/linux/err.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_ERR_CAST 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fast_hash_ops matches in $KSRC/include/linux/hash.h" >&5 -$as_echo_n "checking whether fast_hash_ops matches in $KSRC/include/linux/hash.h... " >&6; } - if test -f $KSRC/include/linux/hash.h; then - grep 'fast_hash_ops' $KSRC/include/linux/hash.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_FAST_HASH_OPS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether eth_hw_addr_random matches in $KSRC/include/linux/etherdevice.h" >&5 -$as_echo_n "checking whether eth_hw_addr_random matches in $KSRC/include/linux/etherdevice.h... " >&6; } - if test -f $KSRC/include/linux/etherdevice.h; then - grep 'eth_hw_addr_random' $KSRC/include/linux/etherdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_ETH_HW_ADDR_RANDOM 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ether_addr_copy matches in $KSRC/include/linux/etherdevice.h" >&5 -$as_echo_n "checking whether ether_addr_copy matches in $KSRC/include/linux/etherdevice.h... " >&6; } - if test -f $KSRC/include/linux/etherdevice.h; then - grep 'ether_addr_copy' $KSRC/include/linux/etherdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_ETHER_ADDR_COPY 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vlan_set_encap_proto matches in $KSRC/include/linux/if_vlan.h" >&5 -$as_echo_n "checking whether vlan_set_encap_proto matches in $KSRC/include/linux/if_vlan.h... " >&6; } - if test -f $KSRC/include/linux/if_vlan.h; then - grep 'vlan_set_encap_proto' $KSRC/include/linux/if_vlan.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_VLAN_SET_ENCAP_PROTO 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ipv4_is_multicast matches in $KSRC/include/linux/in.h" >&5 -$as_echo_n "checking whether ipv4_is_multicast matches in $KSRC/include/linux/in.h... " >&6; } - if test -f $KSRC/include/linux/in.h; then - grep 'ipv4_is_multicast' $KSRC/include/linux/in.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_IPV4_IS_MULTICAST 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __ip_select_ident.*dst_entry matches in $KSRC/include/net/ip.h" >&5 -$as_echo_n "checking whether __ip_select_ident.*dst_entry matches in $KSRC/include/net/ip.h... " >&6; } - if test -f $KSRC/include/net/ip.h; then - grep '__ip_select_ident.*dst_entry' $KSRC/include/net/ip.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_IP_SELECT_IDENT_USING_DST_ENTRY 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dev_disable_lro matches in $KSRC/include/linux/netdevice.h" >&5 -$as_echo_n "checking whether dev_disable_lro matches in $KSRC/include/linux/netdevice.h... " >&6; } - if test -f $KSRC/include/linux/netdevice.h; then - grep 'dev_disable_lro' $KSRC/include/linux/netdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_DEV_DISABLE_LRO 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dev_get_stats matches in $KSRC/include/linux/netdevice.h" >&5 -$as_echo_n "checking whether dev_get_stats matches in $KSRC/include/linux/netdevice.h... " >&6; } - if test -f $KSRC/include/linux/netdevice.h; then - grep 'dev_get_stats' $KSRC/include/linux/netdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_DEV_GET_STATS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dev_get_by_index_rcu matches in $KSRC/include/linux/netdevice.h" >&5 -$as_echo_n "checking whether dev_get_by_index_rcu matches in $KSRC/include/linux/netdevice.h... " >&6; } - if test -f $KSRC/include/linux/netdevice.h; then - grep 'dev_get_by_index_rcu' $KSRC/include/linux/netdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_DEV_GET_BY_INDEX_RCU 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __skb_gso_segment matches in $KSRC/include/linux/netdevice.h" >&5 -$as_echo_n "checking whether __skb_gso_segment matches in $KSRC/include/linux/netdevice.h... " >&6; } - if test -f $KSRC/include/linux/netdevice.h; then - grep '__skb_gso_segment' $KSRC/include/linux/netdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE___SKB_GSO_SEGMENT 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether can_checksum_protocol matches in $KSRC/include/linux/netdevice.h" >&5 -$as_echo_n "checking whether can_checksum_protocol matches in $KSRC/include/linux/netdevice.h... " >&6; } - if test -f $KSRC/include/linux/netdevice.h; then - grep 'can_checksum_protocol' $KSRC/include/linux/netdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_CAN_CHECKSUM_PROTOCOL 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether netdev_features_t matches in $KSRC/include/linux/netdevice.h" >&5 -$as_echo_n "checking whether netdev_features_t matches in $KSRC/include/linux/netdevice.h... " >&6; } - if test -f $KSRC/include/linux/netdevice.h; then - grep 'netdev_features_t' $KSRC/include/linux/netdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_NETDEV_FEATURES_T 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pcpu_sw_netstats matches in $KSRC/include/linux/netdevice.h" >&5 -$as_echo_n "checking whether pcpu_sw_netstats matches in $KSRC/include/linux/netdevice.h... " >&6; } - if test -f $KSRC/include/linux/netdevice.h; then - grep 'pcpu_sw_netstats' $KSRC/include/linux/netdevice.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_PCPU_SW_NETSTATS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether prandom_u32 matches in $KSRC/include/linux/random.h" >&5 -$as_echo_n "checking whether prandom_u32 matches in $KSRC/include/linux/random.h... " >&6; } - if test -f $KSRC/include/linux/random.h; then - grep 'prandom_u32' $KSRC/include/linux/random.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_PRANDOM_U32 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rcu_read_lock_held matches in $KSRC/include/linux/rcupdate.h" >&5 -$as_echo_n "checking whether rcu_read_lock_held matches in $KSRC/include/linux/rcupdate.h... " >&6; } - if test -f $KSRC/include/linux/rcupdate.h; then - grep 'rcu_read_lock_held' $KSRC/include/linux/rcupdate.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_RCU_READ_LOCK_HELD 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rcu_read_lock_held matches in $KSRC/include/linux/rtnetlink.h" >&5 -$as_echo_n "checking whether rcu_read_lock_held matches in $KSRC/include/linux/rtnetlink.h... " >&6; } - if test -f $KSRC/include/linux/rtnetlink.h; then - grep 'rcu_read_lock_held' $KSRC/include/linux/rtnetlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_RCU_READ_LOCK_HELD 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rcu_read_lock_held matches in $KSRC/include/linux/rtnetlink.h" >&5 -$as_echo_n "checking whether rcu_read_lock_held matches in $KSRC/include/linux/rtnetlink.h... " >&6; } - if test -f $KSRC/include/linux/rtnetlink.h; then - grep 'rcu_read_lock_held' $KSRC/include/linux/rtnetlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_RCU_READ_LOCK_HELD 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lockdep_rtnl_is_held matches in $KSRC/include/linux/rtnetlink.h" >&5 -$as_echo_n "checking whether lockdep_rtnl_is_held matches in $KSRC/include/linux/rtnetlink.h... " >&6; } - if test -f $KSRC/include/linux/rtnetlink.h; then - grep 'lockdep_rtnl_is_held' $KSRC/include/linux/rtnetlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_LOCKDEP_RTNL_IS_HELD 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - # Check for the proto_data_valid member in struct sk_buff. The [^@] - # is necessary because some versions of this header remove the - # member but retain the kerneldoc comment that describes it (which - # starts with @). The brackets must be doubled because of m4 - # quoting rules. - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether [^@]proto_data_valid matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether [^@]proto_data_valid matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep '[^@]proto_data_valid' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_PROTO_DATA_VALID 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rxhash matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether rxhash matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'rxhash' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_RXHASH 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether u16.*rxhash matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether u16.*rxhash matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'u16.*rxhash' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_U16_RXHASH 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_dst( matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_dst( matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_dst(' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_DST_ACCESSOR_FUNCS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_copy_from_linear_data_offset matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_copy_from_linear_data_offset matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_copy_from_linear_data_offset' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_reset_tail_pointer matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_reset_tail_pointer matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_reset_tail_pointer' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_RESET_TAIL_POINTER 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_cow_head matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_cow_head matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_cow_head' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_COW_HEAD 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_transport_header matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_transport_header matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_transport_header' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKBUFF_HEADER_HELPERS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether icmp6_hdr matches in $KSRC/include/linux/icmpv6.h" >&5 -$as_echo_n "checking whether icmp6_hdr matches in $KSRC/include/linux/icmpv6.h... " >&6; } - if test -f $KSRC/include/linux/icmpv6.h; then - grep 'icmp6_hdr' $KSRC/include/linux/icmpv6.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_ICMP6_HDR 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_warn_if_lro matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_warn_if_lro matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_warn_if_lro' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_WARN_LRO 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether consume_skb matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether consume_skb matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'consume_skb' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_CONSUME_SKB 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_frag_page matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_frag_page matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_frag_page' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_FRAG_PAGE 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_has_frag_list matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_has_frag_list matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_has_frag_list' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_HAS_FRAG_LIST 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __skb_fill_page_desc matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether __skb_fill_page_desc matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep '__skb_fill_page_desc' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE___SKB_FILL_PAGE_DESC 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_reset_mac_len matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_reset_mac_len matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_reset_mac_len' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_RESET_MAC_LEN 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_unclone matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_unclone matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_unclone' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_UNCLONE 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_orphan_frags matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_orphan_frags matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_orphan_frags' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_ORPHAN_FRAGS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_get_hash matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_get_hash matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_get_hash' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_GET_HASH 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether skb_clear_hash matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether skb_clear_hash matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'skb_clear_hash' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_CLEAR_HASH 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether int.skb_zerocopy( matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether int.skb_zerocopy( matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'int.skb_zerocopy(' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SKB_ZEROCOPY 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether l4_rxhash matches in $KSRC/include/linux/skbuff.h" >&5 -$as_echo_n "checking whether l4_rxhash matches in $KSRC/include/linux/skbuff.h... " >&6; } - if test -f $KSRC/include/linux/skbuff.h; then - grep 'l4_rxhash' $KSRC/include/linux/skbuff.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_L4_RXHASH 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bool matches in $KSRC/include/linux/types.h" >&5 -$as_echo_n "checking whether bool matches in $KSRC/include/linux/types.h... " >&6; } - if test -f $KSRC/include/linux/types.h; then - grep 'bool' $KSRC/include/linux/types.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_BOOL_TYPE 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __wsum matches in $KSRC/include/linux/types.h" >&5 -$as_echo_n "checking whether __wsum matches in $KSRC/include/linux/types.h... " >&6; } - if test -f $KSRC/include/linux/types.h; then - grep '__wsum' $KSRC/include/linux/types.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_CSUM_TYPES 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __wsum matches in $KSRC/include/uapi/linux/types.h" >&5 -$as_echo_n "checking whether __wsum matches in $KSRC/include/uapi/linux/types.h... " >&6; } - if test -f $KSRC/include/uapi/linux/types.h; then - grep '__wsum' $KSRC/include/uapi/linux/types.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_CSUM_TYPES 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether csum_replace4 matches in $KSRC/include/net/checksum.h" >&5 -$as_echo_n "checking whether csum_replace4 matches in $KSRC/include/net/checksum.h... " >&6; } - if test -f $KSRC/include/net/checksum.h; then - grep 'csum_replace4' $KSRC/include/net/checksum.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_CSUM_REPLACE4 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether csum_unfold matches in $KSRC/include/net/checksum.h" >&5 -$as_echo_n "checking whether csum_unfold matches in $KSRC/include/net/checksum.h... " >&6; } - if test -f $KSRC/include/net/checksum.h; then - grep 'csum_unfold' $KSRC/include/net/checksum.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_CSUM_UNFOLD 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether parallel_ops matches in $KSRC/include/net/genetlink.h" >&5 -$as_echo_n "checking whether parallel_ops matches in $KSRC/include/net/genetlink.h... " >&6; } - if test -f $KSRC/include/net/genetlink.h; then - grep 'parallel_ops' $KSRC/include/net/genetlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_PARALLEL_OPS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether genlmsg_new_unicast matches in $KSRC/include/net/genetlink.h" >&5 -$as_echo_n "checking whether genlmsg_new_unicast matches in $KSRC/include/net/genetlink.h... " >&6; } - if test -f $KSRC/include/net/genetlink.h; then - grep 'genlmsg_new_unicast' $KSRC/include/net/genetlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_GENLMSG_NEW_UNICAST 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gre_cisco_register matches in $KSRC/include/net/gre.h" >&5 -$as_echo_n "checking whether gre_cisco_register matches in $KSRC/include/net/gre.h... " >&6; } - if test -f $KSRC/include/net/gre.h; then - grep 'gre_cisco_register' $KSRC/include/net/gre.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_GRE_CISCO_REGISTER 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gre_handle_offloads matches in $KSRC/include/net/gre.h" >&5 -$as_echo_n "checking whether gre_handle_offloads matches in $KSRC/include/net/gre.h... " >&6; } - if test -f $KSRC/include/net/gre.h; then - grep 'gre_handle_offloads' $KSRC/include/net/gre.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_GRE_HANDLE_OFFLOADS 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iptunnel_xmit.*net matches in $KSRC/include/net/ip_tunnels.h" >&5 -$as_echo_n "checking whether iptunnel_xmit.*net matches in $KSRC/include/net/ip_tunnels.h... " >&6; } - if test -f $KSRC/include/net/ip_tunnels.h; then - grep 'iptunnel_xmit.*net' $KSRC/include/net/ip_tunnels.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_IPTUNNEL_XMIT_NET 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether IP6_FH_F_SKIP_RH matches in $KSRC/include/net/ipv6.h" >&5 -$as_echo_n "checking whether IP6_FH_F_SKIP_RH matches in $KSRC/include/net/ipv6.h... " >&6; } - if test -f $KSRC/include/net/ipv6.h; then - grep 'IP6_FH_F_SKIP_RH' $KSRC/include/net/ipv6.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_IP6_FH_F_SKIP_RH 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nla_get_be16 matches in $KSRC/include/net/netlink.h" >&5 -$as_echo_n "checking whether nla_get_be16 matches in $KSRC/include/net/netlink.h... " >&6; } - if test -f $KSRC/include/net/netlink.h; then - grep 'nla_get_be16' $KSRC/include/net/netlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_NLA_GET_BE16 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nla_put_be16 matches in $KSRC/include/net/netlink.h" >&5 -$as_echo_n "checking whether nla_put_be16 matches in $KSRC/include/net/netlink.h... " >&6; } - if test -f $KSRC/include/net/netlink.h; then - grep 'nla_put_be16' $KSRC/include/net/netlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_NLA_PUT_BE16 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nla_put_be32 matches in $KSRC/include/net/netlink.h" >&5 -$as_echo_n "checking whether nla_put_be32 matches in $KSRC/include/net/netlink.h... " >&6; } - if test -f $KSRC/include/net/netlink.h; then - grep 'nla_put_be32' $KSRC/include/net/netlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_NLA_PUT_BE32 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nla_put_be64 matches in $KSRC/include/net/netlink.h" >&5 -$as_echo_n "checking whether nla_put_be64 matches in $KSRC/include/net/netlink.h... " >&6; } - if test -f $KSRC/include/net/netlink.h; then - grep 'nla_put_be64' $KSRC/include/net/netlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_NLA_PUT_BE64 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nla_find_nested matches in $KSRC/include/net/netlink.h" >&5 -$as_echo_n "checking whether nla_find_nested matches in $KSRC/include/net/netlink.h... " >&6; } - if test -f $KSRC/include/net/netlink.h; then - grep 'nla_find_nested' $KSRC/include/net/netlink.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_NLA_FIND_NESTED 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vxlan_xmit_skb matches in $KSRC/include/net/vxlan.h" >&5 -$as_echo_n "checking whether vxlan_xmit_skb matches in $KSRC/include/net/vxlan.h... " >&6; } - if test -f $KSRC/include/net/vxlan.h; then - grep 'vxlan_xmit_skb' $KSRC/include/net/vxlan.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_VXLAN_XMIT_SKB 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sctp_compute_cksum matches in $KSRC/include/net/sctp/checksum.h" >&5 -$as_echo_n "checking whether sctp_compute_cksum matches in $KSRC/include/net/sctp/checksum.h... " >&6; } - if test -f $KSRC/include/net/sctp/checksum.h; then - grep 'sctp_compute_cksum' $KSRC/include/net/sctp/checksum.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_SCTP_COMPUTE_CKSUM 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ADD_ALL_VLANS_CMD matches in $KSRC/include/linux/if_vlan.h" >&5 -$as_echo_n "checking whether ADD_ALL_VLANS_CMD matches in $KSRC/include/linux/if_vlan.h... " >&6; } - if test -f $KSRC/include/linux/if_vlan.h; then - grep 'ADD_ALL_VLANS_CMD' $KSRC/include/linux/if_vlan.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_VLAN_BUG_WORKAROUND 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this_cpu_ptr matches in $KSRC/include/linux/percpu.h" >&5 -$as_echo_n "checking whether this_cpu_ptr matches in $KSRC/include/linux/percpu.h... " >&6; } - if test -f $KSRC/include/linux/percpu.h; then - grep 'this_cpu_ptr' $KSRC/include/linux/percpu.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_THIS_CPU_PTR 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether u64_stats_fetch_begin_irq matches in $KSRC/include/linux/u64_stats_sync.h" >&5 -$as_echo_n "checking whether u64_stats_fetch_begin_irq matches in $KSRC/include/linux/u64_stats_sync.h... " >&6; } - if test -f $KSRC/include/linux/u64_stats_sync.h; then - grep 'u64_stats_fetch_begin_irq' $KSRC/include/linux/u64_stats_sync.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_U64_STATS_FETCH_BEGIN_IRQ 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether openvswitch_handle_frame_hook matches in $KSRC/include/linux/openvswitch.h" >&5 -$as_echo_n "checking whether openvswitch_handle_frame_hook matches in $KSRC/include/linux/openvswitch.h... " >&6; } - if test -f $KSRC/include/linux/openvswitch.h; then - grep 'openvswitch_handle_frame_hook' $KSRC/include/linux/openvswitch.h >/dev/null 2>&1 - status=$? - case $status in - 0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_RHEL_OVS_HOOK 1' >> datapath/linux/kcompat.h.new - - ;; - 1) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - ;; - *) - as_fn_error $? "grep exited with status $status" "$LINENO" 5 - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - - fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $KSRC/include/linux/log2.h" >&5 -$as_echo_n "checking for $KSRC/include/linux/log2.h... " >&6; } - if test -e $KSRC/include/linux/log2.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - echo '#define HAVE_LOG2_H 1' >> datapath/linux/kcompat.h.new - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - if cmp -s datapath/linux/kcompat.h.new \ - datapath/linux/kcompat.h >/dev/null 2>&1; then - rm datapath/linux/kcompat.h.new - else - mv datapath/linux/kcompat.h.new datapath/linux/kcompat.h - fi - - fi - if test -n "$KBUILD"; then - LINUX_ENABLED_TRUE= - LINUX_ENABLED_FALSE='#' -else - LINUX_ENABLED_TRUE='#' - LINUX_ENABLED_FALSE= -fi - - - - -# Check whether --with-dpdk was given. -if test "${with_dpdk+set}" = set; then : - withval=$with_dpdk; -fi - - - if test X"$with_dpdk" != X; then - RTE_SDK=$with_dpdk - - DPDK_INCLUDE=$RTE_SDK/include - DPDK_LIB_DIR=$RTE_SDK/lib - DPDK_LIBS="$DPDK_LIB_DIR/libintel_dpdk.a" - - LIBS="$DPDK_LIBS $LIBS" - CPPFLAGS="-I$DPDK_INCLUDE $CPPFLAGS" - - -$as_echo "#define DPDK_NETDEV 1" >>confdefs.h - - else - RTE_SDK= - fi - - if test -n "$RTE_SDK"; then - DPDK_NETDEV_TRUE= - DPDK_NETDEV_FALSE='#' -else - DPDK_NETDEV_TRUE='#' - DPDK_NETDEV_FALSE= -fi - - - -ac_config_files="$ac_config_files Makefile" - -ac_config_files="$ac_config_files datapath/Makefile" - -ac_config_files="$ac_config_files datapath/linux/Kbuild" - -ac_config_files="$ac_config_files datapath/linux/Makefile" - -ac_config_files="$ac_config_files datapath/linux/Makefile.main" - -ac_config_files="$ac_config_files tests/atlocal" - - -ac_config_commands="$ac_config_commands include/openflow/openflow.h.stamp" - - -ac_config_commands="$ac_config_commands utilities/bugtool/dummy" - - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=1;; -esac -AM_BACKSLASH='\' - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -if test -z "${ESX_TRUE}" && test -z "${ESX_FALSE}"; then - as_fn_error $? "conditional \"ESX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then - as_fn_error $? "conditional \"WIN32\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${NDEBUG_TRUE}" && test -z "${NDEBUG_FALSE}"; then - as_fn_error $? "conditional \"NDEBUG\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_NETLINK_TRUE}" && test -z "${HAVE_NETLINK_FALSE}"; then - as_fn_error $? "conditional \"HAVE_NETLINK\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_OPENSSL_TRUE}" && test -z "${HAVE_OPENSSL_FALSE}"; then - as_fn_error $? "conditional \"HAVE_OPENSSL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then - as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${INCLUDE_PYTHON_COMPAT_TRUE}" && test -z "${INCLUDE_PYTHON_COMPAT_FALSE}"; then - as_fn_error $? "conditional \"INCLUDE_PYTHON_COMPAT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_DOT_TRUE}" && test -z "${HAVE_DOT_FALSE}"; then - as_fn_error $? "conditional \"HAVE_DOT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_IF_PACKET_TRUE}" && test -z "${HAVE_IF_PACKET_FALSE}"; then - as_fn_error $? "conditional \"HAVE_IF_PACKET\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_IF_DL_TRUE}" && test -z "${HAVE_IF_DL_FALSE}"; then - as_fn_error $? "conditional \"HAVE_IF_DL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_GROFF_TRUE}" && test -z "${HAVE_GROFF_FALSE}"; then - as_fn_error $? "conditional \"HAVE_GROFF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then - as_fn_error $? "conditional \"GNU_MAKE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_POSIX_AIO_TRUE}" && test -z "${HAVE_POSIX_AIO_FALSE}"; then - as_fn_error $? "conditional \"HAVE_POSIX_AIO\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${LINUX_TRUE}" && test -z "${LINUX_FALSE}"; then - as_fn_error $? "conditional \"LINUX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_WNO_UNUSED_TRUE}" && test -z "${HAVE_WNO_UNUSED_FALSE}"; then - as_fn_error $? "conditional \"HAVE_WNO_UNUSED\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_WNO_UNUSED_PARAMETER_TRUE}" && test -z "${HAVE_WNO_UNUSED_PARAMETER_FALSE}"; then - as_fn_error $? "conditional \"HAVE_WNO_UNUSED_PARAMETER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test "X$enable_Werror" = Xyes; then - CFLAGS="$CFLAGS -Werror" - fi -if test $ovs_cv_gnu_make_if = yes; then - CC='$(if $(C),env REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc $(CGCCFLAGS),'"$CC"')' - fi -if test -z "${LINUX_ENABLED_TRUE}" && test -z "${LINUX_ENABLED_FALSE}"; then - as_fn_error $? "conditional \"LINUX_ENABLED\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DPDK_NETDEV_TRUE}" && test -z "${DPDK_NETDEV_FALSE}"; then - as_fn_error $? "conditional \"DPDK_NETDEV\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by openvswitch $as_me 2.3.1, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -openvswitch config.status 2.3.1 -configured by $0, generated by GNU Autoconf 2.68, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# - -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "tests/atconfig") CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "lib/stdio.h") CONFIG_FILES="$CONFIG_FILES lib/stdio.h" ;; - "lib/string.h") CONFIG_FILES="$CONFIG_FILES lib/string.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "datapath/Makefile") CONFIG_FILES="$CONFIG_FILES datapath/Makefile" ;; - "datapath/linux/Kbuild") CONFIG_FILES="$CONFIG_FILES datapath/linux/Kbuild" ;; - "datapath/linux/Makefile") CONFIG_FILES="$CONFIG_FILES datapath/linux/Makefile" ;; - "datapath/linux/Makefile.main") CONFIG_FILES="$CONFIG_FILES datapath/linux/Makefile.main" ;; - "tests/atlocal") CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; - "include/openflow/openflow.h.stamp") CONFIG_COMMANDS="$CONFIG_COMMANDS include/openflow/openflow.h.stamp" ;; - "utilities/bugtool/dummy") CONFIG_COMMANDS="$CONFIG_COMMANDS utilities/bugtool/dummy" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "tests/atconfig":C) cat >tests/atconfig </dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="" - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - ;; - "utilities/bugtool/dummy":C) : ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff -Nru openvswitch-2.3.1/configure.ac openvswitch-2.4.0~git20150623/configure.ac --- openvswitch-2.3.1/configure.ac 2014-12-04 05:58:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/configure.ac 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. +# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,15 +13,15 @@ # limitations under the License. AC_PREREQ(2.63) -AC_INIT(openvswitch, 2.3.1, bugs@openvswitch.org) +AC_INIT(openvswitch, 2.4.0, bugs@openvswitch.org) AC_CONFIG_SRCDIR([datapath/datapath.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_TESTDIR([tests]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([tar-pax]) -AC_PROG_CC +AC_PROG_CC_C99 AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_MKDIR_P @@ -43,14 +43,50 @@ LT_INIT([disable-shared]) m4_pattern_forbid([LT_INIT]) dnl Make autoconf fail if libtool is missing. +# The following explanation may help to understand the use of the +# version number fields: current, revision, and age. +# +# Consider that there are three possible kinds of reactions from +# users of your library to changes in a shared library: +# +# 1. Programs using the previous version may use the new version as drop-in +# replacement, and programs using the new version can also work with the +# previous one. In other words, no recompiling nor relinking is needed. +# In short, there are no changes to any symbols, no symbols removed, +# and no symbols added. In this case, bump revision only, don't touch +# current nor age. +# +# 2. Programs using the previous version may use the new version as drop-in +# replacement, but programs using the new version may use APIs not +# present in the previous one. In other words, new symbols have been +# added and a program linking against the new version may fail with +# "unresolved symbols." If linking against the old version at runtime: +# set revision to 0, bump current and age. +# +# 3. Programs may need to be changed, recompiled, relinked in order to use +# the new version. This is the case when symbols have been modified or +# deleted. Bump current, set revision and age to 0. + +m4_define([libopenvswitch_lt_current], [1]) +m4_define([libopenvswitch_lt_revision], [0]) +m4_define([libopenvswitch_lt_age], [0]) + +LT_CURRENT=libopenvswitch_lt_current +AC_SUBST([LT_CURRENT]) +LT_REVISION=libopenvswitch_lt_revision +AC_SUBST([LT_REVISION]) +LT_AGE=libopenvswitch_lt_age +AC_SUBST([LT_AGE]) + AC_SEARCH_LIBS([pow], [m]) AC_SEARCH_LIBS([clock_gettime], [rt]) AC_SEARCH_LIBS([timer_create], [rt]) -AC_SEARCH_LIBS([pthread_sigmask], [pthread]) +AC_SEARCH_LIBS([pthread_create], [pthread]) AC_FUNC_STRERROR_R OVS_CHECK_ESX OVS_CHECK_WIN32 +OVS_CHECK_VISUAL_STUDIO_DDK OVS_CHECK_COVERAGE OVS_CHECK_NDEBUG OVS_CHECK_NETLINK @@ -75,7 +111,7 @@ OVS_CHECK_RUNDIR OVS_CHECK_DBDIR OVS_CHECK_BACKTRACE -OVS_CHECK_MALLOC_HOOKS +OVS_CHECK_PERF_EVENT OVS_CHECK_VALGRIND OVS_CHECK_SOCKET_LIBS OVS_CHECK_XENSERVER_VERSION @@ -94,18 +130,22 @@ AX_FUNC_POSIX_MEMALIGN OVS_CHECK_INCLUDE_NEXT([stdio.h string.h]) -AC_CONFIG_FILES([lib/stdio.h lib/string.h]) +AC_CONFIG_FILES([ + lib/stdio.h + lib/string.h + ovsdb/libovsdb.sym + ofproto/libofproto.sym + lib/libsflow.sym + lib/libopenvswitch.sym + vtep/libvtep.sym]) OVS_ENABLE_OPTION([-Wall]) OVS_ENABLE_OPTION([-Wextra]) OVS_ENABLE_OPTION([-Wno-sign-compare]) OVS_ENABLE_OPTION([-Wpointer-arith]) -OVS_ENABLE_OPTION([-Wdeclaration-after-statement]) OVS_ENABLE_OPTION([-Wformat-security]) -OVS_ENABLE_OPTION([-Wno-format-zero-length]) OVS_ENABLE_OPTION([-Wswitch-enum]) OVS_ENABLE_OPTION([-Wunused-parameter]) -OVS_ENABLE_OPTION([-Wstrict-aliasing]) OVS_ENABLE_OPTION([-Wbad-function-cast]) OVS_ENABLE_OPTION([-Wcast-align]) OVS_ENABLE_OPTION([-Wstrict-prototypes]) @@ -113,6 +153,8 @@ OVS_ENABLE_OPTION([-Wmissing-prototypes]) OVS_ENABLE_OPTION([-Wmissing-field-initializers]) OVS_ENABLE_OPTION([-Wthread-safety]) +OVS_ENABLE_OPTION([-fno-strict-aliasing]) +OVS_ENABLE_OPTION([-Qunused-arguments]) OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED]) OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER]) OVS_ENABLE_WERROR @@ -122,6 +164,9 @@ AC_SUBST(KARCH) OVS_CHECK_LINUX OVS_CHECK_DPDK +OVS_CHECK_PRAGMA_MESSAGE +AC_SUBST([OVS_CFLAGS]) +AC_SUBST([OVS_LDFLAGS]) AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(datapath/Makefile) @@ -129,6 +174,11 @@ AC_CONFIG_FILES(datapath/linux/Makefile) AC_CONFIG_FILES(datapath/linux/Makefile.main) AC_CONFIG_FILES(tests/atlocal) +AC_CONFIG_FILES(lib/libopenvswitch.pc) +AC_CONFIG_FILES(lib/libsflow.pc) +AC_CONFIG_FILES(ofproto/libofproto.pc) +AC_CONFIG_FILES(ovsdb/libovsdb.pc) +AC_CONFIG_FILES(include/openvswitch/version.h) dnl This makes sure that include/openflow gets created in the build directory. AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp]) diff -Nru openvswitch-2.3.1/CONTRIBUTING openvswitch-2.4.0~git20150623/CONTRIBUTING --- openvswitch-2.3.1/CONTRIBUTING 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/CONTRIBUTING 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ -How to Submit Patches for Open vSwitch -====================================== - -Send changes to Open vSwitch as patches to dev@openvswitch.org. -One patch per email, please. More details are included below. - -If you are using Git, then "git format-patch" takes care of most of -the mechanics described below for you. - -Before You Start ----------------- - -Before you send patches at all, make sure that each patch makes sense. -In particular: - - - A given patch should not break anything, even if later - patches fix the problems that it causes. The source tree - should still build and work after each patch is applied. - (This enables "git bisect" to work best.) - - - A patch should make one logical change. Don't make - multiple, logically unconnected changes to disparate - subsystems in a single patch. - - - A patch that adds or removes user-visible features should - also update the appropriate user documentation or manpages. - -Testing is also important: - - - A patch that adds or deletes files should be tested with - "make distcheck" before submission. - - - A patch that modifies Linux kernel code should be at least - build-tested on various Linux kernel versions before - submission. I suggest versions 2.6.32 and whatever - the current latest release version is at the time. - - - A patch that modifies the ofproto or vswitchd code should be - tested in at least simple cases before submission. - - - A patch that modifies xenserver code should be tested on - XenServer before submission. - -Email Subject -------------- - -The subject line of your email should be in the following format: -[PATCH /] : - - - [PATCH /] indicates that this is the nth of a series - of m patches. It helps reviewers to read patches in the - correct order. You may omit this prefix if you are sending - only one patch. - - - : indicates the area of the Open vSwitch to which the - change applies (often the name of a source file or a - directory). You may omit it if the change crosses multiple - distinct pieces of code. - - - briefly describes the change. - -The subject, minus the [PATCH /] prefix, becomes the first line -of the commit's change log message. - -Description ------------ - -The body of the email should start with a more thorough description of -the change. This becomes the body of the commit message, following -the subject. There is no need to duplicate the summary given in the -subject. - -Please limit lines in the description to 79 characters in width. - -The description should include: - - - The rationale for the change. - - - Design description and rationale (but this might be better - added as code comments). - - - Testing that you performed (or testing that should be done - but you could not for whatever reason). - -There is no need to describe what the patch actually changed, if the -reader can see it for himself. - -If the patch refers to a commit already in the Open vSwitch -repository, please include both the commit number and the subject of -the patch, e.g. 'commit 632d136c (vswitch: Remove restriction on -datapath names.)'. - -If you, the person sending the patch, did not write the patch -yourself, then the very first line of the body should take the form -"From: ", followed by a blank line. This -will automatically cause the named author to be credited with -authorship in the repository. If others contributed to the patch, but -are not the main authors, then please credit them as part of the -description (e.g. "Thanks to Bob J. User for reporting this bug."). - -Please sign off on the patch as a submitter, and be sure to have the -author(s) sign off for patches that you did not author. - -Simply include your name and email address as the last line of the commit -message before any comments (and author too, if that is not you): - -Signed-off-by: Author Name -Signed-off-by: Submitter Name - -By doing this, you are agreeing to the Developer's Certificate of Origin -(see below for more details). - -Developer's Certificate of Origin ---------------------------------- - -To help track the author of a patch as well as the submission chain, -and be clear that the developer has authority to submit a patch for -inclusion in openvswitch please sign off your work. The sign off -certifies the following: - - Developer's Certificate of Origin 1.1 - - By making a contribution to this project, I certify that: - - (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - - (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - - (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - - (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -Comments --------- - -If you want to include any comments in your email that should not be -part of the commit's change log message, put them after the -description, separated by a line that contains just "---". It may be -helpful to include a diffstat here for changes that touch multiple -files. - -Patch ------ - -The patch should be in the body of the email following the description, -separated by a blank line. - -Patches should be in "diff -up" format. We recommend that you use Git -to produce your patches, in which case you should use the -M -C -options to "git diff" (or other Git tools) if your patch renames or -copies files. Quilt (http://savannah.nongnu.org/projects/quilt) might -be useful if you do not want to use Git. - -Patches should be inline in the email message. Some email clients -corrupt white space or wrap lines in patches. There are hints on how -to configure many email clients to avoid this problem at: - http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/email-clients.txt -If you cannot convince your email client not to mangle patches, then -sending the patch as an attachment is a second choice. - -Please follow the style used in the code that you are modifying. The -CodingStyle file describes the coding style used in most of Open -vSwitch. Use Linux kernel coding style for Linux kernel code. - -Example -------- - -From fa29a1c2c17682879e79a21bb0cdd5bbe67fa7c0 Mon Sep 17 00:00:00 2001 -From: Jesse Gross -Date: Thu, 8 Dec 2011 13:17:24 -0800 -Subject: [PATCH] datapath: Alphabetize include/net/ipv6.h compat header. - -Signed-off-by: Jesse Gross ---- - datapath/linux/Modules.mk | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk -index fdd952e..f6cb88e 100644 ---- a/datapath/linux/Modules.mk -+++ b/datapath/linux/Modules.mk -@@ -56,11 +56,11 @@ openvswitch_headers += \ - linux/compat/include/net/dst.h \ - linux/compat/include/net/genetlink.h \ - linux/compat/include/net/ip.h \ -+ linux/compat/include/net/ipv6.h \ - linux/compat/include/net/net_namespace.h \ - linux/compat/include/net/netlink.h \ - linux/compat/include/net/protocol.h \ - linux/compat/include/net/route.h \ -- linux/compat/include/net/ipv6.h \ - linux/compat/genetlink.inc - - both_modules += brcompat --- -1.7.7.3 - diff -Nru openvswitch-2.3.1/CONTRIBUTING.md openvswitch-2.4.0~git20150623/CONTRIBUTING.md --- openvswitch-2.3.1/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/CONTRIBUTING.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,323 @@ +How to Submit Patches for Open vSwitch +====================================== + +Send changes to Open vSwitch as patches to dev@openvswitch.org. +One patch per email, please. More details are included below. + +If you are using Git, then `git format-patch` takes care of most of +the mechanics described below for you. + +Before You Start +---------------- + +Before you send patches at all, make sure that each patch makes sense. +In particular: + + - A given patch should not break anything, even if later + patches fix the problems that it causes. The source tree + should still build and work after each patch is applied. + (This enables `git bisect` to work best.) + + - A patch should make one logical change. Don't make + multiple, logically unconnected changes to disparate + subsystems in a single patch. + + - A patch that adds or removes user-visible features should + also update the appropriate user documentation or manpages. + +Testing is also important: + + - A patch that modifies existing code should be tested with + `make check` before submission. + + - A patch that adds or deletes files should also be tested with + `make distcheck` before submission. + + - A patch that modifies Linux kernel code should be at least + build-tested on various Linux kernel versions before + submission. I suggest versions 2.6.32 and whatever + the current latest release version is at the time. + + - A patch that modifies the ofproto or vswitchd code should be + tested in at least simple cases before submission. + + - A patch that modifies xenserver code should be tested on + XenServer before submission. + +If you are using GitHub, then you may utilize the travis-ci.org CI build +system by linking your GitHub repository to it. This will run some of +the above tests automatically when you push changes to your repository. +See the "Continuous Integration with Travis-CI" in the [INSTALL.md] file +for details on how to set it up. + +Email Subject +------------- + +The subject line of your email should be in the following format: +`[PATCH /] : ` + + - `[PATCH /]` indicates that this is the nth of a series + of m patches. It helps reviewers to read patches in the + correct order. You may omit this prefix if you are sending + only one patch. + + - `:` indicates the area of the Open vSwitch to which the + change applies (often the name of a source file or a + directory). You may omit it if the change crosses multiple + distinct pieces of code. + + - `` briefly describes the change. + +The subject, minus the `[PATCH /]` prefix, becomes the first line +of the commit's change log message. + +Description +----------- + +The body of the email should start with a more thorough description of +the change. This becomes the body of the commit message, following +the subject. There is no need to duplicate the summary given in the +subject. + +Please limit lines in the description to 79 characters in width. + +The description should include: + + - The rationale for the change. + + - Design description and rationale (but this might be better + added as code comments). + + - Testing that you performed (or testing that should be done + but you could not for whatever reason). + + - Tags (see below). + +There is no need to describe what the patch actually changed, if the +reader can see it for himself. + +If the patch refers to a commit already in the Open vSwitch +repository, please include both the commit number and the subject of +the patch, e.g. 'commit 632d136c (vswitch: Remove restriction on +datapath names.)'. + +If you, the person sending the patch, did not write the patch +yourself, then the very first line of the body should take the form +`From: `, followed by a blank line. This +will automatically cause the named author to be credited with +authorship in the repository. + +Tags +---- + +The description ends with a series of tags, written one to a line as +the last paragraph of the email. Each tag indicates some property of +the patch in an easily machine-parseable manner. + +Examples of common tags follow. + + Signed-off-by: Author Name + + Informally, this indicates that Author Name is the author or + submitter of a patch and has the authority to submit it under + the terms of the license. The formal meaning is to agree to + the Developer's Certificate of Origin (see below). + + If the author and submitter are different, each must sign off. + If the patch has more than one author, all must sign off. + + Signed-off-by: Author Name + Signed-off-by: Submitter Name + + Co-authored-by: Author Name + + Git can only record a single person as the author of a given + patch. In the rare event that a patch has multiple authors, + one must be given the credit in Git and the others must be + credited via Co-authored-by: tags. (All co-authors must also + sign off.) + + Acked-by: Reviewer Name + + Reviewers will often give an Acked-by: tag to code of which + they approve. It is polite for the submitter to add the tag + before posting the next version of the patch or applying the + patch to the repository. Quality reviewing is hard work, so + this gives a small amount of credit to the reviewer. + + Not all reviewers give Acked-by: tags when they provide + positive reviews. It's customary only to add tags from + reviewers who actually provide them explicitly. + + Tested-by: Tester Name + + When someone tests a patch, it is customary to add a + Tested-by: tag indicating that. It's rare for a tester to + actually provide the tag; usually the patch submitter makes + the tag himself in response to an email indicating successful + testing results. + + Reported-by: Reporter Name + + When a patch fixes a bug reported by some person, please + credit the reporter in the commit log in this fashion. Please + also add the reporter's name and email address to the list of + people who provided helpful bug reports in the AUTHORS file at + the top of the source tree. + + Fairly often, the reporter of a bug also tests the fix. + Occasionally one sees a combined "Reported-and-tested-by:" tag + used to indicate this. It is also acceptable, and more + common, to include both tags separately. + + (If a bug report is received privately, it might not always be + appropriate to publicly credit the reporter. If in doubt, + please ask the reporter.) + + Requested-by: Requester Name + Suggested-by: Suggester Name + + When a patch implements a request or a suggestion made by some + person, please credit that person in the commit log in this + fashion. For a helpful suggestion, please also add the + person's name and email address to the list of people who + provided suggestions in the AUTHORS file at the top of the + source tree. + + (If a suggestion or a request is received privately, it might + not always be appropriate to publicly give credit. If in + doubt, please ask.) + + Reported-at: + + If a patch fixes or is otherwise related to a bug reported in + a public bug tracker, please include a reference to the bug in + the form of a URL to the specific bug, e.g.: + + Reported-at: https://bugs.debian.org/743635 + + This is also an appropriate way to refer to bug report emails + in public email archives, e.g.: + + Reported-at: http://openvswitch.org/pipermail/dev/2014-June/040952.html + + VMware-BZ: #1234567 + ONF-JIRA: EXT-12345 + + If a patch fixes or is otherwise related to a bug reported in + a private bug tracker, you may include some tracking ID for + the bug for your own reference. Please include some + identifier to make the origin clear, e.g. "VMware-BZ" refers + to VMware's internal Bugzilla instance and "ONF-JIRA" refers + to the Open Networking Foundation's JIRA bug tracker. + + Bug #1234567. + Issue: 1234567 + + These are obsolete forms of VMware-BZ: that can still be seen + in old change log entries. (They are obsolete because they do + not tell the reader what bug tracker is referred to.) + +Developer's Certificate of Origin +--------------------------------- + +To help track the author of a patch as well as the submission chain, +and be clear that the developer has authority to submit a patch for +inclusion in openvswitch please sign off your work. The sign off +certifies the following: + + Developer's Certificate of Origin 1.1 + + By making a contribution to this project, I certify that: + + (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + + (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + + (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + + (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +Comments +-------- + +If you want to include any comments in your email that should not be +part of the commit's change log message, put them after the +description, separated by a line that contains just `---`. It may be +helpful to include a diffstat here for changes that touch multiple +files. + +Patch +----- + +The patch should be in the body of the email following the description, +separated by a blank line. + +Patches should be in `diff -up` format. We recommend that you use Git +to produce your patches, in which case you should use the `-M -C` +options to `git diff` (or other Git tools) if your patch renames or +copies files. Quilt (http://savannah.nongnu.org/projects/quilt) might +be useful if you do not want to use Git. + +Patches should be inline in the email message. Some email clients +corrupt white space or wrap lines in patches. There are hints on how +to configure many email clients to avoid this problem at: + http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/email-clients.txt +If you cannot convince your email client not to mangle patches, then +sending the patch as an attachment is a second choice. + +Please follow the style used in the code that you are modifying. The +[CodingStyle.md] file describes the coding style used in most of Open +vSwitch. Use Linux kernel coding style for Linux kernel code. + +Example +------- + +``` +From fa29a1c2c17682879e79a21bb0cdd5bbe67fa7c0 Mon Sep 17 00:00:00 2001 +From: Jesse Gross +Date: Thu, 8 Dec 2011 13:17:24 -0800 +Subject: [PATCH] datapath: Alphabetize include/net/ipv6.h compat header. + +Signed-off-by: Jesse Gross +--- + datapath/linux/Modules.mk | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk +index fdd952e..f6cb88e 100644 +--- a/datapath/linux/Modules.mk ++++ b/datapath/linux/Modules.mk +@@ -56,11 +56,11 @@ openvswitch_headers += \ + linux/compat/include/net/dst.h \ + linux/compat/include/net/genetlink.h \ + linux/compat/include/net/ip.h \ ++ linux/compat/include/net/ipv6.h \ + linux/compat/include/net/net_namespace.h \ + linux/compat/include/net/netlink.h \ + linux/compat/include/net/protocol.h \ + linux/compat/include/net/route.h \ +- linux/compat/include/net/ipv6.h \ + linux/compat/genetlink.inc + + both_modules += brcompat +-- +1.7.7.3 +``` + +[INSTALL.md]:INSTALL.md +[CodingStyle.md]:CodingStyle.md diff -Nru openvswitch-2.3.1/datapath/actions.c openvswitch-2.4.0~git20150623/datapath/actions.c --- openvswitch-2.3.1/datapath/actions.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/actions.c 2015-06-23 18:46:21.000000000 +0000 @@ -32,119 +32,256 @@ #include #include #include +#include #include #include "datapath.h" +#include "gso.h" #include "vlan.h" #include "vport.h" static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, + struct sw_flow_key *key, const struct nlattr *attr, int len); -static int make_writable(struct sk_buff *skb, int write_len) +struct deferred_action { + struct sk_buff *skb; + const struct nlattr *actions; + + /* Store pkt_key clone when creating deferred action. */ + struct sw_flow_key pkt_key; +}; + +#define DEFERRED_ACTION_FIFO_SIZE 10 +struct action_fifo { + int head; + int tail; + /* Deferred action fifo queue storage. */ + struct deferred_action fifo[DEFERRED_ACTION_FIFO_SIZE]; +}; + +static struct action_fifo __percpu *action_fifos; +#define EXEC_ACTIONS_LEVEL_LIMIT 4 /* limit used to detect packet + * looping by the network stack + */ +static DEFINE_PER_CPU(int, exec_actions_level); + +static void action_fifo_init(struct action_fifo *fifo) { - if (!skb_cloned(skb) || skb_clone_writable(skb, write_len)) - return 0; + fifo->head = 0; + fifo->tail = 0; +} + +static bool action_fifo_is_empty(const struct action_fifo *fifo) +{ + return (fifo->head == fifo->tail); +} + +static struct deferred_action *action_fifo_get(struct action_fifo *fifo) +{ + if (action_fifo_is_empty(fifo)) + return NULL; + + return &fifo->fifo[fifo->tail++]; +} + +static struct deferred_action *action_fifo_put(struct action_fifo *fifo) +{ + if (fifo->head >= DEFERRED_ACTION_FIFO_SIZE - 1) + return NULL; + + return &fifo->fifo[fifo->head++]; +} + +/* Return queue entry if fifo is not full */ +static struct deferred_action *add_deferred_actions(struct sk_buff *skb, + const struct sw_flow_key *key, + const struct nlattr *attr) +{ + struct action_fifo *fifo; + struct deferred_action *da; + + fifo = this_cpu_ptr(action_fifos); + da = action_fifo_put(fifo); + if (da) { + da->skb = skb; + da->actions = attr; + da->pkt_key = *key; + } + + return da; +} - return pskb_expand_head(skb, 0, 0, GFP_ATOMIC); +static void invalidate_flow_key(struct sw_flow_key *key) +{ + key->eth.type = htons(0); +} + +static bool is_flow_key_valid(const struct sw_flow_key *key) +{ + return !!key->eth.type; } -/* remove VLAN header from packet and update csum accordingly. */ -static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci) +static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key, + const struct ovs_action_push_mpls *mpls) { - struct vlan_hdr *vhdr; + __be32 *new_mpls_lse; + struct ethhdr *hdr; + + /* Networking stack do not allow simultaneous Tunnel and MPLS GSO. */ + if (skb_encapsulation(skb)) + return -ENOTSUPP; + + if (skb_cow_head(skb, MPLS_HLEN) < 0) + return -ENOMEM; + + skb_push(skb, MPLS_HLEN); + memmove(skb_mac_header(skb) - MPLS_HLEN, skb_mac_header(skb), + skb->mac_len); + skb_reset_mac_header(skb); + + new_mpls_lse = (__be32 *)skb_mpls_header(skb); + *new_mpls_lse = mpls->mpls_lse; + + if (skb->ip_summed == CHECKSUM_COMPLETE) + skb->csum = csum_add(skb->csum, csum_partial(new_mpls_lse, + MPLS_HLEN, 0)); + + hdr = eth_hdr(skb); + hdr->h_proto = mpls->mpls_ethertype; + if (!ovs_skb_get_inner_protocol(skb)) + ovs_skb_set_inner_protocol(skb, skb->protocol); + skb->protocol = mpls->mpls_ethertype; + + invalidate_flow_key(key); + return 0; +} + +static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, + const __be16 ethertype) +{ + struct ethhdr *hdr; int err; - err = make_writable(skb, VLAN_ETH_HLEN); + err = skb_ensure_writable(skb, skb->mac_len + MPLS_HLEN); if (unlikely(err)) return err; if (skb->ip_summed == CHECKSUM_COMPLETE) - skb->csum = csum_sub(skb->csum, csum_partial(skb->data - + (2 * ETH_ALEN), VLAN_HLEN, 0)); + skb->csum = csum_sub(skb->csum, + csum_partial(skb_mpls_header(skb), + MPLS_HLEN, 0)); - vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN); - *current_tci = vhdr->h_vlan_TCI; + memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb), + skb->mac_len); - memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN); - __skb_pull(skb, VLAN_HLEN); + __skb_pull(skb, MPLS_HLEN); + skb_reset_mac_header(skb); - vlan_set_encap_proto(skb, vhdr); - skb->mac_header += VLAN_HLEN; - skb_reset_mac_len(skb); + /* skb_mpls_header() is used to locate the ethertype + * field correctly in the presence of VLAN tags. + */ + hdr = (struct ethhdr *)(skb_mpls_header(skb) - ETH_HLEN); + hdr->h_proto = ethertype; + if (eth_p_mpls(skb->protocol)) + skb->protocol = ethertype; + invalidate_flow_key(key); return 0; } -static int pop_vlan(struct sk_buff *skb) +/* 'KEY' must not have any bits set outside of the 'MASK' */ +#define MASKED(OLD, KEY, MASK) ((KEY) | ((OLD) & ~(MASK))) +#define SET_MASKED(OLD, KEY, MASK) ((OLD) = MASKED(OLD, KEY, MASK)) + +static int set_mpls(struct sk_buff *skb, struct sw_flow_key *flow_key, + const __be32 *mpls_lse, const __be32 *mask) { - __be16 tci; + __be32 *stack; + __be32 lse; int err; - if (likely(vlan_tx_tag_present(skb))) { - vlan_set_tci(skb, 0); - } else { - if (unlikely(skb->protocol != htons(ETH_P_8021Q) || - skb->len < VLAN_ETH_HLEN)) - return 0; - - err = __pop_vlan_tci(skb, &tci); - if (err) - return err; - } - /* move next vlan tag to hw accel tag */ - if (likely(skb->protocol != htons(ETH_P_8021Q) || - skb->len < VLAN_ETH_HLEN)) - return 0; - - err = __pop_vlan_tci(skb, &tci); + err = skb_ensure_writable(skb, skb->mac_len + MPLS_HLEN); if (unlikely(err)) return err; - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(tci)); + stack = (__be32 *)skb_mpls_header(skb); + lse = MASKED(*stack, *mpls_lse, *mask); + if (skb->ip_summed == CHECKSUM_COMPLETE) { + __be32 diff[] = { ~(*stack), lse }; + + skb->csum = ~csum_partial((char *)diff, sizeof(diff), + ~skb->csum); + } + + *stack = lse; + flow_key->mpls.top_lse = lse; return 0; } -static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vlan) +static int pop_vlan(struct sk_buff *skb, struct sw_flow_key *key) { - if (unlikely(vlan_tx_tag_present(skb))) { - u16 current_tag; + int err; - /* push down current VLAN tag */ - current_tag = vlan_tx_tag_get(skb); + err = skb_vlan_pop(skb); + if (skb_vlan_tag_present(skb)) + invalidate_flow_key(key); + else + key->eth.tci = 0; - if (!__vlan_put_tag(skb, skb->vlan_proto, current_tag)) - return -ENOMEM; + return err; +} - if (skb->ip_summed == CHECKSUM_COMPLETE) - skb->csum = csum_add(skb->csum, csum_partial(skb->data - + (2 * ETH_ALEN), VLAN_HLEN, 0)); +static int push_vlan(struct sk_buff *skb, struct sw_flow_key *key, + const struct ovs_action_push_vlan *vlan) +{ + if (skb_vlan_tag_present(skb)) + invalidate_flow_key(key); + else + key->eth.tci = vlan->vlan_tci; - } - __vlan_hwaccel_put_tag(skb, vlan->vlan_tpid, ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT); - return 0; + return skb_vlan_push(skb, vlan->vlan_tpid, + ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT); } -static int set_eth_addr(struct sk_buff *skb, - const struct ovs_key_ethernet *eth_key) +/* 'src' is already properly masked. */ +static void ether_addr_copy_masked(u8 *dst_, const u8 *src_, const u8 *mask_) +{ + u16 *dst = (u16 *)dst_; + const u16 *src = (const u16 *)src_; + const u16 *mask = (const u16 *)mask_; + + SET_MASKED(dst[0], src[0], mask[0]); + SET_MASKED(dst[1], src[1], mask[1]); + SET_MASKED(dst[2], src[2], mask[2]); +} + +static int set_eth_addr(struct sk_buff *skb, struct sw_flow_key *flow_key, + const struct ovs_key_ethernet *key, + const struct ovs_key_ethernet *mask) { int err; - err = make_writable(skb, ETH_HLEN); + + err = skb_ensure_writable(skb, ETH_HLEN); if (unlikely(err)) return err; skb_postpull_rcsum(skb, eth_hdr(skb), ETH_ALEN * 2); - ether_addr_copy(eth_hdr(skb)->h_source, eth_key->eth_src); - ether_addr_copy(eth_hdr(skb)->h_dest, eth_key->eth_dst); + ether_addr_copy_masked(eth_hdr(skb)->h_source, key->eth_src, + mask->eth_src); + ether_addr_copy_masked(eth_hdr(skb)->h_dest, key->eth_dst, + mask->eth_dst); ovs_skb_postpush_rcsum(skb, eth_hdr(skb), ETH_ALEN * 2); + ether_addr_copy(flow_key->eth.src, eth_hdr(skb)->h_source); + ether_addr_copy(flow_key->eth.dst, eth_hdr(skb)->h_dest); return 0; } static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, - __be32 *addr, __be32 new_addr) + __be32 *addr, __be32 new_addr) { int transport_len = skb->len - skb_transport_offset(skb); @@ -197,231 +334,300 @@ } } +static void mask_ipv6_addr(const __be32 old[4], const __be32 addr[4], + const __be32 mask[4], __be32 masked[4]) +{ + masked[0] = MASKED(old[0], addr[0], mask[0]); + masked[1] = MASKED(old[1], addr[1], mask[1]); + masked[2] = MASKED(old[2], addr[2], mask[2]); + masked[3] = MASKED(old[3], addr[3], mask[3]); +} + static void set_ipv6_addr(struct sk_buff *skb, u8 l4_proto, __be32 addr[4], const __be32 new_addr[4], bool recalculate_csum) { - if (recalculate_csum) + if (likely(recalculate_csum)) update_ipv6_checksum(skb, l4_proto, addr, new_addr); skb_clear_hash(skb); memcpy(addr, new_addr, sizeof(__be32[4])); } -static void set_ipv6_tc(struct ipv6hdr *nh, u8 tc) +static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask) { - nh->priority = tc >> 4; - nh->flow_lbl[0] = (nh->flow_lbl[0] & 0x0F) | ((tc & 0x0F) << 4); + /* Bits 21-24 are always unmasked, so this retains their values. */ + SET_MASKED(nh->flow_lbl[0], (u8)(fl >> 16), (u8)(mask >> 16)); + SET_MASKED(nh->flow_lbl[1], (u8)(fl >> 8), (u8)(mask >> 8)); + SET_MASKED(nh->flow_lbl[2], (u8)fl, (u8)mask); } -static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl) +static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl, + u8 mask) { - nh->flow_lbl[0] = (nh->flow_lbl[0] & 0xF0) | (fl & 0x000F0000) >> 16; - nh->flow_lbl[1] = (fl & 0x0000FF00) >> 8; - nh->flow_lbl[2] = fl & 0x000000FF; -} + new_ttl = MASKED(nh->ttl, new_ttl, mask); -static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl) -{ csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8)); nh->ttl = new_ttl; } -static int set_ipv4(struct sk_buff *skb, const struct ovs_key_ipv4 *ipv4_key) +static int set_ipv4(struct sk_buff *skb, struct sw_flow_key *flow_key, + const struct ovs_key_ipv4 *key, + const struct ovs_key_ipv4 *mask) { struct iphdr *nh; + __be32 new_addr; int err; - err = make_writable(skb, skb_network_offset(skb) + - sizeof(struct iphdr)); + err = skb_ensure_writable(skb, skb_network_offset(skb) + + sizeof(struct iphdr)); if (unlikely(err)) return err; nh = ip_hdr(skb); - if (ipv4_key->ipv4_src != nh->saddr) - set_ip_addr(skb, nh, &nh->saddr, ipv4_key->ipv4_src); - - if (ipv4_key->ipv4_dst != nh->daddr) - set_ip_addr(skb, nh, &nh->daddr, ipv4_key->ipv4_dst); - - if (ipv4_key->ipv4_tos != nh->tos) - ipv4_change_dsfield(nh, 0, ipv4_key->ipv4_tos); + /* Setting an IP addresses is typically only a side effect of + * matching on them in the current userspace implementation, so it + * makes sense to check if the value actually changed. + */ + if (mask->ipv4_src) { + new_addr = MASKED(nh->saddr, key->ipv4_src, mask->ipv4_src); + + if (unlikely(new_addr != nh->saddr)) { + set_ip_addr(skb, nh, &nh->saddr, new_addr); + flow_key->ipv4.addr.src = new_addr; + } + } + if (mask->ipv4_dst) { + new_addr = MASKED(nh->daddr, key->ipv4_dst, mask->ipv4_dst); - if (ipv4_key->ipv4_ttl != nh->ttl) - set_ip_ttl(skb, nh, ipv4_key->ipv4_ttl); + if (unlikely(new_addr != nh->daddr)) { + set_ip_addr(skb, nh, &nh->daddr, new_addr); + flow_key->ipv4.addr.dst = new_addr; + } + } + if (mask->ipv4_tos) { + ipv4_change_dsfield(nh, ~mask->ipv4_tos, key->ipv4_tos); + flow_key->ip.tos = nh->tos; + } + if (mask->ipv4_ttl) { + set_ip_ttl(skb, nh, key->ipv4_ttl, mask->ipv4_ttl); + flow_key->ip.ttl = nh->ttl; + } return 0; } -static int set_ipv6(struct sk_buff *skb, const struct ovs_key_ipv6 *ipv6_key) +static bool is_ipv6_mask_nonzero(const __be32 addr[4]) +{ + return !!(addr[0] | addr[1] | addr[2] | addr[3]); +} + +static int set_ipv6(struct sk_buff *skb, struct sw_flow_key *flow_key, + const struct ovs_key_ipv6 *key, + const struct ovs_key_ipv6 *mask) { struct ipv6hdr *nh; int err; - __be32 *saddr; - __be32 *daddr; - err = make_writable(skb, skb_network_offset(skb) + - sizeof(struct ipv6hdr)); + err = skb_ensure_writable(skb, skb_network_offset(skb) + + sizeof(struct ipv6hdr)); if (unlikely(err)) return err; nh = ipv6_hdr(skb); - saddr = (__be32 *)&nh->saddr; - daddr = (__be32 *)&nh->daddr; - - if (memcmp(ipv6_key->ipv6_src, saddr, sizeof(ipv6_key->ipv6_src))) - set_ipv6_addr(skb, ipv6_key->ipv6_proto, saddr, - ipv6_key->ipv6_src, true); - if (memcmp(ipv6_key->ipv6_dst, daddr, sizeof(ipv6_key->ipv6_dst))) { + /* Setting an IP addresses is typically only a side effect of + * matching on them in the current userspace implementation, so it + * makes sense to check if the value actually changed. + */ + if (is_ipv6_mask_nonzero(mask->ipv6_src)) { + __be32 *saddr = (__be32 *)&nh->saddr; + __be32 masked[4]; + + mask_ipv6_addr(saddr, key->ipv6_src, mask->ipv6_src, masked); + + if (unlikely(memcmp(saddr, masked, sizeof(masked)))) { + set_ipv6_addr(skb, key->ipv6_proto, saddr, masked, + true); + memcpy(&flow_key->ipv6.addr.src, masked, + sizeof(flow_key->ipv6.addr.src)); + } + } + if (is_ipv6_mask_nonzero(mask->ipv6_dst)) { unsigned int offset = 0; int flags = IP6_FH_F_SKIP_RH; bool recalc_csum = true; + __be32 *daddr = (__be32 *)&nh->daddr; + __be32 masked[4]; - if (ipv6_ext_hdr(nh->nexthdr)) - recalc_csum = ipv6_find_hdr(skb, &offset, - NEXTHDR_ROUTING, NULL, - &flags) != NEXTHDR_ROUTING; + mask_ipv6_addr(daddr, key->ipv6_dst, mask->ipv6_dst, masked); - set_ipv6_addr(skb, ipv6_key->ipv6_proto, daddr, - ipv6_key->ipv6_dst, recalc_csum); + if (unlikely(memcmp(daddr, masked, sizeof(masked)))) { + if (ipv6_ext_hdr(nh->nexthdr)) + recalc_csum = (ipv6_find_hdr(skb, &offset, + NEXTHDR_ROUTING, + NULL, &flags) + != NEXTHDR_ROUTING); + + set_ipv6_addr(skb, key->ipv6_proto, daddr, masked, + recalc_csum); + memcpy(&flow_key->ipv6.addr.dst, masked, + sizeof(flow_key->ipv6.addr.dst)); + } + } + if (mask->ipv6_tclass) { + ipv6_change_dsfield(nh, ~mask->ipv6_tclass, key->ipv6_tclass); + flow_key->ip.tos = ipv6_get_dsfield(nh); + } + if (mask->ipv6_label) { + set_ipv6_fl(nh, ntohl(key->ipv6_label), + ntohl(mask->ipv6_label)); + flow_key->ipv6.label = + *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); + } + if (mask->ipv6_hlimit) { + SET_MASKED(nh->hop_limit, key->ipv6_hlimit, mask->ipv6_hlimit); + flow_key->ip.ttl = nh->hop_limit; } - - set_ipv6_tc(nh, ipv6_key->ipv6_tclass); - set_ipv6_fl(nh, ntohl(ipv6_key->ipv6_label)); - nh->hop_limit = ipv6_key->ipv6_hlimit; - return 0; } -/* Must follow make_writable() since that can move the skb data. */ +/* Must follow skb_ensure_writable() since that can move the skb data. */ static void set_tp_port(struct sk_buff *skb, __be16 *port, - __be16 new_port, __sum16 *check) + __be16 new_port, __sum16 *check) { inet_proto_csum_replace2(check, skb, *port, new_port, 0); *port = new_port; - skb_clear_hash(skb); -} - -static void set_udp_port(struct sk_buff *skb, __be16 *port, __be16 new_port) -{ - struct udphdr *uh = udp_hdr(skb); - - if (uh->check && skb->ip_summed != CHECKSUM_PARTIAL) { - set_tp_port(skb, port, new_port, &uh->check); - - if (!uh->check) - uh->check = CSUM_MANGLED_0; - } else { - *port = new_port; - skb_clear_hash(skb); - } } -static int set_udp(struct sk_buff *skb, const struct ovs_key_udp *udp_port_key) +static int set_udp(struct sk_buff *skb, struct sw_flow_key *flow_key, + const struct ovs_key_udp *key, + const struct ovs_key_udp *mask) { struct udphdr *uh; + __be16 src, dst; int err; - err = make_writable(skb, skb_transport_offset(skb) + - sizeof(struct udphdr)); + err = skb_ensure_writable(skb, skb_transport_offset(skb) + + sizeof(struct udphdr)); if (unlikely(err)) return err; uh = udp_hdr(skb); - if (udp_port_key->udp_src != uh->source) - set_udp_port(skb, &uh->source, udp_port_key->udp_src); + /* Either of the masks is non-zero, so do not bother checking them. */ + src = MASKED(uh->source, key->udp_src, mask->udp_src); + dst = MASKED(uh->dest, key->udp_dst, mask->udp_dst); - if (udp_port_key->udp_dst != uh->dest) - set_udp_port(skb, &uh->dest, udp_port_key->udp_dst); + if (uh->check && skb->ip_summed != CHECKSUM_PARTIAL) { + if (likely(src != uh->source)) { + set_tp_port(skb, &uh->source, src, &uh->check); + flow_key->tp.src = src; + } + if (likely(dst != uh->dest)) { + set_tp_port(skb, &uh->dest, dst, &uh->check); + flow_key->tp.dst = dst; + } + + if (unlikely(!uh->check)) + uh->check = CSUM_MANGLED_0; + } else { + uh->source = src; + uh->dest = dst; + flow_key->tp.src = src; + flow_key->tp.dst = dst; + } + + skb_clear_hash(skb); return 0; } -static int set_tcp(struct sk_buff *skb, const struct ovs_key_tcp *tcp_port_key) +static int set_tcp(struct sk_buff *skb, struct sw_flow_key *flow_key, + const struct ovs_key_tcp *key, + const struct ovs_key_tcp *mask) { struct tcphdr *th; + __be16 src, dst; int err; - err = make_writable(skb, skb_transport_offset(skb) + - sizeof(struct tcphdr)); + err = skb_ensure_writable(skb, skb_transport_offset(skb) + + sizeof(struct tcphdr)); if (unlikely(err)) return err; th = tcp_hdr(skb); - if (tcp_port_key->tcp_src != th->source) - set_tp_port(skb, &th->source, tcp_port_key->tcp_src, &th->check); - if (tcp_port_key->tcp_dst != th->dest) - set_tp_port(skb, &th->dest, tcp_port_key->tcp_dst, &th->check); + src = MASKED(th->source, key->tcp_src, mask->tcp_src); + if (likely(src != th->source)) { + set_tp_port(skb, &th->source, src, &th->check); + flow_key->tp.src = src; + } + dst = MASKED(th->dest, key->tcp_dst, mask->tcp_dst); + if (likely(dst != th->dest)) { + set_tp_port(skb, &th->dest, dst, &th->check); + flow_key->tp.dst = dst; + } + skb_clear_hash(skb); return 0; } -static int set_sctp(struct sk_buff *skb, - const struct ovs_key_sctp *sctp_port_key) +static int set_sctp(struct sk_buff *skb, struct sw_flow_key *flow_key, + const struct ovs_key_sctp *key, + const struct ovs_key_sctp *mask) { + unsigned int sctphoff = skb_transport_offset(skb); struct sctphdr *sh; + __le32 old_correct_csum, new_csum, old_csum; int err; - unsigned int sctphoff = skb_transport_offset(skb); - err = make_writable(skb, sctphoff + sizeof(struct sctphdr)); + err = skb_ensure_writable(skb, sctphoff + sizeof(struct sctphdr)); if (unlikely(err)) return err; sh = sctp_hdr(skb); - if (sctp_port_key->sctp_src != sh->source || - sctp_port_key->sctp_dst != sh->dest) { - __le32 old_correct_csum, new_csum, old_csum; - old_csum = sh->checksum; - old_correct_csum = sctp_compute_cksum(skb, sctphoff); + old_csum = sh->checksum; + old_correct_csum = sctp_compute_cksum(skb, sctphoff); - sh->source = sctp_port_key->sctp_src; - sh->dest = sctp_port_key->sctp_dst; + sh->source = MASKED(sh->source, key->sctp_src, mask->sctp_src); + sh->dest = MASKED(sh->dest, key->sctp_dst, mask->sctp_dst); - new_csum = sctp_compute_cksum(skb, sctphoff); + new_csum = sctp_compute_cksum(skb, sctphoff); - /* Carry any checksum errors through. */ - sh->checksum = old_csum ^ old_correct_csum ^ new_csum; + /* Carry any checksum errors through. */ + sh->checksum = old_csum ^ old_correct_csum ^ new_csum; - skb_clear_hash(skb); - } + skb_clear_hash(skb); + flow_key->tp.src = sh->source; + flow_key->tp.dst = sh->dest; return 0; } -static int do_output(struct datapath *dp, struct sk_buff *skb, int out_port) +static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port) { - struct vport *vport; - - if (unlikely(!skb)) - return -ENOMEM; + struct vport *vport = ovs_vport_rcu(dp, out_port); - vport = ovs_vport_rcu(dp, out_port); - if (unlikely(!vport)) { + if (likely(vport)) + ovs_vport_send(vport, skb); + else kfree_skb(skb); - return -ENODEV; - } - - ovs_vport_send(vport, skb); - return 0; } static int output_userspace(struct datapath *dp, struct sk_buff *skb, - const struct nlattr *attr) + struct sw_flow_key *key, const struct nlattr *attr) { + struct ovs_tunnel_info info; struct dp_upcall_info upcall; const struct nlattr *a; int rem; - BUG_ON(!OVS_CB(skb)->pkt_key); - upcall.cmd = OVS_PACKET_CMD_ACTION; - upcall.key = OVS_CB(skb)->pkt_key; upcall.userdata = NULL; upcall.portid = 0; + upcall.egress_tun_info = NULL; for (a = nla_data(attr), rem = nla_len(attr); rem > 0; a = nla_next(a, &rem)) { @@ -433,23 +639,34 @@ case OVS_USERSPACE_ATTR_PID: upcall.portid = nla_get_u32(a); break; + + case OVS_USERSPACE_ATTR_EGRESS_TUN_PORT: { + /* Get out tunnel info. */ + struct vport *vport; + + vport = ovs_vport_rcu(dp, nla_get_u32(a)); + if (vport) { + int err; + + err = ovs_vport_get_egress_tun_info(vport, skb, + &info); + if (!err) + upcall.egress_tun_info = &info; + } + break; } - } - return ovs_dp_upcall(dp, skb, &upcall); -} + } /* End of switch. */ + } -static bool last_action(const struct nlattr *a, int rem) -{ - return a->nla_len == rem; + return ovs_dp_upcall(dp, skb, key, &upcall); } static int sample(struct datapath *dp, struct sk_buff *skb, - const struct nlattr *attr) + struct sw_flow_key *key, const struct nlattr *attr) { const struct nlattr *acts_list = NULL; const struct nlattr *a; - struct sk_buff *sample_skb; int rem; for (a = nla_data(attr), rem = nla_len(attr); rem > 0; @@ -469,33 +686,37 @@ rem = nla_len(acts_list); a = nla_data(acts_list); - /* Actions list is either empty or only contains a single user-space - * action, the latter being a special case as it is the only known - * usage of the sample action. - * In these special cases don't clone the skb as there are no - * side-effects in the nested actions. - * Otherwise, clone in case the nested actions have side effects. */ - if (likely(rem == 0 || - (nla_type(a) == OVS_ACTION_ATTR_USERSPACE && - last_action(a, rem)))) { - sample_skb = skb; - skb_get(skb); - } else { - sample_skb = skb_clone(skb, GFP_ATOMIC); - } + /* Actions list is empty, do nothing */ + if (unlikely(!rem)) + return 0; - /* Note that do_execute_actions() never consumes skb. - * In the case where skb has been cloned above it is the clone that - * is consumed. Otherwise the skb_get(skb) call prevents - * consumption by do_execute_actions(). Thus, it is safe to simply - * return the error code and let the caller (also - * do_execute_actions()) free skb on error. */ - return do_execute_actions(dp, sample_skb, a, rem); + /* The only known usage of sample action is having a single user-space + * action. Treat this usage as a special case. + * The output_userspace() should clone the skb to be sent to the + * user space. This skb will be consumed by its caller. + */ + if (likely(nla_type(a) == OVS_ACTION_ATTR_USERSPACE && + nla_is_last(a, rem))) + return output_userspace(dp, skb, key, a); + + skb = skb_clone(skb, GFP_ATOMIC); + if (!skb) + /* Skip the sample action when out of memory. */ + return 0; + + if (!add_deferred_actions(skb, key, a)) { + if (net_ratelimit()) + pr_warn("%s: deferred actions limit reached, dropping sample action\n", + ovs_dp_name(dp)); + + kfree_skb(skb); + } + return 0; } -static void execute_hash(struct sk_buff *skb, const struct nlattr *attr) +static void execute_hash(struct sk_buff *skb, struct sw_flow_key *key, + const struct nlattr *attr) { - struct sw_flow_key *key = OVS_CB(skb)->pkt_key; struct ovs_action_hash *hash_act = nla_data(attr); u32 hash = 0; @@ -509,45 +730,77 @@ } static int execute_set_action(struct sk_buff *skb, - const struct nlattr *nested_attr) + struct sw_flow_key *flow_key, + const struct nlattr *a) +{ + /* Only tunnel set execution is supported without a mask. */ + if (nla_type(a) == OVS_KEY_ATTR_TUNNEL_INFO) { + OVS_CB(skb)->egress_tun_info = nla_data(a); + return 0; + } + + return -EINVAL; + +} + +/* Mask is at the midpoint of the data. */ +#define get_mask(a, type) ((const type)nla_data(a) + 1) + +static int execute_masked_set_action(struct sk_buff *skb, + struct sw_flow_key *flow_key, + const struct nlattr *a) { int err = 0; - switch (nla_type(nested_attr)) { + switch (nla_type(a)) { case OVS_KEY_ATTR_PRIORITY: - skb->priority = nla_get_u32(nested_attr); + SET_MASKED(skb->priority, nla_get_u32(a), *get_mask(a, u32 *)); + flow_key->phy.priority = skb->priority; break; case OVS_KEY_ATTR_SKB_MARK: - skb->mark = nla_get_u32(nested_attr); + SET_MASKED(skb->mark, nla_get_u32(a), *get_mask(a, u32 *)); + flow_key->phy.skb_mark = skb->mark; break; - case OVS_KEY_ATTR_IPV4_TUNNEL: - OVS_CB(skb)->tun_key = nla_data(nested_attr); + case OVS_KEY_ATTR_TUNNEL_INFO: + /* Masked data not supported for tunnel. */ + err = -EINVAL; break; case OVS_KEY_ATTR_ETHERNET: - err = set_eth_addr(skb, nla_data(nested_attr)); + err = set_eth_addr(skb, flow_key, nla_data(a), + get_mask(a, struct ovs_key_ethernet *)); break; case OVS_KEY_ATTR_IPV4: - err = set_ipv4(skb, nla_data(nested_attr)); + err = set_ipv4(skb, flow_key, nla_data(a), + get_mask(a, struct ovs_key_ipv4 *)); break; case OVS_KEY_ATTR_IPV6: - err = set_ipv6(skb, nla_data(nested_attr)); + err = set_ipv6(skb, flow_key, nla_data(a), + get_mask(a, struct ovs_key_ipv6 *)); break; case OVS_KEY_ATTR_TCP: - err = set_tcp(skb, nla_data(nested_attr)); + err = set_tcp(skb, flow_key, nla_data(a), + get_mask(a, struct ovs_key_tcp *)); break; case OVS_KEY_ATTR_UDP: - err = set_udp(skb, nla_data(nested_attr)); + err = set_udp(skb, flow_key, nla_data(a), + get_mask(a, struct ovs_key_udp *)); break; case OVS_KEY_ATTR_SCTP: - err = set_sctp(skb, nla_data(nested_attr)); + err = set_sctp(skb, flow_key, nla_data(a), + get_mask(a, struct ovs_key_sctp *)); + break; + + case OVS_KEY_ATTR_MPLS: + err = set_mpls(skb, flow_key, nla_data(a), get_mask(a, + __be32 *)); break; } @@ -555,32 +808,57 @@ } static int execute_recirc(struct datapath *dp, struct sk_buff *skb, - const struct nlattr *a) + struct sw_flow_key *key, + const struct nlattr *a, int rem) { - struct sw_flow_key recirc_key; - int err; + struct deferred_action *da; - err = ovs_flow_key_extract_recirc(nla_get_u32(a), OVS_CB(skb)->pkt_key, - skb, &recirc_key); - if (err) { - kfree_skb(skb); - return err; + if (!is_flow_key_valid(key)) { + int err; + + err = ovs_flow_key_update(skb, key); + if (err) + return err; } + BUG_ON(!is_flow_key_valid(key)); + if (!nla_is_last(a, rem)) { + /* Recirc action is the not the last action + * of the action list, need to clone the skb. + */ + skb = skb_clone(skb, GFP_ATOMIC); + + /* Skip the recirc action when out of memory, but + * continue on with the rest of the action list. + */ + if (!skb) + return 0; + } - ovs_dp_process_packet_with_key(skb, &recirc_key, true); + da = add_deferred_actions(skb, key, NULL); + if (da) { + da->pkt_key.recirc_id = nla_get_u32(a); + } else { + kfree_skb(skb); + + if (net_ratelimit()) + pr_warn("%s: deferred action limit reached, drop recirc action\n", + ovs_dp_name(dp)); + } return 0; } /* Execute a list of actions against 'skb'. */ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, - const struct nlattr *attr, int len) + struct sw_flow_key *key, + const struct nlattr *attr, int len) { /* Every output action needs a separate clone of 'skb', but the common * case is just a single output action, so that doing a clone and * then freeing the original skbuff is wasteful. So the following code - * is slightly obscure just to avoid that. */ + * is slightly obscure just to avoid that. + */ int prev_port = -1; const struct nlattr *a; int rem; @@ -589,8 +867,12 @@ a = nla_next(a, &rem)) { int err = 0; - if (prev_port != -1) { - do_output(dp, skb_clone(skb, GFP_ATOMIC), prev_port); + if (unlikely(prev_port != -1)) { + struct sk_buff *out_skb = skb_clone(skb, GFP_ATOMIC); + + if (out_skb) + do_output(dp, out_skb, prev_port); + prev_port = -1; } @@ -600,47 +882,51 @@ break; case OVS_ACTION_ATTR_USERSPACE: - output_userspace(dp, skb, a); + output_userspace(dp, skb, key, a); break; case OVS_ACTION_ATTR_HASH: - execute_hash(skb, a); + execute_hash(skb, key, a); break; - case OVS_ACTION_ATTR_PUSH_VLAN: - err = push_vlan(skb, nla_data(a)); - if (unlikely(err)) /* skb already freed. */ - return err; + case OVS_ACTION_ATTR_PUSH_MPLS: + err = push_mpls(skb, key, nla_data(a)); break; - case OVS_ACTION_ATTR_POP_VLAN: - err = pop_vlan(skb); + case OVS_ACTION_ATTR_POP_MPLS: + err = pop_mpls(skb, key, nla_get_be16(a)); break; - case OVS_ACTION_ATTR_RECIRC: { - struct sk_buff *recirc_skb; - - if (last_action(a, rem)) - return execute_recirc(dp, skb, a); - - /* Recirc action is the not the last action - * of the action list. */ - recirc_skb = skb_clone(skb, GFP_ATOMIC); + case OVS_ACTION_ATTR_PUSH_VLAN: + err = push_vlan(skb, key, nla_data(a)); + break; - /* Skip the recirc action when out of memory, but - * continue on with the rest of the action list. */ - if (recirc_skb) - err = execute_recirc(dp, recirc_skb, a); + case OVS_ACTION_ATTR_POP_VLAN: + err = pop_vlan(skb, key); + break; + case OVS_ACTION_ATTR_RECIRC: + err = execute_recirc(dp, skb, key, a, rem); + if (nla_is_last(a, rem)) { + /* If this is the last action, the skb has + * been consumed or freed. + * Return immediately. + */ + return err; + } break; - } case OVS_ACTION_ATTR_SET: - err = execute_set_action(skb, nla_data(a)); + err = execute_set_action(skb, key, nla_data(a)); + break; + + case OVS_ACTION_ATTR_SET_MASKED: + case OVS_ACTION_ATTR_SET_TO_MASKED: + err = execute_masked_set_action(skb, key, nla_data(a)); break; case OVS_ACTION_ATTR_SAMPLE: - err = sample(dp, skb, a); + err = sample(dp, skb, key, a); break; } @@ -658,64 +944,75 @@ return 0; } -/* We limit the number of times that we pass into execute_actions() - * to avoid blowing out the stack in the event that we have a loop. - * - * Each loop adds some (estimated) cost to the kernel stack. - * The loop terminates when the max cost is exceeded. - * */ -#define RECIRC_STACK_COST 1 -#define DEFAULT_STACK_COST 4 -/* Allow up to 4 regular services, and up to 3 recirculations */ -#define MAX_STACK_COST (DEFAULT_STACK_COST * 4 + RECIRC_STACK_COST * 3) - -struct loop_counter { - u8 stack_cost; /* loop stack cost. */ - bool looping; /* Loop detected? */ -}; +static void process_deferred_actions(struct datapath *dp) +{ + struct action_fifo *fifo = this_cpu_ptr(action_fifos); -static DEFINE_PER_CPU(struct loop_counter, loop_counters); + /* Do not touch the FIFO in case there is no deferred actions. */ + if (action_fifo_is_empty(fifo)) + return; + + /* Finishing executing all deferred actions. */ + do { + struct deferred_action *da = action_fifo_get(fifo); + struct sk_buff *skb = da->skb; + struct sw_flow_key *key = &da->pkt_key; + const struct nlattr *actions = da->actions; + + if (actions) + do_execute_actions(dp, skb, key, actions, + nla_len(actions)); + else + ovs_dp_process_packet(skb, key); + } while (!action_fifo_is_empty(fifo)); -static int loop_suppress(struct datapath *dp, struct sw_flow_actions *actions) -{ - if (net_ratelimit()) - pr_warn("%s: flow loop detected, dropping\n", - ovs_dp_name(dp)); - actions->actions_len = 0; - return -ELOOP; + /* Reset FIFO for the next packet. */ + action_fifo_init(fifo); } /* Execute a list of actions against 'skb'. */ -int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb, bool recirc) +int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb, + const struct sw_flow_actions *acts, + struct sw_flow_key *key) { - struct sw_flow_actions *acts = rcu_dereference(OVS_CB(skb)->flow->sf_acts); - const u8 stack_cost = recirc ? RECIRC_STACK_COST : DEFAULT_STACK_COST; - struct loop_counter *loop; - int error; - - /* Check whether we've looped too much. */ - loop = &__get_cpu_var(loop_counters); - loop->stack_cost += stack_cost; - if (unlikely(loop->stack_cost > MAX_STACK_COST)) - loop->looping = true; - if (unlikely(loop->looping)) { - error = loop_suppress(dp, acts); + int level = this_cpu_read(exec_actions_level); + int err; + + if (unlikely(level >= EXEC_ACTIONS_LEVEL_LIMIT)) { + if (net_ratelimit()) + pr_warn("%s: packet loop detected, dropping.\n", + ovs_dp_name(dp)); + kfree_skb(skb); - goto out_loop; + return -ELOOP; } - OVS_CB(skb)->tun_key = NULL; - error = do_execute_actions(dp, skb, acts->actions, acts->actions_len); + this_cpu_inc(exec_actions_level); + err = do_execute_actions(dp, skb, key, + acts->actions, acts->actions_len); + + if (!level) + process_deferred_actions(dp); + + this_cpu_dec(exec_actions_level); + + /* This return status currently does not reflect the errors + * encounted during deferred actions execution. Probably needs to + * be fixed in the future. + */ + return err; +} - /* Check whether sub-actions looped too much. */ - if (unlikely(loop->looping)) - error = loop_suppress(dp, acts); +int action_fifos_init(void) +{ + action_fifos = alloc_percpu(struct action_fifo); + if (!action_fifos) + return -ENOMEM; -out_loop: - /* Decrement loop stack cost. */ - loop->stack_cost -= stack_cost; - if (!loop->stack_cost) - loop->looping = false; + return 0; +} - return error; +void action_fifos_exit(void) +{ + free_percpu(action_fifos); } diff -Nru openvswitch-2.3.1/datapath/compat.h openvswitch-2.4.0~git20150623/datapath/compat.h --- openvswitch-2.3.1/datapath/compat.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/compat.h 2015-06-23 18:46:21.000000000 +0000 @@ -25,10 +25,10 @@ #include #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) -#define GROUP_ID(grp) 0 -#else +#ifdef HAVE_GENL_MULTICAST_GROUP_WITH_ID #define GROUP_ID(grp) ((grp)->id) +#else +#define GROUP_ID(grp) 0 #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) @@ -49,7 +49,8 @@ { struct rtable *rt; /* Tunnel configuration keeps DSCP part of TOS bits, But Linux - * router expect RT_TOS bits only. */ + * router expect RT_TOS bits only. + */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) struct flowi fl = { .nl_u = { .ip4_u = { @@ -75,4 +76,14 @@ return rt; #endif } + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) +static inline bool skb_encapsulation(struct sk_buff *skb) +{ + return skb->encapsulation; +} +#else +#define skb_encapsulation(skb) false +#endif + #endif /* compat.h */ diff -Nru openvswitch-2.3.1/datapath/datapath.c openvswitch-2.4.0~git20150623/datapath/datapath.c --- openvswitch-2.3.1/datapath/datapath.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/datapath.c 2015-06-23 18:46:21.000000000 +0000 @@ -48,8 +48,6 @@ #include #include #include -#include -#include #include #include #include @@ -63,11 +61,14 @@ #include "vport-netdev.h" int ovs_net_id __read_mostly; +EXPORT_SYMBOL_GPL(ovs_net_id); static struct genl_family dp_packet_genl_family; static struct genl_family dp_flow_genl_family; static struct genl_family dp_datapath_genl_family; +static const struct nla_policy flow_policy[]; + static struct genl_multicast_group ovs_dp_flow_multicast_group = { .name = OVS_FLOW_MCGROUP }; @@ -81,12 +82,13 @@ }; /* Check if need to build a reply message. - * OVS userspace sets the NLM_F_ECHO flag if it needs the reply. */ -static bool ovs_must_notify(struct genl_info *info, - const struct genl_multicast_group *grp) + * OVS userspace sets the NLM_F_ECHO flag if it needs the reply. + */ +static bool ovs_must_notify(struct genl_family *family, struct genl_info *info, + unsigned int group) { return info->nlhdr->nlmsg_flags & NLM_F_ECHO || - netlink_has_listeners(genl_info_net(info)->genl_sock, GROUP_ID(grp)); + genl_has_listeners(family, genl_info_net(info), group); } static void ovs_notify(struct genl_family *family, struct genl_multicast_group *grp, @@ -133,26 +135,40 @@ else return 1; } +EXPORT_SYMBOL_GPL(lockdep_ovsl_is_held); #endif static int queue_gso_packets(struct datapath *dp, struct sk_buff *, + const struct sw_flow_key *, const struct dp_upcall_info *); static int queue_userspace_packet(struct datapath *dp, struct sk_buff *, + const struct sw_flow_key *, const struct dp_upcall_info *); -/* Must be called with rcu_read_lock or ovs_mutex. */ -static struct datapath *get_dp(struct net *net, int dp_ifindex) +/* Must be called with rcu_read_lock. */ +static struct datapath *get_dp_rcu(struct net *net, int dp_ifindex) { - struct datapath *dp = NULL; - struct net_device *dev; + struct net_device *dev = dev_get_by_index_rcu(net, dp_ifindex); - rcu_read_lock(); - dev = dev_get_by_index_rcu(net, dp_ifindex); if (dev) { struct vport *vport = ovs_internal_dev_get_vport(dev); if (vport) - dp = vport->dp; + return vport->dp; } + + return NULL; +} + +/* The caller must hold either ovs_mutex or rcu_read_lock to keep the + * returned dp pointer valid. + */ +static inline struct datapath *get_dp(struct net *net, int dp_ifindex) +{ + struct datapath *dp; + + WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_ovsl_is_held()); + rcu_read_lock(); + dp = get_dp_rcu(net, dp_ifindex); rcu_read_unlock(); return dp; @@ -165,7 +181,7 @@ return vport->ops->get_name(vport); } -static int get_dpifindex(struct datapath *dp) +static int get_dpifindex(const struct datapath *dp) { struct vport *local; int ifindex; @@ -240,13 +256,13 @@ ovs_vport_del(p); } -void ovs_dp_process_packet_with_key(struct sk_buff *skb, - struct sw_flow_key *pkt_key, - bool recirc) +/* Must be called with rcu_read_lock. */ +void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key) { const struct vport *p = OVS_CB(skb)->input_vport; struct datapath *dp = p->dp; struct sw_flow *flow; + struct sw_flow_actions *sf_acts; struct dp_stats_percpu *stats; u64 *stats_counter; u32 n_mask_hit; @@ -254,55 +270,41 @@ stats = this_cpu_ptr(dp->stats_percpu); /* Look up flow. */ - flow = ovs_flow_tbl_lookup_stats(&dp->table, pkt_key, skb_get_hash(skb), + flow = ovs_flow_tbl_lookup_stats(&dp->table, key, skb_get_hash(skb), &n_mask_hit); if (unlikely(!flow)) { struct dp_upcall_info upcall; + int error; upcall.cmd = OVS_PACKET_CMD_MISS; - upcall.key = pkt_key; upcall.userdata = NULL; upcall.portid = ovs_vport_find_upcall_portid(p, skb); - ovs_dp_upcall(dp, skb, &upcall); - consume_skb(skb); + upcall.egress_tun_info = NULL; + error = ovs_dp_upcall(dp, skb, key, &upcall); + if (unlikely(error)) + kfree_skb(skb); + else + consume_skb(skb); stats_counter = &stats->n_missed; goto out; } - OVS_CB(skb)->pkt_key = pkt_key; - OVS_CB(skb)->flow = flow; + ovs_flow_stats_update(flow, key->tp.flags, skb); + sf_acts = rcu_dereference(flow->sf_acts); + ovs_execute_actions(dp, skb, sf_acts, key); - ovs_flow_stats_update(OVS_CB(skb)->flow, pkt_key->tp.flags, skb); - ovs_execute_actions(dp, skb, recirc); stats_counter = &stats->n_hit; out: /* Update datapath statistics. */ - u64_stats_update_begin(&stats->sync); + u64_stats_update_begin(&stats->syncp); (*stats_counter)++; stats->n_mask_hit += n_mask_hit; - u64_stats_update_end(&stats->sync); -} - -/* Must be called with rcu_read_lock. */ -void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb) -{ - int error; - struct sw_flow_key key; - - OVS_CB(skb)->input_vport = p; - - /* Extract flow from 'skb' into 'key'. */ - error = ovs_flow_key_extract(skb, &key); - if (unlikely(error)) { - kfree_skb(skb); - return; - } - - ovs_dp_process_packet_with_key(skb, &key, false); + u64_stats_update_end(&stats->syncp); } int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb, + const struct sw_flow_key *key, const struct dp_upcall_info *upcall_info) { struct dp_stats_percpu *stats; @@ -314,9 +316,9 @@ } if (!skb_is_gso(skb)) - err = queue_userspace_packet(dp, skb, upcall_info); + err = queue_userspace_packet(dp, skb, key, upcall_info); else - err = queue_gso_packets(dp, skb, upcall_info); + err = queue_gso_packets(dp, skb, key, upcall_info); if (err) goto err; @@ -325,18 +327,18 @@ err: stats = this_cpu_ptr(dp->stats_percpu); - u64_stats_update_begin(&stats->sync); + u64_stats_update_begin(&stats->syncp); stats->n_lost++; - u64_stats_update_end(&stats->sync); + u64_stats_update_end(&stats->syncp); return err; } static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, + const struct sw_flow_key *key, const struct dp_upcall_info *upcall_info) { unsigned short gso_type = skb_shinfo(skb)->gso_type; - struct dp_upcall_info later_info; struct sw_flow_key later_key; struct sk_buff *segs, *nskb; struct ovs_skb_cb ovs_cb; @@ -350,26 +352,26 @@ if (segs == NULL) return -EINVAL; + if (gso_type & SKB_GSO_UDP) { + /* The initial flow key extracted by ovs_flow_key_extract() + * in this case is for a first fragment, so we need to + * properly mark later fragments. + */ + later_key = *key; + later_key.ip.frag = OVS_FRAG_TYPE_LATER; + } + /* Queue all of the segments. */ skb = segs; do { *OVS_CB(skb) = ovs_cb; - err = queue_userspace_packet(dp, skb, upcall_info); + if (gso_type & SKB_GSO_UDP && skb != segs) + key = &later_key; + + err = queue_userspace_packet(dp, skb, key, upcall_info); if (err) break; - if (skb == segs && gso_type & SKB_GSO_UDP) { - /* The initial flow key extracted by ovs_flow_extract() - * in this case is for a first fragment, so we need to - * properly mark later fragments. - */ - later_key = *upcall_info->key; - later_key.ip.frag = OVS_FRAG_TYPE_LATER; - - later_info = *upcall_info; - later_info.key = &later_key; - upcall_info = &later_info; - } } while ((skb = skb->next)); /* Free all of the segments. */ @@ -384,55 +386,31 @@ return err; } -static size_t key_attr_size(void) -{ - /* Whenever adding new OVS_KEY_ FIELDS, we should consider - * updating this function. */ - BUILD_BUG_ON(OVS_KEY_ATTR_IPV4_TUNNEL != 21); - - return nla_total_size(4) /* OVS_KEY_ATTR_PRIORITY */ - + nla_total_size(0) /* OVS_KEY_ATTR_TUNNEL */ - + nla_total_size(8) /* OVS_TUNNEL_KEY_ATTR_ID */ - + nla_total_size(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_SRC */ - + nla_total_size(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_DST */ - + nla_total_size(1) /* OVS_TUNNEL_KEY_ATTR_TOS */ - + nla_total_size(1) /* OVS_TUNNEL_KEY_ATTR_TTL */ - + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT */ - + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_CSUM */ - + nla_total_size(4) /* OVS_KEY_ATTR_IN_PORT */ - + nla_total_size(4) /* OVS_KEY_ATTR_SKB_MARK */ - + nla_total_size(4) /* OVS_KEY_ATTR_DP_HASH */ - + nla_total_size(4) /* OVS_KEY_ATTR_RECIRC_ID */ - + nla_total_size(12) /* OVS_KEY_ATTR_ETHERNET */ - + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */ - + nla_total_size(4) /* OVS_KEY_ATTR_8021Q */ - + nla_total_size(0) /* OVS_KEY_ATTR_ENCAP */ - + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */ - + nla_total_size(40) /* OVS_KEY_ATTR_IPV6 */ - + nla_total_size(2) /* OVS_KEY_ATTR_ICMPV6 */ - + nla_total_size(28); /* OVS_KEY_ATTR_ND */ -} - -static size_t upcall_msg_size(const struct nlattr *userdata, +static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info, unsigned int hdrlen) { size_t size = NLMSG_ALIGN(sizeof(struct ovs_header)) + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */ - + nla_total_size(key_attr_size()); /* OVS_PACKET_ATTR_KEY */ + + nla_total_size(ovs_key_attr_size()); /* OVS_PACKET_ATTR_KEY */ /* OVS_PACKET_ATTR_USERDATA */ - if (userdata) - size += NLA_ALIGN(userdata->nla_len); + if (upcall_info->userdata) + size += NLA_ALIGN(upcall_info->userdata->nla_len); + + /* OVS_PACKET_ATTR_EGRESS_TUN_KEY */ + if (upcall_info->egress_tun_info) + size += nla_total_size(ovs_tun_key_attr_size()); return size; } static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, + const struct sw_flow_key *key, const struct dp_upcall_info *upcall_info) { struct ovs_header *upcall; struct sk_buff *nskb = NULL; - struct sk_buff *user_skb; /* to be queued to userspace */ + struct sk_buff *user_skb = NULL; /* to be queued to userspace */ struct nlattr *nla; struct genl_info info = { #ifdef HAVE_GENLMSG_NEW_UNICAST @@ -448,12 +426,12 @@ if (!dp_ifindex) return -ENODEV; - if (vlan_tx_tag_present(skb)) { + if (skb_vlan_tag_present(skb)) { nskb = skb_clone(skb, GFP_ATOMIC); if (!nskb) return -ENOMEM; - nskb = __vlan_put_tag(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb)); + nskb = vlan_insert_tag_set_proto(nskb, nskb->vlan_proto, skb_vlan_tag_get(nskb)); if (!nskb) return -ENOMEM; @@ -481,7 +459,7 @@ else hlen = skb->len; - len = upcall_msg_size(upcall_info->userdata, hlen); + len = upcall_msg_size(upcall_info, hlen); user_skb = genlmsg_new_unicast(len, &info, GFP_ATOMIC); if (!user_skb) { err = -ENOMEM; @@ -492,18 +470,25 @@ 0, upcall_info->cmd); upcall->dp_ifindex = dp_ifindex; - nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_KEY); - err = ovs_nla_put_flow(upcall_info->key, upcall_info->key, user_skb); + err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb); BUG_ON(err); - nla_nest_end(user_skb, nla); if (upcall_info->userdata) __nla_put(user_skb, OVS_PACKET_ATTR_USERDATA, nla_len(upcall_info->userdata), nla_data(upcall_info->userdata)); + if (upcall_info->egress_tun_info) { + nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_EGRESS_TUN_KEY); + err = ovs_nla_put_egress_tunnel_key(user_skb, + upcall_info->egress_tun_info); + BUG_ON(err); + nla_nest_end(user_skb, nla); + } + /* Only reserve room for attribute header, packet data is added - * in skb_zerocopy() */ + * in skb_zerocopy() + */ if (!(nla = nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, 0))) { err = -ENOBUFS; goto out; @@ -525,9 +510,11 @@ ((struct nlmsghdr *) user_skb->data)->nlmsg_len = user_skb->len; err = genlmsg_unicast(ovs_dp_get_net(dp), user_skb, upcall_info->portid); + user_skb = NULL; out: if (err) skb_tx_error(skb); + kfree_skb(user_skb); kfree_skb(nskb); return err; } @@ -539,11 +526,13 @@ struct sw_flow_actions *acts; struct sk_buff *packet; struct sw_flow *flow; + struct sw_flow_actions *sf_acts; struct datapath *dp; struct ethhdr *eth; struct vport *input_vport; int len; int err; + bool log = !a[OVS_PACKET_ATTR_PROBE]; err = -EINVAL; if (!a[OVS_PACKET_ATTR_PACKET] || !a[OVS_PACKET_ATTR_KEY] || @@ -564,7 +553,8 @@ /* Normally, setting the skb 'protocol' field would be handled by a * call to eth_type_trans(), but it assumes there's a sending - * device, which we may not have. */ + * device, which we may not have. + */ if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) packet->protocol = eth->h_proto; else @@ -577,28 +567,22 @@ goto err_kfree_skb; err = ovs_flow_key_extract_userspace(a[OVS_PACKET_ATTR_KEY], packet, - &flow->key); + &flow->key, log); if (err) goto err_flow_free; - acts = ovs_nla_alloc_flow_actions(nla_len(a[OVS_PACKET_ATTR_ACTIONS])); - err = PTR_ERR(acts); - if (IS_ERR(acts)) - goto err_flow_free; - err = ovs_nla_copy_actions(a[OVS_PACKET_ATTR_ACTIONS], - &flow->key, 0, &acts); - rcu_assign_pointer(flow->sf_acts, acts); + &flow->key, &acts, log); if (err) goto err_flow_free; - OVS_CB(packet)->flow = flow; - OVS_CB(packet)->pkt_key = &flow->key; + rcu_assign_pointer(flow->sf_acts, acts); + OVS_CB(packet)->egress_tun_info = NULL; packet->priority = flow->key.phy.priority; packet->mark = flow->key.phy.skb_mark; rcu_read_lock(); - dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); + dp = get_dp_rcu(sock_net(skb->sk), ovs_header->dp_ifindex); err = -ENODEV; if (!dp) goto err_unlock; @@ -611,9 +595,10 @@ goto err_unlock; OVS_CB(packet)->input_vport = input_vport; + sf_acts = rcu_dereference(flow->sf_acts); local_bh_disable(); - err = ovs_execute_actions(dp, packet, false); + err = ovs_execute_actions(dp, packet, sf_acts, &flow->key); local_bh_enable(); rcu_read_unlock(); @@ -634,6 +619,7 @@ [OVS_PACKET_ATTR_PACKET] = { .len = ETH_HLEN }, [OVS_PACKET_ATTR_KEY] = { .type = NLA_NESTED }, [OVS_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED }, + [OVS_PACKET_ATTR_PROBE] = { .type = NLA_FLAG }, }; static struct genl_ops dp_packet_genl_ops[] = { @@ -656,7 +642,7 @@ .n_ops = ARRAY_SIZE(dp_packet_genl_ops), }; -static void get_dp_stats(struct datapath *dp, struct ovs_dp_stats *stats, +static void get_dp_stats(const struct datapath *dp, struct ovs_dp_stats *stats, struct ovs_dp_megaflow_stats *mega_stats) { int i; @@ -676,9 +662,9 @@ percpu_stats = per_cpu_ptr(dp->stats_percpu, i); do { - start = u64_stats_fetch_begin_irq(&percpu_stats->sync); + start = u64_stats_fetch_begin_irq(&percpu_stats->syncp); local_stats = *percpu_stats; - } while (u64_stats_fetch_retry_irq(&percpu_stats->sync, start)); + } while (u64_stats_fetch_retry_irq(&percpu_stats->syncp, start)); stats->n_hit += local_stats.n_hit; stats->n_missed += local_stats.n_missed; @@ -687,70 +673,81 @@ } } -static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts) +static bool should_fill_key(const struct sw_flow_id *sfid, uint32_t ufid_flags) { - return NLMSG_ALIGN(sizeof(struct ovs_header)) - + nla_total_size(key_attr_size()) /* OVS_FLOW_ATTR_KEY */ - + nla_total_size(key_attr_size()) /* OVS_FLOW_ATTR_MASK */ - + nla_total_size(sizeof(struct ovs_flow_stats)) /* OVS_FLOW_ATTR_STATS */ - + nla_total_size(1) /* OVS_FLOW_ATTR_TCP_FLAGS */ - + nla_total_size(8) /* OVS_FLOW_ATTR_USED */ - + nla_total_size(acts->actions_len); /* OVS_FLOW_ATTR_ACTIONS */ + return ovs_identifier_is_ufid(sfid) && + !(ufid_flags & OVS_UFID_F_OMIT_KEY); } -/* Called with ovs_mutex or RCU read lock. */ -static int ovs_flow_cmd_fill_info(const struct sw_flow *flow, int dp_ifindex, - struct sk_buff *skb, u32 portid, - u32 seq, u32 flags, u8 cmd) +static bool should_fill_mask(uint32_t ufid_flags) { - const int skb_orig_len = skb->len; - struct nlattr *start; - struct ovs_flow_stats stats; - __be16 tcp_flags; - unsigned long used; - struct ovs_header *ovs_header; - struct nlattr *nla; - int err; + return !(ufid_flags & OVS_UFID_F_OMIT_MASK); +} - ovs_header = genlmsg_put(skb, portid, seq, &dp_flow_genl_family, flags, cmd); - if (!ovs_header) - return -EMSGSIZE; +static bool should_fill_actions(uint32_t ufid_flags) +{ + return !(ufid_flags & OVS_UFID_F_OMIT_ACTIONS); +} - ovs_header->dp_ifindex = dp_ifindex; +static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts, + const struct sw_flow_id *sfid, + uint32_t ufid_flags) +{ + size_t len = NLMSG_ALIGN(sizeof(struct ovs_header)); - /* Fill flow key. */ - nla = nla_nest_start(skb, OVS_FLOW_ATTR_KEY); - if (!nla) - goto nla_put_failure; + /* OVS_FLOW_ATTR_UFID */ + if (sfid && ovs_identifier_is_ufid(sfid)) + len += nla_total_size(sfid->ufid_len); - err = ovs_nla_put_flow(&flow->unmasked_key, &flow->unmasked_key, skb); - if (err) - goto error; - nla_nest_end(skb, nla); + /* OVS_FLOW_ATTR_KEY */ + if (!sfid || should_fill_key(sfid, ufid_flags)) + len += nla_total_size(ovs_key_attr_size()); - nla = nla_nest_start(skb, OVS_FLOW_ATTR_MASK); - if (!nla) - goto nla_put_failure; + /* OVS_FLOW_ATTR_MASK */ + if (should_fill_mask(ufid_flags)) + len += nla_total_size(ovs_key_attr_size()); - err = ovs_nla_put_flow(&flow->key, &flow->mask->key, skb); - if (err) - goto error; + /* OVS_FLOW_ATTR_ACTIONS */ + if (should_fill_actions(ufid_flags)) + len += nla_total_size(acts->actions_len); - nla_nest_end(skb, nla); + return len + + nla_total_size(sizeof(struct ovs_flow_stats)) /* OVS_FLOW_ATTR_STATS */ + + nla_total_size(1) /* OVS_FLOW_ATTR_TCP_FLAGS */ + + nla_total_size(8); /* OVS_FLOW_ATTR_USED */ +} + +/* Called with ovs_mutex or RCU read lock. */ +static int ovs_flow_cmd_fill_stats(const struct sw_flow *flow, + struct sk_buff *skb) +{ + struct ovs_flow_stats stats; + __be16 tcp_flags; + unsigned long used; ovs_flow_stats_get(flow, &stats, &used, &tcp_flags); if (used && nla_put_u64(skb, OVS_FLOW_ATTR_USED, ovs_flow_used_time(used))) - goto nla_put_failure; + return -EMSGSIZE; if (stats.n_packets && nla_put(skb, OVS_FLOW_ATTR_STATS, sizeof(struct ovs_flow_stats), &stats)) - goto nla_put_failure; + return -EMSGSIZE; if ((u8)ntohs(tcp_flags) && nla_put_u8(skb, OVS_FLOW_ATTR_TCP_FLAGS, (u8)ntohs(tcp_flags))) - goto nla_put_failure; + return -EMSGSIZE; + + return 0; +} + +/* Called with ovs_mutex or RCU read lock. */ +static int ovs_flow_cmd_fill_actions(const struct sw_flow *flow, + struct sk_buff *skb, int skb_orig_len) +{ + struct nlattr *start; + int err; /* If OVS_FLOW_ATTR_ACTIONS doesn't fit, skip dumping the actions if * this is the first flow to be dumped into 'skb'. This is unusual for @@ -774,17 +771,62 @@ nla_nest_end(skb, start); else { if (skb_orig_len) - goto error; + return err; nla_nest_cancel(skb, start); } - } else if (skb_orig_len) - goto nla_put_failure; + } else if (skb_orig_len) { + return -EMSGSIZE; + } - return genlmsg_end(skb, ovs_header); + return 0; +} + +/* Called with ovs_mutex or RCU read lock. */ +static int ovs_flow_cmd_fill_info(const struct sw_flow *flow, int dp_ifindex, + struct sk_buff *skb, u32 portid, + u32 seq, u32 flags, u8 cmd, u32 ufid_flags) +{ + const int skb_orig_len = skb->len; + struct ovs_header *ovs_header; + int err; + + ovs_header = genlmsg_put(skb, portid, seq, &dp_flow_genl_family, + flags, cmd); + if (!ovs_header) + return -EMSGSIZE; + + ovs_header->dp_ifindex = dp_ifindex; + + err = ovs_nla_put_identifier(flow, skb); + if (err) + goto error; + + if (should_fill_key(&flow->id, ufid_flags)) { + err = ovs_nla_put_masked_key(flow, skb); + if (err) + goto error; + } + + if (should_fill_mask(ufid_flags)) { + err = ovs_nla_put_mask(flow, skb); + if (err) + goto error; + } + + err = ovs_flow_cmd_fill_stats(flow, skb); + if (err) + goto error; + + if (should_fill_actions(ufid_flags)) { + err = ovs_flow_cmd_fill_actions(flow, skb, skb_orig_len); + if (err) + goto error; + } + + genlmsg_end(skb, ovs_header); + return 0; -nla_put_failure: - err = -EMSGSIZE; error: genlmsg_cancel(skb, ovs_header); return err; @@ -792,16 +834,20 @@ /* May not be called with RCU read lock. */ static struct sk_buff *ovs_flow_cmd_alloc_info(const struct sw_flow_actions *acts, + const struct sw_flow_id *sfid, struct genl_info *info, - bool always) + bool always, + uint32_t ufid_flags) { struct sk_buff *skb; + size_t len; - if (!always && !ovs_must_notify(info, &ovs_dp_flow_multicast_group)) + if (!always && !ovs_must_notify(&dp_flow_genl_family, info, + GROUP_ID(&ovs_dp_flow_multicast_group))) return NULL; - skb = genlmsg_new_unicast(ovs_flow_cmd_msg_size(acts), info, GFP_KERNEL); - + len = ovs_flow_cmd_msg_size(acts, sfid, ufid_flags); + skb = genlmsg_new_unicast(len, info, GFP_KERNEL); if (!skb) return ERR_PTR(-ENOMEM); @@ -812,19 +858,19 @@ static struct sk_buff *ovs_flow_cmd_build_info(const struct sw_flow *flow, int dp_ifindex, struct genl_info *info, u8 cmd, - bool always) + bool always, u32 ufid_flags) { struct sk_buff *skb; int retval; - skb = ovs_flow_cmd_alloc_info(ovsl_dereference(flow->sf_acts), info, - always); - if (!skb || IS_ERR(skb)) + skb = ovs_flow_cmd_alloc_info(ovsl_dereference(flow->sf_acts), + &flow->id, info, always, ufid_flags); + if (IS_ERR_OR_NULL(skb)) return skb; retval = ovs_flow_cmd_fill_info(flow, dp_ifindex, skb, info->snd_portid, info->snd_seq, 0, - cmd); + cmd, ufid_flags); BUG_ON(retval < 0); return skb; } @@ -833,23 +879,31 @@ { struct nlattr **a = info->attrs; struct ovs_header *ovs_header = info->userhdr; - struct sw_flow *flow, *new_flow; + struct sw_flow *flow = NULL, *new_flow; struct sw_flow_mask mask; struct sk_buff *reply; struct datapath *dp; + struct sw_flow_key key; struct sw_flow_actions *acts; struct sw_flow_match match; + u32 ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]); int error; + bool log = !a[OVS_FLOW_ATTR_PROBE]; /* Must have key and actions. */ error = -EINVAL; - if (!a[OVS_FLOW_ATTR_KEY]) + if (!a[OVS_FLOW_ATTR_KEY]) { + OVS_NLERR(log, "Flow key attr not present in new flow."); goto error; - if (!a[OVS_FLOW_ATTR_ACTIONS]) + } + if (!a[OVS_FLOW_ATTR_ACTIONS]) { + OVS_NLERR(log, "Flow actions attr not present in new flow."); goto error; + } /* Most of the time we need to allocate a new flow, do it before - * locking. */ + * locking. + */ new_flow = ovs_flow_alloc(); if (IS_ERR(new_flow)) { error = PTR_ERR(new_flow); @@ -857,28 +911,30 @@ } /* Extract key. */ - ovs_match_init(&match, &new_flow->unmasked_key, &mask); - error = ovs_nla_get_match(&match, - a[OVS_FLOW_ATTR_KEY], a[OVS_FLOW_ATTR_MASK]); + ovs_match_init(&match, &key, &mask); + error = ovs_nla_get_match(&match, a[OVS_FLOW_ATTR_KEY], + a[OVS_FLOW_ATTR_MASK], log); if (error) goto err_kfree_flow; - ovs_flow_mask_key(&new_flow->key, &new_flow->unmasked_key, &mask); + ovs_flow_mask_key(&new_flow->key, &key, &mask); - /* Validate actions. */ - acts = ovs_nla_alloc_flow_actions(nla_len(a[OVS_FLOW_ATTR_ACTIONS])); - error = PTR_ERR(acts); - if (IS_ERR(acts)) + /* Extract flow identifier. */ + error = ovs_nla_get_identifier(&new_flow->id, a[OVS_FLOW_ATTR_UFID], + &key, log); + if (error) goto err_kfree_flow; + /* Validate actions. */ error = ovs_nla_copy_actions(a[OVS_FLOW_ATTR_ACTIONS], &new_flow->key, - 0, &acts); + &acts, log); if (error) { - OVS_NLERR("Flow actions may not be safe on all matching packets.\n"); - goto err_kfree_acts; + OVS_NLERR(log, "Flow actions may not be safe on all matching packets."); + goto err_kfree_flow; } - reply = ovs_flow_cmd_alloc_info(acts, info, false); + reply = ovs_flow_cmd_alloc_info(acts, &new_flow->id, info, false, + ufid_flags); if (IS_ERR(reply)) { error = PTR_ERR(reply); goto err_kfree_acts; @@ -890,8 +946,12 @@ error = -ENODEV; goto err_unlock_ovs; } + /* Check if this is a duplicate flow */ - flow = ovs_flow_tbl_lookup(&dp->table, &new_flow->unmasked_key); + if (ovs_identifier_is_ufid(&new_flow->id)) + flow = ovs_flow_tbl_lookup_ufid(&dp->table, &new_flow->id); + if (!flow) + flow = ovs_flow_tbl_lookup(&dp->table, &key); if (likely(!flow)) { rcu_assign_pointer(new_flow->sf_acts, acts); @@ -907,7 +967,8 @@ ovs_header->dp_ifindex, reply, info->snd_portid, info->snd_seq, 0, - OVS_FLOW_CMD_NEW); + OVS_FLOW_CMD_NEW, + ufid_flags); BUG_ON(error < 0); } ovs_unlock(); @@ -925,10 +986,15 @@ error = -EEXIST; goto err_unlock_ovs; } - /* The unmasked key has to be the same for flow updates. */ - if (unlikely(!ovs_flow_cmp_unmasked_key(flow, &match))) { - /* Look for any overlapping flow. */ - flow = ovs_flow_tbl_lookup_exact(&dp->table, &match); + /* The flow identifier has to be the same for flow updates. + * Look for any overlapping flow. + */ + if (unlikely(!ovs_flow_cmp(flow, &match))) { + if (ovs_identifier_is_key(&flow->id)) + flow = ovs_flow_tbl_lookup_exact(&dp->table, + &match); + else /* UFID matches but key is different */ + flow = NULL; if (!flow) { error = -ENOENT; goto err_unlock_ovs; @@ -943,7 +1009,8 @@ ovs_header->dp_ifindex, reply, info->snd_portid, info->snd_seq, 0, - OVS_FLOW_CMD_NEW); + OVS_FLOW_CMD_NEW, + ufid_flags); BUG_ON(error < 0); } ovs_unlock(); @@ -967,49 +1034,70 @@ return error; } +/* Factor out action copy to avoid "Wframe-larger-than=1024" warning. */ +static struct sw_flow_actions *get_flow_actions(const struct nlattr *a, + const struct sw_flow_key *key, + const struct sw_flow_mask *mask, + bool log) +{ + struct sw_flow_actions *acts; + struct sw_flow_key masked_key; + int error; + + ovs_flow_mask_key(&masked_key, key, mask); + error = ovs_nla_copy_actions(a, &masked_key, &acts, log); + if (error) { + OVS_NLERR(log, + "Actions may not be safe on all matching packets"); + return ERR_PTR(error); + } + + return acts; +} + static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info) { struct nlattr **a = info->attrs; struct ovs_header *ovs_header = info->userhdr; - struct sw_flow_key key, masked_key; + struct sw_flow_key key; struct sw_flow *flow; struct sw_flow_mask mask; struct sk_buff *reply = NULL; struct datapath *dp; struct sw_flow_actions *old_acts = NULL, *acts = NULL; struct sw_flow_match match; + struct sw_flow_id sfid; + u32 ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]); int error; + bool log = !a[OVS_FLOW_ATTR_PROBE]; + bool ufid_present; /* Extract key. */ error = -EINVAL; - if (!a[OVS_FLOW_ATTR_KEY]) + if (!a[OVS_FLOW_ATTR_KEY]) { + OVS_NLERR(log, "Flow key attribute not present in set flow."); goto error; + } + ufid_present = ovs_nla_get_ufid(&sfid, a[OVS_FLOW_ATTR_UFID], log); ovs_match_init(&match, &key, &mask); - error = ovs_nla_get_match(&match, - a[OVS_FLOW_ATTR_KEY], a[OVS_FLOW_ATTR_MASK]); + error = ovs_nla_get_match(&match, a[OVS_FLOW_ATTR_KEY], + a[OVS_FLOW_ATTR_MASK], log); if (error) goto error; /* Validate actions. */ if (a[OVS_FLOW_ATTR_ACTIONS]) { - acts = ovs_nla_alloc_flow_actions(nla_len(a[OVS_FLOW_ATTR_ACTIONS])); - error = PTR_ERR(acts); - if (IS_ERR(acts)) + acts = get_flow_actions(a[OVS_FLOW_ATTR_ACTIONS], &key, &mask, + log); + if (IS_ERR(acts)) { + error = PTR_ERR(acts); goto error; - - ovs_flow_mask_key(&masked_key, &key, &mask); - error = ovs_nla_copy_actions(a[OVS_FLOW_ATTR_ACTIONS], - &masked_key, 0, &acts); - if (error) { - OVS_NLERR("Flow actions may not be safe on all matching packets.\n"); - goto err_kfree_acts; } - } - /* Can allocate before locking if have acts. */ - if (acts) { - reply = ovs_flow_cmd_alloc_info(acts, info, false); + /* Can allocate before locking if have acts. */ + reply = ovs_flow_cmd_alloc_info(acts, &sfid, info, false, + ufid_flags); if (IS_ERR(reply)) { error = PTR_ERR(reply); goto err_kfree_acts; @@ -1023,7 +1111,10 @@ goto err_unlock_ovs; } /* Check that the flow exists. */ - flow = ovs_flow_tbl_lookup_exact(&dp->table, &match); + if (ufid_present) + flow = ovs_flow_tbl_lookup_ufid(&dp->table, &sfid); + else + flow = ovs_flow_tbl_lookup_exact(&dp->table, &match); if (unlikely(!flow)) { error = -ENOENT; goto err_unlock_ovs; @@ -1039,13 +1130,16 @@ ovs_header->dp_ifindex, reply, info->snd_portid, info->snd_seq, 0, - OVS_FLOW_CMD_NEW); + OVS_FLOW_CMD_NEW, + ufid_flags); BUG_ON(error < 0); } } else { /* Could not alloc without acts before locking. */ reply = ovs_flow_cmd_build_info(flow, ovs_header->dp_ifindex, - info, OVS_FLOW_CMD_NEW, false); + info, OVS_FLOW_CMD_NEW, false, + ufid_flags); + if (unlikely(IS_ERR(reply))) { error = PTR_ERR(reply); goto err_unlock_ovs; @@ -1061,6 +1155,7 @@ ovs_notify(&dp_flow_genl_family, &ovs_dp_flow_multicast_group, reply, info); if (old_acts) ovs_nla_free_flow_actions(old_acts); + return 0; err_unlock_ovs: @@ -1081,15 +1176,22 @@ struct sw_flow *flow; struct datapath *dp; struct sw_flow_match match; - int err; + struct sw_flow_id ufid; + u32 ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]); + int err = 0; + bool log = !a[OVS_FLOW_ATTR_PROBE]; + bool ufid_present; - if (!a[OVS_FLOW_ATTR_KEY]) { - OVS_NLERR("Flow get message rejected, Key attribute missing.\n"); - return -EINVAL; + ufid_present = ovs_nla_get_ufid(&ufid, a[OVS_FLOW_ATTR_UFID], log); + if (a[OVS_FLOW_ATTR_KEY]) { + ovs_match_init(&match, &key, NULL); + err = ovs_nla_get_match(&match, a[OVS_FLOW_ATTR_KEY], NULL, + log); + } else if (!ufid_present) { + OVS_NLERR(log, + "Flow get message rejected, Key attribute missing."); + err = -EINVAL; } - - ovs_match_init(&match, &key, NULL); - err = ovs_nla_get_match(&match, a[OVS_FLOW_ATTR_KEY], NULL); if (err) return err; @@ -1100,14 +1202,17 @@ goto unlock; } - flow = ovs_flow_tbl_lookup_exact(&dp->table, &match); + if (ufid_present) + flow = ovs_flow_tbl_lookup_ufid(&dp->table, &ufid); + else + flow = ovs_flow_tbl_lookup_exact(&dp->table, &match); if (!flow) { err = -ENOENT; goto unlock; } reply = ovs_flow_cmd_build_info(flow, ovs_header->dp_ifindex, info, - OVS_FLOW_CMD_NEW, true); + OVS_FLOW_CMD_NEW, true, ufid_flags); if (IS_ERR(reply)) { err = PTR_ERR(reply); goto unlock; @@ -1126,14 +1231,20 @@ struct ovs_header *ovs_header = info->userhdr; struct sw_flow_key key; struct sk_buff *reply; - struct sw_flow *flow; + struct sw_flow *flow = NULL; struct datapath *dp; struct sw_flow_match match; + struct sw_flow_id ufid; + u32 ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]); int err; + bool log = !a[OVS_FLOW_ATTR_PROBE]; + bool ufid_present; - if (likely(a[OVS_FLOW_ATTR_KEY])) { + ufid_present = ovs_nla_get_ufid(&ufid, a[OVS_FLOW_ATTR_UFID], log); + if (a[OVS_FLOW_ATTR_KEY]) { ovs_match_init(&match, &key, NULL); - err = ovs_nla_get_match(&match, a[OVS_FLOW_ATTR_KEY], NULL); + err = ovs_nla_get_match(&match, a[OVS_FLOW_ATTR_KEY], NULL, + log); if (unlikely(err)) return err; } @@ -1144,11 +1255,16 @@ err = -ENODEV; goto unlock; } - if (unlikely(!a[OVS_FLOW_ATTR_KEY])) { + + if (unlikely(!a[OVS_FLOW_ATTR_KEY] && !ufid_present)) { err = ovs_flow_tbl_flush(&dp->table); goto unlock; } - flow = ovs_flow_tbl_lookup_exact(&dp->table, &match); + + if (ufid_present) + flow = ovs_flow_tbl_lookup_ufid(&dp->table, &ufid); + else + flow = ovs_flow_tbl_lookup_exact(&dp->table, &match); if (unlikely(!flow)) { err = -ENOENT; goto unlock; @@ -1157,17 +1273,17 @@ ovs_flow_tbl_remove(&dp->table, flow); ovs_unlock(); - reply = ovs_flow_cmd_alloc_info((const struct sw_flow_actions __force *)flow->sf_acts, - info, false); + reply = ovs_flow_cmd_alloc_info(rcu_dereference_raw(flow->sf_acts), + &flow->id, info, false, ufid_flags); if (likely(reply)) { if (likely(!IS_ERR(reply))) { - rcu_read_lock(); /* Keep RCU checker happy. */ - err = ovs_flow_cmd_fill_info(flow, - ovs_header->dp_ifindex, + rcu_read_lock(); /*To keep RCU checker happy. */ + err = ovs_flow_cmd_fill_info(flow, ovs_header->dp_ifindex, reply, info->snd_portid, info->snd_seq, 0, - OVS_FLOW_CMD_DEL); + OVS_FLOW_CMD_DEL, + ufid_flags); rcu_read_unlock(); BUG_ON(err < 0); ovs_notify(&dp_flow_genl_family, &ovs_dp_flow_multicast_group, reply, info); @@ -1187,12 +1303,21 @@ static int ovs_flow_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) { + struct nlattr *a[__OVS_FLOW_ATTR_MAX]; struct ovs_header *ovs_header = genlmsg_data(nlmsg_data(cb->nlh)); struct table_instance *ti; struct datapath *dp; + u32 ufid_flags; + int err; + + err = genlmsg_parse(cb->nlh, &dp_flow_genl_family, a, + OVS_FLOW_ATTR_MAX, flow_policy); + if (err) + return err; + ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]); rcu_read_lock(); - dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); + dp = get_dp_rcu(sock_net(skb->sk), ovs_header->dp_ifindex); if (!dp) { rcu_read_unlock(); return -ENODEV; @@ -1212,7 +1337,7 @@ if (ovs_flow_cmd_fill_info(flow, ovs_header->dp_ifindex, skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, NLM_F_MULTI, - OVS_FLOW_CMD_NEW) < 0) + OVS_FLOW_CMD_NEW, ufid_flags) < 0) break; cb->args[0] = bucket; @@ -1224,8 +1349,12 @@ static const struct nla_policy flow_policy[OVS_FLOW_ATTR_MAX + 1] = { [OVS_FLOW_ATTR_KEY] = { .type = NLA_NESTED }, + [OVS_FLOW_ATTR_MASK] = { .type = NLA_NESTED }, [OVS_FLOW_ATTR_ACTIONS] = { .type = NLA_NESTED }, [OVS_FLOW_ATTR_CLEAR] = { .type = NLA_FLAG }, + [OVS_FLOW_ATTR_PROBE] = { .type = NLA_FLAG }, + [OVS_FLOW_ATTR_UFID] = { .type = NLA_UNSPEC, .len = 1 }, + [OVS_FLOW_ATTR_UFID_FLAGS] = { .type = NLA_U32 }, }; static struct genl_ops dp_flow_genl_ops[] = { @@ -1311,7 +1440,8 @@ if (nla_put_u32(skb, OVS_DP_ATTR_USER_FEATURES, dp->user_features)) goto nla_put_failure; - return genlmsg_end(skb, ovs_header); + genlmsg_end(skb, ovs_header); + return 0; nla_put_failure: genlmsg_cancel(skb, ovs_header); @@ -1326,7 +1456,7 @@ /* Called with rcu_read_lock or ovs_mutex. */ static struct datapath *lookup_datapath(struct net *net, - struct ovs_header *ovs_header, + const struct ovs_header *ovs_header, struct nlattr *a[OVS_DP_ATTR_MAX + 1]) { struct datapath *dp; @@ -1354,7 +1484,7 @@ dp->user_features = 0; } -static void ovs_dp_change(struct datapath *dp, struct nlattr **a) +static void ovs_dp_change(struct datapath *dp, struct nlattr *a[]) { if (a[OVS_DP_ATTR_USER_FEATURES]) dp->user_features = nla_get_u32(a[OVS_DP_ATTR_USER_FEATURES]); @@ -1390,18 +1520,12 @@ if (err) goto err_free_dp; - dp->stats_percpu = alloc_percpu(struct dp_stats_percpu); + dp->stats_percpu = netdev_alloc_pcpu_stats(struct dp_stats_percpu); if (!dp->stats_percpu) { err = -ENOMEM; goto err_destroy_table; } - for_each_possible_cpu(i) { - struct dp_stats_percpu *dpath_stats; - dpath_stats = per_cpu_ptr(dp->stats_percpu, i); - u64_stats_init(&dpath_stats->sync); - } - dp->ports = kmalloc(DP_VPORT_HASH_BUCKETS * sizeof(struct hlist_head), GFP_KERNEL); if (!dp->ports) { @@ -1449,7 +1573,6 @@ ovs_net = net_generic(ovs_dp_get_net(dp), ovs_net_id); list_add_tail_rcu(&dp->list_node, &ovs_net->dps); - ovs_unlock(); ovs_notify(&dp_datapath_genl_family, &ovs_dp_datapath_multicast_group, reply, info); @@ -1517,8 +1640,8 @@ BUG_ON(err < 0); __dp_destroy(dp); - ovs_unlock(); + ovs_notify(&dp_datapath_genl_family, &ovs_dp_datapath_multicast_group, reply, info); return 0; @@ -1549,8 +1672,8 @@ err = ovs_dp_cmd_fill_info(dp, reply, info->snd_portid, info->snd_seq, 0, OVS_DP_CMD_NEW); BUG_ON(err < 0); - ovs_unlock(); + ovs_notify(&dp_datapath_genl_family, &ovs_dp_datapath_multicast_group, reply, info); return 0; @@ -1688,7 +1811,8 @@ if (err == -EMSGSIZE) goto error; - return genlmsg_end(skb, ovs_header); + genlmsg_end(skb, ovs_header); + return 0; nla_put_failure: err = -EMSGSIZE; @@ -1721,7 +1845,7 @@ /* Called with ovs_mutex or RCU read lock. */ static struct vport *lookup_vport(struct net *net, - struct ovs_header *ovs_header, + const struct ovs_header *ovs_header, struct nlattr *a[OVS_VPORT_ATTR_MAX + 1]) { struct datapath *dp; @@ -1778,6 +1902,7 @@ return -ENOMEM; ovs_lock(); +restart: dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); err = -ENODEV; if (!dp) @@ -1809,12 +1934,11 @@ vport = new_vport(&parms); err = PTR_ERR(vport); - if (IS_ERR(vport)) + if (IS_ERR(vport)) { + if (err == -EAGAIN) + goto restart; goto exit_unlock_free; - - err = 0; - if (a[OVS_VPORT_ATTR_STATS]) - ovs_vport_set_stats(vport, nla_data(a[OVS_VPORT_ATTR_STATS])); + } err = ovs_vport_cmd_fill_info(vport, reply, info->snd_portid, info->snd_seq, 0, OVS_VPORT_CMD_NEW); @@ -1859,13 +1983,10 @@ goto exit_unlock_free; } - if (a[OVS_VPORT_ATTR_STATS]) - ovs_vport_set_stats(vport, nla_data(a[OVS_VPORT_ATTR_STATS])); - - if (a[OVS_VPORT_ATTR_UPCALL_PID]) { - err = ovs_vport_set_upcall_portids(vport, - a[OVS_VPORT_ATTR_UPCALL_PID]); + struct nlattr *ids = a[OVS_VPORT_ATTR_UPCALL_PID]; + + err = ovs_vport_set_upcall_portids(vport, ids); if (err) goto exit_unlock_free; } @@ -1959,7 +2080,7 @@ int i, j = 0; rcu_read_lock(); - dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); + dp = get_dp_rcu(sock_net(skb->sk), ovs_header->dp_ifindex); if (!dp) { rcu_read_unlock(); return -ENODEV; @@ -2080,14 +2201,55 @@ return 0; } -static void __net_exit ovs_exit_net(struct net *net) +static void __net_exit list_vports_from_net(struct net *net, struct net *dnet, + struct list_head *head) { - struct datapath *dp, *dp_next; struct ovs_net *ovs_net = net_generic(net, ovs_net_id); + struct datapath *dp; + + list_for_each_entry(dp, &ovs_net->dps, list_node) { + int i; + + for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++) { + struct vport *vport; + + hlist_for_each_entry(vport, &dp->ports[i], dp_hash_node) { + struct netdev_vport *netdev_vport; + + if (vport->ops->type != OVS_VPORT_TYPE_INTERNAL) + continue; + + netdev_vport = netdev_vport_priv(vport); + if (dev_net(netdev_vport->dev) == dnet) + list_add(&vport->detach_list, head); + } + } + } +} + +static void __net_exit ovs_exit_net(struct net *dnet) +{ + struct datapath *dp, *dp_next; + struct ovs_net *ovs_net = net_generic(dnet, ovs_net_id); + struct vport *vport, *vport_next; + struct net *net; + LIST_HEAD(head); ovs_lock(); list_for_each_entry_safe(dp, dp_next, &ovs_net->dps, list_node) __dp_destroy(dp); + + rtnl_lock(); + for_each_net(net) + list_vports_from_net(net, dnet, &head); + rtnl_unlock(); + + /* Detach all vports from given namespace. */ + list_for_each_entry_safe(vport, vport_next, &head, detach_list) { + list_del(&vport->detach_list); + ovs_dp_detach_port(vport); + } + ovs_unlock(); cancel_work_sync(&ovs_net->dp_notify_work); @@ -2108,13 +2270,20 @@ BUILD_BUG_ON(sizeof(struct ovs_skb_cb) > FIELD_SIZEOF(struct sk_buff, cb)); - pr_info("Open vSwitch switching datapath %s, built "__DATE__" "__TIME__"\n", - VERSION); + pr_info("Open vSwitch switching datapath %s\n", VERSION); - err = ovs_flow_init(); + err = action_fifos_init(); if (err) goto error; + err = ovs_internal_dev_rtnl_link_register(); + if (err) + goto error_action_fifos_exit; + + err = ovs_flow_init(); + if (err) + goto error_unreg_rtnl_link; + err = ovs_vport_init(); if (err) goto error_flow_exit; @@ -2127,12 +2296,18 @@ if (err) goto error_netns_exit; + err = ovs_netdev_init(); + if (err) + goto error_unreg_notifier; + err = dp_register_genl(); if (err < 0) - goto error_unreg_notifier; + goto error_unreg_netdev; return 0; +error_unreg_netdev: + ovs_netdev_exit(); error_unreg_notifier: unregister_netdevice_notifier(&ovs_dp_device_notifier); error_netns_exit: @@ -2141,6 +2316,10 @@ ovs_vport_exit(); error_flow_exit: ovs_flow_exit(); +error_unreg_rtnl_link: + ovs_internal_dev_rtnl_link_unregister(); +error_action_fifos_exit: + action_fifos_exit(); error: return err; } @@ -2148,11 +2327,14 @@ static void dp_cleanup(void) { dp_unregister_genl(ARRAY_SIZE(dp_genl_families)); + ovs_netdev_exit(); unregister_netdevice_notifier(&ovs_dp_device_notifier); unregister_pernet_device(&ovs_net_ops); rcu_barrier(); ovs_vport_exit(); ovs_flow_exit(); + ovs_internal_dev_rtnl_link_unregister(); + action_fifos_exit(); } module_init(dp_init); diff -Nru openvswitch-2.3.1/datapath/datapath.h openvswitch-2.4.0~git20150623/datapath/datapath.h --- openvswitch-2.3.1/datapath/datapath.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/datapath.h 2015-06-23 18:46:21.000000000 +0000 @@ -32,8 +32,8 @@ #include "vlan.h" #include "vport.h" -#define DP_MAX_PORTS USHRT_MAX -#define DP_VPORT_HASH_BUCKETS 1024 +#define DP_MAX_PORTS USHRT_MAX +#define DP_VPORT_HASH_BUCKETS 1024 #define SAMPLE_ACTION_DEPTH 3 @@ -57,7 +57,7 @@ u64 n_missed; u64 n_lost; u64 n_mask_hit; - struct u64_stats_sync sync; + struct u64_stats_sync syncp; }; /** @@ -96,35 +96,32 @@ /** * struct ovs_skb_cb - OVS data in skb CB - * @flow: The flow associated with this packet. May be %NULL if no flow. - * @pkt_key: The flow information extracted from the packet. Must be nonnull. - * @tun_key: Key for the tunnel that encapsulated this packet. NULL if the + * @egress_tun_info: Tunnel information about this packet on egress path. + * NULL if the packet is not being tunneled. * @input_vport: The original vport packet came in on. This value is cached * when a packet is received by OVS. */ struct ovs_skb_cb { - struct sw_flow *flow; - struct sw_flow_key *pkt_key; - struct ovs_key_ipv4_tunnel *tun_key; - struct vport *input_vport; + struct ovs_tunnel_info *egress_tun_info; + struct vport *input_vport; }; #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb) /** * struct dp_upcall - metadata to include with a packet to send to userspace * @cmd: One of %OVS_PACKET_CMD_*. - * @key: Becomes %OVS_PACKET_ATTR_KEY. Must be nonnull. * @userdata: If nonnull, its variable-length value is passed to userspace as * %OVS_PACKET_ATTR_USERDATA. - * @portid: Netlink PID to which packet should be sent. If @portid is 0 then no - * packet is sent and the packet is accounted in the datapath's @n_lost + * @portid: Netlink portid to which packet should be sent. If @portid is 0 + * then no packet is sent and the packet is accounted in the datapath's @n_lost * counter. + * @egress_tun_info: If nonnull, becomes %OVS_PACKET_ATTR_EGRESS_TUN_KEY. */ struct dp_upcall_info { - u8 cmd; - const struct sw_flow_key *key; + const struct ovs_tunnel_info *egress_tun_info; const struct nlattr *userdata; u32 portid; + u8 cmd; }; /** @@ -135,8 +132,8 @@ */ struct ovs_net { struct list_head dps; - struct vport_net vport_net; struct work_struct dp_notify_work; + struct vport_net vport_net; }; extern int ovs_net_id; @@ -149,13 +146,13 @@ #define lockdep_ovsl_is_held() 1 #endif -#define ASSERT_OVSL() WARN_ON(unlikely(!lockdep_ovsl_is_held())) +#define ASSERT_OVSL() WARN_ON(!lockdep_ovsl_is_held()) #define ovsl_dereference(p) \ rcu_dereference_protected(p, lockdep_ovsl_is_held()) #define rcu_dereference_ovsl(p) \ rcu_dereference_check(p, lockdep_ovsl_is_held()) -static inline struct net *ovs_dp_get_net(struct datapath *dp) +static inline struct net *ovs_dp_get_net(const struct datapath *dp) { return read_pnet(&dp->net); } @@ -189,23 +186,26 @@ extern struct genl_family dp_vport_genl_family; extern struct genl_multicast_group ovs_dp_vport_multicast_group; -void ovs_dp_process_received_packet(struct vport *, struct sk_buff *); -void ovs_dp_process_packet_with_key(struct sk_buff *, - struct sw_flow_key *pkt_key, bool recirc); +void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key); void ovs_dp_detach_port(struct vport *); int ovs_dp_upcall(struct datapath *, struct sk_buff *, - const struct dp_upcall_info *); + const struct sw_flow_key *, const struct dp_upcall_info *); const char *ovs_dp_name(const struct datapath *dp); -struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 portid, u32 seq, +struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 pid, u32 seq, u8 cmd); -int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb, bool recirc); +int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb, + const struct sw_flow_actions *, struct sw_flow_key *); + void ovs_dp_notify_wq(struct work_struct *work); -#define OVS_NLERR(fmt, ...) \ +int action_fifos_init(void); +void action_fifos_exit(void); + +#define OVS_NLERR(logging_allowed, fmt, ...) \ do { \ - if (net_ratelimit()) \ - pr_info("netlink: " fmt, ##__VA_ARGS__); \ + if (logging_allowed && net_ratelimit()) \ + pr_info("netlink: " fmt "\n", ##__VA_ARGS__); \ } while (0) #endif /* datapath.h */ diff -Nru openvswitch-2.3.1/datapath/flow.c openvswitch-2.4.0~git20150623/datapath/flow.c --- openvswitch-2.3.1/datapath/flow.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/flow.c 2015-06-23 18:46:21.000000000 +0000 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ #include #include #include +#include #include #include "datapath.h" @@ -65,10 +67,11 @@ #define TCP_FLAGS_BE16(tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF)) void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, - struct sk_buff *skb) + const struct sk_buff *skb) { struct flow_stats *stats; int node = numa_node_id(); + int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); stats = rcu_dereference(flow->stats[node]); @@ -92,7 +95,7 @@ * allocated stats as we have already locked them. */ if (likely(flow->stats_last_writer != NUMA_NO_NODE) - && likely(!rcu_dereference(flow->stats[node]))) { + && likely(!rcu_access_pointer(flow->stats[node]))) { /* Try to allocate node-specific stats. */ struct flow_stats *new_stats; @@ -104,7 +107,7 @@ if (likely(new_stats)) { new_stats->used = jiffies; new_stats->packet_count = 1; - new_stats->byte_count = skb->len; + new_stats->byte_count = len; new_stats->tcp_flags = tcp_flags; spin_lock_init(&new_stats->lock); @@ -119,7 +122,7 @@ stats->used = jiffies; stats->packet_count++; - stats->byte_count += skb->len; + stats->byte_count += len; stats->tcp_flags |= tcp_flags; unlock: spin_unlock(&stats->lock); @@ -275,6 +278,8 @@ key->ip.frag = OVS_FRAG_TYPE_LATER; else key->ip.frag = OVS_FRAG_TYPE_FIRST; + } else { + key->ip.frag = OVS_FRAG_TYPE_NONE; } nh_len = payload_ofs - nh_ofs; @@ -359,6 +364,7 @@ */ key->tp.src = htons(icmp->icmp6_type); key->tp.dst = htons(icmp->icmp6_code); + memset(&key->ipv6.nd, 0, sizeof(key->ipv6.nd)); if (icmp->icmp6_code == 0 && (icmp->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION || @@ -398,13 +404,13 @@ if (unlikely(!is_zero_ether_addr(key->ipv6.nd.sll))) goto invalid; ether_addr_copy(key->ipv6.nd.sll, - &nd->opt[offset+sizeof(*nd_opt)]); + &nd->opt[offset+sizeof(*nd_opt)]); } else if (nd_opt->nd_opt_type == ND_OPT_TARGET_LL_ADDR && opt_len == 8) { if (unlikely(!is_zero_ether_addr(key->ipv6.nd.tll))) goto invalid; ether_addr_copy(key->ipv6.nd.tll, - &nd->opt[offset+sizeof(*nd_opt)]); + &nd->opt[offset+sizeof(*nd_opt)]); } icmp_len -= opt_len; @@ -449,6 +455,9 @@ int error; struct ethhdr *eth; + /* Flags are always used as part of stats */ + key->tp.flags = 0; + skb_reset_mac_header(skb); /* Link layer. We are guaranteed to have at least the 14 byte Ethernet @@ -460,9 +469,11 @@ __skb_pull(skb, 2 * ETH_ALEN); /* We are going to push all headers that we pull, so no need to - * update skb->csum here. */ + * update skb->csum here. + */ - if (vlan_tx_tag_present(skb)) + key->eth.tci = 0; + if (skb_vlan_tag_present(skb)) key->eth.tci = htons(vlan_get_tci(skb)); else if (eth->h_proto == htons(ETH_P_8021Q)) if (unlikely(parse_vlan(skb, key))) @@ -473,6 +484,7 @@ return -ENOMEM; skb_reset_network_header(skb); + skb_reset_mac_len(skb); __skb_push(skb, skb->data - skb_mac_header(skb)); /* Network layer. */ @@ -482,6 +494,8 @@ error = check_iphdr(skb); if (unlikely(error)) { + memset(&key->ip, 0, sizeof(key->ip)); + memset(&key->ipv4, 0, sizeof(key->ipv4)); if (error == -EINVAL) { skb->transport_header = skb->network_header; error = 0; @@ -503,8 +517,10 @@ return 0; } if (nh->frag_off & htons(IP_MF) || - skb_shinfo(skb)->gso_type & SKB_GSO_UDP) + skb_shinfo(skb)->gso_type & SKB_GSO_UDP) key->ip.frag = OVS_FRAG_TYPE_FIRST; + else + key->ip.frag = OVS_FRAG_TYPE_NONE; /* Transport layer. */ if (key->ip.proto == IPPROTO_TCP) { @@ -513,34 +529,44 @@ key->tp.src = tcp->source; key->tp.dst = tcp->dest; key->tp.flags = TCP_FLAGS_BE16(tcp); + } else { + memset(&key->tp, 0, sizeof(key->tp)); } + } else if (key->ip.proto == IPPROTO_UDP) { if (udphdr_ok(skb)) { struct udphdr *udp = udp_hdr(skb); key->tp.src = udp->source; key->tp.dst = udp->dest; + } else { + memset(&key->tp, 0, sizeof(key->tp)); } } else if (key->ip.proto == IPPROTO_SCTP) { if (sctphdr_ok(skb)) { struct sctphdr *sctp = sctp_hdr(skb); key->tp.src = sctp->source; key->tp.dst = sctp->dest; + } else { + memset(&key->tp, 0, sizeof(key->tp)); } } else if (key->ip.proto == IPPROTO_ICMP) { if (icmphdr_ok(skb)) { struct icmphdr *icmp = icmp_hdr(skb); /* The ICMP type and code fields use the 16-bit * transport port fields, so we need to store - * them in 16-bit network byte order. */ + * them in 16-bit network byte order. + */ key->tp.src = htons(icmp->type); key->tp.dst = htons(icmp->code); + } else { + memset(&key->tp, 0, sizeof(key->tp)); } } - } else if ((key->eth.type == htons(ETH_P_ARP) || - key->eth.type == htons(ETH_P_RARP)) && arphdr_ok(skb)) { - bool arp_available = arphdr_ok(skb); + } else if (key->eth.type == htons(ETH_P_ARP) || + key->eth.type == htons(ETH_P_RARP)) { struct arp_eth_header *arp; + bool arp_available = arphdr_ok(skb); arp = (struct arp_eth_header *)skb_network_header(skb); @@ -549,19 +575,55 @@ arp->ar_pro == htons(ETH_P_IP) && arp->ar_hln == ETH_ALEN && arp->ar_pln == 4) { + /* We only match on the lower 8 bits of the opcode. */ if (ntohs(arp->ar_op) <= 0xff) key->ip.proto = ntohs(arp->ar_op); + else + key->ip.proto = 0; + memcpy(&key->ipv4.addr.src, arp->ar_sip, sizeof(key->ipv4.addr.src)); memcpy(&key->ipv4.addr.dst, arp->ar_tip, sizeof(key->ipv4.addr.dst)); ether_addr_copy(key->ipv4.arp.sha, arp->ar_sha); ether_addr_copy(key->ipv4.arp.tha, arp->ar_tha); + } else { + memset(&key->ip, 0, sizeof(key->ip)); + memset(&key->ipv4, 0, sizeof(key->ipv4)); + } + } else if (eth_p_mpls(key->eth.type)) { + size_t stack_len = MPLS_HLEN; + + /* In the presence of an MPLS label stack the end of the L2 + * header and the beginning of the L3 header differ. + * + * Advance network_header to the beginning of the L3 + * header. mac_len corresponds to the end of the L2 header. + */ + while (1) { + __be32 lse; + + error = check_header(skb, skb->mac_len + stack_len); + if (unlikely(error)) + return 0; + + memcpy(&lse, skb_network_header(skb), MPLS_HLEN); + + if (stack_len == MPLS_HLEN) + memcpy(&key->mpls.top_lse, &lse, MPLS_HLEN); + + skb_set_network_header(skb, skb->mac_len + stack_len); + if (lse & htonl(MPLS_LS_S_MASK)) + break; + + stack_len += MPLS_HLEN; } } else if (key->eth.type == htons(ETH_P_IPV6)) { int nh_len; /* IPv6 Header + Extensions */ nh_len = parse_ipv6hdr(skb, key); if (unlikely(nh_len < 0)) { + memset(&key->ip, 0, sizeof(key->ip)); + memset(&key->ipv6.addr, 0, sizeof(key->ipv6.addr)); if (nh_len == -EINVAL) { skb->transport_header = skb->network_header; error = 0; @@ -583,68 +645,84 @@ key->tp.src = tcp->source; key->tp.dst = tcp->dest; key->tp.flags = TCP_FLAGS_BE16(tcp); + } else { + memset(&key->tp, 0, sizeof(key->tp)); } } else if (key->ip.proto == NEXTHDR_UDP) { if (udphdr_ok(skb)) { struct udphdr *udp = udp_hdr(skb); key->tp.src = udp->source; key->tp.dst = udp->dest; + } else { + memset(&key->tp, 0, sizeof(key->tp)); } } else if (key->ip.proto == NEXTHDR_SCTP) { if (sctphdr_ok(skb)) { struct sctphdr *sctp = sctp_hdr(skb); key->tp.src = sctp->source; key->tp.dst = sctp->dest; + } else { + memset(&key->tp, 0, sizeof(key->tp)); } } else if (key->ip.proto == NEXTHDR_ICMP) { if (icmp6hdr_ok(skb)) { error = parse_icmpv6(skb, key, nh_len); if (error) return error; + } else { + memset(&key->tp, 0, sizeof(key->tp)); } } } - return 0; } -int ovs_flow_key_extract(struct sk_buff *skb, struct sw_flow_key *key) +int ovs_flow_key_update(struct sk_buff *skb, struct sw_flow_key *key) +{ + return key_extract(skb, key); +} + +int ovs_flow_key_extract(const struct ovs_tunnel_info *tun_info, + struct sk_buff *skb, struct sw_flow_key *key) { /* Extract metadata from packet. */ + if (tun_info) { + memcpy(&key->tun_key, &tun_info->tunnel, sizeof(key->tun_key)); - memset(key, 0, sizeof(*key)); - if (OVS_CB(skb)->tun_key) - memcpy(&key->tun_key, OVS_CB(skb)->tun_key, sizeof(key->tun_key)); + BUILD_BUG_ON(((1 << (sizeof(tun_info->options_len) * 8)) - 1) > + sizeof(key->tun_opts)); + + if (tun_info->options) { + memcpy(TUN_METADATA_OPTS(key, tun_info->options_len), + tun_info->options, tun_info->options_len); + key->tun_opts_len = tun_info->options_len; + } else { + key->tun_opts_len = 0; + } + } else { + key->tun_opts_len = 0; + memset(&key->tun_key, 0, sizeof(key->tun_key)); + } key->phy.priority = skb->priority; key->phy.in_port = OVS_CB(skb)->input_vport->port_no; key->phy.skb_mark = skb->mark; + key->ovs_flow_hash = 0; + key->recirc_id = 0; return key_extract(skb, key); } int ovs_flow_key_extract_userspace(const struct nlattr *attr, struct sk_buff *skb, - struct sw_flow_key *key) + struct sw_flow_key *key, bool log) { int err; - memset(key, 0, sizeof(*key)); /* Extract metadata from netlink attributes. */ - err = ovs_nla_get_flow_metadata(attr, key); + err = ovs_nla_get_flow_metadata(attr, key, log); if (err) return err; return key_extract(skb, key); } - -int ovs_flow_key_extract_recirc(u32 recirc_id, - const struct sw_flow_key *key, - struct sk_buff *skb, - struct sw_flow_key *new_key) -{ - memset(new_key, 0, sizeof(*new_key)); - memcpy(new_key, key, OVS_SW_FLOW_KEY_METADATA_SIZE); - new_key->recirc_id = recirc_id; - return key_extract(skb, new_key); -} diff -Nru openvswitch-2.3.1/datapath/flow.h openvswitch-2.4.0~git20150623/datapath/flow.h --- openvswitch-2.3.1/datapath/flow.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/flow.h 2015-06-23 18:46:21.000000000 +0000 @@ -31,16 +31,14 @@ #include #include #include - #include -#include struct sk_buff; /* Used to memset ovs_key_ipv4_tunnel padding. */ #define OVS_TUNNEL_KEY_SIZE \ - (offsetof(struct ovs_key_ipv4_tunnel, ipv4_ttl) + \ - FIELD_SIZEOF(struct ovs_key_ipv4_tunnel, ipv4_ttl)) + (offsetof(struct ovs_key_ipv4_tunnel, tp_dst) + \ + FIELD_SIZEOF(struct ovs_key_ipv4_tunnel, tp_dst)) struct ovs_key_ipv4_tunnel { __be64 tun_id; @@ -49,30 +47,82 @@ __be16 tun_flags; u8 ipv4_tos; u8 ipv4_ttl; + __be16 tp_src; + __be16 tp_dst; } __packed __aligned(4); /* Minimize padding. */ -static inline void ovs_flow_tun_key_init(struct ovs_key_ipv4_tunnel *tun_key, - const struct iphdr *iph, __be64 tun_id, - __be16 tun_flags) +struct ovs_tunnel_info { + struct ovs_key_ipv4_tunnel tunnel; + const void *options; + u8 options_len; +}; + +/* Store options at the end of the array if they are less than the + * maximum size. This allows us to get the benefits of variable length + * matching for small options. + */ +#define TUN_METADATA_OFFSET(opt_len) \ + (FIELD_SIZEOF(struct sw_flow_key, tun_opts) - opt_len) +#define TUN_METADATA_OPTS(flow_key, opt_len) \ + ((void *)((flow_key)->tun_opts + TUN_METADATA_OFFSET(opt_len))) + + +static inline void __ovs_flow_tun_info_init(struct ovs_tunnel_info *tun_info, + __be32 saddr, __be32 daddr, + u8 tos, u8 ttl, + __be16 tp_src, + __be16 tp_dst, + __be64 tun_id, + __be16 tun_flags, + const void *opts, + u8 opts_len) +{ + tun_info->tunnel.tun_id = tun_id; + tun_info->tunnel.ipv4_src = saddr; + tun_info->tunnel.ipv4_dst = daddr; + tun_info->tunnel.ipv4_tos = tos; + tun_info->tunnel.ipv4_ttl = ttl; + tun_info->tunnel.tun_flags = tun_flags; + + /* For the tunnel types on the top of IPsec, the tp_src and tp_dst of + * the upper tunnel are used. + * E.g: GRE over IPSEC, the tp_src and tp_port are zero. + */ + tun_info->tunnel.tp_src = tp_src; + tun_info->tunnel.tp_dst = tp_dst; + + /* Clear struct padding. */ + if (sizeof(tun_info->tunnel) != OVS_TUNNEL_KEY_SIZE) + memset((unsigned char *)&tun_info->tunnel + OVS_TUNNEL_KEY_SIZE, + 0, sizeof(tun_info->tunnel) - OVS_TUNNEL_KEY_SIZE); + + tun_info->options = opts; + tun_info->options_len = opts_len; +} + +static inline void ovs_flow_tun_info_init(struct ovs_tunnel_info *tun_info, + const struct iphdr *iph, + __be16 tp_src, + __be16 tp_dst, + __be64 tun_id, + __be16 tun_flags, + const void *opts, + u8 opts_len) { - tun_key->tun_id = tun_id; - tun_key->ipv4_src = iph->saddr; - tun_key->ipv4_dst = iph->daddr; - tun_key->ipv4_tos = iph->tos; - tun_key->ipv4_ttl = iph->ttl; - tun_key->tun_flags = tun_flags; - - /* clear struct padding. */ - memset((unsigned char *) tun_key + OVS_TUNNEL_KEY_SIZE, 0, - sizeof(*tun_key) - OVS_TUNNEL_KEY_SIZE); + __ovs_flow_tun_info_init(tun_info, iph->saddr, iph->daddr, + iph->tos, iph->ttl, + tp_src, tp_dst, + tun_id, tun_flags, + opts, opts_len); } #define OVS_SW_FLOW_KEY_METADATA_SIZE \ (offsetof(struct sw_flow_key, recirc_id) + \ FIELD_SIZEOF(struct sw_flow_key, recirc_id)) - struct sw_flow_key { + u8 tun_opts[255]; + u8 tun_opts_len; struct ovs_key_ipv4_tunnel tun_key; /* Encapsulating tunnel key. */ struct { u32 priority; /* Packet QoS priority. */ @@ -87,12 +137,17 @@ __be16 tci; /* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ __be16 type; /* Ethernet frame type. */ } eth; - struct { - u8 proto; /* IP protocol or lower 8 bits of ARP opcode. */ - u8 tos; /* IP ToS. */ - u8 ttl; /* IP TTL/hop limit. */ - u8 frag; /* One of OVS_FRAG_TYPE_*. */ - } ip; + union { + struct { + __be32 top_lse; /* top label stack entry */ + } mpls; + struct { + u8 proto; /* IP protocol or lower 8 bits of ARP opcode. */ + u8 tos; /* IP ToS. */ + u8 ttl; /* IP TTL/hop limit. */ + u8 frag; /* One of OVS_FRAG_TYPE_*. */ + } ip; + }; struct { __be16 src; /* TCP/UDP/SCTP source port. */ __be16 dst; /* TCP/UDP/SCTP destination port. */ @@ -142,6 +197,16 @@ struct sw_flow_mask *mask; }; +#define MAX_UFID_LENGTH 16 /* 128 bits */ + +struct sw_flow_id { + u32 ufid_len; + union { + u32 ufid[MAX_UFID_LENGTH / 4]; + struct sw_flow_key *unmasked_key; + }; +}; + struct sw_flow_actions { struct rcu_head rcu; u32 actions_len; @@ -158,13 +223,15 @@ struct sw_flow { struct rcu_head rcu; - struct hlist_node hash_node[2]; - u32 hash; + struct { + struct hlist_node node[2]; + u32 hash; + } flow_table, ufid_table; int stats_last_writer; /* NUMA-node id of the last writer on * 'stats[0]'. */ struct sw_flow_key key; - struct sw_flow_key unmasked_key; + struct sw_flow_id id; struct sw_flow_mask *mask; struct sw_flow_actions __rcu *sf_acts; struct flow_stats __rcu *stats[]; /* One for each NUMA node. First one @@ -188,21 +255,31 @@ unsigned char ar_tip[4]; /* target IP address */ } __packed; +static inline bool ovs_identifier_is_ufid(const struct sw_flow_id *sfid) +{ + return sfid->ufid_len; +} + +static inline bool ovs_identifier_is_key(const struct sw_flow_id *sfid) +{ + return !ovs_identifier_is_ufid(sfid); +} + void ovs_flow_stats_update(struct sw_flow *, __be16 tcp_flags, - struct sk_buff *); + const struct sk_buff *); void ovs_flow_stats_get(const struct sw_flow *, struct ovs_flow_stats *, unsigned long *used, __be16 *tcp_flags); void ovs_flow_stats_clear(struct sw_flow *); u64 ovs_flow_used_time(unsigned long flow_jiffies); -int ovs_flow_key_extract(struct sk_buff *skb, struct sw_flow_key *key); +/* Update the non-metadata part of the flow key using skb. */ +int ovs_flow_key_update(struct sk_buff *skb, struct sw_flow_key *key); +int ovs_flow_key_extract(const struct ovs_tunnel_info *tun_info, + struct sk_buff *skb, + struct sw_flow_key *key); /* Extract key from packet coming from userspace. */ int ovs_flow_key_extract_userspace(const struct nlattr *attr, struct sk_buff *skb, - struct sw_flow_key *key); -int ovs_flow_key_extract_recirc(u32 recirc_id, - const struct sw_flow_key *key, - struct sk_buff *skb, - struct sw_flow_key *new_key); + struct sw_flow_key *key, bool log); #endif /* flow.h */ diff -Nru openvswitch-2.3.1/datapath/flow_netlink.c openvswitch-2.4.0~git20150623/datapath/flow_netlink.c --- openvswitch-2.3.1/datapath/flow_netlink.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/flow_netlink.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2013 Nicira, Inc. + * Copyright (c) 2007-2014 Nicira, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -18,8 +18,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include "flow.h" -#include "datapath.h" #include #include #include @@ -42,28 +40,36 @@ #include #include #include +#include #include -#include #include #include +#include +#include "datapath.h" +#include "flow.h" #include "flow_netlink.h" +#include "vport-vxlan.h" + +struct ovs_len_tbl { + int len; + const struct ovs_len_tbl *next; +}; -static void update_range__(struct sw_flow_match *match, - size_t offset, size_t size, bool is_mask) +#define OVS_ATTR_NESTED -1 + +static void update_range(struct sw_flow_match *match, + size_t offset, size_t size, bool is_mask) { - struct sw_flow_key_range *range = NULL; + struct sw_flow_key_range *range; size_t start = rounddown(offset, sizeof(long)); size_t end = roundup(offset + size, sizeof(long)); if (!is_mask) range = &match->range; - else if (match->mask) + else range = &match->mask->range; - if (!range) - return; - if (range->start == range->end) { range->start = start; range->end = end; @@ -79,41 +85,48 @@ #define SW_FLOW_KEY_PUT(match, field, value, is_mask) \ do { \ - update_range__(match, offsetof(struct sw_flow_key, field), \ - sizeof((match)->key->field), is_mask); \ - if (is_mask) { \ - if ((match)->mask) \ - (match)->mask->key.field = value; \ - } else { \ + update_range(match, offsetof(struct sw_flow_key, field), \ + sizeof((match)->key->field), is_mask); \ + if (is_mask) \ + (match)->mask->key.field = value; \ + else \ (match)->key->field = value; \ - } \ } while (0) -#define SW_FLOW_KEY_MEMCPY(match, field, value_p, len, is_mask) \ - do { \ - update_range__(match, offsetof(struct sw_flow_key, field), \ - len, is_mask); \ - if (is_mask) { \ - if ((match)->mask) \ - memcpy(&(match)->mask->key.field, value_p, len);\ - } else { \ - memcpy(&(match)->key->field, value_p, len); \ - } \ +#define SW_FLOW_KEY_MEMCPY_OFFSET(match, offset, value_p, len, is_mask) \ + do { \ + update_range(match, offset, len, is_mask); \ + if (is_mask) \ + memcpy((u8 *)&(match)->mask->key + offset, value_p, len);\ + else \ + memcpy((u8 *)(match)->key + offset, value_p, len); \ } while (0) -static u16 range_n_bytes(const struct sw_flow_key_range *range) -{ - return range->end - range->start; -} +#define SW_FLOW_KEY_MEMCPY(match, field, value_p, len, is_mask) \ + SW_FLOW_KEY_MEMCPY_OFFSET(match, offsetof(struct sw_flow_key, field), \ + value_p, len, is_mask) + +#define SW_FLOW_KEY_MEMSET_FIELD(match, field, value, is_mask) \ + do { \ + update_range(match, offsetof(struct sw_flow_key, field), \ + sizeof((match)->key->field), is_mask); \ + if (is_mask) \ + memset((u8 *)&(match)->mask->key.field, value, \ + sizeof((match)->mask->key.field)); \ + else \ + memset((u8 *)&(match)->key->field, value, \ + sizeof((match)->key->field)); \ + } while (0) static bool match_validate(const struct sw_flow_match *match, - u64 key_attrs, u64 mask_attrs) + u64 key_attrs, u64 mask_attrs, bool log) { u64 key_expected = 1ULL << OVS_KEY_ATTR_ETHERNET; u64 mask_allowed = key_attrs; /* At most allow all key attributes */ /* The following mask attributes allowed only if they - * pass the validation tests. */ + * pass the validation tests. + */ mask_allowed &= ~((1ULL << OVS_KEY_ATTR_IPV4) | (1ULL << OVS_KEY_ATTR_IPV6) | (1ULL << OVS_KEY_ATTR_TCP) @@ -123,7 +136,8 @@ | (1ULL << OVS_KEY_ATTR_ICMP) | (1ULL << OVS_KEY_ATTR_ICMPV6) | (1ULL << OVS_KEY_ATTR_ARP) - | (1ULL << OVS_KEY_ATTR_ND)); + | (1ULL << OVS_KEY_ATTR_ND) + | (1ULL << OVS_KEY_ATTR_MPLS)); /* Always allowed mask fields. */ mask_allowed |= ((1ULL << OVS_KEY_ATTR_TUNNEL) @@ -138,6 +152,12 @@ mask_allowed |= 1ULL << OVS_KEY_ATTR_ARP; } + if (eth_p_mpls(match->key->eth.type)) { + key_expected |= 1ULL << OVS_KEY_ATTR_MPLS; + if (match->mask && (match->mask->key.eth.type == htons(0xffff))) + mask_allowed |= 1ULL << OVS_KEY_ATTR_MPLS; + } + if (match->key->eth.type == htons(ETH_P_IP)) { key_expected |= 1ULL << OVS_KEY_ATTR_IPV4; if (match->mask && (match->mask->key.eth.type == htons(0xffff))) @@ -218,45 +238,108 @@ if ((key_attrs & key_expected) != key_expected) { /* Key attributes check failed. */ - OVS_NLERR("Missing expected key attributes (key_attrs=%llx, expected=%llx).\n", - (unsigned long long)key_attrs, (unsigned long long)key_expected); + OVS_NLERR(log, "Missing key (keys=%llx, expected=%llx)", + (unsigned long long)key_attrs, + (unsigned long long)key_expected); return false; } if ((mask_attrs & mask_allowed) != mask_attrs) { /* Mask attributes check failed. */ - OVS_NLERR("Contain more than allowed mask fields (mask_attrs=%llx, mask_allowed=%llx).\n", - (unsigned long long)mask_attrs, (unsigned long long)mask_allowed); + OVS_NLERR(log, "Unexpected mask (mask=%llx, allowed=%llx)", + (unsigned long long)mask_attrs, + (unsigned long long)mask_allowed); return false; } return true; } -/* The size of the argument for each %OVS_KEY_ATTR_* Netlink attribute. */ -static const int ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = { - [OVS_KEY_ATTR_ENCAP] = -1, - [OVS_KEY_ATTR_PRIORITY] = sizeof(u32), - [OVS_KEY_ATTR_IN_PORT] = sizeof(u32), - [OVS_KEY_ATTR_SKB_MARK] = sizeof(u32), - [OVS_KEY_ATTR_ETHERNET] = sizeof(struct ovs_key_ethernet), - [OVS_KEY_ATTR_VLAN] = sizeof(__be16), - [OVS_KEY_ATTR_ETHERTYPE] = sizeof(__be16), - [OVS_KEY_ATTR_IPV4] = sizeof(struct ovs_key_ipv4), - [OVS_KEY_ATTR_IPV6] = sizeof(struct ovs_key_ipv6), - [OVS_KEY_ATTR_TCP] = sizeof(struct ovs_key_tcp), - [OVS_KEY_ATTR_TCP_FLAGS] = sizeof(__be16), - [OVS_KEY_ATTR_UDP] = sizeof(struct ovs_key_udp), - [OVS_KEY_ATTR_SCTP] = sizeof(struct ovs_key_sctp), - [OVS_KEY_ATTR_ICMP] = sizeof(struct ovs_key_icmp), - [OVS_KEY_ATTR_ICMPV6] = sizeof(struct ovs_key_icmpv6), - [OVS_KEY_ATTR_ARP] = sizeof(struct ovs_key_arp), - [OVS_KEY_ATTR_ND] = sizeof(struct ovs_key_nd), - [OVS_KEY_ATTR_DP_HASH] = sizeof(u32), - [OVS_KEY_ATTR_RECIRC_ID] = sizeof(u32), - [OVS_KEY_ATTR_TUNNEL] = -1, +size_t ovs_tun_key_attr_size(void) +{ + /* Whenever adding new OVS_TUNNEL_KEY_ FIELDS, we should consider + * updating this function. + */ + return nla_total_size(8) /* OVS_TUNNEL_KEY_ATTR_ID */ + + nla_total_size(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_SRC */ + + nla_total_size(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_DST */ + + nla_total_size(1) /* OVS_TUNNEL_KEY_ATTR_TOS */ + + nla_total_size(1) /* OVS_TUNNEL_KEY_ATTR_TTL */ + + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT */ + + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_CSUM */ + + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_OAM */ + + nla_total_size(256) /* OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS */ + /* OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS is mutually exclusive with + * OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS and covered by it. + */ + + nla_total_size(2) /* OVS_TUNNEL_KEY_ATTR_TP_SRC */ + + nla_total_size(2); /* OVS_TUNNEL_KEY_ATTR_TP_DST */ +} + +size_t ovs_key_attr_size(void) +{ + /* Whenever adding new OVS_KEY_ FIELDS, we should consider + * updating this function. + */ + BUILD_BUG_ON(OVS_KEY_ATTR_TUNNEL_INFO != 22); + + return nla_total_size(4) /* OVS_KEY_ATTR_PRIORITY */ + + nla_total_size(0) /* OVS_KEY_ATTR_TUNNEL */ + + ovs_tun_key_attr_size() + + nla_total_size(4) /* OVS_KEY_ATTR_IN_PORT */ + + nla_total_size(4) /* OVS_KEY_ATTR_SKB_MARK */ + + nla_total_size(4) /* OVS_KEY_ATTR_DP_HASH */ + + nla_total_size(4) /* OVS_KEY_ATTR_RECIRC_ID */ + + nla_total_size(12) /* OVS_KEY_ATTR_ETHERNET */ + + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */ + + nla_total_size(4) /* OVS_KEY_ATTR_VLAN */ + + nla_total_size(0) /* OVS_KEY_ATTR_ENCAP */ + + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */ + + nla_total_size(40) /* OVS_KEY_ATTR_IPV6 */ + + nla_total_size(2) /* OVS_KEY_ATTR_ICMPV6 */ + + nla_total_size(28); /* OVS_KEY_ATTR_ND */ +} + +static const struct ovs_len_tbl ovs_tunnel_key_lens[OVS_TUNNEL_KEY_ATTR_MAX + 1] = { + [OVS_TUNNEL_KEY_ATTR_ID] = { .len = sizeof(u64) }, + [OVS_TUNNEL_KEY_ATTR_IPV4_SRC] = { .len = sizeof(u32) }, + [OVS_TUNNEL_KEY_ATTR_IPV4_DST] = { .len = sizeof(u32) }, + [OVS_TUNNEL_KEY_ATTR_TOS] = { .len = 1 }, + [OVS_TUNNEL_KEY_ATTR_TTL] = { .len = 1 }, + [OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT] = { .len = 0 }, + [OVS_TUNNEL_KEY_ATTR_CSUM] = { .len = 0 }, + [OVS_TUNNEL_KEY_ATTR_TP_SRC] = { .len = sizeof(u16) }, + [OVS_TUNNEL_KEY_ATTR_TP_DST] = { .len = sizeof(u16) }, + [OVS_TUNNEL_KEY_ATTR_OAM] = { .len = 0 }, + [OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS] = { .len = OVS_ATTR_NESTED }, + [OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS] = { .len = OVS_ATTR_NESTED }, }; +/* The size of the argument for each %OVS_KEY_ATTR_* Netlink attribute. */ +static const struct ovs_len_tbl ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = { + [OVS_KEY_ATTR_ENCAP] = { .len = OVS_ATTR_NESTED }, + [OVS_KEY_ATTR_PRIORITY] = { .len = sizeof(u32) }, + [OVS_KEY_ATTR_IN_PORT] = { .len = sizeof(u32) }, + [OVS_KEY_ATTR_SKB_MARK] = { .len = sizeof(u32) }, + [OVS_KEY_ATTR_ETHERNET] = { .len = sizeof(struct ovs_key_ethernet) }, + [OVS_KEY_ATTR_VLAN] = { .len = sizeof(__be16) }, + [OVS_KEY_ATTR_ETHERTYPE] = { .len = sizeof(__be16) }, + [OVS_KEY_ATTR_IPV4] = { .len = sizeof(struct ovs_key_ipv4) }, + [OVS_KEY_ATTR_IPV6] = { .len = sizeof(struct ovs_key_ipv6) }, + [OVS_KEY_ATTR_TCP] = { .len = sizeof(struct ovs_key_tcp) }, + [OVS_KEY_ATTR_TCP_FLAGS] = { .len = sizeof(__be16) }, + [OVS_KEY_ATTR_UDP] = { .len = sizeof(struct ovs_key_udp) }, + [OVS_KEY_ATTR_SCTP] = { .len = sizeof(struct ovs_key_sctp) }, + [OVS_KEY_ATTR_ICMP] = { .len = sizeof(struct ovs_key_icmp) }, + [OVS_KEY_ATTR_ICMPV6] = { .len = sizeof(struct ovs_key_icmpv6) }, + [OVS_KEY_ATTR_ARP] = { .len = sizeof(struct ovs_key_arp) }, + [OVS_KEY_ATTR_ND] = { .len = sizeof(struct ovs_key_nd) }, + [OVS_KEY_ATTR_RECIRC_ID] = { .len = sizeof(u32) }, + [OVS_KEY_ATTR_DP_HASH] = { .len = sizeof(u32) }, + [OVS_KEY_ATTR_TUNNEL] = { .len = OVS_ATTR_NESTED, + .next = ovs_tunnel_key_lens, }, + [OVS_KEY_ATTR_MPLS] = { .len = sizeof(struct ovs_key_mpls) }, +}; static bool is_all_zero(const u8 *fp, size_t size) { int i; @@ -273,7 +356,7 @@ static int __parse_flow_nlattrs(const struct nlattr *attr, const struct nlattr *a[], - u64 *attrsp, bool nz) + u64 *attrsp, bool log, bool nz) { const struct nlattr *nla; u64 attrs; @@ -285,21 +368,20 @@ int expected_len; if (type > OVS_KEY_ATTR_MAX) { - OVS_NLERR("Unknown key attribute (type=%d, max=%d).\n", + OVS_NLERR(log, "Key type %d is out of range max %d", type, OVS_KEY_ATTR_MAX); return -EINVAL; } if (attrs & (1ULL << type)) { - OVS_NLERR("Duplicate key attribute (type %d).\n", type); + OVS_NLERR(log, "Duplicate key (type %d).", type); return -EINVAL; } - expected_len = ovs_key_lens[type]; - if (nla_len(nla) != expected_len && expected_len != -1) { - OVS_NLERR("Key attribute has unexpected length (type=%d" - ", length=%d, expected=%d).\n", type, - nla_len(nla), expected_len); + expected_len = ovs_key_lens[type].len; + if (nla_len(nla) != expected_len && expected_len != OVS_ATTR_NESTED) { + OVS_NLERR(log, "Key %d has unexpected len %d expected %d", + type, nla_len(nla), expected_len); return -EINVAL; } @@ -309,7 +391,7 @@ } } if (rem) { - OVS_NLERR("Message has %d unknown bytes.\n", rem); + OVS_NLERR(log, "Message has %d unknown bytes.", rem); return -EINVAL; } @@ -318,47 +400,129 @@ } static int parse_flow_mask_nlattrs(const struct nlattr *attr, - const struct nlattr *a[], u64 *attrsp) + const struct nlattr *a[], u64 *attrsp, + bool log) { - return __parse_flow_nlattrs(attr, a, attrsp, true); + return __parse_flow_nlattrs(attr, a, attrsp, log, true); } static int parse_flow_nlattrs(const struct nlattr *attr, - const struct nlattr *a[], u64 *attrsp) + const struct nlattr *a[], u64 *attrsp, + bool log) +{ + return __parse_flow_nlattrs(attr, a, attrsp, log, false); +} + +static int genev_tun_opt_from_nlattr(const struct nlattr *a, + struct sw_flow_match *match, bool is_mask, + bool log) { - return __parse_flow_nlattrs(attr, a, attrsp, false); + unsigned long opt_key_offset; + + if (nla_len(a) > sizeof(match->key->tun_opts)) { + OVS_NLERR(log, "Geneve option length err (len %d, max %zu).", + nla_len(a), sizeof(match->key->tun_opts)); + return -EINVAL; + } + + if (nla_len(a) % 4 != 0) { + OVS_NLERR(log, "Geneve opt len %d is not a multiple of 4.", + nla_len(a)); + return -EINVAL; + } + + /* We need to record the length of the options passed + * down, otherwise packets with the same format but + * additional options will be silently matched. + */ + if (!is_mask) { + SW_FLOW_KEY_PUT(match, tun_opts_len, nla_len(a), + false); + } else { + /* This is somewhat unusual because it looks at + * both the key and mask while parsing the + * attributes (and by extension assumes the key + * is parsed first). Normally, we would verify + * that each is the correct length and that the + * attributes line up in the validate function. + * However, that is difficult because this is + * variable length and we won't have the + * information later. + */ + if (match->key->tun_opts_len != nla_len(a)) { + OVS_NLERR(log, "Geneve option len %d != mask len %d", + match->key->tun_opts_len, nla_len(a)); + return -EINVAL; + } + + SW_FLOW_KEY_PUT(match, tun_opts_len, 0xff, true); + } + + opt_key_offset = TUN_METADATA_OFFSET(nla_len(a)); + SW_FLOW_KEY_MEMCPY_OFFSET(match, opt_key_offset, nla_data(a), + nla_len(a), is_mask); + return 0; +} + +static const struct nla_policy vxlan_opt_policy[OVS_VXLAN_EXT_MAX + 1] = { + [OVS_VXLAN_EXT_GBP] = { .type = NLA_U32 }, +}; + +static int vxlan_tun_opt_from_nlattr(const struct nlattr *a, + struct sw_flow_match *match, bool is_mask, + bool log) +{ + struct nlattr *tb[OVS_VXLAN_EXT_MAX+1]; + unsigned long opt_key_offset; + struct ovs_vxlan_opts opts; + int err; + + BUILD_BUG_ON(sizeof(opts) > sizeof(match->key->tun_opts)); + + err = nla_parse_nested(tb, OVS_VXLAN_EXT_MAX, a, vxlan_opt_policy); + if (err < 0) + return err; + + memset(&opts, 0, sizeof(opts)); + + if (tb[OVS_VXLAN_EXT_GBP]) + opts.gbp = nla_get_u32(tb[OVS_VXLAN_EXT_GBP]); + + if (!is_mask) + SW_FLOW_KEY_PUT(match, tun_opts_len, sizeof(opts), false); + else + SW_FLOW_KEY_PUT(match, tun_opts_len, 0xff, true); + + opt_key_offset = TUN_METADATA_OFFSET(sizeof(opts)); + SW_FLOW_KEY_MEMCPY_OFFSET(match, opt_key_offset, &opts, sizeof(opts), + is_mask); + return 0; } static int ipv4_tun_from_nlattr(const struct nlattr *attr, - struct sw_flow_match *match, bool is_mask) + struct sw_flow_match *match, bool is_mask, + bool log) { struct nlattr *a; int rem; bool ttl = false; __be16 tun_flags = 0; + int opts_type = 0; nla_for_each_nested(a, attr, rem) { int type = nla_type(a); - static const u32 ovs_tunnel_key_lens[OVS_TUNNEL_KEY_ATTR_MAX + 1] = { - [OVS_TUNNEL_KEY_ATTR_ID] = sizeof(u64), - [OVS_TUNNEL_KEY_ATTR_IPV4_SRC] = sizeof(u32), - [OVS_TUNNEL_KEY_ATTR_IPV4_DST] = sizeof(u32), - [OVS_TUNNEL_KEY_ATTR_TOS] = 1, - [OVS_TUNNEL_KEY_ATTR_TTL] = 1, - [OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT] = 0, - [OVS_TUNNEL_KEY_ATTR_CSUM] = 0, - }; + int err; if (type > OVS_TUNNEL_KEY_ATTR_MAX) { - OVS_NLERR("Unknown IPv4 tunnel attribute (type=%d, max=%d).\n", - type, OVS_TUNNEL_KEY_ATTR_MAX); + OVS_NLERR(log, "Tunnel attr %d out of range max %d", + type, OVS_TUNNEL_KEY_ATTR_MAX); return -EINVAL; } - if (ovs_tunnel_key_lens[type] != nla_len(a)) { - OVS_NLERR("IPv4 tunnel attribute type has unexpected " - " length (type=%d, length=%d, expected=%d).\n", - type, nla_len(a), ovs_tunnel_key_lens[type]); + if (ovs_tunnel_key_lens[type].len != nla_len(a) && + ovs_tunnel_key_lens[type].len != OVS_ATTR_NESTED) { + OVS_NLERR(log, "Tunnel attr %d has unexpected len %d expected %d", + type, nla_len(a), ovs_tunnel_key_lens[type].len); return -EINVAL; } @@ -391,7 +555,46 @@ case OVS_TUNNEL_KEY_ATTR_CSUM: tun_flags |= TUNNEL_CSUM; break; + case OVS_TUNNEL_KEY_ATTR_TP_SRC: + SW_FLOW_KEY_PUT(match, tun_key.tp_src, + nla_get_be16(a), is_mask); + break; + case OVS_TUNNEL_KEY_ATTR_TP_DST: + SW_FLOW_KEY_PUT(match, tun_key.tp_dst, + nla_get_be16(a), is_mask); + break; + case OVS_TUNNEL_KEY_ATTR_OAM: + tun_flags |= TUNNEL_OAM; + break; + case OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS: + if (opts_type) { + OVS_NLERR(log, "Multiple metadata blocks provided"); + return -EINVAL; + } + + err = genev_tun_opt_from_nlattr(a, match, is_mask, log); + if (err) + return err; + + tun_flags |= TUNNEL_GENEVE_OPT; + opts_type = type; + break; + case OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS: + if (opts_type) { + OVS_NLERR(log, "Multiple metadata blocks provided"); + return -EINVAL; + } + + err = vxlan_tun_opt_from_nlattr(a, match, is_mask, log); + if (err) + return err; + + tun_flags |= TUNNEL_VXLAN_OPT; + opts_type = type; + break; default: + OVS_NLERR(log, "Unknown IPv4 tunnel attribute %d", + type); return -EINVAL; } } @@ -399,63 +602,119 @@ SW_FLOW_KEY_PUT(match, tun_key.tun_flags, tun_flags, is_mask); if (rem > 0) { - OVS_NLERR("IPv4 tunnel attribute has %d unknown bytes.\n", rem); + OVS_NLERR(log, "IPv4 tunnel attribute has %d unknown bytes.", + rem); return -EINVAL; } if (!is_mask) { if (!match->key->tun_key.ipv4_dst) { - OVS_NLERR("IPv4 tunnel destination address is zero.\n"); + OVS_NLERR(log, "IPv4 tunnel dst address is zero"); return -EINVAL; } if (!ttl) { - OVS_NLERR("IPv4 tunnel TTL not specified.\n"); + OVS_NLERR(log, "IPv4 tunnel TTL not specified."); return -EINVAL; } } - return 0; + return opts_type; } -static int ipv4_tun_to_nlattr(struct sk_buff *skb, - const struct ovs_key_ipv4_tunnel *tun_key, - const struct ovs_key_ipv4_tunnel *output) +static int vxlan_opt_to_nlattr(struct sk_buff *skb, + const void *tun_opts, int swkey_tun_opts_len) { + const struct ovs_vxlan_opts *opts = tun_opts; struct nlattr *nla; - nla = nla_nest_start(skb, OVS_KEY_ATTR_TUNNEL); + nla = nla_nest_start(skb, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS); if (!nla) return -EMSGSIZE; + if (nla_put_u32(skb, OVS_VXLAN_EXT_GBP, opts->gbp) < 0) + return -EMSGSIZE; + + nla_nest_end(skb, nla); + return 0; +} + +static int __ipv4_tun_to_nlattr(struct sk_buff *skb, + const struct ovs_key_ipv4_tunnel *output, + const void *tun_opts, int swkey_tun_opts_len) +{ if (output->tun_flags & TUNNEL_KEY && nla_put_be64(skb, OVS_TUNNEL_KEY_ATTR_ID, output->tun_id)) return -EMSGSIZE; if (output->ipv4_src && - nla_put_be32(skb, OVS_TUNNEL_KEY_ATTR_IPV4_SRC, output->ipv4_src)) + nla_put_be32(skb, OVS_TUNNEL_KEY_ATTR_IPV4_SRC, output->ipv4_src)) return -EMSGSIZE; if (output->ipv4_dst && - nla_put_be32(skb, OVS_TUNNEL_KEY_ATTR_IPV4_DST, output->ipv4_dst)) + nla_put_be32(skb, OVS_TUNNEL_KEY_ATTR_IPV4_DST, output->ipv4_dst)) return -EMSGSIZE; if (output->ipv4_tos && - nla_put_u8(skb, OVS_TUNNEL_KEY_ATTR_TOS, output->ipv4_tos)) + nla_put_u8(skb, OVS_TUNNEL_KEY_ATTR_TOS, output->ipv4_tos)) return -EMSGSIZE; if (nla_put_u8(skb, OVS_TUNNEL_KEY_ATTR_TTL, output->ipv4_ttl)) return -EMSGSIZE; if ((output->tun_flags & TUNNEL_DONT_FRAGMENT) && - nla_put_flag(skb, OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT)) + nla_put_flag(skb, OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT)) return -EMSGSIZE; if ((output->tun_flags & TUNNEL_CSUM) && - nla_put_flag(skb, OVS_TUNNEL_KEY_ATTR_CSUM)) + nla_put_flag(skb, OVS_TUNNEL_KEY_ATTR_CSUM)) + return -EMSGSIZE; + if (output->tp_src && + nla_put_be16(skb, OVS_TUNNEL_KEY_ATTR_TP_SRC, output->tp_src)) return -EMSGSIZE; + if (output->tp_dst && + nla_put_be16(skb, OVS_TUNNEL_KEY_ATTR_TP_DST, output->tp_dst)) + return -EMSGSIZE; + if ((output->tun_flags & TUNNEL_OAM) && + nla_put_flag(skb, OVS_TUNNEL_KEY_ATTR_OAM)) + return -EMSGSIZE; + if (tun_opts) { + if (output->tun_flags & TUNNEL_GENEVE_OPT && + nla_put(skb, OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, + swkey_tun_opts_len, tun_opts)) + return -EMSGSIZE; + else if (output->tun_flags & TUNNEL_VXLAN_OPT && + vxlan_opt_to_nlattr(skb, tun_opts, swkey_tun_opts_len)) + return -EMSGSIZE; + } + + return 0; +} + +static int ipv4_tun_to_nlattr(struct sk_buff *skb, + const struct ovs_key_ipv4_tunnel *output, + const void *tun_opts, int swkey_tun_opts_len) +{ + struct nlattr *nla; + int err; + + nla = nla_nest_start(skb, OVS_KEY_ATTR_TUNNEL); + if (!nla) + return -EMSGSIZE; + + err = __ipv4_tun_to_nlattr(skb, output, tun_opts, swkey_tun_opts_len); + if (err) + return err; nla_nest_end(skb, nla); return 0; } +int ovs_nla_put_egress_tunnel_key(struct sk_buff *skb, + const struct ovs_tunnel_info *egress_tun_info) +{ + return __ipv4_tun_to_nlattr(skb, &egress_tun_info->tunnel, + egress_tun_info->options, + egress_tun_info->options_len); +} static int metadata_from_nlattrs(struct sw_flow_match *match, u64 *attrs, - const struct nlattr **a, bool is_mask) + const struct nlattr **a, bool is_mask, + bool log) { if (*attrs & (1ULL << OVS_KEY_ATTR_DP_HASH)) { u32 hash_val = nla_get_u32(a[OVS_KEY_ATTR_DP_HASH]); @@ -480,10 +739,13 @@ if (*attrs & (1ULL << OVS_KEY_ATTR_IN_PORT)) { u32 in_port = nla_get_u32(a[OVS_KEY_ATTR_IN_PORT]); - if (is_mask) + if (is_mask) { in_port = 0xffffffff; /* Always exact match in_port. */ - else if (in_port >= DP_MAX_PORTS) + } else if (in_port >= DP_MAX_PORTS) { + OVS_NLERR(log, "Port %d exceeds max allowable %d", + in_port, DP_MAX_PORTS); return -EINVAL; + } SW_FLOW_KEY_PUT(match, phy.in_port, in_port, is_mask); *attrs &= ~(1ULL << OVS_KEY_ATTR_IN_PORT); @@ -499,7 +761,7 @@ } if (*attrs & (1ULL << OVS_KEY_ATTR_TUNNEL)) { if (ipv4_tun_from_nlattr(a[OVS_KEY_ATTR_TUNNEL], match, - is_mask)) + is_mask, log) < 0) return -EINVAL; *attrs &= ~(1ULL << OVS_KEY_ATTR_TUNNEL); } @@ -507,12 +769,12 @@ } static int ovs_key_from_nlattrs(struct sw_flow_match *match, u64 attrs, - const struct nlattr **a, bool is_mask) + const struct nlattr **a, bool is_mask, + bool log) { int err; - u64 orig_attrs = attrs; - err = metadata_from_nlattrs(match, &attrs, a, is_mask); + err = metadata_from_nlattrs(match, &attrs, a, is_mask, log); if (err) return err; @@ -533,17 +795,16 @@ tci = nla_get_be16(a[OVS_KEY_ATTR_VLAN]); if (!(tci & htons(VLAN_TAG_PRESENT))) { if (is_mask) - OVS_NLERR("VLAN TCI mask does not have exact match for VLAN_TAG_PRESENT bit.\n"); + OVS_NLERR(log, "VLAN TCI mask does not have exact match for VLAN_TAG_PRESENT bit."); else - OVS_NLERR("VLAN TCI does not have VLAN_TAG_PRESENT bit set.\n"); + OVS_NLERR(log, "VLAN TCI does not have VLAN_TAG_PRESENT bit set."); return -EINVAL; } SW_FLOW_KEY_PUT(match, eth.tci, tci, is_mask); attrs &= ~(1ULL << OVS_KEY_ATTR_VLAN); - } else if (!is_mask) - SW_FLOW_KEY_PUT(match, eth.tci, htons(0xffff), true); + } if (attrs & (1ULL << OVS_KEY_ATTR_ETHERTYPE)) { __be16 eth_type; @@ -553,8 +814,8 @@ /* Always exact match EtherType. */ eth_type = htons(0xffff); } else if (ntohs(eth_type) < ETH_P_802_3_MIN) { - OVS_NLERR("EtherType is less than minimum (type=%x, min=%x).\n", - ntohs(eth_type), ETH_P_802_3_MIN); + OVS_NLERR(log, "EtherType %x is less than min %x", + ntohs(eth_type), ETH_P_802_3_MIN); return -EINVAL; } @@ -569,8 +830,8 @@ ipv4_key = nla_data(a[OVS_KEY_ATTR_IPV4]); if (!is_mask && ipv4_key->ipv4_frag > OVS_FRAG_TYPE_MAX) { - OVS_NLERR("Unknown IPv4 fragment type (value=%d, max=%d).\n", - ipv4_key->ipv4_frag, OVS_FRAG_TYPE_MAX); + OVS_NLERR(log, "IPv4 frag type %d is out of range max %d", + ipv4_key->ipv4_frag, OVS_FRAG_TYPE_MAX); return -EINVAL; } SW_FLOW_KEY_PUT(match, ip.proto, @@ -593,8 +854,14 @@ ipv6_key = nla_data(a[OVS_KEY_ATTR_IPV6]); if (!is_mask && ipv6_key->ipv6_frag > OVS_FRAG_TYPE_MAX) { - OVS_NLERR("Unknown IPv6 fragment type (value=%d, max=%d).\n", - ipv6_key->ipv6_frag, OVS_FRAG_TYPE_MAX); + OVS_NLERR(log, "IPv6 frag type %d is out of range max %d", + ipv6_key->ipv6_frag, OVS_FRAG_TYPE_MAX); + return -EINVAL; + } + if (!is_mask && ipv6_key->ipv6_label & htonl(0xFFF00000)) { + OVS_NLERR(log, + "Invalid IPv6 flow label value (value=%x, max=%x).", + ntohl(ipv6_key->ipv6_label), (1 << 20) - 1); return -EINVAL; } SW_FLOW_KEY_PUT(match, ipv6.label, @@ -624,7 +891,7 @@ arp_key = nla_data(a[OVS_KEY_ATTR_ARP]); if (!is_mask && (arp_key->arp_op & htons(0xff00))) { - OVS_NLERR("Unknown ARP opcode (opcode=%d).\n", + OVS_NLERR(log, "Unknown ARP opcode (opcode=%d).", arp_key->arp_op); return -EINVAL; } @@ -643,6 +910,16 @@ attrs &= ~(1ULL << OVS_KEY_ATTR_ARP); } + if (attrs & (1ULL << OVS_KEY_ATTR_MPLS)) { + const struct ovs_key_mpls *mpls_key; + + mpls_key = nla_data(a[OVS_KEY_ATTR_MPLS]); + SW_FLOW_KEY_PUT(match, mpls.top_lse, + mpls_key->mpls_lse, is_mask); + + attrs &= ~(1ULL << OVS_KEY_ATTR_MPLS); + } + if (attrs & (1ULL << OVS_KEY_ATTR_TCP)) { const struct ovs_key_tcp *tcp_key; @@ -653,15 +930,9 @@ } if (attrs & (1ULL << OVS_KEY_ATTR_TCP_FLAGS)) { - if (orig_attrs & (1ULL << OVS_KEY_ATTR_IPV4)) { - SW_FLOW_KEY_PUT(match, tp.flags, - nla_get_be16(a[OVS_KEY_ATTR_TCP_FLAGS]), - is_mask); - } else { - SW_FLOW_KEY_PUT(match, tp.flags, - nla_get_be16(a[OVS_KEY_ATTR_TCP_FLAGS]), - is_mask); - } + SW_FLOW_KEY_PUT(match, tp.flags, + nla_get_be16(a[OVS_KEY_ATTR_TCP_FLAGS]), + is_mask); attrs &= ~(1ULL << OVS_KEY_ATTR_TCP_FLAGS); } @@ -720,19 +991,33 @@ attrs &= ~(1ULL << OVS_KEY_ATTR_ND); } - if (attrs != 0) + if (attrs != 0) { + OVS_NLERR(log, "Unknown key attributes %llx", + (unsigned long long)attrs); return -EINVAL; + } return 0; } -static void sw_flow_mask_set(struct sw_flow_mask *mask, - struct sw_flow_key_range *range, u8 val) +static void nlattr_set(struct nlattr *attr, u8 val, + const struct ovs_len_tbl *tbl) { - u8 *m = (u8 *)&mask->key + range->start; + struct nlattr *nla; + int rem; + + /* The nlattr stream should already have been validated */ + nla_for_each_nested(nla, attr, rem) { + if (tbl && tbl[nla_type(nla)].len == OVS_ATTR_NESTED) + nlattr_set(nla, val, tbl[nla_type(nla)].next); + else + memset(nla_data(nla), val, nla_len(nla)); + } +} - mask->range = *range; - memset(m, val, range_n_bytes(range)); +static void mask_set_nlattr(struct nlattr *attr, u8 val) +{ + nlattr_set(attr, val, ovs_key_lens); } /** @@ -746,19 +1031,24 @@ * of this flow. * @mask: Optional. Netlink attribute holding nested %OVS_KEY_ATTR_* Netlink * attribute specifies the mask field of the wildcarded flow. + * @log: Boolean to allow kernel error logging. Normally true, but when + * probing for feature compatibility this should be passed in as false to + * suppress unnecessary error logging. */ int ovs_nla_get_match(struct sw_flow_match *match, - const struct nlattr *key, - const struct nlattr *mask) + const struct nlattr *nla_key, + const struct nlattr *nla_mask, + bool log) { const struct nlattr *a[OVS_KEY_ATTR_MAX + 1]; const struct nlattr *encap; + struct nlattr *newmask = NULL; u64 key_attrs = 0; u64 mask_attrs = 0; bool encap_valid = false; int err; - err = parse_flow_nlattrs(key, a, &key_attrs); + err = parse_flow_nlattrs(nla_key, a, &key_attrs, log); if (err) return err; @@ -769,7 +1059,7 @@ if (!((key_attrs & (1ULL << OVS_KEY_ATTR_VLAN)) && (key_attrs & (1ULL << OVS_KEY_ATTR_ENCAP)))) { - OVS_NLERR("Invalid Vlan frame.\n"); + OVS_NLERR(log, "Invalid Vlan frame."); return -EINVAL; } @@ -780,37 +1070,70 @@ encap_valid = true; if (tci & htons(VLAN_TAG_PRESENT)) { - err = parse_flow_nlattrs(encap, a, &key_attrs); + err = parse_flow_nlattrs(encap, a, &key_attrs, log); if (err) return err; } else if (!tci) { /* Corner case for truncated 802.1Q header. */ if (nla_len(encap)) { - OVS_NLERR("Truncated 802.1Q header has non-zero encap attribute.\n"); + OVS_NLERR(log, "Truncated 802.1Q header has non-zero encap attribute."); return -EINVAL; } } else { - OVS_NLERR("Encap attribute is set for a non-VLAN frame.\n"); + OVS_NLERR(log, "Encap attr is set for non-VLAN frame"); return -EINVAL; } } - err = ovs_key_from_nlattrs(match, key_attrs, a, false); + err = ovs_key_from_nlattrs(match, key_attrs, a, false, log); if (err) return err; - if (mask) { - err = parse_flow_mask_nlattrs(mask, a, &mask_attrs); + if (match->mask) { + if (!nla_mask) { + /* Create an exact match mask. We need to set to 0xff + * all the 'match->mask' fields that have been touched + * in 'match->key'. We cannot simply memset + * 'match->mask', because padding bytes and fields not + * specified in 'match->key' should be left to 0. + * Instead, we use a stream of netlink attributes, + * copied from 'key' and set to 0xff. + * ovs_key_from_nlattrs() will take care of filling + * 'match->mask' appropriately. + */ + newmask = kmemdup(nla_key, + nla_total_size(nla_len(nla_key)), + GFP_KERNEL); + if (!newmask) + return -ENOMEM; + + mask_set_nlattr(newmask, 0xff); + + /* The userspace does not send tunnel attributes that + * are 0, but we should not wildcard them nonetheless. + */ + if (match->key->tun_key.ipv4_dst) + SW_FLOW_KEY_MEMSET_FIELD(match, tun_key, + 0xff, true); + + nla_mask = newmask; + } + + err = parse_flow_mask_nlattrs(nla_mask, a, &mask_attrs, log); if (err) - return err; + goto free_newmask; - if (mask_attrs & 1ULL << OVS_KEY_ATTR_ENCAP) { + /* Always match on tci. */ + SW_FLOW_KEY_PUT(match, eth.tci, htons(0xffff), true); + + if (mask_attrs & 1ULL << OVS_KEY_ATTR_ENCAP) { __be16 eth_type = 0; __be16 tci = 0; if (!encap_valid) { - OVS_NLERR("Encap mask attribute is set for non-VLAN frame.\n"); - return -EINVAL; + OVS_NLERR(log, "Encap mask attribute is set for non-VLAN frame."); + err = -EINVAL; + goto free_newmask; } mask_attrs &= ~(1ULL << OVS_KEY_ATTR_ENCAP); @@ -820,86 +1143,157 @@ if (eth_type == htons(0xffff)) { mask_attrs &= ~(1ULL << OVS_KEY_ATTR_ETHERTYPE); encap = a[OVS_KEY_ATTR_ENCAP]; - err = parse_flow_mask_nlattrs(encap, a, &mask_attrs); + err = parse_flow_mask_nlattrs(encap, a, + &mask_attrs, log); + if (err) + goto free_newmask; } else { - OVS_NLERR("VLAN frames must have an exact match on the TPID (mask=%x).\n", - ntohs(eth_type)); - return -EINVAL; + OVS_NLERR(log, "VLAN frames must have an exact match on the TPID (mask=%x).", + ntohs(eth_type)); + err = -EINVAL; + goto free_newmask; } if (a[OVS_KEY_ATTR_VLAN]) tci = nla_get_be16(a[OVS_KEY_ATTR_VLAN]); if (!(tci & htons(VLAN_TAG_PRESENT))) { - OVS_NLERR("VLAN tag present bit must have an exact match (tci_mask=%x).\n", ntohs(tci)); - return -EINVAL; + OVS_NLERR(log, "VLAN tag present bit must have an exact match (tci_mask=%x).", + ntohs(tci)); + err = -EINVAL; + goto free_newmask; } } - err = ovs_key_from_nlattrs(match, mask_attrs, a, true); + err = ovs_key_from_nlattrs(match, mask_attrs, a, true, log); if (err) - return err; - } else { - /* Populate exact match flow's key mask. */ - if (match->mask) - sw_flow_mask_set(match->mask, &match->range, 0xff); + goto free_newmask; } - if (!match_validate(match, key_attrs, mask_attrs)) - return -EINVAL; + if (!match_validate(match, key_attrs, mask_attrs, log)) + err = -EINVAL; + +free_newmask: + kfree(newmask); + return err; +} + +static size_t get_ufid_len(const struct nlattr *attr, bool log) +{ + size_t len; + + if (!attr) + return 0; + + len = nla_len(attr); + if (len < 1 || len > MAX_UFID_LENGTH) { + OVS_NLERR(log, "ufid size %u bytes exceeds the range (1, %d)", + nla_len(attr), MAX_UFID_LENGTH); + return 0; + } + + return len; +} + +/* Initializes 'flow->ufid', returning true if 'attr' contains a valid UFID, + * or false otherwise. + */ +bool ovs_nla_get_ufid(struct sw_flow_id *sfid, const struct nlattr *attr, + bool log) +{ + sfid->ufid_len = get_ufid_len(attr, log); + if (sfid->ufid_len) + memcpy(sfid->ufid, nla_data(attr), sfid->ufid_len); + + return sfid->ufid_len; +} + +int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid, + const struct sw_flow_key *key, bool log) +{ + struct sw_flow_key *new_key; + + if (ovs_nla_get_ufid(sfid, ufid, log)) + return 0; + + /* If UFID was not provided, use unmasked key. */ + new_key = kmalloc(sizeof(*new_key), GFP_KERNEL); + if (!new_key) + return -ENOMEM; + memcpy(new_key, key, sizeof(*key)); + sfid->unmasked_key = new_key; return 0; } +u32 ovs_nla_get_ufid_flags(const struct nlattr *attr) +{ + return attr ? nla_get_u32(attr) : 0; +} + /** * ovs_nla_get_flow_metadata - parses Netlink attributes into a flow key. * @key: Receives extracted in_port, priority, tun_key and skb_mark. * @attr: Netlink attribute holding nested %OVS_KEY_ATTR_* Netlink attribute * sequence. + * @log: Boolean to allow kernel error logging. Normally true, but when + * probing for feature compatibility this should be passed in as false to + * suppress unnecessary error logging. * * This parses a series of Netlink attributes that form a flow key, which must * take the same form accepted by flow_from_nlattrs(), but only enough of it to * get the metadata, that is, the parts of the flow key that cannot be * extracted from the packet itself. */ + int ovs_nla_get_flow_metadata(const struct nlattr *attr, - struct sw_flow_key *key) + struct sw_flow_key *key, + bool log) { const struct nlattr *a[OVS_KEY_ATTR_MAX + 1]; struct sw_flow_match match; u64 attrs = 0; int err; - err = parse_flow_nlattrs(attr, a, &attrs); + err = parse_flow_nlattrs(attr, a, &attrs, log); if (err) return -EINVAL; memset(&match, 0, sizeof(match)); match.key = key; + memset(key, 0, OVS_SW_FLOW_KEY_METADATA_SIZE); key->phy.in_port = DP_MAX_PORTS; - return metadata_from_nlattrs(&match, &attrs, a, false); + + return metadata_from_nlattrs(&match, &attrs, a, false, log); } -int ovs_nla_put_flow(const struct sw_flow_key *swkey, - const struct sw_flow_key *output, struct sk_buff *skb) +static int __ovs_nla_put_key(const struct sw_flow_key *swkey, + const struct sw_flow_key *output, bool is_mask, + struct sk_buff *skb) { struct ovs_key_ethernet *eth_key; struct nlattr *nla, *encap; - bool is_mask = (swkey != output); - if (nla_put_u32(skb, OVS_KEY_ATTR_DP_HASH, output->ovs_flow_hash)) + if (nla_put_u32(skb, OVS_KEY_ATTR_RECIRC_ID, output->recirc_id)) goto nla_put_failure; - if (nla_put_u32(skb, OVS_KEY_ATTR_RECIRC_ID, output->recirc_id)) + if (nla_put_u32(skb, OVS_KEY_ATTR_DP_HASH, output->ovs_flow_hash)) goto nla_put_failure; if (nla_put_u32(skb, OVS_KEY_ATTR_PRIORITY, output->phy.priority)) goto nla_put_failure; - if ((swkey->tun_key.ipv4_dst || is_mask) && - ipv4_tun_to_nlattr(skb, &swkey->tun_key, &output->tun_key)) - goto nla_put_failure; + if ((swkey->tun_key.ipv4_dst || is_mask)) { + const void *opts = NULL; + + if (output->tun_key.tun_flags & TUNNEL_OPTIONS_PRESENT) + opts = TUN_METADATA_OPTS(output, swkey->tun_opts_len); + + if (ipv4_tun_to_nlattr(skb, &output->tun_key, opts, + swkey->tun_opts_len)) + goto nla_put_failure; + } if (swkey->phy.in_port == DP_MAX_PORTS) { if (is_mask && (output->phy.in_port == 0xffff)) @@ -997,6 +1391,14 @@ arp_key->arp_op = htons(output->ip.proto); ether_addr_copy(arp_key->arp_sha, output->ipv4.arp.sha); ether_addr_copy(arp_key->arp_tha, output->ipv4.arp.tha); + } else if (eth_p_mpls(swkey->eth.type)) { + struct ovs_key_mpls *mpls_key; + + nla = nla_reserve(skb, OVS_KEY_ATTR_MPLS, sizeof(*mpls_key)); + if (!nla) + goto nla_put_failure; + mpls_key = nla_data(nla); + mpls_key->mpls_lse = output->mpls.top_lse; } if ((swkey->eth.type == htons(ETH_P_IP) || @@ -1081,14 +1483,59 @@ return -EMSGSIZE; } +int ovs_nla_put_key(const struct sw_flow_key *swkey, + const struct sw_flow_key *output, int attr, bool is_mask, + struct sk_buff *skb) +{ + int err; + struct nlattr *nla; + + nla = nla_nest_start(skb, attr); + if (!nla) + return -EMSGSIZE; + err = __ovs_nla_put_key(swkey, output, is_mask, skb); + if (err) + return err; + nla_nest_end(skb, nla); + + return 0; +} + +/* Called with ovs_mutex or RCU read lock. */ +int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb) +{ + if (ovs_identifier_is_ufid(&flow->id)) + return nla_put(skb, OVS_FLOW_ATTR_UFID, flow->id.ufid_len, + flow->id.ufid); + + return ovs_nla_put_key(flow->id.unmasked_key, flow->id.unmasked_key, + OVS_FLOW_ATTR_KEY, false, skb); +} + +/* Called with ovs_mutex or RCU read lock. */ +int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb) +{ + return ovs_nla_put_key(&flow->key, &flow->key, + OVS_FLOW_ATTR_KEY, false, skb); +} + +/* Called with ovs_mutex or RCU read lock. */ +int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb) +{ + return ovs_nla_put_key(&flow->key, &flow->mask->key, + OVS_FLOW_ATTR_MASK, true, skb); +} + #define MAX_ACTIONS_BUFSIZE (32 * 1024) -struct sw_flow_actions *ovs_nla_alloc_flow_actions(int size) +static struct sw_flow_actions *nla_alloc_flow_actions(int size, bool log) { struct sw_flow_actions *sfa; - if (size > MAX_ACTIONS_BUFSIZE) + if (size > MAX_ACTIONS_BUFSIZE) { + OVS_NLERR(log, "Flow action size %u bytes exceeds max", size); return ERR_PTR(-EINVAL); + } sfa = kmalloc(sizeof(*sfa) + size, GFP_KERNEL); if (!sfa) @@ -1107,14 +1554,15 @@ } /* Schedules 'sf_acts' to be freed after the next RCU grace period. - * The caller must hold rcu_read_lock for this to be sensible. */ + * The caller must hold rcu_read_lock for this to be sensible. + */ void ovs_nla_free_flow_actions(struct sw_flow_actions *sf_acts) { call_rcu(&sf_acts->rcu, rcu_free_acts_callback); } static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, - int attr_len) + int attr_len, bool log) { struct sw_flow_actions *acts; @@ -1134,7 +1582,7 @@ new_acts_size = MAX_ACTIONS_BUFSIZE; } - acts = ovs_nla_alloc_flow_actions(new_acts_size); + acts = nla_alloc_flow_actions(new_acts_size, log); if (IS_ERR(acts)) return (void *)acts; @@ -1148,13 +1596,14 @@ return (struct nlattr *) ((unsigned char *)(*sfa) + next_offset); } -static int add_action(struct sw_flow_actions **sfa, int attrtype, void *data, int len) +static struct nlattr *__add_action(struct sw_flow_actions **sfa, + int attrtype, void *data, int len, bool log) { struct nlattr *a; - a = reserve_sfa_size(sfa, nla_attr_size(len)); + a = reserve_sfa_size(sfa, nla_attr_size(len), log); if (IS_ERR(a)) - return PTR_ERR(a); + return a; a->nla_type = attrtype; a->nla_len = nla_attr_size(len); @@ -1163,16 +1612,28 @@ memcpy(nla_data(a), data, len); memset((unsigned char *) a + a->nla_len, 0, nla_padlen(len)); + return a; +} + +static int add_action(struct sw_flow_actions **sfa, int attrtype, + void *data, int len, bool log) +{ + struct nlattr *a; + + a = __add_action(sfa, attrtype, data, len, log); + if (IS_ERR(a)) + return PTR_ERR(a); + return 0; } static inline int add_nested_action_start(struct sw_flow_actions **sfa, - int attrtype) + int attrtype, bool log) { int used = (*sfa)->actions_len; int err; - err = add_action(sfa, attrtype, NULL, 0); + err = add_action(sfa, attrtype, NULL, 0, log); if (err) return err; @@ -1188,9 +1649,15 @@ a->nla_len = sfa->actions_len - st_offset; } +static int __ovs_nla_copy_actions(const struct nlattr *attr, + const struct sw_flow_key *key, + int depth, struct sw_flow_actions **sfa, + __be16 eth_type, __be16 vlan_tci, bool log); + static int validate_and_copy_sample(const struct nlattr *attr, const struct sw_flow_key *key, int depth, - struct sw_flow_actions **sfa) + struct sw_flow_actions **sfa, + __be16 eth_type, __be16 vlan_tci, bool log) { const struct nlattr *attrs[OVS_SAMPLE_ATTR_MAX + 1]; const struct nlattr *probability, *actions; @@ -1216,18 +1683,19 @@ return -EINVAL; /* validation done, copy sample action. */ - start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SAMPLE); + start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SAMPLE, log); if (start < 0) return start; err = add_action(sfa, OVS_SAMPLE_ATTR_PROBABILITY, - nla_data(probability), sizeof(u32)); + nla_data(probability), sizeof(u32), log); if (err) return err; - st_acts = add_nested_action_start(sfa, OVS_SAMPLE_ATTR_ACTIONS); + st_acts = add_nested_action_start(sfa, OVS_SAMPLE_ATTR_ACTIONS, log); if (st_acts < 0) return st_acts; - err = ovs_nla_copy_actions(actions, key, depth + 1, sfa); + err = __ovs_nla_copy_actions(actions, key, depth + 1, sfa, + eth_type, vlan_tci, log); if (err) return err; @@ -1237,16 +1705,6 @@ return 0; } -static int validate_tp_port(const struct sw_flow_key *flow_key) -{ - if ((flow_key->eth.type == htons(ETH_P_IP) || - flow_key->eth.type == htons(ETH_P_IPV6)) && - (flow_key->tp.src || flow_key->tp.dst)) - return 0; - - return -EINVAL; -} - void ovs_match_init(struct sw_flow_match *match, struct sw_flow_key *key, struct sw_flow_mask *mask) @@ -1263,44 +1721,129 @@ } } +static int validate_geneve_opts(struct sw_flow_key *key) +{ + struct geneve_opt *option; + int opts_len = key->tun_opts_len; + bool crit_opt = false; + + option = (struct geneve_opt *)TUN_METADATA_OPTS(key, key->tun_opts_len); + while (opts_len > 0) { + int len; + + if (opts_len < sizeof(*option)) + return -EINVAL; + + len = sizeof(*option) + option->length * 4; + if (len > opts_len) + return -EINVAL; + + crit_opt |= !!(option->type & GENEVE_CRIT_OPT_TYPE); + + option = (struct geneve_opt *)((u8 *)option + len); + opts_len -= len; + }; + + key->tun_key.tun_flags |= crit_opt ? TUNNEL_CRIT_OPT : 0; + + return 0; +} + static int validate_and_copy_set_tun(const struct nlattr *attr, - struct sw_flow_actions **sfa) + struct sw_flow_actions **sfa, bool log) { struct sw_flow_match match; struct sw_flow_key key; - int err, start; + struct ovs_tunnel_info *tun_info; + struct nlattr *a; + int start, opts_type; + int err = 0; ovs_match_init(&match, &key, NULL); - err = ipv4_tun_from_nlattr(nla_data(attr), &match, false); - if (err) - return err; + opts_type = ipv4_tun_from_nlattr(nla_data(attr), &match, false, log); + if (opts_type < 0) + return opts_type; + + if (key.tun_opts_len) { + switch (opts_type) { + case OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS: + err = validate_geneve_opts(&key); + if (err < 0) + return err; + break; + case OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS: + break; + } + }; - start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SET); + start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SET, log); if (start < 0) return start; - err = add_action(sfa, OVS_KEY_ATTR_IPV4_TUNNEL, &match.key->tun_key, - sizeof(match.key->tun_key)); + a = __add_action(sfa, OVS_KEY_ATTR_TUNNEL_INFO, NULL, + sizeof(*tun_info) + key.tun_opts_len, log); + if (IS_ERR(a)) + return PTR_ERR(a); + + tun_info = nla_data(a); + tun_info->tunnel = key.tun_key; + tun_info->options_len = key.tun_opts_len; + + if (tun_info->options_len) { + /* We need to store the options in the action itself since + * everything else will go away after flow setup. We can append + * it to tun_info and then point there. + */ + memcpy((tun_info + 1), + TUN_METADATA_OPTS(&key, key.tun_opts_len), key.tun_opts_len); + tun_info->options = (tun_info + 1); + + } else { + tun_info->options = NULL; + } + add_nested_action_end(*sfa, start); return err; } +/* Return false if there are any non-masked bits set. + * Mask follows data immediately, before any netlink padding. + */ +static bool validate_masked(u8 *data, int len) +{ + u8 *mask = data + len; + + while (len--) + if (*data++ & ~*mask++) + return false; + + return true; +} + static int validate_set(const struct nlattr *a, const struct sw_flow_key *flow_key, struct sw_flow_actions **sfa, - bool *set_tun) + bool *skip_copy, __be16 eth_type, bool masked, bool log) { const struct nlattr *ovs_key = nla_data(a); int key_type = nla_type(ovs_key); + size_t key_len; /* There can be only one key in a action */ if (nla_total_size(nla_len(ovs_key)) != nla_len(a)) return -EINVAL; + key_len = nla_len(ovs_key); + if (masked) + key_len /= 2; + if (key_type > OVS_KEY_ATTR_MAX || - (ovs_key_lens[key_type] != nla_len(ovs_key) && - ovs_key_lens[key_type] != -1)) + (ovs_key_lens[key_type].len != key_len && + ovs_key_lens[key_type].len != OVS_ATTR_NESTED)) + return -EINVAL; + + if (masked && !validate_masked(nla_data(ovs_key), key_len)) return -EINVAL; switch (key_type) { @@ -1314,69 +1857,127 @@ break; case OVS_KEY_ATTR_TUNNEL: - *set_tun = true; - err = validate_and_copy_set_tun(a, sfa); + if (eth_p_mpls(eth_type)) + return -EINVAL; + + if (masked) + return -EINVAL; /* Masked tunnel set not supported. */ + + *skip_copy = true; + err = validate_and_copy_set_tun(a, sfa, log); if (err) return err; break; case OVS_KEY_ATTR_IPV4: - if (flow_key->eth.type != htons(ETH_P_IP)) - return -EINVAL; - - if (!flow_key->ip.proto) + if (eth_type != htons(ETH_P_IP)) return -EINVAL; ipv4_key = nla_data(ovs_key); - if (ipv4_key->ipv4_proto != flow_key->ip.proto) - return -EINVAL; - if (ipv4_key->ipv4_frag != flow_key->ip.frag) - return -EINVAL; + if (masked) { + const struct ovs_key_ipv4 *mask = ipv4_key + 1; + + /* Non-writeable fields. */ + if (mask->ipv4_proto || mask->ipv4_frag) + return -EINVAL; + } else { + if (ipv4_key->ipv4_proto != flow_key->ip.proto) + return -EINVAL; + if (ipv4_key->ipv4_frag != flow_key->ip.frag) + return -EINVAL; + } break; case OVS_KEY_ATTR_IPV6: - if (flow_key->eth.type != htons(ETH_P_IPV6)) - return -EINVAL; - - if (!flow_key->ip.proto) + if (eth_type != htons(ETH_P_IPV6)) return -EINVAL; ipv6_key = nla_data(ovs_key); - if (ipv6_key->ipv6_proto != flow_key->ip.proto) - return -EINVAL; + if (masked) { + const struct ovs_key_ipv6 *mask = ipv6_key + 1; - if (ipv6_key->ipv6_frag != flow_key->ip.frag) - return -EINVAL; + /* Non-writeable fields. */ + if (mask->ipv6_proto || mask->ipv6_frag) + return -EINVAL; + /* Invalid bits in the flow label mask? */ + if (ntohl(mask->ipv6_label) & 0xFFF00000) + return -EINVAL; + } else { + if (ipv6_key->ipv6_proto != flow_key->ip.proto) + return -EINVAL; + + if (ipv6_key->ipv6_frag != flow_key->ip.frag) + return -EINVAL; + } if (ntohl(ipv6_key->ipv6_label) & 0xFFF00000) return -EINVAL; break; case OVS_KEY_ATTR_TCP: - if (flow_key->ip.proto != IPPROTO_TCP) + if ((eth_type != htons(ETH_P_IP) && + eth_type != htons(ETH_P_IPV6)) || + flow_key->ip.proto != IPPROTO_TCP) return -EINVAL; - return validate_tp_port(flow_key); + break; case OVS_KEY_ATTR_UDP: - if (flow_key->ip.proto != IPPROTO_UDP) + if ((eth_type != htons(ETH_P_IP) && + eth_type != htons(ETH_P_IPV6)) || + flow_key->ip.proto != IPPROTO_UDP) return -EINVAL; - return validate_tp_port(flow_key); + break; + + case OVS_KEY_ATTR_MPLS: + if (!eth_p_mpls(eth_type)) + return -EINVAL; + break; case OVS_KEY_ATTR_SCTP: - if (flow_key->ip.proto != IPPROTO_SCTP) + if ((eth_type != htons(ETH_P_IP) && + eth_type != htons(ETH_P_IPV6)) || + flow_key->ip.proto != IPPROTO_SCTP) return -EINVAL; - return validate_tp_port(flow_key); + break; default: return -EINVAL; } + /* Convert non-masked non-tunnel set actions to masked set actions. */ + if (!masked && key_type != OVS_KEY_ATTR_TUNNEL) { + int start, len = key_len * 2; + struct nlattr *at; + + *skip_copy = true; + + start = add_nested_action_start(sfa, + OVS_ACTION_ATTR_SET_TO_MASKED, + log); + if (start < 0) + return start; + + at = __add_action(sfa, key_type, NULL, len, log); + if (IS_ERR(at)) + return PTR_ERR(at); + + memcpy(nla_data(at), nla_data(ovs_key), key_len); /* Key. */ + memset(nla_data(at) + key_len, 0xff, key_len); /* Mask. */ + /* Clear non-writeable bits from otherwise writeable fields. */ + if (key_type == OVS_KEY_ATTR_IPV6) { + struct ovs_key_ipv6 *mask = nla_data(at) + key_len; + + mask->ipv6_label &= htonl(0x000FFFFF); + } + add_nested_action_end(*sfa, start); + } + return 0; } @@ -1385,6 +1986,7 @@ static const struct nla_policy userspace_policy[OVS_USERSPACE_ATTR_MAX + 1] = { [OVS_USERSPACE_ATTR_PID] = {.type = NLA_U32 }, [OVS_USERSPACE_ATTR_USERDATA] = {.type = NLA_UNSPEC }, + [OVS_USERSPACE_ATTR_EGRESS_TUN_PORT] = {.type = NLA_U32 }, }; struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1]; int error; @@ -1402,12 +2004,12 @@ } static int copy_action(const struct nlattr *from, - struct sw_flow_actions **sfa) + struct sw_flow_actions **sfa, bool log) { int totlen = NLA_ALIGN(from->nla_len); struct nlattr *to; - to = reserve_sfa_size(sfa, from->nla_len); + to = reserve_sfa_size(sfa, from->nla_len, log); if (IS_ERR(to)) return PTR_ERR(to); @@ -1415,10 +2017,10 @@ return 0; } -int ovs_nla_copy_actions(const struct nlattr *attr, - const struct sw_flow_key *key, - int depth, - struct sw_flow_actions **sfa) +static int __ovs_nla_copy_actions(const struct nlattr *attr, + const struct sw_flow_key *key, + int depth, struct sw_flow_actions **sfa, + __be16 eth_type, __be16 vlan_tci, bool log) { const struct nlattr *a; int rem, err; @@ -1432,9 +2034,12 @@ [OVS_ACTION_ATTR_OUTPUT] = sizeof(u32), [OVS_ACTION_ATTR_RECIRC] = sizeof(u32), [OVS_ACTION_ATTR_USERSPACE] = (u32)-1, + [OVS_ACTION_ATTR_PUSH_MPLS] = sizeof(struct ovs_action_push_mpls), + [OVS_ACTION_ATTR_POP_MPLS] = sizeof(__be16), [OVS_ACTION_ATTR_PUSH_VLAN] = sizeof(struct ovs_action_push_vlan), [OVS_ACTION_ATTR_POP_VLAN] = 0, [OVS_ACTION_ATTR_SET] = (u32)-1, + [OVS_ACTION_ATTR_SET_MASKED] = (u32)-1, [OVS_ACTION_ATTR_SAMPLE] = (u32)-1, [OVS_ACTION_ATTR_HASH] = sizeof(struct ovs_action_hash) }; @@ -1461,6 +2066,7 @@ case OVS_ACTION_ATTR_OUTPUT: if (nla_get_u32(a) >= DP_MAX_PORTS) return -EINVAL; + break; case OVS_ACTION_ATTR_HASH: { @@ -1477,6 +2083,7 @@ } case OVS_ACTION_ATTR_POP_VLAN: + vlan_tci = htons(0); break; case OVS_ACTION_ATTR_PUSH_VLAN: @@ -1485,29 +2092,77 @@ return -EINVAL; if (!(vlan->vlan_tci & htons(VLAN_TAG_PRESENT))) return -EINVAL; + vlan_tci = vlan->vlan_tci; break; case OVS_ACTION_ATTR_RECIRC: break; + case OVS_ACTION_ATTR_PUSH_MPLS: { + const struct ovs_action_push_mpls *mpls = nla_data(a); + + if (!eth_p_mpls(mpls->mpls_ethertype)) + return -EINVAL; + + /* Prohibit push MPLS other than to a white list + * for packets that have a known tag order. + */ + if (vlan_tci & htons(VLAN_TAG_PRESENT) || + (eth_type != htons(ETH_P_IP) && + eth_type != htons(ETH_P_IPV6) && + eth_type != htons(ETH_P_ARP) && + eth_type != htons(ETH_P_RARP) && + !eth_p_mpls(eth_type))) + return -EINVAL; + eth_type = mpls->mpls_ethertype; + break; + } + + case OVS_ACTION_ATTR_POP_MPLS: + if (vlan_tci & htons(VLAN_TAG_PRESENT) || + !eth_p_mpls(eth_type)) + return -EINVAL; + + /* Disallow subsequent L2.5+ set and mpls_pop actions + * as there is no check here to ensure that the new + * eth_type is valid and thus set actions could + * write off the end of the packet or otherwise + * corrupt it. + * + * Support for these actions is planned using packet + * recirculation. + */ + eth_type = htons(0); + break; + case OVS_ACTION_ATTR_SET: - err = validate_set(a, key, sfa, &skip_copy); + err = validate_set(a, key, sfa, + &skip_copy, eth_type, false, log); + if (err) + return err; + break; + + case OVS_ACTION_ATTR_SET_MASKED: + err = validate_set(a, key, sfa, + &skip_copy, eth_type, true, log); if (err) return err; break; case OVS_ACTION_ATTR_SAMPLE: - err = validate_and_copy_sample(a, key, depth, sfa); + err = validate_and_copy_sample(a, key, depth, sfa, + eth_type, vlan_tci, log); if (err) return err; skip_copy = true; break; default: + OVS_NLERR(log, "Unknown Action type %d", type); return -EINVAL; } if (!skip_copy) { - err = copy_action(a, sfa); + err = copy_action(a, sfa, log); if (err) return err; } @@ -1519,6 +2174,25 @@ return 0; } +/* 'key' must be the masked key. */ +int ovs_nla_copy_actions(const struct nlattr *attr, + const struct sw_flow_key *key, + struct sw_flow_actions **sfa, bool log) +{ + int err; + + *sfa = nla_alloc_flow_actions(nla_len(attr), log); + if (IS_ERR(*sfa)) + return PTR_ERR(*sfa); + + err = __ovs_nla_copy_actions(attr, key, 0, sfa, key->eth.type, + key->eth.tci, log); + if (err) + kfree(*sfa); + + return err; +} + static int sample_action_to_attr(const struct nlattr *attr, struct sk_buff *skb) { const struct nlattr *a; @@ -1563,17 +2237,22 @@ int err; switch (key_type) { - case OVS_KEY_ATTR_IPV4_TUNNEL: + case OVS_KEY_ATTR_TUNNEL_INFO: { + struct ovs_tunnel_info *tun_info = nla_data(ovs_key); + start = nla_nest_start(skb, OVS_ACTION_ATTR_SET); if (!start) return -EMSGSIZE; - err = ipv4_tun_to_nlattr(skb, nla_data(ovs_key), - nla_data(ovs_key)); + err = ipv4_tun_to_nlattr(skb, &tun_info->tunnel, + tun_info->options_len ? + tun_info->options : NULL, + tun_info->options_len); if (err) return err; nla_nest_end(skb, start); break; + } default: if (nla_put(skb, OVS_ACTION_ATTR_SET, nla_len(a), ovs_key)) return -EMSGSIZE; @@ -1583,6 +2262,21 @@ return 0; } +static int masked_set_action_to_set_action_attr(const struct nlattr *a, + struct sk_buff *skb) +{ + const struct nlattr *ovs_key = nla_data(a); + size_t key_len = nla_len(ovs_key) / 2; + + /* Revert the conversion we did from a non-masked set action to + * masked set action. + */ + if (nla_put(skb, OVS_ACTION_ATTR_SET, nla_len(a) - key_len, ovs_key)) + return -EMSGSIZE; + + return 0; +} + int ovs_nla_put_actions(const struct nlattr *attr, int len, struct sk_buff *skb) { const struct nlattr *a; @@ -1597,6 +2291,12 @@ if (err) return err; break; + + case OVS_ACTION_ATTR_SET_TO_MASKED: + err = masked_set_action_to_set_action_attr(a, skb); + if (err) + return err; + break; case OVS_ACTION_ATTR_SAMPLE: err = sample_action_to_attr(a, skb); diff -Nru openvswitch-2.3.1/datapath/flow_netlink.h openvswitch-2.4.0~git20150623/datapath/flow_netlink.h --- openvswitch-2.3.1/datapath/flow_netlink.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/flow_netlink.h 2015-06-23 18:46:21.000000000 +0000 @@ -37,24 +37,37 @@ #include "flow.h" +size_t ovs_tun_key_attr_size(void); +size_t ovs_key_attr_size(void); + void ovs_match_init(struct sw_flow_match *match, struct sw_flow_key *key, struct sw_flow_mask *mask); -int ovs_nla_put_flow(const struct sw_flow_key *, - const struct sw_flow_key *, struct sk_buff *); -int ovs_nla_get_flow_metadata(const struct nlattr *, struct sw_flow_key *); - -int ovs_nla_get_match(struct sw_flow_match *match, - const struct nlattr *, - const struct nlattr *); +int ovs_nla_put_key(const struct sw_flow_key *, const struct sw_flow_key *, + int attr, bool is_mask, struct sk_buff *); +int ovs_nla_get_flow_metadata(const struct nlattr *, struct sw_flow_key *, + bool log); + +int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb); +int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb); +int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb); + +int ovs_nla_get_match(struct sw_flow_match *, const struct nlattr *key, + const struct nlattr *mask, bool log); +int ovs_nla_put_egress_tunnel_key(struct sk_buff *, + const struct ovs_tunnel_info *); + +bool ovs_nla_get_ufid(struct sw_flow_id *, const struct nlattr *, bool log); +int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid, + const struct sw_flow_key *key, bool log); +u32 ovs_nla_get_ufid_flags(const struct nlattr *attr); int ovs_nla_copy_actions(const struct nlattr *attr, - const struct sw_flow_key *key, int depth, - struct sw_flow_actions **sfa); + const struct sw_flow_key *key, + struct sw_flow_actions **sfa, bool log); int ovs_nla_put_actions(const struct nlattr *attr, int len, struct sk_buff *skb); -struct sw_flow_actions *ovs_nla_alloc_flow_actions(int actions_len); void ovs_nla_free_flow_actions(struct sw_flow_actions *); #endif /* flow_netlink.h */ diff -Nru openvswitch-2.3.1/datapath/flow_table.c openvswitch-2.4.0~git20150623/datapath/flow_table.c --- openvswitch-2.3.1/datapath/flow_table.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/flow_table.c 2015-06-23 18:46:21.000000000 +0000 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,6 +92,8 @@ flow->sf_acts = NULL; flow->mask = NULL; + flow->id.ufid_len = 0; + flow->id.unmasked_key = NULL; flow->stats_last_writer = NUMA_NO_NODE; /* Initialize the default stat node. */ @@ -114,7 +116,7 @@ return ERR_PTR(-ENOMEM); } -int ovs_flow_tbl_count(struct flow_table *table) +int ovs_flow_tbl_count(const struct flow_table *table) { return table->count; } @@ -146,11 +148,13 @@ { int node; - kfree((struct sw_flow_actions __force *)flow->sf_acts); + if (ovs_identifier_is_key(&flow->id)) + kfree(flow->id.unmasked_key); + kfree(rcu_dereference_raw(flow->sf_acts)); for_each_node(node) if (flow->stats[node]) kmem_cache_free(flow_stats_cache, - (struct flow_stats __force *)flow->stats[node]); + rcu_dereference_raw(flow->stats[node])); kmem_cache_free(flow_cache, flow); } @@ -265,7 +269,7 @@ int ovs_flow_tbl_init(struct flow_table *table) { - struct table_instance *ti; + struct table_instance *ti, *ufid_ti; struct mask_array *ma; table->mask_cache = __alloc_percpu(sizeof(struct mask_cache_entry) * @@ -281,12 +285,20 @@ if (!ti) goto free_mask_array; + ufid_ti = table_instance_alloc(TBL_MIN_BUCKETS); + if (!ufid_ti) + goto free_ti; + rcu_assign_pointer(table->ti, ti); + rcu_assign_pointer(table->ufid_ti, ufid_ti); rcu_assign_pointer(table->mask_array, ma); table->last_rehash = jiffies; table->count = 0; + table->ufid_count = 0; return 0; +free_ti: + __table_instance_destroy(ti); free_mask_array: kfree(ma); free_mask_cache: @@ -301,13 +313,16 @@ __table_instance_destroy(ti); } -static void table_instance_destroy(struct table_instance *ti, bool deferred) +static void table_instance_destroy(struct table_instance *ti, + struct table_instance *ufid_ti, + bool deferred) { int i; if (!ti) return; + BUG_ON(!ufid_ti); if (ti->keep_flows) goto skip_flows; @@ -316,29 +331,37 @@ struct hlist_head *head = flex_array_get(ti->buckets, i); struct hlist_node *n; int ver = ti->node_ver; + int ufid_ver = ufid_ti->node_ver; - hlist_for_each_entry_safe(flow, n, head, hash_node[ver]) { - hlist_del_rcu(&flow->hash_node[ver]); + hlist_for_each_entry_safe(flow, n, head, flow_table.node[ver]) { + hlist_del_rcu(&flow->flow_table.node[ver]); + if (ovs_identifier_is_ufid(&flow->id)) + hlist_del_rcu(&flow->ufid_table.node[ufid_ver]); ovs_flow_free(flow, deferred); } } skip_flows: - if (deferred) + if (deferred) { call_rcu(&ti->rcu, flow_tbl_destroy_rcu_cb); - else + call_rcu(&ufid_ti->rcu, flow_tbl_destroy_rcu_cb); + } else { __table_instance_destroy(ti); + __table_instance_destroy(ufid_ti); + } } /* No need for locking this function is called from RCU callback or - * error path. */ + * error path. + */ void ovs_flow_tbl_destroy(struct flow_table *table) { - struct table_instance *ti = (struct table_instance __force *)table->ti; + struct table_instance *ti = rcu_dereference_raw(table->ti); + struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti); free_percpu(table->mask_cache); - kfree((struct mask_array __force *)table->mask_array); - table_instance_destroy(ti, false); + kfree(rcu_dereference_raw(table->mask_array)); + table_instance_destroy(ti, ufid_ti, false); } struct sw_flow *ovs_flow_tbl_dump_next(struct table_instance *ti, @@ -353,7 +376,7 @@ while (*bucket < ti->n_buckets) { i = 0; head = flex_array_get(ti->buckets, *bucket); - hlist_for_each_entry_rcu(flow, head, hash_node[ver]) { + hlist_for_each_entry_rcu(flow, head, flow_table.node[ver]) { if (i < *last) { i++; continue; @@ -375,16 +398,26 @@ (hash & (ti->n_buckets - 1))); } -static void table_instance_insert(struct table_instance *ti, struct sw_flow *flow) +static void table_instance_insert(struct table_instance *ti, + struct sw_flow *flow) { struct hlist_head *head; - head = find_bucket(ti, flow->hash); - hlist_add_head_rcu(&flow->hash_node[ti->node_ver], head); + head = find_bucket(ti, flow->flow_table.hash); + hlist_add_head_rcu(&flow->flow_table.node[ti->node_ver], head); +} + +static void ufid_table_instance_insert(struct table_instance *ti, + struct sw_flow *flow) +{ + struct hlist_head *head; + + head = find_bucket(ti, flow->ufid_table.hash); + hlist_add_head_rcu(&flow->ufid_table.node[ti->node_ver], head); } static void flow_table_copy_flows(struct table_instance *old, - struct table_instance *new) + struct table_instance *new, bool ufid) { int old_ver; int i; @@ -399,15 +432,21 @@ head = flex_array_get(old->buckets, i); - hlist_for_each_entry(flow, head, hash_node[old_ver]) - table_instance_insert(new, flow); + if (ufid) + hlist_for_each_entry(flow, head, + ufid_table.node[old_ver]) + ufid_table_instance_insert(new, flow); + else + hlist_for_each_entry(flow, head, + flow_table.node[old_ver]) + table_instance_insert(new, flow); } old->keep_flows = true; } static struct table_instance *table_instance_rehash(struct table_instance *ti, - int n_buckets) + int n_buckets, bool ufid) { struct table_instance *new_ti; @@ -415,39 +454,52 @@ if (!new_ti) return NULL; - flow_table_copy_flows(ti, new_ti); + flow_table_copy_flows(ti, new_ti, ufid); return new_ti; } int ovs_flow_tbl_flush(struct flow_table *flow_table) { - struct table_instance *old_ti; - struct table_instance *new_ti; + struct table_instance *old_ti, *new_ti; + struct table_instance *old_ufid_ti, *new_ufid_ti; - old_ti = ovsl_dereference(flow_table->ti); new_ti = table_instance_alloc(TBL_MIN_BUCKETS); if (!new_ti) return -ENOMEM; + new_ufid_ti = table_instance_alloc(TBL_MIN_BUCKETS); + if (!new_ufid_ti) + goto err_free_ti; + + old_ti = ovsl_dereference(flow_table->ti); + old_ufid_ti = ovsl_dereference(flow_table->ufid_ti); rcu_assign_pointer(flow_table->ti, new_ti); + rcu_assign_pointer(flow_table->ufid_ti, new_ufid_ti); flow_table->last_rehash = jiffies; flow_table->count = 0; + flow_table->ufid_count = 0; - table_instance_destroy(old_ti, true); + table_instance_destroy(old_ti, old_ufid_ti, true); return 0; + +err_free_ti: + __table_instance_destroy(new_ti); + return -ENOMEM; } -static u32 flow_hash(const struct sw_flow_key *key, int key_start, - int key_end) +static u32 flow_hash(const struct sw_flow_key *key, + const struct sw_flow_key_range *range) { + int key_start = range->start; + int key_end = range->end; const u32 *hash_key = (const u32 *)((const u8 *)key + key_start); int hash_u32s = (key_end - key_start) >> 2; /* Make sure number of hash bytes are multiple of u32. */ BUILD_BUG_ON(sizeof(long) % sizeof(u32)); - return arch_fast_hash2(hash_key, hash_u32s, 0); + return jhash2(hash_key, hash_u32s, 0); } static int flow_key_start(const struct sw_flow_key *key) @@ -476,41 +528,39 @@ static bool flow_cmp_masked_key(const struct sw_flow *flow, const struct sw_flow_key *key, - int key_start, int key_end) + const struct sw_flow_key_range *range) { - return cmp_key(&flow->key, key, key_start, key_end); + return cmp_key(&flow->key, key, range->start, range->end); } -bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow, - struct sw_flow_match *match) +static bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow, + const struct sw_flow_match *match) { struct sw_flow_key *key = match->key; int key_start = flow_key_start(key); int key_end = match->range.end; - return cmp_key(&flow->unmasked_key, key, key_start, key_end); + BUG_ON(ovs_identifier_is_ufid(&flow->id)); + return cmp_key(flow->id.unmasked_key, key, key_start, key_end); } static struct sw_flow *masked_flow_lookup(struct table_instance *ti, const struct sw_flow_key *unmasked, - struct sw_flow_mask *mask, + const struct sw_flow_mask *mask, u32 *n_mask_hit) { struct sw_flow *flow; struct hlist_head *head; - int key_start = mask->range.start; - int key_end = mask->range.end; u32 hash; struct sw_flow_key masked_key; ovs_flow_mask_key(&masked_key, unmasked, mask); - hash = flow_hash(&masked_key, key_start, key_end); + hash = flow_hash(&masked_key, &mask->range); head = find_bucket(ti, hash); (*n_mask_hit)++; - hlist_for_each_entry_rcu(flow, head, hash_node[ti->node_ver]) { - if (flow->mask == mask && flow->hash == hash && - flow_cmp_masked_key(flow, &masked_key, - key_start, key_end)) + hlist_for_each_entry_rcu(flow, head, flow_table.node[ti->node_ver]) { + if (flow->mask == mask && flow->flow_table.hash == hash && + flow_cmp_masked_key(flow, &masked_key, &mask->range)) return flow; } return NULL; @@ -521,7 +571,7 @@ */ static struct sw_flow *flow_lookup(struct flow_table *tbl, struct table_instance *ti, - struct mask_array *ma, + const struct mask_array *ma, const struct sw_flow_key *key, u32 *n_mask_hit, u32 *index) @@ -564,7 +614,7 @@ * cache entry in mask cache. * This is per cpu cache and is divided in MC_HASH_SEGS segments. * In case of a hash collision the entry is hashed in next segment. - * */ + */ struct sw_flow *ovs_flow_tbl_lookup_stats(struct flow_table *tbl, const struct sw_flow_key *key, u32 skb_hash, @@ -574,7 +624,7 @@ struct table_instance *ti = rcu_dereference(tbl->ti); struct mask_cache_entry *entries, *ce; struct sw_flow *flow; - u32 hash = skb_hash; + u32 hash; int seg; *n_mask_hit = 0; @@ -584,7 +634,14 @@ return flow_lookup(tbl, ti, ma, key, n_mask_hit, &mask_index); } + /* Pre and post recirulation flows usually have the same skb_hash + * value. To avoid hash collisions, rehash the 'skb_hash' with + * 'recirc_id'. */ + if (key->recirc_id) + skb_hash = jhash_1word(skb_hash, key->recirc_id); + ce = NULL; + hash = skb_hash; entries = this_cpu_ptr(tbl->mask_cache); /* Find the cache entry 'ce' to operate on. */ @@ -627,7 +684,7 @@ } struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *tbl, - struct sw_flow_match *match) + const struct sw_flow_match *match) { struct mask_array *ma = ovsl_dereference(tbl->mask_array); int i; @@ -643,7 +700,48 @@ if (!mask) continue; flow = masked_flow_lookup(ti, match->key, mask, &n_mask_hit); - if (flow && ovs_flow_cmp_unmasked_key(flow, match)) + if (flow && ovs_identifier_is_key(&flow->id) && + ovs_flow_cmp_unmasked_key(flow, match)) + return flow; + } + return NULL; +} + +static u32 ufid_hash(const struct sw_flow_id *sfid) +{ + return jhash(sfid->ufid, sfid->ufid_len, 0); +} + +static bool ovs_flow_cmp_ufid(const struct sw_flow *flow, + const struct sw_flow_id *sfid) +{ + if (flow->id.ufid_len != sfid->ufid_len) + return false; + + return !memcmp(flow->id.ufid, sfid->ufid, sfid->ufid_len); +} + +bool ovs_flow_cmp(const struct sw_flow *flow, const struct sw_flow_match *match) +{ + if (ovs_identifier_is_ufid(&flow->id)) + return flow_cmp_masked_key(flow, match->key, &match->range); + + return ovs_flow_cmp_unmasked_key(flow, match); +} + +struct sw_flow *ovs_flow_tbl_lookup_ufid(struct flow_table *tbl, + const struct sw_flow_id *ufid) +{ + struct table_instance *ti = rcu_dereference_ovsl(tbl->ufid_ti); + struct sw_flow *flow; + struct hlist_head *head; + u32 hash; + + hash = ufid_hash(ufid); + head = find_bucket(ti, hash); + hlist_for_each_entry_rcu(flow, head, ufid_table.node[ti->node_ver]) { + if (flow->ufid_table.hash == hash && + ovs_flow_cmp_ufid(flow, ufid)) return flow; } return NULL; @@ -657,9 +755,10 @@ return ma->count; } -static struct table_instance *table_instance_expand(struct table_instance *ti) +static struct table_instance *table_instance_expand(struct table_instance *ti, + bool ufid) { - return table_instance_rehash(ti, ti->n_buckets * 2); + return table_instance_rehash(ti, ti->n_buckets * 2, ufid); } static void tbl_mask_array_delete_mask(struct mask_array *ma, @@ -709,13 +808,19 @@ void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow) { struct table_instance *ti = ovsl_dereference(table->ti); + struct table_instance *ufid_ti = ovsl_dereference(table->ufid_ti); BUG_ON(table->count == 0); - hlist_del_rcu(&flow->hash_node[ti->node_ver]); + hlist_del_rcu(&flow->flow_table.node[ti->node_ver]); table->count--; + if (ovs_identifier_is_ufid(&flow->id)) { + hlist_del_rcu(&flow->ufid_table.node[ufid_ti->node_ver]); + table->ufid_count--; + } /* RCU delete the mask. 'flow->mask' is not NULLed, as it should be - * accessible as long as the RCU read lock is held. */ + * accessible as long as the RCU read lock is held. + */ flow_mask_remove(table, flow->mask); } @@ -761,7 +866,7 @@ /* Add 'mask' into the mask list, if it is not already there. */ static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow, - struct sw_flow_mask *new) + const struct sw_flow_mask *new) { struct sw_flow_mask *mask; @@ -813,39 +918,70 @@ } /* Must be called with OVS mutex held. */ -int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, - struct sw_flow_mask *mask) +static void flow_key_insert(struct flow_table *table, struct sw_flow *flow) { struct table_instance *new_ti = NULL; struct table_instance *ti; - int err; - err = flow_mask_insert(table, flow, mask); - if (err) - return err; - - flow->hash = flow_hash(&flow->key, flow->mask->range.start, - flow->mask->range.end); + flow->flow_table.hash = flow_hash(&flow->key, &flow->mask->range); ti = ovsl_dereference(table->ti); table_instance_insert(ti, flow); table->count++; /* Expand table, if necessary, to make room. */ if (table->count > ti->n_buckets) - new_ti = table_instance_expand(ti); + new_ti = table_instance_expand(ti, false); else if (time_after(jiffies, table->last_rehash + REHASH_INTERVAL)) - new_ti = table_instance_rehash(ti, ti->n_buckets); + new_ti = table_instance_rehash(ti, ti->n_buckets, false); if (new_ti) { rcu_assign_pointer(table->ti, new_ti); - table_instance_destroy(ti, true); + call_rcu(&ti->rcu, flow_tbl_destroy_rcu_cb); table->last_rehash = jiffies; } +} + +/* Must be called with OVS mutex held. */ +static void flow_ufid_insert(struct flow_table *table, struct sw_flow *flow) +{ + struct table_instance *ti; + + flow->ufid_table.hash = ufid_hash(&flow->id); + ti = ovsl_dereference(table->ufid_ti); + ufid_table_instance_insert(ti, flow); + table->ufid_count++; + + /* Expand table, if necessary, to make room. */ + if (table->ufid_count > ti->n_buckets) { + struct table_instance *new_ti; + + new_ti = table_instance_expand(ti, true); + if (new_ti) { + rcu_assign_pointer(table->ufid_ti, new_ti); + call_rcu(&ti->rcu, flow_tbl_destroy_rcu_cb); + } + } +} + +/* Must be called with OVS mutex held. */ +int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, + const struct sw_flow_mask *mask) +{ + int err; + + err = flow_mask_insert(table, flow, mask); + if (err) + return err; + flow_key_insert(table, flow); + if (ovs_identifier_is_ufid(&flow->id)) + flow_ufid_insert(table, flow); + return 0; } /* Initializes the flow module. - * Returns zero if successful or a negative error code. */ + * Returns zero if successful or a negative error code. + */ int ovs_flow_init(void) { BUILD_BUG_ON(__alignof__(struct sw_flow_key) % __alignof__(long)); diff -Nru openvswitch-2.3.1/datapath/flow_table.h openvswitch-2.4.0~git20150623/datapath/flow_table.h --- openvswitch-2.3.1/datapath/flow_table.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/flow_table.h 2015-06-23 18:46:21.000000000 +0000 @@ -58,10 +58,12 @@ struct flow_table { struct table_instance __rcu *ti; + struct table_instance __rcu *ufid_ti; struct mask_cache_entry __percpu *mask_cache; struct mask_array __rcu *mask_array; unsigned long last_rehash; unsigned int count; + unsigned int ufid_count; }; extern struct kmem_cache *flow_stats_cache; @@ -73,12 +75,12 @@ void ovs_flow_free(struct sw_flow *, bool deferred); int ovs_flow_tbl_init(struct flow_table *); -int ovs_flow_tbl_count(struct flow_table *table); +int ovs_flow_tbl_count(const struct flow_table *table); void ovs_flow_tbl_destroy(struct flow_table *table); int ovs_flow_tbl_flush(struct flow_table *flow_table); int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, - struct sw_flow_mask *mask); + const struct sw_flow_mask *mask); void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow); int ovs_flow_tbl_num_masks(const struct flow_table *table); struct sw_flow *ovs_flow_tbl_dump_next(struct table_instance *table, @@ -89,11 +91,12 @@ u32 *n_mask_hit); struct sw_flow *ovs_flow_tbl_lookup(struct flow_table *, const struct sw_flow_key *); -struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *, - struct sw_flow_match *match); +struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *tbl, + const struct sw_flow_match *match); +struct sw_flow *ovs_flow_tbl_lookup_ufid(struct flow_table *, + const struct sw_flow_id *); -bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow, - struct sw_flow_match *match); +bool ovs_flow_cmp(const struct sw_flow *, const struct sw_flow_match *); void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src, const struct sw_flow_mask *mask); diff -Nru openvswitch-2.3.1/datapath/.gitignore openvswitch-2.4.0~git20150623/datapath/.gitignore --- openvswitch-2.3.1/datapath/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,7 @@ +/Makefile +/Makefile.in +*.cmd +*.ko +*.mod.c +Module.symvers +/distfiles diff -Nru openvswitch-2.3.1/datapath/linux/compat/build-aux/export-check-whitelist openvswitch-2.4.0~git20150623/datapath/linux/compat/build-aux/export-check-whitelist --- openvswitch-2.3.1/datapath/linux/compat/build-aux/export-check-whitelist 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/build-aux/export-check-whitelist 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1 @@ +pskb_expand_head \ No newline at end of file diff -Nru openvswitch-2.3.1/datapath/linux/compat/dev-openvswitch.c openvswitch-2.4.0~git20150623/datapath/linux/compat/dev-openvswitch.c --- openvswitch-2.3.1/datapath/linux/compat/dev-openvswitch.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/dev-openvswitch.c 2015-06-23 18:46:21.000000000 +0000 @@ -39,9 +39,9 @@ static int nr_bridges; #ifdef HAVE_RHEL_OVS_HOOK -int netdev_rx_handler_register(struct net_device *dev, - openvswitch_handle_frame_hook_t *hook, - void *rx_handler_data) +int rpl_netdev_rx_handler_register(struct net_device *dev, + openvswitch_handle_frame_hook_t *hook, + void *rx_handler_data) { nr_bridges++; rcu_assign_pointer(dev->ax25_ptr, rx_handler_data); @@ -50,12 +50,13 @@ rcu_assign_pointer(openvswitch_handle_frame_hook, hook); return 0; } +EXPORT_SYMBOL_GPL(rpl_netdev_rx_handler_register); #else -int netdev_rx_handler_register(struct net_device *dev, - struct sk_buff *(*hook)(struct net_bridge_port *p, - struct sk_buff *skb), - void *rx_handler_data) +int rpl_netdev_rx_handler_register(struct net_device *dev, + struct sk_buff *(*hook)(struct net_bridge_port *p, + struct sk_buff *skb), + void *rx_handler_data) { nr_bridges++; if (dev->br_port) @@ -67,9 +68,10 @@ br_handle_frame_hook = hook; return 0; } +EXPORT_SYMBOL_GPL(rpl_netdev_rx_handler_register); #endif -void netdev_rx_handler_unregister(struct net_device *dev) +void rpl_netdev_rx_handler_unregister(struct net_device *dev) { nr_bridges--; #ifdef HAVE_RHEL_OVS_HOOK @@ -88,4 +90,6 @@ br_handle_frame_hook = NULL; #endif } +EXPORT_SYMBOL_GPL(rpl_netdev_rx_handler_unregister); + #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/exthdrs_core.c openvswitch-2.4.0~git20150623/datapath/linux/compat/exthdrs_core.c --- openvswitch-2.3.1/datapath/linux/compat/exthdrs_core.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/exthdrs_core.c 2015-06-23 18:46:21.000000000 +0000 @@ -45,6 +45,7 @@ *nexthdrp = nexthdr; return start; } +EXPORT_SYMBOL_GPL(rpl_ipv6_skip_exthdr); #endif /* Kernel version < 3.3 */ #ifndef HAVE_IP6_FH_F_SKIP_RH @@ -169,5 +170,6 @@ *offset = start; return nexthdr; } +EXPORT_SYMBOL_GPL(rpl_ipv6_find_hdr); #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/flex_array.c openvswitch-2.4.0~git20150623/datapath/linux/compat/flex_array.c --- openvswitch-2.3.1/datapath/linux/compat/flex_array.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/flex_array.c 2015-06-23 18:46:21.000000000 +0000 @@ -89,7 +89,7 @@ * capacity in the base structure. Also note that no effort is made * to efficiently pack objects across page boundaries. */ -struct flex_array *flex_array_alloc(int element_size, unsigned int total, +struct flex_array *rpl_flex_array_alloc(int element_size, unsigned int total, gfp_t flags) { struct flex_array *ret; @@ -118,6 +118,7 @@ FLEX_ARRAY_BASE_BYTES_LEFT); return ret; } +EXPORT_SYMBOL_GPL(rpl_flex_array_alloc); static int fa_element_to_part_nr(struct flex_array *fa, unsigned int element_nr) @@ -132,7 +133,7 @@ * This is to be used in cases where the base 'struct flex_array' * has been statically allocated and should not be free. */ -void flex_array_free_parts(struct flex_array *fa) +void rpl_flex_array_free_parts(struct flex_array *fa) { int part_nr; @@ -141,12 +142,14 @@ for (part_nr = 0; part_nr < FLEX_ARRAY_NR_BASE_PTRS; part_nr++) kfree(fa->parts[part_nr]); } +EXPORT_SYMBOL_GPL(rpl_flex_array_free_parts); -void flex_array_free(struct flex_array *fa) +void rpl_flex_array_free(struct flex_array *fa) { flex_array_free_parts(fa); kfree(fa); } +EXPORT_SYMBOL_GPL(rpl_flex_array_free); static unsigned int index_inside_part(struct flex_array *fa, unsigned int element_nr, @@ -191,7 +194,7 @@ * * Locking must be provided by the caller. */ -int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, +int rpl_flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, gfp_t flags) { int part_nr = 0; @@ -214,6 +217,7 @@ memcpy(dst, src, fa->element_size); return 0; } +EXPORT_SYMBOL_GPL(rpl_flex_array_put); /** * flex_array_clear - clear element in array at @element_nr @@ -222,7 +226,7 @@ * * Locking must be provided by the caller. */ -int flex_array_clear(struct flex_array *fa, unsigned int element_nr) +int rpl_flex_array_clear(struct flex_array *fa, unsigned int element_nr) { int part_nr = 0; struct flex_array_part *part; @@ -244,6 +248,7 @@ memset(dst, FLEX_ARRAY_FREE, fa->element_size); return 0; } +EXPORT_SYMBOL_GPL(rpl_flex_array_clear); /** * flex_array_prealloc - guarantee that array space exists @@ -260,7 +265,7 @@ * * Locking must be provided by the caller. */ -int flex_array_prealloc(struct flex_array *fa, unsigned int start, +int rpl_flex_array_prealloc(struct flex_array *fa, unsigned int start, unsigned int nr_elements, gfp_t flags) { int start_part; @@ -293,6 +298,7 @@ } return 0; } +EXPORT_SYMBOL_GPL(rpl_flex_array_prealloc); /** * flex_array_get - pull data back out of the array @@ -306,7 +312,7 @@ * * Locking must be provided by the caller. */ -void *flex_array_get(struct flex_array *fa, unsigned int element_nr) +void *rpl_flex_array_get(struct flex_array *fa, unsigned int element_nr) { int part_nr = 0; struct flex_array_part *part; @@ -325,6 +331,7 @@ } return &part->elements[index_inside_part(fa, element_nr, part_nr)]; } +EXPORT_SYMBOL_GPL(rpl_flex_array_get); /** * flex_array_get_ptr - pull a ptr back out of the array @@ -335,7 +342,7 @@ * flex_array_put_ptr(). This function should not be called if the * element in question was not set using the _put_ptr() helper. */ -void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr) +void *rpl_flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr) { void **tmp; @@ -345,6 +352,7 @@ return *tmp; } +EXPORT_SYMBOL_GPL(rpl_flex_array_get_ptr); static int part_is_free(struct flex_array_part *part) { @@ -365,7 +373,7 @@ * * Locking must be provided by the caller. */ -int flex_array_shrink(struct flex_array *fa) +int rpl_flex_array_shrink(struct flex_array *fa) { struct flex_array_part *part; int part_nr; @@ -387,5 +395,6 @@ } return ret; } +EXPORT_SYMBOL_GPL(rpl_flex_array_shrink); #endif /* Linux version < 3.0.0 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/flow_dissector.c openvswitch-2.4.0~git20150623/datapath/linux/compat/flow_dissector.c --- openvswitch-2.3.1/datapath/linux/compat/flow_dissector.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/flow_dissector.c 2015-06-23 18:46:21.000000000 +0000 @@ -204,7 +204,7 @@ return jhash_3words(a, b, c, hashrnd); } -u32 __skb_get_hash(struct sk_buff *skb) +u32 rpl__skb_get_rxhash(struct sk_buff *skb) { struct flow_keys keys; u32 hash; @@ -231,4 +231,6 @@ #endif return hash; } +EXPORT_SYMBOL_GPL(rpl__skb_get_rxhash); + #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/genetlink-openvswitch.c openvswitch-2.4.0~git20150623/datapath/linux/compat/genetlink-openvswitch.c --- openvswitch-2.3.1/datapath/linux/compat/genetlink-openvswitch.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/genetlink-openvswitch.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) +#ifndef HAVE_GENL_NOTIFY_TAKES_FAMILY #undef genl_notify @@ -21,6 +21,7 @@ genl_notify(skb, net, portid, group, nlh, flags); #endif } +EXPORT_SYMBOL_GPL(rpl_genl_notify); int rpl___genl_register_family(struct rpl_genl_family *f) { @@ -52,4 +53,6 @@ return err; } +EXPORT_SYMBOL_GPL(rpl___genl_register_family); + #endif /* kernel version < 3.13.0 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/geneve.c openvswitch-2.4.0~git20150623/datapath/linux/compat/geneve.c --- openvswitch-2.3.1/datapath/linux/compat/geneve.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/geneve.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,249 @@ +/* + * Geneve: Generic Network Virtualization Encapsulation + * + * Copyright (c) 2014 Nicira, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if IS_ENABLED(CONFIG_IPV6) +#include +#include +#include +#include +#endif + +#include "compat.h" +#include "gso.h" + +static inline struct genevehdr *geneve_hdr(const struct sk_buff *skb) +{ + return (struct genevehdr *)(udp_hdr(skb) + 1); +} + +static void geneve_build_header(struct genevehdr *geneveh, + __be16 tun_flags, u8 vni[3], + u8 options_len, u8 *options) +{ + geneveh->ver = GENEVE_VER; + geneveh->opt_len = options_len / 4; + geneveh->oam = !!(tun_flags & TUNNEL_OAM); + geneveh->critical = !!(tun_flags & TUNNEL_CRIT_OPT); + geneveh->rsvd1 = 0; + memcpy(geneveh->vni, vni, 3); + geneveh->proto_type = htons(ETH_P_TEB); + geneveh->rsvd2 = 0; + + memcpy(geneveh->options, options, options_len); +} + +/* Transmit a fully formatted Geneve frame. + * + * When calling this function. The skb->data should point + * to the geneve header which is fully formed. + * + * This function will add other UDP tunnel headers. + */ +int rpl_geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt, + struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, + __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, + __be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt, + bool csum, bool xnet) +{ + struct genevehdr *gnvh; + int min_headroom; + int err; + + min_headroom = LL_RESERVED_SPACE(rt_dst(rt).dev) + rt_dst(rt).header_len + + GENEVE_BASE_HLEN + opt_len + sizeof(struct iphdr) + + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); + + err = skb_cow_head(skb, min_headroom); + if (unlikely(err)) { + kfree_skb(skb); + return err; + } + + skb = vlan_hwaccel_push_inside(skb); + if (unlikely(!skb)) + return -ENOMEM; + + skb = udp_tunnel_handle_offloads(skb, csum, (opt_len == 0)); + if (IS_ERR(skb)) + return PTR_ERR(skb); + + gnvh = (struct genevehdr *)__skb_push(skb, sizeof(*gnvh) + opt_len); + geneve_build_header(gnvh, tun_flags, vni, opt_len, opt); + + ovs_skb_set_inner_protocol(skb, htons(ETH_P_TEB)); + + return udp_tunnel_xmit_skb(rt, skb, src, dst, + tos, ttl, df, src_port, dst_port, xnet, + !csum); +} +EXPORT_SYMBOL_GPL(rpl_geneve_xmit_skb); + +/* Callback from net/ipv4/udp.c to receive packets */ +static int geneve_udp_encap_recv(struct sock *sk, struct sk_buff *skb) +{ + struct genevehdr *geneveh; + struct geneve_sock *gs; + int opts_len; + + /* Need Geneve and inner Ethernet header to be present */ + if (unlikely(!pskb_may_pull(skb, GENEVE_BASE_HLEN))) + goto error; + + /* Return packets with reserved bits set */ + geneveh = geneve_hdr(skb); + + if (unlikely(geneveh->ver != GENEVE_VER)) + goto error; + + if (unlikely(geneveh->proto_type != htons(ETH_P_TEB))) + goto error; + + opts_len = geneveh->opt_len * 4; + if (iptunnel_pull_header(skb, GENEVE_BASE_HLEN + opts_len, + htons(ETH_P_TEB))) + goto drop; + + gs = rcu_dereference_sk_user_data(sk); + if (!gs) + goto drop; + + gs->rcv(gs, skb); + return 0; + +drop: + /* Consume bad packet */ + kfree_skb(skb); + return 0; + +error: + /* Let the UDP layer deal with the skb */ + return 1; +} + +static struct socket *geneve_create_sock(struct net *net, bool ipv6, + __be16 port) +{ + struct socket *sock; + struct udp_port_cfg udp_conf; + int err; + + memset(&udp_conf, 0, sizeof(udp_conf)); + + if (ipv6) { + udp_conf.family = AF_INET6; + } else { + udp_conf.family = AF_INET; + udp_conf.local_ip.s_addr = htonl(INADDR_ANY); + } + + udp_conf.local_udp_port = port; + + /* Open UDP socket */ + err = udp_sock_create(net, &udp_conf, &sock); + if (err < 0) + return ERR_PTR(err); + + return sock; +} + +/* Create new listen socket if needed */ +static struct geneve_sock *geneve_socket_create(struct net *net, __be16 port, + geneve_rcv_t *rcv, void *data, + bool ipv6) +{ + struct geneve_sock *gs; + struct socket *sock; + struct udp_tunnel_sock_cfg tunnel_cfg; + + gs = kzalloc(sizeof(*gs), GFP_KERNEL); + if (!gs) + return ERR_PTR(-ENOMEM); + + sock = geneve_create_sock(net, ipv6, port); + if (IS_ERR(sock)) { + kfree(gs); + return ERR_CAST(sock); + } + + gs->sock = sock; + gs->rcv = rcv; + gs->rcv_data = data; + + /* Mark socket as an encapsulation socket */ + tunnel_cfg.sk_user_data = gs; + tunnel_cfg.encap_type = 1; + tunnel_cfg.encap_rcv = geneve_udp_encap_recv; + tunnel_cfg.encap_destroy = NULL; + setup_udp_tunnel_sock(net, sock, &tunnel_cfg); + + return gs; +} + +struct geneve_sock *rpl_geneve_sock_add(struct net *net, __be16 port, + geneve_rcv_t *rcv, void *data, + bool no_share, bool ipv6) +{ + return geneve_socket_create(net, port, rcv, data, ipv6); +} +EXPORT_SYMBOL_GPL(rpl_geneve_sock_add); + +static void rcu_free_gs(struct rcu_head *rcu) +{ + struct geneve_sock *gs = container_of(rcu, struct geneve_sock, rcu); + + kfree(gs); +} + +void rpl_geneve_sock_release(struct geneve_sock *gs) +{ + udp_tunnel_sock_release(gs->sock); + call_rcu(&gs->rcu, rcu_free_gs); +} +EXPORT_SYMBOL_GPL(rpl_geneve_sock_release); + +#endif /* kernel < 4.0 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/gre.c openvswitch-2.4.0~git20150623/datapath/linux/compat/gre.c --- openvswitch-2.3.1/datapath/linux/compat/gre.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/gre.c 2015-06-23 18:46:21.000000000 +0000 @@ -17,11 +17,7 @@ */ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) - #include -#if IS_ENABLED(CONFIG_NET_IPGRE_DEMUX) - #include #include #include @@ -42,6 +38,10 @@ #include "gso.h" +#if IS_ENABLED(CONFIG_NET_IPGRE_DEMUX) + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) + #ifndef HAVE_GRE_CISCO_REGISTER #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) @@ -236,7 +236,7 @@ .handler = gre_cisco_rcv, }; -int gre_cisco_register(struct gre_cisco_protocol *newp) +int rpl_gre_cisco_register(struct gre_cisco_protocol *newp) { int err; @@ -250,8 +250,9 @@ return (cmpxchg((struct gre_cisco_protocol **)&gre_cisco_proto, NULL, newp) == NULL) ? 0 : -EBUSY; } +EXPORT_SYMBOL_GPL(rpl_gre_cisco_register); -int gre_cisco_unregister(struct gre_cisco_protocol *proto) +int rpl_gre_cisco_unregister(struct gre_cisco_protocol *proto) { int ret; @@ -265,12 +266,13 @@ ret = gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO); return ret; } +EXPORT_SYMBOL_GPL(rpl_gre_cisco_unregister); #endif /* !HAVE_GRE_CISCO_REGISTER */ -#ifndef USE_KERNEL_TUNNEL_API - /* GRE TX side. */ +static void gre_nop_fix(struct sk_buff *skb) { } + static void gre_csum_fix(struct sk_buff *skb) { struct gre_base_hdr *greh; @@ -285,38 +287,12 @@ skb->len - gre_offset, 0)); } -struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum) -{ - int err; - - skb_reset_inner_headers(skb); - - if (skb_is_gso(skb)) { - if (gre_csum) - OVS_GSO_CB(skb)->fix_segment = gre_csum_fix; - else - OVS_GSO_CB(skb)->fix_segment = NULL; - } else { - if (skb->ip_summed == CHECKSUM_PARTIAL && gre_csum) { - err = skb_checksum_help(skb); - if (err) - goto error; - - } else if (skb->ip_summed != CHECKSUM_PARTIAL) - skb->ip_summed = CHECKSUM_NONE; - } - return skb; -error: - kfree_skb(skb); - return ERR_PTR(err); -} - static bool is_gre_gso(struct sk_buff *skb) { return skb_is_gso(skb); } -void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, +void rpl_gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, int hdr_len) { struct gre_base_hdr *greh; @@ -344,9 +320,35 @@ skb->len, 0)); } } + + ovs_skb_set_inner_protocol(skb, tpi->proto); +} +EXPORT_SYMBOL_GPL(rpl_gre_build_header); + +struct sk_buff *rpl_gre_handle_offloads(struct sk_buff *skb, bool gre_csum) +{ + int type = gre_csum ? SKB_GSO_GRE_CSUM : SKB_GSO_GRE; + gso_fix_segment_t fix_segment; + + if (gre_csum) + fix_segment = gre_csum_fix; + else + fix_segment = gre_nop_fix; + + return ovs_iptunnel_handle_offloads(skb, gre_csum, type, fix_segment); +} +#else +struct sk_buff *rpl_gre_handle_offloads(struct sk_buff *skb, bool gre_csum) +{ + if (skb_is_gso(skb) && skb_is_encapsulated(skb)) { + kfree_skb(skb); + return ERR_PTR(-ENOSYS); + } + skb_clear_ovs_gso_cb(skb); +#undef gre_handle_offloads + return gre_handle_offloads(skb, gre_csum); } #endif +EXPORT_SYMBOL_GPL(rpl_gre_handle_offloads); #endif /* CONFIG_NET_IPGRE_DEMUX */ - -#endif /* 3.12 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/gso.c openvswitch-2.4.0~git20150623/datapath/linux/compat/gso.c --- openvswitch-2.3.1/datapath/linux/compat/gso.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/gso.c 2015-06-23 18:46:21.000000000 +0000 @@ -17,11 +17,11 @@ */ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) #include #include #include +#include #include #include #include @@ -33,11 +33,13 @@ #include #include +#include #include #include #include #include "gso.h" +#include "vlan.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \ !defined(HAVE_VLAN_BUG_WORKAROUND) @@ -50,10 +52,12 @@ #define vlan_tso true #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) +#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION static bool dev_supports_vlan_tx(struct net_device *dev) { -#if defined(HAVE_VLAN_BUG_WORKAROUND) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) + return true; +#elif defined(HAVE_VLAN_BUG_WORKAROUND) return dev->features & NETIF_F_HW_VLAN_TX; #else /* Assume that the driver is buggy. */ @@ -61,26 +65,72 @@ #endif } +/* Strictly this is not needed and will be optimised out + * as this code is guarded by if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0). + * It is here to make things explicit should the compatibility + * code be extended in some way prior extending its life-span + * beyond v3.19. + */ +static bool supports_mpls_gso(void) +{ +/* MPLS GSO was introduced in v3.11, however it was not correctly + * activated using mpls_features until v3.19. */ +#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION + return true; +#else + return false; +#endif +} + int rpl_dev_queue_xmit(struct sk_buff *skb) { #undef dev_queue_xmit int err = -ENOMEM; + bool vlan, mpls; + + vlan = mpls = false; - if (vlan_tx_tag_present(skb) && !dev_supports_vlan_tx(skb->dev)) { + /* Avoid traversing any VLAN tags that are present to determine if + * the ethtype is MPLS. Instead compare the mac_len (end of L2) and + * skb_network_offset() (beginning of L3) whose inequality will + * indicate the presence of an MPLS label stack. */ + if (skb->mac_len != skb_network_offset(skb) && !supports_mpls_gso()) + mpls = true; + + if (skb_vlan_tag_present(skb) && !dev_supports_vlan_tx(skb->dev)) + vlan = true; + + if (vlan || mpls) { int features; features = netif_skb_features(skb); - if (!vlan_tso) - features &= ~(NETIF_F_TSO | NETIF_F_TSO6 | - NETIF_F_UFO | NETIF_F_FSO); + if (vlan) { + if (!vlan_tso) + features &= ~(NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_UFO | NETIF_F_FSO); + + skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, + skb_vlan_tag_get(skb)); + if (unlikely(!skb)) + return err; + vlan_set_tci(skb, 0); + } - skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb)); - if (unlikely(!skb)) - return err; - vlan_set_tci(skb, 0); + /* As of v3.11 the kernel provides an mpls_features field in + * struct net_device which allows devices to advertise which + * features its supports for MPLS. This value defaults to + * NETIF_F_SG and as of v3.19. + * + * This compatibility code is intended for kernels older + * than v3.19 that do not support MPLS GSO and do not + * use mpls_features. Thus this code uses NETIF_F_SG + * directly in place of mpls_features. + */ + if (mpls) + features &= NETIF_F_SG; - if (netif_needs_gso(skb, features)) { + if (netif_needs_gso(skb->dev, skb, features)) { struct sk_buff *nskb; nskb = skb_gso_segment(skb, features); @@ -117,8 +167,10 @@ kfree_skb(skb); return err; } -#endif /* kernel version < 2.6.37 */ +EXPORT_SYMBOL_GPL(rpl_dev_queue_xmit); +#endif /* OVS_USE_COMPAT_GSO_SEGMENTATION */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) static __be16 __skb_network_protocol(struct sk_buff *skb) { __be16 type = skb->protocol; @@ -135,6 +187,9 @@ vlan_depth += VLAN_HLEN; } + if (eth_p_mpls(type)) + type = ovs_skb_get_inner_protocol(skb); + return type; } @@ -164,7 +219,17 @@ * make copy of it to restore it back. */ memcpy(cb, skb->cb, sizeof(cb)); + /* We are handling offloads by segmenting l3 packet, so + * no need to call OVS compat segmentation function. */ + +#ifdef HAVE___SKB_GSO_SEGMENT +#undef __skb_gso_segment segs = __skb_gso_segment(skb, 0, tx_path); +#else +#undef skb_gso_segment + segs = skb_gso_segment(skb, 0); +#endif + if (!segs || IS_ERR(segs)) goto free; @@ -178,8 +243,7 @@ memcpy(ip_hdr(skb), iph, pkt_hlen); memcpy(skb->cb, cb, sizeof(cb)); - if (OVS_GSO_CB(skb)->fix_segment) - OVS_GSO_CB(skb)->fix_segment(skb); + OVS_GSO_CB(skb)->fix_segment(skb); skb->protocol = proto; skb = skb->next; @@ -189,11 +253,29 @@ return segs; } +static int output_ip(struct sk_buff *skb) +{ + int ret = NETDEV_TX_OK; + int err; + + memset(IPCB(skb), 0, sizeof(*IPCB(skb))); + +#undef ip_local_out + err = ip_local_out(skb); + if (unlikely(net_xmit_eval(err))) + ret = err; + + return ret; +} + int rpl_ip_local_out(struct sk_buff *skb) { int ret = NETDEV_TX_OK; int id = -1; + if (!OVS_GSO_CB(skb)->fix_segment) + return output_ip(skb); + if (skb_is_gso(skb)) { struct iphdr *iph; @@ -213,7 +295,6 @@ while (skb) { struct sk_buff *next_skb = skb->next; struct iphdr *iph; - int err; skb->next = NULL; @@ -221,15 +302,11 @@ if (id >= 0) iph->id = htons(id++); - memset(IPCB(skb), 0, sizeof(*IPCB(skb))); - -#undef ip_local_out - err = ip_local_out(skb); - if (unlikely(net_xmit_eval(err))) - ret = err; - + ret = output_ip(skb); skb = next_skb; } return ret; } -#endif /* 3.12 */ +EXPORT_SYMBOL_GPL(rpl_ip_local_out); + +#endif /* 3.18 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/gso.h openvswitch-2.4.0~git20150623/datapath/linux/compat/gso.h --- openvswitch-2.3.1/datapath/linux/compat/gso.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/gso.h 2015-06-23 18:46:21.000000000 +0000 @@ -2,59 +2,142 @@ #define __LINUX_GSO_WRAPPER_H #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +#include #include #include #include "datapath.h" +typedef void (*gso_fix_segment_t)(struct sk_buff *); struct ovs_gso_cb { struct ovs_skb_cb dp_cb; - sk_buff_data_t inner_network_header; - sk_buff_data_t inner_mac_header; - void (*fix_segment)(struct sk_buff *); + gso_fix_segment_t fix_segment; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) + __be16 inner_protocol; +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) + unsigned int inner_mac_header; +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) + unsigned int inner_network_header; +#endif }; #define OVS_GSO_CB(skb) ((struct ovs_gso_cb *)(skb)->cb) -#define skb_inner_network_header rpl_skb_inner_network_header +static inline void skb_clear_ovs_gso_cb(struct sk_buff *skb) +{ + OVS_GSO_CB(skb)->fix_segment = NULL; +} +#else +static inline void skb_clear_ovs_gso_cb(struct sk_buff *skb) +{ + +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) +static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb) +{ + return skb->head + OVS_GSO_CB(skb)->inner_mac_header; +} + +static inline void skb_set_inner_mac_header(const struct sk_buff *skb, + int offset) +{ + OVS_GSO_CB(skb)->inner_mac_header = (skb->data - skb->head) + offset; +} +#endif -#ifdef NET_SKBUFF_DATA_USES_OFFSET -#define skb_inner_network_header rpl_skb_inner_network_header +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb) { return skb->head + OVS_GSO_CB(skb)->inner_network_header; } -#define skb_inner_mac_header rpl_skb_inner_mac_header -static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb) +static inline int skb_inner_network_offset(const struct sk_buff *skb) { - return skb->head + OVS_GSO_CB(skb)->inner_mac_header; + return skb_inner_network_header(skb) - skb->data; +} + +/* We don't actually store the transport offset on backports because + * we don't use it anywhere. Slightly rename this version to avoid + * future users from picking it up accidentially. + */ +static inline int ovs_skb_inner_transport_offset(const struct sk_buff *skb) +{ + return 0; +} + +static inline void skb_set_inner_network_header(const struct sk_buff *skb, + int offset) +{ + OVS_GSO_CB(skb)->inner_network_header = (skb->data - skb->head) + + offset; } +static inline void skb_set_inner_transport_header(const struct sk_buff *skb, + int offset) +{ } + #else -#define skb_inner_network_header rpl_skb_inner_network_header -static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb) +static inline int ovs_skb_inner_transport_offset(const struct sk_buff *skb) { - return OVS_GSO_CB(skb)->inner_network_header; + return skb_inner_transport_header(skb) - skb->data; } -#define skb_inner_mac_header rpl_skb_inner_mac_header -static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) +static inline void ovs_skb_init_inner_protocol(struct sk_buff *skb) { + OVS_GSO_CB(skb)->inner_protocol = htons(0); +} + +static inline void ovs_skb_set_inner_protocol(struct sk_buff *skb, + __be16 ethertype) { + OVS_GSO_CB(skb)->inner_protocol = ethertype; +} + +static inline __be16 ovs_skb_get_inner_protocol(struct sk_buff *skb) { - return OVS_GSO_CB(skb)->inner_mac_header; + return OVS_GSO_CB(skb)->inner_protocol; +} + +#else + +static inline void ovs_skb_init_inner_protocol(struct sk_buff *skb) { + /* Nothing to do. The inner_protocol is either zero or + * has been set to a value by another user. + * Either way it may be considered initialised. + */ } +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +static inline void ovs_skb_set_inner_protocol(struct sk_buff *skb, + __be16 ethertype) +{ + skb->inner_protocol = ethertype; +} +#else +static inline void ovs_skb_set_inner_protocol(struct sk_buff *skb, + __be16 ethertype) +{ + skb_set_inner_protocol(skb, ethertype); +} #endif -#define skb_inner_network_offset rpl_skb_inner_network_offset -static inline int skb_inner_network_offset(const struct sk_buff *skb) +static inline __be16 ovs_skb_get_inner_protocol(struct sk_buff *skb) { - return skb_inner_network_header(skb) - skb->data; + return skb->inner_protocol; } +#endif /* 3.11 */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +#define ip_local_out rpl_ip_local_out +int rpl_ip_local_out(struct sk_buff *skb); -#define skb_inner_mac_offset rpl_skb_inner_mac_offset static inline int skb_inner_mac_offset(const struct sk_buff *skb) { return skb_inner_mac_header(skb) - skb->data; @@ -64,14 +147,10 @@ static inline void skb_reset_inner_headers(struct sk_buff *skb) { BUILD_BUG_ON(sizeof(struct ovs_gso_cb) > FIELD_SIZEOF(struct sk_buff, cb)); - OVS_GSO_CB(skb)->inner_network_header = skb->network_header; - OVS_GSO_CB(skb)->inner_mac_header = skb->mac_header; - - OVS_GSO_CB(skb)->fix_segment = NULL; + skb_set_inner_mac_header(skb, skb_mac_header(skb) - skb->data); + skb_set_inner_network_header(skb, skb_network_offset(skb)); + skb_set_inner_transport_header(skb, skb_transport_offset(skb)); } +#endif /* 3.18 */ -#define ip_local_out rpl_ip_local_out -int ip_local_out(struct sk_buff *skb); - -#endif /* 3.12 */ #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/hash.c openvswitch-2.4.0~git20150623/datapath/linux/compat/hash.c --- openvswitch-2.3.1/datapath/linux/compat/hash.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/hash.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* General purpose hashing library - * - * That's a start of a kernel hashing library, which can be extended - * with further algorithms in future. arch_fast_hash{2,}() will - * eventually resolve to an architecture optimized implementation. - * - * Copyright 2013 Francesco Fusco - * Copyright 2013 Daniel Borkmann - * Copyright 2013 Thomas Graf - * Licensed under the GNU General Public License, version 2.0 (GPLv2) - */ - -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) - -#include -#include -#include -#include -#include - -static struct fast_hash_ops arch_hash_ops __read_mostly = { - .hash = jhash, - .hash2 = jhash2, -}; - -static bool arch_inited __read_mostly; -static void init_arch(void) -{ - if (likely(arch_inited)) - return; - - setup_arch_fast_hash(&arch_hash_ops); - arch_inited = true; -} - -u32 arch_fast_hash(const void *data, u32 len, u32 seed) -{ - init_arch(); - - return arch_hash_ops.hash(data, len, seed); -} - -u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed) -{ - init_arch(); - - return arch_hash_ops.hash2(data, len, seed); -} - -#endif /* < 3.14 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/hash-x86.c openvswitch-2.4.0~git20150623/datapath/linux/compat/hash-x86.c --- openvswitch-2.3.1/datapath/linux/compat/hash-x86.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/hash-x86.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/* - * Some portions derived from code covered by the following notice: - * - * Copyright (c) 2010-2013 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) - -#ifdef CONFIG_X86 - -#include - -#include -#include - -static inline u32 crc32_u32(u32 crc, u32 val) -{ - asm ("crc32l %1,%0\n" : "+r" (crc) : "rm" (val)); - return crc; -} - -static u32 intel_crc4_2_hash(const void *data, u32 len, u32 seed) -{ - const u32 *p32 = (const u32 *) data; - u32 i, tmp = 0; - - for (i = 0; i < len / 4; i++) - seed = crc32_u32(*p32++, seed); - - switch (3 - (len & 0x03)) { - case 0: - tmp |= *((const u8 *) p32 + 2) << 16; - /* fallthrough */ - case 1: - tmp |= *((const u8 *) p32 + 1) << 8; - /* fallthrough */ - case 2: - tmp |= *((const u8 *) p32); - seed = crc32_u32(tmp, seed); - default: - break; - } - - return seed; -} - -static u32 intel_crc4_2_hash2(const u32 *data, u32 len, u32 seed) -{ - const u32 *p32 = (const u32 *) data; - u32 i; - - for (i = 0; i < len; i++) - seed = crc32_u32(*p32++, seed); - - return seed; -} - -void setup_arch_fast_hash(struct fast_hash_ops *ops) -{ - if (cpu_has_xmm4_2) { - ops->hash = intel_crc4_2_hash; - ops->hash2 = intel_crc4_2_hash2; - } -} - -#endif /* CONFIG_X86 */ -#endif /* < 3.14 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/asm/hash.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/asm/hash.h --- openvswitch-2.3.1/datapath/linux/compat/include/asm/hash.h 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/asm/hash.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#ifndef _ASM_HASH_WRAPPER_H -#define _ASM_HASH_WRAPPER_H - -#include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) -#include_next -#else - -struct fast_hash_ops; -#ifdef CONFIG_X86 -extern void setup_arch_fast_hash(struct fast_hash_ops *ops); -#else -static inline void setup_arch_fast_hash(struct fast_hash_ops *ops) { } -#endif - -#endif /* < 3.14 */ - -#endif /* _ASM_HASH_WRAPPER_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/asm/percpu.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/asm/percpu.h --- openvswitch-2.3.1/datapath/linux/compat/include/asm/percpu.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/asm/percpu.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#ifndef __ASM_PERCPU_WRAPPER_H -#define __ASM_PERCPU_WRAPPER_H 1 - -#include_next - -#if !defined this_cpu_ptr && !defined HAVE_THIS_CPU_PTR -#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id()) -#endif - -#endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/err.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/err.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/err.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/err.h 2015-06-23 18:46:21.000000000 +0000 @@ -18,4 +18,11 @@ } #endif /* HAVE_ERR_CAST */ +#ifndef HAVE_IS_ERR_OR_NULL +static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) +{ + return !ptr || IS_ERR_VALUE((unsigned long)ptr); +} +#endif + #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/flex_array.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/flex_array.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/flex_array.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/flex_array.h 2015-06-23 18:46:21.000000000 +0000 @@ -66,22 +66,39 @@ FLEX_ARRAY_ELEMENTS_PER_PART(__element_size)); \ } -struct flex_array *flex_array_alloc(int element_size, unsigned int total, +#define flex_array_alloc rpl_flex_array_alloc +struct flex_array *rpl_flex_array_alloc(int element_size, unsigned int total, gfp_t flags); -int flex_array_prealloc(struct flex_array *fa, unsigned int start, + +#define flex_array_prealloc rpl_flex_array_prealloc +int rpl_flex_array_prealloc(struct flex_array *fa, unsigned int start, unsigned int nr_elements, gfp_t flags); -void flex_array_free(struct flex_array *fa); -void flex_array_free_parts(struct flex_array *fa); -int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, + +#define flex_array_free rpl_flex_array_free +void rpl_flex_array_free(struct flex_array *fa); + +#define flex_array_free_parts rpl_flex_array_free_parts +void rpl_flex_array_free_parts(struct flex_array *fa); + +#define flex_array_put rpl_flex_array_put +int rpl_flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, gfp_t flags); -int flex_array_clear(struct flex_array *fa, unsigned int element_nr); -void *flex_array_get(struct flex_array *fa, unsigned int element_nr); -int flex_array_shrink(struct flex_array *fa); -#define flex_array_put_ptr(fa, nr, src, gfp) \ +#define flex_array_clear rpl_flex_array_clear +int rpl_flex_array_clear(struct flex_array *fa, unsigned int element_nr); + +#define flex_array_get rpl_flex_array_get +void *rpl_flex_array_get(struct flex_array *fa, unsigned int element_nr); + +#define flex_array_shrink rpl_flex_array_shrink +int rpl_flex_array_shrink(struct flex_array *fa); + +#define flex_array_put_ptr rpl_flex_array_put_ptr +#define rpl_flex_array_put_ptr(fa, nr, src, gfp) \ flex_array_put(fa, nr, (void *)&(src), gfp) -void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr); +#define flex_array_get_ptr rpl_flex_array_get_ptr +void *rpl_flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr); #endif /* Linux version < 3.0.0 */ #endif /* __LINUX_FLEX_ARRAY_WRAPPER_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/hash.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/hash.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/hash.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/hash.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -#ifndef _LINUX_HASH_WRAPPER_H -#define _LINUX_HASH_WRAPPER_H - -#include_next -#include - -#ifndef HAVE_FAST_HASH_OPS - -struct fast_hash_ops { - u32 (*hash)(const void *data, u32 len, u32 seed); - u32 (*hash2)(const u32 *data, u32 len, u32 seed); -}; - -/** - * arch_fast_hash - Caclulates a hash over a given buffer that can have - * arbitrary size. This function will eventually use an - * architecture-optimized hashing implementation if - * available, and trades off distribution for speed. - * - * @data: buffer to hash - * @len: length of buffer in bytes - * @seed: start seed - * - * Returns 32bit hash. - */ -extern u32 arch_fast_hash(const void *data, u32 len, u32 seed); - -/** - * arch_fast_hash2 - Caclulates a hash over a given buffer that has a - * size that is of a multiple of 32bit words. This - * function will eventually use an architecture- - * optimized hashing implementation if available, - * and trades off distribution for speed. - * - * @data: buffer to hash (must be 32bit padded) - * @len: number of 32bit words - * @seed: start seed - * - * Returns 32bit hash. - */ -extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed); -#endif /* !HASH_FAST_HASH_OPS */ - -#endif /* _LINUX_HASH_WRAPPER_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/if.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/if.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/if.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/if.h 2015-06-23 18:46:21.000000000 +0000 @@ -3,16 +3,4 @@ #include_next -#ifndef IFF_TX_SKB_SHARING -#define IFF_TX_SKB_SHARING 0 -#endif - -#ifndef IFF_OVS_DATAPATH -#define IFF_OVS_DATAPATH 0 -#endif - -#ifndef IFF_LIVE_ADDR_CHANGE -#define IFF_LIVE_ADDR_CHANGE 0 -#endif - #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/if_vlan.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/if_vlan.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/if_vlan.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/if_vlan.h 2015-06-23 18:46:21.000000000 +0000 @@ -5,9 +5,10 @@ #include #include_next -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) +#ifndef HAVE_VLAN_INSERT_TAG_SET_PROTO /* - * The behavior of __vlan_put_tag() has changed over time: + * The behavior of __vlan_put_tag()/vlan_insert_tag_set_proto() has changed + * over time: * * - In 2.6.26 and earlier, it adjusted both MAC and network header * pointers. (The latter didn't make any sense.) @@ -16,13 +17,16 @@ * * - In 2.6.29 and later, it adjusts the MAC header pointer only. * + * - In 3.19 and later, it was renamed to vlan_insert_tag_set_proto() + * * This is the version from 2.6.33. We unconditionally substitute this version * to avoid the need to guess whether the version in the kernel tree is * acceptable. */ -#define __vlan_put_tag(skb, proto, tag) rpl__vlan_put_tag(skb, tag) - -static inline struct sk_buff *rpl__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) +#define vlan_insert_tag_set_proto(skb, proto, vlan_tci) \ + rpl_vlan_insert_tag_set_proto(skb, vlan_tci) +static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb, + u16 vlan_tci) { struct vlan_ethhdr *veth; @@ -46,7 +50,45 @@ return skb; } +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +/* + * __vlan_hwaccel_push_inside - pushes vlan tag to the payload + * @skb: skbuff to tag + * + * Pushes the VLAN tag from @skb->vlan_tci inside to the payload. + * + * Following the skb_unshare() example, in case of error, the calling function + * doesn't have to worry about freeing the original skb. + */ +static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) +{ + skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, + vlan_tx_tag_get(skb)); + if (likely(skb)) + skb->vlan_tci = 0; + return skb; +} +/* + * vlan_hwaccel_push_inside - pushes vlan tag to the payload + * @skb: skbuff to tag + * + * Checks is tag is present in @skb->vlan_tci and if it is, it pushes the + * VLAN tag from @skb->vlan_tci inside to the payload. + * + * Following the skb_unshare() example, in case of error, the calling function + * doesn't have to worry about freeing the original skb. + */ +static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) +{ + if (vlan_tx_tag_present(skb)) + skb = __vlan_hwaccel_push_inside(skb); + return skb; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) static inline struct sk_buff *rpl___vlan_hwaccel_put_tag(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci) @@ -55,7 +97,6 @@ } #define __vlan_hwaccel_put_tag rpl___vlan_hwaccel_put_tag - #endif /* All of these were introduced in a single commit preceding 2.6.33, so @@ -101,4 +142,38 @@ skb->protocol = htons(ETH_P_802_2); } #endif + +#ifndef HAVE___VLAN_INSERT_TAG +/* Kernels which don't have __vlan_insert_tag() also don't have skb->vlan_proto + * so ignore the proto paramter. + */ +#define __vlan_insert_tag(skb, proto, tci) rpl_vlan_insert_tag(skb, tci) +static inline int rpl_vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci) +{ + struct vlan_ethhdr *veth; + + if (skb_cow_head(skb, VLAN_HLEN) < 0) + return -ENOMEM; + + veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); + + /* Move the mac addresses to the beginning of the new header. */ + memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); + skb->mac_header -= VLAN_HLEN; + + /* first, the ethernet type */ + veth->h_vlan_proto = htons(ETH_P_8021Q); + + /* now, the TCI */ + veth->h_vlan_TCI = htons(vlan_tci); + + return 0; +} +#endif + +#ifndef skb_vlan_tag_present +#define skb_vlan_tag_present(skb) vlan_tx_tag_present(skb) +#define skb_vlan_tag_get(skb) vlan_tx_tag_get(skb) +#endif + #endif /* linux/if_vlan.h wrapper */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/ip.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/ip.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/ip.h 2012-07-10 09:39:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/ip.h 2015-06-23 18:46:21.000000000 +0000 @@ -5,6 +5,7 @@ #ifndef HAVE_SKBUFF_HEADER_HELPERS #include + static inline struct iphdr *ip_hdr(const struct sk_buff *skb) { return (struct iphdr *)skb_network_header(skb); diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/log2.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/log2.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/log2.h 2012-07-10 09:39:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/log2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#ifndef __LINUX_LOG2_WRAPPER -#define __LINUX_LOG2_WRAPPER - -#ifdef HAVE_LOG2_H -#include_next -#else -/* This is very stripped down because log2.h has far too many dependencies. */ - -extern __attribute__((const, noreturn)) -int ____ilog2_NaN(void); - -#define ilog2(n) ((n) == 4 ? 2 : \ - (n) == 8 ? 3 : \ - ____ilog2_NaN()) -#endif - -#endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/mpls.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/mpls.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/mpls.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/mpls.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,40 @@ +#ifndef _UAPI_MPLS_WRAPPER_H +#define _UAPI_MPLS_WRAPPER_H + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) +#include_next +#else + +#include +#include + +/* Reference: RFC 5462, RFC 3032 + * + * 0 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Label | TC |S| TTL | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * Label: Label Value, 20 bits + * TC: Traffic Class field, 3 bits + * S: Bottom of Stack, 1 bit + * TTL: Time to Live, 8 bits + */ + +struct mpls_label { + __be32 entry; +}; + +#define MPLS_LS_LABEL_MASK 0xFFFFF000 +#define MPLS_LS_LABEL_SHIFT 12 +#define MPLS_LS_TC_MASK 0x00000E00 +#define MPLS_LS_TC_SHIFT 9 +#define MPLS_LS_S_MASK 0x00000100 +#define MPLS_LS_S_SHIFT 8 +#define MPLS_LS_TTL_MASK 0x000000FF +#define MPLS_LS_TTL_SHIFT 0 +#endif + +#endif /* _UAPI_MPLS_WRAPPER_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/netdev_features.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/netdev_features.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/netdev_features.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/netdev_features.h 2015-06-23 18:46:21.000000000 +0000 @@ -42,6 +42,7 @@ #define NETIF_F_GSO_MPLS 0 #endif +#ifndef NETIF_F_GSO_ENCAP_ALL #define NETIF_F_GSO_ENCAP_ALL (NETIF_F_GSO_GRE | \ NETIF_F_GSO_GRE_CSUM | \ NETIF_F_GSO_IPIP | \ @@ -52,3 +53,5 @@ #endif #endif + +#endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/netdevice.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/netdevice.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/netdevice.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/netdevice.h 2015-06-23 18:46:21.000000000 +0000 @@ -8,10 +8,31 @@ #include +#ifndef IFF_TX_SKB_SHARING +#define IFF_TX_SKB_SHARING 0 +#endif + +#ifndef IFF_OVS_DATAPATH +#define IFF_OVS_DATAPATH 0 +#else +#define HAVE_OVS_DATAPATH +#endif + +#ifndef IFF_LIVE_ADDR_CHANGE +#define IFF_LIVE_ADDR_CHANGE 0 +#endif + #ifndef to_net_dev #define to_net_dev(class) container_of(class, struct net_device, NETDEV_DEV_MEMBER) #endif +#ifndef HAVE_NET_NAME_UNKNOWN +#undef alloc_netdev +#define NET_NAME_UNKNOWN 0 +#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ + alloc_netdev_mq(sizeof_priv, name, setup, 1) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) extern void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); @@ -29,18 +50,21 @@ typedef struct sk_buff *(openvswitch_handle_frame_hook_t)(struct sk_buff *skb); extern openvswitch_handle_frame_hook_t *openvswitch_handle_frame_hook; -int netdev_rx_handler_register(struct net_device *dev, - openvswitch_handle_frame_hook_t *hook, - void *rx_handler_data); +#define netdev_rx_handler_register rpl_netdev_rx_handler_register +int rpl_netdev_rx_handler_register(struct net_device *dev, + openvswitch_handle_frame_hook_t *hook, + void *rx_handler_data); #else -int netdev_rx_handler_register(struct net_device *dev, - struct sk_buff *(*netdev_hook)(struct net_bridge_port *p, - struct sk_buff *skb), - void *rx_handler_data); +#define netdev_rx_handler_register rpl_netdev_rx_handler_register +int rpl_netdev_rx_handler_register(struct net_device *dev, + struct sk_buff *(*netdev_hook)(struct net_bridge_port *p, + struct sk_buff *skb), + void *rx_handler_data); #endif -void netdev_rx_handler_unregister(struct net_device *dev); +#define netdev_rx_handler_unregister rpl_netdev_rx_handler_unregister +void rpl_netdev_rx_handler_unregister(struct net_device *dev); #endif #ifndef HAVE_DEV_GET_BY_INDEX_RCU @@ -64,29 +88,42 @@ typedef u32 netdev_features_t; #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#define OVS_USE_COMPAT_GSO_SEGMENTATION +#endif + +#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION +/* define compat version to handle MPLS segmentation offload. */ +#define __skb_gso_segment rpl__skb_gso_segment +struct sk_buff *rpl__skb_gso_segment(struct sk_buff *skb, + netdev_features_t features, + bool tx_path); + #define skb_gso_segment rpl_skb_gso_segment -struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb, - netdev_features_t features); +static inline +struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb, netdev_features_t features) +{ + return rpl__skb_gso_segment(skb, features, true); +} +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #define netif_skb_features rpl_netif_skb_features netdev_features_t rpl_netif_skb_features(struct sk_buff *skb); +#endif -#define netif_needs_gso rpl_netif_needs_gso -static inline int rpl_netif_needs_gso(struct sk_buff *skb, int features) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +static inline int rpl_netif_needs_gso(struct net_device *dev, + struct sk_buff *skb, int features) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); -} +#else + return netif_needs_gso(skb, features); #endif - -#ifndef HAVE___SKB_GSO_SEGMENT -static inline struct sk_buff *__skb_gso_segment(struct sk_buff *skb, - netdev_features_t features, - bool tx_path) -{ - return skb_gso_segment(skb, features); } +#define netif_needs_gso rpl_netif_needs_gso #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) @@ -113,9 +150,9 @@ } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) #define dev_queue_xmit rpl_dev_queue_xmit -int dev_queue_xmit(struct sk_buff *skb); +int rpl_dev_queue_xmit(struct sk_buff *skb); #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) @@ -138,4 +175,20 @@ }; #endif +#ifndef netdev_alloc_pcpu_stats +#define netdev_alloc_pcpu_stats(type) \ +({ \ + typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \ + if (pcpu_stats) { \ + int ____i; \ + for_each_possible_cpu(____i) { \ + typeof(type) *stat; \ + stat = per_cpu_ptr(pcpu_stats, ____i); \ + u64_stats_init(&stat->syncp); \ + } \ + } \ + pcpu_stats; \ +}) +#endif + #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/net.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/net.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/net.h 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/net.h 2015-06-23 18:46:21.000000000 +0000 @@ -30,7 +30,8 @@ #endif #ifndef net_get_random_once -bool __net_get_random_once(void *buf, int nbytes, bool *done, +#define __net_get_random_once rpl___net_get_random_once +bool rpl___net_get_random_once(void *buf, int nbytes, bool *done, atomic_t *done_key); #define ___NET_RANDOM_STATIC_KEY_INIT ATOMIC_INIT(0) diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/openvswitch.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/openvswitch.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/openvswitch.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/openvswitch.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,720 @@ +/* + * Copyright (c) 2007-2014 Nicira, Inc. + * + * This file is offered under your choice of two licenses: Apache 2.0 or GNU + * GPL 2.0 or later. The permission statements for each of these licenses is + * given below. You may license your modifications to this file under either + * of these licenses or both. If you wish to license your modifications under + * only one of these licenses, delete the permission text for the other + * license. + * + * ---------------------------------------------------------------------- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA + * ---------------------------------------------------------------------- + */ + +#ifndef _LINUX_OPENVSWITCH_H +#define _LINUX_OPENVSWITCH_H 1 + +#include +#include + +/** + * struct ovs_header - header for OVS Generic Netlink messages. + * @dp_ifindex: ifindex of local port for datapath (0 to make a request not + * specific to a datapath). + * + * Attributes following the header are specific to a particular OVS Generic + * Netlink family, but all of the OVS families use this header. + */ + +struct ovs_header { + int dp_ifindex; +}; + +/* Datapaths. */ + +#define OVS_DATAPATH_FAMILY "ovs_datapath" +#define OVS_DATAPATH_MCGROUP "ovs_datapath" + +/* V2: + * - API users are expected to provide OVS_DP_ATTR_USER_FEATURES + * when creating the datapath. + */ +#define OVS_DATAPATH_VERSION 2 + +/* First OVS datapath version to support features */ +#define OVS_DP_VER_FEATURES 2 + +enum ovs_datapath_cmd { + OVS_DP_CMD_UNSPEC, + OVS_DP_CMD_NEW, + OVS_DP_CMD_DEL, + OVS_DP_CMD_GET, + OVS_DP_CMD_SET +}; + +/** + * enum ovs_datapath_attr - attributes for %OVS_DP_* commands. + * @OVS_DP_ATTR_NAME: Name of the network device that serves as the "local + * port". This is the name of the network device whose dp_ifindex is given in + * the &struct ovs_header. Always present in notifications. Required in + * %OVS_DP_NEW requests. May be used as an alternative to specifying + * dp_ifindex in other requests (with a dp_ifindex of 0). + * @OVS_DP_ATTR_UPCALL_PID: The Netlink socket in userspace that is initially + * set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on + * %OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should + * not be sent. + * @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the + * datapath. Always present in notifications. + * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the + * datapath. Always present in notifications. + * + * These attributes follow the &struct ovs_header within the Generic Netlink + * payload for %OVS_DP_* commands. + */ +enum ovs_datapath_attr { + OVS_DP_ATTR_UNSPEC, + OVS_DP_ATTR_NAME, /* name of dp_ifindex netdev */ + OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */ + OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ + OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ + OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */ + __OVS_DP_ATTR_MAX +}; + +#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1) + +/* All 64-bit integers within Netlink messages are 4-byte aligned only. */ +struct ovs_dp_stats { + __u64 n_hit; /* Number of flow table matches. */ + __u64 n_missed; /* Number of flow table misses. */ + __u64 n_lost; /* Number of misses not sent to userspace. */ + __u64 n_flows; /* Number of flows present */ +}; + +struct ovs_dp_megaflow_stats { + __u64 n_mask_hit; /* Number of masks used for flow lookups. */ + __u32 n_masks; /* Number of masks for the datapath. */ + __u32 pad0; /* Pad for future expension. */ + __u64 pad1; /* Pad for future expension. */ + __u64 pad2; /* Pad for future expension. */ +}; + +struct ovs_vport_stats { + __u64 rx_packets; /* total packets received */ + __u64 tx_packets; /* total packets transmitted */ + __u64 rx_bytes; /* total bytes received */ + __u64 tx_bytes; /* total bytes transmitted */ + __u64 rx_errors; /* bad packets received */ + __u64 tx_errors; /* packet transmit problems */ + __u64 rx_dropped; /* no space in linux buffers */ + __u64 tx_dropped; /* no space available in linux */ +}; + +/* Allow last Netlink attribute to be unaligned */ +#define OVS_DP_F_UNALIGNED (1 << 0) + +/* Allow datapath to associate multiple Netlink PIDs to each vport */ +#define OVS_DP_F_VPORT_PIDS (1 << 1) + +/* Fixed logical ports. */ +#define OVSP_LOCAL ((__u32)0) + +/* Packet transfer. */ + +#define OVS_PACKET_FAMILY "ovs_packet" +#define OVS_PACKET_VERSION 0x1 + +enum ovs_packet_cmd { + OVS_PACKET_CMD_UNSPEC, + + /* Kernel-to-user notifications. */ + OVS_PACKET_CMD_MISS, /* Flow table miss. */ + OVS_PACKET_CMD_ACTION, /* OVS_ACTION_ATTR_USERSPACE action. */ + + /* Userspace commands. */ + OVS_PACKET_CMD_EXECUTE /* Apply actions to a packet. */ +}; + +/** + * enum ovs_packet_attr - attributes for %OVS_PACKET_* commands. + * @OVS_PACKET_ATTR_PACKET: Present for all notifications. Contains the entire + * packet as received, from the start of the Ethernet header onward. For + * %OVS_PACKET_CMD_ACTION, %OVS_PACKET_ATTR_PACKET reflects changes made by + * actions preceding %OVS_ACTION_ATTR_USERSPACE, but %OVS_PACKET_ATTR_KEY is + * the flow key extracted from the packet as originally received. + * @OVS_PACKET_ATTR_KEY: Present for all notifications. Contains the flow key + * extracted from the packet as nested %OVS_KEY_ATTR_* attributes. This allows + * userspace to adapt its flow setup strategy by comparing its notion of the + * flow key against the kernel's. When used with %OVS_PACKET_CMD_EXECUTE, only + * metadata key fields (e.g. priority, skb mark) are honored. All the packet + * header fields are parsed from the packet instead. + * @OVS_PACKET_ATTR_ACTIONS: Contains actions for the packet. Used + * for %OVS_PACKET_CMD_EXECUTE. It has nested %OVS_ACTION_ATTR_* attributes. + * @OVS_PACKET_ATTR_USERDATA: Present for an %OVS_PACKET_CMD_ACTION + * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an + * %OVS_USERSPACE_ATTR_USERDATA attribute, with the same length and content + * specified there. + * @OVS_PACKET_ATTR_EGRESS_TUN_KEY: Present for an %OVS_PACKET_CMD_ACTION + * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an + * %OVS_USERSPACE_ATTR_EGRESS_TUN_PORT attribute, which is sent only if the + * output port is actually a tunnel port. Contains the output tunnel key + * extracted from the packet as nested %OVS_TUNNEL_KEY_ATTR_* attributes. + * + * These attributes follow the &struct ovs_header within the Generic Netlink + * payload for %OVS_PACKET_* commands. + */ +enum ovs_packet_attr { + OVS_PACKET_ATTR_UNSPEC, + OVS_PACKET_ATTR_PACKET, /* Packet data. */ + OVS_PACKET_ATTR_KEY, /* Nested OVS_KEY_ATTR_* attributes. */ + OVS_PACKET_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */ + OVS_PACKET_ATTR_USERDATA, /* OVS_ACTION_ATTR_USERSPACE arg. */ + OVS_PACKET_ATTR_EGRESS_TUN_KEY, /* Nested OVS_TUNNEL_KEY_ATTR_* + attributes. */ + OVS_PACKET_ATTR_UNUSED1, + OVS_PACKET_ATTR_UNUSED2, + OVS_PACKET_ATTR_PROBE, /* Packet operation is a feature probe, + error logging should be suppressed. */ + __OVS_PACKET_ATTR_MAX +}; + +#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1) + +/* Virtual ports. */ + +#define OVS_VPORT_FAMILY "ovs_vport" +#define OVS_VPORT_MCGROUP "ovs_vport" +#define OVS_VPORT_VERSION 0x1 + +enum ovs_vport_cmd { + OVS_VPORT_CMD_UNSPEC, + OVS_VPORT_CMD_NEW, + OVS_VPORT_CMD_DEL, + OVS_VPORT_CMD_GET, + OVS_VPORT_CMD_SET +}; + +enum ovs_vport_type { + OVS_VPORT_TYPE_UNSPEC, + OVS_VPORT_TYPE_NETDEV, /* network device */ + OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ + OVS_VPORT_TYPE_GRE, /* GRE tunnel. */ + OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel. */ + OVS_VPORT_TYPE_GENEVE, /* Geneve tunnel. */ + OVS_VPORT_TYPE_GRE64 = 104, /* GRE tunnel with 64-bit keys */ + OVS_VPORT_TYPE_LISP = 105, /* LISP tunnel */ + OVS_VPORT_TYPE_STT = 106, /* STT tunnel */ + __OVS_VPORT_TYPE_MAX +}; + +#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1) + +/** + * enum ovs_vport_attr - attributes for %OVS_VPORT_* commands. + * @OVS_VPORT_ATTR_PORT_NO: 32-bit port number within datapath. + * @OVS_VPORT_ATTR_TYPE: 32-bit %OVS_VPORT_TYPE_* constant describing the type + * of vport. + * @OVS_VPORT_ATTR_NAME: Name of vport. For a vport based on a network device + * this is the name of the network device. Maximum length %IFNAMSIZ-1 bytes + * plus a null terminator. + * @OVS_VPORT_ATTR_OPTIONS: Vport-specific configuration information. + * @OVS_VPORT_ATTR_UPCALL_PID: The array of Netlink socket pids in userspace + * among which OVS_PACKET_CMD_MISS upcalls will be distributed for packets + * received on this port. If this is a single-element array of value 0, + * upcalls should not be sent. + * @OVS_VPORT_ATTR_STATS: A &struct ovs_vport_stats giving statistics for + * packets sent or received through the vport. + * + * These attributes follow the &struct ovs_header within the Generic Netlink + * payload for %OVS_VPORT_* commands. + * + * For %OVS_VPORT_CMD_NEW requests, the %OVS_VPORT_ATTR_TYPE and + * %OVS_VPORT_ATTR_NAME attributes are required. %OVS_VPORT_ATTR_PORT_NO is + * optional; if not specified a free port number is automatically selected. + * Whether %OVS_VPORT_ATTR_OPTIONS is required or optional depends on the type + * of vport. %OVS_VPORT_ATTR_STATS is optional and other attributes are + * ignored. + * + * For other requests, if %OVS_VPORT_ATTR_NAME is specified then it is used to + * look up the vport to operate on; otherwise dp_idx from the &struct + * ovs_header plus %OVS_VPORT_ATTR_PORT_NO determine the vport. + */ +enum ovs_vport_attr { + OVS_VPORT_ATTR_UNSPEC, + OVS_VPORT_ATTR_PORT_NO, /* u32 port number within datapath */ + OVS_VPORT_ATTR_TYPE, /* u32 OVS_VPORT_TYPE_* constant. */ + OVS_VPORT_ATTR_NAME, /* string name, up to IFNAMSIZ bytes long */ + OVS_VPORT_ATTR_OPTIONS, /* nested attributes, varies by vport type */ + OVS_VPORT_ATTR_UPCALL_PID, /* array of u32 Netlink socket PIDs for */ + /* receiving upcalls */ + OVS_VPORT_ATTR_STATS, /* struct ovs_vport_stats */ + __OVS_VPORT_ATTR_MAX +}; + +#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) + +enum { + OVS_VXLAN_EXT_UNSPEC, + OVS_VXLAN_EXT_GBP, /* Flag or __u32 */ + __OVS_VXLAN_EXT_MAX, +}; + +#define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1) + +/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels. + */ +enum { + OVS_TUNNEL_ATTR_UNSPEC, + OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */ + OVS_TUNNEL_ATTR_EXTENSION, + __OVS_TUNNEL_ATTR_MAX +}; + +#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1) + +/* Flows. */ + +#define OVS_FLOW_FAMILY "ovs_flow" +#define OVS_FLOW_MCGROUP "ovs_flow" +#define OVS_FLOW_VERSION 0x1 + +enum ovs_flow_cmd { + OVS_FLOW_CMD_UNSPEC, + OVS_FLOW_CMD_NEW, + OVS_FLOW_CMD_DEL, + OVS_FLOW_CMD_GET, + OVS_FLOW_CMD_SET +}; + +struct ovs_flow_stats { + __u64 n_packets; /* Number of matched packets. */ + __u64 n_bytes; /* Number of matched bytes. */ +}; + +enum ovs_key_attr { + OVS_KEY_ATTR_UNSPEC, + OVS_KEY_ATTR_ENCAP, /* Nested set of encapsulated attributes. */ + OVS_KEY_ATTR_PRIORITY, /* u32 skb->priority */ + OVS_KEY_ATTR_IN_PORT, /* u32 OVS dp port number */ + OVS_KEY_ATTR_ETHERNET, /* struct ovs_key_ethernet */ + OVS_KEY_ATTR_VLAN, /* be16 VLAN TCI */ + OVS_KEY_ATTR_ETHERTYPE, /* be16 Ethernet type */ + OVS_KEY_ATTR_IPV4, /* struct ovs_key_ipv4 */ + OVS_KEY_ATTR_IPV6, /* struct ovs_key_ipv6 */ + OVS_KEY_ATTR_TCP, /* struct ovs_key_tcp */ + OVS_KEY_ATTR_UDP, /* struct ovs_key_udp */ + OVS_KEY_ATTR_ICMP, /* struct ovs_key_icmp */ + OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */ + OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */ + OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ + OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */ + OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */ + OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */ + OVS_KEY_ATTR_TCP_FLAGS, /* be16 TCP flags. */ + OVS_KEY_ATTR_DP_HASH, /* u32 hash value. Value 0 indicates the hash + is not computed by the datapath. */ + OVS_KEY_ATTR_RECIRC_ID, /* u32 recirc id */ + OVS_KEY_ATTR_MPLS, /* array of struct ovs_key_mpls. + * The implementation may restrict + * the accepted length of the array. */ + +#ifdef __KERNEL__ + /* Only used within kernel data path. */ + OVS_KEY_ATTR_TUNNEL_INFO, /* struct ovs_tunnel_info */ +#endif + __OVS_KEY_ATTR_MAX +}; + +#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1) + +enum ovs_tunnel_key_attr { + OVS_TUNNEL_KEY_ATTR_ID, /* be64 Tunnel ID */ + OVS_TUNNEL_KEY_ATTR_IPV4_SRC, /* be32 src IP address. */ + OVS_TUNNEL_KEY_ATTR_IPV4_DST, /* be32 dst IP address. */ + OVS_TUNNEL_KEY_ATTR_TOS, /* u8 Tunnel IP ToS. */ + OVS_TUNNEL_KEY_ATTR_TTL, /* u8 Tunnel IP TTL. */ + OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT, /* No argument, set DF. */ + OVS_TUNNEL_KEY_ATTR_CSUM, /* No argument. CSUM packet. */ + OVS_TUNNEL_KEY_ATTR_OAM, /* No argument. OAM frame. */ + OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, /* Array of Geneve options. */ + OVS_TUNNEL_KEY_ATTR_TP_SRC, /* be16 src Transport Port. */ + OVS_TUNNEL_KEY_ATTR_TP_DST, /* be16 dst Transport Port. */ + OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS, /* Nested OVS_VXLAN_EXT_* */ + __OVS_TUNNEL_KEY_ATTR_MAX +}; + +#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1) + +/** + * enum ovs_frag_type - IPv4 and IPv6 fragment type + * @OVS_FRAG_TYPE_NONE: Packet is not a fragment. + * @OVS_FRAG_TYPE_FIRST: Packet is a fragment with offset 0. + * @OVS_FRAG_TYPE_LATER: Packet is a fragment with nonzero offset. + * + * Used as the @ipv4_frag in &struct ovs_key_ipv4 and as @ipv6_frag &struct + * ovs_key_ipv6. + */ +enum ovs_frag_type { + OVS_FRAG_TYPE_NONE, + OVS_FRAG_TYPE_FIRST, + OVS_FRAG_TYPE_LATER, + __OVS_FRAG_TYPE_MAX +}; + +#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1) + +struct ovs_key_ethernet { + __u8 eth_src[ETH_ALEN]; + __u8 eth_dst[ETH_ALEN]; +}; + +struct ovs_key_mpls { + __be32 mpls_lse; +}; + +struct ovs_key_ipv4 { + __be32 ipv4_src; + __be32 ipv4_dst; + __u8 ipv4_proto; + __u8 ipv4_tos; + __u8 ipv4_ttl; + __u8 ipv4_frag; /* One of OVS_FRAG_TYPE_*. */ +}; + +struct ovs_key_ipv6 { + __be32 ipv6_src[4]; + __be32 ipv6_dst[4]; + __be32 ipv6_label; /* 20-bits in least-significant bits. */ + __u8 ipv6_proto; + __u8 ipv6_tclass; + __u8 ipv6_hlimit; + __u8 ipv6_frag; /* One of OVS_FRAG_TYPE_*. */ +}; + +struct ovs_key_tcp { + __be16 tcp_src; + __be16 tcp_dst; +}; + +struct ovs_key_udp { + __be16 udp_src; + __be16 udp_dst; +}; + +struct ovs_key_sctp { + __be16 sctp_src; + __be16 sctp_dst; +}; + +struct ovs_key_icmp { + __u8 icmp_type; + __u8 icmp_code; +}; + +struct ovs_key_icmpv6 { + __u8 icmpv6_type; + __u8 icmpv6_code; +}; + +struct ovs_key_arp { + __be32 arp_sip; + __be32 arp_tip; + __be16 arp_op; + __u8 arp_sha[ETH_ALEN]; + __u8 arp_tha[ETH_ALEN]; +}; + +struct ovs_key_nd { + __be32 nd_target[4]; + __u8 nd_sll[ETH_ALEN]; + __u8 nd_tll[ETH_ALEN]; +}; + +/** + * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands. + * @OVS_FLOW_ATTR_KEY: Nested %OVS_KEY_ATTR_* attributes specifying the flow + * key. Always present in notifications. Required for all requests (except + * dumps). + * @OVS_FLOW_ATTR_ACTIONS: Nested %OVS_ACTION_ATTR_* attributes specifying + * the actions to take for packets that match the key. Always present in + * notifications. Required for %OVS_FLOW_CMD_NEW requests, optional for + * %OVS_FLOW_CMD_SET requests. An %OVS_FLOW_CMD_SET without + * %OVS_FLOW_ATTR_ACTIONS will not modify the actions. To clear the actions, + * an %OVS_FLOW_ATTR_ACTIONS without any nested attributes must be given. + * @OVS_FLOW_ATTR_STATS: &struct ovs_flow_stats giving statistics for this + * flow. Present in notifications if the stats would be nonzero. Ignored in + * requests. + * @OVS_FLOW_ATTR_TCP_FLAGS: An 8-bit value giving the OR'd value of all of the + * TCP flags seen on packets in this flow. Only present in notifications for + * TCP flows, and only if it would be nonzero. Ignored in requests. + * @OVS_FLOW_ATTR_USED: A 64-bit integer giving the time, in milliseconds on + * the system monotonic clock, at which a packet was last processed for this + * flow. Only present in notifications if a packet has been processed for this + * flow. Ignored in requests. + * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the + * last-used time, accumulated TCP flags, and statistics for this flow. + * Otherwise ignored in requests. Never present in notifications. + * @OVS_FLOW_ATTR_MASK: Nested %OVS_KEY_ATTR_* attributes specifying the + * mask bits for wildcarded flow match. Mask bit value '1' specifies exact + * match with corresponding flow key bit, while mask bit value '0' specifies + * a wildcarded match. Omitting attribute is treated as wildcarding all + * corresponding fields. Optional for all requests. If not present, + * all flow key bits are exact match bits. + * @OVS_FLOW_ATTR_UFID: A value between 1-16 octets specifying a unique + * identifier for the flow. Causes the flow to be indexed by this value rather + * than the value of the %OVS_FLOW_ATTR_KEY attribute. Optional for all + * requests. Present in notifications if the flow was created with this + * attribute. + * @OVS_FLOW_ATTR_UFID_FLAGS: A 32-bit value of OR'd %OVS_UFID_F_* + * flags that provide alternative semantics for flow installation and + * retrieval. Optional for all requests. + * + * These attributes follow the &struct ovs_header within the Generic Netlink + * payload for %OVS_FLOW_* commands. + */ +enum ovs_flow_attr { + OVS_FLOW_ATTR_UNSPEC, + OVS_FLOW_ATTR_KEY, /* Sequence of OVS_KEY_ATTR_* attributes. */ + OVS_FLOW_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */ + OVS_FLOW_ATTR_STATS, /* struct ovs_flow_stats. */ + OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */ + OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */ + OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */ + OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ + OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error + * logging should be suppressed. */ + OVS_FLOW_ATTR_UFID, /* Variable length unique flow identifier. */ + OVS_FLOW_ATTR_UFID_FLAGS,/* u32 of OVS_UFID_F_*. */ + __OVS_FLOW_ATTR_MAX +}; + +#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1) + +/** + * Omit attributes for notifications. + * + * If a datapath request contains an OVS_UFID_F_OMIT_* flag, then the datapath + * may omit the corresponding 'ovs_flow_attr' from the response. + */ +#define OVS_UFID_F_OMIT_KEY (1 << 0) +#define OVS_UFID_F_OMIT_MASK (1 << 1) +#define OVS_UFID_F_OMIT_ACTIONS (1 << 2) + +/** + * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action. + * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with + * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of + * %UINT32_MAX samples all packets and intermediate values sample intermediate + * fractions of packets. + * @OVS_SAMPLE_ATTR_ACTIONS: Set of actions to execute in sampling event. + * Actions are passed as nested attributes. + * + * Executes the specified actions with the given probability on a per-packet + * basis. + */ +enum ovs_sample_attr { + OVS_SAMPLE_ATTR_UNSPEC, + OVS_SAMPLE_ATTR_PROBABILITY, /* u32 number */ + OVS_SAMPLE_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */ + __OVS_SAMPLE_ATTR_MAX, +}; + +#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1) + +/** + * enum ovs_userspace_attr - Attributes for %OVS_ACTION_ATTR_USERSPACE action. + * @OVS_USERSPACE_ATTR_PID: u32 Netlink PID to which the %OVS_PACKET_CMD_ACTION + * message should be sent. Required. + * @OVS_USERSPACE_ATTR_USERDATA: If present, its variable-length argument is + * copied to the %OVS_PACKET_CMD_ACTION message as %OVS_PACKET_ATTR_USERDATA. + * @OVS_USERSPACE_ATTR_EGRESS_TUN_PORT: If present, u32 output port to get + * tunnel info. + */ +enum ovs_userspace_attr { + OVS_USERSPACE_ATTR_UNSPEC, + OVS_USERSPACE_ATTR_PID, /* u32 Netlink PID to receive upcalls. */ + OVS_USERSPACE_ATTR_USERDATA, /* Optional user-specified cookie. */ + OVS_USERSPACE_ATTR_EGRESS_TUN_PORT, /* Optional, u32 output port + * to get tunnel info. */ + __OVS_USERSPACE_ATTR_MAX +}; + +#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1) + +/** + * struct ovs_action_push_mpls - %OVS_ACTION_ATTR_PUSH_MPLS action argument. + * @mpls_lse: MPLS label stack entry to push. + * @mpls_ethertype: Ethertype to set in the encapsulating ethernet frame. + * + * The only values @mpls_ethertype should ever be given are %ETH_P_MPLS_UC and + * %ETH_P_MPLS_MC, indicating MPLS unicast or multicast. Other are rejected. + */ +struct ovs_action_push_mpls { + __be32 mpls_lse; + __be16 mpls_ethertype; /* Either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC */ +}; + +/** + * struct ovs_action_push_vlan - %OVS_ACTION_ATTR_PUSH_VLAN action argument. + * @vlan_tpid: Tag protocol identifier (TPID) to push. + * @vlan_tci: Tag control identifier (TCI) to push. The CFI bit must be set + * (but it will not be set in the 802.1Q header that is pushed). + * + * The @vlan_tpid value is typically %ETH_P_8021Q. The only acceptable TPID + * values are those that the kernel module also parses as 802.1Q headers, to + * prevent %OVS_ACTION_ATTR_PUSH_VLAN followed by %OVS_ACTION_ATTR_POP_VLAN + * from having surprising results. + */ +struct ovs_action_push_vlan { + __be16 vlan_tpid; /* 802.1Q TPID. */ + __be16 vlan_tci; /* 802.1Q TCI (VLAN ID and priority). */ +}; + +/* Data path hash algorithm for computing Datapath hash. + * + * The algorithm type only specifies the fields in a flow + * will be used as part of the hash. Each datapath is free + * to use its own hash algorithm. The hash value will be + * opaque to the user space daemon. + */ +enum ovs_hash_alg { + OVS_HASH_ALG_L4, +}; + +/* + * struct ovs_action_hash - %OVS_ACTION_ATTR_HASH action argument. + * @hash_alg: Algorithm used to compute hash prior to recirculation. + * @hash_basis: basis used for computing hash. + */ +struct ovs_action_hash { + uint32_t hash_alg; /* One of ovs_hash_alg. */ + uint32_t hash_basis; +}; + +#ifndef __KERNEL__ +#define TNL_PUSH_HEADER_SIZE 128 + +/* + * struct ovs_action_push_tnl - %OVS_ACTION_ATTR_TUNNEL_PUSH + * @tnl_port: To identify tunnel port to pass header info. + * @out_port: Physical port to send encapsulated packet. + * @header_len: Length of the header to be pushed. + * @tnl_type: This is only required to format this header. Otherwise + * ODP layer can not parse %header. + * @header: Partial header for the tunnel. Tunnel push action can use + * this header to build final header according to actual packet parameters. + */ +struct ovs_action_push_tnl { + uint32_t tnl_port; + uint32_t out_port; + uint32_t header_len; + uint32_t tnl_type; /* For logging. */ + uint8_t header[TNL_PUSH_HEADER_SIZE]; +}; +#endif + +/** + * enum ovs_action_attr - Action types. + * + * @OVS_ACTION_ATTR_OUTPUT: Output packet to port. + * @OVS_ACTION_ATTR_USERSPACE: Send packet to userspace according to nested + * %OVS_USERSPACE_ATTR_* attributes. + * @OVS_ACTION_ATTR_PUSH_VLAN: Push a new outermost 802.1Q header onto the + * packet. + * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet. + * @OVS_ACTION_ATTR_SAMPLE: Probabilitically executes actions, as specified in + * the nested %OVS_SAMPLE_ATTR_* attributes. + * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The + * single nested %OVS_KEY_ATTR_* attribute specifies a header to modify and its + * value. + * @OVS_ACTION_ATTR_SET_MASKED: Replaces the contents of an existing header. A + * nested %OVS_KEY_ATTR_* attribute specifies a header to modify, its value, + * and a mask. For every bit set in the mask, the corresponding bit value + * is copied from the value to the packet header field, rest of the bits are + * left unchanged. The non-masked value bits must be passed in as zeroes. + * Masking is not supported for the %OVS_KEY_ATTR_TUNNEL attribute. + * @OVS_ACTION_RECIRC: Recirculate within the data path. + * @OVS_ACTION_HASH: Compute and set flow hash value. + * @OVS_ACTION_ATTR_PUSH_MPLS: Push a new MPLS label stack entry onto the + * top of the packets MPLS label stack. Set the ethertype of the + * encapsulating frame to either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC to + * indicate the new packet contents. + * @OVS_ACTION_ATTR_POP_MPLS: Pop an MPLS label stack entry off of the + * packet's MPLS label stack. Set the encapsulating frame's ethertype to + * indicate the new packet contents. This could potentially still be + * %ETH_P_MPLS if the resulting MPLS label stack is not empty. If there + * is no MPLS label stack, as determined by ethertype, no action is taken. + * + * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all + * fields within a header are modifiable, e.g. the IPv4 protocol and fragment + * type may not be changed. + * + * + * @OVS_ACTION_ATTR_SET_TO_MASKED: Kernel internal masked set action translated + * from the @OVS_ACTION_ATTR_SET. + * @OVS_ACTION_ATTR_TUNNEL_PUSH: Push tunnel header described by struct + * ovs_action_push_tnl. + * @OVS_ACTION_ATTR_TUNNEL_POP: Lookup tunnel port by port-no passed and pop + * tunnel header. + */ + +enum ovs_action_attr { + OVS_ACTION_ATTR_UNSPEC, + OVS_ACTION_ATTR_OUTPUT, /* u32 port number. */ + OVS_ACTION_ATTR_USERSPACE, /* Nested OVS_USERSPACE_ATTR_*. */ + OVS_ACTION_ATTR_SET, /* One nested OVS_KEY_ATTR_*. */ + OVS_ACTION_ATTR_PUSH_VLAN, /* struct ovs_action_push_vlan. */ + OVS_ACTION_ATTR_POP_VLAN, /* No argument. */ + OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */ + OVS_ACTION_ATTR_RECIRC, /* u32 recirc_id. */ + OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */ + OVS_ACTION_ATTR_PUSH_MPLS, /* struct ovs_action_push_mpls. */ + OVS_ACTION_ATTR_POP_MPLS, /* __be16 ethertype. */ + OVS_ACTION_ATTR_SET_MASKED, /* One nested OVS_KEY_ATTR_* including + * data immediately followed by a mask. + * The data must be zero for the unmasked + * bits. */ + +#ifndef __KERNEL__ + OVS_ACTION_ATTR_TUNNEL_PUSH, /* struct ovs_action_push_tnl*/ + OVS_ACTION_ATTR_TUNNEL_POP, /* u32 port number. */ +#endif + __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted + * from userspace. */ + +#ifdef __KERNEL__ + OVS_ACTION_ATTR_SET_TO_MASKED, /* Kernel module internal masked + * set action converted from + * OVS_ACTION_ATTR_SET. */ +#endif +}; + +#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1) + +#endif /* _LINUX_OPENVSWITCH_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/percpu.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/percpu.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/percpu.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/percpu.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,28 @@ +#ifndef __LINUX_PERCPU_WRAPPER_H +#define __LINUX_PERCPU_WRAPPER_H 1 + +#include_next + +#if !defined this_cpu_ptr +#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id()) +#endif + +#ifdef HAVE_RHEL_OVS_HOOK +#undef this_cpu_read +#undef this_cpu_inc +#undef this_cpu_dec +#endif + +#if !defined this_cpu_read +#define this_cpu_read(ptr) percpu_read(ptr) +#endif + +#if !defined this_cpu_inc +#define this_cpu_inc(ptr) percpu_add(ptr, 1) +#endif + +#if !defined this_cpu_dec +#define this_cpu_dec(ptr) percpu_sub(ptr, 1) +#endif + +#endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/rcupdate.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/rcupdate.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/rcupdate.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/rcupdate.h 2015-06-23 18:46:21.000000000 +0000 @@ -15,6 +15,10 @@ #define rcu_dereference_raw(p) rcu_dereference_check(p, 1) #endif +#ifndef rcu_access_pointer +#define rcu_access_pointer(p) rcu_dereference(p) +#endif + #ifndef HAVE_RCU_READ_LOCK_HELD static inline int rcu_read_lock_held(void) { diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/reciprocal_div.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/reciprocal_div.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/reciprocal_div.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/reciprocal_div.h 2015-06-23 18:46:21.000000000 +0000 @@ -25,10 +25,10 @@ u8 sh1, sh2; }; -struct reciprocal_value reciprocal_value(u32 d); +struct reciprocal_value rpl_reciprocal_value(u32 d); #define reciprocal_divide rpl_reciprocal_divide -static inline u32 reciprocal_divide(u32 a, struct reciprocal_value R) +static inline u32 rpl_reciprocal_divide(u32 a, struct reciprocal_value R) { u32 t = (u32)(((u64)a * R.m) >> 32); return (t + ((a - t) >> R.sh1)) >> R.sh2; diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/linux/skbuff.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/skbuff.h --- openvswitch-2.3.1/datapath/linux/compat/include/linux/skbuff.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/linux/skbuff.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,10 +1,42 @@ #ifndef __LINUX_SKBUFF_WRAPPER_H #define __LINUX_SKBUFF_WRAPPER_H 1 +#include +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +/* This should be before skbuff.h to make sure that we rewrite + * the calls there. */ +struct sk_buff; + +int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, + gfp_t gfp_mask); +#define pskb_expand_head rpl_pskb_expand_head +#endif + #include_next #include -#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#define SKB_GSO_GRE 0 +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) +#define SKB_GSO_UDP_TUNNEL 0 +#endif + +#ifndef HAVE_SKB_GSO_GRE_CSUM +#define SKB_GSO_GRE_CSUM 0 +#endif + +#ifndef HAVE_SKB_GSO_UDP_TUNNEL_CSUM +#define SKB_GSO_UDP_TUNNEL_CSUM 0 +#endif + +#ifndef HAVE_IGNORE_DF_RENAME +#define ignore_df local_df +#endif #ifndef HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb, @@ -283,13 +315,14 @@ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) -unsigned int skb_zerocopy_headlen(const struct sk_buff *from); +#define skb_zerocopy_headlen rpl_skb_zerocopy_headlen +unsigned int rpl_skb_zerocopy_headlen(const struct sk_buff *from); #endif #ifndef HAVE_SKB_ZEROCOPY #define skb_zerocopy rpl_skb_zerocopy -int skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, - int hlen); +int rpl_skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, + int hlen); #endif #ifndef HAVE_SKB_CLEAR_HASH @@ -320,4 +353,23 @@ } #endif +#ifndef HAVE_SKB_ENSURE_WRITABLE +#define skb_ensure_writable rpl_skb_ensure_writable +int rpl_skb_ensure_writable(struct sk_buff *skb, int write_len); +#endif + +#ifndef HAVE_SKB_VLAN_POP +#define skb_vlan_pop rpl_skb_vlan_pop +int rpl_skb_vlan_pop(struct sk_buff *skb); +#endif + +#ifndef HAVE_SKB_VLAN_PUSH +#define skb_vlan_push rpl_skb_vlan_push +int rpl_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); +#endif + +#ifndef HAVE_KFREE_SKB_LIST +void rpl_kfree_skb_list(struct sk_buff *segs); +#define kfree_skb_list rpl_kfree_skb_list +#endif #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/checksum.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/checksum.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/checksum.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/checksum.h 2015-06-23 18:46:21.000000000 +0000 @@ -37,8 +37,9 @@ #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) -void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, - const __be32 *from, const __be32 *to, - int pseudohdr); +#define inet_proto_csum_replace16 rpl_inet_proto_csum_replace16 +void rpl_inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, + const __be32 *from, const __be32 *to, + int pseudohdr); #endif #endif /* checksum.h */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/genetlink.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/genetlink.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/genetlink.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/genetlink.h 2015-06-23 18:46:21.000000000 +0000 @@ -17,7 +17,7 @@ #define portid pid #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) +#ifndef HAVE_GENL_NOTIFY_TAKES_FAMILY struct rpl_genl_family { struct genl_family compat_family; unsigned int id; @@ -45,9 +45,9 @@ #define genl_family rpl_genl_family #define genl_notify rpl_genl_notify -void genl_notify(struct genl_family *family, - struct sk_buff *skb, struct net *net, u32 portid, u32 group, - struct nlmsghdr *nlh, gfp_t flags); +void rpl_genl_notify(struct genl_family *family, + struct sk_buff *skb, struct net *net, u32 portid, u32 group, + struct nlmsghdr *nlh, gfp_t flags); static inline void *rpl_genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, struct genl_family *family, int flags, u8 cmd) @@ -105,4 +105,44 @@ } #endif +#ifndef HAVE_GENL_HAS_LISTENERS +static inline int genl_has_listeners(struct genl_family *family, + struct net *net, unsigned int group) +{ +#ifdef HAVE_MCGRP_OFFSET + if (WARN_ON_ONCE(group >= family->n_mcgrps)) + return -EINVAL; + group = family->mcgrp_offset + group; +#endif + return netlink_has_listeners(net->genl_sock, group); +} +#else + +#ifndef HAVE_GENL_HAS_LISTENERS_TAKES_NET +static inline int rpl_genl_has_listeners(struct genl_family *family, + struct net *net, unsigned int group) +{ +#ifdef HAVE_GENL_NOTIFY_TAKES_FAMILY + return genl_has_listeners(family, net->genl_sock, group); +#else + return genl_has_listeners(&family->compat_family, net->genl_sock, group); +#endif +} + +#define genl_has_listeners rpl_genl_has_listeners +#endif + +#endif /* HAVE_GENL_HAS_LISTENERS */ + +#ifndef HAVE_GENLMSG_PARSE +static inline int genlmsg_parse(const struct nlmsghdr *nlh, + const struct genl_family *family, + struct nlattr *tb[], int maxtype, + const struct nla_policy *policy) +{ + return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, + policy); +} +#endif + #endif /* genetlink.h */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/geneve.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/geneve.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/geneve.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/geneve.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,104 @@ +#ifndef __NET_GENEVE_WRAPPER_H +#define __NET_GENEVE_WRAPPER_H 1 + +#include + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) +#include_next +#else + +#ifdef CONFIG_INET +#include +#endif + + +/* Geneve Header: + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * |Ver| Opt Len |O|C| Rsvd. | Protocol Type | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Virtual Network Identifier (VNI) | Reserved | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Variable Length Options | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * Option Header: + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Option Class | Type |R|R|R| Length | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Variable Option Data | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ + +struct geneve_opt { + __be16 opt_class; + u8 type; +#ifdef __LITTLE_ENDIAN_BITFIELD + u8 length:5; + u8 r3:1; + u8 r2:1; + u8 r1:1; +#else + u8 r1:1; + u8 r2:1; + u8 r3:1; + u8 length:5; +#endif + u8 opt_data[]; +}; + +#define GENEVE_CRIT_OPT_TYPE (1 << 7) + +struct genevehdr { +#ifdef __LITTLE_ENDIAN_BITFIELD + u8 opt_len:6; + u8 ver:2; + u8 rsvd1:6; + u8 critical:1; + u8 oam:1; +#else + u8 ver:2; + u8 opt_len:6; + u8 oam:1; + u8 critical:1; + u8 rsvd1:6; +#endif + __be16 proto_type; + u8 vni[3]; + u8 rsvd2; + struct geneve_opt options[]; +}; + +#ifdef CONFIG_INET +struct geneve_sock; + +typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb); + +struct geneve_sock { + geneve_rcv_t *rcv; + void *rcv_data; + struct socket *sock; + struct rcu_head rcu; +}; + +#define GENEVE_VER 0 +#define GENEVE_BASE_HLEN (sizeof(struct udphdr) + sizeof(struct genevehdr)) + +#define geneve_sock_add rpl_geneve_sock_add +struct geneve_sock *rpl_geneve_sock_add(struct net *net, __be16 port, + geneve_rcv_t *rcv, void *data, + bool no_share, bool ipv6); + +#define geneve_sock_release rpl_geneve_sock_release +void rpl_geneve_sock_release(struct geneve_sock *vs); + +#define geneve_xmit_skb rpl_geneve_xmit_skb +int rpl_geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt, + struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, + __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, + __be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt, + bool csum, bool xnet); +#endif /*ifdef CONFIG_INET */ + +#endif /* kernel < 4.0 */ + +#endif /*ifdef__NET_GENEVE_WRAPPER_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/gre.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/gre.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/gre.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/gre.h 2015-06-23 18:46:21.000000000 +0000 @@ -23,10 +23,10 @@ }; #define gre_cisco_register rpl_gre_cisco_register -int gre_cisco_register(struct gre_cisco_protocol *proto); +int rpl_gre_cisco_register(struct gre_cisco_protocol *proto); #define gre_cisco_unregister rpl_gre_cisco_unregister -int gre_cisco_unregister(struct gre_cisco_protocol *proto); +int rpl_gre_cisco_unregister(struct gre_cisco_protocol *proto); #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) struct gre_base_hdr { @@ -81,14 +81,14 @@ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */ #endif /* HAVE_GRE_CISCO_REGISTER */ -#ifndef USE_KERNEL_TUNNEL_API +#define gre_handle_offloads rpl_gre_handle_offloads +struct sk_buff *rpl_gre_handle_offloads(struct sk_buff *skb, bool gre_csum); -#define gre_build_header rpl_gre_build_header -void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, - int hdr_len); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) -#define gre_handle_offloads rpl_gre_handle_offloads -struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum); +#define gre_build_header rpl_gre_build_header +void rpl_gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, + int hdr_len); #define ip_gre_calc_hlen rpl_ip_gre_calc_hlen static inline int ip_gre_calc_hlen(__be16 o_flags) @@ -103,17 +103,6 @@ addend += 4; return addend; } -#else -static inline struct sk_buff *rpl_gre_handle_offloads(struct sk_buff *skb, - bool gre_csum) -{ - if (skb->encapsulation && skb_is_gso(skb)) { - kfree_skb(skb); - return ERR_PTR(-ENOSYS); - } - return gre_handle_offloads(skb, gre_csum); -} -#define gre_handle_offloads rpl_gre_handle_offloads #endif #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/ip.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/ip.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/ip.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/ip.h 2015-06-23 18:46:21.000000000 +0000 @@ -12,7 +12,7 @@ } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) +#ifndef HAVE_INET_GET_LOCAL_PORT_RANGE_USING_NET static inline void rpl_inet_get_local_port_range(struct net *net, int *low, int *high) { diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/ip_tunnels.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/ip_tunnels.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/ip_tunnels.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/ip_tunnels.h 2015-06-23 18:46:21.000000000 +0000 @@ -2,31 +2,12 @@ #define __NET_IP_TUNNELS_WRAPPER_H 1 #include -#if defined(HAVE_GRE_HANDLE_OFFLOADS) && \ - LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && \ - defined(HAVE_VXLAN_XMIT_SKB) -/* RHEL6 and RHEL7 both has backported tunnel API but RHEL6 has - * older version, so avoid using RHEL6 backports. - */ -#define USE_KERNEL_TUNNEL_API -#endif -#ifdef USE_KERNEL_TUNNEL_API +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) #include_next -static inline int rpl_iptunnel_xmit(struct rtable *rt, - struct sk_buff *skb, __be32 src, - __be32 dst, __u8 proto, __u8 tos, - __u8 ttl, __be16 df, bool xnet) -{ -#ifdef HAVE_IPTUNNEL_XMIT_NET - return iptunnel_xmit(NULL, rt, skb, src, dst, proto, tos, ttl, df); -#else - return iptunnel_xmit(rt, skb, src, dst, proto, tos, ttl, df, xnet); #endif -} -#define iptunnel_xmit rpl_iptunnel_xmit -#else +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) #include #include @@ -38,6 +19,26 @@ #include #include +struct sk_buff *ovs_iptunnel_handle_offloads(struct sk_buff *skb, + bool csum_help, int gso_type_mask, + void (*fix_segment)(struct sk_buff *)); + +#define iptunnel_xmit rpl_iptunnel_xmit +int rpl_iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, + __be32 src, __be32 dst, __u8 proto, __u8 tos, __u8 ttl, + __be16 df, bool xnet); + +#define iptunnel_pull_header rpl_iptunnel_pull_header +int rpl_iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto); + +#else + +#define ovs_iptunnel_handle_offloads(skb, csum_help, gso_type_mask, fix_segment) \ + iptunnel_handle_offloads(skb, csum_help, gso_type_mask) + +#endif /* 3.18 */ + +#ifndef TUNNEL_CSUM #define TUNNEL_CSUM __cpu_to_be16(0x01) #define TUNNEL_ROUTING __cpu_to_be16(0x02) #define TUNNEL_KEY __cpu_to_be16(0x04) @@ -46,7 +47,6 @@ #define TUNNEL_REC __cpu_to_be16(0x20) #define TUNNEL_VERSION __cpu_to_be16(0x40) #define TUNNEL_NO_KEY __cpu_to_be16(0x80) -#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100) struct tnl_ptk_info { __be16 flags; @@ -57,13 +57,30 @@ #define PACKET_RCVD 0 #define PACKET_REJECT 1 +#endif -int iptunnel_xmit(struct rtable *rt, - struct sk_buff *skb, - __be32 src, __be32 dst, __u8 proto, - __u8 tos, __u8 ttl, __be16 df, bool xnet); +#ifndef TUNNEL_DONT_FRAGMENT +#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100) +#endif -int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto); +#ifndef TUNNEL_OAM +#define TUNNEL_OAM __cpu_to_be16(0x0200) +#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400) +#endif +#ifndef TUNNEL_GENEVE_OPT +#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800) #endif + +#ifndef TUNNEL_VXLAN_OPT +#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000) +#endif + +/* Older kernels defined TUNNEL_OPTIONS_PRESENT to GENEVE only */ +#undef TUNNEL_OPTIONS_PRESENT +#define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT) + +#define skb_is_encapsulated ovs_skb_is_encapsulated +bool ovs_skb_is_encapsulated(struct sk_buff *skb); + #endif /* __NET_IP_TUNNELS_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/ipv6.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/ipv6.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/ipv6.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/ipv6.h 2015-06-23 18:46:21.000000000 +0000 @@ -11,8 +11,8 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) #define ipv6_skip_exthdr rpl_ipv6_skip_exthdr -extern int ipv6_skip_exthdr(const struct sk_buff *skb, int start, - u8 *nexthdrp, __be16 *frag_offp); +extern int rpl_ipv6_skip_exthdr(const struct sk_buff *skb, int start, + u8 *nexthdrp, __be16 *frag_offp); #endif #ifndef HAVE_IP6_FH_F_SKIP_RH @@ -28,8 +28,8 @@ * IP6_FH_F_SKIP_RH. */ #define ipv6_find_hdr rpl_ipv6_find_hdr -extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, - int target, unsigned short *fragoff, int *fragflg); +extern int rpl_ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, + int target, unsigned short *fragoff, int *fragflg); #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/mpls.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/mpls.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/mpls.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/mpls.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#ifndef _NET_MPLS_WRAPPER_H +#define _NET_MPLS_WRAPPER_H 1 + +#include +#include + +#define MPLS_HLEN 4 + +static inline bool eth_p_mpls(__be16 eth_type) +{ + return eth_type == htons(ETH_P_MPLS_UC) || + eth_type == htons(ETH_P_MPLS_MC); +} + +/* + * For non-MPLS skbs this will correspond to the network header. + * For MPLS skbs it will be before the network_header as the MPLS + * label stack lies between the end of the mac header and the network + * header. That is, for MPLS skbs the end of the mac header + * is the top of the MPLS label stack. + */ +static inline unsigned char *skb_mpls_header(struct sk_buff *skb) +{ + return skb_mac_header(skb) + skb->mac_len; +} +#endif /* _NET_MPLS_WRAPPER_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/netlink.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/netlink.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/netlink.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/netlink.h 2015-06-23 18:46:21.000000000 +0000 @@ -63,4 +63,11 @@ } #endif +#ifndef HAVE_NLA_IS_LAST +static inline bool nla_is_last(const struct nlattr *nla, int rem) +{ + return nla->nla_len == rem; +} +#endif + #endif /* net/netlink.h */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/net_namespace.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/net_namespace.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/net_namespace.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/net_namespace.h 2015-06-23 18:46:21.000000000 +0000 @@ -17,8 +17,10 @@ #define register_pernet_device rpl_register_pernet_gen_device #define unregister_pernet_device rpl_unregister_pernet_gen_device -int compat_init_net(struct net *net, struct rpl_pernet_operations *pnet); -void compat_exit_net(struct net *net, struct rpl_pernet_operations *pnet); +#define compat_init_net ovs_compat_init_net +int ovs_compat_init_net(struct net *net, struct rpl_pernet_operations *pnet); +#define compat_exit_net ovs_compat_exit_net +void ovs_compat_exit_net(struct net *net, struct rpl_pernet_operations *pnet); #define DEFINE_COMPAT_PNET_REG_FUNC(TYPE) \ \ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/stt.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/stt.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/stt.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/stt.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,71 @@ +#ifndef __NET_STT_H +#define __NET_STT_H 1 + +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) && IS_ENABLED(CONFIG_NETFILTER) +#include +#define OVS_STT + +struct stthdr { + __u8 version; + __u8 flags; + __u8 l4_offset; + __u8 reserved; + __be16 mss; + __be16 vlan_tci; + __be64 key; +}; + +/* Padding after the end of the tunnel headers to provide alignment + * for inner packet IP header after 14 byte Ethernet header. + */ +#define STT_ETH_PAD 2 + +#define STT_BASE_HLEN (sizeof(struct stthdr) + STT_ETH_PAD) +#define STT_HEADER_LEN (sizeof(struct tcphdr) + STT_BASE_HLEN) + +static inline struct stthdr *stt_hdr(const struct sk_buff *skb) +{ + return (struct stthdr *)(skb_transport_header(skb) + + sizeof(struct tcphdr)); +} + +struct stt_sock; +typedef void (stt_rcv_t)(struct stt_sock *stt_sock, struct sk_buff *skb); + +/* @list: Per-net list of STT ports. + * @rcv: The callback is called on STT packet recv, STT reassembly can generate + * multiple packets, in this case first packet has tunnel outer header, rest + * of the packets are inner packet segments with no stt header. + * @rcv_data: user data. + * @sock: Fake TCP socket for the STT port. + */ +struct stt_sock { + struct list_head list; + stt_rcv_t *rcv; + void *rcv_data; + struct socket *sock; + struct rcu_head rcu; +}; + +#define stt_sock_add rpl_stt_sock_add +struct stt_sock *rpl_stt_sock_add(struct net *net, __be16 port, + stt_rcv_t *rcv, void *data); + +#define stt_sock_release rpl_stt_sock_release +void rpl_stt_sock_release(struct stt_sock *stt_sock); + +#define stt_xmit_skb rpl_stt_xmit_skb +int rpl_stt_xmit_skb(struct sk_buff *skb, struct rtable *rt, + __be32 src, __be32 dst, __u8 tos, + __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, + __be64 tun_id); + +#define stt_init_module ovs_stt_init_module +int ovs_stt_init_module(void); + +#define stt_cleanup_module ovs_stt_cleanup_module +void ovs_stt_cleanup_module(void); + +#endif +#endif /*ifdef__NET_STT_H */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/udp.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/udp.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/udp.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/udp.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,63 @@ +#ifndef __NET_UDP_WRAPPER_H +#define __NET_UDP_WRAPPER_H 1 + +#include + +#ifdef inet_get_local_port_range +/* RHEL7 backports udp_flow_src_port() using an older version of + * inet_get_local_port_range(). */ +#undef inet_get_local_port_range +#include_next +#define inet_get_local_port_range rpl_inet_get_local_port_range +#else +#include_next +#endif + +#ifndef HAVE_UDP_FLOW_SRC_PORT +static inline __be16 rpl_udp_flow_src_port(struct net *net, struct sk_buff *skb, + int min, int max, bool use_eth) +{ + u32 hash; + + if (min >= max) { + /* Use default range */ + inet_get_local_port_range(net, &min, &max); + } + + hash = skb_get_hash(skb); + if (unlikely(!hash) && use_eth) { + /* Can't find a normal hash, caller has indicated an Ethernet + * packet so use that to compute a hash. + */ + hash = jhash(skb->data, 2 * ETH_ALEN, + (__force u32) skb->protocol); + } + + /* Since this is being sent on the wire obfuscate hash a bit + * to minimize possbility that any useful information to an + * attacker is leaked. Only upper 16 bits are relevant in the + * computation for 16 bit port value. + */ + hash ^= hash << 16; + + return htons((((u64) hash * (max - min)) >> 32) + min); +} + +#define udp_flow_src_port rpl_udp_flow_src_port +#endif + +#ifndef HAVE_UDP_V4_CHECK +static inline __sum16 udp_v4_check(int len, __be32 saddr, + __be32 daddr, __wsum base) +{ + return csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP, base); +} +#endif + +#ifndef HAVE_UDP_SET_CSUM +#define udp_set_csum rpl_udp_set_csum +void rpl_udp_set_csum(bool nocheck, struct sk_buff *skb, + __be32 saddr, __be32 daddr, int len); +#endif + +#endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/udp_tunnel.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/udp_tunnel.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/udp_tunnel.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/udp_tunnel.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,109 @@ +#ifndef __NET_UDP_TUNNEL_WRAPPER_H +#define __NET_UDP_TUNNEL_WRAPPER_H + +#include +#include + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) +#include_next + +static inline struct sk_buff * +rpl_udp_tunnel_handle_offloads(struct sk_buff *skb, bool udp_csum, + bool is_vxlan) +{ + if (skb_is_gso(skb) && skb_is_encapsulated(skb)) { + kfree_skb(skb); + return ERR_PTR(-ENOSYS); + } + return udp_tunnel_handle_offloads(skb, udp_csum); +} +#define udp_tunnel_handle_offloads rpl_udp_tunnel_handle_offloads + +#else + +#include +#include + +struct udp_port_cfg { + u8 family; + + /* Used only for kernel-created sockets */ + union { + struct in_addr local_ip; +#if IS_ENABLED(CONFIG_IPV6) + struct in6_addr local_ip6; +#endif + }; + + union { + struct in_addr peer_ip; +#if IS_ENABLED(CONFIG_IPV6) + struct in6_addr peer_ip6; +#endif + }; + + __be16 local_udp_port; + __be16 peer_udp_port; + unsigned int use_udp_checksums:1, + use_udp6_tx_checksums:1, + use_udp6_rx_checksums:1; +}; + +#define udp_sock_create rpl_udp_sock_create +int rpl_udp_sock_create(struct net *net, struct udp_port_cfg *cfg, + struct socket **sockp); + +typedef int (*udp_tunnel_encap_rcv_t)(struct sock *sk, struct sk_buff *skb); +typedef void (*udp_tunnel_encap_destroy_t)(struct sock *sk); + +struct udp_tunnel_sock_cfg { + void *sk_user_data; /* user data used by encap_rcv call back */ + /* Used for setting up udp_sock fields, see udp.h for details */ + __u8 encap_type; + udp_tunnel_encap_rcv_t encap_rcv; + udp_tunnel_encap_destroy_t encap_destroy; +}; + +/* Setup the given (UDP) sock to receive UDP encapsulated packets */ +#define setup_udp_tunnel_sock rpl_setup_udp_tunnel_sock +void rpl_setup_udp_tunnel_sock(struct net *net, struct socket *sock, + struct udp_tunnel_sock_cfg *sock_cfg); + +/* Transmit the skb using UDP encapsulation. */ +#define udp_tunnel_xmit_skb rpl_udp_tunnel_xmit_skb +int rpl_udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb, + __be32 src, __be32 dst, __u8 tos, __u8 ttl, + __be16 df, __be16 src_port, __be16 dst_port, + bool xnet, bool nocheck); + + +#define udp_tunnel_sock_release rpl_udp_tunnel_sock_release +void rpl_udp_tunnel_sock_release(struct socket *sock); + +void ovs_udp_gso(struct sk_buff *skb); +void ovs_udp_csum_gso(struct sk_buff *skb); + +static inline struct sk_buff *udp_tunnel_handle_offloads(struct sk_buff *skb, + bool udp_csum, + bool is_vxlan) +{ + int type = udp_csum ? SKB_GSO_UDP_TUNNEL_CSUM : SKB_GSO_UDP_TUNNEL; + void (*fix_segment)(struct sk_buff *); + + if (!udp_csum) + fix_segment = ovs_udp_gso; + else + fix_segment = ovs_udp_csum_gso; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) + if (!is_vxlan) + type = 0; +#endif + + return ovs_iptunnel_handle_offloads(skb, udp_csum, type, fix_segment); +} + +#define udp_tunnel_encap_enable(sock) udp_encap_enable() + +#endif /* Linux version < 4.0 */ +#endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/include/net/vxlan.h openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/vxlan.h --- openvswitch-2.3.1/datapath/linux/compat/include/net/vxlan.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/include/net/vxlan.h 2015-06-23 18:46:21.000000000 +0000 @@ -7,31 +7,116 @@ #include #include -#ifdef USE_KERNEL_TUNNEL_API + +#ifdef HAVE_VXLAN_METADATA +#define USE_UPSTREAM_VXLAN + #include_next +#endif + +#ifndef VXLAN_HLEN +/* VXLAN header flags. */ +#define VXLAN_HF_VNI 0x08000000 +#ifndef VXLAN_HF_GBP +#define VXLAN_HF_GBP 0x80000000 +#endif + +#define VXLAN_N_VID (1u << 24) +#define VXLAN_VID_MASK (VXLAN_N_VID - 1) +#define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr)) +#endif + +#ifndef VXLAN_GBP_USED_BITS +/* + * VXLAN Group Based Policy Extension: + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * |1|-|-|-|1|-|-|-|R|D|R|R|A|R|R|R| Group Policy ID | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | VXLAN Network Identifier (VNI) | Reserved | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * D = Don't Learn bit. When set, this bit indicates that the egress + * VTEP MUST NOT learn the source address of the encapsulated frame. + * + * A = Indicates that the group policy has already been applied to + * this packet. Policies MUST NOT be applied by devices when the + * A bit is set. + * + * [0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy + */ +struct vxlanhdr_gbp { + __u8 vx_flags; +#ifdef __LITTLE_ENDIAN_BITFIELD + __u8 reserved_flags1:3, + policy_applied:1, + reserved_flags2:2, + dont_learn:1, + reserved_flags3:1; +#elif defined(__BIG_ENDIAN_BITFIELD) + __u8 reserved_flags1:1, + dont_learn:1, + reserved_flags2:2, + policy_applied:1, + reserved_flags3:3; +#else +#error "Please fix " +#endif + __be16 policy_id; + __be32 vx_vni; +}; +#define VXLAN_GBP_USED_BITS (VXLAN_HF_GBP | 0xFFFFFF) + +/* skb->mark mapping + * + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * |R|R|R|R|R|R|R|R|R|D|R|R|A|R|R|R| Group Policy ID | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +#define VXLAN_GBP_DONT_LEARN (BIT(6) << 16) +#define VXLAN_GBP_POLICY_APPLIED (BIT(3) << 16) +#define VXLAN_GBP_ID_MASK (0xFFFF) + +#define VXLAN_F_GBP 0x800 +#endif +#ifndef VXLAN_F_UDP_CSUM +#define VXLAN_F_UDP_CSUM 0x40 +#endif + +#ifndef VXLAN_F_RCV_FLAGS +#define VXLAN_F_RCV_FLAGS VXLAN_F_GBP +#endif + +#ifdef USE_UPSTREAM_VXLAN static inline int rpl_vxlan_xmit_skb(struct vxlan_sock *vs, struct rtable *rt, struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, - __be16 src_port, __be16 dst_port, __be32 vni) + __be16 src_port, __be16 dst_port, + struct vxlan_metadata *md, bool xnet, u32 vxflags) { - if (skb->encapsulation && skb_is_gso(skb)) { + if (skb_is_gso(skb) && skb_is_encapsulated(skb)) { kfree_skb(skb); return -ENOSYS; } -#ifndef HAVE_IPTUNNEL_XMIT_NET - return vxlan_xmit_skb(vs, rt, skb, src, dst, tos, ttl, df, - src_port, dst_port, vni); -#else - return vxlan_xmit_skb(NULL, vs, rt, skb, src, dst, tos, ttl, df, - src_port, dst_port, vni); -#endif + + return vxlan_xmit_skb(rt, skb, src, dst, tos, ttl, df, + src_port, dst_port, md, xnet, vxflags); } + #define vxlan_xmit_skb rpl_vxlan_xmit_skb -#else +#else /* USE_UPSTREAM_VXLAN */ + +struct vxlan_metadata { + __be32 vni; + u32 gbp; +}; -struct vxlan_sock; -typedef void (vxlan_rcv_t)(struct vxlan_sock *vs, struct sk_buff *skb, __be32 key); +#define vxlan_sock rpl_vxlan_sock +struct rpl_vxlan_sock; + +#define vxlan_rcv_t rpl_vxlan_rcv_t +typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, + struct vxlan_metadata *md); /* per UDP socket information */ struct vxlan_sock { @@ -41,20 +126,23 @@ struct work_struct del_work; struct socket *sock; struct rcu_head rcu; + u32 flags; }; -struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, - vxlan_rcv_t *rcv, void *data, - bool no_share, bool ipv6); - -void vxlan_sock_release(struct vxlan_sock *vs); +#define vxlan_sock_add rpl_vxlan_sock_add +struct vxlan_sock *rpl_vxlan_sock_add(struct net *net, __be16 port, + vxlan_rcv_t *rcv, void *data, + bool no_share, u32 flags); -int vxlan_xmit_skb(struct vxlan_sock *vs, - struct rtable *rt, struct sk_buff *skb, - __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, - __be16 src_port, __be16 dst_port, __be32 vni); +#define vxlan_sock_release rpl_vxlan_sock_release +void rpl_vxlan_sock_release(struct vxlan_sock *vs); -__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); +#define vxlan_xmit_skb rpl_vxlan_xmit_skb +int rpl_vxlan_xmit_skb(struct vxlan_sock *vs, + struct rtable *rt, struct sk_buff *skb, + __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, + __be16 src_port, __be16 dst_port, + struct vxlan_metadata *md, bool xnet, u32 vxflags); -#endif /* 3.12 */ +#endif /* !HAVE_VXLAN_METADATA */ #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/ip_tunnels_core.c openvswitch-2.4.0~git20150623/datapath/linux/compat/ip_tunnels_core.c --- openvswitch-2.3.1/datapath/linux/compat/ip_tunnels_core.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/ip_tunnels_core.c 2015-06-23 18:46:21.000000000 +0000 @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -36,11 +35,10 @@ #include "compat.h" #include "gso.h" -#ifndef USE_KERNEL_TUNNEL_API -int iptunnel_xmit(struct rtable *rt, - struct sk_buff *skb, - __be32 src, __be32 dst, __u8 proto, - __u8 tos, __u8 ttl, __be16 df, bool xnet) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +int rpl_iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, + __be32 src, __be32 dst, __u8 proto, __u8 tos, __u8 ttl, + __be16 df, bool xnet) { int pkt_len = skb->len; struct iphdr *iph; @@ -82,8 +80,62 @@ pkt_len = 0; return pkt_len; } +EXPORT_SYMBOL_GPL(rpl_iptunnel_xmit); -int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto) +struct sk_buff *ovs_iptunnel_handle_offloads(struct sk_buff *skb, + bool csum_help, int gso_type_mask, + void (*fix_segment)(struct sk_buff *)) +{ + int err; + + if (likely(!skb_is_encapsulated(skb))) { + skb_reset_inner_headers(skb); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + skb->encapsulation = 1; +#endif + } else if (skb_is_gso(skb)) { + err = -ENOSYS; + goto error; + } + + if (gso_type_mask) + fix_segment = NULL; + + OVS_GSO_CB(skb)->fix_segment = fix_segment; + + if (skb_is_gso(skb)) { + err = skb_unclone(skb, GFP_ATOMIC); + if (unlikely(err)) + goto error; + skb_shinfo(skb)->gso_type |= gso_type_mask; + return skb; + } + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + /* If packet is not gso and we are resolving any partial checksum, + * clear encapsulation flag. This allows setting CHECKSUM_PARTIAL + * on the outer header without confusing devices that implement + * NETIF_F_IP_CSUM with encapsulation. + */ + if (csum_help) + skb->encapsulation = 0; +#endif + + if (skb->ip_summed == CHECKSUM_PARTIAL && csum_help) { + err = skb_checksum_help(skb); + if (unlikely(err)) + goto error; + } else if (skb->ip_summed != CHECKSUM_PARTIAL) + skb->ip_summed = CHECKSUM_NONE; + + return skb; +error: + kfree_skb(skb); + return ERR_PTR(err); +} +EXPORT_SYMBOL_GPL(ovs_iptunnel_handle_offloads); + +int rpl_iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto) { if (unlikely(!pskb_may_pull(skb, hdr_len))) return -ENOMEM; @@ -116,5 +168,15 @@ skb->pkt_type = PACKET_HOST; return 0; } +EXPORT_SYMBOL_GPL(rpl_iptunnel_pull_header); #endif + +bool ovs_skb_is_encapsulated(struct sk_buff *skb) +{ + /* checking for inner protocol should be sufficient on newer kernel, but + * old kernel just set encapsulation bit. + */ + return ovs_skb_get_inner_protocol(skb) || skb_encapsulation(skb); +} +EXPORT_SYMBOL_GPL(ovs_skb_is_encapsulated); diff -Nru openvswitch-2.3.1/datapath/linux/compat/netdevice.c openvswitch-2.4.0~git20150623/datapath/linux/compat/netdevice.c --- openvswitch-2.3.1/datapath/linux/compat/netdevice.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/netdevice.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,8 @@ #include #include +#include + +#include "gso.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef HAVE_CAN_CHECKSUM_PROTOCOL @@ -55,7 +58,7 @@ if (protocol == htons(ETH_P_8021Q)) { struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; protocol = veh->h_vlan_encapsulated_proto; - } else if (!vlan_tx_tag_present(skb)) { + } else if (!skb_vlan_tag_present(skb)) { return harmonize_features(skb, protocol, features); } @@ -69,9 +72,13 @@ return harmonize_features(skb, protocol, features); } } +EXPORT_SYMBOL_GPL(rpl_netif_skb_features); +#endif /* kernel version < 2.6.38 */ -struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb, - netdev_features_t features) +#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION +struct sk_buff *rpl__skb_gso_segment(struct sk_buff *skb, + netdev_features_t features, + bool tx_path) { int vlan_depth = ETH_HLEN; __be16 type = skb->protocol; @@ -89,13 +96,24 @@ vlan_depth += VLAN_HLEN; } + if (eth_p_mpls(type)) + type = ovs_skb_get_inner_protocol(skb); + /* this hack needed to get regular skb_gso_segment() */ -#undef skb_gso_segment skb_proto = skb->protocol; skb->protocol = type; +#ifdef HAVE___SKB_GSO_SEGMENT +#undef __skb_gso_segment + skb_gso = __skb_gso_segment(skb, features, tx_path); +#else +#undef skb_gso_segment skb_gso = skb_gso_segment(skb, features); +#endif + skb->protocol = skb_proto; return skb_gso; } -#endif /* kernel version < 2.6.38 */ +EXPORT_SYMBOL_GPL(rpl__skb_gso_segment); + +#endif /* OVS_USE_COMPAT_GSO_SEGMENTATION */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/net_namespace.c openvswitch-2.4.0~git20150623/datapath/linux/compat/net_namespace.c --- openvswitch-2.3.1/datapath/linux/compat/net_namespace.c 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/net_namespace.c 2015-06-23 18:46:21.000000000 +0000 @@ -5,7 +5,7 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) -int compat_init_net(struct net *net, struct rpl_pernet_operations *pnet) +int ovs_compat_init_net(struct net *net, struct rpl_pernet_operations *pnet) { int err; void *ovs_net = kzalloc(pnet->size, GFP_KERNEL); @@ -28,8 +28,9 @@ kfree(ovs_net); return err; } +EXPORT_SYMBOL_GPL(ovs_compat_init_net); -void compat_exit_net(struct net *net, struct rpl_pernet_operations *pnet) +void ovs_compat_exit_net(struct net *net, struct rpl_pernet_operations *pnet) { void *ovs_net = net_generic(net, *pnet->id); @@ -37,4 +38,6 @@ pnet->exit(net); kfree(ovs_net); } +EXPORT_SYMBOL_GPL(ovs_compat_exit_net); + #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/reciprocal_div.c openvswitch-2.4.0~git20150623/datapath/linux/compat/reciprocal_div.c --- openvswitch-2.3.1/datapath/linux/compat/reciprocal_div.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/reciprocal_div.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,6 @@ #include #include +#include #include /* @@ -7,7 +8,7 @@ * include/linux/reciprocal_div.h */ -struct reciprocal_value reciprocal_value(u32 d) +struct reciprocal_value rpl_reciprocal_value(u32 d) { struct reciprocal_value R; u64 m; @@ -23,3 +24,4 @@ return R; } +EXPORT_SYMBOL_GPL(rpl_reciprocal_value); diff -Nru openvswitch-2.3.1/datapath/linux/compat/skbuff-openvswitch.c openvswitch-2.4.0~git20150623/datapath/linux/compat/skbuff-openvswitch.c --- openvswitch-2.3.1/datapath/linux/compat/skbuff-openvswitch.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/skbuff-openvswitch.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,9 @@ #include #include #include +#include + +#include "gso.h" #if !defined(HAVE_SKB_WARN_LRO) && defined(NETIF_F_LRO) @@ -34,7 +37,7 @@ * into skb_zerocopy(). */ unsigned int -skb_zerocopy_headlen(const struct sk_buff *from) +rpl_skb_zerocopy_headlen(const struct sk_buff *from) { unsigned int hlen = 0; @@ -48,6 +51,7 @@ return hlen; } +EXPORT_SYMBOL_GPL(rpl_skb_zerocopy_headlen); #ifndef HAVE_SKB_ZEROCOPY /** @@ -69,7 +73,7 @@ * -EFAULT: skb_copy_bits() found some problem with skb geometry */ int -skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, int hlen) +rpl_skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, int hlen) { int i, j = 0; int plen = 0; /* length of skb->head fragment */ @@ -122,5 +126,157 @@ return 0; } +EXPORT_SYMBOL_GPL(rpl_skb_zerocopy); +#endif +#endif + +#ifndef HAVE_SKB_ENSURE_WRITABLE +int rpl_skb_ensure_writable(struct sk_buff *skb, int write_len) +{ + if (!pskb_may_pull(skb, write_len)) + return -ENOMEM; + + if (!skb_cloned(skb) || skb_clone_writable(skb, write_len)) + return 0; + + return pskb_expand_head(skb, 0, 0, GFP_ATOMIC); +} +EXPORT_SYMBOL_GPL(rpl_skb_ensure_writable); +#endif + +#ifndef HAVE_SKB_VLAN_POP +/* remove VLAN header from packet and update csum accordingly. */ +static int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci) +{ + struct vlan_hdr *vhdr; + unsigned int offset = skb->data - skb_mac_header(skb); + int err; + + __skb_push(skb, offset); + err = skb_ensure_writable(skb, VLAN_ETH_HLEN); + if (unlikely(err)) + goto pull; + + skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN); + + vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN); + *vlan_tci = ntohs(vhdr->h_vlan_TCI); + + memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN); + __skb_pull(skb, VLAN_HLEN); + + vlan_set_encap_proto(skb, vhdr); + skb->mac_header += VLAN_HLEN; + + if (skb_network_offset(skb) < ETH_HLEN) + skb_set_network_header(skb, ETH_HLEN); + + skb_reset_mac_len(skb); +pull: + __skb_pull(skb, offset); + + return err; +} + +int rpl_skb_vlan_pop(struct sk_buff *skb) +{ + u16 vlan_tci; + __be16 vlan_proto; + int err; + + if (likely(skb_vlan_tag_present(skb))) { + skb->vlan_tci = 0; + } else { + if (unlikely((skb->protocol != htons(ETH_P_8021Q) && + skb->protocol != htons(ETH_P_8021AD)) || + skb->len < VLAN_ETH_HLEN)) + return 0; + + err = __skb_vlan_pop(skb, &vlan_tci); + if (err) + return err; + } + /* move next vlan tag to hw accel tag */ + if (likely((skb->protocol != htons(ETH_P_8021Q) && + skb->protocol != htons(ETH_P_8021AD)) || + skb->len < VLAN_ETH_HLEN)) + return 0; + + vlan_proto = htons(ETH_P_8021Q); + err = __skb_vlan_pop(skb, &vlan_tci); + if (unlikely(err)) + return err; + + __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci); + return 0; +} +EXPORT_SYMBOL_GPL(rpl_skb_vlan_pop); +#endif + +#ifndef HAVE_SKB_VLAN_PUSH +int rpl_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci) +{ + if (skb_vlan_tag_present(skb)) { + unsigned int offset = skb->data - skb_mac_header(skb); + int err; + + /* __vlan_insert_tag expect skb->data pointing to mac header. + * So change skb->data before calling it and change back to + * original position later + */ + __skb_push(skb, offset); + err = __vlan_insert_tag(skb, skb->vlan_proto, + skb_vlan_tag_get(skb)); + if (err) + return err; + skb->mac_len += VLAN_HLEN; + __skb_pull(skb, offset); + + if (skb->ip_summed == CHECKSUM_COMPLETE) + skb->csum = csum_add(skb->csum, csum_partial(skb->data + + (2 * ETH_ALEN), VLAN_HLEN, 0)); + } + __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci); + return 0; +} +EXPORT_SYMBOL_GPL(rpl_skb_vlan_push); +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +int rpl_pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, + gfp_t gfp_mask) +{ + int err; + int inner_mac_offset, inner_nw_offset, inner_transport_offset; + + inner_mac_offset = skb_inner_mac_offset(skb); + inner_nw_offset = skb_inner_network_offset(skb); + inner_transport_offset = ovs_skb_inner_transport_offset(skb); + +#undef pskb_expand_head + err = pskb_expand_head(skb, nhead, ntail, gfp_mask); + if (err) + return err; + + skb_set_inner_mac_header(skb, inner_mac_offset); + skb_set_inner_network_header(skb, inner_nw_offset); + skb_set_inner_transport_header(skb, inner_transport_offset); + + return 0; +} +EXPORT_SYMBOL(rpl_pskb_expand_head); + #endif + +#ifndef HAVE_KFREE_SKB_LIST +void rpl_kfree_skb_list(struct sk_buff *segs) +{ + while (segs) { + struct sk_buff *next = segs->next; + + kfree_skb(segs); + segs = next; + } +} +EXPORT_SYMBOL(rpl_kfree_skb_list); #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/stt.c openvswitch-2.4.0~git20150623/datapath/linux/compat/stt.c --- openvswitch-2.3.1/datapath/linux/compat/stt.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/stt.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1550 @@ +/* + * Stateless TCP Tunnel (STT) vport. + * + * Copyright (c) 2015 Nicira, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gso.h" + +#ifdef OVS_STT +#define STT_VER 0 + +#define STT_CSUM_VERIFIED BIT(0) +#define STT_CSUM_PARTIAL BIT(1) +#define STT_PROTO_IPV4 BIT(2) +#define STT_PROTO_TCP BIT(3) +#define STT_PROTO_TYPES (STT_PROTO_IPV4 | STT_PROTO_TCP) + +#define SUPPORTED_GSO_TYPES (SKB_GSO_TCPV4 | SKB_GSO_UDP | SKB_GSO_DODGY | \ + SKB_GSO_TCPV6) + +/* The length and offset of a fragment are encoded in the sequence number. + * STT_SEQ_LEN_SHIFT is the left shift needed to store the length. + * STT_SEQ_OFFSET_MASK is the mask to extract the offset. + */ +#define STT_SEQ_LEN_SHIFT 16 +#define STT_SEQ_OFFSET_MASK (BIT(STT_SEQ_LEN_SHIFT) - 1) + +/* The maximum amount of memory used to store packets waiting to be reassembled + * on a given CPU. Once this threshold is exceeded we will begin freeing the + * least recently used fragments. + */ +#define REASM_HI_THRESH (4 * 1024 * 1024) +/* The target for the high memory evictor. Once we have exceeded + * REASM_HI_THRESH, we will continue freeing fragments until we hit + * this limit. + */ +#define REASM_LO_THRESH (3 * 1024 * 1024) +/* The length of time a given packet has to be reassembled from the time the + * first fragment arrives. Once this limit is exceeded it becomes available + * for cleaning. + */ +#define FRAG_EXP_TIME (30 * HZ) +/* Number of hash entries. Each entry has only a single slot to hold a packet + * so if there are collisions, we will drop packets. This is allocated + * per-cpu and each entry consists of struct pkt_frag. + */ +#define FRAG_HASH_SHIFT 8 +#define FRAG_HASH_ENTRIES BIT(FRAG_HASH_SHIFT) +#define FRAG_HASH_SEGS ((sizeof(u32) * 8) / FRAG_HASH_SHIFT) + +#define CLEAN_PERCPU_INTERVAL (30 * HZ) + +struct pkt_key { + __be32 saddr; + __be32 daddr; + __be32 pkt_seq; + u32 mark; +}; + +struct pkt_frag { + struct sk_buff *skbs; + unsigned long timestamp; + struct list_head lru_node; + struct pkt_key key; +}; + +struct stt_percpu { + struct flex_array *frag_hash; + struct list_head frag_lru; + unsigned int frag_mem_used; + + /* Protect frags table. */ + spinlock_t lock; +}; + +struct first_frag { + struct sk_buff *last_skb; + unsigned int mem_used; + u16 tot_len; + u16 rcvd_len; + bool set_ecn_ce; +}; + +struct frag_skb_cb { + u16 offset; + + /* Only valid for the first skb in the chain. */ + struct first_frag first; +}; + +#define FRAG_CB(skb) ((struct frag_skb_cb *)(skb)->cb) + +/* per-network namespace private data for this module */ +struct stt_net { + struct list_head sock_list; +}; + +static int stt_net_id; + +static struct stt_percpu __percpu *stt_percpu_data __read_mostly; +static u32 frag_hash_seed __read_mostly; + +/* Protects sock-hash and refcounts. */ +static DEFINE_MUTEX(stt_mutex); + +static int n_tunnels; +static DEFINE_PER_CPU(u32, pkt_seq_counter); + +static void clean_percpu(struct work_struct *work); +static DECLARE_DELAYED_WORK(clean_percpu_wq, clean_percpu); + +static struct stt_sock *stt_find_sock(struct net *net, __be16 port) +{ + struct stt_net *sn = net_generic(net, stt_net_id); + struct stt_sock *stt_sock; + + list_for_each_entry_rcu(stt_sock, &sn->sock_list, list) { + if (inet_sk(stt_sock->sock->sk)->inet_sport == port) + return stt_sock; + } + return NULL; +} + +static __be32 ack_seq(void) +{ +#if NR_CPUS <= 65536 + u32 pkt_seq, ack; + + pkt_seq = this_cpu_read(pkt_seq_counter); + ack = pkt_seq << ilog2(NR_CPUS) | smp_processor_id(); + this_cpu_inc(pkt_seq_counter); + + return (__force __be32)ack; +#else +#error "Support for greater than 64k CPUs not implemented" +#endif +} + +static int clear_gso(struct sk_buff *skb) +{ + struct skb_shared_info *shinfo = skb_shinfo(skb); + int err; + + if (shinfo->gso_type == 0 && shinfo->gso_size == 0 && + shinfo->gso_segs == 0) + return 0; + + err = skb_unclone(skb, GFP_ATOMIC); + if (unlikely(err)) + return err; + + shinfo = skb_shinfo(skb); + shinfo->gso_type = 0; + shinfo->gso_size = 0; + shinfo->gso_segs = 0; + return 0; +} + +static struct sk_buff *normalize_frag_list(struct sk_buff *head, + struct sk_buff **skbp) +{ + struct sk_buff *skb = *skbp; + struct sk_buff *last; + + do { + struct sk_buff *frags; + + if (skb_shared(skb)) { + struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); + + if (unlikely(!nskb)) + return ERR_PTR(-ENOMEM); + + nskb->next = skb->next; + consume_skb(skb); + skb = nskb; + *skbp = skb; + } + + if (head) { + head->len -= skb->len; + head->data_len -= skb->len; + head->truesize -= skb->truesize; + } + + frags = skb_shinfo(skb)->frag_list; + if (frags) { + int err; + + err = skb_unclone(skb, GFP_ATOMIC); + if (unlikely(err)) + return ERR_PTR(err); + + last = normalize_frag_list(skb, &frags); + if (IS_ERR(last)) + return last; + + skb_shinfo(skb)->frag_list = NULL; + last->next = skb->next; + skb->next = frags; + } else { + last = skb; + } + + skbp = &skb->next; + } while ((skb = skb->next)); + + return last; +} + +/* Takes a linked list of skbs, which potentially contain frag_list + * (whose members in turn potentially contain frag_lists, etc.) and + * converts them into a single linear linked list. + */ +static int straighten_frag_list(struct sk_buff **skbp) +{ + struct sk_buff *err_skb; + + err_skb = normalize_frag_list(NULL, skbp); + if (IS_ERR(err_skb)) + return PTR_ERR(err_skb); + + return 0; +} + +static void copy_skb_metadata(struct sk_buff *to, struct sk_buff *from) +{ + to->protocol = from->protocol; + to->tstamp = from->tstamp; + to->priority = from->priority; + to->mark = from->mark; + to->vlan_tci = from->vlan_tci; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + to->vlan_proto = from->vlan_proto; +#endif + skb_copy_secmark(to, from); +} + +static void update_headers(struct sk_buff *skb, bool head, + unsigned int l4_offset, unsigned int hdr_len, + bool ipv4, u32 tcp_seq) +{ + u16 old_len, new_len; + __be32 delta; + struct tcphdr *tcph; + int gso_size; + + if (ipv4) { + struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN); + + old_len = ntohs(iph->tot_len); + new_len = skb->len - ETH_HLEN; + iph->tot_len = htons(new_len); + + ip_send_check(iph); + } else { + struct ipv6hdr *ip6h = (struct ipv6hdr *)(skb->data + ETH_HLEN); + + old_len = ntohs(ip6h->payload_len); + new_len = skb->len - ETH_HLEN - sizeof(struct ipv6hdr); + ip6h->payload_len = htons(new_len); + } + + tcph = (struct tcphdr *)(skb->data + l4_offset); + if (!head) { + tcph->seq = htonl(tcp_seq); + tcph->cwr = 0; + } + + if (skb->next) { + tcph->fin = 0; + tcph->psh = 0; + } + + delta = htonl(~old_len + new_len); + tcph->check = ~csum_fold((__force __wsum)((__force u32)tcph->check + + (__force u32)delta)); + + gso_size = skb_shinfo(skb)->gso_size; + if (gso_size && skb->len - hdr_len <= gso_size) + BUG_ON(clear_gso(skb)); +} + +static bool can_segment(struct sk_buff *head, bool ipv4, bool tcp, bool csum_partial) +{ + /* If no offloading is in use then we don't have enough information + * to process the headers. + */ + if (!csum_partial) + goto linearize; + + /* Handling UDP packets requires IP fragmentation, which means that + * the L4 checksum can no longer be calculated by hardware (since the + * fragments are in different packets. If we have to compute the + * checksum it's faster just to linearize and large UDP packets are + * pretty uncommon anyways, so it's not worth dealing with for now. + */ + if (!tcp) + goto linearize; + + if (ipv4) { + struct iphdr *iph = (struct iphdr *)(head->data + ETH_HLEN); + + /* It's difficult to get the IP IDs exactly right here due to + * varying segment sizes and potentially multiple layers of + * segmentation. IP ID isn't important when DF is set and DF + * is generally set for TCP packets, so just linearize if it's + * not. + */ + if (!(iph->frag_off & htons(IP_DF))) + goto linearize; + } else { + struct ipv6hdr *ip6h = (struct ipv6hdr *)(head->data + ETH_HLEN); + + /* Jumbograms require more processing to update and we'll + * probably never see them, so just linearize. + */ + if (ip6h->payload_len == 0) + goto linearize; + } + return true; + +linearize: + return false; +} + +static int copy_headers(struct sk_buff *head, struct sk_buff *frag, + int hdr_len) +{ + u16 csum_start; + + if (skb_cloned(frag) || skb_headroom(frag) < hdr_len) { + int extra_head = hdr_len - skb_headroom(frag); + + extra_head = extra_head > 0 ? extra_head : 0; + if (unlikely(pskb_expand_head(frag, extra_head, 0, + GFP_ATOMIC))) + return -ENOMEM; + } + + memcpy(__skb_push(frag, hdr_len), head->data, hdr_len); + + csum_start = head->csum_start - skb_headroom(head); + frag->csum_start = skb_headroom(frag) + csum_start; + frag->csum_offset = head->csum_offset; + frag->ip_summed = head->ip_summed; + + skb_shinfo(frag)->gso_size = skb_shinfo(head)->gso_size; + skb_shinfo(frag)->gso_type = skb_shinfo(head)->gso_type; + skb_shinfo(frag)->gso_segs = 0; + + copy_skb_metadata(frag, head); + return 0; +} + +static int skb_list_segment(struct sk_buff *head, bool ipv4, int l4_offset) +{ + struct sk_buff *skb; + struct tcphdr *tcph; + int seg_len; + int hdr_len; + int tcp_len; + u32 seq; + + if (unlikely(!pskb_may_pull(head, l4_offset + sizeof(*tcph)))) + return -ENOMEM; + + tcph = (struct tcphdr *)(head->data + l4_offset); + tcp_len = tcph->doff * 4; + hdr_len = l4_offset + tcp_len; + + if (unlikely((tcp_len < sizeof(struct tcphdr)) || + (head->len < hdr_len))) + return -EINVAL; + + if (unlikely(!pskb_may_pull(head, hdr_len))) + return -ENOMEM; + + tcph = (struct tcphdr *)(head->data + l4_offset); + /* Update header of each segment. */ + seq = ntohl(tcph->seq); + seg_len = skb_pagelen(head) - hdr_len; + + skb = skb_shinfo(head)->frag_list; + skb_shinfo(head)->frag_list = NULL; + head->next = skb; + for (; skb; skb = skb->next) { + int err; + + head->len -= skb->len; + head->data_len -= skb->len; + head->truesize -= skb->truesize; + + seq += seg_len; + seg_len = skb->len; + err = copy_headers(head, skb, hdr_len); + if (err) + return err; + update_headers(skb, false, l4_offset, hdr_len, ipv4, seq); + } + update_headers(head, true, l4_offset, hdr_len, ipv4, 0); + return 0; +} + +static int coalesce_skb(struct sk_buff **headp) +{ + struct sk_buff *frag, *head, *prev; + int err; + + err = straighten_frag_list(headp); + if (unlikely(err)) + return err; + head = *headp; + + /* Coalesce frag list. */ + prev = head; + for (frag = head->next; frag; frag = frag->next) { + bool headstolen; + int delta; + + if (unlikely(skb_unclone(prev, GFP_ATOMIC))) + return -ENOMEM; + + if (!skb_try_coalesce(prev, frag, &headstolen, &delta)) { + prev = frag; + continue; + } + + prev->next = frag->next; + frag->len = 0; + frag->data_len = 0; + frag->truesize -= delta; + kfree_skb_partial(frag, headstolen); + frag = prev; + } + + if (!head->next) + return 0; + + for (frag = head->next; frag; frag = frag->next) { + head->len += frag->len; + head->data_len += frag->len; + head->truesize += frag->truesize; + } + + skb_shinfo(head)->frag_list = head->next; + head->next = NULL; + return 0; +} + +static int __try_to_segment(struct sk_buff *skb, bool csum_partial, + bool ipv4, bool tcp, int l4_offset) +{ + if (can_segment(skb, ipv4, tcp, csum_partial)) + return skb_list_segment(skb, ipv4, l4_offset); + else + return skb_linearize(skb); +} + +static int try_to_segment(struct sk_buff *skb) +{ + struct stthdr *stth = stt_hdr(skb); + bool csum_partial = !!(stth->flags & STT_CSUM_PARTIAL); + bool ipv4 = !!(stth->flags & STT_PROTO_IPV4); + bool tcp = !!(stth->flags & STT_PROTO_TCP); + int l4_offset = stth->l4_offset; + + return __try_to_segment(skb, csum_partial, ipv4, tcp, l4_offset); +} + +static int segment_skb(struct sk_buff **headp, bool csum_partial, + bool ipv4, bool tcp, int l4_offset) +{ + int err; + + err = coalesce_skb(headp); + if (err) + return err; + + if (skb_shinfo(*headp)->frag_list) + return __try_to_segment(*headp, csum_partial, + ipv4, tcp, l4_offset); + return 0; +} + +static int __push_stt_header(struct sk_buff *skb, __be64 tun_id, + __be16 s_port, __be16 d_port, + __be32 saddr, __be32 dst, + __be16 l3_proto, u8 l4_proto, + int dst_mtu) +{ + int data_len = skb->len + sizeof(struct stthdr) + STT_ETH_PAD; + unsigned short encap_mss; + struct tcphdr *tcph; + struct stthdr *stth; + + skb_push(skb, STT_HEADER_LEN); + skb_reset_transport_header(skb); + tcph = tcp_hdr(skb); + memset(tcph, 0, STT_HEADER_LEN); + stth = stt_hdr(skb); + + if (skb->ip_summed == CHECKSUM_PARTIAL) { + stth->flags |= STT_CSUM_PARTIAL; + + stth->l4_offset = skb->csum_start - + (skb_headroom(skb) + + STT_HEADER_LEN); + + if (l3_proto == htons(ETH_P_IP)) + stth->flags |= STT_PROTO_IPV4; + + if (l4_proto == IPPROTO_TCP) + stth->flags |= STT_PROTO_TCP; + + stth->mss = htons(skb_shinfo(skb)->gso_size); + } else if (skb->ip_summed == CHECKSUM_UNNECESSARY) { + stth->flags |= STT_CSUM_VERIFIED; + } + + stth->vlan_tci = htons(skb->vlan_tci); + skb->vlan_tci = 0; + put_unaligned(tun_id, &stth->key); + + tcph->source = s_port; + tcph->dest = d_port; + tcph->doff = sizeof(struct tcphdr) / 4; + tcph->ack = 1; + tcph->psh = 1; + tcph->window = htons(USHRT_MAX); + tcph->seq = htonl(data_len << STT_SEQ_LEN_SHIFT); + tcph->ack_seq = ack_seq(); + tcph->check = ~tcp_v4_check(skb->len, saddr, dst, 0); + + skb->csum_start = skb_transport_header(skb) - skb->head; + skb->csum_offset = offsetof(struct tcphdr, check); + skb->ip_summed = CHECKSUM_PARTIAL; + + encap_mss = dst_mtu - sizeof(struct iphdr) - sizeof(struct tcphdr); + if (data_len > encap_mss) { + if (unlikely(skb_unclone(skb, GFP_ATOMIC))) + return -EINVAL; + + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; + skb_shinfo(skb)->gso_size = encap_mss; + skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(data_len, encap_mss); + } else { + if (unlikely(clear_gso(skb))) + return -EINVAL; + } + return 0; +} + +static struct sk_buff *push_stt_header(struct sk_buff *head, __be64 tun_id, + __be16 s_port, __be16 d_port, + __be32 saddr, __be32 dst, + __be16 l3_proto, u8 l4_proto, + int dst_mtu) +{ + struct sk_buff *skb; + + if (skb_shinfo(head)->frag_list) { + bool ipv4 = (l3_proto == htons(ETH_P_IP)); + bool tcp = (l4_proto == IPPROTO_TCP); + bool csum_partial = (head->ip_summed == CHECKSUM_PARTIAL); + int l4_offset = skb_transport_offset(head); + + /* Need to call skb_orphan() to report currect true-size. + * calling skb_orphan() in this layer is odd but SKB with + * frag-list should not be associated with any socket, so + * skb-orphan should be no-op. */ + skb_orphan(head); + if (unlikely(segment_skb(&head, csum_partial, + ipv4, tcp, l4_offset))) + goto error; + } + + for (skb = head; skb; skb = skb->next) { + if (__push_stt_header(skb, tun_id, s_port, d_port, saddr, dst, + l3_proto, l4_proto, dst_mtu)) + goto error; + } + + return head; +error: + kfree_skb_list(head); + return NULL; +} + +static int stt_can_offload(struct sk_buff *skb, __be16 l3_proto, u8 l4_proto) +{ + if (skb_is_gso(skb) && skb->ip_summed != CHECKSUM_PARTIAL) { + int csum_offset; + __sum16 *csum; + int len; + + if (l4_proto == IPPROTO_TCP) + csum_offset = offsetof(struct tcphdr, check); + else if (l4_proto == IPPROTO_UDP) + csum_offset = offsetof(struct udphdr, check); + else + return 0; + + len = skb->len - skb_transport_offset(skb); + csum = (__sum16 *)(skb_transport_header(skb) + csum_offset); + + if (unlikely(!pskb_may_pull(skb, skb_transport_offset(skb) + + csum_offset + sizeof(*csum)))) + return -EINVAL; + + if (l3_proto == htons(ETH_P_IP)) { + struct iphdr *iph = ip_hdr(skb); + + *csum = ~csum_tcpudp_magic(iph->saddr, iph->daddr, + len, l4_proto, 0); + } else if (l3_proto == htons(ETH_P_IPV6)) { + struct ipv6hdr *ip6h = ipv6_hdr(skb); + + *csum = ~csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, + len, l4_proto, 0); + } else { + return 0; + } + skb->csum_start = skb_transport_header(skb) - skb->head; + skb->csum_offset = csum_offset; + skb->ip_summed = CHECKSUM_PARTIAL; + } + + if (skb->ip_summed == CHECKSUM_PARTIAL) { + /* Assume receiver can only offload TCP/UDP over IPv4/6, + * and require 802.1Q VLANs to be accelerated. + */ + if (l3_proto != htons(ETH_P_IP) && + l3_proto != htons(ETH_P_IPV6)) + return 0; + + if (l4_proto != IPPROTO_TCP && l4_proto != IPPROTO_UDP) + return 0; + + /* L4 offset must fit in a 1-byte field. */ + if (skb->csum_start - skb_headroom(skb) > 255) + return 0; + + if (skb_shinfo(skb)->gso_type & ~SUPPORTED_GSO_TYPES) + return 0; + } + /* Total size of encapsulated packet must fit in 16 bits. */ + if (skb->len + STT_HEADER_LEN + sizeof(struct iphdr) > 65535) + return 0; + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + if (skb_vlan_tag_present(skb) && skb->vlan_proto != htons(ETH_P_8021Q)) + return 0; +#endif + return 1; +} + +static bool need_linearize(const struct sk_buff *skb) +{ + struct skb_shared_info *shinfo = skb_shinfo(skb); + int i; + + if (unlikely(shinfo->frag_list)) + return true; + + /* Generally speaking we should linearize if there are paged frags. + * However, if all of the refcounts are 1 we know nobody else can + * change them from underneath us and we can skip the linearization. + */ + for (i = 0; i < shinfo->nr_frags; i++) + if (unlikely(page_count(skb_frag_page(&shinfo->frags[i])) > 1)) + return true; + + return false; +} + +static struct sk_buff *handle_offloads(struct sk_buff *skb, int min_headroom) +{ + int err; + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + if (skb_vlan_tag_present(skb) && skb->vlan_proto != htons(ETH_P_8021Q)) { + + min_headroom += VLAN_HLEN; + if (skb_headroom(skb) < min_headroom) { + int head_delta = SKB_DATA_ALIGN(min_headroom - + skb_headroom(skb) + 16); + + err = pskb_expand_head(skb, max_t(int, head_delta, 0), + 0, GFP_ATOMIC); + if (unlikely(err)) + goto error; + } + + skb = __vlan_hwaccel_push_inside(skb); + if (!skb) { + err = -ENOMEM; + goto error; + } + } +#endif + + if (skb_is_gso(skb)) { + struct sk_buff *nskb; + char cb[sizeof(skb->cb)]; + + memcpy(cb, skb->cb, sizeof(cb)); + + nskb = __skb_gso_segment(skb, 0, false); + if (IS_ERR(nskb)) { + err = PTR_ERR(nskb); + goto error; + } + + consume_skb(skb); + skb = nskb; + while (nskb) { + memcpy(nskb->cb, cb, sizeof(cb)); + nskb = nskb->next; + } + } else if (skb->ip_summed == CHECKSUM_PARTIAL) { + /* Pages aren't locked and could change at any time. + * If this happens after we compute the checksum, the + * checksum will be wrong. We linearize now to avoid + * this problem. + */ + if (unlikely(need_linearize(skb))) { + err = __skb_linearize(skb); + if (unlikely(err)) + goto error; + } + + err = skb_checksum_help(skb); + if (unlikely(err)) + goto error; + } + skb->ip_summed = CHECKSUM_NONE; + + return skb; +error: + kfree_skb(skb); + return ERR_PTR(err); +} + +static int skb_list_xmit(struct rtable *rt, struct sk_buff *skb, __be32 src, + __be32 dst, __u8 tos, __u8 ttl, __be16 df) +{ + int len = 0; + + while (skb) { + struct sk_buff *next = skb->next; + + if (next) + dst_clone(&rt->dst); + + skb_clear_ovs_gso_cb(skb); + skb->next = NULL; + len += iptunnel_xmit(NULL, rt, skb, src, dst, IPPROTO_TCP, + tos, ttl, df, false); + + skb = next; + } + return len; +} + +static u8 parse_ipv6_l4_proto(struct sk_buff *skb) +{ + unsigned int nh_ofs = skb_network_offset(skb); + int payload_ofs; + struct ipv6hdr *nh; + uint8_t nexthdr; + __be16 frag_off; + + if (unlikely(!pskb_may_pull(skb, nh_ofs + sizeof(struct ipv6hdr)))) + return 0; + + nh = ipv6_hdr(skb); + nexthdr = nh->nexthdr; + payload_ofs = (u8 *)(nh + 1) - skb->data; + + payload_ofs = ipv6_skip_exthdr(skb, payload_ofs, &nexthdr, &frag_off); + if (unlikely(payload_ofs < 0)) + return 0; + + return nexthdr; +} + +static u8 skb_get_l4_proto(struct sk_buff *skb, __be16 l3_proto) +{ + if (l3_proto == htons(ETH_P_IP)) { + unsigned int nh_ofs = skb_network_offset(skb); + + if (unlikely(!pskb_may_pull(skb, nh_ofs + sizeof(struct iphdr)))) + return 0; + + return ip_hdr(skb)->protocol; + } else if (l3_proto == htons(ETH_P_IPV6)) { + return parse_ipv6_l4_proto(skb); + } + return 0; +} + +int rpl_stt_xmit_skb(struct sk_buff *skb, struct rtable *rt, + __be32 src, __be32 dst, __u8 tos, + __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, + __be64 tun_id) +{ + struct ethhdr *eh = eth_hdr(skb); + int ret = 0, min_headroom; + __be16 inner_l3_proto; + u8 inner_l4_proto; + + inner_l3_proto = eh->h_proto; + inner_l4_proto = skb_get_l4_proto(skb, inner_l3_proto); + + min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len + + STT_HEADER_LEN + sizeof(struct iphdr); + + if (skb_headroom(skb) < min_headroom || skb_header_cloned(skb)) { + int head_delta = SKB_DATA_ALIGN(min_headroom - + skb_headroom(skb) + + 16); + + ret = pskb_expand_head(skb, max_t(int, head_delta, 0), + 0, GFP_ATOMIC); + if (unlikely(ret)) + goto err_free_rt; + } + + ret = stt_can_offload(skb, inner_l3_proto, inner_l4_proto); + if (ret < 0) + goto err_free_rt; + if (!ret) { + skb = handle_offloads(skb, min_headroom); + if (IS_ERR(skb)) { + ret = PTR_ERR(skb); + skb = NULL; + goto err_free_rt; + } + } + + ret = 0; + while (skb) { + struct sk_buff *next_skb = skb->next; + + skb->next = NULL; + + if (next_skb) + dst_clone(&rt->dst); + + /* Push STT and TCP header. */ + skb = push_stt_header(skb, tun_id, src_port, dst_port, src, + dst, inner_l3_proto, inner_l4_proto, + dst_mtu(&rt->dst)); + if (unlikely(!skb)) { + ip_rt_put(rt); + goto next; + } + + /* Push IP header. */ + ret += skb_list_xmit(rt, skb, src, dst, tos, ttl, df); + +next: + skb = next_skb; + } + + return ret; + +err_free_rt: + ip_rt_put(rt); + kfree_skb(skb); + return ret; +} +EXPORT_SYMBOL_GPL(rpl_stt_xmit_skb); + +static void free_frag(struct stt_percpu *stt_percpu, + struct pkt_frag *frag) +{ + stt_percpu->frag_mem_used -= FRAG_CB(frag->skbs)->first.mem_used; + kfree_skb_list(frag->skbs); + list_del(&frag->lru_node); + frag->skbs = NULL; +} + +static void evict_frags(struct stt_percpu *stt_percpu) +{ + while (!list_empty(&stt_percpu->frag_lru) && + stt_percpu->frag_mem_used > REASM_LO_THRESH) { + struct pkt_frag *frag; + + frag = list_first_entry(&stt_percpu->frag_lru, + struct pkt_frag, + lru_node); + free_frag(stt_percpu, frag); + } +} + +static bool pkt_key_match(struct net *net, + const struct pkt_frag *a, const struct pkt_key *b) +{ + return a->key.saddr == b->saddr && a->key.daddr == b->daddr && + a->key.pkt_seq == b->pkt_seq && a->key.mark == b->mark && + net_eq(dev_net(a->skbs->dev), net); +} + +static u32 pkt_key_hash(const struct net *net, const struct pkt_key *key) +{ + u32 initval = frag_hash_seed ^ (u32)(unsigned long)net ^ key->mark; + + return jhash_3words((__force u32)key->saddr, (__force u32)key->daddr, + (__force u32)key->pkt_seq, initval); +} + +static struct pkt_frag *lookup_frag(struct net *net, + struct stt_percpu *stt_percpu, + const struct pkt_key *key, u32 hash) +{ + struct pkt_frag *frag, *victim_frag = NULL; + int i; + + for (i = 0; i < FRAG_HASH_SEGS; i++) { + frag = flex_array_get(stt_percpu->frag_hash, + hash & (FRAG_HASH_ENTRIES - 1)); + + if (frag->skbs && + time_before(jiffies, frag->timestamp + FRAG_EXP_TIME) && + pkt_key_match(net, frag, key)) + return frag; + + if (!victim_frag || + (victim_frag->skbs && + (!frag->skbs || + time_before(frag->timestamp, victim_frag->timestamp)))) + victim_frag = frag; + + hash >>= FRAG_HASH_SHIFT; + } + + if (victim_frag->skbs) + free_frag(stt_percpu, victim_frag); + + return victim_frag; +} + +static struct sk_buff *reassemble(struct sk_buff *skb) +{ + struct iphdr *iph = ip_hdr(skb); + struct tcphdr *tcph = tcp_hdr(skb); + u32 seq = ntohl(tcph->seq); + struct stt_percpu *stt_percpu; + struct sk_buff *last_skb; + struct pkt_frag *frag; + struct pkt_key key; + int tot_len; + u32 hash; + + tot_len = seq >> STT_SEQ_LEN_SHIFT; + FRAG_CB(skb)->offset = seq & STT_SEQ_OFFSET_MASK; + + if (unlikely(skb->len == 0)) + goto out_free; + + if (unlikely(FRAG_CB(skb)->offset + skb->len > tot_len)) + goto out_free; + + if (tot_len == skb->len) + goto out; + + key.saddr = iph->saddr; + key.daddr = iph->daddr; + key.pkt_seq = tcph->ack_seq; + key.mark = skb->mark; + hash = pkt_key_hash(dev_net(skb->dev), &key); + + stt_percpu = per_cpu_ptr(stt_percpu_data, smp_processor_id()); + + spin_lock(&stt_percpu->lock); + + if (unlikely(stt_percpu->frag_mem_used + skb->truesize > REASM_HI_THRESH)) + evict_frags(stt_percpu); + + frag = lookup_frag(dev_net(skb->dev), stt_percpu, &key, hash); + if (!frag->skbs) { + frag->skbs = skb; + frag->key = key; + frag->timestamp = jiffies; + FRAG_CB(skb)->first.last_skb = skb; + FRAG_CB(skb)->first.mem_used = skb->truesize; + FRAG_CB(skb)->first.tot_len = tot_len; + FRAG_CB(skb)->first.rcvd_len = skb->len; + FRAG_CB(skb)->first.set_ecn_ce = false; + list_add_tail(&frag->lru_node, &stt_percpu->frag_lru); + stt_percpu->frag_mem_used += skb->truesize; + + skb = NULL; + goto unlock; + } + + /* Optimize for the common case where fragments are received in-order + * and not overlapping. + */ + last_skb = FRAG_CB(frag->skbs)->first.last_skb; + if (likely(FRAG_CB(last_skb)->offset + last_skb->len == + FRAG_CB(skb)->offset)) { + last_skb->next = skb; + FRAG_CB(frag->skbs)->first.last_skb = skb; + } else { + struct sk_buff *prev = NULL, *next; + + for (next = frag->skbs; next; next = next->next) { + if (FRAG_CB(next)->offset >= FRAG_CB(skb)->offset) + break; + prev = next; + } + + /* Overlapping fragments aren't allowed. We shouldn't start + * before the end of the previous fragment. + */ + if (prev && + FRAG_CB(prev)->offset + prev->len > FRAG_CB(skb)->offset) + goto unlock_free; + + /* We also shouldn't end after the beginning of the next + * fragment. + */ + if (next && + FRAG_CB(skb)->offset + skb->len > FRAG_CB(next)->offset) + goto unlock_free; + + if (prev) { + prev->next = skb; + } else { + FRAG_CB(skb)->first = FRAG_CB(frag->skbs)->first; + frag->skbs = skb; + } + + if (next) + skb->next = next; + else + FRAG_CB(frag->skbs)->first.last_skb = skb; + } + + FRAG_CB(frag->skbs)->first.set_ecn_ce |= INET_ECN_is_ce(iph->tos); + FRAG_CB(frag->skbs)->first.rcvd_len += skb->len; + FRAG_CB(frag->skbs)->first.mem_used += skb->truesize; + stt_percpu->frag_mem_used += skb->truesize; + + if (FRAG_CB(frag->skbs)->first.tot_len == + FRAG_CB(frag->skbs)->first.rcvd_len) { + struct sk_buff *frag_head = frag->skbs; + + frag_head->tstamp = skb->tstamp; + if (FRAG_CB(frag_head)->first.set_ecn_ce) + INET_ECN_set_ce(frag_head); + + list_del(&frag->lru_node); + stt_percpu->frag_mem_used -= FRAG_CB(frag_head)->first.mem_used; + frag->skbs = NULL; + skb = frag_head; + } else { + list_move_tail(&frag->lru_node, &stt_percpu->frag_lru); + skb = NULL; + } + + goto unlock; + +unlock_free: + kfree_skb(skb); + skb = NULL; +unlock: + spin_unlock(&stt_percpu->lock); + return skb; +out_free: + kfree_skb(skb); + skb = NULL; +out: + return skb; +} + +static bool validate_checksum(struct sk_buff *skb) +{ + struct iphdr *iph = ip_hdr(skb); + + if (skb_csum_unnecessary(skb)) + return true; + + if (skb->ip_summed == CHECKSUM_COMPLETE && + !tcp_v4_check(skb->len, iph->saddr, iph->daddr, skb->csum)) + return true; + + skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, skb->len, + IPPROTO_TCP, 0); + + return __tcp_checksum_complete(skb) == 0; +} + +static bool set_offloads(struct sk_buff *skb) +{ + struct stthdr *stth = stt_hdr(skb); + unsigned short gso_type; + int l3_header_size; + int l4_header_size; + u16 csum_offset; + u8 proto_type; + + if (stth->vlan_tci) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), + ntohs(stth->vlan_tci)); + + if (!(stth->flags & STT_CSUM_PARTIAL)) { + if (stth->flags & STT_CSUM_VERIFIED) + skb->ip_summed = CHECKSUM_UNNECESSARY; + else + skb->ip_summed = CHECKSUM_NONE; + + return clear_gso(skb) == 0; + } + + proto_type = stth->flags & STT_PROTO_TYPES; + + switch (proto_type) { + case (STT_PROTO_IPV4 | STT_PROTO_TCP): + /* TCP/IPv4 */ + csum_offset = offsetof(struct tcphdr, check); + gso_type = SKB_GSO_TCPV4; + l3_header_size = sizeof(struct iphdr); + l4_header_size = sizeof(struct tcphdr); + skb->protocol = htons(ETH_P_IP); + break; + case STT_PROTO_TCP: + /* TCP/IPv6 */ + csum_offset = offsetof(struct tcphdr, check); + gso_type = SKB_GSO_TCPV6; + l3_header_size = sizeof(struct ipv6hdr); + l4_header_size = sizeof(struct tcphdr); + skb->protocol = htons(ETH_P_IPV6); + break; + case STT_PROTO_IPV4: + /* UDP/IPv4 */ + csum_offset = offsetof(struct udphdr, check); + gso_type = SKB_GSO_UDP; + l3_header_size = sizeof(struct iphdr); + l4_header_size = sizeof(struct udphdr); + skb->protocol = htons(ETH_P_IP); + break; + default: + /* UDP/IPv6 */ + csum_offset = offsetof(struct udphdr, check); + gso_type = SKB_GSO_UDP; + l3_header_size = sizeof(struct ipv6hdr); + l4_header_size = sizeof(struct udphdr); + skb->protocol = htons(ETH_P_IPV6); + } + + if (unlikely(stth->l4_offset < ETH_HLEN + l3_header_size)) + return false; + + if (unlikely(!pskb_may_pull(skb, stth->l4_offset + l4_header_size))) + return false; + + stth = stt_hdr(skb); + + skb->csum_start = skb_headroom(skb) + stth->l4_offset; + skb->csum_offset = csum_offset; + skb->ip_summed = CHECKSUM_PARTIAL; + + if (stth->mss) { + if (unlikely(skb_unclone(skb, GFP_ATOMIC))) + return false; + + skb_shinfo(skb)->gso_type = gso_type | SKB_GSO_DODGY; + skb_shinfo(skb)->gso_size = ntohs(stth->mss); + skb_shinfo(skb)->gso_segs = 0; + } else { + if (unlikely(clear_gso(skb))) + return false; + } + + return true; +} +static void stt_rcv(struct stt_sock *stt_sock, struct sk_buff *skb) +{ + int err; + + if (unlikely(!validate_checksum(skb))) + goto drop; + + skb = reassemble(skb); + if (!skb) + return; + + if (skb->next && coalesce_skb(&skb)) + goto drop; + + err = iptunnel_pull_header(skb, + sizeof(struct stthdr) + STT_ETH_PAD, + htons(ETH_P_TEB)); + if (unlikely(err)) + goto drop; + + if (unlikely(stt_hdr(skb)->version != 0)) + goto drop; + + if (unlikely(!set_offloads(skb))) + goto drop; + + if (skb_shinfo(skb)->frag_list && try_to_segment(skb)) + goto drop; + + stt_sock->rcv(stt_sock, skb); + return; +drop: + /* Consume bad packet */ + kfree_skb_list(skb); +} + +static void tcp_sock_release(struct socket *sock) +{ + kernel_sock_shutdown(sock, SHUT_RDWR); + sk_release_kernel(sock->sk); +} + +static int tcp_sock_create4(struct net *net, __be16 port, + struct socket **sockp) +{ + struct sockaddr_in tcp_addr; + struct socket *sock = NULL; + int err; + + err = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock); + if (err < 0) + goto error; + + sk_change_net(sock->sk, net); + + memset(&tcp_addr, 0, sizeof(tcp_addr)); + tcp_addr.sin_family = AF_INET; + tcp_addr.sin_addr.s_addr = htonl(INADDR_ANY); + tcp_addr.sin_port = port; + err = kernel_bind(sock, (struct sockaddr *)&tcp_addr, + sizeof(tcp_addr)); + if (err < 0) + goto error; + + *sockp = sock; + return 0; + +error: + if (sock) + tcp_sock_release(sock); + *sockp = NULL; + return err; +} + +static void schedule_clean_percpu(void) +{ + schedule_delayed_work(&clean_percpu_wq, CLEAN_PERCPU_INTERVAL); +} + +static void clean_percpu(struct work_struct *work) +{ + int i; + + for_each_possible_cpu(i) { + struct stt_percpu *stt_percpu = per_cpu_ptr(stt_percpu_data, i); + int j; + + for (j = 0; j < FRAG_HASH_ENTRIES; j++) { + struct pkt_frag *frag; + + frag = flex_array_get(stt_percpu->frag_hash, j); + if (!frag->skbs || + time_before(jiffies, frag->timestamp + FRAG_EXP_TIME)) + continue; + + spin_lock_bh(&stt_percpu->lock); + + if (frag->skbs && + time_after(jiffies, frag->timestamp + FRAG_EXP_TIME)) + free_frag(stt_percpu, frag); + + spin_unlock_bh(&stt_percpu->lock); + } + } + schedule_clean_percpu(); +} + +#ifdef HAVE_NF_HOOKFN_ARG_OPS +#define FIRST_PARAM const struct nf_hook_ops *ops, +#else +#define FIRST_PARAM unsigned int hooknum, +#endif + +static unsigned int nf_ip_hook(FIRST_PARAM + struct sk_buff *skb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)) +{ + struct stt_sock *stt_sock; + int ip_hdr_len; + + if (ip_hdr(skb)->protocol != IPPROTO_TCP) + return NF_ACCEPT; + + ip_hdr_len = ip_hdrlen(skb); + if (unlikely(!pskb_may_pull(skb, ip_hdr_len + sizeof(struct tcphdr)))) + return NF_ACCEPT; + + skb_set_transport_header(skb, ip_hdr_len); + + stt_sock = stt_find_sock(dev_net(skb->dev), tcp_hdr(skb)->dest); + if (!stt_sock) + return NF_ACCEPT; + + __skb_pull(skb, ip_hdr_len + sizeof(struct tcphdr)); + stt_rcv(stt_sock, skb); + return NF_STOLEN; +} + +static struct nf_hook_ops nf_hook_ops __read_mostly = { + .hook = nf_ip_hook, + .owner = THIS_MODULE, + .pf = NFPROTO_IPV4, + .hooknum = NF_INET_LOCAL_IN, + .priority = INT_MAX, +}; + +static int stt_start(void) +{ + int err; + int i; + + if (n_tunnels) { + n_tunnels++; + return 0; + } + get_random_bytes(&frag_hash_seed, sizeof(u32)); + + stt_percpu_data = alloc_percpu(struct stt_percpu); + if (!stt_percpu_data) { + err = -ENOMEM; + goto error; + } + + for_each_possible_cpu(i) { + struct stt_percpu *stt_percpu = per_cpu_ptr(stt_percpu_data, i); + struct flex_array *frag_hash; + + spin_lock_init(&stt_percpu->lock); + INIT_LIST_HEAD(&stt_percpu->frag_lru); + get_random_bytes(&per_cpu(pkt_seq_counter, i), sizeof(u32)); + + frag_hash = flex_array_alloc(sizeof(struct pkt_frag), + FRAG_HASH_ENTRIES, + GFP_KERNEL | __GFP_ZERO); + if (!frag_hash) { + err = -ENOMEM; + goto free_percpu; + } + stt_percpu->frag_hash = frag_hash; + + err = flex_array_prealloc(stt_percpu->frag_hash, 0, + FRAG_HASH_ENTRIES, + GFP_KERNEL | __GFP_ZERO); + if (err) + goto free_percpu; + } + err = nf_register_hook(&nf_hook_ops); + if (err) + goto free_percpu; + + schedule_clean_percpu(); + n_tunnels++; + return 0; + +free_percpu: + for_each_possible_cpu(i) { + struct stt_percpu *stt_percpu = per_cpu_ptr(stt_percpu_data, i); + + if (stt_percpu->frag_hash) + flex_array_free(stt_percpu->frag_hash); + } + + free_percpu(stt_percpu_data); + +error: + return err; +} + +static void stt_cleanup(void) +{ + int i; + + n_tunnels--; + if (n_tunnels) + return; + + cancel_delayed_work_sync(&clean_percpu_wq); + nf_unregister_hook(&nf_hook_ops); + + for_each_possible_cpu(i) { + struct stt_percpu *stt_percpu = per_cpu_ptr(stt_percpu_data, i); + int j; + + for (j = 0; j < FRAG_HASH_ENTRIES; j++) { + struct pkt_frag *frag; + + frag = flex_array_get(stt_percpu->frag_hash, j); + kfree_skb_list(frag->skbs); + } + + flex_array_free(stt_percpu->frag_hash); + } + + free_percpu(stt_percpu_data); +} + +static struct stt_sock *stt_socket_create(struct net *net, __be16 port, + stt_rcv_t *rcv, void *data) +{ + struct stt_net *sn = net_generic(net, stt_net_id); + struct stt_sock *stt_sock; + struct socket *sock; + int err; + + stt_sock = kzalloc(sizeof(*stt_sock), GFP_KERNEL); + if (!stt_sock) + return ERR_PTR(-ENOMEM); + + err = tcp_sock_create4(net, port, &sock); + if (err) { + kfree(stt_sock); + return ERR_PTR(err); + } + + stt_sock->sock = sock; + stt_sock->rcv = rcv; + stt_sock->rcv_data = data; + + list_add_rcu(&stt_sock->list, &sn->sock_list); + + return stt_sock; +} + +static void __stt_sock_release(struct stt_sock *stt_sock) +{ + list_del_rcu(&stt_sock->list); + tcp_sock_release(stt_sock->sock); + kfree_rcu(stt_sock, rcu); +} + +struct stt_sock *rpl_stt_sock_add(struct net *net, __be16 port, + stt_rcv_t *rcv, void *data) +{ + struct stt_sock *stt_sock; + int err; + + err = stt_start(); + if (err) + return ERR_PTR(err); + + mutex_lock(&stt_mutex); + rcu_read_lock(); + stt_sock = stt_find_sock(net, port); + rcu_read_unlock(); + if (stt_sock) + stt_sock = ERR_PTR(-EBUSY); + else + stt_sock = stt_socket_create(net, port, rcv, data); + + mutex_unlock(&stt_mutex); + + if (IS_ERR(stt_sock)) + stt_cleanup(); + + return stt_sock; +} +EXPORT_SYMBOL_GPL(rpl_stt_sock_add); + +void rpl_stt_sock_release(struct stt_sock *stt_sock) +{ + mutex_lock(&stt_mutex); + if (stt_sock) { + __stt_sock_release(stt_sock); + stt_cleanup(); + } + mutex_unlock(&stt_mutex); +} +EXPORT_SYMBOL_GPL(rpl_stt_sock_release); + +static int stt_init_net(struct net *net) +{ + struct stt_net *sn = net_generic(net, stt_net_id); + + INIT_LIST_HEAD(&sn->sock_list); + return 0; +} + +static struct pernet_operations stt_net_ops = { + .init = stt_init_net, + .id = &stt_net_id, + .size = sizeof(struct stt_net), +}; + +int ovs_stt_init_module(void) +{ + return register_pernet_subsys(&stt_net_ops); +} +EXPORT_SYMBOL_GPL(ovs_stt_init_module); + +void ovs_stt_cleanup_module(void) +{ + unregister_pernet_subsys(&stt_net_ops); +} +EXPORT_SYMBOL_GPL(ovs_stt_cleanup_module); +#endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/udp.c openvswitch-2.4.0~git20150623/datapath/linux/compat/udp.c --- openvswitch-2.3.1/datapath/linux/compat/udp.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/udp.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,44 @@ +#include + +#ifndef HAVE_UDP_SET_CSUM + +#include + +/* Function to set UDP checksum for an IPv4 UDP packet. This is intended + * for the simple case like when setting the checksum for a UDP tunnel. + */ +void rpl_udp_set_csum(bool nocheck, struct sk_buff *skb, + __be32 saddr, __be32 daddr, int len) +{ + struct udphdr *uh = udp_hdr(skb); + + if (nocheck) + uh->check = 0; + else if (skb_is_gso(skb)) + uh->check = ~udp_v4_check(len, saddr, daddr, 0); + else if (skb_dst(skb) && skb_dst(skb)->dev && + (skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) { + + BUG_ON(skb->ip_summed == CHECKSUM_PARTIAL); + + skb->ip_summed = CHECKSUM_PARTIAL; + skb->csum_start = skb_transport_header(skb) - skb->head; + skb->csum_offset = offsetof(struct udphdr, check); + uh->check = ~udp_v4_check(len, saddr, daddr, 0); + } else { + __wsum csum; + + BUG_ON(skb->ip_summed == CHECKSUM_PARTIAL); + + uh->check = 0; + csum = skb_checksum(skb, 0, len, 0); + uh->check = udp_v4_check(len, saddr, daddr, csum); + if (uh->check == 0) + uh->check = CSUM_MANGLED_0; + + skb->ip_summed = CHECKSUM_UNNECESSARY; + } +} +EXPORT_SYMBOL_GPL(rpl_udp_set_csum); + +#endif /* Linux version < 3.16 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/udp_tunnel.c openvswitch-2.4.0~git20150623/datapath/linux/compat/udp_tunnel.c --- openvswitch-2.3.1/datapath/linux/compat/udp_tunnel.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/udp_tunnel.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,175 @@ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int rpl_udp_sock_create(struct net *net, struct udp_port_cfg *cfg, + struct socket **sockp) +{ + int err; + struct socket *sock = NULL; + +#if IS_ENABLED(CONFIG_IPV6) + if (cfg->family == AF_INET6) { + struct sockaddr_in6 udp6_addr; + + err = sock_create_kern(AF_INET6, SOCK_DGRAM, 0, &sock); + if (err < 0) + goto error; + + sk_change_net(sock->sk, net); + + udp6_addr.sin6_family = AF_INET6; + memcpy(&udp6_addr.sin6_addr, &cfg->local_ip6, + sizeof(udp6_addr.sin6_addr)); + udp6_addr.sin6_port = cfg->local_udp_port; + err = kernel_bind(sock, (struct sockaddr *)&udp6_addr, + sizeof(udp6_addr)); + if (err < 0) + goto error; + + if (cfg->peer_udp_port) { + udp6_addr.sin6_family = AF_INET6; + memcpy(&udp6_addr.sin6_addr, &cfg->peer_ip6, + sizeof(udp6_addr.sin6_addr)); + udp6_addr.sin6_port = cfg->peer_udp_port; + err = kernel_connect(sock, + (struct sockaddr *)&udp6_addr, + sizeof(udp6_addr), 0); + } + if (err < 0) + goto error; + } else +#endif + if (cfg->family == AF_INET) { + struct sockaddr_in udp_addr; + + err = sock_create_kern(AF_INET, SOCK_DGRAM, 0, &sock); + if (err < 0) + goto error; + + sk_change_net(sock->sk, net); + + udp_addr.sin_family = AF_INET; + udp_addr.sin_addr = cfg->local_ip; + udp_addr.sin_port = cfg->local_udp_port; + err = kernel_bind(sock, (struct sockaddr *)&udp_addr, + sizeof(udp_addr)); + if (err < 0) + goto error; + + if (cfg->peer_udp_port) { + udp_addr.sin_family = AF_INET; + udp_addr.sin_addr = cfg->peer_ip; + udp_addr.sin_port = cfg->peer_udp_port; + err = kernel_connect(sock, + (struct sockaddr *)&udp_addr, + sizeof(udp_addr), 0); + if (err < 0) + goto error; + } + } else { + return -EPFNOSUPPORT; + } + + + *sockp = sock; + + return 0; + +error: + if (sock) { + kernel_sock_shutdown(sock, SHUT_RDWR); + sk_release_kernel(sock->sk); + } + *sockp = NULL; + return err; +} +EXPORT_SYMBOL_GPL(rpl_udp_sock_create); + +void rpl_setup_udp_tunnel_sock(struct net *net, struct socket *sock, + struct udp_tunnel_sock_cfg *cfg) +{ + struct sock *sk = sock->sk; + + /* Disable multicast loopback */ + inet_sk(sk)->mc_loop = 0; + + rcu_assign_sk_user_data(sk, cfg->sk_user_data); + + udp_sk(sk)->encap_type = cfg->encap_type; + udp_sk(sk)->encap_rcv = cfg->encap_rcv; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) + udp_sk(sk)->encap_destroy = cfg->encap_destroy; +#endif + + udp_tunnel_encap_enable(sock); +} +EXPORT_SYMBOL_GPL(rpl_setup_udp_tunnel_sock); + +void ovs_udp_gso(struct sk_buff *skb) +{ + int udp_offset = skb_transport_offset(skb); + struct udphdr *uh; + + uh = udp_hdr(skb); + uh->len = htons(skb->len - udp_offset); +} +EXPORT_SYMBOL_GPL(ovs_udp_gso); + +void ovs_udp_csum_gso(struct sk_buff *skb) +{ + struct iphdr *iph = ip_hdr(skb); + int udp_offset = skb_transport_offset(skb); + + ovs_udp_gso(skb); + + /* csum segment if tunnel sets skb with csum. The cleanest way + * to do this just to set it up from scratch. */ + skb->ip_summed = CHECKSUM_NONE; + udp_set_csum(true, skb, iph->saddr, iph->daddr, + skb->len - udp_offset); +} +EXPORT_SYMBOL_GPL(ovs_udp_csum_gso); + +int rpl_udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb, + __be32 src, __be32 dst, __u8 tos, __u8 ttl, + __be16 df, __be16 src_port, __be16 dst_port, + bool xnet, bool nocheck) +{ + struct udphdr *uh; + + __skb_push(skb, sizeof(*uh)); + skb_reset_transport_header(skb); + uh = udp_hdr(skb); + + uh->dest = dst_port; + uh->source = src_port; + uh->len = htons(skb->len); + + udp_set_csum(nocheck, skb, src, dst, skb->len); + + return iptunnel_xmit(skb->sk, rt, skb, src, dst, IPPROTO_UDP, + tos, ttl, df, xnet); +} +EXPORT_SYMBOL_GPL(rpl_udp_tunnel_xmit_skb); + +void rpl_udp_tunnel_sock_release(struct socket *sock) +{ + rcu_assign_sk_user_data(sock->sk, NULL); + kernel_sock_shutdown(sock, SHUT_RDWR); + sk_release_kernel(sock->sk); +} +EXPORT_SYMBOL_GPL(rpl_udp_tunnel_sock_release); + +#endif /* Linux version < 4.0 */ diff -Nru openvswitch-2.3.1/datapath/linux/compat/utils.c openvswitch-2.4.0~git20150623/datapath/linux/compat/utils.c --- openvswitch-2.3.1/datapath/linux/compat/utils.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/utils.c 2015-06-23 18:46:21.000000000 +0000 @@ -19,9 +19,9 @@ #include #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) -void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, - const __be32 *from, const __be32 *to, - int pseudohdr) +void rpl_inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, + const __be32 *from, const __be32 *to, + int pseudohdr) { __be32 diff[] = { ~from[0], ~from[1], ~from[2], ~from[3], @@ -37,10 +37,12 @@ *sum = ~csum_fold(csum_partial(diff, sizeof(diff), csum_unfold(*sum))); } +EXPORT_SYMBOL_GPL(rpl_inet_proto_csum_replace16); #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) -bool __net_get_random_once(void *buf, int nbytes, bool *done, + +bool rpl___net_get_random_once(void *buf, int nbytes, bool *done, atomic_t *done_key) { static DEFINE_SPINLOCK(lock); @@ -60,4 +62,6 @@ return true; } +EXPORT_SYMBOL_GPL(rpl___net_get_random_once); + #endif diff -Nru openvswitch-2.3.1/datapath/linux/compat/vxlan.c openvswitch-2.4.0~git20150623/datapath/linux/compat/vxlan.c --- openvswitch-2.3.1/datapath/linux/compat/vxlan.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/compat/vxlan.c 2015-06-23 18:46:21.000000000 +0000 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -58,11 +59,8 @@ #include "datapath.h" #include "gso.h" #include "vlan.h" -#ifndef USE_KERNEL_TUNNEL_API -#define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr)) - -#define VXLAN_FLAGS 0x08000000 /* struct vxlanhdr.vx_flags required value. */ +#ifndef USE_UPSTREAM_VXLAN /* VXLAN protocol header */ struct vxlanhdr { @@ -75,18 +73,22 @@ { struct vxlan_sock *vs; struct vxlanhdr *vxh; + u32 flags, vni; + struct vxlan_metadata md = {0}; /* Need Vxlan and inner Ethernet header to be present */ if (!pskb_may_pull(skb, VXLAN_HLEN)) goto error; - /* Return packets with reserved bits set */ vxh = (struct vxlanhdr *)(udp_hdr(skb) + 1); - if (vxh->vx_flags != htonl(VXLAN_FLAGS) || - (vxh->vx_vni & htonl(0xff))) { - pr_warn("invalid vxlan flags=%#x vni=%#x\n", - ntohl(vxh->vx_flags), ntohl(vxh->vx_vni)); - goto error; + flags = ntohl(vxh->vx_flags); + vni = ntohl(vxh->vx_vni); + + if (flags & VXLAN_HF_VNI) { + flags &= ~VXLAN_HF_VNI; + } else { + /* VNI flag always required to be set */ + goto bad_flags; } if (iptunnel_pull_header(skb, VXLAN_HLEN, htons(ETH_P_TEB))) @@ -96,13 +98,48 @@ if (!vs) goto drop; - vs->rcv(vs, skb, vxh->vx_vni); + /* For backwards compatibility, only allow reserved fields to be + * used by VXLAN extensions if explicitly requested. + */ + if ((flags & VXLAN_HF_GBP) && (vs->flags & VXLAN_F_GBP)) { + struct vxlanhdr_gbp *gbp; + + gbp = (struct vxlanhdr_gbp *)vxh; + md.gbp = ntohs(gbp->policy_id); + + if (gbp->dont_learn) + md.gbp |= VXLAN_GBP_DONT_LEARN; + + if (gbp->policy_applied) + md.gbp |= VXLAN_GBP_POLICY_APPLIED; + + flags &= ~VXLAN_GBP_USED_BITS; + } + + if (flags || (vni & 0xff)) { + /* If there are any unprocessed flags remaining treat + * this as a malformed packet. This behavior diverges from + * VXLAN RFC (RFC7348) which stipulates that bits in reserved + * in reserved fields are to be ignored. The approach here + * maintains compatbility with previous stack code, and also + * is more robust and provides a little more security in + * adding extensions to VXLAN. + */ + + goto bad_flags; + } + + md.vni = vxh->vx_vni; + vs->rcv(vs, skb, &md); return 0; drop: /* Consume bad packet */ kfree_skb(skb); return 0; +bad_flags: + pr_debug("invalid vxlan flags=%#x vni=%#x\n", + ntohl(vxh->vx_flags), ntohl(vxh->vx_vni)); error: /* Return non vxlan pkt */ @@ -123,112 +160,72 @@ skb->destructor = vxlan_sock_put; } -/* Compute source port for outgoing packet - * first choice to use L4 flow hash since it will spread - * better and maybe available from hardware - * secondary choice is to use jhash on the Ethernet header - */ -__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb) -{ - unsigned int range = (port_max - port_min) + 1; - u32 hash; - - hash = skb_get_hash(skb); - if (!hash) - hash = jhash(skb->data, 2 * ETH_ALEN, - (__force u32) skb->protocol); - - return htons((((u64) hash * range) >> 32) + port_min); -} - -static void vxlan_gso(struct sk_buff *skb) +static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, u32 vxflags, + struct vxlan_metadata *md) { - int udp_offset = skb_transport_offset(skb); - struct udphdr *uh; + struct vxlanhdr_gbp *gbp; - uh = udp_hdr(skb); - uh->len = htons(skb->len - udp_offset); + if (!md->gbp) + return; - /* csum segment if tunnel sets skb with csum. */ - if (unlikely(uh->check)) { - struct iphdr *iph = ip_hdr(skb); + gbp = (struct vxlanhdr_gbp *)vxh; + vxh->vx_flags |= htonl(VXLAN_HF_GBP); - uh->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, - skb->len - udp_offset, - IPPROTO_UDP, 0); - uh->check = csum_fold(skb_checksum(skb, udp_offset, - skb->len - udp_offset, 0)); + if (md->gbp & VXLAN_GBP_DONT_LEARN) + gbp->dont_learn = 1; - if (uh->check == 0) - uh->check = CSUM_MANGLED_0; + if (md->gbp & VXLAN_GBP_POLICY_APPLIED) + gbp->policy_applied = 1; - } - skb->ip_summed = CHECKSUM_NONE; -} - -static int handle_offloads(struct sk_buff *skb) -{ - if (skb_is_gso(skb)) { - OVS_GSO_CB(skb)->fix_segment = vxlan_gso; - } else { - if (skb->ip_summed != CHECKSUM_PARTIAL) - skb->ip_summed = CHECKSUM_NONE; - } - return 0; + gbp->policy_id = htons(md->gbp & VXLAN_GBP_ID_MASK); } -int vxlan_xmit_skb(struct vxlan_sock *vs, - struct rtable *rt, struct sk_buff *skb, - __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, - __be16 src_port, __be16 dst_port, __be32 vni) +int rpl_vxlan_xmit_skb(struct vxlan_sock *vs, + struct rtable *rt, struct sk_buff *skb, + __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, + __be16 src_port, __be16 dst_port, + struct vxlan_metadata *md, bool xnet, u32 vxflags) { struct vxlanhdr *vxh; - struct udphdr *uh; int min_headroom; int err; + bool udp_sum = !!(vxflags & VXLAN_F_UDP_CSUM); min_headroom = LL_RESERVED_SPACE(rt_dst(rt).dev) + rt_dst(rt).header_len + VXLAN_HLEN + sizeof(struct iphdr) - + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); + + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); /* Need space for new headers (invalidates iph ptr) */ err = skb_cow_head(skb, min_headroom); - if (unlikely(err)) + if (unlikely(err)) { + kfree_skb(skb); return err; - - if (vlan_tx_tag_present(skb)) { - if (unlikely(!__vlan_put_tag(skb, - skb->vlan_proto, - vlan_tx_tag_get(skb)))) - return -ENOMEM; - - vlan_set_tci(skb, 0); } - skb_reset_inner_headers(skb); + skb = vlan_hwaccel_push_inside(skb); + if (WARN_ON(!skb)) + return -ENOMEM; + + skb = udp_tunnel_handle_offloads(skb, udp_sum, true); + if (IS_ERR(skb)) + return PTR_ERR(skb); vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh)); - vxh->vx_flags = htonl(VXLAN_FLAGS); - vxh->vx_vni = vni; - - __skb_push(skb, sizeof(*uh)); - skb_reset_transport_header(skb); - uh = udp_hdr(skb); - - uh->dest = dst_port; - uh->source = src_port; + vxh->vx_flags = htonl(VXLAN_HF_VNI); + vxh->vx_vni = md->vni; - uh->len = htons(skb->len); - uh->check = 0; + if (vxflags & VXLAN_F_GBP) + vxlan_build_gbp_hdr(vxh, vxflags, md); vxlan_set_owner(vs->sock->sk, skb); - err = handle_offloads(skb); - if (err) - return err; + ovs_skb_set_inner_protocol(skb, htons(ETH_P_TEB)); - return iptunnel_xmit(rt, skb, src, dst, IPPROTO_UDP, tos, ttl, df, false); + return udp_tunnel_xmit_skb(rt, skb, src, dst, tos, + ttl, df, src_port, dst_port, xnet, + !udp_sum); } +EXPORT_SYMBOL_GPL(rpl_vxlan_xmit_skb); static void rcu_free_vs(struct rcu_head *rcu) { @@ -241,21 +238,46 @@ { struct vxlan_sock *vs = container_of(work, struct vxlan_sock, del_work); - sk_release_kernel(vs->sock->sk); + udp_tunnel_sock_release(vs->sock); call_rcu(&vs->rcu, rcu_free_vs); } +static struct socket *vxlan_create_sock(struct net *net, bool ipv6, + __be16 port, u32 flags) +{ + struct socket *sock; + struct udp_port_cfg udp_conf; + int err; + + memset(&udp_conf, 0, sizeof(udp_conf)); + + if (ipv6) { + udp_conf.family = AF_INET6; + /* The checksum flag is silently ignored but it + * doesn't make sense here anyways because OVS enables + * checksums on a finer granularity than per-socket. + */ + } else { + udp_conf.family = AF_INET; + udp_conf.local_ip.s_addr = htonl(INADDR_ANY); + } + + udp_conf.local_udp_port = port; + + /* Open UDP socket */ + err = udp_sock_create(net, &udp_conf, &sock); + if (err < 0) + return ERR_PTR(err); + + return sock; +} + static struct vxlan_sock *vxlan_socket_create(struct net *net, __be16 port, - vxlan_rcv_t *rcv, void *data) + vxlan_rcv_t *rcv, void *data, u32 flags) { struct vxlan_sock *vs; - struct sock *sk; - struct sockaddr_in vxlan_addr = { - .sin_family = AF_INET, - .sin_addr.s_addr = htonl(INADDR_ANY), - .sin_port = port, - }; - int rc; + struct socket *sock; + struct udp_tunnel_sock_cfg tunnel_cfg; vs = kmalloc(sizeof(*vs), GFP_KERNEL); if (!vs) { @@ -265,54 +287,41 @@ INIT_WORK(&vs->del_work, vxlan_del_work); - /* Create UDP socket for encapsulation receive. */ - rc = sock_create_kern(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &vs->sock); - if (rc < 0) { - pr_debug("UDP socket create failed\n"); + sock = vxlan_create_sock(net, false, port, flags); + if (IS_ERR(sock)) { kfree(vs); - return ERR_PTR(rc); + return ERR_CAST(sock); } - /* Put in proper namespace */ - sk = vs->sock->sk; - sk_change_net(sk, net); - - rc = kernel_bind(vs->sock, (struct sockaddr *) &vxlan_addr, - sizeof(vxlan_addr)); - if (rc < 0) { - pr_debug("bind for UDP socket %pI4:%u (%d)\n", - &vxlan_addr.sin_addr, ntohs(vxlan_addr.sin_port), rc); - sk_release_kernel(sk); - kfree(vs); - return ERR_PTR(rc); - } + vs->sock = sock; vs->rcv = rcv; vs->data = data; + vs->flags = (flags & VXLAN_F_RCV_FLAGS); + + tunnel_cfg.sk_user_data = vs; + tunnel_cfg.encap_type = 1; + tunnel_cfg.encap_rcv = vxlan_udp_encap_recv; + tunnel_cfg.encap_destroy = NULL; + + setup_udp_tunnel_sock(net, sock, &tunnel_cfg); - /* Disable multicast loopback */ - inet_sk(sk)->mc_loop = 0; - rcu_assign_sk_user_data(vs->sock->sk, vs); - - /* Mark socket as an encapsulation socket. */ - udp_sk(sk)->encap_type = 1; - udp_sk(sk)->encap_rcv = vxlan_udp_encap_recv; - udp_encap_enable(); return vs; } -struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, - vxlan_rcv_t *rcv, void *data, - bool no_share, bool ipv6) +struct vxlan_sock *rpl_vxlan_sock_add(struct net *net, __be16 port, + vxlan_rcv_t *rcv, void *data, + bool no_share, u32 flags) { - return vxlan_socket_create(net, port, rcv, data); + return vxlan_socket_create(net, port, rcv, data, flags); } +EXPORT_SYMBOL_GPL(rpl_vxlan_sock_add); -void vxlan_sock_release(struct vxlan_sock *vs) +void rpl_vxlan_sock_release(struct vxlan_sock *vs) { ASSERT_OVSL(); - rcu_assign_sk_user_data(vs->sock->sk, NULL); queue_work(system_wq, &vs->del_work); } +EXPORT_SYMBOL_GPL(rpl_vxlan_sock_release); -#endif /* 3.12 */ +#endif /* !USE_UPSTREAM_VXLAN */ diff -Nru openvswitch-2.3.1/datapath/linux/.gitignore openvswitch-2.4.0~git20150623/datapath/linux/.gitignore --- openvswitch-2.3.1/datapath/linux/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,58 @@ +/Kbuild +/Makefile +/Makefile.main +/Module.markers +/actions.c +/addrconf_core-openvswitch.c +/checksum.c +/dev-openvswitch.c +/dp_sysfs_dp.c +/dp_sysfs_if.c +/datapath.c +/dp_dev.c +/dp_notify.c +/exthdrs_core.c +/flex_array.c +/flow.c +/flow_dissector.c +/flow_netlink.c +/flow_table.c +/genetlink-openvswitch.c +/geneve.c +/genl_exec.c +/gre.c +/gso.c +/hash.c +/hash-x86.c +/ip_output-openvswitch.c +/ip_tunnels_core.c +/kcompat.h +/kmemdup.c +/loop_counter.c +/modules.order +/netdevice.c +/net_namespace.c +/random32.c +/reciprocal_div.c +/skbuff-openvswitch.c +/stt.c +/table.c +/time.c +/tmp +/tunnel.c +/udp.c +/udp_tunnel.c +/utils.c +/vlan.c +/vport-generic.c +/vport-geneve.c +/vport-gre.c +/vport-internal_dev.c +/vport-lisp.c +/vport-netdev.c +/vport-patch.c +/vport-stt.c +/vport-vxlan.c +/vport.c +/vxlan.c +/workqueue.c diff -Nru openvswitch-2.3.1/datapath/linux/Kbuild.in openvswitch-2.4.0~git20150623/datapath/linux/Kbuild.in --- openvswitch-2.3.1/datapath/linux/Kbuild.in 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/Kbuild.in 2015-06-23 18:46:21.000000000 +0000 @@ -7,21 +7,21 @@ include $(srcdir)/../Modules.mk include $(srcdir)/Modules.mk -EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\" -EXTRA_CFLAGS += -I$(srcdir)/.. -EXTRA_CFLAGS += -I$(builddir)/.. -EXTRA_CFLAGS += -g -EXTRA_CFLAGS += -include $(builddir)/kcompat.h +ccflags-y := -DVERSION=\"$(VERSION)\" +ccflags-y += -I$(srcdir)/.. +ccflags-y += -I$(builddir)/.. +ccflags-y += -g +ccflags-y += -include $(builddir)/kcompat.h # These include directories have to go before -I$(KSRC)/include. # NOSTDINC_FLAGS just happens to be a variable that goes in the # right place, even though it's conceptually incorrect. NOSTDINC_FLAGS += -I$(top_srcdir)/include -I$(srcdir)/compat -I$(srcdir)/compat/include -obj-m := $(patsubst %,%.o,$(build_modules)) +obj-m := $(subst _,-,$(patsubst %,%.o,$(build_modules))) define module_template $(1)-y = $$(notdir $$(patsubst %.c,%.o,$($(1)_sources))) endef -$(foreach module,$(build_modules),$(eval $(call module_template,$(module)))) +$(foreach module,$(build_multi_modules),$(eval $(call module_template,$(module)))) diff -Nru openvswitch-2.3.1/datapath/linux/Makefile.main.in openvswitch-2.4.0~git20150623/datapath/linux/Makefile.main.in --- openvswitch-2.3.1/datapath/linux/Makefile.main.in 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/Makefile.main.in 2015-06-23 18:46:21.000000000 +0000 @@ -29,7 +29,8 @@ installcheck: mostlyclean: clean: - rm -f *.o *.ko *.mod.* Module.symvers *.cmd kcompat.h.new + rm -f *.o *.ko *.mod.* Module.symvers .*.cmd kcompat.h.new \ + modules.order .tmp_versions/openvswitch.mod for d in $(build_links); do if test -h $$d; then rm $$d; fi; done distclean: clean rm -f kcompat.h diff -Nru openvswitch-2.3.1/datapath/linux/Modules.mk openvswitch-2.4.0~git20150623/datapath/linux/Modules.mk --- openvswitch-2.3.1/datapath/linux/Modules.mk 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/linux/Modules.mk 2015-06-23 18:46:21.000000000 +0000 @@ -3,22 +3,23 @@ linux/compat/exthdrs_core.c \ linux/compat/flex_array.c \ linux/compat/flow_dissector.c \ + linux/compat/geneve.c \ linux/compat/gre.c \ linux/compat/gso.c \ linux/compat/genetlink-openvswitch.c \ - linux/compat/hash.c \ - linux/compat/hash-x86.c \ linux/compat/ip_tunnels_core.c \ linux/compat/netdevice.c \ linux/compat/net_namespace.c \ linux/compat/reciprocal_div.c \ linux/compat/skbuff-openvswitch.c \ + linux/compat/stt.c \ + linux/compat/udp.c \ + linux/compat/udp_tunnel.c \ linux/compat/vxlan.c \ linux/compat/utils.c openvswitch_headers += \ linux/compat/gso.h \ - linux/compat/include/asm/hash.h \ - linux/compat/include/asm/percpu.h \ + linux/compat/include/linux/percpu.h \ linux/compat/include/linux/bug.h \ linux/compat/include/linux/compiler.h \ linux/compat/include/linux/compiler-gcc.h \ @@ -26,7 +27,6 @@ linux/compat/include/linux/err.h \ linux/compat/include/linux/etherdevice.h \ linux/compat/include/linux/flex_array.h \ - linux/compat/include/linux/hash.h \ linux/compat/include/linux/icmp.h \ linux/compat/include/linux/icmpv6.h \ linux/compat/include/linux/if.h \ @@ -40,12 +40,13 @@ linux/compat/include/linux/kconfig.h \ linux/compat/include/linux/kernel.h \ linux/compat/include/linux/list.h \ - linux/compat/include/linux/log2.h \ + linux/compat/include/linux/mpls.h \ linux/compat/include/linux/net.h \ linux/compat/include/linux/random.h \ linux/compat/include/linux/netdevice.h \ linux/compat/include/linux/netdev_features.h \ linux/compat/include/linux/netlink.h \ + linux/compat/include/linux/openvswitch.h \ linux/compat/include/linux/poison.h \ linux/compat/include/linux/rculist.h \ linux/compat/include/linux/rcupdate.h \ @@ -63,13 +64,19 @@ linux/compat/include/net/dst.h \ linux/compat/include/net/flow_keys.h \ linux/compat/include/net/genetlink.h \ + linux/compat/include/net/geneve.h \ linux/compat/include/net/gre.h \ linux/compat/include/net/inet_frag.h \ linux/compat/include/net/ip.h \ linux/compat/include/net/ip_tunnels.h \ linux/compat/include/net/ipv6.h \ + linux/compat/include/net/mpls.h \ linux/compat/include/net/net_namespace.h \ linux/compat/include/net/netlink.h \ + linux/compat/include/net/udp.h \ + linux/compat/include/net/udp_tunnel.h \ linux/compat/include/net/sock.h \ + linux/compat/include/net/stt.h \ linux/compat/include/net/vxlan.h \ linux/compat/include/net/sctp/checksum.h +EXTRA_DIST += linux/compat/build-aux/export-check-whitelist diff -Nru openvswitch-2.3.1/datapath/Makefile.am openvswitch-2.4.0~git20150623/datapath/Makefile.am --- openvswitch-2.3.1/datapath/Makefile.am 2012-07-10 09:39:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/Makefile.am 2015-06-23 18:46:21.000000000 +0000 @@ -20,3 +20,39 @@ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@ CLEANFILES = distfiles + +# Print name of all modules. +print-build-modules: + @if test -z "$(build_modules)"; \ + then \ + echo "Could not find any kernel module."; \ + exit 1; \ + fi + @echo "$(build_modules)" | tr '_' '-'; + +COMPAT_GET_FUNCTIONS := find $(top_srcdir)/datapath/linux/compat -name "*.h" \ + -exec sed -n '/^[a-z][a-z]* \*\?[A-Za-z0-9_][A-Za-z0-9_]*([a-z]/p; /^struct [a-z0-9_][a-z0-9_]* \*\?[A-Za-z0-9_][A-Za-z0-9_]*([a-z]/p' {} \; | tr -d '*' | cut -d '(' -f1 | rev | cut -d ' ' -f1 | rev +COMPAT_GET_EXPORTS := find $(top_srcdir)/datapath/linux/compat -name "*.c" \ + -exec sed -n 's/^EXPORT_SYMBOL[A-Z_]*(\([a-z_][a-z_]*\));$$/\1/p' {} \; +COMPAT_FUNCTIONS := $(shell $(COMPAT_GET_FUNCTIONS)) +COMPAT_EXPORTS := $(shell $(COMPAT_GET_EXPORTS)) + +# Checks that all public functions are 'rpl_' or 'ovs_' prefixed. +# Checks that all EXPORT_SYMBOL_GPL() export 'rpl_' or 'ovs_' prefixed functions. +check-export-symbol: + @for fun_ in $(COMPAT_FUNCTIONS); do \ + if ! grep -- $${fun_} $(top_srcdir)/datapath/linux/compat/build-aux/export-check-whitelist > /dev/null; then \ + if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \ + echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \ + exit 1; \ + fi; \ + fi; \ + done + @for fun_ in $(COMPAT_EXPORTS); do \ + if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \ + echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \ + exit 1; \ + fi; \ + done + +all-local: check-export-symbol diff -Nru openvswitch-2.3.1/datapath/Makefile.in openvswitch-2.4.0~git20150623/datapath/Makefile.in --- openvswitch-2.3.1/datapath/Makefile.in 2014-12-04 05:59:43.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,703 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@LINUX_ENABLED_TRUE@am__append_1 = linux -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/Modules.mk $(srcdir)/linux/Modules.mk -subdir = datapath -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ - $(top_srcdir)/m4/ax_check_openssl.m4 \ - $(top_srcdir)/m4/ax_func_posix_memalign.m4 \ - $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/openvswitch.m4 $(top_srcdir)/m4/compat.at \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = linux -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOM4TE = @AUTOM4TE@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CGCCFLAGS = @CGCCFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DBDIR = @DBDIR@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_OPENSSL = @HAVE_OPENSSL@ -HAVE_PYTHON = @HAVE_PYTHON@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KARCH = @KARCH@ -KBUILD = @KBUILD@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LOGDIR = @LOGDIR@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ -NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ -NEXT_STDIO_H = @NEXT_STDIO_H@ -NEXT_STRING_H = @NEXT_STRING_H@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PKG_CONFIG = @PKG_CONFIG@ -PKIDIR = @PKIDIR@ -PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ -PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ -PTHREAD_INCLUDES = @PTHREAD_INCLUDES@ -PTHREAD_LDFLAGS = @PTHREAD_LDFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -PYTHON = @PYTHON@ -RANLIB = @RANLIB@ -RUNDIR = @RUNDIR@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SPARSE = @SPARSE@ -SPARSEFLAGS = @SPARSEFLAGS@ -SPARSE_EXTRA_INCLUDES = @SPARSE_EXTRA_INCLUDES@ -SSL_INCLUDES = @SSL_INCLUDES@ -SSL_LDFLAGS = @SSL_LDFLAGS@ -SSL_LIBS = @SSL_LIBS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WARNING_FLAGS = @WARNING_FLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = $(am__append_1) -EXTRA_DIST = $(dist_headers) $(dist_sources) $(dist_extras) - -# Suppress warnings about GNU extensions in Modules.mk files. -AUTOMAKE_OPTIONS = -Wno-portability - -# Some modules should be built and distributed, e.g. openvswitch. -# -# Some modules should be built but not distributed, e.g. third-party -# hwtable modules. -both_modules = openvswitch -build_modules = $(both_modules) # Modules to build -dist_modules = $(both_modules) # Modules to distribute -openvswitch_sources = actions.c datapath.c dp_notify.c flow.c \ - flow_netlink.c flow_table.c vport.c vport-gre.c \ - vport-internal_dev.c vport-lisp.c vport-netdev.c vport-vxlan.c \ - linux/compat/dev-openvswitch.c linux/compat/exthdrs_core.c \ - linux/compat/flex_array.c linux/compat/flow_dissector.c \ - linux/compat/gre.c linux/compat/gso.c \ - linux/compat/genetlink-openvswitch.c linux/compat/hash.c \ - linux/compat/hash-x86.c linux/compat/ip_tunnels_core.c \ - linux/compat/netdevice.c linux/compat/net_namespace.c \ - linux/compat/reciprocal_div.c \ - linux/compat/skbuff-openvswitch.c linux/compat/vxlan.c \ - linux/compat/utils.c -openvswitch_headers = compat.h datapath.h flow.h flow_netlink.h \ - flow_table.h vlan.h vport.h vport-internal_dev.h \ - vport-netdev.h linux/compat/gso.h \ - linux/compat/include/asm/hash.h \ - linux/compat/include/asm/percpu.h \ - linux/compat/include/linux/bug.h \ - linux/compat/include/linux/compiler.h \ - linux/compat/include/linux/compiler-gcc.h \ - linux/compat/include/linux/cpumask.h \ - linux/compat/include/linux/err.h \ - linux/compat/include/linux/etherdevice.h \ - linux/compat/include/linux/flex_array.h \ - linux/compat/include/linux/hash.h \ - linux/compat/include/linux/icmp.h \ - linux/compat/include/linux/icmpv6.h \ - linux/compat/include/linux/if.h \ - linux/compat/include/linux/if_arp.h \ - linux/compat/include/linux/if_ether.h \ - linux/compat/include/linux/if_vlan.h \ - linux/compat/include/linux/in.h \ - linux/compat/include/linux/ip.h \ - linux/compat/include/linux/ipv6.h \ - linux/compat/include/linux/jiffies.h \ - linux/compat/include/linux/kconfig.h \ - linux/compat/include/linux/kernel.h \ - linux/compat/include/linux/list.h \ - linux/compat/include/linux/log2.h \ - linux/compat/include/linux/net.h \ - linux/compat/include/linux/random.h \ - linux/compat/include/linux/netdevice.h \ - linux/compat/include/linux/netdev_features.h \ - linux/compat/include/linux/netlink.h \ - linux/compat/include/linux/poison.h \ - linux/compat/include/linux/rculist.h \ - linux/compat/include/linux/rcupdate.h \ - linux/compat/include/linux/reciprocal_div.h \ - linux/compat/include/linux/rtnetlink.h \ - linux/compat/include/linux/sctp.h \ - linux/compat/include/linux/skbuff.h \ - linux/compat/include/linux/stddef.h \ - linux/compat/include/linux/tcp.h \ - linux/compat/include/linux/types.h \ - linux/compat/include/linux/u64_stats_sync.h \ - linux/compat/include/linux/udp.h \ - linux/compat/include/linux/workqueue.h \ - linux/compat/include/net/checksum.h \ - linux/compat/include/net/dst.h \ - linux/compat/include/net/flow_keys.h \ - linux/compat/include/net/genetlink.h \ - linux/compat/include/net/gre.h \ - linux/compat/include/net/inet_frag.h \ - linux/compat/include/net/ip.h \ - linux/compat/include/net/ip_tunnels.h \ - linux/compat/include/net/ipv6.h \ - linux/compat/include/net/net_namespace.h \ - linux/compat/include/net/netlink.h \ - linux/compat/include/net/sock.h \ - linux/compat/include/net/vxlan.h \ - linux/compat/include/net/sctp/checksum.h -openvswitch_extras = \ - README - -dist_sources = $(foreach module,$(dist_modules),$($(module)_sources)) -dist_headers = $(foreach module,$(dist_modules),$($(module)_headers)) -dist_extras = $(foreach module,$(dist_modules),$($(module)_extras)) -build_sources = $(foreach module,$(build_modules),$($(module)_sources)) -build_headers = $(foreach module,$(build_modules),$($(module)_headers)) -build_links = $(notdir $(build_sources)) -build_objects = $(notdir $(patsubst %.c,%.o,$(build_sources))) -CLEANFILES = distfiles -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Modules.mk $(srcdir)/linux/Modules.mk $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu datapath/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu datapath/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am - - -# The following is based on commands for the Automake "distdir" target. -distfiles: Makefile - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@ - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru openvswitch-2.3.1/datapath/Modules.mk openvswitch-2.4.0~git20150623/datapath/Modules.mk --- openvswitch-2.3.1/datapath/Modules.mk 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/Modules.mk 2015-06-23 18:46:21.000000000 +0000 @@ -2,7 +2,17 @@ # # Some modules should be built but not distributed, e.g. third-party # hwtable modules. -both_modules = openvswitch +build_multi_modules = \ + openvswitch +both_modules = \ + $(build_multi_modules) \ + vport_geneve \ + vport_gre \ + vport_lisp \ + vport_stt \ + vport_vxlan +# When changing the name of 'build_modules', please also update the +# print-build-modules in Makefile.am. build_modules = $(both_modules) # Modules to build dist_modules = $(both_modules) # Modules to distribute @@ -14,11 +24,14 @@ flow_netlink.c \ flow_table.c \ vport.c \ - vport-gre.c \ vport-internal_dev.c \ - vport-lisp.c \ - vport-netdev.c \ - vport-vxlan.c + vport-netdev.c + +vport_geneve_sources = vport-geneve.c +vport_vxlan_sources = vport-vxlan.c +vport_gre_sources = vport-gre.c +vport_lisp_sources = vport-lisp.c +vport_stt_sources = vport-stt.c openvswitch_headers = \ compat.h \ @@ -29,10 +42,11 @@ vlan.h \ vport.h \ vport-internal_dev.h \ - vport-netdev.h + vport-netdev.h \ + vport-vxlan.h openvswitch_extras = \ - README + README.md dist_sources = $(foreach module,$(dist_modules),$($(module)_sources)) dist_headers = $(foreach module,$(dist_modules),$($(module)_headers)) diff -Nru openvswitch-2.3.1/datapath/README openvswitch-2.4.0~git20150623/datapath/README --- openvswitch-2.3.1/datapath/README 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,235 +0,0 @@ -Open vSwitch datapath developer documentation -============================================= - -The Open vSwitch kernel module allows flexible userspace control over -flow-level packet processing on selected network devices. It can be -used to implement a plain Ethernet switch, network device bonding, -VLAN processing, network access control, flow-based network control, -and so on. - -The kernel module implements multiple "datapaths" (analogous to -bridges), each of which can have multiple "vports" (analogous to ports -within a bridge). Each datapath also has associated with it a "flow -table" that userspace populates with "flows" that map from keys based -on packet headers and metadata to sets of actions. The most common -action forwards the packet to another vport; other actions are also -implemented. - -When a packet arrives on a vport, the kernel module processes it by -extracting its flow key and looking it up in the flow table. If there -is a matching flow, it executes the associated actions. If there is -no match, it queues the packet to userspace for processing (as part of -its processing, userspace will likely set up a flow to handle further -packets of the same type entirely in-kernel). - - -Flow key compatibility ----------------------- - -Network protocols evolve over time. New protocols become important -and existing protocols lose their prominence. For the Open vSwitch -kernel module to remain relevant, it must be possible for newer -versions to parse additional protocols as part of the flow key. It -might even be desirable, someday, to drop support for parsing -protocols that have become obsolete. Therefore, the Netlink interface -to Open vSwitch is designed to allow carefully written userspace -applications to work with any version of the flow key, past or future. - -To support this forward and backward compatibility, whenever the -kernel module passes a packet to userspace, it also passes along the -flow key that it parsed from the packet. Userspace then extracts its -own notion of a flow key from the packet and compares it against the -kernel-provided version: - - - If userspace's notion of the flow key for the packet matches the - kernel's, then nothing special is necessary. - - - If the kernel's flow key includes more fields than the userspace - version of the flow key, for example if the kernel decoded IPv6 - headers but userspace stopped at the Ethernet type (because it - does not understand IPv6), then again nothing special is - necessary. Userspace can still set up a flow in the usual way, - as long as it uses the kernel-provided flow key to do it. - - - If the userspace flow key includes more fields than the - kernel's, for example if userspace decoded an IPv6 header but - the kernel stopped at the Ethernet type, then userspace can - forward the packet manually, without setting up a flow in the - kernel. This case is bad for performance because every packet - that the kernel considers part of the flow must go to userspace, - but the forwarding behavior is correct. (If userspace can - determine that the values of the extra fields would not affect - forwarding behavior, then it could set up a flow anyway.) - -How flow keys evolve over time is important to making this work, so -the following sections go into detail. - - -Flow key format ---------------- - -A flow key is passed over a Netlink socket as a sequence of Netlink -attributes. Some attributes represent packet metadata, defined as any -information about a packet that cannot be extracted from the packet -itself, e.g. the vport on which the packet was received. Most -attributes, however, are extracted from headers within the packet, -e.g. source and destination addresses from Ethernet, IP, or TCP -headers. - -The header file defines the exact format of the -flow key attributes. For informal explanatory purposes here, we write -them as comma-separated strings, with parentheses indicating arguments -and nesting. For example, the following could represent a flow key -corresponding to a TCP packet that arrived on vport 1: - - in_port(1), eth(src=e0:91:f5:21:d0:b2, dst=00:02:e3:0f:80:a4), - eth_type(0x0800), ipv4(src=172.16.0.20, dst=172.18.0.52, proto=17, tos=0, - frag=no), tcp(src=49163, dst=80) - -Often we ellipsize arguments not important to the discussion, e.g.: - - in_port(1), eth(...), eth_type(0x0800), ipv4(...), tcp(...) - - -Wildcarded flow key format --------------------------- - -A wildcarded flow is described with two sequences of Netlink attributes -passed over the Netlink socket. A flow key, exactly as described above, and an -optional corresponding flow mask. - -A wildcarded flow can represent a group of exact match flows. Each '1' bit -in the mask specifies a exact match with the corresponding bit in the flow key. -A '0' bit specifies a don't care bit, which will match either a '1' or '0' bit -of a incoming packet. Using wildcarded flow can improve the flow set up rate -by reduce the number of new flows need to be processed by the user space program. - -Support for the mask Netlink attribute is optional for both the kernel and user -space program. The kernel can ignore the mask attribute, installing an exact -match flow, or reduce the number of don't care bits in the kernel to less than -what was specified by the user space program. In this case, variations in bits -that the kernel does not implement will simply result in additional flow setups. -The kernel module will also work with user space programs that neither support -nor supply flow mask attributes. - -Since the kernel may ignore or modify wildcard bits, it can be difficult for -the userspace program to know exactly what matches are installed. There are -two possible approaches: reactively install flows as they miss the kernel -flow table (and therefore not attempt to determine wildcard changes at all) -or use the kernel's response messages to determine the installed wildcards. - -When interacting with userspace, the kernel should maintain the match portion -of the key exactly as originally installed. This will provides a handle to -identify the flow for all future operations. However, when reporting the -mask of an installed flow, the mask should include any restrictions imposed -by the kernel. - -The behavior when using overlapping wildcarded flows is undefined. It is the -responsibility of the user space program to ensure that any incoming packet -can match at most one flow, wildcarded or not. The current implementation -performs best-effort detection of overlapping wildcarded flows and may reject -some but not all of them. However, this behavior may change in future versions. - - -Basic rule for evolving flow keys ---------------------------------- - -Some care is needed to really maintain forward and backward -compatibility for applications that follow the rules listed under -"Flow key compatibility" above. - -The basic rule is obvious: - - ------------------------------------------------------------------ - New network protocol support must only supplement existing flow - key attributes. It must not change the meaning of already defined - flow key attributes. - ------------------------------------------------------------------ - -This rule does have less-obvious consequences so it is worth working -through a few examples. Suppose, for example, that the kernel module -did not already implement VLAN parsing. Instead, it just interpreted -the 802.1Q TPID (0x8100) as the Ethertype then stopped parsing the -packet. The flow key for any packet with an 802.1Q header would look -essentially like this, ignoring metadata: - - eth(...), eth_type(0x8100) - -Naively, to add VLAN support, it makes sense to add a new "vlan" flow -key attribute to contain the VLAN tag, then continue to decode the -encapsulated headers beyond the VLAN tag using the existing field -definitions. With this change, a TCP packet in VLAN 10 would have a -flow key much like this: - - eth(...), vlan(vid=10, pcp=0), eth_type(0x0800), ip(proto=6, ...), tcp(...) - -But this change would negatively affect a userspace application that -has not been updated to understand the new "vlan" flow key attribute. -The application could, following the flow compatibility rules above, -ignore the "vlan" attribute that it does not understand and therefore -assume that the flow contained IP packets. This is a bad assumption -(the flow only contains IP packets if one parses and skips over the -802.1Q header) and it could cause the application's behavior to change -across kernel versions even though it follows the compatibility rules. - -The solution is to use a set of nested attributes. This is, for -example, why 802.1Q support uses nested attributes. A TCP packet in -VLAN 10 is actually expressed as: - - eth(...), eth_type(0x8100), vlan(vid=10, pcp=0), encap(eth_type(0x0800), - ip(proto=6, ...), tcp(...))) - -Notice how the "eth_type", "ip", and "tcp" flow key attributes are -nested inside the "encap" attribute. Thus, an application that does -not understand the "vlan" key will not see either of those attributes -and therefore will not misinterpret them. (Also, the outer eth_type -is still 0x8100, not changed to 0x0800.) - -Handling malformed packets --------------------------- - -Don't drop packets in the kernel for malformed protocol headers, bad -checksums, etc. This would prevent userspace from implementing a -simple Ethernet switch that forwards every packet. - -Instead, in such a case, include an attribute with "empty" content. -It doesn't matter if the empty content could be valid protocol values, -as long as those values are rarely seen in practice, because userspace -can always forward all packets with those values to userspace and -handle them individually. - -For example, consider a packet that contains an IP header that -indicates protocol 6 for TCP, but which is truncated just after the IP -header, so that the TCP header is missing. The flow key for this -packet would include a tcp attribute with all-zero src and dst, like -this: - - eth(...), eth_type(0x0800), ip(proto=6, ...), tcp(src=0, dst=0) - -As another example, consider a packet with an Ethernet type of 0x8100, -indicating that a VLAN TCI should follow, but which is truncated just -after the Ethernet type. The flow key for this packet would include -an all-zero-bits vlan and an empty encap attribute, like this: - - eth(...), eth_type(0x8100), vlan(0), encap() - -Unlike a TCP packet with source and destination ports 0, an -all-zero-bits VLAN TCI is not that rare, so the CFI bit (aka -VLAN_TAG_PRESENT inside the kernel) is ordinarily set in a vlan -attribute expressly to allow this situation to be distinguished. -Thus, the flow key in this second example unambiguously indicates a -missing or malformed VLAN TCI. - -Other rules ------------ - -The other rules for flow keys are much less subtle: - - - Duplicate attributes are not allowed at a given nesting level. - - - Ordering of attributes is not significant. - - - When the kernel sends a given flow key to userspace, it always - composes it the same way. This allows userspace to hash and - compare entire flow keys that it may not be able to fully - interpret. diff -Nru openvswitch-2.3.1/datapath/README.md openvswitch-2.4.0~git20150623/datapath/README.md --- openvswitch-2.3.1/datapath/README.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/README.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,264 @@ +Open vSwitch datapath developer documentation +============================================= + +The Open vSwitch kernel module allows flexible userspace control over +flow-level packet processing on selected network devices. It can be +used to implement a plain Ethernet switch, network device bonding, +VLAN processing, network access control, flow-based network control, +and so on. + +The kernel module implements multiple "datapaths" (analogous to +bridges), each of which can have multiple "vports" (analogous to ports +within a bridge). Each datapath also has associated with it a "flow +table" that userspace populates with "flows" that map from keys based +on packet headers and metadata to sets of actions. The most common +action forwards the packet to another vport; other actions are also +implemented. + +When a packet arrives on a vport, the kernel module processes it by +extracting its flow key and looking it up in the flow table. If there +is a matching flow, it executes the associated actions. If there is +no match, it queues the packet to userspace for processing (as part of +its processing, userspace will likely set up a flow to handle further +packets of the same type entirely in-kernel). + + +Flow key compatibility +---------------------- + +Network protocols evolve over time. New protocols become important +and existing protocols lose their prominence. For the Open vSwitch +kernel module to remain relevant, it must be possible for newer +versions to parse additional protocols as part of the flow key. It +might even be desirable, someday, to drop support for parsing +protocols that have become obsolete. Therefore, the Netlink interface +to Open vSwitch is designed to allow carefully written userspace +applications to work with any version of the flow key, past or future. + +To support this forward and backward compatibility, whenever the +kernel module passes a packet to userspace, it also passes along the +flow key that it parsed from the packet. Userspace then extracts its +own notion of a flow key from the packet and compares it against the +kernel-provided version: + + - If userspace's notion of the flow key for the packet matches the + kernel's, then nothing special is necessary. + + - If the kernel's flow key includes more fields than the userspace + version of the flow key, for example if the kernel decoded IPv6 + headers but userspace stopped at the Ethernet type (because it + does not understand IPv6), then again nothing special is + necessary. Userspace can still set up a flow in the usual way, + as long as it uses the kernel-provided flow key to do it. + + - If the userspace flow key includes more fields than the + kernel's, for example if userspace decoded an IPv6 header but + the kernel stopped at the Ethernet type, then userspace can + forward the packet manually, without setting up a flow in the + kernel. This case is bad for performance because every packet + that the kernel considers part of the flow must go to userspace, + but the forwarding behavior is correct. (If userspace can + determine that the values of the extra fields would not affect + forwarding behavior, then it could set up a flow anyway.) + +How flow keys evolve over time is important to making this work, so +the following sections go into detail. + + +Flow key format +--------------- + +A flow key is passed over a Netlink socket as a sequence of Netlink +attributes. Some attributes represent packet metadata, defined as any +information about a packet that cannot be extracted from the packet +itself, e.g. the vport on which the packet was received. Most +attributes, however, are extracted from headers within the packet, +e.g. source and destination addresses from Ethernet, IP, or TCP +headers. + +The header file defines the exact format of the +flow key attributes. For informal explanatory purposes here, we write +them as comma-separated strings, with parentheses indicating arguments +and nesting. For example, the following could represent a flow key +corresponding to a TCP packet that arrived on vport 1: + + in_port(1), eth(src=e0:91:f5:21:d0:b2, dst=00:02:e3:0f:80:a4), + eth_type(0x0800), ipv4(src=172.16.0.20, dst=172.18.0.52, proto=17, tos=0, + frag=no), tcp(src=49163, dst=80) + +Often we ellipsize arguments not important to the discussion, e.g.: + + in_port(1), eth(...), eth_type(0x0800), ipv4(...), tcp(...) + + +Wildcarded flow key format +-------------------------- + +A wildcarded flow is described with two sequences of Netlink attributes +passed over the Netlink socket. A flow key, exactly as described above, and an +optional corresponding flow mask. + +A wildcarded flow can represent a group of exact match flows. Each '1' bit +in the mask specifies a exact match with the corresponding bit in the flow key. +A '0' bit specifies a don't care bit, which will match either a '1' or '0' bit +of a incoming packet. Using wildcarded flow can improve the flow set up rate +by reduce the number of new flows need to be processed by the user space program. + +Support for the mask Netlink attribute is optional for both the kernel and user +space program. The kernel can ignore the mask attribute, installing an exact +match flow, or reduce the number of don't care bits in the kernel to less than +what was specified by the user space program. In this case, variations in bits +that the kernel does not implement will simply result in additional flow setups. +The kernel module will also work with user space programs that neither support +nor supply flow mask attributes. + +Since the kernel may ignore or modify wildcard bits, it can be difficult for +the userspace program to know exactly what matches are installed. There are +two possible approaches: reactively install flows as they miss the kernel +flow table (and therefore not attempt to determine wildcard changes at all) +or use the kernel's response messages to determine the installed wildcards. + +When interacting with userspace, the kernel should maintain the match portion +of the key exactly as originally installed. This will provides a handle to +identify the flow for all future operations. However, when reporting the +mask of an installed flow, the mask should include any restrictions imposed +by the kernel. + +The behavior when using overlapping wildcarded flows is undefined. It is the +responsibility of the user space program to ensure that any incoming packet +can match at most one flow, wildcarded or not. The current implementation +performs best-effort detection of overlapping wildcarded flows and may reject +some but not all of them. However, this behavior may change in future versions. + + +Unique flow identifiers +----------------------- + +An alternative to using the original match portion of a key as the handle for +flow identification is a unique flow identifier, or "UFID". UFIDs are optional +for both the kernel and user space program. + +User space programs that support UFID are expected to provide it during flow +setup in addition to the flow, then refer to the flow using the UFID for all +future operations. The kernel is not required to index flows by the original +flow key if a UFID is specified. + + +Basic rule for evolving flow keys +--------------------------------- + +Some care is needed to really maintain forward and backward +compatibility for applications that follow the rules listed under +"Flow key compatibility" above. + +The basic rule is obvious: + + ------------------------------------------------------------------ + New network protocol support must only supplement existing flow + key attributes. It must not change the meaning of already defined + flow key attributes. + ------------------------------------------------------------------ + +This rule does have less-obvious consequences so it is worth working +through a few examples. Suppose, for example, that the kernel module +did not already implement VLAN parsing. Instead, it just interpreted +the 802.1Q TPID (0x8100) as the Ethertype then stopped parsing the +packet. The flow key for any packet with an 802.1Q header would look +essentially like this, ignoring metadata: + + eth(...), eth_type(0x8100) + +Naively, to add VLAN support, it makes sense to add a new "vlan" flow +key attribute to contain the VLAN tag, then continue to decode the +encapsulated headers beyond the VLAN tag using the existing field +definitions. With this change, a TCP packet in VLAN 10 would have a +flow key much like this: + + eth(...), vlan(vid=10, pcp=0), eth_type(0x0800), ip(proto=6, ...), tcp(...) + +But this change would negatively affect a userspace application that +has not been updated to understand the new "vlan" flow key attribute. +The application could, following the flow compatibility rules above, +ignore the "vlan" attribute that it does not understand and therefore +assume that the flow contained IP packets. This is a bad assumption +(the flow only contains IP packets if one parses and skips over the +802.1Q header) and it could cause the application's behavior to change +across kernel versions even though it follows the compatibility rules. + +The solution is to use a set of nested attributes. This is, for +example, why 802.1Q support uses nested attributes. A TCP packet in +VLAN 10 is actually expressed as: + + eth(...), eth_type(0x8100), vlan(vid=10, pcp=0), encap(eth_type(0x0800), + ip(proto=6, ...), tcp(...))) + +Notice how the "eth_type", "ip", and "tcp" flow key attributes are +nested inside the "encap" attribute. Thus, an application that does +not understand the "vlan" key will not see either of those attributes +and therefore will not misinterpret them. (Also, the outer eth_type +is still 0x8100, not changed to 0x0800.) + +Handling malformed packets +-------------------------- + +Don't drop packets in the kernel for malformed protocol headers, bad +checksums, etc. This would prevent userspace from implementing a +simple Ethernet switch that forwards every packet. + +Instead, in such a case, include an attribute with "empty" content. +It doesn't matter if the empty content could be valid protocol values, +as long as those values are rarely seen in practice, because userspace +can always forward all packets with those values to userspace and +handle them individually. + +For example, consider a packet that contains an IP header that +indicates protocol 6 for TCP, but which is truncated just after the IP +header, so that the TCP header is missing. The flow key for this +packet would include a tcp attribute with all-zero src and dst, like +this: + + eth(...), eth_type(0x0800), ip(proto=6, ...), tcp(src=0, dst=0) + +As another example, consider a packet with an Ethernet type of 0x8100, +indicating that a VLAN TCI should follow, but which is truncated just +after the Ethernet type. The flow key for this packet would include +an all-zero-bits vlan and an empty encap attribute, like this: + + eth(...), eth_type(0x8100), vlan(0), encap() + +Unlike a TCP packet with source and destination ports 0, an +all-zero-bits VLAN TCI is not that rare, so the CFI bit (aka +VLAN_TAG_PRESENT inside the kernel) is ordinarily set in a vlan +attribute expressly to allow this situation to be distinguished. +Thus, the flow key in this second example unambiguously indicates a +missing or malformed VLAN TCI. + +Other rules +----------- + +The other rules for flow keys are much less subtle: + + - Duplicate attributes are not allowed at a given nesting level. + + - Ordering of attributes is not significant. + + - When the kernel sends a given flow key to userspace, it always + composes it the same way. This allows userspace to hash and + compare entire flow keys that it may not be able to fully + interpret. + + +Coding rules +============ + +Compatibility +------------- + +Please implement the headers and codes for compatibility with older kernel +in linux/compat/ directory. All public functions should be exported using +EXPORT_SYMBOL macro. Public function replacing the same-named kernel +function should be prefixed with 'rpl_'. Otherwise, the function should be +prefixed with 'ovs_'. For special case when it is not possible to follow +this rule (e.g., the pskb_expand_head() function), the function name must +be added to linux/compat/build-aux/export-check-whitelist, otherwise, the +compilation check 'check-export-symbol' will fail. diff -Nru openvswitch-2.3.1/datapath/vport.c openvswitch-2.4.0~git20150623/datapath/vport.c --- openvswitch-2.3.1/datapath/vport.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport.c 2015-06-23 18:46:21.000000000 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -32,24 +33,14 @@ #include #include "datapath.h" +#include "gso.h" #include "vport.h" #include "vport-internal_dev.h" static void ovs_vport_record_error(struct vport *, enum vport_err_type err_type); -/* List of statically compiled vport implementations. Don't forget to also - * add yours to the list at the bottom of vport.h. */ -static const struct vport_ops *vport_ops_list[] = { - &ovs_netdev_vport_ops, - &ovs_internal_vport_ops, -#if IS_ENABLED(CONFIG_NET_IPGRE_DEMUX) - &ovs_gre_vport_ops, - &ovs_gre64_vport_ops, -#endif - &ovs_vxlan_vport_ops, - &ovs_lisp_vport_ops, -}; +static LIST_HEAD(vport_ops_list); /* Protected by RCU read lock for reading, ovs_mutex for writing. */ static struct hlist_head *dev_table; @@ -80,12 +71,38 @@ kfree(dev_table); } -static struct hlist_head *hash_bucket(struct net *net, const char *name) +static struct hlist_head *hash_bucket(const struct net *net, const char *name) { unsigned int hash = jhash(name, strlen(name), (unsigned long) net); return &dev_table[hash & (VPORT_HASH_BUCKETS - 1)]; } +int ovs_vport_ops_register(struct vport_ops *ops) +{ + int err = -EEXIST; + struct vport_ops *o; + + ovs_lock(); + list_for_each_entry(o, &vport_ops_list, list) + if (ops->type == o->type) + goto errout; + + list_add_tail(&ops->list, &vport_ops_list); + err = 0; +errout: + ovs_unlock(); + return err; +} +EXPORT_SYMBOL_GPL(ovs_vport_ops_register); + +void ovs_vport_ops_unregister(struct vport_ops *ops) +{ + ovs_lock(); + list_del(&ops->list); + ovs_unlock(); +} +EXPORT_SYMBOL_GPL(ovs_vport_ops_unregister); + /** * ovs_vport_locate - find a port that has already been created * @@ -93,7 +110,7 @@ * * Must be called with ovs or RCU read lock. */ -struct vport *ovs_vport_locate(struct net *net, const char *name) +struct vport *ovs_vport_locate(const struct net *net, const char *name) { struct hlist_head *bucket = hash_bucket(net, name); struct vport *vport; @@ -122,7 +139,6 @@ { struct vport *vport; size_t alloc_size; - int i; alloc_size = sizeof(struct vport); if (priv_size) { @@ -139,24 +155,30 @@ vport->ops = ops; INIT_HLIST_NODE(&vport->dp_hash_node); - if (ovs_vport_set_upcall_portids(vport, parms->upcall_portids)) + if (ovs_vport_set_upcall_portids(vport, parms->upcall_portids)) { + kfree(vport); return ERR_PTR(-EINVAL); + } - vport->percpu_stats = alloc_percpu(struct pcpu_sw_netstats); + vport->percpu_stats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); if (!vport->percpu_stats) { kfree(vport); return ERR_PTR(-ENOMEM); } - for_each_possible_cpu(i) { - struct pcpu_sw_netstats *vport_stats; - vport_stats = per_cpu_ptr(vport->percpu_stats, i); - u64_stats_init(&vport_stats->syncp); - } + return vport; +} +EXPORT_SYMBOL_GPL(ovs_vport_alloc); - spin_lock_init(&vport->stats_lock); +static struct vport_ops *ovs_vport_lookup(const struct vport_parms *parms) +{ + struct vport_ops *ops; - return vport; + list_for_each_entry(ops, &vport_ops_list, list) + if (ops->type == parms->type) + return ops; + + return NULL; } /** @@ -171,10 +193,11 @@ */ void ovs_vport_free(struct vport *vport) { - kfree((struct vport_portids __force *)vport->upcall_portids); + kfree(rcu_dereference_raw(vport->upcall_portids)); free_percpu(vport->percpu_stats); kfree(vport); } +EXPORT_SYMBOL_GPL(ovs_vport_free); /** * ovs_vport_add - add vport device (for kernel callers) @@ -186,31 +209,40 @@ */ struct vport *ovs_vport_add(const struct vport_parms *parms) { + struct vport_ops *ops; struct vport *vport; - int err = 0; - int i; - for (i = 0; i < ARRAY_SIZE(vport_ops_list); i++) { - if (vport_ops_list[i]->type == parms->type) { - struct hlist_head *bucket; - - vport = vport_ops_list[i]->create(parms); - if (IS_ERR(vport)) { - err = PTR_ERR(vport); - goto out; - } - - bucket = hash_bucket(ovs_dp_get_net(vport->dp), - vport->ops->get_name(vport)); - hlist_add_head_rcu(&vport->hash_node, bucket); + ops = ovs_vport_lookup(parms); + if (ops) { + struct hlist_head *bucket; + + if (!try_module_get(ops->owner)) + return ERR_PTR(-EAFNOSUPPORT); + + vport = ops->create(parms); + if (IS_ERR(vport)) { + module_put(ops->owner); return vport; } + + bucket = hash_bucket(ovs_dp_get_net(vport->dp), + vport->ops->get_name(vport)); + hlist_add_head_rcu(&vport->hash_node, bucket); + return vport; } - err = -EAFNOSUPPORT; + /* Unlock to attempt module load and return -EAGAIN if load + * was successful as we need to restart the port addition + * workflow. + */ + ovs_unlock(); + request_module("vport-type-%d", parms->type); + ovs_lock(); -out: - return ERR_PTR(err); + if (!ovs_vport_lookup(parms)) + return ERR_PTR(-EAFNOSUPPORT); + else + return ERR_PTR(-EAGAIN); } /** @@ -242,30 +274,11 @@ ASSERT_OVSL(); hlist_del_rcu(&vport->hash_node); + module_put(vport->ops->owner); vport->ops->destroy(vport); } /** - * ovs_vport_set_stats - sets offset device stats - * - * @vport: vport on which to set stats - * @stats: stats to set - * - * Provides a set of transmit, receive, and error stats to be added as an - * offset to the collected data when stats are retrieved. Some devices may not - * support setting the stats, in which case the result will always be - * -EOPNOTSUPP. - * - * Must be called with ovs_mutex. - */ -void ovs_vport_set_stats(struct vport *vport, struct ovs_vport_stats *stats) -{ - spin_lock_bh(&vport->stats_lock); - vport->offset_stats = *stats; - spin_unlock_bh(&vport->stats_lock); -} - -/** * ovs_vport_get_stats - retrieve device stats * * @vport: vport from which to retrieve the stats @@ -279,27 +292,25 @@ { int i; - /* We potentially have 3 sources of stats that need to be + /* We potentially have two surces of stats that need to be * combined: those we have collected (split into err_stats and - * percpu_stats), offset_stats from set_stats(), and device - * error stats from netdev->get_stats() (for errors that happen - * downstream and therefore aren't reported through our - * vport_record_error() function). - * Stats from first two sources are merged and reported by ovs over + * percpu_stats), and device error stats from netdev->get_stats() + * (for errors that happen downstream and therefore aren't + * reported through our vport_record_error() function). + * Stats from first source are reported by ovs over * OVS_VPORT_ATTR_STATS. * netdev-stats can be directly read over netlink-ioctl. */ - spin_lock_bh(&vport->stats_lock); - - *stats = vport->offset_stats; - - stats->rx_errors += vport->err_stats.rx_errors; - stats->tx_errors += vport->err_stats.tx_errors; - stats->tx_dropped += vport->err_stats.tx_dropped; - stats->rx_dropped += vport->err_stats.rx_dropped; - - spin_unlock_bh(&vport->stats_lock); + stats->rx_errors = atomic_long_read(&vport->err_stats.rx_errors); + stats->tx_errors = atomic_long_read(&vport->err_stats.tx_errors); + stats->tx_dropped = atomic_long_read(&vport->err_stats.tx_dropped); + stats->rx_dropped = atomic_long_read(&vport->err_stats.rx_dropped); + + stats->rx_bytes = 0; + stats->rx_packets = 0; + stats->tx_bytes = 0; + stats->tx_packets = 0; for_each_possible_cpu(i) { const struct pcpu_sw_netstats *percpu_stats; @@ -379,7 +390,7 @@ * * Must be called with ovs_mutex. */ -int ovs_vport_set_upcall_portids(struct vport *vport, struct nlattr *ids) +int ovs_vport_set_upcall_portids(struct vport *vport, const struct nlattr *ids) { struct vport_portids *old, *vport_portids; @@ -444,12 +455,12 @@ * * Returns the portid of the target socket. Must be called with rcu_read_lock. */ -u32 ovs_vport_find_upcall_portid(const struct vport *p, struct sk_buff *skb) +u32 ovs_vport_find_upcall_portid(const struct vport *vport, struct sk_buff *skb) { struct vport_portids *ids; u32 hash; - ids = rcu_dereference(p->upcall_portids); + ids = rcu_dereference(vport->upcall_portids); if (ids->n_ids == 1 && ids->ids[0] == 0) return 0; @@ -463,26 +474,37 @@ * * @vport: vport that received the packet * @skb: skb that was received - * @tun_key: tunnel (if any) that carried packet + * @tun_info: tunnel (if any) that carried packet * * Must be called with rcu_read_lock. The packet cannot be shared and * skb->data should point to the Ethernet header. The caller must have already * called compute_ip_summed() to initialize the checksumming fields. */ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb, - struct ovs_key_ipv4_tunnel *tun_key) + const struct ovs_tunnel_info *tun_info) { struct pcpu_sw_netstats *stats; + struct sw_flow_key key; + int error; stats = this_cpu_ptr(vport->percpu_stats); u64_stats_update_begin(&stats->syncp); stats->rx_packets++; - stats->rx_bytes += skb->len; + stats->rx_bytes += skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); u64_stats_update_end(&stats->syncp); - OVS_CB(skb)->tun_key = tun_key; - ovs_dp_process_received_packet(vport, skb); + ovs_skb_init_inner_protocol(skb); + OVS_CB(skb)->input_vport = vport; + OVS_CB(skb)->egress_tun_info = NULL; + error = ovs_flow_key_extract(tun_info, skb, &key); + if (unlikely(error)) { + kfree_skb(skb); + return; + } + + ovs_dp_process_packet(skb, &key); } +EXPORT_SYMBOL_GPL(ovs_vport_receive); /** * ovs_vport_send - send a packet on a device @@ -508,9 +530,9 @@ u64_stats_update_end(&stats->syncp); } else if (sent < 0) { ovs_vport_record_error(vport, VPORT_E_TX_ERROR); - kfree_skb(skb); - } else + } else { ovs_vport_record_error(vport, VPORT_E_TX_DROPPED); + } return sent; } @@ -527,27 +549,23 @@ static void ovs_vport_record_error(struct vport *vport, enum vport_err_type err_type) { - spin_lock(&vport->stats_lock); - switch (err_type) { case VPORT_E_RX_DROPPED: - vport->err_stats.rx_dropped++; + atomic_long_inc(&vport->err_stats.rx_dropped); break; case VPORT_E_RX_ERROR: - vport->err_stats.rx_errors++; + atomic_long_inc(&vport->err_stats.rx_errors); break; case VPORT_E_TX_DROPPED: - vport->err_stats.tx_dropped++; + atomic_long_inc(&vport->err_stats.tx_dropped); break; case VPORT_E_TX_ERROR: - vport->err_stats.tx_errors++; + atomic_long_inc(&vport->err_stats.tx_errors); break; } - - spin_unlock(&vport->stats_lock); } static void free_vport_rcu(struct rcu_head *rcu) @@ -564,3 +582,63 @@ call_rcu(&vport->rcu, free_vport_rcu); } +EXPORT_SYMBOL_GPL(ovs_vport_deferred_free); + +int ovs_tunnel_get_egress_info(struct ovs_tunnel_info *egress_tun_info, + struct net *net, + const struct ovs_tunnel_info *tun_info, + u8 ipproto, + u32 skb_mark, + __be16 tp_src, + __be16 tp_dst) +{ + const struct ovs_key_ipv4_tunnel *tun_key; + struct rtable *rt; + __be32 saddr; + + if (unlikely(!tun_info)) + return -EINVAL; + + tun_key = &tun_info->tunnel; + saddr = tun_key->ipv4_src; + /* Route lookup to get srouce IP address: saddr. + * The process may need to be changed if the corresponding process + * in vports ops changed. + */ + rt = find_route(net, + &saddr, + tun_key->ipv4_dst, + ipproto, + tun_key->ipv4_tos, + skb_mark); + if (IS_ERR(rt)) + return PTR_ERR(rt); + + ip_rt_put(rt); + + /* Generate egress_tun_info based on tun_info, + * saddr, tp_src and tp_dst + */ + __ovs_flow_tun_info_init(egress_tun_info, + saddr, tun_key->ipv4_dst, + tun_key->ipv4_tos, + tun_key->ipv4_ttl, + tp_src, tp_dst, + tun_key->tun_id, + tun_key->tun_flags, + tun_info->options, + tun_info->options_len); + + return 0; +} +EXPORT_SYMBOL_GPL(ovs_tunnel_get_egress_info); + +int ovs_vport_get_egress_tun_info(struct vport *vport, struct sk_buff *skb, + struct ovs_tunnel_info *info) +{ + /* get_egress_tun_info() is only implemented on tunnel ports. */ + if (unlikely(!vport->ops->get_egress_tun_info)) + return -EINVAL; + + return vport->ops->get_egress_tun_info(vport, skb, info); +} diff -Nru openvswitch-2.3.1/datapath/vport-geneve.c openvswitch-2.4.0~git20150623/datapath/vport-geneve.c --- openvswitch-2.3.1/datapath/vport-geneve.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-geneve.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,279 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "datapath.h" +#include "vport.h" + +static struct vport_ops ovs_geneve_vport_ops; + +/** + * struct geneve_port - Keeps track of open UDP ports + * @gs: The socket created for this port number. + * @name: vport name. + */ +struct geneve_port { + struct geneve_sock *gs; + char name[IFNAMSIZ]; +}; + +static LIST_HEAD(geneve_ports); + +static inline struct geneve_port *geneve_vport(const struct vport *vport) +{ + return vport_priv(vport); +} + +static inline struct genevehdr *geneve_hdr(const struct sk_buff *skb) +{ + return (struct genevehdr *)(udp_hdr(skb) + 1); +} + +/* Convert 64 bit tunnel ID to 24 bit VNI. */ +static void tunnel_id_to_vni(__be64 tun_id, __u8 *vni) +{ +#ifdef __BIG_ENDIAN + vni[0] = (__force __u8)(tun_id >> 16); + vni[1] = (__force __u8)(tun_id >> 8); + vni[2] = (__force __u8)tun_id; +#else + vni[0] = (__force __u8)((__force u64)tun_id >> 40); + vni[1] = (__force __u8)((__force u64)tun_id >> 48); + vni[2] = (__force __u8)((__force u64)tun_id >> 56); +#endif +} + +/* Convert 24 bit VNI to 64 bit tunnel ID. */ +static __be64 vni_to_tunnel_id(const __u8 *vni) +{ +#ifdef __BIG_ENDIAN + return (vni[0] << 16) | (vni[1] << 8) | vni[2]; +#else + return (__force __be64)(((__force u64)vni[0] << 40) | + ((__force u64)vni[1] << 48) | + ((__force u64)vni[2] << 56)); +#endif +} + +static void geneve_rcv(struct geneve_sock *gs, struct sk_buff *skb) +{ + struct vport *vport = gs->rcv_data; + struct genevehdr *geneveh = geneve_hdr(skb); + int opts_len; + struct ovs_tunnel_info tun_info; + __be64 key; + __be16 flags; + + opts_len = geneveh->opt_len * 4; + + flags = TUNNEL_KEY | TUNNEL_GENEVE_OPT | + (udp_hdr(skb)->check != 0 ? TUNNEL_CSUM : 0) | + (geneveh->oam ? TUNNEL_OAM : 0) | + (geneveh->critical ? TUNNEL_CRIT_OPT : 0); + + key = vni_to_tunnel_id(geneveh->vni); + + ovs_flow_tun_info_init(&tun_info, ip_hdr(skb), + udp_hdr(skb)->source, udp_hdr(skb)->dest, + key, flags, + geneveh->options, opts_len); + + ovs_vport_receive(vport, skb, &tun_info); +} + +static int geneve_get_options(const struct vport *vport, + struct sk_buff *skb) +{ + struct geneve_port *geneve_port = geneve_vport(vport); + __be16 dst_port = inet_sport(geneve_port->gs->sock->sk); + + if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(dst_port))) + return -EMSGSIZE; + return 0; +} + +static void geneve_tnl_destroy(struct vport *vport) +{ + struct geneve_port *geneve_port = geneve_vport(vport); + + geneve_sock_release(geneve_port->gs); + + ovs_vport_deferred_free(vport); +} + +static struct vport *geneve_tnl_create(const struct vport_parms *parms) +{ + struct net *net = ovs_dp_get_net(parms->dp); + struct nlattr *options = parms->options; + struct geneve_port *geneve_port; + struct geneve_sock *gs; + struct vport *vport; + struct nlattr *a; + int err; + u16 dst_port; + + if (!options) { + err = -EINVAL; + goto error; + } + + a = nla_find_nested(options, OVS_TUNNEL_ATTR_DST_PORT); + if (a && nla_len(a) == sizeof(u16)) { + dst_port = nla_get_u16(a); + } else { + /* Require destination port from userspace. */ + err = -EINVAL; + goto error; + } + + vport = ovs_vport_alloc(sizeof(struct geneve_port), + &ovs_geneve_vport_ops, parms); + if (IS_ERR(vport)) + return vport; + + geneve_port = geneve_vport(vport); + strncpy(geneve_port->name, parms->name, IFNAMSIZ); + + gs = geneve_sock_add(net, htons(dst_port), geneve_rcv, vport, true, 0); + if (IS_ERR(gs)) { + ovs_vport_free(vport); + return (void *)gs; + } + geneve_port->gs = gs; + + return vport; +error: + return ERR_PTR(err); +} + +static int geneve_tnl_send(struct vport *vport, struct sk_buff *skb) +{ + const struct ovs_key_ipv4_tunnel *tun_key; + struct ovs_tunnel_info *tun_info; + struct net *net = ovs_dp_get_net(vport->dp); + struct geneve_port *geneve_port = geneve_vport(vport); + __be16 dport = inet_sport(geneve_port->gs->sock->sk); + __be16 sport; + __be32 saddr; + struct rtable *rt; + u8 vni[3], opts_len, *opts; + __be16 df; + int err; + + tun_info = OVS_CB(skb)->egress_tun_info; + if (unlikely(!tun_info)) { + err = -EINVAL; + goto error; + } + + tun_key = &tun_info->tunnel; + + saddr = tun_key->ipv4_src; + rt = find_route(ovs_dp_get_net(vport->dp), + &saddr, tun_key->ipv4_dst, + IPPROTO_UDP, tun_key->ipv4_tos, + skb->mark); + if (IS_ERR(rt)) { + err = PTR_ERR(rt); + goto error; + } + + df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; + sport = udp_flow_src_port(net, skb, 1, USHRT_MAX, true); + tunnel_id_to_vni(tun_key->tun_id, vni); + skb->ignore_df = 1; + + if (tun_key->tun_flags & TUNNEL_GENEVE_OPT) { + opts = (u8 *)tun_info->options; + opts_len = tun_info->options_len; + } else { + opts = NULL; + opts_len = 0; + } + + err = geneve_xmit_skb(geneve_port->gs, rt, skb, saddr, + tun_key->ipv4_dst, tun_key->ipv4_tos, + tun_key->ipv4_ttl, df, sport, dport, + tun_key->tun_flags, vni, opts_len, opts, + !!(tun_key->tun_flags & TUNNEL_CSUM), false); + if (err < 0) + ip_rt_put(rt); + return err; + +error: + kfree_skb(skb); + return err; +} + +static const char *geneve_get_name(const struct vport *vport) +{ + struct geneve_port *geneve_port = geneve_vport(vport); + + return geneve_port->name; +} + +static int geneve_get_egress_tun_info(struct vport *vport, struct sk_buff *skb, + struct ovs_tunnel_info *egress_tun_info) +{ + struct geneve_port *geneve_port = geneve_vport(vport); + struct net *net = ovs_dp_get_net(vport->dp); + __be16 dport = inet_sport(geneve_port->gs->sock->sk); + __be16 sport = udp_flow_src_port(net, skb, 1, USHRT_MAX, true); + + /* Get tp_src and tp_dst, refert to geneve_build_header(). + */ + return ovs_tunnel_get_egress_info(egress_tun_info, + ovs_dp_get_net(vport->dp), + OVS_CB(skb)->egress_tun_info, + IPPROTO_UDP, skb->mark, sport, dport); +} + +static struct vport_ops ovs_geneve_vport_ops = { + .type = OVS_VPORT_TYPE_GENEVE, + .create = geneve_tnl_create, + .destroy = geneve_tnl_destroy, + .get_name = geneve_get_name, + .get_options = geneve_get_options, + .send = geneve_tnl_send, + .get_egress_tun_info = geneve_get_egress_tun_info, + .owner = THIS_MODULE, +}; + +static int __init ovs_geneve_tnl_init(void) +{ + return ovs_vport_ops_register(&ovs_geneve_vport_ops); +} + +static void __exit ovs_geneve_tnl_exit(void) +{ + ovs_vport_ops_unregister(&ovs_geneve_vport_ops); +} + +module_init(ovs_geneve_tnl_init); +module_exit(ovs_geneve_tnl_exit); + +MODULE_DESCRIPTION("OVS: Geneve swiching port"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("vport-type-5"); diff -Nru openvswitch-2.3.1/datapath/vport-gre.c openvswitch-2.4.0~git20150623/datapath/vport-gre.c --- openvswitch-2.3.1/datapath/vport-gre.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-gre.c 2015-06-23 18:46:21.000000000 +0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,9 @@ #include "datapath.h" #include "vport.h" +static struct vport_ops ovs_gre_vport_ops; +static struct vport_ops ovs_gre64_vport_ops; + /* Returns the least-significant 32 bits of a __be64. */ static __be32 be64_get_low32(__be64 x) { @@ -66,12 +70,13 @@ int tunnel_hlen, __be32 seq, __be16 gre64_flag) { - const struct ovs_key_ipv4_tunnel *tun_key = OVS_CB(skb)->tun_key; + const struct ovs_key_ipv4_tunnel *tun_key; struct tnl_ptk_info tpi; + tun_key = &OVS_CB(skb)->egress_tun_info->tunnel; skb = gre_handle_offloads(skb, !!(tun_key->tun_flags & TUNNEL_CSUM)); if (IS_ERR(skb)) - return NULL; + return skb; tpi.flags = filter_tnl_flags(tun_key->tun_flags) | gre64_flag; @@ -96,7 +101,7 @@ static int gre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi) { - struct ovs_key_ipv4_tunnel tun_key; + struct ovs_tunnel_info tun_info; struct ovs_net *ovs_net; struct vport *vport; __be64 key; @@ -110,9 +115,10 @@ return PACKET_REJECT; key = key_to_tunnel_id(tpi->key, tpi->seq); - ovs_flow_tun_key_init(&tun_key, ip_hdr(skb), key, filter_tnl_flags(tpi->flags)); + ovs_flow_tun_info_init(&tun_info, ip_hdr(skb), 0, 0, key, + filter_tnl_flags(tpi->flags), NULL, 0); - ovs_vport_receive(vport, skb, &tun_key); + ovs_vport_receive(vport, skb, &tun_info); return PACKET_RCVD; } @@ -139,6 +145,7 @@ int tunnel_hlen, __be32 seq, __be16 gre64_flag) { + struct ovs_key_ipv4_tunnel *tun_key; struct rtable *rt; int min_headroom; __be16 df; @@ -146,12 +153,11 @@ int err; /* Route lookup */ - saddr = OVS_CB(skb)->tun_key->ipv4_src; + tun_key = &OVS_CB(skb)->egress_tun_info->tunnel; + saddr = tun_key->ipv4_src; rt = find_route(ovs_dp_get_net(vport->dp), - &saddr, - OVS_CB(skb)->tun_key->ipv4_dst, - IPPROTO_GRE, - OVS_CB(skb)->tun_key->ipv4_tos, + &saddr, tun_key->ipv4_dst, + IPPROTO_GRE, tun_key->ipv4_tos, skb->mark); if (IS_ERR(rt)) { err = PTR_ERR(rt); @@ -160,7 +166,7 @@ min_headroom = LL_RESERVED_SPACE(rt_dst(rt).dev) + rt_dst(rt).header_len + tunnel_hlen + sizeof(struct iphdr) - + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); + + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); if (skb_headroom(skb) < min_headroom || skb_header_cloned(skb)) { int head_delta = SKB_DATA_ALIGN(min_headroom - @@ -172,11 +178,12 @@ goto err_free_rt; } - if (vlan_tx_tag_present(skb)) { - if (unlikely(!__vlan_put_tag(skb, - skb->vlan_proto, - vlan_tx_tag_get(skb)))) { + if (skb_vlan_tag_present(skb)) { + if (unlikely(!vlan_insert_tag_set_proto(skb, + skb->vlan_proto, + skb_vlan_tag_get(skb)))) { err = -ENOMEM; + skb = NULL; goto err_free_rt; } vlan_set_tci(skb, 0); @@ -184,23 +191,23 @@ /* Push Tunnel header. */ skb = __build_header(skb, tunnel_hlen, seq, gre64_flag); - if (unlikely(!skb)) { - err = 0; + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + skb = NULL; goto err_free_rt; } - df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? - htons(IP_DF) : 0; - - skb->local_df = 1; + df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; + skb->ignore_df = 1; - return iptunnel_xmit(rt, skb, saddr, - OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE, - OVS_CB(skb)->tun_key->ipv4_tos, - OVS_CB(skb)->tun_key->ipv4_ttl, df, false); + return iptunnel_xmit(skb->sk, rt, skb, saddr, + tun_key->ipv4_dst, IPPROTO_GRE, + tun_key->ipv4_tos, + tun_key->ipv4_ttl, df, false); err_free_rt: ip_rt_put(rt); error: + kfree_skb(skb); return err; } @@ -286,20 +293,33 @@ { int hlen; - if (unlikely(!OVS_CB(skb)->tun_key)) + if (unlikely(!OVS_CB(skb)->egress_tun_info)) { + kfree_skb(skb); return -EINVAL; + } - hlen = ip_gre_calc_hlen(OVS_CB(skb)->tun_key->tun_flags); + hlen = ip_gre_calc_hlen(OVS_CB(skb)->egress_tun_info->tunnel.tun_flags); return __send(vport, skb, hlen, 0, 0); } -const struct vport_ops ovs_gre_vport_ops = { - .type = OVS_VPORT_TYPE_GRE, - .create = gre_create, - .destroy = gre_tnl_destroy, - .get_name = gre_get_name, - .send = gre_send, +static int gre_get_egress_tun_info(struct vport *vport, struct sk_buff *skb, + struct ovs_tunnel_info *egress_tun_info) +{ + return ovs_tunnel_get_egress_info(egress_tun_info, + ovs_dp_get_net(vport->dp), + OVS_CB(skb)->egress_tun_info, + IPPROTO_GRE, skb->mark, 0, 0); +} + +static struct vport_ops ovs_gre_vport_ops = { + .type = OVS_VPORT_TYPE_GRE, + .create = gre_create, + .destroy = gre_tnl_destroy, + .get_name = gre_get_name, + .send = gre_send, + .get_egress_tun_info = gre_get_egress_tun_info, + .owner = THIS_MODULE, }; /* GRE64 vport. */ @@ -360,21 +380,54 @@ GRE_HEADER_SECTION; /* GRE SEQ */ __be32 seq; - if (unlikely(!OVS_CB(skb)->tun_key)) + if (unlikely(!OVS_CB(skb)->egress_tun_info)) { + kfree_skb(skb); return -EINVAL; + } - if (OVS_CB(skb)->tun_key->tun_flags & TUNNEL_CSUM) + if (OVS_CB(skb)->egress_tun_info->tunnel.tun_flags & TUNNEL_CSUM) hlen += GRE_HEADER_SECTION; - seq = be64_get_high32(OVS_CB(skb)->tun_key->tun_id); + seq = be64_get_high32(OVS_CB(skb)->egress_tun_info->tunnel.tun_id); return __send(vport, skb, hlen, seq, (TUNNEL_KEY|TUNNEL_SEQ)); } -const struct vport_ops ovs_gre64_vport_ops = { - .type = OVS_VPORT_TYPE_GRE64, - .create = gre64_create, - .destroy = gre64_tnl_destroy, - .get_name = gre_get_name, - .send = gre64_send, +static struct vport_ops ovs_gre64_vport_ops = { + .type = OVS_VPORT_TYPE_GRE64, + .create = gre64_create, + .destroy = gre64_tnl_destroy, + .get_name = gre_get_name, + .send = gre64_send, + .get_egress_tun_info = gre_get_egress_tun_info, + .owner = THIS_MODULE, }; + +static int __init ovs_gre_tnl_init(void) +{ + int err; + + err = ovs_vport_ops_register(&ovs_gre_vport_ops); + if (err < 0) + return err; + + err = ovs_vport_ops_register(&ovs_gre64_vport_ops); + if (err < 0) + ovs_vport_ops_unregister(&ovs_gre_vport_ops); + + return err; +} + +static void __exit ovs_gre_tnl_exit(void) +{ + ovs_vport_ops_unregister(&ovs_gre64_vport_ops); + ovs_vport_ops_unregister(&ovs_gre_vport_ops); +} + +module_init(ovs_gre_tnl_init); +module_exit(ovs_gre_tnl_exit); + +MODULE_DESCRIPTION("OVS: GRE switching port"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("vport-type-3"); +MODULE_ALIAS("vport-type-104"); #endif diff -Nru openvswitch-2.3.1/datapath/vport.h openvswitch-2.4.0~git20150623/datapath/vport.h --- openvswitch-2.3.1/datapath/vport.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport.h 2015-06-23 18:46:21.000000000 +0000 @@ -43,28 +43,37 @@ struct vport *ovs_vport_add(const struct vport_parms *); void ovs_vport_del(struct vport *); -struct vport *ovs_vport_locate(struct net *net, const char *name); +struct vport *ovs_vport_locate(const struct net *net, const char *name); -void ovs_vport_set_stats(struct vport *, struct ovs_vport_stats *); void ovs_vport_get_stats(struct vport *, struct ovs_vport_stats *); int ovs_vport_set_options(struct vport *, struct nlattr *options); int ovs_vport_get_options(const struct vport *, struct sk_buff *); -int ovs_vport_set_upcall_portids(struct vport *, struct nlattr *pids); +int ovs_vport_set_upcall_portids(struct vport *, const struct nlattr *pids); int ovs_vport_get_upcall_portids(const struct vport *, struct sk_buff *); u32 ovs_vport_find_upcall_portid(const struct vport *, struct sk_buff *); int ovs_vport_send(struct vport *, struct sk_buff *); -/* The following definitions are for implementers of vport devices: */ +int ovs_tunnel_get_egress_info(struct ovs_tunnel_info *egress_tun_info, + struct net *net, + const struct ovs_tunnel_info *tun_info, + u8 ipproto, + u32 skb_mark, + __be16 tp_src, + __be16 tp_dst); +int ovs_vport_get_egress_tun_info(struct vport *vport, struct sk_buff *skb, + struct ovs_tunnel_info *info); +/* The following definitions are for implementers of vport devices: */ struct vport_err_stats { - u64 rx_dropped; - u64 rx_errors; - u64 tx_dropped; - u64 tx_errors; + atomic_long_t rx_dropped; + atomic_long_t rx_errors; + atomic_long_t tx_dropped; + atomic_long_t tx_errors; }; + /** * struct vport_portids - array of netlink portids of a vport. * must be protected by rcu. @@ -91,10 +100,8 @@ * @dp_hash_node: Element in @datapath->ports hash table in datapath.c. * @ops: Class structure. * @percpu_stats: Points to per-CPU statistics used and maintained by vport - * @stats_lock: Protects @err_stats and @offset_stats. * @err_stats: Points to error statistics used and maintained by vport - * @offset_stats: Added to actual statistics as a sop to compatibility with - * XAPI for Citrix XenServer. Deprecated. + * @detach_list: list used for detaching vport in net-exit call. */ struct vport { struct rcu_head rcu; @@ -108,9 +115,8 @@ struct pcpu_sw_netstats __percpu *percpu_stats; - spinlock_t stats_lock; struct vport_err_stats err_stats; - struct ovs_vport_stats offset_stats; + struct list_head detach_list; }; /** @@ -150,6 +156,8 @@ * @get_name: Get the device's name. * @send: Send a packet on the device. Returns the length of the packet sent, * zero for dropped packets or negative for error. + * @get_egress_tun_info: Get the egress tunnel 5-tuple and other info for + * a packet. */ struct vport_ops { enum ovs_vport_type type; @@ -165,6 +173,11 @@ const char *(*get_name)(const struct vport *); int (*send)(struct vport *, struct sk_buff *); + int (*get_egress_tun_info)(struct vport *, struct sk_buff *, + struct ovs_tunnel_info *); + + struct module *owner; + struct list_head list; }; enum vport_err_type { @@ -211,16 +224,8 @@ } void ovs_vport_receive(struct vport *, struct sk_buff *, - struct ovs_key_ipv4_tunnel *); + const struct ovs_tunnel_info *); -/* List of statically compiled vport implementations. Don't forget to also - * add yours to the list at the top of vport.c. */ -extern const struct vport_ops ovs_netdev_vport_ops; -extern const struct vport_ops ovs_internal_vport_ops; -extern const struct vport_ops ovs_gre_vport_ops; -extern const struct vport_ops ovs_gre64_vport_ops; -extern const struct vport_ops ovs_vxlan_vport_ops; -extern const struct vport_ops ovs_lisp_vport_ops; static inline void ovs_skb_postpush_rcsum(struct sk_buff *skb, const void *start, unsigned int len) @@ -228,4 +233,7 @@ if (skb->ip_summed == CHECKSUM_COMPLETE) skb->csum = csum_add(skb->csum, csum_partial(start, len, 0)); } + +int ovs_vport_ops_register(struct vport_ops *ops); +void ovs_vport_ops_unregister(struct vport_ops *ops); #endif /* vport.h */ diff -Nru openvswitch-2.3.1/datapath/vport-internal_dev.c openvswitch-2.4.0~git20150623/datapath/vport-internal_dev.c --- openvswitch-2.3.1/datapath/vport-internal_dev.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-internal_dev.c 2015-06-23 18:46:21.000000000 +0000 @@ -38,6 +38,8 @@ struct vport *vport; }; +static struct vport_ops ovs_internal_vport_ops; + static struct internal_dev *internal_dev_priv(struct net_device *netdev) { return netdev_priv(netdev); @@ -59,7 +61,8 @@ ovs_vport_get_stats(vport, &vport_stats); /* The tx and rx stats need to be swapped because the - * switch and host OS have opposite perspectives. */ + * switch and host OS have opposite perspectives. + */ stats->rx_packets = vport_stats.tx_packets; stats->tx_packets = vport_stats.rx_packets; stats->rx_bytes = vport_stats.tx_bytes; @@ -142,6 +145,10 @@ #endif }; +static struct rtnl_link_ops internal_dev_link_ops __read_mostly = { + .kind = "openvswitch", +}; + static void do_setup(struct net_device *netdev) { ether_setup(netdev); @@ -151,7 +158,8 @@ netdev->priv_flags &= ~IFF_TX_SKB_SHARING; netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE; netdev->destructor = internal_dev_destructor; - SET_ETHTOOL_OPS(netdev, &internal_dev_ethtool_ops); + netdev->ethtool_ops = &internal_dev_ethtool_ops; + netdev->rtnl_link_ops = &internal_dev_link_ops; netdev->tx_queue_len = 0; netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST | @@ -189,7 +197,7 @@ netdev_vport = netdev_vport_priv(vport); netdev_vport->dev = alloc_netdev(sizeof(struct internal_dev), - parms->name, do_setup); + parms->name, NET_NAME_UNKNOWN, do_setup); if (!netdev_vport->dev) { err = -ENOMEM; goto error_free_vport; @@ -248,10 +256,10 @@ } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) - if (vlan_tx_tag_present(skb)) { - if (unlikely(!__vlan_put_tag(skb, - skb->vlan_proto, - vlan_tx_tag_get(skb)))) + if (skb_vlan_tag_present(skb)) { + if (unlikely(!vlan_insert_tag_set_proto(skb, + skb->vlan_proto, + skb_vlan_tag_get(skb)))) return 0; if (skb->ip_summed == CHECKSUM_COMPLETE) @@ -279,7 +287,7 @@ return len; } -const struct vport_ops ovs_internal_vport_ops = { +static struct vport_ops ovs_internal_vport_ops = { .type = OVS_VPORT_TYPE_INTERNAL, .create = internal_dev_create, .destroy = internal_dev_destroy, @@ -299,3 +307,24 @@ return internal_dev_priv(netdev)->vport; } + +int ovs_internal_dev_rtnl_link_register(void) +{ + int err; + + err = rtnl_link_register(&internal_dev_link_ops); + if (err < 0) + return err; + + err = ovs_vport_ops_register(&ovs_internal_vport_ops); + if (err < 0) + rtnl_link_unregister(&internal_dev_link_ops); + + return err; +} + +void ovs_internal_dev_rtnl_link_unregister(void) +{ + ovs_vport_ops_unregister(&ovs_internal_vport_ops); + rtnl_link_unregister(&internal_dev_link_ops); +} diff -Nru openvswitch-2.3.1/datapath/vport-internal_dev.h openvswitch-2.4.0~git20150623/datapath/vport-internal_dev.h --- openvswitch-2.3.1/datapath/vport-internal_dev.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-internal_dev.h 2015-06-23 18:46:21.000000000 +0000 @@ -24,5 +24,7 @@ int ovs_is_internal_dev(const struct net_device *); struct vport *ovs_internal_dev_get_vport(struct net_device *); +int ovs_internal_dev_rtnl_link_register(void); +void ovs_internal_dev_rtnl_link_unregister(void); #endif /* vport-internal_dev.h */ diff -Nru openvswitch-2.3.1/datapath/vport-lisp.c openvswitch-2.4.0~git20150623/datapath/vport-lisp.c --- openvswitch-2.3.1/datapath/vport-lisp.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-lisp.c 2015-06-23 18:46:21.000000000 +0000 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -31,6 +32,7 @@ #include #include #include +#include #include #include "datapath.h" @@ -109,6 +111,7 @@ }; static LIST_HEAD(lisp_ports); +static struct vport_ops ovs_lisp_vport_ops; static inline struct lisp_port *lisp_vport(const struct vport *vport) { @@ -171,10 +174,22 @@ int low; if (!hash) { - struct sw_flow_key *pkt_key = OVS_CB(skb)->pkt_key; - - hash = jhash2((const u32 *)pkt_key, - sizeof(*pkt_key) / sizeof(u32), 0); + if (skb->protocol == htons(ETH_P_IP)) { + struct iphdr *iph; + int size = (sizeof(iph->saddr) * 2) / sizeof(u32); + + iph = (struct iphdr *) skb_network_header(skb); + hash = jhash2((const u32 *)&iph->saddr, size, 0); + } else if (skb->protocol == htons(ETH_P_IPV6)) { + struct ipv6hdr *ipv6hdr; + + ipv6hdr = (struct ipv6hdr *) skb_network_header(skb); + hash = jhash2((const u32 *)&ipv6hdr->saddr, + (sizeof(struct in6_addr) * 2) / sizeof(u32), 0); + } else { + pr_warn_once("LISP inner protocol is not IP when " + "calculating hash.\n"); + } } inet_get_local_port_range(net, &low, &high); @@ -182,20 +197,14 @@ return (((u64) hash * range) >> 32) + low; } -static void lisp_build_header(const struct vport *vport, - struct sk_buff *skb) +static void lisp_build_header(struct sk_buff *skb) { - struct net *net = ovs_dp_get_net(vport->dp); - struct lisp_port *lisp_port = lisp_vport(vport); - struct udphdr *udph = udp_hdr(skb); - struct lisphdr *lisph = (struct lisphdr *)(udph + 1); - const struct ovs_key_ipv4_tunnel *tun_key = OVS_CB(skb)->tun_key; - - udph->dest = lisp_port->dst_port; - udph->source = htons(get_src_port(net, skb)); - udph->check = 0; - udph->len = htons(skb->len - skb_transport_offset(skb)); + struct lisphdr *lisph; + const struct ovs_key_ipv4_tunnel *tun_key; + tun_key = &OVS_CB(skb)->egress_tun_info->tunnel; + + lisph = (struct lisphdr *)__skb_push(skb, sizeof(struct lisphdr)); lisph->nonce_present = 0; /* We don't support echo nonce algorithm */ lisph->locator_status_bits_present = 1; /* Set LSB */ lisph->solicit_echo_nonce = 0; /* No echo noncing */ @@ -217,12 +226,12 @@ struct lisp_port *lisp_port; struct lisphdr *lisph; struct iphdr *iph, *inner_iph; - struct ovs_key_ipv4_tunnel tun_key; + struct ovs_tunnel_info tun_info; __be64 key; struct ethhdr *ethh; __be16 protocol; - lisp_port = lisp_find_port(dev_net(skb->dev), udp_hdr(skb)->dest); + lisp_port = rcu_dereference_sk_user_data(sk); if (unlikely(!lisp_port)) goto error; @@ -238,7 +247,9 @@ /* Save outer tunnel values */ iph = ip_hdr(skb); - ovs_flow_tun_key_init(&tun_key, iph, key, TUNNEL_KEY); + ovs_flow_tun_info_init(&tun_info, iph, + udp_hdr(skb)->source, udp_hdr(skb)->dest, + key, TUNNEL_KEY, NULL, 0); /* Drop non-IP inner packets */ inner_iph = (struct iphdr *)(lisph + 1); @@ -263,7 +274,7 @@ ovs_skb_postpush_rcsum(skb, skb->data, ETH_HLEN); - ovs_vport_receive(vport_from_priv(lisp_port), skb, &tun_key); + ovs_vport_receive(vport_from_priv(lisp_port), skb, &tun_info); goto out; error: @@ -272,42 +283,32 @@ return 0; } -/* Arbitrary value. Irrelevant as long as it's not 0 since we set the handler. */ -#define UDP_ENCAP_LISP 1 static int lisp_socket_init(struct lisp_port *lisp_port, struct net *net) { - struct sockaddr_in sin; + struct udp_port_cfg udp_conf; + struct udp_tunnel_sock_cfg tunnel_cfg; int err; - err = sock_create_kern(AF_INET, SOCK_DGRAM, 0, - &lisp_port->lisp_rcv_socket); - if (err) - goto error; - - /* release net ref. */ - sk_change_net(lisp_port->lisp_rcv_socket->sk, net); + memset(&udp_conf, 0, sizeof(udp_conf)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_ANY); - sin.sin_port = lisp_port->dst_port; - - err = kernel_bind(lisp_port->lisp_rcv_socket, (struct sockaddr *)&sin, - sizeof(struct sockaddr_in)); - if (err) - goto error_sock; + udp_conf.family = AF_INET; + udp_conf.local_ip.s_addr = htonl(INADDR_ANY); + udp_conf.local_udp_port = lisp_port->dst_port; + + err = udp_sock_create(net, &udp_conf, &lisp_port->lisp_rcv_socket); + if (err < 0) { + pr_warn("cannot register lisp protocol handler: %d\n", err); + return err; + } - udp_sk(lisp_port->lisp_rcv_socket->sk)->encap_type = UDP_ENCAP_LISP; - udp_sk(lisp_port->lisp_rcv_socket->sk)->encap_rcv = lisp_rcv; + tunnel_cfg.sk_user_data = lisp_port; + tunnel_cfg.encap_type = 1; + tunnel_cfg.encap_rcv = lisp_rcv; + tunnel_cfg.encap_destroy = NULL; - udp_encap_enable(); + setup_udp_tunnel_sock(net, lisp_port->lisp_rcv_socket, &tunnel_cfg); return 0; - -error_sock: - sk_release_kernel(lisp_port->lisp_rcv_socket->sk); -error: - pr_warn("cannot register lisp protocol handler: %d\n", err); - return err; } static int lisp_get_options(const struct vport *vport, struct sk_buff *skb) @@ -324,9 +325,7 @@ struct lisp_port *lisp_port = lisp_vport(vport); list_del_rcu(&lisp_port->list); - /* Release socket */ - sk_release_kernel(lisp_port->lisp_rcv_socket->sk); - + udp_tunnel_sock_release(lisp_port->lisp_rcv_socket); ovs_vport_deferred_free(vport); } @@ -382,71 +381,38 @@ return ERR_PTR(err); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) - -static void lisp_fix_segment(struct sk_buff *skb) -{ - struct udphdr *udph = udp_hdr(skb); - - udph->len = htons(skb->len - skb_transport_offset(skb)); -} - -static int handle_offloads(struct sk_buff *skb) -{ - if (skb_is_gso(skb)) - OVS_GSO_CB(skb)->fix_segment = lisp_fix_segment; - else if (skb->ip_summed != CHECKSUM_PARTIAL) - skb->ip_summed = CHECKSUM_NONE; - return 0; -} -#else -static int handle_offloads(struct sk_buff *skb) -{ - if (skb->encapsulation && skb_is_gso(skb)) { - kfree_skb(skb); - return -ENOSYS; - } - - if (skb_is_gso(skb)) { - int err = skb_unclone(skb, GFP_ATOMIC); - if (unlikely(err)) - return err; - - skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL; - } else if (skb->ip_summed != CHECKSUM_PARTIAL) - skb->ip_summed = CHECKSUM_NONE; - - skb->encapsulation = 1; - return 0; -} -#endif - static int lisp_send(struct vport *vport, struct sk_buff *skb) { + struct ovs_key_ipv4_tunnel *tun_key; + struct lisp_port *lisp_port = lisp_vport(vport); + struct net *net = ovs_dp_get_net(vport->dp); int network_offset = skb_network_offset(skb); struct rtable *rt; int min_headroom; __be32 saddr; + __be16 src_port, dst_port; __be16 df; int sent_len; int err; - if (unlikely(!OVS_CB(skb)->tun_key)) - return -EINVAL; + if (unlikely(!OVS_CB(skb)->egress_tun_info)) { + err = -EINVAL; + goto error; + } + + tun_key = &OVS_CB(skb)->egress_tun_info->tunnel; if (skb->protocol != htons(ETH_P_IP) && skb->protocol != htons(ETH_P_IPV6)) { - kfree_skb(skb); - return 0; + err = 0; + goto error; } /* Route lookup */ - saddr = OVS_CB(skb)->tun_key->ipv4_src; + saddr = tun_key->ipv4_src; rt = find_route(ovs_dp_get_net(vport->dp), - &saddr, - OVS_CB(skb)->tun_key->ipv4_dst, - IPPROTO_UDP, - OVS_CB(skb)->tun_key->ipv4_tos, + &saddr, tun_key->ipv4_dst, + IPPROTO_UDP, tun_key->ipv4_tos, skb->mark); if (IS_ERR(rt)) { err = PTR_ERR(rt); @@ -472,32 +438,33 @@ skb_reset_mac_header(skb); vlan_set_tci(skb, 0); - skb_reset_inner_headers(skb); + skb = udp_tunnel_handle_offloads(skb, false, false); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + skb = NULL; + goto err_free_rt; + } - __skb_push(skb, LISP_HLEN); - skb_reset_transport_header(skb); + src_port = htons(get_src_port(net, skb)); + dst_port = lisp_port->dst_port; - lisp_build_header(vport, skb); + lisp_build_header(skb); - /* Offloading */ - err = handle_offloads(skb); - if (err) - goto err_free_rt; + skb->ignore_df = 1; - skb->local_df = 1; + ovs_skb_set_inner_protocol(skb, skb->protocol); - df = OVS_CB(skb)->tun_key->tun_flags & - TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; - sent_len = iptunnel_xmit(rt, skb, - saddr, OVS_CB(skb)->tun_key->ipv4_dst, - IPPROTO_UDP, OVS_CB(skb)->tun_key->ipv4_tos, - OVS_CB(skb)->tun_key->ipv4_ttl, df, false); + df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; + sent_len = udp_tunnel_xmit_skb(rt, skb, saddr, tun_key->ipv4_dst, + tun_key->ipv4_tos, tun_key->ipv4_ttl, + df, src_port, dst_port, false, true); return sent_len > 0 ? sent_len + network_offset : sent_len; err_free_rt: ip_rt_put(rt); error: + kfree_skb(skb); return err; } @@ -507,11 +474,51 @@ return lisp_port->name; } -const struct vport_ops ovs_lisp_vport_ops = { - .type = OVS_VPORT_TYPE_LISP, - .create = lisp_tnl_create, - .destroy = lisp_tnl_destroy, - .get_name = lisp_get_name, - .get_options = lisp_get_options, - .send = lisp_send, +static int lisp_get_egress_tun_info(struct vport *vport, struct sk_buff *skb, + struct ovs_tunnel_info *egress_tun_info) +{ + struct net *net = ovs_dp_get_net(vport->dp); + struct lisp_port *lisp_port = lisp_vport(vport); + + if (skb->protocol != htons(ETH_P_IP) && + skb->protocol != htons(ETH_P_IPV6)) { + return -EINVAL; + } + + /* + * Get tp_src and tp_dst, refert to lisp_build_header(). + */ + return ovs_tunnel_get_egress_info(egress_tun_info, net, + OVS_CB(skb)->egress_tun_info, + IPPROTO_UDP, skb->mark, + htons(get_src_port(net, skb)), + lisp_port->dst_port); +} + +static struct vport_ops ovs_lisp_vport_ops = { + .type = OVS_VPORT_TYPE_LISP, + .create = lisp_tnl_create, + .destroy = lisp_tnl_destroy, + .get_name = lisp_get_name, + .get_options = lisp_get_options, + .send = lisp_send, + .get_egress_tun_info = lisp_get_egress_tun_info, + .owner = THIS_MODULE, }; + +static int __init ovs_lisp_tnl_init(void) +{ + return ovs_vport_ops_register(&ovs_lisp_vport_ops); +} + +static void __exit ovs_lisp_tnl_exit(void) +{ + ovs_vport_ops_unregister(&ovs_lisp_vport_ops); +} + +module_init(ovs_lisp_tnl_init); +module_exit(ovs_lisp_tnl_exit); + +MODULE_DESCRIPTION("OVS: LISP switching port"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("vport-type-105"); diff -Nru openvswitch-2.3.1/datapath/vport-netdev.c openvswitch-2.4.0~git20150623/datapath/vport-netdev.c --- openvswitch-2.3.1/datapath/vport-netdev.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-netdev.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -34,6 +35,7 @@ #include "vport-internal_dev.h" #include "vport-netdev.h" +static struct vport_ops ovs_netdev_vport_ops; static void netdev_port_receive(struct vport *vport, struct sk_buff *skb); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) @@ -84,7 +86,7 @@ #error #endif -static struct net_device *get_dpdev(struct datapath *dp) +static struct net_device *get_dpdev(const struct datapath *dp) { struct vport *local; @@ -201,7 +203,8 @@ /* Make our own copy of the packet. Otherwise we will mangle the * packet for anyone who came before us (e.g. tcpdump via AF_PACKET). * (No one comes after us, since we tell handle_bridge() that we took - * the packet.) */ + * the packet.) + */ skb = skb_share_check(skb, GFP_ATOMIC); if (unlikely(!skb)) return; @@ -255,7 +258,7 @@ { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) || \ defined HAVE_RHEL_OVS_HOOK -#if IFF_OVS_DATAPATH != 0 +#ifdef HAVE_OVS_DATAPATH if (likely(dev->priv_flags & IFF_OVS_DATAPATH)) #else if (likely(rcu_access_pointer(dev->rx_handler) == netdev_frame_hook)) @@ -272,7 +275,7 @@ #endif } -const struct vport_ops ovs_netdev_vport_ops = { +static struct vport_ops ovs_netdev_vport_ops = { .type = OVS_VPORT_TYPE_NETDEV, .create = netdev_create, .destroy = netdev_destroy, @@ -280,6 +283,16 @@ .send = netdev_send, }; +int __init ovs_netdev_init(void) +{ + return ovs_vport_ops_register(&ovs_netdev_vport_ops); +} + +void ovs_netdev_exit(void) +{ + ovs_vport_ops_unregister(&ovs_netdev_vport_ops); +} + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) && \ !defined HAVE_RHEL_OVS_HOOK /* diff -Nru openvswitch-2.3.1/datapath/vport-netdev.h openvswitch-2.4.0~git20150623/datapath/vport-netdev.h --- openvswitch-2.3.1/datapath/vport-netdev.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-netdev.h 2015-06-23 18:46:21.000000000 +0000 @@ -41,4 +41,7 @@ const char *ovs_netdev_get_name(const struct vport *); void ovs_netdev_detach_dev(struct vport *); +int __init ovs_netdev_init(void); +void ovs_netdev_exit(void); + #endif /* vport_netdev.h */ diff -Nru openvswitch-2.3.1/datapath/vport-stt.c openvswitch-2.4.0~git20150623/datapath/vport-stt.c --- openvswitch-2.3.1/datapath/vport-stt.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-stt.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2015 Nicira, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "datapath.h" +#include "vport.h" + +#ifdef OVS_STT +static struct vport_ops ovs_stt_vport_ops; + +/** + * struct stt_port + * @stt_sock: The socket created for this port number. + * @name: vport name. + */ +struct stt_port { + struct stt_sock *stt_sock; + char name[IFNAMSIZ]; +}; + +static inline struct stt_port *stt_vport(const struct vport *vport) +{ + return vport_priv(vport); +} + +static void stt_rcv(struct stt_sock *stt_sock, struct sk_buff *skb) +{ + struct vport *vport = stt_sock->rcv_data; + struct stthdr *stth = stt_hdr(skb); + struct ovs_tunnel_info tun_info; + struct sk_buff *next; + + ovs_flow_tun_info_init(&tun_info, ip_hdr(skb), + tcp_hdr(skb)->source, tcp_hdr(skb)->dest, + get_unaligned(&stth->key), + TUNNEL_KEY | TUNNEL_CSUM, + NULL, 0); + do { + next = skb->next; + skb->next = NULL; + ovs_vport_receive(vport, skb, &tun_info); + } while ((skb = next)); +} + +static int stt_tnl_get_options(const struct vport *vport, + struct sk_buff *skb) +{ + struct stt_port *stt_port = stt_vport(vport); + struct inet_sock *sk = inet_sk(stt_port->stt_sock->sock->sk); + + if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(sk->inet_sport))) + return -EMSGSIZE; + return 0; +} + +static void stt_tnl_destroy(struct vport *vport) +{ + struct stt_port *stt_port = stt_vport(vport); + + stt_sock_release(stt_port->stt_sock); + ovs_vport_deferred_free(vport); +} + +static struct vport *stt_tnl_create(const struct vport_parms *parms) +{ + struct net *net = ovs_dp_get_net(parms->dp); + struct nlattr *options = parms->options; + struct stt_port *stt_port; + struct stt_sock *stt_sock; + struct vport *vport; + struct nlattr *a; + int err; + u16 dst_port; + + if (!options) { + err = -EINVAL; + goto error; + } + + a = nla_find_nested(options, OVS_TUNNEL_ATTR_DST_PORT); + if (a && nla_len(a) == sizeof(u16)) { + dst_port = nla_get_u16(a); + } else { + /* Require destination port from userspace. */ + err = -EINVAL; + goto error; + } + + vport = ovs_vport_alloc(sizeof(struct stt_port), + &ovs_stt_vport_ops, parms); + if (IS_ERR(vport)) + return vport; + + stt_port = stt_vport(vport); + strncpy(stt_port->name, parms->name, IFNAMSIZ); + + stt_sock = stt_sock_add(net, htons(dst_port), stt_rcv, vport); + if (IS_ERR(stt_sock)) { + ovs_vport_free(vport); + return ERR_CAST(stt_sock); + } + stt_port->stt_sock = stt_sock; + + return vport; +error: + return ERR_PTR(err); +} + +static int stt_tnl_send(struct vport *vport, struct sk_buff *skb) +{ + struct net *net = ovs_dp_get_net(vport->dp); + struct stt_port *stt_port = stt_vport(vport); + __be16 dport = inet_sk(stt_port->stt_sock->sock->sk)->inet_sport; + const struct ovs_key_ipv4_tunnel *tun_key; + const struct ovs_tunnel_info *tun_info; + struct rtable *rt; + __be16 sport; + __be32 saddr; + __be16 df; + int err; + + tun_info = OVS_CB(skb)->egress_tun_info; + if (unlikely(!tun_info)) { + err = -EINVAL; + goto error; + } + + tun_key = &tun_info->tunnel; + /* Route lookup */ + saddr = tun_key->ipv4_src; + rt = find_route(ovs_dp_get_net(vport->dp), + &saddr, tun_key->ipv4_dst, + IPPROTO_TCP, tun_key->ipv4_tos, + skb->mark); + + if (IS_ERR(rt)) { + err = PTR_ERR(rt); + goto error; + } + + df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; + sport = udp_flow_src_port(net, skb, 1, USHRT_MAX, true); + skb->ignore_df = 1; + + return stt_xmit_skb(skb, rt, saddr, tun_key->ipv4_dst, + tun_key->ipv4_tos, tun_key->ipv4_ttl, + df, sport, dport, tun_key->tun_id); +error: + kfree_skb(skb); + return err; +} + +static const char *stt_tnl_get_name(const struct vport *vport) +{ + return stt_vport(vport)->name; +} + +static int stt_get_egress_tun_info(struct vport *vport, struct sk_buff *skb, + struct ovs_tunnel_info *egress_tun_info) +{ + struct stt_port *stt_port = stt_vport(vport); + struct net *net = ovs_dp_get_net(vport->dp); + __be16 dport = inet_sk(stt_port->stt_sock->sock->sk)->inet_sport; + __be16 sport = udp_flow_src_port(net, skb, 1, USHRT_MAX, true); + + /* Get tp_src and tp_dst, refert to stt_build_header(). + */ + return ovs_tunnel_get_egress_info(egress_tun_info, + ovs_dp_get_net(vport->dp), + OVS_CB(skb)->egress_tun_info, + IPPROTO_UDP, skb->mark, sport, dport); +} + +static struct vport_ops ovs_stt_vport_ops = { + .type = OVS_VPORT_TYPE_STT, + .create = stt_tnl_create, + .destroy = stt_tnl_destroy, + .get_name = stt_tnl_get_name, + .get_options = stt_tnl_get_options, + .send = stt_tnl_send, + .get_egress_tun_info = stt_get_egress_tun_info, + .owner = THIS_MODULE, +}; + +static int __init ovs_stt_tnl_init(void) +{ + int err; + + err = stt_init_module(); + if (err) + return err; + err = ovs_vport_ops_register(&ovs_stt_vport_ops); + if (err) + stt_cleanup_module(); + return err; +} + +static void __exit ovs_stt_tnl_exit(void) +{ + ovs_vport_ops_unregister(&ovs_stt_vport_ops); + stt_cleanup_module(); +} + +module_init(ovs_stt_tnl_init); +module_exit(ovs_stt_tnl_exit); + +MODULE_DESCRIPTION("OVS: STT switching port"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("vport-type-106"); +#endif diff -Nru openvswitch-2.3.1/datapath/vport-vxlan.c openvswitch-2.4.0~git20150623/datapath/vport-vxlan.c --- openvswitch-2.3.1/datapath/vport-vxlan.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-vxlan.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,7 @@ #include "datapath.h" #include "vport.h" +#include "vport-vxlan.h" /** * struct vxlan_port - Keeps track of open UDP ports @@ -50,27 +52,42 @@ struct vxlan_port { struct vxlan_sock *vs; char name[IFNAMSIZ]; + u32 exts; /* VXLAN_F_* in */ }; +static struct vport_ops ovs_vxlan_vport_ops; + static inline struct vxlan_port *vxlan_vport(const struct vport *vport) { return vport_priv(vport); } -/* Called with rcu_read_lock and BH disabled. */ -static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, __be32 vx_vni) +static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, + struct vxlan_metadata *md) { - struct ovs_key_ipv4_tunnel tun_key; + struct ovs_tunnel_info tun_info; + struct vxlan_port *vxlan_port; struct vport *vport = vs->data; struct iphdr *iph; + struct ovs_vxlan_opts opts = { + .gbp = md->gbp, + }; __be64 key; + __be16 flags; + + flags = TUNNEL_KEY | (udp_hdr(skb)->check != 0 ? TUNNEL_CSUM : 0); + vxlan_port = vxlan_vport(vport); + if (vxlan_port->exts & VXLAN_F_GBP && md->gbp) + flags |= TUNNEL_VXLAN_OPT; /* Save outer tunnel values */ iph = ip_hdr(skb); - key = cpu_to_be64(ntohl(vx_vni) >> 8); - ovs_flow_tun_key_init(&tun_key, iph, key, TUNNEL_KEY); + key = cpu_to_be64(ntohl(md->vni) >> 8); + ovs_flow_tun_info_init(&tun_info, iph, + udp_hdr(skb)->source, udp_hdr(skb)->dest, + key, flags, &opts, sizeof(opts)); - ovs_vport_receive(vport, skb, &tun_key); + ovs_vport_receive(vport, skb, &tun_info); } static int vxlan_get_options(const struct vport *vport, struct sk_buff *skb) @@ -80,6 +97,21 @@ if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(dst_port))) return -EMSGSIZE; + + if (vxlan_port->exts) { + struct nlattr *exts; + + exts = nla_nest_start(skb, OVS_TUNNEL_ATTR_EXTENSION); + if (!exts) + return -EMSGSIZE; + + if (vxlan_port->exts & VXLAN_F_GBP && + nla_put_flag(skb, OVS_VXLAN_EXT_GBP)) + return -EMSGSIZE; + + nla_nest_end(skb, exts); + } + return 0; } @@ -92,6 +124,31 @@ ovs_vport_deferred_free(vport); } +static const struct nla_policy exts_policy[OVS_VXLAN_EXT_MAX+1] = { + [OVS_VXLAN_EXT_GBP] = { .type = NLA_FLAG, }, +}; + +static int vxlan_configure_exts(struct vport *vport, struct nlattr *attr) +{ + struct nlattr *exts[OVS_VXLAN_EXT_MAX+1]; + struct vxlan_port *vxlan_port; + int err; + + if (nla_len(attr) < sizeof(struct nlattr)) + return -EINVAL; + + err = nla_parse_nested(exts, OVS_VXLAN_EXT_MAX, attr, exts_policy); + if (err < 0) + return err; + + vxlan_port = vxlan_vport(vport); + + if (exts[OVS_VXLAN_EXT_GBP]) + vxlan_port->exts |= VXLAN_F_GBP; + + return 0; +} + static struct vport *vxlan_tnl_create(const struct vport_parms *parms) { struct net *net = ovs_dp_get_net(parms->dp); @@ -124,7 +181,17 @@ vxlan_port = vxlan_vport(vport); strncpy(vxlan_port->name, parms->name, IFNAMSIZ); - vs = vxlan_sock_add(net, htons(dst_port), vxlan_rcv, vport, true, false); + a = nla_find_nested(options, OVS_TUNNEL_ATTR_EXTENSION); + if (a) { + err = vxlan_configure_exts(vport, a); + if (err) { + ovs_vport_free(vport); + goto error; + } + } + + vs = vxlan_sock_add(net, htons(dst_port), vxlan_rcv, vport, true, + vxlan_port->exts); if (IS_ERR(vs)) { ovs_vport_free(vport); return (void *)vs; @@ -137,68 +204,122 @@ return ERR_PTR(err); } +static int vxlan_ext_gbp(struct sk_buff *skb) +{ + const struct ovs_tunnel_info *tun_info; + const struct ovs_vxlan_opts *opts; + + tun_info = OVS_CB(skb)->egress_tun_info; + opts = tun_info->options; + + if (tun_info->tunnel.tun_flags & TUNNEL_VXLAN_OPT && + tun_info->options_len >= sizeof(*opts)) + return opts->gbp; + else + return 0; +} + static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) { + struct ovs_key_ipv4_tunnel *tun_key; struct net *net = ovs_dp_get_net(vport->dp); struct vxlan_port *vxlan_port = vxlan_vport(vport); __be16 dst_port = inet_sport(vxlan_port->vs->sock->sk); + struct vxlan_metadata md = {0}; struct rtable *rt; __be16 src_port; __be32 saddr; __be16 df; - int port_min; - int port_max; int err; + u32 vxflags; - if (unlikely(!OVS_CB(skb)->tun_key)) { + if (unlikely(!OVS_CB(skb)->egress_tun_info)) { err = -EINVAL; goto error; } + tun_key = &OVS_CB(skb)->egress_tun_info->tunnel; + /* Route lookup */ - saddr = OVS_CB(skb)->tun_key->ipv4_src; + saddr = tun_key->ipv4_src; rt = find_route(ovs_dp_get_net(vport->dp), - &saddr, - OVS_CB(skb)->tun_key->ipv4_dst, - IPPROTO_UDP, - OVS_CB(skb)->tun_key->ipv4_tos, + &saddr, tun_key->ipv4_dst, + IPPROTO_UDP, tun_key->ipv4_tos, skb->mark); if (IS_ERR(rt)) { err = PTR_ERR(rt); goto error; } - df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? - htons(IP_DF) : 0; - - skb->local_df = 1; + df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; + skb->ignore_df = 1; - inet_get_local_port_range(net, &port_min, &port_max); - src_port = vxlan_src_port(port_min, port_max, skb); + src_port = udp_flow_src_port(net, skb, 0, 0, true); + md.vni = htonl(be64_to_cpu(tun_key->tun_id) << 8); + md.gbp = vxlan_ext_gbp(skb); + vxflags = vxlan_port->exts | + (tun_key->tun_flags & TUNNEL_CSUM ? VXLAN_F_UDP_CSUM : 0); err = vxlan_xmit_skb(vxlan_port->vs, rt, skb, - saddr, OVS_CB(skb)->tun_key->ipv4_dst, - OVS_CB(skb)->tun_key->ipv4_tos, - OVS_CB(skb)->tun_key->ipv4_ttl, df, + saddr, tun_key->ipv4_dst, + tun_key->ipv4_tos, + tun_key->ipv4_ttl, df, src_port, dst_port, - htonl(be64_to_cpu(OVS_CB(skb)->tun_key->tun_id) << 8)); + &md, false, vxflags); if (err < 0) ip_rt_put(rt); + return err; error: + kfree_skb(skb); return err; } +static int vxlan_get_egress_tun_info(struct vport *vport, struct sk_buff *skb, + struct ovs_tunnel_info *egress_tun_info) +{ + struct net *net = ovs_dp_get_net(vport->dp); + struct vxlan_port *vxlan_port = vxlan_vport(vport); + __be16 dst_port = inet_sport(vxlan_port->vs->sock->sk); + __be16 src_port; + + src_port = udp_flow_src_port(net, skb, 0, 0, true); + + return ovs_tunnel_get_egress_info(egress_tun_info, net, + OVS_CB(skb)->egress_tun_info, + IPPROTO_UDP, skb->mark, + src_port, dst_port); +} + static const char *vxlan_get_name(const struct vport *vport) { struct vxlan_port *vxlan_port = vxlan_vport(vport); return vxlan_port->name; } -const struct vport_ops ovs_vxlan_vport_ops = { - .type = OVS_VPORT_TYPE_VXLAN, - .create = vxlan_tnl_create, - .destroy = vxlan_tnl_destroy, - .get_name = vxlan_get_name, - .get_options = vxlan_get_options, - .send = vxlan_tnl_send, +static struct vport_ops ovs_vxlan_vport_ops = { + .type = OVS_VPORT_TYPE_VXLAN, + .create = vxlan_tnl_create, + .destroy = vxlan_tnl_destroy, + .get_name = vxlan_get_name, + .get_options = vxlan_get_options, + .send = vxlan_tnl_send, + .get_egress_tun_info = vxlan_get_egress_tun_info, + .owner = THIS_MODULE, }; + +static int __init ovs_vxlan_tnl_init(void) +{ + return ovs_vport_ops_register(&ovs_vxlan_vport_ops); +} + +static void __exit ovs_vxlan_tnl_exit(void) +{ + ovs_vport_ops_unregister(&ovs_vxlan_vport_ops); +} + +module_init(ovs_vxlan_tnl_init); +module_exit(ovs_vxlan_tnl_exit); + +MODULE_DESCRIPTION("OVS: VXLAN switching port"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("vport-type-4"); diff -Nru openvswitch-2.3.1/datapath/vport-vxlan.h openvswitch-2.4.0~git20150623/datapath/vport-vxlan.h --- openvswitch-2.3.1/datapath/vport-vxlan.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath/vport-vxlan.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,11 @@ +#ifndef VPORT_VXLAN_H +#define VPORT_VXLAN_H 1 + +#include +#include + +struct ovs_vxlan_opts { + __u32 gbp; +}; + +#endif diff -Nru openvswitch-2.3.1/datapath-windows/automake.mk openvswitch-2.4.0~git20150623/datapath-windows/automake.mk --- openvswitch-2.3.1/datapath-windows/automake.mk 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,67 @@ +EXTRA_DIST += \ + datapath-windows/CodingStyle \ + datapath-windows/DESIGN \ + datapath-windows/Package/package.VcxProj \ + datapath-windows/Package/package.VcxProj.user \ + datapath-windows/include/OvsDpInterfaceExt.h \ + datapath-windows/misc/install.cmd \ + datapath-windows/misc/uninstall.cmd \ + datapath-windows/misc/OVS.psm1 \ + datapath-windows/ovsext.sln \ + datapath-windows/ovsext/Datapath.c \ + datapath-windows/ovsext/Datapath.h \ + datapath-windows/ovsext/DpInternal.h\ + datapath-windows/ovsext/Actions.c \ + datapath-windows/ovsext/Atomic.h \ + datapath-windows/ovsext/BufferMgmt.c \ + datapath-windows/ovsext/BufferMgmt.h \ + datapath-windows/ovsext/Checksum.c \ + datapath-windows/ovsext/Checksum.h \ + datapath-windows/ovsext/Debug.c \ + datapath-windows/ovsext/Debug.h \ + datapath-windows/ovsext/Driver.c \ + datapath-windows/ovsext/Ethernet.h \ + datapath-windows/ovsext/Event.c \ + datapath-windows/ovsext/Event.h \ + datapath-windows/ovsext/Flow.c \ + datapath-windows/ovsext/Flow.h \ + datapath-windows/ovsext/IpHelper.c \ + datapath-windows/ovsext/IpHelper.h \ + datapath-windows/ovsext/Jhash.c \ + datapath-windows/ovsext/Jhash.h \ + datapath-windows/ovsext/Netlink/Netlink.c \ + datapath-windows/ovsext/Netlink/Netlink.h \ + datapath-windows/ovsext/Netlink/NetlinkBuf.c \ + datapath-windows/ovsext/Netlink/NetlinkBuf.h \ + datapath-windows/ovsext/Netlink/NetlinkError.h \ + datapath-windows/ovsext/Netlink/NetlinkProto.h \ + datapath-windows/ovsext/NetProto.h \ + datapath-windows/ovsext/Oid.c \ + datapath-windows/ovsext/Oid.h \ + datapath-windows/ovsext/PacketIO.c \ + datapath-windows/ovsext/PacketIO.h \ + datapath-windows/ovsext/PacketParser.c \ + datapath-windows/ovsext/PacketParser.h \ + datapath-windows/ovsext/Switch.c \ + datapath-windows/ovsext/Switch.h \ + datapath-windows/ovsext/Tunnel.c \ + datapath-windows/ovsext/Tunnel.h \ + datapath-windows/ovsext/TunnelFilter.c \ + datapath-windows/ovsext/TunnelIntf.h \ + datapath-windows/ovsext/Types.h \ + datapath-windows/ovsext/User.c \ + datapath-windows/ovsext/User.h \ + datapath-windows/ovsext/Util.c \ + datapath-windows/ovsext/Util.h \ + datapath-windows/ovsext/Vport.c \ + datapath-windows/ovsext/Vport.h \ + datapath-windows/ovsext/Vxlan.c \ + datapath-windows/ovsext/Stt.h \ + datapath-windows/ovsext/Stt.c \ + datapath-windows/ovsext/Vxlan.h \ + datapath-windows/ovsext/ovsext.inf \ + datapath-windows/ovsext/ovsext.rc \ + datapath-windows/ovsext/ovsext.vcxproj \ + datapath-windows/ovsext/ovsext.vcxproj.user \ + datapath-windows/ovsext/precomp.h \ + datapath-windows/ovsext/precompsrc.c diff -Nru openvswitch-2.3.1/datapath-windows/CodingStyle openvswitch-2.4.0~git20150623/datapath-windows/CodingStyle --- openvswitch-2.3.1/datapath-windows/CodingStyle 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/CodingStyle 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,152 @@ + Open vSwitch Windows Datapath Coding Style + ========================================== + +The coding style described in the Open vSwitch distribution gives the +flexiblity for each platform to use its own coding style for the kernel +datapath. This file describes the specific coding style used in most +of the C files in the Windows kernel datapath of the Open vSwitch distribution. + +Most of the coding conventions applicable for the Open vSwitch distribution are +applicable to the Windows kernel datapath as well. There are some exceptions +and new guidlines owing to the commonly followed practices in Windows +kernel/driver code. They are noted as follows: + + +BASICS + + Limit lines to 79 characters. Many times, this is not possible due to long +names of functions and it is fine to go beyond the characters limit. One +common example is when calling into NDIS functions. + + +TYPES + Use data types defined by Windows for most of the code. This is a common +practice in Windows driver code, and it makes integrating with the data +structures and functions defined by Windows easier. Example: DWORD and +BOOLEAN. + + Use caution in portions of the code that interface with the OVS userspace. +OVS userspace does not use Windows specific data types, and when copying data +back and forth between kernel and userspace, care should be exercised. + + +NAMING + + It is common practice to use camel casing for naming variables, functions +and files in Windows. For types, especially structures, unions and enums, +using all upper case letters with words seprated by '_' is common. These +practices can be used for OVS Windows datapath. However, use the following +guidelines: + + Use lower case to begin the name of a variable. + + Do not use '_' to begin the name of the variable. '_' is to be used to begin + the parameters of a pre-processor macro. + + Use upper case to begin the name of a function, enum, file name etc. + + Static functions whose scope is limited to the file they are defined in can + be prefixed with '_'. This is not mandatory though. + + For types, use all upper case for all letters with words separated by '_'. If + camel casing is preferred, use upper case for the first letter. + + It is a common practice to define a pointer type by prefixing the letter +'P' to a data type. The same practice can be followed here as well. + + Example: + +static __inline BOOLEAN +OvsDetectTunnelRxPkt(POVS_FORWARDING_CONTEXT ovsFwdCtx, + POVS_FLOW_KEY flowKey) +{ + POVS_VPORT_ENTRY tunnelVport = NULL; + + if (!flowKey->ipKey.nwFrag && + flowKey->ipKey.nwProto == IPPROTO_UDP && + flowKey->ipKey.l4.tpDst == VXLAN_UDP_PORT_NBO) { + tunnelVport = OvsGetTunnelVport(OVSWIN_VPORT_TYPE_VXLAN); + ovsActionStats.rxVxlan++; + } + + if (tunnelVport) { + ASSERT(ovsFwdCtx->tunnelRxNic == NULL); + ovsFwdCtx->tunnelRxNic = tunnelVport; + return TRUE; + } + + return FALSE; +} + + For declaring variables of pointer type, use of the pointer data type +prefixed with 'P' is preferred over using '*'. This is not mandatory though, +and is only prescribed since it is a common practice in Windows. + + Example, #1 is preferred over #2 though #2 is also equally correct: + 1. PNET_BUFFER_LIST curNbl; + 2. NET_BUFFER_LIST *curNbl; + +COMMENTS + + Comments should be written as full sentences that start with a +capital letter and end with a period. Putting two spaces between sentances is +not necessary. + + // can be used for comments as long as the comment is a single line comment. +For block comments, use /* */ comments + + +FUNCTIONS + + Put the return type, function name, and the braces that surround the +function's code on separate lines, all starting in column 0. + + Before each function definition, write a comment that describes the +function's purpose, including each parameter, the return value, and +side effects. References to argument names should be given in +single-quotes, e.g. 'arg'. The comment should not include the +function name, nor need it follow any formal structure. The comment +does not need to describe how a function does its work, unless this +information is needed to use the function correctly (this is often +better done with comments *inside* the function). + + Mention any side effects that the function has that are not obvious based on +the name of the function or based on the workflow it is called from. + + In the interest of keeping comments describing functions similar in +structure, use the following template. + +/* + *---------------------------------------------------------------------------- + * Any description of the function, arguments, return types, assumptions and + * side effects. + *---------------------------------------------------------------------------- + */ + +SOURCE FILES + + Each source file should state its license in a comment at the very +top, followed by a comment explaining the purpose of the code that is +in that file. The comment should explain how the code in the file +relates to code in other files. The goal is to allow a programmer to +quickly figure out where a given module fits into the larger system. + + The first non-comment line in a .c source file should be: + + #include + +#include directives should appear in the following order: + + 1. #include + + 2. The module's own headers, if any. Including this before any + other header (besides ) ensures that the module's + header file is self-contained (see HEADER FILES) below. + + 3. Standard C library headers and other system headers, preferably + in alphabetical order. (Occasionally one encounters a set of + system headers that must be included in a particular order, in + which case that order must take precedence.) + + 4. Open vSwitch headers, in alphabetical order. Use "", not <>, + to specify Open vSwitch header names. diff -Nru openvswitch-2.3.1/datapath-windows/DESIGN openvswitch-2.4.0~git20150623/datapath-windows/DESIGN --- openvswitch-2.3.1/datapath-windows/DESIGN 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/DESIGN 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,457 @@ + OVS-on-Hyper-V Design Document + ============================== +There has been a community effort to develop Open vSwitch on Microsoft Hyper-V. +In this document, we provide details of the development effort. We believe this +document should give enough information to understand the overall design. + +The userspace portion of the OVS has been ported to Hyper-V in a separate +effort, and committed to the openvswitch repo. So, this document will mostly +emphasize on the kernel driver, though we touch upon some of the aspects of +userspace as well. + +We cover the following topics: +1. Background into relevant Hyper-V architecture +2. Design of the OVS Windows implementation + a. Kernel module (datapath) + b. Userspace components + c. Kernel-Userspace interface + d. Flow of a packet +3. Build/Deployment environment + +For more questions, please contact dev@openvswitch.org + +1) Background into relevant Hyper-V architecture +------------------------------------------------ +Microsoft’s hypervisor solution - Hyper-V[1] implements a virtual switch that +is extensible and provides opportunities for other vendors to implement +functional extensions[2]. The extensions need to be implemented as NDIS drivers +that bind within the extensible switch driver stack provided. The extensions +can broadly provide the functionality of monitoring, modifying and forwarding +packets to destination ports on the Hyper-V extensible switch. Correspondingly, +the extensions can be categorized into the following types and provide the +functionality noted: + * Capturing extensions: monitoring packets + * Filtering extensions: monitoring, modifying packets + * Forwarding extensions: monitoring, modifying, forwarding packets + +As can be expected, the kernel portion (datapath) of OVS on Hyper-V solution +will be implemented as a forwarding extension. + +In Hyper-V, the virtual machine is called the Child Partition. Each VIF or +physical NIC on the Hyper-V extensible switch is attached via a port. Each port +is both on the ingress path or the egress path of the switch. The ingress path +is used for packets being sent out of a port, and egress is used for packet +being received on a port. By design, NDIS provides a layered interface. In this +layered interface, higher level layers call into lower level layers, in the +ingress path. In the egress path, it is the other way round. In addition, there +is a object identifier (OID) interface for control operations Eg. addition of +a port. The workflow for the calls is similar in nature to the packets, where +higher level layers call into the lower level layers. A good representational +diagram of this architecture is in [4]. + +Windows Filtering Platform (WFP)[5] is a platform implemented on Hyper-V that +provides APIs and services for filtering packets. WFP has been utilized to +filter on some of the packets that OVS is not equipped to handle directly. More +details in later sections. + +IP Helper [6] is a set of API available on Hyper-V to retrieve information +related to the network configuration information on the host machine. IP Helper +has been used to retrieve some of the configuration information that OVS needs. + + +2) Design of the OVS Windows implementation +------------------------------------------- + + +-------------------------------+ + | | + | CHILD PARTITION | + | | + +------+ +--------------+ | +-----------+ +------------+ | + | | | | | | | | | | + | ovs- | | OVS- | | | Virtual | | Virtual | | + | *ctl | | USERSPACE | | | Machine #1| | Machine #2 | | + | | | DAEMON | | | | | | | + +------+-++---+---------+ | +--+------+-+ +----+------++ | +--------+ + | dpif- | | netdev- | | |VIF #1| |VIF #2| | |Physical| + | netlink | | windows | | +------+ +------+ | | NIC | + +---------+ +---------+ | || /\ | +--------+ +User /\ /\ | || *#1* *#4* || | /\ +=========||=========||============+------||-------------------||--+ || +Kernel || || \/ || ||=====/ + \/ \/ +-----+ +-----+ *#5* + +-------------------------------+ | | | | + | +----------------------+ | | | | | + | | OVS Pseudo Device | | | | | | + | +----------------------+ | | | | | + | | Netlink Impl. | | | | | | + | ----------------- | | I | | | + | +------------+ | | N | | E | + | | Flowtable | +------------+ | | G | | G | + | +------------+ | Packet | |*#2*| R | | R | + | +--------+ | Processing | |<=> | E | | E | + | | WFP | | | | | S | | S | + | | Driver | +------------+ | | S | | S | + | +--------+ | | | | | + | | | | | | + | OVS FORWARDING EXTENSION | | | | | + +-------------------------------+ +-----+-----------------+-----+ + |HYPER-V Extensible Switch *#3| + +-----------------------------+ + NDIS STACK + + Fig 2. Various blocks of the OVS Windows implementation + +Figure 2 shows the various blocks involved in the OVS Windows implementation, +along with some of the components available in the NDIS stack, and also the +virtual machines. The workflow of a packet being transmitted from a VIF out and +into another VIF and to a physical NIC is also shown. Later on in this section, +we will discuss the flow of a packet at a high level. + +The figure gives a general idea of where the OVS userspace and the kernel +components fit in, and how they interface with each other. + +The kernel portion (datapath) of OVS on Hyper-V solution has be implemented as +a forwarding extension roughly implementing the following +sub-modules/functionality. Details of each of these sub-components in the +kernel are contained in later sections: + * Interfacing with the NDIS stack + * Netlink message parser + * Netlink sockets + * Switch/Datapath management + * Interfacing with userspace portion of the OVS solution to implement the + necessary functionality that userspace needs + * Port management + * Flowtable/Actions/packet forwarding + * Tunneling + * Event notifications + +The datapath for the OVS on Linux is a kernel module, and cannot be directly +ported since there are significant differences in architecture even though the +end functionality provided would be similar. Some examples of the differences +are: + * Interfacing with the NDIS stack to hook into the NDIS callbacks for + functionality such as receiving and sending packets, packet completions, + OIDs used for events such as a new port appearing on the virtual switch. + * Interface between the userspace and the kernel module. + * Event notifications are significantly different. + * The communication interface between DPIF and the kernel module need not be + implemented in the way OVS on Linux does. That said, it would be + advantageous to have a similar interface to the kernel module for reasons of + readability and maintainability. + * Any licensing issues of using Linux kernel code directly. + +Due to these differences, it was a straightforward decision to develop the +datapath for OVS on Hyper-V from scratch rather than porting the one on Linux. +A re-development focused on the following goals: + * Adhere to the existing requirements of userspace portion of OVS (such as + ovs-vswitchd), to minimize changes in the userspace workflow. + * Fit well into the typical workflow of a Hyper-V extensible switch forwarding + extension. + +The userspace portion of the OVS solution is mostly POSIX code, and not very +Linux specific. Majority of the userspace code does not interface directly with +the kernel datapath and was ported independently of the kernel datapath +effort. + +As explained in the OVS porting design document [7], DPIF is the portion of +userspace that interfaces with the kernel portion of the OVS. The interface +that each DPIF provider has to implement is defined in dpif-provider.h [3]. +Though each platform is allowed to have its own implementation of the DPIF +provider, it was found, via community feedback, that it is desired to +share code whenever possible. Thus, the DPIF provider for OVS on Hyper-V shares +code with the DPIF provider on Linux. This interface is implemented in +dpif-netlink.c, formerly dpif-linux.c. + +We'll elaborate more on kernel-userspace interface in a dedicated section +below. Here it suffices to say that the DPIF provider implementation for +Windows is netlink-based and shares code with the Linux one. + +2.a) Kernel module (datapath) +----------------------------- + +Interfacing with the NDIS stack +------------------------------- +For each virtual switch on Hyper-V, the OVS extensible switch extension can be +enabled/disabled. We support enabling the OVS extension on only one switch. +This is consistent with using a single datapath in the kernel on Linux. All the +physical adapters are connected as external adapters to the extensible switch. + +When the OVS switch extension registers itself as a filter driver, it also +registers callbacks for the switch/port management and datapath functions. In +other words, when a switch is created on the Hyper-V root partition (host), the +extension gets an activate callback upon which it can initialize the data +structures necessary for OVS to function. Similarly, there are callbacks for +when a port gets added to the Hyper-V switch, and an External Network adapter +or a VM Network adapter is connected/disconnected to the port. There are also +callbacks for when a VIF (NIC of a child partition) send out a packet, or a +packet is received on an external NIC. + +As shown in the figures, an extensible switch extension gets to see a packet +sent by the VM (VIF) twice - once on the ingress path and once on the egress +path. Forwarding decisions are to be made on the ingress path. Correspondingly, +we will be hooking onto the following interfaces: + * Ingress send indication: intercept packets for performing flow based + forwarding.This includes straight forwarding to output ports. Any packet + modifications needed to be performed are done here either inline or by + creating a new packet. A forwarding action is performed as the flow actions + dictate. + * Ingress completion indication: cleanup and free packets that we generated on + the ingress send path, pass-through for packets that we did not generate. + * Egress receive indication: pass-through. + * Egress completion indication: pass-through. + +Interfacing with OVS userspace +------------------------------ +We have implemented a pseudo device interface for letting OVS userspace talk to +the OVS kernel module. This is equivalent to the typical character device +interface on POSIX platforms where we can register custom functions for read, +write and ioctl functionality. The pseudo device supports a whole bunch of +ioctls that netdev and DPIF on OVS userspace make use of. + +Netlink message parser +---------------------- +The communication between OVS userspace and OVS kernel datapath is in the form +of Netlink messages [1]. More details about this are provided in #2.c section, +kernel-userspace interface. In the kernel, a full fledged netlink message +parser has been implemented along the lines of the netlink message parser in +OVS userspace. In fact, a lot of the code is ported code. + +On the lines of 'struct ofpbuf' in OVS userspace, a managed buffer has been +implemented in the kernel datapath to make it easier to parse and construct +netlink messages. + +Netlink sockets +--------------- +On Linux, OVS userspace utilizes netlink sockets to pass back and forth netlink +messages. Since much of userspace code including DPIF provider in +dpif-netlink.c (formerly dpif-linux.c) has been reused, pseudo-netlink sockets +have been implemented in OVS userspace. As it is known, Windows lacks native +netlink socket support, and also the socket family is not extensible either. +Hence it is not possible to provide a native implementation of netlink socket. +We emulate netlink sockets in lib/netlink-socket.c and support all of the nl_* +APIs to higher levels. The implementation opens a handle to the pseudo device +for each netlink socket. Some more details on this topic are provided in the +userspace section on netlink sockets. + +Typical netlink semantics of read message, write message, dump, and transaction +have been implemented so that higher level layers are not affected by the +netlink implementation not being native. + +Switch/Datapath management +-------------------------- +As explained above, we hook onto the management callback functions in the NDIS +interface for when to initialize the OVS data structures, flow tables etc. Some +of this code is also driven by OVS userspace code which sends down ioctls for +operations like creating a tunnel port etc. + +Port management +--------------- +As explained above, we hook onto the management callback functions in the NDIS +interface to know when a port is added/connected to the Hyper-V switch. We use +these callbacks to initialize the port related data structures in OVS. Also, +some of the ports are tunnel ports that don’t exist on the Hyper-V switch and +get added from OVS userspace. + +In order to identify a Hyper-V port, we use the value of 'FriendlyName' field +in each Hyper-V port. We call this the "OVS-port-name". The idea is that OVS +userspace sets 'OVS-port-name' in each Hyper-V port to the same value as the +'name' field of the 'Interface' table in OVSDB. When OVS userspace calls into +the kernel datapath to add a port, we match the name of the port with the +'OVS-port-name' of a Hyper-V port. + +We maintain separate hash tables, and separate counters for ports that have +been added from the Hyper-V switch, and for ports that have been added from OVS +userspace. + +Flowtable/Actions/packet forwarding +----------------------------------- +The flowtable and flow actions based packet forwarding is the core of the OVS +datapath functionality. For each packet on the ingress path, we consult the +flowtable and execute the corresponding actions. The actions can be limited to +simple forwarding to a particular destination port(s), or more commonly +involves modifying the packet to insert a tunnel context or a VLAN ID, and +thereafter forwarding to the external port to send the packet to a destination +host. + +Tunneling +--------- +We make use of the Internal Port on a Hyper-V switch for implementing +tunneling. The Internal Port is a virtual adapter that is exposed on the Hyper- +V host, and connected to the Hyper-V switch. Basically, it is an interface +between the host and the virtual switch. The Internal Port acts as the Tunnel +end point for the host (aka VTEP), and holds the VTEP IP address. + +Tunneling ports are not actual ports on the Hyper-V switch. These are virtual +ports that OVS maintains and while executing actions, if the outport is a +tunnel port, we short circuit by performing the encapsulation action based on +the tunnel context. The encapsulated packet gets forwarded to the external +port, and appears to the outside world as though it was set from the VTEP. + +Similarly, when a tunneled packet enters the OVS from the external port bound +to the internal port (VTEP), and if yes, we short circuit the path, and +directly forward the inner packet to the destination port (mostly a VIF, but +dictated by the flow). We leverage the Windows Filtering Platform (WFP) +framework to be able to receive tunneled packets that cannot be decapsulated by +OVS right away. Currently, fragmented IP packets fall into that category, and +we leverage the code in the host IP stack to reassemble the packet, and +performing decapsulation on the reassembled packet. + +We’ll also be using the IP helper library to provide us IP address and other +information corresponding to the Internal port. + +Event notifications +------------------- +The pseudo device interface described above is also used for providing event +notifications back to OVS userspace. A shared memory/overlapped IO model is +used. + +2.b) Userspace components +------------------------- +The userspace portion of the OVS solution is mostly POSIX code, and not very +Linux specific. Majority of the userspace code does not interface directly with +the kernel datapath and was ported independently of the kernel datapath +effort. + +In this section, we cover the userspace components that interface with the +kernel datapath. + +As explained earlier, OVS on Hyper-V shares the DPIF provider implementation +with Linux. The DPIF provider on Linux uses netlink sockets and netlink +messages. Netlink sockets and messages are extensively used on Linux to +exchange information between userspace and kernel. In order to satisfy these +dependencies, netlink socket (pseudo and non-native) and netlink messages +are implemented on Hyper-V. + +The following are the major advantages of sharing DPIF provider code: +1. Maintenance is simpler: + Any change made to the interface defined in dpif-provider.h need not be + propagated to multiple implementations. Also, developers familiar with the + Linux implementation of the DPIF provider can easily ramp on the Hyper-V + implementation as well. +2. Netlink messages provides inherent advantages: + Netlink messages are known for their extensibility. Each message is + versioned, so the provided data structures offer a mechanism to perform + version checking and forward/backward compatibility with the kernel + module. + +Netlink sockets +--------------- +As explained in other sections, an emulation of netlink sockets has been +implemented in lib/netlink-socket.c for Windows. The implementation creates a +handle to the OVS pseudo device, and emulates netlink socket semantics of +receive message, send message, dump, and transact. Most of the nl_* functions +are supported. + +The fact that the implementation is non-native manifests in various ways. +One example is that PID for the netlink socket is not automatically assigned in +userspace when a handle is created to the OVS pseudo device. There's an extra +command (defined in OvsDpInterfaceExt.h) that is used to grab the PID generated +in the kernel. + +DPIF provider +-------------- +As has been mentioned in earlier sections, the netlink socket and netlink +message based DPIF provider on Linux has been ported to Windows. +Correspondingly, the file is called lib/dpif-netlink.c now from its former +name of lib/dpif-linux.c. + +Most of the code is common. Some divergence is in the code to receive +packets. The Linux implementation uses epoll() which is not natively supported +on Windows. + +Netdev-Windows +-------------- +We have a Windows implementation of the interface defined in +lib/netdev-provider.h. The implementation provides functionality to get +extended information about an interface. It is limited in functionality +compared to the Linux implementation of the netdev provider and cannot be used +to add any interfaces in the kernel such as a tap interface or to send/receive +packets. The netdev-windows implementation uses the datapath interface +extensions defined in: +datapath-windows/include/OvsDpInterfaceExt.h + +Powershell extensions to set "OVS-port-name" +-------------------------------------------- +As explained in the section on "Port management", each Hyper-V port has a +'FriendlyName' field, which we call as the "OVS-port-name" field. We have +implemented powershell command extensions to be able to set the "OVS-port-name" +of a Hyper-V port. + +2.c) Kernel-Userspace interface +------------------------------- +openvswitch.h and OvsDpInterfaceExt.h +------------------------------------- +Since the DPIF provider is shared with Linux, the kernel datapath provides the +same interface as the Linux datapath. The interface is defined in +datapath/linux/compat/include/linux/openvswitch.h. Derivatives of this +interface file are created during OVS userspace compilation. The derivative for +the kernel datapath on Hyper-V is provided in the following location: +datapath-windows/include/OvsDpInterface.h + +That said, there are Windows specific extensions that are defined in the +interface file: +datapath-windows/include/OvsDpInterfaceExt.h + +2.d) Flow of a packet +--------------------- +Figure 2 shows the numbered steps in which a packets gets sent out of a VIF and +is forwarded to another VIF or a physical NIC. As mentioned earlier, each VIF +is attached to the switch via a port, and each port is both on the ingress and +egress path of the switch, and depending on whether a packet is being +transmitted or received, one of the paths gets used. In the figure, each step n +is annotated as *#n* + +The steps are as follows: +1. When a packet is sent out of a VIF or an physical NIC or an internal port, +the packet is part of the ingress path. +2. The OVS kernel driver gets to intercept this packet. + a. OVS looks up the flows in the flowtable for this packet, and executes the + corresponding action. + b. If there is not action, the packet is sent up to OVS userspace to examine + the packet and figure out the actions. + v. Userspace executes the packet by specifying the actions, and might also + insert a flow for such a packet in the future. + d. The destination ports are added to the packet and sent down to the Hyper- + V switch. +3. The Hyper-V forwards the packet to the destination ports specified in the +packet, and sends it out on the egress path. +4. The packet gets forwarded to the destination VIF. +5. It might also get forwarded to a physical NIC as well, if the physical NIC +has been added as a destination port by OVS. + + +3) Build/Deployment: +-------------------- +The userspace components added as part of OVS Windows implementation have been +integrated with autoconf, and can be built using the steps mentioned in the +BUILD.Windows file. Additional targets need to be specified to make. + +The OVS kernel code is part of a Visual Studio 2013 solution, and is compiled +from the IDE. There are plans in the future to move this to a compilation mode +such that we can compile it without an IDE as well. + +Once compiled, we have an install script that can be used to load the kernel +driver. + + +Reference list: +=============== +1. Hyper-V Extensible Switch +http://msdn.microsoft.com/en-us/library/windows/hardware/hh598161(v=vs.85).aspx +2. Hyper-V Extensible Switch Extensions +http://msdn.microsoft.com/en-us/library/windows/hardware/hh598169(v=vs.85).aspx +3. DPIF Provider +http://openvswitch.sourcearchive.com/documentation/1.1.0-1/dpif- +provider_8h_source.html +4. Hyper-V Extensible Switch Components +http://msdn.microsoft.com/en-us/library/windows/hardware/hh598163(v=vs.85).aspx +5. Windows Filtering Platform +http://msdn.microsoft.com/en-us/library/windows/desktop/aa366510(v=vs.85).aspx +6. IP Helper +http://msdn.microsoft.com/en-us/library/windows/hardware/ff557015(v=vs.85).aspx +7. How to Port Open vSwitch to New Software or Hardware +http://git.openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob;f=PORTING +8. Netlink +http://en.wikipedia.org/wiki/Netlink +9. epoll +http://en.wikipedia.org/wiki/Epoll diff -Nru openvswitch-2.3.1/datapath-windows/.gitignore openvswitch-2.4.0~git20150623/datapath-windows/.gitignore --- openvswitch-2.3.1/datapath-windows/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,5 @@ +/Package/x64/ +*.opensdf +*.sdf +/ovsext/x64/ +/x64 diff -Nru openvswitch-2.3.1/datapath-windows/include/automake.mk openvswitch-2.4.0~git20150623/datapath-windows/include/automake.mk --- openvswitch-2.3.1/datapath-windows/include/automake.mk 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/include/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,10 @@ +BUILT_SOURCES += $(srcdir)/datapath-windows/include/OvsDpInterface.h + +$(srcdir)/datapath-windows/include/OvsDpInterface.h: \ + datapath/linux/compat/include/linux/openvswitch.h \ + build-aux/extract-odp-netlink-windows-dp-h + $(AM_V_GEN)sed -f $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h < $< > $@ + +EXTRA_DIST += $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h + +CLEANFILES += $(srcdir)/datapath-windows/include/OvsDpInterface.h diff -Nru openvswitch-2.3.1/datapath-windows/include/OvsDpInterfaceExt.h openvswitch-2.4.0~git20150623/datapath-windows/include/OvsDpInterfaceExt.h --- openvswitch-2.3.1/datapath-windows/include/OvsDpInterfaceExt.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/include/OvsDpInterfaceExt.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __OVS_DP_INTERFACE_EXT_H_ +#define __OVS_DP_INTERFACE_EXT_H_ 1 + +/* Windows kernel datapath extensions to the standard datapath interface. */ + +/* Version number of the datapath interface extensions. */ +#define OVS_DATAPATH_EXT_VERSION 1 + +/* Name of the device. */ +#define OVS_DEVICE_NAME_NT L"\\Device\\OpenvSwitchDevice" +#define OVS_DEVICE_NAME_DOS L"\\DosDevices\\OpenvSwitchDevice" +#define OVS_DEVICE_NAME_USER TEXT("\\\\.\\OpenvSwitchDevice") + +#define OVS_IOCTL_DEVICE_TYPE 45000 + +#define OVS_IOCTL_START 0x100 +/* We used Direct I/O (zero copy) for the buffers. */ +/* Non-Netlink-based IOCTLs. */ +#define OVS_IOCTL_GET_PID \ + CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x0, METHOD_BUFFERED,\ + FILE_WRITE_ACCESS) +/* Netlink-based IOCTLs. */ +#define OVS_IOCTL_READ \ + CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x1, METHOD_OUT_DIRECT,\ + FILE_READ_ACCESS) +#define OVS_IOCTL_READ_EVENT \ + CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x2, METHOD_OUT_DIRECT, \ + FILE_READ_ACCESS) +#define OVS_IOCTL_READ_PACKET \ + CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x3, METHOD_OUT_DIRECT, \ + FILE_READ_ACCESS) +#define OVS_IOCTL_WRITE \ + CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x4, METHOD_IN_DIRECT,\ + FILE_READ_ACCESS) +#define OVS_IOCTL_TRANSACT \ + CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x5, METHOD_OUT_DIRECT,\ + FILE_WRITE_ACCESS) + +/* + * On platforms that support netlink natively, the operating system assigns a + * dynamic value to a netlink family when it is registered. In the absense of + * such mechanism, defined hard-coded values that are known both to userspace + * and kernel. + */ +#define OVS_WIN_NL_INVALID_FAMILY_ID 0 +#define OVS_WIN_NL_CTRL_FAMILY_ID (NLMSG_MIN_TYPE + 1) +#define OVS_WIN_NL_DATAPATH_FAMILY_ID (NLMSG_MIN_TYPE + 2) +#define OVS_WIN_NL_PACKET_FAMILY_ID (NLMSG_MIN_TYPE + 3) +#define OVS_WIN_NL_VPORT_FAMILY_ID (NLMSG_MIN_TYPE + 4) +#define OVS_WIN_NL_FLOW_FAMILY_ID (NLMSG_MIN_TYPE + 5) +#define OVS_WIN_NL_NETDEV_FAMILY_ID (NLMSG_MIN_TYPE + 6) + +#define OVS_WIN_NL_INVALID_MCGRP_ID 0 +#define OVS_WIN_NL_MCGRP_START_ID 100 +#define OVS_WIN_NL_VPORT_MCGRP_ID (OVS_WIN_NL_MCGRP_START_ID + 1) + +/* + * Define a family of netlink command specific to Windows. This is part of the + * extensions. + */ +#define OVS_WIN_CONTROL_FAMILY "ovs_win_control" +#define OVS_WIN_CONTROL_MCGROUP "ovs_win_control" +#define OVS_WIN_CONTROL_VERSION 1 + +/* Commands available under the OVS_WIN_CONTROL_FAMILY. */ +enum ovs_win_control_cmd { + OVS_CTRL_CMD_WIN_PEND_REQ, + OVS_CTRL_CMD_WIN_PEND_PACKET_REQ, + OVS_CTRL_CMD_MC_SUBSCRIBE_REQ, + OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ, + + /* This command is logically belong to the Vport family */ + OVS_CTRL_CMD_EVENT_NOTIFY, + OVS_CTRL_CMD_READ_NOTIFY +}; + +/* NL Attributes for joining/unjoining an MC group */ +enum ovs_nl_mcast_attr { + OVS_NL_ATTR_MCAST_GRP, /* (UINT32) Join an MC group */ + OVS_NL_ATTR_MCAST_JOIN, /* (UINT8) 1/0 - Join/Unjoin */ + OVS_NL_ATTR_PACKET_SUBSCRIBE, /* (UNINT8): 1/0 - subscribe/unsubscribe */ + OVS_NL_ATTR_PACKET_PID, /* (UNINT32) netlink PID to receive upcalls */ + __OVS_NL_ATTR_CTRL_MAX +}; +#define OVS_WIN_CONTROL_ATTR_MAX (__OVS_NL_ATTR_CTRL_MAX - 1) + +/* + * Netdev family of commands specific to Windows. + */ +#define OVS_WIN_NETDEV_FAMILY "ovs_win_netdev" +#define OVS_WIN_NETDEV_MCGROUP "ovs_win_netdev" +#define OVS_WIN_NETDEV_VERSION 1 + +enum ovs_win_netdev_cmd { + OVS_WIN_NETDEV_CMD_UNSPEC, + OVS_WIN_NETDEV_CMD_GET, /* information about the netdev. */ +}; + +/** + * For every vport on the datapath, there is a corresponding netdev. General + * network device attributes of a vport that are not specific to OVS, such as + * MTU are represented using a netdev. For convenience, some of the vport + * attributes are also included as netdev attributes. + * + * enum ovs_win_netdev_attr - attributes for %OVS_WIN_NETDEV_* commands. + * @OVS_WIN_NETDEV_ATTR_PORT_NO: 32-bit port number of the vport within the + * datapath. + * @OVS_WIN_NETDEV_ATTR_TYPE: 32-bit %OVS_VPORT_TYPE_* constant describing + * the type of vport. + * @OVS_WIN_NETDEV_ATTR_NAME: Name of vport. Maximum length %IFNAMSIZ-1 bytes + * plus a null terminator. + * @OVS_WIN_NETDEV_ATTR_MAC_ADDR: MAC address of the vport. %ETH_ADDR_LEN bytes + * long. + * @OVS_WIN_NETDEV_ATTR_MTU : 32-bit MTU of the vport. + * @OVS_WIN_NETDEV_ATTR_IF_FLAGS: 32-bit %OVS_WIN_NETDEV_IFF_* interface flags + * of the vport. + * + * These attributes follow the &struct ovs_header within the Generic Netlink + * payload for %OVS_WIN_NETDEV_* commands. + * + * For all requests, if %OVS_WIN_NETDEV_ATTR_NAME is specified then it is used + * to look up the netdev to operate on; dp_idx from the &struct + * ovs_header is not relevant for the look up. + */ +enum ovs_win_netdev_attr { + OVS_WIN_NETDEV_ATTR_UNSPEC, + OVS_WIN_NETDEV_ATTR_PORT_NO, /* u32 port number within datapath. */ + OVS_WIN_NETDEV_ATTR_TYPE, /* u32 OVS_NETDEV_TYPE_* constant. */ + OVS_WIN_NETDEV_ATTR_NAME, /* string name, up to IFNAMSIZ bytes long. */ + OVS_WIN_NETDEV_ATTR_MAC_ADDR, /* MAC address of the vport. */ + OVS_WIN_NETDEV_ATTR_MTU, /* MTU of the vport. */ + OVS_WIN_NETDEV_ATTR_IF_FLAGS, /* Interface flags o the vport. */ + __OVS_WIN_NETDEV_ATTR_MAX +}; +#define OVS_WIN_NETDEV_ATTR_MAX (__OVS_WIN_NETDEV_ATTR_MAX - 1) + +#define OVS_WIN_NETDEV_IFF_UP (1 << 0) +#define OVS_WIN_NETDEV_IFF_PROMISC (1 << 1) + +typedef struct ovs_dp_stats OVS_DP_STATS; +typedef enum ovs_vport_type OVS_VPORT_TYPE; + +#endif /* __OVS_DP_INTERFACE_EXT_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/misc/install.cmd openvswitch-2.4.0~git20150623/datapath-windows/misc/install.cmd --- openvswitch-2.3.1/datapath-windows/misc/install.cmd 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/misc/install.cmd 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,4 @@ +netcfg -l .\ovsext.inf -c s -i OVSExt + +net stop vmms +net start vmms diff -Nru openvswitch-2.3.1/datapath-windows/misc/OVS.psm1 openvswitch-2.4.0~git20150623/datapath-windows/misc/OVS.psm1 --- openvswitch-2.3.1/datapath-windows/misc/OVS.psm1 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/misc/OVS.psm1 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,210 @@ +<# +Copyright 2014, 2015 Cloudbase Solutions Srl + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +#> + +$WMI_JOB_STATUS_STARTED = 4096 +$WMI_JOB_STATE_RUNNING = 4 +$WMI_JOB_STATE_COMPLETED = 7 + +$hvassembly = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.HyperV.PowerShell") + +function Set-VMNetworkAdapterOVSPort +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Microsoft.HyperV.PowerShell.VMNetworkAdapter]$VMNetworkAdapter, + + [parameter(Mandatory=$true)] + [ValidateLength(1, 48)] + [string]$OVSPortName + ) + process + { + $ns = "root\virtualization\v2" + $EscapedId = $VMNetworkAdapter.Id.Replace('\', '\\') + + $sd = gwmi -namespace $ns -class Msvm_EthernetPortAllocationSettingData -Filter "ElementName = '$OVSPortName'" + if($sd) + { + if($sd.InstanceId.Contains($VMNetworkAdapter.Id)) + { + throw "The OVS port name '$OVSPortName' is already assigned to this port." + } + throw "Cannot assign the OVS port name '$OVSPortName' as it is already assigned to an other port." + } + + $sd = gwmi -namespace $ns -class Msvm_EthernetPortAllocationSettingData -Filter "InstanceId like '$EscapedId%'" + + if($sd) + { + $sd.ElementName = $OVSPortName + + $vsms = gwmi -namespace $ns -class Msvm_VirtualSystemManagementService + $retVal = $vsms.ModifyResourceSettings(@($sd.GetText(1))) + try + { + CheckWMIReturnValue $retVal + } + catch + { + throw "Assigning OVS port '$OVSPortName' failed" + } + } + } +} + +function Get-VMNetworkAdapterByOVSPort +{ + [CmdletBinding()] + param + ( + + [parameter(Mandatory=$true)] + [ValidateLength(1, 48)] + [string]$OVSPortName + ) + process + { + $ns = "root\virtualization\v2" + + $sd = gwmi -namespace $ns -class Msvm_EthernetPortAllocationSettingData -Filter "ElementName = '$OVSPortName'" + if($sd) + { + return $sd + } + } +} + +function Get-VMByOVSPort +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory=$true)] + [ValidateLength(1, 48)] + [string]$OVSPortName + ) + process + { + $ns = "root\virtualization\v2" + + $vms = gwmi -namespace $ns -class Msvm_VirtualSystemSettingData + ForEach($vm in $vms) + { + $ports = gwmi -Namespace $ns -Query " + Associators of {$vm} Where + ResultClass = Msvm_EthernetPortAllocationSettingData" + if ($ports.ElementName -eq $OVSPortName) + { + return $vm + } + } + } +} + +#This function returns the Msvm_VirtualSystemSettingData given a VMName +function Get-VMNetworkAdapterWithOVSPort +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory=$true)] + [ValidateLength(1, 1024)] + [string]$vmName + ) + process + { + $ns = "root\virtualization\v2" + $vm = {} + $ports = {} + + $vm = gwmi -namespace $ns -class Msvm_VirtualSystemSettingData -Filter "ElementName = '$VMName'" + + $ports = gwmi -Namespace $ns -Query " + Associators of {$vm} Where + ResultClass = Msvm_EthernetPortAllocationSettingData" + + return $ports + } +} + +function CheckWMIReturnValue($retVal) +{ + if ($retVal.ReturnValue -ne 0) + { + if ($retVal.ReturnValue -eq $WMI_JOB_STATUS_STARTED) + { + do + { + $job = [wmi]$retVal.Job + } + while ($job.JobState -eq $WMI_JOB_STATE_RUNNING) + + if ($job.JobState -ne $WMI_JOB_STATE_COMPLETED) + { + echo $job.ReturnValue + $errorString = "Job Failed. Job State: " + $job.JobState.ToString() + if ($job.__CLASS -eq "Msvm_ConcreteJob") + { + $errorString += " Error Code: " + $job.ErrorCode.ToString() + $errorString += " Error Details: " + $job.ErrorDescription + } + else + { + $error = $job.GetError() + if ($error.Error) + { + $errorString += " Error:" + $error.Error + } + } + throw $errorString + } + } + else + { + throw "Job Failed. Return Value: {0}" -f $job.ReturnValue + } + } +} + +function Set-VMNetworkAdapterOVSPortDirect +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory=$true)] + [ValidateLength(1, 1024)] + [string]$vmName, + + [parameter(Mandatory=$true)] + [ValidateLength(1, 48)] + [string]$OVSPortName + ) + process + { + $vnic = 0 + + if ($vmName) + { + $vnic = Get-VMNetworkAdapter -VMName $vmName + } + # XXX the vnic index should be provided by the caller + $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName $OVSPortName + } +} + +Export-ModuleMember -function Set-*, Get-* diff -Nru openvswitch-2.3.1/datapath-windows/misc/uninstall.cmd openvswitch-2.4.0~git20150623/datapath-windows/misc/uninstall.cmd --- openvswitch-2.3.1/datapath-windows/misc/uninstall.cmd 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/misc/uninstall.cmd 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1 @@ +netcfg -u OVSExt diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Actions.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Actions.c --- openvswitch-2.3.1/datapath-windows/ovsext/Actions.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Actions.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1599 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" + +#include "Switch.h" +#include "Vport.h" +#include "Event.h" +#include "User.h" +#include "NetProto.h" +#include "Flow.h" +#include "Vxlan.h" +#include "Stt.h" +#include "Checksum.h" +#include "PacketIO.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_ACTION +#include "Debug.h" + +typedef struct _OVS_ACTION_STATS { + UINT64 rxVxlan; + UINT64 txVxlan; + UINT64 rxStt; + UINT64 txStt; + UINT64 flowMiss; + UINT64 flowUserspace; + UINT64 txTcp; + UINT32 failedFlowMiss; + UINT32 noVport; + UINT32 failedFlowExtract; + UINT32 noResource; + UINT32 noCopiedNbl; + UINT32 failedEncap; + UINT32 failedDecap; + UINT32 cannotGrowDest; + UINT32 zeroActionLen; + UINT32 failedChecksum; +} OVS_ACTION_STATS, *POVS_ACTION_STATS; + +OVS_ACTION_STATS ovsActionStats; + +/* + * There a lot of data that needs to be maintained while executing the pipeline + * as dictated by the actions of a flow, across different functions at different + * levels. Such data is put together in a 'context' structure. Care should be + * exercised while adding new members to the structure - only add ones that get + * used across multiple stages in the pipeline/get used in multiple functions. + */ +#define OVS_DEST_PORTS_ARRAY_MIN_SIZE 2 +typedef struct OvsForwardingContext { + POVS_SWITCH_CONTEXT switchContext; + /* The NBL currently used in the pipeline. */ + PNET_BUFFER_LIST curNbl; + /* NDIS forwarding detail for 'curNbl'. */ + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO fwdDetail; + /* Array of destination ports for 'curNbl'. */ + PNDIS_SWITCH_FORWARDING_DESTINATION_ARRAY destinationPorts; + /* send flags while sending 'curNbl' into NDIS. */ + ULONG sendFlags; + /* Total number of output ports, used + unused, in 'curNbl'. */ + UINT32 destPortsSizeIn; + /* Total number of used output ports in 'curNbl'. */ + UINT32 destPortsSizeOut; + /* + * If 'curNbl' is not owned by OVS, they need to be tracked, if they need to + * be freed/completed. + */ + OvsCompletionList *completionList; + /* + * vport number of 'curNbl' when it is passed from the PIF bridge to the INT + * bridge. ie. during tunneling on the Rx side. + */ + UINT32 srcVportNo; + + /* + * Tunnel key: + * - specified in actions during tunneling Tx + * - extracted from an NBL during tunneling Rx + */ + OvsIPv4TunnelKey tunKey; + + /* + * Tunneling - Tx: + * To store the output port, when it is a tunneled port. We don't foresee + * multiple tunneled ports as outport for any given NBL. + */ + POVS_VPORT_ENTRY tunnelTxNic; + + /* + * Tunneling - Rx: + * Points to the Internal port on the PIF Bridge, if the packet needs to be + * de-tunneled. + */ + POVS_VPORT_ENTRY tunnelRxNic; + + /* header information */ + OVS_PACKET_HDR_INFO layers; +} OvsForwardingContext; + + +/* + * -------------------------------------------------------------------------- + * OvsInitForwardingCtx -- + * Function to init/re-init the 'ovsFwdCtx' context as the actions pipeline + * is being executed. + * + * Result: + * NDIS_STATUS_SUCCESS on success + * Other NDIS_STATUS upon failure. Upon failure, it is safe to call + * OvsCompleteNBLForwardingCtx(), since 'ovsFwdCtx' has been initialized + * enough for OvsCompleteNBLForwardingCtx() to do its work. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsInitForwardingCtx(OvsForwardingContext *ovsFwdCtx, + POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST curNbl, + UINT32 srcVportNo, + ULONG sendFlags, + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO fwdDetail, + OvsCompletionList *completionList, + OVS_PACKET_HDR_INFO *layers, + BOOLEAN resetTunnelInfo) +{ + ASSERT(ovsFwdCtx); + ASSERT(switchContext); + ASSERT(curNbl); + ASSERT(fwdDetail); + + /* + * Set values for curNbl and switchContext so upon failures, we have enough + * information to do cleanup. + */ + ovsFwdCtx->curNbl = curNbl; + ovsFwdCtx->switchContext = switchContext; + ovsFwdCtx->completionList = completionList; + ovsFwdCtx->fwdDetail = fwdDetail; + + if (fwdDetail->NumAvailableDestinations > 0) { + /* + * XXX: even though MSDN says GetNetBufferListDestinations() returns + * NDIS_STATUS, the header files say otherwise. + */ + switchContext->NdisSwitchHandlers.GetNetBufferListDestinations( + switchContext->NdisSwitchContext, curNbl, + &ovsFwdCtx->destinationPorts); + + ASSERT(ovsFwdCtx->destinationPorts); + /* Ensure that none of the elements are consumed yet. */ + ASSERT(ovsFwdCtx->destinationPorts->NumElements == + fwdDetail->NumAvailableDestinations); + } else { + ovsFwdCtx->destinationPorts = NULL; + } + ovsFwdCtx->destPortsSizeIn = fwdDetail->NumAvailableDestinations; + ovsFwdCtx->destPortsSizeOut = 0; + ovsFwdCtx->srcVportNo = srcVportNo; + ovsFwdCtx->sendFlags = sendFlags; + if (layers) { + ovsFwdCtx->layers = *layers; + } else { + RtlZeroMemory(&ovsFwdCtx->layers, sizeof ovsFwdCtx->layers); + } + if (resetTunnelInfo) { + ovsFwdCtx->tunnelTxNic = NULL; + ovsFwdCtx->tunnelRxNic = NULL; + RtlZeroMemory(&ovsFwdCtx->tunKey, sizeof ovsFwdCtx->tunKey); + } + + return NDIS_STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * OvsDetectTunnelRxPkt -- + * Utility function for an RX packet to detect its tunnel type. + * + * Result: + * True - if the tunnel type was detected. + * False - if not a tunnel packet or tunnel type not supported. + * -------------------------------------------------------------------------- + */ +static __inline BOOLEAN +OvsDetectTunnelRxPkt(OvsForwardingContext *ovsFwdCtx, + const OvsFlowKey *flowKey) +{ + POVS_VPORT_ENTRY tunnelVport = NULL; + + /* XXX: we should also check for the length of the UDP payload to pick + * packets only if they are at least VXLAN header size. + */ + if (!flowKey->ipKey.nwFrag && + flowKey->ipKey.nwProto == IPPROTO_UDP) { + UINT16 dstPort = ntohs(flowKey->ipKey.l4.tpDst); + tunnelVport = OvsFindTunnelVportByDstPort(ovsFwdCtx->switchContext, + dstPort, + OVS_VPORT_TYPE_VXLAN); + if (tunnelVport) { + ovsActionStats.rxVxlan++; + } + } else if (!flowKey->ipKey.nwFrag && + flowKey->ipKey.nwProto == IPPROTO_TCP) { + UINT16 dstPort = htons(flowKey->ipKey.l4.tpDst); + tunnelVport = OvsFindTunnelVportByDstPort(ovsFwdCtx->switchContext, + dstPort, + OVS_VPORT_TYPE_STT); + if (tunnelVport) { + ovsActionStats.rxStt++; + } + } + + + // We might get tunnel packets even before the tunnel gets initialized. + if (tunnelVport) { + ASSERT(ovsFwdCtx->tunnelRxNic == NULL); + ovsFwdCtx->tunnelRxNic = tunnelVport; + return TRUE; + } + + return FALSE; +} + +/* + * -------------------------------------------------------------------------- + * OvsDetectTunnelPkt -- + * Utility function to detect if a packet is to be subjected to + * tunneling (Tx) or de-tunneling (Rx). Various factors such as source + * port, destination port, packet contents, and previously setup tunnel + * context are used. + * + * Result: + * True - If the packet is to be subjected to tunneling. + * In case of invalid tunnel context, the tunneling functionality is + * a no-op and is completed within this function itself by consuming + * all of the tunneling context. + * False - If not a tunnel packet or tunnel type not supported. Caller should + * process the packet as a non-tunnel packet. + * -------------------------------------------------------------------------- + */ +static __inline BOOLEAN +OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx, + const POVS_VPORT_ENTRY dstVport, + const OvsFlowKey *flowKey) +{ + if (OvsIsInternalVportType(dstVport->ovsType)) { + /* + * Rx: + * The source of NBL during tunneling Rx could be the external + * port or if it is being executed from userspace, the source port is + * default port. + */ + BOOLEAN validSrcPort = + (ovsFwdCtx->fwdDetail->SourcePortId == + ovsFwdCtx->switchContext->virtualExternalPortId) || + (ovsFwdCtx->fwdDetail->SourcePortId == + NDIS_SWITCH_DEFAULT_PORT_ID); + + if (validSrcPort && OvsDetectTunnelRxPkt(ovsFwdCtx, flowKey)) { + ASSERT(ovsFwdCtx->tunnelTxNic == NULL); + ASSERT(ovsFwdCtx->tunnelRxNic != NULL); + return TRUE; + } + } else if (OvsIsTunnelVportType(dstVport->ovsType)) { + ASSERT(ovsFwdCtx->tunnelTxNic == NULL); + ASSERT(ovsFwdCtx->tunnelRxNic == NULL); + + /* + * Tx: + * The destination port is a tunnel port. Encapsulation must be + * performed only on packets that originate from: + * - a VIF port + * - a bridge-internal port (packets generated from userspace) + * - no port. + * + * If the packet will not be encapsulated, consume the tunnel context + * by clearing it. + */ + if (ovsFwdCtx->srcVportNo != OVS_DEFAULT_PORT_NO) { + + POVS_VPORT_ENTRY vport = OvsFindVportByPortNo( + ovsFwdCtx->switchContext, ovsFwdCtx->srcVportNo); + + if (!vport || + (vport->ovsType != OVS_VPORT_TYPE_NETDEV && + !OvsIsBridgeInternalVport(vport))) { + ovsFwdCtx->tunKey.dst = 0; + } + } + + /* Tunnel the packet only if tunnel context is set. */ + if (ovsFwdCtx->tunKey.dst != 0) { + switch(dstVport->ovsType) { + case OVS_VPORT_TYPE_VXLAN: + ovsActionStats.txVxlan++; + break; + case OVS_VPORT_TYPE_STT: + ovsActionStats.txStt++; + break; + } + ovsActionStats.txVxlan++; + ovsFwdCtx->tunnelTxNic = dstVport; + } + + return TRUE; + } + + return FALSE; +} + + +/* + * -------------------------------------------------------------------------- + * OvsAddPorts -- + * Add the specified destination vport into the forwarding context. If the + * vport is a VIF/external port, it is added directly to the NBL. If it is + * a tunneling port, it is NOT added to the NBL. + * + * Result: + * NDIS_STATUS_SUCCESS on success + * Other NDIS_STATUS upon failure. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsAddPorts(OvsForwardingContext *ovsFwdCtx, + OvsFlowKey *flowKey, + NDIS_SWITCH_PORT_ID dstPortId, + BOOLEAN preserveVLAN, + BOOLEAN preservePriority) +{ + POVS_VPORT_ENTRY vport; + PNDIS_SWITCH_PORT_DESTINATION fwdPort; + NDIS_STATUS status; + POVS_SWITCH_CONTEXT switchContext = ovsFwdCtx->switchContext; + + /* + * We hold the dispatch lock that protects the list of vports, so vports + * validated here can be added as destinations safely before we call into + * NDIS. + * + * Some of the vports can be tunnelled ports as well in which case + * they should be added to a separate list of tunnelled destination ports + * instead of the VIF ports. The context for the tunnel is settable + * in OvsForwardingContext. + */ + vport = OvsFindVportByPortNo(ovsFwdCtx->switchContext, dstPortId); + if (vport == NULL || vport->ovsState != OVS_STATE_CONNECTED) { + /* + * There may be some latency between a port disappearing, and userspace + * updating the recalculated flows. In the meantime, handle invalid + * ports gracefully. + */ + ovsActionStats.noVport++; + return NDIS_STATUS_SUCCESS; + } + ASSERT(vport->nicState == NdisSwitchNicStateConnected); + vport->stats.txPackets++; + vport->stats.txBytes += + NET_BUFFER_DATA_LENGTH(NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl)); + + if (OvsIsBridgeInternalVport(vport)) { + return NDIS_STATUS_SUCCESS; + } + + if (OvsDetectTunnelPkt(ovsFwdCtx, vport, flowKey)) { + return NDIS_STATUS_SUCCESS; + } + + if (ovsFwdCtx->destPortsSizeOut == ovsFwdCtx->destPortsSizeIn) { + if (ovsFwdCtx->destPortsSizeIn == 0) { + ASSERT(ovsFwdCtx->destinationPorts == NULL); + ASSERT(ovsFwdCtx->fwdDetail->NumAvailableDestinations == 0); + status = + switchContext->NdisSwitchHandlers.GrowNetBufferListDestinations( + switchContext->NdisSwitchContext, ovsFwdCtx->curNbl, + OVS_DEST_PORTS_ARRAY_MIN_SIZE, + &ovsFwdCtx->destinationPorts); + if (status != NDIS_STATUS_SUCCESS) { + ovsActionStats.cannotGrowDest++; + return status; + } + ovsFwdCtx->destPortsSizeIn = + ovsFwdCtx->fwdDetail->NumAvailableDestinations; + ASSERT(ovsFwdCtx->destinationPorts); + } else { + ASSERT(ovsFwdCtx->destinationPorts != NULL); + /* + * NumElements: + * A ULONG value that specifies the total number of + * NDIS_SWITCH_PORT_DESTINATION elements in the + * NDIS_SWITCH_FORWARDING_DESTINATION_ARRAY structure. + * + * NumDestinations: + * A ULONG value that specifies the number of + * NDIS_SWITCH_PORT_DESTINATION elements in the + * NDIS_SWITCH_FORWARDING_DESTINATION_ARRAY structure that + * specify port destinations. + * + * NumAvailableDestinations: + * A value that specifies the number of unused extensible switch + * destination ports elements within an NET_BUFFER_LIST structure. + */ + ASSERT(ovsFwdCtx->destinationPorts->NumElements == + ovsFwdCtx->destPortsSizeIn); + ASSERT(ovsFwdCtx->destinationPorts->NumDestinations == + ovsFwdCtx->destPortsSizeOut - + ovsFwdCtx->fwdDetail->NumAvailableDestinations); + ASSERT(ovsFwdCtx->fwdDetail->NumAvailableDestinations > 0); + /* + * Before we grow the array of destination ports, the current set + * of ports needs to be committed. Only the ports added since the + * last commit need to be part of the new update. + */ + status = switchContext->NdisSwitchHandlers.UpdateNetBufferListDestinations( + switchContext->NdisSwitchContext, ovsFwdCtx->curNbl, + ovsFwdCtx->fwdDetail->NumAvailableDestinations, + ovsFwdCtx->destinationPorts); + if (status != NDIS_STATUS_SUCCESS) { + ovsActionStats.cannotGrowDest++; + return status; + } + ASSERT(ovsFwdCtx->destinationPorts->NumElements == + ovsFwdCtx->destPortsSizeIn); + ASSERT(ovsFwdCtx->destinationPorts->NumDestinations == + ovsFwdCtx->destPortsSizeOut); + ASSERT(ovsFwdCtx->fwdDetail->NumAvailableDestinations == 0); + + status = switchContext->NdisSwitchHandlers.GrowNetBufferListDestinations( + switchContext->NdisSwitchContext, ovsFwdCtx->curNbl, + ovsFwdCtx->destPortsSizeIn, &ovsFwdCtx->destinationPorts); + if (status != NDIS_STATUS_SUCCESS) { + ovsActionStats.cannotGrowDest++; + return status; + } + ASSERT(ovsFwdCtx->destinationPorts != NULL); + ovsFwdCtx->destPortsSizeIn <<= 1; + } + } + + ASSERT(ovsFwdCtx->destPortsSizeOut < ovsFwdCtx->destPortsSizeIn); + fwdPort = + NDIS_SWITCH_PORT_DESTINATION_AT_ARRAY_INDEX(ovsFwdCtx->destinationPorts, + ovsFwdCtx->destPortsSizeOut); + + fwdPort->PortId = vport->portId; + fwdPort->NicIndex = vport->nicIndex; + fwdPort->IsExcluded = 0; + fwdPort->PreserveVLAN = preserveVLAN; + fwdPort->PreservePriority = preservePriority; + ovsFwdCtx->destPortsSizeOut += 1; + + return NDIS_STATUS_SUCCESS; +} + + +/* + * -------------------------------------------------------------------------- + * OvsClearTunTxCtx -- + * Utility function to clear tx tunneling context. + * -------------------------------------------------------------------------- + */ +static __inline VOID +OvsClearTunTxCtx(OvsForwardingContext *ovsFwdCtx) +{ + ovsFwdCtx->tunnelTxNic = NULL; + ovsFwdCtx->tunKey.dst = 0; +} + + +/* + * -------------------------------------------------------------------------- + * OvsClearTunRxCtx -- + * Utility function to clear rx tunneling context. + * -------------------------------------------------------------------------- + */ +static __inline VOID +OvsClearTunRxCtx(OvsForwardingContext *ovsFwdCtx) +{ + ovsFwdCtx->tunnelRxNic = NULL; + ovsFwdCtx->tunKey.dst = 0; +} + + +/* + * -------------------------------------------------------------------------- + * OvsCompleteNBLForwardingCtx -- + * This utility function is responsible for freeing/completing an NBL - either + * by adding it to a completion list or by freeing it. + * + * Side effects: + * It also resets the necessary fields in 'ovsFwdCtx'. + * -------------------------------------------------------------------------- + */ +static __inline VOID +OvsCompleteNBLForwardingCtx(OvsForwardingContext *ovsFwdCtx, + PCWSTR dropReason) +{ + NDIS_STRING filterReason; + + RtlInitUnicodeString(&filterReason, dropReason); + if (ovsFwdCtx->completionList) { + OvsAddPktCompletionList(ovsFwdCtx->completionList, TRUE, + ovsFwdCtx->fwdDetail->SourcePortId, ovsFwdCtx->curNbl, 1, + &filterReason); + ovsFwdCtx->curNbl = NULL; + } else { + /* If there is no completionList, we assume this is ovs created NBL */ + ovsFwdCtx->curNbl = OvsCompleteNBL(ovsFwdCtx->switchContext, + ovsFwdCtx->curNbl, TRUE); + ASSERT(ovsFwdCtx->curNbl == NULL); + } + /* XXX: these can be made debug only to save cycles. Ideally the pipeline + * using these fields should reset the values at the end of the pipeline. */ + ovsFwdCtx->destPortsSizeOut = 0; + ovsFwdCtx->tunnelTxNic = NULL; + ovsFwdCtx->tunnelRxNic = NULL; +} + +/* + * -------------------------------------------------------------------------- + * OvsDoFlowLookupOutput -- + * Function to be used for the second stage of a tunneling workflow, ie.: + * - On the encapsulated packet on Tx path, to do a flow extract, flow + * lookup and excuting the actions. + * - On the decapsulated packet on Rx path, to do a flow extract, flow + * lookup and excuting the actions. + * + * XXX: It is assumed that the NBL in 'ovsFwdCtx' is owned by OVS. This is + * until the new buffer management framework is adopted. + * + * Side effects: + * The NBL in 'ovsFwdCtx' is consumed. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsDoFlowLookupOutput(OvsForwardingContext *ovsFwdCtx) +{ + OvsFlowKey key; + OvsFlow *flow; + UINT64 hash; + NDIS_STATUS status; + POVS_VPORT_ENTRY vport = + OvsFindVportByPortNo(ovsFwdCtx->switchContext, ovsFwdCtx->srcVportNo); + if (vport == NULL || vport->ovsState != OVS_STATE_CONNECTED) { + ASSERT(FALSE); // XXX: let's catch this for now + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-Dropped due to internal/tunnel port removal"); + ovsActionStats.noVport++; + return NDIS_STATUS_SUCCESS; + } + ASSERT(vport->nicState == NdisSwitchNicStateConnected); + + /* Assert that in the Rx direction, key is always setup. */ + ASSERT(ovsFwdCtx->tunnelRxNic == NULL || ovsFwdCtx->tunKey.dst != 0); + status = OvsExtractFlow(ovsFwdCtx->curNbl, ovsFwdCtx->srcVportNo, + &key, &ovsFwdCtx->layers, ovsFwdCtx->tunKey.dst != 0 ? + &ovsFwdCtx->tunKey : NULL); + if (status != NDIS_STATUS_SUCCESS) { + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-Flow extract failed"); + ovsActionStats.failedFlowExtract++; + return status; + } + + flow = OvsLookupFlow(&ovsFwdCtx->switchContext->datapath, &key, &hash, FALSE); + if (flow) { + OvsFlowUsed(flow, ovsFwdCtx->curNbl, &ovsFwdCtx->layers); + ovsFwdCtx->switchContext->datapath.hits++; + status = OvsActionsExecute(ovsFwdCtx->switchContext, + ovsFwdCtx->completionList, ovsFwdCtx->curNbl, + ovsFwdCtx->srcVportNo, ovsFwdCtx->sendFlags, + &key, &hash, &ovsFwdCtx->layers, + flow->actions, flow->actionsLen); + ovsFwdCtx->curNbl = NULL; + } else { + LIST_ENTRY missedPackets; + UINT32 num = 0; + ovsFwdCtx->switchContext->datapath.misses++; + InitializeListHead(&missedPackets); + status = OvsCreateAndAddPackets(NULL, 0, OVS_PACKET_CMD_MISS, + ovsFwdCtx->srcVportNo, + &key,ovsFwdCtx->curNbl, + ovsFwdCtx->tunnelRxNic != NULL, &ovsFwdCtx->layers, + ovsFwdCtx->switchContext, &missedPackets, &num); + if (num) { + OvsQueuePackets(&missedPackets, num); + } + if (status == NDIS_STATUS_SUCCESS) { + /* Complete the packet since it was copied to user buffer. */ + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-Dropped since packet was copied to userspace"); + ovsActionStats.flowMiss++; + status = NDIS_STATUS_SUCCESS; + } else { + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-Dropped due to failure to queue to userspace"); + status = NDIS_STATUS_FAILURE; + ovsActionStats.failedFlowMiss++; + } + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * OvsTunnelPortTx -- + * The start function for Tx tunneling - encapsulates the packet, and + * outputs the packet on the PIF bridge. + * + * Side effects: + * The NBL in 'ovsFwdCtx' is consumed. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsTunnelPortTx(OvsForwardingContext *ovsFwdCtx) +{ + NDIS_STATUS status = NDIS_STATUS_FAILURE; + PNET_BUFFER_LIST newNbl = NULL; + + /* + * Setup the source port to be the internal port to as to facilitate the + * second OvsLookupFlow. + */ + if (ovsFwdCtx->switchContext->internalVport == NULL || + ovsFwdCtx->switchContext->virtualExternalVport == NULL) { + OvsClearTunTxCtx(ovsFwdCtx); + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-Dropped since either internal or external port is absent"); + return NDIS_STATUS_FAILURE; + } + ovsFwdCtx->srcVportNo = + ((POVS_VPORT_ENTRY)ovsFwdCtx->switchContext->internalVport)->portNo; + + ovsFwdCtx->fwdDetail->SourcePortId = ovsFwdCtx->switchContext->internalPortId; + ovsFwdCtx->fwdDetail->SourceNicIndex = + ((POVS_VPORT_ENTRY)ovsFwdCtx->switchContext->internalVport)->nicIndex; + + /* Do the encap. Encap function does not consume the NBL. */ + switch(ovsFwdCtx->tunnelTxNic->ovsType) { + case OVS_VPORT_TYPE_VXLAN: + status = OvsEncapVxlan(ovsFwdCtx->tunnelTxNic, ovsFwdCtx->curNbl, + &ovsFwdCtx->tunKey, ovsFwdCtx->switchContext, + &ovsFwdCtx->layers, &newNbl); + break; + case OVS_VPORT_TYPE_STT: + status = OvsEncapStt(ovsFwdCtx->tunnelTxNic, ovsFwdCtx->curNbl, + &ovsFwdCtx->tunKey, ovsFwdCtx->switchContext, + &ovsFwdCtx->layers, &newNbl); + break; + default: + ASSERT(! "Tx: Unhandled tunnel type"); + } + + /* Reset the tunnel context so that it doesn't get used after this point. */ + OvsClearTunTxCtx(ovsFwdCtx); + + if (status == NDIS_STATUS_SUCCESS) { + ASSERT(newNbl); + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"Complete after cloning NBL for encapsulation"); + ovsFwdCtx->curNbl = newNbl; + status = OvsDoFlowLookupOutput(ovsFwdCtx); + ASSERT(ovsFwdCtx->curNbl == NULL); + } else { + /* + * XXX: Temporary freeing of the packet until we register a + * callback to IP helper. + */ + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-Dropped due to encap failure"); + ovsActionStats.failedEncap++; + status = NDIS_STATUS_SUCCESS; + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * OvsTunnelPortRx -- + * Decapsulate the incoming NBL based on the tunnel type and goes through + * the flow lookup for the inner packet. + * + * Note: IP checksum is validate here, but L4 checksum validation needs + * to be done by the corresponding tunnel types. + * + * Side effects: + * The NBL in 'ovsFwdCtx' is consumed. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsTunnelPortRx(OvsForwardingContext *ovsFwdCtx) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + PNET_BUFFER_LIST newNbl = NULL; + POVS_VPORT_ENTRY tunnelRxVport = ovsFwdCtx->tunnelRxNic; + + if (OvsValidateIPChecksum(ovsFwdCtx->curNbl, &ovsFwdCtx->layers) + != NDIS_STATUS_SUCCESS) { + ovsActionStats.failedChecksum++; + OVS_LOG_INFO("Packet dropped due to IP checksum failure."); + goto dropNbl; + } + + /* + * Decap port functions should return a new NBL if it was copied, and + * this new NBL should be setup as the ovsFwdCtx->curNbl. + */ + + switch(tunnelRxVport->ovsType) { + case OVS_VPORT_TYPE_VXLAN: + status = OvsDecapVxlan(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, + &ovsFwdCtx->tunKey, &newNbl); + break; + case OVS_VPORT_TYPE_STT: + status = OvsDecapStt(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, + &ovsFwdCtx->tunKey, &newNbl); + break; + default: + OVS_LOG_ERROR("Rx: Unhandled tunnel type: %d\n", + tunnelRxVport->ovsType); + ASSERT(! "Rx: Unhandled tunnel type"); + status = NDIS_STATUS_NOT_SUPPORTED; + } + + if (status != NDIS_STATUS_SUCCESS) { + ovsActionStats.failedDecap++; + goto dropNbl; + } + + /* + * tunnelRxNic and other fields will be cleared, re-init the context + * before usage. + */ + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-dropped due to new decap packet"); + + /* Decapsulated packet is in a new NBL */ + ovsFwdCtx->tunnelRxNic = tunnelRxVport; + OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, + newNbl, tunnelRxVport->portNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), + ovsFwdCtx->completionList, + &ovsFwdCtx->layers, FALSE); + + /* + * Set the NBL's SourcePortId and SourceNicIndex to default values to + * keep NDIS happy when we forward the packet. + */ + ovsFwdCtx->fwdDetail->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID; + ovsFwdCtx->fwdDetail->SourceNicIndex = 0; + + status = OvsDoFlowLookupOutput(ovsFwdCtx); + ASSERT(ovsFwdCtx->curNbl == NULL); + OvsClearTunRxCtx(ovsFwdCtx); + + return status; + +dropNbl: + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-dropped due to decap failure"); + OvsClearTunRxCtx(ovsFwdCtx); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * OvsOutputForwardingCtx -- + * This function outputs an NBL to NDIS or to a tunneling pipeline based on + * the ports added so far into 'ovsFwdCtx'. + * + * Side effects: + * This function consumes the NBL - either by forwarding it successfully to + * NDIS, or adding it to the completion list in 'ovsFwdCtx', or freeing it. + * + * Also makes sure that the list of destination ports - tunnel or otherwise is + * drained. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx) +{ + NDIS_STATUS status = STATUS_SUCCESS; + POVS_SWITCH_CONTEXT switchContext = ovsFwdCtx->switchContext; + PCWSTR dropReason; + + /* + * Handle the case where the some of the destination ports are tunneled + * ports - the non-tunneled ports get a unmodified copy of the NBL, and the + * tunneling pipeline starts when we output the packet to tunneled port. + */ + if (ovsFwdCtx->destPortsSizeOut > 0) { + PNET_BUFFER_LIST newNbl = NULL; + PNET_BUFFER nb; + UINT32 portsToUpdate = + ovsFwdCtx->fwdDetail->NumAvailableDestinations - + (ovsFwdCtx->destPortsSizeIn - ovsFwdCtx->destPortsSizeOut); + + ASSERT(ovsFwdCtx->destinationPorts != NULL); + + /* + * Create a copy of the packet in order to do encap on it later. Also, + * don't copy the offload context since the encap'd packet has a + * different set of headers. This will change when we implement offloads + * before doing encapsulation. + */ + if (ovsFwdCtx->tunnelTxNic != NULL || ovsFwdCtx->tunnelRxNic != NULL) { + nb = NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl); + newNbl = OvsPartialCopyNBL(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, + 0, 0, TRUE /*copy NBL info*/); + if (newNbl == NULL) { + status = NDIS_STATUS_RESOURCES; + ovsActionStats.noCopiedNbl++; + dropReason = L"Dropped due to failure to create NBL copy."; + goto dropit; + } + } + + /* It does not seem like we'll get here unless 'portsToUpdate' > 0. */ + ASSERT(portsToUpdate > 0); + status = switchContext->NdisSwitchHandlers.UpdateNetBufferListDestinations( + switchContext->NdisSwitchContext, ovsFwdCtx->curNbl, + portsToUpdate, ovsFwdCtx->destinationPorts); + if (status != NDIS_STATUS_SUCCESS) { + OvsCompleteNBL(ovsFwdCtx->switchContext, newNbl, TRUE); + ovsActionStats.cannotGrowDest++; + dropReason = L"Dropped due to failure to update destinations."; + goto dropit; + } + + OvsSendNBLIngress(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, + ovsFwdCtx->sendFlags); + /* End this pipeline by resetting the corresponding context. */ + ovsFwdCtx->destPortsSizeOut = 0; + ovsFwdCtx->curNbl = NULL; + if (newNbl) { + status = OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, + newNbl, ovsFwdCtx->srcVportNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), + ovsFwdCtx->completionList, + &ovsFwdCtx->layers, FALSE); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"Dropped due to resouces."; + goto dropit; + } + } + } + + if (ovsFwdCtx->tunnelTxNic != NULL) { + status = OvsTunnelPortTx(ovsFwdCtx); + ASSERT(ovsFwdCtx->tunnelTxNic == NULL); + ASSERT(ovsFwdCtx->tunKey.dst == 0); + } else if (ovsFwdCtx->tunnelRxNic != NULL) { + status = OvsTunnelPortRx(ovsFwdCtx); + ASSERT(ovsFwdCtx->tunnelRxNic == NULL); + ASSERT(ovsFwdCtx->tunKey.dst == 0); + } + ASSERT(ovsFwdCtx->curNbl == NULL); + + return status; + +dropit: + if (status != NDIS_STATUS_SUCCESS) { + OvsCompleteNBLForwardingCtx(ovsFwdCtx, dropReason); + } + + return status; +} + + +/* + * -------------------------------------------------------------------------- + * OvsLookupFlowOutput -- + * Utility function for external callers to do flow extract, lookup, + * actions execute on a given NBL. + * + * Note: If this is being used from a callback function, make sure that the + * arguments specified are still valid in the asynchronous context. + * + * Side effects: + * This function consumes the NBL. + * -------------------------------------------------------------------------- + */ +VOID +OvsLookupFlowOutput(POVS_SWITCH_CONTEXT switchContext, + VOID *compList, + PNET_BUFFER_LIST curNbl) +{ + NDIS_STATUS status; + OvsForwardingContext ovsFwdCtx; + POVS_VPORT_ENTRY internalVport = + (POVS_VPORT_ENTRY)switchContext->internalVport; + + /* XXX: make sure comp list was not a stack variable previously. */ + OvsCompletionList *completionList = (OvsCompletionList *)compList; + + /* + * XXX: can internal port disappear while we are busy doing ARP resolution? + * It could, but will we get this callback from IP helper in that case. Need + * to check. + */ + ASSERT(switchContext->internalVport); + status = OvsInitForwardingCtx(&ovsFwdCtx, switchContext, curNbl, + internalVport->portNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(curNbl), + completionList, NULL, TRUE); + if (status != NDIS_STATUS_SUCCESS) { + OvsCompleteNBLForwardingCtx(&ovsFwdCtx, + L"OVS-Dropped due to resources"); + return; + } + + ASSERT(FALSE); + /* + * XXX: We need to acquire the dispatch lock and the datapath lock. + */ + + OvsDoFlowLookupOutput(&ovsFwdCtx); +} + + +/* + * -------------------------------------------------------------------------- + * OvsOutputBeforeSetAction -- + * Function to be called to complete one set of actions on an NBL, before + * we start the next one. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsOutputBeforeSetAction(OvsForwardingContext *ovsFwdCtx) +{ + PNET_BUFFER_LIST newNbl; + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + PNET_BUFFER nb; + + /* + * Create a copy and work on the copy after this point. The original NBL is + * forwarded. One reason to not use the copy for forwarding is that + * ports have already been added to the original NBL, and it might be + * inefficient/impossible to remove/re-add them to the copy. There's no + * notion of removing the ports, the ports need to be marked as + * "isExcluded". There's seems no real advantage to retaining the original + * and sending out the copy instead. + * + * XXX: We are copying the offload context here. This is to handle actions + * such as: + * outport, pop_vlan(), outport, push_vlan(), outport + * + * copy size needs to include inner ether + IP + TCP, need to revisit + * if we support IP options. + * XXX Head room needs to include the additional encap. + * XXX copySize check is not considering multiple NBs. + */ + nb = NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl); + newNbl = OvsPartialCopyNBL(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, + 0, 0, TRUE /*copy NBL info*/); + + ASSERT(ovsFwdCtx->destPortsSizeOut > 0 || + ovsFwdCtx->tunnelTxNic != NULL || ovsFwdCtx->tunnelRxNic != NULL); + + /* Send the original packet out */ + status = OvsOutputForwardingCtx(ovsFwdCtx); + ASSERT(ovsFwdCtx->curNbl == NULL); + ASSERT(ovsFwdCtx->destPortsSizeOut == 0); + ASSERT(ovsFwdCtx->tunnelRxNic == NULL); + ASSERT(ovsFwdCtx->tunnelTxNic == NULL); + + /* If we didn't make a copy, can't continue. */ + if (newNbl == NULL) { + ovsActionStats.noCopiedNbl++; + return NDIS_STATUS_RESOURCES; + } + + /* Finish the remaining actions with the new NBL */ + if (status != NDIS_STATUS_SUCCESS) { + OvsCompleteNBL(ovsFwdCtx->switchContext, newNbl, TRUE); + } else { + status = OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, + newNbl, ovsFwdCtx->srcVportNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), + ovsFwdCtx->completionList, + &ovsFwdCtx->layers, FALSE); + } + + return status; +} + + +/* + * -------------------------------------------------------------------------- + * OvsPopVlanInPktBuf -- + * Function to pop a VLAN tag when the tag is in the packet buffer. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsPopVlanInPktBuf(OvsForwardingContext *ovsFwdCtx) +{ + PNET_BUFFER curNb; + PMDL curMdl; + PUINT8 bufferStart; + ULONG dataLength = sizeof (DL_EUI48) + sizeof (DL_EUI48); + UINT32 packetLen, mdlLen; + PNET_BUFFER_LIST newNbl; + NDIS_STATUS status; + + /* + * Declare a dummy vlanTag structure since we need to compute the size + * of shiftLength. The NDIS one is a unionized structure. + */ + NDIS_PACKET_8021Q_INFO vlanTag = {0}; + ULONG shiftLength = sizeof (vlanTag.TagHeader); + PUINT8 tempBuffer[sizeof (DL_EUI48) + sizeof (DL_EUI48)]; + + newNbl = OvsPartialCopyNBL(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, + 0, 0, TRUE /* copy NBL info */); + if (!newNbl) { + ovsActionStats.noCopiedNbl++; + return NDIS_STATUS_RESOURCES; + } + + /* Complete the original NBL and create a copy to modify. */ + OvsCompleteNBLForwardingCtx(ovsFwdCtx, L"OVS-Dropped due to copy"); + + status = OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, + newNbl, ovsFwdCtx->srcVportNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), + NULL, &ovsFwdCtx->layers, FALSE); + if (status != NDIS_STATUS_SUCCESS) { + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"Dropped due to resouces"); + return NDIS_STATUS_RESOURCES; + } + + curNb = NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl); + packetLen = NET_BUFFER_DATA_LENGTH(curNb); + ASSERT(curNb->Next == NULL); + curMdl = NET_BUFFER_CURRENT_MDL(curNb); + NdisQueryMdl(curMdl, &bufferStart, &mdlLen, LowPagePriority); + if (!bufferStart) { + return NDIS_STATUS_RESOURCES; + } + mdlLen -= NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + /* Bail out if L2 + VLAN header is not contiguous in the first buffer. */ + if (MIN(packetLen, mdlLen) < sizeof (EthHdr) + shiftLength) { + ASSERT(FALSE); + return NDIS_STATUS_FAILURE; + } + bufferStart += NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + RtlCopyMemory(tempBuffer, bufferStart, dataLength); + RtlCopyMemory(bufferStart + shiftLength, tempBuffer, dataLength); + NdisAdvanceNetBufferDataStart(curNb, shiftLength, FALSE, NULL); + + return NDIS_STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * OvsTunnelAttrToIPv4TunnelKey -- + * Convert tunnel attribute to OvsIPv4TunnelKey. + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsTunnelAttrToIPv4TunnelKey(PNL_ATTR attr, + OvsIPv4TunnelKey *tunKey) +{ + PNL_ATTR a; + INT rem; + + tunKey->attr[0] = 0; + tunKey->attr[1] = 0; + tunKey->attr[2] = 0; + ASSERT(NlAttrType(attr) == OVS_KEY_ATTR_TUNNEL); + + NL_ATTR_FOR_EACH_UNSAFE (a, rem, NlAttrData(attr), + NlAttrGetSize(attr)) { + switch (NlAttrType(a)) { + case OVS_TUNNEL_KEY_ATTR_ID: + tunKey->tunnelId = NlAttrGetBe64(a); + tunKey->flags |= OVS_TNL_F_KEY; + break; + case OVS_TUNNEL_KEY_ATTR_IPV4_SRC: + tunKey->src = NlAttrGetBe32(a); + break; + case OVS_TUNNEL_KEY_ATTR_IPV4_DST: + tunKey->dst = NlAttrGetBe32(a); + break; + case OVS_TUNNEL_KEY_ATTR_TOS: + tunKey->tos = NlAttrGetU8(a); + break; + case OVS_TUNNEL_KEY_ATTR_TTL: + tunKey->ttl = NlAttrGetU8(a); + break; + case OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT: + tunKey->flags |= OVS_TNL_F_DONT_FRAGMENT; + break; + case OVS_TUNNEL_KEY_ATTR_CSUM: + tunKey->flags |= OVS_TNL_F_CSUM; + break; + default: + ASSERT(0); + } + } + + return NDIS_STATUS_SUCCESS; +} + +/* + *---------------------------------------------------------------------------- + * OvsUpdateEthHeader -- + * Updates the ethernet header in ovsFwdCtx.curNbl inline based on the + * specified key. + *---------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsUpdateEthHeader(OvsForwardingContext *ovsFwdCtx, + const struct ovs_key_ethernet *ethAttr) +{ + PNET_BUFFER curNb; + PMDL curMdl; + PUINT8 bufferStart; + EthHdr *ethHdr; + UINT32 packetLen, mdlLen; + + curNb = NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl); + ASSERT(curNb->Next == NULL); + packetLen = NET_BUFFER_DATA_LENGTH(curNb); + curMdl = NET_BUFFER_CURRENT_MDL(curNb); + NdisQueryMdl(curMdl, &bufferStart, &mdlLen, LowPagePriority); + if (!bufferStart) { + ovsActionStats.noResource++; + return NDIS_STATUS_RESOURCES; + } + mdlLen -= NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + ASSERT(mdlLen > 0); + /* Bail out if the L2 header is not in a contiguous buffer. */ + if (MIN(packetLen, mdlLen) < sizeof *ethHdr) { + ASSERT(FALSE); + return NDIS_STATUS_FAILURE; + } + ethHdr = (EthHdr *)(bufferStart + NET_BUFFER_CURRENT_MDL_OFFSET(curNb)); + + RtlCopyMemory(ethHdr->Destination, ethAttr->eth_dst, + sizeof ethHdr->Destination); + RtlCopyMemory(ethHdr->Source, ethAttr->eth_src, sizeof ethHdr->Source); + + return NDIS_STATUS_SUCCESS; +} + +/* + *---------------------------------------------------------------------------- + * OvsUpdateIPv4Header -- + * Updates the IPv4 header in ovsFwdCtx.curNbl inline based on the + * specified key. + *---------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsUpdateIPv4Header(OvsForwardingContext *ovsFwdCtx, + const struct ovs_key_ipv4 *ipAttr) +{ + PNET_BUFFER curNb; + PMDL curMdl; + ULONG curMdlOffset; + PUINT8 bufferStart; + UINT32 mdlLen, hdrSize, packetLen; + OVS_PACKET_HDR_INFO *layers = &ovsFwdCtx->layers; + NDIS_STATUS status; + IPHdr *ipHdr; + TCPHdr *tcpHdr = NULL; + UDPHdr *udpHdr = NULL; + + ASSERT(layers->value != 0); + + /* + * Peek into the MDL to get a handle to the IP header and if required + * the TCP/UDP header as well. We check if the required headers are in one + * contiguous MDL, and if not, we copy them over to one MDL. + */ + curNb = NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl); + ASSERT(curNb->Next == NULL); + packetLen = NET_BUFFER_DATA_LENGTH(curNb); + curMdl = NET_BUFFER_CURRENT_MDL(curNb); + NdisQueryMdl(curMdl, &bufferStart, &mdlLen, LowPagePriority); + if (!bufferStart) { + ovsActionStats.noResource++; + return NDIS_STATUS_RESOURCES; + } + curMdlOffset = NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + mdlLen -= curMdlOffset; + ASSERT((INT)mdlLen >= 0); + + if (layers->isTcp || layers->isUdp) { + hdrSize = layers->l4Offset + + layers->isTcp ? sizeof (*tcpHdr) : sizeof (*udpHdr); + } else { + hdrSize = layers->l3Offset + sizeof (*ipHdr); + } + + /* Count of number of bytes of valid data there are in the first MDL. */ + mdlLen = MIN(packetLen, mdlLen); + if (mdlLen < hdrSize) { + PNET_BUFFER_LIST newNbl; + newNbl = OvsPartialCopyNBL(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, + hdrSize, 0, TRUE /*copy NBL info*/); + if (!newNbl) { + ovsActionStats.noCopiedNbl++; + return NDIS_STATUS_RESOURCES; + } + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"Complete after partial copy."); + + status = OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, + newNbl, ovsFwdCtx->srcVportNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), + NULL, &ovsFwdCtx->layers, FALSE); + if (status != NDIS_STATUS_SUCCESS) { + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"OVS-Dropped due to resources"); + return NDIS_STATUS_RESOURCES; + } + + curNb = NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl); + ASSERT(curNb->Next == NULL); + curMdl = NET_BUFFER_CURRENT_MDL(curNb); + NdisQueryMdl(curMdl, &bufferStart, &mdlLen, LowPagePriority); + if (!curMdl) { + ovsActionStats.noResource++; + return NDIS_STATUS_RESOURCES; + } + curMdlOffset = NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + mdlLen -= curMdlOffset; + ASSERT(mdlLen >= hdrSize); + } + + ipHdr = (IPHdr *)(bufferStart + curMdlOffset + layers->l3Offset); + + if (layers->isTcp) { + tcpHdr = (TCPHdr *)(bufferStart + curMdlOffset + layers->l4Offset); + } else if (layers->isUdp) { + udpHdr = (UDPHdr *)(bufferStart + curMdlOffset + layers->l4Offset); + } + + /* + * Adjust the IP header inline as dictated by the action, nad also update + * the IP and the TCP checksum for the data modified. + * + * In the future, this could be optimized to make one call to + * ChecksumUpdate32(). Ignoring this for now, since for the most common + * case, we only update the TTL. + */ + if (ipHdr->saddr != ipAttr->ipv4_src) { + if (tcpHdr) { + tcpHdr->check = ChecksumUpdate32(tcpHdr->check, ipHdr->saddr, + ipAttr->ipv4_src); + } else if (udpHdr && udpHdr->check) { + udpHdr->check = ChecksumUpdate32(udpHdr->check, ipHdr->saddr, + ipAttr->ipv4_src); + } + + if (ipHdr->check != 0) { + ipHdr->check = ChecksumUpdate32(ipHdr->check, ipHdr->saddr, + ipAttr->ipv4_src); + } + ipHdr->saddr = ipAttr->ipv4_src; + } + if (ipHdr->daddr != ipAttr->ipv4_dst) { + if (tcpHdr) { + tcpHdr->check = ChecksumUpdate32(tcpHdr->check, ipHdr->daddr, + ipAttr->ipv4_dst); + } else if (udpHdr && udpHdr->check) { + udpHdr->check = ChecksumUpdate32(udpHdr->check, ipHdr->daddr, + ipAttr->ipv4_dst); + } + + if (ipHdr->check != 0) { + ipHdr->check = ChecksumUpdate32(ipHdr->check, ipHdr->daddr, + ipAttr->ipv4_dst); + } + ipHdr->daddr = ipAttr->ipv4_dst; + } + if (ipHdr->protocol != ipAttr->ipv4_proto) { + UINT16 oldProto = (ipHdr->protocol << 16) & 0xff00; + UINT16 newProto = (ipAttr->ipv4_proto << 16) & 0xff00; + if (tcpHdr) { + tcpHdr->check = ChecksumUpdate16(tcpHdr->check, oldProto, newProto); + } else if (udpHdr && udpHdr->check) { + udpHdr->check = ChecksumUpdate16(udpHdr->check, oldProto, newProto); + } + + if (ipHdr->check != 0) { + ipHdr->check = ChecksumUpdate16(ipHdr->check, oldProto, newProto); + } + ipHdr->protocol = ipAttr->ipv4_proto; + } + if (ipHdr->ttl != ipAttr->ipv4_ttl) { + UINT16 oldTtl = (ipHdr->ttl) & 0xff; + UINT16 newTtl = (ipAttr->ipv4_ttl) & 0xff; + if (ipHdr->check != 0) { + ipHdr->check = ChecksumUpdate16(ipHdr->check, oldTtl, newTtl); + } + ipHdr->ttl = ipAttr->ipv4_ttl; + } + + return NDIS_STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * OvsExecuteSetAction -- + * Executes a set() action, but storing the actions into 'ovsFwdCtx' + * -------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsExecuteSetAction(OvsForwardingContext *ovsFwdCtx, + OvsFlowKey *key, + UINT64 *hash, + const PNL_ATTR a) +{ + enum ovs_key_attr type = NlAttrType(a); + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + + switch (type) { + case OVS_KEY_ATTR_ETHERNET: + status = OvsUpdateEthHeader(ovsFwdCtx, + NlAttrGetUnspec(a, sizeof(struct ovs_key_ethernet))); + break; + + case OVS_KEY_ATTR_IPV4: + status = OvsUpdateIPv4Header(ovsFwdCtx, + NlAttrGetUnspec(a, sizeof(struct ovs_key_ipv4))); + break; + + case OVS_KEY_ATTR_TUNNEL: + { + OvsIPv4TunnelKey tunKey; + status = OvsTunnelAttrToIPv4TunnelKey((PNL_ATTR)a, &tunKey); + ASSERT(status == NDIS_STATUS_SUCCESS); + tunKey.flow_hash = (uint16)(hash ? *hash : OvsHashFlow(key)); + tunKey.dst_port = key->ipKey.l4.tpDst; + RtlCopyMemory(&ovsFwdCtx->tunKey, &tunKey, sizeof ovsFwdCtx->tunKey); + break; + } + case OVS_KEY_ATTR_SKB_MARK: + /* XXX: Not relevant to Hyper-V. Return OK */ + break; + case OVS_KEY_ATTR_UNSPEC: + case OVS_KEY_ATTR_ENCAP: + case OVS_KEY_ATTR_ETHERTYPE: + case OVS_KEY_ATTR_IN_PORT: + case OVS_KEY_ATTR_VLAN: + case OVS_KEY_ATTR_ICMP: + case OVS_KEY_ATTR_ICMPV6: + case OVS_KEY_ATTR_ARP: + case OVS_KEY_ATTR_ND: + case __OVS_KEY_ATTR_MAX: + default: + OVS_LOG_INFO("Unhandled attribute %#x", type); + ASSERT(FALSE); + } + return status; +} + +/* + * -------------------------------------------------------------------------- + * OvsActionsExecute -- + * Interpret and execute the specified 'actions' on the specifed packet + * 'curNbl'. The expectation is that if the packet needs to be dropped + * (completed) for some reason, it is added to 'completionList' so that the + * caller can complete the packet. If 'completionList' is NULL, the NBL is + * assumed to be generated by OVS and freed up. Otherwise, the function + * consumes the NBL by generating a NDIS send indication for the packet. + * + * There are one or more of "clone" NBLs that may get generated while + * executing the actions. Upon any failures, the "cloned" NBLs are freed up, + * and the caller does not have to worry about them. + * + * Success or failure is returned based on whether the specified actions + * were executed successfully on the packet or not. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsActionsExecute(POVS_SWITCH_CONTEXT switchContext, + OvsCompletionList *completionList, + PNET_BUFFER_LIST curNbl, + UINT32 portNo, + ULONG sendFlags, + OvsFlowKey *key, + UINT64 *hash, + OVS_PACKET_HDR_INFO *layers, + const PNL_ATTR actions, + INT actionsLen) +{ + PNL_ATTR a; + INT rem; + UINT32 dstPortID; + OvsForwardingContext ovsFwdCtx; + PCWSTR dropReason = L""; + NDIS_STATUS status; + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO fwdDetail = + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(curNbl); + + /* XXX: ASSERT that the flow table lock is held. */ + status = OvsInitForwardingCtx(&ovsFwdCtx, switchContext, curNbl, portNo, + sendFlags, fwdDetail, completionList, + layers, TRUE); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"OVS-initing destination port list failed"; + goto dropit; + } + + if (actionsLen == 0) { + dropReason = L"OVS-Dropped due to Flow action"; + ovsActionStats.zeroActionLen++; + goto dropit; + } + + NL_ATTR_FOR_EACH_UNSAFE (a, rem, actions, actionsLen) { + switch(NlAttrType(a)) { + case OVS_ACTION_ATTR_OUTPUT: + dstPortID = NlAttrGetU32(a); + status = OvsAddPorts(&ovsFwdCtx, key, dstPortID, + TRUE, TRUE); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"OVS-adding destination port failed"; + goto dropit; + } + break; + + case OVS_ACTION_ATTR_PUSH_VLAN: + { + struct ovs_action_push_vlan *vlan; + PVOID vlanTagValue; + PNDIS_NET_BUFFER_LIST_8021Q_INFO vlanTag; + + if (ovsFwdCtx.destPortsSizeOut > 0 || ovsFwdCtx.tunnelTxNic != NULL + || ovsFwdCtx.tunnelRxNic != NULL) { + status = OvsOutputBeforeSetAction(&ovsFwdCtx); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"OVS-adding destination failed"; + goto dropit; + } + } + + vlanTagValue = NET_BUFFER_LIST_INFO(ovsFwdCtx.curNbl, + Ieee8021QNetBufferListInfo); + if (vlanTagValue != NULL) { + /* + * XXX: We don't support double VLAN tag offload. In such cases, + * we need to insert the existing one into the packet buffer, + * and add the new one as offload. This will take care of + * guest tag-in-tag case as well as OVS rules that specify + * tag-in-tag. + */ + } else { + vlanTagValue = 0; + vlanTag = (PNDIS_NET_BUFFER_LIST_8021Q_INFO)(PVOID *)&vlanTagValue; + vlan = (struct ovs_action_push_vlan *)NlAttrGet((const PNL_ATTR)a); + vlanTag->TagHeader.VlanId = ntohs(vlan->vlan_tci) & 0xfff; + vlanTag->TagHeader.UserPriority = ntohs(vlan->vlan_tci) >> 13; + + NET_BUFFER_LIST_INFO(ovsFwdCtx.curNbl, + Ieee8021QNetBufferListInfo) = vlanTagValue; + } + break; + } + + case OVS_ACTION_ATTR_POP_VLAN: + { + if (ovsFwdCtx.destPortsSizeOut > 0 || ovsFwdCtx.tunnelTxNic != NULL + || ovsFwdCtx.tunnelRxNic != NULL) { + status = OvsOutputBeforeSetAction(&ovsFwdCtx); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"OVS-adding destination failed"; + goto dropit; + } + } + + if (NET_BUFFER_LIST_INFO(ovsFwdCtx.curNbl, + Ieee8021QNetBufferListInfo) != 0) { + NET_BUFFER_LIST_INFO(ovsFwdCtx.curNbl, + Ieee8021QNetBufferListInfo) = 0; + } else { + /* + * The VLAN tag is inserted into the packet buffer. Pop the tag + * by packet buffer modification. + */ + status = OvsPopVlanInPktBuf(&ovsFwdCtx); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"OVS-pop vlan action failed"; + goto dropit; + } + } + break; + } + + case OVS_ACTION_ATTR_USERSPACE: + { + PNL_ATTR userdataAttr; + PNL_ATTR queueAttr; + POVS_PACKET_QUEUE_ELEM elem; + BOOLEAN isRecv = FALSE; + + POVS_VPORT_ENTRY vport = OvsFindVportByPortNo(switchContext, + portNo); + + if (vport) { + if (vport->isExternal || + OvsIsTunnelVportType(vport->ovsType)) { + isRecv = TRUE; + } + } + + queueAttr = NlAttrFindNested(a, OVS_USERSPACE_ATTR_PID); + userdataAttr = NlAttrFindNested(a, OVS_USERSPACE_ATTR_USERDATA); + + elem = OvsCreateQueueNlPacket((PVOID)userdataAttr, + userdataAttr->nlaLen, + OVS_PACKET_CMD_ACTION, + portNo, key,ovsFwdCtx.curNbl, + NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx.curNbl), + isRecv, + layers); + if (elem) { + LIST_ENTRY missedPackets; + InitializeListHead(&missedPackets); + InsertTailList(&missedPackets, &elem->link); + OvsQueuePackets(&missedPackets, 1); + dropReason = L"OVS-Completed since packet was copied to " + L"userspace"; + } else { + dropReason = L"OVS-Dropped due to failure to queue to " + L"userspace"; + goto dropit; + } + break; + } + case OVS_ACTION_ATTR_SET: + { + if (ovsFwdCtx.destPortsSizeOut > 0 || ovsFwdCtx.tunnelTxNic != NULL + || ovsFwdCtx.tunnelRxNic != NULL) { + status = OvsOutputBeforeSetAction(&ovsFwdCtx); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"OVS-adding destination failed"; + goto dropit; + } + } + + status = OvsExecuteSetAction(&ovsFwdCtx, key, hash, + (const PNL_ATTR)NlAttrGet + ((const PNL_ATTR)a)); + if (status != NDIS_STATUS_SUCCESS) { + dropReason = L"OVS-set action failed"; + goto dropit; + } + break; + } + case OVS_ACTION_ATTR_SAMPLE: + default: + status = NDIS_STATUS_NOT_SUPPORTED; + break; + } + } + + if (ovsFwdCtx.destPortsSizeOut > 0 || ovsFwdCtx.tunnelTxNic != NULL + || ovsFwdCtx.tunnelRxNic != NULL) { + status = OvsOutputForwardingCtx(&ovsFwdCtx); + ASSERT(ovsFwdCtx.curNbl == NULL); + } + + ASSERT(ovsFwdCtx.destPortsSizeOut == 0); + ASSERT(ovsFwdCtx.tunnelRxNic == NULL); + ASSERT(ovsFwdCtx.tunnelTxNic == NULL); + +dropit: + /* + * If curNbl != NULL, it implies the NBL has not been not freed up so far. + */ + if (ovsFwdCtx.curNbl) { + OvsCompleteNBLForwardingCtx(&ovsFwdCtx, dropReason); + } + + return status; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Atomic.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Atomic.h --- openvswitch-2.3.1/datapath-windows/ovsext/Atomic.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Atomic.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __ATOMIC_H_ +#define __ATOMIC_H_ 1 + +static __inline UINT64 +atomic_add64(UINT64 *ptr, UINT32 val) +{ + return InterlockedAdd64((LONGLONG volatile *) ptr, (LONGLONG) val); +} + +static __inline UINT64 +atomic_inc64(UINT64 *ptr) +{ + return InterlockedIncrement64((LONGLONG volatile *) ptr); +} + +#endif /* __ATOMIC_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/BufferMgmt.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/BufferMgmt.c --- openvswitch-2.3.1/datapath-windows/ovsext/BufferMgmt.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/BufferMgmt.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1535 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * **************************************************************************** + * + * Simple Buffer Management framework for OVS + * + * It introduces four NDIS buffer pools + * **Fix size net buffer list pool--this is used for small buffer + * One allocation will include NBL + NB + MDL + Data + CONTEXT. + * + * **Variable size net buffer list pool--this is used for variable size + * buffer. The allocation of net buffer list will include NBL + NB + + * CONTEXT, a separate allocation of MDL + data buffer is required. + * + * **NBL only net buffer list pool-- this is used for partial copy + * (or clone). In this case we can not allocate net buffer list and + * net buffer at the same time. + * + * **Net buffer pool-- this is required when net buffer need to be + * allocated separately. + * + * A Buffer context is defined to track the buffer specific information + * so that during NBL completion, proper action can be taken. Please see + * code for details. + * + * Here is the usage of the management API + * All external NBL should be initialized its NBL context by calling + * OvsInitExternalNBLContext() + * + * After the external NBL context is initialized, it can call the following + * API to allocate, copy or partial copy NBL. + * + * OvsAllocateFixSizeNBL() + * OvsAllocateVariableSizeNBL() + * + * OvsPartialCopyNBL() + * OvsPartialCopyToMultipleNBLs() + * + * OvsFullCopyNBL() + * OvsFullCopyToMultipleNBLs() + * + * See code comments for detail description of the functions. + * + * All NBLs is completed through + * OvsCompleteNBL() + * If this API return non NULL value, then the returned NBL should be + * returned to upper layer by calling + * NdisFSendNetBufferListsComplete() if the buffer is from upper + * layer. In case of WFP, it can call the corresponding completion routine + * to return the NBL to the framework. + * + * NOTE: + * 1. Copy or partial copy will not copy destination port array + * 2. Copy or partial copy will copy src port id and index + * 3. New Allocated NBL will have src port set to default port id + * 4. If original packet has direction flag set, the copied or partial + * copied NBL will still be in same direction. + * 5. When you advance or retreate the buffer, you may need to update + * relevant meta data to keep it consistent. + * + * **************************************************************************** + */ + +#include "precomp.h" +#include "Switch.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_BUFMGMT +#include "Debug.h" +#include "NetProto.h" +#include "Flow.h" +#include "Checksum.h" +#include "PacketParser.h" + +/* + * -------------------------------------------------------------------------- + * OvsInitBufferPool -- + * + * Allocate NBL and NB pool + * + * XXX: more optimization may be done for buffer management include local cache + * of NBL, NB, data, context, MDL. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsInitBufferPool(PVOID ovsContext) +{ + POVS_NBL_POOL ovsPool; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + NET_BUFFER_LIST_POOL_PARAMETERS nblParam; + NET_BUFFER_POOL_PARAMETERS nbParam; + + C_ASSERT(MEMORY_ALLOCATION_ALIGNMENT >= 8); + + OVS_LOG_TRACE("Enter: context: %p", context); + + ovsPool = &context->ovsPool; + RtlZeroMemory(ovsPool, sizeof (OVS_NBL_POOL)); + ovsPool->ndisHandle = context->NdisFilterHandle; + ovsPool->ndisContext = context->NdisSwitchContext; + /* + * fix size NBL pool includes + * NBL + NB + MDL + DATA + Context + * This is mainly used for Packet execute or slow path when copy is + * required and size is less than OVS_DEFAULT_DATA_SIZE. We expect + * Most of packet from user space will use this Pool. (This is + * true for all bfd and cfm packet. + */ + RtlZeroMemory(&nblParam, sizeof (nblParam)); + OVS_INIT_OBJECT_HEADER(&nblParam.Header, + NDIS_OBJECT_TYPE_DEFAULT, + NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1, + NDIS_SIZEOF_NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1); + nblParam.ContextSize = OVS_DEFAULT_NBL_CONTEXT_SIZE; + nblParam.PoolTag = OVS_FIX_SIZE_NBL_POOL_TAG; + nblParam.fAllocateNetBuffer = TRUE; + nblParam.DataSize = OVS_DEFAULT_DATA_SIZE + OVS_DEFAULT_HEADROOM_SIZE; + + ovsPool->fixSizePool = + NdisAllocateNetBufferListPool(context->NdisSwitchContext, &nblParam); + if (ovsPool->fixSizePool == NULL) { + goto pool_cleanup; + } + + /* + * Zero Size NBL Pool includes + * NBL + NB + Context + * This is mainly for packet with large data Size, in this case MDL and + * Data will be allocate separately. + */ + RtlZeroMemory(&nblParam, sizeof (nblParam)); + OVS_INIT_OBJECT_HEADER(&nblParam.Header, + NDIS_OBJECT_TYPE_DEFAULT, + NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1, + NDIS_SIZEOF_NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1); + + nblParam.ContextSize = OVS_DEFAULT_NBL_CONTEXT_SIZE; + nblParam.PoolTag = OVS_VARIABLE_SIZE_NBL_POOL_TAG; + nblParam.fAllocateNetBuffer = TRUE; + nblParam.DataSize = 0; + + ovsPool->zeroSizePool = + NdisAllocateNetBufferListPool(context->NdisSwitchContext, &nblParam); + if (ovsPool->zeroSizePool == NULL) { + goto pool_cleanup; + } + + /* + * NBL only pool just includes + * NBL (+ context) + * This is mainly used for clone and partial copy + */ + RtlZeroMemory(&nblParam, sizeof (nblParam)); + OVS_INIT_OBJECT_HEADER(&nblParam.Header, + NDIS_OBJECT_TYPE_DEFAULT, + NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1, + NDIS_SIZEOF_NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1); + + nblParam.ContextSize = OVS_DEFAULT_NBL_CONTEXT_SIZE; + nblParam.PoolTag = OVS_NBL_ONLY_POOL_TAG; + nblParam.fAllocateNetBuffer = FALSE; + nblParam.DataSize = 0; + + ovsPool->nblOnlyPool = + NdisAllocateNetBufferListPool(context->NdisSwitchContext, &nblParam); + if (ovsPool->nblOnlyPool == NULL) { + goto pool_cleanup; + } + + /* nb Pool + * NB only pool, used for copy + */ + + OVS_INIT_OBJECT_HEADER(&nbParam.Header, + NDIS_OBJECT_TYPE_DEFAULT, + NET_BUFFER_POOL_PARAMETERS_REVISION_1, + NDIS_SIZEOF_NET_BUFFER_POOL_PARAMETERS_REVISION_1); + nbParam.PoolTag = OVS_NET_BUFFER_POOL_TAG; + nbParam.DataSize = 0; + ovsPool->nbPool = + NdisAllocateNetBufferPool(context->NdisSwitchContext, &nbParam); + if (ovsPool->nbPool == NULL) { + goto pool_cleanup; + } + OVS_LOG_TRACE("Exit: fixSizePool: %p zeroSizePool: %p nblOnlyPool: %p" + "nbPool: %p", ovsPool->fixSizePool, ovsPool->zeroSizePool, + ovsPool->nblOnlyPool, ovsPool->nbPool); + return NDIS_STATUS_SUCCESS; + +pool_cleanup: + OvsCleanupBufferPool(context); + OVS_LOG_TRACE("Exit: Fail to initialize ovs buffer pool"); + return NDIS_STATUS_RESOURCES; +} + + +/* + * -------------------------------------------------------------------------- + * OvsCleanupBufferPool -- + * Free Buffer pool for NBL and NB. + * -------------------------------------------------------------------------- + */ +VOID +OvsCleanupBufferPool(PVOID ovsContext) +{ + POVS_NBL_POOL ovsPool; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + ovsPool = &context->ovsPool; + OVS_LOG_TRACE("Enter: context: %p", context); +#ifdef DBG + ASSERT(ovsPool->fixNBLCount == 0); + ASSERT(ovsPool->zeroNBLCount == 0); + ASSERT(ovsPool->nblOnlyCount == 0); + ASSERT(ovsPool->nbCount == 0); + ASSERT(ovsPool->sysNBLCount == 0); + ASSERT(ovsPool->fragNBLCount == 0); +#endif + + if (ovsPool->fixSizePool) { + NdisFreeNetBufferListPool(ovsPool->fixSizePool); + ovsPool->fixSizePool = NULL; + } + if (ovsPool->zeroSizePool) { + NdisFreeNetBufferListPool(ovsPool->zeroSizePool); + ovsPool->zeroSizePool = NULL; + } + if (ovsPool->nblOnlyPool) { + NdisFreeNetBufferListPool(ovsPool->nblOnlyPool); + ovsPool->nblOnlyPool = NULL; + } + if (ovsPool->nbPool) { + NdisFreeNetBufferPool(ovsPool->nbPool); + ovsPool->nbPool = NULL; + } + OVS_LOG_TRACE("Exit: cleanup OVS Buffer pool"); +} + + +static VOID +OvsInitNBLContext(POVS_BUFFER_CONTEXT ctx, + UINT16 flags, + UINT32 origDataLength, + UINT32 srcPortNo) +{ + ctx->magic = OVS_CTX_MAGIC; + ctx->refCount = 1; + ctx->flags = flags; + ctx->srcPortNo = srcPortNo; + ctx->origDataLength = origDataLength; +} + + +static VOID +OvsDumpForwardingDetails(PNET_BUFFER_LIST nbl) +{ + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO info; + info = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(nbl); + if (info == NULL) { + return; + } + OVS_LOG_INFO("nbl: %p, numAvailableDest: %d, srcId:%d, srcIndex: %d " + "isDataSafe: %s, safeDataSize: %d", + nbl, info->NumAvailableDestinations, info->SourcePortId, + info->SourceNicIndex, + info->IsPacketDataSafe ? "TRUE" : "FALSE", + info->IsPacketDataSafe ? 0 : info->SafePacketDataSize); + +} + +static VOID +OvsDumpNBLContext(PNET_BUFFER_LIST nbl) +{ + PNET_BUFFER_LIST_CONTEXT ctx = nbl->Context; + if (ctx == NULL) { + OVS_LOG_INFO("No Net Buffer List context"); + return; + } + while (ctx) { + OVS_LOG_INFO("nbl: %p, ctx: %p, TotalSize: %d, Offset: %d", + nbl, ctx, ctx->Size, ctx->Offset); + ctx = ctx->Next; + } +} + + +static VOID +OvsDumpMDLChain(PMDL mdl) +{ + PMDL tmp; + tmp = mdl; + while (tmp) { + OVS_LOG_INFO("MDL: %p, Size: %d, MappedSystemVa: %p, StartVa: %p" + " ByteCount: %d, ByteOffset: %d", + tmp, tmp->Size, tmp->MappedSystemVa, + tmp->StartVa, tmp->ByteCount, tmp->ByteOffset); + tmp = tmp->Next; + } +} + + +static VOID +OvsDumpNetBuffer(PNET_BUFFER nb) +{ + OVS_LOG_INFO("NET_BUFFER: %p, ChecksumBias: %d Handle: %p, MDLChain: %p " + "CurrMDL: %p, CurrOffset: %d, DataLen: %d, Offset: %d", + nb, + NET_BUFFER_CHECKSUM_BIAS(nb), nb->NdisPoolHandle, + NET_BUFFER_FIRST_MDL(nb), + NET_BUFFER_CURRENT_MDL(nb), + NET_BUFFER_CURRENT_MDL_OFFSET(nb), + NET_BUFFER_DATA_LENGTH(nb), + NET_BUFFER_DATA_OFFSET(nb)); + OvsDumpMDLChain(NET_BUFFER_FIRST_MDL(nb)); +} + + +static VOID +OvsDumpNetBufferList(PNET_BUFFER_LIST nbl) +{ + PNET_BUFFER nb; + OVS_LOG_INFO("NBL: %p, parent: %p, SrcHandle: %p, ChildCount:%d " + "poolHandle: %p", + nbl, nbl->ParentNetBufferList, + nbl->SourceHandle, nbl->ChildRefCount, + nbl->NdisPoolHandle); + OvsDumpNBLContext(nbl); + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + while (nb) { + OvsDumpNetBuffer(nb); + nb = NET_BUFFER_NEXT_NB(nb); + } +} + +/* + * -------------------------------------------------------------------------- + * OvsAllocateFixSizeNBL -- + * + * Allocate fix size NBL which include + * NBL + NB + MBL + Data + Context + * Please note: + * * Forwarding Context is allocated, but forwarding detail information + * is not initailized. + * * The headroom can not be larger than OVS_DEFAULT_HEADROOM_SIZE(128 + * byte). + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsAllocateFixSizeNBL(PVOID ovsContext, + UINT32 size, + UINT32 headRoom) +{ + PNET_BUFFER_LIST nbl = NULL; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + POVS_BUFFER_CONTEXT ctx; + POVS_NBL_POOL ovsPool = &context->ovsPool; + NDIS_STATUS status; + UINT32 line; + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO info; + + if ((headRoom + size) > OVS_FIX_NBL_DATA_SIZE || size == 0) { + line = __LINE__; + goto allocate_done; + } + + nbl = NdisAllocateNetBufferList(ovsPool->fixSizePool, + (UINT16)sizeof (OVS_BUFFER_CONTEXT), + (UINT16)OVS_DEFAULT_NBL_CONTEXT_FILL); + + if (nbl == NULL) { + line = __LINE__; + goto allocate_done; + } + + nbl->SourceHandle = ovsPool->ndisHandle; + status = context->NdisSwitchHandlers. + AllocateNetBufferListForwardingContext(ovsPool->ndisContext, nbl); + + if (status != NDIS_STATUS_SUCCESS) { + NdisFreeNetBufferList(nbl); + nbl = NULL; + line = __LINE__; + goto allocate_done; + } + info = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(nbl); + ASSERT(info); + info->IsPacketDataSafe = TRUE; + info->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID; + + status = NdisRetreatNetBufferDataStart(NET_BUFFER_LIST_FIRST_NB(nbl), + size, 0, NULL); + ASSERT(status == NDIS_STATUS_SUCCESS); + +#ifdef DBG + InterlockedIncrement((LONG volatile *)&ovsPool->fixNBLCount); + OvsDumpNetBufferList(nbl); + OvsDumpForwardingDetails(nbl); +#endif + + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + ASSERT(ctx); + + OvsInitNBLContext(ctx, OVS_BUFFER_FROM_FIX_SIZE_POOL | + OVS_BUFFER_PRIVATE_FORWARD_CONTEXT, size, + OVS_DEFAULT_PORT_NO); + line = __LINE__; +allocate_done: + OVS_LOG_LOUD("Allocate Fix NBL: %p, line: %d", nbl, line); + return nbl; +} + + +static PMDL +OvsAllocateMDLAndData(NDIS_HANDLE ndisHandle, + UINT32 dataSize) +{ + PMDL mdl; + PVOID data; + + data = OvsAllocateMemoryWithTag(dataSize, OVS_MDL_POOL_TAG); + if (data == NULL) { + return NULL; + } + + mdl = NdisAllocateMdl(ndisHandle, data, dataSize); + if (mdl == NULL) { + OvsFreeMemoryWithTag(data, OVS_MDL_POOL_TAG); + } + + return mdl; +} + + +static VOID +OvsFreeMDLAndData(PMDL mdl) +{ + PVOID data; + + data = MmGetMdlVirtualAddress(mdl); + NdisFreeMdl(mdl); + OvsFreeMemoryWithTag(data, OVS_MDL_POOL_TAG); +} + + +/* + * -------------------------------------------------------------------------- + * OvsAllocateVariableSizeNBL -- + * + * Allocate variable size NBL, the NBL looks like + * NBL + NB + Context + * MDL + Data + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsAllocateVariableSizeNBL(PVOID ovsContext, + UINT32 size, + UINT32 headRoom) +{ + PNET_BUFFER_LIST nbl = NULL; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + POVS_NBL_POOL ovsPool = &context->ovsPool; + POVS_BUFFER_CONTEXT ctx; + UINT32 realSize; + PMDL mdl; + NDIS_STATUS status; + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO info; + if (size == 0) { + return NULL; + } + realSize = MEM_ALIGN_SIZE(size + headRoom); + + mdl = OvsAllocateMDLAndData(ovsPool->ndisHandle, realSize); + if (mdl == NULL) { + return NULL; + } + + nbl = NdisAllocateNetBufferAndNetBufferList(ovsPool->zeroSizePool, + (UINT16)sizeof (OVS_BUFFER_CONTEXT), + (UINT16)OVS_DEFAULT_NBL_CONTEXT_FILL, + mdl, realSize, 0); + if (nbl == NULL) { + OvsFreeMDLAndData(mdl); + return NULL; + } + + nbl->SourceHandle = ovsPool->ndisHandle; + status = context->NdisSwitchHandlers. + AllocateNetBufferListForwardingContext(ovsPool->ndisContext, nbl); + + if (status != NDIS_STATUS_SUCCESS) { + /* + * do we need to remove mdl from nbl XXX + */ + OvsFreeMDLAndData(mdl); + NdisFreeNetBufferList(nbl); + return NULL; + } + + info = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(nbl); + ASSERT(info); + info->IsPacketDataSafe = TRUE; + info->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID; + status = NdisRetreatNetBufferDataStart(NET_BUFFER_LIST_FIRST_NB(nbl), + size, 0, NULL); + ASSERT(status == NDIS_STATUS_SUCCESS); + +#ifdef DBG + InterlockedIncrement((LONG volatile *)&ovsPool->zeroNBLCount); + OvsDumpNetBufferList(nbl); + OvsDumpForwardingDetails(nbl); +#endif + + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + + OvsInitNBLContext(ctx, OVS_BUFFER_PRIVATE_MDL | OVS_BUFFER_PRIVATE_DATA | + OVS_BUFFER_PRIVATE_FORWARD_CONTEXT | + OVS_BUFFER_FROM_ZERO_SIZE_POOL, + size, OVS_DEFAULT_PORT_NO); + + OVS_LOG_LOUD("Allocate variable size NBL: %p", nbl); + return nbl; +} + + +/* + * -------------------------------------------------------------------------- + * OvsInitExternalNBLContext -- + * + * For NBL not allocated by OVS, it will allocate and initialize + * the NBL context. + * -------------------------------------------------------------------------- + */ +POVS_BUFFER_CONTEXT +OvsInitExternalNBLContext(PVOID ovsContext, + PNET_BUFFER_LIST nbl, + BOOLEAN isRecv) +{ + NDIS_HANDLE poolHandle; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + POVS_BUFFER_CONTEXT ctx; + PNET_BUFFER nb; + NDIS_STATUS status; + UINT16 flags; + + poolHandle = NdisGetPoolFromNetBufferList(nbl); + + if (poolHandle == context->ovsPool.ndisHandle) { + return (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + } + status = NdisAllocateNetBufferListContext(nbl, sizeof (OVS_BUFFER_CONTEXT), + OVS_DEFAULT_NBL_CONTEXT_FILL, + OVS_OTHER_POOL_TAG); + if (status != NDIS_STATUS_SUCCESS) { + return NULL; + } +#ifdef DBG + OvsDumpNBLContext(nbl); + InterlockedIncrement((LONG volatile *)&context->ovsPool.sysNBLCount); +#endif + flags = isRecv ? OVS_BUFFER_RECV_BUFFER : OVS_BUFFER_SEND_BUFFER; + flags |= OVS_BUFFER_NEED_COMPLETE | OVS_BUFFER_PRIVATE_CONTEXT; + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + /* + * we use first nb to decide whether we need advance or retreat during + * complete. + */ + OvsInitNBLContext(ctx, flags, NET_BUFFER_DATA_LENGTH(nb), OVS_DEFAULT_PORT_NO); + return ctx; +} + +/* + * -------------------------------------------------------------------------- + * OvsAllocateNBLContext + * + * Create NBL buffer context and forwarding context. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsAllocateNBLContext(POVS_SWITCH_CONTEXT context, + PNET_BUFFER_LIST nbl) +{ + POVS_NBL_POOL ovsPool = &context->ovsPool; + NDIS_STATUS status; + + status = NdisAllocateNetBufferListContext(nbl, + sizeof (OVS_BUFFER_CONTEXT), + OVS_DEFAULT_NBL_CONTEXT_FILL, + OVS_OTHER_POOL_TAG); + if (status != NDIS_STATUS_SUCCESS) { + return NDIS_STATUS_FAILURE; + } + + nbl->SourceHandle = ovsPool->ndisHandle; + status = context->NdisSwitchHandlers. + AllocateNetBufferListForwardingContext(ovsPool->ndisContext, nbl); + + if (status != NDIS_STATUS_SUCCESS) { + NdisFreeNetBufferListContext(nbl, sizeof (OVS_BUFFER_CONTEXT)); + return NDIS_STATUS_FAILURE; + } + return status; +} + +/* + * -------------------------------------------------------------------------- + * OvsFreeNBLContext + * + * Free the NBL buffer context and forwarding context. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsFreeNBLContext(POVS_SWITCH_CONTEXT context, + PNET_BUFFER_LIST nbl) +{ + POVS_NBL_POOL ovsPool = &context->ovsPool; + + context->NdisSwitchHandlers. + FreeNetBufferListForwardingContext(ovsPool->ndisContext, nbl); + NdisFreeNetBufferListContext(nbl, sizeof (OVS_BUFFER_CONTEXT)); + + return NDIS_STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * OvsCopyNBLInfo + * + * Copy NBL info from src to dst + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsCopyNBLInfo(PNET_BUFFER_LIST srcNbl, PNET_BUFFER_LIST dstNbl, + POVS_BUFFER_CONTEXT srcCtx, UINT32 copySize, + BOOLEAN copyNblInfo) +{ + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO srcInfo, dstInfo; + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + + srcInfo = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(srcNbl); + dstInfo = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(dstNbl); + if (srcInfo) { +#ifdef OVS_USE_COPY_NET_BUFFER_LIST_INFO + status = context->NdisSwitchHandlers. + CopyNetBufferListInfo(ovsPool->ndisContext, dstNbl, srcNbl, 0); + + if (status != NDIS_STATUS_SUCCESS) { + return status; + } +#else + dstInfo->SourcePortId = srcInfo->SourcePortId; + dstInfo->SourceNicIndex = srcInfo->SourceNicIndex; + if (copyNblInfo) { + if (srcCtx->flags & OVS_BUFFER_RECV_BUFFER) { + NdisCopyReceiveNetBufferListInfo(dstNbl, srcNbl); + } else if (srcCtx->flags & OVS_BUFFER_SEND_BUFFER) { + NdisCopySendNetBufferListInfo(dstNbl, srcNbl); + } + } +#endif + dstInfo->IsPacketDataSafe = srcInfo->IsPacketDataSafe; + if (!srcInfo->IsPacketDataSafe && copySize > + srcInfo->SafePacketDataSize) { + srcInfo->SafePacketDataSize = copySize; + } + } else { + /* + * Assume all data are safe + */ + dstInfo->IsPacketDataSafe = TRUE; + dstInfo->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID; + } + return status; +} + +/* + * -------------------------------------------------------------------------- + * OvsPartialCopyNBL -- + * + * Partial copy NBL, if there is multiple NB in NBL, each one will be + * copied. We also reserve headroom for the new NBL. + * + * Please note, + * NBL should have OVS_BUFFER_CONTEXT setup before calling + * this function. + * The NBL should already have ref to itself so that during copy + * it will not be freed. + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsPartialCopyNBL(PVOID ovsContext, + PNET_BUFFER_LIST nbl, + UINT32 copySize, + UINT32 headRoom, + BOOLEAN copyNblInfo) +{ + PNET_BUFFER_LIST newNbl; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + NDIS_STATUS status; + PNET_BUFFER srcNb, dstNb; + ULONG byteCopied; + POVS_NBL_POOL ovsPool = &context->ovsPool; + POVS_BUFFER_CONTEXT srcCtx, dstCtx; + UINT16 flags; + + srcCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + if (srcCtx == NULL || srcCtx->magic != OVS_CTX_MAGIC) { + OVS_LOG_INFO("src nbl must have ctx initialized"); + ASSERT(srcCtx && srcCtx->magic == OVS_CTX_MAGIC); + return NULL; + } + + if (copySize) { + NdisAdvanceNetBufferListDataStart(nbl, copySize, FALSE, NULL); + } + newNbl = NdisAllocateCloneNetBufferList(nbl, ovsPool->nblOnlyPool, + NULL, 0); + if (copySize) { + status = NdisRetreatNetBufferListDataStart(nbl, copySize, 0, + NULL, NULL); + ASSERT(status == NDIS_STATUS_SUCCESS); + } + + if (newNbl == NULL) { + return NULL; + } + + /* + * Allocate private memory for copy + */ + if (copySize + headRoom) { + status = NdisRetreatNetBufferListDataStart(newNbl, copySize + headRoom, + 0, NULL, NULL); + if (status != NDIS_STATUS_SUCCESS) { + goto retreat_error; + } + + if (headRoom) { + NdisAdvanceNetBufferListDataStart(newNbl, headRoom, FALSE, NULL); + } + if (copySize) { + srcNb = NET_BUFFER_LIST_FIRST_NB(nbl); + dstNb = NET_BUFFER_LIST_FIRST_NB(newNbl); + + while (srcNb) { + status = NdisCopyFromNetBufferToNetBuffer(dstNb, 0, copySize, + srcNb, 0, + &byteCopied); + if (status != NDIS_STATUS_SUCCESS || copySize != byteCopied) { + goto nbl_context_error; + } + srcNb = NET_BUFFER_NEXT_NB(srcNb); + dstNb = NET_BUFFER_NEXT_NB(dstNb); + } + } + } + + status = OvsAllocateNBLContext(context, newNbl); + if (status != NDIS_STATUS_SUCCESS) { + goto nbl_context_error; + } + + status = OvsCopyNBLInfo(nbl, newNbl, srcCtx, copySize, copyNblInfo); + if (status != NDIS_STATUS_SUCCESS) { + goto copy_list_info_error; + } + +#ifdef DBG + InterlockedIncrement((LONG volatile *)&ovsPool->nblOnlyCount); +#endif + + newNbl->ParentNetBufferList = nbl; + + dstCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(newNbl); + ASSERT(dstCtx != NULL); + + flags = srcCtx->flags & (OVS_BUFFER_RECV_BUFFER | OVS_BUFFER_SEND_BUFFER); + + flags |= OVS_BUFFER_FROM_NBL_ONLY_POOL | OVS_BUFFER_PRIVATE_CONTEXT | + OVS_BUFFER_PRIVATE_FORWARD_CONTEXT; + + srcNb = NET_BUFFER_LIST_FIRST_NB(nbl); + OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(srcNb) - copySize, + OVS_DEFAULT_PORT_NO); + + InterlockedIncrement((LONG volatile *)&srcCtx->refCount); +#ifdef DBG + OvsDumpNetBufferList(nbl); + OvsDumpForwardingDetails(nbl); + + OvsDumpNetBufferList(newNbl); + OvsDumpForwardingDetails(newNbl); +#endif + OVS_LOG_LOUD("Partial Copy new NBL: %p", newNbl); + return newNbl; + +copy_list_info_error: + OvsFreeNBLContext(context, newNbl); +nbl_context_error: + if (copySize) { + NdisAdvanceNetBufferListDataStart(newNbl, copySize, TRUE, NULL); + } +retreat_error: + NdisFreeCloneNetBufferList(newNbl, 0); + return NULL; +} + +/* + * -------------------------------------------------------------------------- + * OvsPartialCopyToMultipleNBLs -- + * + * This is similar to OvsPartialCopyNBL() except that each NB will + * have its own NBL. + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsPartialCopyToMultipleNBLs(PVOID ovsContext, + PNET_BUFFER_LIST nbl, + UINT32 copySize, + UINT32 headRoom, + BOOLEAN copyNblInfo) +{ + PNET_BUFFER nb, nextNb = NULL, firstNb, prevNb; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + PNET_BUFFER_LIST firstNbl = NULL, newNbl, prevNbl = NULL; + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + if (NET_BUFFER_NEXT_NB(nb) == NULL) { + return OvsPartialCopyNBL(context, nbl, copySize, headRoom, copyNblInfo); + } + + firstNb = nb; + prevNb = nb; + + while (nb) { + nextNb = NET_BUFFER_NEXT_NB(nb); + NET_BUFFER_NEXT_NB(nb) = NULL; + + NET_BUFFER_LIST_FIRST_NB(nbl) = nb; + + newNbl = OvsPartialCopyNBL(context, nbl, copySize, headRoom, + copyNblInfo); + if (newNbl == NULL) { + goto cleanup; + } + if (prevNbl == NULL) { + firstNbl = newNbl; + } else { + NET_BUFFER_LIST_NEXT_NBL(prevNbl) = newNbl; + NET_BUFFER_NEXT_NB(prevNb) = nb; + } + prevNbl = newNbl; + prevNb = nb; + nb = nextNb; + } + NET_BUFFER_LIST_FIRST_NB(nbl) = firstNb; + return firstNbl; + +cleanup: + NET_BUFFER_NEXT_NB(prevNb) = nb; + NET_BUFFER_NEXT_NB(nb) = nextNb; + NET_BUFFER_LIST_FIRST_NB(nbl) = firstNb; + + newNbl = firstNbl; + while (newNbl) { + firstNbl = NET_BUFFER_LIST_NEXT_NBL(newNbl); + NET_BUFFER_LIST_NEXT_NBL(firstNbl) = NULL; + OvsCompleteNBL(context, newNbl, TRUE); + newNbl = firstNbl; + } + return NULL; +} + + +static PNET_BUFFER_LIST +OvsCopySinglePacketNBL(PVOID ovsContext, + PNET_BUFFER_LIST nbl, + PNET_BUFFER nb, + UINT32 headRoom, + BOOLEAN copyNblInfo) +{ + UINT32 size; + ULONG copiedSize; + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + PNET_BUFFER_LIST newNbl; + PNET_BUFFER newNb; + NDIS_STATUS status; + POVS_BUFFER_CONTEXT srcCtx, dstCtx; + + size = NET_BUFFER_DATA_LENGTH(nb); + if ((size + headRoom) <= OVS_FIX_NBL_DATA_SIZE) { + newNbl = OvsAllocateFixSizeNBL(context, size, headRoom); + } else { + newNbl = OvsAllocateVariableSizeNBL(context, size, headRoom); + } + if (newNbl == NULL) { + return NULL; + } + newNb = NET_BUFFER_LIST_FIRST_NB(newNbl); + status = NdisCopyFromNetBufferToNetBuffer(newNb, 0, size, nb, 0, + &copiedSize); + + srcCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + if (status == NDIS_STATUS_SUCCESS) { + status = OvsCopyNBLInfo(nbl, newNbl, srcCtx, copiedSize, copyNblInfo); + } + + if (status != NDIS_STATUS_SUCCESS || copiedSize != size) { + OvsCompleteNBL(context, newNbl, TRUE); + return NULL; + } + + dstCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(newNbl); + ASSERT(dstCtx && srcCtx); + ASSERT(srcCtx->magic == OVS_CTX_MAGIC && dstCtx->magic == OVS_CTX_MAGIC); + + dstCtx->flags |= srcCtx->flags & (OVS_BUFFER_RECV_BUFFER | + OVS_BUFFER_SEND_BUFFER); +#ifdef DBG + OvsDumpNetBufferList(newNbl); + OvsDumpForwardingDetails(newNbl); +#endif + OVS_LOG_LOUD("Copy single nb to new NBL: %p", newNbl); + return newNbl; +} + +/* + * -------------------------------------------------------------------------- + * OvsFullCopyNBL -- + * + * Copy the NBL to a new NBL including data. + * + * Notes: + * The NBL can have multiple NBs, but the final result is one NBL. + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsFullCopyNBL(PVOID ovsContext, + PNET_BUFFER_LIST nbl, + UINT32 headRoom, + BOOLEAN copyNblInfo) +{ + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + POVS_NBL_POOL ovsPool = &context->ovsPool; + PNET_BUFFER_LIST newNbl; + PNET_BUFFER nb, newNb, firstNb = NULL, prevNb = NULL; + POVS_BUFFER_CONTEXT dstCtx, srcCtx; + PMDL mdl; + NDIS_STATUS status; + UINT32 size, totalSize; + ULONG copiedSize; + UINT16 flags; + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO dstInfo; + + srcCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + if (srcCtx == NULL || srcCtx->magic != OVS_CTX_MAGIC) { + OVS_LOG_INFO("src nbl must have ctx initialized"); + ASSERT(srcCtx && srcCtx->magic == OVS_CTX_MAGIC); + return NULL; + } + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + + if (NET_BUFFER_NEXT_NB(nb) == NULL) { + return OvsCopySinglePacketNBL(context, nbl, nb, headRoom, copyNblInfo); + } + + newNbl = NdisAllocateNetBufferList(ovsPool->nblOnlyPool, + (UINT16)sizeof (OVS_BUFFER_CONTEXT), + (UINT16)OVS_DEFAULT_NBL_CONTEXT_FILL); + if (newNbl == NULL) { + return NULL; + } + + while (nb) { + size = NET_BUFFER_DATA_LENGTH(nb); + totalSize = MEM_ALIGN_SIZE(size + headRoom); + mdl = OvsAllocateMDLAndData(ovsPool->ndisHandle, totalSize); + + if (mdl == NULL) { + goto nblcopy_error; + } + newNb = NdisAllocateNetBuffer(ovsPool->nbPool, mdl, totalSize, 0); + if (newNb == NULL) { + OvsFreeMDLAndData(mdl); + goto nblcopy_error; + } + if (firstNb == NULL) { + firstNb = newNb; + } else { + NET_BUFFER_NEXT_NB(prevNb) = newNb; + } + prevNb = newNb; +#ifdef DBG + InterlockedIncrement((LONG volatile *)&ovsPool->nbCount); +#endif + status = NdisRetreatNetBufferDataStart(newNb, size, 0, NULL); + ASSERT(status == NDIS_STATUS_SUCCESS); + + status = NdisCopyFromNetBufferToNetBuffer(newNb, 0, size, nb, 0, + &copiedSize); + if (status != NDIS_STATUS_SUCCESS || size != copiedSize) { + goto nblcopy_error; + } + + nb = NET_BUFFER_NEXT_NB(nb); + } + + NET_BUFFER_LIST_FIRST_NB(newNbl) = firstNb; + + newNbl->SourceHandle = ovsPool->ndisHandle; + status = context->NdisSwitchHandlers. + AllocateNetBufferListForwardingContext(ovsPool->ndisContext, newNbl); + + if (status != NDIS_STATUS_SUCCESS) { + goto nblcopy_error; + } + + status = OvsCopyNBLInfo(nbl, newNbl, srcCtx, 0, copyNblInfo); + if (status != NDIS_STATUS_SUCCESS) { + goto nblcopy_error; + } + + dstInfo = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl); + dstInfo->IsPacketDataSafe = TRUE; + + dstCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(newNbl); + + flags = srcCtx->flags & (OVS_BUFFER_RECV_BUFFER | OVS_BUFFER_SEND_BUFFER); + + flags |= OVS_BUFFER_PRIVATE_MDL | OVS_BUFFER_PRIVATE_DATA | + OVS_BUFFER_PRIVATE_NET_BUFFER | OVS_BUFFER_FROM_NBL_ONLY_POOL | + OVS_BUFFER_PRIVATE_FORWARD_CONTEXT; + + OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(firstNb), + OVS_DEFAULT_PORT_NO); + +#ifdef DBG + OvsDumpNetBufferList(nbl); + OvsDumpForwardingDetails(nbl); + InterlockedIncrement((LONG volatile *)&ovsPool->nblOnlyCount); +#endif + OVS_LOG_LOUD("newNbl: %p", newNbl); + return newNbl; + +nblcopy_error: + while (firstNb) { +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->nbCount); +#endif + prevNb = firstNb; + firstNb = NET_BUFFER_NEXT_NB(prevNb); + mdl = NET_BUFFER_FIRST_MDL(prevNb); + NET_BUFFER_FIRST_MDL(prevNb) = NULL; + NdisFreeNetBuffer(prevNb); + OvsFreeMDLAndData(mdl); + } + NdisFreeNetBufferList(newNbl); + OVS_LOG_ERROR("OvsFullCopyNBL failed"); + return NULL; +} + +/* + * -------------------------------------------------------------------------- + * GetSegmentHeaderInfo + * + * Extract header size and sequence number for the segment. + * -------------------------------------------------------------------------- + */ +static NDIS_STATUS +GetSegmentHeaderInfo(PNET_BUFFER_LIST nbl, + const POVS_PACKET_HDR_INFO hdrInfo, + UINT32 *hdrSize, UINT32 *seqNumber) +{ + TCPHdr tcpStorage; + const TCPHdr *tcp; + + /* Parse the orginal Eth/IP/TCP header */ + tcp = OvsGetPacketBytes(nbl, sizeof *tcp, hdrInfo->l4Offset, &tcpStorage); + if (tcp == NULL) { + return NDIS_STATUS_FAILURE; + } + *seqNumber = ntohl(tcp->seq); + *hdrSize = hdrInfo->l4Offset + TCP_HDR_LEN(tcp); + + return NDIS_STATUS_SUCCESS; +} + + +/* + * -------------------------------------------------------------------------- + * FixSegmentHeader + * + * Fix IP length, IP checksum, TCP sequence number and TCP checksum + * in the segment. + * -------------------------------------------------------------------------- + */ +static NDIS_STATUS +FixSegmentHeader(PNET_BUFFER nb, UINT16 segmentSize, UINT32 seqNumber) +{ + EthHdr *dstEth; + IPHdr *dstIP; + TCPHdr *dstTCP; + PMDL mdl; + PUINT8 bufferStart; + + mdl = NET_BUFFER_FIRST_MDL(nb); + + bufferStart = (PUINT8)MmGetSystemAddressForMdlSafe(mdl, LowPagePriority); + if (!bufferStart) { + return NDIS_STATUS_RESOURCES; + } + dstEth = (EthHdr *)(bufferStart + NET_BUFFER_CURRENT_MDL_OFFSET(nb)); + ASSERT((INT)MmGetMdlByteCount(mdl) - NET_BUFFER_CURRENT_MDL_OFFSET(nb) + >= sizeof(EthHdr) + sizeof(IPHdr) + sizeof(TCPHdr)); + dstIP = (IPHdr *)((PCHAR)dstEth + sizeof *dstEth); + dstTCP = (TCPHdr *)((PCHAR)dstIP + dstIP->ihl * 4); + ASSERT((INT)MmGetMdlByteCount(mdl) - NET_BUFFER_CURRENT_MDL_OFFSET(nb) + >= sizeof(EthHdr) + dstIP->ihl * 4 + TCP_HDR_LEN(dstTCP)); + + /* Fix IP length and checksum */ + ASSERT(dstIP->protocol == IPPROTO_TCP); + dstIP->tot_len = htons(segmentSize + dstIP->ihl * 4 + TCP_HDR_LEN(dstTCP)); + dstIP->check = 0; + dstIP->check = IPChecksum((UINT8 *)dstIP, dstIP->ihl * 4, 0); + + /* Fix TCP checksum */ + dstTCP->seq = htonl(seqNumber); + dstTCP->check = + IPPseudoChecksum((UINT32 *)&dstIP->saddr, + (UINT32 *)&dstIP->daddr, + IPPROTO_TCP, segmentSize + TCP_HDR_LEN(dstTCP)); + dstTCP->check = CalculateChecksumNB(nb, + (UINT16)(NET_BUFFER_DATA_LENGTH(nb) - sizeof *dstEth - dstIP->ihl * 4), + sizeof *dstEth + dstIP->ihl * 4); + return STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * OvsTcpSegmentyNBL -- + * + * Segment TCP payload, and prepend each segment with ether/IP/TCP header. + * Leave headRoom for additional encap. + * + * Please note, + * NBL should have OVS_BUFFER_CONTEXT setup before calling + * this function. + * The NBL should already have ref to itself so that during copy + * it will not be freed. + * Currently this API assert there is only one NB in an NBL, it needs + * to be fixed if we receive multiple NBs in an NBL. + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsTcpSegmentNBL(PVOID ovsContext, + PNET_BUFFER_LIST nbl, + POVS_PACKET_HDR_INFO hdrInfo, + UINT32 mss, + UINT32 headRoom) +{ + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; +#ifdef DBG + POVS_NBL_POOL ovsPool = &context->ovsPool; +#endif + POVS_BUFFER_CONTEXT dstCtx, srcCtx; + UINT32 size, hdrSize, seqNumber; + PNET_BUFFER_LIST newNbl; + PNET_BUFFER nb, newNb; + NDIS_STATUS status; + UINT16 segmentSize; + ULONG copiedSize; + + srcCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + if (srcCtx == NULL || srcCtx->magic != OVS_CTX_MAGIC) { + OVS_LOG_INFO("src nbl must have ctx initialized"); + ASSERT(srcCtx && srcCtx->magic == OVS_CTX_MAGIC); + return NULL; + } + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + ASSERT(NET_BUFFER_NEXT_NB(nb) == NULL); + + /* Figure out the segment header size */ + status = GetSegmentHeaderInfo(nbl, hdrInfo, &hdrSize, &seqNumber); + if (status != NDIS_STATUS_SUCCESS) { + OVS_LOG_INFO("Cannot parse NBL header"); + return NULL; + } + + size = NET_BUFFER_DATA_LENGTH(nb) - hdrSize; + + /* XXX add to ovsPool counters? */ + newNbl = NdisAllocateFragmentNetBufferList(nbl, NULL, + NULL, hdrSize, mss, hdrSize + headRoom , 0, 0); + if (newNbl == NULL) { + return NULL; + } + + /* Now deal with TCP payload */ + for (newNb = NET_BUFFER_LIST_FIRST_NB(newNbl); newNb != NULL; + newNb = NET_BUFFER_NEXT_NB(newNb)) { + segmentSize = (size > mss ? mss : size) & 0xffff; + if (headRoom) { + NdisAdvanceNetBufferDataStart(newNb, headRoom, FALSE, NULL); + } + + /* Now copy the eth/IP/TCP header and fix up */ + status = NdisCopyFromNetBufferToNetBuffer(newNb, 0, hdrSize, nb, 0, + &copiedSize); + if (status != NDIS_STATUS_SUCCESS || hdrSize != copiedSize) { + goto nblcopy_error; + } + + status = FixSegmentHeader(newNb, segmentSize, seqNumber); + if (status != NDIS_STATUS_SUCCESS) { + goto nblcopy_error; + } + + + /* Move on to the next segment */ + size -= segmentSize; + seqNumber += segmentSize; + } + + status = OvsAllocateNBLContext(context, newNbl); + if (status != NDIS_STATUS_SUCCESS) { + goto nblcopy_error; + } + + status = OvsCopyNBLInfo(nbl, newNbl, srcCtx, hdrSize + headRoom, FALSE); + if (status != NDIS_STATUS_SUCCESS) { + goto nbl_context_error; + } + + newNbl->ParentNetBufferList = nbl; + + /* Remember it's a fragment NBL so we can free it properly */ + dstCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(newNbl); + ASSERT(dstCtx != NULL); + dstCtx->flags = OVS_BUFFER_FRAGMENT | OVS_BUFFER_PRIVATE_CONTEXT | + OVS_BUFFER_PRIVATE_FORWARD_CONTEXT | OVS_BUFFER_SEND_BUFFER; + dstCtx->refCount = 1; + dstCtx->magic = OVS_CTX_MAGIC; + dstCtx->dataOffsetDelta = hdrSize + headRoom; + + InterlockedIncrement((LONG volatile *)&srcCtx->refCount); +#ifdef DBG + InterlockedIncrement((LONG volatile *)&ovsPool->fragNBLCount); + + OvsDumpNetBufferList(nbl); + OvsDumpForwardingDetails(nbl); + + OvsDumpNetBufferList(newNbl); + OvsDumpForwardingDetails(newNbl); +#endif + OVS_LOG_TRACE("Segment nbl %p to newNbl: %p", nbl, newNbl); + return newNbl; + +nbl_context_error: + OvsFreeNBLContext(context, newNbl); +nblcopy_error: +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->fragNBLCount); +#endif + NdisFreeFragmentNetBufferList(newNbl, hdrSize + headRoom, 0); + return NULL; +} + + +/* + * -------------------------------------------------------------------------- + * OvsFullCopyToMultipleNBLs -- + * + * Copy NBL to multiple NBLs, each NB will have its own NBL + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsFullCopyToMultipleNBLs(PVOID ovsContext, + PNET_BUFFER_LIST nbl, + UINT32 headRoom, + BOOLEAN copyNblInfo) +{ + + POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext; + PNET_BUFFER_LIST firstNbl, currNbl, newNbl; + PNET_BUFFER nb; + POVS_BUFFER_CONTEXT srcCtx; + + srcCtx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + if (srcCtx == NULL || srcCtx->magic != OVS_CTX_MAGIC) { + OVS_LOG_INFO("src nbl must have ctx initialized"); + ASSERT(srcCtx && srcCtx->magic == OVS_CTX_MAGIC); + return NULL; + } + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + newNbl = OvsCopySinglePacketNBL(context, nbl, nb, headRoom, copyNblInfo); + + if (newNbl == NULL || NET_BUFFER_NEXT_NB(nb) == NULL) { + return newNbl; + } else { + firstNbl = newNbl; + currNbl = newNbl; + } + + while (nb) { + newNbl = OvsCopySinglePacketNBL(context, nbl, nb, headRoom, + copyNblInfo); + if (newNbl == NULL) { + goto copymultiple_error; + } + NET_BUFFER_LIST_NEXT_NBL(currNbl) = newNbl; + currNbl = newNbl; + nb = NET_BUFFER_NEXT_NB(nb); + } + return firstNbl; + +copymultiple_error: + while (firstNbl) { + currNbl = firstNbl; + firstNbl = NET_BUFFER_LIST_NEXT_NBL(firstNbl); + NET_BUFFER_LIST_NEXT_NBL(currNbl) = NULL; + OvsCompleteNBL(context, currNbl, TRUE); + } + return NULL; + +} + + +/* + * -------------------------------------------------------------------------- + * OvsCompleteNBL -- + * + * This function tries to free the NBL allocated by OVS buffer + * management module. If it trigger the completion of the parent + * NBL, it will recursively call itself. If it trigger the completion + * of external NBL, it will be returned to the caller. The caller + * is responsible to call API to return to upper layer. + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsCompleteNBL(POVS_SWITCH_CONTEXT context, + PNET_BUFFER_LIST nbl, + BOOLEAN updateRef) +{ + POVS_BUFFER_CONTEXT ctx; + UINT16 flags; + PNET_BUFFER_LIST parent; + NDIS_STATUS status; + NDIS_HANDLE poolHandle; + LONG value; + POVS_NBL_POOL ovsPool = &context->ovsPool; + PNET_BUFFER nb; + + + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + + ASSERT(ctx && ctx->magic == OVS_CTX_MAGIC); + + OVS_LOG_TRACE("Enter: nbl: %p, ctx: %p, refCount: %d, updateRef:%d", + nbl, ctx, ctx->refCount, updateRef); + + if (updateRef) { + value = InterlockedDecrement((LONG volatile *)&ctx->refCount); + if (value != 0) { + return NULL; + } + } else { + /* + * This is a special case, the refCount must be zero + */ + ASSERT(ctx->refCount == 0); + } + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + + flags = ctx->flags; + if (!(flags & OVS_BUFFER_FRAGMENT) && + NET_BUFFER_DATA_LENGTH(nb) != ctx->origDataLength) { + UINT32 diff; + if (NET_BUFFER_DATA_LENGTH(nb) < ctx->origDataLength) { + diff = ctx->origDataLength -NET_BUFFER_DATA_LENGTH(nb); + status = NdisRetreatNetBufferListDataStart(nbl, diff, 0, + NULL, NULL); + ASSERT(status == NDIS_STATUS_SUCCESS); + } else { + diff = NET_BUFFER_DATA_LENGTH(nb) - ctx->origDataLength; + NdisAdvanceNetBufferListDataStart(nbl, diff, TRUE, NULL); + } + } + + if (ctx->flags & OVS_BUFFER_PRIVATE_CONTEXT) { + NdisFreeNetBufferListContext(nbl, sizeof (OVS_BUFFER_CONTEXT)); + } + + if (flags & OVS_BUFFER_NEED_COMPLETE) { + /* + * return to caller for completion + */ +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->sysNBLCount); +#endif + return nbl; + } + + if (flags & OVS_BUFFER_PRIVATE_FORWARD_CONTEXT) { + context->NdisSwitchHandlers. + FreeNetBufferListForwardingContext(ovsPool->ndisContext, nbl); + } + + if (flags & (OVS_BUFFER_PRIVATE_MDL | OVS_BUFFER_PRIVATE_DATA)) { + PNET_BUFFER nb = NET_BUFFER_LIST_FIRST_NB(nbl); + while (nb) { + PMDL mdl = NET_BUFFER_FIRST_MDL(nb); + NET_BUFFER_FIRST_MDL(nb) = NULL; + ASSERT(mdl->Next == NULL); + OvsFreeMDLAndData(mdl); + nb = NET_BUFFER_NEXT_NB(nb); + } + } + + if (flags & OVS_BUFFER_PRIVATE_NET_BUFFER) { + PNET_BUFFER nb, nextNb; + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + while (nb) { + nextNb = NET_BUFFER_NEXT_NB(nb); + NdisFreeNetBuffer(nb); +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->nbCount); +#endif + nb = nextNb; + } + NET_BUFFER_LIST_FIRST_NB(nbl) = NULL; + } + + parent = nbl->ParentNetBufferList; + + poolHandle = NdisGetPoolFromNetBufferList(nbl); + if (flags & OVS_BUFFER_FROM_FIX_SIZE_POOL) { + ASSERT(poolHandle == ovsPool->fixSizePool); +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->fixNBLCount); +#endif + NdisFreeNetBufferList(nbl); + } else if (flags & OVS_BUFFER_FROM_ZERO_SIZE_POOL) { + ASSERT(poolHandle == ovsPool->zeroSizePool); +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->zeroNBLCount); +#endif + NdisFreeNetBufferList(nbl); + } else if (flags & OVS_BUFFER_FROM_NBL_ONLY_POOL) { + ASSERT(poolHandle == ovsPool->nblOnlyPool); +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->nblOnlyCount); +#endif + NdisFreeCloneNetBufferList(nbl, 0); + } else if (flags & OVS_BUFFER_FRAGMENT) { + OVS_LOG_TRACE("Free fragment %p parent %p", nbl, parent); +#ifdef DBG + InterlockedDecrement((LONG volatile *)&ovsPool->fragNBLCount); +#endif + NdisFreeFragmentNetBufferList(nbl, ctx->dataOffsetDelta, 0); + } + + if (parent != NULL) { + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(parent); + ASSERT(ctx && ctx->magic == OVS_CTX_MAGIC); + value = InterlockedDecrement((LONG volatile *)&ctx->refCount); + if (value == 0) { + return OvsCompleteNBL(context, parent, FALSE); + } + } + return NULL; +} + +/* + * -------------------------------------------------------------------------- + * OvsSetCtxSourcePortNo -- + * Setter function which stores the source port of an NBL in the NBL + * Context Info. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsSetCtxSourcePortNo(PNET_BUFFER_LIST nbl, + UINT32 portNo) +{ + POVS_BUFFER_CONTEXT ctx; + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + if (ctx == NULL) { + ASSERT(ctx && ctx->magic == OVS_CTX_MAGIC); + return STATUS_INVALID_PARAMETER; + } + + ctx->srcPortNo = portNo; + return NDIS_STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * OvsGetCtxSourcePortNo -- + * Get source port of an NBL from its Context Info. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsGetCtxSourcePortNo(PNET_BUFFER_LIST nbl, + UINT32 *portNo) +{ + POVS_BUFFER_CONTEXT ctx; + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); + if (ctx == NULL || portNo == NULL) { + ASSERT(ctx && ctx->magic == OVS_CTX_MAGIC); + return STATUS_INVALID_PARAMETER; + } + *portNo = ctx->srcPortNo; + return NDIS_STATUS_SUCCESS; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/BufferMgmt.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/BufferMgmt.h --- openvswitch-2.3.1/datapath-windows/ovsext/BufferMgmt.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/BufferMgmt.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __BUFFER_MGMT_H_ +#define __BUFFER_MGMT_H_ 1 + +#define MEM_ALIGN MEMORY_ALLOCATION_ALIGNMENT +#define MEM_ALIGN_SIZE(_x) ((MEM_ALIGN - 1 + (_x))/MEM_ALIGN * MEM_ALIGN) +#define OVS_CTX_MAGIC 0xabcd + +#define OVS_DEFAULT_NBL_CONTEXT_SIZE MEM_ALIGN_SIZE(64) +#define OVS_DEFAULT_NBL_CONTEXT_FILL \ + (OVS_DEFAULT_NBL_CONTEXT_SIZE - sizeof (OVS_BUFFER_CONTEXT)) + +#define OVS_DEFAULT_DATA_SIZE 256 +#define OVS_DEFAULT_HEADROOM_SIZE 128 +#define OVS_FIX_NBL_DATA_SIZE (OVS_DEFAULT_DATA_SIZE + OVS_DEFAULT_HEADROOM_SIZE) + +/* Default we copy 18 bytes, to make sure ethernet header and vlan is in + * continuous buffer */ +#define OVS_DEFAULT_COPY_SIZE 18 + +enum { + OVS_BUFFER_NEED_COMPLETE = BIT16(0), + OVS_BUFFER_PRIVATE_MDL = BIT16(1), + OVS_BUFFER_PRIVATE_DATA = BIT16(2), + OVS_BUFFER_PRIVATE_NET_BUFFER = BIT16(3), + OVS_BUFFER_PRIVATE_FORWARD_CONTEXT = BIT16(4), + OVS_BUFFER_PRIVATE_CONTEXT = BIT16(5), + OVS_BUFFER_FROM_FIX_SIZE_POOL = BIT16(6), + OVS_BUFFER_FROM_ZERO_SIZE_POOL = BIT16(7), + OVS_BUFFER_FROM_NBL_ONLY_POOL = BIT16(8), + OVS_BUFFER_RECV_BUFFER = BIT16(9), + OVS_BUFFER_SEND_BUFFER = BIT16(10), + OVS_BUFFER_FRAGMENT = BIT16(11), +}; + +typedef union _OVS_BUFFER_CONTEXT { + struct { + UINT16 magic; + UINT16 flags; + UINT32 srcPortNo; + UINT32 refCount; + union { + UINT32 origDataLength; + UINT32 dataOffsetDelta; + }; + }; + + UINT64 value[MEM_ALIGN_SIZE(16) >> 3]; +} OVS_BUFFER_CONTEXT, *POVS_BUFFER_CONTEXT; + + +typedef struct _OVS_NBL_POOL { + NDIS_SWITCH_CONTEXT ndisContext; + NDIS_HANDLE ndisHandle; + NDIS_HANDLE fixSizePool; // data size of 256 + NDIS_HANDLE zeroSizePool; // no data, NBL + NB + Context + NDIS_HANDLE nblOnlyPool; // NBL + context for clone + NDIS_HANDLE nbPool; // NB for clone +#ifdef DBG + LONG fixNBLCount; + LONG zeroNBLCount; + LONG nblOnlyCount; + LONG nbCount; + LONG sysNBLCount; + LONG fragNBLCount; +#endif +} OVS_NBL_POOL, *POVS_NBL_POOL; + + +NDIS_STATUS OvsInitBufferPool(PVOID context); +VOID OvsCleanupBufferPool(PVOID context); + +PNET_BUFFER_LIST OvsAllocateFixSizeNBL(PVOID context, + UINT32 size, + UINT32 headRoom); +PNET_BUFFER_LIST OvsAllocateVariableSizeNBL(PVOID context, + UINT32 size, + UINT32 headRoom); + +POVS_BUFFER_CONTEXT OvsInitExternalNBLContext(PVOID context, + PNET_BUFFER_LIST nbl, + BOOLEAN isRecv); + +PNET_BUFFER_LIST OvsPartialCopyNBL(PVOID context, + PNET_BUFFER_LIST nbl, + UINT32 copySize, + UINT32 headRoom, + BOOLEAN copyNblInfo); +PNET_BUFFER_LIST OvsPartialCopyToMultipleNBLs(PVOID context, + PNET_BUFFER_LIST nbl, + UINT32 copySize, + UINT32 headRoom, + BOOLEAN copyNblInfo); +PNET_BUFFER_LIST OvsFullCopyNBL(PVOID context, PNET_BUFFER_LIST nbl, + UINT32 headRoom, BOOLEAN copyNblInfo); +PNET_BUFFER_LIST OvsTcpSegmentNBL(PVOID context, + PNET_BUFFER_LIST nbl, + POVS_PACKET_HDR_INFO hdrInfo, + UINT32 MSS, + UINT32 headRoom); +PNET_BUFFER_LIST OvsFullCopyToMultipleNBLs(PVOID context, + PNET_BUFFER_LIST nbl, UINT32 headRoom, BOOLEAN copyNblInfo); +PNET_BUFFER_LIST OvsCompleteNBL(PVOID context, PNET_BUFFER_LIST nbl, + BOOLEAN updateRef); +NDIS_STATUS OvsSetCtxSourcePortNo(PNET_BUFFER_LIST nbl, UINT32 portNo); + +NDIS_STATUS OvsGetCtxSourcePortNo(PNET_BUFFER_LIST nbl, UINT32 *portNo); + +#endif /* __BUFFER_MGMT_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Checksum.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Checksum.c --- openvswitch-2.3.1/datapath-windows/ovsext/Checksum.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Checksum.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,578 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "Checksum.h" +#include "Flow.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_CHECKSUM +#include "Debug.h" +#include "PacketParser.h" + +#ifndef htons +#define htons(_x) (((UINT16)(_x) >> 8) + (((UINT16)(_x) << 8) & 0xff00)) +#endif + +#ifndef swap64 +#define swap64(_x) ((((UINT64)(_x) >> 8) & 0x00ff00ff00ff00ff) + \ + (((UINT64)(_x) << 8) & 0xff00ff00ff00ff00)) +#endif + +#define fold64(_x) \ + _x = ((_x) >> 32) + ((_x) & 0xffffffff); \ + _x = (UINT32)(((_x) >> 32) + (_x)); \ + _x = ((_x) >> 16) + ((_x) & 0xffff); \ + _x = (UINT16)(((_x) >> 16) + (_x)) + +#define fold32(_x) \ + _x = ((_x) >> 16) + ((_x) & 0xffff); \ + _x = (UINT16)(((_x) >> 16) + (_x)) + + +/* + *---------------------------------------------------------------------------- + * CalculateOnesComplement -- + * + * Given the start address and buffer length, calculate the 1's complement + * This routine can be used when multiple buffers are used for a packets. + * + * PLEASE NOTE, even though the last parameter is UINT64, but the assumption + * is it will not overflowed after adding the extra data. + * ------------------------------------------------ + * + * Result: + * As name indicate, the final data is not 1's complemnent + *---------------------------------------------------------------------------- + */ +UINT64 +CalculateOnesComplement(UINT8 *start, + UINT16 totalLength, + UINT64 initial, + BOOLEAN isEvenStart) +{ + UINT64 sum = 0, val; + UINT64 *src = (UINT64 *)start; + union { + UINT32 val; + UINT8 b8[4]; + } tmp; + + while (totalLength > 7) { + val = *src; + sum += (val >> 32) + (val & 0xffffffff); + src++; + totalLength -= 8; + } + if (totalLength > 3) { + sum += *(UINT32 *)src; + src = (UINT64 *)((UINT8 *)src + 4); + totalLength -= 4; + } + start = (UINT8 *)src; + tmp.val = 0; + switch (totalLength) { + case 3: + tmp.b8[2] = start[2]; + case 2: + tmp.b8[1] = start[1]; + case 1: + tmp.b8[0] = start[0]; + sum += tmp.val; + } + sum = (isEvenStart ? sum : swap64(sum)) + initial; + return sum; +} + +/* + *---------------------------------------------------------------------------- + * CalculateChecksum -- + * + * Given the start point, and length, calculate the checksum + * as 1's complement of 1's comlement. + * + * This assume the checksum field is initailized properly. + * + * Input Parameter: + * ptr: point to the data to be checksumed + * totalLength: total length of the data + * initial: inital value to remit the checksum. Please note this + * value should be network byte order value. + * + * The last parameter may be useful where you don't want to set + * checksum field to zero, in that case you can pass ~checksum, + * this is equivalent of set checksum field to zero. + * + * Result: + * The result can be assigned to checksum field directly. + *---------------------------------------------------------------------------- + */ +UINT16 +CalculateChecksum(UINT8 *ptr, + UINT16 totalLength, + UINT16 initial) +{ + UINT64 sum = CalculateOnesComplement(ptr, totalLength, initial, TRUE); + fold64(sum); + return (UINT16)~sum; +} + +/* + *---------------------------------------------------------------------------- + * CopyAndCalculateOnesComplement -- + * + * Given the start address and buffer length, calculate the 1's complement + * at same time, copt the data from src to dst. + * + * This routine can be used when multiple buffers are used for a packets. + * + * PLEASE NOTE, even though the last parameter is UINT64, but the assumption + * is it will not overflowed after adding the extra data. + * ------------------------------------------------ + * + * Result: + * As name indicate, the final data is not 1's complemnent + *---------------------------------------------------------------------------- + */ +UINT64 +CopyAndCalculateOnesComplement(UINT8 *dst, + UINT8 *src, + UINT16 length, + UINT64 initial, + BOOLEAN isEvenStart) +{ + UINT64 sum =0, val; + UINT64 *src64, *dst64; + union { + UINT32 val; + UINT8 b8[4]; + } tmp; + + src64 = (UINT64 *)src; + dst64 = (UINT64 *)dst; + + while (length > 7) { + val = *src64; + *dst64 = val; + sum += (val >> 32) + (val & 0xffffffff); + src64++; + dst64++; + length -= 8; + } + + if (length > 3) { + val = *(UINT32 *)src64; + *(UINT32 *)dst64 = (UINT32)val; + sum += (UINT32)val; + dst64 = (UINT64 *)((UINT8 *)dst64 + 4); + src64 = (UINT64 *)((UINT8 *)src64 + 4); + length -= 4; + } + src = (UINT8 *)src64; + dst = (UINT8 *)dst64; + tmp.val = 0; + switch (length) { + case 3: + dst[2] = src[2]; + tmp.b8[2] = src[2]; + case 2: + dst[1] = src[1]; + tmp.b8[1] = src[1]; + case 1: + dst[0] = src[0]; + tmp.b8[0] = src[0]; + sum += tmp.val; + } + sum = (isEvenStart ? sum : swap64(sum)) + initial; + return sum; +} + +/* + *---------------------------------------------------------------------------- + * CopyAndCalculateChecksum -- + * + * This is similar to CalculateChecksum, except it will also copy data to + * destination address. + *---------------------------------------------------------------------------- + */ +UINT16 +CopyAndCalculateChecksum(UINT8 *dst, + UINT8 *src, + UINT16 length, + UINT16 initial) +{ + + UINT64 sum = CopyAndCalculateOnesComplement(dst, src, length, initial, + TRUE); + fold64(sum); + return (UINT16)~sum; +} + + +/* + *---------------------------------------------------------------------------- + * IPChecksum -- + * + * Give IP header, calculate the IP checksum. + * We assume IP checksum field is initialized properly + * + * Input Pramater: + * ipHdr: IP header start point + * length: IP header length (potentially include IP options) + * initial: same as CalculateChecksum + * + * Result: + * The result is already 1's complement, so can be assigned + * to checksum field directly + *---------------------------------------------------------------------------- + */ +UINT16 +IPChecksum(UINT8 *ipHdr, + UINT16 length, + UINT16 initial) +{ + UINT32 sum = initial; + UINT16 *ptr = (UINT16 *)ipHdr; + ASSERT((length & 0x3) == 0); + while (length > 1) { + sum += ptr[0]; + ptr++; + length -= 2; + } + fold32(sum); + return (UINT16)~sum; +} + +/* + *---------------------------------------------------------------------------- + * IPPseudoChecksum -- + * + * Give src and dst IP address, protocol value and total + * upper layer length(not include IP header, but include + * upller layer protocol header, for example it include + * TCP header for TCP checksum), calculate the pseudo + * checksum, please note this checksum is just 1's complement + * addition. + * + * Input Parameter: + * src: please note it is in network byte order + * dst: same as src + * protocol: protocol value in IP header + * totalLength: total length of upper layer data including + * header. + * + * Result: + * + * This value should be put in TCP checksum field before + * calculating TCP checksum using CalculateChecksum with + * initial value of 0. + *---------------------------------------------------------------------------- + */ +UINT16 +IPPseudoChecksum(UINT32 *src, + UINT32 *dst, + UINT8 protocol, + UINT16 totalLength) +{ + UINT32 sum = (UINT32)htons(totalLength) + htons(protocol); + sum += (*src >> 16) + (*src & 0xffff); + sum += (*dst >> 16) + (*dst & 0xffff); + fold32(sum); + return (UINT16)sum; +} + +/* + *---------------------------------------------------------------------------- + * IPv6PseudoChecksum -- + * + * Given IPv6 src and dst address, upper layer protocol and total + * upper layer protocol data length including upper layer header + * part, calculate the pseudo checksum for upper layer protocol + * checksum. + * + * please note this checksum is just 1's complement addition. + * + * Input Parameter: + * src: src IPv6 address in network byte order + * dst: dst IPv6 address. + * protocol: upper layer protocol + * totalLength: total length of upper layer data. Please note this is + * in host byte order. + * + * Result: + * + * Place in upper layer checksum field before calculate upper layer + * checksum. + *---------------------------------------------------------------------------- + */ +UINT16 +IPv6PseudoChecksum(UINT32 *src, + UINT32 *dst, + UINT8 protocol, + UINT16 totalLength) +{ + UINT64 sum = (UINT32)htons(totalLength) + htons(protocol); + sum += (UINT64)src[0] + src[1] + src[2] + src[3]; + sum += (UINT64)dst[0] + dst[1] + dst[2] + dst[3]; + fold64(sum); + return (UINT16)sum; +} + +/* + *---------------------------------------------------------------------------- + * ChecksumUpdate32 -- + * + * Given old checksum value (as it is in checksum field), + * prev value of the relevant field in network byte order + * new value of the relevant field in the network byte order + * calculate the new checksum. + * Please check relevant RFC for reference. + * + * Input Pramater: + * oldSum: old checksum value in checksum field + * prev: previous value of relevant 32 bit feld in network + * byte order. + * new: new value of the relevant 32 bit field in network + * byte order. + * + * Result: + * new checksum value to be placed in the checksum field. + *---------------------------------------------------------------------------- + */ +UINT16 +ChecksumUpdate32(UINT16 oldSum, + UINT32 prev, + UINT32 newValue) +{ + UINT32 sum = ~prev; + sum = (sum >> 16) + (sum & 0xffff); + sum += (newValue >> 16) + (newValue & 0xffff); + sum += (UINT16)~oldSum; + fold32(sum); + return (UINT16)~sum; +} + + +/* + *---------------------------------------------------------------------------- + * ChecksumUpdate16 -- + * + * Given old checksum value (as it is in checksum field), + * prev value of the relevant field in network byte order + * new value of the relevant field in the network byte order + * calculate the new checksum. + * Please check relevant RFC for reference. + * + * Input Pramater: + * oldSum: old checksum value in checksum field + * prev: previous value of relevant 32 bit feld in network + * byte order. + * new: new value of the relevant 32 bit field in network + * byte order. + * + * Result: + * new checksum value to be placed in the checksum field. + *---------------------------------------------------------------------------- + */ +UINT16 +ChecksumUpdate16(UINT16 oldSum, + UINT16 prev, + UINT16 newValue) +{ + UINT32 sum = (UINT16)~oldSum; + sum += (UINT32)((UINT16)~prev) + newValue; + fold32(sum); + return (UINT16)~sum; +} + +/* + *---------------------------------------------------------------------------- + * CalculateChecksumNB -- + * + * Calculates checksum over a length of bytes contained in an NB. + * + * nb : NB which contains the packet bytes. + * csumDataLen : Length of bytes to be checksummed. + * offset : offset to the first bytes of the data stream to be + * checksumed. + * + * Result: + * return 0, if there is a failure. + *---------------------------------------------------------------------------- + */ +UINT16 +CalculateChecksumNB(const PNET_BUFFER nb, + UINT16 csumDataLen, + UINT32 offset) +{ + ULONG mdlLen; + UINT16 csLen; + PUCHAR src; + UINT64 csum = 0; + PMDL currentMdl; + ULONG firstMdlLen; + /* Running count of bytes in remainder of the MDLs including current. */ + ULONG packetLen; + + if ((nb == NULL) || (csumDataLen == 0) + || (offset >= NET_BUFFER_DATA_LENGTH(nb)) + || (offset + csumDataLen > NET_BUFFER_DATA_LENGTH(nb))) { + OVS_LOG_ERROR("Invalid parameters - csum length %u, offset %u," + "pkt%s len %u", csumDataLen, offset, nb? "":"(null)", + nb? NET_BUFFER_DATA_LENGTH(nb) : 0); + return 0; + } + + currentMdl = NET_BUFFER_CURRENT_MDL(nb); + packetLen = NET_BUFFER_DATA_LENGTH(nb); + firstMdlLen = + MmGetMdlByteCount(currentMdl) - NET_BUFFER_CURRENT_MDL_OFFSET(nb); + + firstMdlLen = MIN(firstMdlLen, packetLen); + if (offset < firstMdlLen) { + src = (PUCHAR) MmGetSystemAddressForMdlSafe(currentMdl, LowPagePriority); + if (!src) { + return 0; + } + src += (NET_BUFFER_CURRENT_MDL_OFFSET(nb) + offset); + mdlLen = firstMdlLen - offset; + packetLen -= firstMdlLen; + ASSERT((INT)packetLen >= 0); + } else { + offset -= firstMdlLen; + packetLen -= firstMdlLen; + ASSERT((INT)packetLen >= 0); + currentMdl = NDIS_MDL_LINKAGE(currentMdl); + mdlLen = MmGetMdlByteCount(currentMdl); + mdlLen = MIN(mdlLen, packetLen); + + while (offset >= mdlLen) { + offset -= mdlLen; + packetLen -= mdlLen; + ASSERT((INT)packetLen >= 0); + currentMdl = NDIS_MDL_LINKAGE(currentMdl); + mdlLen = MmGetMdlByteCount(currentMdl); + mdlLen = MIN(mdlLen, packetLen); + } + + src = (PUCHAR)MmGetSystemAddressForMdlSafe(currentMdl, LowPagePriority); + if (!src) { + return 0; + } + + src += offset; + mdlLen -= offset; + } + + while (csumDataLen && (currentMdl != NULL)) { + ASSERT(mdlLen < 65536); + csLen = MIN((UINT16) mdlLen, csumDataLen); + //XXX Not handling odd bytes yet. + ASSERT(((csLen & 0x1) == 0) || csumDataLen <= mdlLen); + + csum = CalculateOnesComplement(src, csLen, csum, TRUE); + fold64(csum); + + csumDataLen -= csLen; + currentMdl = NDIS_MDL_LINKAGE(currentMdl); + if (csumDataLen && currentMdl) { + src = MmGetSystemAddressForMdlSafe(currentMdl, LowPagePriority); + if (!src) { + return 0; + } + + mdlLen = MmGetMdlByteCount(currentMdl); + mdlLen = MIN(mdlLen, packetLen); + /* packetLen does not include the current MDL from here on. */ + packetLen -= mdlLen; + ASSERT((INT)packetLen >= 0); + } + } + + ASSERT(csumDataLen == 0); + ASSERT((csum & ~0xffff) == 0); + return (UINT16) ~csum; +} + +/* + * -------------------------------------------------------------------------- + * OvsValidateIPChecksum + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsValidateIPChecksum(PNET_BUFFER_LIST curNbl, + POVS_PACKET_HDR_INFO hdrInfo) +{ + NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO csumInfo; + uint16_t checksum, hdrChecksum; + struct IPHdr ip_storage; + const IPHdr *ipHdr; + + if (!hdrInfo->isIPv4) { + return NDIS_STATUS_SUCCESS; + } + + /* First check if NIC has indicated checksum failure. */ + csumInfo.Value = NET_BUFFER_LIST_INFO(curNbl, + TcpIpChecksumNetBufferListInfo); + if (csumInfo.Receive.IpChecksumFailed) { + return NDIS_STATUS_FAILURE; + } + + /* Next, check if the NIC did not validate the RX checksum. */ + if (!csumInfo.Receive.IpChecksumSucceeded) { + ipHdr = OvsGetIp(curNbl, hdrInfo->l3Offset, &ip_storage); + if (ipHdr) { + ip_storage = *ipHdr; + hdrChecksum = ipHdr->check; + ip_storage.check = 0; + checksum = IPChecksum((uint8 *)&ip_storage, ipHdr->ihl * 4, 0); + if (checksum != hdrChecksum) { + return NDIS_STATUS_FAILURE; + } + } + } + return NDIS_STATUS_SUCCESS; +} + +/* + *---------------------------------------------------------------------------- + * OvsValidateUDPChecksum + *---------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsValidateUDPChecksum(PNET_BUFFER_LIST curNbl, BOOLEAN udpCsumZero) +{ + NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO csumInfo; + + csumInfo.Value = NET_BUFFER_LIST_INFO(curNbl, TcpIpChecksumNetBufferListInfo); + + if (udpCsumZero) { + /* Zero is valid checksum. */ + csumInfo.Receive.UdpChecksumFailed = 0; + NET_BUFFER_LIST_INFO(curNbl, TcpIpChecksumNetBufferListInfo) = csumInfo.Value; + return NDIS_STATUS_SUCCESS; + } + + /* First check if NIC has indicated UDP checksum failure. */ + if (csumInfo.Receive.UdpChecksumFailed) { + return NDIS_STATUS_INVALID_PACKET; + } + + return NDIS_STATUS_SUCCESS; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Checksum.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Checksum.h --- openvswitch-2.3.1/datapath-windows/ovsext/Checksum.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Checksum.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKSUM_H_ +#define __CHECKSUM_H_ 1 + +typedef union _OVS_PACKET_HDR_INFO *POVS_PACKET_HDR_INFO; + +UINT16 CalculateChecksum(UINT8 *ptr, UINT16 length, UINT16 initial); +UINT16 CopyAndCalculateChecksum(UINT8 *dst, UINT8 *src, UINT16 length, + UINT16 initial); +UINT16 IPChecksum(UINT8 *ipHdr, UINT16 length, UINT16 initial); +UINT16 IPPseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol, + UINT16 totalLength); +UINT16 IPv6PseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol, + UINT16 totalLength); +UINT16 ChecksumUpdate32(UINT16 oldSum, UINT32 prev, UINT32 newValue); +UINT16 ChecksumUpdate16(UINT16 oldSum, UINT16 prev, UINT16 newValue); +UINT16 CalculateChecksumNB(const PNET_BUFFER nb, UINT16 csumDataLen, + UINT32 offset); +NDIS_STATUS OvsValidateIPChecksum(PNET_BUFFER_LIST curNbl, + POVS_PACKET_HDR_INFO hdrInfo); +NDIS_STATUS OvsValidateUDPChecksum(PNET_BUFFER_LIST curNbl, + BOOLEAN udpCsumZero); + +#endif /* __CHECKSUM_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Datapath.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Datapath.c --- openvswitch-2.3.1/datapath-windows/ovsext/Datapath.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Datapath.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1701 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * XXX: OVS_USE_NL_INTERFACE is being used to keep the legacy DPIF interface + * alive while we transition over to the netlink based interface. + * OVS_USE_NL_INTERFACE = 0 => legacy inteface to use with dpif-windows.c + * OVS_USE_NL_INTERFACE = 1 => netlink inteface to use with ported dpif-linux.c + */ + +#include "precomp.h" +#include "Switch.h" +#include "User.h" +#include "Datapath.h" +#include "Jhash.h" +#include "Vport.h" +#include "Event.h" +#include "User.h" +#include "PacketIO.h" +#include "NetProto.h" +#include "Flow.h" +#include "User.h" +#include "Vxlan.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_DATAPATH +#include "Debug.h" + +#define NETLINK_FAMILY_NAME_LEN 48 + + +/* + * Netlink messages are grouped by family (aka type), and each family supports + * a set of commands, and can be passed both from kernel -> userspace or + * vice-versa. To call into the kernel, userspace uses a device operation which + * is outside of a netlink message. + * + * Each command results in the invocation of a handler function to implement the + * request functionality. + * + * Expectedly, only certain combinations of (device operation, netlink family, + * command) are valid. + * + * Here, we implement the basic infrastructure to perform validation on the + * incoming message, version checking, and also to invoke the corresponding + * handler to do the heavy-lifting. + */ + +/* + * Handler for a given netlink command. Not all the parameters are used by all + * the handlers. + */ +typedef NTSTATUS(NetlinkCmdHandler)(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); + +typedef struct _NETLINK_CMD { + UINT16 cmd; + NetlinkCmdHandler *handler; + UINT32 supportedDevOp; /* Supported device operations. */ + BOOLEAN validateDpIndex; /* Does command require a valid DP argument. */ +} NETLINK_CMD, *PNETLINK_CMD; + +/* A netlink family is a group of commands. */ +typedef struct _NETLINK_FAMILY { + CHAR *name; + UINT16 id; + UINT8 version; + UINT8 pad1; + UINT16 maxAttr; + UINT16 pad2; + NETLINK_CMD *cmds; /* Array of netlink commands and handlers. */ + UINT16 opsCount; +} NETLINK_FAMILY, *PNETLINK_FAMILY; + +/* Handlers for the various netlink commands. */ +static NetlinkCmdHandler OvsPendEventCmdHandler, + OvsPendPacketCmdHandler, + OvsSubscribeEventCmdHandler, + OvsSubscribePacketCmdHandler, + OvsReadEventCmdHandler, + OvsReadPacketCmdHandler, + OvsNewDpCmdHandler, + OvsGetDpCmdHandler, + OvsSetDpCmdHandler; + +NetlinkCmdHandler OvsGetNetdevCmdHandler, + OvsGetVportCmdHandler, + OvsSetVportCmdHandler, + OvsNewVportCmdHandler, + OvsDeleteVportCmdHandler; + +static NTSTATUS HandleGetDpTransaction(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); +static NTSTATUS HandleGetDpDump(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); +static NTSTATUS HandleDpTransactionCommon( + POVS_USER_PARAMS_CONTEXT usrParamsCtx, UINT32 *replyLen); +static NTSTATUS OvsGetPidHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); + +/* + * The various netlink families, along with the supported commands. Most of + * these families and commands are part of the openvswitch specification for a + * netlink datapath. In addition, each platform can implement a few families + * and commands as extensions. + */ + +/* Netlink control family: this is a Windows specific family. */ +NETLINK_CMD nlControlFamilyCmdOps[] = { + { .cmd = OVS_CTRL_CMD_WIN_PEND_REQ, + .handler = OvsPendEventCmdHandler, + .supportedDevOp = OVS_WRITE_DEV_OP, + .validateDpIndex = TRUE, + }, + { .cmd = OVS_CTRL_CMD_WIN_PEND_PACKET_REQ, + .handler = OvsPendPacketCmdHandler, + .supportedDevOp = OVS_WRITE_DEV_OP, + .validateDpIndex = TRUE, + }, + { .cmd = OVS_CTRL_CMD_MC_SUBSCRIBE_REQ, + .handler = OvsSubscribeEventCmdHandler, + .supportedDevOp = OVS_WRITE_DEV_OP, + .validateDpIndex = TRUE, + }, + { .cmd = OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ, + .handler = OvsSubscribePacketCmdHandler, + .supportedDevOp = OVS_WRITE_DEV_OP, + .validateDpIndex = TRUE, + }, + { .cmd = OVS_CTRL_CMD_EVENT_NOTIFY, + .handler = OvsReadEventCmdHandler, + .supportedDevOp = OVS_READ_DEV_OP, + .validateDpIndex = FALSE, + }, + { .cmd = OVS_CTRL_CMD_READ_NOTIFY, + .handler = OvsReadPacketCmdHandler, + .supportedDevOp = OVS_READ_DEV_OP, + .validateDpIndex = FALSE, + } +}; + +NETLINK_FAMILY nlControlFamilyOps = { + .name = OVS_WIN_CONTROL_FAMILY, + .id = OVS_WIN_NL_CTRL_FAMILY_ID, + .version = OVS_WIN_CONTROL_VERSION, + .maxAttr = OVS_WIN_CONTROL_ATTR_MAX, + .cmds = nlControlFamilyCmdOps, + .opsCount = ARRAY_SIZE(nlControlFamilyCmdOps) +}; + +/* Netlink datapath family. */ +NETLINK_CMD nlDatapathFamilyCmdOps[] = { + { .cmd = OVS_DP_CMD_NEW, + .handler = OvsNewDpCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = FALSE + }, + { .cmd = OVS_DP_CMD_GET, + .handler = OvsGetDpCmdHandler, + .supportedDevOp = OVS_WRITE_DEV_OP | OVS_READ_DEV_OP | + OVS_TRANSACTION_DEV_OP, + .validateDpIndex = FALSE + }, + { .cmd = OVS_DP_CMD_SET, + .handler = OvsSetDpCmdHandler, + .supportedDevOp = OVS_WRITE_DEV_OP | OVS_READ_DEV_OP | + OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + } +}; + +NETLINK_FAMILY nlDatapathFamilyOps = { + .name = OVS_DATAPATH_FAMILY, + .id = OVS_WIN_NL_DATAPATH_FAMILY_ID, + .version = OVS_DATAPATH_VERSION, + .maxAttr = OVS_DP_ATTR_MAX, + .cmds = nlDatapathFamilyCmdOps, + .opsCount = ARRAY_SIZE(nlDatapathFamilyCmdOps) +}; + +/* Netlink packet family. */ + +NETLINK_CMD nlPacketFamilyCmdOps[] = { + { .cmd = OVS_PACKET_CMD_EXECUTE, + .handler = OvsNlExecuteCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + } +}; + +NETLINK_FAMILY nlPacketFamilyOps = { + .name = OVS_PACKET_FAMILY, + .id = OVS_WIN_NL_PACKET_FAMILY_ID, + .version = OVS_PACKET_VERSION, + .maxAttr = OVS_PACKET_ATTR_MAX, + .cmds = nlPacketFamilyCmdOps, + .opsCount = ARRAY_SIZE(nlPacketFamilyCmdOps) +}; + +/* Netlink vport family. */ +NETLINK_CMD nlVportFamilyCmdOps[] = { + { .cmd = OVS_VPORT_CMD_GET, + .handler = OvsGetVportCmdHandler, + .supportedDevOp = OVS_WRITE_DEV_OP | OVS_READ_DEV_OP | + OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + }, + { .cmd = OVS_VPORT_CMD_NEW, + .handler = OvsNewVportCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + }, + { .cmd = OVS_VPORT_CMD_SET, + .handler = OvsSetVportCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + }, + { .cmd = OVS_VPORT_CMD_DEL, + .handler = OvsDeleteVportCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + }, +}; + +NETLINK_FAMILY nlVportFamilyOps = { + .name = OVS_VPORT_FAMILY, + .id = OVS_WIN_NL_VPORT_FAMILY_ID, + .version = OVS_VPORT_VERSION, + .maxAttr = OVS_VPORT_ATTR_MAX, + .cmds = nlVportFamilyCmdOps, + .opsCount = ARRAY_SIZE(nlVportFamilyCmdOps) +}; + +/* Netlink flow family. */ + +NETLINK_CMD nlFlowFamilyCmdOps[] = { + { .cmd = OVS_FLOW_CMD_NEW, + .handler = OvsFlowNlCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + }, + { .cmd = OVS_FLOW_CMD_SET, + .handler = OvsFlowNlCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + }, + { .cmd = OVS_FLOW_CMD_DEL, + .handler = OvsFlowNlCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + }, + { .cmd = OVS_FLOW_CMD_GET, + .handler = OvsFlowNlGetCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP | + OVS_WRITE_DEV_OP | OVS_READ_DEV_OP, + .validateDpIndex = TRUE + }, +}; + +NETLINK_FAMILY nlFLowFamilyOps = { + .name = OVS_FLOW_FAMILY, + .id = OVS_WIN_NL_FLOW_FAMILY_ID, + .version = OVS_FLOW_VERSION, + .maxAttr = OVS_FLOW_ATTR_MAX, + .cmds = nlFlowFamilyCmdOps, + .opsCount = ARRAY_SIZE(nlFlowFamilyCmdOps) +}; + +/* Netlink netdev family. */ +NETLINK_CMD nlNetdevFamilyCmdOps[] = { + { .cmd = OVS_WIN_NETDEV_CMD_GET, + .handler = OvsGetNetdevCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = FALSE + }, +}; + +NETLINK_FAMILY nlNetdevFamilyOps = { + .name = OVS_WIN_NETDEV_FAMILY, + .id = OVS_WIN_NL_NETDEV_FAMILY_ID, + .version = OVS_WIN_NETDEV_VERSION, + .maxAttr = OVS_WIN_NETDEV_ATTR_MAX, + .cmds = nlNetdevFamilyCmdOps, + .opsCount = ARRAY_SIZE(nlNetdevFamilyCmdOps) +}; + +static NTSTATUS MapIrpOutputBuffer(PIRP irp, + UINT32 bufferLength, + UINT32 requiredLength, + PVOID *buffer); +static NTSTATUS ValidateNetlinkCmd(UINT32 devOp, + POVS_OPEN_INSTANCE instance, + POVS_MESSAGE ovsMsg, + NETLINK_FAMILY *nlFamilyOps); +static NTSTATUS InvokeNetlinkCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + NETLINK_FAMILY *nlFamilyOps, + UINT32 *replyLen); + +/* Handles to the device object for communication with userspace. */ +NDIS_HANDLE gOvsDeviceHandle; +PDEVICE_OBJECT gOvsDeviceObject; + +_Dispatch_type_(IRP_MJ_CREATE) +_Dispatch_type_(IRP_MJ_CLOSE) +DRIVER_DISPATCH OvsOpenCloseDevice; + +_Dispatch_type_(IRP_MJ_CLEANUP) +DRIVER_DISPATCH OvsCleanupDevice; + +_Dispatch_type_(IRP_MJ_DEVICE_CONTROL) +DRIVER_DISPATCH OvsDeviceControl; + +#ifdef ALLOC_PRAGMA +#pragma alloc_text(INIT, OvsCreateDeviceObject) +#pragma alloc_text(PAGE, OvsOpenCloseDevice) +#pragma alloc_text(PAGE, OvsCleanupDevice) +#pragma alloc_text(PAGE, OvsDeviceControl) +#endif // ALLOC_PRAGMA + +/* + * We might hit this limit easily since userspace opens a netlink descriptor for + * each thread, and at least one descriptor per vport. Revisit this later. + */ +#define OVS_MAX_OPEN_INSTANCES 512 +#define OVS_SYSTEM_DP_NAME "ovs-system" + +POVS_OPEN_INSTANCE ovsOpenInstanceArray[OVS_MAX_OPEN_INSTANCES]; +UINT32 ovsNumberOfOpenInstances; +extern POVS_SWITCH_CONTEXT gOvsSwitchContext; + +NDIS_SPIN_LOCK ovsCtrlLockObj; +PNDIS_SPIN_LOCK gOvsCtrlLock; + +NTSTATUS +InitUserDumpState(POVS_OPEN_INSTANCE instance, + POVS_MESSAGE ovsMsg) +{ + /* Clear the dumpState from a previous dump sequence. */ + ASSERT(instance->dumpState.ovsMsg == NULL); + ASSERT(ovsMsg); + + instance->dumpState.ovsMsg = + (POVS_MESSAGE)OvsAllocateMemoryWithTag(sizeof(OVS_MESSAGE), + OVS_DATAPATH_POOL_TAG); + if (instance->dumpState.ovsMsg == NULL) { + return STATUS_NO_MEMORY; + } + RtlCopyMemory(instance->dumpState.ovsMsg, ovsMsg, + sizeof *instance->dumpState.ovsMsg); + RtlZeroMemory(instance->dumpState.index, + sizeof instance->dumpState.index); + + return STATUS_SUCCESS; +} + +VOID +FreeUserDumpState(POVS_OPEN_INSTANCE instance) +{ + if (instance->dumpState.ovsMsg != NULL) { + OvsFreeMemoryWithTag(instance->dumpState.ovsMsg, + OVS_DATAPATH_POOL_TAG); + RtlZeroMemory(&instance->dumpState, sizeof instance->dumpState); + } +} + +VOID +OvsInit() +{ + gOvsCtrlLock = &ovsCtrlLockObj; + NdisAllocateSpinLock(gOvsCtrlLock); + OvsInitEventQueue(); +} + +VOID +OvsCleanup() +{ + OvsCleanupEventQueue(); + if (gOvsCtrlLock) { + NdisFreeSpinLock(gOvsCtrlLock); + gOvsCtrlLock = NULL; + } +} + +VOID +OvsAcquireCtrlLock() +{ + NdisAcquireSpinLock(gOvsCtrlLock); +} + +VOID +OvsReleaseCtrlLock() +{ + NdisReleaseSpinLock(gOvsCtrlLock); +} + + +/* + * -------------------------------------------------------------------------- + * Creates the communication device between user and kernel, and also + * initializes the data associated data structures. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + UNICODE_STRING deviceName; + UNICODE_STRING symbolicDeviceName; + PDRIVER_DISPATCH dispatchTable[IRP_MJ_MAXIMUM_FUNCTION+1]; + NDIS_DEVICE_OBJECT_ATTRIBUTES deviceAttributes; + OVS_LOG_TRACE("ovsExtDriverHandle: %p", ovsExtDriverHandle); + + RtlZeroMemory(dispatchTable, + (IRP_MJ_MAXIMUM_FUNCTION + 1) * sizeof (PDRIVER_DISPATCH)); + dispatchTable[IRP_MJ_CREATE] = OvsOpenCloseDevice; + dispatchTable[IRP_MJ_CLOSE] = OvsOpenCloseDevice; + dispatchTable[IRP_MJ_CLEANUP] = OvsCleanupDevice; + dispatchTable[IRP_MJ_DEVICE_CONTROL] = OvsDeviceControl; + + NdisInitUnicodeString(&deviceName, OVS_DEVICE_NAME_NT); + NdisInitUnicodeString(&symbolicDeviceName, OVS_DEVICE_NAME_DOS); + + RtlZeroMemory(&deviceAttributes, sizeof (NDIS_DEVICE_OBJECT_ATTRIBUTES)); + + OVS_INIT_OBJECT_HEADER(&deviceAttributes.Header, + NDIS_OBJECT_TYPE_DEVICE_OBJECT_ATTRIBUTES, + NDIS_DEVICE_OBJECT_ATTRIBUTES_REVISION_1, + sizeof (NDIS_DEVICE_OBJECT_ATTRIBUTES)); + + deviceAttributes.DeviceName = &deviceName; + deviceAttributes.SymbolicName = &symbolicDeviceName; + deviceAttributes.MajorFunctions = dispatchTable; + deviceAttributes.ExtensionSize = sizeof (OVS_DEVICE_EXTENSION); + + status = NdisRegisterDeviceEx(ovsExtDriverHandle, + &deviceAttributes, + &gOvsDeviceObject, + &gOvsDeviceHandle); + if (status != NDIS_STATUS_SUCCESS) { + POVS_DEVICE_EXTENSION ovsExt = + (POVS_DEVICE_EXTENSION)NdisGetDeviceReservedExtension(gOvsDeviceObject); + ASSERT(gOvsDeviceObject != NULL); + ASSERT(gOvsDeviceHandle != NULL); + + if (ovsExt) { + ovsExt->numberOpenInstance = 0; + } + } else { + OvsRegisterSystemProvider((PVOID)gOvsDeviceObject); + } + + OVS_LOG_TRACE("DeviceObject: %p", gOvsDeviceObject); + return status; +} + + +VOID +OvsDeleteDeviceObject() +{ + if (gOvsDeviceHandle) { +#ifdef DBG + POVS_DEVICE_EXTENSION ovsExt = (POVS_DEVICE_EXTENSION) + NdisGetDeviceReservedExtension(gOvsDeviceObject); + if (ovsExt) { + ASSERT(ovsExt->numberOpenInstance == 0); + } +#endif + + ASSERT(gOvsDeviceObject); + NdisDeregisterDeviceEx(gOvsDeviceHandle); + gOvsDeviceHandle = NULL; + gOvsDeviceObject = NULL; + + OvsUnregisterSystemProvider(); + } +} + +POVS_OPEN_INSTANCE +OvsGetOpenInstance(PFILE_OBJECT fileObject, + UINT32 dpNo) +{ + POVS_OPEN_INSTANCE instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + ASSERT(instance); + ASSERT(instance->fileObject == fileObject); + if (gOvsSwitchContext->dpNo != dpNo) { + return NULL; + } + return instance; +} + + +POVS_OPEN_INSTANCE +OvsFindOpenInstance(PFILE_OBJECT fileObject) +{ + UINT32 i, j; + for (i = 0, j = 0; i < OVS_MAX_OPEN_INSTANCES && + j < ovsNumberOfOpenInstances; i++) { + if (ovsOpenInstanceArray[i]) { + if (ovsOpenInstanceArray[i]->fileObject == fileObject) { + return ovsOpenInstanceArray[i]; + } + j++; + } + } + return NULL; +} + +NTSTATUS +OvsAddOpenInstance(POVS_DEVICE_EXTENSION ovsExt, + PFILE_OBJECT fileObject) +{ + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)OvsAllocateMemoryWithTag(sizeof(OVS_OPEN_INSTANCE), + OVS_DATAPATH_POOL_TAG); + UINT32 i; + + if (instance == NULL) { + return STATUS_NO_MEMORY; + } + OvsAcquireCtrlLock(); + ASSERT(OvsFindOpenInstance(fileObject) == NULL); + + if (ovsNumberOfOpenInstances >= OVS_MAX_OPEN_INSTANCES) { + OvsReleaseCtrlLock(); + OvsFreeMemoryWithTag(instance, OVS_DATAPATH_POOL_TAG); + return STATUS_INSUFFICIENT_RESOURCES; + } + RtlZeroMemory(instance, sizeof (OVS_OPEN_INSTANCE)); + + for (i = 0; i < OVS_MAX_OPEN_INSTANCES; i++) { + if (ovsOpenInstanceArray[i] == NULL) { + ovsOpenInstanceArray[i] = instance; + ovsNumberOfOpenInstances++; + instance->cookie = i; + break; + } + } + ASSERT(i < OVS_MAX_OPEN_INSTANCES); + instance->fileObject = fileObject; + ASSERT(fileObject->FsContext == NULL); + instance->pid = (UINT32)InterlockedIncrement((LONG volatile *)&ovsExt->pidCount); + if (instance->pid == 0) { + /* XXX: check for rollover. */ + } + fileObject->FsContext = instance; + OvsReleaseCtrlLock(); + return STATUS_SUCCESS; +} + +static VOID +OvsCleanupOpenInstance(PFILE_OBJECT fileObject) +{ + POVS_OPEN_INSTANCE instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + ASSERT(instance); + ASSERT(fileObject == instance->fileObject); + OvsCleanupEvent(instance); + OvsCleanupPacketQueue(instance); +} + +VOID +OvsRemoveOpenInstance(PFILE_OBJECT fileObject) +{ + POVS_OPEN_INSTANCE instance; + ASSERT(fileObject->FsContext); + instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + ASSERT(instance->cookie < OVS_MAX_OPEN_INSTANCES); + + OvsAcquireCtrlLock(); + fileObject->FsContext = NULL; + ASSERT(ovsOpenInstanceArray[instance->cookie] == instance); + ovsOpenInstanceArray[instance->cookie] = NULL; + ovsNumberOfOpenInstances--; + OvsReleaseCtrlLock(); + ASSERT(instance->eventQueue == NULL); + ASSERT (instance->packetQueue == NULL); + OvsFreeMemoryWithTag(instance, OVS_DATAPATH_POOL_TAG); +} + +NTSTATUS +OvsCompleteIrpRequest(PIRP irp, + ULONG_PTR infoPtr, + NTSTATUS status) +{ + irp->IoStatus.Information = infoPtr; + irp->IoStatus.Status = status; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return status; +} + + +NTSTATUS +OvsOpenCloseDevice(PDEVICE_OBJECT deviceObject, + PIRP irp) +{ + PIO_STACK_LOCATION irpSp; + NTSTATUS status = STATUS_SUCCESS; + PFILE_OBJECT fileObject; + POVS_DEVICE_EXTENSION ovsExt = + (POVS_DEVICE_EXTENSION)NdisGetDeviceReservedExtension(deviceObject); + + ASSERT(deviceObject == gOvsDeviceObject); + ASSERT(ovsExt != NULL); + + irpSp = IoGetCurrentIrpStackLocation(irp); + fileObject = irpSp->FileObject; + OVS_LOG_TRACE("DeviceObject: %p, fileObject:%p, instance: %u", + deviceObject, fileObject, + ovsExt->numberOpenInstance); + + switch (irpSp->MajorFunction) { + case IRP_MJ_CREATE: + status = OvsAddOpenInstance(ovsExt, fileObject); + if (STATUS_SUCCESS == status) { + InterlockedIncrement((LONG volatile *)&ovsExt->numberOpenInstance); + } + break; + case IRP_MJ_CLOSE: + ASSERT(ovsExt->numberOpenInstance > 0); + OvsRemoveOpenInstance(fileObject); + InterlockedDecrement((LONG volatile *)&ovsExt->numberOpenInstance); + break; + default: + ASSERT(0); + } + return OvsCompleteIrpRequest(irp, (ULONG_PTR)0, status); +} + +_Use_decl_annotations_ +NTSTATUS +OvsCleanupDevice(PDEVICE_OBJECT deviceObject, + PIRP irp) +{ + + PIO_STACK_LOCATION irpSp; + PFILE_OBJECT fileObject; + + NTSTATUS status = STATUS_SUCCESS; +#ifdef DBG + POVS_DEVICE_EXTENSION ovsExt = + (POVS_DEVICE_EXTENSION)NdisGetDeviceReservedExtension(deviceObject); + if (ovsExt) { + ASSERT(ovsExt->numberOpenInstance > 0); + } +#else + UNREFERENCED_PARAMETER(deviceObject); +#endif + ASSERT(deviceObject == gOvsDeviceObject); + irpSp = IoGetCurrentIrpStackLocation(irp); + fileObject = irpSp->FileObject; + + ASSERT(irpSp->MajorFunction == IRP_MJ_CLEANUP); + + OvsCleanupOpenInstance(fileObject); + + return OvsCompleteIrpRequest(irp, (ULONG_PTR)0, status); +} + +/* + * -------------------------------------------------------------------------- + * IOCTL function handler for the device. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsDeviceControl(PDEVICE_OBJECT deviceObject, + PIRP irp) +{ + PIO_STACK_LOCATION irpSp; + NTSTATUS status = STATUS_SUCCESS; + PFILE_OBJECT fileObject; + PVOID inputBuffer = NULL; + PVOID outputBuffer = NULL; + UINT32 inputBufferLen, outputBufferLen; + UINT32 code, replyLen = 0; + POVS_OPEN_INSTANCE instance; + UINT32 devOp; + OVS_MESSAGE ovsMsgReadOp; + POVS_MESSAGE ovsMsg; + NETLINK_FAMILY *nlFamilyOps; + OVS_USER_PARAMS_CONTEXT usrParamsCtx; + +#ifdef DBG + POVS_DEVICE_EXTENSION ovsExt = + (POVS_DEVICE_EXTENSION)NdisGetDeviceReservedExtension(deviceObject); + ASSERT(deviceObject == gOvsDeviceObject); + ASSERT(ovsExt); + ASSERT(ovsExt->numberOpenInstance > 0); +#else + UNREFERENCED_PARAMETER(deviceObject); +#endif + + irpSp = IoGetCurrentIrpStackLocation(irp); + + ASSERT(irpSp->MajorFunction == IRP_MJ_DEVICE_CONTROL); + ASSERT(irpSp->FileObject != NULL); + + fileObject = irpSp->FileObject; + instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + code = irpSp->Parameters.DeviceIoControl.IoControlCode; + inputBufferLen = irpSp->Parameters.DeviceIoControl.InputBufferLength; + outputBufferLen = irpSp->Parameters.DeviceIoControl.OutputBufferLength; + inputBuffer = irp->AssociatedIrp.SystemBuffer; + + /* Check if the extension is enabled. */ + if (NULL == gOvsSwitchContext) { + status = STATUS_NOT_FOUND; + goto exit; + } + + if (!OvsAcquireSwitchContext()) { + status = STATUS_NOT_FOUND; + goto exit; + } + + /* + * Validate the input/output buffer arguments depending on the type of the + * operation. + */ + switch (code) { + case OVS_IOCTL_GET_PID: + /* Both input buffer and output buffer use the same location. */ + outputBuffer = irp->AssociatedIrp.SystemBuffer; + if (outputBufferLen != 0) { + InitUserParamsCtx(irp, instance, 0, NULL, + inputBuffer, inputBufferLen, + outputBuffer, outputBufferLen, + &usrParamsCtx); + + ASSERT(outputBuffer); + } else { + status = STATUS_NDIS_INVALID_LENGTH; + goto done; + } + + status = OvsGetPidHandler(&usrParamsCtx, &replyLen); + goto done; + + case OVS_IOCTL_TRANSACT: + /* Both input buffer and output buffer are mandatory. */ + if (outputBufferLen != 0) { + status = MapIrpOutputBuffer(irp, outputBufferLen, + sizeof *ovsMsg, &outputBuffer); + if (status != STATUS_SUCCESS) { + goto done; + } + ASSERT(outputBuffer); + } else { + status = STATUS_NDIS_INVALID_LENGTH; + goto done; + } + + if (inputBufferLen < sizeof (*ovsMsg)) { + status = STATUS_NDIS_INVALID_LENGTH; + goto done; + } + + ovsMsg = inputBuffer; + devOp = OVS_TRANSACTION_DEV_OP; + break; + + case OVS_IOCTL_READ_EVENT: + case OVS_IOCTL_READ_PACKET: + /* + * Output buffer is mandatory. These IOCTLs are used to read events and + * packets respectively. It is convenient to have separate ioctls. + */ + if (outputBufferLen != 0) { + status = MapIrpOutputBuffer(irp, outputBufferLen, + sizeof *ovsMsg, &outputBuffer); + if (status != STATUS_SUCCESS) { + goto done; + } + ASSERT(outputBuffer); + } else { + status = STATUS_NDIS_INVALID_LENGTH; + goto done; + } + inputBuffer = NULL; + inputBufferLen = 0; + + ovsMsg = &ovsMsgReadOp; + RtlZeroMemory(ovsMsg, sizeof *ovsMsg); + ovsMsg->nlMsg.nlmsgLen = sizeof *ovsMsg; + ovsMsg->nlMsg.nlmsgType = nlControlFamilyOps.id; + ovsMsg->nlMsg.nlmsgPid = instance->pid; + + /* An "artificial" command so we can use NL family function table*/ + ovsMsg->genlMsg.cmd = (code == OVS_IOCTL_READ_EVENT) ? + OVS_CTRL_CMD_EVENT_NOTIFY : + OVS_CTRL_CMD_READ_NOTIFY; + ovsMsg->genlMsg.version = nlControlFamilyOps.version; + + devOp = OVS_READ_DEV_OP; + break; + + case OVS_IOCTL_READ: + /* Output buffer is mandatory. */ + if (outputBufferLen != 0) { + status = MapIrpOutputBuffer(irp, outputBufferLen, + sizeof *ovsMsg, &outputBuffer); + if (status != STATUS_SUCCESS) { + goto done; + } + ASSERT(outputBuffer); + } else { + status = STATUS_NDIS_INVALID_LENGTH; + goto done; + } + + /* + * Operate in the mode that read ioctl is similar to ReadFile(). This + * might change as the userspace code gets implemented. + */ + inputBuffer = NULL; + inputBufferLen = 0; + + /* + * For implementing read (ioctl or otherwise), we need to store some + * state in the instance to indicate the command that started the dump + * operation. The state can setup 'ovsMsgReadOp' appropriately. Note + * that 'ovsMsgReadOp' is needed only in this function to call into the + * appropriate handler. The handler itself can access the state in the + * instance. + * + * In the absence of a dump start, return 0 bytes. + */ + if (instance->dumpState.ovsMsg == NULL) { + replyLen = 0; + status = STATUS_SUCCESS; + goto done; + } + RtlCopyMemory(&ovsMsgReadOp, instance->dumpState.ovsMsg, + sizeof (ovsMsgReadOp)); + + /* Create an NL message for consumption. */ + ovsMsg = &ovsMsgReadOp; + devOp = OVS_READ_DEV_OP; + + break; + + case OVS_IOCTL_WRITE: + /* Input buffer is mandatory. */ + if (inputBufferLen < sizeof (*ovsMsg)) { + status = STATUS_NDIS_INVALID_LENGTH; + goto done; + } + + ovsMsg = inputBuffer; + devOp = OVS_WRITE_DEV_OP; + break; + + default: + status = STATUS_INVALID_DEVICE_REQUEST; + goto done; + } + + ASSERT(ovsMsg); + switch (ovsMsg->nlMsg.nlmsgType) { + case OVS_WIN_NL_CTRL_FAMILY_ID: + nlFamilyOps = &nlControlFamilyOps; + break; + case OVS_WIN_NL_DATAPATH_FAMILY_ID: + nlFamilyOps = &nlDatapathFamilyOps; + break; + case OVS_WIN_NL_FLOW_FAMILY_ID: + nlFamilyOps = &nlFLowFamilyOps; + break; + case OVS_WIN_NL_PACKET_FAMILY_ID: + nlFamilyOps = &nlPacketFamilyOps; + break; + case OVS_WIN_NL_VPORT_FAMILY_ID: + nlFamilyOps = &nlVportFamilyOps; + break; + case OVS_WIN_NL_NETDEV_FAMILY_ID: + nlFamilyOps = &nlNetdevFamilyOps; + break; + default: + status = STATUS_INVALID_PARAMETER; + goto done; + } + + /* + * For read operation, avoid duplicate validation since 'ovsMsg' is either + * "artificial" or was copied from a previously validated 'ovsMsg'. + */ + if (devOp != OVS_READ_DEV_OP) { + status = ValidateNetlinkCmd(devOp, instance, ovsMsg, nlFamilyOps); + if (status != STATUS_SUCCESS) { + goto done; + } + } + + InitUserParamsCtx(irp, instance, devOp, ovsMsg, + inputBuffer, inputBufferLen, + outputBuffer, outputBufferLen, + &usrParamsCtx); + + status = InvokeNetlinkCmdHandler(&usrParamsCtx, nlFamilyOps, &replyLen); + +done: + OvsReleaseSwitchContext(gOvsSwitchContext); + +exit: + /* Should not complete a pending IRP unless proceesing is completed. */ + if (status == STATUS_PENDING) { + /* STATUS_PENDING is returned by the NL handler when the request is + * to be processed later, so we mark the IRP as pending and complete + * it in another thread when the request is processed. */ + IoMarkIrpPending(irp); + return status; + } + return OvsCompleteIrpRequest(irp, (ULONG_PTR)replyLen, status); +} + + +/* + * -------------------------------------------------------------------------- + * Function to validate a netlink command. Only certain combinations of + * (device operation, netlink family, command) are valid. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +ValidateNetlinkCmd(UINT32 devOp, + POVS_OPEN_INSTANCE instance, + POVS_MESSAGE ovsMsg, + NETLINK_FAMILY *nlFamilyOps) +{ + NTSTATUS status = STATUS_INVALID_PARAMETER; + UINT16 i; + + for (i = 0; i < nlFamilyOps->opsCount; i++) { + if (nlFamilyOps->cmds[i].cmd == ovsMsg->genlMsg.cmd) { + /* Validate if the command is valid for the device operation. */ + if ((devOp & nlFamilyOps->cmds[i].supportedDevOp) == 0) { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + /* Validate the version. */ + if (nlFamilyOps->version > ovsMsg->genlMsg.version) { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + /* Validate the DP for commands that require a DP. */ + if (nlFamilyOps->cmds[i].validateDpIndex == TRUE) { + if (ovsMsg->ovsHdr.dp_ifindex != + (INT)gOvsSwitchContext->dpNo) { + status = STATUS_INVALID_PARAMETER; + goto done; + } + } + + /* Validate the PID. */ + if (ovsMsg->nlMsg.nlmsgPid != instance->pid) { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + status = STATUS_SUCCESS; + break; + } + } + +done: + return status; +} + +/* + * -------------------------------------------------------------------------- + * Function to invoke the netlink command handler. The function also stores + * the return value of the handler function to construct a 'NL_ERROR' message, + * and in turn returns success to the caller. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +InvokeNetlinkCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + NETLINK_FAMILY *nlFamilyOps, + UINT32 *replyLen) +{ + NTSTATUS status = STATUS_INVALID_PARAMETER; + UINT16 i; + + for (i = 0; i < nlFamilyOps->opsCount; i++) { + if (nlFamilyOps->cmds[i].cmd == usrParamsCtx->ovsMsg->genlMsg.cmd) { + NetlinkCmdHandler *handler = nlFamilyOps->cmds[i].handler; + ASSERT(handler); + if (handler) { + status = handler(usrParamsCtx, replyLen); + } + break; + } + } + + /* + * Netlink socket semantics dictate that the return value of the netlink + * function should be an error ONLY under fatal conditions. If the message + * made it all the way to the handler function, it is not a fatal condition. + * Absorb the error returned by the handler function into a 'struct + * NL_ERROR' and populate the 'output buffer' to return to userspace. + * + * This behavior is obviously applicable only to netlink commands that + * specify an 'output buffer'. For other commands, we return the error as + * is. + * + * 'STATUS_PENDING' is a special return value and userspace is equipped to + * handle it. + */ + if (status != STATUS_SUCCESS && status != STATUS_PENDING) { + if (usrParamsCtx->devOp != OVS_WRITE_DEV_OP && *replyLen == 0) { + NL_ERROR nlError = NlMapStatusToNlErr(status); + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + + ASSERT(msgError); + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + + if (*replyLen != 0) { + status = STATUS_SUCCESS; + } + } + +#ifdef DBG + if (usrParamsCtx->devOp != OVS_WRITE_DEV_OP) { + ASSERT(status == STATUS_PENDING || *replyLen != 0 || status == STATUS_SUCCESS); + } +#endif + + return status; +} + +/* + * -------------------------------------------------------------------------- + * Handler for 'OVS_IOCTL_GET_PID'. + * + * Each handle on the device is assigned a unique PID when the handle is + * created. This function passes the PID to userspace using METHOD_BUFFERED + * method. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsGetPidHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS status = STATUS_SUCCESS; + PUINT32 msgOut = (PUINT32)usrParamsCtx->outputBuffer; + + if (usrParamsCtx->outputLength >= sizeof *msgOut) { + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + + RtlZeroMemory(msgOut, sizeof *msgOut); + RtlCopyMemory(msgOut, &instance->pid, sizeof(*msgOut)); + *replyLen = sizeof *msgOut; + } else { + *replyLen = sizeof *msgOut; + status = STATUS_NDIS_INVALID_LENGTH; + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * Utility function to fill up information about the datapath in a reply to + * userspace. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsDpFillInfo(POVS_SWITCH_CONTEXT ovsSwitchContext, + POVS_MESSAGE msgIn, + PNL_BUFFER nlBuf) +{ + BOOLEAN writeOk; + OVS_MESSAGE msgOutTmp; + OVS_DATAPATH *datapath = &ovsSwitchContext->datapath; + PNL_MSG_HDR nlMsg; + + ASSERT(NlBufAt(nlBuf, 0, 0) != 0 && NlBufRemLen(nlBuf) >= sizeof *msgIn); + + msgOutTmp.nlMsg.nlmsgType = OVS_WIN_NL_DATAPATH_FAMILY_ID; + msgOutTmp.nlMsg.nlmsgFlags = 0; /* XXX: ? */ + msgOutTmp.nlMsg.nlmsgSeq = msgIn->nlMsg.nlmsgSeq; + msgOutTmp.nlMsg.nlmsgPid = msgIn->nlMsg.nlmsgPid; + + msgOutTmp.genlMsg.cmd = OVS_DP_CMD_GET; + msgOutTmp.genlMsg.version = nlDatapathFamilyOps.version; + msgOutTmp.genlMsg.reserved = 0; + + msgOutTmp.ovsHdr.dp_ifindex = ovsSwitchContext->dpNo; + + writeOk = NlMsgPutHead(nlBuf, (PCHAR)&msgOutTmp, sizeof msgOutTmp); + if (writeOk) { + writeOk = NlMsgPutTailString(nlBuf, OVS_DP_ATTR_NAME, + OVS_SYSTEM_DP_NAME); + } + if (writeOk) { + OVS_DP_STATS dpStats; + + dpStats.n_hit = datapath->hits; + dpStats.n_missed = datapath->misses; + dpStats.n_lost = datapath->lost; + dpStats.n_flows = datapath->nFlows; + writeOk = NlMsgPutTailUnspec(nlBuf, OVS_DP_ATTR_STATS, + (PCHAR)&dpStats, sizeof dpStats); + } + nlMsg = (PNL_MSG_HDR)NlBufAt(nlBuf, 0, 0); + nlMsg->nlmsgLen = NlBufSize(nlBuf); + + return writeOk ? STATUS_SUCCESS : STATUS_INVALID_BUFFER_SIZE; +} + +/* + * -------------------------------------------------------------------------- + * Handler for queueing an IRP used for event notification. The IRP is + * completed when a port state changes. STATUS_PENDING is returned on + * success. User mode keep a pending IRP at all times. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsPendEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NDIS_STATUS status; + + UNREFERENCED_PARAMETER(replyLen); + + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + OVS_EVENT_POLL poll; + + poll.dpNo = msgIn->ovsHdr.dp_ifindex; + status = OvsWaitEventIoctl(usrParamsCtx->irp, instance->fileObject, + &poll, sizeof poll); + return status; +} + +/* + * -------------------------------------------------------------------------- + * Handler for the subscription for the event queue + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsSubscribeEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NDIS_STATUS status; + OVS_EVENT_SUBSCRIBE request; + BOOLEAN rc; + UINT8 join; + PNL_ATTR attrs[2]; + const NL_POLICY policy[] = { + [OVS_NL_ATTR_MCAST_GRP] = {.type = NL_A_U32 }, + [OVS_NL_ATTR_MCAST_JOIN] = {.type = NL_A_U8 }, + }; + + UNREFERENCED_PARAMETER(replyLen); + + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + + rc = NlAttrParse(&msgIn->nlMsg, sizeof (*msgIn), + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), policy, attrs, ARRAY_SIZE(attrs)); + if (!rc) { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + /* XXX Ignore the MC group for now */ + join = NlAttrGetU8(attrs[OVS_NL_ATTR_MCAST_JOIN]); + request.dpNo = msgIn->ovsHdr.dp_ifindex; + request.subscribe = join; + request.mask = OVS_EVENT_MASK_ALL; + + status = OvsSubscribeEventIoctl(instance->fileObject, &request, + sizeof request); +done: + return status; +} + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_DP_CMD_NEW'. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsNewDpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + return HandleDpTransactionCommon(usrParamsCtx, replyLen); +} + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_DP_CMD_GET'. + * + * The function handles both the dump based as well as the transaction based + * 'OVS_DP_CMD_GET' command. In the dump command, it handles the initial + * call to setup dump state, as well as subsequent calls to continue dumping + * data. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsGetDpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + if (usrParamsCtx->devOp == OVS_TRANSACTION_DEV_OP) { + return HandleDpTransactionCommon(usrParamsCtx, replyLen); + } else { + return HandleGetDpDump(usrParamsCtx, replyLen); + } +} + +/* + * -------------------------------------------------------------------------- + * Function for handling the transaction based 'OVS_DP_CMD_GET' command. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +HandleGetDpTransaction(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + return HandleDpTransactionCommon(usrParamsCtx, replyLen); +} + + +/* + * -------------------------------------------------------------------------- + * Function for handling the dump-based 'OVS_DP_CMD_GET' command. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +HandleGetDpDump(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + + if (usrParamsCtx->devOp == OVS_WRITE_DEV_OP) { + *replyLen = 0; + OvsSetupDumpStart(usrParamsCtx); + } else { + NL_BUFFER nlBuf; + NTSTATUS status; + POVS_MESSAGE msgIn = instance->dumpState.ovsMsg; + + ASSERT(usrParamsCtx->devOp == OVS_READ_DEV_OP); + + if (instance->dumpState.ovsMsg == NULL) { + ASSERT(FALSE); + return STATUS_INVALID_DEVICE_STATE; + } + + /* Dump state must have been deleted after previous dump operation. */ + ASSERT(instance->dumpState.index[0] == 0); + + /* Output buffer has been validated while validating read dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength); + + status = OvsDpFillInfo(gOvsSwitchContext, msgIn, &nlBuf); + + if (status != STATUS_SUCCESS) { + *replyLen = 0; + FreeUserDumpState(instance); + return status; + } + + /* Increment the dump index. */ + instance->dumpState.index[0] = 1; + *replyLen = msgOut->nlMsg.nlmsgLen; + + /* Free up the dump state, since there's no more data to continue. */ + FreeUserDumpState(instance); + } + + return STATUS_SUCCESS; +} + + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_DP_CMD_SET'. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsSetDpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + return HandleDpTransactionCommon(usrParamsCtx, replyLen); +} + +/* + * -------------------------------------------------------------------------- + * Function for handling transaction based 'OVS_DP_CMD_NEW', 'OVS_DP_CMD_GET' + * and 'OVS_DP_CMD_SET' commands. + * + * 'OVS_DP_CMD_NEW' is implemented to keep userspace code happy. Creation of a + * new datapath is not supported currently. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +HandleDpTransactionCommon(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + NTSTATUS status = STATUS_SUCCESS; + NL_BUFFER nlBuf; + NL_ERROR nlError = NL_ERROR_SUCCESS; + static const NL_POLICY ovsDatapathSetPolicy[] = { + [OVS_DP_ATTR_NAME] = { .type = NL_A_STRING, .maxLen = IFNAMSIZ }, + [OVS_DP_ATTR_UPCALL_PID] = { .type = NL_A_U32, .optional = TRUE }, + [OVS_DP_ATTR_USER_FEATURES] = { .type = NL_A_U32, .optional = TRUE }, + }; + PNL_ATTR dpAttrs[ARRAY_SIZE(ovsDatapathSetPolicy)]; + + UNREFERENCED_PARAMETER(msgOut); + + /* input buffer has been validated while validating write dev op. */ + ASSERT(msgIn != NULL && usrParamsCtx->inputLength >= sizeof *msgIn); + + /* Parse any attributes in the request. */ + if (usrParamsCtx->ovsMsg->genlMsg.cmd == OVS_DP_CMD_SET || + usrParamsCtx->ovsMsg->genlMsg.cmd == OVS_DP_CMD_NEW) { + if (!NlAttrParse((PNL_MSG_HDR)msgIn, + NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), + ovsDatapathSetPolicy, dpAttrs, ARRAY_SIZE(dpAttrs))) { + return STATUS_INVALID_PARAMETER; + } + + /* + * XXX: Not clear at this stage if there's any role for the + * OVS_DP_ATTR_UPCALL_PID and OVS_DP_ATTR_USER_FEATURES attributes passed + * from userspace. + */ + + } else { + RtlZeroMemory(dpAttrs, sizeof dpAttrs); + } + + /* Output buffer has been validated while validating transact dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, usrParamsCtx->outputLength); + + if (dpAttrs[OVS_DP_ATTR_NAME] != NULL) { + if (!OvsCompareString(NlAttrGet(dpAttrs[OVS_DP_ATTR_NAME]), + OVS_SYSTEM_DP_NAME)) { + + /* Creation of new datapaths is not supported. */ + if (usrParamsCtx->ovsMsg->genlMsg.cmd == OVS_DP_CMD_SET) { + nlError = NL_ERROR_NOTSUPP; + goto cleanup; + } + + nlError = NL_ERROR_NODEV; + goto cleanup; + } + } else if ((UINT32)msgIn->ovsHdr.dp_ifindex != gOvsSwitchContext->dpNo) { + nlError = NL_ERROR_NODEV; + goto cleanup; + } + + if (usrParamsCtx->ovsMsg->genlMsg.cmd == OVS_DP_CMD_NEW) { + nlError = NL_ERROR_EXIST; + goto cleanup; + } + + status = OvsDpFillInfo(gOvsSwitchContext, msgIn, &nlBuf); + + *replyLen = NlBufSize(&nlBuf); + +cleanup: + if (nlError != NL_ERROR_SUCCESS) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + + return STATUS_SUCCESS; +} + + +NTSTATUS +OvsSetupDumpStart(POVS_USER_PARAMS_CONTEXT usrParamsCtx) +{ + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + + /* input buffer has been validated while validating write dev op. */ + ASSERT(msgIn != NULL && usrParamsCtx->inputLength >= sizeof *msgIn); + + /* A write operation that does not indicate dump start is invalid. */ + if ((msgIn->nlMsg.nlmsgFlags & NLM_F_DUMP) != NLM_F_DUMP) { + return STATUS_INVALID_PARAMETER; + } + /* XXX: Handle other NLM_F_* flags in the future. */ + + /* + * This operation should be setting up the dump state. If there's any + * previous state, clear it up so as to set it up afresh. + */ + FreeUserDumpState(instance); + + return InitUserDumpState(instance, msgIn); +} + + +/* + * -------------------------------------------------------------------------- + * Utility function to map the output buffer in an IRP. The buffer is assumed + * to have been passed down using METHOD_OUT_DIRECT (Direct I/O). + * -------------------------------------------------------------------------- + */ +static NTSTATUS +MapIrpOutputBuffer(PIRP irp, + UINT32 bufferLength, + UINT32 requiredLength, + PVOID *buffer) +{ + ASSERT(irp); + ASSERT(buffer); + ASSERT(bufferLength); + ASSERT(requiredLength); + if (!buffer || !irp || bufferLength == 0 || requiredLength == 0) { + return STATUS_INVALID_PARAMETER; + } + + if (bufferLength < requiredLength) { + return STATUS_NDIS_INVALID_LENGTH; + } + if (irp->MdlAddress == NULL) { + return STATUS_INVALID_PARAMETER; + } + *buffer = MmGetSystemAddressForMdlSafe(irp->MdlAddress, + NormalPagePriority); + if (*buffer == NULL) { + return STATUS_INSUFFICIENT_RESOURCES; + } + + return STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * Utility function to fill up information about the state of a port in a reply + * to* userspace. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsPortFillInfo(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + POVS_EVENT_ENTRY eventEntry, + PNL_BUFFER nlBuf) +{ + NTSTATUS status; + BOOLEAN ok; + OVS_MESSAGE msgOutTmp; + PNL_MSG_HDR nlMsg; + POVS_VPORT_ENTRY vport; + + ASSERT(NlBufAt(nlBuf, 0, 0) != 0 && nlBuf->bufRemLen >= sizeof msgOutTmp); + + msgOutTmp.nlMsg.nlmsgType = OVS_WIN_NL_VPORT_FAMILY_ID; + msgOutTmp.nlMsg.nlmsgFlags = 0; /* XXX: ? */ + + /* driver intiated messages should have zerp seq number*/ + msgOutTmp.nlMsg.nlmsgSeq = 0; + msgOutTmp.nlMsg.nlmsgPid = usrParamsCtx->ovsInstance->pid; + + msgOutTmp.genlMsg.version = nlVportFamilyOps.version; + msgOutTmp.genlMsg.reserved = 0; + + /* we don't have netdev yet, treat link up/down a adding/removing a port*/ + if (eventEntry->status & (OVS_EVENT_LINK_UP | OVS_EVENT_CONNECT)) { + msgOutTmp.genlMsg.cmd = OVS_VPORT_CMD_NEW; + } else if (eventEntry->status & + (OVS_EVENT_LINK_DOWN | OVS_EVENT_DISCONNECT)) { + msgOutTmp.genlMsg.cmd = OVS_VPORT_CMD_DEL; + } else { + ASSERT(FALSE); + return STATUS_UNSUCCESSFUL; + } + msgOutTmp.ovsHdr.dp_ifindex = gOvsSwitchContext->dpNo; + + ok = NlMsgPutHead(nlBuf, (PCHAR)&msgOutTmp, sizeof msgOutTmp); + if (!ok) { + status = STATUS_INVALID_BUFFER_SIZE; + goto cleanup; + } + + vport = OvsFindVportByPortNo(gOvsSwitchContext, eventEntry->portNo); + if (!vport) { + status = STATUS_DEVICE_DOES_NOT_EXIST; + goto cleanup; + } + + ok = NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_PORT_NO, eventEntry->portNo) && + NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_TYPE, vport->ovsType) && + NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_UPCALL_PID, + vport->upcallPid) && + NlMsgPutTailString(nlBuf, OVS_VPORT_ATTR_NAME, vport->ovsName); + if (!ok) { + status = STATUS_INVALID_BUFFER_SIZE; + goto cleanup; + } + + /* XXXX Should we add the port stats attributes?*/ + nlMsg = (PNL_MSG_HDR)NlBufAt(nlBuf, 0, 0); + nlMsg->nlmsgLen = NlBufSize(nlBuf); + status = STATUS_SUCCESS; + +cleanup: + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Handler for reading events from the driver event queue. This handler is + * executed when user modes issues a socket receive on a socket assocaited + * with the MC group for events. + * XXX user mode should read multiple events in one system call + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsReadEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ +#ifdef DBG + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; +#endif + NL_BUFFER nlBuf; + NTSTATUS status; + OVS_EVENT_ENTRY eventEntry; + + ASSERT(usrParamsCtx->devOp == OVS_READ_DEV_OP); + + /* Should never read events with a dump socket */ + ASSERT(instance->dumpState.ovsMsg == NULL); + + /* Must have an event queue */ + ASSERT(instance->eventQueue != NULL); + + /* Output buffer has been validated while validating read dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, usrParamsCtx->outputLength); + + /* remove an event entry from the event queue */ + status = OvsRemoveEventEntry(usrParamsCtx->ovsInstance, &eventEntry); + if (status != STATUS_SUCCESS) { + /* If there were not elements, read should return no data. */ + status = STATUS_SUCCESS; + *replyLen = 0; + goto cleanup; + } + + status = OvsPortFillInfo(usrParamsCtx, &eventEntry, &nlBuf); + if (status == NDIS_STATUS_SUCCESS) { + *replyLen = NlBufSize(&nlBuf); + } + +cleanup: + return status; +} + +/* + * -------------------------------------------------------------------------- + * Handler for reading missed pacckets from the driver event queue. This + * handler is executed when user modes issues a socket receive on a socket + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsReadPacketCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ +#ifdef DBG + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; +#endif + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + NTSTATUS status; + + ASSERT(usrParamsCtx->devOp == OVS_READ_DEV_OP); + + /* Should never read events with a dump socket */ + ASSERT(instance->dumpState.ovsMsg == NULL); + + /* Must have an packet queue */ + ASSERT(instance->packetQueue != NULL); + + /* Output buffer has been validated while validating read dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + /* Read a packet from the instance queue */ + status = OvsReadDpIoctl(instance->fileObject, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength, replyLen); + return status; +} + +/* + * -------------------------------------------------------------------------- + * Handler for the subscription for a packet queue + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsSubscribePacketCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NDIS_STATUS status; + BOOLEAN rc; + UINT8 join; + UINT32 pid; + const NL_POLICY policy[] = { + [OVS_NL_ATTR_PACKET_PID] = {.type = NL_A_U32 }, + [OVS_NL_ATTR_PACKET_SUBSCRIBE] = {.type = NL_A_U8 } + }; + PNL_ATTR attrs[ARRAY_SIZE(policy)]; + + UNREFERENCED_PARAMETER(replyLen); + + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + + rc = NlAttrParse(&msgIn->nlMsg, sizeof (*msgIn), + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), policy, attrs, ARRAY_SIZE(attrs)); + if (!rc) { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + join = NlAttrGetU8(attrs[OVS_NL_ATTR_PACKET_PID]); + pid = NlAttrGetU32(attrs[OVS_NL_ATTR_PACKET_PID]); + + /* The socket subscribed with must be the same socket we perform receive*/ + ASSERT(pid == instance->pid); + + status = OvsSubscribeDpIoctl(instance, pid, join); + + /* + * XXX Need to add this instance to a global data structure + * which hold all packet based instances. The data structure (hash) + * should be searched through the pid field of the instance for + * placing the missed packet into the correct queue + */ +done: + return status; +} + +/* + * -------------------------------------------------------------------------- + * Handler for queueing an IRP used for missed packet notification. The IRP is + * completed when a packet received and mismatched. STATUS_PENDING is returned + * on success. User mode keep a pending IRP at all times. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsPendPacketCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + UNREFERENCED_PARAMETER(replyLen); + + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + + /* + * XXX access to packet queue must be through acquiring a lock as user mode + * could unsubscribe and the instnace will be freed. + */ + return OvsWaitDpIoctl(usrParamsCtx->irp, instance->fileObject); +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Datapath.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Datapath.h --- openvswitch-2.3.1/datapath-windows/ovsext/Datapath.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Datapath.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * XXX: OVS_USE_NL_INTERFACE is being used to keep the legacy DPIF interface + * alive while we transition over to the netlink based interface. + * OVS_USE_NL_INTERFACE = 0 => legacy inteface to use with dpif-windows.c + * OVS_USE_NL_INTERFACE = 1 => netlink inteface to use with ported dpif-linux.c + */ + +#ifndef __DATAPATH_H_ +#define __DATAPATH_H_ 1 + +/* + * Device operations to tag netlink commands with. This is a bitmask since it + * is possible that a particular command can be invoked via different device + * operations. + */ +#define OVS_READ_DEV_OP (1 << 0) +#define OVS_WRITE_DEV_OP (1 << 1) +#define OVS_TRANSACTION_DEV_OP (1 << 2) + +typedef struct _OVS_DEVICE_EXTENSION { + INT numberOpenInstance; + INT pidCount; +} OVS_DEVICE_EXTENSION, *POVS_DEVICE_EXTENSION; + +// forward declaration +typedef struct _OVS_USER_PACKET_QUEUE OVS_USER_PACKET_QUEUE, + *POVS_USER_PACKET_QUEUE; + +/* + * Private context for each handle on the device. + */ +typedef struct _OVS_OPEN_INSTANCE { + UINT32 cookie; + PFILE_OBJECT fileObject; + PVOID eventQueue; + POVS_USER_PACKET_QUEUE packetQueue; + UINT32 pid; + + struct { + POVS_MESSAGE ovsMsg; /* OVS message passed during dump start. */ + UINT32 index[2]; /* markers to continue dump from. One or more + * of them may be used. Eg. in flow dump, the + * markers can store the row and the column + * indices. */ + } dumpState; /* data to support dump commands. */ + LIST_ENTRY pidLink; /* Links the instance to + * pidHashArray */ +} OVS_OPEN_INSTANCE, *POVS_OPEN_INSTANCE; + +NDIS_STATUS OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle); +VOID OvsDeleteDeviceObject(); +VOID OvsInit(); +VOID OvsCleanup(); + +POVS_OPEN_INSTANCE OvsGetOpenInstance(PFILE_OBJECT fileObject, + UINT32 dpNo); + +NTSTATUS OvsCompleteIrpRequest(PIRP irp, ULONG_PTR infoPtr, NTSTATUS status); + +VOID OvsAcquireCtrlLock(); +VOID OvsReleaseCtrlLock(); + +/* + * Utility structure and functions to collect in one place all the parameters + * passed during a call from userspace. + */ +typedef struct _OVS_USER_PARAMS_CONTEXT { + PIRP irp; /* The IRP used for the userspace call. */ + POVS_OPEN_INSTANCE ovsInstance; /* Private data of the device handle. */ + UINT32 devOp; /* Device operation of the userspace call. */ + POVS_MESSAGE ovsMsg; /* OVS message that userspace passed down. */ + PVOID inputBuffer; /* Input data specified by userspace. Maybe NULL. */ + UINT32 inputLength; /* Length of input buffer. */ + PVOID outputBuffer; /* Output buffer specified by userspace for reading + * data. Maybe NULL. */ + UINT32 outputLength; /* Length of output buffer. */ +} OVS_USER_PARAMS_CONTEXT, *POVS_USER_PARAMS_CONTEXT; + +static __inline VOID +InitUserParamsCtx(PIRP irp, + POVS_OPEN_INSTANCE ovsInstance, + UINT32 devOp, + POVS_MESSAGE ovsMsg, + PVOID inputBuffer, + UINT32 inputLength, + PVOID outputBuffer, + UINT32 outputLength, + POVS_USER_PARAMS_CONTEXT usrParamsCtx) +{ + usrParamsCtx->irp = irp; + usrParamsCtx->ovsInstance = ovsInstance; + usrParamsCtx->devOp = devOp; + usrParamsCtx->ovsMsg = ovsMsg; + usrParamsCtx->inputBuffer = inputBuffer; + usrParamsCtx->inputLength = inputLength; + usrParamsCtx->outputBuffer = outputBuffer; + usrParamsCtx->outputLength = outputLength; +} + +NTSTATUS InitUserDumpState(POVS_OPEN_INSTANCE instance, + POVS_MESSAGE ovsMsg); + +VOID FreeUserDumpState(POVS_OPEN_INSTANCE instance); + +NTSTATUS OvsSetupDumpStart(POVS_USER_PARAMS_CONTEXT usrParamsCtx); + +#endif /* __DATAPATH_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Debug.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Debug.c --- openvswitch-2.3.1/datapath-windows/ovsext/Debug.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Debug.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" + +#include "Debug.h" +#ifdef DBG +#define OVS_DBG_DEFAULT OVS_DBG_INFO +#else +#define OVS_DBG_DEFAULT OVS_DBG_ERROR +#endif + +UINT32 ovsLogFlags = 0xffffffff; +UINT32 ovsLogLevel = OVS_DBG_DEFAULT; + +#define OVS_LOG_BUFFER_SIZE 384 + +/* + * -------------------------------------------------------------------------- + * OvsLog -- + * Utility function to log to the Windows debug console. + * -------------------------------------------------------------------------- + */ +VOID +OvsLog(UINT32 level, + UINT32 flag, + CHAR *funcName, + UINT32 line, + CHAR *format, + ...) +{ + va_list args; + CHAR buf[OVS_LOG_BUFFER_SIZE]; + + if (level > ovsLogLevel || (ovsLogFlags & flag) == 0) { + return; + } + + buf[0] = 0; + va_start(args, format); + RtlStringCbVPrintfA(buf, sizeof (buf), format, args); + va_end(args); + + DbgPrintEx(DPFLTR_IHVNETWORK_ID, level, "%s:%lu %s\n", funcName, line, buf); +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Debug.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Debug.h --- openvswitch-2.3.1/datapath-windows/ovsext/Debug.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Debug.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __DEBUG_H_ +#define __DEBUG_H_ 1 + +#define OVS_DBG_INIT BIT32(0) +#define OVS_DBG_SWITCH BIT32(1) +#define OVS_DBG_VPORT BIT32(2) +#define OVS_DBG_FLOW BIT32(3) +#define OVS_DBG_QOS BIT32(4) +#define OVS_DBG_USER BIT32(5) +#define OVS_DBG_EXECUTE BIT32(6) +#define OVS_DBG_EVENT BIT32(7) +#define OVS_DBG_DISPATCH BIT32(8) +#define OVS_DBG_OID BIT32(9) +#define OVS_DBG_STATUS BIT32(10) +#define OVS_DBG_CHECKSUM BIT32(11) +#define OVS_DBG_VXLAN BIT32(12) +#define OVS_DBG_GRE BIT32(13) +#define OVS_DBG_GRE64 BIT32(14) +#define OVS_DBG_ACTION BIT32(15) +#define OVS_DBG_DATAPATH BIT32(16) +#define OVS_DBG_PROPERTY BIT32(17) +#define OVS_DBG_IPHELPER BIT32(18) +#define OVS_DBG_BUFMGMT BIT32(19) +#define OVS_DBG_OTHERS BIT32(21) +#define OVS_DBG_NETLINK BIT32(22) +#define OVS_DBG_TUNFLT BIT32(23) +#define OVS_DBG_STT BIT32(24) + +#define OVS_DBG_RESERVED BIT32(31) +//Please add above OVS_DBG_RESERVED. + +#define OVS_DBG_ERROR DPFLTR_ERROR_LEVEL +#define OVS_DBG_WARN DPFLTR_WARNING_LEVEL +#define OVS_DBG_TRACE DPFLTR_TRACE_LEVEL +#define OVS_DBG_INFO DPFLTR_INFO_LEVEL +#define OVS_DBG_LOUD (DPFLTR_INFO_LEVEL + 1) + + + +VOID OvsLog(UINT32 level, UINT32 flag, CHAR *funcName, + UINT32 line, CHAR *format, ...); + + +#define OVS_LOG_LOUD(_format, ...) \ + OvsLog(OVS_DBG_LOUD, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__) + +#define OVS_LOG_INFO(_format, ...) \ + OvsLog(OVS_DBG_INFO, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__) + +#define OVS_LOG_TRACE(_format, ...) \ + OvsLog(OVS_DBG_TRACE, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__) + +#define OVS_LOG_ERROR(_format, ...) \ + OvsLog(OVS_DBG_ERROR, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__) + +#define OVS_LOG_WARN(_format, ...) \ + OvsLog(OVS_DBG_WARN, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__) + +#if DBG +#define OVS_VERIFY_IRQL(_x) \ + if (KeGetCurrentIrql() != (KIRQL)_x) { \ + OVS_LOG_WARN("expected IRQL %u, actual IRQL: %u", \ + _x, KeGetCurrentIrql()); \ + } + +#define OVS_VERIFY_IRQL_LE(_x) \ + if (KeGetCurrentIrql() > (KIRQL)_x) { \ + OVS_LOG_WARN("expected IRQL <= %u, actual IRQL: %u", \ + _x, KeGetCurrentIrql()); \ + } + +#else +#define OVS_VERIFY_IRQL(_x) +#define OVS_VERIFY_IRQL_LE(_x) +#endif + +#endif /* __DEBUG_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/DpInternal.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/DpInternal.h --- openvswitch-2.3.1/datapath-windows/ovsext/DpInternal.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/DpInternal.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __DP_INTERNAL_H_ +#define __DP_INTERNAL_H_ 1 + +#include +#define IFNAMSIZ IF_NAMESIZE +#include "../ovsext/Netlink/Netlink.h" + +#define OVS_DP_NUMBER ((uint32_t) 0) + +typedef __declspec(align(8)) uint64_t Ovs64AlignedU64; +typedef __declspec(align(8)) ovs_be64 Ovs64AlignedBe64; +#pragma pack(push, 1) + +#define OVS_MAX_PORT_NAME_LENGTH IFNAMSIZ + +typedef struct _OVS_VPORT_GET { + uint32_t dpNo; + uint32_t portNo; + char name[OVS_MAX_PORT_NAME_LENGTH]; +} OVS_VPORT_GET, *POVS_VPORT_GET; + +#define OVS_MAX_VM_UUID_LEN 128 +#define OVS_MAX_VIF_UUID_LEN 128 + +typedef struct _OVS_VPORT_EXT_INFO { + uint32_t dpNo; + uint32_t portNo; + uint8_t macAddress[ETH_ADDR_LEN]; + uint8_t permMACAddress[ETH_ADDR_LEN]; + uint8_t vmMACAddress[ETH_ADDR_LEN]; + uint16_t nicIndex; + uint32_t portId; + uint32_t type; + uint32_t mtu; + char name[OVS_MAX_PORT_NAME_LENGTH]; + uint32_t status; + char vmUUID[OVS_MAX_VM_UUID_LEN]; + char vifUUID[OVS_MAX_VIF_UUID_LEN]; +} OVS_VPORT_EXT_INFO, *POVS_VPORT_EXT_INFO; + + +/* Flows. */ +#define OVSWIN_VLAN_CFI 0x1000 + +/* Used for OvsFlowKey's dlType member for frames that have no Ethernet type, + * that is, pure 802.2 frames. */ +#define OVSWIN_DL_TYPE_NONE 0x5ff + +/* Fragment bits, used for IPv4 and IPv6, always zero for non-IP flows. */ +#define OVSWIN_NW_FRAG_ANY (1 << 0) /* Set for any IP frag. */ +#define OVSWIN_NW_FRAG_LATER (1 << 1) /* Set for IP frag with nonzero + * offset. */ +#define OVSWIN_NW_FRAG_MASK (OVSWIN_NW_FRAG_ANY | OVSWIN_NW_FRAG_LATER) + +typedef struct L4Key { + ovs_be16 tpSrc; /* TCP/UDP/SCTP source port. */ + ovs_be16 tpDst; /* TCP/UDP/SCTP destination port. */ +} L4Key; + +typedef struct Ipkey { + ovs_be32 nwSrc; /* IPv4 source address. */ + ovs_be32 nwDst; /* IPv4 destination address. */ + uint8_t nwProto; /* IP protocol or low 8 bits of ARP opcode. */ + uint8_t nwTos; /* IP ToS (including DSCP and ECN). */ + uint8_t nwTtl; /* IP TTL/Hop Limit. */ + uint8_t nwFrag; /* FLOW_FRAG_* flags. */ + L4Key l4; +} IpKey; /* Size of 16 byte. */ + +typedef struct ArpKey { + ovs_be32 nwSrc; /* IPv4 source address. */ + ovs_be32 nwDst; /* IPv4 destination address. */ + uint8_t arpSha[6]; /* ARP/ND source hardware address. */ + uint8_t arpTha[6]; /* ARP/ND target hardware address. */ + uint8_t nwProto; /* IP protocol or low 8 bits of ARP opcode. */ + uint8_t pad[3]; +} ArpKey; /* Size of 24 byte. */ + +typedef struct Ipv6Key { + struct in6_addr ipv6Src; /* IPv6 source address. */ + struct in6_addr ipv6Dst; /* IPv6 destination address. */ + ovs_be32 ipv6Label; /* IPv6 flow label. */ + uint8_t nwProto; /* IP protocol or low 8 bits of ARP opcode. */ + uint8_t nwTos; /* IP ToS (including DSCP and ECN). */ + uint8_t nwTtl; /* IP TTL/Hop Limit. */ + uint8_t nwFrag; /* FLOW_FRAG_* flags. */ + L4Key l4; + uint32_t pad; +} Ipv6Key; /* Size of 48 byte. */ + +typedef struct Icmp6Key { + struct in6_addr ipv6Src; /* IPv6 source address. */ + struct in6_addr ipv6Dst; /* IPv6 destination address. */ + ovs_be32 ipv6Label; /* IPv6 flow label. */ + uint8_t nwProto; /* IP protocol or low 8 bits of ARP opcode. */ + uint8_t nwTos; /* IP ToS (including DSCP and ECN). */ + uint8_t nwTtl; /* IP TTL/Hop Limit. */ + uint8_t nwFrag; /* FLOW_FRAG_* flags. */ + L4Key l4; + uint8_t arpSha[6]; /* ARP/ND source hardware address. */ + uint8_t arpTha[6]; /* ARP/ND target hardware address. */ + struct in6_addr ndTarget; /* IPv6 neighbor discovery (ND) target. */ +} Icmp6Key; /* Size of 72 byte. */ + +typedef struct L2Key { + uint32_t inPort; /* Port number of input port. */ + union { + struct { + uint16_t offset; + uint16_t keyLen; + }; + uint32_t val; + }; + uint8_t dlSrc[6]; /* Ethernet source address. */ + uint8_t dlDst[6]; /* Ethernet destination address. */ + ovs_be16 vlanTci; /* If 802.1Q, TCI | VLAN_CFI; otherwise 0. */ + ovs_be16 dlType; /* Ethernet frame type. */ +} L2Key; /* Size of 24 byte. */ + +/* Number of packet attributes required to store OVS tunnel key. */ +#define NUM_PKT_ATTR_REQUIRED 3 + +typedef union OvsIPv4TunnelKey { + struct { + ovs_be32 dst; + ovs_be32 src; + ovs_be64 tunnelId; + uint16_t flags; + uint8_t tos; + uint8_t ttl; + union { + uint32_t pad; + struct { + ovs_be16 dst_port; + uint16_t flow_hash; + }; + }; + }; + uint64_t attr[NUM_PKT_ATTR_REQUIRED]; +} OvsIPv4TunnelKey; + +typedef __declspec(align(8)) struct OvsFlowKey { + OvsIPv4TunnelKey tunKey; /* 24 bytes */ + L2Key l2; /* 24 bytes */ + union { + IpKey ipKey; /* size 16 */ + ArpKey arpKey; /* size 24 */ + Ipv6Key ipv6Key; /* size 48 */ + Icmp6Key icmp6Key; /* size 72 */ + }; +} OvsFlowKey; + +#define OVS_WIN_TUNNEL_KEY_SIZE (sizeof (OvsIPv4TunnelKey)) +#define OVS_L2_KEY_SIZE (sizeof (L2Key)) +#define OVS_IP_KEY_SIZE (sizeof (IpKey)) +#define OVS_IPV6_KEY_SIZE (sizeof (Ipv6Key)) +#define OVS_ARP_KEY_SIZE (sizeof (ArpKey)) +#define OVS_ICMPV6_KEY_SIZE (sizeof (Icmp6Key)) + +typedef struct OvsFlowStats { + Ovs64AlignedU64 packetCount; + Ovs64AlignedU64 byteCount; + uint32_t used; + uint8_t tcpFlags; +} OvsFlowStats; + +typedef struct OvsFlowInfo { + OvsFlowKey key; + struct OvsFlowStats stats; + uint32_t actionsLen; + PNL_ATTR actions; +} OvsFlowInfo; + +enum GetFlags { + FLOW_GET_KEY = 0x00000001, + FLOW_GET_STATS = 0x00000010, + FLOW_GET_ACTIONS = 0x00000100, +}; + +typedef struct OvsFlowDumpInput { + uint32_t dpNo; + uint32_t position[2]; /* Offset hint to the start of flow dump. */ + /* 0 - index of the hash table. + * 1 - nth element in the hash table index. */ + uint32_t getFlags; /* Information to get in addition to keys. */ + uint32_t actionsLen; +} OvsFlowDumpInput; + + +typedef struct OvsFlowDumpOutput { + /* Hint for the next flow dump operation. */ + uint32_t position[2]; + + /* #flows (currently 0 or 1). In case the buffer is too small to output all + * actions, this field indicates actual size needed to dump all actions. */ + uint32_t n; + + OvsFlowInfo flow; +} OvsFlowDumpOutput; + +typedef struct OvsFlowGetInput { + uint32_t dpNo; + OvsFlowKey key; + uint32_t getFlags; /* Information to get in addition to keys. */ + uint32_t actionsLen; /* Sizeof of buffer for actions. */ +} OvsFlowGetInput; + +typedef struct OvsFlowGetOutput { + OvsFlowInfo info; /* Variable length. */ +} OvsFlowGetOutput; + + +typedef enum OvsFlowPutFlags { + OVSWIN_FLOW_PUT_CREATE = 1 << 0, + OVSWIN_FLOW_PUT_MODIFY = 1 << 1, + OVSWIN_FLOW_PUT_DELETE = 1 << 2, + + OVSWIN_FLOW_PUT_CLEAR = 1 << 3 +} OvsFlowPutFlags; + + +typedef struct OvsFlowPut { + uint32_t dpNo; + uint32_t actionsLen; + OvsFlowKey key; + uint32_t flags; + PNL_ATTR actions; +} OvsFlowPut; + +#define OVS_MIN_PACKET_SIZE 60 +typedef struct _OVS_PACKET_INFO { + uint32_t totalLen; + uint32_t userDataLen; + uint32_t packetLen; + uint32_t queue; + uint32_t inPort; + uint32_t cmd; + OvsIPv4TunnelKey tunnelKey; + uint8_t *payload; + /* Includes user data defined as chain of netlink attributes followed by the + * packet data. */ + uint8_t data[0]; +} OVS_PACKET_INFO, *POVS_PACKET_INFO; + +typedef struct OvsPacketExecute { + uint32_t dpNo; + uint32_t inPort; + + uint32_t packetLen; + uint32_t actionsLen; + PCHAR packetBuf; + PNL_ATTR actions; +} OvsPacketExecute; + + +typedef struct _OVS_EVENT_SUBSCRIBE { + uint32_t cookie; + uint32_t dpNo; + uint32_t subscribe; + uint32_t mask; +} OVS_EVENT_SUBSCRIBE, *POVS_EVENT_SUBSCRIBE; + +typedef struct _OVS_EVENT_POLL { + uint32_t cookie; + uint32_t dpNo; +} OVS_EVENT_POLL, *POVS_EVENT_POLL; + +enum { + OVS_EVENT_CONNECT = ((uint32_t)0x1 << 0), + OVS_EVENT_DISCONNECT = ((uint32_t)0x1 << 1), + OVS_EVENT_LINK_UP = ((uint32_t)0x1 << 2), + OVS_EVENT_LINK_DOWN = ((uint32_t)0x1 << 3), + OVS_EVENT_MAC_CHANGE = ((uint32_t)0x1 << 4), + OVS_EVENT_MTU_CHANGE = ((uint32_t)0x1 << 5), + OVS_EVENT_MASK_ALL = 0x3f, +}; + + +typedef struct _OVS_EVENT_ENTRY { + uint32_t portNo; + uint32_t status; +} OVS_EVENT_ENTRY, *POVS_EVENT_ENTRY; + +#define OVS_DEFAULT_PORT_NO 0xffffffff +#define OVS_DEFAULT_EVENT_STATUS 0xffffffff + +typedef struct _OVS_EVENT_STATUS { + uint32_t numberEntries; + OVS_EVENT_ENTRY eventEntries[0]; +} OVS_EVENT_STATUS, *POVS_EVENT_STATUS; + +#pragma pack(pop) + +#endif /* __DP_INTERNAL_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Driver.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Driver.c --- openvswitch-2.3.1/datapath-windows/ovsext/Driver.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Driver.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "Switch.h" +#include "User.h" +#include "Datapath.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_DRIVER +#include "Debug.h" + +/* Global handles. XXX: Some of them need not be global. */ +/* + * Maps to DriverObject and FilterDriverContext parameters in the NDIS filter + * driver functions. + * DriverObject is specified by NDIS. + * FilterDriverContext is specified by the filter driver. + */ +NDIS_HANDLE gOvsExtDriverObject; + +/* + * Maps to NdisFilterHandle parameter in the NDIS filter driver functions. + * NdisFilterHandle is returned by NDISFRegisterFilterDriver. + */ +NDIS_HANDLE gOvsExtDriverHandle; + +/* + * Maps to FilterModuleContext parameter in the NDIS filter driver functions. + * FilterModuleContext is a allocated by the driver in the FilterAttach + * function. + */ +extern POVS_SWITCH_CONTEXT gOvsSwitchContext; + +static PWCHAR ovsExtFriendlyName = L"Open vSwitch Extension"; +static PWCHAR ovsExtServiceName = L"OVSExt"; +NDIS_STRING ovsExtGuidUC; +NDIS_STRING ovsExtFriendlyNameUC; + +static PWCHAR ovsExtGuidStr = L"{583CC151-73EC-4A6A-8B47-578297AD7623}"; +static const GUID ovsExtGuid = { + 0x583cc151, + 0x73ec, + 0x4a6a, + {0x8b, 0x47, 0x57, 0x82, 0x97, 0xad, 0x76, 0x23} +}; + +/* Declarations of callback functions for the filter driver. */ +DRIVER_UNLOAD OvsExtUnload; +FILTER_NET_PNP_EVENT OvsExtNetPnPEvent; +FILTER_STATUS OvsExtStatus; + +FILTER_ATTACH OvsExtAttach; +FILTER_DETACH OvsExtDetach; +FILTER_RESTART OvsExtRestart; +FILTER_PAUSE OvsExtPause; + +FILTER_SEND_NET_BUFFER_LISTS OvsExtSendNBL; +FILTER_SEND_NET_BUFFER_LISTS_COMPLETE OvsExtSendNBLComplete; +FILTER_CANCEL_SEND_NET_BUFFER_LISTS OvsExtCancelSendNBL; +FILTER_RECEIVE_NET_BUFFER_LISTS OvsExtReceiveNBL; +FILTER_RETURN_NET_BUFFER_LISTS OvsExtReturnNBL; + +FILTER_OID_REQUEST OvsExtOidRequest; +FILTER_OID_REQUEST_COMPLETE OvsExtOidRequestComplete; +FILTER_CANCEL_OID_REQUEST OvsExtCancelOidRequest; + + +/* + * -------------------------------------------------------------------------- + * Init/Load function for the OVSEXT filter Driver. + * -------------------------------------------------------------------------- + */ +NTSTATUS +DriverEntry(PDRIVER_OBJECT driverObject, + PUNICODE_STRING registryPath) +{ + NDIS_STATUS status; + NDIS_FILTER_DRIVER_CHARACTERISTICS driverChars; + + UNREFERENCED_PARAMETER(registryPath); + + /* Initialize driver associated data structures. */ + OvsInit(); + + gOvsExtDriverObject = driverObject; + + RtlZeroMemory(&driverChars, sizeof driverChars); + driverChars.Header.Type = NDIS_OBJECT_TYPE_FILTER_DRIVER_CHARACTERISTICS; + driverChars.Header.Size = sizeof driverChars; + driverChars.Header.Revision = NDIS_FILTER_CHARACTERISTICS_REVISION_2; + driverChars.MajorNdisVersion = NDIS_FILTER_MAJOR_VERSION; + driverChars.MinorNdisVersion = NDIS_FILTER_MINOR_VERSION; + driverChars.MajorDriverVersion = 1; + driverChars.MinorDriverVersion = 0; + driverChars.Flags = 0; + + RtlInitUnicodeString(&driverChars.ServiceName, ovsExtServiceName); + RtlInitUnicodeString(&ovsExtFriendlyNameUC, ovsExtFriendlyName); + RtlInitUnicodeString(&ovsExtGuidUC, ovsExtGuidStr); + + driverChars.FriendlyName = ovsExtFriendlyNameUC; + driverChars.UniqueName = ovsExtGuidUC; + + driverChars.AttachHandler = OvsExtAttach; + driverChars.DetachHandler = OvsExtDetach; + driverChars.RestartHandler = OvsExtRestart; + driverChars.PauseHandler = OvsExtPause; + + driverChars.SendNetBufferListsHandler = OvsExtSendNBL; + driverChars.SendNetBufferListsCompleteHandler = OvsExtSendNBLComplete; + driverChars.CancelSendNetBufferListsHandler = OvsExtCancelSendNBL; + driverChars.ReceiveNetBufferListsHandler = NULL; + driverChars.ReturnNetBufferListsHandler = NULL; + + driverChars.OidRequestHandler = OvsExtOidRequest; + driverChars.OidRequestCompleteHandler = OvsExtOidRequestComplete; + driverChars.CancelOidRequestHandler = OvsExtCancelOidRequest; + + driverChars.DevicePnPEventNotifyHandler = NULL; + driverChars.NetPnPEventHandler = OvsExtNetPnPEvent; + driverChars.StatusHandler = NULL; + + driverObject->DriverUnload = OvsExtUnload; + + status = NdisFRegisterFilterDriver(driverObject, + (NDIS_HANDLE) gOvsExtDriverObject, + &driverChars, &gOvsExtDriverHandle); + if (status != NDIS_STATUS_SUCCESS) { + return status; + } + + /* Create the communication channel for usersapce. */ + status = OvsCreateDeviceObject(gOvsExtDriverHandle); + if (status != NDIS_STATUS_SUCCESS) { + OvsCleanup(); + NdisFDeregisterFilterDriver(gOvsExtDriverHandle); + gOvsExtDriverHandle = NULL; + } + + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Un-init/Unload function for the OVS intermediate Driver. + * -------------------------------------------------------------------------- + */ +VOID +OvsExtUnload(struct _DRIVER_OBJECT *driverObject) +{ + UNREFERENCED_PARAMETER(driverObject); + + /* Release driver associated data structures. */ + OvsCleanup(); + + OvsDeleteDeviceObject(); + + NdisFDeregisterFilterDriver(gOvsExtDriverHandle); +} + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterStatus function. + * -------------------------------------------------------------------------- + */ +VOID +OvsExtStatus(NDIS_HANDLE filterModuleContext, + PNDIS_STATUS_INDICATION statusIndication) +{ + UNREFERENCED_PARAMETER(statusIndication); + POVS_SWITCH_CONTEXT switchObject = (POVS_SWITCH_CONTEXT)filterModuleContext; + + NdisFIndicateStatus(switchObject->NdisFilterHandle, statusIndication); + return; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Ethernet.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Ethernet.h --- openvswitch-2.3.1/datapath-windows/ovsext/Ethernet.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Ethernet.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,450 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __ETHERNET_H_ +#define __ETHERNET_H_ 1 + +#define ETH_LADRF_LEN 2 +#define ETH_ADDR_LENGTH 6 + +typedef UINT8 Eth_Address[ETH_ADDR_LENGTH]; + +#define ETH_ADDR_FMT_STR "%02x:%02x:%02x:%02x:%02x:%02x" +#define ETH_ADDR_FMT_ARGS(a) ((UINT8 *)a)[0], ((UINT8 *)a)[1], ((UINT8 *)a)[2], \ + ((UINT8 *)a)[3], ((UINT8 *)a)[4], ((UINT8 *)a)[5] + +#define ETH_MAX_EXACT_MULTICAST_ADDRS 32 + +typedef enum Eth_RxMode { + ETH_FILTER_UNICAST = 0x0001, /* pass unicast (directed) frames */ + ETH_FILTER_MULTICAST = 0x0002, /* pass some multicast frames */ + ETH_FILTER_ALLMULTI = 0x0004, /* pass *all* multicast frames */ + ETH_FILTER_BROADCAST = 0x0008, /* pass broadcast frames */ + ETH_FILTER_PROMISC = 0x0010, /* pass all frames (ie no filter) */ + ETH_FILTER_USE_LADRF = 0x0020, /* use the LADRF for multicast filtering */ + ETH_FILTER_SINK = 0x10000 /* pass not-matched unicast frames */ +} Eth_RxMode; + +/* filter flags printf helpers */ +#define ETH_FILTER_FLAG_FMT_STR "%s%s%s%s%s%s%s" +#define ETH_FILTER_FLAG_FMT_ARGS(f) (f) & ETH_FILTER_UNICAST ? " UNICAST" : "", \ + (f) & ETH_FILTER_MULTICAST ? " MULTICAST" : "", \ + (f) & ETH_FILTER_ALLMULTI ? " ALLMULTI" : "", \ + (f) & ETH_FILTER_BROADCAST ? " BROADCAST" : "", \ + (f) & ETH_FILTER_PROMISC ? " PROMISC" : "", \ + (f) & ETH_FILTER_USE_LADRF ? " USE_LADRF" : "", \ + (f) & ETH_FILTER_SINK ? " SINK" : "" + +/* Ethernet header type */ +typedef enum { + ETH_HEADER_TYPE_DIX, + ETH_HEADER_TYPE_802_1PQ, + ETH_HEADER_TYPE_802_3, + ETH_HEADER_TYPE_802_1PQ_802_3, +} Eth_HdrType; + +/* DIX type fields we care about */ +typedef enum { + ETH_TYPE_IPV4 = 0x0800, + ETH_TYPE_IPV6 = 0x86DD, + ETH_TYPE_ARP = 0x0806, + ETH_TYPE_RARP = 0x8035, + ETH_TYPE_LLDP = 0x88CC, + ETH_TYPE_CDP = 0x2000, + ETH_TYPE_802_1PQ = 0x8100, // not really a DIX type, but used as such + ETH_TYPE_LLC = 0xFFFF, // 0xFFFF is IANA reserved, used to mark LLC +} Eth_DixType; + +typedef enum { + ETH_TYPE_IPV4_NBO = 0x0008, + ETH_TYPE_IPV6_NBO = 0xDD86, + ETH_TYPE_ARP_NBO = 0x0608, + ETH_TYPE_RARP_NBO = 0x3580, + ETH_TYPE_LLDP_NBO = 0xCC88, + ETH_TYPE_CDP_NBO = 0x0020, + ETH_TYPE_AKIMBI_NBO = 0xDE88, + ETH_TYPE_802_1PQ_NBO = 0x0081, // not really a DIX type, but used as such +} Eth_DixTypeNBO; + +/* low two bits of the LLC control byte */ +typedef enum { + ETH_LLC_CONTROL_IFRAME = 0x0, // both 0x0 and 0x2, only low bit of 0 needed + ETH_LLC_CONTROL_SFRAME = 0x1, + ETH_LLC_CONTROL_UFRAME = 0x3, +} Eth_LLCControlBits; + +#define ETH_LLC_CONTROL_UFRAME_MASK (0x3) + +typedef struct Eth_DIX { + UINT16 typeNBO; // indicates the higher level protocol +} Eth_DIX; + +/* + * LLC header come in two varieties: 8 bit control and 16 bit control. + * when the lower two bits of the first byte's control are '11', this + * indicated the 8 bit control field. + */ +typedef struct Eth_LLC8 { + UINT8 dsap; + UINT8 ssap; + UINT8 control; +} Eth_LLC8; + +typedef struct Eth_LLC16 { + UINT8 dsap; + UINT8 ssap; + UINT16 control; +} Eth_LLC16; + +typedef struct Eth_SNAP { + UINT8 snapOrg[3]; + Eth_DIX snapType; +} Eth_SNAP; + +typedef struct Eth_802_3 { + UINT16 lenNBO; // length of the frame + Eth_LLC8 llc; // LLC header + Eth_SNAP snap; // SNAP header +} Eth_802_3; + +// 802.1p QOS/priority tags +enum { + ETH_802_1_P_BEST_EFFORT = 0, + ETH_802_1_P_BACKGROUND = 1, + ETH_802_1_P_EXCELLENT_EFFORT = 2, + ETH_802_1_P_CRITICAL_APPS = 3, + ETH_802_1_P_VIDEO = 4, + ETH_802_1_P_VOICE = 5, + ETH_802_1_P_INTERNETWORK_CONROL = 6, + ETH_802_1_P_NETWORK_CONTROL = 7 +}; + +typedef struct Eth_802_1pq_Tag { + UINT16 typeNBO; // always ETH_TYPE_802_1PQ + UINT16 vidHi:4, // 802.1q vlan ID high nibble + canonical:1, // bit order? (should always be 0) + priority:3, // 802.1p priority tag + vidLo:8; // 802.1q vlan ID low byte +} Eth_802_1pq_Tag; + +typedef struct Eth_802_1pq { + Eth_802_1pq_Tag tag; // VLAN/QOS tag + union { + Eth_DIX dix; // DIX header follows + Eth_802_3 e802_3; // or 802.3 header follows + }; +} Eth_802_1pq; + +typedef struct Eth_Header { + Eth_Address dst; // all types of ethernet frame have dst first + Eth_Address src; // and the src next (at least all the ones we'll see) + union { + Eth_DIX dix; // followed by a DIX header... + Eth_802_3 e802_3; // ...or an 802.3 header + Eth_802_1pq e802_1pq; // ...or an 802.1[pq] tag and a header + }; +} Eth_Header; + +#define ETH_BROADCAST_ADDRESS { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } + +static Eth_Address netEthBroadcastAddr = ETH_BROADCAST_ADDRESS; + +/* + * simple predicate for 1536 boundary. + * the parameter is a network ordered UINT16, which is compared to 0x06, + * testing for "length" values greater than or equal to 0x0600 (1536) + */ + +#define ETH_TYPENOT8023(x) (((x) & 0xff) >= 0x06) + +/* + * header length macros + * + * first two are typical: ETH_HEADER_LEN_DIX, ETH_HEADER_LEN_802_1PQ + * last two are suspicious, due to 802.3 incompleteness + */ + +#define ETH_HEADER_LEN_DIX (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(Eth_DIX)) +#define ETH_HEADER_LEN_802_1PQ (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(Eth_802_1pq_Tag) + \ + sizeof(Eth_DIX)) +#define ETH_HEADER_LEN_802_2_LLC (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(UINT16) + \ + sizeof(Eth_LLC8)) +#define ETH_HEADER_LEN_802_2_LLC16 (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(UINT16) + \ + sizeof(Eth_LLC16)) +#define ETH_HEADER_LEN_802_3 (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(Eth_802_3)) +#define ETH_HEADER_LEN_802_1PQ_LLC (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(Eth_802_1pq_Tag) + \ + sizeof(UINT16) + \ + sizeof(Eth_LLC8)) +#define ETH_HEADER_LEN_802_1PQ_LLC16 (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(Eth_802_1pq_Tag) + \ + sizeof(UINT16) + \ + sizeof(Eth_LLC16)) +#define ETH_HEADER_LEN_802_1PQ_802_3 (sizeof(Eth_Address) + \ + sizeof(Eth_Address) + \ + sizeof(Eth_802_1pq_Tag) + \ + sizeof(Eth_802_3)) + +#define ETH_MIN_HEADER_LEN (ETH_HEADER_LEN_DIX) +#define ETH_MAX_HEADER_LEN (ETH_HEADER_LEN_802_1PQ_802_3) + +#define ETH_MIN_FRAME_LEN 60 +#define ETH_MAX_STD_MTU 1500 +#define ETH_MAX_STD_FRAMELEN (ETH_MAX_STD_MTU + ETH_MAX_HEADER_LEN) +#define ETH_MAX_JUMBO_MTU 9000 +#define ETH_MAX_JUMBO_FRAMELEN (ETH_MAX_JUMBO_MTU + ETH_MAX_HEADER_LEN) + +#define ETH_DEFAULT_MTU 1500 + +#define ETH_FCS_LEN 4 +#define ETH_VLAN_LEN sizeof(Eth_802_1pq_Tag) + + +/* + *---------------------------------------------------------------------------- + * Do the two ethernet addresses match? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsAddrMatch(const Eth_Address addr1, const Eth_Address addr2) +{ + return !memcmp(addr1, addr2, ETH_ADDR_LENGTH); +} + + +/* + *---------------------------------------------------------------------------- + * Is the address the broadcast address? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsBroadcastAddr(const Eth_Address addr) +{ + return Eth_IsAddrMatch(addr, netEthBroadcastAddr); +} + + +/* + *---------------------------------------------------------------------------- + * Is the address a unicast address? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsUnicastAddr(const Eth_Address addr) +{ + // broadcast and multicast frames always have the low bit set in byte 0 + return !(((CHAR *)addr)[0] & 0x1); +} + +/* + *---------------------------------------------------------------------------- + * Is the address the all-zeros address? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsNullAddr(const Eth_Address addr) +{ + return ((addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]) == 0); +} + +/* + *---------------------------------------------------------------------------- + * + * Eth_HeaderType -- + * return an Eth_HdrType depending on the eth header + * contents. will not work in all cases, especially since it + * requres ETH_HEADER_LEN_802_1PQ bytes to determine the type + * + * HeaderType isn't sufficient to determine the length of + * the eth header. for 802.3 header, its not clear without + * examination, whether a SNAP is included + * + * returned type: + * + * ETH_HEADER_TYPE_DIX: typical 14 byte eth header + * ETH_HEADER_TYPE_802_1PQ: DIX+vlan tagging + * ETH_HEADER_TYPE_802_3: 802.3 eth header + * ETH_HEADER_TYPE_802_1PQ_802_3: 802.3 + vlan tag + * + * the test for DIX was moved from a 1500 boundary to a 1536 + * boundary, since the vmxnet2 MTU was updated to 1514. when + * W2K8 attempted to send LLC frames, these were interpreted + * as DIX frames instead of the correct 802.3 type + * + * these links may help if they're valid: + * + * http://standards.ieee.org/regauth/ethertype/type-tut.html + * http://standards.ieee.org/regauth/ethertype/type-pub.html + * + * Results: + * Eth_HdrType value + * + *---------------------------------------------------------------------------- + */ +static __inline Eth_HdrType +Eth_HeaderType(const Eth_Header *eh) +{ + /* + * we use 1536 (IEEE 802.3-std mentions 1536, but iana indicates + * type of 0-0x5dc are 802.3) instead of some #def symbol to prevent + * inadvertant reuse of the same macro for buffer size decls. + */ + if (ETH_TYPENOT8023(eh->dix.typeNBO)) { + if (eh->dix.typeNBO != ETH_TYPE_802_1PQ_NBO) { + /* typical case */ + return ETH_HEADER_TYPE_DIX; + } + + /* some type of 802.1pq tagged frame */ + if (ETH_TYPENOT8023(eh->e802_1pq.dix.typeNBO)) { + /* vlan tagging with dix style type */ + return ETH_HEADER_TYPE_802_1PQ; + } + + /* vlan tagging with 802.3 header */ + return ETH_HEADER_TYPE_802_1PQ_802_3; + } + + /* assume 802.3 */ + return ETH_HEADER_TYPE_802_3; +} + + +/* + *---------------------------------------------------------------------------- + * + * Eth_EncapsulatedPktType -- + * Get the encapsulated (layer 3) frame type. + * for LLC frames without SNAP, we don't have + * an encapsulated type, and return ETH_TYPE_LLC. + * + * IANA reserves 0xFFFF, which we reuse to indicate + * ETH_TYPE_LLC. + * + * Results: + * NBO frame type. + * + *---------------------------------------------------------------------------- + */ +static __inline UINT16 +Eth_EncapsulatedPktType(const Eth_Header *eh) +{ + Eth_HdrType type = Eth_HeaderType(eh); + + switch (type) { + case ETH_HEADER_TYPE_DIX: return eh->dix.typeNBO; + case ETH_HEADER_TYPE_802_1PQ: return eh->e802_1pq.dix.typeNBO; + case ETH_HEADER_TYPE_802_3: + /* + * Documentation describes SNAP headers as having ONLY + * 0x03 as the control fields, not just the lower two bits + * This prevents the use of Eth_IsLLCControlUFormat. + */ + if ((eh->e802_3.llc.dsap == 0xaa) && (eh->e802_3.llc.ssap == 0xaa) && + (eh->e802_3.llc.control == ETH_LLC_CONTROL_UFRAME)) { + return eh->e802_3.snap.snapType.typeNBO; + } else { + // LLC, no snap header, then no type + return ETH_TYPE_LLC; + } + + case ETH_HEADER_TYPE_802_1PQ_802_3: + if ((eh->e802_1pq.e802_3.llc.dsap == 0xaa) && + (eh->e802_1pq.e802_3.llc.ssap == 0xaa) && + (eh->e802_1pq.e802_3.llc.control == ETH_LLC_CONTROL_UFRAME)) { + return eh->e802_1pq.e802_3.snap.snapType.typeNBO; + } else { + // tagged LLC, no snap header, then no type + return ETH_TYPE_LLC; + } + } + + ASSERT(FALSE); + return 0; +} + +/* + *---------------------------------------------------------------------------- + * Is the frame of the requested protocol type or is it an 802.1[pq] + * encapsulation of such a frame? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsDixType(const Eth_Header *eh, const Eth_DixTypeNBO type) +{ + return Eth_EncapsulatedPktType(eh) == type; +} + + +/* + *---------------------------------------------------------------------------- + * Is the frame an IPV4 frame? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsIPV4(const Eth_Header *eh) +{ + return Eth_IsDixType(eh, ETH_TYPE_IPV4_NBO); +} + + +/* + *---------------------------------------------------------------------------- + * Is the frame an IPV6 frame? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsIPV6(const Eth_Header *eh) +{ + return Eth_IsDixType(eh, ETH_TYPE_IPV6_NBO); +} + + +/* + *---------------------------------------------------------------------------- + * Is the frame an ARP frame? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsARP(const Eth_Header *eh) +{ + return Eth_IsDixType(eh, ETH_TYPE_ARP_NBO); +} + + +/* + *---------------------------------------------------------------------------- + * Does the frame contain an 802.1[pq] tag? + *---------------------------------------------------------------------------- + */ +static __inline BOOLEAN +Eth_IsFrameTagged(const Eth_Header *eh) +{ + return (eh->dix.typeNBO == ETH_TYPE_802_1PQ_NBO); +} +#endif /* __ETHERNET_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Event.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Event.c --- openvswitch-2.3.1/datapath-windows/ovsext/Event.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Event.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,459 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" + +#include "Switch.h" +#include "User.h" +#include "Datapath.h" +#include "Vport.h" +#include "Event.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_EVENT +#include "Debug.h" + +LIST_ENTRY ovsEventQueue; +static NDIS_SPIN_LOCK eventQueueLock; +UINT32 ovsNumEventQueue; +UINT32 ovsNumPollAll; + +NTSTATUS +OvsInitEventQueue() +{ + InitializeListHead(&ovsEventQueue); + NdisAllocateSpinLock(&eventQueueLock); + return STATUS_SUCCESS; +} + +VOID +OvsCleanupEventQueue() +{ + ASSERT(IsListEmpty(&ovsEventQueue)); + ASSERT(ovsNumEventQueue == 0); + NdisFreeSpinLock(&eventQueueLock); +} + +static __inline VOID +OvsAcquireEventQueueLock() +{ + NdisAcquireSpinLock(&eventQueueLock); +} + +static __inline VOID +OvsReleaseEventQueueLock() +{ + NdisReleaseSpinLock(&eventQueueLock); +} + +/* + * -------------------------------------------------------------------------- + * Cleanup the event queue of the OpenInstance. + * -------------------------------------------------------------------------- + */ +VOID +OvsCleanupEvent(POVS_OPEN_INSTANCE instance) +{ + POVS_EVENT_QUEUE queue; + PIRP irp = NULL; + queue = (POVS_EVENT_QUEUE)instance->eventQueue; + if (queue) { + POVS_EVENT_QUEUE_ELEM elem; + PLIST_ENTRY link, next; + + OvsAcquireEventQueueLock(); + RemoveEntryList(&queue->queueLink); + ovsNumEventQueue--; + if (queue->pendingIrp) { + PDRIVER_CANCEL cancelRoutine; + irp = queue->pendingIrp; + cancelRoutine = IoSetCancelRoutine(irp, NULL); + queue->pendingIrp = NULL; + if (cancelRoutine == NULL) { + irp = NULL; + } + } + instance->eventQueue = NULL; + OvsReleaseEventQueueLock(); + if (irp) { + OvsCompleteIrpRequest(irp, 0, STATUS_SUCCESS); + } + + LIST_FORALL_SAFE(&queue->elemList, link, next) { + elem = CONTAINING_RECORD(link, OVS_EVENT_QUEUE_ELEM, link); + OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); + } + OvsFreeMemoryWithTag(queue, OVS_EVENT_POOL_TAG); + } +} + +/* + * -------------------------------------------------------------------------- + * When event is generated, we need to post the event to all + * the event queues. If there is pending Irp waiting for event + * complete the Irp to wakeup the user thread. + * + * Side effects: User thread may be woken up. + * -------------------------------------------------------------------------- + */ +VOID +OvsPostEvent(UINT32 portNo, + UINT32 status) +{ + POVS_EVENT_QUEUE_ELEM elem; + POVS_EVENT_QUEUE queue; + PLIST_ENTRY link; + BOOLEAN triggerPollAll = FALSE; + LIST_ENTRY list; + PLIST_ENTRY entry; + PIRP irp; + + InitializeListHead(&list); + + OVS_LOG_TRACE("Enter: portNo: %#x, status: %#x", portNo, status); + + OvsAcquireEventQueueLock(); + + LIST_FORALL(&ovsEventQueue, link) { + queue = CONTAINING_RECORD(link, OVS_EVENT_QUEUE, queueLink); + if ((status & queue->mask) == 0 || + queue->pollAll) { + continue; + } + if (queue->numElems > (OVS_MAX_VPORT_ARRAY_SIZE >> 1) || + portNo == OVS_DEFAULT_PORT_NO) { + queue->pollAll = TRUE; + } else { + elem = (POVS_EVENT_QUEUE_ELEM)OvsAllocateMemoryWithTag( + sizeof(*elem), OVS_EVENT_POOL_TAG); + if (elem == NULL) { + queue->pollAll = TRUE; + } else { + elem->portNo = portNo; + elem->status = (status & queue->mask); + InsertTailList(&queue->elemList, &elem->link); + queue->numElems++; + OVS_LOG_INFO("Queue: %p, numElems: %d", + queue, queue->numElems); + } + } + if (queue->pollAll) { + PLIST_ENTRY curr, next; + triggerPollAll = TRUE; + ovsNumPollAll++; + LIST_FORALL_SAFE(&queue->elemList, curr, next) { + RemoveEntryList(curr); + elem = CONTAINING_RECORD(curr, OVS_EVENT_QUEUE_ELEM, link); + OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); + } + queue->numElems = 0; + } + if (queue->pendingIrp != NULL) { + PDRIVER_CANCEL cancelRoutine; + irp = queue->pendingIrp; + queue->pendingIrp = NULL; + cancelRoutine = IoSetCancelRoutine(irp, NULL); + if (cancelRoutine) { + InsertTailList(&list, &irp->Tail.Overlay.ListEntry); + } + } + } + OvsReleaseEventQueueLock(); + while (!IsListEmpty(&list)) { + entry = RemoveHeadList(&list); + irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry); + OVS_LOG_INFO("Wakeup thread with IRP: %p", irp); + OvsCompleteIrpRequest(irp, 0, STATUS_SUCCESS); + } + OVS_LOG_TRACE("Exit: triggered pollAll: %s", + (triggerPollAll ? "TRUE" : "FALSE")); +} + + +/* + * -------------------------------------------------------------------------- + * Subscribe for event notification. + * + * Results: + * STATUS_SUCCESS for valid request and enough resource. + * STATUS_NO_RESOURCES for queue allocation failure + * STATUS_INVALID_PARAMETER for invalid request + * + * Side effects: + * Event queue is created for the current open instance. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsSubscribeEventIoctl(PFILE_OBJECT fileObject, + PVOID inputBuffer, + UINT32 inputLength) +{ + POVS_EVENT_SUBSCRIBE request = (POVS_EVENT_SUBSCRIBE)inputBuffer; + NTSTATUS status = STATUS_SUCCESS; + POVS_OPEN_INSTANCE instance; + POVS_EVENT_QUEUE queue = NULL; + + OVS_LOG_TRACE("Enter: fileObject: %p, inputLength: %d", fileObject, + inputLength); + + if (inputLength < sizeof (OVS_EVENT_SUBSCRIBE) || + (request->mask & OVS_EVENT_MASK_ALL) == 0) { + OVS_LOG_TRACE("Exit: subscribe failed with invalid request."); + return STATUS_INVALID_PARAMETER; + } + + OvsAcquireEventQueueLock(); + + instance = OvsGetOpenInstance(fileObject, request->dpNo); + + if (instance == NULL) { + status = STATUS_INVALID_PARAMETER; + OVS_LOG_WARN("can not find open instance"); + goto done_event_subscribe; + } + + /* + * XXX for now, we don't allow change mask. + */ + queue = (POVS_EVENT_QUEUE)instance->eventQueue; + if (request->subscribe && queue) { + if (queue->mask != request->mask) { + status = STATUS_INVALID_PARAMETER; + OVS_LOG_WARN("Can not chnage mask when the queue is subscribed"); + } + status = STATUS_SUCCESS; + goto done_event_subscribe; + } else if (!request->subscribe && queue == NULL) { + status = STATUS_SUCCESS; + goto done_event_subscribe; + } + + if (request->subscribe) { + queue = (POVS_EVENT_QUEUE)OvsAllocateMemoryWithTag( + sizeof(OVS_EVENT_QUEUE), OVS_EVENT_POOL_TAG); + if (queue == NULL) { + status = STATUS_NO_MEMORY; + OVS_LOG_WARN("Fail to allocate event queue"); + goto done_event_subscribe; + } + InitializeListHead(&queue->elemList); + queue->mask = request->mask; + queue->pendingIrp = NULL; + queue->numElems = 0; + queue->pollAll = TRUE; /* always poll all in the begining */ + InsertHeadList(&ovsEventQueue, &queue->queueLink); + ovsNumEventQueue++; + instance->eventQueue = queue; + queue->instance = instance; + } else { + queue = (POVS_EVENT_QUEUE)instance->eventQueue; + RemoveEntryList(&queue->queueLink); + ovsNumEventQueue--; + instance->eventQueue = NULL; + } +done_event_subscribe: + if (!request->subscribe && queue) { + POVS_EVENT_QUEUE_ELEM elem; + PLIST_ENTRY link, next; + PIRP irp = NULL; + if (queue->pendingIrp) { + PDRIVER_CANCEL cancelRoutine; + irp = queue->pendingIrp; + queue->pendingIrp = NULL; + cancelRoutine = IoSetCancelRoutine(irp, NULL); + if (cancelRoutine == NULL) { + irp = NULL; + } + } + OvsReleaseEventQueueLock(); + if (irp) { + OvsCompleteIrpRequest(queue->pendingIrp, 0, STATUS_SUCCESS); + } + LIST_FORALL_SAFE(&queue->elemList, link, next) { + elem = CONTAINING_RECORD(link, OVS_EVENT_QUEUE_ELEM, link); + OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); + } + OvsFreeMemoryWithTag(queue, OVS_EVENT_POOL_TAG); + } else { + OvsReleaseEventQueueLock(); + } + OVS_LOG_TRACE("Exit: subscribe event with status: %#x.", status); + return status; +} + +/* + * -------------------------------------------------------------------------- + * Cancel wait IRP for event + * + * Please note, when this routine is called, it is always guaranteed that + * IRP is valid. + * + * Side effects: Pending IRP is completed. + * -------------------------------------------------------------------------- + */ +VOID +OvsCancelIrp(PDEVICE_OBJECT deviceObject, + PIRP irp) +{ + PIO_STACK_LOCATION irpSp; + PFILE_OBJECT fileObject; + POVS_EVENT_QUEUE queue; + POVS_OPEN_INSTANCE instance; + + UNREFERENCED_PARAMETER(deviceObject); + + IoReleaseCancelSpinLock(irp->CancelIrql); + + irpSp = IoGetCurrentIrpStackLocation(irp); + fileObject = irpSp->FileObject; + + if (fileObject == NULL) { + goto done; + } + OvsAcquireEventQueueLock(); + instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + if (instance == NULL || instance->eventQueue == NULL) { + OvsReleaseEventQueueLock(); + goto done; + } + queue = instance->eventQueue; + if (queue->pendingIrp == irp) { + queue->pendingIrp = NULL; + } + OvsReleaseEventQueueLock(); +done: + OvsCompleteIrpRequest(irp, 0, STATUS_CANCELLED); +} + +/* + * -------------------------------------------------------------------------- + * Wait for event. + * + * Results: + * STATUS_SUCCESS for valid request + * STATUS_DEVICE_BUSY if already in waiting state. + * STATUS_INVALID_PARAMETER for invalid request + * STATUS_PENDING wait for event + * + * Side effects: + * May return pending to IO manager. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsWaitEventIoctl(PIRP irp, + PFILE_OBJECT fileObject, + PVOID inputBuffer, + UINT32 inputLength) +{ + NTSTATUS status; + POVS_EVENT_POLL poll; + POVS_EVENT_QUEUE queue; + POVS_OPEN_INSTANCE instance; + BOOLEAN cancelled = FALSE; + OVS_LOG_TRACE("Enter: inputLength: %u", inputLength); + + if (inputLength < sizeof (OVS_EVENT_POLL)) { + OVS_LOG_TRACE("Exit: Invalid input buffer length."); + return STATUS_INVALID_PARAMETER; + } + poll = (POVS_EVENT_POLL)inputBuffer; + + OvsAcquireEventQueueLock(); + + instance = OvsGetOpenInstance(fileObject, poll->dpNo); + if (instance == NULL) { + OvsReleaseEventQueueLock(); + OVS_LOG_TRACE("Exit: Can not find open instance, dpNo: %d", poll->dpNo); + return STATUS_INVALID_PARAMETER; + } + + queue = (POVS_EVENT_QUEUE)instance->eventQueue; + if (queue == NULL) { + OvsReleaseEventQueueLock(); + OVS_LOG_TRACE("Exit: Event queue does not exist"); + return STATUS_INVALID_PARAMETER; + } + if (queue->pendingIrp) { + OvsReleaseEventQueueLock(); + OVS_LOG_TRACE("Exit: Event queue already in pending state"); + return STATUS_DEVICE_BUSY; + } + + status = (queue->numElems != 0 || queue->pollAll) ? + STATUS_SUCCESS : STATUS_PENDING; + if (status == STATUS_PENDING) { + PDRIVER_CANCEL cancelRoutine; + IoMarkIrpPending(irp); + IoSetCancelRoutine(irp, OvsCancelIrp); + if (irp->Cancel) { + cancelRoutine = IoSetCancelRoutine(irp, NULL); + if (cancelRoutine) { + cancelled = TRUE; + } + } else { + queue->pendingIrp = irp; + } + } + OvsReleaseEventQueueLock(); + if (cancelled) { + OvsCompleteIrpRequest(irp, 0, STATUS_CANCELLED); + OVS_LOG_INFO("Event IRP cancelled: %p", irp); + } + OVS_LOG_TRACE("Exit: return status: %#x", status); + return status; +} + +/* + *-------------------------------------------------------------------------- + * Poll event queued in the event queue.always synchronous. + * + * Results: + * STATUS_SUCCESS event was dequeued + * STATUS_UNSUCCESSFUL the queue is empty. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsRemoveEventEntry(POVS_OPEN_INSTANCE instance, + POVS_EVENT_ENTRY entry) +{ + NTSTATUS status = STATUS_UNSUCCESSFUL; + POVS_EVENT_QUEUE queue; + POVS_EVENT_QUEUE_ELEM elem; + + OvsAcquireEventQueueLock(); + + queue = (POVS_EVENT_QUEUE)instance->eventQueue; + + if (queue == NULL) { + ASSERT(queue); + goto remove_event_done; + } + + if (queue->numElems) { + elem = (POVS_EVENT_QUEUE_ELEM)RemoveHeadList(&queue->elemList); + entry->portNo = elem->portNo; + entry->status = elem->status; + OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); + queue->numElems--; + status = STATUS_SUCCESS; + } + +remove_event_done: + OvsReleaseEventQueueLock(); + return status; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Event.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Event.h --- openvswitch-2.3.1/datapath-windows/ovsext/Event.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Event.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __EVENT_H_ +#define __EVENT_H_ 1 + +typedef struct _OVS_EVENT_QUEUE_ELEM { + LIST_ENTRY link; + UINT32 portNo; + UINT32 status; +} OVS_EVENT_QUEUE_ELEM, *POVS_EVENT_QUEUE_ELEM; + +typedef struct _OVS_EVENT_QUEUE { + LIST_ENTRY queueLink; + LIST_ENTRY elemList; + UINT32 mask; + UINT16 numElems; + BOOLEAN pollAll; + PIRP pendingIrp; + PVOID instance; +} OVS_EVENT_QUEUE, *POVS_EVENT_QUEUE; + +NTSTATUS OvsInitEventQueue(VOID); +VOID OvsCleanupEventQueue(VOID); + +struct _OVS_OPEN_INSTANCE; + +VOID OvsCleanupEvent(struct _OVS_OPEN_INSTANCE *instance); +VOID OvsPostEvent(UINT32 portNo, UINT32 status); +NTSTATUS OvsSubscribeEventIoctl(PFILE_OBJECT fileObject, PVOID inputBuffer, + UINT32 inputLength); +NTSTATUS OvsPollEventIoctl(PFILE_OBJECT fileObject, PVOID inputBuffer, + UINT32 inputLength, PVOID outputBuffer, + UINT32 outputLength, UINT32 *replyLen); +NTSTATUS OvsWaitEventIoctl(PIRP irp, PFILE_OBJECT fileObject, + PVOID inputBuffer, UINT32 inputLength); +NTSTATUS OvsRemoveEventEntry(PVOID instance, POVS_EVENT_ENTRY entry); + +#endif /* __EVENT_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Flow.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Flow.c --- openvswitch-2.3.1/datapath-windows/ovsext/Flow.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Flow.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2386 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "NetProto.h" +#include "Util.h" +#include "Jhash.h" +#include "Flow.h" +#include "PacketParser.h" +#include "Datapath.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_FLOW +#include "Debug.h" + +#pragma warning( push ) +#pragma warning( disable:4127 ) + +extern POVS_SWITCH_CONTEXT gOvsSwitchContext; +extern UINT64 ovsTimeIncrementPerTick; + +static NTSTATUS ReportFlowInfo(OvsFlow *flow, UINT32 getFlags, + OvsFlowInfo *info); +static NTSTATUS HandleFlowPut(OvsFlowPut *put, + OVS_DATAPATH *datapath, + struct OvsFlowStats *stats); +static NTSTATUS OvsPrepareFlow(OvsFlow **flow, const OvsFlowPut *put, + UINT64 hash); +static VOID RemoveFlow(OVS_DATAPATH *datapath, OvsFlow **flow); +static VOID DeleteAllFlows(OVS_DATAPATH *datapath); +static NTSTATUS AddFlow(OVS_DATAPATH *datapath, OvsFlow *flow); +static VOID FreeFlow(OvsFlow *flow); +static VOID __inline *GetStartAddrNBL(const NET_BUFFER_LIST *_pNB); +static NTSTATUS _MapNlToFlowPut(POVS_MESSAGE msgIn, PNL_ATTR keyAttr, + PNL_ATTR actionAttr, + PNL_ATTR flowAttrClear, + OvsFlowPut *mappedFlow); +static VOID _MapKeyAttrToFlowPut(PNL_ATTR *keyAttrs, + PNL_ATTR *tunnelAttrs, + OvsFlowKey *destKey); + +static VOID _MapTunAttrToFlowPut(PNL_ATTR *keyAttrs, + PNL_ATTR *tunnelAttrs, + OvsFlowKey *destKey); +static VOID _MapNlToFlowPutFlags(PGENL_MSG_HDR genlMsgHdr, + PNL_ATTR flowAttrClear, + OvsFlowPut *mappedFlow); + +static NTSTATUS _FlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); +static NTSTATUS _FlowNlDumpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); +static NTSTATUS _MapFlowInfoToNl(PNL_BUFFER nlBuf, + OvsFlowInfo *flowInfo); +static NTSTATUS _MapFlowStatsToNlStats(PNL_BUFFER nlBuf, + OvsFlowStats *flowStats); +static NTSTATUS _MapFlowActionToNlAction(PNL_BUFFER nlBuf, + uint32_t actionsLen, + PNL_ATTR actions); + +static NTSTATUS _MapFlowIpv4KeyToNlKey(PNL_BUFFER nlBuf, + IpKey *ipv4FlowPutKey); +static NTSTATUS _MapFlowIpv6KeyToNlKey(PNL_BUFFER nlBuf, + Ipv6Key *ipv6FlowPutKey, + Icmp6Key *ipv6FlowPutIcmpKey); +static NTSTATUS _MapFlowArpKeyToNlKey(PNL_BUFFER nlBuf, + ArpKey *arpFlowPutKey); + +static NTSTATUS OvsDoDumpFlows(OvsFlowDumpInput *dumpInput, + OvsFlowDumpOutput *dumpOutput, + UINT32 *replyLen); + + +#define OVS_FLOW_TABLE_SIZE 2048 +#define OVS_FLOW_TABLE_MASK (OVS_FLOW_TABLE_SIZE -1) +#define HASH_BUCKET(hash) ((hash) & OVS_FLOW_TABLE_MASK) + +/* Flow family related netlink policies */ + +/* For Parsing attributes in FLOW_* commands */ +const NL_POLICY nlFlowPolicy[] = { + [OVS_FLOW_ATTR_KEY] = {.type = NL_A_NESTED, .optional = FALSE}, + [OVS_FLOW_ATTR_MASK] = {.type = NL_A_NESTED, .optional = TRUE}, + [OVS_FLOW_ATTR_ACTIONS] = {.type = NL_A_NESTED, .optional = TRUE}, + [OVS_FLOW_ATTR_STATS] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_flow_stats), + .maxLen = sizeof(struct ovs_flow_stats), + .optional = TRUE}, + [OVS_FLOW_ATTR_TCP_FLAGS] = {NL_A_U8, .optional = TRUE}, + [OVS_FLOW_ATTR_USED] = {NL_A_U64, .optional = TRUE} +}; + +/* For Parsing nested OVS_FLOW_ATTR_KEY attributes. + * Some of the attributes like OVS_KEY_ATTR_RECIRC_ID + * & OVS_KEY_ATTR_MPLS are not supported yet. */ + +const NL_POLICY nlFlowKeyPolicy[] = { + [OVS_KEY_ATTR_ENCAP] = {.type = NL_A_VAR_LEN, .optional = TRUE}, + [OVS_KEY_ATTR_PRIORITY] = {.type = NL_A_UNSPEC, .minLen = 4, + .maxLen = 4, .optional = TRUE}, + [OVS_KEY_ATTR_IN_PORT] = {.type = NL_A_UNSPEC, .minLen = 4, + .maxLen = 4, .optional = FALSE}, + [OVS_KEY_ATTR_ETHERNET] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_ethernet), + .maxLen = sizeof(struct ovs_key_ethernet), + .optional = TRUE}, + [OVS_KEY_ATTR_VLAN] = {.type = NL_A_UNSPEC, .minLen = 2, + .maxLen = 2, .optional = TRUE}, + [OVS_KEY_ATTR_ETHERTYPE] = {.type = NL_A_UNSPEC, .minLen = 2, + .maxLen = 2, .optional = TRUE}, + [OVS_KEY_ATTR_IPV4] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_ipv4), + .maxLen = sizeof(struct ovs_key_ipv4), + .optional = TRUE}, + [OVS_KEY_ATTR_IPV6] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_ipv6), + .maxLen = sizeof(struct ovs_key_ipv6), + .optional = TRUE}, + [OVS_KEY_ATTR_TCP] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_tcp), + .maxLen = sizeof(struct ovs_key_tcp), + .optional = TRUE}, + [OVS_KEY_ATTR_UDP] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_udp), + .maxLen = sizeof(struct ovs_key_udp), + .optional = TRUE}, + [OVS_KEY_ATTR_ICMP] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_icmp), + .maxLen = sizeof(struct ovs_key_icmp), + .optional = TRUE}, + [OVS_KEY_ATTR_ICMPV6] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_icmpv6), + .maxLen = sizeof(struct ovs_key_icmpv6), + .optional = TRUE}, + [OVS_KEY_ATTR_ARP] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_arp), + .maxLen = sizeof(struct ovs_key_arp), + .optional = TRUE}, + [OVS_KEY_ATTR_ND] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_nd), + .maxLen = sizeof(struct ovs_key_nd), + .optional = TRUE}, + [OVS_KEY_ATTR_SKB_MARK] = {.type = NL_A_UNSPEC, .minLen = 4, + .maxLen = 4, .optional = TRUE}, + [OVS_KEY_ATTR_TUNNEL] = {.type = NL_A_VAR_LEN, .optional = TRUE}, + [OVS_KEY_ATTR_SCTP] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_key_sctp), + .maxLen = sizeof(struct ovs_key_sctp), + .optional = TRUE}, + [OVS_KEY_ATTR_TCP_FLAGS] = {.type = NL_A_UNSPEC, + .minLen = 2, .maxLen = 2, + .optional = TRUE}, + [OVS_KEY_ATTR_DP_HASH] = {.type = NL_A_UNSPEC, .minLen = 4, + .maxLen = 4, .optional = TRUE}, + [OVS_KEY_ATTR_RECIRC_ID] = {.type = NL_A_UNSPEC, .minLen = 4, + .maxLen = 4, .optional = TRUE}, + [OVS_KEY_ATTR_MPLS] = {.type = NL_A_VAR_LEN, .optional = TRUE} +}; + +/* For Parsing nested OVS_KEY_ATTR_TUNNEL attributes */ +const NL_POLICY nlFlowTunnelKeyPolicy[] = { + [OVS_TUNNEL_KEY_ATTR_ID] = {.type = NL_A_UNSPEC, .minLen = 8, + .maxLen = 8, .optional = TRUE}, + [OVS_TUNNEL_KEY_ATTR_IPV4_SRC] = {.type = NL_A_UNSPEC, .minLen = 4, + .maxLen = 4, .optional = TRUE}, + [OVS_TUNNEL_KEY_ATTR_IPV4_DST] = {.type = NL_A_UNSPEC, .minLen = 4 , + .maxLen = 4, .optional = FALSE}, + [OVS_TUNNEL_KEY_ATTR_TOS] = {.type = NL_A_UNSPEC, .minLen = 1, + .maxLen = 1, .optional = TRUE}, + [OVS_TUNNEL_KEY_ATTR_TTL] = {.type = NL_A_UNSPEC, .minLen = 1, + .maxLen = 1, .optional = TRUE}, + [OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT] = {.type = NL_A_UNSPEC, .minLen = 0, + .maxLen = 0, .optional = TRUE}, + [OVS_TUNNEL_KEY_ATTR_CSUM] = {.type = NL_A_UNSPEC, .minLen = 0, + .maxLen = 0, .optional = TRUE}, + [OVS_TUNNEL_KEY_ATTR_OAM] = {.type = NL_A_UNSPEC, .minLen = 0, + .maxLen = 0, .optional = TRUE}, + [OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS] = {.type = NL_A_VAR_LEN, + .optional = TRUE} +}; + +/* For Parsing nested OVS_FLOW_ATTR_ACTIONS attributes */ +const NL_POLICY nlFlowActionPolicy[] = { + [OVS_ACTION_ATTR_OUTPUT] = {.type = NL_A_UNSPEC, .minLen = sizeof(UINT32), + .maxLen = sizeof(UINT32), .optional = TRUE}, + [OVS_ACTION_ATTR_USERSPACE] = {.type = NL_A_VAR_LEN, .optional = TRUE}, + [OVS_ACTION_ATTR_PUSH_VLAN] = {.type = NL_A_UNSPEC, + .minLen = + sizeof(struct ovs_action_push_vlan), + .maxLen = + sizeof(struct ovs_action_push_vlan), + .optional = TRUE}, + [OVS_ACTION_ATTR_POP_VLAN] = {.type = NL_A_UNSPEC, .optional = TRUE}, + [OVS_ACTION_ATTR_PUSH_MPLS] = {.type = NL_A_UNSPEC, + .minLen = + sizeof(struct ovs_action_push_mpls), + .maxLen = + sizeof(struct ovs_action_push_mpls), + .optional = TRUE}, + [OVS_ACTION_ATTR_POP_MPLS] = {.type = NL_A_UNSPEC, + .minLen = sizeof(UINT16), + .maxLen = sizeof(UINT16), + .optional = TRUE}, + [OVS_ACTION_ATTR_RECIRC] = {.type = NL_A_UNSPEC, + .minLen = sizeof(UINT32), + .maxLen = sizeof(UINT32), + .optional = TRUE}, + [OVS_ACTION_ATTR_HASH] = {.type = NL_A_UNSPEC, + .minLen = sizeof(struct ovs_action_hash), + .maxLen = sizeof(struct ovs_action_hash), + .optional = TRUE}, + [OVS_ACTION_ATTR_SET] = {.type = NL_A_VAR_LEN, .optional = TRUE}, + [OVS_ACTION_ATTR_SAMPLE] = {.type = NL_A_VAR_LEN, .optional = TRUE} +}; + +/* + *---------------------------------------------------------------------------- + * Netlink interface for flow commands. + *---------------------------------------------------------------------------- + */ + +/* + *---------------------------------------------------------------------------- + * OvsFlowNewCmdHandler -- + * Handler for OVS_FLOW_CMD_NEW/SET/DEL command. + * It also handles FLUSH case (DEL w/o any key in input) + *---------------------------------------------------------------------------- + */ +NTSTATUS +OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS rc = STATUS_SUCCESS; + BOOLEAN ok; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + PNL_MSG_HDR nlMsgHdr = &(msgIn->nlMsg); + PGENL_MSG_HDR genlMsgHdr = &(msgIn->genlMsg); + POVS_HDR ovsHdr = &(msgIn->ovsHdr); + PNL_ATTR nlAttrs[__OVS_FLOW_ATTR_MAX]; + UINT32 attrOffset = NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN; + OvsFlowPut mappedFlow; + OvsFlowStats stats; + struct ovs_flow_stats replyStats; + NL_ERROR nlError = NL_ERROR_SUCCESS; + NL_BUFFER nlBuf; + + RtlZeroMemory(&mappedFlow, sizeof(OvsFlowPut)); + RtlZeroMemory(&stats, sizeof(stats)); + RtlZeroMemory(&replyStats, sizeof(replyStats)); + + if (!(usrParamsCtx->outputBuffer)) { + /* No output buffer */ + rc = STATUS_INVALID_BUFFER_SIZE; + goto done; + } + + /* Get all the top level Flow attributes */ + if ((NlAttrParse(nlMsgHdr, attrOffset, NlMsgAttrsLen(nlMsgHdr), + nlFlowPolicy, nlAttrs, ARRAY_SIZE(nlAttrs))) + != TRUE) { + OVS_LOG_ERROR("Attr Parsing failed for msg: %p", + nlMsgHdr); + rc = STATUS_INVALID_PARAMETER; + goto done; + } + + /* FLOW_DEL command w/o any key input is a flush case. */ + if ((genlMsgHdr->cmd == OVS_FLOW_CMD_DEL) && + (!(nlAttrs[OVS_FLOW_ATTR_KEY]))) { + + rc = OvsFlushFlowIoctl(ovsHdr->dp_ifindex); + + if (rc == STATUS_SUCCESS) { + /* XXX: refactor this code. */ + /* So far so good. Prepare the reply for userspace */ + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength); + + /* Prepare nl Msg headers */ + ok = NlFillOvsMsg(&nlBuf, nlMsgHdr->nlmsgType, 0, + nlMsgHdr->nlmsgSeq, nlMsgHdr->nlmsgPid, + genlMsgHdr->cmd, OVS_FLOW_VERSION, + ovsHdr->dp_ifindex); + if (ok) { + *replyLen = msgOut->nlMsg.nlmsgLen; + } else { + rc = STATUS_INVALID_BUFFER_SIZE; + } + } + + goto done; + } + + if ((rc = _MapNlToFlowPut(msgIn, nlAttrs[OVS_FLOW_ATTR_KEY], + nlAttrs[OVS_FLOW_ATTR_ACTIONS], nlAttrs[OVS_FLOW_ATTR_CLEAR], + &mappedFlow)) + != STATUS_SUCCESS) { + OVS_LOG_ERROR("Conversion to OvsFlowPut failed"); + goto done; + } + + rc = OvsPutFlowIoctl(&mappedFlow, sizeof (struct OvsFlowPut), + &stats); + if (rc != STATUS_SUCCESS) { + OVS_LOG_ERROR("OvsPutFlowIoctl failed."); + goto done; + } + + replyStats.n_packets = stats.packetCount; + replyStats.n_bytes = stats.byteCount; + + /* So far so good. Prepare the reply for userspace */ + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength); + + /* Prepare nl Msg headers */ + ok = NlFillOvsMsg(&nlBuf, nlMsgHdr->nlmsgType, 0, + nlMsgHdr->nlmsgSeq, nlMsgHdr->nlmsgPid, + genlMsgHdr->cmd, OVS_FLOW_VERSION, + ovsHdr->dp_ifindex); + if (!ok) { + rc = STATUS_INVALID_BUFFER_SIZE; + goto done; + } else { + rc = STATUS_SUCCESS; + } + + /* Append OVS_FLOW_ATTR_STATS attribute */ + if (!NlMsgPutTailUnspec(&nlBuf, OVS_FLOW_ATTR_STATS, + (PCHAR)(&replyStats), sizeof(replyStats))) { + OVS_LOG_ERROR("Adding OVS_FLOW_ATTR_STATS attribute failed."); + rc = STATUS_INVALID_BUFFER_SIZE; + goto done; + } + + msgOut->nlMsg.nlmsgLen = NLMSG_ALIGN(NlBufSize(&nlBuf)); + *replyLen = msgOut->nlMsg.nlmsgLen; + +done: + + if (nlError != NL_ERROR_SUCCESS) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + rc = STATUS_SUCCESS; + } + + return rc; +} + +/* + *---------------------------------------------------------------------------- + * OvsFlowNlGetCmdHandler -- + * Handler for OVS_FLOW_CMD_GET/DUMP commands. + *---------------------------------------------------------------------------- + */ +NTSTATUS +OvsFlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS status = STATUS_SUCCESS; + NL_ERROR nlError = NL_ERROR_SUCCESS; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + + if (usrParamsCtx->devOp == OVS_TRANSACTION_DEV_OP) { + status = _FlowNlGetCmdHandler(usrParamsCtx, replyLen); + + /* No trasanctional errors as of now. + * If we have something then we need to convert rc to + * nlError. */ + if ((nlError != NL_ERROR_SUCCESS) && + (usrParamsCtx->outputBuffer)) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + status = STATUS_SUCCESS; + goto done; + } + } else { + status = _FlowNlDumpCmdHandler(usrParamsCtx, replyLen); + } + +done: + return status; +} + +/* + *---------------------------------------------------------------------------- + * _FlowNlGetCmdHandler -- + * Handler for OVS_FLOW_CMD_GET command. + *---------------------------------------------------------------------------- + */ +NTSTATUS +_FlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS rc = STATUS_SUCCESS; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + PNL_MSG_HDR nlMsgHdr = &(msgIn->nlMsg); + POVS_HDR ovsHdr = &(msgIn->ovsHdr); + PNL_MSG_HDR nlMsgOutHdr = NULL; + UINT32 attrOffset = NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN; + PNL_ATTR nlAttrs[__OVS_FLOW_ATTR_MAX]; + + OvsFlowGetInput getInput; + OvsFlowGetOutput getOutput; + NL_BUFFER nlBuf; + PNL_ATTR keyAttrs[__OVS_KEY_ATTR_MAX]; + PNL_ATTR tunnelAttrs[__OVS_TUNNEL_KEY_ATTR_MAX]; + + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength); + RtlZeroMemory(&getInput, sizeof(OvsFlowGetInput)); + RtlZeroMemory(&getOutput, sizeof(OvsFlowGetOutput)); + UINT32 keyAttrOffset = 0; + UINT32 tunnelKeyAttrOffset = 0; + BOOLEAN ok; + + if (usrParamsCtx->inputLength > usrParamsCtx->outputLength) { + /* Should not be the case. + * We'll be copying the flow keys back from + * input buffer to output buffer. */ + rc = STATUS_INVALID_PARAMETER; + OVS_LOG_ERROR("inputLength: %d GREATER THEN outputLength: %d", + usrParamsCtx->inputLength, usrParamsCtx->outputLength); + goto done; + } + + /* Get all the top level Flow attributes */ + if ((NlAttrParse(nlMsgHdr, attrOffset, NlMsgAttrsLen(nlMsgHdr), + nlFlowPolicy, nlAttrs, ARRAY_SIZE(nlAttrs))) + != TRUE) { + OVS_LOG_ERROR("Attr Parsing failed for msg: %p", + nlMsgHdr); + rc = STATUS_INVALID_PARAMETER; + goto done; + } + + keyAttrOffset = (UINT32)((PCHAR) nlAttrs[OVS_FLOW_ATTR_KEY] - + (PCHAR)nlMsgHdr); + + /* Get flow keys attributes */ + if ((NlAttrParseNested(nlMsgHdr, keyAttrOffset, + NlAttrLen(nlAttrs[OVS_FLOW_ATTR_KEY]), + nlFlowKeyPolicy, keyAttrs, ARRAY_SIZE(keyAttrs))) + != TRUE) { + OVS_LOG_ERROR("Key Attr Parsing failed for msg: %p", + nlMsgHdr); + rc = STATUS_INVALID_PARAMETER; + goto done; + } + + if (keyAttrs[OVS_KEY_ATTR_TUNNEL]) { + tunnelKeyAttrOffset = (UINT32)((PCHAR) + (keyAttrs[OVS_KEY_ATTR_TUNNEL]) + - (PCHAR)nlMsgHdr); + + /* Get tunnel keys attributes */ + if ((NlAttrParseNested(nlMsgHdr, tunnelKeyAttrOffset, + NlAttrLen(keyAttrs[OVS_KEY_ATTR_TUNNEL]), + nlFlowTunnelKeyPolicy, + tunnelAttrs, ARRAY_SIZE(tunnelAttrs))) + != TRUE) { + OVS_LOG_ERROR("Tunnel key Attr Parsing failed for msg: %p", + nlMsgHdr); + rc = STATUS_INVALID_PARAMETER; + goto done; + } + } + + _MapKeyAttrToFlowPut(keyAttrs, tunnelAttrs, + &(getInput.key)); + + getInput.dpNo = ovsHdr->dp_ifindex; + getInput.getFlags = FLOW_GET_STATS | FLOW_GET_ACTIONS; + + /* 4th argument is a no op. + * We are keeping this argument to be compatible + * with our dpif-windows based interface. */ + rc = OvsGetFlowIoctl(&getInput, &getOutput); + if (rc != STATUS_SUCCESS) { + OVS_LOG_ERROR("OvsGetFlowIoctl failed."); + goto done; + } + + /* Lets prepare the reply. */ + nlMsgOutHdr = (PNL_MSG_HDR)(NlBufAt(&nlBuf, 0, 0)); + + /* Input already has all the attributes for the flow key. + * Lets copy the values back. */ + ok = NlMsgPutTail(&nlBuf, (PCHAR)(usrParamsCtx->inputBuffer), + usrParamsCtx->inputLength); + if (!ok) { + OVS_LOG_ERROR("Could not copy the data to the buffer tail"); + goto done; + } + + rc = _MapFlowStatsToNlStats(&nlBuf, &((getOutput.info).stats)); + if (rc != STATUS_SUCCESS) { + OVS_LOG_ERROR("_OvsFlowMapFlowKeyToNlStats failed."); + goto done; + } + + rc = _MapFlowActionToNlAction(&nlBuf, ((getOutput.info).actionsLen), + getOutput.info.actions); + if (rc != STATUS_SUCCESS) { + OVS_LOG_ERROR("_MapFlowActionToNlAction failed."); + goto done; + } + + NlMsgSetSize(nlMsgOutHdr, NlBufSize(&nlBuf)); + NlMsgAlignSize(nlMsgOutHdr); + *replyLen += NlMsgSize(nlMsgOutHdr); + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _FlowNlDumpCmdHandler -- + * Handler for OVS_FLOW_CMD_DUMP command. + *---------------------------------------------------------------------------- + */ +NTSTATUS +_FlowNlDumpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS rc = STATUS_SUCCESS; + UINT32 temp = 0; /* To keep compiler happy for calling OvsDoDumpFlows */ + + POVS_OPEN_INSTANCE instance = (POVS_OPEN_INSTANCE) + (usrParamsCtx->ovsInstance); + + if (usrParamsCtx->devOp == OVS_WRITE_DEV_OP) { + /* Dump Start */ + OvsSetupDumpStart(usrParamsCtx); + goto done; + } + + POVS_MESSAGE msgIn = instance->dumpState.ovsMsg; + PNL_MSG_HDR nlMsgHdr = &(msgIn->nlMsg); + PGENL_MSG_HDR genlMsgHdr = &(msgIn->genlMsg); + POVS_HDR ovsHdr = &(msgIn->ovsHdr); + PNL_MSG_HDR nlMsgOutHdr = NULL; + UINT32 hdrOffset = 0; + + /* Get Next */ + OvsFlowDumpOutput dumpOutput; + OvsFlowDumpInput dumpInput; + NL_BUFFER nlBuf; + + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength); + + ASSERT(usrParamsCtx->devOp == OVS_READ_DEV_OP); + ASSERT(usrParamsCtx->outputLength); + + RtlZeroMemory(&dumpInput, sizeof(OvsFlowDumpInput)); + RtlZeroMemory(&dumpOutput, sizeof(OvsFlowDumpOutput)); + + dumpInput.dpNo = ovsHdr->dp_ifindex; + dumpInput.getFlags = FLOW_GET_KEY | FLOW_GET_STATS | FLOW_GET_ACTIONS; + + /* Lets provide as many flows to userspace as possible. */ + do { + dumpInput.position[0] = instance->dumpState.index[0]; + dumpInput.position[1] = instance->dumpState.index[1]; + + rc = OvsDoDumpFlows(&dumpInput, &dumpOutput, &temp); + if (rc != STATUS_SUCCESS) { + OVS_LOG_ERROR("OvsDoDumpFlows failed with rc: %d", rc); + break; + } + + /* Done with Dump, send NLMSG_DONE */ + if (!(dumpOutput.n)) { + BOOLEAN ok; + + OVS_LOG_INFO("Dump Done"); + + nlMsgOutHdr = (PNL_MSG_HDR)(NlBufAt(&nlBuf, NlBufSize(&nlBuf), 0)); + ok = NlFillNlHdr(&nlBuf, NLMSG_DONE, NLM_F_MULTI, + nlMsgHdr->nlmsgSeq, nlMsgHdr->nlmsgPid); + + if (!ok) { + rc = STATUS_INVALID_BUFFER_SIZE; + OVS_LOG_ERROR("Unable to prepare DUMP_DONE reply."); + break; + } else { + rc = STATUS_SUCCESS; + } + + NlMsgAlignSize(nlMsgOutHdr); + *replyLen += NlMsgSize(nlMsgOutHdr); + + FreeUserDumpState(instance); + break; + } else { + BOOLEAN ok; + + hdrOffset = NlBufSize(&nlBuf); + nlMsgOutHdr = (PNL_MSG_HDR)(NlBufAt(&nlBuf, hdrOffset, 0)); + + /* Netlink header */ + ok = NlFillOvsMsg(&nlBuf, nlMsgHdr->nlmsgType, NLM_F_MULTI, + nlMsgHdr->nlmsgSeq, nlMsgHdr->nlmsgPid, + genlMsgHdr->cmd, genlMsgHdr->version, + ovsHdr->dp_ifindex); + + if (!ok) { + /* Reset rc to success so that we can + * send already added messages to user space. */ + rc = STATUS_SUCCESS; + break; + } + + /* Time to add attributes */ + rc = _MapFlowInfoToNl(&nlBuf, &(dumpOutput.flow)); + if (rc != STATUS_SUCCESS) { + /* Adding the attribute failed, we are out of + space in the buffer, remove the appended OVS header */ + NlMsgSetSize(nlMsgOutHdr, + NlMsgSize(nlMsgOutHdr) - + sizeof(struct _OVS_MESSAGE)); + + /* Reset rc to success so that we can + * send already added messages to user space. */ + rc = STATUS_SUCCESS; + break; + } + + NlMsgSetSize(nlMsgOutHdr, NlBufSize(&nlBuf) - hdrOffset); + NlMsgAlignSize(nlMsgOutHdr); + *replyLen += NlMsgSize(nlMsgOutHdr); + instance->dumpState.index[0] = dumpOutput.position[0]; + instance->dumpState.index[1] = dumpOutput.position[1]; + } + } while(TRUE); + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapFlowInfoToNl -- + * Maps OvsFlowInfo to Netlink attributes. + *---------------------------------------------------------------------------- + */ +static NTSTATUS +_MapFlowInfoToNl(PNL_BUFFER nlBuf, OvsFlowInfo *flowInfo) +{ + NTSTATUS rc = STATUS_SUCCESS; + + rc = MapFlowKeyToNlKey(nlBuf, &(flowInfo->key), OVS_FLOW_ATTR_KEY, + OVS_KEY_ATTR_TUNNEL); + if (rc != STATUS_SUCCESS) { + goto done; + } + + rc = _MapFlowStatsToNlStats(nlBuf, &(flowInfo->stats)); + if (rc != STATUS_SUCCESS) { + goto done; + } + + rc = _MapFlowActionToNlAction(nlBuf, flowInfo->actionsLen, + flowInfo->actions); + if (rc != STATUS_SUCCESS) { + goto done; + } + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapFlowStatsToNlStats -- + * Maps OvsFlowStats to OVS_FLOW_ATTR_STATS attribute. + *---------------------------------------------------------------------------- + */ +static NTSTATUS +_MapFlowStatsToNlStats(PNL_BUFFER nlBuf, OvsFlowStats *flowStats) +{ + NTSTATUS rc = STATUS_SUCCESS; + struct ovs_flow_stats replyStats; + + replyStats.n_packets = flowStats->packetCount; + replyStats.n_bytes = flowStats->byteCount; + + if (!NlMsgPutTailU64(nlBuf, OVS_FLOW_ATTR_USED, flowStats->used)) { + rc = STATUS_INVALID_BUFFER_SIZE; + goto done; + } + + if (!NlMsgPutTailUnspec(nlBuf, OVS_FLOW_ATTR_STATS, + (PCHAR)(&replyStats), + sizeof(struct ovs_flow_stats))) { + rc = STATUS_INVALID_BUFFER_SIZE; + goto done; + } + + if (!NlMsgPutTailU8(nlBuf, OVS_FLOW_ATTR_TCP_FLAGS, flowStats->tcpFlags)) { + rc = STATUS_INVALID_BUFFER_SIZE; + goto done; + } + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapFlowActionToNlAction -- + * Maps flow actions to OVS_FLOW_ATTR_ACTION attribute. + *---------------------------------------------------------------------------- + */ +static NTSTATUS +_MapFlowActionToNlAction(PNL_BUFFER nlBuf, uint32_t actionsLen, + PNL_ATTR actions) +{ + NTSTATUS rc = STATUS_SUCCESS; + UINT32 offset = 0; + + offset = NlMsgStartNested(nlBuf, OVS_FLOW_ATTR_ACTIONS); + if (!offset) { + /* Starting the nested attribute failed. */ + rc = STATUS_INVALID_BUFFER_SIZE; + goto error_nested_start; + } + + if (!NlBufCopyAtTail(nlBuf, (PCHAR)actions, actionsLen)) { + /* Adding a nested attribute failed. */ + rc = STATUS_INVALID_BUFFER_SIZE; + goto done; + } + +done: + NlMsgEndNested(nlBuf, offset); +error_nested_start: + return rc; + +} + +/* + *---------------------------------------------------------------------------- + * MapFlowKeyToNlKey -- + * Maps OvsFlowKey to OVS_FLOW_ATTR_KEY attribute. + *---------------------------------------------------------------------------- + */ +NTSTATUS +MapFlowKeyToNlKey(PNL_BUFFER nlBuf, + OvsFlowKey *flowKey, + UINT16 keyType, + UINT16 tunKeyType) +{ + NTSTATUS rc = STATUS_SUCCESS; + struct ovs_key_ethernet ethKey; + UINT32 offset = 0; + + offset = NlMsgStartNested(nlBuf, keyType); + if (!offset) { + /* Starting the nested attribute failed. */ + rc = STATUS_UNSUCCESSFUL; + goto error_nested_start; + } + + /* Ethernet header */ + RtlCopyMemory(&(ethKey.eth_src), flowKey->l2.dlSrc, ETH_ADDR_LEN); + RtlCopyMemory(&(ethKey.eth_dst), flowKey->l2.dlDst, ETH_ADDR_LEN); + + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_ETHERNET, + (PCHAR)(ðKey), + sizeof(struct ovs_key_ethernet))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + if (!NlMsgPutTailU32(nlBuf, OVS_KEY_ATTR_IN_PORT, + flowKey->l2.inPort)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + if (!NlMsgPutTailU16(nlBuf, OVS_KEY_ATTR_ETHERTYPE, + flowKey->l2.dlType)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + if (flowKey->l2.vlanTci) { + if (!NlMsgPutTailU16(nlBuf, OVS_KEY_ATTR_VLAN, + flowKey->l2.vlanTci)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + } + + /* ==== L3 + L4 ==== */ + switch (ntohs(flowKey->l2.dlType)) { + case ETH_TYPE_IPV4: { + IpKey *ipv4FlowPutKey = &(flowKey->ipKey); + rc = _MapFlowIpv4KeyToNlKey(nlBuf, ipv4FlowPutKey); + break; + } + + case ETH_TYPE_IPV6: { + Ipv6Key *ipv6FlowPutKey = &(flowKey->ipv6Key); + Icmp6Key *icmpv6FlowPutKey = &(flowKey->icmp6Key); + rc = _MapFlowIpv6KeyToNlKey(nlBuf, ipv6FlowPutKey, + icmpv6FlowPutKey); + break; + } + + case ETH_TYPE_ARP: + case ETH_TYPE_RARP: { + ArpKey *arpFlowPutKey = &(flowKey->arpKey); + rc = _MapFlowArpKeyToNlKey(nlBuf, arpFlowPutKey); + break; + } + + default: + break; + } + + if (rc != STATUS_SUCCESS) { + goto done; + } + + if (flowKey->tunKey.dst) { + rc = MapFlowTunKeyToNlKey(nlBuf, &(flowKey->tunKey), + tunKeyType); + if (rc != STATUS_SUCCESS) { + goto done; + } + } + +done: + NlMsgEndNested(nlBuf, offset); +error_nested_start: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * MapFlowTunKeyToNlKey -- + * Maps OvsIPv4TunnelKey to OVS_TUNNEL_KEY_ATTR_ID attribute. + *---------------------------------------------------------------------------- + */ +NTSTATUS +MapFlowTunKeyToNlKey(PNL_BUFFER nlBuf, + OvsIPv4TunnelKey *tunKey, + UINT16 tunKeyType) +{ + NTSTATUS rc = STATUS_SUCCESS; + UINT32 offset = 0; + + offset = NlMsgStartNested(nlBuf, tunKeyType); + if (!offset) { + /* Starting the nested attribute failed. */ + rc = STATUS_UNSUCCESSFUL; + goto error_nested_start; + } + + if (!NlMsgPutTailU64(nlBuf, OVS_TUNNEL_KEY_ATTR_ID, + tunKey->tunnelId)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + if (!NlMsgPutTailU32(nlBuf, OVS_TUNNEL_KEY_ATTR_IPV4_DST, + tunKey->dst)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + if (!NlMsgPutTailU32(nlBuf, OVS_TUNNEL_KEY_ATTR_IPV4_SRC, + tunKey->src)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + if (!NlMsgPutTailU8(nlBuf, OVS_TUNNEL_KEY_ATTR_TOS, + tunKey->tos)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + if (!NlMsgPutTailU8(nlBuf, OVS_TUNNEL_KEY_ATTR_TTL, + tunKey->ttl)) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + +done: + NlMsgEndNested(nlBuf, offset); +error_nested_start: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapFlowTunKeyToNlKey -- + * Maps OvsIPv4FlowPutKey to OVS_KEY_ATTR_IPV4 attribute. + *---------------------------------------------------------------------------- + */ +static NTSTATUS +_MapFlowIpv4KeyToNlKey(PNL_BUFFER nlBuf, IpKey *ipv4FlowPutKey) +{ + NTSTATUS rc = STATUS_SUCCESS; + struct ovs_key_ipv4 ipv4Key; + + ipv4Key.ipv4_src = ipv4FlowPutKey->nwSrc; + ipv4Key.ipv4_dst = ipv4FlowPutKey->nwDst; + ipv4Key.ipv4_proto = ipv4FlowPutKey->nwProto; + ipv4Key.ipv4_tos = ipv4FlowPutKey->nwTos; + ipv4Key.ipv4_ttl = ipv4FlowPutKey->nwTtl; + ipv4Key.ipv4_frag = ipv4FlowPutKey->nwFrag; + + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_IPV4, + (PCHAR)(&ipv4Key), + sizeof(struct ovs_key_ipv4))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + switch (ipv4Key.ipv4_proto) { + case IPPROTO_TCP: { + struct ovs_key_tcp tcpKey; + tcpKey.tcp_src = ipv4FlowPutKey->l4.tpSrc; + tcpKey.tcp_dst = ipv4FlowPutKey->l4.tpDst; + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP, + (PCHAR)(&tcpKey), + sizeof(tcpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + break; + } + + case IPPROTO_UDP: { + struct ovs_key_udp udpKey; + udpKey.udp_src = ipv4FlowPutKey->l4.tpSrc; + udpKey.udp_dst = ipv4FlowPutKey->l4.tpDst; + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_UDP, + (PCHAR)(&udpKey), + sizeof(udpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + break; + } + + case IPPROTO_SCTP: { + struct ovs_key_sctp sctpKey; + sctpKey.sctp_src = ipv4FlowPutKey->l4.tpSrc; + sctpKey.sctp_dst = ipv4FlowPutKey->l4.tpDst; + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_SCTP, + (PCHAR)(&sctpKey), + sizeof(sctpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + break; + } + + case IPPROTO_ICMP: { + struct ovs_key_icmp icmpKey; + /* XXX: revisit to see if htons is needed */ + icmpKey.icmp_type = (__u8)(ipv4FlowPutKey->l4.tpSrc); + icmpKey.icmp_code = (__u8)(ipv4FlowPutKey->l4.tpDst); + + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_ICMP, + (PCHAR)(&icmpKey), + sizeof(icmpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + break; + } + + default: + break; + } + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapFlowIpv6KeyToNlKey -- + * Maps _MapFlowIpv6KeyToNlKey to OVS_KEY_ATTR_IPV6 attribute. + *---------------------------------------------------------------------------- + */ +static NTSTATUS +_MapFlowIpv6KeyToNlKey(PNL_BUFFER nlBuf, Ipv6Key *ipv6FlowPutKey, + Icmp6Key *icmpv6FlowPutKey) +{ + NTSTATUS rc = STATUS_SUCCESS; + struct ovs_key_ipv6 ipv6Key; + + RtlCopyMemory(&(ipv6Key.ipv6_src), &ipv6FlowPutKey->ipv6Src, + sizeof ipv6Key.ipv6_src); + RtlCopyMemory(&(ipv6Key.ipv6_dst), &ipv6FlowPutKey->ipv6Dst, + sizeof ipv6Key.ipv6_dst); + + ipv6Key.ipv6_label = ipv6FlowPutKey->ipv6Label; + ipv6Key.ipv6_proto = ipv6FlowPutKey->nwProto; + ipv6Key.ipv6_tclass = ipv6FlowPutKey->nwTos; + ipv6Key.ipv6_hlimit = ipv6FlowPutKey->nwTtl; + ipv6Key.ipv6_frag = ipv6FlowPutKey->nwFrag; + + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_IPV6, + (PCHAR)(&ipv6Key), + sizeof(ipv6Key))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + switch (ipv6Key.ipv6_proto) { + case IPPROTO_TCP: { + struct ovs_key_tcp tcpKey; + tcpKey.tcp_src = ipv6FlowPutKey->l4.tpSrc; + tcpKey.tcp_dst = ipv6FlowPutKey->l4.tpDst; + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP, + (PCHAR)(&tcpKey), + sizeof(tcpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + break; + } + + case IPPROTO_UDP: { + struct ovs_key_udp udpKey; + udpKey.udp_src = ipv6FlowPutKey->l4.tpSrc; + udpKey.udp_dst = ipv6FlowPutKey->l4.tpDst; + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_UDP, + (PCHAR)(&udpKey), + sizeof(udpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + break; + } + + case IPPROTO_SCTP: { + struct ovs_key_sctp sctpKey; + sctpKey.sctp_src = ipv6FlowPutKey->l4.tpSrc; + sctpKey.sctp_dst = ipv6FlowPutKey->l4.tpDst; + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_SCTP, + (PCHAR)(&sctpKey), + sizeof(sctpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + break; + } + + case IPPROTO_ICMPV6: { + struct ovs_key_icmpv6 icmpV6Key; + struct ovs_key_nd ndKey; + + /* XXX: revisit to see if htons is needed */ + icmpV6Key.icmpv6_type = (__u8)(icmpv6FlowPutKey->l4.tpSrc); + icmpV6Key.icmpv6_code = (__u8)(icmpv6FlowPutKey->l4.tpDst); + + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_ICMPV6, + (PCHAR)(&icmpV6Key), + sizeof(icmpV6Key))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + RtlCopyMemory(&(ndKey.nd_target), &icmpv6FlowPutKey->ndTarget, + sizeof(icmpv6FlowPutKey->ndTarget)); + RtlCopyMemory(&(ndKey.nd_sll), &icmpv6FlowPutKey->arpSha, + ETH_ADDR_LEN); + RtlCopyMemory(&(ndKey.nd_tll), &icmpv6FlowPutKey->arpTha, + ETH_ADDR_LEN); + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_ND, + (PCHAR)(&ndKey), + sizeof(ndKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + + break; + } + + default: + break; + } + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapFlowArpKeyToNlKey -- + * Maps _MapFlowArpKeyToNlKey to OVS_KEY_ATTR_ARP attribute. + *---------------------------------------------------------------------------- + */ +static NTSTATUS +_MapFlowArpKeyToNlKey(PNL_BUFFER nlBuf, ArpKey *arpFlowPutKey) +{ + NTSTATUS rc = STATUS_SUCCESS; + struct ovs_key_arp arpKey; + + arpKey.arp_sip = arpFlowPutKey->nwSrc; + arpKey.arp_tip = arpFlowPutKey->nwDst; + + RtlCopyMemory(&(arpKey.arp_sha), arpFlowPutKey->arpSha, ETH_ADDR_LEN); + RtlCopyMemory(&(arpKey.arp_tha), arpFlowPutKey->arpTha, ETH_ADDR_LEN); + + /* + * Flow_Extract() stores 'nwProto' in host order for ARP since 'nwProto' is + * 1 byte field and the ARP opcode is 2 bytes, and all of the kernel code + * understand this while looking at an ARP key. + * While we pass up the ARP key to userspace, convert from host order to + * network order. Likewise, when processing an ARP key from userspace, + * convert from network order to host order. + * + * It is important to note that the flow table stores the ARP opcode field + * in host order. + */ + arpKey.arp_op = htons(arpFlowPutKey->nwProto); + + if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_ARP, + (PCHAR)(&arpKey), + sizeof(arpKey))) { + rc = STATUS_UNSUCCESSFUL; + goto done; + } + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapNlToFlowPut -- + * Maps input netlink message to OvsFlowPut. + *---------------------------------------------------------------------------- + */ +static NTSTATUS +_MapNlToFlowPut(POVS_MESSAGE msgIn, PNL_ATTR keyAttr, + PNL_ATTR actionAttr, PNL_ATTR flowAttrClear, + OvsFlowPut *mappedFlow) +{ + NTSTATUS rc = STATUS_SUCCESS; + PNL_MSG_HDR nlMsgHdr = &(msgIn->nlMsg); + PGENL_MSG_HDR genlMsgHdr = &(msgIn->genlMsg); + POVS_HDR ovsHdr = &(msgIn->ovsHdr); + + UINT32 keyAttrOffset = (UINT32)((PCHAR)keyAttr - (PCHAR)nlMsgHdr); + UINT32 tunnelKeyAttrOffset; + + PNL_ATTR keyAttrs[__OVS_KEY_ATTR_MAX] = {NULL}; + PNL_ATTR tunnelAttrs[__OVS_TUNNEL_KEY_ATTR_MAX] = {NULL}; + + /* Get flow keys attributes */ + if ((NlAttrParseNested(nlMsgHdr, keyAttrOffset, NlAttrLen(keyAttr), + nlFlowKeyPolicy, keyAttrs, ARRAY_SIZE(keyAttrs))) + != TRUE) { + OVS_LOG_ERROR("Key Attr Parsing failed for msg: %p", + nlMsgHdr); + rc = STATUS_INVALID_PARAMETER; + goto done; + } + + if (keyAttrs[OVS_KEY_ATTR_TUNNEL]) { + tunnelKeyAttrOffset = (UINT32)((PCHAR) + (keyAttrs[OVS_KEY_ATTR_TUNNEL]) + - (PCHAR)nlMsgHdr); + + /* Get tunnel keys attributes */ + if ((NlAttrParseNested(nlMsgHdr, tunnelKeyAttrOffset, + NlAttrLen(keyAttrs[OVS_KEY_ATTR_TUNNEL]), + nlFlowTunnelKeyPolicy, + tunnelAttrs, ARRAY_SIZE(tunnelAttrs))) + != TRUE) { + OVS_LOG_ERROR("Tunnel key Attr Parsing failed for msg: %p", + nlMsgHdr); + rc = STATUS_INVALID_PARAMETER; + goto done; + } + } + + _MapKeyAttrToFlowPut(keyAttrs, tunnelAttrs, + &(mappedFlow->key)); + + /* Map the action */ + if (actionAttr) { + mappedFlow->actionsLen = NlAttrGetSize(actionAttr); + mappedFlow->actions = NlAttrGet(actionAttr); + } + + mappedFlow->dpNo = ovsHdr->dp_ifindex; + + _MapNlToFlowPutFlags(genlMsgHdr, flowAttrClear, + mappedFlow); + +done: + return rc; +} + +/* + *---------------------------------------------------------------------------- + * _MapNlToFlowPutFlags -- + * Maps netlink message to OvsFlowPut->flags. + *---------------------------------------------------------------------------- + */ +static VOID +_MapNlToFlowPutFlags(PGENL_MSG_HDR genlMsgHdr, + PNL_ATTR flowAttrClear, OvsFlowPut *mappedFlow) +{ + uint32_t flags = 0; + + switch (genlMsgHdr->cmd) { + case OVS_FLOW_CMD_NEW: + flags |= OVSWIN_FLOW_PUT_CREATE; + break; + case OVS_FLOW_CMD_DEL: + flags |= OVSWIN_FLOW_PUT_DELETE; + break; + case OVS_FLOW_CMD_SET: + flags |= OVSWIN_FLOW_PUT_MODIFY; + break; + default: + ASSERT(0); + } + + if (flowAttrClear) { + flags |= OVSWIN_FLOW_PUT_CLEAR; + } + + mappedFlow->flags = flags; +} + +/* + *---------------------------------------------------------------------------- + * _MapKeyAttrToFlowPut -- + * Converts FLOW_KEY attribute to OvsFlowPut->key. + *---------------------------------------------------------------------------- + */ +static VOID +_MapKeyAttrToFlowPut(PNL_ATTR *keyAttrs, + PNL_ATTR *tunnelAttrs, + OvsFlowKey *destKey) +{ + _MapTunAttrToFlowPut(keyAttrs, tunnelAttrs, destKey); + + /* ===== L2 headers ===== */ + destKey->l2.inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]); + + if (keyAttrs[OVS_KEY_ATTR_ETHERNET]) { + const struct ovs_key_ethernet *eth_key; + eth_key = NlAttrGet(keyAttrs[OVS_KEY_ATTR_ETHERNET]); + RtlCopyMemory(destKey->l2.dlSrc, eth_key->eth_src, ETH_ADDR_LEN); + RtlCopyMemory(destKey->l2.dlDst, eth_key->eth_dst, ETH_ADDR_LEN); + } + + /* TODO: Ideally ETHERTYPE should not be optional. + * But during vswitchd bootup we are seeing FLOW_ADD + * requests with no ETHERTYPE attributes. + * Need to verify this. */ + if (keyAttrs[OVS_KEY_ATTR_ETHERTYPE]) { + destKey->l2.dlType = (NlAttrGetU16(keyAttrs + [OVS_KEY_ATTR_ETHERTYPE])); + } + + if (keyAttrs[OVS_KEY_ATTR_VLAN]) { + destKey->l2.vlanTci = NlAttrGetU16(keyAttrs[OVS_KEY_ATTR_VLAN]); + } + + /* ==== L3 + L4. ==== */ + destKey->l2.keyLen = OVS_WIN_TUNNEL_KEY_SIZE + OVS_L2_KEY_SIZE + - destKey->l2.offset; + + switch (ntohs(destKey->l2.dlType)) { + case ETH_TYPE_IPV4: { + + if (keyAttrs[OVS_KEY_ATTR_IPV4]) { + const struct ovs_key_ipv4 *ipv4Key; + + ipv4Key = NlAttrGet(keyAttrs[OVS_KEY_ATTR_IPV4]); + IpKey *ipv4FlowPutKey = &(destKey->ipKey); + ipv4FlowPutKey->nwSrc = ipv4Key->ipv4_src; + ipv4FlowPutKey->nwDst = ipv4Key->ipv4_dst; + ipv4FlowPutKey->nwProto = ipv4Key->ipv4_proto; + ipv4FlowPutKey->nwTos = ipv4Key->ipv4_tos; + ipv4FlowPutKey->nwTtl = ipv4Key->ipv4_ttl; + ipv4FlowPutKey->nwFrag = ipv4Key->ipv4_frag; + + if (keyAttrs[OVS_KEY_ATTR_TCP]) { + const struct ovs_key_tcp *tcpKey; + tcpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_TCP]); + ipv4FlowPutKey->l4.tpSrc = tcpKey->tcp_src; + ipv4FlowPutKey->l4.tpDst = tcpKey->tcp_dst; + } + + if (keyAttrs[OVS_KEY_ATTR_UDP]) { + const struct ovs_key_udp *udpKey; + udpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_UDP]); + ipv4FlowPutKey->l4.tpSrc = udpKey->udp_src; + ipv4FlowPutKey->l4.tpDst = udpKey->udp_dst; + } + + if (keyAttrs[OVS_KEY_ATTR_SCTP]) { + const struct ovs_key_sctp *sctpKey; + sctpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_SCTP]); + ipv4FlowPutKey->l4.tpSrc = sctpKey->sctp_src; + ipv4FlowPutKey->l4.tpDst = sctpKey->sctp_dst; + } + + destKey->l2.keyLen += OVS_IP_KEY_SIZE; + } + break; + } + case ETH_TYPE_IPV6: { + + if (keyAttrs[OVS_KEY_ATTR_IPV6]) { + const struct ovs_key_ipv6 *ipv6Key; + + ipv6Key = NlAttrGet(keyAttrs[OVS_KEY_ATTR_IPV6]); + Ipv6Key *ipv6FlowPutKey = &(destKey->ipv6Key); + + RtlCopyMemory(&ipv6FlowPutKey->ipv6Src, ipv6Key->ipv6_src, + sizeof ipv6Key->ipv6_src); + RtlCopyMemory(&ipv6FlowPutKey->ipv6Dst, ipv6Key->ipv6_dst, + sizeof ipv6Key->ipv6_dst); + + ipv6FlowPutKey->ipv6Label = ipv6Key->ipv6_label; + ipv6FlowPutKey->nwProto = ipv6Key->ipv6_proto; + ipv6FlowPutKey->nwTos = ipv6Key->ipv6_tclass; + ipv6FlowPutKey->nwTtl = ipv6Key->ipv6_hlimit; + ipv6FlowPutKey->nwFrag = ipv6Key->ipv6_frag; + + if (keyAttrs[OVS_KEY_ATTR_TCP]) { + const struct ovs_key_tcp *tcpKey; + tcpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_TCP]); + ipv6FlowPutKey->l4.tpSrc = tcpKey->tcp_src; + ipv6FlowPutKey->l4.tpDst = tcpKey->tcp_dst; + } + + if (keyAttrs[OVS_KEY_ATTR_UDP]) { + const struct ovs_key_udp *udpKey; + udpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_UDP]); + ipv6FlowPutKey->l4.tpSrc = udpKey->udp_src; + ipv6FlowPutKey->l4.tpDst = udpKey->udp_dst; + } + + if (keyAttrs[OVS_KEY_ATTR_SCTP]) { + const struct ovs_key_sctp *sctpKey; + sctpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_SCTP]); + ipv6FlowPutKey->l4.tpSrc = sctpKey->sctp_src; + ipv6FlowPutKey->l4.tpDst = sctpKey->sctp_dst; + } + + if (keyAttrs[OVS_KEY_ATTR_ICMPV6]) { + const struct ovs_key_icmpv6 *icmpv6Key; + + Icmp6Key *icmp6FlowPutKey= &(destKey->icmp6Key); + + icmpv6Key = NlAttrGet(keyAttrs[OVS_KEY_ATTR_ICMPV6]); + + icmp6FlowPutKey->l4.tpSrc = icmpv6Key->icmpv6_type; + icmp6FlowPutKey->l4.tpDst = icmpv6Key->icmpv6_code; + + if (keyAttrs[OVS_KEY_ATTR_ND]) { + const struct ovs_key_nd *ndKey; + + ndKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_ND]); + RtlCopyMemory(&icmp6FlowPutKey->ndTarget, + ndKey->nd_target, sizeof (icmp6FlowPutKey->ndTarget)); + RtlCopyMemory(icmp6FlowPutKey->arpSha, + ndKey->nd_sll, ETH_ADDR_LEN); + RtlCopyMemory(icmp6FlowPutKey->arpTha, + ndKey->nd_tll, ETH_ADDR_LEN); + } + + destKey->l2.keyLen += OVS_ICMPV6_KEY_SIZE; + + } else { + + destKey->l2.keyLen += OVS_IPV6_KEY_SIZE; + } + + ipv6FlowPutKey->pad = 0; + } + break; + } + case ETH_TYPE_ARP: + case ETH_TYPE_RARP: { + + if (keyAttrs[OVS_KEY_ATTR_ARP]) { + ArpKey *arpFlowPutKey = &destKey->arpKey; + const struct ovs_key_arp *arpKey; + + arpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_ARP]); + + arpFlowPutKey->nwSrc = arpKey->arp_sip; + arpFlowPutKey->nwDst = arpKey->arp_tip; + + RtlCopyMemory(arpFlowPutKey->arpSha, arpKey->arp_sha, ETH_ADDR_LEN); + RtlCopyMemory(arpFlowPutKey->arpTha, arpKey->arp_tha, ETH_ADDR_LEN); + /* Kernel datapath assumes 'arpFlowPutKey->nwProto' to be in host + * order. */ + arpFlowPutKey->nwProto = (UINT8)ntohs((arpKey->arp_op)); + arpFlowPutKey->pad[0] = 0; + arpFlowPutKey->pad[1] = 0; + arpFlowPutKey->pad[2] = 0; + destKey->l2.keyLen += OVS_ARP_KEY_SIZE; + break; + } + } + } +} + +/* + *---------------------------------------------------------------------------- + * _MapTunAttrToFlowPut -- + * Converts FLOW_TUNNEL_KEY attribute to OvsFlowKey->tunKey. + *---------------------------------------------------------------------------- + */ +static VOID +_MapTunAttrToFlowPut(PNL_ATTR *keyAttrs, + PNL_ATTR *tunAttrs, + OvsFlowKey *destKey) +{ + if (keyAttrs[OVS_KEY_ATTR_TUNNEL]) { + + if (tunAttrs[OVS_TUNNEL_KEY_ATTR_ID]) { + destKey->tunKey.tunnelId = NlAttrGetU64 + (tunAttrs[OVS_TUNNEL_KEY_ATTR_ID]); + destKey->tunKey.flags |= OVS_TNL_F_KEY; + } + + if (tunAttrs[OVS_TUNNEL_KEY_ATTR_IPV4_DST]) { + destKey->tunKey.dst = NlAttrGetU32 + (tunAttrs[OVS_TUNNEL_KEY_ATTR_IPV4_DST]); + } + + if (tunAttrs[OVS_TUNNEL_KEY_ATTR_IPV4_SRC]) { + destKey->tunKey.src = NlAttrGetU32 + (tunAttrs[OVS_TUNNEL_KEY_ATTR_IPV4_SRC]); + } + + if (tunAttrs[OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT]) { + destKey->tunKey.flags |= OVS_TNL_F_DONT_FRAGMENT; + } + + if (tunAttrs[OVS_TUNNEL_KEY_ATTR_CSUM]) { + destKey->tunKey.flags |= OVS_TNL_F_CSUM; + } + + if (tunAttrs[OVS_TUNNEL_KEY_ATTR_TOS]) { + destKey->tunKey.tos = NlAttrGetU8 + (tunAttrs[OVS_TUNNEL_KEY_ATTR_TOS]); + } + + if (tunAttrs[OVS_TUNNEL_KEY_ATTR_TTL]) { + destKey->tunKey.ttl = NlAttrGetU8 + (tunAttrs[OVS_TUNNEL_KEY_ATTR_TTL]); + } + + destKey->tunKey.pad = 0; + destKey->l2.offset = 0; + } else { + destKey->tunKey.attr[0] = 0; + destKey->tunKey.attr[1] = 0; + destKey->tunKey.attr[2] = 0; + destKey->l2.offset = sizeof destKey->tunKey; + } +} + +/* + *---------------------------------------------------------------------------- + * OvsDeleteFlowTable -- + * Results: + * NDIS_STATUS_SUCCESS always. + *---------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsDeleteFlowTable(OVS_DATAPATH *datapath) +{ + if (datapath == NULL || datapath->flowTable == NULL) { + return NDIS_STATUS_SUCCESS; + } + + DeleteAllFlows(datapath); + OvsFreeMemoryWithTag(datapath->flowTable, OVS_FLOW_POOL_TAG); + datapath->flowTable = NULL; + NdisFreeRWLock(datapath->lock); + + return NDIS_STATUS_SUCCESS; +} + +/* + *---------------------------------------------------------------------------- + * OvsAllocateFlowTable -- + * Results: + * NDIS_STATUS_SUCCESS on success. + * NDIS_STATUS_RESOURCES if memory couldn't be allocated + *---------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsAllocateFlowTable(OVS_DATAPATH *datapath, + POVS_SWITCH_CONTEXT switchContext) +{ + PLIST_ENTRY bucket; + int i; + + datapath->flowTable = OvsAllocateMemoryWithTag( + OVS_FLOW_TABLE_SIZE * sizeof(LIST_ENTRY), OVS_FLOW_POOL_TAG); + if (!datapath->flowTable) { + return NDIS_STATUS_RESOURCES; + } + for (i = 0; i < OVS_FLOW_TABLE_SIZE; i++) { + bucket = &(datapath->flowTable[i]); + InitializeListHead(bucket); + } + datapath->lock = NdisAllocateRWLock(switchContext->NdisFilterHandle); + + return NDIS_STATUS_SUCCESS; +} + + +/* + *---------------------------------------------------------------------------- + * GetStartAddrNBL -- + * Get the virtual address of the frame. + * + * Results: + * Virtual address of the frame. + *---------------------------------------------------------------------------- + */ +static __inline VOID * +GetStartAddrNBL(const NET_BUFFER_LIST *_pNB) +{ + PMDL curMdl; + PUINT8 curBuffer; + PEthHdr curHeader; + + ASSERT(_pNB); + + // Ethernet Header is a guaranteed safe access. + curMdl = (NET_BUFFER_LIST_FIRST_NB(_pNB))->CurrentMdl; + curBuffer = MmGetSystemAddressForMdlSafe(curMdl, LowPagePriority); + if (!curBuffer) { + return NULL; + } + + curHeader = (PEthHdr) + (curBuffer + (NET_BUFFER_LIST_FIRST_NB(_pNB))->CurrentMdlOffset); + + return (VOID *) curHeader; +} + +VOID +OvsFlowUsed(OvsFlow *flow, + const NET_BUFFER_LIST *packet, + const POVS_PACKET_HDR_INFO layers) +{ + LARGE_INTEGER tickCount; + + KeQueryTickCount(&tickCount); + flow->used = tickCount.QuadPart * ovsTimeIncrementPerTick; + flow->packetCount++; + flow->byteCount += OvsPacketLenNBL(packet); + flow->tcpFlags |= OvsGetTcpFlags(packet, &flow->key, layers); +} + + +VOID +DeleteAllFlows(OVS_DATAPATH *datapath) +{ + INT i; + PLIST_ENTRY bucket; + + for (i = 0; i < OVS_FLOW_TABLE_SIZE; i++) { + PLIST_ENTRY next; + bucket = &(datapath->flowTable[i]); + while (!IsListEmpty(bucket)) { + OvsFlow *flow; + next = bucket->Flink; + flow = CONTAINING_RECORD(next, OvsFlow, ListEntry); + RemoveFlow(datapath, &flow); + } + } +} + +/* + *---------------------------------------------------------------------------- + * Initializes 'flow' members from 'packet', 'skb_priority', 'tun_id', and + * 'ofp_in_port'. + * + * Initializes 'packet' header pointers as follows: + * + * - packet->l2 to the start of the Ethernet header. + * + * - packet->l3 to just past the Ethernet header, or just past the + * vlan_header if one is present, to the first byte of the payload of the + * Ethernet frame. + * + * - packet->l4 to just past the IPv4 header, if one is present and has a + * correct length, and otherwise NULL. + * + * - packet->l7 to just past the TCP or UDP or ICMP header, if one is + * present and has a correct length, and otherwise NULL. + * + * Returns NDIS_STATUS_SUCCESS normally. Fails only if packet data cannot be accessed + * (e.g. if Pkt_CopyBytesOut() returns an error). + *---------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsExtractFlow(const NET_BUFFER_LIST *packet, + UINT32 inPort, + OvsFlowKey *flow, + POVS_PACKET_HDR_INFO layers, + OvsIPv4TunnelKey *tunKey) +{ + struct Eth_Header *eth; + UINT8 offset = 0; + PVOID vlanTagValue; + + layers->value = 0; + + if (tunKey) { + ASSERT(tunKey->dst != 0); + RtlMoveMemory(&flow->tunKey, tunKey, sizeof flow->tunKey); + flow->l2.offset = 0; + } else { + flow->tunKey.dst = 0; + flow->l2.offset = OVS_WIN_TUNNEL_KEY_SIZE; + } + + flow->l2.inPort = inPort; + + if ( OvsPacketLenNBL(packet) < ETH_HEADER_LEN_DIX) { + flow->l2.keyLen = OVS_WIN_TUNNEL_KEY_SIZE + 8 - flow->l2.offset; + return NDIS_STATUS_SUCCESS; + } + + /* Link layer. */ + eth = (Eth_Header *)GetStartAddrNBL((NET_BUFFER_LIST *)packet); + memcpy(flow->l2.dlSrc, eth->src, ETH_ADDR_LENGTH); + memcpy(flow->l2.dlDst, eth->dst, ETH_ADDR_LENGTH); + + /* + * vlan_tci. + */ + vlanTagValue = NET_BUFFER_LIST_INFO(packet, Ieee8021QNetBufferListInfo); + if (vlanTagValue) { + PNDIS_NET_BUFFER_LIST_8021Q_INFO vlanTag = + (PNDIS_NET_BUFFER_LIST_8021Q_INFO)(PVOID *)&vlanTagValue; + flow->l2.vlanTci = htons(vlanTag->TagHeader.VlanId | OVSWIN_VLAN_CFI | + (vlanTag->TagHeader.UserPriority << 13)); + } else { + if (eth->dix.typeNBO == ETH_TYPE_802_1PQ_NBO) { + Eth_802_1pq_Tag *tag= (Eth_802_1pq_Tag *)ð->dix.typeNBO; + flow->l2.vlanTci = ((UINT16)tag->priority << 13) | + OVSWIN_VLAN_CFI | + ((UINT16)tag->vidHi << 8) | tag->vidLo; + offset = sizeof (Eth_802_1pq_Tag); + } else { + flow->l2.vlanTci = 0; + } + /* + * XXX + * Please note after this point, src mac and dst mac should + * not be accessed through eth + */ + eth = (Eth_Header *)((UINT8 *)eth + offset); + } + + /* + * dl_type. + * + * XXX assume that at least the first + * 12 bytes of received packets are mapped. This code has the stronger + * assumption that at least the first 22 bytes of 'packet' is mapped (if my + * arithmetic is right). + */ + if (ETH_TYPENOT8023(eth->dix.typeNBO)) { + flow->l2.dlType = eth->dix.typeNBO; + layers->l3Offset = ETH_HEADER_LEN_DIX + offset; + } else if (OvsPacketLenNBL(packet) >= ETH_HEADER_LEN_802_3 && + eth->e802_3.llc.dsap == 0xaa && + eth->e802_3.llc.ssap == 0xaa && + eth->e802_3.llc.control == ETH_LLC_CONTROL_UFRAME && + eth->e802_3.snap.snapOrg[0] == 0x00 && + eth->e802_3.snap.snapOrg[1] == 0x00 && + eth->e802_3.snap.snapOrg[2] == 0x00) { + flow->l2.dlType = eth->e802_3.snap.snapType.typeNBO; + layers->l3Offset = ETH_HEADER_LEN_802_3 + offset; + } else { + flow->l2.dlType = htons(OVSWIN_DL_TYPE_NONE); + layers->l3Offset = ETH_HEADER_LEN_DIX + offset; + } + + flow->l2.keyLen = OVS_WIN_TUNNEL_KEY_SIZE + OVS_L2_KEY_SIZE - flow->l2.offset; + /* Network layer. */ + if (flow->l2.dlType == htons(ETH_TYPE_IPV4)) { + struct IPHdr ip_storage; + const struct IPHdr *nh; + IpKey *ipKey = &flow->ipKey; + + flow->l2.keyLen += OVS_IP_KEY_SIZE; + layers->isIPv4 = 1; + nh = OvsGetIp(packet, layers->l3Offset, &ip_storage); + if (nh) { + layers->l4Offset = layers->l3Offset + nh->ihl * 4; + + ipKey->nwSrc = nh->saddr; + ipKey->nwDst = nh->daddr; + ipKey->nwProto = nh->protocol; + + ipKey->nwTos = nh->tos; + if (nh->frag_off & htons(IP_MF | IP_OFFSET)) { + ipKey->nwFrag = OVSWIN_NW_FRAG_ANY; + if (nh->frag_off & htons(IP_OFFSET)) { + ipKey->nwFrag |= OVSWIN_NW_FRAG_LATER; + } + } else { + ipKey->nwFrag = 0; + } + + ipKey->nwTtl = nh->ttl; + ipKey->l4.tpSrc = 0; + ipKey->l4.tpDst = 0; + + if (!(nh->frag_off & htons(IP_OFFSET))) { + if (ipKey->nwProto == SOCKET_IPPROTO_TCP) { + OvsParseTcp(packet, &ipKey->l4, layers); + } else if (ipKey->nwProto == SOCKET_IPPROTO_UDP) { + OvsParseUdp(packet, &ipKey->l4, layers); + } else if (ipKey->nwProto == SOCKET_IPPROTO_ICMP) { + ICMPHdr icmpStorage; + const ICMPHdr *icmp; + + icmp = OvsGetIcmp(packet, layers->l4Offset, &icmpStorage); + if (icmp) { + ipKey->l4.tpSrc = htons(icmp->type); + ipKey->l4.tpDst = htons(icmp->code); + layers->l7Offset = layers->l4Offset + sizeof *icmp; + } + } + } + } else { + ((UINT64 *)ipKey)[0] = 0; + ((UINT64 *)ipKey)[1] = 0; + } + } else if (flow->l2.dlType == htons(ETH_TYPE_IPV6)) { + NDIS_STATUS status; + flow->l2.keyLen += OVS_IPV6_KEY_SIZE; + status = OvsParseIPv6(packet, flow, layers); + if (status != NDIS_STATUS_SUCCESS) { + memset(&flow->ipv6Key, 0, sizeof (Ipv6Key)); + return status; + } + layers->isIPv6 = 1; + flow->ipv6Key.l4.tpSrc = 0; + flow->ipv6Key.l4.tpDst = 0; + flow->ipv6Key.pad = 0; + + if (flow->ipv6Key.nwProto == SOCKET_IPPROTO_TCP) { + OvsParseTcp(packet, &(flow->ipv6Key.l4), layers); + } else if (flow->ipv6Key.nwProto == SOCKET_IPPROTO_UDP) { + OvsParseUdp(packet, &(flow->ipv6Key.l4), layers); + } else if (flow->ipv6Key.nwProto == SOCKET_IPPROTO_ICMPV6) { + OvsParseIcmpV6(packet, flow, layers); + flow->l2.keyLen += (OVS_ICMPV6_KEY_SIZE - OVS_IPV6_KEY_SIZE); + } + } else if (flow->l2.dlType == htons(ETH_TYPE_ARP)) { + EtherArp arpStorage; + const EtherArp *arp; + ArpKey *arpKey = &flow->arpKey; + ((UINT64 *)arpKey)[0] = 0; + ((UINT64 *)arpKey)[1] = 0; + ((UINT64 *)arpKey)[2] = 0; + flow->l2.keyLen += OVS_ARP_KEY_SIZE; + arp = OvsGetArp(packet, layers->l3Offset, &arpStorage); + if (arp && arp->ea_hdr.ar_hrd == htons(1) && + arp->ea_hdr.ar_pro == htons(ETH_TYPE_IPV4) && + arp->ea_hdr.ar_hln == ETH_ADDR_LENGTH && + arp->ea_hdr.ar_pln == 4) { + /* We only match on the lower 8 bits of the opcode. */ + if (ntohs(arp->ea_hdr.ar_op) <= 0xff) { + arpKey->nwProto = (UINT8)ntohs(arp->ea_hdr.ar_op); + } + if (arpKey->nwProto == ARPOP_REQUEST + || arpKey->nwProto == ARPOP_REPLY) { + memcpy(&arpKey->nwSrc, arp->arp_spa, 4); + memcpy(&arpKey->nwDst, arp->arp_tpa, 4); + memcpy(arpKey->arpSha, arp->arp_sha, ETH_ADDR_LENGTH); + memcpy(arpKey->arpTha, arp->arp_tha, ETH_ADDR_LENGTH); + } + } + } + + return NDIS_STATUS_SUCCESS; +} + +__inline BOOLEAN +FlowEqual(UINT64 *src, UINT64 *dst, UINT32 size) +{ + UINT32 i; + ASSERT((size & 0x7) == 0); + ASSERT(((UINT64)src & 0x7) == 0); + ASSERT(((UINT64)dst & 0x7) == 0); + for (i = 0; i < (size >> 3); i++) { + if (src[i] != dst[i]) { + return FALSE; + } + } + return TRUE; +} + + +/* + * ---------------------------------------------------------------------------- + * AddFlow -- + * Add a flow to flow table. + * + * Results: + * NDIS_STATUS_SUCCESS if no same flow in the flow table. + * ---------------------------------------------------------------------------- + */ +NTSTATUS +AddFlow(OVS_DATAPATH *datapath, OvsFlow *flow) +{ + PLIST_ENTRY head; + + if (OvsLookupFlow(datapath, &flow->key, &flow->hash, TRUE) != NULL) { + return STATUS_INVALID_HANDLE; + } + + head = &(datapath->flowTable[HASH_BUCKET(flow->hash)]); + /* + * We need fence here to make sure flow's nextPtr is updated before + * head->nextPtr is updated. + */ + KeMemoryBarrier(); + + //KeAcquireSpinLock(&FilterDeviceExtension->NblQueueLock, &oldIrql); + InsertTailList(head, &flow->ListEntry); + //KeReleaseSpinLock(&FilterDeviceExtension->NblQueueLock, oldIrql); + + datapath->nFlows++; + + return STATUS_SUCCESS; +} + + +/* ---------------------------------------------------------------------------- + * RemoveFlow -- + * Remove a flow from flow table, and added to wait list + * ---------------------------------------------------------------------------- + */ +VOID +RemoveFlow(OVS_DATAPATH *datapath, + OvsFlow **flow) +{ + OvsFlow *f = *flow; + *flow = NULL; + + ASSERT(datapath->nFlows); + datapath->nFlows--; + // Remove the flow from queue + RemoveEntryList(&f->ListEntry); + FreeFlow(f); +} + + +/* + * ---------------------------------------------------------------------------- + * OvsLookupFlow -- + * + * Find flow from flow table based on flow key. + * Caller should either hold portset handle or should + * have a flowRef in datapath or Acquired datapath. + * + * Results: + * Flow pointer if lookup successful. + * NULL if not exists. + * ---------------------------------------------------------------------------- + */ +OvsFlow * +OvsLookupFlow(OVS_DATAPATH *datapath, + const OvsFlowKey *key, + UINT64 *hash, + BOOLEAN hashValid) +{ + PLIST_ENTRY link, head; + UINT16 offset = key->l2.offset; + UINT16 size = key->l2.keyLen; + UINT8 *start; + + ASSERT(key->tunKey.dst || offset == sizeof (OvsIPv4TunnelKey)); + ASSERT(!key->tunKey.dst || offset == 0); + + start = (UINT8 *)key + offset; + + if (!hashValid) { + *hash = OvsJhashBytes(start, size, 0); + } + + head = &datapath->flowTable[HASH_BUCKET(*hash)]; + link = head->Flink; + while (link != head) { + OvsFlow *flow = CONTAINING_RECORD(link, OvsFlow, ListEntry); + + if (flow->hash == *hash && + flow->key.l2.val == key->l2.val && + FlowEqual((UINT64 *)((uint8 *)&flow->key + offset), + (UINT64 *)start, size)) { + return flow; + } + link = link->Flink; + } + return NULL; +} + + +/* + * ---------------------------------------------------------------------------- + * OvsHashFlow -- + * Calculate the hash for the given flow key. + * ---------------------------------------------------------------------------- + */ +UINT64 +OvsHashFlow(const OvsFlowKey *key) +{ + UINT16 offset = key->l2.offset; + UINT16 size = key->l2.keyLen; + UINT8 *start; + + ASSERT(key->tunKey.dst || offset == sizeof (OvsIPv4TunnelKey)); + ASSERT(!key->tunKey.dst || offset == 0); + start = (UINT8 *)key + offset; + return OvsJhashBytes(start, size, 0); +} + + +/* + * ---------------------------------------------------------------------------- + * FreeFlow -- + * Free a flow and its actions. + * ---------------------------------------------------------------------------- + */ +VOID +FreeFlow(OvsFlow *flow) +{ + ASSERT(flow); + OvsFreeMemoryWithTag(flow, OVS_FLOW_POOL_TAG); +} + +NTSTATUS +OvsDoDumpFlows(OvsFlowDumpInput *dumpInput, + OvsFlowDumpOutput *dumpOutput, + UINT32 *replyLen) +{ + UINT32 dpNo; + OVS_DATAPATH *datapath = NULL; + OvsFlow *flow; + PLIST_ENTRY node, head; + UINT32 column = 0; + UINT32 rowIndex, columnIndex; + LOCK_STATE_EX dpLockState; + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN findNextNonEmpty = FALSE; + + dpNo = dumpInput->dpNo; + if (gOvsSwitchContext->dpNo != dpNo) { + status = STATUS_INVALID_PARAMETER; + goto exit; + } + + rowIndex = dumpInput->position[0]; + if (rowIndex >= OVS_FLOW_TABLE_SIZE) { + dumpOutput->n = 0; + *replyLen = sizeof(*dumpOutput); + goto exit; + } + + columnIndex = dumpInput->position[1]; + + datapath = &gOvsSwitchContext->datapath; + ASSERT(datapath); + OvsAcquireDatapathRead(datapath, &dpLockState, FALSE); + + head = &datapath->flowTable[rowIndex]; + node = head->Flink; + + while (column < columnIndex) { + if (node == head) { + break; + } + node = node->Flink; + column++; + } + + if (node == head) { + findNextNonEmpty = TRUE; + columnIndex = 0; + } + + if (findNextNonEmpty) { + while (head == node) { + if (++rowIndex >= OVS_FLOW_TABLE_SIZE) { + dumpOutput->n = 0; + goto dp_unlock; + } + head = &datapath->flowTable[rowIndex]; + node = head->Flink; + } + } + + ASSERT(node != head); + ASSERT(rowIndex < OVS_FLOW_TABLE_SIZE); + + flow = CONTAINING_RECORD(node, OvsFlow, ListEntry); + status = ReportFlowInfo(flow, dumpInput->getFlags, &dumpOutput->flow); + + if (status == STATUS_BUFFER_TOO_SMALL) { + dumpOutput->n = sizeof(OvsFlowDumpOutput) + flow->actionsLen; + *replyLen = sizeof(*dumpOutput); + } else { + dumpOutput->n = 1; //one flow reported. + *replyLen = sizeof(*dumpOutput) + dumpOutput->flow.actionsLen; + } + + dumpOutput->position[0] = rowIndex; + dumpOutput->position[1] = ++columnIndex; + +dp_unlock: + OvsReleaseDatapath(datapath, &dpLockState); + +exit: + return status; +} + +static NTSTATUS +ReportFlowInfo(OvsFlow *flow, + UINT32 getFlags, + OvsFlowInfo *info) +{ + NTSTATUS status = STATUS_SUCCESS; + + if (getFlags & FLOW_GET_KEY) { + // always copy the tunnel key part + RtlCopyMemory(&info->key, &flow->key, + flow->key.l2.keyLen + flow->key.l2.offset); + } + + if (getFlags & FLOW_GET_STATS) { + OvsFlowStats *stats = &info->stats; + stats->packetCount = flow->packetCount; + stats->byteCount = flow->byteCount; + stats->used = (UINT32)flow->used; + stats->tcpFlags = flow->tcpFlags; + } + + if (getFlags & FLOW_GET_ACTIONS) { + if (flow->actionsLen == 0) { + info->actionsLen = 0; + } else { + info->actions = flow->actions; + info->actionsLen = flow->actionsLen; + } + } + + return status; +} + +NTSTATUS +OvsPutFlowIoctl(PVOID inputBuffer, + UINT32 inputLength, + struct OvsFlowStats *stats) +{ + NTSTATUS status = STATUS_SUCCESS; + OVS_DATAPATH *datapath = NULL; + ULONG actionsLen; + OvsFlowPut *put; + UINT32 dpNo; + LOCK_STATE_EX dpLockState; + + if ((inputLength < sizeof(OvsFlowPut)) || (inputBuffer == NULL)) { + return STATUS_INFO_LENGTH_MISMATCH; + } + + put = (OvsFlowPut *)inputBuffer; + if (put->actionsLen > 0) { + actionsLen = put->actionsLen; + } else { + actionsLen = 0; + } + + dpNo = put->dpNo; + if (gOvsSwitchContext->dpNo != dpNo) { + status = STATUS_INVALID_PARAMETER; + goto exit; + } + + datapath = &gOvsSwitchContext->datapath; + ASSERT(datapath); + OvsAcquireDatapathWrite(datapath, &dpLockState, FALSE); + status = HandleFlowPut(put, datapath, stats); + OvsReleaseDatapath(datapath, &dpLockState); + +exit: + return status; +} + + +/* Handles flow add, modify as well as delete */ +static NTSTATUS +HandleFlowPut(OvsFlowPut *put, + OVS_DATAPATH *datapath, + struct OvsFlowStats *stats) +{ + BOOLEAN mayCreate, mayModify, mayDelete; + OvsFlow *KernelFlow; + UINT64 hash; + NTSTATUS status = STATUS_SUCCESS; + + mayCreate = (put->flags & OVSWIN_FLOW_PUT_CREATE) != 0; + mayModify = (put->flags & OVSWIN_FLOW_PUT_MODIFY) != 0; + mayDelete = (put->flags & OVSWIN_FLOW_PUT_DELETE) != 0; + + if ((mayCreate || mayModify) == mayDelete) { + return STATUS_INVALID_PARAMETER; + } + + KernelFlow = OvsLookupFlow(datapath, &put->key, &hash, FALSE); + if (!KernelFlow) { + if (!mayCreate) { + return STATUS_INVALID_PARAMETER; + } + + status = OvsPrepareFlow(&KernelFlow, put, hash); + if (status != STATUS_SUCCESS) { + FreeFlow(KernelFlow); + return STATUS_UNSUCCESSFUL; + } + + status = AddFlow(datapath, KernelFlow); + if (status != STATUS_SUCCESS) { + FreeFlow(KernelFlow); + return STATUS_UNSUCCESSFUL; + } + + /* Validate the flow addition */ + { + UINT64 newHash; + OvsFlow *flow = OvsLookupFlow(datapath, &put->key, &newHash, + FALSE); + ASSERT(flow); + ASSERT(newHash == hash); + if (!flow || newHash != hash) { + return STATUS_UNSUCCESSFUL; + } + } + } else { + stats->packetCount = KernelFlow->packetCount; + stats->byteCount = KernelFlow->byteCount; + stats->tcpFlags = KernelFlow->tcpFlags; + stats->used = (UINT32)KernelFlow->used; + + if (mayModify) { + OvsFlow *newFlow; + status = OvsPrepareFlow(&newFlow, put, hash); + if (status != STATUS_SUCCESS) { + return STATUS_UNSUCCESSFUL; + } + + KernelFlow = OvsLookupFlow(datapath, &put->key, &hash, TRUE); + if (KernelFlow) { + if ((put->flags & OVSWIN_FLOW_PUT_CLEAR) == 0) { + newFlow->packetCount = KernelFlow->packetCount; + newFlow->byteCount = KernelFlow->byteCount; + newFlow->tcpFlags = KernelFlow->tcpFlags; + } + RemoveFlow(datapath, &KernelFlow); + } else { + if ((put->flags & OVSWIN_FLOW_PUT_CLEAR) == 0) { + newFlow->packetCount = stats->packetCount; + newFlow->byteCount = stats->byteCount; + newFlow->tcpFlags = stats->tcpFlags; + } + } + status = AddFlow(datapath, newFlow); + ASSERT(status == STATUS_SUCCESS); + + /* Validate the flow addition */ + { + UINT64 newHash; + OvsFlow *testflow = OvsLookupFlow(datapath, &put->key, + &newHash, FALSE); + ASSERT(testflow); + ASSERT(newHash == hash); + if (!testflow || newHash != hash) { + FreeFlow(newFlow); + return STATUS_UNSUCCESSFUL; + } + } + } else { + if (mayDelete) { + if (KernelFlow) { + RemoveFlow(datapath, &KernelFlow); + } + } else { + /* Return success if an identical flow already exists. */ + /* XXX: should we return EEXIST in a netlink error? */ + return STATUS_SUCCESS; + } + } + } + return STATUS_SUCCESS; +} + +static NTSTATUS +OvsPrepareFlow(OvsFlow **flow, + const OvsFlowPut *put, + UINT64 hash) +{ + OvsFlow *localFlow = *flow; + NTSTATUS status = STATUS_SUCCESS; + + do { + *flow = localFlow = + OvsAllocateMemoryWithTag(sizeof(OvsFlow) + put->actionsLen, + OVS_FLOW_POOL_TAG); + if (localFlow == NULL) { + status = STATUS_NO_MEMORY; + break; + } + + localFlow->key = put->key; + localFlow->actionsLen = put->actionsLen; + if (put->actionsLen) { + NdisMoveMemory((PUCHAR)localFlow->actions, put->actions, + put->actionsLen); + } + localFlow->userActionsLen = 0; // 0 indicate no conversion is made + localFlow->used = 0; + localFlow->packetCount = 0; + localFlow->byteCount = 0; + localFlow->tcpFlags = 0; + localFlow->hash = hash; + } while(FALSE); + + return status; +} + +NTSTATUS +OvsGetFlowIoctl(PVOID inputBuffer, + PVOID outputBuffer) +{ + NTSTATUS status = STATUS_SUCCESS; + OVS_DATAPATH *datapath = NULL; + OvsFlow *flow; + UINT32 getFlags, getActionsLen; + OvsFlowGetInput *getInput; + OvsFlowGetOutput *getOutput; + UINT64 hash; + UINT32 dpNo; + LOCK_STATE_EX dpLockState; + + getInput = (OvsFlowGetInput *) inputBuffer; + getFlags = getInput->getFlags; + getActionsLen = getInput->actionsLen; + + if (outputBuffer == NULL) { + return STATUS_INFO_LENGTH_MISMATCH; + } + + dpNo = getInput->dpNo; + if (gOvsSwitchContext->dpNo != dpNo) { + status = STATUS_INVALID_PARAMETER; + goto exit; + } + + datapath = &gOvsSwitchContext->datapath; + ASSERT(datapath); + OvsAcquireDatapathRead(datapath, &dpLockState, FALSE); + flow = OvsLookupFlow(datapath, &getInput->key, &hash, FALSE); + if (!flow) { + status = STATUS_INVALID_PARAMETER; + goto dp_unlock; + } + + getOutput = (OvsFlowGetOutput *)outputBuffer; + ReportFlowInfo(flow, getFlags, &getOutput->info); + +dp_unlock: + OvsReleaseDatapath(datapath, &dpLockState); +exit: + return status; +} + +NTSTATUS +OvsFlushFlowIoctl(UINT32 dpNo) +{ + NTSTATUS status = STATUS_SUCCESS; + OVS_DATAPATH *datapath = NULL; + LOCK_STATE_EX dpLockState; + + if (gOvsSwitchContext->dpNo != dpNo) { + status = STATUS_INVALID_PARAMETER; + goto exit; + } + + datapath = &gOvsSwitchContext->datapath; + ASSERT(datapath); + OvsAcquireDatapathWrite(datapath, &dpLockState, FALSE); + DeleteAllFlows(datapath); + OvsReleaseDatapath(datapath, &dpLockState); + +exit: + return status; +} + +UINT32 +OvsFlowKeyAttrSize(void) +{ + return NlAttrTotalSize(4) /* OVS_KEY_ATTR_PRIORITY */ + + NlAttrTotalSize(0) /* OVS_KEY_ATTR_TUNNEL */ + + OvsTunKeyAttrSize() + + NlAttrTotalSize(4) /* OVS_KEY_ATTR_IN_PORT */ + + NlAttrTotalSize(4) /* OVS_KEY_ATTR_SKB_MARK */ + + NlAttrTotalSize(4) /* OVS_KEY_ATTR_DP_HASH */ + + NlAttrTotalSize(4) /* OVS_KEY_ATTR_RECIRC_ID */ + + NlAttrTotalSize(12) /* OVS_KEY_ATTR_ETHERNET */ + + NlAttrTotalSize(2) /* OVS_KEY_ATTR_ETHERTYPE */ + + NlAttrTotalSize(4) /* OVS_KEY_ATTR_VLAN */ + + NlAttrTotalSize(0) /* OVS_KEY_ATTR_ENCAP */ + + NlAttrTotalSize(2) /* OVS_KEY_ATTR_ETHERTYPE */ + + NlAttrTotalSize(40) /* OVS_KEY_ATTR_IPV6 */ + + NlAttrTotalSize(2) /* OVS_KEY_ATTR_ICMPV6 */ + + NlAttrTotalSize(28); /* OVS_KEY_ATTR_ND */ +} + +UINT32 +OvsTunKeyAttrSize(void) +{ + /* Whenever adding new OVS_TUNNEL_KEY_ FIELDS, we should consider + * updating this function. + */ + return NlAttrTotalSize(8) /* OVS_TUNNEL_KEY_ATTR_ID */ + + NlAttrTotalSize(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_SRC */ + + NlAttrTotalSize(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_DST */ + + NlAttrTotalSize(1) /* OVS_TUNNEL_KEY_ATTR_TOS */ + + NlAttrTotalSize(1) /* OVS_TUNNEL_KEY_ATTR_TTL */ + + NlAttrTotalSize(0) /* OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT */ + + NlAttrTotalSize(0) /* OVS_TUNNEL_KEY_ATTR_CSUM */ + + NlAttrTotalSize(0) /* OVS_TUNNEL_KEY_ATTR_OAM */ + + NlAttrTotalSize(256) /* OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS */ + + NlAttrTotalSize(2) /* OVS_TUNNEL_KEY_ATTR_TP_SRC */ + + NlAttrTotalSize(2); /* OVS_TUNNEL_KEY_ATTR_TP_DST */ +} + +#pragma warning( pop ) diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Flow.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Flow.h --- openvswitch-2.3.1/datapath-windows/ovsext/Flow.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Flow.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __FLOW_H_ +#define __FLOW_H_ 1 + +#include "precomp.h" +#include "Switch.h" +#include "User.h" +#include "NetProto.h" +#include "Datapath.h" + +typedef struct _OvsFlow { + LIST_ENTRY ListEntry; // In Datapath's flowTable. + OvsFlowKey key; + UINT64 hash; + UINT32 actionsLen; + UINT8 tcpFlags; + UINT64 used; + UINT64 packetCount; + UINT64 byteCount; + UINT32 userActionsLen; // used for flow query + UINT32 actionBufferLen; // used for flow reuse + NL_ATTR actions[1]; +} OvsFlow; + + +typedef struct _OvsLayers { + UINT32 l3Ofs; // IPv4, IPv6, ARP, or other L3 header. + UINT32 l4Ofs; // TCP, UDP, ICMP, ICMPv6, or other L4 header. + UINT32 l7Ofs; // L4 protocol's payload. +} OvsLayers; + +extern UINT64 ovsUserTimestampDelta; +extern UINT64 ovsTimeIncrementPerTick; + +NDIS_STATUS OvsDeleteFlowTable(OVS_DATAPATH *datapath); +NDIS_STATUS OvsAllocateFlowTable(OVS_DATAPATH *datapath, + POVS_SWITCH_CONTEXT switchContext); + +NDIS_STATUS OvsExtractFlow(const NET_BUFFER_LIST *pkt, UINT32 inPort, + OvsFlowKey *flow, POVS_PACKET_HDR_INFO layers, + OvsIPv4TunnelKey *tunKey); +OvsFlow *OvsLookupFlow(OVS_DATAPATH *datapath, const OvsFlowKey *key, + UINT64 *hash, BOOLEAN hashValid); +UINT64 OvsHashFlow(const OvsFlowKey *key); +VOID OvsFlowUsed(OvsFlow *flow, const NET_BUFFER_LIST *pkt, + const POVS_PACKET_HDR_INFO layers); + +NTSTATUS OvsDumpFlowIoctl(PVOID inputBuffer, UINT32 inputLength, + PVOID outputBuffer, UINT32 outputLength, + UINT32 *replyLen); +NTSTATUS OvsPutFlowIoctl(PVOID inputBuffer, UINT32 inputLength, + struct OvsFlowStats *stats); +NTSTATUS OvsGetFlowIoctl(PVOID inputBuffer, PVOID outputBuffer); +NTSTATUS OvsFlushFlowIoctl(UINT32 dpNo); + +NTSTATUS OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); +NTSTATUS OvsFlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); +NTSTATUS MapFlowKeyToNlKey(PNL_BUFFER nlBuf, OvsFlowKey *flowKey, + UINT16 keyType, UINT16 tunKeyType); +NTSTATUS MapFlowTunKeyToNlKey(PNL_BUFFER nlBuf, OvsIPv4TunnelKey *tunKey, + UINT16 tunKeyType); +UINT32 OvsFlowKeyAttrSize(void); +UINT32 OvsTunKeyAttrSize(void); + +/* Flags for tunneling */ +#define OVS_TNL_F_DONT_FRAGMENT (1 << 0) +#define OVS_TNL_F_CSUM (1 << 1) +#define OVS_TNL_F_KEY (1 << 2) + +#endif /* __FLOW_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/IpHelper.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/IpHelper.c --- openvswitch-2.3.1/datapath-windows/ovsext/IpHelper.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/IpHelper.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1691 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "IpHelper.h" +#include "Switch.h" +#include "Jhash.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_IPHELPER +#include "Debug.h" + +/* + * Fow now, we assume only one internal adapter + */ + +KSTART_ROUTINE OvsStartIpHelper; + + +/* + * Only when the internal IP is configured and virtual + * internal port is connected, the IP helper request can be + * queued. + */ +static BOOLEAN ovsInternalIPConfigured; +static UINT32 ovsInternalPortNo; +static GUID ovsInternalNetCfgId; +static MIB_IF_ROW2 ovsInternalRow; +static MIB_IPINTERFACE_ROW ovsInternalIPRow; + +/* we only keep one internal IP for reference, it will not be used for + * determining SRC IP of Tunnel + */ +static UINT32 ovsInternalIP; + + +/* + * FWD_ENTRY --------> IPFORWARD_ENTRY + * | + * |--------------------------------------> IPENIGH_ENTRY + * + * IPFORWARD_ENTRY ------> FWD_ENTRY LIST with same IPFORWARD + * + * IPNEIGH_ENTRY ------> FWD_ENTRY LIST with same IPNEIGH + * + */ + +static PLIST_ENTRY ovsFwdHashTable; // based on DST IP +static PLIST_ENTRY ovsRouteHashTable; // based on DST PREFIX +static PLIST_ENTRY ovsNeighHashTable; // based on DST IP +static LIST_ENTRY ovsSortedIPNeighList; +static UINT32 ovsNumFwdEntries; + + +static PNDIS_RW_LOCK_EX ovsTableLock; +static NDIS_SPIN_LOCK ovsIpHelperLock; + +static LIST_ENTRY ovsIpHelperRequestList; +static UINT32 ovsNumIpHelperRequests; + +static HANDLE ipInterfaceNotificationHandle; +static HANDLE ipRouteNotificationHandle; +static HANDLE unicastIPNotificationHandle; + +static OVS_IP_HELPER_THREAD_CONTEXT ovsIpHelperThreadContext; + +static POVS_IPFORWARD_ENTRY OvsLookupIPForwardEntry(PIP_ADDRESS_PREFIX prefix); +static VOID OvsRemoveIPForwardEntry(POVS_IPFORWARD_ENTRY ipf); +static VOID OvsRemoveAllFwdEntriesWithSrc(UINT32 ipAddr); +static VOID OvsCleanupIpHelperRequestList(VOID); +static VOID OvsCleanupFwdTable(VOID); +static VOID OvsAddToSortedNeighList(POVS_IPNEIGH_ENTRY ipn); + +static VOID +OvsDumpIfRow(PMIB_IF_ROW2 ifRow) +{ + OVS_LOG_INFO("InterfaceLuid: NetLuidIndex: %d, type: %d", + ifRow->InterfaceLuid.Info.NetLuidIndex, + ifRow->InterfaceLuid.Info.IfType); + OVS_LOG_INFO("InterfaceIndex: %d", ifRow->InterfaceIndex); + + OVS_LOG_INFO("Interface GUID: %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", + ifRow->InterfaceGuid.Data1, + ifRow->InterfaceGuid.Data2, + ifRow->InterfaceGuid.Data3, + *(UINT16 *)ifRow->InterfaceGuid.Data4, + ifRow->InterfaceGuid.Data4[2], + ifRow->InterfaceGuid.Data4[3], + ifRow->InterfaceGuid.Data4[4], + ifRow->InterfaceGuid.Data4[5], + ifRow->InterfaceGuid.Data4[6], + ifRow->InterfaceGuid.Data4[7]); + OVS_LOG_INFO("Perm MAC Address: %02x:%02x:%02x:%02x:%02x:%02x", + ifRow->PermanentPhysicalAddress[0], + ifRow->PermanentPhysicalAddress[1], + ifRow->PermanentPhysicalAddress[2], + ifRow->PermanentPhysicalAddress[3], + ifRow->PermanentPhysicalAddress[4], + ifRow->PermanentPhysicalAddress[5]); +} + + +static VOID +OvsDumpIfTable(PMIB_IF_TABLE2 ifTable) +{ + PMIB_IF_ROW2 ifRow; + UINT32 i; + + OVS_LOG_INFO("======Number of entries: %d========", ifTable->NumEntries); + + for (i = 0; i < ifTable->NumEntries; i++) { + ifRow = &ifTable->Table[i]; + OvsDumpIfRow(ifRow); + } +} + + +NTSTATUS +OvsGetIfEntry(GUID *interfaceGuid, PMIB_IF_ROW2 ifEntry) +{ + NTSTATUS status; + PMIB_IF_TABLE2 ifTable; + UINT32 i; + + if (interfaceGuid == NULL || ifEntry == NULL) { + return STATUS_INVALID_PARAMETER; + } + + status = GetIfTable2Ex(MibIfTableNormal, &ifTable); + + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fail to get if table, status: %x", status); + return status; + } + status = STATUS_NOT_FOUND; + + for (i = 0; i < ifTable->NumEntries; i++) { + PMIB_IF_ROW2 ifRow; + + ifRow = &ifTable->Table[i]; + if (!memcmp(interfaceGuid, &ifRow->InterfaceGuid, sizeof (GUID))) { + RtlCopyMemory(ifEntry, ifRow, sizeof (MIB_IF_ROW2)); + status = STATUS_SUCCESS; + OvsDumpIfRow(ifEntry); + break; + } + } + + FreeMibTable(ifTable); + return status; +} + + +static VOID +OvsDumpIPInterfaceEntry(PMIB_IPINTERFACE_ROW ipRow) +{ + OVS_LOG_INFO("InterfaceLuid: NetLuidIndex: %d, type: %d", + ipRow->InterfaceLuid.Info.NetLuidIndex, + ipRow->InterfaceLuid.Info.IfType); + OVS_LOG_INFO("InterfaceIndex: %d", ipRow->InterfaceIndex); + + OVS_LOG_INFO("MaxReassembleSize: %u", ipRow->MaxReassemblySize); +} + + +NTSTATUS +OvsGetIPInterfaceEntry(NET_LUID luid, + PMIB_IPINTERFACE_ROW ipRow) +{ + NTSTATUS status; + + if (ipRow == NULL) { + return STATUS_INVALID_PARAMETER; + } + + ipRow->Family = AF_INET; + ipRow->InterfaceLuid.Value = luid.Value; + + status = GetIpInterfaceEntry(ipRow); + + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fail to get internal IP Interface mib row, status: %x", + status); + return status; + } + OvsDumpIPInterfaceEntry(ipRow); + return status; +} + + +static VOID +OvsDumpIPEntry(PMIB_UNICASTIPADDRESS_ROW ipRow) +{ + UINT32 ipAddr; + + OVS_LOG_INFO("InterfaceLuid: NetLuidIndex: %d, type: %d", + ipRow->InterfaceLuid.Info.NetLuidIndex, + ipRow->InterfaceLuid.Info.IfType); + + OVS_LOG_INFO("InterfaceIndex: %d", ipRow->InterfaceIndex); + + ASSERT(ipRow->Address.si_family == AF_INET); + + ipAddr = ipRow->Address.Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("Unicast Address: %d.%d.%d.%d\n", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, ipAddr >> 24); +} + + +NTSTATUS +OvsGetIPEntry(NET_LUID interfaceLuid, + PMIB_UNICASTIPADDRESS_ROW ipEntry) +{ + PMIB_UNICASTIPADDRESS_TABLE ipTable; + NTSTATUS status; + UINT32 i; + + if (ipEntry == NULL || ipEntry == NULL) { + return STATUS_INVALID_PARAMETER; + } + + status = GetUnicastIpAddressTable(AF_INET, &ipTable); + + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fail to get unicast address table, status: %x", status); + return status; + } + + status = STATUS_NOT_FOUND; + + for (i = 0; i < ipTable->NumEntries; i++) { + PMIB_UNICASTIPADDRESS_ROW ipRow; + + ipRow = &ipTable->Table[i]; + if (ipRow->InterfaceLuid.Value == interfaceLuid.Value) { + RtlCopyMemory(ipEntry, ipRow, sizeof (*ipRow)); + OvsDumpIPEntry(ipEntry); + status = STATUS_SUCCESS; + break; + } + } + + FreeMibTable(ipTable); + return status; +} + +#ifdef OVS_ENABLE_IPPATH +static VOID +OvsDumpIPPath(PMIB_IPPATH_ROW ipPath) +{ + UINT32 ipAddr = ipPath->Source.Ipv4.sin_addr.s_addr; + + OVS_LOG_INFO("Source: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); + + ipAddr = ipPath->Destination.Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("Destination: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); + + ipAddr = ipPath->CurrentNextHop.Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("NextHop: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); +} + + +NTSTATUS +OvsGetIPPathEntry(PMIB_IPPATH_ROW ipPath) +{ + NTSTATUS status; + UINT32 ipAddr = ipPath->Destination.Ipv4.sin_addr.s_addr; + + status = GetIpPathEntry(ipPath); + + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fail to get IP path to %d.%d.%d.%d, status:%x", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff, status); + return status; + } + OvsDumpIPPath(ipPath); + return status; +} +#endif + +static VOID +OvsDumpRoute(const SOCKADDR_INET *sourceAddress, + const SOCKADDR_INET *destinationAddress, + PMIB_IPFORWARD_ROW2 route) +{ + UINT32 ipAddr = destinationAddress->Ipv4.sin_addr.s_addr; + + OVS_LOG_INFO("Destination: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); + + ipAddr = sourceAddress->Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("Source: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); + + ipAddr = route->NextHop.Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("NextHop: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); +} + + +NTSTATUS +OvsGetRoute(NET_LUID interfaceLuid, + const SOCKADDR_INET *destinationAddress, + PMIB_IPFORWARD_ROW2 route, + SOCKADDR_INET *sourceAddress) +{ + NTSTATUS status; + + if (destinationAddress == NULL || route == NULL) { + return STATUS_INVALID_PARAMETER; + } + + status = GetBestRoute2(&interfaceLuid, 0, + NULL, destinationAddress, + 0, route, sourceAddress); + + if (status != STATUS_SUCCESS) { + UINT32 ipAddr = destinationAddress->Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("Fail to get route to %d.%d.%d.%d, status: %x", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff, status); + return status; + } + + OvsDumpRoute(sourceAddress, destinationAddress, route); + return status; +} + +static VOID +OvsDumpIPNeigh(PMIB_IPNET_ROW2 ipNeigh) +{ + UINT32 ipAddr = ipNeigh->Address.Ipv4.sin_addr.s_addr; + + OVS_LOG_INFO("Neigh: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); + OVS_LOG_INFO("MAC Address: %02x:%02x:%02x:%02x:%02x:%02x", + ipNeigh->PhysicalAddress[0], + ipNeigh->PhysicalAddress[1], + ipNeigh->PhysicalAddress[2], + ipNeigh->PhysicalAddress[3], + ipNeigh->PhysicalAddress[4], + ipNeigh->PhysicalAddress[5]); +} + + +NTSTATUS +OvsGetIPNeighEntry(PMIB_IPNET_ROW2 ipNeigh) +{ + NTSTATUS status; + + ASSERT(ipNeigh); + + status = GetIpNetEntry2(ipNeigh); + + if (status != STATUS_SUCCESS) { + UINT32 ipAddr = ipNeigh->Address.Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("Fail to get ARP entry: %d.%d.%d.%d, status: %x", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff, status); + return status; + } + if (ipNeigh->State == NlnsReachable || + ipNeigh->State == NlnsPermanent) { + OvsDumpIPNeigh(ipNeigh); + return STATUS_SUCCESS; + } + return STATUS_FWP_TCPIP_NOT_READY; +} + + +NTSTATUS +OvsResolveIPNeighEntry(PMIB_IPNET_ROW2 ipNeigh) +{ + NTSTATUS status; + + ASSERT(ipNeigh); + status = ResolveIpNetEntry2(ipNeigh, NULL); + + if (status != STATUS_SUCCESS) { + UINT32 ipAddr = ipNeigh->Address.Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("Fail to resolve ARP entry: %d.%d.%d.%d, status: %x", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff, status); + return status; + } + + if (ipNeigh->State == NlnsReachable || + ipNeigh->State == NlnsPermanent) { + OvsDumpIPNeigh(ipNeigh); + return STATUS_SUCCESS; + } + return STATUS_FWP_TCPIP_NOT_READY; +} + + +NTSTATUS +OvsGetOrResolveIPNeigh(UINT32 ipAddr, + PMIB_IPNET_ROW2 ipNeigh) +{ + NTSTATUS status; + + ASSERT(ipNeigh); + + RtlZeroMemory(ipNeigh, sizeof (*ipNeigh)); + ipNeigh->InterfaceLuid.Value = ovsInternalRow.InterfaceLuid.Value; + ipNeigh->InterfaceIndex = ovsInternalRow.InterfaceIndex; + ipNeigh->Address.si_family = AF_INET; + ipNeigh->Address.Ipv4.sin_addr.s_addr = ipAddr; + + status = OvsGetIPNeighEntry(ipNeigh); + + if (status != STATUS_SUCCESS) { + RtlZeroMemory(ipNeigh, sizeof (*ipNeigh)); + ipNeigh->InterfaceLuid.Value = ovsInternalRow.InterfaceLuid.Value; + ipNeigh->InterfaceIndex = ovsInternalRow.InterfaceIndex; + ipNeigh->Address.si_family = AF_INET; + ipNeigh->Address.Ipv4.sin_addr.s_addr = ipAddr; + status = OvsResolveIPNeighEntry(ipNeigh); + } + return status; +} + + +static VOID +OvsChangeCallbackIpInterface(PVOID context, + PMIB_IPINTERFACE_ROW ipRow, + MIB_NOTIFICATION_TYPE notificationType) +{ + UNREFERENCED_PARAMETER(context); + switch (notificationType) { + case MibParameterNotification: + case MibAddInstance: + if (ipRow->InterfaceLuid.Info.NetLuidIndex == + ovsInternalRow.InterfaceLuid.Info.NetLuidIndex && + ipRow->InterfaceLuid.Info.IfType == + ovsInternalRow.InterfaceLuid.Info.IfType && + ipRow->InterfaceIndex == ovsInternalRow.InterfaceIndex) { + /* + * Update the IP Interface Row + */ + NdisAcquireSpinLock(&ovsIpHelperLock); + RtlCopyMemory(&ovsInternalIPRow, ipRow, + sizeof (PMIB_IPINTERFACE_ROW)); + ovsInternalIPConfigured = TRUE; + NdisReleaseSpinLock(&ovsIpHelperLock); + } + OVS_LOG_INFO("IP Interface with NetLuidIndex: %d, type: %d is %s", + ipRow->InterfaceLuid.Info.NetLuidIndex, + ipRow->InterfaceLuid.Info.IfType, + notificationType == MibAddInstance ? "added" : "modified"); + break; + case MibDeleteInstance: + OVS_LOG_INFO("IP Interface with NetLuidIndex: %d, type: %d, deleted", + ipRow->InterfaceLuid.Info.NetLuidIndex, + ipRow->InterfaceLuid.Info.IfType); + if (ipRow->InterfaceLuid.Info.NetLuidIndex == + ovsInternalRow.InterfaceLuid.Info.NetLuidIndex && + ipRow->InterfaceLuid.Info.IfType == + ovsInternalRow.InterfaceLuid.Info.IfType && + ipRow->InterfaceIndex == ovsInternalRow.InterfaceIndex) { + + NdisAcquireSpinLock(&ovsIpHelperLock); + ovsInternalIPConfigured = FALSE; + NdisReleaseSpinLock(&ovsIpHelperLock); + + OvsCleanupIpHelperRequestList(); + + OvsCleanupFwdTable(); + } + + break; + case MibInitialNotification: + OVS_LOG_INFO("Get Initial notification for IP Interface change."); + default: + return; + } +} + + +static VOID +OvsChangeCallbackIpRoute(PVOID context, + PMIB_IPFORWARD_ROW2 ipRoute, + MIB_NOTIFICATION_TYPE notificationType) +{ + UINT32 ipAddr, nextHop; + + UNREFERENCED_PARAMETER(context); + switch (notificationType) { + case MibAddInstance: + + ASSERT(ipRoute); + ipAddr = ipRoute->DestinationPrefix.Prefix.Ipv4.sin_addr.s_addr; + nextHop = ipRoute->NextHop.Ipv4.sin_addr.s_addr; + + OVS_LOG_INFO("IPRoute: To %d.%d.%d.%d/%d through %d.%d.%d.%d added", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff, + ipRoute->DestinationPrefix.PrefixLength, + nextHop & 0xff, (nextHop >> 8) & 0xff, + (nextHop >> 16) & 0xff, (nextHop >> 24) & 0xff); + break; + + case MibParameterNotification: + case MibDeleteInstance: + ASSERT(ipRoute); + ipAddr = ipRoute->DestinationPrefix.Prefix.Ipv4.sin_addr.s_addr; + nextHop = ipRoute->NextHop.Ipv4.sin_addr.s_addr; + + OVS_LOG_INFO("IPRoute: To %d.%d.%d.%d/%d through %d.%d.%d.%d %s.", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff, + ipRoute->DestinationPrefix.PrefixLength, + nextHop & 0xff, (nextHop >> 8) & 0xff, + (nextHop >> 16) & 0xff, (nextHop >> 24) & 0xff, + notificationType == MibDeleteInstance ? "deleted" : + "modified"); + + if (ipRoute->InterfaceLuid.Info.NetLuidIndex == + ovsInternalRow.InterfaceLuid.Info.NetLuidIndex && + ipRoute->InterfaceLuid.Info.IfType == + ovsInternalRow.InterfaceLuid.Info.IfType && + ipRoute->InterfaceIndex == ovsInternalRow.InterfaceIndex) { + + POVS_IPFORWARD_ENTRY ipf; + LOCK_STATE_EX lockState; + + NdisAcquireRWLockWrite(ovsTableLock, &lockState, 0); + ipf = OvsLookupIPForwardEntry(&ipRoute->DestinationPrefix); + if (ipf != NULL) { + OvsRemoveIPForwardEntry(ipf); + } + NdisReleaseRWLock(ovsTableLock, &lockState); + } + break; + + case MibInitialNotification: + OVS_LOG_INFO("Get Initial notification for IP Route change."); + default: + return; + } +} + + +static VOID +OvsChangeCallbackUnicastIpAddress(PVOID context, + PMIB_UNICASTIPADDRESS_ROW unicastRow, + MIB_NOTIFICATION_TYPE notificationType) +{ + UINT32 ipAddr; + + UNREFERENCED_PARAMETER(context); + switch (notificationType) { + case MibParameterNotification: + case MibAddInstance: + ASSERT(unicastRow); + ipAddr = unicastRow->Address.Ipv4.sin_addr.s_addr; + if (unicastRow->InterfaceLuid.Info.NetLuidIndex == + ovsInternalRow.InterfaceLuid.Info.NetLuidIndex && + unicastRow->InterfaceLuid.Info.IfType == + ovsInternalRow.InterfaceLuid.Info.IfType && + unicastRow->InterfaceIndex == ovsInternalRow.InterfaceIndex) { + ovsInternalIP = ipAddr; + } + OVS_LOG_INFO("IP Address: %d.%d.%d.%d is %s", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff, + notificationType == MibAddInstance ? "added": "modified"); + break; + + case MibDeleteInstance: + ASSERT(unicastRow); + ipAddr = unicastRow->Address.Ipv4.sin_addr.s_addr; + OVS_LOG_INFO("IP Address removed: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); + if (unicastRow->InterfaceLuid.Info.NetLuidIndex == + ovsInternalRow.InterfaceLuid.Info.NetLuidIndex && + unicastRow->InterfaceLuid.Info.IfType == + ovsInternalRow.InterfaceLuid.Info.IfType && + unicastRow->InterfaceIndex == ovsInternalRow.InterfaceIndex) { + + LOCK_STATE_EX lockState; + NdisAcquireRWLockWrite(ovsTableLock, &lockState, 0); + OvsRemoveAllFwdEntriesWithSrc(ipAddr); + NdisReleaseRWLock(ovsTableLock, &lockState); + + } + break; + + case MibInitialNotification: + OVS_LOG_INFO("Get Initial notification for Unicast IP Address change."); + default: + return; + } +} + + +static VOID +OvsCancelChangeNotification() +{ + if (ipInterfaceNotificationHandle != NULL) { + CancelMibChangeNotify2(ipInterfaceNotificationHandle); + ipInterfaceNotificationHandle = NULL; + } + if (ipRouteNotificationHandle != NULL) { + CancelMibChangeNotify2(ipRouteNotificationHandle); + ipRouteNotificationHandle = NULL; + } + if (unicastIPNotificationHandle != NULL) { + CancelMibChangeNotify2(unicastIPNotificationHandle); + unicastIPNotificationHandle = NULL; + } +} + + +static NTSTATUS +OvsRegisterChangeNotification() +{ + NTSTATUS status; + + + status = NotifyIpInterfaceChange(AF_INET, OvsChangeCallbackIpInterface, + NULL, TRUE, + &ipInterfaceNotificationHandle); + if (status != STATUS_SUCCESS) { + OVS_LOG_ERROR("Fail to register Notify IP interface change, status:%x.", + status); + return status; + } + + status = NotifyRouteChange2(AF_INET, OvsChangeCallbackIpRoute, NULL, + TRUE, &ipRouteNotificationHandle); + if (status != STATUS_SUCCESS) { + OVS_LOG_ERROR("Fail to regiter ip route change, status: %x.", + status); + goto register_cleanup; + } + status = NotifyUnicastIpAddressChange(AF_INET, + OvsChangeCallbackUnicastIpAddress, + NULL, TRUE, + &unicastIPNotificationHandle); + if (status != STATUS_SUCCESS) { + OVS_LOG_ERROR("Fail to regiter unicast ip change, status: %x.", status); + } +register_cleanup: + if (status != STATUS_SUCCESS) { + OvsCancelChangeNotification(); + } + + return status; +} + + +static POVS_IPNEIGH_ENTRY +OvsLookupIPNeighEntry(UINT32 ipAddr) +{ + PLIST_ENTRY link; + POVS_IPNEIGH_ENTRY entry; + UINT32 hash = OvsJhashWords(&ipAddr, 1, OVS_HASH_BASIS); + + LIST_FORALL(&ovsNeighHashTable[hash & OVS_NEIGH_HASH_TABLE_MASK], link) { + entry = CONTAINING_RECORD(link, OVS_IPNEIGH_ENTRY, link); + if (entry->ipAddr == ipAddr) { + return entry; + } + } + return NULL; +} + + +static UINT32 +OvsHashIPPrefix(PIP_ADDRESS_PREFIX prefix) +{ + UINT64 words = (UINT64)prefix->Prefix.Ipv4.sin_addr.s_addr << 32 | + (UINT32)prefix->PrefixLength; + return OvsJhashWords((UINT32 *)&words, 2, OVS_HASH_BASIS); +} + + +static POVS_IPFORWARD_ENTRY +OvsLookupIPForwardEntry(PIP_ADDRESS_PREFIX prefix) +{ + + PLIST_ENTRY link; + POVS_IPFORWARD_ENTRY ipfEntry; + UINT32 hash; + ASSERT(prefix->Prefix.si_family == AF_INET); + + hash = RtlUlongByteSwap(prefix->Prefix.Ipv4.sin_addr.s_addr); + + ASSERT(prefix->PrefixLength >= 32 || + (hash & (((UINT32)1 << (32 - prefix->PrefixLength)) - 1)) == 0); + + hash = OvsHashIPPrefix(prefix); + LIST_FORALL(&ovsRouteHashTable[hash & OVS_ROUTE_HASH_TABLE_MASK], link) { + ipfEntry = CONTAINING_RECORD(link, OVS_IPFORWARD_ENTRY, link); + if (ipfEntry->prefix.PrefixLength == prefix->PrefixLength && + ipfEntry->prefix.Prefix.Ipv4.sin_addr.s_addr == + prefix->Prefix.Ipv4.sin_addr.s_addr) { + return ipfEntry; + } + } + return NULL; +} + + +static POVS_FWD_ENTRY +OvsLookupIPFwdEntry(UINT32 dstIp) +{ + PLIST_ENTRY link; + POVS_FWD_ENTRY entry; + UINT32 hash = OvsJhashWords(&dstIp, 1, OVS_HASH_BASIS); + + LIST_FORALL(&ovsFwdHashTable[hash & OVS_FWD_HASH_TABLE_MASK], link) { + entry = CONTAINING_RECORD(link, OVS_FWD_ENTRY, link); + if (entry->info.dstIpAddr == dstIp) { + return entry; + } + } + return NULL; +} + + +NTSTATUS +OvsLookupIPFwdInfo(UINT32 dstIp, + POVS_FWD_INFO info) +{ + POVS_FWD_ENTRY entry; + LOCK_STATE_EX lockState; + NTSTATUS status = STATUS_NOT_FOUND; + + NdisAcquireRWLockRead(ovsTableLock, &lockState, 0); + entry = OvsLookupIPFwdEntry(dstIp); + if (entry) { + info->value[0] = entry->info.value[0]; + info->value[1] = entry->info.value[1]; + info->value[2] = entry->info.value[2]; + status = STATUS_SUCCESS; + } + NdisReleaseRWLock(ovsTableLock, &lockState); + return status; +} + + +static POVS_IPNEIGH_ENTRY +OvsCreateIPNeighEntry(PMIB_IPNET_ROW2 ipNeigh) +{ + + POVS_IPNEIGH_ENTRY entry; + UINT64 timeVal; + + ASSERT(ipNeigh != NULL); + entry = (POVS_IPNEIGH_ENTRY)OvsAllocateMemoryWithTag( + sizeof(OVS_IPNEIGH_ENTRY), OVS_IPHELPER_POOL_TAG); + if (entry == NULL) { + return NULL; + } + + RtlZeroMemory(entry, sizeof (OVS_IPNEIGH_ENTRY)); + entry->ipAddr = ipNeigh->Address.Ipv4.sin_addr.s_addr; + KeQuerySystemTime((LARGE_INTEGER *)&timeVal); + entry->timeout = timeVal + OVS_IPNEIGH_TIMEOUT; + RtlCopyMemory(entry->macAddr, ipNeigh->PhysicalAddress, + ETH_ADDR_LEN); + InitializeListHead(&entry->fwdList); + + return entry; +} + + +static POVS_IPFORWARD_ENTRY +OvsCreateIPForwardEntry(PMIB_IPFORWARD_ROW2 ipRoute) +{ + + POVS_IPFORWARD_ENTRY entry; + + ASSERT(ipRoute); + + entry = (POVS_IPFORWARD_ENTRY)OvsAllocateMemoryWithTag( + sizeof(OVS_IPFORWARD_ENTRY), OVS_IPHELPER_POOL_TAG); + if (entry == NULL) { + return NULL; + } + + RtlZeroMemory(entry, sizeof (OVS_IPFORWARD_ENTRY)); + RtlCopyMemory(&entry->prefix, &ipRoute->DestinationPrefix, + sizeof (IP_ADDRESS_PREFIX)); + entry->nextHop = ipRoute->NextHop.Ipv4.sin_addr.s_addr; + InitializeListHead(&entry->fwdList); + + return entry; +} + + +static POVS_FWD_ENTRY +OvsCreateFwdEntry(POVS_FWD_INFO fwdInfo) +{ + POVS_FWD_ENTRY entry; + + entry = (POVS_FWD_ENTRY)OvsAllocateMemoryWithTag( + sizeof(OVS_FWD_ENTRY), OVS_IPHELPER_POOL_TAG); + if (entry == NULL) { + return NULL; + } + + RtlZeroMemory(entry, sizeof (OVS_FWD_ENTRY)); + RtlCopyMemory(&entry->info, fwdInfo, sizeof (OVS_FWD_INFO)); + return entry; +} + + +static VOID +OvsRemoveFwdEntry(POVS_FWD_ENTRY fwdEntry) +{ + POVS_IPFORWARD_ENTRY ipf; + POVS_IPNEIGH_ENTRY ipn; + + ipf = fwdEntry->ipf; + ipn = fwdEntry->ipn; + + RemoveEntryList(&fwdEntry->link); + ovsNumFwdEntries--; + + RemoveEntryList(&fwdEntry->ipfLink); + ipf->refCount--; + + RemoveEntryList(&fwdEntry->ipnLink); + ipn->refCount--; + + if (ipf->refCount == 0) { + ASSERT(IsListEmpty(&ipf->fwdList)); + RemoveEntryList(&ipf->link); + OvsFreeMemoryWithTag(ipf, OVS_IPHELPER_POOL_TAG); + } + + if (ipn->refCount == 0) { + ASSERT(IsListEmpty(&ipn->fwdList)); + RemoveEntryList(&ipn->link); + NdisAcquireSpinLock(&ovsIpHelperLock); + RemoveEntryList(&ipn->slink); + NdisReleaseSpinLock(&ovsIpHelperLock); + OvsFreeMemoryWithTag(ipn, OVS_IPHELPER_POOL_TAG); + } + + OvsFreeMemoryWithTag(fwdEntry, OVS_IPHELPER_POOL_TAG); +} + + +static VOID +OvsRemoveIPForwardEntry(POVS_IPFORWARD_ENTRY ipf) +{ + POVS_FWD_ENTRY fwdEntry; + PLIST_ENTRY link, next; + + ipf->refCount++; + + LIST_FORALL_SAFE(&ipf->fwdList, link, next) { + fwdEntry = CONTAINING_RECORD(link, OVS_FWD_ENTRY, ipfLink); + OvsRemoveFwdEntry(fwdEntry); + } + ASSERT(ipf->refCount == 1); + + RemoveEntryList(&ipf->link); + OvsFreeMemoryWithTag(ipf, OVS_IPHELPER_POOL_TAG); +} + + +static VOID +OvsRemoveIPNeighEntry(POVS_IPNEIGH_ENTRY ipn) +{ + PLIST_ENTRY link, next; + POVS_FWD_ENTRY fwdEntry; + + ipn->refCount++; + + LIST_FORALL_SAFE(&ipn->fwdList, link, next) { + fwdEntry = CONTAINING_RECORD(link, OVS_FWD_ENTRY, ipnLink); + OvsRemoveFwdEntry(fwdEntry); + } + + if (ipn->refCount == 1) { + RemoveEntryList(&ipn->link); + NdisAcquireSpinLock(&ovsIpHelperLock); + RemoveEntryList(&ipn->slink); + NdisReleaseSpinLock(&ovsIpHelperLock); + OvsFreeMemoryWithTag(ipn, OVS_IPHELPER_POOL_TAG); + } +} + + +static VOID +OvsAddToSortedNeighList(POVS_IPNEIGH_ENTRY ipn) +{ + PLIST_ENTRY link; + POVS_IPNEIGH_ENTRY entry; + + if (!IsListEmpty(&ovsSortedIPNeighList)) { + link = ovsSortedIPNeighList.Blink; + entry = CONTAINING_RECORD(link, OVS_IPNEIGH_ENTRY, slink); + if (entry->timeout > ipn->timeout) { + ipn->timeout++; + } + } + InsertTailList(&ovsSortedIPNeighList, &ipn->slink); +} + + +static VOID +OvsAddIPFwdCache(POVS_FWD_ENTRY fwdEntry, + POVS_IPFORWARD_ENTRY ipf, + POVS_IPNEIGH_ENTRY ipn) + +{ + UINT32 hash; + + if (ipn->refCount == 0) { + NdisAcquireSpinLock(&ovsIpHelperLock); + OvsAddToSortedNeighList(ipn); + NdisReleaseSpinLock(&ovsIpHelperLock); + hash = OvsJhashWords(&ipn->ipAddr, 1, OVS_HASH_BASIS); + InsertHeadList(&ovsNeighHashTable[hash & OVS_NEIGH_HASH_TABLE_MASK], + &ipn->link); + } + if (ipf->refCount == 0) { + hash = OvsHashIPPrefix(&ipf->prefix); + InsertHeadList(&ovsRouteHashTable[hash & OVS_ROUTE_HASH_TABLE_MASK], + &ipf->link); + } + + InsertHeadList(&ipf->fwdList, &fwdEntry->ipfLink); + ipf->refCount++; + fwdEntry->ipf = ipf; + + InsertHeadList(&ipn->fwdList, &fwdEntry->ipnLink); + ipn->refCount++; + fwdEntry->ipn = ipn; + + hash = OvsJhashWords(&fwdEntry->info.dstIpAddr, 1, OVS_HASH_BASIS); + InsertHeadList(&ovsFwdHashTable[hash & OVS_FWD_HASH_TABLE_MASK], + &fwdEntry->link); + ovsNumFwdEntries++; +} + + +static VOID +OvsRemoveAllFwdEntriesWithSrc(UINT32 ipAddr) +{ + UINT32 i; + POVS_FWD_ENTRY fwdEntry; + PLIST_ENTRY link, next; + + for (i = 0; i < OVS_FWD_HASH_TABLE_SIZE; i++) { + LIST_FORALL_SAFE(&ovsFwdHashTable[i], link, next) { + fwdEntry = CONTAINING_RECORD(link, OVS_FWD_ENTRY, link); + if (fwdEntry->info.srcIpAddr == ipAddr) { + OvsRemoveFwdEntry(fwdEntry); + } + } + } +} + + +static VOID +OvsCleanupFwdTable(VOID) +{ + PLIST_ENTRY link, next; + POVS_IPNEIGH_ENTRY ipn; + UINT32 i; + LOCK_STATE_EX lockState; + + NdisAcquireRWLockWrite(ovsTableLock, &lockState, 0); + if (ovsNumFwdEntries) { + LIST_FORALL_SAFE(&ovsSortedIPNeighList, link, next) { + ipn = CONTAINING_RECORD(link, OVS_IPNEIGH_ENTRY, slink); + OvsRemoveIPNeighEntry(ipn); + } + } + for (i = 0; i < OVS_FWD_HASH_TABLE_SIZE; i++) { + ASSERT(IsListEmpty(&ovsFwdHashTable[i])); + } + for (i = 0; i < OVS_ROUTE_HASH_TABLE_SIZE; i++) { + ASSERT(IsListEmpty(&ovsRouteHashTable[i])); + } + NdisReleaseRWLock(ovsTableLock, &lockState); +} + + +static VOID +OvsCleanupIpHelperRequestList(VOID) +{ + LIST_ENTRY list; + PLIST_ENTRY next, link; + POVS_IP_HELPER_REQUEST request; + + NdisAcquireSpinLock(&ovsIpHelperLock); + if (ovsNumIpHelperRequests == 0) { + NdisReleaseSpinLock(&ovsIpHelperLock); + return; + } + + InitializeListHead(&list); + OvsAppendList(&list, &ovsIpHelperRequestList); + ovsNumIpHelperRequests = 0; + NdisReleaseSpinLock(&ovsIpHelperLock); + + LIST_FORALL_SAFE(&list, link, next) { + request = CONTAINING_RECORD(link, OVS_IP_HELPER_REQUEST, link); + + if (request->command == OVS_IP_HELPER_FWD_REQUEST && + request->fwdReq.cb) { + request->fwdReq.cb(request->fwdReq.nbl, + request->fwdReq.inPort, + &request->fwdReq.tunnelKey, + request->fwdReq.cbData1, + request->fwdReq.cbData2, + STATUS_DEVICE_NOT_READY, + NULL); + } + OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG); + } +} + + + +static VOID +OvsWakeupIPHelper(VOID) +{ + KeSetEvent(&ovsIpHelperThreadContext.event, 0, FALSE); +} + +VOID +OvsInternalAdapterDown(VOID) +{ + NdisAcquireSpinLock(&ovsIpHelperLock); + ovsInternalPortNo = OVS_DEFAULT_PORT_NO; + ovsInternalIPConfigured = FALSE; + NdisReleaseSpinLock(&ovsIpHelperLock); + + OvsCleanupIpHelperRequestList(); + + OvsCleanupFwdTable(); +} + + +VOID +OvsInternalAdapterUp(UINT32 portNo, + GUID *netCfgInstanceId) +{ + POVS_IP_HELPER_REQUEST request; + + RtlCopyMemory(&ovsInternalNetCfgId, netCfgInstanceId, sizeof (GUID)); + RtlZeroMemory(&ovsInternalRow, sizeof (MIB_IF_ROW2)); + + request = (POVS_IP_HELPER_REQUEST)OvsAllocateMemoryWithTag( + sizeof(OVS_IP_HELPER_REQUEST), OVS_IPHELPER_POOL_TAG); + if (request == NULL) { + OVS_LOG_ERROR("Fail to initialize Internal Adapter"); + return; + } + RtlZeroMemory(request, sizeof (OVS_IP_HELPER_REQUEST)); + request->command = OVS_IP_HELPER_INTERNAL_ADAPTER_UP; + + NdisAcquireSpinLock(&ovsIpHelperLock); + ovsInternalPortNo = portNo; + InsertHeadList(&ovsIpHelperRequestList, &request->link); + ovsNumIpHelperRequests++; + if (ovsNumIpHelperRequests == 1) { + OvsWakeupIPHelper(); + } + NdisReleaseSpinLock(&ovsIpHelperLock); +} + + +static VOID +OvsHandleInternalAdapterUp(POVS_IP_HELPER_REQUEST request) +{ + NTSTATUS status; + MIB_UNICASTIPADDRESS_ROW ipEntry; + GUID *netCfgInstanceId = &ovsInternalNetCfgId; + + OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG); + + status = OvsGetIfEntry(&ovsInternalNetCfgId, &ovsInternalRow); + + if (status != STATUS_SUCCESS) { + OVS_LOG_ERROR("Fali to get IF entry for internal port with GUID" + " %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", + netCfgInstanceId->Data1, + netCfgInstanceId->Data2, + netCfgInstanceId->Data3, + *(UINT16 *)netCfgInstanceId->Data4, + netCfgInstanceId->Data4[2], + netCfgInstanceId->Data4[3], + netCfgInstanceId->Data4[4], + netCfgInstanceId->Data4[5], + netCfgInstanceId->Data4[6], + netCfgInstanceId->Data4[7]); + return; + } + + status = OvsGetIPInterfaceEntry(ovsInternalRow.InterfaceLuid, + &ovsInternalIPRow); + + if (status == STATUS_SUCCESS) { + NdisAcquireSpinLock(&ovsIpHelperLock); + ovsInternalIPConfigured = TRUE; + NdisReleaseSpinLock(&ovsIpHelperLock); + } else { + return; + } + + status = OvsGetIPEntry(ovsInternalRow.InterfaceLuid, &ipEntry); + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fali to get IP entry for internal port with GUID" + " %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", + netCfgInstanceId->Data1, + netCfgInstanceId->Data2, + netCfgInstanceId->Data3, + *(UINT16 *)netCfgInstanceId->Data4, + netCfgInstanceId->Data4[2], + netCfgInstanceId->Data4[3], + netCfgInstanceId->Data4[4], + netCfgInstanceId->Data4[5], + netCfgInstanceId->Data4[6], + netCfgInstanceId->Data4[7]); + } +} + + +static NTSTATUS +OvsEnqueueIpHelperRequest(POVS_IP_HELPER_REQUEST request) +{ + + NdisAcquireSpinLock(&ovsIpHelperLock); + + if (ovsInternalPortNo == OVS_DEFAULT_PORT_NO || + ovsInternalIPConfigured == FALSE) { + NdisReleaseSpinLock(&ovsIpHelperLock); + OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG); + return STATUS_NDIS_ADAPTER_NOT_READY; + } else { + InsertHeadList(&ovsIpHelperRequestList, &request->link); + ovsNumIpHelperRequests++; + if (ovsNumIpHelperRequests == 1) { + OvsWakeupIPHelper(); + } + NdisReleaseSpinLock(&ovsIpHelperLock); + return STATUS_SUCCESS; + } +} + + +NTSTATUS +OvsFwdIPHelperRequest(PNET_BUFFER_LIST nbl, + UINT32 inPort, + const OvsIPv4TunnelKey *tunnelKey, + OvsIPHelperCallback cb, + PVOID cbData1, + PVOID cbData2) +{ + POVS_IP_HELPER_REQUEST request; + + request = (POVS_IP_HELPER_REQUEST)OvsAllocateMemoryWithTag( + sizeof(OVS_IP_HELPER_REQUEST), OVS_IPHELPER_POOL_TAG); + + if (request == NULL) { + return STATUS_INSUFFICIENT_RESOURCES; + } + request->command = OVS_IP_HELPER_FWD_REQUEST; + request->fwdReq.nbl = nbl; + request->fwdReq.inPort = inPort; + RtlCopyMemory(&request->fwdReq.tunnelKey, tunnelKey, + sizeof (*tunnelKey)); + request->fwdReq.cb = cb; + request->fwdReq.cbData1 = cbData1; + request->fwdReq.cbData2 = cbData2; + + return OvsEnqueueIpHelperRequest(request); +} + + +static VOID +OvsHandleFwdRequest(POVS_IP_HELPER_REQUEST request) +{ + SOCKADDR_INET dst, src; + NTSTATUS status = STATUS_SUCCESS; + MIB_IPFORWARD_ROW2 ipRoute; + MIB_IPNET_ROW2 ipNeigh; + OVS_FWD_INFO fwdInfo; + UINT32 ipAddr; + UINT32 srcAddr; + POVS_FWD_ENTRY fwdEntry = NULL; + POVS_IPFORWARD_ENTRY ipf = NULL; + POVS_IPNEIGH_ENTRY ipn = NULL; + LOCK_STATE_EX lockState; + BOOLEAN newIPF = FALSE; + BOOLEAN newIPN = FALSE; + BOOLEAN newFWD = FALSE; + + status = OvsLookupIPFwdInfo(request->fwdReq.tunnelKey.dst, + &fwdInfo); + if (status == STATUS_SUCCESS) { + goto fwd_handle_nbl; + } + + /* find IPRoute */ + RtlZeroMemory(&dst, sizeof(dst)); + RtlZeroMemory(&src, sizeof(src)); + RtlZeroMemory(&ipRoute, sizeof (MIB_IPFORWARD_ROW2)); + dst.si_family = AF_INET; + dst.Ipv4.sin_addr.s_addr = request->fwdReq.tunnelKey.dst; + + status = OvsGetRoute(ovsInternalRow.InterfaceLuid, &dst, &ipRoute, &src); + if (status != STATUS_SUCCESS) { + goto fwd_handle_nbl; + } + srcAddr = src.Ipv4.sin_addr.s_addr; + + /* find IPNeigh */ + ipAddr = ipRoute.NextHop.Ipv4.sin_addr.s_addr; + if (ipAddr != 0) { + NdisAcquireRWLockWrite(ovsTableLock, &lockState, 0); + ipn = OvsLookupIPNeighEntry(ipAddr); + if (ipn) { + goto fwd_request_done; + } + NdisReleaseRWLock(ovsTableLock, &lockState); + } + RtlZeroMemory(&ipNeigh, sizeof (ipNeigh)); + ipNeigh.InterfaceLuid.Value = ovsInternalRow.InterfaceLuid.Value; + if (ipAddr == 0) { + ipAddr = request->fwdReq.tunnelKey.dst; + } + status = OvsGetOrResolveIPNeigh(ipAddr, &ipNeigh); + if (status != STATUS_SUCCESS) { + goto fwd_handle_nbl; + } + + NdisAcquireRWLockWrite(ovsTableLock, &lockState, 0); + +fwd_request_done: + + /* + * Initialize ipf + */ + ipf = OvsLookupIPForwardEntry(&ipRoute.DestinationPrefix); + if (ipf == NULL) { + ipf = OvsCreateIPForwardEntry(&ipRoute); + if (ipf == NULL) { + NdisReleaseRWLock(ovsTableLock, &lockState); + status = STATUS_INSUFFICIENT_RESOURCES; + goto fwd_handle_nbl; + } + newIPF = TRUE; + } else { + PLIST_ENTRY link; + link = ipf->fwdList.Flink; + fwdEntry = CONTAINING_RECORD(link, OVS_FWD_ENTRY, ipfLink); + srcAddr = fwdEntry->info.srcIpAddr; + } + + /* + * initialize ipn + */ + if (ipn == NULL) { + ipn = OvsLookupIPNeighEntry(ipAddr); + if (ipn == NULL) { + ipn = OvsCreateIPNeighEntry(&ipNeigh); + if (ipn == NULL) { + NdisReleaseRWLock(ovsTableLock, &lockState); + status = STATUS_INSUFFICIENT_RESOURCES; + goto fwd_handle_nbl; + } + newIPN = TRUE; + } + } + + /* + * initialize fwdEntry + */ + fwdInfo.dstIpAddr = request->fwdReq.tunnelKey.dst; + fwdInfo.srcIpAddr = srcAddr; + RtlCopyMemory(fwdInfo.dstMacAddr, ipn->macAddr, ETH_ADDR_LEN); + RtlCopyMemory(fwdInfo.srcMacAddr, ovsInternalRow.PhysicalAddress, + ETH_ADDR_LEN); + fwdInfo.srcPortNo = request->fwdReq.inPort; + + fwdEntry = OvsCreateFwdEntry(&fwdInfo); + if (fwdEntry == NULL) { + NdisReleaseRWLock(ovsTableLock, &lockState); + status = STATUS_INSUFFICIENT_RESOURCES; + goto fwd_handle_nbl; + } + newFWD = TRUE; + /* + * Cache the result + */ + OvsAddIPFwdCache(fwdEntry, ipf, ipn); + NdisReleaseRWLock(ovsTableLock, &lockState); + +fwd_handle_nbl: + + if (status != STATUS_SUCCESS) { + if (newFWD) { + ASSERT(fwdEntry != NULL); + OvsFreeMemoryWithTag(fwdEntry, OVS_IPHELPER_POOL_TAG); + } + if (newIPF) { + ASSERT(ipf && ipf->refCount == 0); + OvsFreeMemoryWithTag(ipf, OVS_IPHELPER_POOL_TAG); + } + if (newIPN) { + ASSERT(ipn && ipn->refCount == 0); + OvsFreeMemoryWithTag(ipn, OVS_IPHELPER_POOL_TAG); + } + ipAddr = request->fwdReq.tunnelKey.dst; + OVS_LOG_INFO("Fail to handle IP helper request for dst: %d.%d.%d.%d", + ipAddr & 0xff, (ipAddr >> 8) & 0xff, + (ipAddr >> 16) & 0xff, (ipAddr >> 24) & 0xff); + } + if (request->fwdReq.cb) { + request->fwdReq.cb(request->fwdReq.nbl, + request->fwdReq.inPort, + &request->fwdReq.tunnelKey, + request->fwdReq.cbData1, + request->fwdReq.cbData2, + status, + status == STATUS_SUCCESS ? &fwdInfo : NULL); + } + OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG); +} + + +static VOID +OvsUpdateIPNeighEntry(UINT32 ipAddr, + PMIB_IPNET_ROW2 ipNeigh, + NTSTATUS status) +{ + UINT64 timeVal; + POVS_IPNEIGH_ENTRY ipn; + LOCK_STATE_EX lockState; + KeQuerySystemTime((LARGE_INTEGER *)&timeVal); + /* + * if mac changed, update all relevant fwdEntry + */ + if (status != STATUS_SUCCESS) { + NdisAcquireRWLockWrite(ovsTableLock, &lockState, 0); + } else { + NdisAcquireRWLockRead(ovsTableLock, &lockState, 0); + } + ipn = OvsLookupIPNeighEntry(ipAddr); + if (ipn == NULL) { + NdisReleaseRWLock(ovsTableLock, &lockState); + return; + } + if (status != STATUS_SUCCESS) { + OvsRemoveIPNeighEntry(ipn); + NdisReleaseRWLock(ovsTableLock, &lockState); + return; + } + + if (memcmp((const PVOID)ipn->macAddr, + (const PVOID)ipNeigh->PhysicalAddress, + (size_t)ETH_ADDR_LEN)) { + PLIST_ENTRY link; + POVS_FWD_ENTRY fwdEntry; + NdisReleaseRWLock(ovsTableLock, &lockState); + /* + * need update, release and acquire write lock + * This is not the common case. + */ + + NdisAcquireRWLockWrite(ovsTableLock, &lockState, 0); + ipn = OvsLookupIPNeighEntry(ipAddr); + + if (ipn == NULL) { + NdisReleaseRWLock(ovsTableLock, &lockState); + return; + } + + LIST_FORALL(&ipn->fwdList, link) { + fwdEntry = CONTAINING_RECORD(link, OVS_FWD_ENTRY, ipnLink); + RtlCopyMemory(fwdEntry->info.dstMacAddr, + ipNeigh->PhysicalAddress, ETH_ADDR_LEN); + } + } + /* + * update timeout and move to the end of + * the sorted list + */ + + NdisAcquireSpinLock(&ovsIpHelperLock); + RemoveEntryList(&ipn->slink); + ipn->timeout = timeVal + OVS_IPNEIGH_TIMEOUT; + OvsAddToSortedNeighList(ipn); + NdisReleaseSpinLock(&ovsIpHelperLock); + NdisReleaseRWLock(ovsTableLock, &lockState); +} + + +static VOID +OvsHandleIPNeighTimeout(UINT32 ipAddr) +{ + MIB_IPNET_ROW2 ipNeigh; + NTSTATUS status; + + status = OvsGetOrResolveIPNeigh(ipAddr, &ipNeigh); + + OvsUpdateIPNeighEntry(ipAddr, &ipNeigh, status); +} + + +/* + *---------------------------------------------------------------------------- + * IP Helper system threash handle following request + * 1. Intialize Internal port row when internal port is connected + * 2. Handle FWD request + * 3. Handle IP Neigh timeout + * + * IP Interface, unicast address, and IP route change will be handled + * by the revelant callback. + *---------------------------------------------------------------------------- + */ +VOID +OvsStartIpHelper(PVOID data) +{ + POVS_IP_HELPER_THREAD_CONTEXT context = (POVS_IP_HELPER_THREAD_CONTEXT)data; + POVS_IP_HELPER_REQUEST req; + POVS_IPNEIGH_ENTRY ipn; + PLIST_ENTRY link; + UINT64 timeVal, timeout; + + OVS_LOG_INFO("Start the IP Helper Thread, context: %p", context); + + NdisAcquireSpinLock(&ovsIpHelperLock); + while (!context->exit) { + + timeout = 0; + while (!IsListEmpty(&ovsIpHelperRequestList)) { + if (context->exit) { + goto ip_helper_wait; + } + link = ovsIpHelperRequestList.Flink; + RemoveEntryList(link); + NdisReleaseSpinLock(&ovsIpHelperLock); + req = CONTAINING_RECORD(link, OVS_IP_HELPER_REQUEST, link); + switch (req->command) { + case OVS_IP_HELPER_INTERNAL_ADAPTER_UP: + OvsHandleInternalAdapterUp(req); + break; + case OVS_IP_HELPER_FWD_REQUEST: + OvsHandleFwdRequest(req); + break; + default: + OvsFreeMemoryWithTag(req, OVS_IPHELPER_POOL_TAG); + } + NdisAcquireSpinLock(&ovsIpHelperLock); + } + + /* for now, let us hold the lock here, if this cause any issue + * we will change to use IpHelper lock only to protect + * IPN + */ + while (!IsListEmpty(&ovsSortedIPNeighList)) { + UINT32 ipAddr; + if (context->exit) { + goto ip_helper_wait; + } + link = ovsSortedIPNeighList.Flink; + ipn = CONTAINING_RECORD(link, OVS_IPNEIGH_ENTRY, slink); + KeQuerySystemTime((LARGE_INTEGER *)&timeVal); + if (ipn->timeout > timeVal) { + timeout = ipn->timeout; + break; + } + ipAddr = ipn->ipAddr; + + NdisReleaseSpinLock(&ovsIpHelperLock); + + OvsHandleIPNeighTimeout(ipAddr); + + NdisAcquireSpinLock(&ovsIpHelperLock); + } + if (!IsListEmpty(&ovsIpHelperRequestList)) { + continue; + } + +ip_helper_wait: + if (context->exit) { + break; + } + + KeClearEvent(&context->event); + NdisReleaseSpinLock(&ovsIpHelperLock); + + KeWaitForSingleObject(&context->event, Executive, KernelMode, + FALSE, (LARGE_INTEGER *)&timeout); + NdisAcquireSpinLock(&ovsIpHelperLock); + } + NdisReleaseSpinLock(&ovsIpHelperLock); + OvsCleanupFwdTable(); + OvsCleanupIpHelperRequestList(); + + OVS_LOG_INFO("Terminating the OVS IP Helper system thread"); + + PsTerminateSystemThread(STATUS_SUCCESS); +} + + +NTSTATUS +OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle) +{ + NTSTATUS status; + HANDLE threadHandle; + UINT32 i; + + ovsFwdHashTable = (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_FWD_HASH_TABLE_SIZE, OVS_IPHELPER_POOL_TAG); + + ovsRouteHashTable = (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_ROUTE_HASH_TABLE_SIZE, OVS_IPHELPER_POOL_TAG); + + ovsNeighHashTable = (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_NEIGH_HASH_TABLE_SIZE, OVS_IPHELPER_POOL_TAG); + + RtlZeroMemory(&ovsInternalRow, sizeof(MIB_IF_ROW2)); + RtlZeroMemory(&ovsInternalIPRow, sizeof (MIB_IPINTERFACE_ROW)); + ovsInternalIP = 0; + + ovsInternalPortNo = OVS_DEFAULT_PORT_NO; + + InitializeListHead(&ovsSortedIPNeighList); + + ovsTableLock = NdisAllocateRWLock(ndisFilterHandle); + NdisAllocateSpinLock(&ovsIpHelperLock); + + InitializeListHead(&ovsIpHelperRequestList); + ovsNumIpHelperRequests = 0; + ipInterfaceNotificationHandle = NULL; + ipRouteNotificationHandle = NULL; + unicastIPNotificationHandle = NULL; + + if (ovsFwdHashTable == NULL || + ovsRouteHashTable == NULL || + ovsNeighHashTable == NULL || + ovsTableLock == NULL) { + status = STATUS_INSUFFICIENT_RESOURCES; + goto init_cleanup; + } + + for (i = 0; i < OVS_FWD_HASH_TABLE_SIZE; i++) { + InitializeListHead(&ovsFwdHashTable[i]); + } + + for (i = 0; i < OVS_ROUTE_HASH_TABLE_SIZE; i++) { + InitializeListHead(&ovsRouteHashTable[i]); + } + + for (i = 0; i < OVS_NEIGH_HASH_TABLE_SIZE; i++) { + InitializeListHead(&ovsNeighHashTable[i]); + } + + + KeInitializeEvent(&ovsIpHelperThreadContext.event, NotificationEvent, + FALSE); + status = OvsRegisterChangeNotification(); + ovsIpHelperThreadContext.exit = 0; + if (status == STATUS_SUCCESS) { + status = PsCreateSystemThread(&threadHandle, SYNCHRONIZE, + NULL, NULL, NULL, OvsStartIpHelper, + &ovsIpHelperThreadContext); + if (status != STATUS_SUCCESS) { + goto init_cleanup; + } + ObReferenceObjectByHandle(threadHandle, SYNCHRONIZE, NULL, + KernelMode, + &ovsIpHelperThreadContext.threadObject, + NULL); + ZwClose(threadHandle); + } + +init_cleanup: + + if (status != STATUS_SUCCESS) { + OvsCancelChangeNotification(); + if (ovsFwdHashTable) { + OvsFreeMemoryWithTag(ovsFwdHashTable, OVS_IPHELPER_POOL_TAG); + ovsFwdHashTable = NULL; + } + if (ovsRouteHashTable) { + OvsFreeMemoryWithTag(ovsRouteHashTable, OVS_IPHELPER_POOL_TAG); + ovsRouteHashTable = NULL; + } + if (ovsNeighHashTable) { + OvsFreeMemoryWithTag(ovsNeighHashTable, OVS_IPHELPER_POOL_TAG); + ovsNeighHashTable = NULL; + } + if (ovsTableLock) { + NdisFreeRWLock(ovsTableLock); + ovsTableLock = NULL; + } + NdisFreeSpinLock(&ovsIpHelperLock); + } + return STATUS_SUCCESS; +} + + +VOID +OvsCleanupIpHelper(VOID) +{ + OvsCancelChangeNotification(); + + NdisAcquireSpinLock(&ovsIpHelperLock); + ovsIpHelperThreadContext.exit = 1; + OvsWakeupIPHelper(); + NdisReleaseSpinLock(&ovsIpHelperLock); + + KeWaitForSingleObject(ovsIpHelperThreadContext.threadObject, Executive, + KernelMode, FALSE, NULL); + ObDereferenceObject(ovsIpHelperThreadContext.threadObject); + + OvsFreeMemoryWithTag(ovsFwdHashTable, OVS_IPHELPER_POOL_TAG); + OvsFreeMemoryWithTag(ovsRouteHashTable, OVS_IPHELPER_POOL_TAG); + OvsFreeMemoryWithTag(ovsNeighHashTable, OVS_IPHELPER_POOL_TAG); + + NdisFreeRWLock(ovsTableLock); + NdisFreeSpinLock(&ovsIpHelperLock); +} + +VOID +OvsCancelFwdIpHelperRequest(PNET_BUFFER_LIST nbl) +{ + PLIST_ENTRY link, next; + POVS_IP_HELPER_REQUEST req; + LIST_ENTRY list; + InitializeListHead(&list); + + NdisAcquireSpinLock(&ovsIpHelperLock); + LIST_FORALL_SAFE(&ovsIpHelperRequestList, link, next) { + req = CONTAINING_RECORD(link, OVS_IP_HELPER_REQUEST, link); + if (req->command == OVS_IP_HELPER_FWD_REQUEST && + (nbl == NULL || req->fwdReq.nbl == nbl)) { + RemoveEntryList(link); + InsertHeadList(&list, link); + if (nbl != NULL) { + break; + } + } + } + NdisReleaseSpinLock(&ovsIpHelperLock); + + LIST_FORALL_SAFE(&list, link, next) { + req = CONTAINING_RECORD(link, OVS_IP_HELPER_REQUEST, link); + if (req->fwdReq.cb) { + req->fwdReq.cb(req->fwdReq.nbl, req->fwdReq.inPort, + &req->fwdReq.tunnelKey, + req->fwdReq.cbData1, + req->fwdReq.cbData2, + STATUS_DEVICE_NOT_READY, + NULL); + } + OvsFreeMemoryWithTag(req, OVS_IPHELPER_POOL_TAG); + } +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/IpHelper.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/IpHelper.h --- openvswitch-2.3.1/datapath-windows/ovsext/IpHelper.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/IpHelper.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __IP_HELPER_H_ +#define __IP_HELPER_H_ 1 + +#include +#include + +#define OVS_FWD_HASH_TABLE_SIZE ((UINT32)1 << 10) +#define OVS_FWD_HASH_TABLE_MASK (OVS_FWD_HASH_TABLE_SIZE - 1) + +#define OVS_ROUTE_HASH_TABLE_SIZE ((UINT32)1 << 8) +#define OVS_ROUTE_HASH_TABLE_MASK (OVS_ROUTE_HASH_TABLE_SIZE - 1) + +#define OVS_NEIGH_HASH_TABLE_SIZE ((UINT32)1 << 8) +#define OVS_NEIGH_HASH_TABLE_MASK (OVS_NEIGH_HASH_TABLE_SIZE - 1) + +#define OVS_IPNEIGH_TIMEOUT 100000000 // 10 s + + +typedef struct _OVS_IPNEIGH_ENTRY { + UINT8 macAddr[ETH_ADDR_LEN]; + UINT16 refCount; + UINT32 ipAddr; + UINT32 pad; + UINT64 timeout; + LIST_ENTRY link; + LIST_ENTRY slink; + LIST_ENTRY fwdList; +} OVS_IPNEIGH_ENTRY, *POVS_IPNEIGH_ENTRY; + +typedef struct _OVS_IPFORWARD_ENTRY { + IP_ADDRESS_PREFIX prefix; + UINT32 nextHop; + UINT16 refCount; + LIST_ENTRY link; + LIST_ENTRY fwdList; +} OVS_IPFORWARD_ENTRY, *POVS_IPFORWARD_ENTRY; + +typedef union _OVS_FWD_INFO { + struct { + UINT32 dstIpAddr; + UINT32 srcIpAddr; + UINT8 dstMacAddr[ETH_ADDR_LEN]; + UINT8 srcMacAddr[ETH_ADDR_LEN]; + UINT32 srcPortNo; + }; + UINT64 value[3]; +} OVS_FWD_INFO, *POVS_FWD_INFO; + +typedef struct _OVS_FWD_ENTRY { + OVS_FWD_INFO info; + POVS_IPFORWARD_ENTRY ipf; + POVS_IPNEIGH_ENTRY ipn; + LIST_ENTRY link; + LIST_ENTRY ipfLink; + LIST_ENTRY ipnLink; +} OVS_FWD_ENTRY, *POVS_FWD_ENTRY; + + +enum { + OVS_IP_HELPER_INTERNAL_ADAPTER_UP, + OVS_IP_HELPER_FWD_REQUEST, +}; + +typedef VOID (*OvsIPHelperCallback)(PNET_BUFFER_LIST nbl, + UINT32 inPort, + PVOID tunnelKey, + PVOID cbData1, + PVOID cbData2, + NTSTATUS status, + POVS_FWD_INFO fwdInfo); + +typedef struct _OVS_FWD_REQUEST_INFO { + PNET_BUFFER_LIST nbl; + UINT32 inPort; + OvsIPv4TunnelKey tunnelKey; + OvsIPHelperCallback cb; + PVOID cbData1; + PVOID cbData2; +} OVS_FWD_REQUEST_INFO, *POVS_FWD_REQUEST_INFO; + + +typedef struct _OVS_IP_HELPER_REQUEST { + LIST_ENTRY link; + UINT32 command; + union { + OVS_FWD_REQUEST_INFO fwdReq; + UINT32 dummy; + }; +} OVS_IP_HELPER_REQUEST, *POVS_IP_HELPER_REQUEST; + + +typedef struct _OVS_IP_HELPER_THREAD_CONTEXT { + KEVENT event; + PVOID threadObject; + UINT32 exit; +} OVS_IP_HELPER_THREAD_CONTEXT, *POVS_IP_HELPER_THREAD_CONTEXT; + +NTSTATUS OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle); +VOID OvsCleanupIpHelper(VOID); + +VOID OvsInternalAdapterUp(UINT32 portNo, GUID *netCfgInstanceId); +VOID OvsInternalAdapterDown(VOID); + +NTSTATUS OvsFwdIPHelperRequest(PNET_BUFFER_LIST nbl, UINT32 inPort, + const PVOID tunnelKey, + OvsIPHelperCallback cb, + PVOID cbData1, + PVOID cbData2); +NTSTATUS OvsLookupIPFwdInfo(UINT32 dstIp, POVS_FWD_INFO info); +VOID OvsCancelFwdIpHelperRequest(PNET_BUFFER_LIST nbl); + +#endif /* __IP_HELPER_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Jhash.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Jhash.c --- openvswitch-2.3.1/datapath-windows/ovsext/Jhash.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Jhash.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2012, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" + +static __inline UINT32 +GetUnalignedU32(const UINT32 *p_) +{ + const UINT8 *p = (const UINT8 *)p_; + return ntohl((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); +} + +/* This is the public domain lookup3 hash by Bob Jenkins from + * http://burtleburtle.net/bob/c/lookup3.c, modified for style. */ + +static __inline UINT32 +JhashRot(UINT32 x, INT k) +{ + return (x << k) | (x >> (32 - k)); +} + +static __inline VOID +JhashMix(UINT32 *a, UINT32 *b, UINT32 *c) +{ + *a -= *c; *a ^= JhashRot(*c, 4); *c += *b; + *b -= *a; *b ^= JhashRot(*a, 6); *a += *c; + *c -= *b; *c ^= JhashRot(*b, 8); *b += *a; + *a -= *c; *a ^= JhashRot(*c, 16); *c += *b; + *b -= *a; *b ^= JhashRot(*a, 19); *a += *c; + *c -= *b; *c ^= JhashRot(*b, 4); *b += *a; +} + +static __inline VOID +JhashFinal(UINT32 *a, UINT32 *b, UINT32 *c) +{ + *c ^= *b; *c -= JhashRot(*b, 14); + *a ^= *c; *a -= JhashRot(*c, 11); + *b ^= *a; *b -= JhashRot(*a, 25); + *c ^= *b; *c -= JhashRot(*b, 16); + *a ^= *c; *a -= JhashRot(*c, 4); + *b ^= *a; *b -= JhashRot(*a, 14); + *c ^= *b; *c -= JhashRot(*b, 24); +} + +/* Returns the Jenkins hash of the 'n' 32-bit words at 'p', starting from + * 'basis'. 'p' must be properly aligned. + * + * Use hash_words() instead, unless you're computing a hash function whose + * value is exposed "on the wire" so we don't want to change it. */ +UINT32 +OvsJhashWords(const UINT32 *p, SIZE_T n, UINT32 basis) +{ + UINT32 a, b, c; + + a = b = c = 0xdeadbeef + (((UINT32) n) << 2) + basis; + + while (n > 3) { + a += p[0]; + b += p[1]; + c += p[2]; + JhashMix(&a, &b, &c); + n -= 3; + p += 3; + } + + switch (n) { + case 3: + c += p[2]; + /* fall through */ + case 2: + b += p[1]; + /* fall through */ + case 1: + a += p[0]; + JhashFinal(&a, &b, &c); + /* fall through */ + case 0: + break; + } + return c; +} + +/* Returns the Jenkins hash of the 'n' bytes at 'p', starting from 'basis'. + * + * Use hash_bytes() instead, unless you're computing a hash function whose + * value is exposed "on the wire" so we don't want to change it. */ +UINT32 +OvsJhashBytes(const VOID *p_, SIZE_T n, UINT32 basis) +{ + const UINT32 *p = p_; + UINT32 a, b, c; + + a = b = c = 0xdeadbeef + (UINT32)n + basis; + + while (n >= 12) { + a += GetUnalignedU32(p); + b += GetUnalignedU32(p + 1); + c += GetUnalignedU32(p + 2); + JhashMix(&a, &b, &c); + n -= 12; + p += 3; + } + + if (n) { + UINT32 tmp[3]; + + tmp[0] = tmp[1] = tmp[2] = 0; + memcpy(tmp, p, n); + a += tmp[0]; + b += tmp[1]; + c += tmp[2]; + JhashFinal(&a, &b, &c); + } + + return c; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Jhash.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Jhash.h --- openvswitch-2.3.1/datapath-windows/ovsext/Jhash.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Jhash.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2012, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __JHASH_H_ +#define __JHASH_H_ 1 + +/* This is the public domain lookup3 hash by Bob Jenkins from + * http://burtleburtle.net/bob/c/lookup3.c, modified for style. + * + * Use the functions in hash.h instead if you can. These are here just for + * places where we've exposed a hash function "on the wire" and don't want it + * to change. */ + +uint32_t OvsJhashWords(const uint32_t *, size_t n_word, uint32_t basis); +uint32_t OvsJhashBytes(const void *, size_t n_bytes, uint32_t basis); + +#endif /* __JHASH_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkBuf.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkBuf.c --- openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkBuf.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkBuf.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ========================================================================== + * This is a simple buffer mangement framework specific for netlink protocol. + * The name could be confused with ovsext/BufferMgmt.c. Ovsext/BufferMgmt.c + * deals with buffer mgmt for NBLs. Where as this framework deals with + * management of buffer that holds a netlink message. + * + * This framework provides APIs for putting/accessing data in a buffer. These + * APIs are used by driver's netlink protocol implementation. + * + * We can see this framework as a subset of ofpbuf in ovs userspace. + * + * This framework is NOT a generic buffer management framework (ofpbuf + * is a generic buffer mgmt framework) and provides only the functioanlities + * which would be useful for netlink protocol. Some of the key features are: + * + * a. It DOES NOT support automatic buffer reallocation. + * i. A netlink input/output message is a static buffer. + * b. The unused space is at the tail. + * c. There is no notion of headdroom. + * ========================================================================== + */ +#include +#include +#include +#include +#include +#include + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_NETLINK +#include "Debug.h" +#include "NetlinkBuf.h" + +/* Returns used space in the buffer */ +#define NL_BUF_USED_SPACE(_buf) (_buf->bufLen - \ + _buf->bufRemLen) + +/* Validates that offset is within buffer boundaries and will not + * create holes in the buffer.*/ +#define NL_BUF_IS_VALID_OFFSET(_buf, _offset) (_offset <= \ + NL_BUF_TAIL_OFFSET(_buf) ? 1 : 0) + +/* Validates if new data of size _size can be added at offset _offset. + * This macor assumes that offset validation has been done.*/ +#define NL_BUF_CAN_ADD(_buf, _size, _offset) (((_offset + _size <= \ + _buf->bufLen) && (_size \ + <= _buf->bufRemLen)) ? \ + 1 : 0) + +/* Returns the offset of tail wrt buffer head */ +#define NL_BUF_TAIL_OFFSET(_buf) (_buf->tail - _buf->head) + +static __inline VOID +_NlBufCopyAtTailUnsafe(PNL_BUFFER nlBuf, PCHAR data, UINT32 len); +static __inline VOID +_NlBufCopyAtOffsetUnsafe(PNL_BUFFER nlBuf, PCHAR data, + UINT32 len, UINT32 offset); + +/* + * -------------------------------------------------------------------------- + * NlBufInit -- + * + * Initializes NL_BUF with buffer pointer and length. + * -------------------------------------------------------------------------- + */ +VOID +NlBufInit(PNL_BUFFER nlBuf, PCHAR base, UINT32 size) +{ + ASSERT(nlBuf); + nlBuf->head = nlBuf->tail = base; + nlBuf->bufLen = nlBuf->bufRemLen = size; +} + +/* + * -------------------------------------------------------------------------- + * NlBufDeInit -- + * + * Resets the buffer variables to NULL. + * -------------------------------------------------------------------------- + */ +VOID +NlBufDeInit(PNL_BUFFER nlBuf) +{ + ASSERT(nlBuf); + nlBuf->head = nlBuf->tail = NULL; + nlBuf->bufLen = nlBuf->bufRemLen = 0; +} + +/* + * -------------------------------------------------------------------------- + * NlBufCopyAtTail -- + * + * Copies the data to the tail end of the buffer. + * -------------------------------------------------------------------------- + */ +BOOLEAN +NlBufCopyAtTail(PNL_BUFFER nlBuf, PCHAR data, UINT32 len) +{ + BOOLEAN ret = TRUE; + + ASSERT(nlBuf); + + /* Check if we have enough space */ + if (!NL_BUF_CAN_ADD(nlBuf, len, NL_BUF_TAIL_OFFSET(nlBuf))) { + ret = FALSE; + goto done; + } + + _NlBufCopyAtTailUnsafe(nlBuf, data, len); + +done: + return ret; +} + +/* + * -------------------------------------------------------------------------- + * NlBufCopyAtHead -- + * + * Copies the data to the head of the buffer. + * It can be seen as special case of NlBufCopyAtOffset with input + * offset zero. + * -------------------------------------------------------------------------- + */ +BOOLEAN +NlBufCopyAtHead(PNL_BUFFER nlBuf, PCHAR data, UINT32 len) +{ + BOOLEAN ret = TRUE; + + ASSERT(nlBuf); + + /* Check if we have enough space */ + if (!NL_BUF_CAN_ADD(nlBuf, len, 0)) { + ret = FALSE; + goto done; + } + + if (nlBuf->head == nlBuf->tail) { + /* same as inserting in tail */ + _NlBufCopyAtTailUnsafe(nlBuf, data, len); + goto done; + } + + _NlBufCopyAtOffsetUnsafe(nlBuf, data, len, 0); + +done: + return ret; +} + +/* + * -------------------------------------------------------------------------- + * NlBufCopyAtOffset -- + * + * Inserts data at input offset in the buffer. + * If the offset is earlier then tail end then it first creates + * space of size input length at input offset by moving the existing + * data forward. + * -------------------------------------------------------------------------- + */ +BOOLEAN +NlBufCopyAtOffset(PNL_BUFFER nlBuf, PCHAR data, UINT32 len, UINT32 offset) +{ + PCHAR dest = NULL; + BOOLEAN ret = TRUE; + + ASSERT(nlBuf); + + /* Check if input offset is valid and has enough space */ + if ((!NL_BUF_IS_VALID_OFFSET(nlBuf, offset)) || + (!NL_BUF_CAN_ADD(nlBuf, len, offset))) { + ret = FALSE; + goto done; + } + + dest = nlBuf->head + offset; + + if (dest == nlBuf->tail) { + /* same as inserting in tail */ + _NlBufCopyAtTailUnsafe(nlBuf, data, len); + goto done; + } + + _NlBufCopyAtOffsetUnsafe(nlBuf, data, len, offset); + +done: + return ret; +} + +/* + * -------------------------------------------------------------------------- + * NlBufCopyAtTailUninit -- + * + * Memsets the buffer portion of length len at tail end with zero. + * -------------------------------------------------------------------------- + */ +PCHAR +NlBufCopyAtTailUninit(PNL_BUFFER nlBuf, UINT32 len) +{ + PCHAR ret; + + ret = nlBuf->tail; + if ((NlBufCopyAtTail(nlBuf, NULL, len)) == FALSE) { + ret = NULL; + } + + return ret; +} + +/* + * -------------------------------------------------------------------------- + * NlBufCopyAtHeadUninit -- + * + * Memsets the buffer portion of length len at head with zero. + * -------------------------------------------------------------------------- + */ +PCHAR +NlBufCopyAtHeadUninit(PNL_BUFFER nlBuf, UINT32 len) +{ + PCHAR ret = NULL; + + if ((NlBufCopyAtHead(nlBuf, NULL, len)) == FALSE) { + goto done; + } + + ret = nlBuf->head; + +done: + return ret; +} + +/* + * -------------------------------------------------------------------------- + * NlBufCopyAtOffsetUninit -- + * + * Memsets the buffer portion of length len at head with zero. + * + * If the offset is earlier then tail end then it first creates + * space of size input length at input offset by moving the existing + * data forward. + * -------------------------------------------------------------------------- + */ +PCHAR +NlBufCopyAtOffsetUninit(PNL_BUFFER nlBuf, UINT32 len, UINT32 offset) +{ + PCHAR ret = NULL; + + if ((NlBufCopyAtOffset(nlBuf, NULL, len, offset)) == FALSE) { + goto done; + } + + ret = nlBuf->head + offset; + +done: + return ret; +} + +/* + * -------------------------------------------------------------------------- + * NlBufAt -- + * + * Returns pointer to buffer at input offset. + * bufLen is used to verify that expected data length + * is within valid boundaries. Here by boundaries we mean + * within head and tail. + * -------------------------------------------------------------------------- + */ +PCHAR +NlBufAt(PNL_BUFFER nlBuf, UINT32 offset, UINT32 bufLen) +{ + PCHAR ret = NULL; + + ASSERT(nlBuf); + + if ((!NL_BUF_IS_VALID_OFFSET(nlBuf, offset))) { + goto done; + } + + /* Check if requested buffer is within head and tail */ + if ((offset + bufLen) > NL_BUF_USED_SPACE(nlBuf)) { + goto done; + } + + ret = nlBuf->head + offset; +done: + return ret; +} + +/* *_Unsafe functions does not do any validation. */ + +/* + * -------------------------------------------------------------------------- + * _NlBufCopyAtTailUnsafe -- + * + * Helper function for NlBufCopyAtTail. + * -------------------------------------------------------------------------- + */ +static __inline VOID +_NlBufCopyAtTailUnsafe(PNL_BUFFER nlBuf, PCHAR data, UINT32 len) +{ + if (data) { + RtlCopyMemory(nlBuf->tail, data, len); + } else { + RtlZeroMemory(nlBuf->tail, len); + } + + nlBuf->tail += len; + nlBuf->bufRemLen -= len; +} + +/* + * -------------------------------------------------------------------------- + * _NlBufCopyAtOffsetUnsafe -- + * + * Helper function for NlBufCopyAtOffset. + * -------------------------------------------------------------------------- + */ +static __inline VOID +_NlBufCopyAtOffsetUnsafe(PNL_BUFFER nlBuf, PCHAR data, + UINT32 len, UINT32 offset) +{ + PCHAR dest = NULL; + + dest = nlBuf->head + offset; + + RtlMoveMemory(dest+len, dest, NL_BUF_USED_SPACE(nlBuf) - offset); + + if (data) { + RtlCopyMemory(dest, data, len); + } else { + RtlZeroMemory(dest, len); + } + + nlBuf->tail += len; + nlBuf->bufRemLen -= len; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkBuf.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkBuf.h --- openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkBuf.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkBuf.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __NETLINK_BUF_H_ +#define __NETLINK_BUF_H_ 1 + +typedef struct _NL_BUF { + PCHAR head; /* start address of the buffer */ + PCHAR tail; /* first empty byte of the buffer */ + UINT32 bufLen; /* original length of buffer */ + UINT32 bufRemLen; /* remaining length of buffer */ +} NL_BUFFER, *PNL_BUFFER; + +VOID NlBufInit(PNL_BUFFER nlBuf, PCHAR base, UINT32 size); +VOID NlBufDeInit(PNL_BUFFER nlBuf); + +BOOLEAN NlBufCopyAtTail(PNL_BUFFER nlBuf, PCHAR data, UINT32 len); +BOOLEAN NlBufCopyAtHead(PNL_BUFFER nlBuf, PCHAR data, UINT32 len); +BOOLEAN NlBufCopyAtOffset(PNL_BUFFER nlBuf, PCHAR data, + UINT32 len, UINT32 offset); + +PCHAR NlBufCopyAtTailUninit(PNL_BUFFER nlBuf, UINT32 len); +PCHAR NlBufCopyAtHeadUninit(PNL_BUFFER nlBuf, UINT32 len); +PCHAR NlBufCopyAtOffsetUninit(PNL_BUFFER nlBuf, UINT32 len, UINT32 offset); + +PCHAR NlBufAt(PNL_BUFFER nlBuf, UINT32 offset, UINT32 len); + +/* + * -------------------------------------------------------------------------- + * NlBufSize -- + * + * Returns the used size of buffer. + * -------------------------------------------------------------------------- + */ +static __inline UINT32 +NlBufSize(PNL_BUFFER nlBuf) +{ + ASSERT(nlBuf); + return (nlBuf->bufLen - nlBuf->bufRemLen); +} + +/* + * -------------------------------------------------------------------------- + * NlBufRemLen -- + * + * Returns the unused size of buffer. + * -------------------------------------------------------------------------- + */ +static __inline UINT32 +NlBufRemLen(PNL_BUFFER nlBuf) +{ + ASSERT(nlBuf); + return (nlBuf->bufRemLen); +} + +#endif /* __NETLINK_BUF_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Netlink/Netlink.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/Netlink.c --- openvswitch-2.3.1/datapath-windows/ovsext/Netlink/Netlink.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/Netlink.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1128 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "NetlinkProto.h" +#include "Netlink.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_NETLINK +#include "Debug.h" + +/* ========================================================================== + * This file provides simple netlink get, put and validation APIs. + * Most of the code is on similar lines as userspace netlink implementation. + * + * TODO: Convert these methods to inline. + * ========================================================================== + */ + +/* + * --------------------------------------------------------------------------- + * Prepare netlink message headers. This API adds + * NL_MSG_HDR + GENL_HDR + OVS_HDR to the tail of input NLBuf. + * Attributes should be added by caller. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlFillOvsMsg(PNL_BUFFER nlBuf, UINT16 nlmsgType, + UINT16 nlmsgFlags, UINT32 nlmsgSeq, + UINT32 nlmsgPid, UINT8 genlCmd, + UINT8 genlVer, UINT32 dpNo) +{ + BOOLEAN writeOk; + OVS_MESSAGE msgOut; + UINT32 offset = NlBufSize(nlBuf); + + /* To keep compiler happy for release build. */ + UNREFERENCED_PARAMETER(offset); + ASSERT(NlBufAt(nlBuf, offset, 0) != 0); + + msgOut.nlMsg.nlmsgType = nlmsgType; + msgOut.nlMsg.nlmsgFlags = nlmsgFlags; + msgOut.nlMsg.nlmsgSeq = nlmsgSeq; + msgOut.nlMsg.nlmsgPid = nlmsgPid; + msgOut.nlMsg.nlmsgLen = sizeof(struct _OVS_MESSAGE); + + msgOut.genlMsg.cmd = genlCmd; + msgOut.genlMsg.version = genlVer; + msgOut.genlMsg.reserved = 0; + + msgOut.ovsHdr.dp_ifindex = dpNo; + + writeOk = NlMsgPutTail(nlBuf, (PCHAR)(&msgOut), + sizeof (struct _OVS_MESSAGE)); + + return writeOk; +} + +/* + * --------------------------------------------------------------------------- + * Prepare NL_MSG_HDR only. This API appends a NL_MSG_HDR to the tail of + * input NlBuf. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlFillNlHdr(PNL_BUFFER nlBuf, UINT16 nlmsgType, + UINT16 nlmsgFlags, UINT32 nlmsgSeq, + UINT32 nlmsgPid) +{ + BOOLEAN writeOk; + NL_MSG_HDR msgOut; + UINT32 offset = NlBufSize(nlBuf); + + /* To keep compiler happy for release build. */ + UNREFERENCED_PARAMETER(offset); + ASSERT(NlBufAt(nlBuf, offset, 0) != 0); + + msgOut.nlmsgType = nlmsgType; + msgOut.nlmsgFlags = nlmsgFlags; + msgOut.nlmsgSeq = nlmsgSeq; + msgOut.nlmsgPid = nlmsgPid; + msgOut.nlmsgLen = sizeof(struct _NL_MSG_HDR); + + writeOk = NlMsgPutTail(nlBuf, (PCHAR)(&msgOut), + sizeof(struct _NL_MSG_HDR)); + + return writeOk; +} + +/* + * --------------------------------------------------------------------------- + * Prepare a 'OVS_MESSAGE_ERROR' message. + * --------------------------------------------------------------------------- + */ +VOID +NlBuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgError, UINT errorCode) +{ + NL_BUFFER nlBuffer; + + ASSERT(errorCode != NL_ERROR_PENDING); + + NlBufInit(&nlBuffer, (PCHAR)msgError, sizeof *msgError); + NlFillNlHdr(&nlBuffer, NLMSG_ERROR, 0, + msgIn->nlMsg.nlmsgSeq, msgIn->nlMsg.nlmsgPid); + + msgError->errorMsg.error = errorCode; + msgError->errorMsg.nlMsg = msgIn->nlMsg; + msgError->nlMsg.nlmsgLen = sizeof(OVS_MESSAGE_ERROR); +} + +/* + * --------------------------------------------------------------------------- + * Adds Netlink Header to the NL_BUF. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutNlHdr(PNL_BUFFER buf, PNL_MSG_HDR nlMsg) +{ + if ((NlBufCopyAtOffset(buf, (PCHAR)nlMsg, NLMSG_HDRLEN, 0))) { + return TRUE; + } + + return FALSE; +} + +/* + * --------------------------------------------------------------------------- + * Adds Genl Header to the NL_BUF. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutGenlHdr(PNL_BUFFER buf, PGENL_MSG_HDR genlMsg) +{ + if ((NlBufCopyAtOffset(buf, (PCHAR)genlMsg, GENL_HDRLEN, NLMSG_HDRLEN))) { + return TRUE; + } + + return FALSE; +} + +/* + * --------------------------------------------------------------------------- + * Adds OVS Header to the NL_BUF. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutOvsHdr(PNL_BUFFER buf, POVS_HDR ovsHdr) +{ + if ((NlBufCopyAtOffset(buf, (PCHAR)ovsHdr, OVS_HDRLEN, + GENL_HDRLEN + NLMSG_HDRLEN))) { + return TRUE; + } + + return FALSE; +} + +/* + * --------------------------------------------------------------------------- + * Adds data of length 'len' to the tail end of NL_BUF. + * Refer nl_msg_put for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTail(PNL_BUFFER buf, const PCHAR data, UINT32 len) +{ + len = NLMSG_ALIGN(len); + if (NlBufCopyAtTail(buf, data, len)) { + return TRUE; + } + + return FALSE; +} + +/* + * --------------------------------------------------------------------------- + * memsets length 'len' at tail end of NL_BUF. + * Refer nl_msg_put_uninit for more details. + * --------------------------------------------------------------------------- + */ +PCHAR +NlMsgPutTailUninit(PNL_BUFFER buf, UINT32 len) +{ + len = NLMSG_ALIGN(len); + return NlBufCopyAtTailUninit(buf, len); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute to the tail end of buffer. It does + * not copy the attribute payload. + * Refer nl_msg_put_unspec_uninit for more details. + * --------------------------------------------------------------------------- + */ +PCHAR +NlMsgPutTailUnspecUninit(PNL_BUFFER buf, UINT16 type, UINT16 len) +{ + PCHAR ret = NULL; + UINT16 totalLen = NLA_HDRLEN + len; + PNL_ATTR nla = (PNL_ATTR)(NlMsgPutTailUninit(buf, totalLen)); + + if (!nla) { + goto done; + } + + ret = (PCHAR)(nla + 1); + nla->nlaLen = totalLen; + nla->nlaType = type; + +done: + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute to the tail end of buffer. It copies attribute + * payload as well. + * Refer nl_msg_put_unspec for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTailUnspec(PNL_BUFFER buf, UINT16 type, PCHAR data, UINT16 len) +{ + BOOLEAN ret = TRUE; + PCHAR nlaData = NlMsgPutTailUnspecUninit(buf, type, len); + + if (!nlaData) { + ret = FALSE; + goto done; + } + + RtlCopyMemory(nlaData, data, len); + +done: + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and no payload at the tail end of buffer. + * Refer nl_msg_put_flag for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTailFlag(PNL_BUFFER buf, UINT16 type) +{ + BOOLEAN ret = TRUE; + PCHAR nlaData = NlMsgPutTailUnspecUninit(buf, type, 0); + + if (!nlaData) { + ret = FALSE; + } + + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 8 bit payload at the tail end of buffer. + * Refer nl_msg_put_u8 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTailU8(PNL_BUFFER buf, UINT16 type, UINT8 value) +{ + return (NlMsgPutTailUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 16 bit payload at the tail end of buffer. + * Refer nl_msg_put_u16 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTailU16(PNL_BUFFER buf, UINT16 type, UINT16 value) +{ + return (NlMsgPutTailUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 32 bit payload at the tail end of buffer. + * Refer nl_msg_put_u32 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTailU32(PNL_BUFFER buf, UINT16 type, UINT32 value) +{ + return (NlMsgPutTailUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 64 bit payload at the tail end of buffer. + * Refer nl_msg_put_u64 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTailU64(PNL_BUFFER buf, UINT16 type, UINT64 value) +{ + return (NlMsgPutTailUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and string payload. + * Refer nl_msg_put_string for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutTailString(PNL_BUFFER buf, UINT16 type, PCHAR value) +{ + size_t strLen = strlen(value) + 1; +#ifdef DBG + /* Attribute length should come within 16 bits (NL_ATTR). + * Not a likely case, hence validation only in debug mode. */ + if ((strLen + PAD_SIZE(strLen, NLA_ALIGNTO)) > MAXUINT16) { + return FALSE; + } +#endif + + /* typecast to keep compiler happy */ + return (NlMsgPutTailUnspec(buf, type, value, + (UINT16)strLen)); +} + +/* + * --------------------------------------------------------------------------- + * Adds data of length 'len' to the head of NL_BUF. + * Refer nl_msg_push for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHead(PNL_BUFFER buf, const PCHAR data, UINT32 len) +{ + len = NLMSG_ALIGN(len); + if (NlBufCopyAtHead(buf, data, len)) { + return TRUE; + } + + return FALSE; +} + +/* + * --------------------------------------------------------------------------- + * memsets length 'len' at head of NL_BUF. + * Refer nl_msg_push_uninit for more details. + * --------------------------------------------------------------------------- + */ +PCHAR +NlMsgPutHeadUninit(PNL_BUFFER buf, UINT32 len) +{ + len = NLMSG_ALIGN(len); + return NlBufCopyAtHeadUninit(buf, len); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute to the head of buffer. It does + * not copy the attribute payload. + * Refer nl_msg_push_unspec_uninit for more details. + * --------------------------------------------------------------------------- + */ +PCHAR +NlMsgPutHeadUnspecUninit(PNL_BUFFER buf, UINT16 type, UINT16 len) +{ + PCHAR ret = NULL; + UINT16 totalLen = NLA_HDRLEN + len; + PNL_ATTR nla = (PNL_ATTR)(NlMsgPutHeadUninit(buf, totalLen)); + + if (!nla) { + goto done; + } + + ret = (PCHAR)(nla + 1); + nla->nlaLen = totalLen; + nla->nlaType = type; + +done: + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute to the head of buffer. It copies attribute + * payload as well. + * Refer nl_msg_push_unspec for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHeadUnspec(PNL_BUFFER buf, UINT16 type, PCHAR data, UINT16 len) +{ + BOOLEAN ret = TRUE; + PCHAR nlaData = NlMsgPutHeadUnspecUninit(buf, type, len); + + if (!nlaData) { + ret = FALSE; + goto done; + } + + RtlCopyMemory(nlaData, data, len); + +done: + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and no payload at the head of buffer. + * Refer nl_msg_push_flag for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHeadFlag(PNL_BUFFER buf, UINT16 type) +{ + BOOLEAN ret = TRUE; + PCHAR nlaData = NlMsgPutHeadUnspecUninit(buf, type, 0); + + if (!nlaData) { + ret = FALSE; + } + + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 8 bit payload at the head of buffer. + * Refer nl_msg_push_u8 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHeadU8(PNL_BUFFER buf, UINT16 type, UINT8 value) +{ + return (NlMsgPutHeadUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 16 bit payload at the head of buffer. + * Refer nl_msg_push_u16 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHeadU16(PNL_BUFFER buf, UINT16 type, UINT16 value) +{ + return (NlMsgPutHeadUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 32 bit payload at the head of buffer. + * Refer nl_msg_push_u32 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHeadU32(PNL_BUFFER buf, UINT16 type, UINT32 value) +{ + return (NlMsgPutHeadUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and 64 bit payload at the head of buffer. + * Refer nl_msg_push_u64 for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHeadU64(PNL_BUFFER buf, UINT16 type, UINT64 value) +{ + return (NlMsgPutHeadUnspec(buf, type, (PCHAR)(&value), sizeof(value))); +} + +/* + * --------------------------------------------------------------------------- + * Adds an attribute of 'type' and string payload. + * Refer nl_msg_push_string for more details. + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlMsgPutHeadString(PNL_BUFFER buf, UINT16 type, PCHAR value) +{ + size_t strLen = strlen(value) + 1; +#ifdef DBG + /* Attribute length should come within 16 bits (NL_ATTR). + * Not a likely case, hence validation only in debug mode. */ + if ((strLen + PAD_SIZE(strLen, NLA_ALIGNTO)) > MAXUINT16) { + return FALSE; + } +#endif + + /* typecast to keep compiler happy */ + return (NlMsgPutHeadUnspec(buf, type, value, + (UINT16)strLen)); +} + +/* + * --------------------------------------------------------------------------- + * Adds the header for nested netlink attributes. It + * returns the offset of this header. If addition of header fails + * then returned value of offset will be zero. + * Refer nl_msg_start_nested for more details. + * --------------------------------------------------------------------------- + */ +UINT32 +NlMsgStartNested(PNL_BUFFER buf, UINT16 type) +{ + UINT32 offset = NlBufSize(buf); + PCHAR nlaData = NULL; + + nlaData = NlMsgPutTailUnspecUninit(buf, type, 0); + + if (!nlaData) { + /* Value zero must be reated as error by the caller. + * This is because an attribute can never be added + * at offset zero, it will always come after NL_MSG_HDR, + * GENL_HDR and OVS_HEADER. */ + offset = 0; + } + + return offset; +} + +/* + * --------------------------------------------------------------------------- + * Finalizes the nested netlink attribute by updating the nla_len. + * offset should be the one returned by NlMsgStartNested. + * Refer nl_msg_end_nested for more details. + * --------------------------------------------------------------------------- + */ +VOID +NlMsgEndNested(PNL_BUFFER buf, UINT32 offset) +{ + PNL_ATTR attr = (PNL_ATTR)(NlBufAt(buf, offset, sizeof *attr)); + + /* Typecast to keep compiler happy. + * Attribute length would never exceed MAX UINT16.*/ + attr->nlaLen = (UINT16)(NlBufSize(buf) - offset); +} + +/* + * -------------------------------------------------------------------------- + * Appends a nested Netlink attribute of the given 'type', with the 'size' + * bytes of content starting at 'data', to 'msg'. + * Refer nl_msg_put_nested for more details. + * -------------------------------------------------------------------------- + */ +VOID +NlMsgPutNested(PNL_BUFFER buf, UINT16 type, + const PVOID data, UINT32 size) +{ + UINT32 offset = NlMsgStartNested(buf, type); + BOOLEAN ret = FALSE; + + ASSERT(offset); + + ret = NlMsgPutTail(buf, data, size); + + ASSERT(ret); + + NlMsgEndNested(buf, offset); +} + +/* Accessing netlink message payload */ + +/* + * --------------------------------------------------------------------------- + * Netlink message accessing the payload. + * --------------------------------------------------------------------------- + */ +PVOID +NlMsgAt(const PNL_MSG_HDR nlh, UINT32 offset) +{ + return ((PCHAR)nlh + offset); +} + +/* + * --------------------------------------------------------------------------- + * Returns the size of netlink message. + * --------------------------------------------------------------------------- + */ +UINT32 +NlMsgSize(const PNL_MSG_HDR nlh) +{ + return nlh->nlmsgLen; +} + +/* + * --------------------------------------------------------------------------- + * Aligns the size of Netlink message. + * --------------------------------------------------------------------------- + */ +VOID +NlMsgAlignSize(const PNL_MSG_HDR nlh) +{ + nlh->nlmsgLen = NLMSG_ALIGN(nlh->nlmsgLen); + return; +} + +/* + * --------------------------------------------------------------------------- + * Sets the size of Netlink message. + * --------------------------------------------------------------------------- + */ +VOID +NlMsgSetSize(const PNL_MSG_HDR nlh, UINT32 msgLen) +{ + nlh->nlmsgLen = msgLen; +} + +/* + * --------------------------------------------------------------------------- + * Returns pointer to nlmsg payload. + * --------------------------------------------------------------------------- + */ +PCHAR +NlHdrPayload(const PNL_MSG_HDR nlh) +{ + return ((PCHAR)nlh + NLMSG_HDRLEN); +} + +/* + * --------------------------------------------------------------------------- + * Returns length of nlmsg payload. + * --------------------------------------------------------------------------- + */ +UINT32 +NlHdrPayloadLen(const PNL_MSG_HDR nlh) +{ + return nlh->nlmsgLen - NLMSG_HDRLEN; +} + +/* + * --------------------------------------------------------------------------- + * Returns pointer to nlmsg attributes. + * --------------------------------------------------------------------------- + */ +PNL_ATTR +NlMsgAttrs(const PNL_MSG_HDR nlh) +{ + return (PNL_ATTR) (NlHdrPayload(nlh) + GENL_HDRLEN + OVS_HDRLEN); +} + +/* + * --------------------------------------------------------------------------- + * Returns size of to nlmsg attributes. + * --------------------------------------------------------------------------- + */ +UINT32 +NlMsgAttrsLen(const PNL_MSG_HDR nlh) +{ + return NlHdrPayloadLen(nlh) - GENL_HDRLEN - OVS_HDRLEN; +} + +/* Netlink message parse. */ + +/* + * --------------------------------------------------------------------------- + * Returns next netlink message in the stream. + * --------------------------------------------------------------------------- + */ +PNL_MSG_HDR +NlMsgNext(const PNL_MSG_HDR nlh) +{ + return (PNL_MSG_HDR)((PCHAR)nlh + + NLMSG_ALIGN(nlh->nlmsgLen)); +} + +/* + * --------------------------------------------------------------------------- + * Netlink Attr helper APIs. + * --------------------------------------------------------------------------- + */ +INT +NlAttrIsValid(const PNL_ATTR nla, UINT32 maxlen) +{ + return (maxlen >= sizeof *nla + && nla->nlaLen >= sizeof *nla + && nla->nlaLen <= maxlen); +} + +/* + * --------------------------------------------------------------------------- + * Returns alligned length of the attribute. + * --------------------------------------------------------------------------- + */ +UINT32 +NlAttrLenPad(const PNL_ATTR nla, UINT32 maxlen) +{ + UINT32 len = NLA_ALIGN(nla->nlaLen); + + return len <= maxlen ? len : nla->nlaLen; +} + +/* + * --------------------------------------------------------------------------- + * Default minimum payload size for each type of attribute. + * --------------------------------------------------------------------------- + */ +UINT32 +NlAttrMinLen(NL_ATTR_TYPE type) +{ + switch (type) { + case NL_A_NO_ATTR: return 0; + case NL_A_UNSPEC: return 0; + case NL_A_U8: return 1; + case NL_A_U16: return 2; + case NL_A_U32: return 4; + case NL_A_U64: return 8; + case NL_A_STRING: return 1; + case NL_A_FLAG: return 0; + case NL_A_NESTED: return 0; + case N_NL_ATTR_TYPES: + default: + OVS_LOG_WARN("Unsupprted attribute type: %d", type); + ASSERT(0); + } + + /* To keep compiler happy */ + return 0; +} + +/* + * --------------------------------------------------------------------------- + * Default maximum payload size for each type of attribute. + * --------------------------------------------------------------------------- + */ +UINT32 +NlAttrMaxLen(NL_ATTR_TYPE type) +{ + switch (type) { + case NL_A_NO_ATTR: return SIZE_MAX; + case NL_A_UNSPEC: return SIZE_MAX; + case NL_A_U8: return 1; + case NL_A_U16: return 2; + case NL_A_U32: return 4; + case NL_A_U64: return 8; + case NL_A_STRING: return MAXUINT16; + case NL_A_FLAG: return SIZE_MAX; + case NL_A_NESTED: return SIZE_MAX; + case N_NL_ATTR_TYPES: + default: + OVS_LOG_WARN("Unsupprted attribute type: %d", type); + ASSERT(0); + } + + /* To keep compiler happy */ + return 0; +} + +/* Netlink attribute iteration. */ + +/* + * --------------------------------------------------------------------------- + * Returns the next attribute. + * --------------------------------------------------------------------------- + */ +PNL_ATTR +NlAttrNext(const PNL_ATTR nla) +{ + return (PNL_ATTR)((UINT8 *)nla + NLA_ALIGN(nla->nlaLen)); +} + +/* + * -------------------------------------------------------------------------- + * Returns the bits of 'nla->nlaType' that are significant for determining + * its type. + * -------------------------------------------------------------------------- + */ +UINT16 +NlAttrType(const PNL_ATTR nla) +{ + return nla->nlaType & NLA_TYPE_MASK; +} + +/* + * -------------------------------------------------------------------------- + * Returns the netlink attribute data. + * -------------------------------------------------------------------------- + */ +PVOID +NlAttrData(const PNL_ATTR nla) +{ + return ((PCHAR)nla + NLA_HDRLEN); +} + +/* + * --------------------------------------------------------------------------- + * Returns the number of bytes in the payload of attribute 'nla'. + * --------------------------------------------------------------------------- + */ +UINT32 +NlAttrGetSize(const PNL_ATTR nla) +{ + return nla->nlaLen - NLA_HDRLEN; +} + +/* + * --------------------------------------------------------------------------- + * Returns the first byte in the payload of attribute 'nla'. + * --------------------------------------------------------------------------- + */ +const PVOID +NlAttrGet(const PNL_ATTR nla) +{ + ASSERT(nla->nlaLen >= NLA_HDRLEN); + return nla + 1; +} + +/* + * --------------------------------------------------------------------------- + * Asserts that 'nla''s payload is at least 'size' bytes long, and returns the + * first byte of the payload. + * --------------------------------------------------------------------------- + */ +const +PVOID NlAttrGetUnspec(const PNL_ATTR nla, UINT32 size) +{ + UNREFERENCED_PARAMETER(size); + ASSERT(nla->nlaLen >= NLA_HDRLEN + size); + return nla + 1; +} + +/* + * --------------------------------------------------------------------------- + * Returns the 64-bit network byte order value in 'nla''s payload. + * + * Asserts that 'nla''s payload is at least 8 bytes long. + * --------------------------------------------------------------------------- + */ +BE64 +NlAttrGetBe64(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, BE64); +} + +/* + * --------------------------------------------------------------------------- + * Returns the 32-bit network byte order value in 'nla''s payload. + * + * Asserts that 'nla''s payload is at least 4 bytes long. + * --------------------------------------------------------------------------- + */ +BE32 +NlAttrGetBe32(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, BE32); +} + +/* + * --------------------------------------------------------------------------- + * Returns the 16-bit network byte order value in 'nla''s payload. + * + * Asserts that 'nla''s payload is at least 2 bytes long. + * --------------------------------------------------------------------------- + */ +BE16 +NlAttrGetBe16(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, BE16); +} + +/* + * --------------------------------------------------------------------------- + * Returns the 8-bit network byte order value in 'nla''s payload. + * + * Asserts that 'nla''s payload is at least 1 byte long. + * --------------------------------------------------------------------------- + */ +BE8 +NlAttrGetBe8(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, BE8); +} + +/* + * --------------------------------------------------------------------------- + * Returns the 8-bit value in 'nla''s payload. + * --------------------------------------------------------------------------- + */ +UINT8 +NlAttrGetU8(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, UINT8); +} + +/* + * --------------------------------------------------------------------------- + * Returns the 16-bit host byte order value in 'nla''s payload. + * Asserts that 'nla''s payload is at least 2 bytes long. + * --------------------------------------------------------------------------- + */ +UINT16 +NlAttrGetU16(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, UINT16); +} + +/* + * --------------------------------------------------------------------------- + * Returns the 32-bit host byte order value in 'nla''s payload. + * Asserts that 'nla''s payload is at least 4 bytes long. + * --------------------------------------------------------------------------- + */ +UINT32 +NlAttrGetU32(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, UINT32); +} + +/* + * --------------------------------------------------------------------------- + * Returns the 64-bit host byte order value in 'nla''s payload. + * Asserts that 'nla''s payload is at least 8 bytes long. + * --------------------------------------------------------------------------- + */ +UINT64 +NlAttrGetU64(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, UINT64); +} + +/* + * --------------------------------------------------------------------------- + * Validate the netlink attribute against the policy + * --------------------------------------------------------------------------- + */ +BOOLEAN +NlAttrValidate(const PNL_ATTR nla, const PNL_POLICY policy) +{ + UINT32 minLen; + UINT32 maxLen; + UINT32 len; + BOOLEAN ret = FALSE; + + if ((policy->type == NL_A_NO_ATTR) || + (policy->type == NL_A_VAR_LEN) || + (policy->type == NL_A_NESTED)) { + /* Do not validate anything for attributes of type var length */ + ret = TRUE; + goto done; + } + + /* Figure out min and max length. */ + minLen = policy->minLen; + if (!minLen) { + minLen = NlAttrMinLen(policy->type); + } + maxLen = policy->maxLen; + if (!maxLen) { + maxLen = NlAttrMaxLen(policy->type); + } + + /* Verify length. */ + len = NlAttrGetSize(nla); + if (len < minLen || len > maxLen) { + OVS_LOG_WARN("Attribute: %p, len: %d, not in valid range, " + "min: %d, max: %d", nla, len, minLen, maxLen); + goto done; + } + + /* Strings must be null terminated and must not have embedded nulls. */ + if (policy->type == NL_A_STRING) { + if (((PCHAR) nla)[nla->nlaLen - 1]) { + OVS_LOG_WARN("Attributes %p lacks null at the end", nla); + goto done; + } + + if (memchr(nla + 1, '\0', len - 1) != NULL) { + OVS_LOG_WARN("Attributes %p has bad length", nla); + goto done; + } + } + + ret = TRUE; + +done: + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Returns an attribute of type 'type' from a series of + * attributes. + * --------------------------------------------------------------------------- + */ +const PNL_ATTR +NlAttrFind__(const PNL_ATTR attrs, UINT32 size, UINT16 type) +{ + PNL_ATTR iter = NULL; + PNL_ATTR ret = NULL; + UINT32 left; + + NL_ATTR_FOR_EACH (iter, left, attrs, size) { + if (NlAttrType(iter) == type) { + ret = iter; + goto done; + } + } + +done: + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Returns the first Netlink attribute within 'nla' with the specified + * 'type'. + * + * This function does not validate the attribute's length. + * --------------------------------------------------------------------------- + */ +const PNL_ATTR +NlAttrFindNested(const PNL_ATTR nla, UINT16 type) +{ + return NlAttrFind__((const PNL_ATTR)(NlAttrGet(nla)), + NlAttrGetSize(nla), type); +} + +/* + *---------------------------------------------------------------------------- + * Parses the netlink message at a given offset (attrOffset) + * as a series of attributes. A pointer to the attribute with type + * 'type' is stored in attrs at index 'type'. policy is used to define the + * attribute type validation parameters. + * 'nla_offset' should be NLMSG_HDRLEN + GENL_HDRLEN + OVS_HEADER + * + * Returns BOOLEAN to indicate success/failure. + *---------------------------------------------------------------------------- + */ +BOOLEAN +NlAttrParse(const PNL_MSG_HDR nlMsg, UINT32 attrOffset, + UINT32 totalAttrLen, + const NL_POLICY policy[], + PNL_ATTR attrs[], UINT32 n_attrs) +{ + PNL_ATTR nla; + UINT32 left; + UINT32 iter; + BOOLEAN ret = FALSE; + + RtlZeroMemory(attrs, n_attrs * sizeof *attrs); + + + /* There is nothing to parse */ + if (!(NlMsgAttrsLen(nlMsg))) { + ret = TRUE; + goto done; + } + + if ((NlMsgSize(nlMsg) < attrOffset)) { + OVS_LOG_WARN("No attributes in nlMsg: %p at offset: %d", + nlMsg, attrOffset); + goto done; + } + + NL_ATTR_FOR_EACH (nla, left, NlMsgAt(nlMsg, attrOffset), + totalAttrLen) + { + UINT16 type = NlAttrType(nla); + if (type < n_attrs && policy[type].type != NL_A_NO_ATTR) { + /* Typecasting to keep the compiler happy */ + const PNL_POLICY e = (const PNL_POLICY)(&policy[type]); + if (!NlAttrValidate(nla, e)) { + goto done; + } + + if (attrs[type]) { + OVS_LOG_WARN("Duplicate attribute in nlMsg: %p, " + "type: %u", nlMsg, type); + } + + attrs[type] = nla; + } + } + + if (left) { + OVS_LOG_ERROR("Attributes followed by garbage"); + goto done; + } + + for (iter = 0; iter < n_attrs; iter++) { + const PNL_POLICY e = (const PNL_POLICY)(&policy[iter]); + if (!e->optional && e->type != NL_A_NO_ATTR && !attrs[iter]) { + OVS_LOG_ERROR("Required attr:%d missing", iter); + goto done; + } + } + + ret = TRUE; + +done: + return ret; +} + +/* + *---------------------------------------------------------------------------- + * Parses the netlink message for nested attributes. attrOffset must be the + * offset of nla which is the header of the nested attribute series. + * Refer nl_parse_nested for more details. + * + * Returns BOOLEAN to indicate success/failure. + *---------------------------------------------------------------------------- + */ +BOOLEAN +NlAttrParseNested(const PNL_MSG_HDR nlMsg, UINT32 attrOffset, + UINT32 totalAttrLen, + const NL_POLICY policy[], + PNL_ATTR attrs[], UINT32 n_attrs) +{ + return NlAttrParse(nlMsg, attrOffset + NLA_HDRLEN, + totalAttrLen - NLA_HDRLEN, policy, attrs, n_attrs); +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkError.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkError.h --- openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkError.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkError.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,238 @@ +/* +* Copyright 2014 Cloudbase Solutions Srl +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include "precomp.h" + +/* + * These are error codes to be used by netlink transactional operations. + * The error code is assigned to the "error" field (INT) of the NL_MSG_ERR + * struct. +*/ + +typedef enum _NL_ERROR_ +{ + NL_ERROR_SUCCESS = 0, + /* The operation is not permitted */ + NL_ERROR_PERM = ((ULONG)-1), + /* There is no such file or directory */ + NL_ERROR_NOENT = ((ULONG)-2), + /* There is no such process */ + NL_ERROR_SRCH = ((ULONG)-3), + /* An interrupted system call / interrupted function */ + NL_ERROR_INTR = ((ULONG)-4), + /* An I/O error */ + NL_ERROR_IO = ((ULONG)-5), + /* There is no such device or address */ + NL_ERROR_NXIO = ((ULONG)-6), + /* The argument list is too long */ + NL_ERROR_2BIG = ((ULONG)-7), + /* Executable file format error */ + NL_ERROR_NOEXEC = ((ULONG)-8), + /* A bad file descriptor / number */ + NL_ERROR_BADF = ((ULONG)-9), + /* Have no child processes */ + NL_ERROR_CHILD = ((ULONG)-10), + /* resource unavailable => try again later */ + NL_ERROR_AGAIN = ((ULONG)-11), + /* We're out of memory */ + NL_ERROR_NOMEM = ((ULONG)-12), + /* Permission is denied */ + NL_ERROR_ACCES = ((ULONG)-13), + /* A bad address */ + NL_ERROR_FAULT = ((ULONG)-14), + + /* The device or the resource is busy */ + NL_ERROR_BUSY = ((ULONG)-16), + /* The file exists */ + NL_ERROR_EXIST = ((ULONG)-17), + /* A cross-device link */ + NL_ERROR_XDEV = ((ULONG)-18), + /* There is no such device */ + NL_ERROR_NODEV = ((ULONG)-19), + /* It is not a directory, nor a symbolic link to a directory. */ + NL_ERROR_NOTDIR = ((ULONG)-20), + /* This is a directory */ + NL_ERROR_ISDIR = ((ULONG)-21), + /* An invalid argument */ + NL_ERROR_INVAL = ((ULONG)-22), + /* + * There are too many files open in system (i.e. no room for another file + * descriptor) + */ + NL_ERROR_NFILE = ((ULONG)-23), + /* The file descriptor value is too large. */ + NL_ERROR_MFILE = ((ULONG)-24), + /* And Inappropriate I/O control operation. Or, this is not a typewriter */ + NL_ERROR_NOTTY = ((ULONG)-25), + + /* The file is too large */ + NL_ERROR_FBIG = ((ULONG)-27), + /* There is no space left on the device */ + NL_ERROR_NOSPC = ((ULONG)-28), + /* This is an invalid seek */ + NL_ERROR_SPIPE = ((ULONG)-29), + /* A read-only file system */ + NL_ERROR_ROFS = ((ULONG)-30), + /* There are too many links */ + NL_ERROR_MLINK = ((ULONG)-31), + /* A broken pipe */ + NL_ERROR_PIPE = ((ULONG)-32), + /* The mathematics argument is out of the domain of the function. */ + NL_ERROR_DOM = ((ULONG)-33), + /* The result is too large / cannot be represented */ + NL_ERROR_RANGE = ((ULONG)-34), + /* A resource deadlock would occur */ + NL_ERROR_DEADLK = ((ULONG)-36), + + /* The file name is too long */ + NL_ERROR_NAMETOOLONG = ((ULONG)-38), + /* There are no locks available */ + NL_ERROR_NOLCK = ((ULONG)-39), + + /* The function is not implemented / not supported */ + NL_ERROR_NOSYS = ((ULONG)-40), + /* The directory is not empty */ + NL_ERROR_NOTEMPTY = ((ULONG)-41), + /* The byte sequence is illegal */ + NL_ERROR_ILSEQ = ((ULONG)-42), + + NL_ERROR_STRUNCATE = ((ULONG)-80), + + /* The address is already in use */ + NL_ERROR_ADDRINUSE = ((ULONG)-100), + /* The requested address cannot be assigned: is is not available */ + NL_ERROR_ADDRNOTAVAIL = ((ULONG)-101), + /* the address family is not supported by the protocol */ + NL_ERROR_AFNOSUPPORT = ((ULONG)-102), + /* The operation / connection is already in progress */ + NL_ERROR_ALREADY = ((ULONG)-103), + /* The message is bad */ + NL_ERROR_BADMSG = ((ULONG)-104), + /* The operation was canceled */ + NL_ERROR_CANCELED = ((ULONG)-105), + /* The software has caused a connection abort */ + NL_ERROR_CONNABORTED = ((ULONG)-106), + /*The connection was refused */ + NL_ERROR_CONNREFUSED = ((ULONG)-107), + /* The connection was reset by the peer */ + NL_ERROR_CONNRESET = ((ULONG)-108), + /* The destination address is required */ + NL_ERROR_DESTADDRREQ = ((ULONG)-109), + /*The host is unreachable */ + NL_ERROR_HOSTUNREACH = ((ULONG)-110), + /* The identifier was removed */ + NL_ERROR_IDRM = ((ULONG)-111), + /* The operations is in progress */ + NL_ERROR_INPROGRESS = ((ULONG)-112), + /* The socket is already connected */ + NL_ERROR_ISCONN = ((ULONG)-113), + /* There are too many levels of symbolic links. */ + NL_ERROR_LOOP = ((ULONG)-114), + /*The message is too large */ + NL_ERROR_MSGSIZE = ((ULONG)-115), + /* The network is down */ + NL_ERROR_NETDOWN = ((ULONG)-116), + /* The network has dropped connection because of a reset (i.e. the + * connection was aborted by the network) + */ + NL_ERROR_NETRESET = ((ULONG)-117), + /* The network is unreachable */ + NL_ERROR_NETUNREACH = ((ULONG)-118), + /* There is no buffer space available */ + NL_ERROR_NOBUFS = ((ULONG)-119), + /* There is no data available (on the stream head read queue) */ + NL_ERROR_NODATA = ((ULONG)-120), + /* The link has been severed (it's reserved in posix) */ + NL_ERROR_NOLINK = ((ULONG)-121), + /* There is no message of the desired type */ + NL_ERROR_NOMSG = ((ULONG)-122), + /* The protocol is not available */ + NL_ERROR_NOPROTOOPT = ((ULONG)-123), + /* We're out of streams resources */ + NL_ERROR_NOSR = ((ULONG)-124), + /* This is not a stream */ + NL_ERROR_NOSTR = ((ULONG)-125), + /* The socket is not connected */ + NL_ERROR_NOTCONN = ((ULONG)-126), + /* The state is not recoverable */ + NL_ERROR_NOTRECOVERABLE = ((ULONG)-127), + /* This is not a socket */ + NL_ERROR_NOTSOCK = ((ULONG)-128), + /* The operation is not supported */ + NL_ERROR_NOTSUPP = ((ULONG)-129), + /* The operation is not supported on socket */ + NL_ERROR_OPNOTSUPP = ((ULONG)-130), + + NL_ERROR_OTHER = ((ULONG)-131), + /* The value is too large for the data type */ + NL_ERROR_OVERFLOW = ((ULONG)-132), + /* The previous owner died */ + NL_ERROR_OWNERDEAD = ((ULONG)-133), + /* A protocol error */ + NL_ERROR_PROTO = ((ULONG)-134), + /* The protocol is not supported */ + NL_ERROR_PROTONOSUPPORT = ((ULONG)-135), + /* This is a wrong protocol type for the socket */ + NL_ERROR_PROTOTYPE = ((ULONG)-136), + /* The timer has expired (or, the stream ioctl has timed out) */ + NL_ERROR_TIME = ((ULONG)-137), + /* The connection has timed out */ + NL_ERROR_TIMEDOUT = ((ULONG)-138), + /* The given text file is busy */ + NL_ERROR_TXTBSY = ((ULONG)-139), + /* The operation would block */ + NL_ERROR_WOULDBLOCK = ((ULONG)-140), + /* The operation is not finished */ + NL_ERROR_PENDING = ((ULONG)-141), +} NL_ERROR; + +static __inline +NlMapStatusToNlErr(NTSTATUS status) +{ + NL_ERROR ret; + + switch (status) + { + case STATUS_NOT_SUPPORTED: + ret = NL_ERROR_NOTSUPP; + break; + case STATUS_INSUFFICIENT_RESOURCES: + ret = NL_ERROR_NOMEM; + break; + case STATUS_SUCCESS: + ret = NL_ERROR_SUCCESS; + break; + case STATUS_PENDING: + ret = NL_ERROR_PENDING; + break; + case STATUS_CANCELLED: + ret = NL_ERROR_CANCELED; + break; + case STATUS_INVALID_PARAMETER: + ret = NL_ERROR_INVAL; + break; + case STATUS_OBJECT_NAME_EXISTS: + ret = NL_ERROR_EXIST; + break; + default: + ret = NL_ERROR_OTHER; + break; + } + + return ret; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Netlink/Netlink.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/Netlink.h --- openvswitch-2.3.1/datapath-windows/ovsext/Netlink/Netlink.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/Netlink.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __NETLINK_H_ +#define __NETLINK_H_ 1 + +#include "Types.h" +#include "NetlinkProto.h" +#include "NetlinkBuf.h" +#include "..\..\include\OvsDpInterface.h" + +/* + * Structure of any message passed between userspace and kernel. + */ +typedef struct _OVS_MESSAGE { + NL_MSG_HDR nlMsg; + GENL_MSG_HDR genlMsg; + OVS_HDR ovsHdr; + /* Variable length nl_attrs follow. */ +} OVS_MESSAGE, *POVS_MESSAGE; + +/* + * Structure of an error message sent as a reply from kernel. + */ +typedef struct _OVS_MESSAGE_ERROR { + NL_MSG_HDR nlMsg; + NL_MSG_ERR errorMsg; +} OVS_MESSAGE_ERROR, *POVS_MESSAGE_ERROR; + +/* Netlink attribute types. */ +typedef enum +{ + NL_A_NO_ATTR = 0, + NL_A_VAR_LEN, + NL_A_UNSPEC, + NL_A_U8, + NL_A_U16, + NL_A_BE16 = NL_A_U16, + NL_A_U32, + NL_A_BE32 = NL_A_U32, + NL_A_U64, + NL_A_BE64 = NL_A_U64, + NL_A_STRING, + NL_A_FLAG, + NL_A_NESTED, + N_NL_ATTR_TYPES +} NL_ATTR_TYPE; + +/* Netlink attribute policy. + * Specifies the policy for parsing for netlink attribute. */ +typedef struct _NL_POLICY +{ + NL_ATTR_TYPE type; + UINT32 minLen; + UINT32 maxLen; + BOOLEAN optional; +} NL_POLICY, *PNL_POLICY; + +/* This macro is careful to check for attributes with bad lengths. */ +#define NL_ATTR_FOR_EACH(ITER, LEFT, ATTRS, ATTRS_LEN) \ + for ((ITER) = (ATTRS), (LEFT) = (ATTRS_LEN); \ + NlAttrIsValid(ITER, LEFT); \ + (LEFT) -= NlAttrLenPad(ITER, LEFT), (ITER) = NlAttrNext(ITER)) + +/* This macro does not check for attributes with bad lengths. It should only + * be used with messages from trusted sources or with messages that have + * already been validated (e.g. with NL_ATTR_FOR_EACH). */ +#define NL_ATTR_FOR_EACH_UNSAFE(ITER, LEFT, ATTRS, ATTRS_LEN) \ + for ((ITER) = (ATTRS), (LEFT) = (ATTRS_LEN); \ + (LEFT) > 0; \ + (LEFT) -= NLA_ALIGN((ITER)->nlaLen), (ITER) = NlAttrNext(ITER)) + +#define NL_ATTR_GET_AS(NLA, TYPE) \ + (*(TYPE*) NlAttrGetUnspec(nla, sizeof(TYPE))) + +BOOLEAN NlFillOvsMsg(PNL_BUFFER nlBuf, + UINT16 nlmsgType, UINT16 nlmsgFlags, + UINT32 nlmsgSeq, UINT32 nlmsgPid, + UINT8 genlCmd, UINT8 genlVer, UINT32 dpNo); +BOOLEAN NlFillNlHdr(PNL_BUFFER nlBuf, + UINT16 nlmsgType, UINT16 nlmsgFlags, + UINT32 nlmsgSeq, UINT32 nlmsgPid); + +VOID NlBuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgOut, + UINT errorCode); + +/* Netlink message accessing the payload */ +PVOID NlMsgAt(const PNL_MSG_HDR nlh, UINT32 offset); +UINT32 NlMsgSize(const PNL_MSG_HDR nlh); +VOID NlMsgAlignSize(const PNL_MSG_HDR nlh); +VOID NlMsgSetSize(const PNL_MSG_HDR nlh, UINT32 msgLen); +PCHAR NlHdrPayload(const PNL_MSG_HDR nlh); +UINT32 NlHdrPayloadLen(const PNL_MSG_HDR nlh); +PNL_ATTR NlMsgAttrs(const PNL_MSG_HDR nlh); +UINT32 NlMsgAttrsLen(const PNL_MSG_HDR nlh); + +/* Netlink message parse */ +PNL_MSG_HDR NlMsgNext(const PNL_MSG_HDR nlh); +INT NlAttrIsValid(const PNL_ATTR nla, UINT32 maxlen); +UINT32 NlAttrLenPad(const PNL_ATTR nla, UINT32 maxlen); + +/* Netlink attribute parsing. */ +UINT32 NlAttrMinLen(NL_ATTR_TYPE type); +UINT32 NlAttrMinLen(NL_ATTR_TYPE type); +PNL_ATTR NlAttrNext(const PNL_ATTR nla); +UINT16 NlAttrType(const PNL_ATTR nla); +PVOID NlAttrData(const PNL_ATTR nla); +UINT32 NlAttrGetSize(const PNL_ATTR nla); +const PVOID NlAttrGet(const PNL_ATTR nla); +const PVOID NlAttrGetUnspec(const PNL_ATTR nla, UINT32 size); +BE64 NlAttrGetBe64(const PNL_ATTR nla); +BE32 NlAttrGetBe32(const PNL_ATTR nla); +UINT8 NlAttrGetU8(const PNL_ATTR nla); +UINT16 NlAttrGetU16(const PNL_ATTR nla); +UINT32 NlAttrGetU32(const PNL_ATTR nla); +UINT64 NlAttrGetU64(const PNL_ATTR nla); +const PNL_ATTR NlAttrFind__(const PNL_ATTR attrs, + UINT32 size, UINT16 type); +const PNL_ATTR NlAttrFindNested(const PNL_ATTR nla, + UINT16 type); +BOOLEAN NlAttrParse(const PNL_MSG_HDR nlMsg, UINT32 attrOffset, + UINT32 totalAttrLen, const NL_POLICY policy[], + PNL_ATTR attrs[], UINT32 n_attrs); +BOOLEAN NlAttrParseNested(const PNL_MSG_HDR nlMsg, UINT32 attrOffset, + UINT32 totalAttrLen, const NL_POLICY policy[], + PNL_ATTR attrs[], UINT32 n_attrs); +/* + * -------------------------------------------------------------------------- + * Returns the length of attribute. + * -------------------------------------------------------------------------- + */ +static __inline UINT16 +NlAttrLen(const PNL_ATTR nla) +{ + return nla->nlaLen; +} + +/* + * --------------------------------------------------------------------------- + * Default maximum payload size for each type of attribute. + * --------------------------------------------------------------------------- + */ +UINT32 +static __inline NlAttrSize(UINT32 payloadSize) +{ + return NLA_HDRLEN + payloadSize; +} + +/* + * --------------------------------------------------------------------------- + * Total length including padding. + * --------------------------------------------------------------------------- + */ +UINT32 +static __inline NlAttrTotalSize(UINT32 payloadSize) +{ + return NLA_ALIGN(NlAttrSize(payloadSize)); +} + +/* Netlink attribute validation */ +BOOLEAN NlAttrValidate(const PNL_ATTR, const PNL_POLICY); + +/* Put APis */ +BOOLEAN NlMsgPutNlHdr(PNL_BUFFER buf, PNL_MSG_HDR nlMsg); +BOOLEAN NlMsgPutGenlHdr(PNL_BUFFER buf, PGENL_MSG_HDR genlMsg); +BOOLEAN NlMsgPutOvsHdr(PNL_BUFFER buf, POVS_HDR ovsHdr); + +BOOLEAN NlMsgPutTail(PNL_BUFFER buf, const PCHAR data, UINT32 len); +PCHAR NlMsgPutTailUninit(PNL_BUFFER buf, UINT32 len); +PCHAR NlMsgPutTailUnspecUninit(PNL_BUFFER buf, UINT16 type, UINT16 len); +BOOLEAN NlMsgPutTailUnspec(PNL_BUFFER buf, UINT16 type, PCHAR data, UINT16 len); +BOOLEAN NlMsgPutTailFlag(PNL_BUFFER buf, UINT16 type); +BOOLEAN NlMsgPutTailU8(PNL_BUFFER buf, UINT16 type, UINT8 value); +BOOLEAN NlMsgPutTailU16(PNL_BUFFER buf, UINT16 type, UINT16 value); +BOOLEAN NlMsgPutTailU32(PNL_BUFFER buf, UINT16 type, UINT32 value); +BOOLEAN NlMsgPutTailU64(PNL_BUFFER buf, UINT16 type, UINT64 value); +BOOLEAN NlMsgPutTailString(PNL_BUFFER buf, UINT16 type, PCHAR value); + +BOOLEAN NlMsgPutHead(PNL_BUFFER buf, const PCHAR data, UINT32 len); +PCHAR NlMsgPutHeadUninit(PNL_BUFFER buf, UINT32 len); +PCHAR NlMsgPutHeadUnspecUninit(PNL_BUFFER buf, UINT16 type, UINT16 len); +BOOLEAN NlMsgPutHeadUnspec(PNL_BUFFER buf, UINT16 type, PCHAR data, UINT16 len); +BOOLEAN NlMsgPutHeadFlag(PNL_BUFFER buf, UINT16 type); +BOOLEAN NlMsgPutHeadU8(PNL_BUFFER buf, UINT16 type, UINT8 value); +BOOLEAN NlMsgPutHeadU16(PNL_BUFFER buf, UINT16 type, UINT16 value); +BOOLEAN NlMsgPutHeadU32(PNL_BUFFER buf, UINT16 type, UINT32 value); +BOOLEAN NlMsgPutHeadU64(PNL_BUFFER buf, UINT16 type, UINT64 value); +BOOLEAN NlMsgPutHeadString(PNL_BUFFER buf, UINT16 type, PCHAR value); +UINT32 NlMsgStartNested(PNL_BUFFER buf, UINT16 type); +VOID NlMsgEndNested(PNL_BUFFER buf, UINT32 offset); +VOID NlMsgPutNested(PNL_BUFFER buf, UINT16 type, + const PVOID data, UINT32 size); + +/* These variants are convenient for iterating nested attributes. */ +#define NL_NESTED_FOR_EACH(ITER, LEFT, A) \ + NL_ATTR_FOR_EACH(ITER, LEFT, NlAttrGet(A), NlAttrGetSize(A)) +#define NL_NESTED_FOR_EACH_UNSAFE(ITER, LEFT, A) \ + NL_ATTR_FOR_EACH_UNSAFE(ITER, LEFT, NlAttrGet(A), NlAttrGetSize(A)) + +#endif /* __NETLINK_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkProto.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkProto.h --- openvswitch-2.3.1/datapath-windows/ovsext/Netlink/NetlinkProto.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Netlink/NetlinkProto.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2008, 2010, 2011, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __NETLINK_PROTO_H_ +#define __NETLINK_PROTO_H_ 1 + +/* Netlink protocol definitions. + * + * Netlink is a message framing format described in RFC 3549 and used heavily + * in Linux to access the network stack. Open vSwitch uses AF_NETLINK sockets + * for this purpose on Linux. On Windows platform too, Open vSwitch uses + * netlink message format for userspace-kernelspace communication. + * + * This header provides access to the Netlink message framing definitions + * regardless of platform. + */ +#include "Types.h" + +#define BUILD_ASSERT(EXPR) \ + typedef char AssertOnCompileFailed[(EXPR) ? 1: -1] +#define BUILD_ASSERT_DECL(EXPR) BUILD_ASSERT(EXPR) + +/* Returns X / Y, rounding up. X must be nonnegative to round correctly. */ +#define DIV_ROUND_UP(X, Y) (((X) + ((Y) - 1)) / (Y)) + +/* Returns X rounded up to the nearest multiple of Y. */ +#define ROUND_UP(X, Y) (DIV_ROUND_UP(X, Y) * (Y)) + +/* Returns the least number that, when added to X, yields a multiple of Y. */ +#define PAD_SIZE(X, Y) (ROUND_UP(X, Y) - (X)) + +/* Netlink message */ + +/* nlmsg_flags bits. */ +#define NLM_F_REQUEST 0x001 +#define NLM_F_MULTI 0x002 +#define NLM_F_ACK 0x004 +#define NLM_F_ECHO 0x008 + +#define NLM_F_ROOT 0x100 +#define NLM_F_MATCH 0x200 +#define NLM_F_EXCL 0x200 +#define NLM_F_ATOMIC 0x400 +#define NLM_F_CREATE 0x400 +#define NLM_F_DUMP (NLM_F_ROOT | NLM_F_MATCH) + +/* nlmsg_type values. */ +#define NLMSG_NOOP 1 +#define NLMSG_ERROR 2 +#define NLMSG_DONE 3 +#define NLMSG_OVERRUN 4 + +#define NLMSG_MIN_TYPE 0x10 + +#define MAX_LINKS 32 + +#define NLMSG_ALIGNTO 4 +#define NLMSG_ALIGN(SIZE) ROUND_UP(SIZE, NLMSG_ALIGNTO) + +#define NLA_ALIGNTO 4 +#define NLA_ALIGN(SIZE) ROUND_UP(SIZE, NLA_ALIGNTO) + +typedef struct ovs_header OVS_HDR, *POVS_HDR; + +typedef struct _NL_MSG_HDR { + UINT32 nlmsgLen; + UINT16 nlmsgType; + UINT16 nlmsgFlags; + UINT32 nlmsgSeq; + UINT32 nlmsgPid; +} NL_MSG_HDR, *PNL_MSG_HDR; +BUILD_ASSERT_DECL(sizeof(NL_MSG_HDR) == 16); + +typedef struct _NlMsgErr +{ + INT error; + NL_MSG_HDR nlMsg; +} NL_MSG_ERR, *PNL_MSG_ERR; +BUILD_ASSERT_DECL(sizeof(NL_MSG_ERR) == 20); + +typedef struct _GENL_MSG_HDR { + UINT8 cmd; + UINT8 version; + UINT16 reserved; +} GENL_MSG_HDR, *PGENL_MSG_HDR; +BUILD_ASSERT_DECL(sizeof(GENL_MSG_HDR) == 4); + +/* Netlink attributes */ +typedef struct _NL_ATTR { + UINT16 nlaLen; + UINT16 nlaType; +} NL_ATTR, *PNL_ATTR; +BUILD_ASSERT_DECL(sizeof(NL_ATTR) == 4); + +#ifndef NLA_TYPE_MASK +#define NLA_F_NESTED (1 << 15) +#define NLA_F_NET_BYTEORDER (1 << 14) +#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER) +#endif + +#define NLMSG_HDRLEN ((INT) NLMSG_ALIGN(sizeof(NL_MSG_HDR))) +#define GENL_HDRLEN NLMSG_ALIGN(sizeof(GENL_MSG_HDR)) +#define OVS_HDRLEN NLMSG_ALIGN(sizeof(OVS_HDR)) +#define NLA_HDRLEN ((INT) NLA_ALIGN(sizeof(NL_ATTR))) + +#endif /* NetlinProto.h */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/NetProto.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/NetProto.h --- openvswitch-2.3.1/datapath-windows/ovsext/NetProto.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/NetProto.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,369 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __NET_PROTO_H_ +#define __NET_PROTO_H_ 1 + +#include "precomp.h" +#include "Ethernet.h" + +#define ETH_ADDR_LENGTH 6 +/* + * There is a more inclusive definition of ethernet header (Eth_Header) in + * OvsEth.h that is used for packet parsing. For simple cases, , use the following definition. + */ +typedef struct EthHdr { + UINT8 Destination[ETH_ADDR_LENGTH]; + UINT8 Source[ETH_ADDR_LENGTH]; + UINT16 Type; +} EthHdr, *PEthHdr; + +#define IPV4 4 +#define IPV6 6 + +#define IP_HDR_MIN_LENGTH 20 +#define TCP_HDR_MIN_LENGTH 20 +#define TCP_CSUM_OFFSET 16 +#define UDP_CSUM_OFFSET 6 +#define ICMP_CSUM_OFFSET 2 +#define INET_CSUM_LENGTH (sizeof(UINT16)) + +#define IP4_UNITS_TO_BYTES(x) ((x) << 2) +#define IP4_BYTES_TO_UNITS(x) ((x) >> 2) + +// length unit for ip->ihl, tcp->doff +typedef UINT32 IP4UnitLength; + +#define IP4_LENGTH_UNIT (sizeof(IP4UnitLength)) +#define IP4_HDR_MIN_LENGTH_IN_UNITS (IP_HDR_MIN_LENGTH / IP4_LENGTH_UNIT) +#define TCP_HDR_MIN_LENGTH_IN_UNITS (TCP_HDR_MIN_LENGTH / IP4_LENGTH_UNIT) + +#define IP4_IHL_NO_OPTIONS IP4_HDR_MIN_LENGTH_IN_UNITS +#define IP4_HDR_LEN(iph) IP4_UNITS_TO_BYTES((iph)->ihl) + +// length unit for ip->frag_off +typedef UINT64 IP4FragUnitLength; + +#define IP4_FRAG_UNIT_LENGTH (sizeof(IP4FragUnitLength)) + +// length UINT for ipv6 header length. +typedef UINT64 IP6UnitLength; + +#define TCP_HDR_LEN(tcph) IP4_UNITS_TO_BYTES((tcph)->doff) +#define TCP_DATA_LENGTH(iph, tcph) (ntohs(iph->tot_len) - \ + IP4_HDR_LEN(iph) - TCP_HDR_LEN(tcph)) + +#define TCP_DATA_OFFSET_NO_OPTIONS TCP_HDR_MIN_LENGTH_IN_UNITS +#define TCP_DATA_OFFSET_WITH_TIMESTAMP 8 + +/* + * This is the maximum value for the length field in the IP header. The meaning + * varies with IP protocols: + * IPv4: the total ip length (including ip header and extention) + * IPv6: the IP payload length (including IP extensions) + */ +#define IP_MAX_PACKET 0xFFFF + +#define IPPROTO_ICMP 1 +#define IPPROTO_IGMP 2 +#define IPPROTO_UDP 17 +#define IPPROTO_GRE 47 +#define IPPROTO_TCP 6 +#define IPPROTO_RSVD 0xff + +#define IPPROTO_HOPOPTS 0 /* Hop-by-hop option header */ +#define IPPROTO_IPV6 41 /* IPv6 in IPv6 */ +#define IPPROTO_ROUTING 43 /* Routing header */ +#define IPPROTO_FRAGMENT 44 /* Fragmentation/reassembly header */ +#define IPPROTO_GRE 47 /* General Routing Encapsulation */ +#define IPPROTO_ESP 50 /* Encap. Security Payload */ +#define IPPROTO_AH 51 /* Authentication header */ +#define IPPROTO_ICMPV6 58 /* ICMP for IPv6 */ +#define IPPROTO_NONE 59 /* No next header */ +#define IPPROTO_DSTOPTS 60 /* Destination options header */ +#define IPPROTO_ETHERIP 97 /* etherIp tunneled protocol */ + +/* ICMPv6 types. */ +#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */ +#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisment */ + +/* IPv6 Neighbor discovery option header. */ +#define ND_OPT_SOURCE_LINKADDR 1 +#define ND_OPT_TARGET_LINKADDR 2 + +/* Collides with MS definition (opposite order) */ +#define IP6F_OFF_HOST_ORDER_MASK 0xfff8 + +#define ARPOP_REQUEST 1 /* ARP request. */ +#define ARPOP_REPLY 2 /* ARP reply. */ +#define RARPOP_REQUEST 3 /* RARP request. */ +#define RARPOP_REPLY 4 /* RARP reply. */ + + /* all ARP NBO's assume short ar_op */ +#define ARPOP_REQUEST_NBO 0x0100 /* NBO ARP request. */ +#define ARPOP_REPLY_NBO 0x0200 /* NBO ARP reply. */ +#define RARPOP_REQUEST_NBO 0x0300 /* NBO RARP request. */ +#define RARPOP_REPLY_NBO 0x0300 /* NBO RARP reply. */ + +#define ICMP_ECHO 8 /* Echo Request */ +#define ICMP_ECHOREPLY 0 /* Echo Reply */ +#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */ + +/* IGMP related constants */ +#define IGMP_UNKNOWN 0x00 /* For IGMP packets where we don't know the type */ + /* Eg: Fragmented packets without the header */ + +/* Constants from RFC 3376 */ +#define IGMP_QUERY 0x11 /* IGMP Host Membership Query. */ +#define IGMP_V1REPORT 0x12 /* IGMPv1 Host Membership Report. */ +#define IGMP_V2REPORT 0x16 /* IGMPv2 Host Membership Report. */ +#define IGMP_V3REPORT 0x22 /* IGMPv3 Host Membership Report. */ +#define IGMP_V2LEAVE 0x17 /* IGMPv2 Leave. */ + +/* Constants from RFC 2710 and RFC 3810 */ +#define MLD_QUERY 0x82 /* Multicast Listener Query. */ +#define MLD_V1REPORT 0x83 /* Multicast Listener V1 Report. */ +#define MLD_V2REPORT 0x8F /* Multicast Listener V2 Report. */ +#define MLD_DONE 0x84 /* Multicast Listener Done. */ + +/* IPv4 offset flags */ +#define IP_CE 0x8000 /* Flag: "Congestion" */ +#define IP_DF 0x4000 /* Flag: "Don't Fragment" */ +#define IP_MF 0x2000 /* Flag: "More Fragments" */ +#define IP_OFFSET 0x1FFF /* "Fragment Offset" part */ + +#define IP_OFFSET_NBO 0xFF1F /* "Fragment Offset" part, NBO */ +#define IP_DF_NBO 0x0040 /* NBO version of don't fragment */ +#define IP_MF_NBO 0x0020 /* NBO version of more fragments */ + +#define IPOPT_RTRALT 0x94 + +/* IP Explicit Congestion Notification bits (TOS field) */ +#define IP_ECN_NOT_ECT 0 +#define IP_ECN_ECT_1 1 +#define IP_ECN_ECT_0 2 +#define IP_ECN_CE 3 +#define IP_ECN_MASK 3 + +/* TCP options */ +#define TCP_OPT_NOP 1 /* Padding */ +#define TCP_OPT_EOL 0 /* End of options */ +#define TCP_OPT_MSS 2 /* Segment size negotiating */ +#define TCP_OPT_WINDOW 3 /* Window scaling */ +#define TCP_OPT_SACK_PERM 4 /* SACK Permitted */ +#define TCP_OPT_SACK 5 /* SACK Block */ +#define TCP_OPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ +#define TCP_OPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ + +#define TCP_OPT_LEN_MSS 4 +#define TCP_OPT_LEN_WINDOW 3 +#define TCP_OPT_LEN_SACK_PERM 2 +#define TCP_OPT_LEN_TIMESTAMP 10 +#define TCP_OPT_LEN_MD5SIG 18 + +#define SOCKET_IPPROTO_HOPOPTS IPPROTO_HOPOPTS +#define SOCKET_IPPROTO_ROUTING IPPROTO_ROUTING +#define SOCKET_IPPROTO_FRAGMENT IPPROTO_FRAGMENT +#define SOCKET_IPPROTO_AH IPPROTO_AH +#define SOCKET_IPPROTO_ICMPV6 IPPROTO_ICMPV6 +#define SOCKET_IPPROTO_NONE IPPROTO_NONE +#define SOCKET_IPPROTO_DSTOPTS IPPROTO_DSTOPTS +#define SOCKET_IPPROTO_EON 80 +#define SOCKET_IPPROTO_ETHERIP IPPROTO_ETHERIP +#define SOCKET_IPPROTO_ENCAP 98 +#define SOCKET_IPPROTO_PIM 103 +#define SOCKET_IPPROTO_IPCOMP 108 +#define SOCKET_IPPROTO_CARP 112 +#define SOCKET_IPPROTO_PFSYNC 240 +#define SOCKET_IPPROTO_RAW IPPROTO_RSVD + +typedef union _OVS_PACKET_HDR_INFO { + struct { + UINT16 l3Offset; + UINT16 l4Offset; + union { + UINT16 l7Offset; + UINT16 l4PayLoad; + }; + UINT16 isIPv4:1; + UINT16 isIPv6:1; + UINT16 isTcp:1; + UINT16 isUdp:1; + UINT16 tcpCsumNeeded:1; + UINT16 udpCsumNeeded:1; + UINT16 udpCsumZero:1; + UINT16 pad:9; + } ; + UINT64 value; +} OVS_PACKET_HDR_INFO, *POVS_PACKET_HDR_INFO; + +typedef struct IPHdr { + UINT8 ihl:4, + version:4; + UINT8 tos; + UINT16 tot_len; + UINT16 id; + UINT16 frag_off; + UINT8 ttl; + UINT8 protocol; + UINT16 check; + UINT32 saddr; + UINT32 daddr; +} IPHdr; + + + /* + * IPv6 fixed header + * + * BEWARE, it is incorrect. The first 4 bits of flow_lbl + * are glued to priority now, forming "class". + */ + +typedef struct IPv6Hdr { + UINT8 priority:4, + version:4; + UINT8 flow_lbl[3]; + + UINT16 payload_len; + UINT8 nexthdr; + UINT8 hop_limit; + + struct in6_addr saddr; + struct in6_addr daddr; +} IPv6Hdr; + +// Generic IPv6 extension header +typedef struct IPv6ExtHdr { + UINT8 nextHeader; // type of the next header + UINT8 hdrExtLen; // length of header extensions (beyond 8 bytes) + UINT16 optPad1; + UINT32 optPad2; +} IPv6ExtHdr; + +typedef struct IPv6FragHdr { + UINT8 nextHeader; + UINT8 reserved; + UINT16 offlg; + UINT32 ident; +} IPv6FragHdr; + +typedef struct IPv6NdOptHdr { + UINT8 type; + UINT8 len; +} IPv6NdOptHdr; + +typedef struct ICMPHdr { + UINT8 type; + UINT8 code; + UINT16 checksum; +} ICMPHdr; + +typedef struct ICMPEcho { + UINT16 id; + UINT16 seq; +} ICMPEcho; + +typedef struct UDPHdr { + UINT16 source; + UINT16 dest; + UINT16 len; + UINT16 check; +} UDPHdr; + +typedef struct TCPHdr { + UINT16 source; + UINT16 dest; + UINT32 seq; + UINT32 ack_seq; + UINT16 res1:4, + doff:4, + fin:1, + syn:1, + rst:1, + psh:1, + ack:1, + urg:1, + ece:1, + cwr:1; + UINT16 window; + UINT16 check; + UINT16 urg_ptr; +} TCPHdr; + +typedef struct PseudoHdr { + UINT32 sourceIPAddr; + UINT32 destIPAddr; + UINT8 zero; + UINT8 protocol; + UINT16 length; +} PseudoHdr; + +typedef struct PseudoHdrIPv6 { + UINT8 sourceIPAddr[16]; + UINT8 destIPAddr[16]; + UINT8 zero; + UINT8 protocol; + UINT16 length; +} PseudoHdrIPv6; + + +struct ArpHdr { + UINT16 ar_hrd; /* Format of hardware address. */ + UINT16 ar_pro; /* Format of protocol address. */ + UINT8 ar_hln; /* Length of hardware address. */ + UINT8 ar_pln; /* Length of protocol address. */ + UINT16 ar_op; /* ARP opcode (command). */ +}; + +typedef struct EtherArp { + struct ArpHdr ea_hdr; /* fixed-size header */ + Eth_Address arp_sha; /* sender hardware address */ + UINT8 arp_spa[4]; /* sender protocol address */ + Eth_Address arp_tha; /* target hardware address */ + UINT8 arp_tpa[4]; /* target protocol address */ +} EtherArp; + +typedef struct IGMPHdr { + UINT8 type; + UINT8 maxResponseTime; + UINT16 csum; + UINT8 groupAddr[4]; +} IGMPHdr; + +typedef struct IGMPV3Trailer { + UINT8 qrv:3, + s:1, + resv:4; + UINT8 qqic; + UINT16 numSources; +} IGMPV3Trailer; + +typedef struct IPOpt { + UINT8 type; + UINT8 length; + UINT16 value; +} IPOpt; + +/* + * IP protocol types + */ +#define SOCKET_IPPROTO_IP 0 +#define SOCKET_IPPROTO_ICMP 1 +#define SOCKET_IPPROTO_TCP 6 +#define SOCKET_IPPROTO_UDP 17 +#define SOCKET_IPPROTO_GRE 47 + +#endif /* __NET_PROTO_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Oid.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Oid.c --- openvswitch-2.3.1/datapath-windows/ovsext/Oid.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Oid.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,882 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "Switch.h" +#include "Vport.h" +#include "NetProto.h" +#include "User.h" +#include "Flow.h" +#include "Event.h" +#include "User.h" +#include "Oid.h" + +/* Due to an imported header file */ +#pragma warning( disable:4505 ) + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_DISPATCH +#include "Debug.h" + +typedef struct _OVS_OID_CONTEXT { + NDIS_EVENT oidComplete; + NDIS_STATUS status; +} OVS_OID_CONTEXT, *POVS_OID_CONTEXT; + + +VOID +OvsExtOidRequestComplete(NDIS_HANDLE filterModuleContext, + PNDIS_OID_REQUEST oidRequest, + NDIS_STATUS status); +static VOID +OvsOidRequestCompleteMethod(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PNDIS_OID_REQUEST origOidRequest, + NDIS_STATUS status); +static VOID +OvsOidRequestCompleteSetInfo(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PNDIS_OID_REQUEST origOidRequest, + NDIS_STATUS status); +static VOID +OvsOidRequestCompleteQuery(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PNDIS_OID_REQUEST origOidRequest, + NDIS_STATUS status); + +static NDIS_STATUS +OvsProcessSetOidPortProp(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest); +static NDIS_STATUS +OvsProcessSetOidPort(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest); +static NDIS_STATUS +OvsProcessSetOidNic(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest); + +__inline BOOLEAN +OvsCheckOidHeaderFunc(PNDIS_OBJECT_HEADER header, + LONG propRev, + LONG propSize) +{ + return header->Type != NDIS_OBJECT_TYPE_DEFAULT || + header->Revision < propRev || + header->Size < propSize; +} + +#define OvsCheckOidHeader(_hdr, _rev) \ + OvsCheckOidHeaderFunc(_hdr, _rev, ##NDIS_SIZEOF_##_rev) + +static __inline VOID +OvsOidSetOrigRequest(PNDIS_OID_REQUEST clonedRequest, + PNDIS_OID_REQUEST origRequest) +{ + *(PVOID*)(&clonedRequest->SourceReserved[0]) = origRequest; +} + +static __inline PNDIS_OID_REQUEST +OvsOidGetOrigRequest(PNDIS_OID_REQUEST clonedRequest) +{ + return *((PVOID*)(&clonedRequest->SourceReserved[0])); +} + +static __inline VOID +OvsOidSetContext(PNDIS_OID_REQUEST clonedRequest, + POVS_OID_CONTEXT origRequest) +{ + *(PVOID*)(&clonedRequest->SourceReserved[8]) = origRequest; +} + +static __inline POVS_OID_CONTEXT +OvsOidGetContext(PNDIS_OID_REQUEST clonedRequest) +{ + return *((PVOID*)(&clonedRequest->SourceReserved[8])); +} + +static NDIS_STATUS +OvsProcessSetOidPortProp(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + struct _SET *setInfo = &(oidRequest->DATA.SET_INFORMATION); + PNDIS_SWITCH_PORT_PROPERTY_PARAMETERS portPropParam = + setInfo->InformationBuffer; + BOOLEAN checkFailed = TRUE; + + UNREFERENCED_PARAMETER(switchObject); + + if (setInfo->Oid == OID_SWITCH_PORT_PROPERTY_DELETE) { + checkFailed = OvsCheckOidHeader( + (PNDIS_OBJECT_HEADER)portPropParam, + NDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS_REVISION_1); + } else { + /* it must be a add or update request */ + checkFailed = OvsCheckOidHeader( + (PNDIS_OBJECT_HEADER)portPropParam, + NDIS_SWITCH_PORT_PROPERTY_PARAMETERS_REVISION_1); + } + + if (checkFailed) { + status = NDIS_STATUS_INVALID_PARAMETER; + goto done; + } + + if (portPropParam->PropertyType == NdisSwitchPortPropertyTypeVlan) { + status = NDIS_STATUS_NOT_SUPPORTED; + goto done; + } + +done: + return status; +} + +static NDIS_STATUS +OvsProcessSetOidPort(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + struct _SET *setInfo = &(oidRequest->DATA.SET_INFORMATION); + PNDIS_SWITCH_PORT_PARAMETERS portParam = setInfo->InformationBuffer; + + if (OvsCheckOidHeader((PNDIS_OBJECT_HEADER)portParam, + NDIS_SWITCH_PORT_PARAMETERS_REVISION_1)) { + status = NDIS_STATUS_NOT_SUPPORTED; + goto done; + } + + if (portParam->IsValidationPort) { + /* Validation ports are used internally by the Hyper-V switch + * to validate and verify settings. We must skip handling them, + * and return STATUS_SUCCESS as the OID result + */ + return NDIS_STATUS_SUCCESS; + } + + switch(setInfo->Oid) { + case OID_SWITCH_PORT_CREATE: + status = HvCreatePort(switchObject, portParam); + break; + case OID_SWITCH_PORT_UPDATED: + status = HvUpdatePort(switchObject, portParam); + break; + case OID_SWITCH_PORT_TEARDOWN: + HvTeardownPort(switchObject, portParam); + break; + case OID_SWITCH_PORT_DELETE: + HvDeletePort(switchObject, portParam); + break; + default: + break; + } + +done: + return status; +} + +static NDIS_STATUS +OvsProcessSetOidNic(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + struct _SET *setInfo = &(oidRequest->DATA.SET_INFORMATION); + PNDIS_SWITCH_NIC_PARAMETERS nicParam = setInfo->InformationBuffer; + + if (OvsCheckOidHeader((PNDIS_OBJECT_HEADER)nicParam, + NDIS_SWITCH_NIC_PARAMETERS_REVISION_1)) { + status = NDIS_STATUS_NOT_SUPPORTED; + goto done; + } + + switch(setInfo->Oid) { + case OID_SWITCH_NIC_CREATE: + status = HvCreateNic(switchObject, nicParam); + break; + case OID_SWITCH_NIC_CONNECT: + HvConnectNic(switchObject, nicParam); + break; + case OID_SWITCH_NIC_UPDATED: + HvUpdateNic(switchObject, nicParam); + break; + case OID_SWITCH_NIC_DISCONNECT: + HvDisconnectNic(switchObject, nicParam); + break; + case OID_SWITCH_NIC_DELETE: + HvDeleteNic(switchObject, nicParam); + break; + default: + break; + } + +done: + return status; + +} + +static NDIS_STATUS +OvsProcessSetOid(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PBOOLEAN complete) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + struct _SET *setInfo = &(oidRequest->DATA.SET_INFORMATION); + + *complete = FALSE; + + OVS_LOG_TRACE("Enter: oidRequest %p, Oid: %lu", + oidRequest, setInfo->Oid); + + /* Verify the basic Oid paramters first */ + if (setInfo->InformationBufferLength && + (setInfo->InformationBufferLength < sizeof(NDIS_OBJECT_HEADER))) { + status = NDIS_STATUS_INVALID_OID; + OVS_LOG_INFO("Invalid input %d", setInfo->InformationBufferLength); + goto error; + } + + /* Documentation does not specify what should be done + * if informationBuffer is not present. Although it mentions the + * structure type informationBUffer points to for each oid request, + * but it does not explicitly mention that it is a MUST. + * hence we are following this scenario same way as what sample code + * mentions. */ + if (!(setInfo->InformationBufferLength)) { + /* We cannot do anything about this oid request, + * lets just pass it down. */ + OVS_LOG_INFO("Buffer Length Zero"); + goto done; + } + + switch(setInfo->Oid) { + case OID_SWITCH_PORT_PROPERTY_ADD: + case OID_SWITCH_PORT_PROPERTY_UPDATE: + case OID_SWITCH_PORT_PROPERTY_DELETE: + status = OvsProcessSetOidPortProp(switchObject, oidRequest); + break; + + case OID_SWITCH_PORT_CREATE: + case OID_SWITCH_PORT_UPDATED: + case OID_SWITCH_PORT_TEARDOWN: + case OID_SWITCH_PORT_DELETE: + status = OvsProcessSetOidPort(switchObject, oidRequest); + break; + + case OID_SWITCH_NIC_CREATE: + case OID_SWITCH_NIC_CONNECT: + case OID_SWITCH_NIC_UPDATED: + case OID_SWITCH_NIC_DISCONNECT: + case OID_SWITCH_NIC_DELETE: + status = OvsProcessSetOidNic(switchObject, oidRequest); + break; + + default: + /* Non handled OID request */ + break; + } + + if (status != NDIS_STATUS_SUCCESS) { + goto error; + } + + goto done; + +error: + *complete = TRUE; +done: + OVS_LOG_TRACE("Exit: status %8x.", status); + return status; +} + +static NDIS_STATUS +OvsProcessMethodOid(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PBOOLEAN complete, + PULONG bytesNeededParam) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + struct _METHOD *methodInfo = &(oidRequest->DATA.METHOD_INFORMATION); + struct _SET *nicReqSetInfo = NULL; + PNDIS_OBJECT_HEADER header = NULL; + PNDIS_OID_REQUEST nicOidRequest = NULL; + + UNREFERENCED_PARAMETER(switchObject); + + OVS_LOG_TRACE("Enter: oidRequest %p, Oid: %lu", + oidRequest, methodInfo->Oid); + + *complete = FALSE; + *bytesNeededParam = 0; + header = methodInfo->InformationBuffer; + + switch(methodInfo->Oid) { + /* We deal with only OID_SWITCH_NIC_REQUEST as of now */ + case OID_SWITCH_NIC_REQUEST: + if (OvsCheckOidHeader(header, + NDIS_SWITCH_NIC_OID_REQUEST_REVISION_1)) { + OVS_LOG_INFO("Check Header failed"); + status = NDIS_STATUS_NOT_SUPPORTED; + *complete = TRUE; + goto done; + } + + nicOidRequest = (((PNDIS_SWITCH_NIC_OID_REQUEST)header)->OidRequest); + nicReqSetInfo = &(nicOidRequest->DATA.SET_INFORMATION); + + /* Fail the SR-IOV VF case */ + if ((nicOidRequest->RequestType == NdisRequestSetInformation) && + (nicReqSetInfo->Oid == OID_NIC_SWITCH_ALLOCATE_VF)) { + OVS_LOG_INFO("We do not support Oid: " + "OID_NIC_SWITCH_ALLOCATE_VF"); + status = NDIS_STATUS_FAILURE; + *complete = TRUE; + } + break; + default: + /* No op */ + break; + } + +done: + OVS_LOG_TRACE("Exit: status %8x.", status); + return status; +} + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterOidRequest function. + * -------------------------------------------------------------------------- + */ + +NDIS_STATUS +OvsExtOidRequest(NDIS_HANDLE filterModuleContext, + PNDIS_OID_REQUEST oidRequest) +{ + POVS_SWITCH_CONTEXT switchObject = (POVS_SWITCH_CONTEXT)filterModuleContext; + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + PNDIS_OID_REQUEST clonedOidRequest = NULL; + struct _METHOD *methodInfo = &(oidRequest->DATA.METHOD_INFORMATION); + BOOLEAN completeOid = FALSE; + ULONG bytesNeeded = 0; + + OVS_LOG_TRACE("Enter: oidRequest %p, reqType: %d", + oidRequest, oidRequest->RequestType); + status = NdisAllocateCloneOidRequest(switchObject->NdisFilterHandle, + oidRequest, OVS_MEMORY_TAG, + &clonedOidRequest); + if (status != NDIS_STATUS_SUCCESS) { + goto done; + } + + NdisInterlockedIncrement(&(switchObject->pendingOidCount)); + + /* set the original oid request in cloned one. */ + OvsOidSetOrigRequest(clonedOidRequest, oidRequest); + OvsOidSetContext(clonedOidRequest, NULL); + + switch(clonedOidRequest->RequestType) { + case NdisRequestSetInformation: + status = OvsProcessSetOid(switchObject, clonedOidRequest, + &completeOid); + break; + case NdisRequestMethod: + status = OvsProcessMethodOid(switchObject, clonedOidRequest, + &completeOid, &bytesNeeded); + break; + default: + /* We do not handle other request types as of now. + * We are just a passthrough for those. */ + break; + } + + if (completeOid == TRUE) { + /* dont leave any reference back to original request, + * even if we are freeing it up. */ + OVS_LOG_INFO("Complete True oidRequest %p.", oidRequest); + OvsOidSetOrigRequest(clonedOidRequest, NULL); + NdisFreeCloneOidRequest(switchObject->NdisFilterHandle, + clonedOidRequest); + methodInfo->BytesNeeded = bytesNeeded; + NdisInterlockedDecrement(&switchObject->pendingOidCount); + goto done; + } + + /* pass the request down */ + status = NdisFOidRequest(switchObject->NdisFilterHandle, clonedOidRequest); + if (status != NDIS_STATUS_PENDING) { + OvsExtOidRequestComplete(switchObject, clonedOidRequest, status); + /* sample code says so */ + status = NDIS_STATUS_PENDING; + } + +done: + OVS_LOG_TRACE("Exit: status %8x.", status); + return status; +} + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterOidRequestComplete function. + * -------------------------------------------------------------------------- + */ +VOID +OvsExtOidRequestComplete(NDIS_HANDLE filterModuleContext, + PNDIS_OID_REQUEST oidRequest, + NDIS_STATUS status) +{ + POVS_SWITCH_CONTEXT switchObject = (POVS_SWITCH_CONTEXT)filterModuleContext; + PNDIS_OID_REQUEST origReq = OvsOidGetOrigRequest(oidRequest); + POVS_OID_CONTEXT oidContext = OvsOidGetContext(oidRequest); + + /* Only one of the two should be set */ + ASSERT(origReq != NULL || oidContext != NULL); + ASSERT(oidContext != NULL || origReq != NULL); + + OVS_LOG_TRACE("Enter: oidRequest %p, reqType: %d", + oidRequest, oidRequest->RequestType); + + if (origReq == NULL) { + NdisInterlockedDecrement(&(switchObject->pendingOidCount)); + oidContext->status = status; + NdisSetEvent(&oidContext->oidComplete); + OVS_LOG_INFO("Internally generated request"); + goto done; + } + + switch(oidRequest->RequestType) { + case NdisRequestMethod: + OvsOidRequestCompleteMethod(switchObject, oidRequest, + origReq, status); + break; + + case NdisRequestSetInformation: + OvsOidRequestCompleteSetInfo(switchObject, oidRequest, + origReq, status); + break; + + case NdisRequestQueryInformation: + case NdisRequestQueryStatistics: + default: + OvsOidRequestCompleteQuery(switchObject, oidRequest, + origReq, status); + break; + } + + OvsOidSetOrigRequest(oidRequest, NULL); + + NdisFreeCloneOidRequest(switchObject->NdisFilterHandle, oidRequest); + NdisFOidRequestComplete(switchObject->NdisFilterHandle, origReq, status); + NdisInterlockedDecrement(&(switchObject->pendingOidCount)); + +done: + OVS_LOG_TRACE("Exit"); +} + +static VOID +OvsOidRequestCompleteMethod(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PNDIS_OID_REQUEST origOidRequest, + NDIS_STATUS status) +{ + UNREFERENCED_PARAMETER(status); + UNREFERENCED_PARAMETER(switchObject); + + struct _METHOD *methodInfo = &(oidRequest->DATA.METHOD_INFORMATION); + struct _METHOD *origMethodInfo = &(origOidRequest->DATA. + METHOD_INFORMATION); + + OVS_LOG_TRACE("Enter: oidRequest %p, Oid: %lu", + oidRequest, methodInfo->Oid); + + origMethodInfo->OutputBufferLength = methodInfo->OutputBufferLength; + origMethodInfo->BytesRead = methodInfo->BytesRead; + origMethodInfo->BytesNeeded = methodInfo->BytesNeeded; + origMethodInfo->BytesWritten = methodInfo->BytesWritten; + + OVS_LOG_TRACE("Exit"); +} + +static VOID +OvsOidRequestCompleteSetInfo(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PNDIS_OID_REQUEST origOidRequest, + NDIS_STATUS status) +{ + struct _SET *setInfo = &(oidRequest->DATA.SET_INFORMATION); + struct _SET *origSetInfo = &(origOidRequest->DATA.SET_INFORMATION); + PNDIS_OBJECT_HEADER origHeader = origSetInfo->InformationBuffer; + + OVS_LOG_TRACE("Enter: oidRequest %p, Oid: %lu", + oidRequest, setInfo->Oid); + + origSetInfo->BytesRead = setInfo->BytesRead; + origSetInfo->BytesNeeded = setInfo->BytesNeeded; + + if (status != NDIS_STATUS_SUCCESS) { + + switch(setInfo->Oid) { + case OID_SWITCH_PORT_CREATE: + HvDeletePort(switchObject, + (PNDIS_SWITCH_PORT_PARAMETERS)origHeader); + break; + + case OID_SWITCH_NIC_CREATE: + HvDeleteNic(switchObject, + (PNDIS_SWITCH_NIC_PARAMETERS)origHeader); + break; + + default: + break; + } + } + + OVS_LOG_TRACE("Exit"); +} + +static VOID +OvsOidRequestCompleteQuery(POVS_SWITCH_CONTEXT switchObject, + PNDIS_OID_REQUEST oidRequest, + PNDIS_OID_REQUEST origOidRequest, + NDIS_STATUS status) +{ + UNREFERENCED_PARAMETER(switchObject); + UNREFERENCED_PARAMETER(status); + + struct _QUERY *queryInfo = &((oidRequest->DATA).QUERY_INFORMATION); + struct _QUERY *origQueryInfo = &((origOidRequest->DATA).QUERY_INFORMATION); + + OVS_LOG_TRACE("Enter: oidRequest %p, Oid: %lu", + oidRequest, queryInfo->Oid); + + origQueryInfo->BytesWritten = queryInfo->BytesWritten; + origQueryInfo->BytesNeeded = queryInfo->BytesNeeded; + + OVS_LOG_TRACE("Exit"); +} + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterCancelOidRequest function. + * -------------------------------------------------------------------------- + */ +VOID +OvsExtCancelOidRequest(NDIS_HANDLE filterModuleContext, + PVOID requestId) +{ + OVS_LOG_TRACE("Enter: requestId: %p", requestId); + + UNREFERENCED_PARAMETER(filterModuleContext); + UNREFERENCED_PARAMETER(requestId); +} + + +/* + * -------------------------------------------------------------------------- + * Utility function to issue the specified OID to the NDIS stack. The OID is + * directed towards the miniport edge of the extensible switch. + * An OID that gets issued may not complete immediately, and in such cases, the + * function waits for the OID to complete. Thus, this function must not be + * called at the PASSIVE_LEVEL. + * -------------------------------------------------------------------------- + */ +static NDIS_STATUS +OvsIssueOidRequest(POVS_SWITCH_CONTEXT switchContext, + NDIS_REQUEST_TYPE oidType, + UINT32 oidRequestEnum, + PVOID oidInputBuffer, + UINT32 inputSize, + PVOID oidOutputBuffer, + UINT32 outputSize, + UINT32 *outputSizeNeeded) +{ + NDIS_STATUS status; + PNDIS_OID_REQUEST oidRequest; + POVS_OID_CONTEXT oidContext; + ULONG OvsExtOidRequestId = 'ISVO'; + + DBG_UNREFERENCED_PARAMETER(inputSize); + DBG_UNREFERENCED_PARAMETER(oidInputBuffer); + + OVS_LOG_TRACE("Enter: switchContext: %p, oidType: %d", + switchContext, oidType); + + ASSERT(oidInputBuffer == NULL || inputSize != 0); + ASSERT(oidOutputBuffer == NULL || outputSize != 0); + ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); + + oidRequest = OvsAllocateMemoryWithTag(sizeof *oidRequest, + OVS_OID_POOL_TAG); + if (!oidRequest) { + status = NDIS_STATUS_RESOURCES; + goto done; + } + + oidContext = OvsAllocateMemoryWithTag(sizeof *oidContext, + OVS_OID_POOL_TAG); + if (!oidContext) { + OvsFreeMemoryWithTag(oidRequest, OVS_OID_POOL_TAG); + status = NDIS_STATUS_RESOURCES; + goto done; + } + + RtlZeroMemory(oidRequest, sizeof *oidRequest); + RtlZeroMemory(oidContext, sizeof *oidContext); + + oidRequest->Header.Type = NDIS_OBJECT_TYPE_OID_REQUEST; + oidRequest->Header.Revision = NDIS_OID_REQUEST_REVISION_1; + oidRequest->Header.Size = NDIS_SIZEOF_OID_REQUEST_REVISION_1; + + oidRequest->RequestType = oidType; + oidRequest->PortNumber = 0; + oidRequest->Timeout = 0; + oidRequest->RequestId = (PVOID)OvsExtOidRequestId; + + switch(oidType) { + case NdisRequestQueryInformation: + oidRequest->DATA.QUERY_INFORMATION.Oid = oidRequestEnum; + oidRequest->DATA.QUERY_INFORMATION.InformationBuffer = oidOutputBuffer; + oidRequest->DATA.QUERY_INFORMATION.InformationBufferLength = outputSize; + break; + default: + ASSERT(FALSE); + status = NDIS_STATUS_INVALID_PARAMETER; + break; + } + + /* + * We make use of the SourceReserved field in the OID request to store + * pointers to the original OID (if any), and also context for completion + * (if any). + */ + oidContext->status = NDIS_STATUS_SUCCESS; + NdisInitializeEvent(&oidContext->oidComplete); + + OvsOidSetOrigRequest(oidRequest, NULL); + OvsOidSetContext(oidRequest, oidContext); + + NdisInterlockedIncrement(&(switchContext->pendingOidCount)); + status = NdisFOidRequest(switchContext->NdisFilterHandle, oidRequest); + if (status == NDIS_STATUS_PENDING) { + NdisWaitEvent(&oidContext->oidComplete, 0); + } else { + NdisInterlockedDecrement(&(switchContext->pendingOidCount)); + } + + if (status == NDIS_STATUS_INVALID_LENGTH || + oidContext->status == NDIS_STATUS_INVALID_LENGTH) { + switch(oidType) { + case NdisRequestQueryInformation: + *outputSizeNeeded = oidRequest->DATA.QUERY_INFORMATION.BytesNeeded; + } + } + + status = oidContext->status; + ASSERT(status != NDIS_STATUS_PENDING); + + OvsFreeMemoryWithTag(oidRequest, OVS_OID_POOL_TAG); + OvsFreeMemoryWithTag(oidContext, OVS_OID_POOL_TAG); + +done: + OVS_LOG_TRACE("Exit: status %8x.", status); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Utility function to query if the extensible switch has completed activation + * successfully. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsQuerySwitchActivationComplete(POVS_SWITCH_CONTEXT switchContext, + BOOLEAN *switchActive) +{ + NDIS_STATUS status; + PNDIS_SWITCH_PARAMETERS switchParams; + UINT32 outputSizeNeeded; + + OVS_LOG_TRACE("Enter: switchContext: %p, switchActive: %p", + switchContext, switchActive); + + switchParams = OvsAllocateMemoryWithTag(sizeof *switchParams, + OVS_OID_POOL_TAG); + if (!switchParams) { + status = NDIS_STATUS_RESOURCES; + goto done; + } + + /* + * Even though 'switchParms' is supposed to be populated by the OID, it + * needs to be initialized nevertheless. Otherwise, OID returns + * NDIS_STATUS_INVALID_PARAMETER. This is not clear in the documentation. + */ + RtlZeroMemory(switchParams, sizeof *switchParams); + switchParams->Header.Revision = NDIS_SWITCH_PARAMETERS_REVISION_1; + switchParams->Header.Type = NDIS_OBJECT_TYPE_DEFAULT; + switchParams->Header.Size = NDIS_SIZEOF_NDIS_SWITCH_PARAMETERS_REVISION_1; + + status = OvsIssueOidRequest(switchContext, NdisRequestQueryInformation, + OID_SWITCH_PARAMETERS, NULL, 0, + (PVOID)switchParams, sizeof *switchParams, + &outputSizeNeeded); + + ASSERT(status != NDIS_STATUS_INVALID_LENGTH); + ASSERT(status != NDIS_STATUS_PENDING); + if (status == NDIS_STATUS_SUCCESS) { + ASSERT(switchParams->Header.Type == NDIS_OBJECT_TYPE_DEFAULT); + ASSERT(switchParams->Header.Revision == NDIS_SWITCH_PARAMETERS_REVISION_1); + ASSERT(switchParams->Header.Size == + NDIS_SIZEOF_NDIS_SWITCH_PARAMETERS_REVISION_1); + *switchActive = switchParams->IsActive; + } + + OvsFreeMemoryWithTag(switchParams, OVS_OID_POOL_TAG); + +done: + OVS_LOG_TRACE("Exit: status %8x, switchActive: %d.", + status, *switchActive); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Utility function to get the array of ports on the extensible switch. Upon + * success, the caller needs to free the returned array. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsGetPortsOnSwitch(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_ARRAY *portArrayOut) +{ + PNDIS_SWITCH_PORT_ARRAY portArray; + UINT32 arraySize = sizeof *portArray; + NDIS_STATUS status = NDIS_STATUS_FAILURE; + + OVS_LOG_TRACE("Enter: switchContext: %p, portArray: %p", + switchContext, portArrayOut); + do { + UINT32 reqdArraySize; + + portArray = OvsAllocateMemoryWithTag(arraySize, OVS_OID_POOL_TAG); + if (!portArray) { + status = NDIS_STATUS_RESOURCES; + goto done; + } + + /* + * Even though 'portArray' is supposed to be populated by the OID, it + * needs to be initialized nevertheless. Otherwise, OID returns + * NDIS_STATUS_INVALID_PARAMETER. This is not clear in the documentation. + */ + RtlZeroMemory(portArray, sizeof *portArray); + portArray->Header.Revision = NDIS_SWITCH_PORT_ARRAY_REVISION_1; + portArray->Header.Type = NDIS_OBJECT_TYPE_DEFAULT; + portArray->Header.Size = NDIS_SIZEOF_NDIS_SWITCH_PORT_ARRAY_REVISION_1; + + status = OvsIssueOidRequest(switchContext, NdisRequestQueryInformation, + OID_SWITCH_PORT_ARRAY, NULL, 0, + (PVOID)portArray, arraySize, + &reqdArraySize); + if (status == NDIS_STATUS_SUCCESS) { + *portArrayOut = portArray; + break; + } + + OvsFreeMemoryWithTag(portArray, OVS_OID_POOL_TAG); + arraySize = reqdArraySize; + if (status != NDIS_STATUS_INVALID_LENGTH) { + break; + } + } while(status == NDIS_STATUS_INVALID_LENGTH); + +done: + OVS_LOG_TRACE("Exit: status %8x.", status); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Utility function to get the array of nics on the extensible switch. Upon + * success, the caller needs to free the returned array. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsGetNicsOnSwitch(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_ARRAY *nicArrayOut) +{ + PNDIS_SWITCH_NIC_ARRAY nicArray; + UINT32 arraySize = sizeof *nicArray; + NDIS_STATUS status = NDIS_STATUS_FAILURE; + + OVS_LOG_TRACE("Enter: switchContext: %p, nicArray: %p", + switchContext, nicArrayOut); + + do { + UINT32 reqdArraySize; + + nicArray = OvsAllocateMemoryWithTag(arraySize, OVS_OID_POOL_TAG); + if (!nicArray) { + status = NDIS_STATUS_RESOURCES; + goto done; + } + + /* + * Even though 'nicArray' is supposed to be populated by the OID, it + * needs to be initialized nevertheless. Otherwise, OID returns + * NDIS_STATUS_INVALID_PARAMETER. This is not clear in the documentation. + */ + RtlZeroMemory(nicArray, sizeof *nicArray); + nicArray->Header.Revision = NDIS_SWITCH_NIC_ARRAY_REVISION_1; + nicArray->Header.Type = NDIS_OBJECT_TYPE_DEFAULT; + nicArray->Header.Size = NDIS_SIZEOF_NDIS_SWITCH_NIC_ARRAY_REVISION_1; + + status = OvsIssueOidRequest(switchContext, NdisRequestQueryInformation, + OID_SWITCH_NIC_ARRAY, NULL, 0, + (PVOID)nicArray, arraySize, + &reqdArraySize); + if (status == NDIS_STATUS_SUCCESS) { + *nicArrayOut = nicArray; + break; + } + + OvsFreeMemoryWithTag(nicArray, OVS_OID_POOL_TAG); + arraySize = reqdArraySize; + if (status != NDIS_STATUS_INVALID_LENGTH) { + break; + } + } while(status == NDIS_STATUS_INVALID_LENGTH); + +done: + OVS_LOG_TRACE("Exit: status %8x.", status); + return status; +} + +VOID OvsFreeSwitchPortsArray(PNDIS_SWITCH_PORT_ARRAY portsArray) +{ + if (portsArray) { + OvsFreeMemoryWithTag(portsArray, OVS_OID_POOL_TAG); + } +} + +VOID OvsFreeSwitchNicsArray(PNDIS_SWITCH_NIC_ARRAY nicsArray) +{ + if (nicsArray) { + OvsFreeMemoryWithTag(nicsArray, OVS_OID_POOL_TAG); + } +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Oid.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Oid.h --- openvswitch-2.3.1/datapath-windows/ovsext/Oid.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Oid.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __OID_H_ +#define __OID_H_ 1 + +NDIS_STATUS OvsQuerySwitchActivationComplete(POVS_SWITCH_CONTEXT switchContext, + BOOLEAN *switchActive); +NDIS_STATUS OvsGetPortsOnSwitch(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_ARRAY *portArrayOut); +NDIS_STATUS OvsGetNicsOnSwitch(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_ARRAY *nicArrayOut); +VOID OvsFreeSwitchPortsArray(PNDIS_SWITCH_PORT_ARRAY portsArray); +VOID OvsFreeSwitchNicsArray(PNDIS_SWITCH_NIC_ARRAY nicsArray); + +#endif /* __OID_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/ovsext.inf openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.inf --- openvswitch-2.3.1/datapath-windows/ovsext/ovsext.inf 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.inf 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,85 @@ +; +; Copyright (c) VMware. All Rights Reserved. +; + +[version] +Signature = "$Windows NT$" +Class = NetService +ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318} +Provider = %OVS% +CatalogFile = ovsext.cat +DriverVer = 10/10/2013,1.0 + +[Manufacturer] +%OVS%=OVS,NTx86,NTia64,NTamd64 + +[OVS.NTx86] +%OVSExt_Desc%=Install, OVSExt + +[OVS.NTia64] +%OVSExt_Desc%=Install, OVSExt + +[OVS.NTamd64] +%OVSExt_Desc%=Install, OVSExt + +;------------------------------------------------------------------------- +; Installation Section +;------------------------------------------------------------------------- +[Install] +AddReg=Inst_Ndi +Characteristics=0x40000 +NetCfgInstanceId="{583CC151-73EC-4A6A-8B47-578297AD7623}" +Copyfiles = OVSExt.copyfiles.sys + +[SourceDisksNames] +1=%OVSExt_Desc%,"",, + +[SourceDisksFiles] +OVSExt.sys=1 + +[DestinationDirs] +DefaultDestDir=12 +OVSExt.copyfiles.sys=12 + +[OVSExt.copyfiles.sys] +OVSExt.sys,,,2 + + +;------------------------------------------------------------------------- +; Ndi installation support +;------------------------------------------------------------------------- +[Inst_Ndi] +HKR, Ndi,Service,,"OVSExt" +HKR, Ndi,CoServices,0x00010000,"OVSExt" +HKR, Ndi,HelpText,,%OVSExt_HelpText% +HKR, Ndi,FilterClass,,"ms_switch_forward" +HKR, Ndi,FilterType,0x00010001,0x00000002 +HKR, Ndi\Interfaces,UpperRange,,"noupper" +HKR, Ndi\Interfaces,LowerRange,,"nolower" +HKR, Ndi\Interfaces, FilterMediaTypes,,"vmnetextension" +HKR, Ndi,FilterRunType, 0x00010001, 2 ; optional + +;------------------------------------------------------------------------- +; Service installation support, common.EventLog here is to demonstrate how to +; write an enent log +;------------------------------------------------------------------------- +[Install.Services] +AddService=OVSExt,,OVSExt_Service_Inst;, common.EventLog + +[OVSExt_Service_Inst] +DisplayName = %OVSExt_Desc% +ServiceType = 1 ;SERVICE_KERNEL_DRIVER +StartType = 1 ;SERVICE_SYSTEM_START +ErrorControl = 1 ;SERVICE_ERROR_NORMAL +ServiceBinary = %12%\OVSExt.sys +LoadOrderGroup = NDIS +Description = %OVSExt_Desc% +AddReg = Common.Params.reg + +[Install.Remove.Services] +DelService=OVSExt,0x200 + +[Strings] +OVS = "Open vSwitch" +OVSExt_Desc = "Open vSwitch Extension" +OVSExt_HelpText = "Open vSwitch forwarding switch extension" diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/ovsext.rc openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.rc --- openvswitch-2.3.1/datapath-windows/ovsext/ovsext.rc 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.rc 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All Rights Reserved. +// + +#include +#include + +/*-----------------------------------------------*/ +/* the following lines are specific to this file */ +/*-----------------------------------------------*/ + +/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR + * and VER_INTERNALNAME_STR must be defined before including COMMON.VER + * The strings don't need a '\0', since common.ver has them. + */ +#define VER_FILETYPE VFT_DRV +#define VER_FILESUBTYPE VFT2_DRV_NETWORK +#define VER_FILEDESCRIPTION_STR "VMWare OVS Extension" +#define VER_INTERNALNAME_STR "OVSExt.SYS" +#define VER_ORIGINALFILENAME_STR "OVSExt.SYS" +#define VER_LANGNEUTRAL + +#include "common.ver" diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/ovsext.vcxproj openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.vcxproj --- openvswitch-2.3.1/datapath-windows/ovsext/ovsext.vcxproj 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.vcxproj 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,207 @@ + + + + + Win8.1 Debug + x64 + + + Win8 Debug + x64 + + + Win8.1 Release + x64 + + + Win8 Release + x64 + + + + WDM + Driver + + + $(VCTargetsPath11) + Win8 Debug + Win32 + {0D37F250-E766-44C7-90B4-D7E07E77D1AA} + + + + {63FE215D-98BE-4440-8081-C6160EFB80FA} + $(MSBuildProjectName) + + + WindowsV6.3 + True + WindowsKernelModeDriver8.1 + + + Win8 + True + WindowsKernelModeDriver8.1 + + + WindowsV6.3 + False + WindowsKernelModeDriver8.1 + + + Win8 + False + WindowsKernelModeDriver8.1 + + + + $(IntDir) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OVSExt + + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1 + + + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1 + + + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1 + + + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1 + + + %(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1 + + + + + %(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)\fwpkclnt.lib;$(SDK_LIB_PATH)\uuid.lib;$(DDK_LIB_PATH)\netio.lib + + + true + Level4 + + + $(IntDir);%(AdditionalIncludeDirectories);..\.. + $(IntDir);%(AdditionalIncludeDirectories);..\.. + $(IntDir);%(AdditionalIncludeDirectories);..\.. + $(IntDir);%(AdditionalIncludeDirectories);..\.. + + + + + + + + + + + + + + + + + + + + ;%(AdditionalIncludeDirectories) + precomp.h + Create + $(IntDir)\precomp.h.pch + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/ovsext.vcxproj.user openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.vcxproj.user --- openvswitch-2.3.1/datapath-windows/ovsext/ovsext.vcxproj.user 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/ovsext.vcxproj.user 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,15 @@ + + + + TestSign + + + TestSign + + + TestSign + + + TestSign + + diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/PacketIO.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketIO.c --- openvswitch-2.3.1/datapath-windows/ovsext/PacketIO.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketIO.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,537 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file contains the implementation of the datapath/forwarding + * functionality of the OVS. + */ + +#include "precomp.h" +#include "Switch.h" +#include "Vport.h" +#include "NetProto.h" +#include "User.h" +#include "PacketIO.h" +#include "Flow.h" +#include "Event.h" +#include "User.h" + +/* Due to an imported header file */ +#pragma warning( disable:4505 ) + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_DISPATCH +#include "Debug.h" + +extern NDIS_STRING ovsExtGuidUC; +extern NDIS_STRING ovsExtFriendlyNameUC; + +static VOID OvsFinalizeCompletionList(OvsCompletionList *completionList); +static VOID OvsCompleteNBLIngress(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST netBufferLists, ULONG sendCompleteFlags); +static NTSTATUS OvsCreateNewNBLsFromMultipleNBs( + POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST *curNbl, + PNET_BUFFER_LIST *nextNbl); + +__inline VOID +OvsInitCompletionList(OvsCompletionList *completionList, + POVS_SWITCH_CONTEXT switchContext, + ULONG sendCompleteFlags) +{ + ASSERT(completionList); + completionList->dropNbl = NULL; + completionList->dropNblNext = &completionList->dropNbl; + completionList->switchContext = switchContext; + completionList->sendCompleteFlags = sendCompleteFlags; +} + +/* Utility function used to complete an NBL. */ +__inline VOID +OvsAddPktCompletionList(OvsCompletionList *completionList, + BOOLEAN incoming, + NDIS_SWITCH_PORT_ID sourcePort, + PNET_BUFFER_LIST netBufferList, + UINT32 netBufferListCount, + PNDIS_STRING filterReason) +{ + POVS_BUFFER_CONTEXT ctx; + + /* XXX: We handle one NBL at a time. */ + ASSERT(netBufferList->Next == NULL); + + /* Make sure it has a context. */ + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(netBufferList); + ASSERT(ctx && ctx->magic == OVS_CTX_MAGIC); + + completionList->switchContext->NdisSwitchHandlers.ReportFilteredNetBufferLists( + completionList->switchContext->NdisSwitchContext, &ovsExtGuidUC, + &ovsExtFriendlyNameUC, sourcePort, + incoming ? NDIS_SWITCH_REPORT_FILTERED_NBL_FLAGS_IS_INCOMING : 0, + netBufferListCount, netBufferList, filterReason); + + *completionList->dropNblNext = netBufferList; + completionList->dropNblNext = &netBufferList->Next; + ASSERT(completionList->dropNbl); +} + +static __inline VOID +OvsReportNBLIngressError(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST nblList, + PNDIS_STRING filterReason, + NDIS_STATUS error) +{ + PNET_BUFFER_LIST nbl = nblList; + while (nbl) { + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO fwdDetail; + fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(nbl); + + nbl->Status = error; + + /* This can be optimized by batching NBL's from the same + * SourcePortId. */ + switchContext->NdisSwitchHandlers.ReportFilteredNetBufferLists( + switchContext->NdisSwitchContext, &ovsExtGuidUC, + &ovsExtFriendlyNameUC, fwdDetail->SourcePortId, + NDIS_SWITCH_REPORT_FILTERED_NBL_FLAGS_IS_INCOMING, + 1 /*Nbl count.*/, nbl, filterReason); + + nbl = NET_BUFFER_LIST_NEXT_NBL(nbl); + } +} + +static __inline ULONG +OvsGetSendCompleteFlags(ULONG sendFlags) +{ + BOOLEAN dispatch, sameSource; + ULONG sendCompleteFlags; + + dispatch = NDIS_TEST_SEND_AT_DISPATCH_LEVEL(sendFlags); + sendCompleteFlags = (dispatch ? + NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL : 0); + sameSource = NDIS_TEST_SEND_FLAG(sendFlags, + NDIS_SEND_FLAGS_SWITCH_SINGLE_SOURCE); + sendCompleteFlags |= (sameSource ? + NDIS_SEND_COMPLETE_FLAGS_SWITCH_SINGLE_SOURCE : 0); + + return sendCompleteFlags; +} + +VOID +OvsSendNBLIngress(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST netBufferLists, + ULONG sendFlags) +{ + if (switchContext->dataFlowState == OvsSwitchPaused) { + /* If a filter module is in the Paused state, the filter driver must not + * originate any send requests for that filter module. If NDIS calls + * FilterSendNetBufferLists, the driver must not call + * NdisFSendNetBufferLists to pass on the data until the driver is + * restarted. The driver should call NdisFSendNetBufferListsComplete + * immediately to complete the send operation. It should set the + * complete status in each NET_BUFFER_LIST structure to + * NDIS_STATUS_PAUSED. + * + * http://msdn.microsoft.com/en-us/library/windows/hardware/ + * ff549966(v=vs.85).aspx */ + NDIS_STRING filterReason; + ULONG sendCompleteFlags = OvsGetSendCompleteFlags(sendFlags); + + RtlInitUnicodeString(&filterReason, + L"Switch state PAUSED, drop before FSendNBL."); + OvsReportNBLIngressError(switchContext, netBufferLists, &filterReason, + NDIS_STATUS_PAUSED); + OvsCompleteNBLIngress(switchContext, netBufferLists, + sendCompleteFlags); + return; + } + + ASSERT(switchContext->dataFlowState == OvsSwitchRunning); + + NdisFSendNetBufferLists(switchContext->NdisFilterHandle, netBufferLists, + NDIS_DEFAULT_PORT_NUMBER, sendFlags); +} + +static __inline VOID +OvsStartNBLIngressError(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST nblList, + ULONG sendCompleteFlags, + PNDIS_STRING filterReason, + NDIS_STATUS error) +{ + ASSERT(error); + OvsReportNBLIngressError(switchContext, nblList, filterReason, error); + NdisFSendNetBufferListsComplete(switchContext->NdisFilterHandle, nblList, + sendCompleteFlags); +} + +static VOID +OvsAppendNativeForwardedPacket(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST curNbl, + PNET_BUFFER_LIST *nativeNbls, + ULONG flags, + BOOLEAN isRecv) +{ + POVS_BUFFER_CONTEXT ctx = { 0 }; + NDIS_STRING filterReason; + + *nativeNbls = curNbl; + nativeNbls = &(curNbl->Next); + + ctx = OvsInitExternalNBLContext(switchContext, curNbl, isRecv); + if (ctx == NULL) { + RtlInitUnicodeString(&filterReason, + L"Cannot allocate native NBL context."); + + OvsStartNBLIngressError(switchContext, curNbl, flags, &filterReason, + NDIS_STATUS_RESOURCES); + } +} + +static VOID +OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST netBufferLists, + ULONG SendFlags) +{ + NDIS_SWITCH_PORT_ID sourcePort = 0; + NDIS_SWITCH_NIC_INDEX sourceIndex = 0; + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO fwdDetail; + PNET_BUFFER_LIST curNbl = NULL, nextNbl = NULL; + ULONG sendCompleteFlags; + UCHAR dispatch; + LOCK_STATE_EX lockState, dpLockState; + NDIS_STATUS status; + NDIS_STRING filterReason; + LIST_ENTRY missedPackets; + UINT32 num = 0; + OvsCompletionList completionList; +#if (NDIS_SUPPORT_NDIS640) + PNET_BUFFER_LIST nativeForwardedNbls = NULL; + PNET_BUFFER_LIST *nextNativeForwardedNbl = &nativeForwardedNbls; +#endif + + dispatch = NDIS_TEST_SEND_AT_DISPATCH_LEVEL(SendFlags)? + NDIS_RWL_AT_DISPATCH_LEVEL : 0; + sendCompleteFlags = OvsGetSendCompleteFlags(SendFlags); + SendFlags |= NDIS_SEND_FLAGS_SWITCH_DESTINATION_GROUP; + + InitializeListHead(&missedPackets); + OvsInitCompletionList(&completionList, switchContext, sendCompleteFlags); + + for (curNbl = netBufferLists; curNbl != NULL; curNbl = nextNbl) { + POVS_VPORT_ENTRY vport; + UINT32 portNo; + OVS_DATAPATH *datapath = &switchContext->datapath; + OVS_PACKET_HDR_INFO layers; + OvsFlowKey key; + UINT64 hash; + PNET_BUFFER curNb; + POVS_BUFFER_CONTEXT ctx; + + nextNbl = curNbl->Next; + curNbl->Next = NULL; + + fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(curNbl); + sourcePort = fwdDetail->SourcePortId; + sourceIndex = (NDIS_SWITCH_NIC_INDEX)fwdDetail->SourceNicIndex; + +#if (NDIS_SUPPORT_NDIS640) + if (fwdDetail->NativeForwardingRequired) { + /* Add current NBL to those that require native forwarding. */ + OvsAppendNativeForwardedPacket( + switchContext, + curNbl, + nextNativeForwardedNbl, + sendCompleteFlags, + sourcePort == switchContext->virtualExternalPortId); + continue; + } +#endif /* NDIS_SUPPORT_NDIS640 */ + + ctx = OvsInitExternalNBLContext(switchContext, curNbl, + sourcePort == switchContext->virtualExternalPortId); + if (ctx == NULL) { + RtlInitUnicodeString(&filterReason, + L"Cannot allocate external NBL context."); + + OvsStartNBLIngressError(switchContext, curNbl, + sendCompleteFlags, &filterReason, + NDIS_STATUS_RESOURCES); + continue; + } + + /* Ethernet Header is a guaranteed safe access. */ + curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); + if (curNb->Next != NULL) { + /* Create a NET_BUFFER_LIST for each NET_BUFFER. */ + status = OvsCreateNewNBLsFromMultipleNBs(switchContext, + &curNbl, + &nextNbl); + if (!NT_SUCCESS(status)) { + RtlInitUnicodeString(&filterReason, + L"Cannot allocate NBLs with single NB."); + + OvsStartNBLIngressError(switchContext, curNbl, + sendCompleteFlags, &filterReason, + NDIS_STATUS_RESOURCES); + continue; + } + } + { + OvsFlow *flow; + + /* Take the DispatchLock so none of the VPORTs disconnect while + * we are setting destination ports. + * + * XXX: acquire/release the dispatch lock for a "batch" of packets + * rather than for each packet. */ + NdisAcquireRWLockRead(switchContext->dispatchLock, &lockState, + dispatch); + + vport = OvsFindVportByPortIdAndNicIndex(switchContext, sourcePort, + sourceIndex); + if (vport == NULL || vport->ovsState != OVS_STATE_CONNECTED) { + RtlInitUnicodeString(&filterReason, + L"OVS-Cannot forward packet from unknown source port"); + goto dropit; + } else { + portNo = vport->portNo; + } + + vport->stats.rxPackets++; + vport->stats.rxBytes += NET_BUFFER_DATA_LENGTH(curNb); + + status = OvsExtractFlow(curNbl, vport->portNo, &key, &layers, NULL); + if (status != NDIS_STATUS_SUCCESS) { + RtlInitUnicodeString(&filterReason, L"OVS-Flow extract failed"); + goto dropit; + } + + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + OvsAcquireDatapathRead(datapath, &dpLockState, TRUE); + + flow = OvsLookupFlow(datapath, &key, &hash, FALSE); + if (flow) { + OvsFlowUsed(flow, curNbl, &layers); + datapath->hits++; + /* If successful, OvsActionsExecute() consumes the NBL. + * Otherwise, it adds it to the completionList. No need to + * check the return value. */ + OvsActionsExecute(switchContext, &completionList, curNbl, + portNo, SendFlags, &key, &hash, &layers, + flow->actions, flow->actionsLen); + OvsReleaseDatapath(datapath, &dpLockState); + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + continue; + } else { + OvsReleaseDatapath(datapath, &dpLockState); + + datapath->misses++; + status = OvsCreateAndAddPackets(NULL, 0, OVS_PACKET_CMD_MISS, + portNo, &key, curNbl, + sourcePort == switchContext->virtualExternalPortId, + &layers, switchContext, &missedPackets, &num); + if (status == NDIS_STATUS_SUCCESS) { + /* Complete the packet since it was copied to user + * buffer. */ + RtlInitUnicodeString(&filterReason, + L"OVS-Dropped since packet was copied to userspace"); + } else { + RtlInitUnicodeString(&filterReason, + L"OVS-Dropped due to failure to queue to userspace"); + } + goto dropit; + } + +dropit: + OvsAddPktCompletionList(&completionList, TRUE, sourcePort, curNbl, 0, + &filterReason); + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + } + } + +#if (NDIS_SUPPORT_NDIS640) + if (nativeForwardedNbls) { + /* This is NVGRE encapsulated traffic and is forwarded to NDIS + * in order to be handled by the HNV module. */ + OvsSendNBLIngress(switchContext, nativeForwardedNbls, SendFlags); + } +#endif /* NDIS_SUPPORT_NDIS640 */ + + /* Queue the missed packets. */ + OvsQueuePackets(&missedPackets, num); + OvsFinalizeCompletionList(&completionList); +} + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterSendNetBufferLists Function. + * -------------------------------------------------------------------------- + */ +VOID +OvsExtSendNBL(NDIS_HANDLE filterModuleContext, + PNET_BUFFER_LIST netBufferLists, + NDIS_PORT_NUMBER portNumber, + ULONG sendFlags) +{ + UNREFERENCED_PARAMETER(portNumber); + + /* 'filterModuleContext' is the switch context that gets created in the + * AttachHandler. */ + POVS_SWITCH_CONTEXT switchContext; + switchContext = (POVS_SWITCH_CONTEXT) filterModuleContext; + + if (switchContext->dataFlowState == OvsSwitchPaused) { + NDIS_STRING filterReason; + ULONG sendCompleteFlags = OvsGetSendCompleteFlags(sendFlags); + + RtlInitUnicodeString(&filterReason, + L"Switch state PAUSED, drop on ingress."); + OvsStartNBLIngressError(switchContext, netBufferLists, + sendCompleteFlags, &filterReason, + NDIS_STATUS_PAUSED); + return; + } + + ASSERT(switchContext->dataFlowState == OvsSwitchRunning); + + OvsStartNBLIngress(switchContext, netBufferLists, sendFlags); +} + +static VOID +OvsCompleteNBLIngress(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST netBufferLists, + ULONG sendCompleteFlags) +{ + PNET_BUFFER_LIST curNbl = NULL, nextNbl = NULL; + OvsCompletionList newList; + + newList.dropNbl = NULL; + newList.dropNblNext = &newList.dropNbl; + + for (curNbl = netBufferLists; curNbl != NULL; curNbl = nextNbl) { + nextNbl = curNbl->Next; + curNbl->Next = NULL; + + curNbl = OvsCompleteNBL(switchContext, curNbl, TRUE); + if (curNbl != NULL) { + /* NBL originated from the upper layer. */ + *newList.dropNblNext = curNbl; + newList.dropNblNext = &curNbl->Next; + } + } + + /* Complete the NBL's that were sent by the upper layer. */ + if (newList.dropNbl != NULL) { + NdisFSendNetBufferListsComplete(switchContext->NdisFilterHandle, newList.dropNbl, + sendCompleteFlags); + } +} + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterSendNetBufferListsComplete function. + * -------------------------------------------------------------------------- + */ +VOID +OvsExtSendNBLComplete(NDIS_HANDLE filterModuleContext, + PNET_BUFFER_LIST netBufferLists, + ULONG sendCompleteFlags) +{ + OvsCompleteNBLIngress((POVS_SWITCH_CONTEXT)filterModuleContext, + netBufferLists, sendCompleteFlags); +} + + +VOID +OvsFinalizeCompletionList(OvsCompletionList *completionList) +{ + if (completionList->dropNbl != NULL) { + OvsCompleteNBLIngress(completionList->switchContext, + completionList->dropNbl, + completionList->sendCompleteFlags); + + completionList->dropNbl = NULL; + completionList->dropNblNext = &completionList->dropNbl; + } +} + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterCancelSendNetBufferLists function. + * + * "If a filter driver specifies a FilterSendNetBufferLists function and it + * queues send requests, it must also specify a + * FilterCancelSendNetBufferLists function." + * + * http://msdn.microsoft.com/en-us/library/windows/hardware/ + * ff549966(v=vs.85).aspx + * -------------------------------------------------------------------------- + */ +VOID +OvsExtCancelSendNBL(NDIS_HANDLE filterModuleContext, + PVOID CancelId) +{ + UNREFERENCED_PARAMETER(filterModuleContext); + UNREFERENCED_PARAMETER(CancelId); + + /* All send requests get completed synchronously, so there is no need to + * implement this callback. */ +} + +static NTSTATUS +OvsCreateNewNBLsFromMultipleNBs(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST *curNbl, + PNET_BUFFER_LIST *nextNbl) +{ + NTSTATUS status = STATUS_SUCCESS; + PNET_BUFFER_LIST newNbls = NULL; + PNET_BUFFER_LIST lastNbl = NULL; + PNET_BUFFER_LIST nbl = NULL; + BOOLEAN error = TRUE; + + do { + /* Create new NBLs from curNbl with multiple net buffers. */ + newNbls = OvsPartialCopyToMultipleNBLs(switchContext, + *curNbl, 0, 0, TRUE); + if (NULL == newNbls) { + OVS_LOG_ERROR("Failed to allocate NBLs with single NB."); + status = NDIS_STATUS_RESOURCES; + break; + } + + nbl = newNbls; + while (nbl) { + lastNbl = nbl; + nbl = NET_BUFFER_LIST_NEXT_NBL(nbl); + } + lastNbl->Next = *nextNbl; + *nextNbl = newNbls->Next; + + OvsCompleteNBL(switchContext, *curNbl, TRUE); + + *curNbl = newNbls; + (*curNbl)->Next = NULL; + + error = FALSE; + } while (error); + + return status; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/PacketIO.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketIO.h --- openvswitch-2.3.1/datapath-windows/ovsext/PacketIO.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketIO.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __PACKETIO_H_ +#define __PACKETIO_H_ 1 + +typedef union _OVS_PACKET_HDR_INFO OVS_PACKET_HDR_INFO; + +/* + * Data structures and utility functions to help manage a list of packets to be + * completed (dropped). + */ +typedef struct OvsCompletionList { + PNET_BUFFER_LIST dropNbl; + PNET_BUFFER_LIST *dropNblNext; + POVS_SWITCH_CONTEXT switchContext; + ULONG sendCompleteFlags; +} OvsCompletionList; + +VOID OvsInitCompletionList(OvsCompletionList *completionList, + POVS_SWITCH_CONTEXT switchContext, + ULONG sendCompleteFlags); +VOID OvsAddPktCompletionList(OvsCompletionList *completionList, + BOOLEAN incoming, + NDIS_SWITCH_PORT_ID sourcePort, + PNET_BUFFER_LIST netBufferList, + UINT32 netBufferListCount, + PNDIS_STRING filterReason); + + +/* + * Functions related to packet processing. + */ +VOID OvsSendNBLIngress(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST netBufferLists, + ULONG sendFlags); + +NDIS_STATUS OvsActionsExecute(POVS_SWITCH_CONTEXT switchContext, + OvsCompletionList *completionList, + PNET_BUFFER_LIST curNbl, UINT32 srcVportNo, + ULONG sendFlags, OvsFlowKey *key, UINT64 *hash, + OVS_PACKET_HDR_INFO *layers, + const PNL_ATTR actions, int actionsLen); + +VOID OvsLookupFlowOutput(POVS_SWITCH_CONTEXT switchContext, + VOID *compList, PNET_BUFFER_LIST curNbl); + +#endif /* __PACKETIO_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/PacketParser.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketParser.c --- openvswitch-2.3.1/datapath-windows/ovsext/PacketParser.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketParser.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PacketParser.h" + +//XXX consider moving to NdisGetDataBuffer. +const VOID * +OvsGetPacketBytes(const NET_BUFFER_LIST *nbl, + UINT32 len, + UINT32 srcOffset, + VOID *storage) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + PNET_BUFFER netBuffer = NET_BUFFER_LIST_FIRST_NB(nbl); + PMDL currentMdl; + BOOLEAN firstMDL = TRUE; + ULONG destOffset = 0; + VOID *dest = storage; + const UINT32 copyLen = len; + ULONG packetLen; + + packetLen = NET_BUFFER_DATA_LENGTH(netBuffer); + // Start copy from current MDL + currentMdl = NET_BUFFER_CURRENT_MDL(netBuffer); + + // Data on current MDL may be offset from start of MDL + while (destOffset < copyLen && currentMdl) { + PUCHAR srcMemory = MmGetSystemAddressForMdlSafe(currentMdl, + LowPagePriority); + ULONG length = MmGetMdlByteCount(currentMdl); + if (!srcMemory) { + status = NDIS_STATUS_RESOURCES; + break; + } + + if (firstMDL) { + ULONG mdlOffset = NET_BUFFER_CURRENT_MDL_OFFSET(netBuffer); + srcMemory += mdlOffset; + length -= mdlOffset; + firstMDL = FALSE; + } + length = MIN(length, packetLen); + packetLen -= length; + ASSERT((INT)packetLen >= 0); + + if (srcOffset >= length) { + currentMdl = NDIS_MDL_LINKAGE(currentMdl); + srcOffset -= length; + continue; + } else { + srcMemory += srcOffset; + length -= srcOffset; + srcOffset = 0; + } + + length = min(length, copyLen-destOffset); + + NdisMoveMemory((PUCHAR)dest+destOffset, srcMemory, length); + destOffset += length; + + currentMdl = NDIS_MDL_LINKAGE(currentMdl); + } + + if (destOffset == copyLen) { + ASSERT(status == NDIS_STATUS_SUCCESS); + return storage; + } + + return NULL; +} + +NDIS_STATUS +OvsParseIPv6(const NET_BUFFER_LIST *packet, + OvsFlowKey *key, + POVS_PACKET_HDR_INFO layers) +{ + UINT16 ofs = layers->l3Offset; + IPv6Hdr ipv6HdrStorage; + const IPv6Hdr *nh; + UINT32 nextHdr; + Ipv6Key *flow= &key->ipv6Key; + + ofs = layers->l3Offset; + nh = OvsGetPacketBytes(packet, sizeof *nh, ofs, &ipv6HdrStorage); + if (!nh) { + return NDIS_STATUS_FAILURE; + } + + nextHdr = nh->nexthdr; + memcpy(&flow->ipv6Src, nh->saddr.s6_addr, 16); + memcpy(&flow->ipv6Dst, nh->daddr.s6_addr, 16); + + flow->nwTos = ((nh->flow_lbl[0] & 0xF0) >> 4) | (nh->priority << 4); + flow->ipv6Label = + ((nh->flow_lbl[0] & 0x0F) << 16) | (nh->flow_lbl[1] << 8) | nh->flow_lbl[2]; + flow->nwTtl = nh->hop_limit; + flow->nwProto = SOCKET_IPPROTO_NONE; + flow->nwFrag = 0; + + // Parse extended headers and compute L4 offset + ofs += sizeof(IPv6Hdr); + for (;;) { + if ((nextHdr != SOCKET_IPPROTO_HOPOPTS) + && (nextHdr != SOCKET_IPPROTO_ROUTING) + && (nextHdr != SOCKET_IPPROTO_DSTOPTS) + && (nextHdr != SOCKET_IPPROTO_AH) + && (nextHdr != SOCKET_IPPROTO_FRAGMENT)) { + /* + * It's either a terminal header (e.g., TCP, UDP) or one we + * don't understand. In either case, we're done with the + * packet, so use it to fill in 'nw_proto'. + */ + break; + } + + if (nextHdr == SOCKET_IPPROTO_HOPOPTS + || nextHdr == SOCKET_IPPROTO_ROUTING + || nextHdr == SOCKET_IPPROTO_DSTOPTS + || nextHdr == SOCKET_IPPROTO_AH) { + IPv6ExtHdr extHdrStorage; + const IPv6ExtHdr *extHdr; + UINT8 len; + + extHdr = OvsGetPacketBytes(packet, sizeof *extHdr, ofs, &extHdrStorage); + if (!extHdr) { + return NDIS_STATUS_FAILURE; + } + + len = extHdr->hdrExtLen; + ofs += nextHdr == SOCKET_IPPROTO_AH ? (len + 2) * 4 : (len + 1) * 8; + nextHdr = extHdr->nextHeader; + if (OvsPacketLenNBL(packet) < ofs) { + return NDIS_STATUS_FAILURE; + } + } else if (nextHdr == SOCKET_IPPROTO_FRAGMENT) { + IPv6FragHdr fragHdrStorage; + const IPv6FragHdr *fragHdr; + + fragHdr = OvsGetPacketBytes(packet, sizeof *fragHdr, ofs, + &fragHdrStorage); + if (!fragHdr) { + return NDIS_STATUS_FAILURE; + } + + nextHdr = fragHdr->nextHeader; + ofs += sizeof *fragHdr; + + /* We only process the first fragment. */ + if (fragHdr->offlg != htons(0)) { + if ((fragHdr->offlg & IP6F_OFF_HOST_ORDER_MASK) == htons(0)) { + flow->nwFrag = OVSWIN_NW_FRAG_ANY; + } else { + flow->nwFrag |= OVSWIN_NW_FRAG_LATER; + nextHdr = SOCKET_IPPROTO_FRAGMENT; + break; + } + } + } + } + + flow->nwProto = (UINT8)nextHdr; + layers->l4Offset = ofs; + return NDIS_STATUS_SUCCESS; +} + +VOID +OvsParseTcp(const NET_BUFFER_LIST *packet, + L4Key *flow, + POVS_PACKET_HDR_INFO layers) +{ + TCPHdr tcpStorage; + const TCPHdr *tcp = OvsGetTcp(packet, layers->l4Offset, &tcpStorage); + if (tcp) { + flow->tpSrc = tcp->source; + flow->tpDst = tcp->dest; + layers->isTcp = 1; + layers->l7Offset = layers->l4Offset + 4 * tcp->doff; + } +} + +VOID +OvsParseUdp(const NET_BUFFER_LIST *packet, + L4Key *flow, + POVS_PACKET_HDR_INFO layers) +{ + UDPHdr udpStorage; + const UDPHdr *udp = OvsGetUdp(packet, layers->l4Offset, &udpStorage); + if (udp) { + flow->tpSrc = udp->source; + flow->tpDst = udp->dest; + layers->isUdp = 1; + if (udp->check == 0) { + layers->udpCsumZero = 1; + } + layers->l7Offset = layers->l4Offset + sizeof *udp; + } +} + +NDIS_STATUS +OvsParseIcmpV6(const NET_BUFFER_LIST *packet, + OvsFlowKey *key, + POVS_PACKET_HDR_INFO layers) +{ + UINT16 ofs = layers->l4Offset; + ICMPHdr icmpStorage; + const ICMPHdr *icmp; + Icmp6Key *flow = &key->icmp6Key; + + memset(&flow->ndTarget, 0, sizeof(flow->ndTarget)); + memset(flow->arpSha, 0, sizeof(flow->arpSha)); + memset(flow->arpTha, 0, sizeof(flow->arpTha)); + + icmp = OvsGetIcmp(packet, ofs, &icmpStorage); + if (!icmp) { + return NDIS_STATUS_FAILURE; + } + ofs += sizeof *icmp; + + /* + * The ICMPv6 type and code fields use the 16-bit transport port + * fields, so we need to store them in 16-bit network byte order. + */ + key->ipv6Key.l4.tpSrc = htons(icmp->type); + key->ipv6Key.l4.tpDst = htons(icmp->code); + + if (icmp->code == 0 && + (icmp->type == ND_NEIGHBOR_SOLICIT || + icmp->type == ND_NEIGHBOR_ADVERT)) { + struct in6_addr ndTargetStorage; + const struct in6_addr *ndTarget; + + ndTarget = OvsGetPacketBytes(packet, sizeof *ndTarget, ofs, + &ndTargetStorage); + if (!ndTarget) { + return NDIS_STATUS_FAILURE; + } + flow->ndTarget = *ndTarget; + + while ((UINT32)(ofs + 8) <= OvsPacketLenNBL(packet)) { + /* + * The minimum size of an option is 8 bytes, which also is + * the size of Ethernet link-layer options. + */ + IPv6NdOptHdr ndOptStorage; + const IPv6NdOptHdr *ndOpt; + UINT16 optLen; + + ndOpt = OvsGetPacketBytes(packet, sizeof *ndOpt, ofs, &ndOptStorage); + if (!ndOpt) { + return NDIS_STATUS_FAILURE; + } + + optLen = ndOpt->len * 8; + if (!optLen || (UINT32)(ofs + optLen) > OvsPacketLenNBL(packet)) { + goto invalid; + } + + /* + * Store the link layer address if the appropriate option is + * provided. It is considered an error if the same link + * layer option is specified twice. + */ + if (ndOpt->type == ND_OPT_SOURCE_LINKADDR && optLen == 8) { + if (Eth_IsNullAddr(flow->arpSha)) { + memcpy(flow->arpSha, ndOpt + 1, ETH_ADDR_LENGTH); + } else { + goto invalid; + } + } else if (ndOpt->type == ND_OPT_TARGET_LINKADDR && optLen == 8) { + if (Eth_IsNullAddr(flow->arpTha)) { + memcpy(flow->arpTha, ndOpt + 1, ETH_ADDR_LENGTH); + } else { + goto invalid; + } + } + + ofs += optLen; + } + } + + layers->l7Offset = ofs; + return NDIS_STATUS_SUCCESS; + +invalid: + memset(&flow->ndTarget, 0, sizeof(flow->ndTarget)); + memset(flow->arpSha, 0, sizeof(flow->arpSha)); + memset(flow->arpTha, 0, sizeof(flow->arpTha)); + + return NDIS_STATUS_FAILURE; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/PacketParser.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketParser.h --- openvswitch-2.3.1/datapath-windows/ovsext/PacketParser.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/PacketParser.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __PACKET_PARSER_H_ +#define __PACKET_PARSER_H_ 1 + +#include "precomp.h" +#include "NetProto.h" + +const VOID* OvsGetPacketBytes(const NET_BUFFER_LIST *_pNB, UINT32 len, + UINT32 SrcOffset, VOID *storage); +NDIS_STATUS OvsParseIPv6(const NET_BUFFER_LIST *packet, OvsFlowKey *key, + POVS_PACKET_HDR_INFO layers); +VOID OvsParseTcp(const NET_BUFFER_LIST *packet, L4Key *flow, + POVS_PACKET_HDR_INFO layers); +VOID OvsParseUdp(const NET_BUFFER_LIST *packet, L4Key *flow, + POVS_PACKET_HDR_INFO layers); +NDIS_STATUS OvsParseIcmpV6(const NET_BUFFER_LIST *packet, OvsFlowKey *key, + POVS_PACKET_HDR_INFO layers); + +static __inline ULONG +OvsPacketLenNBL(const NET_BUFFER_LIST *_pNB) +{ + INT length = 0; + NET_BUFFER *nb; + + nb = NET_BUFFER_LIST_FIRST_NB(_pNB); + ASSERT(nb); + while(nb) { + length += NET_BUFFER_DATA_LENGTH(nb); + nb = NET_BUFFER_NEXT_NB(nb); + } + + return length; +} + +/* + * Returns the ctl field from the TCP header in 'packet', or 0 if the field + * can't be read. The caller must have ensured that 'packet' contains a TCP + * header. + * + * We can't just use TCPHdr, from netProto.h, for this because that + * breaks the flags down into individual bit-fields. We can't even use + * offsetof because that will try to take the address of a bit-field, + * which C does not allow. + */ +static UINT16 +OvsGetTcpCtl(const NET_BUFFER_LIST *packet, // IN + const POVS_PACKET_HDR_INFO layers) // IN +{ +#define TCP_CTL_OFS 12 // Offset of "ctl" field in TCP header. +#define TCP_FLAGS(CTL) ((CTL) & 0x3f) // Obtain TCP flags from CTL. + + const UINT16 *ctl; + UINT16 storage; + + ctl = OvsGetPacketBytes(packet, sizeof *ctl, layers->l4Offset + TCP_CTL_OFS, + &storage); + return ctl ? *ctl : 0; +} + + +static UINT8 +OvsGetTcpFlags(const NET_BUFFER_LIST *packet, // IN + const OvsFlowKey *key, // IN + const POVS_PACKET_HDR_INFO layers) // IN +{ + UNREFERENCED_PARAMETER(key); // should be removed later + + if (layers->isTcp) { + return TCP_FLAGS(OvsGetTcpCtl(packet, layers)); + } else { + return 0; + } +} + +static const EtherArp * +OvsGetArp(const NET_BUFFER_LIST *packet, + UINT32 ofs, + EtherArp *storage) +{ + return OvsGetPacketBytes(packet, sizeof *storage, ofs, storage); +} + +static const IPHdr * +OvsGetIp(const NET_BUFFER_LIST *packet, + UINT32 ofs, + IPHdr *storage) +{ + const IPHdr *ip = OvsGetPacketBytes(packet, sizeof *ip, ofs, storage); + if (ip) { + int ipLen = ip->ihl * 4; + if (ipLen >= sizeof *ip && OvsPacketLenNBL(packet) >= ofs + ipLen) { + return ip; + } + } + return NULL; +} + +static const TCPHdr * +OvsGetTcp(const NET_BUFFER_LIST *packet, + UINT32 ofs, + TCPHdr *storage) +{ + const TCPHdr *tcp = OvsGetPacketBytes(packet, sizeof *tcp, ofs, storage); + if (tcp) { + int tcpLen = tcp->doff * 4; + if (tcpLen >= sizeof *tcp && OvsPacketLenNBL(packet) >= ofs + tcpLen) { + return tcp; + } + } + return NULL; +} + +static const UDPHdr * +OvsGetUdp(const NET_BUFFER_LIST *packet, + UINT32 ofs, + UDPHdr *storage) +{ + return OvsGetPacketBytes(packet, sizeof *storage, ofs, storage); +} + +static const ICMPHdr * +OvsGetIcmp(const NET_BUFFER_LIST *packet, + UINT32 ofs, + ICMPHdr *storage) +{ + return OvsGetPacketBytes(packet, sizeof *storage, ofs, storage); +} + +#endif /* __PACKET_PARSER_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/precomp.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/precomp.h --- openvswitch-2.3.1/datapath-windows/ovsext/precomp.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/precomp.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include "Types.h" + +#include "..\include\OvsDpInterface.h" + +#include "Util.h" +#include "Netlink/NetlinkError.h" +#include "Netlink/Netlink.h" +#include "Netlink/NetlinkProto.h" +#include "..\include\OvsDpInterfaceExt.h" +#include "DpInternal.h" diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/precompsrc.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/precompsrc.c --- openvswitch-2.3.1/datapath-windows/ovsext/precompsrc.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/precompsrc.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Stt.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Stt.c --- openvswitch-2.3.1/datapath-windows/ovsext/Stt.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Stt.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,369 @@ +/* + * Copyright (c) 2015 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "NetProto.h" +#include "Switch.h" +#include "Vport.h" +#include "Flow.h" +#include "Stt.h" +#include "IpHelper.h" +#include "Checksum.h" +#include "User.h" +#include "PacketIO.h" +#include "Flow.h" +#include "PacketParser.h" +#include "Atomic.h" +#include "Util.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_STT +#include "Debug.h" + +static NDIS_STATUS +OvsDoEncapStt(POVS_VPORT_ENTRY vport, PNET_BUFFER_LIST curNbl, + const OvsIPv4TunnelKey *tunKey, + const POVS_FWD_INFO fwdInfo, + POVS_PACKET_HDR_INFO layers, + POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST *newNbl); + +/* + * -------------------------------------------------------------------------- + * OvsInitSttTunnel -- + * Initialize STT tunnel module. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsInitSttTunnel(POVS_VPORT_ENTRY vport, + UINT16 tcpDestPort) +{ + POVS_STT_VPORT sttPort; + + sttPort = (POVS_STT_VPORT) OvsAllocateMemoryWithTag(sizeof(*sttPort), + OVS_STT_POOL_TAG); + if (!sttPort) { + OVS_LOG_ERROR("Insufficient memory, can't allocate STT_VPORT"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlZeroMemory(sttPort, sizeof(*sttPort)); + sttPort->dstPort = tcpDestPort; + vport->priv = (PVOID) sttPort; + return STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * OvsCleanupSttTunnel -- + * Cleanup STT Tunnel module. + * -------------------------------------------------------------------------- + */ +void +OvsCleanupSttTunnel(POVS_VPORT_ENTRY vport) +{ + if (vport->ovsType != OVS_VPORT_TYPE_STT || + vport->priv == NULL) { + return; + } + + OvsFreeMemoryWithTag(vport->priv, OVS_STT_POOL_TAG); + vport->priv = NULL; +} + +/* + * -------------------------------------------------------------------------- + * OvsEncapStt -- + * Encapsulates a packet with an STT header. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsEncapStt(POVS_VPORT_ENTRY vport, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + POVS_SWITCH_CONTEXT switchContext, + POVS_PACKET_HDR_INFO layers, + PNET_BUFFER_LIST *newNbl) +{ + OVS_FWD_INFO fwdInfo; + NDIS_STATUS status; + + UNREFERENCED_PARAMETER(switchContext); + status = OvsLookupIPFwdInfo(tunKey->dst, &fwdInfo); + if (status != STATUS_SUCCESS) { + OvsFwdIPHelperRequest(NULL, 0, tunKey, NULL, NULL, NULL); + /* + * XXX This case where the ARP table is not populated is + * currently not handled + */ + return NDIS_STATUS_FAILURE; + } + + status = OvsDoEncapStt(vport, curNbl, tunKey, &fwdInfo, layers, + switchContext, newNbl); + return status; +} + +/* + * -------------------------------------------------------------------------- + * OvsDoEncapStt -- + * Internal utility function which actually does the STT encap. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsDoEncapStt(POVS_VPORT_ENTRY vport, + PNET_BUFFER_LIST curNbl, + const OvsIPv4TunnelKey *tunKey, + const POVS_FWD_INFO fwdInfo, + POVS_PACKET_HDR_INFO layers, + POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST *newNbl) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + PMDL curMdl = NULL; + PNET_BUFFER curNb; + PUINT8 buf = NULL; + EthHdr *outerEthHdr; + IPHdr *outerIpHdr; + TCPHdr *outerTcpHdr; + SttHdr *sttHdr; + UINT32 innerFrameLen, ipTotalLen; + POVS_STT_VPORT vportStt; + UINT32 headRoom = OvsGetSttTunHdrSize(); + UINT32 tcpChksumLen; + + UNREFERENCED_PARAMETER(layers); + + curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); + if (layers->isTcp) { + NDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO lsoInfo; + + lsoInfo.Value = NET_BUFFER_LIST_INFO(curNbl, + TcpLargeSendNetBufferListInfo); + if (lsoInfo.LsoV1Transmit.MSS) { + /* XXX We don't handle LSO yet */ + OVS_LOG_ERROR("LSO on STT is not supported"); + return NDIS_STATUS_FAILURE; + } + } + + vportStt = (POVS_STT_VPORT) GetOvsVportPriv(vport); + ASSERT(vportStt); + + *newNbl = OvsPartialCopyNBL(switchContext, curNbl, 0, headRoom, + FALSE /*copy NblInfo*/); + if (*newNbl == NULL) { + OVS_LOG_ERROR("Unable to copy NBL"); + return NDIS_STATUS_FAILURE; + } + + curNbl = *newNbl; + curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); + /* NB Chain should be split before */ + ASSERT(NET_BUFFER_NEXT_NB(curNb) == NULL); + + innerFrameLen = NET_BUFFER_DATA_LENGTH(curNb); + /* + * External port can't be removed as we hold the dispatch lock + * We also check if the external port was removed beforecalling + * port encapsulation functions + */ + if (innerFrameLen > OvsGetExternalMtu(switchContext) - headRoom) { + OVS_LOG_ERROR("Packet too large (size %d, mtu %d). Can't encapsulate", + innerFrameLen, OvsGetExternalMtu(switchContext)); + status = NDIS_STATUS_FAILURE; + goto ret_error; + } + + status = NdisRetreatNetBufferDataStart(curNb, headRoom, 0, NULL); + if (status != NDIS_STATUS_SUCCESS) { + ASSERT(!"Unable to NdisRetreatNetBufferDataStart(headroom)"); + OVS_LOG_ERROR("Unable to NdisRetreatNetBufferDataStart(headroom)"); + goto ret_error; + } + + /* + * Make sure that the headroom for the tunnel header is continguous in + * memory. + */ + curMdl = NET_BUFFER_CURRENT_MDL(curNb); + ASSERT((int) (MmGetMdlByteCount(curMdl) - NET_BUFFER_CURRENT_MDL_OFFSET(curNb)) + >= (int) headRoom); + + buf = (PUINT8) MmGetSystemAddressForMdlSafe(curMdl, LowPagePriority); + if (!buf) { + ASSERT(!"MmGetSystemAddressForMdlSafe failed"); + OVS_LOG_ERROR("MmGetSystemAddressForMdlSafe failed"); + status = NDIS_STATUS_RESOURCES; + goto ret_error; + } + + buf += NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + outerEthHdr = (EthHdr *)buf; + outerIpHdr = (IPHdr *) (outerEthHdr + 1); + outerTcpHdr = (TCPHdr *) (outerIpHdr + 1); + sttHdr = (SttHdr *) (outerTcpHdr + 1); + + /* L2 header */ + ASSERT(((PCHAR)&fwdInfo->dstMacAddr + sizeof fwdInfo->dstMacAddr) == + (PCHAR)&fwdInfo->srcMacAddr); + NdisMoveMemory(outerEthHdr->Destination, fwdInfo->dstMacAddr, + sizeof outerEthHdr->Destination + sizeof outerEthHdr->Source); + outerEthHdr->Type = htons(ETH_TYPE_IPV4); + + /* L3 header */ + outerIpHdr->ihl = sizeof(IPHdr) >> 2; + outerIpHdr->version = IPPROTO_IPV4; + outerIpHdr->tos = tunKey->tos; + + ipTotalLen = sizeof(IPHdr) + sizeof(TCPHdr) + STT_HDR_LEN + innerFrameLen; + outerIpHdr->tot_len = htons(ipTotalLen); + ASSERT(ipTotalLen < 65536); + + outerIpHdr->id = (uint16) atomic_add64(&vportStt->ipId, innerFrameLen); + outerIpHdr->frag_off = (tunKey->flags & OVS_TNL_F_DONT_FRAGMENT) ? + IP_DF_NBO : 0; + outerIpHdr->ttl = tunKey->ttl? tunKey->ttl : 64; + outerIpHdr->protocol = IPPROTO_TCP; + outerIpHdr->check = 0; + outerIpHdr->saddr = fwdInfo->srcIpAddr; + outerIpHdr->daddr = tunKey->dst; + outerIpHdr->check = IPChecksum((uint8 *)outerIpHdr, sizeof *outerIpHdr, 0); + + /* L4 header */ + RtlZeroMemory(outerTcpHdr, sizeof *outerTcpHdr); + outerTcpHdr->source = htons(tunKey->flow_hash | 32768); + outerTcpHdr->dest = htons(vportStt->dstPort); + outerTcpHdr->seq = htonl((STT_HDR_LEN + innerFrameLen) << + STT_SEQ_LEN_SHIFT); + outerTcpHdr->ack_seq = htonl(atomic_inc64(&vportStt->ackNo)); + outerTcpHdr->doff = sizeof(TCPHdr) >> 2; + outerTcpHdr->psh = 1; + outerTcpHdr->ack = 1; + outerTcpHdr->window = (uint16) ~0; + + /* Calculate pseudo header chksum */ + tcpChksumLen = sizeof(TCPHdr) + STT_HDR_LEN + innerFrameLen; + ASSERT(tcpChksumLen < 65535); + outerTcpHdr->check = IPPseudoChecksum(&fwdInfo->srcIpAddr,(uint32 *) &tunKey->dst, + IPPROTO_TCP, (uint16) tcpChksumLen); + sttHdr->version = 0; + + /* XXX need to peek into the inner packet, hard code for now */ + sttHdr->flags = STT_PROTO_IPV4; + sttHdr->l4Offset = 0; + + sttHdr->reserved = 0; + /* XXX Used for large TCP packets.Not sure how it is used, clarify */ + sttHdr->mss = 0; + sttHdr->vlanTCI = 0; + sttHdr->key = tunKey->tunnelId; + /* Zero out stt padding */ + *(uint16 *)(sttHdr + 1) = 0; + + /* Calculate software tcp checksum */ + outerTcpHdr->check = CalculateChecksumNB(curNb, (uint16) tcpChksumLen, + sizeof(EthHdr) + sizeof(IPHdr)); + if (outerTcpHdr->check == 0) { + status = NDIS_STATUS_FAILURE; + goto ret_error; + } + + return STATUS_SUCCESS; + +ret_error: + OvsCompleteNBL(switchContext, *newNbl, TRUE); + *newNbl = NULL; + return status; +} + +/* + * -------------------------------------------------------------------------- + * OvsDecapStt -- + * Decapsulates an STT packet. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsDecapStt(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + PNET_BUFFER_LIST *newNbl) +{ + NDIS_STATUS status = NDIS_STATUS_FAILURE; + PNET_BUFFER curNb; + IPHdr *ipHdr; + char *ipBuf[sizeof(IPHdr)]; + SttHdr *sttHdr; + char *sttBuf[STT_HDR_LEN]; + UINT32 advanceCnt, hdrLen; + + curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); + ASSERT(NET_BUFFER_NEXT_NB(curNb) == NULL); + + if (NET_BUFFER_DATA_LENGTH(curNb) < OvsGetSttTunHdrSize()) { + OVS_LOG_ERROR("Packet length received is less than the tunnel header:" + " %d<%d\n", NET_BUFFER_DATA_LENGTH(curNb), OvsGetSttTunHdrSize()); + return NDIS_STATUS_INVALID_LENGTH; + } + + /* Skip Eth header */ + hdrLen = sizeof(EthHdr); + NdisAdvanceNetBufferDataStart(curNb, hdrLen, FALSE, NULL); + advanceCnt = hdrLen; + + ipHdr = NdisGetDataBuffer(curNb, sizeof *ipHdr, (PVOID) &ipBuf, + 1 /*no align*/, 0); + ASSERT(ipHdr); + + /* Skip IP & TCP headers */ + hdrLen = sizeof(IPHdr) + sizeof(TCPHdr), + NdisAdvanceNetBufferDataStart(curNb, hdrLen, FALSE, NULL); + advanceCnt += hdrLen; + + /* STT Header */ + sttHdr = NdisGetDataBuffer(curNb, sizeof *sttHdr, (PVOID) &sttBuf, + 1 /*no align*/, 0); + ASSERT(sttHdr); + + /* Initialize the tunnel key */ + tunKey->dst = ipHdr->daddr; + tunKey->src = ipHdr->saddr; + tunKey->tunnelId = sttHdr->key; + tunKey->flags = (OVS_TNL_F_CSUM | OVS_TNL_F_KEY); + tunKey->tos = ipHdr->tos; + tunKey->ttl = ipHdr->ttl; + tunKey->pad = 0; + + /* Skip stt header, DataOffset points to inner pkt now. */ + hdrLen = STT_HDR_LEN; + NdisAdvanceNetBufferDataStart(curNb, hdrLen, FALSE, NULL); + advanceCnt += hdrLen; + + *newNbl = OvsPartialCopyNBL(switchContext, curNbl, OVS_DEFAULT_COPY_SIZE, + 0, FALSE /*copy NBL info*/); + + ASSERT(advanceCnt == OvsGetSttTunHdrSize()); + status = NdisRetreatNetBufferDataStart(curNb, advanceCnt, 0, NULL); + + if (*newNbl == NULL) { + OVS_LOG_ERROR("OvsDecapStt: Unable to allocate a new cloned NBL"); + status = NDIS_STATUS_RESOURCES; + } + + return status; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Stt.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Stt.h --- openvswitch-2.3.1/datapath-windows/ovsext/Stt.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Stt.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2015 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __OVS_STT_H_ +#define __OVS_STT_H_ 1 + +#define STT_TCP_PORT 7471 +#define STT_TCP_PORT_NBO 0x2f1d + +#define MAX_IP_TOTAL_LEN 65535 + +// STT defines. +#define STT_SEQ_LEN_SHIFT 16 +#define STT_SEQ_OFFSET_MASK ((1 << STT_SEQ_LEN_SHIFT) - 1) +#define STT_FRAME_LEN(seq) ((seq) >> STT_SEQ_LEN_SHIFT) +#define STT_SEGMENT_OFF(seq) ((seq) & STT_SEQ_OFFSET_MASK) + +#define STT_CSUM_VERIFIED (1 << 0) +#define STT_CSUM_PARTIAL (1 << 1) +#define STT_PROTO_IPV4 (1 << 2) +#define STT_PROTO_TCP (1 << 3) +#define STT_PROTO_TYPES (STT_PROTO_IPV4 | STT_PROTO_TCP) + +#define STT_ETH_PAD 2 +typedef struct SttHdr { + UINT8 version; + UINT8 flags; + UINT8 l4Offset; + UINT8 reserved; + UINT16 mss; + UINT16 vlanTCI; + UINT64 key; +} SttHdr, *PSttHdr; + +#define STT_HDR_LEN (sizeof(SttHdr) + STT_ETH_PAD) + +typedef struct _OVS_STT_VPORT { + UINT16 dstPort; + UINT64 ackNo; + UINT64 ipId; + + UINT64 inPkts; + UINT64 outPkts; + UINT64 slowInPkts; + UINT64 slowOutPkts; +} OVS_STT_VPORT, *POVS_STT_VPORT; + +NTSTATUS OvsInitSttTunnel(POVS_VPORT_ENTRY vport, + UINT16 udpDestPort); + +VOID OvsCleanupSttTunnel(POVS_VPORT_ENTRY vport); + + +void OvsCleanupSttTunnel(POVS_VPORT_ENTRY vport); + +NDIS_STATUS OvsEncapStt(POVS_VPORT_ENTRY vport, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + POVS_SWITCH_CONTEXT switchContext, + POVS_PACKET_HDR_INFO layers, + PNET_BUFFER_LIST *newNbl); + + +NDIS_STATUS OvsDecapStt(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + PNET_BUFFER_LIST *newNbl); + +static __inline UINT32 +OvsGetSttTunHdrSize(VOID) +{ + return sizeof (EthHdr) + sizeof(IPHdr) + sizeof(TCPHdr) + + STT_HDR_LEN; +} + +#endif /*__OVS_STT_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Switch.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Switch.c --- openvswitch-2.3.1/datapath-windows/ovsext/Switch.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Switch.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,611 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file contains the implementation of the management functionality of the + * OVS. + */ + +#include "precomp.h" + +#include "Switch.h" +#include "Vport.h" +#include "Event.h" +#include "Flow.h" +#include "IpHelper.h" +#include "Oid.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_SWITCH +#include "Debug.h" + +POVS_SWITCH_CONTEXT gOvsSwitchContext; +LONG volatile gOvsInAttach; +UINT64 ovsTimeIncrementPerTick; + +extern NDIS_HANDLE gOvsExtDriverHandle; +extern NDIS_HANDLE gOvsExtDriverObject; +extern PDEVICE_OBJECT gOvsDeviceObject; + +/* + * Reference count used to prevent premature deallocation of the global switch + * context structure, gOvsSwitchContext. + */ +volatile LONG gOvsSwitchContextRefCount = 0; + +static NDIS_STATUS OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, + POVS_SWITCH_CONTEXT *switchContextOut); +static NDIS_STATUS OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext); +static VOID OvsDeleteSwitch(POVS_SWITCH_CONTEXT switchContext); +static VOID OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext); +static NDIS_STATUS OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext); + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterAttach function. + * + * This function allocates the switch context, and initializes its necessary + * members. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsExtAttach(NDIS_HANDLE ndisFilterHandle, + NDIS_HANDLE filterDriverContext, + PNDIS_FILTER_ATTACH_PARAMETERS attachParameters) +{ + NDIS_STATUS status = NDIS_STATUS_FAILURE; + NDIS_FILTER_ATTRIBUTES ovsExtAttributes; + POVS_SWITCH_CONTEXT switchContext = NULL; + + UNREFERENCED_PARAMETER(filterDriverContext); + + OVS_LOG_TRACE("Enter: ndisFilterHandle %p", ndisFilterHandle); + + ASSERT(filterDriverContext == (NDIS_HANDLE)gOvsExtDriverObject); + if (attachParameters->MiniportMediaType != NdisMedium802_3) { + status = NDIS_STATUS_INVALID_PARAMETER; + goto cleanup; + } + + if (gOvsExtDriverHandle == NULL) { + OVS_LOG_TRACE("Exit: OVSEXT driver is not loaded."); + ASSERT(FALSE); + goto cleanup; + } + + if (gOvsSwitchContext) { + OVS_LOG_TRACE("Exit: Failed to create OVS Switch, only one datapath is" + "supported, %p.", gOvsSwitchContext); + goto cleanup; + } + + if (InterlockedCompareExchange(&gOvsInAttach, 1, 0)) { + /* Just fail the request. */ + OVS_LOG_TRACE("Exit: Failed to create OVS Switch, since another attach" + "instance is in attach process."); + goto cleanup; + } + + status = OvsInitIpHelper(ndisFilterHandle); + if (status != STATUS_SUCCESS) { + OVS_LOG_ERROR("Exit: Failed to initialize IP helper."); + goto cleanup; + } + + status = OvsCreateSwitch(ndisFilterHandle, &switchContext); + if (status != NDIS_STATUS_SUCCESS) { + OvsCleanupIpHelper(); + goto cleanup; + } + ASSERT(switchContext); + + /* + * Register the switch context with NDIS so NDIS can pass it back to the + * FilterXXX callback functions as the 'FilterModuleContext' parameter. + */ + RtlZeroMemory(&ovsExtAttributes, sizeof(NDIS_FILTER_ATTRIBUTES)); + ovsExtAttributes.Header.Revision = NDIS_FILTER_ATTRIBUTES_REVISION_1; + ovsExtAttributes.Header.Size = sizeof(NDIS_FILTER_ATTRIBUTES); + ovsExtAttributes.Header.Type = NDIS_OBJECT_TYPE_FILTER_ATTRIBUTES; + ovsExtAttributes.Flags = 0; + + NDIS_DECLARE_FILTER_MODULE_CONTEXT(OVS_SWITCH_CONTEXT); + status = NdisFSetAttributes(ndisFilterHandle, switchContext, &ovsExtAttributes); + if (status != NDIS_STATUS_SUCCESS) { + OVS_LOG_ERROR("Failed to set attributes."); + OvsCleanupIpHelper(); + goto cleanup; + } + + /* Setup the state machine. */ + switchContext->controlFlowState = OvsSwitchAttached; + switchContext->dataFlowState = OvsSwitchPaused; + + gOvsSwitchContextRefCount = 1; + gOvsSwitchContext = switchContext; + KeMemoryBarrier(); + +cleanup: + gOvsInAttach = FALSE; + if (status != NDIS_STATUS_SUCCESS) { + if (switchContext != NULL) { + OvsDeleteSwitch(switchContext); + } + } + OVS_LOG_TRACE("Exit: status %x", status); + + return status; +} + + +/* + * -------------------------------------------------------------------------- + * This function allocated the switch context, and initializes its necessary + * members. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, + POVS_SWITCH_CONTEXT *switchContextOut) +{ + NDIS_STATUS status; + POVS_SWITCH_CONTEXT switchContext; + NDIS_SWITCH_CONTEXT hostSwitchContext; + NDIS_SWITCH_OPTIONAL_HANDLERS hostSwitchHandler; + + OVS_LOG_TRACE("Enter: Create switch object"); + + switchContext = (POVS_SWITCH_CONTEXT) OvsAllocateMemoryWithTag( + sizeof(OVS_SWITCH_CONTEXT), OVS_SWITCH_POOL_TAG); + if (switchContext == NULL) { + status = NDIS_STATUS_RESOURCES; + goto create_switch_done; + } + RtlZeroMemory(switchContext, sizeof(OVS_SWITCH_CONTEXT)); + + /* Initialize the switch. */ + hostSwitchHandler.Header.Type = NDIS_OBJECT_TYPE_SWITCH_OPTIONAL_HANDLERS; + hostSwitchHandler.Header.Size = NDIS_SIZEOF_SWITCH_OPTIONAL_HANDLERS_REVISION_1; + hostSwitchHandler.Header.Revision = NDIS_SWITCH_OPTIONAL_HANDLERS_REVISION_1; + + status = NdisFGetOptionalSwitchHandlers(ndisFilterHandle, + &hostSwitchContext, + &hostSwitchHandler); + if (status != NDIS_STATUS_SUCCESS) { + OVS_LOG_ERROR("OvsExtAttach: Extension is running in " + "non-switch environment."); + OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); + goto create_switch_done; + } + + switchContext->NdisFilterHandle = ndisFilterHandle; + switchContext->NdisSwitchContext = hostSwitchContext; + RtlCopyMemory(&switchContext->NdisSwitchHandlers, &hostSwitchHandler, + sizeof(NDIS_SWITCH_OPTIONAL_HANDLERS)); + + status = OvsInitSwitchContext(switchContext); + if (status != NDIS_STATUS_SUCCESS) { + OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); + switchContext = NULL; + goto create_switch_done; + } + + status = OvsInitTunnelFilter(gOvsExtDriverObject, gOvsDeviceObject); + if (status != NDIS_STATUS_SUCCESS) { + OvsUninitSwitchContext(switchContext); + goto create_switch_done; + } + + *switchContextOut = switchContext; + +create_switch_done: + OVS_LOG_TRACE("Exit: switchContext: %p status: %#lx", + switchContext, status); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterDetach function. + * -------------------------------------------------------------------------- + */ +_Use_decl_annotations_ +VOID +OvsExtDetach(NDIS_HANDLE filterModuleContext) +{ + POVS_SWITCH_CONTEXT switchContext = (POVS_SWITCH_CONTEXT)filterModuleContext; + + OVS_LOG_TRACE("Enter: filterModuleContext %p", filterModuleContext); + + ASSERT(switchContext->dataFlowState == OvsSwitchPaused); + switchContext->controlFlowState = OvsSwitchDetached; + KeMemoryBarrier(); + while(switchContext->pendingOidCount > 0) { + NdisMSleep(1000); + } + OvsDeleteSwitch(switchContext); + OvsCleanupIpHelper(); + /* This completes the cleanup, and a new attach can be handled now. */ + + OVS_LOG_TRACE("Exit: OvsDetach Successfully"); +} + + +/* + * -------------------------------------------------------------------------- + * This function deletes the switch by freeing all memory previously allocated. + * XXX need synchronization with other path. + * -------------------------------------------------------------------------- + */ +VOID +OvsDeleteSwitch(POVS_SWITCH_CONTEXT switchContext) +{ + UINT32 dpNo = (UINT32) -1; + + OVS_LOG_TRACE("Enter: switchContext:%p", switchContext); + + if (switchContext) + { + dpNo = switchContext->dpNo; + OvsClearAllSwitchVports(switchContext); + OvsUninitTunnelFilter(gOvsExtDriverObject); + OvsUninitSwitchContext(switchContext); + } + OVS_LOG_TRACE("Exit: deleted switch %p dpNo: %d", switchContext, dpNo); +} + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterRestart function. + * -------------------------------------------------------------------------- + */ +_Use_decl_annotations_ +NDIS_STATUS +OvsExtRestart(NDIS_HANDLE filterModuleContext, + PNDIS_FILTER_RESTART_PARAMETERS filterRestartParameters) +{ + POVS_SWITCH_CONTEXT switchContext = (POVS_SWITCH_CONTEXT)filterModuleContext; + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + BOOLEAN switchActive; + + UNREFERENCED_PARAMETER(filterRestartParameters); + + OVS_LOG_TRACE("Enter: filterModuleContext %p", + filterModuleContext); + + /* Activate the switch if this is the first restart. */ + if (!switchContext->isActivated && !switchContext->isActivateFailed) { + status = OvsQuerySwitchActivationComplete(switchContext, + &switchActive); + if (status != NDIS_STATUS_SUCCESS) { + switchContext->isActivateFailed = TRUE; + status = NDIS_STATUS_RESOURCES; + goto cleanup; + } + + if (switchActive) { + status = OvsActivateSwitch(switchContext); + + if (status != NDIS_STATUS_SUCCESS) { + OVS_LOG_WARN("Failed to activate switch, dpNo:%d", + switchContext->dpNo); + status = NDIS_STATUS_RESOURCES; + goto cleanup; + } + } + } + + ASSERT(switchContext->dataFlowState == OvsSwitchPaused); + switchContext->dataFlowState = OvsSwitchRunning; + +cleanup: + OVS_LOG_TRACE("Exit: Restart switch:%p, dpNo: %d, status: %#x", + switchContext, switchContext->dpNo, status); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterPause function + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsExtPause(NDIS_HANDLE filterModuleContext, + PNDIS_FILTER_PAUSE_PARAMETERS pauseParameters) +{ + POVS_SWITCH_CONTEXT switchContext = (POVS_SWITCH_CONTEXT)filterModuleContext; + + UNREFERENCED_PARAMETER(pauseParameters); + OVS_LOG_TRACE("Enter: filterModuleContext %p", + filterModuleContext); + + ASSERT(switchContext->dataFlowState == OvsSwitchRunning); + switchContext->dataFlowState = OvsSwitchPaused; + KeMemoryBarrier(); + while(switchContext->pendingOidCount > 0) { + NdisMSleep(1000); + } + + OVS_LOG_TRACE("Exit: OvsDetach Successfully"); + return NDIS_STATUS_SUCCESS; +} + +static NDIS_STATUS +OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) +{ + int i; + NTSTATUS status; + + OVS_LOG_TRACE("Enter: switchContext: %p", switchContext); + + switchContext->dispatchLock = + NdisAllocateRWLock(switchContext->NdisFilterHandle); + + switchContext->portNoHashArray = (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); + switchContext->ovsPortNameHashArray = (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); + switchContext->portIdHashArray= (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); + switchContext->pidHashArray = (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_MAX_PID_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); + switchContext->tunnelVportsArray = (PLIST_ENTRY)OvsAllocateMemoryWithTag( + sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); + status = OvsAllocateFlowTable(&switchContext->datapath, switchContext); + + if (status == NDIS_STATUS_SUCCESS) { + status = OvsInitBufferPool(switchContext); + } + if (status != NDIS_STATUS_SUCCESS || + switchContext->dispatchLock == NULL || + switchContext->portNoHashArray == NULL || + switchContext->ovsPortNameHashArray == NULL || + switchContext->portIdHashArray== NULL || + switchContext->pidHashArray == NULL || + switchContext->tunnelVportsArray == NULL) { + if (switchContext->dispatchLock) { + NdisFreeRWLock(switchContext->dispatchLock); + } + if (switchContext->portNoHashArray) { + OvsFreeMemoryWithTag(switchContext->portNoHashArray, + OVS_SWITCH_POOL_TAG); + } + if (switchContext->ovsPortNameHashArray) { + OvsFreeMemoryWithTag(switchContext->ovsPortNameHashArray, + OVS_SWITCH_POOL_TAG); + } + if (switchContext->portIdHashArray) { + OvsFreeMemoryWithTag(switchContext->portIdHashArray, + OVS_SWITCH_POOL_TAG); + } + if (switchContext->pidHashArray) { + OvsFreeMemoryWithTag(switchContext->pidHashArray, + OVS_SWITCH_POOL_TAG); + } + + if (switchContext->tunnelVportsArray) { + OvsFreeMemory(switchContext->tunnelVportsArray); + } + + OvsDeleteFlowTable(&switchContext->datapath); + OvsCleanupBufferPool(switchContext); + + OVS_LOG_TRACE("Exit: Failed to init switchContext"); + return NDIS_STATUS_RESOURCES; + } + + for (i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) { + InitializeListHead(&switchContext->ovsPortNameHashArray[i]); + InitializeListHead(&switchContext->portIdHashArray[i]); + InitializeListHead(&switchContext->portNoHashArray[i]); + InitializeListHead(&switchContext->tunnelVportsArray[i]); + } + + for (i = 0; i < OVS_MAX_PID_ARRAY_SIZE; i++) { + InitializeListHead(&switchContext->pidHashArray[i]); + } + + NdisAllocateSpinLock(&(switchContext->pidHashLock)); + switchContext->isActivated = FALSE; + switchContext->isActivateFailed = FALSE; + switchContext->dpNo = OVS_DP_NUMBER; + ovsTimeIncrementPerTick = KeQueryTimeIncrement() / 10000; + + OVS_LOG_TRACE("Exit: Succesfully initialized switchContext: %p", + switchContext); + return NDIS_STATUS_SUCCESS; +} + +static VOID +OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext) +{ + OvsReleaseSwitchContext(switchContext); +} + +/* + * -------------------------------------------------------------------------- + * Frees up the contents of and also the switch context. + * -------------------------------------------------------------------------- + */ +static VOID +OvsDeleteSwitchContext(POVS_SWITCH_CONTEXT switchContext) +{ + OVS_LOG_TRACE("Enter: Delete switchContext:%p", switchContext); + + /* We need to do cleanup for tunnel port here. */ + ASSERT(switchContext->numHvVports == 0); + ASSERT(switchContext->numNonHvVports == 0); + + NdisFreeRWLock(switchContext->dispatchLock); + switchContext->dispatchLock = NULL; + NdisFreeSpinLock(&(switchContext->pidHashLock)); + OvsFreeMemoryWithTag(switchContext->ovsPortNameHashArray, + OVS_SWITCH_POOL_TAG); + switchContext->ovsPortNameHashArray = NULL; + OvsFreeMemoryWithTag(switchContext->portIdHashArray, + OVS_SWITCH_POOL_TAG); + switchContext->portIdHashArray = NULL; + OvsFreeMemoryWithTag(switchContext->portNoHashArray, + OVS_SWITCH_POOL_TAG); + switchContext->portNoHashArray = NULL; + OvsFreeMemoryWithTag(switchContext->pidHashArray, + OVS_SWITCH_POOL_TAG); + switchContext->pidHashArray = NULL; + OvsFreeMemory(switchContext->tunnelVportsArray); + switchContext->tunnelVportsArray = NULL; + OvsDeleteFlowTable(&switchContext->datapath); + OvsCleanupBufferPool(switchContext); + + OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); + OVS_LOG_TRACE("Exit: Delete switchContext: %p", switchContext); +} + +VOID +OvsReleaseSwitchContext(POVS_SWITCH_CONTEXT switchContext) +{ + LONG ref = 0; + LONG newRef = 0; + LONG icxRef = 0; + + do { + ref = gOvsSwitchContextRefCount; + newRef = (0 == ref) ? 0 : ref - 1; + icxRef = InterlockedCompareExchange(&gOvsSwitchContextRefCount, + newRef, + ref); + } while (icxRef != ref); + + if (ref == 1) { + OvsDeleteSwitchContext(switchContext); + gOvsSwitchContext = NULL; + } +} + +BOOLEAN +OvsAcquireSwitchContext(VOID) +{ + LONG ref = 0; + LONG newRef = 0; + LONG icxRef = 0; + BOOLEAN ret = FALSE; + + do { + ref = gOvsSwitchContextRefCount; + newRef = (0 == ref) ? 0 : ref + 1; + icxRef = InterlockedCompareExchange(&gOvsSwitchContextRefCount, + newRef, + ref); + } while (icxRef != ref); + + if (ref != 0) { + ret = TRUE; + } + + return ret; +} + +/* + * -------------------------------------------------------------------------- + * This function activates the switch by initializing it with all the runtime + * state. First it queries all of the MAC addresses set as custom switch policy + * to allow sends from, and adds tme to the property list. Then it queries the + * NIC list and verifies it can support all of the NICs currently connected to + * the switch, and adds the NICs to the NIC list. + * -------------------------------------------------------------------------- + */ +static NDIS_STATUS +OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext) +{ + NDIS_STATUS status; + + ASSERT(!switchContext->isActivated); + + OVS_LOG_TRACE("Enter: activate switch %p, dpNo: %ld", + switchContext, switchContext->dpNo); + + status = OvsAddConfiguredSwitchPorts(switchContext); + + if (status != NDIS_STATUS_SUCCESS) { + OVS_LOG_WARN("Failed to add configured switch ports"); + goto cleanup; + + } + status = OvsInitConfiguredSwitchNics(switchContext); + + if (status != NDIS_STATUS_SUCCESS) { + OVS_LOG_WARN("Failed to add configured vports"); + OvsClearAllSwitchVports(switchContext); + goto cleanup; + } + switchContext->isActivated = TRUE; + OvsPostEvent(OVS_DEFAULT_PORT_NO, OVS_DEFAULT_EVENT_STATUS); + +cleanup: + OVS_LOG_TRACE("Exit: activate switch:%p, isActivated: %s, status = %lx", + switchContext, + (switchContext->isActivated ? "TRUE" : "FALSE"), status); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * Implements filter driver's FilterNetPnPEvent function. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsExtNetPnPEvent(NDIS_HANDLE filterModuleContext, + PNET_PNP_EVENT_NOTIFICATION netPnPEvent) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + POVS_SWITCH_CONTEXT switchContext = (POVS_SWITCH_CONTEXT)filterModuleContext; + BOOLEAN switchActive; + + OVS_LOG_TRACE("Enter: filterModuleContext: %p, NetEvent: %d", + filterModuleContext, (netPnPEvent->NetPnPEvent).NetEvent); + /* + * The only interesting event is the NetEventSwitchActivate. It provides + * an asynchronous notification of the switch completing activation. + */ + if (netPnPEvent->NetPnPEvent.NetEvent == NetEventSwitchActivate) { + status = OvsQuerySwitchActivationComplete(switchContext, &switchActive); + if (status != NDIS_STATUS_SUCCESS) { + switchContext->isActivateFailed = TRUE; + } else { + ASSERT(switchContext->isActivated == FALSE); + if (switchContext->isActivated == FALSE && switchActive == TRUE) { + status = OvsActivateSwitch(switchContext); + OVS_LOG_TRACE("OvsExtNetPnPEvent: activated switch: %p " + "status: %s", switchContext, + status ? "TRUE" : "FALSE"); + } + } + } + + if (status == NDIS_STATUS_SUCCESS) { + status = NdisFNetPnPEvent(switchContext->NdisFilterHandle, + netPnPEvent); + } + OVS_LOG_TRACE("Exit: OvsExtNetPnPEvent"); + + return status; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Switch.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Switch.h --- openvswitch-2.3.1/datapath-windows/ovsext/Switch.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Switch.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file contains the definition of the switch object for the OVS. + */ + +#ifndef __SWITCH_H_ +#define __SWITCH_H_ 1 + +#include "NetProto.h" +#include "BufferMgmt.h" +#include "TunnelIntf.h" +#define OVS_MAX_VPORT_ARRAY_SIZE 1024 +#define OVS_MAX_PID_ARRAY_SIZE 1024 + +#define OVS_VPORT_MASK (OVS_MAX_VPORT_ARRAY_SIZE - 1) +#define OVS_PID_MASK (OVS_MAX_PID_ARRAY_SIZE - 1) + +#define OVS_INTERNAL_VPORT_DEFAULT_INDEX 0 + +//Tunnel port indicies +#define RESERVED_START_INDEX1 1 +#define OVS_TUNNEL_INDEX_START RESERVED_START_INDEX1 +#define OVS_VXLAN_VPORT_INDEX 2 +#define OVS_GRE_VPORT_INDEX 3 +#define OVS_GRE64_VPORT_INDEX 4 +#define OVS_TUNNEL_INDEX_END OVS_GRE64_VPORT_INDEX + +#define OVS_MAX_PHYS_ADAPTERS 32 +#define OVS_MAX_IP_VPOR 32 + +#define OVS_HASH_BASIS 0x13578642 + +typedef struct _OVS_VPORT_ENTRY *POVS_VPORT_ENTRY; + +typedef struct _OVS_DATAPATH +{ + PLIST_ENTRY flowTable; // Contains OvsFlows. + UINT32 nFlows; // Number of entries in flowTable. + + // List_Links queues[64]; // Hash table of queue IDs. + + /* Statistics. */ + UINT64 hits; // Number of flow table hits. + UINT64 misses; // Number of flow table misses. + UINT64 lost; // Number of dropped misses. + + /* Used to protect the flows in the flowtable. */ + PNDIS_RW_LOCK_EX lock; +} OVS_DATAPATH, *POVS_DATAPATH; + +/* + * OVS_SWITCH_CONTEXT + * + * The context allocated per switch., For OVS, we only + * support one switch which corresponding to one datapath. + * Each datapath can have multiple logical bridges configured + * which is maintained by vswitchd. + */ + +typedef enum OVS_SWITCH_DATAFLOW_STATE +{ + OvsSwitchPaused, + OvsSwitchRunning +} OVS_SWITCH_DATAFLOW_STATE, *POVS_SWITCH_DATAFLOW_STATE; + +typedef enum OVS_SWITCH_CONTROFLOW_STATE +{ + OvsSwitchUnknown, + OvsSwitchAttached, + OvsSwitchDetached +} OVS_SWITCH_CONTROLFLOW_STATE, *POVS_SWITCH_CONTROLFLOW_STATE; + +// XXX: Take care of alignment and grouping members by cacheline +typedef struct _OVS_SWITCH_CONTEXT +{ + /* Coarse and fine-grained switch states. */ + OVS_SWITCH_DATAFLOW_STATE dataFlowState; + OVS_SWITCH_CONTROLFLOW_STATE controlFlowState; + BOOLEAN isActivated; + BOOLEAN isActivateFailed; + + UINT32 dpNo; + + /* + * 'virtualExternalVport' represents default external interface. This is + * a virtual interface. The friendly name of such an interface has + * been observed to be: "Microsoft Default External Interface". This NIC + * has 'NicIndex' == 0. + * + * The "real" physical external NIC has 'NicIndex' > 0. For each + * external interface, virtual or physical, NDIS gives an NIC level + * OID callback. Note that, even though there are multile "NICs", + * there's only one underlying Hyper-V port. Thus, we get a single + * NDIS port-level callback, but multiple NDIS NIC-level callbacks. + * + * The virtual external NIC can be accessed at 'virtualExternalVport', and + * is assigned the name "external.defaultAdapter". The virtual external + * NIC is not inserted into the 'portIdHashArray' since the port must not + * be exposed to OVS userspace. + * + * The physical external NICs are assigned names "external.%INDEX%", + * where '%INDEX%' represents the 'NicIndex' of the NIC. + * + * While adding a physical external NIC in OvsInitConfiguredSwitchNics(), + * some required properties of the vport are available only at the + * NDIS port-level. So, these are copied from 'virtualExternalVport'. + * The vport created for the physical external NIC is inserted into the + * 'portIdHashArray'. + * + * When the virtual external NIC is torn down or deleted, the + * corresponding physical external ports are also torn down or + * deleted. The number of physical external NICs is tracked by + * 'numPhysicalNics'. + */ + NDIS_SWITCH_PORT_ID virtualExternalPortId; + NDIS_SWITCH_PORT_ID internalPortId; + POVS_VPORT_ENTRY virtualExternalVport; // the virtual adapter vport + POVS_VPORT_ENTRY internalVport; + + /* + * 'portIdHashArray' ONLY contains ports that exist on the Hyper-V switch, + * namely: VIF (vNIC) ports, external port and Hyper-V internal port. + * 'numHvVports' counts the ports in 'portIdHashArray'. If a port got + * deleted on the Hyper-V switch, it gets deleted from 'portIdHashArray'. + * The port itself will not get deallocated if it has been added from OVS + * userspace. 'numHvVports' is decremented when the port is deallocated. + * + * 'portNoHashArray' ONLY contains ports that are added from OVS userspace, + * regardless of whether that port exists on the Hyper-V switch or not. + * Tunnel ports and bridge-internal ports are examples of ports that do not + * exist on the Hyper-V switch, and 'numNonHvVports' counts such ports in + * 'portNoHashArray'. + * + * 'tunnelVportsArray' contains tunnel ports that are added from OVS + * userspace. Currently only VXLAN tunnels are added in this list. + * + * 'ovsPortNameHashArray' contains the same entries as 'portNoHashArray' but + * hashed on a different key. + */ + PLIST_ENTRY portIdHashArray; // based on Hyper-V portId + PLIST_ENTRY portNoHashArray; // based on ovs port number + PLIST_ENTRY tunnelVportsArray; // based on ovs dst port number + PLIST_ENTRY ovsPortNameHashArray; // based on ovsName + PLIST_ENTRY pidHashArray; // based on packet pids + NDIS_SPIN_LOCK pidHashLock; // Lock for pidHash table + + UINT32 numPhysicalNics; // the number of physical + // external NICs. + UINT32 numHvVports; + UINT32 numNonHvVports; + + /* Lock taken over the switch. This protects the ports on the switch. */ + PNDIS_RW_LOCK_EX dispatchLock; + + /* The flowtable. */ + OVS_DATAPATH datapath; + + /* Handle to the OVSExt filter driver. Same as 'gOvsExtDriverHandle'. */ + NDIS_HANDLE NdisFilterHandle; + + /* Handle and callbacks exposed by the underlying hyper-v switch. */ + NDIS_SWITCH_CONTEXT NdisSwitchContext; + NDIS_SWITCH_OPTIONAL_HANDLERS NdisSwitchHandlers; + + volatile LONG pendingInjectedNblCount; + volatile LONG pendingOidCount; + + OVS_NBL_POOL ovsPool; +} OVS_SWITCH_CONTEXT, *POVS_SWITCH_CONTEXT; + + +static __inline VOID +OvsAcquireDatapathRead(OVS_DATAPATH *datapath, + LOCK_STATE_EX *lockState, + BOOLEAN dispatch) +{ + ASSERT(datapath); + NdisAcquireRWLockRead(datapath->lock, lockState, + dispatch ? NDIS_RWL_AT_DISPATCH_LEVEL : 0); +} + +static __inline VOID +OvsAcquireDatapathWrite(OVS_DATAPATH *datapath, + LOCK_STATE_EX *lockState, + BOOLEAN dispatch) +{ + ASSERT(datapath); + NdisAcquireRWLockWrite(datapath->lock, lockState, + dispatch ? NDIS_RWL_AT_DISPATCH_LEVEL : 0); +} + +static __inline VOID +OvsReleaseDatapath(OVS_DATAPATH *datapath, + LOCK_STATE_EX *lockState) +{ + ASSERT(datapath); + NdisReleaseRWLock(datapath->lock, lockState); +} + +BOOLEAN +OvsAcquireSwitchContext(VOID); + +VOID +OvsReleaseSwitchContext(POVS_SWITCH_CONTEXT switchContext); + +#endif /* __SWITCH_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Tunnel.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Tunnel.c --- openvswitch-2.3.1/datapath-windows/ovsext/Tunnel.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Tunnel.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,348 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * OvsTunnel.c + * WFP Classified callback function and Action code for injecting a packet to the vswitch + */ + +#include "precomp.h" + +#pragma warning(push) +#pragma warning(disable:4201) // unnamed struct/union +#include +#pragma warning(pop) + +#pragma warning( push ) +#pragma warning( disable:4127 ) + +#include +#include "Tunnel.h" +#include "Switch.h" +#include "Vport.h" +#include "Event.h" +#include "User.h" +#include "Vxlan.h" +#include "PacketIO.h" +#include "NetProto.h" +#include "Flow.h" + +extern POVS_SWITCH_CONTEXT gOvsSwitchContext; + +static NTSTATUS +OvsInjectPacketThroughActions(PNET_BUFFER_LIST pNbl, + OVS_TUNNEL_PENDED_PACKET *packet); + +VOID OvsAcquireDatapathRead(OVS_DATAPATH *datapath, + LOCK_STATE_EX *lockState, + BOOLEAN dispatch); +VOID OvsAcquireDatapathWrite(OVS_DATAPATH *datapath, + LOCK_STATE_EX *lockState, + BOOLEAN dispatch); +VOID OvsReleaseDatapath(OVS_DATAPATH *datapath, + LOCK_STATE_EX *lockState); + + +NTSTATUS +OvsTunnelNotify(FWPS_CALLOUT_NOTIFY_TYPE notifyType, + const GUID *filterKey, + const FWPS_FILTER *filter) +{ + UNREFERENCED_PARAMETER(notifyType); + UNREFERENCED_PARAMETER(filterKey); + UNREFERENCED_PARAMETER(filter); + + return STATUS_SUCCESS; +} + +static NTSTATUS +OvsTunnelAnalyzePacket(OVS_TUNNEL_PENDED_PACKET *packet) +{ + NTSTATUS status = STATUS_SUCCESS; + UINT32 packetLength = 0; + ULONG bytesCopied = 0; + NET_BUFFER_LIST *copiedNBL = NULL; + NET_BUFFER *netBuffer; + NDIS_STATUS ndisStatus; + + /* + * For inbound net buffer list, we can assume it contains only one + * net buffer (unless it was an re-assembeled fragments). in both cases + * the first net buffer should include all headers, we assert if the retreat fails + */ + netBuffer = NET_BUFFER_LIST_FIRST_NB(packet->netBufferList); + + /* Drop the packet from the host stack */ + packet->classifyOut->actionType = FWP_ACTION_BLOCK; + packet->classifyOut->rights &= ~FWPS_RIGHT_ACTION_WRITE; + + /* Adjust the net buffer list offset to the start of the IP header */ + ndisStatus = NdisRetreatNetBufferDataStart(netBuffer, + packet->ipHeaderSize + + packet->transportHeaderSize, + 0, NULL); + ASSERT(ndisStatus == NDIS_STATUS_SUCCESS); + + /* Single NBL element for WFP */ + ASSERT(packet->netBufferList->Next == NULL); + + /* Note that the copy will inherit the original net buffer list's offset */ + packetLength = NET_BUFFER_DATA_LENGTH(netBuffer); + copiedNBL = OvsAllocateVariableSizeNBL(gOvsSwitchContext, packetLength, + OVS_DEFAULT_HEADROOM_SIZE); + + if (copiedNBL == NULL) { + goto analyzeDone; + } + + status = NdisCopyFromNetBufferToNetBuffer(NET_BUFFER_LIST_FIRST_NB(copiedNBL), + 0, packetLength, + netBuffer, 0, &bytesCopied); + if (status != NDIS_STATUS_SUCCESS || packetLength != bytesCopied) { + goto analyzeFreeNBL; + } + + status = OvsInjectPacketThroughActions(copiedNBL, + packet); + goto analyzeDone; + + /* Undo the adjustment on the original net buffer list */ +analyzeFreeNBL: + OvsCompleteNBL(gOvsSwitchContext, copiedNBL, TRUE); +analyzeDone: + NdisAdvanceNetBufferDataStart(netBuffer, + packet->transportHeaderSize + packet->ipHeaderSize, + FALSE, + NULL); + return status; +} + + +/* + * -------------------------------------------------------------------------- + * This is the classifyFn function of the datagram-data callout. It + * allocates a packet structure to store the classify and meta data and + * it references the net buffer list for out-of-band modification and + * re-injection. The packet structure will be queued to the global packet + * queue. The worker thread will then be signaled, if idle, to process + * the queue. + * -------------------------------------------------------------------------- + */ +VOID +OvsTunnelClassify(const FWPS_INCOMING_VALUES *inFixedValues, + const FWPS_INCOMING_METADATA_VALUES *inMetaValues, + VOID *layerData, + const VOID *classifyContext, + const FWPS_FILTER *filter, + UINT64 flowContext, + FWPS_CLASSIFY_OUT *classifyOut) +{ + OVS_TUNNEL_PENDED_PACKET packetStorage; + OVS_TUNNEL_PENDED_PACKET *packet = &packetStorage; + FWP_DIRECTION direction; + + UNREFERENCED_PARAMETER(classifyContext); + UNREFERENCED_PARAMETER(filter); + UNREFERENCED_PARAMETER(flowContext); + + ASSERT(layerData != NULL); + + /* We don't have the necessary right to alter the packet flow */ + if ((classifyOut->rights & FWPS_RIGHT_ACTION_WRITE) == 0) { + /* XXX TBD revisit protect against other filters owning this packet */ + ASSERT(FALSE); + goto Exit; + } + + RtlZeroMemory(packet, sizeof(OVS_TUNNEL_PENDED_PACKET)); + + /* classifyOut cannot be accessed from a different thread context */ + packet->classifyOut = classifyOut; + + if (inFixedValues->layerId == FWPS_LAYER_DATAGRAM_DATA_V4) { + direction = + inFixedValues->incomingValue[FWPS_FIELD_DATAGRAM_DATA_V4_DIRECTION].\ + value.uint32; + } + else { + ASSERT(inFixedValues->layerId == FWPS_LAYER_DATAGRAM_DATA_V6); + direction = + inFixedValues->incomingValue[FWPS_FIELD_DATAGRAM_DATA_V6_DIRECTION].\ + value.uint32; + } + + packet->netBufferList = layerData; + + ASSERT(FWPS_IS_METADATA_FIELD_PRESENT(inMetaValues, + FWPS_METADATA_FIELD_COMPARTMENT_ID)); + + ASSERT(direction == FWP_DIRECTION_INBOUND); + + ASSERT(FWPS_IS_METADATA_FIELD_PRESENT( + inMetaValues, + FWPS_METADATA_FIELD_IP_HEADER_SIZE)); + ASSERT(FWPS_IS_METADATA_FIELD_PRESENT( + inMetaValues, + FWPS_METADATA_FIELD_TRANSPORT_HEADER_SIZE)); + + packet->ipHeaderSize = inMetaValues->ipHeaderSize; + packet->transportHeaderSize = inMetaValues->transportHeaderSize; + + ASSERT(inFixedValues->incomingValue[FWPS_FIELD_DATAGRAM_DATA_V4_IP_PROTOCOL].value.uint8 == IPPROTO_UDP ); + OvsTunnelAnalyzePacket(packet); + +Exit: + ; +} + + +static NTSTATUS +OvsInjectPacketThroughActions(PNET_BUFFER_LIST pNbl, + OVS_TUNNEL_PENDED_PACKET *packet) +{ + NTSTATUS status = STATUS_SUCCESS; + OvsIPv4TunnelKey tunnelKey; + NET_BUFFER *pNb; + ULONG sendCompleteFlags = 0; + BOOLEAN dispatch; + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO fwdDetail; + LOCK_STATE_EX lockState, dpLockState; + LIST_ENTRY missedPackets; + OvsCompletionList completionList; + KIRQL irql; + ULONG SendFlags = NDIS_SEND_FLAGS_SWITCH_DESTINATION_GROUP; + OVS_DATAPATH *datapath = NULL; + + ASSERT(gOvsSwitchContext); + datapath = &gOvsSwitchContext->datapath; + + /* Fill the tunnel key */ + status = OvsSlowPathDecapVxlan(pNbl, &tunnelKey); + + if(!NT_SUCCESS(status)) { + goto dropit; + } + + pNb = NET_BUFFER_LIST_FIRST_NB(pNbl); + + NdisAdvanceNetBufferDataStart(pNb, + packet->transportHeaderSize + packet->ipHeaderSize + + sizeof(VXLANHdr), + FALSE, + NULL); + + /* Most likely (always) dispatch irql */ + irql = KeGetCurrentIrql(); + + /* dispatch is used for datapath lock as well */ + dispatch = (irql == DISPATCH_LEVEL) ? NDIS_RWL_AT_DISPATCH_LEVEL : 0; + if (dispatch) { + sendCompleteFlags |= NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL; + } + + InitializeListHead(&missedPackets); + OvsInitCompletionList(&completionList, gOvsSwitchContext, + sendCompleteFlags); + + { + POVS_VPORT_ENTRY vport; + UINT32 portNo; + OVS_PACKET_HDR_INFO layers; + OvsFlowKey key; + UINT64 hash; + PNET_BUFFER curNb; + OvsFlow *flow; + + fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(pNbl); + + /* + * XXX WFP packets contain a single NBL structure. + * Reassembeled packet "may" have multiple NBs, however, a simple test shows + * that the packet still has a single NB (after reassemble) + * We still need to check if the Ethernet header of the innet packet is in a single MD + */ + + curNb = NET_BUFFER_LIST_FIRST_NB(pNbl); + ASSERT(curNb->Next == NULL); + + NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, dispatch); + + /* Lock the flowtable for the duration of accessing the flow */ + OvsAcquireDatapathRead(datapath, &dpLockState, NDIS_RWL_AT_DISPATCH_LEVEL); + + SendFlags |= NDIS_SEND_FLAGS_DISPATCH_LEVEL; + + vport = OvsFindTunnelVportByDstPort(gOvsSwitchContext, + htons(tunnelKey.dst_port), + OVS_VPORT_TYPE_VXLAN); + + if (vport == NULL){ + status = STATUS_UNSUCCESSFUL; + goto unlockAndDrop; + } + + ASSERT(vport->ovsType == OVS_VPORT_TYPE_VXLAN); + + portNo = vport->portNo; + + status = OvsExtractFlow(pNbl, portNo, &key, &layers, &tunnelKey); + if (status != NDIS_STATUS_SUCCESS) { + goto unlockAndDrop; + } + + flow = OvsLookupFlow(datapath, &key, &hash, FALSE); + if (flow) { + OvsFlowUsed(flow, pNbl, &layers); + datapath->hits++; + + OvsActionsExecute(gOvsSwitchContext, &completionList, pNbl, + portNo, SendFlags, &key, &hash, &layers, + flow->actions, flow->actionsLen); + + OvsReleaseDatapath(datapath, &dpLockState); + } else { + POVS_PACKET_QUEUE_ELEM elem; + + datapath->misses++; + elem = OvsCreateQueueNlPacket(NULL, 0, OVS_PACKET_CMD_MISS, + portNo, &key, pNbl, curNb, + TRUE, &layers); + if (elem) { + /* Complete the packet since it was copied to user buffer. */ + InsertTailList(&missedPackets, &elem->link); + OvsQueuePackets(&missedPackets, 1); + } else { + status = STATUS_INSUFFICIENT_RESOURCES; + } + goto unlockAndDrop; + } + + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + + } + + return status; + +unlockAndDrop: + OvsReleaseDatapath(datapath, &dpLockState); + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); +dropit: + pNbl = OvsCompleteNBL(gOvsSwitchContext, pNbl, TRUE); + ASSERT(pNbl == NULL); + return status; +} + +#pragma warning(pop) diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/TunnelFilter.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/TunnelFilter.c --- openvswitch-2.3.1/datapath-windows/ovsext/TunnelFilter.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/TunnelFilter.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1508 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" + +#pragma warning(push) +#pragma warning(disable:4201) // unnamed struct/union +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_TUNFLT +#include "Debug.h" + + +#include + +#pragma warning(pop) + +#include +#include +#include +#include + +#include "Tunnel.h" +#include "Switch.h" +#include "Vport.h" +#include "Event.h" +#include "User.h" +#include "Vxlan.h" + + +#define INITGUID +#include + +/* Infinite timeout */ +#define INFINITE 0xFFFFFFFF + +/* The provider name should always match the provider string from the install + * file. */ +#define OVS_TUNNEL_PROVIDER_NAME L"Open vSwitch" + +/* The provider description should always contain the OVS service description + * string from the install file. */ +#define OVS_TUNNEL_PROVIDER_DESC L"Open vSwitch Extension tunnel provider" + +/* The session name isn't required but it's useful for diagnostics. */ +#define OVS_TUNNEL_SESSION_NAME L"OVS tunnel session" + +/* Maximum number of tunnel threads to be created. */ +#define OVS_TUNFLT_MAX_THREADS 8 + +/* + * Callout and sublayer GUIDs + */ + +/* b16b0a6e-2b2a-41a3-8b39-bd3ffc855ff8 */ +DEFINE_GUID( + OVS_TUNNEL_CALLOUT_V4, + 0xb16b0a6e, + 0x2b2a, + 0x41a3, + 0x8b, 0x39, 0xbd, 0x3f, 0xfc, 0x85, 0x5f, 0xf8 + ); + +/* 0104fd7e-c825-414e-94c9-f0d525bbc169 */ +DEFINE_GUID( + OVS_TUNNEL_SUBLAYER, + 0x0104fd7e, + 0xc825, + 0x414e, + 0x94, 0xc9, 0xf0, 0xd5, 0x25, 0xbb, 0xc1, 0x69 + ); + +/* 6fc957d7-14e7-47c7-812b-4668be994ba1 */ +DEFINE_GUID( + OVS_TUNNEL_PROVIDER_KEY, + 0x6fc957d7, + 0x14e7, + 0x47c7, + 0x81, 0x2b, 0x46, 0x68, 0xbe, 0x99, 0x4b, 0xa1 + ); + +/* bfd4814c-9650-4de3-a536-1eedb9e9ba6a */ +DEFINE_GUID( + OVS_TUNNEL_FILTER_KEY, + 0xbfd4814c, + 0x9650, + 0x4de3, + 0xa5, 0x36, 0x1e, 0xed, 0xb9, 0xe9, 0xba, 0x6a + ); + +/* + * Callout driver type definitions + */ +typedef enum _OVS_TUNFLT_OPERATION { + OVS_TUN_FILTER_CREATE = 0, + OVS_TUN_FILTER_DELETE +} OVS_TUNFLT_OPERATION; + +typedef struct _OVS_TUNFLT_REQUEST { + LIST_ENTRY entry; + /* Tunnel filter destination port. */ + UINT16 port; + /* XXX: We also need to specify the tunnel L4 protocol, because there are + * different protocols that can use the same destination port.*/ + union { + /* Tunnel filter identification used for filter deletion. */ + UINT64 delID; + /* Pointer used to return filter ID to the caller on filter creation. */ + PUINT64 addID; + }filterID; + /* Requested operation to be performed. */ + OVS_TUNFLT_OPERATION operation; + /* Current I/O request to be completed when requested + * operation is finished. */ + PIRP irp; + /* Callback function called before completing the IRP. */ + PFNTunnelVportPendingOp callback; + /* Context passed to the callback function. */ + PVOID context; +} OVS_TUNFLT_REQUEST, *POVS_TUNFLT_REQUEST; + +typedef struct _OVS_TUNFLT_REQUEST_LIST { + /* SpinLock for syncronizing access to the requests list. */ + NDIS_SPIN_LOCK spinlock; + /* Head of the requests list. */ + LIST_ENTRY head; + /* Number of requests in the list. This variable is used by + * InterlockedCompareExchange function and needs to be aligned + * at 32-bit boundaries. */ + UINT32 numEntries; +} OVS_TUNFLT_REQUEST_LIST, *POVS_TUNFLT_REQUEST_LIST; + +typedef struct _OVS_TUNFLT_THREAD_CONTEXT { + /* Thread identification. */ + UINT threadID; + /* Thread's engine session handle. */ + HANDLE engineSession; + /* Reference of the thread object. */ + PVOID threadObject; + /* Requests queue list. */ + OVS_TUNFLT_REQUEST_LIST listRequests; + /* Event signaling that there are requests to process. */ + KEVENT requestEvent; + /* Event for stopping thread execution. */ + KEVENT stopEvent; +} OVS_TUNFLT_THREAD_CONTEXT, *POVS_TUNFLT_THREAD_CONTEXT; + +KSTART_ROUTINE OvsTunnelFilterThreadProc; + +static NTSTATUS OvsTunnelFilterStartThreads(); +static NTSTATUS OvsTunnelFilterThreadStart(POVS_TUNFLT_THREAD_CONTEXT threadCtx); +static VOID OvsTunnelFilterStopThreads(); +static VOID OvsTunnelFilterThreadStop(POVS_TUNFLT_THREAD_CONTEXT threadCtx, + BOOLEAN signalEvent); +static NTSTATUS OvsTunnelFilterThreadInit(POVS_TUNFLT_THREAD_CONTEXT threadCtx); +static VOID OvsTunnelFilterThreadUninit(POVS_TUNFLT_THREAD_CONTEXT threadCtx); + +/* + * Callout driver global variables + */ + +/* Pointer to the device object that must be create before we can register our + * callout to the base filtering engine. */ +static PDEVICE_OBJECT gDeviceObject = NULL; +/* Handle to an open session to the filter engine that is used for adding + * tunnel's callout. */ +static HANDLE gEngineHandle = NULL; +/* A pointer to the received handle that is associated with the registration of + * the OvsTunnelProviderBfeCallback callback. */ +static HANDLE gTunnelProviderBfeHandle = NULL; +/* A pointer to the received handle that is associated with the registration of + * the OvsTunnelInitBfeCallback callback. */ +static HANDLE gTunnelInitBfeHandle = NULL; +/* Runtime identifier for tunnel's callout which is retrieved at tunnel + * initialization phase when the callout is registered. This ID is then used + * for removing the callout object from the system at tunnel + * uninitialization phase. */ +static UINT32 gCalloutIdV4 = 0; +/* Array used for storing tunnel thread's private data. */ +static OVS_TUNFLT_THREAD_CONTEXT gTunnelThreadCtx[OVS_TUNFLT_MAX_THREADS] = { 0 }; + +/* + * Callout driver implementation. + */ + +NTSTATUS +OvsTunnelEngineOpen(HANDLE *engineSession) +{ + NTSTATUS status = STATUS_SUCCESS; + FWPM_SESSION session = { 0 }; + + /* + * Set an infinite wait timeout, so we don't have to handle FWP_E_TIMEOUT + * errors while waiting to acquire the transaction lock. + */ + session.txnWaitTimeoutInMSec = INFINITE; + + /* The authentication service should always be RPC_C_AUTHN_DEFAULT. */ + status = FwpmEngineOpen(NULL, + RPC_C_AUTHN_DEFAULT, + NULL, + &session, + engineSession); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to open filtering engine session, status: %x.", + status); + } + + return status; +} + +VOID +OvsTunnelEngineClose(HANDLE *engineSession) +{ + if (*engineSession) { + FwpmEngineClose(*engineSession); + *engineSession = NULL; + } +} + +VOID +OvsTunnelAddSystemProvider(HANDLE engineSession) +{ + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN inTransaction = FALSE; + FWPM_PROVIDER provider = { 0 }; + + do { + status = FwpmTransactionBegin(engineSession, 0); + if (!NT_SUCCESS(status)) { + break; + } + inTransaction = TRUE; + + memset(&provider, 0, sizeof(provider)); + provider.providerKey = OVS_TUNNEL_PROVIDER_KEY; + provider.displayData.name = OVS_TUNNEL_PROVIDER_NAME; + provider.displayData.description = OVS_TUNNEL_PROVIDER_DESC; + /* + * Since we always want the provider to be present, it's easiest to add + * it as persistent object during driver load. + */ + provider.flags = FWPM_PROVIDER_FLAG_PERSISTENT; + + status = FwpmProviderAdd(engineSession, + &provider, + NULL); + if (!NT_SUCCESS(status)) { + if (STATUS_FWP_ALREADY_EXISTS != status) { + OVS_LOG_ERROR("Failed to add WFP provider, status: %x.", + status); + break; + } + } + + status = FwpmTransactionCommit(engineSession); + if (!NT_SUCCESS(status)) { + break; + } + + inTransaction = FALSE; + } while (inTransaction); + + if (inTransaction){ + FwpmTransactionAbort(engineSession); + } +} + +VOID +OvsTunnelRemoveSystemProvider(HANDLE engineSession) +{ + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN inTransaction = FALSE; + + do { + status = FwpmTransactionBegin(engineSession, 0); + if (!NT_SUCCESS(status)) { + break; + } + inTransaction = TRUE; + + status = FwpmProviderDeleteByKey(engineSession, + &OVS_TUNNEL_PROVIDER_KEY); + if (!NT_SUCCESS(status)) { + break; + } + + status = FwpmTransactionCommit(engineSession); + if (!NT_SUCCESS(status)) { + break; + } + + inTransaction = FALSE; + } while (inTransaction); + + if (inTransaction){ + FwpmTransactionAbort(engineSession); + } +} + +NTSTATUS +OvsTunnelAddFilter(HANDLE engineSession, + PWSTR filterName, + const PWSTR filterDesc, + USHORT remotePort, + FWP_DIRECTION direction, + UINT64 context, + const GUID *filterKey, + const GUID *layerKey, + const GUID *calloutKey, + UINT64 *filterID) +{ + NTSTATUS status = STATUS_SUCCESS; + FWPM_FILTER filter = {0}; + FWPM_FILTER_CONDITION filterConditions[3] = {0}; + UINT conditionIndex; + + if (filterKey) { + filter.filterKey = *filterKey; + } + filter.layerKey = *layerKey; + filter.displayData.name = (wchar_t*)filterName; + filter.displayData.description = (wchar_t*)filterDesc; + + filter.action.type = FWP_ACTION_CALLOUT_TERMINATING; + filter.action.calloutKey = *calloutKey; + filter.filterCondition = filterConditions; + filter.subLayerKey = OVS_TUNNEL_SUBLAYER; + filter.weight.type = FWP_EMPTY; // auto-weight. + filter.rawContext = context; + + conditionIndex = 0; + + filterConditions[conditionIndex].fieldKey = FWPM_CONDITION_DIRECTION; + filterConditions[conditionIndex].matchType = FWP_MATCH_EQUAL; + filterConditions[conditionIndex].conditionValue.type = FWP_UINT32; + filterConditions[conditionIndex].conditionValue.uint32 = direction; + + conditionIndex++; + + filterConditions[conditionIndex].fieldKey = FWPM_CONDITION_IP_LOCAL_PORT; + filterConditions[conditionIndex].matchType = FWP_MATCH_EQUAL; + filterConditions[conditionIndex].conditionValue.type = FWP_UINT16; + filterConditions[conditionIndex].conditionValue.uint16 = remotePort; + + conditionIndex++; + + filter.numFilterConditions = conditionIndex; + + status = FwpmFilterAdd(engineSession, + &filter, + NULL, + filterID); + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function registers callouts for intercepting UDP traffic at WFP + * FWPM_LAYER_DATAGRAM_DATA_V4 layer. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsTunnelRegisterDatagramDataCallouts(const GUID *layerKey, + const GUID *calloutKey, + VOID *deviceObject, + UINT32 *calloutId) +{ + NTSTATUS status = STATUS_SUCCESS; + + FWPS_CALLOUT sCallout = {0}; + FWPM_CALLOUT mCallout = {0}; + + FWPM_DISPLAY_DATA displayData = {0}; + + BOOLEAN calloutRegistered = FALSE; + + sCallout.calloutKey = *calloutKey; + sCallout.classifyFn = OvsTunnelClassify; + sCallout.notifyFn = OvsTunnelNotify; +#if FLOW_CONTEXT + /* Currently we don't associate a context with the flow */ + sCallout.flowDeleteFn = OvsTunnelFlowDelete; + sCallout.flags = FWP_CALLOUT_FLAG_CONDITIONAL_ON_FLOW; +#endif + + status = FwpsCalloutRegister(deviceObject, &sCallout, calloutId); + if (!NT_SUCCESS(status)) { + goto Exit; + } + calloutRegistered = TRUE; + + displayData.name = L"Datagram-Data OVS Callout"; + displayData.description = L"Proxies destination address/port for UDP"; + + mCallout.calloutKey = *calloutKey; + mCallout.displayData = displayData; + mCallout.applicableLayer = *layerKey; + + status = FwpmCalloutAdd(gEngineHandle, &mCallout, NULL, NULL); + if (!NT_SUCCESS(status)) { + if (STATUS_FWP_ALREADY_EXISTS != status) { + OVS_LOG_ERROR("Failed to add WFP callout, status: %x.", + status); + goto Exit; + } + status = STATUS_SUCCESS; + } + +Exit: + + if (!NT_SUCCESS(status)){ + if (calloutRegistered) { + FwpsCalloutUnregisterById(*calloutId); + *calloutId = 0; + } + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function registers non-dynamic callouts for intercepting UDP traffic. + * Callouts will be removed during un-initializing phase. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsTunnelRegisterCallouts(VOID *deviceObject) +{ + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN inTransaction = FALSE; + FWPM_SUBLAYER OvsTunnelSubLayer; + + status = FwpmTransactionBegin(gEngineHandle, 0); + if (!NT_SUCCESS(status)) { + goto Exit; + } + inTransaction = TRUE; + + RtlZeroMemory(&OvsTunnelSubLayer, sizeof(FWPM_SUBLAYER)); + + OvsTunnelSubLayer.subLayerKey = OVS_TUNNEL_SUBLAYER; + OvsTunnelSubLayer.displayData.name = L"Datagram-Data OVS Sub-Layer"; + OvsTunnelSubLayer.displayData.description = + L"Sub-Layer for use by Datagram-Data OVS callouts"; + OvsTunnelSubLayer.flags = 0; + OvsTunnelSubLayer.weight = FWP_EMPTY; /* auto-weight */ + + status = FwpmSubLayerAdd(gEngineHandle, &OvsTunnelSubLayer, NULL); + if (!NT_SUCCESS(status)) { + if (STATUS_FWP_ALREADY_EXISTS != status) { + OVS_LOG_ERROR("Failed to add WFP sublayer, status: %x.", + status); + goto Exit; + } + } + + /* In order to use this callout a socket must be opened. */ + status = OvsTunnelRegisterDatagramDataCallouts(&FWPM_LAYER_DATAGRAM_DATA_V4, + &OVS_TUNNEL_CALLOUT_V4, + deviceObject, + &gCalloutIdV4); + if (!NT_SUCCESS(status)) { + goto Exit; + } + + status = FwpmTransactionCommit(gEngineHandle); + if (!NT_SUCCESS(status)){ + goto Exit; + } + inTransaction = FALSE; + +Exit: + + if (!NT_SUCCESS(status)) { + if (inTransaction) { + FwpmTransactionAbort(gEngineHandle); + } + } + + return status; +} + +VOID +OvsTunnelUnregisterCallouts() +{ + FwpsCalloutUnregisterById(gCalloutIdV4); + FwpmSubLayerDeleteByKey(gEngineHandle, &OVS_TUNNEL_SUBLAYER); + FwpmCalloutDeleteById(gEngineHandle, gCalloutIdV4); +} + +VOID +OvsTunnelFilterUninitialize(PDRIVER_OBJECT driverObject) +{ + UNREFERENCED_PARAMETER(driverObject); + + OvsTunnelFilterStopThreads(); + + OvsTunnelUnregisterCallouts(); + OvsTunnelEngineClose(&gEngineHandle); + + if (gDeviceObject) { + IoDeleteDevice(gDeviceObject); + } +} + + +NTSTATUS +OvsTunnelFilterInitialize(PDRIVER_OBJECT driverObject) +{ + NTSTATUS status = STATUS_SUCCESS; + UNICODE_STRING deviceName; + + RtlInitUnicodeString(&deviceName, + L"\\Device\\OvsTunnelFilter"); + + status = IoCreateDevice(driverObject, + 0, + &deviceName, + FILE_DEVICE_NETWORK, + 0, + FALSE, + &gDeviceObject); + + if (!NT_SUCCESS(status)){ + OVS_LOG_ERROR("Failed to create tunnel filter device, status: %x.", + status); + goto Exit; + } + + status = OvsTunnelFilterStartThreads(); + if (!NT_SUCCESS(status)){ + goto Exit; + } + + status = OvsTunnelEngineOpen(&gEngineHandle); + if (!NT_SUCCESS(status)){ + goto Exit; + } + + status = OvsTunnelRegisterCallouts(gDeviceObject); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to register callout, status: %x.", + status); + } + +Exit: + + if (!NT_SUCCESS(status)){ + OvsTunnelFilterUninitialize(driverObject); + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function adds OVS system provider to the system if the BFE (Base + * Filtering Engine) is running. + * -------------------------------------------------------------------------- + */ +VOID NTAPI +OvsTunnelProviderBfeCallback(PVOID context, + FWPM_SERVICE_STATE bfeState) +{ + HANDLE engineSession = NULL; + + DBG_UNREFERENCED_PARAMETER(context); + + if (FWPM_SERVICE_RUNNING == bfeState) { + OvsTunnelEngineOpen(&engineSession); + if (engineSession) { + OvsTunnelAddSystemProvider(engineSession); + } + OvsTunnelEngineClose(&engineSession); + } +} + +/* + * -------------------------------------------------------------------------- + * This function registers the OvsTunnelProviderBfeCallback callback that is + * called whenever there is a change to the state of base filtering engine. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsSubscribeTunnelProviderBfeStateChanges(PVOID deviceObject) +{ + NTSTATUS status = STATUS_SUCCESS; + + if (!gTunnelProviderBfeHandle) { + status = FwpmBfeStateSubscribeChanges(deviceObject, + OvsTunnelProviderBfeCallback, + NULL, + &gTunnelProviderBfeHandle); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR( + "Failed to subscribe BFE tunnel provider callback, status: %x.", + status); + } + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function unregisters the OvsTunnelProviderBfeCallback callback that + * was previously registered by OvsSubscribeTunnelProviderBfeStateChanges + * function. + * -------------------------------------------------------------------------- + */ +VOID +OvsUnsubscribeTunnelProviderBfeStateChanges() +{ + NTSTATUS status = STATUS_SUCCESS; + + if (gTunnelProviderBfeHandle) { + status = FwpmBfeStateUnsubscribeChanges(gTunnelProviderBfeHandle); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR( + "Failed to unsubscribe BFE tunnel provider callback, status: %x.", + status); + } + gTunnelProviderBfeHandle = NULL; + } +} + +/* + * -------------------------------------------------------------------------- + * This function registers the OVS system provider if the BFE (Base Filtering + * Engine) is running. + * Otherwise, it will register the OvsTunnelProviderBfeCallback callback. + + * Note: Before calling FwpmBfeStateGet, the callout driver must call the + * FwpmBfeStateSubscribeChanges function to register the callback function + * to be called whenever the state of the filter engine changes. + * + * Register WFP system provider call hierarchy: + * + * + * + * + * --> registers OvsTunnelProviderBfeCallback callback + * + * --> if BFE is running: + * + * --> if BFE is running: + * + * + * --> unregisters OvsTunnelProviderBfeCallback callback + * + * -------------------------------------------------------------------------- + */ +VOID +OvsRegisterSystemProvider(PVOID deviceObject) +{ + NTSTATUS status = STATUS_SUCCESS; + HANDLE engineSession = NULL; + + status = OvsSubscribeTunnelProviderBfeStateChanges(deviceObject); + if (NT_SUCCESS(status)) { + if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) { + OvsTunnelEngineOpen(&engineSession); + if (engineSession) { + OvsTunnelAddSystemProvider(engineSession); + } + OvsTunnelEngineClose(&engineSession); + + OvsUnsubscribeTunnelProviderBfeStateChanges(); + } + } +} + +/* + * -------------------------------------------------------------------------- + * This function removes the OVS system provider and unregisters the + * OvsTunnelProviderBfeCallback callback from BFE (Base Filtering Engine). + * + * Unregister WFP system provider call hierarchy: + * + * + * + * + * + * --> unregisters OvsTunnelProviderBfeCallback callback + * + * -------------------------------------------------------------------------- + */ +VOID +OvsUnregisterSystemProvider() +{ + HANDLE engineSession = NULL; + + OvsTunnelEngineOpen(&engineSession); + if (engineSession) { + OvsTunnelRemoveSystemProvider(engineSession); + } + OvsTunnelEngineClose(&engineSession); + + OvsUnsubscribeTunnelProviderBfeStateChanges(); +} + +/* + * -------------------------------------------------------------------------- + * This function initializes the tunnel filter if the BFE is running. + * -------------------------------------------------------------------------- + */ +VOID NTAPI +OvsTunnelInitBfeCallback(PVOID context, + FWPM_SERVICE_STATE bfeState) +{ + NTSTATUS status = STATUS_SUCCESS; + PDRIVER_OBJECT driverObject = (PDRIVER_OBJECT) context; + + if (FWPM_SERVICE_RUNNING == bfeState) { + status = OvsTunnelFilterInitialize(driverObject); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR( + "Failed to initialize tunnel filter, status: %x.", + status); + } + } +} + +/* + * -------------------------------------------------------------------------- + * This function registers the OvsTunnelInitBfeCallback callback that is + * called whenever there is a change to the state of base filtering engine. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsSubscribeTunnelInitBfeStateChanges(PDRIVER_OBJECT driverObject, + PVOID deviceObject) +{ + NTSTATUS status = STATUS_SUCCESS; + + if (!gTunnelInitBfeHandle) { + status = FwpmBfeStateSubscribeChanges(deviceObject, + OvsTunnelInitBfeCallback, + driverObject, + &gTunnelInitBfeHandle); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR( + "Failed to subscribe BFE tunnel init callback, status: %x.", + status); + } + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function unregisters the OvsTunnelInitBfeCallback callback that + * was previously registered by OvsSubscribeTunnelInitBfeStateChanges + * function. + * -------------------------------------------------------------------------- + */ +VOID +OvsUnsubscribeTunnelInitBfeStateChanges() +{ + NTSTATUS status = STATUS_SUCCESS; + + if (gTunnelInitBfeHandle) { + status = FwpmBfeStateUnsubscribeChanges(gTunnelInitBfeHandle); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR( + "Failed to unsubscribe BFE tunnel init callback, status: %x.", + status); + } + gTunnelInitBfeHandle = NULL; + } +} + +/* + * -------------------------------------------------------------------------- + * This function initializes the OVS tunnel filter if the BFE (Base Filtering + * Engine) is running. + * Otherwise, it will register the OvsTunnelInitBfeCallback callback. + + * Note: Before calling FwpmBfeStateGet, the callout driver must call the + * FwpmBfeStateSubscribeChanges function to register the callback function + * to be called whenever the state of the filter engine changes. + * + * Initialize OVS tunnel filter call hierarchy: + * + * + * + * + * --> registers OvsTunnelInitBfeCallback callback + * + * --> if BFE is running: + * + * + * + * + * --> if BFE is running: + * + * + * + * + * + * --> unregisters OvsTunnelInitBfeCallback callback + * + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsInitTunnelFilter(PDRIVER_OBJECT driverObject, PVOID deviceObject) +{ + NTSTATUS status = STATUS_SUCCESS; + + status = OvsSubscribeTunnelInitBfeStateChanges(driverObject, deviceObject); + if (NT_SUCCESS(status)) { + if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) { + status = OvsTunnelFilterInitialize(driverObject); + if (!NT_SUCCESS(status)) { + /* XXX: We need to decide what actions to take in case of + * failure to initialize tunnel filter. */ + ASSERT(status == NDIS_STATUS_SUCCESS); + OVS_LOG_ERROR( + "Failed to initialize tunnel filter, status: %x.", + status); + } + OvsUnsubscribeTunnelInitBfeStateChanges(); + } + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function uninitializes the OVS tunnel filter and unregisters the + * OvsTunnelInitBfeCallback callback from BFE. + * + * Uninitialize OVS tunnel filter call hierarchy: + * + * + * + * + * + * + * + * + * --> unregisters OvsTunnelInitBfeCallback callback + * + * -------------------------------------------------------------------------- + */ +VOID OvsUninitTunnelFilter(PDRIVER_OBJECT driverObject) +{ + OvsTunnelFilterUninitialize(driverObject); + OvsUnsubscribeTunnelInitBfeStateChanges(); +} + +NTSTATUS +OvsTunnelAddFilterEx(HANDLE engineSession, + UINT32 filterPort, + UINT64 *filterID) +{ + NTSTATUS status = STATUS_SUCCESS; + + status = OvsTunnelAddFilter(engineSession, + L"Datagram-Data OVS Filter (Inbound)", + L"address/port for UDP", + (USHORT)filterPort, + FWP_DIRECTION_INBOUND, + 0, + NULL, + &FWPM_LAYER_DATAGRAM_DATA_V4, + &OVS_TUNNEL_CALLOUT_V4, + filterID); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to add tunnel filter for port: %d, status: %x.", + filterPort, status); + } else { + OVS_LOG_INFO("Filter added, filter port: %d, filter ID: %d.", + filterPort, *filterID); + } + + return status; +} + +NTSTATUS +OvsTunnelRemoveFilterEx(HANDLE engineSession, + UINT64 filterID) +{ + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN error = TRUE; + + do { + if (filterID == 0) { + OVS_LOG_INFO("No tunnel filter to remove."); + break; + } + + status = FwpmFilterDeleteById(engineSession, filterID); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to remove tunnel with filter ID: %d,\ + status: %x.", filterID, status); + break; + } + OVS_LOG_INFO("Filter removed, filter ID: %d.", + filterID); + + error = FALSE; + } while (error); + + return status; +} + +NTSTATUS +OvsTunnelFilterExecuteAction(HANDLE engineSession, + POVS_TUNFLT_REQUEST request) +{ + NTSTATUS status = STATUS_SUCCESS; + + switch (request->operation) + { + case OVS_TUN_FILTER_CREATE: + status = OvsTunnelAddFilterEx(engineSession, + request->port, + request->filterID.addID); + break; + case OVS_TUN_FILTER_DELETE: + status = OvsTunnelRemoveFilterEx(engineSession, + request->filterID.delID); + break; + default: + status = STATUS_NOT_SUPPORTED; + break; + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function pops the whole request entries from the queue and returns the + * number of entries through the 'count' parameter. The operation is + * synchronized using request list spinlock. + * -------------------------------------------------------------------------- + */ +VOID +OvsTunnelFilterRequestPopList(POVS_TUNFLT_REQUEST_LIST listRequests, + PLIST_ENTRY head, + UINT32 *count) +{ + NdisAcquireSpinLock(&listRequests->spinlock); + + if (!IsListEmpty(&listRequests->head)) { + PLIST_ENTRY PrevEntry; + PLIST_ENTRY NextEntry; + + NextEntry = listRequests->head.Flink; + PrevEntry = listRequests->head.Blink; + + head->Flink = NextEntry; + NextEntry->Blink = head; + + head->Blink = PrevEntry; + PrevEntry->Flink = head; + + *count = listRequests->numEntries; + + InitializeListHead(&listRequests->head); + listRequests->numEntries = 0; + } + + NdisReleaseSpinLock(&listRequests->spinlock); +} + +/* + * -------------------------------------------------------------------------- + * This function pushes the received request to the list while holding the + * request list spinlock. + * -------------------------------------------------------------------------- + */ +VOID +OvsTunnelFilterRequestPush(POVS_TUNFLT_REQUEST_LIST listRequests, + POVS_TUNFLT_REQUEST request) +{ + NdisAcquireSpinLock(&listRequests->spinlock); + + InsertTailList(&listRequests->head, &(request->entry)); + listRequests->numEntries++; + + NdisReleaseSpinLock(&listRequests->spinlock); +} + +/* + * -------------------------------------------------------------------------- + * This function pushes the received request to the corresponding thread + * request queue. The arrival of the new request is signaled to the thread, + * in order to start processing it. + * + * For a uniform distribution of requests to thread queues, a thread index is + * calculated based on the received destination port. + * -------------------------------------------------------------------------- + */ +VOID +OvsTunnelFilterThreadPush(POVS_TUNFLT_REQUEST request) +{ + UINT32 threadIndex; + + threadIndex = request->port % OVS_TUNFLT_MAX_THREADS; + + OvsTunnelFilterRequestPush( + &gTunnelThreadCtx[threadIndex].listRequests, + request); + + KeSetEvent(&gTunnelThreadCtx[threadIndex].requestEvent, + IO_NO_INCREMENT, + FALSE); +} + +VOID +OvsTunnelFilterCompleteRequest(PIRP irp, + PFNTunnelVportPendingOp callback, + PVOID context, + NTSTATUS status) +{ + UINT32 replyLen = 0; + + if (callback) { + callback(context, status, &replyLen); + /* Release the context passed to the callback function. */ + OvsFreeMemory(context); + } + + if (irp) { + OvsCompleteIrpRequest(irp, (ULONG_PTR)replyLen, status); + } +} + +VOID +OvsTunnelFilterRequestListProcess(POVS_TUNFLT_THREAD_CONTEXT threadCtx) +{ + POVS_TUNFLT_REQUEST request = NULL; + PLIST_ENTRY link = NULL; + PLIST_ENTRY next = NULL; + LIST_ENTRY head; + NTSTATUS status = STATUS_SUCCESS; + UINT32 count = 0; + BOOLEAN inTransaction = FALSE; + BOOLEAN error = TRUE; + + do + { + if (!InterlockedCompareExchange( + (LONG volatile *)&threadCtx->listRequests.numEntries, 0, 0)) { + OVS_LOG_INFO("Nothing to do... request list is empty."); + break; + } + + status = FwpmTransactionBegin(threadCtx->engineSession, 0); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to start transaction, status: %x.", + status); + break; + } + inTransaction = TRUE; + + InitializeListHead(&head); + OvsTunnelFilterRequestPopList(&threadCtx->listRequests, &head, &count); + + LIST_FORALL_SAFE(&head, link, next) { + request = CONTAINING_RECORD(link, OVS_TUNFLT_REQUEST, entry); + + status = OvsTunnelFilterExecuteAction(threadCtx->engineSession, + request); + if (!NT_SUCCESS(status)) { + RemoveEntryList(&request->entry); + count--; + + /* Complete the IRP with the failure status. */ + OvsTunnelFilterCompleteRequest(request->irp, + request->callback, + request->context, + status); + OvsFreeMemory(request); + request = NULL; + } else { + error = FALSE; + } + } + + if (error) { + /* No successful requests were made, so there is no point to commit + * the transaction. */ + break; + } + + status = FwpmTransactionCommit(threadCtx->engineSession); + if (!NT_SUCCESS(status)){ + OVS_LOG_ERROR("Failed to commit transaction, status: %x.", + status); + break; + } + + inTransaction = FALSE; + } while (inTransaction); + + if (inTransaction) { + FwpmTransactionAbort(threadCtx->engineSession); + OVS_LOG_ERROR("Failed to execute request, status: %x.\ + Transaction aborted.", status); + } + + /* Complete the requests successfully executed with the transaction commit + * status. */ + while (count) { + request = (POVS_TUNFLT_REQUEST)RemoveHeadList(&head); + count--; + + OvsTunnelFilterCompleteRequest(request->irp, + request->callback, + request->context, + status); + OvsFreeMemory(request); + request = NULL; + } +} + +/* + *---------------------------------------------------------------------------- + * System thread routine that processes thread's requests queue. The thread + * routine initializes thread's necessary data and waits on two events, + * requestEvent and stopEvent. Whenever a request is pushed to the thread's + * queue, the requestEvent is signaled and the thread routine starts processing + * the arrived requests. When stopEvent is signaled, all subsequent requests + * are completed with STATUS_CANCELED, without being added to the thread's + * queue, and the routine finishes processing all existing requests from the + * queue before uninitializing the thread and exiting. + *---------------------------------------------------------------------------- + */ +_Use_decl_annotations_ +VOID +OvsTunnelFilterThreadProc(PVOID context) +{ + NTSTATUS status = STATUS_SUCCESS; + POVS_TUNFLT_THREAD_CONTEXT threadCtx = (POVS_TUNFLT_THREAD_CONTEXT)context; + PKEVENT eventArray[2] = { 0 }; + ULONG count = 0; + BOOLEAN exit = FALSE; + BOOLEAN error = TRUE; + + OVS_LOG_INFO("Starting OVS Tunnel system thread %d.", + threadCtx->threadID); + + eventArray[0] = &threadCtx->stopEvent; + eventArray[1] = &threadCtx->requestEvent; + count = ARRAY_SIZE(eventArray); + + do { + status = OvsTunnelFilterThreadInit(threadCtx); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to initialize tunnel filter thread %d.", + threadCtx->threadID); + break; + } + + do { + status = KeWaitForMultipleObjects(count, + (PVOID)eventArray, + WaitAny, + Executive, + KernelMode, + FALSE, + NULL, + NULL); + switch (status) { + case STATUS_WAIT_1: + /* Start processing requests. */ + OvsTunnelFilterRequestListProcess(threadCtx); + break; + default: + /* Finish processing the received requests and exit. */ + OvsTunnelFilterRequestListProcess(threadCtx); + exit = TRUE; + break; + } + } while (!exit); + + OvsTunnelFilterThreadUninit(threadCtx); + + error = FALSE; + } while (error); + + OVS_LOG_INFO("Terminating OVS Tunnel system thread %d.", + threadCtx->threadID); + + PsTerminateSystemThread(STATUS_SUCCESS); +}; + +static NTSTATUS +OvsTunnelFilterStartThreads() +{ + NTSTATUS status = STATUS_SUCCESS; + + for (UINT index = 0; index < OVS_TUNFLT_MAX_THREADS; index++) { + gTunnelThreadCtx[index].threadID = index; + + status = OvsTunnelFilterThreadStart(&gTunnelThreadCtx[index]); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to start tunnel filter thread %d.", index); + break; + } + } + + return status; +} + +static NTSTATUS +OvsTunnelFilterThreadStart(POVS_TUNFLT_THREAD_CONTEXT threadCtx) +{ + NTSTATUS status = STATUS_SUCCESS; + HANDLE threadHandle = NULL; + BOOLEAN error = TRUE; + + do { + status = PsCreateSystemThread(&threadHandle, + SYNCHRONIZE, + NULL, + NULL, + NULL, + OvsTunnelFilterThreadProc, + threadCtx); + if (!NT_SUCCESS(status)) { + OVS_LOG_ERROR("Failed to create tunnel thread, status: %x.", + status); + break; + } + + ObReferenceObjectByHandle(threadHandle, + SYNCHRONIZE, + NULL, + KernelMode, + &threadCtx->threadObject, + NULL); + ZwClose(threadHandle); + threadHandle = NULL; + + error = FALSE; + } while (error); + + return status; +} + +static VOID +OvsTunnelFilterStopThreads() +{ + /* Signal all threads to stop and ignore all subsequent requests. */ + for (UINT index = 0; index < OVS_TUNFLT_MAX_THREADS; index++) { + OvsTunnelFilterThreadStop(&gTunnelThreadCtx[index], TRUE); + } + + /* Wait for all threads to finish processing the requests. */ + for (UINT index = 0; index < OVS_TUNFLT_MAX_THREADS; index++) { + OvsTunnelFilterThreadStop(&gTunnelThreadCtx[index], FALSE); + } +} + +static VOID +OvsTunnelFilterThreadStop(POVS_TUNFLT_THREAD_CONTEXT threadCtx, + BOOLEAN signalEvent) +{ + if (signalEvent) { + /* Signal stop thread event. */ + OVS_LOG_INFO("Received stop event for OVS Tunnel system thread %d.", + threadCtx->threadID); + KeSetEvent(&threadCtx->stopEvent, IO_NO_INCREMENT, FALSE); + } else { + /* Wait for the tunnel thread to finish. */ + KeWaitForSingleObject(threadCtx->threadObject, + Executive, + KernelMode, + FALSE, + NULL); + + ObDereferenceObject(threadCtx->threadObject); + } +} + +/* + * -------------------------------------------------------------------------- + * This function initializes thread's necessary data. Each thread has its own + * session object to the BFE that is used for processing the requests from + * the thread's queue. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +OvsTunnelFilterThreadInit(POVS_TUNFLT_THREAD_CONTEXT threadCtx) +{ + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN error = TRUE; + + do { + /* Create thread's engine session object. */ + status = OvsTunnelEngineOpen(&threadCtx->engineSession); + if (!NT_SUCCESS(status)) { + break; + } + + NdisAllocateSpinLock(&threadCtx->listRequests.spinlock); + + InitializeListHead(&threadCtx->listRequests.head); + + KeInitializeEvent(&threadCtx->stopEvent, + NotificationEvent, + FALSE); + + KeInitializeEvent(&threadCtx->requestEvent, + SynchronizationEvent, + FALSE); + + error = FALSE; + } while (error); + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function uninitializes thread's private data. Thread's engine session + * handle is closed and set to NULL. + * -------------------------------------------------------------------------- + */ +static VOID +OvsTunnelFilterThreadUninit(POVS_TUNFLT_THREAD_CONTEXT threadCtx) +{ + if (threadCtx->engineSession) { + /* Close thread's FWPM session. */ + OvsTunnelEngineClose(&threadCtx->engineSession); + + NdisFreeSpinLock(&threadCtx->listRequests.spinlock); + } +} + +/* + * -------------------------------------------------------------------------- + * This function creates a new tunnel filter request and push it to a thread + * queue. If the thread stop event is signaled, the request is completed with + * STATUS_CANCELLED without pushing it to any queue. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsTunnelFilterQueueRequest(PIRP irp, + UINT16 remotePort, + UINT64 *filterID, + OVS_TUNFLT_OPERATION operation, + PFNTunnelVportPendingOp callback, + PVOID tunnelContext) +{ + POVS_TUNFLT_REQUEST request = NULL; + NTSTATUS status = STATUS_PENDING; + BOOLEAN error = TRUE; + UINT64 timeout = 0; + + do { + /* Verify if the stop event was signaled. */ + if (STATUS_SUCCESS == KeWaitForSingleObject( + &gTunnelThreadCtx[0].stopEvent, + Executive, + KernelMode, + FALSE, + (LARGE_INTEGER *)&timeout)) { + /* The stop event is signaled. Completed the IRP with + * STATUS_CANCELLED. */ + status = STATUS_CANCELLED; + break; + } + + if (NULL == filterID) { + OVS_LOG_ERROR("Invalid request."); + status = STATUS_INVALID_PARAMETER; + break; + } + + request = (POVS_TUNFLT_REQUEST) OvsAllocateMemory(sizeof(*request)); + if (NULL == request) { + OVS_LOG_ERROR("Failed to allocate list item."); + status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + + request->port = remotePort; + request->operation = operation; + switch (operation) { + case OVS_TUN_FILTER_CREATE: + request->filterID.addID = filterID; + break; + case OVS_TUN_FILTER_DELETE: + request->filterID.delID = *filterID; + break; + } + request->irp = irp; + request->callback = callback; + request->context = tunnelContext; + + OvsTunnelFilterThreadPush(request); + + error = FALSE; + } while (error); + + if (error) { + OvsTunnelFilterCompleteRequest(irp, callback, tunnelContext, status); + if (request) { + OvsFreeMemory(request); + request = NULL; + } + } + + return status; +} + +/* + * -------------------------------------------------------------------------- + * This function adds a new WFP filter for the received port and returns the + * ID of the created WFP filter. + * + * Note: + * All necessary calls to the WFP filtering engine must be running at IRQL = + * PASSIVE_LEVEL. Because the function is called at IRQL = DISPATCH_LEVEL, + * we register an OVS_TUN_FILTER_CREATE request that will be processed by + * the tunnel filter thread routine at IRQL = PASSIVE_LEVEL. + * + * OVS VXLAN port add call hierarchy: + * + * + * + * + * + * --> if thread STOP event is signalled: + * --> Complete request with STATUS_CANCELLED + * --> EXIT + * + * --> add the request to one of tunnel thread queues + * + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsTunelFilterCreate(PIRP irp, + UINT16 filterPort, + UINT64 *filterID, + PFNTunnelVportPendingOp callback, + PVOID tunnelContext) +{ + return OvsTunnelFilterQueueRequest(irp, + filterPort, + filterID, + OVS_TUN_FILTER_CREATE, + callback, + tunnelContext); +} + +/* + * -------------------------------------------------------------------------- + * This function removes a WFP filter using the received filter ID. + * + * Note: + * All necessary calls to the WFP filtering engine must be running at IRQL = + * PASSIVE_LEVEL. Because the function is called at IRQL = DISPATCH_LEVEL, + * we register an OVS_TUN_FILTER_DELETE request that will be processed by + * the tunnel filter thread routine at IRQL = PASSIVE_LEVEL. + * + * OVS VXLAN port delete call hierarchy: + * + * + * + * + * + * --> if thread STOP event is signalled: + * --> Complete request with STATUS_CANCELLED + * --> EXIT + * + * --> add the request to one of tunnel thread queues + * + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsTunelFilterDelete(PIRP irp, + UINT64 filterID, + PFNTunnelVportPendingOp callback, + PVOID tunnelContext) +{ + return OvsTunnelFilterQueueRequest(irp, + 0, + &filterID, + OVS_TUN_FILTER_DELETE, + callback, + tunnelContext); +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Tunnel.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Tunnel.h --- openvswitch-2.3.1/datapath-windows/ovsext/Tunnel.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Tunnel.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TUNNEL_H_ +#define __TUNNEL_H_ 1 + +// +// OVS_TUNNEL_PENDED_PACKET is the object type we used to store all information +// needed for out-of-band packet modification and re-injection. This type +// also points back to the flow context the packet belongs to. + +typedef struct OVS_TUNNEL_PENDED_PACKET_ +{ + /* Common fields for inbound and outbound traffic */ + NET_BUFFER_LIST *netBufferList; + + UINT32 ipHeaderSize; + UINT32 transportHeaderSize; + FWPS_CLASSIFY_OUT *classifyOut; +} OVS_TUNNEL_PENDED_PACKET; + +// +// Shared function prototypes +// +VOID OvsTunnelClassify(const FWPS_INCOMING_VALUES *inFixedValues, + const FWPS_INCOMING_METADATA_VALUES *inMetaValues, + VOID *layerData, + const VOID *classifyContext, + const FWPS_FILTER *filter, + UINT64 flowContext, + FWPS_CLASSIFY_OUT *classifyOut); + + +NTSTATUS OvsTunnelNotify(FWPS_CALLOUT_NOTIFY_TYPE notifyType, + const GUID *filterKey, + const FWPS_FILTER *filter); + +#endif /* __TUNNEL_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/TunnelIntf.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/TunnelIntf.h --- openvswitch-2.3.1/datapath-windows/ovsext/TunnelIntf.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/TunnelIntf.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TUNNEL_INTF_H_ +#define __TUNNEL_INTF_H_ 1 + +typedef VOID(*PFNTunnelVportPendingOp)(PVOID context, + NTSTATUS status, + UINT32 *replyLen); + +/* Tunnel callout driver load/unload functions */ +NTSTATUS OvsInitTunnelFilter(PDRIVER_OBJECT driverObject, PVOID deviceObject); + +VOID OvsUninitTunnelFilter(PDRIVER_OBJECT driverObject); + +VOID OvsRegisterSystemProvider(PVOID deviceObject); + +VOID OvsUnregisterSystemProvider(); + +NTSTATUS OvsTunelFilterCreate(PIRP irp, + UINT16 filterPort, + UINT64 *filterID, + PFNTunnelVportPendingOp callback, + PVOID context); + +NTSTATUS OvsTunelFilterDelete(PIRP irp, + UINT64 filterID, + PFNTunnelVportPendingOp callback, + PVOID context); + +#endif /* __TUNNEL_INTF_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Types.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Types.h --- openvswitch-2.3.1/datapath-windows/ovsext/Types.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Types.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TYPES_H_ +#define __TYPES_H_ 1 + +/* Defines the userspace specific data types + * for files included from user space. */ +typedef unsigned long long uint64, uint64_t, ovs_be64, u64; +typedef long long int64, int64_t; +typedef unsigned int uint32, uint32_t, ovs_be32, u32; +typedef unsigned short uint16, uint16_t, ovs_be16, u16; +typedef unsigned char uint8, uint8_t, u8; +typedef uint64 __u64, __be64; +typedef uint32 __u32, __be32; +typedef uint16 __u16, __be16; +typedef uint8 __u8; + +/* Defines the userspace specific data types for file + * included within kernel only. */ +typedef UINT8 BE8; +typedef UINT16 BE16; +typedef UINT32 BE32; +typedef UINT64 BE64; + +#define ETH_ALEN 6 + +#define SIZE_MAX MAXUINT32 + +#endif /* __TYPES_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/User.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/User.c --- openvswitch-2.3.1/datapath-windows/ovsext/User.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/User.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1156 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * OvsUser.c + * Manage packet queue for packet miss for userAction. + */ + + +#include "precomp.h" + +#include "Switch.h" +#include "Vport.h" +#include "Event.h" +#include "User.h" +#include "Datapath.h" +#include "PacketIO.h" +#include "Checksum.h" +#include "NetProto.h" +#include "Flow.h" +#include "TunnelIntf.h" +#include "Jhash.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_USER +#include "Debug.h" + +POVS_PACKET_QUEUE_ELEM OvsGetNextPacket(POVS_OPEN_INSTANCE instance); +extern PNDIS_SPIN_LOCK gOvsCtrlLock; +extern POVS_SWITCH_CONTEXT gOvsSwitchContext; +OVS_USER_STATS ovsUserStats; + +static VOID _MapNlAttrToOvsPktExec(PNL_ATTR *nlAttrs, PNL_ATTR *keyAttrs, + OvsPacketExecute *execute); +extern NL_POLICY nlFlowKeyPolicy[]; + +static __inline VOID +OvsAcquirePidHashLock() +{ + NdisAcquireSpinLock(&(gOvsSwitchContext->pidHashLock)); +} + +static __inline VOID +OvsReleasePidHashLock() +{ + NdisReleaseSpinLock(&(gOvsSwitchContext->pidHashLock)); +} + + +static VOID +OvsPurgePacketQueue(POVS_USER_PACKET_QUEUE queue, + POVS_OPEN_INSTANCE instance) +{ + PLIST_ENTRY link, next; + LIST_ENTRY tmp; + POVS_PACKET_QUEUE_ELEM elem; + + InitializeListHead(&tmp); + NdisAcquireSpinLock(&queue->queueLock); + if (queue->instance != instance) { + NdisReleaseSpinLock(&queue->queueLock); + return; + } + + if (queue->numPackets) { + OvsAppendList(&tmp, &queue->packetList); + queue->numPackets = 0; + } + NdisReleaseSpinLock(&queue->queueLock); + LIST_FORALL_SAFE(&tmp, link, next) { + RemoveEntryList(link); + elem = CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); + OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); + } +} + +VOID +OvsCleanupPacketQueue(POVS_OPEN_INSTANCE instance) +{ + POVS_USER_PACKET_QUEUE queue; + POVS_PACKET_QUEUE_ELEM elem; + PLIST_ENTRY link, next; + LIST_ENTRY tmp; + PIRP irp = NULL; + + ASSERT(instance); + InitializeListHead(&tmp); + queue = (POVS_USER_PACKET_QUEUE)instance->packetQueue; + if (queue) { + PDRIVER_CANCEL cancelRoutine; + NdisAcquireSpinLock(&queue->queueLock); + ASSERT(queue->instance == instance); + /* XXX Should not happen */ + if (queue->instance != instance) { + NdisReleaseSpinLock(&queue->queueLock); + NdisFreeSpinLock(&queue->queueLock); + return; + } + + if (queue->numPackets) { + OvsAppendList(&tmp, &queue->packetList); + queue->numPackets = 0; + } + queue->instance = NULL; + instance->packetQueue = NULL; + irp = queue->pendingIrp; + queue->pendingIrp = NULL; + if (irp) { + cancelRoutine = IoSetCancelRoutine(irp, NULL); + if (cancelRoutine == NULL) { + irp = NULL; + } + } + NdisReleaseSpinLock(&queue->queueLock); + NdisFreeSpinLock(&queue->queueLock); + } + LIST_FORALL_SAFE(&tmp, link, next) { + RemoveEntryList(link); + elem = CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); + OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); + } + if (irp) { + OvsCompleteIrpRequest(irp, 0, STATUS_SUCCESS); + } + if (queue) { + OvsFreeMemoryWithTag(queue, OVS_USER_POOL_TAG); + } + + /* Verify if gOvsSwitchContext exists. */ + if (gOvsSwitchContext) { + /* Remove the instance from pidHashArray */ + OvsAcquirePidHashLock(); + OvsDelPidInstance(gOvsSwitchContext, instance->pid); + OvsReleasePidHashLock(); + } +} + +NTSTATUS +OvsSubscribeDpIoctl(PVOID instanceP, + UINT32 pid, + UINT8 join) +{ + POVS_USER_PACKET_QUEUE queue; + POVS_OPEN_INSTANCE instance = (POVS_OPEN_INSTANCE)instanceP; + + if (instance->packetQueue && !join) { + /* unsubscribe */ + OvsCleanupPacketQueue(instance); + } else if (instance->packetQueue == NULL && join) { + queue = (POVS_USER_PACKET_QUEUE) OvsAllocateMemoryWithTag( + sizeof *queue, OVS_USER_POOL_TAG); + if (queue == NULL) { + return STATUS_NO_MEMORY; + } + InitializeListHead(&(instance->pidLink)); + instance->packetQueue = queue; + RtlZeroMemory(queue, sizeof (*queue)); + NdisAllocateSpinLock(&queue->queueLock); + NdisAcquireSpinLock(&queue->queueLock); + InitializeListHead(&queue->packetList); + queue->pid = pid; + queue->instance = instance; + instance->packetQueue = queue; + NdisReleaseSpinLock(&queue->queueLock); + + OvsAcquirePidHashLock(); + /* Insert the instance to pidHashArray */ + OvsAddPidInstance(gOvsSwitchContext, pid, instance); + OvsReleasePidHashLock(); + + } else { + /* user mode should call only once for subscribe */ + return STATUS_INVALID_PARAMETER; + } + + return STATUS_SUCCESS; +} + + +NTSTATUS +OvsReadDpIoctl(PFILE_OBJECT fileObject, + PVOID outputBuffer, + UINT32 outputLength, + UINT32 *replyLen) +{ + POVS_OPEN_INSTANCE instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + POVS_PACKET_QUEUE_ELEM elem; + UINT32 len; + +#define TCP_CSUM_OFFSET 16 +#define UDP_CSUM_OFFSET 6 + ASSERT(instance); + + if (instance->packetQueue == NULL) { + return STATUS_INVALID_PARAMETER; + } + if (outputLength < (sizeof (OVS_PACKET_INFO) + OVS_MIN_PACKET_SIZE)) { + return STATUS_BUFFER_TOO_SMALL; + } + + elem = OvsGetNextPacket(instance); + if (elem) { + /* + * XXX revisit this later + */ + len = elem->packet.totalLen > outputLength ? outputLength : + elem->packet.totalLen; + + if ((elem->hdrInfo.tcpCsumNeeded || elem->hdrInfo.udpCsumNeeded) && + len == elem->packet.totalLen) { + UINT16 sum, *ptr; + UINT16 size = (UINT16)(elem->packet.payload - elem->packet.data + + elem->hdrInfo.l4Offset); + RtlCopyMemory(outputBuffer, &elem->packet.data, size); + ASSERT(len - size >= elem->hdrInfo.l4PayLoad); + sum = CopyAndCalculateChecksum((UINT8 *)outputBuffer + size, + (UINT8 *)&elem->packet.data + size, + elem->hdrInfo.l4PayLoad, 0); + ptr =(UINT16 *)((UINT8 *)outputBuffer + size + + (elem->hdrInfo.tcpCsumNeeded ? + TCP_CSUM_OFFSET : UDP_CSUM_OFFSET)); + *ptr = sum; + ovsUserStats.l4Csum++; + } else { + RtlCopyMemory(outputBuffer, &elem->packet.data, len); + } + + *replyLen = len; + OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); + } + return STATUS_SUCCESS; +} + +/* Helper function to allocate a Forwarding Context for an NBL */ +NTSTATUS +OvsAllocateForwardingContextForNBL(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST nbl) +{ + return switchContext->NdisSwitchHandlers. + AllocateNetBufferListForwardingContext( + switchContext->NdisSwitchContext, nbl); +} + +/* + * -------------------------------------------------------------------------- + * This function allocates all the stuff necessary for creating an NBL from the + * input buffer of specified length, namely, a nonpaged data buffer of size + * length, an MDL from it, and a NB and NBL from it. It does not allocate an NBL + * context yet. It also copies data from the specified buffer to the NBL. + * -------------------------------------------------------------------------- + */ +PNET_BUFFER_LIST +OvsAllocateNBLForUserBuffer(POVS_SWITCH_CONTEXT switchContext, + PVOID userBuffer, + ULONG length) +{ + UINT8 *data = NULL; + PNET_BUFFER_LIST nbl = NULL; + PNET_BUFFER nb; + PMDL mdl; + + if (length > OVS_DEFAULT_DATA_SIZE) { + nbl = OvsAllocateVariableSizeNBL(switchContext, length, + OVS_DEFAULT_HEADROOM_SIZE); + + } else { + nbl = OvsAllocateFixSizeNBL(switchContext, length, + OVS_DEFAULT_HEADROOM_SIZE); + } + if (nbl == NULL) { + return NULL; + } + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + mdl = NET_BUFFER_CURRENT_MDL(nb); + data = (PUINT8)MmGetSystemAddressForMdlSafe(mdl, LowPagePriority) + + NET_BUFFER_CURRENT_MDL_OFFSET(nb); + if (!data) { + OvsCompleteNBL(switchContext, nbl, TRUE); + return NULL; + } + + NdisMoveMemory(data, userBuffer, length); + + return nbl; +} + +/* + *---------------------------------------------------------------------------- + * OvsNlExecuteCmdHandler -- + * Handler for OVS_PACKET_CMD_EXECUTE command. + *---------------------------------------------------------------------------- + */ +NTSTATUS +OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS status = STATUS_SUCCESS; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + PNL_MSG_HDR nlMsgHdr = &(msgIn->nlMsg); + PGENL_MSG_HDR genlMsgHdr = &(msgIn->genlMsg); + POVS_HDR ovsHdr = &(msgIn->ovsHdr); + + PNL_ATTR nlAttrs[__OVS_PACKET_ATTR_MAX]; + PNL_ATTR keyAttrs[__OVS_KEY_ATTR_MAX] = {NULL}; + + UINT32 attrOffset = NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN; + UINT32 keyAttrOffset = 0; + OvsPacketExecute execute; + NL_ERROR nlError = NL_ERROR_SUCCESS; + NL_BUFFER nlBuf; + + static const NL_POLICY nlPktExecPolicy[] = { + [OVS_PACKET_ATTR_PACKET] = {.type = NL_A_UNSPEC, .optional = FALSE}, + [OVS_PACKET_ATTR_KEY] = {.type = NL_A_UNSPEC, .optional = FALSE}, + [OVS_PACKET_ATTR_ACTIONS] = {.type = NL_A_UNSPEC, .optional = FALSE}, + [OVS_PACKET_ATTR_USERDATA] = {.type = NL_A_UNSPEC, .optional = TRUE}, + [OVS_PACKET_ATTR_EGRESS_TUN_KEY] = {.type = NL_A_UNSPEC, + .optional = TRUE} + }; + + RtlZeroMemory(&execute, sizeof(OvsPacketExecute)); + + /* Get all the top level Flow attributes */ + if ((NlAttrParse(nlMsgHdr, attrOffset, NlMsgAttrsLen(nlMsgHdr), + nlPktExecPolicy, nlAttrs, ARRAY_SIZE(nlAttrs))) + != TRUE) { + OVS_LOG_ERROR("Attr Parsing failed for msg: %p", + nlMsgHdr); + status = STATUS_UNSUCCESSFUL; + goto done; + } + + keyAttrOffset = (UINT32)((PCHAR)nlAttrs[OVS_PACKET_ATTR_KEY] - + (PCHAR)nlMsgHdr); + + /* Get flow keys attributes */ + if ((NlAttrParseNested(nlMsgHdr, keyAttrOffset, + NlAttrLen(nlAttrs[OVS_PACKET_ATTR_KEY]), + nlFlowKeyPolicy, keyAttrs, + ARRAY_SIZE(keyAttrs))) != TRUE) { + OVS_LOG_ERROR("Key Attr Parsing failed for msg: %p", nlMsgHdr); + status = STATUS_UNSUCCESSFUL; + goto done; + } + + execute.dpNo = ovsHdr->dp_ifindex; + + _MapNlAttrToOvsPktExec(nlAttrs, keyAttrs, &execute); + + status = OvsExecuteDpIoctl(&execute); + + /* Default reply that we want to send */ + if (status == STATUS_SUCCESS) { + BOOLEAN ok; + + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength); + + /* Prepare nl Msg headers */ + ok = NlFillOvsMsg(&nlBuf, nlMsgHdr->nlmsgType, 0, + nlMsgHdr->nlmsgSeq, nlMsgHdr->nlmsgPid, + genlMsgHdr->cmd, OVS_PACKET_VERSION, + ovsHdr->dp_ifindex); + + if (ok) { + *replyLen = msgOut->nlMsg.nlmsgLen; + } else { + status = STATUS_INVALID_BUFFER_SIZE; + } + } else { + /* Map NTSTATUS to NL_ERROR */ + nlError = NlMapStatusToNlErr(status); + + /* As of now there are no transactional errors in the implementation. + * Once we have them then we need to map status to correct + * nlError value, so that below mentioned code gets hit. */ + if ((nlError != NL_ERROR_SUCCESS) && + (usrParamsCtx->outputBuffer)) { + + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + status = STATUS_SUCCESS; + goto done; + } + } + +done: + return status; +} + +/* + *---------------------------------------------------------------------------- + * _MapNlAttrToOvsPktExec -- + * Maps input Netlink attributes to OvsPacketExecute. + *---------------------------------------------------------------------------- + */ +static VOID +_MapNlAttrToOvsPktExec(PNL_ATTR *nlAttrs, PNL_ATTR *keyAttrs, + OvsPacketExecute *execute) +{ + execute->packetBuf = NlAttrGet(nlAttrs[OVS_PACKET_ATTR_PACKET]); + execute->packetLen = NlAttrGetSize(nlAttrs[OVS_PACKET_ATTR_PACKET]); + + execute->actions = NlAttrGet(nlAttrs[OVS_PACKET_ATTR_ACTIONS]); + execute->actionsLen = NlAttrGetSize(nlAttrs[OVS_PACKET_ATTR_ACTIONS]); + + execute->inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]); +} + +NTSTATUS +OvsExecuteDpIoctl(OvsPacketExecute *execute) +{ + NTSTATUS status = STATUS_SUCCESS; + NTSTATUS ndisStatus; + LOCK_STATE_EX lockState; + PNET_BUFFER_LIST pNbl; + PNL_ATTR actions; + PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO fwdDetail; + OvsFlowKey key; + OVS_PACKET_HDR_INFO layers; + POVS_VPORT_ENTRY vport; + + if (execute->packetLen == 0) { + status = STATUS_INVALID_PARAMETER; + goto exit; + } + + actions = execute->actions; + + ASSERT(actions); + + /* + * Allocate the NBL, copy the data from the userspace buffer. Allocate + * also, the forwarding context for the packet. + */ + pNbl = OvsAllocateNBLForUserBuffer(gOvsSwitchContext, execute->packetBuf, + execute->packetLen); + if (pNbl == NULL) { + status = STATUS_NO_MEMORY; + goto exit; + } + + fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(pNbl); + vport = OvsFindVportByPortNo(gOvsSwitchContext, execute->inPort); + if (vport) { + fwdDetail->SourcePortId = vport->portId; + fwdDetail->SourceNicIndex = vport->nicIndex; + } else { + fwdDetail->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID; + fwdDetail->SourceNicIndex = 0; + } + // XXX: Figure out if any of the other members of fwdDetail need to be set. + + ndisStatus = OvsExtractFlow(pNbl, fwdDetail->SourcePortId, &key, &layers, + NULL); + if (ndisStatus == NDIS_STATUS_SUCCESS) { + NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0); + ndisStatus = OvsActionsExecute(gOvsSwitchContext, NULL, pNbl, + vport ? vport->portNo : + OVS_DEFAULT_PORT_NO, + NDIS_SEND_FLAGS_SWITCH_DESTINATION_GROUP, + &key, NULL, &layers, actions, + execute->actionsLen); + pNbl = NULL; + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + } + if (ndisStatus != NDIS_STATUS_SUCCESS) { + if (ndisStatus == NDIS_STATUS_NOT_SUPPORTED) { + status = STATUS_NOT_SUPPORTED; + } else { + status = STATUS_UNSUCCESSFUL; + } + } + + if (pNbl) { + OvsCompleteNBL(gOvsSwitchContext, pNbl, TRUE); + } +exit: + return status; +} + + +NTSTATUS +OvsPurgeDpIoctl(PFILE_OBJECT fileObject) +{ + POVS_OPEN_INSTANCE instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + POVS_USER_PACKET_QUEUE queue = (POVS_USER_PACKET_QUEUE)instance->packetQueue; + + if (queue == NULL) { + return STATUS_INVALID_PARAMETER; + } + OvsPurgePacketQueue(queue, instance); + return STATUS_SUCCESS; +} + +VOID +OvsCancelIrpDatapath(PDEVICE_OBJECT deviceObject, + PIRP irp) +{ + PIO_STACK_LOCATION irpSp; + PFILE_OBJECT fileObject; + POVS_OPEN_INSTANCE instance; + POVS_USER_PACKET_QUEUE queue = NULL; + + UNREFERENCED_PARAMETER(deviceObject); + + IoReleaseCancelSpinLock(irp->CancelIrql); + irpSp = IoGetCurrentIrpStackLocation(irp); + fileObject = irpSp->FileObject; + + if (fileObject == NULL) { + goto done; + } + NdisAcquireSpinLock(gOvsCtrlLock); + instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + if (instance) { + queue = instance->packetQueue; + } + if (instance == NULL || queue == NULL) { + NdisReleaseSpinLock(gOvsCtrlLock); + goto done; + } + NdisReleaseSpinLock(gOvsCtrlLock); + NdisAcquireSpinLock(&queue->queueLock); + if (queue->pendingIrp == irp) { + queue->pendingIrp = NULL; + } + NdisReleaseSpinLock(&queue->queueLock); +done: + OvsCompleteIrpRequest(irp, 0, STATUS_CANCELLED); +} + + +NTSTATUS +OvsWaitDpIoctl(PIRP irp, PFILE_OBJECT fileObject) +{ + POVS_OPEN_INSTANCE instance = (POVS_OPEN_INSTANCE)fileObject->FsContext; + POVS_USER_PACKET_QUEUE queue = + (POVS_USER_PACKET_QUEUE)instance->packetQueue; + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN cancelled = FALSE; + + if (queue == NULL) { + return STATUS_INVALID_PARAMETER; + } + NdisAcquireSpinLock(&queue->queueLock); + if (queue->instance != instance) { + NdisReleaseSpinLock(&queue->queueLock); + return STATUS_INVALID_PARAMETER; + } + if (queue->pendingIrp) { + NdisReleaseSpinLock(&queue->queueLock); + return STATUS_DEVICE_BUSY; + } + if (queue->numPackets == 0) { + PDRIVER_CANCEL cancelRoutine; + IoMarkIrpPending(irp); + IoSetCancelRoutine(irp, OvsCancelIrpDatapath); + if (irp->Cancel) { + cancelRoutine = IoSetCancelRoutine(irp, NULL); + if (cancelRoutine) { + cancelled = TRUE; + } + } else { + queue->pendingIrp = irp; + } + status = STATUS_PENDING; + } + NdisReleaseSpinLock(&queue->queueLock); + if (cancelled) { + OvsCompleteIrpRequest(irp, 0, STATUS_CANCELLED); + OVS_LOG_INFO("Datapath IRP cancelled: %p", irp); + } + return status; +} + + +POVS_PACKET_QUEUE_ELEM +OvsGetNextPacket(POVS_OPEN_INSTANCE instance) +{ + POVS_USER_PACKET_QUEUE queue; + PLIST_ENTRY link; + queue = (POVS_USER_PACKET_QUEUE)instance->packetQueue; + if (queue == NULL) { + return NULL; + } + NdisAcquireSpinLock(&queue->queueLock); + if (queue->instance != instance || queue->numPackets == 0) { + NdisReleaseSpinLock(&queue->queueLock); + return NULL; + } + link = RemoveHeadList(&queue->packetList); + queue->numPackets--; + NdisReleaseSpinLock(&queue->queueLock); + return CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); +} + +/* + * --------------------------------------------------------------------------- + * Given a pid, returns the corresponding USER_PACKET_QUEUE. + * --------------------------------------------------------------------------- + */ +POVS_USER_PACKET_QUEUE +OvsGetQueue(UINT32 pid) +{ + POVS_OPEN_INSTANCE instance; + POVS_USER_PACKET_QUEUE ret = NULL; + + instance = OvsGetPidInstance(gOvsSwitchContext, pid); + + if (instance) { + ret = instance->packetQueue; + } + + return ret; +} + +/* + * --------------------------------------------------------------------------- + * Given a pid, returns the corresponding instance. + * pidHashLock must be acquired before calling this API. + * --------------------------------------------------------------------------- + */ +POVS_OPEN_INSTANCE +OvsGetPidInstance(POVS_SWITCH_CONTEXT switchContext, UINT32 pid) +{ + POVS_OPEN_INSTANCE instance; + PLIST_ENTRY head, link; + UINT32 hash = OvsJhashBytes((const VOID *)&pid, sizeof(pid), + OVS_HASH_BASIS); + head = &(switchContext->pidHashArray[hash & OVS_PID_MASK]); + LIST_FORALL(head, link) { + instance = CONTAINING_RECORD(link, OVS_OPEN_INSTANCE, pidLink); + if (instance->pid == pid) { + return instance; + } + } + return NULL; +} + +/* + * --------------------------------------------------------------------------- + * Given a pid and an instance. This API adds instance to pidHashArray. + * pidHashLock must be acquired before calling this API. + * --------------------------------------------------------------------------- + */ +VOID +OvsAddPidInstance(POVS_SWITCH_CONTEXT switchContext, UINT32 pid, + POVS_OPEN_INSTANCE instance) +{ + PLIST_ENTRY head; + UINT32 hash = OvsJhashBytes((const VOID *)&pid, sizeof(pid), + OVS_HASH_BASIS); + head = &(switchContext->pidHashArray[hash & OVS_PID_MASK]); + InsertHeadList(head, &(instance->pidLink)); +} + +/* + * --------------------------------------------------------------------------- + * Given a pid and an instance. This API removes instance from pidHashArray. + * pidHashLock must be acquired before calling this API. + * --------------------------------------------------------------------------- + */ +VOID +OvsDelPidInstance(POVS_SWITCH_CONTEXT switchContext, UINT32 pid) +{ + POVS_OPEN_INSTANCE instance = OvsGetPidInstance(switchContext, pid); + + if (instance) { + RemoveEntryList(&(instance->pidLink)); + } +} + +VOID +OvsQueuePackets(PLIST_ENTRY packetList, + UINT32 numElems) +{ + POVS_USER_PACKET_QUEUE upcallQueue = NULL; + POVS_PACKET_QUEUE_ELEM elem; + PIRP irp = NULL; + PLIST_ENTRY link; + UINT32 num = 0; + LIST_ENTRY dropPackets; + + OVS_LOG_LOUD("Enter: numELems: %u", numElems); + + InitializeListHead(&dropPackets); + + while (!IsListEmpty(packetList)) { + link = RemoveHeadList(packetList); + elem = CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); + + ASSERT(elem); + + OvsAcquirePidHashLock(); + + upcallQueue = OvsGetQueue(elem->upcallPid); + if (!upcallQueue) { + /* No upcall queue found, drop this packet. */ + InsertTailList(&dropPackets, &elem->link); + } else { + NdisAcquireSpinLock(&upcallQueue->queueLock); + + if (upcallQueue->instance == NULL) { + InsertTailList(&dropPackets, &elem->link); + } else { + InsertTailList(&upcallQueue->packetList, &elem->link); + upcallQueue->numPackets++; + if (upcallQueue->pendingIrp) { + PDRIVER_CANCEL cancelRoutine; + irp = upcallQueue->pendingIrp; + upcallQueue->pendingIrp = NULL; + cancelRoutine = IoSetCancelRoutine(irp, NULL); + if (cancelRoutine == NULL) { + irp = NULL; + } + } + } + + if (irp) { + OvsCompleteIrpRequest(irp, 0, STATUS_SUCCESS); + } + + NdisReleaseSpinLock(&upcallQueue->queueLock); + } + + OvsReleasePidHashLock(); + } + + while (!IsListEmpty(&dropPackets)) { + link = RemoveHeadList(&dropPackets); + elem = CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); + OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); + num++; + } + + OVS_LOG_LOUD("Exit: drop %u packets", num); +} + +/* + *---------------------------------------------------------------------------- + * OvsCreateAndAddPackets -- + * + * Create a packet and forwarded to user space. + * + * This function would fragment packet if needed, and queue + * each segment to user space. + *---------------------------------------------------------------------------- + */ +NTSTATUS +OvsCreateAndAddPackets(PVOID userData, + UINT32 userDataLen, + UINT32 cmd, + UINT32 inPort, + OvsFlowKey *key, + PNET_BUFFER_LIST nbl, + BOOLEAN isRecv, + POVS_PACKET_HDR_INFO hdrInfo, + POVS_SWITCH_CONTEXT switchContext, + LIST_ENTRY *list, + UINT32 *num) +{ + POVS_PACKET_QUEUE_ELEM elem; + PNET_BUFFER_LIST newNbl = NULL; + PNET_BUFFER nb; + + if (hdrInfo->isTcp) { + NDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO tsoInfo; + UINT32 packetLength; + + tsoInfo.Value = NET_BUFFER_LIST_INFO(nbl, TcpLargeSendNetBufferListInfo); + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + packetLength = NET_BUFFER_DATA_LENGTH(nb); + + OVS_LOG_TRACE("MSS %u packet len %u", + tsoInfo.LsoV1Transmit.MSS, packetLength); + if (tsoInfo.LsoV1Transmit.MSS) { + OVS_LOG_TRACE("l4Offset %d", hdrInfo->l4Offset); + newNbl = OvsTcpSegmentNBL(switchContext, nbl, hdrInfo, + tsoInfo.LsoV1Transmit.MSS , 0); + if (newNbl == NULL) { + return NDIS_STATUS_FAILURE; + } + nbl = newNbl; + } + } + + nb = NET_BUFFER_LIST_FIRST_NB(nbl); + while (nb) { + elem = OvsCreateQueueNlPacket(userData, userDataLen, + cmd, inPort, key, nbl, nb, + isRecv, hdrInfo); + if (elem) { + InsertTailList(list, &elem->link); + (*num)++; + } + nb = NET_BUFFER_NEXT_NB(nb); + } + if (newNbl) { + OvsCompleteNBL(switchContext, newNbl, TRUE); + } + return NDIS_STATUS_SUCCESS; +} + +static __inline UINT32 +OvsGetUpcallMsgSize(PVOID userData, + UINT32 userDataLen, + OvsIPv4TunnelKey *tunnelKey, + UINT32 payload) +{ + UINT32 size = NLMSG_ALIGN(sizeof(struct ovs_header)) + + NlAttrSize(payload) + + NlAttrSize(OvsFlowKeyAttrSize()); + + /* OVS_PACKET_ATTR_USERDATA */ + if (userData) { + size += NlAttrTotalSize(userDataLen); + } + /* OVS_PACKET_ATTR_EGRESS_TUN_KEY */ + /* Is it included in the the flwo key attr XXX */ + if (tunnelKey) { + size += NlAttrTotalSize(OvsTunKeyAttrSize()); + } + return size; +} + +/* + *---------------------------------------------------------------------------- + * This function completes the IP Header csum. record the L4 payload offset and + * if there is a need to calculate the TCP or UDP csum. The actual csum will be + * caluculated simopultaneossly with the copy of the payload to the destination + * buffer when the packet is read. + *---------------------------------------------------------------------------- + */ +static VOID +OvsCompletePacketHeader(UINT8 *packet, + BOOLEAN isRecv, + NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO csumInfo, + POVS_PACKET_HDR_INFO hdrInfoIn, + POVS_PACKET_HDR_INFO hdrInfoOut) +{ + if ((isRecv && csumInfo.Receive.IpChecksumValueInvalid) || + (!isRecv && csumInfo.Transmit.IsIPv4 && + csumInfo.Transmit.IpHeaderChecksum)) { + PIPV4_HEADER ipHdr = (PIPV4_HEADER)(packet + hdrInfoOut->l3Offset); + ASSERT(hdrInfoIn->isIPv4); + ASSERT(ipHdr->Version == 4); + ipHdr->HeaderChecksum = IPChecksum((UINT8 *)ipHdr, + ipHdr->HeaderLength << 2, + (UINT16)~ipHdr->HeaderChecksum); + ovsUserStats.ipCsum++; + } + ASSERT(hdrInfoIn->tcpCsumNeeded == 0 && hdrInfoOut->udpCsumNeeded == 0); + /* + * calculate TCP/UDP pseudo checksum + */ + if (isRecv && csumInfo.Receive.TcpChecksumValueInvalid) { + /* + * Only this case, we need to reclaculate pseudo checksum + * all other cases, it is assumed the pseudo checksum is + * filled already. + * + */ + PTCP_HDR tcpHdr = (PTCP_HDR)(packet + hdrInfoIn->l4Offset); + if (hdrInfoIn->isIPv4) { + PIPV4_HEADER ipHdr = (PIPV4_HEADER)(packet + hdrInfoIn->l3Offset); + hdrInfoOut->l4PayLoad = (UINT16)(ntohs(ipHdr->TotalLength) - + (ipHdr->HeaderLength << 2)); + tcpHdr->th_sum = IPPseudoChecksum((UINT32 *)&ipHdr->SourceAddress, + (UINT32 *)&ipHdr->DestinationAddress, + IPPROTO_TCP, hdrInfoOut->l4PayLoad); + } else { + PIPV6_HEADER ipv6Hdr = (PIPV6_HEADER)(packet + hdrInfoIn->l3Offset); + hdrInfoOut->l4PayLoad = + (UINT16)(ntohs(ipv6Hdr->PayloadLength) + + hdrInfoIn->l3Offset + sizeof(IPV6_HEADER)- + hdrInfoIn->l4Offset); + ASSERT(hdrInfoIn->isIPv6); + tcpHdr->th_sum = + IPv6PseudoChecksum((UINT32 *)&ipv6Hdr->SourceAddress, + (UINT32 *)&ipv6Hdr->DestinationAddress, + IPPROTO_TCP, hdrInfoOut->l4PayLoad); + } + hdrInfoOut->tcpCsumNeeded = 1; + ovsUserStats.recalTcpCsum++; + } else if (!isRecv) { + if (csumInfo.Transmit.TcpChecksum) { + hdrInfoOut->tcpCsumNeeded = 1; + } else if (csumInfo.Transmit.UdpChecksum) { + hdrInfoOut->udpCsumNeeded = 1; + } + if (hdrInfoOut->tcpCsumNeeded || hdrInfoOut->udpCsumNeeded) { +#ifdef DBG + UINT16 sum, *ptr; + UINT8 proto = + hdrInfoOut->tcpCsumNeeded ? IPPROTO_TCP : IPPROTO_UDP; +#endif + if (hdrInfoIn->isIPv4) { + PIPV4_HEADER ipHdr = (PIPV4_HEADER)(packet + hdrInfoIn->l3Offset); + hdrInfoOut->l4PayLoad = (UINT16)(ntohs(ipHdr->TotalLength) - + (ipHdr->HeaderLength << 2)); +#ifdef DBG + sum = IPPseudoChecksum((UINT32 *)&ipHdr->SourceAddress, + (UINT32 *)&ipHdr->DestinationAddress, + proto, hdrInfoOut->l4PayLoad); +#endif + } else { + PIPV6_HEADER ipv6Hdr = (PIPV6_HEADER)(packet + + hdrInfoIn->l3Offset); + hdrInfoOut->l4PayLoad = + (UINT16)(ntohs(ipv6Hdr->PayloadLength) + + hdrInfoIn->l3Offset + sizeof(IPV6_HEADER)- + hdrInfoIn->l4Offset); + ASSERT(hdrInfoIn->isIPv6); +#ifdef DBG + sum = IPv6PseudoChecksum((UINT32 *)&ipv6Hdr->SourceAddress, + (UINT32 *)&ipv6Hdr->DestinationAddress, + proto, hdrInfoOut->l4PayLoad); +#endif + } +#ifdef DBG + ptr = (UINT16 *)(packet + hdrInfoIn->l4Offset + + (hdrInfoOut->tcpCsumNeeded ? + TCP_CSUM_OFFSET : UDP_CSUM_OFFSET)); + ASSERT(*ptr == sum); +#endif + } + } +} + +static NTSTATUS +OvsGetPid(POVS_VPORT_ENTRY vport, PNET_BUFFER nb, UINT32 *pid) +{ + UNREFERENCED_PARAMETER(nb); + + ASSERT(vport); + + /* XXX select a pid from an array of pids using a flow based hash */ + *pid = vport->upcallPid; + return STATUS_SUCCESS; +} + +/* + *---------------------------------------------------------------------------- + * OvsCreateQueueNlPacket -- + * + * Create a packet which will be forwarded to user space. + * + * InputParameter: + * userData: when cmd is user action, this field contain + * user action data. + * userDataLen: as name indicated + * cmd: either miss or user action + * inPort: datapath port id from which the packet is received. + * key: flow Key with a tunnel key if available + * nbl: the NET_BUFFER_LIST which contain the packet + * nb: the packet + * isRecv: This is used to decide how to interprete the csum info + * hdrInfo: include hdr info initialized during flow extraction. + * + * Results: + * NULL if fail to create the packet + * The packet element otherwise + *---------------------------------------------------------------------------- + */ +POVS_PACKET_QUEUE_ELEM +OvsCreateQueueNlPacket(PVOID userData, + UINT32 userDataLen, + UINT32 cmd, + UINT32 inPort, + OvsFlowKey *key, + PNET_BUFFER_LIST nbl, + PNET_BUFFER nb, + BOOLEAN isRecv, + POVS_PACKET_HDR_INFO hdrInfo) +{ +#define VLAN_TAG_SIZE 4 + UINT32 allocLen, dataLen, extraLen; + POVS_PACKET_QUEUE_ELEM elem; + UINT8 *src, *dst; + NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO csumInfo; + NDIS_NET_BUFFER_LIST_8021Q_INFO vlanInfo; + OvsIPv4TunnelKey *tunnelKey = (OvsIPv4TunnelKey *)&key->tunKey; + UINT32 pid; + UINT32 nlMsgSize; + NL_BUFFER nlBuf; + PNL_MSG_HDR nlMsg; + + /* XXX pass vport in the stack rather than portNo */ + POVS_VPORT_ENTRY vport = + OvsFindVportByPortNo(gOvsSwitchContext, inPort); + + if (vport == NULL){ + /* No vport is not fatal. */ + return NULL; + } + + OvsGetPid(vport, nb, &pid); + + if (!pid) { + /* + * There is no userspace queue created yet, so there is no point for + * creating a new packet to be queued. + */ + return NULL; + } + + csumInfo.Value = NET_BUFFER_LIST_INFO(nbl, TcpIpChecksumNetBufferListInfo); + + if (isRecv && (csumInfo.Receive.TcpChecksumFailed || + (csumInfo.Receive.UdpChecksumFailed && !hdrInfo->udpCsumZero) || + csumInfo.Receive.IpChecksumFailed)) { + OVS_LOG_INFO("Packet dropped due to checksum failure."); + ovsUserStats.dropDuetoChecksum++; + return NULL; + } + + vlanInfo.Value = NET_BUFFER_LIST_INFO(nbl, Ieee8021QNetBufferListInfo); + extraLen = vlanInfo.TagHeader.VlanId ? VLAN_TAG_SIZE : 0; + + dataLen = NET_BUFFER_DATA_LENGTH(nb); + + if (NlAttrSize(dataLen) > MAXUINT16) { + return NULL; + } + + nlMsgSize = OvsGetUpcallMsgSize(userData, userDataLen, tunnelKey, + dataLen + extraLen); + + allocLen = sizeof (OVS_PACKET_QUEUE_ELEM) + nlMsgSize; + elem = (POVS_PACKET_QUEUE_ELEM)OvsAllocateMemoryWithTag(allocLen, + OVS_USER_POOL_TAG); + if (elem == NULL) { + ovsUserStats.dropDuetoResource++; + return NULL; + } + elem->hdrInfo.value = hdrInfo->value; + elem->upcallPid = pid; + elem->packet.totalLen = nlMsgSize; + /* XXX remove queueid */ + elem->packet.queue = 0; + /* XXX no need as the length is already in the NL attrib */ + elem->packet.userDataLen = userDataLen; + elem->packet.inPort = inPort; + elem->packet.cmd = cmd; + if (cmd == (UINT32)OVS_PACKET_CMD_MISS) { + ovsUserStats.miss++; + } else if (cmd == (UINT32)OVS_PACKET_CMD_ACTION) { + ovsUserStats.action++; + } else { + ASSERT(FALSE); + goto fail; + } + /* XXX Should we have both packetLen and TotalLen*/ + elem->packet.packetLen = dataLen + extraLen; + + NlBufInit(&nlBuf, (PCHAR)elem->packet.data, nlMsgSize); + + /* + * Initialize the OVS header + * Since we are pre allocating memory for the NL buffer + * the attribute settings should not fail + */ + if (!NlFillOvsMsg(&nlBuf, OVS_WIN_NL_PACKET_FAMILY_ID, 0, + 0, pid, (UINT8)cmd, OVS_PACKET_VERSION, + gOvsSwitchContext->dpNo)) { + goto fail; + } + + if (MapFlowKeyToNlKey(&nlBuf, key, OVS_PACKET_ATTR_KEY, + OVS_KEY_ATTR_TUNNEL) != STATUS_SUCCESS) { + goto fail; + } + + /* XXX must send OVS_PACKET_ATTR_EGRESS_TUN_KEY if set by vswtchd */ + if (userData){ + if (!NlMsgPutTailUnspec(&nlBuf, OVS_PACKET_ATTR_USERDATA, + userData, (UINT16)userDataLen)) { + goto fail; + } + } + + /* + * Make space for the payload to be copied and set the attribute + * XXX Uninit set initilizes the buffer with xero, we don't actually need + * that the payload to be initailized + */ + dst = (UINT8 *)NlMsgPutTailUnspecUninit(&nlBuf, OVS_PACKET_ATTR_PACKET, + (UINT16)(dataLen + extraLen)); + if (!dst) { + goto fail; + } + + /* Store the payload for csum calculation when packet is read */ + elem->packet.payload = dst; + dst += extraLen; + + src = NdisGetDataBuffer(nb, dataLen, dst, 1, 0); + if (src == NULL) { + ovsUserStats.dropDuetoResource++; + goto fail; + } else if (src != dst) { + /* Copy the data from the NDIS buffer to dst. */ + RtlCopyMemory(dst, src, dataLen); + } + + /* Set csum if was offloaded */ + OvsCompletePacketHeader(dst, isRecv, csumInfo, hdrInfo, &elem->hdrInfo); + + /* + * Finally insert VLAN tag + */ + if (extraLen) { + dst = elem->packet.payload; + src = dst + extraLen; + ((UINT32 *)dst)[0] = ((UINT32 *)src)[0]; + ((UINT32 *)dst)[1] = ((UINT32 *)src)[1]; + ((UINT32 *)dst)[2] = ((UINT32 *)src)[2]; + dst += 12; + ((UINT16 *)dst)[0] = htons(0x8100); + ((UINT16 *)dst)[1] = htons(vlanInfo.TagHeader.VlanId | + (vlanInfo.TagHeader.UserPriority << 13)); + elem->hdrInfo.l3Offset += VLAN_TAG_SIZE; + elem->hdrInfo.l4Offset += VLAN_TAG_SIZE; + ovsUserStats.vlanInsert++; + } + + nlMsg = (PNL_MSG_HDR)NlBufAt(&nlBuf, 0, 0); + nlMsg->nlmsgLen = NlBufSize(&nlBuf); + /* 'totalLen' should be size of valid data. */ + elem->packet.totalLen = nlMsg->nlmsgLen; + + return elem; +fail: + OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); + return NULL; +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/User.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/User.h --- openvswitch-2.3.1/datapath-windows/ovsext/User.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/User.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,121 @@ + /* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This file contains structures and function definitions necessary for + * forwarding packet to user space. + */ + +#ifndef __USER_H_ +#define __USER_H_ 1 + + +#include "Datapath.h" + +/* + * Even we have more cores, I don't think we need + * more than 32 queues for processing packets to + * userspace + */ +#define OVS_DEFAULT_PACKET_QUEUE 1 +#define OVS_MAX_PACKET_QUEUE_LEN 4096 + +/* + * Only when OVS_PER_VPORT_QUEUE_CTRL is defined + * we will apply this constraint + */ +#define OVS_MAX_PACKETS_PER_VPORT 128 +#define OVS_MAX_PACKETS_PER_TUNNEL 1024 + +typedef struct _OVS_USER_PACKET_QUEUE { + UINT32 pid; + UINT32 numPackets; + LIST_ENTRY packetList; + PVOID instance; + PIRP pendingIrp; + NDIS_SPIN_LOCK queueLock; +} OVS_USER_PACKET_QUEUE, *POVS_USER_PACKET_QUEUE; + +typedef struct _OVS_PACKET_QUEUE_ELEM { + UINT32 upcallPid; + LIST_ENTRY link; + OVS_PACKET_HDR_INFO hdrInfo; + OVS_PACKET_INFO packet; +} OVS_PACKET_QUEUE_ELEM, *POVS_PACKET_QUEUE_ELEM; + +struct _OVS_OPEN_INSTANCE; + +typedef struct _OVS_USER_STATS { + UINT64 miss; + UINT64 action; + UINT32 dropDuetoResource; + UINT32 dropDuetoChecksum; + UINT32 ipCsum; + UINT32 recalTcpCsum; + UINT32 vlanInsert; + UINT32 l4Csum; +} OVS_USER_STATS, *POVS_USER_STATS; + +VOID OvsCleanupPacketQueue(struct _OVS_OPEN_INSTANCE *instance); + +POVS_PACKET_QUEUE_ELEM OvsCreateQueueNlPacket(PVOID userData, + UINT32 userDataLen, + UINT32 cmd, UINT32 inPort, + OvsFlowKey *key, + PNET_BUFFER_LIST nbl, + PNET_BUFFER nb, + BOOLEAN isRecv, + POVS_PACKET_HDR_INFO hdrInfo); + +VOID OvsQueuePackets(PLIST_ENTRY packetList, UINT32 numElems); +NTSTATUS OvsCreateAndAddPackets(PVOID userData, + UINT32 userDataLen, + UINT32 cmd, + UINT32 inPort, + OvsFlowKey *key, + PNET_BUFFER_LIST nbl, + BOOLEAN isRecv, + POVS_PACKET_HDR_INFO hdrInfo, + POVS_SWITCH_CONTEXT switchContext, + LIST_ENTRY *list, + UINT32 *num); + +NTSTATUS OvsSubscribeDpIoctl(PVOID instanceP, + UINT32 pid, + UINT8 join); + +NTSTATUS OvsReadDpIoctl(PFILE_OBJECT fileObject, + PVOID outputBuffer, + UINT32 outputLength, + UINT32 *replyLen); +NTSTATUS OvsExecuteDpIoctl(OvsPacketExecute *execute); +NTSTATUS OvsPurgeDpIoctl(PFILE_OBJECT fileObject); + +NTSTATUS OvsWaitDpIoctl(PIRP irp, PFILE_OBJECT fileObject); + +NTSTATUS OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); + +POVS_OPEN_INSTANCE +OvsGetPidInstance(POVS_SWITCH_CONTEXT switchContext, UINT32 pid); + +VOID +OvsAddPidInstance(POVS_SWITCH_CONTEXT switchContext, UINT32 pid, + POVS_OPEN_INSTANCE instance); + +VOID +OvsDelPidInstance(POVS_SWITCH_CONTEXT switchContext, UINT32 pid); + +#endif /* __USER_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Util.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Util.c --- openvswitch-2.3.1/datapath-windows/ovsext/Util.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Util.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_OTHERS + +#include "Debug.h" + +extern NDIS_HANDLE gOvsExtDriverHandle; + +VOID* +OvsAllocateMemoryWithTag(size_t size, ULONG tag) +{ + OVS_VERIFY_IRQL_LE(DISPATCH_LEVEL); + return NdisAllocateMemoryWithTagPriority(gOvsExtDriverHandle, + (UINT32)size, tag, NormalPoolPriority); +} + +VOID +OvsFreeMemoryWithTag(VOID *ptr, ULONG tag) +{ + ASSERT(ptr); + NdisFreeMemoryWithTagPriority(gOvsExtDriverHandle, ptr, tag); +} + +VOID * +OvsAllocateMemory(size_t size) +{ + OVS_VERIFY_IRQL_LE(DISPATCH_LEVEL); + return NdisAllocateMemoryWithTagPriority(gOvsExtDriverHandle, + (UINT32)size, OVS_MEMORY_TAG, NormalPoolPriority); +} + +VOID * +OvsAllocateAlignedMemory(size_t size, UINT16 align) +{ + OVS_VERIFY_IRQL_LE(DISPATCH_LEVEL); + + ASSERT((align == 8) || (align == 16)); + + if ((align == 8) || (align == 16)) { + /* + * XXX: NdisAllocateMemory*() functions don't talk anything about + * alignment. Hence using ExAllocatePool*(); + */ + return (VOID *)ExAllocatePoolWithTagPriority(NonPagedPool, size, + OVS_MEMORY_TAG, + NormalPoolPriority); + } + + /* Invalid user input. */ + return NULL; +} + +VOID +OvsFreeMemory(VOID *ptr) +{ + ASSERT(ptr); + NdisFreeMemoryWithTagPriority(gOvsExtDriverHandle, ptr, OVS_MEMORY_TAG); +} + +VOID +OvsFreeAlignedMemory(VOID *ptr) +{ + ASSERT(ptr); + ExFreePoolWithTag(ptr, OVS_MEMORY_TAG); +} + +VOID +OvsAppendList(PLIST_ENTRY dst, PLIST_ENTRY src) +{ + PLIST_ENTRY srcFirst, srcLast, dstLast; + if (IsListEmpty(src)) { + return; + } + srcFirst = src->Flink; + srcLast = src->Blink; + dstLast = dst->Blink; + + dstLast->Flink = srcFirst; + srcFirst->Blink = dstLast; + + srcLast->Flink = dst; + dst->Blink = srcLast; + + src->Flink = src; + src->Blink = src; +} + +BOOLEAN +OvsCompareString(PVOID string1, PVOID string2) +{ + /* + * Not a super-efficient string compare since we walk over the strings + * twice: to initialize, and then to do the comparison. + */ + STRING str1, str2; + + RtlInitString(&str1, string1); + RtlInitString(&str2, string2); + return RtlEqualString(&str1, &str2, FALSE); +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Util.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Util.h --- openvswitch-2.3.1/datapath-windows/ovsext/Util.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Util.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __UTIL_H_ +#define __UTIL_H_ 1 + +#define OVS_MEMORY_TAG 'TSVO' +#define OVS_FIX_SIZE_NBL_POOL_TAG 'FSVO' +#define OVS_VARIABLE_SIZE_NBL_POOL_TAG 'VSVO' +#define OVS_NBL_ONLY_POOL_TAG 'OSVO' +#define OVS_NET_BUFFER_POOL_TAG 'NSVO' +#define OVS_OTHER_POOL_TAG 'MSVO' +#define OVS_MDL_POOL_TAG 'BSVO' +#define OVS_DATAPATH_POOL_TAG 'DSVO' +#define OVS_EVENT_POOL_TAG 'ESVO' +#define OVS_FLOW_POOL_TAG 'LSVO' +#define OVS_VXLAN_POOL_TAG 'XSVO' +#define OVS_IPHELPER_POOL_TAG 'HSVO' +#define OVS_OID_POOL_TAG 'ASVO' +#define OVS_SWITCH_POOL_TAG 'SSVO' +#define OVS_USER_POOL_TAG 'USVO' +#define OVS_VPORT_POOL_TAG 'PSVO' +#define OVS_STT_POOL_TAG 'TSVO' + +VOID *OvsAllocateMemory(size_t size); +VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); +VOID *OvsAllocateAlignedMemory(size_t size, UINT16 align); +VOID OvsFreeMemory(VOID *ptr); +VOID OvsFreeMemoryWithTag(VOID *ptr, ULONG tag); +VOID OvsFreeAlignedMemory(VOID *ptr); + +#define LIST_FORALL(_headPtr, _itemPtr) \ + for (_itemPtr = (_headPtr)->Flink; \ + _itemPtr != _headPtr; \ + _itemPtr = (_itemPtr)->Flink) + +#define LIST_FORALL_SAFE(_headPtr, _itemPtr, _nextPtr) \ + for (_itemPtr = (_headPtr)->Flink, _nextPtr = (_itemPtr)->Flink; \ + _itemPtr != _headPtr; \ + _itemPtr = _nextPtr, _nextPtr = (_itemPtr)->Flink) + +#define LIST_FORALL_REVERSE(_headPtr, _itemPtr) \ + for (_itemPtr = (_headPtr)->Blink; \ + _itemPtr != _headPtr; \ + _itemPtr = (_itemPtr)->Blink) + +#define LIST_FORALL_REVERSE_SAFE(_headPtr, _itemPtr, _nextPtr) \ + for (_itemPtr = (_headPtr)->Blink, _nextPtr = (_itemPtr)->Blink; \ + _itemPtr != _headPtr; \ + _itemPtr = _nextPtr, _nextPtr = (_itemPtr)->Blink) + +VOID OvsAppendList(PLIST_ENTRY dst, PLIST_ENTRY src); + + +#define MIN(_a, _b) (_a) > (_b) ? (_b) : (_a) +#define ARRAY_SIZE(_x) ((sizeof(_x))/sizeof (_x)[0]) +#define OVS_SWITCH_PORT_ID_INVALID (NDIS_SWITCH_PORT_ID)(-1) + +#ifndef htons +#define htons(_x) _byteswap_ushort((USHORT)(_x)) +#define ntohs(_x) _byteswap_ushort((USHORT)(_x)) +#define htonl(_x) _byteswap_ulong((ULONG)(_x)) +#define ntohl(_x) _byteswap_ulong((ULONG)(_x)) +#endif + +#define OVS_INIT_OBJECT_HEADER(_obj, _type, _revision, _size) \ + { \ + PNDIS_OBJECT_HEADER hdrp = _obj; \ + hdrp->Type = _type; \ + hdrp->Revision = _revision; \ + hdrp->Size = _size; \ + } + + +#define BIT16(_x) ((UINT16)0x1 << (_x)) +#define BIT32(_x) ((UINT32)0x1 << (_x)) + +BOOLEAN OvsCompareString(PVOID string1, PVOID string2); + +#endif /* __UTIL_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Vport.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vport.c --- openvswitch-2.3.1/datapath-windows/ovsext/Vport.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vport.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2657 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "Jhash.h" +#include "Switch.h" +#include "Vport.h" +#include "Event.h" +#include "User.h" +#include "Vxlan.h" +#include "Stt.h" +#include "IpHelper.h" +#include "Oid.h" +#include "Datapath.h" + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_VPORT +#include "Debug.h" + +#define VPORT_NIC_ENTER(_nic) \ + OVS_LOG_TRACE("Enter: PortId: %x, NicIndex: %d", _nic->PortId, \ + _nic->NicIndex) + +#define VPORT_NIC_EXIT(_nic) \ + OVS_LOG_TRACE("Exit: PortId: %x, NicIndex: %d", _nic->PortId, \ + _nic->NicIndex) + +#define VPORT_PORT_ENTER(_port) \ + OVS_LOG_TRACE("Enter: PortId: %x", _port->PortId) + +#define VPORT_PORT_EXIT(_port) \ + OVS_LOG_TRACE("Exit: PortId: %x", _port->PortId) + +#define OVS_VPORT_DEFAULT_WAIT_TIME_MICROSEC 100 + +/* Context structure used to pass back and forth information to the tunnel + * filter threads. */ +typedef struct _OVS_TUNFLT_INIT_CONTEXT { + POVS_SWITCH_CONTEXT switchContext; + UINT32 outputLength; + PVOID outputBuffer; + PVOID inputBuffer; + POVS_VPORT_ENTRY vport; + BOOLEAN hvSwitchPort; + BOOLEAN hvDelete; + BOOLEAN ovsDelete; +} OVS_TUNFLT_INIT_CONTEXT, *POVS_TUNFLT_INIT_CONTEXT; + + +extern POVS_SWITCH_CONTEXT gOvsSwitchContext; + +static VOID OvsInitVportWithPortParam(POVS_VPORT_ENTRY vport, + PNDIS_SWITCH_PORT_PARAMETERS portParam); +static VOID OvsInitVportWithNicParam(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, PNDIS_SWITCH_NIC_PARAMETERS nicParam); +static VOID OvsInitPhysNicVport(POVS_VPORT_ENTRY physExtVPort, + POVS_VPORT_ENTRY virtExtVport, UINT32 nicIndex); +static __inline VOID OvsWaitActivate(POVS_SWITCH_CONTEXT switchContext, + ULONG sleepMicroSec); +static NTSTATUS OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet, + POVS_VPORT_EXT_INFO extInfo); +static NTSTATUS CreateNetlinkMesgForNetdev(POVS_VPORT_EXT_INFO info, + POVS_MESSAGE msgIn, + PVOID outBuffer, + UINT32 outBufLen, + int dpIfIndex); +static POVS_VPORT_ENTRY OvsFindVportByHvNameW(POVS_SWITCH_CONTEXT switchContext, + PWSTR wsName, SIZE_T wstrSize); +static NDIS_STATUS InitHvVportCommon(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, + BOOLEAN newPort); +static VOID OvsCleanupVportCommon(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, + BOOLEAN hvSwitchPort, + BOOLEAN hvDelete, + BOOLEAN ovsDelete); +static VOID OvsTunnelVportPendingInit(PVOID context, + NTSTATUS status, + UINT32 *replyLen); +static VOID OvsTunnelVportPendingUninit(PVOID context, + NTSTATUS status, + UINT32 *replyLen); + + +/* + * Functions implemented in relaton to NDIS port manipulation. + */ +NDIS_STATUS +HvCreatePort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParam) +{ + POVS_VPORT_ENTRY vport; + LOCK_STATE_EX lockState; + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + BOOLEAN newPort = FALSE; + + VPORT_PORT_ENTER(portParam); + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + /* Lookup by port ID. */ + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + portParam->PortId, 0); + if (vport != NULL) { + OVS_LOG_ERROR("Port add failed due to duplicate port name, " + "port Id: %u", portParam->PortId); + status = STATUS_DATA_NOT_ACCEPTED; + goto create_port_done; + } + + /* + * Lookup by port name to see if this port with this name had been added + * (and deleted) previously. + */ + vport = OvsFindVportByHvNameW(gOvsSwitchContext, + portParam->PortFriendlyName.String, + portParam->PortFriendlyName.Length); + if (vport && vport->isPresentOnHv == FALSE) { + OVS_LOG_ERROR("Port add failed since a port already exists on " + "the specified port Id: %u, ovsName: %s", + portParam->PortId, vport->ovsName); + status = STATUS_DATA_NOT_ACCEPTED; + goto create_port_done; + } + + if (vport != NULL) { + ASSERT(vport->isPresentOnHv); + ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID); + + /* + * It should be possible to simply just mark this port as "not deleted" + * given that the port Id and the name are the same and also provided + * that the other properties that we cache have not changed. + */ + if (vport->portType != portParam->PortType) { + OVS_LOG_INFO("Port add failed due to PortType change, port Id: %u" + " old: %u, new: %u", portParam->PortId, + vport->portType, portParam->PortType); + status = STATUS_DATA_NOT_ACCEPTED; + goto create_port_done; + } + vport->isPresentOnHv = FALSE; + } else { + vport = (POVS_VPORT_ENTRY)OvsAllocateVport(); + if (vport == NULL) { + status = NDIS_STATUS_RESOURCES; + goto create_port_done; + } + newPort = TRUE; + } + OvsInitVportWithPortParam(vport, portParam); + InitHvVportCommon(switchContext, vport, newPort); + +create_port_done: + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + VPORT_PORT_EXIT(portParam); + return status; +} + + +/* + * Function updating the port properties + */ +NDIS_STATUS +HvUpdatePort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParam) +{ + POVS_VPORT_ENTRY vport; + LOCK_STATE_EX lockState; + OVS_VPORT_STATE ovsState; + NDIS_SWITCH_NIC_STATE nicState; + + VPORT_PORT_ENTER(portParam); + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + portParam->PortId, 0); + /* + * Update properties only for NETDEV ports for supprting PS script + * We don't allow changing the names of the internal or external ports + */ + if (vport == NULL || (( vport->portType != NdisSwitchPortTypeSynthetic) && + ( vport->portType != NdisSwitchPortTypeEmulated))) { + goto update_port_done; + } + + /* Store the nic and the OVS states as Nic Create won't be called */ + ovsState = vport->ovsState; + nicState = vport->nicState; + + /* + * Currently only the port friendly name is being updated + * Make sure that no other properties are changed + */ + ASSERT(portParam->PortId == vport->portId); + ASSERT(portParam->PortState == vport->portState); + ASSERT(portParam->PortType == vport->portType); + + /* + * Call the set parameters function the handle all properties + * change in a single place in case future version supports change of + * other properties + */ + OvsInitVportWithPortParam(vport, portParam); + /* Retore the nic and OVS states */ + vport->nicState = nicState; + vport->ovsState = ovsState; + +update_port_done: + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + VPORT_PORT_EXIT(portParam); + + /* Must always return success */ + return NDIS_STATUS_SUCCESS; +} + +VOID +HvTeardownPort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParam) +{ + POVS_VPORT_ENTRY vport; + LOCK_STATE_EX lockState; + + VPORT_PORT_ENTER(portParam); + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + portParam->PortId, 0); + if (vport) { + /* add assertion here */ + vport->portState = NdisSwitchPortStateTeardown; + vport->ovsState = OVS_STATE_PORT_TEAR_DOWN; + } else { + OVS_LOG_WARN("Vport not present."); + } + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + + VPORT_PORT_EXIT(portParam); +} + + +VOID +HvDeletePort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParams) +{ + POVS_VPORT_ENTRY vport; + LOCK_STATE_EX lockState; + + VPORT_PORT_ENTER(portParams); + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + portParams->PortId, 0); + + /* + * XXX: we can only destroy and remove the port if its datapath port + * counterpart was deleted. If the datapath port counterpart is present, + * we only mark the vport for deletion, so that a netlink command vport + * delete will delete the vport. + */ + if (vport) { + OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, FALSE); + } else { + OVS_LOG_WARN("Vport not present."); + } + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + + VPORT_PORT_EXIT(portParams); +} + + +/* + * Functions implemented in relaton to NDIS NIC manipulation. + */ +NDIS_STATUS +HvCreateNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam) +{ + POVS_VPORT_ENTRY vport; + UINT32 portNo = 0; + UINT32 event = 0; + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + + LOCK_STATE_EX lockState; + + VPORT_NIC_ENTER(nicParam); + + /* Wait for lists to be initialized. */ + OvsWaitActivate(switchContext, OVS_VPORT_DEFAULT_WAIT_TIME_MICROSEC); + + if (!switchContext->isActivated) { + OVS_LOG_WARN("Switch is not activated yet."); + /* Veto the creation of nic */ + status = NDIS_STATUS_NOT_SUPPORTED; + goto done; + } + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, nicParam->PortId, 0); + if (vport == NULL) { + OVS_LOG_ERROR("Create NIC without Switch Port," + " PortId: %x, NicIndex: %d", + nicParam->PortId, nicParam->NicIndex); + status = NDIS_STATUS_INVALID_PARAMETER; + goto add_nic_done; + } + + if (nicParam->NicType == NdisSwitchNicTypeExternal && + nicParam->NicIndex != 0) { + POVS_VPORT_ENTRY virtExtVport = + (POVS_VPORT_ENTRY)switchContext->virtualExternalVport; + + vport = (POVS_VPORT_ENTRY)OvsAllocateVport(); + if (vport == NULL) { + status = NDIS_STATUS_RESOURCES; + goto add_nic_done; + } + OvsInitPhysNicVport(vport, virtExtVport, nicParam->NicIndex); + status = InitHvVportCommon(switchContext, vport, TRUE); + if (status != NDIS_STATUS_SUCCESS) { + OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); + goto add_nic_done; + } + } + OvsInitVportWithNicParam(switchContext, vport, nicParam); + portNo = vport->portNo; + if (vport->ovsState == OVS_STATE_CONNECTED) { + event = OVS_EVENT_CONNECT | OVS_EVENT_LINK_UP; + } else if (vport->ovsState == OVS_STATE_NIC_CREATED) { + event = OVS_EVENT_CONNECT; + } + +add_nic_done: + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + if (portNo != OVS_DPPORT_NUMBER_INVALID && event) { + OvsPostEvent(portNo, event); + } + +done: + VPORT_NIC_EXIT(nicParam); + OVS_LOG_TRACE("Exit: status %8x.\n", status); + + return status; +} + + +/* Mark already created NIC as connected. */ +VOID +HvConnectNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam) +{ + LOCK_STATE_EX lockState; + POVS_VPORT_ENTRY vport; + UINT32 portNo = 0; + + VPORT_NIC_ENTER(nicParam); + + /* Wait for lists to be initialized. */ + OvsWaitActivate(switchContext, OVS_VPORT_DEFAULT_WAIT_TIME_MICROSEC); + + if (!switchContext->isActivated) { + OVS_LOG_WARN("Switch is not activated yet."); + goto done; + } + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + nicParam->PortId, + nicParam->NicIndex); + + if (!vport) { + OVS_LOG_WARN("Vport not present."); + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + ASSERT(0); + goto done; + } + + vport->ovsState = OVS_STATE_CONNECTED; + vport->nicState = NdisSwitchNicStateConnected; + portNo = vport->portNo; + + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + + /* XXX only if portNo != INVALID or always? */ + OvsPostEvent(portNo, OVS_EVENT_LINK_UP); + + if (nicParam->NicType == NdisSwitchNicTypeInternal) { + OvsInternalAdapterUp(portNo, &nicParam->NetCfgInstanceId); + } + +done: + VPORT_NIC_EXIT(nicParam); +} + +VOID +HvUpdateNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam) +{ + POVS_VPORT_ENTRY vport; + LOCK_STATE_EX lockState; + + UINT32 status = 0, portNo = 0; + + VPORT_NIC_ENTER(nicParam); + + /* Wait for lists to be initialized. */ + OvsWaitActivate(switchContext, OVS_VPORT_DEFAULT_WAIT_TIME_MICROSEC); + + if (!switchContext->isActivated) { + OVS_LOG_WARN("Switch is not activated yet."); + goto update_nic_done; + } + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + nicParam->PortId, + nicParam->NicIndex); + if (vport == NULL) { + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + OVS_LOG_WARN("Vport search failed."); + goto update_nic_done; + } + switch (nicParam->NicType) { + case NdisSwitchNicTypeExternal: + case NdisSwitchNicTypeInternal: + RtlCopyMemory(&vport->netCfgInstanceId, &nicParam->NetCfgInstanceId, + sizeof (GUID)); + break; + case NdisSwitchNicTypeSynthetic: + case NdisSwitchNicTypeEmulated: + if (!RtlEqualMemory(vport->vmMacAddress, nicParam->VMMacAddress, + sizeof (vport->vmMacAddress))) { + status |= OVS_EVENT_MAC_CHANGE; + RtlCopyMemory(vport->vmMacAddress, nicParam->VMMacAddress, + sizeof (vport->vmMacAddress)); + } + break; + default: + ASSERT(0); + } + if (!RtlEqualMemory(vport->permMacAddress, nicParam->PermanentMacAddress, + sizeof (vport->permMacAddress))) { + RtlCopyMemory(vport->permMacAddress, nicParam->PermanentMacAddress, + sizeof (vport->permMacAddress)); + status |= OVS_EVENT_MAC_CHANGE; + } + if (!RtlEqualMemory(vport->currMacAddress, nicParam->CurrentMacAddress, + sizeof (vport->currMacAddress))) { + RtlCopyMemory(vport->currMacAddress, nicParam->CurrentMacAddress, + sizeof (vport->currMacAddress)); + status |= OVS_EVENT_MAC_CHANGE; + } + + if (vport->mtu != nicParam->MTU) { + vport->mtu = nicParam->MTU; + status |= OVS_EVENT_MTU_CHANGE; + } + vport->numaNodeId = nicParam->NumaNodeId; + portNo = vport->portNo; + + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + if (status && portNo) { + OvsPostEvent(portNo, status); + } +update_nic_done: + VPORT_NIC_EXIT(nicParam); +} + + +VOID +HvDisconnectNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam) +{ + POVS_VPORT_ENTRY vport; + UINT32 portNo = 0; + LOCK_STATE_EX lockState; + BOOLEAN isInternalPort = FALSE; + + VPORT_NIC_ENTER(nicParam); + + /* Wait for lists to be initialized. */ + OvsWaitActivate(switchContext, OVS_VPORT_DEFAULT_WAIT_TIME_MICROSEC); + + if (!switchContext->isActivated) { + OVS_LOG_WARN("Switch is not activated yet."); + goto done; + } + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + nicParam->PortId, + nicParam->NicIndex); + + if (!vport) { + OVS_LOG_WARN("Vport not present."); + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + goto done; + } + + vport->nicState = NdisSwitchNicStateDisconnected; + vport->ovsState = OVS_STATE_NIC_CREATED; + portNo = vport->portNo; + + if (vport->ovsType == OVS_VPORT_TYPE_INTERNAL) { + isInternalPort = TRUE; + } + + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + + /* XXX if portNo != INVALID or always? */ + OvsPostEvent(portNo, OVS_EVENT_LINK_DOWN); + + if (isInternalPort) { + OvsInternalAdapterDown(); + } + +done: + VPORT_NIC_EXIT(nicParam); +} + + +VOID +HvDeleteNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam) +{ + LOCK_STATE_EX lockState; + POVS_VPORT_ENTRY vport; + UINT32 portNo = 0; + + VPORT_NIC_ENTER(nicParam); + /* Wait for lists to be initialized. */ + OvsWaitActivate(switchContext, OVS_VPORT_DEFAULT_WAIT_TIME_MICROSEC); + + if (!switchContext->isActivated) { + OVS_LOG_WARN("Switch is not activated yet."); + goto done; + } + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + nicParam->PortId, + nicParam->NicIndex); + + if (!vport) { + OVS_LOG_WARN("Vport not present."); + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + goto done; + } + + vport->nicState = NdisSwitchNicStateUnknown; + vport->ovsState = OVS_STATE_PORT_CREATED; + + portNo = vport->portNo; + if (vport->portType == NdisSwitchPortTypeExternal && + vport->nicIndex != 0) { + OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, FALSE); + } + + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); + /* XXX if portNo != INVALID or always? */ + OvsPostEvent(portNo, OVS_EVENT_DISCONNECT); + +done: + VPORT_NIC_EXIT(nicParam); +} + + +/* + * OVS Vport related functionality. + */ +POVS_VPORT_ENTRY +OvsFindVportByPortNo(POVS_SWITCH_CONTEXT switchContext, + UINT32 portNo) +{ + POVS_VPORT_ENTRY vport; + PLIST_ENTRY head, link; + UINT32 hash = OvsJhashBytes((const VOID *)&portNo, sizeof(portNo), + OVS_HASH_BASIS); + head = &(switchContext->portNoHashArray[hash & OVS_VPORT_MASK]); + LIST_FORALL(head, link) { + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink); + if (vport->portNo == portNo) { + return vport; + } + } + return NULL; +} + + +POVS_VPORT_ENTRY +OvsFindTunnelVportByDstPort(POVS_SWITCH_CONTEXT switchContext, + UINT16 dstPort, + OVS_VPORT_TYPE ovsPortType) +{ + POVS_VPORT_ENTRY vport; + PLIST_ENTRY head, link; + UINT32 hash = OvsJhashBytes((const VOID *)&dstPort, sizeof(dstPort), + OVS_HASH_BASIS); + head = &(switchContext->tunnelVportsArray[hash & OVS_VPORT_MASK]); + LIST_FORALL(head, link) { + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, tunnelVportLink); + if (GetPortFromPriv(vport) == dstPort && + vport->ovsType == ovsPortType) { + return vport; + } + } + return NULL; +} + + +POVS_VPORT_ENTRY +OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext, + PSTR name) +{ + POVS_VPORT_ENTRY vport; + PLIST_ENTRY head, link; + UINT32 hash; + SIZE_T length = strlen(name) + 1; + + hash = OvsJhashBytes((const VOID *)name, length, OVS_HASH_BASIS); + head = &(switchContext->ovsPortNameHashArray[hash & OVS_VPORT_MASK]); + + LIST_FORALL(head, link) { + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, ovsNameLink); + if (!strcmp(name, vport->ovsName)) { + return vport; + } + } + + return NULL; +} + +/* OvsFindVportByHvName: "name" is assumed to be null-terminated */ +POVS_VPORT_ENTRY +OvsFindVportByHvNameW(POVS_SWITCH_CONTEXT switchContext, + PWSTR wsName, SIZE_T wstrSize) +{ + POVS_VPORT_ENTRY vport = NULL; + PLIST_ENTRY head, link; + UINT i; + + for (i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) { + head = &(switchContext->portIdHashArray[i]); + LIST_FORALL(head, link) { + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portIdLink); + + /* + * NOTE about portFriendlyName: + * If the string is NULL-terminated, the Length member does not + * include the terminating NULL character. + */ + if (vport->portFriendlyName.Length == wstrSize && + RtlEqualMemory(wsName, vport->portFriendlyName.String, + vport->portFriendlyName.Length)) { + goto Cleanup; + } + + vport = NULL; + } + } + + /* + * Look in the list of ports that were added from the Hyper-V switch and + * deleted. + */ + if (vport == NULL) { + for (i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) { + head = &(switchContext->portNoHashArray[i]); + LIST_FORALL(head, link) { + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink); + if (vport->portFriendlyName.Length == wstrSize && + RtlEqualMemory(wsName, vport->portFriendlyName.String, + vport->portFriendlyName.Length)) { + goto Cleanup; + } + + vport = NULL; + } + } + } + +Cleanup: + return vport; +} + +POVS_VPORT_ENTRY +OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext, + PSTR name) +{ + POVS_VPORT_ENTRY vport = NULL; + /* 'portFriendlyName' is not NUL-terminated. */ + SIZE_T length = strlen(name); + SIZE_T wstrSize = length * sizeof(WCHAR); + UINT i; + + PWSTR wsName = OvsAllocateMemoryWithTag(wstrSize, OVS_VPORT_POOL_TAG); + if (!wsName) { + return NULL; + } + for (i = 0; i < length; i++) { + wsName[i] = name[i]; + } + vport = OvsFindVportByHvNameW(switchContext, wsName, wstrSize); + OvsFreeMemoryWithTag(wsName, OVS_VPORT_POOL_TAG); + return vport; +} + +POVS_VPORT_ENTRY +OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT switchContext, + NDIS_SWITCH_PORT_ID portId, + NDIS_SWITCH_NIC_INDEX index) +{ + if (switchContext->virtualExternalVport && + portId == switchContext->virtualExternalPortId && + index == switchContext->virtualExternalVport->nicIndex) { + return (POVS_VPORT_ENTRY)switchContext->virtualExternalVport; + } else if (switchContext->internalVport && + portId == switchContext->internalPortId && + index == switchContext->internalVport->nicIndex) { + return (POVS_VPORT_ENTRY)switchContext->internalVport; + } else { + PLIST_ENTRY head, link; + POVS_VPORT_ENTRY vport; + UINT32 hash; + hash = OvsJhashWords((UINT32 *)&portId, 1, OVS_HASH_BASIS); + head = &(switchContext->portIdHashArray[hash & OVS_VPORT_MASK]); + LIST_FORALL(head, link) { + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portIdLink); + if (portId == vport->portId && index == vport->nicIndex) { + return vport; + } + } + return NULL; + } +} + +POVS_VPORT_ENTRY +OvsAllocateVport(VOID) +{ + POVS_VPORT_ENTRY vport; + vport = (POVS_VPORT_ENTRY)OvsAllocateMemoryWithTag( + sizeof(OVS_VPORT_ENTRY), OVS_VPORT_POOL_TAG); + if (vport == NULL) { + return NULL; + } + RtlZeroMemory(vport, sizeof (OVS_VPORT_ENTRY)); + vport->ovsState = OVS_STATE_UNKNOWN; + vport->isPresentOnHv = FALSE; + vport->portNo = OVS_DPPORT_NUMBER_INVALID; + + InitializeListHead(&vport->ovsNameLink); + InitializeListHead(&vport->portIdLink); + InitializeListHead(&vport->portNoLink); + + return vport; +} + +static VOID +OvsInitVportWithPortParam(POVS_VPORT_ENTRY vport, + PNDIS_SWITCH_PORT_PARAMETERS portParam) +{ + vport->portType = portParam->PortType; + vport->portState = portParam->PortState; + vport->portId = portParam->PortId; + vport->nicState = NdisSwitchNicStateUnknown; + vport->isExternal = FALSE; + vport->isBridgeInternal = FALSE; + + switch (vport->portType) { + case NdisSwitchPortTypeExternal: + vport->isExternal = TRUE; + vport->ovsType = OVS_VPORT_TYPE_NETDEV; + break; + case NdisSwitchPortTypeInternal: + vport->ovsType = OVS_VPORT_TYPE_INTERNAL; + break; + case NdisSwitchPortTypeSynthetic: + case NdisSwitchPortTypeEmulated: + vport->ovsType = OVS_VPORT_TYPE_NETDEV; + break; + } + RtlCopyMemory(&vport->hvPortName, &portParam->PortName, + sizeof (NDIS_SWITCH_PORT_NAME)); + /* For external and internal ports, 'portFriendlyName' is overwritten + * later. */ + RtlCopyMemory(&vport->portFriendlyName, &portParam->PortFriendlyName, + sizeof(NDIS_SWITCH_PORT_FRIENDLYNAME)); + + switch (vport->portState) { + case NdisSwitchPortStateCreated: + vport->ovsState = OVS_STATE_PORT_CREATED; + break; + case NdisSwitchPortStateTeardown: + vport->ovsState = OVS_STATE_PORT_TEAR_DOWN; + break; + case NdisSwitchPortStateDeleted: + vport->ovsState = OVS_STATE_PORT_DELETED; + break; + } +} + + +static VOID +OvsInitVportWithNicParam(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, + PNDIS_SWITCH_NIC_PARAMETERS nicParam) +{ + ASSERT(vport->portId == nicParam->PortId); + ASSERT(vport->ovsState == OVS_STATE_PORT_CREATED); + + UNREFERENCED_PARAMETER(switchContext); + + RtlCopyMemory(vport->permMacAddress, nicParam->PermanentMacAddress, + sizeof (nicParam->PermanentMacAddress)); + RtlCopyMemory(vport->currMacAddress, nicParam->CurrentMacAddress, + sizeof (nicParam->CurrentMacAddress)); + + if (nicParam->NicType == NdisSwitchNicTypeSynthetic || + nicParam->NicType == NdisSwitchNicTypeEmulated) { + RtlCopyMemory(vport->vmMacAddress, nicParam->VMMacAddress, + sizeof (nicParam->VMMacAddress)); + RtlCopyMemory(&vport->vmName, &nicParam->VmName, + sizeof (nicParam->VmName)); + } else { + RtlCopyMemory(&vport->netCfgInstanceId, &nicParam->NetCfgInstanceId, + sizeof (nicParam->NetCfgInstanceId)); + } + RtlCopyMemory(&vport->nicName, &nicParam->NicName, + sizeof (nicParam->NicName)); + vport->mtu = nicParam->MTU; + vport->nicState = nicParam->NicState; + vport->nicIndex = nicParam->NicIndex; + vport->numaNodeId = nicParam->NumaNodeId; + + switch (vport->nicState) { + case NdisSwitchNicStateCreated: + vport->ovsState = OVS_STATE_NIC_CREATED; + break; + case NdisSwitchNicStateConnected: + vport->ovsState = OVS_STATE_CONNECTED; + break; + case NdisSwitchNicStateDisconnected: + vport->ovsState = OVS_STATE_NIC_CREATED; + break; + case NdisSwitchNicStateDeleted: + vport->ovsState = OVS_STATE_PORT_CREATED; + break; + } +} + +/* + * -------------------------------------------------------------------------- + * Copies the relevant NDIS port properties from a virtual (pseudo) external + * NIC to a physical (real) external NIC. + * -------------------------------------------------------------------------- + */ +static VOID +OvsInitPhysNicVport(POVS_VPORT_ENTRY physExtVport, + POVS_VPORT_ENTRY virtExtVport, + UINT32 physNicIndex) +{ + physExtVport->portType = virtExtVport->portType; + physExtVport->portState = virtExtVport->portState; + physExtVport->portId = virtExtVport->portId; + physExtVport->nicState = NdisSwitchNicStateUnknown; + physExtVport->ovsType = OVS_VPORT_TYPE_NETDEV; + physExtVport->isExternal = TRUE; + physExtVport->isBridgeInternal = FALSE; + physExtVport->nicIndex = (NDIS_SWITCH_NIC_INDEX)physNicIndex; + + RtlCopyMemory(&physExtVport->hvPortName, &virtExtVport->hvPortName, + sizeof (NDIS_SWITCH_PORT_NAME)); + + /* 'portFriendlyName' is overwritten later. */ + RtlCopyMemory(&physExtVport->portFriendlyName, + &virtExtVport->portFriendlyName, + sizeof(NDIS_SWITCH_PORT_FRIENDLYNAME)); + + physExtVport->ovsState = OVS_STATE_PORT_CREATED; +} + +/* + * -------------------------------------------------------------------------- + * Initializes a tunnel vport. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsInitTunnelVport(PVOID userContext, + POVS_VPORT_ENTRY vport, + OVS_VPORT_TYPE ovsType, + UINT16 dstPort) +{ + NTSTATUS status = STATUS_SUCCESS; + POVS_USER_PARAMS_CONTEXT usrParamsCtx = + (POVS_USER_PARAMS_CONTEXT)userContext; + + vport->isBridgeInternal = FALSE; + vport->ovsType = ovsType; + vport->ovsState = OVS_STATE_PORT_CREATED; + switch (ovsType) { + case OVS_VPORT_TYPE_GRE: + break; + case OVS_VPORT_TYPE_GRE64: + break; + case OVS_VPORT_TYPE_VXLAN: + { + POVS_TUNFLT_INIT_CONTEXT tunnelContext = NULL; + + tunnelContext = OvsAllocateMemory(sizeof(*tunnelContext)); + if (tunnelContext == NULL) { + status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + tunnelContext->inputBuffer = usrParamsCtx->inputBuffer; + tunnelContext->outputBuffer = usrParamsCtx->outputBuffer; + tunnelContext->outputLength = usrParamsCtx->outputLength; + tunnelContext->vport = vport; + + status = OvsInitVxlanTunnel(usrParamsCtx->irp, + vport, + dstPort, + OvsTunnelVportPendingInit, + (PVOID)tunnelContext); + break; + } + case OVS_VPORT_TYPE_STT: + status = OvsInitSttTunnel(vport, dstPort); + break; + default: + ASSERT(0); + } + return status; +} + +/* + * -------------------------------------------------------------------------- + * Initializes a bridge internal vport ie. a port of type + * OVS_VPORT_TYPE_INTERNAL but not present on the Hyper-V switch. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsInitBridgeInternalVport(POVS_VPORT_ENTRY vport) +{ + vport->isBridgeInternal = TRUE; + vport->ovsType = OVS_VPORT_TYPE_INTERNAL; + /* Mark the status to be connected, since there is no other initialization + * for this port. */ + vport->ovsState = OVS_STATE_CONNECTED; + return STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * For external vports 'portFriendlyName' provided by Hyper-V is over-written + * by synthetic names. + * -------------------------------------------------------------------------- + */ +static VOID +AssignNicNameSpecial(POVS_VPORT_ENTRY vport) +{ + size_t len; + + if (vport->portType == NdisSwitchPortTypeExternal) { + if (vport->nicIndex == 0) { + ASSERT(vport->nicIndex == 0); + RtlStringCbPrintfW(vport->portFriendlyName.String, + IF_MAX_STRING_SIZE, + L"%s.virtualAdapter", OVS_DPPORT_EXTERNAL_NAME_W); + } else { + RtlStringCbPrintfW(vport->portFriendlyName.String, + IF_MAX_STRING_SIZE, + L"%s.%lu", OVS_DPPORT_EXTERNAL_NAME_W, + (UINT32)vport->nicIndex); + } + } else { + RtlStringCbPrintfW(vport->portFriendlyName.String, + IF_MAX_STRING_SIZE, + L"%s", OVS_DPPORT_INTERNAL_NAME_W); + } + + RtlStringCbLengthW(vport->portFriendlyName.String, IF_MAX_STRING_SIZE, + &len); + vport->portFriendlyName.Length = (USHORT)len; +} + + +/* + * -------------------------------------------------------------------------- + * Functionality common to any port on the Hyper-V switch. This function is not + * to be called for a port that is not on the Hyper-V switch. + * + * Inserts the port into 'portIdHashArray' and caches the pointer in the + * 'switchContext' if needed. + * + * For external NIC, assigns the name for the NIC. + * -------------------------------------------------------------------------- + */ +static NDIS_STATUS +InitHvVportCommon(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, + BOOLEAN newPort) +{ + UINT32 hash; + + switch (vport->portType) { + case NdisSwitchPortTypeExternal: + /* + * Overwrite the 'portFriendlyName' of this external vport. The reason + * for having this in common code is to be able to call it from the NDIS + * Port callback as well as the NDIS NIC callback. + */ + AssignNicNameSpecial(vport); + + if (vport->nicIndex == 0) { + switchContext->virtualExternalPortId = vport->portId; + switchContext->virtualExternalVport = vport; + } else { + switchContext->numPhysicalNics++; + } + break; + case NdisSwitchPortTypeInternal: + ASSERT(vport->isBridgeInternal == FALSE); + + /* Overwrite the 'portFriendlyName' of the internal vport. */ + AssignNicNameSpecial(vport); + switchContext->internalPortId = vport->portId; + switchContext->internalVport = vport; + break; + case NdisSwitchPortTypeSynthetic: + case NdisSwitchPortTypeEmulated: + break; + } + + /* + * It is important to not insert vport corresponding to virtual external + * port into the 'portIdHashArray' since the port should not be exposed to + * OVS userspace. + */ + if (vport->portType == NdisSwitchPortTypeExternal && + vport->nicIndex == 0) { + return NDIS_STATUS_SUCCESS; + } + + /* + * NOTE: OvsJhashWords has portId as "1" word. This should be ok, even + * though sizeof(NDIS_SWITCH_PORT_ID) = 4, not 2, because the + * hyper-v switch seems to use only 2 bytes out of 4. + */ + hash = OvsJhashWords(&vport->portId, 1, OVS_HASH_BASIS); + InsertHeadList(&switchContext->portIdHashArray[hash & OVS_VPORT_MASK], + &vport->portIdLink); + if (newPort) { + switchContext->numHvVports++; + } + return NDIS_STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * Functionality common to any port added from OVS userspace. + * + * Inserts the port into 'portNoHashArray', 'ovsPortNameHashArray' and in + * 'tunnelVportsArray' if appropriate. + * -------------------------------------------------------------------------- + */ +NDIS_STATUS +InitOvsVportCommon(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport) +{ + UINT32 hash; + + switch(vport->ovsType) { + case OVS_VPORT_TYPE_VXLAN: + case OVS_VPORT_TYPE_STT: + { + UINT16 dstPort = GetPortFromPriv(vport); + hash = OvsJhashBytes(&dstPort, + sizeof(dstPort), + OVS_HASH_BASIS); + InsertHeadList( + &gOvsSwitchContext->tunnelVportsArray[hash & OVS_VPORT_MASK], + &vport->tunnelVportLink); + switchContext->numNonHvVports++; + break; + } + case OVS_VPORT_TYPE_INTERNAL: + if (vport->isBridgeInternal) { + switchContext->numNonHvVports++; + } + default: + break; + } + + /* + * Insert the port into the hash array of ports: by port number and ovs + * and ovs (datapath) port name. + * NOTE: OvsJhashWords has portNo as "1" word. This is ok, because the + * portNo is stored in 2 bytes only (max port number = MAXUINT16). + */ + hash = OvsJhashWords(&vport->portNo, 1, OVS_HASH_BASIS); + InsertHeadList(&gOvsSwitchContext->portNoHashArray[hash & OVS_VPORT_MASK], + &vport->portNoLink); + + hash = OvsJhashBytes(vport->ovsName, strlen(vport->ovsName) + 1, + OVS_HASH_BASIS); + InsertHeadList( + &gOvsSwitchContext->ovsPortNameHashArray[hash & OVS_VPORT_MASK], + &vport->ovsNameLink); + + return STATUS_SUCCESS; +} + +static VOID +OvsCleanupVportCommon(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, + BOOLEAN hvSwitchPort, + BOOLEAN hvDelete, + BOOLEAN ovsDelete) +{ + BOOLEAN deletedOnOvs = FALSE; + BOOLEAN deletedOnHv = FALSE; + + /* + * 'hvDelete' == TRUE indicates that the port should be removed from the + * 'portIdHashArray', while 'ovsDelete' == TRUE indicates that the port + * should be removed from 'portNoHashArray' and the 'ovsPortNameHashArray'. + * + * Both 'hvDelete' and 'ovsDelete' can be set to TRUE by the caller. + */ + if (vport->isPresentOnHv == TRUE) { + deletedOnHv = TRUE; + } + if (vport->portNo == OVS_DPPORT_NUMBER_INVALID) { + deletedOnOvs = TRUE; + } + + if (hvDelete && !deletedOnHv) { + vport->isPresentOnHv = TRUE; + + /* Remove the port from the relevant lists. */ + RemoveEntryList(&vport->portIdLink); + InitializeListHead(&vport->portIdLink); + deletedOnHv = TRUE; + } + if (ovsDelete && !deletedOnOvs) { + vport->portNo = OVS_DPPORT_NUMBER_INVALID; + vport->ovsName[0] = '\0'; + + /* Remove the port from the relevant lists. */ + RemoveEntryList(&vport->ovsNameLink); + InitializeListHead(&vport->ovsNameLink); + RemoveEntryList(&vport->portNoLink); + InitializeListHead(&vport->portNoLink); + if (OVS_VPORT_TYPE_VXLAN == vport->ovsType || + OVS_VPORT_TYPE_STT == vport->ovsType) { + RemoveEntryList(&vport->tunnelVportLink); + InitializeListHead(&vport->tunnelVportLink); + } + + deletedOnOvs = TRUE; + } + + /* + * Deallocate the port if it has been deleted on the Hyper-V switch as well + * as OVS userspace. + */ + if (deletedOnHv && deletedOnOvs) { + if (hvSwitchPort) { + switchContext->numHvVports--; + } + else { + switchContext->numNonHvVports--; + } + OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); + } +} + +/* + * -------------------------------------------------------------------------- + * Provides functionality that is partly complementatry to + * InitOvsVportCommon()/InitHvVportCommon(). + * + * 'hvDelete' indicates if caller is removing the vport as a result of the + * port being removed on the Hyper-V switch. + * 'ovsDelete' indicates if caller is removing the vport as a result of the + * port being removed from OVS userspace. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsRemoveAndDeleteVport(PVOID usrParamsContext, + POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, + BOOLEAN hvDelete, + BOOLEAN ovsDelete) +{ + NTSTATUS status = STATUS_SUCCESS; + POVS_USER_PARAMS_CONTEXT usrParamsCtx = + (POVS_USER_PARAMS_CONTEXT)usrParamsContext; + BOOLEAN hvSwitchPort = FALSE; + + if (vport->isExternal) { + if (vport->nicIndex == 0) { + ASSERT(switchContext->numPhysicalNics == 0); + switchContext->virtualExternalPortId = 0; + switchContext->virtualExternalVport = NULL; + OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); + return STATUS_SUCCESS; + } else { + ASSERT(switchContext->numPhysicalNics); + switchContext->numPhysicalNics--; + hvSwitchPort = TRUE; + } + } + + switch (vport->ovsType) { + case OVS_VPORT_TYPE_INTERNAL: + if (!vport->isBridgeInternal) { + switchContext->internalPortId = 0; + switchContext->internalVport = NULL; + OvsInternalAdapterDown(); + hvSwitchPort = TRUE; + } + break; + case OVS_VPORT_TYPE_VXLAN: + { + POVS_TUNFLT_INIT_CONTEXT tunnelContext = NULL; + PIRP irp = NULL; + + tunnelContext = OvsAllocateMemory(sizeof(*tunnelContext)); + if (tunnelContext == NULL) { + status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + RtlZeroMemory(tunnelContext, sizeof(*tunnelContext)); + + tunnelContext->switchContext = switchContext; + tunnelContext->hvSwitchPort = hvSwitchPort; + tunnelContext->hvDelete = hvDelete; + tunnelContext->ovsDelete = ovsDelete; + tunnelContext->vport = vport; + + if (usrParamsCtx) { + tunnelContext->inputBuffer = usrParamsCtx->inputBuffer; + tunnelContext->outputBuffer = usrParamsCtx->outputBuffer; + tunnelContext->outputLength = usrParamsCtx->outputLength; + irp = usrParamsCtx->irp; + } + + status = OvsCleanupVxlanTunnel(irp, + vport, + OvsTunnelVportPendingUninit, + tunnelContext); + break; + } + case OVS_VPORT_TYPE_STT: + OvsCleanupSttTunnel(vport); + break; + case OVS_VPORT_TYPE_GRE: + case OVS_VPORT_TYPE_GRE64: + break; + case OVS_VPORT_TYPE_NETDEV: + hvSwitchPort = TRUE; + default: + break; + } + + if (STATUS_SUCCESS == status) { + OvsCleanupVportCommon(switchContext, + vport, + hvSwitchPort, + hvDelete, + ovsDelete); + } + + return status; +} + +NDIS_STATUS +OvsAddConfiguredSwitchPorts(POVS_SWITCH_CONTEXT switchContext) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + ULONG arrIndex; + PNDIS_SWITCH_PORT_PARAMETERS portParam; + PNDIS_SWITCH_PORT_ARRAY portArray = NULL; + POVS_VPORT_ENTRY vport; + + OVS_LOG_TRACE("Enter: switchContext:%p", switchContext); + + status = OvsGetPortsOnSwitch(switchContext, &portArray); + if (status != NDIS_STATUS_SUCCESS) { + goto cleanup; + } + + for (arrIndex = 0; arrIndex < portArray->NumElements; arrIndex++) { + portParam = NDIS_SWITCH_PORT_AT_ARRAY_INDEX(portArray, arrIndex); + + if (portParam->IsValidationPort) { + continue; + } + + vport = (POVS_VPORT_ENTRY)OvsAllocateVport(); + if (vport == NULL) { + status = NDIS_STATUS_RESOURCES; + goto cleanup; + } + OvsInitVportWithPortParam(vport, portParam); + status = InitHvVportCommon(switchContext, vport, TRUE); + if (status != NDIS_STATUS_SUCCESS) { + OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); + goto cleanup; + } + } + +cleanup: + if (status != NDIS_STATUS_SUCCESS) { + OvsClearAllSwitchVports(switchContext); + } + + OvsFreeSwitchPortsArray(portArray); + + OVS_LOG_TRACE("Exit: status: %x", status); + + return status; +} + + +NDIS_STATUS +OvsInitConfiguredSwitchNics(POVS_SWITCH_CONTEXT switchContext) +{ + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + PNDIS_SWITCH_NIC_ARRAY nicArray = NULL; + ULONG arrIndex; + PNDIS_SWITCH_NIC_PARAMETERS nicParam; + POVS_VPORT_ENTRY vport; + + OVS_LOG_TRACE("Enter: switchContext: %p", switchContext); + /* + * Now, get NIC list. + */ + status = OvsGetNicsOnSwitch(switchContext, &nicArray); + if (status != NDIS_STATUS_SUCCESS) { + goto cleanup; + } + for (arrIndex = 0; arrIndex < nicArray->NumElements; ++arrIndex) { + + nicParam = NDIS_SWITCH_NIC_AT_ARRAY_INDEX(nicArray, arrIndex); + + /* + * XXX: Check if the port is configured with a VLAN. Disallow such a + * configuration, since we don't support tag-in-tag. + */ + + /* + * XXX: Check if the port is connected to a VF. Disconnect the VF in + * such a case. + */ + + if (nicParam->NicType == NdisSwitchNicTypeExternal && + nicParam->NicIndex != 0) { + POVS_VPORT_ENTRY virtExtVport = + (POVS_VPORT_ENTRY)switchContext->virtualExternalVport; + + vport = OvsAllocateVport(); + if (vport) { + OvsInitPhysNicVport(vport, virtExtVport, + nicParam->NicIndex); + status = InitHvVportCommon(switchContext, vport, TRUE); + if (status != NDIS_STATUS_SUCCESS) { + OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); + vport = NULL; + } + } + } else { + vport = OvsFindVportByPortIdAndNicIndex(switchContext, + nicParam->PortId, + nicParam->NicIndex); + } + if (vport == NULL) { + OVS_LOG_ERROR("Fail to allocate vport"); + continue; + } + OvsInitVportWithNicParam(switchContext, vport, nicParam); + if (nicParam->NicType == NdisSwitchNicTypeInternal) { + OvsInternalAdapterUp(vport->portNo, &nicParam->NetCfgInstanceId); + } + } +cleanup: + + OvsFreeSwitchNicsArray(nicArray); + + OVS_LOG_TRACE("Exit: status: %x", status); + return status; +} + +/* + * -------------------------------------------------------------------------- + * Deletes ports added from the Hyper-V switch as well as OVS usersapce. The + * function deletes ports in 'portIdHashArray'. This will delete most of the + * ports that are in the 'portNoHashArray' as well. Any remaining ports + * are deleted by walking the the 'portNoHashArray'. + * -------------------------------------------------------------------------- + */ +VOID +OvsClearAllSwitchVports(POVS_SWITCH_CONTEXT switchContext) +{ + for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash++) { + PLIST_ENTRY head, link, next; + + head = &(switchContext->portIdHashArray[hash & OVS_VPORT_MASK]); + LIST_FORALL_SAFE(head, link, next) { + POVS_VPORT_ENTRY vport; + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portIdLink); + OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE); + } + } + + /* + * Remove 'virtualExternalVport' as well. This port is not part of the + * 'portIdHashArray'. + */ + if (switchContext->virtualExternalVport) { + OvsRemoveAndDeleteVport(NULL, switchContext, + (POVS_VPORT_ENTRY)switchContext->virtualExternalVport, TRUE, TRUE); + } + + + for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash++) { + PLIST_ENTRY head, link, next; + head = &(switchContext->portNoHashArray[hash & OVS_VPORT_MASK]); + LIST_FORALL_SAFE(head, link, next) { + POVS_VPORT_ENTRY vport; + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink); + ASSERT(OvsIsTunnelVportType(vport->ovsType) || + (vport->ovsType == OVS_VPORT_TYPE_INTERNAL && + vport->isBridgeInternal) || vport->isPresentOnHv == TRUE); + OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE); + } + } + + ASSERT(switchContext->virtualExternalVport == NULL); + ASSERT(switchContext->internalVport == NULL); +} + + +NTSTATUS +OvsConvertIfCountedStrToAnsiStr(PIF_COUNTED_STRING wStr, + CHAR *str, + UINT16 maxStrLen) +{ + ANSI_STRING astr; + UNICODE_STRING ustr; + NTSTATUS status; + UINT32 size; + + ustr.Buffer = wStr->String; + ustr.Length = wStr->Length; + ustr.MaximumLength = IF_MAX_STRING_SIZE; + + astr.Buffer = str; + astr.MaximumLength = maxStrLen; + astr.Length = 0; + + size = RtlUnicodeStringToAnsiSize(&ustr); + if (size > maxStrLen) { + return STATUS_BUFFER_OVERFLOW; + } + + status = RtlUnicodeStringToAnsiString(&astr, &ustr, FALSE); + + ASSERT(status == STATUS_SUCCESS); + if (status != STATUS_SUCCESS) { + return status; + } + ASSERT(astr.Length <= maxStrLen); + str[astr.Length] = 0; + return STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * Utility function that populates a 'OVS_VPORT_EXT_INFO' structure for the + * specified vport. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet, + POVS_VPORT_EXT_INFO extInfo) +{ + POVS_VPORT_ENTRY vport; + size_t len; + LOCK_STATE_EX lockState; + NTSTATUS status = STATUS_SUCCESS; + BOOLEAN doConvert = FALSE; + + RtlZeroMemory(extInfo, sizeof (POVS_VPORT_EXT_INFO)); + NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0); + if (vportGet->portNo == 0) { + StringCbLengthA(vportGet->name, OVS_MAX_PORT_NAME_LENGTH - 1, &len); + vport = OvsFindVportByHvNameA(gOvsSwitchContext, vportGet->name); + if (vport != NULL) { + /* If the port is not a Hyper-V port and it has been added earlier, + * we'll find it in 'ovsPortNameHashArray'. */ + vport = OvsFindVportByOvsName(gOvsSwitchContext, vportGet->name); + } + } else { + vport = OvsFindVportByPortNo(gOvsSwitchContext, vportGet->portNo); + } + if (vport == NULL || (vport->ovsState != OVS_STATE_CONNECTED && + vport->ovsState != OVS_STATE_NIC_CREATED)) { + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + if (vportGet->portNo) { + OVS_LOG_WARN("vport %u does not exist any more", vportGet->portNo); + } else { + OVS_LOG_WARN("vport %s does not exist any more", vportGet->name); + } + status = STATUS_DEVICE_DOES_NOT_EXIST; + goto ext_info_done; + } + extInfo->dpNo = vportGet->dpNo; + extInfo->portNo = vport->portNo; + RtlCopyMemory(extInfo->macAddress, vport->currMacAddress, + sizeof (vport->currMacAddress)); + RtlCopyMemory(extInfo->permMACAddress, vport->permMacAddress, + sizeof (vport->permMacAddress)); + if (vport->ovsType == OVS_VPORT_TYPE_NETDEV) { + RtlCopyMemory(extInfo->vmMACAddress, vport->vmMacAddress, + sizeof (vport->vmMacAddress)); + } + extInfo->nicIndex = vport->nicIndex; + extInfo->portId = vport->portId; + extInfo->type = vport->ovsType; + extInfo->mtu = vport->mtu; + /* + * TO be revisit XXX + */ + if (vport->ovsState == OVS_STATE_NIC_CREATED) { + extInfo->status = OVS_EVENT_CONNECT | OVS_EVENT_LINK_DOWN; + } else if (vport->ovsState == OVS_STATE_CONNECTED) { + extInfo->status = OVS_EVENT_CONNECT | OVS_EVENT_LINK_UP; + } else { + extInfo->status = OVS_EVENT_DISCONNECT; + } + if (extInfo->type == OVS_VPORT_TYPE_NETDEV && + (vport->ovsState == OVS_STATE_NIC_CREATED || + vport->ovsState == OVS_STATE_CONNECTED)) { + doConvert = TRUE; + } else { + extInfo->vmUUID[0] = 0; + extInfo->vifUUID[0] = 0; + } + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + if (doConvert) { + status = OvsConvertIfCountedStrToAnsiStr(&vport->portFriendlyName, + extInfo->name, + OVS_MAX_PORT_NAME_LENGTH); + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fail to convert NIC name."); + extInfo->vmUUID[0] = 0; + } + + status = OvsConvertIfCountedStrToAnsiStr(&vport->vmName, + extInfo->vmUUID, + OVS_MAX_VM_UUID_LEN); + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fail to convert VM name."); + extInfo->vmUUID[0] = 0; + } + + status = OvsConvertIfCountedStrToAnsiStr(&vport->nicName, + extInfo->vifUUID, + OVS_MAX_VIF_UUID_LEN); + if (status != STATUS_SUCCESS) { + OVS_LOG_INFO("Fail to convert nic UUID"); + extInfo->vifUUID[0] = 0; + } + /* + * for now ignore status + */ + status = STATUS_SUCCESS; + } + +ext_info_done: + return status; +} + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_WIN_NETDEV_CMD_GET'. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsGetNetdevCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS status = STATUS_SUCCESS; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + NL_ERROR nlError = NL_ERROR_SUCCESS; + OVS_VPORT_GET vportGet; + OVS_VPORT_EXT_INFO info; + + static const NL_POLICY ovsNetdevPolicy[] = { + [OVS_WIN_NETDEV_ATTR_NAME] = { .type = NL_A_STRING, + .minLen = 2, + .maxLen = IFNAMSIZ }, + }; + PNL_ATTR netdevAttrs[ARRAY_SIZE(ovsNetdevPolicy)]; + + /* input buffer has been validated while validating transaction dev op. */ + ASSERT(usrParamsCtx->inputBuffer != NULL && + usrParamsCtx->inputLength > sizeof *msgIn); + + if (msgOut == NULL || usrParamsCtx->outputLength < sizeof *msgOut) { + return STATUS_INVALID_BUFFER_SIZE; + } + + if (!NlAttrParse((PNL_MSG_HDR)msgIn, + NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), + ovsNetdevPolicy, netdevAttrs, ARRAY_SIZE(netdevAttrs))) { + return STATUS_INVALID_PARAMETER; + } + + vportGet.portNo = 0; + RtlCopyMemory(&vportGet.name, NlAttrGet(netdevAttrs[OVS_VPORT_ATTR_NAME]), + NlAttrGetSize(netdevAttrs[OVS_VPORT_ATTR_NAME])); + + status = OvsGetExtInfoIoctl(&vportGet, &info); + if (status == STATUS_DEVICE_DOES_NOT_EXIST) { + nlError = NL_ERROR_NODEV; + goto cleanup; + } + + status = CreateNetlinkMesgForNetdev(&info, msgIn, + usrParamsCtx->outputBuffer, usrParamsCtx->outputLength, + gOvsSwitchContext->dpNo); + if (status == STATUS_SUCCESS) { + *replyLen = msgOut->nlMsg.nlmsgLen; + } + +cleanup: + if (nlError != NL_ERROR_SUCCESS) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + + return STATUS_SUCCESS; +} + + +/* + * -------------------------------------------------------------------------- + * Utility function to construct an OVS_MESSAGE for the specified vport. The + * OVS_MESSAGE contains the output of a netdev command. + * -------------------------------------------------------------------------- + */ +static NTSTATUS +CreateNetlinkMesgForNetdev(POVS_VPORT_EXT_INFO info, + POVS_MESSAGE msgIn, + PVOID outBuffer, + UINT32 outBufLen, + int dpIfIndex) +{ + NL_BUFFER nlBuffer; + BOOLEAN ok; + PNL_MSG_HDR nlMsg; + UINT32 netdevFlags = 0; + + NlBufInit(&nlBuffer, outBuffer, outBufLen); + + ok = NlFillOvsMsg(&nlBuffer, msgIn->nlMsg.nlmsgType, NLM_F_MULTI, + msgIn->nlMsg.nlmsgSeq, msgIn->nlMsg.nlmsgPid, + msgIn->genlMsg.cmd, msgIn->genlMsg.version, + dpIfIndex); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailU32(&nlBuffer, OVS_WIN_NETDEV_ATTR_PORT_NO, + info->portNo); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailU32(&nlBuffer, OVS_WIN_NETDEV_ATTR_TYPE, info->type); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailString(&nlBuffer, OVS_WIN_NETDEV_ATTR_NAME, + info->name); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailUnspec(&nlBuffer, OVS_WIN_NETDEV_ATTR_MAC_ADDR, + (PCHAR)info->macAddress, sizeof (info->macAddress)); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailU32(&nlBuffer, OVS_WIN_NETDEV_ATTR_MTU, info->mtu); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + if (info->status != OVS_EVENT_CONNECT) { + netdevFlags = OVS_WIN_NETDEV_IFF_UP; + } + ok = NlMsgPutTailU32(&nlBuffer, OVS_WIN_NETDEV_ATTR_IF_FLAGS, + netdevFlags); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + /* + * XXX: add netdev_stats when we have the definition available in the + * kernel. + */ + + nlMsg = (PNL_MSG_HDR)NlBufAt(&nlBuffer, 0, 0); + nlMsg->nlmsgLen = NlBufSize(&nlBuffer); + + return STATUS_SUCCESS; +} + +static __inline VOID +OvsWaitActivate(POVS_SWITCH_CONTEXT switchContext, ULONG sleepMicroSec) +{ + while ((!switchContext->isActivated) && + (!switchContext->isActivateFailed)) { + /* Wait for the switch to be active and + * the list of ports in OVS to be initialized. */ + NdisMSleep(sleepMicroSec); + } +} + +static NTSTATUS +OvsCreateMsgFromVport(POVS_VPORT_ENTRY vport, + POVS_MESSAGE msgIn, + PVOID outBuffer, + UINT32 outBufLen, + int dpIfIndex) +{ + NL_BUFFER nlBuffer; + OVS_VPORT_FULL_STATS vportStats; + BOOLEAN ok; + PNL_MSG_HDR nlMsg; + + NlBufInit(&nlBuffer, outBuffer, outBufLen); + + ok = NlFillOvsMsg(&nlBuffer, msgIn->nlMsg.nlmsgType, NLM_F_MULTI, + msgIn->nlMsg.nlmsgSeq, msgIn->nlMsg.nlmsgPid, + msgIn->genlMsg.cmd, msgIn->genlMsg.version, + dpIfIndex); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailU32(&nlBuffer, OVS_VPORT_ATTR_PORT_NO, vport->portNo); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailU32(&nlBuffer, OVS_VPORT_ATTR_TYPE, vport->ovsType); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + ok = NlMsgPutTailString(&nlBuffer, OVS_VPORT_ATTR_NAME, vport->ovsName); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + /* + * XXX: when we implement OVS_DP_ATTR_USER_FEATURES in datapath, + * we'll need to check the OVS_DP_F_VPORT_PIDS flag: if it is set, + * it means we have an array of pids, instead of a single pid. + * ATM we assume we have one pid only. + */ + + ok = NlMsgPutTailU32(&nlBuffer, OVS_VPORT_ATTR_UPCALL_PID, + vport->upcallPid); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + /*stats*/ + vportStats.rxPackets = vport->stats.rxPackets; + vportStats.rxBytes = vport->stats.rxBytes; + vportStats.txPackets = vport->stats.txPackets; + vportStats.txBytes = vport->stats.txBytes; + vportStats.rxErrors = vport->errStats.rxErrors; + vportStats.txErrors = vport->errStats.txErrors; + vportStats.rxDropped = vport->errStats.rxDropped; + vportStats.txDropped = vport->errStats.txDropped; + + ok = NlMsgPutTailUnspec(&nlBuffer, OVS_VPORT_ATTR_STATS, + (PCHAR)&vportStats, + sizeof(OVS_VPORT_FULL_STATS)); + if (!ok) { + return STATUS_INVALID_BUFFER_SIZE; + } + + /* + * XXX: when vxlan udp dest port becomes configurable, we will also need + * to add vport options + */ + + nlMsg = (PNL_MSG_HDR)NlBufAt(&nlBuffer, 0, 0); + nlMsg->nlmsgLen = NlBufSize(&nlBuffer); + + return STATUS_SUCCESS; +} + +static NTSTATUS +OvsGetVportDumpNext(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + POVS_MESSAGE msgIn; + POVS_OPEN_INSTANCE instance = + (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance; + LOCK_STATE_EX lockState; + UINT32 i = OVS_MAX_VPORT_ARRAY_SIZE; + + /* + * XXX: this function shares some code with other dump command(s). + * In the future, we will need to refactor the dump functions + */ + + ASSERT(usrParamsCtx->devOp == OVS_READ_DEV_OP); + + if (instance->dumpState.ovsMsg == NULL) { + ASSERT(FALSE); + return STATUS_INVALID_DEVICE_STATE; + } + + /* Output buffer has been validated while validating read dev op. */ + ASSERT(usrParamsCtx->outputBuffer != NULL); + + msgIn = instance->dumpState.ovsMsg; + + /* + * XXX: when we implement OVS_DP_ATTR_USER_FEATURES in datapath, + * we'll need to check the OVS_DP_F_VPORT_PIDS flag: if it is set, + * it means we have an array of pids, instead of a single pid. + * ATM we assume we have one pid only. + */ + NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0); + + if (gOvsSwitchContext->numHvVports > 0 || + gOvsSwitchContext->numNonHvVports > 0) { + /* inBucket: the bucket, used for lookup */ + UINT32 inBucket = instance->dumpState.index[0]; + /* inIndex: index within the given bucket, used for lookup */ + UINT32 inIndex = instance->dumpState.index[1]; + /* the bucket to be used for the next dump operation */ + UINT32 outBucket = 0; + /* the index within the outBucket to be used for the next dump */ + UINT32 outIndex = 0; + + for (i = inBucket; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) { + PLIST_ENTRY head, link; + head = &(gOvsSwitchContext->portNoHashArray[i]); + POVS_VPORT_ENTRY vport = NULL; + + outIndex = 0; + LIST_FORALL(head, link) { + + /* + * if one or more dumps were previously done on this same bucket, + * inIndex will be > 0, so we'll need to reply with the + * inIndex + 1 vport from the bucket. + */ + if (outIndex >= inIndex) { + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink); + + ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID); + OvsCreateMsgFromVport(vport, msgIn, + usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength, + gOvsSwitchContext->dpNo); + ++outIndex; + break; + } + + ++outIndex; + } + + if (vport) { + break; + } + + /* + * if no vport was found above, check the next bucket, beginning + * with the first (i.e. index 0) elem from within that bucket + */ + inIndex = 0; + } + + outBucket = i; + + /* XXX: what about NLMSG_DONE (as msg type)? */ + instance->dumpState.index[0] = outBucket; + instance->dumpState.index[1] = outIndex; + } + + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + + /* if i < OVS_MAX_VPORT_ARRAY_SIZE => vport was found */ + if (i < OVS_MAX_VPORT_ARRAY_SIZE) { + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + *replyLen = msgOut->nlMsg.nlmsgLen; + } else { + /* + * if i >= OVS_MAX_VPORT_ARRAY_SIZE => vport was not found => + * it's dump done + */ + *replyLen = 0; + /* Free up the dump state, since there's no more data to continue. */ + FreeUserDumpState(instance); + } + + return STATUS_SUCCESS; +} + +static NTSTATUS +OvsGetVport(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS status = STATUS_SUCCESS; + LOCK_STATE_EX lockState; + + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + POVS_VPORT_ENTRY vport = NULL; + NL_ERROR nlError = NL_ERROR_SUCCESS; + PCHAR portName = NULL; + UINT32 portNameLen = 0; + UINT32 portNumber = OVS_DPPORT_NUMBER_INVALID; + + static const NL_POLICY ovsVportPolicy[] = { + [OVS_VPORT_ATTR_PORT_NO] = { .type = NL_A_U32, .optional = TRUE }, + [OVS_VPORT_ATTR_NAME] = { .type = NL_A_STRING, + .minLen = 2, + .maxLen = IFNAMSIZ, + .optional = TRUE}, + }; + PNL_ATTR vportAttrs[ARRAY_SIZE(ovsVportPolicy)]; + + /* input buffer has been validated while validating write dev op. */ + ASSERT(usrParamsCtx->inputBuffer != NULL); + + if (!NlAttrParse((PNL_MSG_HDR)msgIn, + NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), + ovsVportPolicy, vportAttrs, ARRAY_SIZE(vportAttrs))) { + return STATUS_INVALID_PARAMETER; + } + + /* Output buffer has been validated while validating transact dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0); + if (vportAttrs[OVS_VPORT_ATTR_NAME] != NULL) { + portName = NlAttrGet(vportAttrs[OVS_VPORT_ATTR_NAME]); + portNameLen = NlAttrGetSize(vportAttrs[OVS_VPORT_ATTR_NAME]); + + /* the port name is expected to be null-terminated */ + ASSERT(portName[portNameLen - 1] == '\0'); + + vport = OvsFindVportByOvsName(gOvsSwitchContext, portName); + } else if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) { + portNumber = NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_PORT_NO]); + + vport = OvsFindVportByPortNo(gOvsSwitchContext, portNumber); + } else { + nlError = NL_ERROR_INVAL; + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + goto Cleanup; + } + + if (!vport) { + nlError = NL_ERROR_NODEV; + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + goto Cleanup; + } + + status = OvsCreateMsgFromVport(vport, msgIn, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength, + gOvsSwitchContext->dpNo); + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + + *replyLen = msgOut->nlMsg.nlmsgLen; + +Cleanup: + if (nlError != NL_ERROR_SUCCESS) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + + return STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_VPORT_CMD_GET'. + * + * The function handles the initial call to setup the dump state, as well as + * subsequent calls to continue dumping data. + * -------------------------------------------------------------------------- +*/ +NTSTATUS +OvsGetVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + *replyLen = 0; + + switch (usrParamsCtx->devOp) { + case OVS_WRITE_DEV_OP: + return OvsSetupDumpStart(usrParamsCtx); + + case OVS_READ_DEV_OP: + return OvsGetVportDumpNext(usrParamsCtx, replyLen); + + case OVS_TRANSACTION_DEV_OP: + return OvsGetVport(usrParamsCtx, replyLen); + + default: + return STATUS_INVALID_DEVICE_REQUEST; + } + +} + +static UINT32 +OvsComputeVportNo(POVS_SWITCH_CONTEXT switchContext) +{ + /* we are not allowed to create the port OVS_DPPORT_NUMBER_LOCAL */ + for (ULONG i = OVS_DPPORT_NUMBER_LOCAL + 1; i < MAXUINT16; ++i) { + POVS_VPORT_ENTRY vport; + + vport = OvsFindVportByPortNo(switchContext, i); + if (!vport) { + return i; + } + } + + return OVS_DPPORT_NUMBER_INVALID; +} + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_VPORT_CMD_NEW'. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsNewVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NDIS_STATUS status = STATUS_SUCCESS; + LOCK_STATE_EX lockState; + + NL_ERROR nlError = NL_ERROR_SUCCESS; + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + POVS_VPORT_ENTRY vport = NULL; + PCHAR portName; + ULONG portNameLen; + UINT32 portType; + BOOLEAN isBridgeInternal = FALSE; + BOOLEAN vportAllocated = FALSE, vportInitialized = FALSE; + BOOLEAN addInternalPortAsNetdev = FALSE; + + static const NL_POLICY ovsVportPolicy[] = { + [OVS_VPORT_ATTR_PORT_NO] = { .type = NL_A_U32, .optional = TRUE }, + [OVS_VPORT_ATTR_TYPE] = { .type = NL_A_U32, .optional = FALSE }, + [OVS_VPORT_ATTR_NAME] = { .type = NL_A_STRING, .maxLen = IFNAMSIZ, + .optional = FALSE}, + [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NL_A_UNSPEC, + .optional = FALSE }, + [OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = TRUE }, + }; + + PNL_ATTR vportAttrs[ARRAY_SIZE(ovsVportPolicy)]; + + /* input buffer has been validated while validating write dev op. */ + ASSERT(usrParamsCtx->inputBuffer != NULL); + + /* Output buffer has been validated while validating transact dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + if (!NlAttrParse((PNL_MSG_HDR)msgIn, + NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), + ovsVportPolicy, vportAttrs, ARRAY_SIZE(vportAttrs))) { + return STATUS_INVALID_PARAMETER; + } + + portName = NlAttrGet(vportAttrs[OVS_VPORT_ATTR_NAME]); + portNameLen = NlAttrGetSize(vportAttrs[OVS_VPORT_ATTR_NAME]); + portType = NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_TYPE]); + + /* we are expecting null terminated strings to be passed */ + ASSERT(portName[portNameLen - 1] == '\0'); + + NdisAcquireRWLockWrite(gOvsSwitchContext->dispatchLock, &lockState, 0); + + vport = OvsFindVportByOvsName(gOvsSwitchContext, portName); + if (vport) { + nlError = NL_ERROR_EXIST; + goto Cleanup; + } + + if (portName && portType == OVS_VPORT_TYPE_NETDEV && + !strcmp(OVS_DPPORT_INTERNAL_NAME_A, portName)) { + addInternalPortAsNetdev = TRUE; + } + + if (portName && portType == OVS_VPORT_TYPE_INTERNAL && + strcmp(OVS_DPPORT_INTERNAL_NAME_A, portName)) { + isBridgeInternal = TRUE; + } + + if (portType == OVS_VPORT_TYPE_INTERNAL && !isBridgeInternal) { + vport = gOvsSwitchContext->internalVport; + } else if (portType == OVS_VPORT_TYPE_NETDEV) { + /* External ports can also be looked up like VIF ports. */ + vport = OvsFindVportByHvNameA(gOvsSwitchContext, portName); + } else { + ASSERT(OvsIsTunnelVportType(portType) || + (portType == OVS_VPORT_TYPE_INTERNAL && isBridgeInternal)); + + vport = (POVS_VPORT_ENTRY)OvsAllocateVport(); + if (vport == NULL) { + nlError = NL_ERROR_NOMEM; + goto Cleanup; + } + vportAllocated = TRUE; + + if (OvsIsTunnelVportType(portType)) { + UINT16 transportPortDest = 0; + + switch (vport->ovsType) { + case OVS_VPORT_TYPE_VXLAN: + transportPortDest = VXLAN_UDP_PORT; + break; + case OVS_VPORT_TYPE_STT: + transportPortDest = STT_TCP_PORT; + break; + default: + break; + } + + PNL_ATTR attr = NlAttrFindNested(vportAttrs[OVS_VPORT_ATTR_OPTIONS], + OVS_TUNNEL_ATTR_DST_PORT); + if (attr) { + transportPortDest = NlAttrGetU16(attr); + } + + status = OvsInitTunnelVport(usrParamsCtx, + vport, + portType, + transportPortDest); + + nlError = NlMapStatusToNlErr(status); + } else { + OvsInitBridgeInternalVport(vport); + } + + vportInitialized = TRUE; + + if (nlError == NL_ERROR_SUCCESS) { + vport->ovsState = OVS_STATE_CONNECTED; + vport->nicState = NdisSwitchNicStateConnected; + + /* + * Allow the vport to be deleted, because there is no + * corresponding hyper-v switch part. + */ + vport->isPresentOnHv = TRUE; + } else { + goto Cleanup; + } + } + + if (!vport) { + nlError = NL_ERROR_INVAL; + goto Cleanup; + } + if (vport->portNo != OVS_DPPORT_NUMBER_INVALID) { + nlError = NL_ERROR_EXIST; + goto Cleanup; + } + + /* Initialize the vport with OVS specific properties. */ + if (addInternalPortAsNetdev != TRUE) { + vport->ovsType = portType; + } + if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) { + /* + * XXX: when we implement the limit for ovs port number to be + * MAXUINT16, we'll need to check the port number received from the + * userspace. + */ + vport->portNo = NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_PORT_NO]); + } else { + vport->portNo = OvsComputeVportNo(gOvsSwitchContext); + if (vport->portNo == OVS_DPPORT_NUMBER_INVALID) { + nlError = NL_ERROR_NOMEM; + goto Cleanup; + } + } + + /* The ovs port name must be uninitialized. */ + ASSERT(vport->ovsName[0] == '\0'); + ASSERT(portNameLen <= OVS_MAX_PORT_NAME_LENGTH); + + RtlCopyMemory(vport->ovsName, portName, portNameLen); + /* if we don't have options, then vport->portOptions will be NULL */ + vport->portOptions = vportAttrs[OVS_VPORT_ATTR_OPTIONS]; + + /* + * XXX: when we implement OVS_DP_ATTR_USER_FEATURES in datapath, + * we'll need to check the OVS_DP_F_VPORT_PIDS flag: if it is set, + * it means we have an array of pids, instead of a single pid. + * ATM we assume we have one pid only. + */ + vport->upcallPid = NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_UPCALL_PID]); + + status = InitOvsVportCommon(gOvsSwitchContext, vport); + ASSERT(status == STATUS_SUCCESS); + + status = OvsCreateMsgFromVport(vport, msgIn, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength, + gOvsSwitchContext->dpNo); + + *replyLen = msgOut->nlMsg.nlmsgLen; + +Cleanup: + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + + if ((nlError != NL_ERROR_SUCCESS) && (nlError != NL_ERROR_PENDING)) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + + if (vport && vportAllocated == TRUE) { + if (vportInitialized == TRUE) { + if (OvsIsTunnelVportType(portType)) { + switch (vport->ovsType) { + case OVS_VPORT_TYPE_VXLAN: + OvsCleanupVxlanTunnel(NULL, vport, NULL, NULL); + break; + case OVS_VPORT_TYPE_STT: + OvsCleanupSttTunnel(vport);; + break; + default: + ASSERT(!"Invalid tunnel port type"); + } + } + } + OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); + } + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + + return (status == STATUS_PENDING) ? STATUS_PENDING : STATUS_SUCCESS; +} + + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_VPORT_CMD_SET'. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsSetVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NDIS_STATUS status = STATUS_SUCCESS; + LOCK_STATE_EX lockState; + + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + POVS_VPORT_ENTRY vport = NULL; + NL_ERROR nlError = NL_ERROR_SUCCESS; + + static const NL_POLICY ovsVportPolicy[] = { + [OVS_VPORT_ATTR_PORT_NO] = { .type = NL_A_U32, .optional = TRUE }, + [OVS_VPORT_ATTR_TYPE] = { .type = NL_A_U32, .optional = TRUE }, + [OVS_VPORT_ATTR_NAME] = { .type = NL_A_STRING, .maxLen = IFNAMSIZ, + .optional = TRUE }, + [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NL_A_UNSPEC, + .optional = TRUE }, + [OVS_VPORT_ATTR_STATS] = { .type = NL_A_UNSPEC, + .minLen = sizeof(OVS_VPORT_FULL_STATS), + .maxLen = sizeof(OVS_VPORT_FULL_STATS), + .optional = TRUE }, + [OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = TRUE }, + }; + PNL_ATTR vportAttrs[ARRAY_SIZE(ovsVportPolicy)]; + + ASSERT(usrParamsCtx->inputBuffer != NULL); + + if (!NlAttrParse((PNL_MSG_HDR)msgIn, + NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), + ovsVportPolicy, vportAttrs, ARRAY_SIZE(vportAttrs))) { + return STATUS_INVALID_PARAMETER; + } + + /* Output buffer has been validated while validating transact dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + NdisAcquireRWLockWrite(gOvsSwitchContext->dispatchLock, &lockState, 0); + if (vportAttrs[OVS_VPORT_ATTR_NAME] != NULL) { + PSTR portName = NlAttrGet(vportAttrs[OVS_VPORT_ATTR_NAME]); +#ifdef DBG + UINT32 portNameLen = NlAttrGetSize(vportAttrs[OVS_VPORT_ATTR_NAME]); +#endif + /* the port name is expected to be null-terminated */ + ASSERT(portName[portNameLen - 1] == '\0'); + + vport = OvsFindVportByOvsName(gOvsSwitchContext, portName); + } else if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) { + vport = OvsFindVportByPortNo(gOvsSwitchContext, + NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_PORT_NO])); + } + + if (!vport) { + nlError = NL_ERROR_NODEV; + goto Cleanup; + } + + /* + * XXX: when we implement OVS_DP_ATTR_USER_FEATURES in datapath, + * we'll need to check the OVS_DP_F_VPORT_PIDS flag: if it is set, + * it means we have an array of pids, instead of a single pid. + * Currently, we support only one pid. + */ + if (vportAttrs[OVS_VPORT_ATTR_UPCALL_PID]) { + vport->upcallPid = NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_UPCALL_PID]); + } + + if (vportAttrs[OVS_VPORT_ATTR_TYPE]) { + OVS_VPORT_TYPE type = NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_TYPE]); + if (type != vport->ovsType) { + nlError = NL_ERROR_INVAL; + goto Cleanup; + } + } + + if (vportAttrs[OVS_VPORT_ATTR_OPTIONS]) { + OVS_LOG_ERROR("Vport options not supported"); + nlError = NL_ERROR_NOTSUPP; + goto Cleanup; + } + + status = OvsCreateMsgFromVport(vport, msgIn, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength, + gOvsSwitchContext->dpNo); + + *replyLen = msgOut->nlMsg.nlmsgLen; + +Cleanup: + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + + if (nlError != NL_ERROR_SUCCESS) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + + return STATUS_SUCCESS; +} + +/* + * -------------------------------------------------------------------------- + * Command Handler for 'OVS_VPORT_CMD_DEL'. + * -------------------------------------------------------------------------- + */ +NTSTATUS +OvsDeleteVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NDIS_STATUS status = STATUS_SUCCESS; + LOCK_STATE_EX lockState; + + POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer; + POVS_VPORT_ENTRY vport = NULL; + NL_ERROR nlError = NL_ERROR_SUCCESS; + PSTR portName = NULL; + UINT32 portNameLen = 0; + + static const NL_POLICY ovsVportPolicy[] = { + [OVS_VPORT_ATTR_PORT_NO] = { .type = NL_A_U32, .optional = TRUE }, + [OVS_VPORT_ATTR_NAME] = { .type = NL_A_STRING, .maxLen = IFNAMSIZ, + .optional = TRUE }, + }; + PNL_ATTR vportAttrs[ARRAY_SIZE(ovsVportPolicy)]; + + ASSERT(usrParamsCtx->inputBuffer != NULL); + + if (!NlAttrParse((PNL_MSG_HDR)msgIn, + NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), + ovsVportPolicy, vportAttrs, ARRAY_SIZE(vportAttrs))) { + return STATUS_INVALID_PARAMETER; + } + + /* Output buffer has been validated while validating transact dev op. */ + ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut); + + NdisAcquireRWLockWrite(gOvsSwitchContext->dispatchLock, &lockState, 0); + if (vportAttrs[OVS_VPORT_ATTR_NAME] != NULL) { + portName = NlAttrGet(vportAttrs[OVS_VPORT_ATTR_NAME]); + portNameLen = NlAttrGetSize(vportAttrs[OVS_VPORT_ATTR_NAME]); + + /* the port name is expected to be null-terminated */ + ASSERT(portName[portNameLen - 1] == '\0'); + + vport = OvsFindVportByOvsName(gOvsSwitchContext, portName); + } + else if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) { + vport = OvsFindVportByPortNo(gOvsSwitchContext, + NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_PORT_NO])); + } + + if (!vport) { + nlError = NL_ERROR_NODEV; + goto Cleanup; + } + + status = OvsCreateMsgFromVport(vport, msgIn, usrParamsCtx->outputBuffer, + usrParamsCtx->outputLength, + gOvsSwitchContext->dpNo); + + *replyLen = msgOut->nlMsg.nlmsgLen; + + /* + * Mark the port as deleted from OVS userspace. If the port does not exist + * on the Hyper-V switch, it gets deallocated. Otherwise, it stays. + */ + status = OvsRemoveAndDeleteVport(usrParamsCtx, + gOvsSwitchContext, + vport, + FALSE, + TRUE); + if (status) { + nlError = NlMapStatusToNlErr(status); + } + +Cleanup: + NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState); + + if ((nlError != NL_ERROR_SUCCESS) && (nlError != NL_ERROR_PENDING)) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) + usrParamsCtx->outputBuffer; + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + + return (status == STATUS_PENDING) ? STATUS_PENDING : STATUS_SUCCESS; +} + +static VOID +OvsTunnelVportPendingUninit(PVOID context, + NTSTATUS status, + UINT32 *replyLen) +{ + POVS_TUNFLT_INIT_CONTEXT tunnelContext = + (POVS_TUNFLT_INIT_CONTEXT) context; + POVS_SWITCH_CONTEXT switchContext = tunnelContext->switchContext; + POVS_VPORT_ENTRY vport = tunnelContext->vport; + POVS_MESSAGE msgIn = (POVS_MESSAGE)tunnelContext->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)tunnelContext->outputBuffer; + NL_ERROR nlError = NlMapStatusToNlErr(status); + LOCK_STATE_EX lockState; + + NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0); + + if (msgIn && msgOut) { + /* Check the received status to reply to the caller. */ + if (STATUS_SUCCESS == status) { + OvsCreateMsgFromVport(vport, + msgIn, + msgOut, + tunnelContext->outputLength, + switchContext->dpNo); + + *replyLen = msgOut->nlMsg.nlmsgLen; + } else { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR)msgOut; + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } + } + + OvsCleanupVportCommon(switchContext, + vport, + tunnelContext->hvSwitchPort, + tunnelContext->hvDelete, + tunnelContext->ovsDelete); + + NdisReleaseRWLock(switchContext->dispatchLock, &lockState); +} + +static VOID +OvsTunnelVportPendingInit(PVOID context, + NTSTATUS status, + UINT32 *replyLen) +{ + POVS_TUNFLT_INIT_CONTEXT tunnelContext = + (POVS_TUNFLT_INIT_CONTEXT) context; + POVS_VPORT_ENTRY vport = tunnelContext->vport; + POVS_MESSAGE msgIn = (POVS_MESSAGE)tunnelContext->inputBuffer; + POVS_MESSAGE msgOut = (POVS_MESSAGE)tunnelContext->outputBuffer; + PCHAR portName; + ULONG portNameLen = 0; + UINT32 portType = 0; + NL_ERROR nlError = NL_ERROR_SUCCESS; + BOOLEAN error = TRUE; + + do { + if (!NT_SUCCESS(status)) { + nlError = NlMapStatusToNlErr(status); + break; + } + + static const NL_POLICY ovsVportPolicy[] = { + [OVS_VPORT_ATTR_PORT_NO] = { .type = NL_A_U32, .optional = TRUE }, + [OVS_VPORT_ATTR_TYPE] = { .type = NL_A_U32, .optional = FALSE }, + [OVS_VPORT_ATTR_NAME] = { .type = NL_A_STRING, .maxLen = IFNAMSIZ, + .optional = FALSE }, + [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NL_A_UNSPEC, + .optional = FALSE }, + [OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = TRUE }, + }; + + PNL_ATTR vportAttrs[ARRAY_SIZE(ovsVportPolicy)]; + + /* input buffer has been validated while validating write dev op. */ + ASSERT(msgIn != NULL); + + /* Output buffer has been validated while validating transact dev op. */ + ASSERT(msgOut != NULL && tunnelContext->outputLength >= sizeof *msgOut); + + if (!NlAttrParse((PNL_MSG_HDR)msgIn, + NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN, + NlMsgAttrsLen((PNL_MSG_HDR)msgIn), + ovsVportPolicy, vportAttrs, ARRAY_SIZE(vportAttrs))) { + nlError = NL_ERROR_INVAL; + break; + } + + portName = NlAttrGet(vportAttrs[OVS_VPORT_ATTR_NAME]); + portNameLen = NlAttrGetSize(vportAttrs[OVS_VPORT_ATTR_NAME]); + portType = NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_TYPE]); + + if (vport->portNo != OVS_DPPORT_NUMBER_INVALID) { + nlError = NL_ERROR_EXIST; + break; + } + + vport->ovsState = OVS_STATE_CONNECTED; + vport->nicState = NdisSwitchNicStateConnected; + + /* + * Allow the vport to be deleted, because there is no + * corresponding hyper-v switch part. + */ + vport->isPresentOnHv = TRUE; + + if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) { + /* + * XXX: when we implement the limit for OVS port number to be + * MAXUINT16, we'll need to check the port number received from the + * userspace. + */ + vport->portNo = + NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_PORT_NO]); + } else { + vport->portNo = + OvsComputeVportNo(gOvsSwitchContext); + if (vport->portNo == OVS_DPPORT_NUMBER_INVALID) { + nlError = NL_ERROR_NOMEM; + break; + } + } + + /* The ovs port name must be uninitialized. */ + ASSERT(vport->ovsName[0] == '\0'); + ASSERT(portNameLen <= OVS_MAX_PORT_NAME_LENGTH); + + RtlCopyMemory(vport->ovsName, portName, portNameLen); + /* if we don't have options, then vport->portOptions will be NULL */ + vport->portOptions = vportAttrs[OVS_VPORT_ATTR_OPTIONS]; + + /* + * XXX: when we implement OVS_DP_ATTR_USER_FEATURES in datapath, + * we'll need to check the OVS_DP_F_VPORT_PIDS flag: if it is set, + * it means we have an array of pids, instead of a single pid. + * ATM we assume we have one pid only. + */ + vport->upcallPid = + NlAttrGetU32(vportAttrs[OVS_VPORT_ATTR_UPCALL_PID]); + + status = InitOvsVportCommon(gOvsSwitchContext, vport); + ASSERT(status == STATUS_SUCCESS); + + OvsCreateMsgFromVport(vport, + msgIn, + msgOut, + tunnelContext->outputLength, + gOvsSwitchContext->dpNo); + + *replyLen = msgOut->nlMsg.nlmsgLen; + + error = FALSE; + } while (error); + + if (error) { + POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) msgOut; + + OvsCleanupVxlanTunnel(NULL, vport, NULL, NULL); + OvsFreeMemory(vport); + + NlBuildErrorMsg(msgIn, msgError, nlError); + *replyLen = msgError->nlMsg.nlmsgLen; + } +} diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Vport.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vport.h --- openvswitch-2.3.1/datapath-windows/ovsext/Vport.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vport.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __VPORT_H_ +#define __VPORT_H_ 1 + +#include "Switch.h" +#include "VxLan.h" +#include "Stt.h" + +#define OVS_MAX_DPPORTS MAXUINT16 +#define OVS_DPPORT_NUMBER_INVALID OVS_MAX_DPPORTS +/* + * The local port (0) is a reserved port, that is not allowed to be be + * created by the netlink command vport add. On linux, this port is created + * at netlink command datapath new. However, on windows, we do not need to + * create it, and more, we shouldn't. The userspace attempts to create two + * internal vports, the LOCAL port (0) and the internal port (with any other + * port number). The non-LOCAL internal port is used in the userspace when it + * requests the internal port. + */ +#define OVS_DPPORT_NUMBER_LOCAL 0 + +#define OVS_DPPORT_INTERNAL_NAME_A "internal" +#define OVS_DPPORT_INTERNAL_NAME_W L"internal" +#define OVS_DPPORT_EXTERNAL_NAME_A "external" +#define OVS_DPPORT_EXTERNAL_NAME_W L"external" + +/* + * A Vport, or Virtual Port, is a port on the OVS. It can be one of the + * following types. Some of the Vports are "real" ports on the hyper-v switch, + * and some are not: + * - VIF port (VM's NIC) + * - External Adapters (physical NIC) + * - Internal Adapter (Virtual adapter exposed on the host). + * - Tunnel ports created by OVS userspace. + */ + +typedef enum { + OVS_STATE_UNKNOWN, + OVS_STATE_PORT_CREATED, + OVS_STATE_NIC_CREATED, + OVS_STATE_CONNECTED, + OVS_STATE_PORT_TEAR_DOWN, + OVS_STATE_PORT_DELETED, +} OVS_VPORT_STATE; + +typedef struct _OVS_VPORT_STATS { + UINT64 rxPackets; + UINT64 txPackets; + UINT64 rxBytes; + UINT64 txBytes; +} OVS_VPORT_STATS; + +typedef struct _OVS_VPORT_ERR_STATS { + UINT64 rxErrors; + UINT64 txErrors; + UINT64 rxDropped; + UINT64 txDropped; +} OVS_VPORT_ERR_STATS; + +/* used for vport netlink commands. */ +typedef struct _OVS_VPORT_FULL_STATS { + OVS_VPORT_STATS; + OVS_VPORT_ERR_STATS; +}OVS_VPORT_FULL_STATS; +/* + * Each internal, external adapter or vritual adapter has + * one vport entry. In addition, we have one vport for each + * tunnel type, such as vxlan, gre, gre64 + */ +typedef struct _OVS_VPORT_ENTRY { + LIST_ENTRY ovsNameLink; + LIST_ENTRY portIdLink; + LIST_ENTRY portNoLink; + LIST_ENTRY tunnelVportLink; + + OVS_VPORT_STATE ovsState; + OVS_VPORT_TYPE ovsType; + OVS_VPORT_STATS stats; + OVS_VPORT_ERR_STATS errStats; + UINT32 portNo; + UINT32 mtu; + /* ovsName is the ovs (datapath) port name - it is null terminated. */ + CHAR ovsName[OVS_MAX_PORT_NAME_LENGTH]; + + PVOID priv; + NDIS_SWITCH_PORT_ID portId; + NDIS_SWITCH_NIC_INDEX nicIndex; + UINT16 numaNodeId; + NDIS_SWITCH_PORT_STATE portState; + NDIS_SWITCH_NIC_STATE nicState; + NDIS_SWITCH_PORT_TYPE portType; + + UINT8 permMacAddress[ETH_ADDR_LEN]; + UINT8 currMacAddress[ETH_ADDR_LEN]; + UINT8 vmMacAddress[ETH_ADDR_LEN]; + + NDIS_SWITCH_PORT_NAME hvPortName; + IF_COUNTED_STRING portFriendlyName; + NDIS_SWITCH_NIC_NAME nicName; + NDIS_VM_NAME vmName; + GUID netCfgInstanceId; + /* + * OVS userpace has a notion of bridges which basically defines an + * L2-domain. Each "bridge" has an "internal" port of type + * OVS_VPORT_TYPE_INTERNAL. Such a port is connected to the OVS datapath in + * one end, and the other end is a virtual adapter on the hypervisor host. + * This is akin to the Hyper-V "internal" NIC. It is intuitive to map the + * Hyper-V "internal" NIC to the OVS bridge's "internal" port, but there's + * only one Hyper-V NIC but multiple bridges. To support multiple OVS bridge + * "internal" ports, we use the flag 'isBridgeInternal' in each vport. We + * support addition of multiple bridge-internal ports. A vport with + * 'isBridgeInternal' == TRUE is a dummy port and has no backing currently. + * If a flow actions specifies the output port to be a bridge-internal port, + * the port is silently ignored. + */ + BOOLEAN isBridgeInternal; + BOOLEAN isExternal; + UINT32 upcallPid; /* netlink upcall port id */ + PNL_ATTR portOptions; + BOOLEAN isPresentOnHv; /* Is this port present on the + Hyper-V switch? */ +} OVS_VPORT_ENTRY, *POVS_VPORT_ENTRY; + +struct _OVS_SWITCH_CONTEXT; + +POVS_VPORT_ENTRY OvsFindVportByPortNo(POVS_SWITCH_CONTEXT switchContext, + UINT32 portNo); +/* "name" is null-terminated */ +POVS_VPORT_ENTRY OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext, + PSTR name); +POVS_VPORT_ENTRY OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext, + PSTR name); +POVS_VPORT_ENTRY OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT switchContext, + NDIS_SWITCH_PORT_ID portId, + NDIS_SWITCH_NIC_INDEX index); +POVS_VPORT_ENTRY OvsFindTunnelVportByDstPort(POVS_SWITCH_CONTEXT switchContext, + UINT16 dstPort, + OVS_VPORT_TYPE ovsVportType); + +NDIS_STATUS OvsAddConfiguredSwitchPorts(struct _OVS_SWITCH_CONTEXT *switchContext); +NDIS_STATUS OvsInitConfiguredSwitchNics(struct _OVS_SWITCH_CONTEXT *switchContext); + +VOID OvsClearAllSwitchVports(struct _OVS_SWITCH_CONTEXT *switchContext); + +NDIS_STATUS HvCreateNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam); +NDIS_STATUS HvCreatePort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParam); +NDIS_STATUS HvUpdatePort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParam); +VOID HvTeardownPort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParam); +VOID HvDeletePort(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_PORT_PARAMETERS portParam); +VOID HvConnectNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam); +VOID HvUpdateNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam); +VOID HvDeleteNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam); +VOID HvDisconnectNic(POVS_SWITCH_CONTEXT switchContext, + PNDIS_SWITCH_NIC_PARAMETERS nicParam); + +static __inline BOOLEAN +OvsIsTunnelVportType(OVS_VPORT_TYPE ovsType) +{ + return ovsType == OVS_VPORT_TYPE_VXLAN || + ovsType == OVS_VPORT_TYPE_STT || + ovsType == OVS_VPORT_TYPE_GRE || + ovsType == OVS_VPORT_TYPE_GRE64; +} + + +static __inline PVOID +GetOvsVportPriv(POVS_VPORT_ENTRY ovsVport) +{ + return ovsVport->priv; +} + +static __inline BOOLEAN +OvsIsInternalVportType(OVS_VPORT_TYPE ovsType) +{ + return ovsType == OVS_VPORT_TYPE_INTERNAL; +} + +static __inline BOOLEAN +OvsIsBridgeInternalVport(POVS_VPORT_ENTRY vport) +{ + if (vport->isBridgeInternal) { + ASSERT(vport->ovsType == OVS_VPORT_TYPE_INTERNAL); + } + return vport->isBridgeInternal == TRUE; +} + +NTSTATUS OvsRemoveAndDeleteVport(PVOID usrParamsCtx, + POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport, + BOOLEAN hvDelete, BOOLEAN ovsDelete); +static __inline POVS_VPORT_ENTRY +OvsGetExternalVport(POVS_SWITCH_CONTEXT switchContext) +{ + return switchContext->virtualExternalVport; +} + +static __inline UINT32 +OvsGetExternalMtu(POVS_SWITCH_CONTEXT switchContext) +{ + ASSERT(OvsGetExternalVport(switchContext)); + return ((POVS_VPORT_ENTRY) OvsGetExternalVport(switchContext))->mtu; +} + +static __inline UINT16 +GetPortFromPriv(POVS_VPORT_ENTRY vport) +{ + UINT16 dstPort = 0; + PVOID vportPriv = GetOvsVportPriv(vport); + + /* XXX would better to have a commom tunnel "parent" structure */ + ASSERT(vportPriv); + switch(vport->ovsType) { + case OVS_VPORT_TYPE_VXLAN: + dstPort = ((POVS_VXLAN_VPORT)vportPriv)->dstPort; + break; + case OVS_VPORT_TYPE_STT: + dstPort = ((POVS_STT_VPORT)vportPriv)->dstPort; + break; + default: + ASSERT(! "Port is not a tunnel port"); + } + ASSERT(dstPort); + return dstPort; +} + +NDIS_STATUS InitOvsVportCommon(POVS_SWITCH_CONTEXT switchContext, + POVS_VPORT_ENTRY vport); +NTSTATUS OvsInitTunnelVport(PVOID usrParamsCtx, POVS_VPORT_ENTRY vport, + OVS_VPORT_TYPE ovsType, UINT16 dstport); +NTSTATUS OvsInitBridgeInternalVport(POVS_VPORT_ENTRY vport); + +POVS_VPORT_ENTRY OvsAllocateVport(VOID); + +#endif /* __VPORT_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Vxlan.c openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vxlan.c --- openvswitch-2.3.1/datapath-windows/ovsext/Vxlan.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vxlan.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,543 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "precomp.h" +#include "NetProto.h" +#include "Switch.h" +#include "Vport.h" +#include "Flow.h" +#include "Vxlan.h" +#include "IpHelper.h" +#include "Checksum.h" +#include "User.h" +#include "PacketIO.h" +#include "Flow.h" +#include "PacketParser.h" + +#pragma warning( push ) +#pragma warning( disable:4127 ) + + +#ifdef OVS_DBG_MOD +#undef OVS_DBG_MOD +#endif +#define OVS_DBG_MOD OVS_DBG_VXLAN +#include "Debug.h" + +/* Helper macro to check if a VXLAN ID is valid. */ +#define VXLAN_ID_IS_VALID(vxlanID) (0 < (vxlanID) && (vxlanID) <= 0xffffff) +#define VXLAN_TUNNELID_TO_VNI(_tID) (UINT32)(((UINT64)(_tID)) >> 40) +#define VXLAN_VNI_TO_TUNNELID(_vni) (((UINT64)(_vni)) << 40) +#define IP_DF_NBO 0x0040 +#define VXLAN_DEFAULT_TTL 64 +#define VXLAN_MULTICAST_TTL 64 +#define VXLAN_DEFAULT_INSTANCE_ID 1 + +/* Move to a header file */ +extern POVS_SWITCH_CONTEXT gOvsSwitchContext; + +/* + *---------------------------------------------------------------------------- + * This function verifies if the VXLAN tunnel already exists, in order to + * avoid sending a duplicate request to the WFP base filtering engine. + *---------------------------------------------------------------------------- + */ +static BOOLEAN +OvsIsTunnelFilterCreated(POVS_SWITCH_CONTEXT switchContext, + UINT16 udpPortDest) +{ + for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash++) { + PLIST_ENTRY head, link, next; + + head = &(switchContext->portNoHashArray[hash & OVS_VPORT_MASK]); + LIST_FORALL_SAFE(head, link, next) { + POVS_VPORT_ENTRY vport = NULL; + POVS_VXLAN_VPORT vxlanPort = NULL; + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink); + vxlanPort = (POVS_VXLAN_VPORT)vport->priv; + if (vxlanPort) { + if ((udpPortDest == vxlanPort->dstPort)) { + /* The VXLAN tunnel was already created. */ + return TRUE; + } + } + } + } + + return FALSE; +} + +/* + *---------------------------------------------------------------------------- + * This function allocates and initializes the OVS_VXLAN_VPORT. The function + * also creates a WFP tunnel filter for the necessary destination port. The + * tunnel filter create request is passed to the tunnel filter threads that + * will complete the request at a later time when IRQL is lowered to + * PASSIVE_LEVEL. + * + * udpDestPort: the vxlan is set as payload to a udp frame. If the destination + * port of an udp frame is udpDestPort, we understand it to be vxlan. + *---------------------------------------------------------------------------- + */ +NTSTATUS +OvsInitVxlanTunnel(PIRP irp, + POVS_VPORT_ENTRY vport, + UINT16 udpDestPort, + PFNTunnelVportPendingOp callback, + PVOID tunnelContext) +{ + NTSTATUS status = STATUS_SUCCESS; + POVS_VXLAN_VPORT vxlanPort = NULL; + + vxlanPort = OvsAllocateMemoryWithTag(sizeof (*vxlanPort), + OVS_VXLAN_POOL_TAG); + if (vxlanPort == NULL) { + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlZeroMemory(vxlanPort, sizeof(*vxlanPort)); + vxlanPort->dstPort = udpDestPort; + vport->priv = (PVOID)vxlanPort; + + if (!OvsIsTunnelFilterCreated(gOvsSwitchContext, udpDestPort)) { + status = OvsTunelFilterCreate(irp, + udpDestPort, + &vxlanPort->filterID, + callback, + tunnelContext); + } else { + status = STATUS_OBJECT_NAME_EXISTS; + } + + return status; +} + +/* + *---------------------------------------------------------------------------- + * This function releases the OVS_VXLAN_VPORT. The function also deletes the + * WFP tunnel filter previously created. The tunnel filter delete request is + * passed to the tunnel filter threads that will complete the request at a + * later time when IRQL is lowered to PASSIVE_LEVEL. + *---------------------------------------------------------------------------- + */ +NTSTATUS +OvsCleanupVxlanTunnel(PIRP irp, + POVS_VPORT_ENTRY vport, + PFNTunnelVportPendingOp callback, + PVOID tunnelContext) +{ + NTSTATUS status = STATUS_SUCCESS; + POVS_VXLAN_VPORT vxlanPort = NULL; + + if (vport->ovsType != OVS_VPORT_TYPE_VXLAN || + vport->priv == NULL) { + return STATUS_SUCCESS; + } + + vxlanPort = (POVS_VXLAN_VPORT)vport->priv; + + if (vxlanPort->filterID != 0) { + status = OvsTunelFilterDelete(irp, + vxlanPort->filterID, + callback, + tunnelContext); + } + + OvsFreeMemoryWithTag(vport->priv, OVS_VXLAN_POOL_TAG); + vport->priv = NULL; + + return status; +} + + +/* + *---------------------------------------------------------------------------- + * OvsDoEncapVxlan + * Encapsulates the packet. + *---------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsDoEncapVxlan(POVS_VPORT_ENTRY vport, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + POVS_FWD_INFO fwdInfo, + POVS_PACKET_HDR_INFO layers, + POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST *newNbl) +{ + NDIS_STATUS status; + PNET_BUFFER curNb; + PMDL curMdl; + PUINT8 bufferStart; + EthHdr *ethHdr; + IPHdr *ipHdr; + UDPHdr *udpHdr; + VXLANHdr *vxlanHdr; + POVS_VXLAN_VPORT vportVxlan; + UINT32 headRoom = OvsGetVxlanTunHdrSize(); + UINT32 packetLength; + + /* + * XXX: the assumption currently is that the NBL is owned by OVS, and + * headroom has already been allocated as part of allocating the NBL and + * MDL. + */ + curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); + packetLength = NET_BUFFER_DATA_LENGTH(curNb); + if (layers->isTcp) { + NDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO tsoInfo; + + tsoInfo.Value = NET_BUFFER_LIST_INFO(curNbl, + TcpLargeSendNetBufferListInfo); + OVS_LOG_TRACE("MSS %u packet len %u", tsoInfo.LsoV1Transmit.MSS, packetLength); + if (tsoInfo.LsoV1Transmit.MSS) { + OVS_LOG_TRACE("l4Offset %d", layers->l4Offset); + *newNbl = OvsTcpSegmentNBL(switchContext, curNbl, layers, + tsoInfo.LsoV1Transmit.MSS, headRoom); + if (*newNbl == NULL) { + OVS_LOG_ERROR("Unable to segment NBL"); + return NDIS_STATUS_FAILURE; + } + } + } + + vportVxlan = (POVS_VXLAN_VPORT) GetOvsVportPriv(vport); + ASSERT(vportVxlan); + + /* If we didn't split the packet above, make a copy now */ + if (*newNbl == NULL) { + *newNbl = OvsPartialCopyNBL(switchContext, curNbl, 0, headRoom, + FALSE /*NBL info*/); + if (*newNbl == NULL) { + OVS_LOG_ERROR("Unable to copy NBL"); + return NDIS_STATUS_FAILURE; + } + } + + curNbl = *newNbl; + for (curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); curNb != NULL; + curNb = curNb->Next) { + status = NdisRetreatNetBufferDataStart(curNb, headRoom, 0, NULL); + if (status != NDIS_STATUS_SUCCESS) { + goto ret_error; + } + + curMdl = NET_BUFFER_CURRENT_MDL(curNb); + bufferStart = (PUINT8)MmGetSystemAddressForMdlSafe(curMdl, LowPagePriority); + if (!bufferStart) { + status = NDIS_STATUS_RESOURCES; + goto ret_error; + } + + bufferStart += NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + if (NET_BUFFER_NEXT_NB(curNb)) { + OVS_LOG_TRACE("nb length %u next %u", NET_BUFFER_DATA_LENGTH(curNb), + NET_BUFFER_DATA_LENGTH(curNb->Next)); + } + + /* L2 header */ + ethHdr = (EthHdr *)bufferStart; + ASSERT(((PCHAR)&fwdInfo->dstMacAddr + sizeof fwdInfo->dstMacAddr) == + (PCHAR)&fwdInfo->srcMacAddr); + NdisMoveMemory(ethHdr->Destination, fwdInfo->dstMacAddr, + sizeof ethHdr->Destination + sizeof ethHdr->Source); + ethHdr->Type = htons(ETH_TYPE_IPV4); + + // XXX: question: there are fields in the OvsIPv4TunnelKey for ttl and such, + // should we use those values instead? or will they end up being + // uninitialized; + /* IP header */ + ipHdr = (IPHdr *)((PCHAR)ethHdr + sizeof *ethHdr); + + ipHdr->ihl = sizeof *ipHdr / 4; + ipHdr->version = IPV4; + ipHdr->tos = 0; + ipHdr->tot_len = htons(NET_BUFFER_DATA_LENGTH(curNb) - sizeof *ethHdr); + ipHdr->id = 0; + ipHdr->frag_off = IP_DF_NBO; + ipHdr->ttl = tunKey->ttl ? tunKey->ttl : VXLAN_DEFAULT_TTL; + ipHdr->protocol = IPPROTO_UDP; + ASSERT(tunKey->dst == fwdInfo->dstIpAddr); + ASSERT(tunKey->src == fwdInfo->srcIpAddr || tunKey->src == 0); + ipHdr->saddr = fwdInfo->srcIpAddr; + ipHdr->daddr = fwdInfo->dstIpAddr; + ipHdr->check = 0; + ipHdr->check = IPChecksum((UINT8 *)ipHdr, sizeof *ipHdr, 0); + + /* UDP header */ + udpHdr = (UDPHdr *)((PCHAR)ipHdr + sizeof *ipHdr); + udpHdr->source = htons(tunKey->flow_hash | 32768); + udpHdr->dest = htons(vportVxlan->dstPort); + udpHdr->len = htons(NET_BUFFER_DATA_LENGTH(curNb) - headRoom + + sizeof *udpHdr + sizeof *vxlanHdr); + udpHdr->check = 0; + + /* VXLAN header */ + vxlanHdr = (VXLANHdr *)((PCHAR)udpHdr + sizeof *udpHdr); + vxlanHdr->flags1 = 0; + vxlanHdr->locallyReplicate = 0; + vxlanHdr->flags2 = 0; + vxlanHdr->reserved1 = 0; + if (tunKey->flags | OVS_TNL_F_KEY) { + vxlanHdr->vxlanID = VXLAN_TUNNELID_TO_VNI(tunKey->tunnelId); + vxlanHdr->instanceID = 1; + } + vxlanHdr->reserved2 = 0; + } + return STATUS_SUCCESS; + +ret_error: + OvsCompleteNBL(switchContext, *newNbl, TRUE); + *newNbl = NULL; + return status; +} + + +/* + *---------------------------------------------------------------------------- + * OvsEncapVxlan -- + * Encapsulates the packet if L2/L3 for destination resolves. Otherwise, + * enqueues a callback that does encapsulatation after resolution. + *---------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsEncapVxlan(POVS_VPORT_ENTRY vport, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + POVS_SWITCH_CONTEXT switchContext, + POVS_PACKET_HDR_INFO layers, + PNET_BUFFER_LIST *newNbl) +{ + NTSTATUS status; + OVS_FWD_INFO fwdInfo; + + status = OvsLookupIPFwdInfo(tunKey->dst, &fwdInfo); + if (status != STATUS_SUCCESS) { + OvsFwdIPHelperRequest(NULL, 0, tunKey, NULL, NULL, NULL); + // return NDIS_STATUS_PENDING; + /* + * XXX: Don't know if the completionList will make any sense when + * accessed in the callback. Make sure the caveats are known. + * + * XXX: This code will work once we are able to grab locks in the + * callback. + */ + return NDIS_STATUS_FAILURE; + } + + return OvsDoEncapVxlan(vport, curNbl, tunKey, &fwdInfo, layers, + switchContext, newNbl); +} + +/* + *---------------------------------------------------------------------------- + * OvsCalculateUDPChecksum + * Calculate UDP checksum + *---------------------------------------------------------------------------- + */ +static __inline NDIS_STATUS +OvsCalculateUDPChecksum(PNET_BUFFER_LIST curNbl, + PNET_BUFFER curNb, + IPHdr *ipHdr, + UDPHdr *udpHdr, + UINT32 packetLength) +{ + NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO csumInfo; + UINT16 checkSum; + + csumInfo.Value = NET_BUFFER_LIST_INFO(curNbl, TcpIpChecksumNetBufferListInfo); + + /* Next check if UDP checksum has been calculated. */ + if (!csumInfo.Receive.UdpChecksumSucceeded) { + UINT32 l4Payload; + + checkSum = udpHdr->check; + + l4Payload = packetLength - sizeof(EthHdr) - ipHdr->ihl * 4; + udpHdr->check = 0; + udpHdr->check = + IPPseudoChecksum((UINT32 *)&ipHdr->saddr, + (UINT32 *)&ipHdr->daddr, + IPPROTO_UDP, (UINT16)l4Payload); + udpHdr->check = CalculateChecksumNB(curNb, (UINT16)l4Payload, + sizeof(EthHdr) + ipHdr->ihl * 4); + if (checkSum != udpHdr->check) { + OVS_LOG_TRACE("UDP checksum incorrect."); + return NDIS_STATUS_INVALID_PACKET; + } + } + + csumInfo.Receive.UdpChecksumSucceeded = 1; + NET_BUFFER_LIST_INFO(curNbl, TcpIpChecksumNetBufferListInfo) = csumInfo.Value; + return NDIS_STATUS_SUCCESS; +} + +/* + *---------------------------------------------------------------------------- + * OvsDecapVxlan + * Decapsulates to tunnel header in 'curNbl' and puts into 'tunKey'. + *---------------------------------------------------------------------------- + */ +NDIS_STATUS +OvsDecapVxlan(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + PNET_BUFFER_LIST *newNbl) +{ + PNET_BUFFER curNb; + PMDL curMdl; + EthHdr *ethHdr; + IPHdr *ipHdr; + UDPHdr *udpHdr; + VXLANHdr *vxlanHdr; + UINT32 tunnelSize = 0, packetLength = 0; + PUINT8 bufferStart; + NDIS_STATUS status; + + /* Check the the length of the UDP payload */ + curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); + packetLength = NET_BUFFER_DATA_LENGTH(curNb); + tunnelSize = OvsGetVxlanTunHdrSize(); + if (packetLength <= tunnelSize) { + return NDIS_STATUS_INVALID_LENGTH; + } + + /* + * Create a copy of the NBL so that we have all the headers in one MDL. + */ + *newNbl = OvsPartialCopyNBL(switchContext, curNbl, + tunnelSize + OVS_DEFAULT_COPY_SIZE, 0, + TRUE /*copy NBL info */); + + if (*newNbl == NULL) { + return NDIS_STATUS_RESOURCES; + } + + /* XXX: Handle VLAN header. */ + curNbl = *newNbl; + curNb = NET_BUFFER_LIST_FIRST_NB(curNbl); + curMdl = NET_BUFFER_CURRENT_MDL(curNb); + bufferStart = (PUINT8)MmGetSystemAddressForMdlSafe(curMdl, LowPagePriority) + + NET_BUFFER_CURRENT_MDL_OFFSET(curNb); + if (!bufferStart) { + status = NDIS_STATUS_RESOURCES; + goto dropNbl; + } + + ethHdr = (EthHdr *)bufferStart; + /* XXX: Handle IP options. */ + ipHdr = (IPHdr *)((PCHAR)ethHdr + sizeof *ethHdr); + tunKey->src = ipHdr->saddr; + tunKey->dst = ipHdr->daddr; + tunKey->tos = ipHdr->tos; + tunKey->ttl = ipHdr->ttl; + tunKey->pad = 0; + udpHdr = (UDPHdr *)((PCHAR)ipHdr + sizeof *ipHdr); + + /* Validate if NIC has indicated checksum failure. */ + status = OvsValidateUDPChecksum(curNbl, udpHdr->check == 0); + if (status != NDIS_STATUS_SUCCESS) { + goto dropNbl; + } + + /* Calculate and verify UDP checksum if NIC didn't do it. */ + if (udpHdr->check != 0) { + status = OvsCalculateUDPChecksum(curNbl, curNb, ipHdr, udpHdr, packetLength); + if (status != NDIS_STATUS_SUCCESS) { + goto dropNbl; + } + } + + vxlanHdr = (VXLANHdr *)((PCHAR)udpHdr + sizeof *udpHdr); + if (vxlanHdr->instanceID) { + tunKey->flags = OVS_TNL_F_KEY; + tunKey->tunnelId = VXLAN_VNI_TO_TUNNELID(vxlanHdr->vxlanID); + } else { + tunKey->flags = 0; + tunKey->tunnelId = 0; + } + + /* Clear out the receive flag for the inner packet. */ + NET_BUFFER_LIST_INFO(curNbl, TcpIpChecksumNetBufferListInfo) = 0; + NdisAdvanceNetBufferDataStart(curNb, tunnelSize, FALSE, NULL); + return NDIS_STATUS_SUCCESS; + +dropNbl: + OvsCompleteNBL(switchContext, *newNbl, TRUE); + *newNbl = NULL; + return status; +} + + +NDIS_STATUS +OvsSlowPathDecapVxlan(const PNET_BUFFER_LIST packet, + OvsIPv4TunnelKey *tunnelKey) +{ + NDIS_STATUS status = NDIS_STATUS_FAILURE; + UDPHdr udpStorage; + const UDPHdr *udp; + VXLANHdr *VxlanHeader; + VXLANHdr VxlanHeaderBuffer; + struct IPHdr ip_storage; + const struct IPHdr *nh; + OVS_PACKET_HDR_INFO layers; + + layers.value = 0; + + do { + nh = OvsGetIp(packet, layers.l3Offset, &ip_storage); + if (nh) { + layers.l4Offset = layers.l3Offset + nh->ihl * 4; + } else { + break; + } + + /* make sure it's a VXLAN packet */ + udp = OvsGetUdp(packet, layers.l4Offset, &udpStorage); + if (udp) { + layers.l7Offset = layers.l4Offset + sizeof *udp; + } else { + break; + } + + VxlanHeader = (VXLANHdr *)OvsGetPacketBytes(packet, + sizeof(*VxlanHeader), + layers.l7Offset, + &VxlanHeaderBuffer); + + if (VxlanHeader) { + tunnelKey->src = nh->saddr; + tunnelKey->dst = nh->daddr; + tunnelKey->ttl = nh->ttl; + tunnelKey->tos = nh->tos; + if (VxlanHeader->instanceID) { + tunnelKey->flags = OVS_TNL_F_KEY; + tunnelKey->tunnelId = VXLAN_VNI_TO_TUNNELID(VxlanHeader->vxlanID); + } else { + tunnelKey->flags = 0; + tunnelKey->tunnelId = 0; + } + } else { + break; + } + status = NDIS_STATUS_SUCCESS; + + } while(FALSE); + + return status; +} + +#pragma warning( pop ) diff -Nru openvswitch-2.3.1/datapath-windows/ovsext/Vxlan.h openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vxlan.h --- openvswitch-2.3.1/datapath-windows/ovsext/Vxlan.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext/Vxlan.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __VXLAN_H_ +#define __VXLAN_H_ 1 + +#include "NetProto.h" +typedef struct _OVS_VXLAN_VPORT { + UINT16 dstPort; + UINT64 inPkts; + UINT64 outPkts; + UINT64 slowInPkts; + UINT64 slowOutPkts; + UINT64 filterID; + /* + * To be filled + */ +} OVS_VXLAN_VPORT, *POVS_VXLAN_VPORT; + +/* VXLAN header. */ +typedef struct VXLANHdr { + /* Flags. */ + UINT32 flags1:2; + /* Packet needs replication to multicast group (used for multicast proxy). */ + UINT32 locallyReplicate:1; + /* Instance ID flag, must be set to 1. */ + UINT32 instanceID:1; + /* Flags. */ + UINT32 flags2:4; + /* Reserved. */ + UINT32 reserved1:24; + /* VXLAN ID. */ + UINT32 vxlanID:24; + /* Reserved. */ + UINT32 reserved2:8; +} VXLANHdr; + +NTSTATUS OvsInitVxlanTunnel(PIRP irp, + POVS_VPORT_ENTRY vport, + UINT16 udpDestPort, + PFNTunnelVportPendingOp callback, + PVOID tunnelContext); + +NTSTATUS OvsCleanupVxlanTunnel(PIRP irp, + POVS_VPORT_ENTRY vport, + PFNTunnelVportPendingOp callback, + PVOID tunnelContext); + +NDIS_STATUS OvsSlowPathDecapVxlan(const PNET_BUFFER_LIST packet, + OvsIPv4TunnelKey *tunnelKey); + +NDIS_STATUS OvsEncapVxlan(POVS_VPORT_ENTRY vport, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + POVS_SWITCH_CONTEXT switchContext, + POVS_PACKET_HDR_INFO layers, + PNET_BUFFER_LIST *newNbl); + +NDIS_STATUS OvsDecapVxlan(POVS_SWITCH_CONTEXT switchContext, + PNET_BUFFER_LIST curNbl, + OvsIPv4TunnelKey *tunKey, + PNET_BUFFER_LIST *newNbl); + +static __inline UINT32 +OvsGetVxlanTunHdrSize(VOID) +{ + /* XXX: Can L2 include VLAN at all? */ + return sizeof (EthHdr) + sizeof (IPHdr) + sizeof (UDPHdr) + + sizeof (VXLANHdr); +} + +#define VXLAN_UDP_PORT 4789 +#define VXLAN_UDP_PORT_NBO 0xB512 + +#endif /* __VXLAN_H_ */ diff -Nru openvswitch-2.3.1/datapath-windows/ovsext.sln openvswitch-2.4.0~git20150623/datapath-windows/ovsext.sln --- openvswitch-2.3.1/datapath-windows/ovsext.sln 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/ovsext.sln 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,49 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{6BA8554E-AE50-49B0-9C98-4592447FEF8D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OVSExt", "OVSExt", "{4A841675-477D-40A2-9CC6-128C3B8714F8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "Package\package.VcxProj", "{911D7389-3E61-449F-B8F3-14AD7EE9A0F2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ovsext", "ovsext\ovsext.vcxproj", "{63FE215D-98BE-4440-8081-C6160EFB80FA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Win8.1Debug|x64 = Win8.1Debug|x64 + Win8.1Release|x64 = Win8.1Release|x64 + Win8Debug|x64 = Win8Debug|x64 + Win8Release|x64 = Win8Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8.1Debug|x64.ActiveCfg = Win8.1 Debug|x64 + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8.1Debug|x64.Build.0 = Win8.1 Debug|x64 + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8.1Release|x64.ActiveCfg = Win8.1 Release|x64 + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8.1Release|x64.Build.0 = Win8.1 Release|x64 + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8Debug|x64.ActiveCfg = Win8 Debug|x64 + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8Debug|x64.Build.0 = Win8 Debug|x64 + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8Release|x64.ActiveCfg = Win8 Release|x64 + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8Release|x64.Build.0 = Win8 Release|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8.1Debug|x64.ActiveCfg = Win8.1 Debug|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8.1Debug|x64.Build.0 = Win8.1 Debug|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8.1Debug|x64.Deploy.0 = Win8.1 Debug|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8.1Release|x64.ActiveCfg = Win8.1 Release|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8.1Release|x64.Build.0 = Win8.1 Release|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8.1Release|x64.Deploy.0 = Win8.1 Release|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8Debug|x64.ActiveCfg = Win8 Debug|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8Debug|x64.Build.0 = Win8 Debug|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8Debug|x64.Deploy.0 = Win8 Debug|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8Release|x64.ActiveCfg = Win8 Release|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8Release|x64.Build.0 = Win8 Release|x64 + {63FE215D-98BE-4440-8081-C6160EFB80FA}.Win8Release|x64.Deploy.0 = Win8 Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2} = {6BA8554E-AE50-49B0-9C98-4592447FEF8D} + {63FE215D-98BE-4440-8081-C6160EFB80FA} = {4A841675-477D-40A2-9CC6-128C3B8714F8} + EndGlobalSection +EndGlobal diff -Nru openvswitch-2.3.1/datapath-windows/Package/package.VcxProj openvswitch-2.4.0~git20150623/datapath-windows/Package/package.VcxProj --- openvswitch-2.3.1/datapath-windows/Package/package.VcxProj 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/Package/package.VcxProj 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,113 @@ + + + + + Win8.1 Debug + x64 + + + Win8 Debug + x64 + + + Win8.1 Release + x64 + + + Win8 Release + x64 + + + + Utility + Package + true + Win8 Debug + + + $(VCTargetsPath11) + + + + {911D7389-3E61-449F-B8F3-14AD7EE9A0F2} + {E753AF15-94DC-4773-AED9-06A6636E6E67} + $(MSBuildProjectName) + + + WindowsV6.3 + true + WindowsKernelModeDriver8.1 + + + Windows8 + true + WindowsKernelModeDriver8.1 + + + WindowsV6.3 + false + WindowsKernelModeDriver8.1 + + + Windows8 + false + WindowsKernelModeDriver8.1 + + + + + + + + + + + DbgengKernelDebugger + False + False + None + + + + + + %PathToInf% + False + False + True + + 133563 + + + + true + + + + + true + + + + + true + + + + + true + + + + + + + + + {63FE215D-98BE-4440-8081-C6160EFB80FA} + + + + + + \ No newline at end of file diff -Nru openvswitch-2.3.1/datapath-windows/Package/package.VcxProj.user openvswitch-2.4.0~git20150623/datapath-windows/Package/package.VcxProj.user --- openvswitch-2.3.1/datapath-windows/Package/package.VcxProj.user 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/datapath-windows/Package/package.VcxProj.user 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,15 @@ + + + + TestSign + + + TestSign + + + TestSign + + + TestSign + + diff -Nru openvswitch-2.3.1/debian/automake.mk openvswitch-2.4.0~git20150623/debian/automake.mk --- openvswitch-2.3.1/debian/automake.mk 2014-12-18 12:10:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/automake.mk 2015-06-23 20:58:45.000000000 +0000 @@ -27,6 +27,14 @@ debian/openvswitch-switch.links \ debian/openvswitch-test.install \ debian/openvswitch-test.manpages \ + debian/openvswitch-testcontroller.README.Debian \ + debian/openvswitch-testcontroller.default \ + debian/openvswitch-testcontroller.dirs \ + debian/openvswitch-testcontroller.init \ + debian/openvswitch-testcontroller.install \ + debian/openvswitch-testcontroller.manpages \ + debian/openvswitch-testcontroller.postinst \ + debian/openvswitch-testcontroller.postrm \ debian/openvswitch-vtep.default \ debian/openvswitch-vtep.dirs \ debian/openvswitch-vtep.init \ @@ -51,6 +59,7 @@ DIST_HOOKS += check-debian-changelog-version $(srcdir)/debian/copyright: AUTHORS debian/copyright.in + $(AM_V_GEN) \ { sed -n -e '/%AUTHORS%/q' -e p < $(srcdir)/debian/copyright.in; \ sed '1,/^$$/d' $(srcdir)/AUTHORS | \ sed -n -e '/^$$/q' -e 's/^/ /p'; \ diff -Nru openvswitch-2.3.1/debian/changelog openvswitch-2.4.0~git20150623/debian/changelog --- openvswitch-2.3.1/debian/changelog 2014-12-18 12:37:41.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/changelog 2015-06-24 10:25:14.000000000 +0000 @@ -1,3 +1,15 @@ +openvswitch (2.4.0~git20150623-0ubuntu1~ubuntu15.10.1~ppa201506241125) wily; urgency=medium + + * No-change backport to wily + + -- James Page Wed, 24 Jun 2015 11:25:13 +0100 + +openvswitch (2.4.0~git20150623-0ubuntu1) UNRELEASED; urgency=medium + + * New upstream snapshot from 2.4 branch + + -- James Page Wed, 24 Jun 2015 08:41:35 +0100 + openvswitch (2.3.1-0ubuntu1) vivid; urgency=low * New upstream release. diff -Nru openvswitch-2.3.1/debian/control openvswitch-2.4.0~git20150623/debian/control --- openvswitch-2.3.1/debian/control 2014-12-18 11:25:29.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/control 2015-06-24 07:58:07.000000000 +0000 @@ -29,7 +29,8 @@ to support distribution across multiple physical servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. . - openvswitch-common provides components required by both openvswitch-switch. + openvswitch-common provides components required by both openvswitch-switch + and openvswitch-testcontroller. Package: openvswitch-switch Architecture: linux-any @@ -85,6 +86,19 @@ Open vSwitch switches and controllers, reducing the risk of man-in-the-middle attacks on the Open vSwitch network infrastructure. +Package: openvswitch-testcontroller +Architecture: linux-any +Depends: + ${shlibs:Depends}, openvswitch-common (= ${binary:Version}), + openvswitch-pki (= ${source:Version}), ${misc:Depends} +Breaks: openvswitch-test (<< 2.1.2-0ubuntu3) +Replaces: openvswitch-test (<< 2.1.2-0ubuntu3) +Description: Simple controller for testing OpenFlow setups + This controller enables OpenFlow switches that connect to it to act + as MAC-learning Ethernet switches. It can be used for initial + testing of OpenFlow networks. It is not a necessary or desirable + part of a production OpenFlow deployment. + Package: openvswitch-dbg Section: debug Architecture: linux-any @@ -152,22 +166,3 @@ . This package provides utilities that are useful to interact with a VTEP-configured database and a VTEP emulator. - -Package: openvswitch-testcontroller -Architecture: linux-any -Depends: - ${shlibs:Depends}, ${misc:Depends}, openvswitch-common (>= ${binary:Version}) -Breaks: openvswitch-test (<< 2.1.2-0ubuntu3) -Replaces: openvswitch-test (<< 2.1.2-0ubuntu3) -Description: Open vSwitch test controller implementation - Open vSwitch is a production quality, multilayer, software-based, - Ethernet virtual switch. It is designed to enable massive network - automation through programmatic extension, while still supporting - standard management interfaces and protocols (e.g. NetFlow, IPFIX, - sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed - to support distribution across multiple physical servers similar to - VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. - . - The Open vSwitch controller enables OpenFlow switches that connect to it - to act as MAC-learning Ethernet switches. Note that the test controller - should be used for testing purposes only. diff -Nru openvswitch-2.3.1/debian/copyright openvswitch-2.4.0~git20150623/debian/copyright --- openvswitch-2.3.1/debian/copyright 2014-12-12 11:26:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/copyright 2015-06-24 09:47:05.000000000 +0000 @@ -4,140 +4,7 @@ Upstream Authors (from AUTHORS): - Aaron Rosen arosen@clemson.edu - Alexandru Copot alex.mihai.c@gmail.com - Alexei Starovoitov ast@plumgrid.com - Alexey I. Froloff raorn@altlinux.org - Alex Wang alexw@nicira.com - Alfredo Finelli alf@computationes.de - Alin Serdean aserdean@cloudbasesolutions.com - Andrew Evans aevans@nicira.com - Andrew Lambeth wal@nicira.com - Andy Hill hillad@gmail.com - Andy Southgate andy.southgate@citrix.com - Andy Zhou azhou@nicira.com - Anoob Soman anoob.soman@citrix.com - Ansis Atteka aatteka@nicira.com - Anupam Chanda achanda@nicira.com - Arun Sharma arun.sharma@calsoftinc.com - Aryan TaheriMonfared aryan.taherimonfared@uis.no - Ashwin Swaminathan ashwinds@arista.com - Ben Pfaff blp@nicira.com - Brian Kruger bkruger+ovsdev@gmail.com - Bruce Davie bsd@nicira.com - Bryan Phillippe bp@toroki.com - Casey Barker crbarker@google.com - Chris Wright chrisw@sous-sol.org - Chuck Short zulcss@ubuntu.com - Damien Millescamps damien.millescamps@6wind.com - Dan Carpenter dan.carpenter@oracle.com - Dan Wendlandt dan@nicira.com - Daniel Hiltgen daniel@netkine.com - Daniel Roman droman@nicira.com - Daniele Di Proietto daniele.di.proietto@gmail.com - Daniele Venturino daniele.venturino@m3s.it - Danny Kukawka danny.kukawka@bisect.de - Dave Tucker dave@dtucker.co.uk - David Erickson derickso@stanford.edu - David S. Miller davem@davemloft.net - David Yang davidy@vmware.com - Devendra Naga devendra.aaru@gmail.com - Dominic Curran dominic.curran@citrix.com - Duffie Cooley dcooley@nicira.com - Ed Maste emaste at freebsd.org - Edouard Bourguignon madko@linuxed.net - Edward Tomasz Napierała trasz@freebsd.org - Ethan Jackson ethan@nicira.com - Flavio Leitner fbl@redhat.com - Francesco Fusco ffusco@redhat.com - FUJITA Tomonori fujita.tomonori@lab.ntt.co.jp - Gaetano Catalli gaetano.catalli@gmail.com - Geoffrey Wossum gwossum@acm.org - Giuseppe Lettieri g.lettieri@iet.unipi.it - Glen Gibb grg@stanford.edu - Guolin Yang gyang@nicira.com - Gurucharan Shetty gshetty@nicira.com - Henry Mai hmai@nicira.com - Hao Zheng hzheng@nicira.com - Helmut Schaa helmut.schaa@googlemail.com - Ian Campbell Ian.Campbell@citrix.com - Isaku Yamahata yamahata@valinux.co.jp - James P. roampune@gmail.com - James Page james.page@ubuntu.com - Jarno Rajahalme jrajahalme@nicira.com - Jason Kölker jason@koelker.net - Jasper Capel jasper@capel.tv - Jean Tourrilhes jt@hpl.hp.com - Jeremy Stribling strib@nicira.com - Jesse Gross jesse@nicira.com - Jing Ai jinga@google.com - Joe Perches joe@perches.com - Joe Stringer joestringer@nicira.com - Jun Nakajima jun.nakajima@intel.com - Justin Pettit jpettit@nicira.com - Keith Amidon keith@nicira.com - Ken Ajiro ajiro@mxw.nes.nec.co.jp - Kmindg G kmindg@gmail.com - Krishna Kondaka kkondaka@vmware.com - Kyle Mestery kmestery@cisco.com - Leo Alterman lalterman@nicira.com - Linda Sun lsun@vmware.com - Lior Neudorfer lior@guardicore.com - Lorand Jakab lojakab@cisco.com - Luca Giraudo lgiraudo@nicira.com - Luigi Rizzo rizzo@iet.unipi.it - Mark Hamilton mhamilton@nicira.com - Martin Casado casado@nicira.com - Mehak Mahajan mmahajan@nicira.com - Murphy McCauley murphy.mccauley@gmail.com - Natasha Gude natasha@nicira.com - Neil McKee neil.mckee@inmon.com - Neil Zhu zhuj@centecnetworks.com - Padmanabhan Krishnan kprad1@yahoo.com - Paraneetharan Chandrasekaran paraneetharanc@gmail.com - Paul Fazzone pfazzone@nicira.com - Paul Ingram paul@nicira.com - Pavithra Ramesh paramesh@vmware.com - Philippe Jung phil.jung@free.fr - pritesh pritesh.kothari@cisco.com - Pravin B Shelar pshelar@nicira.com - Raju Subramanian rsubramanian@nicira.com - Rami Rosen ramirose@gmail.com - Ravi Kerur Ravi.Kerur@telekom.com - Reid Price reid@nicira.com - Remko Tronçon git@el-tramo.be - Rich Lane rlane@bigswitch.com - Rob Hoes rob.hoes@citrix.com - Romain Lenglet romain.lenglet@berabera.info - Sajjad Lateef slateef@nicira.com - Sanjay Sane ssane@nicira.com - Saurabh Shah ssaurabh@nicira.com - Shan Wei davidshan@tencent.com - Shih-Hao Li shli@nicira.com - Simon Horman horms@verge.net.au - Stephane A. Sezer sas@cd80.net - SUGYO Kazushi sugyo.org@gmail.com - Tadaaki Nagao nagao@stratosphere.co.jp - Tetsuo NAKAGAWA nakagawa@mxc.nes.nec.co.jp - Thomas Goirand zigo@debian.org - Thomas Graf tgraf@redhat.com - Thomas Lacroix thomas.lacroix@citrix.com - Todd Deshane deshantm@gmail.com - Tom Everman teverman@google.com - Tsvi Slonim tsvi@toroki.com - Tyler Coumbes coumbes@gmail.com - Valient Gough vgough@pobox.com - Vivien Bernet-Rollande vbr@soprive.net - Wei Yongjun yjwei@cn.fujitsu.com - William Fulton - YAMAMOTO Takashi yamamoto@valinux.co.jp - Yasuhito Takamiya yasuhito@gmail.com - yinpeijun yinpeijun@huawei.com - Yu Zhiguo yuzg@cn.fujitsu.com - ZhengLingyun konghuarukhr@163.com - Zoltan Kiss zoltan.kiss@citrix.com - Zhi Yong Wu zwu.kernel@gmail.com - Zang MingJie zealot0630@gmail.com +%AUTHORS% Upstream Copyright Holders: @@ -150,6 +17,10 @@ Copyright (C) 2000 The NetBSD Foundation, Inc. Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. Copyright (c) 1982, 1986, 1990, 1993 The Regents of the University of California. + Copyright (c) 2008, 2012 Vincent Bernat + Copyright (c) 2014 Michael Chapman + Copyright (c) 2014 WindRiver, Inc. + Copyright (c) 2014 Avaya, Inc. License: @@ -228,7 +99,7 @@ * The following components are dual-licensed under the GNU General Public License version 2 and the Apache License Version 2.0. - include/linux/openvswitch.h + datapath/linux/compat/include/linux/openvswitch.h On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. @@ -337,6 +208,17 @@ gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. +* The following files are licensed under the ISC-license + + lib/lldp/aa-structs.h + lib/lldp/lldpd.c + lib/lldp/lldpd.h + lib/lldp/lldpd-structs.c + lib/lldp/lldpd-structs.h + lib/lldp/lldp.c + lib/lldp/lldp-tlv.h + lib/lldp/lldp-const.h + * All other components of this package are licensed under The Apache License Version 2.0. diff -Nru openvswitch-2.3.1/debian/copyright.in openvswitch-2.4.0~git20150623/debian/copyright.in --- openvswitch-2.3.1/debian/copyright.in 2014-12-12 11:26:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/copyright.in 2015-06-23 20:58:45.000000000 +0000 @@ -17,6 +17,10 @@ Copyright (C) 2000 The NetBSD Foundation, Inc. Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. Copyright (c) 1982, 1986, 1990, 1993 The Regents of the University of California. + Copyright (c) 2008, 2012 Vincent Bernat + Copyright (c) 2014 Michael Chapman + Copyright (c) 2014 WindRiver, Inc. + Copyright (c) 2014 Avaya, Inc. License: @@ -95,7 +99,7 @@ * The following components are dual-licensed under the GNU General Public License version 2 and the Apache License Version 2.0. - include/linux/openvswitch.h + datapath/linux/compat/include/linux/openvswitch.h On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. @@ -204,6 +208,17 @@ gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. +* The following files are licensed under the ISC-license + + lib/lldp/aa-structs.h + lib/lldp/lldpd.c + lib/lldp/lldpd.h + lib/lldp/lldpd-structs.c + lib/lldp/lldpd-structs.h + lib/lldp/lldp.c + lib/lldp/lldp-tlv.h + lib/lldp/lldp-const.h + * All other components of this package are licensed under The Apache License Version 2.0. diff -Nru openvswitch-2.3.1/debian/dkms.conf.in openvswitch-2.4.0~git20150623/debian/dkms.conf.in --- openvswitch-2.3.1/debian/dkms.conf.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/dkms.conf.in 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1,11 @@ +MODULES=( __MODULES__ ) + +PACKAGE_NAME="openvswitch" +PACKAGE_VERSION="__VERSION__" +MAKE="./configure --with-linux='${kernel_source_dir}' && make -C datapath/linux" +for __idx in ${!MODULES[@]}; do + BUILT_MODULE_NAME[__idx]=${MODULES[__idx]} + BUILT_MODULE_LOCATION[__idx]=datapath/linux/ + DEST_MODULE_LOCATION[__idx]=/kernel/drivers/net/openvswitch/ +done +AUTOINSTALL=yes diff -Nru openvswitch-2.3.1/debian/ifupdown.sh openvswitch-2.4.0~git20150623/debian/ifupdown.sh --- openvswitch-2.3.1/debian/ifupdown.sh 2014-12-18 11:24:10.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/ifupdown.sh 2015-06-23 20:58:45.000000000 +0000 @@ -77,6 +77,12 @@ ifconfig "${slave}" up done ;; + OVSPatchPort) + ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_OPTIONS} -- set Interface "${IFACE}" \ + type=patch options:peer="${IF_OVS_PATCH_PEER}" \ + ${OVS_EXTRA+-- $OVS_EXTRA} + ;; OVSTunnel) ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ "${IFACE}" ${IF_OVS_OPTIONS} -- set Interface "${IFACE}" \ @@ -96,7 +102,7 @@ ovs_vsctl -- --if-exists del-br "${IFACE}" ;; - OVSPort|OVSIntPort|OVSBond|OVSTunnel) + OVSPort|OVSIntPort|OVSBond|OVSPatchPort|OVSTunnel) ovs_vsctl -- --if-exists del-port "${IF_OVS_BRIDGE}" "${IFACE}" ;; *) diff -Nru openvswitch-2.3.1/debian/openvswitch-common.docs openvswitch-2.4.0~git20150623/debian/openvswitch-common.docs --- openvswitch-2.3.1/debian/openvswitch-common.docs 2014-12-18 11:50:17.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-common.docs 2015-06-23 20:58:45.000000000 +0000 @@ -1 +1,3 @@ -FAQ +FAQ.md +INSTALL.DPDK.md +README-native-tunneling.md diff -Nru openvswitch-2.3.1/debian/openvswitch-common.install openvswitch-2.4.0~git20150623/debian/openvswitch-common.install --- openvswitch-2.3.1/debian/openvswitch-common.install 2014-12-18 11:50:17.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-common.install 2015-06-23 20:58:45.000000000 +0000 @@ -1,5 +1,7 @@ +etc/bash_completion.d/ovs-appctl-bashcomp.bash usr/bin/ovs-appctl usr/bin/ovs-benchmark +usr/bin/ovs-docker usr/bin/ovs-ofctl usr/bin/ovs-parse-backtrace usr/bin/ovs-pki diff -Nru openvswitch-2.3.1/debian/openvswitch-switch.init openvswitch-2.4.0~git20150623/debian/openvswitch-switch.init --- openvswitch-2.3.1/debian/openvswitch-switch.init 2014-12-18 11:50:17.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-switch.init 2015-06-23 20:58:45.000000000 +0000 @@ -33,7 +33,7 @@ network_interfaces () { INTERFACES="/etc/network/interfaces" [ -e "${INTERFACES}" ] || return - bridges=`awk '{ if ($1 == "allow-ovs") { print $2; } }' "${INTERFACES}"` + bridges=`ifquery --allow ovs --list` [ -n "${bridges}" ] && $1 --allow=ovs ${bridges} } diff -Nru openvswitch-2.3.1/debian/openvswitch-switch.install openvswitch-2.4.0~git20150623/debian/openvswitch-switch.install --- openvswitch-2.3.1/debian/openvswitch-switch.install 2014-12-18 11:50:17.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-switch.install 2015-06-23 20:58:45.000000000 +0000 @@ -1,3 +1,4 @@ +etc/bash_completion.d/ovs-vsctl-bashcomp.bash usr/bin/ovs-dpctl usr/bin/ovs-dpctl-top usr/bin/ovs-pcap diff -Nru openvswitch-2.3.1/debian/openvswitch-switch.README.Debian openvswitch-2.4.0~git20150623/debian/openvswitch-switch.README.Debian --- openvswitch-2.3.1/debian/openvswitch-switch.README.Debian 2014-12-18 11:50:17.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-switch.README.Debian 2015-06-23 20:58:45.000000000 +0000 @@ -26,9 +26,10 @@ The following OVS specific "command" options are supported: - - ovs_type: This can either be OVSBridge, OVSPort, OVSIntPort, OVSBond or - OVSTunnel depending on whether you configure a bridge, port, an internal - port, a bond or a tunnel. This is a required option. + - ovs_type: This can either be OVSBridge, OVSPort, OVSIntPort, OVSBond, + OVSPatchPort or OVSTunnel depending on whether you configure a bridge, + port, an internal port, a bond, a patch port or a tunnel. This is a + required option. - ovs_ports: This option specifies all the ports that belong to a bridge. @@ -38,6 +39,9 @@ - ovs_bonds: This option specifies the list of physical interfaces to be bonded together. + - ovs_patch_peer: For "OVSPatchPort" interfaces, this field specifies + the patch's peer on the other bridge. + - ovs_tunnel_type: For "OVSTunnel" interfaces, the type of the tunnel. For example, "gre", "vxlan", etc. @@ -126,7 +130,31 @@ ovs_bonds eth2 eth3 ovs_options bond_mode=balance-tcp lacp=active -ex 6: Tunnel. +ex 6: Patch ports. + +allow-ovs br0 +iface br0 inet manual + ovs_type OVSBridge + ovs_ports patch0 + +allow-br0 patch0 +iface patch0 inet manual + ovs_bridge br0 + ovs_type OVSPatchPort + ovs_patch_peer patch1 + +allow-ovs br1 +iface br1 inet manual + ovs_type OVSBridge + ovs_ports patch1 + +allow-br1 patch1 +iface patch1 inet manual + ovs_bridge br1 + ovs_type OVSPatchPort + ovs_patch_peer patch0 + +ex 7: Tunnel. allow-ovs br1 iface br1 inet static @@ -142,7 +170,7 @@ ovs_tunnel_type gre ovs_tunnel_options options:remote_ip=182.168.1.2 options:key=1 -ex 7: Create and destroy bridges. +ex 8: Create and destroy bridges. ifup --allow=ovs $list_of_bridges ifdown --allow=ovs $list_of_bridges diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.default openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.default --- openvswitch-2.3.1/debian/openvswitch-testcontroller.default 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.default 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1,29 @@ +# This is a POSIX shell fragment -*- sh -*- + +# LISTEN: What OpenFlow connection methods should the controller listen on? +# +# This is a space-delimited list of connection methods: +# +# * "pssl:[PORT]": Listen for SSL connections on the specified PORT +# (default: 6653). The private key, certificate, and CA certificate +# must be specified below. +# +# * "ptcp:[PORT]": Listen for TCP connections on the specified PORT +# (default: 6653). Not recommended for security reasons. +# +LISTEN="pssl:" + +# PRIVKEY: Name of file containing controller's private key. +# Required if SSL enabled. +PRIVKEY=/etc/openvswitch-testcontroller/privkey.pem + +# CERT: Name of file containing certificate for private key. +# Required if SSL enabled. +CERT=/etc/openvswitch-testcontroller/cert.pem + +# CACERT: Name of file containing switch CA certificate. +# Required if SSL enabled. +CACERT=/etc/openvswitch-testcontroller/cacert.pem + +# Additional options to pass to ovs-testcontroller, e.g. "--hub" +DAEMON_OPTS="" diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.dirs openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.dirs --- openvswitch-2.3.1/debian/openvswitch-testcontroller.dirs 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.dirs 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1 @@ +etc/openvswitch-testcontroller diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.init openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.init --- openvswitch-2.3.1/debian/openvswitch-testcontroller.init 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.init 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1,278 @@ +#!/bin/sh +# +# Copyright (c) 2011, 2014 Nicira, Inc. +# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino +# +# This is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, +# or (at your option) any later version. +# +# This is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License with +# the Debian operating system, in /usr/share/common-licenses/GPL; if +# not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# +### BEGIN INIT INFO +# Provides: openvswitch-testcontroller +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $remote_fs +# Should-Start: $named +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Simple OpenFlow controller for testing +# Description: This controller enables OpenFlow switches that connect to +# it to act as MAC-learning Ethernet switches. +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/bin/ovs-testcontroller # Introduce the server's location here +NAME=ovs-testcontroller # Introduce the short server's name here +DESC=ovs-testcontroller # Introduce a short description here +LOGDIR=/var/log/openvswitch # Log directory to use + +PIDFILE=/var/run/openvswitch/$NAME.pid + +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +# Default options, these can be overriden by the information +# at /etc/default/openvswitch-testcontroller +DAEMON_OPTS="" # Additional options given to the server + +DODTIME=10 # Time to wait for the server to die, in seconds + # If this value is set too low you might not + # let some servers to die gracefully and + # 'restart' will not work + +LOGFILE=$LOGDIR/$NAME.log # Server logfile +#DAEMONUSER= # User to run the daemons as. If this value + # is set start-stop-daemon will chuid the server + +# Include defaults if available +default=/etc/default/openvswitch-testcontroller +if [ -f $default ] ; then + . $default +fi + +# Check that the user exists (if we set a user) +# Does the user exist? +if [ -n "$DAEMONUSER" ] ; then + if getent passwd | grep -q "^$DAEMONUSER:"; then + # Obtain the uid and gid + DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` + DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` + else + log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." + exit 1 + fi +fi + + +set -e + +running_pid() { +# Check if a given process pid's cmdline matches a given name + pid=$1 + name=$2 + [ -z "$pid" ] && return 1 + [ ! -d /proc/$pid ] && return 1 + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` + # Is this the expected server + [ "$cmd" != "$name" ] && return 1 + return 0 +} + +running() { +# Check if the process is running looking at /proc +# (works for all users) + + # No pidfile, probably no daemon present + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` + running_pid $pid $DAEMON || return 1 + return 0 +} + +start_server() { + if [ -z "$LISTEN" ]; then + echo "$default: No connection methods configured, controller disabled" >&2 + exit 0 + fi + + if [ ! -d /var/run/openvswitch ]; then + install -d -m 755 -o root -g root /var/run/openvswitch + fi + + SSL_OPTS= + case $LISTEN in + *ssl*) + : ${PRIVKEY:=/etc/openvswitch-testcontroller/privkey.pem} + : ${CERT:=/etc/openvswitch-testcontroller/cert.pem} + : ${CACERT:=/etc/openvswitch-testcontroller/cacert.pem} + if test ! -e "$PRIVKEY" || test ! -e "$CERT" || + test ! -e "$CACERT"; then + if test ! -e "$PRIVKEY"; then + echo "$PRIVKEY: private key missing" >&2 + fi + if test ! -e "$CERT"; then + echo "$CERT: certificate for private key missing" >&2 + fi + if test ! -e "$CACERT"; then + echo "$CACERT: CA certificate missing" >&2 + fi + exit 1 + fi + SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT" + ;; + esac + +# Start the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + start-stop-daemon --start --pidfile $PIDFILE \ + --exec $DAEMON -- --detach --pidfile=$PIDFILE \ + $LISTEN $DAEMON_OPTS $SSL_OPTS + errcode=$? + else +# if we are using a daemonuser then change the user id + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --chuid $DAEMONUSER --exec $DAEMON -- \ + --detach --pidfile=$PIDFILE $LISTEN $DAEMON_OPTS \ + $SSL_OPTS + errcode=$? + fi + return $errcode +} + +stop_server() { +# Stop the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + errcode=$? + else +# if we are using a daemonuser then look for process that match + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER --exec $DAEMON + errcode=$? + fi + + return $errcode +} + +reload_server() { + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` # This is the daemon's pid + # Send a SIGHUP + kill -1 $pid + return $? +} + +force_stop() { +# Force the process to die killing it manually + [ ! -e "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + sleep "$DODTIME" + if running ; then + kill -9 $pid + sleep "$DODTIME" + if running ; then + echo "Cannot kill $NAME (pid=$pid)!" + exit 1 + fi + fi + fi + rm -f $PIDFILE +} + + +case "$1" in + start) + log_daemon_msg "Starting $DESC " "$NAME" + # Check if it's running first + if running ; then + log_progress_msg "apparently already running" + log_end_msg 0 + exit 0 + fi + if start_server && running ; then + # It's ok, the server started and is running + log_end_msg 0 + else + # Either we could not start it or it is not running + # after we did + # NOTE: Some servers might die some time after they start, + # this code does not try to detect this and might give + # a false positive (use 'status' for that) + log_end_msg 1 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if running ; then + # Only stop the server if we see it running + stop_server + log_end_msg $? + else + # If it's not running don't do anything + log_progress_msg "apparently not running" + log_end_msg 0 + exit 0 + fi + ;; + force-stop) + # First try to stop gracefully the program + $0 stop + if running; then + # If it's still running try to kill it more forcefully + log_daemon_msg "Stopping (force) $DESC" "$NAME" + force_stop + log_end_msg $? + fi + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + if running; then + stop_server + # Wait some sensible amount, some server need this. + [ -n "$DODTIME" ] && sleep $DODTIME + fi + start_server + running + log_end_msg $? + ;; + status) + + log_daemon_msg "Checking status of $DESC" "$NAME" + if running ; then + log_progress_msg "running" + log_end_msg 0 + else + log_progress_msg "apparently not running" + log_end_msg 1 + exit 1 + fi + ;; + # Use this if the daemon cannot reload + reload) + log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" + log_warning_msg "cannot re-read the config file (use restart)." + ;; + *) + N=/etc/init.d/openvswitch-testcontroller + echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.install openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.install --- openvswitch-2.3.1/debian/openvswitch-testcontroller.install 2014-12-18 11:50:17.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.install 2015-06-24 09:55:58.000000000 +0000 @@ -1 +1 @@ -tests/test-controller usr/bin +usr/bin/ovs-testcontroller diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.manpages openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.manpages --- openvswitch-2.3.1/debian/openvswitch-testcontroller.manpages 2014-12-18 11:50:17.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.manpages 2015-06-24 09:56:10.000000000 +0000 @@ -1 +1 @@ -tests/test-controller.8 +utilities/ovs-testcontroller.8 diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.postinst openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.postinst --- openvswitch-2.3.1/debian/openvswitch-testcontroller.postinst 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.postinst 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1,60 @@ +#!/bin/sh +# postinst script for openvswitch-testcontroller +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + cd /etc/openvswitch-testcontroller + + # If cacert.pem is a symlink to the old location for cacert.pem, + # remove it so that we can symlink it to the new location. + if test -h cacert.pem && \ + test X"`readlink cacert.pem`" = X/usr/share/openvswitch/pki/switchca/cacert.pem; then + rm -f cacert.pem + fi + + if ! test -e cacert.pem; then + ln -s /var/lib/openvswitch/pki/switchca/cacert.pem cacert.pem + fi + if ! test -e privkey.pem || ! test -e cert.pem; then + oldumask=$(umask) + umask 077 + ovs-pki req+sign tmp controller >/dev/null + mv tmp-privkey.pem privkey.pem + mv tmp-cert.pem cert.pem + mv tmp-req.pem req.pem + chmod go+r cert.pem req.pem + umask $oldumask + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + + diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.postrm openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.postrm --- openvswitch-2.3.1/debian/openvswitch-testcontroller.postrm 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.postrm 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1,44 @@ +#!/bin/sh +# postrm script for openvswitch-testcontroller +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + if cd /etc/openvswitch-testcontroller; then + rm -f cacert.pem cert.pem privkey.pem req.pem + rm -f tmp-privkey.pem tmp-cert.pem tmp-req.pem + fi + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -Nru openvswitch-2.3.1/debian/openvswitch-testcontroller.README.Debian openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.README.Debian --- openvswitch-2.3.1/debian/openvswitch-testcontroller.README.Debian 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/openvswitch-testcontroller.README.Debian 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1,12 @@ +README.Debian for openvswitch-testcontroller +-------------------------------------------- + +The controller in this package enables OpenFlow switches that connect +to it to act as MAC-learning Ethernet switches. It can be used for +initial testing of OpenFlow networks. It is not a necessary or +desirable part of a production OpenFlow deployment. + +To (re)configure the controller, edit /etc/default/openvswitch-testcontroller +and run "/etc/init.d/openvswitch-testcontroller restart". + + -- Ben Pfaff , Thu, 14 Aug 2014 10:49:34 -0700 diff -Nru openvswitch-2.3.1/debian/patches/cfm-avoid-long-delay.patch openvswitch-2.4.0~git20150623/debian/patches/cfm-avoid-long-delay.patch --- openvswitch-2.3.1/debian/patches/cfm-avoid-long-delay.patch 2014-12-12 11:26:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/patches/cfm-avoid-long-delay.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From df0e5f55763289e37f90d1f2464423f07478f372 Mon Sep 17 00:00:00 2001 -From: Ben Pfaff -Date: Fri, 25 Jul 2014 09:19:17 -0700 -Subject: [PATCH] cfm: Reduce "long delay" message from WARN to INFO, to match - BFD behavior. - -These messages can cause the testsuite to fail on a busy build machine -since the testsuite treats WARN or ERR log messages as failures. BFD -uses an INFO message instead of WARN, so this just changes CFM to match. - -Alternatively, the testsuite could ignore "long delay" messages (it ignores -some other categories of messages). In that case I'd expect that we'd -want to change BFD to match CFM since I don't know of a reason why they -should log differently. - -Signed-off-by: Ben Pfaff -Acked-by: Justin Pettit ---- - lib/cfm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/cfm.c b/lib/cfm.c -index 7784369..d83a68c 100644 ---- a/lib/cfm.c -+++ b/lib/cfm.c -@@ -613,7 +613,7 @@ cfm_compose_ccm(struct cfm *cfm, struct ofpbuf *packet, - if (cfm->last_tx) { - long long int delay = time_msec() - cfm->last_tx; - if (delay > (cfm->ccm_interval_ms * 3 / 2)) { -- VLOG_WARN("%s: long delay of %lldms (expected %dms) sending CCM" -+ VLOG_INFO("%s: long delay of %lldms (expected %dms) sending CCM" - " seq %"PRIu32, cfm->name, delay, cfm->ccm_interval_ms, - cfm->seq); - } --- -1.9.1 - diff -Nru openvswitch-2.3.1/debian/patches/disable-poll-loop-logging-for-long-output.patch openvswitch-2.4.0~git20150623/debian/patches/disable-poll-loop-logging-for-long-output.patch --- openvswitch-2.3.1/debian/patches/disable-poll-loop-logging-for-long-output.patch 2014-12-14 20:04:42.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/patches/disable-poll-loop-logging-for-long-output.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -From 222820c67cea17ed76024364dcdd08778d1232fc Mon Sep 17 00:00:00 2001 -From: Ben Pfaff -Date: Tue, 29 Jul 2014 09:54:17 -0700 -Subject: [PATCH] tests: Turn off appctl poll_loop logging for long output. - -One of the VMware internal autobuilder builds failed due to extraneous -logging in these tests of the form: - - 2014-07-28T21:11:07Z|00001|poll_loop|INFO|wakeup due to [POLLIN] on fd 3 - (...) at lib/stream-fd-unix.c:124 (93% CPU usage) - -I think this must be because these tests have tons of output and so on a -loaded machine it can take some CPU to pull it down. We don't want to fail -for that reason, so disable this logging. - -Signed-off-by: Ben Pfaff -Acked-by: Ansis Atteka ---- - tests/ofproto-dpif.at | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/tests/ofproto-dpif.at -+++ b/tests/ofproto-dpif.at -@@ -4560,7 +4560,7 @@ AT_BANNER([ofproto-dpif - flow translati - AT_SETUP([ofproto-dpif - infinite resubmit]) - OVS_VSWITCHD_START - AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3]) --AT_CHECK([ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'], -+AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'], - [0], [stdout]) - AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop - ]) -@@ -4579,7 +4579,7 @@ ADD_OF_PORTS([br0], 1) - done - echo "in_port=65, actions=local") > flows - AT_CHECK([ovs-ofctl add-flows br0 flows]) --AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout]) -+AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout]) - AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1 - ]) - OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"]) -@@ -4594,7 +4594,7 @@ ADD_OF_PORTS([br0], 1) - done - echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows - AT_CHECK([ovs-ofctl add-flows br0 flows]) --AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout]) -+AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout]) - AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout], - [0], [1 - ]) -@@ -4613,7 +4613,7 @@ ADD_OF_PORTS([br0], 1) - push="push:NXM_NX_REG0[[]]" - echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows - AT_CHECK([ovs-ofctl add-flows br0 flows]) --AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout]) -+AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout]) - AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1 - ]) - OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"]) diff -Nru openvswitch-2.3.1/debian/patches/ovs-appctl-log-options.patch openvswitch-2.4.0~git20150623/debian/patches/ovs-appctl-log-options.patch --- openvswitch-2.3.1/debian/patches/ovs-appctl-log-options.patch 2014-12-12 11:26:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/patches/ovs-appctl-log-options.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -From 9664732f4cd90b741b840db8a8ed24939d227c2e Mon Sep 17 00:00:00 2001 -From: Ben Pfaff -Date: Mon, 4 Aug 2014 12:36:04 -0700 -Subject: [PATCH] ovs-appctl: Add logging options. - -Normally I would also add documentation for the logging options to the -ovs-appctl manpage, but I am concerned that in this case it would actually -make the manpage confusing, because one of the main purposes of ovs-appctl -is to modify the log levels of *other* programs, and these options only -modify the log level of ovs-appctl itself, which is rarely useful. - -The following commit will start using these logging options in a test. - -Signed-off-by: Ben Pfaff -Acked-by: Ansis Atteka ---- - utilities/ovs-appctl.c | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c -index a6fbebd..bb17ec2 100644 ---- a/utilities/ovs-appctl.c -+++ b/utilities/ovs-appctl.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. -+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2014 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. -@@ -31,6 +31,7 @@ - #include "timeval.h" - #include "unixctl.h" - #include "util.h" -+#include "vlog.h" - - static void usage(void); - static const char *parse_command_line(int argc, char *argv[]); -@@ -108,14 +109,20 @@ Other options:\n\ - static const char * - parse_command_line(int argc, char *argv[]) - { -+ enum { -+ VLOG_OPTION_ENUMS -+ }; - static const struct option long_options[] = { - {"target", required_argument, NULL, 't'}, - {"execute", no_argument, NULL, 'e'}, - {"help", no_argument, NULL, 'h'}, - {"version", no_argument, NULL, 'V'}, - {"timeout", required_argument, NULL, 'T'}, -+ VLOG_LONG_OPTIONS, - {NULL, 0, NULL, 0}, - }; -+ char *short_options_ = long_options_to_short_options(long_options); -+ char *short_options = xasprintf("+%s", short_options_); - const char *target; - int e_options; - -@@ -124,7 +131,7 @@ parse_command_line(int argc, char *argv[]) - for (;;) { - int option; - -- option = getopt_long(argc, argv, "+t:hVe", long_options, NULL); -+ option = getopt_long(argc, argv, short_options, long_options, NULL); - if (option == -1) { - break; - } -@@ -158,6 +165,8 @@ parse_command_line(int argc, char *argv[]) - ovs_print_version(0, 0); - exit(EXIT_SUCCESS); - -+ VLOG_OPTION_HANDLERS -+ - case '?': - exit(EXIT_FAILURE); - -@@ -165,6 +174,8 @@ parse_command_line(int argc, char *argv[]) - OVS_NOT_REACHED(); - } - } -+ free(short_options_); -+ free(short_options); - - if (optind >= argc) { - ovs_fatal(0, "at least one non-option argument is required " --- -1.9.1 - diff -Nru openvswitch-2.3.1/debian/patches/series openvswitch-2.4.0~git20150623/debian/patches/series --- openvswitch-2.3.1/debian/patches/series 2014-12-12 11:26:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -xcp-interface-reconfigure.patch -cfm-avoid-long-delay.patch -ovs-appctl-log-options.patch -disable-poll-loop-logging-for-long-output.patch diff -Nru openvswitch-2.3.1/debian/patches/xcp-interface-reconfigure.patch openvswitch-2.4.0~git20150623/debian/patches/xcp-interface-reconfigure.patch --- openvswitch-2.3.1/debian/patches/xcp-interface-reconfigure.patch 2014-12-12 11:26:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/patches/xcp-interface-reconfigure.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Description: Use xcp-xapi interface-reconfigure if found - Ubuntu/Debian provide the XCP interface-reconfigure hook in - a FHS compliant location; use this if found. -Author: James Page -Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/1195053 -Forwarded: no - ---- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update -+++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update -@@ -43,6 +43,10 @@ def delete_cacert(): - def update(session, args): - # Refresh bridge network UUIDs in case this host joined or left a pool. - script = "/opt/xensource/libexec/interface-reconfigure" -+ # NOTE(jamespage): Override with distro xcp xapi locations -+ # if present -+ if os.path.exists('/usr/lib/xcp/lib/interface-reconfigure'): -+ script = '/usr/lib/xcp/lib/interface-reconfigure' - try: - retval = subprocess.call([script, "rewrite"]) - if retval != 0: diff -Nru openvswitch-2.3.1/debian/rules openvswitch-2.4.0~git20150623/debian/rules --- openvswitch-2.3.1/debian/rules 2014-12-18 11:57:57.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/rules 2015-06-24 09:54:38.000000000 +0000 @@ -21,7 +21,7 @@ override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - if $(MAKE) check TESTSUITEFLAGS='$(PARALLEL) 1-710 714-' ||\ + if $(MAKE) check TESTSUITEFLAGS='$(PARALLEL)' || \ $(MAKE) check TESTSUITEFLAGS='--recheck'; then :; \ else \ cat tests/testsuite.log; \ @@ -51,7 +51,7 @@ # Helper target for creating snapshots from upstream git DATE=$(shell date +%Y%m%d) # Upstream branch to track -BRANCH=branch-2.3 +BRANCH=branch-2.4 get-orig-snapshot: rm -Rf openvswitch-upstream diff -Nru openvswitch-2.3.1/debian/rules.modules openvswitch-2.4.0~git20150623/debian/rules.modules --- openvswitch-2.3.1/debian/rules.modules 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/debian/rules.modules 2015-06-23 20:58:45.000000000 +0000 @@ -0,0 +1,39 @@ +#! /usr/bin/make -f + +PACKAGE=openvswitch-datapath-module +MA_DIR ?= /usr/share/modass +-include $(MA_DIR)/include/generic.make +-include $(MA_DIR)/include/common-rules.make + +DATAPATH_CONFIGURE_OPTS = + +kdist_clean: + dh_testdir + dh_testroot + dh_clean + rm -rf openvswitch + +.PHONY: kdist_config +kdist_config: prep-deb-files + +.PHONY: binary-modules +binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel/updates +binary-modules: prep-deb-files + dh_testdir + dh_testroot + dh_clean -k + tar xzf openvswitch.tar.gz + cd openvswitch && ./configure --with-linux=$(KSRC) $(DATAPATH_CONFIGURE_OPTS) + cd openvswitch && $(MAKE) -C datapath/linux + install -d -m755 $(DSTDIR) + install -m644 openvswitch/datapath/linux/*.ko $(DSTDIR)/ + dh_installmodules + dh_installdocs + dh_installchangelogs + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb --destdir=$(DEB_DESTDIR) + diff -Nru openvswitch-2.3.1/DESIGN openvswitch-2.4.0~git20150623/DESIGN --- openvswitch-2.3.1/DESIGN 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/DESIGN 1970-01-01 00:00:00.000000000 +0000 @@ -1,933 +0,0 @@ - Design Decisions In Open vSwitch - ================================ - -This document describes design decisions that went into implementing -Open vSwitch. While we believe these to be reasonable decisions, it is -impossible to predict how Open vSwitch will be used in all environments. -Understanding assumptions made by Open vSwitch is critical to a -successful deployment. The end of this document contains contact -information that can be used to let us know how we can make Open vSwitch -more generally useful. - -Asynchronous Messages -===================== - -Over time, Open vSwitch has added many knobs that control whether a -given controller receives OpenFlow asynchronous messages. This -section describes how all of these features interact. - -First, a service controller never receives any asynchronous messages -unless it changes its miss_send_len from the service controller -default of zero in one of the following ways: - - - Sending an OFPT_SET_CONFIG message with nonzero miss_send_len. - - - Sending any NXT_SET_ASYNC_CONFIG message: as a side effect, this - message changes the miss_send_len to - OFP_DEFAULT_MISS_SEND_LEN (128) for service controllers. - -Second, OFPT_FLOW_REMOVED and NXT_FLOW_REMOVED messages are generated -only if the flow that was removed had the OFPFF_SEND_FLOW_REM flag -set. - -Third, OFPT_PACKET_IN and NXT_PACKET_IN messages are sent only to -OpenFlow controller connections that have the correct connection ID -(see "struct nx_controller_id" and "struct nx_action_controller"): - - - For packet-in messages generated by a NXAST_CONTROLLER action, - the controller ID specified in the action. - - - For other packet-in messages, controller ID zero. (This is the - default ID when an OpenFlow controller does not configure one.) - -Finally, Open vSwitch consults a per-connection table indexed by the -message type, reason code, and current role. The following table -shows how this table is initialized by default when an OpenFlow -connection is made. An entry labeled "yes" means that the message is -sent, an entry labeled "---" means that the message is suppressed. - - master/ - message and reason code other slave - ---------------------------------------- ------- ----- - OFPT_PACKET_IN / NXT_PACKET_IN - OFPR_NO_MATCH yes --- - OFPR_ACTION yes --- - OFPR_INVALID_TTL --- --- - - OFPT_FLOW_REMOVED / NXT_FLOW_REMOVED - OFPRR_IDLE_TIMEOUT yes --- - OFPRR_HARD_TIMEOUT yes --- - OFPRR_DELETE yes --- - - OFPT_PORT_STATUS - OFPPR_ADD yes yes - OFPPR_DELETE yes yes - OFPPR_MODIFY yes yes - -The NXT_SET_ASYNC_CONFIG message directly sets all of the values in -this table for the current connection. The -OFPC_INVALID_TTL_TO_CONTROLLER bit in the OFPT_SET_CONFIG message -controls the setting for OFPR_INVALID_TTL for the "master" role. - - -OFPAT_ENQUEUE -============= - -The OpenFlow 1.0 specification requires the output port of the OFPAT_ENQUEUE -action to "refer to a valid physical port (i.e. < OFPP_MAX) or OFPP_IN_PORT". -Although OFPP_LOCAL is not less than OFPP_MAX, it is an 'internal' port which -can have QoS applied to it in Linux. Since we allow the OFPAT_ENQUEUE to apply -to 'internal' ports whose port numbers are less than OFPP_MAX, we interpret -OFPP_LOCAL as a physical port and support OFPAT_ENQUEUE on it as well. - - -OFPT_FLOW_MOD -============= - -The OpenFlow specification for the behavior of OFPT_FLOW_MOD is -confusing. The following tables summarize the Open vSwitch -implementation of its behavior in the following categories: - - - "match on priority": Whether the flow_mod acts only on flows - whose priority matches that included in the flow_mod message. - - - "match on out_port": Whether the flow_mod acts only on flows - that output to the out_port included in the flow_mod message (if - out_port is not OFPP_NONE). OpenFlow 1.1 and later have a - similar feature (not listed separately here) for out_group. - - - "match on flow_cookie": Whether the flow_mod acts only on flows - whose flow_cookie matches an optional controller-specified value - and mask. - - - "updates flow_cookie": Whether the flow_mod changes the - flow_cookie of the flow or flows that it matches to the - flow_cookie included in the flow_mod message. - - - "updates OFPFF_ flags": Whether the flow_mod changes the - OFPFF_SEND_FLOW_REM flag of the flow or flows that it matches to - the setting included in the flags of the flow_mod message. - - - "honors OFPFF_CHECK_OVERLAP": Whether the OFPFF_CHECK_OVERLAP - flag in the flow_mod is significant. - - - "updates idle_timeout" and "updates hard_timeout": Whether the - idle_timeout and hard_timeout in the flow_mod, respectively, - have an effect on the flow or flows matched by the flow_mod. - - - "updates idle timer": Whether the flow_mod resets the per-flow - timer that measures how long a flow has been idle. - - - "updates hard timer": Whether the flow_mod resets the per-flow - timer that measures how long it has been since a flow was - modified. - - - "zeros counters": Whether the flow_mod resets per-flow packet - and byte counters to zero. - - - "may add a new flow": Whether the flow_mod may add a new flow to - the flow table. (Obviously this is always true for "add" - commands but in some OpenFlow versions "modify" and - "modify-strict" can also add new flows.) - - - "sends flow_removed message": Whether the flow_mod generates a - flow_removed message for the flow or flows that it affects. - -An entry labeled "yes" means that the flow mod type does have the -indicated behavior, "---" means that it does not, an empty cell means -that the property is not applicable, and other values are explained -below the table. - -OpenFlow 1.0 ------------- - - MODIFY DELETE - ADD MODIFY STRICT DELETE STRICT - === ====== ====== ====== ====== -match on priority yes --- yes --- yes -match on out_port --- --- --- yes yes -match on flow_cookie --- --- --- --- --- -match on table_id --- --- --- --- --- -controller chooses table_id --- --- --- -updates flow_cookie yes yes yes -updates OFPFF_SEND_FLOW_REM yes + + -honors OFPFF_CHECK_OVERLAP yes + + -updates idle_timeout yes + + -updates hard_timeout yes + + -resets idle timer yes + + -resets hard timer yes yes yes -zeros counters yes + + -may add a new flow yes yes yes -sends flow_removed message --- --- --- % % - -(+) "modify" and "modify-strict" only take these actions when they - create a new flow, not when they update an existing flow. - -(%) "delete" and "delete_strict" generates a flow_removed message if - the deleted flow or flows have the OFPFF_SEND_FLOW_REM flag set. - (Each controller can separately control whether it wants to - receive the generated messages.) - -OpenFlow 1.1 ------------- - -OpenFlow 1.1 makes these changes: - - - The controller now must specify the table_id of the flow match - searched and into which a flow may be inserted. Behavior for a - table_id of 255 is undefined. - - - A flow_mod, except an "add", can now match on the flow_cookie. - - - When a flow_mod matches on the flow_cookie, "modify" and - "modify-strict" never insert a new flow. - - MODIFY DELETE - ADD MODIFY STRICT DELETE STRICT - === ====== ====== ====== ====== -match on priority yes --- yes --- yes -match on out_port --- --- --- yes yes -match on flow_cookie --- yes yes yes yes -match on table_id yes yes yes yes yes -controller chooses table_id yes yes yes -updates flow_cookie yes --- --- -updates OFPFF_SEND_FLOW_REM yes + + -honors OFPFF_CHECK_OVERLAP yes + + -updates idle_timeout yes + + -updates hard_timeout yes + + -resets idle timer yes + + -resets hard timer yes yes yes -zeros counters yes + + -may add a new flow yes # # -sends flow_removed message --- --- --- % % - -(+) "modify" and "modify-strict" only take these actions when they - create a new flow, not when they update an existing flow. - -(%) "delete" and "delete_strict" generates a flow_removed message if - the deleted flow or flows have the OFPFF_SEND_FLOW_REM flag set. - (Each controller can separately control whether it wants to - receive the generated messages.) - -(#) "modify" and "modify-strict" only add a new flow if the flow_mod - does not match on any bits of the flow cookie - -OpenFlow 1.2 ------------- - -OpenFlow 1.2 makes these changes: - - - Only "add" commands ever add flows, "modify" and "modify-strict" - never do. - - - A new flag OFPFF_RESET_COUNTS now controls whether "modify" and - "modify-strict" reset counters, whereas previously they never - reset counters (except when they inserted a new flow). - - MODIFY DELETE - ADD MODIFY STRICT DELETE STRICT - === ====== ====== ====== ====== -match on priority yes --- yes --- yes -match on out_port --- --- --- yes yes -match on flow_cookie --- yes yes yes yes -match on table_id yes yes yes yes yes -controller chooses table_id yes yes yes -updates flow_cookie yes --- --- -updates OFPFF_SEND_FLOW_REM yes --- --- -honors OFPFF_CHECK_OVERLAP yes --- --- -updates idle_timeout yes --- --- -updates hard_timeout yes --- --- -resets idle timer yes --- --- -resets hard timer yes yes yes -zeros counters yes & & -may add a new flow yes --- --- -sends flow_removed message --- --- --- % % - -(%) "delete" and "delete_strict" generates a flow_removed message if - the deleted flow or flows have the OFPFF_SEND_FLOW_REM flag set. - (Each controller can separately control whether it wants to - receive the generated messages.) - -(&) "modify" and "modify-strict" reset counters if the - OFPFF_RESET_COUNTS flag is specified. - -OpenFlow 1.3 ------------- - -OpenFlow 1.3 makes these changes: - - - Behavior for a table_id of 255 is now defined, for "delete" and - "delete-strict" commands, as meaning to delete from all tables. - A table_id of 255 is now explicitly invalid for other commands. - - - New flags OFPFF_NO_PKT_COUNTS and OFPFF_NO_BYT_COUNTS for "add" - operations. - -The table for 1.3 is the same as the one shown above for 1.2. - - -OpenFlow 1.4 ------------- - -OpenFlow 1.4 does not change flow_mod semantics. - - -OFPT_PACKET_IN -============== - -The OpenFlow 1.1 specification for OFPT_PACKET_IN is confusing. The -definition in OF1.1 openflow.h is[*]: - - /* Packet received on port (datapath -> controller). */ - struct ofp_packet_in { - struct ofp_header header; - uint32_t buffer_id; /* ID assigned by datapath. */ - uint32_t in_port; /* Port on which frame was received. */ - uint32_t in_phy_port; /* Physical Port on which frame was received. */ - uint16_t total_len; /* Full length of frame. */ - uint8_t reason; /* Reason packet is being sent (one of OFPR_*) */ - uint8_t table_id; /* ID of the table that was looked up */ - uint8_t data[0]; /* Ethernet frame, halfway through 32-bit word, - so the IP header is 32-bit aligned. The - amount of data is inferred from the length - field in the header. Because of padding, - offsetof(struct ofp_packet_in, data) == - sizeof(struct ofp_packet_in) - 2. */ - }; - OFP_ASSERT(sizeof(struct ofp_packet_in) == 24); - -The confusing part is the comment on the data[] member. This comment -is a leftover from OF1.0 openflow.h, in which the comment was correct: -sizeof(struct ofp_packet_in) is 20 in OF1.0 and offsetof(struct -ofp_packet_in, data) is 18. When OF1.1 was written, the structure -members were changed but the comment was carelessly not updated, and -the comment became wrong: sizeof(struct ofp_packet_in) and -offsetof(struct ofp_packet_in, data) are both 24 in OF1.1. - -That leaves the question of how to implement ofp_packet_in in OF1.1. -The OpenFlow reference implementation for OF1.1 does not include any -padding, that is, the first byte of the encapsulated frame immediately -follows the 'table_id' member without a gap. Open vSwitch therefore -implements it the same way for compatibility. - -For an earlier discussion, please see the thread archived at: -https://mailman.stanford.edu/pipermail/openflow-discuss/2011-August/002604.html - -[*] The quoted definition is directly from OF1.1. Definitions used - inside OVS omit the 8-byte ofp_header members, so the sizes in - this discussion are 8 bytes larger than those declared in OVS - header files. - - -VLAN Matching -============= - -The 802.1Q VLAN header causes more trouble than any other 4 bytes in -networking. More specifically, three versions of OpenFlow and Open -vSwitch have among them four different ways to match the contents and -presence of the VLAN header. The following table describes how each -version works. - - Match NXM OF1.0 OF1.1 OF1.2 - ----- --------- ----------- ----------- ------------ - [1] 0000/0000 ????/1,??/? ????/1,??/? 0000/0000,-- - [2] 0000/ffff ffff/0,??/? ffff/0,??/? 0000/ffff,-- - [3] 1xxx/1fff 0xxx/0,??/1 0xxx/0,??/1 1xxx/ffff,-- - [4] z000/f000 ????/1,0y/0 fffe/0,0y/0 1000/1000,0y - [5] zxxx/ffff 0xxx/0,0y/0 0xxx/0,0y/0 1xxx/ffff,0y - [6] 0000/0fff - [7] 0000/f000 - [8] 0000/efff - [9] 1001/1001 1001/1001,-- - [10] 3000/3000 - -Each column is interpreted as follows. - - - Match: See the list below. - - - NXM: xxxx/yyyy means NXM_OF_VLAN_TCI_W with value xxxx and mask - yyyy. A mask of 0000 is equivalent to omitting - NXM_OF_VLAN_TCI(_W), a mask of ffff is equivalent to - NXM_OF_VLAN_TCI. - - - OF1.0 and OF1.1: wwww/x,yy/z means dl_vlan wwww, OFPFW_DL_VLAN - x, dl_vlan_pcp yy, and OFPFW_DL_VLAN_PCP z. ? means that the - given nibble is ignored (and conventionally 0 for wwww or yy, - conventionally 1 for x or z). means that the given match - is not supported. - - - OF1.2: xxxx/yyyy,zz means OXM_OF_VLAN_VID_W with value xxxx and - mask yyyy, and OXM_OF_VLAN_PCP (which is not maskable) with - value zz. A mask of 0000 is equivalent to omitting - OXM_OF_VLAN_VID(_W), a mask of ffff is equivalent to - OXM_OF_VLAN_VID. -- means that OXM_OF_VLAN_PCP is omitted. - means that the given match is not supported. - -The matches are: - - [1] Matches any packet, that is, one without an 802.1Q header or with - an 802.1Q header with any TCI value. - - [2] Matches only packets without an 802.1Q header. - - NXM: Any match with (vlan_tci == 0) and (vlan_tci_mask & 0x1000) - != 0 is equivalent to the one listed in the table. - - OF1.0: The spec doesn't define behavior if dl_vlan is set to - 0xffff and OFPFW_DL_VLAN_PCP is not set. - - OF1.1: The spec says explicitly to ignore dl_vlan_pcp when - dl_vlan is set to 0xffff. - - OF1.2: The spec doesn't say what should happen if (vlan_vid == 0) - and (vlan_vid_mask & 0x1000) != 0 but (vlan_vid_mask != 0x1000), - but it would be straightforward to also interpret as [2]. - - [3] Matches only packets that have an 802.1Q header with VID xxx (and - any PCP). - - [4] Matches only packets that have an 802.1Q header with PCP y (and - any VID). - - NXM: z is ((y << 1) | 1). - - OF1.0: The spec isn't very clear, but OVS implements it this way. - - OF1.2: Presumably other masks such that (vlan_vid_mask & 0x1fff) - == 0x1000 would also work, but the spec doesn't define their - behavior. - - [5] Matches only packets that have an 802.1Q header with VID xxx and - PCP y. - - NXM: z is ((y << 1) | 1). - - OF1.2: Presumably other masks such that (vlan_vid_mask & 0x1fff) - == 0x1fff would also work. - - [6] Matches packets with no 802.1Q header or with an 802.1Q header - with a VID of 0. Only possible with NXM. - - [7] Matches packets with no 802.1Q header or with an 802.1Q header - with a PCP of 0. Only possible with NXM. - - [8] Matches packets with no 802.1Q header or with an 802.1Q header - with both VID and PCP of 0. Only possible with NXM. - - [9] Matches only packets that have an 802.1Q header with an - odd-numbered VID (and any PCP). Only possible with NXM and - OF1.2. (This is just an example; one can match on any desired - VID bit pattern.) - -[10] Matches only packets that have an 802.1Q header with an - odd-numbered PCP (and any VID). Only possible with NXM. (This - is just an example; one can match on any desired VID bit - pattern.) - -Additional notes: - - - OF1.2: The top three bits of OXM_OF_VLAN_VID are fixed to zero, - so bits 13, 14, and 15 in the masks listed in the table may be - set to arbitrary values, as long as the corresponding value bits - are also zero. The suggested ffff mask for [2], [3], and [5] - allows a shorter OXM representation (the mask is omitted) than - the minimal 1fff mask. - - -Flow Cookies -============ - -OpenFlow 1.0 and later versions have the concept of a "flow cookie", -which is a 64-bit integer value attached to each flow. The treatment -of the flow cookie has varied greatly across OpenFlow versions, -however. - -In OpenFlow 1.0: - - - OFPFC_ADD set the cookie in the flow that it added. - - - OFPFC_MODIFY and OFPFC_MODIFY_STRICT updated the cookie for - the flow or flows that it modified. - - - OFPST_FLOW messages included the flow cookie. - - - OFPT_FLOW_REMOVED messages reported the cookie of the flow - that was removed. - -OpenFlow 1.1 made the following changes: - - - Flow mod operations OFPFC_MODIFY, OFPFC_MODIFY_STRICT, - OFPFC_DELETE, and OFPFC_DELETE_STRICT, plus flow stats - requests and aggregate stats requests, gained the ability to - match on flow cookies with an arbitrary mask. - - - OFPFC_MODIFY and OFPFC_MODIFY_STRICT were changed to add a - new flow, in the case of no match, only if the flow table - modification operation did not match on the cookie field. - (In OpenFlow 1.0, modify operations always added a new flow - when there was no match.) - - - OFPFC_MODIFY and OFPFC_MODIFY_STRICT no longer updated flow - cookies. - -OpenFlow 1.2 made the following changes: - - - OFPC_MODIFY and OFPFC_MODIFY_STRICT were changed to never - add a new flow, regardless of whether the flow cookie was - used for matching. - -Open vSwitch support for OpenFlow 1.0 implements the OpenFlow 1.0 -behavior with the following extensions: - - - An NXM extension field NXM_NX_COOKIE(_W) allows the NXM - versions of OFPFC_MODIFY, OFPFC_MODIFY_STRICT, OFPFC_DELETE, - and OFPFC_DELETE_STRICT flow_mods, plus flow stats requests - and aggregate stats requests, to match on flow cookies with - arbitrary masks. This is much like the equivalent OpenFlow - 1.1 feature. - - - Like OpenFlow 1.1, OFPC_MODIFY and OFPFC_MODIFY_STRICT add a - new flow if there is no match and the mask is zero (or not - given). - - - The "cookie" field in OFPT_FLOW_MOD and NXT_FLOW_MOD messages - is used as the cookie value for OFPFC_ADD commands, as - described in OpenFlow 1.0. For OFPFC_MODIFY and - OFPFC_MODIFY_STRICT commands, the "cookie" field is used as a - new cookie for flows that match unless it is UINT64_MAX, in - which case the flow's cookie is not updated. - - - NXT_PACKET_IN (the Nicira extended version of - OFPT_PACKET_IN) reports the cookie of the rule that - generated the packet, or all-1-bits if no rule generated the - packet. (Older versions of OVS used all-0-bits instead of - all-1-bits.) - -The following table shows the handling of different protocols when -receiving OFPFC_MODIFY and OFPFC_MODIFY_STRICT messages. A mask of 0 -indicates either an explicit mask of zero or an implicit one by not -specifying the NXM_NX_COOKIE(_W) field. - - Match Update Add on miss Add on miss - cookie cookie mask!=0 mask==0 - ====== ====== =========== =========== -OpenFlow 1.0 no yes -OpenFlow 1.1 yes no no yes -OpenFlow 1.2 yes no no no -NXM yes yes* no yes - -* Updates the flow's cookie unless the "cookie" field is UINT64_MAX. - - -Multiple Table Support -====================== - -OpenFlow 1.0 has only rudimentary support for multiple flow tables. -Notably, OpenFlow 1.0 does not allow the controller to specify the -flow table to which a flow is to be added. Open vSwitch adds an -extension for this purpose, which is enabled on a per-OpenFlow -connection basis using the NXT_FLOW_MOD_TABLE_ID message. When the -extension is enabled, the upper 8 bits of the 'command' member in an -OFPT_FLOW_MOD or NXT_FLOW_MOD message designates the table to which a -flow is to be added. - -The Open vSwitch software switch implementation offers 255 flow -tables. On packet ingress, only the first flow table (table 0) is -searched, and the contents of the remaining tables are not considered -in any way. Tables other than table 0 only come into play when an -NXAST_RESUBMIT_TABLE action specifies another table to search. - -Tables 128 and above are reserved for use by the switch itself. -Controllers should use only tables 0 through 127. - - -IPv6 -==== - -Open vSwitch supports stateless handling of IPv6 packets. Flows can be -written to support matching TCP, UDP, and ICMPv6 headers within an IPv6 -packet. Deeper matching of some Neighbor Discovery messages is also -supported. - -IPv6 was not designed to interact well with middle-boxes. This, -combined with Open vSwitch's stateless nature, have affected the -processing of IPv6 traffic, which is detailed below. - -Extension Headers ------------------ - -The base IPv6 header is incredibly simple with the intention of only -containing information relevant for routing packets between two -endpoints. IPv6 relies heavily on the use of extension headers to -provide any other functionality. Unfortunately, the extension headers -were designed in such a way that it is impossible to move to the next -header (including the layer-4 payload) unless the current header is -understood. - -Open vSwitch will process the following extension headers and continue -to the next header: - - * Fragment (see the next section) - * AH (Authentication Header) - * Hop-by-Hop Options - * Routing - * Destination Options - -When a header is encountered that is not in that list, it is considered -"terminal". A terminal header's IPv6 protocol value is stored in -"nw_proto" for matching purposes. If a terminal header is TCP, UDP, or -ICMPv6, the packet will be further processed in an attempt to extract -layer-4 information. - -Fragments ---------- - -IPv6 requires that every link in the internet have an MTU of 1280 octets -or greater (RFC 2460). As such, a terminal header (as described above in -"Extension Headers") in the first fragment should generally be -reachable. In this case, the terminal header's IPv6 protocol type is -stored in the "nw_proto" field for matching purposes. If a terminal -header cannot be found in the first fragment (one with a fragment offset -of zero), the "nw_proto" field is set to 0. Subsequent fragments (those -with a non-zero fragment offset) have the "nw_proto" field set to the -IPv6 protocol type for fragments (44). - -Jumbograms ----------- - -An IPv6 jumbogram (RFC 2675) is a packet containing a payload longer -than 65,535 octets. A jumbogram is only relevant in subnets with a link -MTU greater than 65,575 octets, and are not required to be supported on -nodes that do not connect to link with such large MTUs. Currently, Open -vSwitch doesn't process jumbograms. - - -In-Band Control -=============== - -Motivation ----------- - -An OpenFlow switch must establish and maintain a TCP network -connection to its controller. There are two basic ways to categorize -the network that this connection traverses: either it is completely -separate from the one that the switch is otherwise controlling, or its -path may overlap the network that the switch controls. We call the -former case "out-of-band control", the latter case "in-band control". - -Out-of-band control has the following benefits: - - - Simplicity: Out-of-band control slightly simplifies the switch - implementation. - - - Reliability: Excessive switch traffic volume cannot interfere - with control traffic. - - - Integrity: Machines not on the control network cannot - impersonate a switch or a controller. - - - Confidentiality: Machines not on the control network cannot - snoop on control traffic. - -In-band control, on the other hand, has the following advantages: - - - No dedicated port: There is no need to dedicate a physical - switch port to control, which is important on switches that have - few ports (e.g. wireless routers, low-end embedded platforms). - - - No dedicated network: There is no need to build and maintain a - separate control network. This is important in many - environments because it reduces proliferation of switches and - wiring. - -Open vSwitch supports both out-of-band and in-band control. This -section describes the principles behind in-band control. See the -description of the Controller table in ovs-vswitchd.conf.db(5) to -configure OVS for in-band control. - -Principles ----------- - -The fundamental principle of in-band control is that an OpenFlow -switch must recognize and switch control traffic without involving the -OpenFlow controller. All the details of implementing in-band control -are special cases of this principle. - -The rationale for this principle is simple. If the switch does not -handle in-band control traffic itself, then it will be caught in a -contradiction: it must contact the controller, but it cannot, because -only the controller can set up the flows that are needed to contact -the controller. - -The following points describe important special cases of this -principle. - - - In-band control must be implemented regardless of whether the - switch is connected. - - It is tempting to implement the in-band control rules only when - the switch is not connected to the controller, using the - reasoning that the controller should have complete control once - it has established a connection with the switch. - - This does not work in practice. Consider the case where the - switch is connected to the controller. Occasionally it can - happen that the controller forgets or otherwise needs to obtain - the MAC address of the switch. To do so, the controller sends a - broadcast ARP request. A switch that implements the in-band - control rules only when it is disconnected will then send an - OFPT_PACKET_IN message up to the controller. The controller will - be unable to respond, because it does not know the MAC address of - the switch. This is a deadlock situation that can only be - resolved by the switch noticing that its connection to the - controller has hung and reconnecting. - - - In-band control must override flows set up by the controller. - - It is reasonable to assume that flows set up by the OpenFlow - controller should take precedence over in-band control, on the - basis that the controller should be in charge of the switch. - - Again, this does not work in practice. Reasonable controller - implementations may set up a "last resort" fallback rule that - wildcards every field and, e.g., sends it up to the controller or - discards it. If a controller does that, then it will isolate - itself from the switch. - - - The switch must recognize all control traffic. - - The fundamental principle of in-band control states, in part, - that a switch must recognize control traffic without involving - the OpenFlow controller. More specifically, the switch must - recognize *all* control traffic. "False negatives", that is, - packets that constitute control traffic but that the switch does - not recognize as control traffic, lead to control traffic storms. - - Consider an OpenFlow switch that only recognizes control packets - sent to or from that switch. Now suppose that two switches of - this type, named A and B, are connected to ports on an Ethernet - hub (not a switch) and that an OpenFlow controller is connected - to a third hub port. In this setup, control traffic sent by - switch A will be seen by switch B, which will send it to the - controller as part of an OFPT_PACKET_IN message. Switch A will - then see the OFPT_PACKET_IN message's packet, re-encapsulate it - in another OFPT_PACKET_IN, and send it to the controller. Switch - B will then see that OFPT_PACKET_IN, and so on in an infinite - loop. - - Incidentally, the consequences of "false positives", where - packets that are not control traffic are nevertheless recognized - as control traffic, are much less severe. The controller will - not be able to control their behavior, but the network will - remain in working order. False positives do constitute a - security problem. - - - The switch should use echo-requests to detect disconnection. - - TCP will notice that a connection has hung, but this can take a - considerable amount of time. For example, with default settings - the Linux kernel TCP implementation will retransmit for between - 13 and 30 minutes, depending on the connection's retransmission - timeout, according to kernel documentation. This is far too long - for a switch to be disconnected, so an OpenFlow switch should - implement its own connection timeout. OpenFlow OFPT_ECHO_REQUEST - messages are the best way to do this, since they test the - OpenFlow connection itself. - -Implementation --------------- - -This section describes how Open vSwitch implements in-band control. -Correctly implementing in-band control has proven difficult due to its -many subtleties, and has thus gone through many iterations. Please -read through and understand the reasoning behind the chosen rules -before making modifications. - -Open vSwitch implements in-band control as "hidden" flows, that is, -flows that are not visible through OpenFlow, and at a higher priority -than wildcarded flows can be set up through OpenFlow. This is done so -that the OpenFlow controller cannot interfere with them and possibly -break connectivity with its switches. It is possible to see all -flows, including in-band ones, with the ovs-appctl "bridge/dump-flows" -command. - -The Open vSwitch implementation of in-band control can hide traffic to -arbitrary "remotes", where each remote is one TCP port on one IP address. -Currently the remotes are automatically configured as the in-band OpenFlow -controllers plus the OVSDB managers, if any. (The latter is a requirement -because OVSDB managers are responsible for configuring OpenFlow controllers, -so if the manager cannot be reached then OpenFlow cannot be reconfigured.) - -The following rules (with the OFPP_NORMAL action) are set up on any bridge -that has any remotes: - - (a) DHCP requests sent from the local port. - (b) ARP replies to the local port's MAC address. - (c) ARP requests from the local port's MAC address. - -In-band also sets up the following rules for each unique next-hop MAC -address for the remotes' IPs (the "next hop" is either the remote -itself, if it is on a local subnet, or the gateway to reach the remote): - - (d) ARP replies to the next hop's MAC address. - (e) ARP requests from the next hop's MAC address. - -In-band also sets up the following rules for each unique remote IP address: - - (f) ARP replies containing the remote's IP address as a target. - (g) ARP requests containing the remote's IP address as a source. - -In-band also sets up the following rules for each unique remote (IP,port) -pair: - - (h) TCP traffic to the remote's IP and port. - (i) TCP traffic from the remote's IP and port. - -The goal of these rules is to be as narrow as possible to allow a -switch to join a network and be able to communicate with the -remotes. As mentioned earlier, these rules have higher priority -than the controller's rules, so if they are too broad, they may -prevent the controller from implementing its policy. As such, -in-band actively monitors some aspects of flow and packet processing -so that the rules can be made more precise. - -In-band control monitors attempts to add flows into the datapath that -could interfere with its duties. The datapath only allows exact -match entries, so in-band control is able to be very precise about -the flows it prevents. Flows that miss in the datapath are sent to -userspace to be processed, so preventing these flows from being -cached in the "fast path" does not affect correctness. The only type -of flow that is currently prevented is one that would prevent DHCP -replies from being seen by the local port. For example, a rule that -forwarded all DHCP traffic to the controller would not be allowed, -but one that forwarded to all ports (including the local port) would. - -As mentioned earlier, packets that miss in the datapath are sent to -the userspace for processing. The userspace has its own flow table, -the "classifier", so in-band checks whether any special processing -is needed before the classifier is consulted. If a packet is a DHCP -response to a request from the local port, the packet is forwarded to -the local port, regardless of the flow table. Note that this requires -L7 processing of DHCP replies to determine whether the 'chaddr' field -matches the MAC address of the local port. - -It is interesting to note that for an L3-based in-band control -mechanism, the majority of rules are devoted to ARP traffic. At first -glance, some of these rules appear redundant. However, each serves an -important role. First, in order to determine the MAC address of the -remote side (controller or gateway) for other ARP rules, we must allow -ARP traffic for our local port with rules (b) and (c). If we are -between a switch and its connection to the remote, we have to -allow the other switch's ARP traffic to through. This is done with -rules (d) and (e), since we do not know the addresses of the other -switches a priori, but do know the remote's or gateway's. Finally, -if the remote is running in a local guest VM that is not reached -through the local port, the switch that is connected to the VM must -allow ARP traffic based on the remote's IP address, since it will -not know the MAC address of the local port that is sending the traffic -or the MAC address of the remote in the guest VM. - -With a few notable exceptions below, in-band should work in most -network setups. The following are considered "supported' in the -current implementation: - - - Locally Connected. The switch and remote are on the same - subnet. This uses rules (a), (b), (c), (h), and (i). - - - Reached through Gateway. The switch and remote are on - different subnets and must go through a gateway. This uses - rules (a), (b), (c), (h), and (i). - - - Between Switch and Remote. This switch is between another - switch and the remote, and we want to allow the other - switch's traffic through. This uses rules (d), (e), (h), and - (i). It uses (b) and (c) indirectly in order to know the MAC - address for rules (d) and (e). Note that DHCP for the other - switch will not work unless an OpenFlow controller explicitly lets this - switch pass the traffic. - - - Between Switch and Gateway. This switch is between another - switch and the gateway, and we want to allow the other switch's - traffic through. This uses the same rules and logic as the - "Between Switch and Remote" configuration described earlier. - - - Remote on Local VM. The remote is a guest VM on the - system running in-band control. This uses rules (a), (b), (c), - (h), and (i). - - - Remote on Local VM with Different Networks. The remote - is a guest VM on the system running in-band control, but the - local port is not used to connect to the remote. For - example, an IP address is configured on eth0 of the switch. The - remote's VM is connected through eth1 of the switch, but an - IP address has not been configured for that port on the switch. - As such, the switch will use eth0 to connect to the remote, - and eth1's rules about the local port will not work. In the - example, the switch attached to eth0 would use rules (a), (b), - (c), (h), and (i) on eth0. The switch attached to eth1 would use - rules (f), (g), (h), and (i). - -The following are explicitly *not* supported by in-band control: - - - Specify Remote by Name. Currently, the remote must be - identified by IP address. A naive approach would be to permit - all DNS traffic. Unfortunately, this would prevent the - controller from defining any policy over DNS. Since switches - that are located behind us need to connect to the remote, - in-band cannot simply add a rule that allows DNS traffic from - the local port. The "correct" way to support this is to parse - DNS requests to allow all traffic related to a request for the - remote's name through. Due to the potential security - problems and amount of processing, we decided to hold off for - the time-being. - - - Differing Remotes for Switches. All switches must know - the L3 addresses for all the remotes that other switches - may use, since rules need to be set up to allow traffic related - to those remotes through. See rules (f), (g), (h), and (i). - - - Differing Routes for Switches. In order for the switch to - allow other switches to connect to a remote through a - gateway, it allows the gateway's traffic through with rules (d) - and (e). If the routes to the remote differ for the two - switches, we will not know the MAC address of the alternate - gateway. - - -Action Reproduction -=================== - -It seems likely that many controllers, at least at startup, use the -OpenFlow "flow statistics" request to obtain existing flows, then -compare the flows' actions against the actions that they expect to -find. Before version 1.8.0, Open vSwitch always returned exact, -byte-for-byte copies of the actions that had been added to the flow -table. The current version of Open vSwitch does not always do this in -some exceptional cases. This section lists the exceptions that -controller authors must keep in mind if they compare actual actions -against desired actions in a bytewise fashion: - - - Open vSwitch zeros padding bytes in action structures, - regardless of their values when the flows were added. - - - Open vSwitch "normalizes" the instructions in OpenFlow 1.1 - (and later) in the following way: - - * OVS sorts the instructions into the following order: - Apply-Actions, Clear-Actions, Write-Actions, - Write-Metadata, Goto-Table. - - * OVS drops Apply-Actions instructions that have empty - action lists. - - * OVS drops Write-Actions instructions that have empty - action sets. - -Please report other discrepancies, if you notice any, so that we can -fix or document them. - - -Suggestions -=========== - -Suggestions to improve Open vSwitch are welcome at discuss@openvswitch.org. diff -Nru openvswitch-2.3.1/DESIGN.md openvswitch-2.4.0~git20150623/DESIGN.md --- openvswitch-2.3.1/DESIGN.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/DESIGN.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,998 @@ +Design Decisions In Open vSwitch +================================ + +This document describes design decisions that went into implementing +Open vSwitch. While we believe these to be reasonable decisions, it is +impossible to predict how Open vSwitch will be used in all environments. +Understanding assumptions made by Open vSwitch is critical to a +successful deployment. The end of this document contains contact +information that can be used to let us know how we can make Open vSwitch +more generally useful. + +Asynchronous Messages +===================== + +Over time, Open vSwitch has added many knobs that control whether a +given controller receives OpenFlow asynchronous messages. This +section describes how all of these features interact. + +First, a service controller never receives any asynchronous messages +unless it changes its miss_send_len from the service controller +default of zero in one of the following ways: + + - Sending an OFPT_SET_CONFIG message with nonzero miss_send_len. + + - Sending any NXT_SET_ASYNC_CONFIG message: as a side effect, this + message changes the miss_send_len to + OFP_DEFAULT_MISS_SEND_LEN (128) for service controllers. + +Second, OFPT_FLOW_REMOVED and NXT_FLOW_REMOVED messages are generated +only if the flow that was removed had the OFPFF_SEND_FLOW_REM flag +set. + +Third, OFPT_PACKET_IN and NXT_PACKET_IN messages are sent only to +OpenFlow controller connections that have the correct connection ID +(see "struct nx_controller_id" and "struct nx_action_controller"): + + - For packet-in messages generated by a NXAST_CONTROLLER action, + the controller ID specified in the action. + + - For other packet-in messages, controller ID zero. (This is the + default ID when an OpenFlow controller does not configure one.) + +Finally, Open vSwitch consults a per-connection table indexed by the +message type, reason code, and current role. The following table +shows how this table is initialized by default when an OpenFlow +connection is made. An entry labeled "yes" means that the message is +sent, an entry labeled "---" means that the message is suppressed. + +``` + master/ + message and reason code other slave + ---------------------------------------- ------- ----- + OFPT_PACKET_IN / NXT_PACKET_IN + OFPR_NO_MATCH yes --- + OFPR_ACTION yes --- + OFPR_INVALID_TTL --- --- + OFPR_ACTION_SET (OF1.4+) yes --- + OFPR_GROUP (OF1.4+) yes --- + + OFPT_FLOW_REMOVED / NXT_FLOW_REMOVED + OFPRR_IDLE_TIMEOUT yes --- + OFPRR_HARD_TIMEOUT yes --- + OFPRR_DELETE yes --- + + OFPT_PORT_STATUS + OFPPR_ADD yes yes + OFPPR_DELETE yes yes + OFPPR_MODIFY yes yes +``` + +The NXT_SET_ASYNC_CONFIG message directly sets all of the values in +this table for the current connection. The +OFPC_INVALID_TTL_TO_CONTROLLER bit in the OFPT_SET_CONFIG message +controls the setting for OFPR_INVALID_TTL for the "master" role. + + +OFPAT_ENQUEUE +============= + +The OpenFlow 1.0 specification requires the output port of the OFPAT_ENQUEUE +action to "refer to a valid physical port (i.e. < OFPP_MAX) or OFPP_IN_PORT". +Although OFPP_LOCAL is not less than OFPP_MAX, it is an 'internal' port which +can have QoS applied to it in Linux. Since we allow the OFPAT_ENQUEUE to apply +to 'internal' ports whose port numbers are less than OFPP_MAX, we interpret +OFPP_LOCAL as a physical port and support OFPAT_ENQUEUE on it as well. + + +OFPT_FLOW_MOD +============= + +The OpenFlow specification for the behavior of OFPT_FLOW_MOD is +confusing. The following tables summarize the Open vSwitch +implementation of its behavior in the following categories: + + - "match on priority": Whether the flow_mod acts only on flows + whose priority matches that included in the flow_mod message. + + - "match on out_port": Whether the flow_mod acts only on flows + that output to the out_port included in the flow_mod message (if + out_port is not OFPP_NONE). OpenFlow 1.1 and later have a + similar feature (not listed separately here) for out_group. + + - "match on flow_cookie": Whether the flow_mod acts only on flows + whose flow_cookie matches an optional controller-specified value + and mask. + + - "updates flow_cookie": Whether the flow_mod changes the + flow_cookie of the flow or flows that it matches to the + flow_cookie included in the flow_mod message. + + - "updates OFPFF_ flags": Whether the flow_mod changes the + OFPFF_SEND_FLOW_REM flag of the flow or flows that it matches to + the setting included in the flags of the flow_mod message. + + - "honors OFPFF_CHECK_OVERLAP": Whether the OFPFF_CHECK_OVERLAP + flag in the flow_mod is significant. + + - "updates idle_timeout" and "updates hard_timeout": Whether the + idle_timeout and hard_timeout in the flow_mod, respectively, + have an effect on the flow or flows matched by the flow_mod. + + - "updates idle timer": Whether the flow_mod resets the per-flow + timer that measures how long a flow has been idle. + + - "updates hard timer": Whether the flow_mod resets the per-flow + timer that measures how long it has been since a flow was + modified. + + - "zeros counters": Whether the flow_mod resets per-flow packet + and byte counters to zero. + + - "may add a new flow": Whether the flow_mod may add a new flow to + the flow table. (Obviously this is always true for "add" + commands but in some OpenFlow versions "modify" and + "modify-strict" can also add new flows.) + + - "sends flow_removed message": Whether the flow_mod generates a + flow_removed message for the flow or flows that it affects. + +An entry labeled "yes" means that the flow mod type does have the +indicated behavior, "---" means that it does not, an empty cell means +that the property is not applicable, and other values are explained +below the table. + +OpenFlow 1.0 +------------ + +``` + MODIFY DELETE + ADD MODIFY STRICT DELETE STRICT + === ====== ====== ====== ====== +match on priority yes --- yes --- yes +match on out_port --- --- --- yes yes +match on flow_cookie --- --- --- --- --- +match on table_id --- --- --- --- --- +controller chooses table_id --- --- --- +updates flow_cookie yes yes yes +updates OFPFF_SEND_FLOW_REM yes + + +honors OFPFF_CHECK_OVERLAP yes + + +updates idle_timeout yes + + +updates hard_timeout yes + + +resets idle timer yes + + +resets hard timer yes yes yes +zeros counters yes + + +may add a new flow yes yes yes +sends flow_removed message --- --- --- % % + +(+) "modify" and "modify-strict" only take these actions when they + create a new flow, not when they update an existing flow. + +(%) "delete" and "delete_strict" generates a flow_removed message if + the deleted flow or flows have the OFPFF_SEND_FLOW_REM flag set. + (Each controller can separately control whether it wants to + receive the generated messages.) +``` + +OpenFlow 1.1 +------------ + +OpenFlow 1.1 makes these changes: + + - The controller now must specify the table_id of the flow match + searched and into which a flow may be inserted. Behavior for a + table_id of 255 is undefined. + + - A flow_mod, except an "add", can now match on the flow_cookie. + + - When a flow_mod matches on the flow_cookie, "modify" and + "modify-strict" never insert a new flow. + +``` + MODIFY DELETE + ADD MODIFY STRICT DELETE STRICT + === ====== ====== ====== ====== +match on priority yes --- yes --- yes +match on out_port --- --- --- yes yes +match on flow_cookie --- yes yes yes yes +match on table_id yes yes yes yes yes +controller chooses table_id yes yes yes +updates flow_cookie yes --- --- +updates OFPFF_SEND_FLOW_REM yes + + +honors OFPFF_CHECK_OVERLAP yes + + +updates idle_timeout yes + + +updates hard_timeout yes + + +resets idle timer yes + + +resets hard timer yes yes yes +zeros counters yes + + +may add a new flow yes # # +sends flow_removed message --- --- --- % % + +(+) "modify" and "modify-strict" only take these actions when they + create a new flow, not when they update an existing flow. + +(%) "delete" and "delete_strict" generates a flow_removed message if + the deleted flow or flows have the OFPFF_SEND_FLOW_REM flag set. + (Each controller can separately control whether it wants to + receive the generated messages.) + +(#) "modify" and "modify-strict" only add a new flow if the flow_mod + does not match on any bits of the flow cookie +``` + +OpenFlow 1.2 +------------ + +OpenFlow 1.2 makes these changes: + + - Only "add" commands ever add flows, "modify" and "modify-strict" + never do. + + - A new flag OFPFF_RESET_COUNTS now controls whether "modify" and + "modify-strict" reset counters, whereas previously they never + reset counters (except when they inserted a new flow). + +``` + MODIFY DELETE + ADD MODIFY STRICT DELETE STRICT + === ====== ====== ====== ====== +match on priority yes --- yes --- yes +match on out_port --- --- --- yes yes +match on flow_cookie --- yes yes yes yes +match on table_id yes yes yes yes yes +controller chooses table_id yes yes yes +updates flow_cookie yes --- --- +updates OFPFF_SEND_FLOW_REM yes --- --- +honors OFPFF_CHECK_OVERLAP yes --- --- +updates idle_timeout yes --- --- +updates hard_timeout yes --- --- +resets idle timer yes --- --- +resets hard timer yes yes yes +zeros counters yes & & +may add a new flow yes --- --- +sends flow_removed message --- --- --- % % + +(%) "delete" and "delete_strict" generates a flow_removed message if + the deleted flow or flows have the OFPFF_SEND_FLOW_REM flag set. + (Each controller can separately control whether it wants to + receive the generated messages.) + +(&) "modify" and "modify-strict" reset counters if the + OFPFF_RESET_COUNTS flag is specified. +``` + +OpenFlow 1.3 +------------ + +OpenFlow 1.3 makes these changes: + + - Behavior for a table_id of 255 is now defined, for "delete" and + "delete-strict" commands, as meaning to delete from all tables. + A table_id of 255 is now explicitly invalid for other commands. + + - New flags OFPFF_NO_PKT_COUNTS and OFPFF_NO_BYT_COUNTS for "add" + operations. + +The table for 1.3 is the same as the one shown above for 1.2. + + +OpenFlow 1.4 +------------ + +OpenFlow 1.4 adds the "importance" field to flow_mods, but it does not +explicitly specify which kinds of flow_mods set the importance. For +consistency, Open vSwitch uses the same rule for importance as for +idle_timeout and hard_timeout, that is, only an "ADD" flow_mod sets +the importance. (This issue has been filed with the ONF as EXT-496.) + + +OpenFlow 1.4 Bundles +==================== + +Open vSwitch makes all flow table modifications atomically, i.e., any +datapath packet only sees flow table configurations either before or +after any change made by any flow_mod. For example, if a controller +removes all flows with a single OpenFlow "flow_mod", no packet sees an +intermediate version of the OpenFlow pipeline where only some of the +flows have been deleted. + +It should be noted that Open vSwitch caches datapath flows, and that +the cached flows are NOT flushed immediately when a flow table +changes. Instead, the datapath flows are revalidated against the new +flow table as soon as possible, and usually within one second of the +modification. This design amortizes the cost of datapath cache +flushing across multiple flow table changes, and has a significant +performance effect during simultaneous heavy flow table churn and high +traffic load. This means that different cached datapath flows may +have been computed based on a different flow table configurations, but +each of the datapath flows is guaranteed to have been computed over a +coherent view of the flow tables, as described above. + +With OpenFlow 1.4 bundles this atomicity can be extended across an +arbitrary set of flow_mods. Bundles are supported for flow_mod and +port_mod messages only. For flow_mods, both 'atomic' and 'ordered' +bundle flags are trivially supported, as all bundled messages are +executed in the order they were added and all flow table modifications +are now atomic to the datapath. Port mods may not appear in atomic +bundles, as port status modifications are not atomic. + +To support bundles, ovs-ofctl has a '--bundle' option that makes the +flow mod commands ('add-flow', 'add-flows', 'mod-flows', 'del-flows', +and 'replace-flows') use an OpenFlow 1.4 bundle to operate the +modifications as a single atomic transaction. If any of the flow mods +in a transaction fail, none of them are executed. All flow mods in a +bundle appear to datapath lookups simultaneously. + +Furthermore, ovs-ofctl 'add-flow' and 'add-flows' commands now accept +arbitrary flow mods as an input by allowing the flow specification to +start with an explicit 'add', 'modify', 'modify_strict', 'delete', or +'delete_strict' keyword. A missing keyword is treated as 'add', so +this is fully backwards compatible. With the new '--bundle' option +all the flow mods are executed as a single atomic transaction using an +OpenFlow 1.4 bundle. Without the '--bundle' option the flow mods are +executed in order up to the first failing flow_mod, and in case of an +error the earlier successful flow_mods are not rolled back. + + +OFPT_PACKET_IN +============== + +The OpenFlow 1.1 specification for OFPT_PACKET_IN is confusing. The +definition in OF1.1 openflow.h is[*]: + +``` + /* Packet received on port (datapath -> controller). */ + struct ofp_packet_in { + struct ofp_header header; + uint32_t buffer_id; /* ID assigned by datapath. */ + uint32_t in_port; /* Port on which frame was received. */ + uint32_t in_phy_port; /* Physical Port on which frame was received. */ + uint16_t total_len; /* Full length of frame. */ + uint8_t reason; /* Reason packet is being sent (one of OFPR_*) */ + uint8_t table_id; /* ID of the table that was looked up */ + uint8_t data[0]; /* Ethernet frame, halfway through 32-bit word, + so the IP header is 32-bit aligned. The + amount of data is inferred from the length + field in the header. Because of padding, + offsetof(struct ofp_packet_in, data) == + sizeof(struct ofp_packet_in) - 2. */ + }; + OFP_ASSERT(sizeof(struct ofp_packet_in) == 24); +``` + +The confusing part is the comment on the data[] member. This comment +is a leftover from OF1.0 openflow.h, in which the comment was correct: +sizeof(struct ofp_packet_in) is 20 in OF1.0 and offsetof(struct +ofp_packet_in, data) is 18. When OF1.1 was written, the structure +members were changed but the comment was carelessly not updated, and +the comment became wrong: sizeof(struct ofp_packet_in) and +offsetof(struct ofp_packet_in, data) are both 24 in OF1.1. + +That leaves the question of how to implement ofp_packet_in in OF1.1. +The OpenFlow reference implementation for OF1.1 does not include any +padding, that is, the first byte of the encapsulated frame immediately +follows the 'table_id' member without a gap. Open vSwitch therefore +implements it the same way for compatibility. + +For an earlier discussion, please see the thread archived at: +https://mailman.stanford.edu/pipermail/openflow-discuss/2011-August/002604.html + +[*] The quoted definition is directly from OF1.1. Definitions used + inside OVS omit the 8-byte ofp_header members, so the sizes in + this discussion are 8 bytes larger than those declared in OVS + header files. + + +VLAN Matching +============= + +The 802.1Q VLAN header causes more trouble than any other 4 bytes in +networking. More specifically, three versions of OpenFlow and Open +vSwitch have among them four different ways to match the contents and +presence of the VLAN header. The following table describes how each +version works. + + Match NXM OF1.0 OF1.1 OF1.2 + ----- --------- ----------- ----------- ------------ + [1] 0000/0000 ????/1,??/? ????/1,??/? 0000/0000,-- + [2] 0000/ffff ffff/0,??/? ffff/0,??/? 0000/ffff,-- + [3] 1xxx/1fff 0xxx/0,??/1 0xxx/0,??/1 1xxx/ffff,-- + [4] z000/f000 ????/1,0y/0 fffe/0,0y/0 1000/1000,0y + [5] zxxx/ffff 0xxx/0,0y/0 0xxx/0,0y/0 1xxx/ffff,0y + [6] 0000/0fff + [7] 0000/f000 + [8] 0000/efff + [9] 1001/1001 1001/1001,-- + [10] 3000/3000 + +Each column is interpreted as follows. + + - Match: See the list below. + + - NXM: xxxx/yyyy means NXM_OF_VLAN_TCI_W with value xxxx and mask + yyyy. A mask of 0000 is equivalent to omitting + NXM_OF_VLAN_TCI(_W), a mask of ffff is equivalent to + NXM_OF_VLAN_TCI. + + - OF1.0 and OF1.1: wwww/x,yy/z means dl_vlan wwww, OFPFW_DL_VLAN + x, dl_vlan_pcp yy, and OFPFW_DL_VLAN_PCP z. ? means that the + given nibble is ignored (and conventionally 0 for wwww or yy, + conventionally 1 for x or z). means that the given match + is not supported. + + - OF1.2: xxxx/yyyy,zz means OXM_OF_VLAN_VID_W with value xxxx and + mask yyyy, and OXM_OF_VLAN_PCP (which is not maskable) with + value zz. A mask of 0000 is equivalent to omitting + OXM_OF_VLAN_VID(_W), a mask of ffff is equivalent to + OXM_OF_VLAN_VID. -- means that OXM_OF_VLAN_PCP is omitted. + means that the given match is not supported. + +The matches are: + + [1] Matches any packet, that is, one without an 802.1Q header or with + an 802.1Q header with any TCI value. + + [2] Matches only packets without an 802.1Q header. + + NXM: Any match with (vlan_tci == 0) and (vlan_tci_mask & 0x1000) + != 0 is equivalent to the one listed in the table. + + OF1.0: The spec doesn't define behavior if dl_vlan is set to + 0xffff and OFPFW_DL_VLAN_PCP is not set. + + OF1.1: The spec says explicitly to ignore dl_vlan_pcp when + dl_vlan is set to 0xffff. + + OF1.2: The spec doesn't say what should happen if (vlan_vid == 0) + and (vlan_vid_mask & 0x1000) != 0 but (vlan_vid_mask != 0x1000), + but it would be straightforward to also interpret as [2]. + + [3] Matches only packets that have an 802.1Q header with VID xxx (and + any PCP). + + [4] Matches only packets that have an 802.1Q header with PCP y (and + any VID). + + NXM: z is ((y << 1) | 1). + + OF1.0: The spec isn't very clear, but OVS implements it this way. + + OF1.2: Presumably other masks such that (vlan_vid_mask & 0x1fff) + == 0x1000 would also work, but the spec doesn't define their + behavior. + + [5] Matches only packets that have an 802.1Q header with VID xxx and + PCP y. + + NXM: z is ((y << 1) | 1). + + OF1.2: Presumably other masks such that (vlan_vid_mask & 0x1fff) + == 0x1fff would also work. + + [6] Matches packets with no 802.1Q header or with an 802.1Q header + with a VID of 0. Only possible with NXM. + + [7] Matches packets with no 802.1Q header or with an 802.1Q header + with a PCP of 0. Only possible with NXM. + + [8] Matches packets with no 802.1Q header or with an 802.1Q header + with both VID and PCP of 0. Only possible with NXM. + + [9] Matches only packets that have an 802.1Q header with an + odd-numbered VID (and any PCP). Only possible with NXM and + OF1.2. (This is just an example; one can match on any desired + VID bit pattern.) + +[10] Matches only packets that have an 802.1Q header with an + odd-numbered PCP (and any VID). Only possible with NXM. (This + is just an example; one can match on any desired VID bit + pattern.) + +Additional notes: + + - OF1.2: The top three bits of OXM_OF_VLAN_VID are fixed to zero, + so bits 13, 14, and 15 in the masks listed in the table may be + set to arbitrary values, as long as the corresponding value bits + are also zero. The suggested ffff mask for [2], [3], and [5] + allows a shorter OXM representation (the mask is omitted) than + the minimal 1fff mask. + + +Flow Cookies +============ + +OpenFlow 1.0 and later versions have the concept of a "flow cookie", +which is a 64-bit integer value attached to each flow. The treatment +of the flow cookie has varied greatly across OpenFlow versions, +however. + +In OpenFlow 1.0: + + - OFPFC_ADD set the cookie in the flow that it added. + + - OFPFC_MODIFY and OFPFC_MODIFY_STRICT updated the cookie for + the flow or flows that it modified. + + - OFPST_FLOW messages included the flow cookie. + + - OFPT_FLOW_REMOVED messages reported the cookie of the flow + that was removed. + +OpenFlow 1.1 made the following changes: + + - Flow mod operations OFPFC_MODIFY, OFPFC_MODIFY_STRICT, + OFPFC_DELETE, and OFPFC_DELETE_STRICT, plus flow stats + requests and aggregate stats requests, gained the ability to + match on flow cookies with an arbitrary mask. + + - OFPFC_MODIFY and OFPFC_MODIFY_STRICT were changed to add a + new flow, in the case of no match, only if the flow table + modification operation did not match on the cookie field. + (In OpenFlow 1.0, modify operations always added a new flow + when there was no match.) + + - OFPFC_MODIFY and OFPFC_MODIFY_STRICT no longer updated flow + cookies. + +OpenFlow 1.2 made the following changes: + + - OFPC_MODIFY and OFPFC_MODIFY_STRICT were changed to never + add a new flow, regardless of whether the flow cookie was + used for matching. + +Open vSwitch support for OpenFlow 1.0 implements the OpenFlow 1.0 +behavior with the following extensions: + + - An NXM extension field NXM_NX_COOKIE(_W) allows the NXM + versions of OFPFC_MODIFY, OFPFC_MODIFY_STRICT, OFPFC_DELETE, + and OFPFC_DELETE_STRICT flow_mods, plus flow stats requests + and aggregate stats requests, to match on flow cookies with + arbitrary masks. This is much like the equivalent OpenFlow + 1.1 feature. + + - Like OpenFlow 1.1, OFPC_MODIFY and OFPFC_MODIFY_STRICT add a + new flow if there is no match and the mask is zero (or not + given). + + - The "cookie" field in OFPT_FLOW_MOD and NXT_FLOW_MOD messages + is used as the cookie value for OFPFC_ADD commands, as + described in OpenFlow 1.0. For OFPFC_MODIFY and + OFPFC_MODIFY_STRICT commands, the "cookie" field is used as a + new cookie for flows that match unless it is UINT64_MAX, in + which case the flow's cookie is not updated. + + - NXT_PACKET_IN (the Nicira extended version of + OFPT_PACKET_IN) reports the cookie of the rule that + generated the packet, or all-1-bits if no rule generated the + packet. (Older versions of OVS used all-0-bits instead of + all-1-bits.) + +The following table shows the handling of different protocols when +receiving OFPFC_MODIFY and OFPFC_MODIFY_STRICT messages. A mask of 0 +indicates either an explicit mask of zero or an implicit one by not +specifying the NXM_NX_COOKIE(_W) field. + +``` + Match Update Add on miss Add on miss + cookie cookie mask!=0 mask==0 + ====== ====== =========== =========== +OpenFlow 1.0 no yes +OpenFlow 1.1 yes no no yes +OpenFlow 1.2 yes no no no +NXM yes yes* no yes + +* Updates the flow's cookie unless the "cookie" field is UINT64_MAX. +``` + +Multiple Table Support +====================== + +OpenFlow 1.0 has only rudimentary support for multiple flow tables. +Notably, OpenFlow 1.0 does not allow the controller to specify the +flow table to which a flow is to be added. Open vSwitch adds an +extension for this purpose, which is enabled on a per-OpenFlow +connection basis using the NXT_FLOW_MOD_TABLE_ID message. When the +extension is enabled, the upper 8 bits of the 'command' member in an +OFPT_FLOW_MOD or NXT_FLOW_MOD message designates the table to which a +flow is to be added. + +The Open vSwitch software switch implementation offers 255 flow +tables. On packet ingress, only the first flow table (table 0) is +searched, and the contents of the remaining tables are not considered +in any way. Tables other than table 0 only come into play when an +NXAST_RESUBMIT_TABLE action specifies another table to search. + +Tables 128 and above are reserved for use by the switch itself. +Controllers should use only tables 0 through 127. + + +IPv6 +==== + +Open vSwitch supports stateless handling of IPv6 packets. Flows can be +written to support matching TCP, UDP, and ICMPv6 headers within an IPv6 +packet. Deeper matching of some Neighbor Discovery messages is also +supported. + +IPv6 was not designed to interact well with middle-boxes. This, +combined with Open vSwitch's stateless nature, have affected the +processing of IPv6 traffic, which is detailed below. + +Extension Headers +----------------- + +The base IPv6 header is incredibly simple with the intention of only +containing information relevant for routing packets between two +endpoints. IPv6 relies heavily on the use of extension headers to +provide any other functionality. Unfortunately, the extension headers +were designed in such a way that it is impossible to move to the next +header (including the layer-4 payload) unless the current header is +understood. + +Open vSwitch will process the following extension headers and continue +to the next header: + + * Fragment (see the next section) + * AH (Authentication Header) + * Hop-by-Hop Options + * Routing + * Destination Options + +When a header is encountered that is not in that list, it is considered +"terminal". A terminal header's IPv6 protocol value is stored in +"nw_proto" for matching purposes. If a terminal header is TCP, UDP, or +ICMPv6, the packet will be further processed in an attempt to extract +layer-4 information. + +Fragments +--------- + +IPv6 requires that every link in the internet have an MTU of 1280 octets +or greater (RFC 2460). As such, a terminal header (as described above in +"Extension Headers") in the first fragment should generally be +reachable. In this case, the terminal header's IPv6 protocol type is +stored in the "nw_proto" field for matching purposes. If a terminal +header cannot be found in the first fragment (one with a fragment offset +of zero), the "nw_proto" field is set to 0. Subsequent fragments (those +with a non-zero fragment offset) have the "nw_proto" field set to the +IPv6 protocol type for fragments (44). + +Jumbograms +---------- + +An IPv6 jumbogram (RFC 2675) is a packet containing a payload longer +than 65,535 octets. A jumbogram is only relevant in subnets with a link +MTU greater than 65,575 octets, and are not required to be supported on +nodes that do not connect to link with such large MTUs. Currently, Open +vSwitch doesn't process jumbograms. + + +In-Band Control +=============== + +Motivation +---------- + +An OpenFlow switch must establish and maintain a TCP network +connection to its controller. There are two basic ways to categorize +the network that this connection traverses: either it is completely +separate from the one that the switch is otherwise controlling, or its +path may overlap the network that the switch controls. We call the +former case "out-of-band control", the latter case "in-band control". + +Out-of-band control has the following benefits: + + - Simplicity: Out-of-band control slightly simplifies the switch + implementation. + + - Reliability: Excessive switch traffic volume cannot interfere + with control traffic. + + - Integrity: Machines not on the control network cannot + impersonate a switch or a controller. + + - Confidentiality: Machines not on the control network cannot + snoop on control traffic. + +In-band control, on the other hand, has the following advantages: + + - No dedicated port: There is no need to dedicate a physical + switch port to control, which is important on switches that have + few ports (e.g. wireless routers, low-end embedded platforms). + + - No dedicated network: There is no need to build and maintain a + separate control network. This is important in many + environments because it reduces proliferation of switches and + wiring. + +Open vSwitch supports both out-of-band and in-band control. This +section describes the principles behind in-band control. See the +description of the Controller table in ovs-vswitchd.conf.db(5) to +configure OVS for in-band control. + +Principles +---------- + +The fundamental principle of in-band control is that an OpenFlow +switch must recognize and switch control traffic without involving the +OpenFlow controller. All the details of implementing in-band control +are special cases of this principle. + +The rationale for this principle is simple. If the switch does not +handle in-band control traffic itself, then it will be caught in a +contradiction: it must contact the controller, but it cannot, because +only the controller can set up the flows that are needed to contact +the controller. + +The following points describe important special cases of this +principle. + + - In-band control must be implemented regardless of whether the + switch is connected. + + It is tempting to implement the in-band control rules only when + the switch is not connected to the controller, using the + reasoning that the controller should have complete control once + it has established a connection with the switch. + + This does not work in practice. Consider the case where the + switch is connected to the controller. Occasionally it can + happen that the controller forgets or otherwise needs to obtain + the MAC address of the switch. To do so, the controller sends a + broadcast ARP request. A switch that implements the in-band + control rules only when it is disconnected will then send an + OFPT_PACKET_IN message up to the controller. The controller will + be unable to respond, because it does not know the MAC address of + the switch. This is a deadlock situation that can only be + resolved by the switch noticing that its connection to the + controller has hung and reconnecting. + + - In-band control must override flows set up by the controller. + + It is reasonable to assume that flows set up by the OpenFlow + controller should take precedence over in-band control, on the + basis that the controller should be in charge of the switch. + + Again, this does not work in practice. Reasonable controller + implementations may set up a "last resort" fallback rule that + wildcards every field and, e.g., sends it up to the controller or + discards it. If a controller does that, then it will isolate + itself from the switch. + + - The switch must recognize all control traffic. + + The fundamental principle of in-band control states, in part, + that a switch must recognize control traffic without involving + the OpenFlow controller. More specifically, the switch must + recognize *all* control traffic. "False negatives", that is, + packets that constitute control traffic but that the switch does + not recognize as control traffic, lead to control traffic storms. + + Consider an OpenFlow switch that only recognizes control packets + sent to or from that switch. Now suppose that two switches of + this type, named A and B, are connected to ports on an Ethernet + hub (not a switch) and that an OpenFlow controller is connected + to a third hub port. In this setup, control traffic sent by + switch A will be seen by switch B, which will send it to the + controller as part of an OFPT_PACKET_IN message. Switch A will + then see the OFPT_PACKET_IN message's packet, re-encapsulate it + in another OFPT_PACKET_IN, and send it to the controller. Switch + B will then see that OFPT_PACKET_IN, and so on in an infinite + loop. + + Incidentally, the consequences of "false positives", where + packets that are not control traffic are nevertheless recognized + as control traffic, are much less severe. The controller will + not be able to control their behavior, but the network will + remain in working order. False positives do constitute a + security problem. + + - The switch should use echo-requests to detect disconnection. + + TCP will notice that a connection has hung, but this can take a + considerable amount of time. For example, with default settings + the Linux kernel TCP implementation will retransmit for between + 13 and 30 minutes, depending on the connection's retransmission + timeout, according to kernel documentation. This is far too long + for a switch to be disconnected, so an OpenFlow switch should + implement its own connection timeout. OpenFlow OFPT_ECHO_REQUEST + messages are the best way to do this, since they test the + OpenFlow connection itself. + +Implementation +-------------- + +This section describes how Open vSwitch implements in-band control. +Correctly implementing in-band control has proven difficult due to its +many subtleties, and has thus gone through many iterations. Please +read through and understand the reasoning behind the chosen rules +before making modifications. + +Open vSwitch implements in-band control as "hidden" flows, that is, +flows that are not visible through OpenFlow, and at a higher priority +than wildcarded flows can be set up through OpenFlow. This is done so +that the OpenFlow controller cannot interfere with them and possibly +break connectivity with its switches. It is possible to see all +flows, including in-band ones, with the ovs-appctl "bridge/dump-flows" +command. + +The Open vSwitch implementation of in-band control can hide traffic to +arbitrary "remotes", where each remote is one TCP port on one IP address. +Currently the remotes are automatically configured as the in-band OpenFlow +controllers plus the OVSDB managers, if any. (The latter is a requirement +because OVSDB managers are responsible for configuring OpenFlow controllers, +so if the manager cannot be reached then OpenFlow cannot be reconfigured.) + +The following rules (with the OFPP_NORMAL action) are set up on any bridge +that has any remotes: + + (a) DHCP requests sent from the local port. + (b) ARP replies to the local port's MAC address. + (c) ARP requests from the local port's MAC address. + +In-band also sets up the following rules for each unique next-hop MAC +address for the remotes' IPs (the "next hop" is either the remote +itself, if it is on a local subnet, or the gateway to reach the remote): + + (d) ARP replies to the next hop's MAC address. + (e) ARP requests from the next hop's MAC address. + +In-band also sets up the following rules for each unique remote IP address: + + (f) ARP replies containing the remote's IP address as a target. + (g) ARP requests containing the remote's IP address as a source. + +In-band also sets up the following rules for each unique remote (IP,port) +pair: + + (h) TCP traffic to the remote's IP and port. + (i) TCP traffic from the remote's IP and port. + +The goal of these rules is to be as narrow as possible to allow a +switch to join a network and be able to communicate with the +remotes. As mentioned earlier, these rules have higher priority +than the controller's rules, so if they are too broad, they may +prevent the controller from implementing its policy. As such, +in-band actively monitors some aspects of flow and packet processing +so that the rules can be made more precise. + +In-band control monitors attempts to add flows into the datapath that +could interfere with its duties. The datapath only allows exact +match entries, so in-band control is able to be very precise about +the flows it prevents. Flows that miss in the datapath are sent to +userspace to be processed, so preventing these flows from being +cached in the "fast path" does not affect correctness. The only type +of flow that is currently prevented is one that would prevent DHCP +replies from being seen by the local port. For example, a rule that +forwarded all DHCP traffic to the controller would not be allowed, +but one that forwarded to all ports (including the local port) would. + +As mentioned earlier, packets that miss in the datapath are sent to +the userspace for processing. The userspace has its own flow table, +the "classifier", so in-band checks whether any special processing +is needed before the classifier is consulted. If a packet is a DHCP +response to a request from the local port, the packet is forwarded to +the local port, regardless of the flow table. Note that this requires +L7 processing of DHCP replies to determine whether the 'chaddr' field +matches the MAC address of the local port. + +It is interesting to note that for an L3-based in-band control +mechanism, the majority of rules are devoted to ARP traffic. At first +glance, some of these rules appear redundant. However, each serves an +important role. First, in order to determine the MAC address of the +remote side (controller or gateway) for other ARP rules, we must allow +ARP traffic for our local port with rules (b) and (c). If we are +between a switch and its connection to the remote, we have to +allow the other switch's ARP traffic to through. This is done with +rules (d) and (e), since we do not know the addresses of the other +switches a priori, but do know the remote's or gateway's. Finally, +if the remote is running in a local guest VM that is not reached +through the local port, the switch that is connected to the VM must +allow ARP traffic based on the remote's IP address, since it will +not know the MAC address of the local port that is sending the traffic +or the MAC address of the remote in the guest VM. + +With a few notable exceptions below, in-band should work in most +network setups. The following are considered "supported" in the +current implementation: + + - Locally Connected. The switch and remote are on the same + subnet. This uses rules (a), (b), (c), (h), and (i). + + - Reached through Gateway. The switch and remote are on + different subnets and must go through a gateway. This uses + rules (a), (b), (c), (h), and (i). + + - Between Switch and Remote. This switch is between another + switch and the remote, and we want to allow the other + switch's traffic through. This uses rules (d), (e), (h), and + (i). It uses (b) and (c) indirectly in order to know the MAC + address for rules (d) and (e). Note that DHCP for the other + switch will not work unless an OpenFlow controller explicitly lets this + switch pass the traffic. + + - Between Switch and Gateway. This switch is between another + switch and the gateway, and we want to allow the other switch's + traffic through. This uses the same rules and logic as the + "Between Switch and Remote" configuration described earlier. + + - Remote on Local VM. The remote is a guest VM on the + system running in-band control. This uses rules (a), (b), (c), + (h), and (i). + + - Remote on Local VM with Different Networks. The remote + is a guest VM on the system running in-band control, but the + local port is not used to connect to the remote. For + example, an IP address is configured on eth0 of the switch. The + remote's VM is connected through eth1 of the switch, but an + IP address has not been configured for that port on the switch. + As such, the switch will use eth0 to connect to the remote, + and eth1's rules about the local port will not work. In the + example, the switch attached to eth0 would use rules (a), (b), + (c), (h), and (i) on eth0. The switch attached to eth1 would use + rules (f), (g), (h), and (i). + +The following are explicitly *not* supported by in-band control: + + - Specify Remote by Name. Currently, the remote must be + identified by IP address. A naive approach would be to permit + all DNS traffic. Unfortunately, this would prevent the + controller from defining any policy over DNS. Since switches + that are located behind us need to connect to the remote, + in-band cannot simply add a rule that allows DNS traffic from + the local port. The "correct" way to support this is to parse + DNS requests to allow all traffic related to a request for the + remote's name through. Due to the potential security + problems and amount of processing, we decided to hold off for + the time-being. + + - Differing Remotes for Switches. All switches must know + the L3 addresses for all the remotes that other switches + may use, since rules need to be set up to allow traffic related + to those remotes through. See rules (f), (g), (h), and (i). + + - Differing Routes for Switches. In order for the switch to + allow other switches to connect to a remote through a + gateway, it allows the gateway's traffic through with rules (d) + and (e). If the routes to the remote differ for the two + switches, we will not know the MAC address of the alternate + gateway. + + +Action Reproduction +=================== + +It seems likely that many controllers, at least at startup, use the +OpenFlow "flow statistics" request to obtain existing flows, then +compare the flows' actions against the actions that they expect to +find. Before version 1.8.0, Open vSwitch always returned exact, +byte-for-byte copies of the actions that had been added to the flow +table. The current version of Open vSwitch does not always do this in +some exceptional cases. This section lists the exceptions that +controller authors must keep in mind if they compare actual actions +against desired actions in a bytewise fashion: + + - Open vSwitch zeros padding bytes in action structures, + regardless of their values when the flows were added. + + - Open vSwitch "normalizes" the instructions in OpenFlow 1.1 + (and later) in the following way: + + * OVS sorts the instructions into the following order: + Apply-Actions, Clear-Actions, Write-Actions, + Write-Metadata, Goto-Table. + + * OVS drops Apply-Actions instructions that have empty + action lists. + + * OVS drops Write-Actions instructions that have empty + action sets. + +Please report other discrepancies, if you notice any, so that we can +fix or document them. + + +Suggestions +=========== + +Suggestions to improve Open vSwitch are welcome at discuss@openvswitch.org. diff -Nru openvswitch-2.3.1/Documentation/automake.mk openvswitch-2.4.0~git20150623/Documentation/automake.mk --- openvswitch-2.3.1/Documentation/automake.mk 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/Documentation/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2 @@ +EXTRA_DIST += \ + Documentation/group-selection-method-property.txt diff -Nru openvswitch-2.3.1/Documentation/group-selection-method-property.txt openvswitch-2.4.0~git20150623/Documentation/group-selection-method-property.txt --- openvswitch-2.3.1/Documentation/group-selection-method-property.txt 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/Documentation/group-selection-method-property.txt 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,153 @@ +Proposal for Group Selection Method Property +Version: 0.0.3 + +Author: Simon Horman , et al. +Initial Public Revision: September 2014 + + +Contents +======== + +1. Introduction +2. How it Works +3. Experimenter Id +4. Experimenter Messages +5. History + + +1. Introduction +=============== + +This text describes a Netronome Extension to (draft) OpenFlow 1.5 that allows a +controller to provide more information on the selection method for select +groups. This proposal is in the form of an enhanced select group type. + +This may subsequently be proposed as an extension or update to +the OpenFlow specification. + + +2. How it works +=============== + +A new Netronome group experimenter property is defined which provides +compatibility with the group mod message defined in draft Open Flow 1.5 +(also known as ONF EXT-350) and allows parameters for the selection +method of select groups to be passed by the controller. In particular it +allows controllers to: + +* Specify the fields used for bucket selection by the select group. + +* Designate the selection method used. + +* Provide a non-field parameter to the selection method. + + +3. Experimenter ID +================== + +The Experimenter ID of this extension is: + +NTR_VENDOR_ID = 0x00001540 + + +4. Group Experimenter Property +============================== + +The following group property experimenter type defined by this extension. + +enum ntr_group_mod_subtype { + NTRT_SELECTION_METHOD = 1, +}; + + +Modifications to the group table from the controller may be done with a +OFPT_GROUP_MOD message described (draft) Open Flow 1.5. Group Entry +Message. Of relevance here is that (draft) Open Flow 1.5 group messages +have properties. + +This proposal is defined in terms of an implementation of struct +ofp_group_prop_experimenter which is described in (draft) Open Flow 1.5. +The implementation is: + +struct ntr_group_prop_selection_method { + ovs_be16 type; /* OFPGPT_EXPERIMENTER. */ + ovs_be16 length; /* Length in bytes of this property. */ + ovs_be32 experimenter; /* NTR_VENDOR_ID. */ + ovs_be32 exp_type; /* NTRT_SELECTION_METHOD. */ + ovs_be32 pad; + char selection_method[NTR_MAX_SELECTION_METHOD_LEN]; + /* Null-terminated */ + ovs_be64 selection_method_param; /* Non-Field parameter for + * bucket selection. */ + + /* Followed by: + * - Exactly (length - 40) (possibly 0) bytes containing OXM TLVs, then + * - Exactly ((length + 7)/8*8 - length) (between 0 and 7) bytes of + * all-zero bytes + * In summary, ntr_group_prop_selection_method is padded as needed, + * to make its overall size a multiple of 8, to preserve alignment + * in structures using it. + */ + /* uint8_t field_array[0]; */ /* Zero or more fields encoded as + * OXM TLVs where the has_mask bit must + * be zero and the value it specifies is + * a mask to apply to packet fields and + * then input them to the selection + * method of a select group. */ + /* uint8_t pad2[0]; */ +}; +OFP_ASSERT(sizeof(struct ntr_group_mod) == 40); + + +This property may only be used with group mod messages whose: +* command is OFPGC_ADD or OFPGC_MODIFY; and +* type is OFPGT_SELECT + + +The type field is the OFPGPT_EXPERIMENTER which is +defined in EXT-350 as 0xffff. + + +The experimenter field is the Experimenter ID (see 3). + + +The exp_type field is NTRT_SELECTION_METHOD. + + +The group selection_method is a null-terminated string which if non-zero +length specifies a selection method known to an underlying layer of the +switch. The value of NTR_MAX_SELECTION_METHOD_LEN is 16. + +The group selection_method may be zero-length to request compatibility with +Open Flow 1.4. + + +The selection_method_param provides a non-field parameter for +the group selection_method. It must be all-zeros unless the +group selection_method is non-zero length. + +The selection_method_param may for example be used as an initial value for +the hash of a hash group selection method. + + +The fields field is an ofp_match structure which includes the fields which +should be used as inputs to bucket selection. ofp_match is described in +Open Flow 1.4 section 7.2.2 Flow Match Structures. + +Fields must not be specified unless the group selection_method is non-zero +length. + +The pre-requisites for fields specified must be satisfied in the match for +any flow that uses the group. + +Masking is allowed but not required for fields whose TLVs allow masking. + +The fields may for example be used as the fields that are hashed +by a hash group selection method. + + +5. History +========== + +This proposal has been developed independently of any similar work in this +area. No such work is known. diff -Nru openvswitch-2.3.1/FAQ openvswitch-2.4.0~git20150623/FAQ --- openvswitch-2.3.1/FAQ 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/FAQ 1970-01-01 00:00:00.000000000 +0000 @@ -1,1582 +0,0 @@ - Open vSwitch - -Frequently Asked Questions -========================== - -General -------- - -Q: What is Open vSwitch? - -A: Open vSwitch is a production quality open source software switch - designed to be used as a vswitch in virtualized server - environments. A vswitch forwards traffic between different VMs on - the same physical host and also forwards traffic between VMs and - the physical network. Open vSwitch supports standard management - interfaces (e.g. sFlow, NetFlow, IPFIX, RSPAN, CLI), and is open to - programmatic extension and control using OpenFlow and the OVSDB - management protocol. - - Open vSwitch as designed to be compatible with modern switching - chipsets. This means that it can be ported to existing high-fanout - switches allowing the same flexible control of the physical - infrastructure as the virtual infrastructure. It also means that - Open vSwitch will be able to take advantage of on-NIC switching - chipsets as their functionality matures. - -Q: What virtualization platforms can use Open vSwitch? - -A: Open vSwitch can currently run on any Linux-based virtualization - platform (kernel 2.6.32 and newer), including: KVM, VirtualBox, Xen, - Xen Cloud Platform, XenServer. As of Linux 3.3 it is part of the - mainline kernel. The bulk of the code is written in platform- - independent C and is easily ported to other environments. We welcome - inquires about integrating Open vSwitch with other virtualization - platforms. - -Q: How can I try Open vSwitch? - -A: The Open vSwitch source code can be built on a Linux system. You can - build and experiment with Open vSwitch on any Linux machine. - Packages for various Linux distributions are available on many - platforms, including: Debian, Ubuntu, Fedora. - - You may also download and run a virtualization platform that already - has Open vSwitch integrated. For example, download a recent ISO for - XenServer or Xen Cloud Platform. Be aware that the version - integrated with a particular platform may not be the most recent Open - vSwitch release. - -Q: Does Open vSwitch only work on Linux? - -A: No, Open vSwitch has been ported to a number of different operating - systems and hardware platforms. Most of the development work occurs - on Linux, but the code should be portable to any POSIX system. We've - seen Open vSwitch ported to a number of different platforms, - including FreeBSD, Windows, and even non-POSIX embedded systems. - - By definition, the Open vSwitch Linux kernel module only works on - Linux and will provide the highest performance. However, a userspace - datapath is available that should be very portable. - -Q: What's involved with porting Open vSwitch to a new platform or - switching ASIC? - -A: The PORTING document describes how one would go about porting Open - vSwitch to a new operating system or hardware platform. - -Q: Why would I use Open vSwitch instead of the Linux bridge? - -A: Open vSwitch is specially designed to make it easier to manage VM - network configuration and monitor state spread across many physical - hosts in dynamic virtualized environments. Please see WHY-OVS for a - more detailed description of how Open vSwitch relates to the Linux - Bridge. - -Q: How is Open vSwitch related to distributed virtual switches like the - VMware vNetwork distributed switch or the Cisco Nexus 1000V? - -A: Distributed vswitch applications (e.g., VMware vNetwork distributed - switch, Cisco Nexus 1000V) provide a centralized way to configure and - monitor the network state of VMs that are spread across many physical - hosts. Open vSwitch is not a distributed vswitch itself, rather it - runs on each physical host and supports remote management in a way - that makes it easier for developers of virtualization/cloud - management platforms to offer distributed vswitch capabilities. - - To aid in distribution, Open vSwitch provides two open protocols that - are specially designed for remote management in virtualized network - environments: OpenFlow, which exposes flow-based forwarding state, - and the OVSDB management protocol, which exposes switch port state. - In addition to the switch implementation itself, Open vSwitch - includes tools (ovs-ofctl, ovs-vsctl) that developers can script and - extend to provide distributed vswitch capabilities that are closely - integrated with their virtualization management platform. - -Q: Why doesn't Open vSwitch support distribution? - -A: Open vSwitch is intended to be a useful component for building - flexible network infrastructure. There are many different approaches - to distribution which balance trade-offs between simplicity, - scalability, hardware compatibility, convergence times, logical - forwarding model, etc. The goal of Open vSwitch is to be able to - support all as a primitive building block rather than choose a - particular point in the distributed design space. - -Q: How can I contribute to the Open vSwitch Community? - -A: You can start by joining the mailing lists and helping to answer - questions. You can also suggest improvements to documentation. If - you have a feature or bug you would like to work on, send a mail to - one of the mailing lists: - - http://openvswitch.org/mlists/ - - -Releases --------- - -Q: What does it mean for an Open vSwitch release to be LTS (long-term - support)? - -A: All official releases have been through a comprehensive testing - process and are suitable for production use. Planned releases will - occur several times a year. If a significant bug is identified in an - LTS release, we will provide an updated release that includes the - fix. Releases that are not LTS may not be fixed and may just be - supplanted by the next major release. The current LTS release is - 1.9.x. - -Q: What Linux kernel versions does each Open vSwitch release work with? - -A: The following table lists the Linux kernel versions against which the - given versions of the Open vSwitch kernel module will successfully - build. The Linux kernel versions are upstream kernel versions, so - Linux kernels modified from the upstream sources may not build in - some cases even if they are based on a supported version. This is - most notably true of Red Hat Enterprise Linux (RHEL) kernels, which - are extensively modified from upstream. - - Open vSwitch Linux kernel - ------------ ------------- - 1.4.x 2.6.18 to 3.2 - 1.5.x 2.6.18 to 3.2 - 1.6.x 2.6.18 to 3.2 - 1.7.x 2.6.18 to 3.3 - 1.8.x 2.6.18 to 3.4 - 1.9.x 2.6.18 to 3.8 - 1.10.x 2.6.18 to 3.8 - 1.11.x 2.6.18 to 3.8 - 2.0.x 2.6.32 to 3.10 - 2.1.x 2.6.32 to 3.11 - 2.2.x 2.6.32 to 3.14 - - Open vSwitch userspace should also work with the Linux kernel module - built into Linux 3.3 and later. - - Open vSwitch userspace is not sensitive to the Linux kernel version. - It should build against almost any kernel, certainly against 2.6.32 - and later. - -Q: I get an error like this when I configure Open vSwitch: - - configure: error: Linux kernel in is version , but - version newer than is not supported (please refer to the - FAQ for advice) - - What should I do? - -A: If there is a newer version of Open vSwitch, consider building that - one, because it may support the kernel that you are building - against. (To find out, consult the table in the previous answer.) - - Otherwise, use the Linux kernel module supplied with the kernel - that you are using. All versions of Open vSwitch userspace are - compatible with all versions of the Open vSwitch kernel module, so - this will also work. See also the following question. - -Q: What features are not available in the Open vSwitch kernel datapath - that ships as part of the upstream Linux kernel? - -A: The kernel module in upstream Linux does not include support for - LISP. Work is in progress to add support for LISP to the upstream - Linux version of the Open vSwitch kernel module. For now, if you - need this feature, use the kernel module from the Open vSwitch - distribution instead of the upstream Linux kernel module. - - Certain features require kernel support to function or to have - reasonable performance. If the ovs-vswitchd log file indicates that - a feature is not supported, consider upgrading to a newer upstream - Linux release or using the kernel module paired with the userspace - distribution. - -Q: What features are not available when using the userspace datapath? - -A: Tunnel virtual ports are not supported, as described in the - previous answer. It is also not possible to use queue-related - actions. On Linux kernels before 2.6.39, maximum-sized VLAN packets - may not be transmitted. - -Q: What Linux kernel versions does IPFIX flow monitoring work with? - -A: IPFIX flow monitoring requires the Linux kernel module from Open - vSwitch version 1.10.90 or later. - -Q: Should userspace or kernel be upgraded first to minimize downtime? - - In general, the Open vSwitch userspace should be used with the - kernel version included in the same release or with the version - from upstream Linux. However, when upgrading between two releases - of Open vSwitch it is best to migrate userspace first to reduce - the possibility of incompatibilities. - -Q: What happened to the bridge compatibility feature? - -A: Bridge compatibility was a feature of Open vSwitch 1.9 and earlier. - When it was enabled, Open vSwitch imitated the interface of the - Linux kernel "bridge" module. This allowed users to drop Open - vSwitch into environments designed to use the Linux kernel bridge - module without adapting the environment to use Open vSwitch. - - Open vSwitch 1.10 and later do not support bridge compatibility. - The feature was dropped because version 1.10 adopted a new internal - architecture that made bridge compatibility difficult to maintain. - Now that many environments use OVS directly, it would be rarely - useful in any case. - - To use bridge compatibility, install OVS 1.9 or earlier, including - the accompanying kernel modules (both the main and bridge - compatibility modules), following the instructions that come with - the release. Be sure to start the ovs-brcompatd daemon. - - -Terminology ------------ - -Q: I thought Open vSwitch was a virtual Ethernet switch, but the - documentation keeps talking about bridges. What's a bridge? - -A: In networking, the terms "bridge" and "switch" are synonyms. Open - vSwitch implements an Ethernet switch, which means that it is also - an Ethernet bridge. - -Q: What's a VLAN? - -A: See the "VLAN" section below. - - -Basic Configuration -------------------- - -Q: How do I configure a port as an access port? - -A: Add "tag=VLAN" to your "ovs-vsctl add-port" command. For example, - the following commands configure br0 with eth0 as a trunk port (the - default) and tap0 as an access port for VLAN 9: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 tag=9 - - If you want to configure an already added port as an access port, - use "ovs-vsctl set", e.g.: - - ovs-vsctl set port tap0 tag=9 - -Q: How do I configure a port as a SPAN port, that is, enable mirroring - of all traffic to that port? - -A: The following commands configure br0 with eth0 and tap0 as trunk - ports. All traffic coming in or going out on eth0 or tap0 is also - mirrored to tap1; any traffic arriving on tap1 is dropped: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 - ovs-vsctl add-port br0 tap1 \ - -- --id=@p get port tap1 \ - -- --id=@m create mirror name=m0 select-all=true output-port=@p \ - -- set bridge br0 mirrors=@m - - To later disable mirroring, run: - - ovs-vsctl clear bridge br0 mirrors - -Q: Does Open vSwitch support configuring a port in promiscuous mode? - -A: Yes. How you configure it depends on what you mean by "promiscuous - mode": - - - Conventionally, "promiscuous mode" is a feature of a network - interface card. Ordinarily, a NIC passes to the CPU only the - packets actually destined to its host machine. It discards - the rest to avoid wasting memory and CPU cycles. When - promiscuous mode is enabled, however, it passes every packet - to the CPU. On an old-style shared-media or hub-based - network, this allows the host to spy on all packets on the - network. But in the switched networks that are almost - everywhere these days, promiscuous mode doesn't have much - effect, because few packets not destined to a host are - delivered to the host's NIC. - - This form of promiscuous mode is configured in the guest OS of - the VMs on your bridge, e.g. with "ifconfig". - - - The VMware vSwitch uses a different definition of "promiscuous - mode". When you configure promiscuous mode on a VMware vNIC, - the vSwitch sends a copy of every packet received by the - vSwitch to that vNIC. That has a much bigger effect than just - enabling promiscuous mode in a guest OS. Rather than getting - a few stray packets for which the switch does not yet know the - correct destination, the vNIC gets every packet. The effect - is similar to replacing the vSwitch by a virtual hub. - - This "promiscuous mode" is what switches normally call "port - mirroring" or "SPAN". For information on how to configure - SPAN, see "How do I configure a port as a SPAN port, that is, - enable mirroring of all traffic to that port?" - -Q: How do I configure a VLAN as an RSPAN VLAN, that is, enable - mirroring of all traffic to that VLAN? - -A: The following commands configure br0 with eth0 as a trunk port and - tap0 as an access port for VLAN 10. All traffic coming in or going - out on tap0, as well as traffic coming in or going out on eth0 in - VLAN 10, is also mirrored to VLAN 15 on eth0. The original tag for - VLAN 10, in cases where one is present, is dropped as part of - mirroring: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 tag=10 - ovs-vsctl \ - -- --id=@m create mirror name=m0 select-all=true select-vlan=10 \ - output-vlan=15 \ - -- set bridge br0 mirrors=@m - - To later disable mirroring, run: - - ovs-vsctl clear bridge br0 mirrors - - Mirroring to a VLAN can disrupt a network that contains unmanaged - switches. See ovs-vswitchd.conf.db(5) for details. Mirroring to a - GRE tunnel has fewer caveats than mirroring to a VLAN and should - generally be preferred. - -Q: Can I mirror more than one input VLAN to an RSPAN VLAN? - -A: Yes, but mirroring to a VLAN strips the original VLAN tag in favor - of the specified output-vlan. This loss of information may make - the mirrored traffic too hard to interpret. - - To mirror multiple VLANs, use the commands above, but specify a - comma-separated list of VLANs as the value for select-vlan. To - mirror every VLAN, use the commands above, but omit select-vlan and - its value entirely. - - When a packet arrives on a VLAN that is used as a mirror output - VLAN, the mirror is disregarded. Instead, in standalone mode, OVS - floods the packet across all the ports for which the mirror output - VLAN is configured. (If an OpenFlow controller is in use, then it - can override this behavior through the flow table.) If OVS is used - as an intermediate switch, rather than an edge switch, this ensures - that the RSPAN traffic is distributed through the network. - - Mirroring to a VLAN can disrupt a network that contains unmanaged - switches. See ovs-vswitchd.conf.db(5) for details. Mirroring to a - GRE tunnel has fewer caveats than mirroring to a VLAN and should - generally be preferred. - -Q: How do I configure mirroring of all traffic to a GRE tunnel? - -A: The following commands configure br0 with eth0 and tap0 as trunk - ports. All traffic coming in or going out on eth0 or tap0 is also - mirrored to gre0, a GRE tunnel to the remote host 192.168.1.10; any - traffic arriving on gre0 is dropped: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 - ovs-vsctl add-port br0 gre0 \ - -- set interface gre0 type=gre options:remote_ip=192.168.1.10 \ - -- --id=@p get port gre0 \ - -- --id=@m create mirror name=m0 select-all=true output-port=@p \ - -- set bridge br0 mirrors=@m - - To later disable mirroring and destroy the GRE tunnel: - - ovs-vsctl clear bridge br0 mirrors - ovs-vcstl del-port br0 gre0 - -Q: Does Open vSwitch support ERSPAN? - -A: No. ERSPAN is an undocumented proprietary protocol. As an - alternative, Open vSwitch supports mirroring to a GRE tunnel (see - above). - -Q: How do I connect two bridges? - -A: First, why do you want to do this? Two connected bridges are not - much different from a single bridge, so you might as well just have - a single bridge with all your ports on it. - - If you still want to connect two bridges, you can use a pair of - patch ports. The following example creates bridges br0 and br1, - adds eth0 and tap0 to br0, adds tap1 to br1, and then connects br0 - and br1 with a pair of patch ports. - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 - ovs-vsctl add-br br1 - ovs-vsctl add-port br1 tap1 - ovs-vsctl \ - -- add-port br0 patch0 \ - -- set interface patch0 type=patch options:peer=patch1 \ - -- add-port br1 patch1 \ - -- set interface patch1 type=patch options:peer=patch0 - - Bridges connected with patch ports are much like a single bridge. - For instance, if the example above also added eth1 to br1, and both - eth0 and eth1 happened to be connected to the same next-hop switch, - then you could loop your network just as you would if you added - eth0 and eth1 to the same bridge (see the "Configuration Problems" - section below for more information). - - If you are using Open vSwitch 1.9 or an earlier version, then you - need to be using the kernel module bundled with Open vSwitch rather - than the one that is integrated into Linux 3.3 and later, because - Open vSwitch 1.9 and earlier versions need kernel support for patch - ports. This also means that in Open vSwitch 1.9 and earlier, patch - ports will not work with the userspace datapath, only with the - kernel module. - -Q: How do I configure a bridge without an OpenFlow local port? - (Local port in the sense of OFPP_LOCAL) - -A: Open vSwitch does not support such a configuration. - Bridges always have their local ports. - - -Implementation Details ----------------------- - -Q: I hear OVS has a couple of kinds of flows. Can you tell me about them? - -A: Open vSwitch uses different kinds of flows for different purposes: - - - OpenFlow flows are the most important kind of flow. OpenFlow - controllers use these flows to define a switch's policy. - OpenFlow flows support wildcards, priorities, and multiple - tables. - - When in-band control is in use, Open vSwitch sets up a few - "hidden" flows, with priority higher than a controller or the - user can configure, that are not visible via OpenFlow. (See - the "Controller" section of the FAQ for more information - about hidden flows.) - - - The Open vSwitch software switch implementation uses a second - kind of flow internally. These flows, called "datapath" or - "kernel" flows, do not support priorities and comprise only a - single table, which makes them suitable for caching. (Like - OpenFlow flows, datapath flows do support wildcarding, in Open - vSwitch 1.11 and later.) OpenFlow flows and datapath flows - also support different actions and number ports differently. - - Datapath flows are an implementation detail that is subject to - change in future versions of Open vSwitch. Even with the - current version of Open vSwitch, hardware switch - implementations do not necessarily use this architecture. - - Users and controllers directly control only the OpenFlow flow - table. Open vSwitch manages the datapath flow table itself, so - users should not normally be concerned with it. - -Q: Why are there so many different ways to dump flows? - -A: Open vSwitch has two kinds of flows (see the previous question), so - it has commands with different purposes for dumping each kind of - flow: - - - "ovs-ofctl dump-flows
" dumps OpenFlow flows, excluding - hidden flows. This is the most commonly useful form of flow - dump. (Unlike the other commands, this should work with any - OpenFlow switch, not just Open vSwitch.) - - - "ovs-appctl bridge/dump-flows
" dumps OpenFlow flows, - including hidden flows. This is occasionally useful for - troubleshooting suspected issues with in-band control. - - - "ovs-dpctl dump-flows [dp]" dumps the datapath flow table - entries for a Linux kernel-based datapath. In Open vSwitch - 1.10 and later, ovs-vswitchd merges multiple switches into a - single datapath, so it will show all the flows on all your - kernel-based switches. This command can occasionally be - useful for debugging. - - - "ovs-appctl dpif/dump-flows
", new in Open vSwitch 1.10, - dumps datapath flows for only the specified bridge, regardless - of the type. - - -Performance ------------ - -Q: I just upgraded and I see a performance drop. Why? - -A: The OVS kernel datapath may have been updated to a newer version than - the OVS userspace components. Sometimes new versions of OVS kernel - module add functionality that is backwards compatible with older - userspace components but may cause a drop in performance with them. - Especially, if a kernel module from OVS 2.1 or newer is paired with - OVS userspace 1.10 or older, there will be a performance drop for - TCP traffic. - - Updating the OVS userspace components to the latest released - version should fix the performance degradation. - - To get the best possible performance and functionality, it is - recommended to pair the same versions of the kernel module and OVS - userspace. - - -Configuration Problems ----------------------- - -Q: I created a bridge and added my Ethernet port to it, using commands - like these: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - - and as soon as I ran the "add-port" command I lost all connectivity - through eth0. Help! - -A: A physical Ethernet device that is part of an Open vSwitch bridge - should not have an IP address. If one does, then that IP address - will not be fully functional. - - You can restore functionality by moving the IP address to an Open - vSwitch "internal" device, such as the network device named after - the bridge itself. For example, assuming that eth0's IP address is - 192.168.128.5, you could run the commands below to fix up the - situation: - - ifconfig eth0 0.0.0.0 - ifconfig br0 192.168.128.5 - - (If your only connection to the machine running OVS is through the - IP address in question, then you would want to run all of these - commands on a single command line, or put them into a script.) If - there were any additional routes assigned to eth0, then you would - also want to use commands to adjust these routes to go through br0. - - If you use DHCP to obtain an IP address, then you should kill the - DHCP client that was listening on the physical Ethernet interface - (e.g. eth0) and start one listening on the internal interface - (e.g. br0). You might still need to manually clear the IP address - from the physical interface (e.g. with "ifconfig eth0 0.0.0.0"). - - There is no compelling reason why Open vSwitch must work this way. - However, this is the way that the Linux kernel bridge module has - always worked, so it's a model that those accustomed to Linux - bridging are already used to. Also, the model that most people - expect is not implementable without kernel changes on all the - versions of Linux that Open vSwitch supports. - - By the way, this issue is not specific to physical Ethernet - devices. It applies to all network devices except Open vswitch - "internal" devices. - -Q: I created a bridge and added a couple of Ethernet ports to it, - using commands like these: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 eth1 - - and now my network seems to have melted: connectivity is unreliable - (even connectivity that doesn't go through Open vSwitch), all the - LEDs on my physical switches are blinking, wireshark shows - duplicated packets, and CPU usage is very high. - -A: More than likely, you've looped your network. Probably, eth0 and - eth1 are connected to the same physical Ethernet switch. This - yields a scenario where OVS receives a broadcast packet on eth0 and - sends it out on eth1, then the physical switch connected to eth1 - sends the packet back on eth0, and so on forever. More complicated - scenarios, involving a loop through multiple switches, are possible - too. - - The solution depends on what you are trying to do: - - - If you added eth0 and eth1 to get higher bandwidth or higher - reliability between OVS and your physical Ethernet switch, - use a bond. The following commands create br0 and then add - eth0 and eth1 as a bond: - - ovs-vsctl add-br br0 - ovs-vsctl add-bond br0 bond0 eth0 eth1 - - Bonds have tons of configuration options. Please read the - documentation on the Port table in ovs-vswitchd.conf.db(5) - for all the details. - - - Perhaps you don't actually need eth0 and eth1 to be on the - same bridge. For example, if you simply want to be able to - connect each of them to virtual machines, then you can put - each of them on a bridge of its own: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - - ovs-vsctl add-br br1 - ovs-vsctl add-port br1 eth1 - - and then connect VMs to br0 and br1. (A potential - disadvantage is that traffic cannot directly pass between br0 - and br1. Instead, it will go out eth0 and come back in eth1, - or vice versa.) - - - If you have a redundant or complex network topology and you - want to prevent loops, turn on spanning tree protocol (STP). - The following commands create br0, enable STP, and add eth0 - and eth1 to the bridge. The order is important because you - don't want have to have a loop in your network even - transiently: - - ovs-vsctl add-br br0 - ovs-vsctl set bridge br0 stp_enable=true - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 eth1 - - The Open vSwitch implementation of STP is not well tested. - Please report any bugs you observe, but if you'd rather avoid - acting as a beta tester then another option might be your - best shot. - -Q: I can't seem to use Open vSwitch in a wireless network. - -A: Wireless base stations generally only allow packets with the source - MAC address of NIC that completed the initial handshake. - Therefore, without MAC rewriting, only a single device can - communicate over a single wireless link. - - This isn't specific to Open vSwitch, it's enforced by the access - point, so the same problems will show up with the Linux bridge or - any other way to do bridging. - -Q: I can't seem to add my PPP interface to an Open vSwitch bridge. - -A: PPP most commonly carries IP packets, but Open vSwitch works only - with Ethernet frames. The correct way to interface PPP to an - Ethernet network is usually to use routing instead of switching. - -Q: Is there any documentation on the database tables and fields? - -A: Yes. ovs-vswitchd.conf.db(5) is a comprehensive reference. - -Q: When I run ovs-dpctl I no longer see the bridges I created. Instead, - I only see a datapath called "ovs-system". How can I see datapath - information about a particular bridge? - -A: In version 1.9.0, OVS switched to using a single datapath that is - shared by all bridges of that type. The "ovs-appctl dpif/*" - commands provide similar functionality that is scoped by the bridge. - -Q: I created a GRE port using ovs-vsctl so why can't I send traffic or - see the port in the datapath? - -A: On Linux kernels before 3.11, the OVS GRE module and Linux GRE module - cannot be loaded at the same time. It is likely that on your system the - Linux GRE module is already loaded and blocking OVS (to confirm, check - dmesg for errors regarding GRE registration). To fix this, unload all - GRE modules that appear in lsmod as well as the OVS kernel module. You - can then reload the OVS module following the directions in INSTALL, - which will ensure that dependencies are satisfied. - -Q: Open vSwitch does not seem to obey my packet filter rules. - -A: It depends on mechanisms and configurations you want to use. - - You cannot usefully use typical packet filters, like iptables, on - physical Ethernet ports that you add to an Open vSwitch bridge. - This is because Open vSwitch captures packets from the interface at - a layer lower below where typical packet-filter implementations - install their hooks. (This actually applies to any interface of - type "system" that you might add to an Open vSwitch bridge.) - - You can usefully use typical packet filters on Open vSwitch - internal ports as they are mostly ordinary interfaces from the point - of view of packet filters. - - For example, suppose you create a bridge br0 and add Ethernet port - eth0 to it. Then you can usefully add iptables rules to affect the - internal interface br0, but not the physical interface eth0. (br0 - is also where you would add an IP address, as discussed elsewhere - in the FAQ.) - - For simple filtering rules, it might be possible to achieve similar - results by installing appropriate OpenFlow flows instead. - - If the use of a particular packet filter setup is essential, Open - vSwitch might not be the best choice for you. On Linux, you might - want to consider using the Linux Bridge. (This is the only choice if - you want to use ebtables rules.) On NetBSD, you might want to - consider using the bridge(4) with BRIDGE_IPF option. - - -Quality of Service (QoS) ------------------------- - -Q: How do I configure Quality of Service (QoS)? - -A: Suppose that you want to set up bridge br0 connected to physical - Ethernet port eth0 (a 1 Gbps device) and virtual machine interfaces - vif1.0 and vif2.0, and that you want to limit traffic from vif1.0 - to eth0 to 10 Mbps and from vif2.0 to eth0 to 20 Mbps. Then, you - could configure the bridge this way: - - ovs-vsctl -- \ - add-br br0 -- \ - add-port br0 eth0 -- \ - add-port br0 vif1.0 -- set interface vif1.0 ofport_request=5 -- \ - add-port br0 vif2.0 -- set interface vif2.0 ofport_request=6 -- \ - set port eth0 qos=@newqos -- \ - --id=@newqos create qos type=linux-htb \ - other-config:max-rate=1000000000 \ - queues:123=@vif10queue \ - queues:234=@vif20queue -- \ - --id=@vif10queue create queue other-config:max-rate=10000000 -- \ - --id=@vif20queue create queue other-config:max-rate=20000000 - - At this point, bridge br0 is configured with the ports and eth0 is - configured with the queues that you need for QoS, but nothing is - actually directing packets from vif1.0 or vif2.0 to the queues that - we have set up for them. That means that all of the packets to - eth0 are going to the "default queue", which is not what we want. - - We use OpenFlow to direct packets from vif1.0 and vif2.0 to the - queues reserved for them: - - ovs-ofctl add-flow br0 in_port=5,actions=set_queue:123,normal - ovs-ofctl add-flow br0 in_port=6,actions=set_queue:234,normal - - Each of the above flows matches on the input port, sets up the - appropriate queue (123 for vif1.0, 234 for vif2.0), and then - executes the "normal" action, which performs the same switching - that Open vSwitch would have done without any OpenFlow flows being - present. (We know that vif1.0 and vif2.0 have OpenFlow port - numbers 5 and 6, respectively, because we set their ofport_request - columns above. If we had not done that, then we would have needed - to find out their port numbers before setting up these flows.) - - Now traffic going from vif1.0 or vif2.0 to eth0 should be - rate-limited. - - By the way, if you delete the bridge created by the above commands, - with: - - ovs-vsctl del-br br0 - - then that will leave one unreferenced QoS record and two - unreferenced Queue records in the Open vSwich database. One way to - clear them out, assuming you don't have other QoS or Queue records - that you want to keep, is: - - ovs-vsctl -- --all destroy QoS -- --all destroy Queue - - If you do want to keep some QoS or Queue records, or the Open - vSwitch you are using is older than version 1.8 (which added the - --all option), then you will have to destroy QoS and Queue records - individually. - -Q: I configured Quality of Service (QoS) in my OpenFlow network by - adding records to the QoS and Queue table, but the results aren't - what I expect. - -A: Did you install OpenFlow flows that use your queues? This is the - primary way to tell Open vSwitch which queues you want to use. If - you don't do this, then the default queue will be used, which will - probably not have the effect you want. - - Refer to the previous question for an example. - -Q: I'd like to take advantage of some QoS feature that Open vSwitch - doesn't yet support. How do I do that? - -A: Open vSwitch does not implement QoS itself. Instead, it can - configure some, but not all, of the QoS features built into the - Linux kernel. If you need some QoS feature that OVS cannot - configure itself, then the first step is to figure out whether - Linux QoS supports that feature. If it does, then you can submit a - patch to support Open vSwitch configuration for that feature, or - you can use "tc" directly to configure the feature in Linux. (If - Linux QoS doesn't support the feature you want, then first you have - to add that support to Linux.) - -Q: I configured QoS, correctly, but my measurements show that it isn't - working as well as I expect. - -A: With the Linux kernel, the Open vSwitch implementation of QoS has - two aspects: - - - Open vSwitch configures a subset of Linux kernel QoS - features, according to what is in OVSDB. It is possible that - this code has bugs. If you believe that this is so, then you - can configure the Linux traffic control (QoS) stack directly - with the "tc" program. If you get better results that way, - you can send a detailed bug report to bugs@openvswitch.org. - - It is certain that Open vSwitch cannot configure every Linux - kernel QoS feature. If you need some feature that OVS cannot - configure, then you can also use "tc" directly (or add that - feature to OVS). - - - The Open vSwitch implementation of OpenFlow allows flows to - be directed to particular queues. This is pretty simple and - unlikely to have serious bugs at this point. - - However, most problems with QoS on Linux are not bugs in Open - vSwitch at all. They tend to be either configuration errors - (please see the earlier questions in this section) or issues with - the traffic control (QoS) stack in Linux. The Open vSwitch - developers are not experts on Linux traffic control. We suggest - that, if you believe you are encountering a problem with Linux - traffic control, that you consult the tc manpages (e.g. tc(8), - tc-htb(8), tc-hfsc(8)), web resources (e.g. http://lartc.org/), or - mailing lists (e.g. http://vger.kernel.org/vger-lists.html#netdev). - -Q: Does Open vSwitch support OpenFlow meters? - -A: Since version 2.0, Open vSwitch has OpenFlow protocol support for - OpenFlow meters. There is no implementation of meters in the Open - vSwitch software switch (neither the kernel-based nor userspace - switches). - - -VLANs ------ - -Q: What's a VLAN? - -A: At the simplest level, a VLAN (short for "virtual LAN") is a way to - partition a single switch into multiple switches. Suppose, for - example, that you have two groups of machines, group A and group B. - You want the machines in group A to be able to talk to each other, - and you want the machine in group B to be able to talk to each - other, but you don't want the machines in group A to be able to - talk to the machines in group B. You can do this with two - switches, by plugging the machines in group A into one switch and - the machines in group B into the other switch. - - If you only have one switch, then you can use VLANs to do the same - thing, by configuring the ports for machines in group A as VLAN - "access ports" for one VLAN and the ports for group B as "access - ports" for a different VLAN. The switch will only forward packets - between ports that are assigned to the same VLAN, so this - effectively subdivides your single switch into two independent - switches, one for each group of machines. - - So far we haven't said anything about VLAN headers. With access - ports, like we've described so far, no VLAN header is present in - the Ethernet frame. This means that the machines (or switches) - connected to access ports need not be aware that VLANs are - involved, just like in the case where we use two different physical - switches. - - Now suppose that you have a whole bunch of switches in your - network, instead of just one, and that some machines in group A are - connected directly to both switches 1 and 2. To allow these - machines to talk to each other, you could add an access port for - group A's VLAN to switch 1 and another to switch 2, and then - connect an Ethernet cable between those ports. That works fine, - but it doesn't scale well as the number of switches and the number - of VLANs increases, because you use up a lot of valuable switch - ports just connecting together your VLANs. - - This is where VLAN headers come in. Instead of using one cable and - two ports per VLAN to connect a pair of switches, we configure a - port on each switch as a VLAN "trunk port". Packets sent and - received on a trunk port carry a VLAN header that says what VLAN - the packet belongs to, so that only two ports total are required to - connect the switches, regardless of the number of VLANs in use. - Normally, only switches (either physical or virtual) are connected - to a trunk port, not individual hosts, because individual hosts - don't expect to see a VLAN header in the traffic that they receive. - - None of the above discussion says anything about particular VLAN - numbers. This is because VLAN numbers are completely arbitrary. - One must only ensure that a given VLAN is numbered consistently - throughout a network and that different VLANs are given different - numbers. (That said, VLAN 0 is usually synonymous with a packet - that has no VLAN header, and VLAN 4095 is reserved.) - -Q: VLANs don't work. - -A: Many drivers in Linux kernels before version 3.3 had VLAN-related - bugs. If you are having problems with VLANs that you suspect to be - driver related, then you have several options: - - - Upgrade to Linux 3.3 or later. - - - Build and install a fixed version of the particular driver - that is causing trouble, if one is available. - - - Use a NIC whose driver does not have VLAN problems. - - - Use "VLAN splinters", a feature in Open vSwitch 1.4 and later - that works around bugs in kernel drivers. To enable VLAN - splinters on interface eth0, use the command: - - ovs-vsctl set interface eth0 other-config:enable-vlan-splinters=true - - For VLAN splinters to be effective, Open vSwitch must know - which VLANs are in use. See the "VLAN splinters" section in - the Interface table in ovs-vswitchd.conf.db(5) for details on - how Open vSwitch infers in-use VLANs. - - VLAN splinters increase memory use and reduce performance, so - use them only if needed. - - - Apply the "vlan workaround" patch from the XenServer kernel - patch queue, build Open vSwitch against this patched kernel, - and then use ovs-vlan-bug-workaround(8) to enable the VLAN - workaround for each interface whose driver is buggy. - - (This is a nontrivial exercise, so this option is included - only for completeness.) - - It is not always easy to tell whether a Linux kernel driver has - buggy VLAN support. The ovs-vlan-test(8) and ovs-test(8) utilities - can help you test. See their manpages for details. Of the two - utilities, ovs-test(8) is newer and more thorough, but - ovs-vlan-test(8) may be easier to use. - -Q: VLANs still don't work. I've tested the driver so I know that it's OK. - -A: Do you have VLANs enabled on the physical switch that OVS is - attached to? Make sure that the port is configured to trunk the - VLAN or VLANs that you are using with OVS. - -Q: Outgoing VLAN-tagged traffic goes through OVS to my physical switch - and to its destination host, but OVS seems to drop incoming return - traffic. - -A: It's possible that you have the VLAN configured on your physical - switch as the "native" VLAN. In this mode, the switch treats - incoming packets either tagged with the native VLAN or untagged as - part of the native VLAN. It may also send outgoing packets in the - native VLAN without a VLAN tag. - - If this is the case, you have two choices: - - - Change the physical switch port configuration to tag packets - it forwards to OVS with the native VLAN instead of forwarding - them untagged. - - - Change the OVS configuration for the physical port to a - native VLAN mode. For example, the following sets up a - bridge with port eth0 in "native-tagged" mode in VLAN 9: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 tag=9 vlan_mode=native-tagged - - In this situation, "native-untagged" mode will probably work - equally well. Refer to the documentation for the Port table - in ovs-vswitchd.conf.db(5) for more information. - -Q: I added a pair of VMs on different VLANs, like this: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 tag=9 - ovs-vsctl add-port br0 tap1 tag=10 - - but the VMs can't access each other, the external network, or the - Internet. - -A: It is to be expected that the VMs can't access each other. VLANs - are a means to partition a network. When you configured tap0 and - tap1 as access ports for different VLANs, you indicated that they - should be isolated from each other. - - As for the external network and the Internet, it seems likely that - the machines you are trying to access are not on VLAN 9 (or 10) and - that the Internet is not available on VLAN 9 (or 10). - -Q: I added a pair of VMs on the same VLAN, like this: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 tag=9 - ovs-vsctl add-port br0 tap1 tag=9 - - The VMs can access each other, but not the external network or the - Internet. - -A: It seems likely that the machines you are trying to access in the - external network are not on VLAN 9 and that the Internet is not - available on VLAN 9. Also, ensure VLAN 9 is set up as an allowed - trunk VLAN on the upstream switch port to which eth0 is connected. - -Q: Can I configure an IP address on a VLAN? - -A: Yes. Use an "internal port" configured as an access port. For - example, the following configures IP address 192.168.0.7 on VLAN 9. - That is, OVS will forward packets from eth0 to 192.168.0.7 only if - they have an 802.1Q header with VLAN 9. Conversely, traffic - forwarded from 192.168.0.7 to eth0 will be tagged with an 802.1Q - header with VLAN 9: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 vlan9 tag=9 -- set interface vlan9 type=internal - ifconfig vlan9 192.168.0.7 - - See also the following question. - -Q: I configured one IP address on VLAN 0 and another on VLAN 9, like - this: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 eth0 - ifconfig br0 192.168.0.5 - ovs-vsctl add-port br0 vlan9 tag=9 -- set interface vlan9 type=internal - ifconfig vlan9 192.168.0.9 - - but other hosts that are only on VLAN 0 can reach the IP address - configured on VLAN 9. What's going on? - -A: RFC 1122 section 3.3.4.2 "Multihoming Requirements" describes two - approaches to IP address handling in Internet hosts: - - - In the "Strong ES Model", where an ES is a host ("End - System"), an IP address is primarily associated with a - particular interface. The host discards packets that arrive - on interface A if they are destined for an IP address that is - configured on interface B. The host never sends packets from - interface A using a source address configured on interface B. - - - In the "Weak ES Model", an IP address is primarily associated - with a host. The host accepts packets that arrive on any - interface if they are destined for any of the host's IP - addresses, even if the address is configured on some - interface other than the one on which it arrived. The host - does not restrict itself to sending packets from an IP - address associated with the originating interface. - - Linux uses the weak ES model. That means that when packets - destined to the VLAN 9 IP address arrive on eth0 and are bridged to - br0, the kernel IP stack accepts them there for the VLAN 9 IP - address, even though they were not received on vlan9, the network - device for vlan9. - - To simulate the strong ES model on Linux, one may add iptables rule - to filter packets based on source and destination address and - adjust ARP configuration with sysctls. - - BSD uses the strong ES model. - -Q: My OpenFlow controller doesn't see the VLANs that I expect. - -A: The configuration for VLANs in the Open vSwitch database (e.g. via - ovs-vsctl) only affects traffic that goes through Open vSwitch's - implementation of the OpenFlow "normal switching" action. By - default, when Open vSwitch isn't connected to a controller and - nothing has been manually configured in the flow table, all traffic - goes through the "normal switching" action. But, if you set up - OpenFlow flows on your own, through a controller or using ovs-ofctl - or through other means, then you have to implement VLAN handling - yourself. - - You can use "normal switching" as a component of your OpenFlow - actions, e.g. by putting "normal" into the lists of actions on - ovs-ofctl or by outputting to OFPP_NORMAL from an OpenFlow - controller. In situations where this is not suitable, you can - implement VLAN handling yourself, e.g.: - - - If a packet comes in on an access port, and the flow table - needs to send it out on a trunk port, then the flow can add - the appropriate VLAN tag with the "mod_vlan_vid" action. - - - If a packet comes in on a trunk port, and the flow table - needs to send it out on an access port, then the flow can - strip the VLAN tag with the "strip_vlan" action. - -Q: I configured ports on a bridge as access ports with different VLAN - tags, like this: - - ovs-vsctl add-br br0 - ovs-vsctl set-controller br0 tcp:192.168.0.10:6633 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 tap0 tag=9 - ovs-vsctl add-port br0 tap1 tag=10 - - but the VMs running behind tap0 and tap1 can still communicate, - that is, they are not isolated from each other even though they are - on different VLANs. - -A: Do you have a controller configured on br0 (as the commands above - do)? If so, then this is a variant on the previous question, "My - OpenFlow controller doesn't see the VLANs that I expect," and you - can refer to the answer there for more information. - - -VXLANs ------ - -Q: What's a VXLAN? - -A: VXLAN stands for Virtual eXtensible Local Area Network, and is a means - to solve the scaling challenges of VLAN networks in a multi-tenant - environment. VXLAN is an overlay network which transports an L2 network - over an existing L3 network. For more information on VXLAN, please see - the IETF draft available here: - - http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-03 - -Q: How much of the VXLAN protocol does Open vSwitch currently support? - -A: Open vSwitch currently supports the framing format for packets on the - wire. There is currently no support for the multicast aspects of VXLAN. - To get around the lack of multicast support, it is possible to - pre-provision MAC to IP address mappings either manually or from a - controller. - -Q: What destination UDP port does the VXLAN implementation in Open vSwitch - use? - -A: By default, Open vSwitch will use the assigned IANA port for VXLAN, which - is 4789. However, it is possible to configure the destination UDP port - manually on a per-VXLAN tunnel basis. An example of this configuration is - provided below. - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 vxlan1 -- set interface vxlan1 - type=vxlan options:remote_ip=192.168.1.2 options:key=flow - options:dst_port=8472 - - -Using OpenFlow (Manually or Via Controller) -------------------------------------------- - -Q: What versions of OpenFlow does Open vSwitch support? - -A: The following table lists the versions of OpenFlow supported by - each version of Open vSwitch: - - Open vSwitch OF1.0 OF1.1 OF1.2 OF1.3 OF1.4 OF1.5 - =============== ===== ===== ===== ===== ===== ===== - 1.9 and earlier yes --- --- --- --- --- - 1.10 yes --- [*] [*] --- --- - 1.11 yes --- [*] [*] --- --- - 2.0 yes [*] [*] [*] --- --- - 2.1 yes [*] [*] [*] --- --- - 2.2 yes [*] [*] [*] [%] [*] - 2.3 yes yes yes yes [*] [*] - - [*] Supported, with one or more missing features. - [%] Experimental, unsafe implementation. - - Open vSwitch 2.3 enables OpenFlow 1.0, 1.1, 1.2, and 1.3 by default - in ovs-vswitchd. In Open vSwitch 1.10 through 2.2, OpenFlow 1.1, - 1.2, and 1.3 must be enabled manually in ovs-vswitchd. OpenFlow - 1.4 and 1.5 are also supported, with missing features, in Open - vSwitch 2.3 and later, but not enabled by default. In any case, - the user may override the default: - - - To enable OpenFlow 1.0, 1.1, 1.2, and 1.3 on bridge br0: - - ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 - - - To enable OpenFlow 1.0, 1.1, 1.2, 1.3, 1.4, and 1.5 on bridge br0: - - ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15 - - - To enable only OpenFlow 1.0 on bridge br0: - - ovs-vsctl set bridge br0 protocols=OpenFlow10 - - All current versions of ovs-ofctl enable only OpenFlow 1.0 by - default. Use the -O option to enable support for later versions of - OpenFlow in ovs-ofctl. For example: - - ovs-ofctl -O OpenFlow13 dump-flows br0 - - (Open vSwitch 2.2 had an experimental implementation of OpenFlow - 1.4 that could cause crashes. We don't recommend enabling it.) - - OPENFLOW-1.1+ in the Open vSwitch source tree tracks support for - OpenFlow 1.1 and later features. When support for OpenFlow 1.4 and - 1.5 is solidly implemented, Open vSwitch will enable those version - by default. Also, the OpenFlow 1.5 specification is still under - development and thus subject to change. - -Q: Does Open vSwitch support MPLS? - -A: Before version 1.11, Open vSwitch did not support MPLS. That is, - these versions can match on MPLS Ethernet types, but they cannot - match, push, or pop MPLS labels, nor can they look past MPLS labels - into the encapsulated packet. - - Open vSwitch versions 1.11, 2.0, and 2.1 have very minimal support - for MPLS. With the userspace datapath only, these versions can - match, push, or pop a single MPLS label, but they still cannot look - past MPLS labels (even after popping them) into the encapsulated - packet. Kernel datapath support is unchanged from earlier - versions. - - Open vSwitch version 2.2 will be able to match, push, or pop up to - 3 MPLS labels. Looking past MPLS labels into the encapsulated - packet will still be unsupported. Both userspace and kernel - datapaths will be supported, but MPLS processing always happens in - userspace either way, so kernel datapath performance will be - disappointing. - -Q: I'm getting "error type 45250 code 0". What's that? - -A: This is a Open vSwitch extension to OpenFlow error codes. Open - vSwitch uses this extension when it must report an error to an - OpenFlow controller but no standard OpenFlow error code is - suitable. - - Open vSwitch logs the errors that it sends to controllers, so the - easiest thing to do is probably to look at the ovs-vswitchd log to - find out what the error was. - - If you want to dissect the extended error message yourself, the - format is documented in include/openflow/nicira-ext.h in the Open - vSwitch source distribution. The extended error codes are - documented in lib/ofp-errors.h. - -Q1: Some of the traffic that I'd expect my OpenFlow controller to see - doesn't actually appear through the OpenFlow connection, even - though I know that it's going through. -Q2: Some of the OpenFlow flows that my controller sets up don't seem - to apply to certain traffic, especially traffic between OVS and - the controller itself. - -A: By default, Open vSwitch assumes that OpenFlow controllers are - connected "in-band", that is, that the controllers are actually - part of the network that is being controlled. In in-band mode, - Open vSwitch sets up special "hidden" flows to make sure that - traffic can make it back and forth between OVS and the controllers. - These hidden flows are higher priority than any flows that can be - set up through OpenFlow, and they are not visible through normal - OpenFlow flow table dumps. - - Usually, the hidden flows are desirable and helpful, but - occasionally they can cause unexpected behavior. You can view the - full OpenFlow flow table, including hidden flows, on bridge br0 - with the command: - - ovs-appctl bridge/dump-flows br0 - - to help you debug. The hidden flows are those with priorities - greater than 65535 (the maximum priority that can be set with - OpenFlow). - - The DESIGN file at the top level of the Open vSwitch source - distribution describes the in-band model in detail. - - If your controllers are not actually in-band (e.g. they are on - localhost via 127.0.0.1, or on a separate network), then you should - configure your controllers in "out-of-band" mode. If you have one - controller on bridge br0, then you can configure out-of-band mode - on it with: - - ovs-vsctl set controller br0 connection-mode=out-of-band - -Q: I configured all my controllers for out-of-band control mode but - "ovs-appctl bridge/dump-flows" still shows some hidden flows. - -A: You probably have a remote manager configured (e.g. with "ovs-vsctl - set-manager"). By default, Open vSwitch assumes that managers need - in-band rules set up on every bridge. You can disable these rules - on bridge br0 with: - - ovs-vsctl set bridge br0 other-config:disable-in-band=true - - This actually disables in-band control entirely for the bridge, as - if all the bridge's controllers were configured for out-of-band - control. - -Q: My OpenFlow controller doesn't see the VLANs that I expect. - -A: See answer under "VLANs", above. - -Q: I ran "ovs-ofctl add-flow br0 nw_dst=192.168.0.1,actions=drop" - but I got a funny message like this: - - ofp_util|INFO|normalization changed ofp_match, details: - ofp_util|INFO| pre: nw_dst=192.168.0.1 - ofp_util|INFO|post: - - and when I ran "ovs-ofctl dump-flows br0" I saw that my nw_dst - match had disappeared, so that the flow ends up matching every - packet. - -A: The term "normalization" in the log message means that a flow - cannot match on an L3 field without saying what L3 protocol is in - use. The "ovs-ofctl" command above didn't specify an L3 protocol, - so the L3 field match was dropped. - - In this case, the L3 protocol could be IP or ARP. A correct - command for each possibility is, respectively: - - ovs-ofctl add-flow br0 ip,nw_dst=192.168.0.1,actions=drop - - and - - ovs-ofctl add-flow br0 arp,nw_dst=192.168.0.1,actions=drop - - Similarly, a flow cannot match on an L4 field without saying what - L4 protocol is in use. For example, the flow match "tp_src=1234" - is, by itself, meaningless and will be ignored. Instead, to match - TCP source port 1234, write "tcp,tp_src=1234", or to match UDP - source port 1234, write "udp,tp_src=1234". - -Q: How can I figure out the OpenFlow port number for a given port? - -A: The OFPT_FEATURES_REQUEST message requests an OpenFlow switch to - respond with an OFPT_FEATURES_REPLY that, among other information, - includes a mapping between OpenFlow port names and numbers. From a - command prompt, "ovs-ofctl show br0" makes such a request and - prints the response for switch br0. - - The Interface table in the Open vSwitch database also maps OpenFlow - port names to numbers. To print the OpenFlow port number - associated with interface eth0, run: - - ovs-vsctl get Interface eth0 ofport - - You can print the entire mapping with: - - ovs-vsctl -- --columns=name,ofport list Interface - - but the output mixes together interfaces from all bridges in the - database, so it may be confusing if more than one bridge exists. - - In the Open vSwitch database, ofport value -1 means that the - interface could not be created due to an error. (The Open vSwitch - log should indicate the reason.) ofport value [] (the empty set) - means that the interface hasn't been created yet. The latter is - normally an intermittent condition (unless ovs-vswitchd is not - running). - -Q: I added some flows with my controller or with ovs-ofctl, but when I - run "ovs-dpctl dump-flows" I don't see them. - -A: ovs-dpctl queries a kernel datapath, not an OpenFlow switch. It - won't display the information that you want. You want to use - "ovs-ofctl dump-flows" instead. - -Q: It looks like each of the interfaces in my bonded port shows up - as an individual OpenFlow port. Is that right? - -A: Yes, Open vSwitch makes individual bond interfaces visible as - OpenFlow ports, rather than the bond as a whole. The interfaces - are treated together as a bond for only a few purposes: - - - Sending a packet to the OFPP_NORMAL port. (When an OpenFlow - controller is not configured, this happens implicitly to - every packet.) - - - Mirrors configured for output to a bonded port. - - It would make a lot of sense for Open vSwitch to present a bond as - a single OpenFlow port. If you want to contribute an - implementation of such a feature, please bring it up on the Open - vSwitch development mailing list at dev@openvswitch.org. - -Q: I have a sophisticated network setup involving Open vSwitch, VMs or - multiple hosts, and other components. The behavior isn't what I - expect. Help! - -A: To debug network behavior problems, trace the path of a packet, - hop-by-hop, from its origin in one host to a remote host. If - that's correct, then trace the path of the response packet back to - the origin. - - Usually a simple ICMP echo request and reply ("ping") packet is - good enough. Start by initiating an ongoing "ping" from the origin - host to a remote host. If you are tracking down a connectivity - problem, the "ping" will not display any successful output, but - packets are still being sent. (In this case the packets being sent - are likely ARP rather than ICMP.) - - Tools available for tracing include the following: - - - "tcpdump" and "wireshark" for observing hops across network - devices, such as Open vSwitch internal devices and physical - wires. - - - "ovs-appctl dpif/dump-flows
" in Open vSwitch 1.10 and - later or "ovs-dpctl dump-flows
" in earlier versions. - These tools allow one to observe the actions being taken on - packets in ongoing flows. - - See ovs-vswitchd(8) for "ovs-appctl dpif/dump-flows" - documentation, ovs-dpctl(8) for "ovs-dpctl dump-flows" - documentation, and "Why are there so many different ways to - dump flows?" above for some background. - - - "ovs-appctl ofproto/trace" to observe the logic behind how - ovs-vswitchd treats packets. See ovs-vswitchd(8) for - documentation. You can out more details about a given flow - that "ovs-dpctl dump-flows" displays, by cutting and pasting - a flow from the output into an "ovs-appctl ofproto/trace" - command. - - - SPAN, RSPAN, and ERSPAN features of physical switches, to - observe what goes on at these physical hops. - - Starting at the origin of a given packet, observe the packet at - each hop in turn. For example, in one plausible scenario, you - might: - - 1. "tcpdump" the "eth" interface through which an ARP egresses - a VM, from inside the VM. - - 2. "tcpdump" the "vif" or "tap" interface through which the ARP - ingresses the host machine. - - 3. Use "ovs-dpctl dump-flows" to spot the ARP flow and observe - the host interface through which the ARP egresses the - physical machine. You may need to use "ovs-dpctl show" to - interpret the port numbers. If the output seems surprising, - you can use "ovs-appctl ofproto/trace" to observe details of - how ovs-vswitchd determined the actions in the "ovs-dpctl - dump-flows" output. - - 4. "tcpdump" the "eth" interface through which the ARP egresses - the physical machine. - - 5. "tcpdump" the "eth" interface through which the ARP - ingresses the physical machine, at the remote host that - receives the ARP. - - 6. Use "ovs-dpctl dump-flows" to spot the ARP flow on the - remote host that receives the ARP and observe the VM "vif" - or "tap" interface to which the flow is directed. Again, - "ovs-dpctl show" and "ovs-appctl ofproto/trace" might help. - - 7. "tcpdump" the "vif" or "tap" interface to which the ARP is - directed. - - 8. "tcpdump" the "eth" interface through which the ARP - ingresses a VM, from inside the VM. - - It is likely that during one of these steps you will figure out the - problem. If not, then follow the ARP reply back to the origin, in - reverse. - -Q: How do I make a flow drop packets? - -A: To drop a packet is to receive it without forwarding it. OpenFlow - explicitly specifies forwarding actions. Thus, a flow with an - empty set of actions does not forward packets anywhere, causing - them to be dropped. You can specify an empty set of actions with - "actions=" on the ovs-ofctl command line. For example: - - ovs-ofctl add-flow br0 priority=65535,actions= - - would cause every packet entering switch br0 to be dropped. - - You can write "drop" explicitly if you like. The effect is the - same. Thus, the following command also causes every packet - entering switch br0 to be dropped: - - ovs-ofctl add-flow br0 priority=65535,actions=drop - - "drop" is not an action, either in OpenFlow or Open vSwitch. - Rather, it is only a way to say that there are no actions. - -Q: I added a flow to send packets out the ingress port, like this: - - ovs-ofctl add-flow br0 in_port=2,actions=2 - - but OVS drops the packets instead. - -A: Yes, OpenFlow requires a switch to ignore attempts to send a packet - out its ingress port. The rationale is that dropping these packets - makes it harder to loop the network. Sometimes this behavior can - even be convenient, e.g. it is often the desired behavior in a flow - that forwards a packet to several ports ("floods" the packet). - - Sometimes one really needs to send a packet out its ingress port - ("hairpin"). In this case, output to OFPP_IN_PORT, which in - ovs-ofctl syntax is expressed as just "in_port", e.g.: - - ovs-ofctl add-flow br0 in_port=2,actions=in_port - - This also works in some circumstances where the flow doesn't match - on the input port. For example, if you know that your switch has - five ports numbered 2 through 6, then the following will send every - received packet out every port, even its ingress port: - - ovs-ofctl add-flow br0 actions=2,3,4,5,6,in_port - - or, equivalently: - - ovs-ofctl add-flow br0 actions=all,in_port - - Sometimes, in complicated flow tables with multiple levels of - "resubmit" actions, a flow needs to output to a particular port - that may or may not be the ingress port. It's difficult to take - advantage of OFPP_IN_PORT in this situation. To help, Open vSwitch - provides, as an OpenFlow extension, the ability to modify the - in_port field. Whatever value is currently in the in_port field is - the port to which outputs will be dropped, as well as the - destination for OFPP_IN_PORT. This means that the following will - reliably output to port 2 or to ports 2 through 6, respectively: - - ovs-ofctl add-flow br0 in_port=2,actions=load:0->NXM_OF_IN_PORT[],2 - ovs-ofctl add-flow br0 actions=load:0->NXM_OF_IN_PORT[],2,3,4,5,6 - - If the input port is important, then one may save and restore it on - the stack: - - ovs-ofctl add-flow br0 actions=push:NXM_OF_IN_PORT[],\ - load:0->NXM_OF_IN_PORT[],\ - 2,3,4,5,6,\ - pop:NXM_OF_IN_PORT[] - -Q: My bridge br0 has host 192.168.0.1 on port 1 and host 192.168.0.2 - on port 2. I set up flows to forward only traffic destined to the - other host and drop other traffic, like this: - - priority=5,in_port=1,ip,nw_dst=192.168.0.2,actions=2 - priority=5,in_port=2,ip,nw_dst=192.168.0.1,actions=1 - priority=0,actions=drop - - But it doesn't work--I don't get any connectivity when I do this. - Why? - -A: These flows drop the ARP packets that IP hosts use to establish IP - connectivity over Ethernet. To solve the problem, add flows to - allow ARP to pass between the hosts: - - priority=5,in_port=1,arp,actions=2 - priority=5,in_port=2,arp,actions=1 - - This issue can manifest other ways, too. The following flows that - match on Ethernet addresses instead of IP addresses will also drop - ARP packets, because ARP requests are broadcast instead of being - directed to a specific host: - - priority=5,in_port=1,dl_dst=54:00:00:00:00:02,actions=2 - priority=5,in_port=2,dl_dst=54:00:00:00:00:01,actions=1 - priority=0,actions=drop - - The solution already described above will also work in this case. - It may be better to add flows to allow all multicast and broadcast - traffic: - - priority=5,in_port=1,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=2 - priority=5,in_port=2,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=1 - - -Development ------------ - -Q: How do I implement a new OpenFlow message? - -A: Add your new message to "enum ofpraw" and "enum ofptype" in - lib/ofp-msgs.h, following the existing pattern. Then recompile and - fix all of the new warnings, implementing new functionality for the - new message as needed. (If you configure with --enable-Werror, as - described in INSTALL, then it is impossible to miss any warnings.) - - If you need to add an OpenFlow vendor extension message for a - vendor that doesn't yet have any extension messages, then you will - also need to edit build-aux/extract-ofp-msgs. - - -Contact -------- - -bugs@openvswitch.org -http://openvswitch.org/ diff -Nru openvswitch-2.3.1/FAQ.md openvswitch-2.4.0~git20150623/FAQ.md --- openvswitch-2.3.1/FAQ.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/FAQ.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1922 @@ +Frequently Asked Questions +========================== + +Open vSwitch + +General +------- + +### Q: What is Open vSwitch? + +A: Open vSwitch is a production quality open source software switch + designed to be used as a vswitch in virtualized server + environments. A vswitch forwards traffic between different VMs on + the same physical host and also forwards traffic between VMs and + the physical network. Open vSwitch supports standard management + interfaces (e.g. sFlow, NetFlow, IPFIX, RSPAN, CLI), and is open to + programmatic extension and control using OpenFlow and the OVSDB + management protocol. + + Open vSwitch as designed to be compatible with modern switching + chipsets. This means that it can be ported to existing high-fanout + switches allowing the same flexible control of the physical + infrastructure as the virtual infrastructure. It also means that + Open vSwitch will be able to take advantage of on-NIC switching + chipsets as their functionality matures. + +### Q: What virtualization platforms can use Open vSwitch? + +A: Open vSwitch can currently run on any Linux-based virtualization + platform (kernel 2.6.32 and newer), including: KVM, VirtualBox, Xen, + Xen Cloud Platform, XenServer. As of Linux 3.3 it is part of the + mainline kernel. The bulk of the code is written in platform- + independent C and is easily ported to other environments. We welcome + inquires about integrating Open vSwitch with other virtualization + platforms. + +### Q: How can I try Open vSwitch? + +A: The Open vSwitch source code can be built on a Linux system. You can + build and experiment with Open vSwitch on any Linux machine. + Packages for various Linux distributions are available on many + platforms, including: Debian, Ubuntu, Fedora. + + You may also download and run a virtualization platform that already + has Open vSwitch integrated. For example, download a recent ISO for + XenServer or Xen Cloud Platform. Be aware that the version + integrated with a particular platform may not be the most recent Open + vSwitch release. + +### Q: Does Open vSwitch only work on Linux? + +A: No, Open vSwitch has been ported to a number of different operating + systems and hardware platforms. Most of the development work occurs + on Linux, but the code should be portable to any POSIX system. We've + seen Open vSwitch ported to a number of different platforms, + including FreeBSD, Windows, and even non-POSIX embedded systems. + + By definition, the Open vSwitch Linux kernel module only works on + Linux and will provide the highest performance. However, a userspace + datapath is available that should be very portable. + +### Q: What's involved with porting Open vSwitch to a new platform or switching ASIC? + +A: The [PORTING.md] document describes how one would go about + porting Open vSwitch to a new operating system or hardware platform. + +### Q: Why would I use Open vSwitch instead of the Linux bridge? + +A: Open vSwitch is specially designed to make it easier to manage VM + network configuration and monitor state spread across many physical + hosts in dynamic virtualized environments. Please see + [WHY-OVS.md] for a more detailed description of how Open vSwitch + relates to the Linux Bridge. + +### Q: How is Open vSwitch related to distributed virtual switches like the VMware vNetwork distributed switch or the Cisco Nexus 1000V? + +A: Distributed vswitch applications (e.g., VMware vNetwork distributed + switch, Cisco Nexus 1000V) provide a centralized way to configure and + monitor the network state of VMs that are spread across many physical + hosts. Open vSwitch is not a distributed vswitch itself, rather it + runs on each physical host and supports remote management in a way + that makes it easier for developers of virtualization/cloud + management platforms to offer distributed vswitch capabilities. + + To aid in distribution, Open vSwitch provides two open protocols that + are specially designed for remote management in virtualized network + environments: OpenFlow, which exposes flow-based forwarding state, + and the OVSDB management protocol, which exposes switch port state. + In addition to the switch implementation itself, Open vSwitch + includes tools (ovs-ofctl, ovs-vsctl) that developers can script and + extend to provide distributed vswitch capabilities that are closely + integrated with their virtualization management platform. + +### Q: Why doesn't Open vSwitch support distribution? + +A: Open vSwitch is intended to be a useful component for building + flexible network infrastructure. There are many different approaches + to distribution which balance trade-offs between simplicity, + scalability, hardware compatibility, convergence times, logical + forwarding model, etc. The goal of Open vSwitch is to be able to + support all as a primitive building block rather than choose a + particular point in the distributed design space. + +### Q: How can I contribute to the Open vSwitch Community? + +A: You can start by joining the mailing lists and helping to answer + questions. You can also suggest improvements to documentation. If + you have a feature or bug you would like to work on, send a mail to + one of the mailing lists: + + http://openvswitch.org/mlists/ + +### Q: Why can I no longer connect to my OpenFlow controller or OVSDB +manager? + +A: Starting in OVS 2.4, we switched the default ports to the + IANA-specified port numbers for OpenFlow (6633->6653) and OVSDB + (6632->6640). We recommend using these port numbers, but if you + cannot, all the programs allow overriding the default port. See the + appropriate man page. + + +Releases +-------- + +### Q: What does it mean for an Open vSwitch release to be LTS (long-term support)? + +A: All official releases have been through a comprehensive testing + process and are suitable for production use. Planned releases will + occur several times a year. If a significant bug is identified in an + LTS release, we will provide an updated release that includes the + fix. Releases that are not LTS may not be fixed and may just be + supplanted by the next major release. The current LTS release is + 2.3.x. + +### Q: What Linux kernel versions does each Open vSwitch release work with? + +A: The following table lists the Linux kernel versions against which the + given versions of the Open vSwitch kernel module will successfully + build. The Linux kernel versions are upstream kernel versions, so + Linux kernels modified from the upstream sources may not build in + some cases even if they are based on a supported version. This is + most notably true of Red Hat Enterprise Linux (RHEL) kernels, which + are extensively modified from upstream. + +| Open vSwitch | Linux kernel +|:------------:|:-------------: +| 1.4.x | 2.6.18 to 3.2 +| 1.5.x | 2.6.18 to 3.2 +| 1.6.x | 2.6.18 to 3.2 +| 1.7.x | 2.6.18 to 3.3 +| 1.8.x | 2.6.18 to 3.4 +| 1.9.x | 2.6.18 to 3.8 +| 1.10.x | 2.6.18 to 3.8 +| 1.11.x | 2.6.18 to 3.8 +| 2.0.x | 2.6.32 to 3.10 +| 2.1.x | 2.6.32 to 3.11 +| 2.3.x | 2.6.32 to 3.14 +| 2.4.x | 2.6.32 to 4.0 + + Open vSwitch userspace should also work with the Linux kernel module + built into Linux 3.3 and later. + + Open vSwitch userspace is not sensitive to the Linux kernel version. + It should build against almost any kernel, certainly against 2.6.32 + and later. + +### Q: I get an error like this when I configure Open vSwitch: + + configure: error: Linux kernel in is version , but + version newer than is not supported (please refer to the + FAQ for advice) + + What should I do? + +A: You have the following options: + + - Use the Linux kernel module supplied with the kernel that you are + using. (See also the following FAQ.) + + - If there is a newer released version of Open vSwitch, consider + building that one, because it may support the kernel that you are + building against. (To find out, consult the table in the + previous FAQ.) + + - The Open vSwitch "master" branch may support the kernel that you + are using, so consider building the kernel module from "master". + + All versions of Open vSwitch userspace are compatible with all + versions of the Open vSwitch kernel module, so you do not have to + use the kernel module from one source along with the userspace + programs from the same source. + +### Q: What features are not available in the Open vSwitch kernel datapath that ships as part of the upstream Linux kernel? + +A: The kernel module in upstream Linux does not include support for + LISP. Work is in progress to add support for LISP to the upstream + Linux version of the Open vSwitch kernel module. For now, if you + need this feature, use the kernel module from the Open vSwitch + distribution instead of the upstream Linux kernel module. + + Certain features require kernel support to function or to have + reasonable performance. If the ovs-vswitchd log file indicates that + a feature is not supported, consider upgrading to a newer upstream + Linux release or using the kernel module paired with the userspace + distribution. + +### Q: Why do tunnels not work when using a kernel module other than the one packaged with Open vSwitch? + +A: Support for tunnels was added to the upstream Linux kernel module + after the rest of Open vSwitch. As a result, some kernels may contain + support for Open vSwitch but not tunnels. The minimum kernel version + that supports each tunnel protocol is: + +| Protocol | Linux Kernel +|:--------:|:-------------: +| GRE | 3.11 +| VXLAN | 3.12 +| Geneve | 3.18 +| LISP | +| STT | + + If you are using a version of the kernel that is older than the one + listed above, it is still possible to use that tunnel protocol. However, + you must compile and install the kernel module included with the Open + vSwitch distribution rather than the one on your machine. If problems + persist after doing this, check to make sure that the module that is + loaded is the one you expect. + +### Q: Why are UDP tunnel checksums not computed for VXLAN or Geneve? + +A: Generating outer UDP checksums requires kernel support that was not + part of the initial implementation of these protocols. If using the + upstream Linux Open vSwitch module, you must use kernel 4.0 or + newer. The out-of-tree modules from Open vSwitch release 2.4 and later + support UDP checksums. + +### Q: What features are not available when using the userspace datapath? + +A: Tunnel virtual ports are not supported, as described in the + previous answer. It is also not possible to use queue-related + actions. On Linux kernels before 2.6.39, maximum-sized VLAN packets + may not be transmitted. + +### Q: What Linux kernel versions does IPFIX flow monitoring work with? + +A: IPFIX flow monitoring requires the Linux kernel module from Linux + 3.10 or later, or the out-of-tree module from Open vSwitch version + 1.10.90 or later. + +### Q: Should userspace or kernel be upgraded first to minimize downtime? + + In general, the Open vSwitch userspace should be used with the + kernel version included in the same release or with the version + from upstream Linux. However, when upgrading between two releases + of Open vSwitch it is best to migrate userspace first to reduce + the possibility of incompatibilities. + +### Q: What happened to the bridge compatibility feature? + +A: Bridge compatibility was a feature of Open vSwitch 1.9 and earlier. + When it was enabled, Open vSwitch imitated the interface of the + Linux kernel "bridge" module. This allowed users to drop Open + vSwitch into environments designed to use the Linux kernel bridge + module without adapting the environment to use Open vSwitch. + + Open vSwitch 1.10 and later do not support bridge compatibility. + The feature was dropped because version 1.10 adopted a new internal + architecture that made bridge compatibility difficult to maintain. + Now that many environments use OVS directly, it would be rarely + useful in any case. + + To use bridge compatibility, install OVS 1.9 or earlier, including + the accompanying kernel modules (both the main and bridge + compatibility modules), following the instructions that come with + the release. Be sure to start the ovs-brcompatd daemon. + + +Terminology +----------- + +### Q: I thought Open vSwitch was a virtual Ethernet switch, but the documentation keeps talking about bridges. What's a bridge? + +A: In networking, the terms "bridge" and "switch" are synonyms. Open + vSwitch implements an Ethernet switch, which means that it is also + an Ethernet bridge. + +### Q: What's a VLAN? + +A: See the "VLAN" section below. + + +Basic Configuration +------------------- + +### Q: How do I configure a port as an access port? + +A: Add "tag=VLAN" to your "ovs-vsctl add-port" command. For example, + the following commands configure br0 with eth0 as a trunk port (the + default) and tap0 as an access port for VLAN 9: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 tag=9 + + If you want to configure an already added port as an access port, + use "ovs-vsctl set", e.g.: + + ovs-vsctl set port tap0 tag=9 + +### Q: How do I configure a port as a SPAN port, that is, enable mirroring of all traffic to that port? + +A: The following commands configure br0 with eth0 and tap0 as trunk + ports. All traffic coming in or going out on eth0 or tap0 is also + mirrored to tap1; any traffic arriving on tap1 is dropped: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 + ovs-vsctl add-port br0 tap1 \ + -- --id=@p get port tap1 \ + -- --id=@m create mirror name=m0 select-all=true output-port=@p \ + -- set bridge br0 mirrors=@m + + To later disable mirroring, run: + + ovs-vsctl clear bridge br0 mirrors + +### Q: Does Open vSwitch support configuring a port in promiscuous mode? + +A: Yes. How you configure it depends on what you mean by "promiscuous + mode": + + - Conventionally, "promiscuous mode" is a feature of a network + interface card. Ordinarily, a NIC passes to the CPU only the + packets actually destined to its host machine. It discards + the rest to avoid wasting memory and CPU cycles. When + promiscuous mode is enabled, however, it passes every packet + to the CPU. On an old-style shared-media or hub-based + network, this allows the host to spy on all packets on the + network. But in the switched networks that are almost + everywhere these days, promiscuous mode doesn't have much + effect, because few packets not destined to a host are + delivered to the host's NIC. + + This form of promiscuous mode is configured in the guest OS of + the VMs on your bridge, e.g. with "ifconfig". + + - The VMware vSwitch uses a different definition of "promiscuous + mode". When you configure promiscuous mode on a VMware vNIC, + the vSwitch sends a copy of every packet received by the + vSwitch to that vNIC. That has a much bigger effect than just + enabling promiscuous mode in a guest OS. Rather than getting + a few stray packets for which the switch does not yet know the + correct destination, the vNIC gets every packet. The effect + is similar to replacing the vSwitch by a virtual hub. + + This "promiscuous mode" is what switches normally call "port + mirroring" or "SPAN". For information on how to configure + SPAN, see "How do I configure a port as a SPAN port, that is, + enable mirroring of all traffic to that port?" + +### Q: How do I configure a DPDK port as an access port? + +A: Firstly, you must have a DPDK-enabled version of Open vSwitch. + + If your version is DPDK-enabled it will support the --dpdk + argument on the command line and will display lines with + "EAL:..." during startup when --dpdk is supplied. + + Secondly, when adding a DPDK port, unlike a system port, the + type for the interface must be specified. For example; + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk + + Finally, it is required that DPDK port names begin with 'dpdk'. + + See [INSTALL.DPDK.md] for more information on enabling and using DPDK with + Open vSwitch. + +### Q: How do I configure a VLAN as an RSPAN VLAN, that is, enable mirroring of all traffic to that VLAN? + +A: The following commands configure br0 with eth0 as a trunk port and + tap0 as an access port for VLAN 10. All traffic coming in or going + out on tap0, as well as traffic coming in or going out on eth0 in + VLAN 10, is also mirrored to VLAN 15 on eth0. The original tag for + VLAN 10, in cases where one is present, is dropped as part of + mirroring: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 tag=10 + ovs-vsctl \ + -- --id=@m create mirror name=m0 select-all=true select-vlan=10 \ + output-vlan=15 \ + -- set bridge br0 mirrors=@m + + To later disable mirroring, run: + + ovs-vsctl clear bridge br0 mirrors + + Mirroring to a VLAN can disrupt a network that contains unmanaged + switches. See ovs-vswitchd.conf.db(5) for details. Mirroring to a + GRE tunnel has fewer caveats than mirroring to a VLAN and should + generally be preferred. + +### Q: Can I mirror more than one input VLAN to an RSPAN VLAN? + +A: Yes, but mirroring to a VLAN strips the original VLAN tag in favor + of the specified output-vlan. This loss of information may make + the mirrored traffic too hard to interpret. + + To mirror multiple VLANs, use the commands above, but specify a + comma-separated list of VLANs as the value for select-vlan. To + mirror every VLAN, use the commands above, but omit select-vlan and + its value entirely. + + When a packet arrives on a VLAN that is used as a mirror output + VLAN, the mirror is disregarded. Instead, in standalone mode, OVS + floods the packet across all the ports for which the mirror output + VLAN is configured. (If an OpenFlow controller is in use, then it + can override this behavior through the flow table.) If OVS is used + as an intermediate switch, rather than an edge switch, this ensures + that the RSPAN traffic is distributed through the network. + + Mirroring to a VLAN can disrupt a network that contains unmanaged + switches. See ovs-vswitchd.conf.db(5) for details. Mirroring to a + GRE tunnel has fewer caveats than mirroring to a VLAN and should + generally be preferred. + +### Q: How do I configure mirroring of all traffic to a GRE tunnel? + +A: The following commands configure br0 with eth0 and tap0 as trunk + ports. All traffic coming in or going out on eth0 or tap0 is also + mirrored to gre0, a GRE tunnel to the remote host 192.168.1.10; any + traffic arriving on gre0 is dropped: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 + ovs-vsctl add-port br0 gre0 \ + -- set interface gre0 type=gre options:remote_ip=192.168.1.10 \ + -- --id=@p get port gre0 \ + -- --id=@m create mirror name=m0 select-all=true output-port=@p \ + -- set bridge br0 mirrors=@m + + To later disable mirroring and destroy the GRE tunnel: + + ovs-vsctl clear bridge br0 mirrors + ovs-vcstl del-port br0 gre0 + +### Q: Does Open vSwitch support ERSPAN? + +A: No. ERSPAN is an undocumented proprietary protocol. As an + alternative, Open vSwitch supports mirroring to a GRE tunnel (see + above). + +### Q: How do I connect two bridges? + +A: First, why do you want to do this? Two connected bridges are not + much different from a single bridge, so you might as well just have + a single bridge with all your ports on it. + + If you still want to connect two bridges, you can use a pair of + patch ports. The following example creates bridges br0 and br1, + adds eth0 and tap0 to br0, adds tap1 to br1, and then connects br0 + and br1 with a pair of patch ports. + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 + ovs-vsctl add-br br1 + ovs-vsctl add-port br1 tap1 + ovs-vsctl \ + -- add-port br0 patch0 \ + -- set interface patch0 type=patch options:peer=patch1 \ + -- add-port br1 patch1 \ + -- set interface patch1 type=patch options:peer=patch0 + + Bridges connected with patch ports are much like a single bridge. + For instance, if the example above also added eth1 to br1, and both + eth0 and eth1 happened to be connected to the same next-hop switch, + then you could loop your network just as you would if you added + eth0 and eth1 to the same bridge (see the "Configuration Problems" + section below for more information). + + If you are using Open vSwitch 1.9 or an earlier version, then you + need to be using the kernel module bundled with Open vSwitch rather + than the one that is integrated into Linux 3.3 and later, because + Open vSwitch 1.9 and earlier versions need kernel support for patch + ports. This also means that in Open vSwitch 1.9 and earlier, patch + ports will not work with the userspace datapath, only with the + kernel module. + +### Q: How do I configure a bridge without an OpenFlow local port? (Local port in the sense of OFPP_LOCAL) + +A: Open vSwitch does not support such a configuration. + Bridges always have their local ports. + + +Implementation Details +---------------------- + +### Q: I hear OVS has a couple of kinds of flows. Can you tell me about them? + +A: Open vSwitch uses different kinds of flows for different purposes: + + - OpenFlow flows are the most important kind of flow. OpenFlow + controllers use these flows to define a switch's policy. + OpenFlow flows support wildcards, priorities, and multiple + tables. + + When in-band control is in use, Open vSwitch sets up a few + "hidden" flows, with priority higher than a controller or the + user can configure, that are not visible via OpenFlow. (See + the "Controller" section of the FAQ for more information + about hidden flows.) + + - The Open vSwitch software switch implementation uses a second + kind of flow internally. These flows, called "datapath" or + "kernel" flows, do not support priorities and comprise only a + single table, which makes them suitable for caching. (Like + OpenFlow flows, datapath flows do support wildcarding, in Open + vSwitch 1.11 and later.) OpenFlow flows and datapath flows + also support different actions and number ports differently. + + Datapath flows are an implementation detail that is subject to + change in future versions of Open vSwitch. Even with the + current version of Open vSwitch, hardware switch + implementations do not necessarily use this architecture. + + Users and controllers directly control only the OpenFlow flow + table. Open vSwitch manages the datapath flow table itself, so + users should not normally be concerned with it. + +### Q: Why are there so many different ways to dump flows? + +A: Open vSwitch has two kinds of flows (see the previous question), so + it has commands with different purposes for dumping each kind of + flow: + + - `ovs-ofctl dump-flows
` dumps OpenFlow flows, excluding + hidden flows. This is the most commonly useful form of flow + dump. (Unlike the other commands, this should work with any + OpenFlow switch, not just Open vSwitch.) + + - `ovs-appctl bridge/dump-flows
` dumps OpenFlow flows, + including hidden flows. This is occasionally useful for + troubleshooting suspected issues with in-band control. + + - `ovs-dpctl dump-flows [dp]` dumps the datapath flow table + entries for a Linux kernel-based datapath. In Open vSwitch + 1.10 and later, ovs-vswitchd merges multiple switches into a + single datapath, so it will show all the flows on all your + kernel-based switches. This command can occasionally be + useful for debugging. + + - `ovs-appctl dpif/dump-flows
`, new in Open vSwitch 1.10, + dumps datapath flows for only the specified bridge, regardless + of the type. + +### Q: How does multicast snooping works with VLANs? + +A: Open vSwitch maintains snooping tables for each VLAN. + + +Performance +----------- + +### Q: I just upgraded and I see a performance drop. Why? + +A: The OVS kernel datapath may have been updated to a newer version than + the OVS userspace components. Sometimes new versions of OVS kernel + module add functionality that is backwards compatible with older + userspace components but may cause a drop in performance with them. + Especially, if a kernel module from OVS 2.1 or newer is paired with + OVS userspace 1.10 or older, there will be a performance drop for + TCP traffic. + + Updating the OVS userspace components to the latest released + version should fix the performance degradation. + + To get the best possible performance and functionality, it is + recommended to pair the same versions of the kernel module and OVS + userspace. + + +Configuration Problems +---------------------- + +### Q: I created a bridge and added my Ethernet port to it, using commands + like these: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + + and as soon as I ran the "add-port" command I lost all connectivity + through eth0. Help! + +A: A physical Ethernet device that is part of an Open vSwitch bridge + should not have an IP address. If one does, then that IP address + will not be fully functional. + + You can restore functionality by moving the IP address to an Open + vSwitch "internal" device, such as the network device named after + the bridge itself. For example, assuming that eth0's IP address is + 192.168.128.5, you could run the commands below to fix up the + situation: + + ifconfig eth0 0.0.0.0 + ifconfig br0 192.168.128.5 + + (If your only connection to the machine running OVS is through the + IP address in question, then you would want to run all of these + commands on a single command line, or put them into a script.) If + there were any additional routes assigned to eth0, then you would + also want to use commands to adjust these routes to go through br0. + + If you use DHCP to obtain an IP address, then you should kill the + DHCP client that was listening on the physical Ethernet interface + (e.g. eth0) and start one listening on the internal interface + (e.g. br0). You might still need to manually clear the IP address + from the physical interface (e.g. with "ifconfig eth0 0.0.0.0"). + + There is no compelling reason why Open vSwitch must work this way. + However, this is the way that the Linux kernel bridge module has + always worked, so it's a model that those accustomed to Linux + bridging are already used to. Also, the model that most people + expect is not implementable without kernel changes on all the + versions of Linux that Open vSwitch supports. + + By the way, this issue is not specific to physical Ethernet + devices. It applies to all network devices except Open vSwitch + "internal" devices. + +### Q: I created a bridge and added a couple of Ethernet ports to it, +### using commands like these: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 eth1 + + and now my network seems to have melted: connectivity is unreliable + (even connectivity that doesn't go through Open vSwitch), all the + LEDs on my physical switches are blinking, wireshark shows + duplicated packets, and CPU usage is very high. + +A: More than likely, you've looped your network. Probably, eth0 and + eth1 are connected to the same physical Ethernet switch. This + yields a scenario where OVS receives a broadcast packet on eth0 and + sends it out on eth1, then the physical switch connected to eth1 + sends the packet back on eth0, and so on forever. More complicated + scenarios, involving a loop through multiple switches, are possible + too. + + The solution depends on what you are trying to do: + + - If you added eth0 and eth1 to get higher bandwidth or higher + reliability between OVS and your physical Ethernet switch, + use a bond. The following commands create br0 and then add + eth0 and eth1 as a bond: + + ovs-vsctl add-br br0 + ovs-vsctl add-bond br0 bond0 eth0 eth1 + + Bonds have tons of configuration options. Please read the + documentation on the Port table in ovs-vswitchd.conf.db(5) + for all the details. + + Configuration for DPDK-enabled interfaces is slightly less + straightforward: see [INSTALL.DPDK.md]. + + - Perhaps you don't actually need eth0 and eth1 to be on the + same bridge. For example, if you simply want to be able to + connect each of them to virtual machines, then you can put + each of them on a bridge of its own: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + + ovs-vsctl add-br br1 + ovs-vsctl add-port br1 eth1 + + and then connect VMs to br0 and br1. (A potential + disadvantage is that traffic cannot directly pass between br0 + and br1. Instead, it will go out eth0 and come back in eth1, + or vice versa.) + + - If you have a redundant or complex network topology and you + want to prevent loops, turn on spanning tree protocol (STP). + The following commands create br0, enable STP, and add eth0 + and eth1 to the bridge. The order is important because you + don't want have to have a loop in your network even + transiently: + + ovs-vsctl add-br br0 + ovs-vsctl set bridge br0 stp_enable=true + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 eth1 + + The Open vSwitch implementation of STP is not well tested. + Please report any bugs you observe, but if you'd rather avoid + acting as a beta tester then another option might be your + best shot. + +### Q: I can't seem to use Open vSwitch in a wireless network. + +A: Wireless base stations generally only allow packets with the source + MAC address of NIC that completed the initial handshake. + Therefore, without MAC rewriting, only a single device can + communicate over a single wireless link. + + This isn't specific to Open vSwitch, it's enforced by the access + point, so the same problems will show up with the Linux bridge or + any other way to do bridging. + +### Q: I can't seem to add my PPP interface to an Open vSwitch bridge. + +A: PPP most commonly carries IP packets, but Open vSwitch works only + with Ethernet frames. The correct way to interface PPP to an + Ethernet network is usually to use routing instead of switching. + +### Q: Is there any documentation on the database tables and fields? + +A: Yes. ovs-vswitchd.conf.db(5) is a comprehensive reference. + +### Q: When I run ovs-dpctl I no longer see the bridges I created. Instead, + I only see a datapath called "ovs-system". How can I see datapath + information about a particular bridge? + +A: In version 1.9.0, OVS switched to using a single datapath that is + shared by all bridges of that type. The "ovs-appctl dpif/*" + commands provide similar functionality that is scoped by the bridge. + +### Q: I created a GRE port using ovs-vsctl so why can't I send traffic or + see the port in the datapath? + +A: On Linux kernels before 3.11, the OVS GRE module and Linux GRE module + cannot be loaded at the same time. It is likely that on your system the + Linux GRE module is already loaded and blocking OVS (to confirm, check + dmesg for errors regarding GRE registration). To fix this, unload all + GRE modules that appear in lsmod as well as the OVS kernel module. You + can then reload the OVS module following the directions in + [INSTALL.md], which will ensure that dependencies are satisfied. + +### Q: Open vSwitch does not seem to obey my packet filter rules. + +A: It depends on mechanisms and configurations you want to use. + + You cannot usefully use typical packet filters, like iptables, on + physical Ethernet ports that you add to an Open vSwitch bridge. + This is because Open vSwitch captures packets from the interface at + a layer lower below where typical packet-filter implementations + install their hooks. (This actually applies to any interface of + type "system" that you might add to an Open vSwitch bridge.) + + You can usefully use typical packet filters on Open vSwitch + internal ports as they are mostly ordinary interfaces from the point + of view of packet filters. + + For example, suppose you create a bridge br0 and add Ethernet port + eth0 to it. Then you can usefully add iptables rules to affect the + internal interface br0, but not the physical interface eth0. (br0 + is also where you would add an IP address, as discussed elsewhere + in the FAQ.) + + For simple filtering rules, it might be possible to achieve similar + results by installing appropriate OpenFlow flows instead. + + If the use of a particular packet filter setup is essential, Open + vSwitch might not be the best choice for you. On Linux, you might + want to consider using the Linux Bridge. (This is the only choice if + you want to use ebtables rules.) On NetBSD, you might want to + consider using the bridge(4) with BRIDGE_IPF option. + +### Q: It seems that Open vSwitch does nothing when I removed a port and + then immediately put it back. For example, consider that p1 is + a port of type=internal: + + ovs-vsctl del-port br0 p1 -- \ + add-port br0 p1 -- \ + set interface p1 type=internal + +A: It's an expected behaviour. + + If del-port and add-port happen in a single OVSDB transaction as + your example, Open vSwitch always "skips" the intermediate steps. + Even if they are done in multiple transactions, it's still allowed + for Open vSwitch to skip the intermediate steps and just implement + the overall effect. In both cases, your example would be turned + into a no-op. + + If you want to make Open vSwitch actually destroy and then re-create + the port for some side effects like resetting kernel setting for the + corresponding interface, you need to separate operations into multiple + OVSDB transactions and ensure that at least the first one does not have + --no-wait. In the following example, the first ovs-vsctl will block + until Open vSwitch reloads the new configuration and removes the port: + + ovs-vsctl del-port br0 p1 + ovs-vsctl add-port br0 p1 -- \ + set interface p1 type=internal + +### Q: I want to add thousands of ports to an Open vSwitch bridge, but + it takes too long (minutes or hours) to do it with ovs-vsctl. How + can I do it faster? + +A: If you add them one at a time with ovs-vsctl, it can take a long + time to add thousands of ports to an Open vSwitch bridge. This is + because every invocation of ovs-vsctl first reads the current + configuration from OVSDB. As the number of ports grows, this + starts to take an appreciable amount of time, and when it is + repeated thousands of times the total time becomes significant. + + The solution is to add the ports in one invocation of ovs-vsctl (or + a small number of them). For example, using bash: + + ovs-vsctl add-br br0 + cmds=; for i in {1..5000}; do cmds+=" -- add-port br0 p$i"; done + ovs-vsctl $cmds + + takes seconds, not minutes or hours, in the OVS sandbox environment. + +### Q: I created a bridge named br0. My bridge shows up in "ovs-vsctl + show", but "ovs-ofctl show br0" just prints "br0 is not a bridge + or a socket". + +A: Open vSwitch wasn't able to create the bridge. Check the + ovs-vswitchd log for details (Debian and Red Hat packaging for Open + vSwitch put it in /var/log/openvswitch/ovs-vswitchd.log). + + In general, the Open vSwitch database reflects the desired + configuration state. ovs-vswitchd monitors the database and, when + it changes, reconfigures the system to reflect the new desired + state. This normally happens very quickly. Thus, a discrepancy + between the database and the actual state indicates that + ovs-vswitchd could not implement the configuration, and so one + should check the log to find out why. (Another possible cause is + that ovs-vswitchd is not running. This will make "ovs-vsctl" + commands hang, if they change the configuration, unless one + specifies "--no-wait".) + +### Q: I have a bridge br0. I added a new port vif1.0, and it shows + up in "ovs-vsctl show", but "ovs-vsctl list port" says that it has + OpenFlow port ("ofport") -1, and "ovs-ofctl show br0" doesn't show + vif1.0 at all. + +A: Open vSwitch wasn't able to create the port. Check the + ovs-vswitchd log for details (Debian and Red Hat packaging for Open + vSwitch put it in /var/log/openvswitch/ovs-vswitchd.log). Please + see the previous question for more information. + + You may want to upgrade to Open vSwitch 2.3 (or later), in which + ovs-vsctl will immediately report when there is an issue creating a + port. + +### Q: I created a tap device tap0, configured an IP address on it, and + added it to a bridge, like this: + + tunctl -t tap0 + ifconfig tap0 192.168.0.123 + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 tap0 + + I expected that I could then use this IP address to contact other + hosts on the network, but it doesn't work. Why not? + +A: The short answer is that this is a misuse of a "tap" device. Use + an "internal" device implemented by Open vSwitch, which works + differently and is designed for this use. To solve this problem + with an internal device, instead run: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 int0 -- set Interface int0 type=internal + ifconfig int0 192.168.0.123 + + Even more simply, you can take advantage of the internal port that + every bridge has under the name of the bridge: + + ovs-vsctl add-br br0 + ifconfig br0 192.168.0.123 + + In more detail, a "tap" device is an interface between the Linux + (or *BSD) network stack and a user program that opens it as a + socket. When the "tap" device transmits a packet, it appears in + the socket opened by the userspace program. Conversely, when the + userspace program writes to the "tap" socket, the kernel TCP/IP + stack processes the packet as if it had been received by the "tap" + device. + + Consider the configuration above. Given this configuration, if you + "ping" an IP address in the 192.168.0.x subnet, the Linux kernel + routing stack will transmit an ARP on the tap0 device. Open + vSwitch userspace treats "tap" devices just like any other network + device; that is, it doesn't open them as "tap" sockets. That means + that the ARP packet will simply get dropped. + + You might wonder why the Open vSwitch kernel module doesn't + intercept the ARP packet and bridge it. After all, Open vSwitch + intercepts packets on other devices. The answer is that Open + vSwitch only intercepts *received* packets, but this is a packet + being transmitted. The same thing happens for all other types of + network devices, except for Open vSwitch "internal" ports. If you, + for example, add a physical Ethernet port to an OVS bridge, + configure an IP address on a physical Ethernet port, and then issue + a "ping" to an address in that subnet, the same thing happens: an + ARP gets transmitted on the physical Ethernet port and Open vSwitch + never sees it. (You should not do that, as documented at the + beginning of this section.) + + It can make sense to add a "tap" device to an Open vSwitch bridge, + if some userspace program (other than Open vSwitch) has opened the + tap socket. This is the case, for example, if the "tap" device was + created by KVM (or QEMU) to simulate a virtual NIC. In such a + case, when OVS bridges a packet to the "tap" device, the kernel + forwards that packet to KVM in userspace, which passes it along to + the VM, and in the other direction, when the VM sends a packet, KVM + writes it to the "tap" socket, which causes OVS to receive it and + bridge it to the other OVS ports. Please note that in such a case + no IP address is configured on the "tap" device (there is normally + an IP address configured in the virtual NIC inside the VM, but this + is not visible to the host Linux kernel or to Open vSwitch). + + There is one special case in which Open vSwitch does directly read + and write "tap" sockets. This is an implementation detail of the + Open vSwitch userspace switch, which implements its "internal" + ports as Linux (or *BSD) "tap" sockets. In such a userspace + switch, OVS receives packets sent on the "tap" device used to + implement an "internal" port by reading the associated "tap" + socket, and bridges them to the rest of the switch. In the other + direction, OVS transmits packets bridged to the "internal" port by + writing them to the "tap" socket, causing them to be processed by + the kernel TCP/IP stack as if they had been received on the "tap" + device. Users should not need to be concerned with this + implementation detail. + + Open vSwitch has a network device type called "tap". This is + intended only for implementing "internal" ports in the OVS + userspace switch and should not be used otherwise. In particular, + users should not configure KVM "tap" devices as type "tap" (use + type "system", the default, instead). + + +Quality of Service (QoS) +------------------------ + +### Q: How do I configure Quality of Service (QoS)? + +A: Suppose that you want to set up bridge br0 connected to physical + Ethernet port eth0 (a 1 Gbps device) and virtual machine interfaces + vif1.0 and vif2.0, and that you want to limit traffic from vif1.0 + to eth0 to 10 Mbps and from vif2.0 to eth0 to 20 Mbps. Then, you + could configure the bridge this way: + + ovs-vsctl -- \ + add-br br0 -- \ + add-port br0 eth0 -- \ + add-port br0 vif1.0 -- set interface vif1.0 ofport_request=5 -- \ + add-port br0 vif2.0 -- set interface vif2.0 ofport_request=6 -- \ + set port eth0 qos=@newqos -- \ + --id=@newqos create qos type=linux-htb \ + other-config:max-rate=1000000000 \ + queues:123=@vif10queue \ + queues:234=@vif20queue -- \ + --id=@vif10queue create queue other-config:max-rate=10000000 -- \ + --id=@vif20queue create queue other-config:max-rate=20000000 + + At this point, bridge br0 is configured with the ports and eth0 is + configured with the queues that you need for QoS, but nothing is + actually directing packets from vif1.0 or vif2.0 to the queues that + we have set up for them. That means that all of the packets to + eth0 are going to the "default queue", which is not what we want. + + We use OpenFlow to direct packets from vif1.0 and vif2.0 to the + queues reserved for them: + + ovs-ofctl add-flow br0 in_port=5,actions=set_queue:123,normal + ovs-ofctl add-flow br0 in_port=6,actions=set_queue:234,normal + + Each of the above flows matches on the input port, sets up the + appropriate queue (123 for vif1.0, 234 for vif2.0), and then + executes the "normal" action, which performs the same switching + that Open vSwitch would have done without any OpenFlow flows being + present. (We know that vif1.0 and vif2.0 have OpenFlow port + numbers 5 and 6, respectively, because we set their ofport_request + columns above. If we had not done that, then we would have needed + to find out their port numbers before setting up these flows.) + + Now traffic going from vif1.0 or vif2.0 to eth0 should be + rate-limited. + + By the way, if you delete the bridge created by the above commands, + with: + + ovs-vsctl del-br br0 + + then that will leave one unreferenced QoS record and two + unreferenced Queue records in the Open vSwich database. One way to + clear them out, assuming you don't have other QoS or Queue records + that you want to keep, is: + + ovs-vsctl -- --all destroy QoS -- --all destroy Queue + + If you do want to keep some QoS or Queue records, or the Open + vSwitch you are using is older than version 1.8 (which added the + --all option), then you will have to destroy QoS and Queue records + individually. + +### Q: I configured Quality of Service (QoS) in my OpenFlow network by + adding records to the QoS and Queue table, but the results aren't + what I expect. + +A: Did you install OpenFlow flows that use your queues? This is the + primary way to tell Open vSwitch which queues you want to use. If + you don't do this, then the default queue will be used, which will + probably not have the effect you want. + + Refer to the previous question for an example. + +### Q: I'd like to take advantage of some QoS feature that Open vSwitch + doesn't yet support. How do I do that? + +A: Open vSwitch does not implement QoS itself. Instead, it can + configure some, but not all, of the QoS features built into the + Linux kernel. If you need some QoS feature that OVS cannot + configure itself, then the first step is to figure out whether + Linux QoS supports that feature. If it does, then you can submit a + patch to support Open vSwitch configuration for that feature, or + you can use "tc" directly to configure the feature in Linux. (If + Linux QoS doesn't support the feature you want, then first you have + to add that support to Linux.) + +### Q: I configured QoS, correctly, but my measurements show that it isn't + working as well as I expect. + +A: With the Linux kernel, the Open vSwitch implementation of QoS has + two aspects: + + - Open vSwitch configures a subset of Linux kernel QoS + features, according to what is in OVSDB. It is possible that + this code has bugs. If you believe that this is so, then you + can configure the Linux traffic control (QoS) stack directly + with the "tc" program. If you get better results that way, + you can send a detailed bug report to bugs@openvswitch.org. + + It is certain that Open vSwitch cannot configure every Linux + kernel QoS feature. If you need some feature that OVS cannot + configure, then you can also use "tc" directly (or add that + feature to OVS). + + - The Open vSwitch implementation of OpenFlow allows flows to + be directed to particular queues. This is pretty simple and + unlikely to have serious bugs at this point. + + However, most problems with QoS on Linux are not bugs in Open + vSwitch at all. They tend to be either configuration errors + (please see the earlier questions in this section) or issues with + the traffic control (QoS) stack in Linux. The Open vSwitch + developers are not experts on Linux traffic control. We suggest + that, if you believe you are encountering a problem with Linux + traffic control, that you consult the tc manpages (e.g. tc(8), + tc-htb(8), tc-hfsc(8)), web resources (e.g. http://lartc.org/), or + mailing lists (e.g. http://vger.kernel.org/vger-lists.html#netdev). + +### Q: Does Open vSwitch support OpenFlow meters? + +A: Since version 2.0, Open vSwitch has OpenFlow protocol support for + OpenFlow meters. There is no implementation of meters in the Open + vSwitch software switch (neither the kernel-based nor userspace + switches). + + +VLANs +----- + +### Q: What's a VLAN? + +A: At the simplest level, a VLAN (short for "virtual LAN") is a way to + partition a single switch into multiple switches. Suppose, for + example, that you have two groups of machines, group A and group B. + You want the machines in group A to be able to talk to each other, + and you want the machine in group B to be able to talk to each + other, but you don't want the machines in group A to be able to + talk to the machines in group B. You can do this with two + switches, by plugging the machines in group A into one switch and + the machines in group B into the other switch. + + If you only have one switch, then you can use VLANs to do the same + thing, by configuring the ports for machines in group A as VLAN + "access ports" for one VLAN and the ports for group B as "access + ports" for a different VLAN. The switch will only forward packets + between ports that are assigned to the same VLAN, so this + effectively subdivides your single switch into two independent + switches, one for each group of machines. + + So far we haven't said anything about VLAN headers. With access + ports, like we've described so far, no VLAN header is present in + the Ethernet frame. This means that the machines (or switches) + connected to access ports need not be aware that VLANs are + involved, just like in the case where we use two different physical + switches. + + Now suppose that you have a whole bunch of switches in your + network, instead of just one, and that some machines in group A are + connected directly to both switches 1 and 2. To allow these + machines to talk to each other, you could add an access port for + group A's VLAN to switch 1 and another to switch 2, and then + connect an Ethernet cable between those ports. That works fine, + but it doesn't scale well as the number of switches and the number + of VLANs increases, because you use up a lot of valuable switch + ports just connecting together your VLANs. + + This is where VLAN headers come in. Instead of using one cable and + two ports per VLAN to connect a pair of switches, we configure a + port on each switch as a VLAN "trunk port". Packets sent and + received on a trunk port carry a VLAN header that says what VLAN + the packet belongs to, so that only two ports total are required to + connect the switches, regardless of the number of VLANs in use. + Normally, only switches (either physical or virtual) are connected + to a trunk port, not individual hosts, because individual hosts + don't expect to see a VLAN header in the traffic that they receive. + + None of the above discussion says anything about particular VLAN + numbers. This is because VLAN numbers are completely arbitrary. + One must only ensure that a given VLAN is numbered consistently + throughout a network and that different VLANs are given different + numbers. (That said, VLAN 0 is usually synonymous with a packet + that has no VLAN header, and VLAN 4095 is reserved.) + +### Q: VLANs don't work. + +A: Many drivers in Linux kernels before version 3.3 had VLAN-related + bugs. If you are having problems with VLANs that you suspect to be + driver related, then you have several options: + + - Upgrade to Linux 3.3 or later. + + - Build and install a fixed version of the particular driver + that is causing trouble, if one is available. + + - Use a NIC whose driver does not have VLAN problems. + + - Use "VLAN splinters", a feature in Open vSwitch 1.4 and later + that works around bugs in kernel drivers. To enable VLAN + splinters on interface eth0, use the command: + + ovs-vsctl set interface eth0 other-config:enable-vlan-splinters=true + + For VLAN splinters to be effective, Open vSwitch must know + which VLANs are in use. See the "VLAN splinters" section in + the Interface table in ovs-vswitchd.conf.db(5) for details on + how Open vSwitch infers in-use VLANs. + + VLAN splinters increase memory use and reduce performance, so + use them only if needed. + + - Apply the "vlan workaround" patch from the XenServer kernel + patch queue, build Open vSwitch against this patched kernel, + and then use ovs-vlan-bug-workaround(8) to enable the VLAN + workaround for each interface whose driver is buggy. + + (This is a nontrivial exercise, so this option is included + only for completeness.) + + It is not always easy to tell whether a Linux kernel driver has + buggy VLAN support. The ovs-vlan-test(8) and ovs-test(8) utilities + can help you test. See their manpages for details. Of the two + utilities, ovs-test(8) is newer and more thorough, but + ovs-vlan-test(8) may be easier to use. + +### Q: VLANs still don't work. I've tested the driver so I know that it's OK. + +A: Do you have VLANs enabled on the physical switch that OVS is + attached to? Make sure that the port is configured to trunk the + VLAN or VLANs that you are using with OVS. + +### Q: Outgoing VLAN-tagged traffic goes through OVS to my physical switch + and to its destination host, but OVS seems to drop incoming return + traffic. + +A: It's possible that you have the VLAN configured on your physical + switch as the "native" VLAN. In this mode, the switch treats + incoming packets either tagged with the native VLAN or untagged as + part of the native VLAN. It may also send outgoing packets in the + native VLAN without a VLAN tag. + + If this is the case, you have two choices: + + - Change the physical switch port configuration to tag packets + it forwards to OVS with the native VLAN instead of forwarding + them untagged. + + - Change the OVS configuration for the physical port to a + native VLAN mode. For example, the following sets up a + bridge with port eth0 in "native-tagged" mode in VLAN 9: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 tag=9 vlan_mode=native-tagged + + In this situation, "native-untagged" mode will probably work + equally well. Refer to the documentation for the Port table + in ovs-vswitchd.conf.db(5) for more information. + +### Q: I added a pair of VMs on different VLANs, like this: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 tag=9 + ovs-vsctl add-port br0 tap1 tag=10 + + but the VMs can't access each other, the external network, or the + Internet. + +A: It is to be expected that the VMs can't access each other. VLANs + are a means to partition a network. When you configured tap0 and + tap1 as access ports for different VLANs, you indicated that they + should be isolated from each other. + + As for the external network and the Internet, it seems likely that + the machines you are trying to access are not on VLAN 9 (or 10) and + that the Internet is not available on VLAN 9 (or 10). + +### Q: I added a pair of VMs on the same VLAN, like this: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 tag=9 + ovs-vsctl add-port br0 tap1 tag=9 + + The VMs can access each other, but not the external network or the + Internet. + +A: It seems likely that the machines you are trying to access in the + external network are not on VLAN 9 and that the Internet is not + available on VLAN 9. Also, ensure VLAN 9 is set up as an allowed + trunk VLAN on the upstream switch port to which eth0 is connected. + +### Q: Can I configure an IP address on a VLAN? + +A: Yes. Use an "internal port" configured as an access port. For + example, the following configures IP address 192.168.0.7 on VLAN 9. + That is, OVS will forward packets from eth0 to 192.168.0.7 only if + they have an 802.1Q header with VLAN 9. Conversely, traffic + forwarded from 192.168.0.7 to eth0 will be tagged with an 802.1Q + header with VLAN 9: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 vlan9 tag=9 -- set interface vlan9 type=internal + ifconfig vlan9 192.168.0.7 + + See also the following question. + +### Q: I configured one IP address on VLAN 0 and another on VLAN 9, like + this: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 eth0 + ifconfig br0 192.168.0.5 + ovs-vsctl add-port br0 vlan9 tag=9 -- set interface vlan9 type=internal + ifconfig vlan9 192.168.0.9 + + but other hosts that are only on VLAN 0 can reach the IP address + configured on VLAN 9. What's going on? + +A: RFC 1122 section 3.3.4.2 "Multihoming Requirements" describes two + approaches to IP address handling in Internet hosts: + + - In the "Strong ES Model", where an ES is a host ("End + System"), an IP address is primarily associated with a + particular interface. The host discards packets that arrive + on interface A if they are destined for an IP address that is + configured on interface B. The host never sends packets from + interface A using a source address configured on interface B. + + - In the "Weak ES Model", an IP address is primarily associated + with a host. The host accepts packets that arrive on any + interface if they are destined for any of the host's IP + addresses, even if the address is configured on some + interface other than the one on which it arrived. The host + does not restrict itself to sending packets from an IP + address associated with the originating interface. + + Linux uses the weak ES model. That means that when packets + destined to the VLAN 9 IP address arrive on eth0 and are bridged to + br0, the kernel IP stack accepts them there for the VLAN 9 IP + address, even though they were not received on vlan9, the network + device for vlan9. + + To simulate the strong ES model on Linux, one may add iptables rule + to filter packets based on source and destination address and + adjust ARP configuration with sysctls. + + BSD uses the strong ES model. + +### Q: My OpenFlow controller doesn't see the VLANs that I expect. + +A: The configuration for VLANs in the Open vSwitch database (e.g. via + ovs-vsctl) only affects traffic that goes through Open vSwitch's + implementation of the OpenFlow "normal switching" action. By + default, when Open vSwitch isn't connected to a controller and + nothing has been manually configured in the flow table, all traffic + goes through the "normal switching" action. But, if you set up + OpenFlow flows on your own, through a controller or using ovs-ofctl + or through other means, then you have to implement VLAN handling + yourself. + + You can use "normal switching" as a component of your OpenFlow + actions, e.g. by putting "normal" into the lists of actions on + ovs-ofctl or by outputting to OFPP_NORMAL from an OpenFlow + controller. In situations where this is not suitable, you can + implement VLAN handling yourself, e.g.: + + - If a packet comes in on an access port, and the flow table + needs to send it out on a trunk port, then the flow can add + the appropriate VLAN tag with the "mod_vlan_vid" action. + + - If a packet comes in on a trunk port, and the flow table + needs to send it out on an access port, then the flow can + strip the VLAN tag with the "strip_vlan" action. + +### Q: I configured ports on a bridge as access ports with different VLAN + tags, like this: + + ovs-vsctl add-br br0 + ovs-vsctl set-controller br0 tcp:192.168.0.10:6653 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 tap0 tag=9 + ovs-vsctl add-port br0 tap1 tag=10 + + but the VMs running behind tap0 and tap1 can still communicate, + that is, they are not isolated from each other even though they are + on different VLANs. + +A: Do you have a controller configured on br0 (as the commands above + do)? If so, then this is a variant on the previous question, "My + OpenFlow controller doesn't see the VLANs that I expect," and you + can refer to the answer there for more information. + +### Q: How MAC learning works with VLANs? + +A: Open vSwitch implements Independent VLAN Learning (IVL) for + OFPP_NORMAL action. I.e. it logically has separate learning tables + for each VLANs. + + +VXLANs +----- + +### Q: What's a VXLAN? + +A: VXLAN stands for Virtual eXtensible Local Area Network, and is a means + to solve the scaling challenges of VLAN networks in a multi-tenant + environment. VXLAN is an overlay network which transports an L2 network + over an existing L3 network. For more information on VXLAN, please see + RFC 7348: + + http://tools.ietf.org/html/rfc7348 + +### Q: How much of the VXLAN protocol does Open vSwitch currently support? + +A: Open vSwitch currently supports the framing format for packets on the + wire. There is currently no support for the multicast aspects of VXLAN. + To get around the lack of multicast support, it is possible to + pre-provision MAC to IP address mappings either manually or from a + controller. + +### Q: What destination UDP port does the VXLAN implementation in Open vSwitch + use? + +A: By default, Open vSwitch will use the assigned IANA port for VXLAN, which + is 4789. However, it is possible to configure the destination UDP port + manually on a per-VXLAN tunnel basis. An example of this configuration is + provided below. + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 vxlan1 -- set interface vxlan1 + type=vxlan options:remote_ip=192.168.1.2 options:key=flow + options:dst_port=8472 + + +Using OpenFlow (Manually or Via Controller) +------------------------------------------- + +### Q: What versions of OpenFlow does Open vSwitch support? + +A: The following table lists the versions of OpenFlow supported by + each version of Open vSwitch: + + Open vSwitch OF1.0 OF1.1 OF1.2 OF1.3 OF1.4 OF1.5 + ###============ ===== ===== ===== ===== ===== ===== + 1.9 and earlier yes --- --- --- --- --- + 1.10 yes --- [*] [*] --- --- + 1.11 yes --- [*] [*] --- --- + 2.0 yes [*] [*] [*] --- --- + 2.1 yes [*] [*] [*] --- --- + 2.2 yes [*] [*] [*] [%] [*] + 2.3 yes yes yes yes [*] [*] + + [*] Supported, with one or more missing features. + [%] Experimental, unsafe implementation. + + Open vSwitch 2.3 enables OpenFlow 1.0, 1.1, 1.2, and 1.3 by default + in ovs-vswitchd. In Open vSwitch 1.10 through 2.2, OpenFlow 1.1, + 1.2, and 1.3 must be enabled manually in ovs-vswitchd. OpenFlow + 1.4 and 1.5 are also supported, with missing features, in Open + vSwitch 2.3 and later, but not enabled by default. In any case, + the user may override the default: + + - To enable OpenFlow 1.0, 1.1, 1.2, and 1.3 on bridge br0: + + ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 + + - To enable OpenFlow 1.0, 1.1, 1.2, 1.3, 1.4, and 1.5 on bridge br0: + + ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15 + + - To enable only OpenFlow 1.0 on bridge br0: + + ovs-vsctl set bridge br0 protocols=OpenFlow10 + + All current versions of ovs-ofctl enable only OpenFlow 1.0 by + default. Use the -O option to enable support for later versions of + OpenFlow in ovs-ofctl. For example: + + ovs-ofctl -O OpenFlow13 dump-flows br0 + + (Open vSwitch 2.2 had an experimental implementation of OpenFlow + 1.4 that could cause crashes. We don't recommend enabling it.) + + [OPENFLOW-1.1+.md] in the Open vSwitch source tree tracks support for + OpenFlow 1.1 and later features. When support for OpenFlow 1.4 and + 1.5 is solidly implemented, Open vSwitch will enable those version + by default. Also, the OpenFlow 1.5 specification is still under + development and thus subject to change. + +### Q: Does Open vSwitch support MPLS? + +A: Before version 1.11, Open vSwitch did not support MPLS. That is, + these versions can match on MPLS Ethernet types, but they cannot + match, push, or pop MPLS labels, nor can they look past MPLS labels + into the encapsulated packet. + + Open vSwitch versions 1.11, 2.0, and 2.1 have very minimal support + for MPLS. With the userspace datapath only, these versions can + match, push, or pop a single MPLS label, but they still cannot look + past MPLS labels (even after popping them) into the encapsulated + packet. Kernel datapath support is unchanged from earlier + versions. + + Open vSwitch version 2.3 can match, push, or pop a single MPLS + label and look past the MPLS label into the encapsulated packet. + Both userspace and kernel datapaths will be supported, but MPLS + processing always happens in userspace either way, so kernel + datapath performance will be disappointing. + + Open vSwitch version 2.4 can match, push, or pop up to 3 MPLS + labels and look past the MPLS label into the encapsulated packet. + It will have kernel support for MPLS, yielding improved + performance. + +### Q: I'm getting "error type 45250 code 0". What's that? + +A: This is a Open vSwitch extension to OpenFlow error codes. Open + vSwitch uses this extension when it must report an error to an + OpenFlow controller but no standard OpenFlow error code is + suitable. + + Open vSwitch logs the errors that it sends to controllers, so the + easiest thing to do is probably to look at the ovs-vswitchd log to + find out what the error was. + + If you want to dissect the extended error message yourself, the + format is documented in include/openflow/nicira-ext.h in the Open + vSwitch source distribution. The extended error codes are + documented in lib/ofp-errors.h. + +Q1: Some of the traffic that I'd expect my OpenFlow controller to see + doesn't actually appear through the OpenFlow connection, even + though I know that it's going through. +Q2: Some of the OpenFlow flows that my controller sets up don't seem + to apply to certain traffic, especially traffic between OVS and + the controller itself. + +A: By default, Open vSwitch assumes that OpenFlow controllers are + connected "in-band", that is, that the controllers are actually + part of the network that is being controlled. In in-band mode, + Open vSwitch sets up special "hidden" flows to make sure that + traffic can make it back and forth between OVS and the controllers. + These hidden flows are higher priority than any flows that can be + set up through OpenFlow, and they are not visible through normal + OpenFlow flow table dumps. + + Usually, the hidden flows are desirable and helpful, but + occasionally they can cause unexpected behavior. You can view the + full OpenFlow flow table, including hidden flows, on bridge br0 + with the command: + + ovs-appctl bridge/dump-flows br0 + + to help you debug. The hidden flows are those with priorities + greater than 65535 (the maximum priority that can be set with + OpenFlow). + + The DESIGN file at the top level of the Open vSwitch source + distribution describes the in-band model in detail. + + If your controllers are not actually in-band (e.g. they are on + localhost via 127.0.0.1, or on a separate network), then you should + configure your controllers in "out-of-band" mode. If you have one + controller on bridge br0, then you can configure out-of-band mode + on it with: + + ovs-vsctl set controller br0 connection-mode=out-of-band + +### Q: I configured all my controllers for out-of-band control mode but + "ovs-appctl bridge/dump-flows" still shows some hidden flows. + +A: You probably have a remote manager configured (e.g. with "ovs-vsctl + set-manager"). By default, Open vSwitch assumes that managers need + in-band rules set up on every bridge. You can disable these rules + on bridge br0 with: + + ovs-vsctl set bridge br0 other-config:disable-in-band=true + + This actually disables in-band control entirely for the bridge, as + if all the bridge's controllers were configured for out-of-band + control. + +### Q: My OpenFlow controller doesn't see the VLANs that I expect. + +A: See answer under "VLANs", above. + +### Q: I ran "ovs-ofctl add-flow br0 nw_dst=192.168.0.1,actions=drop" + but I got a funny message like this: + + ofp_util|INFO|normalization changed ofp_match, details: + ofp_util|INFO| pre: nw_dst=192.168.0.1 + ofp_util|INFO|post: + + and when I ran "ovs-ofctl dump-flows br0" I saw that my nw_dst + match had disappeared, so that the flow ends up matching every + packet. + +A: The term "normalization" in the log message means that a flow + cannot match on an L3 field without saying what L3 protocol is in + use. The "ovs-ofctl" command above didn't specify an L3 protocol, + so the L3 field match was dropped. + + In this case, the L3 protocol could be IP or ARP. A correct + command for each possibility is, respectively: + + ovs-ofctl add-flow br0 ip,nw_dst=192.168.0.1,actions=drop + + and + + ovs-ofctl add-flow br0 arp,nw_dst=192.168.0.1,actions=drop + + Similarly, a flow cannot match on an L4 field without saying what + L4 protocol is in use. For example, the flow match "tp_src=1234" + is, by itself, meaningless and will be ignored. Instead, to match + TCP source port 1234, write "tcp,tp_src=1234", or to match UDP + source port 1234, write "udp,tp_src=1234". + +### Q: How can I figure out the OpenFlow port number for a given port? + +A: The OFPT_FEATURES_REQUEST message requests an OpenFlow switch to + respond with an OFPT_FEATURES_REPLY that, among other information, + includes a mapping between OpenFlow port names and numbers. From a + command prompt, "ovs-ofctl show br0" makes such a request and + prints the response for switch br0. + + The Interface table in the Open vSwitch database also maps OpenFlow + port names to numbers. To print the OpenFlow port number + associated with interface eth0, run: + + ovs-vsctl get Interface eth0 ofport + + You can print the entire mapping with: + + ovs-vsctl -- --columns=name,ofport list Interface + + but the output mixes together interfaces from all bridges in the + database, so it may be confusing if more than one bridge exists. + + In the Open vSwitch database, ofport value -1 means that the + interface could not be created due to an error. (The Open vSwitch + log should indicate the reason.) ofport value [] (the empty set) + means that the interface hasn't been created yet. The latter is + normally an intermittent condition (unless ovs-vswitchd is not + running). + +### Q: I added some flows with my controller or with ovs-ofctl, but when I + run "ovs-dpctl dump-flows" I don't see them. + +A: ovs-dpctl queries a kernel datapath, not an OpenFlow switch. It + won't display the information that you want. You want to use + "ovs-ofctl dump-flows" instead. + +### Q: It looks like each of the interfaces in my bonded port shows up + as an individual OpenFlow port. Is that right? + +A: Yes, Open vSwitch makes individual bond interfaces visible as + OpenFlow ports, rather than the bond as a whole. The interfaces + are treated together as a bond for only a few purposes: + + - Sending a packet to the OFPP_NORMAL port. (When an OpenFlow + controller is not configured, this happens implicitly to + every packet.) + + - Mirrors configured for output to a bonded port. + + It would make a lot of sense for Open vSwitch to present a bond as + a single OpenFlow port. If you want to contribute an + implementation of such a feature, please bring it up on the Open + vSwitch development mailing list at dev@openvswitch.org. + +### Q: I have a sophisticated network setup involving Open vSwitch, VMs or + multiple hosts, and other components. The behavior isn't what I + expect. Help! + +A: To debug network behavior problems, trace the path of a packet, + hop-by-hop, from its origin in one host to a remote host. If + that's correct, then trace the path of the response packet back to + the origin. + + Usually a simple ICMP echo request and reply ("ping") packet is + good enough. Start by initiating an ongoing "ping" from the origin + host to a remote host. If you are tracking down a connectivity + problem, the "ping" will not display any successful output, but + packets are still being sent. (In this case the packets being sent + are likely ARP rather than ICMP.) + + Tools available for tracing include the following: + + - "tcpdump" and "wireshark" for observing hops across network + devices, such as Open vSwitch internal devices and physical + wires. + + - "ovs-appctl dpif/dump-flows
" in Open vSwitch 1.10 and + later or "ovs-dpctl dump-flows
" in earlier versions. + These tools allow one to observe the actions being taken on + packets in ongoing flows. + + See ovs-vswitchd(8) for "ovs-appctl dpif/dump-flows" + documentation, ovs-dpctl(8) for "ovs-dpctl dump-flows" + documentation, and "Why are there so many different ways to + dump flows?" above for some background. + + - "ovs-appctl ofproto/trace" to observe the logic behind how + ovs-vswitchd treats packets. See ovs-vswitchd(8) for + documentation. You can out more details about a given flow + that "ovs-dpctl dump-flows" displays, by cutting and pasting + a flow from the output into an "ovs-appctl ofproto/trace" + command. + + - SPAN, RSPAN, and ERSPAN features of physical switches, to + observe what goes on at these physical hops. + + Starting at the origin of a given packet, observe the packet at + each hop in turn. For example, in one plausible scenario, you + might: + + 1. "tcpdump" the "eth" interface through which an ARP egresses + a VM, from inside the VM. + + 2. "tcpdump" the "vif" or "tap" interface through which the ARP + ingresses the host machine. + + 3. Use "ovs-dpctl dump-flows" to spot the ARP flow and observe + the host interface through which the ARP egresses the + physical machine. You may need to use "ovs-dpctl show" to + interpret the port numbers. If the output seems surprising, + you can use "ovs-appctl ofproto/trace" to observe details of + how ovs-vswitchd determined the actions in the "ovs-dpctl + dump-flows" output. + + 4. "tcpdump" the "eth" interface through which the ARP egresses + the physical machine. + + 5. "tcpdump" the "eth" interface through which the ARP + ingresses the physical machine, at the remote host that + receives the ARP. + + 6. Use "ovs-dpctl dump-flows" to spot the ARP flow on the + remote host that receives the ARP and observe the VM "vif" + or "tap" interface to which the flow is directed. Again, + "ovs-dpctl show" and "ovs-appctl ofproto/trace" might help. + + 7. "tcpdump" the "vif" or "tap" interface to which the ARP is + directed. + + 8. "tcpdump" the "eth" interface through which the ARP + ingresses a VM, from inside the VM. + + It is likely that during one of these steps you will figure out the + problem. If not, then follow the ARP reply back to the origin, in + reverse. + +### Q: How do I make a flow drop packets? + +A: To drop a packet is to receive it without forwarding it. OpenFlow + explicitly specifies forwarding actions. Thus, a flow with an + empty set of actions does not forward packets anywhere, causing + them to be dropped. You can specify an empty set of actions with + "actions=" on the ovs-ofctl command line. For example: + + ovs-ofctl add-flow br0 priority=65535,actions= + + would cause every packet entering switch br0 to be dropped. + + You can write "drop" explicitly if you like. The effect is the + same. Thus, the following command also causes every packet + entering switch br0 to be dropped: + + ovs-ofctl add-flow br0 priority=65535,actions=drop + + "drop" is not an action, either in OpenFlow or Open vSwitch. + Rather, it is only a way to say that there are no actions. + +### Q: I added a flow to send packets out the ingress port, like this: + + ovs-ofctl add-flow br0 in_port=2,actions=2 + + but OVS drops the packets instead. + +A: Yes, OpenFlow requires a switch to ignore attempts to send a packet + out its ingress port. The rationale is that dropping these packets + makes it harder to loop the network. Sometimes this behavior can + even be convenient, e.g. it is often the desired behavior in a flow + that forwards a packet to several ports ("floods" the packet). + + Sometimes one really needs to send a packet out its ingress port + ("hairpin"). In this case, output to OFPP_IN_PORT, which in + ovs-ofctl syntax is expressed as just "in_port", e.g.: + + ovs-ofctl add-flow br0 in_port=2,actions=in_port + + This also works in some circumstances where the flow doesn't match + on the input port. For example, if you know that your switch has + five ports numbered 2 through 6, then the following will send every + received packet out every port, even its ingress port: + + ovs-ofctl add-flow br0 actions=2,3,4,5,6,in_port + + or, equivalently: + + ovs-ofctl add-flow br0 actions=all,in_port + + Sometimes, in complicated flow tables with multiple levels of + "resubmit" actions, a flow needs to output to a particular port + that may or may not be the ingress port. It's difficult to take + advantage of OFPP_IN_PORT in this situation. To help, Open vSwitch + provides, as an OpenFlow extension, the ability to modify the + in_port field. Whatever value is currently in the in_port field is + the port to which outputs will be dropped, as well as the + destination for OFPP_IN_PORT. This means that the following will + reliably output to port 2 or to ports 2 through 6, respectively: + + ovs-ofctl add-flow br0 in_port=2,actions=load:0->NXM_OF_IN_PORT[],2 + ovs-ofctl add-flow br0 actions=load:0->NXM_OF_IN_PORT[],2,3,4,5,6 + + If the input port is important, then one may save and restore it on + the stack: + + ovs-ofctl add-flow br0 actions=push:NXM_OF_IN_PORT[],\ + load:0->NXM_OF_IN_PORT[],\ + 2,3,4,5,6,\ + pop:NXM_OF_IN_PORT[] + +### Q: My bridge br0 has host 192.168.0.1 on port 1 and host 192.168.0.2 + on port 2. I set up flows to forward only traffic destined to the + other host and drop other traffic, like this: + + priority=5,in_port=1,ip,nw_dst=192.168.0.2,actions=2 + priority=5,in_port=2,ip,nw_dst=192.168.0.1,actions=1 + priority=0,actions=drop + + But it doesn't work--I don't get any connectivity when I do this. + Why? + +A: These flows drop the ARP packets that IP hosts use to establish IP + connectivity over Ethernet. To solve the problem, add flows to + allow ARP to pass between the hosts: + + priority=5,in_port=1,arp,actions=2 + priority=5,in_port=2,arp,actions=1 + + This issue can manifest other ways, too. The following flows that + match on Ethernet addresses instead of IP addresses will also drop + ARP packets, because ARP requests are broadcast instead of being + directed to a specific host: + + priority=5,in_port=1,dl_dst=54:00:00:00:00:02,actions=2 + priority=5,in_port=2,dl_dst=54:00:00:00:00:01,actions=1 + priority=0,actions=drop + + The solution already described above will also work in this case. + It may be better to add flows to allow all multicast and broadcast + traffic: + + priority=5,in_port=1,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=2 + priority=5,in_port=2,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=1 + +### Q: My bridge disconnects from my controller on add-port/del-port. + +A: Reconfiguring your bridge can change your bridge's datapath-id because + Open vSwitch generates datapath-id from the MAC address of one of its ports. + In that case, Open vSwitch disconnects from controllers because there's + no graceful way to notify controllers about the change of datapath-id. + + To avoid the behaviour, you can configure datapath-id manually. + + ovs-vsctl set bridge br0 other-config:datapath-id=0123456789abcdef + +### Q: My controller is getting errors about "buffers". What's going on? + +A: When a switch sends a packet to an OpenFlow controller using a + "packet-in" message, it can also keep a copy of that packet in a + "buffer", identified by a 32-bit integer "buffer_id". There are + two advantages to buffering. First, when the controller wants to + tell the switch to do something with the buffered packet (with a + "packet-out" OpenFlow request), it does not need to send another + copy of the packet back across the OpenFlow connection, which + reduces the bandwidth cost of the connection and improves latency. + This enables the second advantage: the switch can optionally send + only the first part of the packet to the controller (assuming that + the switch only needs to look at the first few bytes of the + packet), further reducing bandwidth and improving latency. + + However, buffering introduces some issues of its own. First, any + switch has limited resources, so if the controller does not use a + buffered packet, the switch has to decide how long to keep it + buffered. When many packets are sent to a controller and buffered, + Open vSwitch can discard buffered packets that the controller has + not used after as little as 5 seconds. This means that + controllers, if they make use of packet buffering, should use the + buffered packets promptly. (This includes sending a "packet-out" + with no actions if the controller does not want to do anything with + a buffered packet, to clear the packet buffer and effectively + "drop" its packet.) + + Second, packet buffers are one-time-use, meaning that a controller + cannot use a single packet buffer in two or more "packet-out" + commands. Open vSwitch will respond with an error to the second + and subsequent "packet-out"s in such a case. + + Finally, a common error early in controller development is to try + to use buffer_id 0 in a "packet-out" message as if 0 represented + "no buffered packet". This is incorrect usage: the buffer_id with + this meaning is actually 0xffffffff. + + ovs-vswitchd(8) describes some details of Open vSwitch packet + buffering that the OpenFlow specification requires implementations + to document. + + +Development +----------- + +### Q: How do I implement a new OpenFlow message? + +A: Add your new message to "enum ofpraw" and "enum ofptype" in + lib/ofp-msgs.h, following the existing pattern. Then recompile and + fix all of the new warnings, implementing new functionality for the + new message as needed. (If you configure with --enable-Werror, as + described in [INSTALL.md], then it is impossible to miss any warnings.) + + If you need to add an OpenFlow vendor extension message for a + vendor that doesn't yet have any extension messages, then you will + also need to edit build-aux/extract-ofp-msgs. + +### Q: How do I add support for a new field or header? + +A: Add new members for your field to "struct flow" in lib/flow.h, and + add new enumerations for your new field to "enum mf_field_id" in + lib/meta-flow.h, following the existing pattern. Also, add support + to miniflow_extract() in lib/flow.c for extracting your new field + from a packet into struct miniflow. Then recompile and fix all of + the new warnings, implementing new functionality for the new field + or header as needed. (If you configure with --enable-Werror, as + described in [INSTALL.md], then it is impossible to miss any + warnings.) + + If you want kernel datapath support for your new field, you also + need to modify the kernel module for the operating systems you are + interested in. This isn't mandatory, since fields understood only + by userspace work too (with a performance penalty), so it's + reasonable to start development without it. If you implement + kernel module support for Linux, then the Linux kernel "netdev" + mailing list is the place to submit that support first; please read + up on the Linux kernel development process separately. The Windows + datapath kernel module support, on the other hand, is maintained + within the OVS tree, so patches for that can go directly to + ovs-dev. + +### Q: How do I add support for a new OpenFlow action? + +A: Add your new action to "enum ofp_raw_action_type" in + lib/ofp-actions.c, following the existing pattern. Then recompile + and fix all of the new warnings, implementing new functionality for + the new action as needed. (If you configure with --enable-Werror, + as described in [INSTALL.md], then it is impossible to miss any + warnings.) + + If you need to add an OpenFlow vendor extension action for a vendor + that doesn't yet have any extension actions, then you will also + need to edit build-aux/extract-ofp-actions. + + +Contact +------- + +bugs@openvswitch.org +http://openvswitch.org/ + +[PORTING.md]:PORTING.md +[WHY-OVS.md]:WHY-OVS.md +[INSTALL.md]:INSTALL.md +[OPENFLOW-1.1+.md]:OPENFLOW-1.1+.md +[INSTALL.DPDK.md]:INSTALL.DPDK.md diff -Nru openvswitch-2.3.1/.gitignore openvswitch-2.4.0~git20150623/.gitignore --- openvswitch-2.3.1/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,69 @@ +#*# +*.a +*.d +*.gcno +*.gcda +*.ko +*.la +*.lo +*.loT +*.mod.c +*.o +*.obj +*.exe +*.exp +*.ilk +*.lib +*.pdb +*.pyc +*.so +*.suo +**/*.sym +*~ +*,cover +.#* +.*.cmd +.*.swp +.coverage +.deps +.dirstamp +.libs +.tmp_versions +.gitattributes +/Makefile +/Makefile.in +/aclocal.m4 +/all-distfiles +/all-gitfiles +/autom4te.cache +/build-arch-stamp +/build-indep-stamp +/compile +/config.guess +/config.h +/config.h.in +/config.log +/config.status +/config.sub +/configure +/configure-stamp +/depcomp +/distfiles +/install-sh +/libtool +/manpage-check +/missing +/missing-distfiles +/package.m4 +/stamp-h1 +/_build-gcc +/_build-clang +Module.symvers +TAGS +cscope.* +tags +_debian +odp-netlink.h +OvsDpInterface.h +/.vagrant/ +testsuite.tmp.orig diff -Nru openvswitch-2.3.1/include/automake.mk openvswitch-2.4.0~git20150623/include/automake.mk --- openvswitch-2.3.1/include/automake.mk 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,11 @@ -include include/linux/automake.mk +BUILT_SOURCES += include/odp-netlink.h + +include/odp-netlink.h: datapath/linux/compat/include/linux/openvswitch.h \ + build-aux/extract-odp-netlink-h + $(AM_V_GEN)sed -f $(srcdir)/build-aux/extract-odp-netlink-h < $< > $@ +EXTRA_DIST += build-aux/extract-odp-netlink-h +CLEANFILES += include/odp-netlink.h + include include/openflow/automake.mk include include/openvswitch/automake.mk include include/sparse/automake.mk diff -Nru openvswitch-2.3.1/include/.gitignore openvswitch-2.4.0~git20150623/include/.gitignore --- openvswitch-2.3.1/include/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff -Nru openvswitch-2.3.1/include/linux/automake.mk openvswitch-2.4.0~git20150623/include/linux/automake.mk --- openvswitch-2.3.1/include/linux/automake.mk 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/linux/automake.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -noinst_HEADERS += \ - include/linux/if_ether.h \ - include/linux/openvswitch.h \ - include/linux/types.h diff -Nru openvswitch-2.3.1/include/linux/if_ether.h openvswitch-2.4.0~git20150623/include/linux/if_ether.h --- openvswitch-2.3.1/include/linux/if_ether.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/linux/if_ether.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2013 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LINUX_IF_ETHER_H -#define LINUX_IF_ETHER_H 1 - -/* On Linux, this header file just includes . - * - * On other platforms, this header file implements just enough of - * to allow to work. */ - -#if defined(HAVE_LINUX_IF_ETHER_H) || defined(__KERNEL__) -#include_next -#else /* no */ -#define ETH_ALEN 6 /* Octets in one ethernet addr */ -#endif - -#endif /* */ diff -Nru openvswitch-2.3.1/include/linux/openvswitch.h openvswitch-2.4.0~git20150623/include/linux/openvswitch.h --- openvswitch-2.3.1/include/linux/openvswitch.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/linux/openvswitch.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,615 +0,0 @@ -/* - * Copyright (c) 2007-2014 Nicira, Inc. - * - * This file is offered under your choice of two licenses: Apache 2.0 or GNU - * GPL 2.0 or later. The permission statements for each of these licenses is - * given below. You may license your modifications to this file under either - * of these licenses or both. If you wish to license your modifications under - * only one of these licenses, delete the permission text for the other - * license. - * - * ---------------------------------------------------------------------- - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ---------------------------------------------------------------------- - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA - * ---------------------------------------------------------------------- - */ - -#ifndef _LINUX_OPENVSWITCH_H -#define _LINUX_OPENVSWITCH_H 1 - -#include -#include - -/** - * struct ovs_header - header for OVS Generic Netlink messages. - * @dp_ifindex: ifindex of local port for datapath (0 to make a request not - * specific to a datapath). - * - * Attributes following the header are specific to a particular OVS Generic - * Netlink family, but all of the OVS families use this header. - */ - -struct ovs_header { - int dp_ifindex; -}; - -/* Datapaths. */ - -#define OVS_DATAPATH_FAMILY "ovs_datapath" -#define OVS_DATAPATH_MCGROUP "ovs_datapath" - -/* V2: - * - API users are expected to provide OVS_DP_ATTR_USER_FEATURES - * when creating the datapath. - */ -#define OVS_DATAPATH_VERSION 2 - -/* First OVS datapath version to support features */ -#define OVS_DP_VER_FEATURES 2 - -enum ovs_datapath_cmd { - OVS_DP_CMD_UNSPEC, - OVS_DP_CMD_NEW, - OVS_DP_CMD_DEL, - OVS_DP_CMD_GET, - OVS_DP_CMD_SET -}; - -/** - * enum ovs_datapath_attr - attributes for %OVS_DP_* commands. - * @OVS_DP_ATTR_NAME: Name of the network device that serves as the "local - * port". This is the name of the network device whose dp_ifindex is given in - * the &struct ovs_header. Always present in notifications. Required in - * %OVS_DP_NEW requests. May be used as an alternative to specifying - * dp_ifindex in other requests (with a dp_ifindex of 0). - * @OVS_DP_ATTR_UPCALL_PID: The Netlink socket in userspace that is initially - * set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on - * %OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should - * not be sent. - * @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the - * datapath. Always present in notifications. - * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the - * datapath. Always present in notifications. - * - * These attributes follow the &struct ovs_header within the Generic Netlink - * payload for %OVS_DP_* commands. - */ -enum ovs_datapath_attr { - OVS_DP_ATTR_UNSPEC, - OVS_DP_ATTR_NAME, /* name of dp_ifindex netdev */ - OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */ - OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ - OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ - OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */ - __OVS_DP_ATTR_MAX -}; - -#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1) - -/* All 64-bit integers within Netlink messages are 4-byte aligned only. */ -struct ovs_dp_stats { - __u64 n_hit; /* Number of flow table matches. */ - __u64 n_missed; /* Number of flow table misses. */ - __u64 n_lost; /* Number of misses not sent to userspace. */ - __u64 n_flows; /* Number of flows present */ -}; - -struct ovs_dp_megaflow_stats { - __u64 n_mask_hit; /* Number of masks used for flow lookups. */ - __u32 n_masks; /* Number of masks for the datapath. */ - __u32 pad0; /* Pad for future expension. */ - __u64 pad1; /* Pad for future expension. */ - __u64 pad2; /* Pad for future expension. */ -}; - -struct ovs_vport_stats { - __u64 rx_packets; /* total packets received */ - __u64 tx_packets; /* total packets transmitted */ - __u64 rx_bytes; /* total bytes received */ - __u64 tx_bytes; /* total bytes transmitted */ - __u64 rx_errors; /* bad packets received */ - __u64 tx_errors; /* packet transmit problems */ - __u64 rx_dropped; /* no space in linux buffers */ - __u64 tx_dropped; /* no space available in linux */ -}; - -/* Allow last Netlink attribute to be unaligned */ -#define OVS_DP_F_UNALIGNED (1 << 0) - -/* Allow datapath to associate multiple Netlink PIDs to each vport */ -#define OVS_DP_F_VPORT_PIDS (1 << 1) - -/* Fixed logical ports. */ -#define OVSP_LOCAL ((__u32)0) - -/* Packet transfer. */ - -#define OVS_PACKET_FAMILY "ovs_packet" -#define OVS_PACKET_VERSION 0x1 - -enum ovs_packet_cmd { - OVS_PACKET_CMD_UNSPEC, - - /* Kernel-to-user notifications. */ - OVS_PACKET_CMD_MISS, /* Flow table miss. */ - OVS_PACKET_CMD_ACTION, /* OVS_ACTION_ATTR_USERSPACE action. */ - - /* Userspace commands. */ - OVS_PACKET_CMD_EXECUTE /* Apply actions to a packet. */ -}; - -/** - * enum ovs_packet_attr - attributes for %OVS_PACKET_* commands. - * @OVS_PACKET_ATTR_PACKET: Present for all notifications. Contains the entire - * packet as received, from the start of the Ethernet header onward. For - * %OVS_PACKET_CMD_ACTION, %OVS_PACKET_ATTR_PACKET reflects changes made by - * actions preceding %OVS_ACTION_ATTR_USERSPACE, but %OVS_PACKET_ATTR_KEY is - * the flow key extracted from the packet as originally received. - * @OVS_PACKET_ATTR_KEY: Present for all notifications. Contains the flow key - * extracted from the packet as nested %OVS_KEY_ATTR_* attributes. This allows - * userspace to adapt its flow setup strategy by comparing its notion of the - * flow key against the kernel's. When used with %OVS_PACKET_CMD_EXECUTE, only - * metadata key fields (e.g. priority, skb mark) are honored. All the packet - * header fields are parsed from the packet instead. - * @OVS_PACKET_ATTR_ACTIONS: Contains actions for the packet. Used - * for %OVS_PACKET_CMD_EXECUTE. It has nested %OVS_ACTION_ATTR_* attributes. - * @OVS_PACKET_ATTR_USERDATA: Present for an %OVS_PACKET_CMD_ACTION - * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an - * %OVS_USERSPACE_ATTR_USERDATA attribute, with the same length and content - * specified there. - * - * These attributes follow the &struct ovs_header within the Generic Netlink - * payload for %OVS_PACKET_* commands. - */ -enum ovs_packet_attr { - OVS_PACKET_ATTR_UNSPEC, - OVS_PACKET_ATTR_PACKET, /* Packet data. */ - OVS_PACKET_ATTR_KEY, /* Nested OVS_KEY_ATTR_* attributes. */ - OVS_PACKET_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */ - OVS_PACKET_ATTR_USERDATA, /* OVS_ACTION_ATTR_USERSPACE arg. */ - __OVS_PACKET_ATTR_MAX -}; - -#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1) - -/* Virtual ports. */ - -#define OVS_VPORT_FAMILY "ovs_vport" -#define OVS_VPORT_MCGROUP "ovs_vport" -#define OVS_VPORT_VERSION 0x1 - -enum ovs_vport_cmd { - OVS_VPORT_CMD_UNSPEC, - OVS_VPORT_CMD_NEW, - OVS_VPORT_CMD_DEL, - OVS_VPORT_CMD_GET, - OVS_VPORT_CMD_SET -}; - -enum ovs_vport_type { - OVS_VPORT_TYPE_UNSPEC, - OVS_VPORT_TYPE_NETDEV, /* network device */ - OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ - OVS_VPORT_TYPE_GRE, /* GRE tunnel. */ - OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel */ - OVS_VPORT_TYPE_GRE64 = 104, /* GRE tunnel with 64-bit keys */ - OVS_VPORT_TYPE_LISP = 105, /* LISP tunnel */ - __OVS_VPORT_TYPE_MAX -}; - -#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1) - -/** - * enum ovs_vport_attr - attributes for %OVS_VPORT_* commands. - * @OVS_VPORT_ATTR_PORT_NO: 32-bit port number within datapath. - * @OVS_VPORT_ATTR_TYPE: 32-bit %OVS_VPORT_TYPE_* constant describing the type - * of vport. - * @OVS_VPORT_ATTR_NAME: Name of vport. For a vport based on a network device - * this is the name of the network device. Maximum length %IFNAMSIZ-1 bytes - * plus a null terminator. - * @OVS_VPORT_ATTR_OPTIONS: Vport-specific configuration information. - * @OVS_VPORT_ATTR_UPCALL_PID: The array of Netlink socket pids in userspace - * among which OVS_PACKET_CMD_MISS upcalls will be distributed for packets - * received on this port. If this is a single-element array of value 0, - * upcalls should not be sent. - * @OVS_VPORT_ATTR_STATS: A &struct ovs_vport_stats giving statistics for - * packets sent or received through the vport. - * - * These attributes follow the &struct ovs_header within the Generic Netlink - * payload for %OVS_VPORT_* commands. - * - * For %OVS_VPORT_CMD_NEW requests, the %OVS_VPORT_ATTR_TYPE and - * %OVS_VPORT_ATTR_NAME attributes are required. %OVS_VPORT_ATTR_PORT_NO is - * optional; if not specified a free port number is automatically selected. - * Whether %OVS_VPORT_ATTR_OPTIONS is required or optional depends on the type - * of vport. %OVS_VPORT_ATTR_STATS is optional and other attributes are - * ignored. - * - * For other requests, if %OVS_VPORT_ATTR_NAME is specified then it is used to - * look up the vport to operate on; otherwise dp_idx from the &struct - * ovs_header plus %OVS_VPORT_ATTR_PORT_NO determine the vport. - */ -enum ovs_vport_attr { - OVS_VPORT_ATTR_UNSPEC, - OVS_VPORT_ATTR_PORT_NO, /* u32 port number within datapath */ - OVS_VPORT_ATTR_TYPE, /* u32 OVS_VPORT_TYPE_* constant. */ - OVS_VPORT_ATTR_NAME, /* string name, up to IFNAMSIZ bytes long */ - OVS_VPORT_ATTR_OPTIONS, /* nested attributes, varies by vport type */ - OVS_VPORT_ATTR_UPCALL_PID, /* array of u32 Netlink socket PIDs for */ - /* receiving upcalls */ - OVS_VPORT_ATTR_STATS, /* struct ovs_vport_stats */ - __OVS_VPORT_ATTR_MAX -}; - -#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) - -/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels. - */ -enum { - OVS_TUNNEL_ATTR_UNSPEC, - OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */ - __OVS_TUNNEL_ATTR_MAX -}; - -#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1) - -/* Flows. */ - -#define OVS_FLOW_FAMILY "ovs_flow" -#define OVS_FLOW_MCGROUP "ovs_flow" -#define OVS_FLOW_VERSION 0x1 - -enum ovs_flow_cmd { - OVS_FLOW_CMD_UNSPEC, - OVS_FLOW_CMD_NEW, - OVS_FLOW_CMD_DEL, - OVS_FLOW_CMD_GET, - OVS_FLOW_CMD_SET -}; - -struct ovs_flow_stats { - __u64 n_packets; /* Number of matched packets. */ - __u64 n_bytes; /* Number of matched bytes. */ -}; - -enum ovs_key_attr { - OVS_KEY_ATTR_UNSPEC, - OVS_KEY_ATTR_ENCAP, /* Nested set of encapsulated attributes. */ - OVS_KEY_ATTR_PRIORITY, /* u32 skb->priority */ - OVS_KEY_ATTR_IN_PORT, /* u32 OVS dp port number */ - OVS_KEY_ATTR_ETHERNET, /* struct ovs_key_ethernet */ - OVS_KEY_ATTR_VLAN, /* be16 VLAN TCI */ - OVS_KEY_ATTR_ETHERTYPE, /* be16 Ethernet type */ - OVS_KEY_ATTR_IPV4, /* struct ovs_key_ipv4 */ - OVS_KEY_ATTR_IPV6, /* struct ovs_key_ipv6 */ - OVS_KEY_ATTR_TCP, /* struct ovs_key_tcp */ - OVS_KEY_ATTR_UDP, /* struct ovs_key_udp */ - OVS_KEY_ATTR_ICMP, /* struct ovs_key_icmp */ - OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */ - OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */ - OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ - OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */ - OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */ - OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */ - OVS_KEY_ATTR_TCP_FLAGS, /* be16 TCP flags. */ - OVS_KEY_ATTR_DP_HASH, /* u32 hash value. Value 0 indicates the hash - is not computed by the datapath. */ - OVS_KEY_ATTR_RECIRC_ID, /* u32 recirc id */ -#ifdef __KERNEL__ - /* Only used within kernel data path. */ - OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */ -#endif - /* Experimental */ - - OVS_KEY_ATTR_MPLS = 62, /* array of struct ovs_key_mpls. - * The implementation may restrict - * the accepted length of the array. */ - __OVS_KEY_ATTR_MAX -}; - -#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1) - -enum ovs_tunnel_key_attr { - OVS_TUNNEL_KEY_ATTR_ID, /* be64 Tunnel ID */ - OVS_TUNNEL_KEY_ATTR_IPV4_SRC, /* be32 src IP address. */ - OVS_TUNNEL_KEY_ATTR_IPV4_DST, /* be32 dst IP address. */ - OVS_TUNNEL_KEY_ATTR_TOS, /* u8 Tunnel IP ToS. */ - OVS_TUNNEL_KEY_ATTR_TTL, /* u8 Tunnel IP TTL. */ - OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT, /* No argument, set DF. */ - OVS_TUNNEL_KEY_ATTR_CSUM, /* No argument. CSUM packet. */ - __OVS_TUNNEL_KEY_ATTR_MAX -}; - -#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1) - -/** - * enum ovs_frag_type - IPv4 and IPv6 fragment type - * @OVS_FRAG_TYPE_NONE: Packet is not a fragment. - * @OVS_FRAG_TYPE_FIRST: Packet is a fragment with offset 0. - * @OVS_FRAG_TYPE_LATER: Packet is a fragment with nonzero offset. - * - * Used as the @ipv4_frag in &struct ovs_key_ipv4 and as @ipv6_frag &struct - * ovs_key_ipv6. - */ -enum ovs_frag_type { - OVS_FRAG_TYPE_NONE, - OVS_FRAG_TYPE_FIRST, - OVS_FRAG_TYPE_LATER, - __OVS_FRAG_TYPE_MAX -}; - -#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1) - -struct ovs_key_ethernet { - __u8 eth_src[ETH_ALEN]; - __u8 eth_dst[ETH_ALEN]; -}; - -struct ovs_key_mpls { - __be32 mpls_lse; -}; - -struct ovs_key_ipv4 { - __be32 ipv4_src; - __be32 ipv4_dst; - __u8 ipv4_proto; - __u8 ipv4_tos; - __u8 ipv4_ttl; - __u8 ipv4_frag; /* One of OVS_FRAG_TYPE_*. */ -}; - -struct ovs_key_ipv6 { - __be32 ipv6_src[4]; - __be32 ipv6_dst[4]; - __be32 ipv6_label; /* 20-bits in least-significant bits. */ - __u8 ipv6_proto; - __u8 ipv6_tclass; - __u8 ipv6_hlimit; - __u8 ipv6_frag; /* One of OVS_FRAG_TYPE_*. */ -}; - -struct ovs_key_tcp { - __be16 tcp_src; - __be16 tcp_dst; -}; - -struct ovs_key_udp { - __be16 udp_src; - __be16 udp_dst; -}; - -struct ovs_key_sctp { - __be16 sctp_src; - __be16 sctp_dst; -}; - -struct ovs_key_icmp { - __u8 icmp_type; - __u8 icmp_code; -}; - -struct ovs_key_icmpv6 { - __u8 icmpv6_type; - __u8 icmpv6_code; -}; - -struct ovs_key_arp { - __be32 arp_sip; - __be32 arp_tip; - __be16 arp_op; - __u8 arp_sha[ETH_ALEN]; - __u8 arp_tha[ETH_ALEN]; -}; - -struct ovs_key_nd { - __u32 nd_target[4]; - __u8 nd_sll[ETH_ALEN]; - __u8 nd_tll[ETH_ALEN]; -}; - -/** - * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands. - * @OVS_FLOW_ATTR_KEY: Nested %OVS_KEY_ATTR_* attributes specifying the flow - * key. Always present in notifications. Required for all requests (except - * dumps). - * @OVS_FLOW_ATTR_ACTIONS: Nested %OVS_ACTION_ATTR_* attributes specifying - * the actions to take for packets that match the key. Always present in - * notifications. Required for %OVS_FLOW_CMD_NEW requests, optional for - * %OVS_FLOW_CMD_SET requests. An %OVS_FLOW_CMD_SET without - * %OVS_FLOW_ATTR_ACTIONS will not modify the actions. To clear the actions, - * an %OVS_FLOW_ATTR_ACTIONS without any nested attributes must be given. - * @OVS_FLOW_ATTR_STATS: &struct ovs_flow_stats giving statistics for this - * flow. Present in notifications if the stats would be nonzero. Ignored in - * requests. - * @OVS_FLOW_ATTR_TCP_FLAGS: An 8-bit value giving the OR'd value of all of the - * TCP flags seen on packets in this flow. Only present in notifications for - * TCP flows, and only if it would be nonzero. Ignored in requests. - * @OVS_FLOW_ATTR_USED: A 64-bit integer giving the time, in milliseconds on - * the system monotonic clock, at which a packet was last processed for this - * flow. Only present in notifications if a packet has been processed for this - * flow. Ignored in requests. - * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the - * last-used time, accumulated TCP flags, and statistics for this flow. - * Otherwise ignored in requests. Never present in notifications. - * @OVS_FLOW_ATTR_MASK: Nested %OVS_KEY_ATTR_* attributes specifying the - * mask bits for wildcarded flow match. Mask bit value '1' specifies exact - * match with corresponding flow key bit, while mask bit value '0' specifies - * a wildcarded match. Omitting attribute is treated as wildcarding all - * corresponding fields. Optional for all requests. If not present, - * all flow key bits are exact match bits. - * - * These attributes follow the &struct ovs_header within the Generic Netlink - * payload for %OVS_FLOW_* commands. - */ -enum ovs_flow_attr { - OVS_FLOW_ATTR_UNSPEC, - OVS_FLOW_ATTR_KEY, /* Sequence of OVS_KEY_ATTR_* attributes. */ - OVS_FLOW_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */ - OVS_FLOW_ATTR_STATS, /* struct ovs_flow_stats. */ - OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */ - OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */ - OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */ - OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ - __OVS_FLOW_ATTR_MAX -}; - -#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1) - -/** - * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action. - * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with - * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of - * %UINT32_MAX samples all packets and intermediate values sample intermediate - * fractions of packets. - * @OVS_SAMPLE_ATTR_ACTIONS: Set of actions to execute in sampling event. - * Actions are passed as nested attributes. - * - * Executes the specified actions with the given probability on a per-packet - * basis. - */ -enum ovs_sample_attr { - OVS_SAMPLE_ATTR_UNSPEC, - OVS_SAMPLE_ATTR_PROBABILITY, /* u32 number */ - OVS_SAMPLE_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */ - __OVS_SAMPLE_ATTR_MAX, -}; - -#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1) - -/** - * enum ovs_userspace_attr - Attributes for %OVS_ACTION_ATTR_USERSPACE action. - * @OVS_USERSPACE_ATTR_PID: u32 Netlink PID to which the %OVS_PACKET_CMD_ACTION - * message should be sent. Required. - * @OVS_USERSPACE_ATTR_USERDATA: If present, its variable-length argument is - * copied to the %OVS_PACKET_CMD_ACTION message as %OVS_PACKET_ATTR_USERDATA. - */ -enum ovs_userspace_attr { - OVS_USERSPACE_ATTR_UNSPEC, - OVS_USERSPACE_ATTR_PID, /* u32 Netlink PID to receive upcalls. */ - OVS_USERSPACE_ATTR_USERDATA, /* Optional user-specified cookie. */ - __OVS_USERSPACE_ATTR_MAX -}; - -#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1) - -/** - * struct ovs_action_push_mpls - %OVS_ACTION_ATTR_PUSH_MPLS action argument. - * @mpls_lse: MPLS label stack entry to push. - * @mpls_ethertype: Ethertype to set in the encapsulating ethernet frame. - * - * The only values @mpls_ethertype should ever be given are %ETH_P_MPLS_UC and - * %ETH_P_MPLS_MC, indicating MPLS unicast or multicast. Other are rejected. - */ -struct ovs_action_push_mpls { - __be32 mpls_lse; - __be16 mpls_ethertype; /* Either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC */ -}; - -/** - * struct ovs_action_push_vlan - %OVS_ACTION_ATTR_PUSH_VLAN action argument. - * @vlan_tpid: Tag protocol identifier (TPID) to push. - * @vlan_tci: Tag control identifier (TCI) to push. The CFI bit must be set - * (but it will not be set in the 802.1Q header that is pushed). - * - * The @vlan_tpid value is typically %ETH_P_8021Q. The only acceptable TPID - * values are those that the kernel module also parses as 802.1Q headers, to - * prevent %OVS_ACTION_ATTR_PUSH_VLAN followed by %OVS_ACTION_ATTR_POP_VLAN - * from having surprising results. - */ -struct ovs_action_push_vlan { - __be16 vlan_tpid; /* 802.1Q TPID. */ - __be16 vlan_tci; /* 802.1Q TCI (VLAN ID and priority). */ -}; - -/* Data path hash algorithm for computing Datapath hash. - * - * The algorithm type only specifies the fields in a flow - * will be used as part of the hash. Each datapath is free - * to use its own hash algorithm. The hash value will be - * opaque to the user space daemon. - */ -enum ovs_hash_alg { - OVS_HASH_ALG_L4, -}; -/* - * struct ovs_action_hash - %OVS_ACTION_ATTR_HASH action argument. - * @hash_alg: Algorithm used to compute hash prior to recirculation. - * @hash_basis: basis used for computing hash. - */ -struct ovs_action_hash { - uint32_t hash_alg; /* One of ovs_hash_alg. */ - uint32_t hash_basis; -}; - -/** - * enum ovs_action_attr - Action types. - * - * @OVS_ACTION_ATTR_OUTPUT: Output packet to port. - * @OVS_ACTION_ATTR_USERSPACE: Send packet to userspace according to nested - * %OVS_USERSPACE_ATTR_* attributes. - * @OVS_ACTION_ATTR_PUSH_VLAN: Push a new outermost 802.1Q header onto the - * packet. - * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet. - * @OVS_ACTION_ATTR_SAMPLE: Probabilitically executes actions, as specified in - * the nested %OVS_SAMPLE_ATTR_* attributes. - * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The - * single nested %OVS_KEY_ATTR_* attribute specifies a header to modify and its - * value. - * @OVS_ACTION_RECIRC: Recirculate within the data path. - * @OVS_ACTION_HASH: Compute and set flow hash value. - * @OVS_ACTION_ATTR_PUSH_MPLS: Push a new MPLS label stack entry onto the - * top of the packets MPLS label stack. Set the ethertype of the - * encapsulating frame to either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC to - * indicate the new packet contents. - * @OVS_ACTION_ATTR_POP_MPLS: Pop an MPLS label stack entry off of the - * packet's MPLS label stack. Set the encapsulating frame's ethertype to - * indicate the new packet contents. This could potentially still be - * %ETH_P_MPLS if the resulting MPLS label stack is not empty. If there - * is no MPLS label stack, as determined by ethertype, no action is taken. - * - * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all - * fields within a header are modifiable, e.g. the IPv4 protocol and fragment - * type may not be changed. - */ - -enum ovs_action_attr { - OVS_ACTION_ATTR_UNSPEC, - OVS_ACTION_ATTR_OUTPUT, /* u32 port number. */ - OVS_ACTION_ATTR_USERSPACE, /* Nested OVS_USERSPACE_ATTR_*. */ - OVS_ACTION_ATTR_SET, /* One nested OVS_KEY_ATTR_*. */ - OVS_ACTION_ATTR_PUSH_VLAN, /* struct ovs_action_push_vlan. */ - OVS_ACTION_ATTR_POP_VLAN, /* No argument. */ - OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */ - OVS_ACTION_ATTR_RECIRC, /* u32 recirc_id. */ - OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */ - OVS_ACTION_ATTR_PUSH_MPLS, /* struct ovs_action_push_mpls. */ - OVS_ACTION_ATTR_POP_MPLS, /* __be16 ethertype. */ - __OVS_ACTION_ATTR_MAX -}; - -#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1) - -#endif /* _LINUX_OPENVSWITCH_H */ diff -Nru openvswitch-2.3.1/include/linux/types.h openvswitch-2.4.0~git20150623/include/linux/types.h --- openvswitch-2.3.1/include/linux/types.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/linux/types.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2011 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LINUX_TYPES_H -#define LINUX_TYPES_H 1 - -/* On Linux, this header file just includes . - * - * On other platforms, this header file implements just enough of - * to allow to work, that is, it defines - * the __u and __be types. */ - -#ifdef __KERNEL__ -#include_next -#elif defined(HAVE_LINUX_TYPES_H) -/* With some combinations of kernel and userspace headers, including both - * and only works if you do so in that order, so - * force it. */ - -#ifdef __CHECKER__ -#define __CHECK_ENDIAN__ -#endif - -#include -#include_next -#else /* no */ -#include - -#ifdef __CHECKER__ -#define __bitwise__ __attribute__((bitwise)) -#else -#define __bitwise__ -#endif - -typedef uint8_t __u8; -typedef uint16_t __u16; -typedef uint32_t __u32; -typedef uint64_t __u64; - -typedef uint16_t __bitwise__ __be16; -typedef uint32_t __bitwise__ __be32; -typedef uint64_t __bitwise__ __be64; -#endif /* no */ - -#ifndef _WIN32 -typedef __u32 HANDLE; -#endif - -#endif /* */ diff -Nru openvswitch-2.3.1/include/openflow/automake.mk openvswitch-2.4.0~git20150623/include/openflow/automake.mk --- openvswitch-2.3.1/include/openflow/automake.mk 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,10 +1,13 @@ -noinst_HEADERS += \ +openflowincludedir = $(includedir)/openflow +openflowinclude_HEADERS = \ + include/openflow/netronome-ext.h \ include/openflow/nicira-ext.h \ include/openflow/openflow-1.0.h \ include/openflow/openflow-1.1.h \ include/openflow/openflow-1.2.h \ include/openflow/openflow-1.3.h \ include/openflow/openflow-1.4.h \ + include/openflow/openflow-1.5.h \ include/openflow/openflow-common.h \ include/openflow/openflow.h @@ -12,42 +15,13 @@ SUFFIXES += .h .hstamp .h.hstamp: - $(run_python) $(srcdir)/build-aux/check-structs -I$(srcdir)/include $< + $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/check-structs -I$(srcdir)/include $< && \ touch $@ -HSTAMP_FILES = \ - include/openflow/nicira-ext.hstamp \ - include/openflow/openflow-1.0.hstamp \ - include/openflow/openflow-1.1.hstamp \ - include/openflow/openflow-1.2.hstamp \ - include/openflow/openflow-1.3.hstamp \ - include/openflow/openflow-1.4.hstamp \ - include/openflow/openflow-common.hstamp \ - include/openflow/openflow.hstamp +HSTAMP_FILES = $(openflowinclude_HEADERS:.h=.hstamp) CLEANFILES += $(HSTAMP_FILES) ALL_LOCAL += $(HSTAMP_FILES) -$(HSTAMP_FILES): build-aux/check-structs - -include/openflow/openflow-1.0.hstamp: \ - include/openflow/openflow-common.h -include/openflow/openflow-1.1.hstamp: \ - include/openflow/openflow-common.h -include/openflow/openflow-1.2.hstamp: \ - include/openflow/openflow-common.h \ - include/openflow/openflow-1.1.h -include/openflow/openflow-1.3.hstamp: \ - include/openflow/openflow-common.h \ - include/openflow/openflow-1.1.h \ - include/openflow/openflow-1.2.h -include/openflow/openflow-1.4.hstamp: \ - include/openflow/openflow-1.4.h -include/openflow/nicira-ext.hstamp: \ - include/openflow/openflow.h \ - include/openflow/openflow-common.h \ - include/openflow/openflow-1.0.h \ - include/openflow/openflow-1.1.h \ - include/openflow/openflow-1.2.h \ - include/openflow/openflow-1.3.h +$(HSTAMP_FILES): build-aux/check-structs $(openflowinclude_HEADERS) endif EXTRA_DIST += build-aux/check-structs diff -Nru openvswitch-2.3.1/include/openflow/.gitignore openvswitch-2.4.0~git20150623/include/openflow/.gitignore --- openvswitch-2.3.1/include/openflow/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1 @@ +*.hstamp diff -Nru openvswitch-2.3.1/include/openflow/netronome-ext.h openvswitch-2.4.0~git20150623/include/openflow/netronome-ext.h --- openvswitch-2.3.1/include/openflow/netronome-ext.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/netronome-ext.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014 Netronome. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENFLOW_NETRONOME_EXT_H +#define OPENFLOW_NETRONOME_EXT_H 1 + +#include "openflow/openflow.h" +#include "openvswitch/types.h" + +/* The following vendor extension, proposed by Netronome, is not yet + * standardized, so they are not included in openflow.h. It may + * be suitable for standardization */ + + +/* Netronome enhanced select group */ + +enum ntr_group_mod_subtype { + NTRT_SELECTION_METHOD = 1, +}; + +#define NTR_MAX_SELECTION_METHOD_LEN 16 + +struct ntr_group_prop_selection_method { + ovs_be16 type; /* OFPGPT15_EXPERIMENTER. */ + ovs_be16 length; /* Length in bytes of this property + * excluding trailing padding. */ + ovs_be32 experimenter; /* NTR_VENDOR_ID. */ + ovs_be32 exp_type; /* NTRT_SELECTION_METHOD. */ + ovs_be32 pad; + char selection_method[NTR_MAX_SELECTION_METHOD_LEN]; + /* Null-terminated */ + ovs_be64 selection_method_param; /* Non-Field parameter for + * bucket selection. */ + + /* Followed by: + * - Exactly (length - 40) (possibly 0) bytes containing OXM TLVs, then + * - Exactly ((length + 7)/8*8 - length) (between 0 and 7) bytes of + * all-zero bytes + * In summary, ntr_group_prop_selection_method is padded as needed, + * to make its overall size a multiple of 8, to preserve alignment + * in structures using it. + */ + /* uint8_t field_array[0]; */ /* Zero or more fields encoded as + * OXM TLVs where the has_mask bit must + * be zero and the value it specifies is + * a mask to apply to packet fields and + * then input them to the selection + * method of a select group. */ + /* uint8_t pad2[0]; */ +}; +OFP_ASSERT(sizeof(struct ntr_group_prop_selection_method) == 40); + +#endif /* openflow/netronome-ext.h */ diff -Nru openvswitch-2.3.1/include/openflow/nicira-ext.h openvswitch-2.4.0~git20150623/include/openflow/nicira-ext.h --- openvswitch-2.3.1/include/openflow/nicira-ext.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/nicira-ext.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ #ifndef OPENFLOW_NICIRA_EXT_H #define OPENFLOW_NICIRA_EXT_H 1 -#include "openflow/openflow.h" -#include "openvswitch/types.h" +#include +#include /* The following vendor extensions, proposed by Nicira, are not yet * standardized, so they are not included in openflow.h. Some of them may be @@ -279,870 +279,6 @@ }; OFP_ASSERT(sizeof(struct nx_async_config) == 24); -/* Nicira vendor flow actions. */ - -enum nx_action_subtype { - NXAST_SNAT__OBSOLETE, /* No longer used. */ - NXAST_RESUBMIT, /* struct nx_action_resubmit */ - NXAST_SET_TUNNEL, /* struct nx_action_set_tunnel */ - NXAST_DROP_SPOOFED_ARP__OBSOLETE, - NXAST_SET_QUEUE, /* struct nx_action_set_queue */ - NXAST_POP_QUEUE, /* struct nx_action_pop_queue */ - NXAST_REG_MOVE, /* struct nx_action_reg_move */ - NXAST_REG_LOAD, /* struct nx_action_reg_load */ - NXAST_NOTE, /* struct nx_action_note */ - NXAST_SET_TUNNEL64, /* struct nx_action_set_tunnel64 */ - NXAST_MULTIPATH, /* struct nx_action_multipath */ - NXAST_AUTOPATH__OBSOLETE, /* No longer used. */ - NXAST_BUNDLE, /* struct nx_action_bundle */ - NXAST_BUNDLE_LOAD, /* struct nx_action_bundle */ - NXAST_RESUBMIT_TABLE, /* struct nx_action_resubmit */ - NXAST_OUTPUT_REG, /* struct nx_action_output_reg */ - NXAST_LEARN, /* struct nx_action_learn */ - NXAST_EXIT, /* struct nx_action_header */ - NXAST_DEC_TTL, /* struct nx_action_header */ - NXAST_FIN_TIMEOUT, /* struct nx_action_fin_timeout */ - NXAST_CONTROLLER, /* struct nx_action_controller */ - NXAST_DEC_TTL_CNT_IDS, /* struct nx_action_cnt_ids */ - NXAST_WRITE_METADATA, /* struct nx_action_write_metadata */ - NXAST_PUSH_MPLS, /* struct nx_action_push_mpls */ - NXAST_POP_MPLS, /* struct nx_action_pop_mpls */ - NXAST_SET_MPLS_TTL, /* struct nx_action_ttl */ - NXAST_DEC_MPLS_TTL, /* struct nx_action_header */ - NXAST_STACK_PUSH, /* struct nx_action_stack */ - NXAST_STACK_POP, /* struct nx_action_stack */ - NXAST_SAMPLE, /* struct nx_action_sample */ - NXAST_SET_MPLS_LABEL, /* struct nx_action_ttl */ - NXAST_SET_MPLS_TC, /* struct nx_action_ttl */ -}; - -/* Header for Nicira-defined actions. */ -struct nx_action_header { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_*. */ - uint8_t pad[6]; -}; -OFP_ASSERT(sizeof(struct nx_action_header) == 16); - -/* Action structures for NXAST_RESUBMIT and NXAST_RESUBMIT_TABLE. - * - * These actions search one of the switch's flow tables: - * - * - For NXAST_RESUBMIT_TABLE only, if the 'table' member is not 255, then - * it specifies the table to search. - * - * - Otherwise (for NXAST_RESUBMIT_TABLE with a 'table' of 255, or for - * NXAST_RESUBMIT regardless of 'table'), it searches the current flow - * table, that is, the OpenFlow flow table that contains the flow from - * which this action was obtained. If this action did not come from a - * flow table (e.g. it came from an OFPT_PACKET_OUT message), then table 0 - * is the current table. - * - * The flow table lookup uses a flow that may be slightly modified from the - * original lookup: - * - * - For NXAST_RESUBMIT, the 'in_port' member of struct nx_action_resubmit - * is used as the flow's in_port. - * - * - For NXAST_RESUBMIT_TABLE, if the 'in_port' member is not OFPP_IN_PORT, - * then its value is used as the flow's in_port. Otherwise, the original - * in_port is used. - * - * - If actions that modify the flow (e.g. OFPAT_SET_VLAN_VID) precede the - * resubmit action, then the flow is updated with the new values. - * - * Following the lookup, the original in_port is restored. - * - * If the modified flow matched in the flow table, then the corresponding - * actions are executed. Afterward, actions following the resubmit in the - * original set of actions, if any, are executed; any changes made to the - * packet (e.g. changes to VLAN) by secondary actions persist when those - * actions are executed, although the original in_port is restored. - * - * Resubmit actions may be used any number of times within a set of actions. - * - * Resubmit actions may nest to an implementation-defined depth. Beyond this - * implementation-defined depth, further resubmit actions are simply ignored. - * - * NXAST_RESUBMIT ignores 'table' and 'pad'. NXAST_RESUBMIT_TABLE requires - * 'pad' to be all-bits-zero. - * - * Open vSwitch 1.0.1 and earlier did not support recursion. Open vSwitch - * before 1.2.90 did not support NXAST_RESUBMIT_TABLE. - */ -struct nx_action_resubmit { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_RESUBMIT. */ - ovs_be16 in_port; /* New in_port for checking flow table. */ - uint8_t table; /* NXAST_RESUBMIT_TABLE: table to use. */ - uint8_t pad[3]; -}; -OFP_ASSERT(sizeof(struct nx_action_resubmit) == 16); - -/* Action structure for NXAST_SET_TUNNEL. - * - * Sets the encapsulating tunnel ID to a 32-bit value. The most-significant 32 - * bits of the tunnel ID are set to 0. */ -struct nx_action_set_tunnel { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_SET_TUNNEL. */ - uint8_t pad[2]; - ovs_be32 tun_id; /* Tunnel ID. */ -}; -OFP_ASSERT(sizeof(struct nx_action_set_tunnel) == 16); - -/* Action structure for NXAST_SET_TUNNEL64. - * - * Sets the encapsulating tunnel ID to a 64-bit value. */ -struct nx_action_set_tunnel64 { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 24. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_SET_TUNNEL64. */ - uint8_t pad[6]; - ovs_be64 tun_id; /* Tunnel ID. */ -}; -OFP_ASSERT(sizeof(struct nx_action_set_tunnel64) == 24); - -/* Action structure for NXAST_SET_QUEUE. - * - * Set the queue that should be used when packets are output. This is similar - * to the OpenFlow OFPAT_ENQUEUE action, but does not take the output port as - * an argument. This allows the queue to be defined before the port is - * known. */ -struct nx_action_set_queue { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_SET_QUEUE. */ - uint8_t pad[2]; - ovs_be32 queue_id; /* Where to enqueue packets. */ -}; -OFP_ASSERT(sizeof(struct nx_action_set_queue) == 16); - -/* Action structure for NXAST_POP_QUEUE. - * - * Restores the queue to the value it was before any NXAST_SET_QUEUE actions - * were used. Only the original queue can be restored this way; no stack is - * maintained. */ -struct nx_action_pop_queue { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_POP_QUEUE. */ - uint8_t pad[6]; -}; -OFP_ASSERT(sizeof(struct nx_action_pop_queue) == 16); - -/* Action structure for NXAST_REG_MOVE. - * - * Copies src[src_ofs:src_ofs+n_bits] to dst[dst_ofs:dst_ofs+n_bits], where - * a[b:c] denotes the bits within 'a' numbered 'b' through 'c' (not including - * bit 'c'). Bit numbering starts at 0 for the least-significant bit, 1 for - * the next most significant bit, and so on. - * - * 'src' and 'dst' are nxm_header values with nxm_hasmask=0. (It doesn't make - * sense to use nxm_hasmask=1 because the action does not do any kind of - * matching; it uses the actual value of a field.) - * - * The following nxm_header values are potentially acceptable as 'src': - * - * - NXM_OF_IN_PORT - * - NXM_OF_ETH_DST - * - NXM_OF_ETH_SRC - * - NXM_OF_ETH_TYPE - * - NXM_OF_VLAN_TCI - * - NXM_OF_IP_TOS - * - NXM_OF_IP_PROTO - * - NXM_OF_IP_SRC - * - NXM_OF_IP_DST - * - NXM_OF_TCP_SRC - * - NXM_OF_TCP_DST - * - NXM_OF_UDP_SRC - * - NXM_OF_UDP_DST - * - NXM_OF_ICMP_TYPE - * - NXM_OF_ICMP_CODE - * - NXM_OF_ARP_OP - * - NXM_OF_ARP_SPA - * - NXM_OF_ARP_TPA - * - NXM_NX_TUN_ID - * - NXM_NX_ARP_SHA - * - NXM_NX_ARP_THA - * - NXM_NX_ICMPV6_TYPE - * - NXM_NX_ICMPV6_CODE - * - NXM_NX_ND_SLL - * - NXM_NX_ND_TLL - * - NXM_NX_REG(idx) for idx in the switch's accepted range. - * - NXM_NX_PKT_MARK - * - NXM_NX_TUN_IPV4_SRC - * - NXM_NX_TUN_IPV4_DST - * - * The following nxm_header values are potentially acceptable as 'dst': - * - * - NXM_OF_ETH_DST - * - NXM_OF_ETH_SRC - * - NXM_OF_IP_TOS - * - NXM_OF_IP_SRC - * - NXM_OF_IP_DST - * - NXM_OF_TCP_SRC - * - NXM_OF_TCP_DST - * - NXM_OF_UDP_SRC - * - NXM_OF_UDP_DST - * - NXM_NX_ARP_SHA - * - NXM_NX_ARP_THA - * - NXM_OF_ARP_OP - * - NXM_OF_ARP_SPA - * - NXM_OF_ARP_TPA - * Modifying any of the above fields changes the corresponding packet - * header. - * - * - NXM_OF_IN_PORT - * - * - NXM_NX_REG(idx) for idx in the switch's accepted range. - * - * - NXM_NX_PKT_MARK - * - * - NXM_OF_VLAN_TCI. Modifying this field's value has side effects on the - * packet's 802.1Q header. Setting a value with CFI=0 removes the 802.1Q - * header (if any), ignoring the other bits. Setting a value with CFI=1 - * adds or modifies the 802.1Q header appropriately, setting the TCI field - * to the field's new value (with the CFI bit masked out). - * - * - NXM_NX_TUN_ID, NXM_NX_TUN_IPV4_SRC, NXM_NX_TUN_IPV4_DST. Modifying - * any of these values modifies the corresponding tunnel header field used - * for the packet's next tunnel encapsulation, if allowed by the - * configuration of the output tunnel port. - * - * A given nxm_header value may be used as 'src' or 'dst' only on a flow whose - * nx_match satisfies its prerequisites. For example, NXM_OF_IP_TOS may be - * used only if the flow's nx_match includes an nxm_entry that specifies - * nxm_type=NXM_OF_ETH_TYPE, nxm_hasmask=0, and nxm_value=0x0800. - * - * The switch will reject actions for which src_ofs+n_bits is greater than the - * width of 'src' or dst_ofs+n_bits is greater than the width of 'dst' with - * error type OFPET_BAD_ACTION, code OFPBAC_BAD_ARGUMENT. - * - * This action behaves properly when 'src' overlaps with 'dst', that is, it - * behaves as if 'src' were copied out to a temporary buffer, then the - * temporary buffer copied to 'dst'. - */ -struct nx_action_reg_move { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 24. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_REG_MOVE. */ - ovs_be16 n_bits; /* Number of bits. */ - ovs_be16 src_ofs; /* Starting bit offset in source. */ - ovs_be16 dst_ofs; /* Starting bit offset in destination. */ - ovs_be32 src; /* Source register. */ - ovs_be32 dst; /* Destination register. */ -}; -OFP_ASSERT(sizeof(struct nx_action_reg_move) == 24); - -/* Action structure for NXAST_REG_LOAD. - * - * Copies value[0:n_bits] to dst[ofs:ofs+n_bits], where a[b:c] denotes the bits - * within 'a' numbered 'b' through 'c' (not including bit 'c'). Bit numbering - * starts at 0 for the least-significant bit, 1 for the next most significant - * bit, and so on. - * - * 'dst' is an nxm_header with nxm_hasmask=0. See the documentation for - * NXAST_REG_MOVE, above, for the permitted fields and for the side effects of - * loading them. - * - * The 'ofs' and 'n_bits' fields are combined into a single 'ofs_nbits' field - * to avoid enlarging the structure by another 8 bytes. To allow 'n_bits' to - * take a value between 1 and 64 (inclusive) while taking up only 6 bits, it is - * also stored as one less than its true value: - * - * 15 6 5 0 - * +------------------------------+------------------+ - * | ofs | n_bits - 1 | - * +------------------------------+------------------+ - * - * The switch will reject actions for which ofs+n_bits is greater than the - * width of 'dst', or in which any bits in 'value' with value 2**n_bits or - * greater are set to 1, with error type OFPET_BAD_ACTION, code - * OFPBAC_BAD_ARGUMENT. - */ -struct nx_action_reg_load { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 24. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_REG_LOAD. */ - ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ - ovs_be32 dst; /* Destination register. */ - ovs_be64 value; /* Immediate value. */ -}; -OFP_ASSERT(sizeof(struct nx_action_reg_load) == 24); - -/* Action structure for NXAST_STACK_PUSH and NXAST_STACK_POP. - * - * Pushes (or pops) field[offset: offset + n_bits] to (or from) - * top of the stack. - */ -struct nx_action_stack { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_STACK_PUSH or NXAST_STACK_POP. */ - ovs_be16 offset; /* Bit offset into the field. */ - ovs_be32 field; /* The field used for push or pop. */ - ovs_be16 n_bits; /* (n_bits + 1) bits of the field. */ - uint8_t zero[6]; /* Reserved, must be zero. */ -}; -OFP_ASSERT(sizeof(struct nx_action_stack) == 24); - -/* Action structure for NXAST_NOTE. - * - * This action has no effect. It is variable length. The switch does not - * attempt to interpret the user-defined 'note' data in any way. A controller - * can use this action to attach arbitrary metadata to a flow. - * - * This action might go away in the future. - */ -struct nx_action_note { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* A multiple of 8, but at least 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_NOTE. */ - uint8_t note[6]; /* Start of user-defined data. */ - /* Possibly followed by additional user-defined data. */ -}; -OFP_ASSERT(sizeof(struct nx_action_note) == 16); - -/* Action structure for NXAST_MULTIPATH. - * - * This action performs the following steps in sequence: - * - * 1. Hashes the fields designated by 'fields', one of NX_HASH_FIELDS_*. - * Refer to the definition of "enum nx_mp_fields" for details. - * - * The 'basis' value is used as a universal hash parameter, that is, - * different values of 'basis' yield different hash functions. The - * particular universal hash function used is implementation-defined. - * - * The hashed fields' values are drawn from the current state of the - * flow, including all modifications that have been made by actions up to - * this point. - * - * 2. Applies the multipath link choice algorithm specified by 'algorithm', - * one of NX_MP_ALG_*. Refer to the definition of "enum nx_mp_algorithm" - * for details. - * - * The output of the algorithm is 'link', an unsigned integer less than - * or equal to 'max_link'. - * - * Some algorithms use 'arg' as an additional argument. - * - * 3. Stores 'link' in dst[ofs:ofs+n_bits]. The format and semantics of - * 'dst' and 'ofs_nbits' are similar to those for the NXAST_REG_LOAD - * action. - * - * The switch will reject actions that have an unknown 'fields', or an unknown - * 'algorithm', or in which ofs+n_bits is greater than the width of 'dst', or - * in which 'max_link' is greater than or equal to 2**n_bits, with error type - * OFPET_BAD_ACTION, code OFPBAC_BAD_ARGUMENT. - */ -struct nx_action_multipath { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 32. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_MULTIPATH. */ - - /* What fields to hash and how. */ - ovs_be16 fields; /* One of NX_HASH_FIELDS_*. */ - ovs_be16 basis; /* Universal hash parameter. */ - ovs_be16 pad0; - - /* Multipath link choice algorithm to apply to hash value. */ - ovs_be16 algorithm; /* One of NX_MP_ALG_*. */ - ovs_be16 max_link; /* Number of output links, minus 1. */ - ovs_be32 arg; /* Algorithm-specific argument. */ - ovs_be16 pad1; - - /* Where to store the result. */ - ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ - ovs_be32 dst; /* Destination. */ -}; -OFP_ASSERT(sizeof(struct nx_action_multipath) == 32); - -/* NXAST_MULTIPATH: Multipath link choice algorithm to apply. - * - * In the descriptions below, 'n_links' is max_link + 1. */ -enum nx_mp_algorithm { - /* link = hash(flow) % n_links. - * - * Redistributes all traffic when n_links changes. O(1) performance. See - * RFC 2992. - * - * Use UINT16_MAX for max_link to get a raw hash value. */ - NX_MP_ALG_MODULO_N, - - /* link = hash(flow) / (MAX_HASH / n_links). - * - * Redistributes between one-quarter and one-half of traffic when n_links - * changes. O(1) performance. See RFC 2992. - */ - NX_MP_ALG_HASH_THRESHOLD, - - /* for i in [0,n_links): - * weights[i] = hash(flow, i) - * link = { i such that weights[i] >= weights[j] for all j != i } - * - * Redistributes 1/n_links of traffic when n_links changes. O(n_links) - * performance. If n_links is greater than a threshold (currently 64, but - * subject to change), Open vSwitch will substitute another algorithm - * automatically. See RFC 2992. */ - NX_MP_ALG_HRW, /* Highest Random Weight. */ - - /* i = 0 - * repeat: - * i = i + 1 - * link = hash(flow, i) % arg - * while link > max_link - * - * Redistributes 1/n_links of traffic when n_links changes. O(1) - * performance when arg/max_link is bounded by a constant. - * - * Redistributes all traffic when arg changes. - * - * arg must be greater than max_link and for best performance should be no - * more than approximately max_link * 2. If arg is outside the acceptable - * range, Open vSwitch will automatically substitute the least power of 2 - * greater than max_link. - * - * This algorithm is specific to Open vSwitch. - */ - NX_MP_ALG_ITER_HASH /* Iterative Hash. */ -}; - -/* Action structure for NXAST_LEARN. - * - * This action adds or modifies a flow in an OpenFlow table, similar to - * OFPT_FLOW_MOD with OFPFC_MODIFY_STRICT as 'command'. The new flow has the - * specified idle timeout, hard timeout, priority, cookie, and flags. The new - * flow's match criteria and actions are built by applying each of the series - * of flow_mod_spec elements included as part of the action. - * - * A flow_mod_spec starts with a 16-bit header. A header that is all-bits-0 is - * a no-op used for padding the action as a whole to a multiple of 8 bytes in - * length. Otherwise, the flow_mod_spec can be thought of as copying 'n_bits' - * bits from a source to a destination. In this case, the header contains - * multiple fields: - * - * 15 14 13 12 11 10 0 - * +------+---+------+---------------------------------+ - * | 0 |src| dst | n_bits | - * +------+---+------+---------------------------------+ - * - * The meaning and format of a flow_mod_spec depends on 'src' and 'dst'. The - * following table summarizes the meaning of each possible combination. - * Details follow the table: - * - * src dst meaning - * --- --- ---------------------------------------------------------- - * 0 0 Add match criteria based on value in a field. - * 1 0 Add match criteria based on an immediate value. - * 0 1 Add NXAST_REG_LOAD action to copy field into a different field. - * 1 1 Add NXAST_REG_LOAD action to load immediate value into a field. - * 0 2 Add OFPAT_OUTPUT action to output to port from specified field. - * All other combinations are undefined and not allowed. - * - * The flow_mod_spec header is followed by a source specification and a - * destination specification. The format and meaning of the source - * specification depends on 'src': - * - * - If 'src' is 0, the source bits are taken from a field in the flow to - * which this action is attached. (This should be a wildcarded field. If - * its value is fully specified then the source bits being copied have - * constant values.) - * - * The source specification is an ovs_be32 'field' and an ovs_be16 'ofs'. - * 'field' is an nxm_header with nxm_hasmask=0, and 'ofs' the starting bit - * offset within that field. The source bits are field[ofs:ofs+n_bits-1]. - * 'field' and 'ofs' are subject to the same restrictions as the source - * field in NXAST_REG_MOVE. - * - * - If 'src' is 1, the source bits are a constant value. The source - * specification is (n_bits+15)/16*2 bytes long. Taking those bytes as a - * number in network order, the source bits are the 'n_bits' - * least-significant bits. The switch will report an error if other bits - * in the constant are nonzero. - * - * The flow_mod_spec destination specification, for 'dst' of 0 or 1, is an - * ovs_be32 'field' and an ovs_be16 'ofs'. 'field' is an nxm_header with - * nxm_hasmask=0 and 'ofs' is a starting bit offset within that field. The - * meaning of the flow_mod_spec depends on 'dst': - * - * - If 'dst' is 0, the flow_mod_spec specifies match criteria for the new - * flow. The new flow matches only if bits field[ofs:ofs+n_bits-1] in a - * packet equal the source bits. 'field' may be any nxm_header with - * nxm_hasmask=0 that is allowed in NXT_FLOW_MOD. - * - * Order is significant. Earlier flow_mod_specs must satisfy any - * prerequisites for matching fields specified later, by copying constant - * values into prerequisite fields. - * - * The switch will reject flow_mod_specs that do not satisfy NXM masking - * restrictions. - * - * - If 'dst' is 1, the flow_mod_spec specifies an NXAST_REG_LOAD action for - * the new flow. The new flow copies the source bits into - * field[ofs:ofs+n_bits-1]. Actions are executed in the same order as the - * flow_mod_specs. - * - * A single NXAST_REG_LOAD action writes no more than 64 bits, so n_bits - * greater than 64 yields multiple NXAST_REG_LOAD actions. - * - * The flow_mod_spec destination spec for 'dst' of 2 (when 'src' is 0) is - * empty. It has the following meaning: - * - * - The flow_mod_spec specifies an OFPAT_OUTPUT action for the new flow. - * The new flow outputs to the OpenFlow port specified by the source field. - * Of the special output ports with value OFPP_MAX or larger, OFPP_IN_PORT, - * OFPP_FLOOD, OFPP_LOCAL, and OFPP_ALL are supported. Other special ports - * may not be used. - * - * Resource Management - * ------------------- - * - * A switch has a finite amount of flow table space available for learning. - * When this space is exhausted, no new learning table entries will be learned - * until some existing flow table entries expire. The controller should be - * prepared to handle this by flooding (which can be implemented as a - * low-priority flow). - * - * If a learned flow matches a single TCP stream with a relatively long - * timeout, one may make the best of resource constraints by setting - * 'fin_idle_timeout' or 'fin_hard_timeout' (both measured in seconds), or - * both, to shorter timeouts. When either of these is specified as a nonzero - * value, OVS adds a NXAST_FIN_TIMEOUT action, with the specified timeouts, to - * the learned flow. - * - * Examples - * -------- - * - * The following examples give a prose description of the flow_mod_specs along - * with informal notation for how those would be represented and a hex dump of - * the bytes that would be required. - * - * These examples could work with various nx_action_learn parameters. Typical - * values would be idle_timeout=OFP_FLOW_PERMANENT, hard_timeout=60, - * priority=OFP_DEFAULT_PRIORITY, flags=0, table_id=10. - * - * 1. Learn input port based on the source MAC, with lookup into - * NXM_NX_REG1[16:31] by resubmit to in_port=99: - * - * Match on in_port=99: - * ovs_be16(src=1, dst=0, n_bits=16), 20 10 - * ovs_be16(99), 00 63 - * ovs_be32(NXM_OF_IN_PORT), ovs_be16(0) 00 00 00 02 00 00 - * - * Match Ethernet destination on Ethernet source from packet: - * ovs_be16(src=0, dst=0, n_bits=48), 00 30 - * ovs_be32(NXM_OF_ETH_SRC), ovs_be16(0) 00 00 04 06 00 00 - * ovs_be32(NXM_OF_ETH_DST), ovs_be16(0) 00 00 02 06 00 00 - * - * Set NXM_NX_REG1[16:31] to the packet's input port: - * ovs_be16(src=0, dst=1, n_bits=16), 08 10 - * ovs_be32(NXM_OF_IN_PORT), ovs_be16(0) 00 00 00 02 00 00 - * ovs_be32(NXM_NX_REG1), ovs_be16(16) 00 01 02 04 00 10 - * - * Given a packet that arrived on port A with Ethernet source address B, - * this would set up the flow "in_port=99, dl_dst=B, - * actions=load:A->NXM_NX_REG1[16..31]". - * - * In syntax accepted by ovs-ofctl, this action is: learn(in_port=99, - * NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], - * load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) - * - * 2. Output to input port based on the source MAC and VLAN VID, with lookup - * into NXM_NX_REG1[16:31]: - * - * Match on same VLAN ID as packet: - * ovs_be16(src=0, dst=0, n_bits=12), 00 0c - * ovs_be32(NXM_OF_VLAN_TCI), ovs_be16(0) 00 00 08 02 00 00 - * ovs_be32(NXM_OF_VLAN_TCI), ovs_be16(0) 00 00 08 02 00 00 - * - * Match Ethernet destination on Ethernet source from packet: - * ovs_be16(src=0, dst=0, n_bits=48), 00 30 - * ovs_be32(NXM_OF_ETH_SRC), ovs_be16(0) 00 00 04 06 00 00 - * ovs_be32(NXM_OF_ETH_DST), ovs_be16(0) 00 00 02 06 00 00 - * - * Output to the packet's input port: - * ovs_be16(src=0, dst=2, n_bits=16), 10 10 - * ovs_be32(NXM_OF_IN_PORT), ovs_be16(0) 00 00 00 02 00 00 - * - * Given a packet that arrived on port A with Ethernet source address B in - * VLAN C, this would set up the flow "dl_dst=B, vlan_vid=C, - * actions=output:A". - * - * In syntax accepted by ovs-ofctl, this action is: - * learn(NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], - * output:NXM_OF_IN_PORT[]) - * - * 3. Here's a recipe for a very simple-minded MAC learning switch. It uses a - * 10-second MAC expiration time to make it easier to see what's going on - * - * ovs-vsctl del-controller br0 - * ovs-ofctl del-flows br0 - * ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, \ - hard_timeout=10, NXM_OF_VLAN_TCI[0..11], \ - NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ - output:NXM_OF_IN_PORT[]), resubmit(,1)" - * ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood" - * - * You can then dump the MAC learning table with: - * - * ovs-ofctl dump-flows br0 table=1 - * - * Usage Advice - * ------------ - * - * For best performance, segregate learned flows into a table that is not used - * for any other flows except possibly for a lowest-priority "catch-all" flow - * (a flow with no match criteria). If different learning actions specify - * different match criteria, use different tables for the learned flows. - * - * The meaning of 'hard_timeout' and 'idle_timeout' can be counterintuitive. - * These timeouts apply to the flow that is added, which means that a flow with - * an idle timeout will expire when no traffic has been sent *to* the learned - * address. This is not usually the intent in MAC learning; instead, we want - * the MAC learn entry to expire when no traffic has been sent *from* the - * learned address. Use a hard timeout for that. - */ -struct nx_action_learn { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* At least 24. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_LEARN. */ - ovs_be16 idle_timeout; /* Idle time before discarding (seconds). */ - ovs_be16 hard_timeout; /* Max time before discarding (seconds). */ - ovs_be16 priority; /* Priority level of flow entry. */ - ovs_be64 cookie; /* Cookie for new flow. */ - ovs_be16 flags; /* Either 0 or OFPFF_SEND_FLOW_REM. */ - uint8_t table_id; /* Table to insert flow entry. */ - uint8_t pad; /* Must be zero. */ - ovs_be16 fin_idle_timeout; /* Idle timeout after FIN, if nonzero. */ - ovs_be16 fin_hard_timeout; /* Hard timeout after FIN, if nonzero. */ - /* Followed by a sequence of flow_mod_spec elements, as described above, - * until the end of the action is reached. */ -}; -OFP_ASSERT(sizeof(struct nx_action_learn) == 32); - -#define NX_LEARN_N_BITS_MASK 0x3ff - -#define NX_LEARN_SRC_FIELD (0 << 13) /* Copy from field. */ -#define NX_LEARN_SRC_IMMEDIATE (1 << 13) /* Copy from immediate value. */ -#define NX_LEARN_SRC_MASK (1 << 13) - -#define NX_LEARN_DST_MATCH (0 << 11) /* Add match criterion. */ -#define NX_LEARN_DST_LOAD (1 << 11) /* Add NXAST_REG_LOAD action. */ -#define NX_LEARN_DST_OUTPUT (2 << 11) /* Add OFPAT_OUTPUT action. */ -#define NX_LEARN_DST_RESERVED (3 << 11) /* Not yet defined. */ -#define NX_LEARN_DST_MASK (3 << 11) - -/* Action structure for NXAST_FIN_TIMEOUT. - * - * This action changes the idle timeout or hard timeout, or both, of this - * OpenFlow rule when the rule matches a TCP packet with the FIN or RST flag. - * When such a packet is observed, the action reduces the rule's idle timeout - * to 'fin_idle_timeout' and its hard timeout to 'fin_hard_timeout'. This - * action has no effect on an existing timeout that is already shorter than the - * one that the action specifies. A 'fin_idle_timeout' or 'fin_hard_timeout' - * of zero has no effect on the respective timeout. - * - * 'fin_idle_timeout' and 'fin_hard_timeout' are measured in seconds. - * 'fin_hard_timeout' specifies time since the flow's creation, not since the - * receipt of the FIN or RST. - * - * This is useful for quickly discarding learned TCP flows that otherwise will - * take a long time to expire. - * - * This action is intended for use with an OpenFlow rule that matches only a - * single TCP flow. If the rule matches multiple TCP flows (e.g. it wildcards - * all TCP traffic, or all TCP traffic to a particular port), then any FIN or - * RST in any of those flows will cause the entire OpenFlow rule to expire - * early, which is not normally desirable. - */ -struct nx_action_fin_timeout { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_FIN_TIMEOUT. */ - ovs_be16 fin_idle_timeout; /* New idle timeout, if nonzero. */ - ovs_be16 fin_hard_timeout; /* New hard timeout, if nonzero. */ - ovs_be16 pad; /* Must be zero. */ -}; -OFP_ASSERT(sizeof(struct nx_action_fin_timeout) == 16); - -/* Action structure for NXAST_BUNDLE and NXAST_BUNDLE_LOAD. - * - * The bundle actions choose a slave from a supplied list of options. - * NXAST_BUNDLE outputs to its selection. NXAST_BUNDLE_LOAD writes its - * selection to a register. - * - * The list of possible slaves follows the nx_action_bundle structure. The size - * of each slave is governed by its type as indicated by the 'slave_type' - * parameter. The list of slaves should be padded at its end with zeros to make - * the total length of the action a multiple of 8. - * - * Switches infer from the 'slave_type' parameter the size of each slave. All - * implementations must support the NXM_OF_IN_PORT 'slave_type' which indicates - * that the slaves are OpenFlow port numbers with NXM_LENGTH(NXM_OF_IN_PORT) == - * 2 byte width. Switches should reject actions which indicate unknown or - * unsupported slave types. - * - * Switches use a strategy dictated by the 'algorithm' parameter to choose a - * slave. If the switch does not support the specified 'algorithm' parameter, - * it should reject the action. - * - * Several algorithms take into account liveness when selecting slaves. The - * liveness of a slave is implementation defined (with one exception), but will - * generally take into account things like its carrier status and the results - * of any link monitoring protocols which happen to be running on it. In order - * to give controllers a place-holder value, the OFPP_NONE port is always - * considered live. - * - * Some slave selection strategies require the use of a hash function, in which - * case the 'fields' and 'basis' parameters should be populated. The 'fields' - * parameter (one of NX_HASH_FIELDS_*) designates which parts of the flow to - * hash. Refer to the definition of "enum nx_hash_fields" for details. The - * 'basis' parameter is used as a universal hash parameter. Different values - * of 'basis' yield different hash results. - * - * The 'zero' parameter at the end of the action structure is reserved for - * future use. Switches are required to reject actions which have nonzero - * bytes in the 'zero' field. - * - * NXAST_BUNDLE actions should have 'ofs_nbits' and 'dst' zeroed. Switches - * should reject actions which have nonzero bytes in either of these fields. - * - * NXAST_BUNDLE_LOAD stores the OpenFlow port number of the selected slave in - * dst[ofs:ofs+n_bits]. The format and semantics of 'dst' and 'ofs_nbits' are - * similar to those for the NXAST_REG_LOAD action. */ -struct nx_action_bundle { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length including slaves. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_BUNDLE or NXAST_BUNDLE_LOAD. */ - - /* Slave choice algorithm to apply to hash value. */ - ovs_be16 algorithm; /* One of NX_BD_ALG_*. */ - - /* What fields to hash and how. */ - ovs_be16 fields; /* One of NX_HASH_FIELDS_*. */ - ovs_be16 basis; /* Universal hash parameter. */ - - ovs_be32 slave_type; /* NXM_OF_IN_PORT. */ - ovs_be16 n_slaves; /* Number of slaves. */ - - ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ - ovs_be32 dst; /* Destination. */ - - uint8_t zero[4]; /* Reserved. Must be zero. */ -}; -OFP_ASSERT(sizeof(struct nx_action_bundle) == 32); - -/* NXAST_BUNDLE: Bundle slave choice algorithm to apply. - * - * In the descriptions below, 'slaves' is the list of possible slaves in the - * order they appear in the OpenFlow action. */ -enum nx_bd_algorithm { - /* Chooses the first live slave listed in the bundle. - * - * O(n_slaves) performance. */ - NX_BD_ALG_ACTIVE_BACKUP, - - /* for i in [0,n_slaves): - * weights[i] = hash(flow, i) - * slave = { slaves[i] such that weights[i] >= weights[j] for all j != i } - * - * Redistributes 1/n_slaves of traffic when a slave's liveness changes. - * O(n_slaves) performance. - * - * Uses the 'fields' and 'basis' parameters. */ - NX_BD_ALG_HRW /* Highest Random Weight. */ -}; - - -/* Action structure for NXAST_DEC_TTL_CNT_IDS. - * - * If the packet is not IPv4 or IPv6, does nothing. For IPv4 or IPv6, if the - * TTL or hop limit is at least 2, decrements it by 1. Otherwise, if TTL or - * hop limit is 0 or 1, sends a packet-in to the controllers with each of the - * 'n_controllers' controller IDs specified in 'cnt_ids'. - * - * (This differs from NXAST_DEC_TTL in that for NXAST_DEC_TTL the packet-in is - * sent only to controllers with id 0.) - */ -struct nx_action_cnt_ids { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length including slaves. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_DEC_TTL_CNT_IDS. */ - - ovs_be16 n_controllers; /* Number of controllers. */ - uint8_t zeros[4]; /* Must be zero. */ - - /* Followed by 1 or more controller ids. - * - * uint16_t cnt_ids[]; // Controller ids. - * uint8_t pad[]; // Must be 0 to 8-byte align cnt_ids[]. - */ -}; -OFP_ASSERT(sizeof(struct nx_action_cnt_ids) == 16); - - -/* Action structure for NXAST_OUTPUT_REG. - * - * Outputs to the OpenFlow port number written to src[ofs:ofs+nbits]. - * - * The format and semantics of 'src' and 'ofs_nbits' are similar to those for - * the NXAST_REG_LOAD action. - * - * The acceptable nxm_header values for 'src' are the same as the acceptable - * nxm_header values for the 'src' field of NXAST_REG_MOVE. - * - * The 'max_len' field indicates the number of bytes to send when the chosen - * port is OFPP_CONTROLLER. Its semantics are equivalent to the 'max_len' - * field of OFPAT_OUTPUT. - * - * The 'zero' field is required to be zeroed for forward compatibility. */ -struct nx_action_output_reg { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* 24. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_OUTPUT_REG. */ - - ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ - ovs_be32 src; /* Source. */ - - ovs_be16 max_len; /* Max length to send to controller. */ - - uint8_t zero[6]; /* Reserved, must be zero. */ -}; -OFP_ASSERT(sizeof(struct nx_action_output_reg) == 24); - -/* NXAST_EXIT - * - * Discontinues action processing. - * - * The NXAST_EXIT action causes the switch to immediately halt processing - * actions for the flow. Any actions which have already been processed are - * executed by the switch. However, any further actions, including those which - * may be in different tables, or different levels of the NXAST_RESUBMIT - * hierarchy, will be ignored. - * - * Uses the nx_action_header structure. */ - /* Flexible flow specifications (aka NXM = Nicira Extended Match). * * OpenFlow 1.0 has "struct ofp10_match" for specifying flow matches. This @@ -1151,6 +287,9 @@ * short, that is also supported by Open vSwitch. This section also defines a * replacement for each OpenFlow message that includes struct ofp10_match. * + * OpenFlow 1.2+ introduced OpenFlow Extensible Match (OXM), adapting + * the design of NXM. The format of NXM and OXM are compatible. + * * * Format * ====== @@ -1171,10 +310,12 @@ * +----------------------------------+---------------+--+------------------+ * * The most-significant 23 bits of the header are collectively "nxm_type". - * Bits 16...31 are "nxm_vendor", one of the NXM_VENDOR_* values below. Bits - * 9...15 are "nxm_field", which is a vendor-specific value. nxm_type normally - * designates a protocol header, such as the Ethernet type, but it can also - * refer to packet metadata, such as the switch port on which a packet arrived. + * Bits 16...31 are "nxm_vendor", one of OFPXMC12_* values. In case of + * NXM, it's either OFPXMC12_NXM_0 or OFPXMC12_NXM_1. + * Bits 9...15 are "nxm_field", which is a vendor-specific value. nxm_type + * normally designates a protocol header, such as the Ethernet type, but it + * can also refer to packet metadata, such as the switch port on which a packet + * arrived. * * Bit 8 is "nxm_hasmask" (labeled "hm" above for space reasons). The meaning * of this bit is explained later. @@ -1331,507 +472,13 @@ * nx_match error. */ -#define NXM_HEADER__(VENDOR, FIELD, HASMASK, LENGTH) \ - (((VENDOR) << 16) | ((FIELD) << 9) | ((HASMASK) << 8) | (LENGTH)) -#define NXM_HEADER(VENDOR, FIELD, LENGTH) \ - NXM_HEADER__(VENDOR, FIELD, 0, LENGTH) -#define NXM_HEADER_W(VENDOR, FIELD, LENGTH) \ - NXM_HEADER__(VENDOR, FIELD, 1, (LENGTH) * 2) -#define NXM_VENDOR(HEADER) ((HEADER) >> 16) -#define NXM_FIELD(HEADER) (((HEADER) >> 9) & 0x7f) -#define NXM_TYPE(HEADER) (((HEADER) >> 9) & 0x7fffff) -#define NXM_HASMASK(HEADER) (((HEADER) >> 8) & 1) -#define NXM_LENGTH(HEADER) ((HEADER) & 0xff) - -#define NXM_MAKE_WILD_HEADER(HEADER) \ - NXM_HEADER_W(NXM_VENDOR(HEADER), NXM_FIELD(HEADER), NXM_LENGTH(HEADER)) - -/* ## ------------------------------- ## */ -/* ## OpenFlow 1.0-compatible fields. ## */ -/* ## ------------------------------- ## */ - -/* Physical or virtual port on which the packet was received. - * - * Prereqs: None. - * - * Format: 16-bit integer in network byte order. - * - * Masking: Not maskable. */ -#define NXM_OF_IN_PORT NXM_HEADER (0x0000, 0, 2) - -/* Source or destination address in Ethernet header. - * - * Prereqs: None. - * - * Format: 48-bit Ethernet MAC address. - * - * Masking: Fully maskable, in versions 1.8 and later. Earlier versions only - * supported the following masks for NXM_OF_ETH_DST_W: 00:00:00:00:00:00, - * fe:ff:ff:ff:ff:ff, 01:00:00:00:00:00, ff:ff:ff:ff:ff:ff. */ -#define NXM_OF_ETH_DST NXM_HEADER (0x0000, 1, 6) -#define NXM_OF_ETH_DST_W NXM_HEADER_W(0x0000, 1, 6) -#define NXM_OF_ETH_SRC NXM_HEADER (0x0000, 2, 6) -#define NXM_OF_ETH_SRC_W NXM_HEADER_W(0x0000, 2, 6) - -/* Packet's Ethernet type. - * - * For an Ethernet II packet this is taken from the Ethernet header. For an - * 802.2 LLC+SNAP header with OUI 00-00-00 this is taken from the SNAP header. - * A packet that has neither format has value 0x05ff - * (OFP_DL_TYPE_NOT_ETH_TYPE). - * - * For a packet with an 802.1Q header, this is the type of the encapsulated - * frame. - * - * Prereqs: None. - * - * Format: 16-bit integer in network byte order. - * - * Masking: Not maskable. */ -#define NXM_OF_ETH_TYPE NXM_HEADER (0x0000, 3, 2) - -/* 802.1Q TCI. - * - * For a packet with an 802.1Q header, this is the Tag Control Information - * (TCI) field, with the CFI bit forced to 1. For a packet with no 802.1Q - * header, this has value 0. - * - * Prereqs: None. - * - * Format: 16-bit integer in network byte order. - * - * Masking: Arbitrary masks. - * - * This field can be used in various ways: - * - * - If it is not constrained at all, the nx_match matches packets without - * an 802.1Q header or with an 802.1Q header that has any TCI value. - * - * - Testing for an exact match with 0 matches only packets without an - * 802.1Q header. - * - * - Testing for an exact match with a TCI value with CFI=1 matches packets - * that have an 802.1Q header with a specified VID and PCP. - * - * - Testing for an exact match with a nonzero TCI value with CFI=0 does - * not make sense. The switch may reject this combination. - * - * - Testing with a specific VID and CFI=1, with nxm_mask=0x1fff, matches - * packets that have an 802.1Q header with that VID (and any PCP). - * - * - Testing with a specific PCP and CFI=1, with nxm_mask=0xf000, matches - * packets that have an 802.1Q header with that PCP (and any VID). - * - * - Testing with nxm_value=0, nxm_mask=0x0fff matches packets with no 802.1Q - * header or with an 802.1Q header with a VID of 0. - * - * - Testing with nxm_value=0, nxm_mask=0xe000 matches packets with no 802.1Q - * header or with an 802.1Q header with a PCP of 0. - * - * - Testing with nxm_value=0, nxm_mask=0xefff matches packets with no 802.1Q - * header or with an 802.1Q header with both VID and PCP of 0. - */ -#define NXM_OF_VLAN_TCI NXM_HEADER (0x0000, 4, 2) -#define NXM_OF_VLAN_TCI_W NXM_HEADER_W(0x0000, 4, 2) - -/* The "type of service" byte of the IP header, with the ECN bits forced to 0. - * - * Prereqs: NXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd. - * - * Format: 8-bit integer with 2 least-significant bits forced to 0. - * - * Masking: Not maskable. */ -#define NXM_OF_IP_TOS NXM_HEADER (0x0000, 5, 1) - -/* The "protocol" byte in the IP header. - * - * Prereqs: NXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd. - * - * Format: 8-bit integer. - * - * Masking: Not maskable. */ -#define NXM_OF_IP_PROTO NXM_HEADER (0x0000, 6, 1) - -/* The source or destination address in the IP header. - * - * Prereqs: NXM_OF_ETH_TYPE must match 0x0800 exactly. - * - * Format: 32-bit integer in network byte order. - * - * Masking: Fully maskable, in Open vSwitch 1.8 and later. In earlier - * versions, only CIDR masks are allowed, that is, masks that consist of N - * high-order bits set to 1 and the other 32-N bits set to 0. */ -#define NXM_OF_IP_SRC NXM_HEADER (0x0000, 7, 4) -#define NXM_OF_IP_SRC_W NXM_HEADER_W(0x0000, 7, 4) -#define NXM_OF_IP_DST NXM_HEADER (0x0000, 8, 4) -#define NXM_OF_IP_DST_W NXM_HEADER_W(0x0000, 8, 4) - -/* The source or destination port in the TCP header. - * - * Prereqs: - * NXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd. - * NXM_OF_IP_PROTO must match 6 exactly. - * - * Format: 16-bit integer in network byte order. - * - * Masking: Fully maskable, in Open vSwitch 1.6 and later. Not maskable, in - * earlier versions. */ -#define NXM_OF_TCP_SRC NXM_HEADER (0x0000, 9, 2) -#define NXM_OF_TCP_SRC_W NXM_HEADER_W(0x0000, 9, 2) -#define NXM_OF_TCP_DST NXM_HEADER (0x0000, 10, 2) -#define NXM_OF_TCP_DST_W NXM_HEADER_W(0x0000, 10, 2) - -/* The source or destination port in the UDP header. - * - * Prereqs: - * NXM_OF_ETH_TYPE must match either 0x0800 or 0x86dd. - * NXM_OF_IP_PROTO must match 17 exactly. - * - * Format: 16-bit integer in network byte order. - * - * Masking: Fully maskable, in Open vSwitch 1.6 and later. Not maskable, in - * earlier versions. */ -#define NXM_OF_UDP_SRC NXM_HEADER (0x0000, 11, 2) -#define NXM_OF_UDP_SRC_W NXM_HEADER_W(0x0000, 11, 2) -#define NXM_OF_UDP_DST NXM_HEADER (0x0000, 12, 2) -#define NXM_OF_UDP_DST_W NXM_HEADER_W(0x0000, 12, 2) - -/* The type or code in the ICMP header. - * - * Prereqs: - * NXM_OF_ETH_TYPE must match 0x0800 exactly. - * NXM_OF_IP_PROTO must match 1 exactly. - * - * Format: 8-bit integer. - * - * Masking: Not maskable. */ -#define NXM_OF_ICMP_TYPE NXM_HEADER (0x0000, 13, 1) -#define NXM_OF_ICMP_CODE NXM_HEADER (0x0000, 14, 1) - -/* ARP opcode. - * - * For an Ethernet+IP ARP packet, the opcode in the ARP header. Always 0 - * otherwise. Only ARP opcodes between 1 and 255 should be specified for - * matching. - * - * Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035. - * - * Format: 16-bit integer in network byte order. - * - * Masking: Not maskable. */ -#define NXM_OF_ARP_OP NXM_HEADER (0x0000, 15, 2) - -/* For an Ethernet+IP ARP packet, the source or target protocol address - * in the ARP header. Always 0 otherwise. - * - * Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035. - * - * Format: 32-bit integer in network byte order. - * - * Masking: Fully maskable, in Open vSwitch 1.8 and later. In earlier - * versions, only CIDR masks are allowed, that is, masks that consist of N - * high-order bits set to 1 and the other 32-N bits set to 0. */ -#define NXM_OF_ARP_SPA NXM_HEADER (0x0000, 16, 4) -#define NXM_OF_ARP_SPA_W NXM_HEADER_W(0x0000, 16, 4) -#define NXM_OF_ARP_TPA NXM_HEADER (0x0000, 17, 4) -#define NXM_OF_ARP_TPA_W NXM_HEADER_W(0x0000, 17, 4) - -/* ## ------------------------ ## */ -/* ## Nicira match extensions. ## */ -/* ## ------------------------ ## */ - -/* Metadata registers. - * - * Registers initially have value 0. Actions allow register values to be - * manipulated. - * - * Prereqs: None. - * - * Format: Array of 32-bit integer registers. Space is reserved for up to - * NXM_NX_MAX_REGS registers, but switches may implement fewer. - * - * Masking: Arbitrary masks. */ +/* Number of registers allocated NXM field IDs. */ #define NXM_NX_MAX_REGS 16 -#define NXM_NX_REG(IDX) NXM_HEADER (0x0001, IDX, 4) -#define NXM_NX_REG_W(IDX) NXM_HEADER_W(0x0001, IDX, 4) -#define NXM_NX_REG_IDX(HEADER) NXM_FIELD(HEADER) -#define NXM_IS_NX_REG(HEADER) (!((((HEADER) ^ NXM_NX_REG0)) & 0xffffe1ff)) -#define NXM_IS_NX_REG_W(HEADER) (!((((HEADER) ^ NXM_NX_REG0_W)) & 0xffffe1ff)) -#define NXM_NX_REG0 NXM_HEADER (0x0001, 0, 4) -#define NXM_NX_REG0_W NXM_HEADER_W(0x0001, 0, 4) -#define NXM_NX_REG1 NXM_HEADER (0x0001, 1, 4) -#define NXM_NX_REG1_W NXM_HEADER_W(0x0001, 1, 4) -#define NXM_NX_REG2 NXM_HEADER (0x0001, 2, 4) -#define NXM_NX_REG2_W NXM_HEADER_W(0x0001, 2, 4) -#define NXM_NX_REG3 NXM_HEADER (0x0001, 3, 4) -#define NXM_NX_REG3_W NXM_HEADER_W(0x0001, 3, 4) -#define NXM_NX_REG4 NXM_HEADER (0x0001, 4, 4) -#define NXM_NX_REG4_W NXM_HEADER_W(0x0001, 4, 4) -#define NXM_NX_REG5 NXM_HEADER (0x0001, 5, 4) -#define NXM_NX_REG5_W NXM_HEADER_W(0x0001, 5, 4) -#define NXM_NX_REG6 NXM_HEADER (0x0001, 6, 4) -#define NXM_NX_REG6_W NXM_HEADER_W(0x0001, 6, 4) -#define NXM_NX_REG7 NXM_HEADER (0x0001, 7, 4) -#define NXM_NX_REG7_W NXM_HEADER_W(0x0001, 7, 4) - -/* Tunnel ID. - * - * For a packet received via a GRE, VXLAN or LISP tunnel including a (32-bit) - * key, the key is stored in the low 32-bits and the high bits are zeroed. For - * other packets, the value is 0. - * - * All zero bits, for packets not received via a keyed tunnel. - * - * Prereqs: None. - * - * Format: 64-bit integer in network byte order. - * - * Masking: Arbitrary masks. */ -#define NXM_NX_TUN_ID NXM_HEADER (0x0001, 16, 8) -#define NXM_NX_TUN_ID_W NXM_HEADER_W(0x0001, 16, 8) - -/* For an Ethernet+IP ARP packet, the source or target hardware address - * in the ARP header. Always 0 otherwise. - * - * Prereqs: NXM_OF_ETH_TYPE must match either 0x0806 or 0x8035. - * - * Format: 48-bit Ethernet MAC address. - * - * Masking: Not maskable. */ -#define NXM_NX_ARP_SHA NXM_HEADER (0x0001, 17, 6) -#define NXM_NX_ARP_THA NXM_HEADER (0x0001, 18, 6) - -/* The source or destination address in the IPv6 header. - * - * Prereqs: NXM_OF_ETH_TYPE must match 0x86dd exactly. - * - * Format: 128-bit IPv6 address. - * - * Masking: Fully maskable, in Open vSwitch 1.8 and later. In previous - * versions, only CIDR masks are allowed, that is, masks that consist of N - * high-order bits set to 1 and the other 128-N bits set to 0. */ -#define NXM_NX_IPV6_SRC NXM_HEADER (0x0001, 19, 16) -#define NXM_NX_IPV6_SRC_W NXM_HEADER_W(0x0001, 19, 16) -#define NXM_NX_IPV6_DST NXM_HEADER (0x0001, 20, 16) -#define NXM_NX_IPV6_DST_W NXM_HEADER_W(0x0001, 20, 16) - -/* The type or code in the ICMPv6 header. - * - * Prereqs: - * NXM_OF_ETH_TYPE must match 0x86dd exactly. - * NXM_OF_IP_PROTO must match 58 exactly. - * - * Format: 8-bit integer. - * - * Masking: Not maskable. */ -#define NXM_NX_ICMPV6_TYPE NXM_HEADER (0x0001, 21, 1) -#define NXM_NX_ICMPV6_CODE NXM_HEADER (0x0001, 22, 1) - -/* The target address in an IPv6 Neighbor Discovery message. - * - * Prereqs: - * NXM_OF_ETH_TYPE must match 0x86dd exactly. - * NXM_OF_IP_PROTO must match 58 exactly. - * NXM_OF_ICMPV6_TYPE must be either 135 or 136. - * - * Format: 128-bit IPv6 address. - * - * Masking: Fully maskable, in Open vSwitch 1.8 and later. In previous - * versions, only CIDR masks are allowed, that is, masks that consist of N - * high-order bits set to 1 and the other 128-N bits set to 0. */ -#define NXM_NX_ND_TARGET NXM_HEADER (0x0001, 23, 16) -#define NXM_NX_ND_TARGET_W NXM_HEADER_W (0x0001, 23, 16) - -/* The source link-layer address option in an IPv6 Neighbor Discovery - * message. - * - * Prereqs: - * NXM_OF_ETH_TYPE must match 0x86dd exactly. - * NXM_OF_IP_PROTO must match 58 exactly. - * NXM_OF_ICMPV6_TYPE must be exactly 135. - * - * Format: 48-bit Ethernet MAC address. - * - * Masking: Not maskable. */ -#define NXM_NX_ND_SLL NXM_HEADER (0x0001, 24, 6) - -/* The target link-layer address option in an IPv6 Neighbor Discovery - * message. - * - * Prereqs: - * NXM_OF_ETH_TYPE must match 0x86dd exactly. - * NXM_OF_IP_PROTO must match 58 exactly. - * NXM_OF_ICMPV6_TYPE must be exactly 136. - * - * Format: 48-bit Ethernet MAC address. - * - * Masking: Not maskable. */ -#define NXM_NX_ND_TLL NXM_HEADER (0x0001, 25, 6) - -/* IP fragment information. - * - * Prereqs: - * NXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd. - * - * Format: 8-bit value with one of the values 0, 1, or 3, as described below. - * - * Masking: Fully maskable. - * - * This field has three possible values: - * - * - A packet that is not an IP fragment has value 0. - * - * - A packet that is an IP fragment with offset 0 (the first fragment) has - * bit 0 set and thus value 1. - * - * - A packet that is an IP fragment with nonzero offset has bits 0 and 1 set - * and thus value 3. - * - * NX_IP_FRAG_ANY and NX_IP_FRAG_LATER are declared to symbolically represent - * the meanings of bits 0 and 1. - * - * The switch may reject matches against values that can never appear. - * - * It is important to understand how this field interacts with the OpenFlow IP - * fragment handling mode: - * - * - In OFPC_FRAG_DROP mode, the OpenFlow switch drops all IP fragments - * before they reach the flow table, so every packet that is available for - * matching will have value 0 in this field. - * - * - Open vSwitch does not implement OFPC_FRAG_REASM mode, but if it did then - * IP fragments would be reassembled before they reached the flow table and - * again every packet available for matching would always have value 0. - * - * - In OFPC_FRAG_NORMAL mode, all three values are possible, but OpenFlow - * 1.0 says that fragments' transport ports are always 0, even for the - * first fragment, so this does not provide much extra information. - * - * - In OFPC_FRAG_NX_MATCH mode, all three values are possible. For - * fragments with offset 0, Open vSwitch makes L4 header information - * available. - */ -#define NXM_NX_IP_FRAG NXM_HEADER (0x0001, 26, 1) -#define NXM_NX_IP_FRAG_W NXM_HEADER_W(0x0001, 26, 1) /* Bits in the value of NXM_NX_IP_FRAG. */ #define NX_IP_FRAG_ANY (1 << 0) /* Is this a fragment? */ #define NX_IP_FRAG_LATER (1 << 1) /* Is this a fragment with nonzero offset? */ -/* The flow label in the IPv6 header. - * - * Prereqs: NXM_OF_ETH_TYPE must match 0x86dd exactly. - * - * Format: 20-bit IPv6 flow label in least-significant bits. - * - * Masking: Fully maskable. */ -#define NXM_NX_IPV6_LABEL NXM_HEADER (0x0001, 27, 4) -#define NXM_NX_IPV6_LABEL_W NXM_HEADER_W(0x0001, 27, 4) - -/* The ECN of the IP header. - * - * Prereqs: NXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd. - * - * Format: ECN in the low-order 2 bits. - * - * Masking: Not maskable. */ -#define NXM_NX_IP_ECN NXM_HEADER (0x0001, 28, 1) - -/* The time-to-live/hop limit of the IP header. - * - * Prereqs: NXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd. - * - * Format: 8-bit integer. - * - * Masking: Not maskable. */ -#define NXM_NX_IP_TTL NXM_HEADER (0x0001, 29, 1) - -/* Flow cookie. - * - * This may be used to gain the OpenFlow 1.1-like ability to restrict - * certain NXM-based Flow Mod and Flow Stats Request messages to flows - * with specific cookies. See the "nx_flow_mod" and "nx_flow_stats_request" - * structure definitions for more details. This match is otherwise not - * allowed. - * - * Prereqs: None. - * - * Format: 64-bit integer in network byte order. - * - * Masking: Arbitrary masks. */ -#define NXM_NX_COOKIE NXM_HEADER (0x0001, 30, 8) -#define NXM_NX_COOKIE_W NXM_HEADER_W(0x0001, 30, 8) - -/* The source or destination address in the outer IP header of a tunneled - * packet. - * - * For non-tunneled packets, the value is 0. - * - * Prereqs: None. - * - * Format: 32-bit integer in network byte order. - * - * Masking: Fully maskable. */ -#define NXM_NX_TUN_IPV4_SRC NXM_HEADER (0x0001, 31, 4) -#define NXM_NX_TUN_IPV4_SRC_W NXM_HEADER_W(0x0001, 31, 4) -#define NXM_NX_TUN_IPV4_DST NXM_HEADER (0x0001, 32, 4) -#define NXM_NX_TUN_IPV4_DST_W NXM_HEADER_W(0x0001, 32, 4) - -/* Metadata marked onto the packet in a system-dependent manner. - * - * The packet mark may be used to carry contextual information - * to other parts of the system outside of Open vSwitch. As a - * result, the semantics depend on system in use. - * - * Prereqs: None. - * - * Format: 32-bit integer in network byte order. - * - * Masking: Fully maskable. */ -#define NXM_NX_PKT_MARK NXM_HEADER (0x0001, 33, 4) -#define NXM_NX_PKT_MARK_W NXM_HEADER_W(0x0001, 33, 4) - -/* The flags in the TCP header. -* -* Prereqs: -* NXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd. -* NXM_OF_IP_PROTO must match 6 exactly. -* -* Format: 16-bit integer with 4 most-significant bits forced to 0. -* -* Masking: Bits 0-11 fully maskable. */ -#define NXM_NX_TCP_FLAGS NXM_HEADER (0x0001, 34, 2) -#define NXM_NX_TCP_FLAGS_W NXM_HEADER_W(0x0001, 34, 2) - -/* Metadata dp_hash. - * - * Internal use only, not programable from controller. - * - * The dp_hash is used to carry the flow hash computed in the - * datapath. - * - * Prereqs: None. - * - * Format: 32-bit integer in network byte order. - * - * Masking: Fully maskable. */ -#define NXM_NX_DP_HASH NXM_HEADER (0x0001, 35, 4) -#define NXM_NX_DP_HASH_W NXM_HEADER_W(0x0001, 35, 4) - -/* Metadata recirc_id. - * - * Internal use only, not programable from controller. - * - * The recirc_id used for recirculation. 0 is reserved - * for initially received packet. - * - * Prereqs: None. - * - * Format: 32-bit integer in network byte order. - * - * Masking: not maskable. */ -#define NXM_NX_RECIRC_ID NXM_HEADER (0x0001, 36, 4) - /* ## --------------------- ## */ /* ## Requests and replies. ## */ /* ## --------------------- ## */ @@ -2012,30 +659,6 @@ ovs_be16 controller_id; /* New controller connection ID. */ }; OFP_ASSERT(sizeof(struct nx_controller_id) == 8); - -/* Action structure for NXAST_CONTROLLER. - * - * This generalizes using OFPAT_OUTPUT to send a packet to OFPP_CONTROLLER. In - * addition to the 'max_len' that OFPAT_OUTPUT supports, it also allows - * specifying: - * - * - 'reason': The reason code to use in the ofp_packet_in or nx_packet_in. - * - * - 'controller_id': The ID of the controller connection to which the - * ofp_packet_in should be sent. The ofp_packet_in or nx_packet_in is - * sent only to controllers that have the specified controller connection - * ID. See "struct nx_controller_id" for more information. */ -struct nx_action_controller { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_CONTROLLER. */ - ovs_be16 max_len; /* Maximum length to send to controller. */ - ovs_be16 controller_id; /* Controller ID to send packet-in. */ - uint8_t reason; /* enum ofp_packet_in_reason (OFPR_*). */ - uint8_t zero; /* Must be zero. */ -}; -OFP_ASSERT(sizeof(struct nx_action_controller) == 16); /* Flow Table Monitoring * ===================== @@ -2236,8 +859,9 @@ * a flow_mod with type OFPFC_MODIFY affects multiple flows, but only some * of those modifications succeed (e.g. due to hardware limitations). * - * This cannot occur with the current implementation of the Open vSwitch - * software datapath. It could happen with other datapath implementations. + * This cannot occur with the Open vSwitch software datapath. This also + * cannot occur in Open vSwitch 2.4 and later, because these versions only + * execute any flow modifications if all of them will succeed. * * - Changes that race with conflicting changes made by other controllers or * other flow_mods (not separated by barriers) by the same controller. @@ -2246,6 +870,9 @@ * (regardless of datapath) because Open vSwitch internally serializes * potentially conflicting changes. * + * - Changes that occur when flow notification is paused (see "Buffer + * Management" above). + * * A flow_mod that does not change the flow table will not trigger any * notification, even an abbreviated one. For example, a "modify" or "delete" * flow_mod that does not match any flows will not trigger a notification. @@ -2273,98 +900,4 @@ }; OFP_ASSERT(sizeof(struct nx_flow_monitor_cancel) == 4); -/* Action structure for NXAST_WRITE_METADATA. - * - * Modifies the 'mask' bits of the metadata value. */ -struct nx_action_write_metadata { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 32. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_WRITE_METADATA. */ - uint8_t zeros[6]; /* Must be zero. */ - ovs_be64 metadata; /* Metadata register. */ - ovs_be64 mask; /* Metadata mask. */ -}; -OFP_ASSERT(sizeof(struct nx_action_write_metadata) == 32); - -/* Action structure for NXAST_PUSH_MPLS. */ -struct nx_action_push_mpls { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_PUSH_MPLS. */ - ovs_be16 ethertype; /* Ethertype */ - uint8_t pad[4]; -}; -OFP_ASSERT(sizeof(struct nx_action_push_mpls) == 16); - -/* Action structure for NXAST_POP_MPLS. */ -struct nx_action_pop_mpls { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_POP_MPLS. */ - ovs_be16 ethertype; /* Ethertype */ - uint8_t pad[4]; -}; -OFP_ASSERT(sizeof(struct nx_action_pop_mpls) == 16); - -/* Action structure for NXAST_SET_MPLS_LABEL. */ -struct nx_action_mpls_label { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_SET_MPLS_LABEL. */ - uint8_t zeros[2]; /* Must be zero. */ - ovs_be32 label; /* LABEL */ -}; -OFP_ASSERT(sizeof(struct nx_action_mpls_label) == 16); - -/* Action structure for NXAST_SET_MPLS_TC. */ -struct nx_action_mpls_tc { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_SET_MPLS_TC. */ - uint8_t tc; /* TC */ - uint8_t pad[5]; -}; -OFP_ASSERT(sizeof(struct nx_action_mpls_tc) == 16); - -/* Action structure for NXAST_SET_MPLS_TTL. */ -struct nx_action_mpls_ttl { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_SET_MPLS_TTL. */ - uint8_t ttl; /* TTL */ - uint8_t pad[5]; -}; -OFP_ASSERT(sizeof(struct nx_action_mpls_ttl) == 16); - -/* Action structure for NXAST_SAMPLE. - * - * Samples matching packets with the given probability and sends them - * each to the set of collectors identified with the given ID. The - * probability is expressed as a number of packets to be sampled out - * of USHRT_MAX packets, and must be >0. - * - * When sending packet samples to IPFIX collectors, the IPFIX flow - * record sent for each sampled packet is associated with the given - * observation domain ID and observation point ID. Each IPFIX flow - * record contain the sampled packet's headers when executing this - * rule. If a sampled packet's headers are modified by previous - * actions in the flow, those modified headers are sent. */ -struct nx_action_sample { - ovs_be16 type; /* OFPAT_VENDOR. */ - ovs_be16 len; /* Length is 24. */ - ovs_be32 vendor; /* NX_VENDOR_ID. */ - ovs_be16 subtype; /* NXAST_SAMPLE. */ - ovs_be16 probability; /* Fraction of packets to sample. */ - ovs_be32 collector_set_id; /* ID of collector set in OVSDB. */ - ovs_be32 obs_domain_id; /* ID of sampling observation domain. */ - ovs_be32 obs_point_id; /* ID of sampling observation point. */ -}; -OFP_ASSERT(sizeof(struct nx_action_sample) == 24); - #endif /* openflow/nicira-ext.h */ diff -Nru openvswitch-2.3.1/include/openflow/openflow-1.0.h openvswitch-2.4.0~git20150623/include/openflow/openflow-1.0.h --- openvswitch-2.3.1/include/openflow/openflow-1.0.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow-1.0.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,22 +19,23 @@ #ifndef OPENFLOW_OPENFLOW10_H #define OPENFLOW_OPENFLOW10_H 1 -#include "openflow/openflow-common.h" +#include /* Port number(s) meaning * --------------- -------------------------------------- * 0x0000 not assigned a meaning by OpenFlow 1.0 * 0x0001...0xfeff "physical" ports - * 0xff00...0xfff7 "reserved" but not assigned a meaning by OpenFlow 1.0 - * 0xfff8...0xffff "reserved" OFPP_* ports with assigned meanings + * 0xff00...0xfff6 "reserved" but not assigned a meaning by OpenFlow 1.x + * 0xfff7...0xffff "reserved" OFPP_* ports with assigned meanings */ /* Ranges. */ #define OFPP_MAX OFP_PORT_C(0xff00) /* Max # of switch ports. */ -#define OFPP_FIRST_RESV OFP_PORT_C(0xfff8) /* First assigned reserved port. */ +#define OFPP_FIRST_RESV OFP_PORT_C(0xfff7) /* First assigned reserved port. */ #define OFPP_LAST_RESV OFP_PORT_C(0xffff) /* Last assigned reserved port. */ /* Reserved output "ports". */ +#define OFPP_UNSET OFP_PORT_C(0xfff7) /* For OXM_OF_ACTSET_OUTPUT only. */ #define OFPP_IN_PORT OFP_PORT_C(0xfff8) /* Where the packet came in. */ #define OFPP_TABLE OFP_PORT_C(0xfff9) /* Perform actions in flow table. */ #define OFPP_NORMAL OFP_PORT_C(0xfffa) /* Process with normal L2/L3. */ @@ -170,46 +171,6 @@ }; OFP_ASSERT(sizeof(struct ofp10_packet_in) == 12); -enum ofp10_action_type { - OFPAT10_OUTPUT, /* Output to switch port. */ - OFPAT10_SET_VLAN_VID, /* Set the 802.1q VLAN id. */ - OFPAT10_SET_VLAN_PCP, /* Set the 802.1q priority. */ - OFPAT10_STRIP_VLAN, /* Strip the 802.1q header. */ - OFPAT10_SET_DL_SRC, /* Ethernet source address. */ - OFPAT10_SET_DL_DST, /* Ethernet destination address. */ - OFPAT10_SET_NW_SRC, /* IP source address. */ - OFPAT10_SET_NW_DST, /* IP destination address. */ - OFPAT10_SET_NW_TOS, /* IP ToS (DSCP field, 6 bits). */ - OFPAT10_SET_TP_SRC, /* TCP/UDP source port. */ - OFPAT10_SET_TP_DST, /* TCP/UDP destination port. */ - OFPAT10_ENQUEUE, /* Output to queue. */ - OFPAT10_VENDOR = 0xffff -}; - -/* Action structure for OFPAT10_OUTPUT, which sends packets out 'port'. - * When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max - * number of bytes to send. A 'max_len' of zero means no bytes of the - * packet should be sent. */ -struct ofp10_action_output { - ovs_be16 type; /* OFPAT10_OUTPUT. */ - ovs_be16 len; /* Length is 8. */ - ovs_be16 port; /* Output port. */ - ovs_be16 max_len; /* Max length to send to controller. */ -}; -OFP_ASSERT(sizeof(struct ofp10_action_output) == 8); - -/* OFPAT10_ENQUEUE action struct: send packets to given queue on port. */ -struct ofp10_action_enqueue { - ovs_be16 type; /* OFPAT10_ENQUEUE. */ - ovs_be16 len; /* Len is 16. */ - ovs_be16 port; /* Port that queue belongs. Should - refer to a valid physical port - (i.e. < OFPP_MAX) or OFPP_IN_PORT. */ - uint8_t pad[6]; /* Pad for 64-bit alignment. */ - ovs_be32 queue_id; /* Where to enqueue the packets. */ -}; -OFP_ASSERT(sizeof(struct ofp10_action_enqueue) == 16); - /* Send packet (controller -> datapath). */ struct ofp10_packet_out { ovs_be32 buffer_id; /* ID assigned by datapath or UINT32_MAX. */ @@ -311,9 +272,9 @@ output port. A value of OFPP_NONE indicates no restriction. */ ovs_be16 flags; /* One of OFPFF_*. */ - struct ofp_action_header actions[0]; /* The action length is inferred - from the length field in the - header. */ + + /* Followed by OpenFlow actions whose length is inferred from the length + * field in the OpenFlow header. */ }; OFP_ASSERT(sizeof(struct ofp10_flow_mod) == 64); @@ -374,7 +335,7 @@ ovs_32aligned_be64 cookie; /* Opaque controller-issued identifier. */ ovs_32aligned_be64 packet_count; /* Number of packets in flow. */ ovs_32aligned_be64 byte_count; /* Number of bytes in flow. */ - struct ofp_action_header actions[0]; /* Actions. */ + /* Followed by OpenFlow actions whose length is inferred from 'length'. */ }; OFP_ASSERT(sizeof(struct ofp10_flow_stats) == 88); diff -Nru openvswitch-2.3.1/include/openflow/openflow-1.1.h openvswitch-2.4.0~git20150623/include/openflow/openflow-1.1.h --- openvswitch-2.3.1/include/openflow/openflow-1.1.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow-1.1.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2011, 2012, 2013 The Board of Trustees of The Leland Stanford +/* Copyright (c) 2008, 2011, 2012, 2013, 2014 The Board of Trustees of The Leland Stanford * Junior University * * We are making the OpenFlow specification and associated documentation @@ -52,7 +52,7 @@ #ifndef OPENFLOW_11_H #define OPENFLOW_11_H 1 -#include "openflow/openflow-common.h" +#include /* OpenFlow 1.1 uses 32-bit port numbers. Open vSwitch, for now, uses OpenFlow * 1.0 port numbers internally. We map them to OpenFlow 1.0 as follows: @@ -181,38 +181,6 @@ OFPC11_GROUP_STATS = 1 << 3, /* Group statistics. */ }; -enum ofp11_action_type { - OFPAT11_OUTPUT, /* Output to switch port. */ - OFPAT11_SET_VLAN_VID, /* Set the 802.1q VLAN id. */ - OFPAT11_SET_VLAN_PCP, /* Set the 802.1q priority. */ - OFPAT11_SET_DL_SRC, /* Ethernet source address. */ - OFPAT11_SET_DL_DST, /* Ethernet destination address. */ - OFPAT11_SET_NW_SRC, /* IP source address. */ - OFPAT11_SET_NW_DST, /* IP destination address. */ - OFPAT11_SET_NW_TOS, /* IP ToS (DSCP field, 6 bits). */ - OFPAT11_SET_NW_ECN, /* IP ECN (2 bits). */ - OFPAT11_SET_TP_SRC, /* TCP/UDP/SCTP source port. */ - OFPAT11_SET_TP_DST, /* TCP/UDP/SCTP destination port. */ - OFPAT11_COPY_TTL_OUT, /* Copy TTL "outwards" -- from next-to-outermost - to outermost */ - OFPAT11_COPY_TTL_IN, /* Copy TTL "inwards" -- from outermost to - next-to-outermost */ - OFPAT11_SET_MPLS_LABEL, /* MPLS label */ - OFPAT11_SET_MPLS_TC, /* MPLS TC */ - OFPAT11_SET_MPLS_TTL, /* MPLS TTL */ - OFPAT11_DEC_MPLS_TTL, /* Decrement MPLS TTL */ - - OFPAT11_PUSH_VLAN, /* Push a new VLAN tag */ - OFPAT11_POP_VLAN, /* Pop the outer VLAN tag */ - OFPAT11_PUSH_MPLS, /* Push a new MPLS Label Stack Entry */ - OFPAT11_POP_MPLS, /* Pop the outer MPLS Label Stack Entry */ - OFPAT11_SET_QUEUE, /* Set queue id when outputting to a port */ - OFPAT11_GROUP, /* Apply group. */ - OFPAT11_SET_NW_TTL, /* IP TTL. */ - OFPAT11_DEC_NW_TTL, /* Decrement IP TTL. */ - OFPAT11_EXPERIMENTER = 0xffff -}; - #define OFPMT11_STANDARD_LENGTH 88 struct ofp11_match_header { @@ -290,10 +258,6 @@ OFPIT11_EXPERIMENTER = 0xFFFF /* Experimenter instruction */ }; -#define OFPIT11_ALL (OFPIT11_GOTO_TABLE | OFPIT11_WRITE_METADATA | \ - OFPIT11_WRITE_ACTIONS | OFPIT11_APPLY_ACTIONS | \ - OFPIT11_CLEAR_ACTIONS) - #define OFP11_INSTRUCTION_ALIGN 8 /* Generic ofp_instruction structure. */ @@ -344,97 +308,6 @@ }; OFP_ASSERT(sizeof(struct ofp11_instruction_experimenter) == 8); -/* Action structure for OFPAT_OUTPUT, which sends packets out 'port'. - * When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max - * number of bytes to send. A 'max_len' of zero means no bytes of the - * packet should be sent.*/ -struct ofp11_action_output { - ovs_be16 type; /* OFPAT11_OUTPUT. */ - ovs_be16 len; /* Length is 16. */ - ovs_be32 port; /* Output port. */ - ovs_be16 max_len; /* Max length to send to controller. */ - uint8_t pad[6]; /* Pad to 64 bits. */ -}; -OFP_ASSERT(sizeof(struct ofp11_action_output) == 16); - -/* Action structure for OFPAT_GROUP. */ -struct ofp11_action_group { - ovs_be16 type; /* OFPAT11_GROUP. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 group_id; /* Group identifier. */ -}; -OFP_ASSERT(sizeof(struct ofp11_action_group) == 8); - -/* OFPAT_SET_QUEUE action struct: send packets to given queue on port. */ -struct ofp11_action_set_queue { - ovs_be16 type; /* OFPAT11_SET_QUEUE. */ - ovs_be16 len; /* Len is 8. */ - ovs_be32 queue_id; /* Queue id for the packets. */ -}; -OFP_ASSERT(sizeof(struct ofp11_action_set_queue) == 8); - -/* Action structure for OFPAT11_SET_MPLS_LABEL. */ -struct ofp11_action_mpls_label { - ovs_be16 type; /* OFPAT11_SET_MPLS_LABEL. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 mpls_label; /* MPLS label */ -}; -OFP_ASSERT(sizeof(struct ofp11_action_mpls_label) == 8); - -/* Action structure for OFPAT11_SET_MPLS_TC. */ -struct ofp11_action_mpls_tc { - ovs_be16 type; /* OFPAT11_SET_MPLS_TC. */ - ovs_be16 len; /* Length is 8. */ - uint8_t mpls_tc; /* MPLS TC */ - uint8_t pad[3]; -}; -OFP_ASSERT(sizeof(struct ofp11_action_mpls_tc) == 8); - -/* Action structure for OFPAT11_SET_MPLS_TTL. */ -struct ofp11_action_mpls_ttl { - ovs_be16 type; /* OFPAT11_SET_MPLS_TTL. */ - ovs_be16 len; /* Length is 8. */ - uint8_t mpls_ttl; /* MPLS TTL */ - uint8_t pad[3]; -}; -OFP_ASSERT(sizeof(struct ofp11_action_mpls_ttl) == 8); - -/* Action structure for OFPAT11_SET_NW_ECN. */ -struct ofp11_action_nw_ecn { - ovs_be16 type; /* OFPAT11_SET_TW_SRC/DST. */ - ovs_be16 len; /* Length is 8. */ - uint8_t nw_ecn; /* IP ECN (2 bits). */ - uint8_t pad[3]; -}; -OFP_ASSERT(sizeof(struct ofp11_action_nw_ecn) == 8); - -/* Action structure for OFPAT11_SET_NW_TTL. */ -struct ofp11_action_nw_ttl { - ovs_be16 type; /* OFPAT11_SET_NW_TTL. */ - ovs_be16 len; /* Length is 8. */ - uint8_t nw_ttl; /* IP TTL */ - uint8_t pad[3]; -}; -OFP_ASSERT(sizeof(struct ofp11_action_nw_ttl) == 8); - -/* Action structure for OFPAT11_PUSH_VLAN/MPLS. */ -struct ofp11_action_push { - ovs_be16 type; /* OFPAT11_PUSH_VLAN/MPLS. */ - ovs_be16 len; /* Length is 8. */ - ovs_be16 ethertype; /* Ethertype */ - uint8_t pad[2]; -}; -OFP_ASSERT(sizeof(struct ofp11_action_push) == 8); - -/* Action structure for OFPAT11_POP_MPLS. */ -struct ofp11_action_pop_mpls { - ovs_be16 type; /* OFPAT11_POP_MPLS. */ - ovs_be16 len; /* Length is 8. */ - ovs_be16 ethertype; /* Ethertype */ - uint8_t pad[2]; -}; -OFP_ASSERT(sizeof(struct ofp11_action_pop_mpls) == 8); - /* Configure/Modify behavior of a flow table */ struct ofp11_table_mod { uint8_t table_id; /* ID of the table, 0xFF indicates all tables */ @@ -467,7 +340,7 @@ output group. A value of OFPG11_ANY indicates no restriction. */ ovs_be16 flags; /* One of OFPFF_*. */ - uint8_t pad[2]; + ovs_be16 importance; /* Eviction precedence (OF1.4+). */ /* Followed by an ofp11_match structure. */ /* Followed by an instruction set. */ }; @@ -578,11 +451,12 @@ ovs_be16 idle_timeout; /* Number of seconds idle before expiration. */ ovs_be16 hard_timeout; /* Number of seconds before expiration. */ ovs_be16 flags; /* OF 1.3: Set of OFPFF*. */ - uint8_t pad2[4]; /* Align to 64-bits. */ + ovs_be16 importance; /* Eviction precedence (OF1.4+). */ + uint8_t pad2[2]; /* Align to 64-bits. */ ovs_be64 cookie; /* Opaque controller-issued identifier. */ ovs_be64 packet_count; /* Number of packets in flow. */ ovs_be64 byte_count; /* Number of bytes in flow. */ - /* Open Flow version specific match */ + /* OpenFlow version specific match */ /* struct ofp11_instruction instructions[0]; Instruction set. */ }; OFP_ASSERT(sizeof(struct ofp11_flow_stats) == 48); diff -Nru openvswitch-2.3.1/include/openflow/openflow-1.2.h openvswitch-2.4.0~git20150623/include/openflow/openflow-1.2.h --- openvswitch-2.3.1/include/openflow/openflow-1.2.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow-1.2.h 2015-06-23 18:46:21.000000000 +0000 @@ -53,150 +53,11 @@ #ifndef OPENFLOW_12_H #define OPENFLOW_12_H 1 -#include "openflow/openflow-1.1.h" +#include /* Error type for experimenter error messages. */ #define OFPET12_EXPERIMENTER 0xffff -/* - * OXM Class IDs. - * The high order bit differentiate reserved classes from member classes. - * Classes 0x0000 to 0x7FFF are member classes, allocated by ONF. - * Classes 0x8000 to 0xFFFE are reserved classes, reserved for standardisation. - */ -enum ofp12_oxm_class { - OFPXMC12_NXM_0 = 0x0000, /* Backward compatibility with NXM */ - OFPXMC12_NXM_1 = 0x0001, /* Backward compatibility with NXM */ - OFPXMC12_OPENFLOW_BASIC = 0x8000, /* Basic class for OpenFlow */ - OFPXMC12_EXPERIMENTER = 0xffff, /* Experimenter class */ -}; - -/* OXM Flow match field types for OpenFlow basic class. */ -enum oxm12_ofb_match_fields { - OFPXMT12_OFB_IN_PORT, /* Switch input port. */ - OFPXMT12_OFB_IN_PHY_PORT, /* Switch physical input port. */ - OFPXMT12_OFB_METADATA, /* Metadata passed between tables. */ - OFPXMT12_OFB_ETH_DST, /* Ethernet destination address. */ - OFPXMT12_OFB_ETH_SRC, /* Ethernet source address. */ - OFPXMT12_OFB_ETH_TYPE, /* Ethernet frame type. */ - OFPXMT12_OFB_VLAN_VID, /* VLAN id. */ - OFPXMT12_OFB_VLAN_PCP, /* VLAN priority. */ - OFPXMT12_OFB_IP_DSCP, /* IP DSCP (6 bits in ToS field). */ - OFPXMT12_OFB_IP_ECN, /* IP ECN (2 bits in ToS field). */ - OFPXMT12_OFB_IP_PROTO, /* IP protocol. */ - OFPXMT12_OFB_IPV4_SRC, /* IPv4 source address. */ - OFPXMT12_OFB_IPV4_DST, /* IPv4 destination address. */ - OFPXMT12_OFB_TCP_SRC, /* TCP source port. */ - OFPXMT12_OFB_TCP_DST, /* TCP destination port. */ - OFPXMT12_OFB_UDP_SRC, /* UDP source port. */ - OFPXMT12_OFB_UDP_DST, /* UDP destination port. */ - OFPXMT12_OFB_SCTP_SRC, /* SCTP source port. */ - OFPXMT12_OFB_SCTP_DST, /* SCTP destination port. */ - OFPXMT12_OFB_ICMPV4_TYPE, /* ICMP type. */ - OFPXMT12_OFB_ICMPV4_CODE, /* ICMP code. */ - OFPXMT12_OFB_ARP_OP, /* ARP opcode. */ - OFPXMT12_OFB_ARP_SPA, /* ARP source IPv4 address. */ - OFPXMT12_OFB_ARP_TPA, /* ARP target IPv4 address. */ - OFPXMT12_OFB_ARP_SHA, /* ARP source hardware address. */ - OFPXMT12_OFB_ARP_THA, /* ARP target hardware address. */ - OFPXMT12_OFB_IPV6_SRC, /* IPv6 source address. */ - OFPXMT12_OFB_IPV6_DST, /* IPv6 destination address. */ - OFPXMT12_OFB_IPV6_FLABEL, /* IPv6 Flow Label */ - OFPXMT12_OFB_ICMPV6_TYPE, /* ICMPv6 type. */ - OFPXMT12_OFB_ICMPV6_CODE, /* ICMPv6 code. */ - OFPXMT12_OFB_IPV6_ND_TARGET, /* Target address for ND. */ - OFPXMT12_OFB_IPV6_ND_SLL, /* Source link-layer for ND. */ - OFPXMT12_OFB_IPV6_ND_TLL, /* Target link-layer for ND. */ - OFPXMT12_OFB_MPLS_LABEL, /* MPLS label. */ - OFPXMT12_OFB_MPLS_TC, /* MPLS TC. */ -#define OFPXMT12_MASK ((1ULL << (OFPXMT12_OFB_MPLS_TC + 1)) - 1) - - /* Following added in OpenFlow 1.3 */ - OFPXMT13_OFB_MPLS_BOS, /* MPLS BoS bit. */ - OFPXMT13_OFB_PBB_ISID, /* PBB I-SID. */ - OFPXMT13_OFB_TUNNEL_ID, /* Logical Port Metadata */ - OFPXMT13_OFB_IPV6_EXTHDR, /* IPv6 Extension Header pseudo-field */ -#define OFPXMT13_MASK ((1ULL << (OFPXMT13_OFB_IPV6_EXTHDR + 1)) - 1) - - /* Following added in OpenFlow 1.4. */ - OFPXMT14_OFB_PBB_UCA = 41, /* PBB UCA header field. */ -#define OFPXMT14_MASK (1ULL << OFPXMT14_OFB_PBB_UCA) - - /* Following added in OpenFlow 1.5. */ - OFPXMT15_OFB_TCP_FLAGS = 42, /* TCP flags. */ -#define OFPXMT15_MASK (1ULL << OFPXMT15_OFB_TCP_FLAGS) - }; - -/* OXM implementation makes use of NXM as they are the same format - * with different field definitions - */ - -#define OXM_HEADER(FIELD, LENGTH) \ - NXM_HEADER(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) -#define OXM_HEADER_W(FIELD, LENGTH) \ - NXM_HEADER_W(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) - -#define IS_OXM_HEADER(header) (NXM_VENDOR(header) == OFPXMC12_OPENFLOW_BASIC) - -#define OXM_OF_IN_PORT OXM_HEADER (OFPXMT12_OFB_IN_PORT, 4) -#define OXM_OF_IN_PHY_PORT OXM_HEADER (OFPXMT12_OFB_IN_PHY_PORT, 4) -#define OXM_OF_METADATA OXM_HEADER (OFPXMT12_OFB_METADATA, 8) -#define OXM_OF_ETH_DST OXM_HEADER (OFPXMT12_OFB_ETH_DST, 6) -#define OXM_OF_ETH_DST_W OXM_HEADER_W (OFPXMT12_OFB_ETH_DST, 6) -#define OXM_OF_ETH_SRC OXM_HEADER (OFPXMT12_OFB_ETH_SRC, 6) -#define OXM_OF_ETH_SRC_W OXM_HEADER_W (OFPXMT12_OFB_ETH_SRC, 6) -#define OXM_OF_ETH_TYPE OXM_HEADER (OFPXMT12_OFB_ETH_TYPE, 2) -#define OXM_OF_VLAN_VID OXM_HEADER (OFPXMT12_OFB_VLAN_VID, 2) -#define OXM_OF_VLAN_VID_W OXM_HEADER_W (OFPXMT12_OFB_VLAN_VID, 2) -#define OXM_OF_VLAN_PCP OXM_HEADER (OFPXMT12_OFB_VLAN_PCP, 1) -#define OXM_OF_IP_DSCP OXM_HEADER (OFPXMT12_OFB_IP_DSCP, 1) -#define OXM_OF_IP_ECN OXM_HEADER (OFPXMT12_OFB_IP_ECN, 1) -#define OXM_OF_IP_PROTO OXM_HEADER (OFPXMT12_OFB_IP_PROTO, 1) -#define OXM_OF_IPV4_SRC OXM_HEADER (OFPXMT12_OFB_IPV4_SRC, 4) -#define OXM_OF_IPV4_SRC_W OXM_HEADER_W (OFPXMT12_OFB_IPV4_SRC, 4) -#define OXM_OF_IPV4_DST OXM_HEADER (OFPXMT12_OFB_IPV4_DST, 4) -#define OXM_OF_IPV4_DST_W OXM_HEADER_W (OFPXMT12_OFB_IPV4_DST, 4) -#define OXM_OF_TCP_SRC OXM_HEADER (OFPXMT12_OFB_TCP_SRC, 2) -#define OXM_OF_TCP_DST OXM_HEADER (OFPXMT12_OFB_TCP_DST, 2) -#define OXM_OF_UDP_SRC OXM_HEADER (OFPXMT12_OFB_UDP_SRC, 2) -#define OXM_OF_UDP_DST OXM_HEADER (OFPXMT12_OFB_UDP_DST, 2) -#define OXM_OF_SCTP_SRC OXM_HEADER (OFPXMT12_OFB_SCTP_SRC, 2) -#define OXM_OF_SCTP_DST OXM_HEADER (OFPXMT12_OFB_SCTP_DST, 2) -#define OXM_OF_ICMPV4_TYPE OXM_HEADER (OFPXMT12_OFB_ICMPV4_TYPE, 1) -#define OXM_OF_ICMPV4_CODE OXM_HEADER (OFPXMT12_OFB_ICMPV4_CODE, 1) -#define OXM_OF_ARP_OP OXM_HEADER (OFPXMT12_OFB_ARP_OP, 2) -#define OXM_OF_ARP_SPA OXM_HEADER (OFPXMT12_OFB_ARP_SPA, 4) -#define OXM_OF_ARP_SPA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_SPA, 4) -#define OXM_OF_ARP_TPA OXM_HEADER (OFPXMT12_OFB_ARP_TPA, 4) -#define OXM_OF_ARP_TPA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_TPA, 4) -#define OXM_OF_ARP_SHA OXM_HEADER (OFPXMT12_OFB_ARP_SHA, 6) -#define OXM_OF_ARP_SHA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_SHA, 6) -#define OXM_OF_ARP_THA OXM_HEADER (OFPXMT12_OFB_ARP_THA, 6) -#define OXM_OF_ARP_THA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_THA, 6) -#define OXM_OF_IPV6_SRC OXM_HEADER (OFPXMT12_OFB_IPV6_SRC, 16) -#define OXM_OF_IPV6_SRC_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_SRC, 16) -#define OXM_OF_IPV6_DST OXM_HEADER (OFPXMT12_OFB_IPV6_DST, 16) -#define OXM_OF_IPV6_DST_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_DST, 16) -#define OXM_OF_IPV6_FLABEL OXM_HEADER (OFPXMT12_OFB_IPV6_FLABEL, 4) -#define OXM_OF_IPV6_FLABEL_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_FLABEL, 4) -#define OXM_OF_ICMPV6_TYPE OXM_HEADER (OFPXMT12_OFB_ICMPV6_TYPE, 1) -#define OXM_OF_ICMPV6_CODE OXM_HEADER (OFPXMT12_OFB_ICMPV6_CODE, 1) -#define OXM_OF_IPV6_ND_TARGET OXM_HEADER (OFPXMT12_OFB_IPV6_ND_TARGET, 16) -#define OXM_OF_IPV6_ND_SLL OXM_HEADER (OFPXMT12_OFB_IPV6_ND_SLL, 6) -#define OXM_OF_IPV6_ND_TLL OXM_HEADER (OFPXMT12_OFB_IPV6_ND_TLL, 6) -#define OXM_OF_MPLS_LABEL OXM_HEADER (OFPXMT12_OFB_MPLS_LABEL, 4) -#define OXM_OF_MPLS_TC OXM_HEADER (OFPXMT12_OFB_MPLS_TC, 1) -#define OXM_OF_MPLS_BOS OXM_HEADER (OFPXMT13_OFB_MPLS_BOS, 1) -#define OXM_OF_PBB_ISID OXM_HEADER (OFPXMT12_OFB_PBB_ISID, 3) -#define OXM_OF_PBB_ISID_W OXM_HEADER_W (OFPXMT12_OFB_PBB_ISID, 3) -#define OXM_OF_TUNNEL_ID OXM_HEADER (OFPXMT13_OFB_TUNNEL_ID, 8) -#define OXM_OF_TUNNEL_ID_W OXM_HEADER_W (OFPXMT13_OFB_TUNNEL_ID, 8) -#define OXM_OF_IPV6_EXTHDR OXM_HEADER (OFPXMT13_OFB_IPV6_EXTHDR, 2) -#define OXM_OF_IPV6_EXTHDR_W OXM_HEADER_W (OFPXMT13_OFB_IPV6_EXTHDR, 2) -#define OXM_OF_PBB_UCA OXM_HEADER (OFPXMT14_OFB_PBB_UCA, 1) -#define OXM_OF_TCP_FLAGS OXM_HEADER (OFPXMT15_OFB_TCP_FLAGS, 2) -#define OXM_OF_TCP_FLAGS_W OXM_HEADER_W (OFPXMT15_OFB_TCP_FLAGS, 2) - /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate * special conditions. */ @@ -226,10 +87,6 @@ }; OFP_ASSERT(sizeof(struct ofp12_oxm_experimenter_header) == 8); -enum ofp12_action_type { - OFPAT12_SET_FIELD = 25, /* Set a header field using OXM TLV format. */ -}; - enum ofp12_controller_max_len { OFPCML12_MAX = 0xffe5, /* maximum max_len value which can be used * to request a specific byte length. */ @@ -238,18 +95,6 @@ * sent to the controller. */ }; -/* Action structure for OFPAT12_SET_FIELD. */ -struct ofp12_action_set_field { - ovs_be16 type; /* OFPAT12_SET_FIELD. */ - ovs_be16 len; /* Length is padded to 64 bits. */ - ovs_be32 dst; /* OXM TLV header */ - /* Followed by: - * - Exactly ((oxm_len + 4) + 7)/8*8 - (oxm_len + 4) (between 0 and 7) - * bytes of all-zero bytes - */ -}; -OFP_ASSERT(sizeof(struct ofp12_action_set_field) == 8); - /* OpenFlow 1.2 specific flags * (struct ofp12_flow_mod, member flags). */ enum ofp12_flow_mod_flags { @@ -302,12 +147,20 @@ }; OFP_ASSERT(sizeof(struct ofp12_table_stats) == 128); +/* Number of types of groups supported by ofp12_group_features_stats. */ +#define OFPGT12_N_TYPES 4 + /* Body of reply to OFPST12_GROUP_FEATURES request. Group features. */ struct ofp12_group_features_stats { ovs_be32 types; /* Bitmap of OFPGT11_* values supported. */ ovs_be32 capabilities; /* Bitmap of OFPGFC12_* capability supported. */ - ovs_be32 max_groups[4]; /* Maximum number of groups for each type. */ - ovs_be32 actions[4]; /* Bitmaps of OFPAT_* that are supported. */ + + /* Each element in the following arrays corresponds to the group type with + * the same number, e.g. max_groups[0] is the maximum number of OFPGT11_ALL + * groups, actions[2] is the actions supported by OFPGT11_INDIRECT + * groups. */ + ovs_be32 max_groups[OFPGT12_N_TYPES]; /* Max number of groups. */ + ovs_be32 actions[OFPGT12_N_TYPES]; /* Bitmaps of supported OFPAT_*. */ }; OFP_ASSERT(sizeof(struct ofp12_group_features_stats) == 40); diff -Nru openvswitch-2.3.1/include/openflow/openflow-1.3.h openvswitch-2.4.0~git20150623/include/openflow/openflow-1.3.h --- openvswitch-2.3.1/include/openflow/openflow-1.3.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow-1.3.h 2015-06-23 18:46:21.000000000 +0000 @@ -37,7 +37,7 @@ #ifndef OPENFLOW_13_H #define OPENFLOW_13_H 1 -#include "openflow/openflow-1.2.h" +#include /* * OpenFlow 1.3 modifies the syntax of the following message types: @@ -91,10 +91,6 @@ OFPIT13_METER = 6 /* Apply meter (rate limiter) */ }; -#define OFPIT13_ALL (OFPIT11_GOTO_TABLE | OFPIT11_WRITE_METADATA | \ - OFPIT11_WRITE_ACTIONS | OFPIT11_APPLY_ACTIONS | \ - OFPIT11_CLEAR_ACTIONS | OFPIT13_METER) - /* Instruction structure for OFPIT_METER */ struct ofp13_instruction_meter { ovs_be16 type; /* OFPIT13_METER */ @@ -103,27 +99,6 @@ }; OFP_ASSERT(sizeof(struct ofp13_instruction_meter) == 8); -enum ofp13_action_type { - OFPAT13_OUTPUT = 0, /* Output to switch port. */ - OFPAT13_COPY_TTL_OUT = 11, /* Copy TTL "outwards" -- from next-to-outermost - to outermost */ - OFPAT13_COPY_TTL_IN = 12, /* Copy TTL "inwards" -- from outermost to - next-to-outermost */ - OFPAT13_SET_MPLS_TTL = 15, /* MPLS TTL */ - OFPAT13_DEC_MPLS_TTL = 16, /* Decrement MPLS TTL */ - OFPAT13_PUSH_VLAN = 17, /* Push a new VLAN tag */ - OFPAT13_POP_VLAN = 18, /* Pop the outer VLAN tag */ - OFPAT13_PUSH_MPLS = 19, /* Push a new MPLS Label Stack Entry */ - OFPAT13_POP_MPLS = 20, /* Pop the outer MPLS Label Stack Entry */ - OFPAT13_SET_QUEUE = 21, /* Set queue id when outputting to a port */ - OFPAT13_GROUP = 22, /* Apply group. */ - OFPAT13_SET_NW_TTL = 23, /* IP TTL. */ - OFPAT13_DEC_NW_TTL = 24, /* Decrement IP TTL. */ - OFPAT13_SET_FIELD = 25, /* Set a header field using OXM TLV format. */ - OFPAT13_PUSH_PBB = 26, /* Push a new PBB service tag (I-TAG) */ - OFPAT13_POP_PBB = 27 /* Pop the outer PBB service tag (I-TAG) */ -}; - /* enum ofp_config_flags value OFPC_INVALID_TTL_TO_CONTROLLER * is deprecated in OpenFlow 1.3 */ diff -Nru openvswitch-2.3.1/include/openflow/openflow-1.4.h openvswitch-2.4.0~git20150623/include/openflow/openflow-1.4.h --- openvswitch-2.3.1/include/openflow/openflow-1.4.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow-1.4.h 2015-06-23 18:46:21.000000000 +0000 @@ -37,7 +37,7 @@ #ifndef OPENFLOW_14_H #define OPENFLOW_14_H 1 -#include "openflow/openflow-1.3.h" +#include /* ## ---------- ## */ @@ -367,4 +367,51 @@ }; OFP_ASSERT(sizeof(struct ofp14_bundle_ctrl_msg) == 8); +/* Body for ofp14_multipart_request of type OFPMP_FLOW_MONITOR. + * + * The OFPMP_FLOW_MONITOR request's body consists of an array of zero or more + * instances of this structure. The request arranges to monitor the flows + * that match the specified criteria, which are interpreted in the same way as + * for OFPMP_FLOW. + * + * 'id' identifies a particular monitor for the purpose of allowing it to be + * canceled later with OFPFMC_DELETE. 'id' must be unique among + * existing monitors that have not already been canceled. + */ +struct ofp14_flow_monitor_request { + ovs_be32 monitor_id; /* Controller-assigned ID for this monitor. */ + ovs_be32 out_port; /* Required output port, if not OFPP_ANY. */ + ovs_be32 out_group; /* Required output port, if not OFPG_ANY. */ + ovs_be16 flags; /* OFPMF14_*. */ + uint8_t table_id; /* One table's ID or OFPTT_ALL (all tables). */ + uint8_t command; /* One of OFPFMC14_*. */ + /* Followed by an ofp11_match structure. */ +}; +OFP_ASSERT(sizeof(struct ofp14_flow_monitor_request) == 16); + +/* Flow monitor commands */ +enum ofp14_flow_monitor_command { + OFPFMC14_ADD = 0, /* New flow monitor. */ + OFPFMC14_MODIFY = 1, /* Modify existing flow monitor. */ + OFPFMC14_DELETE = 2, /* Delete/cancel existing flow monitor. */ +}; + +/* 'flags' bits in struct of_flow_monitor_request. */ +enum ofp14_flow_monitor_flags { + /* When to send updates. */ + /* Common to NX and OpenFlow 1.4 */ + OFPFMF14_INITIAL = 1 << 0, /* Initially matching flows. */ + OFPFMF14_ADD = 1 << 1, /* New matching flows as they are added. */ + OFPFMF14_REMOVED = 1 << 2, /* Old matching flows as they are removed. */ + OFPFMF14_MODIFY = 1 << 3, /* Matching flows as they are changed. */ + + /* What to include in updates. */ + /* Common to NX and OpenFlow 1.4 */ + OFPFMF14_INSTRUCTIONS = 1 << 4, /* If set, instructions are included. */ + OFPFMF14_NO_ABBREV = 1 << 5, /* If set, include own changes in full. */ + /* OpenFlow 1.4 */ + OFPFMF14_ONLY_OWN = 1 << 6, /* If set, don't include other controllers. + */ +}; + #endif /* openflow/openflow-1.4.h */ diff -Nru openvswitch-2.3.1/include/openflow/openflow-1.5.h openvswitch-2.4.0~git20150623/include/openflow/openflow-1.5.h --- openvswitch-2.3.1/include/openflow/openflow-1.5.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow-1.5.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,156 @@ +/* Copyright (c) 2008, 2014 The Board of Trustees of The Leland Stanford +* Junior University +* Copyright (c) 2011, 2014 Open Networking Foundation +* +* We are making the OpenFlow specification and associated documentation +* (Software) available for public use and benefit with the expectation +* that others will use, modify and enhance the Software and contribute +* those enhancements back to the community. However, since we would +* like to make the Software available for broadest use, with as few +* restrictions as possible permission is hereby granted, free of +* charge, to any person obtaining a copy of this Software to deal in +* the Software under the copyrights without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject to +* the following conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* The name and trademarks of copyright holder(s) may NOT be used in +* advertising or publicity pertaining to the Software or any +* derivatives without specific, written prior permission. +*/ + +/* OpenFlow: protocol between controller and datapath. */ + +#ifndef OPENFLOW_15_H +#define OPENFLOW_15_H 1 + +#include + +/* Group commands */ +enum ofp15_group_mod_command { + /* Present since OpenFlow 1.1 - 1.4 */ + OFPGC15_ADD = 0, /* New group. */ + OFPGC15_MODIFY = 1, /* Modify all matching groups. */ + OFPGC15_DELETE = 2, /* Delete all matching groups. */ + + /* New in OpenFlow 1.5 */ + OFPGC15_INSERT_BUCKET = 3,/* Insert action buckets to the already available + list of action buckets in a matching group */ + /* OFPGCXX_YYY = 4, */ /* Reserved for future use. */ + OFPGC15_REMOVE_BUCKET = 5,/* Remove all action buckets or any specific + action bucket from matching group */ +}; + +/* Group bucket property types. */ +enum ofp15_group_bucket_prop_type { + OFPGBPT15_WEIGHT = 0, /* Select groups only. */ + OFPGBPT15_WATCH_PORT = 1, /* Fast failover groups only. */ + OFPGBPT15_WATCH_GROUP = 2, /* Fast failover groups only. */ + OFPGBPT15_EXPERIMENTER = 0xFFFF, /* Experimenter defined. */ +}; + +/* Group bucket weight property, for select groups only. */ +struct ofp15_group_bucket_prop_weight { + ovs_be16 type; /* OFPGBPT15_WEIGHT. */ + ovs_be16 length; /* 8. */ + ovs_be16 weight; /* Relative weight of bucket. */ + uint8_t pad[2]; /* Pad to 64 bits. */ +}; +OFP_ASSERT(sizeof(struct ofp15_group_bucket_prop_weight) == 8); + +/* Group bucket watch port or watch group property, for fast failover groups + * only. */ +struct ofp15_group_bucket_prop_watch { + ovs_be16 type; /* OFPGBPT15_WATCH_PORT or OFPGBPT15_WATCH_GROUP. */ + ovs_be16 length; /* 8. */ + ovs_be32 watch; /* The port or the group. */ +}; +OFP_ASSERT(sizeof(struct ofp15_group_bucket_prop_watch) == 8); + +/* Bucket for use in groups. */ +struct ofp15_bucket { + ovs_be16 len; /* Length the bucket in bytes, including + this header and any padding to make it + 64-bit aligned. */ + ovs_be16 action_array_len; /* Length of all actions in bytes. */ + ovs_be32 bucket_id; /* Bucket Id used to identify bucket*/ + /* Followed by exactly len - 8 bytes of group bucket properties. */ + /* Followed by: + * - Exactly 'action_array_len' bytes containing an array of + * struct ofp_action_*. + * - Zero or more bytes of group bucket properties to fill out the + * overall length in header.length. */ +}; +OFP_ASSERT(sizeof(struct ofp15_bucket) == 8); + +/* Bucket Id can be any value between 0 and OFPG_BUCKET_MAX */ +enum ofp15_group_bucket { + OFPG15_BUCKET_MAX = 0xffffff00, /* Last usable bucket ID */ + OFPG15_BUCKET_FIRST = 0xfffffffd, /* First bucket ID in the list of action + buckets of a group. This is applicable + for OFPGC15_INSERT_BUCKET and + OFPGC15_REMOVE_BUCKET commands */ + OFPG15_BUCKET_LAST = 0xfffffffe, /* Last bucket ID in the list of action + buckets of a group. This is applicable + for OFPGC15_INSERT_BUCKET and + OFPGC15_REMOVE_BUCKET commands */ + OFPG15_BUCKET_ALL = 0xffffffff /* All action buckets in a group, + This is applicable for + only OFPGC15_REMOVE_BUCKET command */ +}; + +/* Group property types. */ +enum ofp_group_prop_type { + OFPGPT15_EXPERIMENTER = 0xFFFF, /* Experimenter defined. */ +}; + +/* Group setup and teardown (controller -> datapath). */ +struct ofp15_group_mod { + ovs_be16 command; /* One of OFPGC15_*. */ + uint8_t type; /* One of OFPGT11_*. */ + uint8_t pad; /* Pad to 64 bits. */ + ovs_be32 group_id; /* Group identifier. */ + ovs_be16 bucket_array_len; /* Length of action buckets data. */ + uint8_t pad1[2]; /* Pad to 64 bits. */ + ovs_be32 command_bucket_id; /* Bucket Id used as part of + * OFPGC15_INSERT_BUCKET and + * OFPGC15_REMOVE_BUCKET commands + * execution.*/ + /* Followed by: + * - Exactly 'bucket_array_len' bytes containing an array of + * struct ofp15_bucket. + * - Zero or more bytes of group properties to fill out the overall + * length in header.length. */ +}; +OFP_ASSERT(sizeof(struct ofp15_group_mod) == 16); + +/* Body of reply to OFPMP_GROUP_DESC request. */ +struct ofp15_group_desc_stats { + ovs_be16 length; /* Length of this entry. */ + uint8_t type; /* One of OFPGT11_*. */ + uint8_t pad; /* Pad to 64 bits. */ + ovs_be32 group_id; /* Group identifier. */ + ovs_be16 bucket_list_len; /* Length of action buckets data. */ + uint8_t pad2[6]; /* Pad to 64 bits. */ + /* Followed by: + * - Exactly 'bucket_list_len' bytes containing an array of + * struct ofp_bucket. + * - Zero or more bytes of group properties to fill out the overall + * length in header.length. */ +}; +OFP_ASSERT(sizeof(struct ofp15_group_desc_stats) == 16); + +#endif /* openflow/openflow-1.5.h */ diff -Nru openvswitch-2.3.1/include/openflow/openflow-common.h openvswitch-2.4.0~git20150623/include/openflow/openflow-common.h --- openvswitch-2.3.1/include/openflow/openflow-common.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow-common.h 2015-06-23 18:46:21.000000000 +0000 @@ -50,7 +50,7 @@ #ifndef OPENFLOW_COMMON_H #define OPENFLOW_COMMON_H 1 -#include "openvswitch/types.h" +#include #ifdef SWIG #define OFP_ASSERT(EXPR) /* SWIG can't handle OFP_ASSERT. */ @@ -98,8 +98,12 @@ * * - ONF_VENDOR_ID is being used within the ONF "extensibility" working * group to identify extensions being proposed for standardization. + * + * The list is sorted numerically. */ #define OF_VENDOR_ID 0 +#define HPL_VENDOR_ID 0x000004EA /* HP Labs. */ +#define NTR_VENDOR_ID 0x00001540 /* Netronome. */ #define NX_VENDOR_ID 0x00002320 /* Nicira. */ #define ONF_VENDOR_ID 0x4f4e4600 /* Open Networking Foundation. */ @@ -268,7 +272,10 @@ enum ofp_packet_in_reason { OFPR_NO_MATCH, /* No matching flow. */ OFPR_ACTION, /* Action explicitly output to controller. */ - OFPR_INVALID_TTL /* Packet has invalid TTL. */, + OFPR_INVALID_TTL, /* Packet has invalid TTL. */ + OFPR_ACTION_SET, /* Output to controller in action set */ + OFPR_GROUP, /* Output to controller in group bucket */ + OFPR_PACKET_OUT, /* Output to controller in packet-out */ OFPR_N_REASONS }; @@ -286,82 +293,6 @@ OFPFF_CHECK_OVERLAP = 1 << 1, /* Check for overlapping entries first. */ }; -/* Action header for OFPAT10_VENDOR and OFPAT11_EXPERIMEMNTER. - * The rest of the body is vendor-defined. */ -struct ofp_action_vendor_header { - ovs_be16 type; /* OFPAT10_VENDOR. */ - ovs_be16 len; /* Length is a multiple of 8. */ - ovs_be32 vendor; /* Vendor ID, which takes the same form - as in "struct ofp_vendor_header". */ -}; -OFP_ASSERT(sizeof(struct ofp_action_vendor_header) == 8); - -/* Action header that is common to all actions. The length includes the - * header and any padding used to make the action 64-bit aligned. - * NB: The length of an action *must* always be a multiple of eight. */ -struct ofp_action_header { - ovs_be16 type; /* One of OFPAT*. */ - ovs_be16 len; /* Length of action, including this - header. This is the length of action, - including any padding to make it - 64-bit aligned. */ - uint8_t pad[4]; -}; -OFP_ASSERT(sizeof(struct ofp_action_header) == 8); - -/* Action structure for OFPAT10_SET_VLAN_VID and OFPAT11_SET_VLAN_VID. */ -struct ofp_action_vlan_vid { - ovs_be16 type; /* Type. */ - ovs_be16 len; /* Length is 8. */ - ovs_be16 vlan_vid; /* VLAN id. */ - uint8_t pad[2]; -}; -OFP_ASSERT(sizeof(struct ofp_action_vlan_vid) == 8); - -/* Action structure for OFPAT10_SET_VLAN_PCP and OFPAT11_SET_VLAN_PCP. */ -struct ofp_action_vlan_pcp { - ovs_be16 type; /* Type. */ - ovs_be16 len; /* Length is 8. */ - uint8_t vlan_pcp; /* VLAN priority. */ - uint8_t pad[3]; -}; -OFP_ASSERT(sizeof(struct ofp_action_vlan_pcp) == 8); - -/* Action structure for OFPAT10_SET_DL_SRC/DST and OFPAT11_SET_DL_SRC/DST. */ -struct ofp_action_dl_addr { - ovs_be16 type; /* Type. */ - ovs_be16 len; /* Length is 16. */ - uint8_t dl_addr[OFP_ETH_ALEN]; /* Ethernet address. */ - uint8_t pad[6]; -}; -OFP_ASSERT(sizeof(struct ofp_action_dl_addr) == 16); - -/* Action structure for OFPAT10_SET_NW_SRC/DST and OFPAT11_SET_NW_SRC/DST. */ -struct ofp_action_nw_addr { - ovs_be16 type; /* Type. */ - ovs_be16 len; /* Length is 8. */ - ovs_be32 nw_addr; /* IP address. */ -}; -OFP_ASSERT(sizeof(struct ofp_action_nw_addr) == 8); - -/* Action structure for OFPAT10_SET_NW_TOS and OFPAT11_SET_NW_TOS. */ -struct ofp_action_nw_tos { - ovs_be16 type; /* Type.. */ - ovs_be16 len; /* Length is 8. */ - uint8_t nw_tos; /* DSCP in high 6 bits, rest ignored. */ - uint8_t pad[3]; -}; -OFP_ASSERT(sizeof(struct ofp_action_nw_tos) == 8); - -/* Action structure for OFPAT10_SET_TP_SRC/DST and OFPAT11_SET_TP_SRC/DST. */ -struct ofp_action_tp_port { - ovs_be16 type; /* Type. */ - ovs_be16 len; /* Length is 8. */ - ovs_be16 tp_port; /* TCP/UDP port. */ - uint8_t pad[2]; -}; -OFP_ASSERT(sizeof(struct ofp_action_tp_port) == 8); - /* Why was this flow removed? */ enum ofp_flow_removed_reason { OFPRR_IDLE_TIMEOUT, /* Flow idle time exceeded idle_timeout. */ @@ -370,6 +301,8 @@ OFPRR_GROUP_DELETE, /* Group was removed. */ OFPRR_METER_DELETE, /* Meter was removed. */ OFPRR_EVICTION, /* Switch eviction to free resources. */ + + OVS_OFPRR_NONE /* OVS internal_use only, keep last!. */ }; /* What changed about the physical port */ diff -Nru openvswitch-2.3.1/include/openflow/openflow.h openvswitch-2.4.0~git20150623/include/openflow/openflow.h --- openvswitch-2.3.1/include/openflow/openflow.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openflow/openflow.h 2015-06-23 18:46:21.000000000 +0000 @@ -17,10 +17,11 @@ #ifndef OPENFLOW_OPENFLOW_H #define OPENFLOW_OPENFLOW_H 1 -#include "openflow/openflow-1.0.h" -#include "openflow/openflow-1.1.h" -#include "openflow/openflow-1.2.h" -#include "openflow/openflow-1.3.h" -#include "openflow/openflow-1.4.h" +#include +#include +#include +#include +#include +#include #endif /* openflow/openflow.h */ diff -Nru openvswitch-2.3.1/include/openvswitch/automake.mk openvswitch-2.4.0~git20150623/include/openvswitch/automake.mk --- openvswitch-2.3.1/include/openvswitch/automake.mk 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,3 +1,12 @@ -noinst_HEADERS += \ - include/openvswitch/types.h +openvswitchincludedir = $(includedir)/openvswitch +openvswitchinclude_HEADERS = \ + include/openvswitch/compiler.h \ + include/openvswitch/list.h \ + include/openvswitch/thread.h \ + include/openvswitch/token-bucket.h \ + include/openvswitch/types.h \ + include/openvswitch/util.h \ + include/openvswitch/version.h \ + include/openvswitch/vconn.h \ + include/openvswitch/vlog.h diff -Nru openvswitch-2.3.1/include/openvswitch/compiler.h openvswitch-2.4.0~git20150623/include/openvswitch/compiler.h --- openvswitch-2.3.1/include/openvswitch/compiler.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/compiler.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_COMPILER_H +#define OPENVSWITCH_COMPILER_H 1 + +#ifndef __has_feature + #define __has_feature(x) 0 +#endif +#ifndef __has_extension + #define __has_extension(x) 0 +#endif + +/* To make OVS_NO_RETURN portable across gcc/clang and MSVC, it should be + * added at the beginning of the function declaration. */ +#if __GNUC__ && !__CHECKER__ +#define OVS_NO_RETURN __attribute__((__noreturn__)) +#elif _MSC_VER +#define OVS_NO_RETURN __declspec(noreturn) +#else +#define OVS_NO_RETURN +#endif + +#if __GNUC__ && !__CHECKER__ +#define OVS_UNUSED __attribute__((__unused__)) +#define OVS_PRINTF_FORMAT(FMT, ARG1) __attribute__((__format__(printf, FMT, ARG1))) +#define OVS_SCANF_FORMAT(FMT, ARG1) __attribute__((__format__(scanf, FMT, ARG1))) +#define OVS_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) +#define OVS_LIKELY(CONDITION) __builtin_expect(!!(CONDITION), 1) +#define OVS_UNLIKELY(CONDITION) __builtin_expect(!!(CONDITION), 0) +#else +#define OVS_UNUSED +#define OVS_PRINTF_FORMAT(FMT, ARG1) +#define OVS_SCANF_FORMAT(FMT, ARG1) +#define OVS_WARN_UNUSED_RESULT +#define OVS_LIKELY(CONDITION) (!!(CONDITION)) +#define OVS_UNLIKELY(CONDITION) (!!(CONDITION)) +#endif + +#if __has_feature(c_thread_safety_attributes) +/* "clang" annotations for thread safety check. + * + * OVS_LOCKABLE indicates that the struct contains mutex element + * which can be locked by functions like ovs_mutex_lock(). + * + * Below, the word MUTEX stands for the name of an object with an OVS_LOCKABLE + * struct type. It can also be a comma-separated list of multiple structs, + * e.g. to require a function to hold multiple locks while invoked. + * + * + * On a variable: + * + * - OVS_GUARDED indicates that the variable may only be accessed some mutex + * is held. + * + * - OVS_GUARDED_BY(MUTEX) indicates that the variable may only be accessed + * while the specific MUTEX is held. + * + * + * On a variable A of mutex type: + * + * - OVS_ACQ_BEFORE(B), where B is a mutex or a comma-separated list of + * mutexes, declare that if both A and B are acquired at the same time, + * then A must be acquired before B. That is, B nests inside A. + * + * - OVS_ACQ_AFTER(B) is the opposite of OVS_ACQ_BEFORE(B), that is, it + * declares that A nests inside B. + * + * + * On a function, the following attributes apply to mutexes: + * + * - OVS_ACQUIRES(MUTEX) indicate that the function must be called without + * holding MUTEX and that it returns holding MUTEX. + * + * - OVS_RELEASES(MUTEX) indicates that the function may only be called with + * MUTEX held and that it returns with MUTEX released. It can be used for + * all types of MUTEX. + * + * - OVS_TRY_LOCK(RETVAL, MUTEX) indicate that the function will try to + * acquire MUTEX. RETVAL is an integer or boolean value specifying the + * return value of a successful lock acquisition. + * + * - OVS_REQUIRES(MUTEX) indicate that the function may only be called with + * MUTEX held and that the function does not release MUTEX. + * + * - OVS_EXCLUDED(MUTEX) indicates that the function may only be called when + * MUTEX is not held. + * + * + * The following variants, with the same syntax, apply to reader-writer locks: + * + * mutex rwlock, for reading rwlock, for writing + * ------------------- ------------------- ------------------- + * OVS_ACQUIRES OVS_ACQ_RDLOCK OVS_ACQ_WRLOCK + * OVS_RELEASES OVS_RELEASES OVS_RELEASES + * OVS_TRY_LOCK OVS_TRY_RDLOCK OVS_TRY_WRLOCK + * OVS_REQUIRES OVS_REQ_RDLOCK OVS_REQ_WRLOCK + * OVS_EXCLUDED OVS_EXCLUDED OVS_EXCLUDED + */ +#define OVS_LOCKABLE __attribute__((lockable)) +#define OVS_REQ_RDLOCK(...) __attribute__((shared_locks_required(__VA_ARGS__))) +#define OVS_ACQ_RDLOCK(...) __attribute__((shared_lock_function(__VA_ARGS__))) +#define OVS_REQ_WRLOCK(...) \ + __attribute__((exclusive_locks_required(__VA_ARGS__))) +#define OVS_ACQ_WRLOCK(...) \ + __attribute__((exclusive_lock_function(__VA_ARGS__))) +#define OVS_REQUIRES(...) \ + __attribute__((exclusive_locks_required(__VA_ARGS__))) +#define OVS_ACQUIRES(...) \ + __attribute__((exclusive_lock_function(__VA_ARGS__))) +#define OVS_TRY_WRLOCK(RETVAL, ...) \ + __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__))) +#define OVS_TRY_RDLOCK(RETVAL, ...) \ + __attribute__((shared_trylock_function(RETVAL, __VA_ARGS__))) +#define OVS_TRY_LOCK(RETVAL, ...) \ + __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__))) +#define OVS_GUARDED __attribute__((guarded_var)) +#define OVS_GUARDED_BY(...) __attribute__((guarded_by(__VA_ARGS__))) +#define OVS_RELEASES(...) __attribute__((unlock_function(__VA_ARGS__))) +#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__))) +#define OVS_ACQ_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__))) +#define OVS_ACQ_AFTER(...) __attribute__((acquired_after(__VA_ARGS__))) +#define OVS_NO_THREAD_SAFETY_ANALYSIS \ + __attribute__((no_thread_safety_analysis)) +#else /* not Clang */ +#define OVS_LOCKABLE +#define OVS_REQ_RDLOCK(...) +#define OVS_ACQ_RDLOCK(...) +#define OVS_REQ_WRLOCK(...) +#define OVS_ACQ_WRLOCK(...) +#define OVS_REQUIRES(...) +#define OVS_ACQUIRES(...) +#define OVS_TRY_WRLOCK(...) +#define OVS_TRY_RDLOCK(...) +#define OVS_TRY_LOCK(...) +#define OVS_GUARDED +#define OVS_GUARDED_BY(...) +#define OVS_EXCLUDED(...) +#define OVS_RELEASES(...) +#define OVS_ACQ_BEFORE(...) +#define OVS_ACQ_AFTER(...) +#define OVS_NO_THREAD_SAFETY_ANALYSIS +#endif + +/* ISO C says that a C implementation may choose any integer type for an enum + * that is sufficient to hold all of its values. Common ABIs (such as the + * System V ABI used on i386 GNU/Linux) always use a full-sized "int", even + * when a smaller type would suffice. + * + * In GNU C, "enum __attribute__((packed)) name { ... }" defines 'name' as an + * enum compatible with a type that is no bigger than necessary. This is the + * intended use of OVS_PACKED_ENUM. + * + * OVS_PACKED_ENUM is intended for use only as a space optimization, since it + * only works with GCC. That means that it must not be used in wire protocols + * or otherwise exposed outside of a single process. */ +#if __GNUC__ && !__CHECKER__ +#define OVS_PACKED_ENUM __attribute__((__packed__)) +#define HAVE_PACKED_ENUM +#else +#define OVS_PACKED_ENUM +#endif + +#ifndef _MSC_VER +#define OVS_PACKED(DECL) DECL __attribute__((__packed__)) +#else +#define OVS_PACKED(DECL) __pragma(pack(push, 1)) DECL __pragma(pack(pop)) +#endif + +/* For defining a structure whose instances should aligned on an N-byte + * boundary. + * + * e.g. The following: + * OVS_ALIGNED_STRUCT(64, mystruct) { ... }; + * is equivalent to the following except that it specifies 64-byte alignment: + * struct mystruct { ... }; + */ +#ifndef _MSC_VER +#define OVS_ALIGNED_STRUCT(N, TAG) struct __attribute__((aligned(N))) TAG +#else +#define OVS_ALIGNED_STRUCT(N, TAG) __declspec(align(N)) struct TAG +#endif + +#ifdef _MSC_VER +#define CCALL __cdecl +#pragma section(".CRT$XCU",read) +#define OVS_CONSTRUCTOR(f) \ + static void __cdecl f(void); \ + __declspec(allocate(".CRT$XCU")) void (__cdecl*f##_)(void) = f; \ + static void __cdecl f(void) +#else +#define OVS_CONSTRUCTOR(f) \ + static void f(void) __attribute__((constructor)); \ + static void f(void) +#endif + +/* OVS_PREFETCH() can be used to instruct the CPU to fetch the cache + * line containing the given address to a CPU cache. + * OVS_PREFETCH_WRITE() should be used when the memory is going to be + * written to. Depending on the target CPU, this can generate the same + * instruction as OVS_PREFETCH(), or bring the data into the cache in an + * exclusive state. */ +#if __GNUC__ +#define OVS_PREFETCH(addr) __builtin_prefetch((addr)) +#define OVS_PREFETCH_WRITE(addr) __builtin_prefetch((addr), 1) +#else +#define OVS_PREFETCH(addr) +#define OVS_PREFETCH_WRITE(addr) +#endif + +#endif /* compiler.h */ diff -Nru openvswitch-2.3.1/include/openvswitch/.gitignore openvswitch-2.4.0~git20150623/include/openvswitch/.gitignore --- openvswitch-2.3.1/include/openvswitch/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1 @@ +/version.h diff -Nru openvswitch-2.3.1/include/openvswitch/list.h openvswitch-2.4.0~git20150623/include/openvswitch/list.h --- openvswitch-2.3.1/include/openvswitch/list.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/list.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef OPENVSWITCH_LIST_H +#define OPENVSWITCH_LIST_H 1 + +/* Doubly linked list head or element. */ +struct ovs_list { + struct ovs_list *prev; /* Previous list element. */ + struct ovs_list *next; /* Next list element. */ +}; + +#define OVS_LIST_INITIALIZER(LIST) { LIST, LIST } + +#endif /* list.h */ diff -Nru openvswitch-2.3.1/include/openvswitch/thread.h openvswitch-2.4.0~git20150623/include/openvswitch/thread.h --- openvswitch-2.3.1/include/openvswitch/thread.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/thread.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2013, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_THREAD_H +#define OPENVSWITCH_THREAD_H 1 + +#include +#include +#include +#include +#include "util.h" + +/* Mutex. */ +struct OVS_LOCKABLE ovs_mutex { + pthread_mutex_t lock; + const char *where; /* NULL if and only if uninitialized. */ +}; + +/* "struct ovs_mutex" initializer. */ +#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP +#define OVS_MUTEX_INITIALIZER { PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, \ + "" } +#else +#define OVS_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, "" } +#endif + +#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP +#define OVS_ADAPTIVE_MUTEX_INITIALIZER \ + { PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP, "" } +#else +#define OVS_ADAPTIVE_MUTEX_INITIALIZER OVS_MUTEX_INITIALIZER +#endif + +/* ovs_mutex functions analogous to pthread_mutex_*() functions. + * + * Most of these functions abort the process with an error message on any + * error. ovs_mutex_trylock() is an exception: it passes through a 0 or EBUSY + * return value to the caller and aborts on any other error. */ +void ovs_mutex_init(const struct ovs_mutex *); +void ovs_mutex_init_recursive(const struct ovs_mutex *); +void ovs_mutex_init_adaptive(const struct ovs_mutex *); +void ovs_mutex_destroy(const struct ovs_mutex *); +void ovs_mutex_unlock(const struct ovs_mutex *mutex) OVS_RELEASES(mutex); +void ovs_mutex_lock_at(const struct ovs_mutex *mutex, const char *where) + OVS_ACQUIRES(mutex); +#define ovs_mutex_lock(mutex) \ + ovs_mutex_lock_at(mutex, OVS_SOURCE_LOCATOR) + +int ovs_mutex_trylock_at(const struct ovs_mutex *mutex, const char *where) + OVS_TRY_LOCK(0, mutex); +#define ovs_mutex_trylock(mutex) \ + ovs_mutex_trylock_at(mutex, OVS_SOURCE_LOCATOR) + +void ovs_mutex_cond_wait(pthread_cond_t *, const struct ovs_mutex *); + +/* Convenient once-only execution. + * + * + * Problem + * ======= + * + * POSIX provides pthread_once_t and pthread_once() as primitives for running a + * set of code only once per process execution. They are used like this: + * + * static void run_once(void) { ...initialization... } + * static pthread_once_t once = PTHREAD_ONCE_INIT; + * ... + * pthread_once(&once, run_once); + * + * pthread_once() does not allow passing any parameters to the initialization + * function, which is often inconvenient, because it means that the function + * can only access data declared at file scope. + * + * + * Solution + * ======== + * + * Use ovsthread_once, like this, instead: + * + * static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + * + * if (ovsthread_once_start(&once)) { + * ...initialization... + * ovsthread_once_done(&once); + * } + */ + +struct ovsthread_once { + bool done; /* Non-atomic, false negatives possible. */ + struct ovs_mutex mutex; +}; + +#define OVSTHREAD_ONCE_INITIALIZER \ + { \ + false, \ + OVS_MUTEX_INITIALIZER, \ + } + +static inline bool ovsthread_once_start(struct ovsthread_once *once) + OVS_TRY_LOCK(true, once->mutex); +void ovsthread_once_done(struct ovsthread_once *once) + OVS_RELEASES(once->mutex); + +bool ovsthread_once_start__(struct ovsthread_once *once) + OVS_TRY_LOCK(true, once->mutex); + +/* Returns true if this is the first call to ovsthread_once_start() for + * 'once'. In this case, the caller should perform whatever initialization + * actions it needs to do, then call ovsthread_once_done() for 'once'. + * + * Returns false if this is not the first call to ovsthread_once_start() for + * 'once'. In this case, the call will not return until after + * ovsthread_once_done() has been called. */ +static inline bool +ovsthread_once_start(struct ovsthread_once *once) +{ + /* We may be reading 'done' at the same time as the first thread + * is writing on it, or we can be using a stale copy of it. The + * worst that can happen is that we call ovsthread_once_start__() + * once when strictly not necessary. */ + return OVS_UNLIKELY(!once->done && ovsthread_once_start__(once)); +} + +#endif /* ovs-thread.h */ diff -Nru openvswitch-2.3.1/include/openvswitch/token-bucket.h openvswitch-2.4.0~git20150623/include/openvswitch/token-bucket.h --- openvswitch-2.3.1/include/openvswitch/token-bucket.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/token-bucket.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2012 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_TOKEN_BUCKET_H +#define OPENVSWITCH_TOKEN_BUCKET_H 1 + +#include +#include + +struct token_bucket { + /* Configuration settings. */ + unsigned int rate; /* Tokens added per millisecond. */ + unsigned int burst; /* Max cumulative tokens credit. */ + + /* Current status. */ + unsigned int tokens; /* Current number of tokens. */ + long long int last_fill; /* Last time tokens added. */ +}; + +#define TOKEN_BUCKET_INIT(RATE, BURST) { RATE, BURST, 0, LLONG_MIN } + +void token_bucket_init(struct token_bucket *, + unsigned int rate, unsigned int burst); +void token_bucket_set(struct token_bucket *, + unsigned int rate, unsigned int burst); +bool token_bucket_withdraw(struct token_bucket *, unsigned int n); +void token_bucket_wait(struct token_bucket *, unsigned int n); + +#endif /* token-bucket.h */ diff -Nru openvswitch-2.3.1/include/openvswitch/types.h openvswitch-2.4.0~git20150623/include/openvswitch/types.h --- openvswitch-2.3.1/include/openvswitch/types.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/types.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2013 Nicira, Inc. + * Copyright (c) 2010, 2011, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ #ifndef OPENVSWITCH_TYPES_H #define OPENVSWITCH_TYPES_H 1 -#include #include #include @@ -30,14 +29,10 @@ #endif /* The ovs_be types indicate that an object is in big-endian, not - * native-endian, byte order. They are otherwise equivalent to uint_t. - * - * We bootstrap these from the Linux __be types. If we instead define our - * own independently then __be and ovs_be become mutually - * incompatible. */ -typedef __be16 ovs_be16; -typedef __be32 ovs_be32; -typedef __be64 ovs_be64; + * native-endian, byte order. They are otherwise equivalent to uint_t. */ +typedef uint16_t OVS_BITWISE ovs_be16; +typedef uint32_t OVS_BITWISE ovs_be32; +typedef uint64_t OVS_BITWISE ovs_be64; #define OVS_BE16_MAX ((OVS_FORCE ovs_be16) 0xffff) #define OVS_BE32_MAX ((OVS_FORCE ovs_be32) 0xffffffff) @@ -86,6 +81,13 @@ #endif } ovs_32aligned_u64; +typedef union { + uint32_t u32[4]; + struct { + uint64_t lo, hi; + } u64; +} ovs_u128; + /* A 64-bit value, in network byte order, that is only aligned on a 32-bit * boundary. */ typedef struct { diff -Nru openvswitch-2.3.1/include/openvswitch/util.h openvswitch-2.4.0~git20150623/include/openvswitch/util.h --- openvswitch-2.3.1/include/openvswitch/util.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/util.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_UTIL_H +#define OPENVSWITCH_UTIL_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void ovs_set_program_name__(const char *name, const char *version, + const char *date, const char *time); + +#define ovs_set_program_name(name, version) \ + ovs_set_program_name__(name, version, __DATE__, __TIME__) + +const char *ovs_get_program_name(void); +const char *ovs_get_program_version(void); + +/* Expands to a string that looks like ":", e.g. "tmp.c:10". + * + * See http://c-faq.com/ansi/stringize.html for an explanation of OVS_STRINGIZE + * and OVS_STRINGIZE2. */ +#define OVS_SOURCE_LOCATOR __FILE__ ":" OVS_STRINGIZE(__LINE__) +#define OVS_STRINGIZE(ARG) OVS_STRINGIZE2(ARG) +#define OVS_STRINGIZE2(ARG) #ARG + +/* Saturating multiplication of "unsigned int"s: overflow yields UINT_MAX. */ +#define OVS_SAT_MUL(X, Y) \ + ((Y) == 0 ? 0 \ + : (X) <= UINT_MAX / (Y) ? (unsigned int) (X) * (unsigned int) (Y) \ + : UINT_MAX) + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru openvswitch-2.3.1/include/openvswitch/vconn.h openvswitch-2.4.0~git20150623/include/openvswitch/vconn.h --- openvswitch-2.3.1/include/openvswitch/vconn.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/vconn.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_VCONN_H +#define OPENVSWITCH_VCONN_H 1 + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct ofpbuf; +struct pvconn; +struct pvconn_class; +struct vconn; +struct vconn_class; + +void vconn_usage(bool active, bool passive, bool bootstrap); + +/* Active vconns: virtual connections to OpenFlow devices. */ +int vconn_verify_name(const char *name); +int vconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp, + struct vconn **vconnp); +void vconn_close(struct vconn *); +const char *vconn_get_name(const struct vconn *); + +uint32_t vconn_get_allowed_versions(const struct vconn *vconn); +void vconn_set_allowed_versions(struct vconn *vconn, + uint32_t allowed_versions); +int vconn_get_version(const struct vconn *); +void vconn_set_recv_any_version(struct vconn *); + +int vconn_connect(struct vconn *); +int vconn_recv(struct vconn *, struct ofpbuf **); +int vconn_send(struct vconn *, struct ofpbuf *); +int vconn_recv_xid(struct vconn *, ovs_be32 xid, struct ofpbuf **); +int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **); +int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **); +int vconn_transact_multiple_noreply(struct vconn *, struct ovs_list *requests, + struct ofpbuf **replyp); +int vconn_bundle_transact(struct vconn *, struct ovs_list *requests, + uint16_t bundle_flags, + void (*error_reporter)(const struct ofp_header *)); + +void vconn_run(struct vconn *); +void vconn_run_wait(struct vconn *); + +int vconn_get_status(const struct vconn *); + +int vconn_open_block(const char *name, uint32_t allowed_versions, uint8_t dscp, + struct vconn **); +int vconn_connect_block(struct vconn *); +int vconn_send_block(struct vconn *, struct ofpbuf *); +int vconn_recv_block(struct vconn *, struct ofpbuf **); + +enum vconn_wait_type { + WAIT_CONNECT, + WAIT_RECV, + WAIT_SEND +}; +void vconn_wait(struct vconn *, enum vconn_wait_type); +void vconn_connect_wait(struct vconn *); +void vconn_recv_wait(struct vconn *); +void vconn_send_wait(struct vconn *); + +/* Passive vconns: virtual listeners for incoming OpenFlow connections. */ +int pvconn_verify_name(const char *name); +int pvconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp, + struct pvconn **pvconnp); +const char *pvconn_get_name(const struct pvconn *); +void pvconn_close(struct pvconn *); +int pvconn_accept(struct pvconn *, struct vconn **); +void pvconn_wait(struct pvconn *); + +#ifdef __cplusplus +} +#endif + +#endif /* vconn.h */ diff -Nru openvswitch-2.3.1/include/openvswitch/version.h.in openvswitch-2.4.0~git20150623/include/openvswitch/version.h.in --- openvswitch-2.3.1/include/openvswitch/version.h.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/version.h.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * Copyright (c) 2014 Cisco Systems, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_VERSION_H +#define OPENVSWITCH_VERSION_H 1 + +#define OVS_PACKAGE_STRING "@PACKAGE_STRING@" +#define OVS_PACKAGE_VERSION "@PACKAGE_VERSION@" + +#define OVS_LIB_VERSION @LT_CURRENT@ +#define OVS_LIB_REVISION @LT_REVISION@ +#define OVS_LIB_AGE @LT_AGE@ + +#endif /* openvswitch/version.h */ diff -Nru openvswitch-2.3.1/include/openvswitch/vlog.h openvswitch-2.4.0~git20150623/include/openvswitch/vlog.h --- openvswitch-2.3.1/include/openvswitch/vlog.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/openvswitch/vlog.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_VLOG_H +#define OPENVSWITCH_VLOG_H 1 + +/* Logging. + * + * + * Thread-safety + * ============= + * + * Fully thread safe. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Logging severity levels. + * + * ovs-appctl(8) defines each of the log levels. */ +#define VLOG_LEVELS \ + VLOG_LEVEL(OFF, LOG_ALERT, 1) \ + VLOG_LEVEL(EMER, LOG_ALERT, 1) \ + VLOG_LEVEL(ERR, LOG_ERR, 3) \ + VLOG_LEVEL(WARN, LOG_WARNING, 4) \ + VLOG_LEVEL(INFO, LOG_NOTICE, 5) \ + VLOG_LEVEL(DBG, LOG_DEBUG, 7) +enum vlog_level { +#define VLOG_LEVEL(NAME, SYSLOG_LEVEL, RFC5424_LEVEL) VLL_##NAME, + VLOG_LEVELS +#undef VLOG_LEVEL + VLL_N_LEVELS +}; + +const char *vlog_get_level_name(enum vlog_level); +enum vlog_level vlog_get_level_val(const char *name); + +/* Destinations that we can log to. */ +#define VLOG_DESTINATIONS \ + VLOG_DESTINATION(SYSLOG, "ovs|%05N|%c%T|%p|%m") \ + VLOG_DESTINATION(CONSOLE, "%D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m") \ + VLOG_DESTINATION(FILE, "%D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m") +enum vlog_destination { +#define VLOG_DESTINATION(NAME, PATTERN) VLF_##NAME, + VLOG_DESTINATIONS +#undef VLOG_DESTINATION + VLF_N_DESTINATIONS, + VLF_ANY_DESTINATION = -1 +}; + +const char *vlog_get_destination_name(enum vlog_destination); +enum vlog_destination vlog_get_destination_val(const char *name); + +/* A log module. */ +struct vlog_module { + struct ovs_list list; + const char *name; /* User-visible name. */ + int levels[VLF_N_DESTINATIONS]; /* Minimum log level for each + destination. */ + int min_level; /* Minimum log level for any destination. */ + bool honor_rate_limits; /* Set false to ignore rate limits. */ +}; + +/* Global list of all logging modules */ +extern struct ovs_list vlog_modules; + +void vlog_insert_module(struct ovs_list *); + +/* Creates and initializes a global instance of a module named MODULE. */ +#define VLOG_DEFINE_MODULE(MODULE) \ + VLOG_DEFINE_MODULE__(MODULE) \ + OVS_CONSTRUCTOR(init_##MODULE) { \ + vlog_insert_module(&VLM_##MODULE.list); \ + } \ + +const char *vlog_get_module_name(const struct vlog_module *); +struct vlog_module *vlog_module_from_name(const char *name); + +/* Rate-limiter for log messages. */ +struct vlog_rate_limit { + struct token_bucket token_bucket; + time_t first_dropped; /* Time first message was dropped. */ + time_t last_dropped; /* Time of most recent message drop. */ + unsigned int n_dropped; /* Number of messages dropped. */ + struct ovs_mutex mutex; /* Mutual exclusion for rate limit. */ +}; + +/* Number of tokens to emit a message. We add 'rate' tokens per millisecond, + * thus 60,000 tokens are required to emit one message per minute. */ +#define VLOG_MSG_TOKENS (60 * 1000) + +/* Initializer for a struct vlog_rate_limit, to set up a maximum rate of RATE + * messages per minute and a maximum burst size of BURST messages. */ +#define VLOG_RATE_LIMIT_INIT(RATE, BURST) \ + { \ + TOKEN_BUCKET_INIT(RATE, OVS_SAT_MUL(BURST, VLOG_MSG_TOKENS)), \ + 0, /* first_dropped */ \ + 0, /* last_dropped */ \ + 0, /* n_dropped */ \ + OVS_MUTEX_INITIALIZER /* mutex */ \ + } + +/* Configuring how each module logs messages. */ +enum vlog_level vlog_get_level(const struct vlog_module *, + enum vlog_destination); +void vlog_set_levels(struct vlog_module *, + enum vlog_destination, enum vlog_level); +char *vlog_set_levels_from_string(const char *) OVS_WARN_UNUSED_RESULT; +void vlog_set_levels_from_string_assert(const char *); +char *vlog_get_levels(void); +bool vlog_is_enabled(const struct vlog_module *, enum vlog_level); +bool vlog_should_drop(const struct vlog_module *, enum vlog_level, + struct vlog_rate_limit *); +void vlog_set_verbosity(const char *arg); + +/* Configuring log destinations. */ +void vlog_set_pattern(enum vlog_destination, const char *pattern); +int vlog_set_log_file(const char *file_name); +int vlog_reopen_log_file(void); + +/* Configure syslog target. */ +void vlog_set_syslog_target(const char *target); + +/* Initialization. */ +void vlog_init(void); +void vlog_enable_async(void); + +/* Functions for actual logging. */ +void vlog(const struct vlog_module *, enum vlog_level, const char *format, ...) + OVS_PRINTF_FORMAT (3, 4); +void vlog_valist(const struct vlog_module *, enum vlog_level, + const char *, va_list) + OVS_PRINTF_FORMAT (3, 0); + +OVS_NO_RETURN void vlog_fatal(const struct vlog_module *, const char *format, ...) + OVS_PRINTF_FORMAT (2, 3); +OVS_NO_RETURN void vlog_fatal_valist(const struct vlog_module *, + const char *format, va_list) + OVS_PRINTF_FORMAT (2, 0); + +OVS_NO_RETURN void vlog_abort(const struct vlog_module *, const char *format, ...) + OVS_PRINTF_FORMAT (2, 3); +OVS_NO_RETURN void vlog_abort_valist(const struct vlog_module *, + const char *format, va_list) + OVS_PRINTF_FORMAT (2, 0); + +void vlog_rate_limit(const struct vlog_module *, enum vlog_level, + struct vlog_rate_limit *, const char *, ...) + OVS_PRINTF_FORMAT (4, 5); + +/* Creates and initializes a global instance of a module named MODULE, and + * defines a static variable named THIS_MODULE that points to it, for use with + * the convenience macros below. */ +#define VLOG_DEFINE_THIS_MODULE(MODULE) \ + VLOG_DEFINE_MODULE(MODULE); \ + static struct vlog_module *const THIS_MODULE = &VLM_##MODULE + +/* Convenience macros. These assume that THIS_MODULE points to a "struct + * vlog_module" for the current module, as set up by e.g. the + * VLOG_DEFINE_MODULE macro above. + * + * Guaranteed to preserve errno. + */ +#define VLOG_FATAL(...) vlog_fatal(THIS_MODULE, __VA_ARGS__) +#define VLOG_ABORT(...) vlog_abort(THIS_MODULE, __VA_ARGS__) +#define VLOG_EMER(...) VLOG(VLL_EMER, __VA_ARGS__) +#define VLOG_ERR(...) VLOG(VLL_ERR, __VA_ARGS__) +#define VLOG_WARN(...) VLOG(VLL_WARN, __VA_ARGS__) +#define VLOG_INFO(...) VLOG(VLL_INFO, __VA_ARGS__) +#define VLOG_DBG(...) VLOG(VLL_DBG, __VA_ARGS__) + +/* More convenience macros, for testing whether a given level is enabled in + * THIS_MODULE. When constructing a log message is expensive, this enables it + * to be skipped. */ +#define VLOG_IS_ERR_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_ERR) +#define VLOG_IS_WARN_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_WARN) +#define VLOG_IS_INFO_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_INFO) +#define VLOG_IS_DBG_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_DBG) + +/* Convenience macros for rate-limiting. + * Guaranteed to preserve errno. + */ +#define VLOG_ERR_RL(RL, ...) VLOG_RL(RL, VLL_ERR, __VA_ARGS__) +#define VLOG_WARN_RL(RL, ...) VLOG_RL(RL, VLL_WARN, __VA_ARGS__) +#define VLOG_INFO_RL(RL, ...) VLOG_RL(RL, VLL_INFO, __VA_ARGS__) +#define VLOG_DBG_RL(RL, ...) VLOG_RL(RL, VLL_DBG, __VA_ARGS__) + +/* Convenience macros to additionally store log message in buffer + * Caller is responsible for freeing *ERRP afterwards */ +#define VLOG_ERR_BUF(ERRP, ...) VLOG_ERRP(ERRP, VLL_ERR, __VA_ARGS__) +#define VLOG_WARN_BUF(ERRP, ...) VLOG_ERRP(ERRP, VLL_WARN, __VA_ARGS__) + +#define VLOG_DROP_ERR(RL) vlog_should_drop(THIS_MODULE, VLL_ERR, RL) +#define VLOG_DROP_WARN(RL) vlog_should_drop(THIS_MODULE, VLL_WARN, RL) +#define VLOG_DROP_INFO(RL) vlog_should_drop(THIS_MODULE, VLL_INFO, RL) +#define VLOG_DROP_DBG(RL) vlog_should_drop(THIS_MODULE, VLL_DBG, RL) + +/* Macros for logging at most once per execution. */ +#define VLOG_ERR_ONCE(...) VLOG_ONCE(VLL_ERR, __VA_ARGS__) +#define VLOG_WARN_ONCE(...) VLOG_ONCE(VLL_WARN, __VA_ARGS__) +#define VLOG_INFO_ONCE(...) VLOG_ONCE(VLL_INFO, __VA_ARGS__) +#define VLOG_DBG_ONCE(...) VLOG_ONCE(VLL_DBG, __VA_ARGS__) + +/* Command line processing. */ +#define VLOG_OPTION_ENUMS \ + OPT_LOG_FILE, \ + OPT_SYSLOG_TARGET + +#define VLOG_LONG_OPTIONS \ + {"verbose", optional_argument, NULL, 'v'}, \ + {"log-file", optional_argument, NULL, OPT_LOG_FILE}, \ + {"syslog-target", required_argument, NULL, OPT_SYSLOG_TARGET} + +#define VLOG_OPTION_HANDLERS \ + case 'v': \ + vlog_set_verbosity(optarg); \ + break; \ + case OPT_LOG_FILE: \ + vlog_set_log_file(optarg); \ + break; \ + case OPT_SYSLOG_TARGET: \ + vlog_set_syslog_target(optarg); \ + break; + +void vlog_usage(void); + +/* Implementation details. */ +#define VLOG(LEVEL, ...) \ + do { \ + enum vlog_level level__ = LEVEL; \ + if (THIS_MODULE->min_level >= level__) { \ + vlog(THIS_MODULE, level__, __VA_ARGS__); \ + } \ + } while (0) +#define VLOG_RL(RL, LEVEL, ...) \ + do { \ + enum vlog_level level__ = LEVEL; \ + if (THIS_MODULE->min_level >= level__) { \ + vlog_rate_limit(THIS_MODULE, level__, RL, __VA_ARGS__); \ + } \ + } while (0) +#define VLOG_ONCE(LEVEL, ...) \ + do { \ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; \ + if (ovsthread_once_start(&once)) { \ + vlog(THIS_MODULE, LEVEL, __VA_ARGS__); \ + ovsthread_once_done(&once); \ + } \ + } while (0) +#define VLOG_ERRP(ERRP, LEVEL, ...) \ + do { \ + VLOG(LEVEL, __VA_ARGS__); \ + if (ERRP) { \ + *(ERRP) = xasprintf(__VA_ARGS__); \ + } \ + } while (0) + +#define VLOG_DEFINE_MODULE__(MODULE) \ + extern struct vlog_module VLM_##MODULE; \ + struct vlog_module VLM_##MODULE = \ + { \ + OVS_LIST_INITIALIZER(&VLM_##MODULE.list), \ + #MODULE, /* name */ \ + { VLL_INFO, VLL_INFO, VLL_INFO }, /* levels */ \ + VLL_INFO, /* min_level */ \ + true /* honor_rate_limits */ \ + }; + +#ifdef __cplusplus +} +#endif + +#endif /* vlog.h */ diff -Nru openvswitch-2.3.1/include/sparse/automake.mk openvswitch-2.4.0~git20150623/include/sparse/automake.mk --- openvswitch-2.3.1/include/sparse/automake.mk 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/sparse/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,10 +1,15 @@ noinst_HEADERS += \ include/sparse/arpa/inet.h \ include/sparse/assert.h \ + include/sparse/bmi2intrin.h \ + include/sparse/emmintrin.h \ include/sparse/math.h \ include/sparse/netinet/in.h \ include/sparse/netinet/ip6.h \ include/sparse/netpacket/packet.h \ include/sparse/pthread.h \ + include/sparse/rte_atomic.h \ + include/sparse/rte_lcore.h \ + include/sparse/rte_vect.h \ include/sparse/sys/socket.h \ include/sparse/sys/wait.h diff -Nru openvswitch-2.3.1/include/sparse/bmi2intrin.h openvswitch-2.4.0~git20150623/include/sparse/bmi2intrin.h --- openvswitch-2.3.1/include/sparse/bmi2intrin.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/sparse/bmi2intrin.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,25 @@ +/* Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* Sparse doesn't know the __int128 type used by GCC 4.9 *intrin.h headers. + * We cannot use a typedef because the type is used with a qualifier + * ('unsigned __int128') */ +#define __int128 int +#include_next +#undef __int128 diff -Nru openvswitch-2.3.1/include/sparse/emmintrin.h openvswitch-2.4.0~git20150623/include/sparse/emmintrin.h --- openvswitch-2.3.1/include/sparse/emmintrin.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/sparse/emmintrin.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,27 @@ +/* Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* GCC 4.8 *intrin.h headers do not work if these are not defined */ +#define __SSE2__ +#define __SSE__ +#define __MMX__ +#include_next +#undef __MMX__ +#undef __SSE__ +#undef __SSE2__ diff -Nru openvswitch-2.3.1/include/sparse/netinet/in.h openvswitch-2.4.0~git20150623/include/sparse/netinet/in.h --- openvswitch-2.3.1/include/sparse/netinet/in.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/sparse/netinet/in.h 2015-06-23 18:46:21.000000000 +0000 @@ -61,10 +61,12 @@ #define IPPROTO_IPV6 41 #define IPPROTO_HOPOPTS 0 #define IPPROTO_ICMP 1 +#define IPPROTO_IGMP 2 #define IPPROTO_TCP 6 #define IPPROTO_UDP 17 #define IPPROTO_ROUTING 43 #define IPPROTO_FRAGMENT 44 +#define IPPROTO_GRE 47 #define IPPROTO_AH 51 #define IPPROTO_ICMPV6 58 #define IPPROTO_NONE 59 diff -Nru openvswitch-2.3.1/include/sparse/rte_atomic.h openvswitch-2.4.0~git20150623/include/sparse/rte_atomic.h --- openvswitch-2.3.1/include/sparse/rte_atomic.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/sparse/rte_atomic.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,25 @@ +/* Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* Fix sparse technicality about types in one of the function calls by just + * ignoring it. */ +#define __sync_add_and_fetch(a, b) (0) + +/* Get actual definitions for us to annotate and build on. */ +#include_next diff -Nru openvswitch-2.3.1/include/sparse/rte_lcore.h openvswitch-2.4.0~git20150623/include/sparse/rte_lcore.h --- openvswitch-2.3.1/include/sparse/rte_lcore.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/sparse/rte_lcore.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,23 @@ +/* Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +typedef int rte_cpuset_t; + +/* Get actual definitions for us to annotate and build on. */ +#include_next diff -Nru openvswitch-2.3.1/include/sparse/rte_vect.h openvswitch-2.4.0~git20150623/include/sparse/rte_vect.h --- openvswitch-2.3.1/include/sparse/rte_vect.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/sparse/rte_vect.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,23 @@ +/* Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +typedef int __m128i; + +/* Get actual definitions for us to annotate and build on. */ +#include_next diff -Nru openvswitch-2.3.1/include/windows/automake.mk openvswitch-2.4.0~git20150623/include/windows/automake.mk --- openvswitch-2.3.1/include/windows/automake.mk 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -9,8 +9,11 @@ include/windows/arpa/inet.h \ include/windows/dirent.h \ include/windows/getopt.h \ + include/windows/linux/pkt_sched.h \ + include/windows/linux/types.h \ include/windows/net/if.h \ include/windows/netdb.h \ + include/windows/netpacket/packet.h \ include/windows/netinet/icmp6.h \ include/windows/netinet/in.h \ include/windows/netinet/in_systm.h \ @@ -20,6 +23,7 @@ include/windows/poll.h \ include/windows/strings.h \ include/windows/syslog.h \ + include/windows/sys/epoll.h \ include/windows/sys/ioctl.h \ include/windows/sys/resource.h \ include/windows/sys/socket.h \ diff -Nru openvswitch-2.3.1/include/windows/linux/pkt_sched.h openvswitch-2.4.0~git20150623/include/windows/linux/pkt_sched.h --- openvswitch-2.3.1/include/windows/linux/pkt_sched.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/linux/pkt_sched.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * Copyright 2014 Cloudbase Solutions Srl + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __LINUX_PKT_SCHED_H +#define __LINUX_PKT_SCHED_H 1 + +#define TC_H_MAJ_MASK (0xFFFF0000U) + +#define TC_H_MIN_MASK (0x0000FFFFU) + +#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK)) + +#endif /* linux/pkt_sched.h */ diff -Nru openvswitch-2.3.1/include/windows/net/if.h openvswitch-2.4.0~git20150623/include/windows/net/if.h --- openvswitch-2.3.1/include/windows/net/if.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/net/if.h 2015-06-23 18:46:21.000000000 +0000 @@ -21,4 +21,54 @@ #define IFNAMSIZ IF_NAMESIZE +enum { + IFLA_UNSPEC, + IFLA_ADDRESS, + IFLA_BROADCAST, + IFLA_IFNAME, + IFLA_MTU, + IFLA_LINK, + IFLA_QDISC, + IFLA_STATS, + IFLA_COST, +#define IFLA_COST IFLA_COST + IFLA_PRIORITY, +#define IFLA_PRIORITY IFLA_PRIORITY + IFLA_MASTER, +#define IFLA_MASTER IFLA_MASTER + IFLA_WIRELESS, +#define IFLA_WIRELESS IFLA_WIRELESS + IFLA_PROTINFO, +#define IFLA_PROTINFO IFLA_PROTINFO + IFLA_TXQLEN, +#define IFLA_TXQLEN IFLA_TXQLEN + IFLA_MAP, +#define IFLA_MAP IFLA_MAP + IFLA_WEIGHT, +#define IFLA_WEIGHT IFLA_WEIGHT + IFLA_OPERSTATE, + IFLA_LINKMODE, + IFLA_LINKINFO, +#define IFLA_LINKINFO IFLA_LINKINFO + IFLA_NET_NS_PID, + IFLA_IFALIAS, + IFLA_NUM_VF, + IFLA_VFINFO_LIST, + IFLA_STATS64, + IFLA_VF_PORTS, + IFLA_PORT_SELF, + IFLA_AF_SPEC, + IFLA_GROUP, + IFLA_NET_NS_FD, + IFLA_EXT_MASK, + IFLA_PROMISCUITY, +#define IFLA_PROMISCUITY IFLA_PROMISCUITY + IFLA_NUM_TX_QUEUES, + IFLA_NUM_RX_QUEUES, + IFLA_CARRIER, + IFLA_PHYS_PORT_ID, + __IFLA_MAX +}; +#define IFLA_MAX (__IFLA_MAX - 1) + #endif /* net/if.h */ diff -Nru openvswitch-2.3.1/include/windows/netinet/in.h openvswitch-2.4.0~git20150623/include/windows/netinet/in.h --- openvswitch-2.3.1/include/windows/netinet/in.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/netinet/in.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __NETINET_IN_H +#define __NETINET_IN_H 1 + +#define IPPROTO_GRE 47 + +#endif /* netinet/in.h */ diff -Nru openvswitch-2.3.1/include/windows/netinet/ip.h openvswitch-2.4.0~git20150623/include/windows/netinet/ip.h --- openvswitch-2.3.1/include/windows/netinet/ip.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/netinet/ip.h 2015-06-23 18:46:21.000000000 +0000 @@ -21,5 +21,6 @@ #define MAXTTL 255 #define IPTOS_LOWDELAY 0x10 #define IPTOS_THROUGHPUT 0x08 +#define IP_DF 0x4000 /* dont fragment flag */ #endif /* netinet/ip.h */ diff -Nru openvswitch-2.3.1/include/windows/netpacket/packet.h openvswitch-2.4.0~git20150623/include/windows/netpacket/packet.h --- openvswitch-2.3.1/include/windows/netpacket/packet.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/netpacket/packet.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright 2014 Cloudbase Solutions Srl + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __NETPACKET_PACKET_H +#define __NETPACKET_PACKET_H 1 + +struct iovec +{ + void *iov_base; + unsigned int iov_len; +}; + +struct msghdr + { + void *msg_name; + socklen_t msg_namelen; + + struct iovec *msg_iov; + size_t msg_iovlen; + + void *msg_control; + size_t msg_controllen; + + int msg_flags; + }; + +#endif /* netpacket/packet.h */ diff -Nru openvswitch-2.3.1/include/windows/sys/epoll.h openvswitch-2.4.0~git20150623/include/windows/sys/epoll.h --- openvswitch-2.3.1/include/windows/sys/epoll.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/sys/epoll.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright 2014 Cloudbase Solutions Srl + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __SYS_EPOLL_H +#define __SYS_EPOLL_H 1 + +#define EPOLLIN 0x00001 + +typedef union data { + uint32_t u32; +} data_t; + +struct epoll_event { + uint32_t events; + data_t data; +}; + +#endif /* sys/epoll.h */ diff -Nru openvswitch-2.3.1/include/windows/sys/uio.h openvswitch-2.4.0~git20150623/include/windows/sys/uio.h --- openvswitch-2.3.1/include/windows/sys/uio.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/sys/uio.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,22 @@ +/* + * Copyright 2014 Cloudbase Solutions Srl + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __SYS_UIO_H +#define __SYS_UIO_H 1 + +#include + +#endif /* sys/uio.h */ diff -Nru openvswitch-2.3.1/include/windows/syslog.h openvswitch-2.4.0~git20150623/include/windows/syslog.h --- openvswitch-2.3.1/include/windows/syslog.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/syslog.h 2015-06-23 18:46:21.000000000 +0000 @@ -26,7 +26,19 @@ #define LOG_INFO 6 /* informational */ #define LOG_DEBUG 7 /* debug-level messages */ #define LOG_NDELAY 8 /* don't delay open */ -#define LOG_DAEMON 24 /* system daemons */ + +#define LOG_KERN (0<<3) /* kernel messages */ +#define LOG_USER (1<<3) /* user-level messages */ +#define LOG_MAIL (2<<3) /* mail system */ +#define LOG_DAEMON (3<<3) /* system daemons */ +#define LOG_AUTH (4<<3) /* security/authorization messages */ +#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ +#define LOG_LPR (6<<3) /* line printer subsystem */ +#define LOG_NEWS (7<<3) /* network news subsystem */ +#define LOG_UUCP (8<<3) /* UUCP subsystem */ +#define LOG_CRON (9<<3) /* clock daemon */ +#define LOG_AUTHPRIV (10<<3) /* security/authorization messages */ +#define LOG_FTP (11<<3) /* FTP daemon */ #define LOG_LOCAL0 (16<<3) /* reserved for local use */ #define LOG_LOCAL1 (17<<3) /* reserved for local use */ diff -Nru openvswitch-2.3.1/include/windows/unistd.h openvswitch-2.4.0~git20150623/include/windows/unistd.h --- openvswitch-2.3.1/include/windows/unistd.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/include/windows/unistd.h 2015-06-23 18:46:21.000000000 +0000 @@ -16,6 +16,9 @@ #ifndef _UNISTD_H #define _UNISTD_H 1 +#define WIN32_LEAN_AND_MEAN +#include + #define fsync _commit /* Standard file descriptors. */ @@ -23,4 +26,51 @@ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. */ +#define _SC_UIO_MAXIOV 2 +#define _XOPEN_IOV_MAX 16 + +#define _SC_PAGESIZE 0x1 +#define _SC_NPROCESSORS_ONLN 0x2 +#define _SC_PHYS_PAGES 0x4 + +__inline int GetNumLogicalProcessors(void) +{ + SYSTEM_INFO info_temp; + GetSystemInfo(&info_temp); + long int n_cores = info_temp.dwNumberOfProcessors; + return n_cores; +} + +__inline long sysconf(int type) +{ + long value = -1; + long page_size = -1; + SYSTEM_INFO sys_info; + MEMORYSTATUSEX status; + + switch (type) { + case _SC_NPROCESSORS_ONLN: + value = GetNumLogicalProcessors(); + break; + + case _SC_PAGESIZE: + GetSystemInfo(&sys_info); + value = sys_info.dwPageSize; + break; + + case _SC_PHYS_PAGES: + status.dwLength = sizeof(status); + page_size = sysconf(_SC_PAGESIZE); + if (GlobalMemoryStatusEx(&status) && page_size != -1) { + value = status.ullTotalPhys / page_size; + } + break; + + default: + break; + } + + return value; +} + #endif /* unistd.h */ diff -Nru openvswitch-2.3.1/INSTALL openvswitch-2.4.0~git20150623/INSTALL --- openvswitch-2.3.1/INSTALL 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL 1970-01-01 00:00:00.000000000 +0000 @@ -1,553 +0,0 @@ - How to Install Open vSwitch on Linux, FreeBSD and NetBSD - ======================================================== - -This document describes how to build and install Open vSwitch on a -generic Linux, FreeBSD, or NetBSD host. For specifics around installation -on a specific platform, please see one of these files: - - - INSTALL.Debian - - INSTALL.Fedora - - INSTALL.RHEL - - INSTALL.XenServer - - INSTALL.NetBSD - - INSTALL.DPDK - -Build Requirements ------------------- - -To compile the userspace programs in the Open vSwitch distribution, -you will need the following software: - - - GNU make. - - - A C compiler, such as: - - * GCC 4.x. - - * Clang. Clang 3.4 and later provide useful static semantic - analysis and thread-safety checks. For Ubuntu, there are - nightly built packages available on clang's website. - - - libssl, from OpenSSL, is optional but recommended if you plan to - connect the Open vSwitch to an OpenFlow controller. libssl is - required to establish confidentiality and authenticity in the - connections from an Open vSwitch to an OpenFlow controller. If - libssl is installed, then Open vSwitch will automatically build - with support for it. - - - Python 2.x, for x >= 4. - -On Linux, you may choose to compile the kernel module that comes with -the Open vSwitch distribution or to use the kernel module built into -the Linux kernel (version 3.3 or later). See the FAQ question "What -features are not available in the Open vSwitch kernel datapath that -ships as part of the upstream Linux kernel?" for more information on -this trade-off. You may also use the userspace-only implementation, -at some cost in features and performance (see INSTALL.userspace for -details). To compile the kernel module on Linux, you must also -install the following: - - - A supported Linux kernel version. Please refer to README for a - list of supported versions. - - The Open vSwitch datapath requires bridging support - (CONFIG_BRIDGE) to be built as a kernel module. (This is common - in kernels provided by Linux distributions.) The bridge module - must not be loaded or in use. If the bridge module is running - (check with "lsmod | grep bridge"), you must remove it ("rmmod - bridge") before starting the datapath. - - For optional support of ingress policing, you must enable kernel - configuration options NET_CLS_BASIC, NET_SCH_INGRESS, and - NET_ACT_POLICE, either built-in or as modules. (NET_CLS_POLICE is - obsolete and not needed.) - - To use GRE tunneling on Linux 2.6.37 or newer, kernel support - for GRE must be compiled in or available as a module - (CONFIG_NET_IPGRE_DEMUX). - - To configure HTB or HFSC quality of service with Open vSwitch, - you must enable the respective configuration options. - - To use Open vSwitch support for TAP devices, you must enable - CONFIG_TUN. - - - To build a kernel module, you need the same version of GCC that - was used to build that kernel. - - - A kernel build directory corresponding to the Linux kernel image - the module is to run on. Under Debian and Ubuntu, for example, - each linux-image package containing a kernel binary has a - corresponding linux-headers package with the required build - infrastructure. - -If you are working from a Git tree or snapshot (instead of from a -distribution tarball), or if you modify the Open vSwitch build system -or the database schema, you will also need the following software: - - - Autoconf version 2.63 or later. - - - Automake version 1.10 or later. - - - libtool version 2.4 or later. (Older versions might work too.) - -To run the unit tests, you also need: - - - Perl. Version 5.10.1 is known to work. Earlier versions should - also work. - -The ovs-vswitchd.conf.db(5) manpage will include an E-R diagram, in -formats other than plain text, only if you have the following: - - - "dot" from graphviz (http://www.graphviz.org/). - - - Perl. Version 5.10.1 is known to work. Earlier versions should - also work. - - - Python 2.x, for x >= 4. - -If you are going to extensively modify Open vSwitch, please consider -installing the following to obtain better warnings: - - - "sparse" version 0.4.4 or later - (http://www.kernel.org/pub/software/devel/sparse/dist/). - - - GNU make. - - - clang, version 3.4 or later - -Also, you may find the ovs-dev script found in utilities/ovs-dev.py useful. - -Installation Requirements -------------------------- - -The machine on which Open vSwitch is to be installed must have the -following software: - - - libc compatible with the libc used for build. - - - libssl compatible with the libssl used for build, if OpenSSL was - used for the build. - - - On Linux, the same kernel version configured as part of the build. - - - For optional support of ingress policing on Linux, the "tc" program - from iproute2 (part of all major distributions and available at - http://www.linux-foundation.org/en/Net:Iproute2). - -On Linux you should ensure that /dev/urandom exists. To support TAP -devices, you must also ensure that /dev/net/tun exists. - -Building and Installing Open vSwitch for Linux, FreeBSD or NetBSD -================================================================= - -Once you have installed all the prerequisites listed above in the Base -Prerequisites section, follow the procedure below to build. - -1. If you pulled the sources directly from an Open vSwitch Git tree, - run boot.sh in the top source directory: - - % ./boot.sh - -2. Configure the package by running the configure script. You can - usually invoke configure without any arguments. For example: - - % ./configure - - By default all files are installed under /usr/local. If you want - to install into, e.g., /usr and /var instead of /usr/local and - /usr/local/var, add options as shown here: - - % ./configure --prefix=/usr --localstatedir=/var - - To use a specific C compiler for compiling Open vSwitch user - programs, also specify it on the configure command line, like so: - - % ./configure CC=gcc-4.2 - - To use 'clang' compiler: - - % ./configure CC=clang - - To build the Linux kernel module, so that you can run the - kernel-based switch, pass the location of the kernel build - directory on --with-linux. For example, to build for a running - instance of Linux: - - % ./configure --with-linux=/lib/modules/`uname -r`/build - - If --with-linux requests building for an unsupported version of - Linux, then "configure" will fail with an error message. Please - refer to the FAQ for advice in that case. - - If you wish to build the kernel module for an architecture other - than the architecture of the machine used for the build, you may - specify the kernel architecture string using the KARCH variable - when invoking the configure script. For example, to build for MIPS - with Linux: - - % ./configure --with-linux=/path/to/linux KARCH=mips - - If you plan to do much Open vSwitch development, you might want to - add --enable-Werror, which adds the -Werror option to the compiler - command line, turning warnings into errors. That makes it - impossible to miss warnings generated by the build. - - To build with gcov code coverage support, add --enable-coverage, - e.g.: - - % ./configure --enable-coverage - - The configure script accepts a number of other options and honors - additional environment variables. For a full list, invoke - configure with the --help option. - - You can also run configure from a separate build directory. This - is helpful if you want to build Open vSwitch in more than one way - from a single source directory, e.g. to try out both GCC and Clang - builds, or to build kernel modules for more than one Linux version. - Here is an example: - - % mkdir _gcc && (cd _gcc && ../configure CC=gcc) - % mkdir _clang && (cd _clang && ../configure CC=clang) - -3. Run GNU make in the build directory, e.g.: - - % make - - or if GNU make is installed as "gmake": - - % gmake - - If you used a separate build directory, run make or gmake from that - directory, e.g.: - - % make -C _gcc - % make -C _clang - - For improved warnings if you installed "sparse" (see - "Prerequisites"), add C=1 to the command line. - -4. Consider running the testsuite. Refer to "Running the Testsuite" - below, for instructions. - -5. Become root by running "su" or another program. - -6. Run "make install" to install the executables and manpages into the - running system, by default under /usr/local. - -7. If you built kernel modules, you may install and load them, e.g.: - - % make modules_install - % /sbin/modprobe openvswitch - - To verify that the modules have been loaded, run "/sbin/lsmod" and - check that openvswitch is listed. - - If the "modprobe" operation fails, look at the last few kernel log - messages (e.g. with "dmesg | tail"): - - - The message "openvswitch: exports duplicate symbol - br_should_route_hook (owned by bridge)" means that the bridge - module is loaded. Run "/sbin/rmmod bridge" to remove it. - - If "/sbin/rmmod bridge" fails with "ERROR: Module bridge does - not exist in /proc/modules", then the bridge is compiled into - the kernel, rather than as a module. Open vSwitch does not - support this configuration (see "Build Requirements", above). - - - The message "openvswitch: exports duplicate symbol - dp_ioctl_hook (owned by ofdatapath)" means that the ofdatapath - module from the OpenFlow reference implementation is loaded. - Run "/sbin/rmmod ofdatapath" to remove it. (You might have to - delete any existing datapaths beforehand, using the "dpctl" - program included with the OpenFlow reference implementation. - "ovs-dpctl" will not work.) - - - Otherwise, the most likely problem is that Open vSwitch was - built for a kernel different from the one into which you are - trying to load it. Run "modinfo" on openvswitch.ko and on - a module built for the running kernel, e.g.: - - % /sbin/modinfo openvswitch.ko - % /sbin/modinfo /lib/modules/`uname -r`/kernel/net/bridge/bridge.ko - - Compare the "vermagic" lines output by the two commands. If - they differ, then Open vSwitch was built for the wrong kernel. - - - If you decide to report a bug or ask a question related to - module loading, please include the output from the "dmesg" and - "modinfo" commands mentioned above. - - There is an optional module parameter to openvswitch.ko called - vlan_tso that enables TCP segmentation offload over VLANs on NICs - that support it. Many drivers do not expose support for TSO on VLANs - in a way that Open vSwitch can use but there is no way to detect - whether this is the case. If you know that your particular driver can - handle it (for example by testing sending large TCP packets over VLANs) - then passing in a value of 1 may improve performance. Modules built for - Linux kernels 2.6.37 and later, as well as specially patched versions - of earlier kernels, do not need this and do not have this parameter. If - you do not understand what this means or do not know if your driver - will work, do not set this. - -8. Initialize the configuration database using ovsdb-tool, e.g.: - - % mkdir -p /usr/local/etc/openvswitch - % ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema - -Startup -======= - -Before starting ovs-vswitchd itself, you need to start its -configuration database, ovsdb-server. Each machine on which Open -vSwitch is installed should run its own copy of ovsdb-server. -Configure it to use the database you created during installation (as -explained above), to listen on a Unix domain socket, to connect to any -managers specified in the database itself, and to use the SSL -configuration in the database: - - % ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ - --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ - --private-key=db:Open_vSwitch,SSL,private_key \ - --certificate=db:Open_vSwitch,SSL,certificate \ - --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \ - --pidfile --detach - -(If you built Open vSwitch without SSL support, then omit ---private-key, --certificate, and --bootstrap-ca-cert.) - -Then initialize the database using ovs-vsctl. This is only -necessary the first time after you create the database with -ovsdb-tool (but running it at any time is harmless): - - % ovs-vsctl --no-wait init - -Then start the main Open vSwitch daemon, telling it to connect to the -same Unix domain socket: - - % ovs-vswitchd --pidfile --detach - -Now you may use ovs-vsctl to set up bridges and other Open vSwitch -features. For example, to create a bridge named br0 and add ports -eth0 and vif1.0 to it: - - % ovs-vsctl add-br br0 - % ovs-vsctl add-port br0 eth0 - % ovs-vsctl add-port br0 vif1.0 - -Please refer to ovs-vsctl(8) for more details. - -Upgrading -========= - -When you upgrade Open vSwitch from one version to another, you should -also upgrade the database schema: - -1. Stop the Open vSwitch daemons, e.g.: - - % kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid` - -2. Install the new Open vSwitch release. - -3. Upgrade the database, in one of the following two ways: - - - If there is no important data in your database, then you may - delete the database file and recreate it with ovsdb-tool, - following the instructions under "Building and Installing Open - vSwitch for Linux, FreeBSD or NetBSD". - - - If you want to preserve the contents of your database, back it - up first, then use "ovsdb-tool convert" to upgrade it, e.g.: - - % ovsdb-tool convert /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema - -4. Start the Open vSwitch daemons as described under "Building and - Installing Open vSwitch for Linux, FreeBSD or NetBSD" above. - -Hot Upgrading -============= -Upgrading Open vSwitch from one version to the next version with minimum -disruption of traffic going through the system that is using that Open vSwitch -needs some considerations: - -1. If the upgrade only involves upgrading the userspace utilities and daemons -of Open vSwitch, make sure that the new userspace version is compatible with -the previously loaded kernel module. - -2. An upgrade of userspace daemons means that they have to be restarted. -Restarting the daemons means that the Openflow flows in the ovs-vswitchd daemon -will be lost. One way to restore the flows is to let the controller -re-populate it. Another way is to save the previous flows using a utility -like ovs-ofctl and then re-add them after the restart. Restoring the old flows -is accurate only if the new Open vSwitch interfaces retain the old 'ofport' -values. - -3. When the new userspace daemons get restarted, they automatically flush -the old flows setup in the kernel. This can be expensive if there are hundreds -of new flows that are entering the kernel but userspace daemons are busy -setting up new userspace flows from either the controller or an utility like -ovs-ofctl. Open vSwitch database provides an option to solve this problem -through the other_config:flow-restore-wait column of the Open_vSwitch table. -Refer to the ovs-vswitchd.conf.db(5) manpage for details. - -4. If the upgrade also involves upgrading the kernel module, the old kernel -module needs to be unloaded and the new kernel module should be loaded. This -means that the kernel network devices belonging to Open vSwitch is recreated -and the kernel flows are lost. The downtime of the traffic can be reduced -if the userspace daemons are restarted immediately and the userspace flows -are restored as soon as possible. - -The ovs-ctl utility's "restart" function only restarts the userspace daemons, -makes sure that the 'ofport' values remain consistent across restarts, restores -userspace flows using the ovs-ofctl utility and also uses the -other_config:flow-restore-wait column to keep the traffic downtime to the -minimum. The ovs-ctl utility's "force-reload-kmod" function does all of the -above, but also replaces the old kernel module with the new one. Open vSwitch -startup scripts for Debian, XenServer and RHEL use ovs-ctl's functions and it -is recommended that these functions be used for other software platforms too. - -Testsuites -========== - -This section describe Open vSwitch's built-in support for various test -suites. You must configure and build Open vSwitch (steps 1 through 3 -in "Building and Installing Open vSwitch for Linux, FreeBSD or NetBSD" -above) before you run the tests described here. You do not need to -install Open vSwitch or to build or load the kernel module to run -these test suites. You do not need supervisor privilege to run these -test suites. - -Self-Tests ----------- - -Open vSwitch includes a suite of self-tests. Before you submit patches -upstream, we advise that you run the tests and ensure that they pass. -If you add new features to Open vSwitch, then adding tests for those -features will ensure your features don't break as developers modify -other areas of Open vSwitch. - -Refer to "Testsuites" above for prerequisites. - -To run all the unit tests in Open vSwitch, one at a time: - make check -This takes under 5 minutes on a modern desktop system. - -To run all the unit tests in Open vSwitch, up to 8 in parallel: - make check TESTSUITEFLAGS=-j8 -This takes under a minute on a modern 4-core desktop system. - -To see a list of all the available tests, run: - make check TESTSUITEFLAGS=--list - -To run only a subset of tests, e.g. test 123 and tests 477 through 484: - make check TESTSUITEFLAGS='123 477-484' -(Tests do not have inter-dependencies, so you may run any subset.) - -To run tests matching a keyword, e.g. "ovsdb": - make check TESTSUITEFLAGS='-k ovsdb' - -To see a complete list of test options: - make check TESTSUITEFLAGS=--help - -The results of a testing run are reported in tests/testsuite.log. -Please report test failures as bugs and include the testsuite.log in -your report. - -If you have "valgrind" installed, then you can also run the testsuite -under valgrind by using "make check-valgrind" in place of "make -check". All the same options are available via TESTSUITEFLAGS. When -you do this, the "valgrind" results for test are reported in files -named tests/testsuite.dir//valgrind.*. You may find that the -valgrind results are easier to interpret if you put "-q" in -~/.valgrindrc, since that reduces the amount of output. - -Sometimes a few tests may fail on some runs but not others. This is -usually a bug in the testsuite, not a bug in Open vSwitch itself. If -you find that a test fails intermittently, please report it, since the -developers may not have noticed. - -OFTest ------- - -OFTest is an OpenFlow protocol testing suite. Open vSwitch includes a -Makefile target to run OFTest with Open vSwitch in "dummy mode". In -this mode of testing, no packets travel across physical or virtual -networks. Instead, Unix domain sockets stand in as simulated -networks. This simulation is imperfect, but it is much easier to set -up, does not require extra physical or virtual hardware, and does not -require supervisor privileges. - -To run OFTest with Open vSwitch, first read and follow the -instructions under "Testsuites" above. Second, obtain a copy of -OFTest and install its prerequisites. You need a copy of OFTest that -includes commit 406614846c5 (make ovs-dummy platform work again). -This commit was merged into the OFTest repository on Feb 1, 2013, so -any copy of OFTest more recent than that should work. Testing OVS in -dummy mode does not require root privilege, so you may ignore that -requirement. - -Optionally, add the top-level OFTest directory (containing the "oft" -program) to your $PATH. This slightly simplifies running OFTest later. - -To run OFTest in dummy mode, run the following command from your Open -vSwitch build directory: - make check-oftest OFT= -where is the absolute path to the "oft" program in -OFTest. - -If you added "oft" to your $PATH, you may omit the OFT variable -assignment: - make check-oftest -By default, "check-oftest" passes "oft" just enough options to enable -dummy mode. You can use OFTFLAGS to pass additional options. For -example, to run just the basic.Echo test instead of all tests (the -default) and enable verbose logging: - make check-oftest OFT= OFTFLAGS='--verbose -T basic.Echo' - -If you use OFTest that does not include commit 4d1f3eb2c792 (oft: -change default port to 6653), merged into the OFTest repository in -October 2013, then you need to add an option to use the IETF-assigned -controller port: - make check-oftest OFT= OFTFLAGS='--port=6653' - -Please interpret OFTest results cautiously. Open vSwitch can fail a -given test in OFTest for many reasons, including bugs in Open vSwitch, -bugs in OFTest, bugs in the "dummy mode" integration, and differing -interpretations of the OpenFlow standard and other standards. - -Open vSwitch has not been validated against OFTest. Please do report -test failures that you believe to represent bugs in Open vSwitch. -Include the precise versions of Open vSwitch and OFTest in your bug -report, plus any other information needed to reproduce the problem. - -Ryu ---- - -Ryu is an OpenFlow controller written in Python that includes an -extensive OpenFlow testsuite. Open vSwitch includes a Makefile target -to run Ryu in "dummy mode". See "OFTest" above for an explanation of -dummy mode. - -To run Ryu tests with Open vSwitch, first read and follow the -instructions under "Testsuites" above. Second, obtain a copy of Ryu, -install its prerequisites, and build it. You do not need to install -Ryu (some of the tests do not get installed, so it does not help). - -To run Ryu tests, run the following command from your Open vSwitch -build directory: - make check-ryu RYUDIR= -where is the absolute path to the root of the Ryu -source distribution. The default is $srcdir/../ryu -where $srcdir is your Open vSwitch source directory, so if this -default is correct then you make simply run "make check-ryu". - -Open vSwitch has not been validated against Ryu. Please do report -test failures that you believe to represent bugs in Open vSwitch. -Include the precise versions of Open vSwitch and Ryu in your bug -report, plus any other information needed to reproduce the problem. - -Bug Reporting -============= - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.Debian openvswitch-2.4.0~git20150623/INSTALL.Debian --- openvswitch-2.3.1/INSTALL.Debian 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Debian 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ - How to Build Debian Packages for Open vSwitch - ============================================= - -This document describes how to build Debian packages for Open vSwitch. -To install Open vSwitch on Debian without building Debian packages, -see INSTALL instead. - -These instructions should also work on Ubuntu and other Debian -derivative distributions. - - -Before You Begin ----------------- - -Before you begin, consider whether you really need to build packages -yourself. Debian "wheezy" and "sid", as well as recent versions of -Ubuntu, contain pre-built Debian packages for Open vSwitch. It is -easier to install these than to build your own. To use packages from -your distribution, skip ahead to "Installing .deb Packages", below. - - -Building Open vSwitch Debian packages -------------------------------------- - -You may build from an Open vSwitch distribution tarball or from an -Open vSwitch Git tree with these instructions. - -You do not need to be the superuser to build the Debian packages. - -1. Install the "build-essential" and "fakeroot" packages, e.g. with - "apt-get install build-essential fakeroot". - -2. Obtain and unpack an Open vSwitch source distribution and "cd" into - its top level directory. - -3. Install the build dependencies listed under "Build-Depends:" near - the top of debian/rules. You can install these any way you like, - e.g. with "apt-get install". - - Check your work by running "dpkg-checkbuilddeps". If you've - installed all the dependencies properly, dpkg-checkbuilddeps will - exit without printing anything. If you forgot to install some - dependencies, it will tell you which ones. - -4. Run: - - fakeroot debian/rules binary - - This will do a serial build that runs the unit tests. If you - prefer, you can run a faster parallel build, e.g.: - - DEB_BUILD_OPTIONS='parallel=8' fakeroot debian/rules binary - - If you are in a big hurry, you can even skip the unit tests: - - DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary - -5. The generated .deb files will be in the parent directory of the - Open vSwitch source distribution. - - -Installing .deb Packages ------------------------- - -These instructions apply to installing from Debian packages that you -built yourself, as described in the previous section, or from packages -provided by Debian or a Debian derivative distribution such as Ubuntu. -In the former case, use a command such as "dpkg -i" to install the -.deb files that you build, and in the latter case use a program such -as "apt-get" or "aptitude" to download and install the provided -packages. - -You must be superuser to install Debian packages. - -1. Start by installing an Open vSwitch kernel module. See - debian/openvswitch-switch.README.Debian for the available options. - -2. Install the "openvswitch-switch" and "openvswitch-common" packages. - These packages include the core userspace components of the switch. - -Open vSwitch .deb packages not mentioned above are rarely useful. -Please refer to their individual package descriptions to find out -whether any of them are useful to you. - - -Bug Reporting -------------- - -Please report problems to bugs@openvswitch.org. - diff -Nru openvswitch-2.3.1/INSTALL.Debian.md openvswitch-2.4.0~git20150623/INSTALL.Debian.md --- openvswitch-2.3.1/INSTALL.Debian.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Debian.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,92 @@ +How to Build Debian Packages for Open vSwitch +============================================= + +This document describes how to build Debian packages for Open vSwitch. +To install Open vSwitch on Debian without building Debian packages, +see [INSTALL.md] instead. + +These instructions should also work on Ubuntu and other Debian +derivative distributions. + + +Before You Begin +---------------- + +Before you begin, consider whether you really need to build packages +yourself. Debian "wheezy" and "sid", as well as recent versions of +Ubuntu, contain pre-built Debian packages for Open vSwitch. It is +easier to install these than to build your own. To use packages from +your distribution, skip ahead to "Installing .deb Packages", below. + + +Building Open vSwitch Debian packages +------------------------------------- + +You may build from an Open vSwitch distribution tarball or from an +Open vSwitch Git tree with these instructions. + +You do not need to be the superuser to build the Debian packages. + +1. Install the "build-essential" and "fakeroot" packages, e.g. with + `apt-get install build-essential fakeroot`. + +2. Obtain and unpack an Open vSwitch source distribution and `cd` into + its top level directory. + +3. Install the build dependencies listed under "Build-Depends:" near + the top of debian/control. You can install these any way you like, + e.g. with `apt-get install`. + + Check your work by running `dpkg-checkbuilddeps` in the top level of + your ovs directory. If you've installed all the dependencies + properly, dpkg-checkbuilddeps will exit without printing anything. + If you forgot to install some dependencies, it will tell you which ones. + +4. Run: + + `fakeroot debian/rules binary` + + This will do a serial build that runs the unit tests. This will take + approximately 8 to 10 minutes. If you prefer, you can run a faster + parallel build, e.g.: + + `DEB_BUILD_OPTIONS='parallel=8' fakeroot debian/rules binary` + + If you are in a big hurry, you can even skip the unit tests: + + `DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary` + +5. The generated .deb files will be in the parent directory of the + Open vSwitch source distribution. + + +Installing .deb Packages +------------------------ + +These instructions apply to installing from Debian packages that you +built yourself, as described in the previous section, or from packages +provided by Debian or a Debian derivative distribution such as Ubuntu. +In the former case, use a command such as `dpkg -i` to install the +.deb files that you build, and in the latter case use a program such +as `apt-get` or `aptitude` to download and install the provided +packages. + +You must be superuser to install Debian packages. + +1. Start by installing an Open vSwitch kernel module. See + debian/openvswitch-switch.README.Debian for the available options. + +2. Install the "openvswitch-switch" and "openvswitch-common" packages. + These packages include the core userspace components of the switch. + +Open vSwitch .deb packages not mentioned above are rarely useful. +Please refer to their individual package descriptions to find out +whether any of them are useful to you. + + +Bug Reporting +------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md diff -Nru openvswitch-2.3.1/INSTALL.Docker.md openvswitch-2.4.0~git20150623/INSTALL.Docker.md --- openvswitch-2.3.1/INSTALL.Docker.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Docker.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,109 @@ +How to Use Open vSwitch with Docker +==================================== + +This document describes how to use Open vSwitch with Docker 1.2.0 or +later. This document assumes that you installed Open vSwitch by following +[INSTALL.md] or by using the distribution packages such as .deb or .rpm. +Consult www.docker.com for instructions on how to install Docker. + +Limitations +----------- +Currently there is no native integration of Open vSwitch in Docker, i.e., +one cannot use the Docker client to automatically add a container's +network interface to an Open vSwitch bridge during the creation of the +container. This document describes addition of new network interfaces to an +already created container and in turn attaching that interface as a port to an +Open vSwitch bridge. If and when there is a native integration of Open vSwitch +with Docker, the ovs-docker utility described in this document is expected to +be retired. + +Setup +----- +* Create your container, e.g.: + +``` +% docker run -d ubuntu:14.04 /bin/sh -c \ +"while true; do echo hello world; sleep 1; done" +``` + +The above command creates a container with one network interface 'eth0' +and attaches it to a Linux bridge called 'docker0'. 'eth0' by default +gets an IP address in the 172.17.0.0/16 space. Docker sets up iptables +NAT rules to let this interface talk to the outside world. Also since +it is connected to 'docker0' bridge, it can talk to all other containers +connected to the same bridge. If you prefer that no network interface be +created by default, you can start your container with +the option '--net=none', e,g.: + +``` +% docker run -d --net=none ubuntu:14.04 /bin/sh -c \ +"while true; do echo hello world; sleep 1; done" +``` + +The above commands will return a container id. You will need to pass this +value to the utility 'ovs-docker' to create network interfaces attached to an +Open vSwitch bridge as a port. This document will reference this value +as $CONTAINER_ID in the next steps. + +* Add a new network interface to the container and attach it to an Open vSwitch + bridge. e.g.: + +`% ovs-docker add-port br-int eth1 $CONTAINER_ID` + +The above command will create a network interface 'eth1' inside the container +and then attaches it to the Open vSwitch bridge 'br-int'. This is done by +creating a veth pair. One end of the interface becomes 'eth1' inside the +container and the other end attaches to 'br-int'. + +The script also lets one to add IP address, MAC address, Gateway address and +MTU for the interface. e.g.: + +``` +% ovs-docker add-port br-int eth1 $CONTAINER_ID --ipaddress=192.168.1.2/24 \ +--macaddress=a2:c3:0d:49:7f:f8 --gateway=192.168.1.1 --mtu=1450 +``` + +* A previously added network interface can be deleted. e.g.: + +`% ovs-docker del-port br-int eth1 $CONTAINER_ID` + +All the previously added Open vSwitch interfaces inside a container can be +deleted. e.g.: + +`% ovs-docker del-ports br-int $CONTAINER_ID` + +It is important that the same $CONTAINER_ID be passed to both add-port +and del-port[s] commands. + +* More network control. + +Once a container interface is added to an Open vSwitch bridge, one can +set VLANs, create Tunnels, add OpenFlow rules etc for more network control. +Many times, it is important that the underlying network infrastructure is +plumbed (or programmed) before the application inside the container starts. +To handle this, one can create a micro-container, attach an Open vSwitch +interface to that container, set the UUIDS in OVSDB as mentioned in +[IntegrationGuide.md] and then program the bridge to handle traffic coming out +of that container. Now, you can start the main container asking it +to share the network of the micro-container. When your application starts, +the underlying network infrastructure would be ready. e.g.: + +``` +% docker run -d --net=container:$MICROCONTAINER_ID ubuntu:14.04 /bin/sh -c \ +"while true; do echo hello world; sleep 1; done" +``` + +Please read the man pages of ovs-vsctl, ovs-ofctl, ovs-vswitchd, +ovsdb-server and ovs-vswitchd.conf.db etc for more details about Open vSwitch. + +Docker networking is quite flexible and can be used in multiple ways. For more +information, please read: +https://docs.docker.com/articles/networking + +Bug Reporting +------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md +[IntegrationGuide.md]:IntegrationGuide.md diff -Nru openvswitch-2.3.1/INSTALL.DPDK openvswitch-2.4.0~git20150623/INSTALL.DPDK --- openvswitch-2.3.1/INSTALL.DPDK 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.DPDK 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ - - - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !!!!!! DPDK support in OVS 2.3 is experimental. !!!!!! - !!!!!! Please consider using a later version. !!!!!! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - Using Open vSwitch with DPDK - ============================ - -Open vSwitch can use Intel(R) DPDK lib to operate entirely in -userspace. This file explains how to install and use Open vSwitch in -such a mode. - -The DPDK support of Open vSwitch is considered experimental. -It has not been thoroughly tested. - -This version of Open vSwitch should be built manually with "configure" -and "make". - -Building and Installing: ------------------------- - -Recommended to use DPDK 1.6. - -DPDK: -cd DPDK -update config/defconfig_x86_64-default-linuxapp-gcc so that dpdk generate single lib file. -CONFIG_RTE_BUILD_COMBINE_LIBS=y - -make install T=x86_64-default-linuxapp-gcc -For details refer to http://dpdk.org/ - -Linux kernel: -Refer to intel-dpdk-getting-started-guide.pdf for understanding -DPDK kernel requirement. - -OVS: -cd $(OVS_DIR)/openvswitch -./boot.sh -./configure --with-dpdk=$(DPDK_BUILD) -make - -Refer to INSTALL.userspace for general requirements of building -userspace OVS. - -Using the DPDK with ovs-vswitchd: ---------------------------------- - -First setup DPDK devices: - - insert uio.ko - - insert igb_uio.ko - e.g. insmod DPDK/x86_64-default-linuxapp-gcc/kmod/igb_uio.ko - - mount hugetlbfs - e.g. mount -t hugetlbfs -o pagesize=1G none /mnt/huge/ - - Bind network device to ibg_uio. - e.g. DPDK/tools/pci_unbind.py --bind=igb_uio eth1 - -Ref to http://www.dpdk.org/doc/quick-start for verifying DPDK setup. - -Start vswitchd: -DPDK configuration arguments can be passed to vswitchd via `--dpdk` -argument. dpdk arg -c is ignored by ovs-dpdk, but it is required parameter -for dpdk initialization. - - e.g. - ./vswitchd/ovs-vswitchd --dpdk -c 0x1 -n 4 -- unix:$DB_SOCK --pidfile --detach - -To use ovs-vswitchd with DPDK, create a bridge with datapath_type -"netdev" in the configuration database. For example: - - ovs-vsctl add-br br0 - ovs-vsctl set bridge br0 datapath_type=netdev - -Now you can add dpdk devices. OVS expect DPDK device name start with dpdk -and end with portid. vswitchd should print number of dpdk devices found. - - ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk - -Once first DPDK port is added vswitchd, it creates Polling thread and -polls dpdk device in continuous loop. Therefore CPU utilization -for that thread is always 100%. - -Restrictions: -------------- - - - This Support is for Physical NIC. I have tested with Intel NIC only. - - vswitchd userspace datapath does affine polling thread but it is - assumed that devices are on numa node 0. Therefore if device is - attached to non zero numa node switching performance would be - suboptimal. - - There are fixed number of polling thread and fixed number of per - device queues configured. - - Work with 1500 MTU, needs few changes in DPDK lib to fix this issue. - - Currently DPDK port does not make use any offload functionality. - -Bug Reporting: --------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.DPDK.md openvswitch-2.4.0~git20150623/INSTALL.DPDK.md --- openvswitch-2.3.1/INSTALL.DPDK.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.DPDK.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,731 @@ +Using Open vSwitch with DPDK +============================ + +Open vSwitch can use Intel(R) DPDK lib to operate entirely in +userspace. This file explains how to install and use Open vSwitch in +such a mode. + +The DPDK support of Open vSwitch is considered experimental. +It has not been thoroughly tested. + +This version of Open vSwitch should be built manually with `configure` +and `make`. + +OVS needs a system with 1GB hugepages support. + +Building and Installing: +------------------------ + +Required: DPDK 2.0 +Optional (if building with vhost-cuse): `fuse`, `fuse-devel` (`libfuse-dev` +on Debian/Ubuntu) + +1. Configure build & install DPDK: + 1. Set `$DPDK_DIR` + + ``` + export DPDK_DIR=/usr/src/dpdk-2.0 + cd $DPDK_DIR + ``` + + 2. Update `config/common_linuxapp` so that DPDK generate single lib file. + (modification also required for IVSHMEM build) + + `CONFIG_RTE_BUILD_COMBINE_LIBS=y` + + Update `config/common_linuxapp` so that DPDK is built with vhost + libraries. + + `CONFIG_RTE_LIBRTE_VHOST=y` + + Then run `make install` to build and install the library. + For default install without IVSHMEM: + + `make install T=x86_64-native-linuxapp-gcc` + + To include IVSHMEM (shared memory): + + `make install T=x86_64-ivshmem-linuxapp-gcc` + + For further details refer to http://dpdk.org/ + +2. Configure & build the Linux kernel: + + Refer to intel-dpdk-getting-started-guide.pdf for understanding + DPDK kernel requirement. + +3. Configure & build OVS: + + * Non IVSHMEM: + + `export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc/` + + * IVSHMEM: + + `export DPDK_BUILD=$DPDK_DIR/x86_64-ivshmem-linuxapp-gcc/` + + ``` + cd $(OVS_DIR)/openvswitch + ./boot.sh + ./configure --with-dpdk=$DPDK_BUILD [CFLAGS="-g -O2 -Wno-cast-align"] + make + ``` + + Note: 'clang' users may specify the '-Wno-cast-align' flag to suppress DPDK cast-align warnings. + +To have better performance one can enable aggressive compiler optimizations and +use the special instructions(popcnt, crc32) that may not be available on all +machines. Instead of typing `make`, type: + +`make CFLAGS='-O3 -march=native'` + +Refer to [INSTALL.userspace.md] for general requirements of building userspace OVS. + +Using the DPDK with ovs-vswitchd: +--------------------------------- + +1. Setup system boot + Add the following options to the kernel bootline: + + `default_hugepagesz=1GB hugepagesz=1G hugepages=1` + +2. Setup DPDK devices: + + DPDK devices can be setup using either the VFIO (for DPDK 1.7+) or UIO + modules. UIO requires inserting an out of tree driver igb_uio.ko that is + available in DPDK. Setup for both methods are described below. + + * UIO: + 1. insert uio.ko: `modprobe uio` + 2. insert igb_uio.ko: `insmod $DPDK_BUILD/kmod/igb_uio.ko` + 3. Bind network device to igb_uio: + `$DPDK_DIR/tools/dpdk_nic_bind.py --bind=igb_uio eth1` + + * VFIO: + + VFIO needs to be supported in the kernel and the BIOS. More information + can be found in the [DPDK Linux GSG]. + + 1. Insert vfio-pci.ko: `modprobe vfio-pci` + 2. Set correct permissions on vfio device: `sudo /usr/bin/chmod a+x /dev/vfio` + and: `sudo /usr/bin/chmod 0666 /dev/vfio/*` + 3. Bind network device to vfio-pci: + `$DPDK_DIR/tools/dpdk_nic_bind.py --bind=vfio-pci eth1` + +3. Mount the hugetable filsystem + + `mount -t hugetlbfs -o pagesize=1G none /dev/hugepages` + + Ref to http://www.dpdk.org/doc/quick-start for verifying DPDK setup. + +4. Follow the instructions in [INSTALL.md] to install only the + userspace daemons and utilities (via 'make install'). + 1. First time only db creation (or clearing): + + ``` + mkdir -p /usr/local/etc/openvswitch + mkdir -p /usr/local/var/run/openvswitch + rm /usr/local/etc/openvswitch/conf.db + ovsdb-tool create /usr/local/etc/openvswitch/conf.db \ + /usr/local/share/openvswitch/vswitch.ovsschema + ``` + + 2. Start ovsdb-server + + ``` + ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ + --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ + --private-key=db:Open_vSwitch,SSL,private_key \ + --certificate=Open_vSwitch,SSL,certificate \ + --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert --pidfile --detach + ``` + + 3. First time after db creation, initialize: + + ``` + ovs-vsctl --no-wait init + ``` + +5. Start vswitchd: + + DPDK configuration arguments can be passed to vswitchd via `--dpdk` + argument. This needs to be first argument passed to vswitchd process. + dpdk arg -c is ignored by ovs-dpdk, but it is a required parameter + for dpdk initialization. + + ``` + export DB_SOCK=/usr/local/var/run/openvswitch/db.sock + ovs-vswitchd --dpdk -c 0x1 -n 4 -- unix:$DB_SOCK --pidfile --detach + ``` + + If allocated more than one GB hugepage (as for IVSHMEM), set amount and + use NUMA node 0 memory: + + ``` + ovs-vswitchd --dpdk -c 0x1 -n 4 --socket-mem 1024,0 \ + -- unix:$DB_SOCK --pidfile --detach + ``` + +6. Add bridge & ports + + To use ovs-vswitchd with DPDK, create a bridge with datapath_type + "netdev" in the configuration database. For example: + + `ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev` + + Now you can add dpdk devices. OVS expect DPDK device name start with dpdk + and end with portid. vswitchd should print (in the log file) the number + of dpdk devices found. + + ``` + ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk + ovs-vsctl add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk + ``` + + Once first DPDK port is added to vswitchd, it creates a Polling thread and + polls dpdk device in continuous loop. Therefore CPU utilization + for that thread is always 100%. + + Note: creating bonds of DPDK interfaces is slightly different to creating + bonds of system interfaces. For DPDK, the interface type must be explicitly + set, for example: + + ``` + ovs-vsctl add-bond br0 dpdkbond dpdk0 dpdk1 -- set Interface dpdk0 type=dpdk -- set Interface dpdk1 type=dpdk + ``` + +7. Add test flows + + Test flow script across NICs (assuming ovs in /usr/src/ovs): + Execute script: + + ``` + #! /bin/sh + # Move to command directory + cd /usr/src/ovs/utilities/ + + # Clear current flows + ./ovs-ofctl del-flows br0 + + # Add flows between port 1 (dpdk0) to port 2 (dpdk1) + ./ovs-ofctl add-flow br0 in_port=1,action=output:2 + ./ovs-ofctl add-flow br0 in_port=2,action=output:1 + ``` + +8. Performance tuning + + With pmd multi-threading support, OVS creates one pmd thread for each + numa node as default. The pmd thread handles the I/O of all DPDK + interfaces on the same numa node. The following two commands can be used + to configure the multi-threading behavior. + + `ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=` + + The command above asks for a CPU mask for setting the affinity of pmd + threads. A set bit in the mask means a pmd thread is created and pinned + to the corresponding CPU core. For more information, please refer to + `man ovs-vswitchd.conf.db` + + `ovs-vsctl set Open_vSwitch . other_config:n-dpdk-rxqs=` + + The command above sets the number of rx queues of each DPDK interface. The + rx queues are assigned to pmd threads on the same numa node in round-robin + fashion. For more information, please refer to `man ovs-vswitchd.conf.db` + + Ideally for maximum throughput, the pmd thread should not be scheduled out + which temporarily halts its execution. The following affinitization methods + can help. + + Lets pick core 4,6,8,10 for pmd threads to run on. Also assume a dual 8 core + sandy bridge system with hyperthreading enabled where CPU1 has cores 0,...,7 + and 16,...,23 & CPU2 cores 8,...,15 & 24,...,31. (A different cpu + configuration could have different core mask requirements). + + To kernel bootline add core isolation list for cores and associated hype cores + (e.g. isolcpus=4,20,6,22,8,24,10,26,). Reboot system for isolation to take + effect, restart everything. + + Configure pmd threads on core 4,6,8,10 using 'pmd-cpu-mask': + + `ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=00000550` + + You should be able to check that pmd threads are pinned to the correct cores + via: + + ``` + top -p `pidof ovs-vswitchd` -H -d1 + ``` + + Note, the pmd threads on a numa node are only created if there is at least + one DPDK interface from the numa node that has been added to OVS. + + To understand where most of the time is spent and whether the caches are + effective, these commands can be used: + + ``` + ovs-appctl dpif-netdev/pmd-stats-clear #To reset statistics + ovs-appctl dpif-netdev/pmd-stats-show + ``` + +DPDK Rings : +------------ + +Following the steps above to create a bridge, you can now add dpdk rings +as a port to the vswitch. OVS will expect the DPDK ring device name to +start with dpdkr and end with a portid. + +`ovs-vsctl add-port br0 dpdkr0 -- set Interface dpdkr0 type=dpdkr` + +DPDK rings client test application + +Included in the test directory is a sample DPDK application for testing +the rings. This is from the base dpdk directory and modified to work +with the ring naming used within ovs. + +location tests/ovs_client + +To run the client : + +``` +cd /usr/src/ovs/tests/ +ovsclient -c 1 -n 4 --proc-type=secondary -- -n "port id you gave dpdkr" +``` + +In the case of the dpdkr example above the "port id you gave dpdkr" is 0. + +It is essential to have --proc-type=secondary + +The application simply receives an mbuf on the receive queue of the +ethernet ring and then places that same mbuf on the transmit ring of +the ethernet ring. It is a trivial loopback application. + +DPDK rings in VM (IVSHMEM shared memory communications) +------------------------------------------------------- + +In addition to executing the client in the host, you can execute it within +a guest VM. To do so you will need a patched qemu. You can download the +patch and getting started guide at : + +https://01.org/packet-processing/downloads + +A general rule of thumb for better performance is that the client +application should not be assigned the same dpdk core mask "-c" as +the vswitchd. + +DPDK vhost: +----------- + +DPDK 2.0 supports two types of vhost: + +1. vhost-user +2. vhost-cuse + +Whatever type of vhost is enabled in the DPDK build specified, is the type +that will be enabled in OVS. By default, vhost-user is enabled in DPDK. +Therefore, unless vhost-cuse has been enabled in DPDK, vhost-user ports +will be enabled in OVS. +Please note that support for vhost-cuse is intended to be deprecated in OVS +in a future release. + +DPDK vhost-user: +---------------- + +The following sections describe the use of vhost-user 'dpdkvhostuser' ports +with OVS. + +DPDK vhost-user Prerequisites: +------------------------- + +1. DPDK 2.0 with vhost support enabled as documented in the "Building and + Installing section" + +2. QEMU version v2.1.0+ + + QEMU v2.1.0 will suffice, but it is recommended to use v2.2.0 if providing + your VM with memory greater than 1GB due to potential issues with memory + mapping larger areas. + +Adding DPDK vhost-user ports to the Switch: +-------------------------------------- + +Following the steps above to create a bridge, you can now add DPDK vhost-user +as a port to the vswitch. Unlike DPDK ring ports, DPDK vhost-user ports can +have arbitrary names. + + - For vhost-user, the name of the port type is `dpdkvhostuser` + + ``` + ovs-ofctl add-port br0 vhost-user-1 -- set Interface vhost-user-1 + type=dpdkvhostuser + ``` + + This action creates a socket located at + `/usr/local/var/run/openvswitch/vhost-user-1`, which you must provide + to your VM on the QEMU command line. More instructions on this can be + found in the next section "DPDK vhost-user VM configuration" + Note: If you wish for the vhost-user sockets to be created in a + directory other than `/usr/local/var/run/openvswitch`, you may specify + another location on the ovs-vswitchd command line like so: + + `./vswitchd/ovs-vswitchd --dpdk -vhost_sock_dir /my-dir -c 0x1 ...` + +DPDK vhost-user VM configuration: +--------------------------------- +Follow the steps below to attach vhost-user port(s) to a VM. + +1. Configure sockets. + Pass the following parameters to QEMU to attach a vhost-user device: + + ``` + -chardev socket,id=char1,path=/usr/local/var/run/openvswitch/vhost-user-1 + -netdev type=vhost-user,id=mynet1,chardev=char1,vhostforce + -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1 + ``` + + ...where vhost-user-1 is the name of the vhost-user port added + to the switch. + Repeat the above parameters for multiple devices, changing the + chardev path and id as necessary. Note that a separate and different + chardev path needs to be specified for each vhost-user device. For + example you have a second vhost-user port named 'vhost-user-2', you + append your QEMU command line with an additional set of parameters: + + ``` + -chardev socket,id=char2,path=/usr/local/var/run/openvswitch/vhost-user-2 + -netdev type=vhost-user,id=mynet2,chardev=char2,vhostforce + -device virtio-net-pci,mac=00:00:00:00:00:02,netdev=mynet2 + ``` + +2. Configure huge pages. + QEMU must allocate the VM's memory on hugetlbfs. vhost-user ports access + a virtio-net device's virtual rings and packet buffers mapping the VM's + physical memory on hugetlbfs. To enable vhost-user ports to map the VM's + memory into their process address space, pass the following paramters + to QEMU: + + ``` + -object memory-backend-file,id=mem,size=4096M,mem-path=/dev/hugepages, + share=on + -numa node,memdev=mem -mem-prealloc + ``` + +DPDK vhost-cuse: +---------------- + +The following sections describe the use of vhost-cuse 'dpdkvhostcuse' ports +with OVS. + +DPDK vhost-cuse Prerequisites: +------------------------- + +1. DPDK 2.0 with vhost support enabled as documented in the "Building and + Installing section" + As an additional step, you must enable vhost-cuse in DPDK by setting the + following additional flag in `config/common_linuxapp`: + + `CONFIG_RTE_LIBRTE_VHOST_USER=n` + + Following this, rebuild DPDK as per the instructions in the "Building and + Installing" section. Finally, rebuild OVS as per step 3 in the "Building + and Installing" section - OVS will detect that DPDK has vhost-cuse libraries + compiled and in turn will enable support for it in the switch and disable + vhost-user support. + +2. Insert the Cuse module: + + `modprobe cuse` + +3. Build and insert the `eventfd_link` module: + + ``` + cd $DPDK_DIR/lib/librte_vhost/eventfd_link/ + make + insmod $DPDK_DIR/lib/librte_vhost/eventfd_link.ko + ``` + +4. QEMU version v2.1.0+ + + vhost-cuse will work with QEMU v2.1.0 and above, however it is recommended to + use v2.2.0 if providing your VM with memory greater than 1GB due to potential + issues with memory mapping larger areas. + Note: QEMU v1.6.2 will also work, with slightly different command line parameters, + which are specified later in this document. + +Adding DPDK vhost-cuse ports to the Switch: +-------------------------------------- + +Following the steps above to create a bridge, you can now add DPDK vhost-cuse +as a port to the vswitch. Unlike DPDK ring ports, DPDK vhost-cuse ports can have +arbitrary names. + + - For vhost-cuse, the name of the port type is `dpdkvhostcuse` + + ``` + ovs-ofctl add-port br0 vhost-cuse-1 -- set Interface vhost-cuse-1 + type=dpdkvhostcuse + ``` + + When attaching vhost-cuse ports to QEMU, the name provided during the + add-port operation must match the ifname parameter on the QEMU command + line. More instructions on this can be found in the next section. + +DPDK vhost-cuse VM configuration: +--------------------------------- + + vhost-cuse ports use a Linux* character device to communicate with QEMU. + By default it is set to `/dev/vhost-net`. It is possible to reuse this + standard device for DPDK vhost, which makes setup a little simpler but it + is better practice to specify an alternative character device in order to + avoid any conflicts if kernel vhost is to be used in parallel. + +1. This step is only needed if using an alternative character device. + + The new character device filename must be specified on the vswitchd + commandline: + + `./vswitchd/ovs-vswitchd --dpdk --cuse_dev_name my-vhost-net -c 0x1 ...` + + Note that the `--cuse_dev_name` argument and associated string must be the first + arguments after `--dpdk` and come before the EAL arguments. In the example + above, the character device to be used will be `/dev/my-vhost-net`. + +2. This step is only needed if reusing the standard character device. It will + conflict with the kernel vhost character device so the user must first + remove it. + + `rm -rf /dev/vhost-net` + +3a. Configure virtio-net adaptors: + The following parameters must be passed to the QEMU binary: + + ``` + -netdev tap,id=,script=no,downscript=no,ifname=,vhost=on + -device virtio-net-pci,netdev=net1,mac= + ``` + + Repeat the above parameters for multiple devices. + + The DPDK vhost library will negiotiate its own features, so they + need not be passed in as command line params. Note that as offloads are + disabled this is the equivalent of setting: + + `csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off` + +3b. If using an alternative character device. It must be also explicitly + passed to QEMU using the `vhostfd` argument: + + ``` + -netdev tap,id=,script=no,downscript=no,ifname=,vhost=on, + vhostfd= + -device virtio-net-pci,netdev=net1,mac= + ``` + + The open file descriptor must be passed to QEMU running as a child + process. This could be done with a simple python script. + + ``` + #!/usr/bin/python + fd = os.open("/dev/usvhost", os.O_RDWR) + subprocess.call("qemu-system-x86_64 .... -netdev tap,id=vhostnet0,\ + vhost=on,vhostfd=" + fd +"...", shell=True) + + Alternatively the the `qemu-wrap.py` script can be used to automate the + requirements specified above and can be used in conjunction with libvirt if + desired. See the "DPDK vhost VM configuration with QEMU wrapper" section + below. + +4. Configure huge pages: + QEMU must allocate the VM's memory on hugetlbfs. Vhost ports access a + virtio-net device's virtual rings and packet buffers mapping the VM's + physical memory on hugetlbfs. To enable vhost-ports to map the VM's + memory into their process address space, pass the following parameters + to QEMU: + + `-object memory-backend-file,id=mem,size=4096M,mem-path=/dev/hugepages, + share=on -numa node,memdev=mem -mem-prealloc` + + Note: For use with an earlier QEMU version such as v1.6.2, use the + following to configure hugepages instead: + + `-mem-path /dev/hugepages -mem-prealloc` + +DPDK vhost-cuse VM configuration with QEMU wrapper: +--------------------------------------------------- +The QEMU wrapper script automatically detects and calls QEMU with the +necessary parameters. It performs the following actions: + + * Automatically detects the location of the hugetlbfs and inserts this + into the command line parameters. + * Automatically open file descriptors for each virtio-net device and + inserts this into the command line parameters. + * Calls QEMU passing both the command line parameters passed to the + script itself and those it has auto-detected. + +Before use, you **must** edit the configuration parameters section of the +script to point to the correct emulator location and set additional +settings. Of these settings, `emul_path` and `us_vhost_path` **must** be +set. All other settings are optional. + +To use directly from the command line simply pass the wrapper some of the +QEMU parameters: it will configure the rest. For example: + +``` +qemu-wrap.py -cpu host -boot c -hda -m 4096 -smp 4 + --enable-kvm -nographic -vnc none -net none -netdev tap,id=net1, + script=no,downscript=no,ifname=if1,vhost=on -device virtio-net-pci, + netdev=net1,mac=00:00:00:00:00:01 +``` + +DPDK vhost-cuse VM configuration with libvirt: +---------------------------------------------- + +If you are using libvirt, you must enable libvirt to access the character +device by adding it to controllers cgroup for libvirtd using the following +steps. + + 1. In `/etc/libvirt/qemu.conf` add/edit the following lines: + + ``` + 1) clear_emulator_capabilities = 0 + 2) user = "root" + 3) group = "root" + 4) cgroup_device_acl = [ + "/dev/null", "/dev/full", "/dev/zero", + "/dev/random", "/dev/urandom", + "/dev/ptmx", "/dev/kvm", "/dev/kqemu", + "/dev/rtc", "/dev/hpet", "/dev/net/tun", + "/dev/", + "/dev/hugepages"] + ``` + + refers to "vhost-net" if using the `/dev/vhost-net` + device. If you have specificed a different name on the ovs-vswitchd + commandline using the "--cuse_dev_name" parameter, please specify that + filename instead. + + 2. Disable SELinux or set to permissive mode + + 3. Restart the libvirtd process + For example, on Fedora: + + `systemctl restart libvirtd.service` + +After successfully editing the configuration, you may launch your +vhost-enabled VM. The XML describing the VM can be configured like so +within the section: + + 1. Set up shared hugepages: + + ``` + + + + + + ``` + + 2. Set up your tap devices: + + ``` + + + + + ``` + + Repeat for as many devices as are desired, modifying the id, ifname + and mac as necessary. + + Again, if you are using an alternative character device (other than + `/dev/vhost-net`), please specify the file descriptor like so: + + `` + + Where refers to the open file descriptor of the character device. + Instructions of how to retrieve the file descriptor can be found in the + "DPDK vhost VM configuration" section. + Alternatively, the process is automated with the qemu-wrap.py script, + detailed in the next section. + +Now you may launch your VM using virt-manager, or like so: + + `virsh create my_vhost_vm.xml` + +DPDK vhost-cuse VM configuration with libvirt and QEMU wrapper: +---------------------------------------------------------- + +To use the qemu-wrapper script in conjuntion with libvirt, follow the +steps in the previous section before proceeding with the following steps: + + 1. Place `qemu-wrap.py` in libvirtd's binary search PATH ($PATH) + Ideally in the same directory that the QEMU binary is located. + + 2. Ensure that the script has the same owner/group and file permissions + as the QEMU binary. + + 3. Update the VM xml file using "virsh edit VM.xml" + + 1. Set the VM to use the launch script. + Set the emulator path contained in the `` tags. + For example, replace: + + `/usr/bin/qemu-kvm` + + with: + + `/usr/bin/qemu-wrap.py` + + 4. Edit the Configuration Parameters section of the script to point to + the correct emulator location and set any additional options. If you are + using a alternative character device name, please set "us_vhost_path" to the + location of that device. The script will automatically detect and insert + the correct "vhostfd" value in the QEMU command line arguments. + + 5. Use virt-manager to launch the VM + +Running ovs-vswitchd with DPDK backend inside a VM +-------------------------------------------------- + +Please note that additional configuration is required if you want to run +ovs-vswitchd with DPDK backend inside a QEMU virtual machine. Ovs-vswitchd +creates separate DPDK TX queues for each CPU core available. This operation +fails inside QEMU virtual machine because, by default, VirtIO NIC provided +to the guest is configured to support only single TX queue and single RX +queue. To change this behavior, you need to turn on 'mq' (multiqueue) +property of all virtio-net-pci devices emulated by QEMU and used by DPDK. +You may do it manually (by changing QEMU command line) or, if you use Libvirt, +by adding the following string: + +`` + +to sections of all network devices used by DPDK. Parameter 'N' +determines how many queues can be used by the guest. + +Restrictions: +------------- + + - Work with 1500 MTU, needs few changes in DPDK lib to fix this issue. + - Currently DPDK port does not make use any offload functionality. + - DPDK-vHost support works with 1G huge pages. + + ivshmem: + - If you run Open vSwitch with smaller page sizes (e.g. 2MB), you may be + unable to share any rings or mempools with a virtual machine. + This is because the current implementation of ivshmem works by sharing + a single 1GB huge page from the host operating system to any guest + operating system through the Qemu ivshmem device. When using smaller + page sizes, multiple pages may be required to hold the ring descriptors + and buffer pools. The Qemu ivshmem device does not allow you to share + multiple file descriptors to the guest operating system. However, if you + want to share dpdkr rings with other processes on the host, you can do + this with smaller page sizes. + +Bug Reporting: +-------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.userspace.md]:INSTALL.userspace.md +[INSTALL.md]:INSTALL.md +[DPDK Linux GSG]: http://www.dpdk.org/doc/guides/linux_gsg/build_dpdk.html#binding-and-unbinding-network-ports-to-from-the-igb-uioor-vfio-modules +[DPDK Docs]: http://dpdk.org/doc diff -Nru openvswitch-2.3.1/INSTALL.Fedora openvswitch-2.4.0~git20150623/INSTALL.Fedora --- openvswitch-2.3.1/INSTALL.Fedora 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Fedora 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - How to Install Open vSwitch on Fedora Linux - =========================================== - -This document describes how to build and install Open vSwitch on a Fedora -Linux host. If you want to install Open vSwitch on a generic Linux host, -see INSTALL.Linux instead. - -We have tested these instructions with Fedora 16 and Fedora 17. - -Building Open vSwitch for Fedora --------------------------------- - -You may build from an Open vSwitch distribution tarball or from an -Open vSwitch Git tree. - -Before you begin, note the RPM source directory on your version of -Fedora. On Fedora 17, it is $HOME/rpmbuild/SOURCES. - -1. If you are building from an Open vSwitch Git tree, then you will - need to first create a distribution tarball by running "./boot.sh; - ./configure; make dist" in the Git tree. - -2. Copy the distribution tarball into the RPM source directory. - -3. Unpack the distribution tarball into a temporary directory and "cd" - into the root of the distribution tarball. - -4. To build Open vSwitch userspace, run: - - rpmbuild -bb rhel/openvswitch-fedora.spec - - This produces one RPM: "openvswitch". - - The above command automatically runs the Open vSwitch unit tests. - To disable the unit tests, run: - - rpmbuild -bb --without check rhel/openvswitch-fedora.spec - -5. On Fedora 17, to build the Open vSwitch kernel module, run: - - rpmbuild -bb rhel/openvswitch-kmod-fedora.spec - - You might have to specify a kernel version and/or variants, e.g.: - - rpmbuild -bb \ - -D "kversion 2.6.32-131.6.1.el6.x86_64" \ - -D "kflavors default debug kdump" \ - rhel/openvswitch-kmod-rhel6.spec - - This produces an "kmod-openvswitch" RPM for each kernel variant, - in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and - "kmod-openvswitch-kdump". - -Reporting Bugs --------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.Fedora.md openvswitch-2.4.0~git20150623/INSTALL.Fedora.md --- openvswitch-2.3.1/INSTALL.Fedora.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Fedora.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,91 @@ +How to Install Open vSwitch on Fedora Linux +=========================================== + +This document describes how to build and install Open vSwitch on a Fedora +Linux host. If you want to install Open vSwitch on a generic Linux host, +see [INSTALL.md] instead. + +We have tested these instructions with Fedora 16 and Fedora 17. + +Building Open vSwitch for Fedora +-------------------------------- + +You may build from an Open vSwitch distribution tarball or from an +Open vSwitch Git tree. + +The default RPM build directory (_topdir) has five directories in +the top-level: +1. BUILD/ Where the software is unpacked and built. +2. RPMS/ Where the newly created binary package files are written. +3. SOURCES/ Contains the original sources, patches, and icon files. +4. SPECS/ Contains the spec files for each package to be built. +5. SRPMS/ Where the newly created source package files are written. + +Before you begin, note the RPM sources directory on your version of +Fedora. The command "rpmbuild --showrc" will show the configuration +for each of those directories. Alternatively, the command "rpm --eval + '%{_topdir}'" shows the current configuration for the top level +directory and the command "rpm --eval '%{_sourcedir}'" does the same +for the sources directory. On Fedora 17, the default RPM _topdir is +$HOME/rpmbuild and the default RPM sources directory is +$HOME/rpmbuild/SOURCES. + +1. If you are building from a distribution tarball, skip to step 2. + Otherwise, you must be building from an Open vSwitch Git tree. + Create a distribution tarball from the root of the Git tree by + running: + + ``` + ./boot.sh + ./configure + make dist + ``` + +2. Now you have a distribution tarball, named something like + openvswitch-x.y.z.tar.gz. Copy this file into the RPM sources + directory, e.g.: + + `cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES` + +3. Make another copy of the distribution tarball in a temporary + directory. Then unpack the tarball and "cd" into its root, e.g.: + + ``` + tar xzf openvswitch-x.y.z.tar.gz + cd openvswitch-x.y.z + ``` + +4. To build Open vSwitch userspace, run: + + `rpmbuild -bb rhel/openvswitch-fedora.spec` + + This produces one RPM: "openvswitch". + + The above command automatically runs the Open vSwitch unit tests. + To disable the unit tests, run: + + `rpmbuild -bb --without check rhel/openvswitch-fedora.spec` + +5. On Fedora 17, to build the Open vSwitch kernel module, run: + + `rpmbuild -bb rhel/openvswitch-kmod-fedora.spec` + + You might have to specify a kernel version and/or variants, e.g.: + + ``` + rpmbuild -bb \ + -D "kversion 2.6.32-131.6.1.el6.x86_64" \ + -D "kflavors default debug kdump" \ + rhel/openvswitch-kmod-rhel6.spec + ``` + + This produces an "kmod-openvswitch" RPM for each kernel variant, + in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and + "kmod-openvswitch-kdump". + +Reporting Bugs +-------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md diff -Nru openvswitch-2.3.1/INSTALL.KVM openvswitch-2.4.0~git20150623/INSTALL.KVM --- openvswitch-2.3.1/INSTALL.KVM 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.KVM 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ - How to Use Open vSwitch with KVM - ================================= - -This document describes how to use Open vSwitch with the Kernel-based -Virtual Machine (KVM). This document assumes that you have read and -followed INSTALL to get Open vSwitch setup on your Linux system. - -Setup ------ - -First, follow the setup instructions in INSTALL to get a working -Open vSwitch installation. - -KVM uses tunctl to handle various bridging modes, which you can -install with the Debian/Ubuntu package uml-utilities. - - % apt-get install uml-utilities - -Next, you will need to modify or create custom versions of the qemu-ifup -and qemu-ifdown scripts. In this guide, we'll create custom versions -that make use of example open vSwitch bridges that we'll describe in this -guide. - -Create the following two files and store them in known locations. - -For example /etc/ovs-ifup and /etc/ovs-ifdown - -/etc/ovs-ifup --------------------------------------------------------------------- -#!/bin/sh - -switch='br0' -/sbin/ifconfig $1 0.0.0.0 up -ovs-vsctl add-port ${switch} $1 --------------------------------------------------------------------- - -/etc/ovs-ifdown --------------------------------------------------------------------- -#!/bin/sh - -switch='br0' -/sbin/ifconfig $1 0.0.0.0 down -ovs-vsctl del-port ${switch} $1 --------------------------------------------------------------------- - -At the end of INSTALL, it describes basic usage of creating -bridges and ports. If you haven't already, create a bridge named -br0 with the following command: - - % ovs-vsctl add-br br0 - -Then, add a port to the bridge for the NIC that you want your guests -to communicate over (e.g. eth0): - - % ovs-vsctl add-port br0 eth0 - -Please refer to ovs-vsctl(8) for more details. - -Next, we'll start a guest that will use our ifup and ifdown scripts. - - % kvm -m 512 -net nic,macaddr=00:11:22:EE:EE:EE -net \ -tap,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown -drive \ -file=/path/to/disk-image,boot=on - -This will start the guest and associate a tap device with it. The -ovs-ifup script will add a port on the br0 bridge so that the -guest will be able to communicate over that bridge. - -To get some more information and for debugging you can use Open -vSwitch utilities such as ovs-dpctl and ovs-ofctl, For example: - - % ovs-dpctl show - % ovs-ofctl show br0 - -You should see tap devices for each KVM guest added as ports to -the bridge (e.g. tap0) - -Please refer to ovs-dpctl(8) and ovs-ofctl(8) for more details. - -Bug Reporting -------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.KVM.md openvswitch-2.4.0~git20150623/INSTALL.KVM.md --- openvswitch-2.3.1/INSTALL.KVM.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.KVM.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,87 @@ +How to Use Open vSwitch with KVM +================================= + +This document describes how to use Open vSwitch with the Kernel-based +Virtual Machine (KVM). This document assumes that you have read and +followed [INSTALL.md] to get Open vSwitch setup on your Linux system. + +Setup +----- + +First, follow the setup instructions in [INSTALL.md] to get a working +Open vSwitch installation. + +KVM uses tunctl to handle various bridging modes, which you can +install with the Debian/Ubuntu package uml-utilities. + + % apt-get install uml-utilities + +Next, you will need to modify or create custom versions of the qemu-ifup +and qemu-ifdown scripts. In this guide, we'll create custom versions +that make use of example Open vSwitch bridges that we'll describe in this +guide. + +Create the following two files and store them in known locations. + +For example /etc/ovs-ifup and /etc/ovs-ifdown + +/etc/ovs-ifup + +``` +#!/bin/sh + +switch='br0' +/sbin/ifconfig $1 0.0.0.0 up +ovs-vsctl add-port ${switch} $1 +``` + +/etc/ovs-ifdown + +``` +#!/bin/sh + +switch='br0' +/sbin/ifconfig $1 0.0.0.0 down +ovs-vsctl del-port ${switch} $1 +``` + +At the end of [INSTALL.md], it describes basic usage of creating +bridges and ports. If you haven't already, create a bridge named +br0 with the following command: + + % ovs-vsctl add-br br0 + +Then, add a port to the bridge for the NIC that you want your guests +to communicate over (e.g. eth0): + + % ovs-vsctl add-port br0 eth0 + +Please refer to ovs-vsctl(8) for more details. + +Next, we'll start a guest that will use our ifup and ifdown scripts. + + % kvm -m 512 -net nic,macaddr=00:11:22:EE:EE:EE -net \ + tap,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown -drive \ + file=/path/to/disk-image,boot=on + +This will start the guest and associate a tap device with it. The +ovs-ifup script will add a port on the br0 bridge so that the +guest will be able to communicate over that bridge. + +To get some more information and for debugging you can use Open +vSwitch utilities such as ovs-dpctl and ovs-ofctl, For example: + + % ovs-dpctl show + % ovs-ofctl show br0 + +You should see tap devices for each KVM guest added as ports to +the bridge (e.g. tap0) + +Please refer to ovs-dpctl(8) and ovs-ofctl(8) for more details. + +Bug Reporting +------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md diff -Nru openvswitch-2.3.1/INSTALL.Libvirt openvswitch-2.4.0~git20150623/INSTALL.Libvirt --- openvswitch-2.3.1/INSTALL.Libvirt 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Libvirt 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - How to Use Open vSwitch with Libvirt - ==================================== - -This document describes how to use Open vSwitch with Libvirt 0.9.11 or -later. This document assumes that you followed INSTALL or installed -Open vSwitch from distribution packaging such as a .deb or .rpm. The Open -vSwitch support is included by default in Libvirt 0.9.11. Consult -www.libvirt.org for instructions on how to build the latest Libvirt, if your -Linux distribution by default comes with an older Libvirt release. - -Limitations ------------ -Currently there is no Open vSwitch support for networks that are managed -by libvirt (e.g. NAT). As of now, only bridged networks are supported (those -where the user has to manually create the bridge). - -Setup ------ - -First, create the Open vSwitch bridge by using the ovs-vsctl utility (this -must be done with administrative privileges): - - % ovs-vsctl add-br ovsbr - -Once that is done, create a VM, if necessary, and edit its Domain XML file: - - % virsh edit - -Lookup in the Domain XML file the section. There should be one -such XML section for each interface the VM has. - - ... - - - -
- - ... - -And change it to something like this: - - ... - - - - -
- - ... - -The interface type must be set to "bridge". The XML element -specifies to which bridge this interface will be attached to. The - element indicates that the bridge in element is an -Open vSwitch bridge. - -Then (re)start the VM and verify if the guest's vnet interface is attached to -the ovsbr bridge. - - % ovs-vsctl show - -Troubleshooting ---------------- -If the VM does not want to start, then try to run the libvirtd process either -from the terminal, so that all errors are printed in console, or inspect -Libvirt/Open vSwitch log files for possible root cause. - -Bug Reporting -------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.Libvirt.md openvswitch-2.4.0~git20150623/INSTALL.Libvirt.md --- openvswitch-2.3.1/INSTALL.Libvirt.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Libvirt.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,72 @@ +How to Use Open vSwitch with Libvirt +==================================== + +This document describes how to use Open vSwitch with Libvirt 0.9.11 or +later. This document assumes that you followed [INSTALL.md] or installed +Open vSwitch from distribution packaging such as a .deb or .rpm. The Open +vSwitch support is included by default in Libvirt 0.9.11. Consult +www.libvirt.org for instructions on how to build the latest Libvirt, if your +Linux distribution by default comes with an older Libvirt release. + +Limitations +----------- +Currently there is no Open vSwitch support for networks that are managed +by libvirt (e.g. NAT). As of now, only bridged networks are supported (those +where the user has to manually create the bridge). + +Setup +----- + +First, create the Open vSwitch bridge by using the ovs-vsctl utility (this +must be done with administrative privileges): + + % ovs-vsctl add-br ovsbr + +Once that is done, create a VM, if necessary, and edit its Domain XML file: + + % virsh edit + +Lookup in the Domain XML file the `` section. There should be one +such XML section for each interface the VM has. + +``` + + + +
+ +``` + +And change it to something like this: + +``` + + + + +
+ + ``` + +The interface type must be set to "bridge". The `` XML element +specifies to which bridge this interface will be attached to. The +`` element indicates that the bridge in `` element is an +Open vSwitch bridge. + +Then (re)start the VM and verify if the guest's vnet interface is attached to +the ovsbr bridge. + + % ovs-vsctl show + +Troubleshooting +--------------- +If the VM does not want to start, then try to run the libvirtd process either +from the terminal, so that all errors are printed in console, or inspect +Libvirt/Open vSwitch log files for possible root cause. + +Bug Reporting +------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md diff -Nru openvswitch-2.3.1/INSTALL.md openvswitch-2.4.0~git20150623/INSTALL.md --- openvswitch-2.3.1/INSTALL.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,692 @@ +How to Install Open vSwitch on Linux, FreeBSD and NetBSD +======================================================== + +This document describes how to build and install Open vSwitch on a +generic Linux, FreeBSD, or NetBSD host. For specifics around installation +on a specific platform, please see one of these files: + + - [INSTALL.Debian.md] + - [INSTALL.Fedora.md] + - [INSTALL.RHEL.md] + - [INSTALL.XenServer.md] + - [INSTALL.NetBSD.md] + - [INSTALL.Windows.md] + - [INSTALL.DPDK.md] + +Build Requirements +------------------ + +To compile the userspace programs in the Open vSwitch distribution, +you will need the following software: + + - GNU make. + + - A C compiler, such as: + + * GCC 4.x. + + * Clang. Clang 3.4 and later provide useful static semantic + analysis and thread-safety checks. For Ubuntu, there are + nightly built packages available on clang's website. + + * MSVC 2013. See [INSTALL.Windows] for additional Windows build + instructions. + + While OVS may be compatible with other compilers, optimal + support for atomic operations may be missing, making OVS very + slow (see lib/ovs-atomic.h). + + - libssl, from OpenSSL, is optional but recommended if you plan to + connect the Open vSwitch to an OpenFlow controller. libssl is + required to establish confidentiality and authenticity in the + connections from an Open vSwitch to an OpenFlow controller. If + libssl is installed, then Open vSwitch will automatically build + with support for it. + + - Python 2.x, for x >= 4. + +On Linux, you may choose to compile the kernel module that comes with +the Open vSwitch distribution or to use the kernel module built into +the Linux kernel (version 3.3 or later). See the [FAQ.md] question +"What features are not available in the Open vSwitch kernel datapath that +ships as part of the upstream Linux kernel?" for more information on +this trade-off. You may also use the userspace-only implementation, +at some cost in features and performance (see [INSTALL.userspace.md] +for details). To compile the kernel module on Linux, you must also +install the following: + + - A supported Linux kernel version. Please refer to [README.md] for a + list of supported versions. + + The Open vSwitch datapath requires bridging support + (CONFIG_BRIDGE) to be built as a kernel module. (This is common + in kernels provided by Linux distributions.) The bridge module + must not be loaded or in use. If the bridge module is running + (check with "lsmod | grep bridge"), you must remove it ("rmmod + bridge") before starting the datapath. + + For optional support of ingress policing, you must enable kernel + configuration options NET_CLS_BASIC, NET_SCH_INGRESS, and + NET_ACT_POLICE, either built-in or as modules. (NET_CLS_POLICE is + obsolete and not needed.) + + To use GRE tunneling on Linux 2.6.37 or newer, kernel support + for GRE demultiplexing (CONFIG_NET_IPGRE_DEMUX) must be compiled + in or available as a module. Also, on kernels before 3.11, the + ip_gre module, for GRE tunnels over IP (NET_IPGRE), must not be + loaded or compiled in. + + To configure HTB or HFSC quality of service with Open vSwitch, + you must enable the respective configuration options. + + To use Open vSwitch support for TAP devices, you must enable + CONFIG_TUN. + + - To build a kernel module, you need the same version of GCC that + was used to build that kernel. + + - A kernel build directory corresponding to the Linux kernel image + the module is to run on. Under Debian and Ubuntu, for example, + each linux-image package containing a kernel binary has a + corresponding linux-headers package with the required build + infrastructure. + +If you are working from a Git tree or snapshot (instead of from a +distribution tarball), or if you modify the Open vSwitch build system +or the database schema, you will also need the following software: + + - Autoconf version 2.63 or later. + + - Automake version 1.10 or later. + + - libtool version 2.4 or later. (Older versions might work too.) + +To run the unit tests, you also need: + + - Perl. Version 5.10.1 is known to work. Earlier versions should + also work. + +The ovs-vswitchd.conf.db(5) manpage will include an E-R diagram, in +formats other than plain text, only if you have the following: + + - "dot" from graphviz (http://www.graphviz.org/). + + - Perl. Version 5.10.1 is known to work. Earlier versions should + also work. + + - Python 2.x, for x >= 4. + +If you are going to extensively modify Open vSwitch, please consider +installing the following to obtain better warnings: + + - "sparse" version 0.4.4 or later + (http://www.kernel.org/pub/software/devel/sparse/dist/). + + - GNU make. + + - clang, version 3.4 or later + +Also, you may find the ovs-dev script found in utilities/ovs-dev.py useful. + +Installation Requirements +------------------------- + +The machine on which Open vSwitch is to be installed must have the +following software: + + - libc compatible with the libc used for build. + + - libssl compatible with the libssl used for build, if OpenSSL was + used for the build. + + - On Linux, the same kernel version configured as part of the build. + + - For optional support of ingress policing on Linux, the "tc" program + from iproute2 (part of all major distributions and available at + http://www.linux-foundation.org/en/Net:Iproute2). + +On Linux you should ensure that /dev/urandom exists. To support TAP +devices, you must also ensure that /dev/net/tun exists. + +Building and Installing Open vSwitch for Linux, FreeBSD or NetBSD +================================================================= + +Once you have installed all the prerequisites listed above in the +Base Prerequisites section, follow the procedures below to bootstrap, +to configure and to build the code. + +Bootstrapping the Sources +------------------------- + +This step is not needed if you have downloaded a released tarball. +If you pulled the sources directly from an Open vSwitch Git tree or +got a Git tree snapshot, then run boot.sh in the top source directory +to build the "configure" script. + + `% ./boot.sh` + + +Configuring the Sources +----------------------- + +Configure the package by running the configure script. You can +usually invoke configure without any arguments. For example: + + `% ./configure` + +By default all files are installed under /usr/local. If you want +to install into, e.g., /usr and /var instead of /usr/local and +/usr/local/var, add options as shown here: + + `% ./configure --prefix=/usr --localstatedir=/var` + +By default, static libraries are built and linked against. If you +want to use shared libraries instead: + + % ./configure --enable-shared + +To use a specific C compiler for compiling Open vSwitch user +programs, also specify it on the configure command line, like so: + + `% ./configure CC=gcc-4.2` + +To use 'clang' compiler: + + `% ./configure CC=clang` + +To supply special flags to the C compiler, specify them as CFLAGS on +the configure command line. If you want the default CFLAGS, which +include "-g" to build debug symbols and "-O2" to enable optimizations, +you must include them yourself. For example, to build with the +default CFLAGS plus "-mssse3", you might run configure as follows: + + `% ./configure CFLAGS="-g -O2 -mssse3"` + +Note that these CFLAGS are not applied when building the Linux +kernel module. Custom CFLAGS for the kernel module are supplied +using the EXTRA_CFLAGS variable when running make. So, for example: + + `% make EXTRA_CFLAGS="-Wno-error=date-time" + +To build the Linux kernel module, so that you can run the +kernel-based switch, pass the location of the kernel build +directory on --with-linux. For example, to build for a running +instance of Linux: + + `% ./configure --with-linux=/lib/modules/`uname -r`/build` + +If --with-linux requests building for an unsupported version of +Linux, then "configure" will fail with an error message. Please +refer to the [FAQ.md] for advice in that case. + +If you wish to build the kernel module for an architecture other +than the architecture of the machine used for the build, you may +specify the kernel architecture string using the KARCH variable +when invoking the configure script. For example, to build for MIPS +with Linux: + + `% ./configure --with-linux=/path/to/linux KARCH=mips` + +If you plan to do much Open vSwitch development, you might want to +add --enable-Werror, which adds the -Werror option to the compiler +command line, turning warnings into errors. That makes it +impossible to miss warnings generated by the build. + +To build with gcov code coverage support, add --enable-coverage, +e.g.: + + `% ./configure --enable-coverage` + +The configure script accepts a number of other options and honors +additional environment variables. For a full list, invoke +configure with the --help option. + +You can also run configure from a separate build directory. This +is helpful if you want to build Open vSwitch in more than one way +from a single source directory, e.g. to try out both GCC and Clang +builds, or to build kernel modules for more than one Linux version. +Here is an example: + + `% mkdir _gcc && (cd _gcc && ../configure CC=gcc)` + `% mkdir _clang && (cd _clang && ../configure CC=clang)` + + +Building the Sources +-------------------- + +1. Run GNU make in the build directory, e.g.: + + `% make` + + or if GNU make is installed as "gmake": + + `% gmake` + + If you used a separate build directory, run make or gmake from that + directory, e.g.: + + `% make -C _gcc` + `% make -C _clang` + + For improved warnings if you installed "sparse" (see "Prerequisites"), + add C=1 to the command line. + + Some versions of Clang and ccache are not completely compatible. + If you see unusual warnings when you use both together, consider + disabling ccache for use with Clang. + +2. Consider running the testsuite. Refer to "Running the Testsuite" + below, for instructions. + +3. Become root by running "su" or another program. + +4. Run "make install" to install the executables and manpages into the + running system, by default under /usr/local. + +5. If you built kernel modules, you may install and load them, e.g.: + + `% make modules_install` + `% /sbin/modprobe openvswitch` + + To verify that the modules have been loaded, run "/sbin/lsmod" and + check that openvswitch is listed. + + If the `modprobe` operation fails, look at the last few kernel log + messages (e.g. with `dmesg | tail`): + + - The message "openvswitch: exports duplicate symbol + br_should_route_hook (owned by bridge)" means that the bridge + module is loaded. Run `/sbin/rmmod bridge` to remove it. + + If `/sbin/rmmod bridge` fails with "ERROR: Module bridge does + not exist in /proc/modules", then the bridge is compiled into + the kernel, rather than as a module. Open vSwitch does not + support this configuration (see "Build Requirements", above). + + - The message "openvswitch: exports duplicate symbol + dp_ioctl_hook (owned by ofdatapath)" means that the ofdatapath + module from the OpenFlow reference implementation is loaded. + Run `/sbin/rmmod ofdatapath` to remove it. (You might have to + delete any existing datapaths beforehand, using the "dpctl" + program included with the OpenFlow reference implementation. + "ovs-dpctl" will not work.) + + - Otherwise, the most likely problem is that Open vSwitch was + built for a kernel different from the one into which you are + trying to load it. Run `modinfo` on openvswitch.ko and on + a module built for the running kernel, e.g.: + + ``` + % /sbin/modinfo openvswitch.ko + % /sbin/modinfo /lib/modules/`uname -r`/kernel/net/bridge/bridge.ko + ``` + + Compare the "vermagic" lines output by the two commands. If + they differ, then Open vSwitch was built for the wrong kernel. + + - If you decide to report a bug or ask a question related to + module loading, please include the output from the `dmesg` and + `modinfo` commands mentioned above. + +There is an optional module parameter to openvswitch.ko called +vlan_tso that enables TCP segmentation offload over VLANs on NICs +that support it. Many drivers do not expose support for TSO on VLANs +in a way that Open vSwitch can use but there is no way to detect +whether this is the case. If you know that your particular driver can +handle it (for example by testing sending large TCP packets over VLANs) +then passing in a value of 1 may improve performance. Modules built for +Linux kernels 2.6.37 and later, as well as specially patched versions +of earlier kernels, do not need this and do not have this parameter. If +you do not understand what this means or do not know if your driver +will work, do not set this. + +6. Initialize the configuration database using ovsdb-tool, e.g.: + + `% mkdir -p /usr/local/etc/openvswitch` + `% ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema` + +Startup +======= + +Before starting ovs-vswitchd itself, you need to start its +configuration database, ovsdb-server. Each machine on which Open +vSwitch is installed should run its own copy of ovsdb-server. +Configure it to use the database you created during installation (as +explained above), to listen on a Unix domain socket, to connect to any +managers specified in the database itself, and to use the SSL +configuration in the database: + + % ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ + --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ + --private-key=db:Open_vSwitch,SSL,private_key \ + --certificate=db:Open_vSwitch,SSL,certificate \ + --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \ + --pidfile --detach + +(If you built Open vSwitch without SSL support, then omit +--private-key, --certificate, and --bootstrap-ca-cert.) + +Then initialize the database using ovs-vsctl. This is only +necessary the first time after you create the database with +ovsdb-tool (but running it at any time is harmless): + + % ovs-vsctl --no-wait init + +Then start the main Open vSwitch daemon, telling it to connect to the +same Unix domain socket: + + % ovs-vswitchd --pidfile --detach + +Now you may use ovs-vsctl to set up bridges and other Open vSwitch +features. For example, to create a bridge named br0 and add ports +eth0 and vif1.0 to it: + + % ovs-vsctl add-br br0 + % ovs-vsctl add-port br0 eth0 + % ovs-vsctl add-port br0 vif1.0 + +Please refer to ovs-vsctl(8) for more details. + +Upgrading +========= + +When you upgrade Open vSwitch from one version to another, you should +also upgrade the database schema: + +1. Stop the Open vSwitch daemons, e.g.: + + ``` + % kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid` + ``` + +2. Install the new Open vSwitch release. + +3. Upgrade the database, in one of the following two ways: + + - If there is no important data in your database, then you may + delete the database file and recreate it with ovsdb-tool, + following the instructions under "Building and Installing Open + vSwitch for Linux, FreeBSD or NetBSD". + + - If you want to preserve the contents of your database, back it + up first, then use "ovsdb-tool convert" to upgrade it, e.g.: + + `% ovsdb-tool convert /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema` + +4. Start the Open vSwitch daemons as described under "Building and + Installing Open vSwitch for Linux, FreeBSD or NetBSD" above. + +Hot Upgrading +============= +Upgrading Open vSwitch from one version to the next version with minimum +disruption of traffic going through the system that is using that Open vSwitch +needs some considerations: + +1. If the upgrade only involves upgrading the userspace utilities and daemons +of Open vSwitch, make sure that the new userspace version is compatible with +the previously loaded kernel module. + +2. An upgrade of userspace daemons means that they have to be restarted. +Restarting the daemons means that the OpenFlow flows in the ovs-vswitchd daemon +will be lost. One way to restore the flows is to let the controller +re-populate it. Another way is to save the previous flows using a utility +like ovs-ofctl and then re-add them after the restart. Restoring the old flows +is accurate only if the new Open vSwitch interfaces retain the old 'ofport' +values. + +3. When the new userspace daemons get restarted, they automatically flush +the old flows setup in the kernel. This can be expensive if there are hundreds +of new flows that are entering the kernel but userspace daemons are busy +setting up new userspace flows from either the controller or an utility like +ovs-ofctl. Open vSwitch database provides an option to solve this problem +through the other_config:flow-restore-wait column of the Open_vSwitch table. +Refer to the ovs-vswitchd.conf.db(5) manpage for details. + +4. If the upgrade also involves upgrading the kernel module, the old kernel +module needs to be unloaded and the new kernel module should be loaded. This +means that the kernel network devices belonging to Open vSwitch is recreated +and the kernel flows are lost. The downtime of the traffic can be reduced +if the userspace daemons are restarted immediately and the userspace flows +are restored as soon as possible. + +The ovs-ctl utility's "restart" function only restarts the userspace daemons, +makes sure that the 'ofport' values remain consistent across restarts, restores +userspace flows using the ovs-ofctl utility and also uses the +other_config:flow-restore-wait column to keep the traffic downtime to the +minimum. The ovs-ctl utility's "force-reload-kmod" function does all of the +above, but also replaces the old kernel module with the new one. Open vSwitch +startup scripts for Debian, XenServer and RHEL use ovs-ctl's functions and it +is recommended that these functions be used for other software platforms too. + +Testsuites +========== + +This section describe Open vSwitch's built-in support for various test +suites. You must bootstrap, configure and build Open vSwitch (steps are +in "Building and Installing Open vSwitch for Linux, FreeBSD or NetBSD" +above) before you run the tests described here. You do not need to +install Open vSwitch or to build or load the kernel module to run +these test suites. You do not need supervisor privilege to run these +test suites. + +Self-Tests +---------- + +Open vSwitch includes a suite of self-tests. Before you submit patches +upstream, we advise that you run the tests and ensure that they pass. +If you add new features to Open vSwitch, then adding tests for those +features will ensure your features don't break as developers modify +other areas of Open vSwitch. + +Refer to "Testsuites" above for prerequisites. + +To run all the unit tests in Open vSwitch, one at a time: + `make check` +This takes under 5 minutes on a modern desktop system. + +To run all the unit tests in Open vSwitch, up to 8 in parallel: + `make check TESTSUITEFLAGS=-j8` +This takes under a minute on a modern 4-core desktop system. + +To see a list of all the available tests, run: + `make check TESTSUITEFLAGS=--list` + +To run only a subset of tests, e.g. test 123 and tests 477 through 484: + `make check TESTSUITEFLAGS='123 477-484'` +(Tests do not have inter-dependencies, so you may run any subset.) + +To run tests matching a keyword, e.g. "ovsdb": + `make check TESTSUITEFLAGS='-k ovsdb'` + +To see a complete list of test options: + `make check TESTSUITEFLAGS=--help` + +The results of a testing run are reported in tests/testsuite.log. +Please report test failures as bugs and include the testsuite.log in +your report. + +If you have "valgrind" installed, then you can also run the testsuite +under valgrind by using "make check-valgrind" in place of "make +check". All the same options are available via TESTSUITEFLAGS. When +you do this, the "valgrind" results for test `` are reported in files +named `tests/testsuite.dir//valgrind.*`. You may find that the +valgrind results are easier to interpret if you put "-q" in +~/.valgrindrc, since that reduces the amount of output. + +Sometimes a few tests may fail on some runs but not others. This is +usually a bug in the testsuite, not a bug in Open vSwitch itself. If +you find that a test fails intermittently, please report it, since the +developers may not have noticed. + +OFTest +------ + +OFTest is an OpenFlow protocol testing suite. Open vSwitch includes a +Makefile target to run OFTest with Open vSwitch in "dummy mode". In +this mode of testing, no packets travel across physical or virtual +networks. Instead, Unix domain sockets stand in as simulated +networks. This simulation is imperfect, but it is much easier to set +up, does not require extra physical or virtual hardware, and does not +require supervisor privileges. + +To run OFTest with Open vSwitch, first read and follow the +instructions under "Testsuites" above. Second, obtain a copy of +OFTest and install its prerequisites. You need a copy of OFTest that +includes commit 406614846c5 (make ovs-dummy platform work again). +This commit was merged into the OFTest repository on Feb 1, 2013, so +any copy of OFTest more recent than that should work. Testing OVS in +dummy mode does not require root privilege, so you may ignore that +requirement. + +Optionally, add the top-level OFTest directory (containing the "oft" +program) to your $PATH. This slightly simplifies running OFTest later. + +To run OFTest in dummy mode, run the following command from your Open +vSwitch build directory: + `make check-oftest OFT=` +where `` is the absolute path to the "oft" program in +OFTest. + +If you added "oft" to your $PATH, you may omit the OFT variable +assignment: + `make check-oftest` +By default, "check-oftest" passes "oft" just enough options to enable +dummy mode. You can use OFTFLAGS to pass additional options. For +example, to run just the basic.Echo test instead of all tests (the +default) and enable verbose logging: + `make check-oftest OFT= OFTFLAGS='--verbose -T basic.Echo'` + +If you use OFTest that does not include commit 4d1f3eb2c792 (oft: +change default port to 6653), merged into the OFTest repository in +October 2013, then you need to add an option to use the IETF-assigned +controller port: + `make check-oftest OFT= OFTFLAGS='--port=6653'` + +Please interpret OFTest results cautiously. Open vSwitch can fail a +given test in OFTest for many reasons, including bugs in Open vSwitch, +bugs in OFTest, bugs in the "dummy mode" integration, and differing +interpretations of the OpenFlow standard and other standards. + +Open vSwitch has not been validated against OFTest. Please do report +test failures that you believe to represent bugs in Open vSwitch. +Include the precise versions of Open vSwitch and OFTest in your bug +report, plus any other information needed to reproduce the problem. + +Ryu +--- + +Ryu is an OpenFlow controller written in Python that includes an +extensive OpenFlow testsuite. Open vSwitch includes a Makefile target +to run Ryu in "dummy mode". See "OFTest" above for an explanation of +dummy mode. + +To run Ryu tests with Open vSwitch, first read and follow the +instructions under "Testsuites" above. Second, obtain a copy of Ryu, +install its prerequisites, and build it. You do not need to install +Ryu (some of the tests do not get installed, so it does not help). + +To run Ryu tests, run the following command from your Open vSwitch +build directory: + `make check-ryu RYUDIR=` +where `` is the absolute path to the root of the Ryu +source distribution. The default `` is `$srcdir/../ryu` +where $srcdir is your Open vSwitch source directory, so if this +default is correct then you make simply run `make check-ryu`. + +Open vSwitch has not been validated against Ryu. Please do report +test failures that you believe to represent bugs in Open vSwitch. +Include the precise versions of Open vSwitch and Ryu in your bug +report, plus any other information needed to reproduce the problem. + +Vagrant +------- + +Requires: Vagrant (version 1.7.0 or later) and a compatible hypervisor + +You must bootstrap and configure the sources (steps are in "Building +and Installing Open vSwitch for Linux, FreeBSD or NetBSD" above) before +you run the steps described here. + +A Vagrantfile is provided allowing to compile and provision the source +tree as found locally in a virtual machine using the following commands: + + vagrant up + vagrant ssh + +This will bring up w Fedora 20 VM by default, alternatively the +`Vagrantfile` can be modified to use a different distribution box as +base. Also, the VM can be reprovisioned at any time: + + vagrant provision + +OVS out-of-tree compilation environment can be set up with: + + ./boot.sh + vagrant provision --provision-with configure_ovs,build_ovs + +This will set up an out-of-tree build environment in /home/vagrant/build. +The source code can be found in /vagrant. Out-of-tree build is preferred +to work around limitations of the sync file systems. + +To recompile and reinstall OVS using RPM: + + ./boot.sh + vagrant provision --provision-with configure_ovs,install_rpm + +Continuous Integration with Travis-CI +------------------------------------- + +A .travis.yml file is provided to automatically build Open vSwitch with +various build configurations and run the testsuite using travis-ci. +Builds will be performed with gcc, sparse and clang with the -Werror +compiler flag included, therefore the build will fail if a new warning +has been introduced. + +The CI build is triggered via git push (regardless of the specific +branch) or pull request against any Open vSwitch GitHub repository that +is linked to travis-ci. + +Instructions to setup travis-ci for your GitHub repository: + +1. Go to http://travis-ci.org/ and sign in using your GitHub ID. +2. Go to the "Repositories" tab and enable the ovs repository. You + may disable builds for pushes or pull requests. +3. In order to avoid forks sending build failures to the upstream + mailing list, the notification email recipient is encrypted. If you + want to receive email notification for build failures, replace the + the encrypted string: + 3.1) Install the travis-ci CLI (Requires ruby >=2.0): + gem install travis + 3.2) In your Open vSwitch repository: + travis encrypt mylist@mydomain.org + 3.3) Add/replace the notifications section in .travis.yml and fill + in the secure string as returned by travis encrypt: + + notifications: + email: + recipients: + - secure: "....." + + (You may remove/omit the notifications section to fall back to + default notification behaviour which is to send an email directly + to the author and committer of the failing commit. Note that the + email is only sent if the author/committer have commit rights for + the particular GitHub repository). + +4. Pushing a commit to the repository which breaks the build or the + testsuite will now trigger a email sent to mylist@mydomain.org + +Bug Reporting +============= + +Please report problems to bugs@openvswitch.org. + +[README.md]:README.md +[INSTALL.Debian.md]:INSTALL.Debian.md +[INSTALL.Fedora.md]:INSTALL.Fedora.md +[INSTALL.RHEL.md]:INSTALL.RHEL.md +[INSTALL.XenServer.md]:INSTALL.XenServer.md +[INSTALL.NetBSD.md]:INSTALL.NetBSD.md +[INSTALL.DPDK.md]:INSTALL.DPDK.md +[INSTALL.userspace.md]:INSTALL.userspace.md +[FAQ.md]:FAQ.md diff -Nru openvswitch-2.3.1/INSTALL.NetBSD openvswitch-2.4.0~git20150623/INSTALL.NetBSD --- openvswitch-2.3.1/INSTALL.NetBSD 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.NetBSD 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - How to Install Open vSwitch on NetBSD - ===================================== - -On NetBSD, you might want to install requirements from pkgsrc. -In that case, you need at least the following packages. - - automake - libtool-base - gmake - python27 - py27-xml - pkg_alternatives - -Some components have additional requirements. (See INSTALL) - -Assuming you are running NetBSD/amd64 6.1.2, you can download and -install pre-built binary packages as the following. -(You might get some warnings about minor version mismatch. Don't care.) - - # PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.2/All/ - # export PKG_PATH - # pkg_add automake libtool-base gmake python27 py27-xml pkg_alternatives - -NetBSD's /usr/bin/make is not GNU make. GNU make is installed as -/usr/pkg/bin/gmake by the above mentioned 'gmake' package. - -As all executables installed with pkgsrc are placed in /usr/pkg/bin/ -directory, it might be a good idea to add it to your PATH. - -Open vSwitch on NetBSD is currently "userspace switch" implementation -in the sense described in INSTALL.userspace and PORTING. diff -Nru openvswitch-2.3.1/INSTALL.NetBSD.md openvswitch-2.4.0~git20150623/INSTALL.NetBSD.md --- openvswitch-2.3.1/INSTALL.NetBSD.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.NetBSD.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,37 @@ +How to Install Open vSwitch on NetBSD +===================================== + +On NetBSD, you might want to install requirements from pkgsrc. +In that case, you need at least the following packages. + + * automake + * libtool-base + * gmake + * python27 + * py27-xml + * pkg_alternatives + +Some components have additional requirements. (See [INSTALL.md]) + +Assuming you are running NetBSD/amd64 6.1.2, you can download and +install pre-built binary packages as the following. +(You might get some warnings about minor version mismatch. Don't care.) + + ``` + # PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.2/All/ + # export PKG_PATH + # pkg_add automake libtool-base gmake python27 py27-xml pkg_alternatives + ``` + +NetBSD's `/usr/bin/make` is not GNU make. GNU make is installed as +`/usr/pkg/bin/gmake` by the above mentioned `gmake` package. + +As all executables installed with pkgsrc are placed in `/usr/pkg/bin/` +directory, it might be a good idea to add it to your PATH. + +Open vSwitch on NetBSD is currently "userspace switch" implementation +in the sense described in [INSTALL.userspace.md] and [PORTING.md]. + +[INSTALL.md]:INSTALL.md +[INSTALL.userspace.md]:INSTALL.userspace.md +[PORTING.md]:PORTING.md diff -Nru openvswitch-2.3.1/INSTALL.RHEL openvswitch-2.4.0~git20150623/INSTALL.RHEL --- openvswitch-2.3.1/INSTALL.RHEL 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.RHEL 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ - How to Install Open vSwitch on Red Hat Enterprise Linux - ======================================================= - -This document describes how to build and install Open vSwitch on a Red -Hat Enterprise Linux (RHEL) host. If you want to install Open vSwitch -on a generic Linux host, see INSTALL instead. - -We have tested these instructions with RHEL 5.6 and RHEL 6.0. - -Building Open vSwitch for RHEL ------------------------------- - -You may build from an Open vSwitch distribution tarball or from an -Open vSwitch Git tree. - -Before you begin, note the RPM source directory on your version of -RHEL. On RHEL 5, the default RPM source directory is -/usr/src/redhat/SOURCES. On RHEL 6, it is $HOME/rpmbuild/SOURCES. - -1. If you are building from a distribution tarball, proceed to step 2. - Otherwise, if you are building from an Open vSwitch Git tree, - determine the version of Autoconf available in the RHEL version you - are using. If it is not at least version 2.63, then you have two - choices: - - a. Install Autoconf 2.63 or later, one way or another. - - b. Create a distribution tarball on some other machine, by - running "./boot.sh; ./configure; make dist" in the Git tree. - You must run this on a machine that has the tools listed in - INSTALL as prerequisites for building from a Git tree. - Afterward, proceed with the rest of the instructions using the - distribution tarball. - -2. Install build prerequisites: - - yum install gcc make python-devel openssl-devel kernel-devel graphviz \ - kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \ - libtool - -3. Some versions of the RHEL 6 kernel-devel package contain a broken - "build" symlink. If you are using such a version, you must fix - the problem before continuing. - - To find out whether you are affected, run: - - cd /lib/modules/ - ls -l build/ - - where is the version number of the RHEL 6 kernel. (The - trailing slash in the final command is important. Be sure to include - it.) If the "ls" command produces a directory listing, your - kernel-devel package is OK. If it produces a "No such file or - directory" error, your kernel-devel package is buggy. - - If your kernel-devel package is buggy, then you can fix it with: - - cd /lib/modules/ - rm build - ln -s /usr/src/kernels/ build - - where is the name of an existing directory under - /usr/src/kernels, whose name should be similar to but may - contain some extra parts. Once you have done this, verify the fix with - the same procedure you used above to check for the problem. - -4. If you are building from an Open vSwitch Git tree, then you will - need to first create a distribution tarball by running "./boot.sh; - ./configure; make dist" in the Git tree. - -5. Copy the distribution tarball into the RPM source directory. - -6. Unpack the distribution tarball into a temporary directory and "cd" - into the root of the distribution tarball. - -7. To build Open vSwitch userspace, run: - - rpmbuild -bb rhel/openvswitch.spec - - This produces two RPMs: "openvswitch" and "openvswitch-debuginfo". - - The above command automatically runs the Open vSwitch unit tests. - To disable the unit tests, run: - - rpmbuild -bb --without check rhel/openvswitch.spec - - If the build fails with "configure: error: source dir - /lib/modules/2.6.32-279.el6.x86_64/build doesn't exist" or similar, - then the kernel-devel package is missing or buggy. Go back to step - 1 or 2 and fix the problem. - -8. On RHEL 6, to build the Open vSwitch kernel module, copy - rhel/openvswitch-kmod.files into the RPM source directory and run: - - rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec - - You might have to specify a kernel version and/or variants, e.g.: - - rpmbuild -bb \ - -D "kversion 2.6.32-131.6.1.el6.x86_64" \ - -D "kflavors default debug kdump" \ - rhel/openvswitch-kmod-rhel6.spec - - This produces an "kmod-openvswitch" RPM for each kernel variant, - in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and - "kmod-openvswitch-kdump". - -A RHEL host has default firewall rules that prevent any Open vSwitch tunnel -traffic from passing through. If a user configures Open vSwitch tunnels like -GRE, VXLAN, LISP etc., they will either have to manually add iptables firewall -rules to allow the tunnel traffic or add it through a startup script (Please -refer to the "enable-protocol" command in the ovs-ctl(8) manpage). - -Red Hat Network Scripts Integration ------------------------------------ - -Simple integration with Red Hat network scripts has been implemented. -Please read rhel/README.RHEL in the source tree or -/usr/share/doc/openvswitch/README.RHEL in the installed openvswitch -package for details. - -Reporting Bugs --------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.RHEL.md openvswitch-2.4.0~git20150623/INSTALL.RHEL.md --- openvswitch-2.3.1/INSTALL.RHEL.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.RHEL.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,166 @@ +How to Install Open vSwitch on Red Hat Enterprise Linux +======================================================= + +This document describes how to build and install Open vSwitch on a Red +Hat Enterprise Linux (RHEL) host. If you want to install Open vSwitch +on a generic Linux host, see [INSTALL.md] instead. + +We have tested these instructions with RHEL 5.6 and RHEL 6.0. + +Building Open vSwitch for RHEL +------------------------------ + +You may build from an Open vSwitch distribution tarball or from an +Open vSwitch Git tree. + +The default RPM build directory (_topdir) has five directories in +the top-level: +1. BUILD/ Where the software is unpacked and built. +2. RPMS/ Where the newly created binary package files are written. +3. SOURCES/ Contains the original sources, patches, and icon files. +4. SPECS/ Contains the spec files for each package to be built. +5. SRPMS/ Where the newly created source package files are written. + +Before you begin, note the RPM sources directory on your version of +RHEL. The command "rpmbuild --showrc" will show the configuration +for each of those directories. Alternatively, the command "rpm --eval + '%{_topdir}'" shows the current configuration for the top level +directory and the command "rpm --eval '%{_sourcedir}'" does the same +for the sources directory. On RHEL 5, the default RPM _topdir is +/usr/src/redhat and the default RPM sources directory is +/usr/src/redhat/SOURCES. On RHEL 6, the default _topdir is +$HOME/rpmbuild and the default RPM sources directory is +$HOME/rpmbuild/SOURCES. + +1. Install build prerequisites: + + ``` + yum install gcc make python-devel openssl-devel kernel-devel graphviz \ + kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \ + libtool + ``` + +2. If you are building from a distribution tarball, skip to step 3. + Otherwise, you must be building from an Open vSwitch Git tree. + Determine what version of Autoconf is installed (e.g. run "autoconf + --version"). If it is not at least version 2.63, then you have two + choices: + + a. Install Autoconf 2.63 or later, one way or another. + + b. Create a distribution tarball on some other machine, by + running "./boot.sh; ./configure; make dist" in the Git tree. + You must run this on a machine that has the tools listed in + [INSTALL.md] as prerequisites for building from a Git tree. + Afterward, proceed with the rest of the instructions using + the distribution tarball. + +3. Some versions of the RHEL 6 kernel-devel package contain a broken + "build" symlink. If you are using such a version, you must fix + the problem before continuing. + + To find out whether you are affected, run: + + ``` + cd /lib/modules/ + ls -l build/ + ``` + + where `` is the version number of the RHEL 6 kernel. (The + trailing slash in the final command is important. Be sure to include + it.) If the "ls" command produces a directory listing, your + kernel-devel package is OK. If it produces a "No such file or + directory" error, your kernel-devel package is buggy. + + If your kernel-devel package is buggy, then you can fix it with: + + ``` + cd /lib/modules/ + rm build + ln -s /usr/src/kernels/ build + ``` + + where `` is the name of an existing directory under + /usr/src/kernels, whose name should be similar to `` but may + contain some extra parts. Once you have done this, verify the fix with + the same procedure you used above to check for the problem. + +4. If you are building from a distribution tarball, skip to step 5. + Otherwise, create a distribution tarball from the root of the Git + tree by running: + + ``` + ./boot.sh + ./configure + make dist + ``` + +5. Now you have a distribution tarball, named something like + openvswitch-x.y.z.tar.gz. Copy this file into the RPM sources + directory, e.g.: + + `cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES` + +6. Make another copy of the distribution tarball in a temporary + directory. Then unpack the tarball and "cd" into its root, e.g.: + + ``` + tar xzf openvswitch-x.y.z.tar.gz + cd openvswitch-x.y.z + ``` + +7. To build Open vSwitch userspace, run: + + `rpmbuild -bb rhel/openvswitch.spec` + + This produces two RPMs: "openvswitch" and "openvswitch-debuginfo". + + The above command automatically runs the Open vSwitch unit tests. + To disable the unit tests, run: + + `rpmbuild -bb --without check rhel/openvswitch.spec` + + If the build fails with "configure: error: source dir + /lib/modules/2.6.32-279.el6.x86_64/build doesn't exist" or similar, + then the kernel-devel package is missing or buggy. Go back to step + 1 or 2 and fix the problem. + +8. On RHEL 6, to build the Open vSwitch kernel module, copy + rhel/openvswitch-kmod.files into the RPM sources directory and run: + + `rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec` + + You might have to specify a kernel version and/or variants, e.g.: + + ``` + rpmbuild -bb \ + -D "kversion 2.6.32-131.6.1.el6.x86_64" \ + -D "kflavors default debug kdump" \ + rhel/openvswitch-kmod-rhel6.spec + ``` + + This produces an "kmod-openvswitch" RPM for each kernel variant, in + this example: "kmod-openvswitch", "kmod-openvswitch-debug", and + "kmod-openvswitch-kdump". + +A RHEL host has default firewall rules that prevent any Open vSwitch tunnel +traffic from passing through. If a user configures Open vSwitch tunnels like +Geneve, GRE, VXLAN, LISP etc., they will either have to manually add iptables +firewall rules to allow the tunnel traffic or add it through a startup script +(Please refer to the "enable-protocol" command in the ovs-ctl(8) manpage). + +Red Hat Network Scripts Integration +----------------------------------- + +Simple integration with Red Hat network scripts has been implemented. +Please read [rhel/README.RHEL] in the source tree or +/usr/share/doc/openvswitch/README.RHEL in the installed openvswitch +package for details. + +Reporting Bugs +-------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md +[rhel/README.RHEL]:rhel/README.RHEL diff -Nru openvswitch-2.3.1/INSTALL.SSL openvswitch-2.4.0~git20150623/INSTALL.SSL --- openvswitch-2.3.1/INSTALL.SSL 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.SSL 1970-01-01 00:00:00.000000000 +0000 @@ -1,312 +0,0 @@ - Configuring Open vSwitch for SSL - ================================ - -If you plan to configure Open vSwitch to connect across the network to -an OpenFlow controller, then we recommend that you build Open vSwitch -with OpenSSL. SSL support ensures integrity and confidentiality of -the OpenFlow connections, increasing network security. - -This file explains how to configure an Open vSwitch to connect to an -OpenFlow controller over SSL. Refer to INSTALL for instructions on -building Open vSwitch with SSL support. - -Open vSwitch uses TLS version 1.0 or later (TLSv1), as specified by -RFC 2246, which is very similar to SSL version 3.0. TLSv1 was -released in January 1999, so all current software and hardware should -implement it. - -This document assumes basic familiarity with public-key cryptography -and public-key infrastructure. - -SSL Concepts for OpenFlow -------------------------- - -This section is an introduction to the public-key infrastructure -architectures that Open vSwitch supports for SSL authentication. - -To connect over SSL, every Open vSwitch must have a unique -private/public key pair and a certificate that signs that public key. -Typically, the Open vSwitch generates its own public/private key pair. -There are two common ways to obtain a certificate for a switch: - - * Self-signed certificates: The Open vSwitch signs its certificate - with its own private key. In this case, each switch must be - individually approved by the OpenFlow controller(s), since there - is no central authority. - - This is the only switch PKI model currently supported by NOX - (http://noxrepo.org). - - * Switch certificate authority: A certificate authority (the - "switch CA") signs each Open vSwitch's public key. The OpenFlow - controllers then check that any connecting switches' - certificates are signed by that certificate authority. - - This is the only switch PKI model supported by the simple - OpenFlow controller included with Open vSwitch. - -Each Open vSwitch must also have a copy of the CA certificate for the -certificate authority that signs OpenFlow controllers' keys (the -"controller CA" certificate). Typically, the same controller CA -certificate is installed on all of the switches within a given -administrative unit. There are two common ways for a switch to obtain -the controller CA certificate: - - * Manually copy the certificate to the switch through some secure - means, e.g. using a USB flash drive, or over the network with - "scp", or even FTP or HTTP followed by manual verification. - - * Open vSwitch "bootstrap" mode, in which Open vSwitch accepts and - saves the controller CA certificate that it obtains from the - OpenFlow controller on its first connection. Thereafter the - switch will only connect to controllers signed by the same CA - certificate. - -Establishing a Public Key Infrastructure ----------------------------------------- - -Open vSwitch can make use of your existing public key infrastructure. -If you already have a PKI, you may skip forward to the next section. -Otherwise, if you do not have a PKI, the ovs-pki script included with -Open vSwitch can help. To create an initial PKI structure, invoke it -as: - - % ovs-pki init - -to create and populate a new PKI directory. The default location for -the PKI directory depends on how the Open vSwitch tree was configured -(to see the configured default, look for the --dir option description -in the output of "ovs-pki --help"). - -The pki directory contains two important subdirectories. The -controllerca subdirectory contains controller CA files, including the -following: - - - cacert.pem: Root certificate for the controller certificate - authority. Each Open vSwitch must have a copy of this file to - allow it to authenticate valid controllers. - - - private/cakey.pem: Private signing key for the controller - certificate authority. This file must be kept secret. There is - no need for switches or controllers to have a copy of it. - -The switchca subdirectory contains switch CA files, analogous to those -in the controllerca subdirectory: - - - cacert.pem: Root certificate for the switch certificate - authority. The OpenFlow controller must have this file to - enable it to authenticate valid switches. - - - private/cakey.pem: Private signing key for the switch - certificate authority. This file must be kept secret. There is - no need for switches or controllers to have a copy of it. - -After you create the initial structure, you can create keys and -certificates for switches and controllers with ovs-pki. Refer to the -ovs-pki(8) manage for complete details. A few examples of its use -follow: - -CONTROLLER KEY GENERATION - -To create a controller private key and certificate in files named -ctl-privkey.pem and ctl-cert.pem, run the following on the machine -that contains the PKI structure: - - % ovs-pki req+sign ctl controller - -ctl-privkey.pem and ctl-cert.pem would need to be copied to the -controller for its use at runtime. If you were to use test-controller, -the simple OpenFlow controller included with Open vSwitch, then the ---private-key and --certificate options, respectively, would point to -these files. - -It is very important to make sure that no stray copies of -ctl-privkey.pem are created, because they could be used to impersonate -the controller. - -SWITCH KEY GENERATION WITH SELF-SIGNED CERTIFICATES - -If you are using self-signed certificates (see "SSL Concepts for -OpenFlow"), this is one way to create an acceptable certificate for -your controller to approve. - -1. Run the following command on the Open vSwitch itself: - - % ovs-pki self-sign sc - - (This command does not require a copy of any of the PKI files - generated by "ovs-pki init", and you should not copy them to the - switch because some of them have contents that must remain secret - for security.) - - The "ovs-pki self-sign" command has the following output: - - * sc-privkey.pem, the switch private key file. For security, - the contents of this file must remain secret. There is - ordinarily no need to copy this file off the Open vSwitch. - - * sc-cert.pem, the switch certificate, signed by the switch's - own private key. Its contents are not a secret. - -2. Optionally, copy controllerca/cacert.pem from the machine that has - the OpenFlow PKI structure and verify that it is correct. - (Otherwise, you will have to use CA certificate bootstrapping when - you configure Open vSwitch in the next step.) - -3. Configure Open vSwitch to use the keys and certificates (see - "Configuring SSL Support", below). - -SWITCH KEY GENERATION WITH A SWITCH PKI (EASY METHOD) - -If you are using a switch PKI (see "SSL Concepts for OpenFlow", -above), this method of switch key generation is a little easier than -the alternate method described below, but it is also a little less -secure because it requires copying a sensitive private key from file -from the machine hosting the PKI to the switch. - -1. Run the following on the machine that contains the PKI structure: - - % ovs-pki req+sign sc switch - - This command has the following output: - - * sc-privkey.pem, the switch private key file. For - security, the contents of this file must remain secret. - - * sc-cert.pem, the switch certificate. Its contents are - not a secret. - -2. Copy sc-privkey.pem and sc-cert.pem, plus controllerca/cacert.pem, - to the Open vSwitch. - -3. Delete the copies of sc-privkey.pem and sc-cert.pem on the PKI - machine and any other copies that may have been made in transit. - It is very important to make sure that there are no stray copies of - sc-privkey.pem, because they could be used to impersonate the - switch. - - (Don't delete controllerca/cacert.pem! It is not - security-sensitive and you will need it to configure additional - switches.) - -4. Configure Open vSwitch to use the keys and certificates (see - "Configuring SSL Support", below). - -SWITCH KEY GENERATION WITH A SWITCH PKI (MORE SECURE) - -If you are using a switch PKI (see "SSL Concepts for OpenFlow", -above), then, compared to the previous method, the method described -here takes a little more work, but it does not involve copying the -private key from one machine to another, so it may also be a little -more secure. - -1. Run the following command on the Open vSwitch itself: - - % ovs-pki req sc switch - - (This command does not require a copy of any of the PKI files - generated by "ovs-pki init", and you should not copy them to the - switch because some of them have contents that must remain secret - for security.) - - The "ovs-pki req" command has the following output: - - * sc-privkey.pem, the switch private key file. For security, - the contents of this file must remain secret. There is - ordinarily no need to copy this file off the Open vSwitch. - - * sc-req.pem, the switch "certificate request", which is - essentially the switch's public key. Its contents are not a - secret. - - * A fingerprint, on stdout. - -2. Write the fingerprint down on a slip of paper and copy sc-req.pem - to the machine that contains the PKI structure. - -3. On the machine that contains the PKI structure, run: - - % ovs-pki sign sc switch - - This command will output a fingerprint to stdout and request that - you verify it. Check that it is the same as the fingerprint that - you wrote down on the slip of paper before you answer "yes". - - "ovs-pki sign" creates a file named sc-cert.pem, which is the - switch certificate. Its contents are not a secret. - -4. Copy the generated sc-cert.pem, plus controllerca/cacert.pem from - the PKI structure, to the Open vSwitch, and verify that they were - copied correctly. - - You may delete sc-cert.pem from the machine that hosts the PKI - structure now, although it is not important that you do so. (Don't - delete controllerca/cacert.pem! It is not security-sensitive and - you will need it to configure additional switches.) - -5. Configure Open vSwitch to use the keys and certificates (see - "Configuring SSL Support", below). - -Configuring SSL Support ------------------------ - -SSL configuration requires three additional configuration files. The -first two of these are unique to each Open vSwitch. If you used the -instructions above to build your PKI, then these files will be named -sc-privkey.pem and sc-cert.pem, respectively: - - - A private key file, which contains the private half of an RSA or - DSA key. - - This file can be generated on the Open vSwitch itself, for the - greatest security, or it can be generated elsewhere and copied - to the Open vSwitch. - - The contents of the private key file are secret and must not be - exposed. - - - A certificate file, which certifies that the private key is that - of a trustworthy Open vSwitch. - - This file has to be generated on a machine that has the private - key for the switch certification authority, which should not be - an Open vSwitch; ideally, it should be a machine that is not - networked at all. - - The certificate file itself is not a secret. - -The third configuration file is typically the same across all the -switches in a given administrative unit. If you used the -instructions above to build your PKI, then this file will be named -cacert.pem: - - - The root certificate for the controller certificate authority. - The Open vSwitch verifies it that is authorized to connect to an - OpenFlow controller by verifying a signature against this CA - certificate. - -Once you have these files, configure ovs-vswitchd to use them using -the ovs-vsctl "set-ssl" command, e.g.: - - ovs-vsctl set-ssl /etc/openvswitch/sc-privkey.pem /etc/openvswitch/sc-cert.pem /etc/openvswitch/cacert.pem - -Substitute the correct file names, of course, if they differ from the -ones used above. You should use absolute file names (ones that begin -with "/"), because ovs-vswitchd's current directory is unrelated to -the one from which you run ovs-vsctl. - -If you are using self-signed certificates (see "SSL Concepts for -OpenFlow") and you did not copy controllerca/cacert.pem from the PKI -machine to the Open vSwitch, then add the --bootstrap option, e.g.: - - ovs-vsctl -- --bootstrap set-ssl /etc/openvswitch/sc-privkey.pem /etc/openvswitch/sc-cert.pem /etc/openvswitch/cacert.pem - -After you have added all of these configuration keys, you may specify -"ssl:" connection methods elsewhere in the configuration database. -"tcp:" connection methods are still allowed even after SSL has been -configured, so for security you should use only "ssl:" connections. - -Reporting Bugs --------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.SSL.md openvswitch-2.4.0~git20150623/INSTALL.SSL.md --- openvswitch-2.3.1/INSTALL.SSL.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.SSL.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,314 @@ +Configuring Open vSwitch for SSL +================================ + +If you plan to configure Open vSwitch to connect across the network to +an OpenFlow controller, then we recommend that you build Open vSwitch +with OpenSSL. SSL support ensures integrity and confidentiality of +the OpenFlow connections, increasing network security. + +This file explains how to configure an Open vSwitch to connect to an +OpenFlow controller over SSL. Refer to [INSTALL.md] for instructions +on building Open vSwitch with SSL support. + +Open vSwitch uses TLS version 1.0 or later (TLSv1), as specified by +RFC 2246, which is very similar to SSL version 3.0. TLSv1 was +released in January 1999, so all current software and hardware should +implement it. + +This document assumes basic familiarity with public-key cryptography +and public-key infrastructure. + +SSL Concepts for OpenFlow +------------------------- + +This section is an introduction to the public-key infrastructure +architectures that Open vSwitch supports for SSL authentication. + +To connect over SSL, every Open vSwitch must have a unique +private/public key pair and a certificate that signs that public key. +Typically, the Open vSwitch generates its own public/private key pair. +There are two common ways to obtain a certificate for a switch: + + * Self-signed certificates: The Open vSwitch signs its certificate + with its own private key. In this case, each switch must be + individually approved by the OpenFlow controller(s), since there + is no central authority. + + This is the only switch PKI model currently supported by NOX + (http://noxrepo.org). + + * Switch certificate authority: A certificate authority (the + "switch CA") signs each Open vSwitch's public key. The OpenFlow + controllers then check that any connecting switches' + certificates are signed by that certificate authority. + + This is the only switch PKI model supported by the simple + OpenFlow controller included with Open vSwitch. + +Each Open vSwitch must also have a copy of the CA certificate for the +certificate authority that signs OpenFlow controllers' keys (the +"controller CA" certificate). Typically, the same controller CA +certificate is installed on all of the switches within a given +administrative unit. There are two common ways for a switch to obtain +the controller CA certificate: + + * Manually copy the certificate to the switch through some secure + means, e.g. using a USB flash drive, or over the network with + "scp", or even FTP or HTTP followed by manual verification. + + * Open vSwitch "bootstrap" mode, in which Open vSwitch accepts and + saves the controller CA certificate that it obtains from the + OpenFlow controller on its first connection. Thereafter the + switch will only connect to controllers signed by the same CA + certificate. + +Establishing a Public Key Infrastructure +---------------------------------------- + +Open vSwitch can make use of your existing public key infrastructure. +If you already have a PKI, you may skip forward to the next section. +Otherwise, if you do not have a PKI, the ovs-pki script included with +Open vSwitch can help. To create an initial PKI structure, invoke it +as: + + % ovs-pki init + +to create and populate a new PKI directory. The default location for +the PKI directory depends on how the Open vSwitch tree was configured +(to see the configured default, look for the --dir option description +in the output of "ovs-pki --help"). + +The pki directory contains two important subdirectories. The +controllerca subdirectory contains controller CA files, including the +following: + + - cacert.pem: Root certificate for the controller certificate + authority. Each Open vSwitch must have a copy of this file to + allow it to authenticate valid controllers. + + - private/cakey.pem: Private signing key for the controller + certificate authority. This file must be kept secret. There is + no need for switches or controllers to have a copy of it. + +The switchca subdirectory contains switch CA files, analogous to those +in the controllerca subdirectory: + + - cacert.pem: Root certificate for the switch certificate + authority. The OpenFlow controller must have this file to + enable it to authenticate valid switches. + + - private/cakey.pem: Private signing key for the switch + certificate authority. This file must be kept secret. There is + no need for switches or controllers to have a copy of it. + +After you create the initial structure, you can create keys and +certificates for switches and controllers with ovs-pki. Refer to the +ovs-pki(8) manage for complete details. A few examples of its use +follow: + +CONTROLLER KEY GENERATION + +To create a controller private key and certificate in files named +ctl-privkey.pem and ctl-cert.pem, run the following on the machine +that contains the PKI structure: + + % ovs-pki req+sign ctl controller + +ctl-privkey.pem and ctl-cert.pem would need to be copied to the +controller for its use at runtime. If, for testing purposes, you were +to use ovs-testcontroller, the simple OpenFlow controller included +with Open vSwitch, then the --private-key and --certificate options, +respectively, would point to these files. + +It is very important to make sure that no stray copies of +ctl-privkey.pem are created, because they could be used to impersonate +the controller. + +SWITCH KEY GENERATION WITH SELF-SIGNED CERTIFICATES + +If you are using self-signed certificates (see "SSL Concepts for +OpenFlow"), this is one way to create an acceptable certificate for +your controller to approve. + +1. Run the following command on the Open vSwitch itself: + + % ovs-pki self-sign sc + + (This command does not require a copy of any of the PKI files + generated by "ovs-pki init", and you should not copy them to the + switch because some of them have contents that must remain secret + for security.) + + The "ovs-pki self-sign" command has the following output: + + * sc-privkey.pem, the switch private key file. For security, + the contents of this file must remain secret. There is + ordinarily no need to copy this file off the Open vSwitch. + + * sc-cert.pem, the switch certificate, signed by the switch's + own private key. Its contents are not a secret. + +2. Optionally, copy controllerca/cacert.pem from the machine that has + the OpenFlow PKI structure and verify that it is correct. + (Otherwise, you will have to use CA certificate bootstrapping when + you configure Open vSwitch in the next step.) + +3. Configure Open vSwitch to use the keys and certificates (see + "Configuring SSL Support", below). + +SWITCH KEY GENERATION WITH A SWITCH PKI (EASY METHOD) + +If you are using a switch PKI (see "SSL Concepts for OpenFlow", +above), this method of switch key generation is a little easier than +the alternate method described below, but it is also a little less +secure because it requires copying a sensitive private key from file +from the machine hosting the PKI to the switch. + +1. Run the following on the machine that contains the PKI structure: + + % ovs-pki req+sign sc switch + + This command has the following output: + + * sc-privkey.pem, the switch private key file. For + security, the contents of this file must remain secret. + + * sc-cert.pem, the switch certificate. Its contents are + not a secret. + +2. Copy sc-privkey.pem and sc-cert.pem, plus controllerca/cacert.pem, + to the Open vSwitch. + +3. Delete the copies of sc-privkey.pem and sc-cert.pem on the PKI + machine and any other copies that may have been made in transit. + It is very important to make sure that there are no stray copies of + sc-privkey.pem, because they could be used to impersonate the + switch. + + (Don't delete controllerca/cacert.pem! It is not + security-sensitive and you will need it to configure additional + switches.) + +4. Configure Open vSwitch to use the keys and certificates (see + "Configuring SSL Support", below). + +SWITCH KEY GENERATION WITH A SWITCH PKI (MORE SECURE) + +If you are using a switch PKI (see "SSL Concepts for OpenFlow", +above), then, compared to the previous method, the method described +here takes a little more work, but it does not involve copying the +private key from one machine to another, so it may also be a little +more secure. + +1. Run the following command on the Open vSwitch itself: + + % ovs-pki req sc switch + + (This command does not require a copy of any of the PKI files + generated by "ovs-pki init", and you should not copy them to the + switch because some of them have contents that must remain secret + for security.) + + The "ovs-pki req" command has the following output: + + * sc-privkey.pem, the switch private key file. For security, + the contents of this file must remain secret. There is + ordinarily no need to copy this file off the Open vSwitch. + + * sc-req.pem, the switch "certificate request", which is + essentially the switch's public key. Its contents are not a + secret. + + * A fingerprint, on stdout. + +2. Write the fingerprint down on a slip of paper and copy sc-req.pem + to the machine that contains the PKI structure. + +3. On the machine that contains the PKI structure, run: + + % ovs-pki sign sc switch + + This command will output a fingerprint to stdout and request that + you verify it. Check that it is the same as the fingerprint that + you wrote down on the slip of paper before you answer "yes". + + "ovs-pki sign" creates a file named sc-cert.pem, which is the + switch certificate. Its contents are not a secret. + +4. Copy the generated sc-cert.pem, plus controllerca/cacert.pem from + the PKI structure, to the Open vSwitch, and verify that they were + copied correctly. + + You may delete sc-cert.pem from the machine that hosts the PKI + structure now, although it is not important that you do so. (Don't + delete controllerca/cacert.pem! It is not security-sensitive and + you will need it to configure additional switches.) + +5. Configure Open vSwitch to use the keys and certificates (see + "Configuring SSL Support", below). + +Configuring SSL Support +----------------------- + +SSL configuration requires three additional configuration files. The +first two of these are unique to each Open vSwitch. If you used the +instructions above to build your PKI, then these files will be named +sc-privkey.pem and sc-cert.pem, respectively: + + - A private key file, which contains the private half of an RSA or + DSA key. + + This file can be generated on the Open vSwitch itself, for the + greatest security, or it can be generated elsewhere and copied + to the Open vSwitch. + + The contents of the private key file are secret and must not be + exposed. + + - A certificate file, which certifies that the private key is that + of a trustworthy Open vSwitch. + + This file has to be generated on a machine that has the private + key for the switch certification authority, which should not be + an Open vSwitch; ideally, it should be a machine that is not + networked at all. + + The certificate file itself is not a secret. + +The third configuration file is typically the same across all the +switches in a given administrative unit. If you used the +instructions above to build your PKI, then this file will be named +cacert.pem: + + - The root certificate for the controller certificate authority. + The Open vSwitch verifies it that is authorized to connect to an + OpenFlow controller by verifying a signature against this CA + certificate. + +Once you have these files, configure ovs-vswitchd to use them using +the ovs-vsctl "set-ssl" command, e.g.: + + ovs-vsctl set-ssl /etc/openvswitch/sc-privkey.pem /etc/openvswitch/sc-cert.pem /etc/openvswitch/cacert.pem + +Substitute the correct file names, of course, if they differ from the +ones used above. You should use absolute file names (ones that begin +with "/"), because ovs-vswitchd's current directory is unrelated to +the one from which you run ovs-vsctl. + +If you are using self-signed certificates (see "SSL Concepts for +OpenFlow") and you did not copy controllerca/cacert.pem from the PKI +machine to the Open vSwitch, then add the --bootstrap option, e.g.: + + ovs-vsctl -- --bootstrap set-ssl /etc/openvswitch/sc-privkey.pem /etc/openvswitch/sc-cert.pem /etc/openvswitch/cacert.pem + +After you have added all of these configuration keys, you may specify +"ssl:" connection methods elsewhere in the configuration database. +"tcp:" connection methods are still allowed even after SSL has been +configured, so for security you should use only "ssl:" connections. + +Reporting Bugs +-------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md diff -Nru openvswitch-2.3.1/INSTALL.userspace openvswitch-2.4.0~git20150623/INSTALL.userspace --- openvswitch-2.3.1/INSTALL.userspace 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.userspace 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ - Using Open vSwitch without kernel support - ========================================= - -Open vSwitch can operate, at a cost in performance, entirely in -userspace, without assistance from a kernel module. This file -explains how to install Open vSwitch in such a mode. - -The userspace-only mode of Open vSwitch is considered experimental. -It has not been thoroughly tested. - -This version of Open vSwitch should be built manually with "configure" -and "make". Debian packaging for Open vSwitch is also included, but -it has not been recently tested, and so Debian packages are not a -recommended way to use this version of Open vSwitch. - -Building and Installing ------------------------ - -The requirements and procedure for building, installing, and -configuring Open vSwitch are the same as those given in INSTALL. -You may omit configuring, building, and installing the kernel module, -and the related requirements. - -On Linux, the userspace switch additionally requires the kernel -TUN/TAP driver to be available, either built into the kernel or loaded -as a module. If you are not sure, check for a directory named -/sys/class/misc/tun. If it does not exist, then attempt to load the -module with "modprobe tun". - -The tun device must also exist as /dev/net/tun. If it does not exist, -then create /dev/net (if necessary) with "mkdir /dev/net", then create -/dev/net/tun with "mknod /dev/net/tun c 10 200". - -On FreeBSD and NetBSD, the userspace switch additionally requires the -kernel tap(4) driver to be available, either built into the kernel or -loaded as a module. - -Using the Userspace Datapath with ovs-vswitchd ----------------------------------------------- - -To use ovs-vswitchd in userspace mode, create a bridge with datapath_type -"netdev" in the configuration database. For example: - - ovs-vsctl add-br br0 - ovs-vsctl set bridge br0 datapath_type=netdev - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 eth1 - ovs-vsctl add-port br0 eth2 - -ovs-vswitchd will create a TAP device as the bridge's local interface, -named the same as the bridge, as well as for each configured internal -interface. - -Currently, on FreeBSD, the functionality required for in-band control -support is not implemented. To avoid related errors, you can disable -the in-band support with the following command. - - ovs-vsctl set bridge br0 other_config:disable-in-band=true - -Firewall Rules --------------- - -On Linux, when a physical interface is in use by the userspace -datapath, packets received on the interface still also pass into the -kernel TCP/IP stack. This can cause surprising and incorrect -behavior. You can use "iptables" to avoid this behavior, by using it -to drop received packets. For example, to drop packets received on -eth0: - - iptables -A INPUT -i eth0 -j DROP - iptables -A FORWARD -i eth0 -j DROP - -Other settings --------------- - -On NetBSD, depending on your network topology and applications, the -following configuration might help. See sysctl(7). - - sysctl net.inet.ip.checkinterface=1 - -Bug Reporting -------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.userspace.md openvswitch-2.4.0~git20150623/INSTALL.userspace.md --- openvswitch-2.3.1/INSTALL.userspace.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.userspace.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,86 @@ +Using Open vSwitch without kernel support +========================================= + +Open vSwitch can operate, at a cost in performance, entirely in +userspace, without assistance from a kernel module. This file +explains how to install Open vSwitch in such a mode. + +The userspace-only mode of Open vSwitch is considered experimental. +It has not been thoroughly tested. + +This version of Open vSwitch should be built manually with `configure` +and `make`. Debian packaging for Open vSwitch is also included, but +it has not been recently tested, and so Debian packages are not a +recommended way to use this version of Open vSwitch. + +Building and Installing +----------------------- + +The requirements and procedure for building, installing, and +configuring Open vSwitch are the same as those given in [INSTALL.md]. +You may omit configuring, building, and installing the kernel module, +and the related requirements. + +On Linux, the userspace switch additionally requires the kernel +TUN/TAP driver to be available, either built into the kernel or loaded +as a module. If you are not sure, check for a directory named +/sys/class/misc/tun. If it does not exist, then attempt to load the +module with `modprobe tun`. + +The tun device must also exist as `/dev/net/tun`. If it does not exist, +then create /dev/net (if necessary) with `mkdir /dev/net`, then create +`/dev/net/tun` with `mknod /dev/net/tun c 10 200`. + +On FreeBSD and NetBSD, the userspace switch additionally requires the +kernel tap(4) driver to be available, either built into the kernel or +loaded as a module. + +Using the Userspace Datapath with ovs-vswitchd +---------------------------------------------- + +To use ovs-vswitchd in userspace mode, create a bridge with datapath_type +"netdev" in the configuration database. For example: + + ovs-vsctl add-br br0 + ovs-vsctl set bridge br0 datapath_type=netdev + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 eth1 + ovs-vsctl add-port br0 eth2 + +ovs-vswitchd will create a TAP device as the bridge's local interface, +named the same as the bridge, as well as for each configured internal +interface. + +Currently, on FreeBSD, the functionality required for in-band control +support is not implemented. To avoid related errors, you can disable +the in-band support with the following command. + + ovs-vsctl set bridge br0 other_config:disable-in-band=true + +Firewall Rules +-------------- + +On Linux, when a physical interface is in use by the userspace +datapath, packets received on the interface still also pass into the +kernel TCP/IP stack. This can cause surprising and incorrect +behavior. You can use "iptables" to avoid this behavior, by using it +to drop received packets. For example, to drop packets received on +eth0: + + iptables -A INPUT -i eth0 -j DROP + iptables -A FORWARD -i eth0 -j DROP + +Other settings +-------------- + +On NetBSD, depending on your network topology and applications, the +following configuration might help. See sysctl(7). + + sysctl -w net.inet.ip.checkinterface=1 + +Bug Reporting +------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md diff -Nru openvswitch-2.3.1/INSTALL.Windows.md openvswitch-2.4.0~git20150623/INSTALL.Windows.md --- openvswitch-2.3.1/INSTALL.Windows.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.Windows.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,495 @@ +How to Build the Kernel module & userspace daemons for Windows +============================================================== + +Autoconf, Automake and Visual C++: +--------------------------------- +Open vSwitch on Linux uses autoconf and automake for generating Makefiles. +It will be useful to maintain the same build system while compiling on Windows +too. One approach is to compile Open vSwitch in a MinGW environment that +contains autoconf and automake utilities and then use Visual C++ as a compiler +and linker. + +The following explains the steps in some detail. + +* Install Mingw on a Windows machine by following the instructions at: +http://www.mingw.org/wiki/Getting_Started + +This should install mingw at C:\Mingw and msys at C:\Mingw\msys. +Add "C:\MinGW\bin" and "C:\Mingw\msys\1.0\bin" to PATH environment variable +of Windows. + +You can either use the MinGW installer or the command line utility 'mingw-get' +to install both the base packages and additional packages like automake and +autoconf(version 2.68). + +Also make sure that /mingw mount point exists. If its not, please add/create +the following entry in /etc/fstab - 'C:/MinGW /mingw'. + +* Install the latest Python 2.x from python.org and verify that its path is +part of Windows' PATH environment variable. + +* You will need at least Visual Studio 2013 to compile userspace binaries. In +addition to that, if you want to compile the kernel module you will also need to +install Windows Driver Kit (WDK) 8.1 Update. + +It is important to get the Visual Studio related environment variables and to +have the $PATH inside the bash to point to the proper compiler and linker. One +easy way to achieve this is to get into the "Developer Command prompt for visual +studio" and through it enter into the bash shell available from msys by typing +'bash --login'. + +If after the above step, a 'which link' inside MSYS's bash says, +"/bin/link.exe", rename /bin/link.exe to something else so that the +Visual studio's linker is used. You should also see a 'which sort' report +"/bin/sort.exe". + +* For pthread support, install the library, dll and includes of pthreads-win32 +project from +ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release to a +directory (e.g.: C:/pthread). You should add the pthread-win32's dll +path (e.g.: C:\pthread\dll\x86) to the Windows' PATH environment variable. + +* Get the Open vSwitch sources from either cloning the repo using git +or from a distribution tar ball. + +* If you pulled the sources directly from an Open vSwitch Git tree, + run boot.sh in the top source directory: + + % ./boot.sh + +* In the top source directory, configure the package by running the + configure script. You should provide some configure options to choose + the right compiler, linker, libraries, Open vSwitch component installation + directories, etc. For example, + + % ./configure CC=./build-aux/cccl LD="`which link`" \ + LIBS="-lws2_32 -liphlpapi" --prefix="C:/openvswitch/usr" \ + --localstatedir="C:/openvswitch/var" --sysconfdir="C:/openvswitch/etc" \ + --with-pthread="C:/pthread" + + By default, the above enables compiler optimization for fast code. + For default compiler optimization, pass the "--with-debug" configure + option. + +* Run make for the ported executables in the top source directory, e.g.: + + % make + + For faster compilation, you can pass the '-j' argument to make. For + example, to run 4 jobs simultaneously, run 'make -j4'. + + Note: MSYS 1.0.18 has a bug that causes parallel make to hang. You + can overcome this by downgrading to MSYS 1.0.17. A simple way to + downgrade is to exit all MinGW sessions and then run the command + 'mingw-get upgrade msys-core-bin=1.0.17-1' from MSVC developers command + prompt. + +* To run all the unit tests in Open vSwitch, one at a time: + + % make check + + To run all the unit tests in Open vSwitch, up to 8 in parallel: + + % make check TESTSUITEFLAGS="-j8" + +* To install all the compiled executables on the local machine, run: + + % make install + + The above command will install the Open vSwitch executables in + C:/openvswitch. You can add 'C:\openvswitch\usr\bin' and + 'C:\openvswitch\usr\sbin' to Windows' PATH environment variable + for easy access. + +OpenSSL, Open vSwitch and Visual C++ +------------------------------------ +To get SSL support for Open vSwitch on Windows, do the following: + +* Install OpenSSL for Windows as suggested at +http://www.openssl.org/related/binaries.html. +The link as of this writing suggests to download it from +http://slproweb.com/products/Win32OpenSSL.html + +Note down the directory where OpenSSL is installed (e.g.: C:/OpenSSL-Win32). + +* While configuring the package, specify the OpenSSL directory path. +For example, + + % ./configure CC=./build-aux/cccl LD="`which link`" \ + LIBS="-lws2_32 -liphlpapi" --prefix="C:/openvswitch/usr" \ + --localstatedir="C:/openvswitch/var" --sysconfdir="C:/openvswitch/etc" \ + --with-pthread="C:/pthread" --enable-ssl --with-openssl="C:/OpenSSL-Win32" + +* Run make for the ported executables. + +Building the Kernel datapath module +----------------------------------- +* We directly use the Visual Studio 2013 IDE to compile the kernel datapath. +You can open the extensions.sln file in the IDE and build the solution. + +* The kernel datapath can be compiled from command line as well. The top +level 'make' will invoke building the kernel datapath, if the +'--with-vstudiotarget' argument is specified while configuring the package. +For example, + + % ./configure CC=./build-aux/cccl LD="`which link`" \ + LIBS="-lws2_32 -liphlpapi" --prefix="C:/openvswitch/usr" \ + --localstatedir="C:/openvswitch/var" --sysconfdir="C:/openvswitch/etc" \ + --with-pthread="C:/pthread" --enable-ssl \ + --with-openssl="C:/OpenSSL-Win32" --with-vstudiotarget="" + + Possible values for "" are: + "Debug" and "Release" + +Installing the Kernel module +---------------------------- +Once you have built the solution, you can copy the following files to the +target Hyper-V machines. + + ./datapath-windows/x64/Win8.1Debug/package/ovsext.inf + ./datapath-windows/x64/Win8.1Debug/package/OVSExt.sys + ./datapath-windows/x64/Win8.1Debug/package/ovsext.cat + ./datapath-windows/misc/install.cmd + ./datapath-windows/misc/uninstall.cmd + +The above path assumes that the kernel module has been built using Windows +DDK 8.1 in Debug mode. Change the path appropriately, if a different WDK +has been used. + +Steps to install the module +--------------------------- + +01> Run ./uninstall.cmd to remove the old extension. + +02> Run ./install.cmd to insert the new one. For this to work you will have to +turn on TESTSIGNING boot option or 'Disable Driver Signature Enforcement' +during boot. The following commands can be used: + % bcdedit /set LOADOPTIONS DISABLE_INTEGRITY_CHECKS + % bcdedit /set TESTSIGNING ON + % bcdedit /set nointegritychecks ON + +Note: you may have to restart the machine for the settings to take effect. + +03> In the Virtual Switch Manager configuration you can enable the Open vSwitch +Extension on an existing switch or create a new switch. If you are using an +existing switch, make sure to enable the "Allow Management OS" option for VXLAN +to work (covered later). + +The command to create a new switch named 'OVS-Extended-Switch' using a physical +NIC named 'Ethernet 1' is: + % New-VMSwitch "OVS-Extended-Switch" -AllowManagementOS $true \ + -NetAdapterName "Ethernet 1" + +Note: you can obtain the list of physical NICs on the host using +'Get-NetAdapter' command. + +04> In the properties of any switch, you should should now see "Open +vSwitch Extension" under 'Extensions'. Click the check box to enable the +extension. An alternative way to do the same is to run the following command: + % Enable-VMSwitchExtension "Open vSwitch Extension" OVS-Extended-Switch + +Note: If you enabled the extension using the command line, a delay of a few +seconds has been observed for the change to be reflected in the UI. This is +not a bug in Open vSwitch. + +Steps to run the user processes & configure ports +------------------------------------------------- +The following steps assume that you have installed the Open vSwitch +utilities in the local machine via 'make install'. + +01> Create the database. + % ovsdb-tool create C:\openvswitch\etc\openvswitch\conf.db \ + C:\openvswitch\usr\share\openvswitch\vswitch.ovsschema + +02> Start the ovsdb-server and initialize the database. + % ovsdb-server -vfile:info --remote=punix:db.sock --log-file --pidfile \ + --detach + % ovs-vsctl --no-wait init + + If you would like to terminate the started ovsdb-server, run: + % ovs-appctl -t ovsdb-server exit + + (Note that the logfile is created at C:/openvswitch/var/log/openvswitch/) + +03> Start ovs-vswitchd. + % ovs-vswitchd -vfile:info --log-file --pidfile --detach + + If you would like to terminate the started ovs-vswitchd, run: + % ovs-appctl exit + + (Note that the logfile is created at C:/openvswitch/var/log/openvswitch/) + +04> Create integration bridge & pif bridge + % ovs-vsctl add-br br-int + % ovs-vsctl add-br br-pif + +NOTE: There's a known bug that running the ovs-vsctl command does not +terminate. This is generally solved by having ovs-vswitchd running. If +you face the issue despite that, hit Ctrl-C to terminate ovs-vsctl and +check the output to see if your command succeeded. + +NOTE: There's a known bug that the ports added to OVSDB via ovs-vsctl don't +get to the kernel datapath immediately, ie. they don't show up in the output of +"ovs-dpctl show" even though they show up in output of "ovs-vsctl show". +In order to workaround this issue, restart ovs-vswitchd. (You can terminate +ovs-vswitchd by running 'ovs-appctl exit'.) + +05> Dump the ports in the kernel datapath + % ovs-dpctl show + +* Sample output is as follows: + + % ovs-dpctl show + system@ovs-system: + lookups: hit:0 missed:0 lost:0 + flows: 0 + port 2: br-pif (internal) <<< internal port on 'br-pif' bridge + port 1: br-int (internal) <<< internal port on 'br-int' bridge + +06> Dump the ports in the OVSDB + % ovs-vsctl show + +* Sample output is as follows: + % ovs-vsctl show + a56ec7b5-5b1f-49ec-a795-79f6eb63228b + Bridge br-pif + Port br-pif + Interface br-pif + type: internal + Bridge br-int + Port br-int + Interface br-int + type: internal + +07> Add the physical NIC and the internal port to br-pif. + +In OVS for Hyper-V, we use 'external' as a special name to refer to the +physical NICs connected to the Hyper-V switch. An index is added to this +special name to refer to the particular physical NIC. Eg. 'external.1' refers +to the first physical NIC on the Hyper-V switch. + +Note: Currently, we assume that the Hyper-V switch on which OVS extension is +enabled has a single physical NIC connected to it. + +Interal port is the virtual adapter created on the Hyper-V switch using the +'AllowManagementOS' setting. This has already been setup while creating the +switch using the instructions above. In OVS for Hyper-V, we use a 'internal' +as a special name to refer to that adapter. + + % ovs-vsctl add-port br-pif external.1 + % ovs-vsctl add-port br-pif internal + +* Dumping the ports should show the additional ports that were just added. + Sample output shows up as follows: + + % ovs-dpctl show + system@ovs-system: + lookups: hit:0 missed:0 lost:0 + flows: 0 + port 4: internal (internal) <<< 'AllowManagementOS' adapter on + Hyper-V switch + port 2: br-pif (internal) + port 1: br-int (internal + port 3: external.1 <<< Physical NIC + + % ovs-vsctl show + a56ec7b5-5b1f-49ec-a795-79f6eb63228b + Bridge br-pif + Port internal + Interface internal + Port br-pif + Interface br-pif + type: internal + Port "external.1" + Interface "external.1" + Bridge br-int + Port br-int + Interface br-int + type: internal + +08> Add the VIFs to br-int + +Adding VIFs to openvswitch is a two step procedure. The first step is to +assign a 'OVS port name' which is a unique name across all VIFs on this +Hyper-V. The next step is to add the VIF to the ovsdb using its 'OVS port +name' as key. + +08a> Assign a unique 'OVS port name' to the VIF + +Note that the VIF needs to have been disconnected from the Hyper-V switch +before assigning a 'OVS port name' to it. In the example below, we assign a +'OVS port name' called 'ovs-port-a' to a VIF on a VM by name 'VM1'. By using +index 0 for '$vnic', the first VIF of the VM is being addressed. After +assigning the name 'ovs-port-a', the VIF is connected back to the Hyper-V +switch with name 'OVS-HV-Switch', which is assumed to be the Hyper-V switch +with OVS extension enabled. + + Eg: + % import-module .\datapath-windows\misc\OVS.psm1 + % $vnic = Get-VMNetworkAdapter + % Disconnect-VMNetworkAdapter -VMNetworkAdapter $vnic[0] + % $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-a + % Connect-VMNetworkAdapter -VMNetworkAdapter $vnic[0] \ + -SwitchName OVS-Extended-Switch + +08b> Add the VIFs to br-int in ovsdb + + Eg: + % ovs-vsctl add-port br-int ovs-port-a + +09> Verify the status + % ovs-dpctl show + system@ovs-system: + lookups: hit:0 missed:0 lost:0 + flows: 0 + port 4: internal (internal) + port 5: ovs-port-a + port 2: br-pif (internal) + port 1: br-int (internal + port 3: external.1 + + % ovs-vsctl show + 4cd86499-74df-48bd-a64d-8d115b12a9f2 + Bridge br-pif + Port internal + Interface internal + Port "external.1" + Interface "external.1" + Port br-pif + Interface br-pif + type: internal + Bridge br-int + Port br-int + Interface br-int + type: internal + Port "ovs-port-a" + Interface "ovs-port-a" + +Steps to configure patch ports and switch VLAN tagging +------------------------------------------------------ +The Windows Open vSwitch implementation support VLAN tagging in the switch. +Switch VLAN tagging along with patch ports between 'br-int' and 'br-pif' is +used to configure VLAN tagging functionality between two VMs on different +Hyper-Vs. The following examples demonstrate how it can be done: + +01> Add a patch port from br-int to br-pif + % ovs-vsctl add-port br-int patch-to-pif + % ovs-vsctl set interface patch-to-pif type=patch \ + options:peer=patch-to-int + +02> Add a patch port from br-pif to br-int + % ovs-vsctl add-port br-pif patch-to-int + % ovs-vsctl set interface patch-to-int type=patch \ + options:peer=patch-to-pif + +03> Re-Add the VIF ports with the VLAN tag + % ovs-vsctl add-port br-int ovs-port-a tag=900 + % ovs-vsctl add-port br-int ovs-port-b tag=900 + +Steps to add tunnels +-------------------------- +The Windows Open vSwitch implementation support VXLAN and STT tunnels. To add +tunnels, the following steps serve as examples. + +Note that, any patch ports created between br-int and br-pif MUST be beleted +prior to adding tunnels. + +01> Add the tunnel port between 172.168.201.101 <-> 172.168.201.102 + % ovs-vsctl add-port br-int tun-1 + % ovs-vsctl set Interface tun-1 type=port-type + % ovs-vsctl set Interface tun-1 options:local_ip=172.168.201.101 + % ovs-vsctl set Interface tun-1 options:remote_ip=172.168.201.102 + % ovs-vsctl set Interface tun-1 options:in_key=flow + % ovs-vsctl set Interface tun-1 options:out_key=flow + +02> Add the tunnel port between 172.168.201.101 <-> 172.168.201.105 + % ovs-vsctl add-port br-int tun-2 + % ovs-vsctl set Interface tun-2 type=port-type + % ovs-vsctl set Interface tun-2 options:local_ip=172.168.201.102 + % ovs-vsctl set Interface tun-2 options:remote_ip=172.168.201.105 + % ovs-vsctl set Interface tun-2 options:in_key=flow + % ovs-vsctl set Interface tun-2 options:out_key=flow + + Where port-type is the string stt or vxlan + + +Requirements +------------ +* We require that you don't disable the "Allow management operating system to +share this network adapter" under 'Virtual Switch Properties' > 'Connection +type: External network', in the HyperV virtual network switch configuration. + +* Checksum Offloads + While there is some support for checksum/segmentation offloads in software, +this is still a work in progress. Till the support is complete we recommend +disabling TX/RX offloads for both the VM's as well as the HyperV. + +Windows Services +---------------- +Open vSwitch daemons come with support to run as a Windows service. The +instructions here assume that you have installed the Open vSwitch utilities +and daemons via 'make install'. The commands shown here can be run from +MSYS bash or Windows command prompt. + +* Create the database. + + % ovsdb-tool create C:/openvswitch/etc/openvswitch/conf.db \ + "C:/openvswitch/usr/share/openvswitch/vswitch.ovsschema" + +* Create the ovsdb-server service and start it. + + % sc create ovsdb-server binpath="C:/openvswitch/usr/sbin/ovsdb-server.exe C:/openvswitch/etc/openvswitch/conf.db -vfile:info --log-file --pidfile --remote=punix:db.sock --service --service-monitor" + + One of the common issues with creating a Windows service is with mungled + paths. You can make sure that the correct path has been registered with + the Windows services manager by running: + + % sc qc ovsdb-server + + Start the service. + + % sc start ovsdb-server + + Check that the service is healthy by running: + + % sc query ovsdb-server + +* Initialize the database. + + % ovs-vsctl --no-wait init + +* Create the ovs-vswitchd service and start it. + + % sc create ovs-vswitchd binpath="C:/openvswitch/usr/sbin/ovs-vswitchd.exe --pidfile -vfile:info --log-file --service --service-monitor" + + % sc start ovs-vswitchd + + Check that the service is healthy by running: + + % sc query ovs-vswitchd + +* To stop and delete the services, run: + + % sc stop ovs-vswitchd + % sc stop ovsdb-server + % sc delete ovs-vswitchd + % sc delete ovsdb-server + +Windows autobuild service +------------------------- +AppVeyor (appveyor.com) provides a free Windows autobuild service for +opensource projects. Open vSwitch has integration with AppVeyor for +continuous build. A developer can build test his changes for Windows by +logging into appveyor.com using a github account, creating a new project +by linking it to his development repository in github and triggering +a new build. + +TODO +---- + +* Investigate the working of sFlow on Windows and re-enable the unit tests. + +* Investigate and add the feature to provide QOS. + +* Sign the driver & create an MSI for installing the different OpenvSwitch +components on windows. diff -Nru openvswitch-2.3.1/INSTALL.XenServer openvswitch-2.4.0~git20150623/INSTALL.XenServer --- openvswitch-2.3.1/INSTALL.XenServer 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.XenServer 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ - How to Install Open vSwitch on Citrix XenServer - =============================================== - -This document describes how to build and install Open vSwitch on a -Citrix XenServer host. If you want to install Open vSwitch on a -generic Linux or BSD host, see INSTALL instead. - -These instructions have been tested with XenServer 5.6 FP1. - -Building Open vSwitch for XenServer ------------------------------------ - -You may build from an Open vSwitch distribution tarball or from an -Open vSwitch Git tree. The recommended build environment to build -RPMs for Citrix XenServer is the DDK VM available from Citrix. - -1. If you are building from an Open vSwitch Git tree, then you will - need to first create a distribution tarball by running "./boot.sh; - ./configure; make dist" in the Git tree. You cannot run this in - the DDK VM, because it lacks tools that are necessary to bootstrap - the Open vSwitch distribution. Instead, you must run this on a - machine that has the tools listed in INSTALL as prerequisites for - building from a Git tree. - -2. Copy the distribution tarball into /usr/src/redhat/SOURCES inside - the DDK VM. - -3. In the DDK VM, unpack the distribution tarball into a temporary - directory and "cd" into the root of the distribution tarball. - -4. To build Open vSwitch userspace, run: - - rpmbuild -bb xenserver/openvswitch-xen.spec - - This produces three RPMs in /usr/src/redhat/RPMS/i386: - "openvswitch", "openvswitch-modules-xen", and - "openvswitch-debuginfo". - - The above command automatically runs the Open vSwitch unit tests. - To disable the unit tests, run: - - rpmbuild -bb --without check xenserver/openvswitch-xen.spec - -Build Parameters ----------------- - -openvswitch-xen.spec needs to know a number of pieces of information -about the XenServer kernel. Usually, it can figure these out for -itself, but if it does not do it correctly then you can specify them -yourself as parameters to the build. Thus, the final "rpmbuild" step -above can be elaborated as: - - VERSION= - KERNEL_NAME= - KERNEL_VERSION= - KERNEL_FLAVOR= - rpmbuild \ - -D "openvswitch_version $VERSION" \ - -D "kernel_name $KERNEL_NAME" \ - -D "kernel_version $KERNEL_VERSION" \ - -D "kernel_flavor $KERNEL_FLAVOR" \ - -bb xenserver/openvswitch-xen.spec - -where: - - is the version number that appears in the - name of the Open vSwitch tarball, e.g. 0.90.0. - - is the name of the XenServer kernel package, - e.g. kernel-xen or kernel-NAME-xen, without the "kernel-" prefix. - - is the output of: - rpm -q --queryformat "%{Version}-%{Release}" , - e.g. 2.6.32.12-0.7.1.xs5.6.100.323.170596, where is - the name of the -devel package corresponding to . - - is either "xen" or "kdump". - The "xen" flavor is the main running kernel flavor and the "kdump" flavor is - the crashdump kernel flavor. Commonly, one would specify "xen" here. - -Installing Open vSwitch for XenServer -------------------------------------- - -To install Open vSwitch on a XenServer host, or to upgrade to a newer version, -copy the "openvswitch" and "openvswitch-modules-xen" RPMs to that host with -"scp", then install them with "rpm -U", e.g.: - - scp openvswitch-$VERSION-1.i386.rpm \ - openvswitch-modules-xen-$XEN_KERNEL_VERSION-$VERSION-1.i386.rpm \ - root@: -(At this point you will have to enter 's root password.) - ssh root@ -(At this point you will have to enter 's root password again.) - rpm -U openvswitch-$VERSION-1.i386.rpm \ - openvswitch-modules-xen-$XEN_KERNEL_VERSION-$VERSION-1.i386.rpm - -To uninstall Open vSwitch from a XenServer host, remove the packages: - - ssh root@ -(At this point you will have to enter 's root password again.) - rpm -e openvswitch openvswitch-modules-xen-$XEN_KERNEL_VERSION - -After installing or uninstalling Open vSwitch, the XenServer should be -rebooted as soon as possible. - -Open vSwitch Boot Sequence on XenServer ---------------------------------------- - -When Open vSwitch is installed on XenServer, its startup script -/etc/init.d/openvswitch runs early in boot. It does roughly the -following: - - * Loads the OVS kernel module, openvswitch. - - * Starts ovsdb-server, the OVS configuration database. - - * XenServer expects there to be no bridges configured at - startup, but the OVS configuration database likely still has - bridges configured from before reboot. To match XenServer - expectations, the startup script deletes all configured - bridges from the database. - - * Starts ovs-vswitchd, the OVS switching daemon. - -At this point in the boot process, then, there are no Open vSwitch -bridges, even though all of the Open vSwitch daemons are running. -Later on in boot, /etc/init.d/management-interface (part of XenServer, -not Open vSwitch) creates the bridge for the XAPI management interface -by invoking /opt/xensource/libexec/interface-reconfigure. Normally -this program consults XAPI's database to obtain information about how -to configure the bridge, but XAPI is not running yet[*] so it instead -consults /var/xapi/network.dbcache, which is a cached copy of the most -recent network configuration. - -[*] Even if XAPI were running, if this XenServer node is a pool slave - then the query would have to consult the master, which requires - network access, which begs the question of how to configure the - management interface. - -XAPI starts later on in the boot process. XAPI can then create other -bridges on demand using /opt/xensource/libexec/interface-reconfigure. -Now that XAPI is running, that program consults XAPI directly instead -of reading the cache. - -As part of its own startup, XAPI invokes the Open vSwitch XAPI plugin -script /etc/xapi.d/openvswitch-cfg-update passing the "update" -command. The plugin script does roughly the following: - - * Calls /opt/xensource/libexec/interface-reconfigure with the - "rewrite" command, to ensure that the network cache is - up-to-date. - - * Queries the Open vSwitch manager setting (named - "vswitch_controller") from the XAPI database for the - XenServer pool. - - * If XAPI and OVS are configured for different managers, or if - OVS is configured for a manager but XAPI is not, runs - "ovs-vsctl emer-reset" to bring the Open vSwitch - configuration to a known state. One effect of emer-reset is - to deconfigure any manager from the OVS database. - - * If XAPI is configured for a manager, configures the OVS - manager to match with "ovs-vsctl set-manager". - -Notes ------ - -* The Open vSwitch boot sequence only configures an OVS configuration -database manager. There is no way to directly configure an OpenFlow -controller on XenServer and, as a consequence of the step above that -deletes all of the bridges at boot time, controller configuration only -persists until XenServer reboot. The configuration database manager -can, however, configure controllers for bridges. See the BUGS section -of test-controller(8) for more information on this topic. - -* The Open vSwitch startup script automatically adds a firewall rule -to allow GRE traffic. This rule is needed for the XenServer feature -called "Cross-Host Internal Networks" (CHIN) that uses GRE. If a user -configures tunnels other than GRE (ex: VXLAN, LISP), they will have -to either manually add a iptables firewall rule to allow the tunnel traffic -or add it through a startup script (Please refer to the "enable-protocol" -command in the ovs-ctl(8) manpage). - -Reporting Bugs --------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/INSTALL.XenServer.md openvswitch-2.4.0~git20150623/INSTALL.XenServer.md --- openvswitch-2.3.1/INSTALL.XenServer.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/INSTALL.XenServer.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,206 @@ +How to Install Open vSwitch on Citrix XenServer +=============================================== + +This document describes how to build and install Open vSwitch on a +Citrix XenServer host. If you want to install Open vSwitch on a +generic Linux or BSD host, see [INSTALL.md] instead. + +These instructions have been tested with XenServer 5.6 FP1. + +Building Open vSwitch for XenServer +----------------------------------- + +You may build from an Open vSwitch distribution tarball or from an +Open vSwitch Git tree. The recommended build environment to build +RPMs for Citrix XenServer is the DDK VM available from Citrix. + +1. If you are building from an Open vSwitch Git tree, then you will + need to first create a distribution tarball by running `./boot.sh; + ./configure; make dist` in the Git tree. You cannot run this in + the DDK VM, because it lacks tools that are necessary to bootstrap + the Open vSwitch distribution. Instead, you must run this on a + machine that has the tools listed in [INSTALL.md] as prerequisites + for building from a Git tree. + +2. Copy the distribution tarball into /usr/src/redhat/SOURCES inside + the DDK VM. + +3. In the DDK VM, unpack the distribution tarball into a temporary + directory and "cd" into the root of the distribution tarball. + +4. To build Open vSwitch userspace, run: + + `rpmbuild -bb xenserver/openvswitch-xen.spec` + + This produces three RPMs in /usr/src/redhat/RPMS/i386: + "openvswitch", "openvswitch-modules-xen", and + "openvswitch-debuginfo". + + The above command automatically runs the Open vSwitch unit tests. + To disable the unit tests, run: + + `rpmbuild -bb --without check xenserver/openvswitch-xen.spec` + +Build Parameters +---------------- + +openvswitch-xen.spec needs to know a number of pieces of information +about the XenServer kernel. Usually, it can figure these out for +itself, but if it does not do it correctly then you can specify them +yourself as parameters to the build. Thus, the final "rpmbuild" step +above can be elaborated as: + + ``` + VERSION= + KERNEL_NAME= + KERNEL_VERSION= + KERNEL_FLAVOR= + rpmbuild \ + -D "openvswitch_version $VERSION" \ + -D "kernel_name $KERNEL_NAME" \ + -D "kernel_version $KERNEL_VERSION" \ + -D "kernel_flavor $KERNEL_FLAVOR" \ + -bb xenserver/openvswitch-xen.spec + ``` + +where: + + `` is the version number that appears in the + name of the Open vSwitch tarball, e.g. 0.90.0. + + `` is the name of the XenServer kernel package, + e.g. kernel-xen or kernel-NAME-xen, without the "kernel-" prefix. + + `` is the output of: + rpm -q --queryformat "%{Version}-%{Release}" , + e.g. 2.6.32.12-0.7.1.xs5.6.100.323.170596, where is + the name of the -devel package corresponding to . + + `` is either "xen" or "kdump". + The "xen" flavor is the main running kernel flavor and the "kdump" flavor is + the crashdump kernel flavor. Commonly, one would specify "xen" here. + +For XenServer 6.5 or above, the kernel version naming no longer contains +KERNEL_FLAVOR. In fact, only providing the `uname -r` output is enough. +So, the final "rpmbuild" step changes to: + + ``` + KERNEL_UNAME=<`uname -r` output> + rpmbuild \ + -D "kenel_uname $KERNEL_UNAME" \ + -bb xenserver/openvswitch-xen.spec + ``` + + +Installing Open vSwitch for XenServer +------------------------------------- + +To install Open vSwitch on a XenServer host, or to upgrade to a newer version, +copy the "openvswitch" and "openvswitch-modules-xen" RPMs to that host with +"scp", then install them with "rpm -U", e.g.: + + ``` + scp openvswitch-$VERSION-1.i386.rpm \ + openvswitch-modules-xen-$XEN_KERNEL_VERSION-$VERSION-1.i386.rpm \ + root@: +(At this point you will have to enter 's root password.) + ssh root@ +(At this point you will have to enter 's root password again.) + rpm -U openvswitch-$VERSION-1.i386.rpm \ + openvswitch-modules-xen-$XEN_KERNEL_VERSION-$VERSION-1.i386.rpm + ``` + +To uninstall Open vSwitch from a XenServer host, remove the packages: + + `ssh root@` +(At this point you will have to enter 's root password again.) + `rpm -e openvswitch openvswitch-modules-xen-$XEN_KERNEL_VERSION` + +After installing or uninstalling Open vSwitch, the XenServer should be +rebooted as soon as possible. + +Open vSwitch Boot Sequence on XenServer +--------------------------------------- + +When Open vSwitch is installed on XenServer, its startup script +/etc/init.d/openvswitch runs early in boot. It does roughly the +following: + + * Loads the OVS kernel module, openvswitch. + + * Starts ovsdb-server, the OVS configuration database. + + * XenServer expects there to be no bridges configured at + startup, but the OVS configuration database likely still has + bridges configured from before reboot. To match XenServer + expectations, the startup script deletes all configured + bridges from the database. + + * Starts ovs-vswitchd, the OVS switching daemon. + +At this point in the boot process, then, there are no Open vSwitch +bridges, even though all of the Open vSwitch daemons are running. +Later on in boot, /etc/init.d/management-interface (part of XenServer, +not Open vSwitch) creates the bridge for the XAPI management interface +by invoking /opt/xensource/libexec/interface-reconfigure. Normally +this program consults XAPI's database to obtain information about how +to configure the bridge, but XAPI is not running yet[*] so it instead +consults /var/xapi/network.dbcache, which is a cached copy of the most +recent network configuration. + +[*] Even if XAPI were running, if this XenServer node is a pool slave + then the query would have to consult the master, which requires + network access, which begs the question of how to configure the + management interface. + +XAPI starts later on in the boot process. XAPI can then create other +bridges on demand using /opt/xensource/libexec/interface-reconfigure. +Now that XAPI is running, that program consults XAPI directly instead +of reading the cache. + +As part of its own startup, XAPI invokes the Open vSwitch XAPI plugin +script /etc/xapi.d/openvswitch-cfg-update passing the "update" +command. The plugin script does roughly the following: + + * Calls /opt/xensource/libexec/interface-reconfigure with the + "rewrite" command, to ensure that the network cache is + up-to-date. + + * Queries the Open vSwitch manager setting (named + "vswitch_controller") from the XAPI database for the + XenServer pool. + + * If XAPI and OVS are configured for different managers, or if + OVS is configured for a manager but XAPI is not, runs + "ovs-vsctl emer-reset" to bring the Open vSwitch + configuration to a known state. One effect of emer-reset is + to deconfigure any manager from the OVS database. + + * If XAPI is configured for a manager, configures the OVS + manager to match with "ovs-vsctl set-manager". + +Notes +----- + +* The Open vSwitch boot sequence only configures an OVS configuration +database manager. There is no way to directly configure an OpenFlow +controller on XenServer and, as a consequence of the step above that +deletes all of the bridges at boot time, controller configuration only +persists until XenServer reboot. The configuration database manager +can, however, configure controllers for bridges. See the BUGS section +of ovs-testcontroller(8) for more information on this topic. + +* The Open vSwitch startup script automatically adds a firewall rule +to allow GRE traffic. This rule is needed for the XenServer feature +called "Cross-Host Internal Networks" (CHIN) that uses GRE. If a user +configures tunnels other than GRE (ex: Geneve, VXLAN, LISP), they will have +to either manually add a iptables firewall rule to allow the tunnel traffic +or add it through a startup script (Please refer to the "enable-protocol" +command in the ovs-ctl(8) manpage). + +Reporting Bugs +-------------- + +Please report problems to bugs@openvswitch.org. + +[INSTALL.md]:INSTALL.md diff -Nru openvswitch-2.3.1/IntegrationGuide openvswitch-2.4.0~git20150623/IntegrationGuide --- openvswitch-2.3.1/IntegrationGuide 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/IntegrationGuide 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ - Integration Guide for Centralized Control - ========================================= - -This document describes how to integrate Open vSwitch onto a new -platform to expose the state of the switch and attached devices for -centralized control. (If you are looking to port the switching -components of Open vSwitch to a new platform, please see the PORTING -document.) The focus of this guide is on hypervisors, but many of the -interfaces are useful for hardware switches, as well. The XenServer -integration is the most mature implementation, so most of the examples -are drawn from it. - -The externally visible interface to this integration is -platform-agnostic. We encourage anyone who integrates Open vSwitch to -use the same interface, because keeping a uniform interface means that -controllers require less customization for individual platforms (and -perhaps no customization at all). - -Integration centers around the Open vSwitch database and mostly involves -the 'external_ids' columns in several of the tables. These columns are -not interpreted by Open vSwitch itself. Instead, they provide -information to a controller that permits it to associate a database -record with a more meaningful entity. In contrast, the 'other_config' -column is used to configure behavior of the switch. The main job of the -integrator, then, is to ensure that these values are correctly populated -and maintained. - -An integrator sets the columns in the database by talking to the -ovsdb-server daemon. A few of the columns can be set during startup by -calling the ovs-ctl tool from inside the startup scripts. The -'xenserver/etc_init.d_openvswitch' script provides examples of its use, -and the ovs-ctl(8) manpage contains complete documentation. At runtime, -ovs-vsctl can be be used to set columns in the database. The script -'xenserver/etc_xensource_scripts_vif' contains examples of its use, and -ovs-vsctl(8) manpage contains complete documentation. - -Python and C bindings to the database are provided if deeper integration -with a program are needed. The XenServer ovs-xapi-sync daemon -('xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync') provides an -example of using the Python bindings. More information on the python -bindings is available at 'python/ovs/db/idl.py'. Information on the C -bindings is available at 'lib/ovsdb-idl.h'. - -The following diagram shows how integration scripts fit into the Open vSwitch -architecture: - - +----------------------------------------+ - | Controller Cluster + - +----------------------------------------+ - | - | - +----------------------------------------------------------+ - | | | - | +--------------+---------------+ | - | | | | - | +-------------------+ +------------------+ | - | | ovsdb-server |-----------| ovs-vswitchd | | - | +-------------------+ +------------------+ | - | | | | - | +---------------------+ | | - | | Integration scripts | | | - | | (ex: ovs-xapi-sync) | | | - | +---------------------+ | | - | | Userspace | - |----------------------------------------------------------| - | | Kernel | - | | | - | +---------------------+ | - | | OVS Kernel Module | | - | +---------------------+ | - +----------------------------------------------------------+ - - -A description of the most relevant fields for integration follows. By -setting these values, controllers are able to understand the network and -manage it more dynamically and precisely. For more details about the -database and each individual column, please refer to the -ovs-vswitchd.conf.db(5) manpage. - - -Open_vSwitch table ------------------- -The Open_vSwitch table describes the switch as a whole. The -'system_type' and 'system_version' columns identify the platform to the -controller. The 'external_ids:system-id' key uniquely identifies the -physical host. In XenServer, the system-id will likely be the same as -the UUID returned by 'xe host-list'. This key allows controllers to -distinguish between multiple hypervisors. - -Most of this configuration can be done with the ovs-ctl command at -startup. For example: - - ovs-ctl --system-type="XenServer" --system-version="6.0.0-50762p" \ - --system-id="${UUID}" "${other_options}" start - -Alternatively, the ovs-vsctl command may be used to set a particular -value at runtime. For example: - - ovs-vsctl set open_vswitch . external-ids:system-id='"${UUID}"' - -The 'other_config:enable-statistics' key may be set to "true" to have OVS -populate the database with statistics (e.g., number of CPUs, memory, -system load) for the controller's use. - - -Bridge table ------------- -The Bridge table describes individual bridges within an Open vSwitch -instance. The 'external-ids:bridge-id' key uniquely identifies a -particular bridge. In XenServer, this will likely be the same as the -UUID returned by 'xe network-list' for that particular bridge. - -For example, to set the identifier for bridge "br0", the following -command can be used: - - ovs-vsctl set Bridge br0 external-ids:bridge-id='"${UUID}"' - -The MAC address of the bridge may be manually configured by setting it -with the "other_config:hwaddr" key. For example: - - ovs-vsctl set Bridge br0 other_config:hwaddr="12:34:56:78:90:ab" - - -Interface table ---------------- -The Interface table describes an interface under the control of Open -vSwitch. The 'external_ids' column contains keys that are used to -provide additional information about the interface: - - attached-mac - - This field contains the MAC address of the device attached to - the interface. On a hypervisor, this is the MAC address of the - interface as seen inside a VM. It does not necessarily - correlate to the host-side MAC address. For example, on - XenServer, the MAC address on a VIF in the hypervisor is always - FE:FF:FF:FF:FF:FF, but inside the VM a normal MAC address is - seen. - - iface-id - - This field uniquely identifies the interface. In hypervisors, - this allows the controller to follow VM network interfaces as - VMs migrate. A well-chosen identifier should also allow an - administrator or a controller to associate the interface with - the corresponding object in the VM management system. For - example, the Open vSwitch integration with XenServer by default - uses the XenServer assigned UUID for a VIF record as the - iface-id. - - iface-status - - In a hypervisor, there are situations where there are multiple - interface choices for a single virtual ethernet interface inside - a VM. Valid values are "active" and "inactive". A complete - description is available in the ovs-vswitchd.conf.db(5) manpage. - - vm-id - - This field uniquely identifies the VM to which this interface - belongs. A single VM may have multiple interfaces attached to - it. - -As in the previous tables, the ovs-vsctl command may be used to -configure the values. For example, to set the 'iface-id' on eth0, the -following command can be used: - - ovs-vsctl set Interface eth0 external-ids:iface-id='"${UUID}"' - diff -Nru openvswitch-2.3.1/IntegrationGuide.md openvswitch-2.4.0~git20150623/IntegrationGuide.md --- openvswitch-2.3.1/IntegrationGuide.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/IntegrationGuide.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,169 @@ +Integration Guide for Centralized Control +========================================= + +This document describes how to integrate Open vSwitch onto a new +platform to expose the state of the switch and attached devices for +centralized control. (If you are looking to port the switching +components of Open vSwitch to a new platform, please see the PORTING +document.) The focus of this guide is on hypervisors, but many of the +interfaces are useful for hardware switches, as well. The XenServer +integration is the most mature implementation, so most of the examples +are drawn from it. + +The externally visible interface to this integration is +platform-agnostic. We encourage anyone who integrates Open vSwitch to +use the same interface, because keeping a uniform interface means that +controllers require less customization for individual platforms (and +perhaps no customization at all). + +Integration centers around the Open vSwitch database and mostly involves +the 'external_ids' columns in several of the tables. These columns are +not interpreted by Open vSwitch itself. Instead, they provide +information to a controller that permits it to associate a database +record with a more meaningful entity. In contrast, the 'other_config' +column is used to configure behavior of the switch. The main job of the +integrator, then, is to ensure that these values are correctly populated +and maintained. + +An integrator sets the columns in the database by talking to the +ovsdb-server daemon. A few of the columns can be set during startup by +calling the ovs-ctl tool from inside the startup scripts. The +'xenserver/etc_init.d_openvswitch' script provides examples of its use, +and the ovs-ctl(8) manpage contains complete documentation. At runtime, +ovs-vsctl can be be used to set columns in the database. The script +'xenserver/etc_xensource_scripts_vif' contains examples of its use, and +ovs-vsctl(8) manpage contains complete documentation. + +Python and C bindings to the database are provided if deeper integration +with a program are needed. The XenServer ovs-xapi-sync daemon +('xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync') provides an +example of using the Python bindings. More information on the python +bindings is available at 'python/ovs/db/idl.py'. Information on the C +bindings is available at 'lib/ovsdb-idl.h'. + +The following diagram shows how integration scripts fit into the Open vSwitch +architecture: + + +----------------------------------------+ + | Controller Cluster + + +----------------------------------------+ + | + | + +----------------------------------------------------------+ + | | | + | +--------------+---------------+ | + | | | | + | +-------------------+ +------------------+ | + | | ovsdb-server |-----------| ovs-vswitchd | | + | +-------------------+ +------------------+ | + | | | | + | +---------------------+ | | + | | Integration scripts | | | + | | (ex: ovs-xapi-sync) | | | + | +---------------------+ | | + | | Userspace | + |----------------------------------------------------------| + | | Kernel | + | | | + | +---------------------+ | + | | OVS Kernel Module | | + | +---------------------+ | + +----------------------------------------------------------+ + + +A description of the most relevant fields for integration follows. By +setting these values, controllers are able to understand the network and +manage it more dynamically and precisely. For more details about the +database and each individual column, please refer to the +ovs-vswitchd.conf.db(5) manpage. + + +Open_vSwitch table +------------------ +The Open_vSwitch table describes the switch as a whole. The +'system_type' and 'system_version' columns identify the platform to the +controller. The 'external_ids:system-id' key uniquely identifies the +physical host. In XenServer, the system-id will likely be the same as +the UUID returned by 'xe host-list'. This key allows controllers to +distinguish between multiple hypervisors. + +Most of this configuration can be done with the ovs-ctl command at +startup. For example: + + ovs-ctl --system-type="XenServer" --system-version="6.0.0-50762p" \ + --system-id="${UUID}" "${other_options}" start + +Alternatively, the ovs-vsctl command may be used to set a particular +value at runtime. For example: + + ovs-vsctl set open_vswitch . external-ids:system-id='"${UUID}"' + +The 'other_config:enable-statistics' key may be set to "true" to have OVS +populate the database with statistics (e.g., number of CPUs, memory, +system load) for the controller's use. + + +Bridge table +------------ +The Bridge table describes individual bridges within an Open vSwitch +instance. The 'external-ids:bridge-id' key uniquely identifies a +particular bridge. In XenServer, this will likely be the same as the +UUID returned by 'xe network-list' for that particular bridge. + +For example, to set the identifier for bridge "br0", the following +command can be used: + + ovs-vsctl set Bridge br0 external-ids:bridge-id='"${UUID}"' + +The MAC address of the bridge may be manually configured by setting it +with the "other_config:hwaddr" key. For example: + + ovs-vsctl set Bridge br0 other_config:hwaddr="12:34:56:78:90:ab" + + +Interface table +--------------- +The Interface table describes an interface under the control of Open +vSwitch. The 'external_ids' column contains keys that are used to +provide additional information about the interface: + + attached-mac + + This field contains the MAC address of the device attached to + the interface. On a hypervisor, this is the MAC address of the + interface as seen inside a VM. It does not necessarily + correlate to the host-side MAC address. For example, on + XenServer, the MAC address on a VIF in the hypervisor is always + FE:FF:FF:FF:FF:FF, but inside the VM a normal MAC address is + seen. + + iface-id + + This field uniquely identifies the interface. In hypervisors, + this allows the controller to follow VM network interfaces as + VMs migrate. A well-chosen identifier should also allow an + administrator or a controller to associate the interface with + the corresponding object in the VM management system. For + example, the Open vSwitch integration with XenServer by default + uses the XenServer assigned UUID for a VIF record as the + iface-id. + + iface-status + + In a hypervisor, there are situations where there are multiple + interface choices for a single virtual ethernet interface inside + a VM. Valid values are "active" and "inactive". A complete + description is available in the ovs-vswitchd.conf.db(5) manpage. + + vm-id + + This field uniquely identifies the VM to which this interface + belongs. A single VM may have multiple interfaces attached to + it. + +As in the previous tables, the ovs-vsctl command may be used to +configure the values. For example, to set the 'iface-id' on eth0, the +following command can be used: + + ovs-vsctl set Interface eth0 external-ids:iface-id='"${UUID}"' + diff -Nru openvswitch-2.3.1/lib/automake.mk openvswitch-2.4.0~git20150623/lib/automake.mk --- openvswitch-2.3.1/lib/automake.mk 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -13,7 +13,10 @@ lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS} endif -lib_libopenvswitch_la_LDFLAGS = -release $(VERSION) +lib_libopenvswitch_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/lib/libopenvswitch.sym \ + $(AM_LDFLAGS) lib_libopenvswitch_la_SOURCES = \ lib/aes128.c \ @@ -23,7 +26,6 @@ lib/backtrace.h \ lib/bfd.c \ lib/bfd.h \ - lib/bitmap.c \ lib/bitmap.h \ lib/bundle.c \ lib/bundle.h \ @@ -34,6 +36,9 @@ lib/cfm.h \ lib/classifier.c \ lib/classifier.h \ + lib/classifier-private.h \ + lib/cmap.c \ + lib/cmap.h \ lib/command-line.c \ lib/command-line.h \ lib/compiler.h \ @@ -53,6 +58,10 @@ lib/dummy.h \ lib/dhparams.h \ lib/dirs.h \ + lib/dpctl.c \ + lib/dpctl.h \ + lib/dp-packet.h \ + lib/dp-packet.c \ lib/dpif-netdev.c \ lib/dpif-netdev.h \ lib/dpif-provider.h \ @@ -80,6 +89,8 @@ lib/hmap.h \ lib/hmapx.c \ lib/hmapx.h \ + lib/id-pool.c \ + lib/id-pool.h \ lib/jhash.c \ lib/jhash.h \ lib/json.c \ @@ -93,7 +104,6 @@ lib/learn.h \ lib/learning-switch.c \ lib/learning-switch.h \ - lib/list.c \ lib/list.h \ lib/lockfile.c \ lib/lockfile.h \ @@ -101,6 +111,8 @@ lib/mac-learning.h \ lib/match.c \ lib/match.h \ + lib/mcast-snooping.c \ + lib/mcast-snooping.h \ lib/memory.c \ lib/memory.h \ lib/meta-flow.c \ @@ -133,7 +145,6 @@ lib/ofp-print.c \ lib/ofp-print.h \ lib/ofp-util.c \ - lib/ofp-util.def \ lib/ofp-util.h \ lib/ofp-version-opt.h \ lib/ofp-version-opt.c \ @@ -144,12 +155,19 @@ lib/ovs-atomic-flag-gcc4.7+.h \ lib/ovs-atomic-gcc4+.h \ lib/ovs-atomic-gcc4.7+.h \ + lib/ovs-atomic-i586.h \ lib/ovs-atomic-locked.c \ lib/ovs-atomic-locked.h \ + lib/ovs-atomic-msvc.h \ lib/ovs-atomic-pthreads.h \ + lib/ovs-atomic-x86_64.h \ lib/ovs-atomic.h \ + lib/ovs-lldp.c \ + lib/ovs-lldp.h \ lib/ovs-rcu.c \ lib/ovs-rcu.h \ + lib/ovs-router.h \ + lib/ovs-router.c \ lib/ovs-thread.c \ lib/ovs-thread.h \ lib/ovsdb-data.c \ @@ -167,16 +185,26 @@ lib/packets.h \ lib/pcap-file.c \ lib/pcap-file.h \ + lib/perf-counter.h \ + lib/perf-counter.c \ lib/poll-loop.c \ lib/poll-loop.h \ lib/process.c \ lib/process.h \ + lib/pvector.c \ + lib/pvector.h \ lib/random.c \ lib/random.h \ lib/rconn.c \ lib/rconn.h \ + lib/rculist.h \ lib/reconnect.c \ lib/reconnect.h \ + lib/rstp.c \ + lib/rstp.h \ + lib/rstp-common.h \ + lib/rstp-state-machines.c \ + lib/rstp-state-machines.h \ lib/sat-math.h \ lib/seq.c \ lib/seq.h \ @@ -196,6 +224,7 @@ lib/sset.h \ lib/stp.c \ lib/stp.h \ + lib/stream-fd.c \ lib/stream-fd.h \ lib/stream-provider.h \ lib/stream-ssl.h \ @@ -214,8 +243,11 @@ lib/timer.h \ lib/timeval.c \ lib/timeval.h \ + lib/tnl-arp-cache.c \ + lib/tnl-arp-cache.h \ + lib/tnl-ports.c \ + lib/tnl-ports.h \ lib/token-bucket.c \ - lib/token-bucket.h \ lib/type-props.h \ lib/unaligned.h \ lib/unicode.c \ @@ -230,17 +262,21 @@ lib/vconn-provider.h \ lib/vconn-stream.c \ lib/vconn.c \ - lib/vconn.h \ lib/vlan-bitmap.c \ lib/vlan-bitmap.h \ lib/vlandev.c \ lib/vlandev.h \ lib/vlog.c \ - lib/vlog.h \ lib/vswitch-idl.c \ lib/vswitch-idl.h \ - lib/vtep-idl.c \ - lib/vtep-idl.h + lib/lldp/aa-structs.h \ + lib/lldp/lldp.c \ + lib/lldp/lldp-const.h \ + lib/lldp/lldp-tlv.h \ + lib/lldp/lldpd.c \ + lib/lldp/lldpd.h \ + lib/lldp/lldpd-structs.c \ + lib/lldp/lldpd-structs.h if WIN32 lib_libopenvswitch_la_SOURCES += \ @@ -249,15 +285,14 @@ lib/getrusage-windows.c \ lib/latch-windows.c \ lib/route-table-stub.c \ - lib/strsep.c \ - lib/stream-fd-windows.c + lib/strsep.c else lib_libopenvswitch_la_SOURCES += \ lib/daemon-unix.c \ lib/latch-unix.c \ lib/signals.c \ lib/signals.h \ - lib/stream-fd-unix.c \ + lib/socket-util-unix.c \ lib/stream-unix.c endif @@ -270,7 +305,10 @@ CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES) lib_LTLIBRARIES += lib/libsflow.la -lib_libsflow_la_LDFLAGS = -release $(VERSION) +lib_libsflow_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/lib/libsflow.sym \ + $(AM_LDFLAGS) lib_libsflow_la_SOURCES = \ lib/sflow_api.h \ lib/sflow.h \ @@ -289,8 +327,8 @@ if LINUX lib_libopenvswitch_la_SOURCES += \ - lib/dpif-linux.c \ - lib/dpif-linux.h \ + lib/dpif-netlink.c \ + lib/dpif-netlink.h \ lib/netdev-linux.c \ lib/netdev-linux.h \ lib/netlink-notifier.c \ @@ -298,6 +336,8 @@ lib/netlink-protocol.h \ lib/netlink-socket.c \ lib/netlink-socket.h \ + lib/ovs-numa.c \ + lib/ovs-numa.h \ lib/rtnetlink-link.c \ lib/rtnetlink-link.h \ lib/route-table.c \ @@ -310,6 +350,18 @@ lib/netdev-dpdk.h endif +if WIN32 +lib_libopenvswitch_la_SOURCES += \ + lib/dpif-netlink.c \ + lib/dpif-netlink.h \ + lib/netdev-windows.c \ + lib/netlink-notifier.c \ + lib/netlink-notifier.h \ + lib/netlink-protocol.h \ + lib/netlink-socket.c \ + lib/netlink-socket.h +endif + if HAVE_POSIX_AIO lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c else @@ -333,16 +385,20 @@ lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem - (echo '#include "lib/dhparams.h"' && \ + $(AM_V_GEN)(echo '#include "lib/dhparams.h"' && \ openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \ openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \ openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \ - | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp + | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp && \ mv lib/dhparams.c.tmp lib/dhparams.c else lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c endif +pkgconfig_DATA += \ + $(srcdir)/lib/libopenvswitch.pc \ + $(srcdir)/lib/libsflow.pc + EXTRA_DIST += \ lib/dh1024.pem \ lib/dh2048.pem \ @@ -355,6 +411,7 @@ lib/coverage-unixctl.man \ lib/daemon.man \ lib/daemon-syn.man \ + lib/dpctl.man \ lib/memory-unixctl.man \ lib/ofp-version.man \ lib/ovs.tmac \ @@ -378,29 +435,18 @@ OVSIDL_BUILT += \ $(srcdir)/lib/vswitch-idl.c \ $(srcdir)/lib/vswitch-idl.h \ - $(srcdir)/lib/vswitch-idl.ovsidl \ - $(srcdir)/lib/vtep-idl.c \ - $(srcdir)/lib/vtep-idl.h \ - $(srcdir)/lib/vtep-idl.ovsidl + $(srcdir)/lib/vswitch-idl.ovsidl EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann VSWITCH_IDL_FILES = \ $(srcdir)/vswitchd/vswitch.ovsschema \ $(srcdir)/lib/vswitch-idl.ann $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES) - $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp - mv $@.tmp $@ - -EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann -VTEP_IDL_FILES = \ - $(srcdir)/vtep/vtep.ovsschema \ - $(srcdir)/lib/vtep-idl.ann -$(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES) - $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp + $(AM_V_GEN)$(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp && \ mv $@.tmp $@ lib/dirs.c: lib/dirs.c.in Makefile - ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \ + $(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \ -e 's,[@]srcdir[@],$(srcdir),g' \ -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \ -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \ @@ -408,22 +454,39 @@ -e 's,[@]bindir[@],"$(bindir)",g' \ -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \ -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \ - > lib/dirs.c.tmp + > lib/dirs.c.tmp && \ mv lib/dirs.c.tmp lib/dirs.c +lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h + $(AM_V_GEN)$(run_python) $^ --meta-flow > $@.tmp && mv $@.tmp $@ +lib/meta-flow.lo: lib/meta-flow.inc +lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h + $(AM_V_GEN)$(run_python) $^ --nx-match > $@.tmp && mv $@.tmp $@ +lib/nx-match.lo: lib/nx-match.inc +CLEANFILES += lib/meta-flow.inc lib/nx-match.inc +EXTRA_DIST += build-aux/extract-ofp-fields + +lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c + $(AM_V_GEN)$(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@ +lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c + $(AM_V_GEN)$(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@ +lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2 +CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2 +EXTRA_DIST += build-aux/extract-ofp-actions + $(srcdir)/lib/ofp-errors.inc: \ lib/ofp-errors.h include/openflow/openflow-common.h \ $(srcdir)/build-aux/extract-ofp-errors - $(run_python) $(srcdir)/build-aux/extract-ofp-errors \ + $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-errors \ $(srcdir)/lib/ofp-errors.h \ - $(srcdir)/include/openflow/openflow-common.h > $@.tmp + $(srcdir)/include/openflow/openflow-common.h > $@.tmp && \ mv $@.tmp $@ $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc $(srcdir)/lib/ofp-msgs.inc: \ lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs - $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \ + $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \ $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@ $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc diff -Nru openvswitch-2.3.1/lib/backtrace.c openvswitch-2.4.0~git20150623/lib/backtrace.c --- openvswitch-2.3.1/lib/backtrace.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/backtrace.c 2015-06-23 18:46:21.000000000 +0000 @@ -18,7 +18,7 @@ #include #include "backtrace.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(backtrace); diff -Nru openvswitch-2.3.1/lib/backtrace.h openvswitch-2.4.0~git20150623/lib/backtrace.h --- openvswitch-2.3.1/lib/backtrace.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/backtrace.h 2015-06-23 18:46:21.000000000 +0000 @@ -58,8 +58,8 @@ * ??:0 */ -#define log_backtrace() log_backtrace_at(NULL, SOURCE_LOCATOR); -#define log_backtrace_msg(msg) log_backtrace_at(msg, SOURCE_LOCATOR); +#define log_backtrace() log_backtrace_at(NULL, OVS_SOURCE_LOCATOR); +#define log_backtrace_msg(msg) log_backtrace_at(msg, OVS_SOURCE_LOCATOR); #define BACKTRACE_MAX_FRAMES 31 diff -Nru openvswitch-2.3.1/lib/bfd.c openvswitch-2.4.0~git20150623/lib/bfd.c --- openvswitch-2.3.1/lib/bfd.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/bfd.c 2015-06-23 18:46:21.000000000 +0000 @@ -24,6 +24,7 @@ #include "byte-order.h" #include "connectivity.h" #include "csum.h" +#include "dp-packet.h" #include "dpif.h" #include "dynamic-string.h" #include "flow.h" @@ -44,7 +45,7 @@ #include "unaligned.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(bfd); @@ -338,7 +339,7 @@ struct netdev *netdev) OVS_EXCLUDED(mutex) { static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; - static atomic_uint16_t udp_src = ATOMIC_VAR_INIT(0); + static atomic_count udp_src = ATOMIC_COUNT_INIT(0); int decay_min_rx; long long int min_tx, min_rx; @@ -385,16 +386,15 @@ * UDP source port number MUST be used for all BFD Control packets * associated with a particular session. The source port number SHOULD * be unique among all BFD sessions on the system. */ - atomic_add(&udp_src, 1, &bfd->udp_src); - bfd->udp_src = (bfd->udp_src % 16384) + 49152; + bfd->udp_src = (atomic_count_inc(&udp_src) % 16384) + 49152; bfd_set_state(bfd, STATE_DOWN, DIAG_NONE); bfd_status_changed(bfd); } - atomic_store(&bfd->check_tnl_key, - smap_get_bool(cfg, "check_tnl_key", false)); + atomic_store_relaxed(&bfd->check_tnl_key, + smap_get_bool(cfg, "check_tnl_key", false)); min_tx = smap_get_int(cfg, "min_tx", 100); min_tx = MAX(min_tx, 1); if (bfd->cfg_min_tx != min_tx) { @@ -505,7 +505,7 @@ void bfd_unref(struct bfd *bfd) OVS_EXCLUDED(mutex) { - if (bfd && ovs_refcount_unref(&bfd->ref_cnt) == 1) { + if (bfd && ovs_refcount_unref_relaxed(&bfd->ref_cnt) == 1) { ovs_mutex_lock(&mutex); bfd_status_changed(bfd); hmap_remove(all_bfds, &bfd->node); @@ -516,10 +516,12 @@ } } -void +long long int bfd_wait(const struct bfd *bfd) OVS_EXCLUDED(mutex) { - poll_timer_wait_until(bfd_wake_time(bfd)); + long long int wake_time = bfd_wake_time(bfd); + poll_timer_wait_until(wake_time); + return wake_time; } /* Returns the next wake up time. */ @@ -586,7 +588,7 @@ } void -bfd_put_packet(struct bfd *bfd, struct ofpbuf *p, +bfd_put_packet(struct bfd *bfd, struct dp_packet *p, uint8_t eth_src[ETH_ADDR_LEN]) OVS_EXCLUDED(mutex) { long long int min_tx, min_rx; @@ -610,8 +612,8 @@ * set. */ ovs_assert(!(bfd->flags & FLAG_POLL) || !(bfd->flags & FLAG_FINAL)); - ofpbuf_reserve(p, 2); /* Properly align after the ethernet header. */ - eth = ofpbuf_put_uninit(p, sizeof *eth); + dp_packet_reserve(p, 2); /* Properly align after the ethernet header. */ + eth = dp_packet_put_uninit(p, sizeof *eth); memcpy(eth->eth_src, eth_addr_is_zero(bfd->local_eth_src) ? eth_src : bfd->local_eth_src, @@ -622,7 +624,7 @@ ETH_ADDR_LEN); eth->eth_type = htons(ETH_TYPE_IP); - ip = ofpbuf_put_zeros(p, sizeof *ip); + ip = dp_packet_put_zeros(p, sizeof *ip); ip->ip_ihl_ver = IP_IHL_VER(5, 4); ip->ip_tot_len = htons(sizeof *ip + sizeof *udp + sizeof *msg); ip->ip_ttl = MAXTTL; @@ -632,12 +634,12 @@ put_16aligned_be32(&ip->ip_dst, bfd->ip_dst); ip->ip_csum = csum(ip, sizeof *ip); - udp = ofpbuf_put_zeros(p, sizeof *udp); + udp = dp_packet_put_zeros(p, sizeof *udp); udp->udp_src = htons(bfd->udp_src); udp->udp_dst = htons(BFD_DEST_PORT); udp->udp_len = htons(sizeof *udp + sizeof *msg); - msg = ofpbuf_put_uninit(p, sizeof *msg); + msg = dp_packet_put_uninit(p, sizeof *msg); msg->vers_diag = (BFD_VERSION << 5) | bfd->diag; msg->flags = (bfd->state & STATE_MASK) | bfd->flags; @@ -672,37 +674,45 @@ struct flow_wildcards *wc) { struct bfd *bfd = CONST_CAST(struct bfd *, bfd_); - bool check_tnl_key; - memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst); - if (!eth_addr_is_zero(bfd->rmt_eth_dst) - && memcmp(bfd->rmt_eth_dst, flow->dl_dst, ETH_ADDR_LEN)) { - return false; - } + if (!eth_addr_is_zero(bfd->rmt_eth_dst)) { + memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst); - memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); - memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst); + if (memcmp(bfd->rmt_eth_dst, flow->dl_dst, ETH_ADDR_LEN)) { + return false; + } + } - atomic_read(&bfd->check_tnl_key, &check_tnl_key); - if (check_tnl_key) { - memset(&wc->masks.tunnel.tun_id, 0xff, sizeof wc->masks.tunnel.tun_id); + if (flow->dl_type == htons(ETH_TYPE_IP)) { + memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); + if (flow->nw_proto == IPPROTO_UDP) { + memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst); + if (flow->tp_dst == htons(BFD_DEST_PORT)) { + bool check_tnl_key; + + atomic_read_relaxed(&bfd->check_tnl_key, &check_tnl_key); + if (check_tnl_key) { + memset(&wc->masks.tunnel.tun_id, 0xff, + sizeof wc->masks.tunnel.tun_id); + return flow->tunnel.tun_id == htonll(0); + } + return true; + } + } } - return (flow->dl_type == htons(ETH_TYPE_IP) - && flow->nw_proto == IPPROTO_UDP - && flow->tp_dst == htons(BFD_DEST_PORT) - && (!check_tnl_key || flow->tunnel.tun_id == htonll(0))); + return false; } void bfd_process_packet(struct bfd *bfd, const struct flow *flow, - const struct ofpbuf *p) OVS_EXCLUDED(mutex) + const struct dp_packet *p) OVS_EXCLUDED(mutex) { uint32_t rmt_min_rx, pkt_your_disc; enum state rmt_state; enum flags flags; uint8_t version; struct msg *msg; - const uint8_t *l7 = ofpbuf_get_udp_payload(p); + const uint8_t *l7 = dp_packet_get_udp_payload(p); if (!l7) { return; /* No UDP payload. */ @@ -721,11 +731,11 @@ goto out; } - msg = ofpbuf_at(p, l7 - (uint8_t *)ofpbuf_data(p), BFD_PACKET_LEN); + msg = dp_packet_at(p, l7 - (uint8_t *)dp_packet_data(p), BFD_PACKET_LEN); if (!msg) { VLOG_INFO_RL(&rl, "%s: Received too-short BFD control message (only " "%"PRIdPTR" bytes long, at least %d required).", - bfd->name, (uint8_t *) ofpbuf_tail(p) - l7, + bfd->name, (uint8_t *) dp_packet_tail(p) - l7, BFD_PACKET_LEN); goto out; } @@ -734,7 +744,7 @@ * If the Length field is greater than the payload of the encapsulating * protocol, the packet MUST be discarded. * - * Note that we make this check implicity. Above we use ofpbuf_at() to + * Note that we make this check implicitly. Above we use dp_packet_at() to * ensure that there are at least BFD_PACKET_LEN bytes in the payload of * the encapsulating protocol. Below we require msg->length to be exactly * BFD_PACKET_LEN bytes. */ diff -Nru openvswitch-2.3.1/lib/bfd.h openvswitch-2.4.0~git20150623/lib/bfd.h --- openvswitch-2.3.1/lib/bfd.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/bfd.h 2015-06-23 18:46:21.000000000 +0000 @@ -21,25 +21,27 @@ #include #include +#include "packets.h" + struct bfd; struct dpif_flow_stats; struct flow; struct flow_wildcards; struct netdev; -struct ofpbuf; +struct dp_packet; struct smap; -void bfd_wait(const struct bfd *); +long long int bfd_wait(const struct bfd *); void bfd_run(struct bfd *); bool bfd_should_send_packet(const struct bfd *); -void bfd_put_packet(struct bfd *bfd, struct ofpbuf *packet, - uint8_t eth_src[6]); +void bfd_put_packet(struct bfd *bfd, struct dp_packet *packet, + uint8_t eth_src[ETH_ADDR_LEN]); bool bfd_should_process_flow(const struct bfd *, const struct flow *, struct flow_wildcards *); void bfd_process_packet(struct bfd *, const struct flow *, - const struct ofpbuf *); + const struct dp_packet *); struct bfd *bfd_configure(struct bfd *, const char *name, const struct smap *smap, diff -Nru openvswitch-2.3.1/lib/bitmap.c openvswitch-2.4.0~git20150623/lib/bitmap.c --- openvswitch-2.3.1/lib/bitmap.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/bitmap.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2011, 2014 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "bitmap.h" -#include -#include "util.h" - -/* Allocates and returns a bitmap initialized to all-1-bits. */ -unsigned long * -bitmap_allocate1(size_t n_bits) -{ - size_t n_bytes = bitmap_n_bytes(n_bits); - size_t n_longs = bitmap_n_longs(n_bits); - size_t r_bits = n_bits % BITMAP_ULONG_BITS; - unsigned long *bitmap; - - /* Allocate and initialize most of the bitmap. */ - bitmap = xmalloc(n_bytes); - memset(bitmap, 0xff, n_bytes); - - /* Ensure that the last "unsigned long" in the bitmap only has as many - * 1-bits as there actually should be. */ - if (r_bits) { - bitmap[n_longs - 1] = (1UL << r_bits) - 1; - } - - return bitmap; -} - -/* Sets 'count' consecutive bits in 'bitmap', starting at bit offset 'start', - * to 'value'. */ -void -bitmap_set_multiple(unsigned long *bitmap, size_t start, size_t count, - bool value) -{ - for (; count && start % BITMAP_ULONG_BITS; count--) { - bitmap_set(bitmap, start++, value); - } - for (; count >= BITMAP_ULONG_BITS; count -= BITMAP_ULONG_BITS) { - *bitmap_unit__(bitmap, start) = -(unsigned long) value; - start += BITMAP_ULONG_BITS; - } - for (; count; count--) { - bitmap_set(bitmap, start++, value); - } -} - -/* Compares the 'n' bits in bitmaps 'a' and 'b'. Returns true if all bits are - * equal, false otherwise. */ -bool -bitmap_equal(const unsigned long *a, const unsigned long *b, size_t n) -{ - size_t i; - - if (memcmp(a, b, n / BITMAP_ULONG_BITS * sizeof(unsigned long))) { - return false; - } - for (i = ROUND_DOWN(n, BITMAP_ULONG_BITS); i < n; i++) { - if (bitmap_is_set(a, i) != bitmap_is_set(b, i)) { - return false; - } - } - return true; -} - -/* Scans 'bitmap' from bit offset 'start' to 'end', excluding 'end' itself. - * Returns the bit offset of the lowest-numbered bit set to 'target', or 'end' - * if all of the bits are set to '!target'. */ -size_t -bitmap_scan(const unsigned long int *bitmap, bool target, - size_t start, size_t end) -{ - /* XXX slow */ - size_t i; - - for (i = start; i < end; i++) { - if (bitmap_is_set(bitmap, i) == target) { - break; - } - } - return i; -} - -/* Returns the number of 1-bits in the 'n'-bit bitmap at 'bitmap'. */ -size_t -bitmap_count1(const unsigned long int *bitmap, size_t n) -{ - size_t i; - size_t count = 0; - - BUILD_ASSERT(ULONG_MAX <= UINT64_MAX); - for (i = 0; i < BITMAP_N_LONGS(n); i++) { - count += count_1bits(bitmap[i]); - } - - return count; -} diff -Nru openvswitch-2.3.1/lib/bitmap.h openvswitch-2.4.0~git20150623/lib/bitmap.h --- openvswitch-2.3.1/lib/bitmap.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/bitmap.h 2015-06-23 18:46:21.000000000 +0000 @@ -55,7 +55,27 @@ return xzalloc(bitmap_n_bytes(n_bits)); } -unsigned long *bitmap_allocate1(size_t n_bits); +/* Initializes bitmap to all-1-bits and returns the bitmap pointer. */ +static inline unsigned long * +bitmap_init1(unsigned long *bitmap, size_t n_bits) +{ + size_t n_longs = bitmap_n_longs(n_bits); + size_t n_bytes = bitmap_n_bytes(n_bits); + size_t r_bits = n_bits % BITMAP_ULONG_BITS; + + memset(bitmap, 0xff, n_bytes); + if (r_bits) { + bitmap[n_longs - 1] >>= BITMAP_ULONG_BITS - r_bits; + } + return bitmap; +} + +/* Allocates and returns a bitmap initialized to all-1-bits. */ +static inline unsigned long * +bitmap_allocate1(size_t n_bits) +{ + return bitmap_init1(xmalloc(bitmap_n_bytes(n_bits)), n_bits); +} static inline unsigned long * bitmap_clone(const unsigned long *bitmap, size_t n_bits) @@ -75,37 +95,187 @@ return (*bitmap_unit__(bitmap, offset) & bitmap_bit__(offset)) != 0; } -static inline void +static inline unsigned long * bitmap_set1(unsigned long *bitmap, size_t offset) { *bitmap_unit__(bitmap, offset) |= bitmap_bit__(offset); + return bitmap; } -static inline void +static inline unsigned long * bitmap_set0(unsigned long *bitmap, size_t offset) { *bitmap_unit__(bitmap, offset) &= ~bitmap_bit__(offset); + return bitmap; } -static inline void +static inline unsigned long * bitmap_set(unsigned long *bitmap, size_t offset, bool value) { + return (value) ? bitmap_set1(bitmap, offset) : bitmap_set0(bitmap, offset); +} + +/* Sets 'n' bits of a single unit. */ +static inline void +bitmap_set_n__(unsigned long *bitmap, size_t start, size_t n, bool value) +{ + unsigned long mask = ((1UL << n) - 1) << start % BITMAP_ULONG_BITS; + if (value) { - bitmap_set1(bitmap, offset); + *bitmap_unit__(bitmap, start) |= mask; } else { - bitmap_set0(bitmap, offset); + *bitmap_unit__(bitmap, start) &= ~mask; + } +} + +/* Sets 'count' consecutive bits in 'bitmap', starting at bit offset 'start', + * to 'value'. */ +static inline unsigned long * +bitmap_set_multiple(unsigned long *bitmap, size_t start, size_t count, + bool value) +{ + if (count && start % BITMAP_ULONG_BITS) { + size_t n = MIN(count, BITMAP_ULONG_BITS - start % BITMAP_ULONG_BITS); + + bitmap_set_n__(bitmap, start, n, value); + count -= n; + start += n; + } + for (; count >= BITMAP_ULONG_BITS; count -= BITMAP_ULONG_BITS) { + *bitmap_unit__(bitmap, start) = (unsigned long)!value - 1; + start += BITMAP_ULONG_BITS; + } + if (count) { + bitmap_set_n__(bitmap, start, count, value); + } + return bitmap; +} + +/* Returns the number of 1-bits in the 'n'-bit bitmap at 'bitmap'. */ +static inline size_t +bitmap_count1(const unsigned long int *bitmap, size_t n) +{ + size_t i; + size_t count = 0; + + BUILD_ASSERT(ULONG_MAX <= UINT64_MAX); + for (i = 0; i < BITMAP_N_LONGS(n); i++) { + count += count_1bits(bitmap[i]); + } + return count; +} + +/* "dst &= arg;" for n-bit dst and arg. */ +static inline unsigned long * +bitmap_and(unsigned long *dst, const unsigned long *arg, size_t n) +{ + size_t i; + + for (i = 0; i < BITMAP_N_LONGS(n); i++) { + dst[i] &= arg[i]; } + return dst; } -void bitmap_set_multiple(unsigned long *, size_t start, size_t count, - bool value); -bool bitmap_equal(const unsigned long *, const unsigned long *, size_t n); -size_t bitmap_scan(const unsigned long int *, bool target, - size_t start, size_t end); -size_t bitmap_count1(const unsigned long *, size_t n); +/* "dst |= arg;" for n-bit dst and arg. */ +static inline unsigned long * +bitmap_or(unsigned long *dst, const unsigned long *arg, size_t n) +{ + size_t i; + + for (i = 0; i < BITMAP_N_LONGS(n); i++) { + dst[i] |= arg[i]; + } + return dst; +} + +/* "dst = ~dst;" for n-bit dst. */ +static inline unsigned long * +bitmap_not(unsigned long *dst, size_t n) +{ + size_t i; + + for (i = 0; i < n / BITMAP_ULONG_BITS; i++) { + dst[i] = ~dst[i]; + } + if (n % BITMAP_ULONG_BITS) { + dst[i] ^= (1UL << (n % BITMAP_ULONG_BITS)) - 1; + } + return dst; +} + +/* Compares the 'n' bits in bitmaps 'a' and 'b'. Returns true if all bits are + * equal, false otherwise. */ +static inline bool +bitmap_equal(const unsigned long *a, const unsigned long *b, size_t n) +{ + if (memcmp(a, b, n / BITMAP_ULONG_BITS * sizeof(unsigned long))) { + return false; + } + if (n % BITMAP_ULONG_BITS) { + unsigned long mask = (1UL << n % BITMAP_ULONG_BITS) - 1; + unsigned long diff = *bitmap_unit__(a, n) ^ *bitmap_unit__(b, n); + + return !(diff & mask); + } + return true; +} + +/* Scans 'bitmap' from bit offset 'start' to 'end', excluding 'end' itself. + * Returns the bit offset of the lowest-numbered bit set to 'target', or 'end' + * if all of the bits are set to '!target'. 'target' is typically a + * compile-time constant, so it makes sense to inline this. Compiler may also + * optimize parts away depending on the 'start' and 'end' values passed in. */ +static inline size_t +bitmap_scan(const unsigned long *bitmap, bool target, size_t start, size_t end) +{ + if (OVS_LIKELY(start < end)) { + unsigned long *p, unit; + + p = bitmap_unit__(bitmap, start); + unit = (target ? *p : ~*p) >> (start % BITMAP_ULONG_BITS); + if (!unit) { + start -= start % BITMAP_ULONG_BITS; /* Round down. */ + start += BITMAP_ULONG_BITS; /* Start of the next unit. */ + + for (; start < end; start += BITMAP_ULONG_BITS) { + unit = target ? *++p : ~*++p; + if (unit) { + goto found; + } + } + return end; + } +found: + start += raw_ctz(unit); /* unit != 0 */ + if (OVS_LIKELY(start < end)) { + return start; + } + } + return end; +} + +/* Returns true if all of the 'n' bits in 'bitmap' are 0, + * false if at least one bit is a 1.*/ +static inline bool +bitmap_is_all_zeros(const unsigned long *bitmap, size_t n) +{ + return bitmap_scan(bitmap, true, 0, n) == n; +} + +#define BITMAP_FOR_EACH_1_RANGE(IDX, BEGIN, END, BITMAP) \ + for ((IDX) = bitmap_scan(BITMAP, true, BEGIN, END); (IDX) < (END); \ + (IDX) = bitmap_scan(BITMAP, true, (IDX) + 1, END)) +#define BITMAP_FOR_EACH_1(IDX, SIZE, BITMAP) \ + BITMAP_FOR_EACH_1_RANGE(IDX, 0, SIZE, BITMAP) + +/* More efficient access to a map of single ulong. */ +#define ULONG_FOR_EACH_1(IDX, MAP) \ + for (unsigned long map__ = (MAP); \ + map__ && (((IDX) = raw_ctz(map__)), true); \ + map__ = zero_rightmost_1bit(map__)) -#define BITMAP_FOR_EACH_1(IDX, SIZE, BITMAP) \ - for ((IDX) = bitmap_scan(BITMAP, 1, 0, SIZE); (IDX) < (SIZE); \ - (IDX) = bitmap_scan(BITMAP, 1, (IDX) + 1, SIZE)) +#define ULONG_SET0(MAP, OFFSET) ((MAP) &= ~(1UL << (OFFSET))) +#define ULONG_SET1(MAP, OFFSET) ((MAP) |= 1UL << (OFFSET)) #endif /* bitmap.h */ diff -Nru openvswitch-2.3.1/lib/bundle.c openvswitch-2.4.0~git20150623/lib/bundle.c --- openvswitch-2.3.1/lib/bundle.c 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/bundle.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, 2013 Nicira, Inc. +/* Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,9 +29,7 @@ #include "ofp-errors.h" #include "ofp-util.h" #include "openflow/nicira-ext.h" -#include "vlog.h" - -#define BUNDLE_MAX_SLAVES 2048 +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(bundle); @@ -103,89 +101,6 @@ } } -/* Checks that 'nab' specifies a bundle action which is supported by this - * bundle module. Uses the 'max_ports' parameter to validate each port using - * ofputil_check_output_port(). Returns 0 if 'nab' is supported, otherwise an - * OFPERR_* error code. */ -enum ofperr -bundle_from_openflow(const struct nx_action_bundle *nab, - struct ofpbuf *ofpacts) -{ - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); - struct ofpact_bundle *bundle; - uint16_t subtype; - uint32_t slave_type; - size_t slaves_size, i; - enum ofperr error; - - bundle = ofpact_put_BUNDLE(ofpacts); - - subtype = ntohs(nab->subtype); - bundle->n_slaves = ntohs(nab->n_slaves); - bundle->basis = ntohs(nab->basis); - bundle->fields = ntohs(nab->fields); - bundle->algorithm = ntohs(nab->algorithm); - slave_type = ntohl(nab->slave_type); - slaves_size = ntohs(nab->len) - sizeof *nab; - - error = OFPERR_OFPBAC_BAD_ARGUMENT; - if (!flow_hash_fields_valid(bundle->fields)) { - VLOG_WARN_RL(&rl, "unsupported fields %d", (int) bundle->fields); - } else if (bundle->n_slaves > BUNDLE_MAX_SLAVES) { - VLOG_WARN_RL(&rl, "too may slaves"); - } else if (bundle->algorithm != NX_BD_ALG_HRW - && bundle->algorithm != NX_BD_ALG_ACTIVE_BACKUP) { - VLOG_WARN_RL(&rl, "unsupported algorithm %d", (int) bundle->algorithm); - } else if (slave_type != NXM_OF_IN_PORT) { - VLOG_WARN_RL(&rl, "unsupported slave type %"PRIu16, slave_type); - } else { - error = 0; - } - - if (!is_all_zeros(nab->zero, sizeof nab->zero)) { - VLOG_WARN_RL(&rl, "reserved field is nonzero"); - error = OFPERR_OFPBAC_BAD_ARGUMENT; - } - - if (subtype == NXAST_BUNDLE && (nab->ofs_nbits || nab->dst)) { - VLOG_WARN_RL(&rl, "bundle action has nonzero reserved fields"); - error = OFPERR_OFPBAC_BAD_ARGUMENT; - } - - if (subtype == NXAST_BUNDLE_LOAD) { - bundle->dst.field = mf_from_nxm_header(ntohl(nab->dst)); - bundle->dst.ofs = nxm_decode_ofs(nab->ofs_nbits); - bundle->dst.n_bits = nxm_decode_n_bits(nab->ofs_nbits); - - if (bundle->dst.n_bits < 16) { - VLOG_WARN_RL(&rl, "bundle_load action requires at least 16 bit " - "destination."); - error = OFPERR_OFPBAC_BAD_ARGUMENT; - } - } - - if (slaves_size < bundle->n_slaves * sizeof(ovs_be16)) { - VLOG_WARN_RL(&rl, "Nicira action %"PRIu16" only has %"PRIuSIZE" bytes " - "allocated for slaves. %"PRIuSIZE" bytes are required for " - "%"PRIu16" slaves.", subtype, slaves_size, - bundle->n_slaves * sizeof(ovs_be16), bundle->n_slaves); - error = OFPERR_OFPBAC_BAD_LEN; - } - - for (i = 0; i < bundle->n_slaves; i++) { - uint16_t ofp_port = ntohs(((ovs_be16 *)(nab + 1))[i]); - ofpbuf_put(ofpacts, &ofp_port, sizeof ofp_port); - } - - bundle = ofpacts->frame; - ofpact_update_len(ofpacts, &bundle->ofpact); - - if (!error) { - error = bundle_check(bundle, OFPP_MAX, NULL); - } - return error; -} - enum ofperr bundle_check(const struct ofpact_bundle *bundle, ofp_port_t max_ports, const struct flow *flow) @@ -222,40 +137,12 @@ return 0; } -void -bundle_to_nxast(const struct ofpact_bundle *bundle, struct ofpbuf *openflow) -{ - int slaves_len = ROUND_UP(2 * bundle->n_slaves, OFP_ACTION_ALIGN); - struct nx_action_bundle *nab; - ovs_be16 *slaves; - size_t i; - - nab = (bundle->dst.field - ? ofputil_put_NXAST_BUNDLE_LOAD(openflow) - : ofputil_put_NXAST_BUNDLE(openflow)); - nab->len = htons(ntohs(nab->len) + slaves_len); - nab->algorithm = htons(bundle->algorithm); - nab->fields = htons(bundle->fields); - nab->basis = htons(bundle->basis); - nab->slave_type = htonl(NXM_OF_IN_PORT); - nab->n_slaves = htons(bundle->n_slaves); - if (bundle->dst.field) { - nab->ofs_nbits = nxm_encode_ofs_nbits(bundle->dst.ofs, - bundle->dst.n_bits); - nab->dst = htonl(bundle->dst.field->nxm_header); - } - - slaves = ofpbuf_put_zeros(openflow, slaves_len); - for (i = 0; i < bundle->n_slaves; i++) { - slaves[i] = htons(ofp_to_u16(bundle->slaves[i])); - } -} /* Helper for bundle_parse and bundle_parse_load. * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string.*/ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT bundle_parse__(const char *s, char **save_ptr, const char *fields, const char *basis, const char *algorithm, const char *slave_type, const char *dst, @@ -288,7 +175,7 @@ } ofpbuf_put(ofpacts, &slave_port, sizeof slave_port); - bundle = ofpacts->frame; + bundle = ofpacts->header; bundle->n_slaves++; } ofpact_update_len(ofpacts, &bundle->ofpact); @@ -320,6 +207,11 @@ if (error) { return error; } + + if (!mf_nxm_header(bundle->dst.field->id)) { + return xasprintf("%s: experimenter OXM field '%s' not supported", + s, dst); + } } return NULL; @@ -330,7 +222,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT bundle_parse(const char *s, struct ofpbuf *ofpacts) { char *fields, *basis, *algorithm, *slave_type, *slave_delim; @@ -357,7 +249,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string.*/ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT bundle_parse_load(const char *s, struct ofpbuf *ofpacts) { char *fields, *basis, *algorithm, *slave_type, *dst, *slave_delim; diff -Nru openvswitch-2.3.1/lib/bundle.h openvswitch-2.4.0~git20150623/lib/bundle.h --- openvswitch-2.3.1/lib/bundle.h 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/bundle.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, 2013 Nicira, Inc. +/* Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,18 +36,17 @@ * * See include/openflow/nicira-ext.h for NXAST_BUNDLE specification. */ +#define BUNDLE_MAX_SLAVES 2048 + ofp_port_t bundle_execute(const struct ofpact_bundle *, const struct flow *, struct flow_wildcards *wc, bool (*slave_enabled)(ofp_port_t ofp_port, void *aux), void *aux); -enum ofperr bundle_from_openflow(const struct nx_action_bundle *, - struct ofpbuf *ofpact); enum ofperr bundle_check(const struct ofpact_bundle *, ofp_port_t max_ports, const struct flow *); -void bundle_to_nxast(const struct ofpact_bundle *, struct ofpbuf *of10); -char *bundle_parse(const char *, struct ofpbuf *ofpacts) WARN_UNUSED_RESULT; +char *bundle_parse(const char *, struct ofpbuf *ofpacts) OVS_WARN_UNUSED_RESULT; char *bundle_parse_load(const char *, struct ofpbuf *ofpacts) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void bundle_format(const struct ofpact_bundle *, struct ds *); #endif /* bundle.h */ diff -Nru openvswitch-2.3.1/lib/cfm.c openvswitch-2.4.0~git20150623/lib/cfm.c --- openvswitch-2.3.1/lib/cfm.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/cfm.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,12 +23,13 @@ #include "byte-order.h" #include "connectivity.h" +#include "dp-packet.h" #include "dynamic-string.h" #include "flow.h" #include "hash.h" #include "hmap.h" #include "netdev.h" -#include "ofpbuf.h" +#include "ovs-atomic.h" #include "packets.h" #include "poll-loop.h" #include "random.h" @@ -36,15 +37,16 @@ #include "timer.h" #include "timeval.h" #include "unixctl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(cfm); #define CFM_MAX_RMPS 256 /* Ethernet destination address of CCM packets. */ -static const uint8_t eth_addr_ccm[6] = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x30 }; -static const uint8_t eth_addr_ccm_x[6] = { +static const uint8_t eth_addr_ccm[ETH_ADDR_LEN] = { + 0x01, 0x80, 0xC2, 0x00, 0x00, 0x30 }; +static const uint8_t eth_addr_ccm_x[ETH_ADDR_LEN] = { 0x01, 0x23, 0x20, 0x00, 0x00, 0x30 }; @@ -128,6 +130,9 @@ recomputed. */ long long int last_tx; /* Last CCM transmission time. */ + /* These bools are atomic to allow readers to check their values + * without taking 'mutex'. Such readers do not assume the values they + * read are synchronized with any other members. */ atomic_bool check_tnl_key; /* Verify the tunnel key of inbound packets? */ atomic_bool extended; /* Extended mode. */ struct ovs_refcount ref_cnt; @@ -184,7 +189,9 @@ cfm_ccm_addr(struct cfm *cfm) { bool extended; - atomic_read(&cfm->extended, &extended); + + atomic_read_relaxed(&cfm->extended, &extended); + return extended ? eth_addr_ccm_x : eth_addr_ccm; } @@ -374,7 +381,7 @@ return; } - if (ovs_refcount_unref(&cfm->ref_cnt) != 1) { + if (ovs_refcount_unref_relaxed(&cfm->ref_cnt) != 1) { return; } @@ -557,8 +564,8 @@ /* Composes a CCM message into 'packet'. Messages generated with this function * should be sent whenever cfm_should_send_ccm() indicates. */ void -cfm_compose_ccm(struct cfm *cfm, struct ofpbuf *packet, - uint8_t eth_src[ETH_ADDR_LEN]) OVS_EXCLUDED(mutex) +cfm_compose_ccm(struct cfm *cfm, struct dp_packet *packet, + const uint8_t eth_src[ETH_ADDR_LEN]) OVS_EXCLUDED(mutex) { uint16_t ccm_vlan; struct ccm *ccm; @@ -578,7 +585,9 @@ eth_push_vlan(packet, htons(ETH_TYPE_VLAN), htons(tci)); } - ccm = ofpbuf_l3(packet); + atomic_read_relaxed(&cfm->extended, &extended); + + ccm = dp_packet_l3(packet); ccm->mdlevel_version = 0; ccm->opcode = CCM_OPCODE; ccm->tlv_offset = 70; @@ -588,7 +597,6 @@ memset(ccm->zero, 0, sizeof ccm->zero); ccm->end_tlv = 0; - atomic_read(&cfm->extended, &extended); if (extended) { ccm->mpid = htons(hash_mpid(cfm->mpid)); ccm->mpid64 = htonll(cfm->mpid); @@ -613,7 +621,7 @@ if (cfm->last_tx) { long long int delay = time_msec() - cfm->last_tx; if (delay > (cfm->ccm_interval_ms * 3 / 2)) { - VLOG_WARN("%s: long delay of %lldms (expected %dms) sending CCM" + VLOG_INFO("%s: long delay of %lldms (expected %dms) sending CCM" " seq %"PRIu32, cfm->name, delay, cfm->ccm_interval_ms, cfm->seq); } @@ -622,10 +630,12 @@ ovs_mutex_unlock(&mutex); } -void +long long int cfm_wait(struct cfm *cfm) OVS_EXCLUDED(mutex) { - poll_timer_wait_until(cfm_wake_time(cfm)); + long long int wake_time = cfm_wake_time(cfm); + poll_timer_wait_until(wake_time); + return wake_time; } @@ -664,8 +674,8 @@ interval = ms_to_ccm_interval(s->interval); interval_ms = ccm_interval_to_ms(interval); - atomic_store(&cfm->check_tnl_key, s->check_tnl_key); - atomic_store(&cfm->extended, s->extended); + atomic_store_relaxed(&cfm->check_tnl_key, s->check_tnl_key); + atomic_store_relaxed(&cfm->extended, s->extended); cfm->ccm_vlan = s->ccm_vlan; cfm->ccm_pcp = s->ccm_pcp & (VLAN_PCP_MASK >> VLAN_PCP_SHIFT); @@ -717,30 +727,42 @@ struct cfm *cfm = CONST_CAST(struct cfm *, cfm_); bool check_tnl_key; - atomic_read(&cfm->check_tnl_key, &check_tnl_key); + /* Most packets are not CFM. */ + if (OVS_LIKELY(flow->dl_type != htons(ETH_TYPE_CFM))) { + return false; + } + memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst); + if (OVS_UNLIKELY(!eth_addr_equals(flow->dl_dst, cfm_ccm_addr(cfm)))) { + return false; + } + + atomic_read_relaxed(&cfm->check_tnl_key, &check_tnl_key); + if (check_tnl_key) { memset(&wc->masks.tunnel.tun_id, 0xff, sizeof wc->masks.tunnel.tun_id); + return flow->tunnel.tun_id == htonll(0); } - return (ntohs(flow->dl_type) == ETH_TYPE_CFM - && eth_addr_equals(flow->dl_dst, cfm_ccm_addr(cfm)) - && (!check_tnl_key || flow->tunnel.tun_id == htonll(0))); + return true; } /* Updates internal statistics relevant to packet 'p'. Should be called on * every packet whose flow returned true when passed to * cfm_should_process_flow. */ void -cfm_process_heartbeat(struct cfm *cfm, const struct ofpbuf *p) +cfm_process_heartbeat(struct cfm *cfm, const struct dp_packet *p) OVS_EXCLUDED(mutex) { struct ccm *ccm; struct eth_header *eth; + bool extended; ovs_mutex_lock(&mutex); - eth = ofpbuf_l2(p); - ccm = ofpbuf_at(p, (uint8_t *)ofpbuf_l3(p) - (uint8_t *)ofpbuf_data(p), + atomic_read_relaxed(&cfm->extended, &extended); + + eth = dp_packet_l2(p); + ccm = dp_packet_at(p, (uint8_t *)dp_packet_l3(p) - (uint8_t *)dp_packet_data(p), CCM_ACCEPT_LEN); if (!ccm) { @@ -777,10 +799,8 @@ uint64_t ccm_mpid; uint32_t ccm_seq; bool ccm_opdown; - bool extended; enum cfm_fault_reason cfm_fault = 0; - atomic_read(&cfm->extended, &extended); if (extended) { ccm_mpid = ntohll(ccm->mpid64); ccm_opdown = ccm->opdown; @@ -925,26 +945,42 @@ return health; } +static int +cfm_get_opup__(const struct cfm *cfm_) OVS_REQUIRES(mutex) +{ + struct cfm *cfm = CONST_CAST(struct cfm *, cfm_); + bool extended; + + atomic_read_relaxed(&cfm->extended, &extended); + + return extended ? cfm->remote_opup : -1; +} + /* Gets the operational state of 'cfm'. 'cfm' is considered operationally down * if it has received a CCM with the operationally down bit set from any of its * remote maintenance points. Returns 1 if 'cfm' is operationally up, 0 if * 'cfm' is operationally down, or -1 if 'cfm' has no operational state * (because it isn't in extended mode). */ int -cfm_get_opup(const struct cfm *cfm_) OVS_EXCLUDED(mutex) +cfm_get_opup(const struct cfm *cfm) OVS_EXCLUDED(mutex) { - struct cfm *cfm = CONST_CAST(struct cfm *, cfm_); - bool extended; int opup; ovs_mutex_lock(&mutex); - atomic_read(&cfm->extended, &extended); - opup = extended ? cfm->remote_opup : -1; + opup = cfm_get_opup__(cfm); ovs_mutex_unlock(&mutex); return opup; } +static void +cfm_get_remote_mpids__(const struct cfm *cfm, uint64_t **rmps, size_t *n_rmps) + OVS_REQUIRES(mutex) +{ + *rmps = xmemdup(cfm->rmps_array, cfm->rmps_array_len * sizeof **rmps); + *n_rmps = cfm->rmps_array_len; +} + /* Populates 'rmps' with an array of remote maintenance points reachable by * 'cfm'. The number of remote maintenance points is written to 'n_rmps'. * 'cfm' retains ownership of the array written to 'rmps' */ @@ -953,8 +989,20 @@ OVS_EXCLUDED(mutex) { ovs_mutex_lock(&mutex); - *rmps = xmemdup(cfm->rmps_array, cfm->rmps_array_len * sizeof **rmps); - *n_rmps = cfm->rmps_array_len; + cfm_get_remote_mpids__(cfm, rmps, n_rmps); + ovs_mutex_unlock(&mutex); +} + +/* Extracts the status of 'cfm' and fills in the 's'. */ +void +cfm_get_status(const struct cfm *cfm, struct cfm_status *s) OVS_EXCLUDED(mutex) +{ + ovs_mutex_lock(&mutex); + s->faults = cfm_get_fault__(cfm); + s->remote_opstate = cfm_get_opup__(cfm); + s->flap_count = cfm->flap_count; + s->health = cfm->health; + cfm_get_remote_mpids__(cfm, &s->rmps, &s->n_rmps); ovs_mutex_unlock(&mutex); } @@ -978,7 +1026,7 @@ bool extended; int fault; - atomic_read(&cfm->extended, &extended); + atomic_read_relaxed(&cfm->extended, &extended); ds_put_format(ds, "---- %s ----\n", cfm->name); ds_put_format(ds, "MPID %"PRIu64":%s%s\n", cfm->mpid, diff -Nru openvswitch-2.3.1/lib/cfm.h openvswitch-2.4.0~git20150623/lib/cfm.h --- openvswitch-2.3.1/lib/cfm.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/cfm.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2011 Nicira, Inc. +/* Copyright (c) 2010, 2011, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,10 @@ #include "hmap.h" #include "openvswitch/types.h" +#include "packets.h" struct flow; -struct ofpbuf; +struct dp_packet; struct netdev; struct flow_wildcards; @@ -63,25 +64,50 @@ bool check_tnl_key; /* Verify inbound packet key? */ }; +/* CFM status query. */ +struct cfm_status { + /* 0 if not faulted, otherwise a combination of one or more reasons. */ + enum cfm_fault_reason faults; + + /* 0 if the remote CFM endpoint is operationally down, + * 1 if the remote CFM endpoint is operationally up, + * -1 if we don't know because the remote CFM endpoint is not in extended + * mode. */ + int remote_opstate; + + uint64_t flap_count; + + /* Ordinarily a "health status" in the range 0...100 inclusive, with 0 + * being worst and 100 being best, or -1 if the health status is not + * well-defined. */ + int health; + + /* MPIDs of remote maintenance points whose CCMs have been received. */ + uint64_t *rmps; + size_t n_rmps; +}; + void cfm_init(void); struct cfm *cfm_create(const struct netdev *); struct cfm *cfm_ref(const struct cfm *); void cfm_unref(struct cfm *); void cfm_run(struct cfm *); bool cfm_should_send_ccm(struct cfm *); -void cfm_compose_ccm(struct cfm *, struct ofpbuf *packet, uint8_t eth_src[6]); -void cfm_wait(struct cfm *); +void cfm_compose_ccm(struct cfm *, struct dp_packet *, + const uint8_t eth_src[ETH_ADDR_LEN]); +long long int cfm_wait(struct cfm *); bool cfm_configure(struct cfm *, const struct cfm_settings *); void cfm_set_netdev(struct cfm *, const struct netdev *); bool cfm_should_process_flow(const struct cfm *cfm, const struct flow *, struct flow_wildcards *); -void cfm_process_heartbeat(struct cfm *, const struct ofpbuf *packet); +void cfm_process_heartbeat(struct cfm *, const struct dp_packet *packet); bool cfm_check_status_change(struct cfm *); int cfm_get_fault(const struct cfm *); uint64_t cfm_get_flap_count(const struct cfm *); int cfm_get_health(const struct cfm *); int cfm_get_opup(const struct cfm *); void cfm_get_remote_mpids(const struct cfm *, uint64_t **rmps, size_t *n_rmps); +void cfm_get_status(const struct cfm *, struct cfm_status *); const char *cfm_fault_reason_to_str(int fault); long long int cfm_wake_time(struct cfm*); diff -Nru openvswitch-2.3.1/lib/classifier.c openvswitch-2.4.0~git20150623/lib/classifier.c --- openvswitch-2.3.1/lib/classifier.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/classifier.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,106 +16,79 @@ #include #include "classifier.h" +#include "classifier-private.h" #include #include #include "byte-order.h" #include "dynamic-string.h" -#include "flow.h" -#include "hash.h" #include "odp-util.h" #include "ofp-util.h" -#include "ovs-thread.h" #include "packets.h" -#include "vlog.h" +#include "util.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(classifier); -struct trie_node; struct trie_ctx; -/* Ports trie depends on both ports sharing the same ovs_be32. */ -#define TP_PORTS_OFS32 (offsetof(struct flow, tp_src) / 4) -BUILD_ASSERT_DECL(TP_PORTS_OFS32 == offsetof(struct flow, tp_dst) / 4); - -/* Prefix trie for a 'field' */ -struct cls_trie { - const struct mf_field *field; /* Trie field, or NULL. */ - struct trie_node *root; /* NULL if none. */ -}; - -struct cls_subtable_entry { - struct cls_subtable *subtable; - tag_type tag; - unsigned int max_priority; -}; - -struct cls_subtable_cache { - struct cls_subtable_entry *subtables; - size_t alloc_size; /* Number of allocated elements. */ - size_t size; /* One past last valid array element. */ -}; +/* A collection of "struct cls_conjunction"s currently embedded into a + * cls_match. */ +struct cls_conjunction_set { + /* Link back to the cls_match. + * + * cls_conjunction_set is mostly used during classifier lookup, and, in + * turn, during classifier lookup the most used member of + * cls_conjunction_set is the rule's priority, so we cache it here for fast + * access. */ + struct cls_match *match; + int priority; /* Cached copy of match->priority. */ -enum { - CLS_MAX_INDICES = 3 /* Maximum number of lookup indices per subtable. */ + /* Conjunction information. + * + * 'min_n_clauses' allows some optimization during classifier lookup. */ + unsigned int n; /* Number of elements in 'conj'. */ + unsigned int min_n_clauses; /* Smallest 'n' among elements of 'conj'. */ + struct cls_conjunction conj[]; }; -struct cls_classifier { - int n_rules; /* Total number of rules. */ - uint8_t n_flow_segments; - uint8_t flow_segments[CLS_MAX_INDICES]; /* Flow segment boundaries to use - * for staged lookup. */ - struct hmap subtables; /* Contains "struct cls_subtable"s. */ - struct cls_subtable_cache subtables_priority; - struct hmap partitions; /* Contains "struct cls_partition"s. */ - struct cls_trie tries[CLS_MAX_TRIES]; /* Prefix tries. */ - unsigned int n_tries; -}; +/* Ports trie depends on both ports sharing the same ovs_be32. */ +#define TP_PORTS_OFS32 (offsetof(struct flow, tp_src) / 4) +BUILD_ASSERT_DECL(TP_PORTS_OFS32 == offsetof(struct flow, tp_dst) / 4); +BUILD_ASSERT_DECL(TP_PORTS_OFS32 % 2 == 0); +#define TP_PORTS_OFS64 (TP_PORTS_OFS32 / 2) -/* A set of rules that all have the same fields wildcarded. */ -struct cls_subtable { - struct hmap_node hmap_node; /* Within struct cls_classifier 'subtables' - * hmap. */ - struct hmap rules; /* Contains "struct cls_rule"s. */ - int n_rules; /* Number of rules, including duplicates. */ - unsigned int max_priority; /* Max priority of any rule in the subtable. */ - unsigned int max_count; /* Count of max_priority rules. */ - tag_type tag; /* Tag generated from mask for partitioning. */ - uint8_t n_indices; /* How many indices to use. */ - uint8_t index_ofs[CLS_MAX_INDICES]; /* u32 flow segment boundaries. */ - struct hindex indices[CLS_MAX_INDICES]; /* Staged lookup indices. */ - unsigned int trie_plen[CLS_MAX_TRIES]; /* Trie prefix length in 'mask'. */ - int ports_mask_len; - struct trie_node *ports_trie; /* NULL if none. */ - struct minimask mask; /* Wildcards for fields. */ - /* 'mask' must be the last field. */ -}; +static size_t +cls_conjunction_set_size(size_t n) +{ + return (sizeof(struct cls_conjunction_set) + + n * sizeof(struct cls_conjunction)); +} -/* Associates a metadata value (that is, a value of the OpenFlow 1.1+ metadata - * field) with tags for the "cls_subtable"s that contain rules that match that - * metadata value. */ -struct cls_partition { - struct hmap_node hmap_node; /* In struct cls_classifier's 'partitions' - * hmap. */ - ovs_be64 metadata; /* metadata value for this partition. */ - tag_type tags; /* OR of each flow's cls_subtable tag. */ - struct tag_tracker tracker; /* Tracks the bits in 'tags'. */ -}; +static struct cls_conjunction_set * +cls_conjunction_set_alloc(struct cls_match *match, + const struct cls_conjunction conj[], size_t n) +{ + if (n) { + size_t min_n_clauses = conj[0].n_clauses; + for (size_t i = 1; i < n; i++) { + min_n_clauses = MIN(min_n_clauses, conj[i].n_clauses); + } -/* Internal representation of a rule in a "struct cls_subtable". */ -struct cls_match { - struct cls_rule *cls_rule; - struct hindex_node index_nodes[CLS_MAX_INDICES]; /* Within subtable's - * 'indices'. */ - struct hmap_node hmap_node; /* Within struct cls_subtable 'rules'. */ - unsigned int priority; /* Larger numbers are higher priorities. */ - struct cls_partition *partition; - struct list list; /* List of identical, lower-priority rules. */ - struct miniflow flow; /* Matching rule. Mask is in the subtable. */ - /* 'flow' must be the last field. */ -}; + struct cls_conjunction_set *set = xmalloc(cls_conjunction_set_size(n)); + set->match = match; + set->priority = match->priority; + set->n = n; + set->min_n_clauses = min_n_clauses; + memcpy(set->conj, conj, n * sizeof *conj); + return set; + } else { + return NULL; + } +} static struct cls_match * -cls_match_alloc(struct cls_rule *rule) +cls_match_alloc(const struct cls_rule *rule, + const struct cls_conjunction conj[], size_t n) { int count = count_1bits(rule->match.flow.map); @@ -123,476 +96,117 @@ = xmalloc(sizeof *cls_match - sizeof cls_match->flow.inline_values + MINIFLOW_VALUES_SIZE(count)); - cls_match->cls_rule = rule; - miniflow_clone_inline(&cls_match->flow, &rule->match.flow, count); - cls_match->priority = rule->priority; - rule->cls_match = cls_match; + ovsrcu_init(&cls_match->next, NULL); + *CONST_CAST(const struct cls_rule **, &cls_match->cls_rule) = rule; + *CONST_CAST(int *, &cls_match->priority) = rule->priority; + *CONST_CAST(cls_version_t *, &cls_match->add_version) = rule->version; + atomic_init(&cls_match->remove_version, rule->version); /* Initially + invisible. */ + miniflow_clone_inline(CONST_CAST(struct miniflow *, &cls_match->flow), + &rule->match.flow, count); + ovsrcu_set_hidden(&cls_match->conj_set, + cls_conjunction_set_alloc(cls_match, conj, n)); return cls_match; } -static struct cls_subtable *find_subtable(const struct cls_classifier *, +static struct cls_subtable *find_subtable(const struct classifier *cls, const struct minimask *); -static struct cls_subtable *insert_subtable(struct cls_classifier *, +static struct cls_subtable *insert_subtable(struct classifier *cls, const struct minimask *); +static void destroy_subtable(struct classifier *cls, struct cls_subtable *); -static void destroy_subtable(struct cls_classifier *, struct cls_subtable *); - -static void update_subtables_after_insertion(struct cls_classifier *, - struct cls_subtable *, - unsigned int new_priority); -static void update_subtables_after_removal(struct cls_classifier *, - struct cls_subtable *, - unsigned int del_priority); - -static struct cls_match *find_match_wc(const struct cls_subtable *, - const struct flow *, struct trie_ctx *, - unsigned int n_tries, - struct flow_wildcards *); -static struct cls_match *find_equal(struct cls_subtable *, +static const struct cls_match *find_match_wc(const struct cls_subtable *, + cls_version_t version, + const struct flow *, + struct trie_ctx *, + unsigned int n_tries, + struct flow_wildcards *); +static struct cls_match *find_equal(const struct cls_subtable *, const struct miniflow *, uint32_t hash); -static struct cls_match *insert_rule(struct cls_classifier *, - struct cls_subtable *, struct cls_rule *); -/* Iterates RULE over HEAD and all of the cls_rules on HEAD->list. */ -#define FOR_EACH_RULE_IN_LIST(RULE, HEAD) \ - for ((RULE) = (HEAD); (RULE) != NULL; (RULE) = next_rule_in_list(RULE)) -#define FOR_EACH_RULE_IN_LIST_SAFE(RULE, NEXT, HEAD) \ - for ((RULE) = (HEAD); \ - (RULE) != NULL && ((NEXT) = next_rule_in_list(RULE), true); \ - (RULE) = (NEXT)) +/* Return the next visible (lower-priority) rule in the list. Multiple + * identical rules with the same priority may exist transitionally, but when + * versioning is used at most one of them is ever visible for lookups on any + * given 'version'. */ +static inline const struct cls_match * +next_visible_rule_in_list(const struct cls_match *rule, cls_version_t version) +{ + do { + rule = cls_match_next(rule); + } while (rule && !cls_match_visible_in_version(rule, version)); -static struct cls_match *next_rule_in_list__(struct cls_match *); -static struct cls_match *next_rule_in_list(struct cls_match *); + return rule; +} static unsigned int minimask_get_prefix_len(const struct minimask *, const struct mf_field *); -static void trie_init(struct cls_classifier *, int trie_idx, +static void trie_init(struct classifier *cls, int trie_idx, const struct mf_field *); static unsigned int trie_lookup(const struct cls_trie *, const struct flow *, - unsigned int *checkbits); -static unsigned int trie_lookup_value(const struct trie_node *, - const ovs_be32 value[], - unsigned int value_bits, - unsigned int *checkbits); -static void trie_destroy(struct trie_node *); + union mf_value *plens); +static unsigned int trie_lookup_value(const rcu_trie_ptr *, + const ovs_be32 value[], ovs_be32 plens[], + unsigned int value_bits); +static void trie_destroy(rcu_trie_ptr *); static void trie_insert(struct cls_trie *, const struct cls_rule *, int mlen); -static void trie_insert_prefix(struct trie_node **, const ovs_be32 *prefix, +static void trie_insert_prefix(rcu_trie_ptr *, const ovs_be32 *prefix, int mlen); static void trie_remove(struct cls_trie *, const struct cls_rule *, int mlen); -static void trie_remove_prefix(struct trie_node **, const ovs_be32 *prefix, +static void trie_remove_prefix(rcu_trie_ptr *, const ovs_be32 *prefix, int mlen); static void mask_set_prefix_bits(struct flow_wildcards *, uint8_t be32ofs, - unsigned int nbits); + unsigned int n_bits); static bool mask_prefix_bits_set(const struct flow_wildcards *, - uint8_t be32ofs, unsigned int nbits); - -static void -cls_subtable_cache_init(struct cls_subtable_cache *array) -{ - memset(array, 0, sizeof *array); -} - -static void -cls_subtable_cache_destroy(struct cls_subtable_cache *array) -{ - free(array->subtables); - memset(array, 0, sizeof *array); -} - -/* Array insertion. */ -static void -cls_subtable_cache_push_back(struct cls_subtable_cache *array, - struct cls_subtable_entry a) -{ - if (array->size == array->alloc_size) { - array->subtables = x2nrealloc(array->subtables, &array->alloc_size, - sizeof a); - } - - array->subtables[array->size++] = a; -} - -/* Move subtable entry at 'from' to 'to', shifting the elements in between - * (including the one at 'to') accordingly. */ -static inline void -cls_subtable_cache_move(struct cls_subtable_entry *to, - struct cls_subtable_entry *from) -{ - if (to != from) { - struct cls_subtable_entry temp = *from; - - if (to > from) { - /* Shift entries (from,to] backwards to make space at 'to'. */ - memmove(from, from + 1, (to - from) * sizeof *to); - } else { - /* Shift entries [to,from) forward to make space at 'to'. */ - memmove(to + 1, to, (from - to) * sizeof *to); - } - - *to = temp; - } -} - -/* Array removal. */ -static inline void -cls_subtable_cache_remove(struct cls_subtable_cache *array, - struct cls_subtable_entry *elem) -{ - ssize_t size = (&array->subtables[array->size] - - (elem + 1)) * sizeof *elem; - if (size > 0) { - memmove(elem, elem + 1, size); - } - array->size--; -} - -#define CLS_SUBTABLE_CACHE_FOR_EACH(SUBTABLE, ITER, ARRAY) \ - for (ITER = (ARRAY)->subtables; \ - ITER < &(ARRAY)->subtables[(ARRAY)->size] \ - && OVS_LIKELY(SUBTABLE = ITER->subtable); \ - ++ITER) -#define CLS_SUBTABLE_CACHE_FOR_EACH_CONTINUE(SUBTABLE, ITER, ARRAY) \ - for (++ITER; \ - ITER < &(ARRAY)->subtables[(ARRAY)->size] \ - && OVS_LIKELY(SUBTABLE = ITER->subtable); \ - ++ITER) -#define CLS_SUBTABLE_CACHE_FOR_EACH_REVERSE(SUBTABLE, ITER, ARRAY) \ - for (ITER = &(ARRAY)->subtables[(ARRAY)->size]; \ - ITER > (ARRAY)->subtables \ - && OVS_LIKELY(SUBTABLE = (--ITER)->subtable);) - -static void -cls_subtable_cache_verify(struct cls_subtable_cache *array) -{ - struct cls_subtable *table; - struct cls_subtable_entry *iter; - unsigned int priority = 0; - - CLS_SUBTABLE_CACHE_FOR_EACH_REVERSE (table, iter, array) { - if (iter->max_priority != table->max_priority) { - VLOG_WARN("Subtable %p has mismatching priority in cache (%u != %u)", - table, iter->max_priority, table->max_priority); - } - if (iter->max_priority < priority) { - VLOG_WARN("Subtable cache is out of order (%u < %u)", - iter->max_priority, priority); - } - priority = iter->max_priority; - } -} - -static void -cls_subtable_cache_reset(struct cls_classifier *cls) -{ - struct cls_subtable_cache old = cls->subtables_priority; - struct cls_subtable *subtable; - - VLOG_WARN("Resetting subtable cache."); - - cls_subtable_cache_verify(&cls->subtables_priority); - - cls_subtable_cache_init(&cls->subtables_priority); - - HMAP_FOR_EACH (subtable, hmap_node, &cls->subtables) { - struct cls_match *head; - struct cls_subtable_entry elem; - struct cls_subtable *table; - struct cls_subtable_entry *iter, *from = NULL; - unsigned int new_max = 0; - unsigned int max_count = 0; - bool found; - - /* Verify max_priority. */ - HMAP_FOR_EACH (head, hmap_node, &subtable->rules) { - if (head->priority > new_max) { - new_max = head->priority; - max_count = 1; - } else if (head->priority == new_max) { - max_count++; - } - } - if (new_max != subtable->max_priority || - max_count != subtable->max_count) { - VLOG_WARN("subtable %p (%u rules) has mismatching max_priority " - "(%u) or max_count (%u). Highest priority found was %u, " - "count: %u", - subtable, subtable->n_rules, subtable->max_priority, - subtable->max_count, new_max, max_count); - subtable->max_priority = new_max; - subtable->max_count = max_count; - } - - /* Locate the subtable from the old cache. */ - found = false; - CLS_SUBTABLE_CACHE_FOR_EACH (table, iter, &old) { - if (table == subtable) { - if (iter->max_priority != new_max) { - VLOG_WARN("Subtable %p has wrong max priority (%u != %u) " - "in the old cache.", - subtable, iter->max_priority, new_max); - } - if (found) { - VLOG_WARN("Subtable %p duplicated in the old cache.", - subtable); - } - found = true; - } - } - if (!found) { - VLOG_WARN("Subtable %p not found from the old cache.", subtable); - } - - elem.subtable = subtable; - elem.tag = subtable->tag; - elem.max_priority = subtable->max_priority; - cls_subtable_cache_push_back(&cls->subtables_priority, elem); - - /* Possibly move 'subtable' earlier in the priority array. If - * we break out of the loop, then the subtable (at 'from') - * should be moved to the position right after the current - * element. If the loop terminates normally, then 'iter' will - * be at the first array element and we'll move the subtable - * to the front of the array. */ - CLS_SUBTABLE_CACHE_FOR_EACH_REVERSE (table, iter, - &cls->subtables_priority) { - if (table == subtable) { - from = iter; /* Locate the subtable as we go. */ - } else if (table->max_priority >= new_max) { - ovs_assert(from != NULL); - iter++; /* After this. */ - break; - } - } - - /* Move subtable at 'from' to 'iter'. */ - cls_subtable_cache_move(iter, from); - } - - /* Verify that the old and the new have the same size. */ - if (old.size != cls->subtables_priority.size) { - VLOG_WARN("subtables cache sizes differ: old (%"PRIuSIZE - ") != new (%"PRIuSIZE").", - old.size, cls->subtables_priority.size); - } - - cls_subtable_cache_destroy(&old); - - cls_subtable_cache_verify(&cls->subtables_priority); -} - + uint8_t be32ofs, unsigned int n_bits); -/* flow/miniflow/minimask/minimatch utilities. - * These are only used by the classifier, so place them here to allow - * for better optimization. */ - -static inline uint64_t -miniflow_get_map_in_range(const struct miniflow *miniflow, - uint8_t start, uint8_t end, unsigned int *offset) -{ - uint64_t map = miniflow->map; - *offset = 0; - - if (start > 0) { - uint64_t msk = (UINT64_C(1) << start) - 1; /* 'start' LSBs set */ - *offset = count_1bits(map & msk); - map &= ~msk; - } - if (end < FLOW_U32S) { - uint64_t msk = (UINT64_C(1) << end) - 1; /* 'end' LSBs set */ - map &= msk; - } - return map; -} - -/* Returns a hash value for the bits of 'flow' where there are 1-bits in - * 'mask', given 'basis'. - * - * The hash values returned by this function are the same as those returned by - * miniflow_hash_in_minimask(), only the form of the arguments differ. */ -static inline uint32_t -flow_hash_in_minimask(const struct flow *flow, const struct minimask *mask, - uint32_t basis) -{ - const uint32_t *mask_values = miniflow_get_u32_values(&mask->masks); - const uint32_t *flow_u32 = (const uint32_t *)flow; - const uint32_t *p = mask_values; - uint32_t hash; - uint64_t map; - - hash = basis; - for (map = mask->masks.map; map; map = zero_rightmost_1bit(map)) { - hash = mhash_add(hash, flow_u32[raw_ctz(map)] & *p++); - } - - return mhash_finish(hash, (p - mask_values) * 4); -} - -/* Returns a hash value for the bits of 'flow' where there are 1-bits in - * 'mask', given 'basis'. - * - * The hash values returned by this function are the same as those returned by - * flow_hash_in_minimask(), only the form of the arguments differ. */ -static inline uint32_t -miniflow_hash_in_minimask(const struct miniflow *flow, - const struct minimask *mask, uint32_t basis) -{ - const uint32_t *mask_values = miniflow_get_u32_values(&mask->masks); - const uint32_t *p = mask_values; - uint32_t hash = basis; - uint32_t flow_u32; - - MINIFLOW_FOR_EACH_IN_MAP(flow_u32, flow, mask->masks.map) { - hash = mhash_add(hash, flow_u32 & *p++); - } - - return mhash_finish(hash, (p - mask_values) * 4); -} - -/* Returns a hash value for the bits of range [start, end) in 'flow', - * where there are 1-bits in 'mask', given 'hash'. - * - * The hash values returned by this function are the same as those returned by - * minimatch_hash_range(), only the form of the arguments differ. */ -static inline uint32_t -flow_hash_in_minimask_range(const struct flow *flow, - const struct minimask *mask, - uint8_t start, uint8_t end, uint32_t *basis) -{ - const uint32_t *mask_values = miniflow_get_u32_values(&mask->masks); - const uint32_t *flow_u32 = (const uint32_t *)flow; - unsigned int offset; - uint64_t map = miniflow_get_map_in_range(&mask->masks, start, end, - &offset); - const uint32_t *p = mask_values + offset; - uint32_t hash = *basis; - - for (; map; map = zero_rightmost_1bit(map)) { - hash = mhash_add(hash, flow_u32[raw_ctz(map)] & *p++); - } - - *basis = hash; /* Allow continuation from the unfinished value. */ - return mhash_finish(hash, (p - mask_values) * 4); -} - -/* Fold minimask 'mask''s wildcard mask into 'wc's wildcard mask. */ -static inline void -flow_wildcards_fold_minimask(struct flow_wildcards *wc, - const struct minimask *mask) -{ - flow_union_with_miniflow(&wc->masks, &mask->masks); -} +/* cls_rule. */ -/* Fold minimask 'mask''s wildcard mask into 'wc's wildcard mask - * in range [start, end). */ static inline void -flow_wildcards_fold_minimask_range(struct flow_wildcards *wc, - const struct minimask *mask, - uint8_t start, uint8_t end) -{ - uint32_t *dst_u32 = (uint32_t *)&wc->masks; - unsigned int offset; - uint64_t map = miniflow_get_map_in_range(&mask->masks, start, end, - &offset); - const uint32_t *p = miniflow_get_u32_values(&mask->masks) + offset; - - for (; map; map = zero_rightmost_1bit(map)) { - dst_u32[raw_ctz(map)] |= *p++; - } -} - -/* Returns a hash value for 'flow', given 'basis'. */ -static inline uint32_t -miniflow_hash(const struct miniflow *flow, uint32_t basis) +cls_rule_init__(struct cls_rule *rule, unsigned int priority, + cls_version_t version) { - const uint32_t *values = miniflow_get_u32_values(flow); - const uint32_t *p = values; - uint32_t hash = basis; - uint64_t hash_map = 0; - uint64_t map; - - for (map = flow->map; map; map = zero_rightmost_1bit(map)) { - if (*p) { - hash = mhash_add(hash, *p); - hash_map |= rightmost_1bit(map); - } - p++; - } - hash = mhash_add(hash, hash_map); - hash = mhash_add(hash, hash_map >> 32); - - return mhash_finish(hash, p - values); -} - -/* Returns a hash value for 'mask', given 'basis'. */ -static inline uint32_t -minimask_hash(const struct minimask *mask, uint32_t basis) -{ - return miniflow_hash(&mask->masks, basis); -} - -/* Returns a hash value for 'match', given 'basis'. */ -static inline uint32_t -minimatch_hash(const struct minimatch *match, uint32_t basis) -{ - return miniflow_hash(&match->flow, minimask_hash(&match->mask, basis)); -} - -/* Returns a hash value for the bits of range [start, end) in 'minimatch', - * given 'basis'. - * - * The hash values returned by this function are the same as those returned by - * flow_hash_in_minimask_range(), only the form of the arguments differ. */ -static inline uint32_t -minimatch_hash_range(const struct minimatch *match, uint8_t start, uint8_t end, - uint32_t *basis) -{ - unsigned int offset; - const uint32_t *p, *q; - uint32_t hash = *basis; - int n, i; - - n = count_1bits(miniflow_get_map_in_range(&match->mask.masks, start, end, - &offset)); - q = miniflow_get_u32_values(&match->mask.masks) + offset; - p = miniflow_get_u32_values(&match->flow) + offset; - - for (i = 0; i < n; i++) { - hash = mhash_add(hash, p[i] & q[i]); - } - *basis = hash; /* Allow continuation from the unfinished value. */ - return mhash_finish(hash, (offset + n) * 4); + rculist_init(&rule->node); + *CONST_CAST(int *, &rule->priority) = priority; + *CONST_CAST(cls_version_t *, &rule->version) = version; + rule->cls_match = NULL; } - -/* cls_rule. */ - /* Initializes 'rule' to match packets specified by 'match' at the given * 'priority'. 'match' must satisfy the invariant described in the comment at * the definition of struct match. * * The caller must eventually destroy 'rule' with cls_rule_destroy(). * - * (OpenFlow uses priorities between 0 and UINT16_MAX, inclusive, but - * internally Open vSwitch supports a wider range.) */ + * Clients should not use priority INT_MIN. (OpenFlow uses priorities between + * 0 and UINT16_MAX, inclusive.) */ void -cls_rule_init(struct cls_rule *rule, - const struct match *match, unsigned int priority) +cls_rule_init(struct cls_rule *rule, const struct match *match, int priority, + cls_version_t version) { - minimatch_init(&rule->match, match); - rule->priority = priority; - rule->cls_match = NULL; + cls_rule_init__(rule, priority, version); + minimatch_init(CONST_CAST(struct minimatch *, &rule->match), match); } /* Same as cls_rule_init() for initialization from a "struct minimatch". */ void cls_rule_init_from_minimatch(struct cls_rule *rule, - const struct minimatch *match, - unsigned int priority) + const struct minimatch *match, int priority, + cls_version_t version) { - minimatch_clone(&rule->match, match); - rule->priority = priority; - rule->cls_match = NULL; + cls_rule_init__(rule, priority, version); + minimatch_clone(CONST_CAST(struct minimatch *, &rule->match), match); +} + +/* Initializes 'dst' as a copy of 'src', but with 'version'. + * + * The caller must eventually destroy 'dst' with cls_rule_destroy(). */ +void +cls_rule_clone_in_version(struct cls_rule *dst, const struct cls_rule *src, + cls_version_t version) +{ + cls_rule_init__(dst, src->priority, version); + minimatch_clone(CONST_CAST(struct minimatch *, &dst->match), &src->match); } /* Initializes 'dst' as a copy of 'src'. @@ -601,20 +215,20 @@ void cls_rule_clone(struct cls_rule *dst, const struct cls_rule *src) { - minimatch_clone(&dst->match, &src->match); - dst->priority = src->priority; - dst->cls_match = NULL; + cls_rule_clone_in_version(dst, src, src->version); } /* Initializes 'dst' with the data in 'src', destroying 'src'. * + * 'src' must be a cls_rule NOT in a classifier. + * * The caller must eventually destroy 'dst' with cls_rule_destroy(). */ void cls_rule_move(struct cls_rule *dst, struct cls_rule *src) { - minimatch_move(&dst->match, &src->match); - dst->priority = src->priority; - dst->cls_match = NULL; + cls_rule_init__(dst, src->priority, src->version); + minimatch_move(CONST_CAST(struct minimatch *, &dst->match), + CONST_CAST(struct minimatch *, &src->match)); } /* Frees memory referenced by 'rule'. Doesn't free 'rule' itself (it's @@ -623,11 +237,38 @@ * ('rule' must not currently be in a classifier.) */ void cls_rule_destroy(struct cls_rule *rule) + OVS_NO_THREAD_SAFETY_ANALYSIS { - ovs_assert(!rule->cls_match); - minimatch_destroy(&rule->match); + ovs_assert(!rule->cls_match); /* Must not be in a classifier. */ + + /* Check that the rule has been properly removed from the classifier. */ + ovs_assert(rule->node.prev == RCULIST_POISON + || rculist_is_empty(&rule->node)); + rculist_poison__(&rule->node); /* Poisons also the next pointer. */ + + minimatch_destroy(CONST_CAST(struct minimatch *, &rule->match)); } +void +cls_rule_set_conjunctions(struct cls_rule *cr, + const struct cls_conjunction *conj, size_t n) +{ + struct cls_match *match = cr->cls_match; + struct cls_conjunction_set *old + = ovsrcu_get_protected(struct cls_conjunction_set *, &match->conj_set); + struct cls_conjunction *old_conj = old ? old->conj : NULL; + unsigned int old_n = old ? old->n : 0; + + if (old_n != n || (n && memcmp(old_conj, conj, n * sizeof *conj))) { + if (old) { + ovsrcu_postpone(free, old); + } + ovsrcu_set(&match->conj_set, + cls_conjunction_set_alloc(match, conj, n)); + } +} + + /* Returns true if 'a' and 'b' match the same packets at the same priority, * false if they differ in some way. */ bool @@ -656,84 +297,103 @@ { return minimask_is_catchall(&rule->match.mask); } - -/* Initializes 'cls' as a classifier that initially contains no classification - * rules. */ + +/* Makes rule invisible after 'version'. Once that version is made invisible + * (by changing the version parameter used in lookups), the rule should be + * actually removed via ovsrcu_postpone(). + * + * 'rule_' must be in a classifier. */ void -classifier_init(struct classifier *cls_, const uint8_t *flow_segments) +cls_rule_make_invisible_in_version(const struct cls_rule *rule, + cls_version_t remove_version) { - struct cls_classifier *cls = xmalloc(sizeof *cls); + ovs_assert(remove_version >= rule->cls_match->add_version); - fat_rwlock_init(&cls_->rwlock); + cls_match_set_remove_version(rule->cls_match, remove_version); +} - cls_->cls = cls; +/* This undoes the change made by cls_rule_make_invisible_after_version(). + * + * 'rule' must be in a classifier. */ +void +cls_rule_restore_visibility(const struct cls_rule *rule) +{ + cls_match_set_remove_version(rule->cls_match, CLS_NOT_REMOVED_VERSION); +} +/* Return true if 'rule' is visible in 'version'. + * + * 'rule' must be in a classifier. */ +bool +cls_rule_visible_in_version(const struct cls_rule *rule, cls_version_t version) +{ + return cls_match_visible_in_version(rule->cls_match, version); +} + +/* Initializes 'cls' as a classifier that initially contains no classification + * rules. */ +void +classifier_init(struct classifier *cls, const uint8_t *flow_segments) +{ cls->n_rules = 0; - hmap_init(&cls->subtables); - cls_subtable_cache_init(&cls->subtables_priority); - hmap_init(&cls->partitions); + cmap_init(&cls->subtables_map); + pvector_init(&cls->subtables); + cmap_init(&cls->partitions); cls->n_flow_segments = 0; if (flow_segments) { while (cls->n_flow_segments < CLS_MAX_INDICES - && *flow_segments < FLOW_U32S) { + && *flow_segments < FLOW_U64S) { cls->flow_segments[cls->n_flow_segments++] = *flow_segments++; } } cls->n_tries = 0; + for (int i = 0; i < CLS_MAX_TRIES; i++) { + trie_init(cls, i, NULL); + } + cls->publish = true; } /* Destroys 'cls'. Rules within 'cls', if any, are not freed; this is the - * caller's responsibility. */ + * caller's responsibility. + * May only be called after all the readers have been terminated. */ void -classifier_destroy(struct classifier *cls_) +classifier_destroy(struct classifier *cls) { - if (cls_) { - struct cls_classifier *cls = cls_->cls; - struct cls_subtable *partition, *next_partition; - struct cls_subtable *subtable, *next_subtable; + if (cls) { + struct cls_partition *partition; + struct cls_subtable *subtable; int i; - fat_rwlock_destroy(&cls_->rwlock); - if (!cls) { - return; - } - for (i = 0; i < cls->n_tries; i++) { - trie_destroy(cls->tries[i].root); + trie_destroy(&cls->tries[i].root); } - HMAP_FOR_EACH_SAFE (subtable, next_subtable, hmap_node, - &cls->subtables) { + CMAP_FOR_EACH (subtable, cmap_node, &cls->subtables_map) { destroy_subtable(cls, subtable); } - hmap_destroy(&cls->subtables); + cmap_destroy(&cls->subtables_map); - HMAP_FOR_EACH_SAFE (partition, next_partition, hmap_node, - &cls->partitions) { - hmap_remove(&cls->partitions, &partition->hmap_node); - free(partition); + CMAP_FOR_EACH (partition, cmap_node, &cls->partitions) { + ovsrcu_postpone(free, partition); } - hmap_destroy(&cls->partitions); + cmap_destroy(&cls->partitions); - cls_subtable_cache_destroy(&cls->subtables_priority); - free(cls); + pvector_destroy(&cls->subtables); } } -/* We use uint64_t as a set for the fields below. */ -BUILD_ASSERT_DECL(MFF_N_IDS <= 64); - /* Set the fields for which prefix lookup should be performed. */ -void -classifier_set_prefix_fields(struct classifier *cls_, +bool +classifier_set_prefix_fields(struct classifier *cls, const enum mf_field_id *trie_fields, unsigned int n_fields) { - struct cls_classifier *cls = cls_->cls; - uint64_t fields = 0; - int i, trie; + const struct mf_field * new_fields[CLS_MAX_TRIES]; + struct mf_bitmap fields = MF_BITMAP_INITIALIZER; + int i, n_tries = 0; + bool changed = false; - for (i = 0, trie = 0; i < n_fields && trie < CLS_MAX_TRIES; i++) { + for (i = 0; i < n_fields && n_tries < CLS_MAX_TRIES; i++) { const struct mf_field *field = mf_from_id(trie_fields[i]); if (field->flow_be32ofs < 0 || field->n_bits % 32) { /* Incompatible field. This is the only place where we @@ -743,90 +403,125 @@ continue; } - if (fields & (UINT64_C(1) << trie_fields[i])) { + if (bitmap_is_set(fields.bm, trie_fields[i])) { /* Duplicate field, there is no need to build more than * one index for any one field. */ continue; } - fields |= UINT64_C(1) << trie_fields[i]; + bitmap_set1(fields.bm, trie_fields[i]); - if (trie >= cls->n_tries || field != cls->tries[trie].field) { - trie_init(cls, trie, field); + new_fields[n_tries] = NULL; + if (n_tries >= cls->n_tries || field != cls->tries[n_tries].field) { + new_fields[n_tries] = field; + changed = true; + } + n_tries++; + } + + if (changed || n_tries < cls->n_tries) { + struct cls_subtable *subtable; + + /* Trie configuration needs to change. Disable trie lookups + * for the tries that are changing and wait all the current readers + * with the old configuration to be done. */ + changed = false; + CMAP_FOR_EACH (subtable, cmap_node, &cls->subtables_map) { + for (i = 0; i < cls->n_tries; i++) { + if ((i < n_tries && new_fields[i]) || i >= n_tries) { + if (subtable->trie_plen[i]) { + subtable->trie_plen[i] = 0; + changed = true; + } + } + } + } + /* Synchronize if any readers were using tries. The readers may + * temporarily function without the trie lookup based optimizations. */ + if (changed) { + /* ovsrcu_synchronize() functions as a memory barrier, so it does + * not matter that subtable->trie_plen is not atomic. */ + ovsrcu_synchronize(); } - trie++; - } - /* Destroy the rest. */ - for (i = trie; i < cls->n_tries; i++) { - trie_init(cls, i, NULL); + /* Now set up the tries. */ + for (i = 0; i < n_tries; i++) { + if (new_fields[i]) { + trie_init(cls, i, new_fields[i]); + } + } + /* Destroy the rest, if any. */ + for (; i < cls->n_tries; i++) { + trie_init(cls, i, NULL); + } + + cls->n_tries = n_tries; + return true; } - cls->n_tries = trie; + + return false; /* No change. */ } static void -trie_init(struct cls_classifier *cls, int trie_idx, - const struct mf_field *field) +trie_init(struct classifier *cls, int trie_idx, const struct mf_field *field) { struct cls_trie *trie = &cls->tries[trie_idx]; struct cls_subtable *subtable; - struct cls_subtable_entry *iter; if (trie_idx < cls->n_tries) { - trie_destroy(trie->root); + trie_destroy(&trie->root); + } else { + ovsrcu_set_hidden(&trie->root, NULL); } - trie->root = NULL; trie->field = field; - /* Add existing rules to the trie. */ - CLS_SUBTABLE_CACHE_FOR_EACH (subtable, iter, &cls->subtables_priority) { + /* Add existing rules to the new trie. */ + CMAP_FOR_EACH (subtable, cmap_node, &cls->subtables_map) { unsigned int plen; plen = field ? minimask_get_prefix_len(&subtable->mask, field) : 0; - /* Initialize subtable's prefix length on this field. */ - subtable->trie_plen[trie_idx] = plen; - if (plen) { struct cls_match *head; - HMAP_FOR_EACH (head, hmap_node, &subtable->rules) { - struct cls_match *match; - - FOR_EACH_RULE_IN_LIST (match, head) { - trie_insert(trie, match->cls_rule, plen); - } + CMAP_FOR_EACH (head, cmap_node, &subtable->rules) { + trie_insert(trie, head->cls_rule, plen); } } + /* Initialize subtable's prefix length on this field. This will + * allow readers to use the trie. */ + atomic_thread_fence(memory_order_release); + subtable->trie_plen[trie_idx] = plen; } } -/* Returns true if 'cls' contains no classification rules, false otherwise. */ +/* Returns true if 'cls' contains no classification rules, false otherwise. + * Checking the cmap requires no locking. */ bool classifier_is_empty(const struct classifier *cls) { - return cls->cls->n_rules == 0; + return cmap_is_empty(&cls->subtables_map); } /* Returns the number of rules in 'cls'. */ int classifier_count(const struct classifier *cls) { - return cls->cls->n_rules; + /* n_rules is an int, so in the presence of concurrent writers this will + * return either the old or a new value. */ + return cls->n_rules; } static uint32_t -hash_metadata(ovs_be64 metadata_) +hash_metadata(ovs_be64 metadata) { - uint64_t metadata = (OVS_FORCE uint64_t) metadata_; - return hash_uint64(metadata); + return hash_uint64((OVS_FORCE uint64_t) metadata); } static struct cls_partition * -find_partition(const struct cls_classifier *cls, ovs_be64 metadata, - uint32_t hash) +find_partition(const struct classifier *cls, ovs_be64 metadata, uint32_t hash) { struct cls_partition *partition; - HMAP_FOR_EACH_IN_BUCKET (partition, hmap_node, hash, &cls->partitions) { + CMAP_FOR_EACH_WITH_HASH (partition, cmap_node, hash, &cls->partitions) { if (partition->metadata == metadata) { return partition; } @@ -836,7 +531,7 @@ } static struct cls_partition * -create_partition(struct cls_classifier *cls, struct cls_subtable *subtable, +create_partition(struct classifier *cls, struct cls_subtable *subtable, ovs_be64 metadata) { uint32_t hash = hash_metadata(metadata); @@ -846,7 +541,7 @@ partition->metadata = metadata; partition->tags = 0; tag_tracker_init(&partition->tracker); - hmap_insert(&cls->partitions, &partition->hmap_node, hash); + cmap_insert(&cls->partitions, &partition->cmap_node, hash); } tag_tracker_add(&partition->tracker, &partition->tags, subtable->tag); return partition; @@ -859,52 +554,84 @@ & MINIFLOW_GET_BE32(&match->mask.masks, tp_src); } +static void +subtable_replace_head_rule(struct classifier *cls OVS_UNUSED, + struct cls_subtable *subtable, + struct cls_match *head, struct cls_match *new, + uint32_t hash, uint32_t ihash[CLS_MAX_INDICES]) +{ + /* Rule's data is already in the tries. */ + + new->partition = head->partition; /* Steal partition, if any. */ + head->partition = NULL; + + for (int i = 0; i < subtable->n_indices; i++) { + cmap_replace(&subtable->indices[i], &head->index_nodes[i], + &new->index_nodes[i], ihash[i]); + } + cmap_replace(&subtable->rules, &head->cmap_node, &new->cmap_node, hash); +} + /* Inserts 'rule' into 'cls'. Until 'rule' is removed from 'cls', the caller * must not modify or free it. * * If 'cls' already contains an identical rule (including wildcards, values of * fixed fields, and priority), replaces the old rule by 'rule' and returns the * rule that was replaced. The caller takes ownership of the returned rule and - * is thus responsible for destroying it with cls_rule_destroy(), freeing the - * memory block in which it resides, etc., as necessary. + * is thus responsible for destroying it with cls_rule_destroy(), after RCU + * grace period has passed (see ovsrcu_postpone()). * * Returns NULL if 'cls' does not contain a rule with an identical key, after * inserting the new rule. In this case, no rules are displaced by the new * rule, even rules that cannot have any effect because the new rule matches a - * superset of their flows and has higher priority. */ -struct cls_rule * -classifier_replace(struct classifier *cls_, struct cls_rule *rule) + * superset of their flows and has higher priority. + */ +const struct cls_rule * +classifier_replace(struct classifier *cls, const struct cls_rule *rule, + const struct cls_conjunction *conjs, size_t n_conjs) { - struct cls_classifier *cls = cls_->cls; - struct cls_match *old_rule; + struct cls_match *new; struct cls_subtable *subtable; + uint32_t ihash[CLS_MAX_INDICES]; + uint8_t prev_be64ofs = 0; + struct cls_match *head; + size_t n_rules = 0; + uint32_t basis; + uint32_t hash; + int i; + + /* 'new' is initially invisible to lookups. */ + new = cls_match_alloc(rule, conjs, n_conjs); + + CONST_CAST(struct cls_rule *, rule)->cls_match = new; subtable = find_subtable(cls, &rule->match.mask); if (!subtable) { subtable = insert_subtable(cls, &rule->match.mask); } - old_rule = insert_rule(cls, subtable, rule); - if (!old_rule) { - int i; - - rule->cls_match->partition = NULL; - if (minimask_get_metadata_mask(&rule->match.mask) == OVS_BE64_MAX) { - ovs_be64 metadata = miniflow_get_metadata(&rule->match.flow); - rule->cls_match->partition = create_partition(cls, subtable, - metadata); - } - - subtable->n_rules++; - cls->n_rules++; + /* Compute hashes in segments. */ + basis = 0; + for (i = 0; i < subtable->n_indices; i++) { + ihash[i] = minimatch_hash_range(&rule->match, prev_be64ofs, + subtable->index_ofs[i], &basis); + prev_be64ofs = subtable->index_ofs[i]; + } + hash = minimatch_hash_range(&rule->match, prev_be64ofs, FLOW_U64S, &basis); + head = find_equal(subtable, &rule->match.flow, hash); + if (!head) { + /* Add rule to tries. + * + * Concurrent readers might miss seeing the rule until this update, + * which might require being fixed up by revalidation later. */ for (i = 0; i < cls->n_tries; i++) { if (subtable->trie_plen[i]) { trie_insert(&cls->tries[i], rule, subtable->trie_plen[i]); } } - /* Ports trie. */ + /* Add rule to ports trie. */ if (subtable->ports_mask_len) { /* We mask the value to be inserted to always have the wildcarded * bits in known (zero) state, so we can include them in comparison @@ -916,15 +643,126 @@ subtable->ports_mask_len); } - return NULL; - } else { - struct cls_rule *old_cls_rule = old_rule->cls_rule; + /* Add rule to partitions. + * + * Concurrent readers might miss seeing the rule until this update, + * which might require being fixed up by revalidation later. */ + new->partition = NULL; + if (minimask_get_metadata_mask(&rule->match.mask) == OVS_BE64_MAX) { + ovs_be64 metadata = miniflow_get_metadata(&rule->match.flow); + + new->partition = create_partition(cls, subtable, metadata); + } + + /* Add new node to segment indices. + * + * Readers may find the rule in the indices before the rule is visible + * in the subtables 'rules' map. This may result in us losing the + * opportunity to quit lookups earlier, resulting in sub-optimal + * wildcarding. This will be fixed later by revalidation (always + * scheduled after flow table changes). */ + for (i = 0; i < subtable->n_indices; i++) { + cmap_insert(&subtable->indices[i], &new->index_nodes[i], ihash[i]); + } + n_rules = cmap_insert(&subtable->rules, &new->cmap_node, hash); + } else { /* Equal rules exist in the classifier already. */ + struct cls_match *prev, *iter; + + /* Scan the list for the insertion point that will keep the list in + * order of decreasing priority. Insert after rules marked invisible + * in any version of the same priority. */ + FOR_EACH_RULE_IN_LIST_PROTECTED (iter, prev, head) { + if (rule->priority > iter->priority + || (rule->priority == iter->priority + && !cls_match_is_eventually_invisible(iter))) { + break; + } + } + + /* Replace 'iter' with 'new' or insert 'new' between 'prev' and + * 'iter'. */ + if (iter) { + struct cls_rule *old; + + if (rule->priority == iter->priority) { + cls_match_replace(prev, iter, new); + old = CONST_CAST(struct cls_rule *, iter->cls_rule); + } else { + cls_match_insert(prev, iter, new); + old = NULL; + } + + /* Replace the existing head in data structures, if rule is the new + * head. */ + if (iter == head) { + subtable_replace_head_rule(cls, subtable, head, new, hash, + ihash); + } + + if (old) { + struct cls_conjunction_set *conj_set; + + conj_set = ovsrcu_get_protected(struct cls_conjunction_set *, + &iter->conj_set); + if (conj_set) { + ovsrcu_postpone(free, conj_set); + } - rule->cls_match->partition = old_rule->partition; - old_cls_rule->cls_match = NULL; - free(old_rule); - return old_cls_rule; + ovsrcu_postpone(cls_match_free_cb, iter); + old->cls_match = NULL; + + /* No change in subtable's max priority or max count. */ + + /* Make 'new' visible to lookups in the appropriate version. */ + cls_match_set_remove_version(new, CLS_NOT_REMOVED_VERSION); + + /* Make rule visible to iterators (immediately). */ + rculist_replace(CONST_CAST(struct rculist *, &rule->node), + &old->node); + + /* Return displaced rule. Caller is responsible for keeping it + * around until all threads quiesce. */ + return old; + } + } else { + /* 'new' is new node after 'prev' */ + cls_match_insert(prev, iter, new); + } } + + /* Make 'new' visible to lookups in the appropriate version. */ + cls_match_set_remove_version(new, CLS_NOT_REMOVED_VERSION); + + /* Make rule visible to iterators (immediately). */ + rculist_push_back(&subtable->rules_list, + CONST_CAST(struct rculist *, &rule->node)); + + /* Rule was added, not replaced. Update 'subtable's 'max_priority' and + * 'max_count', if necessary. + * + * The rule was already inserted, but concurrent readers may not see the + * rule yet as the subtables vector is not updated yet. This will have to + * be fixed by revalidation later. */ + if (n_rules == 1) { + subtable->max_priority = rule->priority; + subtable->max_count = 1; + pvector_insert(&cls->subtables, subtable, rule->priority); + } else if (rule->priority == subtable->max_priority) { + ++subtable->max_count; + } else if (rule->priority > subtable->max_priority) { + subtable->max_priority = rule->priority; + subtable->max_count = 1; + pvector_change_priority(&cls->subtables, subtable, rule->priority); + } + + /* Nothing was replaced. */ + cls->n_rules++; + + if (cls->publish) { + pvector_publish(&cls->subtables); + } + + return NULL; } /* Inserts 'rule' into 'cls'. Until 'rule' is removed from 'cls', the caller @@ -934,93 +772,167 @@ * fixed fields, and priority). Use classifier_find_rule_exactly() to find * such a rule. */ void -classifier_insert(struct classifier *cls, struct cls_rule *rule) +classifier_insert(struct classifier *cls, const struct cls_rule *rule, + const struct cls_conjunction conj[], size_t n_conj) { - struct cls_rule *displaced_rule = classifier_replace(cls, rule); + const struct cls_rule *displaced_rule + = classifier_replace(cls, rule, conj, n_conj); ovs_assert(!displaced_rule); } /* Removes 'rule' from 'cls'. It is the caller's responsibility to destroy * 'rule' with cls_rule_destroy(), freeing the memory block in which 'rule' - * resides, etc., as necessary. */ -void -classifier_remove(struct classifier *cls_, struct cls_rule *rule) + * resides, etc., as necessary. + * + * Does nothing if 'rule' has been already removed, or was never inserted. + * + * Returns the removed rule, or NULL, if it was already removed. + */ +const struct cls_rule * +classifier_remove(struct classifier *cls, const struct cls_rule *cls_rule) { - struct cls_classifier *cls = cls_->cls; + struct cls_match *rule, *prev, *next, *head; struct cls_partition *partition; - struct cls_match *cls_match = rule->cls_match; - struct cls_match *head; + struct cls_conjunction_set *conj_set; struct cls_subtable *subtable; int i; + uint32_t basis = 0, hash, ihash[CLS_MAX_INDICES]; + uint8_t prev_be64ofs = 0; + size_t n_rules; - ovs_assert(cls_match); + rule = cls_rule->cls_match; + if (!rule) { + return NULL; + } + /* Mark as removed. */ + CONST_CAST(struct cls_rule *, cls_rule)->cls_match = NULL; - subtable = find_subtable(cls, &rule->match.mask); + /* Remove 'cls_rule' from the subtable's rules list. */ + rculist_remove(CONST_CAST(struct rculist *, &cls_rule->node)); + + subtable = find_subtable(cls, &cls_rule->match.mask); ovs_assert(subtable); + for (i = 0; i < subtable->n_indices; i++) { + ihash[i] = minimatch_hash_range(&cls_rule->match, prev_be64ofs, + subtable->index_ofs[i], &basis); + prev_be64ofs = subtable->index_ofs[i]; + } + hash = minimatch_hash_range(&cls_rule->match, prev_be64ofs, FLOW_U64S, + &basis); + + head = find_equal(subtable, &cls_rule->match.flow, hash); + + /* Check if the rule is not the head rule. */ + if (rule != head) { + struct cls_match *iter; + + /* Not the head rule, but potentially one with the same priority. */ + /* Remove from the list of equal rules. */ + FOR_EACH_RULE_IN_LIST_PROTECTED (iter, prev, head) { + if (rule == iter) { + break; + } + } + ovs_assert(iter == rule); + + cls_match_remove(prev, rule); + + goto check_priority; + } + + /* 'rule' is the head rule. Check if there is another rule to + * replace 'rule' in the data structures. */ + next = cls_match_next_protected(rule); + if (next) { + subtable_replace_head_rule(cls, subtable, rule, next, hash, ihash); + goto check_priority; + } + + /* 'rule' is last of the kind in the classifier, must remove from all the + * data structures. */ + if (subtable->ports_mask_len) { - ovs_be32 masked_ports = minimatch_get_ports(&rule->match); + ovs_be32 masked_ports = minimatch_get_ports(&cls_rule->match); trie_remove_prefix(&subtable->ports_trie, &masked_ports, subtable->ports_mask_len); } for (i = 0; i < cls->n_tries; i++) { if (subtable->trie_plen[i]) { - trie_remove(&cls->tries[i], rule, subtable->trie_plen[i]); + trie_remove(&cls->tries[i], cls_rule, subtable->trie_plen[i]); } } /* Remove rule node from indices. */ for (i = 0; i < subtable->n_indices; i++) { - hindex_remove(&subtable->indices[i], &cls_match->index_nodes[i]); - } - - head = find_equal(subtable, &rule->match.flow, cls_match->hmap_node.hash); - if (head != cls_match) { - list_remove(&cls_match->list); - } else if (list_is_empty(&cls_match->list)) { - hmap_remove(&subtable->rules, &cls_match->hmap_node); - } else { - struct cls_match *next = CONTAINER_OF(cls_match->list.next, - struct cls_match, list); - - list_remove(&cls_match->list); - hmap_replace(&subtable->rules, &cls_match->hmap_node, - &next->hmap_node); + cmap_remove(&subtable->indices[i], &rule->index_nodes[i], ihash[i]); } + n_rules = cmap_remove(&subtable->rules, &rule->cmap_node, hash); - partition = cls_match->partition; + partition = rule->partition; if (partition) { tag_tracker_subtract(&partition->tracker, &partition->tags, subtable->tag); if (!partition->tags) { - hmap_remove(&cls->partitions, &partition->hmap_node); - free(partition); + cmap_remove(&cls->partitions, &partition->cmap_node, + hash_metadata(partition->metadata)); + ovsrcu_postpone(free, partition); } } - if (--subtable->n_rules == 0) { + if (n_rules == 0) { destroy_subtable(cls, subtable); } else { - update_subtables_after_removal(cls, subtable, cls_match->priority); +check_priority: + if (subtable->max_priority == rule->priority + && --subtable->max_count == 0) { + /* Find the new 'max_priority' and 'max_count'. */ + int max_priority = INT_MIN; + struct cls_match *head; + + CMAP_FOR_EACH (head, cmap_node, &subtable->rules) { + if (head->priority > max_priority) { + max_priority = head->priority; + subtable->max_count = 1; + } else if (head->priority == max_priority) { + ++subtable->max_count; + } + } + subtable->max_priority = max_priority; + pvector_change_priority(&cls->subtables, subtable, max_priority); + } } + if (cls->publish) { + pvector_publish(&cls->subtables); + } + + /* free the rule. */ + conj_set = ovsrcu_get_protected(struct cls_conjunction_set *, + &rule->conj_set); + if (conj_set) { + ovsrcu_postpone(free, conj_set); + } + ovsrcu_postpone(cls_match_free_cb, rule); cls->n_rules--; - rule->cls_match = NULL; - free(cls_match); + return cls_rule; } /* Prefix tree context. Valid when 'lookup_done' is true. Can skip all - * subtables which have more than 'match_plen' bits in their corresponding - * field at offset 'be32ofs'. If skipped, 'maskbits' prefix bits should be - * unwildcarded to quarantee datapath flow matches only packets it should. */ + * subtables which have a prefix match on the trie field, but whose prefix + * length is not indicated in 'match_plens'. For example, a subtable that + * has a 8-bit trie field prefix match can be skipped if + * !be_get_bit_at(&match_plens, 8 - 1). If skipped, 'maskbits' prefix bits + * must be unwildcarded to make datapath flow only match packets it should. */ struct trie_ctx { const struct cls_trie *trie; bool lookup_done; /* Status of the lookup. */ uint8_t be32ofs; /* U32 offset of the field in question. */ - unsigned int match_plen; /* Longest prefix than could possibly match. */ unsigned int maskbits; /* Prefix length needed to avoid false matches. */ + union mf_value match_plens; /* Bitmask of prefix lengths with possible + * matches. */ }; static void @@ -1031,36 +943,114 @@ ctx->lookup_done = false; } -static inline void -lookahead_subtable(const struct cls_subtable_entry *subtables) +struct conjunctive_match { + struct hmap_node hmap_node; + uint32_t id; + uint64_t clauses; +}; + +static struct conjunctive_match * +find_conjunctive_match__(struct hmap *matches, uint64_t id, uint32_t hash) { - ovs_prefetch_range(subtables->subtable, sizeof *subtables->subtable); + struct conjunctive_match *m; + + HMAP_FOR_EACH_IN_BUCKET (m, hmap_node, hash, matches) { + if (m->id == id) { + return m; + } + } + return NULL; } -/* Finds and returns the highest-priority rule in 'cls' that matches 'flow'. - * Returns a null pointer if no rules in 'cls' match 'flow'. If multiple rules - * of equal priority match 'flow', returns one arbitrarily. - * - * If a rule is found and 'wc' is non-null, bitwise-OR's 'wc' with the - * set of bits that were significant in the lookup. At some point - * earlier, 'wc' should have been initialized (e.g., by - * flow_wildcards_init_catchall()). */ -struct cls_rule * -classifier_lookup(const struct classifier *cls_, const struct flow *flow, - struct flow_wildcards *wc) +static bool +find_conjunctive_match(const struct cls_conjunction_set *set, + unsigned int max_n_clauses, struct hmap *matches, + struct conjunctive_match *cm_stubs, size_t n_cm_stubs, + uint32_t *idp) +{ + const struct cls_conjunction *c; + + if (max_n_clauses < set->min_n_clauses) { + return false; + } + + for (c = set->conj; c < &set->conj[set->n]; c++) { + struct conjunctive_match *cm; + uint32_t hash; + + if (c->n_clauses > max_n_clauses) { + continue; + } + + hash = hash_int(c->id, 0); + cm = find_conjunctive_match__(matches, c->id, hash); + if (!cm) { + size_t n = hmap_count(matches); + + cm = n < n_cm_stubs ? &cm_stubs[n] : xmalloc(sizeof *cm); + hmap_insert(matches, &cm->hmap_node, hash); + cm->id = c->id; + cm->clauses = UINT64_MAX << (c->n_clauses & 63); + } + cm->clauses |= UINT64_C(1) << c->clause; + if (cm->clauses == UINT64_MAX) { + *idp = cm->id; + return true; + } + } + return false; +} + +static void +free_conjunctive_matches(struct hmap *matches, + struct conjunctive_match *cm_stubs, size_t n_cm_stubs) +{ + if (hmap_count(matches) > n_cm_stubs) { + struct conjunctive_match *cm, *next; + + HMAP_FOR_EACH_SAFE (cm, next, hmap_node, matches) { + if (!(cm >= cm_stubs && cm < &cm_stubs[n_cm_stubs])) { + free(cm); + } + } + } + hmap_destroy(matches); +} + +/* Like classifier_lookup(), except that support for conjunctive matches can be + * configured with 'allow_conjunctive_matches'. That feature is not exposed + * externally because turning off conjunctive matches is only useful to avoid + * recursion within this function itself. + * + * 'flow' is non-const to allow for temporary modifications during the lookup. + * Any changes are restored before returning. */ +static const struct cls_rule * +classifier_lookup__(const struct classifier *cls, cls_version_t version, + struct flow *flow, struct flow_wildcards *wc, + bool allow_conjunctive_matches) { - struct cls_classifier *cls = cls_->cls; const struct cls_partition *partition; - tag_type tags; - struct cls_match *best; struct trie_ctx trie_ctx[CLS_MAX_TRIES]; - int i; - struct cls_subtable_entry *subtables = cls->subtables_priority.subtables; - int n_subtables = cls->subtables_priority.size; - int64_t best_priority = -1; + const struct cls_match *match; + tag_type tags; - /* Prefetch the subtables array. */ - ovs_prefetch_range(subtables, n_subtables * sizeof *subtables); + /* Highest-priority flow in 'cls' that certainly matches 'flow'. */ + const struct cls_match *hard = NULL; + int hard_pri = INT_MIN; /* hard ? hard->priority : INT_MIN. */ + + /* Highest-priority conjunctive flows in 'cls' matching 'flow'. Since + * these are (components of) conjunctive flows, we can only know whether + * the full conjunctive flow matches after seeing multiple of them. Thus, + * we refer to these as "soft matches". */ + struct cls_conjunction_set *soft_stub[64]; + struct cls_conjunction_set **soft = soft_stub; + size_t n_soft = 0, allocated_soft = ARRAY_SIZE(soft_stub); + int soft_pri = INT_MIN; /* n_soft ? MAX(soft[*]->priority) : INT_MIN. */ + + /* Synchronize for cls->n_tries and subtable->trie_plen. They can change + * when table configuration changes, which happens typically only on + * startup. */ + atomic_thread_fence(memory_order_acquire); /* Determine 'tags' such that, if 'subtable->tag' doesn't intersect them, * then 'flow' cannot possibly match in 'subtable': @@ -1080,165 +1070,274 @@ * that 'tags' always intersects such a cls_subtable's 'tags', so we don't * need a special case. */ - partition = (hmap_is_empty(&cls->partitions) + partition = (cmap_is_empty(&cls->partitions) ? NULL : find_partition(cls, flow->metadata, hash_metadata(flow->metadata))); tags = partition ? partition->tags : TAG_ARBITRARY; - /* Initialize trie contexts for match_find_wc(). */ - for (i = 0; i < cls->n_tries; i++) { + /* Initialize trie contexts for find_match_wc(). */ + for (int i = 0; i < cls->n_tries; i++) { trie_ctx_init(&trie_ctx[i], &cls->tries[i]); } - /* Prefetch the first subtables. */ - if (n_subtables > 1) { - lookahead_subtable(subtables); - lookahead_subtable(subtables + 1); - } + /* Main loop. */ + struct cls_subtable *subtable; + PVECTOR_FOR_EACH_PRIORITY (subtable, hard_pri, 2, sizeof *subtable, + &cls->subtables) { + struct cls_conjunction_set *conj_set; - best = NULL; - for (i = 0; OVS_LIKELY(i < n_subtables); i++) { - struct cls_match *rule; - - if ((int64_t)subtables[i].max_priority <= best_priority) { - /* Subtables are in descending priority order, - * can not find anything better. */ - break; + /* Skip subtables not in our partition. */ + if (!tag_intersects(tags, subtable->tag)) { + continue; } - /* Prefetch a forthcoming subtable. */ - if (i + 2 < n_subtables) { - lookahead_subtable(&subtables[i + 2]); + /* Skip subtables with no match, or where the match is lower-priority + * than some certain match we've already found. */ + match = find_match_wc(subtable, version, flow, trie_ctx, cls->n_tries, + wc); + if (!match || match->priority <= hard_pri) { + continue; } - if (!tag_intersects(tags, subtables[i].tag)) { - continue; + conj_set = ovsrcu_get(struct cls_conjunction_set *, &match->conj_set); + if (!conj_set) { + /* 'match' isn't part of a conjunctive match. It's the best + * certain match we've got so far, since we know that it's + * higher-priority than hard_pri. + * + * (There might be a higher-priority conjunctive match. We can't + * tell yet.) */ + hard = match; + hard_pri = hard->priority; + } else if (allow_conjunctive_matches) { + /* 'match' is part of a conjunctive match. Add it to the list. */ + if (OVS_UNLIKELY(n_soft >= allocated_soft)) { + struct cls_conjunction_set **old_soft = soft; + + allocated_soft *= 2; + soft = xmalloc(allocated_soft * sizeof *soft); + memcpy(soft, old_soft, n_soft * sizeof *soft); + if (old_soft != soft_stub) { + free(old_soft); + } + } + soft[n_soft++] = conj_set; + + /* Keep track of the highest-priority soft match. */ + if (soft_pri < match->priority) { + soft_pri = match->priority; + } } + } - rule = find_match_wc(subtables[i].subtable, flow, trie_ctx, - cls->n_tries, wc); - if (rule && (int64_t)rule->priority > best_priority) { - best_priority = (int64_t)rule->priority; - best = rule; + /* In the common case, at this point we have no soft matches and we can + * return immediately. (We do the same thing if we have potential soft + * matches but none of them are higher-priority than our hard match.) */ + if (hard_pri >= soft_pri) { + if (soft != soft_stub) { + free(soft); } + return hard ? hard->cls_rule : NULL; } - return best ? best->cls_rule : NULL; -} + /* At this point, we have some soft matches. We might also have a hard + * match; if so, its priority is lower than the highest-priority soft + * match. */ -/* Returns true if 'target' satisifies 'match', that is, if each bit for which - * 'match' specifies a particular value has the correct value in 'target'. - * - * 'flow' and 'mask' have the same mask! */ -static bool -miniflow_and_mask_matches_miniflow(const struct miniflow *flow, - const struct minimask *mask, - const struct miniflow *target) -{ - const uint32_t *flowp = miniflow_get_u32_values(flow); - const uint32_t *maskp = miniflow_get_u32_values(&mask->masks); - uint32_t target_u32; + /* Soft match loop. + * + * Check whether soft matches are real matches. */ + for (;;) { + /* Delete soft matches that are null. This only happens in second and + * subsequent iterations of the soft match loop, when we drop back from + * a high-priority soft match to a lower-priority one. + * + * Also, delete soft matches whose priority is less than or equal to + * the hard match's priority. In the first iteration of the soft + * match, these can be in 'soft' because the earlier main loop found + * the soft match before the hard match. In second and later iteration + * of the soft match loop, these can be in 'soft' because we dropped + * back from a high-priority soft match to a lower-priority soft match. + * + * It is tempting to delete soft matches that cannot be satisfied + * because there are fewer soft matches than required to satisfy any of + * their conjunctions, but we cannot do that because there might be + * lower priority soft or hard matches with otherwise identical + * matches. (We could special case those here, but there's no + * need--we'll do so at the bottom of the soft match loop anyway and + * this duplicates less code.) + * + * It's also tempting to break out of the soft match loop if 'n_soft == + * 1' but that would also miss lower-priority hard matches. We could + * special case that also but again there's no need. */ + for (int i = 0; i < n_soft; ) { + if (!soft[i] || soft[i]->priority <= hard_pri) { + soft[i] = soft[--n_soft]; + } else { + i++; + } + } + if (!n_soft) { + break; + } - MINIFLOW_FOR_EACH_IN_MAP(target_u32, target, mask->masks.map) { - if ((*flowp++ ^ target_u32) & *maskp++) { - return false; + /* Find the highest priority among the soft matches. (We know this + * must be higher than the hard match's priority; otherwise we would + * have deleted all of the soft matches in the previous loop.) Count + * the number of soft matches that have that priority. */ + soft_pri = INT_MIN; + int n_soft_pri = 0; + for (int i = 0; i < n_soft; i++) { + if (soft[i]->priority > soft_pri) { + soft_pri = soft[i]->priority; + n_soft_pri = 1; + } else if (soft[i]->priority == soft_pri) { + n_soft_pri++; + } } - } + ovs_assert(soft_pri > hard_pri); - return true; -} + /* Look for a real match among the highest-priority soft matches. + * + * It's unusual to have many conjunctive matches, so we use stubs to + * avoid calling malloc() in the common case. An hmap has a built-in + * stub for up to 2 hmap_nodes; possibly, we would benefit a variant + * with a bigger stub. */ + struct conjunctive_match cm_stubs[16]; + struct hmap matches; + + hmap_init(&matches); + for (int i = 0; i < n_soft; i++) { + uint32_t id; + + if (soft[i]->priority == soft_pri + && find_conjunctive_match(soft[i], n_soft_pri, &matches, + cm_stubs, ARRAY_SIZE(cm_stubs), + &id)) { + uint32_t saved_conj_id = flow->conj_id; + const struct cls_rule *rule; + + flow->conj_id = id; + rule = classifier_lookup__(cls, version, flow, wc, false); + flow->conj_id = saved_conj_id; + + if (rule) { + free_conjunctive_matches(&matches, + cm_stubs, ARRAY_SIZE(cm_stubs)); + if (soft != soft_stub) { + free(soft); + } + return rule; + } + } + } + free_conjunctive_matches(&matches, cm_stubs, ARRAY_SIZE(cm_stubs)); -static inline struct cls_match * -find_match_miniflow(const struct cls_subtable *subtable, - const struct miniflow *flow, - uint32_t hash) -{ - struct cls_match *rule; - - HMAP_FOR_EACH_WITH_HASH (rule, hmap_node, hash, &subtable->rules) { - if (miniflow_and_mask_matches_miniflow(&rule->flow, &subtable->mask, - flow)) { - return rule; + /* There's no real match among the highest-priority soft matches. + * However, if any of those soft matches has a lower-priority but + * otherwise identical flow match, then we need to consider those for + * soft or hard matches. + * + * The next iteration of the soft match loop will delete any null + * pointers we put into 'soft' (and some others too). */ + for (int i = 0; i < n_soft; i++) { + if (soft[i]->priority != soft_pri) { + continue; + } + + /* Find next-lower-priority flow with identical flow match. */ + match = next_visible_rule_in_list(soft[i]->match, version); + if (match) { + soft[i] = ovsrcu_get(struct cls_conjunction_set *, + &match->conj_set); + if (!soft[i]) { + /* The flow is a hard match; don't treat as a soft + * match. */ + if (match->priority > hard_pri) { + hard = match; + hard_pri = hard->priority; + } + } + } else { + /* No such lower-priority flow (probably the common case). */ + soft[i] = NULL; + } } } - return NULL; + if (soft != soft_stub) { + free(soft); + } + return hard ? hard->cls_rule : NULL; } -/* Finds and returns the highest-priority rule in 'cls' that matches - * 'miniflow'. Returns a null pointer if no rules in 'cls' match 'flow'. - * If multiple rules of equal priority match 'flow', returns one arbitrarily. +/* Finds and returns the highest-priority rule in 'cls' that matches 'flow' and + * that is visible in 'version'. Returns a null pointer if no rules in 'cls' + * match 'flow'. If multiple rules of equal priority match 'flow', returns one + * arbitrarily. * - * This function is optimized for the userspace datapath, which only ever has - * one priority value for it's flows! - */ -struct cls_rule *classifier_lookup_miniflow_first(const struct classifier *cls_, - const struct miniflow *flow) + * If a rule is found and 'wc' is non-null, bitwise-OR's 'wc' with the + * set of bits that were significant in the lookup. At some point + * earlier, 'wc' should have been initialized (e.g., by + * flow_wildcards_init_catchall()). + * + * 'flow' is non-const to allow for temporary modifications during the lookup. + * Any changes are restored before returning. */ +const struct cls_rule * +classifier_lookup(const struct classifier *cls, cls_version_t version, + struct flow *flow, struct flow_wildcards *wc) { - struct cls_classifier *cls = cls_->cls; - struct cls_subtable *subtable; - struct cls_subtable_entry *iter; - - CLS_SUBTABLE_CACHE_FOR_EACH (subtable, iter, &cls->subtables_priority) { - struct cls_match *rule; - - rule = find_match_miniflow(subtable, flow, - miniflow_hash_in_minimask(flow, - &subtable->mask, - 0)); - if (rule) { - return rule->cls_rule; - } - } - - return NULL; + return classifier_lookup__(cls, version, flow, wc, true); } /* Finds and returns a rule in 'cls' with exactly the same priority and - * matching criteria as 'target'. Returns a null pointer if 'cls' doesn't + * matching criteria as 'target', and that is visible in 'target->version. + * Only one such rule may ever exist. Returns a null pointer if 'cls' doesn't * contain an exact match. */ -struct cls_rule * -classifier_find_rule_exactly(const struct classifier *cls_, +const struct cls_rule * +classifier_find_rule_exactly(const struct classifier *cls, const struct cls_rule *target) { - struct cls_classifier *cls = cls_->cls; - struct cls_match *head, *rule; - struct cls_subtable *subtable; + const struct cls_match *head, *rule; + const struct cls_subtable *subtable; subtable = find_subtable(cls, &target->match.mask); if (!subtable) { return NULL; } - /* Skip if there is no hope. */ - if (target->priority > subtable->max_priority) { - return NULL; - } - head = find_equal(subtable, &target->match.flow, miniflow_hash_in_minimask(&target->match.flow, &target->match.mask, 0)); - FOR_EACH_RULE_IN_LIST (rule, head) { - if (target->priority >= rule->priority) { - return target->priority == rule->priority ? rule->cls_rule : NULL; + if (!head) { + return NULL; + } + CLS_MATCH_FOR_EACH (rule, head) { + if (rule->priority < target->priority) { + break; /* Not found. */ + } + if (rule->priority == target->priority + && cls_match_visible_in_version(rule, target->version)) { + return rule->cls_rule; } } return NULL; } /* Finds and returns a rule in 'cls' with priority 'priority' and exactly the - * same matching criteria as 'target'. Returns a null pointer if 'cls' doesn't - * contain an exact match. */ -struct cls_rule * + * same matching criteria as 'target', and that is visible in 'version'. + * Returns a null pointer if 'cls' doesn't contain an exact match visible in + * 'version'. */ +const struct cls_rule * classifier_find_match_exactly(const struct classifier *cls, - const struct match *target, - unsigned int priority) + const struct match *target, int priority, + cls_version_t version) { - struct cls_rule *retval; + const struct cls_rule *retval; struct cls_rule cr; - cls_rule_init(&cr, target, priority); + cls_rule_init(&cr, target, priority, version); retval = classifier_find_rule_exactly(cls, &cr); cls_rule_destroy(&cr); @@ -1247,42 +1346,37 @@ /* Checks if 'target' would overlap any other rule in 'cls'. Two rules are * considered to overlap if both rules have the same priority and a packet - * could match both. */ + * could match both, and if both rules are visible in the same version. + * + * A trivial example of overlapping rules is two rules matching disjoint sets + * of fields. E.g., if one rule matches only on port number, while another only + * on dl_type, any packet from that specific port and with that specific + * dl_type could match both, if the rules also have the same priority. */ bool -classifier_rule_overlaps(const struct classifier *cls_, +classifier_rule_overlaps(const struct classifier *cls, const struct cls_rule *target) { - struct cls_classifier *cls = cls_->cls; struct cls_subtable *subtable; - struct cls_subtable_entry *iter; /* Iterate subtables in the descending max priority order. */ - CLS_SUBTABLE_CACHE_FOR_EACH (subtable, iter, &cls->subtables_priority) { - uint32_t storage[FLOW_U32S]; + PVECTOR_FOR_EACH_PRIORITY (subtable, target->priority - 1, 2, + sizeof(struct cls_subtable), &cls->subtables) { + uint64_t storage[FLOW_U64S]; struct minimask mask; - struct cls_match *head; - - if (target->priority > iter->max_priority) { - break; /* Can skip this and the rest of the subtables. */ - } + const struct cls_rule *rule; minimask_combine(&mask, &target->match.mask, &subtable->mask, storage); - HMAP_FOR_EACH (head, hmap_node, &subtable->rules) { - struct cls_match *rule; - FOR_EACH_RULE_IN_LIST (rule, head) { - if (rule->priority < target->priority) { - break; /* Rules in descending priority order. */ - } - if (rule->priority == target->priority - && miniflow_equal_in_minimask(&target->match.flow, - &rule->flow, &mask)) { - return true; - } + RCULIST_FOR_EACH (rule, node, &subtable->rules_list) { + if (rule->priority == target->priority + && miniflow_equal_in_minimask(&target->match.flow, + &rule->match.flow, &mask) + && cls_match_visible_in_version(rule->cls_match, + target->version)) { + return true; } } } - return false; } @@ -1330,24 +1424,29 @@ /* Iteration. */ +/* Rule may only match a target if it is visible in target's version. For NULL + * target we only return rules that are not invisible in any version. */ static bool -rule_matches(const struct cls_match *rule, const struct cls_rule *target) +rule_matches(const struct cls_rule *rule, const struct cls_rule *target) { - return (!target - || miniflow_equal_in_minimask(&rule->flow, - &target->match.flow, - &target->match.mask)); + /* Iterators never see duplicate rules with the same priority. */ + return target + ? (miniflow_equal_in_minimask(&rule->match.flow, &target->match.flow, + &target->match.mask) + && cls_match_visible_in_version(rule->cls_match, target->version)) + : !cls_match_is_eventually_invisible(rule->cls_match); } -static struct cls_match * +static const struct cls_rule * search_subtable(const struct cls_subtable *subtable, - const struct cls_rule *target) + struct cls_cursor *cursor) { - if (!target || !minimask_has_extra(&subtable->mask, &target->match.mask)) { - struct cls_match *rule; + if (!cursor->target + || !minimask_has_extra(&subtable->mask, &cursor->target->match.mask)) { + const struct cls_rule *rule; - HMAP_FOR_EACH (rule, hmap_node, &subtable->rules) { - if (rule_matches(rule, target)) { + RCULIST_FOR_EACH (rule, node, &subtable->rules_list) { + if (rule_matches(rule, cursor->target)) { return rule; } } @@ -1355,83 +1454,85 @@ return NULL; } -/* Initializes 'cursor' for iterating through rules in 'cls': +/* Initializes 'cursor' for iterating through rules in 'cls', and returns the + * first matching cls_rule via '*pnode', or NULL if there are no matches. * - * - If 'target' is null, the cursor will visit every rule in 'cls'. + * - If 'target' is null, or if the 'target' is a catchall target and the + * target's version is CLS_MAX_VERSION, the cursor will visit every rule + * in 'cls' that is not invisible in any version. * * - If 'target' is nonnull, the cursor will visit each 'rule' in 'cls' - * such that cls_rule_is_loose_match(rule, target) returns true. + * such that cls_rule_is_loose_match(rule, target) returns true and that + * the rule is visible in 'target->version'. * * Ignores target->priority. */ -void -cls_cursor_init(struct cls_cursor *cursor, const struct classifier *cls, - const struct cls_rule *target) -{ - cursor->cls = cls->cls; - cursor->target = target && !cls_rule_is_catchall(target) ? target : NULL; -} - -/* Returns the first matching cls_rule in 'cursor''s iteration, or a null - * pointer if there are no matches. */ -struct cls_rule * -cls_cursor_first(struct cls_cursor *cursor) +struct cls_cursor +cls_cursor_start(const struct classifier *cls, const struct cls_rule *target) { + struct cls_cursor cursor; struct cls_subtable *subtable; - HMAP_FOR_EACH (subtable, hmap_node, &cursor->cls->subtables) { - struct cls_match *rule = search_subtable(subtable, cursor->target); + cursor.cls = cls; + cursor.target = target && (!cls_rule_is_catchall(target) + || target->version != CLS_MAX_VERSION) + ? target : NULL; + cursor.rule = NULL; + + /* Find first rule. */ + PVECTOR_CURSOR_FOR_EACH (subtable, &cursor.subtables, + &cursor.cls->subtables) { + const struct cls_rule *rule = search_subtable(subtable, &cursor); + if (rule) { - cursor->subtable = subtable; - return rule->cls_rule; + cursor.subtable = subtable; + cursor.rule = rule; + break; } } - return NULL; + return cursor; } -/* Returns the next matching cls_rule in 'cursor''s iteration, or a null - * pointer if there are no more matches. */ -struct cls_rule * -cls_cursor_next(struct cls_cursor *cursor, const struct cls_rule *rule_) +static const struct cls_rule * +cls_cursor_next(struct cls_cursor *cursor) { - struct cls_match *rule = CONST_CAST(struct cls_match *, rule_->cls_match); + const struct cls_rule *rule; const struct cls_subtable *subtable; - struct cls_match *next; - - next = next_rule_in_list__(rule); - if (next->priority < rule->priority) { - return next->cls_rule; - } - /* 'next' is the head of the list, that is, the rule that is included in - * the subtable's hmap. (This is important when the classifier contains - * rules that differ only in priority.) */ - rule = next; - HMAP_FOR_EACH_CONTINUE (rule, hmap_node, &cursor->subtable->rules) { + rule = cursor->rule; + subtable = cursor->subtable; + RCULIST_FOR_EACH_CONTINUE (rule, node, &subtable->rules_list) { if (rule_matches(rule, cursor->target)) { - return rule->cls_rule; + return rule; } } - subtable = cursor->subtable; - HMAP_FOR_EACH_CONTINUE (subtable, hmap_node, &cursor->cls->subtables) { - rule = search_subtable(subtable, cursor->target); + PVECTOR_CURSOR_FOR_EACH_CONTINUE (subtable, &cursor->subtables) { + rule = search_subtable(subtable, cursor); if (rule) { cursor->subtable = subtable; - return rule->cls_rule; + return rule; } } return NULL; } + +/* Sets 'cursor->rule' to the next matching cls_rule in 'cursor''s iteration, + * or to null if all matching rules have been visited. */ +void +cls_cursor_advance(struct cls_cursor *cursor) +{ + cursor->rule = cls_cursor_next(cursor); +} static struct cls_subtable * -find_subtable(const struct cls_classifier *cls, const struct minimask *mask) +find_subtable(const struct classifier *cls, const struct minimask *mask) { struct cls_subtable *subtable; - HMAP_FOR_EACH_IN_BUCKET (subtable, hmap_node, minimask_hash(mask, 0), - &cls->subtables) { + CMAP_FOR_EACH_WITH_HASH (subtable, cmap_node, minimask_hash(mask, 0), + &cls->subtables_map) { if (minimask_equal(mask, &subtable->mask)) { return subtable; } @@ -1439,21 +1540,22 @@ return NULL; } +/* The new subtable will be visible to the readers only after this. */ static struct cls_subtable * -insert_subtable(struct cls_classifier *cls, const struct minimask *mask) +insert_subtable(struct classifier *cls, const struct minimask *mask) { uint32_t hash = minimask_hash(mask, 0); struct cls_subtable *subtable; int i, index = 0; struct flow_wildcards old, new; uint8_t prev; - struct cls_subtable_entry elem; int count = count_1bits(mask->masks.map); subtable = xzalloc(sizeof *subtable - sizeof mask->masks.inline_values + MINIFLOW_VALUES_SIZE(count)); - hmap_init(&subtable->rules); - miniflow_clone_inline(&subtable->mask.masks, &mask->masks, count); + cmap_init(&subtable->rules); + miniflow_clone_inline(CONST_CAST(struct miniflow *, &subtable->mask.masks), + &mask->masks, count); /* Init indices for segmented lookup, if any. */ flow_wildcards_init_catchall(&new); @@ -1464,8 +1566,9 @@ cls->flow_segments[i]); /* Add an index if it adds mask bits. */ if (!flow_wildcards_equal(&new, &old)) { - hindex_init(&subtable->indices[index]); - subtable->index_ofs[index] = cls->flow_segments[i]; + cmap_init(&subtable->indices[index]); + *CONST_CAST(uint8_t *, &subtable->index_ofs[index]) + = cls->flow_segments[i]; index++; old = new; } @@ -1474,18 +1577,19 @@ /* Check if the rest of the subtable's mask adds any bits, * and remove the last index if it doesn't. */ if (index > 0) { - flow_wildcards_fold_minimask_range(&new, mask, prev, FLOW_U32S); + flow_wildcards_fold_minimask_range(&new, mask, prev, FLOW_U64S); if (flow_wildcards_equal(&new, &old)) { --index; - subtable->index_ofs[index] = 0; - hindex_destroy(&subtable->indices[index]); + *CONST_CAST(uint8_t *, &subtable->index_ofs[index]) = 0; + cmap_destroy(&subtable->indices[index]); } } - subtable->n_indices = index; + *CONST_CAST(uint8_t *, &subtable->n_indices) = index; - subtable->tag = (minimask_get_metadata_mask(mask) == OVS_BE64_MAX - ? tag_create_deterministic(hash) - : TAG_ALL); + *CONST_CAST(tag_type *, &subtable->tag) = + (minimask_get_metadata_mask(mask) == OVS_BE64_MAX + ? tag_create_deterministic(hash) + : TAG_ALL); for (i = 0; i < cls->n_tries; i++) { subtable->trie_plen[i] = minimask_get_prefix_len(mask, @@ -1493,151 +1597,38 @@ } /* Ports trie. */ - subtable->ports_trie = NULL; - subtable->ports_mask_len + ovsrcu_set_hidden(&subtable->ports_trie, NULL); + *CONST_CAST(int *, &subtable->ports_mask_len) = 32 - ctz32(ntohl(MINIFLOW_GET_BE32(&mask->masks, tp_src))); - hmap_insert(&cls->subtables, &subtable->hmap_node, hash); - elem.subtable = subtable; - elem.tag = subtable->tag; - elem.max_priority = subtable->max_priority; - cls_subtable_cache_push_back(&cls->subtables_priority, elem); + /* List of rules. */ + rculist_init(&subtable->rules_list); + + cmap_insert(&cls->subtables_map, &subtable->cmap_node, hash); return subtable; } +/* RCU readers may still access the subtable before it is actually freed. */ static void -destroy_subtable(struct cls_classifier *cls, struct cls_subtable *subtable) +destroy_subtable(struct classifier *cls, struct cls_subtable *subtable) { int i; - struct cls_subtable *table = NULL; - struct cls_subtable_entry *iter; - - CLS_SUBTABLE_CACHE_FOR_EACH (table, iter, &cls->subtables_priority) { - if (table == subtable) { - cls_subtable_cache_remove(&cls->subtables_priority, iter); - break; - } - } - trie_destroy(subtable->ports_trie); + pvector_remove(&cls->subtables, subtable); + cmap_remove(&cls->subtables_map, &subtable->cmap_node, + minimask_hash(&subtable->mask, 0)); + + ovs_assert(ovsrcu_get_protected(struct trie_node *, &subtable->ports_trie) + == NULL); + ovs_assert(cmap_is_empty(&subtable->rules)); + ovs_assert(rculist_is_empty(&subtable->rules_list)); for (i = 0; i < subtable->n_indices; i++) { - hindex_destroy(&subtable->indices[i]); - } - minimask_destroy(&subtable->mask); - hmap_remove(&cls->subtables, &subtable->hmap_node); - hmap_destroy(&subtable->rules); - free(subtable); -} - -/* This function performs the following updates for 'subtable' in 'cls' - * following the addition of a new rule with priority 'new_priority' to - * 'subtable': - * - * - Update 'subtable->max_priority' and 'subtable->max_count' if necessary. - * - * - Update 'subtable''s position in 'cls->subtables_priority' if necessary. - * - * This function should only be called after adding a new rule, not after - * replacing a rule by an identical one or modifying a rule in-place. */ -static void -update_subtables_after_insertion(struct cls_classifier *cls, - struct cls_subtable *subtable, - unsigned int new_priority) -{ - if (new_priority == subtable->max_priority) { - ++subtable->max_count; - } else if (new_priority > subtable->max_priority) { - struct cls_subtable *table; - struct cls_subtable_entry *iter, *from = NULL; - - subtable->max_priority = new_priority; - subtable->max_count = 1; - - /* Possibly move 'subtable' earlier in the priority array. If - * we break out of the loop, then the subtable (at 'from') - * should be moved to the position right after the current - * element. If the loop terminates normally, then 'iter' will - * be at the first array element and we'll move the subtable - * to the front of the array. */ - CLS_SUBTABLE_CACHE_FOR_EACH_REVERSE (table, iter, - &cls->subtables_priority) { - if (table == subtable) { - from = iter; /* Locate the subtable as we go. */ - iter->max_priority = new_priority; - } else if (table->max_priority >= new_priority) { - if (from == NULL) { - /* Corrupted cache? */ - cls_subtable_cache_reset(cls); - VLOG_ABORT("update_subtables_after_insertion(): Subtable priority list corrupted."); - OVS_NOT_REACHED(); - } - iter++; /* After this. */ - break; - } - } - - /* Move subtable at 'from' to 'iter'. */ - cls_subtable_cache_move(iter, from); - } -} - -/* This function performs the following updates for 'subtable' in 'cls' - * following the deletion of a rule with priority 'del_priority' from - * 'subtable': - * - * - Update 'subtable->max_priority' and 'subtable->max_count' if necessary. - * - * - Update 'subtable''s position in 'cls->subtables_priority' if necessary. - * - * This function should only be called after removing a rule, not after - * replacing a rule by an identical one or modifying a rule in-place. */ -static void -update_subtables_after_removal(struct cls_classifier *cls, - struct cls_subtable *subtable, - unsigned int del_priority) -{ - if (del_priority == subtable->max_priority && --subtable->max_count == 0) { - struct cls_match *head; - struct cls_subtable *table; - struct cls_subtable_entry *iter, *from = NULL; - - subtable->max_priority = 0; - HMAP_FOR_EACH (head, hmap_node, &subtable->rules) { - if (head->priority > subtable->max_priority) { - subtable->max_priority = head->priority; - subtable->max_count = 1; - } else if (head->priority == subtable->max_priority) { - ++subtable->max_count; - } - } - - /* Possibly move 'subtable' later in the priority array. - * After the loop the 'iter' will point right after the position - * at which the subtable should be moved (either at a subtable - * with an equal or lower priority, or just past the array), - * so it is decremented once. */ - CLS_SUBTABLE_CACHE_FOR_EACH (table, iter, &cls->subtables_priority) { - if (table == subtable) { - from = iter; /* Locate the subtable as we go. */ - iter->max_priority = subtable->max_priority; - } else if (table->max_priority <= subtable->max_priority) { - if (from == NULL) { - /* Corrupted cache? */ - cls_subtable_cache_reset(cls); - VLOG_ABORT("update_subtables_after_removal(): Subtable priority list corrupted."); - OVS_NOT_REACHED(); - } - break; - } - } - /* Now at one past the destination. */ - iter--; - - /* Move subtable at 'from' to 'iter'. */ - cls_subtable_cache_move(iter, from); + cmap_destroy(&subtable->indices[i]); } + cmap_destroy(&subtable->rules); + ovsrcu_postpone(free, subtable); } struct range { @@ -1645,6 +1636,8 @@ uint8_t end; }; +static unsigned int be_get_bit_at(const ovs_be32 value[], unsigned int ofs); + /* Return 'true' if can skip rest of the subtable based on the prefix trie * lookup results. */ static inline bool @@ -1663,40 +1656,39 @@ if (field_plen[j]) { struct trie_ctx *ctx = &trie_ctx[j]; uint8_t be32ofs = ctx->be32ofs; + uint8_t be64ofs = be32ofs / 2; /* Is the trie field within the current range of fields? */ - if (be32ofs >= ofs.start && be32ofs < ofs.end) { + if (be64ofs >= ofs.start && be64ofs < ofs.end) { /* On-demand trie lookup. */ if (!ctx->lookup_done) { - ctx->match_plen = trie_lookup(ctx->trie, flow, - &ctx->maskbits); + memset(&ctx->match_plens, 0, sizeof ctx->match_plens); + ctx->maskbits = trie_lookup(ctx->trie, flow, + &ctx->match_plens); ctx->lookup_done = true; } /* Possible to skip the rest of the subtable if subtable's - * prefix on the field is longer than what is known to match - * based on the trie lookup. */ - if (field_plen[j] > ctx->match_plen) { - /* RFC: We want the trie lookup to never result in - * unwildcarding any bits that would not be unwildcarded - * otherwise. Since the trie is shared by the whole - * classifier, it is possible that the 'maskbits' contain - * bits that are irrelevant for the partition of the - * classifier relevant for the current flow. */ + * prefix on the field is not included in the lookup result. */ + if (!be_get_bit_at(&ctx->match_plens.be32, field_plen[j] - 1)) { + /* We want the trie lookup to never result in unwildcarding + * any bits that would not be unwildcarded otherwise. + * Since the trie is shared by the whole classifier, it is + * possible that the 'maskbits' contain bits that are + * irrelevant for the partition relevant for the current + * packet. Hence the checks below. */ - /* Can skip if the field is already unwildcarded. */ - if (mask_prefix_bits_set(wc, be32ofs, ctx->maskbits)) { - return true; - } /* Check that the trie result will not unwildcard more bits - * than this stage will. */ + * than this subtable would otherwise. */ if (ctx->maskbits <= field_plen[j]) { /* Unwildcard the bits and skip the rest. */ mask_set_prefix_bits(wc, be32ofs, ctx->maskbits); /* Note: Prerequisite already unwildcarded, as the only * prerequisite of the supported trie lookup fields is - * the ethertype, which is currently always - * unwildcarded. - */ + * the ethertype, which is always unwildcarded. */ + return true; + } + /* Can skip if the field is already unwildcarded. */ + if (mask_prefix_bits_set(wc, be32ofs, ctx->maskbits)) { return true; } } @@ -1711,19 +1703,22 @@ * value has the correct value in 'target'. * * This function is equivalent to miniflow_equal_flow_in_minimask(flow, - * target, mask) but it is faster because of the invariant that - * flow->map and mask->masks.map are the same. */ + * target, mask) but this is faster because of the invariant that + * flow->map and mask->masks.map are the same, and that this version + * takes the 'wc'. */ static inline bool miniflow_and_mask_matches_flow(const struct miniflow *flow, const struct minimask *mask, const struct flow *target) { - const uint32_t *flowp = miniflow_get_u32_values(flow); - const uint32_t *maskp = miniflow_get_u32_values(&mask->masks); - uint32_t target_u32; + const uint64_t *flowp = miniflow_get_values(flow); + const uint64_t *maskp = miniflow_get_values(&mask->masks); + int idx; + + MAP_FOR_EACH_INDEX(idx, mask->masks.map) { + uint64_t diff = (*flowp++ ^ flow_u64_value(target, idx)) & *maskp++; - FLOW_FOR_EACH_IN_MAP(target_u32, target, mask->masks.map) { - if ((*flowp++ ^ target_u32) & *maskp++) { + if (diff) { return false; } } @@ -1731,227 +1726,186 @@ return true; } -static inline struct cls_match * -find_match(const struct cls_subtable *subtable, const struct flow *flow, - uint32_t hash) -{ - struct cls_match *rule; - - HMAP_FOR_EACH_WITH_HASH (rule, hmap_node, hash, &subtable->rules) { - if (miniflow_and_mask_matches_flow(&rule->flow, &subtable->mask, - flow)) { - return rule; +static inline const struct cls_match * +find_match(const struct cls_subtable *subtable, cls_version_t version, + const struct flow *flow, uint32_t hash) +{ + const struct cls_match *head, *rule; + + CMAP_FOR_EACH_WITH_HASH (head, cmap_node, hash, &subtable->rules) { + if (OVS_LIKELY(miniflow_and_mask_matches_flow(&head->flow, + &subtable->mask, + flow))) { + /* Return highest priority rule that is visible. */ + CLS_MATCH_FOR_EACH (rule, head) { + if (OVS_LIKELY(cls_match_visible_in_version(rule, version))) { + return rule; + } + } } } return NULL; } -static struct cls_match * -find_match_wc(const struct cls_subtable *subtable, const struct flow *flow, - struct trie_ctx trie_ctx[CLS_MAX_TRIES], unsigned int n_tries, - struct flow_wildcards *wc) +/* Returns true if 'target' satisifies 'flow'/'mask', that is, if each bit + * for which 'flow', for which 'mask' has a bit set, specifies a particular + * value has the correct value in 'target'. + * + * This function is equivalent to miniflow_and_mask_matches_flow() but this + * version fills in the mask bits in 'wc'. */ +static inline bool +miniflow_and_mask_matches_flow_wc(const struct miniflow *flow, + const struct minimask *mask, + const struct flow *target, + struct flow_wildcards *wc) +{ + const uint64_t *flowp = miniflow_get_values(flow); + const uint64_t *maskp = miniflow_get_values(&mask->masks); + int idx; + + MAP_FOR_EACH_INDEX(idx, mask->masks.map) { + uint64_t mask = *maskp++; + uint64_t diff = (*flowp++ ^ flow_u64_value(target, idx)) & mask; + + if (diff) { + /* Only unwildcard if none of the differing bits is already + * exact-matched. */ + if (!(flow_u64_value(&wc->masks, idx) & diff)) { + /* Keep one bit of the difference. The selected bit may be + * different in big-endian v.s. little-endian systems. */ + *flow_u64_lvalue(&wc->masks, idx) |= rightmost_1bit(diff); + } + return false; + } + /* Fill in the bits that were looked at. */ + *flow_u64_lvalue(&wc->masks, idx) |= mask; + } + + return true; +} + +/* Unwildcard the fields looked up so far, if any. */ +static void +fill_range_wc(const struct cls_subtable *subtable, struct flow_wildcards *wc, + uint8_t to) +{ + if (to) { + flow_wildcards_fold_minimask_range(wc, &subtable->mask, 0, to); + } +} + +static const struct cls_match * +find_match_wc(const struct cls_subtable *subtable, cls_version_t version, + const struct flow *flow, struct trie_ctx trie_ctx[CLS_MAX_TRIES], + unsigned int n_tries, struct flow_wildcards *wc) { uint32_t basis = 0, hash; - struct cls_match *rule = NULL; + const struct cls_match *rule = NULL; int i; struct range ofs; if (OVS_UNLIKELY(!wc)) { - return find_match(subtable, flow, + return find_match(subtable, version, flow, flow_hash_in_minimask(flow, &subtable->mask, 0)); } ofs.start = 0; /* Try to finish early by checking fields in segments. */ for (i = 0; i < subtable->n_indices; i++) { - struct hindex_node *inode; + const struct cmap_node *inode; + ofs.end = subtable->index_ofs[i]; if (check_tries(trie_ctx, n_tries, subtable->trie_plen, ofs, flow, wc)) { - goto range_out; + /* 'wc' bits for the trie field set, now unwildcard the preceding + * bits used so far. */ + fill_range_wc(subtable, wc, ofs.start); + return NULL; } hash = flow_hash_in_minimask_range(flow, &subtable->mask, ofs.start, ofs.end, &basis); - ofs.start = ofs.end; - inode = hindex_node_with_hash(&subtable->indices[i], hash); + inode = cmap_find(&subtable->indices[i], hash); if (!inode) { - /* No match, can stop immediately, but must fold in the mask - * covered so far. */ - goto range_out; + /* No match, can stop immediately, but must fold in the bits + * used in lookup so far. */ + fill_range_wc(subtable, wc, ofs.end); + return NULL; } /* If we have narrowed down to a single rule already, check whether - * that rule matches. If it does match, then we're done. If it does - * not match, then we know that we will never get a match, but we do - * not yet know how many wildcards we need to fold into 'wc' so we - * continue iterating through indices to find that out. (We won't - * waste time calling miniflow_and_mask_matches_flow() again because - * we've set 'rule' nonnull.) - * - * This check shows a measurable benefit with non-trivial flow tables. + * that rule matches. Either way, we're done. * * (Rare) hash collisions may cause us to miss the opportunity for this * optimization. */ - if (!inode->s && !rule) { - ASSIGN_CONTAINER(rule, inode - i, index_nodes); - if (miniflow_and_mask_matches_flow(&rule->flow, &subtable->mask, - flow)) { - goto out; + if (!cmap_node_next(inode)) { + const struct cls_match *head; + + ASSIGN_CONTAINER(head, inode - i, index_nodes); + if (miniflow_and_mask_matches_flow_wc(&head->flow, &subtable->mask, + flow, wc)) { + /* Return highest priority rule that is visible. */ + CLS_MATCH_FOR_EACH (rule, head) { + if (OVS_LIKELY(cls_match_visible_in_version(rule, + version))) { + return rule; + } + } } + return NULL; } + ofs.start = ofs.end; } - ofs.end = FLOW_U32S; + ofs.end = FLOW_U64S; /* Trie check for the final range. */ if (check_tries(trie_ctx, n_tries, subtable->trie_plen, ofs, flow, wc)) { - goto range_out; - } - if (!rule) { - /* Multiple potential matches exist, look for one. */ - hash = flow_hash_in_minimask_range(flow, &subtable->mask, ofs.start, - ofs.end, &basis); - rule = find_match(subtable, flow, hash); - } else { - /* We already narrowed the matching candidates down to just 'rule', - * but it didn't match. */ - rule = NULL; + fill_range_wc(subtable, wc, ofs.start); + return NULL; } + hash = flow_hash_in_minimask_range(flow, &subtable->mask, ofs.start, + ofs.end, &basis); + rule = find_match(subtable, version, flow, hash); if (!rule && subtable->ports_mask_len) { /* Ports are always part of the final range, if any. * No match was found for the ports. Use the ports trie to figure out * which ports bits to unwildcard. */ unsigned int mbits; - ovs_be32 value, mask; + ovs_be32 value, plens, mask; mask = MINIFLOW_GET_BE32(&subtable->mask.masks, tp_src); value = ((OVS_FORCE ovs_be32 *)flow)[TP_PORTS_OFS32] & mask; - trie_lookup_value(subtable->ports_trie, &value, 32, &mbits); + mbits = trie_lookup_value(&subtable->ports_trie, &value, &plens, 32); ((OVS_FORCE ovs_be32 *)&wc->masks)[TP_PORTS_OFS32] |= mask & be32_prefix_mask(mbits); - ofs.start = TP_PORTS_OFS32; - goto range_out; + /* Unwildcard all bits in the mask upto the ports, as they were used + * to determine there is no match. */ + fill_range_wc(subtable, wc, TP_PORTS_OFS64); + return NULL; } - out: + /* Must unwildcard all the fields, as they were looked at. */ flow_wildcards_fold_minimask(wc, &subtable->mask); return rule; - - range_out: - /* Must unwildcard the fields looked up so far, if any. */ - if (ofs.start) { - flow_wildcards_fold_minimask_range(wc, &subtable->mask, 0, ofs.start); - } - return NULL; } static struct cls_match * -find_equal(struct cls_subtable *subtable, const struct miniflow *flow, +find_equal(const struct cls_subtable *subtable, const struct miniflow *flow, uint32_t hash) { struct cls_match *head; - HMAP_FOR_EACH_WITH_HASH (head, hmap_node, hash, &subtable->rules) { + CMAP_FOR_EACH_WITH_HASH (head, cmap_node, hash, &subtable->rules) { if (miniflow_equal(&head->flow, flow)) { return head; } } return NULL; } - -static struct cls_match * -insert_rule(struct cls_classifier *cls, struct cls_subtable *subtable, - struct cls_rule *new) -{ - struct cls_match *cls_match = cls_match_alloc(new); - struct cls_match *head; - struct cls_match *old = NULL; - int i; - uint32_t basis = 0, hash; - uint8_t prev_be32ofs = 0; - - /* Add new node to segment indices. */ - for (i = 0; i < subtable->n_indices; i++) { - hash = minimatch_hash_range(&new->match, prev_be32ofs, - subtable->index_ofs[i], &basis); - hindex_insert(&subtable->indices[i], &cls_match->index_nodes[i], hash); - prev_be32ofs = subtable->index_ofs[i]; - } - hash = minimatch_hash_range(&new->match, prev_be32ofs, FLOW_U32S, &basis); - head = find_equal(subtable, &new->match.flow, hash); - if (!head) { - hmap_insert(&subtable->rules, &cls_match->hmap_node, hash); - list_init(&cls_match->list); - goto out; - } else { - /* Scan the list for the insertion point that will keep the list in - * order of decreasing priority. */ - struct cls_match *rule; - - cls_match->hmap_node.hash = hash; /* Otherwise done by hmap_insert. */ - - FOR_EACH_RULE_IN_LIST (rule, head) { - if (cls_match->priority >= rule->priority) { - if (rule == head) { - /* 'new' is the new highest-priority flow in the list. */ - hmap_replace(&subtable->rules, - &rule->hmap_node, &cls_match->hmap_node); - } - - if (cls_match->priority == rule->priority) { - list_replace(&cls_match->list, &rule->list); - old = rule; - goto out; - } else { - list_insert(&rule->list, &cls_match->list); - goto out; - } - } - } - - /* Insert 'new' at the end of the list. */ - list_push_back(&head->list, &cls_match->list); - } - - out: - if (!old) { - update_subtables_after_insertion(cls, subtable, cls_match->priority); - } else { - /* Remove old node from indices. */ - for (i = 0; i < subtable->n_indices; i++) { - hindex_remove(&subtable->indices[i], &old->index_nodes[i]); - } - } - return old; -} - -static struct cls_match * -next_rule_in_list__(struct cls_match *rule) -{ - struct cls_match *next = OBJECT_CONTAINING(rule->list.next, next, list); - return next; -} - -static struct cls_match * -next_rule_in_list(struct cls_match *rule) -{ - struct cls_match *next = next_rule_in_list__(rule); - return next->priority < rule->priority ? next : NULL; -} /* A longest-prefix match tree. */ -struct trie_node { - uint32_t prefix; /* Prefix bits for this node, MSB first. */ - uint8_t nbits; /* Never zero, except for the root node. */ - unsigned int n_rules; /* Number of rules that have this prefix. */ - struct trie_node *edges[2]; /* Both NULL if leaf. */ -}; - -/* Max bits per node. Must fit in struct trie_node's 'prefix'. - * Also tested with 16, 8, and 5 to stress the implementation. */ -#define TRIE_PREFIX_BITS 32 /* Return at least 'plen' bits of the 'prefix', starting at bit offset 'ofs'. * Prefixes are in the network byte order, and the offset 0 corresponds to @@ -1991,15 +1945,15 @@ return raw_get_prefix(pr, ofs, plen) & ~0u << (32 - plen); } -/* Return the number of equal bits in 'nbits' of 'prefix's MSBs and a 'value' +/* Return the number of equal bits in 'n_bits' of 'prefix's MSBs and a 'value' * starting at "MSB 0"-based offset 'ofs'. */ static unsigned int -prefix_equal_bits(uint32_t prefix, unsigned int nbits, const ovs_be32 value[], +prefix_equal_bits(uint32_t prefix, unsigned int n_bits, const ovs_be32 value[], unsigned int ofs) { - uint64_t diff = prefix ^ raw_get_prefix(value, ofs, nbits); + uint64_t diff = prefix ^ raw_get_prefix(value, ofs, n_bits); /* Set the bit after the relevant bits to limit the result. */ - return raw_clz64(diff << 32 | UINT64_C(1) << (63 - nbits)); + return raw_clz64(diff << 32 | UINT64_C(1) << (63 - n_bits)); } /* Return the number of equal bits in 'node' prefix and a 'prefix' of length @@ -2008,7 +1962,7 @@ trie_prefix_equal_bits(const struct trie_node *node, const ovs_be32 prefix[], unsigned int ofs, unsigned int plen) { - return prefix_equal_bits(node->prefix, MIN(node->nbits, plen - ofs), + return prefix_equal_bits(node->prefix, MIN(node->n_bits, plen - ofs), prefix, ofs); } @@ -2038,9 +1992,9 @@ node->prefix = trie_get_prefix(prefix, ofs, plen); if (plen <= TRIE_PREFIX_BITS) { - node->nbits = plen; - node->edges[0] = NULL; - node->edges[1] = NULL; + node->n_bits = plen; + ovsrcu_set_hidden(&node->edges[0], NULL); + ovsrcu_set_hidden(&node->edges[1], NULL); node->n_rules = n_rules; } else { /* Need intermediate nodes. */ struct trie_node *subnode = trie_branch_create(prefix, @@ -2048,70 +2002,87 @@ plen - TRIE_PREFIX_BITS, n_rules); int bit = get_bit_at(subnode->prefix, 0); - node->nbits = TRIE_PREFIX_BITS; - node->edges[bit] = subnode; - node->edges[!bit] = NULL; + node->n_bits = TRIE_PREFIX_BITS; + ovsrcu_set_hidden(&node->edges[bit], subnode); + ovsrcu_set_hidden(&node->edges[!bit], NULL); node->n_rules = 0; } return node; } static void -trie_node_destroy(struct trie_node *node) +trie_node_destroy(const struct trie_node *node) +{ + ovsrcu_postpone(free, CONST_CAST(struct trie_node *, node)); +} + +/* Copy a trie node for modification and postpone delete the old one. */ +static struct trie_node * +trie_node_rcu_realloc(const struct trie_node *node) { - free(node); + struct trie_node *new_node = xmalloc(sizeof *node); + + *new_node = *node; + trie_node_destroy(node); + + return new_node; } static void -trie_destroy(struct trie_node *node) +trie_destroy(rcu_trie_ptr *trie) { + struct trie_node *node = ovsrcu_get_protected(struct trie_node *, trie); + if (node) { - trie_destroy(node->edges[0]); - trie_destroy(node->edges[1]); - free(node); + ovsrcu_set_hidden(trie, NULL); + trie_destroy(&node->edges[0]); + trie_destroy(&node->edges[1]); + trie_node_destroy(node); } } static bool trie_is_leaf(const struct trie_node *trie) { - return !trie->edges[0] && !trie->edges[1]; /* No children. */ + /* No children? */ + return !ovsrcu_get(struct trie_node *, &trie->edges[0]) + && !ovsrcu_get(struct trie_node *, &trie->edges[1]); } static void mask_set_prefix_bits(struct flow_wildcards *wc, uint8_t be32ofs, - unsigned int nbits) + unsigned int n_bits) { ovs_be32 *mask = &((ovs_be32 *)&wc->masks)[be32ofs]; unsigned int i; - for (i = 0; i < nbits / 32; i++) { + for (i = 0; i < n_bits / 32; i++) { mask[i] = OVS_BE32_MAX; } - if (nbits % 32) { - mask[i] |= htonl(~0u << (32 - nbits % 32)); + if (n_bits % 32) { + mask[i] |= htonl(~0u << (32 - n_bits % 32)); } } static bool mask_prefix_bits_set(const struct flow_wildcards *wc, uint8_t be32ofs, - unsigned int nbits) + unsigned int n_bits) { ovs_be32 *mask = &((ovs_be32 *)&wc->masks)[be32ofs]; unsigned int i; ovs_be32 zeroes = 0; - for (i = 0; i < nbits / 32; i++) { + for (i = 0; i < n_bits / 32; i++) { zeroes |= ~mask[i]; } - if (nbits % 32) { - zeroes |= ~mask[i] & htonl(~0u << (32 - nbits % 32)); + if (n_bits % 32) { + zeroes |= ~mask[i] & htonl(~0u << (32 - n_bits % 32)); } - return !zeroes; /* All 'nbits' bits set. */ + return !zeroes; /* All 'n_bits' bits set. */ } -static struct trie_node ** +static rcu_trie_ptr * trie_next_edge(struct trie_node *node, const ovs_be32 value[], unsigned int ofs) { @@ -2122,50 +2093,61 @@ trie_next_node(const struct trie_node *node, const ovs_be32 value[], unsigned int ofs) { - return node->edges[be_get_bit_at(value, ofs)]; + return ovsrcu_get(struct trie_node *, + &node->edges[be_get_bit_at(value, ofs)]); +} + +/* Set the bit at ("MSB 0"-based) offset 'ofs'. 'ofs' can be greater than 31. + */ +static void +be_set_bit_at(ovs_be32 value[], unsigned int ofs) +{ + ((uint8_t *)value)[ofs / 8] |= 1u << (7 - ofs % 8); } -/* Return the prefix mask length necessary to find the longest-prefix match for - * the '*value' in the prefix tree 'node'. - * '*checkbits' is set to the number of bits in the prefix mask necessary to - * determine a mismatch, in case there are longer prefixes in the tree below - * the one that matched. +/* Returns the number of bits in the prefix mask necessary to determine a + * mismatch, in case there are longer prefixes in the tree below the one that + * matched. + * '*plens' will have a bit set for each prefix length that may have matching + * rules. The caller is responsible for clearing the '*plens' prior to + * calling this. */ static unsigned int -trie_lookup_value(const struct trie_node *node, const ovs_be32 value[], - unsigned int n_bits, unsigned int *checkbits) +trie_lookup_value(const rcu_trie_ptr *trie, const ovs_be32 value[], + ovs_be32 plens[], unsigned int n_bits) { - unsigned int ofs = 0, match_len = 0; const struct trie_node *prev = NULL; + const struct trie_node *node = ovsrcu_get(struct trie_node *, trie); + unsigned int match_len = 0; /* Number of matching bits. */ - for (; node; prev = node, node = trie_next_node(node, value, ofs)) { + for (; node; prev = node, node = trie_next_node(node, value, match_len)) { unsigned int eqbits; /* Check if this edge can be followed. */ - eqbits = prefix_equal_bits(node->prefix, node->nbits, value, ofs); - ofs += eqbits; - if (eqbits < node->nbits) { /* Mismatch, nothing more to be found. */ - /* Bit at offset 'ofs' differed. */ - *checkbits = ofs + 1; /* Includes the first mismatching bit. */ - return match_len; + eqbits = prefix_equal_bits(node->prefix, node->n_bits, value, + match_len); + match_len += eqbits; + if (eqbits < node->n_bits) { /* Mismatch, nothing more to be found. */ + /* Bit at offset 'match_len' differed. */ + return match_len + 1; /* Includes the first mismatching bit. */ } /* Full match, check if rules exist at this prefix length. */ if (node->n_rules > 0) { - match_len = ofs; + be_set_bit_at(plens, match_len - 1); } - if (ofs >= n_bits) { - *checkbits = n_bits; /* Full prefix. */ - return match_len; + if (match_len >= n_bits) { + return n_bits; /* Full prefix. */ } } - /* node == NULL. Full match so far, but we came to a dead end. - * need to exclude the other branch if it exists. */ - *checkbits = !prev || trie_is_leaf(prev) ? ofs : ofs + 1; - return match_len; + /* node == NULL. Full match so far, but we tried to follow an + * non-existing branch. Need to exclude the other branch if it exists + * (it does not if we were called on an empty trie or 'prev' is a leaf + * node). */ + return !prev || trie_is_leaf(prev) ? match_len : match_len + 1; } static unsigned int trie_lookup(const struct cls_trie *trie, const struct flow *flow, - unsigned int *checkbits) + union mf_value *plens) { const struct mf_field *mf = trie->field; @@ -2173,12 +2155,12 @@ * field. Some match fields are used for multiple purposes, so we * must check that the trie is relevant for this flow. */ if (mf_are_prereqs_ok(mf, flow)) { - return trie_lookup_value(trie->root, + return trie_lookup_value(&trie->root, &((ovs_be32 *)flow)[mf->flow_be32ofs], - mf->n_bits, checkbits); + &plens->be32, mf->n_bits); } - *checkbits = 0; /* Value not used in this case. */ - return UINT_MAX; + memset(plens, 0xff, sizeof *plens); /* All prefixes, no skipping. */ + return 0; /* Value not used in this case. */ } /* Returns the length of a prefix match mask for the field 'mf' in 'minimask'. @@ -2188,13 +2170,12 @@ minimask_get_prefix_len(const struct minimask *minimask, const struct mf_field *mf) { - unsigned int nbits = 0, mask_tz = 0; /* Non-zero when end of mask seen. */ - uint8_t u32_ofs = mf->flow_be32ofs; - uint8_t u32_end = u32_ofs + mf->n_bytes / 4; - - for (; u32_ofs < u32_end; ++u32_ofs) { - uint32_t mask; - mask = ntohl((OVS_FORCE ovs_be32)minimask_get(minimask, u32_ofs)); + unsigned int n_bits = 0, mask_tz = 0; /* Non-zero when end of mask seen. */ + uint8_t be32_ofs = mf->flow_be32ofs; + uint8_t be32_end = be32_ofs + mf->n_bytes / 4; + + for (; be32_ofs < be32_end; ++be32_ofs) { + uint32_t mask = ntohl(minimask_get_be32(minimask, be32_ofs)); /* Validate mask, count the mask length. */ if (mask_tz) { @@ -2206,11 +2187,11 @@ return 0; /* Mask not contiguous. */ } mask_tz = ctz32(mask); - nbits += 32 - mask_tz; + n_bits += 32 - mask_tz; } } - return nbits; + return n_bits; } /* @@ -2222,8 +2203,11 @@ static const ovs_be32 * minimatch_get_prefix(const struct minimatch *match, const struct mf_field *mf) { - return miniflow_get_be32_values(&match->flow) + - count_1bits(match->flow.map & ((UINT64_C(1) << mf->flow_be32ofs) - 1)); + return (OVS_FORCE const ovs_be32 *) + (miniflow_get_values(&match->flow) + + count_1bits(match->flow.map & + ((UINT64_C(1) << mf->flow_be32ofs / 2) - 1))) + + (mf->flow_be32ofs & 1); } /* Insert rule in to the prefix tree. @@ -2237,34 +2221,37 @@ } static void -trie_insert_prefix(struct trie_node **edge, const ovs_be32 *prefix, int mlen) +trie_insert_prefix(rcu_trie_ptr *edge, const ovs_be32 *prefix, int mlen) { struct trie_node *node; int ofs = 0; /* Walk the tree. */ - for (; (node = *edge) != NULL; + for (; (node = ovsrcu_get_protected(struct trie_node *, edge)); edge = trie_next_edge(node, prefix, ofs)) { unsigned int eqbits = trie_prefix_equal_bits(node, prefix, ofs, mlen); ofs += eqbits; - if (eqbits < node->nbits) { + if (eqbits < node->n_bits) { /* Mismatch, new node needs to be inserted above. */ int old_branch = get_bit_at(node->prefix, eqbits); + struct trie_node *new_parent; - /* New parent node. */ - *edge = trie_branch_create(prefix, ofs - eqbits, eqbits, - ofs == mlen ? 1 : 0); - - /* Adjust old node for its new position in the tree. */ + new_parent = trie_branch_create(prefix, ofs - eqbits, eqbits, + ofs == mlen ? 1 : 0); + /* Copy the node to modify it. */ + node = trie_node_rcu_realloc(node); + /* Adjust the new node for its new position in the tree. */ node->prefix <<= eqbits; - node->nbits -= eqbits; - (*edge)->edges[old_branch] = node; + node->n_bits -= eqbits; + ovsrcu_set_hidden(&new_parent->edges[old_branch], node); /* Check if need a new branch for the new rule. */ if (ofs < mlen) { - (*edge)->edges[!old_branch] - = trie_branch_create(prefix, ofs, mlen - ofs, 1); + ovsrcu_set_hidden(&new_parent->edges[!old_branch], + trie_branch_create(prefix, ofs, mlen - ofs, + 1)); } + ovsrcu_set(edge, new_parent); /* Publish changes. */ return; } /* Full match so far. */ @@ -2276,7 +2263,7 @@ } } /* Must insert a new tree branch for the new rule. */ - *edge = trie_branch_create(prefix, ofs, mlen - ofs, 1); + ovsrcu_set(edge, trie_branch_create(prefix, ofs, mlen - ofs, 1)); } /* 'mlen' must be the (non-zero) CIDR prefix length of the 'trie->field' mask @@ -2291,19 +2278,19 @@ /* 'mlen' must be the (non-zero) CIDR prefix length of the 'trie->field' mask * in 'rule'. */ static void -trie_remove_prefix(struct trie_node **root, const ovs_be32 *prefix, int mlen) +trie_remove_prefix(rcu_trie_ptr *root, const ovs_be32 *prefix, int mlen) { struct trie_node *node; - struct trie_node **edges[sizeof(union mf_value) * 8]; + rcu_trie_ptr *edges[sizeof(union mf_value) * 8]; int depth = 0, ofs = 0; /* Walk the tree. */ for (edges[0] = root; - (node = *edges[depth]) != NULL; + (node = ovsrcu_get_protected(struct trie_node *, edges[depth])); edges[++depth] = trie_next_edge(node, prefix, ofs)) { unsigned int eqbits = trie_prefix_equal_bits(node, prefix, ofs, mlen); - if (eqbits < node->nbits) { + if (eqbits < node->n_bits) { /* Mismatch, nothing to be removed. This should never happen, as * only rules in the classifier are ever removed. */ break; /* Log a warning. */ @@ -2319,27 +2306,40 @@ node->n_rules--; /* Check if can prune the tree. */ - while (!node->n_rules && !(node->edges[0] && node->edges[1])) { - /* No rules and at most one child node, remove this node. */ - struct trie_node *next; - next = node->edges[0] ? node->edges[0] : node->edges[1]; + while (!node->n_rules) { + struct trie_node *next, + *edge0 = ovsrcu_get_protected(struct trie_node *, + &node->edges[0]), + *edge1 = ovsrcu_get_protected(struct trie_node *, + &node->edges[1]); + + if (edge0 && edge1) { + break; /* A branching point, cannot prune. */ + } + + /* Else have at most one child node, remove this node. */ + next = edge0 ? edge0 : edge1; if (next) { - if (node->nbits + next->nbits > TRIE_PREFIX_BITS) { + if (node->n_bits + next->n_bits > TRIE_PREFIX_BITS) { break; /* Cannot combine. */ } + next = trie_node_rcu_realloc(next); /* Modify. */ + /* Combine node with next. */ - next->prefix = node->prefix | next->prefix >> node->nbits; - next->nbits += node->nbits; + next->prefix = node->prefix | next->prefix >> node->n_bits; + next->n_bits += node->n_bits; } - trie_node_destroy(node); /* Update the parent's edge. */ - *edges[depth] = next; + ovsrcu_set(edges[depth], next); /* Publish changes. */ + trie_node_destroy(node); + if (next || !depth) { /* Branch not pruned or at root, nothing more to do. */ break; } - node = *edges[--depth]; + node = ovsrcu_get_protected(struct trie_node *, + edges[--depth]); } return; } @@ -2348,3 +2348,13 @@ * that actually exist in the classifier are ever removed. */ VLOG_WARN("Trying to remove non-existing rule from a prefix trie."); } + + +#define CLS_MATCH_POISON (struct cls_match *)(UINTPTR_MAX / 0xf * 0xb) + +void +cls_match_free_cb(struct cls_match *rule) +{ + ovsrcu_set_hidden(&rule->next, CLS_MATCH_POISON); + free(rule); +} diff -Nru openvswitch-2.3.1/lib/classifier.h openvswitch-2.4.0~git20150623/lib/classifier.h --- openvswitch-2.3.1/lib/classifier.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/classifier.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -126,9 +126,12 @@ * cls_subtable", with the other almost-identical rules chained off a linked * list inside that highest-priority rule. * + * The following sub-sections describe various optimizations over this simple + * approach. + * * * Staged Lookup (Wildcard Optimization) - * ===================================== + * ------------------------------------- * * Subtable lookup is performed in ranges defined for struct flow, starting * from metadata (registers, in_port, etc.), then L2 header, L3, and finally @@ -141,7 +144,7 @@ * * * Prefix Tracking (Wildcard Optimization) - * ======================================= + * --------------------------------------- * * Classifier uses prefix trees ("tries") for tracking the used * address space, enabling skipping classifier tables containing @@ -171,7 +174,7 @@ * * * Partitioning (Lookup Time and Wildcard Optimization) - * ==================================================== + * ---------------------------------------------------- * * Suppose that a given classifier is being used to handle multiple stages in a * pipeline using "resubmit", with metadata (that is, the OpenFlow 1.1+ field @@ -207,140 +210,266 @@ * Each eliminated subtable lookup also reduces the amount of un-wildcarding. * * + * Classifier Versioning + * ===================== + * + * Classifier lookups are always done in a specific classifier version, where + * a version is defined to be a natural number. + * + * When a new rule is added to a classifier, it is set to become visible in a + * specific version. If the version number used at insert time is larger than + * any version number currently used in lookups, the new rule is said to be + * invisible to lookups. This means that lookups won't find the rule, but the + * rule is immediately available to classifier iterations. + * + * Similarly, a rule can be marked as to be deleted in a future version. To + * delete a rule in a way to not remove the rule before all ongoing lookups are + * finished, the rule should be made invisible in a specific version number. + * Then, when all the lookups use a later version number, the rule can be + * actually removed from the classifier. + * + * Classifiers can hold duplicate rules (rules with the same match criteria and + * priority) when at most one of these duplicates is visible in any given + * lookup version. The caller responsible for classifier modifications must + * maintain this invariant. + * + * The classifier supports versioning for two reasons: + * + * 1. Support for versioned modifications makes it possible to perform an + * arbitraty series of classifier changes as one atomic transaction, + * where intermediate versions of the classifier are not visible to any + * lookups. Also, when a rule is added for a future version, or marked + * for removal after the current version, such modifications can be + * reverted without any visible effects to any of the current lookups. + * + * 2. Performance: Adding (or deleting) a large set of rules can, in + * pathological cases, have a cost proportional to the number of rules + * already in the classifier. When multiple rules are being added (or + * deleted) in one go, though, this pathological case cost can be + * typically avoided, as long as it is OK for any new rules to be + * invisible until the batch change is complete. + * + * Note that the classifier_replace() function replaces a rule immediately, and + * is therefore not safe to use with versioning. It is still available for the + * users that do not use versioning. + * + * + * Deferred Publication + * ==================== + * + * Removing large number of rules from classifier can be costly, as the + * supporting data structures are teared down, in many cases just to be + * re-instantiated right after. In the worst case, as when each rule has a + * different match pattern (mask), the maintenance of the match patterns can + * have cost O(N^2), where N is the number of different match patterns. To + * alleviate this, the classifier supports a "deferred mode", in which changes + * in internal data structures needed for future version lookups may not be + * fully computed yet. The computation is finalized when the deferred mode is + * turned off. + * + * This feature can be used with versioning such that all changes to future + * versions are made in the deferred mode. Then, right before making the new + * version visible to lookups, the deferred mode is turned off so that all the + * data structures are ready for lookups with the new version number. + * + * To use deferred publication, first call classifier_defer(). Then, modify + * the classifier via additions (classifier_insert() with a specific, future + * version number) and deletions (use cls_rule_make_removable_after_version()). + * Then call classifier_publish(), and after that, announce the new version + * number to be used in lookups. + * + * * Thread-safety * ============= * - * The classifier may safely be accessed by many reader threads concurrently or - * by a single writer. */ + * The classifier may safely be accessed by many reader threads concurrently + * and by a single writer, or by multiple writers when they guarantee mutually + * exlucive access to classifier modifications. + * + * Since the classifier rules are RCU protected, the rule destruction after + * removal from the classifier must be RCU postponed. Also, when versioning is + * used, the rule removal itself needs to be typically RCU postponed. In this + * case the rule destruction is doubly RCU postponed, i.e., the second + * ovsrcu_postpone() call to destruct the rule is called from the first RCU + * callback that removes the rule. + * + * Rules that have never been visible to lookups are an exeption to the above + * rule. Such rules can be removed immediately, but their destruction must + * still be RCU postponed, as the rule's visibility attribute may be examined + * parallel to the rule's removal. */ -#include "fat-rwlock.h" -#include "flow.h" -#include "hindex.h" -#include "hmap.h" -#include "list.h" +#include "cmap.h" #include "match.h" #include "meta-flow.h" -#include "tag.h" -#include "openflow/nicira-ext.h" -#include "openflow/openflow.h" -#include "ovs-thread.h" -#include "util.h" +#include "pvector.h" +#include "rculist.h" +#include "type-props.h" #ifdef __cplusplus extern "C" { #endif -/* Needed only for the lock annotation in struct classifier. */ -extern struct ovs_mutex ofproto_mutex; - /* Classifier internal data structures. */ -struct cls_classifier; struct cls_subtable; -struct cls_partition; struct cls_match; +struct trie_node; +typedef OVSRCU_TYPE(struct trie_node *) rcu_trie_ptr; + +/* Prefix trie for a 'field' */ +struct cls_trie { + const struct mf_field *field; /* Trie field, or NULL. */ + rcu_trie_ptr root; /* NULL if none. */ +}; + +typedef uint64_t cls_version_t; + +#define CLS_MIN_VERSION 0 /* Default version number to use. */ +#define CLS_MAX_VERSION (TYPE_MAXIMUM(cls_version_t) - 1) +#define CLS_NOT_REMOVED_VERSION TYPE_MAXIMUM(cls_version_t) + enum { - CLS_MAX_TRIES = 3 /* Maximum number of prefix trees per classifier. */ + CLS_MAX_INDICES = 3, /* Maximum number of lookup indices per subtable. */ + CLS_MAX_TRIES = 3 /* Maximum number of prefix trees per classifier. */ }; /* A flow classifier. */ struct classifier { - struct fat_rwlock rwlock OVS_ACQ_AFTER(ofproto_mutex); - struct cls_classifier *cls; + int n_rules; /* Total number of rules. */ + uint8_t n_flow_segments; + uint8_t flow_segments[CLS_MAX_INDICES]; /* Flow segment boundaries to use + * for staged lookup. */ + struct cmap subtables_map; /* Contains "struct cls_subtable"s. */ + struct pvector subtables; + struct cmap partitions; /* Contains "struct cls_partition"s. */ + struct cls_trie tries[CLS_MAX_TRIES]; /* Prefix tries. */ + unsigned int n_tries; + bool publish; /* Make changes visible to lookups? */ +}; + +struct cls_conjunction { + uint32_t id; + uint8_t clause; + uint8_t n_clauses; }; /* A rule to be inserted to the classifier. */ struct cls_rule { - struct minimatch match; /* Matching rule. */ - unsigned int priority; /* Larger numbers are higher priorities. */ - struct cls_match *cls_match; /* NULL if rule is not in a classifier. */ + struct rculist node; /* In struct cls_subtable 'rules_list'. */ + const int priority; /* Larger numbers are higher priorities. */ + const cls_version_t version; /* Version in which the rule was added. */ + struct cls_match *cls_match; /* NULL if not in a classifier. */ + const struct minimatch match; /* Matching rule. */ }; -void cls_rule_init(struct cls_rule *, const struct match *, - unsigned int priority); +void cls_rule_init(struct cls_rule *, const struct match *, int priority, + cls_version_t); void cls_rule_init_from_minimatch(struct cls_rule *, const struct minimatch *, - unsigned int priority); + int priority, cls_version_t); void cls_rule_clone(struct cls_rule *, const struct cls_rule *); +void cls_rule_clone_in_version(struct cls_rule *, const struct cls_rule *, + cls_version_t); void cls_rule_move(struct cls_rule *dst, struct cls_rule *src); void cls_rule_destroy(struct cls_rule *); +void cls_rule_set_conjunctions(struct cls_rule *, + const struct cls_conjunction *, size_t n); + bool cls_rule_equal(const struct cls_rule *, const struct cls_rule *); uint32_t cls_rule_hash(const struct cls_rule *, uint32_t basis); - void cls_rule_format(const struct cls_rule *, struct ds *); - bool cls_rule_is_catchall(const struct cls_rule *); - bool cls_rule_is_loose_match(const struct cls_rule *rule, const struct minimatch *criteria); +bool cls_rule_visible_in_version(const struct cls_rule *, cls_version_t); +void cls_rule_make_invisible_in_version(const struct cls_rule *, + cls_version_t); +void cls_rule_restore_visibility(const struct cls_rule *); -void classifier_init(struct classifier *cls, const uint8_t *flow_segments); +/* Constructor/destructor. Must run single-threaded. */ +void classifier_init(struct classifier *, const uint8_t *flow_segments); void classifier_destroy(struct classifier *); -void classifier_set_prefix_fields(struct classifier *cls, - const enum mf_field_id *trie_fields, - unsigned int n_trie_fields) - OVS_REQ_WRLOCK(cls->rwlock); -bool classifier_is_empty(const struct classifier *cls) - OVS_REQ_RDLOCK(cls->rwlock); -int classifier_count(const struct classifier *cls) - OVS_REQ_RDLOCK(cls->rwlock); -void classifier_insert(struct classifier *cls, struct cls_rule *) - OVS_REQ_WRLOCK(cls->rwlock); -struct cls_rule *classifier_replace(struct classifier *cls, struct cls_rule *) - OVS_REQ_WRLOCK(cls->rwlock); -void classifier_remove(struct classifier *cls, struct cls_rule *) - OVS_REQ_WRLOCK(cls->rwlock); -struct cls_rule *classifier_lookup(const struct classifier *cls, - const struct flow *, - struct flow_wildcards *) - OVS_REQ_RDLOCK(cls->rwlock); -struct cls_rule *classifier_lookup_miniflow_first(const struct classifier *cls, - const struct miniflow *) - OVS_REQ_RDLOCK(cls->rwlock); -bool classifier_rule_overlaps(const struct classifier *cls, - const struct cls_rule *) - OVS_REQ_RDLOCK(cls->rwlock); - -typedef void cls_cb_func(struct cls_rule *, void *aux); - -struct cls_rule *classifier_find_rule_exactly(const struct classifier *cls, - const struct cls_rule *) - OVS_REQ_RDLOCK(cls->rwlock); -struct cls_rule *classifier_find_match_exactly(const struct classifier *cls, - const struct match *, - unsigned int priority) - OVS_REQ_RDLOCK(cls->rwlock); +/* Modifiers. Caller MUST exclude concurrent calls from other threads. */ +bool classifier_set_prefix_fields(struct classifier *, + const enum mf_field_id *trie_fields, + unsigned int n_trie_fields); +void classifier_insert(struct classifier *, const struct cls_rule *, + const struct cls_conjunction *, size_t n_conjunctions); +const struct cls_rule *classifier_replace(struct classifier *, + const struct cls_rule *, + const struct cls_conjunction *, + size_t n_conjunctions); +const struct cls_rule *classifier_remove(struct classifier *, + const struct cls_rule *); +static inline void classifier_defer(struct classifier *); +static inline void classifier_publish(struct classifier *); + +/* Lookups. These are RCU protected and may run concurrently with modifiers + * and each other. */ +const struct cls_rule *classifier_lookup(const struct classifier *, + cls_version_t, struct flow *, + struct flow_wildcards *); +bool classifier_rule_overlaps(const struct classifier *, + const struct cls_rule *); +const struct cls_rule *classifier_find_rule_exactly(const struct classifier *, + const struct cls_rule *); +const struct cls_rule *classifier_find_match_exactly(const struct classifier *, + const struct match *, + int priority, + cls_version_t); +bool classifier_is_empty(const struct classifier *); +int classifier_count(const struct classifier *); -/* Iteration. */ - +/* Iteration. + * + * Iteration is lockless and RCU-protected. Concurrent threads may perform all + * kinds of concurrent modifications without ruining the iteration. Obviously, + * any modifications may or may not be visible to the concurrent iterator, but + * all the rules not deleted are visited by the iteration. The iterating + * thread may also modify the classifier rules itself. + * + * 'TARGET' iteration only iterates rules matching the 'TARGET' criteria. + * Rather than looping through all the rules and skipping ones that can't + * match, 'TARGET' iteration skips whole subtables, if the 'TARGET' happens to + * be more specific than the subtable. */ struct cls_cursor { - const struct cls_classifier *cls; + const struct classifier *cls; const struct cls_subtable *subtable; const struct cls_rule *target; + struct pvector_cursor subtables; + const struct cls_rule *rule; }; -void cls_cursor_init(struct cls_cursor *cursor, const struct classifier *cls, - const struct cls_rule *match) OVS_REQ_RDLOCK(cls->rwlock); -struct cls_rule *cls_cursor_first(struct cls_cursor *cursor); -struct cls_rule *cls_cursor_next(struct cls_cursor *, const struct cls_rule *); - -#define CLS_CURSOR_FOR_EACH(RULE, MEMBER, CURSOR) \ - for (ASSIGN_CONTAINER(RULE, cls_cursor_first(CURSOR), MEMBER); \ - RULE != OBJECT_CONTAINING(NULL, RULE, MEMBER); \ - ASSIGN_CONTAINER(RULE, cls_cursor_next(CURSOR, &(RULE)->MEMBER), \ - MEMBER)) - -#define CLS_CURSOR_FOR_EACH_SAFE(RULE, NEXT, MEMBER, CURSOR) \ - for (ASSIGN_CONTAINER(RULE, cls_cursor_first(CURSOR), MEMBER); \ - (RULE != OBJECT_CONTAINING(NULL, RULE, MEMBER) \ - ? ASSIGN_CONTAINER(NEXT, cls_cursor_next(CURSOR, &(RULE)->MEMBER), \ - MEMBER), 1 \ - : 0); \ - (RULE) = (NEXT)) +struct cls_cursor cls_cursor_start(const struct classifier *cls, + const struct cls_rule *target); +void cls_cursor_advance(struct cls_cursor *); + +#define CLS_FOR_EACH(RULE, MEMBER, CLS) \ + CLS_FOR_EACH_TARGET(RULE, MEMBER, CLS, NULL) +#define CLS_FOR_EACH_TARGET(RULE, MEMBER, CLS, TARGET) \ + for (struct cls_cursor cursor__ = cls_cursor_start(CLS, TARGET); \ + (cursor__.rule \ + ? (INIT_CONTAINER(RULE, cursor__.rule, MEMBER), \ + cls_cursor_advance(&cursor__), \ + true) \ + : false); \ + ) #ifdef __cplusplus } #endif + +static inline void +classifier_defer(struct classifier *cls) +{ + cls->publish = false; +} +static inline void +classifier_publish(struct classifier *cls) +{ + cls->publish = true; + pvector_publish(&cls->subtables); +} #endif /* classifier.h */ diff -Nru openvswitch-2.3.1/lib/classifier-private.h openvswitch-2.4.0~git20150623/lib/classifier-private.h --- openvswitch-2.3.1/lib/classifier-private.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/classifier-private.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,410 @@ +/* + * Copyright (c) 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CLASSIFIER_PRIVATE_H +#define CLASSIFIER_PRIVATE_H 1 + +#include "cmap.h" +#include "flow.h" +#include "hash.h" +#include "rculist.h" +#include "tag.h" + +/* Classifier internal definitions, subject to change at any time. */ + +/* A set of rules that all have the same fields wildcarded. */ +struct cls_subtable { + struct cmap_node cmap_node; /* Within classifier's 'subtables_map'. */ + + /* These fields are only used by writers. */ + int max_priority; /* Max priority of any rule in subtable. */ + unsigned int max_count; /* Count of max_priority rules. */ + + /* Accessed by iterators. */ + struct rculist rules_list; /* Unordered. */ + + /* Identical, but lower priority rules are not inserted to any of the + * following data structures. */ + + /* These fields are accessed by readers who care about wildcarding. */ + const tag_type tag; /* Tag generated from mask for partitioning. */ + const uint8_t n_indices; /* How many indices to use. */ + const uint8_t index_ofs[CLS_MAX_INDICES]; /* u64 segment boundaries. */ + unsigned int trie_plen[CLS_MAX_TRIES]; /* Trie prefix length in 'mask' + * (runtime configurable). */ + const int ports_mask_len; + struct cmap indices[CLS_MAX_INDICES]; /* Staged lookup indices. */ + rcu_trie_ptr ports_trie; /* NULL if none. */ + + /* These fields are accessed by all readers. */ + struct cmap rules; /* Contains 'cls_match'es. */ + const struct minimask mask; /* Wildcards for fields. */ + /* 'mask' must be the last field. */ +}; + +/* Associates a metadata value (that is, a value of the OpenFlow 1.1+ metadata + * field) with tags for the "cls_subtable"s that contain rules that match that + * metadata value. */ +struct cls_partition { + struct cmap_node cmap_node; /* In struct classifier's 'partitions' map. */ + ovs_be64 metadata; /* metadata value for this partition. */ + tag_type tags; /* OR of each flow's cls_subtable tag. */ + struct tag_tracker tracker; /* Tracks the bits in 'tags'. */ +}; + +/* Internal representation of a rule in a "struct cls_subtable". + * + * The 'next' member is an element in a singly linked, null-terminated list. + * This list links together identical "cls_match"es in order of decreasing + * priority. The classifier code maintains the invariant that at most one rule + * of a given priority is visible for any given lookup version. + */ +struct cls_match { + /* Accessed by everybody. */ + OVSRCU_TYPE(struct cls_match *) next; /* Equal, lower-priority matches. */ + OVSRCU_TYPE(struct cls_conjunction_set *) conj_set; + + /* Accessed only by writers. */ + struct cls_partition *partition; + + /* Accessed by readers interested in wildcarding. */ + const int priority; /* Larger numbers are higher priorities. */ + struct cmap_node index_nodes[CLS_MAX_INDICES]; /* Within subtable's + * 'indices'. */ + /* Accessed by all readers. */ + struct cmap_node cmap_node; /* Within struct cls_subtable 'rules'. */ + + /* Rule versioning. + * + * CLS_NOT_REMOVED_VERSION has a special meaning for 'remove_version', + * meaningthat the rule has been added but not yet removed. + */ + const cls_version_t add_version; /* Version rule was added in. */ + ATOMIC(cls_version_t) remove_version; /* Version rule is removed in. */ + + const struct cls_rule *cls_rule; + const struct miniflow flow; /* Matching rule. Mask is in the subtable. */ + /* 'flow' must be the last field. */ +}; + +/* Must be RCU postponed. */ +void cls_match_free_cb(struct cls_match *); + +static inline void +cls_match_set_remove_version(struct cls_match *rule, cls_version_t version) +{ + atomic_store_relaxed(&rule->remove_version, version); +} + +static inline bool +cls_match_visible_in_version(const struct cls_match *rule, + cls_version_t version) +{ + cls_version_t remove_version; + + /* C11 does not want to access an atomic via a const object pointer. */ + atomic_read_relaxed(&CONST_CAST(struct cls_match *, rule)->remove_version, + &remove_version); + + return rule->add_version <= version && version < remove_version; +} + +static inline bool +cls_match_is_eventually_invisible(const struct cls_match *rule) +{ + cls_version_t remove_version; + + /* C11 does not want to access an atomic via a const object pointer. */ + atomic_read_relaxed(&CONST_CAST(struct cls_match *, rule)->remove_version, + &remove_version); + + return remove_version <= CLS_MAX_VERSION; +} + + +/* cls_match 'next' */ + +static inline const struct cls_match * +cls_match_next(const struct cls_match *rule) +{ + return ovsrcu_get(struct cls_match *, &rule->next); +} + +static inline struct cls_match * +cls_match_next_protected(const struct cls_match *rule) +{ + return ovsrcu_get_protected(struct cls_match *, &rule->next); +} + +/* Puts 'rule' in the position between 'prev' and 'next'. If 'prev' == NULL, + * then the 'rule' is the new list head, and if 'next' == NULL, the rule is the + * new list tail. + * If there are any nodes between 'prev' and 'next', they are dropped from the + * list. */ +static inline void +cls_match_insert(struct cls_match *prev, struct cls_match *next, + struct cls_match *rule) +{ + ovsrcu_set_hidden(&rule->next, next); + + if (prev) { + ovsrcu_set(&prev->next, rule); + } +} + +/* Puts 'new_rule' in the position of 'old_rule', which is the next node after + * 'prev'. If 'prev' == NULL, then the 'new_rule' is the new list head. + * + * The replaced cls_match still links to the later rules, and may still be + * referenced by other threads until all other threads quiesce. The replaced + * rule may not be re-inserted, re-initialized, or deleted until after all + * other threads have quiesced (use ovsrcu_postpone). */ +static inline void +cls_match_replace(struct cls_match *prev, + struct cls_match *old_rule, struct cls_match *new_rule) +{ + cls_match_insert(prev, cls_match_next_protected(old_rule), new_rule); +} + +/* Removes 'rule' following 'prev' from the list. If 'prev' is NULL, then the + * 'rule' is a list head, and the caller is responsible for maintaining its + * list head pointer (if any). + * + * Afterward, the removed rule is not linked to any more, but still links to + * the following rules, and may still be referenced by other threads until all + * other threads quiesce. The removed rule may not be re-inserted, + * re-initialized, or deleted until after all other threads have quiesced (use + * ovsrcu_postpone). + */ +static inline void +cls_match_remove(struct cls_match *prev, struct cls_match *rule) +{ + if (prev) { + ovsrcu_set(&prev->next, cls_match_next_protected(rule)); + } +} + +#define CLS_MATCH_FOR_EACH(ITER, HEAD) \ + for ((ITER) = (HEAD); (ITER); (ITER) = cls_match_next(ITER)) + +#define CLS_MATCH_FOR_EACH_AFTER_HEAD(ITER, HEAD) \ + CLS_MATCH_FOR_EACH(ITER, cls_match_next(HEAD)) + +/* Iterate cls_matches keeping the previous pointer for modifications. */ +#define FOR_EACH_RULE_IN_LIST_PROTECTED(ITER, PREV, HEAD) \ + for ((PREV) = NULL, (ITER) = (HEAD); \ + (ITER); \ + (PREV) = (ITER), (ITER) = cls_match_next_protected(ITER)) + + +/* A longest-prefix match tree. */ +struct trie_node { + uint32_t prefix; /* Prefix bits for this node, MSB first. */ + uint8_t n_bits; /* Never zero, except for the root node. */ + unsigned int n_rules; /* Number of rules that have this prefix. */ + rcu_trie_ptr edges[2]; /* Both NULL if leaf. */ +}; + +/* Max bits per node. Must fit in struct trie_node's 'prefix'. + * Also tested with 16, 8, and 5 to stress the implementation. */ +#define TRIE_PREFIX_BITS 32 + +/* flow/miniflow/minimask/minimatch utilities. + * These are only used by the classifier, so place them here to allow + * for better optimization. */ + +static inline uint64_t +miniflow_get_map_in_range(const struct miniflow *miniflow, + uint8_t start, uint8_t end, unsigned int *offset) +{ + uint64_t map = miniflow->map; + *offset = 0; + + if (start > 0) { + uint64_t msk = (UINT64_C(1) << start) - 1; /* 'start' LSBs set */ + *offset = count_1bits(map & msk); + map &= ~msk; + } + if (end < FLOW_U64S) { + uint64_t msk = (UINT64_C(1) << end) - 1; /* 'end' LSBs set */ + map &= msk; + } + return map; +} + +/* Returns a hash value for the bits of 'flow' where there are 1-bits in + * 'mask', given 'basis'. + * + * The hash values returned by this function are the same as those returned by + * miniflow_hash_in_minimask(), only the form of the arguments differ. */ +static inline uint32_t +flow_hash_in_minimask(const struct flow *flow, const struct minimask *mask, + uint32_t basis) +{ + const uint64_t *mask_values = miniflow_get_values(&mask->masks); + const uint64_t *flow_u64 = (const uint64_t *)flow; + const uint64_t *p = mask_values; + uint32_t hash; + int idx; + + hash = basis; + MAP_FOR_EACH_INDEX(idx, mask->masks.map) { + hash = hash_add64(hash, flow_u64[idx] & *p++); + } + + return hash_finish(hash, (p - mask_values) * 8); +} + +/* Returns a hash value for the bits of 'flow' where there are 1-bits in + * 'mask', given 'basis'. + * + * The hash values returned by this function are the same as those returned by + * flow_hash_in_minimask(), only the form of the arguments differ. */ +static inline uint32_t +miniflow_hash_in_minimask(const struct miniflow *flow, + const struct minimask *mask, uint32_t basis) +{ + const uint64_t *mask_values = miniflow_get_values(&mask->masks); + const uint64_t *p = mask_values; + uint32_t hash = basis; + uint64_t flow_u64; + + MINIFLOW_FOR_EACH_IN_MAP(flow_u64, flow, mask->masks.map) { + hash = hash_add64(hash, flow_u64 & *p++); + } + + return hash_finish(hash, (p - mask_values) * 8); +} + +/* Returns a hash value for the bits of range [start, end) in 'flow', + * where there are 1-bits in 'mask', given 'hash'. + * + * The hash values returned by this function are the same as those returned by + * minimatch_hash_range(), only the form of the arguments differ. */ +static inline uint32_t +flow_hash_in_minimask_range(const struct flow *flow, + const struct minimask *mask, + uint8_t start, uint8_t end, uint32_t *basis) +{ + const uint64_t *mask_values = miniflow_get_values(&mask->masks); + const uint64_t *flow_u64 = (const uint64_t *)flow; + unsigned int offset; + uint64_t map; + const uint64_t *p; + uint32_t hash = *basis; + int idx; + + map = miniflow_get_map_in_range(&mask->masks, start, end, &offset); + p = mask_values + offset; + MAP_FOR_EACH_INDEX(idx, map) { + hash = hash_add64(hash, flow_u64[idx] & *p++); + } + + *basis = hash; /* Allow continuation from the unfinished value. */ + return hash_finish(hash, (p - mask_values) * 8); +} + +/* Fold minimask 'mask''s wildcard mask into 'wc's wildcard mask. */ +static inline void +flow_wildcards_fold_minimask(struct flow_wildcards *wc, + const struct minimask *mask) +{ + flow_union_with_miniflow(&wc->masks, &mask->masks); +} + +/* Fold minimask 'mask''s wildcard mask into 'wc's wildcard mask + * in range [start, end). */ +static inline void +flow_wildcards_fold_minimask_range(struct flow_wildcards *wc, + const struct minimask *mask, + uint8_t start, uint8_t end) +{ + uint64_t *dst_u64 = (uint64_t *)&wc->masks; + unsigned int offset; + uint64_t map; + const uint64_t *p; + int idx; + + map = miniflow_get_map_in_range(&mask->masks, start, end, &offset); + p = miniflow_get_values(&mask->masks) + offset; + MAP_FOR_EACH_INDEX(idx, map) { + dst_u64[idx] |= *p++; + } +} + +/* Returns a hash value for 'flow', given 'basis'. */ +static inline uint32_t +miniflow_hash(const struct miniflow *flow, uint32_t basis) +{ + const uint64_t *values = miniflow_get_values(flow); + const uint64_t *p = values; + uint32_t hash = basis; + uint64_t hash_map = 0; + uint64_t map; + + for (map = flow->map; map; map = zero_rightmost_1bit(map)) { + if (*p) { + hash = hash_add64(hash, *p); + hash_map |= rightmost_1bit(map); + } + p++; + } + hash = hash_add64(hash, hash_map); + + return hash_finish(hash, p - values); +} + +/* Returns a hash value for 'mask', given 'basis'. */ +static inline uint32_t +minimask_hash(const struct minimask *mask, uint32_t basis) +{ + return miniflow_hash(&mask->masks, basis); +} + +/* Returns a hash value for 'match', given 'basis'. */ +static inline uint32_t +minimatch_hash(const struct minimatch *match, uint32_t basis) +{ + return miniflow_hash(&match->flow, minimask_hash(&match->mask, basis)); +} + +/* Returns a hash value for the bits of range [start, end) in 'minimatch', + * given 'basis'. + * + * The hash values returned by this function are the same as those returned by + * flow_hash_in_minimask_range(), only the form of the arguments differ. */ +static inline uint32_t +minimatch_hash_range(const struct minimatch *match, uint8_t start, uint8_t end, + uint32_t *basis) +{ + unsigned int offset; + const uint64_t *p, *q; + uint32_t hash = *basis; + int n, i; + + n = count_1bits(miniflow_get_map_in_range(&match->mask.masks, start, end, + &offset)); + q = miniflow_get_values(&match->mask.masks) + offset; + p = miniflow_get_values(&match->flow) + offset; + + for (i = 0; i < n; i++) { + hash = hash_add64(hash, p[i] & q[i]); + } + *basis = hash; /* Allow continuation from the unfinished value. */ + return hash_finish(hash, (offset + n) * 8); +} + +#endif diff -Nru openvswitch-2.3.1/lib/cmap.c openvswitch-2.4.0~git20150623/lib/cmap.c --- openvswitch-2.3.1/lib/cmap.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/cmap.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,990 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "cmap.h" +#include "coverage.h" +#include "bitmap.h" +#include "hash.h" +#include "ovs-rcu.h" +#include "random.h" +#include "util.h" + +COVERAGE_DEFINE(cmap_expand); +COVERAGE_DEFINE(cmap_shrink); + +/* Optimistic Concurrent Cuckoo Hash + * ================================= + * + * A "cuckoo hash" is an open addressing hash table schema, designed such that + * a given element can be in one of only a small number of buckets 'd', each of + * which holds up to a small number 'k' elements. Thus, the expected and + * worst-case lookup times are O(1) because they require comparing no more than + * a fixed number of elements (k * d). Inserting a new element can require + * moving around existing elements, but it is also O(1) amortized expected + * time. + * + * An optimistic concurrent hash table goes one step further, making it + * possible for a single writer to execute concurrently with any number of + * readers without requiring the readers to take any locks. + * + * This cuckoo hash implementation uses: + * + * - Two hash functions (d=2). More hash functions allow for a higher load + * factor, but increasing 'k' is easier and the benefits of increasing 'd' + * quickly fall off with the 'k' values used here. Also, the method of + * generating hashes used in this implementation is hard to reasonably + * extend beyond d=2. Finally, each additional hash function means that a + * lookup has to look at least one extra cache line. + * + * - 5 or 7 elements per bucket (k=5 or k=7), chosen to make buckets + * exactly one cache line in size. + * + * According to Erlingsson [4], these parameters suggest a maximum load factor + * of about 93%. The current implementation is conservative, expanding the + * hash table when it is over 85% full. + * + * When the load factor is below 20%, the hash table will be shrinked by half. + * This is to reduce the memory utilization of the hash table and to avoid + * the hash table occupying the top of heap chunk which prevents the trimming + * of heap. + * + * Hash Functions + * ============== + * + * A cuckoo hash requires multiple hash functions. When reorganizing the hash + * becomes too difficult, it also requires the ability to change the hash + * functions. Requiring the client to provide multiple hashes and to be able + * to change them to new hashes upon insertion is inconvenient. + * + * This implementation takes another approach. The client provides a single, + * fixed hash. The cuckoo hash internally "rehashes" this hash against a + * randomly selected basis value (see rehash()). This rehashed value is one of + * the two hashes. The other hash is computed by 16-bit circular rotation of + * the rehashed value. Updating the basis changes the hash functions. + * + * To work properly, the hash functions used by a cuckoo hash must be + * independent. If one hash function is a function of the other (e.g. h2(x) = + * h1(x) + 1, or h2(x) = hash(h1(x))), then insertion will eventually fail + * catastrophically (loop forever) because of collisions. With this rehashing + * technique, the two hashes are completely independent for masks up to 16 bits + * wide. For masks wider than 16 bits, only 32-n bits are independent between + * the two hashes. Thus, it becomes risky to grow a cuckoo hash table beyond + * about 2**24 buckets (about 71 million elements with k=5 and maximum load + * 85%). Fortunately, Open vSwitch does not normally deal with hash tables + * this large. + * + * + * Handling Duplicates + * =================== + * + * This cuckoo hash table implementation deals with duplicate client-provided + * hash values by chaining: the second and subsequent cmap_nodes with a given + * hash are chained off the initially inserted node's 'next' member. The hash + * table maintains the invariant that a single client-provided hash value + * exists in only a single chain in a single bucket (even though that hash + * could be stored in two buckets). + * + * + * References + * ========== + * + * [1] D. Zhou, B. Fan, H. Lim, M. Kaminsky, D. G. Andersen, "Scalable, High + * Performance Ethernet Forwarding with CuckooSwitch". In Proc. 9th + * CoNEXT, Dec. 2013. + * + * [2] B. Fan, D. G. Andersen, and M. Kaminsky. "MemC3: Compact and concurrent + * memcache with dumber caching and smarter hashing". In Proc. 10th USENIX + * NSDI, Apr. 2013 + * + * [3] R. Pagh and F. Rodler. "Cuckoo hashing". Journal of Algorithms, 51(2): + * 122-144, May 2004. + * + * [4] U. Erlingsson, M. Manasse, F. McSherry, "A Cool and Practical + * Alternative to Traditional Hash Tables". In Proc. 7th Workshop on + * Distributed Data and Structures (WDAS'06), 2006. + */ +/* An entry is an int and a pointer: 8 bytes on 32-bit, 12 bytes on 64-bit. */ +#define CMAP_ENTRY_SIZE (4 + (UINTPTR_MAX == UINT32_MAX ? 4 : 8)) + +/* Number of entries per bucket: 7 on 32-bit, 5 on 64-bit. */ +#define CMAP_K ((CACHE_LINE_SIZE - 4) / CMAP_ENTRY_SIZE) + +/* Pad to make a bucket a full cache line in size: 4 on 32-bit, 0 on 64-bit. */ +#define CMAP_PADDING ((CACHE_LINE_SIZE - 4) - (CMAP_K * CMAP_ENTRY_SIZE)) + +/* A cuckoo hash bucket. Designed to be cache-aligned and exactly one cache + * line long. */ +struct cmap_bucket { + /* Allows readers to track in-progress changes. Initially zero, each + * writer increments this value just before and just after each change (see + * cmap_set_bucket()). Thus, a reader can ensure that it gets a consistent + * snapshot by waiting for the counter to become even (see + * read_even_counter()), then checking that its value does not change while + * examining the bucket (see cmap_find()). */ + atomic_uint32_t counter; + + /* (hash, node) slots. They are parallel arrays instead of an array of + * structs to reduce the amount of space lost to padding. + * + * The slots are in no particular order. A null pointer indicates that a + * pair is unused. In-use slots are not necessarily in the earliest + * slots. */ + uint32_t hashes[CMAP_K]; + struct cmap_node nodes[CMAP_K]; + + /* Padding to make cmap_bucket exactly one cache line long. */ +#if CMAP_PADDING > 0 + uint8_t pad[CMAP_PADDING]; +#endif +}; +BUILD_ASSERT_DECL(sizeof(struct cmap_bucket) == CACHE_LINE_SIZE); + +/* Default maximum load factor (as a fraction of UINT32_MAX + 1) before + * enlarging a cmap. Reasonable values lie between about 75% and 93%. Smaller + * values waste memory; larger values increase the average insertion time. */ +#define CMAP_MAX_LOAD ((uint32_t) (UINT32_MAX * .85)) + +/* Default minimum load factor (as a fraction of UINT32_MAX + 1) before + * shrinking a cmap. Currently, the value is chosen to be 20%, this + * means cmap will have a 40% load factor after shrink. */ +#define CMAP_MIN_LOAD ((uint32_t) (UINT32_MAX * .20)) + +/* The implementation of a concurrent hash map. */ +struct cmap_impl { + unsigned int n; /* Number of in-use elements. */ + unsigned int max_n; /* Max elements before enlarging. */ + unsigned int min_n; /* Min elements before shrinking. */ + uint32_t mask; /* Number of 'buckets', minus one. */ + uint32_t basis; /* Basis for rehashing client's hash values. */ + + /* Padding to make cmap_impl exactly one cache line long. */ + uint8_t pad[CACHE_LINE_SIZE - sizeof(unsigned int) * 5]; + + struct cmap_bucket buckets[]; +}; +BUILD_ASSERT_DECL(sizeof(struct cmap_impl) == CACHE_LINE_SIZE); + +static struct cmap_impl *cmap_rehash(struct cmap *, uint32_t mask); + +/* Explicit inline keywords in utility functions seem to be necessary + * to prevent performance regression on cmap_find(). */ + +/* Given a rehashed value 'hash', returns the other hash for that rehashed + * value. This is symmetric: other_hash(other_hash(x)) == x. (See also "Hash + * Functions" at the top of this file.) */ +static inline uint32_t +other_hash(uint32_t hash) +{ + return (hash << 16) | (hash >> 16); +} + +/* Returns the rehashed value for 'hash' within 'impl'. (See also "Hash + * Functions" at the top of this file.) */ +static inline uint32_t +rehash(const struct cmap_impl *impl, uint32_t hash) +{ + return hash_finish(impl->basis, hash); +} + +/* Not always without the inline keyword. */ +static inline struct cmap_impl * +cmap_get_impl(const struct cmap *cmap) +{ + return ovsrcu_get(struct cmap_impl *, &cmap->impl); +} + +static uint32_t +calc_max_n(uint32_t mask) +{ + return ((uint64_t) (mask + 1) * CMAP_K * CMAP_MAX_LOAD) >> 32; +} + +static uint32_t +calc_min_n(uint32_t mask) +{ + return ((uint64_t) (mask + 1) * CMAP_K * CMAP_MIN_LOAD) >> 32; +} + +static struct cmap_impl * +cmap_impl_create(uint32_t mask) +{ + struct cmap_impl *impl; + + ovs_assert(is_pow2(mask + 1)); + + impl = xzalloc_cacheline(sizeof *impl + + (mask + 1) * sizeof *impl->buckets); + impl->n = 0; + impl->max_n = calc_max_n(mask); + impl->min_n = calc_min_n(mask); + impl->mask = mask; + impl->basis = random_uint32(); + + return impl; +} + +/* Initializes 'cmap' as an empty concurrent hash map. */ +void +cmap_init(struct cmap *cmap) +{ + ovsrcu_set(&cmap->impl, cmap_impl_create(0)); +} + +/* Destroys 'cmap'. + * + * The client is responsible for destroying any data previously held in + * 'cmap'. */ +void +cmap_destroy(struct cmap *cmap) +{ + if (cmap) { + ovsrcu_postpone(free_cacheline, cmap_get_impl(cmap)); + } +} + +/* Returns the number of elements in 'cmap'. */ +size_t +cmap_count(const struct cmap *cmap) +{ + return cmap_get_impl(cmap)->n; +} + +/* Returns true if 'cmap' is empty, false otherwise. */ +bool +cmap_is_empty(const struct cmap *cmap) +{ + return cmap_count(cmap) == 0; +} + +static inline uint32_t +read_counter(const struct cmap_bucket *bucket_) +{ + struct cmap_bucket *bucket = CONST_CAST(struct cmap_bucket *, bucket_); + uint32_t counter; + + atomic_read_explicit(&bucket->counter, &counter, memory_order_acquire); + + return counter; +} + +static inline uint32_t +read_even_counter(const struct cmap_bucket *bucket) +{ + uint32_t counter; + + do { + counter = read_counter(bucket); + } while (OVS_UNLIKELY(counter & 1)); + + return counter; +} + +static inline bool +counter_changed(const struct cmap_bucket *b_, uint32_t c) +{ + struct cmap_bucket *b = CONST_CAST(struct cmap_bucket *, b_); + uint32_t counter; + + /* Need to make sure the counter read is not moved up, before the hash and + * cmap_node_next(). Using atomic_read_explicit with memory_order_acquire + * would allow prior reads to be moved after the barrier. + * atomic_thread_fence prevents all following memory accesses from moving + * prior to preceding loads. */ + atomic_thread_fence(memory_order_acquire); + atomic_read_relaxed(&b->counter, &counter); + + return OVS_UNLIKELY(counter != c); +} + +static inline const struct cmap_node * +cmap_find_in_bucket(const struct cmap_bucket *bucket, uint32_t hash) +{ + for (int i = 0; i < CMAP_K; i++) { + if (bucket->hashes[i] == hash) { + return cmap_node_next(&bucket->nodes[i]); + } + } + return NULL; +} + +static inline const struct cmap_node * +cmap_find__(const struct cmap_bucket *b1, const struct cmap_bucket *b2, + uint32_t hash) +{ + uint32_t c1, c2; + const struct cmap_node *node; + + do { + do { + c1 = read_even_counter(b1); + node = cmap_find_in_bucket(b1, hash); + } while (OVS_UNLIKELY(counter_changed(b1, c1))); + if (node) { + break; + } + do { + c2 = read_even_counter(b2); + node = cmap_find_in_bucket(b2, hash); + } while (OVS_UNLIKELY(counter_changed(b2, c2))); + if (node) { + break; + } + } while (OVS_UNLIKELY(counter_changed(b1, c1))); + + return node; +} + +/* Searches 'cmap' for an element with the specified 'hash'. If one or more is + * found, returns a pointer to the first one, otherwise a null pointer. All of + * the nodes on the returned list are guaranteed to have exactly the given + * 'hash'. + * + * This function works even if 'cmap' is changing concurrently. If 'cmap' is + * not changing, then cmap_find_protected() is slightly faster. + * + * CMAP_FOR_EACH_WITH_HASH is usually more convenient. */ +const struct cmap_node * +cmap_find(const struct cmap *cmap, uint32_t hash) +{ + const struct cmap_impl *impl = cmap_get_impl(cmap); + uint32_t h1 = rehash(impl, hash); + uint32_t h2 = other_hash(h1); + + return cmap_find__(&impl->buckets[h1 & impl->mask], + &impl->buckets[h2 & impl->mask], + hash); +} + +/* Looks up multiple 'hashes', when the corresponding bit in 'map' is 1, + * and sets the corresponding pointer in 'nodes', if the hash value was + * found from the 'cmap'. In other cases the 'nodes' values are not changed, + * i.e., no NULL pointers are stored there. + * Returns a map where a bit is set to 1 if the corresponding 'nodes' pointer + * was stored, 0 otherwise. + * Generally, the caller wants to use CMAP_NODE_FOR_EACH to verify for + * hash collisions. */ +unsigned long +cmap_find_batch(const struct cmap *cmap, unsigned long map, + uint32_t hashes[], const struct cmap_node *nodes[]) +{ + const struct cmap_impl *impl = cmap_get_impl(cmap); + unsigned long result = map; + int i; + uint32_t h1s[sizeof map * CHAR_BIT]; + const struct cmap_bucket *b1s[sizeof map * CHAR_BIT]; + const struct cmap_bucket *b2s[sizeof map * CHAR_BIT]; + uint32_t c1s[sizeof map * CHAR_BIT]; + + /* Compute hashes and prefetch 1st buckets. */ + ULONG_FOR_EACH_1(i, map) { + h1s[i] = rehash(impl, hashes[i]); + b1s[i] = &impl->buckets[h1s[i] & impl->mask]; + OVS_PREFETCH(b1s[i]); + } + /* Lookups, Round 1. Only look up at the first bucket. */ + ULONG_FOR_EACH_1(i, map) { + uint32_t c1; + const struct cmap_bucket *b1 = b1s[i]; + const struct cmap_node *node; + + do { + c1 = read_even_counter(b1); + node = cmap_find_in_bucket(b1, hashes[i]); + } while (OVS_UNLIKELY(counter_changed(b1, c1))); + + if (!node) { + /* Not found (yet); Prefetch the 2nd bucket. */ + b2s[i] = &impl->buckets[other_hash(h1s[i]) & impl->mask]; + OVS_PREFETCH(b2s[i]); + c1s[i] = c1; /* We may need to check this after Round 2. */ + continue; + } + /* Found. */ + ULONG_SET0(map, i); /* Ignore this on round 2. */ + OVS_PREFETCH(node); + nodes[i] = node; + } + /* Round 2. Look into the 2nd bucket, if needed. */ + ULONG_FOR_EACH_1(i, map) { + uint32_t c2; + const struct cmap_bucket *b2 = b2s[i]; + const struct cmap_node *node; + + do { + c2 = read_even_counter(b2); + node = cmap_find_in_bucket(b2, hashes[i]); + } while (OVS_UNLIKELY(counter_changed(b2, c2))); + + if (!node) { + /* Not found, but the node may have been moved from b2 to b1 right + * after we finished with b1 earlier. We just got a clean reading + * of the 2nd bucket, so we check the counter of the 1st bucket + * only. However, we need to check both buckets again, as the + * entry may be moved again to the 2nd bucket. Basically, we + * need to loop as long as it takes to get stable readings of + * both buckets. cmap_find__() does that, and now that we have + * fetched both buckets we can just use it. */ + if (OVS_UNLIKELY(counter_changed(b1s[i], c1s[i]))) { + node = cmap_find__(b1s[i], b2s[i], hashes[i]); + if (node) { + goto found; + } + } + /* Not found. */ + ULONG_SET0(result, i); /* Fix the result. */ + continue; + } +found: + OVS_PREFETCH(node); + nodes[i] = node; + } + return result; +} + +static int +cmap_find_slot_protected(struct cmap_bucket *b, uint32_t hash) +{ + int i; + + for (i = 0; i < CMAP_K; i++) { + if (b->hashes[i] == hash && cmap_node_next_protected(&b->nodes[i])) { + return i; + } + } + return -1; +} + +static struct cmap_node * +cmap_find_bucket_protected(struct cmap_impl *impl, uint32_t hash, uint32_t h) +{ + struct cmap_bucket *b = &impl->buckets[h & impl->mask]; + int i; + + for (i = 0; i < CMAP_K; i++) { + if (b->hashes[i] == hash) { + return cmap_node_next_protected(&b->nodes[i]); + } + } + return NULL; +} + +/* Like cmap_find(), but only for use if 'cmap' cannot change concurrently. + * + * CMAP_FOR_EACH_WITH_HASH_PROTECTED is usually more convenient. */ +struct cmap_node * +cmap_find_protected(const struct cmap *cmap, uint32_t hash) +{ + struct cmap_impl *impl = cmap_get_impl(cmap); + uint32_t h1 = rehash(impl, hash); + uint32_t h2 = other_hash(hash); + struct cmap_node *node; + + node = cmap_find_bucket_protected(impl, hash, h1); + if (node) { + return node; + } + return cmap_find_bucket_protected(impl, hash, h2); +} + +static int +cmap_find_empty_slot_protected(const struct cmap_bucket *b) +{ + int i; + + for (i = 0; i < CMAP_K; i++) { + if (!cmap_node_next_protected(&b->nodes[i])) { + return i; + } + } + return -1; +} + +static void +cmap_set_bucket(struct cmap_bucket *b, int i, + struct cmap_node *node, uint32_t hash) +{ + uint32_t c; + + atomic_read_explicit(&b->counter, &c, memory_order_acquire); + atomic_store_explicit(&b->counter, c + 1, memory_order_release); + ovsrcu_set(&b->nodes[i].next, node); /* Also atomic. */ + b->hashes[i] = hash; + atomic_store_explicit(&b->counter, c + 2, memory_order_release); +} + +/* Searches 'b' for a node with the given 'hash'. If it finds one, adds + * 'new_node' to the node's linked list and returns true. If it does not find + * one, returns false. */ +static bool +cmap_insert_dup(struct cmap_node *new_node, uint32_t hash, + struct cmap_bucket *b) +{ + int i; + + for (i = 0; i < CMAP_K; i++) { + if (b->hashes[i] == hash) { + struct cmap_node *node = cmap_node_next_protected(&b->nodes[i]); + + if (node) { + struct cmap_node *p; + + /* The common case is that 'new_node' is a singleton, + * with a null 'next' pointer. Rehashing can add a + * longer chain, but due to our invariant of always + * having all nodes with the same (user) hash value at + * a single chain, rehashing will always insert the + * chain to an empty node. The only way we can end up + * here is by the user inserting a chain of nodes at + * once. Find the end of the chain starting at + * 'new_node', then splice 'node' to the end of that + * chain. */ + p = new_node; + for (;;) { + struct cmap_node *next = cmap_node_next_protected(p); + + if (!next) { + break; + } + p = next; + } + ovsrcu_set_hidden(&p->next, node); + } else { + /* The hash value is there from some previous insertion, but + * the associated node has been removed. We're not really + * inserting a duplicate, but we can still reuse the slot. + * Carry on. */ + } + + /* Change the bucket to point to 'new_node'. This is a degenerate + * form of cmap_set_bucket() that doesn't update the counter since + * we're only touching one field and in a way that doesn't change + * the bucket's meaning for readers. */ + ovsrcu_set(&b->nodes[i].next, new_node); + + return true; + } + } + return false; +} + +/* Searches 'b' for an empty slot. If successful, stores 'node' and 'hash' in + * the slot and returns true. Otherwise, returns false. */ +static bool +cmap_insert_bucket(struct cmap_node *node, uint32_t hash, + struct cmap_bucket *b) +{ + int i; + + for (i = 0; i < CMAP_K; i++) { + if (!cmap_node_next_protected(&b->nodes[i])) { + cmap_set_bucket(b, i, node, hash); + return true; + } + } + return false; +} + +/* Returns the other bucket that b->nodes[slot] could occupy in 'impl'. (This + * might be the same as 'b'.) */ +static struct cmap_bucket * +other_bucket_protected(struct cmap_impl *impl, struct cmap_bucket *b, int slot) +{ + uint32_t h1 = rehash(impl, b->hashes[slot]); + uint32_t h2 = other_hash(h1); + uint32_t b_idx = b - impl->buckets; + uint32_t other_h = (h1 & impl->mask) == b_idx ? h2 : h1; + + return &impl->buckets[other_h & impl->mask]; +} + +/* 'new_node' is to be inserted into 'impl', but both candidate buckets 'b1' + * and 'b2' are full. This function attempts to rearrange buckets within + * 'impl' to make room for 'new_node'. + * + * The implementation is a general-purpose breadth-first search. At first + * glance, this is more complex than a random walk through 'impl' (suggested by + * some references), but random walks have a tendency to loop back through a + * single bucket. We have to move nodes backward along the path that we find, + * so that no node actually disappears from the hash table, which means a + * random walk would have to be careful to deal with loops. By contrast, a + * successful breadth-first search always finds a *shortest* path through the + * hash table, and a shortest path will never contain loops, so it avoids that + * problem entirely. + */ +static bool +cmap_insert_bfs(struct cmap_impl *impl, struct cmap_node *new_node, + uint32_t hash, struct cmap_bucket *b1, struct cmap_bucket *b2) +{ + enum { MAX_DEPTH = 4 }; + + /* A path from 'start' to 'end' via the 'n' steps in 'slots[]'. + * + * One can follow the path via: + * + * struct cmap_bucket *b; + * int i; + * + * b = path->start; + * for (i = 0; i < path->n; i++) { + * b = other_bucket_protected(impl, b, path->slots[i]); + * } + * ovs_assert(b == path->end); + */ + struct cmap_path { + struct cmap_bucket *start; /* First bucket along the path. */ + struct cmap_bucket *end; /* Last bucket on the path. */ + uint8_t slots[MAX_DEPTH]; /* Slots used for each hop. */ + int n; /* Number of slots[]. */ + }; + + /* We need to limit the amount of work we do trying to find a path. It + * might actually be impossible to rearrange the cmap, and after some time + * it is likely to be easier to rehash the entire cmap. + * + * This value of MAX_QUEUE is an arbitrary limit suggested by one of the + * references. Empirically, it seems to work OK. */ + enum { MAX_QUEUE = 500 }; + struct cmap_path queue[MAX_QUEUE]; + int head = 0; + int tail = 0; + + /* Add 'b1' and 'b2' as starting points for the search. */ + queue[head].start = b1; + queue[head].end = b1; + queue[head].n = 0; + head++; + if (b1 != b2) { + queue[head].start = b2; + queue[head].end = b2; + queue[head].n = 0; + head++; + } + + while (tail < head) { + const struct cmap_path *path = &queue[tail++]; + struct cmap_bucket *this = path->end; + int i; + + for (i = 0; i < CMAP_K; i++) { + struct cmap_bucket *next = other_bucket_protected(impl, this, i); + int j; + + if (this == next) { + continue; + } + + j = cmap_find_empty_slot_protected(next); + if (j >= 0) { + /* We've found a path along which we can rearrange the hash + * table: Start at path->start, follow all the slots in + * path->slots[], then follow slot 'i', then the bucket you + * arrive at has slot 'j' empty. */ + struct cmap_bucket *buckets[MAX_DEPTH + 2]; + int slots[MAX_DEPTH + 2]; + int k; + + /* Figure out the full sequence of slots. */ + for (k = 0; k < path->n; k++) { + slots[k] = path->slots[k]; + } + slots[path->n] = i; + slots[path->n + 1] = j; + + /* Figure out the full sequence of buckets. */ + buckets[0] = path->start; + for (k = 0; k <= path->n; k++) { + buckets[k + 1] = other_bucket_protected(impl, buckets[k], slots[k]); + } + + /* Now the path is fully expressed. One can start from + * buckets[0], go via slots[0] to buckets[1], via slots[1] to + * buckets[2], and so on. + * + * Move all the nodes across the path "backward". After each + * step some node appears in two buckets. Thus, every node is + * always visible to a concurrent search. */ + for (k = path->n + 1; k > 0; k--) { + int slot = slots[k - 1]; + + cmap_set_bucket( + buckets[k], slots[k], + cmap_node_next_protected(&buckets[k - 1]->nodes[slot]), + buckets[k - 1]->hashes[slot]); + } + + /* Finally, replace the first node on the path by + * 'new_node'. */ + cmap_set_bucket(buckets[0], slots[0], new_node, hash); + + return true; + } + + if (path->n < MAX_DEPTH && head < MAX_QUEUE) { + struct cmap_path *new_path = &queue[head++]; + + *new_path = *path; + new_path->end = next; + new_path->slots[new_path->n++] = i; + } + } + } + + return false; +} + +/* Adds 'node', with the given 'hash', to 'impl'. + * + * 'node' is ordinarily a single node, with a null 'next' pointer. When + * rehashing, however, it may be a longer chain of nodes. */ +static bool +cmap_try_insert(struct cmap_impl *impl, struct cmap_node *node, uint32_t hash) +{ + uint32_t h1 = rehash(impl, hash); + uint32_t h2 = other_hash(h1); + struct cmap_bucket *b1 = &impl->buckets[h1 & impl->mask]; + struct cmap_bucket *b2 = &impl->buckets[h2 & impl->mask]; + + return (OVS_UNLIKELY(cmap_insert_dup(node, hash, b1) || + cmap_insert_dup(node, hash, b2)) || + OVS_LIKELY(cmap_insert_bucket(node, hash, b1) || + cmap_insert_bucket(node, hash, b2)) || + cmap_insert_bfs(impl, node, hash, b1, b2)); +} + +/* Inserts 'node', with the given 'hash', into 'cmap'. The caller must ensure + * that 'cmap' cannot change concurrently (from another thread). If duplicates + * are undesirable, the caller must have already verified that 'cmap' does not + * contain a duplicate of 'node'. + * + * Returns the current number of nodes in the cmap after the insertion. */ +size_t +cmap_insert(struct cmap *cmap, struct cmap_node *node, uint32_t hash) +{ + struct cmap_impl *impl = cmap_get_impl(cmap); + + ovsrcu_set_hidden(&node->next, NULL); + + if (OVS_UNLIKELY(impl->n >= impl->max_n)) { + COVERAGE_INC(cmap_expand); + impl = cmap_rehash(cmap, (impl->mask << 1) | 1); + } + + while (OVS_UNLIKELY(!cmap_try_insert(impl, node, hash))) { + impl = cmap_rehash(cmap, impl->mask); + } + return ++impl->n; +} + +static bool +cmap_replace__(struct cmap_impl *impl, struct cmap_node *node, + struct cmap_node *replacement, uint32_t hash, uint32_t h) +{ + struct cmap_bucket *b = &impl->buckets[h & impl->mask]; + int slot; + + slot = cmap_find_slot_protected(b, hash); + if (slot < 0) { + return false; + } + + /* The pointer to 'node' is changed to point to 'replacement', + * which is the next node if no replacement node is given. */ + if (!replacement) { + replacement = cmap_node_next_protected(node); + } else { + /* 'replacement' takes the position of 'node' in the list. */ + ovsrcu_set_hidden(&replacement->next, cmap_node_next_protected(node)); + } + + struct cmap_node *iter = &b->nodes[slot]; + for (;;) { + struct cmap_node *next = cmap_node_next_protected(iter); + + if (next == node) { + ovsrcu_set(&iter->next, replacement); + return true; + } + iter = next; + } +} + +/* Replaces 'old_node' in 'cmap' with 'new_node'. The caller must + * ensure that 'cmap' cannot change concurrently (from another thread). + * + * 'old_node' must not be destroyed or modified or inserted back into 'cmap' or + * into any other concurrent hash map while any other thread might be accessing + * it. One correct way to do this is to free it from an RCU callback with + * ovsrcu_postpone(). + * + * Returns the current number of nodes in the cmap after the replacement. The + * number of nodes decreases by one if 'new_node' is NULL. */ +size_t +cmap_replace(struct cmap *cmap, struct cmap_node *old_node, + struct cmap_node *new_node, uint32_t hash) +{ + struct cmap_impl *impl = cmap_get_impl(cmap); + uint32_t h1 = rehash(impl, hash); + uint32_t h2 = other_hash(h1); + bool ok; + + ok = cmap_replace__(impl, old_node, new_node, hash, h1) + || cmap_replace__(impl, old_node, new_node, hash, h2); + ovs_assert(ok); + + if (!new_node) { + impl->n--; + if (OVS_UNLIKELY(impl->n < impl->min_n)) { + COVERAGE_INC(cmap_shrink); + impl = cmap_rehash(cmap, impl->mask >> 1); + } + } + return impl->n; +} + +static bool +cmap_try_rehash(const struct cmap_impl *old, struct cmap_impl *new) +{ + const struct cmap_bucket *b; + + for (b = old->buckets; b <= &old->buckets[old->mask]; b++) { + int i; + + for (i = 0; i < CMAP_K; i++) { + /* possible optimization here because we know the hashes are + * unique */ + struct cmap_node *node = cmap_node_next_protected(&b->nodes[i]); + + if (node && !cmap_try_insert(new, node, b->hashes[i])) { + return false; + } + } + } + return true; +} + +static struct cmap_impl * +cmap_rehash(struct cmap *cmap, uint32_t mask) +{ + struct cmap_impl *old = cmap_get_impl(cmap); + struct cmap_impl *new; + + new = cmap_impl_create(mask); + ovs_assert(old->n < new->max_n); + + while (!cmap_try_rehash(old, new)) { + memset(new->buckets, 0, (mask + 1) * sizeof *new->buckets); + new->basis = random_uint32(); + } + + new->n = old->n; + ovsrcu_set(&cmap->impl, new); + ovsrcu_postpone(free_cacheline, old); + + return new; +} + +struct cmap_cursor +cmap_cursor_start(const struct cmap *cmap) +{ + struct cmap_cursor cursor; + + cursor.impl = cmap_get_impl(cmap); + cursor.bucket_idx = 0; + cursor.entry_idx = 0; + cursor.node = NULL; + cmap_cursor_advance(&cursor); + + return cursor; +} + +void +cmap_cursor_advance(struct cmap_cursor *cursor) +{ + const struct cmap_impl *impl = cursor->impl; + + if (cursor->node) { + cursor->node = cmap_node_next(cursor->node); + if (cursor->node) { + return; + } + } + + while (cursor->bucket_idx <= impl->mask) { + const struct cmap_bucket *b = &impl->buckets[cursor->bucket_idx]; + + while (cursor->entry_idx < CMAP_K) { + cursor->node = cmap_node_next(&b->nodes[cursor->entry_idx++]); + if (cursor->node) { + return; + } + } + + cursor->bucket_idx++; + cursor->entry_idx = 0; + } +} + +/* Returns the next node in 'cmap' in hash order, or NULL if no nodes remain in + * 'cmap'. Uses '*pos' to determine where to begin iteration, and updates + * '*pos' to pass on the next iteration into them before returning. + * + * It's better to use plain CMAP_FOR_EACH and related functions, since they are + * faster and better at dealing with cmaps that change during iteration. + * + * Before beginning iteration, set '*pos' to all zeros. */ +struct cmap_node * +cmap_next_position(const struct cmap *cmap, + struct cmap_position *pos) +{ + struct cmap_impl *impl = cmap_get_impl(cmap); + unsigned int bucket = pos->bucket; + unsigned int entry = pos->entry; + unsigned int offset = pos->offset; + + while (bucket <= impl->mask) { + const struct cmap_bucket *b = &impl->buckets[bucket]; + + while (entry < CMAP_K) { + const struct cmap_node *node = cmap_node_next(&b->nodes[entry]); + unsigned int i; + + for (i = 0; node; i++, node = cmap_node_next(node)) { + if (i == offset) { + if (cmap_node_next(node)) { + offset++; + } else { + entry++; + offset = 0; + } + pos->bucket = bucket; + pos->entry = entry; + pos->offset = offset; + return CONST_CAST(struct cmap_node *, node); + } + } + + entry++; + offset = 0; + } + + bucket++; + entry = offset = 0; + } + + pos->bucket = pos->entry = pos->offset = 0; + return NULL; +} diff -Nru openvswitch-2.3.1/lib/cmap.h openvswitch-2.4.0~git20150623/lib/cmap.h --- openvswitch-2.3.1/lib/cmap.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/cmap.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CMAP_H +#define CMAP_H 1 + +#include +#include +#include "ovs-rcu.h" +#include "util.h" + +/* Concurrent hash map + * =================== + * + * A single-writer, multiple-reader hash table that efficiently supports + * duplicates. + * + * + * Thread-safety + * ============= + * + * The general rules are: + * + * - Only a single thread may safely call into cmap_insert(), + * cmap_remove(), or cmap_replace() at any given time. + * + * - Any number of threads may use functions and macros that search or + * iterate through a given cmap, even in parallel with other threads + * calling cmap_insert(), cmap_remove(), or cmap_replace(). + * + * There is one exception: cmap_find_protected() is only safe if no thread + * is currently calling cmap_insert(), cmap_remove(), or cmap_replace(). + * (Use ordinary cmap_find() if that is not guaranteed.) + * + * - See "Iteration" below for additional thread safety rules. + * + * Writers must use special care to ensure that any elements that they remove + * do not get freed or reused until readers have finished with them. This + * includes inserting the element back into its original cmap or a different + * one. One correct way to do this is to free them from an RCU callback with + * ovsrcu_postpone(). + */ + +/* A concurrent hash map node, to be embedded inside the data structure being + * mapped. + * + * All nodes linked together on a chain have exactly the same hash value. */ +struct cmap_node { + OVSRCU_TYPE(struct cmap_node *) next; /* Next node with same hash. */ +}; + +static inline struct cmap_node * +cmap_node_next(const struct cmap_node *node) +{ + return ovsrcu_get(struct cmap_node *, &node->next); +} + +static inline struct cmap_node * +cmap_node_next_protected(const struct cmap_node *node) +{ + return ovsrcu_get_protected(struct cmap_node *, &node->next); +} + +/* Concurrent hash map. */ +struct cmap { + OVSRCU_TYPE(struct cmap_impl *) impl; +}; + +/* Initialization. */ +void cmap_init(struct cmap *); +void cmap_destroy(struct cmap *); + +/* Count. */ +size_t cmap_count(const struct cmap *); +bool cmap_is_empty(const struct cmap *); + +/* Insertion and deletion. Return the current count after the operation. */ +size_t cmap_insert(struct cmap *, struct cmap_node *, uint32_t hash); +static inline size_t cmap_remove(struct cmap *, struct cmap_node *, + uint32_t hash); +size_t cmap_replace(struct cmap *, struct cmap_node *old_node, + struct cmap_node *new_node, uint32_t hash); + +/* Search. + * + * These macros iterate NODE over all of the nodes in CMAP that have hash value + * equal to HASH. MEMBER must be the name of the 'struct cmap_node' member + * within NODE. + * + * CMAP and HASH are evaluated only once. NODE is evaluated many times. + * + * + * Thread-safety + * ============= + * + * CMAP_NODE_FOR_EACH will reliably visit each of the nodes starting with + * CMAP_NODE, even with concurrent insertions and deletions. (Of + * course, if nodes are being inserted or deleted, it might or might not visit + * the nodes actually being inserted or deleted.) + * + * CMAP_NODE_FOR_EACH_PROTECTED may only be used if the containing CMAP is + * guaranteed not to change during iteration. It may be only slightly faster. + * + * CMAP_FOR_EACH_WITH_HASH will reliably visit each of the nodes with the + * specified hash in CMAP, even with concurrent insertions and deletions. (Of + * course, if nodes with the given HASH are being inserted or deleted, it might + * or might not visit the nodes actually being inserted or deleted.) + * + * CMAP_FOR_EACH_WITH_HASH_PROTECTED may only be used if CMAP is guaranteed not + * to change during iteration. It may be very slightly faster. + */ +#define CMAP_NODE_FOR_EACH(NODE, MEMBER, CMAP_NODE) \ + for (INIT_CONTAINER(NODE, CMAP_NODE, MEMBER); \ + (NODE) != OBJECT_CONTAINING(NULL, NODE, MEMBER); \ + ASSIGN_CONTAINER(NODE, cmap_node_next(&(NODE)->MEMBER), MEMBER)) +#define CMAP_NODE_FOR_EACH_PROTECTED(NODE, MEMBER, CMAP_NODE) \ + for (INIT_CONTAINER(NODE, CMAP_NODE, MEMBER); \ + (NODE) != OBJECT_CONTAINING(NULL, NODE, MEMBER); \ + ASSIGN_CONTAINER(NODE, cmap_node_next_protected(&(NODE)->MEMBER), \ + MEMBER)) +#define CMAP_FOR_EACH_WITH_HASH(NODE, MEMBER, HASH, CMAP) \ + CMAP_NODE_FOR_EACH(NODE, MEMBER, cmap_find(CMAP, HASH)) +#define CMAP_FOR_EACH_WITH_HASH_PROTECTED(NODE, MEMBER, HASH, CMAP) \ + CMAP_NODE_FOR_EACH_PROTECTED(NODE, MEMBER, cmap_find_locked(CMAP, HASH)) + +const struct cmap_node *cmap_find(const struct cmap *, uint32_t hash); +struct cmap_node *cmap_find_protected(const struct cmap *, uint32_t hash); + +/* Looks up multiple 'hashes', when the corresponding bit in 'map' is 1, + * and sets the corresponding pointer in 'nodes', if the hash value was + * found from the 'cmap'. In other cases the 'nodes' values are not changed, + * i.e., no NULL pointers are stored there. + * Returns a map where a bit is set to 1 if the corresponding 'nodes' pointer + * was stored, 0 otherwise. + * Generally, the caller wants to use CMAP_NODE_FOR_EACH to verify for + * hash collisions. */ +unsigned long cmap_find_batch(const struct cmap *cmap, unsigned long map, + uint32_t hashes[], + const struct cmap_node *nodes[]); + +/* Iteration. + * + * + * Thread-safety + * ============= + * + * Iteration is safe even in a cmap that is changing concurrently. However: + * + * - In the presence of concurrent calls to cmap_insert(), any given + * iteration might skip some nodes and might visit some nodes more than + * once. If this is a problem, then the iterating code should lock the + * data structure (a rwlock can be used to allow multiple threads to + * iterate in parallel). + * + * - Concurrent calls to cmap_remove() don't have the same problem. (A + * node being deleted may be visited once or not at all. Other nodes + * will be visited once.) + * + * + * Example + * ======= + * + * struct my_node { + * struct cmap_node cmap_node; + * int extra_data; + * }; + * + * struct cmap_cursor cursor; + * struct my_node *iter; + * struct cmap my_map; + * + * cmap_init(&cmap); + * ...add data... + * CMAP_FOR_EACH (my_node, cmap_node, &cursor, &cmap) { + * ...operate on my_node... + * } + * + * CMAP_FOR_EACH is "safe" in the sense of HMAP_FOR_EACH_SAFE. That is, it is + * safe to free the current node before going on to the next iteration. Most + * of the time, though, this doesn't matter for a cmap because node + * deallocation has to be postponed until the next grace period. This means + * that this guarantee is useful only in deallocation code already executing at + * postponed time, when it is known that the RCU grace period has already + * expired. + */ + +#define CMAP_CURSOR_FOR_EACH__(NODE, CURSOR, MEMBER) \ + ((CURSOR)->node \ + ? (INIT_CONTAINER(NODE, (CURSOR)->node, MEMBER), \ + cmap_cursor_advance(CURSOR), \ + true) \ + : false) + +#define CMAP_CURSOR_FOR_EACH(NODE, MEMBER, CURSOR, CMAP) \ + for (*(CURSOR) = cmap_cursor_start(CMAP); \ + CMAP_CURSOR_FOR_EACH__(NODE, CURSOR, MEMBER); \ + ) + +#define CMAP_CURSOR_FOR_EACH_CONTINUE(NODE, MEMBER, CURSOR) \ + while (CMAP_CURSOR_FOR_EACH__(NODE, CURSOR, MEMBER)) + +struct cmap_cursor { + const struct cmap_impl *impl; + uint32_t bucket_idx; + int entry_idx; + struct cmap_node *node; +}; + +struct cmap_cursor cmap_cursor_start(const struct cmap *); +void cmap_cursor_advance(struct cmap_cursor *); + +#define CMAP_FOR_EACH(NODE, MEMBER, CMAP) \ + for (struct cmap_cursor cursor__ = cmap_cursor_start(CMAP); \ + CMAP_CURSOR_FOR_EACH__(NODE, &cursor__, MEMBER); \ + ) + +static inline struct cmap_node *cmap_first(const struct cmap *); + +/* Another, less preferred, form of iteration, for use in situations where it + * is difficult to maintain a pointer to a cmap_node. */ +struct cmap_position { + unsigned int bucket; + unsigned int entry; + unsigned int offset; +}; + +struct cmap_node *cmap_next_position(const struct cmap *, + struct cmap_position *); + +/* Returns the first node in 'cmap', in arbitrary order, or a null pointer if + * 'cmap' is empty. */ +static inline struct cmap_node * +cmap_first(const struct cmap *cmap) +{ + struct cmap_position pos = { 0, 0, 0 }; + + return cmap_next_position(cmap, &pos); +} + +/* Removes 'node' from 'cmap'. The caller must ensure that 'cmap' cannot + * change concurrently (from another thread). + * + * 'node' must not be destroyed or modified or inserted back into 'cmap' or + * into any other concurrent hash map while any other thread might be accessing + * it. One correct way to do this is to free it from an RCU callback with + * ovsrcu_postpone(). + * + * Returns the current number of nodes in the cmap after the removal. */ +static inline size_t +cmap_remove(struct cmap *cmap, struct cmap_node *node, uint32_t hash) +{ + return cmap_replace(cmap, node, NULL, hash); +} + +#endif /* cmap.h */ diff -Nru openvswitch-2.3.1/lib/command-line.c openvswitch-2.4.0~git20150623/lib/command-line.c --- openvswitch-2.3.1/lib/command-line.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/command-line.c 2015-06-23 18:46:21.000000000 +0000 @@ -19,9 +19,10 @@ #include #include #include +#include "dynamic-string.h" #include "ovs-thread.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(command_line); @@ -29,7 +30,7 @@ * passed to getopt() with the corresponding short options. The caller is * responsible for freeing the string. */ char * -long_options_to_short_options(const struct option options[]) +ovs_cmdl_long_options_to_short_options(const struct option options[]) { char short_options[UCHAR_MAX * 3 + 1]; char *p = short_options; @@ -51,24 +52,65 @@ return xstrdup(short_options); } +/* Given the 'struct ovs_cmdl_command' array, prints the usage of all commands. */ +void +ovs_cmdl_print_commands(const struct ovs_cmdl_command commands[]) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + + ds_put_cstr(&ds, "The available commands are:\n"); + for (; commands->name; commands++) { + const struct ovs_cmdl_command *c = commands; + ds_put_format(&ds, " %-23s %s\n", c->name, c->usage ? c->usage : ""); + } + printf("%s", ds.string); + ds_destroy(&ds); +} + +/* Given the GNU-style options in 'options', prints all options. */ +void +ovs_cmdl_print_options(const struct option options[]) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + + for (; options->name; options++) { + const struct option *o = options; + const char *arg = o->has_arg == required_argument ? "ARG" : "[ARG]"; + + ds_put_format(&ds, "--%s%s%s\n", o->name, o->has_arg ? "=" : "", + o->has_arg ? arg : ""); + if (o->flag == NULL && o->val > 0 && o->val <= UCHAR_MAX) { + ds_put_format(&ds, "-%c %s\n", o->val, o->has_arg ? arg : ""); + } + } + printf("%s", ds.string); + ds_destroy(&ds); +} + /* Runs the command designated by argv[0] within the command table specified by * 'commands', which must be terminated by a command whose 'name' member is a * null pointer. * * Command-line options should be stripped off, so that a typical invocation - * looks like "run_command(argc - optind, argv + optind, my_commands);". */ + * looks like: + * struct ovs_cmdl_context ctx = { + * .argc = argc - optind, + * .argv = argv + optind, + * }; + * ovs_cmdl_run_command(&ctx, my_commands); + * */ void -run_command(int argc, char *argv[], const struct command commands[]) +ovs_cmdl_run_command(struct ovs_cmdl_context *ctx, const struct ovs_cmdl_command commands[]) { - const struct command *p; + const struct ovs_cmdl_command *p; - if (argc < 1) { + if (ctx->argc < 1) { ovs_fatal(0, "missing command name; use --help for help"); } for (p = commands; p->name != NULL; p++) { - if (!strcmp(p->name, argv[0])) { - int n_arg = argc - 1; + if (!strcmp(p->name, ctx->argv[0])) { + int n_arg = ctx->argc - 1; if (n_arg < p->min_args) { VLOG_FATAL( "'%s' command requires at least %d arguments", p->name, p->min_args); @@ -76,7 +118,7 @@ VLOG_FATAL("'%s' command takes at most %d arguments", p->name, p->max_args); } else { - p->handler(argc, argv); + p->handler(ctx); if (ferror(stdout)) { VLOG_FATAL("write to stdout failed"); } @@ -88,7 +130,7 @@ } } - VLOG_FATAL("unknown command '%s'; use --help for help", argv[0]); + VLOG_FATAL("unknown command '%s'; use --help for help", ctx->argv[0]); } /* Process title. */ @@ -114,7 +156,7 @@ * before anything else, period, at the very beginning of program * execution. */ void -proctitle_init(int argc, char **argv) +ovs_cmdl_proctitle_init(int argc, char **argv) { int i; @@ -154,7 +196,7 @@ /* Changes the name of the process, as shown by "ps", to the program name * followed by 'format', which is formatted as if by printf(). */ void -proctitle_set(const char *format, ...) +ovs_cmdl_proctitle_set(const char *format, ...) { va_list args; int n; @@ -189,7 +231,7 @@ /* Restores the process's original command line, as seen by "ps". */ void -proctitle_restore(void) +ovs_cmdl_proctitle_restore(void) { ovs_mutex_lock(&proctitle_mutex); if (saved_proctitle) { @@ -203,20 +245,20 @@ /* Stubs that don't do anything on non-Linux systems. */ void -proctitle_init(int argc OVS_UNUSED, char **argv OVS_UNUSED) +ovs_cmdl_proctitle_init(int argc OVS_UNUSED, char **argv OVS_UNUSED) { } #if !(defined(__FreeBSD__) || defined(__NetBSD__)) /* On these platforms we #define this to setproctitle. */ void -proctitle_set(const char *format OVS_UNUSED, ...) +ovs_cmdl_proctitle_set(const char *format OVS_UNUSED, ...) { } #endif void -proctitle_restore(void) +ovs_cmdl_proctitle_restore(void) { } #endif /* !__linux__ */ diff -Nru openvswitch-2.3.1/lib/command-line.h openvswitch-2.4.0~git20150623/lib/command-line.h --- openvswitch-2.3.1/lib/command-line.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/command-line.h 2015-06-23 18:46:21.000000000 +0000 @@ -23,23 +23,38 @@ struct option; -struct command { +/* Command handler context */ +struct ovs_cmdl_context { + /* number of command line arguments */ + int argc; + /* array of command line arguments */ + char **argv; + /* private context data defined by the API user */ + void *pvt; +}; + +typedef void (*ovs_cmdl_handler)(struct ovs_cmdl_context *); + +struct ovs_cmdl_command { const char *name; + const char *usage; int min_args; int max_args; - void (*handler)(int argc, char *argv[]); + ovs_cmdl_handler handler; }; -char *long_options_to_short_options(const struct option *options); -void run_command(int argc, char *argv[], const struct command[]); +char *ovs_cmdl_long_options_to_short_options(const struct option *options); +void ovs_cmdl_print_options(const struct option *options); +void ovs_cmdl_print_commands(const struct ovs_cmdl_command *commands); +void ovs_cmdl_run_command(struct ovs_cmdl_context *, const struct ovs_cmdl_command[]); -void proctitle_init(int argc, char **argv); +void ovs_cmdl_proctitle_init(int argc, char **argv); #if defined(__FreeBSD__) || defined(__NetBSD__) -#define proctitle_set setproctitle +#define ovs_cmdl_proctitle_set setproctitle #else -void proctitle_set(const char *, ...) - PRINTF_FORMAT(1, 2); +void ovs_cmdl_proctitle_set(const char *, ...) + OVS_PRINTF_FORMAT(1, 2); #endif -void proctitle_restore(void); +void ovs_cmdl_proctitle_restore(void); #endif /* command-line.h */ diff -Nru openvswitch-2.3.1/lib/compiler.h openvswitch-2.4.0~git20150623/lib/compiler.h --- openvswitch-2.3.1/lib/compiler.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/compiler.h 2015-06-23 18:46:21.000000000 +0000 @@ -17,207 +17,28 @@ #ifndef COMPILER_H #define COMPILER_H 1 -#ifndef __has_feature - #define __has_feature(x) 0 -#endif -#ifndef __has_extension - #define __has_extension(x) 0 -#endif +#include "openvswitch/compiler.h" #if __GNUC__ && !__CHECKER__ -#define NO_RETURN __attribute__((__noreturn__)) -#define OVS_UNUSED __attribute__((__unused__)) -#define PRINTF_FORMAT(FMT, ARG1) __attribute__((__format__(printf, FMT, ARG1))) -#define SCANF_FORMAT(FMT, ARG1) __attribute__((__format__(scanf, FMT, ARG1))) #define STRFTIME_FORMAT(FMT) __attribute__((__format__(__strftime__, FMT, 0))) #define MALLOC_LIKE __attribute__((__malloc__)) #define ALWAYS_INLINE __attribute__((always_inline)) -#define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) #define SENTINEL(N) __attribute__((sentinel(N))) -#define OVS_LIKELY(CONDITION) __builtin_expect(!!(CONDITION), 1) -#define OVS_UNLIKELY(CONDITION) __builtin_expect(!!(CONDITION), 0) #else -#define NO_RETURN -#define OVS_UNUSED -#define PRINTF_FORMAT(FMT, ARG1) -#define SCANF_FORMAT(FMT, ARG1) #define STRFTIME_FORMAT(FMT) #define MALLOC_LIKE #define ALWAYS_INLINE -#define WARN_UNUSED_RESULT #define SENTINEL(N) -#define OVS_LIKELY(CONDITION) (!!(CONDITION)) -#define OVS_UNLIKELY(CONDITION) (!!(CONDITION)) -#endif - -#if __has_feature(c_thread_safety_attributes) -/* "clang" annotations for thread safety check. - * - * OVS_LOCKABLE indicates that the struct contains mutex element - * which can be locked by functions like ovs_mutex_lock(). - * - * Below, the word MUTEX stands for the name of an object with an OVS_LOCKABLE - * struct type. It can also be a comma-separated list of multiple structs, - * e.g. to require a function to hold multiple locks while invoked. - * - * - * On a variable: - * - * - OVS_GUARDED indicates that the variable may only be accessed some mutex - * is held. - * - * - OVS_GUARDED_BY(MUTEX) indicates that the variable may only be accessed - * while the specific MUTEX is held. - * - * - * On a variable A of mutex type: - * - * - OVS_ACQ_BEFORE(B), where B is a mutex or a comma-separated list of - * mutexes, declare that if both A and B are acquired at the same time, - * then A must be acquired before B. That is, B nests inside A. - * - * - OVS_ACQ_AFTER(B) is the opposite of OVS_ACQ_BEFORE(B), that is, it - * declares that A nests inside B. - * - * - * On a function, the following attributes apply to mutexes: - * - * - OVS_ACQUIRES(MUTEX) indicate that the function must be called without - * holding MUTEX and that it returns holding MUTEX. - * - * - OVS_RELEASES(MUTEX) indicates that the function may only be called with - * MUTEX held and that it returns with MUTEX released. It can be used for - * all types of MUTEX. - * - * - OVS_TRY_LOCK(RETVAL, MUTEX) indicate that the function will try to - * acquire MUTEX. RETVAL is an integer or boolean value specifying the - * return value of a successful lock acquisition. - * - * - OVS_REQUIRES(MUTEX) indicate that the function may only be called with - * MUTEX held and that the function does not release MUTEX. - * - * - OVS_EXCLUDED(MUTEX) indicates that the function may only be called when - * MUTEX is not held. - * - * - * The following variants, with the same syntax, apply to reader-writer locks: - * - * mutex rwlock, for reading rwlock, for writing - * ------------------- ------------------- ------------------- - * OVS_ACQUIRES OVS_ACQ_RDLOCK OVS_ACQ_WRLOCK - * OVS_RELEASES OVS_RELEASES OVS_RELEASES - * OVS_TRY_LOCK OVS_TRY_RDLOCK OVS_TRY_WRLOCK - * OVS_REQUIRES OVS_REQ_RDLOCK OVS_REQ_WRLOCK - * OVS_EXCLUDED OVS_EXCLUDED OVS_EXCLUDED - */ -#define OVS_LOCKABLE __attribute__((lockable)) -#define OVS_REQ_RDLOCK(...) __attribute__((shared_locks_required(__VA_ARGS__))) -#define OVS_ACQ_RDLOCK(...) __attribute__((shared_lock_function(__VA_ARGS__))) -#define OVS_REQ_WRLOCK(...) \ - __attribute__((exclusive_locks_required(__VA_ARGS__))) -#define OVS_ACQ_WRLOCK(...) \ - __attribute__((exclusive_lock_function(__VA_ARGS__))) -#define OVS_REQUIRES(...) \ - __attribute__((exclusive_locks_required(__VA_ARGS__))) -#define OVS_ACQUIRES(...) \ - __attribute__((exclusive_lock_function(__VA_ARGS__))) -#define OVS_TRY_WRLOCK(RETVAL, ...) \ - __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__))) -#define OVS_TRY_RDLOCK(RETVAL, ...) \ - __attribute__((shared_trylock_function(RETVAL, __VA_ARGS__))) -#define OVS_TRY_LOCK(RETVAL, ...) \ - __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__))) -#define OVS_GUARDED __attribute__((guarded_var)) -#define OVS_GUARDED_BY(...) __attribute__((guarded_by(__VA_ARGS__))) -#define OVS_RELEASES(...) __attribute__((unlock_function(__VA_ARGS__))) -#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__))) -#define OVS_ACQ_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__))) -#define OVS_ACQ_AFTER(...) __attribute__((acquired_after(__VA_ARGS__))) -#define OVS_NO_THREAD_SAFETY_ANALYSIS \ - __attribute__((no_thread_safety_analysis)) -#else /* not Clang */ -#define OVS_LOCKABLE -#define OVS_REQ_RDLOCK(...) -#define OVS_ACQ_RDLOCK(...) -#define OVS_REQ_WRLOCK(...) -#define OVS_ACQ_WRLOCK(...) -#define OVS_REQUIRES(...) -#define OVS_ACQUIRES(...) -#define OVS_TRY_WRLOCK(...) -#define OVS_TRY_RDLOCK(...) -#define OVS_TRY_LOCK(...) -#define OVS_GUARDED -#define OVS_GUARDED_BY(...) -#define OVS_EXCLUDED(...) -#define OVS_RELEASES(...) -#define OVS_ACQ_BEFORE(...) -#define OVS_ACQ_AFTER(...) -#define OVS_NO_THREAD_SAFETY_ANALYSIS -#endif - -/* ISO C says that a C implementation may choose any integer type for an enum - * that is sufficient to hold all of its values. Common ABIs (such as the - * System V ABI used on i386 GNU/Linux) always use a full-sized "int", even - * when a smaller type would suffice. - * - * In GNU C, "enum __attribute__((packed)) name { ... }" defines 'name' as an - * enum compatible with a type that is no bigger than necessary. This is the - * intended use of OVS_PACKED_ENUM. - * - * OVS_PACKED_ENUM is intended for use only as a space optimization, since it - * only works with GCC. That means that it must not be used in wire protocols - * or otherwise exposed outside of a single process. */ -#if __GNUC__ && !__CHECKER__ -#define OVS_PACKED_ENUM __attribute__((__packed__)) -#else -#define OVS_PACKED_ENUM -#endif - -#ifndef _MSC_VER -#define OVS_PACKED(DECL) DECL __attribute__((__packed__)) -#else -#define OVS_PACKED(DECL) __pragma(pack(push, 1)) DECL __pragma(pack(pop)) -#endif - -/* For defining a structure whose instances should aligned on an N-byte - * boundary. - * - * e.g. The following: - * OVS_ALIGNED_STRUCT(64, mystruct) { ... }; - * is equivalent to the following except that it specifies 64-byte alignment: - * struct mystruct { ... }; - */ -#ifndef _MSC_VER -#define OVS_ALIGNED_STRUCT(N, TAG) struct __attribute__((aligned(N))) TAG -#else -#define OVS_ALIGNED_STRUCT(N, TAG) __declspec(align(N)) struct TAG -#endif - -#ifdef _MSC_VER -#define CCALL __cdecl -#pragma section(".CRT$XCU",read) -#define OVS_CONSTRUCTOR(f) \ - static void __cdecl f(void); \ - __declspec(allocate(".CRT$XCU")) void (__cdecl*f##_)(void) = f; \ - static void __cdecl f(void) -#else -#define OVS_CONSTRUCTOR(f) \ - static void f(void) __attribute__((constructor)); \ - static void f(void) #endif -/* OVS_PREFETCH() can be used to instruct the CPU to fetch the cache - * line containing the given address to a CPU cache. - * OVS_PREFETCH_WRITE() should be used when the memory is going to be - * written to. Depending on the target CPU, this can generate the same - * instruction as OVS_PREFETCH(), or bring the data into the cache in an - * exclusive state. */ -#if __GNUC__ -#define OVS_PREFETCH(addr) __builtin_prefetch((addr)) -#define OVS_PREFETCH_WRITE(addr) __builtin_prefetch((addr), 1) +/* Output a message (not an error) while compiling without failing the + * compilation process */ +#if HAVE_PRAGMA_MESSAGE +#define DO_PRAGMA(x) _Pragma(#x) +#define BUILD_MESSAGE(x) \ + DO_PRAGMA(message(x)) #else -#define OVS_PREFETCH(addr) -#define OVS_PREFETCH_WRITE(addr) +#define BUILD_MESSAGE(x) #endif #endif /* compiler.h */ diff -Nru openvswitch-2.3.1/lib/coverage.c openvswitch-2.4.0~git20150623/lib/coverage.c --- openvswitch-2.3.1/lib/coverage.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/coverage.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ #include "timeval.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(coverage); @@ -279,8 +279,6 @@ void coverage_run(void) { - /* Defines the moving average array index variables. */ - static unsigned int min_idx, hr_idx; struct coverage_counter **c = coverage_counters; long long int now; @@ -300,8 +298,6 @@ for (i = 0; i < n_coverage_counters; i++) { unsigned int count, portion; - unsigned int m_idx = min_idx; - unsigned int h_idx = hr_idx; unsigned int idx = idx_count; /* Computes the differences between the current total and the one @@ -317,8 +313,8 @@ /* The m_idx is increased from 0 to MIN_AVG_LEN - 1. Every * time the m_idx finishes a cycle (a cycle is one minute), * the h_idx is incremented by 1. */ - m_idx = idx % MIN_AVG_LEN; - h_idx = idx / MIN_AVG_LEN; + unsigned int m_idx = idx % MIN_AVG_LEN; + unsigned int h_idx = idx / MIN_AVG_LEN; c[i]->min[m_idx] = portion + (j == (slots - 1) ? count % slots : 0); @@ -332,8 +328,6 @@ /* Updates the global index variables. */ idx_count = (idx_count + slots) % (MIN_AVG_LEN * HR_AVG_LEN); - min_idx = idx_count % MIN_AVG_LEN; - hr_idx = idx_count / MIN_AVG_LEN; /* Updates the run time. */ coverage_run_time = now + COVERAGE_RUN_INTERVAL; } diff -Nru openvswitch-2.3.1/lib/coverage.h openvswitch-2.4.0~git20150623/lib/coverage.h --- openvswitch-2.3.1/lib/coverage.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/coverage.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ * a useful debugging tool. */ #include "ovs-thread.h" -#include "vlog.h" #include "compiler.h" /* Makes coverage_run run every 5000 ms (5 seconds). @@ -91,7 +90,4 @@ void coverage_clear(void); void coverage_run(void); -/* Implementation detail. */ -#define COVERAGE_DEFINE__(COUNTER) \ - #endif /* coverage.h */ diff -Nru openvswitch-2.3.1/lib/csum.c openvswitch-2.4.0~git20150623/lib/csum.c --- openvswitch-2.3.1/lib/csum.c 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/csum.c 2015-06-23 18:46:21.000000000 +0000 @@ -113,6 +113,26 @@ } /* Returns the new checksum for a packet in which the checksum field previously + * contained 'old_csum' and in which a field that contained the 6 bytes at + * 'old_bytes' was changed to contain the 6 bytes at 'new_bytes'. */ +ovs_be16 +recalc_csum48(ovs_be16 old_csum, const void *old_bytes, + const void *new_bytes) +{ + ovs_be16 new_csum = old_csum; + const uint16_t *p16_old = old_bytes, + *p16_new = new_bytes; + int i; + + for (i = 0; i < 3; ++i) { + new_csum = recalc_csum16(new_csum, get_unaligned_be16(&p16_old[i]), + get_unaligned_be16(&p16_new[i])); + } + + return new_csum; +} + +/* Returns the new checksum for a packet in which the checksum field previously * contained 'old_csum' and in which a field that contained 'old_u32[4]' was * changed to contain 'new_u32[4]'. */ ovs_be16 diff -Nru openvswitch-2.3.1/lib/csum.h openvswitch-2.4.0~git20150623/lib/csum.h --- openvswitch-2.3.1/lib/csum.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/csum.h 2015-06-23 18:46:21.000000000 +0000 @@ -28,6 +28,8 @@ ovs_be16 csum_finish(uint32_t partial); ovs_be16 recalc_csum16(ovs_be16 old_csum, ovs_be16 old_u16, ovs_be16 new_u16); ovs_be16 recalc_csum32(ovs_be16 old_csum, ovs_be32 old_u32, ovs_be32 new_u32); +ovs_be16 recalc_csum48(ovs_be16 old_csum, const void *old_bytes, + const void *new_bytes); ovs_be16 recalc_csum128(ovs_be16 old_csum, ovs_16aligned_be32 old_u32[4], const ovs_be32 new_u32[4]); diff -Nru openvswitch-2.3.1/lib/daemon.c openvswitch-2.4.0~git20150623/lib/daemon.c --- openvswitch-2.3.1/lib/daemon.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/daemon.c 2015-06-23 18:46:21.000000000 +0000 @@ -19,7 +19,9 @@ #include #include #include -#include "vlog.h" +#include "util.h" +#include "ovs-thread.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(daemon); diff -Nru openvswitch-2.3.1/lib/daemon-unix.c openvswitch-2.4.0~git20150623/lib/daemon-unix.c --- openvswitch-2.3.1/lib/daemon-unix.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/daemon-unix.c 2015-06-23 18:46:21.000000000 +0000 @@ -35,7 +35,7 @@ #include "socket-util.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(daemon_unix); @@ -214,19 +214,23 @@ /* Forks, then: * * - In the parent, waits for the child to signal that it has completed its - * startup sequence. Then stores -1 in '*fdp' and returns the child's pid. + * startup sequence. Then stores -1 in '*fdp' and returns the child's + * pid in '*child_pid' argument. * - * - In the child, stores a fd in '*fdp' and returns 0. The caller should - * pass the fd to fork_notify_startup() after it finishes its startup - * sequence. + * - In the child, stores a fd in '*fdp' and returns 0 through '*child_pid' + * argument. The caller should pass the fd to fork_notify_startup() after + * it finishes its startup sequence. * - * If something goes wrong with the fork, logs a critical error and aborts the - * process. */ -static pid_t -fork_and_wait_for_startup(int *fdp) + * Returns 0 on success. If something goes wrong and child process was not + * able to signal its readiness by calling fork_notify_startup(), then this + * function returns -1. However, even in case of failure it still sets child + * process id in '*child_pid'. */ +static int +fork_and_wait_for_startup(int *fdp, pid_t *child_pid) { int fds[2]; pid_t pid; + int ret = 0; xpipe(fds); @@ -252,8 +256,9 @@ exit(WEXITSTATUS(status)); } else { char *status_msg = process_status_msg(status); - VLOG_FATAL("fork child died before signaling startup (%s)", - status_msg); + VLOG_ERR("fork child died before signaling startup (%s)", + status_msg); + ret = -1; } } else if (retval < 0) { VLOG_FATAL("waitpid failed (%s)", ovs_strerror(errno)); @@ -268,8 +273,8 @@ close(fds[0]); *fdp = fds[1]; } - - return pid; + *child_pid = pid; + return ret; } static void @@ -317,6 +322,7 @@ time_t last_restart; char *status_msg; int crashes; + bool child_ready = true; set_subprogram_name("monitor"); status_msg = xstrdup("healthy"); @@ -326,16 +332,19 @@ int retval; int status; - proctitle_set("monitoring pid %lu (%s)", - (unsigned long int) daemon_pid, status_msg); + ovs_cmdl_proctitle_set("monitoring pid %lu (%s)", + (unsigned long int) daemon_pid, status_msg); - do { - retval = waitpid(daemon_pid, &status, 0); - } while (retval == -1 && errno == EINTR); - - if (retval == -1) { - VLOG_FATAL("waitpid failed (%s)", ovs_strerror(errno)); - } else if (retval == daemon_pid) { + if (child_ready) { + do { + retval = waitpid(daemon_pid, &status, 0); + } while (retval == -1 && errno == EINTR); + if (retval == -1) { + VLOG_FATAL("waitpid failed (%s)", ovs_strerror(errno)); + } + } + + if (!child_ready || retval == daemon_pid) { char *s = process_status_msg(status); if (should_restart(status)) { free(status_msg); @@ -372,8 +381,11 @@ last_restart = time(NULL); VLOG_ERR("%s, restarting", status_msg); - daemon_pid = fork_and_wait_for_startup(&daemonize_fd); - if (!daemon_pid) { + child_ready = !fork_and_wait_for_startup(&daemonize_fd, + &daemon_pid); + if (child_ready && !daemon_pid) { + /* Child process needs to break out of monitoring + * loop. */ break; } } else { @@ -387,7 +399,7 @@ free(status_msg); /* Running in new daemon process. */ - proctitle_restore(); + ovs_cmdl_proctitle_restore(); set_subprogram_name(""); } @@ -403,7 +415,12 @@ daemonize_fd = -1; if (detach) { - if (fork_and_wait_for_startup(&daemonize_fd) > 0) { + pid_t pid; + + if (fork_and_wait_for_startup(&daemonize_fd, &pid)) { + VLOG_FATAL("could not detach from foreground session"); + } + if (pid > 0) { /* Running in parent process. */ exit(0); } @@ -416,7 +433,9 @@ int saved_daemonize_fd = daemonize_fd; pid_t daemon_pid; - daemon_pid = fork_and_wait_for_startup(&daemonize_fd); + if (fork_and_wait_for_startup(&daemonize_fd, &daemon_pid)) { + VLOG_FATAL("could not initiate process monitoring"); + } if (daemon_pid > 0) { /* Running in monitor process. */ fork_notify_startup(saved_daemonize_fd); diff -Nru openvswitch-2.3.1/lib/daemon-windows.c openvswitch-2.4.0~git20150623/lib/daemon-windows.c --- openvswitch-2.3.1/lib/daemon-windows.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/daemon-windows.c 2015-06-23 18:46:21.000000000 +0000 @@ -19,8 +19,9 @@ #include "daemon-private.h" #include #include +#include "ovs-thread.h" #include "poll-loop.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(daemon_windows); @@ -107,7 +108,7 @@ VLOG_FATAL("Failed to create a event (%s).", msg_buf); } - poll_fd_wait_event(0, wevent, POLLIN); + poll_wevent_wait(wevent); /* Register the control handler. This function is called by the service * manager to stop the service. */ @@ -206,7 +207,7 @@ if (service_status.dwCurrentState != SERVICE_RUNNING) { return true; } else { - poll_fd_wait_event(0, wevent, POLLIN); + poll_wevent_wait(wevent); } } return false; @@ -218,6 +219,11 @@ void service_stop() { + if (!service_started) { + return; + } + fatal_signal_atexit_handler(); + ResetEvent(wevent); CloseHandle(wevent); @@ -473,7 +479,7 @@ make_pidfile_name(const char *name) { if (name && strchr(name, ':')) { - return strdup(name); + return xstrdup(name); } else { return xasprintf("%s/%s.pid", ovs_rundir(), program_name); } diff -Nru openvswitch-2.3.1/lib/dpctl.c openvswitch-2.4.0~git20150623/lib/dpctl.c --- openvswitch-2.3.1/lib/dpctl.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpctl.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1673 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "command-line.h" +#include "compiler.h" +#include "dirs.h" +#include "dpctl.h" +#include "dpif.h" +#include "dynamic-string.h" +#include "flow.h" +#include "match.h" +#include "netdev.h" +#include "netdev-dpdk.h" +#include "netlink.h" +#include "odp-util.h" +#include "ofp-parse.h" +#include "ofpbuf.h" +#include "ovs-numa.h" +#include "packets.h" +#include "shash.h" +#include "simap.h" +#include "smap.h" +#include "sset.h" +#include "timeval.h" +#include "unixctl.h" +#include "util.h" + +typedef int dpctl_command_handler(int argc, const char *argv[], + struct dpctl_params *); +struct dpctl_command { + const char *name; + const char *usage; + int min_args; + int max_args; + dpctl_command_handler *handler; +}; +static const struct dpctl_command *get_all_dpctl_commands(void); +static void dpctl_print(struct dpctl_params *dpctl_p, const char *fmt, ...) + OVS_PRINTF_FORMAT(2, 3); +static void dpctl_error(struct dpctl_params* dpctl_p, int err_no, + const char *fmt, ...) + OVS_PRINTF_FORMAT(3, 4); + +static void +dpctl_puts(struct dpctl_params *dpctl_p, bool error, const char *string) +{ + dpctl_p->output(dpctl_p->aux, error, string); +} + +static void +dpctl_print(struct dpctl_params *dpctl_p, const char *fmt, ...) +{ + char *string; + va_list args; + + va_start(args, fmt); + string = xvasprintf(fmt, args); + va_end(args); + + dpctl_puts(dpctl_p, false, string); + free(string); +} + +static void +dpctl_error(struct dpctl_params* dpctl_p, int err_no, const char *fmt, ...) +{ + const char *subprogram_name = get_subprogram_name(); + struct ds ds = DS_EMPTY_INITIALIZER; + int save_errno = errno; + va_list args; + + + if (subprogram_name[0]) { + ds_put_format(&ds, "%s(%s): ", program_name,subprogram_name); + } else { + ds_put_format(&ds, "%s: ", program_name); + } + + va_start(args, fmt); + ds_put_format_valist(&ds, fmt, args); + va_end(args); + + if (err_no != 0) { + ds_put_format(&ds, " (%s)", ovs_retval_to_string(err_no)); + } + ds_put_cstr(&ds, "\n"); + + dpctl_puts(dpctl_p, true, ds_cstr(&ds)); + + ds_destroy(&ds); + + errno = save_errno; +} + +static int dpctl_add_if(int argc, const char *argv[], struct dpctl_params *); + +static int +if_up(struct netdev *netdev) +{ + return netdev_turn_flags_on(netdev, NETDEV_UP, NULL); +} + +/* Retrieve the name of the datapath if exactly one exists. The caller + * is responsible for freeing the returned string. If there is not one + * datapath, aborts with an error message. */ +static char * +get_one_dp(struct dpctl_params *dpctl_p) +{ + struct sset types; + const char *type; + char *dp_name = NULL; + size_t count = 0; + + sset_init(&types); + dp_enumerate_types(&types); + SSET_FOR_EACH (type, &types) { + struct sset names; + + sset_init(&names); + if (!dp_enumerate_names(type, &names)) { + count += sset_count(&names); + if (!dp_name && count == 1) { + dp_name = xasprintf("%s@%s", type, SSET_FIRST(&names)); + } + } + sset_destroy(&names); + } + sset_destroy(&types); + + if (!count) { + dpctl_error(dpctl_p, 0, "no datapaths exist"); + } else if (count > 1) { + dpctl_error(dpctl_p, 0, "multiple datapaths, specify one"); + free(dp_name); + dp_name = NULL; + } + + return dp_name; +} + +static int +parsed_dpif_open(const char *arg_, bool create, struct dpif **dpifp) +{ + int result; + char *name, *type; + + dp_parse_name(arg_, &name, &type); + + if (create) { + result = dpif_create(name, type, dpifp); + } else { + result = dpif_open(name, type, dpifp); + } + + free(name); + free(type); + return result; +} + +static int +dpctl_add_dp(int argc, const char *argv[], + struct dpctl_params *dpctl_p) +{ + struct dpif *dpif; + int error; + + error = parsed_dpif_open(argv[1], true, &dpif); + if (error) { + dpctl_error(dpctl_p, error, "add_dp"); + return error; + } + dpif_close(dpif); + if (argc > 2) { + error = dpctl_add_if(argc, argv, dpctl_p); + } + return error; +} + +static int +dpctl_del_dp(int argc OVS_UNUSED, const char *argv[], + struct dpctl_params *dpctl_p) +{ + struct dpif *dpif; + int error; + + error = parsed_dpif_open(argv[1], false, &dpif); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + error = dpif_delete(dpif); + if (error) { + dpctl_error(dpctl_p, error, "del_dp"); + } + + dpif_close(dpif); + return error; +} + +static int +dpctl_add_if(int argc OVS_UNUSED, const char *argv[], + struct dpctl_params *dpctl_p) +{ + struct dpif *dpif; + int i, error, lasterror = 0; + + error = parsed_dpif_open(argv[1], false, &dpif); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + for (i = 2; i < argc; i++) { + const char *name, *type; + char *save_ptr = NULL, *argcopy; + struct netdev *netdev = NULL; + struct smap args; + odp_port_t port_no = ODPP_NONE; + char *option; + + argcopy = xstrdup(argv[i]); + name = strtok_r(argcopy, ",", &save_ptr); + type = "system"; + + if (!name) { + dpctl_error(dpctl_p, 0, "%s is not a valid network device name", + argv[i]); + error = EINVAL; + goto next; + } + + smap_init(&args); + while ((option = strtok_r(NULL, ",", &save_ptr)) != NULL) { + char *save_ptr_2 = NULL; + char *key, *value; + + key = strtok_r(option, "=", &save_ptr_2); + value = strtok_r(NULL, "", &save_ptr_2); + if (!value) { + value = ""; + } + + if (!strcmp(key, "type")) { + type = value; + } else if (!strcmp(key, "port_no")) { + port_no = u32_to_odp(atoi(value)); + } else if (!smap_add_once(&args, key, value)) { + dpctl_error(dpctl_p, 0, "duplicate \"%s\" option", key); + } + } + + error = netdev_open(name, type, &netdev); + if (error) { + dpctl_error(dpctl_p, error, "%s: failed to open network device", + name); + goto next_destroy_args; + } + + error = netdev_set_config(netdev, &args, NULL); + if (error) { + goto next_destroy_args; + } + + error = dpif_port_add(dpif, netdev, &port_no); + if (error) { + dpctl_error(dpctl_p, error, "adding %s to %s failed", name, + argv[1]); + goto next_destroy_args; + } + + error = if_up(netdev); + if (error) { + dpctl_error(dpctl_p, error, "%s: failed bringing interface up", + name); + } + +next_destroy_args: + netdev_close(netdev); + smap_destroy(&args); +next: + free(argcopy); + if (error) { + lasterror = error; + } + } + dpif_close(dpif); + + return lasterror; +} + +static int +dpctl_set_if(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + struct dpif *dpif; + int i, error, lasterror = 0; + + error = parsed_dpif_open(argv[1], false, &dpif); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + for (i = 2; i < argc; i++) { + struct netdev *netdev = NULL; + struct dpif_port dpif_port; + char *save_ptr = NULL; + char *type = NULL; + char *argcopy; + const char *name; + struct smap args; + odp_port_t port_no; + char *option; + int error = 0; + + argcopy = xstrdup(argv[i]); + name = strtok_r(argcopy, ",", &save_ptr); + if (!name) { + dpctl_error(dpctl_p, 0, "%s is not a valid network device name", + argv[i]); + goto next; + } + + /* Get the port's type from the datapath. */ + error = dpif_port_query_by_name(dpif, name, &dpif_port); + if (error) { + dpctl_error(dpctl_p, error, "%s: failed to query port in %s", name, + argv[1]); + goto next; + } + type = xstrdup(dpif_port.type); + port_no = dpif_port.port_no; + dpif_port_destroy(&dpif_port); + + /* Retrieve its existing configuration. */ + error = netdev_open(name, type, &netdev); + if (error) { + dpctl_error(dpctl_p, error, "%s: failed to open network device", + name); + goto next; + } + + smap_init(&args); + error = netdev_get_config(netdev, &args); + if (error) { + dpctl_error(dpctl_p, error, "%s: failed to fetch configuration", + name); + goto next_destroy_args; + } + + /* Parse changes to configuration. */ + while ((option = strtok_r(NULL, ",", &save_ptr)) != NULL) { + char *save_ptr_2 = NULL; + char *key, *value; + + key = strtok_r(option, "=", &save_ptr_2); + value = strtok_r(NULL, "", &save_ptr_2); + if (!value) { + value = ""; + } + + if (!strcmp(key, "type")) { + if (strcmp(value, type)) { + dpctl_error(dpctl_p, 0, + "%s: can't change type from %s to %s", + name, type, value); + error = EINVAL; + goto next_destroy_args; + } + } else if (!strcmp(key, "port_no")) { + if (port_no != u32_to_odp(atoi(value))) { + dpctl_error(dpctl_p, 0, "%s: can't change port number from" + " %"PRIu32" to %d", name, port_no, atoi(value)); + error = EINVAL; + goto next_destroy_args; + } + } else if (value[0] == '\0') { + smap_remove(&args, key); + } else { + smap_replace(&args, key, value); + } + } + + /* Update configuration. */ + char *err_s = NULL; + error = netdev_set_config(netdev, &args, &err_s); + if (err_s || error) { + dpctl_error(dpctl_p, error, "%s", + err_s ? err_s : "Error updating configuration"); + free(err_s); + } + if (error) { + goto next_destroy_args; + } + +next_destroy_args: + smap_destroy(&args); +next: + netdev_close(netdev); + free(type); + free(argcopy); + if (error) { + lasterror = error; + } + } + dpif_close(dpif); + + return lasterror; +} + +static bool +get_port_number(struct dpif *dpif, const char *name, odp_port_t *port, + struct dpctl_params *dpctl_p) +{ + struct dpif_port dpif_port; + + if (!dpif_port_query_by_name(dpif, name, &dpif_port)) { + *port = dpif_port.port_no; + dpif_port_destroy(&dpif_port); + return true; + } else { + dpctl_error(dpctl_p, 0, "no port named %s", name); + return false; + } +} + +static int +dpctl_del_if(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + struct dpif *dpif; + int i, error, lasterror = 0; + + error = parsed_dpif_open(argv[1], false, &dpif); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + for (i = 2; i < argc; i++) { + const char *name = argv[i]; + odp_port_t port; + + if (!name[strspn(name, "0123456789")]) { + port = u32_to_odp(atoi(name)); + } else if (!get_port_number(dpif, name, &port, dpctl_p)) { + lasterror = ENOENT; + continue; + } + + error = dpif_port_del(dpif, port); + if (error) { + dpctl_error(dpctl_p, error, "deleting port %s from %s failed", + name, argv[1]); + lasterror = error; + } + } + dpif_close(dpif); + return lasterror; +} + +static void +print_stat(struct dpctl_params *dpctl_p, const char *leader, uint64_t value) +{ + dpctl_print(dpctl_p, "%s", leader); + if (value != UINT64_MAX) { + dpctl_print(dpctl_p, "%"PRIu64, value); + } else { + dpctl_print(dpctl_p, "?"); + } +} + +static void +print_human_size(struct dpctl_params *dpctl_p, uint64_t value) +{ + if (value == UINT64_MAX) { + /* Nothing to do. */ + } else if (value >= 1024ULL * 1024 * 1024 * 1024) { + dpctl_print(dpctl_p, " (%.1f TiB)", + value / (1024.0 * 1024 * 1024 * 1024)); + } else if (value >= 1024ULL * 1024 * 1024) { + dpctl_print(dpctl_p, " (%.1f GiB)", value / (1024.0 * 1024 * 1024)); + } else if (value >= 1024ULL * 1024) { + dpctl_print(dpctl_p, " (%.1f MiB)", value / (1024.0 * 1024)); + } else if (value >= 1024) { + dpctl_print(dpctl_p, " (%.1f KiB)", value / 1024.0); + } +} + +static void +show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p) +{ + struct dpif_port_dump dump; + struct dpif_port dpif_port; + struct dpif_dp_stats stats; + struct netdev *netdev; + + dpctl_print(dpctl_p, "%s:\n", dpif_name(dpif)); + if (!dpif_get_dp_stats(dpif, &stats)) { + dpctl_print(dpctl_p, "\tlookups: hit:%"PRIu64" missed:%"PRIu64 + " lost:%"PRIu64"\n\tflows: %"PRIu64"\n", + stats.n_hit, stats.n_missed, stats.n_lost, stats.n_flows); + if (stats.n_masks != UINT32_MAX) { + uint64_t n_pkts = stats.n_hit + stats.n_missed; + double avg = n_pkts ? (double) stats.n_mask_hit / n_pkts : 0.0; + + dpctl_print(dpctl_p, "\tmasks: hit:%"PRIu64" total:%"PRIu32 + " hit/pkt:%.2f\n", + stats.n_mask_hit, stats.n_masks, avg); + } + } + + DPIF_PORT_FOR_EACH (&dpif_port, &dump, dpif) { + dpctl_print(dpctl_p, "\tport %u: %s", + dpif_port.port_no, dpif_port.name); + + if (strcmp(dpif_port.type, "system")) { + int error; + + dpctl_print(dpctl_p, " (%s", dpif_port.type); + + error = netdev_open(dpif_port.name, dpif_port.type, &netdev); + if (!error) { + struct smap config; + + smap_init(&config); + error = netdev_get_config(netdev, &config); + if (!error) { + const struct smap_node **nodes; + size_t i; + + nodes = smap_sort(&config); + for (i = 0; i < smap_count(&config); i++) { + const struct smap_node *node = nodes[i]; + dpctl_print(dpctl_p, "%c %s=%s", i ? ',' : ':', + node->key, node->value); + } + free(nodes); + } else { + dpctl_print(dpctl_p, ", could not retrieve configuration " + "(%s)", ovs_strerror(error)); + } + smap_destroy(&config); + + netdev_close(netdev); + } else { + dpctl_print(dpctl_p, ": open failed (%s)", + ovs_strerror(error)); + } + dpctl_print(dpctl_p, ")"); + } + dpctl_print(dpctl_p, "\n"); + + if (dpctl_p->print_statistics) { + struct netdev_stats s; + int error; + + error = netdev_open(dpif_port.name, dpif_port.type, &netdev); + if (error) { + dpctl_print(dpctl_p, ", open failed (%s)", + ovs_strerror(error)); + continue; + } + error = netdev_get_stats(netdev, &s); + if (!error) { + netdev_close(netdev); + print_stat(dpctl_p, "\t\tRX packets:", s.rx_packets); + print_stat(dpctl_p, " errors:", s.rx_errors); + print_stat(dpctl_p, " dropped:", s.rx_dropped); + print_stat(dpctl_p, " overruns:", s.rx_over_errors); + print_stat(dpctl_p, " frame:", s.rx_frame_errors); + dpctl_print(dpctl_p, "\n"); + + print_stat(dpctl_p, "\t\tTX packets:", s.tx_packets); + print_stat(dpctl_p, " errors:", s.tx_errors); + print_stat(dpctl_p, " dropped:", s.tx_dropped); + print_stat(dpctl_p, " aborted:", s.tx_aborted_errors); + print_stat(dpctl_p, " carrier:", s.tx_carrier_errors); + dpctl_print(dpctl_p, "\n"); + + print_stat(dpctl_p, "\t\tcollisions:", s.collisions); + dpctl_print(dpctl_p, "\n"); + + print_stat(dpctl_p, "\t\tRX bytes:", s.rx_bytes); + print_human_size(dpctl_p, s.rx_bytes); + print_stat(dpctl_p, " TX bytes:", s.tx_bytes); + print_human_size(dpctl_p, s.tx_bytes); + dpctl_print(dpctl_p, "\n"); + } else { + dpctl_print(dpctl_p, ", could not retrieve stats (%s)", + ovs_strerror(error)); + } + } + } +} + +typedef void (*dps_for_each_cb)(struct dpif *, struct dpctl_params *); + +static int +dps_for_each(struct dpctl_params *dpctl_p, dps_for_each_cb cb) +{ + struct sset dpif_names = SSET_INITIALIZER(&dpif_names), + dpif_types = SSET_INITIALIZER(&dpif_types); + int error, openerror = 0, enumerror = 0; + const char *type, *name; + bool at_least_one = false; + + dp_enumerate_types(&dpif_types); + + SSET_FOR_EACH (type, &dpif_types) { + error = dp_enumerate_names(type, &dpif_names); + if (error) { + enumerror = error; + } + + SSET_FOR_EACH (name, &dpif_names) { + struct dpif *dpif; + + at_least_one = true; + error = dpif_open(name, type, &dpif); + if (!error) { + cb(dpif, dpctl_p); + dpif_close(dpif); + } else { + openerror = error; + dpctl_error(dpctl_p, error, "opening datapath %s failed", + name); + } + } + } + + sset_destroy(&dpif_names); + sset_destroy(&dpif_types); + + /* If there has been an error while opening a datapath it should be + * reported. Otherwise, we want to ignore the errors generated by + * dp_enumerate_names() if at least one datapath has been discovered, + * because they're not interesting for the user. This happens, for + * example, if OVS is using a userspace datapath and the kernel module + * is not loaded. */ + if (openerror) { + return openerror; + } else { + return at_least_one ? 0 : enumerror; + } +} + +static int +dpctl_show(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + int error, lasterror = 0; + if (argc > 1) { + int i; + for (i = 1; i < argc; i++) { + const char *name = argv[i]; + struct dpif *dpif; + + error = parsed_dpif_open(name, false, &dpif); + if (!error) { + show_dpif(dpif, dpctl_p); + dpif_close(dpif); + } else { + dpctl_error(dpctl_p, error, "opening datapath %s failed", + name); + lasterror = error; + } + } + } else { + lasterror = dps_for_each(dpctl_p, show_dpif); + } + + return lasterror; +} + +static void +dump_cb(struct dpif *dpif, struct dpctl_params *dpctl_p) +{ + dpctl_print(dpctl_p, "%s\n", dpif_name(dpif)); +} + +static int +dpctl_dump_dps(int argc OVS_UNUSED, const char *argv[] OVS_UNUSED, + struct dpctl_params *dpctl_p) +{ + return dps_for_each(dpctl_p, dump_cb); +} + +static void +format_dpif_flow(struct ds *ds, const struct dpif_flow *f, struct hmap *ports, + struct dpctl_params *dpctl_p) +{ + if (dpctl_p->verbosity && f->ufid_present) { + odp_format_ufid(&f->ufid, ds); + ds_put_cstr(ds, ", "); + } + odp_flow_format(f->key, f->key_len, f->mask, f->mask_len, ports, ds, + dpctl_p->verbosity); + ds_put_cstr(ds, ", "); + + dpif_flow_stats_format(&f->stats, ds); + ds_put_cstr(ds, ", actions:"); + format_odp_actions(ds, f->actions, f->actions_len); +} + +static int +dpctl_dump_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + struct dpif *dpif; + struct ds ds; + char *name; + + char *filter = NULL; + struct flow flow_filter; + struct flow_wildcards wc_filter; + + struct dpif_port_dump port_dump; + struct dpif_port dpif_port; + struct hmap portno_names; + struct simap names_portno; + + struct dpif_flow_dump_thread *flow_dump_thread; + struct dpif_flow_dump *flow_dump; + struct dpif_flow f; + int pmd_id = PMD_ID_NULL; + int error; + + if (argc > 1 && !strncmp(argv[argc - 1], "filter=", 7)) { + filter = xstrdup(argv[--argc] + 7); + } + name = (argc == 2) ? xstrdup(argv[1]) : get_one_dp(dpctl_p); + if (!name) { + error = EINVAL; + goto out_freefilter; + } + + error = parsed_dpif_open(name, false, &dpif); + free(name); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + goto out_freefilter; + } + + + hmap_init(&portno_names); + simap_init(&names_portno); + DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) { + odp_portno_names_set(&portno_names, dpif_port.port_no, dpif_port.name); + simap_put(&names_portno, dpif_port.name, + odp_to_u32(dpif_port.port_no)); + } + + if (filter) { + char *err = parse_ofp_exact_flow(&flow_filter, &wc_filter.masks, + filter, &names_portno); + if (err) { + dpctl_error(dpctl_p, 0, "Failed to parse filter (%s)", err); + error = EINVAL; + goto out_dpifclose; + } + } + + /* Make sure that these values are different. PMD_ID_NULL means that the + * pmd is unspecified (e.g. because the datapath doesn't have different + * pmd threads), while NON_PMD_CORE_ID refers to every non pmd threads + * in the userspace datapath */ + BUILD_ASSERT(PMD_ID_NULL != NON_PMD_CORE_ID); + + ds_init(&ds); + flow_dump = dpif_flow_dump_create(dpif, false); + flow_dump_thread = dpif_flow_dump_thread_create(flow_dump); + while (dpif_flow_dump_next(flow_dump_thread, &f, 1)) { + if (filter) { + struct flow flow; + struct flow_wildcards wc; + struct match match, match_filter; + struct minimatch minimatch; + + odp_flow_key_to_flow(f.key, f.key_len, &flow); + odp_flow_key_to_mask(f.mask, f.mask_len, &wc.masks, &flow); + match_init(&match, &flow, &wc); + + match_init(&match_filter, &flow_filter, &wc); + match_init(&match_filter, &match_filter.flow, &wc_filter); + minimatch_init(&minimatch, &match_filter); + + if (!minimatch_matches_flow(&minimatch, &match.flow)) { + minimatch_destroy(&minimatch); + continue; + } + minimatch_destroy(&minimatch); + } + ds_clear(&ds); + /* If 'pmd_id' is specified, overlapping flows could be dumped from + * different pmd threads. So, separates dumps from different pmds + * by printing a title line. */ + if (pmd_id != f.pmd_id) { + if (f.pmd_id == NON_PMD_CORE_ID) { + ds_put_format(&ds, "flow-dump from non-dpdk interfaces:\n"); + } else { + ds_put_format(&ds, "flow-dump from pmd on cpu core: %d\n", + f.pmd_id); + } + pmd_id = f.pmd_id; + } + format_dpif_flow(&ds, &f, &portno_names, dpctl_p); + dpctl_print(dpctl_p, "%s\n", ds_cstr(&ds)); + } + dpif_flow_dump_thread_destroy(flow_dump_thread); + error = dpif_flow_dump_destroy(flow_dump); + + if (error) { + dpctl_error(dpctl_p, error, "Failed to dump flows from datapath"); + } + ds_destroy(&ds); + +out_dpifclose: + odp_portno_names_destroy(&portno_names); + simap_destroy(&names_portno); + hmap_destroy(&portno_names); + dpif_close(dpif); +out_freefilter: + free(filter); + return error; +} + +/* Extracts the in_port from the parsed keys, and returns the reference + * to the 'struct netdev *' of the dpif port. On error, returns NULL. + * Users must call 'netdev_close()' after finish using the returned + * reference. */ +static struct netdev * +get_in_port_netdev_from_key(struct dpif *dpif, const struct ofpbuf *key) +{ + const struct nlattr *in_port_nla; + struct netdev *dev = NULL; + + in_port_nla = nl_attr_find(key, 0, OVS_KEY_ATTR_IN_PORT); + if (in_port_nla) { + struct dpif_port dpif_port; + odp_port_t port_no; + int error; + + port_no = ODP_PORT_C(nl_attr_get_u32(in_port_nla)); + error = dpif_port_query_by_number(dpif, port_no, &dpif_port); + if (error) { + goto out; + } + + netdev_open(dpif_port.name, dpif_port.type, &dev); + dpif_port_destroy(&dpif_port); + } + +out: + return dev; +} + +static int +dpctl_put_flow(int argc, const char *argv[], enum dpif_flow_put_flags flags, + struct dpctl_params *dpctl_p) +{ + const char *key_s = argv[argc - 2]; + const char *actions_s = argv[argc - 1]; + struct netdev *in_port_netdev = NULL; + struct dpif_flow_stats stats; + struct dpif_port dpif_port; + struct dpif_port_dump port_dump; + struct ofpbuf actions; + struct ofpbuf key; + struct ofpbuf mask; + struct dpif *dpif; + ovs_u128 ufid; + bool ufid_present; + char *dp_name; + struct simap port_names; + int n, error; + + dp_name = argc == 4 ? xstrdup(argv[1]) : get_one_dp(dpctl_p); + if (!dp_name) { + return EINVAL; + } + error = parsed_dpif_open(dp_name, false, &dpif); + free(dp_name); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + + ufid_present = false; + n = odp_ufid_from_string(key_s, &ufid); + if (n < 0) { + dpctl_error(dpctl_p, -n, "parsing flow ufid"); + return -n; + } else if (n) { + key_s += n; + ufid_present = true; + } + + simap_init(&port_names); + DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) { + simap_put(&port_names, dpif_port.name, odp_to_u32(dpif_port.port_no)); + } + + ofpbuf_init(&key, 0); + ofpbuf_init(&mask, 0); + error = odp_flow_from_string(key_s, &port_names, &key, &mask); + simap_destroy(&port_names); + if (error) { + dpctl_error(dpctl_p, error, "parsing flow key"); + goto out_freekeymask; + } + + ofpbuf_init(&actions, 0); + error = odp_actions_from_string(actions_s, NULL, &actions); + if (error) { + dpctl_error(dpctl_p, error, "parsing actions"); + goto out_freeactions; + } + + /* For DPDK interface, applies the operation to all pmd threads + * on the same numa node. */ + in_port_netdev = get_in_port_netdev_from_key(dpif, &key); + if (in_port_netdev && netdev_is_pmd(in_port_netdev)) { + int numa_id; + + numa_id = netdev_get_numa_id(in_port_netdev); + if (ovs_numa_numa_id_is_valid(numa_id)) { + struct ovs_numa_dump *dump = ovs_numa_dump_cores_on_numa(numa_id); + struct ovs_numa_info *iter; + + FOR_EACH_CORE_ON_NUMA (iter, dump) { + if (ovs_numa_core_is_pinned(iter->core_id)) { + error = dpif_flow_put(dpif, flags, + key.data, key.size, + mask.size == 0 ? NULL : mask.data, + mask.size, actions.data, + actions.size, ufid_present ? &ufid : NULL, + iter->core_id, dpctl_p->print_statistics ? &stats : NULL); + } + } + ovs_numa_dump_destroy(dump); + } else { + error = EINVAL; + } + } else { + error = dpif_flow_put(dpif, flags, + key.data, key.size, + mask.size == 0 ? NULL : mask.data, + mask.size, actions.data, + actions.size, ufid_present ? &ufid : NULL, + PMD_ID_NULL, dpctl_p->print_statistics ? &stats : NULL); + } + if (error) { + dpctl_error(dpctl_p, error, "updating flow table"); + goto out_freeactions; + } + + if (dpctl_p->print_statistics) { + struct ds s; + + ds_init(&s); + dpif_flow_stats_format(&stats, &s); + dpctl_print(dpctl_p, "%s\n", ds_cstr(&s)); + ds_destroy(&s); + } + +out_freeactions: + ofpbuf_uninit(&actions); +out_freekeymask: + ofpbuf_uninit(&mask); + ofpbuf_uninit(&key); + dpif_close(dpif); + netdev_close(in_port_netdev); + return error; +} + +static int +dpctl_add_flow(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + return dpctl_put_flow(argc, argv, DPIF_FP_CREATE, dpctl_p); +} + +static int +dpctl_mod_flow(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + enum dpif_flow_put_flags flags; + + flags = DPIF_FP_MODIFY; + if (dpctl_p->may_create) { + flags |= DPIF_FP_CREATE; + } + if (dpctl_p->zero_statistics) { + flags |= DPIF_FP_ZERO_STATS; + } + + return dpctl_put_flow(argc, argv, flags, dpctl_p); +} + +static int +dpctl_get_flow(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + const char *key_s = argv[argc - 1]; + struct dpif_flow flow; + struct dpif_port dpif_port; + struct dpif_port_dump port_dump; + struct dpif *dpif; + char *dp_name; + struct hmap portno_names; + ovs_u128 ufid; + struct ofpbuf buf; + uint64_t stub[DPIF_FLOW_BUFSIZE / 8]; + struct ds ds; + int n, error; + + dp_name = argc == 3 ? xstrdup(argv[1]) : get_one_dp(dpctl_p); + if (!dp_name) { + return EINVAL; + } + error = parsed_dpif_open(dp_name, false, &dpif); + free(dp_name); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + + ofpbuf_use_stub(&buf, &stub, sizeof stub); + hmap_init(&portno_names); + DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) { + odp_portno_names_set(&portno_names, dpif_port.port_no, dpif_port.name); + } + + n = odp_ufid_from_string(key_s, &ufid); + if (n <= 0) { + dpctl_error(dpctl_p, -n, "parsing flow ufid"); + goto out; + } + + /* Does not work for DPDK, since do not know which 'pmd' to apply the + * operation. So, just uses PMD_ID_NULL. */ + error = dpif_flow_get(dpif, NULL, 0, &ufid, PMD_ID_NULL, &buf, &flow); + if (error) { + dpctl_error(dpctl_p, error, "getting flow"); + goto out; + } + + ds_init(&ds); + format_dpif_flow(&ds, &flow, &portno_names, dpctl_p); + dpctl_print(dpctl_p, "%s\n", ds_cstr(&ds)); + ds_destroy(&ds); + +out: + odp_portno_names_destroy(&portno_names); + hmap_destroy(&portno_names); + ofpbuf_uninit(&buf); + dpif_close(dpif); + return error; +} + +static int +dpctl_del_flow(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + const char *key_s = argv[argc - 1]; + struct netdev *in_port_netdev = NULL; + struct dpif_flow_stats stats; + struct dpif_port dpif_port; + struct dpif_port_dump port_dump; + struct ofpbuf key; + struct ofpbuf mask; /* To be ignored. */ + struct dpif *dpif; + ovs_u128 ufid; + bool ufid_present; + char *dp_name; + struct simap port_names; + int n, error; + + dp_name = argc == 3 ? xstrdup(argv[1]) : get_one_dp(dpctl_p); + if (!dp_name) { + return EINVAL; + } + error = parsed_dpif_open(dp_name, false, &dpif); + free(dp_name); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + + ufid_present = false; + n = odp_ufid_from_string(key_s, &ufid); + if (n < 0) { + dpctl_error(dpctl_p, -n, "parsing flow ufid"); + return -n; + } else if (n) { + key_s += n; + ufid_present = true; + } + + simap_init(&port_names); + DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) { + simap_put(&port_names, dpif_port.name, odp_to_u32(dpif_port.port_no)); + } + + ofpbuf_init(&key, 0); + ofpbuf_init(&mask, 0); + + error = odp_flow_from_string(key_s, &port_names, &key, &mask); + if (error) { + dpctl_error(dpctl_p, error, "parsing flow key"); + goto out; + } + + /* For DPDK interface, applies the operation to all pmd threads + * on the same numa node. */ + in_port_netdev = get_in_port_netdev_from_key(dpif, &key); + if (in_port_netdev && netdev_is_pmd(in_port_netdev)) { + int numa_id; + + numa_id = netdev_get_numa_id(in_port_netdev); + if (ovs_numa_numa_id_is_valid(numa_id)) { + struct ovs_numa_dump *dump = ovs_numa_dump_cores_on_numa(numa_id); + struct ovs_numa_info *iter; + + FOR_EACH_CORE_ON_NUMA (iter, dump) { + if (ovs_numa_core_is_pinned(iter->core_id)) { + error = dpif_flow_del(dpif, key.data, + key.size, ufid_present ? &ufid : NULL, + iter->core_id, dpctl_p->print_statistics ? &stats : NULL); + } + } + ovs_numa_dump_destroy(dump); + } else { + error = EINVAL; + } + } else { + error = dpif_flow_del(dpif, key.data, key.size, + ufid_present ? &ufid : NULL, PMD_ID_NULL, + dpctl_p->print_statistics ? &stats : NULL); + } + if (error) { + dpctl_error(dpctl_p, error, "deleting flow"); + if (error == ENOENT && !ufid_present) { + struct ds s; + + ds_init(&s); + ds_put_format(&s, "Perhaps you need to specify a UFID?"); + dpctl_print(dpctl_p, "%s\n", ds_cstr(&s)); + ds_destroy(&s); + } + goto out; + } + + if (dpctl_p->print_statistics) { + struct ds s; + + ds_init(&s); + dpif_flow_stats_format(&stats, &s); + dpctl_print(dpctl_p, "%s\n", ds_cstr(&s)); + ds_destroy(&s); + } + +out: + ofpbuf_uninit(&mask); + ofpbuf_uninit(&key); + simap_destroy(&port_names); + dpif_close(dpif); + netdev_close(in_port_netdev); + return error; +} + +static int +dpctl_del_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + struct dpif *dpif; + char *name; + int error; + + name = (argc == 2) ? xstrdup(argv[1]) : get_one_dp(dpctl_p); + if (!name) { + return EINVAL; + } + error = parsed_dpif_open(name, false, &dpif); + free(name); + if (error) { + dpctl_error(dpctl_p, error, "opening datapath"); + return error; + } + + error = dpif_flow_flush(dpif); + if (error) { + dpctl_error(dpctl_p, error, "deleting all flows"); + } + dpif_close(dpif); + return error; +} + +static int +dpctl_help(int argc OVS_UNUSED, const char *argv[] OVS_UNUSED, + struct dpctl_params *dpctl_p) +{ + if (dpctl_p->usage) { + dpctl_p->usage(dpctl_p->aux); + } + + return 0; +} + +static int +dpctl_list_commands(int argc OVS_UNUSED, const char *argv[] OVS_UNUSED, + struct dpctl_params *dpctl_p) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + const struct dpctl_command *commands = get_all_dpctl_commands(); + + ds_put_cstr(&ds, "The available commands are:\n"); + for (; commands->name; commands++) { + const struct dpctl_command *c = commands; + + ds_put_format(&ds, " %s%-23s %s\n", dpctl_p->is_appctl ? "dpctl/" : "", + c->name, c->usage); + } + dpctl_puts(dpctl_p, false, ds.string); + ds_destroy(&ds); + + return 0; +} + +/* Undocumented commands for unit testing. */ + +static int +dpctl_parse_actions(int argc, const char *argv[], struct dpctl_params* dpctl_p) +{ + int i, error = 0; + + for (i = 1; i < argc; i++) { + struct ofpbuf actions; + struct ds s; + + ofpbuf_init(&actions, 0); + error = odp_actions_from_string(argv[i], NULL, &actions); + + if (error) { + ofpbuf_uninit(&actions); + dpctl_error(dpctl_p, error, "odp_actions_from_string"); + return error; + } + + ds_init(&s); + format_odp_actions(&s, actions.data, actions.size); + dpctl_print(dpctl_p, "%s\n", ds_cstr(&s)); + ds_destroy(&s); + + ofpbuf_uninit(&actions); + } + + return error; +} + +struct actions_for_flow { + struct hmap_node hmap_node; + struct flow flow; + struct ofpbuf actions; +}; + +static struct actions_for_flow * +get_actions_for_flow(struct hmap *actions_per_flow, const struct flow *flow) +{ + uint32_t hash = flow_hash(flow, 0); + struct actions_for_flow *af; + + HMAP_FOR_EACH_WITH_HASH (af, hmap_node, hash, actions_per_flow) { + if (flow_equal(&af->flow, flow)) { + return af; + } + } + + af = xmalloc(sizeof *af); + af->flow = *flow; + ofpbuf_init(&af->actions, 0); + hmap_insert(actions_per_flow, &af->hmap_node, hash); + return af; +} + +static int +compare_actions_for_flow(const void *a_, const void *b_) +{ + struct actions_for_flow *const *a = a_; + struct actions_for_flow *const *b = b_; + + return flow_compare_3way(&(*a)->flow, &(*b)->flow); +} + +static int +compare_output_actions(const void *a_, const void *b_) +{ + const struct nlattr *a = a_; + const struct nlattr *b = b_; + uint32_t a_port = nl_attr_get_u32(a); + uint32_t b_port = nl_attr_get_u32(b); + + return a_port < b_port ? -1 : a_port > b_port; +} + +static void +sort_output_actions__(struct nlattr *first, struct nlattr *end) +{ + size_t bytes = (uint8_t *) end - (uint8_t *) first; + size_t n = bytes / NL_A_U32_SIZE; + + ovs_assert(bytes % NL_A_U32_SIZE == 0); + qsort(first, n, NL_A_U32_SIZE, compare_output_actions); +} + +static void +sort_output_actions(struct nlattr *actions, size_t length) +{ + struct nlattr *first_output = NULL; + struct nlattr *a; + int left; + + NL_ATTR_FOR_EACH (a, left, actions, length) { + if (nl_attr_type(a) == OVS_ACTION_ATTR_OUTPUT) { + if (!first_output) { + first_output = a; + } + } else { + if (first_output) { + sort_output_actions__(first_output, a); + first_output = NULL; + } + } + } + if (first_output) { + uint8_t *end = (uint8_t *) actions + length; + sort_output_actions__(first_output, + ALIGNED_CAST(struct nlattr *, end)); + } +} + +/* usage: "ovs-dpctl normalize-actions FLOW ACTIONS" where FLOW and ACTIONS + * have the syntax used by "ovs-dpctl dump-flows". + * + * This command prints ACTIONS in a format that shows what happens for each + * VLAN, independent of the order of the ACTIONS. For example, there is more + * than one way to output a packet on VLANs 9 and 11, but this command will + * print the same output for any form. + * + * The idea here generalizes beyond VLANs (e.g. to setting other fields) but + * so far the implementation only covers VLANs. */ +static int +dpctl_normalize_actions(int argc, const char *argv[], + struct dpctl_params *dpctl_p) +{ + struct simap port_names; + struct ofpbuf keybuf; + struct flow flow; + struct ofpbuf odp_actions; + struct hmap actions_per_flow; + struct actions_for_flow **afs; + struct actions_for_flow *af; + struct nlattr *a; + size_t n_afs; + struct ds s; + int left; + int i, error; + + ds_init(&s); + + simap_init(&port_names); + for (i = 3; i < argc; i++) { + char name[16]; + int number; + + if (ovs_scan(argv[i], "%15[^=]=%d", name, &number)) { + uintptr_t n = number; + simap_put(&port_names, name, n); + } else { + dpctl_error(dpctl_p, 0, "%s: expected NAME=NUMBER", argv[i]); + error = EINVAL; + goto out; + } + } + + /* Parse flow key. */ + ofpbuf_init(&keybuf, 0); + error = odp_flow_from_string(argv[1], &port_names, &keybuf, NULL); + if (error) { + dpctl_error(dpctl_p, error, "odp_flow_key_from_string"); + goto out_freekeybuf; + } + + ds_clear(&s); + odp_flow_format(keybuf.data, keybuf.size, NULL, 0, NULL, + &s, dpctl_p->verbosity); + dpctl_print(dpctl_p, "input flow: %s\n", ds_cstr(&s)); + + error = odp_flow_key_to_flow(keybuf.data, keybuf.size, &flow); + if (error) { + dpctl_error(dpctl_p, error, "odp_flow_key_to_flow"); + goto out_freekeybuf; + } + + /* Parse actions. */ + ofpbuf_init(&odp_actions, 0); + error = odp_actions_from_string(argv[2], &port_names, &odp_actions); + if (error) { + dpctl_error(dpctl_p, error, "odp_actions_from_string"); + goto out_freeactions; + } + + if (dpctl_p->verbosity) { + ds_clear(&s); + format_odp_actions(&s, odp_actions.data, odp_actions.size); + dpctl_print(dpctl_p, "input actions: %s\n", ds_cstr(&s)); + } + + hmap_init(&actions_per_flow); + NL_ATTR_FOR_EACH (a, left, odp_actions.data, odp_actions.size) { + const struct ovs_action_push_vlan *push; + switch(nl_attr_type(a)) { + case OVS_ACTION_ATTR_POP_VLAN: + flow.vlan_tci = htons(0); + continue; + + case OVS_ACTION_ATTR_PUSH_VLAN: + push = nl_attr_get_unspec(a, sizeof *push); + flow.vlan_tci = push->vlan_tci; + continue; + } + + af = get_actions_for_flow(&actions_per_flow, &flow); + nl_msg_put_unspec(&af->actions, nl_attr_type(a), + nl_attr_get(a), nl_attr_get_size(a)); + } + + n_afs = hmap_count(&actions_per_flow); + afs = xmalloc(n_afs * sizeof *afs); + i = 0; + HMAP_FOR_EACH (af, hmap_node, &actions_per_flow) { + afs[i++] = af; + } + + ovs_assert(i == n_afs); + hmap_destroy(&actions_per_flow); + + qsort(afs, n_afs, sizeof *afs, compare_actions_for_flow); + + for (i = 0; i < n_afs; i++) { + struct actions_for_flow *af = afs[i]; + + sort_output_actions(af->actions.data, af->actions.size); + + if (af->flow.vlan_tci != htons(0)) { + dpctl_print(dpctl_p, "vlan(vid=%"PRIu16",pcp=%d): ", + vlan_tci_to_vid(af->flow.vlan_tci), + vlan_tci_to_pcp(af->flow.vlan_tci)); + } else { + dpctl_print(dpctl_p, "no vlan: "); + } + + if (eth_type_mpls(af->flow.dl_type)) { + dpctl_print(dpctl_p, "mpls(label=%"PRIu32",tc=%d,ttl=%d): ", + mpls_lse_to_label(af->flow.mpls_lse[0]), + mpls_lse_to_tc(af->flow.mpls_lse[0]), + mpls_lse_to_ttl(af->flow.mpls_lse[0])); + } else { + dpctl_print(dpctl_p, "no mpls: "); + } + + ds_clear(&s); + format_odp_actions(&s, af->actions.data, af->actions.size); + dpctl_puts(dpctl_p, false, ds_cstr(&s)); + + ofpbuf_uninit(&af->actions); + free(af); + } + free(afs); + + +out_freeactions: + ofpbuf_uninit(&odp_actions); +out_freekeybuf: + ofpbuf_uninit(&keybuf); +out: + simap_destroy(&port_names); + ds_destroy(&s); + + return error; +} + +static const struct dpctl_command all_commands[] = { + { "add-dp", "add-dp dp [iface...]", 1, INT_MAX, dpctl_add_dp }, + { "del-dp", "del-dp dp", 1, 1, dpctl_del_dp }, + { "add-if", "add-if dp iface...", 2, INT_MAX, dpctl_add_if }, + { "del-if", "del-if dp iface...", 2, INT_MAX, dpctl_del_if }, + { "set-if", "set-if dp iface...", 2, INT_MAX, dpctl_set_if }, + { "dump-dps", "", 0, 0, dpctl_dump_dps }, + { "show", "[dp...]", 0, INT_MAX, dpctl_show }, + { "dump-flows", "[dp]", 0, 2, dpctl_dump_flows }, + { "add-flow", "add-flow [dp] flow actions", 2, 3, dpctl_add_flow }, + { "mod-flow", "mod-flow [dp] flow actions", 2, 3, dpctl_mod_flow }, + { "get-flow", "get-flow [dp] ufid", 1, 2, dpctl_get_flow }, + { "del-flow", "del-flow [dp] flow", 1, 2, dpctl_del_flow }, + { "del-flows", "[dp]", 0, 1, dpctl_del_flows }, + { "help", "", 0, INT_MAX, dpctl_help }, + { "list-commands", "", 0, INT_MAX, dpctl_list_commands }, + + /* Undocumented commands for testing. */ + { "parse-actions", "actions", 1, INT_MAX, dpctl_parse_actions }, + { "normalize-actions", "actions", 2, INT_MAX, dpctl_normalize_actions }, + + { NULL, NULL, 0, 0, NULL }, +}; + +static const struct dpctl_command *get_all_dpctl_commands(void) +{ + return all_commands; +} + +/* Runs the command designated by argv[0] within the command table specified by + * 'commands', which must be terminated by a command whose 'name' member is a + * null pointer. */ +int +dpctl_run_command(int argc, const char *argv[], struct dpctl_params *dpctl_p) +{ + const struct dpctl_command *p; + + if (argc < 1) { + dpctl_error(dpctl_p, 0, "missing command name; use --help for help"); + return EINVAL; + } + + for (p = all_commands; p->name != NULL; p++) { + if (!strcmp(p->name, argv[0])) { + int n_arg = argc - 1; + if (n_arg < p->min_args) { + dpctl_error(dpctl_p, 0, + "'%s' command requires at least %d arguments", + p->name, p->min_args); + return EINVAL; + } else if (n_arg > p->max_args) { + dpctl_error(dpctl_p, 0, + "'%s' command takes at most %d arguments", + p->name, p->max_args); + return EINVAL; + } else { + return p->handler(argc, argv, dpctl_p); + } + } + } + + dpctl_error(dpctl_p, 0, "unknown command '%s'; use --help for help", + argv[0]); + return EINVAL; +} + +static void +dpctl_unixctl_print(void *userdata, bool error OVS_UNUSED, const char *msg) +{ + struct ds *ds = userdata; + ds_put_cstr(ds, msg); +} + +static void +dpctl_unixctl_handler(struct unixctl_conn *conn, int argc, const char *argv[], + void *aux) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + struct dpctl_params dpctl_p; + bool error = false; + + dpctl_command_handler *handler = (dpctl_command_handler *) aux; + + dpctl_p.print_statistics = false; + dpctl_p.zero_statistics = false; + dpctl_p.may_create = false; + dpctl_p.verbosity = 0; + + /* Parse options (like getopt). Unfortunately it does + * not seem a good idea to call getopt_long() here, since it uses global + * variables */ + while (argc > 1 && !error) { + const char *arg = argv[1]; + if (!strncmp(arg, "--", 2)) { + /* Long option */ + if (!strcmp(arg, "--statistics")) { + dpctl_p.print_statistics = true; + } else if (!strcmp(arg, "--clear")) { + dpctl_p.zero_statistics = true; + } else if (!strcmp(arg, "--may-create")) { + dpctl_p.may_create = true; + } else if (!strcmp(arg, "--more")) { + dpctl_p.verbosity++; + } else { + ds_put_format(&ds, "Unrecognized option %s", argv[1]); + error = true; + } + } else if (arg[0] == '-' && arg[1] != '\0') { + /* Short option[s] */ + const char *opt = &arg[1]; + + while (*opt && !error) { + switch (*opt) { + case 'm': + dpctl_p.verbosity++; + break; + case 's': + dpctl_p.print_statistics = true; + break; + default: + ds_put_format(&ds, "Unrecognized option -%c", *opt); + error = true; + break; + } + opt++; + } + } else { + /* Doesn't start with -, not an option */ + break; + } + + if (error) { + break; + } + argv++; + argc--; + } + + if (!error) { + dpctl_p.is_appctl = true; + dpctl_p.output = dpctl_unixctl_print; + dpctl_p.aux = &ds; + + error = handler(argc, argv, &dpctl_p) != 0; + } + + if (error) { + unixctl_command_reply_error(conn, ds_cstr(&ds)); + } else { + unixctl_command_reply(conn, ds_cstr(&ds)); + } + + ds_destroy(&ds); +} + +void +dpctl_unixctl_register(void) +{ + const struct dpctl_command *p; + + for (p = all_commands; p->name != NULL; p++) { + char *cmd_name = xasprintf("dpctl/%s", p->name); + unixctl_command_register(cmd_name, "", p->min_args, p->max_args, + dpctl_unixctl_handler, p->handler); + free(cmd_name); + } +} diff -Nru openvswitch-2.3.1/lib/dpctl.h openvswitch-2.4.0~git20150623/lib/dpctl.h --- openvswitch-2.3.1/lib/dpctl.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpctl.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef DPCTL_H +#define DPCTL_H 1 + +#include + +#include "compiler.h" + +struct dpctl_params { + /* True if it is called by ovs-appctl command. */ + bool is_appctl; + + /* -s, --statistics: Print port/flow statistics? */ + bool print_statistics; + + /* --clear: Reset existing statistics to zero when modifying a flow? */ + bool zero_statistics; + + /* --may-create: Allow mod-flows command to create a new flow? */ + bool may_create; + + /* -m, --more: Increase output verbosity. */ + int verbosity; + + /* Callback for printing. This function is called from dpctl_run_command() + * to output data. The 'aux' parameter is set to the 'aux' + * member. The 'error' parameter is true if 'string' is an error + * message, false otherwise */ + void (*output)(void *aux, bool error, const char *string); + void *aux; + + /* 'usage' (if != NULL) gets called for the "help" command. */ + void (*usage)(void *aux); +}; + +int dpctl_run_command(int argc, const char *argv[], + struct dpctl_params *dpctl_p); + +void dpctl_unixctl_register(void); + +#endif /* dpctl.h */ diff -Nru openvswitch-2.3.1/lib/dpctl.man openvswitch-2.4.0~git20150623/lib/dpctl.man --- openvswitch-2.3.1/lib/dpctl.man 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpctl.man 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,151 @@ +.TP +\*(DX\fBadd\-dp \fIdp\fR [\fInetdev\fR[\fB,\fIoption\fR]...] +Creates datapath \fIdp\fR, with a local port also named \fIdp\fR. +This will fail if a network device \fIdp\fR already exists. +.IP +If \fInetdev\fRs are specified, \fB\*(PN\fR adds them to the +new datapath, just as if \fBadd\-if\fR was specified. +. +.TP +\*(DX\fBdel\-dp \fIdp\fR +Deletes datapath \fIdp\fR. If \fIdp\fR is associated with any network +devices, they are automatically removed. +. +.TP +\*(DX\fBadd\-if \fIdp netdev\fR[\fB,\fIoption\fR]... +Adds each \fInetdev\fR to the set of network devices datapath +\fIdp\fR monitors, where \fIdp\fR is the name of an existing +datapath, and \fInetdev\fR is the name of one of the host's +network devices, e.g. \fBeth0\fR. Once a network device has been added +to a datapath, the datapath has complete ownership of the network device's +traffic and the network device appears silent to the rest of the +system. +.IP +A \fInetdev\fR may be followed by a comma-separated list of options. +The following options are currently supported: +. +.RS +.IP "\fBtype=\fItype\fR" +Specifies the type of port to add. The default type is \fBsystem\fR. +.IP "\fBport_no=\fIport\fR" +Requests a specific port number within the datapath. If this option is +not specified then one will be automatically assigned. +.IP "\fIkey\fB=\fIvalue\fR" +Adds an arbitrary key-value option to the port's configuration. +.RE +.IP +\fBovs\-vswitchd.conf.db\fR(5) documents the available port types and +options. +. +.IP "\*(DX\fBset\-if \fIdp port\fR[\fB,\fIoption\fR]..." +Reconfigures each \fIport\fR in \fIdp\fR as specified. An +\fIoption\fR of the form \fIkey\fB=\fIvalue\fR adds the specified +key-value option to the port or overrides an existing key's value. An +\fIoption\fR of the form \fIkey\fB=\fR, that is, without a value, +deletes the key-value named \fIkey\fR. The type and port number of a +port cannot be changed, so \fBtype\fR and \fBport_no\fR are only allowed if +they match the existing configuration. +.TP +\*(DX\fBdel\-if \fIdp netdev\fR... +Removes each \fInetdev\fR from the list of network devices datapath +\fIdp\fR monitors. +. +.TP +\*(DX\fBdump\-dps\fR +Prints the name of each configured datapath on a separate line. +. +.TP +.DO "[\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBshow" "\fR[\fIdp\fR...]" +Prints a summary of configured datapaths, including their datapath +numbers and a list of ports connected to each datapath. (The local +port is identified as port 0.) If \fB\-s\fR or \fB\-\-statistics\fR +is specified, then packet and byte counters are also printed for each +port. +.IP +The datapath numbers consists of flow stats and mega flow mask stats. +.IP +The "lookups" row displays three stats related to flow lookup triggered +by processing incoming packets in the datapath. "hit" displays number +of packets matches existing flows. "missed" displays the number of +packets not matching any existing flow and require user space processing. +"lost" displays number of packets destined for user space process but +subsequently dropped before reaching userspace. The sum of "hit" and "miss" +equals to the total number of packets datapath processed. +.IP +The "flows" row displays the number of flows in datapath. +.IP +The "masks" row displays the mega flow mask stats. This row is omitted +for datapath not implementing mega flow. "hit" displays the total number +of masks visited for matching incoming packets. "total" displays number of +masks in the datapath. "hit/pkt" displays the average number of masks +visited per packet; the ratio between "hit" and total number of +packets processed by the datapath". +.IP +If one or more datapaths are specified, information on only those +datapaths are displayed. Otherwise, \fB\*(PN\fR displays information +about all configured datapaths. +.SS "DATAPATH FLOW TABLE DEBUGGING COMMANDS" +The following commands are primarily useful for debugging Open +vSwitch. The flow table entries (both matches and actions) that they +work with are not OpenFlow flow entries. Instead, they are different +and considerably simpler flows maintained by the Open vSwitch kernel +module. Use \fBovs\-ofctl\fR(8), instead, to work with OpenFlow flow +entries. +. +.PP +The \fIdp\fR argument to each of these commands is optional when +exactly one datapath exists, in which case that datapath is the +default. When multiple datapaths exist, then a datapath name is +required. +. +.TP +.DO "[\fB\-m \fR| \fB\-\-more\fR]" \*(DX\fBdump\-flows\fR "[\fIdp\fR] [\fBfilter=\fIfilter\fR]" +Prints to the console all flow entries in datapath \fIdp\fR's flow +table. Without \fB\-m\fR or \fB\-\-more\fR, output omits match fields +that a flow wildcards entirely; with \fB\-m\fR or \fB\-\-more\fR, +output includes all wildcarded fields. +.IP +If \fBfilter=\fIfilter\fR is specified, only displays the flows +that match the \fIfilter\fR. \fIfilter\fR is a flow in the form similiar +to that accepted by \fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command. (This is +not an OpenFlow flow: besides other differences, it never contains wildcards.) +The \fIfilter\fR is also useful to match wildcarded fields in the datapath +flow. As an example, \fBfilter='tcp,tp_src=100'\fR will match the +datapath flow containing '\fBtcp(src=80/0xff00,dst=8080/0xff)\fR'. +. +.IP "\*(DX\fBadd\-flow\fR [\fIdp\fR] \fIflow actions\fR" +.TP +.DO "[\fB\-\-clear\fR] [\fB\-\-may-create\fR] [\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBmod\-flow\fR" "[\fIdp\fR] \fIflow actions\fR" +Adds or modifies a flow in \fIdp\fR's flow table that, when a packet +matching \fIflow\fR arrives, causes \fIactions\fR to be executed. +.IP +The \fBadd\-flow\fR command succeeds only if \fIflow\fR does not +already exist in \fIdp\fR. Contrariwise, \fBmod\-flow\fR without +\fB\-\-may\-create\fR only modifies the actions for an existing flow. +With \fB\-\-may\-create\fR, \fBmod\-flow\fR will add a new flow or +modify an existing one. +.IP +If \fB\-s\fR or \fB\-\-statistics\fR is specified, then +\fBmod\-flow\fR prints the modified flow's statistics. A flow's +statistics are the number of packets and bytes that have passed +through the flow, the elapsed time since the flow last processed a +packet (if ever), and (for TCP flows) the union of the TCP flags +processed through the flow. +.IP +With \fB\-\-clear\fR, \fBmod\-flow\fR zeros out the flow's +statistics. The statistics printed if \fB\-s\fR or +\fB\-\-statistics\fR is also specified are those from just before +clearing the statistics. +. +.TP +.DO "[\fB\-s\fR | \fB\-\-statistics\fR]" "\*(DX\fBdel\-flow\fR" "[\fIdp\fR] \fIflow\fR" +Deletes the flow from \fIdp\fR's flow table that matches \fIflow\fR. +If \fB\-s\fR or \fB\-\-statistics\fR is specified, then +\fBdel\-flow\fR prints the deleted flow's statistics. +. +.IP "\*(DX\fBget\-flow\fR [\fIdp\fR] ufid:\fIufid\fR" +Fetches the flow from \fIdp\fR's flow table with unique identifier \fIufid\fR. +\fIufid\fR must be specified as a string of 32 hexadecimal characters. +. +.IP "\*(DX\fBdel\-flows\fR [\fIdp\fR]" +Deletes all flow entries from datapath \fIdp\fR's flow table. diff -Nru openvswitch-2.3.1/lib/dpif.c openvswitch-2.4.0~git20150623/lib/dpif.c --- openvswitch-2.3.1/lib/dpif.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif.c 2015-06-23 18:46:21.000000000 +0000 @@ -24,6 +24,8 @@ #include #include "coverage.h" +#include "dpctl.h" +#include "dp-packet.h" #include "dynamic-string.h" #include "flow.h" #include "netdev.h" @@ -36,12 +38,17 @@ #include "ofpbuf.h" #include "packets.h" #include "poll-loop.h" +#include "route-table.h" +#include "seq.h" #include "shash.h" #include "sset.h" #include "timeval.h" +#include "tnl-arp-cache.h" +#include "tnl-ports.h" #include "util.h" +#include "uuid.h" #include "valgrind.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(dpif); @@ -57,8 +64,8 @@ COVERAGE_DEFINE(dpif_execute_with_help); static const struct dpif_class *base_dpif_classes[] = { -#ifdef __linux__ - &dpif_linux_class, +#if defined(__linux__) || defined(_WIN32) + &dpif_netlink_class, #endif &dpif_netdev_class, }; @@ -85,6 +92,7 @@ const char *operation, const struct nlattr *key, size_t key_len, const struct nlattr *mask, size_t mask_len, + const ovs_u128 *ufid, const struct dpif_flow_stats *stats, const struct nlattr *actions, size_t actions_len); static void log_operation(const struct dpif *, const char *operation, @@ -95,7 +103,12 @@ static void log_flow_del_message(struct dpif *, const struct dpif_flow_del *, int error); static void log_execute_message(struct dpif *, const struct dpif_execute *, - int error); + bool subexecute, int error); +static void log_flow_get_message(const struct dpif *, + const struct dpif_flow_get *, int error); + +/* Incremented whenever tnl route, arp, etc changes. */ +struct seq *tnl_conf_seq; static void dp_initialize(void) @@ -105,9 +118,16 @@ if (ovsthread_once_start(&once)) { int i; + tnl_conf_seq = seq_create(); + dpctl_unixctl_register(); + tnl_port_map_init(); + tnl_arp_cache_init(); + route_table_init(); + for (i = 0; i < ARRAY_SIZE(base_dpif_classes); i++) { dp_register_provider(base_dpif_classes[i]); } + ovsthread_once_done(&once); } } @@ -116,6 +136,7 @@ dp_register_provider__(const struct dpif_class *new_class) { struct registered_dpif_class *registered_class; + int error; if (sset_contains(&dpif_blacklist, new_class->type)) { VLOG_DBG("attempted to register blacklisted provider: %s", @@ -129,6 +150,13 @@ return EEXIST; } + error = new_class->init ? new_class->init() : 0; + if (error) { + VLOG_WARN("failed to initialize %s datapath class: %s", + new_class->type, ovs_strerror(error)); + return error; + } + registered_class = xmalloc(sizeof *registered_class); registered_class->dpif_class = new_class; registered_class->refcount = 0; @@ -207,15 +235,14 @@ ovs_mutex_unlock(&dpif_mutex); } -/* Clears 'types' and enumerates the types of all currently registered datapath - * providers into it. The caller must first initialize the sset. */ +/* Adds the types of all currently registered datapath providers to 'types'. + * The caller must first initialize the sset. */ void dp_enumerate_types(struct sset *types) { struct shash_node *node; dp_initialize(); - sset_clear(types); ovs_mutex_lock(&dpif_mutex); SHASH_FOR_EACH(node, &dpif_classes) { @@ -272,7 +299,9 @@ } dpif_class = registered_class->dpif_class; - error = dpif_class->enumerate ? dpif_class->enumerate(names) : 0; + error = (dpif_class->enumerate + ? dpif_class->enumerate(names, dpif_class) + : 0); if (error) { VLOG_WARN("failed to enumerate %s datapaths: %s", dpif_class->type, ovs_strerror(error)); @@ -395,12 +424,13 @@ } /* Performs periodic work needed by 'dpif'. */ -void +bool dpif_run(struct dpif *dpif) { if (dpif->dpif_class->run) { - dpif->dpif_class->run(dpif); + return dpif->dpif_class->run(dpif); } + return false; } /* Arranges for poll_block() to wake up when dp_run() needs to be called for @@ -784,11 +814,11 @@ * arguments must have been initialized through a call to flow_extract(). * 'used' is stored into stats->used. */ void -dpif_flow_stats_extract(const struct flow *flow, const struct ofpbuf *packet, +dpif_flow_stats_extract(const struct flow *flow, const struct dp_packet *packet, long long int used, struct dpif_flow_stats *stats) { stats->tcp_flags = ntohs(flow->tcp_flags); - stats->n_bytes = ofpbuf_size(packet); + stats->n_bytes = dp_packet_size(packet); stats->n_packets = 1; stats->used = used; } @@ -810,6 +840,22 @@ } } +/* Places the hash of the 'key_len' bytes starting at 'key' into '*hash'. */ +void +dpif_flow_hash(const struct dpif *dpif OVS_UNUSED, + const void *key, size_t key_len, ovs_u128 *hash) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + static uint32_t secret; + + if (ovsthread_once_start(&once)) { + secret = random_uint32(); + ovsthread_once_done(&once); + } + hash_bytes128(key, key_len, secret, hash); + uuid_set_bits_v4((struct uuid *)hash); +} + /* Deletes all flows from 'dpif'. Returns 0 if successful, otherwise a * positive errno value. */ int @@ -824,299 +870,212 @@ return error; } -/* Queries 'dpif' for a flow entry. The flow is specified by the Netlink - * attributes with types OVS_KEY_ATTR_* in the 'key_len' bytes starting at - * 'key'. - * - * Returns 0 if successful. If no flow matches, returns ENOENT. On other - * failure, returns a positive errno value. - * - * On success, '*bufp' will be set to an ofpbuf owned by the caller that - * contains the response for 'maskp' and 'actionsp'. The caller must supply - * a valid pointer, and must free the ofpbuf (with ofpbuf_delete()) when it - * is no longer needed. - * - * If 'maskp' is nonnull, then on success '*maskp' will point to the - * Netlink attributes for the flow's mask, stored in '*bufp'. '*mask_len' - * will be set to the length of the mask attributes. - * - * If 'actionsp' is nonnull, then on success '*actionsp' will point to the - * Netlink attributes for the flow's actions, stored in '*bufp'. - * '*actions_len' will be set to the length of the actions attributes. - * - * If 'stats' is nonnull, then on success it will be updated with the flow's - * statistics. */ -int -dpif_flow_get(const struct dpif *dpif, - const struct nlattr *key, size_t key_len, struct ofpbuf **bufp, - struct nlattr **maskp, size_t *mask_len, - struct nlattr **actionsp, size_t *actions_len, - struct dpif_flow_stats *stats) +/* Attempts to install 'key' into the datapath, fetches it, then deletes it. + * Returns true if the datapath supported installing 'flow', false otherwise. + */ +bool +dpif_probe_feature(struct dpif *dpif, const char *name, + const struct ofpbuf *key, const ovs_u128 *ufid) { + struct dpif_flow flow; + struct ofpbuf reply; + uint64_t stub[DPIF_FLOW_BUFSIZE / 8]; + bool enable_feature = false; int error; - COVERAGE_INC(dpif_flow_get); - - *bufp = NULL; - error = dpif->dpif_class->flow_get(dpif, key, key_len, bufp, - maskp, mask_len, - actionsp, actions_len, - stats); + /* Use DPIF_FP_MODIFY to cover the case where ovs-vswitchd is killed (and + * restarted) at just the right time such that feature probes from the + * previous run are still present in the datapath. */ + error = dpif_flow_put(dpif, DPIF_FP_CREATE | DPIF_FP_MODIFY | DPIF_FP_PROBE, + key->data, key->size, NULL, 0, NULL, 0, + ufid, PMD_ID_NULL, NULL); if (error) { - if (actionsp) { - *actionsp = NULL; - *actions_len = 0; - } - if (maskp) { - *maskp = NULL; - *mask_len = 0; + if (error != EINVAL) { + VLOG_WARN("%s: %s flow probe failed (%s)", + dpif_name(dpif), name, ovs_strerror(error)); } - if (stats) { - memset(stats, 0, sizeof *stats); - } - ofpbuf_delete(*bufp); + return false; } - if (should_log_flow_message(error)) { - const struct nlattr *actions; - size_t acts_len; - if (!error && actionsp) { - actions = *actionsp; - acts_len = *actions_len; - } else { - actions = NULL; - acts_len = 0; - } - log_flow_message(dpif, error, "flow_get", key, key_len, - NULL, 0, stats, actions, acts_len); + ofpbuf_use_stack(&reply, &stub, sizeof stub); + error = dpif_flow_get(dpif, key->data, key->size, ufid, + PMD_ID_NULL, &reply, &flow); + if (!error + && (!ufid || (flow.ufid_present + && ovs_u128_equals(ufid, &flow.ufid)))) { + enable_feature = true; } - return error; + + error = dpif_flow_del(dpif, key->data, key->size, ufid, + PMD_ID_NULL, NULL); + if (error) { + VLOG_WARN("%s: failed to delete %s feature probe flow", + dpif_name(dpif), name); + } + + return enable_feature; } -static int -dpif_flow_put__(struct dpif *dpif, const struct dpif_flow_put *put) +/* A dpif_operate() wrapper for performing a single DPIF_OP_FLOW_GET. */ +int +dpif_flow_get(struct dpif *dpif, + const struct nlattr *key, size_t key_len, const ovs_u128 *ufid, + const unsigned pmd_id, struct ofpbuf *buf, struct dpif_flow *flow) { - int error; + struct dpif_op *opp; + struct dpif_op op; - COVERAGE_INC(dpif_flow_put); - ovs_assert(!(put->flags & ~(DPIF_FP_CREATE | DPIF_FP_MODIFY - | DPIF_FP_ZERO_STATS))); - - error = dpif->dpif_class->flow_put(dpif, put); - if (error && put->stats) { - memset(put->stats, 0, sizeof *put->stats); - } - log_flow_put_message(dpif, put, error); - return error; + op.type = DPIF_OP_FLOW_GET; + op.u.flow_get.key = key; + op.u.flow_get.key_len = key_len; + op.u.flow_get.ufid = ufid; + op.u.flow_get.pmd_id = pmd_id; + op.u.flow_get.buffer = buf; + + memset(flow, 0, sizeof *flow); + op.u.flow_get.flow = flow; + op.u.flow_get.flow->key = key; + op.u.flow_get.flow->key_len = key_len; + + opp = &op; + dpif_operate(dpif, &opp, 1); + + return op.error; } -/* Adds or modifies a flow in 'dpif'. The flow is specified by the Netlink - * attribute OVS_FLOW_ATTR_KEY with types OVS_KEY_ATTR_* in the 'key_len' bytes - * starting at 'key', and OVS_FLOW_ATTR_MASK with types of OVS_KEY_ATTR_* in - * the 'mask_len' bytes starting at 'mask'. The associated actions are - * specified by the Netlink attributes with types OVS_ACTION_ATTR_* in the - * 'actions_len' bytes starting at 'actions'. - * - * - If the flow's key does not exist in 'dpif', then the flow will be added if - * 'flags' includes DPIF_FP_CREATE. Otherwise the operation will fail with - * ENOENT. - * - * The datapath may reject attempts to insert overlapping flows with EINVAL - * or EEXIST, but clients should not rely on this: avoiding overlapping flows - * is primarily the client's responsibility. - * - * If the operation succeeds, then 'stats', if nonnull, will be zeroed. - * - * - If the flow's key does exist in 'dpif', then the flow's actions will be - * updated if 'flags' includes DPIF_FP_MODIFY. Otherwise the operation will - * fail with EEXIST. If the flow's actions are updated, then its statistics - * will be zeroed if 'flags' includes DPIF_FP_ZERO_STATS, and left as-is - * otherwise. - * - * If the operation succeeds, then 'stats', if nonnull, will be set to the - * flow's statistics before the update. - */ +/* A dpif_operate() wrapper for performing a single DPIF_OP_FLOW_PUT. */ int dpif_flow_put(struct dpif *dpif, enum dpif_flow_put_flags flags, const struct nlattr *key, size_t key_len, const struct nlattr *mask, size_t mask_len, const struct nlattr *actions, size_t actions_len, + const ovs_u128 *ufid, const unsigned pmd_id, struct dpif_flow_stats *stats) { - struct dpif_flow_put put; + struct dpif_op *opp; + struct dpif_op op; - put.flags = flags; - put.key = key; - put.key_len = key_len; - put.mask = mask; - put.mask_len = mask_len; - put.actions = actions; - put.actions_len = actions_len; - put.stats = stats; - return dpif_flow_put__(dpif, &put); -} + op.type = DPIF_OP_FLOW_PUT; + op.u.flow_put.flags = flags; + op.u.flow_put.key = key; + op.u.flow_put.key_len = key_len; + op.u.flow_put.mask = mask; + op.u.flow_put.mask_len = mask_len; + op.u.flow_put.actions = actions; + op.u.flow_put.actions_len = actions_len; + op.u.flow_put.ufid = ufid; + op.u.flow_put.pmd_id = pmd_id; + op.u.flow_put.stats = stats; -static int -dpif_flow_del__(struct dpif *dpif, struct dpif_flow_del *del) -{ - int error; - - COVERAGE_INC(dpif_flow_del); + opp = &op; + dpif_operate(dpif, &opp, 1); - error = dpif->dpif_class->flow_del(dpif, del); - if (error && del->stats) { - memset(del->stats, 0, sizeof *del->stats); - } - log_flow_del_message(dpif, del, error); - return error; + return op.error; } -/* Deletes a flow from 'dpif' and returns 0, or returns ENOENT if 'dpif' does - * not contain such a flow. The flow is specified by the Netlink attributes - * with types OVS_KEY_ATTR_* in the 'key_len' bytes starting at 'key'. - * - * If the operation succeeds, then 'stats', if nonnull, will be set to the - * flow's statistics before its deletion. */ +/* A dpif_operate() wrapper for performing a single DPIF_OP_FLOW_DEL. */ int dpif_flow_del(struct dpif *dpif, - const struct nlattr *key, size_t key_len, - struct dpif_flow_stats *stats) + const struct nlattr *key, size_t key_len, const ovs_u128 *ufid, + const unsigned pmd_id, struct dpif_flow_stats *stats) { - struct dpif_flow_del del; + struct dpif_op *opp; + struct dpif_op op; - del.key = key; - del.key_len = key_len; - del.stats = stats; - return dpif_flow_del__(dpif, &del); -} + op.type = DPIF_OP_FLOW_DEL; + op.u.flow_del.key = key; + op.u.flow_del.key_len = key_len; + op.u.flow_del.ufid = ufid; + op.u.flow_del.pmd_id = pmd_id; + op.u.flow_del.stats = stats; + op.u.flow_del.terse = false; -/* Allocates thread-local state for use with the 'flow_dump_next' function for - * 'dpif'. On return, initializes '*statep' with any private data needed for - * iteration. */ -void -dpif_flow_dump_state_init(const struct dpif *dpif, void **statep) -{ - dpif->dpif_class->flow_dump_state_init(statep); + opp = &op; + dpif_operate(dpif, &opp, 1); + + return op.error; } -/* Releases 'state' which was initialized by a call to the - * 'flow_dump_state_init' function for 'dpif'. */ -void -dpif_flow_dump_state_uninit(const struct dpif *dpif, void *state) +/* Creates and returns a new 'struct dpif_flow_dump' for iterating through the + * flows in 'dpif'. If 'terse' is true, then only UFID and statistics will + * be returned in the dump. Otherwise, all fields will be returned. + * + * This function always successfully returns a dpif_flow_dump. Error + * reporting is deferred to dpif_flow_dump_destroy(). */ +struct dpif_flow_dump * +dpif_flow_dump_create(const struct dpif *dpif, bool terse) { - dpif->dpif_class->flow_dump_state_uninit(state); + return dpif->dpif_class->flow_dump_create(dpif, terse); } -/* Initializes 'dump' to begin dumping the flows in a dpif. On sucess, - * initializes 'dump' with any data needed for iteration and returns 0. - * Otherwise, returns a positive errno value describing the problem. */ +/* Destroys 'dump', which must have been created with dpif_flow_dump_create(). + * All dpif_flow_dump_thread structures previously created for 'dump' must + * previously have been destroyed. + * + * Returns 0 if the dump operation was error-free, otherwise a positive errno + * value describing the problem. */ int -dpif_flow_dump_start(struct dpif_flow_dump *dump, const struct dpif *dpif) +dpif_flow_dump_destroy(struct dpif_flow_dump *dump) { - int error; - dump->dpif = dpif; - error = dpif->dpif_class->flow_dump_start(dpif, &dump->iter); - log_operation(dpif, "flow_dump_start", error); - return error; + const struct dpif *dpif = dump->dpif; + int error = dpif->dpif_class->flow_dump_destroy(dump); + log_operation(dpif, "flow_dump_destroy", error); + return error == EOF ? 0 : error; } -/* Attempts to retrieve another flow from 'dump', using 'state' for - * thread-local storage. 'dump' must have been initialized with a successful - * call to dpif_flow_dump_start(), and 'state' must have been initialized with - * dpif_flow_state_init(). - * - * On success, updates the output parameters as described below and returns - * true. Otherwise, returns false. Failure might indicate an actual error or - * merely the end of the flow table. An error status for the entire dump - * operation is provided when it is completed by calling dpif_flow_dump_done(). - * Multiple threads may use the same 'dump' with this function, but all other - * parameters must not be shared. - * - * On success, if 'key' and 'key_len' are nonnull then '*key' and '*key_len' - * will be set to Netlink attributes with types OVS_KEY_ATTR_* representing the - * dumped flow's key. If 'actions' and 'actions_len' are nonnull then they are - * set to Netlink attributes with types OVS_ACTION_ATTR_* representing the - * dumped flow's actions. If 'stats' is nonnull then it will be set to the - * dumped flow's statistics. - * - * All of the returned data is owned by 'dpif', not by the caller, and the - * caller must not modify or free it. 'dpif' guarantees that it remains - * accessible and unchanging until at least the next call to 'flow_dump_next' - * or 'flow_dump_done' for 'dump' and 'state'. */ -bool -dpif_flow_dump_next(struct dpif_flow_dump *dump, void *state, - const struct nlattr **key, size_t *key_len, - const struct nlattr **mask, size_t *mask_len, - const struct nlattr **actions, size_t *actions_len, - const struct dpif_flow_stats **stats) +/* Returns new thread-local state for use with dpif_flow_dump_next(). */ +struct dpif_flow_dump_thread * +dpif_flow_dump_thread_create(struct dpif_flow_dump *dump) { - const struct dpif *dpif = dump->dpif; - int error; - - error = dpif->dpif_class->flow_dump_next(dpif, dump->iter, state, - key, key_len, mask, mask_len, - actions, actions_len, stats); - if (error) { - if (key) { - *key = NULL; - *key_len = 0; - } - if (mask) { - *mask = NULL; - *mask_len = 0; - } - if (actions) { - *actions = NULL; - *actions_len = 0; - } - if (stats) { - *stats = NULL; - } - } - if (error == EOF) { - VLOG_DBG_RL(&dpmsg_rl, "%s: dumped all flows", dpif_name(dpif)); - } else if (should_log_flow_message(error)) { - log_flow_message(dpif, error, "flow_dump", - key ? *key : NULL, key ? *key_len : 0, - mask ? *mask : NULL, mask ? *mask_len : 0, - stats ? *stats : NULL, actions ? *actions : NULL, - actions ? *actions_len : 0); - } - return !error; + return dump->dpif->dpif_class->flow_dump_thread_create(dump); } -/* Determines whether the next call to 'dpif_flow_dump_next' for 'dump' and - * 'state' will modify or free the keys that it previously returned. 'state' - * must have been initialized by a call to 'dpif_flow_dump_state_init' for - * 'dump'. - * - * 'dpif' guarantees that data returned by flow_dump_next() will remain - * accessible and unchanging until the next call. This function provides a way - * for callers to determine whether that guarantee extends beyond the next - * call. - * - * Returns true if the next call to flow_dump_next() is expected to be - * destructive to previously returned keys for 'state', false otherwise. */ -bool -dpif_flow_dump_next_may_destroy_keys(struct dpif_flow_dump *dump, void *state) +/* Releases 'thread'. */ +void +dpif_flow_dump_thread_destroy(struct dpif_flow_dump_thread *thread) { - const struct dpif *dpif = dump->dpif; - return (dpif->dpif_class->flow_dump_next_may_destroy_keys - ? dpif->dpif_class->flow_dump_next_may_destroy_keys(state) - : true); + thread->dpif->dpif_class->flow_dump_thread_destroy(thread); } -/* Completes flow table dump operation 'dump', which must have been initialized - * with a successful call to dpif_flow_dump_start(). Returns 0 if the dump - * operation was error-free, otherwise a positive errno value describing the - * problem. */ -int -dpif_flow_dump_done(struct dpif_flow_dump *dump) -{ - const struct dpif *dpif = dump->dpif; - int error = dpif->dpif_class->flow_dump_done(dpif, dump->iter); - log_operation(dpif, "flow_dump_done", error); - return error == EOF ? 0 : error; +/* Attempts to retrieve up to 'max_flows' more flows from 'thread'. Returns 0 + * if and only if no flows remained to be retrieved, otherwise a positive + * number reflecting the number of elements in 'flows[]' that were updated. + * The number of flows returned might be less than 'max_flows' because + * fewer than 'max_flows' remained, because this particular datapath does not + * benefit from batching, or because an error occurred partway through + * retrieval. Thus, the caller should continue calling until a 0 return value, + * even if intermediate return values are less than 'max_flows'. + * + * No error status is immediately provided. An error status for the entire + * dump operation is provided when it is completed by calling + * dpif_flow_dump_destroy(). + * + * All of the data stored into 'flows' is owned by the datapath, not by the + * caller, and the caller must not modify or free it. The datapath guarantees + * that it remains accessible and unchanged until the first of: + * - The next call to dpif_flow_dump_next() for 'thread', or + * - The next rcu quiescent period. */ +int +dpif_flow_dump_next(struct dpif_flow_dump_thread *thread, + struct dpif_flow *flows, int max_flows) +{ + struct dpif *dpif = thread->dpif; + int n; + + ovs_assert(max_flows > 0); + n = dpif->dpif_class->flow_dump_next(thread, flows, max_flows); + if (n > 0) { + struct dpif_flow *f; + + for (f = flows; f < &flows[n] && should_log_flow_message(0); f++) { + log_flow_message(dpif, 0, "flow_dump", + f->key, f->key_len, f->mask, f->mask_len, + &f->ufid, &f->stats, f->actions, f->actions_len); + } + } else { + VLOG_DBG_RL(&dpmsg_rl, "%s: dumped all flows", dpif_name(dpif)); + } + return n; } struct dpif_execute_helper_aux { @@ -1127,20 +1086,25 @@ /* This is called for actions that need the context of the datapath to be * meaningful. */ static void -dpif_execute_helper_cb(void *aux_, struct ofpbuf *packet, - struct pkt_metadata *md, +dpif_execute_helper_cb(void *aux_, struct dp_packet **packets, int cnt, const struct nlattr *action, bool may_steal OVS_UNUSED) { struct dpif_execute_helper_aux *aux = aux_; int type = nl_attr_type(action); + struct dp_packet *packet = *packets; + + ovs_assert(cnt == 1); switch ((enum ovs_action_attr)type) { case OVS_ACTION_ATTR_OUTPUT: + case OVS_ACTION_ATTR_TUNNEL_PUSH: + case OVS_ACTION_ATTR_TUNNEL_POP: case OVS_ACTION_ATTR_USERSPACE: case OVS_ACTION_ATTR_RECIRC: { struct dpif_execute execute; struct ofpbuf execute_actions; uint64_t stub[256 / 8]; + struct pkt_metadata *md = &packet->md; if (md->tunnel.ip_dst) { /* The Linux kernel datapath throws away the tunnel information @@ -1150,17 +1114,18 @@ odp_put_tunnel_action(&md->tunnel, &execute_actions); ofpbuf_put(&execute_actions, action, NLA_ALIGN(action->nla_len)); - execute.actions = ofpbuf_data(&execute_actions); - execute.actions_len = ofpbuf_size(&execute_actions); + execute.actions = execute_actions.data; + execute.actions_len = execute_actions.size; } else { execute.actions = action; execute.actions_len = NLA_ALIGN(action->nla_len); } execute.packet = packet; - execute.md = *md; execute.needs_help = false; - aux->error = aux->dpif->dpif_class->execute(aux->dpif, &execute); + execute.probe = false; + aux->error = dpif_execute(aux->dpif, &execute); + log_execute_message(aux->dpif, &execute, true, aux->error); if (md->tunnel.ip_dst) { ofpbuf_uninit(&execute_actions); @@ -1174,6 +1139,7 @@ case OVS_ACTION_ATTR_PUSH_MPLS: case OVS_ACTION_ATTR_POP_MPLS: case OVS_ACTION_ATTR_SET: + case OVS_ACTION_ATTR_SET_MASKED: case OVS_ACTION_ATTR_SAMPLE: case OVS_ACTION_ATTR_UNSPEC: case __OVS_ACTION_ATTR_MAX: @@ -1190,132 +1156,128 @@ dpif_execute_with_help(struct dpif *dpif, struct dpif_execute *execute) { struct dpif_execute_helper_aux aux = {dpif, 0}; + struct dp_packet *pp; COVERAGE_INC(dpif_execute_with_help); - odp_execute_actions(&aux, execute->packet, false, &execute->md, - execute->actions, execute->actions_len, - dpif_execute_helper_cb); + pp = execute->packet; + odp_execute_actions(&aux, &pp, 1, false, execute->actions, + execute->actions_len, dpif_execute_helper_cb); return aux.error; } -/* Causes 'dpif' to perform the 'execute->actions_len' bytes of actions in - * 'execute->actions' on the Ethernet frame in 'execute->packet' and on packet - * metadata in 'execute->md'. The implementation is allowed to modify both the - * '*execute->packet' and 'execute->md'. - * - * Some dpif providers do not implement every action. The Linux kernel - * datapath, in particular, does not implement ARP field modification. If - * 'needs_help' is true, the dpif layer executes in userspace all of the - * actions that it can, and for OVS_ACTION_ATTR_OUTPUT and - * OVS_ACTION_ATTR_USERSPACE actions it passes the packet through to the dpif - * implementation. - * - * This works even if 'execute->actions_len' is too long for a Netlink - * attribute. - * - * Returns 0 if successful, otherwise a positive errno value. */ +/* Returns true if the datapath needs help executing 'execute'. */ +static bool +dpif_execute_needs_help(const struct dpif_execute *execute) +{ + return execute->needs_help || nl_attr_oversized(execute->actions_len); +} + +/* A dpif_operate() wrapper for performing a single DPIF_OP_EXECUTE. */ int dpif_execute(struct dpif *dpif, struct dpif_execute *execute) { - int error; + if (execute->actions_len) { + struct dpif_op *opp; + struct dpif_op op; - COVERAGE_INC(dpif_execute); - if (execute->actions_len > 0) { - error = (execute->needs_help || nl_attr_oversized(execute->actions_len) - ? dpif_execute_with_help(dpif, execute) - : dpif->dpif_class->execute(dpif, execute)); - } else { - error = 0; - } + op.type = DPIF_OP_EXECUTE; + op.u.execute = *execute; - log_execute_message(dpif, execute, error); + opp = &op; + dpif_operate(dpif, &opp, 1); - return error; + return op.error; + } else { + return 0; + } } /* Executes each of the 'n_ops' operations in 'ops' on 'dpif', in the order in - * which they are specified, placing each operation's results in the "output" - * members documented in comments. - * - * This function exists because some datapaths can perform batched operations - * faster than individual operations. */ + * which they are specified. Places each operation's results in the "output" + * members documented in comments, and 0 in the 'error' member on success or a + * positive errno on failure. */ void dpif_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops) { - if (dpif->dpif_class->operate) { - while (n_ops > 0) { - size_t chunk; - - /* Count 'chunk', the number of ops that can be executed without - * needing any help. Ops that need help should be rare, so we - * expect this to ordinarily be 'n_ops', that is, all the ops. */ - for (chunk = 0; chunk < n_ops; chunk++) { - struct dpif_op *op = ops[chunk]; + while (n_ops > 0) { + size_t chunk; - if (op->type == DPIF_OP_EXECUTE && op->u.execute.needs_help) { - break; - } + /* Count 'chunk', the number of ops that can be executed without + * needing any help. Ops that need help should be rare, so we + * expect this to ordinarily be 'n_ops', that is, all the ops. */ + for (chunk = 0; chunk < n_ops; chunk++) { + struct dpif_op *op = ops[chunk]; + + if (op->type == DPIF_OP_EXECUTE + && dpif_execute_needs_help(&op->u.execute)) { + break; } + } - if (chunk) { - /* Execute a chunk full of ops that the dpif provider can - * handle itself, without help. */ - size_t i; - - dpif->dpif_class->operate(dpif, ops, chunk); - - for (i = 0; i < chunk; i++) { - struct dpif_op *op = ops[i]; - - switch (op->type) { - case DPIF_OP_FLOW_PUT: - log_flow_put_message(dpif, &op->u.flow_put, op->error); - break; - - case DPIF_OP_FLOW_DEL: - log_flow_del_message(dpif, &op->u.flow_del, op->error); - break; - - case DPIF_OP_EXECUTE: - log_execute_message(dpif, &op->u.execute, op->error); - break; + if (chunk) { + /* Execute a chunk full of ops that the dpif provider can + * handle itself, without help. */ + size_t i; + + dpif->dpif_class->operate(dpif, ops, chunk); + + for (i = 0; i < chunk; i++) { + struct dpif_op *op = ops[i]; + int error = op->error; + + switch (op->type) { + case DPIF_OP_FLOW_PUT: { + struct dpif_flow_put *put = &op->u.flow_put; + + COVERAGE_INC(dpif_flow_put); + log_flow_put_message(dpif, put, error); + if (error && put->stats) { + memset(put->stats, 0, sizeof *put->stats); } + break; } - ops += chunk; - n_ops -= chunk; - } else { - /* Help the dpif provider to execute one op. */ - struct dpif_op *op = ops[0]; - - op->error = dpif_execute(dpif, &op->u.execute); - ops++; - n_ops--; - } - } - } else { - size_t i; + case DPIF_OP_FLOW_GET: { + struct dpif_flow_get *get = &op->u.flow_get; - for (i = 0; i < n_ops; i++) { - struct dpif_op *op = ops[i]; + COVERAGE_INC(dpif_flow_get); + if (error) { + memset(get->flow, 0, sizeof *get->flow); + } + log_flow_get_message(dpif, get, error); - switch (op->type) { - case DPIF_OP_FLOW_PUT: - op->error = dpif_flow_put__(dpif, &op->u.flow_put); - break; + break; + } - case DPIF_OP_FLOW_DEL: - op->error = dpif_flow_del__(dpif, &op->u.flow_del); - break; + case DPIF_OP_FLOW_DEL: { + struct dpif_flow_del *del = &op->u.flow_del; - case DPIF_OP_EXECUTE: - op->error = dpif_execute(dpif, &op->u.execute); - break; + COVERAGE_INC(dpif_flow_del); + log_flow_del_message(dpif, del, error); + if (error && del->stats) { + memset(del->stats, 0, sizeof *del->stats); + } + break; + } - default: - OVS_NOT_REACHED(); + case DPIF_OP_EXECUTE: + COVERAGE_INC(dpif_execute); + log_execute_message(dpif, &op->u.execute, false, error); + break; + } } + + ops += chunk; + n_ops -= chunk; + } else { + /* Help the dpif provider to execute one op. */ + struct dpif_op *op = ops[0]; + + COVERAGE_INC(dpif_execute); + op->error = dpif_execute_with_help(dpif, &op->u.execute); + ops++; + n_ops--; } } } @@ -1341,8 +1303,12 @@ int dpif_recv_set(struct dpif *dpif, bool enable) { - int error = dpif->dpif_class->recv_set(dpif, enable); - log_operation(dpif, "recv_set", error); + int error = 0; + + if (dpif->dpif_class->recv_set) { + error = dpif->dpif_class->recv_set(dpif, enable); + log_operation(dpif, "recv_set", error); + } return error; } @@ -1369,8 +1335,76 @@ int dpif_handlers_set(struct dpif *dpif, uint32_t n_handlers) { - int error = dpif->dpif_class->handlers_set(dpif, n_handlers); - log_operation(dpif, "handlers_set", error); + int error = 0; + + if (dpif->dpif_class->handlers_set) { + error = dpif->dpif_class->handlers_set(dpif, n_handlers); + log_operation(dpif, "handlers_set", error); + } + return error; +} + +void +dpif_register_upcall_cb(struct dpif *dpif, upcall_callback *cb, void *aux) +{ + if (dpif->dpif_class->register_upcall_cb) { + dpif->dpif_class->register_upcall_cb(dpif, cb, aux); + } +} + +void +dpif_enable_upcall(struct dpif *dpif) +{ + if (dpif->dpif_class->enable_upcall) { + dpif->dpif_class->enable_upcall(dpif); + } +} + +void +dpif_disable_upcall(struct dpif *dpif) +{ + if (dpif->dpif_class->disable_upcall) { + dpif->dpif_class->disable_upcall(dpif); + } +} + +void +dpif_print_packet(struct dpif *dpif, struct dpif_upcall *upcall) +{ + if (!VLOG_DROP_DBG(&dpmsg_rl)) { + struct ds flow; + char *packet; + + packet = ofp_packet_to_string(dp_packet_data(&upcall->packet), + dp_packet_size(&upcall->packet)); + + ds_init(&flow); + odp_flow_key_format(upcall->key, upcall->key_len, &flow); + + VLOG_DBG("%s: %s upcall:\n%s\n%s", + dpif_name(dpif), dpif_upcall_type_to_string(upcall->type), + ds_cstr(&flow), packet); + + ds_destroy(&flow); + free(packet); + } +} + +/* If 'dpif' creates its own I/O polling threads, refreshes poll threads + * configuration. */ +int +dpif_poll_threads_set(struct dpif *dpif, unsigned int n_rxqs, + const char *cmask) +{ + int error = 0; + + if (dpif->dpif_class->poll_threads_set) { + error = dpif->dpif_class->poll_threads_set(dpif, n_rxqs, cmask); + if (error) { + log_operation(dpif, "poll_threads_set", error); + } + } + return error; } @@ -1396,25 +1430,15 @@ dpif_recv(struct dpif *dpif, uint32_t handler_id, struct dpif_upcall *upcall, struct ofpbuf *buf) { - int error = dpif->dpif_class->recv(dpif, handler_id, upcall, buf); - if (!error && !VLOG_DROP_DBG(&dpmsg_rl)) { - struct ds flow; - char *packet; - - packet = ofp_packet_to_string(ofpbuf_data(&upcall->packet), - ofpbuf_size(&upcall->packet)); - - ds_init(&flow); - odp_flow_key_format(upcall->key, upcall->key_len, &flow); + int error = EAGAIN; - VLOG_DBG("%s: %s upcall:\n%s\n%s", - dpif_name(dpif), dpif_upcall_type_to_string(upcall->type), - ds_cstr(&flow), packet); - - ds_destroy(&flow); - free(packet); - } else if (error && error != EAGAIN) { - log_operation(dpif, "recv", error); + if (dpif->dpif_class->recv) { + error = dpif->dpif_class->recv(dpif, handler_id, upcall, buf); + if (!error) { + dpif_print_packet(dpif, upcall); + } else if (error != EAGAIN) { + log_operation(dpif, "recv", error); + } } return error; } @@ -1437,7 +1461,25 @@ void dpif_recv_wait(struct dpif *dpif, uint32_t handler_id) { - dpif->dpif_class->recv_wait(dpif, handler_id); + if (dpif->dpif_class->recv_wait) { + dpif->dpif_class->recv_wait(dpif, handler_id); + } +} + +/* + * Return the datapath version. Caller is responsible for freeing + * the string. + */ +char * +dpif_get_dp_version(const struct dpif *dpif) +{ + char *version = NULL; + + if (dpif->dpif_class->get_datapath_version) { + version = dpif->dpif_class->get_datapath_version(); + } + + return version; } /* Obtains the NetFlow engine type and engine ID for 'dpif' into '*engine_type' @@ -1537,7 +1579,7 @@ log_flow_message(const struct dpif *dpif, int error, const char *operation, const struct nlattr *key, size_t key_len, const struct nlattr *mask, size_t mask_len, - const struct dpif_flow_stats *stats, + const ovs_u128 *ufid, const struct dpif_flow_stats *stats, const struct nlattr *actions, size_t actions_len) { struct ds ds = DS_EMPTY_INITIALIZER; @@ -1549,6 +1591,10 @@ if (error) { ds_put_format(&ds, "(%s) ", ovs_strerror(error)); } + if (ufid) { + odp_format_ufid(ufid, &ds); + ds_put_cstr(&ds, " "); + } odp_flow_format(key, key_len, mask, mask_len, NULL, &ds, true); if (stats) { ds_put_cstr(&ds, ", "); @@ -1566,7 +1612,7 @@ log_flow_put_message(struct dpif *dpif, const struct dpif_flow_put *put, int error) { - if (should_log_flow_message(error)) { + if (should_log_flow_message(error) && !(put->flags & DPIF_FP_PROBE)) { struct ds s; ds_init(&s); @@ -1582,7 +1628,8 @@ } log_flow_message(dpif, error, ds_cstr(&s), put->key, put->key_len, put->mask, put->mask_len, - put->stats, put->actions, put->actions_len); + put->ufid, put->stats, put->actions, + put->actions_len); ds_destroy(&s); } } @@ -1593,21 +1640,44 @@ { if (should_log_flow_message(error)) { log_flow_message(dpif, error, "flow_del", del->key, del->key_len, - NULL, 0, !error ? del->stats : NULL, NULL, 0); + NULL, 0, del->ufid, !error ? del->stats : NULL, + NULL, 0); } } +/* Logs that 'execute' was executed on 'dpif' and completed with errno 'error' + * (0 for success). 'subexecute' should be true if the execution is a result + * of breaking down a larger execution that needed help, false otherwise. + * + * + * XXX In theory, the log message could be deceptive because this function is + * called after the dpif_provider's '->execute' function, which is allowed to + * modify execute->packet and execute->md. In practice, though: + * + * - dpif-netlink doesn't modify execute->packet or execute->md. + * + * - dpif-netdev does modify them but it is less likely to have problems + * because it is built into ovs-vswitchd and cannot have version skew, + * etc. + * + * It would still be better to avoid the potential problem. I don't know of a + * good way to do that, though, that isn't expensive. */ static void log_execute_message(struct dpif *dpif, const struct dpif_execute *execute, - int error) + bool subexecute, int error) { - if (!(error ? VLOG_DROP_WARN(&error_rl) : VLOG_DROP_DBG(&dpmsg_rl))) { + if (!(error ? VLOG_DROP_WARN(&error_rl) : VLOG_DROP_DBG(&dpmsg_rl)) + && !execute->probe) { struct ds ds = DS_EMPTY_INITIALIZER; char *packet; - packet = ofp_packet_to_string(ofpbuf_data(execute->packet), - ofpbuf_size(execute->packet)); - ds_put_format(&ds, "%s: execute ", dpif_name(dpif)); + packet = ofp_packet_to_string(dp_packet_data(execute->packet), + dp_packet_size(execute->packet)); + ds_put_format(&ds, "%s: %sexecute ", + dpif_name(dpif), + (subexecute ? "sub-" + : dpif_execute_needs_help(execute) ? "super-" + : "")); format_odp_actions(&ds, execute->actions, execute->actions_len); if (error) { ds_put_format(&ds, " failed (%s)", ovs_strerror(error)); @@ -1618,3 +1688,23 @@ free(packet); } } + +static void +log_flow_get_message(const struct dpif *dpif, const struct dpif_flow_get *get, + int error) +{ + if (should_log_flow_message(error)) { + log_flow_message(dpif, error, "flow_get", + get->key, get->key_len, + get->flow->mask, get->flow->mask_len, + get->ufid, &get->flow->stats, + get->flow->actions, get->flow->actions_len); + } +} + +bool +dpif_supports_tnl_push_pop(const struct dpif *dpif) +{ + return !strcmp(dpif->dpif_class->type, "netdev") || + !strcmp(dpif->dpif_class->type, "dummy"); +} diff -Nru openvswitch-2.3.1/lib/dpif.h openvswitch-2.4.0~git20150623/lib/dpif.h --- openvswitch-2.3.1/lib/dpif.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif.h 2015-06-23 18:46:21.000000000 +0000 @@ -113,9 +113,9 @@ * * In Open vSwitch userspace, "struct flow" is the typical way to describe * a flow, but the datapath interface uses a different data format to - * allow ABI forward- and backward-compatibility. datapath/README + * allow ABI forward- and backward-compatibility. datapath/README.md * describes the rationale and design. Refer to OVS_KEY_ATTR_* and - * "struct ovs_key_*" in include/linux/openvswitch.h for details. + * "struct ovs_key_*" in include/odp-netlink.h for details. * lib/odp-util.h defines several functions for working with these flows. * * - A "mask" that, for each bit in the flow, specifies whether the datapath @@ -154,9 +154,8 @@ * within a flow. Some examples of actions are OVS_ACTION_ATTR_OUTPUT, * which transmits the packet out a port, and OVS_ACTION_ATTR_SET, which * modifies packet headers. Refer to OVS_ACTION_ATTR_* and "struct - * ovs_action_*" in include/linux/openvswitch.h for details. - * lib/odp-util.h defines several functions for working with datapath - * actions. + * ovs_action_*" in include/odp-netlink.h for details. lib/odp-util.h + * defines several functions for working with datapath actions. * * The actions list may be empty. This indicates that nothing should be * done to matching packets, that is, they should be dropped. @@ -390,8 +389,9 @@ #include #include #include "netdev.h" -#include "ofpbuf.h" +#include "dp-packet.h" #include "openflow/openflow.h" +#include "ovs-numa.h" #include "packets.h" #include "util.h" @@ -400,11 +400,13 @@ #endif struct dpif; +struct dpif_class; +struct dpif_flow; struct ds; struct flow; +struct flow_wildcards; struct nlattr; struct sset; -struct dpif_class; int dp_register_provider(const struct dpif_class *); int dp_unregister_provider(const char *type); @@ -420,7 +422,7 @@ int dpif_create_and_open(const char *name, const char *type, struct dpif **); void dpif_close(struct dpif *); -void dpif_run(struct dpif *); +bool dpif_run(struct dpif *); void dpif_wait(struct dpif *); const char *dpif_name(const struct dpif *); @@ -503,47 +505,91 @@ uint16_t tcp_flags; }; -void dpif_flow_stats_extract(const struct flow *, const struct ofpbuf *packet, +void dpif_flow_stats_extract(const struct flow *, const struct dp_packet *packet, long long int used, struct dpif_flow_stats *); void dpif_flow_stats_format(const struct dpif_flow_stats *, struct ds *); enum dpif_flow_put_flags { DPIF_FP_CREATE = 1 << 0, /* Allow creating a new flow. */ DPIF_FP_MODIFY = 1 << 1, /* Allow modifying an existing flow. */ - DPIF_FP_ZERO_STATS = 1 << 2 /* Zero the stats of an existing flow. */ + DPIF_FP_ZERO_STATS = 1 << 2, /* Zero the stats of an existing flow. */ + DPIF_FP_PROBE = 1 << 3 /* Suppress error messages, if any. */ }; +bool dpif_probe_feature(struct dpif *, const char *name, + const struct ofpbuf *key, const ovs_u128 *ufid); +void dpif_flow_hash(const struct dpif *, const void *key, size_t key_len, + ovs_u128 *hash); int dpif_flow_flush(struct dpif *); int dpif_flow_put(struct dpif *, enum dpif_flow_put_flags, const struct nlattr *key, size_t key_len, const struct nlattr *mask, size_t mask_len, const struct nlattr *actions, size_t actions_len, + const ovs_u128 *ufid, const unsigned pmd_id, struct dpif_flow_stats *); int dpif_flow_del(struct dpif *, const struct nlattr *key, size_t key_len, + const ovs_u128 *ufid, const unsigned pmd_id, struct dpif_flow_stats *); -int dpif_flow_get(const struct dpif *, +int dpif_flow_get(struct dpif *, const struct nlattr *key, size_t key_len, - struct ofpbuf **bufp, - struct nlattr **maskp, size_t *mask_len, - struct nlattr **actionsp, size_t *acts_len, - struct dpif_flow_stats *stats); + const ovs_u128 *ufid, const unsigned pmd_id, + struct ofpbuf *, struct dpif_flow *); + +/* Flow dumping interface + * ====================== + * + * This interface allows iteration through all of the flows currently installed + * in a datapath. It is somewhat complicated by two requirements: + * + * - Efficient support for dumping flows in parallel from multiple threads. + * + * - Allow callers to avoid making unnecessary copies of data returned by + * the interface across several flows in cases where the dpif + * implementation has to maintain a copy of that information anyhow. + * (That is, allow the client visibility into any underlying batching as + * part of its own batching.) + * + * + * Usage + * ----- + * + * 1. Call dpif_flow_dump_create(). + * 2. In each thread that participates in the dump (which may be just a single + * thread if parallelism isn't important): + * (a) Call dpif_flow_dump_thread_create(). + * (b) Call dpif_flow_dump_next() repeatedly until it returns 0. + * (c) Call dpif_flow_dump_thread_destroy(). + * 3. Call dpif_flow_dump_destroy(). + * + * All error reporting is deferred to the call to dpif_flow_dump_destroy(). + */ +struct dpif_flow_dump *dpif_flow_dump_create(const struct dpif *, bool terse); +int dpif_flow_dump_destroy(struct dpif_flow_dump *); -struct dpif_flow_dump { - const struct dpif *dpif; - void *iter; +struct dpif_flow_dump_thread *dpif_flow_dump_thread_create( + struct dpif_flow_dump *); +void dpif_flow_dump_thread_destroy(struct dpif_flow_dump_thread *); + +#define PMD_ID_NULL OVS_CORE_UNSPEC + +/* A datapath flow as dumped by dpif_flow_dump_next(). */ +struct dpif_flow { + const struct nlattr *key; /* Flow key, as OVS_KEY_ATTR_* attrs. */ + size_t key_len; /* 'key' length in bytes. */ + const struct nlattr *mask; /* Flow mask, as OVS_KEY_ATTR_* attrs. */ + size_t mask_len; /* 'mask' length in bytes. */ + const struct nlattr *actions; /* Actions, as OVS_ACTION_ATTR_ */ + size_t actions_len; /* 'actions' length in bytes. */ + ovs_u128 ufid; /* Unique flow identifier. */ + bool ufid_present; /* True if 'ufid' was provided by datapath.*/ + unsigned pmd_id; /* Datapath poll mode driver id. */ + struct dpif_flow_stats stats; /* Flow statistics. */ }; -void dpif_flow_dump_state_init(const struct dpif *, void **statep); -int dpif_flow_dump_start(struct dpif_flow_dump *, const struct dpif *); -bool dpif_flow_dump_next(struct dpif_flow_dump *, void *state, - const struct nlattr **key, size_t *key_len, - const struct nlattr **mask, size_t *mask_len, - const struct nlattr **actions, size_t *actions_len, - const struct dpif_flow_stats **); -bool dpif_flow_dump_next_may_destroy_keys(struct dpif_flow_dump *dump, - void *state); -int dpif_flow_dump_done(struct dpif_flow_dump *); -void dpif_flow_dump_state_uninit(const struct dpif *, void *state); +int dpif_flow_dump_next(struct dpif_flow_dump_thread *, + struct dpif_flow *flows, int max_flows); + +#define DPIF_FLOW_BUFSIZE 2048 /* Operation batching interface. * @@ -555,8 +601,35 @@ DPIF_OP_FLOW_PUT = 1, DPIF_OP_FLOW_DEL, DPIF_OP_EXECUTE, + DPIF_OP_FLOW_GET, }; +/* Add or modify a flow. + * + * The flow is specified by the Netlink attributes with types OVS_KEY_ATTR_* in + * the 'key_len' bytes starting at 'key'. The associated actions are specified + * by the Netlink attributes with types OVS_ACTION_ATTR_* in the 'actions_len' + * bytes starting at 'actions'. + * + * - If the flow's key does not exist in the dpif, then the flow will be + * added if 'flags' includes DPIF_FP_CREATE. Otherwise the operation will + * fail with ENOENT. + * + * If the operation succeeds, then 'stats', if nonnull, will be zeroed. + * + * - If the flow's key does exist in the dpif, then the flow's actions will + * be updated if 'flags' includes DPIF_FP_MODIFY. Otherwise the operation + * will fail with EEXIST. If the flow's actions are updated, then its + * statistics will be zeroed if 'flags' includes DPIF_FP_ZERO_STATS, and + * left as-is otherwise. + * + * If the operation succeeds, then 'stats', if nonnull, will be set to the + * flow's statistics before the update. + * + * - If the datapath implements multiple pmd thread with its own flow + * table, 'pmd_id' should be used to specify the particular polling + * thread for the operation. + */ struct dpif_flow_put { /* Input. */ enum dpif_flow_put_flags flags; /* DPIF_FP_*. */ @@ -566,35 +639,104 @@ size_t mask_len; /* Length of 'mask' in bytes. */ const struct nlattr *actions; /* Actions to perform on flow. */ size_t actions_len; /* Length of 'actions' in bytes. */ + const ovs_u128 *ufid; /* Optional unique flow identifier. */ + unsigned pmd_id; /* Datapath poll mode driver id. */ /* Output. */ struct dpif_flow_stats *stats; /* Optional flow statistics. */ }; +/* Delete a flow. + * + * The flow is specified by the Netlink attributes with types OVS_KEY_ATTR_* in + * the 'key_len' bytes starting at 'key', or the unique identifier 'ufid'. If + * the flow was created using 'ufid', then 'ufid' must be specified to delete + * the flow. If both are specified, 'key' will be ignored for flow deletion. + * Succeeds with status 0 if the flow is deleted, or fails with ENOENT if the + * dpif does not contain such a flow. + * + * Callers should always provide the 'key' to improve dpif logging in the event + * of errors or unexpected behaviour. + * + * If the datapath implements multiple polling thread with its own flow table, + * 'pmd_id' should be used to specify the particular polling thread for the + * operation. + * + * If the operation succeeds, then 'stats', if nonnull, will be set to the + * flow's statistics before its deletion. */ struct dpif_flow_del { /* Input. */ const struct nlattr *key; /* Flow to delete. */ size_t key_len; /* Length of 'key' in bytes. */ + const ovs_u128 *ufid; /* Unique identifier of flow to delete. */ + bool terse; /* OK to skip sending/receiving full flow + * info? */ + unsigned pmd_id; /* Datapath poll mode driver id. */ /* Output. */ struct dpif_flow_stats *stats; /* Optional flow statistics. */ }; +/* Executes actions on a specified packet. + * + * Performs the 'actions_len' bytes of actions in 'actions' on the Ethernet + * frame in 'packet' and on the packet metadata in 'md'. May modify both + * 'packet' and 'md'. + * + * Some dpif providers do not implement every action. The Linux kernel + * datapath, in particular, does not implement ARP field modification. If + * 'needs_help' is true, the dpif layer executes in userspace all of the + * actions that it can, and for OVS_ACTION_ATTR_OUTPUT and + * OVS_ACTION_ATTR_USERSPACE actions it passes the packet through to the dpif + * implementation. + * + * This works even if 'actions_len' is too long for a Netlink attribute. */ struct dpif_execute { - /* Raw support for execute passed along to the provider. */ + /* Input. */ const struct nlattr *actions; /* Actions to execute on packet. */ size_t actions_len; /* Length of 'actions' in bytes. */ - struct ofpbuf *packet; /* Packet to execute. */ - struct pkt_metadata md; /* Packet metadata. */ - - /* Some dpif providers do not implement every action. The Linux kernel - * datapath, in particular, does not implement ARP field modification. - * - * If this member is set to true, the dpif layer executes in userspace all - * of the actions that it can, and for OVS_ACTION_ATTR_OUTPUT and - * OVS_ACTION_ATTR_USERSPACE actions it passes the packet through to the - * dpif implementation. */ bool needs_help; + bool probe; /* Suppress error messages. */ + + /* Input, but possibly modified as a side effect of execution. */ + struct dp_packet *packet; /* Packet to execute. */ +}; + +/* Queries the dpif for a flow entry. + * + * The flow is specified by the Netlink attributes with types OVS_KEY_ATTR_* in + * the 'key_len' bytes starting at 'key', or the unique identifier 'ufid'. If + * the flow was created using 'ufid', then 'ufid' must be specified to fetch + * the flow. If both are specified, 'key' will be ignored for the flow query. + * 'buffer' must point to an initialized buffer, with a recommended size of + * DPIF_FLOW_BUFSIZE bytes. + * + * On success, 'flow' will be populated with the mask, actions and stats for + * the datapath flow corresponding to 'key'. The mask and actions may point + * within '*buffer', or may point at RCU-protected data. Therefore, callers + * that wish to hold these over quiescent periods must make a copy of these + * fields before quiescing. + * + * Callers should always provide 'key' to improve dpif logging in the event of + * errors or unexpected behaviour. + * + * If the datapath implements multiple polling thread with its own flow table, + * 'pmd_id' should be used to specify the particular polling thread for the + * operation. + * + * Succeeds with status 0 if the flow is fetched, or fails with ENOENT if no + * such flow exists. Other failures are indicated with a positive errno value. + */ +struct dpif_flow_get { + /* Input. */ + const struct nlattr *key; /* Flow to get. */ + size_t key_len; /* Length of 'key' in bytes. */ + const ovs_u128 *ufid; /* Unique identifier of flow to get. */ + unsigned pmd_id; /* Datapath poll mode driver id. */ + struct ofpbuf *buffer; /* Storage for output parameters. */ + + /* Output. */ + struct dpif_flow *flow; /* Resulting flow from datapath. */ }; int dpif_execute(struct dpif *, struct dpif_execute *); @@ -606,6 +748,7 @@ struct dpif_flow_put flow_put; struct dpif_flow_del flow_del; struct dpif_execute execute; + struct dpif_flow_get flow_get; } u; }; @@ -633,20 +776,59 @@ struct dpif_upcall { /* All types. */ enum dpif_upcall_type type; - struct ofpbuf packet; /* Packet data. */ + struct dp_packet packet; /* Packet data. */ struct nlattr *key; /* Flow key. */ size_t key_len; /* Length of 'key' in bytes. */ + ovs_u128 ufid; /* Unique flow identifier for 'key'. */ /* DPIF_UC_ACTION only. */ struct nlattr *userdata; /* Argument to OVS_ACTION_ATTR_USERSPACE. */ + struct nlattr *out_tun_key; /* Output tunnel key. */ }; +/* A callback to process an upcall, currently implemented only by dpif-netdev. + * + * The caller provides the 'packet' and 'flow' to process, the corresponding + * 'ufid' as generated by dpif_flow_hash(), the polling thread id 'pmd_id', + * the 'type' of the upcall, and if 'type' is DPIF_UC_ACTION then the + * 'userdata' attached to the action. + * + * The callback must fill in 'actions' with the datapath actions to apply to + * 'packet'. 'wc' and 'put_actions' will either be both null or both nonnull. + * If they are nonnull, then the caller will install a flow entry to process + * all future packets that match 'flow' and 'wc'; the callback must store a + * wildcard mask suitable for that purpose into 'wc'. If the actions to store + * into the flow entry are the same as 'actions', then the callback may leave + * 'put_actions' empty; otherwise it must store the desired actions into + * 'put_actions'. + * + * Returns 0 if successful, ENOSPC if the flow limit has been reached and no + * flow should be installed, or some otherwise a positive errno value. */ +typedef int upcall_callback(const struct dp_packet *packet, + const struct flow *flow, + ovs_u128 *ufid, + unsigned pmd_id, + enum dpif_upcall_type type, + const struct nlattr *userdata, + struct ofpbuf *actions, + struct flow_wildcards *wc, + struct ofpbuf *put_actions, + void *aux); + +void dpif_register_upcall_cb(struct dpif *, upcall_callback *, void *aux); + int dpif_recv_set(struct dpif *, bool enable); int dpif_handlers_set(struct dpif *, uint32_t n_handlers); +int dpif_poll_threads_set(struct dpif *, unsigned int n_rxqs, + const char *cmask); int dpif_recv(struct dpif *, uint32_t handler_id, struct dpif_upcall *, struct ofpbuf *); void dpif_recv_purge(struct dpif *); void dpif_recv_wait(struct dpif *, uint32_t handler_id); +void dpif_enable_upcall(struct dpif *); +void dpif_disable_upcall(struct dpif *); + +void dpif_print_packet(struct dpif *, struct dpif_upcall *); /* Miscellaneous. */ @@ -656,6 +838,8 @@ int dpif_queue_to_priority(const struct dpif *, uint32_t queue_id, uint32_t *priority); +char *dpif_get_dp_version(const struct dpif *); +bool dpif_supports_tnl_push_pop(const struct dpif *); #ifdef __cplusplus } #endif diff -Nru openvswitch-2.3.1/lib/dpif-linux.c openvswitch-2.4.0~git20150623/lib/dpif-linux.c --- openvswitch-2.3.1/lib/dpif-linux.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif-linux.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2490 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "dpif-linux.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "bitmap.h" -#include "dpif-provider.h" -#include "dynamic-string.h" -#include "flow.h" -#include "fat-rwlock.h" -#include "netdev.h" -#include "netdev-linux.h" -#include "netdev-vport.h" -#include "netlink-notifier.h" -#include "netlink-socket.h" -#include "netlink.h" -#include "odp-util.h" -#include "ofpbuf.h" -#include "packets.h" -#include "poll-loop.h" -#include "random.h" -#include "shash.h" -#include "sset.h" -#include "timeval.h" -#include "unaligned.h" -#include "util.h" -#include "vlog.h" - -VLOG_DEFINE_THIS_MODULE(dpif_linux); -enum { MAX_PORTS = USHRT_MAX }; - -/* This ethtool flag was introduced in Linux 2.6.24, so it might be - * missing if we have old headers. */ -#define ETH_FLAG_LRO (1 << 15) /* LRO is enabled */ - -struct dpif_linux_dp { - /* Generic Netlink header. */ - uint8_t cmd; - - /* struct ovs_header. */ - int dp_ifindex; - - /* Attributes. */ - const char *name; /* OVS_DP_ATTR_NAME. */ - const uint32_t *upcall_pid; /* OVS_DP_ATTR_UPCALL_PID. */ - uint32_t user_features; /* OVS_DP_ATTR_USER_FEATURES */ - struct ovs_dp_stats stats; /* OVS_DP_ATTR_STATS. */ - struct ovs_dp_megaflow_stats megaflow_stats; - /* OVS_DP_ATTR_MEGAFLOW_STATS.*/ -}; - -static void dpif_linux_dp_init(struct dpif_linux_dp *); -static int dpif_linux_dp_from_ofpbuf(struct dpif_linux_dp *, - const struct ofpbuf *); -static void dpif_linux_dp_dump_start(struct nl_dump *); -static int dpif_linux_dp_transact(const struct dpif_linux_dp *request, - struct dpif_linux_dp *reply, - struct ofpbuf **bufp); -static int dpif_linux_dp_get(const struct dpif *, struct dpif_linux_dp *reply, - struct ofpbuf **bufp); - -struct dpif_linux_flow { - /* Generic Netlink header. */ - uint8_t cmd; - - /* struct ovs_header. */ - unsigned int nlmsg_flags; - int dp_ifindex; - - /* Attributes. - * - * The 'stats' member points to 64-bit data that might only be aligned on - * 32-bit boundaries, so get_unaligned_u64() should be used to access its - * values. - * - * If 'actions' is nonnull then OVS_FLOW_ATTR_ACTIONS will be included in - * the Netlink version of the command, even if actions_len is zero. */ - const struct nlattr *key; /* OVS_FLOW_ATTR_KEY. */ - size_t key_len; - const struct nlattr *mask; /* OVS_FLOW_ATTR_MASK. */ - size_t mask_len; - const struct nlattr *actions; /* OVS_FLOW_ATTR_ACTIONS. */ - size_t actions_len; - const struct ovs_flow_stats *stats; /* OVS_FLOW_ATTR_STATS. */ - const uint8_t *tcp_flags; /* OVS_FLOW_ATTR_TCP_FLAGS. */ - const ovs_32aligned_u64 *used; /* OVS_FLOW_ATTR_USED. */ - bool clear; /* OVS_FLOW_ATTR_CLEAR. */ -}; - -static void dpif_linux_flow_init(struct dpif_linux_flow *); -static int dpif_linux_flow_from_ofpbuf(struct dpif_linux_flow *, - const struct ofpbuf *); -static void dpif_linux_flow_to_ofpbuf(const struct dpif_linux_flow *, - struct ofpbuf *); -static int dpif_linux_flow_transact(struct dpif_linux_flow *request, - struct dpif_linux_flow *reply, - struct ofpbuf **bufp); -static void dpif_linux_flow_get_stats(const struct dpif_linux_flow *, - struct dpif_flow_stats *); - -/* One of the dpif channels between the kernel and userspace. */ -struct dpif_channel { - struct nl_sock *sock; /* Netlink socket. */ - long long int last_poll; /* Last time this channel was polled. */ -}; - -struct dpif_handler { - struct dpif_channel *channels;/* Array of channels for each handler. */ - struct epoll_event *epoll_events; - int epoll_fd; /* epoll fd that includes channel socks. */ - int n_events; /* Num events returned by epoll_wait(). */ - int event_offset; /* Offset into 'epoll_events'. */ -}; - -/* Datapath interface for the openvswitch Linux kernel module. */ -struct dpif_linux { - struct dpif dpif; - int dp_ifindex; - - /* Upcall messages. */ - struct fat_rwlock upcall_lock; - struct dpif_handler *handlers; - uint32_t n_handlers; /* Num of upcall handlers. */ - int uc_array_size; /* Size of 'handler->channels' and */ - /* 'handler->epoll_events'. */ - - /* Change notification. */ - struct nl_sock *port_notifier; /* vport multicast group subscriber. */ - bool refresh_channels; -}; - -static void report_loss(struct dpif_linux *, struct dpif_channel *, - uint32_t ch_idx, uint32_t handler_id); - -static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(9999, 5); - -/* Generic Netlink family numbers for OVS. - * - * Initialized by dpif_linux_init(). */ -static int ovs_datapath_family; -static int ovs_vport_family; -static int ovs_flow_family; -static int ovs_packet_family; - -/* Generic Netlink multicast groups for OVS. - * - * Initialized by dpif_linux_init(). */ -static unsigned int ovs_vport_mcgroup; - -static int dpif_linux_init(void); -static int open_dpif(const struct dpif_linux_dp *, struct dpif **); -static uint32_t dpif_linux_port_get_pid(const struct dpif *, - odp_port_t port_no, uint32_t hash); -static int dpif_linux_refresh_channels(struct dpif_linux *, - uint32_t n_handlers); -static void dpif_linux_vport_to_ofpbuf(const struct dpif_linux_vport *, - struct ofpbuf *); -static int dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport *, - const struct ofpbuf *); - -static struct dpif_linux * -dpif_linux_cast(const struct dpif *dpif) -{ - dpif_assert_class(dpif, &dpif_linux_class); - return CONTAINER_OF(dpif, struct dpif_linux, dpif); -} - -static int -dpif_linux_enumerate(struct sset *all_dps) -{ - struct nl_dump dump; - uint64_t reply_stub[NL_DUMP_BUFSIZE / 8]; - struct ofpbuf msg, buf; - int error; - - error = dpif_linux_init(); - if (error) { - return error; - } - - ofpbuf_use_stub(&buf, reply_stub, sizeof reply_stub); - dpif_linux_dp_dump_start(&dump); - while (nl_dump_next(&dump, &msg, &buf)) { - struct dpif_linux_dp dp; - - if (!dpif_linux_dp_from_ofpbuf(&dp, &msg)) { - sset_add(all_dps, dp.name); - } - } - ofpbuf_uninit(&buf); - return nl_dump_done(&dump); -} - -static int -dpif_linux_open(const struct dpif_class *class OVS_UNUSED, const char *name, - bool create, struct dpif **dpifp) -{ - struct dpif_linux_dp dp_request, dp; - struct ofpbuf *buf; - uint32_t upcall_pid; - int error; - - error = dpif_linux_init(); - if (error) { - return error; - } - - /* Create or look up datapath. */ - dpif_linux_dp_init(&dp_request); - if (create) { - dp_request.cmd = OVS_DP_CMD_NEW; - upcall_pid = 0; - dp_request.upcall_pid = &upcall_pid; - } else { - /* Use OVS_DP_CMD_SET to report user features */ - dp_request.cmd = OVS_DP_CMD_SET; - } - dp_request.name = name; - dp_request.user_features |= OVS_DP_F_UNALIGNED; - dp_request.user_features |= OVS_DP_F_VPORT_PIDS; - error = dpif_linux_dp_transact(&dp_request, &dp, &buf); - if (error) { - return error; - } - - error = open_dpif(&dp, dpifp); - ofpbuf_delete(buf); - return error; -} - -static int -open_dpif(const struct dpif_linux_dp *dp, struct dpif **dpifp) -{ - struct dpif_linux *dpif; - - dpif = xzalloc(sizeof *dpif); - dpif->port_notifier = NULL; - fat_rwlock_init(&dpif->upcall_lock); - - dpif_init(&dpif->dpif, &dpif_linux_class, dp->name, - dp->dp_ifindex, dp->dp_ifindex); - - dpif->dp_ifindex = dp->dp_ifindex; - *dpifp = &dpif->dpif; - - return 0; -} - -/* Destroys the netlink sockets pointed by the elements in 'socksp' - * and frees the 'socksp'. */ -static void -vport_del_socksp(struct nl_sock **socksp, uint32_t n_socks) -{ - size_t i; - - for (i = 0; i < n_socks; i++) { - nl_sock_destroy(socksp[i]); - } - - free(socksp); -} - -/* Creates an array of netlink sockets. Returns an array of the - * corresponding pointers. Records the error in 'error'. */ -static struct nl_sock ** -vport_create_socksp(uint32_t n_socks, int *error) -{ - struct nl_sock **socksp = xzalloc(n_socks * sizeof *socksp); - size_t i; - - for (i = 0; i < n_socks; i++) { - *error = nl_sock_create(NETLINK_GENERIC, &socksp[i]); - if (*error) { - goto error; - } - } - - return socksp; - -error: - vport_del_socksp(socksp, n_socks); - - return NULL; -} - -/* Given the array of pointers to netlink sockets 'socksp', returns - * the array of corresponding pids. If the 'socksp' is NULL, returns - * a single-element array of value 0. */ -static uint32_t * -vport_socksp_to_pids(struct nl_sock **socksp, uint32_t n_socks) -{ - uint32_t *pids; - - if (!socksp) { - pids = xzalloc(sizeof *pids); - } else { - size_t i; - - pids = xzalloc(n_socks * sizeof *pids); - for (i = 0; i < n_socks; i++) { - pids[i] = nl_sock_pid(socksp[i]); - } - } - - return pids; -} - -/* Given the port number 'port_idx', extracts the pids of netlink sockets - * associated to the port and assigns it to 'upcall_pids'. */ -static bool -vport_get_pids(struct dpif_linux *dpif, uint32_t port_idx, - uint32_t **upcall_pids) -{ - uint32_t *pids; - size_t i; - - /* Since the nl_sock can only be assigned in either all - * or none "dpif->handlers" channels, the following check - * would suffice. */ - if (!dpif->handlers[0].channels[port_idx].sock) { - return false; - } - - pids = xzalloc(dpif->n_handlers * sizeof *pids); - - for (i = 0; i < dpif->n_handlers; i++) { - pids[i] = nl_sock_pid(dpif->handlers[i].channels[port_idx].sock); - } - - *upcall_pids = pids; - - return true; -} - -static int -vport_add_channels(struct dpif_linux *dpif, odp_port_t port_no, - struct nl_sock **socksp) -{ - struct epoll_event event; - uint32_t port_idx = odp_to_u32(port_no); - size_t i, j; - int error; - - if (dpif->handlers == NULL) { - return 0; - } - - /* We assume that the datapath densely chooses port numbers, which can - * therefore be used as an index into 'channels' and 'epoll_events' of - * 'dpif->handler'. */ - if (port_idx >= dpif->uc_array_size) { - uint32_t new_size = port_idx + 1; - - if (new_size > MAX_PORTS) { - VLOG_WARN_RL(&error_rl, "%s: datapath port %"PRIu32" too big", - dpif_name(&dpif->dpif), port_no); - return EFBIG; - } - - for (i = 0; i < dpif->n_handlers; i++) { - struct dpif_handler *handler = &dpif->handlers[i]; - - handler->channels = xrealloc(handler->channels, - new_size * sizeof *handler->channels); - - for (j = dpif->uc_array_size; j < new_size; j++) { - handler->channels[j].sock = NULL; - } - - handler->epoll_events = xrealloc(handler->epoll_events, - new_size * sizeof *handler->epoll_events); - - } - dpif->uc_array_size = new_size; - } - - memset(&event, 0, sizeof event); - event.events = EPOLLIN; - event.data.u32 = port_idx; - - for (i = 0; i < dpif->n_handlers; i++) { - struct dpif_handler *handler = &dpif->handlers[i]; - - if (epoll_ctl(handler->epoll_fd, EPOLL_CTL_ADD, nl_sock_fd(socksp[i]), - &event) < 0) { - error = errno; - goto error; - } - dpif->handlers[i].channels[port_idx].sock = socksp[i]; - dpif->handlers[i].channels[port_idx].last_poll = LLONG_MIN; - } - - return 0; - -error: - for (j = 0; j < i; j++) { - epoll_ctl(dpif->handlers[j].epoll_fd, EPOLL_CTL_DEL, - nl_sock_fd(socksp[j]), NULL); - dpif->handlers[j].channels[port_idx].sock = NULL; - } - - return error; -} - -static void -vport_del_channels(struct dpif_linux *dpif, odp_port_t port_no) -{ - uint32_t port_idx = odp_to_u32(port_no); - size_t i; - - if (!dpif->handlers || port_idx >= dpif->uc_array_size) { - return; - } - - /* Since the sock can only be assigned in either all or none - * of "dpif->handlers" channels, the following check would - * suffice. */ - if (!dpif->handlers[0].channels[port_idx].sock) { - return; - } - - for (i = 0; i < dpif->n_handlers; i++) { - struct dpif_handler *handler = &dpif->handlers[i]; - - epoll_ctl(handler->epoll_fd, EPOLL_CTL_DEL, - nl_sock_fd(handler->channels[port_idx].sock), NULL); - nl_sock_destroy(handler->channels[port_idx].sock); - handler->channels[port_idx].sock = NULL; - handler->event_offset = handler->n_events = 0; - } -} - -static void -destroy_all_channels(struct dpif_linux *dpif) OVS_REQ_WRLOCK(dpif->upcall_lock) -{ - unsigned int i; - - if (!dpif->handlers) { - return; - } - - for (i = 0; i < dpif->uc_array_size; i++ ) { - struct dpif_linux_vport vport_request; - uint32_t upcall_pids = 0; - - /* Since the sock can only be assigned in either all or none - * of "dpif->handlers" channels, the following check would - * suffice. */ - if (!dpif->handlers[0].channels[i].sock) { - continue; - } - - /* Turn off upcalls. */ - dpif_linux_vport_init(&vport_request); - vport_request.cmd = OVS_VPORT_CMD_SET; - vport_request.dp_ifindex = dpif->dp_ifindex; - vport_request.port_no = u32_to_odp(i); - vport_request.upcall_pids = &upcall_pids; - dpif_linux_vport_transact(&vport_request, NULL, NULL); - - vport_del_channels(dpif, u32_to_odp(i)); - } - - for (i = 0; i < dpif->n_handlers; i++) { - struct dpif_handler *handler = &dpif->handlers[i]; - - close(handler->epoll_fd); - free(handler->epoll_events); - free(handler->channels); - } - - free(dpif->handlers); - dpif->handlers = NULL; - dpif->n_handlers = 0; - dpif->uc_array_size = 0; -} - -static void -dpif_linux_close(struct dpif *dpif_) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - nl_sock_destroy(dpif->port_notifier); - - fat_rwlock_wrlock(&dpif->upcall_lock); - destroy_all_channels(dpif); - fat_rwlock_unlock(&dpif->upcall_lock); - - fat_rwlock_destroy(&dpif->upcall_lock); - free(dpif); -} - -static int -dpif_linux_destroy(struct dpif *dpif_) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_dp dp; - - dpif_linux_dp_init(&dp); - dp.cmd = OVS_DP_CMD_DEL; - dp.dp_ifindex = dpif->dp_ifindex; - return dpif_linux_dp_transact(&dp, NULL, NULL); -} - -static void -dpif_linux_run(struct dpif *dpif_) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - if (dpif->refresh_channels) { - dpif->refresh_channels = false; - fat_rwlock_wrlock(&dpif->upcall_lock); - dpif_linux_refresh_channels(dpif, dpif->n_handlers); - fat_rwlock_unlock(&dpif->upcall_lock); - } -} - -static int -dpif_linux_get_stats(const struct dpif *dpif_, struct dpif_dp_stats *stats) -{ - struct dpif_linux_dp dp; - struct ofpbuf *buf; - int error; - - error = dpif_linux_dp_get(dpif_, &dp, &buf); - if (!error) { - stats->n_hit = dp.stats.n_hit; - stats->n_missed = dp.stats.n_missed; - stats->n_lost = dp.stats.n_lost; - stats->n_flows = dp.stats.n_flows; - stats->n_masks = dp.megaflow_stats.n_masks; - stats->n_mask_hit = dp.megaflow_stats.n_mask_hit; - ofpbuf_delete(buf); - } - return error; -} - -static const char * -get_vport_type(const struct dpif_linux_vport *vport) -{ - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); - - switch (vport->type) { - case OVS_VPORT_TYPE_NETDEV: { - const char *type = netdev_get_type_from_name(vport->name); - - return type ? type : "system"; - } - - case OVS_VPORT_TYPE_INTERNAL: - return "internal"; - - case OVS_VPORT_TYPE_GRE: - return "gre"; - - case OVS_VPORT_TYPE_GRE64: - return "gre64"; - - case OVS_VPORT_TYPE_VXLAN: - return "vxlan"; - - case OVS_VPORT_TYPE_LISP: - return "lisp"; - - case OVS_VPORT_TYPE_UNSPEC: - case __OVS_VPORT_TYPE_MAX: - break; - } - - VLOG_WARN_RL(&rl, "dp%d: port `%s' has unsupported type %u", - vport->dp_ifindex, vport->name, (unsigned int) vport->type); - return "unknown"; -} - -static enum ovs_vport_type -netdev_to_ovs_vport_type(const struct netdev *netdev) -{ - const char *type = netdev_get_type(netdev); - - if (!strcmp(type, "tap") || !strcmp(type, "system")) { - return OVS_VPORT_TYPE_NETDEV; - } else if (!strcmp(type, "internal")) { - return OVS_VPORT_TYPE_INTERNAL; - } else if (strstr(type, "gre64")) { - return OVS_VPORT_TYPE_GRE64; - } else if (strstr(type, "gre")) { - return OVS_VPORT_TYPE_GRE; - } else if (!strcmp(type, "vxlan")) { - return OVS_VPORT_TYPE_VXLAN; - } else if (!strcmp(type, "lisp")) { - return OVS_VPORT_TYPE_LISP; - } else { - return OVS_VPORT_TYPE_UNSPEC; - } -} - -static int -dpif_linux_port_add__(struct dpif_linux *dpif, struct netdev *netdev, - odp_port_t *port_nop) - OVS_REQ_WRLOCK(dpif->upcall_lock) -{ - const struct netdev_tunnel_config *tnl_cfg; - char namebuf[NETDEV_VPORT_NAME_BUFSIZE]; - const char *name = netdev_vport_get_dpif_port(netdev, - namebuf, sizeof namebuf); - const char *type = netdev_get_type(netdev); - struct dpif_linux_vport request, reply; - struct ofpbuf *buf; - uint64_t options_stub[64 / 8]; - struct ofpbuf options; - struct nl_sock **socksp = NULL; - uint32_t *upcall_pids; - int error = 0; - - if (dpif->handlers) { - socksp = vport_create_socksp(dpif->n_handlers, &error); - if (!socksp) { - return error; - } - } - - dpif_linux_vport_init(&request); - request.cmd = OVS_VPORT_CMD_NEW; - request.dp_ifindex = dpif->dp_ifindex; - request.type = netdev_to_ovs_vport_type(netdev); - if (request.type == OVS_VPORT_TYPE_UNSPEC) { - VLOG_WARN_RL(&error_rl, "%s: cannot create port `%s' because it has " - "unsupported type `%s'", - dpif_name(&dpif->dpif), name, type); - vport_del_socksp(socksp, dpif->n_handlers); - return EINVAL; - } - request.name = name; - - if (request.type == OVS_VPORT_TYPE_NETDEV) { - netdev_linux_ethtool_set_flag(netdev, ETH_FLAG_LRO, "LRO", false); - } - - tnl_cfg = netdev_get_tunnel_config(netdev); - if (tnl_cfg && tnl_cfg->dst_port != 0) { - ofpbuf_use_stack(&options, options_stub, sizeof options_stub); - nl_msg_put_u16(&options, OVS_TUNNEL_ATTR_DST_PORT, - ntohs(tnl_cfg->dst_port)); - request.options = ofpbuf_data(&options); - request.options_len = ofpbuf_size(&options); - } - - request.port_no = *port_nop; - upcall_pids = vport_socksp_to_pids(socksp, dpif->n_handlers); - request.n_upcall_pids = socksp ? dpif->n_handlers : 1; - request.upcall_pids = upcall_pids; - - error = dpif_linux_vport_transact(&request, &reply, &buf); - if (!error) { - *port_nop = reply.port_no; - } else { - if (error == EBUSY && *port_nop != ODPP_NONE) { - VLOG_INFO("%s: requested port %"PRIu32" is in use", - dpif_name(&dpif->dpif), *port_nop); - } - - vport_del_socksp(socksp, dpif->n_handlers); - goto exit; - } - - if (socksp) { - error = vport_add_channels(dpif, *port_nop, socksp); - if (error) { - VLOG_INFO("%s: could not add channel for port %s", - dpif_name(&dpif->dpif), name); - - /* Delete the port. */ - dpif_linux_vport_init(&request); - request.cmd = OVS_VPORT_CMD_DEL; - request.dp_ifindex = dpif->dp_ifindex; - request.port_no = *port_nop; - dpif_linux_vport_transact(&request, NULL, NULL); - vport_del_socksp(socksp, dpif->n_handlers); - goto exit; - } - } - free(socksp); - -exit: - ofpbuf_delete(buf); - free(upcall_pids); - - return error; -} - -static int -dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev, - odp_port_t *port_nop) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - int error; - - fat_rwlock_wrlock(&dpif->upcall_lock); - error = dpif_linux_port_add__(dpif, netdev, port_nop); - fat_rwlock_unlock(&dpif->upcall_lock); - - return error; -} - -static int -dpif_linux_port_del__(struct dpif_linux *dpif, odp_port_t port_no) - OVS_REQ_WRLOCK(dpif->upcall_lock) -{ - struct dpif_linux_vport vport; - int error; - - dpif_linux_vport_init(&vport); - vport.cmd = OVS_VPORT_CMD_DEL; - vport.dp_ifindex = dpif->dp_ifindex; - vport.port_no = port_no; - error = dpif_linux_vport_transact(&vport, NULL, NULL); - - vport_del_channels(dpif, port_no); - - return error; -} - -static int -dpif_linux_port_del(struct dpif *dpif_, odp_port_t port_no) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - int error; - - fat_rwlock_wrlock(&dpif->upcall_lock); - error = dpif_linux_port_del__(dpif, port_no); - fat_rwlock_unlock(&dpif->upcall_lock); - - return error; -} - -static int -dpif_linux_port_query__(const struct dpif_linux *dpif, odp_port_t port_no, - const char *port_name, struct dpif_port *dpif_port) -{ - struct dpif_linux_vport request; - struct dpif_linux_vport reply; - struct ofpbuf *buf; - int error; - - dpif_linux_vport_init(&request); - request.cmd = OVS_VPORT_CMD_GET; - request.dp_ifindex = dpif->dp_ifindex; - request.port_no = port_no; - request.name = port_name; - - error = dpif_linux_vport_transact(&request, &reply, &buf); - if (!error) { - if (reply.dp_ifindex != request.dp_ifindex) { - /* A query by name reported that 'port_name' is in some datapath - * other than 'dpif', but the caller wants to know about 'dpif'. */ - error = ENODEV; - } else if (dpif_port) { - dpif_port->name = xstrdup(reply.name); - dpif_port->type = xstrdup(get_vport_type(&reply)); - dpif_port->port_no = reply.port_no; - } - ofpbuf_delete(buf); - } - return error; -} - -static int -dpif_linux_port_query_by_number(const struct dpif *dpif_, odp_port_t port_no, - struct dpif_port *dpif_port) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - return dpif_linux_port_query__(dpif, port_no, NULL, dpif_port); -} - -static int -dpif_linux_port_query_by_name(const struct dpif *dpif_, const char *devname, - struct dpif_port *dpif_port) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - return dpif_linux_port_query__(dpif, 0, devname, dpif_port); -} - -static uint32_t -dpif_linux_port_get_pid__(const struct dpif_linux *dpif, odp_port_t port_no, - uint32_t hash) - OVS_REQ_RDLOCK(dpif->upcall_lock) -{ - uint32_t port_idx = odp_to_u32(port_no); - uint32_t pid = 0; - - if (dpif->handlers && dpif->uc_array_size > 0) { - /* The ODPP_NONE "reserved" port number uses the "ovs-system"'s - * channel, since it is not heavily loaded. */ - uint32_t idx = port_idx >= dpif->uc_array_size ? 0 : port_idx; - struct dpif_handler *h = &dpif->handlers[hash % dpif->n_handlers]; - - /* Needs to check in case the socket pointer is changed in between - * the holding of upcall_lock. A known case happens when the main - * thread deletes the vport while the handler thread is handling - * the upcall from that port. */ - if (h->channels[idx].sock) { - pid = nl_sock_pid(h->channels[idx].sock); - } - } - - return pid; -} - -static uint32_t -dpif_linux_port_get_pid(const struct dpif *dpif_, odp_port_t port_no, - uint32_t hash) -{ - const struct dpif_linux *dpif = dpif_linux_cast(dpif_); - uint32_t ret; - - fat_rwlock_rdlock(&dpif->upcall_lock); - ret = dpif_linux_port_get_pid__(dpif, port_no, hash); - fat_rwlock_unlock(&dpif->upcall_lock); - - return ret; -} - -static int -dpif_linux_flow_flush(struct dpif *dpif_) -{ - const struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_flow flow; - - dpif_linux_flow_init(&flow); - flow.cmd = OVS_FLOW_CMD_DEL; - flow.dp_ifindex = dpif->dp_ifindex; - return dpif_linux_flow_transact(&flow, NULL, NULL); -} - -struct dpif_linux_port_state { - struct nl_dump dump; - struct ofpbuf buf; -}; - -static void -dpif_linux_port_dump_start__(const struct dpif_linux *dpif, - struct nl_dump *dump) -{ - struct dpif_linux_vport request; - struct ofpbuf *buf; - - dpif_linux_vport_init(&request); - request.cmd = OVS_VPORT_CMD_GET; - request.dp_ifindex = dpif->dp_ifindex; - - buf = ofpbuf_new(1024); - dpif_linux_vport_to_ofpbuf(&request, buf); - nl_dump_start(dump, NETLINK_GENERIC, buf); - ofpbuf_delete(buf); -} - -static int -dpif_linux_port_dump_start(const struct dpif *dpif_, void **statep) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_port_state *state; - - *statep = state = xmalloc(sizeof *state); - dpif_linux_port_dump_start__(dpif, &state->dump); - - ofpbuf_init(&state->buf, NL_DUMP_BUFSIZE); - return 0; -} - -static int -dpif_linux_port_dump_next__(const struct dpif_linux *dpif, struct nl_dump *dump, - struct dpif_linux_vport *vport, - struct ofpbuf *buffer) -{ - struct ofpbuf buf; - int error; - - if (!nl_dump_next(dump, &buf, buffer)) { - return EOF; - } - - error = dpif_linux_vport_from_ofpbuf(vport, &buf); - if (error) { - VLOG_WARN_RL(&error_rl, "%s: failed to parse vport record (%s)", - dpif_name(&dpif->dpif), ovs_strerror(error)); - } - return error; -} - -static int -dpif_linux_port_dump_next(const struct dpif *dpif_, void *state_, - struct dpif_port *dpif_port) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_port_state *state = state_; - struct dpif_linux_vport vport; - int error; - - error = dpif_linux_port_dump_next__(dpif, &state->dump, &vport, - &state->buf); - if (error) { - return error; - } - dpif_port->name = CONST_CAST(char *, vport.name); - dpif_port->type = CONST_CAST(char *, get_vport_type(&vport)); - dpif_port->port_no = vport.port_no; - return 0; -} - -static int -dpif_linux_port_dump_done(const struct dpif *dpif_ OVS_UNUSED, void *state_) -{ - struct dpif_linux_port_state *state = state_; - int error = nl_dump_done(&state->dump); - - ofpbuf_uninit(&state->buf); - free(state); - return error; -} - -static int -dpif_linux_port_poll(const struct dpif *dpif_, char **devnamep) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - /* Lazily create the Netlink socket to listen for notifications. */ - if (!dpif->port_notifier) { - struct nl_sock *sock; - int error; - - error = nl_sock_create(NETLINK_GENERIC, &sock); - if (error) { - return error; - } - - error = nl_sock_join_mcgroup(sock, ovs_vport_mcgroup); - if (error) { - nl_sock_destroy(sock); - return error; - } - dpif->port_notifier = sock; - - /* We have no idea of the current state so report that everything - * changed. */ - return ENOBUFS; - } - - for (;;) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); - uint64_t buf_stub[4096 / 8]; - struct ofpbuf buf; - int error; - - ofpbuf_use_stub(&buf, buf_stub, sizeof buf_stub); - error = nl_sock_recv(dpif->port_notifier, &buf, false); - if (!error) { - struct dpif_linux_vport vport; - - error = dpif_linux_vport_from_ofpbuf(&vport, &buf); - if (!error) { - if (vport.dp_ifindex == dpif->dp_ifindex - && (vport.cmd == OVS_VPORT_CMD_NEW - || vport.cmd == OVS_VPORT_CMD_DEL - || vport.cmd == OVS_VPORT_CMD_SET)) { - VLOG_DBG("port_changed: dpif:%s vport:%s cmd:%"PRIu8, - dpif->dpif.full_name, vport.name, vport.cmd); - if (vport.cmd == OVS_VPORT_CMD_DEL && dpif->handlers) { - dpif->refresh_channels = true; - } - *devnamep = xstrdup(vport.name); - ofpbuf_uninit(&buf); - return 0; - } - } - } else if (error != EAGAIN) { - VLOG_WARN_RL(&rl, "error reading or parsing netlink (%s)", - ovs_strerror(error)); - nl_sock_drain(dpif->port_notifier); - error = ENOBUFS; - } - - ofpbuf_uninit(&buf); - if (error) { - return error; - } - } -} - -static void -dpif_linux_port_poll_wait(const struct dpif *dpif_) -{ - const struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - if (dpif->port_notifier) { - nl_sock_wait(dpif->port_notifier, POLLIN); - } else { - poll_immediate_wake(); - } -} - -static int -dpif_linux_flow_get__(const struct dpif_linux *dpif, - const struct nlattr *key, size_t key_len, - struct dpif_linux_flow *reply, struct ofpbuf **bufp) -{ - struct dpif_linux_flow request; - - dpif_linux_flow_init(&request); - request.cmd = OVS_FLOW_CMD_GET; - request.dp_ifindex = dpif->dp_ifindex; - request.key = key; - request.key_len = key_len; - return dpif_linux_flow_transact(&request, reply, bufp); -} - -static int -dpif_linux_flow_get(const struct dpif *dpif_, - const struct nlattr *key, size_t key_len, - struct ofpbuf **bufp, - struct nlattr **maskp, size_t *mask_len, - struct nlattr **actionsp, size_t *actions_len, - struct dpif_flow_stats *stats) -{ - const struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_flow reply; - int error; - - error = dpif_linux_flow_get__(dpif, key, key_len, &reply, bufp); - if (!error) { - if (maskp) { - *maskp = CONST_CAST(struct nlattr *, reply.mask); - *mask_len = reply.mask_len; - } - if (actionsp) { - *actionsp = CONST_CAST(struct nlattr *, reply.actions); - *actions_len = reply.actions_len; - } - if (stats) { - dpif_linux_flow_get_stats(&reply, stats); - } - } - return error; -} - -static void -dpif_linux_init_flow_put(struct dpif_linux *dpif, const struct dpif_flow_put *put, - struct dpif_linux_flow *request) -{ - static const struct nlattr dummy_action; - - dpif_linux_flow_init(request); - request->cmd = (put->flags & DPIF_FP_CREATE - ? OVS_FLOW_CMD_NEW : OVS_FLOW_CMD_SET); - request->dp_ifindex = dpif->dp_ifindex; - request->key = put->key; - request->key_len = put->key_len; - request->mask = put->mask; - request->mask_len = put->mask_len; - /* Ensure that OVS_FLOW_ATTR_ACTIONS will always be included. */ - request->actions = (put->actions - ? put->actions - : CONST_CAST(struct nlattr *, &dummy_action)); - request->actions_len = put->actions_len; - if (put->flags & DPIF_FP_ZERO_STATS) { - request->clear = true; - } - request->nlmsg_flags = put->flags & DPIF_FP_MODIFY ? 0 : NLM_F_CREATE; -} - -static int -dpif_linux_flow_put(struct dpif *dpif_, const struct dpif_flow_put *put) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_flow request, reply; - struct ofpbuf *buf; - int error; - - dpif_linux_init_flow_put(dpif, put, &request); - error = dpif_linux_flow_transact(&request, - put->stats ? &reply : NULL, - put->stats ? &buf : NULL); - if (!error && put->stats) { - dpif_linux_flow_get_stats(&reply, put->stats); - ofpbuf_delete(buf); - } - return error; -} - -static void -dpif_linux_init_flow_del(struct dpif_linux *dpif, const struct dpif_flow_del *del, - struct dpif_linux_flow *request) -{ - dpif_linux_flow_init(request); - request->cmd = OVS_FLOW_CMD_DEL; - request->dp_ifindex = dpif->dp_ifindex; - request->key = del->key; - request->key_len = del->key_len; -} - -static int -dpif_linux_flow_del(struct dpif *dpif_, const struct dpif_flow_del *del) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_flow request, reply; - struct ofpbuf *buf; - int error; - - dpif_linux_init_flow_del(dpif, del, &request); - error = dpif_linux_flow_transact(&request, - del->stats ? &reply : NULL, - del->stats ? &buf : NULL); - if (!error && del->stats) { - dpif_linux_flow_get_stats(&reply, del->stats); - ofpbuf_delete(buf); - } - return error; -} - -struct dpif_linux_flow_state { - struct dpif_linux_flow flow; - struct dpif_flow_stats stats; - struct ofpbuf buffer; /* Always used to store flows. */ - struct ofpbuf *tmp; /* Used if kernel does not supply actions. */ -}; - -struct dpif_linux_flow_iter { - struct nl_dump dump; - atomic_int status; -}; - -static void -dpif_linux_flow_dump_state_init(void **statep) -{ - struct dpif_linux_flow_state *state; - - *statep = state = xmalloc(sizeof *state); - ofpbuf_init(&state->buffer, NL_DUMP_BUFSIZE); - state->tmp = NULL; -} - -static void -dpif_linux_flow_dump_state_uninit(void *state_) -{ - struct dpif_linux_flow_state *state = state_; - - ofpbuf_uninit(&state->buffer); - ofpbuf_delete(state->tmp); - free(state); -} - -static int -dpif_linux_flow_dump_start(const struct dpif *dpif_, void **iterp) -{ - const struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_flow_iter *iter; - struct dpif_linux_flow request; - struct ofpbuf *buf; - - *iterp = iter = xmalloc(sizeof *iter); - - dpif_linux_flow_init(&request); - request.cmd = OVS_FLOW_CMD_GET; - request.dp_ifindex = dpif->dp_ifindex; - - buf = ofpbuf_new(1024); - dpif_linux_flow_to_ofpbuf(&request, buf); - nl_dump_start(&iter->dump, NETLINK_GENERIC, buf); - ofpbuf_delete(buf); - atomic_init(&iter->status, 0); - - return 0; -} - -static int -dpif_linux_flow_dump_next(const struct dpif *dpif_, void *iter_, void *state_, - const struct nlattr **key, size_t *key_len, - const struct nlattr **mask, size_t *mask_len, - const struct nlattr **actions, size_t *actions_len, - const struct dpif_flow_stats **stats) -{ - const struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_flow_iter *iter = iter_; - struct dpif_linux_flow_state *state = state_; - struct ofpbuf buf; - int error; - - do { - ofpbuf_delete(state->tmp); - state->tmp = NULL; - - if (!nl_dump_next(&iter->dump, &buf, &state->buffer)) { - return EOF; - } - - error = dpif_linux_flow_from_ofpbuf(&state->flow, &buf); - if (error) { - atomic_store(&iter->status, error); - return error; - } - - if (actions && !state->flow.actions) { - struct dpif_linux_flow reply; - - /* Keys are required to be allocated from 'state->buffer' so - * they're preserved across calls. Therefore we need a separate - * reply to prevent them from being overwritten. Actions, however, - * don't have this requirement, so it's that fine they're destroyed - * on the next call. */ - error = dpif_linux_flow_get__(dpif, state->flow.key, - state->flow.key_len, - &reply, &state->tmp); - state->flow.actions = reply.actions; - state->flow.actions_len = reply.actions_len; - - if (error == ENOENT) { - VLOG_DBG("dumped flow disappeared on get"); - } else if (error) { - VLOG_WARN("error fetching dumped flow: %s", - ovs_strerror(error)); - } - } - } while (error); - - if (actions) { - *actions = state->flow.actions; - *actions_len = state->flow.actions_len; - } - if (key) { - *key = state->flow.key; - *key_len = state->flow.key_len; - } - if (mask) { - *mask = state->flow.mask; - *mask_len = state->flow.mask ? state->flow.mask_len : 0; - } - if (stats) { - dpif_linux_flow_get_stats(&state->flow, &state->stats); - *stats = &state->stats; - } - return error; -} - -static bool -dpif_linux_flow_dump_next_may_destroy_keys(void *state_) -{ - struct dpif_linux_flow_state *state = state_; - struct dpif_linux_flow flow; - struct ofpbuf nlmsg; - - /* Check whether there's a flow remaining in the buffer that includes - * actions. (If it does not include actions, then we could end up - * destroying keys previously returned trying to retrieve its actions - * fails.) */ - return (!nl_dump_peek(&nlmsg, &state->buffer) - || dpif_linux_flow_from_ofpbuf(&flow, &nlmsg) - || !flow.actions); -} - -static int -dpif_linux_flow_dump_done(const struct dpif *dpif OVS_UNUSED, void *iter_) -{ - struct dpif_linux_flow_iter *iter = iter_; - int dump_status; - unsigned int nl_status = nl_dump_done(&iter->dump); - - atomic_read(&iter->status, &dump_status); - free(iter); - return dump_status ? dump_status : nl_status; -} - -static void -dpif_linux_encode_execute(int dp_ifindex, const struct dpif_execute *d_exec, - struct ofpbuf *buf) -{ - struct ovs_header *k_exec; - size_t key_ofs; - - ofpbuf_prealloc_tailroom(buf, (64 - + ofpbuf_size(d_exec->packet) - + ODP_KEY_METADATA_SIZE - + d_exec->actions_len)); - - nl_msg_put_genlmsghdr(buf, 0, ovs_packet_family, NLM_F_REQUEST, - OVS_PACKET_CMD_EXECUTE, OVS_PACKET_VERSION); - - k_exec = ofpbuf_put_uninit(buf, sizeof *k_exec); - k_exec->dp_ifindex = dp_ifindex; - - nl_msg_put_unspec(buf, OVS_PACKET_ATTR_PACKET, - ofpbuf_data(d_exec->packet), - ofpbuf_size(d_exec->packet)); - - key_ofs = nl_msg_start_nested(buf, OVS_PACKET_ATTR_KEY); - odp_key_from_pkt_metadata(buf, &d_exec->md); - nl_msg_end_nested(buf, key_ofs); - - nl_msg_put_unspec(buf, OVS_PACKET_ATTR_ACTIONS, - d_exec->actions, d_exec->actions_len); -} - -static int -dpif_linux_execute__(int dp_ifindex, const struct dpif_execute *execute) -{ - uint64_t request_stub[1024 / 8]; - struct ofpbuf request; - int error; - - ofpbuf_use_stub(&request, request_stub, sizeof request_stub); - dpif_linux_encode_execute(dp_ifindex, execute, &request); - error = nl_transact(NETLINK_GENERIC, &request, NULL); - ofpbuf_uninit(&request); - - return error; -} - -static int -dpif_linux_execute(struct dpif *dpif_, struct dpif_execute *execute) -{ - const struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - return dpif_linux_execute__(dpif->dp_ifindex, execute); -} - -#define MAX_OPS 50 - -static void -dpif_linux_operate__(struct dpif_linux *dpif, struct dpif_op **ops, size_t n_ops) -{ - - struct op_auxdata { - struct nl_transaction txn; - - struct ofpbuf request; - uint64_t request_stub[1024 / 8]; - - struct ofpbuf reply; - uint64_t reply_stub[1024 / 8]; - } auxes[MAX_OPS]; - - struct nl_transaction *txnsp[MAX_OPS]; - size_t i; - - ovs_assert(n_ops <= MAX_OPS); - for (i = 0; i < n_ops; i++) { - struct op_auxdata *aux = &auxes[i]; - struct dpif_op *op = ops[i]; - struct dpif_flow_put *put; - struct dpif_flow_del *del; - struct dpif_execute *execute; - struct dpif_linux_flow flow; - - ofpbuf_use_stub(&aux->request, - aux->request_stub, sizeof aux->request_stub); - aux->txn.request = &aux->request; - - ofpbuf_use_stub(&aux->reply, aux->reply_stub, sizeof aux->reply_stub); - aux->txn.reply = NULL; - - switch (op->type) { - case DPIF_OP_FLOW_PUT: - put = &op->u.flow_put; - dpif_linux_init_flow_put(dpif, put, &flow); - if (put->stats) { - flow.nlmsg_flags |= NLM_F_ECHO; - aux->txn.reply = &aux->reply; - } - dpif_linux_flow_to_ofpbuf(&flow, &aux->request); - break; - - case DPIF_OP_FLOW_DEL: - del = &op->u.flow_del; - dpif_linux_init_flow_del(dpif, del, &flow); - if (del->stats) { - flow.nlmsg_flags |= NLM_F_ECHO; - aux->txn.reply = &aux->reply; - } - dpif_linux_flow_to_ofpbuf(&flow, &aux->request); - break; - - case DPIF_OP_EXECUTE: - execute = &op->u.execute; - dpif_linux_encode_execute(dpif->dp_ifindex, execute, - &aux->request); - break; - - default: - OVS_NOT_REACHED(); - } - } - - for (i = 0; i < n_ops; i++) { - txnsp[i] = &auxes[i].txn; - } - nl_transact_multiple(NETLINK_GENERIC, txnsp, n_ops); - - for (i = 0; i < n_ops; i++) { - struct op_auxdata *aux = &auxes[i]; - struct nl_transaction *txn = &auxes[i].txn; - struct dpif_op *op = ops[i]; - struct dpif_flow_put *put; - struct dpif_flow_del *del; - - op->error = txn->error; - - switch (op->type) { - case DPIF_OP_FLOW_PUT: - put = &op->u.flow_put; - if (put->stats) { - if (!op->error) { - struct dpif_linux_flow reply; - - op->error = dpif_linux_flow_from_ofpbuf(&reply, - txn->reply); - if (!op->error) { - dpif_linux_flow_get_stats(&reply, put->stats); - } - } - - if (op->error) { - memset(put->stats, 0, sizeof *put->stats); - } - } - break; - - case DPIF_OP_FLOW_DEL: - del = &op->u.flow_del; - if (del->stats) { - if (!op->error) { - struct dpif_linux_flow reply; - - op->error = dpif_linux_flow_from_ofpbuf(&reply, - txn->reply); - if (!op->error) { - dpif_linux_flow_get_stats(&reply, del->stats); - } - } - - if (op->error) { - memset(del->stats, 0, sizeof *del->stats); - } - } - break; - - case DPIF_OP_EXECUTE: - break; - - default: - OVS_NOT_REACHED(); - } - - ofpbuf_uninit(&aux->request); - ofpbuf_uninit(&aux->reply); - } -} - -static void -dpif_linux_operate(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - while (n_ops > 0) { - size_t chunk = MIN(n_ops, MAX_OPS); - dpif_linux_operate__(dpif, ops, chunk); - ops += chunk; - n_ops -= chunk; - } -} - -/* Synchronizes 'channels' in 'dpif->handlers' with the set of vports - * currently in 'dpif' in the kernel, by adding a new set of channels for - * any kernel vport that lacks one and deleting any channels that have no - * backing kernel vports. */ -static int -dpif_linux_refresh_channels(struct dpif_linux *dpif, uint32_t n_handlers) - OVS_REQ_WRLOCK(dpif->upcall_lock) -{ - unsigned long int *keep_channels; - struct dpif_linux_vport vport; - size_t keep_channels_nbits; - struct nl_dump dump; - uint64_t reply_stub[NL_DUMP_BUFSIZE / 8]; - struct ofpbuf buf; - int retval = 0; - size_t i; - - if (dpif->n_handlers != n_handlers) { - destroy_all_channels(dpif); - dpif->handlers = xzalloc(n_handlers * sizeof *dpif->handlers); - for (i = 0; i < n_handlers; i++) { - struct dpif_handler *handler = &dpif->handlers[i]; - - handler->epoll_fd = epoll_create(10); - if (handler->epoll_fd < 0) { - size_t j; - - for (j = 0; j < i; j++) { - close(dpif->handlers[j].epoll_fd); - } - free(dpif->handlers); - dpif->handlers = NULL; - - return errno; - } - } - dpif->n_handlers = n_handlers; - } - - for (i = 0; i < n_handlers; i++) { - struct dpif_handler *handler = &dpif->handlers[i]; - - handler->event_offset = handler->n_events = 0; - } - - keep_channels_nbits = dpif->uc_array_size; - keep_channels = bitmap_allocate(keep_channels_nbits); - - ofpbuf_use_stub(&buf, reply_stub, sizeof reply_stub); - dpif_linux_port_dump_start__(dpif, &dump); - while (!dpif_linux_port_dump_next__(dpif, &dump, &vport, &buf)) { - uint32_t port_no = odp_to_u32(vport.port_no); - uint32_t *upcall_pids = NULL; - int error; - - if (port_no >= dpif->uc_array_size - || !vport_get_pids(dpif, port_no, &upcall_pids)) { - struct nl_sock **socksp = vport_create_socksp(dpif->n_handlers, - &error); - - if (!socksp) { - goto error; - } - - error = vport_add_channels(dpif, vport.port_no, socksp); - if (error) { - VLOG_INFO("%s: could not add channels for port %s", - dpif_name(&dpif->dpif), vport.name); - vport_del_socksp(socksp, dpif->n_handlers); - retval = error; - goto error; - } - upcall_pids = vport_socksp_to_pids(socksp, dpif->n_handlers); - free(socksp); - } - - /* Configure the vport to deliver misses to 'sock'. */ - if (vport.upcall_pids[0] == 0 - || vport.n_upcall_pids != dpif->n_handlers - || memcmp(upcall_pids, vport.upcall_pids, n_handlers * sizeof - *upcall_pids)) { - struct dpif_linux_vport vport_request; - - dpif_linux_vport_init(&vport_request); - vport_request.cmd = OVS_VPORT_CMD_SET; - vport_request.dp_ifindex = dpif->dp_ifindex; - vport_request.port_no = vport.port_no; - vport_request.n_upcall_pids = dpif->n_handlers; - vport_request.upcall_pids = upcall_pids; - error = dpif_linux_vport_transact(&vport_request, NULL, NULL); - if (error) { - VLOG_WARN_RL(&error_rl, - "%s: failed to set upcall pid on port: %s", - dpif_name(&dpif->dpif), ovs_strerror(error)); - - if (error != ENODEV && error != ENOENT) { - retval = error; - } else { - /* The vport isn't really there, even though the dump says - * it is. Probably we just hit a race after a port - * disappeared. */ - } - goto error; - } - } - - if (port_no < keep_channels_nbits) { - bitmap_set1(keep_channels, port_no); - } - free(upcall_pids); - continue; - - error: - free(upcall_pids); - vport_del_channels(dpif, vport.port_no); - } - nl_dump_done(&dump); - ofpbuf_uninit(&buf); - - /* Discard any saved channels that we didn't reuse. */ - for (i = 0; i < keep_channels_nbits; i++) { - if (!bitmap_is_set(keep_channels, i)) { - vport_del_channels(dpif, u32_to_odp(i)); - } - } - free(keep_channels); - - return retval; -} - -static int -dpif_linux_recv_set__(struct dpif_linux *dpif, bool enable) - OVS_REQ_WRLOCK(dpif->upcall_lock) -{ - if ((dpif->handlers != NULL) == enable) { - return 0; - } else if (!enable) { - destroy_all_channels(dpif); - return 0; - } else { - return dpif_linux_refresh_channels(dpif, 1); - } -} - -static int -dpif_linux_recv_set(struct dpif *dpif_, bool enable) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - int error; - - fat_rwlock_wrlock(&dpif->upcall_lock); - error = dpif_linux_recv_set__(dpif, enable); - fat_rwlock_unlock(&dpif->upcall_lock); - - return error; -} - -static int -dpif_linux_handlers_set(struct dpif *dpif_, uint32_t n_handlers) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - int error = 0; - - fat_rwlock_wrlock(&dpif->upcall_lock); - if (dpif->handlers) { - error = dpif_linux_refresh_channels(dpif, n_handlers); - } - fat_rwlock_unlock(&dpif->upcall_lock); - - return error; -} - -static int -dpif_linux_queue_to_priority(const struct dpif *dpif OVS_UNUSED, - uint32_t queue_id, uint32_t *priority) -{ - if (queue_id < 0xf000) { - *priority = TC_H_MAKE(1 << 16, queue_id + 1); - return 0; - } else { - return EINVAL; - } -} - -static int -parse_odp_packet(struct ofpbuf *buf, struct dpif_upcall *upcall, - int *dp_ifindex) -{ - static const struct nl_policy ovs_packet_policy[] = { - /* Always present. */ - [OVS_PACKET_ATTR_PACKET] = { .type = NL_A_UNSPEC, - .min_len = ETH_HEADER_LEN }, - [OVS_PACKET_ATTR_KEY] = { .type = NL_A_NESTED }, - - /* OVS_PACKET_CMD_ACTION only. */ - [OVS_PACKET_ATTR_USERDATA] = { .type = NL_A_UNSPEC, .optional = true }, - }; - - struct ovs_header *ovs_header; - struct nlattr *a[ARRAY_SIZE(ovs_packet_policy)]; - struct nlmsghdr *nlmsg; - struct genlmsghdr *genl; - struct ofpbuf b; - int type; - - ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf)); - - nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); - genl = ofpbuf_try_pull(&b, sizeof *genl); - ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); - if (!nlmsg || !genl || !ovs_header - || nlmsg->nlmsg_type != ovs_packet_family - || !nl_policy_parse(&b, 0, ovs_packet_policy, a, - ARRAY_SIZE(ovs_packet_policy))) { - return EINVAL; - } - - type = (genl->cmd == OVS_PACKET_CMD_MISS ? DPIF_UC_MISS - : genl->cmd == OVS_PACKET_CMD_ACTION ? DPIF_UC_ACTION - : -1); - if (type < 0) { - return EINVAL; - } - - /* (Re)set ALL fields of '*upcall' on successful return. */ - upcall->type = type; - upcall->key = CONST_CAST(struct nlattr *, - nl_attr_get(a[OVS_PACKET_ATTR_KEY])); - upcall->key_len = nl_attr_get_size(a[OVS_PACKET_ATTR_KEY]); - upcall->userdata = a[OVS_PACKET_ATTR_USERDATA]; - - /* Allow overwriting the netlink attribute header without reallocating. */ - ofpbuf_use_stub(&upcall->packet, - CONST_CAST(struct nlattr *, - nl_attr_get(a[OVS_PACKET_ATTR_PACKET])) - 1, - nl_attr_get_size(a[OVS_PACKET_ATTR_PACKET]) + - sizeof(struct nlattr)); - ofpbuf_set_data(&upcall->packet, - (char *)ofpbuf_data(&upcall->packet) + sizeof(struct nlattr)); - ofpbuf_set_size(&upcall->packet, nl_attr_get_size(a[OVS_PACKET_ATTR_PACKET])); - - *dp_ifindex = ovs_header->dp_ifindex; - - return 0; -} - -static int -dpif_linux_recv__(struct dpif_linux *dpif, uint32_t handler_id, - struct dpif_upcall *upcall, struct ofpbuf *buf) - OVS_REQ_RDLOCK(dpif->upcall_lock) -{ - struct dpif_handler *handler; - int read_tries = 0; - - if (!dpif->handlers || handler_id >= dpif->n_handlers) { - return EAGAIN; - } - - handler = &dpif->handlers[handler_id]; - if (handler->event_offset >= handler->n_events) { - int retval; - - handler->event_offset = handler->n_events = 0; - - do { - retval = epoll_wait(handler->epoll_fd, handler->epoll_events, - dpif->uc_array_size, 0); - } while (retval < 0 && errno == EINTR); - if (retval < 0) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); - VLOG_WARN_RL(&rl, "epoll_wait failed (%s)", ovs_strerror(errno)); - } else if (retval > 0) { - handler->n_events = retval; - } - } - - while (handler->event_offset < handler->n_events) { - int idx = handler->epoll_events[handler->event_offset].data.u32; - struct dpif_channel *ch = &dpif->handlers[handler_id].channels[idx]; - - handler->event_offset++; - - for (;;) { - int dp_ifindex; - int error; - - if (++read_tries > 50) { - return EAGAIN; - } - - error = nl_sock_recv(ch->sock, buf, false); - if (error == ENOBUFS) { - /* ENOBUFS typically means that we've received so many - * packets that the buffer overflowed. Try again - * immediately because there's almost certainly a packet - * waiting for us. */ - report_loss(dpif, ch, idx, handler_id); - continue; - } - - ch->last_poll = time_msec(); - if (error) { - if (error == EAGAIN) { - break; - } - return error; - } - - error = parse_odp_packet(buf, upcall, &dp_ifindex); - if (!error && dp_ifindex == dpif->dp_ifindex) { - return 0; - } else if (error) { - return error; - } - } - } - - return EAGAIN; -} - -static int -dpif_linux_recv(struct dpif *dpif_, uint32_t handler_id, - struct dpif_upcall *upcall, struct ofpbuf *buf) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - int error; - - fat_rwlock_rdlock(&dpif->upcall_lock); - error = dpif_linux_recv__(dpif, handler_id, upcall, buf); - fat_rwlock_unlock(&dpif->upcall_lock); - - return error; -} - -static void -dpif_linux_recv_wait__(struct dpif_linux *dpif, uint32_t handler_id) - OVS_REQ_RDLOCK(dpif->upcall_lock) -{ - if (dpif->handlers && handler_id < dpif->n_handlers) { - struct dpif_handler *handler = &dpif->handlers[handler_id]; - - poll_fd_wait(handler->epoll_fd, POLLIN); - } -} - -static void -dpif_linux_recv_wait(struct dpif *dpif_, uint32_t handler_id) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - fat_rwlock_rdlock(&dpif->upcall_lock); - dpif_linux_recv_wait__(dpif, handler_id); - fat_rwlock_unlock(&dpif->upcall_lock); -} - -static void -dpif_linux_recv_purge__(struct dpif_linux *dpif) - OVS_REQ_WRLOCK(dpif->upcall_lock) -{ - if (dpif->handlers) { - size_t i, j; - - for (i = 0; i < dpif->uc_array_size; i++ ) { - if (!dpif->handlers[0].channels[i].sock) { - continue; - } - - for (j = 0; j < dpif->n_handlers; j++) { - nl_sock_drain(dpif->handlers[j].channels[i].sock); - } - } - } -} - -static void -dpif_linux_recv_purge(struct dpif *dpif_) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - - fat_rwlock_wrlock(&dpif->upcall_lock); - dpif_linux_recv_purge__(dpif); - fat_rwlock_unlock(&dpif->upcall_lock); -} - -const struct dpif_class dpif_linux_class = { - "system", - dpif_linux_enumerate, - NULL, - dpif_linux_open, - dpif_linux_close, - dpif_linux_destroy, - dpif_linux_run, - NULL, /* wait */ - dpif_linux_get_stats, - dpif_linux_port_add, - dpif_linux_port_del, - dpif_linux_port_query_by_number, - dpif_linux_port_query_by_name, - dpif_linux_port_get_pid, - dpif_linux_port_dump_start, - dpif_linux_port_dump_next, - dpif_linux_port_dump_done, - dpif_linux_port_poll, - dpif_linux_port_poll_wait, - dpif_linux_flow_get, - dpif_linux_flow_put, - dpif_linux_flow_del, - dpif_linux_flow_flush, - dpif_linux_flow_dump_state_init, - dpif_linux_flow_dump_start, - dpif_linux_flow_dump_next, - dpif_linux_flow_dump_next_may_destroy_keys, - dpif_linux_flow_dump_done, - dpif_linux_flow_dump_state_uninit, - dpif_linux_execute, - dpif_linux_operate, - dpif_linux_recv_set, - dpif_linux_handlers_set, - dpif_linux_queue_to_priority, - dpif_linux_recv, - dpif_linux_recv_wait, - dpif_linux_recv_purge, -}; - -static int -dpif_linux_init(void) -{ - static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; - static int error; - - if (ovsthread_once_start(&once)) { - error = nl_lookup_genl_family(OVS_DATAPATH_FAMILY, - &ovs_datapath_family); - if (error) { - VLOG_ERR("Generic Netlink family '%s' does not exist. " - "The Open vSwitch kernel module is probably not loaded.", - OVS_DATAPATH_FAMILY); - } - if (!error) { - error = nl_lookup_genl_family(OVS_VPORT_FAMILY, &ovs_vport_family); - } - if (!error) { - error = nl_lookup_genl_family(OVS_FLOW_FAMILY, &ovs_flow_family); - } - if (!error) { - error = nl_lookup_genl_family(OVS_PACKET_FAMILY, - &ovs_packet_family); - } - if (!error) { - error = nl_lookup_genl_mcgroup(OVS_VPORT_FAMILY, OVS_VPORT_MCGROUP, - &ovs_vport_mcgroup); - } - - ovsthread_once_done(&once); - } - - return error; -} - -bool -dpif_linux_is_internal_device(const char *name) -{ - struct dpif_linux_vport reply; - struct ofpbuf *buf; - int error; - - error = dpif_linux_vport_get(name, &reply, &buf); - if (!error) { - ofpbuf_delete(buf); - } else if (error != ENODEV && error != ENOENT) { - VLOG_WARN_RL(&error_rl, "%s: vport query failed (%s)", - name, ovs_strerror(error)); - } - - return reply.type == OVS_VPORT_TYPE_INTERNAL; -} - -/* Parses the contents of 'buf', which contains a "struct ovs_header" followed - * by Netlink attributes, into 'vport'. Returns 0 if successful, otherwise a - * positive errno value. - * - * 'vport' will contain pointers into 'buf', so the caller should not free - * 'buf' while 'vport' is still in use. */ -static int -dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport *vport, - const struct ofpbuf *buf) -{ - static const struct nl_policy ovs_vport_policy[] = { - [OVS_VPORT_ATTR_PORT_NO] = { .type = NL_A_U32 }, - [OVS_VPORT_ATTR_TYPE] = { .type = NL_A_U32 }, - [OVS_VPORT_ATTR_NAME] = { .type = NL_A_STRING, .max_len = IFNAMSIZ }, - [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NL_A_UNSPEC }, - [OVS_VPORT_ATTR_STATS] = { NL_POLICY_FOR(struct ovs_vport_stats), - .optional = true }, - [OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = true }, - }; - - struct nlattr *a[ARRAY_SIZE(ovs_vport_policy)]; - struct ovs_header *ovs_header; - struct nlmsghdr *nlmsg; - struct genlmsghdr *genl; - struct ofpbuf b; - - dpif_linux_vport_init(vport); - - ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf)); - nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); - genl = ofpbuf_try_pull(&b, sizeof *genl); - ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); - if (!nlmsg || !genl || !ovs_header - || nlmsg->nlmsg_type != ovs_vport_family - || !nl_policy_parse(&b, 0, ovs_vport_policy, a, - ARRAY_SIZE(ovs_vport_policy))) { - return EINVAL; - } - - vport->cmd = genl->cmd; - vport->dp_ifindex = ovs_header->dp_ifindex; - vport->port_no = nl_attr_get_odp_port(a[OVS_VPORT_ATTR_PORT_NO]); - vport->type = nl_attr_get_u32(a[OVS_VPORT_ATTR_TYPE]); - vport->name = nl_attr_get_string(a[OVS_VPORT_ATTR_NAME]); - if (a[OVS_VPORT_ATTR_UPCALL_PID]) { - vport->n_upcall_pids = nl_attr_get_size(a[OVS_VPORT_ATTR_UPCALL_PID]) - / (sizeof *vport->upcall_pids); - vport->upcall_pids = nl_attr_get(a[OVS_VPORT_ATTR_UPCALL_PID]); - - } - if (a[OVS_VPORT_ATTR_STATS]) { - vport->stats = nl_attr_get(a[OVS_VPORT_ATTR_STATS]); - } - if (a[OVS_VPORT_ATTR_OPTIONS]) { - vport->options = nl_attr_get(a[OVS_VPORT_ATTR_OPTIONS]); - vport->options_len = nl_attr_get_size(a[OVS_VPORT_ATTR_OPTIONS]); - } - return 0; -} - -/* Appends to 'buf' (which must initially be empty) a "struct ovs_header" - * followed by Netlink attributes corresponding to 'vport'. */ -static void -dpif_linux_vport_to_ofpbuf(const struct dpif_linux_vport *vport, - struct ofpbuf *buf) -{ - struct ovs_header *ovs_header; - - nl_msg_put_genlmsghdr(buf, 0, ovs_vport_family, NLM_F_REQUEST | NLM_F_ECHO, - vport->cmd, OVS_VPORT_VERSION); - - ovs_header = ofpbuf_put_uninit(buf, sizeof *ovs_header); - ovs_header->dp_ifindex = vport->dp_ifindex; - - if (vport->port_no != ODPP_NONE) { - nl_msg_put_odp_port(buf, OVS_VPORT_ATTR_PORT_NO, vport->port_no); - } - - if (vport->type != OVS_VPORT_TYPE_UNSPEC) { - nl_msg_put_u32(buf, OVS_VPORT_ATTR_TYPE, vport->type); - } - - if (vport->name) { - nl_msg_put_string(buf, OVS_VPORT_ATTR_NAME, vport->name); - } - - if (vport->upcall_pids) { - nl_msg_put_unspec(buf, OVS_VPORT_ATTR_UPCALL_PID, - vport->upcall_pids, - vport->n_upcall_pids * sizeof *vport->upcall_pids); - } - - if (vport->stats) { - nl_msg_put_unspec(buf, OVS_VPORT_ATTR_STATS, - vport->stats, sizeof *vport->stats); - } - - if (vport->options) { - nl_msg_put_nested(buf, OVS_VPORT_ATTR_OPTIONS, - vport->options, vport->options_len); - } -} - -/* Clears 'vport' to "empty" values. */ -void -dpif_linux_vport_init(struct dpif_linux_vport *vport) -{ - memset(vport, 0, sizeof *vport); - vport->port_no = ODPP_NONE; -} - -/* Executes 'request' in the kernel datapath. If the command fails, returns a - * positive errno value. Otherwise, if 'reply' and 'bufp' are null, returns 0 - * without doing anything else. If 'reply' and 'bufp' are nonnull, then the - * result of the command is expected to be an ovs_vport also, which is decoded - * and stored in '*reply' and '*bufp'. The caller must free '*bufp' when the - * reply is no longer needed ('reply' will contain pointers into '*bufp'). */ -int -dpif_linux_vport_transact(const struct dpif_linux_vport *request, - struct dpif_linux_vport *reply, - struct ofpbuf **bufp) -{ - struct ofpbuf *request_buf; - int error; - - ovs_assert((reply != NULL) == (bufp != NULL)); - - error = dpif_linux_init(); - if (error) { - if (reply) { - *bufp = NULL; - dpif_linux_vport_init(reply); - } - return error; - } - - request_buf = ofpbuf_new(1024); - dpif_linux_vport_to_ofpbuf(request, request_buf); - error = nl_transact(NETLINK_GENERIC, request_buf, bufp); - ofpbuf_delete(request_buf); - - if (reply) { - if (!error) { - error = dpif_linux_vport_from_ofpbuf(reply, *bufp); - } - if (error) { - dpif_linux_vport_init(reply); - ofpbuf_delete(*bufp); - *bufp = NULL; - } - } - return error; -} - -/* Obtains information about the kernel vport named 'name' and stores it into - * '*reply' and '*bufp'. The caller must free '*bufp' when the reply is no - * longer needed ('reply' will contain pointers into '*bufp'). */ -int -dpif_linux_vport_get(const char *name, struct dpif_linux_vport *reply, - struct ofpbuf **bufp) -{ - struct dpif_linux_vport request; - - dpif_linux_vport_init(&request); - request.cmd = OVS_VPORT_CMD_GET; - request.name = name; - - return dpif_linux_vport_transact(&request, reply, bufp); -} - -/* Parses the contents of 'buf', which contains a "struct ovs_header" followed - * by Netlink attributes, into 'dp'. Returns 0 if successful, otherwise a - * positive errno value. - * - * 'dp' will contain pointers into 'buf', so the caller should not free 'buf' - * while 'dp' is still in use. */ -static int -dpif_linux_dp_from_ofpbuf(struct dpif_linux_dp *dp, const struct ofpbuf *buf) -{ - static const struct nl_policy ovs_datapath_policy[] = { - [OVS_DP_ATTR_NAME] = { .type = NL_A_STRING, .max_len = IFNAMSIZ }, - [OVS_DP_ATTR_STATS] = { NL_POLICY_FOR(struct ovs_dp_stats), - .optional = true }, - [OVS_DP_ATTR_MEGAFLOW_STATS] = { - NL_POLICY_FOR(struct ovs_dp_megaflow_stats), - .optional = true }, - }; - - struct nlattr *a[ARRAY_SIZE(ovs_datapath_policy)]; - struct ovs_header *ovs_header; - struct nlmsghdr *nlmsg; - struct genlmsghdr *genl; - struct ofpbuf b; - - dpif_linux_dp_init(dp); - - ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf)); - nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); - genl = ofpbuf_try_pull(&b, sizeof *genl); - ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); - if (!nlmsg || !genl || !ovs_header - || nlmsg->nlmsg_type != ovs_datapath_family - || !nl_policy_parse(&b, 0, ovs_datapath_policy, a, - ARRAY_SIZE(ovs_datapath_policy))) { - return EINVAL; - } - - dp->cmd = genl->cmd; - dp->dp_ifindex = ovs_header->dp_ifindex; - dp->name = nl_attr_get_string(a[OVS_DP_ATTR_NAME]); - if (a[OVS_DP_ATTR_STATS]) { - /* Can't use structure assignment because Netlink doesn't ensure - * sufficient alignment for 64-bit members. */ - memcpy(&dp->stats, nl_attr_get(a[OVS_DP_ATTR_STATS]), - sizeof dp->stats); - } - - if (a[OVS_DP_ATTR_MEGAFLOW_STATS]) { - /* Can't use structure assignment because Netlink doesn't ensure - * sufficient alignment for 64-bit members. */ - memcpy(&dp->megaflow_stats, nl_attr_get(a[OVS_DP_ATTR_MEGAFLOW_STATS]), - sizeof dp->megaflow_stats); - } - - return 0; -} - -/* Appends to 'buf' the Generic Netlink message described by 'dp'. */ -static void -dpif_linux_dp_to_ofpbuf(const struct dpif_linux_dp *dp, struct ofpbuf *buf) -{ - struct ovs_header *ovs_header; - - nl_msg_put_genlmsghdr(buf, 0, ovs_datapath_family, - NLM_F_REQUEST | NLM_F_ECHO, dp->cmd, - OVS_DATAPATH_VERSION); - - ovs_header = ofpbuf_put_uninit(buf, sizeof *ovs_header); - ovs_header->dp_ifindex = dp->dp_ifindex; - - if (dp->name) { - nl_msg_put_string(buf, OVS_DP_ATTR_NAME, dp->name); - } - - if (dp->upcall_pid) { - nl_msg_put_u32(buf, OVS_DP_ATTR_UPCALL_PID, *dp->upcall_pid); - } - - if (dp->user_features) { - nl_msg_put_u32(buf, OVS_DP_ATTR_USER_FEATURES, dp->user_features); - } - - /* Skip OVS_DP_ATTR_STATS since we never have a reason to serialize it. */ -} - -/* Clears 'dp' to "empty" values. */ -static void -dpif_linux_dp_init(struct dpif_linux_dp *dp) -{ - memset(dp, 0, sizeof *dp); - dp->megaflow_stats.n_masks = UINT32_MAX; - dp->megaflow_stats.n_mask_hit = UINT64_MAX; -} - -static void -dpif_linux_dp_dump_start(struct nl_dump *dump) -{ - struct dpif_linux_dp request; - struct ofpbuf *buf; - - dpif_linux_dp_init(&request); - request.cmd = OVS_DP_CMD_GET; - - buf = ofpbuf_new(1024); - dpif_linux_dp_to_ofpbuf(&request, buf); - nl_dump_start(dump, NETLINK_GENERIC, buf); - ofpbuf_delete(buf); -} - -/* Executes 'request' in the kernel datapath. If the command fails, returns a - * positive errno value. Otherwise, if 'reply' and 'bufp' are null, returns 0 - * without doing anything else. If 'reply' and 'bufp' are nonnull, then the - * result of the command is expected to be of the same form, which is decoded - * and stored in '*reply' and '*bufp'. The caller must free '*bufp' when the - * reply is no longer needed ('reply' will contain pointers into '*bufp'). */ -static int -dpif_linux_dp_transact(const struct dpif_linux_dp *request, - struct dpif_linux_dp *reply, struct ofpbuf **bufp) -{ - struct ofpbuf *request_buf; - int error; - - ovs_assert((reply != NULL) == (bufp != NULL)); - - request_buf = ofpbuf_new(1024); - dpif_linux_dp_to_ofpbuf(request, request_buf); - error = nl_transact(NETLINK_GENERIC, request_buf, bufp); - ofpbuf_delete(request_buf); - - if (reply) { - dpif_linux_dp_init(reply); - if (!error) { - error = dpif_linux_dp_from_ofpbuf(reply, *bufp); - } - if (error) { - ofpbuf_delete(*bufp); - *bufp = NULL; - } - } - return error; -} - -/* Obtains information about 'dpif_' and stores it into '*reply' and '*bufp'. - * The caller must free '*bufp' when the reply is no longer needed ('reply' - * will contain pointers into '*bufp'). */ -static int -dpif_linux_dp_get(const struct dpif *dpif_, struct dpif_linux_dp *reply, - struct ofpbuf **bufp) -{ - struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct dpif_linux_dp request; - - dpif_linux_dp_init(&request); - request.cmd = OVS_DP_CMD_GET; - request.dp_ifindex = dpif->dp_ifindex; - - return dpif_linux_dp_transact(&request, reply, bufp); -} - -/* Parses the contents of 'buf', which contains a "struct ovs_header" followed - * by Netlink attributes, into 'flow'. Returns 0 if successful, otherwise a - * positive errno value. - * - * 'flow' will contain pointers into 'buf', so the caller should not free 'buf' - * while 'flow' is still in use. */ -static int -dpif_linux_flow_from_ofpbuf(struct dpif_linux_flow *flow, - const struct ofpbuf *buf) -{ - static const struct nl_policy ovs_flow_policy[] = { - [OVS_FLOW_ATTR_KEY] = { .type = NL_A_NESTED }, - [OVS_FLOW_ATTR_MASK] = { .type = NL_A_NESTED, .optional = true }, - [OVS_FLOW_ATTR_ACTIONS] = { .type = NL_A_NESTED, .optional = true }, - [OVS_FLOW_ATTR_STATS] = { NL_POLICY_FOR(struct ovs_flow_stats), - .optional = true }, - [OVS_FLOW_ATTR_TCP_FLAGS] = { .type = NL_A_U8, .optional = true }, - [OVS_FLOW_ATTR_USED] = { .type = NL_A_U64, .optional = true }, - /* The kernel never uses OVS_FLOW_ATTR_CLEAR. */ - }; - - struct nlattr *a[ARRAY_SIZE(ovs_flow_policy)]; - struct ovs_header *ovs_header; - struct nlmsghdr *nlmsg; - struct genlmsghdr *genl; - struct ofpbuf b; - - dpif_linux_flow_init(flow); - - ofpbuf_use_const(&b, ofpbuf_data(buf), ofpbuf_size(buf)); - nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); - genl = ofpbuf_try_pull(&b, sizeof *genl); - ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); - if (!nlmsg || !genl || !ovs_header - || nlmsg->nlmsg_type != ovs_flow_family - || !nl_policy_parse(&b, 0, ovs_flow_policy, a, - ARRAY_SIZE(ovs_flow_policy))) { - return EINVAL; - } - - flow->nlmsg_flags = nlmsg->nlmsg_flags; - flow->dp_ifindex = ovs_header->dp_ifindex; - flow->key = nl_attr_get(a[OVS_FLOW_ATTR_KEY]); - flow->key_len = nl_attr_get_size(a[OVS_FLOW_ATTR_KEY]); - - if (a[OVS_FLOW_ATTR_MASK]) { - flow->mask = nl_attr_get(a[OVS_FLOW_ATTR_MASK]); - flow->mask_len = nl_attr_get_size(a[OVS_FLOW_ATTR_MASK]); - } - if (a[OVS_FLOW_ATTR_ACTIONS]) { - flow->actions = nl_attr_get(a[OVS_FLOW_ATTR_ACTIONS]); - flow->actions_len = nl_attr_get_size(a[OVS_FLOW_ATTR_ACTIONS]); - } - if (a[OVS_FLOW_ATTR_STATS]) { - flow->stats = nl_attr_get(a[OVS_FLOW_ATTR_STATS]); - } - if (a[OVS_FLOW_ATTR_TCP_FLAGS]) { - flow->tcp_flags = nl_attr_get(a[OVS_FLOW_ATTR_TCP_FLAGS]); - } - if (a[OVS_FLOW_ATTR_USED]) { - flow->used = nl_attr_get(a[OVS_FLOW_ATTR_USED]); - } - return 0; -} - -/* Appends to 'buf' (which must initially be empty) a "struct ovs_header" - * followed by Netlink attributes corresponding to 'flow'. */ -static void -dpif_linux_flow_to_ofpbuf(const struct dpif_linux_flow *flow, - struct ofpbuf *buf) -{ - struct ovs_header *ovs_header; - - nl_msg_put_genlmsghdr(buf, 0, ovs_flow_family, - NLM_F_REQUEST | flow->nlmsg_flags, - flow->cmd, OVS_FLOW_VERSION); - - ovs_header = ofpbuf_put_uninit(buf, sizeof *ovs_header); - ovs_header->dp_ifindex = flow->dp_ifindex; - - if (flow->key_len) { - nl_msg_put_unspec(buf, OVS_FLOW_ATTR_KEY, flow->key, flow->key_len); - } - - if (flow->mask_len) { - nl_msg_put_unspec(buf, OVS_FLOW_ATTR_MASK, flow->mask, flow->mask_len); - } - - if (flow->actions || flow->actions_len) { - nl_msg_put_unspec(buf, OVS_FLOW_ATTR_ACTIONS, - flow->actions, flow->actions_len); - } - - /* We never need to send these to the kernel. */ - ovs_assert(!flow->stats); - ovs_assert(!flow->tcp_flags); - ovs_assert(!flow->used); - - if (flow->clear) { - nl_msg_put_flag(buf, OVS_FLOW_ATTR_CLEAR); - } -} - -/* Clears 'flow' to "empty" values. */ -static void -dpif_linux_flow_init(struct dpif_linux_flow *flow) -{ - memset(flow, 0, sizeof *flow); -} - -/* Executes 'request' in the kernel datapath. If the command fails, returns a - * positive errno value. Otherwise, if 'reply' and 'bufp' are null, returns 0 - * without doing anything else. If 'reply' and 'bufp' are nonnull, then the - * result of the command is expected to be a flow also, which is decoded and - * stored in '*reply' and '*bufp'. The caller must free '*bufp' when the reply - * is no longer needed ('reply' will contain pointers into '*bufp'). */ -static int -dpif_linux_flow_transact(struct dpif_linux_flow *request, - struct dpif_linux_flow *reply, struct ofpbuf **bufp) -{ - struct ofpbuf *request_buf; - int error; - - ovs_assert((reply != NULL) == (bufp != NULL)); - - if (reply) { - request->nlmsg_flags |= NLM_F_ECHO; - } - - request_buf = ofpbuf_new(1024); - dpif_linux_flow_to_ofpbuf(request, request_buf); - error = nl_transact(NETLINK_GENERIC, request_buf, bufp); - ofpbuf_delete(request_buf); - - if (reply) { - if (!error) { - error = dpif_linux_flow_from_ofpbuf(reply, *bufp); - } - if (error) { - dpif_linux_flow_init(reply); - ofpbuf_delete(*bufp); - *bufp = NULL; - } - } - return error; -} - -static void -dpif_linux_flow_get_stats(const struct dpif_linux_flow *flow, - struct dpif_flow_stats *stats) -{ - if (flow->stats) { - stats->n_packets = get_unaligned_u64(&flow->stats->n_packets); - stats->n_bytes = get_unaligned_u64(&flow->stats->n_bytes); - } else { - stats->n_packets = 0; - stats->n_bytes = 0; - } - stats->used = flow->used ? get_32aligned_u64(flow->used) : 0; - stats->tcp_flags = flow->tcp_flags ? *flow->tcp_flags : 0; -} - -/* Logs information about a packet that was recently lost in 'ch' (in - * 'dpif_'). */ -static void -report_loss(struct dpif_linux *dpif, struct dpif_channel *ch, uint32_t ch_idx, - uint32_t handler_id) -{ - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5); - struct ds s; - - if (VLOG_DROP_WARN(&rl)) { - return; - } - - ds_init(&s); - if (ch->last_poll != LLONG_MIN) { - ds_put_format(&s, " (last polled %lld ms ago)", - time_msec() - ch->last_poll); - } - - VLOG_WARN("%s: lost packet on port channel %u of handler %u", - dpif_name(&dpif->dpif), ch_idx, handler_id); - ds_destroy(&s); -} diff -Nru openvswitch-2.3.1/lib/dpif-linux.h openvswitch-2.4.0~git20150623/lib/dpif-linux.h --- openvswitch-2.3.1/lib/dpif-linux.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif-linux.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2010, 2011 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef DPIF_LINUX_H -#define DPIF_LINUX_H 1 - -#include -#include -#include -#include - -#include "flow.h" - -struct ofpbuf; - -struct dpif_linux_vport { - /* Generic Netlink header. */ - uint8_t cmd; - - /* ovs_vport header. */ - int dp_ifindex; - odp_port_t port_no; /* ODPP_NONE if unknown. */ - enum ovs_vport_type type; - - /* Attributes. - * - * The 'stats' member points to 64-bit data that might only be aligned on - * 32-bit boundaries, so use get_unaligned_u64() to access its values. - */ - const char *name; /* OVS_VPORT_ATTR_NAME. */ - uint32_t n_upcall_pids; - const uint32_t *upcall_pids; /* OVS_VPORT_ATTR_UPCALL_PID. */ - const struct ovs_vport_stats *stats; /* OVS_VPORT_ATTR_STATS. */ - const struct nlattr *options; /* OVS_VPORT_ATTR_OPTIONS. */ - size_t options_len; -}; - -void dpif_linux_vport_init(struct dpif_linux_vport *); - -int dpif_linux_vport_transact(const struct dpif_linux_vport *request, - struct dpif_linux_vport *reply, - struct ofpbuf **bufp); -int dpif_linux_vport_get(const char *name, struct dpif_linux_vport *reply, - struct ofpbuf **bufp); - -bool dpif_linux_is_internal_device(const char *name); - -#endif /* dpif-linux.h */ diff -Nru openvswitch-2.3.1/lib/dpif-netdev.c openvswitch-2.4.0~git20150623/lib/dpif-netdev.c --- openvswitch-2.3.1/lib/dpif-netdev.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif-netdev.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,7 +15,7 @@ */ #include -#include "dpif.h" +#include "dpif-netdev.h" #include #include @@ -31,16 +31,19 @@ #include #include -#include "classifier.h" +#include "cmap.h" #include "csum.h" +#include "dp-packet.h" #include "dpif.h" #include "dpif-provider.h" #include "dummy.h" #include "dynamic-string.h" +#include "fat-rwlock.h" #include "flow.h" -#include "hmap.h" +#include "cmap.h" #include "latch.h" #include "list.h" +#include "match.h" #include "meta-flow.h" #include "netdev.h" #include "netdev-dpdk.h" @@ -50,24 +53,24 @@ #include "odp-util.h" #include "ofp-print.h" #include "ofpbuf.h" +#include "ovs-numa.h" #include "ovs-rcu.h" #include "packets.h" #include "poll-loop.h" +#include "pvector.h" #include "random.h" #include "seq.h" #include "shash.h" #include "sset.h" #include "timeval.h" +#include "tnl-arp-cache.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(dpif_netdev); -/* By default, choose a priority in the middle. */ -#define NETDEV_RULE_PRIORITY 0x8000 - -#define NR_THREADS 1 +#define FLOW_DUMP_MAX_BATCH 50 /* Use per thread recirc_depth to prevent recirculation loop. */ #define MAX_RECIRC_DEPTH 5 DEFINE_STATIC_PER_THREAD_DATA(uint32_t, recirc_depth, 0) @@ -75,11 +78,6 @@ /* Configuration parameters. */ enum { MAX_FLOWS = 65536 }; /* Maximum number of flows in flow table. */ -/* Queues. */ -enum { MAX_QUEUE_LEN = 128 }; /* Maximum number of packets per queue. */ -enum { QUEUE_MASK = MAX_QUEUE_LEN - 1 }; -BUILD_ASSERT_DECL(IS_POW2(MAX_QUEUE_LEN)); - /* Protects against changes to 'dp_netdevs'. */ static struct ovs_mutex dp_netdev_mutex = OVS_MUTEX_INITIALIZER; @@ -87,27 +85,85 @@ static struct shash dp_netdevs OVS_GUARDED_BY(dp_netdev_mutex) = SHASH_INITIALIZER(&dp_netdevs); -struct dp_netdev_upcall { - struct dpif_upcall upcall; /* Queued upcall information. */ - struct ofpbuf buf; /* ofpbuf instance for upcall.packet. */ +static struct vlog_rate_limit upcall_rl = VLOG_RATE_LIMIT_INIT(600, 600); + +/* Stores a miniflow with inline values */ + +struct netdev_flow_key { + uint32_t hash; /* Hash function differs for different users. */ + uint32_t len; /* Length of the following miniflow (incl. map). */ + struct miniflow mf; + uint64_t buf[FLOW_MAX_PACKET_U64S - MINI_N_INLINE]; }; -/* A queue passing packets from a struct dp_netdev to its clients (handlers). +/* Exact match cache for frequently used flows + * + * The cache uses a 32-bit hash of the packet (which can be the RSS hash) to + * search its entries for a miniflow that matches exactly the miniflow of the + * packet. It stores the 'dpcls_rule' (rule) that matches the miniflow. + * + * A cache entry holds a reference to its 'dp_netdev_flow'. + * + * A miniflow with a given hash can be in one of EM_FLOW_HASH_SEGS different + * entries. The 32-bit hash is split into EM_FLOW_HASH_SEGS values (each of + * them is EM_FLOW_HASH_SHIFT bits wide and the remainder is thrown away). Each + * value is the index of a cache entry where the miniflow could be. * * * Thread-safety * ============= * - * Any access at all requires the owning 'dp_netdev''s queue_rwlock and - * its own mutex. */ -struct dp_netdev_queue { - struct ovs_mutex mutex; - struct seq *seq; /* Incremented whenever a packet is queued. */ - struct dp_netdev_upcall upcalls[MAX_QUEUE_LEN] OVS_GUARDED; - unsigned int head OVS_GUARDED; - unsigned int tail OVS_GUARDED; + * Each pmd_thread has its own private exact match cache. + * If dp_netdev_input is not called from a pmd thread, a mutex is used. + */ + +#define EM_FLOW_HASH_SHIFT 13 +#define EM_FLOW_HASH_ENTRIES (1u << EM_FLOW_HASH_SHIFT) +#define EM_FLOW_HASH_MASK (EM_FLOW_HASH_ENTRIES - 1) +#define EM_FLOW_HASH_SEGS 2 + +struct emc_entry { + struct dp_netdev_flow *flow; + struct netdev_flow_key key; /* key.hash used for emc hash value. */ +}; + +struct emc_cache { + struct emc_entry entries[EM_FLOW_HASH_ENTRIES]; + int sweep_idx; /* For emc_cache_slow_sweep(). */ +}; + +/* Iterate in the exact match cache through every entry that might contain a + * miniflow with hash 'HASH'. */ +#define EMC_FOR_EACH_POS_WITH_HASH(EMC, CURRENT_ENTRY, HASH) \ + for (uint32_t i__ = 0, srch_hash__ = (HASH); \ + (CURRENT_ENTRY) = &(EMC)->entries[srch_hash__ & EM_FLOW_HASH_MASK], \ + i__ < EM_FLOW_HASH_SEGS; \ + i__++, srch_hash__ >>= EM_FLOW_HASH_SHIFT) + +/* Simple non-wildcarding single-priority classifier. */ + +struct dpcls { + struct cmap subtables_map; + struct pvector subtables; +}; + +/* A rule to be inserted to the classifier. */ +struct dpcls_rule { + struct cmap_node cmap_node; /* Within struct dpcls_subtable 'rules'. */ + struct netdev_flow_key *mask; /* Subtable's mask. */ + struct netdev_flow_key flow; /* Matching key. */ + /* 'flow' must be the last field, additional space is allocated here. */ }; +static void dpcls_init(struct dpcls *); +static void dpcls_destroy(struct dpcls *); +static void dpcls_insert(struct dpcls *, struct dpcls_rule *, + const struct netdev_flow_key *mask); +static void dpcls_remove(struct dpcls *, struct dpcls_rule *); +static bool dpcls_lookup(const struct dpcls *cls, + const struct netdev_flow_key keys[], + struct dpcls_rule **rules, size_t cnt); + /* Datapath based on the network device interface from netdev.h. * * @@ -120,97 +176,90 @@ * Acquisition order is, from outermost to innermost: * * dp_netdev_mutex (global) - * port_rwlock - * flow_mutex - * cls.rwlock - * queue_rwlock + * port_mutex */ struct dp_netdev { const struct dpif_class *const class; const char *const name; + struct dpif *dpif; struct ovs_refcount ref_cnt; atomic_flag destroyed; - /* Flows. - * - * Readers of 'cls' and 'flow_table' must take a 'cls->rwlock' read lock. - * - * Writers of 'cls' and 'flow_table' must take the 'flow_mutex' and then - * the 'cls->rwlock' write lock. (The outer 'flow_mutex' allows writers to - * atomically perform multiple operations on 'cls' and 'flow_table'.) - */ - struct ovs_mutex flow_mutex; - struct classifier cls; /* Classifier. Protected by cls.rwlock. */ - struct hmap flow_table OVS_GUARDED; /* Flow table. */ - - /* Queues. - * - * 'queue_rwlock' protects the modification of 'handler_queues' and - * 'n_handlers'. The queue elements are protected by its - * 'handler_queues''s mutex. */ - struct fat_rwlock queue_rwlock; - struct dp_netdev_queue *handler_queues; - uint32_t n_handlers; - - /* Statistics. - * - * ovsthread_stats is internally synchronized. */ - struct ovsthread_stats stats; /* Contains 'struct dp_netdev_stats *'. */ - /* Ports. * - * Any lookup into 'ports' or any access to the dp_netdev_ports found - * through 'ports' requires taking 'port_rwlock'. */ - struct ovs_rwlock port_rwlock; - struct hmap ports OVS_GUARDED; + * Protected by RCU. Take the mutex to add or remove ports. */ + struct ovs_mutex port_mutex; + struct cmap ports; struct seq *port_seq; /* Incremented whenever a port changes. */ - /* Forwarding threads. */ - struct latch exit_latch; - struct pmd_thread *pmd_threads; - size_t n_pmd_threads; - int pmd_count; + /* Protects access to ofproto-dpif-upcall interface during revalidator + * thread synchronization. */ + struct fat_rwlock upcall_rwlock; + upcall_callback *upcall_cb; /* Callback function for executing upcalls. */ + void *upcall_aux; + + /* Stores all 'struct dp_netdev_pmd_thread's. */ + struct cmap poll_threads; + + /* Protects the access of the 'struct dp_netdev_pmd_thread' + * instance for non-pmd thread. */ + struct ovs_mutex non_pmd_mutex; + + /* Each pmd thread will store its pointer to + * 'struct dp_netdev_pmd_thread' in 'per_pmd_key'. */ + ovsthread_key_t per_pmd_key; + + /* Number of rx queues for each dpdk interface and the cpu mask + * for pin of pmd threads. */ + size_t n_dpdk_rxqs; + char *pmd_cmask; + uint64_t last_tnl_conf_seq; }; static struct dp_netdev_port *dp_netdev_lookup_port(const struct dp_netdev *dp, - odp_port_t) - OVS_REQ_RDLOCK(dp->port_rwlock); + odp_port_t); enum dp_stat_type { - DP_STAT_HIT, /* Packets that matched in the flow table. */ + DP_STAT_EXACT_HIT, /* Packets that had an exact match (emc). */ + DP_STAT_MASKED_HIT, /* Packets that matched in the flow table. */ DP_STAT_MISS, /* Packets that did not match. */ DP_STAT_LOST, /* Packets not passed up to the client. */ DP_N_STATS }; -/* Contained by struct dp_netdev's 'stats' member. */ -struct dp_netdev_stats { - struct ovs_mutex mutex; /* Protects 'n'. */ - - /* Indexed by DP_STAT_*, protected by 'mutex'. */ - unsigned long long int n[DP_N_STATS] OVS_GUARDED; +enum pmd_cycles_counter_type { + PMD_CYCLES_POLLING, /* Cycles spent polling NICs. */ + PMD_CYCLES_PROCESSING, /* Cycles spent processing packets */ + PMD_N_CYCLES }; - /* A port in a netdev-based datapath. */ struct dp_netdev_port { - struct hmap_node node; /* Node in dp_netdev's 'ports'. */ - odp_port_t port_no; + struct pkt_metadata md; struct netdev *netdev; + struct cmap_node node; /* Node in dp_netdev's 'ports'. */ struct netdev_saved_flags *sf; struct netdev_rxq **rxq; struct ovs_refcount ref_cnt; char *type; /* Port type as requested by user. */ }; -/* A flow in dp_netdev's 'flow_table'. +/* Contained by struct dp_netdev_flow's 'stats' member. */ +struct dp_netdev_flow_stats { + atomic_llong used; /* Last used time, in monotonic msecs. */ + atomic_ullong packet_count; /* Number of packets matched. */ + atomic_ullong byte_count; /* Number of bytes matched. */ + atomic_uint16_t tcp_flags; /* Bitwise-OR of seen tcp_flags values. */ +}; + +/* A flow in 'dp_netdev_pmd_thread's 'flow_table'. * * * Thread-safety * ============= * * Except near the beginning or ending of its lifespan, rule 'rule' belongs to - * its dp_netdev's classifier. The text below calls this classifier 'cls'. + * its pmd thread's classifier. The text below calls this classifier 'cls'. * * Motivation * ---------- @@ -229,48 +278,56 @@ * Rules * ----- * - * A flow 'flow' may be accessed without a risk of being freed by code that - * holds a read-lock or write-lock on 'cls->rwlock' or that owns a reference to - * 'flow->ref_cnt' (or both). Code that needs to hold onto a flow for a while - * should take 'cls->rwlock', find the flow it needs, increment 'flow->ref_cnt' - * with dpif_netdev_flow_ref(), and drop 'cls->rwlock'. + * A flow 'flow' may be accessed without a risk of being freed during an RCU + * grace period. Code that needs to hold onto a flow for a while + * should try incrementing 'flow->ref_cnt' with dp_netdev_flow_ref(). * * 'flow->ref_cnt' protects 'flow' from being freed. It doesn't protect the - * flow from being deleted from 'cls' (that's 'cls->rwlock') and it doesn't - * protect members of 'flow' from modification. + * flow from being deleted from 'cls' and it doesn't protect members of 'flow' + * from modification. * * Some members, marked 'const', are immutable. Accessing other members * requires synchronization, as noted in more detail below. */ struct dp_netdev_flow { - /* Packet classification. */ - const struct cls_rule cr; /* In owning dp_netdev's 'cls'. */ - + const struct flow flow; /* Unmasked flow that created this entry. */ /* Hash table index by unmasked flow. */ - const struct hmap_node node; /* In owning dp_netdev's 'flow_table'. */ - const struct flow flow; /* The flow that created this entry. */ + const struct cmap_node node; /* In owning dp_netdev_pmd_thread's */ + /* 'flow_table'. */ + const ovs_u128 ufid; /* Unique flow identifier. */ + const unsigned pmd_id; /* The 'core_id' of pmd thread owning this */ + /* flow. */ + + /* Number of references. + * The classifier owns one reference. + * Any thread trying to keep a rule from being freed should hold its own + * reference. */ + struct ovs_refcount ref_cnt; - /* Statistics. - * - * Reading or writing these members requires 'mutex'. */ - struct ovsthread_stats stats; /* Contains "struct dp_netdev_flow_stats". */ + bool dead; + + /* Statistics. */ + struct dp_netdev_flow_stats stats; /* Actions. */ OVSRCU_TYPE(struct dp_netdev_actions *) actions; -}; -static void dp_netdev_flow_free(struct dp_netdev_flow *); + /* While processing a group of input packets, the datapath uses the next + * member to store a pointer to the output batch for the flow. It is + * reset after the batch has been sent out (See dp_netdev_queue_batches(), + * packet_batch_init() and packet_batch_execute()). */ + struct packet_batch *batch; -/* Contained by struct dp_netdev_flow's 'stats' member. */ -struct dp_netdev_flow_stats { - struct ovs_mutex mutex; /* Guards all the other members. */ - - long long int used OVS_GUARDED; /* Last used time, in monotonic msecs. */ - long long int packet_count OVS_GUARDED; /* Number of packets matched. */ - long long int byte_count OVS_GUARDED; /* Number of bytes matched. */ - uint16_t tcp_flags OVS_GUARDED; /* Bitwise-OR of seen tcp_flags values. */ + /* Packet classification. */ + struct dpcls_rule cr; /* In owning dp_netdev's 'cls'. */ + /* 'cr' must be the last member. */ }; +static void dp_netdev_flow_unref(struct dp_netdev_flow *); +static bool dp_netdev_flow_ref(struct dp_netdev_flow *); +static int dpif_netdev_flow_from_nlattrs(const struct nlattr *, uint32_t, + struct flow *); + /* A set of datapath actions within a "struct dp_netdev_flow". * * @@ -281,8 +338,8 @@ struct dp_netdev_actions { /* These members are immutable: they do not change during the struct's * lifetime. */ - struct nlattr *actions; /* Sequence of OVS_ACTION_ATTR_* attributes. */ unsigned int size; /* Size of 'actions', in bytes. */ + struct nlattr actions[]; /* Sequence of OVS_ACTION_ATTR_* attributes. */ }; struct dp_netdev_actions *dp_netdev_actions_create(const struct nlattr *, @@ -291,24 +348,86 @@ const struct dp_netdev_flow *); static void dp_netdev_actions_free(struct dp_netdev_actions *); +/* Contained by struct dp_netdev_pmd_thread's 'stats' member. */ +struct dp_netdev_pmd_stats { + /* Indexed by DP_STAT_*. */ + atomic_ullong n[DP_N_STATS]; +}; + +/* Contained by struct dp_netdev_pmd_thread's 'cycle' member. */ +struct dp_netdev_pmd_cycles { + /* Indexed by PMD_CYCLES_*. */ + atomic_ullong n[PMD_N_CYCLES]; +}; + /* PMD: Poll modes drivers. PMD accesses devices via polling to eliminate * the performance overhead of interrupt processing. Therefore netdev can * not implement rx-wait for these devices. dpif-netdev needs to poll * these device to check for recv buffer. pmd-thread does polling for - * devices assigned to itself thread. + * devices assigned to itself. * * DPDK used PMD for accessing NIC. * - * A thread that receives packets from PMD ports, looks them up in the flow - * table, and executes the actions it finds. - **/ -struct pmd_thread { + * Note, instance with cpu core id NON_PMD_CORE_ID will be reserved for + * I/O of all non-pmd threads. There will be no actual thread created + * for the instance. + * + * Each struct has its own flow table and classifier. Packets received + * from managed ports are looked up in the corresponding pmd thread's + * flow table, and are executed with the found actions. + * */ +struct dp_netdev_pmd_thread { struct dp_netdev *dp; + struct ovs_refcount ref_cnt; /* Every reference must be refcount'ed. */ + struct cmap_node node; /* In 'dp->poll_threads'. */ + + pthread_cond_t cond; /* For synchronizing pmd thread reload. */ + struct ovs_mutex cond_mutex; /* Mutex for condition variable. */ + + /* Per thread exact-match cache. Note, the instance for cpu core + * NON_PMD_CORE_ID can be accessed by multiple threads, and thusly + * need to be protected (e.g. by 'dp_netdev_mutex'). All other + * instances will only be accessed by its own pmd thread. */ + struct emc_cache flow_cache; + + /* Classifier and Flow-Table. + * + * Writers of 'flow_table' must take the 'flow_mutex'. Corresponding + * changes to 'cls' must be made while still holding the 'flow_mutex'. + */ + struct ovs_mutex flow_mutex; + struct dpcls cls; + struct cmap flow_table OVS_GUARDED; /* Flow table. */ + + /* Statistics. */ + struct dp_netdev_pmd_stats stats; + + /* Cycles counters */ + struct dp_netdev_pmd_cycles cycles; + + /* Used to count cicles. See 'cycles_counter_end()' */ + unsigned long long last_cycles; + + struct latch exit_latch; /* For terminating the pmd thread. */ + atomic_uint change_seq; /* For reloading pmd ports. */ pthread_t thread; - int id; - atomic_uint change_seq; + int index; /* Idx of this pmd thread among pmd*/ + /* threads on same numa node. */ + unsigned core_id; /* CPU core id of this pmd thread. */ + int numa_id; /* numa node id of this pmd thread. */ + int tx_qid; /* Queue id used by this pmd thread to + * send packets on all netdevs */ + + /* Only a pmd thread can write on its own 'cycles' and 'stats'. + * The main thread keeps 'stats_zero' and 'cycles_zero' as base + * values and subtracts them from 'stats' and 'cycles' before + * reporting to the user */ + unsigned long long stats_zero[DP_N_STATS]; + uint64_t cycles_zero[PMD_N_CYCLES]; }; +#define PMD_INITIAL_SEQ 1 + /* Interface to netdev-based datapath. */ struct dpif_netdev { struct dpif dpif; @@ -317,37 +436,88 @@ }; static int get_port_by_number(struct dp_netdev *dp, odp_port_t port_no, - struct dp_netdev_port **portp) - OVS_REQ_RDLOCK(dp->port_rwlock); + struct dp_netdev_port **portp); static int get_port_by_name(struct dp_netdev *dp, const char *devname, - struct dp_netdev_port **portp) - OVS_REQ_RDLOCK(dp->port_rwlock); + struct dp_netdev_port **portp); static void dp_netdev_free(struct dp_netdev *) OVS_REQUIRES(dp_netdev_mutex); -static void dp_netdev_flow_flush(struct dp_netdev *); static int do_add_port(struct dp_netdev *dp, const char *devname, const char *type, odp_port_t port_no) - OVS_REQ_WRLOCK(dp->port_rwlock); -static int do_del_port(struct dp_netdev *dp, odp_port_t port_no) - OVS_REQ_WRLOCK(dp->port_rwlock); -static void dp_netdev_destroy_all_queues(struct dp_netdev *dp) - OVS_REQ_WRLOCK(dp->queue_rwlock); + OVS_REQUIRES(dp->port_mutex); +static void do_del_port(struct dp_netdev *dp, struct dp_netdev_port *) + OVS_REQUIRES(dp->port_mutex); static int dpif_netdev_open(const struct dpif_class *, const char *name, bool create, struct dpif **); -static int dp_netdev_output_userspace(struct dp_netdev *dp, struct ofpbuf *, - int queue_no, int type, - const struct miniflow *, - const struct nlattr *userdata); -static void dp_netdev_execute_actions(struct dp_netdev *dp, - const struct miniflow *, - struct ofpbuf *, bool may_steal, - struct pkt_metadata *, +static void dp_netdev_execute_actions(struct dp_netdev_pmd_thread *pmd, + struct dp_packet **, int c, + bool may_steal, const struct nlattr *actions, size_t actions_len); -static void dp_netdev_port_input(struct dp_netdev *dp, struct ofpbuf *packet, - struct pkt_metadata *); +static void dp_netdev_input(struct dp_netdev_pmd_thread *, + struct dp_packet **, int cnt); + +static void dp_netdev_disable_upcall(struct dp_netdev *); +void dp_netdev_pmd_reload_done(struct dp_netdev_pmd_thread *pmd); +static void dp_netdev_configure_pmd(struct dp_netdev_pmd_thread *pmd, + struct dp_netdev *dp, int index, + unsigned core_id, int numa_id); +static void dp_netdev_destroy_pmd(struct dp_netdev_pmd_thread *pmd); +static void dp_netdev_set_nonpmd(struct dp_netdev *dp); +static struct dp_netdev_pmd_thread *dp_netdev_get_pmd(struct dp_netdev *dp, + unsigned core_id); +static struct dp_netdev_pmd_thread * +dp_netdev_pmd_get_next(struct dp_netdev *dp, struct cmap_position *pos); +static void dp_netdev_destroy_all_pmds(struct dp_netdev *dp); +static void dp_netdev_del_pmds_on_numa(struct dp_netdev *dp, int numa_id); +static void dp_netdev_set_pmds_on_numa(struct dp_netdev *dp, int numa_id); +static void dp_netdev_reset_pmd_threads(struct dp_netdev *dp); +static bool dp_netdev_pmd_try_ref(struct dp_netdev_pmd_thread *pmd); +static void dp_netdev_pmd_unref(struct dp_netdev_pmd_thread *pmd); +static void dp_netdev_pmd_flow_flush(struct dp_netdev_pmd_thread *pmd); + +static inline bool emc_entry_alive(struct emc_entry *ce); +static void emc_clear_entry(struct emc_entry *ce); + +static void +emc_cache_init(struct emc_cache *flow_cache) +{ + int i; + + BUILD_ASSERT(offsetof(struct miniflow, inline_values) == sizeof(uint64_t)); + + flow_cache->sweep_idx = 0; + for (i = 0; i < ARRAY_SIZE(flow_cache->entries); i++) { + flow_cache->entries[i].flow = NULL; + flow_cache->entries[i].key.hash = 0; + flow_cache->entries[i].key.len + = offsetof(struct miniflow, inline_values); + miniflow_initialize(&flow_cache->entries[i].key.mf, + flow_cache->entries[i].key.buf); + } +} + +static void +emc_cache_uninit(struct emc_cache *flow_cache) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(flow_cache->entries); i++) { + emc_clear_entry(&flow_cache->entries[i]); + } +} + +/* Check and clear dead flow references slowly (one entry at each + * invocation). */ +static void +emc_cache_slow_sweep(struct emc_cache *flow_cache) +{ + struct emc_entry *entry = &flow_cache->entries[flow_cache->sweep_idx]; -static void dp_netdev_set_pmd_threads(struct dp_netdev *, int n); + if (!emc_entry_alive(entry)) { + emc_clear_entry(entry); + } + flow_cache->sweep_idx = (flow_cache->sweep_idx + 1) & EM_FLOW_HASH_MASK; +} static struct dpif_netdev * dpif_netdev_cast(const struct dpif *dpif) @@ -361,14 +531,197 @@ { return dpif_netdev_cast(dpif)->dp; } + +enum pmd_info_type { + PMD_INFO_SHOW_STATS, /* show how cpu cycles are spent */ + PMD_INFO_CLEAR_STATS /* set the cycles count to 0 */ +}; + +static void +pmd_info_show_stats(struct ds *reply, + struct dp_netdev_pmd_thread *pmd, + unsigned long long stats[DP_N_STATS], + uint64_t cycles[PMD_N_CYCLES]) +{ + unsigned long long total_packets = 0; + uint64_t total_cycles = 0; + int i; + + /* These loops subtracts reference values ('*_zero') from the counters. + * Since loads and stores are relaxed, it might be possible for a '*_zero' + * value to be more recent than the current value we're reading from the + * counter. This is not a big problem, since these numbers are not + * supposed to be too accurate, but we should at least make sure that + * the result is not negative. */ + for (i = 0; i < DP_N_STATS; i++) { + if (stats[i] > pmd->stats_zero[i]) { + stats[i] -= pmd->stats_zero[i]; + } else { + stats[i] = 0; + } + + if (i != DP_STAT_LOST) { + /* Lost packets are already included in DP_STAT_MISS */ + total_packets += stats[i]; + } + } + + for (i = 0; i < PMD_N_CYCLES; i++) { + if (cycles[i] > pmd->cycles_zero[i]) { + cycles[i] -= pmd->cycles_zero[i]; + } else { + cycles[i] = 0; + } + + total_cycles += cycles[i]; + } + + ds_put_cstr(reply, (pmd->core_id == NON_PMD_CORE_ID) + ? "main thread" : "pmd thread"); + + if (pmd->numa_id != OVS_NUMA_UNSPEC) { + ds_put_format(reply, " numa_id %d", pmd->numa_id); + } + if (pmd->core_id != OVS_CORE_UNSPEC && pmd->core_id != NON_PMD_CORE_ID) { + ds_put_format(reply, " core_id %u", pmd->core_id); + } + ds_put_cstr(reply, ":\n"); + + ds_put_format(reply, + "\temc hits:%llu\n\tmegaflow hits:%llu\n" + "\tmiss:%llu\n\tlost:%llu\n", + stats[DP_STAT_EXACT_HIT], stats[DP_STAT_MASKED_HIT], + stats[DP_STAT_MISS], stats[DP_STAT_LOST]); + + if (total_cycles == 0) { + return; + } + + ds_put_format(reply, + "\tpolling cycles:%"PRIu64" (%.02f%%)\n" + "\tprocessing cycles:%"PRIu64" (%.02f%%)\n", + cycles[PMD_CYCLES_POLLING], + cycles[PMD_CYCLES_POLLING] / (double)total_cycles * 100, + cycles[PMD_CYCLES_PROCESSING], + cycles[PMD_CYCLES_PROCESSING] / (double)total_cycles * 100); + + if (total_packets == 0) { + return; + } + + ds_put_format(reply, + "\tavg cycles per packet: %.02f (%"PRIu64"/%llu)\n", + total_cycles / (double)total_packets, + total_cycles, total_packets); + + ds_put_format(reply, + "\tavg processing cycles per packet: " + "%.02f (%"PRIu64"/%llu)\n", + cycles[PMD_CYCLES_PROCESSING] / (double)total_packets, + cycles[PMD_CYCLES_PROCESSING], total_packets); +} + +static void +pmd_info_clear_stats(struct ds *reply OVS_UNUSED, + struct dp_netdev_pmd_thread *pmd, + unsigned long long stats[DP_N_STATS], + uint64_t cycles[PMD_N_CYCLES]) +{ + int i; + + /* We cannot write 'stats' and 'cycles' (because they're written by other + * threads) and we shouldn't change 'stats' (because they're used to count + * datapath stats, which must not be cleared here). Instead, we save the + * current values and subtract them from the values to be displayed in the + * future */ + for (i = 0; i < DP_N_STATS; i++) { + pmd->stats_zero[i] = stats[i]; + } + for (i = 0; i < PMD_N_CYCLES; i++) { + pmd->cycles_zero[i] = cycles[i]; + } +} + +static void +dpif_netdev_pmd_info(struct unixctl_conn *conn, int argc, const char *argv[], + void *aux) +{ + struct ds reply = DS_EMPTY_INITIALIZER; + struct dp_netdev_pmd_thread *pmd; + struct dp_netdev *dp = NULL; + enum pmd_info_type type = *(enum pmd_info_type *) aux; + + ovs_mutex_lock(&dp_netdev_mutex); + + if (argc == 2) { + dp = shash_find_data(&dp_netdevs, argv[1]); + } else if (shash_count(&dp_netdevs) == 1) { + /* There's only one datapath */ + dp = shash_first(&dp_netdevs)->data; + } + + if (!dp) { + ovs_mutex_unlock(&dp_netdev_mutex); + unixctl_command_reply_error(conn, + "please specify an existing datapath"); + return; + } + + CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { + unsigned long long stats[DP_N_STATS]; + uint64_t cycles[PMD_N_CYCLES]; + int i; + + /* Read current stats and cycle counters */ + for (i = 0; i < ARRAY_SIZE(stats); i++) { + atomic_read_relaxed(&pmd->stats.n[i], &stats[i]); + } + for (i = 0; i < ARRAY_SIZE(cycles); i++) { + atomic_read_relaxed(&pmd->cycles.n[i], &cycles[i]); + } + + if (type == PMD_INFO_CLEAR_STATS) { + pmd_info_clear_stats(&reply, pmd, stats, cycles); + } else if (type == PMD_INFO_SHOW_STATS) { + pmd_info_show_stats(&reply, pmd, stats, cycles); + } + } + + ovs_mutex_unlock(&dp_netdev_mutex); + + unixctl_command_reply(conn, ds_cstr(&reply)); + ds_destroy(&reply); +} + +static int +dpif_netdev_init(void) +{ + static enum pmd_info_type show_aux = PMD_INFO_SHOW_STATS, + clear_aux = PMD_INFO_CLEAR_STATS; + + unixctl_command_register("dpif-netdev/pmd-stats-show", "[dp]", + 0, 1, dpif_netdev_pmd_info, + (void *)&show_aux); + unixctl_command_register("dpif-netdev/pmd-stats-clear", "[dp]", + 0, 1, dpif_netdev_pmd_info, + (void *)&clear_aux); + return 0; +} static int -dpif_netdev_enumerate(struct sset *all_dps) +dpif_netdev_enumerate(struct sset *all_dps, + const struct dpif_class *dpif_class) { struct shash_node *node; ovs_mutex_lock(&dp_netdev_mutex); SHASH_FOR_EACH(node, &dp_netdevs) { + struct dp_netdev *dp = node->data; + if (dpif_class != dp->class) { + /* 'dp_netdevs' contains both "netdev" and "dummy" dpifs. + * If the class doesn't match, skip this dpif. */ + continue; + } sset_add(all_dps, node->name); } ovs_mutex_unlock(&dp_netdev_mutex); @@ -410,7 +763,7 @@ * Return ODPP_NONE on failure. */ static odp_port_t choose_port(struct dp_netdev *dp, const char *name) - OVS_REQ_RDLOCK(dp->port_rwlock) + OVS_REQUIRES(dp->port_mutex) { uint32_t port_no; @@ -464,27 +817,32 @@ ovs_refcount_init(&dp->ref_cnt); atomic_flag_clear(&dp->destroyed); - ovs_mutex_init(&dp->flow_mutex); - classifier_init(&dp->cls, NULL); - hmap_init(&dp->flow_table); + ovs_mutex_init(&dp->port_mutex); + cmap_init(&dp->ports); + dp->port_seq = seq_create(); + fat_rwlock_init(&dp->upcall_rwlock); - fat_rwlock_init(&dp->queue_rwlock); + /* Disable upcalls by default. */ + dp_netdev_disable_upcall(dp); + dp->upcall_aux = NULL; + dp->upcall_cb = NULL; - ovsthread_stats_init(&dp->stats); + cmap_init(&dp->poll_threads); + ovs_mutex_init_recursive(&dp->non_pmd_mutex); + ovsthread_key_create(&dp->per_pmd_key, NULL); - ovs_rwlock_init(&dp->port_rwlock); - hmap_init(&dp->ports); - dp->port_seq = seq_create(); - latch_init(&dp->exit_latch); + dp_netdev_set_nonpmd(dp); + dp->n_dpdk_rxqs = NR_QUEUE; - ovs_rwlock_wrlock(&dp->port_rwlock); + ovs_mutex_lock(&dp->port_mutex); error = do_add_port(dp, name, "internal", ODPP_LOCAL); - ovs_rwlock_unlock(&dp->port_rwlock); + ovs_mutex_unlock(&dp->port_mutex); if (error) { dp_netdev_free(dp); return error; } + dp->last_tnl_conf_seq = seq_read(tnl_conf_seq); *dpp = dp; return 0; } @@ -507,6 +865,7 @@ } if (!error) { *dpifp = create_dpif_netdev(dp); + dp->dpif = *dpifp; } ovs_mutex_unlock(&dp_netdev_mutex); @@ -514,22 +873,15 @@ } static void -dp_netdev_purge_queues(struct dp_netdev *dp) - OVS_REQ_WRLOCK(dp->queue_rwlock) +dp_netdev_destroy_upcall_lock(struct dp_netdev *dp) + OVS_NO_THREAD_SAFETY_ANALYSIS { - int i; - - for (i = 0; i < dp->n_handlers; i++) { - struct dp_netdev_queue *q = &dp->handler_queues[i]; + /* Check that upcalls are disabled, i.e. that the rwlock is taken */ + ovs_assert(fat_rwlock_tryrdlock(&dp->upcall_rwlock)); - ovs_mutex_lock(&q->mutex); - while (q->tail != q->head) { - struct dp_netdev_upcall *u = &q->upcalls[q->tail++ & QUEUE_MASK]; - ofpbuf_uninit(&u->upcall.packet); - ofpbuf_uninit(&u->buf); - } - ovs_mutex_unlock(&q->mutex); - } + /* Before freeing a lock we should release it */ + fat_rwlock_unlock(&dp->upcall_rwlock); + fat_rwlock_destroy(&dp->upcall_rwlock); } /* Requires dp_netdev_mutex so that we can't get a new reference to 'dp' @@ -538,40 +890,28 @@ dp_netdev_free(struct dp_netdev *dp) OVS_REQUIRES(dp_netdev_mutex) { - struct dp_netdev_port *port, *next; - struct dp_netdev_stats *bucket; - int i; + struct dp_netdev_port *port; shash_find_and_delete(&dp_netdevs, dp->name); - dp_netdev_set_pmd_threads(dp, 0); - free(dp->pmd_threads); - - dp_netdev_flow_flush(dp); - ovs_rwlock_wrlock(&dp->port_rwlock); - HMAP_FOR_EACH_SAFE (port, next, node, &dp->ports) { - do_del_port(dp, port->port_no); - } - ovs_rwlock_unlock(&dp->port_rwlock); - - OVSTHREAD_STATS_FOR_EACH_BUCKET (bucket, i, &dp->stats) { - ovs_mutex_destroy(&bucket->mutex); - free_cacheline(bucket); + dp_netdev_destroy_all_pmds(dp); + cmap_destroy(&dp->poll_threads); + ovs_mutex_destroy(&dp->non_pmd_mutex); + ovsthread_key_delete(dp->per_pmd_key); + + ovs_mutex_lock(&dp->port_mutex); + CMAP_FOR_EACH (port, node, &dp->ports) { + do_del_port(dp, port); } - ovsthread_stats_destroy(&dp->stats); + ovs_mutex_unlock(&dp->port_mutex); - fat_rwlock_wrlock(&dp->queue_rwlock); - dp_netdev_destroy_all_queues(dp); - fat_rwlock_unlock(&dp->queue_rwlock); + seq_destroy(dp->port_seq); + cmap_destroy(&dp->ports); - fat_rwlock_destroy(&dp->queue_rwlock); + /* Upcalls must be disabled at this point */ + dp_netdev_destroy_upcall_lock(dp); - classifier_destroy(&dp->cls); - hmap_destroy(&dp->flow_table); - ovs_mutex_destroy(&dp->flow_mutex); - seq_destroy(dp->port_seq); - hmap_destroy(&dp->ports); - latch_destroy(&dp->exit_latch); + free(dp->pmd_cmask); free(CONST_CAST(char *, dp->name)); free(dp); } @@ -583,7 +923,7 @@ /* Take dp_netdev_mutex so that, if dp->ref_cnt falls to zero, we can't * get a new reference to 'dp' through the 'dp_netdevs' shash. */ ovs_mutex_lock(&dp_netdev_mutex); - if (ovs_refcount_unref(&dp->ref_cnt) == 1) { + if (ovs_refcount_unref_relaxed(&dp->ref_cnt) == 1) { dp_netdev_free(dp); } ovs_mutex_unlock(&dp_netdev_mutex); @@ -605,7 +945,7 @@ struct dp_netdev *dp = get_dp_netdev(dpif); if (!atomic_flag_test_and_set(&dp->destroyed)) { - if (ovs_refcount_unref(&dp->ref_cnt) == 1) { + if (ovs_refcount_unref_relaxed(&dp->ref_cnt) == 1) { /* Can't happen: 'dpif' still owns a reference to 'dp'. */ OVS_NOT_REACHED(); } @@ -614,24 +954,40 @@ return 0; } +/* Add 'n' to the atomic variable 'var' non-atomically and using relaxed + * load/store semantics. While the increment is not atomic, the load and + * store operations are, making it impossible to read inconsistent values. + * + * This is used to update thread local stats counters. */ +static void +non_atomic_ullong_add(atomic_ullong *var, unsigned long long n) +{ + unsigned long long tmp; + + atomic_read_relaxed(var, &tmp); + tmp += n; + atomic_store_relaxed(var, tmp); +} + static int dpif_netdev_get_stats(const struct dpif *dpif, struct dpif_dp_stats *stats) { struct dp_netdev *dp = get_dp_netdev(dpif); - struct dp_netdev_stats *bucket; - size_t i; + struct dp_netdev_pmd_thread *pmd; - fat_rwlock_rdlock(&dp->cls.rwlock); - stats->n_flows = hmap_count(&dp->flow_table); - fat_rwlock_unlock(&dp->cls.rwlock); - - stats->n_hit = stats->n_missed = stats->n_lost = 0; - OVSTHREAD_STATS_FOR_EACH_BUCKET (bucket, i, &dp->stats) { - ovs_mutex_lock(&bucket->mutex); - stats->n_hit += bucket->n[DP_STAT_HIT]; - stats->n_missed += bucket->n[DP_STAT_MISS]; - stats->n_lost += bucket->n[DP_STAT_LOST]; - ovs_mutex_unlock(&bucket->mutex); + stats->n_flows = stats->n_hit = stats->n_missed = stats->n_lost = 0; + CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { + unsigned long long n; + stats->n_flows += cmap_count(&pmd->flow_table); + + atomic_read_relaxed(&pmd->stats.n[DP_STAT_MASKED_HIT], &n); + stats->n_hit += n; + atomic_read_relaxed(&pmd->stats.n[DP_STAT_EXACT_HIT], &n); + stats->n_hit += n; + atomic_read_relaxed(&pmd->stats.n[DP_STAT_MISS], &n); + stats->n_missed += n; + atomic_read_relaxed(&pmd->stats.n[DP_STAT_LOST], &n); + stats->n_lost += n; } stats->n_masks = UINT32_MAX; stats->n_mask_hit = UINT64_MAX; @@ -640,22 +996,42 @@ } static void -dp_netdev_reload_pmd_threads(struct dp_netdev *dp) +dp_netdev_reload_pmd__(struct dp_netdev_pmd_thread *pmd) { - int i; + int old_seq; + + if (pmd->core_id == NON_PMD_CORE_ID) { + return; + } - for (i = 0; i < dp->n_pmd_threads; i++) { - struct pmd_thread *f = &dp->pmd_threads[i]; - int id; + ovs_mutex_lock(&pmd->cond_mutex); + atomic_add_relaxed(&pmd->change_seq, 1, &old_seq); + ovs_mutex_cond_wait(&pmd->cond, &pmd->cond_mutex); + ovs_mutex_unlock(&pmd->cond_mutex); +} + +/* Causes all pmd threads to reload its tx/rx devices. + * Must be called after adding/removing ports. */ +static void +dp_netdev_reload_pmds(struct dp_netdev *dp) +{ + struct dp_netdev_pmd_thread *pmd; - atomic_add(&f->change_seq, 1, &id); - } + CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { + dp_netdev_reload_pmd__(pmd); + } +} + +static uint32_t +hash_port_no(odp_port_t port_no) +{ + return hash_int(odp_to_u32(port_no), 0); } static int do_add_port(struct dp_netdev *dp, const char *devname, const char *type, odp_port_t port_no) - OVS_REQ_WRLOCK(dp->port_rwlock) + OVS_REQUIRES(dp->port_mutex) { struct netdev_saved_flags *sf; struct dp_netdev_port *port; @@ -665,7 +1041,10 @@ int error; int i; - /* XXX reject devices already in some dp_netdev. */ + /* Reject devices already in 'dp'. */ + if (!get_port_by_name(dp, devname, &port)) { + return EEXIST; + } /* Open and validate network device. */ open_type = dpif_netdev_port_open_type(dp->class, type); @@ -682,8 +1061,24 @@ return EINVAL; } + if (netdev_is_pmd(netdev)) { + int n_cores = ovs_numa_get_n_cores(); + + if (n_cores == OVS_CORE_UNSPEC) { + VLOG_ERR("%s, cannot get cpu core info", devname); + return ENOENT; + } + /* There can only be ovs_numa_get_n_cores() pmd threads, + * so creates a txq for each, and one extra for the non + * pmd threads. */ + error = netdev_set_multiq(netdev, n_cores + 1, dp->n_dpdk_rxqs); + if (error && (error != EOPNOTSUPP)) { + VLOG_ERR("%s, cannot set multiq", devname); + return errno; + } + } port = xzalloc(sizeof *port); - port->port_no = port_no; + port->md = PKT_METADATA_INITIALIZER(port_no); port->netdev = netdev; port->rxq = xmalloc(sizeof *port->rxq * netdev_n_rxq(netdev)); port->type = xstrdup(type); @@ -694,6 +1089,9 @@ VLOG_ERR("%s: cannot receive packets on this network device (%s)", devname, ovs_strerror(errno)); netdev_close(netdev); + free(port->type); + free(port->rxq); + free(port); return error; } } @@ -704,20 +1102,20 @@ netdev_rxq_close(port->rxq[i]); } netdev_close(netdev); + free(port->type); free(port->rxq); free(port); return error; } port->sf = sf; - if (netdev_is_pmd(netdev)) { - dp->pmd_count++; - dp_netdev_set_pmd_threads(dp, NR_THREADS); - dp_netdev_reload_pmd_threads(dp); - } ovs_refcount_init(&port->ref_cnt); + cmap_insert(&dp->ports, &port->node, hash_port_no(port_no)); - hmap_insert(&dp->ports, &port->node, hash_int(odp_to_u32(port_no), 0)); + if (netdev_is_pmd(netdev)) { + dp_netdev_set_pmds_on_numa(dp, netdev_get_numa_id(netdev)); + dp_netdev_reload_pmds(dp); + } seq_change(dp->port_seq); return 0; @@ -733,7 +1131,7 @@ odp_port_t port_no; int error; - ovs_rwlock_wrlock(&dp->port_rwlock); + ovs_mutex_lock(&dp->port_mutex); dpif_port = netdev_vport_get_dpif_port(netdev, namebuf, sizeof namebuf); if (*port_nop != ODPP_NONE) { port_no = *port_nop; @@ -746,7 +1144,7 @@ *port_nop = port_no; error = do_add_port(dp, dpif_port, netdev_get_type(netdev), port_no); } - ovs_rwlock_unlock(&dp->port_rwlock); + ovs_mutex_unlock(&dp->port_mutex); return error; } @@ -757,9 +1155,18 @@ struct dp_netdev *dp = get_dp_netdev(dpif); int error; - ovs_rwlock_wrlock(&dp->port_rwlock); - error = port_no == ODPP_LOCAL ? EINVAL : do_del_port(dp, port_no); - ovs_rwlock_unlock(&dp->port_rwlock); + ovs_mutex_lock(&dp->port_mutex); + if (port_no == ODPP_LOCAL) { + error = EINVAL; + } else { + struct dp_netdev_port *port; + + error = get_port_by_number(dp, port_no, &port); + if (!error) { + do_del_port(dp, port); + } + } + ovs_mutex_unlock(&dp->port_mutex); return error; } @@ -772,13 +1179,11 @@ static struct dp_netdev_port * dp_netdev_lookup_port(const struct dp_netdev *dp, odp_port_t port_no) - OVS_REQ_RDLOCK(dp->port_rwlock) { struct dp_netdev_port *port; - HMAP_FOR_EACH_IN_BUCKET (port, node, hash_int(odp_to_u32(port_no), 0), - &dp->ports) { - if (port->port_no == port_no) { + CMAP_FOR_EACH_WITH_HASH (port, node, hash_port_no(port_no), &dp->ports) { + if (port->md.in_port.odp_port == port_no) { return port; } } @@ -788,7 +1193,6 @@ static int get_port_by_number(struct dp_netdev *dp, odp_port_t port_no, struct dp_netdev_port **portp) - OVS_REQ_RDLOCK(dp->port_rwlock) { if (!is_valid_port_number(port_no)) { *portp = NULL; @@ -807,10 +1211,20 @@ } } +static bool +port_try_ref(struct dp_netdev_port *port) +{ + if (port) { + return ovs_refcount_try_ref_rcu(&port->ref_cnt); + } + + return false; +} + static void port_unref(struct dp_netdev_port *port) { - if (port && ovs_refcount_unref(&port->ref_cnt) == 1) { + if (port && ovs_refcount_unref_relaxed(&port->ref_cnt) == 1) { int n_rxq = netdev_n_rxq(port->netdev); int i; @@ -829,11 +1243,11 @@ static int get_port_by_name(struct dp_netdev *dp, const char *devname, struct dp_netdev_port **portp) - OVS_REQ_RDLOCK(dp->port_rwlock) + OVS_REQUIRES(dp->port_mutex) { struct dp_netdev_port *port; - HMAP_FOR_EACH (port, node, &dp->ports) { + CMAP_FOR_EACH (port, node, &dp->ports) { if (!strcmp(netdev_get_name(port->netdev), devname)) { *portp = port; return 0; @@ -843,25 +1257,57 @@ } static int -do_del_port(struct dp_netdev *dp, odp_port_t port_no) - OVS_REQ_WRLOCK(dp->port_rwlock) +get_n_pmd_threads_on_numa(struct dp_netdev *dp, int numa_id) +{ + struct dp_netdev_pmd_thread *pmd; + int n_pmds = 0; + + CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { + if (pmd->numa_id == numa_id) { + n_pmds++; + } + } + + return n_pmds; +} + +/* Returns 'true' if there is a port with pmd netdev and the netdev + * is on numa node 'numa_id'. */ +static bool +has_pmd_port_for_numa(struct dp_netdev *dp, int numa_id) { struct dp_netdev_port *port; - int error; - error = get_port_by_number(dp, port_no, &port); - if (error) { - return error; + CMAP_FOR_EACH (port, node, &dp->ports) { + if (netdev_is_pmd(port->netdev) + && netdev_get_numa_id(port->netdev) == numa_id) { + return true; + } } - hmap_remove(&dp->ports, &port->node); + return false; +} + + +static void +do_del_port(struct dp_netdev *dp, struct dp_netdev_port *port) + OVS_REQUIRES(dp->port_mutex) +{ + cmap_remove(&dp->ports, &port->node, + hash_odp_port(port->md.in_port.odp_port)); seq_change(dp->port_seq); if (netdev_is_pmd(port->netdev)) { - dp_netdev_reload_pmd_threads(dp); + int numa_id = netdev_get_numa_id(port->netdev); + + /* If there is no netdev on the numa node, deletes the pmd threads + * for that numa. Else, just reloads the queues. */ + if (!has_pmd_port_for_numa(dp, numa_id)) { + dp_netdev_del_pmds_on_numa(dp, numa_id); + } + dp_netdev_reload_pmds(dp); } port_unref(port); - return 0; } static void @@ -870,7 +1316,7 @@ { dpif_port->name = xstrdup(netdev_get_name(port->netdev)); dpif_port->type = xstrdup(port->type); - dpif_port->port_no = port->port_no; + dpif_port->port_no = port->md.in_port.odp_port; } static int @@ -881,12 +1327,10 @@ struct dp_netdev_port *port; int error; - ovs_rwlock_rdlock(&dp->port_rwlock); error = get_port_by_number(dp, port_no, &port); if (!error && dpif_port) { answer_port_query(port, dpif_port); } - ovs_rwlock_unlock(&dp->port_rwlock); return error; } @@ -899,12 +1343,12 @@ struct dp_netdev_port *port; int error; - ovs_rwlock_rdlock(&dp->port_rwlock); + ovs_mutex_lock(&dp->port_mutex); error = get_port_by_name(dp, devname, &port); if (!error && dpif_port) { answer_port_query(port, dpif_port); } - ovs_rwlock_unlock(&dp->port_rwlock); + ovs_mutex_unlock(&dp->port_mutex); return error; } @@ -912,59 +1356,64 @@ static void dp_netdev_flow_free(struct dp_netdev_flow *flow) { - struct dp_netdev_flow_stats *bucket; - size_t i; + dp_netdev_actions_free(dp_netdev_flow_get_actions(flow)); + free(flow); +} - OVSTHREAD_STATS_FOR_EACH_BUCKET (bucket, i, &flow->stats) { - ovs_mutex_destroy(&bucket->mutex); - free_cacheline(bucket); +static void dp_netdev_flow_unref(struct dp_netdev_flow *flow) +{ + if (ovs_refcount_unref_relaxed(&flow->ref_cnt) == 1) { + ovsrcu_postpone(dp_netdev_flow_free, flow); } - ovsthread_stats_destroy(&flow->stats); +} - cls_rule_destroy(CONST_CAST(struct cls_rule *, &flow->cr)); - dp_netdev_actions_free(dp_netdev_flow_get_actions(flow)); - free(flow); +static uint32_t +dp_netdev_flow_hash(const ovs_u128 *ufid) +{ + return ufid->u32[0]; } static void -dp_netdev_remove_flow(struct dp_netdev *dp, struct dp_netdev_flow *flow) - OVS_REQ_WRLOCK(dp->cls.rwlock) - OVS_REQUIRES(dp->flow_mutex) +dp_netdev_pmd_remove_flow(struct dp_netdev_pmd_thread *pmd, + struct dp_netdev_flow *flow) + OVS_REQUIRES(pmd->flow_mutex) { - struct cls_rule *cr = CONST_CAST(struct cls_rule *, &flow->cr); - struct hmap_node *node = CONST_CAST(struct hmap_node *, &flow->node); + struct cmap_node *node = CONST_CAST(struct cmap_node *, &flow->node); - classifier_remove(&dp->cls, cr); - hmap_remove(&dp->flow_table, node); - ovsrcu_postpone(dp_netdev_flow_free, flow); + dpcls_remove(&pmd->cls, &flow->cr); + cmap_remove(&pmd->flow_table, node, dp_netdev_flow_hash(&flow->ufid)); + flow->dead = true; + + dp_netdev_flow_unref(flow); } static void -dp_netdev_flow_flush(struct dp_netdev *dp) +dp_netdev_pmd_flow_flush(struct dp_netdev_pmd_thread *pmd) { - struct dp_netdev_flow *netdev_flow, *next; + struct dp_netdev_flow *netdev_flow; - ovs_mutex_lock(&dp->flow_mutex); - fat_rwlock_wrlock(&dp->cls.rwlock); - HMAP_FOR_EACH_SAFE (netdev_flow, next, node, &dp->flow_table) { - dp_netdev_remove_flow(dp, netdev_flow); + ovs_mutex_lock(&pmd->flow_mutex); + CMAP_FOR_EACH (netdev_flow, node, &pmd->flow_table) { + dp_netdev_pmd_remove_flow(pmd, netdev_flow); } - fat_rwlock_unlock(&dp->cls.rwlock); - ovs_mutex_unlock(&dp->flow_mutex); + ovs_mutex_unlock(&pmd->flow_mutex); } static int dpif_netdev_flow_flush(struct dpif *dpif) { struct dp_netdev *dp = get_dp_netdev(dpif); + struct dp_netdev_pmd_thread *pmd; + + CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { + dp_netdev_pmd_flow_flush(pmd); + } - dp_netdev_flow_flush(dp); return 0; } struct dp_netdev_port_state { - uint32_t bucket; - uint32_t offset; + struct cmap_position position; char *name; }; @@ -981,11 +1430,10 @@ { struct dp_netdev_port_state *state = state_; struct dp_netdev *dp = get_dp_netdev(dpif); - struct hmap_node *node; + struct cmap_node *node; int retval; - ovs_rwlock_rdlock(&dp->port_rwlock); - node = hmap_at_position(&dp->ports, &state->bucket, &state->offset); + node = cmap_next_position(&dp->ports, &state->position); if (node) { struct dp_netdev_port *port; @@ -995,13 +1443,12 @@ state->name = xstrdup(netdev_get_name(port->netdev)); dpif_port->name = state->name; dpif_port->type = port->type; - dpif_port->port_no = port->port_no; + dpif_port->port_no = port->md.in_port.odp_port; retval = 0; } else { retval = EOF; } - ovs_rwlock_unlock(&dp->port_rwlock); return retval; } @@ -1042,58 +1489,360 @@ } static struct dp_netdev_flow * -dp_netdev_flow_cast(const struct cls_rule *cr) +dp_netdev_flow_cast(const struct dpcls_rule *cr) { return cr ? CONTAINER_OF(cr, struct dp_netdev_flow, cr) : NULL; } -static struct dp_netdev_flow * -dp_netdev_lookup_flow(const struct dp_netdev *dp, const struct miniflow *key) - OVS_EXCLUDED(dp->cls.rwlock) +static bool dp_netdev_flow_ref(struct dp_netdev_flow *flow) { - struct dp_netdev_flow *netdev_flow; - struct cls_rule *rule; + return ovs_refcount_try_ref_rcu(&flow->ref_cnt); +} - fat_rwlock_rdlock(&dp->cls.rwlock); - rule = classifier_lookup_miniflow_first(&dp->cls, key); - netdev_flow = dp_netdev_flow_cast(rule); - fat_rwlock_unlock(&dp->cls.rwlock); +/* netdev_flow_key utilities. + * + * netdev_flow_key is basically a miniflow. We use these functions + * (netdev_flow_key_clone, netdev_flow_key_equal, ...) instead of the miniflow + * functions (miniflow_clone_inline, miniflow_equal, ...), because: + * + * - Since we are dealing exclusively with miniflows created by + * miniflow_extract(), if the map is different the miniflow is different. + * Therefore we can be faster by comparing the map and the miniflow in a + * single memcmp(). + * _ netdev_flow_key's miniflow has always inline values. + * - These functions can be inlined by the compiler. + * + * The following assertions make sure that what we're doing with miniflow is + * safe + */ +BUILD_ASSERT_DECL(offsetof(struct miniflow, inline_values) + == sizeof(uint64_t)); - return netdev_flow; +/* Given the number of bits set in the miniflow map, returns the size of the + * 'netdev_flow_key.mf' */ +static inline uint32_t +netdev_flow_key_size(uint32_t flow_u32s) +{ + return offsetof(struct miniflow, inline_values) + + MINIFLOW_VALUES_SIZE(flow_u32s); } -static struct dp_netdev_flow * -dp_netdev_find_flow(const struct dp_netdev *dp, const struct flow *flow) - OVS_REQ_RDLOCK(dp->cls.rwlock) +static inline bool +netdev_flow_key_equal(const struct netdev_flow_key *a, + const struct netdev_flow_key *b) { - struct dp_netdev_flow *netdev_flow; - - HMAP_FOR_EACH_WITH_HASH (netdev_flow, node, flow_hash(flow, 0), - &dp->flow_table) { - if (flow_equal(&netdev_flow->flow, flow)) { - return netdev_flow; - } - } + /* 'b->len' may be not set yet. */ + return a->hash == b->hash && !memcmp(&a->mf, &b->mf, a->len); +} + +/* Used to compare 'netdev_flow_key' in the exact match cache to a miniflow. + * The maps are compared bitwise, so both 'key->mf' 'mf' must have been + * generated by miniflow_extract. */ +static inline bool +netdev_flow_key_equal_mf(const struct netdev_flow_key *key, + const struct miniflow *mf) +{ + return !memcmp(&key->mf, mf, key->len); +} + +static inline void +netdev_flow_key_clone(struct netdev_flow_key *dst, + const struct netdev_flow_key *src) +{ + memcpy(dst, src, + offsetof(struct netdev_flow_key, mf) + src->len); +} + +/* Slow. */ +static void +netdev_flow_key_from_flow(struct netdev_flow_key *dst, + const struct flow *src) +{ + struct dp_packet packet; + uint64_t buf_stub[512 / 8]; + + miniflow_initialize(&dst->mf, dst->buf); + + dp_packet_use_stub(&packet, buf_stub, sizeof buf_stub); + pkt_metadata_from_flow(&packet.md, src); + flow_compose(&packet, src); + miniflow_extract(&packet, &dst->mf); + dp_packet_uninit(&packet); + + dst->len = netdev_flow_key_size(count_1bits(dst->mf.map)); + dst->hash = 0; /* Not computed yet. */ +} + +/* Initialize a netdev_flow_key 'mask' from 'match'. */ +static inline void +netdev_flow_mask_init(struct netdev_flow_key *mask, + const struct match *match) +{ + const uint64_t *mask_u64 = (const uint64_t *) &match->wc.masks; + uint64_t *dst = mask->mf.inline_values; + uint64_t map, mask_map = 0; + uint32_t hash = 0; + int n; + + /* Only check masks that make sense for the flow. */ + map = flow_wc_map(&match->flow); + + while (map) { + uint64_t rm1bit = rightmost_1bit(map); + int i = raw_ctz(map); + + if (mask_u64[i]) { + mask_map |= rm1bit; + *dst++ = mask_u64[i]; + hash = hash_add64(hash, mask_u64[i]); + } + map -= rm1bit; + } + + mask->mf.values_inline = true; + mask->mf.map = mask_map; + + hash = hash_add64(hash, mask_map); + + n = dst - mask->mf.inline_values; + + mask->hash = hash_finish(hash, n * 8); + mask->len = netdev_flow_key_size(n); +} + +/* Initializes 'dst' as a copy of 'src' masked with 'mask'. */ +static inline void +netdev_flow_key_init_masked(struct netdev_flow_key *dst, + const struct flow *flow, + const struct netdev_flow_key *mask) +{ + uint64_t *dst_u64 = dst->mf.inline_values; + const uint64_t *mask_u64 = mask->mf.inline_values; + uint32_t hash = 0; + uint64_t value; + + dst->len = mask->len; + dst->mf.values_inline = true; + dst->mf.map = mask->mf.map; + + FLOW_FOR_EACH_IN_MAP(value, flow, mask->mf.map) { + *dst_u64 = value & *mask_u64++; + hash = hash_add64(hash, *dst_u64++); + } + dst->hash = hash_finish(hash, (dst_u64 - dst->mf.inline_values) * 8); +} + +/* Iterate through all netdev_flow_key u64 values specified by 'MAP' */ +#define NETDEV_FLOW_KEY_FOR_EACH_IN_MAP(VALUE, KEY, MAP) \ + for (struct mf_for_each_in_map_aux aux__ \ + = { (KEY)->mf.inline_values, (KEY)->mf.map, MAP }; \ + mf_get_next_in_map(&aux__, &(VALUE)); \ + ) + +/* Returns a hash value for the bits of 'key' where there are 1-bits in + * 'mask'. */ +static inline uint32_t +netdev_flow_key_hash_in_mask(const struct netdev_flow_key *key, + const struct netdev_flow_key *mask) +{ + const uint64_t *p = mask->mf.inline_values; + uint32_t hash = 0; + uint64_t key_u64; + + NETDEV_FLOW_KEY_FOR_EACH_IN_MAP(key_u64, key, mask->mf.map) { + hash = hash_add64(hash, key_u64 & *p++); + } + + return hash_finish(hash, (p - mask->mf.inline_values) * 8); +} + +static inline bool +emc_entry_alive(struct emc_entry *ce) +{ + return ce->flow && !ce->flow->dead; +} + +static void +emc_clear_entry(struct emc_entry *ce) +{ + if (ce->flow) { + dp_netdev_flow_unref(ce->flow); + ce->flow = NULL; + } +} + +static inline void +emc_change_entry(struct emc_entry *ce, struct dp_netdev_flow *flow, + const struct netdev_flow_key *key) +{ + if (ce->flow != flow) { + if (ce->flow) { + dp_netdev_flow_unref(ce->flow); + } + + if (dp_netdev_flow_ref(flow)) { + ce->flow = flow; + } else { + ce->flow = NULL; + } + } + if (key) { + netdev_flow_key_clone(&ce->key, key); + } +} + +static inline void +emc_insert(struct emc_cache *cache, const struct netdev_flow_key *key, + struct dp_netdev_flow *flow) +{ + struct emc_entry *to_be_replaced = NULL; + struct emc_entry *current_entry; + + EMC_FOR_EACH_POS_WITH_HASH(cache, current_entry, key->hash) { + if (netdev_flow_key_equal(¤t_entry->key, key)) { + /* We found the entry with the 'mf' miniflow */ + emc_change_entry(current_entry, flow, NULL); + return; + } + + /* Replacement policy: put the flow in an empty (not alive) entry, or + * in the first entry where it can be */ + if (!to_be_replaced + || (emc_entry_alive(to_be_replaced) + && !emc_entry_alive(current_entry)) + || current_entry->key.hash < to_be_replaced->key.hash) { + to_be_replaced = current_entry; + } + } + /* We didn't find the miniflow in the cache. + * The 'to_be_replaced' entry is where the new flow will be stored */ + + emc_change_entry(to_be_replaced, flow, key); +} + +static inline struct dp_netdev_flow * +emc_lookup(struct emc_cache *cache, const struct netdev_flow_key *key) +{ + struct emc_entry *current_entry; + + EMC_FOR_EACH_POS_WITH_HASH(cache, current_entry, key->hash) { + if (current_entry->key.hash == key->hash + && emc_entry_alive(current_entry) + && netdev_flow_key_equal_mf(¤t_entry->key, &key->mf)) { + + /* We found the entry with the 'key->mf' miniflow */ + return current_entry->flow; + } + } + + return NULL; +} + +static struct dp_netdev_flow * +dp_netdev_pmd_lookup_flow(const struct dp_netdev_pmd_thread *pmd, + const struct netdev_flow_key *key) +{ + struct dp_netdev_flow *netdev_flow; + struct dpcls_rule *rule; + + dpcls_lookup(&pmd->cls, key, &rule, 1); + netdev_flow = dp_netdev_flow_cast(rule); + + return netdev_flow; +} + +static struct dp_netdev_flow * +dp_netdev_pmd_find_flow(const struct dp_netdev_pmd_thread *pmd, + const ovs_u128 *ufidp, const struct nlattr *key, + size_t key_len) +{ + struct dp_netdev_flow *netdev_flow; + struct flow flow; + ovs_u128 ufid; + + /* If a UFID is not provided, determine one based on the key. */ + if (!ufidp && key && key_len + && !dpif_netdev_flow_from_nlattrs(key, key_len, &flow)) { + dpif_flow_hash(pmd->dp->dpif, &flow, sizeof flow, &ufid); + ufidp = &ufid; + } + + if (ufidp) { + CMAP_FOR_EACH_WITH_HASH (netdev_flow, node, dp_netdev_flow_hash(ufidp), + &pmd->flow_table) { + if (ovs_u128_equals(&netdev_flow->ufid, ufidp)) { + return netdev_flow; + } + } + } return NULL; } static void -get_dpif_flow_stats(struct dp_netdev_flow *netdev_flow, +get_dpif_flow_stats(const struct dp_netdev_flow *netdev_flow_, struct dpif_flow_stats *stats) { - struct dp_netdev_flow_stats *bucket; - size_t i; + struct dp_netdev_flow *netdev_flow; + unsigned long long n; + long long used; + uint16_t flags; + + netdev_flow = CONST_CAST(struct dp_netdev_flow *, netdev_flow_); + + atomic_read_relaxed(&netdev_flow->stats.packet_count, &n); + stats->n_packets = n; + atomic_read_relaxed(&netdev_flow->stats.byte_count, &n); + stats->n_bytes = n; + atomic_read_relaxed(&netdev_flow->stats.used, &used); + stats->used = used; + atomic_read_relaxed(&netdev_flow->stats.tcp_flags, &flags); + stats->tcp_flags = flags; +} + +/* Converts to the dpif_flow format, using 'key_buf' and 'mask_buf' for + * storing the netlink-formatted key/mask. 'key_buf' may be the same as + * 'mask_buf'. Actions will be returned without copying, by relying on RCU to + * protect them. */ +static void +dp_netdev_flow_to_dpif_flow(const struct dp_netdev_flow *netdev_flow, + struct ofpbuf *key_buf, struct ofpbuf *mask_buf, + struct dpif_flow *flow, bool terse) +{ + if (terse) { + memset(flow, 0, sizeof *flow); + } else { + struct flow_wildcards wc; + struct dp_netdev_actions *actions; + size_t offset; + + miniflow_expand(&netdev_flow->cr.mask->mf, &wc.masks); - memset(stats, 0, sizeof *stats); - OVSTHREAD_STATS_FOR_EACH_BUCKET (bucket, i, &netdev_flow->stats) { - ovs_mutex_lock(&bucket->mutex); - stats->n_packets += bucket->packet_count; - stats->n_bytes += bucket->byte_count; - stats->used = MAX(stats->used, bucket->used); - stats->tcp_flags |= bucket->tcp_flags; - ovs_mutex_unlock(&bucket->mutex); + /* Key */ + offset = key_buf->size; + flow->key = ofpbuf_tail(key_buf); + odp_flow_key_from_flow(key_buf, &netdev_flow->flow, &wc.masks, + netdev_flow->flow.in_port.odp_port, true); + flow->key_len = key_buf->size - offset; + + /* Mask */ + offset = mask_buf->size; + flow->mask = ofpbuf_tail(mask_buf); + odp_flow_key_from_mask(mask_buf, &wc.masks, &netdev_flow->flow, + odp_to_u32(wc.masks.in_port.odp_port), + SIZE_MAX, true); + flow->mask_len = mask_buf->size - offset; + + /* Actions */ + actions = dp_netdev_flow_get_actions(netdev_flow); + flow->actions = actions->actions; + flow->actions_len = actions->size; } + + flow->ufid = netdev_flow->ufid; + flow->ufid_present = true; + flow->pmd_id = netdev_flow->pmd_id; + get_dpif_flow_stats(netdev_flow, &flow->stats); } static int @@ -1189,112 +1938,84 @@ } static int -dpif_netdev_flow_get(const struct dpif *dpif, - const struct nlattr *nl_key, size_t nl_key_len, - struct ofpbuf **bufp, - struct nlattr **maskp, size_t *mask_len, - struct nlattr **actionsp, size_t *actions_len, - struct dpif_flow_stats *stats) +dpif_netdev_flow_get(const struct dpif *dpif, const struct dpif_flow_get *get) { struct dp_netdev *dp = get_dp_netdev(dpif); struct dp_netdev_flow *netdev_flow; - struct flow key; - int error; + struct dp_netdev_pmd_thread *pmd; + unsigned pmd_id = get->pmd_id == PMD_ID_NULL + ? NON_PMD_CORE_ID : get->pmd_id; + int error = 0; - error = dpif_netdev_flow_from_nlattrs(nl_key, nl_key_len, &key); - if (error) { - return error; + pmd = dp_netdev_get_pmd(dp, pmd_id); + if (!pmd) { + return EINVAL; } - fat_rwlock_rdlock(&dp->cls.rwlock); - netdev_flow = dp_netdev_find_flow(dp, &key); - fat_rwlock_unlock(&dp->cls.rwlock); - + netdev_flow = dp_netdev_pmd_find_flow(pmd, get->ufid, get->key, + get->key_len); if (netdev_flow) { - if (stats) { - get_dpif_flow_stats(netdev_flow, stats); - } - - if (maskp || actionsp) { - struct dp_netdev_actions *actions; - size_t len = 0; - - actions = dp_netdev_flow_get_actions(netdev_flow); - len += maskp ? sizeof(struct odputil_keybuf) : 0; - len += actionsp ? actions->size : 0; - - *bufp = ofpbuf_new(len); - if (maskp) { - struct flow_wildcards wc; - - minimask_expand(&netdev_flow->cr.match.mask, &wc); - odp_flow_key_from_mask(*bufp, &wc.masks, &netdev_flow->flow, - odp_to_u32(wc.masks.in_port.odp_port), - SIZE_MAX); - *maskp = ofpbuf_data(*bufp); - *mask_len = ofpbuf_size(*bufp); - } - if (actionsp) { - struct dp_netdev_actions *actions; - - actions = dp_netdev_flow_get_actions(netdev_flow); - *actionsp = ofpbuf_put(*bufp, actions->actions, actions->size); - *actions_len = actions->size; - } - } - } else { + dp_netdev_flow_to_dpif_flow(netdev_flow, get->buffer, get->buffer, + get->flow, false); + } else { error = ENOENT; } + dp_netdev_pmd_unref(pmd); + return error; } -static int -dp_netdev_flow_add(struct dp_netdev *dp, const struct flow *flow, - const struct flow_wildcards *wc, - const struct nlattr *actions, - size_t actions_len) - OVS_REQUIRES(dp->flow_mutex) -{ - struct dp_netdev_flow *netdev_flow; - struct match match; - - netdev_flow = xzalloc(sizeof *netdev_flow); - *CONST_CAST(struct flow *, &netdev_flow->flow) = *flow; - - ovsthread_stats_init(&netdev_flow->stats); - - ovsrcu_set(&netdev_flow->actions, - dp_netdev_actions_create(actions, actions_len)); - - match_init(&match, flow, wc); - cls_rule_init(CONST_CAST(struct cls_rule *, &netdev_flow->cr), - &match, NETDEV_RULE_PRIORITY); - fat_rwlock_wrlock(&dp->cls.rwlock); - classifier_insert(&dp->cls, - CONST_CAST(struct cls_rule *, &netdev_flow->cr)); - hmap_insert(&dp->flow_table, - CONST_CAST(struct hmap_node *, &netdev_flow->node), - flow_hash(flow, 0)); - fat_rwlock_unlock(&dp->cls.rwlock); - - return 0; -} +static struct dp_netdev_flow * +dp_netdev_flow_add(struct dp_netdev_pmd_thread *pmd, + struct match *match, const ovs_u128 *ufid, + const struct nlattr *actions, size_t actions_len) + OVS_REQUIRES(pmd->flow_mutex) +{ + struct dp_netdev_flow *flow; + struct netdev_flow_key mask; + + netdev_flow_mask_init(&mask, match); + /* Make sure wc does not have metadata. */ + ovs_assert(!(mask.mf.map & (MINIFLOW_MAP(metadata) | MINIFLOW_MAP(regs)))); + + /* Do not allocate extra space. */ + flow = xmalloc(sizeof *flow - sizeof flow->cr.flow.mf + mask.len); + memset(&flow->stats, 0, sizeof flow->stats); + flow->dead = false; + flow->batch = NULL; + *CONST_CAST(unsigned *, &flow->pmd_id) = pmd->core_id; + *CONST_CAST(struct flow *, &flow->flow) = match->flow; + *CONST_CAST(ovs_u128 *, &flow->ufid) = *ufid; + ovs_refcount_init(&flow->ref_cnt); + ovsrcu_set(&flow->actions, dp_netdev_actions_create(actions, actions_len)); + + netdev_flow_key_init_masked(&flow->cr.flow, &match->flow, &mask); + dpcls_insert(&pmd->cls, &flow->cr, &mask); + + cmap_insert(&pmd->flow_table, CONST_CAST(struct cmap_node *, &flow->node), + dp_netdev_flow_hash(&flow->ufid)); + + if (OVS_UNLIKELY(VLOG_IS_DBG_ENABLED())) { + struct match match; + struct ds ds = DS_EMPTY_INITIALIZER; + + match.flow = flow->flow; + miniflow_expand(&flow->cr.mask->mf, &match.wc.masks); + + ds_put_cstr(&ds, "flow_add: "); + odp_format_ufid(ufid, &ds); + ds_put_cstr(&ds, " "); + match_format(&match, &ds, OFP_DEFAULT_PRIORITY); + ds_put_cstr(&ds, ", actions:"); + format_odp_actions(&ds, actions, actions_len); -static void -clear_stats(struct dp_netdev_flow *netdev_flow) -{ - struct dp_netdev_flow_stats *bucket; - size_t i; + VLOG_DBG_RL(&upcall_rl, "%s", ds_cstr(&ds)); - OVSTHREAD_STATS_FOR_EACH_BUCKET (bucket, i, &netdev_flow->stats) { - ovs_mutex_lock(&bucket->mutex); - bucket->used = 0; - bucket->packet_count = 0; - bucket->byte_count = 0; - bucket->tcp_flags = 0; - ovs_mutex_unlock(&bucket->mutex); + ds_destroy(&ds); } + + return flow; } static int @@ -1302,33 +2023,52 @@ { struct dp_netdev *dp = get_dp_netdev(dpif); struct dp_netdev_flow *netdev_flow; - struct flow flow; - struct miniflow miniflow; - struct flow_wildcards wc; + struct netdev_flow_key key; + struct dp_netdev_pmd_thread *pmd; + struct match match; + ovs_u128 ufid; + unsigned pmd_id = put->pmd_id == PMD_ID_NULL + ? NON_PMD_CORE_ID : put->pmd_id; int error; - error = dpif_netdev_flow_from_nlattrs(put->key, put->key_len, &flow); + error = dpif_netdev_flow_from_nlattrs(put->key, put->key_len, &match.flow); if (error) { return error; } error = dpif_netdev_mask_from_nlattrs(put->key, put->key_len, put->mask, put->mask_len, - &flow, &wc.masks); + &match.flow, &match.wc.masks); if (error) { return error; } - miniflow_init(&miniflow, &flow); - ovs_mutex_lock(&dp->flow_mutex); - netdev_flow = dp_netdev_lookup_flow(dp, &miniflow); + pmd = dp_netdev_get_pmd(dp, pmd_id); + if (!pmd) { + return EINVAL; + } + + /* Must produce a netdev_flow_key for lookup. + * This interface is no longer performance critical, since it is not used + * for upcall processing any more. */ + netdev_flow_key_from_flow(&key, &match.flow); + + if (put->ufid) { + ufid = *put->ufid; + } else { + dpif_flow_hash(dpif, &match.flow, sizeof match.flow, &ufid); + } + + ovs_mutex_lock(&pmd->flow_mutex); + netdev_flow = dp_netdev_pmd_lookup_flow(pmd, &key); if (!netdev_flow) { if (put->flags & DPIF_FP_CREATE) { - if (hmap_count(&dp->flow_table) < MAX_FLOWS) { + if (cmap_count(&pmd->flow_table) < MAX_FLOWS) { if (put->stats) { memset(put->stats, 0, sizeof *put->stats); } - error = dp_netdev_flow_add(dp, &flow, &wc, put->actions, - put->actions_len); + dp_netdev_flow_add(pmd, &match, &ufid, put->actions, + put->actions_len); + error = 0; } else { error = EFBIG; } @@ -1337,7 +2077,7 @@ } } else { if (put->flags & DPIF_FP_MODIFY - && flow_equal(&flow, &netdev_flow->flow)) { + && flow_equal(&match.flow, &netdev_flow->flow)) { struct dp_netdev_actions *new_actions; struct dp_netdev_actions *old_actions; @@ -1351,7 +2091,16 @@ get_dpif_flow_stats(netdev_flow, put->stats); } if (put->flags & DPIF_FP_ZERO_STATS) { - clear_stats(netdev_flow); + /* XXX: The userspace datapath uses thread local statistics + * (for flows), which should be updated only by the owning + * thread. Since we cannot write on stats memory here, + * we choose not to support this flag. Please note: + * - This feature is currently used only by dpctl commands with + * option --clear. + * - Should the need arise, this operation can be implemented + * by keeping a base value (to be update here) for each + * counter, and subtracting it before outputting the stats */ + error = EOPNOTSUPP; } ovsrcu_postpone(dp_netdev_actions_free, old_actions); @@ -1362,8 +2111,8 @@ error = EINVAL; } } - ovs_mutex_unlock(&dp->flow_mutex); - miniflow_destroy(&miniflow); + ovs_mutex_unlock(&pmd->flow_mutex); + dp_netdev_pmd_unref(pmd); return error; } @@ -1373,258 +2122,319 @@ { struct dp_netdev *dp = get_dp_netdev(dpif); struct dp_netdev_flow *netdev_flow; - struct flow key; - int error; + struct dp_netdev_pmd_thread *pmd; + unsigned pmd_id = del->pmd_id == PMD_ID_NULL + ? NON_PMD_CORE_ID : del->pmd_id; + int error = 0; - error = dpif_netdev_flow_from_nlattrs(del->key, del->key_len, &key); - if (error) { - return error; + pmd = dp_netdev_get_pmd(dp, pmd_id); + if (!pmd) { + return EINVAL; } - ovs_mutex_lock(&dp->flow_mutex); - fat_rwlock_wrlock(&dp->cls.rwlock); - netdev_flow = dp_netdev_find_flow(dp, &key); + ovs_mutex_lock(&pmd->flow_mutex); + netdev_flow = dp_netdev_pmd_find_flow(pmd, del->ufid, del->key, + del->key_len); if (netdev_flow) { if (del->stats) { get_dpif_flow_stats(netdev_flow, del->stats); } - dp_netdev_remove_flow(dp, netdev_flow); + dp_netdev_pmd_remove_flow(pmd, netdev_flow); } else { error = ENOENT; } - fat_rwlock_unlock(&dp->cls.rwlock); - ovs_mutex_unlock(&dp->flow_mutex); + ovs_mutex_unlock(&pmd->flow_mutex); + dp_netdev_pmd_unref(pmd); return error; } -struct dp_netdev_flow_state { - struct odputil_keybuf keybuf; - struct odputil_keybuf maskbuf; - struct dpif_flow_stats stats; -}; - -struct dp_netdev_flow_iter { - uint32_t bucket; - uint32_t offset; +struct dpif_netdev_flow_dump { + struct dpif_flow_dump up; + struct cmap_position poll_thread_pos; + struct cmap_position flow_pos; + struct dp_netdev_pmd_thread *cur_pmd; int status; struct ovs_mutex mutex; }; -static void -dpif_netdev_flow_dump_state_init(void **statep) +static struct dpif_netdev_flow_dump * +dpif_netdev_flow_dump_cast(struct dpif_flow_dump *dump) { - struct dp_netdev_flow_state *state; - - *statep = state = xmalloc(sizeof *state); + return CONTAINER_OF(dump, struct dpif_netdev_flow_dump, up); } -static void -dpif_netdev_flow_dump_state_uninit(void *state_) +static struct dpif_flow_dump * +dpif_netdev_flow_dump_create(const struct dpif *dpif_, bool terse) { - struct dp_netdev_flow_state *state = state_; + struct dpif_netdev_flow_dump *dump; - free(state); + dump = xzalloc(sizeof *dump); + dpif_flow_dump_init(&dump->up, dpif_); + dump->up.terse = terse; + ovs_mutex_init(&dump->mutex); + + return &dump->up; } static int -dpif_netdev_flow_dump_start(const struct dpif *dpif OVS_UNUSED, void **iterp) +dpif_netdev_flow_dump_destroy(struct dpif_flow_dump *dump_) { - struct dp_netdev_flow_iter *iter; + struct dpif_netdev_flow_dump *dump = dpif_netdev_flow_dump_cast(dump_); - *iterp = iter = xmalloc(sizeof *iter); - iter->bucket = 0; - iter->offset = 0; - iter->status = 0; - ovs_mutex_init(&iter->mutex); + ovs_mutex_destroy(&dump->mutex); + free(dump); return 0; } -/* XXX the caller must use 'actions' without quiescing */ -static int -dpif_netdev_flow_dump_next(const struct dpif *dpif, void *iter_, void *state_, - const struct nlattr **key, size_t *key_len, - const struct nlattr **mask, size_t *mask_len, - const struct nlattr **actions, size_t *actions_len, - const struct dpif_flow_stats **stats) -{ - struct dp_netdev_flow_iter *iter = iter_; - struct dp_netdev_flow_state *state = state_; - struct dp_netdev *dp = get_dp_netdev(dpif); - struct dp_netdev_flow *netdev_flow; - struct flow_wildcards wc; - int error; - - ovs_mutex_lock(&iter->mutex); - error = iter->status; - if (!error) { - struct hmap_node *node; - - fat_rwlock_rdlock(&dp->cls.rwlock); - node = hmap_at_position(&dp->flow_table, &iter->bucket, &iter->offset); - if (node) { - netdev_flow = CONTAINER_OF(node, struct dp_netdev_flow, node); - } - fat_rwlock_unlock(&dp->cls.rwlock); - if (!node) { - iter->status = error = EOF; - } - } - ovs_mutex_unlock(&iter->mutex); - if (error) { - return error; - } - - minimask_expand(&netdev_flow->cr.match.mask, &wc); - - if (key) { - struct ofpbuf buf; +struct dpif_netdev_flow_dump_thread { + struct dpif_flow_dump_thread up; + struct dpif_netdev_flow_dump *dump; + struct odputil_keybuf keybuf[FLOW_DUMP_MAX_BATCH]; + struct odputil_keybuf maskbuf[FLOW_DUMP_MAX_BATCH]; +}; - ofpbuf_use_stack(&buf, &state->keybuf, sizeof state->keybuf); - odp_flow_key_from_flow(&buf, &netdev_flow->flow, &wc.masks, - netdev_flow->flow.in_port.odp_port); +static struct dpif_netdev_flow_dump_thread * +dpif_netdev_flow_dump_thread_cast(struct dpif_flow_dump_thread *thread) +{ + return CONTAINER_OF(thread, struct dpif_netdev_flow_dump_thread, up); +} - *key = ofpbuf_data(&buf); - *key_len = ofpbuf_size(&buf); - } +static struct dpif_flow_dump_thread * +dpif_netdev_flow_dump_thread_create(struct dpif_flow_dump *dump_) +{ + struct dpif_netdev_flow_dump *dump = dpif_netdev_flow_dump_cast(dump_); + struct dpif_netdev_flow_dump_thread *thread; - if (key && mask) { - struct ofpbuf buf; + thread = xmalloc(sizeof *thread); + dpif_flow_dump_thread_init(&thread->up, &dump->up); + thread->dump = dump; + return &thread->up; +} - ofpbuf_use_stack(&buf, &state->maskbuf, sizeof state->maskbuf); - odp_flow_key_from_mask(&buf, &wc.masks, &netdev_flow->flow, - odp_to_u32(wc.masks.in_port.odp_port), - SIZE_MAX); +static void +dpif_netdev_flow_dump_thread_destroy(struct dpif_flow_dump_thread *thread_) +{ + struct dpif_netdev_flow_dump_thread *thread + = dpif_netdev_flow_dump_thread_cast(thread_); - *mask = ofpbuf_data(&buf); - *mask_len = ofpbuf_size(&buf); - } + free(thread); +} - if (actions || stats) { - if (actions) { - struct dp_netdev_actions *dp_actions = - dp_netdev_flow_get_actions(netdev_flow); +static int +dpif_netdev_flow_dump_next(struct dpif_flow_dump_thread *thread_, + struct dpif_flow *flows, int max_flows) +{ + struct dpif_netdev_flow_dump_thread *thread + = dpif_netdev_flow_dump_thread_cast(thread_); + struct dpif_netdev_flow_dump *dump = thread->dump; + struct dp_netdev_flow *netdev_flows[FLOW_DUMP_MAX_BATCH]; + int n_flows = 0; + int i; - *actions = dp_actions->actions; - *actions_len = dp_actions->size; - } + ovs_mutex_lock(&dump->mutex); + if (!dump->status) { + struct dpif_netdev *dpif = dpif_netdev_cast(thread->up.dpif); + struct dp_netdev *dp = get_dp_netdev(&dpif->dpif); + struct dp_netdev_pmd_thread *pmd = dump->cur_pmd; + int flow_limit = MIN(max_flows, FLOW_DUMP_MAX_BATCH); + + /* First call to dump_next(), extracts the first pmd thread. + * If there is no pmd thread, returns immediately. */ + if (!pmd) { + pmd = dp_netdev_pmd_get_next(dp, &dump->poll_thread_pos); + if (!pmd) { + ovs_mutex_unlock(&dump->mutex); + return n_flows; - if (stats) { - get_dpif_flow_stats(netdev_flow, &state->stats); - *stats = &state->stats; + } } - } - return 0; -} + do { + for (n_flows = 0; n_flows < flow_limit; n_flows++) { + struct cmap_node *node; + + node = cmap_next_position(&pmd->flow_table, &dump->flow_pos); + if (!node) { + break; + } + netdev_flows[n_flows] = CONTAINER_OF(node, + struct dp_netdev_flow, + node); + } + /* When finishing dumping the current pmd thread, moves to + * the next. */ + if (n_flows < flow_limit) { + memset(&dump->flow_pos, 0, sizeof dump->flow_pos); + dp_netdev_pmd_unref(pmd); + pmd = dp_netdev_pmd_get_next(dp, &dump->poll_thread_pos); + if (!pmd) { + dump->status = EOF; + break; + } + } + /* Keeps the reference to next caller. */ + dump->cur_pmd = pmd; -static int -dpif_netdev_flow_dump_done(const struct dpif *dpif OVS_UNUSED, void *iter_) -{ - struct dp_netdev_flow_iter *iter = iter_; + /* If the current dump is empty, do not exit the loop, since the + * remaining pmds could have flows to be dumped. Just dumps again + * on the new 'pmd'. */ + } while (!n_flows); + } + ovs_mutex_unlock(&dump->mutex); + + for (i = 0; i < n_flows; i++) { + struct odputil_keybuf *maskbuf = &thread->maskbuf[i]; + struct odputil_keybuf *keybuf = &thread->keybuf[i]; + struct dp_netdev_flow *netdev_flow = netdev_flows[i]; + struct dpif_flow *f = &flows[i]; + struct ofpbuf key, mask; + + ofpbuf_use_stack(&key, keybuf, sizeof *keybuf); + ofpbuf_use_stack(&mask, maskbuf, sizeof *maskbuf); + dp_netdev_flow_to_dpif_flow(netdev_flow, &key, &mask, f, + dump->up.terse); + } - ovs_mutex_destroy(&iter->mutex); - free(iter); - return 0; + return n_flows; } static int dpif_netdev_execute(struct dpif *dpif, struct dpif_execute *execute) + OVS_NO_THREAD_SAFETY_ANALYSIS { struct dp_netdev *dp = get_dp_netdev(dpif); - struct pkt_metadata *md = &execute->md; - struct { - struct miniflow flow; - uint32_t buf[FLOW_U32S]; - } key; + struct dp_netdev_pmd_thread *pmd; + struct dp_packet *pp; - if (ofpbuf_size(execute->packet) < ETH_HEADER_LEN || - ofpbuf_size(execute->packet) > UINT16_MAX) { + if (dp_packet_size(execute->packet) < ETH_HEADER_LEN || + dp_packet_size(execute->packet) > UINT16_MAX) { return EINVAL; } - /* Extract flow key. */ - miniflow_initialize(&key.flow, key.buf); - miniflow_extract(execute->packet, md, &key.flow); - - ovs_rwlock_rdlock(&dp->port_rwlock); - dp_netdev_execute_actions(dp, &key.flow, execute->packet, false, md, - execute->actions, execute->actions_len); - ovs_rwlock_unlock(&dp->port_rwlock); + /* Tries finding the 'pmd'. If NULL is returned, that means + * the current thread is a non-pmd thread and should use + * dp_netdev_get_pmd(dp, NON_PMD_CORE_ID). */ + pmd = ovsthread_getspecific(dp->per_pmd_key); + if (!pmd) { + pmd = dp_netdev_get_pmd(dp, NON_PMD_CORE_ID); + } + + /* If the current thread is non-pmd thread, acquires + * the 'non_pmd_mutex'. */ + if (pmd->core_id == NON_PMD_CORE_ID) { + ovs_mutex_lock(&dp->non_pmd_mutex); + ovs_mutex_lock(&dp->port_mutex); + } + + pp = execute->packet; + dp_netdev_execute_actions(pmd, &pp, 1, false, execute->actions, + execute->actions_len); + if (pmd->core_id == NON_PMD_CORE_ID) { + dp_netdev_pmd_unref(pmd); + ovs_mutex_unlock(&dp->port_mutex); + ovs_mutex_unlock(&dp->non_pmd_mutex); + } return 0; } static void -dp_netdev_destroy_all_queues(struct dp_netdev *dp) - OVS_REQ_WRLOCK(dp->queue_rwlock) +dpif_netdev_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops) { size_t i; - dp_netdev_purge_queues(dp); + for (i = 0; i < n_ops; i++) { + struct dpif_op *op = ops[i]; + + switch (op->type) { + case DPIF_OP_FLOW_PUT: + op->error = dpif_netdev_flow_put(dpif, &op->u.flow_put); + break; + + case DPIF_OP_FLOW_DEL: + op->error = dpif_netdev_flow_del(dpif, &op->u.flow_del); + break; - for (i = 0; i < dp->n_handlers; i++) { - struct dp_netdev_queue *q = &dp->handler_queues[i]; + case DPIF_OP_EXECUTE: + op->error = dpif_netdev_execute(dpif, &op->u.execute); + break; - ovs_mutex_destroy(&q->mutex); - seq_destroy(q->seq); + case DPIF_OP_FLOW_GET: + op->error = dpif_netdev_flow_get(dpif, &op->u.flow_get); + break; + } } - free(dp->handler_queues); - dp->handler_queues = NULL; - dp->n_handlers = 0; } -static void -dp_netdev_refresh_queues(struct dp_netdev *dp, uint32_t n_handlers) - OVS_REQ_WRLOCK(dp->queue_rwlock) +/* Returns true if the configuration for rx queues or cpu mask + * is changed. */ +static bool +pmd_config_changed(const struct dp_netdev *dp, size_t rxqs, const char *cmask) { - if (dp->n_handlers != n_handlers) { - size_t i; - - dp_netdev_destroy_all_queues(dp); - - dp->n_handlers = n_handlers; - dp->handler_queues = xzalloc(n_handlers * sizeof *dp->handler_queues); - - for (i = 0; i < n_handlers; i++) { - struct dp_netdev_queue *q = &dp->handler_queues[i]; - - ovs_mutex_init(&q->mutex); - q->seq = seq_create(); + if (dp->n_dpdk_rxqs != rxqs) { + return true; + } else { + if (dp->pmd_cmask != NULL && cmask != NULL) { + return strcmp(dp->pmd_cmask, cmask); + } else { + return (dp->pmd_cmask != NULL || cmask != NULL); } } } +/* Resets pmd threads if the configuration for 'rxq's or cpu mask changes. */ static int -dpif_netdev_recv_set(struct dpif *dpif, bool enable) +dpif_netdev_pmd_set(struct dpif *dpif, unsigned int n_rxqs, const char *cmask) { struct dp_netdev *dp = get_dp_netdev(dpif); - if ((dp->handler_queues != NULL) == enable) { - return 0; - } + if (pmd_config_changed(dp, n_rxqs, cmask)) { + struct dp_netdev_port *port; - fat_rwlock_wrlock(&dp->queue_rwlock); - if (!enable) { - dp_netdev_destroy_all_queues(dp); - } else { - dp_netdev_refresh_queues(dp, 1); - } - fat_rwlock_unlock(&dp->queue_rwlock); + dp_netdev_destroy_all_pmds(dp); - return 0; -} + CMAP_FOR_EACH (port, node, &dp->ports) { + if (netdev_is_pmd(port->netdev)) { + int i, err; + + /* Closes the existing 'rxq's. */ + for (i = 0; i < netdev_n_rxq(port->netdev); i++) { + netdev_rxq_close(port->rxq[i]); + port->rxq[i] = NULL; + } -static int -dpif_netdev_handlers_set(struct dpif *dpif, uint32_t n_handlers) -{ - struct dp_netdev *dp = get_dp_netdev(dpif); + /* Sets the new rx queue config. */ + err = netdev_set_multiq(port->netdev, + ovs_numa_get_n_cores() + 1, + n_rxqs); + if (err && (err != EOPNOTSUPP)) { + VLOG_ERR("Failed to set dpdk interface %s rx_queue to:" + " %u", netdev_get_name(port->netdev), + n_rxqs); + return err; + } + + /* If the set_multiq() above succeeds, reopens the 'rxq's. */ + port->rxq = xrealloc(port->rxq, sizeof *port->rxq + * netdev_n_rxq(port->netdev)); + for (i = 0; i < netdev_n_rxq(port->netdev); i++) { + netdev_rxq_open(port->netdev, &port->rxq[i], i); + } + } + } + dp->n_dpdk_rxqs = n_rxqs; - fat_rwlock_wrlock(&dp->queue_rwlock); - if (dp->handler_queues) { - dp_netdev_refresh_queues(dp, n_handlers); + /* Reconfigures the cpu mask. */ + ovs_numa_set_cpu_mask(cmask); + free(dp->pmd_cmask); + dp->pmd_cmask = cmask ? xstrdup(cmask) : NULL; + + /* Restores the non-pmd. */ + dp_netdev_set_nonpmd(dp); + /* Restores all pmd threads. */ + dp_netdev_reset_pmd_threads(dp); } - fat_rwlock_unlock(&dp->queue_rwlock); return 0; } @@ -1637,172 +2447,129 @@ return 0; } -static bool -dp_netdev_recv_check(const struct dp_netdev *dp, const uint32_t handler_id) - OVS_REQ_RDLOCK(dp->queue_rwlock) + +/* Creates and returns a new 'struct dp_netdev_actions', whose actions are + * a copy of the 'ofpacts_len' bytes of 'ofpacts'. */ +struct dp_netdev_actions * +dp_netdev_actions_create(const struct nlattr *actions, size_t size) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); - - if (!dp->handler_queues) { - VLOG_WARN_RL(&rl, "receiving upcall disabled"); - return false; - } + struct dp_netdev_actions *netdev_actions; - if (handler_id >= dp->n_handlers) { - VLOG_WARN_RL(&rl, "handler index out of bound"); - return false; - } + netdev_actions = xmalloc(sizeof *netdev_actions + size); + memcpy(netdev_actions->actions, actions, size); + netdev_actions->size = size; - return true; + return netdev_actions; } -static int -dpif_netdev_recv(struct dpif *dpif, uint32_t handler_id, - struct dpif_upcall *upcall, struct ofpbuf *buf) +struct dp_netdev_actions * +dp_netdev_flow_get_actions(const struct dp_netdev_flow *flow) { - struct dp_netdev *dp = get_dp_netdev(dpif); - struct dp_netdev_queue *q; - int error = 0; - - fat_rwlock_rdlock(&dp->queue_rwlock); - - if (!dp_netdev_recv_check(dp, handler_id)) { - error = EAGAIN; - goto out; - } - - q = &dp->handler_queues[handler_id]; - ovs_mutex_lock(&q->mutex); - if (q->head != q->tail) { - struct dp_netdev_upcall *u = &q->upcalls[q->tail++ & QUEUE_MASK]; - - *upcall = u->upcall; - - ofpbuf_uninit(buf); - *buf = u->buf; - } else { - error = EAGAIN; - } - ovs_mutex_unlock(&q->mutex); - -out: - fat_rwlock_unlock(&dp->queue_rwlock); - - return error; -} + return ovsrcu_get(struct dp_netdev_actions *, &flow->actions); +} static void -dpif_netdev_recv_wait(struct dpif *dpif, uint32_t handler_id) -{ - struct dp_netdev *dp = get_dp_netdev(dpif); - struct dp_netdev_queue *q; - uint64_t seq; - - fat_rwlock_rdlock(&dp->queue_rwlock); - - if (!dp_netdev_recv_check(dp, handler_id)) { - goto out; - } - - q = &dp->handler_queues[handler_id]; - ovs_mutex_lock(&q->mutex); - seq = seq_read(q->seq); - if (q->head != q->tail) { - poll_immediate_wake(); - } else { - seq_wait(q->seq, seq); - } - - ovs_mutex_unlock(&q->mutex); - -out: - fat_rwlock_unlock(&dp->queue_rwlock); -} - -static void -dpif_netdev_recv_purge(struct dpif *dpif) +dp_netdev_actions_free(struct dp_netdev_actions *actions) { - struct dpif_netdev *dpif_netdev = dpif_netdev_cast(dpif); - - fat_rwlock_wrlock(&dpif_netdev->dp->queue_rwlock); - dp_netdev_purge_queues(dpif_netdev->dp); - fat_rwlock_unlock(&dpif_netdev->dp->queue_rwlock); + free(actions); } -/* Creates and returns a new 'struct dp_netdev_actions', with a reference count - * of 1, whose actions are a copy of from the 'ofpacts_len' bytes of - * 'ofpacts'. */ -struct dp_netdev_actions * -dp_netdev_actions_create(const struct nlattr *actions, size_t size) +static inline unsigned long long +cycles_counter(void) { - struct dp_netdev_actions *netdev_actions; - - netdev_actions = xmalloc(sizeof *netdev_actions); - netdev_actions->actions = xmemdup(actions, size); - netdev_actions->size = size; - - return netdev_actions; +#ifdef DPDK_NETDEV + return rte_get_tsc_cycles(); +#else + return 0; +#endif } -struct dp_netdev_actions * -dp_netdev_flow_get_actions(const struct dp_netdev_flow *flow) +/* Fake mutex to make sure that the calls to cycles_count_* are balanced */ +extern struct ovs_mutex cycles_counter_fake_mutex; + +/* Start counting cycles. Must be followed by 'cycles_count_end()' */ +static inline void +cycles_count_start(struct dp_netdev_pmd_thread *pmd) + OVS_ACQUIRES(&cycles_counter_fake_mutex) + OVS_NO_THREAD_SAFETY_ANALYSIS { - return ovsrcu_get(struct dp_netdev_actions *, &flow->actions); + pmd->last_cycles = cycles_counter(); } -static void -dp_netdev_actions_free(struct dp_netdev_actions *actions) +/* Stop counting cycles and add them to the counter 'type' */ +static inline void +cycles_count_end(struct dp_netdev_pmd_thread *pmd, + enum pmd_cycles_counter_type type) + OVS_RELEASES(&cycles_counter_fake_mutex) + OVS_NO_THREAD_SAFETY_ANALYSIS { - free(actions->actions); - free(actions); + unsigned long long interval = cycles_counter() - pmd->last_cycles; + + non_atomic_ullong_add(&pmd->cycles.n[type], interval); } - static void -dp_netdev_process_rxq_port(struct dp_netdev *dp, - struct dp_netdev_port *port, - struct netdev_rxq *rxq) +dp_netdev_process_rxq_port(struct dp_netdev_pmd_thread *pmd, + struct dp_netdev_port *port, + struct netdev_rxq *rxq) { - struct ofpbuf *packet[NETDEV_MAX_RX_BATCH]; - int error, c; + struct dp_packet *packets[NETDEV_MAX_BURST]; + int error, cnt; - error = netdev_rxq_recv(rxq, packet, &c); + cycles_count_start(pmd); + error = netdev_rxq_recv(rxq, packets, &cnt); + cycles_count_end(pmd, PMD_CYCLES_POLLING); if (!error) { - struct pkt_metadata md = PKT_METADATA_INITIALIZER(port->port_no); int i; - for (i = 0; i < c; i++) { - dp_netdev_port_input(dp, packet[i], &md); - } + *recirc_depth_get() = 0; + + /* XXX: initialize md in netdev implementation. */ + for (i = 0; i < cnt; i++) { + packets[i]->md = port->md; + } + cycles_count_start(pmd); + dp_netdev_input(pmd, packets, cnt); + cycles_count_end(pmd, PMD_CYCLES_PROCESSING); } else if (error != EAGAIN && error != EOPNOTSUPP) { - static struct vlog_rate_limit rl - = VLOG_RATE_LIMIT_INIT(1, 5); + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_ERR_RL(&rl, "error receiving data from %s: %s", - netdev_get_name(port->netdev), - ovs_strerror(error)); + netdev_get_name(port->netdev), ovs_strerror(error)); } } -static void +/* Return true if needs to revalidate datapath flows. */ +static bool dpif_netdev_run(struct dpif *dpif) { struct dp_netdev_port *port; struct dp_netdev *dp = get_dp_netdev(dpif); + struct dp_netdev_pmd_thread *non_pmd = dp_netdev_get_pmd(dp, + NON_PMD_CORE_ID); + uint64_t new_tnl_seq; - ovs_rwlock_rdlock(&dp->port_rwlock); - - HMAP_FOR_EACH (port, node, &dp->ports) { + ovs_mutex_lock(&dp->non_pmd_mutex); + CMAP_FOR_EACH (port, node, &dp->ports) { if (!netdev_is_pmd(port->netdev)) { int i; for (i = 0; i < netdev_n_rxq(port->netdev); i++) { - dp_netdev_process_rxq_port(dp, port, port->rxq[i]); + dp_netdev_process_rxq_port(non_pmd, port, port->rxq[i]); } } } + ovs_mutex_unlock(&dp->non_pmd_mutex); + dp_netdev_pmd_unref(non_pmd); + + tnl_arp_cache_run(); + new_tnl_seq = seq_read(tnl_conf_seq); - ovs_rwlock_unlock(&dp->port_rwlock); + if (dp->last_tnl_conf_seq != new_tnl_seq) { + dp->last_tnl_conf_seq = new_tnl_seq; + return true; + } + return false; } static void @@ -1811,9 +2578,8 @@ struct dp_netdev_port *port; struct dp_netdev *dp = get_dp_netdev(dpif); - ovs_rwlock_rdlock(&dp->port_rwlock); - - HMAP_FOR_EACH (port, node, &dp->ports) { + ovs_mutex_lock(&dp_netdev_mutex); + CMAP_FOR_EACH (port, node, &dp->ports) { if (!netdev_is_pmd(port->netdev)) { int i; @@ -1822,7 +2588,8 @@ } } } - ovs_rwlock_unlock(&dp->port_rwlock); + ovs_mutex_unlock(&dp_netdev_mutex); + seq_wait(tnl_conf_seq, dp->last_tnl_conf_seq); } struct rxq_poll { @@ -1831,44 +2598,48 @@ }; static int -pmd_load_queues(struct pmd_thread *f, +pmd_load_queues(struct dp_netdev_pmd_thread *pmd, struct rxq_poll **ppoll_list, int poll_cnt) { - struct dp_netdev *dp = f->dp; struct rxq_poll *poll_list = *ppoll_list; struct dp_netdev_port *port; - int id = f->id; - int index; - int i; + int n_pmds_on_numa, index, i; /* Simple scheduler for netdev rx polling. */ - ovs_rwlock_rdlock(&dp->port_rwlock); for (i = 0; i < poll_cnt; i++) { - port_unref(poll_list[i].port); + port_unref(poll_list[i].port); } poll_cnt = 0; + n_pmds_on_numa = get_n_pmd_threads_on_numa(pmd->dp, pmd->numa_id); index = 0; - HMAP_FOR_EACH (port, node, &f->dp->ports) { - if (netdev_is_pmd(port->netdev)) { - int i; - - for (i = 0; i < netdev_n_rxq(port->netdev); i++) { - if ((index % dp->n_pmd_threads) == id) { - poll_list = xrealloc(poll_list, sizeof *poll_list * (poll_cnt + 1)); - - port_ref(port); - poll_list[poll_cnt].port = port; - poll_list[poll_cnt].rx = port->rxq[i]; - poll_cnt++; + CMAP_FOR_EACH (port, node, &pmd->dp->ports) { + /* Calls port_try_ref() to prevent the main thread + * from deleting the port. */ + if (port_try_ref(port)) { + if (netdev_is_pmd(port->netdev) + && netdev_get_numa_id(port->netdev) == pmd->numa_id) { + int i; + + for (i = 0; i < netdev_n_rxq(port->netdev); i++) { + if ((index % n_pmds_on_numa) == pmd->index) { + poll_list = xrealloc(poll_list, + sizeof *poll_list * (poll_cnt + 1)); + + port_ref(port); + poll_list[poll_cnt].port = port; + poll_list[poll_cnt].rx = port->rxq[i]; + poll_cnt++; + } + index++; } - index++; } + /* Unrefs the port_try_ref(). */ + port_unref(port); } } - ovs_rwlock_unlock(&dp->port_rwlock); *ppoll_list = poll_list; return poll_cnt; } @@ -1876,45 +2647,53 @@ static void * pmd_thread_main(void *f_) { - struct pmd_thread *f = f_; - struct dp_netdev *dp = f->dp; + struct dp_netdev_pmd_thread *pmd = f_; unsigned int lc = 0; struct rxq_poll *poll_list; - unsigned int port_seq; + unsigned int port_seq = PMD_INITIAL_SEQ; int poll_cnt; int i; poll_cnt = 0; poll_list = NULL; - pmd_thread_setaffinity_cpu(f->id); + /* Stores the pmd thread's 'pmd' to 'per_pmd_key'. */ + ovsthread_setspecific(pmd->dp->per_pmd_key, pmd); + pmd_thread_setaffinity_cpu(pmd->core_id); reload: - poll_cnt = pmd_load_queues(f, &poll_list, poll_cnt); - atomic_read(&f->change_seq, &port_seq); + emc_cache_init(&pmd->flow_cache); + poll_cnt = pmd_load_queues(pmd, &poll_list, poll_cnt); + + /* Signal here to make sure the pmd finishes + * reloading the updated configuration. */ + dp_netdev_pmd_reload_done(pmd); for (;;) { - unsigned int c_port_seq; int i; for (i = 0; i < poll_cnt; i++) { - dp_netdev_process_rxq_port(dp, poll_list[i].port, poll_list[i].rx); + dp_netdev_process_rxq_port(pmd, poll_list[i].port, poll_list[i].rx); } if (lc++ > 1024) { - ovsrcu_quiesce(); + unsigned int seq; - /* TODO: need completely userspace based signaling method. - * to keep this thread entirely in userspace. - * For now using atomic counter. */ lc = 0; - atomic_read_explicit(&f->change_seq, &c_port_seq, memory_order_consume); - if (c_port_seq != port_seq) { + + emc_cache_slow_sweep(&pmd->flow_cache); + ovsrcu_quiesce(); + + atomic_read_relaxed(&pmd->change_seq, &seq); + if (seq != port_seq) { + port_seq = seq; break; } } } - if (!latch_is_set(&f->dp->exit_latch)){ + emc_cache_uninit(&pmd->flow_cache); + + if (!latch_is_set(&pmd->exit_latch)){ goto reload; } @@ -1922,289 +2701,826 @@ port_unref(poll_list[i].port); } + dp_netdev_pmd_reload_done(pmd); + free(poll_list); return NULL; } static void -dp_netdev_set_pmd_threads(struct dp_netdev *dp, int n) +dp_netdev_disable_upcall(struct dp_netdev *dp) + OVS_ACQUIRES(dp->upcall_rwlock) { - int i; + fat_rwlock_wrlock(&dp->upcall_rwlock); +} - if (n == dp->n_pmd_threads) { - return; +static void +dpif_netdev_disable_upcall(struct dpif *dpif) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + struct dp_netdev *dp = get_dp_netdev(dpif); + dp_netdev_disable_upcall(dp); +} + +static void +dp_netdev_enable_upcall(struct dp_netdev *dp) + OVS_RELEASES(dp->upcall_rwlock) +{ + fat_rwlock_unlock(&dp->upcall_rwlock); +} + +static void +dpif_netdev_enable_upcall(struct dpif *dpif) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + struct dp_netdev *dp = get_dp_netdev(dpif); + dp_netdev_enable_upcall(dp); +} + +void +dp_netdev_pmd_reload_done(struct dp_netdev_pmd_thread *pmd) +{ + ovs_mutex_lock(&pmd->cond_mutex); + xpthread_cond_signal(&pmd->cond); + ovs_mutex_unlock(&pmd->cond_mutex); +} + +/* Finds and refs the dp_netdev_pmd_thread on core 'core_id'. Returns + * the pointer if succeeds, otherwise, NULL. + * + * Caller must unrefs the returned reference. */ +static struct dp_netdev_pmd_thread * +dp_netdev_get_pmd(struct dp_netdev *dp, unsigned core_id) +{ + struct dp_netdev_pmd_thread *pmd; + const struct cmap_node *pnode; + + pnode = cmap_find(&dp->poll_threads, hash_int(core_id, 0)); + if (!pnode) { + return NULL; } + pmd = CONTAINER_OF(pnode, struct dp_netdev_pmd_thread, node); - /* Stop existing threads. */ - latch_set(&dp->exit_latch); - dp_netdev_reload_pmd_threads(dp); - for (i = 0; i < dp->n_pmd_threads; i++) { - struct pmd_thread *f = &dp->pmd_threads[i]; - - xpthread_join(f->thread, NULL); - } - latch_poll(&dp->exit_latch); - free(dp->pmd_threads); - - /* Start new threads. */ - dp->pmd_threads = xmalloc(n * sizeof *dp->pmd_threads); - dp->n_pmd_threads = n; - - for (i = 0; i < n; i++) { - struct pmd_thread *f = &dp->pmd_threads[i]; - - f->dp = dp; - f->id = i; - atomic_store(&f->change_seq, 1); - - /* Each thread will distribute all devices rx-queues among - * themselves. */ - f->thread = ovs_thread_create("pmd", pmd_thread_main, f); + return dp_netdev_pmd_try_ref(pmd) ? pmd : NULL; +} + +/* Sets the 'struct dp_netdev_pmd_thread' for non-pmd threads. */ +static void +dp_netdev_set_nonpmd(struct dp_netdev *dp) +{ + struct dp_netdev_pmd_thread *non_pmd; + + non_pmd = xzalloc(sizeof *non_pmd); + dp_netdev_configure_pmd(non_pmd, dp, 0, NON_PMD_CORE_ID, + OVS_NUMA_UNSPEC); +} + +/* Caller must have valid pointer to 'pmd'. */ +static bool +dp_netdev_pmd_try_ref(struct dp_netdev_pmd_thread *pmd) +{ + return ovs_refcount_try_ref_rcu(&pmd->ref_cnt); +} + +static void +dp_netdev_pmd_unref(struct dp_netdev_pmd_thread *pmd) +{ + if (pmd && ovs_refcount_unref(&pmd->ref_cnt) == 1) { + ovsrcu_postpone(dp_netdev_destroy_pmd, pmd); } } - -static void * -dp_netdev_flow_stats_new_cb(void) +/* Given cmap position 'pos', tries to ref the next node. If try_ref() + * fails, keeps checking for next node until reaching the end of cmap. + * + * Caller must unrefs the returned reference. */ +static struct dp_netdev_pmd_thread * +dp_netdev_pmd_get_next(struct dp_netdev *dp, struct cmap_position *pos) +{ + struct dp_netdev_pmd_thread *next; + + do { + struct cmap_node *node; + + node = cmap_next_position(&dp->poll_threads, pos); + next = node ? CONTAINER_OF(node, struct dp_netdev_pmd_thread, node) + : NULL; + } while (next && !dp_netdev_pmd_try_ref(next)); + + return next; +} + +static int +core_id_to_qid(unsigned core_id) { - struct dp_netdev_flow_stats *bucket = xzalloc_cacheline(sizeof *bucket); - ovs_mutex_init(&bucket->mutex); - return bucket; + if (core_id != NON_PMD_CORE_ID) { + return core_id; + } else { + return ovs_numa_get_n_cores(); + } } +/* Configures the 'pmd' based on the input argument. */ static void -dp_netdev_flow_used(struct dp_netdev_flow *netdev_flow, - const struct ofpbuf *packet, - const struct miniflow *key) +dp_netdev_configure_pmd(struct dp_netdev_pmd_thread *pmd, struct dp_netdev *dp, + int index, unsigned core_id, int numa_id) { - uint16_t tcp_flags = miniflow_get_tcp_flags(key); - long long int now = time_msec(); - struct dp_netdev_flow_stats *bucket; + pmd->dp = dp; + pmd->index = index; + pmd->core_id = core_id; + pmd->tx_qid = core_id_to_qid(core_id); + pmd->numa_id = numa_id; - bucket = ovsthread_stats_bucket_get(&netdev_flow->stats, - dp_netdev_flow_stats_new_cb); + ovs_refcount_init(&pmd->ref_cnt); + latch_init(&pmd->exit_latch); + atomic_init(&pmd->change_seq, PMD_INITIAL_SEQ); + xpthread_cond_init(&pmd->cond, NULL); + ovs_mutex_init(&pmd->cond_mutex); + ovs_mutex_init(&pmd->flow_mutex); + dpcls_init(&pmd->cls); + cmap_init(&pmd->flow_table); + /* init the 'flow_cache' since there is no + * actual thread created for NON_PMD_CORE_ID. */ + if (core_id == NON_PMD_CORE_ID) { + emc_cache_init(&pmd->flow_cache); + } + cmap_insert(&dp->poll_threads, CONST_CAST(struct cmap_node *, &pmd->node), + hash_int(core_id, 0)); +} - ovs_mutex_lock(&bucket->mutex); - bucket->used = MAX(now, bucket->used); - bucket->packet_count++; - bucket->byte_count += ofpbuf_size(packet); - bucket->tcp_flags |= tcp_flags; - ovs_mutex_unlock(&bucket->mutex); +static void +dp_netdev_destroy_pmd(struct dp_netdev_pmd_thread *pmd) +{ + dp_netdev_pmd_flow_flush(pmd); + dpcls_destroy(&pmd->cls); + cmap_destroy(&pmd->flow_table); + ovs_mutex_destroy(&pmd->flow_mutex); + latch_destroy(&pmd->exit_latch); + xpthread_cond_destroy(&pmd->cond); + ovs_mutex_destroy(&pmd->cond_mutex); + free(pmd); } -static void * -dp_netdev_stats_new_cb(void) +/* Stops the pmd thread, removes it from the 'dp->poll_threads', + * and unrefs the struct. */ +static void +dp_netdev_del_pmd(struct dp_netdev_pmd_thread *pmd) { - struct dp_netdev_stats *bucket = xzalloc_cacheline(sizeof *bucket); - ovs_mutex_init(&bucket->mutex); - return bucket; + /* Uninit the 'flow_cache' since there is + * no actual thread uninit it for NON_PMD_CORE_ID. */ + if (pmd->core_id == NON_PMD_CORE_ID) { + emc_cache_uninit(&pmd->flow_cache); + } else { + latch_set(&pmd->exit_latch); + dp_netdev_reload_pmd__(pmd); + ovs_numa_unpin_core(pmd->core_id); + xpthread_join(pmd->thread, NULL); + } + cmap_remove(&pmd->dp->poll_threads, &pmd->node, hash_int(pmd->core_id, 0)); + dp_netdev_pmd_unref(pmd); } +/* Destroys all pmd threads. */ static void -dp_netdev_count_packet(struct dp_netdev *dp, enum dp_stat_type type) +dp_netdev_destroy_all_pmds(struct dp_netdev *dp) { - struct dp_netdev_stats *bucket; + struct dp_netdev_pmd_thread *pmd; - bucket = ovsthread_stats_bucket_get(&dp->stats, dp_netdev_stats_new_cb); - ovs_mutex_lock(&bucket->mutex); - bucket->n[type]++; - ovs_mutex_unlock(&bucket->mutex); + CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { + dp_netdev_del_pmd(pmd); + } } +/* Deletes all pmd threads on numa node 'numa_id'. */ static void -dp_netdev_input(struct dp_netdev *dp, struct ofpbuf *packet, - struct pkt_metadata *md) - OVS_REQ_RDLOCK(dp->port_rwlock) +dp_netdev_del_pmds_on_numa(struct dp_netdev *dp, int numa_id) { - struct dp_netdev_flow *netdev_flow; - struct { - struct miniflow flow; - uint32_t buf[FLOW_U32S]; - } key; + struct dp_netdev_pmd_thread *pmd; - if (ofpbuf_size(packet) < ETH_HEADER_LEN) { - ofpbuf_delete(packet); - return; + CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { + if (pmd->numa_id == numa_id) { + dp_netdev_del_pmd(pmd); + } } - miniflow_initialize(&key.flow, key.buf); - miniflow_extract(packet, md, &key.flow); +} - netdev_flow = dp_netdev_lookup_flow(dp, &key.flow); - if (netdev_flow) { - struct dp_netdev_actions *actions; +/* Checks the numa node id of 'netdev' and starts pmd threads for + * the numa node. */ +static void +dp_netdev_set_pmds_on_numa(struct dp_netdev *dp, int numa_id) +{ + int n_pmds; - dp_netdev_flow_used(netdev_flow, packet, &key.flow); + if (!ovs_numa_numa_id_is_valid(numa_id)) { + VLOG_ERR("Cannot create pmd threads due to numa id (%d)" + "invalid", numa_id); + return ; + } - actions = dp_netdev_flow_get_actions(netdev_flow); - dp_netdev_execute_actions(dp, &key.flow, packet, true, md, - actions->actions, actions->size); - dp_netdev_count_packet(dp, DP_STAT_HIT); - } else if (dp->handler_queues) { - dp_netdev_count_packet(dp, DP_STAT_MISS); - dp_netdev_output_userspace(dp, packet, - miniflow_hash_5tuple(&key.flow, 0) - % dp->n_handlers, - DPIF_UC_MISS, &key.flow, NULL); - ofpbuf_delete(packet); + n_pmds = get_n_pmd_threads_on_numa(dp, numa_id); + + /* If there are already pmd threads created for the numa node + * in which 'netdev' is on, do nothing. Else, creates the + * pmd threads for the numa node. */ + if (!n_pmds) { + int can_have, n_unpinned, i; + + n_unpinned = ovs_numa_get_n_unpinned_cores_on_numa(numa_id); + if (!n_unpinned) { + VLOG_ERR("Cannot create pmd threads due to out of unpinned " + "cores on numa node"); + return; + } + + /* If cpu mask is specified, uses all unpinned cores, otherwise + * tries creating NR_PMD_THREADS pmd threads. */ + can_have = dp->pmd_cmask ? n_unpinned : MIN(n_unpinned, NR_PMD_THREADS); + for (i = 0; i < can_have; i++) { + struct dp_netdev_pmd_thread *pmd = xzalloc(sizeof *pmd); + unsigned core_id = ovs_numa_get_unpinned_core_on_numa(numa_id); + + dp_netdev_configure_pmd(pmd, dp, i, core_id, numa_id); + /* Each thread will distribute all devices rx-queues among + * themselves. */ + pmd->thread = ovs_thread_create("pmd", pmd_thread_main, pmd); + } + VLOG_INFO("Created %d pmd threads on numa node %d", can_have, numa_id); + } +} + + +/* Called after pmd threads config change. Restarts pmd threads with + * new configuration. */ +static void +dp_netdev_reset_pmd_threads(struct dp_netdev *dp) +{ + struct dp_netdev_port *port; + + CMAP_FOR_EACH (port, node, &dp->ports) { + if (netdev_is_pmd(port->netdev)) { + int numa_id = netdev_get_numa_id(port->netdev); + + dp_netdev_set_pmds_on_numa(dp, numa_id); + } } } +static char * +dpif_netdev_get_datapath_version(void) +{ + return xstrdup(""); +} + static void -dp_netdev_port_input(struct dp_netdev *dp, struct ofpbuf *packet, - struct pkt_metadata *md) - OVS_REQ_RDLOCK(dp->port_rwlock) +dp_netdev_flow_used(struct dp_netdev_flow *netdev_flow, int cnt, int size, + uint16_t tcp_flags, long long now) { - uint32_t *recirc_depth = recirc_depth_get(); + uint16_t flags; - *recirc_depth = 0; - dp_netdev_input(dp, packet, md); + atomic_store_relaxed(&netdev_flow->stats.used, now); + non_atomic_ullong_add(&netdev_flow->stats.packet_count, cnt); + non_atomic_ullong_add(&netdev_flow->stats.byte_count, size); + atomic_read_relaxed(&netdev_flow->stats.tcp_flags, &flags); + flags |= tcp_flags; + atomic_store_relaxed(&netdev_flow->stats.tcp_flags, flags); +} + +static void +dp_netdev_count_packet(struct dp_netdev_pmd_thread *pmd, + enum dp_stat_type type, int cnt) +{ + non_atomic_ullong_add(&pmd->stats.n[type], cnt); } static int -dp_netdev_output_userspace(struct dp_netdev *dp, struct ofpbuf *packet, - int queue_no, int type, const struct miniflow *key, - const struct nlattr *userdata) +dp_netdev_upcall(struct dp_netdev_pmd_thread *pmd, struct dp_packet *packet_, + struct flow *flow, struct flow_wildcards *wc, ovs_u128 *ufid, + enum dpif_upcall_type type, const struct nlattr *userdata, + struct ofpbuf *actions, struct ofpbuf *put_actions) { - struct dp_netdev_queue *q; - int error; + struct dp_netdev *dp = pmd->dp; - fat_rwlock_rdlock(&dp->queue_rwlock); - q = &dp->handler_queues[queue_no]; - ovs_mutex_lock(&q->mutex); - if (q->head - q->tail < MAX_QUEUE_LEN) { - struct dp_netdev_upcall *u = &q->upcalls[q->head++ & QUEUE_MASK]; - struct dpif_upcall *upcall = &u->upcall; - struct ofpbuf *buf = &u->buf; - size_t buf_size; - struct flow flow; - void *data; - - upcall->type = type; - - /* Allocate buffer big enough for everything. */ - buf_size = ODPUTIL_FLOW_KEY_BYTES; - if (userdata) { - buf_size += NLA_ALIGN(userdata->nla_len); - } - buf_size += ofpbuf_size(packet); - ofpbuf_init(buf, buf_size); - - /* Put ODP flow. */ - miniflow_expand(key, &flow); - odp_flow_key_from_flow(buf, &flow, NULL, flow.in_port.odp_port); - upcall->key = ofpbuf_data(buf); - upcall->key_len = ofpbuf_size(buf); - - /* Put userdata. */ - if (userdata) { - upcall->userdata = ofpbuf_put(buf, userdata, - NLA_ALIGN(userdata->nla_len)); - } - - data = ofpbuf_put(buf, ofpbuf_data(packet), ofpbuf_size(packet)); - ofpbuf_use_stub(&upcall->packet, data, ofpbuf_size(packet)); - ofpbuf_set_size(&upcall->packet, ofpbuf_size(packet)); + if (OVS_UNLIKELY(!dp->upcall_cb)) { + return ENODEV; + } - seq_change(q->seq); + if (OVS_UNLIKELY(!VLOG_DROP_DBG(&upcall_rl))) { + struct ds ds = DS_EMPTY_INITIALIZER; + char *packet_str; + struct ofpbuf key; - error = 0; - } else { - dp_netdev_count_packet(dp, DP_STAT_LOST); - error = ENOBUFS; + ofpbuf_init(&key, 0); + odp_flow_key_from_flow(&key, flow, &wc->masks, flow->in_port.odp_port, + true); + packet_str = ofp_packet_to_string(dp_packet_data(packet_), + dp_packet_size(packet_)); + + odp_flow_key_format(key.data, key.size, &ds); + + VLOG_DBG("%s: %s upcall:\n%s\n%s", dp->name, + dpif_upcall_type_to_string(type), ds_cstr(&ds), packet_str); + + ofpbuf_uninit(&key); + free(packet_str); + + ds_destroy(&ds); } - ovs_mutex_unlock(&q->mutex); - fat_rwlock_unlock(&dp->queue_rwlock); - return error; + return dp->upcall_cb(packet_, flow, ufid, pmd->core_id, type, userdata, + actions, wc, put_actions, dp->upcall_aux); +} + +static inline uint32_t +dpif_netdev_packet_get_rss_hash(struct dp_packet *packet, + const struct miniflow *mf) +{ + uint32_t hash, recirc_depth; + + hash = dp_packet_get_rss_hash(packet); + if (OVS_UNLIKELY(!hash)) { + hash = miniflow_hash_5tuple(mf, 0); + dp_packet_set_rss_hash(packet, hash); + } + + /* The RSS hash must account for the recirculation depth to avoid + * collisions in the exact match cache */ + recirc_depth = *recirc_depth_get_unsafe(); + if (OVS_UNLIKELY(recirc_depth)) { + hash = hash_finish(hash, recirc_depth); + dp_packet_set_rss_hash(packet, hash); + } + return hash; +} + +struct packet_batch { + unsigned int packet_count; + unsigned int byte_count; + uint16_t tcp_flags; + + struct dp_netdev_flow *flow; + + struct dp_packet *packets[NETDEV_MAX_BURST]; +}; + +static inline void +packet_batch_update(struct packet_batch *batch, struct dp_packet *packet, + const struct miniflow *mf) +{ + batch->tcp_flags |= miniflow_get_tcp_flags(mf); + batch->packets[batch->packet_count++] = packet; + batch->byte_count += dp_packet_size(packet); +} + +static inline void +packet_batch_init(struct packet_batch *batch, struct dp_netdev_flow *flow) +{ + flow->batch = batch; + + batch->flow = flow; + batch->packet_count = 0; + batch->byte_count = 0; + batch->tcp_flags = 0; +} + +static inline void +packet_batch_execute(struct packet_batch *batch, + struct dp_netdev_pmd_thread *pmd, + long long now) +{ + struct dp_netdev_actions *actions; + struct dp_netdev_flow *flow = batch->flow; + + dp_netdev_flow_used(flow, batch->packet_count, batch->byte_count, + batch->tcp_flags, now); + + actions = dp_netdev_flow_get_actions(flow); + + dp_netdev_execute_actions(pmd, batch->packets, batch->packet_count, true, + actions->actions, actions->size); +} + +static inline void +dp_netdev_queue_batches(struct dp_packet *pkt, + struct dp_netdev_flow *flow, const struct miniflow *mf, + struct packet_batch *batches, size_t *n_batches) +{ + struct packet_batch *batch = flow->batch; + + if (OVS_LIKELY(batch)) { + packet_batch_update(batch, pkt, mf); + return; + } + + batch = &batches[(*n_batches)++]; + packet_batch_init(batch, flow); + packet_batch_update(batch, pkt, mf); +} + +static inline void +dp_packet_swap(struct dp_packet **a, struct dp_packet **b) +{ + struct dp_packet *tmp = *a; + *a = *b; + *b = tmp; +} + +/* Try to process all ('cnt') the 'packets' using only the exact match cache + * 'flow_cache'. If a flow is not found for a packet 'packets[i]', the + * miniflow is copied into 'keys' and the packet pointer is moved at the + * beginning of the 'packets' array. + * + * The function returns the number of packets that needs to be processed in the + * 'packets' array (they have been moved to the beginning of the vector). + */ +static inline size_t +emc_processing(struct dp_netdev_pmd_thread *pmd, struct dp_packet **packets, + size_t cnt, struct netdev_flow_key *keys, + struct packet_batch batches[], size_t *n_batches) +{ + struct emc_cache *flow_cache = &pmd->flow_cache; + struct netdev_flow_key key; + size_t i, notfound_cnt = 0; + + miniflow_initialize(&key.mf, key.buf); + for (i = 0; i < cnt; i++) { + struct dp_netdev_flow *flow; + + if (OVS_UNLIKELY(dp_packet_size(packets[i]) < ETH_HEADER_LEN)) { + dp_packet_delete(packets[i]); + continue; + } + + if (i != cnt - 1) { + /* Prefetch next packet data */ + OVS_PREFETCH(dp_packet_data(packets[i+1])); + } + + miniflow_extract(packets[i], &key.mf); + key.len = 0; /* Not computed yet. */ + key.hash = dpif_netdev_packet_get_rss_hash(packets[i], &key.mf); + + flow = emc_lookup(flow_cache, &key); + if (OVS_LIKELY(flow)) { + dp_netdev_queue_batches(packets[i], flow, &key.mf, batches, + n_batches); + } else { + if (i != notfound_cnt) { + dp_packet_swap(&packets[i], &packets[notfound_cnt]); + } + + keys[notfound_cnt++] = key; + } + } + + dp_netdev_count_packet(pmd, DP_STAT_EXACT_HIT, cnt - notfound_cnt); + + return notfound_cnt; +} + +static inline void +fast_path_processing(struct dp_netdev_pmd_thread *pmd, + struct dp_packet **packets, size_t cnt, + struct netdev_flow_key *keys, + struct packet_batch batches[], size_t *n_batches) +{ +#if !defined(__CHECKER__) && !defined(_WIN32) + const size_t PKT_ARRAY_SIZE = cnt; +#else + /* Sparse or MSVC doesn't like variable length array. */ + enum { PKT_ARRAY_SIZE = NETDEV_MAX_BURST }; +#endif + struct dpcls_rule *rules[PKT_ARRAY_SIZE]; + struct dp_netdev *dp = pmd->dp; + struct emc_cache *flow_cache = &pmd->flow_cache; + int miss_cnt = 0, lost_cnt = 0; + bool any_miss; + size_t i; + + for (i = 0; i < cnt; i++) { + /* Key length is needed in all the cases, hash computed on demand. */ + keys[i].len = netdev_flow_key_size(count_1bits(keys[i].mf.map)); + } + any_miss = !dpcls_lookup(&pmd->cls, keys, rules, cnt); + if (OVS_UNLIKELY(any_miss) && !fat_rwlock_tryrdlock(&dp->upcall_rwlock)) { + uint64_t actions_stub[512 / 8], slow_stub[512 / 8]; + struct ofpbuf actions, put_actions; + ovs_u128 ufid; + + ofpbuf_use_stub(&actions, actions_stub, sizeof actions_stub); + ofpbuf_use_stub(&put_actions, slow_stub, sizeof slow_stub); + + for (i = 0; i < cnt; i++) { + struct dp_netdev_flow *netdev_flow; + struct ofpbuf *add_actions; + struct match match; + int error; + + if (OVS_LIKELY(rules[i])) { + continue; + } + + /* It's possible that an earlier slow path execution installed + * a rule covering this flow. In this case, it's a lot cheaper + * to catch it here than execute a miss. */ + netdev_flow = dp_netdev_pmd_lookup_flow(pmd, &keys[i]); + if (netdev_flow) { + rules[i] = &netdev_flow->cr; + continue; + } + + miss_cnt++; + + miniflow_expand(&keys[i].mf, &match.flow); + + ofpbuf_clear(&actions); + ofpbuf_clear(&put_actions); + + dpif_flow_hash(dp->dpif, &match.flow, sizeof match.flow, &ufid); + error = dp_netdev_upcall(pmd, packets[i], &match.flow, &match.wc, + &ufid, DPIF_UC_MISS, NULL, &actions, + &put_actions); + if (OVS_UNLIKELY(error && error != ENOSPC)) { + dp_packet_delete(packets[i]); + lost_cnt++; + continue; + } + + /* We can't allow the packet batching in the next loop to execute + * the actions. Otherwise, if there are any slow path actions, + * we'll send the packet up twice. */ + dp_netdev_execute_actions(pmd, &packets[i], 1, true, + actions.data, actions.size); + + add_actions = put_actions.size ? &put_actions : &actions; + if (OVS_LIKELY(error != ENOSPC)) { + /* XXX: There's a race window where a flow covering this packet + * could have already been installed since we last did the flow + * lookup before upcall. This could be solved by moving the + * mutex lock outside the loop, but that's an awful long time + * to be locking everyone out of making flow installs. If we + * move to a per-core classifier, it would be reasonable. */ + ovs_mutex_lock(&pmd->flow_mutex); + netdev_flow = dp_netdev_pmd_lookup_flow(pmd, &keys[i]); + if (OVS_LIKELY(!netdev_flow)) { + netdev_flow = dp_netdev_flow_add(pmd, &match, &ufid, + add_actions->data, + add_actions->size); + } + ovs_mutex_unlock(&pmd->flow_mutex); + + emc_insert(flow_cache, &keys[i], netdev_flow); + } + } + + ofpbuf_uninit(&actions); + ofpbuf_uninit(&put_actions); + fat_rwlock_unlock(&dp->upcall_rwlock); + dp_netdev_count_packet(pmd, DP_STAT_LOST, lost_cnt); + } else if (OVS_UNLIKELY(any_miss)) { + for (i = 0; i < cnt; i++) { + if (OVS_UNLIKELY(!rules[i])) { + dp_packet_delete(packets[i]); + lost_cnt++; + miss_cnt++; + } + } + } + + for (i = 0; i < cnt; i++) { + struct dp_packet *packet = packets[i]; + struct dp_netdev_flow *flow; + + if (OVS_UNLIKELY(!rules[i])) { + continue; + } + + flow = dp_netdev_flow_cast(rules[i]); + + emc_insert(flow_cache, &keys[i], flow); + dp_netdev_queue_batches(packet, flow, &keys[i].mf, batches, n_batches); + } + + dp_netdev_count_packet(pmd, DP_STAT_MASKED_HIT, cnt - miss_cnt); + dp_netdev_count_packet(pmd, DP_STAT_MISS, miss_cnt); + dp_netdev_count_packet(pmd, DP_STAT_LOST, lost_cnt); +} + +static void +dp_netdev_input(struct dp_netdev_pmd_thread *pmd, + struct dp_packet **packets, int cnt) +{ +#if !defined(__CHECKER__) && !defined(_WIN32) + const size_t PKT_ARRAY_SIZE = cnt; +#else + /* Sparse or MSVC doesn't like variable length array. */ + enum { PKT_ARRAY_SIZE = NETDEV_MAX_BURST }; +#endif + struct netdev_flow_key keys[PKT_ARRAY_SIZE]; + struct packet_batch batches[PKT_ARRAY_SIZE]; + long long now = time_msec(); + size_t newcnt, n_batches, i; + + n_batches = 0; + newcnt = emc_processing(pmd, packets, cnt, keys, batches, &n_batches); + if (OVS_UNLIKELY(newcnt)) { + fast_path_processing(pmd, packets, newcnt, keys, batches, &n_batches); + } + + for (i = 0; i < n_batches; i++) { + batches[i].flow->batch = NULL; + } + + for (i = 0; i < n_batches; i++) { + packet_batch_execute(&batches[i], pmd, now); + } } struct dp_netdev_execute_aux { - struct dp_netdev *dp; - const struct miniflow *key; + struct dp_netdev_pmd_thread *pmd; }; static void -dp_execute_cb(void *aux_, struct ofpbuf *packet, - struct pkt_metadata *md, +dpif_netdev_register_upcall_cb(struct dpif *dpif, upcall_callback *cb, + void *aux) +{ + struct dp_netdev *dp = get_dp_netdev(dpif); + dp->upcall_aux = aux; + dp->upcall_cb = cb; +} + +static void +dp_netdev_drop_packets(struct dp_packet **packets, int cnt, bool may_steal) +{ + if (may_steal) { + int i; + + for (i = 0; i < cnt; i++) { + dp_packet_delete(packets[i]); + } + } +} + +static int +push_tnl_action(const struct dp_netdev *dp, + const struct nlattr *attr, + struct dp_packet **packets, int cnt) +{ + struct dp_netdev_port *tun_port; + const struct ovs_action_push_tnl *data; + + data = nl_attr_get(attr); + + tun_port = dp_netdev_lookup_port(dp, u32_to_odp(data->tnl_port)); + if (!tun_port) { + return -EINVAL; + } + netdev_push_header(tun_port->netdev, packets, cnt, data); + + return 0; +} + +static void +dp_netdev_clone_pkt_batch(struct dp_packet **dst_pkts, + struct dp_packet **src_pkts, int cnt) +{ + int i; + + for (i = 0; i < cnt; i++) { + dst_pkts[i] = dp_packet_clone(src_pkts[i]); + } +} + +static void +dp_execute_cb(void *aux_, struct dp_packet **packets, int cnt, const struct nlattr *a, bool may_steal) OVS_NO_THREAD_SAFETY_ANALYSIS { struct dp_netdev_execute_aux *aux = aux_; + uint32_t *depth = recirc_depth_get(); + struct dp_netdev_pmd_thread *pmd = aux->pmd; + struct dp_netdev *dp = pmd->dp; int type = nl_attr_type(a); struct dp_netdev_port *p; - uint32_t *depth = recirc_depth_get(); + int i; switch ((enum ovs_action_attr)type) { case OVS_ACTION_ATTR_OUTPUT: - p = dp_netdev_lookup_port(aux->dp, u32_to_odp(nl_attr_get_u32(a))); - if (p) { - netdev_send(p->netdev, packet, may_steal); - } else if (may_steal) { - ofpbuf_delete(packet); + p = dp_netdev_lookup_port(dp, u32_to_odp(nl_attr_get_u32(a))); + if (OVS_LIKELY(p)) { + netdev_send(p->netdev, pmd->tx_qid, packets, cnt, may_steal); + return; } - break; - case OVS_ACTION_ATTR_USERSPACE: { - const struct nlattr *userdata; + case OVS_ACTION_ATTR_TUNNEL_PUSH: + if (*depth < MAX_RECIRC_DEPTH) { + struct dp_packet *tnl_pkt[NETDEV_MAX_BURST]; + int err; - userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA); + if (!may_steal) { + dp_netdev_clone_pkt_batch(tnl_pkt, packets, cnt); + packets = tnl_pkt; + } - if (aux->dp->n_handlers > 0) { - dp_netdev_output_userspace(aux->dp, packet, - miniflow_hash_5tuple(aux->key, 0) - % aux->dp->n_handlers, - DPIF_UC_ACTION, aux->key, - userdata); + err = push_tnl_action(dp, a, packets, cnt); + if (!err) { + (*depth)++; + dp_netdev_input(pmd, packets, cnt); + (*depth)--; + } else { + dp_netdev_drop_packets(tnl_pkt, cnt, !may_steal); + } + return; } + break; + + case OVS_ACTION_ATTR_TUNNEL_POP: + if (*depth < MAX_RECIRC_DEPTH) { + odp_port_t portno = u32_to_odp(nl_attr_get_u32(a)); - if (may_steal) { - ofpbuf_delete(packet); + p = dp_netdev_lookup_port(dp, portno); + if (p) { + struct dp_packet *tnl_pkt[NETDEV_MAX_BURST]; + int err; + + if (!may_steal) { + dp_netdev_clone_pkt_batch(tnl_pkt, packets, cnt); + packets = tnl_pkt; + } + + err = netdev_pop_header(p->netdev, packets, cnt); + if (!err) { + + for (i = 0; i < cnt; i++) { + packets[i]->md.in_port.odp_port = portno; + } + + (*depth)++; + dp_netdev_input(pmd, packets, cnt); + (*depth)--; + } else { + dp_netdev_drop_packets(tnl_pkt, cnt, !may_steal); + } + return; + } } break; - } - case OVS_ACTION_ATTR_HASH: { - const struct ovs_action_hash *hash_act; - uint32_t hash; - - hash_act = nl_attr_get(a); - if (hash_act->hash_alg == OVS_HASH_ALG_L4) { - /* Hash need not be symmetric, nor does it need to include - * L2 fields. */ - hash = miniflow_hash_5tuple(aux->key, hash_act->hash_basis); - if (!hash) { - hash = 1; /* 0 is not valid */ + case OVS_ACTION_ATTR_USERSPACE: + if (!fat_rwlock_tryrdlock(&dp->upcall_rwlock)) { + const struct nlattr *userdata; + struct ofpbuf actions; + struct flow flow; + ovs_u128 ufid; + + userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA); + ofpbuf_init(&actions, 0); + + for (i = 0; i < cnt; i++) { + int error; + + ofpbuf_clear(&actions); + + flow_extract(packets[i], &flow); + dpif_flow_hash(dp->dpif, &flow, sizeof flow, &ufid); + error = dp_netdev_upcall(pmd, packets[i], &flow, NULL, &ufid, + DPIF_UC_ACTION, userdata,&actions, + NULL); + if (!error || error == ENOSPC) { + dp_netdev_execute_actions(pmd, &packets[i], 1, may_steal, + actions.data, actions.size); + } else if (may_steal) { + dp_packet_delete(packets[i]); + } } + ofpbuf_uninit(&actions); + fat_rwlock_unlock(&dp->upcall_rwlock); - } else { - VLOG_WARN("Unknown hash algorithm specified for the hash action."); - hash = 2; + return; } - - md->dp_hash = hash; break; - } case OVS_ACTION_ATTR_RECIRC: if (*depth < MAX_RECIRC_DEPTH) { - struct pkt_metadata recirc_md = *md; - struct ofpbuf *recirc_packet; + struct dp_packet *recirc_pkts[NETDEV_MAX_BURST]; - recirc_packet = may_steal ? packet : ofpbuf_clone(packet); - recirc_md.recirc_id = nl_attr_get_u32(a); + if (!may_steal) { + dp_netdev_clone_pkt_batch(recirc_pkts, packets, cnt); + packets = recirc_pkts; + } + + for (i = 0; i < cnt; i++) { + packets[i]->md.recirc_id = nl_attr_get_u32(a); + } (*depth)++; - dp_netdev_input(aux->dp, recirc_packet, &recirc_md); + dp_netdev_input(pmd, packets, cnt); (*depth)--; - break; - } else { - if (may_steal) { - ofpbuf_delete(packet); - } - VLOG_WARN("Packet dropped. Max recirculation depth exceeded."); + return; } + + VLOG_WARN("Packet dropped. Max recirculation depth exceeded."); break; case OVS_ACTION_ATTR_PUSH_VLAN: @@ -2212,27 +3528,32 @@ case OVS_ACTION_ATTR_PUSH_MPLS: case OVS_ACTION_ATTR_POP_MPLS: case OVS_ACTION_ATTR_SET: + case OVS_ACTION_ATTR_SET_MASKED: case OVS_ACTION_ATTR_SAMPLE: + case OVS_ACTION_ATTR_HASH: case OVS_ACTION_ATTR_UNSPEC: case __OVS_ACTION_ATTR_MAX: OVS_NOT_REACHED(); } + + dp_netdev_drop_packets(packets, cnt, may_steal); } static void -dp_netdev_execute_actions(struct dp_netdev *dp, const struct miniflow *key, - struct ofpbuf *packet, bool may_steal, - struct pkt_metadata *md, +dp_netdev_execute_actions(struct dp_netdev_pmd_thread *pmd, + struct dp_packet **packets, int cnt, + bool may_steal, const struct nlattr *actions, size_t actions_len) { - struct dp_netdev_execute_aux aux = {dp, key}; + struct dp_netdev_execute_aux aux = { pmd }; - odp_execute_actions(&aux, packet, may_steal, md, - actions, actions_len, dp_execute_cb); + odp_execute_actions(&aux, packets, cnt, may_steal, actions, + actions_len, dp_execute_cb); } const struct dpif_class dpif_netdev_class = { "netdev", + dpif_netdev_init, dpif_netdev_enumerate, dpif_netdev_port_open_type, dpif_netdev_open, @@ -2251,31 +3572,32 @@ dpif_netdev_port_dump_done, dpif_netdev_port_poll, dpif_netdev_port_poll_wait, - dpif_netdev_flow_get, - dpif_netdev_flow_put, - dpif_netdev_flow_del, dpif_netdev_flow_flush, - dpif_netdev_flow_dump_state_init, - dpif_netdev_flow_dump_start, + dpif_netdev_flow_dump_create, + dpif_netdev_flow_dump_destroy, + dpif_netdev_flow_dump_thread_create, + dpif_netdev_flow_dump_thread_destroy, dpif_netdev_flow_dump_next, - NULL, - dpif_netdev_flow_dump_done, - dpif_netdev_flow_dump_state_uninit, - dpif_netdev_execute, - NULL, /* operate */ - dpif_netdev_recv_set, - dpif_netdev_handlers_set, + dpif_netdev_operate, + NULL, /* recv_set */ + NULL, /* handlers_set */ + dpif_netdev_pmd_set, dpif_netdev_queue_to_priority, - dpif_netdev_recv, - dpif_netdev_recv_wait, - dpif_netdev_recv_purge, + NULL, /* recv */ + NULL, /* recv_wait */ + NULL, /* recv_purge */ + dpif_netdev_register_upcall_cb, + dpif_netdev_enable_upcall, + dpif_netdev_disable_upcall, + dpif_netdev_get_datapath_version, }; static void dpif_dummy_change_port_number(struct unixctl_conn *conn, int argc OVS_UNUSED, const char *argv[], void *aux OVS_UNUSED) { - struct dp_netdev_port *port; + struct dp_netdev_port *old_port; + struct dp_netdev_port *new_port; struct dp_netdev *dp; odp_port_t port_no; @@ -2289,8 +3611,8 @@ ovs_refcount_ref(&dp->ref_cnt); ovs_mutex_unlock(&dp_netdev_mutex); - ovs_rwlock_wrlock(&dp->port_rwlock); - if (get_port_by_name(dp, argv[2], &port)) { + ovs_mutex_lock(&dp->port_mutex); + if (get_port_by_name(dp, argv[2], &old_port)) { unixctl_command_reply_error(conn, "unknown port"); goto exit; } @@ -2304,14 +3626,52 @@ unixctl_command_reply_error(conn, "port number already in use"); goto exit; } - hmap_remove(&dp->ports, &port->node); - port->port_no = port_no; - hmap_insert(&dp->ports, &port->node, hash_int(odp_to_u32(port_no), 0)); + + /* Remove old port. */ + cmap_remove(&dp->ports, &old_port->node, hash_port_no(old_port->md.in_port.odp_port)); + ovsrcu_postpone(free, old_port); + + /* Insert new port (cmap semantics mean we cannot re-insert 'old_port'). */ + new_port = xmemdup(old_port, sizeof *old_port); + new_port->md.in_port.odp_port = port_no; + cmap_insert(&dp->ports, &new_port->node, hash_port_no(port_no)); + seq_change(dp->port_seq); unixctl_command_reply(conn, NULL); exit: - ovs_rwlock_unlock(&dp->port_rwlock); + ovs_mutex_unlock(&dp->port_mutex); + dp_netdev_unref(dp); +} + +static void +dpif_dummy_delete_port(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[], void *aux OVS_UNUSED) +{ + struct dp_netdev_port *port; + struct dp_netdev *dp; + + ovs_mutex_lock(&dp_netdev_mutex); + dp = shash_find_data(&dp_netdevs, argv[1]); + if (!dp || !dpif_netdev_class_is_dummy(dp->class)) { + ovs_mutex_unlock(&dp_netdev_mutex); + unixctl_command_reply_error(conn, "unknown datapath or not a dummy"); + return; + } + ovs_refcount_ref(&dp->ref_cnt); + ovs_mutex_unlock(&dp_netdev_mutex); + + ovs_mutex_lock(&dp->port_mutex); + if (get_port_by_name(dp, argv[2], &port)) { + unixctl_command_reply_error(conn, "unknown port"); + } else if (port->md.in_port.odp_port == ODPP_LOCAL) { + unixctl_command_reply_error(conn, "can't delete local port"); + } else { + do_del_port(dp, port); + unixctl_command_reply(conn, NULL); + } + ovs_mutex_unlock(&dp->port_mutex); + dp_netdev_unref(dp); } @@ -2346,6 +3706,217 @@ dpif_dummy_register__("dummy"); unixctl_command_register("dpif-dummy/change-port-number", - "DP PORT NEW-NUMBER", + "dp port new-number", 3, 3, dpif_dummy_change_port_number, NULL); + unixctl_command_register("dpif-dummy/delete-port", "dp port", + 2, 2, dpif_dummy_delete_port, NULL); +} + +/* Datapath Classifier. */ + +/* A set of rules that all have the same fields wildcarded. */ +struct dpcls_subtable { + /* The fields are only used by writers. */ + struct cmap_node cmap_node OVS_GUARDED; /* Within dpcls 'subtables_map'. */ + + /* These fields are accessed by readers. */ + struct cmap rules; /* Contains "struct dpcls_rule"s. */ + struct netdev_flow_key mask; /* Wildcards for fields (const). */ + /* 'mask' must be the last field, additional space is allocated here. */ +}; + +/* Initializes 'cls' as a classifier that initially contains no classification + * rules. */ +static void +dpcls_init(struct dpcls *cls) +{ + cmap_init(&cls->subtables_map); + pvector_init(&cls->subtables); +} + +static void +dpcls_destroy_subtable(struct dpcls *cls, struct dpcls_subtable *subtable) +{ + pvector_remove(&cls->subtables, subtable); + cmap_remove(&cls->subtables_map, &subtable->cmap_node, + subtable->mask.hash); + cmap_destroy(&subtable->rules); + ovsrcu_postpone(free, subtable); +} + +/* Destroys 'cls'. Rules within 'cls', if any, are not freed; this is the + * caller's responsibility. + * May only be called after all the readers have been terminated. */ +static void +dpcls_destroy(struct dpcls *cls) +{ + if (cls) { + struct dpcls_subtable *subtable; + + CMAP_FOR_EACH (subtable, cmap_node, &cls->subtables_map) { + dpcls_destroy_subtable(cls, subtable); + } + cmap_destroy(&cls->subtables_map); + pvector_destroy(&cls->subtables); + } +} + +static struct dpcls_subtable * +dpcls_create_subtable(struct dpcls *cls, const struct netdev_flow_key *mask) +{ + struct dpcls_subtable *subtable; + + /* Need to add one. */ + subtable = xmalloc(sizeof *subtable + - sizeof subtable->mask.mf + mask->len); + cmap_init(&subtable->rules); + netdev_flow_key_clone(&subtable->mask, mask); + cmap_insert(&cls->subtables_map, &subtable->cmap_node, mask->hash); + pvector_insert(&cls->subtables, subtable, 0); + pvector_publish(&cls->subtables); + + return subtable; +} + +static inline struct dpcls_subtable * +dpcls_find_subtable(struct dpcls *cls, const struct netdev_flow_key *mask) +{ + struct dpcls_subtable *subtable; + + CMAP_FOR_EACH_WITH_HASH (subtable, cmap_node, mask->hash, + &cls->subtables_map) { + if (netdev_flow_key_equal(&subtable->mask, mask)) { + return subtable; + } + } + return dpcls_create_subtable(cls, mask); +} + +/* Insert 'rule' into 'cls'. */ +static void +dpcls_insert(struct dpcls *cls, struct dpcls_rule *rule, + const struct netdev_flow_key *mask) +{ + struct dpcls_subtable *subtable = dpcls_find_subtable(cls, mask); + + rule->mask = &subtable->mask; + cmap_insert(&subtable->rules, &rule->cmap_node, rule->flow.hash); +} + +/* Removes 'rule' from 'cls', also destructing the 'rule'. */ +static void +dpcls_remove(struct dpcls *cls, struct dpcls_rule *rule) +{ + struct dpcls_subtable *subtable; + + ovs_assert(rule->mask); + + INIT_CONTAINER(subtable, rule->mask, mask); + + if (cmap_remove(&subtable->rules, &rule->cmap_node, rule->flow.hash) + == 0) { + dpcls_destroy_subtable(cls, subtable); + pvector_publish(&cls->subtables); + } +} + +/* Returns true if 'target' satisifies 'key' in 'mask', that is, if each 1-bit + * in 'mask' the values in 'key' and 'target' are the same. + * + * Note: 'key' and 'mask' have the same mask, and 'key' is already masked. */ +static inline bool +dpcls_rule_matches_key(const struct dpcls_rule *rule, + const struct netdev_flow_key *target) +{ + const uint64_t *keyp = rule->flow.mf.inline_values; + const uint64_t *maskp = rule->mask->mf.inline_values; + uint64_t target_u64; + + NETDEV_FLOW_KEY_FOR_EACH_IN_MAP(target_u64, target, rule->flow.mf.map) { + if (OVS_UNLIKELY((target_u64 & *maskp++) != *keyp++)) { + return false; + } + } + return true; +} + +/* For each miniflow in 'flows' performs a classifier lookup writing the result + * into the corresponding slot in 'rules'. If a particular entry in 'flows' is + * NULL it is skipped. + * + * This function is optimized for use in the userspace datapath and therefore + * does not implement a lot of features available in the standard + * classifier_lookup() function. Specifically, it does not implement + * priorities, instead returning any rule which matches the flow. + * + * Returns true if all flows found a corresponding rule. */ +static bool +dpcls_lookup(const struct dpcls *cls, const struct netdev_flow_key keys[], + struct dpcls_rule **rules, const size_t cnt) +{ + /* The batch size 16 was experimentally found faster than 8 or 32. */ + typedef uint16_t map_type; +#define MAP_BITS (sizeof(map_type) * CHAR_BIT) + +#if !defined(__CHECKER__) && !defined(_WIN32) + const int N_MAPS = DIV_ROUND_UP(cnt, MAP_BITS); +#else + enum { N_MAPS = DIV_ROUND_UP(NETDEV_MAX_BURST, MAP_BITS) }; +#endif + map_type maps[N_MAPS]; + struct dpcls_subtable *subtable; + + memset(maps, 0xff, sizeof maps); + if (cnt % MAP_BITS) { + maps[N_MAPS - 1] >>= MAP_BITS - cnt % MAP_BITS; /* Clear extra bits. */ + } + memset(rules, 0, cnt * sizeof *rules); + + PVECTOR_FOR_EACH (subtable, &cls->subtables) { + const struct netdev_flow_key *mkeys = keys; + struct dpcls_rule **mrules = rules; + map_type remains = 0; + int m; + + BUILD_ASSERT_DECL(sizeof remains == sizeof *maps); + + for (m = 0; m < N_MAPS; m++, mkeys += MAP_BITS, mrules += MAP_BITS) { + uint32_t hashes[MAP_BITS]; + const struct cmap_node *nodes[MAP_BITS]; + unsigned long map = maps[m]; + int i; + + if (!map) { + continue; /* Skip empty maps. */ + } + + /* Compute hashes for the remaining keys. */ + ULONG_FOR_EACH_1(i, map) { + hashes[i] = netdev_flow_key_hash_in_mask(&mkeys[i], + &subtable->mask); + } + /* Lookup. */ + map = cmap_find_batch(&subtable->rules, map, hashes, nodes); + /* Check results. */ + ULONG_FOR_EACH_1(i, map) { + struct dpcls_rule *rule; + + CMAP_NODE_FOR_EACH (rule, cmap_node, nodes[i]) { + if (OVS_LIKELY(dpcls_rule_matches_key(rule, &mkeys[i]))) { + mrules[i] = rule; + goto next; + } + } + ULONG_SET0(map, i); /* Did not match. */ + next: + ; /* Keep Sparse happy. */ + } + maps[m] &= ~map; /* Clear the found rules. */ + remains |= maps[m]; + } + if (!remains) { + return true; /* All found. */ + } + } + return false; /* Some misses. */ } diff -Nru openvswitch-2.3.1/lib/dpif-netdev.h openvswitch-2.4.0~git20150623/lib/dpif-netdev.h --- openvswitch-2.3.1/lib/dpif-netdev.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif-netdev.h 2015-06-23 18:46:21.000000000 +0000 @@ -20,8 +20,9 @@ #include #include #include +#include "dpif.h" #include "openvswitch/types.h" -#include "ofpbuf.h" +#include "dp-packet.h" #include "packets.h" #ifdef __cplusplus @@ -32,14 +33,15 @@ * headers to be aligned on a 4-byte boundary. */ enum { DP_NETDEV_HEADROOM = 2 + VLAN_HEADER_LEN }; -static inline void dp_packet_pad(struct ofpbuf *b) +static inline void dp_packet_pad(struct dp_packet *p) { - if (ofpbuf_size(b) < ETH_TOTAL_MIN) { - ofpbuf_put_zeros(b, ETH_TOTAL_MIN - ofpbuf_size(b)); + if (dp_packet_size(p) < ETH_TOTAL_MIN) { + dp_packet_put_zeros(p, ETH_TOTAL_MIN - dp_packet_size(p)); } } #define NR_QUEUE 1 +#define NR_PMD_THREADS 1 #ifdef __cplusplus } diff -Nru openvswitch-2.3.1/lib/dpif-netlink.c openvswitch-2.4.0~git20150623/lib/dpif-netlink.c --- openvswitch-2.3.1/lib/dpif-netlink.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif-netlink.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2912 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "dpif-netlink.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bitmap.h" +#include "dpif-provider.h" +#include "dynamic-string.h" +#include "flow.h" +#include "fat-rwlock.h" +#include "netdev.h" +#include "netdev-linux.h" +#include "netdev-vport.h" +#include "netlink-notifier.h" +#include "netlink-socket.h" +#include "netlink.h" +#include "odp-util.h" +#include "ofpbuf.h" +#include "packets.h" +#include "poll-loop.h" +#include "random.h" +#include "shash.h" +#include "sset.h" +#include "timeval.h" +#include "unaligned.h" +#include "util.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(dpif_netlink); +#ifdef _WIN32 +enum { WINDOWS = 1 }; +#else +enum { WINDOWS = 0 }; +#endif +enum { MAX_PORTS = USHRT_MAX }; + +/* This ethtool flag was introduced in Linux 2.6.24, so it might be + * missing if we have old headers. */ +#define ETH_FLAG_LRO (1 << 15) /* LRO is enabled */ + +struct dpif_netlink_dp { + /* Generic Netlink header. */ + uint8_t cmd; + + /* struct ovs_header. */ + int dp_ifindex; + + /* Attributes. */ + const char *name; /* OVS_DP_ATTR_NAME. */ + const uint32_t *upcall_pid; /* OVS_DP_ATTR_UPCALL_PID. */ + uint32_t user_features; /* OVS_DP_ATTR_USER_FEATURES */ + const struct ovs_dp_stats *stats; /* OVS_DP_ATTR_STATS. */ + const struct ovs_dp_megaflow_stats *megaflow_stats; + /* OVS_DP_ATTR_MEGAFLOW_STATS.*/ +}; + +static void dpif_netlink_dp_init(struct dpif_netlink_dp *); +static int dpif_netlink_dp_from_ofpbuf(struct dpif_netlink_dp *, + const struct ofpbuf *); +static void dpif_netlink_dp_dump_start(struct nl_dump *); +static int dpif_netlink_dp_transact(const struct dpif_netlink_dp *request, + struct dpif_netlink_dp *reply, + struct ofpbuf **bufp); +static int dpif_netlink_dp_get(const struct dpif *, + struct dpif_netlink_dp *reply, + struct ofpbuf **bufp); + +struct dpif_netlink_flow { + /* Generic Netlink header. */ + uint8_t cmd; + + /* struct ovs_header. */ + unsigned int nlmsg_flags; + int dp_ifindex; + + /* Attributes. + * + * The 'stats' member points to 64-bit data that might only be aligned on + * 32-bit boundaries, so get_unaligned_u64() should be used to access its + * values. + * + * If 'actions' is nonnull then OVS_FLOW_ATTR_ACTIONS will be included in + * the Netlink version of the command, even if actions_len is zero. */ + const struct nlattr *key; /* OVS_FLOW_ATTR_KEY. */ + size_t key_len; + const struct nlattr *mask; /* OVS_FLOW_ATTR_MASK. */ + size_t mask_len; + const struct nlattr *actions; /* OVS_FLOW_ATTR_ACTIONS. */ + size_t actions_len; + ovs_u128 ufid; /* OVS_FLOW_ATTR_FLOW_ID. */ + bool ufid_present; /* Is there a UFID? */ + bool ufid_terse; /* Skip serializing key/mask/acts? */ + const struct ovs_flow_stats *stats; /* OVS_FLOW_ATTR_STATS. */ + const uint8_t *tcp_flags; /* OVS_FLOW_ATTR_TCP_FLAGS. */ + const ovs_32aligned_u64 *used; /* OVS_FLOW_ATTR_USED. */ + bool clear; /* OVS_FLOW_ATTR_CLEAR. */ + bool probe; /* OVS_FLOW_ATTR_PROBE. */ +}; + +static void dpif_netlink_flow_init(struct dpif_netlink_flow *); +static int dpif_netlink_flow_from_ofpbuf(struct dpif_netlink_flow *, + const struct ofpbuf *); +static void dpif_netlink_flow_to_ofpbuf(const struct dpif_netlink_flow *, + struct ofpbuf *); +static int dpif_netlink_flow_transact(struct dpif_netlink_flow *request, + struct dpif_netlink_flow *reply, + struct ofpbuf **bufp); +static void dpif_netlink_flow_get_stats(const struct dpif_netlink_flow *, + struct dpif_flow_stats *); +static void dpif_netlink_flow_to_dpif_flow(struct dpif *, struct dpif_flow *, + const struct dpif_netlink_flow *); + +/* One of the dpif channels between the kernel and userspace. */ +struct dpif_channel { + struct nl_sock *sock; /* Netlink socket. */ + long long int last_poll; /* Last time this channel was polled. */ +}; + +#ifdef _WIN32 +#define VPORT_SOCK_POOL_SIZE 1 +/* On Windows, there is no native support for epoll. There are equivalent + * interfaces though, that are not used currently. For simpicity, a pool of + * netlink sockets is used. Each socket is represented by 'struct + * dpif_windows_vport_sock'. Since it is a pool, multiple OVS ports may be + * sharing the same socket. In the future, we can add a reference count and + * such fields. */ +struct dpif_windows_vport_sock { + struct nl_sock *nl_sock; /* netlink socket. */ +}; +#endif + +struct dpif_handler { + struct dpif_channel *channels;/* Array of channels for each handler. */ + struct epoll_event *epoll_events; + int epoll_fd; /* epoll fd that includes channel socks. */ + int n_events; /* Num events returned by epoll_wait(). */ + int event_offset; /* Offset into 'epoll_events'. */ + +#ifdef _WIN32 + /* Pool of sockets. */ + struct dpif_windows_vport_sock *vport_sock_pool; + size_t last_used_pool_idx; /* Index to aid in allocating a + socket in the pool to a port. */ +#endif +}; + +/* Datapath interface for the openvswitch Linux kernel module. */ +struct dpif_netlink { + struct dpif dpif; + int dp_ifindex; + + /* Upcall messages. */ + struct fat_rwlock upcall_lock; + struct dpif_handler *handlers; + uint32_t n_handlers; /* Num of upcall handlers. */ + int uc_array_size; /* Size of 'handler->channels' and */ + /* 'handler->epoll_events'. */ + + /* Change notification. */ + struct nl_sock *port_notifier; /* vport multicast group subscriber. */ + bool refresh_channels; +}; + +static void report_loss(struct dpif_netlink *, struct dpif_channel *, + uint32_t ch_idx, uint32_t handler_id); + +static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(9999, 5); + +/* Generic Netlink family numbers for OVS. + * + * Initialized by dpif_netlink_init(). */ +static int ovs_datapath_family; +static int ovs_vport_family; +static int ovs_flow_family; +static int ovs_packet_family; + +/* Generic Netlink multicast groups for OVS. + * + * Initialized by dpif_netlink_init(). */ +static unsigned int ovs_vport_mcgroup; + +static int dpif_netlink_init(void); +static int open_dpif(const struct dpif_netlink_dp *, struct dpif **); +static uint32_t dpif_netlink_port_get_pid(const struct dpif *, + odp_port_t port_no, uint32_t hash); +static void dpif_netlink_handler_uninit(struct dpif_handler *handler); +static int dpif_netlink_refresh_channels(struct dpif_netlink *, + uint32_t n_handlers); +static void dpif_netlink_vport_to_ofpbuf(const struct dpif_netlink_vport *, + struct ofpbuf *); +static int dpif_netlink_vport_from_ofpbuf(struct dpif_netlink_vport *, + const struct ofpbuf *); + +static struct dpif_netlink * +dpif_netlink_cast(const struct dpif *dpif) +{ + dpif_assert_class(dpif, &dpif_netlink_class); + return CONTAINER_OF(dpif, struct dpif_netlink, dpif); +} + +static int +dpif_netlink_enumerate(struct sset *all_dps, + const struct dpif_class *dpif_class OVS_UNUSED) +{ + struct nl_dump dump; + uint64_t reply_stub[NL_DUMP_BUFSIZE / 8]; + struct ofpbuf msg, buf; + int error; + + error = dpif_netlink_init(); + if (error) { + return error; + } + + ofpbuf_use_stub(&buf, reply_stub, sizeof reply_stub); + dpif_netlink_dp_dump_start(&dump); + while (nl_dump_next(&dump, &msg, &buf)) { + struct dpif_netlink_dp dp; + + if (!dpif_netlink_dp_from_ofpbuf(&dp, &msg)) { + sset_add(all_dps, dp.name); + } + } + ofpbuf_uninit(&buf); + return nl_dump_done(&dump); +} + +static int +dpif_netlink_open(const struct dpif_class *class OVS_UNUSED, const char *name, + bool create, struct dpif **dpifp) +{ + struct dpif_netlink_dp dp_request, dp; + struct ofpbuf *buf; + uint32_t upcall_pid; + int error; + + error = dpif_netlink_init(); + if (error) { + return error; + } + + /* Create or look up datapath. */ + dpif_netlink_dp_init(&dp_request); + if (create) { + dp_request.cmd = OVS_DP_CMD_NEW; + upcall_pid = 0; + dp_request.upcall_pid = &upcall_pid; + } else { + /* Use OVS_DP_CMD_SET to report user features */ + dp_request.cmd = OVS_DP_CMD_SET; + } + dp_request.name = name; + dp_request.user_features |= OVS_DP_F_UNALIGNED; + dp_request.user_features |= OVS_DP_F_VPORT_PIDS; + error = dpif_netlink_dp_transact(&dp_request, &dp, &buf); + if (error) { + return error; + } + + error = open_dpif(&dp, dpifp); + ofpbuf_delete(buf); + return error; +} + +static int +open_dpif(const struct dpif_netlink_dp *dp, struct dpif **dpifp) +{ + struct dpif_netlink *dpif; + + dpif = xzalloc(sizeof *dpif); + dpif->port_notifier = NULL; + fat_rwlock_init(&dpif->upcall_lock); + + dpif_init(&dpif->dpif, &dpif_netlink_class, dp->name, + dp->dp_ifindex, dp->dp_ifindex); + + dpif->dp_ifindex = dp->dp_ifindex; + *dpifp = &dpif->dpif; + + return 0; +} + +/* Destroys the netlink sockets pointed by the elements in 'socksp' + * and frees the 'socksp'. */ +static void +vport_del_socksp__(struct nl_sock **socksp, uint32_t n_socks) +{ + size_t i; + + for (i = 0; i < n_socks; i++) { + nl_sock_destroy(socksp[i]); + } + + free(socksp); +} + +/* Creates an array of netlink sockets. Returns an array of the + * corresponding pointers. Records the error in 'error'. */ +static struct nl_sock ** +vport_create_socksp__(uint32_t n_socks, int *error) +{ + struct nl_sock **socksp = xzalloc(n_socks * sizeof *socksp); + size_t i; + + for (i = 0; i < n_socks; i++) { + *error = nl_sock_create(NETLINK_GENERIC, &socksp[i]); + if (*error) { + goto error; + } + } + + return socksp; + +error: + vport_del_socksp__(socksp, n_socks); + + return NULL; +} + +#ifdef _WIN32 +static void +vport_delete_sock_pool(struct dpif_handler *handler) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + if (handler->vport_sock_pool) { + uint32_t i; + struct dpif_windows_vport_sock *sock_pool = + handler->vport_sock_pool; + + for (i = 0; i < VPORT_SOCK_POOL_SIZE; i++) { + if (sock_pool[i].nl_sock) { + nl_sock_unsubscribe_packets(sock_pool[i].nl_sock); + nl_sock_destroy(sock_pool[i].nl_sock); + sock_pool[i].nl_sock = NULL; + } + } + + free(handler->vport_sock_pool); + handler->vport_sock_pool = NULL; + } +} + +static int +vport_create_sock_pool(struct dpif_handler *handler) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + struct dpif_windows_vport_sock *sock_pool; + size_t i; + int error = 0; + + sock_pool = xzalloc(VPORT_SOCK_POOL_SIZE * sizeof *sock_pool); + for (i = 0; i < VPORT_SOCK_POOL_SIZE; i++) { + error = nl_sock_create(NETLINK_GENERIC, &sock_pool[i].nl_sock); + if (error) { + goto error; + } + + /* Enable the netlink socket to receive packets. This is equivalent to + * calling nl_sock_join_mcgroup() to receive events. */ + error = nl_sock_subscribe_packets(sock_pool[i].nl_sock); + if (error) { + goto error; + } + } + + handler->vport_sock_pool = sock_pool; + handler->last_used_pool_idx = 0; + return 0; + +error: + vport_delete_sock_pool(handler); + return error; +} + +/* Returns an array pointers to netlink sockets. The sockets are picked from a + * pool. Records the error in 'error'. */ +static struct nl_sock ** +vport_create_socksp_windows(struct dpif_netlink *dpif, int *error) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + uint32_t n_socks = dpif->n_handlers; + struct nl_sock **socksp; + size_t i; + + ovs_assert(n_socks <= 1); + socksp = xzalloc(n_socks * sizeof *socksp); + + /* Pick netlink sockets to use in a round-robin fashion from each + * handler's pool of sockets. */ + for (i = 0; i < n_socks; i++) { + struct dpif_handler *handler = &dpif->handlers[i]; + struct dpif_windows_vport_sock *sock_pool = handler->vport_sock_pool; + size_t index = handler->last_used_pool_idx; + + /* A pool of sockets is allocated when the handler is initialized. */ + if (sock_pool == NULL) { + free(socksp); + *error = EINVAL; + return NULL; + } + + ovs_assert(index < VPORT_SOCK_POOL_SIZE); + socksp[i] = sock_pool[index].nl_sock; + socksp[i] = sock_pool[index].nl_sock; + ovs_assert(socksp[i]); + index = (index == VPORT_SOCK_POOL_SIZE - 1) ? 0 : index + 1; + handler->last_used_pool_idx = index; + } + + return socksp; +} + +static void +vport_del_socksp_windows(struct dpif_netlink *dpif, struct nl_sock **socksp) +{ + free(socksp); +} +#endif /* _WIN32 */ + +static struct nl_sock ** +vport_create_socksp(struct dpif_netlink *dpif, int *error) +{ +#ifdef _WIN32 + return vport_create_socksp_windows(dpif, error); +#else + return vport_create_socksp__(dpif->n_handlers, error); +#endif +} + +static void +vport_del_socksp(struct dpif_netlink *dpif, struct nl_sock **socksp) +{ +#ifdef _WIN32 + vport_del_socksp_windows(dpif, socksp); +#else + vport_del_socksp__(socksp, dpif->n_handlers); +#endif +} + +/* Given the array of pointers to netlink sockets 'socksp', returns + * the array of corresponding pids. If the 'socksp' is NULL, returns + * a single-element array of value 0. */ +static uint32_t * +vport_socksp_to_pids(struct nl_sock **socksp, uint32_t n_socks) +{ + uint32_t *pids; + + if (!socksp) { + pids = xzalloc(sizeof *pids); + } else { + size_t i; + + pids = xzalloc(n_socks * sizeof *pids); + for (i = 0; i < n_socks; i++) { + pids[i] = nl_sock_pid(socksp[i]); + } + } + + return pids; +} + +/* Given the port number 'port_idx', extracts the pids of netlink sockets + * associated to the port and assigns it to 'upcall_pids'. */ +static bool +vport_get_pids(struct dpif_netlink *dpif, uint32_t port_idx, + uint32_t **upcall_pids) +{ + uint32_t *pids; + size_t i; + + /* Since the nl_sock can only be assigned in either all + * or none "dpif->handlers" channels, the following check + * would suffice. */ + if (!dpif->handlers[0].channels[port_idx].sock) { + return false; + } + ovs_assert(!WINDOWS || dpif->n_handlers <= 1); + + pids = xzalloc(dpif->n_handlers * sizeof *pids); + + for (i = 0; i < dpif->n_handlers; i++) { + pids[i] = nl_sock_pid(dpif->handlers[i].channels[port_idx].sock); + } + + *upcall_pids = pids; + + return true; +} + +static int +vport_add_channels(struct dpif_netlink *dpif, odp_port_t port_no, + struct nl_sock **socksp) +{ + struct epoll_event event; + uint32_t port_idx = odp_to_u32(port_no); + size_t i, j; + int error; + + if (dpif->handlers == NULL) { + return 0; + } + + /* We assume that the datapath densely chooses port numbers, which can + * therefore be used as an index into 'channels' and 'epoll_events' of + * 'dpif->handler'. */ + if (port_idx >= dpif->uc_array_size) { + uint32_t new_size = port_idx + 1; + + if (new_size > MAX_PORTS) { + VLOG_WARN_RL(&error_rl, "%s: datapath port %"PRIu32" too big", + dpif_name(&dpif->dpif), port_no); + return EFBIG; + } + + for (i = 0; i < dpif->n_handlers; i++) { + struct dpif_handler *handler = &dpif->handlers[i]; + + handler->channels = xrealloc(handler->channels, + new_size * sizeof *handler->channels); + + for (j = dpif->uc_array_size; j < new_size; j++) { + handler->channels[j].sock = NULL; + } + + handler->epoll_events = xrealloc(handler->epoll_events, + new_size * sizeof *handler->epoll_events); + + } + dpif->uc_array_size = new_size; + } + + memset(&event, 0, sizeof event); + event.events = EPOLLIN; + event.data.u32 = port_idx; + + for (i = 0; i < dpif->n_handlers; i++) { + struct dpif_handler *handler = &dpif->handlers[i]; + +#ifndef _WIN32 + if (epoll_ctl(handler->epoll_fd, EPOLL_CTL_ADD, nl_sock_fd(socksp[i]), + &event) < 0) { + error = errno; + goto error; + } +#endif + dpif->handlers[i].channels[port_idx].sock = socksp[i]; + dpif->handlers[i].channels[port_idx].last_poll = LLONG_MIN; + } + + return 0; + +error: + for (j = 0; j < i; j++) { +#ifndef _WIN32 + epoll_ctl(dpif->handlers[j].epoll_fd, EPOLL_CTL_DEL, + nl_sock_fd(socksp[j]), NULL); +#endif + dpif->handlers[j].channels[port_idx].sock = NULL; + } + + return error; +} + +static void +vport_del_channels(struct dpif_netlink *dpif, odp_port_t port_no) +{ + uint32_t port_idx = odp_to_u32(port_no); + size_t i; + + if (!dpif->handlers || port_idx >= dpif->uc_array_size) { + return; + } + + /* Since the sock can only be assigned in either all or none + * of "dpif->handlers" channels, the following check would + * suffice. */ + if (!dpif->handlers[0].channels[port_idx].sock) { + return; + } + + for (i = 0; i < dpif->n_handlers; i++) { + struct dpif_handler *handler = &dpif->handlers[i]; +#ifndef _WIN32 + epoll_ctl(handler->epoll_fd, EPOLL_CTL_DEL, + nl_sock_fd(handler->channels[port_idx].sock), NULL); + nl_sock_destroy(handler->channels[port_idx].sock); +#endif + handler->channels[port_idx].sock = NULL; + handler->event_offset = handler->n_events = 0; + } +} + +static void +destroy_all_channels(struct dpif_netlink *dpif) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + unsigned int i; + + if (!dpif->handlers) { + return; + } + + for (i = 0; i < dpif->uc_array_size; i++ ) { + struct dpif_netlink_vport vport_request; + uint32_t upcall_pids = 0; + + /* Since the sock can only be assigned in either all or none + * of "dpif->handlers" channels, the following check would + * suffice. */ + if (!dpif->handlers[0].channels[i].sock) { + continue; + } + + /* Turn off upcalls. */ + dpif_netlink_vport_init(&vport_request); + vport_request.cmd = OVS_VPORT_CMD_SET; + vport_request.dp_ifindex = dpif->dp_ifindex; + vport_request.port_no = u32_to_odp(i); + vport_request.n_upcall_pids = 1; + vport_request.upcall_pids = &upcall_pids; + dpif_netlink_vport_transact(&vport_request, NULL, NULL); + + vport_del_channels(dpif, u32_to_odp(i)); + } + + for (i = 0; i < dpif->n_handlers; i++) { + struct dpif_handler *handler = &dpif->handlers[i]; + + dpif_netlink_handler_uninit(handler); + free(handler->epoll_events); + free(handler->channels); + } + + free(dpif->handlers); + dpif->handlers = NULL; + dpif->n_handlers = 0; + dpif->uc_array_size = 0; +} + +static void +dpif_netlink_close(struct dpif *dpif_) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + nl_sock_destroy(dpif->port_notifier); + + fat_rwlock_wrlock(&dpif->upcall_lock); + destroy_all_channels(dpif); + fat_rwlock_unlock(&dpif->upcall_lock); + + fat_rwlock_destroy(&dpif->upcall_lock); + free(dpif); +} + +static int +dpif_netlink_destroy(struct dpif *dpif_) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + struct dpif_netlink_dp dp; + + dpif_netlink_dp_init(&dp); + dp.cmd = OVS_DP_CMD_DEL; + dp.dp_ifindex = dpif->dp_ifindex; + return dpif_netlink_dp_transact(&dp, NULL, NULL); +} + +static bool +dpif_netlink_run(struct dpif *dpif_) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + if (dpif->refresh_channels) { + dpif->refresh_channels = false; + fat_rwlock_wrlock(&dpif->upcall_lock); + dpif_netlink_refresh_channels(dpif, dpif->n_handlers); + fat_rwlock_unlock(&dpif->upcall_lock); + } + return false; +} + +static int +dpif_netlink_get_stats(const struct dpif *dpif_, struct dpif_dp_stats *stats) +{ + struct dpif_netlink_dp dp; + struct ofpbuf *buf; + int error; + + error = dpif_netlink_dp_get(dpif_, &dp, &buf); + if (!error) { + memset(stats, 0, sizeof *stats); + + if (dp.stats) { + stats->n_hit = get_32aligned_u64(&dp.stats->n_hit); + stats->n_missed = get_32aligned_u64(&dp.stats->n_missed); + stats->n_lost = get_32aligned_u64(&dp.stats->n_lost); + stats->n_flows = get_32aligned_u64(&dp.stats->n_flows); + } + + if (dp.megaflow_stats) { + stats->n_masks = dp.megaflow_stats->n_masks; + stats->n_mask_hit = get_32aligned_u64( + &dp.megaflow_stats->n_mask_hit); + } else { + stats->n_masks = UINT32_MAX; + stats->n_mask_hit = UINT64_MAX; + } + ofpbuf_delete(buf); + } + return error; +} + +static const char * +get_vport_type(const struct dpif_netlink_vport *vport) +{ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); + + switch (vport->type) { + case OVS_VPORT_TYPE_NETDEV: { + const char *type = netdev_get_type_from_name(vport->name); + + return type ? type : "system"; + } + + case OVS_VPORT_TYPE_INTERNAL: + return "internal"; + + case OVS_VPORT_TYPE_GENEVE: + return "geneve"; + + case OVS_VPORT_TYPE_GRE: + return "gre"; + + case OVS_VPORT_TYPE_GRE64: + return "gre64"; + + case OVS_VPORT_TYPE_VXLAN: + return "vxlan"; + + case OVS_VPORT_TYPE_LISP: + return "lisp"; + + case OVS_VPORT_TYPE_STT: + return "stt"; + + case OVS_VPORT_TYPE_UNSPEC: + case __OVS_VPORT_TYPE_MAX: + break; + } + + VLOG_WARN_RL(&rl, "dp%d: port `%s' has unsupported type %u", + vport->dp_ifindex, vport->name, (unsigned int) vport->type); + return "unknown"; +} + +static enum ovs_vport_type +netdev_to_ovs_vport_type(const struct netdev *netdev) +{ + const char *type = netdev_get_type(netdev); + + if (!strcmp(type, "tap") || !strcmp(type, "system")) { + return OVS_VPORT_TYPE_NETDEV; + } else if (!strcmp(type, "internal")) { + return OVS_VPORT_TYPE_INTERNAL; + } else if (strstr(type, "stt")) { + return OVS_VPORT_TYPE_STT; + } else if (!strcmp(type, "geneve")) { + return OVS_VPORT_TYPE_GENEVE; + } else if (strstr(type, "gre64")) { + return OVS_VPORT_TYPE_GRE64; + } else if (strstr(type, "gre")) { + return OVS_VPORT_TYPE_GRE; + } else if (!strcmp(type, "vxlan")) { + return OVS_VPORT_TYPE_VXLAN; + } else if (!strcmp(type, "lisp")) { + return OVS_VPORT_TYPE_LISP; + } else { + return OVS_VPORT_TYPE_UNSPEC; + } +} + +static int +dpif_netlink_port_add__(struct dpif_netlink *dpif, struct netdev *netdev, + odp_port_t *port_nop) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + const struct netdev_tunnel_config *tnl_cfg; + char namebuf[NETDEV_VPORT_NAME_BUFSIZE]; + const char *name = netdev_vport_get_dpif_port(netdev, + namebuf, sizeof namebuf); + const char *type = netdev_get_type(netdev); + struct dpif_netlink_vport request, reply; + struct ofpbuf *buf; + uint64_t options_stub[64 / 8]; + struct ofpbuf options; + struct nl_sock **socksp = NULL; + uint32_t *upcall_pids; + int error = 0; + + if (dpif->handlers) { + socksp = vport_create_socksp(dpif, &error); + if (!socksp) { + return error; + } + } + + dpif_netlink_vport_init(&request); + request.cmd = OVS_VPORT_CMD_NEW; + request.dp_ifindex = dpif->dp_ifindex; + request.type = netdev_to_ovs_vport_type(netdev); + if (request.type == OVS_VPORT_TYPE_UNSPEC) { + VLOG_WARN_RL(&error_rl, "%s: cannot create port `%s' because it has " + "unsupported type `%s'", + dpif_name(&dpif->dpif), name, type); + vport_del_socksp(dpif, socksp); + return EINVAL; + } + request.name = name; + + if (request.type == OVS_VPORT_TYPE_NETDEV) { +#ifdef _WIN32 + /* XXX : Map appropiate Windows handle */ +#else + netdev_linux_ethtool_set_flag(netdev, ETH_FLAG_LRO, "LRO", false); +#endif + } + + tnl_cfg = netdev_get_tunnel_config(netdev); + if (tnl_cfg && (tnl_cfg->dst_port != 0 || tnl_cfg->exts)) { + ofpbuf_use_stack(&options, options_stub, sizeof options_stub); + if (tnl_cfg->dst_port) { + nl_msg_put_u16(&options, OVS_TUNNEL_ATTR_DST_PORT, + ntohs(tnl_cfg->dst_port)); + } + if (tnl_cfg->exts) { + size_t ext_ofs; + int i; + + ext_ofs = nl_msg_start_nested(&options, OVS_TUNNEL_ATTR_EXTENSION); + for (i = 0; i < 32; i++) { + if (tnl_cfg->exts & (1 << i)) { + nl_msg_put_flag(&options, i); + } + } + nl_msg_end_nested(&options, ext_ofs); + } + request.options = options.data; + request.options_len = options.size; + } + + request.port_no = *port_nop; + upcall_pids = vport_socksp_to_pids(socksp, dpif->n_handlers); + request.n_upcall_pids = socksp ? dpif->n_handlers : 1; + request.upcall_pids = upcall_pids; + + error = dpif_netlink_vport_transact(&request, &reply, &buf); + if (!error) { + *port_nop = reply.port_no; + } else { + if (error == EBUSY && *port_nop != ODPP_NONE) { + VLOG_INFO("%s: requested port %"PRIu32" is in use", + dpif_name(&dpif->dpif), *port_nop); + } + + vport_del_socksp(dpif, socksp); + goto exit; + } + + if (socksp) { + error = vport_add_channels(dpif, *port_nop, socksp); + if (error) { + VLOG_INFO("%s: could not add channel for port %s", + dpif_name(&dpif->dpif), name); + + /* Delete the port. */ + dpif_netlink_vport_init(&request); + request.cmd = OVS_VPORT_CMD_DEL; + request.dp_ifindex = dpif->dp_ifindex; + request.port_no = *port_nop; + dpif_netlink_vport_transact(&request, NULL, NULL); + vport_del_socksp(dpif, socksp); + goto exit; + } + } + free(socksp); + +exit: + ofpbuf_delete(buf); + free(upcall_pids); + + return error; +} + +static int +dpif_netlink_port_add(struct dpif *dpif_, struct netdev *netdev, + odp_port_t *port_nop) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + int error; + + fat_rwlock_wrlock(&dpif->upcall_lock); + error = dpif_netlink_port_add__(dpif, netdev, port_nop); + fat_rwlock_unlock(&dpif->upcall_lock); + + return error; +} + +static int +dpif_netlink_port_del__(struct dpif_netlink *dpif, odp_port_t port_no) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + struct dpif_netlink_vport vport; + int error; + + dpif_netlink_vport_init(&vport); + vport.cmd = OVS_VPORT_CMD_DEL; + vport.dp_ifindex = dpif->dp_ifindex; + vport.port_no = port_no; + error = dpif_netlink_vport_transact(&vport, NULL, NULL); + + vport_del_channels(dpif, port_no); + + return error; +} + +static int +dpif_netlink_port_del(struct dpif *dpif_, odp_port_t port_no) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + int error; + + fat_rwlock_wrlock(&dpif->upcall_lock); + error = dpif_netlink_port_del__(dpif, port_no); + fat_rwlock_unlock(&dpif->upcall_lock); + + return error; +} + +static int +dpif_netlink_port_query__(const struct dpif_netlink *dpif, odp_port_t port_no, + const char *port_name, struct dpif_port *dpif_port) +{ + struct dpif_netlink_vport request; + struct dpif_netlink_vport reply; + struct ofpbuf *buf; + int error; + + dpif_netlink_vport_init(&request); + request.cmd = OVS_VPORT_CMD_GET; + request.dp_ifindex = dpif->dp_ifindex; + request.port_no = port_no; + request.name = port_name; + + error = dpif_netlink_vport_transact(&request, &reply, &buf); + if (!error) { + if (reply.dp_ifindex != request.dp_ifindex) { + /* A query by name reported that 'port_name' is in some datapath + * other than 'dpif', but the caller wants to know about 'dpif'. */ + error = ENODEV; + } else if (dpif_port) { + dpif_port->name = xstrdup(reply.name); + dpif_port->type = xstrdup(get_vport_type(&reply)); + dpif_port->port_no = reply.port_no; + } + ofpbuf_delete(buf); + } + return error; +} + +static int +dpif_netlink_port_query_by_number(const struct dpif *dpif_, odp_port_t port_no, + struct dpif_port *dpif_port) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + return dpif_netlink_port_query__(dpif, port_no, NULL, dpif_port); +} + +static int +dpif_netlink_port_query_by_name(const struct dpif *dpif_, const char *devname, + struct dpif_port *dpif_port) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + return dpif_netlink_port_query__(dpif, 0, devname, dpif_port); +} + +static uint32_t +dpif_netlink_port_get_pid__(const struct dpif_netlink *dpif, + odp_port_t port_no, uint32_t hash) + OVS_REQ_RDLOCK(dpif->upcall_lock) +{ + uint32_t port_idx = odp_to_u32(port_no); + uint32_t pid = 0; + + if (dpif->handlers && dpif->uc_array_size > 0) { + /* The ODPP_NONE "reserved" port number uses the "ovs-system"'s + * channel, since it is not heavily loaded. */ + uint32_t idx = port_idx >= dpif->uc_array_size ? 0 : port_idx; + struct dpif_handler *h = &dpif->handlers[hash % dpif->n_handlers]; + + /* Needs to check in case the socket pointer is changed in between + * the holding of upcall_lock. A known case happens when the main + * thread deletes the vport while the handler thread is handling + * the upcall from that port. */ + if (h->channels[idx].sock) { + pid = nl_sock_pid(h->channels[idx].sock); + } + } + + return pid; +} + +static uint32_t +dpif_netlink_port_get_pid(const struct dpif *dpif_, odp_port_t port_no, + uint32_t hash) +{ + const struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + uint32_t ret; + + fat_rwlock_rdlock(&dpif->upcall_lock); + ret = dpif_netlink_port_get_pid__(dpif, port_no, hash); + fat_rwlock_unlock(&dpif->upcall_lock); + + return ret; +} + +static int +dpif_netlink_flow_flush(struct dpif *dpif_) +{ + const struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + struct dpif_netlink_flow flow; + + dpif_netlink_flow_init(&flow); + flow.cmd = OVS_FLOW_CMD_DEL; + flow.dp_ifindex = dpif->dp_ifindex; + return dpif_netlink_flow_transact(&flow, NULL, NULL); +} + +struct dpif_netlink_port_state { + struct nl_dump dump; + struct ofpbuf buf; +}; + +static void +dpif_netlink_port_dump_start__(const struct dpif_netlink *dpif, + struct nl_dump *dump) +{ + struct dpif_netlink_vport request; + struct ofpbuf *buf; + + dpif_netlink_vport_init(&request); + request.cmd = OVS_VPORT_CMD_GET; + request.dp_ifindex = dpif->dp_ifindex; + + buf = ofpbuf_new(1024); + dpif_netlink_vport_to_ofpbuf(&request, buf); + nl_dump_start(dump, NETLINK_GENERIC, buf); + ofpbuf_delete(buf); +} + +static int +dpif_netlink_port_dump_start(const struct dpif *dpif_, void **statep) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + struct dpif_netlink_port_state *state; + + *statep = state = xmalloc(sizeof *state); + dpif_netlink_port_dump_start__(dpif, &state->dump); + + ofpbuf_init(&state->buf, NL_DUMP_BUFSIZE); + return 0; +} + +static int +dpif_netlink_port_dump_next__(const struct dpif_netlink *dpif, + struct nl_dump *dump, + struct dpif_netlink_vport *vport, + struct ofpbuf *buffer) +{ + struct ofpbuf buf; + int error; + + if (!nl_dump_next(dump, &buf, buffer)) { + return EOF; + } + + error = dpif_netlink_vport_from_ofpbuf(vport, &buf); + if (error) { + VLOG_WARN_RL(&error_rl, "%s: failed to parse vport record (%s)", + dpif_name(&dpif->dpif), ovs_strerror(error)); + } + return error; +} + +static int +dpif_netlink_port_dump_next(const struct dpif *dpif_, void *state_, + struct dpif_port *dpif_port) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + struct dpif_netlink_port_state *state = state_; + struct dpif_netlink_vport vport; + int error; + + error = dpif_netlink_port_dump_next__(dpif, &state->dump, &vport, + &state->buf); + if (error) { + return error; + } + dpif_port->name = CONST_CAST(char *, vport.name); + dpif_port->type = CONST_CAST(char *, get_vport_type(&vport)); + dpif_port->port_no = vport.port_no; + return 0; +} + +static int +dpif_netlink_port_dump_done(const struct dpif *dpif_ OVS_UNUSED, void *state_) +{ + struct dpif_netlink_port_state *state = state_; + int error = nl_dump_done(&state->dump); + + ofpbuf_uninit(&state->buf); + free(state); + return error; +} + +static int +dpif_netlink_port_poll(const struct dpif *dpif_, char **devnamep) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + /* Lazily create the Netlink socket to listen for notifications. */ + if (!dpif->port_notifier) { + struct nl_sock *sock; + int error; + + error = nl_sock_create(NETLINK_GENERIC, &sock); + if (error) { + return error; + } + + error = nl_sock_join_mcgroup(sock, ovs_vport_mcgroup); + if (error) { + nl_sock_destroy(sock); + return error; + } + dpif->port_notifier = sock; + + /* We have no idea of the current state so report that everything + * changed. */ + return ENOBUFS; + } + + for (;;) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + uint64_t buf_stub[4096 / 8]; + struct ofpbuf buf; + int error; + + ofpbuf_use_stub(&buf, buf_stub, sizeof buf_stub); + error = nl_sock_recv(dpif->port_notifier, &buf, false); + if (!error) { + struct dpif_netlink_vport vport; + + error = dpif_netlink_vport_from_ofpbuf(&vport, &buf); + if (!error) { + if (vport.dp_ifindex == dpif->dp_ifindex + && (vport.cmd == OVS_VPORT_CMD_NEW + || vport.cmd == OVS_VPORT_CMD_DEL + || vport.cmd == OVS_VPORT_CMD_SET)) { + VLOG_DBG("port_changed: dpif:%s vport:%s cmd:%"PRIu8, + dpif->dpif.full_name, vport.name, vport.cmd); + if (vport.cmd == OVS_VPORT_CMD_DEL && dpif->handlers) { + dpif->refresh_channels = true; + } + *devnamep = xstrdup(vport.name); + ofpbuf_uninit(&buf); + return 0; + } + } + } else if (error != EAGAIN) { + VLOG_WARN_RL(&rl, "error reading or parsing netlink (%s)", + ovs_strerror(error)); + nl_sock_drain(dpif->port_notifier); + error = ENOBUFS; + } + + ofpbuf_uninit(&buf); + if (error) { + return error; + } + } +} + +static void +dpif_netlink_port_poll_wait(const struct dpif *dpif_) +{ + const struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + if (dpif->port_notifier) { + nl_sock_wait(dpif->port_notifier, POLLIN); + } else { + poll_immediate_wake(); + } +} + +static void +dpif_netlink_flow_init_ufid(struct dpif_netlink_flow *request, + const ovs_u128 *ufid, bool terse) +{ + if (ufid) { + request->ufid = *ufid; + request->ufid_present = true; + } else { + request->ufid_present = false; + } + request->ufid_terse = terse; +} + +static void +dpif_netlink_init_flow_get__(const struct dpif_netlink *dpif, + const struct nlattr *key, size_t key_len, + const ovs_u128 *ufid, bool terse, + struct dpif_netlink_flow *request) +{ + dpif_netlink_flow_init(request); + request->cmd = OVS_FLOW_CMD_GET; + request->dp_ifindex = dpif->dp_ifindex; + request->key = key; + request->key_len = key_len; + dpif_netlink_flow_init_ufid(request, ufid, terse); +} + +static void +dpif_netlink_init_flow_get(const struct dpif_netlink *dpif, + const struct dpif_flow_get *get, + struct dpif_netlink_flow *request) +{ + dpif_netlink_init_flow_get__(dpif, get->key, get->key_len, get->ufid, + false, request); +} + +static int +dpif_netlink_flow_get__(const struct dpif_netlink *dpif, + const struct nlattr *key, size_t key_len, + const ovs_u128 *ufid, bool terse, + struct dpif_netlink_flow *reply, struct ofpbuf **bufp) +{ + struct dpif_netlink_flow request; + + dpif_netlink_init_flow_get__(dpif, key, key_len, ufid, terse, &request); + return dpif_netlink_flow_transact(&request, reply, bufp); +} + +static int +dpif_netlink_flow_get(const struct dpif_netlink *dpif, + const struct dpif_netlink_flow *flow, + struct dpif_netlink_flow *reply, struct ofpbuf **bufp) +{ + return dpif_netlink_flow_get__(dpif, flow->key, flow->key_len, + flow->ufid_present ? &flow->ufid : NULL, + false, reply, bufp); +} + +static void +dpif_netlink_init_flow_put(struct dpif_netlink *dpif, + const struct dpif_flow_put *put, + struct dpif_netlink_flow *request) +{ + static const struct nlattr dummy_action; + + dpif_netlink_flow_init(request); + request->cmd = (put->flags & DPIF_FP_CREATE + ? OVS_FLOW_CMD_NEW : OVS_FLOW_CMD_SET); + request->dp_ifindex = dpif->dp_ifindex; + request->key = put->key; + request->key_len = put->key_len; + request->mask = put->mask; + request->mask_len = put->mask_len; + dpif_netlink_flow_init_ufid(request, put->ufid, false); + + /* Ensure that OVS_FLOW_ATTR_ACTIONS will always be included. */ + request->actions = (put->actions + ? put->actions + : CONST_CAST(struct nlattr *, &dummy_action)); + request->actions_len = put->actions_len; + if (put->flags & DPIF_FP_ZERO_STATS) { + request->clear = true; + } + if (put->flags & DPIF_FP_PROBE) { + request->probe = true; + } + request->nlmsg_flags = put->flags & DPIF_FP_MODIFY ? 0 : NLM_F_CREATE; +} + +static void +dpif_netlink_init_flow_del__(struct dpif_netlink *dpif, + const struct nlattr *key, size_t key_len, + const ovs_u128 *ufid, bool terse, + struct dpif_netlink_flow *request) +{ + dpif_netlink_flow_init(request); + request->cmd = OVS_FLOW_CMD_DEL; + request->dp_ifindex = dpif->dp_ifindex; + request->key = key; + request->key_len = key_len; + dpif_netlink_flow_init_ufid(request, ufid, terse); +} + +static void +dpif_netlink_init_flow_del(struct dpif_netlink *dpif, + const struct dpif_flow_del *del, + struct dpif_netlink_flow *request) +{ + return dpif_netlink_init_flow_del__(dpif, del->key, del->key_len, + del->ufid, del->terse, request); +} + +struct dpif_netlink_flow_dump { + struct dpif_flow_dump up; + struct nl_dump nl_dump; + atomic_int status; +}; + +static struct dpif_netlink_flow_dump * +dpif_netlink_flow_dump_cast(struct dpif_flow_dump *dump) +{ + return CONTAINER_OF(dump, struct dpif_netlink_flow_dump, up); +} + +static struct dpif_flow_dump * +dpif_netlink_flow_dump_create(const struct dpif *dpif_, bool terse) +{ + const struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + struct dpif_netlink_flow_dump *dump; + struct dpif_netlink_flow request; + struct ofpbuf *buf; + + dump = xmalloc(sizeof *dump); + dpif_flow_dump_init(&dump->up, dpif_); + + dpif_netlink_flow_init(&request); + request.cmd = OVS_FLOW_CMD_GET; + request.dp_ifindex = dpif->dp_ifindex; + request.ufid_present = false; + request.ufid_terse = terse; + + buf = ofpbuf_new(1024); + dpif_netlink_flow_to_ofpbuf(&request, buf); + nl_dump_start(&dump->nl_dump, NETLINK_GENERIC, buf); + ofpbuf_delete(buf); + atomic_init(&dump->status, 0); + dump->up.terse = terse; + + return &dump->up; +} + +static int +dpif_netlink_flow_dump_destroy(struct dpif_flow_dump *dump_) +{ + struct dpif_netlink_flow_dump *dump = dpif_netlink_flow_dump_cast(dump_); + unsigned int nl_status = nl_dump_done(&dump->nl_dump); + int dump_status; + + /* No other thread has access to 'dump' at this point. */ + atomic_read_relaxed(&dump->status, &dump_status); + free(dump); + return dump_status ? dump_status : nl_status; +} + +struct dpif_netlink_flow_dump_thread { + struct dpif_flow_dump_thread up; + struct dpif_netlink_flow_dump *dump; + struct dpif_netlink_flow flow; + struct dpif_flow_stats stats; + struct ofpbuf nl_flows; /* Always used to store flows. */ + struct ofpbuf *nl_actions; /* Used if kernel does not supply actions. */ +}; + +static struct dpif_netlink_flow_dump_thread * +dpif_netlink_flow_dump_thread_cast(struct dpif_flow_dump_thread *thread) +{ + return CONTAINER_OF(thread, struct dpif_netlink_flow_dump_thread, up); +} + +static struct dpif_flow_dump_thread * +dpif_netlink_flow_dump_thread_create(struct dpif_flow_dump *dump_) +{ + struct dpif_netlink_flow_dump *dump = dpif_netlink_flow_dump_cast(dump_); + struct dpif_netlink_flow_dump_thread *thread; + + thread = xmalloc(sizeof *thread); + dpif_flow_dump_thread_init(&thread->up, &dump->up); + thread->dump = dump; + ofpbuf_init(&thread->nl_flows, NL_DUMP_BUFSIZE); + thread->nl_actions = NULL; + + return &thread->up; +} + +static void +dpif_netlink_flow_dump_thread_destroy(struct dpif_flow_dump_thread *thread_) +{ + struct dpif_netlink_flow_dump_thread *thread + = dpif_netlink_flow_dump_thread_cast(thread_); + + ofpbuf_uninit(&thread->nl_flows); + ofpbuf_delete(thread->nl_actions); + free(thread); +} + +static void +dpif_netlink_flow_to_dpif_flow(struct dpif *dpif, struct dpif_flow *dpif_flow, + const struct dpif_netlink_flow *datapath_flow) +{ + dpif_flow->key = datapath_flow->key; + dpif_flow->key_len = datapath_flow->key_len; + dpif_flow->mask = datapath_flow->mask; + dpif_flow->mask_len = datapath_flow->mask_len; + dpif_flow->actions = datapath_flow->actions; + dpif_flow->actions_len = datapath_flow->actions_len; + dpif_flow->ufid_present = datapath_flow->ufid_present; + dpif_flow->pmd_id = PMD_ID_NULL; + if (datapath_flow->ufid_present) { + dpif_flow->ufid = datapath_flow->ufid; + } else { + ovs_assert(datapath_flow->key && datapath_flow->key_len); + dpif_flow_hash(dpif, datapath_flow->key, datapath_flow->key_len, + &dpif_flow->ufid); + } + dpif_netlink_flow_get_stats(datapath_flow, &dpif_flow->stats); +} + +static int +dpif_netlink_flow_dump_next(struct dpif_flow_dump_thread *thread_, + struct dpif_flow *flows, int max_flows) +{ + struct dpif_netlink_flow_dump_thread *thread + = dpif_netlink_flow_dump_thread_cast(thread_); + struct dpif_netlink_flow_dump *dump = thread->dump; + struct dpif_netlink *dpif = dpif_netlink_cast(thread->up.dpif); + int n_flows; + + ofpbuf_delete(thread->nl_actions); + thread->nl_actions = NULL; + + n_flows = 0; + while (!n_flows + || (n_flows < max_flows && thread->nl_flows.size)) { + struct dpif_netlink_flow datapath_flow; + struct ofpbuf nl_flow; + int error; + + /* Try to grab another flow. */ + if (!nl_dump_next(&dump->nl_dump, &nl_flow, &thread->nl_flows)) { + break; + } + + /* Convert the flow to our output format. */ + error = dpif_netlink_flow_from_ofpbuf(&datapath_flow, &nl_flow); + if (error) { + atomic_store_relaxed(&dump->status, error); + break; + } + + if (dump->up.terse || datapath_flow.actions) { + /* Common case: we don't want actions, or the flow includes + * actions. */ + dpif_netlink_flow_to_dpif_flow(&dpif->dpif, &flows[n_flows++], + &datapath_flow); + } else { + /* Rare case: the flow does not include actions. Retrieve this + * individual flow again to get the actions. */ + error = dpif_netlink_flow_get(dpif, &datapath_flow, + &datapath_flow, &thread->nl_actions); + if (error == ENOENT) { + VLOG_DBG("dumped flow disappeared on get"); + continue; + } else if (error) { + VLOG_WARN("error fetching dumped flow: %s", + ovs_strerror(error)); + atomic_store_relaxed(&dump->status, error); + break; + } + + /* Save this flow. Then exit, because we only have one buffer to + * handle this case. */ + dpif_netlink_flow_to_dpif_flow(&dpif->dpif, &flows[n_flows++], + &datapath_flow); + break; + } + } + return n_flows; +} + +static void +dpif_netlink_encode_execute(int dp_ifindex, const struct dpif_execute *d_exec, + struct ofpbuf *buf) +{ + struct ovs_header *k_exec; + size_t key_ofs; + + ofpbuf_prealloc_tailroom(buf, (64 + + dp_packet_size(d_exec->packet) + + ODP_KEY_METADATA_SIZE + + d_exec->actions_len)); + + nl_msg_put_genlmsghdr(buf, 0, ovs_packet_family, NLM_F_REQUEST, + OVS_PACKET_CMD_EXECUTE, OVS_PACKET_VERSION); + + k_exec = ofpbuf_put_uninit(buf, sizeof *k_exec); + k_exec->dp_ifindex = dp_ifindex; + + nl_msg_put_unspec(buf, OVS_PACKET_ATTR_PACKET, + dp_packet_data(d_exec->packet), + dp_packet_size(d_exec->packet)); + + key_ofs = nl_msg_start_nested(buf, OVS_PACKET_ATTR_KEY); + odp_key_from_pkt_metadata(buf, &d_exec->packet->md); + nl_msg_end_nested(buf, key_ofs); + + nl_msg_put_unspec(buf, OVS_PACKET_ATTR_ACTIONS, + d_exec->actions, d_exec->actions_len); + if (d_exec->probe) { + nl_msg_put_flag(buf, OVS_PACKET_ATTR_PROBE); + } +} + +/* Executes, against 'dpif', up to the first 'n_ops' operations in 'ops'. + * Returns the number actually executed (at least 1, if 'n_ops' is + * positive). */ +static size_t +dpif_netlink_operate__(struct dpif_netlink *dpif, + struct dpif_op **ops, size_t n_ops) +{ + enum { MAX_OPS = 50 }; + + struct op_auxdata { + struct nl_transaction txn; + + struct ofpbuf request; + uint64_t request_stub[1024 / 8]; + + struct ofpbuf reply; + uint64_t reply_stub[1024 / 8]; + } auxes[MAX_OPS]; + + struct nl_transaction *txnsp[MAX_OPS]; + size_t i; + + n_ops = MIN(n_ops, MAX_OPS); + for (i = 0; i < n_ops; i++) { + struct op_auxdata *aux = &auxes[i]; + struct dpif_op *op = ops[i]; + struct dpif_flow_put *put; + struct dpif_flow_del *del; + struct dpif_flow_get *get; + struct dpif_netlink_flow flow; + + ofpbuf_use_stub(&aux->request, + aux->request_stub, sizeof aux->request_stub); + aux->txn.request = &aux->request; + + ofpbuf_use_stub(&aux->reply, aux->reply_stub, sizeof aux->reply_stub); + aux->txn.reply = NULL; + + switch (op->type) { + case DPIF_OP_FLOW_PUT: + put = &op->u.flow_put; + dpif_netlink_init_flow_put(dpif, put, &flow); + if (put->stats) { + flow.nlmsg_flags |= NLM_F_ECHO; + aux->txn.reply = &aux->reply; + } + dpif_netlink_flow_to_ofpbuf(&flow, &aux->request); + break; + + case DPIF_OP_FLOW_DEL: + del = &op->u.flow_del; + dpif_netlink_init_flow_del(dpif, del, &flow); + if (del->stats) { + flow.nlmsg_flags |= NLM_F_ECHO; + aux->txn.reply = &aux->reply; + } + dpif_netlink_flow_to_ofpbuf(&flow, &aux->request); + break; + + case DPIF_OP_EXECUTE: + /* Can't execute a packet that won't fit in a Netlink attribute. */ + if (OVS_UNLIKELY(nl_attr_oversized( + dp_packet_size(op->u.execute.packet)))) { + /* Report an error immediately if this is the first operation. + * Otherwise the easiest thing to do is to postpone to the next + * call (when this will be the first operation). */ + if (i == 0) { + VLOG_ERR_RL(&error_rl, + "dropping oversized %"PRIu32"-byte packet", + dp_packet_size(op->u.execute.packet)); + op->error = ENOBUFS; + return 1; + } + n_ops = i; + } else { + dpif_netlink_encode_execute(dpif->dp_ifindex, &op->u.execute, + &aux->request); + } + break; + + case DPIF_OP_FLOW_GET: + get = &op->u.flow_get; + dpif_netlink_init_flow_get(dpif, get, &flow); + aux->txn.reply = get->buffer; + dpif_netlink_flow_to_ofpbuf(&flow, &aux->request); + break; + + default: + OVS_NOT_REACHED(); + } + } + + for (i = 0; i < n_ops; i++) { + txnsp[i] = &auxes[i].txn; + } + nl_transact_multiple(NETLINK_GENERIC, txnsp, n_ops); + + for (i = 0; i < n_ops; i++) { + struct op_auxdata *aux = &auxes[i]; + struct nl_transaction *txn = &auxes[i].txn; + struct dpif_op *op = ops[i]; + struct dpif_flow_put *put; + struct dpif_flow_del *del; + struct dpif_flow_get *get; + + op->error = txn->error; + + switch (op->type) { + case DPIF_OP_FLOW_PUT: + put = &op->u.flow_put; + if (put->stats) { + if (!op->error) { + struct dpif_netlink_flow reply; + + op->error = dpif_netlink_flow_from_ofpbuf(&reply, + txn->reply); + if (!op->error) { + dpif_netlink_flow_get_stats(&reply, put->stats); + } + } + } + break; + + case DPIF_OP_FLOW_DEL: + del = &op->u.flow_del; + if (del->stats) { + if (!op->error) { + struct dpif_netlink_flow reply; + + op->error = dpif_netlink_flow_from_ofpbuf(&reply, + txn->reply); + if (!op->error) { + dpif_netlink_flow_get_stats(&reply, del->stats); + } + } + } + break; + + case DPIF_OP_EXECUTE: + break; + + case DPIF_OP_FLOW_GET: + get = &op->u.flow_get; + if (!op->error) { + struct dpif_netlink_flow reply; + + op->error = dpif_netlink_flow_from_ofpbuf(&reply, txn->reply); + if (!op->error) { + dpif_netlink_flow_to_dpif_flow(&dpif->dpif, get->flow, + &reply); + } + } + break; + + default: + OVS_NOT_REACHED(); + } + + ofpbuf_uninit(&aux->request); + ofpbuf_uninit(&aux->reply); + } + + return n_ops; +} + +static void +dpif_netlink_operate(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + while (n_ops > 0) { + size_t chunk = dpif_netlink_operate__(dpif, ops, n_ops); + ops += chunk; + n_ops -= chunk; + } +} + +#if _WIN32 +static void +dpif_netlink_handler_uninit(struct dpif_handler *handler) +{ + vport_delete_sock_pool(handler); +} + +static int +dpif_netlink_handler_init(struct dpif_handler *handler) +{ + return vport_create_sock_pool(handler); +} +#else + +static int +dpif_netlink_handler_init(struct dpif_handler *handler) +{ + handler->epoll_fd = epoll_create(10); + return handler->epoll_fd < 0 ? errno : 0; +} + +static void +dpif_netlink_handler_uninit(struct dpif_handler *handler) +{ + close(handler->epoll_fd); +} +#endif + +/* Synchronizes 'channels' in 'dpif->handlers' with the set of vports + * currently in 'dpif' in the kernel, by adding a new set of channels for + * any kernel vport that lacks one and deleting any channels that have no + * backing kernel vports. */ +static int +dpif_netlink_refresh_channels(struct dpif_netlink *dpif, uint32_t n_handlers) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + unsigned long int *keep_channels; + struct dpif_netlink_vport vport; + size_t keep_channels_nbits; + struct nl_dump dump; + uint64_t reply_stub[NL_DUMP_BUFSIZE / 8]; + struct ofpbuf buf; + int retval = 0; + size_t i; + + ovs_assert(!WINDOWS || n_handlers <= 1); + ovs_assert(!WINDOWS || dpif->n_handlers <= 1); + + if (dpif->n_handlers != n_handlers) { + destroy_all_channels(dpif); + dpif->handlers = xzalloc(n_handlers * sizeof *dpif->handlers); + for (i = 0; i < n_handlers; i++) { + int error; + struct dpif_handler *handler = &dpif->handlers[i]; + + error = dpif_netlink_handler_init(handler); + if (error) { + size_t j; + struct dpif_handler *tmp = &dpif->handlers[i]; + + + for (j = 0; j < i; j++) { + dpif_netlink_handler_uninit(tmp); + } + free(dpif->handlers); + dpif->handlers = NULL; + + return error; + } + } + dpif->n_handlers = n_handlers; + } + + for (i = 0; i < n_handlers; i++) { + struct dpif_handler *handler = &dpif->handlers[i]; + + handler->event_offset = handler->n_events = 0; + } + + keep_channels_nbits = dpif->uc_array_size; + keep_channels = bitmap_allocate(keep_channels_nbits); + + ofpbuf_use_stub(&buf, reply_stub, sizeof reply_stub); + dpif_netlink_port_dump_start__(dpif, &dump); + while (!dpif_netlink_port_dump_next__(dpif, &dump, &vport, &buf)) { + uint32_t port_no = odp_to_u32(vport.port_no); + uint32_t *upcall_pids = NULL; + int error; + + if (port_no >= dpif->uc_array_size + || !vport_get_pids(dpif, port_no, &upcall_pids)) { + struct nl_sock **socksp = vport_create_socksp(dpif, &error); + + if (!socksp) { + goto error; + } + + error = vport_add_channels(dpif, vport.port_no, socksp); + if (error) { + VLOG_INFO("%s: could not add channels for port %s", + dpif_name(&dpif->dpif), vport.name); + vport_del_socksp(dpif, socksp); + retval = error; + goto error; + } + upcall_pids = vport_socksp_to_pids(socksp, dpif->n_handlers); + free(socksp); + } + + /* Configure the vport to deliver misses to 'sock'. */ + if (vport.upcall_pids[0] == 0 + || vport.n_upcall_pids != dpif->n_handlers + || memcmp(upcall_pids, vport.upcall_pids, n_handlers * sizeof + *upcall_pids)) { + struct dpif_netlink_vport vport_request; + + dpif_netlink_vport_init(&vport_request); + vport_request.cmd = OVS_VPORT_CMD_SET; + vport_request.dp_ifindex = dpif->dp_ifindex; + vport_request.port_no = vport.port_no; + vport_request.n_upcall_pids = dpif->n_handlers; + vport_request.upcall_pids = upcall_pids; + error = dpif_netlink_vport_transact(&vport_request, NULL, NULL); + if (error) { + VLOG_WARN_RL(&error_rl, + "%s: failed to set upcall pid on port: %s", + dpif_name(&dpif->dpif), ovs_strerror(error)); + + if (error != ENODEV && error != ENOENT) { + retval = error; + } else { + /* The vport isn't really there, even though the dump says + * it is. Probably we just hit a race after a port + * disappeared. */ + } + goto error; + } + } + + if (port_no < keep_channels_nbits) { + bitmap_set1(keep_channels, port_no); + } + free(upcall_pids); + continue; + + error: + free(upcall_pids); + vport_del_channels(dpif, vport.port_no); + } + nl_dump_done(&dump); + ofpbuf_uninit(&buf); + + /* Discard any saved channels that we didn't reuse. */ + for (i = 0; i < keep_channels_nbits; i++) { + if (!bitmap_is_set(keep_channels, i)) { + vport_del_channels(dpif, u32_to_odp(i)); + } + } + free(keep_channels); + + return retval; +} + +static int +dpif_netlink_recv_set__(struct dpif_netlink *dpif, bool enable) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + if ((dpif->handlers != NULL) == enable) { + return 0; + } else if (!enable) { + destroy_all_channels(dpif); + return 0; + } else { + return dpif_netlink_refresh_channels(dpif, 1); + } +} + +static int +dpif_netlink_recv_set(struct dpif *dpif_, bool enable) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + int error; + + fat_rwlock_wrlock(&dpif->upcall_lock); + error = dpif_netlink_recv_set__(dpif, enable); + fat_rwlock_unlock(&dpif->upcall_lock); + + return error; +} + +static int +dpif_netlink_handlers_set(struct dpif *dpif_, uint32_t n_handlers) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + int error = 0; + +#ifdef _WIN32 + /* Multiple upcall handlers will be supported once kernel datapath supports + * it. */ + if (n_handlers > 1) { + return error; + } +#endif + + fat_rwlock_wrlock(&dpif->upcall_lock); + if (dpif->handlers) { + error = dpif_netlink_refresh_channels(dpif, n_handlers); + } + fat_rwlock_unlock(&dpif->upcall_lock); + + return error; +} + +static int +dpif_netlink_queue_to_priority(const struct dpif *dpif OVS_UNUSED, + uint32_t queue_id, uint32_t *priority) +{ + if (queue_id < 0xf000) { + *priority = TC_H_MAKE(1 << 16, queue_id + 1); + return 0; + } else { + return EINVAL; + } +} + +static int +parse_odp_packet(const struct dpif_netlink *dpif, struct ofpbuf *buf, + struct dpif_upcall *upcall, int *dp_ifindex) +{ + static const struct nl_policy ovs_packet_policy[] = { + /* Always present. */ + [OVS_PACKET_ATTR_PACKET] = { .type = NL_A_UNSPEC, + .min_len = ETH_HEADER_LEN }, + [OVS_PACKET_ATTR_KEY] = { .type = NL_A_NESTED }, + + /* OVS_PACKET_CMD_ACTION only. */ + [OVS_PACKET_ATTR_USERDATA] = { .type = NL_A_UNSPEC, .optional = true }, + [OVS_PACKET_ATTR_EGRESS_TUN_KEY] = { .type = NL_A_NESTED, .optional = true }, + }; + + struct ovs_header *ovs_header; + struct nlattr *a[ARRAY_SIZE(ovs_packet_policy)]; + struct nlmsghdr *nlmsg; + struct genlmsghdr *genl; + struct ofpbuf b; + int type; + + ofpbuf_use_const(&b, buf->data, buf->size); + + nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); + genl = ofpbuf_try_pull(&b, sizeof *genl); + ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); + if (!nlmsg || !genl || !ovs_header + || nlmsg->nlmsg_type != ovs_packet_family + || !nl_policy_parse(&b, 0, ovs_packet_policy, a, + ARRAY_SIZE(ovs_packet_policy))) { + return EINVAL; + } + + type = (genl->cmd == OVS_PACKET_CMD_MISS ? DPIF_UC_MISS + : genl->cmd == OVS_PACKET_CMD_ACTION ? DPIF_UC_ACTION + : -1); + if (type < 0) { + return EINVAL; + } + + /* (Re)set ALL fields of '*upcall' on successful return. */ + upcall->type = type; + upcall->key = CONST_CAST(struct nlattr *, + nl_attr_get(a[OVS_PACKET_ATTR_KEY])); + upcall->key_len = nl_attr_get_size(a[OVS_PACKET_ATTR_KEY]); + dpif_flow_hash(&dpif->dpif, upcall->key, upcall->key_len, &upcall->ufid); + upcall->userdata = a[OVS_PACKET_ATTR_USERDATA]; + upcall->out_tun_key = a[OVS_PACKET_ATTR_EGRESS_TUN_KEY]; + + /* Allow overwriting the netlink attribute header without reallocating. */ + dp_packet_use_stub(&upcall->packet, + CONST_CAST(struct nlattr *, + nl_attr_get(a[OVS_PACKET_ATTR_PACKET])) - 1, + nl_attr_get_size(a[OVS_PACKET_ATTR_PACKET]) + + sizeof(struct nlattr)); + dp_packet_set_data(&upcall->packet, + (char *)dp_packet_data(&upcall->packet) + sizeof(struct nlattr)); + dp_packet_set_size(&upcall->packet, nl_attr_get_size(a[OVS_PACKET_ATTR_PACKET])); + + *dp_ifindex = ovs_header->dp_ifindex; + + return 0; +} + +#ifdef _WIN32 +#define PACKET_RECV_BATCH_SIZE 50 +static int +dpif_netlink_recv_windows(struct dpif_netlink *dpif, uint32_t handler_id, + struct dpif_upcall *upcall, struct ofpbuf *buf) + OVS_REQ_RDLOCK(dpif->upcall_lock) +{ + struct dpif_handler *handler; + int read_tries = 0; + struct dpif_windows_vport_sock *sock_pool; + uint32_t i; + + if (!dpif->handlers) { + return EAGAIN; + } + + /* Only one handler is supported currently. */ + if (handler_id >= 1) { + return EAGAIN; + } + + if (handler_id >= dpif->n_handlers) { + return EAGAIN; + } + + handler = &dpif->handlers[handler_id]; + sock_pool = handler->vport_sock_pool; + + for (i = 0; i < VPORT_SOCK_POOL_SIZE; i++) { + for (;;) { + int dp_ifindex; + int error; + + if (++read_tries > PACKET_RECV_BATCH_SIZE) { + return EAGAIN; + } + + error = nl_sock_recv(sock_pool[i].nl_sock, buf, false); + if (error == ENOBUFS) { + /* ENOBUFS typically means that we've received so many + * packets that the buffer overflowed. Try again + * immediately because there's almost certainly a packet + * waiting for us. */ + /* XXX: report_loss(dpif, ch, idx, handler_id); */ + continue; + } + + /* XXX: ch->last_poll = time_msec(); */ + if (error) { + if (error == EAGAIN) { + break; + } + return error; + } + + error = parse_odp_packet(dpif, buf, upcall, &dp_ifindex); + if (!error && dp_ifindex == dpif->dp_ifindex) { + return 0; + } else if (error) { + return error; + } + } + } + + return EAGAIN; +} +#else +static int +dpif_netlink_recv__(struct dpif_netlink *dpif, uint32_t handler_id, + struct dpif_upcall *upcall, struct ofpbuf *buf) + OVS_REQ_RDLOCK(dpif->upcall_lock) +{ + struct dpif_handler *handler; + int read_tries = 0; + + if (!dpif->handlers || handler_id >= dpif->n_handlers) { + return EAGAIN; + } + + handler = &dpif->handlers[handler_id]; + if (handler->event_offset >= handler->n_events) { + int retval; + + handler->event_offset = handler->n_events = 0; + + do { + retval = epoll_wait(handler->epoll_fd, handler->epoll_events, + dpif->uc_array_size, 0); + } while (retval < 0 && errno == EINTR); + + if (retval < 0) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + VLOG_WARN_RL(&rl, "epoll_wait failed (%s)", ovs_strerror(errno)); + } else if (retval > 0) { + handler->n_events = retval; + } + } + + while (handler->event_offset < handler->n_events) { + int idx = handler->epoll_events[handler->event_offset].data.u32; + struct dpif_channel *ch = &dpif->handlers[handler_id].channels[idx]; + + handler->event_offset++; + + for (;;) { + int dp_ifindex; + int error; + + if (++read_tries > 50) { + return EAGAIN; + } + + error = nl_sock_recv(ch->sock, buf, false); + if (error == ENOBUFS) { + /* ENOBUFS typically means that we've received so many + * packets that the buffer overflowed. Try again + * immediately because there's almost certainly a packet + * waiting for us. */ + report_loss(dpif, ch, idx, handler_id); + continue; + } + + ch->last_poll = time_msec(); + if (error) { + if (error == EAGAIN) { + break; + } + return error; + } + + error = parse_odp_packet(dpif, buf, upcall, &dp_ifindex); + if (!error && dp_ifindex == dpif->dp_ifindex) { + return 0; + } else if (error) { + return error; + } + } + } + + return EAGAIN; +} +#endif + +static int +dpif_netlink_recv(struct dpif *dpif_, uint32_t handler_id, + struct dpif_upcall *upcall, struct ofpbuf *buf) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + int error; + + fat_rwlock_rdlock(&dpif->upcall_lock); +#ifdef _WIN32 + error = dpif_netlink_recv_windows(dpif, handler_id, upcall, buf); +#else + error = dpif_netlink_recv__(dpif, handler_id, upcall, buf); +#endif + fat_rwlock_unlock(&dpif->upcall_lock); + + return error; +} + +static void +dpif_netlink_recv_wait__(struct dpif_netlink *dpif, uint32_t handler_id) + OVS_REQ_RDLOCK(dpif->upcall_lock) +{ +#ifdef _WIN32 + uint32_t i; + struct dpif_windows_vport_sock *sock_pool = + dpif->handlers[handler_id].vport_sock_pool; + + /* Only one handler is supported currently. */ + if (handler_id >= 1) { + return; + } + + for (i = 0; i < VPORT_SOCK_POOL_SIZE; i++) { + nl_sock_wait(sock_pool[i].nl_sock, POLLIN); + } +#else + if (dpif->handlers && handler_id < dpif->n_handlers) { + struct dpif_handler *handler = &dpif->handlers[handler_id]; + + poll_fd_wait(handler->epoll_fd, POLLIN); + } +#endif +} + +static void +dpif_netlink_recv_wait(struct dpif *dpif_, uint32_t handler_id) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + fat_rwlock_rdlock(&dpif->upcall_lock); + dpif_netlink_recv_wait__(dpif, handler_id); + fat_rwlock_unlock(&dpif->upcall_lock); +} + +static void +dpif_netlink_recv_purge__(struct dpif_netlink *dpif) + OVS_REQ_WRLOCK(dpif->upcall_lock) +{ + if (dpif->handlers) { + size_t i, j; + + for (i = 0; i < dpif->uc_array_size; i++ ) { + if (!dpif->handlers[0].channels[i].sock) { + continue; + } + + for (j = 0; j < dpif->n_handlers; j++) { + nl_sock_drain(dpif->handlers[j].channels[i].sock); + } + } + } +} + +static void +dpif_netlink_recv_purge(struct dpif *dpif_) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + + fat_rwlock_wrlock(&dpif->upcall_lock); + dpif_netlink_recv_purge__(dpif); + fat_rwlock_unlock(&dpif->upcall_lock); +} + +static char * +dpif_netlink_get_datapath_version(void) +{ + char *version_str = NULL; + +#ifdef __linux__ + +#define MAX_VERSION_STR_SIZE 80 +#define LINUX_DATAPATH_VERSION_FILE "/sys/module/openvswitch/version" + FILE *f; + + f = fopen(LINUX_DATAPATH_VERSION_FILE, "r"); + if (f) { + char *newline; + char version[MAX_VERSION_STR_SIZE]; + + if (fgets(version, MAX_VERSION_STR_SIZE, f)) { + newline = strchr(version, '\n'); + if (newline) { + *newline = '\0'; + } + version_str = xstrdup(version); + } + fclose(f); + } +#endif + + return version_str; +} + +const struct dpif_class dpif_netlink_class = { + "system", + NULL, /* init */ + dpif_netlink_enumerate, + NULL, + dpif_netlink_open, + dpif_netlink_close, + dpif_netlink_destroy, + dpif_netlink_run, + NULL, /* wait */ + dpif_netlink_get_stats, + dpif_netlink_port_add, + dpif_netlink_port_del, + dpif_netlink_port_query_by_number, + dpif_netlink_port_query_by_name, + dpif_netlink_port_get_pid, + dpif_netlink_port_dump_start, + dpif_netlink_port_dump_next, + dpif_netlink_port_dump_done, + dpif_netlink_port_poll, + dpif_netlink_port_poll_wait, + dpif_netlink_flow_flush, + dpif_netlink_flow_dump_create, + dpif_netlink_flow_dump_destroy, + dpif_netlink_flow_dump_thread_create, + dpif_netlink_flow_dump_thread_destroy, + dpif_netlink_flow_dump_next, + dpif_netlink_operate, + dpif_netlink_recv_set, + dpif_netlink_handlers_set, + NULL, /* poll_thread_set */ + dpif_netlink_queue_to_priority, + dpif_netlink_recv, + dpif_netlink_recv_wait, + dpif_netlink_recv_purge, + NULL, /* register_upcall_cb */ + NULL, /* enable_upcall */ + NULL, /* disable_upcall */ + dpif_netlink_get_datapath_version, /* get_datapath_version */ +}; + +static int +dpif_netlink_init(void) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + static int error; + + if (ovsthread_once_start(&once)) { + error = nl_lookup_genl_family(OVS_DATAPATH_FAMILY, + &ovs_datapath_family); + if (error) { + VLOG_ERR("Generic Netlink family '%s' does not exist. " + "The Open vSwitch kernel module is probably not loaded.", + OVS_DATAPATH_FAMILY); + } + if (!error) { + error = nl_lookup_genl_family(OVS_VPORT_FAMILY, &ovs_vport_family); + } + if (!error) { + error = nl_lookup_genl_family(OVS_FLOW_FAMILY, &ovs_flow_family); + } + if (!error) { + error = nl_lookup_genl_family(OVS_PACKET_FAMILY, + &ovs_packet_family); + } + if (!error) { + error = nl_lookup_genl_mcgroup(OVS_VPORT_FAMILY, OVS_VPORT_MCGROUP, + &ovs_vport_mcgroup); + } + + ovsthread_once_done(&once); + } + + return error; +} + +bool +dpif_netlink_is_internal_device(const char *name) +{ + struct dpif_netlink_vport reply; + struct ofpbuf *buf; + int error; + + error = dpif_netlink_vport_get(name, &reply, &buf); + if (!error) { + ofpbuf_delete(buf); + } else if (error != ENODEV && error != ENOENT) { + VLOG_WARN_RL(&error_rl, "%s: vport query failed (%s)", + name, ovs_strerror(error)); + } + + return reply.type == OVS_VPORT_TYPE_INTERNAL; +} + +/* Parses the contents of 'buf', which contains a "struct ovs_header" followed + * by Netlink attributes, into 'vport'. Returns 0 if successful, otherwise a + * positive errno value. + * + * 'vport' will contain pointers into 'buf', so the caller should not free + * 'buf' while 'vport' is still in use. */ +static int +dpif_netlink_vport_from_ofpbuf(struct dpif_netlink_vport *vport, + const struct ofpbuf *buf) +{ + static const struct nl_policy ovs_vport_policy[] = { + [OVS_VPORT_ATTR_PORT_NO] = { .type = NL_A_U32 }, + [OVS_VPORT_ATTR_TYPE] = { .type = NL_A_U32 }, + [OVS_VPORT_ATTR_NAME] = { .type = NL_A_STRING, .max_len = IFNAMSIZ }, + [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NL_A_UNSPEC }, + [OVS_VPORT_ATTR_STATS] = { NL_POLICY_FOR(struct ovs_vport_stats), + .optional = true }, + [OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = true }, + }; + + struct nlattr *a[ARRAY_SIZE(ovs_vport_policy)]; + struct ovs_header *ovs_header; + struct nlmsghdr *nlmsg; + struct genlmsghdr *genl; + struct ofpbuf b; + + dpif_netlink_vport_init(vport); + + ofpbuf_use_const(&b, buf->data, buf->size); + nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); + genl = ofpbuf_try_pull(&b, sizeof *genl); + ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); + if (!nlmsg || !genl || !ovs_header + || nlmsg->nlmsg_type != ovs_vport_family + || !nl_policy_parse(&b, 0, ovs_vport_policy, a, + ARRAY_SIZE(ovs_vport_policy))) { + return EINVAL; + } + + vport->cmd = genl->cmd; + vport->dp_ifindex = ovs_header->dp_ifindex; + vport->port_no = nl_attr_get_odp_port(a[OVS_VPORT_ATTR_PORT_NO]); + vport->type = nl_attr_get_u32(a[OVS_VPORT_ATTR_TYPE]); + vport->name = nl_attr_get_string(a[OVS_VPORT_ATTR_NAME]); + if (a[OVS_VPORT_ATTR_UPCALL_PID]) { + vport->n_upcall_pids = nl_attr_get_size(a[OVS_VPORT_ATTR_UPCALL_PID]) + / (sizeof *vport->upcall_pids); + vport->upcall_pids = nl_attr_get(a[OVS_VPORT_ATTR_UPCALL_PID]); + + } + if (a[OVS_VPORT_ATTR_STATS]) { + vport->stats = nl_attr_get(a[OVS_VPORT_ATTR_STATS]); + } + if (a[OVS_VPORT_ATTR_OPTIONS]) { + vport->options = nl_attr_get(a[OVS_VPORT_ATTR_OPTIONS]); + vport->options_len = nl_attr_get_size(a[OVS_VPORT_ATTR_OPTIONS]); + } + return 0; +} + +/* Appends to 'buf' (which must initially be empty) a "struct ovs_header" + * followed by Netlink attributes corresponding to 'vport'. */ +static void +dpif_netlink_vport_to_ofpbuf(const struct dpif_netlink_vport *vport, + struct ofpbuf *buf) +{ + struct ovs_header *ovs_header; + + nl_msg_put_genlmsghdr(buf, 0, ovs_vport_family, NLM_F_REQUEST | NLM_F_ECHO, + vport->cmd, OVS_VPORT_VERSION); + + ovs_header = ofpbuf_put_uninit(buf, sizeof *ovs_header); + ovs_header->dp_ifindex = vport->dp_ifindex; + + if (vport->port_no != ODPP_NONE) { + nl_msg_put_odp_port(buf, OVS_VPORT_ATTR_PORT_NO, vport->port_no); + } + + if (vport->type != OVS_VPORT_TYPE_UNSPEC) { + nl_msg_put_u32(buf, OVS_VPORT_ATTR_TYPE, vport->type); + } + + if (vport->name) { + nl_msg_put_string(buf, OVS_VPORT_ATTR_NAME, vport->name); + } + + if (vport->upcall_pids) { + nl_msg_put_unspec(buf, OVS_VPORT_ATTR_UPCALL_PID, + vport->upcall_pids, + vport->n_upcall_pids * sizeof *vport->upcall_pids); + } + + if (vport->stats) { + nl_msg_put_unspec(buf, OVS_VPORT_ATTR_STATS, + vport->stats, sizeof *vport->stats); + } + + if (vport->options) { + nl_msg_put_nested(buf, OVS_VPORT_ATTR_OPTIONS, + vport->options, vport->options_len); + } +} + +/* Clears 'vport' to "empty" values. */ +void +dpif_netlink_vport_init(struct dpif_netlink_vport *vport) +{ + memset(vport, 0, sizeof *vport); + vport->port_no = ODPP_NONE; +} + +/* Executes 'request' in the kernel datapath. If the command fails, returns a + * positive errno value. Otherwise, if 'reply' and 'bufp' are null, returns 0 + * without doing anything else. If 'reply' and 'bufp' are nonnull, then the + * result of the command is expected to be an ovs_vport also, which is decoded + * and stored in '*reply' and '*bufp'. The caller must free '*bufp' when the + * reply is no longer needed ('reply' will contain pointers into '*bufp'). */ +int +dpif_netlink_vport_transact(const struct dpif_netlink_vport *request, + struct dpif_netlink_vport *reply, + struct ofpbuf **bufp) +{ + struct ofpbuf *request_buf; + int error; + + ovs_assert((reply != NULL) == (bufp != NULL)); + + error = dpif_netlink_init(); + if (error) { + if (reply) { + *bufp = NULL; + dpif_netlink_vport_init(reply); + } + return error; + } + + request_buf = ofpbuf_new(1024); + dpif_netlink_vport_to_ofpbuf(request, request_buf); + error = nl_transact(NETLINK_GENERIC, request_buf, bufp); + ofpbuf_delete(request_buf); + + if (reply) { + if (!error) { + error = dpif_netlink_vport_from_ofpbuf(reply, *bufp); + } + if (error) { + dpif_netlink_vport_init(reply); + ofpbuf_delete(*bufp); + *bufp = NULL; + } + } + return error; +} + +/* Obtains information about the kernel vport named 'name' and stores it into + * '*reply' and '*bufp'. The caller must free '*bufp' when the reply is no + * longer needed ('reply' will contain pointers into '*bufp'). */ +int +dpif_netlink_vport_get(const char *name, struct dpif_netlink_vport *reply, + struct ofpbuf **bufp) +{ + struct dpif_netlink_vport request; + + dpif_netlink_vport_init(&request); + request.cmd = OVS_VPORT_CMD_GET; + request.name = name; + + return dpif_netlink_vport_transact(&request, reply, bufp); +} + +/* Parses the contents of 'buf', which contains a "struct ovs_header" followed + * by Netlink attributes, into 'dp'. Returns 0 if successful, otherwise a + * positive errno value. + * + * 'dp' will contain pointers into 'buf', so the caller should not free 'buf' + * while 'dp' is still in use. */ +static int +dpif_netlink_dp_from_ofpbuf(struct dpif_netlink_dp *dp, const struct ofpbuf *buf) +{ + static const struct nl_policy ovs_datapath_policy[] = { + [OVS_DP_ATTR_NAME] = { .type = NL_A_STRING, .max_len = IFNAMSIZ }, + [OVS_DP_ATTR_STATS] = { NL_POLICY_FOR(struct ovs_dp_stats), + .optional = true }, + [OVS_DP_ATTR_MEGAFLOW_STATS] = { + NL_POLICY_FOR(struct ovs_dp_megaflow_stats), + .optional = true }, + }; + + struct nlattr *a[ARRAY_SIZE(ovs_datapath_policy)]; + struct ovs_header *ovs_header; + struct nlmsghdr *nlmsg; + struct genlmsghdr *genl; + struct ofpbuf b; + + dpif_netlink_dp_init(dp); + + ofpbuf_use_const(&b, buf->data, buf->size); + nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); + genl = ofpbuf_try_pull(&b, sizeof *genl); + ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); + if (!nlmsg || !genl || !ovs_header + || nlmsg->nlmsg_type != ovs_datapath_family + || !nl_policy_parse(&b, 0, ovs_datapath_policy, a, + ARRAY_SIZE(ovs_datapath_policy))) { + return EINVAL; + } + + dp->cmd = genl->cmd; + dp->dp_ifindex = ovs_header->dp_ifindex; + dp->name = nl_attr_get_string(a[OVS_DP_ATTR_NAME]); + if (a[OVS_DP_ATTR_STATS]) { + dp->stats = nl_attr_get(a[OVS_DP_ATTR_STATS]); + } + + if (a[OVS_DP_ATTR_MEGAFLOW_STATS]) { + dp->megaflow_stats = nl_attr_get(a[OVS_DP_ATTR_MEGAFLOW_STATS]); + } + + return 0; +} + +/* Appends to 'buf' the Generic Netlink message described by 'dp'. */ +static void +dpif_netlink_dp_to_ofpbuf(const struct dpif_netlink_dp *dp, struct ofpbuf *buf) +{ + struct ovs_header *ovs_header; + + nl_msg_put_genlmsghdr(buf, 0, ovs_datapath_family, + NLM_F_REQUEST | NLM_F_ECHO, dp->cmd, + OVS_DATAPATH_VERSION); + + ovs_header = ofpbuf_put_uninit(buf, sizeof *ovs_header); + ovs_header->dp_ifindex = dp->dp_ifindex; + + if (dp->name) { + nl_msg_put_string(buf, OVS_DP_ATTR_NAME, dp->name); + } + + if (dp->upcall_pid) { + nl_msg_put_u32(buf, OVS_DP_ATTR_UPCALL_PID, *dp->upcall_pid); + } + + if (dp->user_features) { + nl_msg_put_u32(buf, OVS_DP_ATTR_USER_FEATURES, dp->user_features); + } + + /* Skip OVS_DP_ATTR_STATS since we never have a reason to serialize it. */ +} + +/* Clears 'dp' to "empty" values. */ +static void +dpif_netlink_dp_init(struct dpif_netlink_dp *dp) +{ + memset(dp, 0, sizeof *dp); +} + +static void +dpif_netlink_dp_dump_start(struct nl_dump *dump) +{ + struct dpif_netlink_dp request; + struct ofpbuf *buf; + + dpif_netlink_dp_init(&request); + request.cmd = OVS_DP_CMD_GET; + + buf = ofpbuf_new(1024); + dpif_netlink_dp_to_ofpbuf(&request, buf); + nl_dump_start(dump, NETLINK_GENERIC, buf); + ofpbuf_delete(buf); +} + +/* Executes 'request' in the kernel datapath. If the command fails, returns a + * positive errno value. Otherwise, if 'reply' and 'bufp' are null, returns 0 + * without doing anything else. If 'reply' and 'bufp' are nonnull, then the + * result of the command is expected to be of the same form, which is decoded + * and stored in '*reply' and '*bufp'. The caller must free '*bufp' when the + * reply is no longer needed ('reply' will contain pointers into '*bufp'). */ +static int +dpif_netlink_dp_transact(const struct dpif_netlink_dp *request, + struct dpif_netlink_dp *reply, struct ofpbuf **bufp) +{ + struct ofpbuf *request_buf; + int error; + + ovs_assert((reply != NULL) == (bufp != NULL)); + + request_buf = ofpbuf_new(1024); + dpif_netlink_dp_to_ofpbuf(request, request_buf); + error = nl_transact(NETLINK_GENERIC, request_buf, bufp); + ofpbuf_delete(request_buf); + + if (reply) { + dpif_netlink_dp_init(reply); + if (!error) { + error = dpif_netlink_dp_from_ofpbuf(reply, *bufp); + } + if (error) { + ofpbuf_delete(*bufp); + *bufp = NULL; + } + } + return error; +} + +/* Obtains information about 'dpif_' and stores it into '*reply' and '*bufp'. + * The caller must free '*bufp' when the reply is no longer needed ('reply' + * will contain pointers into '*bufp'). */ +static int +dpif_netlink_dp_get(const struct dpif *dpif_, struct dpif_netlink_dp *reply, + struct ofpbuf **bufp) +{ + struct dpif_netlink *dpif = dpif_netlink_cast(dpif_); + struct dpif_netlink_dp request; + + dpif_netlink_dp_init(&request); + request.cmd = OVS_DP_CMD_GET; + request.dp_ifindex = dpif->dp_ifindex; + + return dpif_netlink_dp_transact(&request, reply, bufp); +} + +/* Parses the contents of 'buf', which contains a "struct ovs_header" followed + * by Netlink attributes, into 'flow'. Returns 0 if successful, otherwise a + * positive errno value. + * + * 'flow' will contain pointers into 'buf', so the caller should not free 'buf' + * while 'flow' is still in use. */ +static int +dpif_netlink_flow_from_ofpbuf(struct dpif_netlink_flow *flow, + const struct ofpbuf *buf) +{ + static const struct nl_policy ovs_flow_policy[__OVS_FLOW_ATTR_MAX] = { + [OVS_FLOW_ATTR_KEY] = { .type = NL_A_NESTED, .optional = true }, + [OVS_FLOW_ATTR_MASK] = { .type = NL_A_NESTED, .optional = true }, + [OVS_FLOW_ATTR_ACTIONS] = { .type = NL_A_NESTED, .optional = true }, + [OVS_FLOW_ATTR_STATS] = { NL_POLICY_FOR(struct ovs_flow_stats), + .optional = true }, + [OVS_FLOW_ATTR_TCP_FLAGS] = { .type = NL_A_U8, .optional = true }, + [OVS_FLOW_ATTR_USED] = { .type = NL_A_U64, .optional = true }, + [OVS_FLOW_ATTR_UFID] = { .type = NL_A_UNSPEC, .optional = true, + .min_len = sizeof(ovs_u128) }, + /* The kernel never uses OVS_FLOW_ATTR_CLEAR. */ + /* The kernel never uses OVS_FLOW_ATTR_PROBE. */ + /* The kernel never uses OVS_FLOW_ATTR_UFID_FLAGS. */ + }; + + struct nlattr *a[ARRAY_SIZE(ovs_flow_policy)]; + struct ovs_header *ovs_header; + struct nlmsghdr *nlmsg; + struct genlmsghdr *genl; + struct ofpbuf b; + + dpif_netlink_flow_init(flow); + + ofpbuf_use_const(&b, buf->data, buf->size); + nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); + genl = ofpbuf_try_pull(&b, sizeof *genl); + ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); + if (!nlmsg || !genl || !ovs_header + || nlmsg->nlmsg_type != ovs_flow_family + || !nl_policy_parse(&b, 0, ovs_flow_policy, a, + ARRAY_SIZE(ovs_flow_policy))) { + return EINVAL; + } + if (!a[OVS_FLOW_ATTR_KEY] && !a[OVS_FLOW_ATTR_UFID]) { + return EINVAL; + } + + flow->nlmsg_flags = nlmsg->nlmsg_flags; + flow->dp_ifindex = ovs_header->dp_ifindex; + if (a[OVS_FLOW_ATTR_KEY]) { + flow->key = nl_attr_get(a[OVS_FLOW_ATTR_KEY]); + flow->key_len = nl_attr_get_size(a[OVS_FLOW_ATTR_KEY]); + } + + if (a[OVS_FLOW_ATTR_UFID]) { + const ovs_u128 *ufid; + + ufid = nl_attr_get_unspec(a[OVS_FLOW_ATTR_UFID], + nl_attr_get_size(a[OVS_FLOW_ATTR_UFID])); + flow->ufid = *ufid; + flow->ufid_present = true; + } + if (a[OVS_FLOW_ATTR_MASK]) { + flow->mask = nl_attr_get(a[OVS_FLOW_ATTR_MASK]); + flow->mask_len = nl_attr_get_size(a[OVS_FLOW_ATTR_MASK]); + } + if (a[OVS_FLOW_ATTR_ACTIONS]) { + flow->actions = nl_attr_get(a[OVS_FLOW_ATTR_ACTIONS]); + flow->actions_len = nl_attr_get_size(a[OVS_FLOW_ATTR_ACTIONS]); + } + if (a[OVS_FLOW_ATTR_STATS]) { + flow->stats = nl_attr_get(a[OVS_FLOW_ATTR_STATS]); + } + if (a[OVS_FLOW_ATTR_TCP_FLAGS]) { + flow->tcp_flags = nl_attr_get(a[OVS_FLOW_ATTR_TCP_FLAGS]); + } + if (a[OVS_FLOW_ATTR_USED]) { + flow->used = nl_attr_get(a[OVS_FLOW_ATTR_USED]); + } + return 0; +} + +/* Appends to 'buf' (which must initially be empty) a "struct ovs_header" + * followed by Netlink attributes corresponding to 'flow'. */ +static void +dpif_netlink_flow_to_ofpbuf(const struct dpif_netlink_flow *flow, + struct ofpbuf *buf) +{ + struct ovs_header *ovs_header; + + nl_msg_put_genlmsghdr(buf, 0, ovs_flow_family, + NLM_F_REQUEST | flow->nlmsg_flags, + flow->cmd, OVS_FLOW_VERSION); + + ovs_header = ofpbuf_put_uninit(buf, sizeof *ovs_header); + ovs_header->dp_ifindex = flow->dp_ifindex; + + if (flow->ufid_present) { + nl_msg_put_unspec(buf, OVS_FLOW_ATTR_UFID, &flow->ufid, + sizeof flow->ufid); + } + if (flow->ufid_terse) { + nl_msg_put_u32(buf, OVS_FLOW_ATTR_UFID_FLAGS, + OVS_UFID_F_OMIT_KEY | OVS_UFID_F_OMIT_MASK + | OVS_UFID_F_OMIT_ACTIONS); + } + if (!flow->ufid_terse || !flow->ufid_present) { + if (flow->key_len) { + nl_msg_put_unspec(buf, OVS_FLOW_ATTR_KEY, + flow->key, flow->key_len); + } + + if (flow->mask_len) { + nl_msg_put_unspec(buf, OVS_FLOW_ATTR_MASK, + flow->mask, flow->mask_len); + } + if (flow->actions || flow->actions_len) { + nl_msg_put_unspec(buf, OVS_FLOW_ATTR_ACTIONS, + flow->actions, flow->actions_len); + } + } + + /* We never need to send these to the kernel. */ + ovs_assert(!flow->stats); + ovs_assert(!flow->tcp_flags); + ovs_assert(!flow->used); + + if (flow->clear) { + nl_msg_put_flag(buf, OVS_FLOW_ATTR_CLEAR); + } + if (flow->probe) { + nl_msg_put_flag(buf, OVS_FLOW_ATTR_PROBE); + } +} + +/* Clears 'flow' to "empty" values. */ +static void +dpif_netlink_flow_init(struct dpif_netlink_flow *flow) +{ + memset(flow, 0, sizeof *flow); +} + +/* Executes 'request' in the kernel datapath. If the command fails, returns a + * positive errno value. Otherwise, if 'reply' and 'bufp' are null, returns 0 + * without doing anything else. If 'reply' and 'bufp' are nonnull, then the + * result of the command is expected to be a flow also, which is decoded and + * stored in '*reply' and '*bufp'. The caller must free '*bufp' when the reply + * is no longer needed ('reply' will contain pointers into '*bufp'). */ +static int +dpif_netlink_flow_transact(struct dpif_netlink_flow *request, + struct dpif_netlink_flow *reply, + struct ofpbuf **bufp) +{ + struct ofpbuf *request_buf; + int error; + + ovs_assert((reply != NULL) == (bufp != NULL)); + + if (reply) { + request->nlmsg_flags |= NLM_F_ECHO; + } + + request_buf = ofpbuf_new(1024); + dpif_netlink_flow_to_ofpbuf(request, request_buf); + error = nl_transact(NETLINK_GENERIC, request_buf, bufp); + ofpbuf_delete(request_buf); + + if (reply) { + if (!error) { + error = dpif_netlink_flow_from_ofpbuf(reply, *bufp); + } + if (error) { + dpif_netlink_flow_init(reply); + ofpbuf_delete(*bufp); + *bufp = NULL; + } + } + return error; +} + +static void +dpif_netlink_flow_get_stats(const struct dpif_netlink_flow *flow, + struct dpif_flow_stats *stats) +{ + if (flow->stats) { + stats->n_packets = get_32aligned_u64(&flow->stats->n_packets); + stats->n_bytes = get_32aligned_u64(&flow->stats->n_bytes); + } else { + stats->n_packets = 0; + stats->n_bytes = 0; + } + stats->used = flow->used ? get_32aligned_u64(flow->used) : 0; + stats->tcp_flags = flow->tcp_flags ? *flow->tcp_flags : 0; +} + +/* Logs information about a packet that was recently lost in 'ch' (in + * 'dpif_'). */ +static void +report_loss(struct dpif_netlink *dpif, struct dpif_channel *ch, uint32_t ch_idx, + uint32_t handler_id) +{ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5); + struct ds s; + + if (VLOG_DROP_WARN(&rl)) { + return; + } + + ds_init(&s); + if (ch->last_poll != LLONG_MIN) { + ds_put_format(&s, " (last polled %lld ms ago)", + time_msec() - ch->last_poll); + } + + VLOG_WARN("%s: lost packet on port channel %u of handler %u", + dpif_name(&dpif->dpif), ch_idx, handler_id); + ds_destroy(&s); +} diff -Nru openvswitch-2.3.1/lib/dpif-netlink.h openvswitch-2.4.0~git20150623/lib/dpif-netlink.h --- openvswitch-2.3.1/lib/dpif-netlink.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif-netlink.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2010, 2011, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef DPIF_NETLINK_H +#define DPIF_NETLINK_H 1 + +#include +#include +#include +#include "odp-netlink.h" + +#include "flow.h" + +struct ofpbuf; + +struct dpif_netlink_vport { + /* Generic Netlink header. */ + uint8_t cmd; + + /* ovs_vport header. */ + int dp_ifindex; + odp_port_t port_no; /* ODPP_NONE if unknown. */ + enum ovs_vport_type type; + + /* Attributes. + * + * The 'stats' member points to 64-bit data that might only be aligned on + * 32-bit boundaries, so use get_unaligned_u64() to access its values. + */ + const char *name; /* OVS_VPORT_ATTR_NAME. */ + uint32_t n_upcall_pids; + const uint32_t *upcall_pids; /* OVS_VPORT_ATTR_UPCALL_PID. */ + const struct ovs_vport_stats *stats; /* OVS_VPORT_ATTR_STATS. */ + const struct nlattr *options; /* OVS_VPORT_ATTR_OPTIONS. */ + size_t options_len; +}; + +void dpif_netlink_vport_init(struct dpif_netlink_vport *); + +int dpif_netlink_vport_transact(const struct dpif_netlink_vport *request, + struct dpif_netlink_vport *reply, + struct ofpbuf **bufp); +int dpif_netlink_vport_get(const char *name, struct dpif_netlink_vport *reply, + struct ofpbuf **bufp); + +bool dpif_netlink_is_internal_device(const char *name); + +#endif /* dpif-netlink.h */ diff -Nru openvswitch-2.3.1/lib/dpif-provider.h openvswitch-2.4.0~git20150623/lib/dpif-provider.h --- openvswitch-2.3.1/lib/dpif-provider.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dpif-provider.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,6 +51,28 @@ ovs_assert(dpif->dpif_class == dpif_class); } +struct dpif_flow_dump { + struct dpif *dpif; + bool terse; /* If true, key/mask/actions may be omitted. */ +}; + +static inline void +dpif_flow_dump_init(struct dpif_flow_dump *dump, const struct dpif *dpif) +{ + dump->dpif = CONST_CAST(struct dpif *, dpif); +} + +struct dpif_flow_dump_thread { + struct dpif *dpif; +}; + +static inline void +dpif_flow_dump_thread_init(struct dpif_flow_dump_thread *thread, + struct dpif_flow_dump *dump) +{ + thread->dpif = dump->dpif; +} + /* Datapath interface class structure, to be defined by each implementation of * a datapath interface. * @@ -68,16 +90,25 @@ * the type assumed if no type is specified when opening a dpif. */ const char *type; - /* Enumerates the names of all known created datapaths, if possible, into - * 'all_dps'. The caller has already initialized 'all_dps' and other dpif - * classes might already have added names to it. + /* Called when the dpif provider is registered, typically at program + * startup. Returning an error from this function will prevent any + * datapath with this class from being created. + * + * This function may be set to null if a datapath class needs no + * initialization at registration time. */ + int (*init)(void); + + /* Enumerates the names of all known created datapaths (of class + * 'dpif_class'), if possible, into 'all_dps'. The caller has already + * initialized 'all_dps' and other dpif classes might already have added + * names to it. * * This is used by the vswitch at startup, so that it can delete any * datapaths that are not configured. * * Some kinds of datapaths might not be practically enumerable, in which * case this function may be a null pointer. */ - int (*enumerate)(struct sset *all_dps); + int (*enumerate)(struct sset *all_dps, const struct dpif_class *dpif_class); /* Returns the type to pass to netdev_open() when a dpif of class * 'dpif_class' has a port of type 'type', for a few special cases @@ -110,8 +141,9 @@ * the 'close' member function. */ int (*destroy)(struct dpif *dpif); - /* Performs periodic work needed by 'dpif', if any is necessary. */ - void (*run)(struct dpif *dpif); + /* Performs periodic work needed by 'dpif', if any is necessary. + * Returns true if need to revalidate. */ + bool (*run)(struct dpif *dpif); /* Arranges for poll_block() to wake up if the "run" member function needs * to be called for 'dpif'. */ @@ -217,157 +249,42 @@ * value other than EAGAIN. */ void (*port_poll_wait)(const struct dpif *dpif); - /* Queries 'dpif' for a flow entry. The flow is specified by the Netlink - * attributes with types OVS_KEY_ATTR_* in the 'key_len' bytes starting at - * 'key'. - * - * Returns 0 if successful. If no flow matches, returns ENOENT. On other - * failure, returns a positive errno value. - * - * On success, '*bufp' will be set to an ofpbuf owned by the caller that - * contains the response for 'maskp' and 'actionsp'. The caller must supply - * a valid pointer, and must free the ofpbuf (with ofpbuf_delete()) when it - * is no longer needed. - * - * If 'maskp' is nonnull, then on success '*maskp' will point to the - * Netlink attributes for the flow's mask, stored in '*bufp'. '*mask_len' - * will be set to the length of the mask attributes. - * - * If 'actionsp' is nonnull, then on success '*actionsp' will point to the - * Netlink attributes for the flow's actions, stored in '*bufp'. - * '*actions_len' will be set to the length of the actions attributes. - * - * If 'stats' is nonnull, then on success it must be updated with the - * flow's statistics. */ - int (*flow_get)(const struct dpif *dpif, - const struct nlattr *key, size_t key_len, - struct ofpbuf **bufp, - struct nlattr **maskp, size_t *mask_len, - struct nlattr **actionsp, size_t *acts_len, - struct dpif_flow_stats *stats); - - /* Adds or modifies a flow in 'dpif'. The flow is specified by the Netlink - * attributes with types OVS_KEY_ATTR_* in the 'put->key_len' bytes - * starting at 'put->key'. The associated actions are specified by the - * Netlink attributes with types OVS_ACTION_ATTR_* in the - * 'put->actions_len' bytes starting at 'put->actions'. - * - * - If the flow's key does not exist in 'dpif', then the flow will be - * added if 'put->flags' includes DPIF_FP_CREATE. Otherwise the - * operation will fail with ENOENT. - * - * If the operation succeeds, then 'put->stats', if nonnull, must be - * zeroed. - * - * - If the flow's key does exist in 'dpif', then the flow's actions will - * be updated if 'put->flags' includes DPIF_FP_MODIFY. Otherwise the - * operation will fail with EEXIST. If the flow's actions are updated, - * then its statistics will be zeroed if 'put->flags' includes - * DPIF_FP_ZERO_STATS, and left as-is otherwise. - * - * If the operation succeeds, then 'put->stats', if nonnull, must be set - * to the flow's statistics before the update. - */ - int (*flow_put)(struct dpif *dpif, const struct dpif_flow_put *put); - - /* Deletes a flow from 'dpif' and returns 0, or returns ENOENT if 'dpif' - * does not contain such a flow. The flow is specified by the Netlink - * attributes with types OVS_KEY_ATTR_* in the 'del->key_len' bytes - * starting at 'del->key'. - * - * If the operation succeeds, then 'del->stats', if nonnull, must be set to - * the flow's statistics before its deletion. */ - int (*flow_del)(struct dpif *dpif, const struct dpif_flow_del *del); - /* Deletes all flows from 'dpif' and clears all of its queues of received * packets. */ int (*flow_flush)(struct dpif *dpif); - /* Allocates thread-local state for use with the function 'flow_dump_next'. - * On return, initializes '*statep' with any private data needed for - * iteration. */ - void (*flow_dump_state_init)(void **statep); - - /* Attempts to begin dumping the flows in a dpif. On success, returns 0 - * and initializes '*iterp' with any shared data needed for iteration. - * On failure, returns a positive errno value. */ - int (*flow_dump_start)(const struct dpif *dpif, void **iterp); - - /* Attempts to retrieve another flow from 'dpif' for 'iter', using - * 'state' for storage. 'iter' must have been initialized by a successful - * call to the 'flow_dump_start' function for 'dpif'. 'state' must have - * been initialised with a call to the 'flow_dump_state_init' function for - * 'dpif. - * - * On success, updates the output parameters as described below and returns - * 0. Returns EOF if the end of the flow table has been reached, or a - * positive errno value on error. Multiple threads may use the same 'dpif' - * and 'iter' with this function, but all other parameters must be - * different for each thread. If this function returns non-zero, - * subsequent calls with the same arguments will also return non-zero. - * - * On success: - * - * - If 'key' and 'key_len' are nonnull, then '*key' and '*key_len' - * must be set to Netlink attributes with types OVS_KEY_ATTR_* - * representing the dumped flow's key. - * - * - If 'mask' and 'mask_len' are nonnull then '*mask' and '*mask_len' - * must be set to Netlink attributes with types of OVS_KEY_ATTR_* - * representing the dumped flow's mask. - * - * - If 'actions' and 'actions_len' are nonnull then they should be set - * to Netlink attributes with types OVS_ACTION_ATTR_* representing - * the dumped flow's actions. - * - * - If 'stats' is nonnull then it should be set to the dumped flow's - * statistics. - * - * All of the returned data is owned by 'dpif', not by the caller, and the - * caller must not modify or free it. 'dpif' must guarantee that it - * remains accessible and unchanging until at least the next call to - * 'flow_dump_next' or 'flow_dump_done' for 'iter' and 'state'. */ - int (*flow_dump_next)(const struct dpif *dpif, void *iter, void *state, - const struct nlattr **key, size_t *key_len, - const struct nlattr **mask, size_t *mask_len, - const struct nlattr **actions, size_t *actions_len, - const struct dpif_flow_stats **stats); - - /* Determines whether the next call to 'flow_dump_next' with 'state' will - * modify or free the keys that it previously returned. 'state' must have - * been initialized by a call to 'flow_dump_state_init' for 'dpif'. - * - * 'dpif' guarantees that data returned by flow_dump_next() will remain - * accessible and unchanging until the next call. This function provides a - * way for callers to determine whether that guarantee extends beyond the - * next call. - * - * Returns true if the next call to flow_dump_next() is expected to be - * destructive to previously returned keys for 'state', false otherwise. */ - bool (*flow_dump_next_may_destroy_keys)(void *state); - - /* Releases resources from 'dpif' for 'iter', which was initialized by a - * successful call to the 'flow_dump_start' function for 'dpif'. Callers - * must ensure that this function is called once within a given iteration, - * as the final flow dump operation. */ - int (*flow_dump_done)(const struct dpif *dpif, void *iter); - - /* Releases 'state' which was initialized by a call to the - * 'flow_dump_state_init' function for this 'dpif'. */ - void (*flow_dump_state_uninit)(void *statep); - - /* Performs the 'execute->actions_len' bytes of actions in - * 'execute->actions' on the Ethernet frame in 'execute->packet' - * and on the packet metadata in 'execute->md'. - * May modify both packet and metadata. */ - int (*execute)(struct dpif *dpif, struct dpif_execute *execute); + /* Flow dumping interface. + * + * This is the back-end for the flow dumping interface described in + * dpif.h. Please read the comments there first, because this code + * closely follows it. + * + * 'flow_dump_create' and 'flow_dump_thread_create' must always return an + * initialized and usable data structure and defer error return until + * flow_dump_destroy(). This hasn't been a problem for the dpifs that + * exist so far. + * + * 'flow_dump_create' and 'flow_dump_thread_create' must initialize the + * structures that they return with dpif_flow_dump_init() and + * dpif_flow_dump_thread_init(), respectively. + * + * If 'terse' is true, then only UID and statistics will + * be returned in the dump. Otherwise, all fields will be returned. */ + struct dpif_flow_dump *(*flow_dump_create)(const struct dpif *dpif, + bool terse); + int (*flow_dump_destroy)(struct dpif_flow_dump *dump); + + struct dpif_flow_dump_thread *(*flow_dump_thread_create)( + struct dpif_flow_dump *dump); + void (*flow_dump_thread_destroy)(struct dpif_flow_dump_thread *thread); + + int (*flow_dump_next)(struct dpif_flow_dump_thread *thread, + struct dpif_flow *flows, int max_flows); /* Executes each of the 'n_ops' operations in 'ops' on 'dpif', in the order * in which they are specified, placing each operation's results in the - * "output" members documented in comments. - * - * This function is optional. It is only worthwhile to implement it if - * 'dpif' can perform operations in batch faster than individually. */ + * "output" members documented in comments and the 'error' member of each + * dpif_op. */ void (*operate)(struct dpif *dpif, struct dpif_op **ops, size_t n_ops); /* Enables or disables receiving packets with dpif_recv() for 'dpif'. @@ -397,6 +314,13 @@ * */ int (*handlers_set)(struct dpif *dpif, uint32_t n_handlers); + /* If 'dpif' creates its own I/O polling threads, refreshes poll threads + * configuration. 'n_rxqs' configures the number of rx_queues, which + * are distributed among threads. 'cmask' configures the cpu mask + * for setting the polling threads' cpu affinity. */ + int (*poll_threads_set)(struct dpif *dpif, unsigned int n_rxqs, + const char *cmask); + /* Translates OpenFlow queue ID 'queue_id' (in host byte order) into a * priority value used for setting packet priority. */ int (*queue_to_priority)(const struct dpif *dpif, uint32_t queue_id, @@ -436,9 +360,30 @@ /* Throws away any queued upcalls that 'dpif' currently has ready to * return. */ void (*recv_purge)(struct dpif *dpif); + + /* For datapaths that run in userspace (i.e. dpif-netdev), threads polling + * for incoming packets can directly call upcall functions instead of + * offloading packet processing to separate handler threads. Datapaths + * that directly call upcall functions should use the functions below to + * to register an upcall function and enable / disable upcalls. + * + * Registers an upcall callback function with 'dpif'. This is only used if + * if 'dpif' directly executes upcall functions. 'aux' is passed to the + * callback on invocation. */ + void (*register_upcall_cb)(struct dpif *, upcall_callback *, void *aux); + + /* Enables upcalls if 'dpif' directly executes upcall functions. */ + void (*enable_upcall)(struct dpif *); + + /* Disables upcalls if 'dpif' directly executes upcall functions. */ + void (*disable_upcall)(struct dpif *); + + /* Get datapath version. Caller is responsible for freeing the string + * returned. */ + char *(*get_datapath_version)(void); }; -extern const struct dpif_class dpif_linux_class; +extern const struct dpif_class dpif_netlink_class; extern const struct dpif_class dpif_netdev_class; #ifdef __cplusplus diff -Nru openvswitch-2.3.1/lib/dp-packet.c openvswitch-2.4.0~git20150623/lib/dp-packet.c --- openvswitch-2.3.1/lib/dp-packet.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dp-packet.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,486 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include "dynamic-string.h" +#include "netdev-dpdk.h" +#include "dp-packet.h" +#include "util.h" + +static void +dp_packet_init__(struct dp_packet *b, size_t allocated, enum dp_packet_source source) +{ + dp_packet_set_allocated(b, allocated); + b->source = source; + b->l2_pad_size = 0; + b->l2_5_ofs = b->l3_ofs = b->l4_ofs = UINT16_MAX; + b->md = PKT_METADATA_INITIALIZER(0); +} + +static void +dp_packet_use__(struct dp_packet *b, void *base, size_t allocated, + enum dp_packet_source source) +{ + dp_packet_set_base(b, base); + dp_packet_set_data(b, base); + dp_packet_set_size(b, 0); + + dp_packet_init__(b, allocated, source); +} + +/* Initializes 'b' as an empty dp_packet that contains the 'allocated' bytes of + * memory starting at 'base'. 'base' should be the first byte of a region + * obtained from malloc(). It will be freed (with free()) if 'b' is resized or + * freed. */ +void +dp_packet_use(struct dp_packet *b, void *base, size_t allocated) +{ + dp_packet_use__(b, base, allocated, DPBUF_MALLOC); +} + +/* Initializes 'b' as an empty dp_packet that contains the 'allocated' bytes of + * memory starting at 'base'. 'base' should point to a buffer on the stack. + * (Nothing actually relies on 'base' being allocated on the stack. It could + * be static or malloc()'d memory. But stack space is the most common use + * case.) + * + * 'base' should be appropriately aligned. Using an array of uint32_t or + * uint64_t for the buffer is a reasonable way to ensure appropriate alignment + * for 32- or 64-bit data. + * + * An dp_packet operation that requires reallocating data will copy the provided + * buffer into a malloc()'d buffer. Thus, it is wise to call dp_packet_uninit() + * on an dp_packet initialized by this function, so that if it expanded into the + * heap, that memory is freed. */ +void +dp_packet_use_stub(struct dp_packet *b, void *base, size_t allocated) +{ + dp_packet_use__(b, base, allocated, DPBUF_STUB); +} + +/* Initializes 'b' as an dp_packet whose data starts at 'data' and continues for + * 'size' bytes. This is appropriate for an dp_packet that will be used to + * inspect existing data, without moving it around or reallocating it, and + * generally without modifying it at all. + * + * An dp_packet operation that requires reallocating data will assert-fail if this + * function was used to initialize it. */ +void +dp_packet_use_const(struct dp_packet *b, const void *data, size_t size) +{ + dp_packet_use__(b, CONST_CAST(void *, data), size, DPBUF_STACK); + dp_packet_set_size(b, size); +} + +/* Initializes 'b' as an empty dp_packet that contains the 'allocated' bytes of + * memory starting at 'base'. DPDK allocated dp_packet and *data is allocated + * from one continous memory region, so in memory data start right after + * dp_packet. Therefore there is special method to free this type of + * buffer. dp_packet base, data and size are initialized by dpdk rcv() so no + * need to initialize those fields. */ +void +dp_packet_init_dpdk(struct dp_packet *b, size_t allocated) +{ + dp_packet_init__(b, allocated, DPBUF_DPDK); +} + +/* Initializes 'b' as an empty dp_packet with an initial capacity of 'size' + * bytes. */ +void +dp_packet_init(struct dp_packet *b, size_t size) +{ + dp_packet_use(b, size ? xmalloc(size) : NULL, size); +} + +/* Frees memory that 'b' points to. */ +void +dp_packet_uninit(struct dp_packet *b) +{ + if (b) { + if (b->source == DPBUF_MALLOC) { + free(dp_packet_base(b)); + } else if (b->source == DPBUF_DPDK) { +#ifdef DPDK_NETDEV + /* If this dp_packet was allocated by DPDK it must have been + * created as a dp_packet */ + free_dpdk_buf((struct dp_packet*) b); +#endif + } + } +} + +/* Creates and returns a new dp_packet with an initial capacity of 'size' + * bytes. */ +struct dp_packet * +dp_packet_new(size_t size) +{ + struct dp_packet *b = xmalloc(sizeof *b); + dp_packet_init(b, size); + return b; +} + +/* Creates and returns a new dp_packet with an initial capacity of 'size + + * headroom' bytes, reserving the first 'headroom' bytes as headroom. */ +struct dp_packet * +dp_packet_new_with_headroom(size_t size, size_t headroom) +{ + struct dp_packet *b = dp_packet_new(size + headroom); + dp_packet_reserve(b, headroom); + return b; +} + +/* Creates and returns a new dp_packet that initially contains a copy of the + * 'dp_packet_size(buffer)' bytes of data starting at 'buffer->data' with no headroom or + * tailroom. */ +struct dp_packet * +dp_packet_clone(const struct dp_packet *buffer) +{ + return dp_packet_clone_with_headroom(buffer, 0); +} + +/* Creates and returns a new dp_packet whose data are copied from 'buffer'. The + * returned dp_packet will additionally have 'headroom' bytes of headroom. */ +struct dp_packet * +dp_packet_clone_with_headroom(const struct dp_packet *buffer, size_t headroom) +{ + struct dp_packet *new_buffer; + + new_buffer = dp_packet_clone_data_with_headroom(dp_packet_data(buffer), + dp_packet_size(buffer), + headroom); + new_buffer->l2_pad_size = buffer->l2_pad_size; + new_buffer->l2_5_ofs = buffer->l2_5_ofs; + new_buffer->l3_ofs = buffer->l3_ofs; + new_buffer->l4_ofs = buffer->l4_ofs; + new_buffer->md = buffer->md; + + return new_buffer; +} + +/* Creates and returns a new dp_packet that initially contains a copy of the + * 'size' bytes of data starting at 'data' with no headroom or tailroom. */ +struct dp_packet * +dp_packet_clone_data(const void *data, size_t size) +{ + return dp_packet_clone_data_with_headroom(data, size, 0); +} + +/* Creates and returns a new dp_packet that initially contains 'headroom' bytes of + * headroom followed by a copy of the 'size' bytes of data starting at + * 'data'. */ +struct dp_packet * +dp_packet_clone_data_with_headroom(const void *data, size_t size, size_t headroom) +{ + struct dp_packet *b = dp_packet_new_with_headroom(size, headroom); + dp_packet_put(b, data, size); + return b; +} + +static void +dp_packet_copy__(struct dp_packet *b, uint8_t *new_base, + size_t new_headroom, size_t new_tailroom) +{ + const uint8_t *old_base = dp_packet_base(b); + size_t old_headroom = dp_packet_headroom(b); + size_t old_tailroom = dp_packet_tailroom(b); + size_t copy_headroom = MIN(old_headroom, new_headroom); + size_t copy_tailroom = MIN(old_tailroom, new_tailroom); + + memcpy(&new_base[new_headroom - copy_headroom], + &old_base[old_headroom - copy_headroom], + copy_headroom + dp_packet_size(b) + copy_tailroom); +} + +/* Reallocates 'b' so that it has exactly 'new_headroom' and 'new_tailroom' + * bytes of headroom and tailroom, respectively. */ +static void +dp_packet_resize__(struct dp_packet *b, size_t new_headroom, size_t new_tailroom) +{ + void *new_base, *new_data; + size_t new_allocated; + + new_allocated = new_headroom + dp_packet_size(b) + new_tailroom; + + switch (b->source) { + case DPBUF_DPDK: + OVS_NOT_REACHED(); + + case DPBUF_MALLOC: + if (new_headroom == dp_packet_headroom(b)) { + new_base = xrealloc(dp_packet_base(b), new_allocated); + } else { + new_base = xmalloc(new_allocated); + dp_packet_copy__(b, new_base, new_headroom, new_tailroom); + free(dp_packet_base(b)); + } + break; + + case DPBUF_STACK: + OVS_NOT_REACHED(); + + case DPBUF_STUB: + b->source = DPBUF_MALLOC; + new_base = xmalloc(new_allocated); + dp_packet_copy__(b, new_base, new_headroom, new_tailroom); + break; + + default: + OVS_NOT_REACHED(); + } + + dp_packet_set_allocated(b, new_allocated); + dp_packet_set_base(b, new_base); + + new_data = (char *) new_base + new_headroom; + if (dp_packet_data(b) != new_data) { + dp_packet_set_data(b, new_data); + } +} + +/* Ensures that 'b' has room for at least 'size' bytes at its tail end, + * reallocating and copying its data if necessary. Its headroom, if any, is + * preserved. */ +void +dp_packet_prealloc_tailroom(struct dp_packet *b, size_t size) +{ + if (size > dp_packet_tailroom(b)) { + dp_packet_resize__(b, dp_packet_headroom(b), MAX(size, 64)); + } +} + +/* Ensures that 'b' has room for at least 'size' bytes at its head, + * reallocating and copying its data if necessary. Its tailroom, if any, is + * preserved. */ +void +dp_packet_prealloc_headroom(struct dp_packet *b, size_t size) +{ + if (size > dp_packet_headroom(b)) { + dp_packet_resize__(b, MAX(size, 64), dp_packet_tailroom(b)); + } +} + +/* Shifts all of the data within the allocated space in 'b' by 'delta' bytes. + * For example, a 'delta' of 1 would cause each byte of data to move one byte + * forward (from address 'p' to 'p+1'), and a 'delta' of -1 would cause each + * byte to move one byte backward (from 'p' to 'p-1'). */ +void +dp_packet_shift(struct dp_packet *b, int delta) +{ + ovs_assert(delta > 0 ? delta <= dp_packet_tailroom(b) + : delta < 0 ? -delta <= dp_packet_headroom(b) + : true); + + if (delta != 0) { + char *dst = (char *) dp_packet_data(b) + delta; + memmove(dst, dp_packet_data(b), dp_packet_size(b)); + dp_packet_set_data(b, dst); + } +} + +/* Appends 'size' bytes of data to the tail end of 'b', reallocating and + * copying its data if necessary. Returns a pointer to the first byte of the + * new data, which is left uninitialized. */ +void * +dp_packet_put_uninit(struct dp_packet *b, size_t size) +{ + void *p; + dp_packet_prealloc_tailroom(b, size); + p = dp_packet_tail(b); + dp_packet_set_size(b, dp_packet_size(b) + size); + return p; +} + +/* Appends 'size' zeroed bytes to the tail end of 'b'. Data in 'b' is + * reallocated and copied if necessary. Returns a pointer to the first byte of + * the data's location in the dp_packet. */ +void * +dp_packet_put_zeros(struct dp_packet *b, size_t size) +{ + void *dst = dp_packet_put_uninit(b, size); + memset(dst, 0, size); + return dst; +} + +/* Appends the 'size' bytes of data in 'p' to the tail end of 'b'. Data in 'b' + * is reallocated and copied if necessary. Returns a pointer to the first + * byte of the data's location in the dp_packet. */ +void * +dp_packet_put(struct dp_packet *b, const void *p, size_t size) +{ + void *dst = dp_packet_put_uninit(b, size); + memcpy(dst, p, size); + return dst; +} + +/* Parses as many pairs of hex digits as possible (possibly separated by + * spaces) from the beginning of 's', appending bytes for their values to 'b'. + * Returns the first character of 's' that is not the first of a pair of hex + * digits. If 'n' is nonnull, stores the number of bytes added to 'b' in + * '*n'. */ +char * +dp_packet_put_hex(struct dp_packet *b, const char *s, size_t *n) +{ + size_t initial_size = dp_packet_size(b); + for (;;) { + uint8_t byte; + bool ok; + + s += strspn(s, " \t\r\n"); + byte = hexits_value(s, 2, &ok); + if (!ok) { + if (n) { + *n = dp_packet_size(b) - initial_size; + } + return CONST_CAST(char *, s); + } + + dp_packet_put(b, &byte, 1); + s += 2; + } +} + +/* Reserves 'size' bytes of headroom so that they can be later allocated with + * dp_packet_push_uninit() without reallocating the dp_packet. */ +void +dp_packet_reserve(struct dp_packet *b, size_t size) +{ + ovs_assert(!dp_packet_size(b)); + dp_packet_prealloc_tailroom(b, size); + dp_packet_set_data(b, (char*)dp_packet_data(b) + size); +} + +/* Reserves 'headroom' bytes at the head and 'tailroom' at the end so that + * they can be later allocated with dp_packet_push_uninit() or + * dp_packet_put_uninit() without reallocating the dp_packet. */ +void +dp_packet_reserve_with_tailroom(struct dp_packet *b, size_t headroom, + size_t tailroom) +{ + ovs_assert(!dp_packet_size(b)); + dp_packet_prealloc_tailroom(b, headroom + tailroom); + dp_packet_set_data(b, (char*)dp_packet_data(b) + headroom); +} + +/* Prefixes 'size' bytes to the head end of 'b', reallocating and copying its + * data if necessary. Returns a pointer to the first byte of the data's + * location in the dp_packet. The new data is left uninitialized. */ +void * +dp_packet_push_uninit(struct dp_packet *b, size_t size) +{ + dp_packet_prealloc_headroom(b, size); + dp_packet_set_data(b, (char*)dp_packet_data(b) - size); + dp_packet_set_size(b, dp_packet_size(b) + size); + return dp_packet_data(b); +} + +/* Prefixes 'size' zeroed bytes to the head end of 'b', reallocating and + * copying its data if necessary. Returns a pointer to the first byte of the + * data's location in the dp_packet. */ +void * +dp_packet_push_zeros(struct dp_packet *b, size_t size) +{ + void *dst = dp_packet_push_uninit(b, size); + memset(dst, 0, size); + return dst; +} + +/* Copies the 'size' bytes starting at 'p' to the head end of 'b', reallocating + * and copying its data if necessary. Returns a pointer to the first byte of + * the data's location in the dp_packet. */ +void * +dp_packet_push(struct dp_packet *b, const void *p, size_t size) +{ + void *dst = dp_packet_push_uninit(b, size); + memcpy(dst, p, size); + return dst; +} + +/* Returns the data in 'b' as a block of malloc()'d memory and frees the buffer + * within 'b'. (If 'b' itself was dynamically allocated, e.g. with + * dp_packet_new(), then it should still be freed with, e.g., dp_packet_delete().) */ +void * +dp_packet_steal_data(struct dp_packet *b) +{ + void *p; + ovs_assert(b->source != DPBUF_DPDK); + + if (b->source == DPBUF_MALLOC && dp_packet_data(b) == dp_packet_base(b)) { + p = dp_packet_data(b); + } else { + p = xmemdup(dp_packet_data(b), dp_packet_size(b)); + if (b->source == DPBUF_MALLOC) { + free(dp_packet_base(b)); + } + } + dp_packet_set_base(b, NULL); + dp_packet_set_data(b, NULL); + return p; +} + +/* Returns a string that describes some of 'b''s metadata plus a hex dump of up + * to 'maxbytes' from the start of the buffer. */ +char * +dp_packet_to_string(const struct dp_packet *b, size_t maxbytes) +{ + struct ds s; + + ds_init(&s); + ds_put_format(&s, "size=%"PRIu32", allocated=%"PRIu32", head=%"PRIuSIZE", tail=%"PRIuSIZE"\n", + dp_packet_size(b), dp_packet_get_allocated(b), + dp_packet_headroom(b), dp_packet_tailroom(b)); + ds_put_hex_dump(&s, dp_packet_data(b), MIN(dp_packet_size(b), maxbytes), 0, false); + return ds_cstr(&s); +} + +static inline void +dp_packet_adjust_layer_offset(uint16_t *offset, int increment) +{ + if (*offset != UINT16_MAX) { + *offset += increment; + } +} + +/* Adjust the size of the l2_5 portion of the dp_packet, updating the l2 + * pointer and the layer offsets. The caller is responsible for + * modifying the contents. */ +void * +dp_packet_resize_l2_5(struct dp_packet *b, int increment) +{ + if (increment >= 0) { + dp_packet_push_uninit(b, increment); + } else { + dp_packet_pull(b, -increment); + } + + /* Adjust layer offsets after l2_5. */ + dp_packet_adjust_layer_offset(&b->l3_ofs, increment); + dp_packet_adjust_layer_offset(&b->l4_ofs, increment); + + return dp_packet_data(b); +} + +/* Adjust the size of the l2 portion of the dp_packet, updating the l2 + * pointer and the layer offsets. The caller is responsible for + * modifying the contents. */ +void * +dp_packet_resize_l2(struct dp_packet *b, int increment) +{ + dp_packet_resize_l2_5(b, increment); + dp_packet_adjust_layer_offset(&b->l2_5_ofs, increment); + return dp_packet_data(b); +} diff -Nru openvswitch-2.3.1/lib/dp-packet.h openvswitch-2.4.0~git20150623/lib/dp-packet.h --- openvswitch-2.3.1/lib/dp-packet.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dp-packet.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,541 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef DPBUF_H +#define DPBUF_H 1 + +#include +#include +#include "list.h" +#include "packets.h" +#include "util.h" +#include "netdev-dpdk.h" + +#ifdef __cplusplus +extern "C" { +#endif + +enum OVS_PACKED_ENUM dp_packet_source { + DPBUF_MALLOC, /* Obtained via malloc(). */ + DPBUF_STACK, /* Un-movable stack space or static buffer. */ + DPBUF_STUB, /* Starts on stack, may expand into heap. */ + DPBUF_DPDK, /* buffer data is from DPDK allocated memory. + * ref to build_dp_packet() in netdev-dpdk. */ +}; + +/* Buffer for holding packet data. A dp_packet is automatically reallocated + * as necessary if it grows too large for the available memory. + */ +struct dp_packet { +#ifdef DPDK_NETDEV + struct rte_mbuf mbuf; /* DPDK mbuf */ +#else + void *base_; /* First byte of allocated space. */ + uint16_t allocated_; /* Number of bytes allocated. */ + uint16_t data_ofs; /* First byte actually in use. */ + uint32_t size_; /* Number of bytes in use. */ + uint32_t rss_hash; /* Packet hash. */ +#endif + enum dp_packet_source source; /* Source of memory allocated as 'base'. */ + uint8_t l2_pad_size; /* Detected l2 padding size. + * Padding is non-pullable. */ + uint16_t l2_5_ofs; /* MPLS label stack offset, or UINT16_MAX */ + uint16_t l3_ofs; /* Network-level header offset, + * or UINT16_MAX. */ + uint16_t l4_ofs; /* Transport-level header offset, + or UINT16_MAX. */ + struct pkt_metadata md; +}; + +static inline void *dp_packet_data(const struct dp_packet *); +static inline void dp_packet_set_data(struct dp_packet *, void *); +static inline void *dp_packet_base(const struct dp_packet *); +static inline void dp_packet_set_base(struct dp_packet *, void *); + +static inline uint32_t dp_packet_size(const struct dp_packet *); +static inline void dp_packet_set_size(struct dp_packet *, uint32_t); + +static inline uint16_t dp_packet_get_allocated(const struct dp_packet *); +static inline void dp_packet_set_allocated(struct dp_packet *, uint16_t); + +void *dp_packet_resize_l2(struct dp_packet *, int increment); +void *dp_packet_resize_l2_5(struct dp_packet *, int increment); +static inline void *dp_packet_l2(const struct dp_packet *); +static inline void dp_packet_reset_offsets(struct dp_packet *); +static inline uint8_t dp_packet_l2_pad_size(const struct dp_packet *); +static inline void dp_packet_set_l2_pad_size(struct dp_packet *, uint8_t); +static inline void *dp_packet_l2_5(const struct dp_packet *); +static inline void dp_packet_set_l2_5(struct dp_packet *, void *); +static inline void *dp_packet_l3(const struct dp_packet *); +static inline void dp_packet_set_l3(struct dp_packet *, void *); +static inline void *dp_packet_l4(const struct dp_packet *); +static inline void dp_packet_set_l4(struct dp_packet *, void *); +static inline size_t dp_packet_l4_size(const struct dp_packet *); +static inline const void *dp_packet_get_tcp_payload(const struct dp_packet *); +static inline const void *dp_packet_get_udp_payload(const struct dp_packet *); +static inline const void *dp_packet_get_sctp_payload(const struct dp_packet *); +static inline const void *dp_packet_get_icmp_payload(const struct dp_packet *); +static inline const void *dp_packet_get_nd_payload(const struct dp_packet *); + +void dp_packet_use(struct dp_packet *, void *, size_t); +void dp_packet_use_stub(struct dp_packet *, void *, size_t); +void dp_packet_use_const(struct dp_packet *, const void *, size_t); + +void dp_packet_init_dpdk(struct dp_packet *, size_t allocated); + +void dp_packet_init(struct dp_packet *, size_t); +void dp_packet_uninit(struct dp_packet *); + +struct dp_packet *dp_packet_new(size_t); +struct dp_packet *dp_packet_new_with_headroom(size_t, size_t headroom); +struct dp_packet *dp_packet_clone(const struct dp_packet *); +struct dp_packet *dp_packet_clone_with_headroom(const struct dp_packet *, + size_t headroom); +struct dp_packet *dp_packet_clone_data(const void *, size_t); +struct dp_packet *dp_packet_clone_data_with_headroom(const void *, size_t, + size_t headroom); +static inline void dp_packet_delete(struct dp_packet *); + +static inline void *dp_packet_at(const struct dp_packet *, size_t offset, + size_t size); +static inline void *dp_packet_at_assert(const struct dp_packet *, + size_t offset, size_t size); +static inline void *dp_packet_tail(const struct dp_packet *); +static inline void *dp_packet_end(const struct dp_packet *); + +void *dp_packet_put_uninit(struct dp_packet *, size_t); +void *dp_packet_put_zeros(struct dp_packet *, size_t); +void *dp_packet_put(struct dp_packet *, const void *, size_t); +char *dp_packet_put_hex(struct dp_packet *, const char *s, size_t *n); +void dp_packet_reserve(struct dp_packet *, size_t); +void dp_packet_reserve_with_tailroom(struct dp_packet *, size_t headroom, + size_t tailroom); +void *dp_packet_push_uninit(struct dp_packet *, size_t); +void *dp_packet_push_zeros(struct dp_packet *, size_t); +void *dp_packet_push(struct dp_packet *, const void *, size_t); + +static inline size_t dp_packet_headroom(const struct dp_packet *); +static inline size_t dp_packet_tailroom(const struct dp_packet *); +void dp_packet_prealloc_headroom(struct dp_packet *, size_t); +void dp_packet_prealloc_tailroom(struct dp_packet *, size_t); +void dp_packet_shift(struct dp_packet *, int); + +static inline void dp_packet_clear(struct dp_packet *); +static inline void *dp_packet_pull(struct dp_packet *, size_t); +static inline void *dp_packet_try_pull(struct dp_packet *, size_t); + +void *dp_packet_steal_data(struct dp_packet *); + +char *dp_packet_to_string(const struct dp_packet *, size_t maxbytes); +static inline bool dp_packet_equal(const struct dp_packet *, + const struct dp_packet *); + + +/* Frees memory that 'b' points to, as well as 'b' itself. */ +static inline void +dp_packet_delete(struct dp_packet *b) +{ + if (b) { + if (b->source == DPBUF_DPDK) { + /* If this dp_packet was allocated by DPDK it must have been + * created as a dp_packet */ + free_dpdk_buf((struct dp_packet*) b); + return; + } + + dp_packet_uninit(b); + free(b); + } +} + +/* If 'b' contains at least 'offset + size' bytes of data, returns a pointer to + * byte 'offset'. Otherwise, returns a null pointer. */ +static inline void * +dp_packet_at(const struct dp_packet *b, size_t offset, size_t size) +{ + return offset + size <= dp_packet_size(b) + ? (char *) dp_packet_data(b) + offset + : NULL; +} + +/* Returns a pointer to byte 'offset' in 'b', which must contain at least + * 'offset + size' bytes of data. */ +static inline void * +dp_packet_at_assert(const struct dp_packet *b, size_t offset, size_t size) +{ + ovs_assert(offset + size <= dp_packet_size(b)); + return ((char *) dp_packet_data(b)) + offset; +} + +/* Returns a pointer to byte following the last byte of data in use in 'b'. */ +static inline void * +dp_packet_tail(const struct dp_packet *b) +{ + return (char *) dp_packet_data(b) + dp_packet_size(b); +} + +/* Returns a pointer to byte following the last byte allocated for use (but + * not necessarily in use) in 'b'. */ +static inline void * +dp_packet_end(const struct dp_packet *b) +{ + return (char *) dp_packet_base(b) + dp_packet_get_allocated(b); +} + +/* Returns the number of bytes of headroom in 'b', that is, the number of bytes + * of unused space in dp_packet 'b' before the data that is in use. (Most + * commonly, the data in a dp_packet is at its beginning, and thus the + * dp_packet's headroom is 0.) */ +static inline size_t +dp_packet_headroom(const struct dp_packet *b) +{ + return (char *) dp_packet_data(b) - (char *) dp_packet_base(b); +} + +/* Returns the number of bytes that may be appended to the tail end of + * dp_packet 'b' before the dp_packet must be reallocated. */ +static inline size_t +dp_packet_tailroom(const struct dp_packet *b) +{ + return (char *) dp_packet_end(b) - (char *) dp_packet_tail(b); +} + +/* Clears any data from 'b'. */ +static inline void +dp_packet_clear(struct dp_packet *b) +{ + dp_packet_set_data(b, dp_packet_base(b)); + dp_packet_set_size(b, 0); +} + +/* Removes 'size' bytes from the head end of 'b', which must contain at least + * 'size' bytes of data. Returns the first byte of data removed. */ +static inline void * +dp_packet_pull(struct dp_packet *b, size_t size) +{ + void *data = dp_packet_data(b); + ovs_assert(dp_packet_size(b) - dp_packet_l2_pad_size(b) >= size); + dp_packet_set_data(b, (char *) dp_packet_data(b) + size); + dp_packet_set_size(b, dp_packet_size(b) - size); + return data; +} + +/* If 'b' has at least 'size' bytes of data, removes that many bytes from the + * head end of 'b' and returns the first byte removed. Otherwise, returns a + * null pointer without modifying 'b'. */ +static inline void * +dp_packet_try_pull(struct dp_packet *b, size_t size) +{ + return dp_packet_size(b) - dp_packet_l2_pad_size(b) >= size + ? dp_packet_pull(b, size) : NULL; +} + +static inline bool +dp_packet_equal(const struct dp_packet *a, const struct dp_packet *b) +{ + return dp_packet_size(a) == dp_packet_size(b) && + !memcmp(dp_packet_data(a), dp_packet_data(b), dp_packet_size(a)); +} + +/* Get the start of the Ethernet frame. 'l3_ofs' marks the end of the l2 + * headers, so return NULL if it is not set. */ +static inline void * +dp_packet_l2(const struct dp_packet *b) +{ + return (b->l3_ofs != UINT16_MAX) ? dp_packet_data(b) : NULL; +} + +/* Resets all layer offsets. 'l3' offset must be set before 'l2' can be + * retrieved. */ +static inline void +dp_packet_reset_offsets(struct dp_packet *b) +{ + b->l2_pad_size = 0; + b->l2_5_ofs = UINT16_MAX; + b->l3_ofs = UINT16_MAX; + b->l4_ofs = UINT16_MAX; +} + +static inline uint8_t +dp_packet_l2_pad_size(const struct dp_packet *b) +{ + return b->l2_pad_size; +} + +static inline void +dp_packet_set_l2_pad_size(struct dp_packet *b, uint8_t pad_size) +{ + ovs_assert(pad_size <= dp_packet_size(b)); + b->l2_pad_size = pad_size; +} + +static inline void * +dp_packet_l2_5(const struct dp_packet *b) +{ + return b->l2_5_ofs != UINT16_MAX + ? (char *) dp_packet_data(b) + b->l2_5_ofs + : NULL; +} + +static inline void +dp_packet_set_l2_5(struct dp_packet *b, void *l2_5) +{ + b->l2_5_ofs = l2_5 + ? (char *) l2_5 - (char *) dp_packet_data(b) + : UINT16_MAX; +} + +static inline void * +dp_packet_l3(const struct dp_packet *b) +{ + return b->l3_ofs != UINT16_MAX + ? (char *) dp_packet_data(b) + b->l3_ofs + : NULL; +} + +static inline void +dp_packet_set_l3(struct dp_packet *b, void *l3) +{ + b->l3_ofs = l3 ? (char *) l3 - (char *) dp_packet_data(b) : UINT16_MAX; +} + +static inline void * +dp_packet_l4(const struct dp_packet *b) +{ + return b->l4_ofs != UINT16_MAX + ? (char *) dp_packet_data(b) + b->l4_ofs + : NULL; +} + +static inline void +dp_packet_set_l4(struct dp_packet *b, void *l4) +{ + b->l4_ofs = l4 ? (char *) l4 - (char *) dp_packet_data(b) : UINT16_MAX; +} + +static inline size_t +dp_packet_l4_size(const struct dp_packet *b) +{ + return b->l4_ofs != UINT16_MAX + ? (const char *)dp_packet_tail(b) - (const char *)dp_packet_l4(b) + - dp_packet_l2_pad_size(b) + : 0; +} + +static inline const void * +dp_packet_get_tcp_payload(const struct dp_packet *b) +{ + size_t l4_size = dp_packet_l4_size(b); + + if (OVS_LIKELY(l4_size >= TCP_HEADER_LEN)) { + struct tcp_header *tcp = dp_packet_l4(b); + int tcp_len = TCP_OFFSET(tcp->tcp_ctl) * 4; + + if (OVS_LIKELY(tcp_len >= TCP_HEADER_LEN && tcp_len <= l4_size)) { + return (const char *)tcp + tcp_len; + } + } + return NULL; +} + +static inline const void * +dp_packet_get_udp_payload(const struct dp_packet *b) +{ + return OVS_LIKELY(dp_packet_l4_size(b) >= UDP_HEADER_LEN) + ? (const char *)dp_packet_l4(b) + UDP_HEADER_LEN : NULL; +} + +static inline const void * +dp_packet_get_sctp_payload(const struct dp_packet *b) +{ + return OVS_LIKELY(dp_packet_l4_size(b) >= SCTP_HEADER_LEN) + ? (const char *)dp_packet_l4(b) + SCTP_HEADER_LEN : NULL; +} + +static inline const void * +dp_packet_get_icmp_payload(const struct dp_packet *b) +{ + return OVS_LIKELY(dp_packet_l4_size(b) >= ICMP_HEADER_LEN) + ? (const char *)dp_packet_l4(b) + ICMP_HEADER_LEN : NULL; +} + +static inline const void * +dp_packet_get_nd_payload(const struct dp_packet *b) +{ + return OVS_LIKELY(dp_packet_l4_size(b) >= ND_MSG_LEN) + ? (const char *)dp_packet_l4(b) + ND_MSG_LEN : NULL; +} + +#ifdef DPDK_NETDEV +BUILD_ASSERT_DECL(offsetof(struct dp_packet, mbuf) == 0); + +static inline void * +dp_packet_base(const struct dp_packet *b) +{ + return b->mbuf.buf_addr; +} + +static inline void +dp_packet_set_base(struct dp_packet *b, void *d) +{ + b->mbuf.buf_addr = d; +} + +static inline uint32_t +dp_packet_size(const struct dp_packet *b) +{ + return b->mbuf.pkt_len; +} + +static inline void +dp_packet_set_size(struct dp_packet *b, uint32_t v) +{ + /* netdev-dpdk does not currently support segmentation; consequently, for + * all intents and purposes, 'data_len' (16 bit) and 'pkt_len' (32 bit) may + * be used interchangably. + * + * On the datapath, it is expected that the size of packets + * (and thus 'v') will always be <= UINT16_MAX; this means that there is no + * loss of accuracy in assigning 'v' to 'data_len'. + */ + b->mbuf.data_len = (uint16_t)v; /* Current seg length. */ + b->mbuf.pkt_len = v; /* Total length of all segments linked to + * this segment. */ +} + +static inline uint16_t +__packet_data(const struct dp_packet *b) +{ + return b->mbuf.data_off; +} + +static inline void +__packet_set_data(struct dp_packet *b, uint16_t v) +{ + b->mbuf.data_off = v; +} + +static inline uint16_t +dp_packet_get_allocated(const struct dp_packet *b) +{ + return b->mbuf.buf_len; +} + +static inline void +dp_packet_set_allocated(struct dp_packet *b, uint16_t s) +{ + b->mbuf.buf_len = s; +} +#else +static inline void * +dp_packet_base(const struct dp_packet *b) +{ + return b->base_; +} + +static inline void +dp_packet_set_base(struct dp_packet *b, void *d) +{ + b->base_ = d; +} + +static inline uint32_t +dp_packet_size(const struct dp_packet *b) +{ + return b->size_; +} + +static inline void +dp_packet_set_size(struct dp_packet *b, uint32_t v) +{ + b->size_ = v; +} + +static inline uint16_t +__packet_data(const struct dp_packet *b) +{ + return b->data_ofs; +} + +static inline void +__packet_set_data(struct dp_packet *b, uint16_t v) +{ + b->data_ofs = v; +} + +static inline uint16_t +dp_packet_get_allocated(const struct dp_packet *b) +{ + return b->allocated_; +} + +static inline void +dp_packet_set_allocated(struct dp_packet *b, uint16_t s) +{ + b->allocated_ = s; +} +#endif + +static inline void * +dp_packet_data(const struct dp_packet *b) +{ + return __packet_data(b) != UINT16_MAX + ? (char *) dp_packet_base(b) + __packet_data(b) : NULL; +} + +static inline void +dp_packet_set_data(struct dp_packet *b, void *data) +{ + if (data) { + __packet_set_data(b, (char *) data - (char *) dp_packet_base(b)); + } else { + __packet_set_data(b, UINT16_MAX); + } +} + +static inline void +dp_packet_reset_packet(struct dp_packet *b, int off) +{ + dp_packet_set_size(b, dp_packet_size(b) - off); + dp_packet_set_data(b, ((unsigned char *) dp_packet_data(b) + off)); + b->l2_5_ofs = b->l3_ofs = b->l4_ofs = UINT16_MAX; +} + +static inline uint32_t +dp_packet_get_rss_hash(struct dp_packet *p) +{ +#ifdef DPDK_NETDEV + return p->mbuf.hash.rss; +#else + return p->rss_hash; +#endif +} + +static inline void +dp_packet_set_rss_hash(struct dp_packet *p, uint32_t hash) +{ +#ifdef DPDK_NETDEV + p->mbuf.hash.rss = hash; +#else + p->rss_hash = hash; +#endif +} + +#ifdef __cplusplus +} +#endif + +#endif /* dp-packet.h */ diff -Nru openvswitch-2.3.1/lib/dynamic-string.c openvswitch-2.4.0~git20150623/lib/dynamic-string.c --- openvswitch-2.3.1/lib/dynamic-string.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dynamic-string.c 2015-06-23 18:46:21.000000000 +0000 @@ -361,6 +361,29 @@ *b = temp; } +void +ds_put_hex(struct ds *ds, const void *buf_, size_t size) +{ + const uint8_t *buf = buf_; + bool printed = false; + int i; + + for (i = 0; i < size; i++) { + uint8_t val = buf[i]; + if (val || printed) { + if (!printed) { + ds_put_format(ds, "0x%"PRIx8, val); + } else { + ds_put_format(ds, "%02"PRIx8, val); + } + printed = true; + } + } + if (!printed) { + ds_put_char(ds, '0'); + } +} + /* Writes the 'size' bytes in 'buf' to 'string' as hex bytes arranged 16 per * line. Numeric offsets are also included, starting at 'ofs' for the first * byte in 'buf'. If 'ascii' is true then the corresponding ASCII characters diff -Nru openvswitch-2.3.1/lib/dynamic-string.h openvswitch-2.4.0~git20150623/lib/dynamic-string.h --- openvswitch-2.3.1/lib/dynamic-string.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/dynamic-string.h 2015-06-23 18:46:21.000000000 +0000 @@ -51,19 +51,20 @@ void ds_put_buffer(struct ds *, const char *, size_t n); void ds_put_cstr(struct ds *, const char *); void ds_put_and_free_cstr(struct ds *, char *); -void ds_put_format(struct ds *, const char *, ...) PRINTF_FORMAT(2, 3); +void ds_put_format(struct ds *, const char *, ...) OVS_PRINTF_FORMAT(2, 3); void ds_put_format_valist(struct ds *, const char *, va_list) - PRINTF_FORMAT(2, 0); + OVS_PRINTF_FORMAT(2, 0); void ds_put_printable(struct ds *, const char *, size_t); +void ds_put_hex(struct ds *ds, const void *buf, size_t size); void ds_put_hex_dump(struct ds *ds, const void *buf_, size_t size, uintptr_t ofs, bool ascii); int ds_get_line(struct ds *, FILE *); int ds_get_preprocessed_line(struct ds *, FILE *, int *line_number); int ds_get_test_line(struct ds *, FILE *); -void ds_put_strftime_msec(struct ds *, const char *template, long long int when, +void ds_put_strftime_msec(struct ds *, const char *format, long long int when, bool utc); -char *xastrftime_msec(const char *template, long long int when, bool utc); +char *xastrftime_msec(const char *format, long long int when, bool utc); char *ds_cstr(struct ds *); const char *ds_cstr_ro(const struct ds *); diff -Nru openvswitch-2.3.1/lib/entropy.c openvswitch-2.4.0~git20150623/lib/entropy.c --- openvswitch-2.3.1/lib/entropy.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/entropy.c 2015-06-23 18:46:21.000000000 +0000 @@ -23,9 +23,9 @@ #ifdef _WIN32 #include #endif - +#include "util.h" #include "socket-util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(entropy); diff -Nru openvswitch-2.3.1/lib/fatal-signal.c openvswitch-2.4.0~git20150623/lib/fatal-signal.c --- openvswitch-2.3.1/lib/fatal-signal.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/fatal-signal.c 2015-06-23 18:46:21.000000000 +0000 @@ -30,7 +30,7 @@ #include "signals.h" #include "socket-util.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #include "type-props.h" @@ -59,12 +59,14 @@ static size_t n_hooks; static int signal_fds[2]; -static HANDLE wevent; static volatile sig_atomic_t stored_sig_nr = SIG_ATOMIC_MAX; +#ifdef _WIN32 +static HANDLE wevent; +#endif + static struct ovs_mutex mutex; -static void atexit_handler(void); static void call_hooks(int sig_nr); #ifdef _WIN32 static BOOL WINAPI ConsoleHandlerRoutine(DWORD dwCtrlType); @@ -115,7 +117,7 @@ } #endif } - atexit(atexit_handler); + atexit(fatal_signal_atexit_handler); } } @@ -200,6 +202,7 @@ VLOG_WARN("terminating with signal %d", (int)sig_nr); #endif call_hooks(sig_nr); + fflush(stderr); /* Re-raise the signal with the default handling so that the program * termination status reflects that we were killed by this signal */ @@ -215,7 +218,11 @@ fatal_signal_wait(void) { fatal_signal_init(); - poll_fd_wait_event(signal_fds[0], wevent, POLLIN); +#ifdef _WIN32 + poll_wevent_wait(wevent); +#else + poll_fd_wait(signal_fds[0], POLLIN); +#endif } void @@ -226,8 +233,8 @@ #endif } -static void -atexit_handler(void) +void +fatal_signal_atexit_handler(void) { call_hooks(0); } @@ -374,3 +381,21 @@ raise(stored_sig_nr); } } + +#ifndef _WIN32 +/* Blocks all fatal signals and returns previous signal mask into + * 'prev_mask'. */ +void +fatal_signal_block(sigset_t *prev_mask) +{ + int i; + sigset_t block_mask; + + sigemptyset(&block_mask); + for (i = 0; i < ARRAY_SIZE(fatal_signals); i++) { + int sig_nr = fatal_signals[i]; + sigaddset(&block_mask, sig_nr); + } + xpthread_sigmask(SIG_BLOCK, &block_mask, prev_mask); +} +#endif diff -Nru openvswitch-2.3.1/lib/fatal-signal.h openvswitch-2.4.0~git20150623/lib/fatal-signal.h --- openvswitch-2.3.1/lib/fatal-signal.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/fatal-signal.h 2015-06-23 18:46:21.000000000 +0000 @@ -17,6 +17,9 @@ #ifndef FATAL_SIGNAL_H #define FATAL_SIGNAL_H 1 +#ifndef _WIN32 +#include +#endif #include /* Basic interface. */ @@ -28,6 +31,7 @@ void fatal_signal_run(void); void fatal_signal_wait(void); void fatal_ignore_sigpipe(void); +void fatal_signal_atexit_handler(void); /* Convenience functions for unlinking files upon termination. * @@ -41,4 +45,8 @@ * it through. */ void fatal_signal_handler(int sig_nr); +#ifndef _WIN32 +void fatal_signal_block(sigset_t *prev_mask); +#endif + #endif /* fatal-signal.h */ diff -Nru openvswitch-2.3.1/lib/fat-rwlock.c openvswitch-2.4.0~git20150623/lib/fat-rwlock.c --- openvswitch-2.3.1/lib/fat-rwlock.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/fat-rwlock.c 2015-06-23 18:46:21.000000000 +0000 @@ -30,7 +30,7 @@ * * fat_rwlock_destroy() sets 'rwlock' to NULL to indicate that this * slot may be destroyed. */ - struct list list_node; /* In struct rwlock's 'threads' list. */ + struct ovs_list list_node; /* In struct rwlock's 'threads' list. */ struct fat_rwlock *rwlock; /* Owner. */ /* Mutex. @@ -162,6 +162,33 @@ } } +static struct fat_rwlock_slot * +fat_rwlock_try_get_slot__(struct fat_rwlock *rwlock) +{ + struct fat_rwlock_slot *slot; + + /* Fast path. */ + slot = ovsthread_getspecific(rwlock->key); + if (slot) { + return slot; + } + + /* Slow path: create a new slot for 'rwlock' in this thread. */ + + if (!ovs_mutex_trylock(&rwlock->mutex)) { + slot = xmalloc_cacheline(sizeof *slot); + slot->rwlock = rwlock; + ovs_mutex_init(&slot->mutex); + slot->depth = 0; + + list_push_back(&rwlock->threads, &slot->list_node); + ovs_mutex_unlock(&rwlock->mutex); + ovsthread_setspecific(rwlock->key, slot); + } + + return slot; +} + /* Tries to lock 'rwlock' for reading. If successful, returns 0. If taking * the lock would require blocking, returns EBUSY (without blocking). */ int @@ -170,9 +197,13 @@ OVS_NO_THREAD_SAFETY_ANALYSIS { struct fat_rwlock *rwlock = CONST_CAST(struct fat_rwlock *, rwlock_); - struct fat_rwlock_slot *this = fat_rwlock_get_slot__(rwlock); + struct fat_rwlock_slot *this = fat_rwlock_try_get_slot__(rwlock); int error; + if (!this) { + return EBUSY; + } + switch (this->depth) { case UINT_MAX: return EBUSY; diff -Nru openvswitch-2.3.1/lib/fat-rwlock.h openvswitch-2.4.0~git20150623/lib/fat-rwlock.h --- openvswitch-2.3.1/lib/fat-rwlock.h 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/fat-rwlock.h 2015-06-23 18:46:21.000000000 +0000 @@ -33,7 +33,7 @@ /* Contains "struct fat_rwlock_slot"s, one for each thread that has taken * this lock. Guarded by 'mutex'. */ - struct list threads OVS_GUARDED; + struct ovs_list threads OVS_GUARDED; struct ovs_mutex mutex; }; diff -Nru openvswitch-2.3.1/lib/flow.c openvswitch-2.4.0~git20150623/lib/flow.c --- openvswitch-2.3.1/lib/flow.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/flow.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ #include "hash.h" #include "jhash.h" #include "match.h" -#include "ofpbuf.h" +#include "dp-packet.h" #include "openflow/openflow.h" #include "packets.h" #include "odp-util.h" @@ -42,39 +42,44 @@ COVERAGE_DEFINE(flow_extract); COVERAGE_DEFINE(miniflow_malloc); -/* U32 indices for segmented flow classification. */ -const uint8_t flow_segment_u32s[4] = { - FLOW_SEGMENT_1_ENDS_AT / 4, - FLOW_SEGMENT_2_ENDS_AT / 4, - FLOW_SEGMENT_3_ENDS_AT / 4, - FLOW_U32S +/* U64 indices for segmented flow classification. */ +const uint8_t flow_segment_u64s[4] = { + FLOW_SEGMENT_1_ENDS_AT / sizeof(uint64_t), + FLOW_SEGMENT_2_ENDS_AT / sizeof(uint64_t), + FLOW_SEGMENT_3_ENDS_AT / sizeof(uint64_t), + FLOW_U64S }; +/* Asserts that field 'f1' follows immediately after 'f0' in struct flow, + * without any intervening padding. */ +#define ASSERT_SEQUENTIAL(f0, f1) \ + BUILD_ASSERT_DECL(offsetof(struct flow, f0) \ + + MEMBER_SIZEOF(struct flow, f0) \ + == offsetof(struct flow, f1)) + +/* Asserts that fields 'f0' and 'f1' are in the same 32-bit aligned word within + * struct flow. */ +#define ASSERT_SAME_WORD(f0, f1) \ + BUILD_ASSERT_DECL(offsetof(struct flow, f0) / 4 \ + == offsetof(struct flow, f1) / 4) + +/* Asserts that 'f0' and 'f1' are both sequential and within the same 32-bit + * aligned word in struct flow. */ +#define ASSERT_SEQUENTIAL_SAME_WORD(f0, f1) \ + ASSERT_SEQUENTIAL(f0, f1); \ + ASSERT_SAME_WORD(f0, f1) + /* miniflow_extract() assumes the following to be true to optimize the * extraction process. */ -BUILD_ASSERT_DECL(offsetof(struct flow, dl_type) + 2 - == offsetof(struct flow, vlan_tci) && - offsetof(struct flow, dl_type) / 4 - == offsetof(struct flow, vlan_tci) / 4 ); - -BUILD_ASSERT_DECL(offsetof(struct flow, nw_frag) + 3 - == offsetof(struct flow, nw_proto) && - offsetof(struct flow, nw_tos) + 2 - == offsetof(struct flow, nw_proto) && - offsetof(struct flow, nw_ttl) + 1 - == offsetof(struct flow, nw_proto) && - offsetof(struct flow, nw_frag) / 4 - == offsetof(struct flow, nw_tos) / 4 && - offsetof(struct flow, nw_ttl) / 4 - == offsetof(struct flow, nw_tos) / 4 && - offsetof(struct flow, nw_proto) / 4 - == offsetof(struct flow, nw_tos) / 4); - -/* TCP flags in the first half of a BE32, zeroes in the other half. */ -BUILD_ASSERT_DECL(offsetof(struct flow, tcp_flags) + 2 - == offsetof(struct flow, pad) && - offsetof(struct flow, tcp_flags) / 4 - == offsetof(struct flow, pad) / 4); +ASSERT_SEQUENTIAL_SAME_WORD(dl_type, vlan_tci); + +ASSERT_SEQUENTIAL_SAME_WORD(nw_frag, nw_tos); +ASSERT_SEQUENTIAL_SAME_WORD(nw_tos, nw_ttl); +ASSERT_SEQUENTIAL_SAME_WORD(nw_ttl, nw_proto); + +/* TCP flags in the middle of a BE64, zeroes in the other half. */ +BUILD_ASSERT_DECL(offsetof(struct flow, tcp_flags) % 8 == 4); + #if WORDS_BIGENDIAN #define TCP_FLAGS_BE32(tcp_ctl) ((OVS_FORCE ovs_be32)TCP_FLAGS_BE16(tcp_ctl) \ << 16) @@ -82,18 +87,15 @@ #define TCP_FLAGS_BE32(tcp_ctl) ((OVS_FORCE ovs_be32)TCP_FLAGS_BE16(tcp_ctl)) #endif -BUILD_ASSERT_DECL(offsetof(struct flow, tp_src) + 2 - == offsetof(struct flow, tp_dst) && - offsetof(struct flow, tp_src) / 4 - == offsetof(struct flow, tp_dst) / 4); +ASSERT_SEQUENTIAL_SAME_WORD(tp_src, tp_dst); /* Removes 'size' bytes from the head end of '*datap', of size '*sizep', which * must contain at least 'size' bytes of data. Returns the first byte of data * removed. */ static inline const void * -data_pull(void **datap, size_t *sizep, size_t size) +data_pull(const void **datap, size_t *sizep, size_t size) { - char *data = (char *)*datap; + const char *data = *datap; *datap = data + size; *sizep -= size; return data; @@ -103,7 +105,7 @@ * the head end of '*datap' and returns the first byte removed. Otherwise, * returns a null pointer without modifying '*datap'. */ static inline const void * -data_try_pull(void **datap, size_t *sizep, size_t size) +data_try_pull(const void **datap, size_t *sizep, size_t size) { return OVS_LIKELY(*sizep >= size) ? data_pull(datap, sizep, size) : NULL; } @@ -111,95 +113,159 @@ /* Context for pushing data to a miniflow. */ struct mf_ctx { uint64_t map; - uint32_t *data; - uint32_t * const end; + uint64_t *data; + uint64_t * const end; }; /* miniflow_push_* macros allow filling in a miniflow data values in order. * Assertions are needed only when the layout of the struct flow is modified. * 'ofs' is a compile-time constant, which allows most of the code be optimized - * away. Some GCC versions gave warnigns on ALWAYS_INLINE, so these are + * away. Some GCC versions gave warnings on ALWAYS_INLINE, so these are * defined as macros. */ -#if (FLOW_WC_SEQ != 26) +#if (FLOW_WC_SEQ != 31) #define MINIFLOW_ASSERT(X) ovs_assert(X) +BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() will have runtime " + "assertions enabled. Consider updating FLOW_WC_SEQ after " + "testing") #else #define MINIFLOW_ASSERT(X) #endif -#define miniflow_push_uint32_(MF, OFS, VALUE) \ +#define miniflow_push_uint64_(MF, OFS, VALUE) \ { \ - MINIFLOW_ASSERT(MF.data < MF.end && (OFS) % 4 == 0 \ - && !(MF.map & (UINT64_MAX << (OFS) / 4))); \ + MINIFLOW_ASSERT(MF.data < MF.end && (OFS) % 8 == 0 \ + && !(MF.map & (UINT64_MAX << (OFS) / 8))); \ *MF.data++ = VALUE; \ - MF.map |= UINT64_C(1) << (OFS) / 4; \ + MF.map |= UINT64_C(1) << (OFS) / 8; \ } -#define miniflow_push_be32_(MF, OFS, VALUE) \ - miniflow_push_uint32_(MF, OFS, (OVS_FORCE uint32_t)(VALUE)) +#define miniflow_push_be64_(MF, OFS, VALUE) \ + miniflow_push_uint64_(MF, OFS, (OVS_FORCE uint64_t)(VALUE)) -#define miniflow_push_uint16_(MF, OFS, VALUE) \ +#define miniflow_push_uint32_(MF, OFS, VALUE) \ { \ MINIFLOW_ASSERT(MF.data < MF.end && \ - (((OFS) % 4 == 0 && !(MF.map & (UINT64_MAX << (OFS) / 4))) \ - || ((OFS) % 4 == 2 && MF.map & (UINT64_C(1) << (OFS) / 4) \ - && !(MF.map & (UINT64_MAX << ((OFS) / 4 + 1)))))); \ + (((OFS) % 8 == 0 && !(MF.map & (UINT64_MAX << (OFS) / 8))) \ + || ((OFS) % 8 == 4 && MF.map & (UINT64_C(1) << (OFS) / 8) \ + && !(MF.map & (UINT64_MAX << ((OFS) / 8 + 1)))))); \ \ - if ((OFS) % 4 == 0) { \ + if ((OFS) % 8 == 0) { \ + *(uint32_t *)MF.data = VALUE; \ + MF.map |= UINT64_C(1) << (OFS) / 8; \ + } else if ((OFS) % 8 == 4) { \ + *((uint32_t *)MF.data + 1) = VALUE; \ + MF.data++; \ + } \ +} + +#define miniflow_push_be32_(MF, OFS, VALUE) \ + miniflow_push_uint32_(MF, OFS, (OVS_FORCE uint32_t)(VALUE)) + +#define miniflow_push_uint16_(MF, OFS, VALUE) \ +{ \ + MINIFLOW_ASSERT(MF.data < MF.end && \ + (((OFS) % 8 == 0 && !(MF.map & (UINT64_MAX << (OFS) / 8))) \ + || ((OFS) % 2 == 0 && MF.map & (UINT64_C(1) << (OFS) / 8) \ + && !(MF.map & (UINT64_MAX << ((OFS) / 8 + 1)))))); \ + \ + if ((OFS) % 8 == 0) { \ *(uint16_t *)MF.data = VALUE; \ - MF.map |= UINT64_C(1) << (OFS) / 4; \ - } else if ((OFS) % 4 == 2) { \ + MF.map |= UINT64_C(1) << (OFS) / 8; \ + } else if ((OFS) % 8 == 2) { \ *((uint16_t *)MF.data + 1) = VALUE; \ + } else if ((OFS) % 8 == 4) { \ + *((uint16_t *)MF.data + 2) = VALUE; \ + } else if ((OFS) % 8 == 6) { \ + *((uint16_t *)MF.data + 3) = VALUE; \ MF.data++; \ } \ } -#define miniflow_push_be16_(MF, OFS, VALUE) \ +#define miniflow_pad_to_64_(MF, OFS) \ +{ \ + MINIFLOW_ASSERT((OFS) % 8 != 0); \ + MINIFLOW_ASSERT(MF.map & (UINT64_C(1) << (OFS) / 8)); \ + MINIFLOW_ASSERT(!(MF.map & (UINT64_MAX << ((OFS) / 8 + 1)))); \ + \ + memset((uint8_t *)MF.data + (OFS) % 8, 0, 8 - (OFS) % 8); \ + MF.data++; \ +} + +#define miniflow_push_be16_(MF, OFS, VALUE) \ miniflow_push_uint16_(MF, OFS, (OVS_FORCE uint16_t)VALUE); /* Data at 'valuep' may be unaligned. */ #define miniflow_push_words_(MF, OFS, VALUEP, N_WORDS) \ { \ - int ofs32 = (OFS) / 4; \ + int ofs64 = (OFS) / 8; \ \ - MINIFLOW_ASSERT(MF.data + (N_WORDS) <= MF.end && (OFS) % 4 == 0 \ - && !(MF.map & (UINT64_MAX << ofs32))); \ + MINIFLOW_ASSERT(MF.data + (N_WORDS) <= MF.end && (OFS) % 8 == 0 \ + && !(MF.map & (UINT64_MAX << ofs64))); \ \ memcpy(MF.data, (VALUEP), (N_WORDS) * sizeof *MF.data); \ MF.data += (N_WORDS); \ - MF.map |= ((UINT64_MAX >> (64 - (N_WORDS))) << ofs32); \ + MF.map |= ((UINT64_MAX >> (64 - (N_WORDS))) << ofs64); \ } -#define miniflow_push_uint32(MF, FIELD, VALUE) \ - miniflow_push_uint32_(MF, offsetof(struct flow, FIELD), VALUE) +/* Push 32-bit words padded to 64-bits. */ +#define miniflow_push_words_32_(MF, OFS, VALUEP, N_WORDS) \ +{ \ + int ofs64 = (OFS) / 8; \ + \ + MINIFLOW_ASSERT(MF.data + DIV_ROUND_UP(N_WORDS, 2) <= MF.end \ + && (OFS) % 8 == 0 \ + && !(MF.map & (UINT64_MAX << ofs64))); \ + \ + memcpy(MF.data, (VALUEP), (N_WORDS) * sizeof(uint32_t)); \ + MF.data += DIV_ROUND_UP(N_WORDS, 2); \ + MF.map |= ((UINT64_MAX >> (64 - DIV_ROUND_UP(N_WORDS, 2))) << ofs64); \ + if ((N_WORDS) & 1) { \ + *((uint32_t *)MF.data - 1) = 0; \ + } \ +} -#define miniflow_push_be32(MF, FIELD, VALUE) \ - miniflow_push_be32_(MF, offsetof(struct flow, FIELD), VALUE) +/* Data at 'valuep' may be unaligned. */ +/* MACs start 64-aligned, and must be followed by other data or padding. */ +#define miniflow_push_macs_(MF, OFS, VALUEP) \ +{ \ + int ofs64 = (OFS) / 8; \ + \ + MINIFLOW_ASSERT(MF.data + 2 <= MF.end && (OFS) % 8 == 0 \ + && !(MF.map & (UINT64_MAX << ofs64))); \ + \ + memcpy(MF.data, (VALUEP), 2 * ETH_ADDR_LEN); \ + MF.data += 1; /* First word only. */ \ + MF.map |= UINT64_C(3) << ofs64; /* Both words. */ \ +} -#define miniflow_push_uint32_check(MF, FIELD, VALUE) \ - { if (OVS_LIKELY(VALUE)) { \ - miniflow_push_uint32_(MF, offsetof(struct flow, FIELD), VALUE); \ - } \ - } +#define miniflow_push_uint32(MF, FIELD, VALUE) \ + miniflow_push_uint32_(MF, offsetof(struct flow, FIELD), VALUE) -#define miniflow_push_be32_check(MF, FIELD, VALUE) \ - { if (OVS_LIKELY(VALUE)) { \ - miniflow_push_be32_(MF, offsetof(struct flow, FIELD), VALUE); \ - } \ - } +#define miniflow_push_be32(MF, FIELD, VALUE) \ + miniflow_push_be32_(MF, offsetof(struct flow, FIELD), VALUE) -#define miniflow_push_uint16(MF, FIELD, VALUE) \ +#define miniflow_push_uint16(MF, FIELD, VALUE) \ miniflow_push_uint16_(MF, offsetof(struct flow, FIELD), VALUE) -#define miniflow_push_be16(MF, FIELD, VALUE) \ +#define miniflow_push_be16(MF, FIELD, VALUE) \ miniflow_push_be16_(MF, offsetof(struct flow, FIELD), VALUE) +#define miniflow_pad_to_64(MF, FIELD) \ + miniflow_pad_to_64_(MF, offsetof(struct flow, FIELD)) + #define miniflow_push_words(MF, FIELD, VALUEP, N_WORDS) \ miniflow_push_words_(MF, offsetof(struct flow, FIELD), VALUEP, N_WORDS) +#define miniflow_push_words_32(MF, FIELD, VALUEP, N_WORDS) \ + miniflow_push_words_32_(MF, offsetof(struct flow, FIELD), VALUEP, N_WORDS) + +#define miniflow_push_macs(MF, FIELD, VALUEP) \ + miniflow_push_macs_(MF, offsetof(struct flow, FIELD), VALUEP) + /* Pulls the MPLS headers at '*datap' and returns the count of them. */ static inline int -parse_mpls(void **datap, size_t *sizep) +parse_mpls(const void **datap, size_t *sizep) { const struct mpls_hdr *mh; int count = 0; @@ -210,11 +276,11 @@ break; } } - return MAX(count, FLOW_MAX_MPLS_LABELS); + return MIN(count, FLOW_MAX_MPLS_LABELS); } static inline ovs_be16 -parse_vlan(void **datap, size_t *sizep) +parse_vlan(const void **datap, size_t *sizep) { const struct eth_header *eth = *datap; @@ -236,7 +302,7 @@ } static inline ovs_be16 -parse_ethertype(void **datap, size_t *sizep) +parse_ethertype(const void **datap, size_t *sizep) { const struct llc_snap_header *llc; ovs_be16 proto; @@ -269,7 +335,7 @@ } static inline bool -parse_icmpv6(void **datap, size_t *sizep, const struct icmp6_hdr *icmp, +parse_icmpv6(const void **datap, size_t *sizep, const struct icmp6_hdr *icmp, const struct in6_addr **nd_target, uint8_t arp_buf[2][ETH_ADDR_LEN]) { @@ -341,50 +407,53 @@ * otherwise UINT16_MAX. */ void -flow_extract(struct ofpbuf *packet, const struct pkt_metadata *md, - struct flow *flow) +flow_extract(struct dp_packet *packet, struct flow *flow) { struct { struct miniflow mf; - uint32_t buf[FLOW_U32S]; + uint64_t buf[FLOW_U64S]; } m; COVERAGE_INC(flow_extract); miniflow_initialize(&m.mf, m.buf); - miniflow_extract(packet, md, &m.mf); + miniflow_extract(packet, &m.mf); miniflow_expand(&m.mf, flow); } /* Caller is responsible for initializing 'dst' with enough storage for - * FLOW_U32S * 4 bytes. */ + * FLOW_U64S * 8 bytes. */ void -miniflow_extract(struct ofpbuf *packet, const struct pkt_metadata *md, - struct miniflow *dst) +miniflow_extract(struct dp_packet *packet, struct miniflow *dst) { - void *data = ofpbuf_data(packet); - size_t size = ofpbuf_size(packet); - uint32_t *values = miniflow_values(dst); - struct mf_ctx mf = { 0, values, values + FLOW_U32S }; - char *l2; + const struct pkt_metadata *md = &packet->md; + const void *data = dp_packet_data(packet); + size_t size = dp_packet_size(packet); + uint64_t *values = miniflow_values(dst); + struct mf_ctx mf = { 0, values, values + FLOW_U64S }; + const char *l2; ovs_be16 dl_type; uint8_t nw_frag, nw_tos, nw_ttl, nw_proto; /* Metadata. */ - if (md) { - if (md->tunnel.ip_dst) { - miniflow_push_words(mf, tunnel, &md->tunnel, - sizeof md->tunnel / 4); - } - miniflow_push_uint32_check(mf, skb_priority, md->skb_priority); - miniflow_push_uint32_check(mf, pkt_mark, md->pkt_mark); - miniflow_push_uint32_check(mf, recirc_id, md->recirc_id); - miniflow_push_uint32(mf, in_port, odp_to_u32(md->in_port.odp_port)); + if (md->tunnel.ip_dst) { + miniflow_push_words(mf, tunnel, &md->tunnel, + sizeof md->tunnel / sizeof(uint64_t)); + } + if (md->skb_priority || md->pkt_mark) { + miniflow_push_uint32(mf, skb_priority, md->skb_priority); + miniflow_push_uint32(mf, pkt_mark, md->pkt_mark); + } + miniflow_push_uint32(mf, dp_hash, md->dp_hash); + miniflow_push_uint32(mf, in_port, odp_to_u32(md->in_port.odp_port)); + if (md->recirc_id) { + miniflow_push_uint32(mf, recirc_id, md->recirc_id); + miniflow_pad_to_64(mf, conj_id); } /* Initialize packet's layer pointer and offsets. */ l2 = data; - ofpbuf_set_frame(packet, data); + dp_packet_reset_offsets(packet); /* Must have full Ethernet header to proceed. */ if (OVS_UNLIKELY(size < sizeof(struct eth_header))) { @@ -393,9 +462,8 @@ ovs_be16 vlan_tci; /* Link layer. */ - BUILD_ASSERT(offsetof(struct flow, dl_dst) + 6 - == offsetof(struct flow, dl_src)); - miniflow_push_words(mf, dl_dst, data, ETH_ADDR_LEN * 2 / 4); + ASSERT_SEQUENTIAL(dl_dst, dl_src); + miniflow_push_macs(mf, dl_dst, data); /* dl_type, vlan_tci. */ vlan_tci = parse_vlan(&data, &size); dl_type = parse_ethertype(&data, &size); @@ -410,7 +478,7 @@ packet->l2_5_ofs = (char *)data - l2; count = parse_mpls(&data, &size); - miniflow_push_words(mf, mpls_lse, mpls, count); + miniflow_push_words_32(mf, mpls_lse, mpls, count); } /* Network layer. */ @@ -420,6 +488,7 @@ if (OVS_LIKELY(dl_type == htons(ETH_TYPE_IP))) { const struct ip_header *nh = data; int ip_len; + uint16_t tot_len; if (OVS_UNLIKELY(size < IP_HEADER_LEN)) { goto out; @@ -429,9 +498,23 @@ if (OVS_UNLIKELY(ip_len < IP_HEADER_LEN)) { goto out; } + if (OVS_UNLIKELY(size < ip_len)) { + goto out; + } + tot_len = ntohs(nh->ip_tot_len); + if (OVS_UNLIKELY(tot_len > size)) { + goto out; + } + if (OVS_UNLIKELY(size - tot_len > UINT8_MAX)) { + goto out; + } + dp_packet_set_l2_pad_size(packet, size - tot_len); + size = tot_len; /* Never pull padding. */ /* Push both source and destination address at once. */ - miniflow_push_words(mf, nw_src, &nh->ip_src, 2); + miniflow_push_words(mf, nw_src, &nh->ip_src, 1); + + miniflow_push_be32(mf, ipv6_label, 0); /* Padding for IPv4. */ nw_tos = nh->ip_tos; nw_ttl = nh->ip_ttl; @@ -442,29 +525,37 @@ nw_frag |= FLOW_NW_FRAG_LATER; } } - if (OVS_UNLIKELY(size < ip_len)) { - goto out; - } data_pull(&data, &size, ip_len); - } else if (dl_type == htons(ETH_TYPE_IPV6)) { const struct ovs_16aligned_ip6_hdr *nh; ovs_be32 tc_flow; + uint16_t plen; if (OVS_UNLIKELY(size < sizeof *nh)) { goto out; } nh = data_pull(&data, &size, sizeof *nh); + plen = ntohs(nh->ip6_plen); + if (OVS_UNLIKELY(plen > size)) { + goto out; + } + /* Jumbo Payload option not supported yet. */ + if (OVS_UNLIKELY(size - plen > UINT8_MAX)) { + goto out; + } + dp_packet_set_l2_pad_size(packet, size - plen); + size = plen; /* Never pull padding. */ + miniflow_push_words(mf, ipv6_src, &nh->ip6_src, - sizeof nh->ip6_src / 4); + sizeof nh->ip6_src / 8); miniflow_push_words(mf, ipv6_dst, &nh->ip6_dst, - sizeof nh->ip6_dst / 4); + sizeof nh->ip6_dst / 8); tc_flow = get_16aligned_be32(&nh->ip6_flow); { ovs_be32 label = tc_flow & htonl(IPV6_LABEL_MASK); - miniflow_push_be32_check(mf, ipv6_label, label); + miniflow_push_be32(mf, ipv6_label, label); } nw_tos = ntohl(tc_flow) >> 20; @@ -545,22 +636,24 @@ && OVS_LIKELY(arp->ar_pro == htons(ETH_TYPE_IP)) && OVS_LIKELY(arp->ar_hln == ETH_ADDR_LEN) && OVS_LIKELY(arp->ar_pln == 4)) { - miniflow_push_words(mf, nw_src, &arp->ar_spa, 1); - miniflow_push_words(mf, nw_dst, &arp->ar_tpa, 1); + miniflow_push_be32(mf, nw_src, + get_16aligned_be32(&arp->ar_spa)); + miniflow_push_be32(mf, nw_dst, + get_16aligned_be32(&arp->ar_tpa)); /* We only match on the lower 8 bits of the opcode. */ if (OVS_LIKELY(ntohs(arp->ar_op) <= 0xff)) { + miniflow_push_be32(mf, ipv6_label, 0); /* Pad with ARP. */ miniflow_push_be32(mf, nw_frag, htonl(ntohs(arp->ar_op))); } /* Must be adjacent. */ - BUILD_ASSERT(offsetof(struct flow, arp_sha) + 6 - == offsetof(struct flow, arp_tha)); + ASSERT_SEQUENTIAL(arp_sha, arp_tha); memcpy(arp_buf[0], arp->ar_sha, ETH_ADDR_LEN); memcpy(arp_buf[1], arp->ar_tha, ETH_ADDR_LEN); - miniflow_push_words(mf, arp_sha, arp_buf, - ETH_ADDR_LEN * 2 / 4); + miniflow_push_macs(mf, arp_sha, arp_buf); + miniflow_pad_to_64(mf, tcp_flags); } } goto out; @@ -575,21 +668,28 @@ if (OVS_LIKELY(size >= TCP_HEADER_LEN)) { const struct tcp_header *tcp = data; + miniflow_push_be32(mf, arp_tha[2], 0); miniflow_push_be32(mf, tcp_flags, TCP_FLAGS_BE32(tcp->tcp_ctl)); - miniflow_push_words(mf, tp_src, &tcp->tcp_src, 1); + miniflow_push_be16(mf, tp_src, tcp->tcp_src); + miniflow_push_be16(mf, tp_dst, tcp->tcp_dst); + miniflow_pad_to_64(mf, igmp_group_ip4); } } else if (OVS_LIKELY(nw_proto == IPPROTO_UDP)) { if (OVS_LIKELY(size >= UDP_HEADER_LEN)) { const struct udp_header *udp = data; - miniflow_push_words(mf, tp_src, &udp->udp_src, 1); + miniflow_push_be16(mf, tp_src, udp->udp_src); + miniflow_push_be16(mf, tp_dst, udp->udp_dst); + miniflow_pad_to_64(mf, igmp_group_ip4); } } else if (OVS_LIKELY(nw_proto == IPPROTO_SCTP)) { if (OVS_LIKELY(size >= SCTP_HEADER_LEN)) { const struct sctp_header *sctp = data; - miniflow_push_words(mf, tp_src, &sctp->sctp_src, 1); + miniflow_push_be16(mf, tp_src, sctp->sctp_src); + miniflow_push_be16(mf, tp_dst, sctp->sctp_dst); + miniflow_pad_to_64(mf, igmp_group_ip4); } } else if (OVS_LIKELY(nw_proto == IPPROTO_ICMP)) { if (OVS_LIKELY(size >= ICMP_HEADER_LEN)) { @@ -597,6 +697,16 @@ miniflow_push_be16(mf, tp_src, htons(icmp->icmp_type)); miniflow_push_be16(mf, tp_dst, htons(icmp->icmp_code)); + miniflow_pad_to_64(mf, igmp_group_ip4); + } + } else if (OVS_LIKELY(nw_proto == IPPROTO_IGMP)) { + if (OVS_LIKELY(size >= IGMP_HEADER_LEN)) { + const struct igmp_header *igmp = data; + + miniflow_push_be16(mf, tp_src, htons(igmp->igmp_type)); + miniflow_push_be16(mf, tp_dst, htons(igmp->igmp_code)); + miniflow_push_be32(mf, igmp_group_ip4, + get_16aligned_be32(&igmp->group)); } } else if (OVS_LIKELY(nw_proto == IPPROTO_ICMPV6)) { if (OVS_LIKELY(size >= sizeof(struct icmp6_hdr))) { @@ -607,21 +717,19 @@ memset(arp_buf, 0, sizeof arp_buf); if (OVS_LIKELY(parse_icmpv6(&data, &size, icmp, &nd_target, arp_buf))) { - miniflow_push_words(mf, arp_sha, arp_buf, - ETH_ADDR_LEN * 2 / 4); if (nd_target) { miniflow_push_words(mf, nd_target, nd_target, - sizeof *nd_target / 4); + sizeof *nd_target / 8); } + miniflow_push_macs(mf, arp_sha, arp_buf); + miniflow_pad_to_64(mf, tcp_flags); miniflow_push_be16(mf, tp_src, htons(icmp->icmp6_type)); miniflow_push_be16(mf, tp_dst, htons(icmp->icmp6_code)); + miniflow_pad_to_64(mf, igmp_group_ip4); } } } } - if (md) { - miniflow_push_uint32_check(mf, dp_hash, md->dp_hash); - } out: dst->map = mf.map; } @@ -631,12 +739,12 @@ void flow_zero_wildcards(struct flow *flow, const struct flow_wildcards *wildcards) { - uint32_t *flow_u32 = (uint32_t *) flow; - const uint32_t *wc_u32 = (const uint32_t *) &wildcards->masks; + uint64_t *flow_u64 = (uint64_t *) flow; + const uint64_t *wc_u64 = (const uint64_t *) &wildcards->masks; size_t i; - for (i = 0; i < FLOW_U32S; i++) { - flow_u32[i] &= wc_u32[i]; + for (i = 0; i < FLOW_U64S; i++) { + flow_u64[i] &= wc_u64[i]; } } @@ -652,21 +760,45 @@ } } -/* Initializes 'fmd' with the metadata found in 'flow'. */ +/* Initializes 'flow_metadata' with the metadata found in 'flow'. */ void -flow_get_metadata(const struct flow *flow, struct flow_metadata *fmd) +flow_get_metadata(const struct flow *flow, struct match *flow_metadata) { - BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26); + int i; + + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); + + match_init_catchall(flow_metadata); + if (flow->tunnel.tun_id != htonll(0)) { + match_set_tun_id(flow_metadata, flow->tunnel.tun_id); + } + if (flow->tunnel.ip_src != htonl(0)) { + match_set_tun_src(flow_metadata, flow->tunnel.ip_src); + } + if (flow->tunnel.ip_dst != htonl(0)) { + match_set_tun_dst(flow_metadata, flow->tunnel.ip_dst); + } + if (flow->tunnel.gbp_id != htons(0)) { + match_set_tun_gbp_id(flow_metadata, flow->tunnel.gbp_id); + } + if (flow->tunnel.gbp_flags) { + match_set_tun_gbp_flags(flow_metadata, flow->tunnel.gbp_flags); + } + if (flow->metadata != htonll(0)) { + match_set_metadata(flow_metadata, flow->metadata); + } + + for (i = 0; i < FLOW_N_REGS; i++) { + if (flow->regs[i]) { + match_set_reg(flow_metadata, i, flow->regs[i]); + } + } + + if (flow->pkt_mark != 0) { + match_set_pkt_mark(flow_metadata, flow->pkt_mark); + } - fmd->dp_hash = flow->dp_hash; - fmd->recirc_id = flow->recirc_id; - fmd->tun_id = flow->tunnel.tun_id; - fmd->tun_src = flow->tunnel.ip_src; - fmd->tun_dst = flow->tunnel.ip_dst; - fmd->metadata = flow->metadata; - memcpy(fmd->regs, flow->regs, sizeof fmd->regs); - fmd->pkt_mark = flow->pkt_mark; - fmd->in_port = flow->in_port.ofp_port; + match_set_in_port(flow_metadata, flow->in_port.ofp_port); } char * @@ -687,6 +819,8 @@ return "csum"; case FLOW_TNL_F_KEY: return "key"; + case FLOW_TNL_F_OAM: + return "oam"; default: return NULL; } @@ -743,8 +877,41 @@ flow_format(struct ds *ds, const struct flow *flow) { struct match match; + struct flow_wildcards *wc = &match.wc; match_wc_init(&match, flow); + + /* As this function is most often used for formatting a packet in a + * packet-in message, skip formatting the packet context fields that are + * all-zeroes to make the print-out easier on the eyes. This means that a + * missing context field implies a zero value for that field. This is + * similar to OpenFlow encoding of these fields, as the specification + * states that all-zeroes context fields should not be encoded in the + * packet-in messages. */ + if (!flow->in_port.ofp_port) { + WC_UNMASK_FIELD(wc, in_port); + } + if (!flow->skb_priority) { + WC_UNMASK_FIELD(wc, skb_priority); + } + if (!flow->pkt_mark) { + WC_UNMASK_FIELD(wc, pkt_mark); + } + if (!flow->recirc_id) { + WC_UNMASK_FIELD(wc, recirc_id); + } + if (!flow->dp_hash) { + WC_UNMASK_FIELD(wc, dp_hash); + } + for (int i = 0; i < FLOW_N_REGS; i++) { + if (!flow->regs[i]) { + WC_UNMASK_FIELD(wc, regs[i]); + } + } + if (!flow->metadata) { + WC_UNMASK_FIELD(wc, metadata); + } + match_format(&match, ds, OFP_DEFAULT_PRIORITY); } @@ -765,13 +932,173 @@ memset(&wc->masks, 0, sizeof wc->masks); } +/* Converts a flow into flow wildcards. It sets the wildcard masks based on + * the packet headers extracted to 'flow'. It will not set the mask for fields + * that do not make sense for the packet type. OpenFlow-only metadata is + * wildcarded, but other metadata is unconditionally exact-matched. */ +void flow_wildcards_init_for_packet(struct flow_wildcards *wc, + const struct flow *flow) +{ + memset(&wc->masks, 0x0, sizeof wc->masks); + + /* Update this function whenever struct flow changes. */ + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); + + if (flow->tunnel.ip_dst) { + if (flow->tunnel.flags & FLOW_TNL_F_KEY) { + WC_MASK_FIELD(wc, tunnel.tun_id); + } + WC_MASK_FIELD(wc, tunnel.ip_src); + WC_MASK_FIELD(wc, tunnel.ip_dst); + WC_MASK_FIELD(wc, tunnel.flags); + WC_MASK_FIELD(wc, tunnel.ip_tos); + WC_MASK_FIELD(wc, tunnel.ip_ttl); + WC_MASK_FIELD(wc, tunnel.tp_src); + WC_MASK_FIELD(wc, tunnel.tp_dst); + WC_MASK_FIELD(wc, tunnel.gbp_id); + WC_MASK_FIELD(wc, tunnel.gbp_flags); + } else if (flow->tunnel.tun_id) { + WC_MASK_FIELD(wc, tunnel.tun_id); + } + + /* metadata, regs, and conj_id wildcarded. */ + + WC_MASK_FIELD(wc, skb_priority); + WC_MASK_FIELD(wc, pkt_mark); + WC_MASK_FIELD(wc, recirc_id); + WC_MASK_FIELD(wc, dp_hash); + WC_MASK_FIELD(wc, in_port); + + /* actset_output wildcarded. */ + + WC_MASK_FIELD(wc, dl_dst); + WC_MASK_FIELD(wc, dl_src); + WC_MASK_FIELD(wc, dl_type); + WC_MASK_FIELD(wc, vlan_tci); + + if (flow->dl_type == htons(ETH_TYPE_IP)) { + WC_MASK_FIELD(wc, nw_src); + WC_MASK_FIELD(wc, nw_dst); + } else if (flow->dl_type == htons(ETH_TYPE_IPV6)) { + WC_MASK_FIELD(wc, ipv6_src); + WC_MASK_FIELD(wc, ipv6_dst); + WC_MASK_FIELD(wc, ipv6_label); + } else if (flow->dl_type == htons(ETH_TYPE_ARP) || + flow->dl_type == htons(ETH_TYPE_RARP)) { + WC_MASK_FIELD(wc, nw_src); + WC_MASK_FIELD(wc, nw_dst); + WC_MASK_FIELD(wc, nw_proto); + WC_MASK_FIELD(wc, arp_sha); + WC_MASK_FIELD(wc, arp_tha); + return; + } else if (eth_type_mpls(flow->dl_type)) { + for (int i = 0; i < FLOW_MAX_MPLS_LABELS; i++) { + WC_MASK_FIELD(wc, mpls_lse[i]); + if (flow->mpls_lse[i] & htonl(MPLS_BOS_MASK)) { + break; + } + } + return; + } else { + return; /* Unknown ethertype. */ + } + + /* IPv4 or IPv6. */ + WC_MASK_FIELD(wc, nw_frag); + WC_MASK_FIELD(wc, nw_tos); + WC_MASK_FIELD(wc, nw_ttl); + WC_MASK_FIELD(wc, nw_proto); + + /* No transport layer header in later fragments. */ + if (!(flow->nw_frag & FLOW_NW_FRAG_LATER) && + (flow->nw_proto == IPPROTO_ICMP || + flow->nw_proto == IPPROTO_ICMPV6 || + flow->nw_proto == IPPROTO_TCP || + flow->nw_proto == IPPROTO_UDP || + flow->nw_proto == IPPROTO_SCTP || + flow->nw_proto == IPPROTO_IGMP)) { + WC_MASK_FIELD(wc, tp_src); + WC_MASK_FIELD(wc, tp_dst); + + if (flow->nw_proto == IPPROTO_TCP) { + WC_MASK_FIELD(wc, tcp_flags); + } else if (flow->nw_proto == IPPROTO_ICMPV6) { + WC_MASK_FIELD(wc, arp_sha); + WC_MASK_FIELD(wc, arp_tha); + WC_MASK_FIELD(wc, nd_target); + } else if (flow->nw_proto == IPPROTO_IGMP) { + WC_MASK_FIELD(wc, igmp_group_ip4); + } + } +} + +/* Return a map of possible fields for a packet of the same type as 'flow'. + * Including extra bits in the returned mask is not wrong, it is just less + * optimal. + * + * This is a less precise version of flow_wildcards_init_for_packet() above. */ +uint64_t +flow_wc_map(const struct flow *flow) +{ + /* Update this function whenever struct flow changes. */ + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); + + uint64_t map = (flow->tunnel.ip_dst) ? MINIFLOW_MAP(tunnel) : 0; + + /* Metadata fields that can appear on packet input. */ + map |= MINIFLOW_MAP(skb_priority) | MINIFLOW_MAP(pkt_mark) + | MINIFLOW_MAP(recirc_id) | MINIFLOW_MAP(dp_hash) + | MINIFLOW_MAP(in_port) + | MINIFLOW_MAP(dl_dst) | MINIFLOW_MAP(dl_src) + | MINIFLOW_MAP(dl_type) | MINIFLOW_MAP(vlan_tci); + + /* Ethertype-dependent fields. */ + if (OVS_LIKELY(flow->dl_type == htons(ETH_TYPE_IP))) { + map |= MINIFLOW_MAP(nw_src) | MINIFLOW_MAP(nw_dst) + | MINIFLOW_MAP(nw_proto) | MINIFLOW_MAP(nw_frag) + | MINIFLOW_MAP(nw_tos) | MINIFLOW_MAP(nw_ttl); + if (OVS_UNLIKELY(flow->nw_proto == IPPROTO_IGMP)) { + map |= MINIFLOW_MAP(igmp_group_ip4); + } else { + map |= MINIFLOW_MAP(tcp_flags) + | MINIFLOW_MAP(tp_src) | MINIFLOW_MAP(tp_dst); + } + } else if (flow->dl_type == htons(ETH_TYPE_IPV6)) { + map |= MINIFLOW_MAP(ipv6_src) | MINIFLOW_MAP(ipv6_dst) + | MINIFLOW_MAP(ipv6_label) + | MINIFLOW_MAP(nw_proto) | MINIFLOW_MAP(nw_frag) + | MINIFLOW_MAP(nw_tos) | MINIFLOW_MAP(nw_ttl); + if (OVS_UNLIKELY(flow->nw_proto == IPPROTO_ICMPV6)) { + map |= MINIFLOW_MAP(nd_target) + | MINIFLOW_MAP(arp_sha) | MINIFLOW_MAP(arp_tha); + } else { + map |= MINIFLOW_MAP(tcp_flags) + | MINIFLOW_MAP(tp_src) | MINIFLOW_MAP(tp_dst); + } + } else if (eth_type_mpls(flow->dl_type)) { + map |= MINIFLOW_MAP(mpls_lse); + } else if (flow->dl_type == htons(ETH_TYPE_ARP) || + flow->dl_type == htons(ETH_TYPE_RARP)) { + map |= MINIFLOW_MAP(nw_src) | MINIFLOW_MAP(nw_dst) + | MINIFLOW_MAP(nw_proto) + | MINIFLOW_MAP(arp_sha) | MINIFLOW_MAP(arp_tha); + } + + return map; +} + /* Clear the metadata and register wildcard masks. They are not packet * header fields. */ void flow_wildcards_clear_non_packet_fields(struct flow_wildcards *wc) { + /* Update this function whenever struct flow changes. */ + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); + memset(&wc->masks.metadata, 0, sizeof wc->masks.metadata); memset(&wc->masks.regs, 0, sizeof wc->masks.regs); + wc->masks.actset_output = 0; + wc->masks.conj_id = 0; } /* Returns true if 'wc' matches every packet, false if 'wc' fixes any bits or @@ -779,11 +1106,11 @@ bool flow_wildcards_is_catchall(const struct flow_wildcards *wc) { - const uint32_t *wc_u32 = (const uint32_t *) &wc->masks; + const uint64_t *wc_u64 = (const uint64_t *) &wc->masks; size_t i; - for (i = 0; i < FLOW_U32S; i++) { - if (wc_u32[i]) { + for (i = 0; i < FLOW_U64S; i++) { + if (wc_u64[i]) { return false; } } @@ -798,13 +1125,13 @@ const struct flow_wildcards *src1, const struct flow_wildcards *src2) { - uint32_t *dst_u32 = (uint32_t *) &dst->masks; - const uint32_t *src1_u32 = (const uint32_t *) &src1->masks; - const uint32_t *src2_u32 = (const uint32_t *) &src2->masks; + uint64_t *dst_u64 = (uint64_t *) &dst->masks; + const uint64_t *src1_u64 = (const uint64_t *) &src1->masks; + const uint64_t *src2_u64 = (const uint64_t *) &src2->masks; size_t i; - for (i = 0; i < FLOW_U32S; i++) { - dst_u32[i] = src1_u32[i] & src2_u32[i]; + for (i = 0; i < FLOW_U64S; i++) { + dst_u64[i] = src1_u64[i] & src2_u64[i]; } } @@ -816,13 +1143,13 @@ const struct flow_wildcards *src1, const struct flow_wildcards *src2) { - uint32_t *dst_u32 = (uint32_t *) &dst->masks; - const uint32_t *src1_u32 = (const uint32_t *) &src1->masks; - const uint32_t *src2_u32 = (const uint32_t *) &src2->masks; + uint64_t *dst_u64 = (uint64_t *) &dst->masks; + const uint64_t *src1_u64 = (const uint64_t *) &src1->masks; + const uint64_t *src2_u64 = (const uint64_t *) &src2->masks; size_t i; - for (i = 0; i < FLOW_U32S; i++) { - dst_u32[i] = src1_u32[i] | src2_u32[i]; + for (i = 0; i < FLOW_U64S; i++) { + dst_u64[i] = src1_u64[i] | src2_u64[i]; } } @@ -848,12 +1175,12 @@ flow_wildcards_has_extra(const struct flow_wildcards *a, const struct flow_wildcards *b) { - const uint32_t *a_u32 = (const uint32_t *) &a->masks; - const uint32_t *b_u32 = (const uint32_t *) &b->masks; + const uint64_t *a_u64 = (const uint64_t *) &a->masks; + const uint64_t *b_u64 = (const uint64_t *) &b->masks; size_t i; - for (i = 0; i < FLOW_U32S; i++) { - if ((a_u32[i] & b_u32[i]) != b_u32[i]) { + for (i = 0; i < FLOW_U64S; i++) { + if ((a_u64[i] & b_u64[i]) != b_u64[i]) { return true; } } @@ -866,13 +1193,13 @@ flow_equal_except(const struct flow *a, const struct flow *b, const struct flow_wildcards *wc) { - const uint32_t *a_u32 = (const uint32_t *) a; - const uint32_t *b_u32 = (const uint32_t *) b; - const uint32_t *wc_u32 = (const uint32_t *) &wc->masks; + const uint64_t *a_u64 = (const uint64_t *) a; + const uint64_t *b_u64 = (const uint64_t *) b; + const uint64_t *wc_u64 = (const uint64_t *) &wc->masks; size_t i; - for (i = 0; i < FLOW_U32S; i++) { - if ((a_u32[i] ^ b_u32[i]) & wc_u32[i]) { + for (i = 0; i < FLOW_U64S; i++) { + if ((a_u64[i] ^ b_u64[i]) & wc_u64[i]) { return false; } } @@ -887,6 +1214,14 @@ wc->masks.regs[idx] = mask; } +/* Sets the wildcard mask for register 'idx' in 'wc' to 'mask'. + * (A 0-bit indicates a wildcard bit.) */ +void +flow_wildcards_set_xreg_mask(struct flow_wildcards *wc, int idx, uint64_t mask) +{ + flow_set_xreg(&wc->masks, idx, mask); +} + /* Calculates the 5-tuple hash from the given miniflow. * This returns the same value as flow_hash_5tuple for the corresponding * flow. */ @@ -898,37 +1233,29 @@ if (flow) { ovs_be16 dl_type = MINIFLOW_GET_BE16(flow, dl_type); - hash = mhash_add(hash, MINIFLOW_GET_U8(flow, nw_proto)); + hash = hash_add(hash, MINIFLOW_GET_U8(flow, nw_proto)); /* Separate loops for better optimization. */ if (dl_type == htons(ETH_TYPE_IPV6)) { - uint64_t map = MINIFLOW_MAP(ipv6_src) | MINIFLOW_MAP(ipv6_dst) - | MINIFLOW_MAP(tp_src); /* Covers both ports */ - uint32_t value; + uint64_t map = MINIFLOW_MAP(ipv6_src) | MINIFLOW_MAP(ipv6_dst); + uint64_t value; MINIFLOW_FOR_EACH_IN_MAP(value, flow, map) { - hash = mhash_add(hash, value); + hash = hash_add64(hash, value); } } else { - uint64_t map = MINIFLOW_MAP(nw_src) | MINIFLOW_MAP(nw_dst) - | MINIFLOW_MAP(tp_src); /* Covers both ports */ - uint32_t value; - - MINIFLOW_FOR_EACH_IN_MAP(value, flow, map) { - hash = mhash_add(hash, value); - } + hash = hash_add(hash, MINIFLOW_GET_U32(flow, nw_src)); + hash = hash_add(hash, MINIFLOW_GET_U32(flow, nw_dst)); } - hash = mhash_finish(hash, 42); /* Arbitrary number. */ + /* Add both ports at once. */ + hash = hash_add(hash, MINIFLOW_GET_U32(flow, tp_src)); + hash = hash_finish(hash, 42); /* Arbitrary number. */ } return hash; } -BUILD_ASSERT_DECL(offsetof(struct flow, tp_src) + 2 - == offsetof(struct flow, tp_dst) && - offsetof(struct flow, tp_src) / 4 - == offsetof(struct flow, tp_dst) / 4); -BUILD_ASSERT_DECL(offsetof(struct flow, ipv6_src) + 16 - == offsetof(struct flow, ipv6_dst)); +ASSERT_SEQUENTIAL_SAME_WORD(tp_src, tp_dst); +ASSERT_SEQUENTIAL(ipv6_src, ipv6_dst); /* Calculates the 5-tuple hash from the given flow. */ uint32_t @@ -937,24 +1264,25 @@ uint32_t hash = basis; if (flow) { - const uint32_t *flow_u32 = (const uint32_t *)flow; - - hash = mhash_add(hash, flow->nw_proto); + hash = hash_add(hash, flow->nw_proto); if (flow->dl_type == htons(ETH_TYPE_IPV6)) { - int ofs = offsetof(struct flow, ipv6_src) / 4; - int end = ofs + 2 * sizeof flow->ipv6_src / 4; + const uint64_t *flow_u64 = (const uint64_t *)flow; + int ofs = offsetof(struct flow, ipv6_src) / 8; + int end = ofs + 2 * sizeof flow->ipv6_src / 8; - while (ofs < end) { - hash = mhash_add(hash, flow_u32[ofs++]); + for (;ofs < end; ofs++) { + hash = hash_add64(hash, flow_u64[ofs]); } } else { - hash = mhash_add(hash, (OVS_FORCE uint32_t) flow->nw_src); - hash = mhash_add(hash, (OVS_FORCE uint32_t) flow->nw_dst); + hash = hash_add(hash, (OVS_FORCE uint32_t) flow->nw_src); + hash = hash_add(hash, (OVS_FORCE uint32_t) flow->nw_dst); } - hash = mhash_add(hash, flow_u32[offsetof(struct flow, tp_src) / 4]); - - hash = mhash_finish(hash, 42); /* Arbitrary number. */ + /* Add both ports at once. */ + hash = hash_add(hash, + ((const uint32_t *)flow)[offsetof(struct flow, tp_src) + / sizeof(uint32_t)]); + hash = hash_finish(hash, 42); /* Arbitrary number. */ } return hash; } @@ -1122,16 +1450,16 @@ flow_hash_in_wildcards(const struct flow *flow, const struct flow_wildcards *wc, uint32_t basis) { - const uint32_t *wc_u32 = (const uint32_t *) &wc->masks; - const uint32_t *flow_u32 = (const uint32_t *) flow; + const uint64_t *wc_u64 = (const uint64_t *) &wc->masks; + const uint64_t *flow_u64 = (const uint64_t *) flow; uint32_t hash; size_t i; hash = basis; - for (i = 0; i < FLOW_U32S; i++) { - hash = mhash_add(hash, flow_u32[i] & wc_u32[i]); + for (i = 0; i < FLOW_U64S; i++) { + hash = hash_add64(hash, flow_u64[i] & wc_u64[i]); } - return mhash_finish(hash, 4 * FLOW_U32S); + return hash_finish(hash, 8 * FLOW_U64S); } /* Sets the VLAN VID that 'flow' matches to 'vid', which is interpreted as an @@ -1193,23 +1521,24 @@ int flow_count_mpls_labels(const struct flow *flow, struct flow_wildcards *wc) { - if (wc) { - wc->masks.dl_type = OVS_BE16_MAX; - } + /* dl_type is always masked. */ if (eth_type_mpls(flow->dl_type)) { int i; - int len = FLOW_MAX_MPLS_LABELS; + int cnt; - for (i = 0; i < len; i++) { + cnt = 0; + for (i = 0; i < FLOW_MAX_MPLS_LABELS; i++) { if (wc) { wc->masks.mpls_lse[i] |= htonl(MPLS_BOS_MASK); } if (flow->mpls_lse[i] & htonl(MPLS_BOS_MASK)) { return i + 1; } + if (flow->mpls_lse[i]) { + cnt++; + } } - - return len; + return cnt; } else { return 0; } @@ -1264,7 +1593,7 @@ * * - BoS: 1. * - * If the new label is the second or label MPLS label in 'flow', it is + * If the new label is the second or later label MPLS label in 'flow', it is * generated as; * * - label: Copied from outer label. @@ -1285,15 +1614,16 @@ ovs_assert(eth_type_mpls(mpls_eth_type)); ovs_assert(n < FLOW_MAX_MPLS_LABELS); - memset(wc->masks.mpls_lse, 0xff, sizeof wc->masks.mpls_lse); if (n) { int i; + if (wc) { + memset(&wc->masks.mpls_lse, 0xff, sizeof *wc->masks.mpls_lse * n); + } for (i = n; i >= 1; i--) { flow->mpls_lse[i] = flow->mpls_lse[i - 1]; } - flow->mpls_lse[0] = (flow->mpls_lse[1] - & htonl(~MPLS_BOS_MASK)); + flow->mpls_lse[0] = (flow->mpls_lse[1] & htonl(~MPLS_BOS_MASK)); } else { int label = 0; /* IPv4 Explicit Null. */ int tc = 0; @@ -1305,20 +1635,23 @@ if (is_ip_any(flow)) { tc = (flow->nw_tos & IP_DSCP_MASK) >> 2; - wc->masks.nw_tos |= IP_DSCP_MASK; + if (wc) { + wc->masks.nw_tos |= IP_DSCP_MASK; + wc->masks.nw_ttl = 0xff; + } if (flow->nw_ttl) { ttl = flow->nw_ttl; } - wc->masks.nw_ttl = 0xff; } flow->mpls_lse[0] = set_mpls_lse_values(ttl, tc, 1, htonl(label)); - /* Clear all L3 and L4 fields. */ - BUILD_ASSERT(FLOW_WC_SEQ == 26); + /* Clear all L3 and L4 fields and dp_hash. */ + BUILD_ASSERT(FLOW_WC_SEQ == 31); memset((char *) flow + FLOW_SEGMENT_2_ENDS_AT, 0, sizeof(struct flow) - FLOW_SEGMENT_2_ENDS_AT); + flow->dp_hash = 0; } flow->dl_type = mpls_eth_type; } @@ -1337,13 +1670,20 @@ if (n == 0) { /* Nothing to pop. */ return false; - } else if (n == FLOW_MAX_MPLS_LABELS - && !(flow->mpls_lse[n - 1] & htonl(MPLS_BOS_MASK))) { - /* Can't pop because we don't know what to fill in mpls_lse[n - 1]. */ - return false; + } else if (n == FLOW_MAX_MPLS_LABELS) { + if (wc) { + wc->masks.mpls_lse[n - 1] |= htonl(MPLS_BOS_MASK); + } + if (!(flow->mpls_lse[n - 1] & htonl(MPLS_BOS_MASK))) { + /* Can't pop because don't know what to fill in mpls_lse[n - 1]. */ + return false; + } } - memset(wc->masks.mpls_lse, 0xff, sizeof wc->masks.mpls_lse); + if (wc) { + memset(&wc->masks.mpls_lse[1], 0xff, + sizeof *wc->masks.mpls_lse * (n - 1)); + } for (i = 1; i < n; i++) { flow->mpls_lse[i - 1] = flow->mpls_lse[i]; } @@ -1391,7 +1731,7 @@ } static size_t -flow_compose_l4(struct ofpbuf *b, const struct flow *flow) +flow_compose_l4(struct dp_packet *p, const struct flow *flow) { size_t l4_len = 0; @@ -1401,7 +1741,7 @@ struct tcp_header *tcp; l4_len = sizeof *tcp; - tcp = ofpbuf_put_zeros(b, l4_len); + tcp = dp_packet_put_zeros(p, l4_len); tcp->tcp_src = flow->tp_src; tcp->tcp_dst = flow->tp_dst; tcp->tcp_ctl = TCP_CTL(ntohs(flow->tcp_flags), 5); @@ -1409,29 +1749,38 @@ struct udp_header *udp; l4_len = sizeof *udp; - udp = ofpbuf_put_zeros(b, l4_len); + udp = dp_packet_put_zeros(p, l4_len); udp->udp_src = flow->tp_src; udp->udp_dst = flow->tp_dst; } else if (flow->nw_proto == IPPROTO_SCTP) { struct sctp_header *sctp; l4_len = sizeof *sctp; - sctp = ofpbuf_put_zeros(b, l4_len); + sctp = dp_packet_put_zeros(p, l4_len); sctp->sctp_src = flow->tp_src; sctp->sctp_dst = flow->tp_dst; } else if (flow->nw_proto == IPPROTO_ICMP) { struct icmp_header *icmp; l4_len = sizeof *icmp; - icmp = ofpbuf_put_zeros(b, l4_len); + icmp = dp_packet_put_zeros(p, l4_len); icmp->icmp_type = ntohs(flow->tp_src); icmp->icmp_code = ntohs(flow->tp_dst); icmp->icmp_csum = csum(icmp, ICMP_HEADER_LEN); + } else if (flow->nw_proto == IPPROTO_IGMP) { + struct igmp_header *igmp; + + l4_len = sizeof *igmp; + igmp = dp_packet_put_zeros(p, l4_len); + igmp->igmp_type = ntohs(flow->tp_src); + igmp->igmp_code = ntohs(flow->tp_dst); + put_16aligned_be32(&igmp->group, flow->igmp_group_ip4); + igmp->igmp_csum = csum(igmp, IGMP_HEADER_LEN); } else if (flow->nw_proto == IPPROTO_ICMPV6) { struct icmp6_hdr *icmp; l4_len = sizeof *icmp; - icmp = ofpbuf_put_zeros(b, l4_len); + icmp = dp_packet_put_zeros(p, l4_len); icmp->icmp6_type = ntohs(flow->tp_src); icmp->icmp6_code = ntohs(flow->tp_dst); @@ -1442,26 +1791,26 @@ struct nd_opt_hdr *nd_opt; l4_len += sizeof *nd_target; - nd_target = ofpbuf_put_zeros(b, sizeof *nd_target); + nd_target = dp_packet_put_zeros(p, sizeof *nd_target); *nd_target = flow->nd_target; if (!eth_addr_is_zero(flow->arp_sha)) { l4_len += 8; - nd_opt = ofpbuf_put_zeros(b, 8); + nd_opt = dp_packet_put_zeros(p, 8); nd_opt->nd_opt_len = 1; nd_opt->nd_opt_type = ND_OPT_SOURCE_LINKADDR; memcpy(nd_opt + 1, flow->arp_sha, ETH_ADDR_LEN); } if (!eth_addr_is_zero(flow->arp_tha)) { l4_len += 8; - nd_opt = ofpbuf_put_zeros(b, 8); + nd_opt = dp_packet_put_zeros(p, 8); nd_opt->nd_opt_len = 1; nd_opt->nd_opt_type = ND_OPT_TARGET_LINKADDR; memcpy(nd_opt + 1, flow->arp_tha, ETH_ADDR_LEN); } } icmp->icmp6_cksum = (OVS_FORCE uint16_t) - csum(icmp, (char *)ofpbuf_tail(b) - (char *)icmp); + csum(icmp, (char *)dp_packet_tail(p) - (char *)icmp); } } return l4_len; @@ -1474,26 +1823,26 @@ * valid. It hasn't got some checksums filled in, for one, and lots of fields * are just zeroed.) */ void -flow_compose(struct ofpbuf *b, const struct flow *flow) +flow_compose(struct dp_packet *p, const struct flow *flow) { size_t l4_len; /* eth_compose() sets l3 pointer and makes sure it is 32-bit aligned. */ - eth_compose(b, flow->dl_dst, flow->dl_src, ntohs(flow->dl_type), 0); + eth_compose(p, flow->dl_dst, flow->dl_src, ntohs(flow->dl_type), 0); if (flow->dl_type == htons(FLOW_DL_TYPE_NONE)) { - struct eth_header *eth = ofpbuf_l2(b); - eth->eth_type = htons(ofpbuf_size(b)); + struct eth_header *eth = dp_packet_l2(p); + eth->eth_type = htons(dp_packet_size(p)); return; } if (flow->vlan_tci & htons(VLAN_CFI)) { - eth_push_vlan(b, htons(ETH_TYPE_VLAN), flow->vlan_tci); + eth_push_vlan(p, htons(ETH_TYPE_VLAN), flow->vlan_tci); } if (flow->dl_type == htons(ETH_TYPE_IP)) { struct ip_header *ip; - ip = ofpbuf_put_zeros(b, sizeof *ip); + ip = dp_packet_put_zeros(p, sizeof *ip); ip->ip_ihl_ver = IP_IHL_VER(5, 4); ip->ip_tos = flow->nw_tos; ip->ip_ttl = flow->nw_ttl; @@ -1508,17 +1857,17 @@ } } - ofpbuf_set_l4(b, ofpbuf_tail(b)); + dp_packet_set_l4(p, dp_packet_tail(p)); - l4_len = flow_compose_l4(b, flow); + l4_len = flow_compose_l4(p, flow); - ip = ofpbuf_l3(b); - ip->ip_tot_len = htons(b->l4_ofs - b->l3_ofs + l4_len); + ip = dp_packet_l3(p); + ip->ip_tot_len = htons(p->l4_ofs - p->l3_ofs + l4_len); ip->ip_csum = csum(ip, sizeof *ip); } else if (flow->dl_type == htons(ETH_TYPE_IPV6)) { struct ovs_16aligned_ip6_hdr *nh; - nh = ofpbuf_put_zeros(b, sizeof *nh); + nh = dp_packet_put_zeros(p, sizeof *nh); put_16aligned_be32(&nh->ip6_flow, htonl(6 << 28) | htonl(flow->nw_tos << 20) | flow->ipv6_label); nh->ip6_hlim = flow->nw_ttl; @@ -1527,18 +1876,18 @@ memcpy(&nh->ip6_src, &flow->ipv6_src, sizeof(nh->ip6_src)); memcpy(&nh->ip6_dst, &flow->ipv6_dst, sizeof(nh->ip6_dst)); - ofpbuf_set_l4(b, ofpbuf_tail(b)); + dp_packet_set_l4(p, dp_packet_tail(p)); - l4_len = flow_compose_l4(b, flow); + l4_len = flow_compose_l4(p, flow); - nh = ofpbuf_l3(b); + nh = dp_packet_l3(p); nh->ip6_plen = htons(l4_len); } else if (flow->dl_type == htons(ETH_TYPE_ARP) || flow->dl_type == htons(ETH_TYPE_RARP)) { struct arp_eth_header *arp; - arp = ofpbuf_put_zeros(b, sizeof *arp); - ofpbuf_set_l3(b, arp); + arp = dp_packet_put_zeros(p, sizeof *arp); + dp_packet_set_l3(p, arp); arp->ar_hrd = htons(1); arp->ar_pro = htons(ETH_TYPE_IP); arp->ar_hln = ETH_ADDR_LEN; @@ -1557,14 +1906,14 @@ if (eth_type_mpls(flow->dl_type)) { int n; - b->l2_5_ofs = b->l3_ofs; + p->l2_5_ofs = p->l3_ofs; for (n = 1; n < FLOW_MAX_MPLS_LABELS; n++) { if (flow->mpls_lse[n - 1] & htonl(MPLS_BOS_MASK)) { break; } } while (n > 0) { - push_mpls(b, flow->dl_type, flow->mpls_lse[--n]); + push_mpls(p, flow->dl_type, flow->mpls_lse[--n]); } } } @@ -1577,7 +1926,7 @@ return count_1bits(flow->map); } -static uint32_t * +static uint64_t * miniflow_alloc_values(struct miniflow *flow, int n) { int size = MINIFLOW_VALUES_SIZE(n); @@ -1595,7 +1944,7 @@ /* Completes an initialization of 'dst' as a miniflow copy of 'src' begun by * the caller. The caller must have already initialized 'dst->map' properly - * to indicate the significant uint32_t elements of 'src'. 'n' must be the + * to indicate the significant uint64_t elements of 'src'. 'n' must be the * number of 1-bits in 'dst->map'. * * Normally the significant elements are the ones that are non-zero. However, @@ -1603,17 +1952,17 @@ * so that the flow and mask always have the same maps. * * This function initializes values (either inline if possible or with - * malloc() otherwise) and copies the uint32_t elements of 'src' indicated by + * malloc() otherwise) and copies the uint64_t elements of 'src' indicated by * 'dst->map' into it. */ static void miniflow_init__(struct miniflow *dst, const struct flow *src, int n) { - const uint32_t *src_u32 = (const uint32_t *) src; - uint32_t *dst_u32 = miniflow_alloc_values(dst, n); - uint64_t map; + const uint64_t *src_u64 = (const uint64_t *) src; + uint64_t *dst_u64 = miniflow_alloc_values(dst, n); + int idx; - for (map = dst->map; map; map = zero_rightmost_1bit(map)) { - *dst_u32++ = src_u32[raw_ctz(map)]; + MAP_FOR_EACH_INDEX(idx, dst->map) { + *dst_u64++ = src_u64[idx]; } } @@ -1623,7 +1972,7 @@ void miniflow_init(struct miniflow *dst, const struct flow *src) { - const uint32_t *src_u32 = (const uint32_t *) src; + const uint64_t *src_u64 = (const uint64_t *) src; unsigned int i; int n; @@ -1631,8 +1980,8 @@ n = 0; dst->map = 0; - for (i = 0; i < FLOW_U32S; i++) { - if (src_u32[i]) { + for (i = 0; i < FLOW_U64S; i++) { + if (src_u64[i]) { dst->map |= UINT64_C(1) << i; n++; } @@ -1657,7 +2006,7 @@ miniflow_clone(struct miniflow *dst, const struct miniflow *src) { int size = MINIFLOW_VALUES_SIZE(miniflow_n_values(src)); - uint32_t *values; + uint64_t *values; dst->map = src->map; if (size <= sizeof dst->inline_values) { @@ -1687,7 +2036,8 @@ /* Initializes 'dst' with the data in 'src', destroying 'src'. * The caller must eventually free 'dst' with miniflow_destroy(). * 'dst' must be regularly sized miniflow, but 'src' can have - * larger than default inline values. */ + * storage for more than the default MINI_N_INLINE inline + * values. */ void miniflow_move(struct miniflow *dst, struct miniflow *src) { @@ -1727,43 +2077,24 @@ flow_union_with_miniflow(dst, src); } -/* Returns the uint32_t that would be at byte offset '4 * u32_ofs' if 'flow' - * were expanded into a "struct flow". */ -static uint32_t -miniflow_get(const struct miniflow *flow, unsigned int u32_ofs) -{ - return (flow->map & UINT64_C(1) << u32_ofs) - ? *(miniflow_get_u32_values(flow) + - count_1bits(flow->map & ((UINT64_C(1) << u32_ofs) - 1))) - : 0; -} - -/* Returns true if 'a' and 'b' are the same flow, false otherwise. */ +/* Returns true if 'a' and 'b' are the equal miniflow, false otherwise. */ bool miniflow_equal(const struct miniflow *a, const struct miniflow *b) { - const uint32_t *ap = miniflow_get_u32_values(a); - const uint32_t *bp = miniflow_get_u32_values(b); - const uint64_t a_map = a->map; - const uint64_t b_map = b->map; + const uint64_t *ap = miniflow_get_values(a); + const uint64_t *bp = miniflow_get_values(b); - if (OVS_LIKELY(a_map == b_map)) { + if (OVS_LIKELY(a->map == b->map)) { int count = miniflow_n_values(a); - while (count--) { - if (*ap++ != *bp++) { - return false; - } - } + return !memcmp(ap, bp, count * sizeof *ap); } else { uint64_t map; - for (map = a_map | b_map; map; map = zero_rightmost_1bit(map)) { + for (map = a->map | b->map; map; map = zero_rightmost_1bit(map)) { uint64_t bit = rightmost_1bit(map); - uint64_t a_value = a_map & bit ? *ap++ : 0; - uint64_t b_value = b_map & bit ? *bp++ : 0; - if (a_value != b_value) { + if ((a->map & bit ? *ap++ : 0) != (b->map & bit ? *bp++ : 0)) { return false; } } @@ -1772,19 +2103,17 @@ return true; } -/* Returns true if 'a' and 'b' are equal at the places where there are 1-bits - * in 'mask', false if they differ. */ +/* Returns false if 'a' and 'b' differ at the places where there are 1-bits + * in 'mask', true otherwise. */ bool miniflow_equal_in_minimask(const struct miniflow *a, const struct miniflow *b, const struct minimask *mask) { - const uint32_t *p = miniflow_get_u32_values(&mask->masks); - uint64_t map; - - for (map = mask->masks.map; map; map = zero_rightmost_1bit(map)) { - int ofs = raw_ctz(map); + const uint64_t *p = miniflow_get_values(&mask->masks); + int idx; - if ((miniflow_get(a, ofs) ^ miniflow_get(b, ofs)) & *p++) { + MAP_FOR_EACH_INDEX(idx, mask->masks.map) { + if ((miniflow_get(a, idx) ^ miniflow_get(b, idx)) & *p++) { return false; } } @@ -1798,14 +2127,12 @@ miniflow_equal_flow_in_minimask(const struct miniflow *a, const struct flow *b, const struct minimask *mask) { - const uint32_t *b_u32 = (const uint32_t *) b; - const uint32_t *p = miniflow_get_u32_values(&mask->masks); - uint64_t map; - - for (map = mask->masks.map; map; map = zero_rightmost_1bit(map)) { - int ofs = raw_ctz(map); + const uint64_t *b_u64 = (const uint64_t *) b; + const uint64_t *p = miniflow_get_values(&mask->masks); + int idx; - if ((miniflow_get(a, ofs) ^ b_u32[ofs]) & *p++) { + MAP_FOR_EACH_INDEX(idx, mask->masks.map) { + if ((miniflow_get(a, idx) ^ b_u64[idx]) & *p++) { return false; } } @@ -1840,31 +2167,30 @@ /* Initializes 'dst_' as the bit-wise "and" of 'a_' and 'b_'. * - * The caller must provide room for FLOW_U32S "uint32_t"s in 'storage', for use + * The caller must provide room for FLOW_U64S "uint64_t"s in 'storage', for use * by 'dst_'. The caller must *not* free 'dst_' with minimask_destroy(). */ void minimask_combine(struct minimask *dst_, const struct minimask *a_, const struct minimask *b_, - uint32_t storage[FLOW_U32S]) + uint64_t storage[FLOW_U64S]) { struct miniflow *dst = &dst_->masks; - uint32_t *dst_values = storage; + uint64_t *dst_values = storage; const struct miniflow *a = &a_->masks; const struct miniflow *b = &b_->masks; - uint64_t map; - int n = 0; + int idx; dst->values_inline = false; dst->offline_values = storage; dst->map = 0; - for (map = a->map & b->map; map; map = zero_rightmost_1bit(map)) { - int ofs = raw_ctz(map); - uint32_t mask = miniflow_get(a, ofs) & miniflow_get(b, ofs); + MAP_FOR_EACH_INDEX(idx, a->map & b->map) { + /* Both 'a' and 'b' have non-zero data at 'idx'. */ + uint64_t mask = miniflow_get__(a, idx) & miniflow_get__(b, idx); if (mask) { - dst->map |= rightmost_1bit(map); - dst_values[n++] = mask; + dst->map |= UINT64_C(1) << idx; + *dst_values++ = mask; } } } @@ -1884,19 +2210,16 @@ miniflow_expand(&mask->masks, &wc->masks); } -/* Returns the uint32_t that would be at byte offset '4 * u32_ofs' if 'mask' - * were expanded into a "struct flow_wildcards". */ -uint32_t -minimask_get(const struct minimask *mask, unsigned int u32_ofs) -{ - return miniflow_get(&mask->masks, u32_ofs); -} - -/* Returns true if 'a' and 'b' are the same flow mask, false otherwise. */ +/* Returns true if 'a' and 'b' are the same flow mask, false otherwise. + * Minimasks may not have zero data values, so for the minimasks to be the + * same, they need to have the same map and the same data values. */ bool minimask_equal(const struct minimask *a, const struct minimask *b) { - return miniflow_equal(&a->masks, &b->masks); + return a->masks.map == b->masks.map && + !memcmp(miniflow_get_values(&a->masks), + miniflow_get_values(&b->masks), + count_1bits(a->masks.map) * sizeof *a->masks.inline_values); } /* Returns true if at least one bit matched by 'b' is wildcarded by 'a', @@ -1904,15 +2227,19 @@ bool minimask_has_extra(const struct minimask *a, const struct minimask *b) { - const uint32_t *p = miniflow_get_u32_values(&b->masks); - uint64_t map; - - for (map = b->masks.map; map; map = zero_rightmost_1bit(map)) { - uint32_t a_u32 = minimask_get(a, raw_ctz(map)); - uint32_t b_u32 = *p++; - - if ((a_u32 & b_u32) != b_u32) { - return true; + const uint64_t *ap = miniflow_get_values(&a->masks); + const uint64_t *bp = miniflow_get_values(&b->masks); + int idx; + + MAP_FOR_EACH_INDEX(idx, b->masks.map) { + uint64_t b_u64 = *bp++; + + /* 'b_u64' is non-zero, check if the data in 'a' is either zero + * or misses some of the bits in 'b_u64'. */ + if (!(a->masks.map & (UINT64_C(1) << idx)) + || ((miniflow_values_get__(ap, a->masks.map, idx) & b_u64) + != b_u64)) { + return true; /* 'a' wildcards some bits 'b' doesn't. */ } } diff -Nru openvswitch-2.3.1/lib/flow.h openvswitch-2.4.0~git20150623/lib/flow.h --- openvswitch-2.3.1/lib/flow.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/flow.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,16 +32,25 @@ struct ds; struct flow_wildcards; struct minimask; -struct ofpbuf; +struct dp_packet; struct pkt_metadata; +struct match; /* This sequence number should be incremented whenever anything involving flows * or the wildcarding of flows changes. This will cause build assertion * failures in places which likely need to be updated. */ -#define FLOW_WC_SEQ 26 +#define FLOW_WC_SEQ 31 +/* Number of Open vSwitch extension 32-bit registers. */ #define FLOW_N_REGS 8 BUILD_ASSERT_DECL(FLOW_N_REGS <= NXM_NX_MAX_REGS); +BUILD_ASSERT_DECL(FLOW_N_REGS % 2 == 0); /* Even. */ + +/* Number of OpenFlow 1.5+ 64-bit registers. + * + * Each of these overlays a pair of Open vSwitch 32-bit registers, so there + * are half as many of them.*/ +#define FLOW_N_XREGS (FLOW_N_REGS / 2) /* Used for struct flow's dl_type member for frames that have no Ethernet * type, that is, pure 802.2 frames. */ @@ -58,6 +67,9 @@ #define FLOW_TNL_F_DONT_FRAGMENT (1 << 0) #define FLOW_TNL_F_CSUM (1 << 1) #define FLOW_TNL_F_KEY (1 << 2) +#define FLOW_TNL_F_OAM (1 << 3) + +#define FLOW_TNL_F_MASK ((1 << 4) - 1) const char *flow_tun_flag_to_string(uint32_t flags); @@ -73,8 +85,8 @@ * * The meaning of 'in_port' is context-dependent. In most cases, it is a * 16-bit OpenFlow 1.0 port number. In the software datapath interface (dpif) - * layer and its implementations (e.g. dpif-linux, dpif-netdev), it is instead - * a 32-bit datapath port number. + * layer and its implementations (e.g. dpif-netlink, dpif-netdev), it is + * instead a 32-bit datapath port number. * * The fields are organized in four segments to facilitate staged lookup, where * lower layer fields are first used to determine if the later fields need to @@ -84,94 +96,95 @@ * reflected in miniflow_extract()! */ struct flow { - /* L1 */ + /* Metadata */ struct flow_tnl tunnel; /* Encapsulating tunnel parameters. */ ovs_be64 metadata; /* OpenFlow Metadata. */ uint32_t regs[FLOW_N_REGS]; /* Registers. */ uint32_t skb_priority; /* Packet priority for QoS. */ uint32_t pkt_mark; /* Packet mark. */ - uint32_t recirc_id; /* Must be exact match. */ + uint32_t dp_hash; /* Datapath computed hash value. The exact + * computation is opaque to the user space. */ union flow_in_port in_port; /* Input port.*/ - - /* L2, Order the same as in the Ethernet header! */ - uint8_t dl_dst[6]; /* Ethernet destination address. */ - uint8_t dl_src[6]; /* Ethernet source address. */ + uint32_t recirc_id; /* Must be exact match. */ + uint32_t conj_id; /* Conjunction ID. */ + ofp_port_t actset_output; /* Output port in action set. */ + uint8_t pad1[6]; /* Pad to 64 bits. */ + + /* L2, Order the same as in the Ethernet header! (64-bit aligned) */ + uint8_t dl_dst[ETH_ADDR_LEN]; /* Ethernet destination address. */ + uint8_t dl_src[ETH_ADDR_LEN]; /* Ethernet source address. */ ovs_be16 dl_type; /* Ethernet frame type. */ ovs_be16 vlan_tci; /* If 802.1Q, TCI | VLAN_CFI; otherwise 0. */ - ovs_be32 mpls_lse[FLOW_MAX_MPLS_LABELS]; /* MPLS label stack entry. */ - - /* L3 */ + ovs_be32 mpls_lse[ROUND_UP(FLOW_MAX_MPLS_LABELS, 2)]; /* MPLS label stack + (with padding). */ + /* L3 (64-bit aligned) */ + ovs_be32 nw_src; /* IPv4 source address. */ + ovs_be32 nw_dst; /* IPv4 destination address. */ struct in6_addr ipv6_src; /* IPv6 source address. */ struct in6_addr ipv6_dst; /* IPv6 destination address. */ ovs_be32 ipv6_label; /* IPv6 flow label. */ - ovs_be32 nw_src; /* IPv4 source address. */ - ovs_be32 nw_dst; /* IPv4 destination address. */ uint8_t nw_frag; /* FLOW_FRAG_* flags. */ uint8_t nw_tos; /* IP ToS (including DSCP and ECN). */ uint8_t nw_ttl; /* IP TTL/Hop Limit. */ uint8_t nw_proto; /* IP protocol or low 8 bits of ARP opcode. */ - uint8_t arp_sha[6]; /* ARP/ND source hardware address. */ - uint8_t arp_tha[6]; /* ARP/ND target hardware address. */ struct in6_addr nd_target; /* IPv6 neighbor discovery (ND) target. */ + uint8_t arp_sha[ETH_ADDR_LEN]; /* ARP/ND source hardware address. */ + uint8_t arp_tha[ETH_ADDR_LEN]; /* ARP/ND target hardware address. */ ovs_be16 tcp_flags; /* TCP flags. With L3 to avoid matching L4. */ - ovs_be16 pad; /* Padding. */ + ovs_be16 pad2; /* Pad to 64 bits. */ - /* L4 */ + /* L4 (64-bit aligned) */ ovs_be16 tp_src; /* TCP/UDP/SCTP source port. */ - ovs_be16 tp_dst; /* TCP/UDP/SCTP destination port. - * Keep last for the BUILD_ASSERT_DECL below */ - uint32_t dp_hash; /* Datapath computed hash value. The exact - computation is opaque to the user space.*/ + ovs_be16 tp_dst; /* TCP/UDP/SCTP destination port. */ + ovs_be32 igmp_group_ip4; /* IGMP group IPv4 address. + * Keep last for BUILD_ASSERT_DECL below. */ }; -BUILD_ASSERT_DECL(sizeof(struct flow) % 4 == 0); +BUILD_ASSERT_DECL(sizeof(struct flow) % sizeof(uint64_t) == 0); -#define FLOW_U32S (sizeof(struct flow) / 4) +#define FLOW_U64S (sizeof(struct flow) / sizeof(uint64_t)) + +/* Some flow fields are mutually exclusive or only appear within the flow + * pipeline. IPv6 headers are bigger than IPv4 and MPLS, and IPv6 ND packets + * are bigger than TCP,UDP and IGMP packets. */ +#define FLOW_MAX_PACKET_U64S (FLOW_U64S \ + /* Unused in datapath */ - FLOW_U64_SIZE(regs) \ + - FLOW_U64_SIZE(metadata) \ + /* L2.5/3 */ - FLOW_U64_SIZE(nw_src) /* incl. nw_dst */ \ + - FLOW_U64_SIZE(mpls_lse) \ + /* L4 */ - FLOW_U64_SIZE(tp_src) \ + ) /* Remember to update FLOW_WC_SEQ when changing 'struct flow'. */ -BUILD_ASSERT_DECL(offsetof(struct flow, dp_hash) + sizeof(uint32_t) - == sizeof(struct flow_tnl) + 172 - && FLOW_WC_SEQ == 26); +BUILD_ASSERT_DECL(offsetof(struct flow, igmp_group_ip4) + sizeof(uint32_t) + == sizeof(struct flow_tnl) + 192 + && FLOW_WC_SEQ == 31); /* Incremental points at which flow classification may be performed in * segments. * This is located here since this is dependent on the structure of the * struct flow defined above: - * Each offset must be on a distinct, successive U32 boundary strictly + * Each offset must be on a distinct, successive U64 boundary strictly * within the struct flow. */ enum { FLOW_SEGMENT_1_ENDS_AT = offsetof(struct flow, dl_dst), - FLOW_SEGMENT_2_ENDS_AT = offsetof(struct flow, ipv6_src), + FLOW_SEGMENT_2_ENDS_AT = offsetof(struct flow, nw_src), FLOW_SEGMENT_3_ENDS_AT = offsetof(struct flow, tp_src), }; -BUILD_ASSERT_DECL(FLOW_SEGMENT_1_ENDS_AT % 4 == 0); -BUILD_ASSERT_DECL(FLOW_SEGMENT_2_ENDS_AT % 4 == 0); -BUILD_ASSERT_DECL(FLOW_SEGMENT_3_ENDS_AT % 4 == 0); +BUILD_ASSERT_DECL(FLOW_SEGMENT_1_ENDS_AT % sizeof(uint64_t) == 0); +BUILD_ASSERT_DECL(FLOW_SEGMENT_2_ENDS_AT % sizeof(uint64_t) == 0); +BUILD_ASSERT_DECL(FLOW_SEGMENT_3_ENDS_AT % sizeof(uint64_t) == 0); BUILD_ASSERT_DECL( 0 < FLOW_SEGMENT_1_ENDS_AT); BUILD_ASSERT_DECL(FLOW_SEGMENT_1_ENDS_AT < FLOW_SEGMENT_2_ENDS_AT); BUILD_ASSERT_DECL(FLOW_SEGMENT_2_ENDS_AT < FLOW_SEGMENT_3_ENDS_AT); BUILD_ASSERT_DECL(FLOW_SEGMENT_3_ENDS_AT < sizeof(struct flow)); -extern const uint8_t flow_segment_u32s[]; - -/* Represents the metadata fields of struct flow. */ -struct flow_metadata { - uint32_t dp_hash; /* Datapath computed hash field. */ - uint32_t recirc_id; /* Recirculation ID. */ - ovs_be64 tun_id; /* Encapsulating tunnel ID. */ - ovs_be32 tun_src; /* Tunnel outer IPv4 src addr */ - ovs_be32 tun_dst; /* Tunnel outer IPv4 dst addr */ - ovs_be64 metadata; /* OpenFlow 1.1+ metadata field. */ - uint32_t regs[FLOW_N_REGS]; /* Registers. */ - uint32_t pkt_mark; /* Packet mark. */ - ofp_port_t in_port; /* OpenFlow port or zero. */ -}; +extern const uint8_t flow_segment_u64s[]; -void flow_extract(struct ofpbuf *, const struct pkt_metadata *md, - struct flow *); +void flow_extract(struct dp_packet *, struct flow *); void flow_zero_wildcards(struct flow *, const struct flow_wildcards *); void flow_unwildcard_tp_ports(const struct flow *, struct flow_wildcards *); -void flow_get_metadata(const struct flow *, struct flow_metadata *); +void flow_get_metadata(const struct flow *, struct match *flow_metadata); char *flow_to_string(const struct flow *); void format_flags(struct ds *ds, const char *(*bit_to_string)(uint32_t), @@ -204,7 +217,20 @@ void flow_set_mpls_bos(struct flow *, int idx, uint8_t stack); void flow_set_mpls_lse(struct flow *, int idx, ovs_be32 lse); -void flow_compose(struct ofpbuf *, const struct flow *); +void flow_compose(struct dp_packet *, const struct flow *); + +static inline uint64_t +flow_get_xreg(const struct flow *flow, int idx) +{ + return ((uint64_t) flow->regs[idx * 2] << 32) | flow->regs[idx * 2 + 1]; +} + +static inline void +flow_set_xreg(struct flow *flow, int idx, uint64_t value) +{ + flow->regs[idx * 2] = value >> 32; + flow->regs[idx * 2 + 1] = value; +} static inline int flow_compare_3way(const struct flow *a, const struct flow *b) @@ -221,7 +247,8 @@ static inline size_t flow_hash(const struct flow *flow, uint32_t basis) { - return hash_words((const uint32_t *) flow, sizeof *flow / 4, basis); + return hash_words64((const uint64_t *)flow, + sizeof *flow / sizeof(uint64_t), basis); } static inline uint16_t @@ -281,14 +308,25 @@ struct flow masks; }; +#define WC_MASK_FIELD(WC, FIELD) \ + memset(&(WC)->masks.FIELD, 0xff, sizeof (WC)->masks.FIELD) +#define WC_UNMASK_FIELD(WC, FIELD) \ + memset(&(WC)->masks.FIELD, 0, sizeof (WC)->masks.FIELD) + void flow_wildcards_init_catchall(struct flow_wildcards *); +void flow_wildcards_init_for_packet(struct flow_wildcards *, + const struct flow *); +uint64_t flow_wc_map(const struct flow *); + void flow_wildcards_clear_non_packet_fields(struct flow_wildcards *); bool flow_wildcards_is_catchall(const struct flow_wildcards *); void flow_wildcards_set_reg_mask(struct flow_wildcards *, int idx, uint32_t mask); +void flow_wildcards_set_xreg_mask(struct flow_wildcards *, + int idx, uint64_t mask); void flow_wildcards_and(struct flow_wildcards *dst, const struct flow_wildcards *src1, @@ -322,8 +360,11 @@ /* Compressed flow. */ -#define MINI_N_INLINE (sizeof(void *) == 4 ? 7 : 8) -BUILD_ASSERT_DECL(FLOW_U32S <= 63); +/* Number of 64-bit words present in struct miniflow. */ +#define MINI_N_INLINE 4 + +/* Maximum number of 64-bit words supported. */ +BUILD_ASSERT_DECL(FLOW_U64S <= 63); /* A sparse representation of a "struct flow". * @@ -332,8 +373,8 @@ * saves time when the goal is to iterate over only the nonzero parts of the * struct. * - * The 'map' member holds one bit for each uint32_t in a "struct flow". Each - * 0-bit indicates that the corresponding uint32_t is zero, each 1-bit that it + * The 'map' member holds one bit for each uint64_t in a "struct flow". Each + * 0-bit indicates that the corresponding uint64_t is zero, each 1-bit that it * *may* be nonzero (see below how this applies to minimasks). * * The 'values_inline' boolean member indicates that the values are at @@ -343,6 +384,11 @@ * the first element of the values array, the next 1-bit is in the next array * element, and so on. * + * MINI_N_INLINE is the default number of inline words. When a miniflow is + * dynamically allocated the actual amount of inline storage may be different. + * In that case 'inline_values' contains storage at least for the number + * of words indicated by 'map' (one uint64_t for each 1-bit in the map). + * * Elements in values array are allowed to be zero. This is useful for "struct * minimatch", for which ensuring that the miniflow and minimask members have * same 'map' allows optimization. This allowance applies only to a miniflow @@ -353,41 +399,33 @@ uint64_t map:63; uint64_t values_inline:1; union { - uint32_t *offline_values; - uint32_t inline_values[MINI_N_INLINE]; + uint64_t *offline_values; + uint64_t inline_values[MINI_N_INLINE]; /* Minimum inline size. */ }; }; +BUILD_ASSERT_DECL(sizeof(struct miniflow) + == sizeof(uint64_t) + MINI_N_INLINE * sizeof(uint64_t)); -#define MINIFLOW_VALUES_SIZE(COUNT) ((COUNT) * sizeof(uint32_t)) +#define MINIFLOW_VALUES_SIZE(COUNT) ((COUNT) * sizeof(uint64_t)) -static inline uint32_t *miniflow_values(struct miniflow *mf) +static inline uint64_t *miniflow_values(struct miniflow *mf) { return OVS_LIKELY(mf->values_inline) ? mf->inline_values : mf->offline_values; } -static inline const uint32_t *miniflow_get_values(const struct miniflow *mf) +static inline const uint64_t *miniflow_get_values(const struct miniflow *mf) { return OVS_LIKELY(mf->values_inline) ? mf->inline_values : mf->offline_values; } -static inline const uint32_t *miniflow_get_u32_values(const struct miniflow *mf) -{ - return miniflow_get_values(mf); -} - -static inline const ovs_be32 *miniflow_get_be32_values(const struct miniflow *mf) -{ - return (OVS_FORCE const ovs_be32 *)miniflow_get_values(mf); -} - /* This is useful for initializing a miniflow for a miniflow_extract() call. */ static inline void miniflow_initialize(struct miniflow *mf, - uint32_t buf[FLOW_U32S]) + uint64_t buf[FLOW_U64S]) { mf->map = 0; - mf->values_inline = (buf == (uint32_t *)(mf + 1)); + mf->values_inline = (buf == (uint64_t *)(mf + 1)); if (!mf->values_inline) { mf->offline_values = buf; } @@ -396,10 +434,9 @@ struct pkt_metadata; /* The 'dst->values' must be initialized with a buffer with space for - * FLOW_U32S. 'dst->map' is ignored on input and set on output to + * FLOW_U64S. 'dst->map' is ignored on input and set on output to * indicate which fields were extracted. */ -void miniflow_extract(struct ofpbuf *packet, const struct pkt_metadata *, - struct miniflow *dst); +void miniflow_extract(struct dp_packet *packet, struct miniflow *dst); void miniflow_init(struct miniflow *, const struct flow *); void miniflow_init_with_minimask(struct miniflow *, const struct flow *, const struct minimask *); @@ -411,78 +448,132 @@ void miniflow_expand(const struct miniflow *, struct flow *); -static inline uint32_t -flow_get_next_in_map(const struct flow *flow, uint64_t map, uint32_t *value) +static inline uint64_t flow_u64_value(const struct flow *flow, size_t index) +{ + return ((uint64_t *)(flow))[index]; +} + +static inline uint64_t *flow_u64_lvalue(struct flow *flow, size_t index) +{ + return &((uint64_t *)(flow))[index]; +} + +static inline bool +flow_get_next_in_map(const struct flow *flow, uint64_t map, uint64_t *value) { if (map) { - *value = ((const uint32_t *)flow)[raw_ctz(map)]; + *value = flow_u64_value(flow, raw_ctz(map)); return true; } return false; } -/* Iterate through all flow u32 values specified by 'MAP'. - * This works as the first statement in a block.*/ -#define FLOW_FOR_EACH_IN_MAP(VALUE, FLOW, MAP) \ - uint64_t map_; \ - for (map_ = (MAP); \ - flow_get_next_in_map(FLOW, map_, &(VALUE)); \ - map_ = zero_rightmost_1bit(map_)) +/* Iterate through all flow u64 values specified by 'MAP'. */ +#define FLOW_FOR_EACH_IN_MAP(VALUE, FLOW, MAP) \ + for (uint64_t map__ = (MAP); \ + flow_get_next_in_map(FLOW, map__, &(VALUE)); \ + map__ = zero_rightmost_1bit(map__)) + +/* Iterate through all struct flow u64 indices specified by 'MAP'. */ +#define MAP_FOR_EACH_INDEX(U64IDX, MAP) \ + for (uint64_t map__ = (MAP); \ + map__ && ((U64IDX) = raw_ctz(map__), true); \ + map__ = zero_rightmost_1bit(map__)) -#define FLOW_U32_SIZE(FIELD) \ - DIV_ROUND_UP(sizeof(((struct flow *)0)->FIELD), sizeof(uint32_t)) +#define FLOW_U64_SIZE(FIELD) \ + DIV_ROUND_UP(sizeof(((struct flow *)0)->FIELD), sizeof(uint64_t)) #define MINIFLOW_MAP(FIELD) \ - (((UINT64_C(1) << FLOW_U32_SIZE(FIELD)) - 1) \ - << (offsetof(struct flow, FIELD) / 4)) + (((UINT64_C(1) << FLOW_U64_SIZE(FIELD)) - 1) \ + << (offsetof(struct flow, FIELD) / sizeof(uint64_t))) -static inline uint32_t -mf_get_next_in_map(uint64_t *fmap, uint64_t rm1bit, const uint32_t **fp, - uint32_t *value) +struct mf_for_each_in_map_aux { + const uint64_t *values; + uint64_t fmap; + uint64_t map; +}; + +static inline bool +mf_get_next_in_map(struct mf_for_each_in_map_aux *aux, uint64_t *value) { - *value = 0; - if (*fmap & rm1bit) { - uint64_t trash = *fmap & (rm1bit - 1); - - if (trash) { - *fmap -= trash; - *fp += count_1bits(trash); + if (aux->map) { + uint64_t rm1bit = rightmost_1bit(aux->map); + aux->map -= rm1bit; + + if (aux->fmap & rm1bit) { + /* Advance 'aux->values' to point to the value for 'rm1bit'. */ + uint64_t trash = aux->fmap & (rm1bit - 1); + if (trash) { + aux->fmap -= trash; + aux->values += count_1bits(trash); + } + + /* Retrieve the value for 'rm1bit' then advance past it. */ + aux->fmap -= rm1bit; + *value = *aux->values++; + } else { + *value = 0; } - *value = **fp; + return true; + } else { + return false; } - return rm1bit != 0; } -/* Iterate through all miniflow u32 values specified by 'MAP'. - * This works as the first statement in a block.*/ +/* Iterate through all miniflow u64 values specified by 'MAP'. */ #define MINIFLOW_FOR_EACH_IN_MAP(VALUE, FLOW, MAP) \ - const uint32_t *fp_ = miniflow_get_u32_values(FLOW); \ - uint64_t rm1bit_, fmap_, map_; \ - for (fmap_ = (FLOW)->map, map_ = (MAP), rm1bit_ = rightmost_1bit(map_); \ - mf_get_next_in_map(&fmap_, rm1bit_, &fp_, &(VALUE)); \ - map_ -= rm1bit_, rm1bit_ = rightmost_1bit(map_)) + for (struct mf_for_each_in_map_aux aux__ \ + = { miniflow_get_values(FLOW), (FLOW)->map, MAP }; \ + mf_get_next_in_map(&aux__, &(VALUE)); \ + ) -/* Get the value of 'FIELD' of an up to 4 byte wide integer type 'TYPE' of +/* This can be used when it is known that 'u64_idx' is set in 'map'. */ +static inline uint64_t +miniflow_values_get__(const uint64_t *values, uint64_t map, int u64_idx) +{ + return values[count_1bits(map & ((UINT64_C(1) << u64_idx) - 1))]; +} + +/* This can be used when it is known that 'u64_idx' is set in + * the map of 'mf'. */ +static inline uint64_t +miniflow_get__(const struct miniflow *mf, int u64_idx) +{ + return miniflow_values_get__(miniflow_get_values(mf), mf->map, u64_idx); +} + +/* Get the value of 'FIELD' of an up to 8 byte wide integer type 'TYPE' of * a miniflow. */ #define MINIFLOW_GET_TYPE(MF, TYPE, OFS) \ - (((MF)->map & (UINT64_C(1) << (OFS) / 4)) \ + (((MF)->map & (UINT64_C(1) << (OFS) / sizeof(uint64_t))) \ ? ((OVS_FORCE const TYPE *) \ - (miniflow_get_u32_values(MF) \ - + count_1bits((MF)->map & ((UINT64_C(1) << (OFS) / 4) - 1)))) \ - [(OFS) % 4 / sizeof(TYPE)] \ + (miniflow_get_values(MF) \ + + count_1bits((MF)->map & \ + ((UINT64_C(1) << (OFS) / sizeof(uint64_t)) - 1)))) \ + [(OFS) % sizeof(uint64_t) / sizeof(TYPE)] \ : 0) \ -#define MINIFLOW_GET_U8(FLOW, FIELD) \ +#define MINIFLOW_GET_U8(FLOW, FIELD) \ MINIFLOW_GET_TYPE(FLOW, uint8_t, offsetof(struct flow, FIELD)) -#define MINIFLOW_GET_U16(FLOW, FIELD) \ +#define MINIFLOW_GET_U16(FLOW, FIELD) \ MINIFLOW_GET_TYPE(FLOW, uint16_t, offsetof(struct flow, FIELD)) -#define MINIFLOW_GET_BE16(FLOW, FIELD) \ +#define MINIFLOW_GET_BE16(FLOW, FIELD) \ MINIFLOW_GET_TYPE(FLOW, ovs_be16, offsetof(struct flow, FIELD)) -#define MINIFLOW_GET_U32(FLOW, FIELD) \ +#define MINIFLOW_GET_U32(FLOW, FIELD) \ MINIFLOW_GET_TYPE(FLOW, uint32_t, offsetof(struct flow, FIELD)) -#define MINIFLOW_GET_BE32(FLOW, FIELD) \ +#define MINIFLOW_GET_BE32(FLOW, FIELD) \ MINIFLOW_GET_TYPE(FLOW, ovs_be32, offsetof(struct flow, FIELD)) - +#define MINIFLOW_GET_U64(FLOW, FIELD) \ + MINIFLOW_GET_TYPE(FLOW, uint64_t, offsetof(struct flow, FIELD)) +#define MINIFLOW_GET_BE64(FLOW, FIELD) \ + MINIFLOW_GET_TYPE(FLOW, ovs_be64, offsetof(struct flow, FIELD)) + +static inline uint64_t miniflow_get(const struct miniflow *, + unsigned int u64_ofs); +static inline uint32_t miniflow_get_u32(const struct miniflow *, + unsigned int u32_ofs); +static inline ovs_be32 miniflow_get_be32(const struct miniflow *, + unsigned int be32_ofs); static inline uint16_t miniflow_get_vid(const struct miniflow *); static inline uint16_t miniflow_get_tcp_flags(const struct miniflow *); static inline ovs_be64 miniflow_get_metadata(const struct miniflow *); @@ -514,12 +605,15 @@ void minimask_move(struct minimask *dst, struct minimask *src); void minimask_combine(struct minimask *dst, const struct minimask *a, const struct minimask *b, - uint32_t storage[FLOW_U32S]); + uint64_t storage[FLOW_U64S]); void minimask_destroy(struct minimask *); void minimask_expand(const struct minimask *, struct flow_wildcards *); -uint32_t minimask_get(const struct minimask *, unsigned int u32_ofs); +static inline uint32_t minimask_get_u32(const struct minimask *, + unsigned int u32_ofs); +static inline ovs_be32 minimask_get_be32(const struct minimask *, + unsigned int be32_ofs); static inline uint16_t minimask_get_vid_mask(const struct minimask *); static inline ovs_be64 minimask_get_metadata_mask(const struct minimask *); @@ -538,6 +632,33 @@ return mask->masks.map == 0; } +/* Returns the uint64_t that would be at byte offset '8 * u64_ofs' if 'flow' + * were expanded into a "struct flow". */ +static inline uint64_t miniflow_get(const struct miniflow *flow, + unsigned int u64_ofs) +{ + return flow->map & (UINT64_C(1) << u64_ofs) + ? miniflow_get__(flow, u64_ofs) : 0; +} + +static inline uint32_t miniflow_get_u32(const struct miniflow *flow, + unsigned int u32_ofs) +{ + uint64_t value = miniflow_get(flow, u32_ofs / 2); + +#if WORDS_BIGENDIAN + return (u32_ofs & 1) ? value : value >> 32; +#else + return (u32_ofs & 1) ? value >> 32 : value; +#endif +} + +static inline ovs_be32 miniflow_get_be32(const struct miniflow *flow, + unsigned int be32_ofs) +{ + return (OVS_FORCE ovs_be32)miniflow_get_u32(flow, be32_ofs); +} + /* Returns the VID within the vlan_tci member of the "struct flow" represented * by 'flow'. */ static inline uint16_t @@ -547,6 +668,20 @@ return vlan_tci_to_vid(tci); } +/* Returns the uint32_t that would be at byte offset '4 * u32_ofs' if 'mask' + * were expanded into a "struct flow_wildcards". */ +static inline uint32_t +minimask_get_u32(const struct minimask *mask, unsigned int u32_ofs) +{ + return miniflow_get_u32(&mask->masks, u32_ofs); +} + +static inline ovs_be32 +minimask_get_be32(const struct minimask *mask, unsigned int be32_ofs) +{ + return (OVS_FORCE ovs_be32)minimask_get_u32(mask, be32_ofs); +} + /* Returns the VID mask within the vlan_tci member of the "struct * flow_wildcards" represented by 'mask'. */ static inline uint16_t @@ -566,20 +701,7 @@ static inline ovs_be64 miniflow_get_metadata(const struct miniflow *flow) { - union { - ovs_be64 be64; - struct { - ovs_be32 hi; - ovs_be32 lo; - }; - } value; - - enum { MD_OFS = offsetof(struct flow, metadata) }; - BUILD_ASSERT_DECL(MD_OFS % sizeof(uint32_t) == 0); - value.hi = MINIFLOW_GET_TYPE(flow, ovs_be32, MD_OFS); - value.lo = MINIFLOW_GET_TYPE(flow, ovs_be32, MD_OFS + 4); - - return value.be64; + return MINIFLOW_GET_BE64(flow, metadata); } /* Returns the mask for the OpenFlow 1.1+ "metadata" field in 'mask'. @@ -591,7 +713,7 @@ static inline ovs_be64 minimask_get_metadata_mask(const struct minimask *mask) { - return miniflow_get_metadata(&mask->masks); + return MINIFLOW_GET_BE64(&mask->masks, metadata); } /* Perform a bitwise OR of miniflow 'src' flow data with the equivalent @@ -599,28 +721,24 @@ static inline void flow_union_with_miniflow(struct flow *dst, const struct miniflow *src) { - uint32_t *dst_u32 = (uint32_t *) dst; - const uint32_t *p = miniflow_get_u32_values(src); - uint64_t map; + uint64_t *dst_u64 = (uint64_t *) dst; + const uint64_t *p = miniflow_get_values(src); + int idx; - for (map = src->map; map; map = zero_rightmost_1bit(map)) { - dst_u32[raw_ctz(map)] |= *p++; + MAP_FOR_EACH_INDEX(idx, src->map) { + dst_u64[idx] |= *p++; } } -static inline struct pkt_metadata -pkt_metadata_from_flow(const struct flow *flow) +static inline void +pkt_metadata_from_flow(struct pkt_metadata *md, const struct flow *flow) { - struct pkt_metadata md; - - md.recirc_id = flow->recirc_id; - md.dp_hash = flow->dp_hash; - md.tunnel = flow->tunnel; - md.skb_priority = flow->skb_priority; - md.pkt_mark = flow->pkt_mark; - md.in_port = flow->in_port; - - return md; + md->recirc_id = flow->recirc_id; + md->dp_hash = flow->dp_hash; + md->tunnel = flow->tunnel; + md->skb_priority = flow->skb_priority; + md->pkt_mark = flow->pkt_mark; + md->in_port = flow->in_port; } static inline bool is_ip_any(const struct flow *flow) diff -Nru openvswitch-2.3.1/lib/getopt_long.c openvswitch-2.4.0~git20150623/lib/getopt_long.c --- openvswitch-2.3.1/lib/getopt_long.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/getopt_long.c 2015-06-23 18:46:21.000000000 +0000 @@ -33,7 +33,7 @@ #include #include #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(getopt_long); @@ -59,7 +59,6 @@ #define EMSG "" -#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) #define _DIAGASSERT(q) ovs_assert(q) #define warnx VLOG_WARN @@ -258,7 +257,7 @@ } else { /* takes (optional) argument */ optarg = NULL; if (*place) /* no white space */ - optarg = __UNCONST(place); + optarg = CONST_CAST(char *, place); /* XXX: disable test for :: if PC? (GNU doesn't) */ else if (oli[1] != ':') { /* arg not optional */ if (++optind >= nargc) { /* no arg */ @@ -295,7 +294,7 @@ _DIAGASSERT(nargv != NULL); _DIAGASSERT(options != NULL); - retval = getopt_internal(nargc, __UNCONST(nargv), options); + retval = getopt_internal(nargc, CONST_CAST(char **, nargv), options); if (retval == -2) { ++optind; /* @@ -334,13 +333,13 @@ _DIAGASSERT(long_options != NULL); /* idx may be NULL */ - retval = getopt_internal(nargc, __UNCONST(nargv), options); + retval = getopt_internal(nargc, CONST_CAST(char **, nargv), options); if (retval == -2) { char *current_argv, *has_equal; size_t current_argv_len; int i, ambiguous, match; - current_argv = __UNCONST(place); + current_argv = CONST_CAST(char *, place); match = -1; ambiguous = 0; @@ -354,7 +353,7 @@ */ if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, - optind, __UNCONST(nargv)); + optind, CONST_CAST(char **, nargv)); optind -= nonopt_end - nonopt_start; } nonopt_start = nonopt_end = -1; diff -Nru openvswitch-2.3.1/lib/getrusage-windows.c openvswitch-2.4.0~git20150623/lib/getrusage-windows.c --- openvswitch-2.3.1/lib/getrusage-windows.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/getrusage-windows.c 2015-06-23 18:46:21.000000000 +0000 @@ -20,7 +20,7 @@ #include #include #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(getrusage_windows); diff -Nru openvswitch-2.3.1/lib/.gitignore openvswitch-2.4.0~git20150623/lib/.gitignore --- openvswitch-2.3.1/lib/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,18 @@ +/Makefile +/Makefile.in +/dhparams.c +/dirs.c +/coverage-counters.c +/meta-flow.inc +/nx-match.inc +/ofp-actions.inc1 +/ofp-actions.inc2 +/ofp-errors.inc +/ofp-msgs.inc +/stdio.h +/string.h +/vswitch-idl.c +/vswitch-idl.h +/vswitch-idl.ovsidl +/libopenvswitch.pc +/libsflow.pc diff -Nru openvswitch-2.3.1/lib/guarded-list.c openvswitch-2.4.0~git20150623/lib/guarded-list.c --- openvswitch-2.3.1/lib/guarded-list.c 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/guarded-list.c 2015-06-23 18:46:21.000000000 +0000 @@ -51,7 +51,7 @@ * the list. */ size_t guarded_list_push_back(struct guarded_list *list, - struct list *node, size_t max) + struct ovs_list *node, size_t max) { size_t retval = 0; @@ -65,10 +65,10 @@ return retval; } -struct list * +struct ovs_list * guarded_list_pop_front(struct guarded_list *list) { - struct list *node = NULL; + struct ovs_list *node = NULL; ovs_mutex_lock(&list->mutex); if (list->n) { @@ -81,7 +81,7 @@ } size_t -guarded_list_pop_all(struct guarded_list *list, struct list *elements) +guarded_list_pop_all(struct guarded_list *list, struct ovs_list *elements) { size_t n; diff -Nru openvswitch-2.3.1/lib/guarded-list.h openvswitch-2.4.0~git20150623/lib/guarded-list.h --- openvswitch-2.3.1/lib/guarded-list.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/guarded-list.h 2015-06-23 18:46:21.000000000 +0000 @@ -24,13 +24,13 @@ struct guarded_list { struct ovs_mutex mutex; - struct list list; + struct ovs_list list; size_t n; }; -#define GUARDED_LIST_INITIALIZER(LIST) { \ +#define GUARDED_OVS_LIST_INITIALIZER(LIST) { \ .mutex = OVS_MUTEX_INITIALIZER, \ - .list = LIST_INITIALIZER(&((LIST)->list)), \ + .list = OVS_LIST_INITIALIZER(&((LIST)->list)), \ .n = 0 } void guarded_list_init(struct guarded_list *); @@ -38,9 +38,9 @@ bool guarded_list_is_empty(const struct guarded_list *); -size_t guarded_list_push_back(struct guarded_list *, struct list *, +size_t guarded_list_push_back(struct guarded_list *, struct ovs_list *, size_t max); -struct list *guarded_list_pop_front(struct guarded_list *); -size_t guarded_list_pop_all(struct guarded_list *, struct list *); +struct ovs_list *guarded_list_pop_front(struct guarded_list *); +size_t guarded_list_pop_all(struct guarded_list *, struct ovs_list *); #endif /* guarded-list.h */ diff -Nru openvswitch-2.3.1/lib/hash.c openvswitch-2.4.0~git20150623/lib/hash.c --- openvswitch-2.3.1/lib/hash.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/hash.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ uint32_t hash_3words(uint32_t a, uint32_t b, uint32_t c) { - return mhash_finish(mhash_add(mhash_add(mhash_add(a, 0), b), c), 12); + return hash_finish(hash_add(hash_add(hash_add(a, 0), b), c), 12); } /* Returns the hash of the 'n' bytes at 'p', starting from 'basis'. */ @@ -35,7 +35,7 @@ hash = basis; while (n >= 4) { - hash = mhash_add(hash, get_unaligned_u32(p)); + hash = hash_add(hash, get_unaligned_u32(p)); n -= 4; p += 1; } @@ -44,25 +44,10 @@ uint32_t tmp = 0; memcpy(&tmp, p, n); - hash = mhash_add__(hash, tmp); + hash = hash_add(hash, tmp); } - return mhash_finish(hash, orig_n); -} - -/* Returns the hash of the 'n' 32-bit words at 'p', starting from 'basis'. - * 'p' must be properly aligned. */ -uint32_t -hash_words(const uint32_t p[], size_t n_words, uint32_t basis) -{ - uint32_t hash; - size_t i; - - hash = basis; - for (i = 0; i < n_words; i++) { - hash = mhash_add(hash, p[i]); - } - return mhash_finish(hash, n_words * 4); + return hash_finish(hash, orig_n); } uint32_t @@ -74,3 +59,279 @@ memcpy(value, &x, sizeof value); return hash_3words(value[0], value[1], basis); } + +uint32_t +hash_words__(const uint32_t p[], size_t n_words, uint32_t basis) +{ + return hash_words_inline(p, n_words, basis); +} + +uint32_t +hash_words64__(const uint64_t p[], size_t n_words, uint32_t basis) +{ + return hash_words64_inline(p, n_words, basis); +} + +#if !(defined(__x86_64__)) +void +hash_bytes128(const void *p_, size_t len, uint32_t basis, ovs_u128 *out) +{ + const uint32_t c1 = 0x239b961b; + const uint32_t c2 = 0xab0e9789; + const uint32_t c3 = 0x38b34ae5; + const uint32_t c4 = 0xa1e38b93; + const uint8_t *tail, *data = (const uint8_t *)p_; + const uint32_t *blocks = (const uint32_t *)p_; + const int nblocks = len / 16; + uint32_t h1 = basis; + uint32_t h2 = basis; + uint32_t h3 = basis; + uint32_t h4 = basis; + uint32_t k1, k2, k3, k4; + + /* Body */ + for (int i = 0; i < nblocks; i++) { + uint32_t k1 = get_unaligned_u32(&blocks[i * 4 + 0]); + uint32_t k2 = get_unaligned_u32(&blocks[i * 4 + 1]); + uint32_t k3 = get_unaligned_u32(&blocks[i * 4 + 2]); + uint32_t k4 = get_unaligned_u32(&blocks[i * 4 + 3]); + + k1 *= c1; + k1 = hash_rot(k1, 15); + k1 *= c2; + h1 ^= k1; + + h1 = hash_rot(h1, 19); + h1 += h2; + h1 = h1 * 5 + 0x561ccd1b; + + k2 *= c2; + k2 = hash_rot(k2, 16); + k2 *= c3; + h2 ^= k2; + + h2 = hash_rot(h2, 17); + h2 += h3; + h2 = h2 * 5 + 0x0bcaa747; + + k3 *= c3; + k3 = hash_rot(k3, 17); + k3 *= c4; + h3 ^= k3; + + h3 = hash_rot(h3, 15); + h3 += h4; + h3 = h3 * 5 + 0x96cd1c35; + + k4 *= c4; + k4 = hash_rot(k4, 18); + k4 *= c1; + h4 ^= k4; + + h4 = hash_rot(h4, 13); + h4 += h1; + h4 = h4 * 5 + 0x32ac3b17; + } + + /* Tail */ + k1 = k2 = k3 = k4 = 0; + tail = data + nblocks * 16; + switch (len & 15) { + case 15: + k4 ^= tail[14] << 16; + case 14: + k4 ^= tail[13] << 8; + case 13: + k4 ^= tail[12] << 0; + k4 *= c4; + k4 = hash_rot(k4, 18); + k4 *= c1; + h4 ^= k4; + + case 12: + k3 ^= tail[11] << 24; + case 11: + k3 ^= tail[10] << 16; + case 10: + k3 ^= tail[9] << 8; + case 9: + k3 ^= tail[8] << 0; + k3 *= c3; + k3 = hash_rot(k3, 17); + k3 *= c4; + h3 ^= k3; + + case 8: + k2 ^= tail[7] << 24; + case 7: + k2 ^= tail[6] << 16; + case 6: + k2 ^= tail[5] << 8; + case 5: + k2 ^= tail[4] << 0; + k2 *= c2; + k2 = hash_rot(k2, 16); + k2 *= c3; + h2 ^= k2; + + case 4: + k1 ^= tail[3] << 24; + case 3: + k1 ^= tail[2] << 16; + case 2: + k1 ^= tail[1] << 8; + case 1: + k1 ^= tail[0] << 0; + k1 *= c1; + k1 = hash_rot(k1, 15); + k1 *= c2; + h1 ^= k1; + }; + + /* Finalization */ + h1 ^= len; + h2 ^= len; + h3 ^= len; + h4 ^= len; + + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; + + h1 = mhash_finish(h1); + h2 = mhash_finish(h2); + h3 = mhash_finish(h3); + h4 = mhash_finish(h4); + + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; + + out->u32[0] = h1; + out->u32[1] = h2; + out->u32[2] = h3; + out->u32[3] = h4; +} + +#else /* __x86_64__ */ + +static inline uint64_t +hash_rot64(uint64_t x, int8_t r) +{ + return (x << r) | (x >> (64 - r)); +} + +static inline uint64_t +fmix64(uint64_t k) +{ + k ^= k >> 33; + k *= 0xff51afd7ed558ccdULL; + k ^= k >> 33; + k *= 0xc4ceb9fe1a85ec53ULL; + k ^= k >> 33; + + return k; +} + +void +hash_bytes128(const void *p_, size_t len, uint32_t basis, ovs_u128 *out) +{ + const uint64_t c1 = 0x87c37b91114253d5ULL; + const uint64_t c2 = 0x4cf5ad432745937fULL; + const uint8_t *tail, *data = (const uint8_t *)p_; + const uint64_t *blocks = (const uint64_t *)p_; + const int nblocks = len / 16; + uint64_t h1 = basis; + uint64_t h2 = basis; + uint64_t k1, k2; + + /* Body */ + for (int i = 0; i < nblocks; i++) { + k1 = get_unaligned_u64(&blocks[i * 2 + 0]); + k2 = get_unaligned_u64(&blocks[i * 2 + 1]); + + k1 *= c1; + k1 = hash_rot64(k1, 31); + k1 *= c2; + h1 ^= k1; + + h1 = hash_rot64(h1, 27); + h1 += h2; + h1 = h1 * 5 + 0x52dce729; + + k2 *= c2; + k2 = hash_rot64(k2, 33); + k2 *= c1; + h2 ^= k2; + + h2 = hash_rot64(h2, 31); + h2 += h1; + h2 = h2 * 5 + 0x38495ab5; + } + + /* Tail */ + k1 = 0; + k2 = 0; + tail = data + nblocks * 16; + switch (len & 15) { + case 15: + k2 ^= ((uint64_t) tail[14]) << 48; + case 14: + k2 ^= ((uint64_t) tail[13]) << 40; + case 13: + k2 ^= ((uint64_t) tail[12]) << 32; + case 12: + k2 ^= ((uint64_t) tail[11]) << 24; + case 11: + k2 ^= ((uint64_t) tail[10]) << 16; + case 10: + k2 ^= ((uint64_t) tail[9]) << 8; + case 9: + k2 ^= ((uint64_t) tail[8]) << 0; + k2 *= c2; + k2 = hash_rot64(k2, 33); + k2 *= c1; + h2 ^= k2; + + case 8: + k1 ^= ((uint64_t) tail[7]) << 56; + case 7: + k1 ^= ((uint64_t) tail[6]) << 48; + case 6: + k1 ^= ((uint64_t) tail[5]) << 40; + case 5: + k1 ^= ((uint64_t) tail[4]) << 32; + case 4: + k1 ^= ((uint64_t) tail[3]) << 24; + case 3: + k1 ^= ((uint64_t) tail[2]) << 16; + case 2: + k1 ^= ((uint64_t) tail[1]) << 8; + case 1: + k1 ^= ((uint64_t) tail[0]) << 0; + k1 *= c1; + k1 = hash_rot64(k1, 31); + k1 *= c2; + h1 ^= k1; + }; + + /* Finalization */ + h1 ^= len; + h2 ^= len; + h1 += h2; + h2 += h1; + h1 = fmix64(h1); + h2 = fmix64(h2); + h1 += h2; + h2 += h1; + + out->u64.lo = h1; + out->u64.hi = h2; +} +#endif /* __x86_64__ */ diff -Nru openvswitch-2.3.1/lib/hash.h openvswitch-2.4.0~git20150623/lib/hash.h --- openvswitch-2.3.1/lib/hash.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/hash.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,13 +32,16 @@ return (x << k) | (x >> (32 - k)); } -uint32_t hash_words(const uint32_t data[], size_t n_words, uint32_t basis); uint32_t hash_bytes(const void *, size_t n_bytes, uint32_t basis); +/* The hash input must be a word larger than 128 bits. */ +void hash_bytes128(const void *_, size_t n_bytes, uint32_t basis, + ovs_u128 *out); static inline uint32_t hash_int(uint32_t x, uint32_t basis); static inline uint32_t hash_2words(uint32_t, uint32_t); -static inline uint32_t hash_uint64(uint64_t); -static inline uint32_t hash_uint64_basis(uint64_t x, uint32_t basis); +static inline uint32_t hash_uint64(const uint64_t); +static inline uint32_t hash_uint64_basis(const uint64_t x, + const uint32_t basis); uint32_t hash_3words(uint32_t, uint32_t, uint32_t); static inline uint32_t hash_boolean(bool x, uint32_t basis); @@ -72,9 +75,8 @@ return hash * 5 + 0xe6546b64; } -static inline uint32_t mhash_finish(uint32_t hash, size_t n_bytes) +static inline uint32_t mhash_finish(uint32_t hash) { - hash ^= n_bytes; hash ^= hash >> 16; hash *= 0x85ebca6b; hash ^= hash >> 13; @@ -83,23 +85,53 @@ return hash; } -static inline uint32_t hash_string(const char *s, uint32_t basis) +#if !(defined(__SSE4_2__) && defined(__x86_64__)) +/* Mhash-based implementation. */ + +static inline uint32_t hash_add(uint32_t hash, uint32_t data) { - return hash_bytes(s, strlen(s), basis); + return mhash_add(hash, data); } -static inline uint32_t hash_int(uint32_t x, uint32_t basis) +static inline uint32_t hash_add64(uint32_t hash, uint64_t data) { - return hash_2words(x, basis); + return hash_add(hash_add(hash, data), data >> 32); } -/* An attempt at a useful 1-bit hash function. Has not been analyzed for - * quality. */ -static inline uint32_t hash_boolean(bool x, uint32_t basis) +static inline uint32_t hash_finish(uint32_t hash, uint32_t final) { - const uint32_t P0 = 0xc2b73583; /* This is hash_int(1, 0). */ - const uint32_t P1 = 0xe90f1258; /* This is hash_int(2, 0). */ - return (x ? P0 : P1) ^ hash_rot(basis, 1); + return mhash_finish(hash ^ final); +} + +/* Returns the hash of the 'n' 32-bit words at 'p', starting from 'basis'. + * 'p' must be properly aligned. + * + * This is inlined for the compiler to have access to the 'n_words', which + * in many cases is a constant. */ +static inline uint32_t +hash_words_inline(const uint32_t p[], size_t n_words, uint32_t basis) +{ + uint32_t hash; + size_t i; + + hash = basis; + for (i = 0; i < n_words; i++) { + hash = hash_add(hash, p[i]); + } + return hash_finish(hash, n_words * 4); +} + +static inline uint32_t +hash_words64_inline(const uint64_t p[], size_t n_words, uint32_t basis) +{ + uint32_t hash; + size_t i; + + hash = basis; + for (i = 0; i < n_words; i++) { + hash = hash_add64(hash, p[i]); + } + return hash_finish(hash, n_words * 8); } static inline uint32_t hash_pointer(const void *p, uint32_t basis) @@ -117,19 +149,199 @@ static inline uint32_t hash_2words(uint32_t x, uint32_t y) { - return mhash_finish(mhash_add(mhash_add(x, 0), y), 8); + return hash_finish(hash_add(hash_add(x, 0), y), 8); +} + +static inline uint32_t hash_uint64_basis(const uint64_t x, + const uint32_t basis) +{ + return hash_finish(hash_add64(basis, x), 8); } static inline uint32_t hash_uint64(const uint64_t x) { - return hash_2words((uint32_t)(x >> 32), (uint32_t)x); + return hash_uint64_basis(x, 0); +} + +#else /* __SSE4_2__ && __x86_64__ */ +#include + +static inline uint32_t hash_add(uint32_t hash, uint32_t data) +{ + return _mm_crc32_u32(hash, data); +} + +/* Add the halves of 'data' in the memory order. */ +static inline uint32_t hash_add64(uint32_t hash, uint64_t data) +{ + return _mm_crc32_u64(hash, data); +} + +static inline uint32_t hash_finish(uint64_t hash, uint64_t final) +{ + /* The finishing multiplier 0x805204f3 has been experimentally + * derived to pass the testsuite hash tests. */ + hash = _mm_crc32_u64(hash, final) * 0x805204f3; + return hash ^ (uint32_t)hash >> 16; /* Increase entropy in LSBs. */ +} + +/* Returns the hash of the 'n' 32-bit words at 'p_', starting from 'basis'. + * We access 'p_' as a uint64_t pointer, which is fine for __SSE_4_2__. + * + * This is inlined for the compiler to have access to the 'n_words', which + * in many cases is a constant. */ +static inline uint32_t +hash_words_inline(const uint32_t p_[], size_t n_words, uint32_t basis) +{ + const uint64_t *p = (const void *)p_; + uint64_t hash1 = basis; + uint64_t hash2 = 0; + uint64_t hash3 = n_words; + const uint32_t *endp = (const uint32_t *)p + n_words; + const uint64_t *limit = p + n_words / 2 - 3; + + while (p <= limit) { + hash1 = _mm_crc32_u64(hash1, p[0]); + hash2 = _mm_crc32_u64(hash2, p[1]); + hash3 = _mm_crc32_u64(hash3, p[2]); + p += 3; + } + switch (endp - (const uint32_t *)p) { + case 1: + hash1 = _mm_crc32_u32(hash1, *(const uint32_t *)&p[0]); + break; + case 2: + hash1 = _mm_crc32_u64(hash1, p[0]); + break; + case 3: + hash1 = _mm_crc32_u64(hash1, p[0]); + hash2 = _mm_crc32_u32(hash2, *(const uint32_t *)&p[1]); + break; + case 4: + hash1 = _mm_crc32_u64(hash1, p[0]); + hash2 = _mm_crc32_u64(hash2, p[1]); + break; + case 5: + hash1 = _mm_crc32_u64(hash1, p[0]); + hash2 = _mm_crc32_u64(hash2, p[1]); + hash3 = _mm_crc32_u32(hash3, *(const uint32_t *)&p[2]); + break; + } + return hash_finish(hash1, hash2 << 32 | hash3); +} + +/* A simpler version for 64-bit data. + * 'n_words' is the count of 64-bit words, basis is 64 bits. */ +static inline uint32_t +hash_words64_inline(const uint64_t p[], size_t n_words, uint32_t basis) +{ + uint64_t hash1 = basis; + uint64_t hash2 = 0; + uint64_t hash3 = n_words; + const uint64_t *endp = p + n_words; + const uint64_t *limit = endp - 3; + + while (p <= limit) { + hash1 = _mm_crc32_u64(hash1, p[0]); + hash2 = _mm_crc32_u64(hash2, p[1]); + hash3 = _mm_crc32_u64(hash3, p[2]); + p += 3; + } + switch (endp - p) { + case 1: + hash1 = _mm_crc32_u64(hash1, p[0]); + break; + case 2: + hash1 = _mm_crc32_u64(hash1, p[0]); + hash2 = _mm_crc32_u64(hash2, p[1]); + break; + } + return hash_finish(hash1, hash2 << 32 | hash3); } static inline uint32_t hash_uint64_basis(const uint64_t x, const uint32_t basis) { - return hash_3words((uint32_t)(x >> 32), (uint32_t)x, basis); + /* '23' chosen to mix bits enough for the test-hash to pass. */ + return hash_finish(hash_add64(basis, x), 23); } + +static inline uint32_t hash_uint64(const uint64_t x) +{ + return hash_uint64_basis(x, 0); +} + +static inline uint32_t hash_2words(uint32_t x, uint32_t y) +{ + return hash_uint64((uint64_t)y << 32 | x); +} + +static inline uint32_t hash_pointer(const void *p, uint32_t basis) +{ + return hash_uint64_basis((uint64_t) (uintptr_t) p, basis); +} +#endif + +uint32_t hash_words__(const uint32_t p[], size_t n_words, uint32_t basis); +uint32_t hash_words64__(const uint64_t p[], size_t n_words, uint32_t basis); + +/* Inline the larger hash functions only when 'n_words' is known to be + * compile-time constant. */ +#if __GNUC__ >= 4 +static inline uint32_t +hash_words(const uint32_t p[], size_t n_words, uint32_t basis) +{ + if (__builtin_constant_p(n_words)) { + return hash_words_inline(p, n_words, basis); + } else { + return hash_words__(p, n_words, basis); + } +} + +static inline uint32_t +hash_words64(const uint64_t p[], size_t n_words, uint32_t basis) +{ + if (__builtin_constant_p(n_words)) { + return hash_words64_inline(p, n_words, basis); + } else { + return hash_words64__(p, n_words, basis); + } +} + +#else + +static inline uint32_t +hash_words(const uint32_t p[], size_t n_words, uint32_t basis) +{ + return hash_words__(p, n_words, basis); +} + +static inline uint32_t +hash_words64(const uint64_t p[], size_t n_words, uint32_t basis) +{ + return hash_words64__(p, n_words, basis); +} +#endif + +static inline uint32_t hash_string(const char *s, uint32_t basis) +{ + return hash_bytes(s, strlen(s), basis); +} + +static inline uint32_t hash_int(uint32_t x, uint32_t basis) +{ + return hash_2words(x, basis); +} + +/* An attempt at a useful 1-bit hash function. Has not been analyzed for + * quality. */ +static inline uint32_t hash_boolean(bool x, uint32_t basis) +{ + const uint32_t P0 = 0xc2b73583; /* This is hash_int(1, 0). */ + const uint32_t P1 = 0xe90f1258; /* This is hash_int(2, 0). */ + return (x ? P0 : P1) ^ hash_rot(basis, 1); +} + #ifdef __cplusplus } #endif diff -Nru openvswitch-2.3.1/lib/heap.h openvswitch-2.4.0~git20150623/lib/heap.h --- openvswitch-2.3.1/lib/heap.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/heap.h 2015-06-23 18:46:21.000000000 +0000 @@ -68,7 +68,7 @@ * element. */ #define HEAP_FOR_EACH(NODE, MEMBER, HEAP) \ for (((HEAP)->n > 0 \ - ? ASSIGN_CONTAINER(NODE, (HEAP)->array[1], MEMBER) \ + ? INIT_CONTAINER(NODE, (HEAP)->array[1], MEMBER) \ : ((NODE) = NULL, (void) 0)); \ (NODE) != NULL; \ ((NODE)->MEMBER.idx < (HEAP)->n \ diff -Nru openvswitch-2.3.1/lib/hindex.h openvswitch-2.4.0~git20150623/lib/hindex.h --- openvswitch-2.3.1/lib/hindex.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/hindex.h 2015-06-23 18:46:21.000000000 +0000 @@ -128,7 +128,7 @@ * Evaluates HASH only once. */ #define HINDEX_FOR_EACH_WITH_HASH(NODE, MEMBER, HASH, HINDEX) \ - for (ASSIGN_CONTAINER(NODE, hindex_node_with_hash(HINDEX, HASH), MEMBER); \ + for (INIT_CONTAINER(NODE, hindex_node_with_hash(HINDEX, HASH), MEMBER); \ NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER); \ ASSIGN_CONTAINER(NODE, (NODE)->MEMBER.s, MEMBER)) @@ -149,16 +149,16 @@ /* Iterates through every node in HINDEX. */ #define HINDEX_FOR_EACH(NODE, MEMBER, HINDEX) \ - for (ASSIGN_CONTAINER(NODE, hindex_first(HINDEX), MEMBER); \ + for (INIT_CONTAINER(NODE, hindex_first(HINDEX), MEMBER); \ NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER); \ ASSIGN_CONTAINER(NODE, hindex_next(HINDEX, &(NODE)->MEMBER), MEMBER)) /* Safe when NODE may be freed (not needed when NODE may be removed from the * hash index but its members remain accessible and intact). */ -#define HINDEX_FOR_EACH_SAFE(NODE, NEXT, MEMBER, HINDEX) \ - for (ASSIGN_CONTAINER(NODE, hindex_first(HINDEX), MEMBER); \ +#define HINDEX_FOR_EACH_SAFE(NODE, NEXT, MEMBER, HINDEX) \ + for (INIT_CONTAINER(NODE, hindex_first(HINDEX), MEMBER); \ (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER) \ - ? ASSIGN_CONTAINER(NEXT, hindex_next(HINDEX, &(NODE)->MEMBER), MEMBER), 1 \ + ? INIT_CONTAINER(NEXT, hindex_next(HINDEX, &(NODE)->MEMBER), MEMBER), 1 \ : 0); \ (NODE) = (NEXT)) diff -Nru openvswitch-2.3.1/lib/hmap.c openvswitch-2.4.0~git20150623/lib/hmap.c --- openvswitch-2.3.1/lib/hmap.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/hmap.c 2015-06-23 18:46:21.000000000 +0000 @@ -21,7 +21,7 @@ #include "coverage.h" #include "random.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(hmap); diff -Nru openvswitch-2.3.1/lib/hmap.h openvswitch-2.4.0~git20150623/lib/hmap.h --- openvswitch-2.3.1/lib/hmap.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/hmap.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ #include #include -#include "ovs-atomic.h" #include "util.h" #ifdef __cplusplus @@ -80,20 +79,20 @@ /* Adjusting capacity. */ void hmap_expand_at(struct hmap *, const char *where); -#define hmap_expand(HMAP) hmap_expand_at(HMAP, SOURCE_LOCATOR) +#define hmap_expand(HMAP) hmap_expand_at(HMAP, OVS_SOURCE_LOCATOR) void hmap_shrink_at(struct hmap *, const char *where); -#define hmap_shrink(HMAP) hmap_shrink_at(HMAP, SOURCE_LOCATOR) +#define hmap_shrink(HMAP) hmap_shrink_at(HMAP, OVS_SOURCE_LOCATOR) void hmap_reserve_at(struct hmap *, size_t capacity, const char *where); #define hmap_reserve(HMAP, CAPACITY) \ - hmap_reserve_at(HMAP, CAPACITY, SOURCE_LOCATOR) + hmap_reserve_at(HMAP, CAPACITY, OVS_SOURCE_LOCATOR) /* Insertion and deletion. */ static inline void hmap_insert_at(struct hmap *, struct hmap_node *, size_t hash, const char *where); #define hmap_insert(HMAP, NODE, HASH) \ - hmap_insert_at(HMAP, NODE, HASH, SOURCE_LOCATOR) + hmap_insert_at(HMAP, NODE, HASH, OVS_SOURCE_LOCATOR) static inline void hmap_insert_fast(struct hmap *, struct hmap_node *, size_t hash); @@ -124,14 +123,24 @@ * iteration). * * HASH is only evaluated once. + * + * + * Warning + * ------- + * + * When the loop terminates, &NODE->MEMBER will equal NULL. Unless MEMBER is + * the first member in its struct, this means that NODE itself will not be + * NULL. + * + * (This is true for all of the HMAP_FOR_EACH_*() macros.) */ #define HMAP_FOR_EACH_WITH_HASH(NODE, MEMBER, HASH, HMAP) \ - for (ASSIGN_CONTAINER(NODE, hmap_first_with_hash(HMAP, HASH), MEMBER); \ + for (INIT_CONTAINER(NODE, hmap_first_with_hash(HMAP, HASH), MEMBER); \ NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER); \ ASSIGN_CONTAINER(NODE, hmap_next_with_hash(&(NODE)->MEMBER), \ MEMBER)) #define HMAP_FOR_EACH_IN_BUCKET(NODE, MEMBER, HASH, HMAP) \ - for (ASSIGN_CONTAINER(NODE, hmap_first_in_bucket(HMAP, HASH), MEMBER); \ + for (INIT_CONTAINER(NODE, hmap_first_in_bucket(HMAP, HASH), MEMBER); \ NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER); \ ASSIGN_CONTAINER(NODE, hmap_next_in_bucket(&(NODE)->MEMBER), MEMBER)) @@ -148,16 +157,16 @@ /* Iterates through every node in HMAP. */ #define HMAP_FOR_EACH(NODE, MEMBER, HMAP) \ - for (ASSIGN_CONTAINER(NODE, hmap_first(HMAP), MEMBER); \ + for (INIT_CONTAINER(NODE, hmap_first(HMAP), MEMBER); \ NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER); \ ASSIGN_CONTAINER(NODE, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER)) /* Safe when NODE may be freed (not needed when NODE may be removed from the * hash map but its members remain accessible and intact). */ #define HMAP_FOR_EACH_SAFE(NODE, NEXT, MEMBER, HMAP) \ - for (ASSIGN_CONTAINER(NODE, hmap_first(HMAP), MEMBER); \ + for (INIT_CONTAINER(NODE, hmap_first(HMAP), MEMBER); \ (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER) \ - ? ASSIGN_CONTAINER(NEXT, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER), 1 \ + ? INIT_CONTAINER(NEXT, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER), 1 \ : 0); \ (NODE) = (NEXT)) diff -Nru openvswitch-2.3.1/lib/id-pool.c openvswitch-2.4.0~git20150623/lib/id-pool.c --- openvswitch-2.3.1/lib/id-pool.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/id-pool.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * Copyright (c) 2014 Netronome. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "id-pool.h" +#include "hmap.h" +#include "hash.h" + +struct id_node { + struct hmap_node node; + uint32_t id; +}; + +struct id_pool { + struct hmap map; + uint32_t base; /* IDs in the range of [base, base + n_ids). */ + uint32_t n_ids; /* Total number of ids in the pool. */ + uint32_t next_free_id; /* Possible next free id. */ +}; + +static void id_pool_init(struct id_pool *pool, + uint32_t base, uint32_t n_ids); +static void id_pool_uninit(struct id_pool *pool); +static struct id_node *id_pool_find(struct id_pool *pool, uint32_t id); + +struct id_pool * +id_pool_create(uint32_t base, uint32_t n_ids) +{ + struct id_pool *pool; + + pool = xmalloc(sizeof *pool); + id_pool_init(pool, base, n_ids); + + return pool; +} + +void +id_pool_destroy(struct id_pool *pool) +{ + if (pool) { + id_pool_uninit(pool); + free(pool); + } +} + +static void +id_pool_init(struct id_pool *pool, uint32_t base, uint32_t n_ids) +{ + pool->base = base; + pool->n_ids = n_ids; + pool->next_free_id = base; + hmap_init(&pool->map); +} + +static void +id_pool_uninit(struct id_pool *pool) +{ + struct id_node *id_node, *next; + + HMAP_FOR_EACH_SAFE(id_node, next, node, &pool->map) { + hmap_remove(&pool->map, &id_node->node); + free(id_node); + } + + hmap_destroy(&pool->map); +} + +static struct id_node * +id_pool_find(struct id_pool *pool, uint32_t id) +{ + size_t hash; + struct id_node *id_node; + + hash = hash_int(id, 0); + HMAP_FOR_EACH_WITH_HASH(id_node, node, hash, &pool->map) { + if (id == id_node->id) { + return id_node; + } + } + return NULL; +} + +void +id_pool_add(struct id_pool *pool, uint32_t id) +{ + struct id_node *id_node = xmalloc(sizeof *id_node); + size_t hash; + + id_node->id = id; + hash = hash_int(id, 0); + hmap_insert(&pool->map, &id_node->node, hash); +} + +bool +id_pool_alloc_id(struct id_pool *pool, uint32_t *id_) +{ + uint32_t id; + + if (pool->n_ids == 0) { + return false; + } + + if (!(id_pool_find(pool, pool->next_free_id))) { + id = pool->next_free_id; + goto found_free_id; + } + + for(id = pool->base; id < pool->base + pool->n_ids; id++) { + if (!id_pool_find(pool, id)) { + goto found_free_id; + } + } + + /* Not available. */ + return false; + +found_free_id: + id_pool_add(pool, id); + + if (id < pool->base + pool->n_ids) { + pool->next_free_id = id + 1; + } else { + pool->next_free_id = pool->base; + } + + *id_ = id; + return true; +} + +void +id_pool_free_id(struct id_pool *pool, uint32_t id) +{ + struct id_node *id_node; + if (id > pool->base && (id <= pool->base + pool->n_ids)) { + id_node = id_pool_find(pool, id); + if (id_node) { + hmap_remove(&pool->map, &id_node->node); + free(id_node); + } + } +} diff -Nru openvswitch-2.3.1/lib/id-pool.h openvswitch-2.4.0~git20150623/lib/id-pool.h --- openvswitch-2.3.1/lib/id-pool.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/id-pool.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * Copyright (c) 2014 Netronome. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ID_POOL_H +#define ID_POOL_H + +#include +#include +#include + +struct id_pool; + +struct id_pool *id_pool_create(uint32_t base, uint32_t n_ids); +void id_pool_destroy(struct id_pool *); +bool id_pool_alloc_id(struct id_pool *, uint32_t *id); +void id_pool_free_id(struct id_pool *, uint32_t id); +void id_pool_add(struct id_pool *, uint32_t id); + +/* + * ID pool. + * ======== + * + * Pool of unique 32bit ids. + * + * + * Thread-safety + * ============= + * + * APIs are not thread safe. + */ +#endif /* id-pool.h */ diff -Nru openvswitch-2.3.1/lib/json.c openvswitch-2.4.0~git20150623/lib/json.c --- openvswitch-2.3.1/lib/json.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/json.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,7 +117,7 @@ static void json_parser_input(struct json_parser *, struct json_token *); static void json_error(struct json_parser *p, const char *format, ...) - PRINTF_FORMAT(2, 3); + OVS_PRINTF_FORMAT(2, 3); const char * json_type_to_string(enum json_type type) @@ -746,13 +746,14 @@ json_lex_4hex(const char *cp, const char *end, int *valuep) { unsigned int value; + bool ok; if (cp + 4 > end) { return "quoted string ends within \\u escape"; } - value = hexits_value(cp, 4, NULL); - if (value == UINT_MAX) { + value = hexits_value(cp, 4, &ok); + if (!ok) { return "malformed \\u escape"; } if (!value) { @@ -830,6 +831,7 @@ * lexer will never pass in a string that ends in a single * backslash, but json_string_unescape() has other callers that * are not as careful.*/ + ds_clear(&out); ds_put_cstr(&out, "quoted string may not end with backslash"); goto exit; } diff -Nru openvswitch-2.3.1/lib/jsonrpc.c openvswitch-2.4.0~git20150623/lib/jsonrpc.c --- openvswitch-2.3.1/lib/jsonrpc.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/jsonrpc.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ #include "reconnect.h" #include "stream.h" #include "timeval.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(jsonrpc); @@ -46,7 +46,7 @@ struct json_parser *parser; /* Output. */ - struct list output; /* Contains "struct ofpbuf"s. */ + struct ovs_list output; /* Contains "struct ofpbuf"s. */ size_t output_count; /* Number of elements in "output". */ size_t backlog; }; @@ -63,8 +63,7 @@ int jsonrpc_stream_open(const char *name, struct stream **streamp, uint8_t dscp) { - return stream_open_with_default_port(name, OVSDB_OLD_PORT, - streamp, dscp); + return stream_open_with_default_port(name, OVSDB_PORT, streamp, dscp); } /* This is just the same as pstream_open() except that it uses the default @@ -72,8 +71,7 @@ int jsonrpc_pstream_open(const char *name, struct pstream **pstreamp, uint8_t dscp) { - return pstream_open_with_default_port(name, OVSDB_OLD_PORT, - pstreamp, dscp); + return pstream_open_with_default_port(name, OVSDB_PORT, pstreamp, dscp); } /* Returns a new JSON-RPC stream that uses 'stream' for input and output. The @@ -119,11 +117,11 @@ struct ofpbuf *buf = ofpbuf_from_list(rpc->output.next); int retval; - retval = stream_send(rpc->stream, ofpbuf_data(buf), ofpbuf_size(buf)); + retval = stream_send(rpc->stream, buf->data, buf->size); if (retval >= 0) { rpc->backlog -= retval; ofpbuf_pull(buf, retval); - if (!ofpbuf_size(buf)) { + if (!buf->size) { list_remove(&buf->list_node); rpc->output_count--; ofpbuf_delete(buf); @@ -257,7 +255,7 @@ buf = xmalloc(sizeof *buf); ofpbuf_use(buf, s, length); - ofpbuf_set_size(buf, length); + buf->size = length; list_push_back(&rpc->output, &buf->list_node); rpc->output_count++; rpc->backlog += length; @@ -526,10 +524,10 @@ static struct json * jsonrpc_create_id(void) { - static atomic_uint next_id = ATOMIC_VAR_INIT(0); + static atomic_count next_id = ATOMIC_COUNT_INIT(0); unsigned int id; - atomic_add(&next_id, 1, &id); + id = atomic_count_inc(&next_id); return json_integer_create(id); } @@ -1065,36 +1063,49 @@ } } +/* Returns true if 's' is currently connected or trying to connect. */ bool jsonrpc_session_is_alive(const struct jsonrpc_session *s) { return s->rpc || s->stream || reconnect_get_max_tries(s->reconnect); } +/* Returns true if 's' is currently connected. */ bool jsonrpc_session_is_connected(const struct jsonrpc_session *s) { return s->rpc != NULL; } +/* Returns a sequence number for 's'. The sequence number increments every + * time 's' connects or disconnects. Thus, a caller can use the change (or + * lack of change) in the sequence number to figure out whether the underlying + * connection is the same as before. */ unsigned int jsonrpc_session_get_seqno(const struct jsonrpc_session *s) { return s->seqno; } +/* Returns the current status of 's'. If 's' is NULL or is disconnected, this + * is 0, otherwise it is the status of the connection, as reported by + * jsonrpc_get_status(). */ int jsonrpc_session_get_status(const struct jsonrpc_session *s) { return s && s->rpc ? jsonrpc_get_status(s->rpc) : 0; } +/* Returns the last error reported on a connection by 's'. The return value is + * 0 only if no connection made by 's' has ever encountered an error. See + * jsonrpc_get_status() for return value interpretation. */ int jsonrpc_session_get_last_error(const struct jsonrpc_session *s) { return s->last_error; } +/* Populates 'stats' with statistics from 's'. */ void jsonrpc_session_get_reconnect_stats(const struct jsonrpc_session *s, struct reconnect_stats *stats) @@ -1102,6 +1113,7 @@ reconnect_get_stats(s->reconnect, time_msec(), stats); } +/* Enables 's' to reconnect to the peer if the connection drops. */ void jsonrpc_session_enable_reconnect(struct jsonrpc_session *s) { @@ -1110,18 +1122,27 @@ RECONNECT_DEFAULT_MAX_BACKOFF); } +/* Forces 's' to drop its connection (if any) and reconnect. */ void jsonrpc_session_force_reconnect(struct jsonrpc_session *s) { reconnect_force_reconnect(s->reconnect, time_msec()); } +/* Sets 'max_backoff' as the maximum time, in milliseconds, to wait after a + * connection attempt fails before attempting to connect again. */ void jsonrpc_session_set_max_backoff(struct jsonrpc_session *s, int max_backoff) { reconnect_set_backoff(s->reconnect, 0, max_backoff); } +/* Sets the "probe interval" for 's' to 'probe_interval', in milliseconds. If + * this is zero, it disables the connection keepalive feature. Otherwise, if + * 's' is idle for 'probe_interval' milliseconds then 's' will send an echo + * request and, if no reply is received within an additional 'probe_interval' + * milliseconds, close the connection (then reconnect, if that feature is + * enabled). */ void jsonrpc_session_set_probe_interval(struct jsonrpc_session *s, int probe_interval) @@ -1129,26 +1150,16 @@ reconnect_set_probe_interval(s->reconnect, probe_interval); } +/* Sets the DSCP value used for 's''s connection to 'dscp'. If this is + * different from the DSCP value currently in use then the connection is closed + * and reconnected. */ void -jsonrpc_session_set_dscp(struct jsonrpc_session *s, - uint8_t dscp) +jsonrpc_session_set_dscp(struct jsonrpc_session *s, uint8_t dscp) { if (s->dscp != dscp) { - if (s->pstream) { - int error; + pstream_close(s->pstream); + s->pstream = NULL; - error = pstream_set_dscp(s->pstream, dscp); - if (error) { - VLOG_ERR("%s: failed set_dscp %s", - reconnect_get_name(s->reconnect), - ovs_strerror(error)); - } - /* - * XXX race window between setting dscp to listening socket - * and accepting socket. accepted socket may have old dscp value. - * Ignore this race window for now. - */ - } s->dscp = dscp; jsonrpc_session_force_reconnect(s); } diff -Nru openvswitch-2.3.1/lib/jsonrpc.h openvswitch-2.4.0~git20150623/lib/jsonrpc.h --- openvswitch-2.3.1/lib/jsonrpc.h 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/jsonrpc.h 2015-06-23 18:46:21.000000000 +0000 @@ -35,9 +35,7 @@ /* Default port numbers. * * OVSDB_OLD_PORT defines the original port number used by OVS. - * OVSDB_PORT defines the official port number assigned by IANA. By - * default, we still uses OVSDB_OLD_PORT, but we present a warning that - * that will change. */ + * OVSDB_PORT defines the official port number assigned by IANA. */ #define OVSDB_OLD_PORT 6632 #define OVSDB_PORT 6640 diff -Nru openvswitch-2.3.1/lib/lacp.c openvswitch-2.4.0~git20150623/lib/lacp.c --- openvswitch-2.3.1/lib/lacp.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lacp.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc. +/* Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,8 @@ #include "dynamic-string.h" #include "hash.h" #include "hmap.h" -#include "ofpbuf.h" +#include "dp-packet.h" +#include "ovs-atomic.h" #include "packets.h" #include "poll-loop.h" #include "seq.h" @@ -30,7 +31,7 @@ #include "timer.h" #include "timeval.h" #include "unixctl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(lacp); @@ -61,7 +62,6 @@ BUILD_ASSERT_DECL(LACP_INFO_LEN == sizeof(struct lacp_info)); #define LACP_PDU_LEN 110 -OVS_PACKED( struct lacp_pdu { uint8_t subtype; /* Always 1. */ uint8_t version; /* Always 1. */ @@ -80,7 +80,7 @@ uint8_t collector_len; /* Always 16. */ ovs_be16 collector_delay; /* Maximum collector delay. Set to UINT16_MAX. */ uint8_t z3[64]; /* Combination of several fields. Always 0. */ -}); +}; BUILD_ASSERT_DECL(LACP_PDU_LEN == sizeof(struct lacp_pdu)); /* Implementation. */ @@ -92,7 +92,7 @@ }; struct lacp { - struct list node; /* Node in all_lacps list. */ + struct ovs_list node; /* Node in all_lacps list. */ char *name; /* Name of this lacp object. */ uint8_t sys_id[ETH_ADDR_LEN]; /* System ID. */ uint16_t sys_priority; /* System Priority. */ @@ -125,11 +125,15 @@ struct lacp_info ntt_actor; /* Used to decide if we Need To Transmit. */ struct timer tx; /* Next message transmission timer. */ struct timer rx; /* Expected message receive timer. */ + + uint32_t count_rx_pdus; /* dot3adAggPortStatsLACPDUsRx */ + uint32_t count_rx_pdus_bad; /* dot3adAggPortStatsIllegalRx */ + uint32_t count_tx_pdus; /* dot3adAggPortStatsLACPDUsTx */ }; static struct ovs_mutex mutex; -static struct list all_lacps__ = LIST_INITIALIZER(&all_lacps__); -static struct list *const all_lacps OVS_GUARDED_BY(mutex) = &all_lacps__; +static struct ovs_list all_lacps__ = OVS_LIST_INITIALIZER(&all_lacps__); +static struct ovs_list *const all_lacps OVS_GUARDED_BY(mutex) = &all_lacps__; static void lacp_update_attached(struct lacp *) OVS_REQUIRES(mutex); @@ -177,11 +181,11 @@ * supported by OVS. Otherwise, it returns a pointer to the lacp_pdu contained * within 'b'. */ static const struct lacp_pdu * -parse_lacp_packet(const struct ofpbuf *b) +parse_lacp_packet(const struct dp_packet *p) { const struct lacp_pdu *pdu; - pdu = ofpbuf_at(b, (uint8_t *)ofpbuf_l3(b) - (uint8_t *)ofpbuf_data(b), + pdu = dp_packet_at(p, (uint8_t *)dp_packet_l3(p) - (uint8_t *)dp_packet_data(p), LACP_PDU_LEN); if (pdu && pdu->subtype == 1 @@ -251,7 +255,7 @@ void lacp_unref(struct lacp *lacp) OVS_EXCLUDED(mutex) { - if (lacp && ovs_refcount_unref(&lacp->ref_cnt) == 1) { + if (lacp && ovs_refcount_unref_relaxed(&lacp->ref_cnt) == 1) { struct slave *slave, *next; lacp_lock(); @@ -315,7 +319,7 @@ */ void lacp_process_packet(struct lacp *lacp, const void *slave_, - const struct ofpbuf *packet) + const struct dp_packet *packet) OVS_EXCLUDED(mutex) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); @@ -328,9 +332,11 @@ if (!slave) { goto out; } + slave->count_rx_pdus++; pdu = parse_lacp_packet(packet); if (!pdu) { + slave->count_rx_pdus_bad++; VLOG_WARN_RL(&rl, "%s: received an unparsable LACP PDU.", lacp->name); goto out; } @@ -548,6 +554,7 @@ slave->ntt_actor = actor; compose_lacp_pdu(&actor, &slave->partner, &pdu); send_pdu(slave->aux, &pdu, sizeof pdu); + slave->count_tx_pdus++; duration = (slave->partner.state & LACP_STATE_TIME ? LACP_FAST_TIME_TX @@ -978,3 +985,58 @@ out: lacp_unlock(); } + +/* Extract a snapshot of the current state and counters for a slave port. + Return false if the slave is not active. */ +bool +lacp_get_slave_stats(const struct lacp *lacp, const void *slave_, struct lacp_slave_stats *stats) + OVS_EXCLUDED(mutex) +{ + struct slave *slave; + struct lacp_info actor; + bool ret; + + ovs_mutex_lock(&mutex); + + slave = slave_lookup(lacp, slave_); + if (slave) { + ret = true; + slave_get_actor(slave, &actor); + memcpy(&stats->dot3adAggPortActorSystemID, + actor.sys_id, + ETH_ADDR_LEN); + memcpy(&stats->dot3adAggPortPartnerOperSystemID, + slave->partner.sys_id, + ETH_ADDR_LEN); + stats->dot3adAggPortAttachedAggID = (lacp->key_slave->key ? + lacp->key_slave->key : + lacp->key_slave->port_id); + + /* Construct my admin-state. Assume aggregation is configured on. */ + stats->dot3adAggPortActorAdminState = LACP_STATE_AGG; + if (lacp->active) { + stats->dot3adAggPortActorAdminState |= LACP_STATE_ACT; + } + if (lacp->fast) { + stats->dot3adAggPortActorAdminState |= LACP_STATE_TIME; + } + /* XXX Not sure how to know the partner admin state. It + * might have to be captured and remembered during the + * negotiation phase. + */ + stats->dot3adAggPortPartnerAdminState = 0; + + stats->dot3adAggPortActorOperState = actor.state; + stats->dot3adAggPortPartnerOperState = slave->partner.state; + + /* Read out the latest counters */ + stats->dot3adAggPortStatsLACPDUsRx = slave->count_rx_pdus; + stats->dot3adAggPortStatsIllegalRx = slave->count_rx_pdus_bad; + stats->dot3adAggPortStatsLACPDUsTx = slave->count_tx_pdus; + } else { + ret = false; + } + ovs_mutex_unlock(&mutex); + return ret; + +} diff -Nru openvswitch-2.3.1/lib/lacp.h openvswitch-2.4.0~git20150623/lib/lacp.h --- openvswitch-2.3.1/lib/lacp.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lacp.h 2015-06-23 18:46:21.000000000 +0000 @@ -47,7 +47,7 @@ bool lacp_is_active(const struct lacp *); void lacp_process_packet(struct lacp *, const void *slave, - const struct ofpbuf *packet); + const struct dp_packet *packet); enum lacp_status lacp_status(const struct lacp *); struct lacp_slave_settings { @@ -70,4 +70,27 @@ void lacp_run(struct lacp *, lacp_send_pdu *); void lacp_wait(struct lacp *); +struct lacp_slave_stats { + /* id */ + uint8_t dot3adAggPortActorSystemID[ETH_ADDR_LEN]; + uint8_t dot3adAggPortPartnerOperSystemID[ETH_ADDR_LEN]; + uint32_t dot3adAggPortAttachedAggID; + /* state */ + uint8_t dot3adAggPortActorAdminState; + uint8_t dot3adAggPortActorOperState; + uint8_t dot3adAggPortPartnerAdminState; + uint8_t dot3adAggPortPartnerOperState; + /* counters */ + uint32_t dot3adAggPortStatsLACPDUsRx; + /* uint32_t dot3adAggPortStatsMarkerPDUsRx; */ + /* uint32_t dot3adAggPortStatsMarkerResponsePDUsRx; */ + /* uint32_t dot3adAggPortStatsUnknownRx; */ + uint32_t dot3adAggPortStatsIllegalRx; + uint32_t dot3adAggPortStatsLACPDUsTx; + /* uint32_t dot3adAggPortStatsMarkerPDUsTx; */ + /* uint32_t dot3adAggPortStatsMarkerResponsePDUsTx; */ +}; + +bool lacp_get_slave_stats(const struct lacp *, const void *slave_, struct lacp_slave_stats *); + #endif /* lacp.h */ diff -Nru openvswitch-2.3.1/lib/latch.h openvswitch-2.4.0~git20150623/lib/latch.h --- openvswitch-2.3.1/lib/latch.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/latch.h 2015-06-23 18:46:21.000000000 +0000 @@ -42,6 +42,6 @@ bool latch_is_set(const struct latch *); void latch_wait_at(const struct latch *, const char *where); -#define latch_wait(latch) latch_wait_at(latch, SOURCE_LOCATOR) +#define latch_wait(latch) latch_wait_at(latch, OVS_SOURCE_LOCATOR) #endif /* latch.h */ diff -Nru openvswitch-2.3.1/lib/latch-unix.c openvswitch-2.4.0~git20150623/lib/latch-unix.c --- openvswitch-2.3.1/lib/latch-unix.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/latch-unix.c 2015-06-23 18:46:21.000000000 +0000 @@ -83,5 +83,5 @@ void latch_wait_at(const struct latch *latch, const char *where) { - poll_fd_wait_at(latch->fds[0], 0, POLLIN, where); + poll_fd_wait_at(latch->fds[0], POLLIN, where); } diff -Nru openvswitch-2.3.1/lib/latch-windows.c openvswitch-2.4.0~git20150623/lib/latch-windows.c --- openvswitch-2.3.1/lib/latch-windows.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/latch-windows.c 2015-06-23 18:46:21.000000000 +0000 @@ -79,5 +79,5 @@ void latch_wait_at(const struct latch *latch, const char *where) { - poll_fd_wait_at(0, latch->wevent, POLLIN, where); + poll_wevent_wait_at(latch->wevent, where); } diff -Nru openvswitch-2.3.1/lib/learn.c openvswitch-2.4.0~git20150623/lib/learn.c --- openvswitch-2.3.1/lib/learn.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/learn.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,151 +30,6 @@ #include "openflow/openflow.h" #include "unaligned.h" -static ovs_be16 -get_be16(const void **pp) -{ - const ovs_be16 *p = *pp; - ovs_be16 value = *p; - *pp = p + 1; - return value; -} - -static ovs_be32 -get_be32(const void **pp) -{ - const ovs_be32 *p = *pp; - ovs_be32 value = get_unaligned_be32(p); - *pp = p + 1; - return value; -} - -static void -get_subfield(int n_bits, const void **p, struct mf_subfield *sf) -{ - sf->field = mf_from_nxm_header(ntohl(get_be32(p))); - sf->ofs = ntohs(get_be16(p)); - sf->n_bits = n_bits; -} - -static unsigned int -learn_min_len(uint16_t header) -{ - int n_bits = header & NX_LEARN_N_BITS_MASK; - int src_type = header & NX_LEARN_SRC_MASK; - int dst_type = header & NX_LEARN_DST_MASK; - unsigned int min_len; - - min_len = 0; - if (src_type == NX_LEARN_SRC_FIELD) { - min_len += sizeof(ovs_be32); /* src_field */ - min_len += sizeof(ovs_be16); /* src_ofs */ - } else { - min_len += DIV_ROUND_UP(n_bits, 16); - } - if (dst_type == NX_LEARN_DST_MATCH || - dst_type == NX_LEARN_DST_LOAD) { - min_len += sizeof(ovs_be32); /* dst_field */ - min_len += sizeof(ovs_be16); /* dst_ofs */ - } - return min_len; -} - -/* Converts 'nal' into a "struct ofpact_learn" and appends that struct to - * 'ofpacts'. Returns 0 if successful, otherwise an OFPERR_*. */ -enum ofperr -learn_from_openflow(const struct nx_action_learn *nal, struct ofpbuf *ofpacts) -{ - struct ofpact_learn *learn; - const void *p, *end; - - if (nal->pad) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - - learn = ofpact_put_LEARN(ofpacts); - - learn->idle_timeout = ntohs(nal->idle_timeout); - learn->hard_timeout = ntohs(nal->hard_timeout); - learn->priority = ntohs(nal->priority); - learn->cookie = ntohll(nal->cookie); - learn->table_id = nal->table_id; - learn->fin_idle_timeout = ntohs(nal->fin_idle_timeout); - learn->fin_hard_timeout = ntohs(nal->fin_hard_timeout); - - /* We only support "send-flow-removed" for now. */ - switch (ntohs(nal->flags)) { - case 0: - learn->flags = 0; - break; - case OFPFF_SEND_FLOW_REM: - learn->flags = OFPUTIL_FF_SEND_FLOW_REM; - break; - default: - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - - if (learn->table_id == 0xff) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - - end = (char *) nal + ntohs(nal->len); - for (p = nal + 1; p != end; ) { - struct ofpact_learn_spec *spec; - uint16_t header = ntohs(get_be16(&p)); - - if (!header) { - break; - } - - spec = ofpbuf_put_zeros(ofpacts, sizeof *spec); - learn = ofpacts->frame; - learn->n_specs++; - - spec->src_type = header & NX_LEARN_SRC_MASK; - spec->dst_type = header & NX_LEARN_DST_MASK; - spec->n_bits = header & NX_LEARN_N_BITS_MASK; - - /* Check for valid src and dst type combination. */ - if (spec->dst_type == NX_LEARN_DST_MATCH || - spec->dst_type == NX_LEARN_DST_LOAD || - (spec->dst_type == NX_LEARN_DST_OUTPUT && - spec->src_type == NX_LEARN_SRC_FIELD)) { - /* OK. */ - } else { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - - /* Check that the arguments don't overrun the end of the action. */ - if ((char *) end - (char *) p < learn_min_len(header)) { - return OFPERR_OFPBAC_BAD_LEN; - } - - /* Get the source. */ - if (spec->src_type == NX_LEARN_SRC_FIELD) { - get_subfield(spec->n_bits, &p, &spec->src); - } else { - int p_bytes = 2 * DIV_ROUND_UP(spec->n_bits, 16); - - bitwise_copy(p, p_bytes, 0, - &spec->src_imm, sizeof spec->src_imm, 0, - spec->n_bits); - p = (const uint8_t *) p + p_bytes; - } - - /* Get the destination. */ - if (spec->dst_type == NX_LEARN_DST_MATCH || - spec->dst_type == NX_LEARN_DST_LOAD) { - get_subfield(spec->n_bits, &p, &spec->dst); - } - } - ofpact_update_len(ofpacts, &learn->ofpact); - - if (!is_all_zeros(p, (char *) end - (char *) p)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - - return 0; -} /* Checks that 'learn' is a valid action on 'flow'. Returns 0 if it is valid, * otherwise an OFPERR_*. */ @@ -222,79 +77,6 @@ return 0; } -static void -put_be16(struct ofpbuf *b, ovs_be16 x) -{ - ofpbuf_put(b, &x, sizeof x); -} - -static void -put_be32(struct ofpbuf *b, ovs_be32 x) -{ - ofpbuf_put(b, &x, sizeof x); -} - -static void -put_u16(struct ofpbuf *b, uint16_t x) -{ - put_be16(b, htons(x)); -} - -static void -put_u32(struct ofpbuf *b, uint32_t x) -{ - put_be32(b, htonl(x)); -} - -/* Converts 'learn' into a "struct nx_action_learn" and appends that action to - * 'ofpacts'. */ -void -learn_to_nxast(const struct ofpact_learn *learn, struct ofpbuf *openflow) -{ - const struct ofpact_learn_spec *spec; - struct nx_action_learn *nal; - size_t start_ofs; - - start_ofs = ofpbuf_size(openflow); - nal = ofputil_put_NXAST_LEARN(openflow); - nal->idle_timeout = htons(learn->idle_timeout); - nal->hard_timeout = htons(learn->hard_timeout); - nal->fin_idle_timeout = htons(learn->fin_idle_timeout); - nal->fin_hard_timeout = htons(learn->fin_hard_timeout); - nal->priority = htons(learn->priority); - nal->cookie = htonll(learn->cookie); - nal->flags = htons(learn->flags); - nal->table_id = learn->table_id; - - for (spec = learn->specs; spec < &learn->specs[learn->n_specs]; spec++) { - put_u16(openflow, spec->n_bits | spec->dst_type | spec->src_type); - - if (spec->src_type == NX_LEARN_SRC_FIELD) { - put_u32(openflow, spec->src.field->nxm_header); - put_u16(openflow, spec->src.ofs); - } else { - size_t n_dst_bytes = 2 * DIV_ROUND_UP(spec->n_bits, 16); - uint8_t *bits = ofpbuf_put_zeros(openflow, n_dst_bytes); - bitwise_copy(&spec->src_imm, sizeof spec->src_imm, 0, - bits, n_dst_bytes, 0, - spec->n_bits); - } - - if (spec->dst_type == NX_LEARN_DST_MATCH || - spec->dst_type == NX_LEARN_DST_LOAD) { - put_u32(openflow, spec->dst.field->nxm_header); - put_u16(openflow, spec->dst.ofs); - } - } - - if ((ofpbuf_size(openflow) - start_ofs) % 8) { - ofpbuf_put_zeros(openflow, 8 - (ofpbuf_size(openflow) - start_ofs) % 8); - } - - nal = ofpbuf_at_assert(openflow, start_ofs, sizeof *nal); - nal->len = htons(ofpbuf_size(openflow) - start_ofs); -} - /* Composes 'fm' so that executing it will implement 'learn' given that the * packet being processed has 'flow' as its flow. * @@ -313,17 +95,22 @@ fm->priority = learn->priority; fm->cookie = htonll(0); fm->cookie_mask = htonll(0); - fm->new_cookie = htonll(learn->cookie); + fm->new_cookie = learn->cookie; fm->modify_cookie = fm->new_cookie != OVS_BE64_MAX; fm->table_id = learn->table_id; fm->command = OFPFC_MODIFY_STRICT; fm->idle_timeout = learn->idle_timeout; fm->hard_timeout = learn->hard_timeout; + fm->importance = 0; fm->buffer_id = UINT32_MAX; fm->out_port = OFPP_NONE; - fm->flags = learn->flags; + fm->flags = 0; + if (learn->flags & NX_LEARN_F_SEND_FLOW_REM) { + fm->flags |= OFPUTIL_FF_SEND_FLOW_REM; + } fm->ofpacts = NULL; fm->ofpacts_len = 0; + fm->delete_reason = OFPRR_DELETE; if (learn->fin_idle_timeout || learn->fin_hard_timeout) { struct ofpact_fin_timeout *oft; @@ -334,8 +121,8 @@ } for (spec = learn->specs; spec < &learn->specs[learn->n_specs]; spec++) { + struct ofpact_set_field *sf; union mf_subvalue value; - int chunk, ofs; if (spec->src_type == NX_LEARN_SRC_FIELD) { mf_read_subfield(&spec->src, flow, &value); @@ -349,25 +136,20 @@ break; case NX_LEARN_DST_LOAD: - for (ofs = 0; ofs < spec->n_bits; ofs += chunk) { - struct ofpact_reg_load *load; - - chunk = MIN(spec->n_bits - ofs, 64); - - load = ofpact_put_REG_LOAD(ofpacts); - load->dst.field = spec->dst.field; - load->dst.ofs = spec->dst.ofs + ofs; - load->dst.n_bits = chunk; - bitwise_copy(&value, sizeof value, ofs, - &load->subvalue, sizeof load->subvalue, 0, - chunk); - } + sf = ofpact_put_reg_load(ofpacts); + sf->field = spec->dst.field; + bitwise_copy(&value, sizeof value, 0, + &sf->value, spec->dst.field->n_bytes, spec->dst.ofs, + spec->n_bits); + bitwise_one(&sf->mask, spec->dst.field->n_bytes, spec->dst.ofs, + spec->n_bits); break; case NX_LEARN_DST_OUTPUT: if (spec->n_bits <= 16 || is_all_zeros(value.u8, sizeof value - 2)) { - ofp_port_t port = u16_to_ofp(ntohs(value.be16[7])); + ovs_be16 *last_be16 = &value.be16[ARRAY_SIZE(value.be16) - 1]; + ofp_port_t port = u16_to_ofp(ntohs(*last_be16)); if (ofp_to_u16(port) < ofp_to_u16(OFPP_MAX) || port == OFPP_IN_PORT @@ -382,8 +164,8 @@ } ofpact_pad(ofpacts); - fm->ofpacts = ofpbuf_data(ofpacts); - fm->ofpacts_len = ofpbuf_size(ofpacts); + fm->ofpacts = ofpacts->data; + fm->ofpacts_len = ofpacts->size; } /* Perform a bitwise-OR on 'wc''s fields that are relevant as sources in @@ -404,32 +186,18 @@ /* Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT learn_parse_load_immediate(const char *s, struct ofpact_learn_spec *spec) { const char *full_s = s; - const char *arrow = strstr(s, "->"); struct mf_subfield dst; union mf_subvalue imm; char *error; + int err; - memset(&imm, 0, sizeof imm); - if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X') && arrow) { - const char *in = arrow - 1; - uint8_t *out = imm.u8 + sizeof imm.u8 - 1; - int n = arrow - (s + 2); - int i; - - for (i = 0; i < n; i++) { - int hexit = hexit_value(in[-i]); - if (hexit < 0) { - return xasprintf("%s: bad hex digit in value", full_s); - } - out[-(i / 2)] |= i % 2 ? hexit << 4 : hexit; - } - s = arrow; - } else { - imm.be64[1] = htonll(strtoull(s, (char **) &s, 0)); + err = parse_int_string(s, imm.u8, sizeof imm.u8, (char **) &s); + if (err) { + return xasprintf("%s: too many bits in immediate value", full_s); } if (strncmp(s, "->", 2)) { @@ -441,6 +209,10 @@ if (error) { return error; } + if (!mf_nxm_header(dst.field->id)) { + return xasprintf("%s: experimenter OXM field '%s' not supported", + full_s, s); + } if (!bitwise_is_all_zeros(&imm, sizeof imm, dst.n_bits, (8 * sizeof imm) - dst.n_bits)) { @@ -458,7 +230,7 @@ /* Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT learn_parse_spec(const char *orig, char *name, char *value, struct ofpact_learn_spec *spec) { @@ -489,6 +261,10 @@ if (error) { return error; } + if (!mf_nxm_header(spec->dst.field->id)) { + return xasprintf("%s: experimenter OXM field '%s' not supported", + orig, name); + } /* Parse source and check prerequisites. */ if (value[0] != '\0') { @@ -547,7 +323,7 @@ /* Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT learn_parse__(char *orig, char *arg, struct ofpbuf *ofpacts) { struct ofpact_learn *learn; @@ -579,13 +355,17 @@ } else if (!strcmp(name, "fin_hard_timeout")) { learn->fin_hard_timeout = atoi(value); } else if (!strcmp(name, "cookie")) { - learn->cookie = strtoull(value, NULL, 0); + learn->cookie = htonll(strtoull(value, NULL, 0)); + } else if (!strcmp(name, "send_flow_rem")) { + learn->flags |= NX_LEARN_F_SEND_FLOW_REM; + } else if (!strcmp(name, "delete_learned")) { + learn->flags |= NX_LEARN_F_DELETE_LEARNED; } else { struct ofpact_learn_spec *spec; char *error; spec = ofpbuf_put_zeros(ofpacts, sizeof *spec); - learn = ofpacts->frame; + learn = ofpacts->header; learn->n_specs++; error = learn_parse_spec(orig, name, value, spec); @@ -618,7 +398,7 @@ * the action's arguments. * * Modifies 'arg'. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT learn_parse(char *arg, struct ofpbuf *ofpacts) { char *orig = xstrdup(arg); @@ -653,11 +433,14 @@ if (learn->priority != OFP_DEFAULT_PRIORITY) { ds_put_format(s, ",priority=%"PRIu16, learn->priority); } - if (learn->flags & OFPFF_SEND_FLOW_REM) { - ds_put_cstr(s, ",OFPFF_SEND_FLOW_REM"); + if (learn->flags & NX_LEARN_F_SEND_FLOW_REM) { + ds_put_cstr(s, ",send_flow_rem"); + } + if (learn->flags & NX_LEARN_F_DELETE_LEARNED) { + ds_put_cstr(s, ",delete_learned"); } if (learn->cookie != 0) { - ds_put_format(s, ",cookie=%#"PRIx64, learn->cookie); + ds_put_format(s, ",cookie=%#"PRIx64, ntohll(learn->cookie)); } for (spec = learn->specs; spec < &learn->specs[learn->n_specs]; spec++) { diff -Nru openvswitch-2.3.1/lib/learn.h openvswitch-2.4.0~git20150623/lib/learn.h --- openvswitch-2.3.1/lib/learn.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/learn.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,16 +33,12 @@ * See include/openflow/nicira-ext.h for NXAST_LEARN specification. */ -enum ofperr learn_from_openflow(const struct nx_action_learn *, - struct ofpbuf *ofpacts); enum ofperr learn_check(const struct ofpact_learn *, const struct flow *); -void learn_to_nxast(const struct ofpact_learn *, struct ofpbuf *openflow); - void learn_execute(const struct ofpact_learn *, const struct flow *, struct ofputil_flow_mod *, struct ofpbuf *ofpacts); void learn_mask(const struct ofpact_learn *, struct flow_wildcards *); -char *learn_parse(char *, struct ofpbuf *ofpacts) WARN_UNUSED_RESULT; +char *learn_parse(char *, struct ofpbuf *ofpacts) OVS_WARN_UNUSED_RESULT; void learn_format(const struct ofpact_learn *, struct ds *); #endif /* learn.h */ diff -Nru openvswitch-2.3.1/lib/learning-switch.c openvswitch-2.4.0~git20150623/lib/learning-switch.c --- openvswitch-2.3.1/lib/learning-switch.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/learning-switch.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include "byte-order.h" #include "classifier.h" +#include "dp-packet.h" #include "flow.h" #include "hmap.h" #include "mac-learning.h" @@ -41,8 +42,8 @@ #include "shash.h" #include "simap.h" #include "timeval.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(learning_switch); @@ -105,6 +106,13 @@ static void process_packet_in(struct lswitch *, const struct ofp_header *); static void process_echo_request(struct lswitch *, const struct ofp_header *); +static ofp_port_t get_mac_entry_ofp_port(const struct mac_learning *ml, + const struct mac_entry *) + OVS_REQ_RDLOCK(ml->rwlock); +static void set_mac_entry_ofp_port(struct mac_learning *ml, + struct mac_entry *, ofp_port_t) + OVS_REQ_WRLOCK(ml->rwlock); + /* Creates and returns a new learning switch whose configuration is given by * 'cfg'. * @@ -173,10 +181,51 @@ lswitch_handshake(struct lswitch *sw) { enum ofputil_protocol protocol; + enum ofp_version version; send_features_request(sw); - protocol = ofputil_protocol_from_ofp_version(rconn_get_version(sw->rconn)); + version = rconn_get_version(sw->rconn); + protocol = ofputil_protocol_from_ofp_version(version); + if (version >= OFP13_VERSION) { + /* OpenFlow 1.3 and later by default drop packets that miss in the flow + * table. Set up a flow to send packets to the controller by + * default. */ + struct ofputil_flow_mod fm; + struct ofpact_output output; + struct ofpbuf *msg; + int error; + + ofpact_init_OUTPUT(&output); + output.port = OFPP_CONTROLLER; + output.max_len = OFP_DEFAULT_MISS_SEND_LEN; + + match_init_catchall(&fm.match); + fm.priority = 0; + fm.cookie = 0; + fm.cookie_mask = 0; + fm.new_cookie = 0; + fm.modify_cookie = false; + fm.table_id = 0; + fm.command = OFPFC_ADD; + fm.idle_timeout = 0; + fm.hard_timeout = 0; + fm.importance = 0; + fm.buffer_id = UINT32_MAX; + fm.out_port = OFPP_NONE; + fm.out_group = OFPG_ANY; + fm.flags = 0; + fm.ofpacts = &output.ofpact; + fm.ofpacts_len = sizeof output; + fm.delete_reason = 0; + + msg = ofputil_encode_flow_mod(&fm, protocol); + error = rconn_send(sw->rconn, msg, NULL); + if (error) { + VLOG_INFO_RL(&rl, "%s: failed to add default flow (%s)", + rconn_get_name(sw->rconn), ovs_strerror(error)); + } + } if (sw->default_flows) { struct ofpbuf *msg = NULL; int error = 0; @@ -315,12 +364,12 @@ switch (type) { case OFPTYPE_ECHO_REQUEST: - process_echo_request(sw, ofpbuf_data(msg)); + process_echo_request(sw, msg->data); break; case OFPTYPE_FEATURES_REPLY: if (sw->state == S_FEATURES_REPLY) { - if (!process_switch_features(sw, ofpbuf_data(msg))) { + if (!process_switch_features(sw, msg->data)) { sw->state = S_SWITCHING; } else { rconn_disconnect(sw->rconn); @@ -329,7 +378,7 @@ break; case OFPTYPE_PACKET_IN: - process_packet_in(sw, ofpbuf_data(msg)); + process_packet_in(sw, msg->data); break; case OFPTYPE_FLOW_REMOVED: @@ -402,7 +451,7 @@ case OFPTYPE_BUNDLE_ADD_MESSAGE: default: if (VLOG_IS_DBG_ENABLED()) { - char *s = ofp_to_string(ofpbuf_data(msg), ofpbuf_size(msg), 2); + char *s = ofp_to_string(msg->data, msg->size, 2); VLOG_DBG_RL(&rl, "%016llx: OpenFlow packet ignored: %s", sw->datapath_id, s); free(s); @@ -485,14 +534,14 @@ if (mac_learning_may_learn(sw->ml, flow->dl_src, 0)) { struct mac_entry *mac = mac_learning_insert(sw->ml, flow->dl_src, 0); - if (mac->port.ofp_port != flow->in_port.ofp_port) { + if (get_mac_entry_ofp_port(sw->ml, mac) + != flow->in_port.ofp_port) { VLOG_DBG_RL(&rl, "%016llx: learned that "ETH_ADDR_FMT" is on " "port %"PRIu16, sw->datapath_id, ETH_ADDR_ARGS(flow->dl_src), flow->in_port.ofp_port); - mac->port.ofp_port = flow->in_port.ofp_port; - mac_learning_changed(sw->ml); + set_mac_entry_ofp_port(sw->ml, mac, flow->in_port.ofp_port); } } ovs_rwlock_unlock(&sw->ml->rwlock); @@ -510,7 +559,7 @@ ovs_rwlock_rdlock(&sw->ml->rwlock); mac = mac_learning_lookup(sw->ml, flow->dl_dst, 0); if (mac) { - out_port = mac->port.ofp_port; + out_port = get_mac_entry_ofp_port(sw->ml, mac); if (out_port == flow->in_port.ofp_port) { /* Don't send a packet back out its input port. */ ovs_rwlock_unlock(&sw->ml->rwlock); @@ -556,7 +605,7 @@ struct ofputil_packet_out po; enum ofperr error; - struct ofpbuf pkt; + struct dp_packet pkt; struct flow flow; error = ofputil_decode_packet_in(&pi, oh); @@ -574,16 +623,16 @@ } /* Extract flow data from 'opi' into 'flow'. */ - ofpbuf_use_const(&pkt, pi.packet, pi.packet_len); - flow_extract(&pkt, NULL, &flow); - flow.in_port.ofp_port = pi.fmd.in_port; - flow.tunnel.tun_id = pi.fmd.tun_id; + dp_packet_use_const(&pkt, pi.packet, pi.packet_len); + flow_extract(&pkt, &flow); + flow.in_port.ofp_port = pi.flow_metadata.flow.in_port.ofp_port; + flow.tunnel.tun_id = pi.flow_metadata.flow.tunnel.tun_id; /* Choose output port. */ out_port = lswitch_choose_destination(sw, &flow); /* Make actions. */ - queue_id = get_queue_id(sw, pi.fmd.in_port); + queue_id = get_queue_id(sw, pi.flow_metadata.flow.in_port.ofp_port); ofpbuf_use_stack(&ofpacts, ofpacts_stub, sizeof ofpacts_stub); if (out_port == OFPP_NONE) { /* No actions. */ @@ -600,15 +649,15 @@ /* Prepare packet_out in case we need one. */ po.buffer_id = pi.buffer_id; if (po.buffer_id == UINT32_MAX) { - po.packet = ofpbuf_data(&pkt); - po.packet_len = ofpbuf_size(&pkt); + po.packet = dp_packet_data(&pkt); + po.packet_len = dp_packet_size(&pkt); } else { po.packet = NULL; po.packet_len = 0; } - po.in_port = pi.fmd.in_port; - po.ofpacts = ofpbuf_data(&ofpacts); - po.ofpacts_len = ofpbuf_size(&ofpacts); + po.in_port = pi.flow_metadata.flow.in_port.ofp_port; + po.ofpacts = ofpacts.data; + po.ofpacts_len = ofpacts.size; /* Send the packet, and possibly the whole flow, to the output port. */ if (sw->max_idle >= 0 && (!sw->ml || out_port != OFPP_FLOOD)) { @@ -620,14 +669,14 @@ memset(&fm, 0, sizeof fm); match_init(&fm.match, &flow, &sw->wc); ofputil_normalize_match_quiet(&fm.match); - fm.priority = 0; + fm.priority = 1; /* Must be > 0 because of table-miss flow entry. */ fm.table_id = 0xff; fm.command = OFPFC_ADD; fm.idle_timeout = sw->max_idle; fm.buffer_id = pi.buffer_id; fm.out_port = OFPP_NONE; - fm.ofpacts = ofpbuf_data(&ofpacts); - fm.ofpacts_len = ofpbuf_size(&ofpacts); + fm.ofpacts = ofpacts.data; + fm.ofpacts_len = ofpacts.size; buffer = ofputil_encode_flow_mod(&fm, sw->protocol); queue_tx(sw, buffer); @@ -650,3 +699,20 @@ { queue_tx(sw, make_echo_reply(rq)); } + +static ofp_port_t +get_mac_entry_ofp_port(const struct mac_learning *ml, + const struct mac_entry *e) + OVS_REQ_RDLOCK(ml->rwlock) +{ + void *port = mac_entry_get_port(ml, e); + return (OVS_FORCE ofp_port_t) (uintptr_t) port; +} + +static void +set_mac_entry_ofp_port(struct mac_learning *ml, + struct mac_entry *e, ofp_port_t ofp_port) + OVS_REQ_WRLOCK(ml->rwlock) +{ + mac_entry_set_port(ml, e, (void *) (OVS_FORCE uintptr_t) ofp_port); +} diff -Nru openvswitch-2.3.1/lib/libopenvswitch.pc.in openvswitch-2.4.0~git20150623/lib/libopenvswitch.pc.in --- openvswitch-2.3.1/lib/libopenvswitch.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/libopenvswitch.pc.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libopenvswitch +Description: Open vSwitch library +Version: @VERSION@ +Libs: -L${libdir} -lopenvswitch +Libs.private: @LIBS@ +Cflags: -I${includedir} diff -Nru openvswitch-2.3.1/lib/libopenvswitch.sym.in openvswitch-2.4.0~git20150623/lib/libopenvswitch.sym.in --- openvswitch-2.3.1/lib/libopenvswitch.sym.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/libopenvswitch.sym.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,4 @@ +libopenvswitch_@LT_CURRENT@ { +global: + *; +}; diff -Nru openvswitch-2.3.1/lib/libsflow.pc.in openvswitch-2.4.0~git20150623/lib/libsflow.pc.in --- openvswitch-2.3.1/lib/libsflow.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/libsflow.pc.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libofproto +Description: sFlow library of Open vSwitch +Version: @VERSION@ +Libs: -L${libdir} -lsflow +Libs.private: @LIBS@ +Cflags: -I${includedir} diff -Nru openvswitch-2.3.1/lib/libsflow.sym.in openvswitch-2.4.0~git20150623/lib/libsflow.sym.in --- openvswitch-2.3.1/lib/libsflow.sym.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/libsflow.sym.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,4 @@ +libsflow_@LT_CURRENT@ { +global: + *; +}; diff -Nru openvswitch-2.3.1/lib/list.c openvswitch-2.4.0~git20150623/lib/list.c --- openvswitch-2.3.1/lib/list.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/list.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include -#include "list.h" - -/* Initializes 'list' as an empty list. */ -void -list_init(struct list *list) -{ - list->next = list->prev = list; -} - -/* Initializes 'list' with pointers that will (probably) cause segfaults if - * dereferenced and, better yet, show up clearly in a debugger. */ -void -list_poison(struct list *list) -{ - memset(list, 0xcc, sizeof *list); -} - -/* Inserts 'elem' just before 'before'. */ -void -list_insert(struct list *before, struct list *elem) -{ - elem->prev = before->prev; - elem->next = before; - before->prev->next = elem; - before->prev = elem; -} - -/* Removes elements 'first' though 'last' (exclusive) from their current list, - then inserts them just before 'before'. */ -void -list_splice(struct list *before, struct list *first, struct list *last) -{ - if (first == last) { - return; - } - last = last->prev; - - /* Cleanly remove 'first'...'last' from its current list. */ - first->prev->next = last->next; - last->next->prev = first->prev; - - /* Splice 'first'...'last' into new list. */ - first->prev = before->prev; - last->next = before; - before->prev->next = first; - before->prev = last; -} - -/* Inserts 'elem' at the beginning of 'list', so that it becomes the front in - 'list'. */ -void -list_push_front(struct list *list, struct list *elem) -{ - list_insert(list->next, elem); -} - -/* Inserts 'elem' at the end of 'list', so that it becomes the back in - * 'list'. */ -void -list_push_back(struct list *list, struct list *elem) -{ - list_insert(list, elem); -} - -/* Puts 'elem' in the position currently occupied by 'position'. - * Afterward, 'position' is not part of a list. */ -void -list_replace(struct list *element, const struct list *position) -{ - element->next = position->next; - element->next->prev = element; - element->prev = position->prev; - element->prev->next = element; -} - -/* Adjusts pointers around 'list' to compensate for 'list' having been moved - * around in memory (e.g. as a consequence of realloc()). - * - * This always works if 'list' is a member of a list, or if 'list' is the head - * of a non-empty list. It fails badly, however, if 'list' is the head of an - * empty list; just use list_init() in that case. */ -void -list_moved(struct list *list) -{ - list->prev->next = list->next->prev = list; -} - -/* Initializes 'dst' with the contents of 'src', compensating for moving it - * around in memory. The effect is that, if 'src' was the head of a list, now - * 'dst' is the head of a list containing the same elements. */ -void -list_move(struct list *dst, struct list *src) -{ - if (!list_is_empty(src)) { - *dst = *src; - list_moved(dst); - } else { - list_init(dst); - } -} - -/* Removes 'elem' from its list and returns the element that followed it. - Undefined behavior if 'elem' is not in a list. */ -struct list * -list_remove(struct list *elem) -{ - elem->prev->next = elem->next; - elem->next->prev = elem->prev; - return elem->next; -} - -/* Removes the front element from 'list' and returns it. Undefined behavior if - 'list' is empty before removal. */ -struct list * -list_pop_front(struct list *list) -{ - struct list *front = list->next; - list_remove(front); - return front; -} - -/* Removes the back element from 'list' and returns it. - Undefined behavior if 'list' is empty before removal. */ -struct list * -list_pop_back(struct list *list) -{ - struct list *back = list->prev; - list_remove(back); - return back; -} - -/* Returns the front element in 'list_'. - Undefined behavior if 'list_' is empty. */ -struct list * -list_front(const struct list *list_) -{ - struct list *list = CONST_CAST(struct list *, list_); - - ovs_assert(!list_is_empty(list)); - return list->next; -} - -/* Returns the back element in 'list_'. - Undefined behavior if 'list_' is empty. */ -struct list * -list_back(const struct list *list_) -{ - struct list *list = CONST_CAST(struct list *, list_); - - ovs_assert(!list_is_empty(list)); - return list->prev; -} - -/* Returns the number of elements in 'list'. - Runs in O(n) in the number of elements. */ -size_t -list_size(const struct list *list) -{ - const struct list *e; - size_t cnt = 0; - - for (e = list->next; e != list; e = e->next) { - cnt++; - } - return cnt; -} - -/* Returns true if 'list' is empty, false otherwise. */ -bool -list_is_empty(const struct list *list) -{ - return list->next == list; -} - -/* Returns true if 'list' has exactly 1 element, false otherwise. */ -bool -list_is_singleton(const struct list *list) -{ - return list_is_short(list) && !list_is_empty(list); -} - -/* Returns true if 'list' has 0 or 1 elements, false otherwise. */ -bool -list_is_short(const struct list *list) -{ - return list->next == list->prev; -} diff -Nru openvswitch-2.3.1/lib/list.h openvswitch-2.4.0~git20150623/lib/list.h --- openvswitch-2.3.1/lib/list.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/list.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,52 +21,46 @@ #include #include #include "util.h" +#include "openvswitch/list.h" -/* Doubly linked list head or element. */ -struct list { - struct list *prev; /* Previous list element. */ - struct list *next; /* Next list element. */ -}; - -#define LIST_INITIALIZER(LIST) { LIST, LIST } - -void list_init(struct list *); -void list_poison(struct list *); +static inline void list_init(struct ovs_list *); +static inline void list_poison(struct ovs_list *); /* List insertion. */ -void list_insert(struct list *, struct list *); -void list_splice(struct list *before, struct list *first, struct list *last); -void list_push_front(struct list *, struct list *); -void list_push_back(struct list *, struct list *); -void list_replace(struct list *, const struct list *); -void list_moved(struct list *); -void list_move(struct list *dst, struct list *src); +static inline void list_insert(struct ovs_list *, struct ovs_list *); +static inline void list_splice(struct ovs_list *before, struct ovs_list *first, + struct ovs_list *last); +static inline void list_push_front(struct ovs_list *, struct ovs_list *); +static inline void list_push_back(struct ovs_list *, struct ovs_list *); +static inline void list_replace(struct ovs_list *, const struct ovs_list *); +static inline void list_moved(struct ovs_list *, const struct ovs_list *orig); +static inline void list_move(struct ovs_list *dst, struct ovs_list *src); /* List removal. */ -struct list *list_remove(struct list *); -struct list *list_pop_front(struct list *); -struct list *list_pop_back(struct list *); +static inline struct ovs_list *list_remove(struct ovs_list *); +static inline struct ovs_list *list_pop_front(struct ovs_list *); +static inline struct ovs_list *list_pop_back(struct ovs_list *); /* List elements. */ -struct list *list_front(const struct list *); -struct list *list_back(const struct list *); +static inline struct ovs_list *list_front(const struct ovs_list *); +static inline struct ovs_list *list_back(const struct ovs_list *); /* List properties. */ -size_t list_size(const struct list *); -bool list_is_empty(const struct list *); -bool list_is_singleton(const struct list *); -bool list_is_short(const struct list *); +static inline size_t list_size(const struct ovs_list *); +static inline bool list_is_empty(const struct ovs_list *); +static inline bool list_is_singleton(const struct ovs_list *); +static inline bool list_is_short(const struct ovs_list *); #define LIST_FOR_EACH(ITER, MEMBER, LIST) \ - for (ASSIGN_CONTAINER(ITER, (LIST)->next, MEMBER); \ + for (INIT_CONTAINER(ITER, (LIST)->next, MEMBER); \ &(ITER)->MEMBER != (LIST); \ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER)) #define LIST_FOR_EACH_CONTINUE(ITER, MEMBER, LIST) \ - for (ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER); \ + for (INIT_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER); \ &(ITER)->MEMBER != (LIST); \ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER)) #define LIST_FOR_EACH_REVERSE(ITER, MEMBER, LIST) \ - for (ASSIGN_CONTAINER(ITER, (LIST)->prev, MEMBER); \ + for (INIT_CONTAINER(ITER, (LIST)->prev, MEMBER); \ &(ITER)->MEMBER != (LIST); \ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER)) #define LIST_FOR_EACH_REVERSE_CONTINUE(ITER, MEMBER, LIST) \ @@ -74,10 +68,207 @@ &(ITER)->MEMBER != (LIST); \ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER)) #define LIST_FOR_EACH_SAFE(ITER, NEXT, MEMBER, LIST) \ - for (ASSIGN_CONTAINER(ITER, (LIST)->next, MEMBER); \ + for (INIT_CONTAINER(ITER, (LIST)->next, MEMBER); \ (&(ITER)->MEMBER != (LIST) \ - ? ASSIGN_CONTAINER(NEXT, (ITER)->MEMBER.next, MEMBER), 1 \ + ? INIT_CONTAINER(NEXT, (ITER)->MEMBER.next, MEMBER), 1 \ : 0); \ (ITER) = (NEXT)) +#define LIST_FOR_EACH_POP(ITER, MEMBER, LIST) \ + while (!list_is_empty(LIST) \ + && (INIT_CONTAINER(ITER, list_pop_front(LIST), MEMBER), 1)) + +/* Inline implementations. */ + +/* Initializes 'list' as an empty list. */ +static inline void +list_init(struct ovs_list *list) +{ + list->next = list->prev = list; +} + +/* Initializes 'list' with pointers that will (probably) cause segfaults if + * dereferenced and, better yet, show up clearly in a debugger. */ +static inline void +list_poison(struct ovs_list *list) +{ + memset(list, 0xcc, sizeof *list); +} + +/* Inserts 'elem' just before 'before'. */ +static inline void +list_insert(struct ovs_list *before, struct ovs_list *elem) +{ + elem->prev = before->prev; + elem->next = before; + before->prev->next = elem; + before->prev = elem; +} + +/* Removes elements 'first' though 'last' (exclusive) from their current list, + then inserts them just before 'before'. */ +static inline void +list_splice(struct ovs_list *before, struct ovs_list *first, struct ovs_list *last) +{ + if (first == last) { + return; + } + last = last->prev; + + /* Cleanly remove 'first'...'last' from its current list. */ + first->prev->next = last->next; + last->next->prev = first->prev; + + /* Splice 'first'...'last' into new list. */ + first->prev = before->prev; + last->next = before; + before->prev->next = first; + before->prev = last; +} + +/* Inserts 'elem' at the beginning of 'list', so that it becomes the front in + 'list'. */ +static inline void +list_push_front(struct ovs_list *list, struct ovs_list *elem) +{ + list_insert(list->next, elem); +} + +/* Inserts 'elem' at the end of 'list', so that it becomes the back in + * 'list'. */ +static inline void +list_push_back(struct ovs_list *list, struct ovs_list *elem) +{ + list_insert(list, elem); +} + +/* Puts 'elem' in the position currently occupied by 'position'. + * Afterward, 'position' is not part of a list. */ +static inline void +list_replace(struct ovs_list *element, const struct ovs_list *position) +{ + element->next = position->next; + element->next->prev = element; + element->prev = position->prev; + element->prev->next = element; +} + +/* Adjusts pointers around 'list' to compensate for 'list' having been moved + * around in memory (e.g. as a consequence of realloc()), with original + * location 'orig'. + * + * ('orig' likely points to freed memory, but this function does not + * dereference 'orig', it only compares it to 'list'. In a very pedantic + * language lawyer sense, this still yields undefined behavior, but it works + * with actual compilers.) */ +static inline void +list_moved(struct ovs_list *list, const struct ovs_list *orig) +{ + if (list->next == orig) { + list_init(list); + } else { + list->prev->next = list->next->prev = list; + } +} + +/* Initializes 'dst' with the contents of 'src', compensating for moving it + * around in memory. The effect is that, if 'src' was the head of a list, now + * 'dst' is the head of a list containing the same elements. */ +static inline void +list_move(struct ovs_list *dst, struct ovs_list *src) +{ + *dst = *src; + list_moved(dst, src); +} + +/* Removes 'elem' from its list and returns the element that followed it. + Undefined behavior if 'elem' is not in a list. */ +static inline struct ovs_list * +list_remove(struct ovs_list *elem) +{ + elem->prev->next = elem->next; + elem->next->prev = elem->prev; + return elem->next; +} + +/* Removes the front element from 'list' and returns it. Undefined behavior if + 'list' is empty before removal. */ +static inline struct ovs_list * +list_pop_front(struct ovs_list *list) +{ + struct ovs_list *front = list->next; + + list_remove(front); + return front; +} + +/* Removes the back element from 'list' and returns it. + Undefined behavior if 'list' is empty before removal. */ +static inline struct ovs_list * +list_pop_back(struct ovs_list *list) +{ + struct ovs_list *back = list->prev; + + list_remove(back); + return back; +} + +/* Returns the front element in 'list_'. + Undefined behavior if 'list_' is empty. */ +static inline struct ovs_list * +list_front(const struct ovs_list *list_) +{ + struct ovs_list *list = CONST_CAST(struct ovs_list *, list_); + + ovs_assert(!list_is_empty(list)); + + return list->next; +} + +/* Returns the back element in 'list_'. + Undefined behavior if 'list_' is empty. */ +static inline struct ovs_list * +list_back(const struct ovs_list *list_) +{ + struct ovs_list *list = CONST_CAST(struct ovs_list *, list_); + + ovs_assert(!list_is_empty(list)); + + return list->prev; +} + +/* Returns the number of elements in 'list'. + Runs in O(n) in the number of elements. */ +static inline size_t +list_size(const struct ovs_list *list) +{ + const struct ovs_list *e; + size_t cnt = 0; + + for (e = list->next; e != list; e = e->next) { + cnt++; + } + return cnt; +} + +/* Returns true if 'list' is empty, false otherwise. */ +static inline bool +list_is_empty(const struct ovs_list *list) +{ + return list->next == list; +} + +/* Returns true if 'list' has exactly 1 element, false otherwise. */ +static inline bool +list_is_singleton(const struct ovs_list *list) +{ + return list_is_short(list) && !list_is_empty(list); +} + +/* Returns true if 'list' has 0 or 1 elements, false otherwise. */ +static inline bool +list_is_short(const struct ovs_list *list) +{ + return list->next == list->prev; +} #endif /* list.h */ diff -Nru openvswitch-2.3.1/lib/lldp/aa-structs.h openvswitch-2.4.0~git20150623/lib/lldp/aa-structs.h --- openvswitch-2.3.1/lib/lldp/aa-structs.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/aa-structs.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,52 @@ +/* aa-structs.h */ +/* contains tlv structures for various auto attach functionality */ + +/* Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2014 Avaya, Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef AA_STRUCTS_H +#define AA_STRUCTS_H + +#include +#include "list.h" + +struct lldp_aa_element_system_id { + uint8_t system_mac[6]; + uint16_t conn_type; + uint16_t rsvd; + uint8_t rsvd2[2]; +}; + +struct lldpd_aa_element_tlv { + uint16_t type; + uint16_t vlan_tagging; + uint16_t auto_prov_mode; + uint16_t mgmt_vlan; + struct lldp_aa_element_system_id system_id; +}; + +struct lldpd_aa_isid_vlan_map_data { + uint16_t status; + uint16_t vlan; + uint32_t isid; +}; + +struct lldpd_aa_isid_vlan_maps_tlv { + struct ovs_list m_entries; + struct lldpd_aa_isid_vlan_map_data isid_vlan_data; +}; + +#endif diff -Nru openvswitch-2.3.1/lib/lldp/lldp.c openvswitch-2.4.0~git20150623/lib/lldp/lldp.c --- openvswitch-2.3.1/lib/lldp/lldp.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/lldp.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,652 @@ +/* -*- mode: c; c-file-style: "openbsd" -*- */ +/* + * Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2008 Vincent Bernat + * Copyright (c) 2014 Michael Chapman + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include "lldpd.h" +#include +#include +#include +#include +#include +#include +#include "compiler.h" +#include "dp-packet.h" +#include "packets.h" + +VLOG_DEFINE_THIS_MODULE(lldp); + +/* This set of macro are used to parse packets. The current position in buffer + * is `pos'. The length of the remaining space in buffer is `length'. There is + * no check on boundaries. + */ + +#define PEEK(type, func) \ + ( \ + memcpy(&type, pos, sizeof type), \ + length -= sizeof type, \ + pos += sizeof type, \ + func(type) \ + ) +#define PEEK_UINT8 PEEK(types.f_uint8, ) +#define PEEK_UINT16 PEEK(types.f_uint16, ntohs) +#define PEEK_UINT32 PEEK(types.f_uint32, ntohl) +#define PEEK_BYTES(value, bytes) \ + do { \ + memcpy(value, pos, bytes); \ + length -= (bytes); \ + pos += (bytes); \ + } while (0) +#define PEEK_DISCARD(bytes) \ + do { \ + length -= (bytes); \ + pos += (bytes); \ + } while (0) +#define PEEK_DISCARD_UINT8 PEEK_DISCARD(1) +#define PEEK_DISCARD_UINT16 PEEK_DISCARD(2) +#define PEEK_DISCARD_UINT32 PEEK_DISCARD(3) +#define PEEK_CMP(value, bytes) \ + (length -= (bytes), \ + pos += (bytes), \ + memcmp(pos-bytes, value, bytes)) +#define CHECK_TLV_SIZE(x, name) \ + do { \ + if (tlv_size < (x)) { \ + VLOG_WARN(name " TLV too short received on %s", \ + hardware->h_ifname); \ + goto malformed; \ + } \ + } while (0) +#define PEEK_SAVE(where) (where = pos, 1) + +static union { + uint8_t f_uint8; + ovs_be16 f_uint16; + ovs_be32 f_uint32; +} types; + +static int +lldpd_af_to_lldp_proto(int af) +{ + switch (af) { + case LLDPD_AF_IPV4: + return LLDP_MGMT_ADDR_IP4; + case LLDPD_AF_IPV6: + return LLDP_MGMT_ADDR_IP6; + default: + return LLDP_MGMT_ADDR_NONE; + } +} + +static int +lldpd_af_from_lldp_proto(int proto) +{ + switch (proto) { + case LLDP_MGMT_ADDR_IP4: + return LLDPD_AF_IPV4; + case LLDP_MGMT_ADDR_IP6: + return LLDPD_AF_IPV6; + default: + return LLDPD_AF_UNSPEC; + } +} + +static void +lldp_tlv_put_u8(struct dp_packet *p, uint8_t x) +{ + dp_packet_put(p, &x, sizeof x); +} + +static void +lldp_tlv_put_u16(struct dp_packet *p, uint16_t x) +{ + ovs_be16 nx = htons(x); + dp_packet_put(p, &nx, sizeof nx); +} + +static void +lldp_tlv_put_u32(struct dp_packet *p, uint32_t x) +{ + ovs_be32 nx = htonl(x); + dp_packet_put(p, &nx, sizeof nx); +} + +static void +lldp_tlv_put_isid(struct dp_packet *p, uint32_t isid) +{ + uint8_t *data = dp_packet_put_uninit(p, 3); + data[0] = isid >> 16; + data[1] = isid >> 8; + data[2] = isid; +} + +static void +lldp_tlv_start(struct dp_packet *p, uint8_t tlv, unsigned int *start) +{ + *start = dp_packet_size(p); + lldp_tlv_put_u16(p, tlv << 9); +} + +static void +lldp_tlv_end(struct dp_packet *p, unsigned int start) +{ + ovs_be16 *tlv = dp_packet_at_assert(p, start, 2); + *tlv |= htons((dp_packet_size(p) - (start + 2)) & 0x1ff); +} + +int +lldp_send(struct lldpd *global OVS_UNUSED, + struct lldpd_hardware *hardware, + struct dp_packet *p) +{ + unsigned int orig_size = dp_packet_size(p); + unsigned int start; + + struct lldpd_port *port; + struct lldpd_chassis *chassis; + struct lldpd_mgmt *mgmt; + const uint8_t avaya[] = LLDP_TLV_ORG_AVAYA; + struct lldpd_aa_isid_vlan_maps_tlv *vlan_isid_map; + uint8_t msg_auth_digest[LLDP_TLV_AA_ISID_VLAN_DIGEST_LENGTH]; + + port = &hardware->h_lport; + chassis = port->p_chassis; + + /* The ethernet header is filled in elsewhere, we must save room for it. */ + VLOG_DBG("LLDP PDU send to %s mtu %d incoming", + hardware->h_ifname, hardware->h_mtu); + + /* Chassis ID */ + lldp_tlv_start(p, LLDP_TLV_CHASSIS_ID, &start); + lldp_tlv_put_u8(p, chassis->c_id_subtype); + dp_packet_put(p, chassis->c_id, chassis->c_id_len); + lldp_tlv_end(p, start); + + /* Port ID */ + lldp_tlv_start(p, LLDP_TLV_PORT_ID, &start); + lldp_tlv_put_u8(p, port->p_id_subtype); + dp_packet_put(p, port->p_id, port->p_id_len); + lldp_tlv_end(p, start); + + /* Time to live */ + lldp_tlv_start(p, LLDP_TLV_TTL, &start); + lldp_tlv_put_u16(p, chassis->c_ttl); + lldp_tlv_end(p, start); + + /* System name */ + if (chassis->c_name && *chassis->c_name != '\0') { + lldp_tlv_start(p, LLDP_TLV_SYSTEM_NAME, &start); + dp_packet_put(p, chassis->c_name, strlen(chassis->c_name)); + lldp_tlv_end(p, start); + } + + /* System description (skip it if empty) */ + if (chassis->c_descr && *chassis->c_descr != '\0') { + lldp_tlv_start(p, LLDP_TLV_SYSTEM_DESCR, &start); + dp_packet_put(p, chassis->c_descr, strlen(chassis->c_descr)); + lldp_tlv_end(p, start); + } + + /* System capabilities */ + lldp_tlv_start(p, LLDP_TLV_SYSTEM_CAP, &start); + lldp_tlv_put_u16(p, chassis->c_cap_available); + lldp_tlv_put_u16(p, chassis->c_cap_enabled); + lldp_tlv_end(p, start); + + LIST_FOR_EACH (mgmt, m_entries, &chassis->c_mgmt) { + lldp_tlv_start(p, LLDP_TLV_MGMT_ADDR, &start); + lldp_tlv_put_u8(p, mgmt->m_addrsize + 1); + lldp_tlv_put_u8(p, lldpd_af_to_lldp_proto(mgmt->m_family)); + dp_packet_put(p, &mgmt->m_addr, mgmt->m_addrsize); + + /* Interface port type, OID */ + if (mgmt->m_iface == 0) { + /* We don't know the management interface */ + lldp_tlv_put_u8(p, LLDP_MGMT_IFACE_UNKNOWN); + lldp_tlv_put_u32(p, 0); + } else { + /* We have the index of the management interface */ + lldp_tlv_put_u8(p, LLDP_MGMT_IFACE_IFINDEX); + lldp_tlv_put_u32(p, mgmt->m_iface); + } + lldp_tlv_put_u8(p, 0); + lldp_tlv_end(p, start); + } + + /* Port description */ + if (port->p_descr && *port->p_descr != '\0') { + lldp_tlv_start(p, LLDP_TLV_PORT_DESCR, &start); + dp_packet_put(p, port->p_descr, strlen(port->p_descr)); + lldp_tlv_end(p, start); + } + + /* Add Auto Attach tlvs V3.1 to packet. LLDP FA element v3.1 format: + TLV Type[127] TLV Length[50 octets] Avaya OUI[00-04-0D] Subtype[11] + 7 bits 9 bits 3 octets 1 octet + HMAC-SHA Digest Element Type State Mgmt VLAN Rsvd System ID + 32 octets 6 bits 6 bits 12 bits 1 octet 10 octets + */ + /* AA-ELEMENT */ + if (port->p_element.type != 0) { + u_int16_t aa_element_first_word = 0; + u_int16_t aa_element_second_word = 0; + u_int16_t aa_element_state = 0; + u_int8_t aa_elem_sys_id_first_byte; + u_int8_t aa_elem_sys_id_second_byte; + + /* Link VLAN Tagging Requirements (bit 1), + * Automatic Provisioning Mode (bit 2/3) (left to right, 1 based) */ + aa_element_state = ((port->p_element.vlan_tagging & 0x1) << 5) | + ((port->p_element.auto_prov_mode & 0x3) << 3); + + /* Element first word should be first 6 most significant bits of + * element type, bitwise OR that with the next 6 bits of the state, + * bitwise OR with the first 4 bits of mgmt vlan id. + * Element type should be LLDP_TLV_AA_ELEM_TYPE_VIRTUAL_SWITCH for + * AA client */ + aa_element_first_word = (port->p_element.type << 10) | + (aa_element_state << 4) | + ((port->p_element.mgmt_vlan & 0x0F00)>> 8); + + /* Element second type should be the first 8 most significant bits + * of the remaining 8 bits of mgmt vlan id. */ + aa_element_second_word = (port->p_element.mgmt_vlan & 0xFF) << 8; + + /* System id first byte should be first 3 most significant bits of + * connecion type, bitwise OR that with the device state and bitwise + * OR that with the first 2 most significant bitsof rsvd (10 bits). */ + aa_elem_sys_id_first_byte = + ((port->p_element.system_id.conn_type & 0x7) << 5) | + ((port->p_element.system_id.rsvd >> 8) & 0x3); + + /* Second byte should just be the remaining 8 bits of 10 bits rsvd */ + aa_elem_sys_id_second_byte = + (port->p_element.system_id.rsvd & 0xFF); + + memset(msg_auth_digest, 0, sizeof msg_auth_digest); + + lldp_tlv_start(p, LLDP_TLV_ORG, &start); + dp_packet_put(p, avaya, sizeof avaya); + lldp_tlv_put_u8(p, LLDP_TLV_AA_ELEMENT_SUBTYPE); + dp_packet_put(p, msg_auth_digest, sizeof msg_auth_digest); + lldp_tlv_put_u16(p, aa_element_first_word); + lldp_tlv_put_u16(p, aa_element_second_word); + dp_packet_put(p, &port->p_element.system_id.system_mac, + sizeof port->p_element.system_id.system_mac); + lldp_tlv_put_u8(p, aa_elem_sys_id_first_byte); + lldp_tlv_put_u8(p, aa_elem_sys_id_second_byte); + dp_packet_put(p, &port->p_element.system_id.rsvd2, + sizeof port->p_element.system_id.rsvd2); + lldp_tlv_end(p, start); + } + + if (!list_is_empty(&port->p_isid_vlan_maps)) { + + memset(msg_auth_digest, 0, sizeof msg_auth_digest); + + lldp_tlv_start(p, LLDP_TLV_ORG, &start); + dp_packet_put(p, avaya, sizeof avaya); + lldp_tlv_put_u8(p, LLDP_TLV_AA_ISID_VLAN_ASGNS_SUBTYPE); + dp_packet_put(p, msg_auth_digest, sizeof msg_auth_digest); + + LIST_FOR_EACH (vlan_isid_map, + m_entries, + &hardware->h_lport.p_isid_vlan_maps) { + u_int16_t status_vlan_word; + status_vlan_word = + (vlan_isid_map->isid_vlan_data.status << 12) | + vlan_isid_map->isid_vlan_data.vlan; + + lldp_tlv_put_u16(p, status_vlan_word); + lldp_tlv_put_isid(p, vlan_isid_map->isid_vlan_data.isid); + } + + lldp_tlv_end(p, start); + } + + /* END */ + lldp_tlv_start(p, LLDP_TLV_END, &start); + lldp_tlv_end(p, start); + + hardware->h_tx_cnt++; + + const char *lldp = dp_packet_at_assert(p, orig_size, 0); + unsigned int lldp_len = dp_packet_size(p) - orig_size; + if (!hardware->h_lport.p_lastframe + || hardware->h_lport.p_lastframe->size != lldp_len + || memcmp(hardware->h_lport.p_lastframe->frame, lldp, lldp_len)) { + + struct lldpd_frame *frame = xmalloc(sizeof *frame + lldp_len); + frame->size = lldp_len; + memcpy(frame->frame, lldp, lldp_len); + free(hardware->h_lport.p_lastframe); + hardware->h_lport.p_lastframe = frame; + hardware->h_lport.p_lastchange = time(NULL); + } + + return dp_packet_size(p); +} + +int +lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s, + struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis, + struct lldpd_port **newport) +{ + struct lldpd_chassis *chassis; + struct lldpd_port *port; + const char lldpaddr[] = LLDP_MULTICAST_ADDR; + const char dot1[] = LLDP_TLV_ORG_DOT1; + const char dot3[] = LLDP_TLV_ORG_DOT3; + const char med[] = LLDP_TLV_ORG_MED; + const char avaya_oid[] = LLDP_TLV_ORG_AVAYA; + const char dcbx[] = LLDP_TLV_ORG_DCBX; + char orgid[3]; + int length, af; + bool gotend = false; + bool ttl_received = false; + int tlv_size, tlv_type, tlv_subtype; + u_int8_t *pos, *tlv; + void *b; + struct lldpd_aa_isid_vlan_maps_tlv *isid_vlan_map = NULL; + u_int8_t msg_auth_digest[LLDP_TLV_AA_ISID_VLAN_DIGEST_LENGTH]; + struct lldpd_mgmt *mgmt; + u_int8_t addr_str_length, addr_str_buffer[32]; + u_int8_t addr_family, addr_length, *addr_ptr, iface_subtype; + u_int32_t iface_number, iface; + + VLOG_DBG("receive LLDP PDU on %s", hardware->h_ifname); + + chassis = xzalloc(sizeof *chassis); + list_init(&chassis->c_mgmt); + + port = xzalloc(sizeof *port); + list_init(&port->p_isid_vlan_maps); + + length = s; + pos = (u_int8_t*) frame; + + if (length < 2 * ETH_ADDR_LEN + sizeof(u_int16_t)) { + VLOG_WARN("too short frame received on %s", hardware->h_ifname); + goto malformed; + } + if (PEEK_CMP(lldpaddr, ETH_ADDR_LEN) != 0) { + VLOG_INFO("frame not targeted at LLDP multicast address " + "received on %s", hardware->h_ifname); + goto malformed; + } + + PEEK_DISCARD(ETH_ADDR_LEN); /* Skip source address */ + if (PEEK_UINT16 != ETHERTYPE_LLDP) { + VLOG_INFO("non LLDP frame received on %s", hardware->h_ifname); + goto malformed; + } + + while (length && !gotend) { + if (length < 2) { + VLOG_WARN("tlv header too short received on %s", + hardware->h_ifname); + goto malformed; + } + tlv_size = PEEK_UINT16; + tlv_type = tlv_size >> 9; + tlv_size = tlv_size & 0x1ff; + (void) PEEK_SAVE(tlv); + if (length < tlv_size) { + VLOG_WARN("frame too short for tlv received on %s", + hardware->h_ifname); + goto malformed; + } + + switch (tlv_type) { + case LLDP_TLV_END: + if (tlv_size != 0) { + VLOG_WARN("lldp end received with size not null on %s", + hardware->h_ifname); + goto malformed; + } + if (length) { + VLOG_DBG("extra data after lldp end on %s", + hardware->h_ifname); + } + gotend = true; + break; + + case LLDP_TLV_CHASSIS_ID: + case LLDP_TLV_PORT_ID: + CHECK_TLV_SIZE(2, "Port Id"); + tlv_subtype = PEEK_UINT8; + if (tlv_subtype == 0 || tlv_subtype > 7) { + VLOG_WARN("unknown subtype for tlv id received on %s", + hardware->h_ifname); + goto malformed; + } + b = xzalloc(tlv_size - 1); + PEEK_BYTES(b, tlv_size - 1); + if (tlv_type == LLDP_TLV_PORT_ID) { + port->p_id_subtype = tlv_subtype; + port->p_id = b; + port->p_id_len = tlv_size - 1; + } else { + chassis->c_id_subtype = tlv_subtype; + chassis->c_id = b; + chassis->c_id_len = tlv_size - 1; + } + break; + + case LLDP_TLV_TTL: + CHECK_TLV_SIZE(2, "TTL"); + chassis->c_ttl = PEEK_UINT16; + ttl_received = true; + break; + + case LLDP_TLV_PORT_DESCR: + case LLDP_TLV_SYSTEM_NAME: + case LLDP_TLV_SYSTEM_DESCR: + if (tlv_size < 1) { + VLOG_DBG("empty tlv received on %s", hardware->h_ifname); + break; + } + b = xzalloc(tlv_size + 1); + PEEK_BYTES(b, tlv_size); + if (tlv_type == LLDP_TLV_PORT_DESCR) { + port->p_descr = b; + } else if (tlv_type == LLDP_TLV_SYSTEM_NAME) { + chassis->c_name = b; + } else { + chassis->c_descr = b; + } + break; + + case LLDP_TLV_SYSTEM_CAP: + CHECK_TLV_SIZE(4, "System capabilities"); + chassis->c_cap_available = PEEK_UINT16; + chassis->c_cap_enabled = PEEK_UINT16; + break; + + case LLDP_TLV_MGMT_ADDR: + CHECK_TLV_SIZE(1, "Management address"); + addr_str_length = PEEK_UINT8; + CHECK_TLV_SIZE(1 + addr_str_length, "Management address"); + PEEK_BYTES(addr_str_buffer, addr_str_length); + addr_length = addr_str_length - 1; + addr_family = addr_str_buffer[0]; + addr_ptr = &addr_str_buffer[1]; + CHECK_TLV_SIZE(1 + addr_str_length + 5, "Management address"); + iface_subtype = PEEK_UINT8; + iface_number = PEEK_UINT32; + + af = lldpd_af_from_lldp_proto(addr_family); + if (af == LLDPD_AF_UNSPEC) { + break; + } + iface = iface_subtype == LLDP_MGMT_IFACE_IFINDEX ? + iface_number : 0; + mgmt = lldpd_alloc_mgmt(af, addr_ptr, addr_length, iface); + if (mgmt == NULL) { + VLOG_WARN("unable to allocate memory for management address"); + goto malformed; + } + list_push_back(&chassis->c_mgmt, &mgmt->m_entries); + break; + + case LLDP_TLV_ORG: + CHECK_TLV_SIZE(4, "Organisational"); + PEEK_BYTES(orgid, sizeof orgid); + tlv_subtype = PEEK_UINT8; + if (memcmp(dot1, orgid, sizeof orgid) == 0) { + hardware->h_rx_unrecognized_cnt++; + } else if (memcmp(dot3, orgid, sizeof orgid) == 0) { + hardware->h_rx_unrecognized_cnt++; + } else if (memcmp(med, orgid, sizeof orgid) == 0) { + /* LLDP-MED */ + hardware->h_rx_unrecognized_cnt++; + } else if (memcmp(avaya_oid, orgid, sizeof orgid) == 0) { + u_int32_t aa_element_dword; + u_int16_t aa_system_id_word; + u_int16_t aa_status_vlan_word; + u_int8_t aa_element_state; + unsigned short num_mappings; + + switch(tlv_subtype) { + case LLDP_TLV_AA_ELEMENT_SUBTYPE: + PEEK_BYTES(&msg_auth_digest, sizeof msg_auth_digest); + + aa_element_dword = PEEK_UINT32; + + /* Type is first 6 most-significant bits of + * aa_element_dword */ + port->p_element.type = aa_element_dword >> 26; + + /* State is 6 most significant bits of aa_element_dword */ + aa_element_state = (aa_element_dword >> 20) & 0x3F; + + /* vlan tagging requirement is the bit 1(left to right) + * of the 6 bits state (1 based) */ + port->p_element.vlan_tagging = + (aa_element_state >> 5) & 0x1; + + /* Automatic provision mode is the bit 2/3(left to right) + * of the 6 bits state (1 based) */ + port->p_element.auto_prov_mode = + (aa_element_state >> 3) & 0x3; + + /* mgmt_vlan is the 12 bits of aa_element_dword from + * bit 12 */ + port->p_element.mgmt_vlan = + (aa_element_dword >> 8) & 0xFFF; + VLOG_INFO("Element type: %X, vlan tagging %X, " + "auto prov mode %x, Mgmt vlan: %X", + port->p_element.type, + port->p_element.vlan_tagging, + port->p_element.auto_prov_mode, + port->p_element.mgmt_vlan); + + PEEK_BYTES(&port->p_element.system_id.system_mac, + sizeof port->p_element.system_id.system_mac); + VLOG_INFO("System mac: "ETH_ADDR_FMT, + ETH_ADDR_ARGS(port->p_element.system_id.system_mac)); + aa_system_id_word = PEEK_UINT16; + port->p_element.system_id.conn_type = + aa_system_id_word >> 13; + port->p_element.system_id.rsvd = aa_system_id_word & + 0x03FF; + PEEK_BYTES(&port->p_element.system_id.rsvd2, + sizeof port->p_element.system_id.rsvd2); + break; + + case LLDP_TLV_AA_ISID_VLAN_ASGNS_SUBTYPE: + PEEK_BYTES(&msg_auth_digest, sizeof msg_auth_digest); + + /* Subtract off tlv type and length (2Bytes) + OUI (3B) + + * Subtype (1B) + MSG DIGEST (32B). + */ + num_mappings = tlv_size - 4 - + LLDP_TLV_AA_ISID_VLAN_DIGEST_LENGTH; + if (num_mappings % 5 != 0) { + VLOG_INFO("malformed vlan-isid mappings tlv received"); + goto malformed; + } + + num_mappings /= 5; /* Each mapping is 5 Bytes */ + for(; num_mappings > 0; num_mappings--) { + uint8_t isid[3]; + + isid_vlan_map = xzalloc(sizeof *isid_vlan_map); + aa_status_vlan_word = PEEK_UINT16; + + /* Status is first 4 most-significant bits. */ + isid_vlan_map->isid_vlan_data.status = + aa_status_vlan_word >> 12; + + /* Vlan is last 12 bits */ + isid_vlan_map->isid_vlan_data.vlan = + aa_status_vlan_word & 0x0FFF; + PEEK_BYTES(isid, 3); + isid_vlan_map->isid_vlan_data.isid = + (isid[0] << 16) | (isid[1] << 8) | isid[2]; + list_push_back(&port->p_isid_vlan_maps, + &isid_vlan_map->m_entries); + isid_vlan_map = NULL; + } + break; + + default: + hardware->h_rx_unrecognized_cnt++; + VLOG_INFO("Unrecogised tlv subtype received"); + break; + } + } else if (memcmp(dcbx, orgid, sizeof orgid) == 0) { + VLOG_DBG("unsupported DCBX tlv received on %s " + "- ignore", hardware->h_ifname); + hardware->h_rx_unrecognized_cnt++; + } else { + VLOG_INFO("unknown org tlv [%02x:%02x:%02x] received " + "on %s", orgid[0], orgid[1], orgid[2], + hardware->h_ifname); + hardware->h_rx_unrecognized_cnt++; + } + break; + default: + VLOG_WARN("unknown tlv (%d) received on %s", + tlv_type, + hardware->h_ifname); + goto malformed; + } + if (pos > tlv + tlv_size) { + VLOG_WARN("BUG: already past TLV!"); + goto malformed; + } + PEEK_DISCARD(tlv + tlv_size - pos); + } + + /* Some random check */ + if (!chassis->c_id || !port->p_id || !ttl_received || !gotend) { + VLOG_WARN("some mandatory tlv are missing for frame received " + "on %s", hardware->h_ifname); + goto malformed; + } + *newchassis = chassis; + *newport = port; + return 1; + +malformed: + lldpd_chassis_cleanup(chassis, true); + lldpd_port_cleanup(port, true); + free(port); + return -1; +} diff -Nru openvswitch-2.3.1/lib/lldp/lldp-const.h openvswitch-2.4.0~git20150623/lib/lldp/lldp-const.h --- openvswitch-2.3.1/lib/lldp/lldp-const.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/lldp-const.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,230 @@ +/* -*- mode: c; c-file-style: "openbsd" -*- */ +/* + * Copyright (c) 2008 Vincent Bernat + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LLDP_H +#define _LLDP_H + +/* Definitions prefixed by `LLDP_` are constants from LLDP + * specifications. Definitions prefixed by `LLDPD_` are custom + * constants that are useful in the context of lldpd and its clients. + */ + +/* Chassis ID subtype */ +#define LLDP_CHASSISID_SUBTYPE_CHASSIS 1 +#define LLDP_CHASSISID_SUBTYPE_IFALIAS 2 +#define LLDP_CHASSISID_SUBTYPE_PORT 3 +#define LLDP_CHASSISID_SUBTYPE_LLADDR 4 +#define LLDP_CHASSISID_SUBTYPE_ADDR 5 +#define LLDP_CHASSISID_SUBTYPE_IFNAME 6 +#define LLDP_CHASSISID_SUBTYPE_LOCAL 7 + +/* Port ID subtype */ +#define LLDP_PORTID_SUBTYPE_UNKNOWN 0 +#define LLDP_PORTID_SUBTYPE_IFALIAS 1 +#define LLDP_PORTID_SUBTYPE_PORT 2 +#define LLDP_PORTID_SUBTYPE_LLADDR 3 +#define LLDP_PORTID_SUBTYPE_ADDR 4 +#define LLDP_PORTID_SUBTYPE_IFNAME 5 +#define LLDP_PORTID_SUBTYPE_AGENTCID 6 +#define LLDP_PORTID_SUBTYPE_LOCAL 7 +#define LLDP_PORTID_SUBTYPE_MAX LLDP_PORTID_SUBTYPE_LOCAL + +/* Operational MAU Type field, from RFC 3636 */ +#define LLDP_DOT3_MAU_AUI 1 +#define LLDP_DOT3_MAU_10BASE5 2 +#define LLDP_DOT3_MAU_FOIRL 3 +#define LLDP_DOT3_MAU_10BASE2 4 +#define LLDP_DOT3_MAU_10BASET 5 +#define LLDP_DOT3_MAU_10BASEFP 6 +#define LLDP_DOT3_MAU_10BASEFB 7 +#define LLDP_DOT3_MAU_10BASEFL 8 +#define LLDP_DOT3_MAU_10BROAD36 9 +#define LLDP_DOT3_MAU_10BASETHD 10 +#define LLDP_DOT3_MAU_10BASETFD 11 +#define LLDP_DOT3_MAU_10BASEFLHD 12 +#define LLDP_DOT3_MAU_10BASEFLFD 13 +#define LLDP_DOT3_MAU_10BASET4 14 +#define LLDP_DOT3_MAU_100BASETXHD 15 +#define LLDP_DOT3_MAU_100BASETXFD 16 +#define LLDP_DOT3_MAU_100BASEFXHD 17 +#define LLDP_DOT3_MAU_100BASEFXFD 18 +#define LLDP_DOT3_MAU_100BASET2HD 19 +#define LLDP_DOT3_MAU_100BASET2FD 20 +#define LLDP_DOT3_MAU_1000BASEXHD 21 +#define LLDP_DOT3_MAU_1000BASEXFD 22 +#define LLDP_DOT3_MAU_1000BASELXHD 23 +#define LLDP_DOT3_MAU_1000BASELXFD 24 +#define LLDP_DOT3_MAU_1000BASESXHD 25 +#define LLDP_DOT3_MAU_1000BASESXFD 26 +#define LLDP_DOT3_MAU_1000BASECXHD 27 +#define LLDP_DOT3_MAU_1000BASECXFD 28 +#define LLDP_DOT3_MAU_1000BASETHD 29 +#define LLDP_DOT3_MAU_1000BASETFD 30 +#define LLDP_DOT3_MAU_10GIGBASEX 31 +#define LLDP_DOT3_MAU_10GIGBASELX4 32 +#define LLDP_DOT3_MAU_10GIGBASER 33 +#define LLDP_DOT3_MAU_10GIGBASEER 34 +#define LLDP_DOT3_MAU_10GIGBASELR 35 +#define LLDP_DOT3_MAU_10GIGBASESR 36 +#define LLDP_DOT3_MAU_10GIGBASEW 37 +#define LLDP_DOT3_MAU_10GIGBASEEW 38 +#define LLDP_DOT3_MAU_10GIGBASELW 39 +#define LLDP_DOT3_MAU_10GIGBASESW 40 + +/* Dot3 Power Devicetype */ +#define LLDP_DOT3_POWER_PSE 1 +#define LLDP_DOT3_POWER_PD 2 + +/* Dot3 Power Pairs (RFC 3621) */ +#define LLDP_DOT3_POWERPAIRS_SIGNAL 1 +#define LLDP_DOT3_POWERPAIRS_SPARE 2 + +/* Dot3 Power type (for 802.3at) */ +#define LLDP_DOT3_POWER_8023AT_OFF 0 +#define LLDP_DOT3_POWER_8023AT_TYPE1 1 +#define LLDP_DOT3_POWER_8023AT_TYPE2 2 + +/* Dot3 power source */ +#define LLDP_DOT3_POWER_SOURCE_UNKNOWN 0 +#define LLDP_DOT3_POWER_SOURCE_PRIMARY 1 +#define LLDP_DOT3_POWER_SOURCE_PSE 1 +#define LLDP_DOT3_POWER_SOURCE_BACKUP 2 +#define LLDP_DOT3_POWER_SOURCE_LOCAL 2 +#define LLDP_DOT3_POWER_SOURCE_BOTH 3 + +/* Dot3 power priority */ +#define LLDP_DOT3_POWER_PRIO_UNKNOWN 0 +#define LLDP_DOT3_POWER_PRIO_CRITICAL 1 +#define LLDP_DOT3_POWER_PRIO_HIGH 2 +#define LLDP_DOT3_POWER_PRIO_LOW 3 + +/* PMD Auto-Negotiation Advertised Capability field, from RFC 3636 */ +#define LLDP_DOT3_LINK_AUTONEG_OTHER 0x8000 +#define LLDP_DOT3_LINK_AUTONEG_10BASE_T 0x4000 +#define LLDP_DOT3_LINK_AUTONEG_10BASET_FD 0x2000 +#define LLDP_DOT3_LINK_AUTONEG_100BASE_T4 0x1000 +#define LLDP_DOT3_LINK_AUTONEG_100BASE_TX 0x0800 +#define LLDP_DOT3_LINK_AUTONEG_100BASE_TXFD 0x0400 +#define LLDP_DOT3_LINK_AUTONEG_100BASE_T2 0x0200 +#define LLDP_DOT3_LINK_AUTONEG_100BASE_T2FD 0x0100 +#define LLDP_DOT3_LINK_AUTONEG_FDX_PAUSE 0x0080 +#define LLDP_DOT3_LINK_AUTONEG_FDX_APAUSE 0x0040 +#define LLDP_DOT3_LINK_AUTONEG_FDX_SPAUSE 0x0020 +#define LLDP_DOT3_LINK_AUTONEG_FDX_BPAUSE 0x0010 +#define LLDP_DOT3_LINK_AUTONEG_1000BASE_X 0x0008 +#define LLDP_DOT3_LINK_AUTONEG_1000BASE_XFD 0x0004 +#define LLDP_DOT3_LINK_AUTONEG_1000BASE_T 0x0002 +#define LLDP_DOT3_LINK_AUTONEG_1000BASE_TFD 0x0001 + +/* Capabilities */ +#define LLDP_CAP_OTHER 0x01 +#define LLDP_CAP_REPEATER 0x02 +#define LLDP_CAP_BRIDGE 0x04 +#define LLDP_CAP_WLAN 0x08 +#define LLDP_CAP_ROUTER 0x10 +#define LLDP_CAP_TELEPHONE 0x20 +#define LLDP_CAP_DOCSIS 0x40 +#define LLDP_CAP_STATION 0x80 + +#define LLDP_PPVID_CAP_SUPPORTED (1 << 1) +#define LLDP_PPVID_CAP_ENABLED (1 << 2) + +/* see http://www.iana.org/assignments/address-family-numbers */ +#define LLDP_MGMT_ADDR_NONE 0 +#define LLDP_MGMT_ADDR_IP4 1 +#define LLDP_MGMT_ADDR_IP6 2 + +#define LLDP_MGMT_IFACE_UNKNOWN 1 +#define LLDP_MGMT_IFACE_IFINDEX 2 +#define LLDP_MGMT_IFACE_SYSPORT 3 + +#define LLDP_MED_CLASS_I 1 +#define LLDP_MED_CLASS_II 2 +#define LLDP_MED_CLASS_III 3 +#define LLDP_MED_NETWORK_DEVICE 4 + +/* LLDP MED application ttpes */ +#define LLDP_MED_APPTYPE_UNDEFINED 0 +#define LLDP_MED_APPTYPE_VOICE 1 +#define LLDP_MED_APPTYPE_VOICESIGNAL 2 +#define LLDP_MED_APPTYPE_GUESTVOICE 3 +#define LLDP_MED_APPTYPE_GUESTVOICESIGNAL 4 +#define LLDP_MED_APPTYPE_SOFTPHONEVOICE 5 +#define LLDP_MED_APPTYPE_VIDEOCONFERENCE 6 +#define LLDP_MED_APPTYPE_VIDEOSTREAM 7 +#define LLDP_MED_APPTYPE_VIDEOSIGNAL 8 +#define LLDP_MED_APPTYPE_LAST LLDP_MED_APPTYPE_VIDEOSIGNAL + +/* LLDP MED location formats */ +#define LLDP_MED_LOCFORMAT_COORD 1 +#define LLDP_MED_LOCFORMAT_CIVIC 2 +#define LLDP_MED_LOCFORMAT_ELIN 3 +#define LLDP_MED_LOCFORMAT_LAST LLDP_MED_LOCFORMAT_ELIN + +#define LLDP_MED_LOCATION_GEOID_WGS84 1 +#define LLDP_MED_LOCATION_GEOID_NAD83 2 +#define LLDP_MED_LOCATION_GEOID_NAD83_MLLW 3 + +#define LLDP_MED_LOCATION_ALTITUDE_UNIT_METER 1 +#define LLDP_MED_LOCATION_ALTITUDE_UNIT_FLOOR 2 + +/* LLDP MED power related constants */ +#define LLDP_MED_POW_TYPE_PSE 1 +#define LLDP_MED_POW_TYPE_PD 2 +#define LLDP_MED_POW_TYPE_RESERVED 3 + +#define LLDP_MED_POW_SOURCE_UNKNOWN 1 +#define LLDP_MED_POW_SOURCE_PRIMARY 2 +#define LLDP_MED_POW_SOURCE_BACKUP 3 +#define LLDP_MED_POW_SOURCE_RESERVED 4 +#define LLDP_MED_POW_SOURCE_PSE 5 +#define LLDP_MED_POW_SOURCE_LOCAL 6 +#define LLDP_MED_POW_SOURCE_BOTH 7 + +#define LLDP_MED_POW_PRIO_UNKNOWN 0 +#define LLDP_MED_POW_PRIO_CRITICAL 1 +#define LLDP_MED_POW_PRIO_HIGH 2 +#define LLDP_MED_POW_PRIO_LOW 3 + +/* LLDP MED capabilities */ +#define LLDP_MED_CAP_CAP 0x01 +#define LLDP_MED_CAP_POLICY 0x02 +#define LLDP_MED_CAP_LOCATION 0x04 +#define LLDP_MED_CAP_MDI_PSE 0x08 +#define LLDP_MED_CAP_MDI_PD 0x10 +#define LLDP_MED_CAP_IV 0x20 + +/* Protocol constants for multi-protocol lldpd */ +#define LLDPD_MODE_LLDP 1 +#define LLDPD_MODE_CDPV1 2 +#define LLDPD_MODE_CDPV2 3 +#define LLDPD_MODE_SONMP 4 +#define LLDPD_MODE_EDP 5 +#define LLDPD_MODE_FDP 6 +#define LLDPD_MODE_MAX LLDPD_MODE_FDP + + +/* Bond slave src mac type constants */ +#define LLDP_BOND_SLAVE_SRC_MAC_TYPE_UNKNOWN 0 +#define LLDP_BOND_SLAVE_SRC_MAC_TYPE_REAL 1 +#define LLDP_BOND_SLAVE_SRC_MAC_TYPE_ZERO 2 +#define LLDP_BOND_SLAVE_SRC_MAC_TYPE_FIXED 3 +#define LLDP_BOND_SLAVE_SRC_MAC_TYPE_LOCALLY_ADMINISTERED 4 +#define LLDP_BOND_SLAVE_SRC_MAC_TYPE_MAX \ + LLDP_BOND_SLAVE_SRC_MAC_TYPE_LOCALLY_ADMINISTERED + +#endif /* _LLDP_H */ diff -Nru openvswitch-2.3.1/lib/lldp/lldpd.c openvswitch-2.4.0~git20150623/lib/lldp/lldpd.c --- openvswitch-2.3.1/lib/lldp/lldpd.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/lldpd.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,642 @@ +/* -*- mode: c; c-file-style: "openbsd" -*- */ +/* + * Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2008 Vincent Bernat + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include "lldpd.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _WIN32 +#include +#include +#include +#include +#include +#endif +#include "compiler.h" +#include "list.h" +#include "packets.h" +#include "timeval.h" + +VLOG_DEFINE_THIS_MODULE(lldpd); + +static struct protocol protos[] = +{ + { LLDPD_MODE_LLDP, 1, "LLDP", 'l', lldp_send, lldp_decode, NULL, + LLDP_MULTICAST_ADDR }, + { 0, 0, "any", ' ', NULL, NULL, NULL, + { 0,0,0,0,0,0 } } +}; + +void lldpd_assign_cfg_to_protocols(struct lldpd *cfg) +{ + cfg->g_protocols = protos; +} + +struct lldpd_hardware * +lldpd_get_hardware(struct lldpd *cfg, char *name, int index, + struct lldpd_ops *ops) +{ + struct lldpd_hardware *hw; + + LIST_FOR_EACH (hw, h_entries, &cfg->g_hardware) { + if (!strcmp(hw->h_ifname, name) && hw->h_ifindex == index + && (!ops || ops == hw->h_ops)) { + return hw; + } + } + + return NULL; +} + +struct lldpd_hardware * +lldpd_alloc_hardware(struct lldpd *cfg, char *name, int index) +{ + struct lldpd_hardware *hw; + + VLOG_DBG("allocate a new local hardware interface (%s)", name); + + hw = xzalloc(sizeof *hw); + hw->h_cfg = cfg; + ovs_strlcpy(hw->h_ifname, name, sizeof hw->h_ifname); + hw->h_ifindex = index; + hw->h_lport.p_chassis = CONTAINER_OF(list_front(&cfg->g_chassis), + struct lldpd_chassis, list); + hw->h_lport.p_chassis->c_refcount++; + list_init(&hw->h_rports); + + return hw; +} + +struct lldpd_mgmt * +lldpd_alloc_mgmt(int family, void *addrptr, size_t addrsize, u_int32_t iface) +{ + struct lldpd_mgmt *mgmt; + + VLOG_DBG("allocate a new management address (family: %d)", family); + + if (family <= LLDPD_AF_UNSPEC || family >= LLDPD_AF_LAST) { + errno = EAFNOSUPPORT; + return NULL; + } + if (addrsize > LLDPD_MGMT_MAXADDRSIZE) { + errno = EOVERFLOW; + return NULL; + } + mgmt = xzalloc(sizeof *mgmt); + mgmt->m_family = family; + memcpy(&mgmt->m_addr, addrptr, addrsize); + mgmt->m_addrsize = addrsize; + mgmt->m_iface = iface; + + return mgmt; +} + +void +lldpd_hardware_cleanup(struct lldpd *cfg, struct lldpd_hardware *hardware) +{ + VLOG_DBG("cleanup hardware port %s", hardware->h_ifname); + + lldpd_port_cleanup(&hardware->h_lport, true); + if (hardware->h_ops && hardware->h_ops->cleanup) { + hardware->h_ops->cleanup(cfg, hardware); + } + free(hardware); +} + +void +lldpd_cleanup(struct lldpd *cfg) +{ + struct lldpd_hardware *hw, *hw_next; + struct lldpd_chassis *chassis, *chassis_next; + + VLOG_DBG("cleanup all ports"); + + LIST_FOR_EACH_SAFE (hw, hw_next, h_entries, &cfg->g_hardware) { + if (!hw->h_flags) { + list_remove(&hw->h_entries); + lldpd_remote_cleanup(hw, NULL, true); + lldpd_hardware_cleanup(cfg, hw); + } else { + lldpd_remote_cleanup(hw, NULL, false); + } + } + + VLOG_DBG("cleanup all chassis"); + + LIST_FOR_EACH_SAFE (chassis, chassis_next, list, &cfg->g_chassis) { + if (chassis->c_refcount == 0) { + list_remove(&chassis->list); + lldpd_chassis_cleanup(chassis, 1); + } + } +} + +/* Update chassis `ochassis' with values from `chassis'. The later one is not + * expected to be part of a list! It will also be wiped from memory. + */ +static void +lldpd_move_chassis(struct lldpd_chassis *ochassis, + struct lldpd_chassis *chassis) +{ + struct lldpd_mgmt *mgmt; + int refcount = ochassis->c_refcount; + int index = ochassis->c_index; + struct ovs_list listcopy; + + /* We want to keep refcount, index and list stuff from the current chassis + */ + memcpy(&listcopy, &ochassis->list, sizeof listcopy); + lldpd_chassis_cleanup(ochassis, 0); + + /* Make the copy. */ + /* WARNING: this is a kludgy hack, we need in-place copy and cannot use + * marshaling. + */ + memcpy(ochassis, chassis, sizeof *ochassis); + list_init(&ochassis->c_mgmt); + + /* Copy of management addresses */ + LIST_FOR_EACH_POP (mgmt, m_entries, &chassis->c_mgmt) { + list_insert(&ochassis->c_mgmt, &mgmt->m_entries); + } + + /* Restore saved values */ + ochassis->c_refcount = refcount; + ochassis->c_index = index; + memcpy(&ochassis->list, &listcopy, sizeof ochassis->list); + + /* Get rid of the new chassis */ + free(chassis); +} + +static int +lldpd_guess_type(struct lldpd *cfg, char *frame, int s) +{ + int i; + + if (s < ETH_ADDR_LEN) { + return -1; + } + + for (i = 0; cfg->g_protocols[i].mode != 0; i++) { + if (!cfg->g_protocols[i].enabled) { + continue; + } + if (cfg->g_protocols[i].guess == NULL) { + if (memcmp(frame, cfg->g_protocols[i].mac, ETH_ADDR_LEN) == 0) { + VLOG_DBG("guessed protocol is %s (from MAC address)", + cfg->g_protocols[i].name); + return cfg->g_protocols[i].mode; + } + } else { + if (cfg->g_protocols[i].guess(frame, s)) { + VLOG_DBG("guessed protocol is %s (from detector function)", + cfg->g_protocols[i].name); + return cfg->g_protocols[i].mode; + } + } + } + + return -1; +} + +static void +lldpd_decode(struct lldpd *cfg, char *frame, int s, + struct lldpd_hardware *hw) +{ + size_t listsize, i; + struct lldpd_chassis *chassis, *ochassis = NULL; + struct lldpd_port *port, *oport; + int guess = LLDPD_MODE_LLDP; + struct eth_header eheader; + int count = 0; + bool found = false; + + VLOG_DBG("decode a received frame on %s size %d", hw->h_ifname,s); + + if (s < sizeof(struct eth_header) + 4) { + /* Too short, just discard it */ + return; + } + + /* Decapsulate VLAN frames */ + memcpy(&eheader, frame, sizeof eheader); + if (eheader.eth_type == htons(ETH_TYPE_VLAN)) { + /* VLAN decapsulation means to shift 4 bytes left the frame from + * offset 2 * ETH_ADDR_LEN + */ + memmove(frame + 2 * ETH_ADDR_LEN, frame + 2 * ETH_ADDR_LEN + 4, + s - 2 * ETH_ADDR_LEN); + s -= 4; + } + + LIST_FOR_EACH (oport, p_entries, &hw->h_rports) { + if (oport->p_lastframe && + oport->p_lastframe->size == s && + !memcmp(oport->p_lastframe->frame, frame, s)) { + /* Already received the same frame */ + VLOG_DBG("duplicate frame, no need to decode"); + oport->p_lastupdate = time_now(); + return; + } + } + + guess = lldpd_guess_type(cfg, frame, s); + VLOG_DBG("guessed %d enabled:%d", guess, cfg->g_protocols[0].enabled); + + for (i = 0; cfg->g_protocols[i].mode != 0; i++) { + if (!cfg->g_protocols[i].enabled) { + continue; + } + if (cfg->g_protocols[i].mode == guess) { + VLOG_DBG("using decode function for %s protocol", + cfg->g_protocols[i].name); + if (cfg->g_protocols[i].decode(cfg, frame, s, hw, &chassis, &port) + == -1) { + VLOG_DBG("function for %s protocol did not " + "decode this frame", + cfg->g_protocols[i].name); + return; + } + chassis->c_protocol = port->p_protocol = cfg->g_protocols[i].mode; + break; + } + VLOG_DBG(" %"PRIuSIZE "mode:%d enabled:%d", + i, cfg->g_protocols[i].mode, cfg->g_protocols[i].enabled); + } + if (cfg->g_protocols[i].mode == 0) { + VLOG_DBG("unable to guess frame type on %s", hw->h_ifname); + return; + } + + /* Do we already have the same MSAP somewhere? */ + VLOG_DBG("search for the same MSAP"); + + LIST_FOR_EACH (oport, p_entries, &hw->h_rports) { + if (port->p_protocol == oport->p_protocol) { + count++; + if (port->p_id_subtype == oport->p_id_subtype && + port->p_id_len == oport->p_id_len && + !memcmp(port->p_id, oport->p_id, port->p_id_len) && + chassis->c_id_subtype == oport->p_chassis->c_id_subtype && + chassis->c_id_len == oport->p_chassis->c_id_len && + !memcmp(chassis->c_id, oport->p_chassis->c_id, + chassis->c_id_len)) { + ochassis = oport->p_chassis; + VLOG_DBG("MSAP is already known"); + found = true; + break; + } + } + } + + if (!found) { + oport = NULL; + } + + /* Do we have room for a new MSAP? */ + if (!oport && cfg->g_config.c_max_neighbors) { + if (count == (cfg->g_config.c_max_neighbors - 1)) { + VLOG_DBG("max neighbors %d reached for port %s, " + "dropping any new ones silently", + cfg->g_config.c_max_neighbors, + hw->h_ifname); + } else if (count > cfg->g_config.c_max_neighbors - 1) { + VLOG_DBG("too many neighbors for port %s, drop this new one", + hw->h_ifname); + lldpd_port_cleanup(port, true); + lldpd_chassis_cleanup(chassis, true); + free(port); + return; + } + } + + /* No, but do we already know the system? */ + if (!oport) { + bool found = false; + VLOG_DBG("MSAP is unknown, search for the chassis"); + + LIST_FOR_EACH (ochassis, list, &cfg->g_chassis) { + if ((chassis->c_protocol == ochassis->c_protocol) && + (chassis->c_id_subtype == ochassis->c_id_subtype) && + (chassis->c_id_len == ochassis->c_id_len) && + (memcmp(chassis->c_id, ochassis->c_id, + chassis->c_id_len) == 0)) { + found = true; + break; + } + } + + if (!found) { + ochassis = NULL; + } + } + + if (oport) { + /* The port is known, remove it before adding it back */ + list_remove(&oport->p_entries); + lldpd_port_cleanup(oport, 1); + free(oport); + } + + if (ochassis) { + lldpd_move_chassis(ochassis, chassis); + chassis = ochassis; + } else { + /* Chassis not known, add it */ + VLOG_DBG("unknown chassis, add it to the list"); + chassis->c_index = ++cfg->g_lastrid; + chassis->c_refcount = 0; + list_push_back(&cfg->g_chassis, &chassis->list); + listsize = list_size(&cfg->g_chassis); + VLOG_DBG("%"PRIuSIZE " different systems are known", listsize); + } + + /* Add port */ + port->p_lastchange = port->p_lastupdate = time_now(); + port->p_lastframe = xmalloc(s + sizeof(struct lldpd_frame)); + port->p_lastframe->size = s; + memcpy(port->p_lastframe->frame, frame, s); + list_insert(&hw->h_rports, &port->p_entries); + + port->p_chassis = chassis; + port->p_chassis->c_refcount++; + /* Several cases are possible : + * 1. chassis is new, its refcount was 0. It is now attached + * to this port, its refcount is 1. + * 2. chassis already exists and was attached to another + * port, we increase its refcount accordingly. + * 3. chassis already exists and was attached to the same + * port, its refcount was decreased with + * lldpd_port_cleanup() and is now increased again. + * + * In all cases, if the port already existed, it has been + * freed with lldpd_port_cleanup() and therefore, the refcount + * of the chassis that was attached to it is decreased. + */ + i = list_size(&hw->h_rports); + VLOG_DBG("%"PRIuSIZE " neighbors for %s", i, hw->h_ifname); + + if (!oport) { + hw->h_insert_cnt++; + } + + return; +} + +static void +lldpd_hide_ports(struct lldpd *cfg, + struct lldpd_hardware *hw, + int mask) { + struct lldpd_port *port; + int protocols[LLDPD_MODE_MAX + 1]; + char buffer[256]; + bool found = false; + int i, j, k; + unsigned int min; + + VLOG_DBG("apply smart filter for port %s", hw->h_ifname); + + /* Compute the number of occurrences of each protocol */ + for (i = 0; i <= LLDPD_MODE_MAX; i++) { + protocols[i] = 0; + } + + LIST_FOR_EACH (port, p_entries, &hw->h_rports) { + protocols[port->p_protocol]++; + } + + /* Turn the protocols[] array into an array of + * enabled/disabled protocols. 1 means enabled, 0 + * means disabled. + */ + min = (unsigned int) - 1; + for (i = 0; i <= LLDPD_MODE_MAX; i++) { + if (protocols[i] && (protocols[i] < min)) { + min = protocols[i]; + } + } + for (i = 0; i <= LLDPD_MODE_MAX; i++) { + if (protocols[i] == min && !found) { + /* If we need a tie breaker, we take the first protocol only */ + if (cfg->g_config.c_smart & mask & + (SMART_OUTGOING_ONE_PROTO | SMART_INCOMING_ONE_PROTO)) { + found = true; + } + protocols[i] = 1; + } else { + protocols[i] = 0; + } + } + + /* We set the p_hidden flag to 1 if the protocol is disabled */ + LIST_FOR_EACH (port, p_entries, &hw->h_rports) { + if (mask == SMART_OUTGOING) { + port->p_hidden_out = protocols[port->p_protocol] ? false : true; + } else { + port->p_hidden_in = protocols[port->p_protocol] ? false : true; + } + } + + /* If we want only one neighbor, we take the first one */ + if (cfg->g_config.c_smart & mask & + (SMART_OUTGOING_ONE_NEIGH | SMART_INCOMING_ONE_NEIGH)) { + found = false; + + LIST_FOR_EACH (port, p_entries, &hw->h_rports) { + if (mask == SMART_OUTGOING) { + if (found) { + port->p_hidden_out = true; + } + if (!port->p_hidden_out) { + found = true; + } + } + if (mask == SMART_INCOMING) { + if (found) { + port->p_hidden_in = true; + } + if (!port->p_hidden_in) { + found = true; + } + } + } + } + + /* Print a debug message summarizing the operation */ + for (i = 0; i <= LLDPD_MODE_MAX; i++) { + protocols[i] = 0; + } + + k = j = 0; + LIST_FOR_EACH (port, p_entries, &hw->h_rports) { + if (!((mask == SMART_OUTGOING && port->p_hidden_out) || + (mask == SMART_INCOMING && port->p_hidden_in))) { + k++; + protocols[port->p_protocol] = 1; + } + j++; + } + + buffer[0] = '\0'; + for (i = 0; cfg->g_protocols[i].mode != 0; i++) { + if (cfg->g_protocols[i].enabled && + protocols[cfg->g_protocols[i].mode]) { + if (strlen(buffer) + + strlen(cfg->g_protocols[i].name) + 3 > sizeof(buffer)) { + /* Unlikely, our buffer is too small */ + memcpy(buffer + sizeof(buffer) - 4, "...", 4); + break; + } + if (buffer[0]) { + strncat(buffer, ", ", 2); + strncat(buffer, cfg->g_protocols[i].name, + strlen(cfg->g_protocols[i].name)); + } + } + } + VLOG_DBG("%s: %s: %d visible neighbors (out of %d)", + hw->h_ifname, + (mask == SMART_OUTGOING) ? "out filter" : "in filter", + k, j); + VLOG_DBG("%s: protocols: %s", + hw->h_ifname, buffer[0] ? buffer : "(none)"); +} + +/* Hide unwanted ports depending on smart mode set by the user */ +static void +lldpd_hide_all(struct lldpd *cfg) +{ + struct lldpd_hardware *hw; + + if (!cfg->g_config.c_smart) { + return; + } + + VLOG_DBG("apply smart filter results on all ports"); + + LIST_FOR_EACH (hw, h_entries, &cfg->g_hardware) { + if (cfg->g_config.c_smart & SMART_INCOMING_FILTER) { + lldpd_hide_ports(cfg, hw, SMART_INCOMING); + } + if (cfg->g_config.c_smart & SMART_OUTGOING_FILTER) { + lldpd_hide_ports(cfg, hw, SMART_OUTGOING); + } + } +} + +void +lldpd_recv(struct lldpd *cfg, + struct lldpd_hardware *hw, + char *buffer, + size_t bufSize) +{ + int n = bufSize; + + VLOG_DBG("receive a frame on %s", hw->h_ifname); + if (cfg->g_config.c_paused) { + VLOG_DBG("paused, ignore the frame on %s", hw->h_ifname); + return; + } + hw->h_rx_cnt++; + VLOG_DBG("decode received frame on %s h_rx_cnt=%" PRIu64, + hw->h_ifname, hw->h_rx_cnt); + lldpd_decode(cfg, buffer, n, hw); + lldpd_hide_all(cfg); /* Immediatly hide */ +} + +uint32_t +lldpd_send(struct lldpd_hardware *hw, struct dp_packet *p) +{ + struct lldpd *cfg = hw->h_cfg; + struct lldpd_port *port; + int i, sent = 0; + int lldp_size = 0; + + if (cfg->g_config.c_receiveonly || cfg->g_config.c_paused) { + return 0; + } +#ifndef _WIN32 + if ((hw->h_flags & IFF_RUNNING) == 0) { + return 0; + } +#endif + + for (i = 0; cfg->g_protocols[i].mode != 0; i++) { + if (!cfg->g_protocols[i].enabled) { + continue; + } + + /* We send only if we have at least one remote system + * speaking this protocol or if the protocol is forced */ + if (cfg->g_protocols[i].enabled > 1) { + if ((lldp_size = cfg->g_protocols[i].send(cfg, hw, p)) != -E2BIG) { + sent++; + continue; + } else { + VLOG_DBG("send PDU on %s failed E2BIG", hw->h_ifname); + continue; + } + } + + LIST_FOR_EACH (port, p_entries, &hw->h_rports) { + /* If this remote port is disabled, we don't consider it */ + if (port->p_hidden_out) { + continue; + } + if (port->p_protocol == cfg->g_protocols[i].mode) { + VLOG_DBG("send PDU on %s with protocol %s", + hw->h_ifname, cfg->g_protocols[i].name); + lldp_size = cfg->g_protocols[i].send(cfg, hw, p); + sent++; + break; + } + } + } + + if (!sent) { + /* Nothing was sent for this port, let's speak the first + * available protocol. + */ + for (i = 0; cfg->g_protocols[i].mode != 0; i++) { + if (!cfg->g_protocols[i].enabled) { + continue; + } + VLOG_DBG("fallback to protocol %s for %s", + cfg->g_protocols[i].name, hw->h_ifname); + lldp_size = cfg->g_protocols[i].send(cfg, hw, p); + break; + } + if (cfg->g_protocols[i].mode == 0) { + VLOG_WARN("no protocol enabled, dunno what to send"); + } + } + + return lldp_size; +} diff -Nru openvswitch-2.3.1/lib/lldp/lldpd.h openvswitch-2.4.0~git20150623/lib/lldp/lldpd.h --- openvswitch-2.3.1/lib/lldp/lldpd.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/lldpd.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,101 @@ +/* -*- mode: c; c-file-style: "openbsd" -*- */ +/* + * Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2008 Vincent Bernat + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LLDPD_H +#define _LLDPD_H + +#ifndef _WIN32 +#include +#endif +#include +#include +#include +#include +#include "dp-packet.h" +#include "list.h" +#include "lldpd-structs.h" +#include "lldp-tlv.h" +#include "packets.h" +#include "openvswitch/vlog.h" + +#define ETHERTYPE_LLDP 0x88cc + +#define LLDPD_TX_INTERVAL 5 +#define LLDPD_TX_HOLD 4 +#define LLDPD_TTL (LLDPD_TX_INTERVAL * LLDPD_TX_HOLD) + +#define PROTO_SEND_SIG struct lldpd *, struct lldpd_hardware *,struct dp_packet * +#define PROTO_DECODE_SIG struct lldpd *, char *, int, struct lldpd_hardware *,\ + struct lldpd_chassis **, struct lldpd_port ** +#define PROTO_GUESS_SIG char *, int + +struct protocol { + int mode; /* > 0 mode identifier (unique per protocol) */ + int enabled; /* Is this protocol enabled? */ + char *name; /* Name of protocol */ + char arg; /* Argument to enable this protocol */ + int(*send)(PROTO_SEND_SIG); /* How to send a frame */ + int(*decode)(PROTO_DECODE_SIG); /* How to decode a frame */ + int(*guess)(PROTO_GUESS_SIG); /* Can be NULL, use MAC address in this + * case + */ + u_int8_t mac[ETH_ADDR_LEN]; /* Destination MAC address used by this + * protocol + */ +}; + +#define SMART_HIDDEN(port) (port->p_hidden_in) + +struct lldpd { + struct lldpd_config g_config; + struct protocol *g_protocols; + int g_lastrid; + + struct ovs_list g_chassis; /* Contains "struct lldp_chassis". */ + struct ovs_list g_hardware; /* Contains "struct lldpd_hardware". */ +}; + +static inline struct lldpd_hardware * +lldpd_first_hardware(struct lldpd *lldpd) +{ + return CONTAINER_OF(list_front(&lldpd->g_hardware), + struct lldpd_hardware, h_entries); +} + +/* lldpd.c */ +struct lldpd_hardware *lldpd_get_hardware(struct lldpd *, + char *, int, struct lldpd_ops *); +struct lldpd_hardware *lldpd_alloc_hardware(struct lldpd *, char *, int); +void lldpd_hardware_cleanup(struct lldpd*, struct lldpd_hardware *); +struct lldpd_mgmt *lldpd_alloc_mgmt(int family, void *addr, size_t addrsize, + u_int32_t iface); +void lldpd_recv(struct lldpd *, struct lldpd_hardware *, char *, size_t); +uint32_t lldpd_send(struct lldpd_hardware *, struct dp_packet *); +void lldpd_loop(struct lldpd *); + +int lldpd_main(int, char **); +void lldpd_update_localports(struct lldpd *); +void lldpd_cleanup(struct lldpd *); + +void lldpd_assign_cfg_to_protocols(struct lldpd *); + +/* lldp.c */ +int lldp_send(PROTO_SEND_SIG); +int lldp_decode(PROTO_DECODE_SIG); + +#endif /* _LLDPD_H */ diff -Nru openvswitch-2.3.1/lib/lldp/lldpd-structs.c openvswitch-2.4.0~git20150623/lib/lldp/lldpd-structs.c --- openvswitch-2.3.1/lib/lldp/lldpd-structs.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/lldpd-structs.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,150 @@ +/* -*- mode: c; c-file-style: "openbsd" -*- */ +/* + * Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2008 Vincent Bernat + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include "lldpd-structs.h" +#include +#include +#include "lldpd.h" +#include "timeval.h" + +VLOG_DEFINE_THIS_MODULE(lldpd_structs); + +void +lldpd_chassis_mgmt_cleanup(struct lldpd_chassis *chassis) +{ + struct lldpd_mgmt *mgmt; + + VLOG_DBG("cleanup management addresses for chassis %s", + chassis->c_name ? chassis->c_name : "(unknown)"); + + LIST_FOR_EACH_POP (mgmt, m_entries, &chassis->c_mgmt) { + free(mgmt); + } + + list_init(&chassis->c_mgmt); +} + +void +lldpd_chassis_cleanup(struct lldpd_chassis *chassis, bool all) +{ + lldpd_chassis_mgmt_cleanup(chassis); + VLOG_DBG("cleanup chassis %s", + chassis->c_name ? chassis->c_name : "(unknown)"); + free(chassis->c_id); + free(chassis->c_name); + free(chassis->c_descr); + if (all) { + free(chassis); + } +} + +/* Cleanup a remote port. The before last argument, `expire` is a function that + * should be called when a remote port is removed. If the last argument is + * true, all remote ports are removed. + */ +void +lldpd_remote_cleanup(struct lldpd_hardware *hw, + void(*expire)(struct lldpd_hardware *, + struct lldpd_port *), + bool all) +{ + struct lldpd_port *port, *port_next; + time_t now = time_now(); + + VLOG_DBG("cleanup remote port on %s", hw->h_ifname); + LIST_FOR_EACH_SAFE (port, port_next, p_entries, &hw->h_rports) { + bool del = all; + if (!all && expire && + (now >= port->p_lastupdate + port->p_chassis->c_ttl)) { + hw->h_ageout_cnt++; + hw->h_delete_cnt++; + del = true; + } + if (del) { + if (expire) { + expire(hw, port); + } + + if (!all) { + list_remove(&port->p_entries); + } + lldpd_port_cleanup(port, true); + free(port); + } + } + if (all) { + list_init(&hw->h_rports); + } +} + +/* Cleanup the auto-attach mappings attached to port. + */ +static void +lldpd_aa_maps_cleanup(struct lldpd_port *port) +{ + struct lldpd_aa_isid_vlan_maps_tlv *isid_vlan_map = NULL; + struct lldpd_aa_isid_vlan_maps_tlv *isid_vlan_map_next = NULL; + + if (!list_is_empty(&port->p_isid_vlan_maps)) { + + LIST_FOR_EACH_SAFE (isid_vlan_map, isid_vlan_map_next, m_entries, + &port->p_isid_vlan_maps) { + + list_remove(&isid_vlan_map->m_entries); + free(isid_vlan_map); + } + + list_init(&port->p_isid_vlan_maps); + } +} + +/* If `all' is true, clear all information, including information that + are not refreshed periodically. Port should be freed manually. */ +void +lldpd_port_cleanup(struct lldpd_port *port, bool all) +{ + /* We set these to NULL so we don't free wrong memory */ + free(port->p_id); + port->p_id = NULL; + free(port->p_descr); + port->p_descr = NULL; + + /* Cleanup auto-attach mappings */ + lldpd_aa_maps_cleanup(port); + + if (all) { + free(port->p_lastframe); + /* Chassis may not have been attributed, yet.*/ + if (port->p_chassis) { + port->p_chassis->c_refcount--; + port->p_chassis = NULL; + } + } +} + +void +lldpd_config_cleanup(struct lldpd_config *config) +{ + VLOG_DBG("general configuration cleanup"); + free(config->c_mgmt_pattern); + free(config->c_cid_pattern); + free(config->c_iface_pattern); + free(config->c_platform); + free(config->c_description); +} diff -Nru openvswitch-2.3.1/lib/lldp/lldpd-structs.h openvswitch-2.4.0~git20150623/lib/lldp/lldpd-structs.h --- openvswitch-2.3.1/lib/lldp/lldpd-structs.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/lldpd-structs.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,223 @@ +/* -*- mode: c; c-file-style: "openbsd" -*- */ +/* + * Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2008 Vincent Bernat + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LLDPD_STRUCTS_H +#define _LLDPD_STRUCTS_H + +#include +#ifndef _WIN32 +#include +#endif +#include +#include +#include "aa-structs.h" +#include "lldp-const.h" +#include "packets.h" + +enum { + LLDPD_AF_UNSPEC = 0, + LLDPD_AF_IPV4, + LLDPD_AF_IPV6, + LLDPD_AF_LAST +}; + +inline static int +lldpd_af(int af) +{ + switch (af) { + case LLDPD_AF_IPV4: return AF_INET; + case LLDPD_AF_IPV6: return AF_INET6; + case LLDPD_AF_LAST: return AF_MAX; + default: return AF_UNSPEC; + } +} + +#define LLDPD_MGMT_MAXADDRSIZE 16 /* sizeof(struct in6_addr) */ +struct lldpd_mgmt { + struct ovs_list m_entries; + int m_family; + union { + struct in_addr inet; + struct in6_addr inet6; + u_int8_t octets[LLDPD_MGMT_MAXADDRSIZE]; + } m_addr; + size_t m_addrsize; + u_int32_t m_iface; +}; + +struct lldpd_chassis { + struct ovs_list list; + u_int16_t c_refcount; /* Reference count by ports */ + u_int16_t c_index; /* Monotonic index */ + u_int8_t c_protocol; /* Protocol used to get this chassis */ + u_int8_t c_id_subtype; + uint8_t *c_id; /* Typically an Ethernet address. */ + int c_id_len; + char *c_name; + char *c_descr; + + u_int16_t c_cap_available; + u_int16_t c_cap_enabled; + + u_int16_t c_ttl; + + struct ovs_list c_mgmt; /* Contains "struct lldp_mgmt"s. */ +}; +/* WARNING: any change to this structure should also be reflected into + `lldpd_copy_chassis()` which is not using marshaling. */ + +struct lldpd_port { + struct ovs_list p_entries; + struct lldpd_chassis *p_chassis; /* Attached chassis */ + time_t p_lastchange; /* Time of last change of values */ + time_t p_lastupdate; /* Time of last update received */ + struct lldpd_frame *p_lastframe; /* Frame received during last update */ + u_int8_t p_protocol; /* Protocol used to get this port */ + u_int8_t p_hidden_in:1; /* Considered hidden for reception */ + u_int8_t p_hidden_out:1; /* Considered hidden for emission */ + /* Important: all fields that should be ignored to check if a port has + * been changed should be before p_id_subtype. Check + * `lldpd_reset_timer()`. + */ + u_int8_t p_id_subtype; + char *p_id; + int p_id_len; + char *p_descr; + u_int16_t p_mfs; + struct lldpd_aa_element_tlv p_element; + struct ovs_list p_isid_vlan_maps; /* Contains "struct lldpd_aa_isid_vlan_maps_tlv"s. */ +}; + +/* Smart mode / Hide mode */ +#define SMART_INCOMING_FILTER (1<<0) /* Incoming filtering enabled */ +#define SMART_INCOMING_ONE_PROTO (1<<1) /* On reception, keep only 1 proto */ +#define SMART_INCOMING_ONE_NEIGH (1<<2) /* On recep., keep only 1 neighbor */ +#define SMART_OUTGOING_FILTER (1<<3) /* Outgoing filtering enabled */ +#define SMART_OUTGOING_ONE_PROTO (1<<4) /* On emission, keep only one proto */ +#define SMART_OUTGOING_ONE_NEIGH (1<<5) /* On emission, consider only + one neighbor */ +#define SMART_INCOMING (SMART_INCOMING_FILTER | \ + SMART_INCOMING_ONE_PROTO | \ + SMART_INCOMING_ONE_NEIGH) +#define SMART_OUTGOING (SMART_OUTGOING_FILTER | \ + SMART_OUTGOING_ONE_PROTO | \ + SMART_OUTGOING_ONE_NEIGH) + +struct lldpd_config { + int c_paused; /* lldpd is paused */ + int c_tx_interval; /* Transmit interval */ + int c_smart; /* Bitmask for smart configuration (see SMART_*) */ + int c_receiveonly; /* Receive only mode */ + int c_max_neighbors; /* Maximum number of neighbors (per protocol) */ + + char *c_mgmt_pattern; /* Pattern to match a management address */ + char *c_cid_pattern; /* Pattern to match interfaces to use for chassis + * ID */ + char *c_iface_pattern; /* Pattern to match interfaces to use */ + + char *c_platform; /* Override platform description (for CDP) */ + char *c_description; /* Override chassis description */ + char *c_hostname; /* Override system name */ + int c_advertise_version; /* Should the precise version be advertised? */ + int c_set_ifdescr; /* Set interface description */ + int c_promisc; /* Interfaces should be in promiscuous mode */ + int c_tx_hold; /* Transmit hold */ + int c_bond_slave_src_mac_type; /* Src mac type in lldp frames over bond + * slaves */ + int c_lldp_portid_type; /* The PortID type */ +}; + +struct lldpd_frame { + int size; + unsigned char frame[]; +}; + +struct lldpd_hardware; +struct lldpd; +struct lldpd_ops { + int (*send)(struct lldpd *, + struct lldpd_hardware *, + char *, size_t); /* Function to send a frame */ + int (*recv)(struct lldpd *, + struct lldpd_hardware *, + int, char *, size_t); /* Function to receive a frame */ + int (*cleanup)(struct lldpd *, struct lldpd_hardware *); /* Cleanup */ +}; + +/* An interface is uniquely identified by h_ifindex, h_ifname and h_ops. This + * means if an interface becomes enslaved, it will be considered as a new + * interface. The same applies for renaming and we include the index in case of + * renaming to an existing interface. + */ +struct lldpd_hardware { + struct ovs_list h_entries; + + struct lldpd *h_cfg; /* Pointer to main configuration */ + void *h_recv; /* FD for reception */ + int h_sendfd; /* FD for sending, only used by h_ops */ + int h_mangle; /* 1 if we have to mangle the MAC address */ + struct lldpd_ops *h_ops; /* Hardware-dependent functions */ + void *h_data; /* Hardware-dependent data */ + void *h_timer; /* Timer for this port */ + + int h_mtu; + int h_flags; /* Packets will be sent only + * if IFF_RUNNING. Will be + * removed if this is left + * to 0. */ + int h_ifindex; /* Interface index, used by SNMP */ + char h_ifname[IFNAMSIZ]; /* Should be unique */ + u_int8_t h_lladdr[ETH_ADDR_LEN]; + + u_int64_t h_tx_cnt; + u_int64_t h_rx_cnt; + u_int64_t h_rx_discarded_cnt; + u_int64_t h_rx_unrecognized_cnt; + u_int64_t h_ageout_cnt; + u_int64_t h_insert_cnt; + u_int64_t h_delete_cnt; + u_int64_t h_drop_cnt; + + u_int16_t h_lport_cksum; /* Checksum on local port to see if there + * is a change + */ + struct lldpd_port h_lport; /* Port attached to this hardware port */ + struct ovs_list h_rports; /* Contains "struct lldp_port"s. */ +}; + +struct lldpd_interface; +struct lldpd_interface_list; + +struct lldpd_neighbor_change { + char *ifname; +#define NEIGHBOR_CHANGE_DELETED -1 +#define NEIGHBOR_CHANGE_ADDED 1 +#define NEIGHBOR_CHANGE_UPDATED 0 + int state; + struct lldpd_port *neighbor; +}; + +/* Cleanup functions */ +void lldpd_chassis_mgmt_cleanup(struct lldpd_chassis *); +void lldpd_chassis_cleanup(struct lldpd_chassis *, bool all); +void lldpd_remote_cleanup(struct lldpd_hardware *, + void (*expire)(struct lldpd_hardware *, struct lldpd_port *), bool all); +void lldpd_port_cleanup(struct lldpd_port *, bool all); +void lldpd_config_cleanup(struct lldpd_config *); + +#endif diff -Nru openvswitch-2.3.1/lib/lldp/lldp-tlv.h openvswitch-2.4.0~git20150623/lib/lldp/lldp-tlv.h --- openvswitch-2.3.1/lib/lldp/lldp-tlv.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lldp/lldp-tlv.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,89 @@ +/* -*- mode: c; c-file-style: "openbsd" -*- */ +/* + * Copyright (c) 2012 Vincent Bernat + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LLDP_TLV_H +#define _LLDP_TLV_H + +#define LLDP_MULTICAST_ADDR { \ + 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e \ +} + +#define LLDP_TLV_END 0 +#define LLDP_TLV_CHASSIS_ID 1 +#define LLDP_TLV_PORT_ID 2 +#define LLDP_TLV_TTL 3 +#define LLDP_TLV_PORT_DESCR 4 +#define LLDP_TLV_SYSTEM_NAME 5 +#define LLDP_TLV_SYSTEM_DESCR 6 +#define LLDP_TLV_SYSTEM_CAP 7 +#define LLDP_TLV_MGMT_ADDR 8 +#define LLDP_TLV_ORG 127 + +#define LLDP_TLV_ORG_DOT1 {0x00, 0x80, 0xc2} +#define LLDP_TLV_ORG_DOT3 {0x00, 0x12, 0x0f} +#define LLDP_TLV_ORG_MED {0x00, 0x12, 0xbb} +#define LLDP_TLV_ORG_AVAYA {0x00, 0x04, 0x0D} +#define LLDP_TLV_ORG_DCBX {0x00, 0x1b, 0x21} + +#define LLDP_TLV_DOT1_PVID 1 +#define LLDP_TLV_DOT1_PPVID 2 +#define LLDP_TLV_DOT1_VLANNAME 3 +#define LLDP_TLV_DOT1_PI 4 + +#define LLDP_TLV_DOT3_MAC 1 +#define LLDP_TLV_DOT3_POWER 2 +#define LLDP_TLV_DOT3_LA 3 +#define LLDP_TLV_DOT3_MFS 4 + +#define LLDP_TLV_MED_CAP 1 +#define LLDP_TLV_MED_POLICY 2 +#define LLDP_TLV_MED_LOCATION 3 +#define LLDP_TLV_MED_MDI 4 +#define LLDP_TLV_MED_IV_HW 5 +#define LLDP_TLV_MED_IV_FW 6 +#define LLDP_TLV_MED_IV_SW 7 +#define LLDP_TLV_MED_IV_SN 8 +#define LLDP_TLV_MED_IV_MANUF 9 +#define LLDP_TLV_MED_IV_MODEL 10 +#define LLDP_TLV_MED_IV_ASSET 11 + +#define LLDP_TLV_AA_ELEMENT_SUBTYPE 0x0b +#define LLDP_TLV_AA_ISID_VLAN_ASGNS_SUBTYPE 0x0c +#define LLDP_TLV_AA_ISID_VLAN_DIGEST_LENGTH 32 + +#define LLDP_TLV_AA_ELEM_TYPE_UNKNOWN 1 +#define LLDP_TLV_AA_ELEM_TYPE_SERVER 2 +#define LLDP_TLV_AA_ELEM_TYPE_PROXY 3 +#define LLDP_TLV_AA_ELEM_TYPE_SERV_NO_AUTH 4 +#define LLDP_TLV_AA_ELEM_TYPE_PROXY_NO_AUTH 5 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_WIRELESS_ACCESS_POINT_TYPE1 6 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_WIRELESS_ACCESS_POINT_TYPE2 7 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_SWITCH 8 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_ROUTER 9 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_IP_PHONE 10 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_IP_CAMERA 11 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_IP_VIDEO 12 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_SECURITY_DEVICE 13 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_VIRTUAL_SWITCH 14 +#define LLDP_TLV_AA_ELEM_TYPE_CLIENT_SERVER_ENDPOINT 15 + +#define LLDP_TLV_AA_ELEM_CONN_TYPE_SINGLE 0 +#define LLDP_TLV_AA_ELEM_CONN_TYPE_MLT 1 +#define LLDP_TLV_AA_ELEM_CONN_TYPE_SLT 2 +#define LLDP_TLV_AA_ELEM_CONN_TYPE_SMLT 3 + +#endif diff -Nru openvswitch-2.3.1/lib/lockfile.c openvswitch-2.4.0~git20150623/lib/lockfile.c --- openvswitch-2.3.1/lib/lockfile.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/lockfile.c 2015-06-23 18:46:21.000000000 +0000 @@ -30,7 +30,7 @@ #include "ovs-thread.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(lockfile); @@ -82,6 +82,14 @@ * symlink, not one for each. */ filename = follow_symlinks(filename_); slash = strrchr(filename, '/'); + +#ifdef _WIN32 + char *backslash = strrchr(filename, '\\'); + if (backslash && (!slash || backslash > slash)) { + slash = backslash; + } +#endif + lockname = (slash ? xasprintf("%.*s/.%s.~lock~", (int) (slash - filename), filename, slash + 1) @@ -276,8 +284,9 @@ retval = LockFileEx(lock_handle, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, 1, 0, &overl); if (!retval) { - VLOG_WARN("Failed to lock file : %s", ovs_lasterror_to_string()); - return EEXIST; + VLOG_DBG("Failed to lock file : %s", ovs_lasterror_to_string()); + *pidp = getpid(); + return EDEADLK; } lockfile = xmalloc(sizeof *lockfile); diff -Nru openvswitch-2.3.1/lib/mac-learning.c openvswitch-2.4.0~git20150623/lib/mac-learning.c --- openvswitch-2.3.1/lib/mac-learning.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/mac-learning.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ } static struct mac_entry * -mac_entry_from_lru_node(struct list *list) +mac_entry_from_lru_node(struct ovs_list *list) { return CONTAINER_OF(list, struct mac_entry, lru_node); } @@ -69,6 +69,90 @@ return NULL; } +static struct mac_learning_port * +mac_learning_port_lookup(struct mac_learning *ml, void *port) +{ + struct mac_learning_port *mlport; + + HMAP_FOR_EACH_IN_BUCKET (mlport, hmap_node, hash_pointer(port, ml->secret), + &ml->ports_by_ptr) { + if (mlport->port == port) { + return mlport; + } + } + return NULL; +} + +/* Changes the client-owned pointer for entry 'e' in 'ml' to 'port'. The + * pointer can be retrieved with mac_entry_get_port(). + * + * The MAC-learning implementation treats the data that 'port' points to as + * opaque and never tries to dereference it. However, when a MAC learning + * table becomes overfull, so that eviction is required, the implementation + * does first evict MAC entries for the most common 'port's values in 'ml', so + * that there is a degree of fairness, that is, each port is entitled to its + * fair share of MAC entries. */ +void +mac_entry_set_port(struct mac_learning *ml, struct mac_entry *e, void *port) + OVS_REQ_WRLOCK(ml->rwlock) +{ + if (mac_entry_get_port(ml, e) != port) { + ml->need_revalidate = true; + + if (e->mlport) { + struct mac_learning_port *mlport = e->mlport; + list_remove(&e->port_lru_node); + + if (list_is_empty(&mlport->port_lrus)) { + ovs_assert(mlport->heap_node.priority == 1); + hmap_remove(&ml->ports_by_ptr, &mlport->hmap_node); + heap_remove(&ml->ports_by_usage, &mlport->heap_node); + free(mlport); + } else { + ovs_assert(mlport->heap_node.priority > 1); + heap_change(&ml->ports_by_usage, &mlport->heap_node, + mlport->heap_node.priority - 1); + } + e->mlport = NULL; + } + + if (port) { + struct mac_learning_port *mlport; + + mlport = mac_learning_port_lookup(ml, port); + if (!mlport) { + mlport = xzalloc(sizeof *mlport); + hmap_insert(&ml->ports_by_ptr, &mlport->hmap_node, + hash_pointer(port, ml->secret)); + heap_insert(&ml->ports_by_usage, &mlport->heap_node, 1); + mlport->port = port; + list_init(&mlport->port_lrus); + } else { + heap_change(&ml->ports_by_usage, &mlport->heap_node, + mlport->heap_node.priority + 1); + } + list_push_back(&mlport->port_lrus, &e->port_lru_node); + e->mlport = mlport; + } + } +} + +/* Finds one of the ports with the most MAC entries and evicts its least + * recently used entry. */ +static void +evict_mac_entry_fairly(struct mac_learning *ml) + OVS_REQ_WRLOCK(ml->rwlock) +{ + struct mac_learning_port *mlport; + struct mac_entry *e; + + mlport = CONTAINER_OF(heap_max(&ml->ports_by_usage), + struct mac_learning_port, heap_node); + e = CONTAINER_OF(list_front(&mlport->port_lrus), + struct mac_entry, port_lru_node); + mac_learning_expire(ml, e); +} + /* If the LRU list is not empty, stores the least-recently-used entry in '*e' * and returns true. Otherwise, if the LRU list is empty, stores NULL in '*e' * and return false. */ @@ -109,6 +193,8 @@ ml->idle_time = normalize_idle_time(idle_time); ml->max_entries = MAC_DEFAULT_MAX; ml->need_revalidate = false; + hmap_init(&ml->ports_by_ptr); + heap_init(&ml->ports_by_usage); ovs_refcount_init(&ml->ref_cnt); ovs_rwlock_init(&ml->rwlock); return ml; @@ -131,13 +217,16 @@ if (ml && ovs_refcount_unref(&ml->ref_cnt) == 1) { struct mac_entry *e, *next; + ovs_rwlock_wrlock(&ml->rwlock); HMAP_FOR_EACH_SAFE (e, next, hmap_node, &ml->table) { - hmap_remove(&ml->table, &e->hmap_node); - free(e); + mac_learning_expire(ml, e); } hmap_destroy(&ml->table); + hmap_destroy(&ml->ports_by_ptr); + heap_destroy(&ml->ports_by_usage); bitmap_free(ml->flood_vlans); + ovs_rwlock_unlock(&ml->rwlock); ovs_rwlock_destroy(&ml->rwlock); free(ml); } @@ -207,11 +296,9 @@ * by calling mac_learning_may_learn(), that 'src_mac' and 'vlan' are * learnable. * - * If the returned MAC entry is new (as may be determined by calling - * mac_entry_is_new()), then the caller must pass the new entry to - * mac_learning_changed(). The caller must also initialize the new entry's - * 'port' member. Otherwise calling those functions is at the caller's - * discretion. */ + * If the returned MAC entry is new (that is, if it has a NULL client-provided + * port, as returned by mac_entry_get_port()), then the caller must initialize + * the new entry's port to a nonnull value with mac_entry_set_port(). */ struct mac_entry * mac_learning_insert(struct mac_learning *ml, const uint8_t src_mac[ETH_ADDR_LEN], uint16_t vlan) @@ -223,8 +310,7 @@ uint32_t hash = mac_table_hash(ml, src_mac, vlan); if (hmap_count(&ml->table) >= ml->max_entries) { - get_lru(ml, &e); - mac_learning_expire(ml, e); + evict_mac_entry_fairly(ml); } e = xmalloc(sizeof *e); @@ -232,37 +318,25 @@ memcpy(e->mac, src_mac, ETH_ADDR_LEN); e->vlan = vlan; e->grat_arp_lock = TIME_MIN; - e->port.p = NULL; + e->mlport = NULL; + COVERAGE_INC(mac_learning_learned); } else { list_remove(&e->lru_node); } /* Mark 'e' as recently used. */ list_push_back(&ml->lrus, &e->lru_node); + if (e->mlport) { + list_remove(&e->port_lru_node); + list_push_back(&e->mlport->port_lrus, &e->port_lru_node); + } e->expires = time_now() + ml->idle_time; return e; } -/* Changes 'e''s tag to a new, randomly selected one. Causes - * mac_learning_run() to flag for revalidation the tag that would have been - * previously used for this entry's MAC and VLAN (either before 'e' was - * inserted, if it is new, or otherwise before its port was updated.) - * - * The client should call this function after obtaining a MAC learning entry - * from mac_learning_insert(), if the entry is either new or if its learned - * port has changed. */ -void -mac_learning_changed(struct mac_learning *ml) -{ - COVERAGE_INC(mac_learning_learned); - ml->need_revalidate = true; -} - /* Looks up MAC 'dst' for VLAN 'vlan' in 'ml' and returns the associated MAC - * learning entry, if any. If 'tag' is nonnull, then the tag that associates - * 'dst' and 'vlan' with its currently learned port will be OR'd into - * '*tag'. */ + * learning entry, if any. */ struct mac_entry * mac_learning_lookup(const struct mac_learning *ml, const uint8_t dst[ETH_ADDR_LEN], uint16_t vlan) @@ -278,7 +352,7 @@ } else { struct mac_entry *e = mac_entry_lookup(ml, dst, vlan); - ovs_assert(e == NULL || e->port.p != NULL); + ovs_assert(e == NULL || mac_entry_get_port(ml, e) != NULL); return e; } } @@ -287,21 +361,19 @@ void mac_learning_expire(struct mac_learning *ml, struct mac_entry *e) { + ml->need_revalidate = true; + mac_entry_set_port(ml, e, NULL); hmap_remove(&ml->table, &e->hmap_node); list_remove(&e->lru_node); free(e); } -/* Expires all the mac-learning entries in 'ml'. If not NULL, the tags in 'ml' - * are added to 'tags'. Otherwise the tags in 'ml' are discarded. The client - * is responsible for revalidating any flows that depend on 'ml', if - * necessary. */ +/* Expires all the mac-learning entries in 'ml'. */ void mac_learning_flush(struct mac_learning *ml) { struct mac_entry *e; while (get_lru(ml, &e)){ - ml->need_revalidate = true; mac_learning_expire(ml, e); } hmap_shrink(&ml->table); @@ -319,7 +391,6 @@ && (hmap_count(&ml->table) > ml->max_entries || time_now() >= e->expires)) { COVERAGE_INC(mac_learning_expired); - ml->need_revalidate = true; mac_learning_expire(ml, e); } diff -Nru openvswitch-2.3.1/lib/mac-learning.h openvswitch-2.4.0~git20150623/lib/mac-learning.h --- openvswitch-2.3.1/lib/mac-learning.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/mac-learning.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ #define MAC_LEARNING_H 1 #include +#include "heap.h" #include "hmap.h" #include "list.h" #include "ovs-atomic.h" @@ -25,6 +26,66 @@ #include "packets.h" #include "timeval.h" +/* MAC learning table + * ================== + * + * A MAC learning table is a dictionary data structure that is specialized to + * map from an (Ethernet address, VLAN ID) pair to a user-provided pointer. In + * an Ethernet switch implementation, it used to keep track of the port on + * which a packet from a given Ethernet address was last seen. This knowledge + * is useful when the switch receives a packet to such an Ethernet address, so + * that the switch can send the packet directly to the correct port instead of + * having to flood it to every port. + * + * A few complications make the implementation into more than a simple wrapper + * around a hash table. First, and most simply, MAC learning can be disabled + * on a per-VLAN basis. (This is most useful for RSPAN; see + * ovs-vswitchd.conf.db(5) documentation of the "output_vlan" column in the + * Mirror table for more information.). The data structure maintains a bitmap + * to track such VLANs. + * + * Second, the implementation has the ability to "lock" a MAC table entry + * updated by a gratuitous ARP. This is a simple feature but the rationale for + * it is complicated. Please refer to the description of SLB bonding in + * vswitchd/INTERNALS for an explanation. + * + * Third, the implementation expires entries that are idle for longer than a + * configurable amount of time. This is implemented by keeping all of the + * current table entries on a list ordered from least recently used (LRU) to + * most recently used (MRU). Each time a MAC entry is used, it is moved to the + * MRU end of the list. Periodically mac_learning_run() sweeps through the + * list starting from the LRU end, deleting each entry that has been idle too + * long. + * + * Finally, the number of MAC learning table entries has a configurable maximum + * size to prevent memory exhaustion. When a new entry must be inserted but + * the table is already full, the implementation uses an eviction strategy + * based on fairness: it chooses the port that currently has greatest number of + * learned MACs (choosing arbitrarily in case of a tie), and among that port's + * entries it evicts the least recently used. (This is a security feature + * because it prevents an attacker from forcing other ports' MACs out of the + * MAC learning table with a "MAC flooding attack" that causes the other ports' + * traffic to be flooded so that the attacker can easily sniff it.) The + * implementation of this feature is like a specialized form of the + * general-purpose "eviction groups" that OVS implements in OpenFlow (see the + * documentation of the "groups" column in the Flow_Table table in + * ovs-vswitchd.conf.db(5) for details). + * + * + * Thread-safety + * ============= + * + * Many operations require the caller to take the MAC learning table's rwlock + * for writing (please refer to the Clang thread safety annotations). The + * important exception to this is mac_learning_lookup(), which only needs a + * read lock. This is useful for the common case where a MAC learning entry + * being looked up already exists and does not need an update. However, + * there's no deadlock-free way to upgrade a read lock to a write lock, so in + * the case where the lookup result means that an update is required, the + * caller must drop the read lock, take the write lock, and then repeat the + * lookup (in case some other thread has already made a change). + */ + struct mac_learning; /* Default maximum size of a MAC learning table, in entries. */ @@ -38,7 +99,7 @@ #define MAC_GRAT_ARP_LOCK_TIME 5 /* A MAC learning table entry. - * Guarded by owning 'mac_learning''s rwlock */ + * Guarded by owning 'mac_learning''s rwlock. */ struct mac_entry { struct hmap_node hmap_node; /* Node in a mac_learning hmap. */ time_t expires; /* Expiration time. */ @@ -47,14 +108,30 @@ uint16_t vlan; /* VLAN tag. */ /* The following are marked guarded to prevent users from iterating over or - * accessing a mac_entry without hodling the parent mac_learning rwlock. */ - struct list lru_node OVS_GUARDED; /* Element in 'lrus' list. */ + * accessing a mac_entry without holding the parent mac_learning rwlock. */ + struct ovs_list lru_node OVS_GUARDED; /* Element in 'lrus' list. */ + + /* Learned port. + * + * The client-specified data is mlport->port. */ + struct mac_learning_port *mlport; + struct ovs_list port_lru_node; /* In mac_learning_port's "port_lru"s. */ +}; - /* Learned port. */ - union { - void *p; - ofp_port_t ofp_port; - } port OVS_GUARDED; +static inline void *mac_entry_get_port(const struct mac_learning *ml, + const struct mac_entry *); +void mac_entry_set_port(struct mac_learning *, struct mac_entry *, void *port); + +/* Information about client-provided port pointers (the 'port' member), to + * allow for per-port fairness. + * + * The client-provided pointer is opaque to the MAC-learning table, which never + * dereferences it. */ +struct mac_learning_port { + struct hmap_node hmap_node; /* In mac_learning's "ports_by_ptr". */ + struct heap_node heap_node; /* In mac_learning's "ports_by_usage". */ + void *port; /* Client-provided port pointer. */ + struct ovs_list port_lrus; /* Contains "struct mac_entry"s by port_lru. */ }; /* Sets a gratuitous ARP lock on 'mac' that will expire in @@ -74,8 +151,7 @@ /* MAC learning table. */ struct mac_learning { struct hmap table; /* Learning table. */ - struct list lrus OVS_GUARDED; /* In-use entries, least recently used at the - front, most recently used at the back. */ + struct ovs_list lrus OVS_GUARDED; /* In-use entries, LRU at front. */ uint32_t secret; /* Secret for randomizing hash table. */ unsigned long *flood_vlans; /* Bitmap of learning disabled VLANs. */ unsigned int idle_time; /* Max age before deleting an entry. */ @@ -83,6 +159,21 @@ struct ovs_refcount ref_cnt; struct ovs_rwlock rwlock; bool need_revalidate; + + /* Fairness. + * + * Both of these data structures include the same "struct + * mac_learning_port" but indexed differently. + * + * ports_by_usage is a per-port max-heap, in which the priority is the + * number of MAC addresses for the port. When the MAC learning table + * overflows, this allows us to evict a MAC entry from one of the ports + * that have the largest number of MAC entries, achieving a form of + * fairness. + * + * ports_by_ptr is a hash table indexed by the client-provided pointer. */ + struct hmap ports_by_ptr; /* struct mac_learning_port hmap_nodes. */ + struct heap ports_by_usage; /* struct mac_learning_port heap_nodes. */ }; int mac_entry_age(const struct mac_learning *ml, const struct mac_entry *e) @@ -116,7 +207,6 @@ const uint8_t src[ETH_ADDR_LEN], uint16_t vlan) OVS_REQ_WRLOCK(ml->rwlock); -void mac_learning_changed(struct mac_learning *ml) OVS_REQ_WRLOCK(ml->rwlock); /* Lookup. */ struct mac_entry *mac_learning_lookup(const struct mac_learning *ml, @@ -128,5 +218,15 @@ void mac_learning_expire(struct mac_learning *ml, struct mac_entry *e) OVS_REQ_WRLOCK(ml->rwlock); void mac_learning_flush(struct mac_learning *ml) OVS_REQ_WRLOCK(ml->rwlock); + +/* Inlines. */ + +static inline void * +mac_entry_get_port(const struct mac_learning *ml OVS_UNUSED, + const struct mac_entry *e) + OVS_REQ_RDLOCK(ml->rwlock) +{ + return e->mlport ? e->mlport->port : NULL; +} #endif /* mac-learning.h */ diff -Nru openvswitch-2.3.1/lib/match.c openvswitch-2.4.0~git20150623/lib/match.c --- openvswitch-2.3.1/lib/match.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/match.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,108 +39,11 @@ void match_wc_init(struct match *match, const struct flow *flow) { - struct flow_wildcards *wc; - int i; - match->flow = *flow; - wc = &match->wc; - memset(&wc->masks, 0x0, sizeof wc->masks); - - memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type); - - if (flow->nw_proto) { - memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); - } - if (flow->skb_priority) { - memset(&wc->masks.skb_priority, 0xff, sizeof wc->masks.skb_priority); - } - - if (flow->pkt_mark) { - memset(&wc->masks.pkt_mark, 0xff, sizeof wc->masks.pkt_mark); - } - - for (i = 0; i < FLOW_N_REGS; i++) { - if (flow->regs[i]) { - memset(&wc->masks.regs[i], 0xff, sizeof wc->masks.regs[i]); - } - } - - if (flow->tunnel.ip_dst) { - if (flow->tunnel.flags & FLOW_TNL_F_KEY) { - memset(&wc->masks.tunnel.tun_id, 0xff, sizeof wc->masks.tunnel.tun_id); - } - memset(&wc->masks.tunnel.ip_src, 0xff, sizeof wc->masks.tunnel.ip_src); - memset(&wc->masks.tunnel.ip_dst, 0xff, sizeof wc->masks.tunnel.ip_dst); - memset(&wc->masks.tunnel.flags, 0xff, sizeof wc->masks.tunnel.flags); - memset(&wc->masks.tunnel.ip_tos, 0xff, sizeof wc->masks.tunnel.ip_tos); - memset(&wc->masks.tunnel.ip_ttl, 0xff, sizeof wc->masks.tunnel.ip_ttl); - } else if (flow->tunnel.tun_id) { - memset(&wc->masks.tunnel.tun_id, 0xff, sizeof wc->masks.tunnel.tun_id); - } - - memset(&wc->masks.metadata, 0xff, sizeof wc->masks.metadata); - memset(&wc->masks.in_port, 0xff, sizeof wc->masks.in_port); - memset(&wc->masks.vlan_tci, 0xff, sizeof wc->masks.vlan_tci); - memset(&wc->masks.dl_src, 0xff, sizeof wc->masks.dl_src); - memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst); - - if (flow->dl_type == htons(ETH_TYPE_IPV6)) { - memset(&wc->masks.ipv6_src, 0xff, sizeof wc->masks.ipv6_src); - memset(&wc->masks.ipv6_dst, 0xff, sizeof wc->masks.ipv6_dst); - memset(&wc->masks.ipv6_label, 0xff, sizeof wc->masks.ipv6_label); - } else if (flow->dl_type == htons(ETH_TYPE_IP) || - (flow->dl_type == htons(ETH_TYPE_ARP)) || - (flow->dl_type == htons(ETH_TYPE_RARP))) { - memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src); - memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst); - } else if (eth_type_mpls(flow->dl_type)) { - int i; - - for (i = 0; i < FLOW_MAX_MPLS_LABELS; i++) { - wc->masks.mpls_lse[i] = OVS_BE32_MAX; - if (flow->mpls_lse[i] & htonl(MPLS_BOS_MASK)) { - break; - } - } - } - - if (flow->dl_type == htons(ETH_TYPE_ARP) || - flow->dl_type == htons(ETH_TYPE_RARP)) { - memset(&wc->masks.arp_sha, 0xff, sizeof wc->masks.arp_sha); - memset(&wc->masks.arp_tha, 0xff, sizeof wc->masks.arp_tha); - } - - if (is_ip_any(flow)) { - memset(&wc->masks.nw_tos, 0xff, sizeof wc->masks.nw_tos); - memset(&wc->masks.nw_ttl, 0xff, sizeof wc->masks.nw_ttl); - - if (flow->nw_frag) { - memset(&wc->masks.nw_frag, 0xff, sizeof wc->masks.nw_frag); - if (flow->nw_frag & FLOW_NW_FRAG_LATER) { - /* No transport layer header in later fragments. */ - return; - } - } - - if (flow->nw_proto == IPPROTO_ICMP || - flow->nw_proto == IPPROTO_ICMPV6 || - (flow->tp_src || flow->tp_dst)) { - memset(&wc->masks.tp_src, 0xff, sizeof wc->masks.tp_src); - memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst); - } - if (flow->nw_proto == IPPROTO_TCP) { - memset(&wc->masks.tcp_flags, 0xff, sizeof wc->masks.tcp_flags); - } - - if (flow->nw_proto == IPPROTO_ICMPV6) { - memset(&wc->masks.arp_sha, 0xff, sizeof wc->masks.arp_sha); - memset(&wc->masks.arp_tha, 0xff, sizeof wc->masks.arp_tha); - memset(&wc->masks.nd_target, 0xff, sizeof wc->masks.nd_target); - } - } - - return; + flow_wildcards_init_for_packet(&match->wc, flow); + WC_MASK_FIELD(&match->wc, regs); + WC_MASK_FIELD(&match->wc, metadata); } /* Initializes 'match' as a "catch-all" match that matches every packet. */ @@ -186,6 +89,13 @@ } void +match_set_conj_id(struct match *match, uint32_t value) +{ + match->flow.conj_id = value; + match->wc.masks.conj_id = UINT32_MAX; +} + +void match_set_reg(struct match *match, unsigned int reg_idx, uint32_t value) { match_set_reg_masked(match, reg_idx, value, UINT32_MAX); @@ -201,6 +111,28 @@ } void +match_set_xreg(struct match *match, unsigned int xreg_idx, uint64_t value) +{ + match_set_xreg_masked(match, xreg_idx, value, UINT64_MAX); +} + +void +match_set_xreg_masked(struct match *match, unsigned int xreg_idx, + uint64_t value, uint64_t mask) +{ + ovs_assert(xreg_idx < FLOW_N_XREGS); + flow_wildcards_set_xreg_mask(&match->wc, xreg_idx, mask); + flow_set_xreg(&match->flow, xreg_idx, value & mask); +} + +void +match_set_actset_output(struct match *match, ofp_port_t actset_output) +{ + match->wc.masks.actset_output = u16_to_ofp(UINT16_MAX); + match->flow.actset_output = actset_output; +} + +void match_set_metadata(struct match *match, ovs_be64 metadata) { match_set_metadata_masked(match, metadata, OVS_BE64_MAX); @@ -293,6 +225,32 @@ } void +match_set_tun_gbp_id_masked(struct match *match, ovs_be16 gbp_id, ovs_be16 mask) +{ + match->wc.masks.tunnel.gbp_id = mask; + match->flow.tunnel.gbp_id = gbp_id & mask; +} + +void +match_set_tun_gbp_id(struct match *match, ovs_be16 gbp_id) +{ + match_set_tun_gbp_id_masked(match, gbp_id, OVS_BE16_MAX); +} + +void +match_set_tun_gbp_flags_masked(struct match *match, uint8_t flags, uint8_t mask) +{ + match->wc.masks.tunnel.gbp_flags = mask; + match->flow.tunnel.gbp_flags = flags & mask; +} + +void +match_set_tun_gbp_flags(struct match *match, uint8_t flags) +{ + match_set_tun_gbp_flags_masked(match, flags, UINT8_MAX); +} + +void match_set_in_port(struct match *match, ofp_port_t ofp_port) { match->wc.masks.in_port.ofp_port = u16_to_ofp(UINT16_MAX); @@ -818,8 +776,9 @@ } static void -format_eth_masked(struct ds *s, const char *name, const uint8_t eth[6], - const uint8_t mask[6]) +format_eth_masked(struct ds *s, const char *name, + const uint8_t eth[ETH_ADDR_LEN], + const uint8_t mask[ETH_ADDR_LEN]) { if (!eth_addr_is_zero(mask)) { ds_put_format(s, "%s=", name); @@ -919,6 +878,15 @@ format_ip_netmask(s, "tun_src", tnl->ip_src, wc->masks.tunnel.ip_src); format_ip_netmask(s, "tun_dst", tnl->ip_dst, wc->masks.tunnel.ip_dst); + if (wc->masks.tunnel.gbp_id) { + format_be16_masked(s, "tun_gbp_id", tnl->gbp_id, + wc->masks.tunnel.gbp_id); + } + + if (wc->masks.tunnel.gbp_flags) { + ds_put_format(s, "tun_gbp_flags=%#"PRIx8",", tnl->gbp_flags); + } + if (wc->masks.tunnel.ip_tos) { ds_put_format(s, "tun_tos=%"PRIx8",", tnl->ip_tos); } @@ -934,7 +902,7 @@ /* Appends a string representation of 'match' to 's'. If 'priority' is * different from OFP_DEFAULT_PRIORITY, includes it in 's'. */ void -match_format(const struct match *match, struct ds *s, unsigned int priority) +match_format(const struct match *match, struct ds *s, int priority) { const struct flow_wildcards *wc = &match->wc; size_t start_len = s->length; @@ -944,10 +912,10 @@ int i; - BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26); + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); if (priority != OFP_DEFAULT_PRIORITY) { - ds_put_format(s, "priority=%u,", priority); + ds_put_format(s, "priority=%d,", priority); } format_uint32_masked(s, "pkt_mark", f->pkt_mark, wc->masks.pkt_mark); @@ -957,15 +925,25 @@ wc->masks.recirc_id); } - if (f->dp_hash && wc->masks.dp_hash) { + if (wc->masks.dp_hash) { format_uint32_masked(s, "dp_hash", f->dp_hash, wc->masks.dp_hash); } + if (wc->masks.conj_id) { + ds_put_format(s, "conj_id=%"PRIu32",", f->conj_id); + } + if (wc->masks.skb_priority) { ds_put_format(s, "skb_priority=%#"PRIx32",", f->skb_priority); } + if (wc->masks.actset_output) { + ds_put_cstr(s, "actset_output="); + ofputil_format_port(f->actset_output, s); + ds_put_char(s, ','); + } + if (wc->masks.dl_type) { skip_type = true; if (f->dl_type == htons(ETH_TYPE_IP)) { @@ -973,6 +951,8 @@ skip_proto = true; if (f->nw_proto == IPPROTO_ICMP) { ds_put_cstr(s, "icmp,"); + } else if (f->nw_proto == IPPROTO_IGMP) { + ds_put_cstr(s, "igmp,"); } else if (f->nw_proto == IPPROTO_TCP) { ds_put_cstr(s, "tcp,"); } else if (f->nw_proto == IPPROTO_UDP) { @@ -1108,19 +1088,19 @@ } if (wc->masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK)) { ds_put_format(s, "mpls_label=%"PRIu32",", - mpls_lse_to_label(f->mpls_lse[0])); + mpls_lse_to_label(f->mpls_lse[0])); } if (wc->masks.mpls_lse[0] & htonl(MPLS_TC_MASK)) { ds_put_format(s, "mpls_tc=%"PRIu8",", - mpls_lse_to_tc(f->mpls_lse[0])); + mpls_lse_to_tc(f->mpls_lse[0])); } if (wc->masks.mpls_lse[0] & htonl(MPLS_TTL_MASK)) { ds_put_format(s, "mpls_ttl=%"PRIu8",", - mpls_lse_to_ttl(f->mpls_lse[0])); + mpls_lse_to_ttl(f->mpls_lse[0])); } if (wc->masks.mpls_lse[0] & htonl(MPLS_BOS_MASK)) { ds_put_format(s, "mpls_bos=%"PRIu8",", - mpls_lse_to_bos(f->mpls_lse[0])); + mpls_lse_to_bos(f->mpls_lse[0])); } format_be32_masked(s, "mpls_lse1", f->mpls_lse[1], wc->masks.mpls_lse[1]); format_be32_masked(s, "mpls_lse2", f->mpls_lse[2], wc->masks.mpls_lse[2]); @@ -1147,6 +1127,10 @@ f->nw_proto == IPPROTO_ICMP) { format_be16_masked(s, "icmp_type", f->tp_src, wc->masks.tp_src); format_be16_masked(s, "icmp_code", f->tp_dst, wc->masks.tp_dst); + } else if (f->dl_type == htons(ETH_TYPE_IP) && + f->nw_proto == IPPROTO_IGMP) { + format_be16_masked(s, "igmp_type", f->tp_src, wc->masks.tp_src); + format_be16_masked(s, "igmp_code", f->tp_dst, wc->masks.tp_dst); } else if (f->dl_type == htons(ETH_TYPE_IPV6) && f->nw_proto == IPPROTO_ICMPV6) { format_be16_masked(s, "icmp_type", f->tp_src, wc->masks.tp_src); @@ -1161,16 +1145,23 @@ } if (is_ip_any(f) && f->nw_proto == IPPROTO_TCP && wc->masks.tcp_flags) { uint16_t mask = TCP_FLAGS(wc->masks.tcp_flags); + if (mask == TCP_FLAGS(OVS_BE16_MAX)) { - ds_put_format(s, "tcp_flags=0x%03"PRIx16",", ntohs(f->tcp_flags)); - } else { + ds_put_cstr(s, "tcp_flags="); + if (f->tcp_flags) { + format_flags(s, packet_tcp_flag_to_string, ntohs(f->tcp_flags), + '|'); + } else { + ds_put_cstr(s, "0"); /* Zero flags. */ + } + } else if (mask) { format_flags_masked(s, "tcp_flags", packet_tcp_flag_to_string, ntohs(f->tcp_flags), mask); } } - if (s->length > start_len && ds_last(s) == ',') { - s->length--; + if (s->length > start_len) { + ds_chomp(s, ','); } } @@ -1178,7 +1169,7 @@ * different from OFP_DEFAULT_PRIORITY, includes it in the string. The caller * must free the string (with free()). */ char * -match_to_string(const struct match *match, unsigned int priority) +match_to_string(const struct match *match, int priority) { struct ds s = DS_EMPTY_INITIALIZER; match_format(match, &s, priority); @@ -1255,13 +1246,13 @@ minimatch_matches_flow(const struct minimatch *match, const struct flow *target) { - const uint32_t *target_u32 = (const uint32_t *) target; - const uint32_t *flowp = miniflow_get_u32_values(&match->flow); - const uint32_t *maskp = miniflow_get_u32_values(&match->mask.masks); - uint64_t map; + const uint64_t *target_u64 = (const uint64_t *) target; + const uint64_t *flowp = miniflow_get_values(&match->flow); + const uint64_t *maskp = miniflow_get_values(&match->mask.masks); + int idx; - for (map = match->flow.map; map; map = zero_rightmost_1bit(map)) { - if ((*flowp++ ^ target_u32[raw_ctz(map)]) & *maskp++) { + MAP_FOR_EACH_INDEX(idx, match->flow.map) { + if ((*flowp++ ^ target_u64[idx]) & *maskp++) { return false; } } @@ -1272,8 +1263,7 @@ /* Appends a string representation of 'match' to 's'. If 'priority' is * different from OFP_DEFAULT_PRIORITY, includes it in 's'. */ void -minimatch_format(const struct minimatch *match, struct ds *s, - unsigned int priority) +minimatch_format(const struct minimatch *match, struct ds *s, int priority) { struct match megamatch; @@ -1285,7 +1275,7 @@ * different from OFP_DEFAULT_PRIORITY, includes it in the string. The caller * must free the string (with free()). */ char * -minimatch_to_string(const struct minimatch *match, unsigned int priority) +minimatch_to_string(const struct minimatch *match, int priority) { struct match megamatch; diff -Nru openvswitch-2.3.1/lib/match.h openvswitch-2.4.0~git20150623/lib/match.h --- openvswitch-2.3.1/lib/match.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/match.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ #define MATCH_H 1 #include "flow.h" +#include "packets.h" struct ds; @@ -45,11 +46,16 @@ void match_set_dp_hash_masked(struct match *, uint32_t value, uint32_t mask); void match_set_recirc_id(struct match *, uint32_t value); -void match_set_recirc_id_masked(struct match *, uint32_t value, uint32_t mask); + +void match_set_conj_id(struct match *, uint32_t value); void match_set_reg(struct match *, unsigned int reg_idx, uint32_t value); void match_set_reg_masked(struct match *, unsigned int reg_idx, uint32_t value, uint32_t mask); +void match_set_xreg(struct match *, unsigned int xreg_idx, uint64_t value); +void match_set_xreg_masked(struct match *, unsigned int xreg_idx, + uint64_t value, uint64_t mask); +void match_set_actset_output(struct match *, ofp_port_t actset_output); void match_set_metadata(struct match *, ovs_be64 metadata); void match_set_metadata_masked(struct match *, ovs_be64 metadata, ovs_be64 mask); @@ -65,17 +71,21 @@ void match_set_tun_tos_masked(struct match *match, uint8_t tos, uint8_t mask); void match_set_tun_flags(struct match *match, uint16_t flags); void match_set_tun_flags_masked(struct match *match, uint16_t flags, uint16_t mask); +void match_set_tun_gbp_id_masked(struct match *match, ovs_be16 gbp_id, ovs_be16 mask); +void match_set_tun_gbp_id(struct match *match, ovs_be16 gbp_id); +void match_set_tun_gbp_flags_masked(struct match *match, uint8_t flags, uint8_t mask); +void match_set_tun_gbp_flags(struct match *match, uint8_t flags); void match_set_in_port(struct match *, ofp_port_t ofp_port); void match_set_pkt_mark(struct match *, uint32_t pkt_mark); void match_set_pkt_mark_masked(struct match *, uint32_t pkt_mark, uint32_t mask); void match_set_skb_priority(struct match *, uint32_t skb_priority); void match_set_dl_type(struct match *, ovs_be16); -void match_set_dl_src(struct match *, const uint8_t[6]); -void match_set_dl_src_masked(struct match *, const uint8_t dl_src[6], - const uint8_t mask[6]); -void match_set_dl_dst(struct match *, const uint8_t[6]); -void match_set_dl_dst_masked(struct match *, const uint8_t dl_dst[6], - const uint8_t mask[6]); +void match_set_dl_src(struct match *, const uint8_t[ETH_ADDR_LEN]); +void match_set_dl_src_masked(struct match *, const uint8_t dl_src[ETH_ADDR_LEN], + const uint8_t mask[ETH_ADDR_LEN]); +void match_set_dl_dst(struct match *, const uint8_t[ETH_ADDR_LEN]); +void match_set_dl_dst_masked(struct match *, const uint8_t dl_dst[ETH_ADDR_LEN], + const uint8_t mask[ETH_ADDR_LEN]); void match_set_dl_tci(struct match *, ovs_be16 tci); void match_set_dl_tci_masked(struct match *, ovs_be16 tci, ovs_be16 mask); void match_set_any_vid(struct match *); @@ -111,14 +121,14 @@ void match_set_nw_frag_masked(struct match *, uint8_t nw_frag, uint8_t mask); void match_set_icmp_type(struct match *, uint8_t); void match_set_icmp_code(struct match *, uint8_t); -void match_set_arp_sha(struct match *, const uint8_t[6]); +void match_set_arp_sha(struct match *, const uint8_t[ETH_ADDR_LEN]); void match_set_arp_sha_masked(struct match *, - const uint8_t arp_sha[6], - const uint8_t mask[6]); -void match_set_arp_tha(struct match *, const uint8_t[6]); + const uint8_t arp_sha[ETH_ADDR_LEN], + const uint8_t mask[ETH_ADDR_LEN]); +void match_set_arp_tha(struct match *, const uint8_t[ETH_ADDR_LEN]); void match_set_arp_tha_masked(struct match *, - const uint8_t arp_tha[6], - const uint8_t mask[6]); + const uint8_t arp_tha[ETH_ADDR_LEN], + const uint8_t mask[ETH_ADDR_LEN]); void match_set_ipv6_src(struct match *, const struct in6_addr *); void match_set_ipv6_src_masked(struct match *, const struct in6_addr *, const struct in6_addr *); @@ -137,8 +147,8 @@ void match_init_hidden_fields(struct match *); bool match_has_default_hidden_fields(const struct match *); -void match_format(const struct match *, struct ds *, unsigned int priority); -char *match_to_string(const struct match *, unsigned int priority); +void match_format(const struct match *, struct ds *, int priority); +char *match_to_string(const struct match *, int priority); void match_print(const struct match *); /* Compressed match. */ @@ -170,8 +180,7 @@ bool minimatch_matches_flow(const struct minimatch *, const struct flow *); -void minimatch_format(const struct minimatch *, struct ds *, - unsigned int priority); -char *minimatch_to_string(const struct minimatch *, unsigned int priority); +void minimatch_format(const struct minimatch *, struct ds *, int priority); +char *minimatch_to_string(const struct minimatch *, int priority); #endif /* match.h */ diff -Nru openvswitch-2.3.1/lib/mcast-snooping.c openvswitch-2.4.0~git20150623/lib/mcast-snooping.c --- openvswitch-2.3.1/lib/mcast-snooping.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/mcast-snooping.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,843 @@ +/* + * Copyright (c) 2014 Red Hat, Inc. + * + * Based on mac-learning implementation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "mcast-snooping.h" + +#include +#include + +#include "bitmap.h" +#include "byte-order.h" +#include "coverage.h" +#include "hash.h" +#include "list.h" +#include "poll-loop.h" +#include "timeval.h" +#include "entropy.h" +#include "unaligned.h" +#include "util.h" +#include "vlan-bitmap.h" +#include "openvswitch/vlog.h" + +COVERAGE_DEFINE(mcast_snooping_learned); +COVERAGE_DEFINE(mcast_snooping_expired); + +static struct mcast_port_bundle * +mcast_snooping_port_lookup(struct ovs_list *list, void *port); +static struct mcast_mrouter_bundle * +mcast_snooping_mrouter_lookup(struct mcast_snooping *ms, uint16_t vlan, + void *port) + OVS_REQ_RDLOCK(ms->rwlock); + +bool +mcast_snooping_enabled(const struct mcast_snooping *ms) +{ + return !!ms; +} + +bool +mcast_snooping_flood_unreg(const struct mcast_snooping *ms) +{ + return ms->flood_unreg; +} + +bool +mcast_snooping_is_query(ovs_be16 igmp_type) +{ + return igmp_type == htons(IGMP_HOST_MEMBERSHIP_QUERY); +} + +bool +mcast_snooping_is_membership(ovs_be16 igmp_type) +{ + switch (ntohs(igmp_type)) { + case IGMP_HOST_MEMBERSHIP_REPORT: + case IGMPV2_HOST_MEMBERSHIP_REPORT: + case IGMPV3_HOST_MEMBERSHIP_REPORT: + case IGMP_HOST_LEAVE_MESSAGE: + return true; + } + return false; +} + +/* Returns the number of seconds since multicast group 'b' was learned in a + * port on 'ms'. */ +int +mcast_bundle_age(const struct mcast_snooping *ms, + const struct mcast_group_bundle *b) +{ + time_t remaining = b->expires - time_now(); + return ms->idle_time - remaining; +} + +static uint32_t +mcast_table_hash(const struct mcast_snooping *ms, ovs_be32 grp_ip4, + uint16_t vlan) +{ + return hash_3words((OVS_FORCE uint32_t) grp_ip4, vlan, ms->secret); +} + +static struct mcast_group_bundle * +mcast_group_bundle_from_lru_node(struct ovs_list *list) +{ + return CONTAINER_OF(list, struct mcast_group_bundle, bundle_node); +} + +static struct mcast_group * +mcast_group_from_lru_node(struct ovs_list *list) +{ + return CONTAINER_OF(list, struct mcast_group, group_node); +} + +/* Searches 'ms' for and returns an mcast group for destination address + * 'dip' in 'vlan'. */ +struct mcast_group * +mcast_snooping_lookup(const struct mcast_snooping *ms, ovs_be32 dip, + uint16_t vlan) + OVS_REQ_RDLOCK(ms->rwlock) +{ + struct mcast_group *grp; + uint32_t hash; + + hash = mcast_table_hash(ms, dip, vlan); + HMAP_FOR_EACH_WITH_HASH (grp, hmap_node, hash, &ms->table) { + if (grp->vlan == vlan && grp->ip4 == dip) { + return grp; + } + } + return NULL; +} + +/* If the LRU list is not empty, stores the least-recently-used entry + * in '*e' and returns true. Otherwise, if the LRU list is empty, + * stores NULL in '*e' and return false. */ +static bool +group_get_lru(const struct mcast_snooping *ms, struct mcast_group **grp) + OVS_REQ_RDLOCK(ms->rwlock) +{ + if (!list_is_empty(&ms->group_lru)) { + *grp = mcast_group_from_lru_node(ms->group_lru.next); + return true; + } else { + *grp = NULL; + return false; + } +} + +static unsigned int +normalize_idle_time(unsigned int idle_time) +{ + return (idle_time < 15 ? 15 + : idle_time > 3600 ? 3600 + : idle_time); +} + +/* Creates and returns a new mcast table with an initial mcast aging + * timeout of MCAST_ENTRY_DEFAULT_IDLE_TIME seconds and an initial maximum of + * MCAST_DEFAULT_MAX entries. */ +struct mcast_snooping * +mcast_snooping_create(void) +{ + struct mcast_snooping *ms; + + ms = xmalloc(sizeof *ms); + hmap_init(&ms->table); + list_init(&ms->group_lru); + list_init(&ms->mrouter_lru); + list_init(&ms->fport_list); + list_init(&ms->rport_list); + ms->secret = random_uint32(); + ms->idle_time = MCAST_ENTRY_DEFAULT_IDLE_TIME; + ms->max_entries = MCAST_DEFAULT_MAX_ENTRIES; + ms->need_revalidate = false; + ms->flood_unreg = true; + ovs_refcount_init(&ms->ref_cnt); + ovs_rwlock_init(&ms->rwlock); + return ms; +} + +struct mcast_snooping * +mcast_snooping_ref(const struct mcast_snooping *ms_) +{ + struct mcast_snooping *ms = CONST_CAST(struct mcast_snooping *, ms_); + if (ms) { + ovs_refcount_ref(&ms->ref_cnt); + } + return ms; +} + +/* Unreferences (and possibly destroys) mcast snooping table 'ms'. */ +void +mcast_snooping_unref(struct mcast_snooping *ms) +{ + if (!mcast_snooping_enabled(ms)) { + return; + } + + if (ovs_refcount_unref_relaxed(&ms->ref_cnt) == 1) { + mcast_snooping_flush(ms); + hmap_destroy(&ms->table); + ovs_rwlock_destroy(&ms->rwlock); + free(ms); + } +} + +/* Changes the mcast aging timeout of 'ms' to 'idle_time' seconds. */ +void +mcast_snooping_set_idle_time(struct mcast_snooping *ms, unsigned int idle_time) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_group *grp; + struct mcast_group_bundle *b; + int delta; + + idle_time = normalize_idle_time(idle_time); + if (idle_time != ms->idle_time) { + delta = (int) idle_time - (int) ms->idle_time; + LIST_FOR_EACH (grp, group_node, &ms->group_lru) { + LIST_FOR_EACH (b, bundle_node, &grp->bundle_lru) { + b->expires += delta; + } + } + ms->idle_time = idle_time; + } +} + +/* Sets the maximum number of entries in 'ms' to 'max_entries', adjusting it + * to be within a reasonable range. */ +void +mcast_snooping_set_max_entries(struct mcast_snooping *ms, + size_t max_entries) + OVS_REQ_WRLOCK(ms->rwlock) +{ + ms->max_entries = (max_entries < 10 ? 10 + : max_entries > 1000 * 1000 ? 1000 * 1000 + : max_entries); +} + +/* Sets if unregistered multicast packets should be flooded to + * all ports or only to ports connected to multicast routers + * + * Returns true if previous state differs from current state, + * false otherwise. */ +bool +mcast_snooping_set_flood_unreg(struct mcast_snooping *ms, bool enable) + OVS_REQ_WRLOCK(ms->rwlock) +{ + bool prev = ms->flood_unreg; + ms->flood_unreg = enable; + return prev != enable; +} + +static struct mcast_group_bundle * +mcast_group_bundle_lookup(struct mcast_snooping *ms OVS_UNUSED, + struct mcast_group *grp, void *port) + OVS_REQ_RDLOCK(ms->rwlock) +{ + struct mcast_group_bundle *b; + + LIST_FOR_EACH (b, bundle_node, &grp->bundle_lru) { + if (b->port == port) { + return b; + } + } + return NULL; +} + +/* Insert a new bundle to the mcast group or update its + * position and expiration if it is already there. */ +static struct mcast_group_bundle * +mcast_group_insert_bundle(struct mcast_snooping *ms OVS_UNUSED, + struct mcast_group *grp, void *port, int idle_time) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_group_bundle *b; + + b = mcast_group_bundle_lookup(ms, grp, port); + if (b) { + list_remove(&b->bundle_node); + } else { + b = xmalloc(sizeof *b); + list_init(&b->bundle_node); + b->port = port; + } + + b->expires = time_now() + idle_time; + list_push_back(&grp->bundle_lru, &b->bundle_node); + return b; +} + +/* Return true if multicast still has bundles associated. + * Return false if there is no bundles. */ +static bool +mcast_group_has_bundles(struct mcast_group *grp) +{ + return !list_is_empty(&grp->bundle_lru); +} + +/* Delete 'grp' from the 'ms' hash table. + * Caller is responsible to clean bundle lru first. */ +static void +mcast_snooping_flush_group__(struct mcast_snooping *ms, + struct mcast_group *grp) +{ + ovs_assert(list_is_empty(&grp->bundle_lru)); + hmap_remove(&ms->table, &grp->hmap_node); + list_remove(&grp->group_node); + free(grp); +} + +/* Flush out mcast group and its bundles */ +static void +mcast_snooping_flush_group(struct mcast_snooping *ms, struct mcast_group *grp) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_group_bundle *b; + + LIST_FOR_EACH_POP (b, bundle_node, &grp->bundle_lru) { + free(b); + } + mcast_snooping_flush_group__(ms, grp); + ms->need_revalidate = true; +} + + +/* Delete bundle returning true if it succeeds, + * false if it didn't find the group. */ +static bool +mcast_group_delete_bundle(struct mcast_snooping *ms OVS_UNUSED, + struct mcast_group *grp, void *port) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_group_bundle *b; + + LIST_FOR_EACH (b, bundle_node, &grp->bundle_lru) { + if (b->port == port) { + list_remove(&b->bundle_node); + free(b); + return true; + } + } + return false; +} + +/* If any bundle has expired, delete it. Returns the number of deleted + * bundles. */ +static int +mcast_snooping_prune_expired(struct mcast_snooping *ms, + struct mcast_group *grp) + OVS_REQ_WRLOCK(ms->rwlock) +{ + int expired; + struct mcast_group_bundle *b, *next_b; + time_t timenow = time_now(); + + expired = 0; + LIST_FOR_EACH_SAFE (b, next_b, bundle_node, &grp->bundle_lru) { + /* This list is sorted on expiration time. */ + if (b->expires > timenow) { + break; + } + list_remove(&b->bundle_node); + free(b); + expired++; + } + + if (!mcast_group_has_bundles(grp)) { + mcast_snooping_flush_group__(ms, grp); + expired++; + } + + if (expired) { + ms->need_revalidate = true; + COVERAGE_ADD(mcast_snooping_expired, expired); + } + + return expired; +} + +/* Add a multicast group to the mdb. If it exists, then + * move to the last position in the LRU list. + */ +bool +mcast_snooping_add_group(struct mcast_snooping *ms, ovs_be32 ip4, + uint16_t vlan, void *port) + OVS_REQ_WRLOCK(ms->rwlock) +{ + bool learned; + struct mcast_group *grp; + + /* Avoid duplicate packets. */ + if (mcast_snooping_mrouter_lookup(ms, vlan, port) + || mcast_snooping_port_lookup(&ms->fport_list, port)) { + return false; + } + + learned = false; + grp = mcast_snooping_lookup(ms, ip4, vlan); + if (!grp) { + uint32_t hash = mcast_table_hash(ms, ip4, vlan); + + if (hmap_count(&ms->table) >= ms->max_entries) { + group_get_lru(ms, &grp); + mcast_snooping_flush_group(ms, grp); + } + + grp = xmalloc(sizeof *grp); + hmap_insert(&ms->table, &grp->hmap_node, hash); + grp->ip4 = ip4; + grp->vlan = vlan; + list_init(&grp->bundle_lru); + learned = true; + ms->need_revalidate = true; + COVERAGE_INC(mcast_snooping_learned); + } else { + list_remove(&grp->group_node); + } + mcast_group_insert_bundle(ms, grp, port, ms->idle_time); + + /* Mark 'grp' as recently used. */ + list_push_back(&ms->group_lru, &grp->group_node); + return learned; +} + +int +mcast_snooping_add_report(struct mcast_snooping *ms, + const struct dp_packet *p, + uint16_t vlan, void *port) +{ + ovs_be32 ip4; + size_t offset; + const struct igmpv3_header *igmpv3; + const struct igmpv3_record *record; + int count = 0; + int ngrp; + + offset = (char *) dp_packet_l4(p) - (char *) dp_packet_data(p); + igmpv3 = dp_packet_at(p, offset, IGMPV3_HEADER_LEN); + if (!igmpv3) { + return 0; + } + ngrp = ntohs(igmpv3->ngrp); + offset += IGMPV3_HEADER_LEN; + while (ngrp--) { + bool ret; + record = dp_packet_at(p, offset, sizeof(struct igmpv3_record)); + if (!record) { + break; + } + /* Only consider known record types. */ + if (record->type < IGMPV3_MODE_IS_INCLUDE + || record->type > IGMPV3_BLOCK_OLD_SOURCES) { + continue; + } + ip4 = get_16aligned_be32(&record->maddr); + /* + * If record is INCLUDE MODE and there are no sources, it's equivalent + * to a LEAVE. + */ + if (ntohs(record->nsrcs) == 0 + && (record->type == IGMPV3_MODE_IS_INCLUDE + || record->type == IGMPV3_CHANGE_TO_INCLUDE_MODE)) { + ret = mcast_snooping_leave_group(ms, ip4, vlan, port); + } else { + ret = mcast_snooping_add_group(ms, ip4, vlan, port); + } + if (ret) { + count++; + } + offset += sizeof(*record) + + ntohs(record->nsrcs) * sizeof(ovs_be32) + record->aux_len; + } + return count; +} + +bool +mcast_snooping_leave_group(struct mcast_snooping *ms, ovs_be32 ip4, + uint16_t vlan, void *port) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_group *grp; + + /* Ports flagged to forward Reports usually have more + * than one host behind it, so don't leave the group + * on the first message and just let it expire */ + if (mcast_snooping_port_lookup(&ms->rport_list, port)) { + return false; + } + + grp = mcast_snooping_lookup(ms, ip4, vlan); + if (grp && mcast_group_delete_bundle(ms, grp, port)) { + ms->need_revalidate = true; + return true; + } + return false; +} + + +/* Router ports. */ + +/* Returns the number of seconds since the multicast router + * was learned in a port. */ +int +mcast_mrouter_age(const struct mcast_snooping *ms OVS_UNUSED, + const struct mcast_mrouter_bundle *mrouter) +{ + time_t remaining = mrouter->expires - time_now(); + return MCAST_MROUTER_PORT_IDLE_TIME - remaining; +} + +static struct mcast_mrouter_bundle * +mcast_mrouter_from_lru_node(struct ovs_list *list) +{ + return CONTAINER_OF(list, struct mcast_mrouter_bundle, mrouter_node); +} + +/* If the LRU list is not empty, stores the least-recently-used mrouter + * in '*m' and returns true. Otherwise, if the LRU list is empty, + * stores NULL in '*m' and return false. */ +static bool +mrouter_get_lru(const struct mcast_snooping *ms, + struct mcast_mrouter_bundle **m) + OVS_REQ_RDLOCK(ms->rwlock) +{ + if (!list_is_empty(&ms->mrouter_lru)) { + *m = mcast_mrouter_from_lru_node(ms->mrouter_lru.next); + return true; + } else { + *m = NULL; + return false; + } +} + +static struct mcast_mrouter_bundle * +mcast_snooping_mrouter_lookup(struct mcast_snooping *ms, uint16_t vlan, + void *port) + OVS_REQ_RDLOCK(ms->rwlock) +{ + struct mcast_mrouter_bundle *mrouter; + + LIST_FOR_EACH (mrouter, mrouter_node, &ms->mrouter_lru) { + if (mrouter->vlan == vlan && mrouter->port == port) { + return mrouter; + } + } + return NULL; +} + +bool +mcast_snooping_add_mrouter(struct mcast_snooping *ms, uint16_t vlan, + void *port) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_mrouter_bundle *mrouter; + + /* Avoid duplicate packets. */ + if (mcast_snooping_port_lookup(&ms->fport_list, port)) { + return false; + } + + mrouter = mcast_snooping_mrouter_lookup(ms, vlan, port); + if (mrouter) { + list_remove(&mrouter->mrouter_node); + } else { + mrouter = xmalloc(sizeof *mrouter); + mrouter->vlan = vlan; + mrouter->port = port; + COVERAGE_INC(mcast_snooping_learned); + ms->need_revalidate = true; + } + + mrouter->expires = time_now() + MCAST_MROUTER_PORT_IDLE_TIME; + list_push_back(&ms->mrouter_lru, &mrouter->mrouter_node); + return ms->need_revalidate; +} + +static void +mcast_snooping_flush_mrouter(struct mcast_mrouter_bundle *mrouter) +{ + list_remove(&mrouter->mrouter_node); + free(mrouter); +} + +/* Ports */ + +static struct mcast_port_bundle * +mcast_port_from_list_node(struct ovs_list *list) +{ + return CONTAINER_OF(list, struct mcast_port_bundle, node); +} + +/* If the list is not empty, stores the fport in '*f' and returns true. + * Otherwise, if the list is empty, stores NULL in '*f' and return false. */ +static bool +mcast_snooping_port_get(const struct ovs_list *list, + struct mcast_port_bundle **f) +{ + if (!list_is_empty(list)) { + *f = mcast_port_from_list_node(list->next); + return true; + } else { + *f = NULL; + return false; + } +} + +static struct mcast_port_bundle * +mcast_snooping_port_lookup(struct ovs_list *list, void *port) +{ + struct mcast_port_bundle *pbundle; + + LIST_FOR_EACH (pbundle, node, list) { + if (pbundle->port == port) { + return pbundle; + } + } + return NULL; +} + +static void +mcast_snooping_add_port(struct ovs_list *list, void *port) +{ + struct mcast_port_bundle *pbundle; + + pbundle = xmalloc(sizeof *pbundle); + pbundle->port = port; + list_insert(list, &pbundle->node); +} + +static void +mcast_snooping_flush_port(struct mcast_port_bundle *pbundle) +{ + list_remove(&pbundle->node); + free(pbundle); +} + + +/* Flood ports. */ +void +mcast_snooping_set_port_flood(struct mcast_snooping *ms, void *port, + bool flood) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_port_bundle *fbundle; + + fbundle = mcast_snooping_port_lookup(&ms->fport_list, port); + if (flood && !fbundle) { + mcast_snooping_add_port(&ms->fport_list, port); + ms->need_revalidate = true; + } else if (!flood && fbundle) { + mcast_snooping_flush_port(fbundle); + ms->need_revalidate = true; + } +} + +/* Flood Reports ports. */ + +void +mcast_snooping_set_port_flood_reports(struct mcast_snooping *ms, void *port, + bool flood) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_port_bundle *pbundle; + + pbundle = mcast_snooping_port_lookup(&ms->rport_list, port); + if (flood && !pbundle) { + mcast_snooping_add_port(&ms->rport_list, port); + ms->need_revalidate = true; + } else if (!flood && pbundle) { + mcast_snooping_flush_port(pbundle); + ms->need_revalidate = true; + } +} + +/* Run and flush. */ + +static void +mcast_snooping_mdb_flush__(struct mcast_snooping *ms) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_group *grp; + struct mcast_mrouter_bundle *mrouter; + + while (group_get_lru(ms, &grp)) { + mcast_snooping_flush_group(ms, grp); + } + + hmap_shrink(&ms->table); + + while (mrouter_get_lru(ms, &mrouter)) { + mcast_snooping_flush_mrouter(mrouter); + } +} + +void +mcast_snooping_mdb_flush(struct mcast_snooping *ms) +{ + if (!mcast_snooping_enabled(ms)) { + return; + } + + ovs_rwlock_wrlock(&ms->rwlock); + mcast_snooping_mdb_flush__(ms); + ovs_rwlock_unlock(&ms->rwlock); +} + +/* Flushes mdb and flood ports. */ +static void +mcast_snooping_flush__(struct mcast_snooping *ms) + OVS_REQ_WRLOCK(ms->rwlock) +{ + struct mcast_group *grp; + struct mcast_mrouter_bundle *mrouter; + struct mcast_port_bundle *pbundle; + + while (group_get_lru(ms, &grp)) { + mcast_snooping_flush_group(ms, grp); + } + + hmap_shrink(&ms->table); + + /* flush multicast routers */ + while (mrouter_get_lru(ms, &mrouter)) { + mcast_snooping_flush_mrouter(mrouter); + } + + /* flush flood ports */ + while (mcast_snooping_port_get(&ms->fport_list, &pbundle)) { + mcast_snooping_flush_port(pbundle); + } + + /* flush flood report ports */ + while (mcast_snooping_port_get(&ms->rport_list, &pbundle)) { + mcast_snooping_flush_port(pbundle); + } +} + +void +mcast_snooping_flush(struct mcast_snooping *ms) +{ + if (!mcast_snooping_enabled(ms)) { + return; + } + + ovs_rwlock_wrlock(&ms->rwlock); + mcast_snooping_flush__(ms); + ovs_rwlock_unlock(&ms->rwlock); +} + +static bool +mcast_snooping_run__(struct mcast_snooping *ms) + OVS_REQ_WRLOCK(ms->rwlock) +{ + bool need_revalidate; + struct mcast_group *grp; + struct mcast_mrouter_bundle *mrouter; + int mrouter_expired; + + while (group_get_lru(ms, &grp)) { + if (hmap_count(&ms->table) > ms->max_entries) { + mcast_snooping_flush_group(ms, grp); + } else { + if (!mcast_snooping_prune_expired(ms, grp)) { + break; + } + } + } + + hmap_shrink(&ms->table); + + mrouter_expired = 0; + while (mrouter_get_lru(ms, &mrouter) + && time_now() >= mrouter->expires) { + mcast_snooping_flush_mrouter(mrouter); + mrouter_expired++; + } + + if (mrouter_expired) { + ms->need_revalidate = true; + COVERAGE_ADD(mcast_snooping_expired, mrouter_expired); + } + + need_revalidate = ms->need_revalidate; + ms->need_revalidate = false; + return need_revalidate; +} + +/* Does periodic work required by 'ms'. Returns true if something changed + * that may require flow revalidation. */ +bool +mcast_snooping_run(struct mcast_snooping *ms) +{ + bool need_revalidate; + + if (!mcast_snooping_enabled(ms)) { + return false; + } + + ovs_rwlock_wrlock(&ms->rwlock); + need_revalidate = mcast_snooping_run__(ms); + ovs_rwlock_unlock(&ms->rwlock); + + return need_revalidate; +} + +static void +mcast_snooping_wait__(struct mcast_snooping *ms) + OVS_REQ_RDLOCK(ms->rwlock) +{ + if (hmap_count(&ms->table) > ms->max_entries + || ms->need_revalidate) { + poll_immediate_wake(); + } else { + struct mcast_group *grp; + struct mcast_group_bundle *bundle; + struct mcast_mrouter_bundle *mrouter; + long long int mrouter_msec; + long long int msec = 0; + + if (!list_is_empty(&ms->group_lru)) { + grp = mcast_group_from_lru_node(ms->group_lru.next); + bundle = mcast_group_bundle_from_lru_node(grp->bundle_lru.next); + msec = bundle->expires * 1000LL; + } + + if (!list_is_empty(&ms->mrouter_lru)) { + mrouter = mcast_mrouter_from_lru_node(ms->mrouter_lru.next); + mrouter_msec = mrouter->expires * 1000LL; + msec = msec ? MIN(msec, mrouter_msec) : mrouter_msec; + } + + if (msec) { + poll_timer_wait_until(msec); + } + } +} + +void +mcast_snooping_wait(struct mcast_snooping *ms) +{ + if (!mcast_snooping_enabled(ms)) { + return; + } + + ovs_rwlock_rdlock(&ms->rwlock); + mcast_snooping_wait__(ms); + ovs_rwlock_unlock(&ms->rwlock); +} diff -Nru openvswitch-2.3.1/lib/mcast-snooping.h openvswitch-2.4.0~git20150623/lib/mcast-snooping.h --- openvswitch-2.3.1/lib/mcast-snooping.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/mcast-snooping.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2014 Red Hat, Inc. + * + * Based on mac-learning implementation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MCAST_SNOOPING_H +#define MCAST_SNOOPING_H 1 + +#include +#include "dp-packet.h" +#include "hmap.h" +#include "list.h" +#include "ovs-atomic.h" +#include "ovs-thread.h" +#include "packets.h" +#include "timeval.h" + +struct mcast_snooping; + +/* Default maximum size of a mcast snooping table, in entries. */ +#define MCAST_DEFAULT_MAX_ENTRIES 2048 + +/* Time, in seconds, before expiring a mcast_group due to inactivity. */ +#define MCAST_ENTRY_DEFAULT_IDLE_TIME 300 + +/* Time, in seconds, before expiring a mrouter_port due to inactivity. */ +#define MCAST_MROUTER_PORT_IDLE_TIME 180 + +/* Multicast group entry. + * Guarded by owning 'mcast_snooping''s rwlock. */ +struct mcast_group { + /* Node in parent struct mcast_snooping hmap. */ + struct hmap_node hmap_node; + + /* Multicast group IPv4 address. */ + ovs_be32 ip4; + + /* VLAN tag. */ + uint16_t vlan; + + /* Node in parent struct mcast_snooping group_lru. */ + struct ovs_list group_node OVS_GUARDED; + + /* Contains struct mcast_group_bundle (ports), least recently used + * at the front, most recently used at the back. */ + struct ovs_list bundle_lru OVS_GUARDED; +}; + +/* The bundle associated to the multicast group. + * Guarded by owning 'mcast_snooping''s rwlock. */ +struct mcast_group_bundle { + /* Node in parent struct mcast_group bundle_lru list. */ + struct ovs_list bundle_node OVS_GUARDED; + + /* When this node expires. */ + time_t expires; + + /* Learned port. */ + void *port OVS_GUARDED; +}; + +/* The bundle connected to a multicast router. + * Guarded by owning 'mcast_snooping''s rwlock. */ +struct mcast_mrouter_bundle { + /* Node in parent struct mcast_group mrouter_lru list. */ + struct ovs_list mrouter_node OVS_GUARDED; + + /* When this node expires. */ + time_t expires; + + /* VLAN tag. */ + uint16_t vlan; + + /* Learned port. */ + void *port OVS_GUARDED; +}; + +/* The bundle to send multicast traffic or Reports. + * Guarded by owning 'mcast_snooping''s rwlock */ +struct mcast_port_bundle { + /* Node in parent struct mcast_snooping. */ + struct ovs_list node; + + /* VLAN tag. */ + uint16_t vlan; + + /* Learned port. */ + void *port; +}; + +/* Multicast snooping table. */ +struct mcast_snooping { + /* Snooping/learning table. */ + struct hmap table; + + /* Contains struct mcast_group, least recently used at the front, + * most recently used at the back. */ + struct ovs_list group_lru OVS_GUARDED; + + /* Contains struct mcast_mrouter_bundle, least recently used at the + * front, most recently used at the back. */ + struct ovs_list mrouter_lru OVS_GUARDED; + + /* Contains struct mcast_port_bundle to be flooded with multicast + * packets in no special order. */ + struct ovs_list fport_list OVS_GUARDED; + + /* Contains struct mcast_port_bundle to forward Reports in + * no special order. */ + struct ovs_list rport_list OVS_GUARDED; + + /* Secret for randomizing hash table. */ + uint32_t secret; + + /* Maximum age before deleting an entry. */ + unsigned int idle_time; + + /* Maximum number of multicast groups learned. */ + size_t max_entries; + + /* True if flow revalidation is needed. */ + bool need_revalidate; + + /* True if unregistered multicast packets should be flooded to all + * ports, otherwise send them to ports connected to multicast routers. */ + bool flood_unreg; + + struct ovs_refcount ref_cnt; + struct ovs_rwlock rwlock; +}; + +/* Basics. */ +bool mcast_snooping_enabled(const struct mcast_snooping *ms); +bool mcast_snooping_flood_unreg(const struct mcast_snooping *ms); +int mcast_mrouter_age(const struct mcast_snooping *ms, + const struct mcast_mrouter_bundle *m); +int mcast_bundle_age(const struct mcast_snooping *ms, + const struct mcast_group_bundle *b); +struct mcast_snooping *mcast_snooping_create(void); +struct mcast_snooping *mcast_snooping_ref(const struct mcast_snooping *); +void mcast_snooping_unref(struct mcast_snooping *); +bool mcast_snooping_run(struct mcast_snooping *ms); +void mcast_snooping_wait(struct mcast_snooping *ms); + +/* Configuration. */ +void mcast_snooping_set_idle_time(struct mcast_snooping *ms, + unsigned int idle_time) + OVS_REQ_WRLOCK(ms->rwlock); +void mcast_snooping_set_max_entries(struct mcast_snooping *ms, + size_t max_entries) + OVS_REQ_WRLOCK(ms->rwlock); +bool +mcast_snooping_set_flood_unreg(struct mcast_snooping *ms, bool enable) + OVS_REQ_WRLOCK(ms->rwlock); +void mcast_snooping_set_port_flood(struct mcast_snooping *ms, void *port, + bool flood) + OVS_REQ_WRLOCK(ms->rwlock); +void mcast_snooping_set_port_flood_reports(struct mcast_snooping *ms, + void *port, bool flood) + OVS_REQ_WRLOCK(ms->rwlock); + +/* Lookup. */ +struct mcast_group * +mcast_snooping_lookup(const struct mcast_snooping *ms, ovs_be32 dip, + uint16_t vlan) + OVS_REQ_RDLOCK(ms->rwlock); + +/* Learning. */ +bool mcast_snooping_add_group(struct mcast_snooping *ms, ovs_be32 ip4, + uint16_t vlan, void *port) + OVS_REQ_WRLOCK(ms->rwlock); +int mcast_snooping_add_report(struct mcast_snooping *ms, + const struct dp_packet *p, + uint16_t vlan, void *port) + OVS_REQ_WRLOCK(ms->rwlock); +bool mcast_snooping_leave_group(struct mcast_snooping *ms, ovs_be32 ip4, + uint16_t vlan, void *port) + OVS_REQ_WRLOCK(ms->rwlock); +bool mcast_snooping_add_mrouter(struct mcast_snooping *ms, uint16_t vlan, + void *port) + OVS_REQ_WRLOCK(ms->rwlock); +bool mcast_snooping_is_query(ovs_be16 igmp_type); +bool mcast_snooping_is_membership(ovs_be16 igmp_type); + +/* Flush. */ +void mcast_snooping_mdb_flush(struct mcast_snooping *ms); +void mcast_snooping_flush(struct mcast_snooping *ms); + +#endif /* mcast-snooping.h */ diff -Nru openvswitch-2.3.1/lib/memory.c openvswitch-2.4.0~git20150623/lib/memory.c --- openvswitch-2.3.1/lib/memory.c 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/memory.c 2015-06-23 18:46:21.000000000 +0000 @@ -24,7 +24,7 @@ #include "simap.h" #include "timeval.h" #include "unixctl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(memory); diff -Nru openvswitch-2.3.1/lib/meta-flow.c openvswitch-2.4.0~git20150623/lib/meta-flow.c --- openvswitch-2.3.1/lib/meta-flow.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/meta-flow.c 2015-06-23 18:46:21.000000000 +0000 @@ -25,6 +25,7 @@ #include "classifier.h" #include "dynamic-string.h" +#include "nx-match.h" #include "ofp-errors.h" #include "ofp-util.h" #include "ovs-thread.h" @@ -34,7 +35,7 @@ #include "socket-util.h" #include "unaligned.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(meta_flow); @@ -48,759 +49,9 @@ extern const struct mf_field mf_fields[MFF_N_IDS]; /* Silence a warning. */ const struct mf_field mf_fields[MFF_N_IDS] = { - /* ## -------- ## */ - /* ## metadata ## */ - /* ## -------- ## */ - - { - MFF_DP_HASH, "dp_hash", NULL, - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_HEXADECIMAL, - MFP_NONE, - false, - NXM_NX_DP_HASH, "NXM_NX_DP_HASH", - NXM_NX_DP_HASH, "NXM_NX_DP_HASH", 0, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_RECIRC_ID, "recirc_id", NULL, - MF_FIELD_SIZES(be32), - MFM_NONE, - MFS_DECIMAL, - MFP_NONE, - false, - NXM_NX_RECIRC_ID, "NXM_NX_RECIRC_ID", - NXM_NX_RECIRC_ID, "NXM_NX_RECIRC_ID", 0, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_TUN_ID, "tun_id", "tunnel_id", - MF_FIELD_SIZES(be64), - MFM_FULLY, - MFS_HEXADECIMAL, - MFP_NONE, - true, - NXM_NX_TUN_ID, "NXM_NX_TUN_ID", - OXM_OF_TUNNEL_ID, "OXM_OF_TUNNEL_ID", OFP13_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - FLOW_U32OFS(tunnel.tun_id), - }, { - MFF_TUN_SRC, "tun_src", NULL, - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_IPV4, - MFP_NONE, - true, - NXM_NX_TUN_IPV4_SRC, "NXM_NX_TUN_IPV4_SRC", - NXM_NX_TUN_IPV4_SRC, "NXM_NX_TUN_IPV4_SRC", 0, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - FLOW_U32OFS(tunnel.ip_src), - }, { - MFF_TUN_DST, "tun_dst", NULL, - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_IPV4, - MFP_NONE, - true, - NXM_NX_TUN_IPV4_DST, "NXM_NX_TUN_IPV4_DST", - NXM_NX_TUN_IPV4_DST, "NXM_NX_TUN_IPV4_DST", 0, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - FLOW_U32OFS(tunnel.ip_dst), - }, { - MFF_TUN_FLAGS, "tun_flags", NULL, - MF_FIELD_SIZES(be16), - MFM_NONE, - MFS_TNL_FLAGS, - MFP_NONE, - false, - 0, NULL, - 0, NULL, 0, - OFPUTIL_P_NONE, - OFPUTIL_P_NONE, - -1, - }, { - MFF_TUN_TTL, "tun_ttl", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_NONE, - false, - 0, NULL, - 0, NULL, 0, - OFPUTIL_P_NONE, - OFPUTIL_P_NONE, - -1, - }, { - MFF_TUN_TOS, "tun_tos", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_NONE, - false, - 0, NULL, - 0, NULL, 0, - OFPUTIL_P_NONE, - OFPUTIL_P_NONE, - -1, - }, { - MFF_METADATA, "metadata", NULL, - MF_FIELD_SIZES(be64), - MFM_FULLY, - MFS_HEXADECIMAL, - MFP_NONE, - true, - OXM_OF_METADATA, "OXM_OF_METADATA", - OXM_OF_METADATA, "OXM_OF_METADATA", OFP12_VERSION, - OFPUTIL_P_NXM_OF11_UP, - OFPUTIL_P_NXM_OF11_UP, - -1, - }, { - MFF_IN_PORT, "in_port", NULL, - MF_FIELD_SIZES(be16), - MFM_NONE, - MFS_OFP_PORT, - MFP_NONE, - true, - NXM_OF_IN_PORT, "NXM_OF_IN_PORT", - NXM_OF_IN_PORT, "NXM_OF_IN_PORT", 0, - OFPUTIL_P_ANY, /* OF11+ via mapping to 32 bits. */ - OFPUTIL_P_NONE, - -1, - }, { - MFF_IN_PORT_OXM, "in_port_oxm", NULL, - MF_FIELD_SIZES(be32), - MFM_NONE, - MFS_OFP_PORT_OXM, - MFP_NONE, - true, - OXM_OF_IN_PORT, "OXM_OF_IN_PORT", - OXM_OF_IN_PORT, "OXM_OF_IN_PORT", OFP12_VERSION, - OFPUTIL_P_OF11_UP, - OFPUTIL_P_NONE, - -1, - }, { - MFF_SKB_PRIORITY, "skb_priority", NULL, - MF_FIELD_SIZES(be32), - MFM_NONE, - MFS_HEXADECIMAL, - MFP_NONE, - false, - 0, NULL, - 0, NULL, 0, - OFPUTIL_P_NONE, - OFPUTIL_P_NONE, - -1, - }, { - MFF_PKT_MARK, "pkt_mark", NULL, - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_HEXADECIMAL, - MFP_NONE, - true, - NXM_NX_PKT_MARK, "NXM_NX_PKT_MARK", - NXM_NX_PKT_MARK, "NXM_NX_PKT_MARK", 0, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, - -#define REGISTER(IDX) \ - { \ - MFF_REG##IDX, "reg" #IDX, NULL, \ - MF_FIELD_SIZES(be32), \ - MFM_FULLY, \ - MFS_HEXADECIMAL, \ - MFP_NONE, \ - true, \ - NXM_NX_REG(IDX), "NXM_NX_REG" #IDX, \ - NXM_NX_REG(IDX), "NXM_NX_REG" #IDX, 0, \ - OFPUTIL_P_NXM_OXM_ANY, \ - OFPUTIL_P_NXM_OXM_ANY, \ - -1, \ - } -#if FLOW_N_REGS > 0 - REGISTER(0), -#endif -#if FLOW_N_REGS > 1 - REGISTER(1), -#endif -#if FLOW_N_REGS > 2 - REGISTER(2), -#endif -#if FLOW_N_REGS > 3 - REGISTER(3), -#endif -#if FLOW_N_REGS > 4 - REGISTER(4), -#endif -#if FLOW_N_REGS > 5 - REGISTER(5), -#endif -#if FLOW_N_REGS > 6 - REGISTER(6), -#endif -#if FLOW_N_REGS > 7 - REGISTER(7), -#endif -#if FLOW_N_REGS > 8 -#error -#endif - - /* ## -- ## */ - /* ## L2 ## */ - /* ## -- ## */ - - { - MFF_ETH_SRC, "eth_src", "dl_src", - MF_FIELD_SIZES(mac), - MFM_FULLY, - MFS_ETHERNET, - MFP_NONE, - true, - NXM_OF_ETH_SRC, "NXM_OF_ETH_SRC", - OXM_OF_ETH_SRC, "OXM_OF_ETH_SRC", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OF11_UP, /* Bitwise masking only with NXM and OF11+! */ - -1, - }, { - MFF_ETH_DST, "eth_dst", "dl_dst", - MF_FIELD_SIZES(mac), - MFM_FULLY, - MFS_ETHERNET, - MFP_NONE, - true, - NXM_OF_ETH_DST, "NXM_OF_ETH_DST", - OXM_OF_ETH_DST, "OXM_OF_ETH_DST", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OF11_UP, /* Bitwise masking only with NXM and OF11+! */ - -1, - }, { - MFF_ETH_TYPE, "eth_type", "dl_type", - MF_FIELD_SIZES(be16), - MFM_NONE, - MFS_HEXADECIMAL, - MFP_NONE, - false, - NXM_OF_ETH_TYPE, "NXM_OF_ETH_TYPE", - OXM_OF_ETH_TYPE, "OXM_OF_ETH_TYPE", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NONE, - -1, - }, - - { - MFF_VLAN_TCI, "vlan_tci", NULL, - MF_FIELD_SIZES(be16), - MFM_FULLY, - MFS_HEXADECIMAL, - MFP_NONE, - true, - NXM_OF_VLAN_TCI, "NXM_OF_VLAN_TCI", - NXM_OF_VLAN_TCI, "NXM_OF_VLAN_TCI", 0, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_DL_VLAN, "dl_vlan", NULL, - sizeof(ovs_be16), 12, - MFM_NONE, - MFS_DECIMAL, - MFP_NONE, - true, - 0, NULL, - 0, NULL, 0, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_VLAN_VID, "vlan_vid", NULL, - sizeof(ovs_be16), 12, - MFM_FULLY, - MFS_DECIMAL, - MFP_NONE, - true, - OXM_OF_VLAN_VID, "OXM_OF_VLAN_VID", - OXM_OF_VLAN_VID, "OXM_OF_VLAN_VID", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_DL_VLAN_PCP, "dl_vlan_pcp", NULL, - 1, 3, - MFM_NONE, - MFS_DECIMAL, - MFP_NONE, - true, - 0, NULL, - 0, NULL, 0, - OFPUTIL_P_ANY, /* Will be mapped to NXM and OXM. */ - OFPUTIL_P_NONE, - -1, - }, { - MFF_VLAN_PCP, "vlan_pcp", NULL, - 1, 3, - MFM_NONE, - MFS_DECIMAL, - MFP_VLAN_VID, - true, - OXM_OF_VLAN_PCP, "OXM_OF_VLAN_PCP", - OXM_OF_VLAN_PCP, "OXM_OF_VLAN_PCP", OFP12_VERSION, - OFPUTIL_P_ANY, /* Will be mapped to OF10 and NXM. */ - OFPUTIL_P_NONE, - -1, - }, - - /* ## ---- ## */ - /* ## L2.5 ## */ - /* ## ---- ## */ - { - MFF_MPLS_LABEL, "mpls_label", NULL, - 4, 20, - MFM_NONE, - MFS_DECIMAL, - MFP_MPLS, - true, - OXM_OF_MPLS_LABEL, "OXM_OF_MPLS_LABEL", - OXM_OF_MPLS_LABEL, "OXM_OF_MPLS_LABEL", OFP12_VERSION, - OFPUTIL_P_NXM_OF11_UP, - OFPUTIL_P_NONE, - -1, - }, { - MFF_MPLS_TC, "mpls_tc", NULL, - 1, 3, - MFM_NONE, - MFS_DECIMAL, - MFP_MPLS, - true, - OXM_OF_MPLS_TC, "OXM_OF_MPLS_TC", - OXM_OF_MPLS_TC, "OXM_OF_MPLS_TC", OFP12_VERSION, - OFPUTIL_P_NXM_OF11_UP, - OFPUTIL_P_NONE, - -1, - }, { - MFF_MPLS_BOS, "mpls_bos", NULL, - 1, 1, - MFM_NONE, - MFS_DECIMAL, - MFP_MPLS, - false, - OXM_OF_MPLS_BOS, "OXM_OF_MPLS_BOS", - OXM_OF_MPLS_BOS, "OXM_OF_MPLS_BOS", OFP13_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NONE, - -1, - }, - - /* ## -- ## */ - /* ## L3 ## */ - /* ## -- ## */ - - { - MFF_IPV4_SRC, "ip_src", "nw_src", - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_IPV4, - MFP_IPV4, - true, - NXM_OF_IP_SRC, "NXM_OF_IP_SRC", - OXM_OF_IPV4_SRC, "OXM_OF_IPV4_SRC", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OF11_UP, - FLOW_U32OFS(nw_src), - }, { - MFF_IPV4_DST, "ip_dst", "nw_dst", - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_IPV4, - MFP_IPV4, - true, - NXM_OF_IP_DST, "NXM_OF_IP_DST", - OXM_OF_IPV4_DST, "OXM_OF_IPV4_DST", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OF11_UP, - FLOW_U32OFS(nw_dst), - }, - - { - MFF_IPV6_SRC, "ipv6_src", NULL, - MF_FIELD_SIZES(ipv6), - MFM_FULLY, - MFS_IPV6, - MFP_IPV6, - true, - NXM_NX_IPV6_SRC, "NXM_NX_IPV6_SRC", - OXM_OF_IPV6_SRC, "OXM_OF_IPV6_SRC", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - FLOW_U32OFS(ipv6_src), - }, { - MFF_IPV6_DST, "ipv6_dst", NULL, - MF_FIELD_SIZES(ipv6), - MFM_FULLY, - MFS_IPV6, - MFP_IPV6, - true, - NXM_NX_IPV6_DST, "NXM_NX_IPV6_DST", - OXM_OF_IPV6_DST, "OXM_OF_IPV6_DST", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - FLOW_U32OFS(ipv6_dst), - }, - { - MFF_IPV6_LABEL, "ipv6_label", NULL, - 4, 20, - MFM_FULLY, - MFS_HEXADECIMAL, - MFP_IPV6, - false, - NXM_NX_IPV6_LABEL, "NXM_NX_IPV6_LABEL", - OXM_OF_IPV6_FLABEL, "OXM_OF_IPV6_FLABEL", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, - - { - MFF_IP_PROTO, "nw_proto", "ip_proto", - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_IP_ANY, - false, - NXM_OF_IP_PROTO, "NXM_OF_IP_PROTO", - OXM_OF_IP_PROTO, "OXM_OF_IP_PROTO", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NONE, - -1, - }, { - MFF_IP_DSCP, "nw_tos", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_IP_ANY, - true, - NXM_OF_IP_TOS, "NXM_OF_IP_TOS", - NXM_OF_IP_TOS, "NXM_OF_IP_TOS", 0, - OFPUTIL_P_ANY, /* Will be shifted for OXM. */ - OFPUTIL_P_NONE, - -1, - }, { - MFF_IP_DSCP_SHIFTED, "ip_dscp", NULL, - 1, 6, - MFM_NONE, - MFS_DECIMAL, - MFP_IP_ANY, - true, - OXM_OF_IP_DSCP, "OXM_OF_IP_DSCP", - OXM_OF_IP_DSCP, "OXM_OF_IP_DSCP", OFP12_VERSION, - OFPUTIL_P_ANY, /* Will be shifted for non-OXM. */ - OFPUTIL_P_NONE, - -1, - }, { - MFF_IP_ECN, "nw_ecn", "ip_ecn", - 1, 2, - MFM_NONE, - MFS_DECIMAL, - MFP_IP_ANY, - true, - NXM_NX_IP_ECN, "NXM_NX_IP_ECN", - OXM_OF_IP_ECN, "OXM_OF_IP_ECN", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NONE, - -1, - }, { - MFF_IP_TTL, "nw_ttl", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_IP_ANY, - true, - NXM_NX_IP_TTL, "NXM_NX_IP_TTL", - NXM_NX_IP_TTL, "NXM_NX_IP_TTL", 0, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NONE, - -1, - }, { - MFF_IP_FRAG, "ip_frag", NULL, - 1, 2, - MFM_FULLY, - MFS_FRAG, - MFP_IP_ANY, - false, - NXM_NX_IP_FRAG, "NXM_NX_IP_FRAG", - NXM_NX_IP_FRAG, "NXM_NX_IP_FRAG", 0, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, - - { - MFF_ARP_OP, "arp_op", NULL, - MF_FIELD_SIZES(be16), - MFM_NONE, - MFS_DECIMAL, - MFP_ARP, - true, - NXM_OF_ARP_OP, "NXM_OF_ARP_OP", - OXM_OF_ARP_OP, "OXM_OF_ARP_OP", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NONE, - -1, - }, { - MFF_ARP_SPA, "arp_spa", NULL, - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_IPV4, - MFP_ARP, - true, - NXM_OF_ARP_SPA, "NXM_OF_ARP_SPA", - OXM_OF_ARP_SPA, "OXM_OF_ARP_SPA", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OF11_UP, - -1, - }, { - MFF_ARP_TPA, "arp_tpa", NULL, - MF_FIELD_SIZES(be32), - MFM_FULLY, - MFS_IPV4, - MFP_ARP, - true, - NXM_OF_ARP_TPA, "NXM_OF_ARP_TPA", - OXM_OF_ARP_TPA, "OXM_OF_ARP_TPA", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OF11_UP, - -1, - }, { - MFF_ARP_SHA, "arp_sha", NULL, - MF_FIELD_SIZES(mac), - MFM_FULLY, - MFS_ETHERNET, - MFP_ARP, - true, - NXM_NX_ARP_SHA, "NXM_NX_ARP_SHA", - OXM_OF_ARP_SHA, "OXM_OF_ARP_SHA", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_ARP_THA, "arp_tha", NULL, - MF_FIELD_SIZES(mac), - MFM_FULLY, - MFS_ETHERNET, - MFP_ARP, - true, - NXM_NX_ARP_THA, "NXM_NX_ARP_THA", - OXM_OF_ARP_THA, "OXM_OF_ARP_THA", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, - - /* ## -- ## */ - /* ## L4 ## */ - /* ## -- ## */ - - { - MFF_TCP_SRC, "tcp_src", "tp_src", - MF_FIELD_SIZES(be16), - MFM_FULLY, - MFS_DECIMAL, - MFP_TCP, - true, - NXM_OF_TCP_SRC, "NXM_OF_TCP_SRC", - OXM_OF_TCP_SRC, "OXM_OF_TCP_SRC", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_TCP_DST, "tcp_dst", "tp_dst", - MF_FIELD_SIZES(be16), - MFM_FULLY, - MFS_DECIMAL, - MFP_TCP, - true, - NXM_OF_TCP_DST, "NXM_OF_TCP_DST", - OXM_OF_TCP_DST, "OXM_OF_TCP_DST", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_TCP_FLAGS, "tcp_flags", NULL, - 2, 12, - MFM_FULLY, - MFS_TCP_FLAGS, - MFP_TCP, - false, - NXM_NX_TCP_FLAGS, "NXM_NX_TCP_FLAGS", - OXM_OF_TCP_FLAGS, "OXM_OF_TCP_FLAGS", OFP15_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, - - { - MFF_UDP_SRC, "udp_src", NULL, - MF_FIELD_SIZES(be16), - MFM_FULLY, - MFS_DECIMAL, - MFP_UDP, - true, - NXM_OF_UDP_SRC, "NXM_OF_UDP_SRC", - OXM_OF_UDP_SRC, "OXM_OF_UDP_SRC", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_UDP_DST, "udp_dst", NULL, - MF_FIELD_SIZES(be16), - MFM_FULLY, - MFS_DECIMAL, - MFP_UDP, - true, - NXM_OF_UDP_DST, "NXM_OF_UDP_DST", - OXM_OF_UDP_DST, "OXM_OF_UDP_DST", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, - - { - MFF_SCTP_SRC, "sctp_src", NULL, - MF_FIELD_SIZES(be16), - MFM_FULLY, - MFS_DECIMAL, - MFP_SCTP, - true, - OXM_OF_SCTP_SRC, "OXM_OF_SCTP_SRC", - OXM_OF_SCTP_SRC, "OXM_OF_SCTP_SRC", OFP12_VERSION, - OFPUTIL_P_NXM_OF11_UP, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_SCTP_DST, "sctp_dst", NULL, - MF_FIELD_SIZES(be16), - MFM_FULLY, - MFS_DECIMAL, - MFP_SCTP, - true, - OXM_OF_SCTP_DST, "OXM_OF_SCTP_DST", - OXM_OF_SCTP_DST, "OXM_OF_SCTP_DST", OFP12_VERSION, - OFPUTIL_P_NXM_OF11_UP, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, - - { - MFF_ICMPV4_TYPE, "icmp_type", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_ICMPV4, - false, - NXM_OF_ICMP_TYPE, "NXM_OF_ICMP_TYPE", - OXM_OF_ICMPV4_TYPE, "OXM_OF_ICMPV4_TYPE", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NONE, - -1, - }, { - MFF_ICMPV4_CODE, "icmp_code", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_ICMPV4, - false, - NXM_OF_ICMP_CODE, "NXM_OF_ICMP_CODE", - OXM_OF_ICMPV4_CODE, "OXM_OF_ICMPV4_CODE", OFP12_VERSION, - OFPUTIL_P_ANY, - OFPUTIL_P_NONE, - -1, - }, - - { - MFF_ICMPV6_TYPE, "icmpv6_type", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_ICMPV6, - false, - NXM_NX_ICMPV6_TYPE, "NXM_NX_ICMPV6_TYPE", - OXM_OF_ICMPV6_TYPE, "OXM_OF_ICMPV6_TYPE", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NONE, - -1, - }, { - MFF_ICMPV6_CODE, "icmpv6_code", NULL, - MF_FIELD_SIZES(u8), - MFM_NONE, - MFS_DECIMAL, - MFP_ICMPV6, - false, - NXM_NX_ICMPV6_CODE, "NXM_NX_ICMPV6_CODE", - OXM_OF_ICMPV6_CODE, "OXM_OF_ICMPV6_CODE", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NONE, - -1, - }, - - /* ## ---- ## */ - /* ## L"5" ## */ - /* ## ---- ## */ - - { - MFF_ND_TARGET, "nd_target", NULL, - MF_FIELD_SIZES(ipv6), - MFM_FULLY, - MFS_IPV6, - MFP_ND, - false, - NXM_NX_ND_TARGET, "NXM_NX_ND_TARGET", - OXM_OF_IPV6_ND_TARGET, "OXM_OF_IPV6_ND_TARGET", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_ND_SLL, "nd_sll", NULL, - MF_FIELD_SIZES(mac), - MFM_FULLY, - MFS_ETHERNET, - MFP_ND_SOLICIT, - false, - NXM_NX_ND_SLL, "NXM_NX_ND_SLL", - OXM_OF_IPV6_ND_SLL, "OXM_OF_IPV6_ND_SLL", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - }, { - MFF_ND_TLL, "nd_tll", NULL, - MF_FIELD_SIZES(mac), - MFM_FULLY, - MFS_ETHERNET, - MFP_ND_ADVERT, - false, - NXM_NX_ND_TLL, "NXM_NX_ND_TLL", - OXM_OF_IPV6_ND_TLL, "OXM_OF_IPV6_ND_TLL", OFP12_VERSION, - OFPUTIL_P_NXM_OXM_ANY, - OFPUTIL_P_NXM_OXM_ANY, - -1, - } -}; - -/* Maps an NXM or OXM header value to an mf_field. */ -struct nxm_field { - struct hmap_node hmap_node; /* In 'all_fields' hmap. */ - uint32_t header; /* NXM or OXM header value. */ - const struct mf_field *mf; +#include "meta-flow.inc" }; -/* Contains 'struct nxm_field's. */ -static struct hmap all_fields; - /* Maps from an mf_field's 'name' or 'extra_name' to the mf_field. */ static struct shash mf_by_name; @@ -808,7 +59,6 @@ * controller and so there's not much point in showing a lot of them. */ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); -const struct mf_field *mf_from_nxm_header__(uint32_t header); static void nxm_init(void); /* Returns the field with the given 'name', or a null pointer if no field has @@ -821,45 +71,16 @@ } static void -add_nxm_field(uint32_t header, const struct mf_field *mf) -{ - struct nxm_field *f; - - f = xmalloc(sizeof *f); - hmap_insert(&all_fields, &f->hmap_node, hash_int(header, 0)); - f->header = header; - f->mf = mf; -} - -static void -nxm_init_add_field(const struct mf_field *mf, uint32_t header) -{ - if (header) { - ovs_assert(!mf_from_nxm_header__(header)); - add_nxm_field(header, mf); - if (mf->maskable != MFM_NONE) { - add_nxm_field(NXM_MAKE_WILD_HEADER(header), mf); - } - } -} - -static void nxm_do_init(void) { int i; - hmap_init(&all_fields); shash_init(&mf_by_name); for (i = 0; i < MFF_N_IDS; i++) { const struct mf_field *mf = &mf_fields[i]; ovs_assert(mf->id == i); /* Fields must be in the enum order. */ - nxm_init_add_field(mf, mf->nxm_header); - if (mf->oxm_header != mf->nxm_header) { - nxm_init_add_field(mf, mf->oxm_header); - } - shash_add_once(&mf_by_name, mf->name, mf); if (mf->extra_name) { shash_add_once(&mf_by_name, mf->extra_name, mf); @@ -874,37 +95,6 @@ pthread_once(&once, nxm_do_init); } -const struct mf_field * -mf_from_nxm_header(uint32_t header) -{ - nxm_init(); - return mf_from_nxm_header__(header); -} - -const struct mf_field * -mf_from_nxm_header__(uint32_t header) -{ - const struct nxm_field *f; - - HMAP_FOR_EACH_IN_BUCKET (f, hmap_node, hash_int(header, 0), &all_fields) { - if (f->header == header) { - return f->mf; - } - } - - return NULL; -} - -uint32_t -mf_oxm_header(enum mf_field_id id, enum ofp_version oxm_version) -{ - const struct mf_field *field = mf_from_id(id); - - return (oxm_version >= field->oxm_version - ? field->oxm_header - : field->nxm_header); -} - /* Returns true if 'wc' wildcards all the bits in field 'mf', false if 'wc' * specifies at least one bit in the field. * @@ -918,6 +108,8 @@ return !wc->masks.dp_hash; case MFF_RECIRC_ID: return !wc->masks.recirc_id; + case MFF_CONJ_ID: + return !wc->masks.conj_id; case MFF_TUN_SRC: return !wc->masks.tunnel.ip_src; case MFF_TUN_DST: @@ -927,6 +119,10 @@ case MFF_TUN_TTL: case MFF_TUN_FLAGS: return !wc->masks.tunnel.tun_id; + case MFF_TUN_GBP_ID: + return !wc->masks.tunnel.gbp_id; + case MFF_TUN_GBP_FLAGS: + return !wc->masks.tunnel.gbp_flags; case MFF_METADATA: return !wc->masks.metadata; case MFF_IN_PORT: @@ -938,6 +134,10 @@ return !wc->masks.pkt_mark; CASE_MFF_REGS: return !wc->masks.regs[mf->id - MFF_REG0]; + CASE_MFF_XREGS: + return !flow_get_xreg(&wc->masks, mf->id - MFF_XREG0); + case MFF_ACTSET_OUTPUT: + return !wc->masks.actset_output; case MFF_ETH_SRC: return eth_addr_is_zero(wc->masks.dl_src); @@ -1048,8 +248,8 @@ { switch (mf->maskable) { case MFM_NONE: - return (is_all_zeros((const uint8_t *) mask, mf->n_bytes) || - is_all_ones((const uint8_t *) mask, mf->n_bytes)); + return (is_all_zeros(mask, mf->n_bytes) || + is_all_ones(mask, mf->n_bytes)); case MFM_FULLY: return true; @@ -1081,11 +281,14 @@ return is_ip_any(flow); case MFP_TCP: - return is_ip_any(flow) && flow->nw_proto == IPPROTO_TCP; + return is_ip_any(flow) && flow->nw_proto == IPPROTO_TCP + && !(flow->nw_frag & FLOW_NW_FRAG_LATER); case MFP_UDP: - return is_ip_any(flow) && flow->nw_proto == IPPROTO_UDP; + return is_ip_any(flow) && flow->nw_proto == IPPROTO_UDP + && !(flow->nw_frag & FLOW_NW_FRAG_LATER); case MFP_SCTP: - return is_ip_any(flow) && flow->nw_proto == IPPROTO_SCTP; + return is_ip_any(flow) && flow->nw_proto == IPPROTO_SCTP + && !(flow->nw_frag & FLOW_NW_FRAG_LATER); case MFP_ICMPV4: return is_icmpv4(flow); case MFP_ICMPV6: @@ -1131,6 +334,7 @@ case MFP_SCTP: case MFP_ICMPV4: case MFP_ICMPV6: + /* nw_frag always unwildcarded. */ mask->nw_proto = 0xff; /* Fall through. */ case MFP_ARP: @@ -1148,6 +352,41 @@ } } +/* Set bits of 'bm' corresponding to the field 'mf' and it's prerequisities. */ +void +mf_bitmap_set_field_and_prereqs(const struct mf_field *mf, struct mf_bitmap *bm) +{ + bitmap_set1(bm->bm, mf->id); + + switch (mf->prereqs) { + case MFP_ND: + case MFP_ND_SOLICIT: + case MFP_ND_ADVERT: + bitmap_set1(bm->bm, MFF_TCP_SRC); + bitmap_set1(bm->bm, MFF_TCP_DST); + /* Fall through. */ + case MFP_TCP: + case MFP_UDP: + case MFP_SCTP: + case MFP_ICMPV4: + case MFP_ICMPV6: + /* nw_frag always unwildcarded. */ + bitmap_set1(bm->bm, MFF_IP_PROTO); + /* Fall through. */ + case MFP_ARP: + case MFP_IPV4: + case MFP_IPV6: + case MFP_MPLS: + case MFP_IP_ANY: + bitmap_set1(bm->bm, MFF_ETH_TYPE); + break; + case MFP_VLAN_VID: + bitmap_set1(bm->bm, MFF_VLAN_TCI); + break; + case MFP_NONE: + break; + } +} /* Returns true if 'value' may be a valid value *as part of a masked match*, * false otherwise. @@ -1165,17 +404,21 @@ switch (mf->id) { case MFF_DP_HASH: case MFF_RECIRC_ID: + case MFF_CONJ_ID: case MFF_TUN_ID: case MFF_TUN_SRC: case MFF_TUN_DST: case MFF_TUN_TOS: case MFF_TUN_TTL: case MFF_TUN_FLAGS: + case MFF_TUN_GBP_ID: + case MFF_TUN_GBP_FLAGS: case MFF_METADATA: case MFF_IN_PORT: case MFF_SKB_PRIORITY: case MFF_PKT_MARK: CASE_MFF_REGS: + CASE_MFF_XREGS: case MFF_ETH_SRC: case MFF_ETH_DST: case MFF_ETH_TYPE: @@ -1205,7 +448,8 @@ case MFF_ND_TLL: return true; - case MFF_IN_PORT_OXM: { + case MFF_IN_PORT_OXM: + case MFF_ACTSET_OUTPUT: { ofp_port_t port; return !ofputil_port_from_ofp11(value->be32, &port); } @@ -1264,6 +508,9 @@ case MFF_RECIRC_ID: value->be32 = htonl(flow->recirc_id); break; + case MFF_CONJ_ID: + value->be32 = htonl(flow->conj_id); + break; case MFF_TUN_ID: value->be64 = flow->tunnel.tun_id; break; @@ -1276,6 +523,12 @@ case MFF_TUN_FLAGS: value->be16 = htons(flow->tunnel.flags); break; + case MFF_TUN_GBP_ID: + value->be16 = flow->tunnel.gbp_id; + break; + case MFF_TUN_GBP_FLAGS: + value->u8 = flow->tunnel.gbp_flags; + break; case MFF_TUN_TTL: value->u8 = flow->tunnel.ip_ttl; break; @@ -1293,6 +546,9 @@ case MFF_IN_PORT_OXM: value->be32 = ofputil_port_to_ofp11(flow->in_port.ofp_port); break; + case MFF_ACTSET_OUTPUT: + value->be32 = ofputil_port_to_ofp11(flow->actset_output); + break; case MFF_SKB_PRIORITY: value->be32 = htonl(flow->skb_priority); @@ -1306,6 +562,10 @@ value->be32 = htonl(flow->regs[mf->id - MFF_REG0]); break; + CASE_MFF_XREGS: + value->be64 = htonll(flow_get_xreg(flow, mf->id - MFF_XREG0)); + break; + case MFF_ETH_SRC: memcpy(value->mac, flow->dl_src, ETH_ADDR_LEN); break; @@ -1462,6 +722,9 @@ case MFF_RECIRC_ID: match_set_recirc_id(match, ntohl(value->be32)); break; + case MFF_CONJ_ID: + match_set_conj_id(match, ntohl(value->be32)); + break; case MFF_TUN_ID: match_set_tun_id(match, value->be64); break; @@ -1474,6 +737,12 @@ case MFF_TUN_FLAGS: match_set_tun_flags(match, ntohs(value->be16)); break; + case MFF_TUN_GBP_ID: + match_set_tun_gbp_id(match, value->be16); + break; + case MFF_TUN_GBP_FLAGS: + match_set_tun_gbp_flags(match, value->u8); + break; case MFF_TUN_TOS: match_set_tun_tos(match, value->u8); break; @@ -1495,6 +764,12 @@ match_set_in_port(match, port); break; } + case MFF_ACTSET_OUTPUT: { + ofp_port_t port; + ofputil_port_from_ofp11(value->be32, &port); + match_set_actset_output(match, port); + break; + } case MFF_SKB_PRIORITY: match_set_skb_priority(match, ntohl(value->be32)); @@ -1508,6 +783,10 @@ match_set_reg(match, mf->id - MFF_REG0, ntohl(value->be32)); break; + CASE_MFF_XREGS: + match_set_xreg(match, mf->id - MFF_XREG0, ntohll(value->be64)); + break; + case MFF_ETH_SRC: match_set_dl_src(match, value->mac); break; @@ -1681,6 +960,9 @@ case MFF_RECIRC_ID: flow->recirc_id = ntohl(value->be32); break; + case MFF_CONJ_ID: + flow->conj_id = ntohl(value->be32); + break; case MFF_TUN_ID: flow->tunnel.tun_id = value->be64; break; @@ -1693,6 +975,12 @@ case MFF_TUN_FLAGS: flow->tunnel.flags = ntohs(value->be16); break; + case MFF_TUN_GBP_ID: + flow->tunnel.gbp_id = value->be16; + break; + case MFF_TUN_GBP_FLAGS: + flow->tunnel.gbp_flags = value->u8; + break; case MFF_TUN_TOS: flow->tunnel.ip_tos = value->u8; break; @@ -1708,12 +996,12 @@ flow->in_port.ofp_port = u16_to_ofp(ntohs(value->be16)); break; - case MFF_IN_PORT_OXM: { - ofp_port_t port; - ofputil_port_from_ofp11(value->be32, &port); - flow->in_port.ofp_port = port; + case MFF_IN_PORT_OXM: + ofputil_port_from_ofp11(value->be32, &flow->in_port.ofp_port); + break; + case MFF_ACTSET_OUTPUT: + ofputil_port_from_ofp11(value->be32, &flow->actset_output); break; - } case MFF_SKB_PRIORITY: flow->skb_priority = ntohl(value->be32); @@ -1727,6 +1015,10 @@ flow->regs[mf->id - MFF_REG0] = ntohl(value->be32); break; + CASE_MFF_XREGS: + flow_set_xreg(flow, mf->id - MFF_XREG0, ntohll(value->be64)); + break; + case MFF_ETH_SRC: memcpy(flow->dl_src, value->mac, ETH_ADDR_LEN); break; @@ -1784,7 +1076,7 @@ break; case MFF_IPV6_LABEL: - flow->ipv6_label = value->be32 & ~htonl(IPV6_LABEL_MASK); + flow->ipv6_label = value->be32 & htonl(IPV6_LABEL_MASK); break; case MFF_IP_PROTO: @@ -1872,6 +1164,36 @@ } } +/* Consider each of 'src', 'mask', and 'dst' as if they were arrays of 8*n + * bits. Then, for each 0 <= i < 8 * n such that mask[i] == 1, sets dst[i] = + * src[i]. */ +static void +apply_mask(const uint8_t *src, const uint8_t *mask, uint8_t *dst, size_t n) +{ + size_t i; + + for (i = 0; i < n; i++) { + dst[i] = (src[i] & mask[i]) | (dst[i] & ~mask[i]); + } +} + +/* Sets 'flow' member field described by 'field' to 'value', except that bits + * for which 'mask' has a 0-bit keep their existing values. The caller is + * responsible for ensuring that 'flow' meets 'field''s prerequisites.*/ +void +mf_set_flow_value_masked(const struct mf_field *field, + const union mf_value *value, + const union mf_value *mask, + struct flow *flow) +{ + union mf_value tmp; + + mf_get_value(field, flow, &tmp); + apply_mask((const uint8_t *) value, (const uint8_t *) mask, + (uint8_t *) &tmp, field->n_bytes); + mf_set_flow_value(field, &tmp, flow); +} + /* Returns true if 'mf' has a zero value in 'flow', false if it is nonzero. * * The caller is responsible for ensuring that 'flow' meets 'mf''s @@ -1882,7 +1204,7 @@ union mf_value value; mf_get_value(mf, flow, &value); - return is_all_zeros((const uint8_t *) &value, mf->n_bytes); + return is_all_zeros(&value, mf->n_bytes); } /* Makes 'match' wildcard field 'mf'. @@ -1901,6 +1223,10 @@ match->flow.recirc_id = 0; match->wc.masks.recirc_id = 0; break; + case MFF_CONJ_ID: + match->flow.conj_id = 0; + match->wc.masks.conj_id = 0; + break; case MFF_TUN_ID: match_set_tun_id_masked(match, htonll(0), htonll(0)); break; @@ -1913,6 +1239,12 @@ case MFF_TUN_FLAGS: match_set_tun_flags_masked(match, 0, 0); break; + case MFF_TUN_GBP_ID: + match_set_tun_gbp_id_masked(match, 0, 0); + break; + case MFF_TUN_GBP_FLAGS: + match_set_tun_gbp_flags_masked(match, 0, 0); + break; case MFF_TUN_TOS: match_set_tun_tos_masked(match, 0, 0); break; @@ -1929,6 +1261,10 @@ match->flow.in_port.ofp_port = 0; match->wc.masks.in_port.ofp_port = 0; break; + case MFF_ACTSET_OUTPUT: + match->flow.actset_output = 0; + match->wc.masks.actset_output = 0; + break; case MFF_SKB_PRIORITY: match->flow.skb_priority = 0; @@ -1944,6 +1280,10 @@ match_set_reg_masked(match, mf->id - MFF_REG0, 0, 0); break; + CASE_MFF_XREGS: + match_set_xreg_masked(match, mf->id - MFF_XREG0, 0, 0); + break; + case MFF_ETH_SRC: memset(match->flow.dl_src, 0, ETH_ADDR_LEN); memset(match->wc.masks.dl_src, 0, ETH_ADDR_LEN); @@ -2104,18 +1444,20 @@ const union mf_value *value, const union mf_value *mask, struct match *match) { - if (!mask || is_all_ones((const uint8_t *) mask, mf->n_bytes)) { + if (!mask || is_all_ones(mask, mf->n_bytes)) { mf_set_value(mf, value, match); - return mf->usable_protocols; - } else if (is_all_zeros((const uint8_t *) mask, mf->n_bytes)) { + return mf->usable_protocols_exact; + } else if (is_all_zeros(mask, mf->n_bytes)) { mf_set_wild(mf, match); return OFPUTIL_P_ANY; } switch (mf->id) { case MFF_RECIRC_ID: + case MFF_CONJ_ID: case MFF_IN_PORT: case MFF_IN_PORT_OXM: + case MFF_ACTSET_OUTPUT: case MFF_SKB_PRIORITY: case MFF_ETH_TYPE: case MFF_DL_VLAN: @@ -2151,6 +1493,12 @@ case MFF_TUN_FLAGS: match_set_tun_flags_masked(match, ntohs(value->be16), ntohs(mask->be16)); break; + case MFF_TUN_GBP_ID: + match_set_tun_gbp_id_masked(match, value->be16, mask->be16); + break; + case MFF_TUN_GBP_FLAGS: + match_set_tun_gbp_flags_masked(match, value->u8, mask->u8); + break; case MFF_TUN_TTL: match_set_tun_ttl_masked(match, value->u8, mask->u8); break; @@ -2167,6 +1515,11 @@ ntohl(value->be32), ntohl(mask->be32)); break; + CASE_MFF_XREGS: + match_set_xreg_masked(match, mf->id - MFF_XREG0, + ntohll(value->be64), ntohll(mask->be64)); + break; + case MFF_PKT_MARK: match_set_pkt_mark_masked(match, ntohl(value->be32), ntohl(mask->be32)); @@ -2200,11 +1553,11 @@ case MFF_IPV4_SRC: match_set_nw_src_masked(match, value->be32, mask->be32); - goto cidr_check; + break; case MFF_IPV4_DST: match_set_nw_dst_masked(match, value->be32, mask->be32); - goto cidr_check; + break; case MFF_IPV6_SRC: match_set_ipv6_src_masked(match, &value->ipv6, &mask->ipv6); @@ -2232,11 +1585,11 @@ case MFF_ARP_SPA: match_set_nw_src_masked(match, value->be32, mask->be32); - goto cidr_check; + break; case MFF_ARP_TPA: match_set_nw_dst_masked(match, value->be32, mask->be32); - goto cidr_check; + break; case MFF_TCP_SRC: case MFF_UDP_SRC: @@ -2259,11 +1612,10 @@ OVS_NOT_REACHED(); } - return mf->usable_protocols_bitwise; - -cidr_check: - return ip_is_cidr(mask->be32) ? mf->usable_protocols : - mf->usable_protocols_bitwise; + return ((mf->usable_protocols_bitwise == mf->usable_protocols_cidr + || ip_is_cidr(mask->be32)) + ? mf->usable_protocols_cidr + : mf->usable_protocols_bitwise); } static enum ofperr @@ -2332,39 +1684,35 @@ mf_from_integer_string(const struct mf_field *mf, const char *s, uint8_t *valuep, uint8_t *maskp) { - unsigned long long int integer, mask; char *tail; - int i; + const char *err_str = ""; + int err; - errno = 0; - integer = strtoull(s, &tail, 0); - if (errno || (*tail != '\0' && *tail != '/')) { + err = parse_int_string(s, valuep, mf->n_bytes, &tail); + if (err || (*tail != '\0' && *tail != '/')) { + err_str = "value"; goto syntax_error; } if (*tail == '/') { - mask = strtoull(tail + 1, &tail, 0); - if (errno || *tail != '\0') { + err = parse_int_string(tail + 1, maskp, mf->n_bytes, &tail); + if (err || *tail != '\0') { + err_str = "mask"; goto syntax_error; } } else { - mask = ULLONG_MAX; + memset(maskp, 0xff, mf->n_bytes); } - for (i = mf->n_bytes - 1; i >= 0; i--) { - valuep[i] = integer; - maskp[i] = mask; - integer >>= 8; - mask >>= 8; - } - if (integer) { - return xasprintf("%s: value too large for %u-byte field %s", - s, mf->n_bytes, mf->name); - } return NULL; syntax_error: - return xasprintf("%s: bad syntax for %s", s, mf->name); + if (err == ERANGE) { + return xasprintf("%s: %s too large for %u-byte field %s", + s, err_str, mf->n_bytes, mf->name); + } else { + return xasprintf("%s: bad syntax for %s %s", s, mf->name, err_str); + } } static char * @@ -2759,33 +2107,25 @@ mf_format_integer_string(const struct mf_field *mf, const uint8_t *valuep, const uint8_t *maskp, struct ds *s) { - unsigned long long int integer; - int i; - - ovs_assert(mf->n_bytes <= 8); - - integer = 0; - for (i = 0; i < mf->n_bytes; i++) { - integer = (integer << 8) | valuep[i]; - } if (mf->string == MFS_HEXADECIMAL) { - ds_put_format(s, "%#llx", integer); + ds_put_hex(s, valuep, mf->n_bytes); } else { - ds_put_format(s, "%lld", integer); - } - - if (maskp) { - unsigned long long int mask; + unsigned long long int integer = 0; + int i; - mask = 0; + ovs_assert(mf->n_bytes <= 8); for (i = 0; i < mf->n_bytes; i++) { - mask = (mask << 8) | maskp[i]; + integer = (integer << 8) | valuep[i]; } + ds_put_format(s, "%lld", integer); + } + if (maskp) { /* I guess we could write the mask in decimal for MFS_DECIMAL but I'm * not sure that that a bit-mask written in decimal is ever easier to * understand than the same bit-mask written in hexadecimal. */ - ds_put_format(s, "/%#llx", mask); + ds_put_char(s, '/'); + ds_put_hex(s, maskp, mf->n_bytes); } } @@ -2827,10 +2167,10 @@ struct ds *s) { if (mask) { - if (is_all_zeros((const uint8_t *) mask, mf->n_bytes)) { + if (is_all_zeros(mask, mf->n_bytes)) { ds_put_cstr(s, "ANY"); return; - } else if (is_all_ones((const uint8_t *) mask, mf->n_bytes)) { + } else if (is_all_ones(mask, mf->n_bytes)) { mask = NULL; } } @@ -2945,157 +2285,17 @@ return bitwise_get(&value, sf->field->n_bytes, sf->ofs, sf->n_bits); } -/* Formats 'sf' into 's' in a format normally acceptable to - * mf_parse_subfield(). (It won't be acceptable if sf->field is NULL or if - * sf->field has no NXM name.) */ void -mf_format_subfield(const struct mf_subfield *sf, struct ds *s) -{ - if (!sf->field) { - ds_put_cstr(s, ""); - } else if (sf->field->nxm_name) { - ds_put_cstr(s, sf->field->nxm_name); - } else if (sf->field->nxm_header) { - uint32_t header = sf->field->nxm_header; - ds_put_format(s, "%d:%d", NXM_VENDOR(header), NXM_FIELD(header)); - } else { - ds_put_cstr(s, sf->field->name); - } - - if (sf->field && sf->ofs == 0 && sf->n_bits == sf->field->n_bits) { - ds_put_cstr(s, "[]"); - } else if (sf->n_bits == 1) { - ds_put_format(s, "[%d]", sf->ofs); - } else { - ds_put_format(s, "[%d..%d]", sf->ofs, sf->ofs + sf->n_bits - 1); - } -} - -static const struct mf_field * -mf_parse_subfield_name(const char *name, int name_len, bool *wild) -{ - int i; - - *wild = name_len > 2 && !memcmp(&name[name_len - 2], "_W", 2); - if (*wild) { - name_len -= 2; - } - - for (i = 0; i < MFF_N_IDS; i++) { - const struct mf_field *mf = mf_from_id(i); - - if (mf->nxm_name - && !strncmp(mf->nxm_name, name, name_len) - && mf->nxm_name[name_len] == '\0') { - return mf; - } - if (mf->oxm_name - && !strncmp(mf->oxm_name, name, name_len) - && mf->oxm_name[name_len] == '\0') { - return mf; - } - } - - return NULL; -} - -/* Parses a subfield from the beginning of '*sp' into 'sf'. If successful, - * returns NULL and advances '*sp' to the first byte following the parsed - * string. On failure, returns a malloc()'d error message, does not modify - * '*sp', and does not properly initialize 'sf'. - * - * The syntax parsed from '*sp' takes the form "header[start..end]" where - * 'header' is the name of an NXM field and 'start' and 'end' are (inclusive) - * bit indexes. "..end" may be omitted to indicate a single bit. "start..end" - * may both be omitted (the [] are still required) to indicate an entire - * field. */ -char * WARN_UNUSED_RESULT -mf_parse_subfield__(struct mf_subfield *sf, const char **sp) +mf_format_subvalue(const union mf_subvalue *subvalue, struct ds *s) { - const struct mf_field *field; - const char *name; - int start, end; - const char *s; - int name_len; - bool wild; - - s = *sp; - name = s; - name_len = strcspn(s, "["); - if (s[name_len] != '[') { - return xasprintf("%s: missing [ looking for field name", *sp); - } - - field = mf_parse_subfield_name(name, name_len, &wild); - if (!field) { - return xasprintf("%s: unknown field `%.*s'", *sp, name_len, s); - } - - s += name_len; - if (ovs_scan(s, "[%d..%d]", &start, &end)) { - /* Nothing to do. */ - } else if (ovs_scan(s, "[%d]", &start)) { - end = start; - } else if (!strncmp(s, "[]", 2)) { - start = 0; - end = field->n_bits - 1; - } else { - return xasprintf("%s: syntax error expecting [] or [] or " - "[..]", *sp); - } - s = strchr(s, ']') + 1; - - if (start > end) { - return xasprintf("%s: starting bit %d is after ending bit %d", - *sp, start, end); - } else if (start >= field->n_bits) { - return xasprintf("%s: starting bit %d is not valid because field is " - "only %d bits wide", *sp, start, field->n_bits); - } else if (end >= field->n_bits){ - return xasprintf("%s: ending bit %d is not valid because field is " - "only %d bits wide", *sp, end, field->n_bits); - } - - sf->field = field; - sf->ofs = start; - sf->n_bits = end - start + 1; - - *sp = s; - return NULL; -} - -/* Parses a subfield from the entirety of 's' into 'sf'. Returns NULL if - * successful, otherwise a malloc()'d string describing the error. The caller - * is responsible for freeing the returned string. - * - * The syntax parsed from 's' takes the form "header[start..end]" where - * 'header' is the name of an NXM field and 'start' and 'end' are (inclusive) - * bit indexes. "..end" may be omitted to indicate a single bit. "start..end" - * may both be omitted (the [] are still required) to indicate an entire - * field. */ -char * WARN_UNUSED_RESULT -mf_parse_subfield(struct mf_subfield *sf, const char *s) -{ - char *error = mf_parse_subfield__(sf, &s); - if (!error && s[0]) { - error = xstrdup("unexpected input following field syntax"); - } - return error; + ds_put_hex(s, subvalue->u8, sizeof subvalue->u8); } void -mf_format_subvalue(const union mf_subvalue *subvalue, struct ds *s) +field_array_set(enum mf_field_id id, const union mf_value *value, + struct field_array *fa) { - int i; - - for (i = 0; i < ARRAY_SIZE(subvalue->u8); i++) { - if (subvalue->u8[i]) { - ds_put_format(s, "0x%"PRIx8, subvalue->u8[i]); - for (i++; i < ARRAY_SIZE(subvalue->u8); i++) { - ds_put_format(s, "%02"PRIx8, subvalue->u8[i]); - } - return; - } - } - ds_put_char(s, '0'); + ovs_assert(id < MFF_N_IDS); + bitmap_set1(fa->used.bm, id); + fa->value[id] = *value; } diff -Nru openvswitch-2.3.1/lib/meta-flow.h openvswitch-2.4.0~git20150623/lib/meta-flow.h --- openvswitch-2.3.1/lib/meta-flow.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/meta-flow.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,164 +20,1417 @@ #include #include #include +#include "bitmap.h" #include "flow.h" #include "ofp-errors.h" -#include "ofp-util.h" #include "packets.h" #include "util.h" struct ds; struct match; -/* The comment on each of these indicates the member in "union mf_value" used - * to represent its value. */ +/* Open vSwitch fields + * =================== + * + * A "field" is a property of a packet. Most familiarly, "data fields" are + * fields that can be extracted from a packet. + * + * Some data fields are always present as a consequence of the basic networking + * technology in use. Ethernet is the assumed base technology for current + * versions of OpenFlow and Open vSwitch, so Ethernet header fields are always + * available. + * + * Other data fields are not always present. A packet contains ARP fields, for + * example, only when its Ethernet header indicates the Ethertype for ARP, + * 0x0806. We say that a field is "applicable" when it is it present in a + * packet, and "inapplicable" when it is not, and refer to the conditions that + * determine whether a field is applicable as "prerequisites". Some + * VLAN-related fields are a special case: these fields are always applicable, + * but have a designated value or bit that indicates whether a VLAN header is + * present, with the remaining values or bits indicating the VLAN header's + * content (if it is present). See MFF_VLAN_TCI for an example. + * + * Conceptually, an inapplicable field does not have a value, not even a + * nominal ``value'' such as all-zero-bits. In many circumstances, OpenFlow + * and Open vSwitch allow references only to applicable fields. For example, + * one may match a given field only if the match includes the field's + * prerequisite, e.g. matching an ARP field is only allowed if one also matches + * on Ethertype 0x0806. + * + * (Practically, however, OVS represents a field's value as some fixed member + * in its "struct flow", so accessing that member will obtain some value. Some + * members are used for more than one purpose, e.g. the "tp_src" member + * represents the TCP, UDP, and SCTP source port, so the value read may not + * even make sense. For this reason, it is important to know whether a field's + * prerequisites are satisfied before attempting to read it.) + * + * Sometimes a packet may contain multiple instances of a header. For example, + * a packet may contain multiple VLAN or MPLS headers, and tunnels can cause + * any data field to recur. OpenFlow and Open vSwitch do not address these + * cases uniformly. For VLAN and MPLS headers, only the outermost header is + * accessible, so that inner headers may be accessed only by ``popping'' + * (removing) the outer header. (Open vSwitch supports only a single VLAN + * header in any case.) For tunnels, e.g. GRE or VXLAN, the outer header and + * inner headers are treated as different data fields. + * + * OpenFlow and Open vSwitch support some fields other than data fields. + * "Metadata fields" relate to the origin or treatment of a packet, but they + * are not extracted from the packet data itself. One example is the physical + * port on which a packet arrived at the switch. "Register fields" act like + * variables: they give an OpenFlow switch space for temporary storage while + * processing a packet. Existing metadata and register fields have no + * prerequisites. + * + * A field's value consists of an integral number of bytes. Most data fields + * are copied directly from protocol headers, e.g. at layer 2, MFF_ETH_SRC is + * copied from the Ethernet source address and MFF_ETH_DST from the destination + * address. Other data fields are copied from a packet with padding, usually + * with zeros and in the most significant positions (see e.g. MFF_MPLS_LABEL) + * but not always (see e.g. MFF_IP_DSCP). A final category of data fields is + * transformed in other ways as they are copied from the packets, to make them + * more useful for matching, e.g. MFF_IP_FRAG describes whether a packet is a + * fragment but it is not copied directly from the IP header. + * + * + * Field specifications + * ==================== + * + * Each of the enumeration values below represents a field. The comments + * preceding each enum must be in a stylized form that is parsed at compile + * time by the extract-ofp-fields program. The comment itself consists of a + * series of paragraphs separate by blank lines. The paragraphs consist of: + * + * - The first paragraph gives the user-visible name of the field as a + * quoted string. This is the name used for parsing and formatting the + * field. + * + * For historical reasons, some fields have an additional name that is + * accepted as an alternative in parsing. This name, when there is one, + * is given as a quoted string in parentheses along with "aka". For + * example: + * + * "tun_id" (aka "tunnel_id"). + * + * New fields should have only one name. + * + * - Any number of paragraphs of free text that describe the field. This + * is meant for human readers, so extract-ofp-fields ignores it. + * + * - A final paragraph that consists of a series of key-value pairs, one + * per line, in the form "key: value." where the period at the end of the + * line is a mandatory part of the syntax. + * + * Every field must specify the following key-value pairs: + * + * Type: + * + * The format and size of the field's value. Some possible values are + * generic: + * + * u8: A one-byte field. + * be16: A two-byte field. + * be32: A four-byte field. + * be64: An eight-byte field. + * + * The remaining values imply more about the value's semantics, though OVS + * does not currently take advantage of this additional information: + * + * MAC: A six-byte field whose value is an Ethernet address. + * IPv6: A 16-byte field whose value is an IPv6 address. + * + * Maskable: + * + * Either "bitwise", if OVS supports matching any subset of bits in the + * field, or "no", if OVS only supports matching or wildcarding the entire + * field. + * + * Formatting: + * + * Explains how a field's value is formatted and parsed for human + * consumption. Some of the options are fairly generally useful: + * + * decimal: Formats the value as a decimal number. On parsing, accepts + * decimal (with no prefix), hexadecimal with 0x prefix, or octal + * with 0 prefix. + * + * hexadecimal: Same as decimal except nonzero values are formatted in + * hex with 0x prefix. The default for parsing is *not* hexadecimal: + * only with a 0x prefix is the input in hexadecimal. + * + * Ethernet: Formats and accepts the common format xx:xx:xx:xx:xx:xx. + * 6-byte fields only. + * + * IPv4: Formats and accepts the common format w.x.y.z. 4-byte fields + * only. + * + * IPv6: Formats and accepts the common IPv6 formats. 16-byte fields + * only. + * + * OpenFlow 1.0 port: Accepts an OpenFlow well-known port name + * (e.g. "IN_PORT") in uppercase or lowercase, or a 16-bit port + * number in decimal. Formats ports using their well-known names in + * uppercase, or in decimal otherwise. 2-byte fields only. + * + * OpenFlow 1.1+ port: Same syntax as for OpenFlow 1.0 ports but for + * 4-byte OpenFlow 1.1+ port number fields. + * + * Others are very specific to particular fields: + * + * frag: One of the strings "no", "first", "later", "yes", "not_later" + * describing which IPv4/v6 fragments are matched. + * + * tunnel flags: Any number of the strings "df", "csum", "key", or + * "oam" separated by "|". + * + * TCP flags: See the description of tcp_flags in ovs-ofctl(8). + * + * Prerequisites: + * + * The field's prerequisites. The values should be straightfoward. + * + * Access: + * + * Either "read-only", for a field that cannot be changed via OpenFlow, or + * "read/write" for a modifiable field. + * + * NXM: + * + * If the field has an NXM field assignment, then this specifies the NXM + * name of the field (e.g. "NXM_OF_ETH_SRC"), followed by its nxm_type in + * parentheses, followed by "since v." specifying the version of Open + * vSwitch that first supported this field in NXM (e.g. "since v1.1" if it + * was introduced in Open vSwitch 1.1). + * + * The NXM name must begin with NXM_OF_ or NXM_NX_. This allows OVS to + * determine the correct NXM class. + * + * If the field does not have an NXM field assignment, specify "none". + * + * OXM: + * + * If the field has an OXM field assignment, then this specifies the OXM + * name of the field (e.g. "OXM_OF_ETH_SRC"), followed by its nxm_type in + * parentheses, followed by "since OF. v." specifying the + * versions of OpenFlow and Open vSwitch that first supported this field in + * OXM (e.g. "since OF1.3 and v1.10" if it was introduced in OpenFlow 1.3 + * and first supported by Open vSwitch in version 1.10). + * + * Some fields have more than one OXM field assignment. For example, + * actset_output has an experimenter OXM assignment in OpenFlow 1.3 and a + * standard OXM assignment in OpenFlow 1.5. In such a case, specify both, + * separated by commas. + * + * OVS uses the start of the OXM field name to determine the correct OXM + * class. To support a new OXM class, edit the mapping table in + * build-aux/extract-ofp-fields. + * + * If the field does not have an OXM field assignment, specify "none". + * + * The following key-value pairs are optional. Open vSwitch already supports + * all the fields to which they apply, so new fields should probably not + * include these pairs: + * + * OF1.0: + * + * Specify this as "exact match" if OpenFlow 1.0 can match or wildcard the + * entire field, or as "CIDR mask" if OpenFlow 1.0 can match any CIDR + * prefix of the field. (OpenFlow 1.0 did not support bitwise matching.) + * Omit, if OpenFlow 1.0 did not support this field. + * + * OF1.1: + * + * Specify this as "exact match" if OpenFlow 1.1 can match or wildcard the + * entire field, or as "bitwise" if OpenFlow 1.1 can match any subset of + * bits in the field. Omit, if OpenFlow 1.1 did not support this field. + * + * The following key-value pair is optional: + * + * Prefix lookup member: + * + * If this field makes sense for use with classifier_set_prefix_fields(), + * specify the name of the "struct flow" member that corresponds to the + * field. + * + * Finally, a few "register" fields have very similar names and purposes, + * e.g. MFF_REG0 through MFF_REG7. For these, the comments may be merged + * together using as a metasyntactic variable for the numeric suffix. + * Lines in the comment that are specific to one of the particular fields by + * writing, e.g. <1>, to consider that line only for e.g. MFF_REG1. + */ + enum OVS_PACKED_ENUM mf_field_id { - /* Metadata. */ - MFF_DP_HASH, /* be32 */ - MFF_RECIRC_ID, /* be32 */ - MFF_TUN_ID, /* be64 */ - MFF_TUN_SRC, /* be32 */ - MFF_TUN_DST, /* be32 */ - MFF_TUN_FLAGS, /* be16 */ - MFF_TUN_TTL, /* u8 */ - MFF_TUN_TOS, /* u8 */ - MFF_METADATA, /* be64 */ - MFF_IN_PORT, /* be16 */ - MFF_IN_PORT_OXM, /* be32 */ - MFF_SKB_PRIORITY, /* be32 */ - MFF_PKT_MARK, /* be32 */ +/* ## -------- ## */ +/* ## Metadata ## */ +/* ## -------- ## */ -#if FLOW_N_REGS > 0 - MFF_REG0, /* be32 */ -#endif -#if FLOW_N_REGS > 1 - MFF_REG1, /* be32 */ -#endif -#if FLOW_N_REGS > 2 - MFF_REG2, /* be32 */ -#endif -#if FLOW_N_REGS > 3 - MFF_REG3, /* be32 */ -#endif -#if FLOW_N_REGS > 4 - MFF_REG4, /* be32 */ -#endif -#if FLOW_N_REGS > 5 - MFF_REG5, /* be32 */ -#endif -#if FLOW_N_REGS > 6 - MFF_REG6, /* be32 */ + /* "dp_hash". + * + * Flow hash computed in the datapath. Internal use only, not programmable + * from controller. + * + * The OXM code point for this is an attempt to test OXM experimenter + * support, which is otherwise difficult to test due to the dearth of use + * out in the wild. Because controllers can't add flows that match on + * dp_hash, this doesn't commit OVS to supporting this OXM experimenter + * code point in the future. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read-only. + * NXM: NXM_NX_DP_HASH(35) since v2.2. + * OXM: NXOXM_ET_DP_HASH(0) since OF1.5 and v2.4. + */ + MFF_DP_HASH, + + /* "recirc_id". + * + * ID for recirculation. The value 0 is reserved for initially received + * packets. Internal use only, not programmable from controller. + * + * Type: be32. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: none. + * Access: read-only. + * NXM: NXM_NX_RECIRC_ID(36) since v2.2. + * OXM: none. + */ + MFF_RECIRC_ID, + + /* "conj_id". + * + * ID for "conjunction" actions. Please refer to ovs-ofctl(8) + * documentation of "conjunction" for details. + * + * Type: be32. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: none. + * Access: read-only. + * NXM: NXM_NX_CONJ_ID(37) since v2.4. + * OXM: none. */ + MFF_CONJ_ID, + + /* "tun_id" (aka "tunnel_id"). + * + * The "key" or "tunnel ID" or "VNI" in a packet received via a keyed + * tunnel. For protocols in which the key is shorter than 64 bits, the key + * is stored in the low bits and the high bits are zeroed. For non-keyed + * tunnels and packets not received via a tunnel, the value is 0. + * + * Type: be64. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_NX_TUN_ID(16) since v1.1. + * OXM: OXM_OF_TUNNEL_ID(38) since OF1.3 and v1.10. + * Prefix lookup member: tunnel.tun_id. + */ + MFF_TUN_ID, + + /* "tun_src". + * + * The IPv4 source address in the outer IP header of a tunneled packet. + * + * For non-tunneled packets, the value is 0. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: IPv4. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_NX_TUN_IPV4_SRC(31) since v2.0. + * OXM: none. + * Prefix lookup member: tunnel.ip_src. + */ + MFF_TUN_SRC, + + /* "tun_dst". + * + * The IPv4 destination address in the outer IP header of a tunneled + * packet. + * + * For non-tunneled packets, the value is 0. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: IPv4. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_NX_TUN_IPV4_DST(32) since v2.0. + * OXM: none. + * Prefix lookup member: tunnel.ip_dst. + */ + MFF_TUN_DST, + + /* "tun_flags". + * + * Combination of FLOW_TNL_F_* bitmapped flags that indicate properties of + * a tunneled packet. Internal use only, not programmable from controller. + * + * For non-tunneled packets, the value is 0. + * + * Type: be16. + * Maskable: no. + * Formatting: tunnel flags. + * Prerequisites: none. + * Access: read-only. + * NXM: none. + * OXM: none. + */ + MFF_TUN_FLAGS, + + /* "tun_ttl". + * + * The TTL in the outer IP header of a tunneled packet. Internal use only, + * not programmable from controller. + * + * For non-tunneled packets, the value is 0. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: none. + * Access: read-only. + * NXM: none. + * OXM: none. + */ + MFF_TUN_TTL, + + /* "tun_tos". + * + * The ToS value in the outer IP header of a tunneled packet. Internal use + * only, not programmable from controller. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: none. + * Access: read-only. + * NXM: none. + * OXM: none. + */ + MFF_TUN_TOS, + + /* "tun_gbp_id". + * + * VXLAN Group Policy ID + * + * Type: be16. + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_NX_TUN_GBP_ID(38) since v2.4. + * OXM: none. + */ + MFF_TUN_GBP_ID, + + /* "tun_gbp_flags". + * + * VXLAN Group Policy flags + * + * Type: u8. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_NX_TUN_GBP_FLAGS(39) since v2.4. + * OXM: none. + */ + MFF_TUN_GBP_FLAGS, + + /* "metadata". + * + * A scratch pad value standardized in OpenFlow 1.1+. Initially zero, at + * the beginning of the pipeline. + * + * Type: be64. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_METADATA(2) since OF1.2 and v1.8. + * OF1.1: bitwise mask. + */ + MFF_METADATA, + + /* "in_port". + * + * 16-bit (OpenFlow 1.0) view of the physical or virtual port on which the + * packet was received. + * + * Type: be16. + * Maskable: no. + * Formatting: OpenFlow 1.0 port. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_OF_IN_PORT(0) since v1.1. + * OXM: none. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_IN_PORT, + + /* "in_port_oxm". + * + * 32-bit (OpenFlow 1.1+) view of the physical or virtual port on which the + * packet was received. + * + * Type: be32. + * Maskable: no. + * Formatting: OpenFlow 1.1+ port. + * Prerequisites: none. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_IN_PORT(0) since OF1.2 and v1.7. + * OF1.1: exact match. + */ + MFF_IN_PORT_OXM, + + /* "actset_output". + * + * Type: be32. + * Maskable: no. + * Formatting: OpenFlow 1.1+ port. + * Prerequisites: none. + * Access: read-only. + * NXM: none. + * OXM: ONFOXM_ET_ACTSET_OUTPUT(43) since OF1.3 and v2.4, + * OXM_OF_ACTSET_OUTPUT(43) since OF1.5 and v2.4. + */ + MFF_ACTSET_OUTPUT, + + /* "skb_priority". + * + * Designates the queue to which output will be directed. The value in + * this field is not necessarily the OpenFlow queue number; with the Linux + * kernel switch, it instead has a pair of subfields designating the + * "major" and "minor" numbers of a Linux kernel qdisc handle. + * + * This field is "semi-internal" in that it can be set with the "set_queue" + * action but not matched or read or written other ways. + * + * Type: be32. + * Maskable: no. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read-only. + * NXM: none. + * OXM: none. + */ + MFF_SKB_PRIORITY, + + /* "pkt_mark". + * + * Packet metadata mark. The mark may be passed into other system + * components in order to facilitate interaction between subsystems. On + * Linux this corresponds to struct sk_buff's "skb_mark" member but the + * exact implementation is platform-dependent. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_NX_PKT_MARK(33) since v2.0. + * OXM: none. + */ + MFF_PKT_MARK, + +#if FLOW_N_REGS == 8 + /* "reg". + * + * Nicira extension scratch pad register with initial value 0. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_NX_REG0(0) since v1.1. <0> + * NXM: NXM_NX_REG1(1) since v1.1. <1> + * NXM: NXM_NX_REG2(2) since v1.1. <2> + * NXM: NXM_NX_REG3(3) since v1.1. <3> + * NXM: NXM_NX_REG4(4) since v1.3. <4> + * NXM: NXM_NX_REG5(5) since v1.7. <5> + * NXM: NXM_NX_REG6(6) since v1.7. <6> + * NXM: NXM_NX_REG7(7) since v1.7. <7> + * OXM: none. + */ + MFF_REG0, + MFF_REG1, + MFF_REG2, + MFF_REG3, + MFF_REG4, + MFF_REG5, + MFF_REG6, + MFF_REG7, +#else +#error "Need to update MFF_REG* to match FLOW_N_REGS" #endif -#if FLOW_N_REGS > 7 - MFF_REG7, /* be32 */ + +#if FLOW_N_XREGS == 4 + /* "xreg". + * + * OpenFlow 1.5 ``extended register". Each extended register + * overlays two of the Nicira extension 32-bit registers: xreg0 overlays + * reg0 and reg1, with reg0 supplying the most-significant bits of xreg0 + * and reg1 the least-significant. xreg1 similarly overlays reg2 and reg3, + * and so on. + * + * These registers were introduced in OpenFlow 1.5, but EXT-244 in the ONF + * JIRA also publishes them as a (draft) OpenFlow extension to OpenFlow + * 1.3. + * + * Type: be64. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_PKT_REG() since OF1.3 and v2.4. + */ + MFF_XREG0, + MFF_XREG1, + MFF_XREG2, + MFF_XREG3, +#else +#error "Need to update MFF_REG* to match FLOW_N_XREGS" #endif - /* L2. */ - MFF_ETH_SRC, /* mac */ - MFF_ETH_DST, /* mac */ - MFF_ETH_TYPE, /* be16 */ - - MFF_VLAN_TCI, /* be16 */ - MFF_DL_VLAN, /* be16 (OpenFlow 1.0 compatibility) */ - MFF_VLAN_VID, /* be16 (OpenFlow 1.2 compatibility) */ - MFF_DL_VLAN_PCP, /* u8 (OpenFlow 1.0 compatibility) */ - MFF_VLAN_PCP, /* be16 (OpenFlow 1.2 compatibility) */ - - /* L2.5 */ - MFF_MPLS_LABEL, /* be32 */ - MFF_MPLS_TC, /* u8 */ - MFF_MPLS_BOS, /* u8 */ - - /* L3. */ - /* Update mf_is_l3_or_higher() if MFF_IPV4_SRC is - * no longer the first element for a field of layer 3 or higher */ - MFF_IPV4_SRC, /* be32 */ - MFF_IPV4_DST, /* be32 */ - - MFF_IPV6_SRC, /* ipv6 */ - MFF_IPV6_DST, /* ipv6 */ - MFF_IPV6_LABEL, /* be32 */ - - /* The IPv4/IPv6 DSCP field has two different views: - * - * - MFF_IP_DSCP has the DSCP in bits 2-7, their bit positions in the - * IPv4 and IPv6 "traffic class" field, as used in OpenFlow 1.0 and 1.1 - * flow format and in NXM's NXM_OF_IP_TOS - * - * - MFF_IP_DSCP has the DSCP in bits 0-5, shifted right two bits from - * their positions in the IPv4 and IPv6 "traffic class" field, as used - * in OpenFlow 1.2+ OXM's OXM_OF_IP_DSCP. */ - MFF_IP_PROTO, /* u8 (used for IPv4 or IPv6) */ - MFF_IP_DSCP, /* u8 (used for IPv4 or IPv6) */ - MFF_IP_DSCP_SHIFTED, /* u8 (used for IPv4 or IPv6) (OF1.2 compat) */ - MFF_IP_ECN, /* u8 (used for IPv4 or IPv6) */ - MFF_IP_TTL, /* u8 (used for IPv4 or IPv6) */ - MFF_IP_FRAG, /* u8 (used for IPv4 or IPv6) */ - - MFF_ARP_OP, /* be16 */ - MFF_ARP_SPA, /* be32 */ - MFF_ARP_TPA, /* be32 */ - MFF_ARP_SHA, /* mac */ - MFF_ARP_THA, /* mac */ - - /* L4. */ - MFF_TCP_SRC, /* be16 (used for IPv4 or IPv6) */ - MFF_TCP_DST, /* be16 (used for IPv4 or IPv6) */ - MFF_TCP_FLAGS, /* be16, 12 bits (4 MSB zeroed, - * used for IPv4 or IPv6) */ - - MFF_UDP_SRC, /* be16 (used for IPv4 or IPv6) */ - MFF_UDP_DST, /* be16 (used for IPv4 or IPv6) */ - - MFF_SCTP_SRC, /* be16 (used for IPv4 or IPv6) */ - MFF_SCTP_DST, /* be16 (used for IPv4 or IPv6) */ - - MFF_ICMPV4_TYPE, /* u8 */ - MFF_ICMPV4_CODE, /* u8 */ - - MFF_ICMPV6_TYPE, /* u8 */ - MFF_ICMPV6_CODE, /* u8 */ - - /* ICMPv6 Neighbor Discovery. */ - MFF_ND_TARGET, /* ipv6 */ - MFF_ND_SLL, /* mac */ - MFF_ND_TLL, /* mac */ +/* ## -------- ## */ +/* ## Ethernet ## */ +/* ## -------- ## */ + + /* "eth_src" (aka "dl_src"). + * + * Source address in Ethernet header. + * + * This field was not maskable before Open vSwitch 1.8. + * + * Type: MAC. + * Maskable: bitwise. + * Formatting: Ethernet. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_OF_ETH_SRC(2) since v1.1. + * OXM: OXM_OF_ETH_SRC(4) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: bitwise mask. + */ + MFF_ETH_SRC, + + /* "eth_dst" (aka "dl_dst"). + * + * Destination address in Ethernet header. + * + * Before Open vSwitch 1.8, the allowed masks were restricted to + * 00:00:00:00:00:00, fe:ff:ff:ff:ff:ff, 01:00:00:00:00:00, + * ff:ff:ff:ff:ff:ff. + * + * Type: MAC. + * Maskable: bitwise. + * Formatting: Ethernet. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_OF_ETH_DST(1) since v1.1. + * OXM: OXM_OF_ETH_DST(3) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: bitwise mask. + */ + MFF_ETH_DST, + + /* "eth_type" (aka "dl_type"). + * + * Packet's Ethernet type. + * + * For an Ethernet II packet this is taken from the Ethernet header. For + * an 802.2 LLC+SNAP header with OUI 00-00-00 this is taken from the SNAP + * header. A packet that has neither format has value 0x05ff + * (OFP_DL_TYPE_NOT_ETH_TYPE). + * + * For a packet with an 802.1Q header, this is the type of the encapsulated + * frame. + * + * Type: be16. + * Maskable: no. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read-only. + * NXM: NXM_OF_ETH_TYPE(3) since v1.1. + * OXM: OXM_OF_ETH_TYPE(5) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_ETH_TYPE, + +/* ## ---- ## */ +/* ## VLAN ## */ +/* ## ---- ## */ + +/* It looks odd for vlan_tci, vlan_vid, and vlan_pcp to say that they are + * supported in OF1.0 and OF1.1, since the detailed semantics of these fields + * only apply to NXM or OXM. They are marked as supported for exact matches in + * OF1.0 and OF1.1 because exact matches on those fields can be successfully + * translated into the OF1.0 and OF1.1 flow formats. */ + + /* "vlan_tci". + * + * 802.1Q TCI. + * + * For a packet with an 802.1Q header, this is the Tag Control Information + * (TCI) field, with the CFI bit forced to 1. For a packet with no 802.1Q + * header, this has value 0. + * + * This field can be used in various ways: + * + * - If it is not constrained at all, the nx_match matches packets + * without an 802.1Q header or with an 802.1Q header that has any TCI + * value. + * + * - Testing for an exact match with 0 matches only packets without an + * 802.1Q header. + * + * - Testing for an exact match with a TCI value with CFI=1 matches + * packets that have an 802.1Q header with a specified VID and PCP. + * + * - Testing for an exact match with a nonzero TCI value with CFI=0 does + * not make sense. The switch may reject this combination. + * + * - Testing with a specific VID and CFI=1, with nxm_mask=0x1fff, matches + * packets that have an 802.1Q header with that VID (and any PCP). + * + * - Testing with a specific PCP and CFI=1, with nxm_mask=0xf000, matches + * packets that have an 802.1Q header with that PCP (and any VID). + * + * - Testing with nxm_value=0, nxm_mask=0x0fff matches packets with no + * 802.1Q header or with an 802.1Q header with a VID of 0. + * + * - Testing with nxm_value=0, nxm_mask=0xe000 matches packets with no + * 802.1Q header or with an 802.1Q header with a PCP of 0. + * + * - Testing with nxm_value=0, nxm_mask=0xefff matches packets with no + * 802.1Q header or with an 802.1Q header with both VID and PCP of 0. + * + * Type: be16. + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: none. + * Access: read/write. + * NXM: NXM_OF_VLAN_TCI(4) since v1.1. + * OXM: none. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_VLAN_TCI, + + /* "dl_vlan" (OpenFlow 1.0). + * + * VLAN ID field. Zero if no 802.1Q header is present. + * + * Type: be16 (low 12 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: none. + * Access: read/write. + * NXM: none. + * OXM: none. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_DL_VLAN, + + /* "vlan_vid" (OpenFlow 1.2+). + * + * If an 802.1Q header is present, this field's value is 0x1000 + * bitwise-or'd with the VLAN ID. If no 802.1Q is present, this field's + * value is 0. + * + * Type: be16 (low 12 bits). + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: none. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_VLAN_VID(6) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_VLAN_VID, + + /* "dl_vlan_pcp" (OpenFlow 1.0). + * + * VLAN priority (PCP) field. Zero if no 802.1Q header is present. + * + * Type: u8 (low 3 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: none. + * Access: read/write. + * NXM: none. + * OXM: none. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_DL_VLAN_PCP, + + /* "vlan_pcp" (OpenFlow 1.2+). + * + * VLAN priority (PCP) field. Zero if no 802.1Q header is present. + * + * Type: u8 (low 3 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: VLAN VID. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_VLAN_PCP(7) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_VLAN_PCP, + +/* ## ---- ## */ +/* ## MPLS ## */ +/* ## ---- ## */ + + /* "mpls_label". + * + * The outermost MPLS label, or 0 if no MPLS labels are present. + * + * Type: be32 (low 20 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: MPLS. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_MPLS_LABEL(34) since OF1.2 and v1.11. + * OF1.1: exact match. + */ + MFF_MPLS_LABEL, + + /* "mpls_tc". + * + * The outermost MPLS label's traffic control (TC) field, or 0 if no MPLS + * labels are present. + * + * Type: u8 (low 3 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: MPLS. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_MPLS_TC(35) since OF1.2 and v1.11. + * OF1.1: exact match. + */ + MFF_MPLS_TC, + + /* "mpls_bos". + * + * The outermost MPLS label's bottom of stack (BoS) field, or 0 if no MPLS + * labels are present. + * + * Type: u8 (low 1 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: MPLS. + * Access: read-only. + * NXM: none. + * OXM: OXM_OF_MPLS_BOS(36) since OF1.3 and v1.11. + */ + MFF_MPLS_BOS, + +/* ## ---- ## */ +/* ## IPv4 ## */ +/* ## ---- ## */ + +/* Update mf_is_l3_or_higher() if MFF_IPV4_SRC is no longer the first element + * for a field of layer 3 or higher */ + + /* "ip_src" (aka "nw_src"). + * + * The source address in the IPv4 header. + * + * Before Open vSwitch 1.8, only CIDR masks were supported. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: IPv4. + * Prerequisites: IPv4. + * Access: read/write. + * NXM: NXM_OF_IP_SRC(7) since v1.1. + * OXM: OXM_OF_IPV4_SRC(11) since OF1.2 and v1.7. + * OF1.0: CIDR mask. + * OF1.1: bitwise mask. + * Prefix lookup member: nw_src. + */ + MFF_IPV4_SRC, + + /* "ip_dst" (aka "nw_dst"). + * + * The destination address in the IPv4 header. + * + * Before Open vSwitch 1.8, only CIDR masks were supported. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: IPv4. + * Prerequisites: IPv4. + * Access: read/write. + * NXM: NXM_OF_IP_DST(8) since v1.1. + * OXM: OXM_OF_IPV4_DST(12) since OF1.2 and v1.7. + * OF1.0: CIDR mask. + * OF1.1: bitwise mask. + * Prefix lookup member: nw_dst. + */ + MFF_IPV4_DST, + +/* ## ---- ## */ +/* ## IPv6 ## */ +/* ## ---- ## */ + + /* "ipv6_src". + * + * The source address in the IPv6 header. + * + * Type: IPv6. + * Maskable: bitwise. + * Formatting: IPv6. + * Prerequisites: IPv6. + * Access: read/write. + * NXM: NXM_NX_IPV6_SRC(19) since v1.1. + * OXM: OXM_OF_IPV6_SRC(26) since OF1.2 and v1.1. + * Prefix lookup member: ipv6_src. + */ + MFF_IPV6_SRC, + + /* "ipv6_dst". + * + * The destination address in the IPv6 header. + * + * Type: IPv6. + * Maskable: bitwise. + * Formatting: IPv6. + * Prerequisites: IPv6. + * Access: read/write. + * NXM: NXM_NX_IPV6_DST(20) since v1.1. + * OXM: OXM_OF_IPV6_DST(27) since OF1.2 and v1.1. + * Prefix lookup member: ipv6_dst. + */ + MFF_IPV6_DST, + + /* "ipv6_label". + * + * The flow label in the IPv6 header. + * + * Type: be32 (low 20 bits). + * Maskable: bitwise. + * Formatting: hexadecimal. + * Prerequisites: IPv6. + * Access: read/write. + * NXM: NXM_NX_IPV6_LABEL(27) since v1.4. + * OXM: OXM_OF_IPV6_FLABEL(28) since OF1.2 and v1.7. + */ + MFF_IPV6_LABEL, + +/* ## ----------------------- ## */ +/* ## IPv4/IPv6 common fields ## */ +/* ## ----------------------- ## */ + + /* "nw_proto" (aka "ip_proto"). + * + * The "protocol" byte in the IPv4 or IPv6 header. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: IPv4/IPv6. + * Access: read-only. + * NXM: NXM_OF_IP_PROTO(6) since v1.1. + * OXM: OXM_OF_IP_PROTO(10) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_IP_PROTO, + +/* Both views of the DSCP below are marked as supported in all of the versions + * of OpenFlow because a match on either view can be successfully translated + * into every OpenFlow flow format. */ + + /* "nw_tos" (OpenFlow 1.0/1.1). + * + * The DSCP byte in the IPv4 header or the traffic class byte from the IPv6 + * header, with the ECN bits forced to 0. (That is, bits 2-7 contain the + * type of service and bits 0-1 are zero.) + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: IPv4/IPv6. + * Access: read/write. + * NXM: NXM_OF_IP_TOS(5) since v1.1. + * OXM: none. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_IP_DSCP, + + /* "ip_dscp" (OpenFlow 1.2+). + * + * The DSCP byte in the IPv4 header or the traffic class byte from the IPv6 + * header, shifted right 2 bits. (That is, bits 0-5 contain the type of + * service and bits 6-7 are zero.) + * + * Type: u8 (low 6 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: IPv4/IPv6. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_IP_DSCP(8) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_IP_DSCP_SHIFTED, + + /* "nw_ecn" (aka "ip_ecn"). + * + * The ECN bits in the IPv4 or IPv6 header. + * + * Type: u8 (low 2 bits). + * Maskable: no. + * Formatting: decimal. + * Prerequisites: IPv4/IPv6. + * Access: read/write. + * NXM: NXM_NX_IP_ECN(28) since v1.4. + * OXM: OXM_OF_IP_ECN(9) since OF1.2 and v1.7. + */ + MFF_IP_ECN, + + /* "nw_ttl". + * + * The time-to-live (TTL) in the IPv4 header or hop limit in the IPv6 + * header. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: IPv4/IPv6. + * Access: read/write. + * NXM: NXM_NX_IP_TTL(29) since v1.4. + * OXM: none. + */ + MFF_IP_TTL, + + /* "ip_frag". + * + * IP fragment information. + * + * This field has three possible values: + * + * - A packet that is not an IP fragment has value 0. + * + * - A packet that is an IP fragment with offset 0 (the first fragment) + * has bit 0 set and thus value 1. + * + * - A packet that is an IP fragment with nonzero offset has bits 0 and 1 + * set and thus value 3. + * + * NX_IP_FRAG_ANY and NX_IP_FRAG_LATER are declared to symbolically + * represent the meanings of bits 0 and 1. + * + * The switch may reject matches against values that can never appear. + * + * It is important to understand how this field interacts with the OpenFlow + * IP fragment handling mode: + * + * - In OFPC_FRAG_DROP mode, the OpenFlow switch drops all IP fragments + * before they reach the flow table, so every packet that is available + * for matching will have value 0 in this field. + * + * - Open vSwitch does not implement OFPC_FRAG_REASM mode, but if it did + * then IP fragments would be reassembled before they reached the flow + * table and again every packet available for matching would always + * have value 0. + * + * - In OFPC_FRAG_NORMAL mode, all three values are possible, but + * OpenFlow 1.0 says that fragments' transport ports are always 0, even + * for the first fragment, so this does not provide much extra + * information. + * + * - In OFPC_FRAG_NX_MATCH mode, all three values are possible. For + * fragments with offset 0, Open vSwitch makes L4 header information + * available. + * + * Type: u8 (low 2 bits). + * Maskable: bitwise. + * Formatting: frag. + * Prerequisites: IPv4/IPv6. + * Access: read-only. + * NXM: NXM_NX_IP_FRAG(26) since v1.3. + * OXM: none. + */ + MFF_IP_FRAG, + +/* ## --- ## */ +/* ## ARP ## */ +/* ## --- ## */ + + /* "arp_op". + * + * ARP opcode. + * + * For an Ethernet+IP ARP packet, the opcode in the ARP header. Always 0 + * otherwise. Only ARP opcodes between 1 and 255 should be specified for + * matching. + * + * Type: be16. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: ARP. + * Access: read/write. + * NXM: NXM_OF_ARP_OP(15) since v1.1. + * OXM: OXM_OF_ARP_OP(21) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_ARP_OP, + + /* "arp_spa". + * + * For an Ethernet+IP ARP packet, the source protocol (IPv4) address in the + * ARP header. Always 0 otherwise. + * + * Before Open vSwitch 1.8, only CIDR masks were supported. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: IPv4. + * Prerequisites: ARP. + * Access: read/write. + * NXM: NXM_OF_ARP_SPA(16) since v1.1. + * OXM: OXM_OF_ARP_SPA(22) since OF1.2 and v1.7. + * OF1.0: CIDR mask. + * OF1.1: bitwise mask. + */ + MFF_ARP_SPA, + + /* "arp_tpa". + * + * For an Ethernet+IP ARP packet, the target protocol (IPv4) address in the + * ARP header. Always 0 otherwise. + * + * Before Open vSwitch 1.8, only CIDR masks were supported. + * + * Type: be32. + * Maskable: bitwise. + * Formatting: IPv4. + * Prerequisites: ARP. + * Access: read/write. + * NXM: NXM_OF_ARP_TPA(17) since v1.1. + * OXM: OXM_OF_ARP_TPA(23) since OF1.2 and v1.7. + * OF1.0: CIDR mask. + * OF1.1: bitwise mask. + */ + MFF_ARP_TPA, + + /* "arp_sha". + * + * For an Ethernet+IP ARP packet, the source hardware (Ethernet) address in + * the ARP header. Always 0 otherwise. + * + * Type: MAC. + * Maskable: bitwise. + * Formatting: Ethernet. + * Prerequisites: ARP. + * Access: read/write. + * NXM: NXM_NX_ARP_SHA(17) since v1.1. + * OXM: OXM_OF_ARP_SHA(24) since OF1.2 and v1.7. + */ + MFF_ARP_SHA, + + /* "arp_tha". + * + * For an Ethernet+IP ARP packet, the target hardware (Ethernet) address in + * the ARP header. Always 0 otherwise. + * + * Type: MAC. + * Maskable: bitwise. + * Formatting: Ethernet. + * Prerequisites: ARP. + * Access: read/write. + * NXM: NXM_NX_ARP_THA(18) since v1.1. + * OXM: OXM_OF_ARP_THA(25) since OF1.2 and v1.7. + */ + MFF_ARP_THA, + +/* ## --- ## */ +/* ## TCP ## */ +/* ## --- ## */ + + /* "tcp_src" (aka "tp_src"). + * + * TCP source port. + * + * Type: be16. + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: TCP. + * Access: read/write. + * NXM: NXM_OF_TCP_SRC(9) since v1.1. + * OXM: OXM_OF_TCP_SRC(13) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_TCP_SRC, + + /* "tcp_dst" (aka "tp_dst"). + * + * TCP destination port. + * + * Type: be16. + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: TCP. + * Access: read/write. + * NXM: NXM_OF_TCP_DST(10) since v1.1. + * OXM: OXM_OF_TCP_DST(14) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_TCP_DST, + + /* "tcp_flags". + * + * Flags in the TCP header. + * + * TCP currently defines 9 flag bits, and additional 3 bits are reserved + * (must be transmitted as zero). See RFCs 793, 3168, and 3540. + * + * Type: be16 (low 12 bits). + * Maskable: bitwise. + * Formatting: TCP flags. + * Prerequisites: TCP. + * Access: read-only. + * NXM: NXM_NX_TCP_FLAGS(34) since v2.1. + * OXM: ONFOXM_ET_TCP_FLAGS(42) since OF1.3 and v2.4, + * OXM_OF_TCP_FLAGS(42) since OF1.5 and v2.3. + */ + MFF_TCP_FLAGS, + +/* ## --- ## */ +/* ## UDP ## */ +/* ## --- ## */ + + /* "udp_src". + * + * UDP source port. + * + * Type: be16. + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: UDP. + * Access: read/write. + * NXM: NXM_OF_UDP_SRC(11) since v1.1. + * OXM: OXM_OF_UDP_SRC(15) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_UDP_SRC, + + /* "udp_dst". + * + * UDP destination port + * + * Type: be16. + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: UDP. + * Access: read/write. + * NXM: NXM_OF_UDP_DST(12) since v1.1. + * OXM: OXM_OF_UDP_DST(16) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_UDP_DST, + +/* ## ---- ## */ +/* ## SCTP ## */ +/* ## ---- ## */ + + /* "sctp_src". + * + * SCTP source port. + * + * Type: be16. + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: SCTP. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_SCTP_SRC(17) since OF1.2 and v2.0. + * OF1.1: exact match. + */ + MFF_SCTP_SRC, + + /* "sctp_dst". + * + * SCTP destination port. + * + * Type: be16. + * Maskable: bitwise. + * Formatting: decimal. + * Prerequisites: SCTP. + * Access: read/write. + * NXM: none. + * OXM: OXM_OF_SCTP_DST(18) since OF1.2 and v2.0. + * OF1.1: exact match. + */ + MFF_SCTP_DST, + +/* ## ---- ## */ +/* ## ICMP ## */ +/* ## ---- ## */ + + /* "icmp_type". + * + * ICMPv4 type. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: ICMPv4. + * Access: read-only. + * NXM: NXM_OF_ICMP_TYPE(13) since v1.1. + * OXM: OXM_OF_ICMPV4_TYPE(19) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_ICMPV4_TYPE, + + /* "icmp_code". + * + * ICMPv4 code. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: ICMPv4. + * Access: read-only. + * NXM: NXM_OF_ICMP_CODE(14) since v1.1. + * OXM: OXM_OF_ICMPV4_CODE(20) since OF1.2 and v1.7. + * OF1.0: exact match. + * OF1.1: exact match. + */ + MFF_ICMPV4_CODE, + + /* "icmpv6_type". + * + * ICMPv6 type. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: ICMPv6. + * Access: read-only. + * NXM: NXM_NX_ICMPV6_TYPE(21) since v1.1. + * OXM: OXM_OF_ICMPV6_TYPE(29) since OF1.2 and v1.7. + */ + MFF_ICMPV6_TYPE, + + /* "icmpv6_code". + * + * ICMPv6 code. + * + * Type: u8. + * Maskable: no. + * Formatting: decimal. + * Prerequisites: ICMPv6. + * Access: read-only. + * NXM: NXM_NX_ICMPV6_CODE(22) since v1.1. + * OXM: OXM_OF_ICMPV6_CODE(30) since OF1.2 and v1.7. + */ + MFF_ICMPV6_CODE, + +/* ## ------------------------- ## */ +/* ## ICMPv6 Neighbor Discovery ## */ +/* ## ------------------------- ## */ + + /* "nd_target". + * + * The target address in an IPv6 Neighbor Discovery message. + * + * Before Open vSwitch 1.8, only CIDR masks were supported. + * + * Type: IPv6. + * Maskable: bitwise. + * Formatting: IPv6. + * Prerequisites: ND. + * Access: read/write. + * NXM: NXM_NX_ND_TARGET(23) since v1.1. + * OXM: OXM_OF_IPV6_ND_TARGET(31) since OF1.2 and v1.7. + */ + MFF_ND_TARGET, + + /* "nd_sll". + * + * The source link layer address in an IPv6 Neighbor Discovery message. + * + * Type: MAC. + * Maskable: bitwise. + * Formatting: Ethernet. + * Prerequisites: ND solicit. + * Access: read/write. + * NXM: NXM_NX_ND_SLL(24) since v1.1. + * OXM: OXM_OF_IPV6_ND_SLL(32) since OF1.2 and v1.7. + */ + MFF_ND_SLL, + + /* "nd_tll". + * + * The target link layer address in an IPv6 Neighbor Discovery message. + * + * Type: MAC. + * Maskable: bitwise. + * Formatting: Ethernet. + * Prerequisites: ND advert. + * Access: read/write. + * NXM: NXM_NX_ND_TLL(25) since v1.1. + * OXM: OXM_OF_IPV6_ND_TLL(33) since OF1.2 and v1.7. + */ + MFF_ND_TLL, MFF_N_IDS }; +/* A set of mf_field_ids. */ +struct mf_bitmap { + unsigned long bm[BITMAP_N_LONGS(MFF_N_IDS)]; +}; +#define MF_BITMAP_INITIALIZER { { [0] = 0 } } + /* Use this macro as CASE_MFF_REGS: in a switch statement to choose all of the - * MFF_REGx cases. */ -#if FLOW_N_REGS == 1 -# define CASE_MFF_REGS \ - case MFF_REG0 -#elif FLOW_N_REGS == 2 -# define CASE_MFF_REGS \ - case MFF_REG0: case MFF_REG1 -#elif FLOW_N_REGS == 3 -# define CASE_MFF_REGS \ - case MFF_REG0: case MFF_REG1: case MFF_REG2 -#elif FLOW_N_REGS == 4 -# define CASE_MFF_REGS \ - case MFF_REG0: case MFF_REG1: case MFF_REG2: case MFF_REG3 -#elif FLOW_N_REGS == 5 -# define CASE_MFF_REGS \ - case MFF_REG0: case MFF_REG1: case MFF_REG2: case MFF_REG3: \ - case MFF_REG4 -#elif FLOW_N_REGS == 6 -# define CASE_MFF_REGS \ - case MFF_REG0: case MFF_REG1: case MFF_REG2: case MFF_REG3: \ - case MFF_REG4: case MFF_REG5 -#elif FLOW_N_REGS == 7 -# define CASE_MFF_REGS \ - case MFF_REG0: case MFF_REG1: case MFF_REG2: case MFF_REG3: \ - case MFF_REG4: case MFF_REG5: case MFF_REG6 -#elif FLOW_N_REGS == 8 -# define CASE_MFF_REGS \ + * MFF_REGn cases. */ +#if FLOW_N_REGS == 8 +#define CASE_MFF_REGS \ case MFF_REG0: case MFF_REG1: case MFF_REG2: case MFF_REG3: \ case MFF_REG4: case MFF_REG5: case MFF_REG6: case MFF_REG7 #else -# error +#error "Need to update CASE_MFF_REGS to match FLOW_N_REGS" +#endif + +/* Use this macro as CASE_MFF_XREGS: in a switch statement to choose all of the + * MFF_REGn cases. */ +#if FLOW_N_XREGS == 4 +#define CASE_MFF_XREGS \ + case MFF_XREG0: case MFF_XREG1: case MFF_XREG2: case MFF_XREG3 +#else +#error "Need to update CASE_MFF_XREGS to match FLOW_N_XREGS" #endif /* Prerequisites for matching a field. @@ -232,8 +1485,8 @@ MFS_ETHERNET, MFS_IPV4, MFS_IPV6, - MFS_OFP_PORT, /* An OpenFlow port number or name. */ - MFS_OFP_PORT_OXM, /* An OpenFlow port number or name (32-bit). */ + MFS_OFP_PORT, /* 16-bit OpenFlow 1.0 port number or name. */ + MFS_OFP_PORT_OXM, /* 32-bit OpenFlow 1.1+ port number or name. */ MFS_FRAG, /* no, yes, first, later, not_later */ MFS_TNL_FLAGS, /* FLOW_TNL_F_* flags */ MFS_TCP_FLAGS, /* TCP_* flags */ @@ -266,49 +1519,21 @@ enum mf_prereqs prereqs; bool writable; /* May be written by actions? */ - /* NXM and OXM properties. - * - * There are the following possibilities for these members for a given - * mf_field: - * - * - Neither NXM nor OXM defines such a field: these members will all be - * zero or NULL. - * - * - NXM and OXM both define such a field: nxm_header and oxm_header will - * both be nonzero and different, similarly for nxm_name and oxm_name. - * In this case, 'oxm_version' is significant: if it is greater than - * OFP12_VERSION, then only that version of OpenFlow introduced this - * OXM header, so ovs-vswitchd should send 'nxm_header' instead with - * earlier protocol versions to avoid confusing controllers that were - * using a previous Open vSwitch extension. - * - * - Only NXM or only OXM defines such a field: nxm_header and oxm_header - * will both have the same value (either an OXM_* or NXM_* value) and - * similarly for nxm_name and oxm_name. - * - * Thus, 'nxm_header' is the appropriate header to use when outputting an - * NXM formatted match, since it will be an NXM_* constant when possible - * for compatibility with OpenFlow implementations that expect that, with - * OXM_* constants used for fields that OXM adds. Conversely, 'oxm_header' - * is the header to use when outputting an OXM formatted match to an - * OpenFlow connection of version 'oxm_version' or above (and otherwise - * 'nxm_header'). */ - uint32_t nxm_header; /* An NXM_* (or OXM_*) constant. */ - const char *nxm_name; /* The nxm_header constant's name. */ - uint32_t oxm_header; /* An OXM_* (or NXM_*) constant. */ - const char *oxm_name; /* The oxm_header constant's name */ - enum ofp_version oxm_version; /* OpenFlow version that added oxm_header. */ - /* Usable protocols. + * * NXM and OXM are extensible, allowing later extensions to be sent in * earlier protocol versions, so this does not necessarily correspond to * the OpenFlow protocol version the field was introduced in. * Also, some field types are tranparently mapped to each other via the * struct flow (like vlan and dscp/tos fields), so each variant supports - * all protocols. */ - enum ofputil_protocol usable_protocols; /* If fully/cidr masked. */ - /* If partially/non-cidr masked. */ - enum ofputil_protocol usable_protocols_bitwise; + * all protocols. + * + * These are combinations of OFPUTIL_P_*. (They are not declared as type + * enum ofputil_protocol because that would give meta-flow.h and ofp-util.h + * a circular dependency.) */ + uint32_t usable_protocols_exact; /* Matching or setting whole field. */ + uint32_t usable_protocols_cidr; /* Matching a CIDR mask in field. */ + uint32_t usable_protocols_bitwise; /* Matching arbitrary bits in field. */ int flow_be32ofs; /* Field's be32 offset in "struct flow", if prefix tree * lookup is supported for the field, or -1. */ @@ -325,7 +1550,9 @@ }; BUILD_ASSERT_DECL(sizeof(union mf_value) == 16); +/* An all-1-bits mf_value. Needs to be updated if struct mf_value grows.*/ #define MF_EXACT_MASK_INITIALIZER { IN6ADDR_EXACT_INIT } +BUILD_ASSERT_DECL(sizeof(union mf_value) == sizeof(struct in6_addr)); /* Part of a field. */ struct mf_subfield { @@ -347,10 +1574,14 @@ }; BUILD_ASSERT_DECL(sizeof(union mf_value) == sizeof (union mf_subvalue)); +/* An array of fields with values */ +struct field_array { + struct mf_bitmap used; + union mf_value value[MFF_N_IDS]; +}; + /* Finding mf_fields. */ const struct mf_field *mf_from_name(const char *name); -const struct mf_field *mf_from_nxm_header(uint32_t nxm_header); -const struct mf_field *mf_from_nxm_name(const char *nxm_name); static inline const struct mf_field * mf_from_id(enum mf_field_id id) @@ -360,9 +1591,6 @@ return &mf_fields[id]; } -/* NXM and OXM protocol headers. */ -uint32_t mf_oxm_header(enum mf_field_id, enum ofp_version oxm_version); - /* Inspecting wildcarded bits. */ bool mf_is_all_wild(const struct mf_field *, const struct flow_wildcards *); @@ -373,6 +1601,8 @@ /* Prerequisites. */ bool mf_are_prereqs_ok(const struct mf_field *, const struct flow *); void mf_mask_field_and_prereqs(const struct mf_field *, struct flow *mask); +void mf_bitmap_set_field_and_prereqs(const struct mf_field *mf, struct + mf_bitmap *bm); static inline bool mf_is_l3_or_higher(const struct mf_field *mf) @@ -389,6 +1619,10 @@ struct match *); void mf_set_flow_value(const struct mf_field *, const union mf_value *value, struct flow *); +void mf_set_flow_value_masked(const struct mf_field *, + const union mf_value *value, + const union mf_value *mask, + struct flow *); bool mf_is_zero(const struct mf_field *, const struct flow *); void mf_mask_field(const struct mf_field *, struct flow *); @@ -414,12 +1648,6 @@ uint64_t mf_get_subfield(const struct mf_subfield *, const struct flow *); -void mf_format_subfield(const struct mf_subfield *, struct ds *); -char *mf_parse_subfield__(struct mf_subfield *sf, const char **s) - WARN_UNUSED_RESULT; -char *mf_parse_subfield(struct mf_subfield *, const char *s) - WARN_UNUSED_RESULT; - enum ofperr mf_check_src(const struct mf_subfield *, const struct flow *); enum ofperr mf_check_dst(const struct mf_subfield *, const struct flow *); @@ -432,4 +1660,8 @@ struct ds *); void mf_format_subvalue(const union mf_subvalue *subvalue, struct ds *s); +/* Field Arrays. */ +void field_array_set(enum mf_field_id id, const union mf_value *, + struct field_array *); + #endif /* meta-flow.h */ diff -Nru openvswitch-2.3.1/lib/multipath.c openvswitch-2.4.0~git20150623/lib/multipath.c --- openvswitch-2.3.1/lib/multipath.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/multipath.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,49 +28,7 @@ #include "ofp-util.h" #include "openflow/nicira-ext.h" #include "packets.h" -#include "vlog.h" - -VLOG_DEFINE_THIS_MODULE(multipath); - -static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); -/* Converts 'nam' into 'mp'. Returns 0 if successful, otherwise an - * OFPERR_*. */ -enum ofperr -multipath_from_openflow(const struct nx_action_multipath *nam, - struct ofpact_multipath *mp) -{ - uint32_t n_links = ntohs(nam->max_link) + 1; - size_t min_n_bits = log_2_ceil(n_links); - - ofpact_init_MULTIPATH(mp); - mp->fields = ntohs(nam->fields); - mp->basis = ntohs(nam->basis); - mp->algorithm = ntohs(nam->algorithm); - mp->max_link = ntohs(nam->max_link); - mp->arg = ntohl(nam->arg); - mp->dst.field = mf_from_nxm_header(ntohl(nam->dst)); - mp->dst.ofs = nxm_decode_ofs(nam->ofs_nbits); - mp->dst.n_bits = nxm_decode_n_bits(nam->ofs_nbits); - - if (!flow_hash_fields_valid(mp->fields)) { - VLOG_WARN_RL(&rl, "unsupported fields %d", (int) mp->fields); - return OFPERR_OFPBAC_BAD_ARGUMENT; - } else if (mp->algorithm != NX_MP_ALG_MODULO_N - && mp->algorithm != NX_MP_ALG_HASH_THRESHOLD - && mp->algorithm != NX_MP_ALG_HRW - && mp->algorithm != NX_MP_ALG_ITER_HASH) { - VLOG_WARN_RL(&rl, "unsupported algorithm %d", (int) mp->algorithm); - return OFPERR_OFPBAC_BAD_ARGUMENT; - } else if (mp->dst.n_bits < min_n_bits) { - VLOG_WARN_RL(&rl, "multipath action requires at least %"PRIuSIZE" bits for " - "%"PRIu32" links", min_n_bits, n_links); - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - - return multipath_check(mp, NULL); -} - /* Checks that 'mp' is valid on flow. Returns 0 if it is valid, otherwise an * OFPERR_*. */ enum ofperr @@ -79,22 +37,6 @@ { return mf_check_dst(&mp->dst, flow); } - -/* Converts 'mp' into an OpenFlow NXAST_MULTIPATH action, which it appends to - * 'openflow'. */ -void -multipath_to_nxast(const struct ofpact_multipath *mp, struct ofpbuf *openflow) -{ - struct nx_action_multipath *nam = ofputil_put_NXAST_MULTIPATH(openflow); - - nam->fields = htons(mp->fields); - nam->basis = htons(mp->basis); - nam->algorithm = htons(mp->algorithm); - nam->max_link = htons(mp->max_link); - nam->arg = htonl(mp->arg); - nam->ofs_nbits = nxm_encode_ofs_nbits(mp->dst.ofs, mp->dst.n_bits); - nam->dst = htonl(mp->dst.field->nxm_header); -} /* multipath_execute(). */ @@ -197,7 +139,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string.*/ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s) { char *save_ptr = NULL; @@ -247,6 +189,10 @@ if (error) { return error; } + if (!mf_nxm_header(mp->dst.field->id)) { + return xasprintf("%s: experimenter OXM field '%s' not supported", + s, dst); + } if (mp->dst.n_bits < 16 && n_links > (1u << mp->dst.n_bits)) { return xasprintf("%s: %d-bit destination field has %u possible " "values, less than specified n_links %d", @@ -261,7 +207,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT multipath_parse(struct ofpact_multipath *mp, const char *s_) { char *s = xstrdup(s_); diff -Nru openvswitch-2.3.1/lib/multipath.h openvswitch-2.4.0~git20150623/lib/multipath.h --- openvswitch-2.3.1/lib/multipath.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/multipath.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,23 +28,16 @@ struct ofpact_multipath; struct ofpbuf; -/* NXAST_MULTIPATH helper functions. - * - * See include/openflow/nicira-ext.h for NXAST_MULTIPATH specification. - */ +/* NXAST_MULTIPATH helper functions. */ -enum ofperr multipath_from_openflow(const struct nx_action_multipath *, - struct ofpact_multipath *); enum ofperr multipath_check(const struct ofpact_multipath *, const struct flow *); -void multipath_to_nxast(const struct ofpact_multipath *, - struct ofpbuf *openflow); void multipath_execute(const struct ofpact_multipath *, struct flow *, struct flow_wildcards *); char *multipath_parse(struct ofpact_multipath *, const char *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void multipath_format(const struct ofpact_multipath *, struct ds *); #endif /* multipath.h */ diff -Nru openvswitch-2.3.1/lib/netdev-bsd.c openvswitch-2.4.0~git20150623/lib/netdev-bsd.c --- openvswitch-2.3.1/lib/netdev-bsd.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-bsd.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -42,16 +43,15 @@ #include #if defined(__NetBSD__) #include -#include #include #endif #include "rtbsd.h" #include "coverage.h" +#include "dp-packet.h" #include "dpif-netdev.h" #include "dynamic-string.h" #include "fatal-signal.h" -#include "ofpbuf.h" #include "openflow/openflow.h" #include "ovs-thread.h" #include "packets.h" @@ -60,7 +60,7 @@ #include "socket-util.h" #include "svec.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(netdev_bsd); @@ -247,7 +247,7 @@ if (!cache_notifier_refcount) { ret = rtbsd_notifier_register(&netdev_bsd_cache_notifier, - netdev_bsd_cache_cb, NULL); + netdev_bsd_cache_cb, NULL); if (ret) { return ret; } @@ -360,7 +360,7 @@ /* Turn device UP */ ifr_set_flags(&ifr, IFF_UP); - strncpy(ifr.ifr_name, kernel_name, sizeof ifr.ifr_name); + ovs_strlcpy(ifr.ifr_name, kernel_name, sizeof ifr.ifr_name); error = af_inet_ioctl(SIOCSIFFLAGS, &ifr); if (error) { destroy_tap(netdev->tap_fd, kernel_name); @@ -568,20 +568,20 @@ * from rxq->pcap. */ static int -netdev_rxq_bsd_recv_pcap(struct netdev_rxq_bsd *rxq, struct ofpbuf *buffer) +netdev_rxq_bsd_recv_pcap(struct netdev_rxq_bsd *rxq, struct dp_packet *buffer) { struct pcap_arg arg; int ret; /* prepare the pcap argument to store the packet */ - arg.size = ofpbuf_tailroom(buffer); - arg.data = ofpbuf_data(buffer); + arg.size = dp_packet_tailroom(buffer); + arg.data = dp_packet_data(buffer); for (;;) { ret = pcap_dispatch(rxq->pcap_handle, 1, proc_pkt, (u_char *) &arg); if (ret > 0) { - ofpbuf_set_size(buffer, ofpbuf_size(buffer) + arg.retval); + dp_packet_set_size(buffer, dp_packet_size(buffer) + arg.retval); return 0; } if (ret == -1) { @@ -600,14 +600,14 @@ * 'rxq->fd' is initialized with the tap file descriptor. */ static int -netdev_rxq_bsd_recv_tap(struct netdev_rxq_bsd *rxq, struct ofpbuf *buffer) +netdev_rxq_bsd_recv_tap(struct netdev_rxq_bsd *rxq, struct dp_packet *buffer) { - size_t size = ofpbuf_tailroom(buffer); + size_t size = dp_packet_tailroom(buffer); for (;;) { - ssize_t retval = read(rxq->fd, ofpbuf_data(buffer), size); + ssize_t retval = read(rxq->fd, dp_packet_data(buffer), size); if (retval >= 0) { - ofpbuf_set_size(buffer, ofpbuf_size(buffer) + retval); + dp_packet_set_size(buffer, dp_packet_size(buffer) + retval); return 0; } else if (errno != EINTR) { if (errno != EAGAIN) { @@ -620,11 +620,12 @@ } static int -netdev_bsd_rxq_recv(struct netdev_rxq *rxq_, struct ofpbuf **packet, int *c) +netdev_bsd_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets, + int *c) { struct netdev_rxq_bsd *rxq = netdev_rxq_bsd_cast(rxq_); struct netdev *netdev = rxq->up.netdev; - struct ofpbuf *buffer; + struct dp_packet *packet; ssize_t retval; int mtu; @@ -632,17 +633,18 @@ mtu = ETH_PAYLOAD_MAX; } - buffer = ofpbuf_new_with_headroom(VLAN_ETH_HEADER_LEN + mtu, DP_NETDEV_HEADROOM); - + packet = dp_packet_new_with_headroom(VLAN_ETH_HEADER_LEN + mtu, + DP_NETDEV_HEADROOM); retval = (rxq->pcap_handle - ? netdev_rxq_bsd_recv_pcap(rxq, buffer) - : netdev_rxq_bsd_recv_tap(rxq, buffer)); + ? netdev_rxq_bsd_recv_pcap(rxq, packet) + : netdev_rxq_bsd_recv_tap(rxq, packet)); if (retval) { - ofpbuf_delete(buffer); + dp_packet_delete(packet); } else { - dp_packet_pad(buffer); - packet[0] = buffer; + dp_packet_pad(packet); + dp_packet_set_rss_hash(packet, 0); + packets[0] = packet; *c = 1; } return retval; @@ -681,13 +683,13 @@ * system or a tap device. */ static int -netdev_bsd_send(struct netdev *netdev_, struct ofpbuf *pkt, bool may_steal) +netdev_bsd_send(struct netdev *netdev_, int qid OVS_UNUSED, + struct dp_packet **pkts, int cnt, bool may_steal) { struct netdev_bsd *dev = netdev_bsd_cast(netdev_); const char *name = netdev_get_name(netdev_); - const void *data = ofpbuf_data(pkt); - size_t size = ofpbuf_size(pkt); int error; + int i; ovs_mutex_lock(&dev->mutex); if (dev->tap_fd < 0 && !dev->pcap) { @@ -696,35 +698,43 @@ error = 0; } - while (!error) { - ssize_t retval; - if (dev->tap_fd >= 0) { - retval = write(dev->tap_fd, data, size); - } else { - retval = pcap_inject(dev->pcap, data, size); - } - if (retval < 0) { - if (errno == EINTR) { - continue; + for (i = 0; i < cnt; i++) { + const void *data = dp_packet_data(pkts[i]); + size_t size = dp_packet_size(pkts[i]); + + while (!error) { + ssize_t retval; + if (dev->tap_fd >= 0) { + retval = write(dev->tap_fd, data, size); } else { - error = errno; - if (error != EAGAIN) { - VLOG_WARN_RL(&rl, "error sending Ethernet packet on %s: " - "%s", name, ovs_strerror(error)); + retval = pcap_inject(dev->pcap, data, size); + } + if (retval < 0) { + if (errno == EINTR) { + continue; + } else { + error = errno; + if (error != EAGAIN) { + VLOG_WARN_RL(&rl, "error sending Ethernet packet on" + " %s: %s", name, ovs_strerror(error)); + } } + } else if (retval != size) { + VLOG_WARN_RL(&rl, "sent partial Ethernet packet " + "(%"PRIuSIZE" bytes of " + "%"PRIuSIZE") on %s", retval, size, name); + error = EMSGSIZE; + } else { + break; } - } else if (retval != size) { - VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%"PRIuSIZE" bytes of " - "%"PRIuSIZE") on %s", retval, size, name); - error = EMSGSIZE; - } else { - break; } } ovs_mutex_unlock(&dev->mutex); if (may_steal) { - ofpbuf_delete(pkt); + for (i = 0; i < cnt; i++) { + dp_packet_delete(pkts[i]); + } } return error; @@ -736,7 +746,7 @@ * with netdev_send(). */ static void -netdev_bsd_send_wait(struct netdev *netdev_) +netdev_bsd_send_wait(struct netdev *netdev_, int qid OVS_UNUSED) { struct netdev_bsd *dev = netdev_bsd_cast(netdev_); @@ -834,7 +844,7 @@ } ovs_mutex_unlock(&netdev->mutex); - return 0; + return error; } static int @@ -861,8 +871,8 @@ struct ifmediareq ifmr; memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, netdev_get_kernel_name(netdev_), - sizeof ifmr.ifm_name); + ovs_strlcpy(ifmr.ifm_name, netdev_get_kernel_name(netdev_), + sizeof ifmr.ifm_name); error = af_inet_ioctl(SIOCGIFMEDIA, &ifmr); if (!error) { @@ -1007,8 +1017,8 @@ int error; memset(&ifdr, 0, sizeof(ifdr)); - strncpy(ifdr.ifdr_name, netdev_get_kernel_name(netdev_), - sizeof(ifdr.ifdr_name)); + ovs_strlcpy(ifdr.ifdr_name, netdev_get_kernel_name(netdev_), + sizeof(ifdr.ifdr_name)); error = af_link_ioctl(SIOCGIFDATA, &ifdr); if (!error) { convert_stats(netdev_, stats, &ifdr.ifdr_data); @@ -1112,7 +1122,7 @@ /* XXX Look into SIOCGIFCAP instead of SIOCGIFMEDIA */ memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, netdev_get_name(netdev), sizeof ifmr.ifm_name); + ovs_strlcpy(ifmr.ifm_name, netdev_get_name(netdev), sizeof ifmr.ifm_name); /* We make two SIOCGIFMEDIA ioctl calls. The first to determine the * number of supported modes, and a second with a buffer to retrieve @@ -1548,6 +1558,11 @@ NULL, /* get_config */ \ NULL, /* set_config */ \ NULL, /* get_tunnel_config */ \ + NULL, /* build header */ \ + NULL, /* push header */ \ + NULL, /* pop header */ \ + NULL, /* get_numa_id */ \ + NULL, /* set_multiq */ \ \ netdev_bsd_send, \ netdev_bsd_send_wait, \ @@ -1561,7 +1576,6 @@ NULL, /* get_carrier_resets */ \ NULL, /* set_miimon_interval */ \ netdev_bsd_get_stats, \ - NULL, /* set_stats */ \ \ GET_FEATURES, \ NULL, /* set_advertisement */ \ @@ -1704,7 +1718,7 @@ int error; memset(&ifr, 0, sizeof ifr); - strncpy(ifr.ifr_name, netdev_name, sizeof ifr.ifr_name); + ovs_strlcpy(ifr.ifr_name, netdev_name, sizeof ifr.ifr_name); ifr.ifr_addr.sa_family = hwaddr_family; ifr.ifr_addr.sa_len = hwaddr_len; memcpy(ifr.ifr_addr.sa_data, mac, hwaddr_len); @@ -1730,7 +1744,7 @@ return EOPNOTSUPP; } memset(&req, 0, sizeof(req)); - strncpy(req.iflr_name, netdev_name, sizeof(req.iflr_name)); + ovs_strlcpy(req.iflr_name, netdev_name, sizeof(req.iflr_name)); req.addr.ss_len = sizeof(req.addr); req.addr.ss_family = hwaddr_family; sdl = (struct sockaddr_dl *)&req.addr; @@ -1746,7 +1760,7 @@ oldaddr = req.addr; memset(&req, 0, sizeof(req)); - strncpy(req.iflr_name, netdev_name, sizeof(req.iflr_name)); + ovs_strlcpy(req.iflr_name, netdev_name, sizeof(req.iflr_name)); req.flags = IFLR_ACTIVE; sdl = (struct sockaddr_dl *)&req.addr; sdl->sdl_len = offsetof(struct sockaddr_dl, sdl_data) + hwaddr_len; @@ -1759,7 +1773,7 @@ } memset(&req, 0, sizeof(req)); - strncpy(req.iflr_name, netdev_name, sizeof(req.iflr_name)); + ovs_strlcpy(req.iflr_name, netdev_name, sizeof(req.iflr_name)); req.addr = oldaddr; return af_link_ioctl(SIOCDLIFADDR, &req); #else @@ -1771,7 +1785,7 @@ ifr_get_flags(const struct ifreq *ifr) { #ifdef HAVE_STRUCT_IFREQ_IFR_FLAGSHIGH - return (ifr->ifr_flagshigh << 16) | ifr->ifr_flags; + return (ifr->ifr_flagshigh << 16) | (ifr->ifr_flags & 0xffff); #else return ifr->ifr_flags; #endif @@ -1780,9 +1794,11 @@ static void ifr_set_flags(struct ifreq *ifr, int flags) { - ifr->ifr_flags = flags; #ifdef HAVE_STRUCT_IFREQ_IFR_FLAGSHIGH + ifr->ifr_flags = flags & 0xffff; ifr->ifr_flagshigh = flags >> 16; +#else + ifr->ifr_flags = flags; #endif } diff -Nru openvswitch-2.3.1/lib/netdev.c openvswitch-2.4.0~git20150623/lib/netdev.c --- openvswitch-2.3.1/lib/netdev.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,6 +26,7 @@ #include "coverage.h" #include "dpif.h" +#include "dp-packet.h" #include "dynamic-string.h" #include "fatal-signal.h" #include "hash.h" @@ -33,15 +34,17 @@ #include "netdev-dpdk.h" #include "netdev-provider.h" #include "netdev-vport.h" -#include "ofpbuf.h" +#include "odp-netlink.h" #include "openflow/openflow.h" #include "packets.h" #include "poll-loop.h" +#include "seq.h" #include "shash.h" #include "smap.h" #include "sset.h" #include "svec.h" -#include "vlog.h" +#include "openvswitch/vlog.h" +#include "flow.h" VLOG_DEFINE_THIS_MODULE(netdev); @@ -52,7 +55,7 @@ struct netdev_saved_flags { struct netdev *netdev; - struct list node; /* In struct netdev's saved_flags_list. */ + struct ovs_list node; /* In struct netdev's saved_flags_list. */ enum netdev_flags saved_flags; enum netdev_flags saved_values; }; @@ -77,9 +80,11 @@ = HMAP_INITIALIZER(&netdev_classes); struct netdev_registered_class { - struct hmap_node hmap_node; /* In 'netdev_classes', by class->type. */ - const struct netdev_class *class; - atomic_int ref_cnt; /* Number of 'struct netdev's of this class. */ + /* In 'netdev_classes', by class->type. */ + struct hmap_node hmap_node OVS_GUARDED_BY(netdev_class_mutex); + const struct netdev_class *class OVS_GUARDED_BY(netdev_class_mutex); + /* Number of 'struct netdev's of this class. */ + int ref_cnt OVS_GUARDED_BY(netdev_class_mutex); }; /* This is set pretty low because we probably won't learn anything from the @@ -90,6 +95,12 @@ void update_device_args(struct netdev *, const struct shash *args); int +netdev_n_txq(const struct netdev *netdev) +{ + return netdev->n_txq; +} + +int netdev_n_rxq(const struct netdev *netdev) { return netdev->n_rxq; @@ -98,7 +109,10 @@ bool netdev_is_pmd(const struct netdev *netdev) { - return !strcmp(netdev->netdev_class->type, "dpdk"); + return (!strcmp(netdev->netdev_class->type, "dpdk") || + !strcmp(netdev->netdev_class->type, "dpdkr") || + !strcmp(netdev->netdev_class->type, "dpdkvhostcuse") || + !strcmp(netdev->netdev_class->type, "dpdkvhostuser")); } static void @@ -135,6 +149,11 @@ netdev_register_provider(&netdev_tap_class); netdev_register_provider(&netdev_bsd_class); #endif +#ifdef _WIN32 + netdev_register_provider(&netdev_windows_class); + netdev_register_provider(&netdev_internal_class); + netdev_vport_tunnel_register(); +#endif netdev_dpdk_register(); ovsthread_once_done(&once); @@ -218,7 +237,7 @@ hmap_insert(&netdev_classes, &rc->hmap_node, hash_string(new_class->type, 0)); rc->class = new_class; - atomic_init(&rc->ref_cnt, 0); + rc->ref_cnt = 0; } else { VLOG_ERR("failed to initialize %s network device class: %s", new_class->type, ovs_strerror(error)); @@ -246,10 +265,7 @@ "registered: %s", type); error = EAFNOSUPPORT; } else { - int ref_cnt; - - atomic_read(&rc->ref_cnt, &ref_cnt); - if (!ref_cnt) { + if (!rc->ref_cnt) { hmap_remove(&netdev_classes, &rc->hmap_node); free(rc); error = 0; @@ -298,7 +314,7 @@ ovs_mutex_lock(&netdev_class_mutex); HMAP_FOR_EACH (rc, hmap_node, &netdev_classes) { const char *dpif_port = netdev_vport_class_get_dpif_port(rc->class); - if (dpif_port && !strcmp(dpif_port, name)) { + if (dpif_port && !strncmp(name, dpif_port, strlen(dpif_port))) { ovs_mutex_unlock(&netdev_class_mutex); return true; } @@ -355,19 +371,15 @@ netdev->change_seq = 1; netdev->node = shash_add(&netdev_shash, name, netdev); - /* By default enable one rx queue per netdev. */ - if (netdev->netdev_class->rxq_alloc) { - netdev->n_rxq = 1; - } else { - netdev->n_rxq = 0; - } + /* By default enable one tx and rx queue per netdev. */ + netdev->n_txq = netdev->netdev_class->send ? 1 : 0; + netdev->n_rxq = netdev->netdev_class->rxq_alloc ? 1 : 0; + list_init(&netdev->saved_flags_list); error = rc->class->construct(netdev); if (!error) { - int old_ref_cnt; - - atomic_add(&rc->ref_cnt, 1, &old_ref_cnt); + rc->ref_cnt++; netdev_change_seq_changed(netdev); } else { free(netdev->name); @@ -419,7 +431,7 @@ /* Reconfigures the device 'netdev' with 'args'. 'args' may be empty * or NULL if none are needed. */ int -netdev_set_config(struct netdev *netdev, const struct smap *args) +netdev_set_config(struct netdev *netdev, const struct smap *args, char **errp) OVS_EXCLUDED(netdev_mutex) { if (netdev->netdev_class->set_config) { @@ -429,13 +441,13 @@ error = netdev->netdev_class->set_config(netdev, args ? args : &no_args); if (error) { - VLOG_WARN("%s: could not set configuration (%s)", - netdev_get_name(netdev), ovs_strerror(error)); + VLOG_WARN_BUF(errp, "%s: could not set configuration (%s)", + netdev_get_name(netdev), ovs_strerror(error)); } return error; } else if (args && !smap_is_empty(args)) { - VLOG_WARN("%s: arguments provided to device that is not configurable", - netdev_get_name(netdev)); + VLOG_WARN_BUF(errp, "%s: arguments provided to device that is not configurable", + netdev_get_name(netdev)); } return 0; } @@ -477,6 +489,18 @@ } } +/* Returns the id of the numa node the 'netdev' is on. If the function + * is not implemented, returns NETDEV_NUMA_UNSPEC. */ +int +netdev_get_numa_id(const struct netdev *netdev) +{ + if (netdev->netdev_class->get_numa_id) { + return netdev->netdev_class->get_numa_id(netdev); + } else { + return NETDEV_NUMA_UNSPEC; + } +} + static void netdev_unref(struct netdev *dev) OVS_RELEASES(netdev_mutex) @@ -485,19 +509,20 @@ if (!--dev->ref_cnt) { const struct netdev_class *class = dev->netdev_class; struct netdev_registered_class *rc; - int old_ref_cnt; dev->netdev_class->destruct(dev); - shash_delete(&netdev_shash, dev->node); + if (dev->node) { + shash_delete(&netdev_shash, dev->node); + } free(dev->name); dev->netdev_class->dealloc(dev); ovs_mutex_unlock(&netdev_mutex); ovs_mutex_lock(&netdev_class_mutex); rc = netdev_lookup_class(class->type); - atomic_sub(&rc->ref_cnt, 1, &old_ref_cnt); - ovs_assert(old_ref_cnt > 0); + ovs_assert(rc->ref_cnt > 0); + rc->ref_cnt--; ovs_mutex_unlock(&netdev_class_mutex); } else { ovs_mutex_unlock(&netdev_mutex); @@ -515,6 +540,28 @@ } } +/* Removes 'netdev' from the global shash and unrefs 'netdev'. + * + * This allows handler and revalidator threads to still retain references + * to this netdev while the main thread changes interface configuration. + * + * This function should only be called by the main thread when closing + * netdevs during user configuration changes. Otherwise, netdev_close should be + * used to close netdevs. */ +void +netdev_remove(struct netdev *netdev) +{ + if (netdev) { + ovs_mutex_lock(&netdev_mutex); + if (netdev->node) { + shash_delete(&netdev_shash, netdev->node); + netdev->node = NULL; + netdev_change_seq_changed(netdev); + } + netdev_unref(netdev); + } +} + /* Parses 'netdev_name_', which is of the form [type@]name into its component * pieces. 'name' and 'type' must be freed by the caller. */ void @@ -588,7 +635,7 @@ * Returns EAGAIN immediately if no packet is ready to be received. * * Returns EMSGSIZE, and discards the packet, if the received packet is longer - * than 'ofpbuf_tailroom(buffer)'. + * than 'dp_packet_tailroom(buffer)'. * * It is advised that the tailroom of 'buffer' should be * VLAN_HEADER_LEN bytes longer than the MTU to allow space for an @@ -598,7 +645,7 @@ * This function may be set to null if it would always return EOPNOTSUPP * anyhow. */ int -netdev_rxq_recv(struct netdev_rxq *rx, struct ofpbuf **buffers, int *cnt) +netdev_rxq_recv(struct netdev_rxq *rx, struct dp_packet **buffers, int *cnt) { int retval; @@ -626,25 +673,70 @@ : 0); } -/* Sends 'buffer' on 'netdev'. Returns 0 if successful, otherwise a positive - * errno value. Returns EAGAIN without blocking if the packet cannot be queued - * immediately. Returns EMSGSIZE if a partial packet was transmitted or if - * the packet is too big or too small to transmit on the device. +/* Configures the number of tx queues and rx queues of 'netdev'. + * Return 0 if successful, otherwise a positive errno value. + * + * 'n_rxq' specifies the maximum number of receive queues to create. + * The netdev provider might choose to create less (e.g. if the hardware + * supports only a smaller number). The caller can check how many have been + * actually created by calling 'netdev_n_rxq()' + * + * 'n_txq' specifies the exact number of transmission queues to create. + * If this function returns successfully, the caller can make 'n_txq' + * concurrent calls to netdev_send() (each one with a different 'qid' in the + * range [0..'n_txq'-1]). + * + * On error, the tx queue and rx queue configuration is indeterminant. + * Caller should make decision on whether to restore the previous or + * the default configuration. Also, caller must make sure there is no + * other thread accessing the queues at the same time. */ +int +netdev_set_multiq(struct netdev *netdev, unsigned int n_txq, + unsigned int n_rxq) +{ + int error; + + error = (netdev->netdev_class->set_multiq + ? netdev->netdev_class->set_multiq(netdev, + MAX(n_txq, 1), + MAX(n_rxq, 1)) + : EOPNOTSUPP); + + if (error && error != EOPNOTSUPP) { + VLOG_DBG_RL(&rl, "failed to set tx/rx queue for network device %s:" + "%s", netdev_get_name(netdev), ovs_strerror(error)); + } + + return error; +} + +/* Sends 'buffers' on 'netdev'. Returns 0 if successful (for every packet), + * otherwise a positive errno value. Returns EAGAIN without blocking if + * at least one the packets cannot be queued immediately. Returns EMSGSIZE + * if a partial packet was transmitted or if a packet is too big or too small + * to transmit on the device. + * + * If the function returns a non-zero value, some of the packets might have + * been sent anyway. * * To retain ownership of 'buffer' caller can set may_steal to false. * - * The kernel maintains a packet transmission queue, so the caller is not - * expected to do additional queuing of packets. + * The network device is expected to maintain one or more packet + * transmission queues, so that the caller does not ordinarily have to + * do additional queuing of packets. 'qid' specifies the queue to use + * and can be ignored if the implementation does not support multiple + * queues. * * Some network devices may not implement support for this function. In such * cases this function will always return EOPNOTSUPP. */ int -netdev_send(struct netdev *netdev, struct ofpbuf *buffer, bool may_steal) +netdev_send(struct netdev *netdev, int qid, struct dp_packet **buffers, + int cnt, bool may_steal) { int error; error = (netdev->netdev_class->send - ? netdev->netdev_class->send(netdev, buffer, may_steal) + ? netdev->netdev_class->send(netdev, qid, buffers, cnt, may_steal) : EOPNOTSUPP); if (!error) { COVERAGE_INC(netdev_sent); @@ -652,18 +744,70 @@ return error; } +int +netdev_pop_header(struct netdev *netdev, struct dp_packet **buffers, int cnt) +{ + int i; + + if (!netdev->netdev_class->pop_header) { + return EOPNOTSUPP; + } + + for (i = 0; i < cnt; i++) { + int err; + + err = netdev->netdev_class->pop_header(buffers[i]); + if (err) { + dp_packet_clear(buffers[i]); + } + } + + return 0; +} + +int +netdev_build_header(const struct netdev *netdev, struct ovs_action_push_tnl *data, + const struct flow *tnl_flow) +{ + if (netdev->netdev_class->build_header) { + return netdev->netdev_class->build_header(netdev, data, tnl_flow); + } + return EOPNOTSUPP; +} + +int +netdev_push_header(const struct netdev *netdev, + struct dp_packet **buffers, int cnt, + const struct ovs_action_push_tnl *data) +{ + int i; + + if (!netdev->netdev_class->push_header) { + return -EINVAL; + } + + for (i = 0; i < cnt; i++) { + netdev->netdev_class->push_header(buffers[i], data); + buffers[i]->md = PKT_METADATA_INITIALIZER(u32_to_odp(data->out_port)); + } + + return 0; +} + /* Registers with the poll loop to wake up from the next call to poll_block() * when the packet transmission queue has sufficient room to transmit a packet * with netdev_send(). * - * The kernel maintains a packet transmission queue, so the client is not - * expected to do additional queuing of packets. Thus, this function is - * unlikely to ever be used. It is included for completeness. */ + * The network device is expected to maintain one or more packet + * transmission queues, so that the caller does not ordinarily have to + * do additional queuing of packets. 'qid' specifies the queue to use + * and can be ignored if the implementation does not support multiple + * queues. */ void -netdev_send_wait(struct netdev *netdev) +netdev_send_wait(struct netdev *netdev, int qid) { if (netdev->netdev_class->send_wait) { - netdev->netdev_class->send_wait(netdev); + netdev->netdev_class->send_wait(netdev, qid); } } @@ -1192,19 +1336,6 @@ return error; } -/* Attempts to change the stats for 'netdev' to those provided in 'stats'. - * Returns 0 if successful, otherwise a positive errno value. - * - * This will probably fail for most network devices. Some devices might only - * allow setting their stats to 0. */ -int -netdev_set_stats(struct netdev *netdev, const struct netdev_stats *stats) -{ - return (netdev->netdev_class->set_stats - ? netdev->netdev_class->set_stats(netdev, stats) - : EOPNOTSUPP); -} - /* Attempts to set input rate limiting (policing) policy, such that up to * 'kbits_rate' kbps of traffic is accepted, with a maximum accumulative burst * size of 'kbits' kb. */ diff -Nru openvswitch-2.3.1/lib/netdev-dpdk.c openvswitch-2.4.0~git20150623/lib/netdev-dpdk.c --- openvswitch-2.3.1/lib/netdev-dpdk.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-dpdk.c 2015-06-23 18:46:21.000000000 +0000 @@ -16,7 +16,6 @@ #include -#include #include #include #include @@ -26,8 +25,13 @@ #include #include #include +#include #include +#include +#include +#include "dirs.h" +#include "dp-packet.h" #include "dpif-netdev.h" #include "list.h" #include "netdev-dpdk.h" @@ -35,7 +39,7 @@ #include "netdev-vport.h" #include "odp-util.h" #include "ofp-print.h" -#include "ofpbuf.h" +#include "ovs-numa.h" #include "ovs-thread.h" #include "ovs-rcu.h" #include "packets.h" @@ -44,7 +48,11 @@ #include "unaligned.h" #include "timeval.h" #include "unixctl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" + +#include "rte_config.h" +#include "rte_mbuf.h" +#include "rte_virtio_net.h" VLOG_DEFINE_THIS_MODULE(dpdk); static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); @@ -63,97 +71,128 @@ #define MBUF_SIZE(mtu) (MTU_TO_MAX_LEN(mtu) + (512) + \ sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) -/* TODO: mempool size should be based on system resources. */ -#define NB_MBUF (4096 * 64) -#define MP_CACHE_SZ (256 * 2) +/* Max and min number of packets in the mempool. OVS tries to allocate a + * mempool with MAX_NB_MBUF: if this fails (because the system doesn't have + * enough hugepages) we keep halving the number until the allocation succeeds + * or we reach MIN_NB_MBUF */ + +#define MAX_NB_MBUF (4096 * 64) +#define MIN_NB_MBUF (4096 * 4) +#define MP_CACHE_SZ RTE_MEMPOOL_CACHE_MAX_SIZE + +/* MAX_NB_MBUF can be divided by 2 many times, until MIN_NB_MBUF */ +BUILD_ASSERT_DECL(MAX_NB_MBUF % ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF) == 0); + +/* The smallest possible NB_MBUF that we're going to try should be a multiple + * of MP_CACHE_SZ. This is advised by DPDK documentation. */ +BUILD_ASSERT_DECL((MAX_NB_MBUF / ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF)) + % MP_CACHE_SZ == 0); + #define SOCKET0 0 -#define NON_PMD_THREAD_TX_QUEUE 0 +#define NIC_PORT_RX_Q_SIZE 2048 /* Size of Physical NIC RX Queue, Max (n+32<=4096)*/ +#define NIC_PORT_TX_Q_SIZE 2048 /* Size of Physical NIC TX Queue, Max (n+32<=4096)*/ + +char *cuse_dev_name = NULL; /* Character device cuse_dev_name. */ +char *vhost_sock_dir = NULL; /* Location of vhost-user sockets */ -/* TODO: Needs per NIC value for these constants. */ -#define RX_PTHRESH 32 /* Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 32 /* Default values of RX host threshold reg. */ -#define RX_WTHRESH 16 /* Default values of RX write-back threshold reg. */ - -#define TX_PTHRESH 36 /* Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /* Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /* Default values of TX write-back threshold reg. */ +/* + * Maximum amount of time in micro seconds to try and enqueue to vhost. + */ +#define VHOST_ENQ_RETRY_USECS 100 static const struct rte_eth_conf port_conf = { - .rxmode = { - .mq_mode = ETH_MQ_RX_RSS, - .split_hdr_size = 0, - .header_split = 0, /* Header Split disabled */ - .hw_ip_checksum = 0, /* IP checksum offload disabled */ - .hw_vlan_filter = 0, /* VLAN filtering disabled */ - .jumbo_frame = 0, /* Jumbo Frame Support disabled */ - .hw_strip_crc = 0, - }, - .rx_adv_conf = { - .rss_conf = { - .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4_TCP | ETH_RSS_IPV4 | ETH_RSS_IPV6, - }, - }, - .txmode = { - .mq_mode = ETH_MQ_TX_NONE, + .rxmode = { + .mq_mode = ETH_MQ_RX_RSS, + .split_hdr_size = 0, + .header_split = 0, /* Header Split disabled */ + .hw_ip_checksum = 0, /* IP checksum offload disabled */ + .hw_vlan_filter = 0, /* VLAN filtering disabled */ + .jumbo_frame = 0, /* Jumbo Frame Support disabled */ + .hw_strip_crc = 0, + }, + .rx_adv_conf = { + .rss_conf = { + .rss_key = NULL, + .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP, }, + }, + .txmode = { + .mq_mode = ETH_MQ_TX_NONE, + }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; +enum { MAX_TX_QUEUE_LEN = 384 }; +enum { DPDK_RING_SIZE = 256 }; +BUILD_ASSERT_DECL(IS_POW2(DPDK_RING_SIZE)); +enum { DRAIN_TSC = 200000ULL }; -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, - .tx_rs_thresh = 0, +enum dpdk_dev_type { + DPDK_DEV_ETH = 0, + DPDK_DEV_VHOST = 1, }; -enum { MAX_RX_QUEUE_LEN = 64 }; -enum { MAX_TX_QUEUE_LEN = 64 }; -enum { DRAIN_TSC = 200000ULL }; - static int rte_eal_init_ret = ENODEV; static struct ovs_mutex dpdk_mutex = OVS_MUTEX_INITIALIZER; /* Contains all 'struct dpdk_dev's. */ -static struct list dpdk_list OVS_GUARDED_BY(dpdk_mutex) - = LIST_INITIALIZER(&dpdk_list); +static struct ovs_list dpdk_list OVS_GUARDED_BY(dpdk_mutex) + = OVS_LIST_INITIALIZER(&dpdk_list); + +static struct ovs_list dpdk_mp_list OVS_GUARDED_BY(dpdk_mutex) + = OVS_LIST_INITIALIZER(&dpdk_mp_list); -static struct list dpdk_mp_list OVS_GUARDED_BY(dpdk_mutex) - = LIST_INITIALIZER(&dpdk_mp_list); +/* This mutex must be used by non pmd threads when allocating or freeing + * mbufs through mempools. Since dpdk_queue_pkts() and dpdk_queue_flush() may + * use mempools, a non pmd thread should hold this mutex while calling them */ +static struct ovs_mutex nonpmd_mempool_mutex = OVS_MUTEX_INITIALIZER; struct dpdk_mp { struct rte_mempool *mp; int mtu; int socket_id; int refcount; - struct list list_node OVS_GUARDED_BY(dpdk_mutex); + struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex); }; +/* There should be one 'struct dpdk_tx_queue' created for + * each cpu core. */ struct dpdk_tx_queue { - rte_spinlock_t tx_lock; + bool flush_tx; /* Set to true to flush queue everytime */ + /* pkts are queued. */ int count; + rte_spinlock_t tx_lock; /* Protects the members and the NIC queue + * from concurrent access. It is used only + * if the queue is shared among different + * pmd threads (see 'txq_needs_locking'). */ uint64_t tsc; struct rte_mbuf *burst_pkts[MAX_TX_QUEUE_LEN]; }; +/* dpdk has no way to remove dpdk ring ethernet devices + so we have to keep them around once they've been created +*/ + +static struct ovs_list dpdk_ring_list OVS_GUARDED_BY(dpdk_mutex) + = OVS_LIST_INITIALIZER(&dpdk_ring_list); + +struct dpdk_ring { + /* For the client rings */ + struct rte_ring *cring_tx; + struct rte_ring *cring_rx; + int user_port_id; /* User given port no, parsed from port name */ + int eth_port_id; /* ethernet device port id */ + struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex); +}; + struct netdev_dpdk { struct netdev up; int port_id; int max_packet_len; + enum dpdk_dev_type type; - struct dpdk_tx_queue tx_q[NR_QUEUE]; + struct dpdk_tx_queue *tx_q; struct ovs_mutex mutex OVS_ACQ_AFTER(dpdk_mutex); @@ -161,8 +200,9 @@ int mtu; int socket_id; int buf_size; - struct netdev_stats stats_offset; struct netdev_stats stats; + /* Protects stats */ + rte_spinlock_t stats_lock; uint8_t hwaddr[ETH_ADDR_LEN]; enum netdev_flags flags; @@ -170,8 +210,25 @@ struct rte_eth_link link; int link_reset_cnt; + /* The user might request more txqs than the NIC has. We remap those + * ('up.n_txq') on these ('real_n_txq'). + * If the numbers match, 'txq_needs_locking' is false, otherwise it is + * true and we will take a spinlock on transmission */ + int real_n_txq; + bool txq_needs_locking; + + /* Spinlock for vhost transmission. Other DPDK devices use spinlocks in + * dpdk_tx_queue */ + rte_spinlock_t vhost_tx_lock; + + /* virtio-net structure for vhost device */ + OVSRCU_TYPE(struct virtio_net *) virtio_dev; + + /* Identifier used to distinguish vhost devices from each other */ + char vhost_id[PATH_MAX]; + /* In dpdk_list. */ - struct list list_node OVS_GUARDED_BY(dpdk_mutex); + struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex); }; struct netdev_rxq_dpdk { @@ -179,16 +236,20 @@ int port_id; }; +static bool thread_is_pmd(void); + static int netdev_dpdk_construct(struct netdev *); +struct virtio_net * netdev_dpdk_get_virtio(const struct netdev_dpdk *dev); + static bool is_dpdk_class(const struct netdev_class *class) { return class->construct == netdev_dpdk_construct; } -/* TODO: use dpdk malloc for entire OVS. infact huge page shld be used - * for all other sengments data, bss and text. */ +/* XXX: use dpdk malloc for entire OVS. in fact huge page should be used + * for all other segments data, bss and text. */ static void * dpdk_rte_mzalloc(size_t sz) @@ -202,12 +263,14 @@ return ptr; } +/* XXX this function should be called only by pmd threads (or by non pmd + * threads holding the nonpmd_mempool_mutex) */ void -free_dpdk_buf(struct ofpbuf *b) +free_dpdk_buf(struct dp_packet *p) { - struct rte_mbuf *pkt = (struct rte_mbuf *) b; + struct rte_mbuf *pkt = (struct rte_mbuf *) p; - rte_mempool_put(pkt->pool, pkt); + rte_pktmbuf_free_seg(pkt); } static void @@ -217,26 +280,25 @@ unsigned i OVS_UNUSED) { struct rte_mbuf *m = _m; - uint32_t buf_len = mp->elt_size - sizeof(struct ofpbuf); + uint32_t buf_len = mp->elt_size - sizeof(struct dp_packet); - RTE_MBUF_ASSERT(mp->elt_size >= sizeof(struct ofpbuf)); + RTE_MBUF_ASSERT(mp->elt_size >= sizeof(struct dp_packet)); memset(m, 0, mp->elt_size); /* start of buffer is just after mbuf structure */ - m->buf_addr = (char *)m + sizeof(struct ofpbuf); + m->buf_addr = (char *)m + sizeof(struct dp_packet); m->buf_physaddr = rte_mempool_virt2phy(mp, m) + - sizeof(struct ofpbuf); + sizeof(struct dp_packet); m->buf_len = (uint16_t)buf_len; /* keep some headroom between start of buffer and data */ - m->pkt.data = (char*) m->buf_addr + RTE_MIN(RTE_PKTMBUF_HEADROOM, m->buf_len); + m->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, m->buf_len); /* init some constant fields */ - m->type = RTE_MBUF_PKT; m->pool = mp; - m->pkt.nb_segs = 1; - m->pkt.in_port = 0xff; + m->nb_segs = 1; + m->port = 0xff; } static void @@ -249,7 +311,7 @@ __rte_pktmbuf_init(mp, opaque_arg, _m, i); - ofpbuf_init_dpdk((struct ofpbuf *) m, m->buf_len); + dp_packet_init_dpdk((struct dp_packet *) m, m->buf_len); } static struct dpdk_mp * @@ -257,6 +319,7 @@ { struct dpdk_mp *dmp = NULL; char mp_name[RTE_MEMPOOL_NAMESIZE]; + unsigned mp_size; LIST_FOR_EACH (dmp, list_node, &dpdk_mp_list) { if (dmp->socket_id == socket_id && dmp->mtu == mtu) { @@ -270,16 +333,25 @@ dmp->mtu = mtu; dmp->refcount = 1; - snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_mp_%d", dmp->mtu); - dmp->mp = rte_mempool_create(mp_name, NB_MBUF, MBUF_SIZE(mtu), - MP_CACHE_SZ, - sizeof(struct rte_pktmbuf_pool_private), - rte_pktmbuf_pool_init, NULL, - ovs_rte_pktmbuf_init, NULL, - socket_id, 0); + mp_size = MAX_NB_MBUF; + do { + if (snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_mp_%d_%d_%u", + dmp->mtu, dmp->socket_id, mp_size) < 0) { + return NULL; + } + + dmp->mp = rte_mempool_create(mp_name, mp_size, MBUF_SIZE(mtu), + MP_CACHE_SZ, + sizeof(struct rte_pktmbuf_pool_private), + rte_pktmbuf_pool_init, NULL, + ovs_rte_pktmbuf_init, NULL, + socket_id, 0); + } while (!dmp->mp && rte_errno == ENOMEM && (mp_size /= 2) >= MIN_NB_MBUF); if (dmp->mp == NULL) { return NULL; + } else { + VLOG_DBG("Allocated \"%s\" mempool with %u mbufs", mp_name, mp_size ); } list_push_back(&dpdk_mp_list, &dmp->list_node); @@ -354,41 +426,50 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) OVS_REQUIRES(dpdk_mutex) { struct rte_pktmbuf_pool_private *mbp_priv; + struct rte_eth_dev_info info; struct ether_addr eth_addr; int diag; int i; if (dev->port_id < 0 || dev->port_id >= rte_eth_dev_count()) { - return -ENODEV; + return ENODEV; } - diag = rte_eth_dev_configure(dev->port_id, NR_QUEUE, NR_QUEUE, &port_conf); + rte_eth_dev_info_get(dev->port_id, &info); + dev->up.n_rxq = MIN(info.max_rx_queues, dev->up.n_rxq); + dev->real_n_txq = MIN(info.max_tx_queues, dev->up.n_txq); + + diag = rte_eth_dev_configure(dev->port_id, dev->up.n_rxq, dev->real_n_txq, + &port_conf); if (diag) { - VLOG_ERR("eth dev config error %d",diag); - return diag; + VLOG_ERR("eth dev config error %d. rxq:%d txq:%d", diag, dev->up.n_rxq, + dev->real_n_txq); + return -diag; } - for (i = 0; i < NR_QUEUE; i++) { - diag = rte_eth_tx_queue_setup(dev->port_id, i, 64, 0, &tx_conf); + for (i = 0; i < dev->real_n_txq; i++) { + diag = rte_eth_tx_queue_setup(dev->port_id, i, NIC_PORT_TX_Q_SIZE, + dev->socket_id, NULL); if (diag) { VLOG_ERR("eth dev tx queue setup error %d",diag); - return diag; + return -diag; } } - for (i = 0; i < NR_QUEUE; i++) { - diag = rte_eth_rx_queue_setup(dev->port_id, i, 64, 0, &rx_conf, - dev->dpdk_mp->mp); + for (i = 0; i < dev->up.n_rxq; i++) { + diag = rte_eth_rx_queue_setup(dev->port_id, i, NIC_PORT_RX_Q_SIZE, + dev->socket_id, + NULL, dev->dpdk_mp->mp); if (diag) { VLOG_ERR("eth dev rx queue setup error %d",diag); - return diag; + return -diag; } } diag = rte_eth_dev_start(dev->port_id); if (diag) { VLOG_ERR("eth dev start error %d",diag); - return diag; + return -diag; } rte_eth_promiscuous_enable(dev->port_id); @@ -422,62 +503,169 @@ return &netdev->up; } -static int -netdev_dpdk_construct(struct netdev *netdev_) +static void +netdev_dpdk_alloc_txq(struct netdev_dpdk *netdev, unsigned int n_txqs) { - struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); - unsigned int port_no; - char *cport; - int err; - int i; + unsigned i; - if (rte_eal_init_ret) { - return rte_eal_init_ret; + netdev->tx_q = dpdk_rte_mzalloc(n_txqs * sizeof *netdev->tx_q); + for (i = 0; i < n_txqs; i++) { + int numa_id = ovs_numa_get_numa_id(i); + + if (!netdev->txq_needs_locking) { + /* Each index is considered as a cpu core id, since there should + * be one tx queue for each cpu core. If the corresponding core + * is not on the same numa node as 'netdev', flags the + * 'flush_tx'. */ + netdev->tx_q[i].flush_tx = netdev->socket_id == numa_id; + } else { + /* Queues are shared among CPUs. Always flush */ + netdev->tx_q[i].flush_tx = true; + } + rte_spinlock_init(&netdev->tx_q[i].tx_lock); } +} - ovs_mutex_lock(&dpdk_mutex); - cport = netdev_->name + 4; /* Names always start with "dpdk" */ +static int +netdev_dpdk_init(struct netdev *netdev_, unsigned int port_no, + enum dpdk_dev_type type) + OVS_REQUIRES(dpdk_mutex) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + int sid; + int err = 0; - if (strncmp(netdev_->name, "dpdk", 4)) { - err = ENODEV; - goto unlock_dpdk; - } + ovs_mutex_init(&netdev->mutex); + ovs_mutex_lock(&netdev->mutex); - port_no = strtol(cport, 0, 0); /* string must be null terminated */ + rte_spinlock_init(&netdev->stats_lock); - for (i = 0; i < NR_QUEUE; i++) { - rte_spinlock_init(&netdev->tx_q[i].tx_lock); + /* If the 'sid' is negative, it means that the kernel fails + * to obtain the pci numa info. In that situation, always + * use 'SOCKET0'. */ + if (type == DPDK_DEV_ETH) { + sid = rte_eth_dev_socket_id(port_no); + } else { + sid = rte_lcore_to_socket_id(rte_get_master_lcore()); } - ovs_mutex_init(&netdev->mutex); - - ovs_mutex_lock(&netdev->mutex); + netdev->socket_id = sid < 0 ? SOCKET0 : sid; + netdev->port_id = port_no; + netdev->type = type; netdev->flags = 0; - netdev->mtu = ETHER_MTU; netdev->max_packet_len = MTU_TO_MAX_LEN(netdev->mtu); - /* TODO: need to discover device node at run time. */ - netdev->socket_id = SOCKET0; - netdev->port_id = port_no; - netdev->dpdk_mp = dpdk_mp_get(netdev->socket_id, netdev->mtu); if (!netdev->dpdk_mp) { err = ENOMEM; - goto unlock_dev; + goto unlock; } - err = dpdk_eth_dev_init(netdev); - if (err) { - goto unlock_dev; - } + netdev_->n_txq = NR_QUEUE; netdev_->n_rxq = NR_QUEUE; + netdev->real_n_txq = NR_QUEUE; + + if (type == DPDK_DEV_ETH) { + netdev_dpdk_alloc_txq(netdev, NR_QUEUE); + err = dpdk_eth_dev_init(netdev); + if (err) { + goto unlock; + } + } list_push_back(&dpdk_list, &netdev->list_node); -unlock_dev: +unlock: + if (err) { + rte_free(netdev->tx_q); + } ovs_mutex_unlock(&netdev->mutex); -unlock_dpdk: + return err; +} + +static int +dpdk_dev_parse_name(const char dev_name[], const char prefix[], + unsigned int *port_no) +{ + const char *cport; + + if (strncmp(dev_name, prefix, strlen(prefix))) { + return ENODEV; + } + + cport = dev_name + strlen(prefix); + *port_no = strtol(cport, NULL, 0); /* string must be null terminated */ + return 0; +} + +static int +vhost_construct_helper(struct netdev *netdev_) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + + if (rte_eal_init_ret) { + return rte_eal_init_ret; + } + + rte_spinlock_init(&netdev->vhost_tx_lock); + return netdev_dpdk_init(netdev_, -1, DPDK_DEV_VHOST); +} + +static int +netdev_dpdk_vhost_cuse_construct(struct netdev *netdev_) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + int err; + + ovs_mutex_lock(&dpdk_mutex); + strncpy(netdev->vhost_id, netdev->up.name, sizeof(netdev->vhost_id)); + err = vhost_construct_helper(netdev_); + ovs_mutex_unlock(&dpdk_mutex); + return err; +} + +static int +netdev_dpdk_vhost_user_construct(struct netdev *netdev_) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + int err; + + ovs_mutex_lock(&dpdk_mutex); + /* Take the name of the vhost-user port and append it to the location where + * the socket is to be created, then register the socket. + */ + snprintf(netdev->vhost_id, sizeof(netdev->vhost_id), "%s/%s", + vhost_sock_dir, netdev_->name); + err = rte_vhost_driver_register(netdev->vhost_id); + if (err) { + VLOG_ERR("vhost-user socket device setup failure for socket %s\n", + netdev->vhost_id); + } + VLOG_INFO("Socket %s created for vhost-user port %s\n", netdev->vhost_id, netdev_->name); + err = vhost_construct_helper(netdev_); + ovs_mutex_unlock(&dpdk_mutex); + return err; +} + +static int +netdev_dpdk_construct(struct netdev *netdev) +{ + unsigned int port_no; + int err; + + if (rte_eal_init_ret) { + return rte_eal_init_ret; + } + + /* Names always start with "dpdk" */ + err = dpdk_dev_parse_name(netdev->name, "dpdk", &port_no); + if (err) { + return err; + } + + ovs_mutex_lock(&dpdk_mutex); + err = netdev_dpdk_init(netdev, port_no, DPDK_DEV_ETH); ovs_mutex_unlock(&dpdk_mutex); return err; } @@ -492,11 +680,27 @@ ovs_mutex_unlock(&dev->mutex); ovs_mutex_lock(&dpdk_mutex); + rte_free(dev->tx_q); list_remove(&dev->list_node); dpdk_mp_put(dev->dpdk_mp); ovs_mutex_unlock(&dpdk_mutex); +} - ovs_mutex_destroy(&dev->mutex); +static void +netdev_dpdk_vhost_destruct(struct netdev *netdev_) +{ + struct netdev_dpdk *dev = netdev_dpdk_cast(netdev_); + + /* Can't remove a port while a guest is attached to it. */ + if (netdev_dpdk_get_virtio(dev) != NULL) { + VLOG_ERR("Can not remove port, vhost device still attached"); + return; + } + + ovs_mutex_lock(&dpdk_mutex); + list_remove(&dev->list_node); + dpdk_mp_put(dev->dpdk_mp); + ovs_mutex_unlock(&dpdk_mutex); } static void @@ -514,14 +718,80 @@ ovs_mutex_lock(&dev->mutex); - /* TODO: Allow to configure number of queues. */ - smap_add_format(args, "configured_rx_queues", "%u", netdev_->n_rxq); - smap_add_format(args, "configured_tx_queues", "%u", netdev_->n_rxq); + smap_add_format(args, "configured_rx_queues", "%d", netdev_->n_rxq); + smap_add_format(args, "requested_tx_queues", "%d", netdev_->n_txq); + smap_add_format(args, "configured_tx_queues", "%d", dev->real_n_txq); ovs_mutex_unlock(&dev->mutex); return 0; } +static int +netdev_dpdk_get_numa_id(const struct netdev *netdev_) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + + return netdev->socket_id; +} + +/* Sets the number of tx queues and rx queues for the dpdk interface. + * If the configuration fails, do not try restoring its old configuration + * and just returns the error. */ +static int +netdev_dpdk_set_multiq(struct netdev *netdev_, unsigned int n_txq, + unsigned int n_rxq) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + int err = 0; + + if (netdev->up.n_txq == n_txq && netdev->up.n_rxq == n_rxq) { + return err; + } + + ovs_mutex_lock(&dpdk_mutex); + ovs_mutex_lock(&netdev->mutex); + + rte_eth_dev_stop(netdev->port_id); + + netdev->up.n_txq = n_txq; + netdev->up.n_rxq = n_rxq; + + rte_free(netdev->tx_q); + err = dpdk_eth_dev_init(netdev); + netdev_dpdk_alloc_txq(netdev, netdev->real_n_txq); + + netdev->txq_needs_locking = netdev->real_n_txq != netdev->up.n_txq; + + ovs_mutex_unlock(&netdev->mutex); + ovs_mutex_unlock(&dpdk_mutex); + + return err; +} + +static int +netdev_dpdk_vhost_set_multiq(struct netdev *netdev_, unsigned int n_txq, + unsigned int n_rxq) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + int err = 0; + + if (netdev->up.n_txq == n_txq && netdev->up.n_rxq == n_rxq) { + return err; + } + + ovs_mutex_lock(&dpdk_mutex); + ovs_mutex_lock(&netdev->mutex); + + netdev->up.n_txq = n_txq; + netdev->real_n_txq = 1; + netdev->up.n_rxq = 1; + + ovs_mutex_unlock(&netdev->mutex); + ovs_mutex_unlock(&dpdk_mutex); + + return err; +} + static struct netdev_rxq * netdev_dpdk_rxq_alloc(void) { @@ -562,39 +832,110 @@ rte_free(rx); } -inline static void +static inline void +dpdk_queue_flush__(struct netdev_dpdk *dev, int qid) +{ + struct dpdk_tx_queue *txq = &dev->tx_q[qid]; + uint32_t nb_tx = 0; + + while (nb_tx != txq->count) { + uint32_t ret; + + ret = rte_eth_tx_burst(dev->port_id, qid, txq->burst_pkts + nb_tx, + txq->count - nb_tx); + if (!ret) { + break; + } + + nb_tx += ret; + } + + if (OVS_UNLIKELY(nb_tx != txq->count)) { + /* free buffers, which we couldn't transmit, one at a time (each + * packet could come from a different mempool) */ + int i; + + for (i = nb_tx; i < txq->count; i++) { + rte_pktmbuf_free_seg(txq->burst_pkts[i]); + } + rte_spinlock_lock(&dev->stats_lock); + dev->stats.tx_dropped += txq->count-nb_tx; + rte_spinlock_unlock(&dev->stats_lock); + } + + txq->count = 0; + txq->tsc = rte_get_timer_cycles(); +} + +static inline void dpdk_queue_flush(struct netdev_dpdk *dev, int qid) { struct dpdk_tx_queue *txq = &dev->tx_q[qid]; - uint32_t nb_tx; if (txq->count == 0) { return; } - rte_spinlock_lock(&txq->tx_lock); - nb_tx = rte_eth_tx_burst(dev->port_id, qid, txq->burst_pkts, txq->count); - if (nb_tx != txq->count) { - /* free buffers if we couldn't transmit packets */ - rte_mempool_put_bulk(dev->dpdk_mp->mp, - (void **) &txq->burst_pkts[nb_tx], - (txq->count - nb_tx)); + dpdk_queue_flush__(dev, qid); +} + +static bool +is_vhost_running(struct virtio_net *dev) +{ + return (dev != NULL && (dev->flags & VIRTIO_DEV_RUNNING)); +} + +/* + * The receive path for the vhost port is the TX path out from guest. + */ +static int +netdev_dpdk_vhost_rxq_recv(struct netdev_rxq *rxq_, + struct dp_packet **packets, int *c) +{ + struct netdev_rxq_dpdk *rx = netdev_rxq_dpdk_cast(rxq_); + struct netdev *netdev = rx->up.netdev; + struct netdev_dpdk *vhost_dev = netdev_dpdk_cast(netdev); + struct virtio_net *virtio_dev = netdev_dpdk_get_virtio(vhost_dev); + int qid = 1; + uint16_t nb_rx = 0; + + if (OVS_UNLIKELY(!is_vhost_running(virtio_dev))) { + return EAGAIN; } - txq->count = 0; - rte_spinlock_unlock(&txq->tx_lock); + + nb_rx = rte_vhost_dequeue_burst(virtio_dev, qid, + vhost_dev->dpdk_mp->mp, + (struct rte_mbuf **)packets, + NETDEV_MAX_BURST); + if (!nb_rx) { + return EAGAIN; + } + + rte_spinlock_lock(&vhost_dev->stats_lock); + vhost_dev->stats.rx_packets += (uint64_t)nb_rx; + rte_spinlock_unlock(&vhost_dev->stats_lock); + + *c = (int) nb_rx; + return 0; } static int -netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, struct ofpbuf **packets, int *c) +netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets, + int *c) { struct netdev_rxq_dpdk *rx = netdev_rxq_dpdk_cast(rxq_); struct netdev *netdev = rx->up.netdev; struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); int nb_rx; - dpdk_queue_flush(dev, rxq_->queue_id); + /* There is only one tx queue for this core. Do not flush other + * queueus. */ + if (rxq_->queue_id == rte_lcore_id()) { + dpdk_queue_flush(dev, rxq_->queue_id); + } nb_rx = rte_eth_rx_burst(rx->port_id, rxq_->queue_id, - (struct rte_mbuf **) packets, MAX_RX_QUEUE_LEN); + (struct rte_mbuf **) packets, + NETDEV_MAX_BURST); if (!nb_rx) { return EAGAIN; } @@ -604,105 +945,265 @@ return 0; } +static void +__netdev_dpdk_vhost_send(struct netdev *netdev, struct dp_packet **pkts, + int cnt, bool may_steal) +{ + struct netdev_dpdk *vhost_dev = netdev_dpdk_cast(netdev); + struct virtio_net *virtio_dev = netdev_dpdk_get_virtio(vhost_dev); + struct rte_mbuf **cur_pkts = (struct rte_mbuf **) pkts; + unsigned int total_pkts = cnt; + uint64_t start = 0; + + if (OVS_UNLIKELY(!is_vhost_running(virtio_dev))) { + rte_spinlock_lock(&vhost_dev->stats_lock); + vhost_dev->stats.tx_dropped+= cnt; + rte_spinlock_unlock(&vhost_dev->stats_lock); + goto out; + } + + /* There is vHost TX single queue, So we need to lock it for TX. */ + rte_spinlock_lock(&vhost_dev->vhost_tx_lock); + + do { + unsigned int tx_pkts; + + tx_pkts = rte_vhost_enqueue_burst(virtio_dev, VIRTIO_RXQ, + cur_pkts, cnt); + if (OVS_LIKELY(tx_pkts)) { + /* Packets have been sent.*/ + cnt -= tx_pkts; + /* Prepare for possible next iteration.*/ + cur_pkts = &cur_pkts[tx_pkts]; + } else { + uint64_t timeout = VHOST_ENQ_RETRY_USECS * rte_get_timer_hz() / 1E6; + unsigned int expired = 0; + + if (!start) { + start = rte_get_timer_cycles(); + } + + /* + * Unable to enqueue packets to vhost interface. + * Check available entries before retrying. + */ + while (!rte_vring_available_entries(virtio_dev, VIRTIO_RXQ)) { + if (OVS_UNLIKELY((rte_get_timer_cycles() - start) > timeout)) { + expired = 1; + break; + } + } + if (expired) { + /* break out of main loop. */ + break; + } + } + } while (cnt); + rte_spinlock_unlock(&vhost_dev->vhost_tx_lock); + + rte_spinlock_lock(&vhost_dev->stats_lock); + vhost_dev->stats.tx_packets += (total_pkts - cnt); + vhost_dev->stats.tx_dropped += cnt; + rte_spinlock_unlock(&vhost_dev->stats_lock); + +out: + if (may_steal) { + int i; + + for (i = 0; i < total_pkts; i++) { + dp_packet_delete(pkts[i]); + } + } +} + inline static void -dpdk_queue_pkt(struct netdev_dpdk *dev, int qid, - struct rte_mbuf *pkt) +dpdk_queue_pkts(struct netdev_dpdk *dev, int qid, + struct rte_mbuf **pkts, int cnt) { struct dpdk_tx_queue *txq = &dev->tx_q[qid]; uint64_t diff_tsc; - uint64_t cur_tsc; - uint32_t nb_tx; - rte_spinlock_lock(&txq->tx_lock); - txq->burst_pkts[txq->count++] = pkt; - if (txq->count == MAX_TX_QUEUE_LEN) { - goto flush; - } - cur_tsc = rte_get_timer_cycles(); - if (txq->count == 1) { - txq->tsc = cur_tsc; - } - diff_tsc = cur_tsc - txq->tsc; - if (diff_tsc >= DRAIN_TSC) { - goto flush; - } - rte_spinlock_unlock(&txq->tx_lock); - return; - -flush: - nb_tx = rte_eth_tx_burst(dev->port_id, qid, txq->burst_pkts, txq->count); - if (nb_tx != txq->count) { - /* free buffers if we couldn't transmit packets */ - rte_mempool_put_bulk(dev->dpdk_mp->mp, - (void **) &txq->burst_pkts[nb_tx], - (txq->count - nb_tx)); + int i = 0; + + while (i < cnt) { + int freeslots = MAX_TX_QUEUE_LEN - txq->count; + int tocopy = MIN(freeslots, cnt-i); + + memcpy(&txq->burst_pkts[txq->count], &pkts[i], + tocopy * sizeof (struct rte_mbuf *)); + + txq->count += tocopy; + i += tocopy; + + if (txq->count == MAX_TX_QUEUE_LEN || txq->flush_tx) { + dpdk_queue_flush__(dev, qid); + } + diff_tsc = rte_get_timer_cycles() - txq->tsc; + if (diff_tsc >= DRAIN_TSC) { + dpdk_queue_flush__(dev, qid); + } } - txq->count = 0; - rte_spinlock_unlock(&txq->tx_lock); } /* Tx function. Transmit packets indefinitely */ static void -dpdk_do_tx_copy(struct netdev *netdev, char *buf, int size) -{ +dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet **pkts, + int cnt) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ +#if !defined(__CHECKER__) && !defined(_WIN32) + const size_t PKT_ARRAY_SIZE = cnt; +#else + /* Sparse or MSVC doesn't like variable length array. */ + enum { PKT_ARRAY_SIZE = NETDEV_MAX_BURST }; +#endif struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); - struct rte_mbuf *pkt; + struct rte_mbuf *mbufs[PKT_ARRAY_SIZE]; + int dropped = 0; + int newcnt = 0; + int i; - pkt = rte_pktmbuf_alloc(dev->dpdk_mp->mp); - if (!pkt) { - ovs_mutex_lock(&dev->mutex); - dev->stats.tx_dropped++; - ovs_mutex_unlock(&dev->mutex); - return; + /* If we are on a non pmd thread we have to use the mempool mutex, because + * every non pmd thread shares the same mempool cache */ + + if (!thread_is_pmd()) { + ovs_mutex_lock(&nonpmd_mempool_mutex); + } + + for (i = 0; i < cnt; i++) { + int size = dp_packet_size(pkts[i]); + + if (OVS_UNLIKELY(size > dev->max_packet_len)) { + VLOG_WARN_RL(&rl, "Too big size %d max_packet_len %d", + (int)size , dev->max_packet_len); + + dropped++; + continue; + } + + mbufs[newcnt] = rte_pktmbuf_alloc(dev->dpdk_mp->mp); + + if (!mbufs[newcnt]) { + dropped += cnt - i; + break; + } + + /* We have to do a copy for now */ + memcpy(rte_pktmbuf_mtod(mbufs[newcnt], void *), dp_packet_data(pkts[i]), size); + + rte_pktmbuf_data_len(mbufs[newcnt]) = size; + rte_pktmbuf_pkt_len(mbufs[newcnt]) = size; + + newcnt++; } - /* We have to do a copy for now */ - memcpy(pkt->pkt.data, buf, size); + if (OVS_UNLIKELY(dropped)) { + rte_spinlock_lock(&dev->stats_lock); + dev->stats.tx_dropped += dropped; + rte_spinlock_unlock(&dev->stats_lock); + } - rte_pktmbuf_data_len(pkt) = size; - rte_pktmbuf_pkt_len(pkt) = size; + if (dev->type == DPDK_DEV_VHOST) { + __netdev_dpdk_vhost_send(netdev, (struct dp_packet **) mbufs, newcnt, true); + } else { + dpdk_queue_pkts(dev, qid, mbufs, newcnt); + dpdk_queue_flush(dev, qid); + } - dpdk_queue_pkt(dev, NON_PMD_THREAD_TX_QUEUE, pkt); - dpdk_queue_flush(dev, NON_PMD_THREAD_TX_QUEUE); + if (!thread_is_pmd()) { + ovs_mutex_unlock(&nonpmd_mempool_mutex); + } } static int -netdev_dpdk_send(struct netdev *netdev, - struct ofpbuf *ofpbuf, bool may_steal) +netdev_dpdk_vhost_send(struct netdev *netdev, int qid OVS_UNUSED, struct dp_packet **pkts, + int cnt, bool may_steal) { - struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); - int ret; + if (OVS_UNLIKELY(pkts[0]->source != DPBUF_DPDK)) { + int i; - if (ofpbuf_size(ofpbuf) > dev->max_packet_len) { - VLOG_WARN_RL(&rl, "Too big size %d max_packet_len %d", - (int)ofpbuf_size(ofpbuf) , dev->max_packet_len); + dpdk_do_tx_copy(netdev, qid, pkts, cnt); + if (may_steal) { + for (i = 0; i < cnt; i++) { + dp_packet_delete(pkts[i]); + } + } + } else { + __netdev_dpdk_vhost_send(netdev, pkts, cnt, may_steal); + } + return 0; +} - ovs_mutex_lock(&dev->mutex); - dev->stats.tx_dropped++; - ovs_mutex_unlock(&dev->mutex); +static inline void +netdev_dpdk_send__(struct netdev_dpdk *dev, int qid, + struct dp_packet **pkts, int cnt, bool may_steal) +{ + int i; - ret = E2BIG; - goto out; + if (OVS_UNLIKELY(dev->txq_needs_locking)) { + qid = qid % dev->real_n_txq; + rte_spinlock_lock(&dev->tx_q[qid].tx_lock); } - if (!may_steal || ofpbuf->source != OFPBUF_DPDK) { - dpdk_do_tx_copy(netdev, (char *) ofpbuf_data(ofpbuf), ofpbuf_size(ofpbuf)); + if (OVS_UNLIKELY(!may_steal || + pkts[0]->source != DPBUF_DPDK)) { + struct netdev *netdev = &dev->up; + + dpdk_do_tx_copy(netdev, qid, pkts, cnt); if (may_steal) { - ofpbuf_delete(ofpbuf); + for (i = 0; i < cnt; i++) { + dp_packet_delete(pkts[i]); + } } } else { - int qid; + int next_tx_idx = 0; + int dropped = 0; - qid = rte_lcore_id() % NR_QUEUE; + for (i = 0; i < cnt; i++) { + int size = dp_packet_size(pkts[i]); - dpdk_queue_pkt(dev, qid, (struct rte_mbuf *)ofpbuf); + if (OVS_UNLIKELY(size > dev->max_packet_len)) { + if (next_tx_idx != i) { + dpdk_queue_pkts(dev, qid, + (struct rte_mbuf **)&pkts[next_tx_idx], + i-next_tx_idx); + } + + VLOG_WARN_RL(&rl, "Too big size %d max_packet_len %d", + (int)size , dev->max_packet_len); + + dp_packet_delete(pkts[i]); + dropped++; + next_tx_idx = i + 1; + } + } + if (next_tx_idx != cnt) { + dpdk_queue_pkts(dev, qid, + (struct rte_mbuf **)&pkts[next_tx_idx], + cnt-next_tx_idx); + } + if (OVS_UNLIKELY(dropped)) { + rte_spinlock_lock(&dev->stats_lock); + dev->stats.tx_dropped += dropped; + rte_spinlock_unlock(&dev->stats_lock); + } } - ret = 0; -out: - return ret; + if (OVS_UNLIKELY(dev->txq_needs_locking)) { + rte_spinlock_unlock(&dev->tx_q[qid].tx_lock); + } +} + +static int +netdev_dpdk_eth_send(struct netdev *netdev, int qid, + struct dp_packet **pkts, int cnt, bool may_steal) +{ + struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); + + netdev_dpdk_send__(dev, qid, pkts, cnt, may_steal); + return 0; } static int @@ -777,7 +1278,6 @@ err = dpdk_eth_dev_init(dev); if (err) { - dpdk_mp_put(mp); dev->mtu = old_mtu; dev->dpdk_mp = old_mp; @@ -798,39 +1298,69 @@ netdev_dpdk_get_carrier(const struct netdev *netdev_, bool *carrier); static int -netdev_dpdk_get_stats(const struct netdev *netdev, struct netdev_stats *stats) +netdev_dpdk_vhost_get_stats(const struct netdev *netdev, + struct netdev_stats *stats) { struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); - struct rte_eth_stats rte_stats; - bool gg; - netdev_dpdk_get_carrier(netdev, &gg); ovs_mutex_lock(&dev->mutex); - rte_eth_stats_get(dev->port_id, &rte_stats); - - *stats = dev->stats_offset; - - stats->rx_packets += rte_stats.ipackets; - stats->tx_packets += rte_stats.opackets; - stats->rx_bytes += rte_stats.ibytes; - stats->tx_bytes += rte_stats.obytes; - stats->rx_errors += rte_stats.ierrors; - stats->tx_errors += rte_stats.oerrors; - stats->multicast += rte_stats.imcasts; - + memset(stats, 0, sizeof(*stats)); + /* Unsupported Stats */ + stats->rx_errors = UINT64_MAX; + stats->tx_errors = UINT64_MAX; + stats->multicast = UINT64_MAX; + stats->collisions = UINT64_MAX; + stats->rx_crc_errors = UINT64_MAX; + stats->rx_fifo_errors = UINT64_MAX; + stats->rx_frame_errors = UINT64_MAX; + stats->rx_length_errors = UINT64_MAX; + stats->rx_missed_errors = UINT64_MAX; + stats->rx_over_errors = UINT64_MAX; + stats->tx_aborted_errors = UINT64_MAX; + stats->tx_carrier_errors = UINT64_MAX; + stats->tx_errors = UINT64_MAX; + stats->tx_fifo_errors = UINT64_MAX; + stats->tx_heartbeat_errors = UINT64_MAX; + stats->tx_window_errors = UINT64_MAX; + stats->rx_bytes += UINT64_MAX; + stats->rx_dropped += UINT64_MAX; + stats->tx_bytes += UINT64_MAX; + + rte_spinlock_lock(&dev->stats_lock); + /* Supported Stats */ + stats->rx_packets += dev->stats.rx_packets; + stats->tx_packets += dev->stats.tx_packets; stats->tx_dropped += dev->stats.tx_dropped; + rte_spinlock_unlock(&dev->stats_lock); ovs_mutex_unlock(&dev->mutex); return 0; } static int -netdev_dpdk_set_stats(struct netdev *netdev, const struct netdev_stats *stats) +netdev_dpdk_get_stats(const struct netdev *netdev, struct netdev_stats *stats) { struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); + struct rte_eth_stats rte_stats; + bool gg; + netdev_dpdk_get_carrier(netdev, &gg); ovs_mutex_lock(&dev->mutex); - dev->stats_offset = *stats; + rte_eth_stats_get(dev->port_id, &rte_stats); + + memset(stats, 0, sizeof(*stats)); + + stats->rx_packets = rte_stats.ipackets; + stats->tx_packets = rte_stats.opackets; + stats->rx_bytes = rte_stats.ibytes; + stats->tx_bytes = rte_stats.obytes; + stats->rx_errors = rte_stats.ierrors; + stats->tx_errors = rte_stats.oerrors; + stats->multicast = rte_stats.imcasts; + + rte_spinlock_lock(&dev->stats_lock); + stats->tx_dropped = dev->stats.tx_dropped; + rte_spinlock_unlock(&dev->stats_lock); ovs_mutex_unlock(&dev->mutex); return 0; @@ -903,6 +1433,26 @@ ovs_mutex_lock(&dev->mutex); check_link_status(dev); *carrier = dev->link.link_status; + + ovs_mutex_unlock(&dev->mutex); + + return 0; +} + +static int +netdev_dpdk_vhost_get_carrier(const struct netdev *netdev_, bool *carrier) +{ + struct netdev_dpdk *dev = netdev_dpdk_cast(netdev_); + struct virtio_net *virtio_dev = netdev_dpdk_get_virtio(dev); + + ovs_mutex_lock(&dev->mutex); + + if (is_vhost_running(virtio_dev)) { + *carrier = 1; + } else { + *carrier = 0; + } + ovs_mutex_unlock(&dev->mutex); return 0; @@ -925,14 +1475,13 @@ netdev_dpdk_set_miimon(struct netdev *netdev_ OVS_UNUSED, long long int interval OVS_UNUSED) { - return 0; + return EOPNOTSUPP; } static int netdev_dpdk_update_flags__(struct netdev_dpdk *dev, enum netdev_flags off, enum netdev_flags on, - enum netdev_flags *old_flagsp) - OVS_REQUIRES(dev->mutex) + enum netdev_flags *old_flagsp) OVS_REQUIRES(dev->mutex) { int err; @@ -948,18 +1497,20 @@ return 0; } - if (dev->flags & NETDEV_UP) { - err = rte_eth_dev_start(dev->port_id); - if (err) - return err; - } + if (dev->type == DPDK_DEV_ETH) { + if (dev->flags & NETDEV_UP) { + err = rte_eth_dev_start(dev->port_id); + if (err) + return -err; + } - if (dev->flags & NETDEV_PROMISC) { - rte_eth_promiscuous_enable(dev->port_id); - } + if (dev->flags & NETDEV_PROMISC) { + rte_eth_promiscuous_enable(dev->port_id); + } - if (!(dev->flags & NETDEV_UP)) { - rte_eth_dev_stop(dev->port_id); + if (!(dev->flags & NETDEV_UP)) { + rte_eth_dev_stop(dev->port_id); + } } return 0; @@ -986,7 +1537,7 @@ struct netdev_dpdk *dev = netdev_dpdk_cast(netdev_); struct rte_eth_dev_info dev_info; - if (dev->port_id <= 0) + if (dev->port_id < 0) return ENODEV; ovs_mutex_lock(&dev->mutex); @@ -995,6 +1546,7 @@ smap_add_format(args, "driver_name", "%s", dev_info.driver_name); + smap_add_format(args, "port_no", "%d", dev->port_id); smap_add_format(args, "numa_id", "%d", rte_eth_dev_socket_id(dev->port_id)); smap_add_format(args, "driver_name", "%s", dev_info.driver_name); smap_add_format(args, "min_rx_bufsize", "%u", dev_info.min_rx_bufsize); @@ -1069,137 +1621,528 @@ unixctl_command_reply(conn, "OK"); } +/* + * Set virtqueue flags so that we do not receive interrupts. + */ +static void +set_irq_status(struct virtio_net *dev) +{ + dev->virtqueue[VIRTIO_RXQ]->used->flags = VRING_USED_F_NO_NOTIFY; + dev->virtqueue[VIRTIO_TXQ]->used->flags = VRING_USED_F_NO_NOTIFY; +} + +/* + * A new virtio-net device is added to a vhost port. + */ static int -dpdk_class_init(void) +new_device(struct virtio_net *dev) { - int result; + struct netdev_dpdk *netdev; + bool exists = false; - if (rte_eal_init_ret) { - return 0; + ovs_mutex_lock(&dpdk_mutex); + /* Add device to the vhost port with the same name as that passed down. */ + LIST_FOR_EACH(netdev, list_node, &dpdk_list) { + if (strncmp(dev->ifname, netdev->vhost_id, IF_NAME_SZ) == 0) { + ovs_mutex_lock(&netdev->mutex); + ovsrcu_set(&netdev->virtio_dev, dev); + ovs_mutex_unlock(&netdev->mutex); + exists = true; + dev->flags |= VIRTIO_DEV_RUNNING; + /* Disable notifications. */ + set_irq_status(dev); + break; + } } + ovs_mutex_unlock(&dpdk_mutex); + + if (!exists) { + VLOG_INFO("vHost Device '%s' (%ld) can't be added - name not found", + dev->ifname, dev->device_fh); - result = rte_pmd_init_all(); - if (result) { - VLOG_ERR("Cannot init PMD"); - return result; + return -1; } - result = rte_eal_pci_probe(); - if (result) { - VLOG_ERR("Cannot probe PCI"); - return result; + VLOG_INFO("vHost Device '%s' (%ld) has been added", + dev->ifname, dev->device_fh); + return 0; +} + +/* + * Remove a virtio-net device from the specific vhost port. Use dev->remove + * flag to stop any more packets from being sent or received to/from a VM and + * ensure all currently queued packets have been sent/received before removing + * the device. + */ +static void +destroy_device(volatile struct virtio_net *dev) +{ + struct netdev_dpdk *vhost_dev; + + ovs_mutex_lock(&dpdk_mutex); + LIST_FOR_EACH (vhost_dev, list_node, &dpdk_list) { + if (netdev_dpdk_get_virtio(vhost_dev) == dev) { + + ovs_mutex_lock(&vhost_dev->mutex); + dev->flags &= ~VIRTIO_DEV_RUNNING; + ovsrcu_set(&vhost_dev->virtio_dev, NULL); + ovs_mutex_unlock(&vhost_dev->mutex); + + /* + * Wait for other threads to quiesce before + * setting the virtio_dev to NULL. + */ + ovsrcu_synchronize(); + /* + * As call to ovsrcu_synchronize() will end the quiescent state, + * put thread back into quiescent state before returning. + */ + ovsrcu_quiesce_start(); + } } + ovs_mutex_unlock(&dpdk_mutex); + + VLOG_INFO("vHost Device '%s' (%ld) has been removed", + dev->ifname, dev->device_fh); +} - if (rte_eth_dev_count() < 1) { - VLOG_ERR("No Ethernet devices found. Try assigning ports to UIO."); +struct virtio_net * +netdev_dpdk_get_virtio(const struct netdev_dpdk *dev) +{ + return ovsrcu_get(struct virtio_net *, &dev->virtio_dev); +} + +/* + * These callbacks allow virtio-net devices to be added to vhost ports when + * configuration has been fully complete. + */ +static const struct virtio_net_device_ops virtio_net_device_ops = +{ + .new_device = new_device, + .destroy_device = destroy_device, +}; + +static void * +start_vhost_loop(void *dummy OVS_UNUSED) +{ + pthread_detach(pthread_self()); + /* Put the cuse thread into quiescent state. */ + ovsrcu_quiesce_start(); + rte_vhost_driver_session_start(); + return NULL; +} + +static int +dpdk_vhost_class_init(void) +{ + rte_vhost_driver_callback_register(&virtio_net_device_ops); + ovs_thread_create("vhost_thread", start_vhost_loop, NULL); + return 0; +} + +static int +dpdk_vhost_cuse_class_init(void) +{ + int err = -1; + + + /* Register CUSE device to handle IOCTLs. + * Unless otherwise specified on the vswitchd command line, cuse_dev_name + * is set to vhost-net. + */ + err = rte_vhost_driver_register(cuse_dev_name); + + if (err != 0) { + VLOG_ERR("CUSE device setup failure."); + return -1; } - VLOG_INFO("Ethernet Device Count: %d", (int)rte_eth_dev_count()); + dpdk_vhost_class_init(); + return 0; +} - list_init(&dpdk_list); - list_init(&dpdk_mp_list); +static int +dpdk_vhost_user_class_init(void) +{ + dpdk_vhost_class_init(); + return 0; +} +static void +dpdk_common_init(void) +{ unixctl_command_register("netdev-dpdk/set-admin-state", "[netdev] up|down", 1, 2, netdev_dpdk_set_admin_state, NULL); ovs_thread_create("dpdk_watchdog", dpdk_watchdog, NULL); +} + +/* Client Rings */ + +static int +dpdk_ring_create(const char dev_name[], unsigned int port_no, + unsigned int *eth_port_id) +{ + struct dpdk_ring *ivshmem; + char ring_name[10]; + int err; + + ivshmem = dpdk_rte_mzalloc(sizeof *ivshmem); + if (ivshmem == NULL) { + return ENOMEM; + } + + /* XXX: Add support for multiquque ring. */ + err = snprintf(ring_name, 10, "%s_tx", dev_name); + if (err < 0) { + return -err; + } + + /* Create single consumer/producer rings, netdev does explicit locking. */ + ivshmem->cring_tx = rte_ring_create(ring_name, DPDK_RING_SIZE, SOCKET0, + RING_F_SP_ENQ | RING_F_SC_DEQ); + if (ivshmem->cring_tx == NULL) { + rte_free(ivshmem); + return ENOMEM; + } + + err = snprintf(ring_name, 10, "%s_rx", dev_name); + if (err < 0) { + return -err; + } + + /* Create single consumer/producer rings, netdev does explicit locking. */ + ivshmem->cring_rx = rte_ring_create(ring_name, DPDK_RING_SIZE, SOCKET0, + RING_F_SP_ENQ | RING_F_SC_DEQ); + if (ivshmem->cring_rx == NULL) { + rte_free(ivshmem); + return ENOMEM; + } + + err = rte_eth_from_rings(dev_name, &ivshmem->cring_rx, 1, + &ivshmem->cring_tx, 1, SOCKET0); + + if (err < 0) { + rte_free(ivshmem); + return ENODEV; + } + + ivshmem->user_port_id = port_no; + ivshmem->eth_port_id = rte_eth_dev_count() - 1; + list_push_back(&dpdk_ring_list, &ivshmem->list_node); + + *eth_port_id = ivshmem->eth_port_id; return 0; } -static struct netdev_class netdev_dpdk_class = { - "dpdk", - dpdk_class_init, /* init */ - NULL, /* netdev_dpdk_run */ - NULL, /* netdev_dpdk_wait */ - - netdev_dpdk_alloc, - netdev_dpdk_construct, - netdev_dpdk_destruct, - netdev_dpdk_dealloc, - netdev_dpdk_get_config, - NULL, /* netdev_dpdk_set_config */ - NULL, /* get_tunnel_config */ - - netdev_dpdk_send, /* send */ - NULL, /* send_wait */ - - netdev_dpdk_set_etheraddr, - netdev_dpdk_get_etheraddr, - netdev_dpdk_get_mtu, - netdev_dpdk_set_mtu, - netdev_dpdk_get_ifindex, - netdev_dpdk_get_carrier, - netdev_dpdk_get_carrier_resets, - netdev_dpdk_set_miimon, - netdev_dpdk_get_stats, - netdev_dpdk_set_stats, - netdev_dpdk_get_features, - NULL, /* set_advertisements */ - - NULL, /* set_policing */ - NULL, /* get_qos_types */ - NULL, /* get_qos_capabilities */ - NULL, /* get_qos */ - NULL, /* set_qos */ - NULL, /* get_queue */ - NULL, /* set_queue */ - NULL, /* delete_queue */ - NULL, /* get_queue_stats */ - NULL, /* queue_dump_start */ - NULL, /* queue_dump_next */ - NULL, /* queue_dump_done */ - NULL, /* dump_queue_stats */ - - NULL, /* get_in4 */ - NULL, /* set_in4 */ - NULL, /* get_in6 */ - NULL, /* add_router */ - NULL, /* get_next_hop */ - netdev_dpdk_get_status, - NULL, /* arp_lookup */ - - netdev_dpdk_update_flags, - - netdev_dpdk_rxq_alloc, - netdev_dpdk_rxq_construct, - netdev_dpdk_rxq_destruct, - netdev_dpdk_rxq_dealloc, - netdev_dpdk_rxq_recv, - NULL, /* rxq_wait */ - NULL, /* rxq_drain */ -}; +static int +dpdk_ring_open(const char dev_name[], unsigned int *eth_port_id) OVS_REQUIRES(dpdk_mutex) +{ + struct dpdk_ring *ivshmem; + unsigned int port_no; + int err = 0; + + /* Names always start with "dpdkr" */ + err = dpdk_dev_parse_name(dev_name, "dpdkr", &port_no); + if (err) { + return err; + } + + /* look through our list to find the device */ + LIST_FOR_EACH (ivshmem, list_node, &dpdk_ring_list) { + if (ivshmem->user_port_id == port_no) { + VLOG_INFO("Found dpdk ring device %s:", dev_name); + *eth_port_id = ivshmem->eth_port_id; /* really all that is needed */ + return 0; + } + } + /* Need to create the device rings */ + return dpdk_ring_create(dev_name, port_no, eth_port_id); +} + +static int +netdev_dpdk_ring_send(struct netdev *netdev_, int qid, + struct dp_packet **pkts, int cnt, bool may_steal) +{ + struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_); + unsigned i; + + /* When using 'dpdkr' and sending to a DPDK ring, we want to ensure that the + * rss hash field is clear. This is because the same mbuf may be modified by + * the consumer of the ring and return into the datapath without recalculating + * the RSS hash. */ + for (i = 0; i < cnt; i++) { + dp_packet_set_rss_hash(pkts[i], 0); + } + + netdev_dpdk_send__(netdev, qid, pkts, cnt, may_steal); + return 0; +} + +static int +netdev_dpdk_ring_construct(struct netdev *netdev) +{ + unsigned int port_no = 0; + int err = 0; + + if (rte_eal_init_ret) { + return rte_eal_init_ret; + } + + ovs_mutex_lock(&dpdk_mutex); + + err = dpdk_ring_open(netdev->name, &port_no); + if (err) { + goto unlock_dpdk; + } + + err = netdev_dpdk_init(netdev, port_no, DPDK_DEV_ETH); + +unlock_dpdk: + ovs_mutex_unlock(&dpdk_mutex); + return err; +} + +#define NETDEV_DPDK_CLASS(NAME, INIT, CONSTRUCT, DESTRUCT, MULTIQ, SEND, \ + GET_CARRIER, GET_STATS, GET_FEATURES, GET_STATUS, RXQ_RECV) \ +{ \ + NAME, \ + INIT, /* init */ \ + NULL, /* netdev_dpdk_run */ \ + NULL, /* netdev_dpdk_wait */ \ + \ + netdev_dpdk_alloc, \ + CONSTRUCT, \ + DESTRUCT, \ + netdev_dpdk_dealloc, \ + netdev_dpdk_get_config, \ + NULL, /* netdev_dpdk_set_config */ \ + NULL, /* get_tunnel_config */ \ + NULL, /* build header */ \ + NULL, /* push header */ \ + NULL, /* pop header */ \ + netdev_dpdk_get_numa_id, /* get_numa_id */ \ + MULTIQ, /* set_multiq */ \ + \ + SEND, /* send */ \ + NULL, /* send_wait */ \ + \ + netdev_dpdk_set_etheraddr, \ + netdev_dpdk_get_etheraddr, \ + netdev_dpdk_get_mtu, \ + netdev_dpdk_set_mtu, \ + netdev_dpdk_get_ifindex, \ + GET_CARRIER, \ + netdev_dpdk_get_carrier_resets, \ + netdev_dpdk_set_miimon, \ + GET_STATS, \ + GET_FEATURES, \ + NULL, /* set_advertisements */ \ + \ + NULL, /* set_policing */ \ + NULL, /* get_qos_types */ \ + NULL, /* get_qos_capabilities */ \ + NULL, /* get_qos */ \ + NULL, /* set_qos */ \ + NULL, /* get_queue */ \ + NULL, /* set_queue */ \ + NULL, /* delete_queue */ \ + NULL, /* get_queue_stats */ \ + NULL, /* queue_dump_start */ \ + NULL, /* queue_dump_next */ \ + NULL, /* queue_dump_done */ \ + NULL, /* dump_queue_stats */ \ + \ + NULL, /* get_in4 */ \ + NULL, /* set_in4 */ \ + NULL, /* get_in6 */ \ + NULL, /* add_router */ \ + NULL, /* get_next_hop */ \ + GET_STATUS, \ + NULL, /* arp_lookup */ \ + \ + netdev_dpdk_update_flags, \ + \ + netdev_dpdk_rxq_alloc, \ + netdev_dpdk_rxq_construct, \ + netdev_dpdk_rxq_destruct, \ + netdev_dpdk_rxq_dealloc, \ + RXQ_RECV, \ + NULL, /* rx_wait */ \ + NULL, /* rxq_drain */ \ +} + +static int +process_vhost_flags(char *flag, char *default_val, int size, + char **argv, char **new_val) +{ + int changed = 0; + + /* Depending on which version of vhost is in use, process the vhost-specific + * flag if it is provided on the vswitchd command line, otherwise resort to + * a default value. + * + * For vhost-user: Process "-cuse_dev_name" to set the custom location of + * the vhost-user socket(s). + * For vhost-cuse: Process "-vhost_sock_dir" to set the custom name of the + * vhost-cuse character device. + */ + if (!strcmp(argv[1], flag) && (strlen(argv[2]) <= size)) { + changed = 1; + *new_val = strdup(argv[2]); + VLOG_INFO("User-provided %s in use: %s", flag, *new_val); + } else { + VLOG_INFO("No %s provided - defaulting to %s", flag, default_val); + *new_val = default_val; + } + + return changed; +} int dpdk_init(int argc, char **argv) { int result; + int base = 0; + char *pragram_name = argv[0]; - if (strcmp(argv[1], "--dpdk")) + if (argc < 2 || strcmp(argv[1], "--dpdk")) return 0; + /* Remove the --dpdk argument from arg list.*/ argc--; argv++; +#ifdef VHOST_CUSE + if (process_vhost_flags("-cuse_dev_name", strdup("vhost-net"), + PATH_MAX, argv, &cuse_dev_name)) { +#else + if (process_vhost_flags("-vhost_sock_dir", strdup(ovs_rundir()), + NAME_MAX, argv, &vhost_sock_dir)) { + struct stat s; + int err; + + err = stat(vhost_sock_dir, &s); + if (err) { + VLOG_ERR("vHostUser socket DIR '%s' does not exist.", + vhost_sock_dir); + return err; + } +#endif + /* Remove the vhost flag configuration parameters from the argument + * list, so that the correct elements are passed to the DPDK + * initialization function + */ + argc -= 2; + argv += 2; /* Increment by two to bypass the vhost flag arguments */ + base = 2; + } + + /* Keep the program name argument as this is needed for call to + * rte_eal_init() + */ + argv[0] = pragram_name; + /* Make sure things are initialized ... */ result = rte_eal_init(argc, argv); - if (result < 0) - ovs_abort(result, "Cannot init EAL\n"); + if (result < 0) { + ovs_abort(result, "Cannot init EAL"); + } - rte_memzone_dump(); + rte_memzone_dump(stdout); rte_eal_init_ret = 0; - return result; + if (argc > result) { + argv[result] = argv[0]; + } + + /* We are called from the main thread here */ + RTE_PER_LCORE(_lcore_id) = NON_PMD_CORE_ID; + + return result + 1 + base; } +static const struct netdev_class dpdk_class = + NETDEV_DPDK_CLASS( + "dpdk", + NULL, + netdev_dpdk_construct, + netdev_dpdk_destruct, + netdev_dpdk_set_multiq, + netdev_dpdk_eth_send, + netdev_dpdk_get_carrier, + netdev_dpdk_get_stats, + netdev_dpdk_get_features, + netdev_dpdk_get_status, + netdev_dpdk_rxq_recv); + +static const struct netdev_class dpdk_ring_class = + NETDEV_DPDK_CLASS( + "dpdkr", + NULL, + netdev_dpdk_ring_construct, + netdev_dpdk_destruct, + netdev_dpdk_set_multiq, + netdev_dpdk_ring_send, + netdev_dpdk_get_carrier, + netdev_dpdk_get_stats, + netdev_dpdk_get_features, + netdev_dpdk_get_status, + netdev_dpdk_rxq_recv); + +static const struct netdev_class dpdk_vhost_cuse_class = + NETDEV_DPDK_CLASS( + "dpdkvhostcuse", + dpdk_vhost_cuse_class_init, + netdev_dpdk_vhost_cuse_construct, + netdev_dpdk_vhost_destruct, + netdev_dpdk_vhost_set_multiq, + netdev_dpdk_vhost_send, + netdev_dpdk_vhost_get_carrier, + netdev_dpdk_vhost_get_stats, + NULL, + NULL, + netdev_dpdk_vhost_rxq_recv); + +const struct netdev_class dpdk_vhost_user_class = + NETDEV_DPDK_CLASS( + "dpdkvhostuser", + dpdk_vhost_user_class_init, + netdev_dpdk_vhost_user_construct, + netdev_dpdk_vhost_destruct, + netdev_dpdk_vhost_set_multiq, + netdev_dpdk_vhost_send, + netdev_dpdk_vhost_get_carrier, + netdev_dpdk_vhost_get_stats, + NULL, + NULL, + netdev_dpdk_vhost_rxq_recv); + void netdev_dpdk_register(void) { - netdev_register_provider(&netdev_dpdk_class); + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + + if (rte_eal_init_ret) { + return; + } + + if (ovsthread_once_start(&once)) { + dpdk_common_init(); + netdev_register_provider(&dpdk_class); + netdev_register_provider(&dpdk_ring_class); +#ifdef VHOST_CUSE + netdev_register_provider(&dpdk_vhost_cuse_class); +#else + netdev_register_provider(&dpdk_vhost_user_class); +#endif + ovsthread_once_done(&once); + } } int -pmd_thread_setaffinity_cpu(int cpu) +pmd_thread_setaffinity_cpu(unsigned cpu) { cpu_set_t cpuset; int err; @@ -1211,7 +2154,15 @@ VLOG_ERR("Thread affinity error %d",err); return err; } + /* NON_PMD_CORE_ID is reserved for use by non pmd threads. */ + ovs_assert(cpu != NON_PMD_CORE_ID); RTE_PER_LCORE(_lcore_id) = cpu; return 0; } + +static bool +thread_is_pmd(void) +{ + return rte_lcore_id() != NON_PMD_CORE_ID; +} diff -Nru openvswitch-2.3.1/lib/netdev-dpdk.h openvswitch-2.4.0~git20150623/lib/netdev-dpdk.h --- openvswitch-2.3.1/lib/netdev-dpdk.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-dpdk.h 2015-06-23 18:46:21.000000000 +0000 @@ -2,7 +2,8 @@ #define NETDEV_DPDK_H #include -#include "ofpbuf.h" + +struct dp_packet; #ifdef DPDK_NETDEV @@ -10,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -18,16 +20,25 @@ #include #include +#define NON_PMD_CORE_ID LCORE_ID_ANY + int dpdk_init(int argc, char **argv); void netdev_dpdk_register(void); -void free_dpdk_buf(struct ofpbuf *); -int pmd_thread_setaffinity_cpu(int cpu); +void free_dpdk_buf(struct dp_packet *); +int pmd_thread_setaffinity_cpu(unsigned cpu); #else +#define NON_PMD_CORE_ID UINT32_MAX + +#include "util.h" + static inline int -dpdk_init(int arg1 OVS_UNUSED, char **arg2 OVS_UNUSED) +dpdk_init(int argc, char **argv) { + if (argc >= 2 && !strcmp(argv[1], "--dpdk")) { + ovs_fatal(0, "DPDK support not built into this copy of Open vSwitch."); + } return 0; } @@ -38,13 +49,13 @@ } static inline void -free_dpdk_buf(struct ofpbuf *buf OVS_UNUSED) +free_dpdk_buf(struct dp_packet *buf OVS_UNUSED) { /* Nothing */ } static inline int -pmd_thread_setaffinity_cpu(int cpu OVS_UNUSED) +pmd_thread_setaffinity_cpu(unsigned cpu OVS_UNUSED) { return 0; } diff -Nru openvswitch-2.3.1/lib/netdev-dummy.c openvswitch-2.4.0~git20150623/lib/netdev-dummy.c --- openvswitch-2.3.1/lib/netdev-dummy.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-dummy.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,9 @@ #include +#include "dp-packet.h" #include "dpif-netdev.h" +#include "dynamic-string.h" #include "flow.h" #include "list.h" #include "netdev-provider.h" @@ -28,6 +30,7 @@ #include "odp-util.h" #include "ofp-print.h" #include "ofpbuf.h" +#include "ovs-atomic.h" #include "packets.h" #include "pcap-file.h" #include "poll-loop.h" @@ -38,7 +41,7 @@ #include "timeval.h" #include "unixctl.h" #include "reconnect.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(netdev_dummy); @@ -46,8 +49,8 @@ struct dummy_packet_stream { struct stream *stream; - struct ofpbuf rxbuf; - struct list txq; + struct dp_packet rxbuf; + struct ovs_list txq; }; enum dummy_packet_conn_type { @@ -56,6 +59,12 @@ ACTIVE /* Connect to listener. */ }; +enum dummy_netdev_conn_state { + CONN_STATE_CONNECTED, /* Listener connected. */ + CONN_STATE_NOT_CONNECTED, /* Listener not connected. */ + CONN_STATE_UNKNOWN, /* No relavent information. */ +}; + struct dummy_packet_pconn { struct pstream *pstream; struct dummy_packet_stream *streams; @@ -75,18 +84,23 @@ } u; }; +struct pkt_list_node { + struct dp_packet *pkt; + struct ovs_list list_node; +}; + /* Protects 'dummy_list'. */ static struct ovs_mutex dummy_list_mutex = OVS_MUTEX_INITIALIZER; /* Contains all 'struct dummy_dev's. */ -static struct list dummy_list OVS_GUARDED_BY(dummy_list_mutex) - = LIST_INITIALIZER(&dummy_list); +static struct ovs_list dummy_list OVS_GUARDED_BY(dummy_list_mutex) + = OVS_LIST_INITIALIZER(&dummy_list); struct netdev_dummy { struct netdev up; /* In dummy_list. */ - struct list list_node OVS_GUARDED_BY(dummy_list_mutex); + struct ovs_list list_node OVS_GUARDED_BY(dummy_list_mutex); /* Protects all members below. */ struct ovs_mutex mutex OVS_ACQ_AFTER(dummy_list_mutex); @@ -101,7 +115,8 @@ FILE *tx_pcap, *rxq_pcap OVS_GUARDED; - struct list rxes OVS_GUARDED; /* List of child "netdev_rxq_dummy"s. */ + struct in_addr address, netmask; + struct ovs_list rxes OVS_GUARDED; /* List of child "netdev_rxq_dummy"s. */ }; /* Max 'recv_queue_len' in struct netdev_dummy. */ @@ -109,18 +124,20 @@ struct netdev_rxq_dummy { struct netdev_rxq up; - struct list node; /* In netdev_dummy's "rxes" list. */ - struct list recv_queue; + struct ovs_list node; /* In netdev_dummy's "rxes" list. */ + struct ovs_list recv_queue; int recv_queue_len; /* list_size(&recv_queue). */ struct seq *seq; /* Reports newly queued packets. */ }; static unixctl_cb_func netdev_dummy_set_admin_state; static int netdev_dummy_construct(struct netdev *); -static void netdev_dummy_queue_packet(struct netdev_dummy *, struct ofpbuf *); +static void netdev_dummy_queue_packet(struct netdev_dummy *, struct dp_packet *); static void dummy_packet_stream_close(struct dummy_packet_stream *); +static void pkt_list_delete(struct ovs_list *); + static bool is_dummy_class(const struct netdev_class *class) { @@ -146,7 +163,7 @@ { int rxbuf_size = stream ? 2048 : 0; s->stream = stream; - ofpbuf_init(&s->rxbuf, rxbuf_size); + dp_packet_init(&s->rxbuf, rxbuf_size); list_init(&s->txq); } @@ -175,11 +192,15 @@ dummy_packet_stream_send(struct dummy_packet_stream *s, const void *buffer, size_t size) { if (list_size(&s->txq) < NETDEV_DUMMY_MAX_QUEUE) { - struct ofpbuf *b; + struct dp_packet *b; + struct pkt_list_node *node; - b = ofpbuf_clone_data_with_headroom(buffer, size, 2); - put_unaligned_be16(ofpbuf_push_uninit(b, 2), htons(size)); - list_push_back(&s->txq, &b->list_node); + b = dp_packet_clone_data_with_headroom(buffer, size, 2); + put_unaligned_be16(dp_packet_push_uninit(b, 2), htons(size)); + + node = xmalloc(sizeof *node); + node->pkt = b; + list_push_back(&s->txq, &node->list_node); } } @@ -192,17 +213,20 @@ stream_run(s->stream); if (!list_is_empty(&s->txq)) { - struct ofpbuf *txbuf; + struct pkt_list_node *txbuf_node; + struct dp_packet *txbuf; int retval; - txbuf = ofpbuf_from_list(list_front(&s->txq)); - retval = stream_send(s->stream, ofpbuf_data(txbuf), ofpbuf_size(txbuf)); + ASSIGN_CONTAINER(txbuf_node, list_front(&s->txq), list_node); + txbuf = txbuf_node->pkt; + retval = stream_send(s->stream, dp_packet_data(txbuf), dp_packet_size(txbuf)); if (retval > 0) { - ofpbuf_pull(txbuf, retval); - if (!ofpbuf_size(txbuf)) { - list_remove(&txbuf->list_node); - ofpbuf_delete(txbuf); + dp_packet_pull(txbuf, retval); + if (!dp_packet_size(txbuf)) { + list_remove(&txbuf_node->list_node); + free(txbuf_node); + dp_packet_delete(txbuf); } } else if (retval != -EAGAIN) { error = -retval; @@ -210,37 +234,37 @@ } if (!error) { - if (ofpbuf_size(&s->rxbuf) < 2) { - n = 2 - ofpbuf_size(&s->rxbuf); + if (dp_packet_size(&s->rxbuf) < 2) { + n = 2 - dp_packet_size(&s->rxbuf); } else { uint16_t frame_len; - frame_len = ntohs(get_unaligned_be16(ofpbuf_data(&s->rxbuf))); + frame_len = ntohs(get_unaligned_be16(dp_packet_data(&s->rxbuf))); if (frame_len < ETH_HEADER_LEN) { error = EPROTO; n = 0; } else { - n = (2 + frame_len) - ofpbuf_size(&s->rxbuf); + n = (2 + frame_len) - dp_packet_size(&s->rxbuf); } } } if (!error) { int retval; - ofpbuf_prealloc_tailroom(&s->rxbuf, n); - retval = stream_recv(s->stream, ofpbuf_tail(&s->rxbuf), n); + dp_packet_prealloc_tailroom(&s->rxbuf, n); + retval = stream_recv(s->stream, dp_packet_tail(&s->rxbuf), n); if (retval > 0) { - ofpbuf_set_size(&s->rxbuf, ofpbuf_size(&s->rxbuf) + retval); - if (retval == n && ofpbuf_size(&s->rxbuf) > 2) { - ofpbuf_pull(&s->rxbuf, 2); + dp_packet_set_size(&s->rxbuf, dp_packet_size(&s->rxbuf) + retval); + if (retval == n && dp_packet_size(&s->rxbuf) > 2) { + dp_packet_pull(&s->rxbuf, 2); netdev_dummy_queue_packet(dev, - ofpbuf_clone(&s->rxbuf)); - ofpbuf_clear(&s->rxbuf); + dp_packet_clone(&s->rxbuf)); + dp_packet_clear(&s->rxbuf); } } else if (retval != -EAGAIN) { error = (retval < 0 ? -retval - : ofpbuf_size(&s->rxbuf) ? EPROTO + : dp_packet_size(&s->rxbuf) ? EPROTO : EOF); } } @@ -252,8 +276,8 @@ dummy_packet_stream_close(struct dummy_packet_stream *s) { stream_close(s->stream); - ofpbuf_uninit(&s->rxbuf); - ofpbuf_list_delete(&s->txq); + dp_packet_uninit(&s->rxbuf); + pkt_list_delete(&s->txq); } static void @@ -332,13 +356,15 @@ switch (conn->type) { case PASSIVE: - if (!strcmp(pstream_get_name(conn->u.pconn.pstream), pstream)) { + if (pstream && + !strcmp(pstream_get_name(conn->u.pconn.pstream), pstream)) { return; } dummy_packet_conn_close(conn); break; case ACTIVE: - if (!strcmp(stream_get_name(conn->u.rconn.rstream->stream), stream)) { + if (stream && + !strcmp(stream_get_name(conn->u.rconn.rstream->stream), stream)) { return; } dummy_packet_conn_close(conn); @@ -561,6 +587,24 @@ } } +static enum dummy_netdev_conn_state +dummy_netdev_get_conn_state(struct dummy_packet_conn *conn) +{ + enum dummy_netdev_conn_state state; + + if (conn->type == ACTIVE) { + if (reconnect_is_connected(conn->u.rconn.reconnect)) { + state = CONN_STATE_CONNECTED; + } else { + state = CONN_STATE_NOT_CONNECTED; + } + } else { + state = CONN_STATE_UNKNOWN; + } + + return state; +} + static void netdev_dummy_run(void) { @@ -599,11 +643,11 @@ static int netdev_dummy_construct(struct netdev *netdev_) { - static atomic_uint next_n = ATOMIC_VAR_INIT(0xaa550000); + static atomic_count next_n = ATOMIC_COUNT_INIT(0xaa550000); struct netdev_dummy *netdev = netdev_dummy_cast(netdev_); unsigned int n; - atomic_add(&next_n, 1, &n); + n = atomic_count_inc(&next_n); ovs_mutex_init(&netdev->mutex); ovs_mutex_lock(&netdev->mutex); @@ -672,6 +716,33 @@ } static int +netdev_dummy_get_in4(const struct netdev *netdev_, + struct in_addr *address, struct in_addr *netmask) +{ + struct netdev_dummy *netdev = netdev_dummy_cast(netdev_); + + ovs_mutex_lock(&netdev->mutex); + *address = netdev->address; + *netmask = netdev->netmask; + ovs_mutex_unlock(&netdev->mutex); + return 0; +} + +static int +netdev_dummy_set_in4(struct netdev *netdev_, struct in_addr address, + struct in_addr netmask) +{ + struct netdev_dummy *netdev = netdev_dummy_cast(netdev_); + + ovs_mutex_lock(&netdev->mutex); + netdev->address = address; + netdev->netmask = netmask; + ovs_mutex_unlock(&netdev->mutex); + + return 0; +} + +static int netdev_dummy_set_config(struct netdev *netdev_, const struct smap *args) { struct netdev_dummy *netdev = netdev_dummy_cast(netdev_); @@ -740,7 +811,7 @@ ovs_mutex_lock(&netdev->mutex); list_remove(&rx->node); - ofpbuf_list_delete(&rx->recv_queue); + pkt_list_delete(&rx->recv_queue); ovs_mutex_unlock(&netdev->mutex); seq_destroy(rx->seq); } @@ -754,15 +825,20 @@ } static int -netdev_dummy_rxq_recv(struct netdev_rxq *rxq_, struct ofpbuf **arr, int *c) +netdev_dummy_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **arr, + int *c) { struct netdev_rxq_dummy *rx = netdev_rxq_dummy_cast(rxq_); struct netdev_dummy *netdev = netdev_dummy_cast(rx->up.netdev); - struct ofpbuf *packet; + struct dp_packet *packet; ovs_mutex_lock(&netdev->mutex); if (!list_is_empty(&rx->recv_queue)) { - packet = ofpbuf_from_list(list_pop_front(&rx->recv_queue)); + struct pkt_list_node *pkt_node; + + ASSIGN_CONTAINER(pkt_node, list_pop_front(&rx->recv_queue), list_node); + packet = pkt_node->pkt; + free(pkt_node); rx->recv_queue_len--; } else { packet = NULL; @@ -774,10 +850,12 @@ } ovs_mutex_lock(&netdev->mutex); netdev->stats.rx_packets++; - netdev->stats.rx_bytes += ofpbuf_size(packet); + netdev->stats.rx_bytes += dp_packet_size(packet); ovs_mutex_unlock(&netdev->mutex); dp_packet_pad(packet); + dp_packet_set_rss_hash(packet, 0); + arr[0] = packet; *c = 1; return 0; @@ -806,7 +884,7 @@ struct netdev_dummy *netdev = netdev_dummy_cast(rx->up.netdev); ovs_mutex_lock(&netdev->mutex); - ofpbuf_list_delete(&rx->recv_queue); + pkt_list_delete(&rx->recv_queue); rx->recv_queue_len = 0; ovs_mutex_unlock(&netdev->mutex); @@ -816,50 +894,61 @@ } static int -netdev_dummy_send(struct netdev *netdev, struct ofpbuf *pkt, bool may_steal) +netdev_dummy_send(struct netdev *netdev, int qid OVS_UNUSED, + struct dp_packet **pkts, int cnt, bool may_steal) { struct netdev_dummy *dev = netdev_dummy_cast(netdev); - const void *buffer = ofpbuf_data(pkt); - size_t size = ofpbuf_size(pkt); + int error = 0; + int i; - if (size < ETH_HEADER_LEN) { - return EMSGSIZE; - } else { - const struct eth_header *eth = buffer; - int max_size; + for (i = 0; i < cnt; i++) { + const void *buffer = dp_packet_data(pkts[i]); + size_t size = dp_packet_size(pkts[i]); - ovs_mutex_lock(&dev->mutex); - max_size = dev->mtu + ETH_HEADER_LEN; - ovs_mutex_unlock(&dev->mutex); + if (size < ETH_HEADER_LEN) { + error = EMSGSIZE; + break; + } else { + const struct eth_header *eth = buffer; + int max_size; - if (eth->eth_type == htons(ETH_TYPE_VLAN)) { - max_size += VLAN_HEADER_LEN; - } - if (size > max_size) { - return EMSGSIZE; + ovs_mutex_lock(&dev->mutex); + max_size = dev->mtu + ETH_HEADER_LEN; + ovs_mutex_unlock(&dev->mutex); + + if (eth->eth_type == htons(ETH_TYPE_VLAN)) { + max_size += VLAN_HEADER_LEN; + } + if (size > max_size) { + error = EMSGSIZE; + break; + } } - } - ovs_mutex_lock(&dev->mutex); - dev->stats.tx_packets++; - dev->stats.tx_bytes += size; + ovs_mutex_lock(&dev->mutex); + dev->stats.tx_packets++; + dev->stats.tx_bytes += size; + + dummy_packet_conn_send(&dev->conn, buffer, size); - dummy_packet_conn_send(&dev->conn, buffer, size); + if (dev->tx_pcap) { + struct dp_packet packet; - if (dev->tx_pcap) { - struct ofpbuf packet; + dp_packet_use_const(&packet, buffer, size); + ovs_pcap_write(dev->tx_pcap, &packet); + fflush(dev->tx_pcap); + } - ofpbuf_use_const(&packet, buffer, size); - ovs_pcap_write(dev->tx_pcap, &packet); - fflush(dev->tx_pcap); + ovs_mutex_unlock(&dev->mutex); } - ovs_mutex_unlock(&dev->mutex); if (may_steal) { - ofpbuf_delete(pkt); + for (i = 0; i < cnt; i++) { + dp_packet_delete(pkts[i]); + } } - return 0; + return error; } static int @@ -928,18 +1017,6 @@ } static int -netdev_dummy_set_stats(struct netdev *netdev, const struct netdev_stats *stats) -{ - struct netdev_dummy *dev = netdev_dummy_cast(netdev); - - ovs_mutex_lock(&dev->mutex); - dev->stats = *stats; - ovs_mutex_unlock(&dev->mutex); - - return 0; -} - -static int netdev_dummy_get_ifindex(const struct netdev *netdev) { struct netdev_dummy *dev = netdev_dummy_cast(netdev); @@ -1002,6 +1079,11 @@ netdev_dummy_get_config, netdev_dummy_set_config, NULL, /* get_tunnel_config */ + NULL, /* build header */ + NULL, /* push header */ + NULL, /* pop header */ + NULL, /* get_numa_id */ + NULL, /* set_multiq */ netdev_dummy_send, /* send */ NULL, /* send_wait */ @@ -1015,7 +1097,6 @@ NULL, /* get_carrier_resets */ NULL, /* get_miimon */ netdev_dummy_get_stats, - netdev_dummy_set_stats, NULL, /* get_features */ NULL, /* set_advertisements */ @@ -1034,7 +1115,7 @@ NULL, /* queue_dump_done */ NULL, /* dump_queue_stats */ - NULL, /* get_in4 */ + netdev_dummy_get_in4, /* get_in4 */ NULL, /* set_in4 */ NULL, /* get_in6 */ NULL, /* add_router */ @@ -1053,11 +1134,22 @@ netdev_dummy_rxq_drain, }; -static struct ofpbuf * +static void +pkt_list_delete(struct ovs_list *l) +{ + struct pkt_list_node *pkt; + + LIST_FOR_EACH_POP(pkt, list_node, l) { + dp_packet_delete(pkt->pkt); + free(pkt); + } +} + +static struct dp_packet * eth_from_packet_or_flow(const char *s) { enum odp_key_fitness fitness; - struct ofpbuf *packet; + struct dp_packet *packet; struct ofpbuf odp_key; struct flow flow; int error; @@ -1080,13 +1172,13 @@ } /* Convert odp_key to flow. */ - fitness = odp_flow_key_to_flow(ofpbuf_data(&odp_key), ofpbuf_size(&odp_key), &flow); + fitness = odp_flow_key_to_flow(odp_key.data, odp_key.size, &flow); if (fitness == ODP_FIT_ERROR) { ofpbuf_uninit(&odp_key); return NULL; } - packet = ofpbuf_new(0); + packet = dp_packet_new(0); flow_compose(packet, &flow); ofpbuf_uninit(&odp_key); @@ -1094,15 +1186,18 @@ } static void -netdev_dummy_queue_packet__(struct netdev_rxq_dummy *rx, struct ofpbuf *packet) +netdev_dummy_queue_packet__(struct netdev_rxq_dummy *rx, struct dp_packet *packet) { - list_push_back(&rx->recv_queue, &packet->list_node); + struct pkt_list_node *pkt_node = xmalloc(sizeof *pkt_node); + + pkt_node->pkt = packet; + list_push_back(&rx->recv_queue, &pkt_node->list_node); rx->recv_queue_len++; seq_change(rx->seq); } static void -netdev_dummy_queue_packet(struct netdev_dummy *dummy, struct ofpbuf *packet) +netdev_dummy_queue_packet(struct netdev_dummy *dummy, struct dp_packet *packet) OVS_REQUIRES(dummy->mutex) { struct netdev_rxq_dummy *rx, *prev; @@ -1115,7 +1210,7 @@ LIST_FOR_EACH (rx, node, &dummy->rxes) { if (rx->recv_queue_len < NETDEV_DUMMY_MAX_QUEUE) { if (prev) { - netdev_dummy_queue_packet__(prev, ofpbuf_clone(packet)); + netdev_dummy_queue_packet__(prev, dp_packet_clone(packet)); } prev = rx; } @@ -1123,7 +1218,7 @@ if (prev) { netdev_dummy_queue_packet__(prev, packet); } else { - ofpbuf_delete(packet); + dp_packet_delete(packet); } } @@ -1143,7 +1238,7 @@ dummy_dev = netdev_dummy_cast(netdev); for (i = 2; i < argc; i++) { - struct ofpbuf *packet; + struct dp_packet *packet; packet = eth_from_packet_or_flow(argv[i]); if (!packet) { @@ -1219,14 +1314,115 @@ unixctl_command_reply(conn, "OK"); } +static void +display_conn_state__(struct ds *s, const char *name, + enum dummy_netdev_conn_state state) +{ + ds_put_format(s, "%s: ", name); + + switch (state) { + case CONN_STATE_CONNECTED: + ds_put_cstr(s, "connected\n"); + break; + + case CONN_STATE_NOT_CONNECTED: + ds_put_cstr(s, "disconnected\n"); + break; + + case CONN_STATE_UNKNOWN: + default: + ds_put_cstr(s, "unknown\n"); + break; + }; +} + +static void +netdev_dummy_conn_state(struct unixctl_conn *conn, int argc, + const char *argv[], void *aux OVS_UNUSED) +{ + enum dummy_netdev_conn_state state = CONN_STATE_UNKNOWN; + struct ds s; + + ds_init(&s); + + if (argc > 1) { + const char *dev_name = argv[1]; + struct netdev *netdev = netdev_from_name(dev_name); + + if (netdev && is_dummy_class(netdev->netdev_class)) { + struct netdev_dummy *dummy_dev = netdev_dummy_cast(netdev); + + ovs_mutex_lock(&dummy_dev->mutex); + state = dummy_netdev_get_conn_state(&dummy_dev->conn); + ovs_mutex_unlock(&dummy_dev->mutex); + + netdev_close(netdev); + } + display_conn_state__(&s, dev_name, state); + } else { + struct netdev_dummy *netdev; + + ovs_mutex_lock(&dummy_list_mutex); + LIST_FOR_EACH (netdev, list_node, &dummy_list) { + ovs_mutex_lock(&netdev->mutex); + state = dummy_netdev_get_conn_state(&netdev->conn); + ovs_mutex_unlock(&netdev->mutex); + if (state != CONN_STATE_UNKNOWN) { + display_conn_state__(&s, netdev->up.name, state); + } + } + ovs_mutex_unlock(&dummy_list_mutex); + } + + unixctl_command_reply(conn, ds_cstr(&s)); + ds_destroy(&s); +} + +static void +netdev_dummy_ip4addr(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[], void *aux OVS_UNUSED) +{ + struct netdev *netdev = netdev_from_name(argv[1]); + + if (netdev && is_dummy_class(netdev->netdev_class)) { + struct in_addr ip; + uint16_t plen; + + if (ovs_scan(argv[2], IP_SCAN_FMT"/%"SCNi16, + IP_SCAN_ARGS(&ip.s_addr), &plen)) { + struct in_addr mask; + + mask.s_addr = be32_prefix_mask(plen); + netdev_dummy_set_in4(netdev, ip, mask); + unixctl_command_reply(conn, "OK"); + } else { + unixctl_command_reply(conn, "Invalid parameters"); + } + + netdev_close(netdev); + } else { + unixctl_command_reply_error(conn, "Unknown Dummy Interface"); + netdev_close(netdev); + return; + } + +} + void netdev_dummy_register(bool override) { - unixctl_command_register("netdev-dummy/receive", "NAME PACKET|FLOW...", + unixctl_command_register("netdev-dummy/receive", "name packet|flow...", 2, INT_MAX, netdev_dummy_receive, NULL); unixctl_command_register("netdev-dummy/set-admin-state", "[netdev] up|down", 1, 2, netdev_dummy_set_admin_state, NULL); + unixctl_command_register("netdev-dummy/conn-state", + "[netdev]", 0, 1, + netdev_dummy_conn_state, NULL); + unixctl_command_register("netdev-dummy/ip4addr", + "[netdev] ipaddr/mask-prefix-len", 2, 2, + netdev_dummy_ip4addr, NULL); + if (override) { struct sset types; diff -Nru openvswitch-2.3.1/lib/netdev.h openvswitch-2.4.0~git20150623/lib/netdev.h --- openvswitch-2.3.1/lib/netdev.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev.h 2015-06-23 18:46:21.000000000 +0000 @@ -21,6 +21,8 @@ #include #include #include "openvswitch/types.h" +#include "packets.h" +#include "flow.h" #ifdef __cplusplus extern "C" { @@ -59,6 +61,7 @@ * netdev and access each of those from a different thread.) */ +struct dp_packet; struct netdev; struct netdev_class; struct netdev_rxq; @@ -68,6 +71,7 @@ struct in6_addr; struct smap; struct sset; +struct ovs_action_push_tnl; /* Network device statistics. * @@ -117,6 +121,8 @@ ovs_be32 ip_src; ovs_be32 ip_dst; + uint32_t exts; + uint8_t ttl; bool ttl_inherit; @@ -134,6 +140,7 @@ void netdev_enumerate_types(struct sset *types); bool netdev_is_reserved_name(const char *name); +int netdev_n_txq(const struct netdev *netdev); int netdev_n_rxq(const struct netdev *netdev); bool netdev_is_pmd(const struct netdev *netdev); @@ -141,15 +148,17 @@ int netdev_open(const char *name, const char *type, struct netdev **netdevp); struct netdev *netdev_ref(const struct netdev *); +void netdev_remove(struct netdev *); void netdev_close(struct netdev *); void netdev_parse_name(const char *netdev_name, char **name, char **type); /* Options. */ -int netdev_set_config(struct netdev *, const struct smap *args); +int netdev_set_config(struct netdev *, const struct smap *args, char **errp); int netdev_get_config(const struct netdev *, struct smap *); const struct netdev_tunnel_config * netdev_get_tunnel_config(const struct netdev *); +int netdev_get_numa_id(const struct netdev *); /* Basic properties. */ const char *netdev_get_name(const struct netdev *); @@ -158,6 +167,7 @@ int netdev_get_mtu(const struct netdev *, int *mtup); int netdev_set_mtu(const struct netdev *, int mtu); int netdev_get_ifindex(const struct netdev *); +int netdev_set_multiq(struct netdev *, unsigned int n_txq, unsigned int n_rxq); /* Packet reception. */ int netdev_rxq_open(struct netdev *, struct netdev_rxq **, int id); @@ -165,17 +175,27 @@ const char *netdev_rxq_get_name(const struct netdev_rxq *); -int netdev_rxq_recv(struct netdev_rxq *rx, struct ofpbuf **buffers, int *cnt); +int netdev_rxq_recv(struct netdev_rxq *rx, struct dp_packet **buffers, + int *cnt); void netdev_rxq_wait(struct netdev_rxq *); int netdev_rxq_drain(struct netdev_rxq *); /* Packet transmission. */ -int netdev_send(struct netdev *, struct ofpbuf *, bool may_steal); -void netdev_send_wait(struct netdev *); +int netdev_send(struct netdev *, int qid, struct dp_packet **, int cnt, + bool may_steal); +void netdev_send_wait(struct netdev *, int qid); + +int netdev_build_header(const struct netdev *, struct ovs_action_push_tnl *data, + const struct flow *tnl_flow); +int netdev_push_header(const struct netdev *netdev, + struct dp_packet **buffers, int cnt, + const struct ovs_action_push_tnl *data); +int netdev_pop_header(struct netdev *netdev, struct dp_packet **buffers, + int cnt); /* Hardware address. */ -int netdev_set_etheraddr(struct netdev *, const uint8_t mac[6]); -int netdev_get_etheraddr(const struct netdev *, uint8_t mac[6]); +int netdev_set_etheraddr(struct netdev *, const uint8_t mac[ETH_ADDR_LEN]); +int netdev_get_etheraddr(const struct netdev *, uint8_t mac[ETH_ADDR_LEN]); /* PHY interface. */ bool netdev_get_carrier(const struct netdev *); @@ -239,13 +259,13 @@ int netdev_get_next_hop(const struct netdev *, const struct in_addr *host, struct in_addr *next_hop, char **); int netdev_get_status(const struct netdev *, struct smap *); -int netdev_arp_lookup(const struct netdev *, ovs_be32 ip, uint8_t mac[6]); +int netdev_arp_lookup(const struct netdev *, ovs_be32 ip, + uint8_t mac[ETH_ADDR_LEN]); struct netdev *netdev_find_dev_by_in4(const struct in_addr *); /* Statistics. */ int netdev_get_stats(const struct netdev *, struct netdev_stats *); -int netdev_set_stats(struct netdev *, const struct netdev_stats *); /* Quality of service. */ struct netdev_qos_capabilities { @@ -318,7 +338,8 @@ int netdev_dump_queue_stats(const struct netdev *, netdev_dump_queue_stats_cb *, void *aux); -enum { NETDEV_MAX_RX_BATCH = 256 }; /* Maximum number packets in rx_recv() batch. */ +enum { NETDEV_MAX_BURST = 32 }; /* Maximum number packets in a batch. */ +extern struct seq *tnl_conf_seq; #ifdef __cplusplus } diff -Nru openvswitch-2.3.1/lib/netdev-linux.c openvswitch-2.4.0~git20150623/lib/netdev-linux.c --- openvswitch-2.3.1/lib/netdev-linux.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-linux.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,8 @@ #include #include "coverage.h" -#include "dpif-linux.h" +#include "dp-packet.h" +#include "dpif-netlink.h" #include "dpif-netdev.h" #include "dynamic-string.h" #include "fatal-signal.h" @@ -70,7 +72,7 @@ #include "sset.h" #include "timer.h" #include "unaligned.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(netdev_linux); @@ -137,6 +139,46 @@ uint16_t tp_vlan_tpid; }; +/* Linux 2.6.35 introduced IFLA_STATS64 and rtnl_link_stats64. + * + * Tests for rtnl_link_stats64 don't seem to consistently work, e.g. on + * 2.6.32-431.29.2.el6.x86_64 (see report at + * http://openvswitch.org/pipermail/dev/2014-October/047978.html). Maybe + * if_link.h is not self-contained on those kernels. It is easiest to + * unconditionally define a replacement. */ +#ifndef IFLA_STATS64 +#define IFLA_STATS64 23 +#endif +#define rtnl_link_stats64 rpl_rtnl_link_stats64 +struct rtnl_link_stats64 { + uint64_t rx_packets; + uint64_t tx_packets; + uint64_t rx_bytes; + uint64_t tx_bytes; + uint64_t rx_errors; + uint64_t tx_errors; + uint64_t rx_dropped; + uint64_t tx_dropped; + uint64_t multicast; + uint64_t collisions; + + uint64_t rx_length_errors; + uint64_t rx_over_errors; + uint64_t rx_crc_errors; + uint64_t rx_frame_errors; + uint64_t rx_fifo_errors; + uint64_t rx_missed_errors; + + uint64_t tx_aborted_errors; + uint64_t tx_carrier_errors; + uint64_t tx_fifo_errors; + uint64_t tx_heartbeat_errors; + uint64_t tx_window_errors; + + uint64_t rx_compressed; + uint64_t tx_compressed; +}; + enum { VALID_IFINDEX = 1 << 0, VALID_ETHERADDR = 1 << 1, @@ -335,12 +377,18 @@ static const struct tc_ops tc_ops_htb; static const struct tc_ops tc_ops_hfsc; +static const struct tc_ops tc_ops_codel; +static const struct tc_ops tc_ops_fqcodel; +static const struct tc_ops tc_ops_sfq; static const struct tc_ops tc_ops_default; static const struct tc_ops tc_ops_other; static const struct tc_ops *const tcs[] = { &tc_ops_htb, /* Hierarchy token bucket (see tc-htb(8)). */ &tc_ops_hfsc, /* Hierarchical fair service curve. */ + &tc_ops_codel, /* Controlled delay */ + &tc_ops_fqcodel, /* Fair queue controlled delay */ + &tc_ops_sfq, /* Stochastic fair queueing */ &tc_ops_default, /* Default qdisc (see tc-pfifo_fast(8)). */ &tc_ops_other, /* Some other qdisc. */ NULL @@ -358,8 +406,8 @@ unsigned int flags, struct ofpbuf *); static int tc_transact(struct ofpbuf *request, struct ofpbuf **replyp); static int tc_add_del_ingress_qdisc(struct netdev *netdev, bool add); -static int tc_add_policer(struct netdev *netdev, int kbits_rate, - int kbits_burst); +static int tc_add_policer(struct netdev *, + uint32_t kbits_rate, uint32_t kbits_burst); static int tc_parse_qdisc(const struct ofpbuf *, const char **kind, struct nlattr **options); @@ -434,8 +482,11 @@ /* Polling miimon status for all ports causes performance degradation when * handling a large number of ports. If there are no devices using miimon, then - * we skip netdev_linux_miimon_run() and netdev_linux_miimon_wait(). */ -static atomic_int miimon_cnt = ATOMIC_VAR_INIT(0); + * we skip netdev_linux_miimon_run() and netdev_linux_miimon_wait(). + * + * Readers do not depend on this variable synchronizing with the related + * changes in the device miimon status, so we can use atomic_count. */ +static atomic_count miimon_cnt = ATOMIC_COUNT_INIT(0); static void netdev_linux_run(void); @@ -524,10 +575,7 @@ static bool netdev_linux_miimon_enabled(void) { - int miimon; - - atomic_read(&miimon_cnt, &miimon); - return miimon > 0; + return atomic_count_get(&miimon_cnt) > 0; } static void @@ -757,8 +805,7 @@ } if (netdev->miimon_interval > 0) { - int junk; - atomic_sub(&miimon_cnt, 1, &junk); + atomic_count_dec(&miimon_cnt); } ovs_mutex_destroy(&netdev->mutex); @@ -901,7 +948,7 @@ } static int -netdev_linux_rxq_recv_sock(int fd, struct ofpbuf *buffer) +netdev_linux_rxq_recv_sock(int fd, struct dp_packet *buffer) { size_t size; ssize_t retval; @@ -914,10 +961,10 @@ struct msghdr msgh; /* Reserve headroom for a single VLAN tag */ - ofpbuf_reserve(buffer, VLAN_HEADER_LEN); - size = ofpbuf_tailroom(buffer); + dp_packet_reserve(buffer, VLAN_HEADER_LEN); + size = dp_packet_tailroom(buffer); - iov.iov_base = ofpbuf_data(buffer); + iov.iov_base = dp_packet_data(buffer); iov.iov_len = size; msgh.msg_name = NULL; msgh.msg_namelen = 0; @@ -937,7 +984,7 @@ return EMSGSIZE; } - ofpbuf_set_size(buffer, ofpbuf_size(buffer) + retval); + dp_packet_set_size(buffer, dp_packet_size(buffer) + retval); for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg; cmsg = CMSG_NXTHDR(&msgh, cmsg)) { const struct tpacket_auxdata *aux; @@ -964,13 +1011,13 @@ } static int -netdev_linux_rxq_recv_tap(int fd, struct ofpbuf *buffer) +netdev_linux_rxq_recv_tap(int fd, struct dp_packet *buffer) { ssize_t retval; - size_t size = ofpbuf_tailroom(buffer); + size_t size = dp_packet_tailroom(buffer); do { - retval = read(fd, ofpbuf_data(buffer), size); + retval = read(fd, dp_packet_data(buffer), size); } while (retval < 0 && errno == EINTR); if (retval < 0) { @@ -979,16 +1026,17 @@ return EMSGSIZE; } - ofpbuf_set_size(buffer, ofpbuf_size(buffer) + retval); + dp_packet_set_size(buffer, dp_packet_size(buffer) + retval); return 0; } static int -netdev_linux_rxq_recv(struct netdev_rxq *rxq_, struct ofpbuf **packet, int *c) +netdev_linux_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets, + int *c) { struct netdev_rxq_linux *rx = netdev_rxq_linux_cast(rxq_); struct netdev *netdev = rx->up.netdev; - struct ofpbuf *buffer; + struct dp_packet *buffer; ssize_t retval; int mtu; @@ -996,8 +1044,8 @@ mtu = ETH_PAYLOAD_MAX; } - buffer = ofpbuf_new_with_headroom(VLAN_ETH_HEADER_LEN + mtu, DP_NETDEV_HEADROOM); - + buffer = dp_packet_new_with_headroom(VLAN_ETH_HEADER_LEN + mtu, + DP_NETDEV_HEADROOM); retval = (rx->is_tap ? netdev_linux_rxq_recv_tap(rx->fd, buffer) : netdev_linux_rxq_recv_sock(rx->fd, buffer)); @@ -1007,10 +1055,11 @@ VLOG_WARN_RL(&rl, "error receiving Ethernet packet on %s: %s", ovs_strerror(errno), netdev_rxq_get_name(rxq_)); } - ofpbuf_delete(buffer); + dp_packet_delete(buffer); } else { dp_packet_pad(buffer); - packet[0] = buffer; + dp_packet_set_rss_hash(buffer, 0); + packets[0] = buffer; *c = 1; } @@ -1052,12 +1101,16 @@ * The kernel maintains a packet transmission queue, so the caller is not * expected to do additional queuing of packets. */ static int -netdev_linux_send(struct netdev *netdev_, struct ofpbuf *pkt, bool may_steal) +netdev_linux_send(struct netdev *netdev_, int qid OVS_UNUSED, + struct dp_packet **pkts, int cnt, bool may_steal) { - const void *data = ofpbuf_data(pkt); - size_t size = ofpbuf_size(pkt); + int i; + int error = 0; - for (;;) { + /* 'i' is incremented only if there's no error */ + for (i = 0; i < cnt;) { + const void *data = dp_packet_data(pkts[i]); + size_t size = dp_packet_size(pkts[i]); ssize_t retval; if (!is_tap_netdev(netdev_)) { @@ -1107,31 +1160,41 @@ retval = write(netdev->tap_fd, data, size); } - if (may_steal) { - ofpbuf_delete(pkt); - } - if (retval < 0) { /* The Linux AF_PACKET implementation never blocks waiting for room * for packets, instead returning ENOBUFS. Translate this into * EAGAIN for the caller. */ - if (errno == ENOBUFS) { - return EAGAIN; - } else if (errno == EINTR) { + error = errno == ENOBUFS ? EAGAIN : errno; + if (error == EINTR) { + /* continue without incrementing 'i', i.e. retry this packet */ continue; - } else if (errno != EAGAIN) { - VLOG_WARN_RL(&rl, "error sending Ethernet packet on %s: %s", - netdev_get_name(netdev_), ovs_strerror(errno)); } - return errno; + break; } else if (retval != size) { - VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%"PRIuSIZE" bytes of " - "%"PRIuSIZE") on %s", retval, size, netdev_get_name(netdev_)); - return EMSGSIZE; - } else { - return 0; + VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%"PRIuSIZE" bytes" + " of %"PRIuSIZE") on %s", retval, size, + netdev_get_name(netdev_)); + error = EMSGSIZE; + break; + } + + /* Process the next packet in the batch */ + i++; + } + + if (may_steal) { + for (i = 0; i < cnt; i++) { + dp_packet_delete(pkts[i]); } } + + if (error && error != EAGAIN) { + VLOG_WARN_RL(&rl, "error sending Ethernet packet on %s: %s", + netdev_get_name(netdev_), ovs_strerror(error)); + } + + return error; + } /* Registers with the poll loop to wake up from the next call to poll_block() @@ -1142,7 +1205,7 @@ * expected to do additional queuing of packets. Thus, this function is * unlikely to ever be used. It is included for completeness. */ static void -netdev_linux_send_wait(struct netdev *netdev) +netdev_linux_send_wait(struct netdev *netdev, int qid OVS_UNUSED) { if (is_tap_netdev(netdev)) { /* TAP device always accepts packets.*/ @@ -1397,12 +1460,10 @@ ovs_mutex_lock(&netdev->mutex); interval = interval > 0 ? MAX(interval, 100) : 0; if (netdev->miimon_interval != interval) { - int junk; - if (interval && !netdev->miimon_interval) { - atomic_add(&miimon_cnt, 1, &junk); + atomic_count_inc(&miimon_cnt); } else if (!interval && netdev->miimon_interval) { - atomic_sub(&miimon_cnt, 1, &junk); + atomic_count_dec(&miimon_cnt); } netdev->miimon_interval = interval; @@ -1480,14 +1541,14 @@ netdev_stats_from_ovs_vport_stats(struct netdev_stats *dst, const struct ovs_vport_stats *src) { - dst->rx_packets = get_unaligned_u64(&src->rx_packets); - dst->tx_packets = get_unaligned_u64(&src->tx_packets); - dst->rx_bytes = get_unaligned_u64(&src->rx_bytes); - dst->tx_bytes = get_unaligned_u64(&src->tx_bytes); - dst->rx_errors = get_unaligned_u64(&src->rx_errors); - dst->tx_errors = get_unaligned_u64(&src->tx_errors); - dst->rx_dropped = get_unaligned_u64(&src->rx_dropped); - dst->tx_dropped = get_unaligned_u64(&src->tx_dropped); + dst->rx_packets = get_32aligned_u64(&src->rx_packets); + dst->tx_packets = get_32aligned_u64(&src->tx_packets); + dst->rx_bytes = get_32aligned_u64(&src->rx_bytes); + dst->tx_bytes = get_32aligned_u64(&src->tx_bytes); + dst->rx_errors = get_32aligned_u64(&src->rx_errors); + dst->tx_errors = get_32aligned_u64(&src->tx_errors); + dst->rx_dropped = get_32aligned_u64(&src->rx_dropped); + dst->tx_dropped = get_32aligned_u64(&src->tx_dropped); dst->multicast = 0; dst->collisions = 0; dst->rx_length_errors = 0; @@ -1506,11 +1567,11 @@ static int get_stats_via_vport__(const struct netdev *netdev, struct netdev_stats *stats) { - struct dpif_linux_vport reply; + struct dpif_netlink_vport reply; struct ofpbuf *buf; int error; - error = dpif_linux_vport_get(netdev_get_name(netdev), &reply, &buf); + error = dpif_netlink_vport_get(netdev_get_name(netdev), &reply, &buf); if (error) { return error; } else if (!reply.stats) { @@ -1674,41 +1735,6 @@ return error; } -static int -netdev_internal_set_stats(struct netdev *netdev, - const struct netdev_stats *stats) -{ - struct ovs_vport_stats vport_stats; - struct dpif_linux_vport vport; - int err; - - vport_stats.rx_packets = stats->rx_packets; - vport_stats.tx_packets = stats->tx_packets; - vport_stats.rx_bytes = stats->rx_bytes; - vport_stats.tx_bytes = stats->tx_bytes; - vport_stats.rx_errors = stats->rx_errors; - vport_stats.tx_errors = stats->tx_errors; - vport_stats.rx_dropped = stats->rx_dropped; - vport_stats.tx_dropped = stats->tx_dropped; - - dpif_linux_vport_init(&vport); - vport.cmd = OVS_VPORT_CMD_SET; - vport.name = netdev_get_name(netdev); - vport.stats = &vport_stats; - - err = dpif_linux_vport_transact(&vport, NULL, NULL); - - /* If the vport layer doesn't know about the device, that doesn't mean it - * doesn't exist (after all were able to open it when netdev_open() was - * called), it just means that it isn't attached and we'll be getting - * stats a different way. */ - if (err == ENODEV) { - err = EOPNOTSUPP; - } - - return err; -} - static void netdev_linux_read_features(struct netdev_linux *netdev) { @@ -2717,7 +2743,7 @@ return error; } -#define NETDEV_LINUX_CLASS(NAME, CONSTRUCT, GET_STATS, SET_STATS, \ +#define NETDEV_LINUX_CLASS(NAME, CONSTRUCT, GET_STATS, \ GET_FEATURES, GET_STATUS) \ { \ NAME, \ @@ -2733,6 +2759,11 @@ NULL, /* get_config */ \ NULL, /* set_config */ \ NULL, /* get_tunnel_config */ \ + NULL, /* build header */ \ + NULL, /* push header */ \ + NULL, /* pop header */ \ + NULL, /* get_numa_id */ \ + NULL, /* set_multiq */ \ \ netdev_linux_send, \ netdev_linux_send_wait, \ @@ -2746,7 +2777,6 @@ netdev_linux_get_carrier_resets, \ netdev_linux_set_miimon_interval, \ GET_STATS, \ - SET_STATS, \ \ GET_FEATURES, \ netdev_linux_set_advertisements, \ @@ -2789,7 +2819,6 @@ "system", netdev_linux_construct, netdev_linux_get_stats, - NULL, /* set_stats */ netdev_linux_get_features, netdev_linux_get_status); @@ -2798,7 +2827,6 @@ "tap", netdev_linux_construct_tap, netdev_tap_get_stats, - NULL, /* set_stats */ netdev_linux_get_features, netdev_linux_get_status); @@ -2807,13 +2835,669 @@ "internal", netdev_linux_construct, netdev_internal_get_stats, - netdev_internal_set_stats, NULL, /* get_features */ netdev_internal_get_status); + +#define CODEL_N_QUEUES 0x0000 + +/* In sufficiently new kernel headers these are defined as enums in + * . Define them here as macros to help out with older + * kernels. (This overrides any enum definition in the header file but that's + * harmless.) */ +#define TCA_CODEL_TARGET 1 +#define TCA_CODEL_LIMIT 2 +#define TCA_CODEL_INTERVAL 3 + +struct codel { + struct tc tc; + uint32_t target; + uint32_t limit; + uint32_t interval; +}; + +static struct codel * +codel_get__(const struct netdev *netdev_) +{ + struct netdev_linux *netdev = netdev_linux_cast(netdev_); + return CONTAINER_OF(netdev->tc, struct codel, tc); +} + +static void +codel_install__(struct netdev *netdev_, uint32_t target, uint32_t limit, + uint32_t interval) +{ + struct netdev_linux *netdev = netdev_linux_cast(netdev_); + struct codel *codel; + + codel = xmalloc(sizeof *codel); + tc_init(&codel->tc, &tc_ops_codel); + codel->target = target; + codel->limit = limit; + codel->interval = interval; + + netdev->tc = &codel->tc; +} + +static int +codel_setup_qdisc__(struct netdev *netdev, uint32_t target, uint32_t limit, + uint32_t interval) +{ + size_t opt_offset; + struct ofpbuf request; + struct tcmsg *tcmsg; + uint32_t otarget, olimit, ointerval; + int error; + + tc_del_qdisc(netdev); + + tcmsg = tc_make_request(netdev, RTM_NEWQDISC, + NLM_F_EXCL | NLM_F_CREATE, &request); + if (!tcmsg) { + return ENODEV; + } + tcmsg->tcm_handle = tc_make_handle(1, 0); + tcmsg->tcm_parent = TC_H_ROOT; + + otarget = target ? target : 5000; + olimit = limit ? limit : 10240; + ointerval = interval ? interval : 100000; + + nl_msg_put_string(&request, TCA_KIND, "codel"); + opt_offset = nl_msg_start_nested(&request, TCA_OPTIONS); + nl_msg_put_u32(&request, TCA_CODEL_TARGET, otarget); + nl_msg_put_u32(&request, TCA_CODEL_LIMIT, olimit); + nl_msg_put_u32(&request, TCA_CODEL_INTERVAL, ointerval); + nl_msg_end_nested(&request, opt_offset); + + error = tc_transact(&request, NULL); + if (error) { + VLOG_WARN_RL(&rl, "failed to replace %s qdisc, " + "target %u, limit %u, interval %u error %d(%s)", + netdev_get_name(netdev), + otarget, olimit, ointerval, + error, ovs_strerror(error)); + } + return error; +} + +static void +codel_parse_qdisc_details__(struct netdev *netdev OVS_UNUSED, + const struct smap *details, struct codel *codel) +{ + const char *target_s; + const char *limit_s; + const char *interval_s; + + target_s = smap_get(details, "target"); + limit_s = smap_get(details, "limit"); + interval_s = smap_get(details, "interval"); + + codel->target = target_s ? strtoull(target_s, NULL, 10) : 0; + codel->limit = limit_s ? strtoull(limit_s, NULL, 10) : 0; + codel->interval = interval_s ? strtoull(interval_s, NULL, 10) : 0; + + if (!codel->target) { + codel->target = 5000; + } + if (!codel->limit) { + codel->limit = 10240; + } + if (!codel->interval) { + codel->interval = 100000; + } +} + +static int +codel_tc_install(struct netdev *netdev, const struct smap *details) +{ + int error; + struct codel codel; + + codel_parse_qdisc_details__(netdev, details, &codel); + error = codel_setup_qdisc__(netdev, codel.target, codel.limit, + codel.interval); + if (!error) { + codel_install__(netdev, codel.target, codel.limit, codel.interval); + } + return error; +} + +static int +codel_parse_tca_options__(struct nlattr *nl_options, struct codel *codel) +{ + static const struct nl_policy tca_codel_policy[] = { + [TCA_CODEL_TARGET] = { .type = NL_A_U32 }, + [TCA_CODEL_LIMIT] = { .type = NL_A_U32 }, + [TCA_CODEL_INTERVAL] = { .type = NL_A_U32 } + }; + + struct nlattr *attrs[ARRAY_SIZE(tca_codel_policy)]; + + if (!nl_parse_nested(nl_options, tca_codel_policy, + attrs, ARRAY_SIZE(tca_codel_policy))) { + VLOG_WARN_RL(&rl, "failed to parse CoDel class options"); + return EPROTO; + } + + codel->target = nl_attr_get_u32(attrs[TCA_CODEL_TARGET]); + codel->limit = nl_attr_get_u32(attrs[TCA_CODEL_LIMIT]); + codel->interval = nl_attr_get_u32(attrs[TCA_CODEL_INTERVAL]); + return 0; +} + +static int +codel_tc_load(struct netdev *netdev, struct ofpbuf *nlmsg) +{ + struct nlattr *nlattr; + const char * kind; + int error; + struct codel codel; + + error = tc_parse_qdisc(nlmsg, &kind, &nlattr); + if (error != 0) { + return error; + } + + error = codel_parse_tca_options__(nlattr, &codel); + if (error != 0) { + return error; + } + + codel_install__(netdev, codel.target, codel.limit, codel.interval); + return 0; +} + + +static void +codel_tc_destroy(struct tc *tc) +{ + struct codel *codel = CONTAINER_OF(tc, struct codel, tc); + tc_destroy(tc); + free(codel); +} + +static int +codel_qdisc_get(const struct netdev *netdev, struct smap *details) +{ + const struct codel *codel = codel_get__(netdev); + smap_add_format(details, "target", "%u", codel->target); + smap_add_format(details, "limit", "%u", codel->limit); + smap_add_format(details, "interval", "%u", codel->interval); + return 0; +} + +static int +codel_qdisc_set(struct netdev *netdev, const struct smap *details) +{ + struct codel codel; + + codel_parse_qdisc_details__(netdev, details, &codel); + codel_install__(netdev, codel.target, codel.limit, codel.interval); + codel_get__(netdev)->target = codel.target; + codel_get__(netdev)->limit = codel.limit; + codel_get__(netdev)->interval = codel.interval; + return 0; +} + +static const struct tc_ops tc_ops_codel = { + "codel", /* linux_name */ + "linux-codel", /* ovs_name */ + CODEL_N_QUEUES, /* n_queues */ + codel_tc_install, + codel_tc_load, + codel_tc_destroy, + codel_qdisc_get, + codel_qdisc_set, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +/* FQ-CoDel traffic control class. */ + +#define FQCODEL_N_QUEUES 0x0000 + +/* In sufficiently new kernel headers these are defined as enums in + * . Define them here as macros to help out with older + * kernels. (This overrides any enum definition in the header file but that's + * harmless.) */ +#define TCA_FQ_CODEL_TARGET 1 +#define TCA_FQ_CODEL_LIMIT 2 +#define TCA_FQ_CODEL_INTERVAL 3 +#define TCA_FQ_CODEL_ECN 4 +#define TCA_FQ_CODEL_FLOWS 5 +#define TCA_FQ_CODEL_QUANTUM 6 + +struct fqcodel { + struct tc tc; + uint32_t target; + uint32_t limit; + uint32_t interval; + uint32_t flows; + uint32_t quantum; +}; + +static struct fqcodel * +fqcodel_get__(const struct netdev *netdev_) +{ + struct netdev_linux *netdev = netdev_linux_cast(netdev_); + return CONTAINER_OF(netdev->tc, struct fqcodel, tc); +} + +static void +fqcodel_install__(struct netdev *netdev_, uint32_t target, uint32_t limit, + uint32_t interval, uint32_t flows, uint32_t quantum) +{ + struct netdev_linux *netdev = netdev_linux_cast(netdev_); + struct fqcodel *fqcodel; + + fqcodel = xmalloc(sizeof *fqcodel); + tc_init(&fqcodel->tc, &tc_ops_fqcodel); + fqcodel->target = target; + fqcodel->limit = limit; + fqcodel->interval = interval; + fqcodel->flows = flows; + fqcodel->quantum = quantum; + + netdev->tc = &fqcodel->tc; +} + +static int +fqcodel_setup_qdisc__(struct netdev *netdev, uint32_t target, uint32_t limit, + uint32_t interval, uint32_t flows, uint32_t quantum) +{ + size_t opt_offset; + struct ofpbuf request; + struct tcmsg *tcmsg; + uint32_t otarget, olimit, ointerval, oflows, oquantum; + int error; + + tc_del_qdisc(netdev); + + tcmsg = tc_make_request(netdev, RTM_NEWQDISC, + NLM_F_EXCL | NLM_F_CREATE, &request); + if (!tcmsg) { + return ENODEV; + } + tcmsg->tcm_handle = tc_make_handle(1, 0); + tcmsg->tcm_parent = TC_H_ROOT; + + otarget = target ? target : 5000; + olimit = limit ? limit : 10240; + ointerval = interval ? interval : 100000; + oflows = flows ? flows : 1024; + oquantum = quantum ? quantum : 1514; /* fq_codel default quantum is 1514 + not mtu */ + + nl_msg_put_string(&request, TCA_KIND, "fq_codel"); + opt_offset = nl_msg_start_nested(&request, TCA_OPTIONS); + nl_msg_put_u32(&request, TCA_FQ_CODEL_TARGET, otarget); + nl_msg_put_u32(&request, TCA_FQ_CODEL_LIMIT, olimit); + nl_msg_put_u32(&request, TCA_FQ_CODEL_INTERVAL, ointerval); + nl_msg_put_u32(&request, TCA_FQ_CODEL_FLOWS, oflows); + nl_msg_put_u32(&request, TCA_FQ_CODEL_QUANTUM, oquantum); + nl_msg_end_nested(&request, opt_offset); + + error = tc_transact(&request, NULL); + if (error) { + VLOG_WARN_RL(&rl, "failed to replace %s qdisc, " + "target %u, limit %u, interval %u, flows %u, quantum %u error %d(%s)", + netdev_get_name(netdev), + otarget, olimit, ointerval, oflows, oquantum, + error, ovs_strerror(error)); + } + return error; +} + +static void +fqcodel_parse_qdisc_details__(struct netdev *netdev OVS_UNUSED, + const struct smap *details, struct fqcodel *fqcodel) +{ + const char *target_s; + const char *limit_s; + const char *interval_s; + const char *flows_s; + const char *quantum_s; + + target_s = smap_get(details, "target"); + limit_s = smap_get(details, "limit"); + interval_s = smap_get(details, "interval"); + flows_s = smap_get(details, "flows"); + quantum_s = smap_get(details, "quantum"); + fqcodel->target = target_s ? strtoull(target_s, NULL, 10) : 0; + fqcodel->limit = limit_s ? strtoull(limit_s, NULL, 10) : 0; + fqcodel->interval = interval_s ? strtoull(interval_s, NULL, 10) : 0; + fqcodel->flows = flows_s ? strtoull(flows_s, NULL, 10) : 0; + fqcodel->quantum = quantum_s ? strtoull(quantum_s, NULL, 10) : 0; + if (!fqcodel->target) { + fqcodel->target = 5000; + } + if (!fqcodel->limit) { + fqcodel->limit = 10240; + } + if (!fqcodel->interval) { + fqcodel->interval = 1000000; + } + if (!fqcodel->flows) { + fqcodel->flows = 1024; + } + if (!fqcodel->quantum) { + fqcodel->quantum = 1514; + } +} + +static int +fqcodel_tc_install(struct netdev *netdev, const struct smap *details) +{ + int error; + struct fqcodel fqcodel; + + fqcodel_parse_qdisc_details__(netdev, details, &fqcodel); + error = fqcodel_setup_qdisc__(netdev, fqcodel.target, fqcodel.limit, + fqcodel.interval, fqcodel.flows, + fqcodel.quantum); + if (!error) { + fqcodel_install__(netdev, fqcodel.target, fqcodel.limit, + fqcodel.interval, fqcodel.flows, fqcodel.quantum); + } + return error; +} + +static int +fqcodel_parse_tca_options__(struct nlattr *nl_options, struct fqcodel *fqcodel) +{ + static const struct nl_policy tca_fqcodel_policy[] = { + [TCA_FQ_CODEL_TARGET] = { .type = NL_A_U32 }, + [TCA_FQ_CODEL_LIMIT] = { .type = NL_A_U32 }, + [TCA_FQ_CODEL_INTERVAL] = { .type = NL_A_U32 }, + [TCA_FQ_CODEL_FLOWS] = { .type = NL_A_U32 }, + [TCA_FQ_CODEL_QUANTUM] = { .type = NL_A_U32 } + }; + + struct nlattr *attrs[ARRAY_SIZE(tca_fqcodel_policy)]; + + if (!nl_parse_nested(nl_options, tca_fqcodel_policy, + attrs, ARRAY_SIZE(tca_fqcodel_policy))) { + VLOG_WARN_RL(&rl, "failed to parse FQ_CoDel class options"); + return EPROTO; + } + + fqcodel->target = nl_attr_get_u32(attrs[TCA_FQ_CODEL_TARGET]); + fqcodel->limit = nl_attr_get_u32(attrs[TCA_FQ_CODEL_LIMIT]); + fqcodel->interval =nl_attr_get_u32(attrs[TCA_FQ_CODEL_INTERVAL]); + fqcodel->flows = nl_attr_get_u32(attrs[TCA_FQ_CODEL_FLOWS]); + fqcodel->quantum = nl_attr_get_u32(attrs[TCA_FQ_CODEL_QUANTUM]); + return 0; +} + +static int +fqcodel_tc_load(struct netdev *netdev, struct ofpbuf *nlmsg) +{ + struct nlattr *nlattr; + const char * kind; + int error; + struct fqcodel fqcodel; + + error = tc_parse_qdisc(nlmsg, &kind, &nlattr); + if (error != 0) { + return error; + } + + error = fqcodel_parse_tca_options__(nlattr, &fqcodel); + if (error != 0) { + return error; + } + + fqcodel_install__(netdev, fqcodel.target, fqcodel.limit, fqcodel.interval, + fqcodel.flows, fqcodel.quantum); + return 0; +} + +static void +fqcodel_tc_destroy(struct tc *tc) +{ + struct fqcodel *fqcodel = CONTAINER_OF(tc, struct fqcodel, tc); + tc_destroy(tc); + free(fqcodel); +} + +static int +fqcodel_qdisc_get(const struct netdev *netdev, struct smap *details) +{ + const struct fqcodel *fqcodel = fqcodel_get__(netdev); + smap_add_format(details, "target", "%u", fqcodel->target); + smap_add_format(details, "limit", "%u", fqcodel->limit); + smap_add_format(details, "interval", "%u", fqcodel->interval); + smap_add_format(details, "flows", "%u", fqcodel->flows); + smap_add_format(details, "quantum", "%u", fqcodel->quantum); + return 0; +} + +static int +fqcodel_qdisc_set(struct netdev *netdev, const struct smap *details) +{ + struct fqcodel fqcodel; + + fqcodel_parse_qdisc_details__(netdev, details, &fqcodel); + fqcodel_install__(netdev, fqcodel.target, fqcodel.limit, fqcodel.interval, + fqcodel.flows, fqcodel.quantum); + fqcodel_get__(netdev)->target = fqcodel.target; + fqcodel_get__(netdev)->limit = fqcodel.limit; + fqcodel_get__(netdev)->interval = fqcodel.interval; + fqcodel_get__(netdev)->flows = fqcodel.flows; + fqcodel_get__(netdev)->quantum = fqcodel.quantum; + return 0; +} + +static const struct tc_ops tc_ops_fqcodel = { + "fq_codel", /* linux_name */ + "linux-fq_codel", /* ovs_name */ + FQCODEL_N_QUEUES, /* n_queues */ + fqcodel_tc_install, + fqcodel_tc_load, + fqcodel_tc_destroy, + fqcodel_qdisc_get, + fqcodel_qdisc_set, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +/* SFQ traffic control class. */ + +#define SFQ_N_QUEUES 0x0000 + +struct sfq { + struct tc tc; + uint32_t quantum; + uint32_t perturb; +}; + +static struct sfq * +sfq_get__(const struct netdev *netdev_) +{ + struct netdev_linux *netdev = netdev_linux_cast(netdev_); + return CONTAINER_OF(netdev->tc, struct sfq, tc); +} + +static void +sfq_install__(struct netdev *netdev_, uint32_t quantum, uint32_t perturb) +{ + struct netdev_linux *netdev = netdev_linux_cast(netdev_); + struct sfq *sfq; + + sfq = xmalloc(sizeof *sfq); + tc_init(&sfq->tc, &tc_ops_sfq); + sfq->perturb = perturb; + sfq->quantum = quantum; + + netdev->tc = &sfq->tc; +} + +static int +sfq_setup_qdisc__(struct netdev *netdev, uint32_t quantum, uint32_t perturb) +{ + struct tc_sfq_qopt opt; + struct ofpbuf request; + struct tcmsg *tcmsg; + int mtu; + int mtu_error, error; + mtu_error = netdev_linux_get_mtu__(netdev_linux_cast(netdev), &mtu); + + tc_del_qdisc(netdev); + + tcmsg = tc_make_request(netdev, RTM_NEWQDISC, + NLM_F_EXCL | NLM_F_CREATE, &request); + if (!tcmsg) { + return ENODEV; + } + tcmsg->tcm_handle = tc_make_handle(1, 0); + tcmsg->tcm_parent = TC_H_ROOT; + + memset(&opt, 0, sizeof opt); + if (!quantum) { + if (!mtu_error) { + opt.quantum = mtu; /* if we cannot find mtu, use default */ + } + } else { + opt.quantum = quantum; + } + + if (!perturb) { + opt.perturb_period = 10; + } else { + opt.perturb_period = perturb; + } + + nl_msg_put_string(&request, TCA_KIND, "sfq"); + nl_msg_put_unspec(&request, TCA_OPTIONS, &opt, sizeof opt); + + error = tc_transact(&request, NULL); + if (error) { + VLOG_WARN_RL(&rl, "failed to replace %s qdisc, " + "quantum %u, perturb %u error %d(%s)", + netdev_get_name(netdev), + opt.quantum, opt.perturb_period, + error, ovs_strerror(error)); + } + return error; +} + +static void +sfq_parse_qdisc_details__(struct netdev *netdev, + const struct smap *details, struct sfq *sfq) +{ + const char *perturb_s; + const char *quantum_s; + int mtu; + int mtu_error; + + perturb_s = smap_get(details, "perturb"); + quantum_s = smap_get(details, "quantum"); + sfq->perturb = perturb_s ? strtoull(perturb_s, NULL, 10) : 0; + sfq->quantum = quantum_s ? strtoull(quantum_s, NULL, 10) : 0; + if (!sfq->perturb) { + sfq->perturb = 10; + } + + if (!sfq->quantum) { + mtu_error = netdev_linux_get_mtu__(netdev_linux_cast(netdev), &mtu); + if (!mtu_error) { + sfq->quantum = mtu; + } else { + VLOG_WARN_RL(&rl, "when using SFQ, you must specify quantum on a " + "device without mtu"); + return; + } + } +} + +static int +sfq_tc_install(struct netdev *netdev, const struct smap *details) +{ + int error; + struct sfq sfq; + + sfq_parse_qdisc_details__(netdev, details, &sfq); + error = sfq_setup_qdisc__(netdev, sfq.quantum, sfq.perturb); + if (!error) { + sfq_install__(netdev, sfq.quantum, sfq.perturb); + } + return error; +} + +static int +sfq_tc_load(struct netdev *netdev, struct ofpbuf *nlmsg) +{ + const struct tc_sfq_qopt *sfq; + struct nlattr *nlattr; + const char * kind; + int error; + + error = tc_parse_qdisc(nlmsg, &kind, &nlattr); + if (error == 0) { + sfq = nl_attr_get(nlattr); + sfq_install__(netdev, sfq->perturb_period, sfq->quantum); + return 0; + } + + return error; +} + +static void +sfq_tc_destroy(struct tc *tc) +{ + struct sfq *sfq = CONTAINER_OF(tc, struct sfq, tc); + tc_destroy(tc); + free(sfq); +} + +static int +sfq_qdisc_get(const struct netdev *netdev, struct smap *details) +{ + const struct sfq *sfq = sfq_get__(netdev); + smap_add_format(details, "quantum", "%u", sfq->quantum); + smap_add_format(details, "perturb", "%u", sfq->perturb); + return 0; +} + +static int +sfq_qdisc_set(struct netdev *netdev, const struct smap *details) +{ + struct sfq sfq; + + sfq_parse_qdisc_details__(netdev, details, &sfq); + sfq_install__(netdev, sfq.quantum, sfq.perturb); + sfq_get__(netdev)->quantum = sfq.quantum; + sfq_get__(netdev)->perturb = sfq.perturb; + return 0; +} + +static const struct tc_ops tc_ops_sfq = { + "sfq", /* linux_name */ + "linux-sfq", /* ovs_name */ + SFQ_N_QUEUES, /* n_queues */ + sfq_tc_install, + sfq_tc_load, + sfq_tc_destroy, + sfq_qdisc_get, + sfq_qdisc_set, + NULL, + NULL, + NULL, + NULL, + NULL +}; + /* HTB traffic control class. */ #define HTB_N_QUEUES 0xf000 +#define HTB_RATE2QUANTUM 10 struct htb { struct tc tc; @@ -2872,7 +3556,7 @@ nl_msg_put_string(&request, TCA_KIND, "htb"); memset(&opt, 0, sizeof opt); - opt.rate2quantum = 10; + opt.rate2quantum = HTB_RATE2QUANTUM; opt.version = 3; opt.defcls = 1; @@ -2906,6 +3590,11 @@ memset(&opt, 0, sizeof opt); tc_fill_rate(&opt.rate, class->min_rate, mtu); tc_fill_rate(&opt.ceil, class->max_rate, mtu); + /* Makes sure the quantum is at least MTU. Setting quantum will + * make htb ignore the r2q for this class. */ + if ((class->min_rate / HTB_RATE2QUANTUM) < mtu) { + opt.quantum = mtu; + } opt.buffer = tc_calc_buffer(opt.rate.rate, mtu, class->burst); opt.cbuffer = tc_calc_buffer(opt.ceil.rate, mtu, class->burst); opt.prio = class->priority; @@ -4008,12 +4697,13 @@ * mtu 65535 drop * * The configuration and stats may be seen with the following command: - * /sbin/tc -s filter show eth0 parent ffff: + * /sbin/tc -s filter show dev parent ffff: * * Returns 0 if successful, otherwise a positive errno value. */ static int -tc_add_policer(struct netdev *netdev, int kbits_rate, int kbits_burst) +tc_add_policer(struct netdev *netdev, + uint32_t kbits_rate, uint32_t kbits_burst) { struct tc_police tc_police; struct ofpbuf request; @@ -4027,8 +4717,22 @@ tc_police.action = TC_POLICE_SHOT; tc_police.mtu = mtu; tc_fill_rate(&tc_police.rate, ((uint64_t) kbits_rate * 1000)/8, mtu); - tc_police.burst = tc_bytes_to_ticks(tc_police.rate.rate, - kbits_burst * 1024); + + /* The following appears wrong in two ways: + * + * - tc_bytes_to_ticks() should take "bytes" as quantity for both of its + * arguments (or at least consistently "bytes" as both or "bits" as + * both), but this supplies bytes for the first argument and bits for the + * second. + * + * - In networking a kilobit is usually 1000 bits but this uses 1024 bits. + * + * However if you "fix" those problems then "tc filter show ..." shows + * "125000b", meaning 125,000 bits, when OVS configures it for 1000 kbit == + * 1,000,000 bits, whereas this actually ends up doing the right thing from + * tc's point of view. Whatever. */ + tc_police.burst = tc_bytes_to_ticks( + tc_police.rate.rate, MIN(UINT32_MAX / 1024, kbits_burst) * 1024); tcmsg = tc_make_request(netdev, RTM_NEWTFILTER, NLM_F_EXCL | NLM_F_CREATE, &request); @@ -4370,6 +5074,31 @@ return error; } +static bool +getqdisc_is_safe(void) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + static bool safe = false; + + if (ovsthread_once_start(&once)) { + struct utsname utsname; + int major, minor; + + if (uname(&utsname) == -1) { + VLOG_WARN("uname failed (%s)", ovs_strerror(errno)); + } else if (!ovs_scan(utsname.release, "%d.%d", &major, &minor)) { + VLOG_WARN("uname reported bad OS release (%s)", utsname.release); + } else if (major < 2 || (major == 2 && minor < 35)) { + VLOG_INFO("disabling unsafe RTM_GETQDISC in Linux kernel %s", + utsname.release); + } else { + safe = true; + } + ovsthread_once_done(&once); + } + return safe; +} + /* If 'netdev''s qdisc type and parameters are not yet known, queries the * kernel to determine what they are. Returns 0 if successful, otherwise a * positive errno value. */ @@ -4399,18 +5128,21 @@ * create will have a class with handle 1:0. The built-in qdiscs only have * a class with handle 0:0. * - * We could check for Linux 2.6.35+ and use a more straightforward method - * there. */ + * On Linux 2.6.35+ we use the straightforward method because it allows us + * to handle non-builtin qdiscs without handle 1:0 (e.g. codel). However, + * in such a case we get no response at all from the kernel (!) if a + * builtin qdisc is in use (which is later caught by "!error && + * !qdisc->size"). */ tcmsg = tc_make_request(netdev_, RTM_GETQDISC, NLM_F_ECHO, &request); if (!tcmsg) { return ENODEV; } - tcmsg->tcm_handle = tc_make_handle(1, 0); - tcmsg->tcm_parent = 0; + tcmsg->tcm_handle = tc_make_handle(getqdisc_is_safe() ? 0 : 1, 0); + tcmsg->tcm_parent = getqdisc_is_safe() ? TC_H_ROOT : 0; /* Figure out what tc class to instantiate. */ error = tc_transact(&request, &qdisc); - if (!error) { + if (!error && qdisc->size) { const char *kind; error = tc_parse_qdisc(qdisc, &kind, NULL); @@ -4420,15 +5152,15 @@ ops = tc_lookup_linux_name(kind); if (!ops) { static struct vlog_rate_limit rl2 = VLOG_RATE_LIMIT_INIT(1, 1); - VLOG_INFO_RL(&rl2, "unknown qdisc \"%s\"", kind); + VLOG_DBG_RL(&rl2, "unknown qdisc \"%s\"", kind); ops = &tc_ops_other; } } - } else if (error == ENOENT) { - /* Either it's a built-in qdisc, or it's a qdisc set up by some - * other entity that doesn't have a handle 1:0. We will assume - * that it's the system default qdisc. */ + } else if ((!error && !qdisc->size) || error == ENOENT) { + /* Either it's a built-in qdisc, or (on Linux pre-2.6.35) it's a qdisc + * set up by some other entity that doesn't have a handle 1:0. We will + * assume that it's the system default qdisc. */ ops = &tc_ops_default; error = 0; } else { @@ -4595,6 +5327,34 @@ dst->tx_window_errors = src->tx_window_errors; } +/* Copies 'src' into 'dst', performing format conversion in the process. */ +static void +netdev_stats_from_rtnl_link_stats64(struct netdev_stats *dst, + const struct rtnl_link_stats64 *src) +{ + dst->rx_packets = src->rx_packets; + dst->tx_packets = src->tx_packets; + dst->rx_bytes = src->rx_bytes; + dst->tx_bytes = src->tx_bytes; + dst->rx_errors = src->rx_errors; + dst->tx_errors = src->tx_errors; + dst->rx_dropped = src->rx_dropped; + dst->tx_dropped = src->tx_dropped; + dst->multicast = src->multicast; + dst->collisions = src->collisions; + dst->rx_length_errors = src->rx_length_errors; + dst->rx_over_errors = src->rx_over_errors; + dst->rx_crc_errors = src->rx_crc_errors; + dst->rx_frame_errors = src->rx_frame_errors; + dst->rx_fifo_errors = src->rx_fifo_errors; + dst->rx_missed_errors = src->rx_missed_errors; + dst->tx_aborted_errors = src->tx_aborted_errors; + dst->tx_carrier_errors = src->tx_carrier_errors; + dst->tx_fifo_errors = src->tx_fifo_errors; + dst->tx_heartbeat_errors = src->tx_heartbeat_errors; + dst->tx_window_errors = src->tx_window_errors; +} + static int get_stats_via_netlink(const struct netdev *netdev_, struct netdev_stats *stats) { @@ -4615,13 +5375,19 @@ } if (ofpbuf_try_pull(reply, NLMSG_HDRLEN + sizeof(struct ifinfomsg))) { - const struct nlattr *a = nl_attr_find(reply, 0, IFLA_STATS); - if (a && nl_attr_get_size(a) >= sizeof(struct rtnl_link_stats)) { - netdev_stats_from_rtnl_link_stats(stats, nl_attr_get(a)); + const struct nlattr *a = nl_attr_find(reply, 0, IFLA_STATS64); + if (a && nl_attr_get_size(a) >= sizeof(struct rtnl_link_stats64)) { + netdev_stats_from_rtnl_link_stats64(stats, nl_attr_get(a)); error = 0; } else { - VLOG_WARN_RL(&rl, "RTM_GETLINK reply lacks stats"); - error = EPROTO; + const struct nlattr *a = nl_attr_find(reply, 0, IFLA_STATS); + if (a && nl_attr_get_size(a) >= sizeof(struct rtnl_link_stats)) { + netdev_stats_from_rtnl_link_stats(stats, nl_attr_get(a)); + error = 0; + } else { + VLOG_WARN_RL(&rl, "RTM_GETLINK reply lacks stats"); + error = EPROTO; + } } } else { VLOG_WARN_RL(&rl, "short RTM_GETLINK reply"); diff -Nru openvswitch-2.3.1/lib/netdev-provider.h openvswitch-2.4.0~git20150623/lib/netdev-provider.h --- openvswitch-2.3.1/lib/netdev-provider.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-provider.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,8 @@ #include "connectivity.h" #include "netdev.h" #include "list.h" +#include "ovs-numa.h" +#include "packets.h" #include "seq.h" #include "shash.h" #include "smap.h" @@ -30,6 +32,8 @@ extern "C" { #endif +#define NETDEV_NUMA_UNSPEC OVS_NUMA_UNSPEC + /* A network device (e.g. an Ethernet device). * * Network device implementations may read these members but should not modify @@ -49,10 +53,11 @@ uint64_t change_seq; /* The following are protected by 'netdev_mutex' (internal to netdev.c). */ + int n_txq; int n_rxq; int ref_cnt; /* Times this devices was opened. */ struct shash_node *node; /* Pointer to element in global map. */ - struct list saved_flags_list; /* Contains "struct netdev_saved_flags". */ + struct ovs_list saved_flags_list; /* Contains "struct netdev_saved_flags". */ }; static void @@ -250,17 +255,63 @@ const struct netdev_tunnel_config * (*get_tunnel_config)(const struct netdev *netdev); - /* Sends the buffer on 'netdev'. - * Returns 0 if successful, otherwise a positive errno value. Returns - * EAGAIN without blocking if the packet cannot be queued immediately. - * Returns EMSGSIZE if a partial packet was transmitted or if the packet - * is too big or too small to transmit on the device. - * - * To retain ownership of 'buffer' caller can set may_steal to false. - * - * The network device is expected to maintain a packet transmission queue, - * so that the caller does not ordinarily have to do additional queuing of - * packets. + /* Build Partial Tunnel header. Ethernet and ip header is already built, + * build_header() is suppose build protocol specific part of header. */ + int (*build_header)(const struct netdev *, struct ovs_action_push_tnl *data, + const struct flow *tnl_flow); + + /* build_header() can not build entire header for all packets for given + * flow. Push header is called for packet to build header specific to + * a packet on actual transmit. It uses partial header build by + * build_header() which is passed as data. */ + void (*push_header)(struct dp_packet *packet, + const struct ovs_action_push_tnl *data); + + /* Pop tunnel header from packet, build tunnel metadata and resize packet + * for further processing. */ + int (*pop_header)(struct dp_packet *packet); + + /* Returns the id of the numa node the 'netdev' is on. If there is no + * such info, returns NETDEV_NUMA_UNSPEC. */ + int (*get_numa_id)(const struct netdev *netdev); + + /* Configures the number of tx queues and rx queues of 'netdev'. + * Return 0 if successful, otherwise a positive errno value. + * + * 'n_rxq' specifies the maximum number of receive queues to create. + * The netdev provider might choose to create less (e.g. if the hardware + * supports only a smaller number). The actual number of queues created + * is stored in the 'netdev->n_rxq' field. + * + * 'n_txq' specifies the exact number of transmission queues to create. + * The caller will call netdev_send() concurrently from 'n_txq' different + * threads (with different qid). The netdev provider is responsible for + * making sure that these concurrent calls do not create a race condition + * by using multiple hw queues or locking. + * + * On error, the tx queue and rx queue configuration is indeterminant. + * Caller should make decision on whether to restore the previous or + * the default configuration. Also, caller must make sure there is no + * other thread accessing the queues at the same time. */ + int (*set_multiq)(struct netdev *netdev, unsigned int n_txq, + unsigned int n_rxq); + + /* Sends buffers on 'netdev'. + * Returns 0 if successful (for every buffer), otherwise a positive errno + * value. Returns EAGAIN without blocking if one or more packets cannot be + * queued immediately. Returns EMSGSIZE if a partial packet was transmitted + * or if a packet is too big or too small to transmit on the device. + * + * If the function returns a non-zero value, some of the packets might have + * been sent anyway. + * + * To retain ownership of 'buffers' caller can set may_steal to false. + * + * The network device is expected to maintain one or more packet + * transmission queues, so that the caller does not ordinarily have to + * do additional queuing of packets. 'qid' specifies the queue to use + * and can be ignored if the implementation does not support multiple + * queues. * * May return EOPNOTSUPP if a network device does not implement packet * transmission through this interface. This function may be set to null @@ -268,28 +319,33 @@ * network device from being usefully used by the netdev-based "userspace * datapath". It will also prevent the OVS implementation of bonding from * working properly over 'netdev'.) */ - int (*send)(struct netdev *netdev, struct ofpbuf *buffer, bool may_steal); + int (*send)(struct netdev *netdev, int qid, struct dp_packet **buffers, + int cnt, bool may_steal); /* Registers with the poll loop to wake up from the next call to * poll_block() when the packet transmission queue for 'netdev' has * sufficient room to transmit a packet with netdev_send(). * - * The network device is expected to maintain a packet transmission queue, - * so that the caller does not ordinarily have to do additional queuing of - * packets. Thus, this function is unlikely to ever be useful. + * The network device is expected to maintain one or more packet + * transmission queues, so that the caller does not ordinarily have to + * do additional queuing of packets. 'qid' specifies the queue to use + * and can be ignored if the implementation does not support multiple + * queues. * * May be null if not needed, such as for a network device that does not * implement packet transmission through the 'send' member function. */ - void (*send_wait)(struct netdev *netdev); + void (*send_wait)(struct netdev *netdev, int qid); /* Sets 'netdev''s Ethernet address to 'mac' */ - int (*set_etheraddr)(struct netdev *netdev, const uint8_t mac[6]); + int (*set_etheraddr)(struct netdev *netdev, + const uint8_t mac[ETH_ADDR_LEN]); /* Retrieves 'netdev''s Ethernet address into 'mac'. * * This address will be advertised as 'netdev''s MAC address through the * OpenFlow protocol, among other uses. */ - int (*get_etheraddr)(const struct netdev *netdev, uint8_t mac[6]); + int (*get_etheraddr)(const struct netdev *netdev, + uint8_t mac[ETH_ADDR_LEN]); /* Retrieves 'netdev''s MTU into '*mtup'. * @@ -338,7 +394,7 @@ /* Forces ->get_carrier() to poll 'netdev''s MII registers for link status * instead of checking 'netdev''s carrier. 'netdev''s MII registers will - * be polled once ever 'interval' milliseconds. If 'netdev' does not + * be polled once every 'interval' milliseconds. If 'netdev' does not * support MII, another method may be used as a fallback. If 'interval' is * less than or equal to zero, reverts ->get_carrier() to its normal * behavior. @@ -355,14 +411,6 @@ * (UINT64_MAX). */ int (*get_stats)(const struct netdev *netdev, struct netdev_stats *); - /* Sets the device stats for 'netdev' to 'stats'. - * - * Most network devices won't support this feature and will set this - * function pointer to NULL, which is equivalent to returning EOPNOTSUPP. - * - * Some network devices might only allow setting their stats to 0. */ - int (*set_stats)(struct netdev *netdev, const struct netdev_stats *); - /* Stores the features supported by 'netdev' into each of '*current', * '*advertised', '*supported', and '*peer'. Each value is a bitmap of * NETDEV_F_* bits. @@ -603,11 +651,11 @@ * anyhow. */ int (*add_router)(struct netdev *netdev, struct in_addr router); - /* Looks up the next hop for 'host'. If successful, stores the next hop - * gateway's address (0 if 'host' is on a directly connected network) in - * '*next_hop' and a copy of the name of the device to reach 'host' in - * '*netdev_name', and returns 0. The caller is responsible for freeing - * '*netdev_name' (by calling free()). + /* Looks up the next hop for 'host' in the host's routing table. If + * successful, stores the next hop gateway's address (0 if 'host' is on a + * directly connected network) in '*next_hop' and a copy of the name of the + * device to reach 'host' in '*netdev_name', and returns 0. The caller is + * responsible for freeing '*netdev_name' (by calling free()). * * This function may be set to null if it would always return EOPNOTSUPP * anyhow. */ @@ -635,7 +683,7 @@ * This function may be set to null if it would always return EOPNOTSUPP * anyhow. */ int (*arp_lookup)(const struct netdev *netdev, ovs_be32 ip, - uint8_t mac[6]); + uint8_t mac[ETH_ADDR_LEN]); /* Retrieves the current set of flags on 'netdev' into '*old_flags'. Then, * turns off the flags that are set to 1 in 'off' and turns on the flags @@ -661,8 +709,8 @@ void (*rxq_destruct)(struct netdev_rxq *); void (*rxq_dealloc)(struct netdev_rxq *); - /* Attempts to receive batch of packets from 'rx' and place array of pointers - * into '*pkt'. netdev is responsible for allocating buffers. + /* Attempts to receive batch of packets from 'rx' and place array of + * pointers into '*pkts'. netdev is responsible for allocating buffers. * '*cnt' points to packet count for given batch. Once packets are returned * to caller, netdev should give up ownership of ofpbuf data. * @@ -672,7 +720,8 @@ * Caller is expected to pass array of size MAX_RX_BATCH. * This function may be set to null if it would always return EOPNOTSUPP * anyhow. */ - int (*rxq_recv)(struct netdev_rxq *rx, struct ofpbuf **pkt, int *cnt); + int (*rxq_recv)(struct netdev_rxq *rx, struct dp_packet **pkts, + int *cnt); /* Registers with the poll loop to wake up from the next call to * poll_block() when a packet is ready to be received with netdev_rxq_recv() @@ -686,12 +735,15 @@ int netdev_register_provider(const struct netdev_class *); int netdev_unregister_provider(const char *type); -extern const struct netdev_class netdev_linux_class; -extern const struct netdev_class netdev_internal_class; -extern const struct netdev_class netdev_tap_class; #if defined(__FreeBSD__) || defined(__NetBSD__) extern const struct netdev_class netdev_bsd_class; +#elif defined(_WIN32) +extern const struct netdev_class netdev_windows_class; +#else +extern const struct netdev_class netdev_linux_class; #endif +extern const struct netdev_class netdev_internal_class; +extern const struct netdev_class netdev_tap_class; #ifdef __cplusplus } diff -Nru openvswitch-2.3.1/lib/netdev-vport.c openvswitch-2.4.0~git20150623/lib/netdev-vport.c --- openvswitch-2.3.1/lib/netdev-vport.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-vport.c 2015-06-23 18:46:21.000000000 +0000 @@ -25,25 +25,47 @@ #include #include "byte-order.h" +#include "csum.h" #include "daemon.h" #include "dirs.h" #include "dpif.h" +#include "dp-packet.h" +#include "dynamic-string.h" +#include "flow.h" #include "hash.h" #include "hmap.h" #include "list.h" #include "netdev-provider.h" -#include "ofpbuf.h" +#include "odp-netlink.h" +#include "dp-packet.h" +#include "ovs-router.h" #include "packets.h" #include "poll-loop.h" #include "route-table.h" #include "shash.h" #include "socket-util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" +#include "unaligned.h" +#include "unixctl.h" +#include "util.h" VLOG_DEFINE_THIS_MODULE(netdev_vport); +static struct vlog_rate_limit err_rl = VLOG_RATE_LIMIT_INIT(60, 5); +#define GENEVE_DST_PORT 6081 #define VXLAN_DST_PORT 4789 #define LISP_DST_PORT 4341 +#define STT_DST_PORT 7471 + +#define VXLAN_HLEN (sizeof(struct eth_header) + \ + sizeof(struct ip_header) + \ + sizeof(struct udp_header) + \ + sizeof(struct vxlanhdr)) + +#define GENEVE_BASE_HLEN (sizeof(struct eth_header) + \ + sizeof(struct ip_header) + \ + sizeof(struct udp_header) + \ + sizeof(struct genevehdr)) #define DEFAULT_TTL 64 @@ -78,6 +100,9 @@ static int get_tunnel_config(const struct netdev *, struct smap *args); static bool tunnel_check_status_change__(struct netdev_vport *); +static uint16_t tnl_udp_port_min = 32768; +static uint16_t tnl_udp_port_max = 61000; + static bool is_vport_class(const struct netdev_class *class) { @@ -133,7 +158,8 @@ const char *type = netdev_get_type(dev); return (class->get_config == get_tunnel_config && - (!strcmp("vxlan", type) || !strcmp("lisp", type))); + (!strcmp("geneve", type) || !strcmp("vxlan", type) || + !strcmp("lisp", type) || !strcmp("stt", type)) ); } const char * @@ -146,25 +172,28 @@ netdev_vport_get_dpif_port(const struct netdev *netdev, char namebuf[], size_t bufsize) { + const struct netdev_class *class = netdev_get_class(netdev); + const char *dpif_port = netdev_vport_class_get_dpif_port(class); + + if (!dpif_port) { + return netdev_get_name(netdev); + } + if (netdev_vport_needs_dst_port(netdev)) { const struct netdev_vport *vport = netdev_vport_cast(netdev); - const char *type = netdev_get_type(netdev); /* - * Note: IFNAMSIZ is 16 bytes long. The maximum length of a VXLAN - * or LISP port name below is 15 or 14 bytes respectively. Still, - * assert here on the size of strlen(type) in case that changes - * in the future. + * Note: IFNAMSIZ is 16 bytes long. Implementations should choose + * a dpif port name that is short enough to fit including any + * port numbers but assert just in case. */ BUILD_ASSERT(NETDEV_VPORT_NAME_BUFSIZE >= IFNAMSIZ); - ovs_assert(strlen(type) + 10 < IFNAMSIZ); - snprintf(namebuf, bufsize, "%s_sys_%d", type, + ovs_assert(strlen(dpif_port) + 6 < IFNAMSIZ); + snprintf(namebuf, bufsize, "%s_%d", dpif_port, ntohs(vport->tnl_cfg.dst_port)); return namebuf; } else { - const struct netdev_class *class = netdev_get_class(netdev); - const char *dpif_port = netdev_vport_class_get_dpif_port(class); - return dpif_port ? dpif_port : netdev_get_name(netdev); + return dpif_port; } } @@ -216,13 +245,25 @@ static int netdev_vport_construct(struct netdev *netdev_) { - struct netdev_vport *netdev = netdev_vport_cast(netdev_); + struct netdev_vport *dev = netdev_vport_cast(netdev_); + const char *type = netdev_get_type(netdev_); - ovs_mutex_init(&netdev->mutex); - eth_addr_random(netdev->etheraddr); + ovs_mutex_init(&dev->mutex); + eth_addr_random(dev->etheraddr); - route_table_register(); + /* Add a default destination port for tunnel ports if none specified. */ + if (!strcmp(type, "geneve")) { + dev->tnl_cfg.dst_port = htons(GENEVE_DST_PORT); + } else if (!strcmp(type, "vxlan")) { + dev->tnl_cfg.dst_port = htons(VXLAN_DST_PORT); + } else if (!strcmp(type, "lisp")) { + dev->tnl_cfg.dst_port = htons(LISP_DST_PORT); + } else if (!strcmp(type, "stt")) { + dev->tnl_cfg.dst_port = htons(STT_DST_PORT); + } + dev->tnl_cfg.dont_fragment = true; + dev->tnl_cfg.ttl = DEFAULT_TTL; return 0; } @@ -231,7 +272,6 @@ { struct netdev_vport *netdev = netdev_vport_cast(netdev_); - route_table_unregister(); free(netdev->peer); ovs_mutex_destroy(&netdev->mutex); } @@ -279,10 +319,11 @@ char iface[IFNAMSIZ]; bool status = false; ovs_be32 route; + ovs_be32 gw; iface[0] = '\0'; route = netdev->tnl_cfg.ip_dst; - if (route_table_get_name(route, iface)) { + if (ovs_router_lookup(route, iface, &gw)) { struct netdev *egress_netdev; if (!netdev_open(iface, "system", &egress_netdev)) { @@ -395,10 +436,28 @@ struct netdev_tunnel_config tnl_cfg; struct smap_node *node; - has_csum = strstr(type, "gre"); + has_csum = strstr(type, "gre") || strstr(type, "geneve") || + strstr(type, "stt") || strstr(type, "vxlan"); ipsec_mech_set = false; memset(&tnl_cfg, 0, sizeof tnl_cfg); + /* Add a default destination port for tunnel ports if none specified. */ + if (!strcmp(type, "geneve")) { + tnl_cfg.dst_port = htons(GENEVE_DST_PORT); + } + + if (!strcmp(type, "vxlan")) { + tnl_cfg.dst_port = htons(VXLAN_DST_PORT); + } + + if (!strcmp(type, "lisp")) { + tnl_cfg.dst_port = htons(LISP_DST_PORT); + } + + if (!strcmp(type, "stt")) { + tnl_cfg.dst_port = htons(STT_DST_PORT); + } + needs_dst_port = netdev_vport_needs_dst_port(dev_); tnl_cfg.ipsec = strstr(type, "ipsec"); tnl_cfg.dont_fragment = true; @@ -488,21 +547,29 @@ !strcmp(node->key, "in_key") || !strcmp(node->key, "out_key")) { /* Handled separately below. */ + } else if (!strcmp(node->key, "exts")) { + char *str = xstrdup(node->value); + char *ext, *save_ptr = NULL; + + tnl_cfg.exts = 0; + + ext = strtok_r(str, ",", &save_ptr); + while (ext) { + if (!strcmp(type, "vxlan") && !strcmp(ext, "gbp")) { + tnl_cfg.exts |= (1 << OVS_VXLAN_EXT_GBP); + } else { + VLOG_WARN("%s: unknown extension '%s'", name, ext); + } + + ext = strtok_r(NULL, ",", &save_ptr); + } + + free(str); } else { VLOG_WARN("%s: unknown %s argument '%s'", name, type, node->key); } } - /* Add a default destination port for VXLAN if none specified. */ - if (!strcmp(type, "vxlan") && !tnl_cfg.dst_port) { - tnl_cfg.dst_port = htons(VXLAN_DST_PORT); - } - - /* Add a default destination port for LISP if none specified. */ - if (!strcmp(type, "lisp") && !tnl_cfg.dst_port) { - tnl_cfg.dst_port = htons(LISP_DST_PORT); - } - if (tnl_cfg.ipsec) { static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; static pid_t pid = 0; @@ -559,9 +626,11 @@ &tnl_cfg.out_key_flow); ovs_mutex_lock(&dev->mutex); - dev->tnl_cfg = tnl_cfg; - tunnel_check_status_change__(dev); - netdev_change_seq_changed(dev_); + if (memcmp(&dev->tnl_cfg, &tnl_cfg, sizeof tnl_cfg)) { + dev->tnl_cfg = tnl_cfg; + tunnel_check_status_change__(dev); + netdev_change_seq_changed(dev_); + } ovs_mutex_unlock(&dev->mutex); return 0; @@ -626,8 +695,10 @@ uint16_t dst_port = ntohs(tnl_cfg.dst_port); const char *type = netdev_get_type(dev); - if ((!strcmp("vxlan", type) && dst_port != VXLAN_DST_PORT) || - (!strcmp("lisp", type) && dst_port != LISP_DST_PORT)) { + if ((!strcmp("geneve", type) && dst_port != GENEVE_DST_PORT) || + (!strcmp("vxlan", type) && dst_port != VXLAN_DST_PORT) || + (!strcmp("lisp", type) && dst_port != LISP_DST_PORT) || + (!strcmp("stt", type) && dst_port != STT_DST_PORT)) { smap_add_format(args, "dst_port", "%d", dst_port); } } @@ -733,9 +804,11 @@ } ovs_mutex_lock(&dev->mutex); - free(dev->peer); - dev->peer = xstrdup(peer); - netdev_change_seq_changed(dev_); + if (!dev->peer || strcmp(dev->peer, peer)) { + free(dev->peer); + dev->peer = xstrdup(peer); + netdev_change_seq_changed(dev_); + } ovs_mutex_unlock(&dev->mutex); return 0; @@ -752,9 +825,500 @@ return 0; } + + +/* Tunnel push pop ops. */ + +static struct ip_header * +ip_hdr(void *eth) +{ + return (void *)((char *)eth + sizeof (struct eth_header)); +} + +static struct gre_base_hdr * +gre_hdr(struct ip_header *ip) +{ + return (void *)((char *)ip + sizeof (struct ip_header)); +} + +static void * +ip_extract_tnl_md(struct dp_packet *packet, struct flow_tnl *tnl) +{ + struct ip_header *nh; + void *l4; + + nh = dp_packet_l3(packet); + l4 = dp_packet_l4(packet); + + if (!nh || !l4) { + return NULL; + } + + tnl->ip_src = get_16aligned_be32(&nh->ip_src); + tnl->ip_dst = get_16aligned_be32(&nh->ip_dst); + tnl->ip_tos = nh->ip_tos; + tnl->ip_ttl = nh->ip_ttl; + + return l4; +} + +/* Pushes the 'size' bytes of 'header' into the headroom of 'packet', + * reallocating the packet if necessary. 'header' should contain an Ethernet + * header, followed by an IPv4 header (without options), and an L4 header. + * + * This function sets the IP header's ip_tot_len field (which should be zeroed + * as part of 'header') and puts its value into '*ip_tot_size' as well. Also + * updates IP header checksum. + * + * Return pointer to the L4 header added to 'packet'. */ +static void * +push_ip_header(struct dp_packet *packet, + const void *header, int size, int *ip_tot_size) +{ + struct eth_header *eth; + struct ip_header *ip; + + eth = dp_packet_push_uninit(packet, size); + *ip_tot_size = dp_packet_size(packet) - sizeof (struct eth_header); + + memcpy(eth, header, size); + ip = ip_hdr(eth); + ip->ip_tot_len = htons(*ip_tot_size); + + + ip->ip_csum = recalc_csum16(ip->ip_csum, 0, ip->ip_tot_len); + + return ip + 1; +} + +static void * +udp_extract_tnl_md(struct dp_packet *packet, struct flow_tnl *tnl) +{ + struct udp_header *udp; + + udp = ip_extract_tnl_md(packet, tnl); + if (!udp) { + return NULL; + } + + if (udp->udp_csum) { + uint32_t csum = packet_csum_pseudoheader(dp_packet_l3(packet)); + + csum = csum_continue(csum, udp, dp_packet_size(packet) - + ((const unsigned char *)udp - + (const unsigned char *)dp_packet_l2(packet))); + if (csum_finish(csum)) { + return NULL; + } + tnl->flags |= FLOW_TNL_F_CSUM; + } + + tnl->tp_src = udp->udp_src; + tnl->tp_dst = udp->udp_dst; + + return udp + 1; +} + +static ovs_be16 +get_src_port(struct dp_packet *packet) +{ + uint32_t hash; + + hash = dp_packet_get_rss_hash(packet); + + return htons((((uint64_t) hash * (tnl_udp_port_max - tnl_udp_port_min)) >> 32) + + tnl_udp_port_min); +} + +static void +push_udp_header(struct dp_packet *packet, + const struct ovs_action_push_tnl *data) +{ + struct udp_header *udp; + int ip_tot_size; + + udp = push_ip_header(packet, data->header, data->header_len, &ip_tot_size); + + /* set udp src port */ + udp->udp_src = get_src_port(packet); + udp->udp_len = htons(ip_tot_size - sizeof (struct ip_header)); + + if (udp->udp_csum) { + uint32_t csum = packet_csum_pseudoheader(ip_hdr(dp_packet_data(packet))); + + csum = csum_continue(csum, udp, + ip_tot_size - sizeof (struct ip_header)); + udp->udp_csum = csum_finish(csum); + + if (!udp->udp_csum) { + udp->udp_csum = htons(0xffff); + } + } +} + +static void * +udp_build_header(struct netdev_tunnel_config *tnl_cfg, + const struct flow *tnl_flow, + struct ovs_action_push_tnl *data) +{ + struct ip_header *ip; + struct udp_header *udp; + + ip = ip_hdr(data->header); + ip->ip_proto = IPPROTO_UDP; + + udp = (struct udp_header *) (ip + 1); + udp->udp_dst = tnl_cfg->dst_port; + + if (tnl_flow->tunnel.flags & FLOW_TNL_F_CSUM) { + /* Write a value in now to mark that we should compute the checksum + * later. 0xffff is handy because it is transparent to the + * calculation. */ + udp->udp_csum = htons(0xffff); + } + + return udp + 1; +} + +static int +gre_header_len(ovs_be16 flags) +{ + int hlen = sizeof(struct eth_header) + + sizeof(struct ip_header) + 4; + + if (flags & htons(GRE_CSUM)) { + hlen += 4; + } + if (flags & htons(GRE_KEY)) { + hlen += 4; + } + if (flags & htons(GRE_SEQ)) { + hlen += 4; + } + return hlen; +} + +static int +parse_gre_header(struct dp_packet *packet, + struct flow_tnl *tnl) +{ + const struct gre_base_hdr *greh; + ovs_16aligned_be32 *options; + int hlen; + + greh = ip_extract_tnl_md(packet, tnl); + if (!greh) { + return -EINVAL; + } + + if (greh->flags & ~(htons(GRE_CSUM | GRE_KEY | GRE_SEQ))) { + return -EINVAL; + } + + if (greh->protocol != htons(ETH_TYPE_TEB)) { + return -EINVAL; + } + + hlen = gre_header_len(greh->flags); + if (hlen > dp_packet_size(packet)) { + return -EINVAL; + } + + options = (ovs_16aligned_be32 *)(greh + 1); + if (greh->flags & htons(GRE_CSUM)) { + ovs_be16 pkt_csum; + + pkt_csum = csum(greh, dp_packet_size(packet) - + ((const unsigned char *)greh - + (const unsigned char *)dp_packet_l2(packet))); + if (pkt_csum) { + return -EINVAL; + } + tnl->flags = FLOW_TNL_F_CSUM; + options++; + } + + if (greh->flags & htons(GRE_KEY)) { + tnl->tun_id = (OVS_FORCE ovs_be64) ((OVS_FORCE uint64_t)(get_16aligned_be32(options)) << 32); + tnl->flags |= FLOW_TNL_F_KEY; + options++; + } + + if (greh->flags & htons(GRE_SEQ)) { + options++; + } + + return hlen; +} + +static int +netdev_gre_pop_header(struct dp_packet *packet) +{ + struct pkt_metadata *md = &packet->md; + struct flow_tnl *tnl = &md->tunnel; + int hlen = sizeof(struct eth_header) + + sizeof(struct ip_header) + 4; + + memset(md, 0, sizeof *md); + if (hlen > dp_packet_size(packet)) { + return EINVAL; + } + + hlen = parse_gre_header(packet, tnl); + if (hlen < 0) { + return -hlen; + } + + dp_packet_reset_packet(packet, hlen); + + return 0; +} + +static void +netdev_gre_push_header(struct dp_packet *packet, + const struct ovs_action_push_tnl *data) +{ + struct gre_base_hdr *greh; + int ip_tot_size; + + greh = push_ip_header(packet, data->header, data->header_len, &ip_tot_size); + + if (greh->flags & htons(GRE_CSUM)) { + ovs_be16 *csum_opt = (ovs_be16 *) (greh + 1); + *csum_opt = csum(greh, ip_tot_size - sizeof (struct ip_header)); + } +} + +static int +netdev_gre_build_header(const struct netdev *netdev, + struct ovs_action_push_tnl *data, + const struct flow *tnl_flow) +{ + struct netdev_vport *dev = netdev_vport_cast(netdev); + struct netdev_tunnel_config *tnl_cfg; + struct ip_header *ip; + struct gre_base_hdr *greh; + ovs_16aligned_be32 *options; + int hlen; + + /* XXX: RCUfy tnl_cfg. */ + ovs_mutex_lock(&dev->mutex); + tnl_cfg = &dev->tnl_cfg; + + ip = ip_hdr(data->header); + ip->ip_proto = IPPROTO_GRE; + + greh = gre_hdr(ip); + greh->protocol = htons(ETH_TYPE_TEB); + greh->flags = 0; + + options = (ovs_16aligned_be32 *) (greh + 1); + if (tnl_flow->tunnel.flags & FLOW_TNL_F_CSUM) { + greh->flags |= htons(GRE_CSUM); + put_16aligned_be32(options, 0); + options++; + } + + if (tnl_cfg->out_key_present) { + greh->flags |= htons(GRE_KEY); + put_16aligned_be32(options, (OVS_FORCE ovs_be32) + ((OVS_FORCE uint64_t) tnl_flow->tunnel.tun_id >> 32)); + options++; + } + + ovs_mutex_unlock(&dev->mutex); + + hlen = (uint8_t *) options - (uint8_t *) greh; + + data->header_len = sizeof(struct eth_header) + + sizeof(struct ip_header) + hlen; + data->tnl_type = OVS_VPORT_TYPE_GRE; + return 0; +} + +static int +netdev_vxlan_pop_header(struct dp_packet *packet) +{ + struct pkt_metadata *md = &packet->md; + struct flow_tnl *tnl = &md->tunnel; + struct vxlanhdr *vxh; + + memset(md, 0, sizeof *md); + if (VXLAN_HLEN > dp_packet_size(packet)) { + return EINVAL; + } + + vxh = udp_extract_tnl_md(packet, tnl); + if (!vxh) { + return EINVAL; + } + + if (get_16aligned_be32(&vxh->vx_flags) != htonl(VXLAN_FLAGS) || + (get_16aligned_be32(&vxh->vx_vni) & htonl(0xff))) { + VLOG_WARN_RL(&err_rl, "invalid vxlan flags=%#x vni=%#x\n", + ntohl(get_16aligned_be32(&vxh->vx_flags)), + ntohl(get_16aligned_be32(&vxh->vx_vni))); + return EINVAL; + } + tnl->tun_id = htonll(ntohl(get_16aligned_be32(&vxh->vx_vni)) >> 8); + tnl->flags |= FLOW_TNL_F_KEY; + + dp_packet_reset_packet(packet, VXLAN_HLEN); + + return 0; +} + +static int +netdev_vxlan_build_header(const struct netdev *netdev, + struct ovs_action_push_tnl *data, + const struct flow *tnl_flow) +{ + struct netdev_vport *dev = netdev_vport_cast(netdev); + struct netdev_tunnel_config *tnl_cfg; + struct vxlanhdr *vxh; + + /* XXX: RCUfy tnl_cfg. */ + ovs_mutex_lock(&dev->mutex); + tnl_cfg = &dev->tnl_cfg; + + vxh = udp_build_header(tnl_cfg, tnl_flow, data); + + put_16aligned_be32(&vxh->vx_flags, htonl(VXLAN_FLAGS)); + put_16aligned_be32(&vxh->vx_vni, htonl(ntohll(tnl_flow->tunnel.tun_id) << 8)); + + ovs_mutex_unlock(&dev->mutex); + data->header_len = VXLAN_HLEN; + data->tnl_type = OVS_VPORT_TYPE_VXLAN; + return 0; +} + +static int +netdev_geneve_pop_header(struct dp_packet *packet) +{ + struct pkt_metadata *md = &packet->md; + struct flow_tnl *tnl = &md->tunnel; + struct genevehdr *gnh; + unsigned int hlen; + + memset(md, 0, sizeof *md); + if (GENEVE_BASE_HLEN > dp_packet_size(packet)) { + VLOG_WARN_RL(&err_rl, "geneve packet too small: min header=%u packet size=%u\n", + (unsigned int)GENEVE_BASE_HLEN, dp_packet_size(packet)); + return EINVAL; + } + + gnh = udp_extract_tnl_md(packet, tnl); + if (!gnh) { + return EINVAL; + } + + hlen = GENEVE_BASE_HLEN + gnh->opt_len * 4; + if (hlen > dp_packet_size(packet)) { + VLOG_WARN_RL(&err_rl, "geneve packet too small: header len=%u packet size=%u\n", + hlen, dp_packet_size(packet)); + return EINVAL; + } + + if (gnh->ver != 0) { + VLOG_WARN_RL(&err_rl, "unknown geneve version: %"PRIu8"\n", gnh->ver); + return EINVAL; + } + + if (gnh->opt_len && gnh->critical) { + VLOG_WARN_RL(&err_rl, "unknown geneve critical options: %"PRIu8" bytes\n", + gnh->opt_len * 4); + return EINVAL; + } + + if (gnh->proto_type != htons(ETH_TYPE_TEB)) { + VLOG_WARN_RL(&err_rl, "unknown geneve encapsulated protocol: %#x\n", + ntohs(gnh->proto_type)); + return EINVAL; + } + + tnl->flags |= gnh->oam ? FLOW_TNL_F_OAM : 0; + tnl->tun_id = htonll(ntohl(get_16aligned_be32(&gnh->vni)) >> 8); + tnl->flags |= FLOW_TNL_F_KEY; + + dp_packet_reset_packet(packet, hlen); + + return 0; +} + +static int +netdev_geneve_build_header(const struct netdev *netdev, + struct ovs_action_push_tnl *data, + const struct flow *tnl_flow) +{ + struct netdev_vport *dev = netdev_vport_cast(netdev); + struct netdev_tunnel_config *tnl_cfg; + struct genevehdr *gnh; + + /* XXX: RCUfy tnl_cfg. */ + ovs_mutex_lock(&dev->mutex); + tnl_cfg = &dev->tnl_cfg; + + gnh = udp_build_header(tnl_cfg, tnl_flow, data); + + gnh->oam = !!(tnl_flow->tunnel.flags & FLOW_TNL_F_OAM); + gnh->proto_type = htons(ETH_TYPE_TEB); + put_16aligned_be32(&gnh->vni, htonl(ntohll(tnl_flow->tunnel.tun_id) << 8)); + + ovs_mutex_unlock(&dev->mutex); + data->header_len = GENEVE_BASE_HLEN; + data->tnl_type = OVS_VPORT_TYPE_GENEVE; + return 0; +} + +static void +netdev_vport_range(struct unixctl_conn *conn, int argc, + const char *argv[], void *aux OVS_UNUSED) +{ + int val1, val2; + + if (argc < 3) { + struct ds ds = DS_EMPTY_INITIALIZER; + + ds_put_format(&ds, "Tunnel UDP source port range: %"PRIu16"-%"PRIu16"\n", + tnl_udp_port_min, tnl_udp_port_max); + + unixctl_command_reply(conn, ds_cstr(&ds)); + ds_destroy(&ds); + return; + } + + if (argc != 3) { + return; + } + + val1 = atoi(argv[1]); + if (val1 <= 0 || val1 > UINT16_MAX) { + unixctl_command_reply(conn, "Invalid min."); + return; + } + val2 = atoi(argv[2]); + if (val2 <= 0 || val2 > UINT16_MAX) { + unixctl_command_reply(conn, "Invalid max."); + return; + } + + if (val1 > val2) { + tnl_udp_port_min = val2; + tnl_udp_port_max = val1; + } else { + tnl_udp_port_min = val1; + tnl_udp_port_max = val2; + } + seq_change(tnl_conf_seq); + + unixctl_command_reply(conn, "OK"); +} + #define VPORT_FUNCTIONS(GET_CONFIG, SET_CONFIG, \ - GET_TUNNEL_CONFIG, GET_STATUS) \ + GET_TUNNEL_CONFIG, GET_STATUS, \ + BUILD_HEADER, \ + PUSH_HEADER, POP_HEADER) \ NULL, \ netdev_vport_run, \ netdev_vport_wait, \ @@ -766,6 +1330,11 @@ GET_CONFIG, \ SET_CONFIG, \ GET_TUNNEL_CONFIG, \ + BUILD_HEADER, \ + PUSH_HEADER, \ + POP_HEADER, \ + NULL, /* get_numa_id */ \ + NULL, /* set_multiq */ \ \ NULL, /* send */ \ NULL, /* send_wait */ \ @@ -779,7 +1348,6 @@ NULL, /* get_carrier_resets */ \ NULL, /* get_miimon */ \ get_stats, \ - NULL, /* set_stats */ \ \ NULL, /* get_features */ \ NULL, /* set_advertisements */ \ @@ -816,23 +1384,35 @@ NULL, /* rx_wait */ \ NULL, /* rx_drain */ -#define TUNNEL_CLASS(NAME, DPIF_PORT) \ - { DPIF_PORT, \ - { NAME, VPORT_FUNCTIONS(get_tunnel_config, \ - set_tunnel_config, \ - get_netdev_tunnel_config, \ - tunnel_get_status) }} + +#define TUNNEL_CLASS(NAME, DPIF_PORT, BUILD_HEADER, PUSH_HEADER, POP_HEADER) \ + { DPIF_PORT, \ + { NAME, VPORT_FUNCTIONS(get_tunnel_config, \ + set_tunnel_config, \ + get_netdev_tunnel_config, \ + tunnel_get_status, \ + BUILD_HEADER, PUSH_HEADER, POP_HEADER) }} void netdev_vport_tunnel_register(void) { + /* The name of the dpif_port should be short enough to accomodate adding + * a port number to the end if one is necessary. */ static const struct vport_class vport_classes[] = { - TUNNEL_CLASS("gre", "gre_system"), - TUNNEL_CLASS("ipsec_gre", "gre_system"), - TUNNEL_CLASS("gre64", "gre64_system"), - TUNNEL_CLASS("ipsec_gre64", "gre64_system"), - TUNNEL_CLASS("vxlan", "vxlan_system"), - TUNNEL_CLASS("lisp", "lisp_system") + TUNNEL_CLASS("geneve", "genev_sys", netdev_geneve_build_header, + push_udp_header, + netdev_geneve_pop_header), + TUNNEL_CLASS("gre", "gre_sys", netdev_gre_build_header, + netdev_gre_push_header, + netdev_gre_pop_header), + TUNNEL_CLASS("ipsec_gre", "gre_sys", NULL, NULL, NULL), + TUNNEL_CLASS("gre64", "gre64_sys", NULL, NULL, NULL), + TUNNEL_CLASS("ipsec_gre64", "gre64_sys", NULL, NULL, NULL), + TUNNEL_CLASS("vxlan", "vxlan_sys", netdev_vxlan_build_header, + push_udp_header, + netdev_vxlan_pop_header), + TUNNEL_CLASS("lisp", "lisp_sys", NULL, NULL, NULL), + TUNNEL_CLASS("stt", "stt_sys", NULL, NULL, NULL), }; static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; @@ -842,6 +1422,10 @@ for (i = 0; i < ARRAY_SIZE(vport_classes); i++) { netdev_register_provider(&vport_classes[i].netdev_class); } + + unixctl_command_register("tnl/egress_port_range", "min max", 0, 2, + netdev_vport_range, NULL); + ovsthread_once_done(&once); } } @@ -854,6 +1438,6 @@ { "patch", VPORT_FUNCTIONS(get_patch_config, set_patch_config, NULL, - NULL) }}; + NULL, NULL, NULL, NULL) }}; netdev_register_provider(&patch_class.netdev_class); } diff -Nru openvswitch-2.3.1/lib/netdev-vport.h openvswitch-2.4.0~git20150623/lib/netdev-vport.h --- openvswitch-2.3.1/lib/netdev-vport.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-vport.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2013 Nicira, Inc. + * Copyright (c) 2010, 2011, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,9 @@ #include #include +#include "compiler.h" -struct dpif_linux_vport; +struct dpif_netlink_vport; struct dpif_flow_stats; struct netdev; struct netdev_class; @@ -48,7 +49,8 @@ enum { NETDEV_VPORT_NAME_BUFSIZE = 256 }; #endif const char *netdev_vport_get_dpif_port(const struct netdev *, - char namebuf[], size_t bufsize); + char namebuf[], size_t bufsize) + OVS_WARN_UNUSED_RESULT; char *netdev_vport_get_dpif_port_strdup(const struct netdev *); #endif /* netdev-vport.h */ diff -Nru openvswitch-2.3.1/lib/netdev-windows.c openvswitch-2.4.0~git20150623/lib/netdev-windows.c --- openvswitch-2.3.1/lib/netdev-windows.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netdev-windows.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,517 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include + +#include "coverage.h" +#include "fatal-signal.h" +#include "netdev-provider.h" +#include "ofpbuf.h" +#include "packets.h" +#include "poll-loop.h" +#include "shash.h" +#include "svec.h" +#include "openvswitch/vlog.h" +#include "odp-netlink.h" +#include "netlink-socket.h" +#include "netlink.h" + +VLOG_DEFINE_THIS_MODULE(netdev_windows); +static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(9999, 5); + +enum { + VALID_ETHERADDR = 1 << 0, + VALID_MTU = 1 << 1, + VALID_IFFLAG = 1 << 5, +}; + +/* Caches the information of a netdev. */ +struct netdev_windows { + struct netdev up; + int32_t dev_type; + uint32_t port_no; + + unsigned int change_seq; + + unsigned int cache_valid; + int ifindex; + uint8_t mac[ETH_ADDR_LEN]; + uint32_t mtu; + unsigned int ifi_flags; +}; + +/* Utility structure for netdev commands. */ +struct netdev_windows_netdev_info { + /* Generic Netlink header. */ + uint8_t cmd; + + /* Information that is relevant to ovs. */ + uint32_t dp_ifindex; + uint32_t port_no; + uint32_t ovs_type; + + /* General information of a network device. */ + const char *name; + uint8_t mac_address[ETH_ADDR_LEN]; + uint32_t mtu; + uint32_t ifi_flags; +}; + +static int query_netdev(const char *devname, + struct netdev_windows_netdev_info *reply, + struct ofpbuf **bufp); +static struct netdev *netdev_windows_alloc(void); +static int netdev_windows_init_(void); + +/* Generic Netlink family numbers for OVS. + * + * Initialized by netdev_windows_init_(). */ +static int ovs_win_netdev_family; +struct nl_sock *ovs_win_netdev_sock; + + +static bool +is_netdev_windows_class(const struct netdev_class *netdev_class) +{ + return netdev_class->alloc == netdev_windows_alloc; +} + +static struct netdev_windows * +netdev_windows_cast(const struct netdev *netdev_) +{ + ovs_assert(is_netdev_windows_class(netdev_get_class(netdev_))); + return CONTAINER_OF(netdev_, struct netdev_windows, up); +} + +static int +netdev_windows_init_(void) +{ + int error = 0; + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + + if (ovsthread_once_start(&once)) { + error = nl_lookup_genl_family(OVS_WIN_NETDEV_FAMILY, + &ovs_win_netdev_family); + if (error) { + VLOG_ERR("Generic Netlink family '%s' does not exist. " + "The Open vSwitch kernel module is probably not loaded.", + OVS_WIN_NETDEV_FAMILY); + } + if (!error) { + /* XXX: Where to close this socket? */ + error = nl_sock_create(NETLINK_GENERIC, &ovs_win_netdev_sock); + } + + ovsthread_once_done(&once); + } + + return error; +} + +static struct netdev * +netdev_windows_alloc(void) +{ + struct netdev_windows *netdev = xzalloc(sizeof *netdev); + return netdev ? &netdev->up : NULL; +} + +static uint32_t +dp_to_netdev_ifi_flags(uint32_t dp_flags) +{ + uint32_t nd_flags = 0; + + if (dp_flags && OVS_WIN_NETDEV_IFF_UP) { + nd_flags |= NETDEV_UP; + } + + if (dp_flags && OVS_WIN_NETDEV_IFF_PROMISC) { + nd_flags |= NETDEV_PROMISC; + } + + return nd_flags; +} + +static int +netdev_windows_system_construct(struct netdev *netdev_) +{ + struct netdev_windows *netdev = netdev_windows_cast(netdev_); + uint8_t mac[ETH_ADDR_LEN]; + struct netdev_windows_netdev_info info; + struct ofpbuf *buf; + int ret; + + /* Query the attributes and runtime status of the netdev. */ + ret = query_netdev(netdev_get_name(&netdev->up), &info, &buf); + if (ret) { + return ret; + } + ofpbuf_delete(buf); + + netdev->change_seq = 1; + netdev->dev_type = info.ovs_type; + netdev->port_no = info.port_no; + + memcpy(netdev->mac, info.mac_address, ETH_ADDR_LEN); + netdev->cache_valid = VALID_ETHERADDR; + netdev->ifindex = -EOPNOTSUPP; + + netdev->mtu = info.mtu; + netdev->cache_valid |= VALID_MTU; + + netdev->ifi_flags = dp_to_netdev_ifi_flags(info.ifi_flags); + netdev->cache_valid |= VALID_IFFLAG; + + VLOG_DBG("construct device %s, ovs_type: %u.", + netdev_get_name(&netdev->up), info.ovs_type); + return 0; +} + +static int +netdev_windows_netdev_to_ofpbuf(struct netdev_windows_netdev_info *info, + struct ofpbuf *buf) +{ + struct ovs_header *ovs_header; + int error = EINVAL; + + nl_msg_put_genlmsghdr(buf, 0, ovs_win_netdev_family, + NLM_F_REQUEST | NLM_F_ECHO, + info->cmd, OVS_WIN_NETDEV_VERSION); + + ovs_header = ofpbuf_put_uninit(buf, sizeof *ovs_header); + ovs_header->dp_ifindex = info->dp_ifindex; + + if (info->name) { + nl_msg_put_string(buf, OVS_WIN_NETDEV_ATTR_NAME, info->name); + error = 0; + } + + return error; +} + +static void +netdev_windows_info_init(struct netdev_windows_netdev_info *info) +{ + memset(info, 0, sizeof *info); +} + +static int +netdev_windows_netdev_from_ofpbuf(struct netdev_windows_netdev_info *info, + struct ofpbuf *buf) +{ + static const struct nl_policy ovs_netdev_policy[] = { + [OVS_WIN_NETDEV_ATTR_PORT_NO] = { .type = NL_A_U32 }, + [OVS_WIN_NETDEV_ATTR_TYPE] = { .type = NL_A_U32 }, + [OVS_WIN_NETDEV_ATTR_NAME] = { .type = NL_A_STRING, .max_len = IFNAMSIZ }, + [OVS_WIN_NETDEV_ATTR_MAC_ADDR] = { NL_POLICY_FOR(info->mac_address) }, + [OVS_WIN_NETDEV_ATTR_MTU] = { .type = NL_A_U32 }, + [OVS_WIN_NETDEV_ATTR_IF_FLAGS] = { .type = NL_A_U32 }, + }; + + struct nlattr *a[ARRAY_SIZE(ovs_netdev_policy)]; + struct ovs_header *ovs_header; + struct nlmsghdr *nlmsg; + struct genlmsghdr *genl; + struct ofpbuf b; + + netdev_windows_info_init(info); + + ofpbuf_use_const(&b, buf->data, buf->size); + nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg); + genl = ofpbuf_try_pull(&b, sizeof *genl); + ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header); + if (!nlmsg || !genl || !ovs_header + || nlmsg->nlmsg_type != ovs_win_netdev_family + || !nl_policy_parse(&b, 0, ovs_netdev_policy, a, + ARRAY_SIZE(ovs_netdev_policy))) { + return EINVAL; + } + + info->cmd = genl->cmd; + info->dp_ifindex = ovs_header->dp_ifindex; + info->port_no = nl_attr_get_odp_port(a[OVS_WIN_NETDEV_ATTR_PORT_NO]); + info->ovs_type = nl_attr_get_u32(a[OVS_WIN_NETDEV_ATTR_TYPE]); + info->name = nl_attr_get_string(a[OVS_WIN_NETDEV_ATTR_NAME]); + memcpy(info->mac_address, nl_attr_get_unspec(a[OVS_WIN_NETDEV_ATTR_MAC_ADDR], + sizeof(info->mac_address)), sizeof(info->mac_address)); + info->mtu = nl_attr_get_u32(a[OVS_WIN_NETDEV_ATTR_MTU]); + info->ifi_flags = nl_attr_get_u32(a[OVS_WIN_NETDEV_ATTR_IF_FLAGS]); + + return 0; +} + +static int +query_netdev(const char *devname, + struct netdev_windows_netdev_info *info, + struct ofpbuf **bufp) +{ + int error = 0; + struct ofpbuf *request_buf; + + ovs_assert(info != NULL); + netdev_windows_info_init(info); + + error = netdev_windows_init_(); + if (error) { + if (info) { + *bufp = NULL; + netdev_windows_info_init(info); + } + return error; + } + + request_buf = ofpbuf_new(1024); + info->cmd = OVS_WIN_NETDEV_CMD_GET; + info->name = devname; + error = netdev_windows_netdev_to_ofpbuf(info, request_buf); + if (error) { + ofpbuf_delete(request_buf); + return error; + } + + error = nl_transact(NETLINK_GENERIC, request_buf, bufp); + ofpbuf_delete(request_buf); + + if (info) { + if (!error) { + error = netdev_windows_netdev_from_ofpbuf(info, *bufp); + } + if (error) { + netdev_windows_info_init(info); + ofpbuf_delete(*bufp); + *bufp = NULL; + } + } + + return 0; +} + +static void +netdev_windows_destruct(struct netdev *netdev_) +{ + +} + +static void +netdev_windows_dealloc(struct netdev *netdev_) +{ + struct netdev_windows *netdev = netdev_windows_cast(netdev_); + free(netdev); +} + +static int +netdev_windows_get_etheraddr(const struct netdev *netdev_, + uint8_t mac[ETH_ADDR_LEN]) +{ + struct netdev_windows *netdev = netdev_windows_cast(netdev_); + + ovs_assert((netdev->cache_valid & VALID_ETHERADDR) != 0); + if (netdev->cache_valid & VALID_ETHERADDR) { + memcpy(mac, netdev->mac, ETH_ADDR_LEN); + } else { + return EINVAL; + } + return 0; +} + +static int +netdev_windows_get_mtu(const struct netdev *netdev_, int *mtup) +{ + struct netdev_windows *netdev = netdev_windows_cast(netdev_); + + ovs_assert((netdev->cache_valid & VALID_MTU) != 0); + if (netdev->cache_valid & VALID_MTU) { + *mtup = netdev->mtu; + } else { + return EINVAL; + } + return 0; +} + +/* This functionality is not really required by the datapath. + * But vswitchd bringup expects this to be implemented. */ +static int +netdev_windows_set_etheraddr(const struct netdev *netdev_, + uint8_t mac[ETH_ADDR_LEN]) +{ + return 0; +} + +/* This functionality is not really required by the datapath. + * But vswitchd bringup expects this to be implemented. */ +static int +netdev_windows_update_flags(struct netdev *netdev_, + enum netdev_flags off, + enum netdev_flags on, + enum netdev_flags *old_flagsp) +{ + struct netdev_windows *netdev = netdev_windows_cast(netdev_); + + ovs_assert((netdev->cache_valid & VALID_IFFLAG) != 0); + if (netdev->cache_valid & VALID_IFFLAG) { + *old_flagsp = netdev->ifi_flags; + /* Setting the interface flags is not supported. */ + } else { + return EINVAL; + } + return 0; +} + +/* Looks up in the ARP table entry for a given 'ip'. If it is found, the + * corresponding MAC address will be copied in 'mac' and return 0. If no + * matching entry is found or an error occurs it will log it and return ENXIO. + */ +static int +netdev_windows_arp_lookup(const struct netdev *netdev, + ovs_be32 ip, uint8_t mac[ETH_ADDR_LEN]) +{ + PMIB_IPNETTABLE arp_table = NULL; + /* The buffer length of all ARP entries */ + uint32_t buffer_length = 0; + uint32_t ret_val = 0; + uint32_t counter = 0; + + ret_val = GetIpNetTable(arp_table, &buffer_length, false); + + if (ret_val != ERROR_INSUFFICIENT_BUFFER ) { + VLOG_ERR("Call to GetIpNetTable failed with error: %s", + ovs_format_message(ret_val)); + return ENXIO; + } + + arp_table = (MIB_IPNETTABLE *) malloc(buffer_length); + + if (arp_table == NULL) { + VLOG_ERR("Could not allocate memory for all the interfaces"); + return ENXIO; + } + + ret_val = GetIpNetTable(arp_table, &buffer_length, false); + + if (ret_val == NO_ERROR) { + for (counter = 0; counter < arp_table->dwNumEntries; counter++) { + if (arp_table->table[counter].dwAddr == ip) { + memcpy(mac, arp_table->table[counter].bPhysAddr, ETH_ADDR_LEN); + + free(arp_table); + return 0; + } + } + } else { + VLOG_ERR("Call to GetIpNetTable failed with error: %s", + ovs_format_message(ret_val)); + } + + free(arp_table); + return ENXIO; +} + +static int +netdev_windows_get_next_hop(const struct in_addr *host, + struct in_addr *next_hop, + char **netdev_name) +{ + uint32_t ret_val = 0; + /* The buffer length of all addresses */ + uint32_t buffer_length = 1000; + PIP_ADAPTER_ADDRESSES all_addr = NULL; + PIP_ADAPTER_ADDRESSES cur_addr = NULL; + + ret_val = GetAdaptersAddresses(AF_INET, + GAA_FLAG_INCLUDE_PREFIX | + GAA_FLAG_INCLUDE_GATEWAYS, + NULL, all_addr, &buffer_length); + + if (ret_val != ERROR_INSUFFICIENT_BUFFER ) { + VLOG_ERR("Call to GetAdaptersAddresses failed with error: %s", + ovs_format_message(ret_val)); + return ENXIO; + } + + all_addr = (IP_ADAPTER_ADDRESSES *) malloc(buffer_length); + + if (all_addr == NULL) { + VLOG_ERR("Could not allocate memory for all the interfaces"); + return ENXIO; + } + + ret_val = GetAdaptersAddresses(AF_INET, + GAA_FLAG_INCLUDE_PREFIX | + GAA_FLAG_INCLUDE_GATEWAYS, + NULL, all_addr, &buffer_length); + + if (ret_val == NO_ERROR) { + cur_addr = all_addr; + while (cur_addr) { + if(cur_addr->FirstGatewayAddress && + cur_addr->FirstGatewayAddress->Address.lpSockaddr) { + struct sockaddr_in *ipv4 = (struct sockaddr_in *) + cur_addr->FirstGatewayAddress->Address.lpSockaddr; + next_hop->s_addr = ipv4->sin_addr.S_un.S_addr; + *netdev_name = xstrdup((char *)cur_addr->FriendlyName); + + free(all_addr); + + return 0; + } + + cur_addr = cur_addr->Next; + } + } else { + VLOG_ERR("Call to GetAdaptersAddresses failed with error: %s", + ovs_format_message(ret_val)); + } + + if (all_addr) { + free(all_addr); + } + return ENXIO; +} + +static int +netdev_windows_internal_construct(struct netdev *netdev_) +{ + return netdev_windows_system_construct(netdev_); +} + + +#define NETDEV_WINDOWS_CLASS(NAME, CONSTRUCT) \ +{ \ + .type = NAME, \ + .alloc = netdev_windows_alloc, \ + .construct = CONSTRUCT, \ + .destruct = netdev_windows_destruct, \ + .dealloc = netdev_windows_dealloc, \ + .get_etheraddr = netdev_windows_get_etheraddr, \ + .set_etheraddr = netdev_windows_set_etheraddr, \ + .update_flags = netdev_windows_update_flags, \ + .get_next_hop = netdev_windows_get_next_hop, \ + .arp_lookup = netdev_windows_arp_lookup, \ +} + +const struct netdev_class netdev_windows_class = + NETDEV_WINDOWS_CLASS( + "system", + netdev_windows_system_construct); + +const struct netdev_class netdev_internal_class = + NETDEV_WINDOWS_CLASS( + "internal", + netdev_windows_internal_construct); diff -Nru openvswitch-2.3.1/lib/netlink.c openvswitch-2.4.0~git20150623/lib/netlink.c --- openvswitch-2.3.1/lib/netlink.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netlink.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ #include "ofpbuf.h" #include "timeval.h" #include "unaligned.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(netlink); @@ -67,7 +67,7 @@ int code = EPROTO; if (!err) { VLOG_ERR_RL(&rl, "received invalid nlmsgerr (%"PRIu32" bytes < %"PRIuSIZE")", - ofpbuf_size(msg), NLMSG_HDRLEN + sizeof *err); + msg->size, NLMSG_HDRLEN + sizeof *err); } else if (err->error <= 0 && err->error > INT_MIN) { code = -err->error; } @@ -113,7 +113,7 @@ { struct nlmsghdr *nlmsghdr; - ovs_assert(ofpbuf_size(msg) == 0); + ovs_assert(msg->size == 0); nl_msg_reserve(msg, NLMSG_HDRLEN + expected_payload); nlmsghdr = nl_msg_put_uninit(msg, NLMSG_HDRLEN); @@ -152,7 +152,7 @@ struct genlmsghdr *genlmsghdr; nl_msg_put_nlmsghdr(msg, GENL_HDRLEN + expected_payload, family, flags); - ovs_assert(ofpbuf_size(msg) == NLMSG_HDRLEN); + ovs_assert(msg->size == NLMSG_HDRLEN); genlmsghdr = nl_msg_put_uninit(msg, GENL_HDRLEN); genlmsghdr->cmd = cmd; genlmsghdr->version = version; @@ -214,7 +214,7 @@ { size_t total_size = NLA_HDRLEN + size; struct nlattr* nla = nl_msg_put_uninit(msg, total_size); - ovs_assert(NLA_ALIGN(total_size) <= UINT16_MAX); + ovs_assert(!nl_attr_oversized(size)); nla->nla_len = total_size; nla->nla_type = type; return nla + 1; @@ -432,7 +432,7 @@ size_t nl_msg_start_nested(struct ofpbuf *msg, uint16_t type) { - size_t offset = ofpbuf_size(msg); + size_t offset = msg->size; nl_msg_put_unspec(msg, type, NULL, 0); return offset; } @@ -443,7 +443,7 @@ nl_msg_end_nested(struct ofpbuf *msg, size_t offset) { struct nlattr *attr = ofpbuf_at_assert(msg, offset, sizeof *attr); - attr->nla_len = ofpbuf_size(msg) - offset; + attr->nla_len = msg->size - offset; } /* Appends a nested Netlink attribute of the given 'type', with the 'size' @@ -459,25 +459,26 @@ /* If 'buffer' begins with a valid "struct nlmsghdr", pulls the header and its * payload off 'buffer', stores header and payload in 'msg->data' and - * 'ofpbuf_size(msg)', and returns a pointer to the header. + * 'msg->size', and returns a pointer to the header. * * If 'buffer' does not begin with a "struct nlmsghdr" or begins with one that - * is invalid, returns NULL without modifying 'buffer'. */ + * is invalid, returns NULL and clears 'buffer' and 'msg'. */ struct nlmsghdr * nl_msg_next(struct ofpbuf *buffer, struct ofpbuf *msg) { - if (ofpbuf_size(buffer) >= sizeof(struct nlmsghdr)) { + if (buffer->size >= sizeof(struct nlmsghdr)) { struct nlmsghdr *nlmsghdr = nl_msg_nlmsghdr(buffer); size_t len = nlmsghdr->nlmsg_len; - if (len >= sizeof *nlmsghdr && len <= ofpbuf_size(buffer)) { + if (len >= sizeof *nlmsghdr && len <= buffer->size) { ofpbuf_use_const(msg, nlmsghdr, len); ofpbuf_pull(buffer, len); return nlmsghdr; } } - ofpbuf_set_data(msg, NULL); - ofpbuf_set_size(msg, 0); + ofpbuf_clear(buffer); + msg->data = NULL; + msg->size = 0; return NULL; } @@ -488,7 +489,7 @@ bool nl_attr_oversized(size_t payload_size) { - return NL_ATTR_SIZE(payload_size) > UINT16_MAX; + return payload_size > UINT16_MAX - NLA_HDRLEN; } /* Attributes. */ @@ -728,13 +729,13 @@ memset(attrs, 0, n_attrs * sizeof *attrs); - if (ofpbuf_size(msg) < nla_offset) { + if (msg->size < nla_offset) { VLOG_DBG_RL(&rl, "missing headers in nl_policy_parse"); return false; } NL_ATTR_FOR_EACH (nla, left, ofpbuf_at(msg, nla_offset, 0), - ofpbuf_size(msg) - nla_offset) + msg->size - nla_offset) { uint16_t type = nl_attr_type(nla); if (type < n_attrs && policy[type].type != NL_A_NO_ATTR) { @@ -798,7 +799,7 @@ const struct nlattr * nl_attr_find(const struct ofpbuf *buf, size_t hdr_len, uint16_t type) { - return nl_attr_find__(ofpbuf_at(buf, hdr_len, 0), ofpbuf_size(buf) - hdr_len, + return nl_attr_find__(ofpbuf_at(buf, hdr_len, 0), buf->size - hdr_len, type); } diff -Nru openvswitch-2.3.1/lib/netlink.h openvswitch-2.4.0~git20150623/lib/netlink.h --- openvswitch-2.3.1/lib/netlink.h 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netlink.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,7 +94,14 @@ struct nlmsghdr *nl_msg_next(struct ofpbuf *buffer, struct ofpbuf *msg); /* Sizes of various attribute types, in bytes, including the attribute header - * and padding. */ + * and padding. + * + * A minimum-size attribute is 4 bytes long: 4 bytes of header, no bytes of + * payload, no padding. + * + * A maximum-size attribute is 65536 bytes long: 4 bytes of header, 65531 bytes + * of payload, 1 byte of padding. (Thus, NL_ATTR_SIZE() of a maximum length + * attribute payload does not fit in 16 bits.) */ #define NL_ATTR_SIZE(PAYLOAD_SIZE) (NLA_HDRLEN + NLA_ALIGN(PAYLOAD_SIZE)) #define NL_A_U8_SIZE NL_ATTR_SIZE(sizeof(uint8_t)) #define NL_A_U16_SIZE NL_ATTR_SIZE(sizeof(uint16_t)) diff -Nru openvswitch-2.3.1/lib/netlink-notifier.c openvswitch-2.4.0~git20150623/lib/netlink-notifier.c --- openvswitch-2.3.1/lib/netlink-notifier.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netlink-notifier.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,7 +26,7 @@ #include "netlink.h" #include "netlink-socket.h" #include "ofpbuf.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(netlink_notifier); @@ -36,7 +36,7 @@ struct nln { struct nl_sock *notify_sock; /* Netlink socket. */ - struct list all_notifiers; /* All nln notifiers. */ + struct ovs_list all_notifiers; /* All nln notifiers. */ bool has_run; /* Guard for run and wait functions. */ /* Passed in by nln_create(). */ @@ -49,7 +49,7 @@ struct nln_notifier { struct nln *nln; /* Parent nln. */ - struct list node; + struct ovs_list node; nln_notify_func *cb; void *aux; }; @@ -182,12 +182,15 @@ return; } else { if (error == ENOBUFS) { + /* The socket buffer might be full, there could be too many + * notifications, so it makes sense to call nln_report() */ + nln_report(nln, NULL); VLOG_WARN_RL(&rl, "netlink receive buffer overflowed"); } else { VLOG_WARN_RL(&rl, "error reading netlink socket: %s", ovs_strerror(error)); } - nln_report(nln, NULL); + return; } } } diff -Nru openvswitch-2.3.1/lib/netlink-protocol.h openvswitch-2.4.0~git20150623/lib/netlink-protocol.h --- openvswitch-2.3.1/lib/netlink-protocol.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netlink-protocol.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, 2011 Nicira, Inc. + * Copyright (c) 2008, 2010, 2011, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,14 +40,6 @@ #else #define NETLINK_GENERIC 16 -struct sockaddr_nl { - sa_family_t nl_family; - unsigned short int nl_pad; - uint32_t nl_pid; - uint32_t nl_groups; -}; -BUILD_ASSERT_DECL(sizeof(struct sockaddr_nl) == 12); - /* nlmsg_flags bits. */ #define NLM_F_REQUEST 0x001 #define NLM_F_MULTI 0x002 @@ -56,7 +48,9 @@ #define NLM_F_ROOT 0x100 #define NLM_F_MATCH 0x200 +#define NLM_F_EXCL 0x200 #define NLM_F_ATOMIC 0x400 +#define NLM_F_CREATE 0x400 #define NLM_F_DUMP (NLM_F_ROOT | NLM_F_MATCH) /* nlmsg_type values. */ @@ -67,6 +61,8 @@ #define NLMSG_MIN_TYPE 0x10 +#define MAX_LINKS 32 + struct nlmsghdr { uint32_t nlmsg_len; uint16_t nlmsg_type; diff -Nru openvswitch-2.3.1/lib/netlink-socket.c openvswitch-2.4.0~git20150623/lib/netlink-socket.c --- openvswitch-2.3.1/lib/netlink-socket.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netlink-socket.c 2015-06-23 18:46:21.000000000 +0000 @@ -28,13 +28,14 @@ #include "hmap.h" #include "netlink.h" #include "netlink-protocol.h" +#include "odp-netlink.h" #include "ofpbuf.h" #include "ovs-thread.h" #include "poll-loop.h" #include "seq.h" #include "socket-util.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(netlink_socket); @@ -48,6 +49,20 @@ #define SOL_NETLINK 270 #endif +#ifdef _WIN32 +static struct ovs_mutex portid_mutex = OVS_MUTEX_INITIALIZER; +static uint32_t g_last_portid = 0; + +/* Port IDs must be unique! */ +static uint32_t +portid_next(void) + OVS_GUARDED_BY(portid_mutex) +{ + g_last_portid++; + return g_last_portid; +} +#endif /* _WIN32 */ + /* A single (bad) Netlink message can in theory dump out many, many log * messages, so the burst size is set quite high here to avoid missing useful * information. Also, at high logging levels we log *all* Netlink messages. */ @@ -56,11 +71,20 @@ static uint32_t nl_sock_allocate_seq(struct nl_sock *, unsigned int n); static void log_nlmsg(const char *function, int error, const void *message, size_t size, int protocol); +#ifdef _WIN32 +static int get_sock_pid_from_kernel(struct nl_sock *sock); +#endif /* Netlink sockets. */ struct nl_sock { +#ifdef _WIN32 + HANDLE handle; + OVERLAPPED overlapped; + DWORD read_ioctl; +#else int fd; +#endif uint32_t next_seq; uint32_t pid; int protocol; @@ -88,7 +112,9 @@ { static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; struct nl_sock *sock; +#ifndef _WIN32 struct sockaddr_nl local, remote; +#endif socklen_t local_size; int rcvbuf; int retval = 0; @@ -114,15 +140,45 @@ *sockp = NULL; sock = xmalloc(sizeof *sock); +#ifdef _WIN32 + sock->handle = CreateFile(OVS_DEVICE_NAME_USER, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); + + if (sock->handle == INVALID_HANDLE_VALUE) { + VLOG_ERR("fcntl: %s", ovs_lasterror_to_string()); + goto error; + } + + memset(&sock->overlapped, 0, sizeof sock->overlapped); + sock->overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (sock->overlapped.hEvent == NULL) { + VLOG_ERR("fcntl: %s", ovs_lasterror_to_string()); + goto error; + } + /* Initialize the type/ioctl to Generic */ + sock->read_ioctl = OVS_IOCTL_READ; +#else sock->fd = socket(AF_NETLINK, SOCK_RAW, protocol); if (sock->fd < 0) { VLOG_ERR("fcntl: %s", ovs_strerror(errno)); goto error; } +#endif + sock->protocol = protocol; sock->next_seq = 1; rcvbuf = 1024 * 1024; +#ifdef _WIN32 + sock->rcvbuf = rcvbuf; + retval = get_sock_pid_from_kernel(sock); + if (retval != 0) { + goto error; + } +#else if (setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUFFORCE, &rcvbuf, sizeof rcvbuf)) { /* Only root can use SO_RCVBUFFORCE. Everyone else gets EPERM. @@ -161,6 +217,7 @@ goto error; } sock->pid = local.nl_pid; +#endif *sockp = sock; return 0; @@ -172,9 +229,18 @@ retval = EINVAL; } } +#ifdef _WIN32 + if (sock->overlapped.hEvent) { + CloseHandle(sock->overlapped.hEvent); + } + if (sock->handle != INVALID_HANDLE_VALUE) { + CloseHandle(sock->handle); + } +#else if (sock->fd >= 0) { close(sock->fd); } +#endif free(sock); return retval; } @@ -193,11 +259,72 @@ nl_sock_destroy(struct nl_sock *sock) { if (sock) { +#ifdef _WIN32 + if (sock->overlapped.hEvent) { + CloseHandle(sock->overlapped.hEvent); + } + CloseHandle(sock->handle); +#else close(sock->fd); +#endif free(sock); } } +#ifdef _WIN32 +/* Reads the pid for 'sock' generated in the kernel datapath. The function + * uses a separate IOCTL instead of a transaction semantic to avoid unnecessary + * message overhead. */ +static int +get_sock_pid_from_kernel(struct nl_sock *sock) +{ + uint32_t pid = 0; + int retval = 0; + DWORD bytes = 0; + + if (!DeviceIoControl(sock->handle, OVS_IOCTL_GET_PID, + NULL, 0, &pid, sizeof(pid), + &bytes, NULL)) { + retval = EINVAL; + } else { + if (bytes < sizeof(pid)) { + retval = EINVAL; + } else { + sock->pid = pid; + } + } + + return retval; +} +#endif /* _WIN32 */ + +#ifdef _WIN32 +static int __inline +nl_sock_mcgroup(struct nl_sock *sock, unsigned int multicast_group, bool join) +{ + struct ofpbuf request; + uint64_t request_stub[128]; + struct ovs_header *ovs_header; + struct nlmsghdr *nlmsg; + int error; + + ofpbuf_use_stub(&request, request_stub, sizeof request_stub); + + nl_msg_put_genlmsghdr(&request, 0, OVS_WIN_NL_CTRL_FAMILY_ID, 0, + OVS_CTRL_CMD_MC_SUBSCRIBE_REQ, + OVS_WIN_CONTROL_VERSION); + + ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header); + ovs_header->dp_ifindex = 0; + + nl_msg_put_u32(&request, OVS_NL_ATTR_MCAST_GRP, multicast_group); + nl_msg_put_u8(&request, OVS_NL_ATTR_MCAST_JOIN, join ? 1 : 0); + + error = nl_sock_send(sock, &request, true); + ofpbuf_uninit(&request); + return error; +} +#endif /* Tries to add 'sock' as a listener for 'multicast_group'. Returns 0 if * successful, otherwise a positive errno value. * @@ -212,15 +339,89 @@ int nl_sock_join_mcgroup(struct nl_sock *sock, unsigned int multicast_group) { +#ifdef _WIN32 + /* Set the socket type as a "multicast" socket */ + sock->read_ioctl = OVS_IOCTL_READ_EVENT; + int error = nl_sock_mcgroup(sock, multicast_group, true); + if (error) { + sock->read_ioctl = OVS_IOCTL_READ; + VLOG_WARN("could not join multicast group %u (%s)", + multicast_group, ovs_strerror(error)); + return error; + } +#else if (setsockopt(sock->fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &multicast_group, sizeof multicast_group) < 0) { VLOG_WARN("could not join multicast group %u (%s)", multicast_group, ovs_strerror(errno)); return errno; } +#endif return 0; } +#ifdef _WIN32 +int +nl_sock_subscribe_packets(struct nl_sock *sock) +{ + int error; + + if (sock->read_ioctl != OVS_IOCTL_READ) { + return EINVAL; + } + + error = nl_sock_subscribe_packet__(sock, true); + if (error) { + VLOG_WARN("could not unsubscribe packets (%s)", + ovs_strerror(errno)); + return error; + } + sock->read_ioctl = OVS_IOCTL_READ_PACKET; + + return 0; +} + +int +nl_sock_unsubscribe_packets(struct nl_sock *sock) +{ + ovs_assert(sock->read_ioctl == OVS_IOCTL_READ_PACKET); + + int error = nl_sock_subscribe_packet__(sock, false); + if (error) { + VLOG_WARN("could not subscribe to packets (%s)", + ovs_strerror(errno)); + return error; + } + + sock->read_ioctl = OVS_IOCTL_READ; + return 0; +} + +int +nl_sock_subscribe_packet__(struct nl_sock *sock, bool subscribe) +{ + struct ofpbuf request; + uint64_t request_stub[128]; + struct ovs_header *ovs_header; + struct nlmsghdr *nlmsg; + int error; + + ofpbuf_use_stub(&request, request_stub, sizeof request_stub); + nl_msg_put_genlmsghdr(&request, 0, OVS_WIN_NL_CTRL_FAMILY_ID, 0, + OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ, + OVS_WIN_CONTROL_VERSION); + + ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header); + ovs_header->dp_ifindex = 0; + nl_msg_put_u8(&request, OVS_NL_ATTR_PACKET_SUBSCRIBE, subscribe ? 1 : 0); + nl_msg_put_u32(&request, OVS_NL_ATTR_PACKET_PID, sock->pid); + + error = nl_sock_send(sock, &request, true); + ofpbuf_uninit(&request); + return error; +} +#endif + /* Tries to make 'sock' stop listening to 'multicast_group'. Returns 0 if * successful, otherwise a positive errno value. * @@ -234,12 +435,22 @@ int nl_sock_leave_mcgroup(struct nl_sock *sock, unsigned int multicast_group) { +#ifdef _WIN32 + int error = nl_sock_mcgroup(sock, multicast_group, false); + if (error) { + VLOG_WARN("could not leave multicast group %u (%s)", + multicast_group, ovs_strerror(error)); + return error; + } + sock->read_ioctl = OVS_IOCTL_READ; +#else if (setsockopt(sock->fd, SOL_NETLINK, NETLINK_DROP_MEMBERSHIP, &multicast_group, sizeof multicast_group) < 0) { VLOG_WARN("could not leave multicast group %u (%s)", multicast_group, ovs_strerror(errno)); return errno; } +#endif return 0; } @@ -250,15 +461,32 @@ struct nlmsghdr *nlmsg = nl_msg_nlmsghdr(msg); int error; - nlmsg->nlmsg_len = ofpbuf_size(msg); + nlmsg->nlmsg_len = msg->size; nlmsg->nlmsg_seq = nlmsg_seq; nlmsg->nlmsg_pid = sock->pid; do { int retval; - retval = send(sock->fd, ofpbuf_data(msg), ofpbuf_size(msg), wait ? 0 : MSG_DONTWAIT); +#ifdef _WIN32 + DWORD bytes; + + if (!DeviceIoControl(sock->handle, OVS_IOCTL_WRITE, + msg->data, msg->size, NULL, 0, + &bytes, NULL)) { + retval = -1; + /* XXX: Map to a more appropriate error based on GetLastError(). */ + errno = EINVAL; + VLOG_DBG_RL(&rl, "fatal driver failure in write: %s", + ovs_lasterror_to_string()); + } else { + retval = msg->size; + } +#else + retval = send(sock->fd, msg->data, msg->size, + wait ? 0 : MSG_DONTWAIT); +#endif error = retval < 0 ? errno : 0; } while (error == EINTR); - log_nlmsg(__func__, error, ofpbuf_data(msg), ofpbuf_size(msg), sock->protocol); + log_nlmsg(__func__, error, msg->data, msg->size, sock->protocol); if (!error) { COVERAGE_INC(netlink_sent); } @@ -266,7 +494,7 @@ } /* Tries to send 'msg', which must contain a Netlink message, to the kernel on - * 'sock'. nlmsg_len in 'msg' will be finalized to match ofpbuf_size(msg), nlmsg_pid + * 'sock'. nlmsg_len in 'msg' will be finalized to match msg->size, nlmsg_pid * will be set to 'sock''s pid, and nlmsg_seq will be initialized to a fresh * sequence number, before the message is sent. * @@ -280,7 +508,7 @@ } /* Tries to send 'msg', which must contain a Netlink message, to the kernel on - * 'sock'. nlmsg_len in 'msg' will be finalized to match ofpbuf_size(msg), nlmsg_pid + * 'sock'. nlmsg_len in 'msg' will be finalized to match msg->size, nlmsg_pid * will be set to 'sock''s pid, and nlmsg_seq will be initialized to * 'nlmsg_seq', before the message is sent. * @@ -315,7 +543,7 @@ ovs_assert(buf->allocated >= sizeof *nlmsghdr); ofpbuf_clear(buf); - iov[0].iov_base = ofpbuf_base(buf); + iov[0].iov_base = buf->base; iov[0].iov_len = buf->allocated; iov[1].iov_base = tail; iov[1].iov_len = sizeof tail; @@ -331,10 +559,36 @@ * anything in the receive buffer in that case, so we can initialize the * Netlink header with an impossible message length and then, upon success, * check whether it changed. */ - nlmsghdr = ofpbuf_base(buf); + nlmsghdr = buf->base; do { nlmsghdr->nlmsg_len = UINT32_MAX; +#ifdef _WIN32 + DWORD bytes; + if (!DeviceIoControl(sock->handle, sock->read_ioctl, + NULL, 0, tail, sizeof tail, &bytes, NULL)) { + VLOG_DBG_RL(&rl, "fatal driver failure in transact: %s", + ovs_lasterror_to_string()); + retval = -1; + /* XXX: Map to a more appropriate error. */ + errno = EINVAL; + } else { + retval = bytes; + if (retval == 0) { + retval = -1; + errno = EAGAIN; + } else { + if (retval >= buf->allocated) { + ofpbuf_reinit(buf, retval); + nlmsghdr = buf->base; + nlmsghdr->nlmsg_len = UINT32_MAX; + } + memcpy(buf->data, tail, retval); + buf->size = retval; + } + } +#else retval = recvmsg(sock->fd, &msg, wait ? 0 : MSG_DONTWAIT); +#endif error = (retval < 0 ? errno : retval == 0 ? ECONNRESET /* not possible? */ : nlmsghdr->nlmsg_len != UINT32_MAX ? 0 @@ -362,14 +616,15 @@ retval, sizeof *nlmsghdr); return EPROTO; } - - ofpbuf_set_size(buf, MIN(retval, buf->allocated)); +#ifndef _WIN32 + buf->size = MIN(retval, buf->allocated); if (retval > buf->allocated) { COVERAGE_INC(netlink_recv_jumbo); ofpbuf_put(buf, tail, retval - buf->allocated); } +#endif - log_nlmsg(__func__, 0, ofpbuf_data(buf), ofpbuf_size(buf), sock->protocol); + log_nlmsg(__func__, 0, buf->data, buf->size, sock->protocol); COVERAGE_INC(netlink_received); return 0; @@ -435,14 +690,15 @@ struct nl_transaction *txn = transactions[i]; struct nlmsghdr *nlmsg = nl_msg_nlmsghdr(txn->request); - nlmsg->nlmsg_len = ofpbuf_size(txn->request); + nlmsg->nlmsg_len = txn->request->size; nlmsg->nlmsg_seq = base_seq + i; nlmsg->nlmsg_pid = sock->pid; - iovs[i].iov_base = ofpbuf_data(txn->request); - iovs[i].iov_len = ofpbuf_size(txn->request); + iovs[i].iov_base = txn->request->data; + iovs[i].iov_len = txn->request->size; } +#ifndef _WIN32 memset(&msg, 0, sizeof msg); msg.msg_iov = iovs; msg.msg_iovlen = n; @@ -453,8 +709,8 @@ for (i = 0; i < n; i++) { struct nl_transaction *txn = transactions[i]; - log_nlmsg(__func__, error, ofpbuf_data(txn->request), ofpbuf_size(txn->request), - sock->protocol); + log_nlmsg(__func__, error, txn->request->data, + txn->request->size, sock->protocol); } if (!error) { COVERAGE_ADD(netlink_sent, n); @@ -533,30 +789,98 @@ base_seq += i + 1; } ofpbuf_uninit(&tmp_reply); +#else + error = 0; + uint8_t reply_buf[65536]; + for (i = 0; i < n; i++) { + DWORD reply_len; + bool ret; + struct nl_transaction *txn = transactions[i]; + struct nlmsghdr *request_nlmsg, *reply_nlmsg; + + ret = DeviceIoControl(sock->handle, OVS_IOCTL_TRANSACT, + txn->request->data, + txn->request->size, + reply_buf, sizeof reply_buf, + &reply_len, NULL); + + if (ret && reply_len == 0) { + /* + * The current transaction did not produce any data to read and that + * is not an error as such. Continue with the remainder of the + * transactions. + */ + txn->error = 0; + if (txn->reply) { + ofpbuf_clear(txn->reply); + } + } else if (!ret) { + /* XXX: Map to a more appropriate error. */ + error = EINVAL; + VLOG_DBG_RL(&rl, "fatal driver failure: %s", + ovs_lasterror_to_string()); + break; + } + + if (reply_len != 0) { + if (reply_len < sizeof *reply_nlmsg) { + nl_sock_record_errors__(transactions, n, 0); + VLOG_DBG_RL(&rl, "insufficient length of reply %#"PRIu32 + " for seq: %#"PRIx32, reply_len, request_nlmsg->nlmsg_seq); + break; + } + + /* Validate the sequence number in the reply. */ + request_nlmsg = nl_msg_nlmsghdr(txn->request); + reply_nlmsg = (struct nlmsghdr *)reply_buf; + + if (request_nlmsg->nlmsg_seq != reply_nlmsg->nlmsg_seq) { + ovs_assert(request_nlmsg->nlmsg_seq == reply_nlmsg->nlmsg_seq); + VLOG_DBG_RL(&rl, "mismatched seq request %#"PRIx32 + ", reply %#"PRIx32, request_nlmsg->nlmsg_seq, + reply_nlmsg->nlmsg_seq); + break; + } + + /* Handle errors embedded within the netlink message. */ + ofpbuf_use_stub(&tmp_reply, reply_buf, sizeof reply_buf); + tmp_reply.size = sizeof reply_buf; + if (nl_msg_nlmsgerr(&tmp_reply, &txn->error)) { + if (txn->reply) { + ofpbuf_clear(txn->reply); + } + if (txn->error) { + VLOG_DBG_RL(&rl, "received NAK error=%d (%s)", + error, ovs_strerror(txn->error)); + } + } else { + txn->error = 0; + if (txn->reply) { + /* Copy the reply to the buffer specified by the caller. */ + if (reply_len > txn->reply->allocated) { + ofpbuf_reinit(txn->reply, reply_len); + } + memcpy(txn->reply->data, reply_buf, reply_len); + txn->reply->size = reply_len; + } + } + ofpbuf_uninit(&tmp_reply); + } + + /* Count the number of successful transactions. */ + (*done)++; + + } + + if (!error) { + COVERAGE_ADD(netlink_sent, n); + } +#endif return error; } -/* Sends the 'request' member of the 'n' transactions in 'transactions' on - * 'sock', in order, and receives responses to all of them. Fills in the - * 'error' member of each transaction with 0 if it was successful, otherwise - * with a positive errno value. If 'reply' is nonnull, then it will be filled - * with the reply if the message receives a detailed reply. In other cases, - * i.e. where the request failed or had no reply beyond an indication of - * success, 'reply' will be cleared if it is nonnull. - * - * The caller is responsible for destroying each request and reply, and the - * transactions array itself. - * - * Before sending each message, this function will finalize nlmsg_len in each - * 'request' to match the ofpbuf's size, set nlmsg_pid to 'sock''s pid, and - * initialize nlmsg_seq. - * - * Bare Netlink is an unreliable transport protocol. This function layers - * reliable delivery and reply semantics on top of bare Netlink. See - * nl_sock_transact() for some caveats. - */ -void +static void nl_sock_transact_multiple(struct nl_sock *sock, struct nl_transaction **transactions, size_t n) { @@ -590,12 +914,12 @@ #else enum { MAX_BATCH_BYTES = 4096 - 512 }; #endif - bytes = ofpbuf_size(transactions[0]->request); + bytes = transactions[0]->request->size; for (count = 1; count < n && count < max_batch_count; count++) { - if (bytes + ofpbuf_size(transactions[count]->request) > MAX_BATCH_BYTES) { + if (bytes + transactions[count]->request->size > MAX_BATCH_BYTES) { break; } - bytes += ofpbuf_size(transactions[count]->request); + bytes += transactions[count]->request->size; } error = nl_sock_transact_multiple__(sock, transactions, count, &done); @@ -607,51 +931,16 @@ } else if (error) { VLOG_ERR_RL(&rl, "transaction error (%s)", ovs_strerror(error)); nl_sock_record_errors__(transactions, n, error); + if (error != EAGAIN) { + /* A fatal error has occurred. Abort the rest of + * transactions. */ + break; + } } } } -/* Sends 'request' to the kernel via 'sock' and waits for a response. If - * successful, returns 0. On failure, returns a positive errno value. - * - * If 'replyp' is nonnull, then on success '*replyp' is set to the kernel's - * reply, which the caller is responsible for freeing with ofpbuf_delete(), and - * on failure '*replyp' is set to NULL. If 'replyp' is null, then the kernel's - * reply, if any, is discarded. - * - * Before the message is sent, nlmsg_len in 'request' will be finalized to - * match ofpbuf_size(msg), nlmsg_pid will be set to 'sock''s pid, and nlmsg_seq will - * be initialized, NLM_F_ACK will be set in nlmsg_flags. - * - * The caller is responsible for destroying 'request'. - * - * Bare Netlink is an unreliable transport protocol. This function layers - * reliable delivery and reply semantics on top of bare Netlink. - * - * In Netlink, sending a request to the kernel is reliable enough, because the - * kernel will tell us if the message cannot be queued (and we will in that - * case put it on the transmit queue and wait until it can be delivered). - * - * Receiving the reply is the real problem: if the socket buffer is full when - * the kernel tries to send the reply, the reply will be dropped. However, the - * kernel sets a flag that a reply has been dropped. The next call to recv - * then returns ENOBUFS. We can then re-send the request. - * - * Caveats: - * - * 1. Netlink depends on sequence numbers to match up requests and - * replies. The sender of a request supplies a sequence number, and - * the reply echos back that sequence number. - * - * This is fine, but (1) some kernel netlink implementations are - * broken, in that they fail to echo sequence numbers and (2) this - * function will drop packets with non-matching sequence numbers, so - * that only a single request can be usefully transacted at a time. - * - * 2. Resending the request causes it to be re-executed, so the request - * needs to be idempotent. - */ -int +static int nl_sock_transact(struct nl_sock *sock, const struct ofpbuf *request, struct ofpbuf **replyp) { @@ -680,7 +969,11 @@ int nl_sock_drain(struct nl_sock *sock) { +#ifdef _WIN32 + return 0; +#else return drain_rcvbuf(sock->fd); +#endif } /* Starts a Netlink "dump" operation, by sending 'request' to the kernel on a @@ -702,33 +995,85 @@ void nl_dump_start(struct nl_dump *dump, int protocol, const struct ofpbuf *request) { - int status; - nl_msg_nlmsghdr(request)->nlmsg_flags |= NLM_F_DUMP | NLM_F_ACK; - status = nl_pool_alloc(protocol, &dump->sock); - if (!status) { - status = nl_sock_send__(dump->sock, request, - nl_sock_allocate_seq(dump->sock, 1), true); + + ovs_mutex_init(&dump->mutex); + ovs_mutex_lock(&dump->mutex); + dump->status = nl_pool_alloc(protocol, &dump->sock); + if (!dump->status) { + dump->status = nl_sock_send__(dump->sock, request, + nl_sock_allocate_seq(dump->sock, 1), + true); } - atomic_init(&dump->status, status << 1); dump->nl_seq = nl_msg_nlmsghdr(request)->nlmsg_seq; - dump->status_seq = seq_create(); - ovs_mutex_init(&dump->mutex); + ovs_mutex_unlock(&dump->mutex); +} + +static int +nl_dump_refill(struct nl_dump *dump, struct ofpbuf *buffer) + OVS_REQUIRES(dump->mutex) +{ + struct nlmsghdr *nlmsghdr; + int error; + + while (!buffer->size) { + error = nl_sock_recv__(dump->sock, buffer, false); + if (error) { + /* The kernel never blocks providing the results of a dump, so + * error == EAGAIN means that we've read the whole thing, and + * therefore transform it into EOF. (The kernel always provides + * NLMSG_DONE as a sentinel. Some other thread must have received + * that already but not yet signaled it in 'status'.) + * + * Any other error is just an error. */ + return error == EAGAIN ? EOF : error; + } + + nlmsghdr = nl_msg_nlmsghdr(buffer); + if (dump->nl_seq != nlmsghdr->nlmsg_seq) { + VLOG_DBG_RL(&rl, "ignoring seq %#"PRIx32" != expected %#"PRIx32, + nlmsghdr->nlmsg_seq, dump->nl_seq); + ofpbuf_clear(buffer); + } + } + + if (nl_msg_nlmsgerr(buffer, &error) && error) { + VLOG_INFO_RL(&rl, "netlink dump request error (%s)", + ovs_strerror(error)); + ofpbuf_clear(buffer); + return error; + } + + return 0; +} + +static int +nl_dump_next__(struct ofpbuf *reply, struct ofpbuf *buffer) +{ + struct nlmsghdr *nlmsghdr = nl_msg_next(buffer, reply); + if (!nlmsghdr) { + VLOG_WARN_RL(&rl, "netlink dump contains message fragment"); + return EPROTO; + } else if (nlmsghdr->nlmsg_type == NLMSG_DONE) { + return EOF; + } else { + return 0; + } } /* Attempts to retrieve another reply from 'dump' into 'buffer'. 'dump' must * have been initialized with nl_dump_start(), and 'buffer' must have been * initialized. 'buffer' should be at least NL_DUMP_BUFSIZE bytes long. * - * If successful, returns true and points 'reply->data' and 'ofpbuf_size(reply)' to - * the message that was retrieved. The caller must not modify 'reply' (because - * it points within 'buffer', which will be used by future calls to this - * function). - * - * On failure, returns false and sets 'reply->data' to NULL and 'ofpbuf_size(reply)' - * to 0. Failure might indicate an actual error or merely the end of replies. - * An error status for the entire dump operation is provided when it is - * completed by calling nl_dump_done(). + * If successful, returns true and points 'reply->data' and + * 'reply->size' to the message that was retrieved. The caller must not + * modify 'reply' (because it points within 'buffer', which will be used by + * future calls to this function). + * + * On failure, returns false and sets 'reply->data' to NULL and + * 'reply->size' to 0. Failure might indicate an actual error or merely + * the end of replies. An error status for the entire dump operation is + * provided when it is completed by calling nl_dump_done(). * * Multiple threads may call this function, passing the same nl_dump, however * each must provide independent buffers. This function may cache multiple @@ -739,94 +1084,47 @@ bool nl_dump_next(struct nl_dump *dump, struct ofpbuf *reply, struct ofpbuf *buffer) { - struct nlmsghdr *nlmsghdr; - int error = 0; - - ofpbuf_set_data(reply, NULL); - ofpbuf_set_size(reply, 0); + int retval = 0; - /* If 'buffer' is empty, fetch another batch of nlmsgs. */ - while (!ofpbuf_size(buffer)) { - unsigned int status; - int retval, seq; - - seq = seq_read(dump->status_seq); - atomic_read(&dump->status, &status); - if (status) { - return false; - } - - /* Take the mutex here to avoid an in-kernel race. If two threads try - * to read from a Netlink dump socket at once, then the socket error - * can be set to EINVAL, which will be encountered on the next recv on - * that socket, which could be anywhere due to the way that we pool - * Netlink sockets. Serializing the recv calls avoids the issue. */ + /* If the buffer is empty, refill it. + * + * If the buffer is not empty, we don't check the dump's status. + * Otherwise, we could end up skipping some of the dump results if thread A + * hits EOF while thread B is in the midst of processing a batch. */ + if (!buffer->size) { ovs_mutex_lock(&dump->mutex); - retval = nl_sock_recv__(dump->sock, buffer, false); + if (!dump->status) { + /* Take the mutex here to avoid an in-kernel race. If two threads + * try to read from a Netlink dump socket at once, then the socket + * error can be set to EINVAL, which will be encountered on the + * next recv on that socket, which could be anywhere due to the way + * that we pool Netlink sockets. Serializing the recv calls avoids + * the issue. */ + dump->status = nl_dump_refill(dump, buffer); + } + retval = dump->status; ovs_mutex_unlock(&dump->mutex); + } + /* Fetch the next message from the buffer. */ + if (!retval) { + retval = nl_dump_next__(reply, buffer); if (retval) { - ofpbuf_clear(buffer); - if (retval == EAGAIN) { - nl_sock_wait(dump->sock, POLLIN); - seq_wait(dump->status_seq, seq); - poll_block(); - continue; - } else { - error = retval; - goto exit; + /* Record 'retval' as the dump status, but don't overwrite an error + * with EOF. */ + ovs_mutex_lock(&dump->mutex); + if (dump->status <= 0) { + dump->status = retval; } - } - - nlmsghdr = nl_msg_nlmsghdr(buffer); - if (dump->nl_seq != nlmsghdr->nlmsg_seq) { - VLOG_DBG_RL(&rl, "ignoring seq %#"PRIx32" != expected %#"PRIx32, - nlmsghdr->nlmsg_seq, dump->nl_seq); - ofpbuf_clear(buffer); - continue; - } - - if (nl_msg_nlmsgerr(buffer, &retval) && retval) { - VLOG_INFO_RL(&rl, "netlink dump request error (%s)", - ovs_strerror(retval)); - error = retval == EAGAIN ? EPROTO : retval; - ofpbuf_clear(buffer); - goto exit; + ovs_mutex_unlock(&dump->mutex); } } - /* Fetch the next nlmsg in the current batch. */ - nlmsghdr = nl_msg_next(buffer, reply); - if (!nlmsghdr) { - VLOG_WARN_RL(&rl, "netlink dump reply contains message fragment"); - error = EPROTO; - } else if (nlmsghdr->nlmsg_type == NLMSG_DONE) { - error = EOF; + if (retval) { + reply->data = NULL; + reply->size = 0; } - -exit: - if (error == EOF) { - unsigned int old; - atomic_or(&dump->status, 1, &old); - seq_change(dump->status_seq); - } else if (error) { - atomic_store(&dump->status, error << 1); - seq_change(dump->status_seq); - } - return !error; -} - -/* Attempts to look ahead in 'buffer' to obtain the next reply that will be - * returned by nl_dump_next(). Returns true if successful, in which case - * 'reply' will be initialize to the message that will be obtained by the next - * call to nl_dump_next(), or false on failure. Failure doesn't necessarily - * mean that the nl_dump_next() will fail, only that it needs to obtain a new - * block of dump results from the kernel. */ -bool -nl_dump_peek(struct ofpbuf *reply, struct ofpbuf *buffer) -{ - struct ofpbuf tmp = *buffer; - return nl_msg_next(&tmp, reply); + return !retval; } /* Completes Netlink dump operation 'dump', which must have been initialized @@ -837,11 +1135,14 @@ { int status; + ovs_mutex_lock(&dump->mutex); + status = dump->status; + ovs_mutex_unlock(&dump->mutex); + /* Drain any remaining messages that the client didn't read. Otherwise the * kernel will continue to queue them up and waste buffer space. * * XXX We could just destroy and discard the socket in this case. */ - atomic_read(&dump->status, &status); if (!status) { uint64_t tmp_reply_stub[NL_DUMP_BUFSIZE / 8]; struct ofpbuf reply, buf; @@ -850,22 +1151,90 @@ while (nl_dump_next(dump, &reply, &buf)) { /* Nothing to do. */ } - atomic_read(&dump->status, &status); - ovs_assert(status); ofpbuf_uninit(&buf); + + ovs_mutex_lock(&dump->mutex); + status = dump->status; + ovs_mutex_unlock(&dump->mutex); + ovs_assert(status); } + nl_pool_release(dump->sock); - seq_destroy(dump->status_seq); ovs_mutex_destroy(&dump->mutex); - return status >> 1; + + return status == EOF ? 0 : status; +} + +#ifdef _WIN32 +/* Pend an I/O request in the driver. The driver completes the I/O whenever + * an event or a packet is ready to be read. Once the I/O is completed + * the overlapped structure event associated with the pending I/O will be set + */ +static int +pend_io_request(struct nl_sock *sock) +{ + struct ofpbuf request; + uint64_t request_stub[128]; + struct ovs_header *ovs_header; + struct nlmsghdr *nlmsg; + uint32_t seq; + int retval; + int error; + DWORD bytes; + OVERLAPPED *overlapped = CONST_CAST(OVERLAPPED *, &sock->overlapped); + + int ovs_msg_size = sizeof (struct nlmsghdr) + sizeof (struct genlmsghdr) + + sizeof (struct ovs_header); + + ofpbuf_use_stub(&request, request_stub, sizeof request_stub); + + seq = nl_sock_allocate_seq(sock, 1); + nl_msg_put_genlmsghdr(&request, 0, OVS_WIN_NL_CTRL_FAMILY_ID, 0, + OVS_CTRL_CMD_WIN_PEND_REQ, OVS_WIN_CONTROL_VERSION); + nlmsg = nl_msg_nlmsghdr(&request); + nlmsg->nlmsg_seq = seq; + nlmsg->nlmsg_pid = sock->pid; + + ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header); + ovs_header->dp_ifindex = 0; + + if (!DeviceIoControl(sock->handle, OVS_IOCTL_WRITE, + request.data, request.size, + NULL, 0, &bytes, overlapped)) { + error = GetLastError(); + /* Check if the I/O got pended */ + if (error != ERROR_IO_INCOMPLETE && error != ERROR_IO_PENDING) { + VLOG_ERR("nl_sock_wait failed - %s\n", ovs_format_message(error)); + retval = EINVAL; + goto done; + } + } else { + /* The I/O was completed synchronously */ + poll_immediate_wake(); + } + retval = 0; + +done: + ofpbuf_uninit(&request); + return retval; } +#endif /* _WIN32 */ /* Causes poll_block() to wake up when any of the specified 'events' (which is - * a OR'd combination of POLLIN, POLLOUT, etc.) occur on 'sock'. */ + * a OR'd combination of POLLIN, POLLOUT, etc.) occur on 'sock'. + * On Windows, 'sock' is not treated as const, and may be modified. */ void nl_sock_wait(const struct nl_sock *sock, short int events) { +#ifdef _WIN32 + if (sock->overlapped.Internal != STATUS_PENDING) { + pend_io_request(CONST_CAST(struct nl_sock *, sock)); + /* XXX: poll_wevent_wait(sock->overlapped.hEvent); */ + } + poll_immediate_wake(); /* XXX: temporary. */ +#else poll_fd_wait(sock->fd, events); +#endif } /* Returns the underlying fd for 'sock', for use in "poll()"-like operations @@ -878,7 +1247,12 @@ int nl_sock_fd(const struct nl_sock *sock) { +#ifdef _WIN32 + BUILD_ASSERT_DECL(sizeof sock->handle == sizeof(int)); + return (int)sock->handle; +#else return sock->fd; +#endif } /* Returns the PID associated with this socket. */ @@ -946,6 +1320,7 @@ } } +#ifndef _WIN32 static int do_lookup_genl_family(const char *name, struct nlattr **attrs, struct ofpbuf **replyp) @@ -983,6 +1358,97 @@ *replyp = reply; return 0; } +#else +static int +do_lookup_genl_family(const char *name, struct nlattr **attrs, + struct ofpbuf **replyp) +{ + struct nlmsghdr *nlmsg; + struct ofpbuf *reply; + int error; + uint16_t family_id; + const char *family_name; + uint32_t family_version; + uint32_t family_attrmax; + uint32_t mcgrp_id = OVS_WIN_NL_INVALID_MCGRP_ID; + const char *mcgrp_name = NULL; + + *replyp = NULL; + reply = ofpbuf_new(1024); + + /* CTRL_ATTR_MCAST_GROUPS is supported only for VPORT family. */ + if (!strcmp(name, OVS_WIN_CONTROL_FAMILY)) { + family_id = OVS_WIN_NL_CTRL_FAMILY_ID; + family_name = OVS_WIN_CONTROL_FAMILY; + family_version = OVS_WIN_CONTROL_VERSION; + family_attrmax = OVS_WIN_CONTROL_ATTR_MAX; + } else if (!strcmp(name, OVS_DATAPATH_FAMILY)) { + family_id = OVS_WIN_NL_DATAPATH_FAMILY_ID; + family_name = OVS_DATAPATH_FAMILY; + family_version = OVS_DATAPATH_VERSION; + family_attrmax = OVS_DP_ATTR_MAX; + } else if (!strcmp(name, OVS_PACKET_FAMILY)) { + family_id = OVS_WIN_NL_PACKET_FAMILY_ID; + family_name = OVS_PACKET_FAMILY; + family_version = OVS_PACKET_VERSION; + family_attrmax = OVS_PACKET_ATTR_MAX; + } else if (!strcmp(name, OVS_VPORT_FAMILY)) { + family_id = OVS_WIN_NL_VPORT_FAMILY_ID; + family_name = OVS_VPORT_FAMILY; + family_version = OVS_VPORT_VERSION; + family_attrmax = OVS_VPORT_ATTR_MAX; + mcgrp_id = OVS_WIN_NL_VPORT_MCGRP_ID; + mcgrp_name = OVS_VPORT_MCGROUP; + } else if (!strcmp(name, OVS_FLOW_FAMILY)) { + family_id = OVS_WIN_NL_FLOW_FAMILY_ID; + family_name = OVS_FLOW_FAMILY; + family_version = OVS_FLOW_VERSION; + family_attrmax = OVS_FLOW_ATTR_MAX; + } else if (!strcmp(name, OVS_WIN_NETDEV_FAMILY)) { + family_id = OVS_WIN_NL_NETDEV_FAMILY_ID; + family_name = OVS_WIN_NETDEV_FAMILY; + family_version = OVS_WIN_NETDEV_VERSION; + family_attrmax = OVS_WIN_NETDEV_ATTR_MAX; + } else { + ofpbuf_delete(reply); + return EINVAL; + } + + nl_msg_put_genlmsghdr(reply, 0, GENL_ID_CTRL, 0, + CTRL_CMD_NEWFAMILY, family_version); + /* CTRL_ATTR_HDRSIZE and CTRL_ATTR_OPS are not populated, but the + * callers do not seem to need them. */ + nl_msg_put_u16(reply, CTRL_ATTR_FAMILY_ID, family_id); + nl_msg_put_string(reply, CTRL_ATTR_FAMILY_NAME, family_name); + nl_msg_put_u32(reply, CTRL_ATTR_VERSION, family_version); + nl_msg_put_u32(reply, CTRL_ATTR_MAXATTR, family_attrmax); + + if (mcgrp_id != OVS_WIN_NL_INVALID_MCGRP_ID) { + size_t mcgrp_ofs1 = nl_msg_start_nested(reply, CTRL_ATTR_MCAST_GROUPS); + size_t mcgrp_ofs2= nl_msg_start_nested(reply, + OVS_WIN_NL_VPORT_MCGRP_ID - OVS_WIN_NL_MCGRP_START_ID); + nl_msg_put_u32(reply, CTRL_ATTR_MCAST_GRP_ID, mcgrp_id); + ovs_assert(mcgrp_name != NULL); + nl_msg_put_string(reply, CTRL_ATTR_MCAST_GRP_NAME, mcgrp_name); + nl_msg_end_nested(reply, mcgrp_ofs2); + nl_msg_end_nested(reply, mcgrp_ofs1); + } + + /* Set the total length of the netlink message. */ + nlmsg = nl_msg_nlmsghdr(reply); + nlmsg->nlmsg_len = reply->size; + + if (!nl_policy_parse(reply, NLMSG_HDRLEN + GENL_HDRLEN, + family_policy, attrs, ARRAY_SIZE(family_policy)) + || nl_attr_get_u16(attrs[CTRL_ATTR_FAMILY_ID]) == 0) { + ofpbuf_delete(reply); + return EPROTO; + } + + *replyp = reply; + return 0; +} +#endif /* Finds the multicast group called 'group_name' in genl family 'family_name'. * When successful, writes its result to 'multicast_group' and returns 0. @@ -1112,6 +1578,47 @@ } } +/* Sends 'request' to the kernel on a Netlink socket for the given 'protocol' + * (e.g. NETLINK_ROUTE or NETLINK_GENERIC) and waits for a response. If + * successful, returns 0. On failure, returns a positive errno value. + * + * If 'replyp' is nonnull, then on success '*replyp' is set to the kernel's + * reply, which the caller is responsible for freeing with ofpbuf_delete(), and + * on failure '*replyp' is set to NULL. If 'replyp' is null, then the kernel's + * reply, if any, is discarded. + * + * Before the message is sent, nlmsg_len in 'request' will be finalized to + * match msg->size, nlmsg_pid will be set to the pid of the socket used + * for sending the request, and nlmsg_seq will be initialized. + * + * The caller is responsible for destroying 'request'. + * + * Bare Netlink is an unreliable transport protocol. This function layers + * reliable delivery and reply semantics on top of bare Netlink. + * + * In Netlink, sending a request to the kernel is reliable enough, because the + * kernel will tell us if the message cannot be queued (and we will in that + * case put it on the transmit queue and wait until it can be delivered). + * + * Receiving the reply is the real problem: if the socket buffer is full when + * the kernel tries to send the reply, the reply will be dropped. However, the + * kernel sets a flag that a reply has been dropped. The next call to recv + * then returns ENOBUFS. We can then re-send the request. + * + * Caveats: + * + * 1. Netlink depends on sequence numbers to match up requests and + * replies. The sender of a request supplies a sequence number, and + * the reply echos back that sequence number. + * + * This is fine, but (1) some kernel netlink implementations are + * broken, in that they fail to echo sequence numbers and (2) this + * function will drop packets with non-matching sequence numbers, so + * that only a single request can be usefully transacted at a time. + * + * 2. Resending the request causes it to be re-executed, so the request + * needs to be idempotent. + */ int nl_transact(int protocol, const struct ofpbuf *request, struct ofpbuf **replyp) @@ -1131,6 +1638,26 @@ return error; } +/* Sends the 'request' member of the 'n' transactions in 'transactions' on a + * Netlink socket for the given 'protocol' (e.g. NETLINK_ROUTE or + * NETLINK_GENERIC), in order, and receives responses to all of them. Fills in + * the 'error' member of each transaction with 0 if it was successful, + * otherwise with a positive errno value. If 'reply' is nonnull, then it will + * be filled with the reply if the message receives a detailed reply. In other + * cases, i.e. where the request failed or had no reply beyond an indication of + * success, 'reply' will be cleared if it is nonnull. + * + * The caller is responsible for destroying each request and reply, and the + * transactions array itself. + * + * Before sending each message, this function will finalize nlmsg_len in each + * 'request' to match the ofpbuf's size, set nlmsg_pid to the pid of the socket + * used for the transaction, and initialize nlmsg_seq. + * + * Bare Netlink is an unreliable transport protocol. This function layers + * reliable delivery and reply semantics on top of bare Netlink. See + * nl_transact() for some caveats. + */ void nl_transact_multiple(int protocol, struct nl_transaction **transactions, size_t n) diff -Nru openvswitch-2.3.1/lib/netlink-socket.h openvswitch-2.4.0~git20150623/lib/netlink-socket.h --- openvswitch-2.3.1/lib/netlink-socket.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/netlink-socket.h 2015-06-23 18:46:21.000000000 +0000 @@ -19,17 +19,160 @@ /* Netlink socket definitions. * + * This header file defines functions for working with Netlink sockets. Only + * Linux natively supports Netlink sockets, but Netlink is well suited as a + * basis for extensible low-level protocols, so it can make sense to implement + * a Netlink layer on other systems. This doesn't have to be done in exactly + * the same way as on Linux, as long as the implementation can support the + * semantics that are important to Open vSwitch. See "Usage concepts" below + * for more information. + * + * For Netlink protocol definitions, see netlink-protocol.h. For helper + * functions for working with Netlink messages, see netlink.h. + * + * + * Usage concepts + * ============== + * * Netlink is a datagram-based network protocol primarily for communication - * between user processes and the kernel, and mainly on Linux. Netlink is - * specified in RFC 3549, "Linux Netlink as an IP Services Protocol". + * between user processes and the kernel. Netlink is specified in RFC 3549, + * "Linux Netlink as an IP Services Protocol". * * Netlink is not suitable for use in physical networks of heterogeneous * machines because host byte order is used throughout. * - * This header file defines functions for working with Netlink sockets, which - * are Linux-specific. For Netlink protocol definitions, see - * netlink-protocol.h. For helper functions for working with Netlink messages, - * see netlink.h. + * The AF_NETLINK socket namespace is subdivided into statically numbered + * protocols, e.g. NETLINK_ROUTE, NETLINK_NETFILTER, provided as the third + * argument to the socket() function. Maintaining the assigned numbers became + * a bit of a problem, so the "Generic Netlink" NETLINK_GENERIC protocol was + * introduced to map between human-readable names and dynamically assigned + * numbers. All recently introduced Netlink protocol messages in Linux + * (including all of the Open vSwitch specific messages) fall under + * NETLINK_GENERIC. The Netlink library provides the nl_lookup_genl_family() + * function for translating a Generic Netlink name to a number. On Linux, this + * queries the kernel Generic Netlink implementation, but on other systems it + * might be easier to statically assign each of the names used by Open vSwitch + * and then implement this function entirely in userspace. + * + * Each Netlink socket is distinguished by its Netlink PID, a 32-bit integer + * that is analogous to a TCP or UDP port number. The kernel has PID 0. + * + * Most Netlink messages manage a kernel table of some kind, e.g. the kernel + * routing table, ARP table, etc. Open vSwitch specific messages manage tables + * of datapaths, ports within datapaths ("vports"), and flows within + * datapaths. Open vSwitch also has messages related to network packets + * received on vports, which aren't really a table. + * + * Datagram protocols over a physical network are typically unreliable: in UDP, + * for example, messages can be dropped, delivered more than once, or delivered + * out of order. In Linux, Netlink does not deliver messages out of order or + * multiple times. In some cases it can drop messages, but the kernel + * indicates when a message has been dropped. The description below of each + * way Open vSwitch uses Netlink also explains how to work around dropped + * messages. + * + * Open vSwitch uses Netlink in four characteristic ways: + * + * 1. Transactions. A transaction is analogous to a system call, an ioctl, + * or an RPC: userspace sends a request to the kernel, which processes + * the request synchronously and returns a reply to userspace. + * (Sometimes there is no explicit reply, but even in that case userspace + * will receive an immediate reply if there is an error.) + * + * nl_transact() is the primary interface for transactions over Netlink. + * This function doesn't take a socket as a parameter because sockets do + * not have any state related to transactions. + * + * Netlink uses 16-bit "length" fields extensively, which effectively + * limits requests and replies to 64 kB. "Dumps" (see below) are one way + * to work around this limit for replies. + * + * In the Linux implementation of Netlink transactions, replies can + * sometimes be lost. When this happens, nl_transact() automatically + * executes the transaction again. This means that it is important that + * transactions be idempotent, or that the client be prepared to tolerate + * that a transaction might actually execute more than once. + * + * The Linux implementation can execute several transactions at the same + * time more efficiently than individually. nl_transact_multiple() + * allows for this. The semantics are no different from executing each + * of the transactions individually with nl_transact(). + * + * 2. Dumps. A dump asks the kernel to provide all of the information in a + * table. It consists of a request and a reply, where the reply consists + * of an arbitrary number of messages. Each message in the reply is + * limited to 64 kB, as is the request, but the total size of the reply + * can be many times larger. + * + * The reply to a dump is usually generated piece by piece, not + * atomically. The reply can represent an inconsistent snapshot of the + * table. This is especially likely if entries in the table were being + * added or deleted or changing during the dump. + * + * nl_dump_start() begins a dump based on the caller-provided request and + * initializes a "struct nl_dump" to identify the dump. Subsequent calls + * to nl_dump_next() then obtain the reply, one message at a time. + * Usually, each message gives information about some entry in a table, + * e.g. one flow in the Open vSwitch flow table, or one route in a + * routing table. nl_dump_done() ends the dump. + * + * Linux implements dumps so that messages in a reply do not get lost. + * + * 3. Multicast subscriptions. Most kernel Netlink implementations allow a + * process to monitor changes to its table, by subscribing to a Netlink + * multicast group dedicated to that table. Whenever the table's content + * changes (e.g. an entry is added or deleted or modified), the Netlink + * implementation sends a message to all sockets that subscribe to its + * multicast group notifying it of details of the change. (This doesn't + * require much extra work by the Netlink implementer because the message + * is generally identical to the one sent as a reply to the request that + * changed the table.) + * + * nl_sock_join_mcgroup() subscribes a socket to a multicast group, and + * nl_sock_recv() reads notifications. + * + * If userspace doesn't read messages from a socket subscribed to a + * multicast group quickly enough, then notification messages can pile up + * in the socket's receive buffer. If this continues long enough, the + * receive buffer will fill up and notifications will be lost. In that + * case, nl_sock_recv() will return ENOBUFS. The client can then use a + * dump to resynchronize with the table state. (A simple implementation + * of multicast groups might take advantage of this by simply returning + * ENOBUFS whenever a table changes, without implementing actual + * notifications. This would cause lots of extra dumps, so it may not be + * suitable as a production implementation.) + * + * 4. Unicast subscriptions (Open vSwitch specific). Userspace can assign + * one or more Netlink PIDs to a vport as "upcall PIDs". When a packet + * received on the vport does not match any flow in its datapath's flow + * table, the kernel hashes some of the packet's headers, uses the hash + * to select one of the PIDs, and sends the packet (encapsulated in an + * Open vSwitch Netlink message) to the socket with the selected PID. + * + * nl_sock_recv() reads notifications sent this way. + * + * Specifically on Windows platform, the datapath needs to allocate a + * queue for packets, and it does so only when userspace "subscribe"'s to + * packets on that netlink socket. Before closing the netlink socket, + * userspace needs to "unsubscribe" packets on that netlink socket. + * + * nl_sock_subscribe_packets() and nl_sock_unsubscribe_packets() are + * Windows specific. + * + * Messages received this way can overflow, just like multicast + * subscription messages, and they are reported the same way. Because + * packet notification messages do not report the state of a table, there + * is no way to recover the dropped packets; they are simply lost. + * + * The main reason to support multiple PIDs per vport is to increase + * fairness, that is, to make it harder for a single high-flow-rate + * sender to drown out lower rate sources. Multiple PIDs per vport might + * also improve packet handling latency or flow setup rate, but that is + * not the main goal. + * + * Old versions of the Linux kernel module supported only one PID per + * vport, and userspace still copes with this, so a simple or early + * implementation might only support one PID per vport too. * * * Thread-safety @@ -57,8 +200,10 @@ struct nl_sock; #ifndef HAVE_NETLINK +#ifndef _WIN32 #error "netlink-socket.h is only for hosts that support Netlink sockets" #endif +#endif /* Netlink sockets. */ int nl_sock_create(int protocol, struct nl_sock **); @@ -68,12 +213,15 @@ int nl_sock_join_mcgroup(struct nl_sock *, unsigned int multicast_group); int nl_sock_leave_mcgroup(struct nl_sock *, unsigned int multicast_group); +#ifdef _WIN32 +int nl_sock_subscribe_packets(struct nl_sock *sock); +int nl_sock_unsubscribe_packets(struct nl_sock *sock); +#endif + int nl_sock_send(struct nl_sock *, const struct ofpbuf *, bool wait); int nl_sock_send_seq(struct nl_sock *, const struct ofpbuf *, uint32_t nlmsg_seq, bool wait); int nl_sock_recv(struct nl_sock *, struct ofpbuf *, bool wait); -int nl_sock_transact(struct nl_sock *, const struct ofpbuf *request, - struct ofpbuf **replyp); int nl_sock_drain(struct nl_sock *); @@ -98,9 +246,6 @@ int error; /* Positive errno value, 0 if no error. */ }; -void nl_sock_transact_multiple(struct nl_sock *, - struct nl_transaction **, size_t n); - /* Transactions without an allocated socket. */ int nl_transact(int protocol, const struct ofpbuf *request, struct ofpbuf **replyp); @@ -110,18 +255,20 @@ #define NL_DUMP_BUFSIZE 4096 struct nl_dump { + /* These members are immutable during the lifetime of the nl_dump. */ struct nl_sock *sock; /* Socket being dumped. */ uint32_t nl_seq; /* Expected nlmsg_seq for replies. */ - atomic_uint status; /* Low bit set if we read final message. - * Other bits hold an errno (0 for success). */ - struct seq *status_seq; /* Tracks changes to the above 'status'. */ - struct ovs_mutex mutex; + + /* 'mutex' protects 'status' and serializes access to 'sock'. */ + struct ovs_mutex mutex; /* Protects 'status', synchronizes recv(). */ + int status OVS_GUARDED; /* 0: dump in progress, + * positive errno: dump completed with error, + * EOF: dump completed successfully. */ }; void nl_dump_start(struct nl_dump *, int protocol, const struct ofpbuf *request); bool nl_dump_next(struct nl_dump *, struct ofpbuf *reply, struct ofpbuf *buf); -bool nl_dump_peek(struct ofpbuf *reply, struct ofpbuf *buf); int nl_dump_done(struct nl_dump *); /* Miscellaneous */ diff -Nru openvswitch-2.3.1/lib/nx-match.c openvswitch-2.4.0~git20150623/lib/nx-match.c --- openvswitch-2.3.1/lib/nx-match.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/nx-match.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include "classifier.h" #include "dynamic-string.h" +#include "hmap.h" #include "meta-flow.h" #include "ofp-actions.h" #include "ofp-errors.h" @@ -29,98 +30,422 @@ #include "ofpbuf.h" #include "openflow/nicira-ext.h" #include "packets.h" +#include "shash.h" #include "unaligned.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(nx_match); +/* OXM headers. + * + * + * Standard OXM/NXM + * ================ + * + * The header is 32 bits long. It looks like this: + * + * |31 16 15 9| 8 7 0 + * +----------------------------------+---------------+--+------------------+ + * | oxm_class | oxm_field |hm| oxm_length | + * +----------------------------------+---------------+--+------------------+ + * + * where hm stands for oxm_hasmask. It is followed by oxm_length bytes of + * payload. When oxm_hasmask is 0, the payload is the value of the field + * identified by the header; when oxm_hasmask is 1, the payload is a value for + * the field followed by a mask of equal length. + * + * Internally, we represent a standard OXM header as a 64-bit integer with the + * above information in the most-significant bits. + * + * + * Experimenter OXM + * ================ + * + * The header is 64 bits long. It looks like the diagram above except that a + * 32-bit experimenter ID, which we call oxm_vendor and which identifies a + * vendor, is inserted just before the payload. Experimenter OXMs are + * identified by an all-1-bits oxm_class (OFPXMC12_EXPERIMENTER). The + * oxm_length value *includes* the experimenter ID, so that the real payload is + * only oxm_length - 4 bytes long. + * + * Internally, we represent an experimenter OXM header as a 64-bit integer with + * the standard header in the upper 32 bits and the experimenter ID in the + * lower 32 bits. (It would be more convenient to swap the positions of the + * two 32-bit words, but this would be more error-prone because experimenter + * OXMs are very rarely used, so accidentally passing one through a 32-bit type + * somewhere in the OVS code would be hard to find.) + */ + +/* + * OXM Class IDs. + * The high order bit differentiate reserved classes from member classes. + * Classes 0x0000 to 0x7FFF are member classes, allocated by ONF. + * Classes 0x8000 to 0xFFFE are reserved classes, reserved for standardisation. + */ +enum ofp12_oxm_class { + OFPXMC12_NXM_0 = 0x0000, /* Backward compatibility with NXM */ + OFPXMC12_NXM_1 = 0x0001, /* Backward compatibility with NXM */ + OFPXMC12_OPENFLOW_BASIC = 0x8000, /* Basic class for OpenFlow */ + OFPXMC15_PACKET_REGS = 0x8001, /* Packet registers (pipeline fields). */ + OFPXMC12_EXPERIMENTER = 0xffff, /* Experimenter class */ +}; + +/* Functions for extracting raw field values from OXM/NXM headers. */ +static uint32_t nxm_vendor(uint64_t header) { return header; } +static int nxm_class(uint64_t header) { return header >> 48; } +static int nxm_field(uint64_t header) { return (header >> 41) & 0x7f; } +static bool nxm_hasmask(uint64_t header) { return (header >> 40) & 1; } +static int nxm_length(uint64_t header) { return (header >> 32) & 0xff; } + +static bool +is_experimenter_oxm(uint64_t header) +{ + return nxm_class(header) == OFPXMC12_EXPERIMENTER; +} + +/* The OXM header "length" field is somewhat tricky: + * + * - For a standard OXM header, the length is the number of bytes of the + * payload, and the payload consists of just the value (and mask, if + * present). + * + * - For an experimenter OXM header, the length is the number of bytes in + * the payload plus 4 (the length of the experimenter ID). That is, the + * experimenter ID is included in oxm_length. + * + * This function returns the length of the experimenter ID field in 'header'. + * That is, for an experimenter OXM (when an experimenter ID is present), it + * returns 4, and for a standard OXM (when no experimenter ID is present), it + * returns 0. */ +static int +nxm_experimenter_len(uint64_t header) +{ + return is_experimenter_oxm(header) ? 4 : 0; +} + +/* Returns the number of bytes that follow the header for an NXM/OXM entry + * with the given 'header'. */ +static int +nxm_payload_len(uint64_t header) +{ + return nxm_length(header) - nxm_experimenter_len(header); +} + +/* Returns the number of bytes in the header for an NXM/OXM entry with the + * given 'header'. */ +static int +nxm_header_len(uint64_t header) +{ + return 4 + nxm_experimenter_len(header); +} + +#define NXM_HEADER(VENDOR, CLASS, FIELD, HASMASK, LENGTH) \ + (((uint64_t) (CLASS) << 48) | \ + ((uint64_t) (FIELD) << 41) | \ + ((uint64_t) (HASMASK) << 40) | \ + ((uint64_t) (LENGTH) << 32) | \ + (VENDOR)) + +#define NXM_HEADER_FMT "%#"PRIx32":%d:%d:%d:%d" +#define NXM_HEADER_ARGS(HEADER) \ + nxm_vendor(HEADER), nxm_class(HEADER), nxm_field(HEADER), \ + nxm_hasmask(HEADER), nxm_length(HEADER) + +/* Functions for turning the "hasmask" bit on or off. (This also requires + * adjusting the length.) */ +static uint64_t +nxm_make_exact_header(uint64_t header) +{ + int new_len = nxm_payload_len(header) / 2 + nxm_experimenter_len(header); + return NXM_HEADER(nxm_vendor(header), nxm_class(header), + nxm_field(header), 0, new_len); +} +static uint64_t +nxm_make_wild_header(uint64_t header) +{ + int new_len = nxm_payload_len(header) * 2 + nxm_experimenter_len(header); + return NXM_HEADER(nxm_vendor(header), nxm_class(header), + nxm_field(header), 1, new_len); +} + +/* Flow cookie. + * + * This may be used to gain the OpenFlow 1.1-like ability to restrict + * certain NXM-based Flow Mod and Flow Stats Request messages to flows + * with specific cookies. See the "nx_flow_mod" and "nx_flow_stats_request" + * structure definitions for more details. This match is otherwise not + * allowed. */ +#define NXM_NX_COOKIE NXM_HEADER (0, 0x0001, 30, 0, 8) +#define NXM_NX_COOKIE_W nxm_make_wild_header(NXM_NX_COOKIE) + +struct nxm_field { + uint64_t header; + enum ofp_version version; + const char *name; /* e.g. "NXM_OF_IN_PORT". */ + + enum mf_field_id id; +}; + +static const struct nxm_field *nxm_field_by_header(uint64_t header); +static const struct nxm_field *nxm_field_by_name(const char *name, size_t len); +static const struct nxm_field *nxm_field_by_mf_id(enum mf_field_id, + enum ofp_version); + +static void nx_put_header__(struct ofpbuf *, uint64_t header, bool masked); + /* Rate limit for nx_match parse errors. These always indicate a bug in the * peer and so there's not much point in showing a lot of them. */ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); -/* Returns the width of the data for a field with the given 'header', in - * bytes. */ -int -nxm_field_bytes(uint32_t header) +static const struct nxm_field * +mf_parse_subfield_name(const char *name, int name_len, bool *wild); + +/* Returns the preferred OXM header to use for field 'id' in OpenFlow version + * 'version'. Specify 0 for 'version' if an NXM legacy header should be + * preferred over any standardized OXM header. Returns 0 if field 'id' cannot + * be expressed in NXM or OXM. */ +static uint64_t +mf_oxm_header(enum mf_field_id id, enum ofp_version version) +{ + const struct nxm_field *f = nxm_field_by_mf_id(id, version); + return f ? f->header : 0; +} + +/* Returns the 32-bit OXM or NXM header to use for field 'id', preferring an + * NXM legacy header over any standardized OXM header. Returns 0 if field 'id' + * cannot be expressed with a 32-bit NXM or OXM header. + * + * Whenever possible, use nx_pull_header() instead of this function, because + * this function cannot support 64-bit experimenter OXM headers. */ +uint32_t +mf_nxm_header(enum mf_field_id id) +{ + uint64_t oxm = mf_oxm_header(id, 0); + return is_experimenter_oxm(oxm) ? 0 : oxm >> 32; +} + +static const struct mf_field * +mf_from_oxm_header(uint64_t header) +{ + const struct nxm_field *f = nxm_field_by_header(header); + return f ? mf_from_id(f->id) : NULL; +} + +/* Returns the "struct mf_field" that corresponds to NXM or OXM header + * 'header', or NULL if 'header' doesn't correspond to any known field. */ +const struct mf_field * +mf_from_nxm_header(uint32_t header) { - unsigned int length = NXM_LENGTH(header); - return NXM_HASMASK(header) ? length / 2 : length; + return mf_from_oxm_header((uint64_t) header << 32); } /* Returns the width of the data for a field with the given 'header', in - * bits. */ -int -nxm_field_bits(uint32_t header) + * bytes. */ +static int +nxm_field_bytes(uint64_t header) { - return nxm_field_bytes(header) * 8; + unsigned int length = nxm_payload_len(header); + return nxm_hasmask(header) ? length / 2 : length; } /* nx_pull_match() and helpers. */ -static uint32_t -nx_entry_ok(const void *p, unsigned int match_len) +/* Given NXM/OXM value 'value' and mask 'mask' associated with 'header', checks + * for any 1-bit in the value where there is a 0-bit in the mask. Returns 0 if + * none, otherwise an error code. */ +static bool +is_mask_consistent(uint64_t header, const uint8_t *value, const uint8_t *mask) { - unsigned int payload_len; - ovs_be32 header_be; - uint32_t header; + unsigned int width = nxm_field_bytes(header); + unsigned int i; - if (match_len < 4) { - if (match_len) { - VLOG_DBG_RL(&rl, "nx_match ends with partial (%u-byte) nxm_header", - match_len); + for (i = 0; i < width; i++) { + if (value[i] & ~mask[i]) { + if (!VLOG_DROP_WARN(&rl)) { + VLOG_WARN_RL(&rl, "Rejecting NXM/OXM entry "NXM_HEADER_FMT " " + "with 1-bits in value for bits wildcarded by the " + "mask.", NXM_HEADER_ARGS(header)); + } + return false; } - return 0; } - memcpy(&header_be, p, 4); - header = ntohl(header_be); + return true; +} - payload_len = NXM_LENGTH(header); - if (!payload_len) { - VLOG_DBG_RL(&rl, "nxm_entry %08"PRIx32" has invalid payload " - "length 0", header); - return 0; +static bool +is_cookie_pseudoheader(uint64_t header) +{ + return header == NXM_NX_COOKIE || header == NXM_NX_COOKIE_W; +} + +static enum ofperr +nx_pull_header__(struct ofpbuf *b, bool allow_cookie, uint64_t *header, + const struct mf_field **field) +{ + if (b->size < 4) { + goto bad_len; } - if (match_len < payload_len + 4) { - VLOG_DBG_RL(&rl, "%"PRIu32"-byte nxm_entry but only " - "%u bytes left in nx_match", payload_len + 4, match_len); - return 0; + + *header = ((uint64_t) ntohl(get_unaligned_be32(b->data))) << 32; + if (is_experimenter_oxm(*header)) { + if (b->size < 8) { + goto bad_len; + } + *header = ntohll(get_unaligned_be64(b->data)); + } + if (nxm_length(*header) <= nxm_experimenter_len(*header)) { + VLOG_WARN_RL(&rl, "OXM header "NXM_HEADER_FMT" has invalid length %d " + "(minimum is %d)", + NXM_HEADER_ARGS(*header), nxm_length(*header), + nxm_header_len(*header) + 1); + goto error; + } + ofpbuf_pull(b, nxm_header_len(*header)); + + if (field) { + *field = mf_from_oxm_header(*header); + if (!*field && !(allow_cookie && is_cookie_pseudoheader(*header))) { + VLOG_DBG_RL(&rl, "OXM header "NXM_HEADER_FMT" is unknown", + NXM_HEADER_ARGS(*header)); + return OFPERR_OFPBMC_BAD_FIELD; + } } - return header; + return 0; + +bad_len: + VLOG_DBG_RL(&rl, "encountered partial (%"PRIu32"-byte) OXM entry", + b->size); +error: + *header = 0; + if (field) { + *field = NULL; + } + return OFPERR_OFPBMC_BAD_LEN; } -/* Given NXM/OXM value 'value' and mask 'mask', each 'width' bytes long, - * checks for any 1-bit in the value where there is a 0-bit in the mask. If it - * finds one, logs a warning. */ -static void -check_mask_consistency(const uint8_t *p, const struct mf_field *mf) +static enum ofperr +nx_pull_entry__(struct ofpbuf *b, bool allow_cookie, uint64_t *header, + const struct mf_field **field, + union mf_value *value, union mf_value *mask) { - unsigned int width = mf->n_bytes; - const uint8_t *value = p + 4; - const uint8_t *mask = p + 4 + width; - unsigned int i; + enum ofperr header_error; + unsigned int payload_len; + const uint8_t *payload; + int width; - for (i = 0; i < width; i++) { - if (value[i] & ~mask[i]) { - if (!VLOG_DROP_WARN(&rl)) { - char *s = nx_match_to_string(p, width * 2 + 4); - VLOG_WARN_RL(&rl, "NXM/OXM entry %s has 1-bits in value for " - "bits wildcarded by the mask. (Future versions " - "of OVS may report this as an OpenFlow error.)", - s); - free(s); - break; - } + header_error = nx_pull_header__(b, allow_cookie, header, field); + if (header_error && header_error != OFPERR_OFPBMC_BAD_FIELD) { + return header_error; + } + + payload_len = nxm_payload_len(*header); + payload = ofpbuf_try_pull(b, payload_len); + if (!payload) { + VLOG_DBG_RL(&rl, "OXM header "NXM_HEADER_FMT" calls for %u-byte " + "payload but only %"PRIu32" bytes follow OXM header", + NXM_HEADER_ARGS(*header), payload_len, b->size); + return OFPERR_OFPBMC_BAD_LEN; + } + + width = nxm_field_bytes(*header); + if (nxm_hasmask(*header) + && !is_mask_consistent(*header, payload, payload + width)) { + return OFPERR_OFPBMC_BAD_WILDCARDS; + } + + memcpy(value, payload, MIN(width, sizeof *value)); + if (mask) { + if (nxm_hasmask(*header)) { + memcpy(mask, payload + width, MIN(width, sizeof *mask)); + } else { + memset(mask, 0xff, MIN(width, sizeof *mask)); } + } else if (nxm_hasmask(*header)) { + VLOG_DBG_RL(&rl, "OXM header "NXM_HEADER_FMT" includes mask but " + "masked OXMs are not allowed here", + NXM_HEADER_ARGS(*header)); + return OFPERR_OFPBMC_BAD_MASK; } + + return header_error; +} + +/* Attempts to pull an NXM or OXM header, value, and mask (if present) from the + * beginning of 'b'. If successful, stores a pointer to the "struct mf_field" + * corresponding to the pulled header in '*field', the value into '*value', + * and the mask into '*mask', and returns 0. On error, returns an OpenFlow + * error; in this case, some bytes might have been pulled off 'b' anyhow, and + * the output parameters might have been modified. + * + * If a NULL 'mask' is supplied, masked OXM or NXM entries are treated as + * errors (with OFPERR_OFPBMC_BAD_MASK). + */ +enum ofperr +nx_pull_entry(struct ofpbuf *b, const struct mf_field **field, + union mf_value *value, union mf_value *mask) +{ + uint64_t header; + + return nx_pull_entry__(b, false, &header, field, value, mask); +} + +/* Attempts to pull an NXM or OXM header from the beginning of 'b'. If + * successful, stores a pointer to the "struct mf_field" corresponding to the + * pulled header in '*field', stores the header's hasmask bit in '*masked' + * (true if hasmask=1, false if hasmask=0), and returns 0. On error, returns + * an OpenFlow error; in this case, some bytes might have been pulled off 'b' + * anyhow, and the output parameters might have been modified. + * + * If NULL 'masked' is supplied, masked OXM or NXM headers are treated as + * errors (with OFPERR_OFPBMC_BAD_MASK). + */ +enum ofperr +nx_pull_header(struct ofpbuf *b, const struct mf_field **field, bool *masked) +{ + enum ofperr error; + uint64_t header; + + error = nx_pull_header__(b, false, &header, field); + if (masked) { + *masked = !error && nxm_hasmask(header); + } else if (!error && nxm_hasmask(header)) { + error = OFPERR_OFPBMC_BAD_MASK; + } + return error; +} + +static enum ofperr +nx_pull_match_entry(struct ofpbuf *b, bool allow_cookie, + const struct mf_field **field, + union mf_value *value, union mf_value *mask) +{ + enum ofperr error; + uint64_t header; + + error = nx_pull_entry__(b, allow_cookie, &header, field, value, mask); + if (error) { + return error; + } + if (field && *field) { + if (!mf_is_mask_valid(*field, mask)) { + VLOG_DBG_RL(&rl, "bad mask for field %s", (*field)->name); + return OFPERR_OFPBMC_BAD_MASK; + } + if (!mf_is_value_valid(*field, value)) { + VLOG_DBG_RL(&rl, "bad value for field %s", (*field)->name); + return OFPERR_OFPBMC_BAD_VALUE; + } + } + return 0; } static enum ofperr nx_pull_raw(const uint8_t *p, unsigned int match_len, bool strict, struct match *match, ovs_be64 *cookie, ovs_be64 *cookie_mask) { - uint32_t header; + struct ofpbuf b; ovs_assert((cookie != NULL) == (cookie_mask != NULL)); @@ -128,80 +453,46 @@ if (cookie) { *cookie = *cookie_mask = htonll(0); } - if (!match_len) { - return 0; - } - for (; - (header = nx_entry_ok(p, match_len)) != 0; - p += 4 + NXM_LENGTH(header), match_len -= 4 + NXM_LENGTH(header)) { - const struct mf_field *mf; + ofpbuf_use_const(&b, p, match_len); + while (b.size) { + const uint8_t *pos = b.data; + const struct mf_field *field; + union mf_value value; + union mf_value mask; enum ofperr error; - mf = mf_from_nxm_header(header); - if (!mf) { - if (strict) { + error = nx_pull_match_entry(&b, cookie != NULL, &field, &value, &mask); + if (error) { + if (error == OFPERR_OFPBMC_BAD_FIELD && !strict) { + continue; + } + } else if (!field) { + if (!cookie) { error = OFPERR_OFPBMC_BAD_FIELD; + } else if (*cookie_mask) { + error = OFPERR_OFPBMC_DUP_FIELD; } else { - continue; + *cookie = value.be64; + *cookie_mask = mask.be64; } - } else if (!mf_are_prereqs_ok(mf, &match->flow)) { + } else if (!mf_are_prereqs_ok(field, &match->flow)) { error = OFPERR_OFPBMC_BAD_PREREQ; - } else if (!mf_is_all_wild(mf, &match->wc)) { + } else if (!mf_is_all_wild(field, &match->wc)) { error = OFPERR_OFPBMC_DUP_FIELD; } else { - unsigned int width = mf->n_bytes; - union mf_value value; - - memcpy(&value, p + 4, width); - if (!mf_is_value_valid(mf, &value)) { - error = OFPERR_OFPBMC_BAD_VALUE; - } else if (!NXM_HASMASK(header)) { - error = 0; - mf_set_value(mf, &value, match); - } else { - union mf_value mask; - - memcpy(&mask, p + 4 + width, width); - if (!mf_is_mask_valid(mf, &mask)) { - error = OFPERR_OFPBMC_BAD_MASK; - } else { - error = 0; - check_mask_consistency(p, mf); - mf_set(mf, &value, &mask, match); - } - } - } - - /* Check if the match is for a cookie rather than a classifier rule. */ - if ((header == NXM_NX_COOKIE || header == NXM_NX_COOKIE_W) && cookie) { - if (*cookie_mask) { - error = OFPERR_OFPBMC_DUP_FIELD; - } else { - unsigned int width = sizeof *cookie; - - memcpy(cookie, p + 4, width); - if (NXM_HASMASK(header)) { - memcpy(cookie_mask, p + 4 + width, width); - } else { - *cookie_mask = OVS_BE64_MAX; - } - error = 0; - } + mf_set(field, &value, &mask, match); } if (error) { - VLOG_DBG_RL(&rl, "bad nxm_entry %#08"PRIx32" (vendor=%"PRIu32", " - "field=%"PRIu32", hasmask=%"PRIu32", len=%"PRIu32"), " - "(%s)", header, - NXM_VENDOR(header), NXM_FIELD(header), - NXM_HASMASK(header), NXM_LENGTH(header), - ofperr_to_string(error)); + VLOG_DBG_RL(&rl, "error parsing OXM at offset %"PRIdPTR" " + "within match (%s)", pos - + p, ofperr_to_string(error)); return error; } } - return match_len ? OFPERR_OFPBMC_BAD_LEN : 0; + return 0; } static enum ofperr @@ -216,7 +507,7 @@ if (!p) { VLOG_DBG_RL(&rl, "nx_match length %u, rounded up to a " "multiple of 8, is longer than space in message (max " - "length %"PRIu32")", match_len, ofpbuf_size(b)); + "length %"PRIu32")", match_len, b->size); return OFPERR_OFPBMC_BAD_LEN; } } @@ -252,11 +543,11 @@ static enum ofperr oxm_pull_match__(struct ofpbuf *b, bool strict, struct match *match) { - struct ofp11_match_header *omh = ofpbuf_data(b); + struct ofp11_match_header *omh = b->data; uint8_t *p; uint16_t match_len; - if (ofpbuf_size(b) < sizeof *omh) { + if (b->size < sizeof *omh) { return OFPERR_OFPBMC_BAD_LEN; } @@ -273,7 +564,7 @@ if (!p) { VLOG_DBG_RL(&rl, "oxm length %u, rounded up to a " "multiple of 8, is longer than space in message (max " - "length %"PRIu32")", match_len, ofpbuf_size(b)); + "length %"PRIu32")", match_len, b->size); return OFPERR_OFPBMC_BAD_LEN; } @@ -300,201 +591,158 @@ { return oxm_pull_match__(b, false, match); } - -/* nx_put_match() and helpers. - * - * 'put' functions whose names end in 'w' add a wildcarded field. - * 'put' functions whose names end in 'm' add a field that might be wildcarded. - * Other 'put' functions add exact-match fields. - */ -static void -nxm_put_header(struct ofpbuf *b, uint32_t header) +/* Verify an array of OXM TLVs treating value of each TLV as a mask, + * disallowing masks in each TLV and ignoring pre-requisites. */ +enum ofperr +oxm_pull_field_array(const void *fields_data, size_t fields_len, + struct field_array *fa) { - ovs_be32 n_header = htonl(header); - ofpbuf_put(b, &n_header, sizeof n_header); -} + struct ofpbuf b; -static void -nxm_put_8(struct ofpbuf *b, uint32_t header, uint8_t value) -{ - nxm_put_header(b, header); - ofpbuf_put(b, &value, sizeof value); -} + ofpbuf_use_const(&b, fields_data, fields_len); + while (b.size) { + const uint8_t *pos = b.data; + const struct mf_field *field; + union mf_value value; + enum ofperr error; + uint64_t header; -static void -nxm_put_8m(struct ofpbuf *b, uint32_t header, uint8_t value, uint8_t mask) -{ - switch (mask) { - case 0: - break; - - case UINT8_MAX: - nxm_put_8(b, header, value); - break; - - default: - nxm_put_header(b, NXM_MAKE_WILD_HEADER(header)); - ofpbuf_put(b, &value, sizeof value); - ofpbuf_put(b, &mask, sizeof mask); + error = nx_pull_entry__(&b, false, &header, &field, &value, NULL); + if (error) { + VLOG_DBG_RL(&rl, "error pulling field array field"); + return error; + } else if (!field) { + VLOG_DBG_RL(&rl, "unknown field array field"); + error = OFPERR_OFPBMC_BAD_FIELD; + } else if (bitmap_is_set(fa->used.bm, field->id)) { + VLOG_DBG_RL(&rl, "duplicate field array field '%s'", field->name); + error = OFPERR_OFPBMC_DUP_FIELD; + } else if (!mf_is_mask_valid(field, &value)) { + VLOG_DBG_RL(&rl, "bad mask in field array field '%s'", field->name); + return OFPERR_OFPBMC_BAD_MASK; + } else { + field_array_set(field->id, &value, fa); + } + + if (error) { + const uint8_t *start = fields_data; + + VLOG_DBG_RL(&rl, "error parsing OXM at offset %"PRIdPTR" " + "within field array (%s)", pos - start, + ofperr_to_string(error)); + return error; + } } -} -static void -nxm_put_16(struct ofpbuf *b, uint32_t header, ovs_be16 value) -{ - nxm_put_header(b, header); - ofpbuf_put(b, &value, sizeof value); + return 0; } + +/* nx_put_match() and helpers. + * + * 'put' functions whose names end in 'w' add a wildcarded field. + * 'put' functions whose names end in 'm' add a field that might be wildcarded. + * Other 'put' functions add exact-match fields. + */ static void -nxm_put_16w(struct ofpbuf *b, uint32_t header, ovs_be16 value, ovs_be16 mask) +nxm_put_unmasked(struct ofpbuf *b, enum mf_field_id field, + enum ofp_version version, const void *value, size_t n_bytes) { - nxm_put_header(b, header); - ofpbuf_put(b, &value, sizeof value); - ofpbuf_put(b, &mask, sizeof mask); + nx_put_header(b, field, version, false); + ofpbuf_put(b, value, n_bytes); } static void -nxm_put_16m(struct ofpbuf *b, uint32_t header, ovs_be16 value, ovs_be16 mask) +nxm_put(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + const void *value, const void *mask, size_t n_bytes) { - switch (mask) { - case 0: - break; - - case OVS_BE16_MAX: - nxm_put_16(b, header, value); - break; - - default: - nxm_put_16w(b, NXM_MAKE_WILD_HEADER(header), value, mask); - break; + if (!is_all_zeros(mask, n_bytes)) { + bool masked = !is_all_ones(mask, n_bytes); + nx_put_header(b, field, version, masked); + ofpbuf_put(b, value, n_bytes); + if (masked) { + ofpbuf_put(b, mask, n_bytes); + } } } static void -nxm_put_32(struct ofpbuf *b, uint32_t header, ovs_be32 value) +nxm_put_8m(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + uint8_t value, uint8_t mask) { - nxm_put_header(b, header); - ofpbuf_put(b, &value, sizeof value); + nxm_put(b, field, version, &value, &mask, sizeof value); } static void -nxm_put_32w(struct ofpbuf *b, uint32_t header, ovs_be32 value, ovs_be32 mask) +nxm_put_8(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + uint8_t value) { - nxm_put_header(b, header); - ofpbuf_put(b, &value, sizeof value); - ofpbuf_put(b, &mask, sizeof mask); + nxm_put_unmasked(b, field, version, &value, sizeof value); } static void -nxm_put_32m(struct ofpbuf *b, uint32_t header, ovs_be32 value, ovs_be32 mask) +nxm_put_16m(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + ovs_be16 value, ovs_be16 mask) { - switch (mask) { - case 0: - break; - - case OVS_BE32_MAX: - nxm_put_32(b, header, value); - break; - - default: - nxm_put_32w(b, NXM_MAKE_WILD_HEADER(header), value, mask); - break; - } + nxm_put(b, field, version, &value, &mask, sizeof value); } static void -nxm_put_64(struct ofpbuf *b, uint32_t header, ovs_be64 value) +nxm_put_16(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + ovs_be16 value) { - nxm_put_header(b, header); - ofpbuf_put(b, &value, sizeof value); + nxm_put_unmasked(b, field, version, &value, sizeof value); } static void -nxm_put_64w(struct ofpbuf *b, uint32_t header, ovs_be64 value, ovs_be64 mask) +nxm_put_32m(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + ovs_be32 value, ovs_be32 mask) { - nxm_put_header(b, header); - ofpbuf_put(b, &value, sizeof value); - ofpbuf_put(b, &mask, sizeof mask); + nxm_put(b, field, version, &value, &mask, sizeof value); } static void -nxm_put_64m(struct ofpbuf *b, uint32_t header, ovs_be64 value, ovs_be64 mask) +nxm_put_32(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + ovs_be32 value) { - switch (mask) { - case 0: - break; - - case OVS_BE64_MAX: - nxm_put_64(b, header, value); - break; - - default: - nxm_put_64w(b, NXM_MAKE_WILD_HEADER(header), value, mask); - break; - } + nxm_put_unmasked(b, field, version, &value, sizeof value); } static void -nxm_put_eth(struct ofpbuf *b, uint32_t header, - const uint8_t value[ETH_ADDR_LEN]) +nxm_put_64m(struct ofpbuf *b, enum mf_field_id field, enum ofp_version version, + ovs_be64 value, ovs_be64 mask) { - nxm_put_header(b, header); - ofpbuf_put(b, value, ETH_ADDR_LEN); + nxm_put(b, field, version, &value, &mask, sizeof value); } static void -nxm_put_eth_masked(struct ofpbuf *b, uint32_t header, +nxm_put_eth_masked(struct ofpbuf *b, + enum mf_field_id field, enum ofp_version version, const uint8_t value[ETH_ADDR_LEN], const uint8_t mask[ETH_ADDR_LEN]) { - if (!eth_addr_is_zero(mask)) { - if (eth_mask_is_exact(mask)) { - nxm_put_eth(b, header, value); - } else { - nxm_put_header(b, NXM_MAKE_WILD_HEADER(header)); - ofpbuf_put(b, value, ETH_ADDR_LEN); - ofpbuf_put(b, mask, ETH_ADDR_LEN); - } - } + nxm_put(b, field, version, value, mask, ETH_ADDR_LEN); } static void -nxm_put_ipv6(struct ofpbuf *b, uint32_t header, +nxm_put_ipv6(struct ofpbuf *b, + enum mf_field_id field, enum ofp_version version, const struct in6_addr *value, const struct in6_addr *mask) { - if (ipv6_mask_is_any(mask)) { - return; - } else if (ipv6_mask_is_exact(mask)) { - nxm_put_header(b, header); - ofpbuf_put(b, value, sizeof *value); - } else { - nxm_put_header(b, NXM_MAKE_WILD_HEADER(header)); - ofpbuf_put(b, value, sizeof *value); - ofpbuf_put(b, mask, sizeof *mask); - } + nxm_put(b, field, version, value->s6_addr, mask->s6_addr, + sizeof value->s6_addr); } static void -nxm_put_frag(struct ofpbuf *b, const struct match *match) +nxm_put_frag(struct ofpbuf *b, const struct match *match, + enum ofp_version version) { - uint8_t nw_frag = match->flow.nw_frag; - uint8_t nw_frag_mask = match->wc.masks.nw_frag; + uint8_t nw_frag = match->flow.nw_frag & FLOW_NW_FRAG_MASK; + uint8_t nw_frag_mask = match->wc.masks.nw_frag & FLOW_NW_FRAG_MASK; - switch (nw_frag_mask) { - case 0: - break; - - case FLOW_NW_FRAG_MASK: - nxm_put_8(b, NXM_NX_IP_FRAG, nw_frag); - break; - - default: - nxm_put_8m(b, NXM_NX_IP_FRAG, nw_frag, - nw_frag_mask & FLOW_NW_FRAG_MASK); - break; - } + nxm_put_8m(b, MFF_IP_FRAG, version, nw_frag, + nw_frag_mask == FLOW_NW_FRAG_MASK ? UINT8_MAX : nw_frag_mask); } /* Appends to 'b' a set of OXM or NXM matches for the IPv4 or IPv6 fields in @@ -505,89 +753,89 @@ const struct flow *flow = &match->flow; if (flow->dl_type == htons(ETH_TYPE_IP)) { - nxm_put_32m(b, mf_oxm_header(MFF_IPV4_SRC, oxm), + nxm_put_32m(b, MFF_IPV4_SRC, oxm, flow->nw_src, match->wc.masks.nw_src); - nxm_put_32m(b, mf_oxm_header(MFF_IPV4_DST, oxm), + nxm_put_32m(b, MFF_IPV4_DST, oxm, flow->nw_dst, match->wc.masks.nw_dst); } else { - nxm_put_ipv6(b, mf_oxm_header(MFF_IPV6_SRC, oxm), + nxm_put_ipv6(b, MFF_IPV6_SRC, oxm, &flow->ipv6_src, &match->wc.masks.ipv6_src); - nxm_put_ipv6(b, mf_oxm_header(MFF_IPV6_DST, oxm), + nxm_put_ipv6(b, MFF_IPV6_DST, oxm, &flow->ipv6_dst, &match->wc.masks.ipv6_dst); } - nxm_put_frag(b, match); + nxm_put_frag(b, match, oxm); if (match->wc.masks.nw_tos & IP_DSCP_MASK) { if (oxm) { - nxm_put_8(b, mf_oxm_header(MFF_IP_DSCP_SHIFTED, oxm), + nxm_put_8(b, MFF_IP_DSCP_SHIFTED, oxm, flow->nw_tos >> 2); } else { - nxm_put_8(b, mf_oxm_header(MFF_IP_DSCP, oxm), + nxm_put_8(b, MFF_IP_DSCP, oxm, flow->nw_tos & IP_DSCP_MASK); } } if (match->wc.masks.nw_tos & IP_ECN_MASK) { - nxm_put_8(b, mf_oxm_header(MFF_IP_ECN, oxm), + nxm_put_8(b, MFF_IP_ECN, oxm, flow->nw_tos & IP_ECN_MASK); } if (!oxm && match->wc.masks.nw_ttl) { - nxm_put_8(b, mf_oxm_header(MFF_IP_TTL, oxm), flow->nw_ttl); + nxm_put_8(b, MFF_IP_TTL, oxm, flow->nw_ttl); } - nxm_put_32m(b, mf_oxm_header(MFF_IPV6_LABEL, oxm), + nxm_put_32m(b, MFF_IPV6_LABEL, oxm, flow->ipv6_label, match->wc.masks.ipv6_label); if (match->wc.masks.nw_proto) { - nxm_put_8(b, mf_oxm_header(MFF_IP_PROTO, oxm), flow->nw_proto); + nxm_put_8(b, MFF_IP_PROTO, oxm, flow->nw_proto); if (flow->nw_proto == IPPROTO_TCP) { - nxm_put_16m(b, mf_oxm_header(MFF_TCP_SRC, oxm), + nxm_put_16m(b, MFF_TCP_SRC, oxm, flow->tp_src, match->wc.masks.tp_src); - nxm_put_16m(b, mf_oxm_header(MFF_TCP_DST, oxm), + nxm_put_16m(b, MFF_TCP_DST, oxm, flow->tp_dst, match->wc.masks.tp_dst); - nxm_put_16m(b, mf_oxm_header(MFF_TCP_FLAGS, oxm), + nxm_put_16m(b, MFF_TCP_FLAGS, oxm, flow->tcp_flags, match->wc.masks.tcp_flags); } else if (flow->nw_proto == IPPROTO_UDP) { - nxm_put_16m(b, mf_oxm_header(MFF_UDP_SRC, oxm), + nxm_put_16m(b, MFF_UDP_SRC, oxm, flow->tp_src, match->wc.masks.tp_src); - nxm_put_16m(b, mf_oxm_header(MFF_UDP_DST, oxm), + nxm_put_16m(b, MFF_UDP_DST, oxm, flow->tp_dst, match->wc.masks.tp_dst); } else if (flow->nw_proto == IPPROTO_SCTP) { - nxm_put_16m(b, mf_oxm_header(MFF_SCTP_SRC, oxm), flow->tp_src, + nxm_put_16m(b, MFF_SCTP_SRC, oxm, flow->tp_src, match->wc.masks.tp_src); - nxm_put_16m(b, mf_oxm_header(MFF_SCTP_DST, oxm), flow->tp_dst, + nxm_put_16m(b, MFF_SCTP_DST, oxm, flow->tp_dst, match->wc.masks.tp_dst); } else if (is_icmpv4(flow)) { if (match->wc.masks.tp_src) { - nxm_put_8(b, mf_oxm_header(MFF_ICMPV4_TYPE, oxm), + nxm_put_8(b, MFF_ICMPV4_TYPE, oxm, ntohs(flow->tp_src)); } if (match->wc.masks.tp_dst) { - nxm_put_8(b, mf_oxm_header(MFF_ICMPV4_CODE, oxm), + nxm_put_8(b, MFF_ICMPV4_CODE, oxm, ntohs(flow->tp_dst)); } } else if (is_icmpv6(flow)) { if (match->wc.masks.tp_src) { - nxm_put_8(b, mf_oxm_header(MFF_ICMPV6_TYPE, oxm), + nxm_put_8(b, MFF_ICMPV6_TYPE, oxm, ntohs(flow->tp_src)); } if (match->wc.masks.tp_dst) { - nxm_put_8(b, mf_oxm_header(MFF_ICMPV6_CODE, oxm), + nxm_put_8(b, MFF_ICMPV6_CODE, oxm, ntohs(flow->tp_dst)); } if (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) || flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) { - nxm_put_ipv6(b, mf_oxm_header(MFF_ND_TARGET, oxm), + nxm_put_ipv6(b, MFF_ND_TARGET, oxm, &flow->nd_target, &match->wc.masks.nd_target); if (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT)) { - nxm_put_eth_masked(b, mf_oxm_header(MFF_ND_SLL, oxm), + nxm_put_eth_masked(b, MFF_ND_SLL, oxm, flow->arp_sha, match->wc.masks.arp_sha); } if (flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) { - nxm_put_eth_masked(b, mf_oxm_header(MFF_ND_TLL, oxm), + nxm_put_eth_masked(b, MFF_ND_TLL, oxm, flow->arp_tha, match->wc.masks.arp_tha); } } @@ -613,43 +861,47 @@ ovs_be64 cookie, ovs_be64 cookie_mask) { const struct flow *flow = &match->flow; - const size_t start_len = ofpbuf_size(b); + const size_t start_len = b->size; int match_len; int i; - BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26); + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); /* Metadata. */ if (match->wc.masks.dp_hash) { - if (!oxm) { - nxm_put_32m(b, NXM_NX_DP_HASH, htonl(flow->dp_hash), - htonl(match->wc.masks.dp_hash)); - } + nxm_put_32m(b, MFF_DP_HASH, oxm, + htonl(flow->dp_hash), htonl(match->wc.masks.dp_hash)); } if (match->wc.masks.recirc_id) { - if (!oxm) { - nxm_put_32(b, NXM_NX_RECIRC_ID, htonl(flow->recirc_id)); - } + nxm_put_32(b, MFF_RECIRC_ID, oxm, htonl(flow->recirc_id)); + } + + if (match->wc.masks.conj_id) { + nxm_put_32(b, MFF_CONJ_ID, oxm, htonl(flow->conj_id)); } if (match->wc.masks.in_port.ofp_port) { ofp_port_t in_port = flow->in_port.ofp_port; if (oxm) { - nxm_put_32(b, mf_oxm_header(MFF_IN_PORT_OXM, oxm), + nxm_put_32(b, MFF_IN_PORT_OXM, oxm, ofputil_port_to_ofp11(in_port)); } else { - nxm_put_16(b, mf_oxm_header(MFF_IN_PORT, oxm), + nxm_put_16(b, MFF_IN_PORT, oxm, htons(ofp_to_u16(in_port))); } } + if (match->wc.masks.actset_output) { + nxm_put_32(b, MFF_ACTSET_OUTPUT, oxm, + ofputil_port_to_ofp11(flow->actset_output)); + } /* Ethernet. */ - nxm_put_eth_masked(b, mf_oxm_header(MFF_ETH_SRC, oxm), + nxm_put_eth_masked(b, MFF_ETH_SRC, oxm, flow->dl_src, match->wc.masks.dl_src); - nxm_put_eth_masked(b, mf_oxm_header(MFF_ETH_DST, oxm), + nxm_put_eth_masked(b, MFF_ETH_DST, oxm, flow->dl_dst, match->wc.masks.dl_dst); - nxm_put_16m(b, mf_oxm_header(MFF_ETH_TYPE, oxm), + nxm_put_16m(b, MFF_ETH_TYPE, oxm, ofputil_dl_type_to_openflow(flow->dl_type), match->wc.masks.dl_type); @@ -660,35 +912,35 @@ ovs_be16 mask = match->wc.masks.vlan_tci & VID_CFI_MASK; if (mask == htons(VLAN_VID_MASK | VLAN_CFI)) { - nxm_put_16(b, mf_oxm_header(MFF_VLAN_VID, oxm), vid); + nxm_put_16(b, MFF_VLAN_VID, oxm, vid); } else if (mask) { - nxm_put_16m(b, mf_oxm_header(MFF_VLAN_VID, oxm), vid, mask); + nxm_put_16m(b, MFF_VLAN_VID, oxm, vid, mask); } if (vid && vlan_tci_to_pcp(match->wc.masks.vlan_tci)) { - nxm_put_8(b, mf_oxm_header(MFF_VLAN_PCP, oxm), + nxm_put_8(b, MFF_VLAN_PCP, oxm, vlan_tci_to_pcp(flow->vlan_tci)); } } else { - nxm_put_16m(b, mf_oxm_header(MFF_VLAN_TCI, oxm), flow->vlan_tci, + nxm_put_16m(b, MFF_VLAN_TCI, oxm, flow->vlan_tci, match->wc.masks.vlan_tci); } /* MPLS. */ if (eth_type_mpls(flow->dl_type)) { if (match->wc.masks.mpls_lse[0] & htonl(MPLS_TC_MASK)) { - nxm_put_8(b, mf_oxm_header(MFF_MPLS_TC, oxm), + nxm_put_8(b, MFF_MPLS_TC, oxm, mpls_lse_to_tc(flow->mpls_lse[0])); } if (match->wc.masks.mpls_lse[0] & htonl(MPLS_BOS_MASK)) { - nxm_put_8(b, mf_oxm_header(MFF_MPLS_BOS, oxm), + nxm_put_8(b, MFF_MPLS_BOS, oxm, mpls_lse_to_bos(flow->mpls_lse[0])); } if (match->wc.masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK)) { - nxm_put_32(b, mf_oxm_header(MFF_MPLS_LABEL, oxm), + nxm_put_32(b, MFF_MPLS_LABEL, oxm, htonl(mpls_lse_to_label(flow->mpls_lse[0]))); } } @@ -700,47 +952,68 @@ flow->dl_type == htons(ETH_TYPE_RARP)) { /* ARP. */ if (match->wc.masks.nw_proto) { - nxm_put_16(b, mf_oxm_header(MFF_ARP_OP, oxm), + nxm_put_16(b, MFF_ARP_OP, oxm, htons(flow->nw_proto)); } - nxm_put_32m(b, mf_oxm_header(MFF_ARP_SPA, oxm), + nxm_put_32m(b, MFF_ARP_SPA, oxm, flow->nw_src, match->wc.masks.nw_src); - nxm_put_32m(b, mf_oxm_header(MFF_ARP_TPA, oxm), + nxm_put_32m(b, MFF_ARP_TPA, oxm, flow->nw_dst, match->wc.masks.nw_dst); - nxm_put_eth_masked(b, mf_oxm_header(MFF_ARP_SHA, oxm), + nxm_put_eth_masked(b, MFF_ARP_SHA, oxm, flow->arp_sha, match->wc.masks.arp_sha); - nxm_put_eth_masked(b, mf_oxm_header(MFF_ARP_THA, oxm), + nxm_put_eth_masked(b, MFF_ARP_THA, oxm, flow->arp_tha, match->wc.masks.arp_tha); } /* Tunnel ID. */ - nxm_put_64m(b, mf_oxm_header(MFF_TUN_ID, oxm), + nxm_put_64m(b, MFF_TUN_ID, oxm, flow->tunnel.tun_id, match->wc.masks.tunnel.tun_id); /* Other tunnel metadata. */ - nxm_put_32m(b, mf_oxm_header(MFF_TUN_SRC, oxm), + nxm_put_32m(b, MFF_TUN_SRC, oxm, flow->tunnel.ip_src, match->wc.masks.tunnel.ip_src); - nxm_put_32m(b, mf_oxm_header(MFF_TUN_DST, oxm), + nxm_put_32m(b, MFF_TUN_DST, oxm, flow->tunnel.ip_dst, match->wc.masks.tunnel.ip_dst); + nxm_put_16m(b, MFF_TUN_GBP_ID, oxm, + flow->tunnel.gbp_id, match->wc.masks.tunnel.gbp_id); + nxm_put_8m(b, MFF_TUN_GBP_FLAGS, oxm, + flow->tunnel.gbp_flags, match->wc.masks.tunnel.gbp_flags); /* Registers. */ - for (i = 0; i < FLOW_N_REGS; i++) { - nxm_put_32m(b, mf_oxm_header(MFF_REG0 + i, oxm), - htonl(flow->regs[i]), htonl(match->wc.masks.regs[i])); + if (oxm < OFP15_VERSION) { + for (i = 0; i < FLOW_N_REGS; i++) { + nxm_put_32m(b, MFF_REG0 + i, oxm, + htonl(flow->regs[i]), htonl(match->wc.masks.regs[i])); + } + } else { + for (i = 0; i < FLOW_N_XREGS; i++) { + nxm_put_64m(b, MFF_XREG0 + i, oxm, + htonll(flow_get_xreg(flow, i)), + htonll(flow_get_xreg(&match->wc.masks, i))); + } } /* Mark. */ - nxm_put_32m(b, mf_oxm_header(MFF_PKT_MARK, oxm), htonl(flow->pkt_mark), + nxm_put_32m(b, MFF_PKT_MARK, oxm, htonl(flow->pkt_mark), htonl(match->wc.masks.pkt_mark)); /* OpenFlow 1.1+ Metadata. */ - nxm_put_64m(b, mf_oxm_header(MFF_METADATA, oxm), + nxm_put_64m(b, MFF_METADATA, oxm, flow->metadata, match->wc.masks.metadata); /* Cookie. */ - nxm_put_64m(b, NXM_NX_COOKIE, cookie, cookie_mask); + if (cookie_mask) { + bool masked = cookie_mask != OVS_BE64_MAX; - match_len = ofpbuf_size(b) - start_len; + cookie &= cookie_mask; + nx_put_header__(b, NXM_NX_COOKIE, masked); + ofpbuf_put(b, &cookie, sizeof cookie); + if (masked) { + ofpbuf_put(b, &cookie_mask, sizeof cookie_mask); + } + } + + match_len = b->size - start_len; return match_len; } @@ -781,7 +1054,7 @@ { int match_len; struct ofp11_match_header *omh; - size_t start_len = ofpbuf_size(b); + size_t start_len = b->size; ovs_be64 cookie = htonll(0), cookie_mask = htonll(0); ofpbuf_put_uninit(b, sizeof *omh); @@ -795,28 +1068,144 @@ return match_len; } + +/* Appends to 'b' the nx_match format that expresses the tlv corresponding + * to 'id'. If mask is not all-ones then it is also formated as the value + * of the tlv. */ +static void +nx_format_mask_tlv(struct ds *ds, enum mf_field_id id, + const union mf_value *mask) +{ + const struct mf_field *mf = mf_from_id(id); + + ds_put_format(ds, "%s", mf->name); + + if (!is_all_ones(mask, mf->n_bytes)) { + ds_put_char(ds, '='); + mf_format(mf, mask, NULL, ds); + } + + ds_put_char(ds, ','); +} + +/* Appends a string representation of 'fa_' to 'ds'. + * The TLVS value of 'fa_' is treated as a mask and + * only the name of fields is formated if it is all ones. */ +void +oxm_format_field_array(struct ds *ds, const struct field_array *fa) +{ + size_t start_len = ds->length; + int i; + + for (i = 0; i < MFF_N_IDS; i++) { + if (bitmap_is_set(fa->used.bm, i)) { + nx_format_mask_tlv(ds, i, &fa->value[i]); + } + } + + if (ds->length > start_len) { + ds_chomp(ds, ','); + } +} + +/* Appends to 'b' a series of OXM TLVs corresponding to the series + * of enum mf_field_id and value tuples in 'fa_'. + * + * OXM differs slightly among versions of OpenFlow. Specify the OpenFlow + * version in use as 'version'. + * + * This function can cause 'b''s data to be reallocated. + * + * Returns the number of bytes appended to 'b'. May return zero. */ +int +oxm_put_field_array(struct ofpbuf *b, const struct field_array *fa, + enum ofp_version version) +{ + size_t start_len = b->size; + int i; + + /* Field arrays are only used with the group selection method + * property and group properties are only available in OpenFlow * 1.5+. + * So the following assertion should never fail. + * + * If support for older OpenFlow versions is desired then some care + * will need to be taken of different TLVs that handle the same + * flow fields. In particular: + * - VLAN_TCI, VLAN_VID and MFF_VLAN_PCP + * - IP_DSCP_MASK and DSCP_SHIFTED + * - REGS and XREGS + */ + ovs_assert(version >= OFP15_VERSION); + + for (i = 0; i < MFF_N_IDS; i++) { + if (bitmap_is_set(fa->used.bm, i)) { + nxm_put_unmasked(b, i, version, &fa->value[i], + mf_from_id(i)->n_bytes); + } + } + + return b->size - start_len; +} + +static void +nx_put_header__(struct ofpbuf *b, uint64_t header, bool masked) +{ + uint64_t masked_header = masked ? nxm_make_wild_header(header) : header; + ovs_be64 network_header = htonll(masked_header); + + ofpbuf_put(b, &network_header, nxm_header_len(header)); +} + +void +nx_put_header(struct ofpbuf *b, enum mf_field_id field, + enum ofp_version version, bool masked) +{ + nx_put_header__(b, mf_oxm_header(field, version), masked); +} + +void +nx_put_entry(struct ofpbuf *b, + enum mf_field_id field, enum ofp_version version, + const union mf_value *value, const union mf_value *mask) +{ + int n_bytes = mf_from_id(field)->n_bytes; + bool masked = mask && !is_all_ones(mask, n_bytes); + + nx_put_header(b, field, version, masked); + ofpbuf_put(b, value, n_bytes); + if (masked) { + ofpbuf_put(b, mask, n_bytes); + } +} /* nx_match_to_string() and helpers. */ -static void format_nxm_field_name(struct ds *, uint32_t header); +static void format_nxm_field_name(struct ds *, uint64_t header); char * nx_match_to_string(const uint8_t *p, unsigned int match_len) { - uint32_t header; + struct ofpbuf b; struct ds s; if (!match_len) { return xstrdup(""); } + ofpbuf_use_const(&b, p, match_len); ds_init(&s); - while ((header = nx_entry_ok(p, match_len)) != 0) { - unsigned int length = NXM_LENGTH(header); - unsigned int value_len = nxm_field_bytes(header); - const uint8_t *value = p + 4; - const uint8_t *mask = value + value_len; - unsigned int i; + while (b.size) { + union mf_value value; + union mf_value mask; + enum ofperr error; + uint64_t header; + int value_len; + + error = nx_pull_entry__(&b, true, &header, NULL, &value, &mask); + if (error) { + break; + } + value_len = MIN(sizeof value, nxm_field_bytes(header)); if (s.length) { ds_put_cstr(&s, ", "); @@ -825,27 +1214,24 @@ format_nxm_field_name(&s, header); ds_put_char(&s, '('); - for (i = 0; i < value_len; i++) { - ds_put_format(&s, "%02x", value[i]); + for (int i = 0; i < value_len; i++) { + ds_put_format(&s, "%02x", ((const uint8_t *) &value)[i]); } - if (NXM_HASMASK(header)) { + if (nxm_hasmask(header)) { ds_put_char(&s, '/'); - for (i = 0; i < value_len; i++) { - ds_put_format(&s, "%02x", mask[i]); + for (int i = 0; i < value_len; i++) { + ds_put_format(&s, "%02x", ((const uint8_t *) &mask)[i]); } } ds_put_char(&s, ')'); - - p += 4 + length; - match_len -= 4 + length; } - if (match_len) { + if (b.size) { if (s.length) { ds_put_cstr(&s, ", "); } - ds_put_format(&s, "<%u invalid bytes>", match_len); + ds_put_format(&s, "<%u invalid bytes>", b.size); } return ds_steal_cstr(&s); @@ -854,7 +1240,7 @@ char * oxm_match_to_string(const struct ofpbuf *p, unsigned int match_len) { - const struct ofp11_match_header *omh = ofpbuf_data(p); + const struct ofp11_match_header *omh = p->data; uint16_t match_len_; struct ds s; @@ -889,13 +1275,20 @@ return ds_steal_cstr(&s); } +void +nx_format_field_name(enum mf_field_id id, enum ofp_version version, + struct ds *s) +{ + format_nxm_field_name(s, mf_oxm_header(id, version)); +} + static void -format_nxm_field_name(struct ds *s, uint32_t header) +format_nxm_field_name(struct ds *s, uint64_t header) { - const struct mf_field *mf = mf_from_nxm_header(header); - if (mf) { - ds_put_cstr(s, IS_OXM_HEADER(header) ? mf->oxm_name : mf->nxm_name); - if (NXM_HASMASK(header)) { + const struct nxm_field *f = nxm_field_by_header(header); + if (f) { + ds_put_cstr(s, f->name); + if (nxm_hasmask(header)) { ds_put_cstr(s, "_W"); } } else if (header == NXM_NX_COOKIE) { @@ -903,59 +1296,53 @@ } else if (header == NXM_NX_COOKIE_W) { ds_put_cstr(s, "NXM_NX_COOKIE_W"); } else { - ds_put_format(s, "%d:%d", NXM_VENDOR(header), NXM_FIELD(header)); + ds_put_format(s, "%d:%d", nxm_class(header), nxm_field(header)); } } -static uint32_t +static bool +streq_len(const char *a, size_t a_len, const char *b) +{ + return strlen(b) == a_len && !memcmp(a, b, a_len); +} + +static uint64_t parse_nxm_field_name(const char *name, int name_len) { + const struct nxm_field *f; bool wild; - int i; - - /* Check whether it's a field name. */ - wild = name_len > 2 && !memcmp(&name[name_len - 2], "_W", 2); - if (wild) { - name_len -= 2; - } - - for (i = 0; i < MFF_N_IDS; i++) { - const struct mf_field *mf = mf_from_id(i); - uint32_t header; - - if (mf->nxm_name && - !strncmp(mf->nxm_name, name, name_len) && - mf->nxm_name[name_len] == '\0') { - header = mf->nxm_header; - } else if (mf->oxm_name && - !strncmp(mf->oxm_name, name, name_len) && - mf->oxm_name[name_len] == '\0') { - header = mf->oxm_header; - } else { - continue; - } + f = mf_parse_subfield_name(name, name_len, &wild); + if (f) { if (!wild) { - return header; - } else if (mf->maskable != MFM_NONE) { - return NXM_MAKE_WILD_HEADER(header); + return f->header; + } else if (mf_from_id(f->id)->maskable != MFM_NONE) { + return nxm_make_wild_header(f->header); } } - if (!strncmp("NXM_NX_COOKIE", name, name_len) && - (name_len == strlen("NXM_NX_COOKIE"))) { - if (!wild) { - return NXM_NX_COOKIE; - } else { - return NXM_NX_COOKIE_W; - } + if (streq_len(name, name_len, "NXM_NX_COOKIE")) { + return NXM_NX_COOKIE; + } else if (streq_len(name, name_len, "NXM_NX_COOKIE_W")) { + return NXM_NX_COOKIE_W; } - /* Check whether it's a 32-bit field header value as hex. + /* Check whether it's a field header value as hex. * (This isn't ordinarily useful except for testing error behavior.) */ if (name_len == 8) { - uint32_t header = hexits_value(name, name_len, NULL); - if (header != UINT_MAX) { + uint64_t header; + bool ok; + + header = hexits_value(name, name_len, &ok) << 32; + if (ok) { + return header; + } + } else if (name_len == 16) { + uint64_t header; + bool ok; + + header = hexits_value(name, name_len, &ok); + if (ok && is_experimenter_oxm(header)) { return header; } } @@ -969,17 +1356,17 @@ nx_match_from_string_raw(const char *s, struct ofpbuf *b) { const char *full_s = s; - const size_t start_len = ofpbuf_size(b); + const size_t start_len = b->size; if (!strcmp(s, "")) { - /* Ensure that 'ofpbuf_data(b)' isn't actually null. */ + /* Ensure that 'b->data' isn't actually null. */ ofpbuf_prealloc_tailroom(b, 1); return 0; } for (s += strspn(s, ", "); *s; s += strspn(s, ", ")) { const char *name; - uint32_t header; + uint64_t header; int name_len; size_t n; @@ -996,12 +1383,12 @@ s += name_len + 1; - nxm_put_header(b, header); + nx_put_header__(b, header, false); s = ofpbuf_put_hex(b, s, &n); if (n != nxm_field_bytes(header)) { ovs_fatal(0, "%.2s: hex digits expected", s); } - if (NXM_HASMASK(header)) { + if (nxm_hasmask(header)) { s += strspn(s, " "); if (*s != '/') { ovs_fatal(0, "%s: missing / in masked field %.*s", @@ -1021,7 +1408,7 @@ s++; } - return ofpbuf_size(b) - start_len; + return b->size - start_len; } int @@ -1037,7 +1424,7 @@ { int match_len; struct ofp11_match_header *omh; - size_t start_len = ofpbuf_size(b); + size_t start_len = b->size; ofpbuf_put_uninit(b, sizeof *omh); match_len = nx_match_from_string_raw(s, b) + sizeof *omh; @@ -1055,7 +1442,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT nxm_parse_reg_move(struct ofpact_reg_move *move, const char *s) { const char *full_s = s; @@ -1081,39 +1468,8 @@ } return NULL; } - -/* Parses 's' as a "load" action, in the form described in ovs-ofctl(8), into - * '*load'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT -nxm_parse_reg_load(struct ofpact_reg_load *load, const char *s) -{ - const char *full_s = s; - uint64_t value = strtoull(s, (char **) &s, 0); - char *error; - - if (strncmp(s, "->", 2)) { - return xasprintf("%s: missing `->' following value", full_s); - } - s += 2; - error = mf_parse_subfield(&load->dst, s); - if (error) { - return error; - } - - if (load->dst.n_bits < 64 && (value >> load->dst.n_bits) != 0) { - return xasprintf("%s: value %"PRIu64" does not fit into %d bits", - full_s, value, load->dst.n_bits); - } - - load->subvalue.be64[0] = htonll(0); - load->subvalue.be64[1] = htonll(value); - return NULL; -} -/* nxm_format_reg_move(), nxm_format_reg_load(). */ +/* nxm_format_reg_move(). */ void nxm_format_reg_move(const struct ofpact_reg_move *move, struct ds *s) @@ -1124,53 +1480,6 @@ mf_format_subfield(&move->dst, s); } -void -nxm_format_reg_load(const struct ofpact_reg_load *load, struct ds *s) -{ - ds_put_cstr(s, "load:"); - mf_format_subvalue(&load->subvalue, s); - ds_put_cstr(s, "->"); - mf_format_subfield(&load->dst, s); -} - -enum ofperr -nxm_reg_move_from_openflow(const struct nx_action_reg_move *narm, - struct ofpbuf *ofpacts) -{ - struct ofpact_reg_move *move; - - move = ofpact_put_REG_MOVE(ofpacts); - move->src.field = mf_from_nxm_header(ntohl(narm->src)); - move->src.ofs = ntohs(narm->src_ofs); - move->src.n_bits = ntohs(narm->n_bits); - move->dst.field = mf_from_nxm_header(ntohl(narm->dst)); - move->dst.ofs = ntohs(narm->dst_ofs); - move->dst.n_bits = ntohs(narm->n_bits); - - return nxm_reg_move_check(move, NULL); -} - -enum ofperr -nxm_reg_load_from_openflow(const struct nx_action_reg_load *narl, - struct ofpbuf *ofpacts) -{ - struct ofpact_reg_load *load; - - load = ofpact_put_REG_LOAD(ofpacts); - load->dst.field = mf_from_nxm_header(ntohl(narl->dst)); - load->dst.ofs = nxm_decode_ofs(narl->ofs_nbits); - load->dst.n_bits = nxm_decode_n_bits(narl->ofs_nbits); - load->subvalue.be64[1] = narl->value; - - /* Reject 'narl' if a bit numbered 'n_bits' or higher is set to 1 in - * narl->value. */ - if (load->dst.n_bits < 64 && - ntohll(narl->value) >> load->dst.n_bits) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - - return nxm_reg_load_check(load, NULL); -} enum ofperr nxm_reg_move_check(const struct ofpact_reg_move *move, const struct flow *flow) @@ -1182,42 +1491,10 @@ return error; } - return mf_check_dst(&move->dst, NULL); -} - -enum ofperr -nxm_reg_load_check(const struct ofpact_reg_load *load, const struct flow *flow) -{ - return mf_check_dst(&load->dst, flow); + return mf_check_dst(&move->dst, flow); } -void -nxm_reg_move_to_nxast(const struct ofpact_reg_move *move, - struct ofpbuf *openflow) -{ - struct nx_action_reg_move *narm; - - narm = ofputil_put_NXAST_REG_MOVE(openflow); - narm->n_bits = htons(move->dst.n_bits); - narm->src_ofs = htons(move->src.ofs); - narm->dst_ofs = htons(move->dst.ofs); - narm->src = htonl(move->src.field->nxm_header); - narm->dst = htonl(move->dst.field->nxm_header); -} - -void -nxm_reg_load_to_nxast(const struct ofpact_reg_load *load, - struct ofpbuf *openflow) -{ - struct nx_action_reg_load *narl; - - narl = ofputil_put_NXAST_REG_LOAD(openflow); - narl->ofs_nbits = nxm_encode_ofs_nbits(load->dst.ofs, load->dst.n_bits); - narl->dst = htonl(load->dst.field->nxm_header); - narl->value = load->subvalue.be64[1]; -} - -/* nxm_execute_reg_move(), nxm_execute_reg_load(). */ +/* nxm_execute_reg_move(). */ void nxm_execute_reg_move(const struct ofpact_reg_move *move, @@ -1229,43 +1506,18 @@ mf_mask_field_and_prereqs(move->dst.field, &wc->masks); mf_mask_field_and_prereqs(move->src.field, &wc->masks); - mf_get_value(move->dst.field, flow, &dst_value); - mf_get_value(move->src.field, flow, &src_value); - bitwise_copy(&src_value, move->src.field->n_bytes, move->src.ofs, - &dst_value, move->dst.field->n_bytes, move->dst.ofs, - move->src.n_bits); - mf_set_flow_value(move->dst.field, &dst_value, flow); -} - -void -nxm_execute_reg_load(const struct ofpact_reg_load *load, struct flow *flow, - struct flow_wildcards *wc) -{ - /* Since at the datapath interface we do not have set actions for - * individual fields, but larger sets of fields for a given protocol - * layer, the set action will in practice only ever apply to exactly - * matched flows for the given protocol layer. For example, if the - * reg_load changes the IP TTL, the corresponding datapath action will - * rewrite also the IP addresses and TOS byte. Since these other field - * values may not be explicitly set, they depend on the incoming flow field - * values, and are hence all of them are set in the wildcards masks, when - * the action is committed to the datapath. For the rare case, where the - * reg_load action does not actually change the value, and no other flow - * field values are set (or loaded), the datapath action is skipped, and - * no mask bits are set. Such a datapath flow should, however, be - * dependent on the specific field value, so the corresponding wildcard - * mask bits must be set, lest the datapath flow be applied to packets - * containing some other value in the field and the field value remain - * unchanged regardless of the incoming value. - * - * We set the masks here for the whole fields, and their prerequisities. - * Even if only the lower byte of a TCP destination port is set, - * we set the mask for the whole field, and also the ip_proto in the IP - * header, so that the kernel flow would not be applied on, e.g., a UDP - * packet, or any other IP protocol in addition to TCP packets. - */ - mf_mask_field_and_prereqs(load->dst.field, &wc->masks); - mf_write_subfield_flow(&load->dst, &load->subvalue, flow); + /* A flow may wildcard nw_frag. Do nothing if setting a transport + * header field on a packet that does not have them. */ + if (mf_are_prereqs_ok(move->dst.field, flow) + && mf_are_prereqs_ok(move->src.field, flow)) { + + mf_get_value(move->dst.field, flow, &dst_value); + mf_get_value(move->src.field, flow, &src_value); + bitwise_copy(&src_value, move->src.field->n_bytes, move->src.ofs, + &dst_value, move->dst.field->n_bytes, move->dst.ofs, + move->src.n_bits); + mf_set_flow_value(move->dst.field, &dst_value, flow); + } } void @@ -1292,7 +1544,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT nxm_parse_stack_action(struct ofpact_stack *stack_action, const char *s) { char *error; @@ -1323,49 +1575,6 @@ mf_format_subfield(&pop->subfield, s); } -/* Common set for both push and pop actions. */ -static void -stack_action_from_openflow__(const struct nx_action_stack *nasp, - struct ofpact_stack *stack_action) -{ - stack_action->subfield.field = mf_from_nxm_header(ntohl(nasp->field)); - stack_action->subfield.ofs = ntohs(nasp->offset); - stack_action->subfield.n_bits = ntohs(nasp->n_bits); -} - -static void -nxm_stack_to_nxast__(const struct ofpact_stack *stack_action, - struct nx_action_stack *nasp) -{ - nasp->offset = htons(stack_action->subfield.ofs); - nasp->n_bits = htons(stack_action->subfield.n_bits); - nasp->field = htonl(stack_action->subfield.field->nxm_header); -} - -enum ofperr -nxm_stack_push_from_openflow(const struct nx_action_stack *nasp, - struct ofpbuf *ofpacts) -{ - struct ofpact_stack *push; - - push = ofpact_put_STACK_PUSH(ofpacts); - stack_action_from_openflow__(nasp, push); - - return nxm_stack_push_check(push, NULL); -} - -enum ofperr -nxm_stack_pop_from_openflow(const struct nx_action_stack *nasp, - struct ofpbuf *ofpacts) -{ - struct ofpact_stack *pop; - - pop = ofpact_put_STACK_POP(ofpacts); - stack_action_from_openflow__(nasp, pop); - - return nxm_stack_pop_check(pop, NULL); -} - enum ofperr nxm_stack_push_check(const struct ofpact_stack *push, const struct flow *flow) @@ -1380,20 +1589,6 @@ return mf_check_dst(&pop->subfield, flow); } -void -nxm_stack_push_to_nxast(const struct ofpact_stack *stack, - struct ofpbuf *openflow) -{ - nxm_stack_to_nxast__(stack, ofputil_put_NXAST_STACK_PUSH(openflow)); -} - -void -nxm_stack_pop_to_nxast(const struct ofpact_stack *stack, - struct ofpbuf *openflow) -{ - nxm_stack_to_nxast__(stack, ofputil_put_NXAST_STACK_POP(openflow)); -} - /* nxm_execute_stack_push(), nxm_execute_stack_pop(). */ static void nx_stack_push(struct ofpbuf *stack, union mf_subvalue *v) @@ -1406,9 +1601,9 @@ { union mf_subvalue *v = NULL; - if (ofpbuf_size(stack)) { + if (stack->size) { - ofpbuf_set_size(stack, ofpbuf_size(stack) - sizeof *v); + stack->size -= sizeof *v; v = (union mf_subvalue *) ofpbuf_tail(stack); } @@ -1449,9 +1644,311 @@ } else { if (!VLOG_DROP_WARN(&rl)) { char *flow_str = flow_to_string(flow); - VLOG_WARN_RL(&rl, "Failed to pop from an empty stack. On flow \n" + VLOG_WARN_RL(&rl, "Failed to pop from an empty stack. On flow\n" " %s", flow_str); free(flow_str); } } } + +/* Formats 'sf' into 's' in a format normally acceptable to + * mf_parse_subfield(). (It won't be acceptable if sf->field is NULL or if + * sf->field has no NXM name.) */ +void +mf_format_subfield(const struct mf_subfield *sf, struct ds *s) +{ + if (!sf->field) { + ds_put_cstr(s, ""); + } else { + const struct nxm_field *f = nxm_field_by_mf_id(sf->field->id, 0); + ds_put_cstr(s, f ? f->name : sf->field->name); + } + + if (sf->field && sf->ofs == 0 && sf->n_bits == sf->field->n_bits) { + ds_put_cstr(s, "[]"); + } else if (sf->n_bits == 1) { + ds_put_format(s, "[%d]", sf->ofs); + } else { + ds_put_format(s, "[%d..%d]", sf->ofs, sf->ofs + sf->n_bits - 1); + } +} + +static const struct nxm_field * +mf_parse_subfield_name(const char *name, int name_len, bool *wild) +{ + *wild = name_len > 2 && !memcmp(&name[name_len - 2], "_W", 2); + if (*wild) { + name_len -= 2; + } + + return nxm_field_by_name(name, name_len); +} + +/* Parses a subfield from the beginning of '*sp' into 'sf'. If successful, + * returns NULL and advances '*sp' to the first byte following the parsed + * string. On failure, returns a malloc()'d error message, does not modify + * '*sp', and does not properly initialize 'sf'. + * + * The syntax parsed from '*sp' takes the form "header[start..end]" where + * 'header' is the name of an NXM field and 'start' and 'end' are (inclusive) + * bit indexes. "..end" may be omitted to indicate a single bit. "start..end" + * may both be omitted (the [] are still required) to indicate an entire + * field. */ +char * OVS_WARN_UNUSED_RESULT +mf_parse_subfield__(struct mf_subfield *sf, const char **sp) +{ + const struct mf_field *field; + const struct nxm_field *f; + const char *name; + int start, end; + const char *s; + int name_len; + bool wild; + + s = *sp; + name = s; + name_len = strcspn(s, "["); + if (s[name_len] != '[') { + return xasprintf("%s: missing [ looking for field name", *sp); + } + + f = mf_parse_subfield_name(name, name_len, &wild); + if (!f) { + return xasprintf("%s: unknown field `%.*s'", *sp, name_len, s); + } + field = mf_from_id(f->id); + + s += name_len; + if (ovs_scan(s, "[%d..%d]", &start, &end)) { + /* Nothing to do. */ + } else if (ovs_scan(s, "[%d]", &start)) { + end = start; + } else if (!strncmp(s, "[]", 2)) { + start = 0; + end = field->n_bits - 1; + } else { + return xasprintf("%s: syntax error expecting [] or [] or " + "[..]", *sp); + } + s = strchr(s, ']') + 1; + + if (start > end) { + return xasprintf("%s: starting bit %d is after ending bit %d", + *sp, start, end); + } else if (start >= field->n_bits) { + return xasprintf("%s: starting bit %d is not valid because field is " + "only %d bits wide", *sp, start, field->n_bits); + } else if (end >= field->n_bits){ + return xasprintf("%s: ending bit %d is not valid because field is " + "only %d bits wide", *sp, end, field->n_bits); + } + + sf->field = field; + sf->ofs = start; + sf->n_bits = end - start + 1; + + *sp = s; + return NULL; +} + +/* Parses a subfield from the entirety of 's' into 'sf'. Returns NULL if + * successful, otherwise a malloc()'d string describing the error. The caller + * is responsible for freeing the returned string. + * + * The syntax parsed from 's' takes the form "header[start..end]" where + * 'header' is the name of an NXM field and 'start' and 'end' are (inclusive) + * bit indexes. "..end" may be omitted to indicate a single bit. "start..end" + * may both be omitted (the [] are still required) to indicate an entire + * field. */ +char * OVS_WARN_UNUSED_RESULT +mf_parse_subfield(struct mf_subfield *sf, const char *s) +{ + char *error = mf_parse_subfield__(sf, &s); + if (!error && s[0]) { + error = xstrdup("unexpected input following field syntax"); + } + return error; +} + +/* Returns an bitmap in which each bit corresponds to the like-numbered field + * in the OFPXMC12_OPENFLOW_BASIC OXM class, in which the bit values are taken + * from the 'fields' bitmap. Only fields defined in OpenFlow 'version' are + * considered. + * + * This is useful for encoding OpenFlow 1.2 table stats messages. */ +ovs_be64 +oxm_bitmap_from_mf_bitmap(const struct mf_bitmap *fields, + enum ofp_version version) +{ + uint64_t oxm_bitmap = 0; + int i; + + BITMAP_FOR_EACH_1 (i, MFF_N_IDS, fields->bm) { + uint64_t oxm = mf_oxm_header(i, version); + uint32_t class = nxm_class(oxm); + int field = nxm_field(oxm); + + if (class == OFPXMC12_OPENFLOW_BASIC && field < 64) { + oxm_bitmap |= UINT64_C(1) << field; + } + } + return htonll(oxm_bitmap); +} + +/* Opposite conversion from oxm_bitmap_from_mf_bitmap(). + * + * This is useful for decoding OpenFlow 1.2 table stats messages. */ +struct mf_bitmap +oxm_bitmap_to_mf_bitmap(ovs_be64 oxm_bitmap, enum ofp_version version) +{ + struct mf_bitmap fields = MF_BITMAP_INITIALIZER; + + for (enum mf_field_id id = 0; id < MFF_N_IDS; id++) { + uint64_t oxm = mf_oxm_header(id, version); + if (oxm && version >= nxm_field_by_header(oxm)->version) { + uint32_t class = nxm_class(oxm); + int field = nxm_field(oxm); + + if (class == OFPXMC12_OPENFLOW_BASIC + && field < 64 + && oxm_bitmap & htonll(UINT64_C(1) << field)) { + bitmap_set1(fields.bm, id); + } + } + } + return fields; +} + +/* Returns a bitmap of fields that can be encoded in OXM and that can be + * modified with a "set_field" action. */ +struct mf_bitmap +oxm_writable_fields(void) +{ + struct mf_bitmap b = MF_BITMAP_INITIALIZER; + int i; + + for (i = 0; i < MFF_N_IDS; i++) { + if (mf_oxm_header(i, 0) && mf_from_id(i)->writable) { + bitmap_set1(b.bm, i); + } + } + return b; +} + +/* Returns a bitmap of fields that can be encoded in OXM and that can be + * matched in a flow table. */ +struct mf_bitmap +oxm_matchable_fields(void) +{ + struct mf_bitmap b = MF_BITMAP_INITIALIZER; + int i; + + for (i = 0; i < MFF_N_IDS; i++) { + if (mf_oxm_header(i, 0)) { + bitmap_set1(b.bm, i); + } + } + return b; +} + +/* Returns a bitmap of fields that can be encoded in OXM and that can be + * matched in a flow table with an arbitrary bitmask. */ +struct mf_bitmap +oxm_maskable_fields(void) +{ + struct mf_bitmap b = MF_BITMAP_INITIALIZER; + int i; + + for (i = 0; i < MFF_N_IDS; i++) { + if (mf_oxm_header(i, 0) && mf_from_id(i)->maskable == MFM_FULLY) { + bitmap_set1(b.bm, i); + } + } + return b; +} + +struct nxm_field_index { + struct hmap_node header_node; /* In nxm_header_map. */ + struct hmap_node name_node; /* In nxm_name_map. */ + struct ovs_list mf_node; /* In mf_mf_map[nf.id]. */ + const struct nxm_field nf; +}; + +#include "nx-match.inc" + +static struct hmap nxm_header_map; +static struct hmap nxm_name_map; +static struct ovs_list nxm_mf_map[MFF_N_IDS]; + +static void +nxm_init(void) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + if (ovsthread_once_start(&once)) { + hmap_init(&nxm_header_map); + hmap_init(&nxm_name_map); + for (int i = 0; i < MFF_N_IDS; i++) { + list_init(&nxm_mf_map[i]); + } + for (struct nxm_field_index *nfi = all_nxm_fields; + nfi < &all_nxm_fields[ARRAY_SIZE(all_nxm_fields)]; nfi++) { + hmap_insert(&nxm_header_map, &nfi->header_node, + hash_int(nfi->nf.header, 0)); + hmap_insert(&nxm_name_map, &nfi->name_node, + hash_string(nfi->nf.name, 0)); + list_push_back(&nxm_mf_map[nfi->nf.id], &nfi->mf_node); + } + ovsthread_once_done(&once); + } +} + +static const struct nxm_field * +nxm_field_by_header(uint64_t header) +{ + const struct nxm_field_index *nfi; + + nxm_init(); + if (nxm_hasmask(header)) { + header = nxm_make_exact_header(header); + } + + HMAP_FOR_EACH_IN_BUCKET (nfi, header_node, hash_int(header, 0), + &nxm_header_map) { + if (header == nfi->nf.header) { + return &nfi->nf; + } + } + return NULL; +} + +static const struct nxm_field * +nxm_field_by_name(const char *name, size_t len) +{ + const struct nxm_field_index *nfi; + + nxm_init(); + HMAP_FOR_EACH_WITH_HASH (nfi, name_node, hash_bytes(name, len, 0), + &nxm_name_map) { + if (strlen(nfi->nf.name) == len && !memcmp(nfi->nf.name, name, len)) { + return &nfi->nf; + } + } + return NULL; +} + +static const struct nxm_field * +nxm_field_by_mf_id(enum mf_field_id id, enum ofp_version version) +{ + const struct nxm_field_index *nfi; + const struct nxm_field *f; + + nxm_init(); + + f = NULL; + LIST_FOR_EACH (nfi, mf_node, &nxm_mf_map[id]) { + if (!f || version >= nfi->nf.version) { + f = &nfi->nf; + } + } + return f; +} diff -Nru openvswitch-2.3.1/lib/nx-match.h openvswitch-2.4.0~git20150623/lib/nx-match.h --- openvswitch-2.3.1/lib/nx-match.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/nx-match.h 2015-06-23 18:46:21.000000000 +0000 @@ -22,13 +22,12 @@ #include #include "compiler.h" #include "flow.h" +#include "meta-flow.h" #include "ofp-errors.h" #include "openvswitch/types.h" struct ds; struct match; -struct mf_field; -struct mf_subfield; struct ofpact_reg_move; struct ofpact_reg_load; struct ofpact_stack; @@ -42,6 +41,12 @@ * See include/openflow/nicira-ext.h for NXM specification. */ +void mf_format_subfield(const struct mf_subfield *, struct ds *); +char *mf_parse_subfield__(struct mf_subfield *sf, const char **s) + OVS_WARN_UNUSED_RESULT; +char *mf_parse_subfield(struct mf_subfield *, const char *s) + OVS_WARN_UNUSED_RESULT; + enum ofperr nx_pull_match(struct ofpbuf *, unsigned int match_len, struct match *, ovs_be64 *cookie, ovs_be64 *cookie_mask); @@ -50,65 +55,66 @@ ovs_be64 *cookie_mask); enum ofperr oxm_pull_match(struct ofpbuf *, struct match *); enum ofperr oxm_pull_match_loose(struct ofpbuf *, struct match *); +enum ofperr oxm_pull_field_array(const void *, size_t fields_len, + struct field_array *); int nx_put_match(struct ofpbuf *, const struct match *, ovs_be64 cookie, ovs_be64 cookie_mask); int oxm_put_match(struct ofpbuf *, const struct match *, enum ofp_version); +void oxm_format_field_array(struct ds *, const struct field_array *); +int oxm_put_field_array(struct ofpbuf *, const struct field_array *, + enum ofp_version version); + +/* Decoding and encoding OXM/NXM headers (just a field ID) or entries (a field + * ID followed by a value and possibly a mask). */ +enum ofperr nx_pull_entry(struct ofpbuf *, const struct mf_field **, + union mf_value *value, union mf_value *mask); +enum ofperr nx_pull_header(struct ofpbuf *, const struct mf_field **, + bool *masked); +void nx_put_entry(struct ofpbuf *, enum mf_field_id, enum ofp_version, + const union mf_value *value, const union mf_value *mask); +void nx_put_header(struct ofpbuf *, enum mf_field_id, enum ofp_version, + bool masked); + +/* NXM and OXM protocol headers values. + * + * These are often alternatives to nx_pull_entry/header() and + * nx_put_entry/header() for decoding and encoding OXM/NXM. In those cases, + * the nx_*() functions should be preferred because they can support the 64-bit + * "experimenter" OXM format (even though it is not yet implemented). */ +uint32_t mf_nxm_header(enum mf_field_id); +const struct mf_field *mf_from_nxm_header(uint32_t nxm_header); char *nx_match_to_string(const uint8_t *, unsigned int match_len); char *oxm_match_to_string(const struct ofpbuf *, unsigned int match_len); int nx_match_from_string(const char *, struct ofpbuf *); int oxm_match_from_string(const char *, struct ofpbuf *); +void nx_format_field_name(enum mf_field_id, enum ofp_version, struct ds *); + char *nxm_parse_reg_move(struct ofpact_reg_move *, const char *) - WARN_UNUSED_RESULT; -char *nxm_parse_reg_load(struct ofpact_reg_load *, const char *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void nxm_format_reg_move(const struct ofpact_reg_move *, struct ds *); -void nxm_format_reg_load(const struct ofpact_reg_load *, struct ds *); - -enum ofperr nxm_reg_move_from_openflow(const struct nx_action_reg_move *, - struct ofpbuf *ofpacts); -enum ofperr nxm_reg_load_from_openflow(const struct nx_action_reg_load *, - struct ofpbuf *ofpacts); enum ofperr nxm_reg_move_check(const struct ofpact_reg_move *, const struct flow *); -enum ofperr nxm_reg_load_check(const struct ofpact_reg_load *, - const struct flow *); - -void nxm_reg_move_to_nxast(const struct ofpact_reg_move *, - struct ofpbuf *openflow); -void nxm_reg_load_to_nxast(const struct ofpact_reg_load *, - struct ofpbuf *openflow); void nxm_execute_reg_move(const struct ofpact_reg_move *, struct flow *, struct flow_wildcards *); -void nxm_execute_reg_load(const struct ofpact_reg_load *, struct flow *, - struct flow_wildcards *); void nxm_reg_load(const struct mf_subfield *, uint64_t src_data, struct flow *, struct flow_wildcards *); char *nxm_parse_stack_action(struct ofpact_stack *, const char *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void nxm_format_stack_push(const struct ofpact_stack *, struct ds *); void nxm_format_stack_pop(const struct ofpact_stack *, struct ds *); -enum ofperr nxm_stack_push_from_openflow(const struct nx_action_stack *, - struct ofpbuf *ofpacts); -enum ofperr nxm_stack_pop_from_openflow(const struct nx_action_stack *, - struct ofpbuf *ofpacts); enum ofperr nxm_stack_push_check(const struct ofpact_stack *, const struct flow *); enum ofperr nxm_stack_pop_check(const struct ofpact_stack *, const struct flow *); -void nxm_stack_push_to_nxast(const struct ofpact_stack *, - struct ofpbuf *openflow); -void nxm_stack_pop_to_nxast(const struct ofpact_stack *, - struct ofpbuf *openflow); - void nxm_execute_stack_push(const struct ofpact_stack *, const struct flow *, struct flow_wildcards *, struct ofpbuf *); @@ -116,8 +122,12 @@ struct flow *, struct flow_wildcards *, struct ofpbuf *); -int nxm_field_bytes(uint32_t header); -int nxm_field_bits(uint32_t header); +ovs_be64 oxm_bitmap_from_mf_bitmap(const struct mf_bitmap *, enum ofp_version); +struct mf_bitmap oxm_bitmap_to_mf_bitmap(ovs_be64 oxm_bitmap, + enum ofp_version); +struct mf_bitmap oxm_writable_fields(void); +struct mf_bitmap oxm_matchable_fields(void); +struct mf_bitmap oxm_maskable_fields(void); /* Dealing with the 'ofs_nbits' members in several Nicira extensions. */ diff -Nru openvswitch-2.3.1/lib/odp-execute.c openvswitch-2.4.0~git20150623/lib/odp-execute.c --- openvswitch-2.3.1/lib/odp-execute.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/odp-execute.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * Copyright (c) 2013 Simon Horman * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,28 +17,132 @@ #include #include "odp-execute.h" -#include +#include +#include +#include +#include #include #include +#include "dp-packet.h" #include "dpif.h" #include "netlink.h" -#include "ofpbuf.h" +#include "odp-netlink.h" #include "odp-util.h" #include "packets.h" #include "flow.h" #include "unaligned.h" #include "util.h" +/* Masked copy of an ethernet address. 'src' is already properly masked. */ static void -odp_eth_set_addrs(struct ofpbuf *packet, - const struct ovs_key_ethernet *eth_key) +ether_addr_copy_masked(uint8_t *dst, const uint8_t *src, + const uint8_t *mask) { - struct eth_header *eh = ofpbuf_l2(packet); + int i; + + for (i = 0; i < ETH_ADDR_LEN; i++) { + dst[i] = src[i] | (dst[i] & ~mask[i]); + } +} + +static void +odp_eth_set_addrs(struct dp_packet *packet, const struct ovs_key_ethernet *key, + const struct ovs_key_ethernet *mask) +{ + struct eth_header *eh = dp_packet_l2(packet); if (eh) { - memcpy(eh->eth_src, eth_key->eth_src, sizeof eh->eth_src); - memcpy(eh->eth_dst, eth_key->eth_dst, sizeof eh->eth_dst); + if (!mask) { + memcpy(eh->eth_src, key->eth_src, sizeof eh->eth_src); + memcpy(eh->eth_dst, key->eth_dst, sizeof eh->eth_dst); + } else { + ether_addr_copy_masked(eh->eth_src, key->eth_src, mask->eth_src); + ether_addr_copy_masked(eh->eth_dst, key->eth_dst, mask->eth_dst); + } + } +} + +static void +odp_set_ipv4(struct dp_packet *packet, const struct ovs_key_ipv4 *key, + const struct ovs_key_ipv4 *mask) +{ + struct ip_header *nh = dp_packet_l3(packet); + + packet_set_ipv4( + packet, + key->ipv4_src | (get_16aligned_be32(&nh->ip_src) & ~mask->ipv4_src), + key->ipv4_dst | (get_16aligned_be32(&nh->ip_dst) & ~mask->ipv4_dst), + key->ipv4_tos | (nh->ip_tos & ~mask->ipv4_tos), + key->ipv4_ttl | (nh->ip_ttl & ~mask->ipv4_ttl)); +} + +static const ovs_be32 * +mask_ipv6_addr(const ovs_16aligned_be32 *old, const ovs_be32 *addr, + const ovs_be32 *mask, ovs_be32 *masked) +{ + for (int i = 0; i < 4; i++) { + masked[i] = addr[i] | (get_16aligned_be32(&old[i]) & ~mask[i]); + } + + return masked; +} + +static void +odp_set_ipv6(struct dp_packet *packet, const struct ovs_key_ipv6 *key, + const struct ovs_key_ipv6 *mask) +{ + struct ovs_16aligned_ip6_hdr *nh = dp_packet_l3(packet); + ovs_be32 sbuf[4], dbuf[4]; + uint8_t old_tc = ntohl(get_16aligned_be32(&nh->ip6_flow)) >> 20; + ovs_be32 old_fl = get_16aligned_be32(&nh->ip6_flow) & htonl(0xfffff); + + packet_set_ipv6( + packet, + key->ipv6_proto, + mask_ipv6_addr(nh->ip6_src.be32, key->ipv6_src, mask->ipv6_src, sbuf), + mask_ipv6_addr(nh->ip6_dst.be32, key->ipv6_dst, mask->ipv6_dst, dbuf), + key->ipv6_tclass | (old_tc & ~mask->ipv6_tclass), + key->ipv6_label | (old_fl & ~mask->ipv6_label), + key->ipv6_hlimit | (nh->ip6_hlim & ~mask->ipv6_hlimit)); +} + +static void +odp_set_tcp(struct dp_packet *packet, const struct ovs_key_tcp *key, + const struct ovs_key_tcp *mask) +{ + struct tcp_header *th = dp_packet_l4(packet); + + if (OVS_LIKELY(th && dp_packet_get_tcp_payload(packet))) { + packet_set_tcp_port(packet, + key->tcp_src | (th->tcp_src & ~mask->tcp_src), + key->tcp_dst | (th->tcp_dst & ~mask->tcp_dst)); + } +} + +static void +odp_set_udp(struct dp_packet *packet, const struct ovs_key_udp *key, + const struct ovs_key_udp *mask) +{ + struct udp_header *uh = dp_packet_l4(packet); + + if (OVS_LIKELY(uh && dp_packet_get_udp_payload(packet))) { + packet_set_udp_port(packet, + key->udp_src | (uh->udp_src & ~mask->udp_src), + key->udp_dst | (uh->udp_dst & ~mask->udp_dst)); + } +} + +static void +odp_set_sctp(struct dp_packet *packet, const struct ovs_key_sctp *key, + const struct ovs_key_sctp *mask) +{ + struct sctp_header *sh = dp_packet_l4(packet); + + if (OVS_LIKELY(sh && dp_packet_get_sctp_payload(packet))) { + packet_set_sctp_port(packet, + key->sctp_src | (sh->sctp_src & ~mask->sctp_src), + key->sctp_dst | (sh->sctp_dst & ~mask->sctp_dst)); } } @@ -52,27 +156,80 @@ } static void -set_arp(struct ofpbuf *packet, const struct ovs_key_arp *arp_key) +set_arp(struct dp_packet *packet, const struct ovs_key_arp *key, + const struct ovs_key_arp *mask) +{ + struct arp_eth_header *arp = dp_packet_l3(packet); + + if (!mask) { + arp->ar_op = key->arp_op; + memcpy(arp->ar_sha, key->arp_sha, ETH_ADDR_LEN); + put_16aligned_be32(&arp->ar_spa, key->arp_sip); + memcpy(arp->ar_tha, key->arp_tha, ETH_ADDR_LEN); + put_16aligned_be32(&arp->ar_tpa, key->arp_tip); + } else { + ovs_be32 ar_spa = get_16aligned_be32(&arp->ar_spa); + ovs_be32 ar_tpa = get_16aligned_be32(&arp->ar_tpa); + + arp->ar_op = key->arp_op | (arp->ar_op & ~mask->arp_op); + ether_addr_copy_masked(arp->ar_sha, key->arp_sha, mask->arp_sha); + put_16aligned_be32(&arp->ar_spa, + key->arp_sip | (ar_spa & ~mask->arp_sip)); + ether_addr_copy_masked(arp->ar_tha, key->arp_tha, mask->arp_tha); + put_16aligned_be32(&arp->ar_tpa, + key->arp_tip | (ar_tpa & ~mask->arp_tip)); + } +} + +static void +odp_set_nd(struct dp_packet *packet, const struct ovs_key_nd *key, + const struct ovs_key_nd *mask) { - struct arp_eth_header *arp = ofpbuf_l3(packet); + const struct ovs_nd_msg *ns = dp_packet_l4(packet); + const struct ovs_nd_opt *nd_opt = dp_packet_get_nd_payload(packet); + + if (OVS_LIKELY(ns && nd_opt)) { + int bytes_remain = dp_packet_l4_size(packet) - sizeof(*ns); + ovs_be32 tgt_buf[4]; + uint8_t sll_buf[ETH_ADDR_LEN] = {0}; + uint8_t tll_buf[ETH_ADDR_LEN] = {0}; + + while (bytes_remain >= ND_OPT_LEN && nd_opt->nd_opt_len != 0) { + if (nd_opt->nd_opt_type == ND_OPT_SOURCE_LINKADDR + && nd_opt->nd_opt_len == 1) { + memcpy(sll_buf, nd_opt->nd_opt_data, ETH_ADDR_LEN); + ether_addr_copy_masked(sll_buf, key->nd_sll, mask->nd_sll); + + /* A packet can only contain one SLL or TLL option */ + break; + } else if (nd_opt->nd_opt_type == ND_OPT_TARGET_LINKADDR + && nd_opt->nd_opt_len == 1) { + memcpy(tll_buf, nd_opt->nd_opt_data, ETH_ADDR_LEN); + ether_addr_copy_masked(tll_buf, key->nd_tll, mask->nd_tll); + + /* A packet can only contain one SLL or TLL option */ + break; + } - arp->ar_op = arp_key->arp_op; - memcpy(arp->ar_sha, arp_key->arp_sha, ETH_ADDR_LEN); - put_16aligned_be32(&arp->ar_spa, arp_key->arp_sip); - memcpy(arp->ar_tha, arp_key->arp_tha, ETH_ADDR_LEN); - put_16aligned_be32(&arp->ar_tpa, arp_key->arp_tip); + nd_opt += nd_opt->nd_opt_len; + bytes_remain -= nd_opt->nd_opt_len * ND_OPT_LEN; + } + + packet_set_nd(packet, + mask_ipv6_addr(ns->target.be32, + key->nd_target, mask->nd_target, tgt_buf), + sll_buf, + tll_buf); + } } static void -odp_execute_set_action(struct ofpbuf *packet, const struct nlattr *a, - struct pkt_metadata *md) +odp_execute_set_action(struct dp_packet *packet, const struct nlattr *a) { enum ovs_key_attr type = nl_attr_type(a); const struct ovs_key_ipv4 *ipv4_key; const struct ovs_key_ipv6 *ipv6_key; - const struct ovs_key_tcp *tcp_key; - const struct ovs_key_udp *udp_key; - const struct ovs_key_sctp *sctp_key; + struct pkt_metadata *md = &packet->md; switch (type) { case OVS_KEY_ATTR_PRIORITY: @@ -88,44 +245,69 @@ break; case OVS_KEY_ATTR_ETHERNET: - odp_eth_set_addrs(packet, - nl_attr_get_unspec(a, sizeof(struct ovs_key_ethernet))); + odp_eth_set_addrs(packet, nl_attr_get(a), NULL); break; case OVS_KEY_ATTR_IPV4: ipv4_key = nl_attr_get_unspec(a, sizeof(struct ovs_key_ipv4)); - packet_set_ipv4(packet, ipv4_key->ipv4_src, ipv4_key->ipv4_dst, - ipv4_key->ipv4_tos, ipv4_key->ipv4_ttl); + packet_set_ipv4(packet, ipv4_key->ipv4_src, + ipv4_key->ipv4_dst, ipv4_key->ipv4_tos, + ipv4_key->ipv4_ttl); break; case OVS_KEY_ATTR_IPV6: ipv6_key = nl_attr_get_unspec(a, sizeof(struct ovs_key_ipv6)); - packet_set_ipv6(packet, ipv6_key->ipv6_proto, ipv6_key->ipv6_src, - ipv6_key->ipv6_dst, ipv6_key->ipv6_tclass, - ipv6_key->ipv6_label, ipv6_key->ipv6_hlimit); + packet_set_ipv6(packet, ipv6_key->ipv6_proto, + ipv6_key->ipv6_src, ipv6_key->ipv6_dst, + ipv6_key->ipv6_tclass, ipv6_key->ipv6_label, + ipv6_key->ipv6_hlimit); break; case OVS_KEY_ATTR_TCP: - tcp_key = nl_attr_get_unspec(a, sizeof(struct ovs_key_tcp)); - packet_set_tcp_port(packet, tcp_key->tcp_src, tcp_key->tcp_dst); + if (OVS_LIKELY(dp_packet_get_tcp_payload(packet))) { + const struct ovs_key_tcp *tcp_key + = nl_attr_get_unspec(a, sizeof(struct ovs_key_tcp)); + + packet_set_tcp_port(packet, tcp_key->tcp_src, + tcp_key->tcp_dst); + } break; case OVS_KEY_ATTR_UDP: - udp_key = nl_attr_get_unspec(a, sizeof(struct ovs_key_udp)); - packet_set_udp_port(packet, udp_key->udp_src, udp_key->udp_dst); + if (OVS_LIKELY(dp_packet_get_udp_payload(packet))) { + const struct ovs_key_udp *udp_key + = nl_attr_get_unspec(a, sizeof(struct ovs_key_udp)); + + packet_set_udp_port(packet, udp_key->udp_src, + udp_key->udp_dst); + } break; case OVS_KEY_ATTR_SCTP: - sctp_key = nl_attr_get_unspec(a, sizeof(struct ovs_key_sctp)); - packet_set_sctp_port(packet, sctp_key->sctp_src, sctp_key->sctp_dst); + if (OVS_LIKELY(dp_packet_get_sctp_payload(packet))) { + const struct ovs_key_sctp *sctp_key + = nl_attr_get_unspec(a, sizeof(struct ovs_key_sctp)); + + packet_set_sctp_port(packet, sctp_key->sctp_src, + sctp_key->sctp_dst); + } break; case OVS_KEY_ATTR_MPLS: - set_mpls_lse(packet, nl_attr_get_be32(a)); - break; + set_mpls_lse(packet, nl_attr_get_be32(a)); + break; case OVS_KEY_ATTR_ARP: - set_arp(packet, nl_attr_get_unspec(a, sizeof(struct ovs_key_arp))); + set_arp(packet, nl_attr_get(a), NULL); + break; + + case OVS_KEY_ATTR_ND: + if (OVS_LIKELY(dp_packet_get_nd_payload(packet))) { + const struct ovs_key_nd *nd_key + = nl_attr_get_unspec(a, sizeof(struct ovs_key_nd)); + packet_set_nd(packet, nd_key->nd_target, + nd_key->nd_sll, nd_key->nd_tll); + } break; case OVS_KEY_ATTR_DP_HASH: @@ -143,7 +325,6 @@ case OVS_KEY_ATTR_VLAN: case OVS_KEY_ATTR_ICMP: case OVS_KEY_ATTR_ICMPV6: - case OVS_KEY_ATTR_ND: case OVS_KEY_ATTR_TCP_FLAGS: case __OVS_KEY_ATTR_MAX: default: @@ -151,16 +332,105 @@ } } +#define get_mask(a, type) ((const type *)(const void *)(a + 1) + 1) + static void -odp_execute_actions__(void *dp, struct ofpbuf *packet, bool steal, - struct pkt_metadata *, - const struct nlattr *actions, size_t actions_len, - odp_execute_cb dp_execute_action, bool more_actions); +odp_execute_masked_set_action(struct dp_packet *packet, + const struct nlattr *a) +{ + struct pkt_metadata *md = &packet->md; + enum ovs_key_attr type = nl_attr_type(a); + struct mpls_hdr *mh; + + switch (type) { + case OVS_KEY_ATTR_PRIORITY: + md->skb_priority = nl_attr_get_u32(a) + | (md->skb_priority & ~*get_mask(a, uint32_t)); + break; + + case OVS_KEY_ATTR_SKB_MARK: + md->pkt_mark = nl_attr_get_u32(a) + | (md->pkt_mark & ~*get_mask(a, uint32_t)); + break; + + case OVS_KEY_ATTR_ETHERNET: + odp_eth_set_addrs(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_ethernet)); + break; + + case OVS_KEY_ATTR_IPV4: + odp_set_ipv4(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_ipv4)); + break; + + case OVS_KEY_ATTR_IPV6: + odp_set_ipv6(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_ipv6)); + break; + + case OVS_KEY_ATTR_TCP: + odp_set_tcp(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_tcp)); + break; + + case OVS_KEY_ATTR_UDP: + odp_set_udp(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_udp)); + break; + + case OVS_KEY_ATTR_SCTP: + odp_set_sctp(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_sctp)); + break; + + case OVS_KEY_ATTR_MPLS: + mh = dp_packet_l2_5(packet); + if (mh) { + put_16aligned_be32(&mh->mpls_lse, nl_attr_get_be32(a) + | (get_16aligned_be32(&mh->mpls_lse) + & ~*get_mask(a, ovs_be32))); + } + break; + + case OVS_KEY_ATTR_ARP: + set_arp(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_arp)); + break; + + case OVS_KEY_ATTR_ND: + odp_set_nd(packet, nl_attr_get(a), + get_mask(a, struct ovs_key_nd)); + break; + + case OVS_KEY_ATTR_DP_HASH: + md->dp_hash = nl_attr_get_u32(a) + | (md->dp_hash & ~*get_mask(a, uint32_t)); + break; + + case OVS_KEY_ATTR_RECIRC_ID: + md->recirc_id = nl_attr_get_u32(a) + | (md->recirc_id & ~*get_mask(a, uint32_t)); + break; + + case OVS_KEY_ATTR_TUNNEL: /* Masked data not supported for tunnel. */ + case OVS_KEY_ATTR_UNSPEC: + case OVS_KEY_ATTR_ENCAP: + case OVS_KEY_ATTR_ETHERTYPE: + case OVS_KEY_ATTR_IN_PORT: + case OVS_KEY_ATTR_VLAN: + case OVS_KEY_ATTR_ICMP: + case OVS_KEY_ATTR_ICMPV6: + case OVS_KEY_ATTR_TCP_FLAGS: + case __OVS_KEY_ATTR_MAX: + default: + OVS_NOT_REACHED(); + } +} static void -odp_execute_sample(void *dp, struct ofpbuf *packet, bool steal, - struct pkt_metadata *md, const struct nlattr *action, - odp_execute_cb dp_execute_action, bool more_actions) +odp_execute_sample(void *dp, struct dp_packet *packet, bool steal, + const struct nlattr *action, + odp_execute_cb dp_execute_action) { const struct nlattr *subactions = NULL; const struct nlattr *a; @@ -172,6 +442,9 @@ switch ((enum ovs_sample_attr) type) { case OVS_SAMPLE_ATTR_PROBABILITY: if (random_uint32() >= nl_attr_get_u32(a)) { + if (steal) { + dp_packet_delete(packet); + } return; } break; @@ -187,38 +460,73 @@ } } - odp_execute_actions__(dp, packet, steal, md, nl_attr_get(subactions), - nl_attr_get_size(subactions), dp_execute_action, - more_actions); + odp_execute_actions(dp, &packet, 1, steal, nl_attr_get(subactions), + nl_attr_get_size(subactions), dp_execute_action); } -static void -odp_execute_actions__(void *dp, struct ofpbuf *packet, bool steal, - struct pkt_metadata *md, - const struct nlattr *actions, size_t actions_len, - odp_execute_cb dp_execute_action, bool more_actions) +static bool +requires_datapath_assistance(const struct nlattr *a) +{ + enum ovs_action_attr type = nl_attr_type(a); + + switch (type) { + /* These only make sense in the context of a datapath. */ + case OVS_ACTION_ATTR_OUTPUT: + case OVS_ACTION_ATTR_TUNNEL_PUSH: + case OVS_ACTION_ATTR_TUNNEL_POP: + case OVS_ACTION_ATTR_USERSPACE: + case OVS_ACTION_ATTR_RECIRC: + return true; + + case OVS_ACTION_ATTR_SET: + case OVS_ACTION_ATTR_SET_MASKED: + case OVS_ACTION_ATTR_PUSH_VLAN: + case OVS_ACTION_ATTR_POP_VLAN: + case OVS_ACTION_ATTR_SAMPLE: + case OVS_ACTION_ATTR_HASH: + case OVS_ACTION_ATTR_PUSH_MPLS: + case OVS_ACTION_ATTR_POP_MPLS: + return false; + + case OVS_ACTION_ATTR_UNSPEC: + case __OVS_ACTION_ATTR_MAX: + OVS_NOT_REACHED(); + } + + return false; +} + +void +odp_execute_actions(void *dp, struct dp_packet **packets, int cnt, bool steal, + const struct nlattr *actions, size_t actions_len, + odp_execute_cb dp_execute_action) { const struct nlattr *a; unsigned int left; + int i; NL_ATTR_FOR_EACH_UNSAFE (a, left, actions, actions_len) { int type = nl_attr_type(a); + bool last_action = (left <= NLA_ALIGN(a->nla_len)); - switch ((enum ovs_action_attr) type) { - /* These only make sense in the context of a datapath. */ - case OVS_ACTION_ATTR_OUTPUT: - case OVS_ACTION_ATTR_USERSPACE: - case OVS_ACTION_ATTR_RECIRC: + if (requires_datapath_assistance(a)) { if (dp_execute_action) { /* Allow 'dp_execute_action' to steal the packet data if we do * not need it any more. */ - bool may_steal = steal && (!more_actions - && left <= NLA_ALIGN(a->nla_len) - && type != OVS_ACTION_ATTR_RECIRC); - dp_execute_action(dp, packet, md, a, may_steal); + bool may_steal = steal && last_action; + + dp_execute_action(dp, packets, cnt, a, may_steal); + + if (last_action) { + /* We do not need to free the packets. dp_execute_actions() + * has stolen them */ + return; + } } - break; + continue; + } + switch ((enum ovs_action_attr) type) { case OVS_ACTION_ATTR_HASH: { const struct ovs_action_hash *hash_act = nl_attr_get(a); @@ -230,9 +538,12 @@ struct flow flow; uint32_t hash; - flow_extract(packet, md, &flow); - hash = flow_hash_5tuple(&flow, hash_act->hash_basis); - md->dp_hash = hash ? hash : 1; + for (i = 0; i < cnt; i++) { + flow_extract(packets[i], &flow); + hash = flow_hash_5tuple(&flow, hash_act->hash_basis); + + packets[i]->md.dp_hash = hash; + } } else { /* Assert on unknown hash algorithm. */ OVS_NOT_REACHED(); @@ -242,51 +553,73 @@ case OVS_ACTION_ATTR_PUSH_VLAN: { const struct ovs_action_push_vlan *vlan = nl_attr_get(a); - eth_push_vlan(packet, htons(ETH_TYPE_VLAN), vlan->vlan_tci); + + for (i = 0; i < cnt; i++) { + eth_push_vlan(packets[i], vlan->vlan_tpid, vlan->vlan_tci); + } break; } case OVS_ACTION_ATTR_POP_VLAN: - eth_pop_vlan(packet); + for (i = 0; i < cnt; i++) { + eth_pop_vlan(packets[i]); + } break; case OVS_ACTION_ATTR_PUSH_MPLS: { const struct ovs_action_push_mpls *mpls = nl_attr_get(a); - push_mpls(packet, mpls->mpls_ethertype, mpls->mpls_lse); + + for (i = 0; i < cnt; i++) { + push_mpls(packets[i], mpls->mpls_ethertype, mpls->mpls_lse); + } break; } case OVS_ACTION_ATTR_POP_MPLS: - pop_mpls(packet, nl_attr_get_be16(a)); + for (i = 0; i < cnt; i++) { + pop_mpls(packets[i], nl_attr_get_be16(a)); + } break; case OVS_ACTION_ATTR_SET: - odp_execute_set_action(packet, nl_attr_get(a), md); + for (i = 0; i < cnt; i++) { + odp_execute_set_action(packets[i], nl_attr_get(a)); + } + break; + + case OVS_ACTION_ATTR_SET_MASKED: + for (i = 0; i < cnt; i++) { + odp_execute_masked_set_action(packets[i], nl_attr_get(a)); + } break; case OVS_ACTION_ATTR_SAMPLE: - odp_execute_sample(dp, packet, steal, md, a, dp_execute_action, - more_actions || left > NLA_ALIGN(a->nla_len)); + for (i = 0; i < cnt; i++) { + odp_execute_sample(dp, packets[i], steal && last_action, a, + dp_execute_action); + } + + if (last_action) { + /* We do not need to free the packets. odp_execute_sample() has + * stolen them*/ + return; + } break; + case OVS_ACTION_ATTR_OUTPUT: + case OVS_ACTION_ATTR_TUNNEL_PUSH: + case OVS_ACTION_ATTR_TUNNEL_POP: + case OVS_ACTION_ATTR_USERSPACE: + case OVS_ACTION_ATTR_RECIRC: case OVS_ACTION_ATTR_UNSPEC: case __OVS_ACTION_ATTR_MAX: OVS_NOT_REACHED(); } } -} - -void -odp_execute_actions(void *dp, struct ofpbuf *packet, bool steal, - struct pkt_metadata *md, - const struct nlattr *actions, size_t actions_len, - odp_execute_cb dp_execute_action) -{ - odp_execute_actions__(dp, packet, steal, md, actions, actions_len, - dp_execute_action, false); - if (!actions_len && steal) { - /* Drop action. */ - ofpbuf_delete(packet); + if (steal) { + for (i = 0; i < cnt; i++) { + dp_packet_delete(packets[i]); + } } } diff -Nru openvswitch-2.3.1/lib/odp-execute.h openvswitch-2.4.0~git20150623/lib/odp-execute.h --- openvswitch-2.3.1/lib/odp-execute.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/odp-execute.h 2015-06-23 18:46:21.000000000 +0000 @@ -24,19 +24,18 @@ #include "openvswitch/types.h" struct nlattr; -struct ofpbuf; +struct dp_packet; struct pkt_metadata; -typedef void (*odp_execute_cb)(void *dp, struct ofpbuf *packet, - struct pkt_metadata *, +typedef void (*odp_execute_cb)(void *dp, struct dp_packet **packets, int cnt, const struct nlattr *action, bool may_steal); /* Actions that need to be executed in the context of a datapath are handed * to 'dp_execute_action', if non-NULL. Currently this is called only for * actions OVS_ACTION_ATTR_OUTPUT and OVS_ACTION_ATTR_USERSPACE so * 'dp_execute_action' needs to handle only these. */ -void odp_execute_actions(void *dp, struct ofpbuf *packet, bool steal, - struct pkt_metadata *, - const struct nlattr *actions, size_t actions_len, - odp_execute_cb dp_execute_action); +void odp_execute_actions(void *dp, struct dp_packet **packets, int cnt, + bool steal, + const struct nlattr *actions, size_t actions_len, + odp_execute_cb dp_execute_action); #endif diff -Nru openvswitch-2.3.1/lib/odp-util.c openvswitch-2.4.0~git20150623/lib/odp-util.c --- openvswitch-2.3.1/lib/odp-util.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/odp-util.c 2015-06-23 18:46:21.000000000 +0000 @@ -24,6 +24,7 @@ #include #include #include + #include "byte-order.h" #include "coverage.h" #include "dpif.h" @@ -34,8 +35,10 @@ #include "packets.h" #include "simap.h" #include "timeval.h" +#include "unaligned.h" #include "util.h" -#include "vlog.h" +#include "uuid.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(odp_util); @@ -49,6 +52,15 @@ * from another. */ static const char *delimiters = ", \t\r\n"; +struct attr_len_tbl { + int len; + const struct attr_len_tbl *next; + int next_max; +}; +#define ATTR_LEN_INVALID -1 +#define ATTR_LEN_VARIABLE -2 +#define ATTR_LEN_NESTED -3 + static int parse_odp_key_mask_attr(const char *, const struct simap *port_names, struct ofpbuf *, struct ofpbuf *); static void format_odp_key_attr(const struct nlattr *a, @@ -56,15 +68,18 @@ const struct hmap *portno_names, struct ds *ds, bool verbose); +static struct nlattr *generate_all_wildcard_mask(const struct attr_len_tbl tbl[], + int max, struct ofpbuf *, + const struct nlattr *key); /* Returns one the following for the action with the given OVS_ACTION_ATTR_* * 'type': * * - For an action whose argument has a fixed length, returned that * nonnegative length in bytes. * - * - For an action with a variable-length argument, returns -2. + * - For an action with a variable-length argument, returns ATTR_LEN_VARIABLE. * - * - For an invalid 'type', returns -1. */ + * - For an invalid 'type', returns ATTR_LEN_INVALID. */ static int odp_action_len(uint16_t type) { @@ -74,22 +89,25 @@ switch ((enum ovs_action_attr) type) { case OVS_ACTION_ATTR_OUTPUT: return sizeof(uint32_t); - case OVS_ACTION_ATTR_USERSPACE: return -2; + case OVS_ACTION_ATTR_TUNNEL_PUSH: return ATTR_LEN_VARIABLE; + case OVS_ACTION_ATTR_TUNNEL_POP: return sizeof(uint32_t); + case OVS_ACTION_ATTR_USERSPACE: return ATTR_LEN_VARIABLE; case OVS_ACTION_ATTR_PUSH_VLAN: return sizeof(struct ovs_action_push_vlan); case OVS_ACTION_ATTR_POP_VLAN: return 0; case OVS_ACTION_ATTR_PUSH_MPLS: return sizeof(struct ovs_action_push_mpls); case OVS_ACTION_ATTR_POP_MPLS: return sizeof(ovs_be16); case OVS_ACTION_ATTR_RECIRC: return sizeof(uint32_t); case OVS_ACTION_ATTR_HASH: return sizeof(struct ovs_action_hash); - case OVS_ACTION_ATTR_SET: return -2; - case OVS_ACTION_ATTR_SAMPLE: return -2; + case OVS_ACTION_ATTR_SET: return ATTR_LEN_VARIABLE; + case OVS_ACTION_ATTR_SET_MASKED: return ATTR_LEN_VARIABLE; + case OVS_ACTION_ATTR_SAMPLE: return ATTR_LEN_VARIABLE; case OVS_ACTION_ATTR_UNSPEC: case __OVS_ACTION_ATTR_MAX: - return -1; + return ATTR_LEN_INVALID; } - return -1; + return ATTR_LEN_INVALID; } /* Returns a string form of 'attr'. The return value is either a statically @@ -206,22 +224,94 @@ static int parse_flags(const char *s, const char *(*bit_to_string)(uint32_t), - uint32_t *res) + uint32_t *res_flags, uint32_t allowed, uint32_t *res_mask) { uint32_t result = 0; - int n = 0; + int n; - if (s[n] != '(') { - return -EINVAL; + /* Parse masked flags in numeric format? */ + if (res_mask && ovs_scan(s, "%"SCNi32"/%"SCNi32"%n", + res_flags, res_mask, &n) && n > 0) { + if (*res_flags & ~allowed || *res_mask & ~allowed) { + return -EINVAL; + } + return n; + } + + n = 0; + + if (res_mask && (*s == '+' || *s == '-')) { + uint32_t flags = 0, mask = 0; + + /* Parse masked flags. */ + while (s[0] != ')') { + bool set; + uint32_t bit; + int name_len; + + if (s[0] == '+') { + set = true; + } else if (s[0] == '-') { + set = false; + } else { + return -EINVAL; + } + s++; + n++; + + name_len = strcspn(s, "+-)"); + + for (bit = 1; bit; bit <<= 1) { + const char *fname = bit_to_string(bit); + size_t len; + + if (!fname) { + continue; + } + + len = strlen(fname); + if (len != name_len) { + continue; + } + if (!strncmp(s, fname, len)) { + if (mask & bit) { + /* bit already set. */ + return -EINVAL; + } + if (!(bit & allowed)) { + return -EINVAL; + } + if (set) { + flags |= bit; + } + mask |= bit; + break; + } + } + + if (!bit) { + return -EINVAL; /* Unknown flag name */ + } + s += name_len; + n += name_len; + } + + *res_flags = flags; + *res_mask = mask; + return n; } - n++; + /* Parse unmasked flags. If a flag is present, it is set, otherwise + * it is not set. */ while (s[n] != ')') { unsigned long long int flags; uint32_t bit; int n0; if (ovs_scan(&s[n], "%lli%n", &flags, &n0)) { + if (flags & ~allowed) { + return -EINVAL; + } n += n0 + (s[n + n0] == ','); result |= flags; continue; @@ -238,6 +328,9 @@ len = strlen(name); if (!strncmp(s + n, name, len) && (s[n + len] == ',' || s[n + len] == ')')) { + if (!(bit & allowed)) { + return -EINVAL; + } result |= bit; n += len + (s[n + len] == ','); break; @@ -248,9 +341,11 @@ return -EINVAL; } } - n++; - *res = result; + *res_flags = result; + if (res_mask) { + *res_mask = UINT32_MAX; + } return n; } @@ -261,9 +356,12 @@ [OVS_USERSPACE_ATTR_PID] = { .type = NL_A_U32 }, [OVS_USERSPACE_ATTR_USERDATA] = { .type = NL_A_UNSPEC, .optional = true }, + [OVS_USERSPACE_ATTR_EGRESS_TUN_PORT] = { .type = NL_A_U32, + .optional = true }, }; struct nlattr *a[ARRAY_SIZE(ovs_userspace_policy)]; const struct nlattr *userdata_attr; + const struct nlattr *tunnel_out_port_attr; if (!nl_parse_nested(attr, ovs_userspace_policy, a, ARRAY_SIZE(a))) { ds_put_cstr(ds, "userspace(error)"); @@ -314,7 +412,8 @@ cookie.flow_sample.obs_point_id); } else if (userdata_len >= sizeof cookie.ipfix && cookie.type == USER_ACTION_COOKIE_IPFIX) { - ds_put_format(ds, ",ipfix"); + ds_put_format(ds, ",ipfix(output_port=%"PRIu32")", + cookie.ipfix.output_odp_port); } else { userdata_unspec = true; } @@ -330,18 +429,37 @@ } } + tunnel_out_port_attr = a[OVS_USERSPACE_ATTR_EGRESS_TUN_PORT]; + if (tunnel_out_port_attr) { + ds_put_format(ds, ",tunnel_out_port=%"PRIu32, + nl_attr_get_u32(tunnel_out_port_attr)); + } + ds_put_char(ds, ')'); } static void -format_vlan_tci(struct ds *ds, ovs_be16 vlan_tci) +format_vlan_tci(struct ds *ds, ovs_be16 tci, ovs_be16 mask, bool verbose) { - ds_put_format(ds, "vid=%"PRIu16",pcp=%d", - vlan_tci_to_vid(vlan_tci), - vlan_tci_to_pcp(vlan_tci)); - if (!(vlan_tci & htons(VLAN_CFI))) { - ds_put_cstr(ds, ",cfi=0"); + if (verbose || vlan_tci_to_vid(tci) || vlan_tci_to_vid(mask)) { + ds_put_format(ds, "vid=%"PRIu16, vlan_tci_to_vid(tci)); + if (vlan_tci_to_vid(mask) != VLAN_VID_MASK) { /* Partially masked. */ + ds_put_format(ds, "/0x%"PRIx16, vlan_tci_to_vid(mask)); + }; + ds_put_char(ds, ','); + } + if (verbose || vlan_tci_to_pcp(tci) || vlan_tci_to_pcp(mask)) { + ds_put_format(ds, "pcp=%d", vlan_tci_to_pcp(tci)); + if (vlan_tci_to_pcp(mask) != (VLAN_PCP_MASK >> VLAN_PCP_SHIFT)) { + ds_put_format(ds, "/0x%x", vlan_tci_to_pcp(mask)); + } + ds_put_char(ds, ','); + } + if (!(tci & htons(VLAN_CFI))) { + ds_put_cstr(ds, "cfi=0"); + ds_put_char(ds, ','); } + ds_chomp(ds, ','); } static void @@ -390,7 +508,7 @@ static void format_odp_recirc_action(struct ds *ds, uint32_t recirc_id) { - ds_put_format(ds, "recirc(%"PRIu32")", recirc_id); + ds_put_format(ds, "recirc(%#"PRIx32")", recirc_id); } static void @@ -407,15 +525,115 @@ ds_put_format(ds, ")"); } +static const void * +format_udp_tnl_push_header(struct ds *ds, const struct ip_header *ip) +{ + const struct udp_header *udp; + + udp = (const struct udp_header *) (ip + 1); + ds_put_format(ds, "udp(src=%"PRIu16",dst=%"PRIu16",csum=0x%"PRIx16"),", + ntohs(udp->udp_src), ntohs(udp->udp_dst), + ntohs(udp->udp_csum)); + + return udp + 1; +} + +static void +format_odp_tnl_push_header(struct ds *ds, struct ovs_action_push_tnl *data) +{ + const struct eth_header *eth; + const struct ip_header *ip; + const void *l3; + + eth = (const struct eth_header *)data->header; + + l3 = eth + 1; + ip = (const struct ip_header *)l3; + + /* Ethernet */ + ds_put_format(ds, "header(size=%"PRIu8",type=%"PRIu8",eth(dst=", + data->header_len, data->tnl_type); + ds_put_format(ds, ETH_ADDR_FMT, ETH_ADDR_ARGS(eth->eth_dst)); + ds_put_format(ds, ",src="); + ds_put_format(ds, ETH_ADDR_FMT, ETH_ADDR_ARGS(eth->eth_src)); + ds_put_format(ds, ",dl_type=0x%04"PRIx16"),", ntohs(eth->eth_type)); + + /* IPv4 */ + ds_put_format(ds, "ipv4(src="IP_FMT",dst="IP_FMT",proto=%"PRIu8 + ",tos=%#"PRIx8",ttl=%"PRIu8",frag=0x%"PRIx16"),", + IP_ARGS(get_16aligned_be32(&ip->ip_src)), + IP_ARGS(get_16aligned_be32(&ip->ip_dst)), + ip->ip_proto, ip->ip_tos, + ip->ip_ttl, + ip->ip_frag_off); + + if (data->tnl_type == OVS_VPORT_TYPE_VXLAN) { + const struct vxlanhdr *vxh; + + vxh = format_udp_tnl_push_header(ds, ip); + + ds_put_format(ds, "vxlan(flags=0x%"PRIx32",vni=0x%"PRIx32")", + ntohl(get_16aligned_be32(&vxh->vx_flags)), + ntohl(get_16aligned_be32(&vxh->vx_vni)) >> 8); + } else if (data->tnl_type == OVS_VPORT_TYPE_GENEVE) { + const struct genevehdr *gnh; + + gnh = format_udp_tnl_push_header(ds, ip); + + ds_put_format(ds, "geneve(%svni=0x%"PRIx32")", + gnh->oam ? "oam," : "", + ntohl(get_16aligned_be32(&gnh->vni)) >> 8); + } else if (data->tnl_type == OVS_VPORT_TYPE_GRE) { + const struct gre_base_hdr *greh; + ovs_16aligned_be32 *options; + void *l4; + + l4 = ((uint8_t *)l3 + sizeof(struct ip_header)); + greh = (const struct gre_base_hdr *) l4; + + ds_put_format(ds, "gre((flags=0x%"PRIx16",proto=0x%"PRIx16")", + ntohs(greh->flags), ntohs(greh->protocol)); + options = (ovs_16aligned_be32 *)(greh + 1); + if (greh->flags & htons(GRE_CSUM)) { + ds_put_format(ds, ",csum=0x%"PRIx16, ntohs(*((ovs_be16 *)options))); + options++; + } + if (greh->flags & htons(GRE_KEY)) { + ds_put_format(ds, ",key=0x%"PRIx32, ntohl(get_16aligned_be32(options))); + options++; + } + if (greh->flags & htons(GRE_SEQ)) { + ds_put_format(ds, ",seq=0x%"PRIx32, ntohl(get_16aligned_be32(options))); + options++; + } + ds_put_format(ds, ")"); + } + ds_put_format(ds, ")"); +} + +static void +format_odp_tnl_push_action(struct ds *ds, const struct nlattr *attr) +{ + struct ovs_action_push_tnl *data; + + data = (struct ovs_action_push_tnl *) nl_attr_get(attr); + + ds_put_format(ds, "tnl_push(tnl_port(%"PRIu32"),", data->tnl_port); + format_odp_tnl_push_header(ds, data); + ds_put_format(ds, ",out_port(%"PRIu32"))", data->out_port); +} + static void format_odp_action(struct ds *ds, const struct nlattr *a) { int expected_len; enum ovs_action_attr type = nl_attr_type(a); const struct ovs_action_push_vlan *vlan; + size_t size; expected_len = odp_action_len(nl_attr_type(a)); - if (expected_len != -2 && nl_attr_get_size(a) != expected_len) { + if (expected_len != ATTR_LEN_VARIABLE && + nl_attr_get_size(a) != expected_len) { ds_put_format(ds, "bad length %"PRIuSIZE", expected %d for: ", nl_attr_get_size(a), expected_len); format_generic_odp_action(ds, a); @@ -426,6 +644,12 @@ case OVS_ACTION_ATTR_OUTPUT: ds_put_format(ds, "%"PRIu32, nl_attr_get_u32(a)); break; + case OVS_ACTION_ATTR_TUNNEL_POP: + ds_put_format(ds, "tnl_pop(%"PRIu32")", nl_attr_get_u32(a)); + break; + case OVS_ACTION_ATTR_TUNNEL_PUSH: + format_odp_tnl_push_action(ds, a); + break; case OVS_ACTION_ATTR_USERSPACE: format_odp_userspace_action(ds, a); break; @@ -435,6 +659,28 @@ case OVS_ACTION_ATTR_HASH: format_odp_hash_action(ds, nl_attr_get(a)); break; + case OVS_ACTION_ATTR_SET_MASKED: + a = nl_attr_get(a); + size = nl_attr_get_size(a) / 2; + ds_put_cstr(ds, "set("); + + /* Masked set action not supported for tunnel key, which is bigger. */ + if (size <= sizeof(struct ovs_key_ipv6)) { + struct nlattr attr[1 + DIV_ROUND_UP(sizeof(struct ovs_key_ipv6), + sizeof(struct nlattr))]; + struct nlattr mask[1 + DIV_ROUND_UP(sizeof(struct ovs_key_ipv6), + sizeof(struct nlattr))]; + + mask->nla_type = attr->nla_type = nl_attr_type(a); + mask->nla_len = attr->nla_len = NLA_HDRLEN + size; + memcpy(attr + 1, (char *)(a + 1), size); + memcpy(mask + 1, (char *)(a + 1) + size, size); + format_odp_key_attr(attr, mask, NULL, ds, false); + } else { + format_odp_key_attr(a, NULL, NULL, ds, false); + } + ds_put_cstr(ds, ")"); + break; case OVS_ACTION_ATTR_SET: ds_put_cstr(ds, "set("); format_odp_key_attr(nl_attr_get(a), NULL, NULL, ds, true); @@ -446,7 +692,7 @@ if (vlan->vlan_tpid != htons(ETH_TYPE_VLAN)) { ds_put_format(ds, "tpid=0x%04"PRIx16",", ntohs(vlan->vlan_tpid)); } - format_vlan_tci(ds, vlan->vlan_tci); + format_vlan_tci(ds, vlan->vlan_tci, OVS_BE16_MAX, false); ds_put_char(ds, ')'); break; case OVS_ACTION_ATTR_POP_VLAN: @@ -506,50 +752,36 @@ } } +/* Separate out parse_odp_userspace_action() function. */ static int -parse_odp_action(const char *s, const struct simap *port_names, - struct ofpbuf *actions) +parse_odp_userspace_action(const char *s, struct ofpbuf *actions) { - { - uint32_t port; - int n; - - if (ovs_scan(s, "%"SCNi32"%n", &port, &n)) { - nl_msg_put_u32(actions, OVS_ACTION_ATTR_OUTPUT, port); - return n; - } - } - - if (port_names) { - int len = strcspn(s, delimiters); - struct simap_node *node; + uint32_t pid; + union user_action_cookie cookie; + struct ofpbuf buf; + odp_port_t tunnel_out_port; + int n = -1; + void *user_data = NULL; + size_t user_data_size = 0; - node = simap_find_len(port_names, s, len); - if (node) { - nl_msg_put_u32(actions, OVS_ACTION_ATTR_OUTPUT, node->data); - return len; - } + if (!ovs_scan(s, "userspace(pid=%"SCNi32"%n", &pid, &n)) { + return -EINVAL; } { - uint32_t pid; uint32_t output; uint32_t probability; uint32_t collector_set_id; uint32_t obs_domain_id; uint32_t obs_point_id; int vid, pcp; - int n = -1; - - if (ovs_scan(s, "userspace(pid=%"SCNi32")%n", &pid, &n)) { - odp_put_userspace_action(pid, NULL, 0, actions); - return n; - } else if (ovs_scan(s, "userspace(pid=%"SCNi32",sFlow(vid=%i," - "pcp=%i,output=%"SCNi32"))%n", - &pid, &vid, &pcp, &output, &n)) { - union user_action_cookie cookie; + int n1 = -1; + if (ovs_scan(&s[n], ",sFlow(vid=%i," + "pcp=%i,output=%"SCNi32")%n", + &vid, &pcp, &output, &n1)) { uint16_t tci; + n += n1; tci = vid | (pcp << VLAN_PCP_SHIFT); if (tci) { tci |= VLAN_CFI; @@ -558,83 +790,305 @@ cookie.type = USER_ACTION_COOKIE_SFLOW; cookie.sflow.vlan_tci = htons(tci); cookie.sflow.output = output; - odp_put_userspace_action(pid, &cookie, sizeof cookie.sflow, - actions); - return n; - } else if (ovs_scan(s, "userspace(pid=%"SCNi32",slow_path%n", - &pid, &n)) { - union user_action_cookie cookie; + user_data = &cookie; + user_data_size = sizeof cookie.sflow; + } else if (ovs_scan(&s[n], ",slow_path(%n", + &n1)) { int res; + n += n1; cookie.type = USER_ACTION_COOKIE_SLOW_PATH; cookie.slow_path.unused = 0; cookie.slow_path.reason = 0; res = parse_flags(&s[n], slow_path_reason_to_string, - &cookie.slow_path.reason); - if (res < 0) { + &cookie.slow_path.reason, + SLOW_PATH_REASON_MASK, NULL); + if (res < 0 || s[n + res] != ')') { return res; } - n += res; - if (s[n] != ')') { - return -EINVAL; - } - n++; + n += res + 1; - odp_put_userspace_action(pid, &cookie, sizeof cookie.slow_path, - actions); - return n; - } else if (ovs_scan(s, "userspace(pid=%"SCNi32"," - "flow_sample(probability=%"SCNi32"," + user_data = &cookie; + user_data_size = sizeof cookie.slow_path; + } else if (ovs_scan(&s[n], ",flow_sample(probability=%"SCNi32"," "collector_set_id=%"SCNi32"," "obs_domain_id=%"SCNi32"," - "obs_point_id=%"SCNi32"))%n", - &pid, &probability, &collector_set_id, - &obs_domain_id, &obs_point_id, &n)) { - union user_action_cookie cookie; + "obs_point_id=%"SCNi32")%n", + &probability, &collector_set_id, + &obs_domain_id, &obs_point_id, &n1)) { + n += n1; cookie.type = USER_ACTION_COOKIE_FLOW_SAMPLE; cookie.flow_sample.probability = probability; cookie.flow_sample.collector_set_id = collector_set_id; cookie.flow_sample.obs_domain_id = obs_domain_id; cookie.flow_sample.obs_point_id = obs_point_id; - odp_put_userspace_action(pid, &cookie, sizeof cookie.flow_sample, - actions); - return n; - } else if (ovs_scan(s, "userspace(pid=%"SCNi32",ipfix)%n", &pid, &n)) { - union user_action_cookie cookie; - + user_data = &cookie; + user_data_size = sizeof cookie.flow_sample; + } else if (ovs_scan(&s[n], ",ipfix(output_port=%"SCNi32")%n", + &output, &n1) ) { + n += n1; cookie.type = USER_ACTION_COOKIE_IPFIX; - odp_put_userspace_action(pid, &cookie, sizeof cookie.ipfix, - actions); - return n; - } else if (ovs_scan(s, "userspace(pid=%"SCNi32",userdata(%n", - &pid, &n)) { - struct ofpbuf buf; + cookie.ipfix.output_odp_port = u32_to_odp(output); + user_data = &cookie; + user_data_size = sizeof cookie.ipfix; + } else if (ovs_scan(&s[n], ",userdata(%n", + &n1)) { char *end; + n += n1; ofpbuf_init(&buf, 16); end = ofpbuf_put_hex(&buf, &s[n], NULL); - if (end[0] == ')' && end[1] == ')') { - odp_put_userspace_action(pid, ofpbuf_data(&buf), ofpbuf_size(&buf), actions); - ofpbuf_uninit(&buf); - return (end + 2) - s; + if (end[0] != ')') { + return -EINVAL; + } + user_data = buf.data; + user_data_size = buf.size; + n = (end + 1) - s; + } + } + + { + int n1 = -1; + if (ovs_scan(&s[n], ",tunnel_out_port=%"SCNi32")%n", + &tunnel_out_port, &n1)) { + odp_put_userspace_action(pid, user_data, user_data_size, tunnel_out_port, actions); + return n + n1; + } else if (s[n] == ')') { + odp_put_userspace_action(pid, user_data, user_data_size, ODPP_NONE, actions); + return n + 1; + } + } + + return -EINVAL; +} + +static int +ovs_parse_tnl_push(const char *s, struct ovs_action_push_tnl *data) +{ + struct eth_header *eth; + struct ip_header *ip; + struct udp_header *udp; + struct gre_base_hdr *greh; + uint16_t gre_proto, gre_flags, dl_type, udp_src, udp_dst, csum; + ovs_be32 sip, dip; + uint32_t tnl_type = 0, header_len = 0; + void *l3, *l4; + int n = 0; + + if (!ovs_scan_len(s, &n, "tnl_push(tnl_port(%"SCNi32"),", &data->tnl_port)) { + return -EINVAL; + } + eth = (struct eth_header *) data->header; + l3 = (data->header + sizeof *eth); + l4 = ((uint8_t *) l3 + sizeof (struct ip_header)); + ip = (struct ip_header *) l3; + if (!ovs_scan_len(s, &n, "header(size=%"SCNi32",type=%"SCNi32"," + "eth(dst="ETH_ADDR_SCAN_FMT",", + &data->header_len, + &data->tnl_type, + ETH_ADDR_SCAN_ARGS(eth->eth_dst))) { + return -EINVAL; + } + + if (!ovs_scan_len(s, &n, "src="ETH_ADDR_SCAN_FMT",", + ETH_ADDR_SCAN_ARGS(eth->eth_src))) { + return -EINVAL; + } + if (!ovs_scan_len(s, &n, "dl_type=0x%"SCNx16"),", &dl_type)) { + return -EINVAL; + } + eth->eth_type = htons(dl_type); + + /* IPv4 */ + if (!ovs_scan_len(s, &n, "ipv4(src="IP_SCAN_FMT",dst="IP_SCAN_FMT",proto=%"SCNi8 + ",tos=%"SCNi8",ttl=%"SCNi8",frag=0x%"SCNx16"),", + IP_SCAN_ARGS(&sip), + IP_SCAN_ARGS(&dip), + &ip->ip_proto, &ip->ip_tos, + &ip->ip_ttl, &ip->ip_frag_off)) { + return -EINVAL; + } + put_16aligned_be32(&ip->ip_src, sip); + put_16aligned_be32(&ip->ip_dst, dip); + + /* Tunnel header */ + udp = (struct udp_header *) l4; + greh = (struct gre_base_hdr *) l4; + if (ovs_scan_len(s, &n, "udp(src=%"SCNi16",dst=%"SCNi16",csum=0x%"SCNx16"),", + &udp_src, &udp_dst, &csum)) { + uint32_t vx_flags, vni; + + udp->udp_src = htons(udp_src); + udp->udp_dst = htons(udp_dst); + udp->udp_len = 0; + udp->udp_csum = htons(csum); + + if (ovs_scan_len(s, &n, "vxlan(flags=0x%"SCNx32",vni=0x%"SCNx32"))", + &vx_flags, &vni)) { + struct vxlanhdr *vxh = (struct vxlanhdr *) (udp + 1); + + put_16aligned_be32(&vxh->vx_flags, htonl(vx_flags)); + put_16aligned_be32(&vxh->vx_vni, htonl(vni << 8)); + tnl_type = OVS_VPORT_TYPE_VXLAN; + header_len = sizeof *eth + sizeof *ip + + sizeof *udp + sizeof *vxh; + } else if (ovs_scan_len(s, &n, "geneve(")) { + struct genevehdr *gnh = (struct genevehdr *) (udp + 1); + + memset(gnh, 0, sizeof *gnh); + if (ovs_scan_len(s, &n, "oam,")) { + gnh->oam = 1; + } + if (!ovs_scan_len(s, &n, "vni=0x%"SCNx32"))", &vni)) { + return -EINVAL; } + gnh->proto_type = htons(ETH_TYPE_TEB); + put_16aligned_be32(&gnh->vni, htonl(vni << 8)); + tnl_type = OVS_VPORT_TYPE_GENEVE; + header_len = sizeof *eth + sizeof *ip + + sizeof *udp + sizeof *gnh; + } else { + return -EINVAL; + } + } else if (ovs_scan_len(s, &n, "gre((flags=0x%"SCNx16",proto=0x%"SCNx16")", + &gre_flags, &gre_proto)){ + + tnl_type = OVS_VPORT_TYPE_GRE; + greh->flags = htons(gre_flags); + greh->protocol = htons(gre_proto); + ovs_16aligned_be32 *options = (ovs_16aligned_be32 *) (greh + 1); + + if (greh->flags & htons(GRE_CSUM)) { + if (!ovs_scan_len(s, &n, ",csum=0x%"SCNx16, &csum)) { + return -EINVAL; + } + + memset(options, 0, sizeof *options); + *((ovs_be16 *)options) = htons(csum); + options++; + } + if (greh->flags & htons(GRE_KEY)) { + uint32_t key; + + if (!ovs_scan_len(s, &n, ",key=0x%"SCNx32, &key)) { + return -EINVAL; + } + + put_16aligned_be32(options, htonl(key)); + options++; + } + if (greh->flags & htons(GRE_SEQ)) { + uint32_t seq; + + if (!ovs_scan_len(s, &n, ",seq=0x%"SCNx32, &seq)) { + return -EINVAL; + } + put_16aligned_be32(options, htonl(seq)); + options++; + } + + if (!ovs_scan_len(s, &n, "))")) { + return -EINVAL; + } + + header_len = sizeof *eth + sizeof *ip + + ((uint8_t *) options - (uint8_t *) greh); + } else { + return -EINVAL; + } + + /* check tunnel meta data. */ + if (data->tnl_type != tnl_type) { + return -EINVAL; + } + if (data->header_len != header_len) { + return -EINVAL; + } + + /* Out port */ + if (!ovs_scan_len(s, &n, ",out_port(%"SCNi32"))", &data->out_port)) { + return -EINVAL; + } + + return n; +} + +static int +parse_odp_action(const char *s, const struct simap *port_names, + struct ofpbuf *actions) +{ + { + uint32_t port; + int n; + + if (ovs_scan(s, "%"SCNi32"%n", &port, &n)) { + nl_msg_put_u32(actions, OVS_ACTION_ATTR_OUTPUT, port); + return n; + } + } + + if (port_names) { + int len = strcspn(s, delimiters); + struct simap_node *node; + + node = simap_find_len(port_names, s, len); + if (node) { + nl_msg_put_u32(actions, OVS_ACTION_ATTR_OUTPUT, node->data); + return len; + } + } + + { + uint32_t recirc_id; + int n = -1; + + if (ovs_scan(s, "recirc(%"PRIu32")%n", &recirc_id, &n)) { + nl_msg_put_u32(actions, OVS_ACTION_ATTR_RECIRC, recirc_id); + return n; } } + if (!strncmp(s, "userspace(", 10)) { + return parse_odp_userspace_action(s, actions); + } + if (!strncmp(s, "set(", 4)) { size_t start_ofs; int retval; + struct nlattr mask[128 / sizeof(struct nlattr)]; + struct ofpbuf maskbuf; + struct nlattr *nested, *key; + size_t size; + + /* 'mask' is big enough to hold any key. */ + ofpbuf_use_stack(&maskbuf, mask, sizeof mask); start_ofs = nl_msg_start_nested(actions, OVS_ACTION_ATTR_SET); - retval = parse_odp_key_mask_attr(s + 4, port_names, actions, NULL); + retval = parse_odp_key_mask_attr(s + 4, port_names, actions, &maskbuf); if (retval < 0) { return retval; } if (s[retval + 4] != ')') { return -EINVAL; } + + nested = ofpbuf_at_assert(actions, start_ofs, sizeof *nested); + key = nested + 1; + + size = nl_attr_get_size(mask); + if (size == nl_attr_get_size(key)) { + /* Change to masked set action if not fully masked. */ + if (!is_all_ones(mask + 1, size)) { + key->nla_len += size; + ofpbuf_put(actions, mask + 1, size); + /* 'actions' may have been reallocated by ofpbuf_put(). */ + nested = ofpbuf_at_assert(actions, start_ofs, sizeof *nested); + nested->nla_type = OVS_ACTION_ATTR_SET_MASKED; + } + } + nl_msg_end_nested(actions, start_ofs); return retval + 5; } @@ -708,6 +1162,28 @@ } } + { + uint32_t port; + int n; + + if (ovs_scan(s, "tnl_pop(%"SCNi32")%n", &port, &n)) { + nl_msg_put_u32(actions, OVS_ACTION_ATTR_TUNNEL_POP, port); + return n; + } + } + + { + struct ovs_action_push_tnl data; + int n; + + n = ovs_parse_tnl_push(s, &data); + if (n > 0) { + odp_put_tnl_push_action(actions, &data); + return n; + } else if (n < 0) { + return n; + } + } return -EINVAL; } @@ -726,7 +1202,7 @@ return 0; } - old_size = ofpbuf_size(actions); + old_size = actions->size; for (;;) { int retval; @@ -737,7 +1213,7 @@ retval = parse_odp_action(s, port_names, actions); if (retval < 0 || !strchr(delimiters, s[retval])) { - ofpbuf_set_size(actions, old_size); + actions->size = old_size; return -retval; } s += retval; @@ -746,45 +1222,65 @@ return 0; } +static const struct attr_len_tbl ovs_vxlan_ext_attr_lens[OVS_VXLAN_EXT_MAX + 1] = { + [OVS_VXLAN_EXT_GBP] = { .len = 4 }, +}; + +static const struct attr_len_tbl ovs_tun_key_attr_lens[OVS_TUNNEL_KEY_ATTR_MAX + 1] = { + [OVS_TUNNEL_KEY_ATTR_ID] = { .len = 8 }, + [OVS_TUNNEL_KEY_ATTR_IPV4_SRC] = { .len = 4 }, + [OVS_TUNNEL_KEY_ATTR_IPV4_DST] = { .len = 4 }, + [OVS_TUNNEL_KEY_ATTR_TOS] = { .len = 1 }, + [OVS_TUNNEL_KEY_ATTR_TTL] = { .len = 1 }, + [OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT] = { .len = 0 }, + [OVS_TUNNEL_KEY_ATTR_CSUM] = { .len = 0 }, + [OVS_TUNNEL_KEY_ATTR_TP_SRC] = { .len = 2 }, + [OVS_TUNNEL_KEY_ATTR_TP_DST] = { .len = 2 }, + [OVS_TUNNEL_KEY_ATTR_OAM] = { .len = 0 }, + [OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS] = { .len = ATTR_LEN_VARIABLE }, + [OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS] = { .len = ATTR_LEN_NESTED, + .next = ovs_vxlan_ext_attr_lens , + .next_max = OVS_VXLAN_EXT_MAX}, +}; + +static const struct attr_len_tbl ovs_flow_key_attr_lens[OVS_KEY_ATTR_MAX + 1] = { + [OVS_KEY_ATTR_ENCAP] = { .len = ATTR_LEN_NESTED }, + [OVS_KEY_ATTR_PRIORITY] = { .len = 4 }, + [OVS_KEY_ATTR_SKB_MARK] = { .len = 4 }, + [OVS_KEY_ATTR_DP_HASH] = { .len = 4 }, + [OVS_KEY_ATTR_RECIRC_ID] = { .len = 4 }, + [OVS_KEY_ATTR_TUNNEL] = { .len = ATTR_LEN_NESTED, + .next = ovs_tun_key_attr_lens, + .next_max = OVS_TUNNEL_KEY_ATTR_MAX }, + [OVS_KEY_ATTR_IN_PORT] = { .len = 4 }, + [OVS_KEY_ATTR_ETHERNET] = { .len = sizeof(struct ovs_key_ethernet) }, + [OVS_KEY_ATTR_VLAN] = { .len = 2 }, + [OVS_KEY_ATTR_ETHERTYPE] = { .len = 2 }, + [OVS_KEY_ATTR_MPLS] = { .len = ATTR_LEN_VARIABLE }, + [OVS_KEY_ATTR_IPV4] = { .len = sizeof(struct ovs_key_ipv4) }, + [OVS_KEY_ATTR_IPV6] = { .len = sizeof(struct ovs_key_ipv6) }, + [OVS_KEY_ATTR_TCP] = { .len = sizeof(struct ovs_key_tcp) }, + [OVS_KEY_ATTR_TCP_FLAGS] = { .len = 2 }, + [OVS_KEY_ATTR_UDP] = { .len = sizeof(struct ovs_key_udp) }, + [OVS_KEY_ATTR_SCTP] = { .len = sizeof(struct ovs_key_sctp) }, + [OVS_KEY_ATTR_ICMP] = { .len = sizeof(struct ovs_key_icmp) }, + [OVS_KEY_ATTR_ICMPV6] = { .len = sizeof(struct ovs_key_icmpv6) }, + [OVS_KEY_ATTR_ARP] = { .len = sizeof(struct ovs_key_arp) }, + [OVS_KEY_ATTR_ND] = { .len = sizeof(struct ovs_key_nd) }, +}; + /* Returns the correct length of the payload for a flow key attribute of the - * specified 'type', -1 if 'type' is unknown, or -2 if the attribute's payload - * is variable length. */ + * specified 'type', ATTR_LEN_INVALID if 'type' is unknown, ATTR_LEN_VARIABLE + * if the attribute's payload is variable length, or ATTR_LEN_NESTED if the + * payload is a nested type. */ static int -odp_flow_key_attr_len(uint16_t type) +odp_key_attr_len(const struct attr_len_tbl tbl[], int max_len, uint16_t type) { - if (type > OVS_KEY_ATTR_MAX) { - return -1; - } - - switch ((enum ovs_key_attr) type) { - case OVS_KEY_ATTR_ENCAP: return -2; - case OVS_KEY_ATTR_PRIORITY: return 4; - case OVS_KEY_ATTR_SKB_MARK: return 4; - case OVS_KEY_ATTR_DP_HASH: return 4; - case OVS_KEY_ATTR_RECIRC_ID: return 4; - case OVS_KEY_ATTR_TUNNEL: return -2; - case OVS_KEY_ATTR_IN_PORT: return 4; - case OVS_KEY_ATTR_ETHERNET: return sizeof(struct ovs_key_ethernet); - case OVS_KEY_ATTR_VLAN: return sizeof(ovs_be16); - case OVS_KEY_ATTR_ETHERTYPE: return 2; - case OVS_KEY_ATTR_MPLS: return -2; - case OVS_KEY_ATTR_IPV4: return sizeof(struct ovs_key_ipv4); - case OVS_KEY_ATTR_IPV6: return sizeof(struct ovs_key_ipv6); - case OVS_KEY_ATTR_TCP: return sizeof(struct ovs_key_tcp); - case OVS_KEY_ATTR_TCP_FLAGS: return 2; - case OVS_KEY_ATTR_UDP: return sizeof(struct ovs_key_udp); - case OVS_KEY_ATTR_SCTP: return sizeof(struct ovs_key_sctp); - case OVS_KEY_ATTR_ICMP: return sizeof(struct ovs_key_icmp); - case OVS_KEY_ATTR_ICMPV6: return sizeof(struct ovs_key_icmpv6); - case OVS_KEY_ATTR_ARP: return sizeof(struct ovs_key_arp); - case OVS_KEY_ATTR_ND: return sizeof(struct ovs_key_nd); - - case OVS_KEY_ATTR_UNSPEC: - case __OVS_KEY_ATTR_MAX: - return -1; + if (type > max_len) { + return ATTR_LEN_INVALID; } - return -1; + return tbl[type].len; } static void @@ -821,21 +1317,37 @@ } } +#define GENEVE_OPT(class, type) ((OVS_FORCE uint32_t)(class) << 8 | (type)) static int -tunnel_key_attr_len(int type) +parse_geneve_opts(const struct nlattr *attr) { - switch (type) { - case OVS_TUNNEL_KEY_ATTR_ID: return 8; - case OVS_TUNNEL_KEY_ATTR_IPV4_SRC: return 4; - case OVS_TUNNEL_KEY_ATTR_IPV4_DST: return 4; - case OVS_TUNNEL_KEY_ATTR_TOS: return 1; - case OVS_TUNNEL_KEY_ATTR_TTL: return 1; - case OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT: return 0; - case OVS_TUNNEL_KEY_ATTR_CSUM: return 0; - case __OVS_TUNNEL_KEY_ATTR_MAX: - return -1; - } - return -1; + int opts_len = nl_attr_get_size(attr); + const struct geneve_opt *opt = nl_attr_get(attr); + + while (opts_len > 0) { + int len; + + if (opts_len < sizeof(*opt)) { + return -EINVAL; + } + + len = sizeof(*opt) + opt->length * 4; + if (len > opts_len) { + return -EINVAL; + } + + switch (GENEVE_OPT(opt->opt_class, opt->type)) { + default: + if (opt->type & GENEVE_CRIT_OPT_TYPE) { + return -EINVAL; + } + }; + + opt = opt + len / sizeof(*opt); + opts_len -= len; + }; + + return 0; } enum odp_key_fitness @@ -849,7 +1361,8 @@ NL_NESTED_FOR_EACH(a, left, attr) { uint16_t type = nl_attr_type(a); size_t len = nl_attr_get_size(a); - int expected_len = tunnel_key_attr_len(type); + int expected_len = odp_key_attr_len(ovs_tun_key_attr_lens, + OVS_TUNNEL_ATTR_MAX, type); if (len != expected_len && expected_len >= 0) { return ODP_FIT_ERROR; @@ -879,18 +1392,55 @@ case OVS_TUNNEL_KEY_ATTR_CSUM: tun->flags |= FLOW_TNL_F_CSUM; break; - default: - /* Allow this to show up as unexpected, if there are unknown - * tunnel attribute, eventually resulting in ODP_FIT_TOO_MUCH. */ - unknown = true; + case OVS_TUNNEL_KEY_ATTR_TP_SRC: + tun->tp_src = nl_attr_get_be16(a); break; - } - } + case OVS_TUNNEL_KEY_ATTR_TP_DST: + tun->tp_dst = nl_attr_get_be16(a); + break; + case OVS_TUNNEL_KEY_ATTR_OAM: + tun->flags |= FLOW_TNL_F_OAM; + break; + case OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS: { + static const struct nl_policy vxlan_opts_policy[] = { + [OVS_VXLAN_EXT_GBP] = { .type = NL_A_U32 }, + }; + struct nlattr *ext[ARRAY_SIZE(vxlan_opts_policy)]; - if (!ttl) { - return ODP_FIT_ERROR; - } - if (unknown) { + if (!nl_parse_nested(a, vxlan_opts_policy, ext, ARRAY_SIZE(ext))) { + return ODP_FIT_ERROR; + } + + if (ext[OVS_VXLAN_EXT_GBP]) { + uint32_t gbp = nl_attr_get_u32(ext[OVS_VXLAN_EXT_GBP]); + + tun->gbp_id = htons(gbp & 0xFFFF); + tun->gbp_flags = (gbp >> 16) & 0xFF; + } + + break; + } + case OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS: { + if (parse_geneve_opts(a)) { + return ODP_FIT_ERROR; + } + /* It is necessary to reproduce options exactly (including order) + * so it's easiest to just echo them back. */ + unknown = true; + break; + } + default: + /* Allow this to show up as unexpected, if there are unknown + * tunnel attribute, eventually resulting in ODP_FIT_TOO_MUCH. */ + unknown = true; + break; + } + } + + if (!ttl) { + return ODP_FIT_ERROR; + } + if (unknown) { return ODP_FIT_TOO_MUCH; } return ODP_FIT_PERFECT; @@ -923,6 +1473,23 @@ if (tun_key->flags & FLOW_TNL_F_CSUM) { nl_msg_put_flag(a, OVS_TUNNEL_KEY_ATTR_CSUM); } + if (tun_key->tp_src) { + nl_msg_put_be16(a, OVS_TUNNEL_KEY_ATTR_TP_SRC, tun_key->tp_src); + } + if (tun_key->tp_dst) { + nl_msg_put_be16(a, OVS_TUNNEL_KEY_ATTR_TP_DST, tun_key->tp_dst); + } + if (tun_key->flags & FLOW_TNL_F_OAM) { + nl_msg_put_flag(a, OVS_TUNNEL_KEY_ATTR_OAM); + } + if (tun_key->gbp_flags || tun_key->gbp_id) { + size_t vxlan_opts_ofs; + + vxlan_opts_ofs = nl_msg_start_nested(a, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS); + nl_msg_put_u32(a, OVS_VXLAN_EXT_GBP, + (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id)); + nl_msg_end_nested(a, vxlan_opts_ofs); + } nl_msg_end_nested(a, tun_key_ofs); } @@ -934,32 +1501,54 @@ } static bool +odp_mask_is_exact(enum ovs_key_attr attr, const void *mask, size_t size) +{ + if (attr == OVS_KEY_ATTR_TCP_FLAGS) { + return TCP_FLAGS(*(ovs_be16 *)mask) == TCP_FLAGS(OVS_BE16_MAX); + } + if (attr == OVS_KEY_ATTR_IPV6) { + const struct ovs_key_ipv6 *ipv6_mask = mask; + + return + ((ipv6_mask->ipv6_label & htonl(IPV6_LABEL_MASK)) + == htonl(IPV6_LABEL_MASK)) + && ipv6_mask->ipv6_proto == UINT8_MAX + && ipv6_mask->ipv6_tclass == UINT8_MAX + && ipv6_mask->ipv6_hlimit == UINT8_MAX + && ipv6_mask->ipv6_frag == UINT8_MAX + && ipv6_mask_is_exact((const struct in6_addr *)ipv6_mask->ipv6_src) + && ipv6_mask_is_exact((const struct in6_addr *)ipv6_mask->ipv6_dst); + } + if (attr == OVS_KEY_ATTR_TUNNEL) { + return false; + } + + if (attr == OVS_KEY_ATTR_ARP) { + /* ARP key has padding, ignore it. */ + BUILD_ASSERT_DECL(sizeof(struct ovs_key_arp) == 24); + BUILD_ASSERT_DECL(offsetof(struct ovs_key_arp, arp_tha) == 10 + 6); + size = offsetof(struct ovs_key_arp, arp_tha) + ETH_ADDR_LEN; + ovs_assert(((uint16_t *)mask)[size/2] == 0); + } + + return is_all_ones(mask, size); +} + +static bool odp_mask_attr_is_exact(const struct nlattr *ma) { - bool is_exact = false; enum ovs_key_attr attr = nl_attr_type(ma); + const void *mask; + size_t size; if (attr == OVS_KEY_ATTR_TUNNEL) { - /* XXX this is a hack for now. Should change - * the exact match dection to per field - * instead of per attribute. - */ - struct flow_tnl tun_mask; - memset(&tun_mask, 0, sizeof tun_mask); - odp_tun_key_from_attr(ma, &tun_mask); - if (tun_mask.flags == (FLOW_TNL_F_KEY - | FLOW_TNL_F_DONT_FRAGMENT - | FLOW_TNL_F_CSUM)) { - /* The flags are exact match, check the remaining fields. */ - tun_mask.flags = 0xffff; - is_exact = is_all_ones((uint8_t *)&tun_mask, - offsetof(struct flow_tnl, ip_ttl)); - } + return false; } else { - is_exact = is_all_ones(nl_attr_get(ma), nl_attr_get_size(ma)); + mask = nl_attr_get(ma); + size = nl_attr_get_size(ma); } - return is_exact; + return odp_mask_is_exact(attr, mask, size); } void @@ -1001,45 +1590,517 @@ } } +/* Format helpers. */ + +static void +format_eth(struct ds *ds, const char *name, const uint8_t key[ETH_ADDR_LEN], + const uint8_t (*mask)[ETH_ADDR_LEN], bool verbose) +{ + bool mask_empty = mask && eth_addr_is_zero(*mask); + + if (verbose || !mask_empty) { + bool mask_full = !mask || eth_mask_is_exact(*mask); + + if (mask_full) { + ds_put_format(ds, "%s="ETH_ADDR_FMT",", name, ETH_ADDR_ARGS(key)); + } else { + ds_put_format(ds, "%s=", name); + eth_format_masked(key, *mask, ds); + ds_put_char(ds, ','); + } + } +} + +static void +format_be64(struct ds *ds, const char *name, ovs_be64 key, + const ovs_be64 *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask || *mask == OVS_BE64_MAX; + + ds_put_format(ds, "%s=0x%"PRIx64, name, ntohll(key)); + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "/%#"PRIx64, ntohll(*mask)); + } + ds_put_char(ds, ','); + } +} + +static void +format_ipv4(struct ds *ds, const char *name, ovs_be32 key, + const ovs_be32 *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask || *mask == OVS_BE32_MAX; + + ds_put_format(ds, "%s="IP_FMT, name, IP_ARGS(key)); + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "/"IP_FMT, IP_ARGS(*mask)); + } + ds_put_char(ds, ','); + } +} + +static void +format_ipv6(struct ds *ds, const char *name, const ovs_be32 key_[4], + const ovs_be32 (*mask_)[4], bool verbose) +{ + char buf[INET6_ADDRSTRLEN]; + const struct in6_addr *key = (const struct in6_addr *)key_; + const struct in6_addr *mask = mask_ ? (const struct in6_addr *)*mask_ + : NULL; + bool mask_empty = mask && ipv6_mask_is_any(mask); + + if (verbose || !mask_empty) { + bool mask_full = !mask || ipv6_mask_is_exact(mask); + + inet_ntop(AF_INET6, key, buf, sizeof buf); + ds_put_format(ds, "%s=%s", name, buf); + if (!mask_full) { /* Partially masked. */ + inet_ntop(AF_INET6, mask, buf, sizeof buf); + ds_put_format(ds, "/%s", buf); + } + ds_put_char(ds, ','); + } +} + +static void +format_ipv6_label(struct ds *ds, const char *name, ovs_be32 key, + const ovs_be32 *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask + || (*mask & htonl(IPV6_LABEL_MASK)) == htonl(IPV6_LABEL_MASK); + + ds_put_format(ds, "%s=%#"PRIx32, name, ntohl(key)); + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "/%#"PRIx32, ntohl(*mask)); + } + ds_put_char(ds, ','); + } +} + +static void +format_u8x(struct ds *ds, const char *name, uint8_t key, + const uint8_t *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask || *mask == UINT8_MAX; + + ds_put_format(ds, "%s=%#"PRIx8, name, key); + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "/%#"PRIx8, *mask); + } + ds_put_char(ds, ','); + } +} + +static void +format_u8u(struct ds *ds, const char *name, uint8_t key, + const uint8_t *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask || *mask == UINT8_MAX; + + ds_put_format(ds, "%s=%"PRIu8, name, key); + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "/%#"PRIx8, *mask); + } + ds_put_char(ds, ','); + } +} + +static void +format_be16(struct ds *ds, const char *name, ovs_be16 key, + const ovs_be16 *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask || *mask == OVS_BE16_MAX; + + ds_put_format(ds, "%s=%"PRIu16, name, ntohs(key)); + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "/%#"PRIx16, ntohs(*mask)); + } + ds_put_char(ds, ','); + } +} + +static void +format_be16x(struct ds *ds, const char *name, ovs_be16 key, + const ovs_be16 *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask || *mask == OVS_BE16_MAX; + + ds_put_format(ds, "%s=%#"PRIx16, name, ntohs(key)); + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "/%#"PRIx16, ntohs(*mask)); + } + ds_put_char(ds, ','); + } +} + +static void +format_tun_flags(struct ds *ds, const char *name, uint16_t key, + const uint16_t *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + if (verbose || !mask_empty) { + bool mask_full = !mask || (*mask & FLOW_TNL_F_MASK) == FLOW_TNL_F_MASK; + + ds_put_cstr(ds, name); + ds_put_char(ds, '('); + if (!mask_full) { /* Partially masked. */ + format_flags_masked(ds, NULL, flow_tun_flag_to_string, key, *mask); + } else { /* Fully masked. */ + format_flags(ds, flow_tun_flag_to_string, key, ','); + } + ds_put_cstr(ds, "),"); + } +} + +static bool +check_attr_len(struct ds *ds, const struct nlattr *a, const struct nlattr *ma, + const struct attr_len_tbl tbl[], int max_len, bool need_key) +{ + int expected_len; + + expected_len = odp_key_attr_len(tbl, max_len, nl_attr_type(a)); + if (expected_len != ATTR_LEN_VARIABLE && + expected_len != ATTR_LEN_NESTED) { + + bool bad_key_len = nl_attr_get_size(a) != expected_len; + bool bad_mask_len = ma && nl_attr_get_size(ma) != expected_len; + + if (bad_key_len || bad_mask_len) { + if (need_key) { + ds_put_format(ds, "key%u", nl_attr_type(a)); + } + if (bad_key_len) { + ds_put_format(ds, "(bad key length %"PRIuSIZE", expected %d)(", + nl_attr_get_size(a), expected_len); + } + format_generic_odp_key(a, ds); + if (ma) { + ds_put_char(ds, '/'); + if (bad_mask_len) { + ds_put_format(ds, "(bad mask length %"PRIuSIZE", expected %d)(", + nl_attr_get_size(ma), expected_len); + } + format_generic_odp_key(ma, ds); + } + ds_put_char(ds, ')'); + return false; + } + } + + return true; +} + +static void +format_unknown_key(struct ds *ds, const struct nlattr *a, + const struct nlattr *ma) +{ + ds_put_format(ds, "key%u(", nl_attr_type(a)); + format_generic_odp_key(a, ds); + if (ma && !odp_mask_attr_is_exact(ma)) { + ds_put_char(ds, '/'); + format_generic_odp_key(ma, ds); + } + ds_put_cstr(ds, "),"); +} + +static void +format_odp_tun_vxlan_opt(const struct nlattr *attr, + const struct nlattr *mask_attr, struct ds *ds, + bool verbose) +{ + unsigned int left; + const struct nlattr *a; + struct ofpbuf ofp; + + ofpbuf_init(&ofp, 100); + NL_NESTED_FOR_EACH(a, left, attr) { + uint16_t type = nl_attr_type(a); + const struct nlattr *ma = NULL; + + if (mask_attr) { + ma = nl_attr_find__(nl_attr_get(mask_attr), + nl_attr_get_size(mask_attr), type); + if (!ma) { + ma = generate_all_wildcard_mask(ovs_vxlan_ext_attr_lens, + OVS_VXLAN_EXT_MAX, + &ofp, a); + } + } + + if (!check_attr_len(ds, a, ma, ovs_vxlan_ext_attr_lens, + OVS_VXLAN_EXT_MAX, true)) { + continue; + } + + switch (type) { + case OVS_VXLAN_EXT_GBP: { + uint32_t key = nl_attr_get_u32(a); + ovs_be16 id, id_mask; + uint8_t flags, flags_mask; + + id = htons(key & 0xFFFF); + flags = (key >> 16) & 0xFF; + if (ma) { + uint32_t mask = nl_attr_get_u32(ma); + id_mask = htons(mask & 0xFFFF); + flags_mask = (mask >> 16) & 0xFF; + } + + ds_put_cstr(ds, "gbp("); + format_be16(ds, "id", id, ma ? &id_mask : NULL, verbose); + format_u8x(ds, "flags", flags, ma ? &flags_mask : NULL, verbose); + ds_chomp(ds, ','); + ds_put_cstr(ds, "),"); + break; + } + + default: + format_unknown_key(ds, a, ma); + } + ofpbuf_clear(&ofp); + } + + ds_chomp(ds, ','); + ofpbuf_uninit(&ofp); +} + +#define MASK(PTR, FIELD) PTR ? &PTR->FIELD : NULL + +static void +format_odp_tun_geneve(const struct nlattr *attr, + const struct nlattr *mask_attr, struct ds *ds, + bool verbose) +{ + int opts_len = nl_attr_get_size(attr); + const struct geneve_opt *opt = nl_attr_get(attr); + const struct geneve_opt *mask = mask_attr ? + nl_attr_get(mask_attr) : NULL; + + if (mask && nl_attr_get_size(attr) != nl_attr_get_size(mask_attr)) { + ds_put_format(ds, "value len %"PRIuSIZE" different from mask len %"PRIuSIZE, + nl_attr_get_size(attr), nl_attr_get_size(mask_attr)); + return; + } + + while (opts_len > 0) { + unsigned int len; + uint8_t data_len, data_len_mask; + + if (opts_len < sizeof *opt) { + ds_put_format(ds, "opt len %u less than minimum %"PRIuSIZE, + opts_len, sizeof *opt); + return; + } + + data_len = opt->length * 4; + if (mask) { + if (mask->length == 0x1f) { + data_len_mask = UINT8_MAX; + } else { + data_len_mask = mask->length; + } + } + len = sizeof *opt + data_len; + if (len > opts_len) { + ds_put_format(ds, "opt len %u greater than remaining %u", + len, opts_len); + return; + } + + ds_put_char(ds, '{'); + format_be16x(ds, "class", opt->opt_class, MASK(mask, opt_class), + verbose); + format_u8x(ds, "type", opt->type, MASK(mask, type), verbose); + format_u8u(ds, "len", data_len, mask ? &data_len_mask : NULL, verbose); + if (verbose || !mask || !is_all_zeros(mask + 1, data_len)) { + ds_put_hex(ds, opt + 1, data_len); + if (mask && !is_all_ones(mask + 1, data_len)) { + ds_put_char(ds, '/'); + ds_put_hex(ds, mask + 1, data_len); + } + } else { + ds_chomp(ds, ','); + } + ds_put_char(ds, '}'); + + opt += len / sizeof(*opt); + if (mask) { + mask += len / sizeof(*opt); + } + opts_len -= len; + }; +} + +static void +format_odp_tun_attr(const struct nlattr *attr, const struct nlattr *mask_attr, + struct ds *ds, bool verbose) +{ + unsigned int left; + const struct nlattr *a; + uint16_t flags = 0; + uint16_t mask_flags = 0; + struct ofpbuf ofp; + + ofpbuf_init(&ofp, 100); + NL_NESTED_FOR_EACH(a, left, attr) { + enum ovs_tunnel_key_attr type = nl_attr_type(a); + const struct nlattr *ma = NULL; + + if (mask_attr) { + ma = nl_attr_find__(nl_attr_get(mask_attr), + nl_attr_get_size(mask_attr), type); + if (!ma) { + ma = generate_all_wildcard_mask(ovs_tun_key_attr_lens, + OVS_TUNNEL_KEY_ATTR_MAX, + &ofp, a); + } + } + + if (!check_attr_len(ds, a, ma, ovs_tun_key_attr_lens, + OVS_TUNNEL_KEY_ATTR_MAX, true)) { + continue; + } + + switch (type) { + case OVS_TUNNEL_KEY_ATTR_ID: + format_be64(ds, "tun_id", nl_attr_get_be64(a), + ma ? nl_attr_get(ma) : NULL, verbose); + flags |= FLOW_TNL_F_KEY; + if (ma) { + mask_flags |= FLOW_TNL_F_KEY; + } + break; + case OVS_TUNNEL_KEY_ATTR_IPV4_SRC: + format_ipv4(ds, "src", nl_attr_get_be32(a), + ma ? nl_attr_get(ma) : NULL, verbose); + break; + case OVS_TUNNEL_KEY_ATTR_IPV4_DST: + format_ipv4(ds, "dst", nl_attr_get_be32(a), + ma ? nl_attr_get(ma) : NULL, verbose); + break; + case OVS_TUNNEL_KEY_ATTR_TOS: + format_u8x(ds, "tos", nl_attr_get_u8(a), + ma ? nl_attr_get(ma) : NULL, verbose); + break; + case OVS_TUNNEL_KEY_ATTR_TTL: + format_u8u(ds, "ttl", nl_attr_get_u8(a), + ma ? nl_attr_get(ma) : NULL, verbose); + break; + case OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT: + flags |= FLOW_TNL_F_DONT_FRAGMENT; + break; + case OVS_TUNNEL_KEY_ATTR_CSUM: + flags |= FLOW_TNL_F_CSUM; + break; + case OVS_TUNNEL_KEY_ATTR_TP_SRC: + format_be16(ds, "tp_src", nl_attr_get_be16(a), + ma ? nl_attr_get(ma) : NULL, verbose); + break; + case OVS_TUNNEL_KEY_ATTR_TP_DST: + format_be16(ds, "tp_dst", nl_attr_get_be16(a), + ma ? nl_attr_get(ma) : NULL, verbose); + break; + case OVS_TUNNEL_KEY_ATTR_OAM: + flags |= FLOW_TNL_F_OAM; + break; + case OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS: + ds_put_cstr(ds, "vxlan("); + format_odp_tun_vxlan_opt(a, ma, ds, verbose); + ds_put_cstr(ds, "),"); + break; + case OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS: + ds_put_cstr(ds, "geneve("); + format_odp_tun_geneve(a, ma, ds, verbose); + ds_put_cstr(ds, "),"); + break; + case __OVS_TUNNEL_KEY_ATTR_MAX: + default: + format_unknown_key(ds, a, ma); + } + ofpbuf_clear(&ofp); + } + + /* Flags can have a valid mask even if the attribute is not set, so + * we need to collect these separately. */ + if (mask_attr) { + NL_NESTED_FOR_EACH(a, left, mask_attr) { + switch (nl_attr_type(a)) { + case OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT: + mask_flags |= FLOW_TNL_F_DONT_FRAGMENT; + break; + case OVS_TUNNEL_KEY_ATTR_CSUM: + mask_flags |= FLOW_TNL_F_CSUM; + break; + case OVS_TUNNEL_KEY_ATTR_OAM: + mask_flags |= FLOW_TNL_F_OAM; + break; + } + } + } + + format_tun_flags(ds, "flags", flags, mask_attr ? &mask_flags : NULL, + verbose); + ds_chomp(ds, ','); + ofpbuf_uninit(&ofp); +} + +static void +format_frag(struct ds *ds, const char *name, uint8_t key, + const uint8_t *mask, bool verbose) +{ + bool mask_empty = mask && !*mask; + + /* ODP frag is an enumeration field; partial masks are not meaningful. */ + if (verbose || !mask_empty) { + bool mask_full = !mask || *mask == UINT8_MAX; + + if (!mask_full) { /* Partially masked. */ + ds_put_format(ds, "error: partial mask not supported for frag (%#" + PRIx8"),", *mask); + } else { + ds_put_format(ds, "%s=%s,", name, ovs_frag_type_to_string(key)); + } + } +} + static void format_odp_key_attr(const struct nlattr *a, const struct nlattr *ma, const struct hmap *portno_names, struct ds *ds, bool verbose) { - struct flow_tnl tun_key; enum ovs_key_attr attr = nl_attr_type(a); char namebuf[OVS_KEY_ATTR_BUFSIZE]; - int expected_len; bool is_exact; is_exact = ma ? odp_mask_attr_is_exact(ma) : true; ds_put_cstr(ds, ovs_key_attr_to_string(attr, namebuf, sizeof namebuf)); - { - expected_len = odp_flow_key_attr_len(nl_attr_type(a)); - if (expected_len != -2) { - bool bad_key_len = nl_attr_get_size(a) != expected_len; - bool bad_mask_len = ma && nl_attr_get_size(ma) != expected_len; - - if (bad_key_len || bad_mask_len) { - if (bad_key_len) { - ds_put_format(ds, "(bad key length %"PRIuSIZE", expected %d)(", - nl_attr_get_size(a), expected_len); - } - format_generic_odp_key(a, ds); - if (ma) { - ds_put_char(ds, '/'); - if (bad_mask_len) { - ds_put_format(ds, "(bad mask length %"PRIuSIZE", expected %d)(", - nl_attr_get_size(ma), expected_len); - } - format_generic_odp_key(ma, ds); - } - ds_put_char(ds, ')'); - return; - } - } + if (!check_attr_len(ds, a, ma, ovs_flow_key_attr_lens, + OVS_KEY_ATTR_MAX, false)) { + return; } ds_put_char(ds, '('); @@ -1066,44 +2127,7 @@ break; case OVS_KEY_ATTR_TUNNEL: - memset(&tun_key, 0, sizeof tun_key); - if (odp_tun_key_from_attr(a, &tun_key) == ODP_FIT_ERROR) { - ds_put_format(ds, "error"); - } else if (!is_exact) { - struct flow_tnl tun_mask; - - memset(&tun_mask, 0, sizeof tun_mask); - odp_tun_key_from_attr(ma, &tun_mask); - ds_put_format(ds, "tun_id=%#"PRIx64"/%#"PRIx64 - ",src="IP_FMT"/"IP_FMT",dst="IP_FMT"/"IP_FMT - ",tos=%#"PRIx8"/%#"PRIx8",ttl=%"PRIu8"/%#"PRIx8 - ",flags(", - ntohll(tun_key.tun_id), ntohll(tun_mask.tun_id), - IP_ARGS(tun_key.ip_src), IP_ARGS(tun_mask.ip_src), - IP_ARGS(tun_key.ip_dst), IP_ARGS(tun_mask.ip_dst), - tun_key.ip_tos, tun_mask.ip_tos, - tun_key.ip_ttl, tun_mask.ip_ttl); - - format_flags(ds, flow_tun_flag_to_string, tun_key.flags, ','); - - /* XXX This code is correct, but enabling it would break the unit - test. Disable it for now until the input parser is fixed. - - ds_put_char(ds, '/'); - format_flags(ds, flow_tun_flag_to_string, tun_mask.flags, ','); - */ - ds_put_char(ds, ')'); - } else { - ds_put_format(ds, "tun_id=0x%"PRIx64",src="IP_FMT",dst="IP_FMT"," - "tos=0x%"PRIx8",ttl=%"PRIu8",flags(", - ntohll(tun_key.tun_id), - IP_ARGS(tun_key.ip_src), - IP_ARGS(tun_key.ip_dst), - tun_key.ip_tos, tun_key.ip_ttl); - - format_flags(ds, flow_tun_flag_to_string, tun_key.flags, ','); - ds_put_char(ds, ')'); - } + format_odp_tun_attr(a, ma, ds, verbose); break; case OVS_KEY_ATTR_IN_PORT: @@ -1123,42 +2147,18 @@ } break; - case OVS_KEY_ATTR_ETHERNET: - if (!is_exact) { - const struct ovs_key_ethernet *eth_mask = nl_attr_get(ma); - const struct ovs_key_ethernet *eth_key = nl_attr_get(a); + case OVS_KEY_ATTR_ETHERNET: { + const struct ovs_key_ethernet *mask = ma ? nl_attr_get(ma) : NULL; + const struct ovs_key_ethernet *key = nl_attr_get(a); - ds_put_format(ds, "src="ETH_ADDR_FMT"/"ETH_ADDR_FMT - ",dst="ETH_ADDR_FMT"/"ETH_ADDR_FMT, - ETH_ADDR_ARGS(eth_key->eth_src), - ETH_ADDR_ARGS(eth_mask->eth_src), - ETH_ADDR_ARGS(eth_key->eth_dst), - ETH_ADDR_ARGS(eth_mask->eth_dst)); - } else { - const struct ovs_key_ethernet *eth_key = nl_attr_get(a); - - ds_put_format(ds, "src="ETH_ADDR_FMT",dst="ETH_ADDR_FMT, - ETH_ADDR_ARGS(eth_key->eth_src), - ETH_ADDR_ARGS(eth_key->eth_dst)); - } + format_eth(ds, "src", key->eth_src, MASK(mask, eth_src), verbose); + format_eth(ds, "dst", key->eth_dst, MASK(mask, eth_dst), verbose); + ds_chomp(ds, ','); break; - + } case OVS_KEY_ATTR_VLAN: - { - ovs_be16 vlan_tci = nl_attr_get_be16(a); - if (!is_exact) { - ovs_be16 mask = nl_attr_get_be16(ma); - ds_put_format(ds, "vid=%"PRIu16"/0x%"PRIx16",pcp=%d/0x%x,cfi=%d/%d", - vlan_tci_to_vid(vlan_tci), - vlan_tci_to_vid(mask), - vlan_tci_to_pcp(vlan_tci), - vlan_tci_to_pcp(mask), - vlan_tci_to_cfi(vlan_tci), - vlan_tci_to_cfi(mask)); - } else { - format_vlan_tci(ds, vlan_tci); - } - } + format_vlan_tci(ds, nl_attr_get_be16(a), + ma ? nl_attr_get_be16(ma) : OVS_BE16_MAX, verbose); break; case OVS_KEY_ATTR_MPLS: { @@ -1167,23 +2167,21 @@ size_t size = nl_attr_get_size(a); if (!size || size % sizeof *mpls_key) { - ds_put_format(ds, "(bad key length %"PRIuSIZE")", - nl_attr_get_size(a)); + ds_put_format(ds, "(bad key length %"PRIuSIZE")", size); return; } if (!is_exact) { mpls_mask = nl_attr_get(ma); - if (nl_attr_get_size(a) != nl_attr_get_size(ma)) { + if (size != nl_attr_get_size(ma)) { ds_put_format(ds, "(key length %"PRIuSIZE" != " "mask length %"PRIuSIZE")", - nl_attr_get_size(a), nl_attr_get_size(ma)); + size, nl_attr_get_size(ma)); return; } } format_mpls(ds, mpls_key, mpls_mask, size / sizeof *mpls_key); break; } - case OVS_KEY_ATTR_ETHERTYPE: ds_put_format(ds, "0x%04"PRIx16, ntohs(nl_attr_get_be16(a))); if (!is_exact) { @@ -1191,233 +2189,105 @@ } break; - case OVS_KEY_ATTR_IPV4: - if (!is_exact) { - const struct ovs_key_ipv4 *ipv4_key = nl_attr_get(a); - const struct ovs_key_ipv4 *ipv4_mask = nl_attr_get(ma); - - ds_put_format(ds, "src="IP_FMT"/"IP_FMT",dst="IP_FMT"/"IP_FMT - ",proto=%"PRIu8"/%#"PRIx8",tos=%#"PRIx8"/%#"PRIx8 - ",ttl=%"PRIu8"/%#"PRIx8",frag=%s/%#"PRIx8, - IP_ARGS(ipv4_key->ipv4_src), - IP_ARGS(ipv4_mask->ipv4_src), - IP_ARGS(ipv4_key->ipv4_dst), - IP_ARGS(ipv4_mask->ipv4_dst), - ipv4_key->ipv4_proto, ipv4_mask->ipv4_proto, - ipv4_key->ipv4_tos, ipv4_mask->ipv4_tos, - ipv4_key->ipv4_ttl, ipv4_mask->ipv4_ttl, - ovs_frag_type_to_string(ipv4_key->ipv4_frag), - ipv4_mask->ipv4_frag); - } else { - const struct ovs_key_ipv4 *ipv4_key = nl_attr_get(a); - - ds_put_format(ds, "src="IP_FMT",dst="IP_FMT",proto=%"PRIu8 - ",tos=%#"PRIx8",ttl=%"PRIu8",frag=%s", - IP_ARGS(ipv4_key->ipv4_src), - IP_ARGS(ipv4_key->ipv4_dst), - ipv4_key->ipv4_proto, ipv4_key->ipv4_tos, - ipv4_key->ipv4_ttl, - ovs_frag_type_to_string(ipv4_key->ipv4_frag)); - } + case OVS_KEY_ATTR_IPV4: { + const struct ovs_key_ipv4 *key = nl_attr_get(a); + const struct ovs_key_ipv4 *mask = ma ? nl_attr_get(ma) : NULL; + + format_ipv4(ds, "src", key->ipv4_src, MASK(mask, ipv4_src), verbose); + format_ipv4(ds, "dst", key->ipv4_dst, MASK(mask, ipv4_dst), verbose); + format_u8u(ds, "proto", key->ipv4_proto, MASK(mask, ipv4_proto), + verbose); + format_u8x(ds, "tos", key->ipv4_tos, MASK(mask, ipv4_tos), verbose); + format_u8u(ds, "ttl", key->ipv4_ttl, MASK(mask, ipv4_ttl), verbose); + format_frag(ds, "frag", key->ipv4_frag, MASK(mask, ipv4_frag), + verbose); + ds_chomp(ds, ','); break; - - case OVS_KEY_ATTR_IPV6: - if (!is_exact) { - const struct ovs_key_ipv6 *ipv6_key, *ipv6_mask; - char src_str[INET6_ADDRSTRLEN]; - char dst_str[INET6_ADDRSTRLEN]; - char src_mask[INET6_ADDRSTRLEN]; - char dst_mask[INET6_ADDRSTRLEN]; - - ipv6_key = nl_attr_get(a); - inet_ntop(AF_INET6, ipv6_key->ipv6_src, src_str, sizeof src_str); - inet_ntop(AF_INET6, ipv6_key->ipv6_dst, dst_str, sizeof dst_str); - - ipv6_mask = nl_attr_get(ma); - inet_ntop(AF_INET6, ipv6_mask->ipv6_src, src_mask, sizeof src_mask); - inet_ntop(AF_INET6, ipv6_mask->ipv6_dst, dst_mask, sizeof dst_mask); - - ds_put_format(ds, "src=%s/%s,dst=%s/%s,label=%#"PRIx32"/%#"PRIx32 - ",proto=%"PRIu8"/%#"PRIx8",tclass=%#"PRIx8"/%#"PRIx8 - ",hlimit=%"PRIu8"/%#"PRIx8",frag=%s/%#"PRIx8, - src_str, src_mask, dst_str, dst_mask, - ntohl(ipv6_key->ipv6_label), - ntohl(ipv6_mask->ipv6_label), - ipv6_key->ipv6_proto, ipv6_mask->ipv6_proto, - ipv6_key->ipv6_tclass, ipv6_mask->ipv6_tclass, - ipv6_key->ipv6_hlimit, ipv6_mask->ipv6_hlimit, - ovs_frag_type_to_string(ipv6_key->ipv6_frag), - ipv6_mask->ipv6_frag); - } else { - const struct ovs_key_ipv6 *ipv6_key; - char src_str[INET6_ADDRSTRLEN]; - char dst_str[INET6_ADDRSTRLEN]; - - ipv6_key = nl_attr_get(a); - inet_ntop(AF_INET6, ipv6_key->ipv6_src, src_str, sizeof src_str); - inet_ntop(AF_INET6, ipv6_key->ipv6_dst, dst_str, sizeof dst_str); - - ds_put_format(ds, "src=%s,dst=%s,label=%#"PRIx32",proto=%"PRIu8 - ",tclass=%#"PRIx8",hlimit=%"PRIu8",frag=%s", - src_str, dst_str, ntohl(ipv6_key->ipv6_label), - ipv6_key->ipv6_proto, ipv6_key->ipv6_tclass, - ipv6_key->ipv6_hlimit, - ovs_frag_type_to_string(ipv6_key->ipv6_frag)); - } + } + case OVS_KEY_ATTR_IPV6: { + const struct ovs_key_ipv6 *key = nl_attr_get(a); + const struct ovs_key_ipv6 *mask = ma ? nl_attr_get(ma) : NULL; + + format_ipv6(ds, "src", key->ipv6_src, MASK(mask, ipv6_src), verbose); + format_ipv6(ds, "dst", key->ipv6_dst, MASK(mask, ipv6_dst), verbose); + format_ipv6_label(ds, "label", key->ipv6_label, MASK(mask, ipv6_label), + verbose); + format_u8u(ds, "proto", key->ipv6_proto, MASK(mask, ipv6_proto), + verbose); + format_u8x(ds, "tclass", key->ipv6_tclass, MASK(mask, ipv6_tclass), + verbose); + format_u8u(ds, "hlimit", key->ipv6_hlimit, MASK(mask, ipv6_hlimit), + verbose); + format_frag(ds, "frag", key->ipv6_frag, MASK(mask, ipv6_frag), + verbose); + ds_chomp(ds, ','); break; - + } + /* These have the same structure and format. */ case OVS_KEY_ATTR_TCP: - if (!is_exact) { - const struct ovs_key_tcp *tcp_mask = nl_attr_get(ma); - const struct ovs_key_tcp *tcp_key = nl_attr_get(a); - - ds_put_format(ds, "src=%"PRIu16"/%#"PRIx16 - ",dst=%"PRIu16"/%#"PRIx16, - ntohs(tcp_key->tcp_src), ntohs(tcp_mask->tcp_src), - ntohs(tcp_key->tcp_dst), ntohs(tcp_mask->tcp_dst)); - } else { - const struct ovs_key_tcp *tcp_key = nl_attr_get(a); + case OVS_KEY_ATTR_UDP: + case OVS_KEY_ATTR_SCTP: { + const struct ovs_key_tcp *key = nl_attr_get(a); + const struct ovs_key_tcp *mask = ma ? nl_attr_get(ma) : NULL; - ds_put_format(ds, "src=%"PRIu16",dst=%"PRIu16, - ntohs(tcp_key->tcp_src), ntohs(tcp_key->tcp_dst)); - } + format_be16(ds, "src", key->tcp_src, MASK(mask, tcp_src), verbose); + format_be16(ds, "dst", key->tcp_dst, MASK(mask, tcp_dst), verbose); + ds_chomp(ds, ','); break; - + } case OVS_KEY_ATTR_TCP_FLAGS: - ds_put_format(ds, "0x%03"PRIx16, ntohs(nl_attr_get_be16(a))); - if (!is_exact) { - ds_put_format(ds, "/0x%03"PRIx16, ntohs(nl_attr_get_be16(ma))); - } - break; - - case OVS_KEY_ATTR_UDP: if (!is_exact) { - const struct ovs_key_udp *udp_mask = nl_attr_get(ma); - const struct ovs_key_udp *udp_key = nl_attr_get(a); - - ds_put_format(ds, "src=%"PRIu16"/%#"PRIx16 - ",dst=%"PRIu16"/%#"PRIx16, - ntohs(udp_key->udp_src), ntohs(udp_mask->udp_src), - ntohs(udp_key->udp_dst), ntohs(udp_mask->udp_dst)); + format_flags_masked(ds, NULL, packet_tcp_flag_to_string, + ntohs(nl_attr_get_be16(a)), + ntohs(nl_attr_get_be16(ma))); } else { - const struct ovs_key_udp *udp_key = nl_attr_get(a); - - ds_put_format(ds, "src=%"PRIu16",dst=%"PRIu16, - ntohs(udp_key->udp_src), ntohs(udp_key->udp_dst)); + format_flags(ds, packet_tcp_flag_to_string, + ntohs(nl_attr_get_be16(a)), ','); } break; - case OVS_KEY_ATTR_SCTP: - if (ma) { - const struct ovs_key_sctp *sctp_mask = nl_attr_get(ma); - const struct ovs_key_sctp *sctp_key = nl_attr_get(a); + case OVS_KEY_ATTR_ICMP: { + const struct ovs_key_icmp *key = nl_attr_get(a); + const struct ovs_key_icmp *mask = ma ? nl_attr_get(ma) : NULL; - ds_put_format(ds, "src=%"PRIu16"/%#"PRIx16 - ",dst=%"PRIu16"/%#"PRIx16, - ntohs(sctp_key->sctp_src), ntohs(sctp_mask->sctp_src), - ntohs(sctp_key->sctp_dst), ntohs(sctp_mask->sctp_dst)); - } else { - const struct ovs_key_sctp *sctp_key = nl_attr_get(a); - - ds_put_format(ds, "src=%"PRIu16",dst=%"PRIu16, - ntohs(sctp_key->sctp_src), ntohs(sctp_key->sctp_dst)); - } - break; - - case OVS_KEY_ATTR_ICMP: - if (!is_exact) { - const struct ovs_key_icmp *icmp_mask = nl_attr_get(ma); - const struct ovs_key_icmp *icmp_key = nl_attr_get(a); - - ds_put_format(ds, "type=%"PRIu8"/%#"PRIx8",code=%"PRIu8"/%#"PRIx8, - icmp_key->icmp_type, icmp_mask->icmp_type, - icmp_key->icmp_code, icmp_mask->icmp_code); - } else { - const struct ovs_key_icmp *icmp_key = nl_attr_get(a); - - ds_put_format(ds, "type=%"PRIu8",code=%"PRIu8, - icmp_key->icmp_type, icmp_key->icmp_code); - } + format_u8u(ds, "type", key->icmp_type, MASK(mask, icmp_type), verbose); + format_u8u(ds, "code", key->icmp_code, MASK(mask, icmp_code), verbose); + ds_chomp(ds, ','); break; - - case OVS_KEY_ATTR_ICMPV6: - if (!is_exact) { - const struct ovs_key_icmpv6 *icmpv6_mask = nl_attr_get(ma); - const struct ovs_key_icmpv6 *icmpv6_key = nl_attr_get(a); - - ds_put_format(ds, "type=%"PRIu8"/%#"PRIx8",code=%"PRIu8"/%#"PRIx8, - icmpv6_key->icmpv6_type, icmpv6_mask->icmpv6_type, - icmpv6_key->icmpv6_code, icmpv6_mask->icmpv6_code); - } else { - const struct ovs_key_icmpv6 *icmpv6_key = nl_attr_get(a); - - ds_put_format(ds, "type=%"PRIu8",code=%"PRIu8, - icmpv6_key->icmpv6_type, icmpv6_key->icmpv6_code); - } + } + case OVS_KEY_ATTR_ICMPV6: { + const struct ovs_key_icmpv6 *key = nl_attr_get(a); + const struct ovs_key_icmpv6 *mask = ma ? nl_attr_get(ma) : NULL; + + format_u8u(ds, "type", key->icmpv6_type, MASK(mask, icmpv6_type), + verbose); + format_u8u(ds, "code", key->icmpv6_code, MASK(mask, icmpv6_code), + verbose); + ds_chomp(ds, ','); break; - - case OVS_KEY_ATTR_ARP: - if (!is_exact) { - const struct ovs_key_arp *arp_mask = nl_attr_get(ma); - const struct ovs_key_arp *arp_key = nl_attr_get(a); - - ds_put_format(ds, "sip="IP_FMT"/"IP_FMT",tip="IP_FMT"/"IP_FMT - ",op=%"PRIu16"/%#"PRIx16 - ",sha="ETH_ADDR_FMT"/"ETH_ADDR_FMT - ",tha="ETH_ADDR_FMT"/"ETH_ADDR_FMT, - IP_ARGS(arp_key->arp_sip), - IP_ARGS(arp_mask->arp_sip), - IP_ARGS(arp_key->arp_tip), - IP_ARGS(arp_mask->arp_tip), - ntohs(arp_key->arp_op), ntohs(arp_mask->arp_op), - ETH_ADDR_ARGS(arp_key->arp_sha), - ETH_ADDR_ARGS(arp_mask->arp_sha), - ETH_ADDR_ARGS(arp_key->arp_tha), - ETH_ADDR_ARGS(arp_mask->arp_tha)); - } else { - const struct ovs_key_arp *arp_key = nl_attr_get(a); - - ds_put_format(ds, "sip="IP_FMT",tip="IP_FMT",op=%"PRIu16"," - "sha="ETH_ADDR_FMT",tha="ETH_ADDR_FMT, - IP_ARGS(arp_key->arp_sip), IP_ARGS(arp_key->arp_tip), - ntohs(arp_key->arp_op), - ETH_ADDR_ARGS(arp_key->arp_sha), - ETH_ADDR_ARGS(arp_key->arp_tha)); - } + } + case OVS_KEY_ATTR_ARP: { + const struct ovs_key_arp *mask = ma ? nl_attr_get(ma) : NULL; + const struct ovs_key_arp *key = nl_attr_get(a); + + format_ipv4(ds, "sip", key->arp_sip, MASK(mask, arp_sip), verbose); + format_ipv4(ds, "tip", key->arp_tip, MASK(mask, arp_tip), verbose); + format_be16(ds, "op", key->arp_op, MASK(mask, arp_op), verbose); + format_eth(ds, "sha", key->arp_sha, MASK(mask, arp_sha), verbose); + format_eth(ds, "tha", key->arp_tha, MASK(mask, arp_tha), verbose); + ds_chomp(ds, ','); break; - + } case OVS_KEY_ATTR_ND: { - const struct ovs_key_nd *nd_key, *nd_mask = NULL; - char target[INET6_ADDRSTRLEN]; + const struct ovs_key_nd *mask = ma ? nl_attr_get(ma) : NULL; + const struct ovs_key_nd *key = nl_attr_get(a); - nd_key = nl_attr_get(a); - if (!is_exact) { - nd_mask = nl_attr_get(ma); - } - - inet_ntop(AF_INET6, nd_key->nd_target, target, sizeof target); - ds_put_format(ds, "target=%s", target); - if (!is_exact) { - inet_ntop(AF_INET6, nd_mask->nd_target, target, sizeof target); - ds_put_format(ds, "/%s", target); - } + format_ipv6(ds, "target", key->nd_target, MASK(mask, nd_target), + verbose); + format_eth(ds, "sll", key->nd_sll, MASK(mask, nd_sll), verbose); + format_eth(ds, "tll", key->nd_tll, MASK(mask, nd_tll), verbose); - if (!eth_addr_is_zero(nd_key->nd_sll)) { - ds_put_format(ds, ",sll="ETH_ADDR_FMT, - ETH_ADDR_ARGS(nd_key->nd_sll)); - if (!is_exact) { - ds_put_format(ds, "/"ETH_ADDR_FMT, - ETH_ADDR_ARGS(nd_mask->nd_sll)); - } - } - if (!eth_addr_is_zero(nd_key->nd_tll)) { - ds_put_format(ds, ",tll="ETH_ADDR_FMT, - ETH_ADDR_ARGS(nd_key->nd_tll)); - if (!is_exact) { - ds_put_format(ds, "/"ETH_ADDR_FMT, - ETH_ADDR_ARGS(nd_mask->nd_tll)); - } - } + ds_chomp(ds, ','); break; } case OVS_KEY_ATTR_UNSPEC: @@ -1434,26 +2304,57 @@ } static struct nlattr * -generate_all_wildcard_mask(struct ofpbuf *ofp, const struct nlattr *key) +generate_all_wildcard_mask(const struct attr_len_tbl tbl[], int max, + struct ofpbuf *ofp, const struct nlattr *key) { const struct nlattr *a; unsigned int left; int type = nl_attr_type(key); int size = nl_attr_get_size(key); - if (odp_flow_key_attr_len(type) >=0) { - nl_msg_put_unspec_zero(ofp, type, size); - } else { - size_t nested_mask; + if (odp_key_attr_len(tbl, max, type) != ATTR_LEN_NESTED) { + nl_msg_put_unspec_zero(ofp, type, size); + } else { + size_t nested_mask; + + if (tbl[type].next) { + tbl = tbl[type].next; + max = tbl[type].next_max; + } + + nested_mask = nl_msg_start_nested(ofp, type); + NL_ATTR_FOR_EACH(a, left, key, nl_attr_get_size(key)) { + generate_all_wildcard_mask(tbl, max, ofp, nl_attr_get(a)); + } + nl_msg_end_nested(ofp, nested_mask); + } + + return ofp->base; +} + +int +odp_ufid_from_string(const char *s_, ovs_u128 *ufid) +{ + const char *s = s_; + + if (ovs_scan(s, "ufid:")) { + s += 5; - nested_mask = nl_msg_start_nested(ofp, type); - NL_ATTR_FOR_EACH(a, left, key, nl_attr_get_size(key)) { - generate_all_wildcard_mask(ofp, nl_attr_get(a)); + if (!uuid_from_string_prefix((struct uuid *)ufid, s)) { + return -EINVAL; } - nl_msg_end_nested(ofp, nested_mask); + s += UUID_LEN; + + return s - s_; } - return ofpbuf_base(ofp); + return 0; +} + +void +odp_format_ufid(const ovs_u128 *ufid, struct ds *ds) +{ + ds_put_format(ds, "ufid:"UUID_FMT, UUID_ARGS((struct uuid *)ufid)); } /* Appends to 'ds' a string representation of the 'key_len' bytes of @@ -1483,7 +2384,9 @@ has_ethtype_key = true; } - is_nested_attr = (odp_flow_key_attr_len(attr_type) == -2); + is_nested_attr = odp_key_attr_len(ovs_flow_key_attr_lens, + OVS_KEY_ATTR_MAX, attr_type) == + ATTR_LEN_NESTED; if (mask && mask_len) { ma = nl_attr_find__(mask, mask_len, nl_attr_type(a)); @@ -1492,7 +2395,9 @@ if (verbose || !is_wildcard || is_nested_attr) { if (is_wildcard && !ma) { - ma = generate_all_wildcard_mask(&ofp, a); + ma = generate_all_wildcard_mask(ovs_flow_key_attr_lens, + OVS_KEY_ATTR_MAX, + &ofp, a); } if (!first_field) { ds_put_char(ds, ','); @@ -1537,855 +2442,862 @@ odp_flow_format(key, key_len, NULL, 0, NULL, ds, true); } -static void -put_nd(struct ovs_key_nd* nd_key, const uint8_t *nd_sll, - const uint8_t *nd_tll, struct ofpbuf *key) +static bool +ovs_frag_type_from_string(const char *s, enum ovs_frag_type *type) { - if (nd_sll) { - memcpy(nd_key->nd_sll, nd_sll, ETH_ADDR_LEN); - } - - if (nd_tll) { - memcpy(nd_key->nd_tll, nd_tll, ETH_ADDR_LEN); + if (!strcasecmp(s, "no")) { + *type = OVS_FRAG_TYPE_NONE; + } else if (!strcasecmp(s, "first")) { + *type = OVS_FRAG_TYPE_FIRST; + } else if (!strcasecmp(s, "later")) { + *type = OVS_FRAG_TYPE_LATER; + } else { + return false; } - - nl_msg_put_unspec(key, OVS_KEY_ATTR_ND, nd_key, sizeof *nd_key); + return true; } +/* Parsing. */ + static int -put_nd_key(int n, const char *nd_target_s, const uint8_t *nd_sll, - const uint8_t *nd_tll, struct ofpbuf *key) +scan_eth(const char *s, uint8_t (*key)[ETH_ADDR_LEN], + uint8_t (*mask)[ETH_ADDR_LEN]) { - struct ovs_key_nd nd_key; + int n; - memset(&nd_key, 0, sizeof nd_key); + if (ovs_scan(s, ETH_ADDR_SCAN_FMT"%n", ETH_ADDR_SCAN_ARGS(*key), &n)) { + int len = n; - if (inet_pton(AF_INET6, nd_target_s, nd_key.nd_target) != 1) { - return -EINVAL; + if (mask) { + if (ovs_scan(s + len, "/"ETH_ADDR_SCAN_FMT"%n", + ETH_ADDR_SCAN_ARGS(*mask), &n)) { + len += n; + } else { + memset(mask, 0xff, sizeof *mask); + } + } + return len; } - - put_nd(&nd_key, nd_sll, nd_tll, key); - return n; + return 0; } static int -put_nd_mask(int n, const char *nd_target_s, - const uint8_t *nd_sll, const uint8_t *nd_tll, struct ofpbuf *mask) +scan_ipv4(const char *s, ovs_be32 *key, ovs_be32 *mask) { - struct ovs_key_nd nd_mask; + int n; - memset(&nd_mask, 0xff, sizeof nd_mask); + if (ovs_scan(s, IP_SCAN_FMT"%n", IP_SCAN_ARGS(key), &n)) { + int len = n; - if (strlen(nd_target_s) != 0 && - inet_pton(AF_INET6, nd_target_s, nd_mask.nd_target) != 1) { - return -EINVAL; + if (mask) { + if (ovs_scan(s + len, "/"IP_SCAN_FMT"%n", + IP_SCAN_ARGS(mask), &n)) { + len += n; + } else { + *mask = OVS_BE32_MAX; + } + } + return len; } - - put_nd(&nd_mask, nd_sll, nd_tll, mask); - return n; + return 0; } -static bool -ovs_frag_type_from_string(const char *s, enum ovs_frag_type *type) +static int +scan_ipv6(const char *s, ovs_be32 (*key)[4], ovs_be32 (*mask)[4]) { - if (!strcasecmp(s, "no")) { - *type = OVS_FRAG_TYPE_NONE; - } else if (!strcasecmp(s, "first")) { - *type = OVS_FRAG_TYPE_FIRST; - } else if (!strcasecmp(s, "later")) { - *type = OVS_FRAG_TYPE_LATER; - } else { - return false; + int n; + char ipv6_s[IPV6_SCAN_LEN + 1]; + + if (ovs_scan(s, IPV6_SCAN_FMT"%n", ipv6_s, &n) + && inet_pton(AF_INET6, ipv6_s, key) == 1) { + int len = n; + + if (mask) { + if (ovs_scan(s + len, "/"IPV6_SCAN_FMT"%n", ipv6_s, &n) + && inet_pton(AF_INET6, ipv6_s, mask) == 1) { + len += n; + } else { + memset(mask, 0xff, sizeof *mask); + } + } + return len; } - return true; + return 0; } -static ovs_be32 -mpls_lse_from_components(int mpls_label, int mpls_tc, int mpls_ttl, int mpls_bos) +static int +scan_ipv6_label(const char *s, ovs_be32 *key, ovs_be32 *mask) { - return (htonl((mpls_label << MPLS_LABEL_SHIFT) | - (mpls_tc << MPLS_TC_SHIFT) | - (mpls_ttl << MPLS_TTL_SHIFT) | - (mpls_bos << MPLS_BOS_SHIFT))); + int key_, mask_; + int n; + + if (ovs_scan(s, "%i%n", &key_, &n) + && (key_ & ~IPV6_LABEL_MASK) == 0) { + int len = n; + + *key = htonl(key_); + if (mask) { + if (ovs_scan(s + len, "/%i%n", &mask_, &n) + && (mask_ & ~IPV6_LABEL_MASK) == 0) { + len += n; + *mask = htonl(mask_); + } else { + *mask = htonl(IPV6_LABEL_MASK); + } + } + return len; + } + return 0; } static int -parse_odp_key_mask_attr(const char *s, const struct simap *port_names, - struct ofpbuf *key, struct ofpbuf *mask) +scan_u8(const char *s, uint8_t *key, uint8_t *mask) { - { - uint32_t priority; - uint32_t priority_mask; - int n = -1; + int n; - if (mask && ovs_scan(s, "skb_priority(%"SCNi32"/%"SCNi32")%n", - &priority, &priority_mask, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_PRIORITY, priority); - nl_msg_put_u32(mask, OVS_KEY_ATTR_PRIORITY, priority_mask); - return n; - } else if (ovs_scan(s, "skb_priority(%"SCNi32")%n", &priority, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_PRIORITY, priority); - if (mask) { - nl_msg_put_u32(mask, OVS_KEY_ATTR_PRIORITY, UINT32_MAX); + if (ovs_scan(s, "%"SCNi8"%n", key, &n)) { + int len = n; + + if (mask) { + if (ovs_scan(s + len, "/%"SCNi8"%n", mask, &n)) { + len += n; + } else { + *mask = UINT8_MAX; } - return n; } + return len; } + return 0; +} - { - uint32_t mark; - uint32_t mark_mask; - int n = -1; +static int +scan_u32(const char *s, uint32_t *key, uint32_t *mask) +{ + int n; - if (mask && ovs_scan(s, "skb_mark(%"SCNi32"/%"SCNi32")%n", &mark, - &mark_mask, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_SKB_MARK, mark); - nl_msg_put_u32(mask, OVS_KEY_ATTR_SKB_MARK, mark_mask); - return n; - } else if (ovs_scan(s, "skb_mark(%"SCNi32")%n", &mark, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_SKB_MARK, mark); - if (mask) { - nl_msg_put_u32(mask, OVS_KEY_ATTR_SKB_MARK, UINT32_MAX); + if (ovs_scan(s, "%"SCNi32"%n", key, &n)) { + int len = n; + + if (mask) { + if (ovs_scan(s + len, "/%"SCNi32"%n", mask, &n)) { + len += n; + } else { + *mask = UINT32_MAX; } - return n; } + return len; } + return 0; +} - { - uint32_t recirc_id; - int n = -1; +static int +scan_be16(const char *s, ovs_be16 *key, ovs_be16 *mask) +{ + uint16_t key_, mask_; + int n; - if (ovs_scan(s, "recirc_id(%"SCNi32")%n", &recirc_id, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_RECIRC_ID, recirc_id); - if (mask) { - nl_msg_put_u32(mask, OVS_KEY_ATTR_RECIRC_ID, UINT32_MAX); + if (ovs_scan(s, "%"SCNi16"%n", &key_, &n)) { + int len = n; + + *key = htons(key_); + if (mask) { + if (ovs_scan(s + len, "/%"SCNi16"%n", &mask_, &n)) { + len += n; + *mask = htons(mask_); + } else { + *mask = OVS_BE16_MAX; } - return n; } + return len; } + return 0; +} - { - uint32_t dp_hash; - uint32_t dp_hash_mask; - int n = -1; +static int +scan_be64(const char *s, ovs_be64 *key, ovs_be64 *mask) +{ + uint64_t key_, mask_; + int n; - if (mask && ovs_scan(s, "dp_hash(%"SCNi32"/%"SCNi32")%n", &dp_hash, - &dp_hash_mask, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_DP_HASH, dp_hash); - nl_msg_put_u32(mask, OVS_KEY_ATTR_DP_HASH, dp_hash_mask); - return n; - } else if (ovs_scan(s, "dp_hash(%"SCNi32")%n", &dp_hash, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_DP_HASH, dp_hash); - if (mask) { - nl_msg_put_u32(mask, OVS_KEY_ATTR_DP_HASH, UINT32_MAX); + if (ovs_scan(s, "%"SCNi64"%n", &key_, &n)) { + int len = n; + + *key = htonll(key_); + if (mask) { + if (ovs_scan(s + len, "/%"SCNi64"%n", &mask_, &n)) { + len += n; + *mask = htonll(mask_); + } else { + *mask = OVS_BE64_MAX; } - return n; } + return len; } + return 0; +} - { - uint64_t tun_id, tun_id_mask; - struct flow_tnl tun_key, tun_key_mask; - int n = -1; +static int +scan_tun_flags(const char *s, uint16_t *key, uint16_t *mask) +{ + uint32_t flags, fmask; + int n; - if (mask && ovs_scan(s, "tunnel(tun_id=%"SCNi64"/%"SCNi64"," - "src="IP_SCAN_FMT"/"IP_SCAN_FMT",dst="IP_SCAN_FMT - "/"IP_SCAN_FMT",tos=%"SCNi8"/%"SCNi8"," - "ttl=%"SCNi8"/%"SCNi8",flags%n", - &tun_id, &tun_id_mask, - IP_SCAN_ARGS(&tun_key.ip_src), - IP_SCAN_ARGS(&tun_key_mask.ip_src), - IP_SCAN_ARGS(&tun_key.ip_dst), - IP_SCAN_ARGS(&tun_key_mask.ip_dst), - &tun_key.ip_tos, &tun_key_mask.ip_tos, - &tun_key.ip_ttl, &tun_key_mask.ip_ttl, &n)) { - int res; - uint32_t flags; + n = parse_flags(s, flow_tun_flag_to_string, &flags, + FLOW_TNL_F_MASK, mask ? &fmask : NULL); + if (n >= 0 && s[n] == ')') { + *key = flags; + if (mask) { + *mask = fmask; + } + return n + 1; + } + return 0; +} - tun_key.tun_id = htonll(tun_id); - tun_key_mask.tun_id = htonll(tun_id_mask); - res = parse_flags(&s[n], flow_tun_flag_to_string, &flags); - tun_key.flags = flags; - tun_key_mask.flags = UINT16_MAX; +static int +scan_tcp_flags(const char *s, ovs_be16 *key, ovs_be16 *mask) +{ + uint32_t flags, fmask; + int n; - if (res < 0) { - return res; - } - n += res; - if (s[n] != ')') { - return -EINVAL; - } - n++; - tun_key_to_attr(key, &tun_key); - if (mask) { - tun_key_to_attr(mask, &tun_key_mask); - } - return n; - } else if (ovs_scan(s, "tunnel(tun_id=%"SCNi64"," - "src="IP_SCAN_FMT",dst="IP_SCAN_FMT - ",tos=%"SCNi8",ttl=%"SCNi8",flags%n", &tun_id, - IP_SCAN_ARGS(&tun_key.ip_src), - IP_SCAN_ARGS(&tun_key.ip_dst), - &tun_key.ip_tos, &tun_key.ip_ttl, &n)) { - int res; - uint32_t flags; + n = parse_flags(s, packet_tcp_flag_to_string, &flags, + TCP_FLAGS(OVS_BE16_MAX), mask ? &fmask : NULL); + if (n >= 0) { + *key = htons(flags); + if (mask) { + *mask = htons(fmask); + } + return n; + } + return 0; +} - tun_key.tun_id = htonll(tun_id); - res = parse_flags(&s[n], flow_tun_flag_to_string, &flags); - tun_key.flags = flags; +static int +scan_frag(const char *s, uint8_t *key, uint8_t *mask) +{ + int n; + char frag[8]; + enum ovs_frag_type frag_type; - if (res < 0) { - return res; - } - n += res; - if (s[n] != ')') { - return -EINVAL; - } - n++; - tun_key_to_attr(key, &tun_key); + if (ovs_scan(s, "%7[a-z]%n", frag, &n) + && ovs_frag_type_from_string(frag, &frag_type)) { + int len = n; - if (mask) { - memset(&tun_key, 0xff, sizeof tun_key); - tun_key_to_attr(mask, &tun_key); - } - return n; + *key = frag_type; + if (mask) { + *mask = UINT8_MAX; } + return len; } + return 0; +} - { - uint32_t in_port; - uint32_t in_port_mask; - int n = -1; +static int +scan_port(const char *s, uint32_t *key, uint32_t *mask, + const struct simap *port_names) +{ + int n; - if (mask && ovs_scan(s, "in_port(%"SCNi32"/%"SCNi32")%n", - &in_port, &in_port_mask, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_IN_PORT, in_port); - nl_msg_put_u32(mask, OVS_KEY_ATTR_IN_PORT, in_port_mask); - return n; - } else if (ovs_scan(s, "in_port(%"SCNi32")%n", &in_port, &n)) { - nl_msg_put_u32(key, OVS_KEY_ATTR_IN_PORT, in_port); - if (mask) { - nl_msg_put_u32(mask, OVS_KEY_ATTR_IN_PORT, UINT32_MAX); + if (ovs_scan(s, "%"SCNi32"%n", key, &n)) { + int len = n; + + if (mask) { + if (ovs_scan(s + len, "/%"SCNi32"%n", mask, &n)) { + len += n; + } else { + *mask = UINT32_MAX; } - return n; } - } - - - if (port_names && !strncmp(s, "in_port(", 8)) { - const char *name; + return len; + } else if (port_names) { const struct simap_node *node; - int name_len; + int len; - name = s + 8; - name_len = strcspn(name, ")"); - node = simap_find_len(port_names, name, name_len); + len = strcspn(s, ")"); + node = simap_find_len(port_names, s, len); if (node) { - nl_msg_put_u32(key, OVS_KEY_ATTR_IN_PORT, node->data); + *key = node->data; if (mask) { - nl_msg_put_u32(mask, OVS_KEY_ATTR_IN_PORT, UINT32_MAX); + *mask = UINT32_MAX; } - return 8 + name_len + 1; + return len; } } + return 0; +} - { - struct ovs_key_ethernet eth_key; - struct ovs_key_ethernet eth_key_mask; - int n = -1; +/* Helper for vlan parsing. */ +struct ovs_key_vlan__ { + ovs_be16 tci; +}; - if (mask && ovs_scan(s, - "eth(src="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT"," - "dst="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT")%n", - ETH_ADDR_SCAN_ARGS(eth_key.eth_src), - ETH_ADDR_SCAN_ARGS(eth_key_mask.eth_src), - ETH_ADDR_SCAN_ARGS(eth_key.eth_dst), - ETH_ADDR_SCAN_ARGS(eth_key_mask.eth_dst), &n)) { - nl_msg_put_unspec(key, OVS_KEY_ATTR_ETHERNET, - ð_key, sizeof eth_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ETHERNET, - ð_key_mask, sizeof eth_key_mask); - return n; - } else if (ovs_scan(s, "eth(src="ETH_ADDR_SCAN_FMT"," - "dst="ETH_ADDR_SCAN_FMT")%n", - ETH_ADDR_SCAN_ARGS(eth_key.eth_src), - ETH_ADDR_SCAN_ARGS(eth_key.eth_dst), &n)) { - nl_msg_put_unspec(key, OVS_KEY_ATTR_ETHERNET, - ð_key, sizeof eth_key); +static bool +set_be16_bf(ovs_be16 *bf, uint8_t bits, uint8_t offset, uint16_t value) +{ + const uint16_t mask = ((1U << bits) - 1) << offset; - if (mask) { - memset(ð_key, 0xff, sizeof eth_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ETHERNET, - ð_key, sizeof eth_key); - } - return n; - } + if (value >> bits) { + return false; } - { - int vid, vid_mask; - int pcp, pcp_mask; - int cfi, cfi_mask; - int n = -1; + *bf = htons((ntohs(*bf) & ~mask) | (value << offset)); + return true; +} - if (mask && ovs_scan(s, "vlan(vid=%i/%i,pcp=%i/%i)%n", - &vid, &vid_mask, &pcp, &pcp_mask, &n)) { - nl_msg_put_be16(key, OVS_KEY_ATTR_VLAN, - htons((vid << VLAN_VID_SHIFT) | - (pcp << VLAN_PCP_SHIFT) | - VLAN_CFI)); - nl_msg_put_be16(mask, OVS_KEY_ATTR_VLAN, - htons((vid_mask << VLAN_VID_SHIFT) | - (pcp_mask << VLAN_PCP_SHIFT) | - (1 << VLAN_CFI_SHIFT))); - return n; - } else if (ovs_scan(s, "vlan(vid=%i,pcp=%i)%n", &vid, &pcp, &n)) { - nl_msg_put_be16(key, OVS_KEY_ATTR_VLAN, - htons((vid << VLAN_VID_SHIFT) | - (pcp << VLAN_PCP_SHIFT) | - VLAN_CFI)); - if (mask) { - nl_msg_put_be16(mask, OVS_KEY_ATTR_VLAN, OVS_BE16_MAX); - } - return n; - } else if (mask - && ovs_scan(s, "vlan(vid=%i/%i,pcp=%i/%i,cfi=%i/%i)%n", - &vid, &vid_mask, &pcp, &pcp_mask, - &cfi, &cfi_mask, &n)) { - nl_msg_put_be16(key, OVS_KEY_ATTR_VLAN, - htons((vid << VLAN_VID_SHIFT) | - (pcp << VLAN_PCP_SHIFT) | - (cfi ? VLAN_CFI : 0))); - nl_msg_put_be16(mask, OVS_KEY_ATTR_VLAN, - htons((vid_mask << VLAN_VID_SHIFT) | - (pcp_mask << VLAN_PCP_SHIFT) | - (cfi_mask << VLAN_CFI_SHIFT))); - return n; - } else if (ovs_scan(s, "vlan(vid=%i,pcp=%i,cfi=%i)%n", - &vid, &pcp, &cfi, &n)) { - nl_msg_put_be16(key, OVS_KEY_ATTR_VLAN, - htons((vid << VLAN_VID_SHIFT) | - (pcp << VLAN_PCP_SHIFT) | - (cfi ? VLAN_CFI : 0))); +static int +scan_be16_bf(const char *s, ovs_be16 *key, ovs_be16 *mask, uint8_t bits, + uint8_t offset) +{ + uint16_t key_, mask_; + int n; + + if (ovs_scan(s, "%"SCNi16"%n", &key_, &n)) { + int len = n; + + if (set_be16_bf(key, bits, offset, key_)) { if (mask) { - nl_msg_put_be16(mask, OVS_KEY_ATTR_VLAN, OVS_BE16_MAX); + if (ovs_scan(s + len, "/%"SCNi16"%n", &mask_, &n)) { + len += n; + + if (!set_be16_bf(mask, bits, offset, mask_)) { + return 0; + } + } else { + *mask |= htons(((1U << bits) - 1) << offset); + } } - return n; + return len; } } + return 0; +} - { - int eth_type; - int eth_type_mask; - int n = -1; +static int +scan_vid(const char *s, ovs_be16 *key, ovs_be16 *mask) +{ + return scan_be16_bf(s, key, mask, 12, VLAN_VID_SHIFT); +} - if (mask && ovs_scan(s, "eth_type(%i/%i)%n", - ð_type, ð_type_mask, &n)) { - if (eth_type != 0) { - nl_msg_put_be16(key, OVS_KEY_ATTR_ETHERTYPE, htons(eth_type)); - } - nl_msg_put_be16(mask, OVS_KEY_ATTR_ETHERTYPE, htons(eth_type_mask)); - return n; - } else if (ovs_scan(s, "eth_type(%i)%n", ð_type, &n)) { - nl_msg_put_be16(key, OVS_KEY_ATTR_ETHERTYPE, htons(eth_type)); - if (mask) { - nl_msg_put_be16(mask, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX); - } - return n; - } +static int +scan_pcp(const char *s, ovs_be16 *key, ovs_be16 *mask) +{ + return scan_be16_bf(s, key, mask, 3, VLAN_PCP_SHIFT); +} + +static int +scan_cfi(const char *s, ovs_be16 *key, ovs_be16 *mask) +{ + return scan_be16_bf(s, key, mask, 1, VLAN_CFI_SHIFT); +} + +/* For MPLS. */ +static bool +set_be32_bf(ovs_be32 *bf, uint8_t bits, uint8_t offset, uint32_t value) +{ + const uint32_t mask = ((1U << bits) - 1) << offset; + + if (value >> bits) { + return false; } - { - int label, tc, ttl, bos; - int label_mask, tc_mask, ttl_mask, bos_mask; - int n = -1; + *bf = htonl((ntohl(*bf) & ~mask) | (value << offset)); + return true; +} - if (mask && ovs_scan(s, "mpls(label=%i/%i,tc=%i/%i," - "ttl=%i/%i,bos=%i/%i)%n", - &label, &label_mask, &tc, &tc_mask, - &ttl, &ttl_mask, &bos, &bos_mask, &n)) { - struct ovs_key_mpls *mpls, *mpls_mask; - - mpls = nl_msg_put_unspec_uninit(key, OVS_KEY_ATTR_MPLS, - sizeof *mpls); - mpls->mpls_lse = mpls_lse_from_components(label, tc, ttl, bos); - - mpls_mask = nl_msg_put_unspec_uninit(mask, OVS_KEY_ATTR_MPLS, - sizeof *mpls_mask); - mpls_mask->mpls_lse = mpls_lse_from_components( - label_mask, tc_mask, ttl_mask, bos_mask); - return n; - } else if (ovs_scan(s, "mpls(label=%i,tc=%i,ttl=%i,bos=%i)%n", - &label, &tc, &ttl, &bos, &n)) { - struct ovs_key_mpls *mpls; - - mpls = nl_msg_put_unspec_uninit(key, OVS_KEY_ATTR_MPLS, - sizeof *mpls); - mpls->mpls_lse = mpls_lse_from_components(label, tc, ttl, bos); +static int +scan_be32_bf(const char *s, ovs_be32 *key, ovs_be32 *mask, uint8_t bits, + uint8_t offset) +{ + uint32_t key_, mask_; + int n; + + if (ovs_scan(s, "%"SCNi32"%n", &key_, &n)) { + int len = n; + + if (set_be32_bf(key, bits, offset, key_)) { if (mask) { - mpls = nl_msg_put_unspec_uninit(mask, OVS_KEY_ATTR_MPLS, - sizeof *mpls); - mpls->mpls_lse = OVS_BE32_MAX; + if (ovs_scan(s + len, "/%"SCNi32"%n", &mask_, &n)) { + len += n; + + if (!set_be32_bf(mask, bits, offset, mask_)) { + return 0; + } + } else { + *mask |= htonl(((1U << bits) - 1) << offset); + } } - return n; + return len; } } + return 0; +} +static int +scan_mpls_label(const char *s, ovs_be32 *key, ovs_be32 *mask) +{ + return scan_be32_bf(s, key, mask, 20, MPLS_LABEL_SHIFT); +} - { - struct ovs_key_ipv4 ipv4_key; - struct ovs_key_ipv4 ipv4_mask; +static int +scan_mpls_tc(const char *s, ovs_be32 *key, ovs_be32 *mask) +{ + return scan_be32_bf(s, key, mask, 3, MPLS_TC_SHIFT); +} - char frag[8]; - enum ovs_frag_type ipv4_frag; - int n = -1; +static int +scan_mpls_ttl(const char *s, ovs_be32 *key, ovs_be32 *mask) +{ + return scan_be32_bf(s, key, mask, 8, MPLS_TTL_SHIFT); +} - if (mask - && ovs_scan(s, "ipv4(src="IP_SCAN_FMT"/"IP_SCAN_FMT"," - "dst="IP_SCAN_FMT"/"IP_SCAN_FMT"," - "proto=%"SCNi8"/%"SCNi8"," - "tos=%"SCNi8"/%"SCNi8"," - "ttl=%"SCNi8"/%"SCNi8"," - "frag=%7[a-z]/%"SCNi8")%n", - IP_SCAN_ARGS(&ipv4_key.ipv4_src), - IP_SCAN_ARGS(&ipv4_mask.ipv4_src), - IP_SCAN_ARGS(&ipv4_key.ipv4_dst), - IP_SCAN_ARGS(&ipv4_mask.ipv4_dst), - &ipv4_key.ipv4_proto, &ipv4_mask.ipv4_proto, - &ipv4_key.ipv4_tos, &ipv4_mask.ipv4_tos, - &ipv4_key.ipv4_ttl, &ipv4_mask.ipv4_ttl, - frag, &ipv4_mask.ipv4_frag, &n) - && ovs_frag_type_from_string(frag, &ipv4_frag)) { - ipv4_key.ipv4_frag = ipv4_frag; - nl_msg_put_unspec(key, OVS_KEY_ATTR_IPV4, - &ipv4_key, sizeof ipv4_key); +static int +scan_mpls_bos(const char *s, ovs_be32 *key, ovs_be32 *mask) +{ + return scan_be32_bf(s, key, mask, 1, MPLS_BOS_SHIFT); +} - nl_msg_put_unspec(mask, OVS_KEY_ATTR_IPV4, - &ipv4_mask, sizeof ipv4_mask); - return n; - } else if (ovs_scan(s, "ipv4(src="IP_SCAN_FMT",dst="IP_SCAN_FMT"," - "proto=%"SCNi8",tos=%"SCNi8",ttl=%"SCNi8"," - "frag=%7[a-z])%n", - IP_SCAN_ARGS(&ipv4_key.ipv4_src), - IP_SCAN_ARGS(&ipv4_key.ipv4_dst), - &ipv4_key.ipv4_proto, - &ipv4_key.ipv4_tos, - &ipv4_key.ipv4_ttl, - frag, &n) > 0 - && ovs_frag_type_from_string(frag, &ipv4_frag)) { - ipv4_key.ipv4_frag = ipv4_frag; - nl_msg_put_unspec(key, OVS_KEY_ATTR_IPV4, - &ipv4_key, sizeof ipv4_key); +static int +scan_vxlan_gbp(const char *s, uint32_t *key, uint32_t *mask) +{ + const char *s_base = s; + ovs_be16 id = 0, id_mask = 0; + uint8_t flags = 0, flags_mask = 0; - if (mask) { - memset(&ipv4_key, 0xff, sizeof ipv4_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_IPV4, - &ipv4_key, sizeof ipv4_key); - } - return n; - } + if (!strncmp(s, "id=", 3)) { + s += 3; + s += scan_be16(s, &id, mask ? &id_mask : NULL); } - { - char ipv6_src_s[IPV6_SCAN_LEN + 1]; - char ipv6_src_mask_s[IPV6_SCAN_LEN + 1]; - char ipv6_dst_s[IPV6_SCAN_LEN + 1]; - char ipv6_dst_mask_s[IPV6_SCAN_LEN + 1]; - int ipv6_label, ipv6_label_mask; - int ipv6_proto, ipv6_proto_mask; - int ipv6_tclass, ipv6_tclass_mask; - int ipv6_hlimit, ipv6_hlimit_mask; - char frag[8]; - enum ovs_frag_type ipv6_frag; - int ipv6_frag_mask; - int n = -1; - - if (mask && ovs_scan(s, "ipv6(src="IPV6_SCAN_FMT"/"IPV6_SCAN_FMT",dst=" - IPV6_SCAN_FMT"/"IPV6_SCAN_FMT"," - "label=%i/%i,proto=%i/%i,tclass=%i/%i," - "hlimit=%i/%i,frag=%7[a-z]/%i)%n", - ipv6_src_s, ipv6_src_mask_s, - ipv6_dst_s, ipv6_dst_mask_s, - &ipv6_label, &ipv6_label_mask, &ipv6_proto, - &ipv6_proto_mask, &ipv6_tclass, &ipv6_tclass_mask, - &ipv6_hlimit, &ipv6_hlimit_mask, frag, - &ipv6_frag_mask, &n) - && ovs_frag_type_from_string(frag, &ipv6_frag)) { - struct ovs_key_ipv6 ipv6_key; - struct ovs_key_ipv6 ipv6_mask; - - if (inet_pton(AF_INET6, ipv6_src_s, &ipv6_key.ipv6_src) != 1 || - inet_pton(AF_INET6, ipv6_dst_s, &ipv6_key.ipv6_dst) != 1 || - inet_pton(AF_INET6, ipv6_src_mask_s, &ipv6_mask.ipv6_src) != 1 || - inet_pton(AF_INET6, ipv6_dst_mask_s, &ipv6_mask.ipv6_dst) != 1) { - return -EINVAL; - } - - ipv6_key.ipv6_label = htonl(ipv6_label); - ipv6_key.ipv6_proto = ipv6_proto; - ipv6_key.ipv6_tclass = ipv6_tclass; - ipv6_key.ipv6_hlimit = ipv6_hlimit; - ipv6_key.ipv6_frag = ipv6_frag; - nl_msg_put_unspec(key, OVS_KEY_ATTR_IPV6, - &ipv6_key, sizeof ipv6_key); - - ipv6_mask.ipv6_label = htonl(ipv6_label_mask); - ipv6_mask.ipv6_proto = ipv6_proto_mask; - ipv6_mask.ipv6_tclass = ipv6_tclass_mask; - ipv6_mask.ipv6_hlimit = ipv6_hlimit_mask; - ipv6_mask.ipv6_frag = ipv6_frag_mask; - nl_msg_put_unspec(mask, OVS_KEY_ATTR_IPV6, - &ipv6_mask, sizeof ipv6_mask); - return n; - } else if (ovs_scan(s, "ipv6(src="IPV6_SCAN_FMT",dst="IPV6_SCAN_FMT"," - "label=%i,proto=%i,tclass=%i,hlimit=%i," - "frag=%7[a-z])%n", - ipv6_src_s, ipv6_dst_s, &ipv6_label, - &ipv6_proto, &ipv6_tclass, &ipv6_hlimit, frag, &n) - && ovs_frag_type_from_string(frag, &ipv6_frag)) { - struct ovs_key_ipv6 ipv6_key; + if (s[0] == ',') { + s++; + } + if (!strncmp(s, "flags=", 6)) { + s += 6; + s += scan_u8(s, &flags, mask ? &flags_mask : NULL); + } - if (inet_pton(AF_INET6, ipv6_src_s, &ipv6_key.ipv6_src) != 1 || - inet_pton(AF_INET6, ipv6_dst_s, &ipv6_key.ipv6_dst) != 1) { - return -EINVAL; - } - ipv6_key.ipv6_label = htonl(ipv6_label); - ipv6_key.ipv6_proto = ipv6_proto; - ipv6_key.ipv6_tclass = ipv6_tclass; - ipv6_key.ipv6_hlimit = ipv6_hlimit; - ipv6_key.ipv6_frag = ipv6_frag; - nl_msg_put_unspec(key, OVS_KEY_ATTR_IPV6, - &ipv6_key, sizeof ipv6_key); + if (!strncmp(s, "))", 2)) { + s += 2; - if (mask) { - memset(&ipv6_key, 0xff, sizeof ipv6_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_IPV6, - &ipv6_key, sizeof ipv6_key); - } - return n; + *key = (flags << 16) | ntohs(id); + if (mask) { + *mask = (flags_mask << 16) | ntohs(id_mask); } + + return s - s_base; } - { - int tcp_src; - int tcp_dst; - int tcp_src_mask; - int tcp_dst_mask; - int n = -1; + return 0; +} - if (mask && ovs_scan(s, "tcp(src=%i/%i,dst=%i/%i)%n", - &tcp_src, &tcp_src_mask, &tcp_dst, - &tcp_dst_mask, &n)) { - struct ovs_key_tcp tcp_key; - struct ovs_key_tcp tcp_mask; - - tcp_key.tcp_src = htons(tcp_src); - tcp_key.tcp_dst = htons(tcp_dst); - nl_msg_put_unspec(key, OVS_KEY_ATTR_TCP, &tcp_key, sizeof tcp_key); - - tcp_mask.tcp_src = htons(tcp_src_mask); - tcp_mask.tcp_dst = htons(tcp_dst_mask); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_TCP, - &tcp_mask, sizeof tcp_mask); - return n; - } else if (ovs_scan(s, "tcp(src=%i,dst=%i)%n", - &tcp_src, &tcp_dst, &n)) { - struct ovs_key_tcp tcp_key; - - tcp_key.tcp_src = htons(tcp_src); - tcp_key.tcp_dst = htons(tcp_dst); - nl_msg_put_unspec(key, OVS_KEY_ATTR_TCP, &tcp_key, sizeof tcp_key); +struct geneve_scan { + struct geneve_opt d[63]; + int len; +}; - if (mask) { - memset(&tcp_key, 0xff, sizeof tcp_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_TCP, - &tcp_key, sizeof tcp_key); - } - return n; - } - } +static int +scan_geneve(const char *s, struct geneve_scan *key, struct geneve_scan *mask) +{ + const char *s_base = s; + struct geneve_opt *opt = key->d; + struct geneve_opt *opt_mask = mask ? mask->d : NULL; + int len_remain = sizeof key->d; - { - uint16_t tcp_flags, tcp_flags_mask; - int n = -1; + while (s[0] == '{' && len_remain >= sizeof *opt) { + int data_len = 0; - if (mask && ovs_scan(s, "tcp_flags(%"SCNi16"/%"SCNi16")%n", - &tcp_flags, &tcp_flags_mask, &n) > 0 && n > 0) { - nl_msg_put_be16(key, OVS_KEY_ATTR_TCP_FLAGS, htons(tcp_flags)); - nl_msg_put_be16(mask, OVS_KEY_ATTR_TCP_FLAGS, htons(tcp_flags_mask)); - return n; - } else if (ovs_scan(s, "tcp_flags(%"SCNi16")%n", &tcp_flags, &n)) { - nl_msg_put_be16(key, OVS_KEY_ATTR_TCP_FLAGS, htons(tcp_flags)); - if (mask) { - nl_msg_put_be16(mask, OVS_KEY_ATTR_TCP_FLAGS, - htons(UINT16_MAX)); - } - return n; - } - } + s++; + len_remain -= sizeof *opt; - { - int udp_src; - int udp_dst; - int udp_src_mask; - int udp_dst_mask; - int n = -1; + if (!strncmp(s, "class=", 6)) { + s += 6; + s += scan_be16(s, &opt->opt_class, + mask ? &opt_mask->opt_class : NULL); + } else if (mask) { + memset(&opt_mask->opt_class, 0, sizeof opt_mask->opt_class); + } - if (mask && ovs_scan(s, "udp(src=%i/%i,dst=%i/%i)%n", - &udp_src, &udp_src_mask, - &udp_dst, &udp_dst_mask, &n)) { - struct ovs_key_udp udp_key; - struct ovs_key_udp udp_mask; - - udp_key.udp_src = htons(udp_src); - udp_key.udp_dst = htons(udp_dst); - nl_msg_put_unspec(key, OVS_KEY_ATTR_UDP, &udp_key, sizeof udp_key); - - udp_mask.udp_src = htons(udp_src_mask); - udp_mask.udp_dst = htons(udp_dst_mask); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_UDP, - &udp_mask, sizeof udp_mask); - return n; + if (s[0] == ',') { + s++; + } + if (!strncmp(s, "type=", 5)) { + s += 5; + s += scan_u8(s, &opt->type, mask ? &opt_mask->type : NULL); + } else if (mask) { + memset(&opt_mask->type, 0, sizeof opt_mask->type); } - if (ovs_scan(s, "udp(src=%i,dst=%i)%n", &udp_src, &udp_dst, &n)) { - struct ovs_key_udp udp_key; - udp_key.udp_src = htons(udp_src); - udp_key.udp_dst = htons(udp_dst); - nl_msg_put_unspec(key, OVS_KEY_ATTR_UDP, &udp_key, sizeof udp_key); + if (s[0] == ',') { + s++; + } + if (!strncmp(s, "len=", 4)) { + uint8_t opt_len, opt_len_mask; + s += 4; + s += scan_u8(s, &opt_len, mask ? &opt_len_mask : NULL); + if (opt_len > 124 || opt_len % 4 || opt_len > len_remain) { + return 0; + } + opt->length = opt_len / 4; if (mask) { - memset(&udp_key, 0xff, sizeof udp_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_UDP, &udp_key, sizeof udp_key); + opt_mask->length = opt_len_mask; } - return n; + data_len = opt_len; + } else if (mask) { + memset(&opt_mask->type, 0, sizeof opt_mask->type); } - } - { - int sctp_src; - int sctp_dst; - int sctp_src_mask; - int sctp_dst_mask; - int n = -1; - - if (mask && ovs_scan(s, "sctp(src=%i/%i,dst=%i/%i)%n", - &sctp_src, &sctp_src_mask, - &sctp_dst, &sctp_dst_mask, &n)) { - struct ovs_key_sctp sctp_key; - struct ovs_key_sctp sctp_mask; - - sctp_key.sctp_src = htons(sctp_src); - sctp_key.sctp_dst = htons(sctp_dst); - nl_msg_put_unspec(key, OVS_KEY_ATTR_SCTP, &sctp_key, sizeof sctp_key); - - sctp_mask.sctp_src = htons(sctp_src_mask); - sctp_mask.sctp_dst = htons(sctp_dst_mask); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_SCTP, - &sctp_mask, sizeof sctp_mask); - return n; + if (s[0] == ',') { + s++; + } + if (parse_int_string(s, (uint8_t *)(opt + 1), data_len, (char **)&s)) { + return 0; } - if (ovs_scan(s, "sctp(src=%i,dst=%i)%n", &sctp_src, &sctp_dst, &n)) { - struct ovs_key_sctp sctp_key; - sctp_key.sctp_src = htons(sctp_src); - sctp_key.sctp_dst = htons(sctp_dst); - nl_msg_put_unspec(key, OVS_KEY_ATTR_SCTP, &sctp_key, sizeof sctp_key); + if (mask) { + if (s[0] == '/') { + s++; + if (parse_int_string(s, (uint8_t *)(opt_mask + 1), + data_len, (char **)&s)) { + return 0; + } + } + opt_mask->r1 = 0; + opt_mask->r2 = 0; + opt_mask->r3 = 0; + } + if (s[0] == '}') { + s++; + opt += 1 + data_len / 4; if (mask) { - memset(&sctp_key, 0xff, sizeof sctp_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_SCTP, &sctp_key, sizeof sctp_key); + opt_mask += 1 + data_len / 4; } - return n; + len_remain -= data_len; } } - { - struct ovs_key_icmp icmp_key; - struct ovs_key_icmp icmp_mask; - int n = -1; + if (s[0] == ')') { + int len = sizeof key->d - len_remain; - if (mask && ovs_scan(s, "icmp(type=%"SCNi8"/%"SCNi8"," - "code=%"SCNi8"/%"SCNi8")%n", - &icmp_key.icmp_type, &icmp_mask.icmp_type, - &icmp_key.icmp_code, &icmp_mask.icmp_code, &n)) { - nl_msg_put_unspec(key, OVS_KEY_ATTR_ICMP, - &icmp_key, sizeof icmp_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ICMP, - &icmp_mask, sizeof icmp_mask); - return n; - } else if (ovs_scan(s, "icmp(type=%"SCNi8",code=%"SCNi8")%n", - &icmp_key.icmp_type, &icmp_key.icmp_code, &n)) { - nl_msg_put_unspec(key, OVS_KEY_ATTR_ICMP, - &icmp_key, sizeof icmp_key); - if (mask) { - memset(&icmp_key, 0xff, sizeof icmp_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ICMP, &icmp_key, - sizeof icmp_key); - } - return n; + s++; + key->len = len; + if (mask) { + mask->len = len; } + return s - s_base; } - { - struct ovs_key_icmpv6 icmpv6_key; - struct ovs_key_icmpv6 icmpv6_mask; - int n = -1; + return 0; +} - if (mask && ovs_scan(s, "icmpv6(type=%"SCNi8"/%"SCNi8"," - "code=%"SCNi8"/%"SCNi8")%n", - &icmpv6_key.icmpv6_type, &icmpv6_mask.icmpv6_type, - &icmpv6_key.icmpv6_code, &icmpv6_mask.icmpv6_code, - &n)) { - nl_msg_put_unspec(key, OVS_KEY_ATTR_ICMPV6, - &icmpv6_key, sizeof icmpv6_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ICMPV6, &icmpv6_mask, - sizeof icmpv6_mask); - return n; - } else if (ovs_scan(s, "icmpv6(type=%"SCNi8",code=%"SCNi8")%n", - &icmpv6_key.icmpv6_type, &icmpv6_key.icmpv6_code, - &n)) { - nl_msg_put_unspec(key, OVS_KEY_ATTR_ICMPV6, - &icmpv6_key, sizeof icmpv6_key); +static void +tun_flags_to_attr(struct ofpbuf *a, const void *data_) +{ + const uint16_t *flags = data_; - if (mask) { - memset(&icmpv6_key, 0xff, sizeof icmpv6_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ICMPV6, &icmpv6_key, - sizeof icmpv6_key); - } - return n; - } + if (*flags & FLOW_TNL_F_DONT_FRAGMENT) { + nl_msg_put_flag(a, OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT); + } + if (*flags & FLOW_TNL_F_CSUM) { + nl_msg_put_flag(a, OVS_TUNNEL_KEY_ATTR_CSUM); + } + if (*flags & FLOW_TNL_F_OAM) { + nl_msg_put_flag(a, OVS_TUNNEL_KEY_ATTR_OAM); } +} - { - struct ovs_key_arp arp_key; - struct ovs_key_arp arp_mask; - uint16_t arp_op, arp_op_mask; - int n = -1; +static void +vxlan_gbp_to_attr(struct ofpbuf *a, const void *data_) +{ + const uint32_t *gbp = data_; - if (mask && ovs_scan(s, "arp(sip="IP_SCAN_FMT"/"IP_SCAN_FMT"," - "tip="IP_SCAN_FMT"/"IP_SCAN_FMT"," - "op=%"SCNi16"/%"SCNi16"," - "sha="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT"," - "tha="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT")%n", - IP_SCAN_ARGS(&arp_key.arp_sip), - IP_SCAN_ARGS(&arp_mask.arp_sip), - IP_SCAN_ARGS(&arp_key.arp_tip), - IP_SCAN_ARGS(&arp_mask.arp_tip), - &arp_op, &arp_op_mask, - ETH_ADDR_SCAN_ARGS(arp_key.arp_sha), - ETH_ADDR_SCAN_ARGS(arp_mask.arp_sha), - ETH_ADDR_SCAN_ARGS(arp_key.arp_tha), - ETH_ADDR_SCAN_ARGS(arp_mask.arp_tha), &n)) { - arp_key.arp_op = htons(arp_op); - nl_msg_put_unspec(key, OVS_KEY_ATTR_ARP, &arp_key, sizeof arp_key); - arp_mask.arp_op = htons(arp_op_mask); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ARP, - &arp_mask, sizeof arp_mask); - return n; - } else if (ovs_scan(s, "arp(sip="IP_SCAN_FMT",tip="IP_SCAN_FMT"," - "op=%"SCNi16",sha="ETH_ADDR_SCAN_FMT"," - "tha="ETH_ADDR_SCAN_FMT")%n", - IP_SCAN_ARGS(&arp_key.arp_sip), - IP_SCAN_ARGS(&arp_key.arp_tip), - &arp_op, - ETH_ADDR_SCAN_ARGS(arp_key.arp_sha), - ETH_ADDR_SCAN_ARGS(arp_key.arp_tha), &n)) { - arp_key.arp_op = htons(arp_op); - nl_msg_put_unspec(key, OVS_KEY_ATTR_ARP, &arp_key, sizeof arp_key); + if (*gbp) { + size_t vxlan_opts_ofs; - if (mask) { - memset(&arp_key, 0xff, sizeof arp_key); - nl_msg_put_unspec(mask, OVS_KEY_ATTR_ARP, - &arp_key, sizeof arp_key); - } - return n; - } + vxlan_opts_ofs = nl_msg_start_nested(a, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS); + nl_msg_put_u32(a, OVS_VXLAN_EXT_GBP, *gbp); + nl_msg_end_nested(a, vxlan_opts_ofs); } +} - { - char nd_target_s[IPV6_SCAN_LEN + 1]; - char nd_target_mask_s[IPV6_SCAN_LEN + 1]; - uint8_t nd_sll[ETH_ADDR_LEN]; - uint8_t nd_sll_mask[ETH_ADDR_LEN]; - uint8_t nd_tll[ETH_ADDR_LEN]; - uint8_t nd_tll_mask[ETH_ADDR_LEN]; - int n = -1; +static void +geneve_to_attr(struct ofpbuf *a, const void *data_) +{ + const struct geneve_scan *geneve = data_; - nd_target_mask_s[0] = 0; - memset(nd_sll_mask, 0xff, sizeof nd_sll_mask); - memset(nd_tll_mask, 0xff, sizeof nd_tll_mask); - - if (mask && ovs_scan(s, "nd(target="IPV6_SCAN_FMT"/"IPV6_SCAN_FMT")%n", - nd_target_s, nd_target_mask_s, &n)) { - put_nd_key(n, nd_target_s, NULL, NULL, key); - put_nd_mask(n, nd_target_mask_s, NULL, NULL, mask); - } else if (ovs_scan(s, "nd(target="IPV6_SCAN_FMT")%n", - nd_target_s, &n)) { - put_nd_key(n, nd_target_s, NULL, NULL, key); - if (mask) { - put_nd_mask(n, nd_target_mask_s, NULL, NULL, mask); - } - } else if (mask && - ovs_scan(s, "nd(target="IPV6_SCAN_FMT"/"IPV6_SCAN_FMT - ",sll="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT")%n", - nd_target_s, nd_target_mask_s, - ETH_ADDR_SCAN_ARGS(nd_sll), - ETH_ADDR_SCAN_ARGS(nd_sll_mask), &n)) { - put_nd_key(n, nd_target_s, nd_sll, NULL, key); - put_nd_mask(n, nd_target_mask_s, nd_sll_mask, NULL, mask); - } else if (ovs_scan(s, "nd(target="IPV6_SCAN_FMT"," - "sll="ETH_ADDR_SCAN_FMT")%n", - nd_target_s, ETH_ADDR_SCAN_ARGS(nd_sll), &n)) { - put_nd_key(n, nd_target_s, nd_sll, NULL, key); - if (mask) { - put_nd_mask(n, nd_target_mask_s, nd_sll_mask, NULL, mask); - } - } else if (mask && - ovs_scan(s, "nd(target="IPV6_SCAN_FMT"/"IPV6_SCAN_FMT - ",tll="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT")%n", - nd_target_s, nd_target_mask_s, - ETH_ADDR_SCAN_ARGS(nd_tll), - ETH_ADDR_SCAN_ARGS(nd_tll_mask), &n)) { - put_nd_key(n, nd_target_s, NULL, nd_tll, key); - put_nd_mask(n, nd_target_mask_s, NULL, nd_tll_mask, mask); - } else if (ovs_scan(s, "nd(target="IPV6_SCAN_FMT"," - "tll="ETH_ADDR_SCAN_FMT")%n", - nd_target_s, ETH_ADDR_SCAN_ARGS(nd_tll), &n)) { - put_nd_key(n, nd_target_s, NULL, nd_tll, key); - if (mask) { - put_nd_mask(n, nd_target_mask_s, NULL, nd_tll_mask, mask); - } - } else if (mask && - ovs_scan(s, "nd(target="IPV6_SCAN_FMT"/"IPV6_SCAN_FMT - ",sll="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT"," - "tll="ETH_ADDR_SCAN_FMT"/"ETH_ADDR_SCAN_FMT")%n", - nd_target_s, nd_target_mask_s, - ETH_ADDR_SCAN_ARGS(nd_sll), - ETH_ADDR_SCAN_ARGS(nd_sll_mask), - ETH_ADDR_SCAN_ARGS(nd_tll), - ETH_ADDR_SCAN_ARGS(nd_tll_mask), - &n)) { - put_nd_key(n, nd_target_s, nd_sll, nd_tll, key); - put_nd_mask(n, nd_target_mask_s, nd_sll_mask, nd_tll_mask, mask); - } else if (ovs_scan(s, "nd(target="IPV6_SCAN_FMT"," - "sll="ETH_ADDR_SCAN_FMT"," - "tll="ETH_ADDR_SCAN_FMT")%n", - nd_target_s, ETH_ADDR_SCAN_ARGS(nd_sll), - ETH_ADDR_SCAN_ARGS(nd_tll), &n)) { - put_nd_key(n, nd_target_s, nd_sll, nd_tll, key); - if (mask) { - put_nd_mask(n, nd_target_mask_s, - nd_sll_mask, nd_tll_mask, mask); - } - } + nl_msg_put_unspec(a, OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, geneve->d, + geneve->len); +} - if (n != -1) - return n; +#define SCAN_PUT_ATTR(BUF, ATTR, DATA, FUNC) \ + { \ + unsigned long call_fn = (unsigned long)FUNC; \ + if (call_fn) { \ + typedef void (*fn)(struct ofpbuf *, const void *); \ + fn func = FUNC; \ + func(BUF, &(DATA)); \ + } else { \ + nl_msg_put_unspec(BUF, ATTR, &(DATA), sizeof (DATA)); \ + } \ + } + +#define SCAN_IF(NAME) \ + if (strncmp(s, NAME, strlen(NAME)) == 0) { \ + const char *start = s; \ + int len; \ + \ + s += strlen(NAME) + +/* Usually no special initialization is needed. */ +#define SCAN_BEGIN(NAME, TYPE) \ + SCAN_IF(NAME); \ + TYPE skey, smask; \ + memset(&skey, 0, sizeof skey); \ + memset(&smask, 0, sizeof smask); \ + do { \ + len = 0; + +/* Init as fully-masked as mask will not be scanned. */ +#define SCAN_BEGIN_FULLY_MASKED(NAME, TYPE) \ + SCAN_IF(NAME); \ + TYPE skey, smask; \ + memset(&skey, 0, sizeof skey); \ + memset(&smask, 0xff, sizeof smask); \ + do { \ + len = 0; + +/* VLAN needs special initialization. */ +#define SCAN_BEGIN_INIT(NAME, TYPE, KEY_INIT, MASK_INIT) \ + SCAN_IF(NAME); \ + TYPE skey = KEY_INIT; \ + TYPE smask = MASK_INIT; \ + do { \ + len = 0; + +/* Scan unnamed entry as 'TYPE' */ +#define SCAN_TYPE(TYPE, KEY, MASK) \ + len = scan_##TYPE(s, KEY, MASK); \ + if (len == 0) { \ + return -EINVAL; \ + } \ + s += len + +/* Scan named ('NAME') entry 'FIELD' as 'TYPE'. */ +#define SCAN_FIELD(NAME, TYPE, FIELD) \ + if (strncmp(s, NAME, strlen(NAME)) == 0) { \ + s += strlen(NAME); \ + SCAN_TYPE(TYPE, &skey.FIELD, mask ? &smask.FIELD : NULL); \ + continue; \ + } + +#define SCAN_FINISH() \ + } while (*s++ == ',' && len != 0); \ + if (s[-1] != ')') { \ + return -EINVAL; \ + } + +#define SCAN_FINISH_SINGLE() \ + } while (false); \ + if (*s++ != ')') { \ + return -EINVAL; \ + } + +/* Beginning of nested attribute. */ +#define SCAN_BEGIN_NESTED(NAME, ATTR) \ + SCAN_IF(NAME); \ + size_t key_offset, mask_offset; \ + key_offset = nl_msg_start_nested(key, ATTR); \ + if (mask) { \ + mask_offset = nl_msg_start_nested(mask, ATTR); \ + } \ + do { \ + len = 0; + +#define SCAN_END_NESTED() \ + SCAN_FINISH(); \ + nl_msg_end_nested(key, key_offset); \ + if (mask) { \ + nl_msg_end_nested(mask, mask_offset); \ + } \ + return s - start; \ + } + +#define SCAN_FIELD_NESTED__(NAME, TYPE, SCAN_AS, ATTR, FUNC) \ + if (strncmp(s, NAME, strlen(NAME)) == 0) { \ + TYPE skey, smask; \ + memset(&skey, 0, sizeof skey); \ + memset(&smask, 0xff, sizeof smask); \ + s += strlen(NAME); \ + SCAN_TYPE(SCAN_AS, &skey, &smask); \ + SCAN_PUT(ATTR, FUNC); \ + continue; \ + } + +#define SCAN_FIELD_NESTED(NAME, TYPE, SCAN_AS, ATTR) \ + SCAN_FIELD_NESTED__(NAME, TYPE, SCAN_AS, ATTR, NULL) + +#define SCAN_FIELD_NESTED_FUNC(NAME, TYPE, SCAN_AS, FUNC) \ + SCAN_FIELD_NESTED__(NAME, TYPE, SCAN_AS, 0, FUNC) + +#define SCAN_PUT(ATTR, FUNC) \ + if (!mask || !is_all_zeros(&smask, sizeof smask)) { \ + SCAN_PUT_ATTR(key, ATTR, skey, FUNC); \ + if (mask) { \ + SCAN_PUT_ATTR(mask, ATTR, smask, FUNC); \ + } \ + } + +#define SCAN_END(ATTR) \ + SCAN_FINISH(); \ + SCAN_PUT(ATTR, NULL); \ + return s - start; \ + } + +#define SCAN_END_SINGLE(ATTR) \ + SCAN_FINISH_SINGLE(); \ + SCAN_PUT(ATTR, NULL); \ + return s - start; \ + } + +#define SCAN_SINGLE(NAME, TYPE, SCAN_AS, ATTR) \ + SCAN_BEGIN(NAME, TYPE) { \ + SCAN_TYPE(SCAN_AS, &skey, &smask); \ + } SCAN_END_SINGLE(ATTR) + +#define SCAN_SINGLE_FULLY_MASKED(NAME, TYPE, SCAN_AS, ATTR) \ + SCAN_BEGIN_FULLY_MASKED(NAME, TYPE) { \ + SCAN_TYPE(SCAN_AS, &skey, NULL); \ + } SCAN_END_SINGLE(ATTR) + +/* scan_port needs one extra argument. */ +#define SCAN_SINGLE_PORT(NAME, TYPE, ATTR) \ + SCAN_BEGIN(NAME, TYPE) { \ + len = scan_port(s, &skey, &smask, port_names); \ + if (len == 0) { \ + return -EINVAL; \ + } \ + s += len; \ + } SCAN_END_SINGLE(ATTR) + +static int +parse_odp_key_mask_attr(const char *s, const struct simap *port_names, + struct ofpbuf *key, struct ofpbuf *mask) +{ + ovs_u128 ufid; + int len; + /* Skip UFID. */ + len = odp_ufid_from_string(s, &ufid); + if (len) { + return len; } + SCAN_SINGLE("skb_priority(", uint32_t, u32, OVS_KEY_ATTR_PRIORITY); + SCAN_SINGLE("skb_mark(", uint32_t, u32, OVS_KEY_ATTR_SKB_MARK); + SCAN_SINGLE_FULLY_MASKED("recirc_id(", uint32_t, u32, + OVS_KEY_ATTR_RECIRC_ID); + SCAN_SINGLE("dp_hash(", uint32_t, u32, OVS_KEY_ATTR_DP_HASH); + + SCAN_BEGIN_NESTED("tunnel(", OVS_KEY_ATTR_TUNNEL) { + SCAN_FIELD_NESTED("tun_id=", ovs_be64, be64, OVS_TUNNEL_KEY_ATTR_ID); + SCAN_FIELD_NESTED("src=", ovs_be32, ipv4, OVS_TUNNEL_KEY_ATTR_IPV4_SRC); + SCAN_FIELD_NESTED("dst=", ovs_be32, ipv4, OVS_TUNNEL_KEY_ATTR_IPV4_DST); + SCAN_FIELD_NESTED("tos=", uint8_t, u8, OVS_TUNNEL_KEY_ATTR_TOS); + SCAN_FIELD_NESTED("ttl=", uint8_t, u8, OVS_TUNNEL_KEY_ATTR_TTL); + SCAN_FIELD_NESTED("tp_src=", ovs_be16, be16, OVS_TUNNEL_KEY_ATTR_TP_SRC); + SCAN_FIELD_NESTED("tp_dst=", ovs_be16, be16, OVS_TUNNEL_KEY_ATTR_TP_DST); + SCAN_FIELD_NESTED_FUNC("vxlan(gbp(", uint32_t, vxlan_gbp, vxlan_gbp_to_attr); + SCAN_FIELD_NESTED_FUNC("geneve(", struct geneve_scan, geneve, + geneve_to_attr); + SCAN_FIELD_NESTED_FUNC("flags(", uint16_t, tun_flags, tun_flags_to_attr); + } SCAN_END_NESTED(); + + SCAN_SINGLE_PORT("in_port(", uint32_t, OVS_KEY_ATTR_IN_PORT); + + SCAN_BEGIN("eth(", struct ovs_key_ethernet) { + SCAN_FIELD("src=", eth, eth_src); + SCAN_FIELD("dst=", eth, eth_dst); + } SCAN_END(OVS_KEY_ATTR_ETHERNET); + + SCAN_BEGIN_INIT("vlan(", struct ovs_key_vlan__, + { htons(VLAN_CFI) }, { htons(VLAN_CFI) }) { + SCAN_FIELD("vid=", vid, tci); + SCAN_FIELD("pcp=", pcp, tci); + SCAN_FIELD("cfi=", cfi, tci); + } SCAN_END(OVS_KEY_ATTR_VLAN); + + SCAN_SINGLE("eth_type(", ovs_be16, be16, OVS_KEY_ATTR_ETHERTYPE); + + SCAN_BEGIN("mpls(", struct ovs_key_mpls) { + SCAN_FIELD("label=", mpls_label, mpls_lse); + SCAN_FIELD("tc=", mpls_tc, mpls_lse); + SCAN_FIELD("ttl=", mpls_ttl, mpls_lse); + SCAN_FIELD("bos=", mpls_bos, mpls_lse); + } SCAN_END(OVS_KEY_ATTR_MPLS); + + SCAN_BEGIN("ipv4(", struct ovs_key_ipv4) { + SCAN_FIELD("src=", ipv4, ipv4_src); + SCAN_FIELD("dst=", ipv4, ipv4_dst); + SCAN_FIELD("proto=", u8, ipv4_proto); + SCAN_FIELD("tos=", u8, ipv4_tos); + SCAN_FIELD("ttl=", u8, ipv4_ttl); + SCAN_FIELD("frag=", frag, ipv4_frag); + } SCAN_END(OVS_KEY_ATTR_IPV4); + + SCAN_BEGIN("ipv6(", struct ovs_key_ipv6) { + SCAN_FIELD("src=", ipv6, ipv6_src); + SCAN_FIELD("dst=", ipv6, ipv6_dst); + SCAN_FIELD("label=", ipv6_label, ipv6_label); + SCAN_FIELD("proto=", u8, ipv6_proto); + SCAN_FIELD("tclass=", u8, ipv6_tclass); + SCAN_FIELD("hlimit=", u8, ipv6_hlimit); + SCAN_FIELD("frag=", frag, ipv6_frag); + } SCAN_END(OVS_KEY_ATTR_IPV6); + + SCAN_BEGIN("tcp(", struct ovs_key_tcp) { + SCAN_FIELD("src=", be16, tcp_src); + SCAN_FIELD("dst=", be16, tcp_dst); + } SCAN_END(OVS_KEY_ATTR_TCP); + + SCAN_SINGLE("tcp_flags(", ovs_be16, tcp_flags, OVS_KEY_ATTR_TCP_FLAGS); + + SCAN_BEGIN("udp(", struct ovs_key_udp) { + SCAN_FIELD("src=", be16, udp_src); + SCAN_FIELD("dst=", be16, udp_dst); + } SCAN_END(OVS_KEY_ATTR_UDP); + + SCAN_BEGIN("sctp(", struct ovs_key_sctp) { + SCAN_FIELD("src=", be16, sctp_src); + SCAN_FIELD("dst=", be16, sctp_dst); + } SCAN_END(OVS_KEY_ATTR_SCTP); + + SCAN_BEGIN("icmp(", struct ovs_key_icmp) { + SCAN_FIELD("type=", u8, icmp_type); + SCAN_FIELD("code=", u8, icmp_code); + } SCAN_END(OVS_KEY_ATTR_ICMP); + + SCAN_BEGIN("icmpv6(", struct ovs_key_icmpv6) { + SCAN_FIELD("type=", u8, icmpv6_type); + SCAN_FIELD("code=", u8, icmpv6_code); + } SCAN_END(OVS_KEY_ATTR_ICMPV6); + + SCAN_BEGIN("arp(", struct ovs_key_arp) { + SCAN_FIELD("sip=", ipv4, arp_sip); + SCAN_FIELD("tip=", ipv4, arp_tip); + SCAN_FIELD("op=", be16, arp_op); + SCAN_FIELD("sha=", eth, arp_sha); + SCAN_FIELD("tha=", eth, arp_tha); + } SCAN_END(OVS_KEY_ATTR_ARP); + + SCAN_BEGIN("nd(", struct ovs_key_nd) { + SCAN_FIELD("target=", ipv6, nd_target); + SCAN_FIELD("sll=", eth, nd_sll); + SCAN_FIELD("tll=", eth, nd_tll); + } SCAN_END(OVS_KEY_ATTR_ND); + + /* Encap open-coded. */ if (!strncmp(s, "encap(", 6)) { const char *start = s; size_t encap, encap_mask = 0; @@ -2399,7 +3311,7 @@ for (;;) { int retval; - s += strspn(s, ", \t\r\n"); + s += strspn(s, delimiters); if (!*s) { return -EINVAL; } else if (*s == ')') { @@ -2443,7 +3355,7 @@ odp_flow_from_string(const char *s, const struct simap *port_names, struct ofpbuf *key, struct ofpbuf *mask) { - const size_t old_size = ofpbuf_size(key); + const size_t old_size = key->size; for (;;) { int retval; @@ -2454,7 +3366,7 @@ retval = parse_odp_key_mask_attr(s, port_names, key, mask); if (retval < 0) { - ofpbuf_set_size(key, old_size); + key->size = old_size; return -retval; } s += retval; @@ -2464,28 +3376,50 @@ } static uint8_t -ovs_to_odp_frag(uint8_t nw_frag) -{ - return (nw_frag == 0 ? OVS_FRAG_TYPE_NONE - : nw_frag == FLOW_NW_FRAG_ANY ? OVS_FRAG_TYPE_FIRST - : OVS_FRAG_TYPE_LATER); -} - -static uint8_t -ovs_to_odp_frag_mask(uint8_t nw_frag_mask) +ovs_to_odp_frag(uint8_t nw_frag, bool is_mask) { - uint8_t frag_mask = ~(OVS_FRAG_TYPE_FIRST | OVS_FRAG_TYPE_LATER); - - frag_mask |= (nw_frag_mask & FLOW_NW_FRAG_ANY) ? OVS_FRAG_TYPE_FIRST : 0; - frag_mask |= (nw_frag_mask & FLOW_NW_FRAG_LATER) ? OVS_FRAG_TYPE_LATER : 0; + if (is_mask) { + /* Netlink interface 'enum ovs_frag_type' is an 8-bit enumeration type, + * not a set of flags or bitfields. Hence, if the struct flow nw_frag + * mask, which is a set of bits, has the FLOW_NW_FRAG_ANY as zero, we + * must use a zero mask for the netlink frag field, and all ones mask + * otherwise. */ + return (nw_frag & FLOW_NW_FRAG_ANY) ? UINT8_MAX : 0; + } + return !(nw_frag & FLOW_NW_FRAG_ANY) ? OVS_FRAG_TYPE_NONE + : nw_frag & FLOW_NW_FRAG_LATER ? OVS_FRAG_TYPE_LATER + : OVS_FRAG_TYPE_FIRST; +} + +static void get_ethernet_key(const struct flow *, struct ovs_key_ethernet *); +static void put_ethernet_key(const struct ovs_key_ethernet *, struct flow *); +static void get_ipv4_key(const struct flow *, struct ovs_key_ipv4 *, + bool is_mask); +static void put_ipv4_key(const struct ovs_key_ipv4 *, struct flow *, + bool is_mask); +static void get_ipv6_key(const struct flow *, struct ovs_key_ipv6 *, + bool is_mask); +static void put_ipv6_key(const struct ovs_key_ipv6 *, struct flow *, + bool is_mask); +static void get_arp_key(const struct flow *, struct ovs_key_arp *); +static void put_arp_key(const struct ovs_key_arp *, struct flow *); +static void get_nd_key(const struct flow *, struct ovs_key_nd *); +static void put_nd_key(const struct ovs_key_nd *, struct flow *); + +/* These share the same layout. */ +union ovs_key_tp { + struct ovs_key_tcp tcp; + struct ovs_key_udp udp; + struct ovs_key_sctp sctp; +}; - return frag_mask; -} +static void get_tp_key(const struct flow *, union ovs_key_tp *); +static void put_tp_key(const union ovs_key_tp *, struct flow *); static void odp_flow_key_from_flow__(struct ofpbuf *buf, const struct flow *flow, const struct flow *mask, odp_port_t odp_in_port, - size_t max_mpls_depth, bool export_mask) + size_t max_mpls_depth, bool recirc, bool export_mask) { struct ovs_key_ethernet *eth_key; size_t encap; @@ -2499,11 +3433,8 @@ nl_msg_put_u32(buf, OVS_KEY_ATTR_SKB_MARK, data->pkt_mark); - if (data->recirc_id || (mask && mask->recirc_id)) { + if (recirc) { nl_msg_put_u32(buf, OVS_KEY_ATTR_RECIRC_ID, data->recirc_id); - } - - if (data->dp_hash || (mask && mask->dp_hash)) { nl_msg_put_u32(buf, OVS_KEY_ATTR_DP_HASH, data->dp_hash); } @@ -2515,8 +3446,7 @@ eth_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_ETHERNET, sizeof *eth_key); - memcpy(eth_key->eth_src, data->dl_src, ETH_ADDR_LEN); - memcpy(eth_key->eth_dst, data->dl_dst, ETH_ADDR_LEN); + get_ethernet_key(data, eth_key); if (flow->vlan_tci != htons(0) || flow->dl_type == htons(ETH_TYPE_VLAN)) { if (export_mask) { @@ -2558,37 +3488,20 @@ ipv4_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_IPV4, sizeof *ipv4_key); - ipv4_key->ipv4_src = data->nw_src; - ipv4_key->ipv4_dst = data->nw_dst; - ipv4_key->ipv4_proto = data->nw_proto; - ipv4_key->ipv4_tos = data->nw_tos; - ipv4_key->ipv4_ttl = data->nw_ttl; - ipv4_key->ipv4_frag = export_mask ? ovs_to_odp_frag_mask(data->nw_frag) - : ovs_to_odp_frag(data->nw_frag); + get_ipv4_key(data, ipv4_key, export_mask); } else if (flow->dl_type == htons(ETH_TYPE_IPV6)) { struct ovs_key_ipv6 *ipv6_key; ipv6_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_IPV6, sizeof *ipv6_key); - memcpy(ipv6_key->ipv6_src, &data->ipv6_src, sizeof ipv6_key->ipv6_src); - memcpy(ipv6_key->ipv6_dst, &data->ipv6_dst, sizeof ipv6_key->ipv6_dst); - ipv6_key->ipv6_label = data->ipv6_label; - ipv6_key->ipv6_proto = data->nw_proto; - ipv6_key->ipv6_tclass = data->nw_tos; - ipv6_key->ipv6_hlimit = data->nw_ttl; - ipv6_key->ipv6_frag = export_mask ? ovs_to_odp_frag_mask(data->nw_frag) - : ovs_to_odp_frag(data->nw_frag); + get_ipv6_key(data, ipv6_key, export_mask); } else if (flow->dl_type == htons(ETH_TYPE_ARP) || flow->dl_type == htons(ETH_TYPE_RARP)) { struct ovs_key_arp *arp_key; - arp_key = nl_msg_put_unspec_zero(buf, OVS_KEY_ATTR_ARP, - sizeof *arp_key); - arp_key->arp_sip = data->nw_src; - arp_key->arp_tip = data->nw_dst; - arp_key->arp_op = htons(data->nw_proto); - memcpy(arp_key->arp_sha, data->arp_sha, ETH_ADDR_LEN); - memcpy(arp_key->arp_tha, data->arp_tha, ETH_ADDR_LEN); + arp_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_ARP, + sizeof *arp_key); + get_arp_key(data, arp_key); } else if (eth_type_mpls(flow->dl_type)) { struct ovs_key_mpls *mpls_key; int i, n; @@ -2604,30 +3517,26 @@ if (is_ip_any(flow) && !(flow->nw_frag & FLOW_NW_FRAG_LATER)) { if (flow->nw_proto == IPPROTO_TCP) { - struct ovs_key_tcp *tcp_key; + union ovs_key_tp *tcp_key; tcp_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_TCP, sizeof *tcp_key); - tcp_key->tcp_src = data->tp_src; - tcp_key->tcp_dst = data->tp_dst; - + get_tp_key(data, tcp_key); if (data->tcp_flags) { nl_msg_put_be16(buf, OVS_KEY_ATTR_TCP_FLAGS, data->tcp_flags); } } else if (flow->nw_proto == IPPROTO_UDP) { - struct ovs_key_udp *udp_key; + union ovs_key_tp *udp_key; udp_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_UDP, sizeof *udp_key); - udp_key->udp_src = data->tp_src; - udp_key->udp_dst = data->tp_dst; + get_tp_key(data, udp_key); } else if (flow->nw_proto == IPPROTO_SCTP) { - struct ovs_key_sctp *sctp_key; + union ovs_key_tp *sctp_key; sctp_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_SCTP, sizeof *sctp_key); - sctp_key->sctp_src = data->tp_src; - sctp_key->sctp_dst = data->tp_dst; + get_tp_key(data, sctp_key); } else if (flow->dl_type == htons(ETH_TYPE_IP) && flow->nw_proto == IPPROTO_ICMP) { struct ovs_key_icmp *icmp_key; @@ -2645,11 +3554,11 @@ icmpv6_key->icmpv6_type = ntohs(data->tp_src); icmpv6_key->icmpv6_code = ntohs(data->tp_dst); - if (flow->tp_dst == htons(0) && - (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) || - flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) && - (!export_mask || (data->tp_src == htons(0xffff) && - data->tp_dst == htons(0xffff)))) { + if (flow->tp_dst == htons(0) + && (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) + || flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) + && (!export_mask || (data->tp_src == htons(0xffff) + && data->tp_dst == htons(0xffff)))) { struct ovs_key_nd *nd_key; @@ -2676,12 +3585,17 @@ * port. * * 'buf' must have at least ODPUTIL_FLOW_KEY_BYTES bytes of space, or be - * capable of being expanded to allow for that much space. */ + * capable of being expanded to allow for that much space. + * + * 'recirc' indicates support for recirculation fields. If this is true, then + * these fields will always be serialised. */ void odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow, - const struct flow *mask, odp_port_t odp_in_port) + const struct flow *mask, odp_port_t odp_in_port, + bool recirc) { - odp_flow_key_from_flow__(buf, flow, mask, odp_in_port, SIZE_MAX, false); + odp_flow_key_from_flow__(buf, flow, mask, odp_in_port, SIZE_MAX, recirc, + false); } /* Appends a representation of 'mask' as OVS_KEY_ATTR_* attributes to @@ -2691,14 +3605,17 @@ * ARP, IPv4, IPv6, etc. * * 'buf' must have at least ODPUTIL_FLOW_KEY_BYTES bytes of space, or be - * capable of being expanded to allow for that much space. */ + * capable of being expanded to allow for that much space. + * + * 'recirc' indicates support for recirculation fields. If this is true, then + * these fields will always be serialised. */ void odp_flow_key_from_mask(struct ofpbuf *buf, const struct flow *mask, const struct flow *flow, uint32_t odp_in_port_mask, - size_t max_mpls_depth) + size_t max_mpls_depth, bool recirc) { - odp_flow_key_from_flow__(buf, flow, mask, - u32_to_odp(odp_in_port_mask), max_mpls_depth, true); + odp_flow_key_from_flow__(buf, flow, mask, u32_to_odp(odp_in_port_mask), + max_mpls_depth, recirc, true); } /* Generate ODP flow key from the given packet metadata */ @@ -2736,7 +3653,8 @@ NL_ATTR_FOR_EACH (nla, left, key, key_len) { uint16_t type = nl_attr_type(nla); size_t len = nl_attr_get_size(nla); - int expected_len = odp_flow_key_attr_len(type); + int expected_len = odp_key_attr_len(ovs_flow_key_attr_lens, + OVS_KEY_ATTR_MAX, type); if (len != expected_len && expected_len >= 0) { continue; @@ -2824,23 +3742,23 @@ ds_destroy(&s); } -static bool -odp_to_ovs_frag(uint8_t odp_frag, struct flow *flow) +static uint8_t +odp_to_ovs_frag(uint8_t odp_frag, bool is_mask) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + if (is_mask) { + return odp_frag ? FLOW_NW_FRAG_MASK : 0; + } + if (odp_frag > OVS_FRAG_TYPE_LATER) { VLOG_ERR_RL(&rl, "invalid frag %"PRIu8" in flow key", odp_frag); - return false; + return 0xff; /* Error. */ } - if (odp_frag != OVS_FRAG_TYPE_NONE) { - flow->nw_frag |= FLOW_NW_FRAG_ANY; - if (odp_frag == OVS_FRAG_TYPE_LATER) { - flow->nw_frag |= FLOW_NW_FRAG_LATER; - } - } - return true; + return (odp_frag == OVS_FRAG_TYPE_NONE) ? 0 + : (odp_frag == OVS_FRAG_TYPE_FIRST) ? FLOW_NW_FRAG_ANY + : FLOW_NW_FRAG_ANY | FLOW_NW_FRAG_LATER; } static bool @@ -2859,7 +3777,8 @@ NL_ATTR_FOR_EACH (nla, left, key, key_len) { uint16_t type = nl_attr_type(nla); size_t len = nl_attr_get_size(nla); - int expected_len = odp_flow_key_attr_len(type); + int expected_len = odp_key_attr_len(ovs_flow_key_attr_lens, + OVS_KEY_ATTR_MAX, type); if (len != expected_len && expected_len >= 0) { char namebuf[OVS_KEY_ATTR_BUFSIZE]; @@ -3017,18 +3936,14 @@ const struct ovs_key_ipv4 *ipv4_key; ipv4_key = nl_attr_get(attrs[OVS_KEY_ATTR_IPV4]); - flow->nw_src = ipv4_key->ipv4_src; - flow->nw_dst = ipv4_key->ipv4_dst; - flow->nw_proto = ipv4_key->ipv4_proto; - flow->nw_tos = ipv4_key->ipv4_tos; - flow->nw_ttl = ipv4_key->ipv4_ttl; + put_ipv4_key(ipv4_key, flow, is_mask); + if (flow->nw_frag > FLOW_NW_FRAG_MASK) { + return ODP_FIT_ERROR; + } if (is_mask) { - flow->nw_frag = ipv4_key->ipv4_frag; check_start = ipv4_key; check_len = sizeof *ipv4_key; expected_bit = OVS_KEY_ATTR_IPV4; - } else if (!odp_to_ovs_frag(ipv4_key->ipv4_frag, flow)) { - return ODP_FIT_ERROR; } } } else if (src_flow->dl_type == htons(ETH_TYPE_IPV6)) { @@ -3039,19 +3954,14 @@ const struct ovs_key_ipv6 *ipv6_key; ipv6_key = nl_attr_get(attrs[OVS_KEY_ATTR_IPV6]); - memcpy(&flow->ipv6_src, ipv6_key->ipv6_src, sizeof flow->ipv6_src); - memcpy(&flow->ipv6_dst, ipv6_key->ipv6_dst, sizeof flow->ipv6_dst); - flow->ipv6_label = ipv6_key->ipv6_label; - flow->nw_proto = ipv6_key->ipv6_proto; - flow->nw_tos = ipv6_key->ipv6_tclass; - flow->nw_ttl = ipv6_key->ipv6_hlimit; + put_ipv6_key(ipv6_key, flow, is_mask); + if (flow->nw_frag > FLOW_NW_FRAG_MASK) { + return ODP_FIT_ERROR; + } if (is_mask) { - flow->nw_frag = ipv6_key->ipv6_frag; check_start = ipv6_key; check_len = sizeof *ipv6_key; expected_bit = OVS_KEY_ATTR_IPV6; - } else if (!odp_to_ovs_frag(ipv6_key->ipv6_frag, flow)) { - return ODP_FIT_ERROR; } } } else if (src_flow->dl_type == htons(ETH_TYPE_ARP) || @@ -3063,17 +3973,12 @@ const struct ovs_key_arp *arp_key; arp_key = nl_attr_get(attrs[OVS_KEY_ATTR_ARP]); - flow->nw_src = arp_key->arp_sip; - flow->nw_dst = arp_key->arp_tip; if (!is_mask && (arp_key->arp_op & htons(0xff00))) { VLOG_ERR_RL(&rl, "unsupported ARP opcode %"PRIu16" in flow " "key", ntohs(arp_key->arp_op)); return ODP_FIT_ERROR; } - flow->nw_proto = ntohs(arp_key->arp_op); - memcpy(flow->arp_sha, arp_key->arp_sha, ETH_ADDR_LEN); - memcpy(flow->arp_tha, arp_key->arp_tha, ETH_ADDR_LEN); - + put_arp_key(arp_key, flow); if (is_mask) { check_start = arp_key; check_len = sizeof *arp_key; @@ -3101,11 +4006,10 @@ expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_TCP; } if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TCP)) { - const struct ovs_key_tcp *tcp_key; + const union ovs_key_tp *tcp_key; tcp_key = nl_attr_get(attrs[OVS_KEY_ATTR_TCP]); - flow->tp_src = tcp_key->tcp_src; - flow->tp_dst = tcp_key->tcp_dst; + put_tp_key(tcp_key, flow); expected_bit = OVS_KEY_ATTR_TCP; } if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TCP_FLAGS)) { @@ -3120,11 +4024,10 @@ expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_UDP; } if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_UDP)) { - const struct ovs_key_udp *udp_key; + const union ovs_key_tp *udp_key; udp_key = nl_attr_get(attrs[OVS_KEY_ATTR_UDP]); - flow->tp_src = udp_key->udp_src; - flow->tp_dst = udp_key->udp_dst; + put_tp_key(udp_key, flow); expected_bit = OVS_KEY_ATTR_UDP; } } else if (src_flow->nw_proto == IPPROTO_SCTP @@ -3135,11 +4038,10 @@ expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_SCTP; } if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_SCTP)) { - const struct ovs_key_sctp *sctp_key; + const union ovs_key_tp *sctp_key; sctp_key = nl_attr_get(attrs[OVS_KEY_ATTR_SCTP]); - flow->tp_src = sctp_key->sctp_src; - flow->tp_dst = sctp_key->sctp_dst; + put_tp_key(sctp_key, flow); expected_bit = OVS_KEY_ATTR_SCTP; } } else if (src_flow->nw_proto == IPPROTO_ICMP @@ -3184,8 +4086,7 @@ memcpy(flow->arp_sha, nd_key->nd_sll, ETH_ADDR_LEN); memcpy(flow->arp_tha, nd_key->nd_tll, ETH_ADDR_LEN); if (is_mask) { - if (!is_all_zeros((const uint8_t *) nd_key, - sizeof *nd_key) && + if (!is_all_zeros(nd_key, sizeof *nd_key) && (flow->tp_src != htons(0xffff) || flow->tp_dst != htons(0xffff))) { return ODP_FIT_ERROR; @@ -3352,8 +4253,7 @@ const struct ovs_key_ethernet *eth_key; eth_key = nl_attr_get(attrs[OVS_KEY_ATTR_ETHERNET]); - memcpy(flow->dl_src, eth_key->eth_src, ETH_ADDR_LEN); - memcpy(flow->dl_dst, eth_key->eth_dst, ETH_ADDR_LEN); + put_ethernet_key(eth_key, flow); if (is_mask) { expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_ETHERNET; } @@ -3444,6 +4344,7 @@ size_t odp_put_userspace_action(uint32_t pid, const void *userdata, size_t userdata_size, + odp_port_t tunnel_out_port, struct ofpbuf *odp_actions) { size_t userdata_ofs; @@ -3452,7 +4353,7 @@ offset = nl_msg_start_nested(odp_actions, OVS_ACTION_ATTR_USERSPACE); nl_msg_put_u32(odp_actions, OVS_USERSPACE_ATTR_PID, pid); if (userdata) { - userdata_ofs = ofpbuf_size(odp_actions) + NLA_HDRLEN; + userdata_ofs = odp_actions->size + NLA_HDRLEN; /* The OVS kernel module before OVS 1.11 and the upstream Linux kernel * module before Linux 3.10 required the userdata to be exactly 8 bytes @@ -3470,6 +4371,10 @@ } else { userdata_ofs = 0; } + if (tunnel_out_port != ODPP_NONE) { + nl_msg_put_odp_port(odp_actions, OVS_USERSPACE_ATTR_EGRESS_TUN_PORT, + tunnel_out_port); + } nl_msg_end_nested(odp_actions, offset); return userdata_ofs; @@ -3483,6 +4388,17 @@ tun_key_to_attr(odp_actions, tunnel); nl_msg_end_nested(odp_actions, offset); } + +void +odp_put_tnl_push_action(struct ofpbuf *odp_actions, + struct ovs_action_push_tnl *data) +{ + int size = offsetof(struct ovs_action_push_tnl, header); + + size += data->header_len; + nl_msg_put_unspec(odp_actions, OVS_ACTION_ATTR_TUNNEL_PUSH, data, size); +} + /* The commit_odp_actions() function and its helpers. */ @@ -3495,12 +4411,25 @@ nl_msg_end_nested(odp_actions, offset); } +/* Masked set actions have a mask following the data within the netlink + * attribute. The unmasked bits in the data will be cleared as the data + * is copied to the action. */ void -odp_put_pkt_mark_action(const uint32_t pkt_mark, - struct ofpbuf *odp_actions) -{ - commit_set_action(odp_actions, OVS_KEY_ATTR_SKB_MARK, &pkt_mark, - sizeof(pkt_mark)); +commit_masked_set_action(struct ofpbuf *odp_actions, + enum ovs_key_attr key_type, + const void *key_, const void *mask_, size_t key_size) +{ + size_t offset = nl_msg_start_nested(odp_actions, + OVS_ACTION_ATTR_SET_MASKED); + char *data = nl_msg_put_unspec_uninit(odp_actions, key_type, key_size * 2); + const char *key = key_, *mask = mask_; + + memcpy(data + key_size, mask, key_size); + /* Clear unmasked bits while copying. */ + while (key_size--) { + *data++ = *key++ & *mask++; + } + nl_msg_end_nested(odp_actions, offset); } /* If any of the flow key data that ODP actions can modify are different in @@ -3523,29 +4452,63 @@ } } -static void -commit_set_ether_addr_action(const struct flow *flow, struct flow *base, - struct ofpbuf *odp_actions, - struct flow_wildcards *wc) +static bool +commit(enum ovs_key_attr attr, bool use_masked_set, + const void *key, void *base, void *mask, size_t size, + struct ofpbuf *odp_actions) { - struct ovs_key_ethernet eth_key; + if (memcmp(key, base, size)) { + bool fully_masked = odp_mask_is_exact(attr, mask, size); - if (eth_addr_equals(base->dl_src, flow->dl_src) && - eth_addr_equals(base->dl_dst, flow->dl_dst)) { - return; + if (use_masked_set && !fully_masked) { + commit_masked_set_action(odp_actions, attr, key, mask, size); + } else { + if (!fully_masked) { + memset(mask, 0xff, size); + } + commit_set_action(odp_actions, attr, key, size); + } + memcpy(base, key, size); + return true; + } else { + /* Mask bits are set when we have either read or set the corresponding + * values. Masked bits will be exact-matched, no need to set them + * if the value did not actually change. */ + return false; } +} - memset(&wc->masks.dl_src, 0xff, sizeof wc->masks.dl_src); - memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst); +static void +get_ethernet_key(const struct flow *flow, struct ovs_key_ethernet *eth) +{ + memcpy(eth->eth_src, flow->dl_src, ETH_ADDR_LEN); + memcpy(eth->eth_dst, flow->dl_dst, ETH_ADDR_LEN); +} - memcpy(base->dl_src, flow->dl_src, ETH_ADDR_LEN); - memcpy(base->dl_dst, flow->dl_dst, ETH_ADDR_LEN); +static void +put_ethernet_key(const struct ovs_key_ethernet *eth, struct flow *flow) +{ + memcpy(flow->dl_src, eth->eth_src, ETH_ADDR_LEN); + memcpy(flow->dl_dst, eth->eth_dst, ETH_ADDR_LEN); +} - memcpy(eth_key.eth_src, base->dl_src, ETH_ADDR_LEN); - memcpy(eth_key.eth_dst, base->dl_dst, ETH_ADDR_LEN); +static void +commit_set_ether_addr_action(const struct flow *flow, struct flow *base_flow, + struct ofpbuf *odp_actions, + struct flow_wildcards *wc, + bool use_masked) +{ + struct ovs_key_ethernet key, base, mask; - commit_set_action(odp_actions, OVS_KEY_ATTR_ETHERNET, - ð_key, sizeof(eth_key)); + get_ethernet_key(flow, &key); + get_ethernet_key(base_flow, &base); + get_ethernet_key(&wc->masks, &mask); + + if (commit(OVS_KEY_ATTR_ETHERNET, use_masked, + &key, &base, &mask, sizeof key, odp_actions)) { + put_ethernet_key(&base, base_flow); + put_ethernet_key(&mask, &wc->masks); + } } static void @@ -3580,14 +4543,15 @@ base->vlan_tci = vlan_tci; } +/* Wildcarding already done at action translation time. */ static void commit_mpls_action(const struct flow *flow, struct flow *base, - struct ofpbuf *odp_actions, struct flow_wildcards *wc) + struct ofpbuf *odp_actions) { - int base_n = flow_count_mpls_labels(base, wc); - int flow_n = flow_count_mpls_labels(flow, wc); + int base_n = flow_count_mpls_labels(base, NULL); + int flow_n = flow_count_mpls_labels(flow, NULL); int common_n = flow_count_common_mpls_labels(flow, flow_n, base, base_n, - wc); + NULL); while (base_n > common_n) { if (base_n - 1 == common_n && flow_n > common_n) { @@ -3624,7 +4588,7 @@ dl_type = flow->dl_type; } nl_msg_put_be16(odp_actions, OVS_ACTION_ATTR_POP_MPLS, dl_type); - popped = flow_pop_mpls(base, base_n, flow->dl_type, wc); + popped = flow_pop_mpls(base, base_n, flow->dl_type, NULL); ovs_assert(popped); base_n--; } @@ -3640,122 +4604,195 @@ sizeof *mpls); mpls->mpls_ethertype = flow->dl_type; mpls->mpls_lse = flow->mpls_lse[flow_n - base_n - 1]; - flow_push_mpls(base, base_n, mpls->mpls_ethertype, wc); + flow_push_mpls(base, base_n, mpls->mpls_ethertype, NULL); flow_set_mpls_lse(base, 0, mpls->mpls_lse); base_n++; } } static void -commit_set_ipv4_action(const struct flow *flow, struct flow *base, - struct ofpbuf *odp_actions, struct flow_wildcards *wc) +get_ipv4_key(const struct flow *flow, struct ovs_key_ipv4 *ipv4, bool is_mask) { - struct ovs_key_ipv4 ipv4_key; + ipv4->ipv4_src = flow->nw_src; + ipv4->ipv4_dst = flow->nw_dst; + ipv4->ipv4_proto = flow->nw_proto; + ipv4->ipv4_tos = flow->nw_tos; + ipv4->ipv4_ttl = flow->nw_ttl; + ipv4->ipv4_frag = ovs_to_odp_frag(flow->nw_frag, is_mask); +} - if (base->nw_src == flow->nw_src && - base->nw_dst == flow->nw_dst && - base->nw_tos == flow->nw_tos && - base->nw_ttl == flow->nw_ttl && - base->nw_frag == flow->nw_frag) { - return; - } +static void +put_ipv4_key(const struct ovs_key_ipv4 *ipv4, struct flow *flow, bool is_mask) +{ + flow->nw_src = ipv4->ipv4_src; + flow->nw_dst = ipv4->ipv4_dst; + flow->nw_proto = ipv4->ipv4_proto; + flow->nw_tos = ipv4->ipv4_tos; + flow->nw_ttl = ipv4->ipv4_ttl; + flow->nw_frag = odp_to_ovs_frag(ipv4->ipv4_frag, is_mask); +} - memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src); - memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst); - memset(&wc->masks.nw_tos, 0xff, sizeof wc->masks.nw_tos); - memset(&wc->masks.nw_ttl, 0xff, sizeof wc->masks.nw_ttl); - memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); - memset(&wc->masks.nw_frag, 0xff, sizeof wc->masks.nw_frag); - - ipv4_key.ipv4_src = base->nw_src = flow->nw_src; - ipv4_key.ipv4_dst = base->nw_dst = flow->nw_dst; - ipv4_key.ipv4_tos = base->nw_tos = flow->nw_tos; - ipv4_key.ipv4_ttl = base->nw_ttl = flow->nw_ttl; - ipv4_key.ipv4_proto = base->nw_proto; - ipv4_key.ipv4_frag = ovs_to_odp_frag(base->nw_frag); - - commit_set_action(odp_actions, OVS_KEY_ATTR_IPV4, - &ipv4_key, sizeof(ipv4_key)); +static void +commit_set_ipv4_action(const struct flow *flow, struct flow *base_flow, + struct ofpbuf *odp_actions, struct flow_wildcards *wc, + bool use_masked) +{ + struct ovs_key_ipv4 key, mask, base; + + /* Check that nw_proto and nw_frag remain unchanged. */ + ovs_assert(flow->nw_proto == base_flow->nw_proto && + flow->nw_frag == base_flow->nw_frag); + + get_ipv4_key(flow, &key, false); + get_ipv4_key(base_flow, &base, false); + get_ipv4_key(&wc->masks, &mask, true); + mask.ipv4_proto = 0; /* Not writeable. */ + mask.ipv4_frag = 0; /* Not writable. */ + + if (commit(OVS_KEY_ATTR_IPV4, use_masked, &key, &base, &mask, sizeof key, + odp_actions)) { + put_ipv4_key(&base, base_flow, false); + if (mask.ipv4_proto != 0) { /* Mask was changed by commit(). */ + put_ipv4_key(&mask, &wc->masks, true); + } + } } static void -commit_set_ipv6_action(const struct flow *flow, struct flow *base, - struct ofpbuf *odp_actions, struct flow_wildcards *wc) -{ - struct ovs_key_ipv6 ipv6_key; - - if (ipv6_addr_equals(&base->ipv6_src, &flow->ipv6_src) && - ipv6_addr_equals(&base->ipv6_dst, &flow->ipv6_dst) && - base->ipv6_label == flow->ipv6_label && - base->nw_tos == flow->nw_tos && - base->nw_ttl == flow->nw_ttl && - base->nw_frag == flow->nw_frag) { - return; +get_ipv6_key(const struct flow *flow, struct ovs_key_ipv6 *ipv6, bool is_mask) +{ + memcpy(ipv6->ipv6_src, &flow->ipv6_src, sizeof ipv6->ipv6_src); + memcpy(ipv6->ipv6_dst, &flow->ipv6_dst, sizeof ipv6->ipv6_dst); + ipv6->ipv6_label = flow->ipv6_label; + ipv6->ipv6_proto = flow->nw_proto; + ipv6->ipv6_tclass = flow->nw_tos; + ipv6->ipv6_hlimit = flow->nw_ttl; + ipv6->ipv6_frag = ovs_to_odp_frag(flow->nw_frag, is_mask); +} + +static void +put_ipv6_key(const struct ovs_key_ipv6 *ipv6, struct flow *flow, bool is_mask) +{ + memcpy(&flow->ipv6_src, ipv6->ipv6_src, sizeof flow->ipv6_src); + memcpy(&flow->ipv6_dst, ipv6->ipv6_dst, sizeof flow->ipv6_dst); + flow->ipv6_label = ipv6->ipv6_label; + flow->nw_proto = ipv6->ipv6_proto; + flow->nw_tos = ipv6->ipv6_tclass; + flow->nw_ttl = ipv6->ipv6_hlimit; + flow->nw_frag = odp_to_ovs_frag(ipv6->ipv6_frag, is_mask); +} + +static void +commit_set_ipv6_action(const struct flow *flow, struct flow *base_flow, + struct ofpbuf *odp_actions, struct flow_wildcards *wc, + bool use_masked) +{ + struct ovs_key_ipv6 key, mask, base; + + /* Check that nw_proto and nw_frag remain unchanged. */ + ovs_assert(flow->nw_proto == base_flow->nw_proto && + flow->nw_frag == base_flow->nw_frag); + + get_ipv6_key(flow, &key, false); + get_ipv6_key(base_flow, &base, false); + get_ipv6_key(&wc->masks, &mask, true); + mask.ipv6_proto = 0; /* Not writeable. */ + mask.ipv6_frag = 0; /* Not writable. */ + + if (commit(OVS_KEY_ATTR_IPV6, use_masked, &key, &base, &mask, sizeof key, + odp_actions)) { + put_ipv6_key(&base, base_flow, false); + if (mask.ipv6_proto != 0) { /* Mask was changed by commit(). */ + put_ipv6_key(&mask, &wc->masks, true); + } } +} + +static void +get_arp_key(const struct flow *flow, struct ovs_key_arp *arp) +{ + /* ARP key has padding, clear it. */ + memset(arp, 0, sizeof *arp); - memset(&wc->masks.ipv6_src, 0xff, sizeof wc->masks.ipv6_src); - memset(&wc->masks.ipv6_dst, 0xff, sizeof wc->masks.ipv6_dst); - memset(&wc->masks.ipv6_label, 0xff, sizeof wc->masks.ipv6_label); - memset(&wc->masks.nw_tos, 0xff, sizeof wc->masks.nw_tos); - memset(&wc->masks.nw_ttl, 0xff, sizeof wc->masks.nw_ttl); - memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); - memset(&wc->masks.nw_frag, 0xff, sizeof wc->masks.nw_frag); - - base->ipv6_src = flow->ipv6_src; - memcpy(&ipv6_key.ipv6_src, &base->ipv6_src, sizeof(ipv6_key.ipv6_src)); - base->ipv6_dst = flow->ipv6_dst; - memcpy(&ipv6_key.ipv6_dst, &base->ipv6_dst, sizeof(ipv6_key.ipv6_dst)); - - ipv6_key.ipv6_label = base->ipv6_label = flow->ipv6_label; - ipv6_key.ipv6_tclass = base->nw_tos = flow->nw_tos; - ipv6_key.ipv6_hlimit = base->nw_ttl = flow->nw_ttl; - ipv6_key.ipv6_proto = base->nw_proto; - ipv6_key.ipv6_frag = ovs_to_odp_frag(base->nw_frag); + arp->arp_sip = flow->nw_src; + arp->arp_tip = flow->nw_dst; + arp->arp_op = htons(flow->nw_proto); + memcpy(arp->arp_sha, flow->arp_sha, ETH_ADDR_LEN); + memcpy(arp->arp_tha, flow->arp_tha, ETH_ADDR_LEN); +} - commit_set_action(odp_actions, OVS_KEY_ATTR_IPV6, - &ipv6_key, sizeof(ipv6_key)); +static void +put_arp_key(const struct ovs_key_arp *arp, struct flow *flow) +{ + flow->nw_src = arp->arp_sip; + flow->nw_dst = arp->arp_tip; + flow->nw_proto = ntohs(arp->arp_op); + memcpy(flow->arp_sha, arp->arp_sha, ETH_ADDR_LEN); + memcpy(flow->arp_tha, arp->arp_tha, ETH_ADDR_LEN); } static enum slow_path_reason -commit_set_arp_action(const struct flow *flow, struct flow *base, +commit_set_arp_action(const struct flow *flow, struct flow *base_flow, struct ofpbuf *odp_actions, struct flow_wildcards *wc) { - struct ovs_key_arp arp_key; + struct ovs_key_arp key, mask, base; - if (base->nw_src == flow->nw_src && - base->nw_dst == flow->nw_dst && - base->nw_proto == flow->nw_proto && - eth_addr_equals(base->arp_sha, flow->arp_sha) && - eth_addr_equals(base->arp_tha, flow->arp_tha)) { - return 0; + get_arp_key(flow, &key); + get_arp_key(base_flow, &base); + get_arp_key(&wc->masks, &mask); + + if (commit(OVS_KEY_ATTR_ARP, true, &key, &base, &mask, sizeof key, + odp_actions)) { + put_arp_key(&base, base_flow); + put_arp_key(&mask, &wc->masks); + return SLOW_ACTION; } + return 0; +} + +static void +get_nd_key(const struct flow *flow, struct ovs_key_nd *nd) +{ + memcpy(nd->nd_target, &flow->nd_target, sizeof flow->nd_target); + /* nd_sll and nd_tll are stored in arp_sha and arp_tha, respectively */ + memcpy(nd->nd_sll, flow->arp_sha, ETH_ADDR_LEN); + memcpy(nd->nd_tll, flow->arp_tha, ETH_ADDR_LEN); +} - memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src); - memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst); - memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); - memset(&wc->masks.arp_sha, 0xff, sizeof wc->masks.arp_sha); - memset(&wc->masks.arp_tha, 0xff, sizeof wc->masks.arp_tha); - - base->nw_src = flow->nw_src; - base->nw_dst = flow->nw_dst; - base->nw_proto = flow->nw_proto; - memcpy(base->arp_sha, flow->arp_sha, ETH_ADDR_LEN); - memcpy(base->arp_tha, flow->arp_tha, ETH_ADDR_LEN); - - arp_key.arp_sip = base->nw_src; - arp_key.arp_tip = base->nw_dst; - arp_key.arp_op = htons(base->nw_proto); - memcpy(arp_key.arp_sha, flow->arp_sha, ETH_ADDR_LEN); - memcpy(arp_key.arp_tha, flow->arp_tha, ETH_ADDR_LEN); +static void +put_nd_key(const struct ovs_key_nd *nd, struct flow *flow) +{ + memcpy(&flow->nd_target, &flow->nd_target, sizeof flow->nd_target); + /* nd_sll and nd_tll are stored in arp_sha and arp_tha, respectively */ + memcpy(flow->arp_sha, nd->nd_sll, ETH_ADDR_LEN); + memcpy(flow->arp_tha, nd->nd_tll, ETH_ADDR_LEN); +} - commit_set_action(odp_actions, OVS_KEY_ATTR_ARP, &arp_key, sizeof arp_key); +static enum slow_path_reason +commit_set_nd_action(const struct flow *flow, struct flow *base_flow, + struct ofpbuf *odp_actions, + struct flow_wildcards *wc, bool use_masked) +{ + struct ovs_key_nd key, mask, base; + + get_nd_key(flow, &key); + get_nd_key(base_flow, &base); + get_nd_key(&wc->masks, &mask); + + if (commit(OVS_KEY_ATTR_ND, use_masked, &key, &base, &mask, sizeof key, + odp_actions)) { + put_nd_key(&base, base_flow); + put_nd_key(&mask, &wc->masks); + return SLOW_ACTION; + } - return SLOW_ACTION; + return 0; } static enum slow_path_reason commit_set_nw_action(const struct flow *flow, struct flow *base, - struct ofpbuf *odp_actions, struct flow_wildcards *wc) + struct ofpbuf *odp_actions, struct flow_wildcards *wc, + bool use_masked) { /* Check if 'flow' really has an L3 header. */ if (!flow->nw_proto) { @@ -3764,12 +4801,12 @@ switch (ntohs(base->dl_type)) { case ETH_TYPE_IP: - commit_set_ipv4_action(flow, base, odp_actions, wc); + commit_set_ipv4_action(flow, base, odp_actions, wc, use_masked); break; case ETH_TYPE_IPV6: - commit_set_ipv6_action(flow, base, odp_actions, wc); - break; + commit_set_ipv6_action(flow, base, odp_actions, wc, use_masked); + return commit_set_nd_action(flow, base, odp_actions, wc, use_masked); case ETH_TYPE_ARP: return commit_set_arp_action(flow, base, odp_actions, wc); @@ -3778,79 +4815,98 @@ return 0; } +/* TCP, UDP, and SCTP keys have the same layout. */ +BUILD_ASSERT_DECL(sizeof(struct ovs_key_tcp) == sizeof(struct ovs_key_udp) && + sizeof(struct ovs_key_tcp) == sizeof(struct ovs_key_sctp)); + +static void +get_tp_key(const struct flow *flow, union ovs_key_tp *tp) +{ + tp->tcp.tcp_src = flow->tp_src; + tp->tcp.tcp_dst = flow->tp_dst; +} + +static void +put_tp_key(const union ovs_key_tp *tp, struct flow *flow) +{ + flow->tp_src = tp->tcp.tcp_src; + flow->tp_dst = tp->tcp.tcp_dst; +} + static void -commit_set_port_action(const struct flow *flow, struct flow *base, - struct ofpbuf *odp_actions, struct flow_wildcards *wc) +commit_set_port_action(const struct flow *flow, struct flow *base_flow, + struct ofpbuf *odp_actions, struct flow_wildcards *wc, + bool use_masked) { - if (!is_ip_any(base) || (!base->tp_src && !base->tp_dst)) { + enum ovs_key_attr key_type; + union ovs_key_tp key, mask, base; + + /* Check if 'flow' really has an L3 header. */ + if (!flow->nw_proto) { return; } - if (base->tp_src == flow->tp_src && - base->tp_dst == flow->tp_dst) { + if (!is_ip_any(base_flow)) { return; } - memset(&wc->masks.tp_src, 0xff, sizeof wc->masks.tp_src); - memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst); - if (flow->nw_proto == IPPROTO_TCP) { - struct ovs_key_tcp port_key; - - port_key.tcp_src = base->tp_src = flow->tp_src; - port_key.tcp_dst = base->tp_dst = flow->tp_dst; - - commit_set_action(odp_actions, OVS_KEY_ATTR_TCP, - &port_key, sizeof(port_key)); - + key_type = OVS_KEY_ATTR_TCP; } else if (flow->nw_proto == IPPROTO_UDP) { - struct ovs_key_udp port_key; - - port_key.udp_src = base->tp_src = flow->tp_src; - port_key.udp_dst = base->tp_dst = flow->tp_dst; - - commit_set_action(odp_actions, OVS_KEY_ATTR_UDP, - &port_key, sizeof(port_key)); + key_type = OVS_KEY_ATTR_UDP; } else if (flow->nw_proto == IPPROTO_SCTP) { - struct ovs_key_sctp port_key; - - port_key.sctp_src = base->tp_src = flow->tp_src; - port_key.sctp_dst = base->tp_dst = flow->tp_dst; + key_type = OVS_KEY_ATTR_SCTP; + } else { + return; + } - commit_set_action(odp_actions, OVS_KEY_ATTR_SCTP, - &port_key, sizeof(port_key)); + get_tp_key(flow, &key); + get_tp_key(base_flow, &base); + get_tp_key(&wc->masks, &mask); + + if (commit(key_type, use_masked, &key, &base, &mask, sizeof key, + odp_actions)) { + put_tp_key(&base, base_flow); + put_tp_key(&mask, &wc->masks); } } static void -commit_set_priority_action(const struct flow *flow, struct flow *base, +commit_set_priority_action(const struct flow *flow, struct flow *base_flow, struct ofpbuf *odp_actions, - struct flow_wildcards *wc) + struct flow_wildcards *wc, + bool use_masked) { - if (base->skb_priority == flow->skb_priority) { - return; - } - - memset(&wc->masks.skb_priority, 0xff, sizeof wc->masks.skb_priority); - base->skb_priority = flow->skb_priority; + uint32_t key, mask, base; - commit_set_action(odp_actions, OVS_KEY_ATTR_PRIORITY, - &base->skb_priority, sizeof(base->skb_priority)); + key = flow->skb_priority; + base = base_flow->skb_priority; + mask = wc->masks.skb_priority; + + if (commit(OVS_KEY_ATTR_PRIORITY, use_masked, &key, &base, &mask, + sizeof key, odp_actions)) { + base_flow->skb_priority = base; + wc->masks.skb_priority = mask; + } } static void -commit_set_pkt_mark_action(const struct flow *flow, struct flow *base, +commit_set_pkt_mark_action(const struct flow *flow, struct flow *base_flow, struct ofpbuf *odp_actions, - struct flow_wildcards *wc) + struct flow_wildcards *wc, + bool use_masked) { - if (base->pkt_mark == flow->pkt_mark) { - return; - } - - memset(&wc->masks.pkt_mark, 0xff, sizeof wc->masks.pkt_mark); - base->pkt_mark = flow->pkt_mark; + uint32_t key, mask, base; - odp_put_pkt_mark_action(base->pkt_mark, odp_actions); + key = flow->pkt_mark; + base = base_flow->pkt_mark; + mask = wc->masks.pkt_mark; + + if (commit(OVS_KEY_ATTR_SKB_MARK, use_masked, &key, &base, &mask, + sizeof key, odp_actions)) { + base_flow->pkt_mark = base; + wc->masks.pkt_mark = mask; + } } /* If any of the flow key data that ODP actions can modify are different in @@ -3864,17 +4920,18 @@ * slow path, if there is one, otherwise 0. */ enum slow_path_reason commit_odp_actions(const struct flow *flow, struct flow *base, - struct ofpbuf *odp_actions, struct flow_wildcards *wc) + struct ofpbuf *odp_actions, struct flow_wildcards *wc, + bool use_masked) { enum slow_path_reason slow; - commit_set_ether_addr_action(flow, base, odp_actions, wc); - slow = commit_set_nw_action(flow, base, odp_actions, wc); - commit_set_port_action(flow, base, odp_actions, wc); - commit_mpls_action(flow, base, odp_actions, wc); + commit_set_ether_addr_action(flow, base, odp_actions, wc, use_masked); + slow = commit_set_nw_action(flow, base, odp_actions, wc, use_masked); + commit_set_port_action(flow, base, odp_actions, wc, use_masked); + commit_mpls_action(flow, base, odp_actions); commit_vlan_action(flow->vlan_tci, base, odp_actions, wc); - commit_set_priority_action(flow, base, odp_actions, wc); - commit_set_pkt_mark_action(flow, base, odp_actions, wc); + commit_set_priority_action(flow, base, odp_actions, wc, use_masked); + commit_set_pkt_mark_action(flow, base, odp_actions, wc, use_masked); return slow; } diff -Nru openvswitch-2.3.1/lib/odp-util.h openvswitch-2.4.0~git20150623/lib/odp-util.h --- openvswitch-2.3.1/lib/odp-util.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/odp-util.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,16 +21,14 @@ #include #include #include -#include +#include "flow.h" #include "hash.h" #include "hmap.h" +#include "odp-netlink.h" #include "openflow/openflow.h" #include "util.h" struct ds; -struct flow; -struct flow_tnl; -struct flow_wildcards; struct nlattr; struct ofpbuf; struct simap; @@ -42,6 +40,7 @@ SPR(SLOW_BFD, "bfd", "Consists of BFD packets") \ SPR(SLOW_LACP, "lacp", "Consists of LACP packets") \ SPR(SLOW_STP, "stp", "Consists of STP packets") \ + SPR(SLOW_LLDP, "lldp", "Consists of LLDP packets") \ SPR(SLOW_CONTROLLER, "controller", \ "Sends \"packet-in\" messages to the OpenFlow controller") \ SPR(SLOW_ACTION, "action", \ @@ -64,6 +63,14 @@ #undef SPR }; +/* Mask of all slow_path_reasons. */ +enum { + SLOW_PATH_REASON_MASK = 0 +#define SPR(ENUM, STRING, EXPLANATION) | 1 << ENUM##_INDEX + SLOW_PATH_REASONS +#undef SPR +}; + const char *slow_path_reason_to_explanation(enum slow_path_reason); #define ODPP_LOCAL ODP_PORT_C(OVSP_LOCAL) @@ -106,23 +113,29 @@ * - OVS_TUNNEL_KEY_ATTR_TTL 1 3 4 8 * - OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT 0 -- 4 4 * - OVS_TUNNEL_KEY_ATTR_CSUM 0 -- 4 4 + * - OVS_TUNNEL_KEY_ATTR_OAM 0 -- 4 4 + * - OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS 256 -- 4 260 + * - OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS - -- - - (shared with _GENEVE_OPTS) * OVS_KEY_ATTR_IN_PORT 4 -- 4 8 * OVS_KEY_ATTR_SKB_MARK 4 -- 4 8 + * OVS_KEY_ATTR_DP_HASH 4 -- 4 8 + * OVS_KEY_ATTR_RECIRC_ID 4 -- 4 8 * OVS_KEY_ATTR_ETHERNET 12 -- 4 16 * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (outer VLAN ethertype) - * OVS_KEY_ATTR_8021Q 4 -- 4 8 + * OVS_KEY_ATTR_VLAN 2 2 4 8 * OVS_KEY_ATTR_ENCAP 0 -- 4 4 (VLAN encapsulation) * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (inner VLAN ethertype) * OVS_KEY_ATTR_IPV6 40 -- 4 44 * OVS_KEY_ATTR_ICMPV6 2 2 4 8 * OVS_KEY_ATTR_ND 28 -- 4 32 * ---------------------------------------------------------- - * total 208 + * total 488 * * We include some slack space in case the calculation isn't quite right or we * add another field and forget to adjust this value. */ -#define ODPUTIL_FLOW_KEY_BYTES 256 +#define ODPUTIL_FLOW_KEY_BYTES 512 +BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); /* A buffer with sufficient size and alignment to hold an nlattr-formatted flow * key. An array of "struct nlattr" might not, in theory, be sufficiently @@ -134,6 +147,8 @@ enum odp_key_fitness odp_tun_key_from_attr(const struct nlattr *, struct flow_tnl *); +int odp_ufid_from_string(const char *s_, ovs_u128 *ufid); +void odp_format_ufid(const ovs_u128 *ufid, struct ds *); void odp_flow_format(const struct nlattr *key, size_t key_len, const struct nlattr *mask, size_t mask_len, const struct hmap *portno_names, struct ds *, @@ -144,10 +159,11 @@ struct ofpbuf *, struct ofpbuf *); void odp_flow_key_from_flow(struct ofpbuf *, const struct flow * flow, - const struct flow *mask, odp_port_t odp_in_port); + const struct flow *mask, odp_port_t odp_in_port, + bool recirc); void odp_flow_key_from_mask(struct ofpbuf *, const struct flow *mask, const struct flow *flow, uint32_t odp_in_port, - size_t max_mpls_depth); + size_t max_mpls_depth, bool recirc); uint32_t odp_flow_key_hash(const struct nlattr *, size_t); @@ -179,10 +195,14 @@ void commit_odp_tunnel_action(const struct flow *, struct flow *base, struct ofpbuf *odp_actions); +void commit_masked_set_action(struct ofpbuf *odp_actions, + enum ovs_key_attr key_type, const void *key, + const void *mask, size_t key_size); enum slow_path_reason commit_odp_actions(const struct flow *, struct flow *base, struct ofpbuf *odp_actions, - struct flow_wildcards *wc); + struct flow_wildcards *wc, + bool use_masked); /* ofproto-dpif interface. * @@ -225,17 +245,19 @@ } flow_sample; struct { - uint16_t type; /* USER_ACTION_COOKIE_IPFIX. */ + uint16_t type; /* USER_ACTION_COOKIE_IPFIX. */ + odp_port_t output_odp_port; /* The output odp port. */ } ipfix; }; BUILD_ASSERT_DECL(sizeof(union user_action_cookie) == 16); size_t odp_put_userspace_action(uint32_t pid, const void *userdata, size_t userdata_size, + odp_port_t tunnel_out_port, struct ofpbuf *odp_actions); void odp_put_tunnel_action(const struct flow_tnl *tunnel, struct ofpbuf *odp_actions); -void odp_put_pkt_mark_action(const uint32_t pkt_mark, - struct ofpbuf *odp_actions); +void odp_put_tnl_push_action(struct ofpbuf *odp_actions, + struct ovs_action_push_tnl *data); #endif /* odp-util.h */ diff -Nru openvswitch-2.3.1/lib/ofp-actions.c openvswitch-2.4.0~git20150623/lib/ofp-actions.c --- openvswitch-2.3.1/lib/ofp-actions.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-actions.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,72 +20,353 @@ #include "byte-order.h" #include "compiler.h" #include "dynamic-string.h" +#include "hmap.h" #include "learn.h" #include "meta-flow.h" #include "multipath.h" #include "nx-match.h" +#include "ofp-parse.h" #include "ofp-util.h" #include "ofpbuf.h" +#include "unaligned.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ofp_actions); static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + +struct ofp_action_header; + +/* Raw identifiers for OpenFlow actions. + * + * Decoding and encoding OpenFlow actions across multiple versions is difficult + * to do in a clean, consistent way. This enumeration lays out all of the + * forms of actions that Open vSwitch supports. + * + * The comments here must follow a stylized form because the + * "extract-ofp-actions" program parses them at build time to generate data + * tables. + * + * - The first part of each comment specifies the vendor, OpenFlow versions, + * and type for each protocol that supports the action: + * + * # The vendor is OF for standard OpenFlow actions, NX for Nicira + * extension actions. (Support for other vendors can be added, but + * it can't be done just based on a vendor ID definition alone + * because OpenFlow doesn't define a standard way to specify a + * subtype for vendor actions, so other vendors might do it different + * from Nicira.) + * + * # The version can specify a specific OpenFlow version, a version + * range delimited by "-", or an open-ended range with "+". + * + * # The type, in parentheses, is the action type number (for standard + * OpenFlow actions) or subtype (for vendor extension actions). + * + * # Optionally one may add "is deprecated" followed by a + * human-readable reason in parentheses (which will be used in log + * messages), if a particular action should no longer be used. + * + * Multiple such specifications may be separated by commas. + * + * - The second part describes the action's wire format. It may be: + * + * # "struct ": The struct fully specifies the wire format. The + * action is exactly the size of the struct. (Thus, the struct must + * be an exact multiple of 8 bytes in size.) + * + * # "struct , ...": The struct specifies the beginning of the + * wire format. An instance of the action is either the struct's + * exact size, or a multiple of 8 bytes longer. + * + * # "uint_t" or "ovs_be": The action consists of a (standard or + * vendor extension) header, followed by 0 or more pad bytes to align + * to a multiple of bits, followed by an argument of the given + * type, followed by 0 or more pad bytes to bring the total action up + * to a multiple of 8 bytes. + * + * # "void": The action is just a (standard or vendor extension) + * header. + * + * - Optional additional text enclosed in square brackets is commentary for + * the human reader. + */ +enum ofp_raw_action_type { +/* ## ----------------- ## */ +/* ## Standard actions. ## */ +/* ## ----------------- ## */ + + /* OF1.0(0): struct ofp10_action_output. */ + OFPAT_RAW10_OUTPUT, + /* OF1.1+(0): struct ofp11_action_output. */ + OFPAT_RAW11_OUTPUT, + + /* OF1.0(1): uint16_t. */ + OFPAT_RAW10_SET_VLAN_VID, + /* OF1.0(2): uint8_t. */ + OFPAT_RAW10_SET_VLAN_PCP, + + /* OF1.1(1), OF1.2+(1) is deprecated (use Set-Field): uint16_t. + * + * [Semantics differ slightly between the 1.0 and 1.1 versions of the VLAN + * modification actions: the 1.0 versions push a VLAN header if none is + * present, but the 1.1 versions do not. That is the only reason that we + * distinguish their raw action types.] */ + OFPAT_RAW11_SET_VLAN_VID, + /* OF1.1(2), OF1.2+(2) is deprecated (use Set-Field): uint8_t. */ + OFPAT_RAW11_SET_VLAN_PCP, + + /* OF1.1+(17): ovs_be16. + * + * [The argument is the Ethertype, e.g. ETH_TYPE_VLAN_8021Q, not the VID or + * TCI.] */ + OFPAT_RAW11_PUSH_VLAN, + + /* OF1.0(3): void. */ + OFPAT_RAW10_STRIP_VLAN, + /* OF1.1+(18): void. */ + OFPAT_RAW11_POP_VLAN, + + /* OF1.0(4), OF1.1(3), OF1.2+(3) is deprecated (use Set-Field): struct + * ofp_action_dl_addr. */ + OFPAT_RAW_SET_DL_SRC, + + /* OF1.0(5), OF1.1(4), OF1.2+(4) is deprecated (use Set-Field): struct + * ofp_action_dl_addr. */ + OFPAT_RAW_SET_DL_DST, + + /* OF1.0(6), OF1.1(5), OF1.2+(5) is deprecated (use Set-Field): + * ovs_be32. */ + OFPAT_RAW_SET_NW_SRC, + + /* OF1.0(7), OF1.1(6), OF1.2+(6) is deprecated (use Set-Field): + * ovs_be32. */ + OFPAT_RAW_SET_NW_DST, + + /* OF1.0(8), OF1.1(7), OF1.2+(7) is deprecated (use Set-Field): uint8_t. */ + OFPAT_RAW_SET_NW_TOS, + + /* OF1.1(8), OF1.2+(8) is deprecated (use Set-Field): uint8_t. */ + OFPAT_RAW11_SET_NW_ECN, + + /* OF1.0(9), OF1.1(9), OF1.2+(9) is deprecated (use Set-Field): + * ovs_be16. */ + OFPAT_RAW_SET_TP_SRC, + + /* OF1.0(10), OF1.1(10), OF1.2+(10) is deprecated (use Set-Field): + * ovs_be16. */ + OFPAT_RAW_SET_TP_DST, + + /* OF1.0(11): struct ofp10_action_enqueue. */ + OFPAT_RAW10_ENQUEUE, + + /* NX1.0(30), OF1.1(13), OF1.2+(13) is deprecated (use Set-Field): + * ovs_be32. */ + OFPAT_RAW_SET_MPLS_LABEL, + + /* NX1.0(31), OF1.1(14), OF1.2+(14) is deprecated (use Set-Field): + * uint8_t. */ + OFPAT_RAW_SET_MPLS_TC, + + /* NX1.0(25), OF1.1(15), OF1.2+(15) is deprecated (use Set-Field): + * uint8_t. */ + OFPAT_RAW_SET_MPLS_TTL, + + /* NX1.0(26), OF1.1+(16): void. */ + OFPAT_RAW_DEC_MPLS_TTL, + + /* NX1.0(23), OF1.1+(19): ovs_be16. + * + * [The argument is the Ethertype, e.g. ETH_TYPE_MPLS, not the label.] */ + OFPAT_RAW_PUSH_MPLS, + + /* NX1.0(24), OF1.1+(20): ovs_be16. + * + * [The argument is the Ethertype, e.g. ETH_TYPE_IPV4 if at BoS or + * ETH_TYPE_MPLS otherwise, not the label.] */ + OFPAT_RAW_POP_MPLS, + + /* NX1.0(4), OF1.1+(21): uint32_t. */ + OFPAT_RAW_SET_QUEUE, + + /* OF1.1+(22): uint32_t. */ + OFPAT_RAW11_GROUP, + + /* OF1.1+(23): uint8_t. */ + OFPAT_RAW11_SET_NW_TTL, + + /* NX1.0(18), OF1.1+(24): void. */ + OFPAT_RAW_DEC_NW_TTL, + /* NX1.0+(21): struct nx_action_cnt_ids, ... */ + NXAST_RAW_DEC_TTL_CNT_IDS, + + /* OF1.2-1.4(25): struct ofp12_action_set_field, ... */ + OFPAT_RAW12_SET_FIELD, + /* OF1.5+(25): struct ofp12_action_set_field, ... */ + OFPAT_RAW15_SET_FIELD, + /* NX1.0-1.4(7): struct nx_action_reg_load. + * + * [In OpenFlow 1.5, set_field is a superset of reg_load functionality, so + * we drop reg_load.] */ + NXAST_RAW_REG_LOAD, + /* NX1.0-1.4(33): struct nx_action_reg_load2, ... + * + * [In OpenFlow 1.5, set_field is a superset of reg_load2 functionality, so + * we drop reg_load2.] */ + NXAST_RAW_REG_LOAD2, + + /* OF1.5+(28): struct ofp15_action_copy_field, ... */ + OFPAT_RAW15_COPY_FIELD, + /* ONF1.3-1.4(3200): struct onf_action_copy_field, ... */ + ONFACT_RAW13_COPY_FIELD, + /* NX1.0-1.4(6): struct nx_action_reg_move, ... */ + NXAST_RAW_REG_MOVE, + +/* ## ------------------------- ## */ +/* ## Nicira extension actions. ## */ +/* ## ------------------------- ## */ + +/* Actions similar to standard actions are listed with the standard actions. */ + + /* NX1.0+(1): uint16_t. */ + NXAST_RAW_RESUBMIT, + /* NX1.0+(14): struct nx_action_resubmit. */ + NXAST_RAW_RESUBMIT_TABLE, + + /* NX1.0+(2): uint32_t. */ + NXAST_RAW_SET_TUNNEL, + /* NX1.0+(9): uint64_t. */ + NXAST_RAW_SET_TUNNEL64, + + /* NX1.0+(5): void. */ + NXAST_RAW_POP_QUEUE, + + /* NX1.0+(8): struct nx_action_note, ... */ + NXAST_RAW_NOTE, + + /* NX1.0+(10): struct nx_action_multipath. */ + NXAST_RAW_MULTIPATH, + + /* NX1.0+(12): struct nx_action_bundle, ... */ + NXAST_RAW_BUNDLE, + /* NX1.0+(13): struct nx_action_bundle, ... */ + NXAST_RAW_BUNDLE_LOAD, + + /* NX1.0+(15): struct nx_action_output_reg. */ + NXAST_RAW_OUTPUT_REG, + /* NX1.0+(32): struct nx_action_output_reg2. */ + NXAST_RAW_OUTPUT_REG2, + + /* NX1.0+(16): struct nx_action_learn, ... */ + NXAST_RAW_LEARN, + + /* NX1.0+(17): void. */ + NXAST_RAW_EXIT, + + /* NX1.0+(19): struct nx_action_fin_timeout. */ + NXAST_RAW_FIN_TIMEOUT, + + /* NX1.0+(20): struct nx_action_controller. */ + NXAST_RAW_CONTROLLER, + + /* NX1.0+(22): struct nx_action_write_metadata. */ + NXAST_RAW_WRITE_METADATA, + + /* NX1.0+(27): struct nx_action_stack. */ + NXAST_RAW_STACK_PUSH, + + /* NX1.0+(28): struct nx_action_stack. */ + NXAST_RAW_STACK_POP, + + /* NX1.0+(29): struct nx_action_sample. */ + NXAST_RAW_SAMPLE, + + /* NX1.0+(34): struct nx_action_conjunction. */ + NXAST_RAW_CONJUNCTION, +}; + +/* OpenFlow actions are always a multiple of 8 bytes in length. */ +#define OFP_ACTION_ALIGN 8 + +/* Define a few functions for working with instructions. */ +#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) \ + static inline const struct STRUCT * OVS_UNUSED \ + instruction_get_##ENUM(const struct ofp11_instruction *inst)\ + { \ + ovs_assert(inst->type == htons(ENUM)); \ + return ALIGNED_CAST(struct STRUCT *, inst); \ + } \ + \ + static inline void OVS_UNUSED \ + instruction_init_##ENUM(struct STRUCT *s) \ + { \ + memset(s, 0, sizeof *s); \ + s->type = htons(ENUM); \ + s->len = htons(sizeof *s); \ + } \ + \ + static inline struct STRUCT * OVS_UNUSED \ + instruction_put_##ENUM(struct ofpbuf *buf) \ + { \ + struct STRUCT *s = ofpbuf_put_uninit(buf, sizeof *s); \ + instruction_init_##ENUM(s); \ + return s; \ + } +OVS_INSTRUCTIONS +#undef DEFINE_INST + +static void ofpacts_update_instruction_actions(struct ofpbuf *openflow, + size_t ofs); +static void pad_ofpat(struct ofpbuf *openflow, size_t start_ofs); + +static enum ofperr ofpacts_verify(const struct ofpact[], size_t ofpacts_len, + uint32_t allowed_ovsinsts); + +static void ofpact_put_set_field(struct ofpbuf *openflow, enum ofp_version, + enum mf_field_id, uint64_t value); + +static enum ofperr ofpact_pull_raw(struct ofpbuf *, enum ofp_version, + enum ofp_raw_action_type *, uint64_t *arg); +static void *ofpact_put_raw(struct ofpbuf *, enum ofp_version, + enum ofp_raw_action_type, uint64_t arg); + +static char *OVS_WARN_UNUSED_RESULT ofpacts_parse( + char *str, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols, + bool allow_instructions); + +#include "ofp-actions.inc1" -/* Converting OpenFlow 1.0 to ofpacts. */ +/* Output actions. */ -union ofp_action { - ovs_be16 type; - struct ofp_action_header header; - struct ofp_action_vendor_header vendor; - struct ofp10_action_output output10; - struct ofp_action_vlan_vid vlan_vid; - struct ofp_action_vlan_pcp vlan_pcp; - struct ofp_action_nw_addr nw_addr; - struct ofp_action_nw_tos nw_tos; - struct ofp11_action_nw_ecn nw_ecn; - struct ofp11_action_nw_ttl nw_ttl; - struct ofp_action_tp_port tp_port; - struct ofp_action_dl_addr dl_addr; - struct ofp10_action_enqueue enqueue; - struct ofp11_action_output ofp11_output; - struct ofp11_action_push push; - struct ofp11_action_pop_mpls ofp11_pop_mpls; - struct ofp11_action_set_queue ofp11_set_queue; - struct ofp11_action_mpls_label ofp11_mpls_label; - struct ofp11_action_mpls_tc ofp11_mpls_tc; - struct ofp11_action_mpls_ttl ofp11_mpls_ttl; - struct ofp11_action_group group; - struct ofp12_action_set_field set_field; - struct nx_action_header nxa_header; - struct nx_action_resubmit resubmit; - struct nx_action_set_tunnel set_tunnel; - struct nx_action_set_tunnel64 set_tunnel64; - struct nx_action_write_metadata write_metadata; - struct nx_action_set_queue set_queue; - struct nx_action_reg_move reg_move; - struct nx_action_reg_load reg_load; - struct nx_action_stack stack; - struct nx_action_note note; - struct nx_action_multipath multipath; - struct nx_action_bundle bundle; - struct nx_action_output_reg output_reg; - struct nx_action_cnt_ids cnt_ids; - struct nx_action_fin_timeout fin_timeout; - struct nx_action_controller controller; - struct nx_action_push_mpls push_mpls; - struct nx_action_mpls_ttl mpls_ttl; - struct nx_action_pop_mpls pop_mpls; - struct nx_action_sample sample; - struct nx_action_learn learn; - struct nx_action_mpls_label mpls_label; - struct nx_action_mpls_tc mpls_tc; +/* Action structure for OFPAT10_OUTPUT, which sends packets out 'port'. + * When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max + * number of bytes to send. A 'max_len' of zero means no bytes of the + * packet should be sent. */ +struct ofp10_action_output { + ovs_be16 type; /* OFPAT10_OUTPUT. */ + ovs_be16 len; /* Length is 8. */ + ovs_be16 port; /* Output port. */ + ovs_be16 max_len; /* Max length to send to controller. */ +}; +OFP_ASSERT(sizeof(struct ofp10_action_output) == 8); + +/* Action structure for OFPAT_OUTPUT, which sends packets out 'port'. + * When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max + * number of bytes to send. A 'max_len' of zero means no bytes of the + * packet should be sent.*/ +struct ofp11_action_output { + ovs_be16 type; /* OFPAT11_OUTPUT. */ + ovs_be16 len; /* Length is 16. */ + ovs_be32 port; /* Output port. */ + ovs_be16 max_len; /* Max length to send to controller. */ + uint8_t pad[6]; /* Pad to 64 bits. */ }; +OFP_ASSERT(sizeof(struct ofp11_action_output) == 16); static enum ofperr -output_from_openflow10(const struct ofp10_action_output *oao, - struct ofpbuf *out) +decode_OFPAT_RAW10_OUTPUT(const struct ofp10_action_output *oao, + struct ofpbuf *out) { struct ofpact_output *output; @@ -97,84 +378,137 @@ } static enum ofperr -enqueue_from_openflow10(const struct ofp10_action_enqueue *oae, - struct ofpbuf *out) +decode_OFPAT_RAW11_OUTPUT(const struct ofp11_action_output *oao, + struct ofpbuf *out) { - struct ofpact_enqueue *enqueue; + struct ofpact_output *output; + enum ofperr error; - enqueue = ofpact_put_ENQUEUE(out); - enqueue->port = u16_to_ofp(ntohs(oae->port)); - enqueue->queue = ntohl(oae->queue_id); - if (ofp_to_u16(enqueue->port) >= ofp_to_u16(OFPP_MAX) - && enqueue->port != OFPP_IN_PORT - && enqueue->port != OFPP_LOCAL) { - return OFPERR_OFPBAC_BAD_OUT_PORT; + output = ofpact_put_OUTPUT(out); + output->max_len = ntohs(oao->max_len); + + error = ofputil_port_from_ofp11(oao->port, &output->port); + if (error) { + return error; } - return 0; + + return ofpact_check_output_port(output->port, OFPP_MAX); } static void -resubmit_from_openflow(const struct nx_action_resubmit *nar, - struct ofpbuf *out) +encode_OUTPUT(const struct ofpact_output *output, + enum ofp_version ofp_version, struct ofpbuf *out) { - struct ofpact_resubmit *resubmit; + if (ofp_version == OFP10_VERSION) { + struct ofp10_action_output *oao; - resubmit = ofpact_put_RESUBMIT(out); - resubmit->ofpact.compat = OFPUTIL_NXAST_RESUBMIT; - resubmit->in_port = u16_to_ofp(ntohs(nar->in_port)); - resubmit->table_id = 0xff; + oao = put_OFPAT10_OUTPUT(out); + oao->port = htons(ofp_to_u16(output->port)); + oao->max_len = htons(output->max_len); + } else { + struct ofp11_action_output *oao; + + oao = put_OFPAT11_OUTPUT(out); + oao->port = ofputil_port_to_ofp11(output->port); + oao->max_len = htons(output->max_len); + } } -static enum ofperr -resubmit_table_from_openflow(const struct nx_action_resubmit *nar, - struct ofpbuf *out) +static char * OVS_WARN_UNUSED_RESULT +parse_OUTPUT(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) { - struct ofpact_resubmit *resubmit; + if (strchr(arg, '[')) { + struct ofpact_output_reg *output_reg; - if (nar->pad[0] || nar->pad[1] || nar->pad[2]) { - return OFPERR_OFPBAC_BAD_ARGUMENT; + output_reg = ofpact_put_OUTPUT_REG(ofpacts); + output_reg->max_len = UINT16_MAX; + return mf_parse_subfield(&output_reg->src, arg); + } else { + struct ofpact_output *output; + + output = ofpact_put_OUTPUT(ofpacts); + if (!ofputil_port_from_string(arg, &output->port)) { + return xasprintf("%s: output to unknown port", arg); + } + output->max_len = output->port == OFPP_CONTROLLER ? UINT16_MAX : 0; + return NULL; } +} - resubmit = ofpact_put_RESUBMIT(out); - resubmit->ofpact.compat = OFPUTIL_NXAST_RESUBMIT_TABLE; - resubmit->in_port = u16_to_ofp(ntohs(nar->in_port)); - resubmit->table_id = nar->table; - return 0; +static void +format_OUTPUT(const struct ofpact_output *a, struct ds *s) +{ + if (ofp_to_u16(a->port) < ofp_to_u16(OFPP_MAX)) { + ds_put_format(s, "output:%"PRIu16, a->port); + } else { + ofputil_format_port(a->port, s); + if (a->port == OFPP_CONTROLLER) { + ds_put_format(s, ":%"PRIu16, a->max_len); + } + } } + +/* Group actions. */ static enum ofperr -output_reg_from_openflow(const struct nx_action_output_reg *naor, - struct ofpbuf *out) +decode_OFPAT_RAW11_GROUP(uint32_t group_id, struct ofpbuf *out) { - struct ofpact_output_reg *output_reg; + ofpact_put_GROUP(out)->group_id = group_id; + return 0; +} - if (!is_all_zeros(naor->zero, sizeof naor->zero)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; +static void +encode_GROUP(const struct ofpact_group *group, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version == OFP10_VERSION) { + /* XXX */ + } else { + put_OFPAT11_GROUP(out, group->group_id); } +} - output_reg = ofpact_put_OUTPUT_REG(out); - output_reg->src.field = mf_from_nxm_header(ntohl(naor->src)); - output_reg->src.ofs = nxm_decode_ofs(naor->ofs_nbits); - output_reg->src.n_bits = nxm_decode_n_bits(naor->ofs_nbits); - output_reg->max_len = ntohs(naor->max_len); - - return mf_check_src(&output_reg->src, NULL); +static char * OVS_WARN_UNUSED_RESULT +parse_GROUP(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_u32(arg, &ofpact_put_GROUP(ofpacts)->group_id); } static void -fin_timeout_from_openflow(const struct nx_action_fin_timeout *naft, - struct ofpbuf *out) +format_GROUP(const struct ofpact_group *a, struct ds *s) { - struct ofpact_fin_timeout *oft; - - oft = ofpact_put_FIN_TIMEOUT(out); - oft->fin_idle_timeout = ntohs(naft->fin_idle_timeout); - oft->fin_hard_timeout = ntohs(naft->fin_hard_timeout); + ds_put_format(s, "group:%"PRIu32, a->group_id); } + +/* Action structure for NXAST_CONTROLLER. + * + * This generalizes using OFPAT_OUTPUT to send a packet to OFPP_CONTROLLER. In + * addition to the 'max_len' that OFPAT_OUTPUT supports, it also allows + * specifying: + * + * - 'reason': The reason code to use in the ofp_packet_in or nx_packet_in. + * + * - 'controller_id': The ID of the controller connection to which the + * ofp_packet_in should be sent. The ofp_packet_in or nx_packet_in is + * sent only to controllers that have the specified controller connection + * ID. See "struct nx_controller_id" for more information. */ +struct nx_action_controller { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_CONTROLLER. */ + ovs_be16 max_len; /* Maximum length to send to controller. */ + ovs_be16 controller_id; /* Controller ID to send packet-in. */ + uint8_t reason; /* enum ofp_packet_in_reason (OFPR_*). */ + uint8_t zero; /* Must be zero. */ +}; +OFP_ASSERT(sizeof(struct nx_action_controller) == 16); -static void -controller_from_openflow(const struct nx_action_controller *nac, - struct ofpbuf *out) +static enum ofperr +decode_NXAST_RAW_CONTROLLER(const struct nx_action_controller *nac, + struct ofpbuf *out) { struct ofpact_controller *oc; @@ -182,2302 +516,4517 @@ oc->max_len = ntohs(nac->max_len); oc->controller_id = ntohs(nac->controller_id); oc->reason = nac->reason; + return 0; } -static enum ofperr -metadata_from_nxast(const struct nx_action_write_metadata *nawm, - struct ofpbuf *out) +static void +encode_CONTROLLER(const struct ofpact_controller *controller, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { - struct ofpact_metadata *om; + struct nx_action_controller *nac; - if (!is_all_zeros(nawm->zeros, sizeof nawm->zeros)) { - return OFPERR_NXBRC_MUST_BE_ZERO; + nac = put_NXAST_CONTROLLER(out); + nac->max_len = htons(controller->max_len); + nac->controller_id = htons(controller->controller_id); + nac->reason = controller->reason; +} + +static char * OVS_WARN_UNUSED_RESULT +parse_CONTROLLER(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + enum ofp_packet_in_reason reason = OFPR_ACTION; + uint16_t controller_id = 0; + uint16_t max_len = UINT16_MAX; + + if (!arg[0]) { + /* Use defaults. */ + } else if (strspn(arg, "0123456789") == strlen(arg)) { + char *error = str_to_u16(arg, "max_len", &max_len); + if (error) { + return error; + } + } else { + char *name, *value; + + while (ofputil_parse_key_value(&arg, &name, &value)) { + if (!strcmp(name, "reason")) { + if (!ofputil_packet_in_reason_from_string(value, &reason)) { + return xasprintf("unknown reason \"%s\"", value); + } + } else if (!strcmp(name, "max_len")) { + char *error = str_to_u16(value, "max_len", &max_len); + if (error) { + return error; + } + } else if (!strcmp(name, "id")) { + char *error = str_to_u16(value, "id", &controller_id); + if (error) { + return error; + } + } else { + return xasprintf("unknown key \"%s\" parsing controller " + "action", name); + } + } } - om = ofpact_put_WRITE_METADATA(out); - om->metadata = nawm->metadata; - om->mask = nawm->mask; + if (reason == OFPR_ACTION && controller_id == 0) { + struct ofpact_output *output; - return 0; + output = ofpact_put_OUTPUT(ofpacts); + output->port = OFPP_CONTROLLER; + output->max_len = max_len; + } else { + struct ofpact_controller *controller; + + controller = ofpact_put_CONTROLLER(ofpacts); + controller->max_len = max_len; + controller->reason = reason; + controller->controller_id = controller_id; + } + + return NULL; } static void -note_from_openflow(const struct nx_action_note *nan, struct ofpbuf *out) +format_CONTROLLER(const struct ofpact_controller *a, struct ds *s) { - struct ofpact_note *note; - unsigned int length; + if (a->reason == OFPR_ACTION && a->controller_id == 0) { + ds_put_format(s, "CONTROLLER:%"PRIu16, a->max_len); + } else { + enum ofp_packet_in_reason reason = a->reason; - length = ntohs(nan->len) - offsetof(struct nx_action_note, note); - note = ofpact_put(out, OFPACT_NOTE, - offsetof(struct ofpact_note, data) + length); - note->length = length; - memcpy(note->data, nan->note, length); + ds_put_cstr(s, "controller("); + if (reason != OFPR_ACTION) { + char reasonbuf[OFPUTIL_PACKET_IN_REASON_BUFSIZE]; + + ds_put_format(s, "reason=%s,", + ofputil_packet_in_reason_to_string( + reason, reasonbuf, sizeof reasonbuf)); + } + if (a->max_len != UINT16_MAX) { + ds_put_format(s, "max_len=%"PRIu16",", a->max_len); + } + if (a->controller_id != 0) { + ds_put_format(s, "id=%"PRIu16",", a->controller_id); + } + ds_chomp(s, ','); + ds_put_char(s, ')'); + } } + +/* Enqueue action. */ +struct ofp10_action_enqueue { + ovs_be16 type; /* OFPAT10_ENQUEUE. */ + ovs_be16 len; /* Len is 16. */ + ovs_be16 port; /* Port that queue belongs. Should + refer to a valid physical port + (i.e. < OFPP_MAX) or OFPP_IN_PORT. */ + uint8_t pad[6]; /* Pad for 64-bit alignment. */ + ovs_be32 queue_id; /* Where to enqueue the packets. */ +}; +OFP_ASSERT(sizeof(struct ofp10_action_enqueue) == 16); static enum ofperr -dec_ttl_from_openflow(struct ofpbuf *out, enum ofputil_action_code compat) +decode_OFPAT_RAW10_ENQUEUE(const struct ofp10_action_enqueue *oae, + struct ofpbuf *out) { - uint16_t id = 0; - struct ofpact_cnt_ids *ids; - enum ofperr error = 0; + struct ofpact_enqueue *enqueue; - ids = ofpact_put_DEC_TTL(out); - ids->ofpact.compat = compat; - ids->n_controllers = 1; - ofpbuf_put(out, &id, sizeof id); - ids = out->frame; - ofpact_update_len(out, &ids->ofpact); - return error; + enqueue = ofpact_put_ENQUEUE(out); + enqueue->port = u16_to_ofp(ntohs(oae->port)); + enqueue->queue = ntohl(oae->queue_id); + if (ofp_to_u16(enqueue->port) >= ofp_to_u16(OFPP_MAX) + && enqueue->port != OFPP_IN_PORT + && enqueue->port != OFPP_LOCAL) { + return OFPERR_OFPBAC_BAD_OUT_PORT; + } + return 0; } -static enum ofperr -dec_ttl_cnt_ids_from_openflow(const struct nx_action_cnt_ids *nac_ids, - struct ofpbuf *out) +static void +encode_ENQUEUE(const struct ofpact_enqueue *enqueue, + enum ofp_version ofp_version, struct ofpbuf *out) { - struct ofpact_cnt_ids *ids; - size_t ids_size; - int i; - - ids = ofpact_put_DEC_TTL(out); - ids->ofpact.compat = OFPUTIL_NXAST_DEC_TTL_CNT_IDS; - ids->n_controllers = ntohs(nac_ids->n_controllers); - ids_size = ntohs(nac_ids->len) - sizeof *nac_ids; + if (ofp_version == OFP10_VERSION) { + struct ofp10_action_enqueue *oae; - if (!is_all_zeros(nac_ids->zeros, sizeof nac_ids->zeros)) { - return OFPERR_NXBRC_MUST_BE_ZERO; + oae = put_OFPAT10_ENQUEUE(out); + oae->port = htons(ofp_to_u16(enqueue->port)); + oae->queue_id = htonl(enqueue->queue); + } else { + /* XXX */ } +} - if (ids_size < ids->n_controllers * sizeof(ovs_be16)) { - VLOG_WARN_RL(&rl, "Nicira action dec_ttl_cnt_ids only has %"PRIuSIZE" bytes " - "allocated for controller ids. %"PRIuSIZE" bytes are required for " - "%"PRIu16" controllers.", ids_size, - ids->n_controllers * sizeof(ovs_be16), ids->n_controllers); - return OFPERR_OFPBAC_BAD_LEN; +static char * OVS_WARN_UNUSED_RESULT +parse_ENQUEUE(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + char *sp = NULL; + char *port = strtok_r(arg, ":q,", &sp); + char *queue = strtok_r(NULL, "", &sp); + struct ofpact_enqueue *enqueue; + + if (port == NULL || queue == NULL) { + return xstrdup("\"enqueue\" syntax is \"enqueue:PORT:QUEUE\" or " + "\"enqueue(PORT,QUEUE)\""); } - for (i = 0; i < ids->n_controllers; i++) { - uint16_t id = ntohs(((ovs_be16 *)(nac_ids + 1))[i]); - ofpbuf_put(out, &id, sizeof id); - ids = out->frame; + enqueue = ofpact_put_ENQUEUE(ofpacts); + if (!ofputil_port_from_string(port, &enqueue->port)) { + return xasprintf("%s: enqueue to unknown port", port); } - - ofpact_update_len(out, &ids->ofpact); - - return 0; + return str_to_u32(queue, &enqueue->queue); } -static enum ofperr -sample_from_openflow(const struct nx_action_sample *nas, - struct ofpbuf *out) +static void +format_ENQUEUE(const struct ofpact_enqueue *a, struct ds *s) { - struct ofpact_sample *sample; + ds_put_format(s, "enqueue:"); + ofputil_format_port(a->port, s); + ds_put_format(s, ":%"PRIu32, a->queue); +} + +/* Action structure for NXAST_OUTPUT_REG. + * + * Outputs to the OpenFlow port number written to src[ofs:ofs+nbits]. + * + * The format and semantics of 'src' and 'ofs_nbits' are similar to those for + * the NXAST_REG_LOAD action. + * + * The acceptable nxm_header values for 'src' are the same as the acceptable + * nxm_header values for the 'src' field of NXAST_REG_MOVE. + * + * The 'max_len' field indicates the number of bytes to send when the chosen + * port is OFPP_CONTROLLER. Its semantics are equivalent to the 'max_len' + * field of OFPAT_OUTPUT. + * + * The 'zero' field is required to be zeroed for forward compatibility. */ +struct nx_action_output_reg { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* 24. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_OUTPUT_REG. */ - sample = ofpact_put_SAMPLE(out); - sample->probability = ntohs(nas->probability); - sample->collector_set_id = ntohl(nas->collector_set_id); - sample->obs_domain_id = ntohl(nas->obs_domain_id); - sample->obs_point_id = ntohl(nas->obs_point_id); + ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ + ovs_be32 src; /* Source. */ - if (sample->probability == 0) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } + ovs_be16 max_len; /* Max length to send to controller. */ - return 0; -} + uint8_t zero[6]; /* Reserved, must be zero. */ +}; +OFP_ASSERT(sizeof(struct nx_action_output_reg) == 24); + +/* Action structure for NXAST_OUTPUT_REG2. + * + * Like the NXAST_OUTPUT_REG but organized so that there is room for a 64-bit + * experimenter OXM as 'src'. + */ +struct nx_action_output_reg2 { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* 24. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_OUTPUT_REG2. */ + + ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ + ovs_be16 max_len; /* Max length to send to controller. */ + + /* Followed by: + * - 'src', as an OXM/NXM header (either 4 or 8 bytes). + * - Enough 0-bytes to pad the action out to 24 bytes. */ + uint8_t pad[10]; +}; +OFP_ASSERT(sizeof(struct nx_action_output_reg2) == 24); static enum ofperr -push_mpls_from_openflow(ovs_be16 ethertype, struct ofpbuf *out) +decode_NXAST_RAW_OUTPUT_REG(const struct nx_action_output_reg *naor, + struct ofpbuf *out) { - struct ofpact_push_mpls *oam; + struct ofpact_output_reg *output_reg; - if (!eth_type_mpls(ethertype)) { + if (!is_all_zeros(naor->zero, sizeof naor->zero)) { return OFPERR_OFPBAC_BAD_ARGUMENT; } - oam = ofpact_put_PUSH_MPLS(out); - oam->ethertype = ethertype; - return 0; + output_reg = ofpact_put_OUTPUT_REG(out); + output_reg->ofpact.raw = NXAST_RAW_OUTPUT_REG; + output_reg->src.field = mf_from_nxm_header(ntohl(naor->src)); + output_reg->src.ofs = nxm_decode_ofs(naor->ofs_nbits); + output_reg->src.n_bits = nxm_decode_n_bits(naor->ofs_nbits); + output_reg->max_len = ntohs(naor->max_len); + + return mf_check_src(&output_reg->src, NULL); } static enum ofperr -decode_nxast_action(const union ofp_action *a, enum ofputil_action_code *code) +decode_NXAST_RAW_OUTPUT_REG2(const struct nx_action_output_reg2 *naor, + struct ofpbuf *out) { - const struct nx_action_header *nah = &a->nxa_header; - uint16_t len = ntohs(a->header.len); - - if (len < sizeof(struct nx_action_header)) { - return OFPERR_OFPBAC_BAD_LEN; - } else if (a->vendor.vendor != CONSTANT_HTONL(NX_VENDOR_ID)) { - return OFPERR_OFPBAC_BAD_VENDOR; - } + struct ofpact_output_reg *output_reg; + enum ofperr error; + struct ofpbuf b; - switch (nah->subtype) { -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case CONSTANT_HTONS(ENUM): \ - if (EXTENSIBLE \ - ? len >= sizeof(struct STRUCT) \ - : len == sizeof(struct STRUCT)) { \ - *code = OFPUTIL_##ENUM; \ - return 0; \ - } else { \ - return OFPERR_OFPBAC_BAD_LEN; \ - } \ - OVS_NOT_REACHED(); -#include "ofp-util.def" + output_reg = ofpact_put_OUTPUT_REG(out); + output_reg->ofpact.raw = NXAST_RAW_OUTPUT_REG2; + output_reg->src.ofs = nxm_decode_ofs(naor->ofs_nbits); + output_reg->src.n_bits = nxm_decode_n_bits(naor->ofs_nbits); + output_reg->max_len = ntohs(naor->max_len); - case CONSTANT_HTONS(NXAST_SNAT__OBSOLETE): - case CONSTANT_HTONS(NXAST_DROP_SPOOFED_ARP__OBSOLETE): - default: - return OFPERR_OFPBAC_BAD_TYPE; + ofpbuf_use_const(&b, naor, ntohs(naor->len)); + ofpbuf_pull(&b, OBJECT_OFFSETOF(naor, pad)); + error = nx_pull_header(&b, &output_reg->src.field, NULL); + if (error) { + return error; } + if (!is_all_zeros(b.data, b.size)) { + return OFPERR_NXBRC_MUST_BE_ZERO; + } + + return mf_check_src(&output_reg->src, NULL); } -/* Parses 'a' to determine its type. On success stores the correct type into - * '*code' and returns 0. On failure returns an OFPERR_* error code and - * '*code' is indeterminate. - * - * The caller must have already verified that 'a''s length is potentially - * correct (that is, a->header.len is nonzero and a multiple of - * OFP_ACTION_ALIGN and no longer than the amount of space allocated to 'a'). - * - * This function verifies that 'a''s length is correct for the type of action - * that it represents. */ -static enum ofperr -decode_openflow10_action(const union ofp_action *a, - enum ofputil_action_code *code) +static void +encode_OUTPUT_REG(const struct ofpact_output_reg *output_reg, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) { - switch (a->type) { - case CONSTANT_HTONS(OFPAT10_VENDOR): - return decode_nxast_action(a, code); - -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) \ - case CONSTANT_HTONS(ENUM): \ - if (a->header.len == htons(sizeof(struct STRUCT))) { \ - *code = OFPUTIL_##ENUM; \ - return 0; \ - } else { \ - return OFPERR_OFPBAC_BAD_LEN; \ - } \ - break; -#include "ofp-util.def" + /* If 'output_reg' came in as an NXAST_RAW_OUTPUT_REG2 action, or if it + * cannot be encoded in the older form, encode it as + * NXAST_RAW_OUTPUT_REG2. */ + if (output_reg->ofpact.raw == NXAST_RAW_OUTPUT_REG2 + || !mf_nxm_header(output_reg->src.field->id)) { + struct nx_action_output_reg2 *naor = put_NXAST_OUTPUT_REG2(out); + size_t size = out->size; + + naor->ofs_nbits = nxm_encode_ofs_nbits(output_reg->src.ofs, + output_reg->src.n_bits); + naor->max_len = htons(output_reg->max_len); + + out->size = size - sizeof naor->pad; + nx_put_header(out, output_reg->src.field->id, 0, false); + out->size = size; + } else { + struct nx_action_output_reg *naor = put_NXAST_OUTPUT_REG(out); - default: - return OFPERR_OFPBAC_BAD_TYPE; + naor->ofs_nbits = nxm_encode_ofs_nbits(output_reg->src.ofs, + output_reg->src.n_bits); + naor->src = htonl(mf_nxm_header(output_reg->src.field->id)); + naor->max_len = htons(output_reg->max_len); } } -static enum ofperr -ofpact_from_nxast(const union ofp_action *a, enum ofputil_action_code code, - struct ofpbuf *out) +static char * OVS_WARN_UNUSED_RESULT +parse_OUTPUT_REG(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) { - struct ofpact_tunnel *tunnel; - enum ofperr error = 0; - - switch (code) { - case OFPUTIL_ACTION_INVALID: -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM: -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#include "ofp-util.def" - OVS_NOT_REACHED(); - - case OFPUTIL_NXAST_RESUBMIT: - resubmit_from_openflow(&a->resubmit, out); - break; + return parse_OUTPUT(arg, ofpacts, usable_protocols); +} - case OFPUTIL_NXAST_SET_TUNNEL: - tunnel = ofpact_put_SET_TUNNEL(out); - tunnel->ofpact.compat = code; - tunnel->tun_id = ntohl(a->set_tunnel.tun_id); - break; +static void +format_OUTPUT_REG(const struct ofpact_output_reg *a, struct ds *s) +{ + ds_put_cstr(s, "output:"); + mf_format_subfield(&a->src, s); +} + +/* Action structure for NXAST_BUNDLE and NXAST_BUNDLE_LOAD. + * + * The bundle actions choose a slave from a supplied list of options. + * NXAST_BUNDLE outputs to its selection. NXAST_BUNDLE_LOAD writes its + * selection to a register. + * + * The list of possible slaves follows the nx_action_bundle structure. The size + * of each slave is governed by its type as indicated by the 'slave_type' + * parameter. The list of slaves should be padded at its end with zeros to make + * the total length of the action a multiple of 8. + * + * Switches infer from the 'slave_type' parameter the size of each slave. All + * implementations must support the NXM_OF_IN_PORT 'slave_type' which indicates + * that the slaves are OpenFlow port numbers with NXM_LENGTH(NXM_OF_IN_PORT) == + * 2 byte width. Switches should reject actions which indicate unknown or + * unsupported slave types. + * + * Switches use a strategy dictated by the 'algorithm' parameter to choose a + * slave. If the switch does not support the specified 'algorithm' parameter, + * it should reject the action. + * + * Several algorithms take into account liveness when selecting slaves. The + * liveness of a slave is implementation defined (with one exception), but will + * generally take into account things like its carrier status and the results + * of any link monitoring protocols which happen to be running on it. In order + * to give controllers a place-holder value, the OFPP_NONE port is always + * considered live. + * + * Some slave selection strategies require the use of a hash function, in which + * case the 'fields' and 'basis' parameters should be populated. The 'fields' + * parameter (one of NX_HASH_FIELDS_*) designates which parts of the flow to + * hash. Refer to the definition of "enum nx_hash_fields" for details. The + * 'basis' parameter is used as a universal hash parameter. Different values + * of 'basis' yield different hash results. + * + * The 'zero' parameter at the end of the action structure is reserved for + * future use. Switches are required to reject actions which have nonzero + * bytes in the 'zero' field. + * + * NXAST_BUNDLE actions should have 'ofs_nbits' and 'dst' zeroed. Switches + * should reject actions which have nonzero bytes in either of these fields. + * + * NXAST_BUNDLE_LOAD stores the OpenFlow port number of the selected slave in + * dst[ofs:ofs+n_bits]. The format and semantics of 'dst' and 'ofs_nbits' are + * similar to those for the NXAST_REG_LOAD action. */ +struct nx_action_bundle { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length including slaves. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_BUNDLE or NXAST_BUNDLE_LOAD. */ + + /* Slave choice algorithm to apply to hash value. */ + ovs_be16 algorithm; /* One of NX_BD_ALG_*. */ + + /* What fields to hash and how. */ + ovs_be16 fields; /* One of NX_HASH_FIELDS_*. */ + ovs_be16 basis; /* Universal hash parameter. */ - case OFPUTIL_NXAST_WRITE_METADATA: - error = metadata_from_nxast(&a->write_metadata, out); - break; + ovs_be32 slave_type; /* NXM_OF_IN_PORT. */ + ovs_be16 n_slaves; /* Number of slaves. */ - case OFPUTIL_NXAST_SET_QUEUE: - ofpact_put_SET_QUEUE(out)->queue_id = ntohl(a->set_queue.queue_id); - break; + ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ + ovs_be32 dst; /* Destination. */ - case OFPUTIL_NXAST_POP_QUEUE: - ofpact_put_POP_QUEUE(out); - break; + uint8_t zero[4]; /* Reserved. Must be zero. */ +}; +OFP_ASSERT(sizeof(struct nx_action_bundle) == 32); - case OFPUTIL_NXAST_REG_MOVE: - error = nxm_reg_move_from_openflow(&a->reg_move, out); - break; +static enum ofperr +decode_bundle(bool load, const struct nx_action_bundle *nab, + struct ofpbuf *ofpacts) +{ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + struct ofpact_bundle *bundle; + uint32_t slave_type; + size_t slaves_size, i; + enum ofperr error; - case OFPUTIL_NXAST_REG_LOAD: - error = nxm_reg_load_from_openflow(&a->reg_load, out); - break; + bundle = ofpact_put_BUNDLE(ofpacts); - case OFPUTIL_NXAST_STACK_PUSH: - error = nxm_stack_push_from_openflow(&a->stack, out); - break; + bundle->n_slaves = ntohs(nab->n_slaves); + bundle->basis = ntohs(nab->basis); + bundle->fields = ntohs(nab->fields); + bundle->algorithm = ntohs(nab->algorithm); + slave_type = ntohl(nab->slave_type); + slaves_size = ntohs(nab->len) - sizeof *nab; + + error = OFPERR_OFPBAC_BAD_ARGUMENT; + if (!flow_hash_fields_valid(bundle->fields)) { + VLOG_WARN_RL(&rl, "unsupported fields %d", (int) bundle->fields); + } else if (bundle->n_slaves > BUNDLE_MAX_SLAVES) { + VLOG_WARN_RL(&rl, "too many slaves"); + } else if (bundle->algorithm != NX_BD_ALG_HRW + && bundle->algorithm != NX_BD_ALG_ACTIVE_BACKUP) { + VLOG_WARN_RL(&rl, "unsupported algorithm %d", (int) bundle->algorithm); + } else if (slave_type != mf_nxm_header(MFF_IN_PORT)) { + VLOG_WARN_RL(&rl, "unsupported slave type %"PRIu16, slave_type); + } else { + error = 0; + } - case OFPUTIL_NXAST_STACK_POP: - error = nxm_stack_pop_from_openflow(&a->stack, out); - break; + if (!is_all_zeros(nab->zero, sizeof nab->zero)) { + VLOG_WARN_RL(&rl, "reserved field is nonzero"); + error = OFPERR_OFPBAC_BAD_ARGUMENT; + } - case OFPUTIL_NXAST_NOTE: - note_from_openflow(&a->note, out); - break; + if (load) { + bundle->dst.field = mf_from_nxm_header(ntohl(nab->dst)); + bundle->dst.ofs = nxm_decode_ofs(nab->ofs_nbits); + bundle->dst.n_bits = nxm_decode_n_bits(nab->ofs_nbits); - case OFPUTIL_NXAST_SET_TUNNEL64: - tunnel = ofpact_put_SET_TUNNEL(out); - tunnel->ofpact.compat = code; - tunnel->tun_id = ntohll(a->set_tunnel64.tun_id); - break; + if (bundle->dst.n_bits < 16) { + VLOG_WARN_RL(&rl, "bundle_load action requires at least 16 bit " + "destination."); + error = OFPERR_OFPBAC_BAD_ARGUMENT; + } + } else { + if (nab->ofs_nbits || nab->dst) { + VLOG_WARN_RL(&rl, "bundle action has nonzero reserved fields"); + error = OFPERR_OFPBAC_BAD_ARGUMENT; + } + } - case OFPUTIL_NXAST_MULTIPATH: - error = multipath_from_openflow(&a->multipath, - ofpact_put_MULTIPATH(out)); - break; + if (slaves_size < bundle->n_slaves * sizeof(ovs_be16)) { + VLOG_WARN_RL(&rl, "Nicira action %s only has %"PRIuSIZE" bytes " + "allocated for slaves. %"PRIuSIZE" bytes are required " + "for %"PRIu16" slaves.", + load ? "bundle_load" : "bundle", slaves_size, + bundle->n_slaves * sizeof(ovs_be16), bundle->n_slaves); + error = OFPERR_OFPBAC_BAD_LEN; + } - case OFPUTIL_NXAST_BUNDLE: - case OFPUTIL_NXAST_BUNDLE_LOAD: - error = bundle_from_openflow(&a->bundle, out); - break; + for (i = 0; i < bundle->n_slaves; i++) { + uint16_t ofp_port = ntohs(((ovs_be16 *)(nab + 1))[i]); + ofpbuf_put(ofpacts, &ofp_port, sizeof ofp_port); + } - case OFPUTIL_NXAST_OUTPUT_REG: - error = output_reg_from_openflow(&a->output_reg, out); - break; + bundle = ofpacts->header; + ofpact_update_len(ofpacts, &bundle->ofpact); - case OFPUTIL_NXAST_RESUBMIT_TABLE: - error = resubmit_table_from_openflow(&a->resubmit, out); - break; + if (!error) { + error = bundle_check(bundle, OFPP_MAX, NULL); + } + return error; +} - case OFPUTIL_NXAST_LEARN: - error = learn_from_openflow(&a->learn, out); - break; +static enum ofperr +decode_NXAST_RAW_BUNDLE(const struct nx_action_bundle *nab, struct ofpbuf *out) +{ + return decode_bundle(false, nab, out); +} - case OFPUTIL_NXAST_EXIT: - ofpact_put_EXIT(out); - break; +static enum ofperr +decode_NXAST_RAW_BUNDLE_LOAD(const struct nx_action_bundle *nab, + struct ofpbuf *out) +{ + return decode_bundle(true, nab, out); +} - case OFPUTIL_NXAST_DEC_TTL: - error = dec_ttl_from_openflow(out, code); - break; +static void +encode_BUNDLE(const struct ofpact_bundle *bundle, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) +{ + int slaves_len = ROUND_UP(2 * bundle->n_slaves, OFP_ACTION_ALIGN); + struct nx_action_bundle *nab; + ovs_be16 *slaves; + size_t i; - case OFPUTIL_NXAST_DEC_TTL_CNT_IDS: - error = dec_ttl_cnt_ids_from_openflow(&a->cnt_ids, out); - break; + nab = (bundle->dst.field + ? put_NXAST_BUNDLE_LOAD(out) + : put_NXAST_BUNDLE(out)); + nab->len = htons(ntohs(nab->len) + slaves_len); + nab->algorithm = htons(bundle->algorithm); + nab->fields = htons(bundle->fields); + nab->basis = htons(bundle->basis); + nab->slave_type = htonl(mf_nxm_header(MFF_IN_PORT)); + nab->n_slaves = htons(bundle->n_slaves); + if (bundle->dst.field) { + nab->ofs_nbits = nxm_encode_ofs_nbits(bundle->dst.ofs, + bundle->dst.n_bits); + nab->dst = htonl(mf_nxm_header(bundle->dst.field->id)); + } - case OFPUTIL_NXAST_FIN_TIMEOUT: - fin_timeout_from_openflow(&a->fin_timeout, out); - break; + slaves = ofpbuf_put_zeros(out, slaves_len); + for (i = 0; i < bundle->n_slaves; i++) { + slaves[i] = htons(ofp_to_u16(bundle->slaves[i])); + } +} - case OFPUTIL_NXAST_CONTROLLER: - controller_from_openflow(&a->controller, out); - break; +static char * OVS_WARN_UNUSED_RESULT +parse_BUNDLE(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return bundle_parse(arg, ofpacts); +} - case OFPUTIL_NXAST_PUSH_MPLS: - error = push_mpls_from_openflow(a->push_mpls.ethertype, out); - break; +static char * OVS_WARN_UNUSED_RESULT +parse_bundle_load(const char *arg, struct ofpbuf *ofpacts) +{ + return bundle_parse_load(arg, ofpacts); +} - case OFPUTIL_NXAST_SET_MPLS_LABEL: - ofpact_put_SET_MPLS_LABEL(out)->label = a->mpls_label.label; - break; +static void +format_BUNDLE(const struct ofpact_bundle *a, struct ds *s) +{ + bundle_format(a, s); +} + +/* Set VLAN actions. */ - case OFPUTIL_NXAST_SET_MPLS_TC: - ofpact_put_SET_MPLS_TC(out)->tc = a->mpls_tc.tc; - break; +static enum ofperr +decode_set_vlan_vid(uint16_t vid, bool push_vlan_if_needed, struct ofpbuf *out) +{ + if (vid & ~0xfff) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } else { + struct ofpact_vlan_vid *vlan_vid = ofpact_put_SET_VLAN_VID(out); + vlan_vid->vlan_vid = vid; + vlan_vid->push_vlan_if_needed = push_vlan_if_needed; + return 0; + } +} - case OFPUTIL_NXAST_SET_MPLS_TTL: - ofpact_put_SET_MPLS_TTL(out)->ttl = a->mpls_ttl.ttl; - break; +static enum ofperr +decode_OFPAT_RAW10_SET_VLAN_VID(uint16_t vid, struct ofpbuf *out) +{ + return decode_set_vlan_vid(vid, true, out); +} - case OFPUTIL_NXAST_DEC_MPLS_TTL: - ofpact_put_DEC_MPLS_TTL(out); - break; +static enum ofperr +decode_OFPAT_RAW11_SET_VLAN_VID(uint16_t vid, struct ofpbuf *out) +{ + return decode_set_vlan_vid(vid, false, out); +} - case OFPUTIL_NXAST_POP_MPLS: - if (eth_type_mpls(a->pop_mpls.ethertype)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - ofpact_put_POP_MPLS(out)->ethertype = a->pop_mpls.ethertype; - break; +static void +encode_SET_VLAN_VID(const struct ofpact_vlan_vid *vlan_vid, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + uint16_t vid = vlan_vid->vlan_vid; - case OFPUTIL_NXAST_SAMPLE: - error = sample_from_openflow(&a->sample, out); - break; + /* Push a VLAN tag, if none is present and this form of the action calls + * for such a feature. */ + if (ofp_version > OFP10_VERSION + && vlan_vid->push_vlan_if_needed + && !vlan_vid->flow_has_vlan) { + put_OFPAT11_PUSH_VLAN(out, htons(ETH_TYPE_VLAN_8021Q)); + } + + if (ofp_version == OFP10_VERSION) { + put_OFPAT10_SET_VLAN_VID(out, vid); + } else if (ofp_version == OFP11_VERSION) { + put_OFPAT11_SET_VLAN_VID(out, vid); + } else { + ofpact_put_set_field(out, ofp_version, + MFF_VLAN_VID, vid | OFPVID12_PRESENT); } - - return error; } -static enum ofperr -ofpact_from_openflow10(const union ofp_action *a, - enum ofp_version version OVS_UNUSED, - struct ofpbuf *out) +static char * OVS_WARN_UNUSED_RESULT +parse_set_vlan_vid(char *arg, struct ofpbuf *ofpacts, bool push_vlan_if_needed) { - enum ofputil_action_code code; - enum ofperr error; struct ofpact_vlan_vid *vlan_vid; - struct ofpact_vlan_pcp *vlan_pcp; + uint16_t vid; + char *error; - error = decode_openflow10_action(a, &code); + error = str_to_u16(arg, "VLAN VID", &vid); if (error) { return error; } - switch (code) { - case OFPUTIL_ACTION_INVALID: -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#include "ofp-util.def" - OVS_NOT_REACHED(); - - case OFPUTIL_OFPAT10_OUTPUT: - return output_from_openflow10(&a->output10, out); - - case OFPUTIL_OFPAT10_SET_VLAN_VID: - if (a->vlan_vid.vlan_vid & ~htons(0xfff)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - vlan_vid = ofpact_put_SET_VLAN_VID(out); - vlan_vid->vlan_vid = ntohs(a->vlan_vid.vlan_vid); - vlan_vid->push_vlan_if_needed = true; - vlan_vid->ofpact.compat = code; - break; - - case OFPUTIL_OFPAT10_SET_VLAN_PCP: - if (a->vlan_pcp.vlan_pcp & ~7) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - vlan_pcp = ofpact_put_SET_VLAN_PCP(out); - vlan_pcp->vlan_pcp = a->vlan_pcp.vlan_pcp; - vlan_pcp->push_vlan_if_needed = true; - vlan_pcp->ofpact.compat = code; - break; - - case OFPUTIL_OFPAT10_STRIP_VLAN: - ofpact_put_STRIP_VLAN(out)->ofpact.compat = code; - break; - - case OFPUTIL_OFPAT10_SET_DL_SRC: - memcpy(ofpact_put_SET_ETH_SRC(out)->mac, a->dl_addr.dl_addr, - ETH_ADDR_LEN); - break; - - case OFPUTIL_OFPAT10_SET_DL_DST: - memcpy(ofpact_put_SET_ETH_DST(out)->mac, a->dl_addr.dl_addr, - ETH_ADDR_LEN); - break; - - case OFPUTIL_OFPAT10_SET_NW_SRC: - ofpact_put_SET_IPV4_SRC(out)->ipv4 = a->nw_addr.nw_addr; - break; - - case OFPUTIL_OFPAT10_SET_NW_DST: - ofpact_put_SET_IPV4_DST(out)->ipv4 = a->nw_addr.nw_addr; - break; - - case OFPUTIL_OFPAT10_SET_NW_TOS: - if (a->nw_tos.nw_tos & ~IP_DSCP_MASK) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - ofpact_put_SET_IP_DSCP(out)->dscp = a->nw_tos.nw_tos; - break; - - case OFPUTIL_OFPAT10_SET_TP_SRC: - ofpact_put_SET_L4_SRC_PORT(out)->port = ntohs(a->tp_port.tp_port); - break; - - case OFPUTIL_OFPAT10_SET_TP_DST: - ofpact_put_SET_L4_DST_PORT(out)->port = ntohs(a->tp_port.tp_port); - - break; - - case OFPUTIL_OFPAT10_ENQUEUE: - error = enqueue_from_openflow10(&a->enqueue, out); - break; - -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#include "ofp-util.def" - return ofpact_from_nxast(a, code, out); + if (vid & ~VLAN_VID_MASK) { + return xasprintf("%s: not a valid VLAN VID", arg); } + vlan_vid = ofpact_put_SET_VLAN_VID(ofpacts); + vlan_vid->vlan_vid = vid; + vlan_vid->push_vlan_if_needed = push_vlan_if_needed; + return NULL; +} - return error; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_VLAN_VID(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return parse_set_vlan_vid(arg, ofpacts, false); } -static enum ofperr ofpact_from_openflow11(const union ofp_action *, - enum ofp_version, - struct ofpbuf *out); +static void +format_SET_VLAN_VID(const struct ofpact_vlan_vid *a, struct ds *s) +{ + ds_put_format(s, "%s:%"PRIu16, + a->push_vlan_if_needed ? "mod_vlan_vid" : "set_vlan_vid", + a->vlan_vid); +} + +/* Set PCP actions. */ -static inline union ofp_action * -action_next(const union ofp_action *a) +static enum ofperr +decode_set_vlan_pcp(uint8_t pcp, bool push_vlan_if_needed, struct ofpbuf *out) { - return ((union ofp_action *) (void *) - ((uint8_t *) a + ntohs(a->header.len))); + if (pcp & ~7) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } else { + struct ofpact_vlan_pcp *vlan_pcp = ofpact_put_SET_VLAN_PCP(out); + vlan_pcp->vlan_pcp = pcp; + vlan_pcp->push_vlan_if_needed = push_vlan_if_needed; + return 0; + } } -static inline bool -action_is_valid(const union ofp_action *a, size_t max_actions) +static enum ofperr +decode_OFPAT_RAW10_SET_VLAN_PCP(uint8_t pcp, struct ofpbuf *out) { - uint16_t len = ntohs(a->header.len); - return (!(len % OFP_ACTION_ALIGN) - && len >= OFP_ACTION_ALIGN - && len / OFP_ACTION_ALIGN <= max_actions); + return decode_set_vlan_pcp(pcp, true, out); } -/* This macro is careful to check for actions with bad lengths. */ -#define ACTION_FOR_EACH(ITER, LEFT, ACTIONS, MAX_ACTIONS) \ - for ((ITER) = (ACTIONS), (LEFT) = (MAX_ACTIONS); \ - (LEFT) > 0 && action_is_valid(ITER, LEFT); \ - ((LEFT) -= ntohs((ITER)->header.len) / OFP_ACTION_ALIGN, \ - (ITER) = action_next(ITER))) +static enum ofperr +decode_OFPAT_RAW11_SET_VLAN_PCP(uint8_t pcp, struct ofpbuf *out) +{ + return decode_set_vlan_pcp(pcp, false, out); +} static void -log_bad_action(const union ofp_action *actions, size_t max_actions, - const union ofp_action *bad_action, enum ofperr error) +encode_SET_VLAN_PCP(const struct ofpact_vlan_pcp *vlan_pcp, + enum ofp_version ofp_version, struct ofpbuf *out) { - if (!VLOG_DROP_WARN(&rl)) { - struct ds s; + uint8_t pcp = vlan_pcp->vlan_pcp; - ds_init(&s); - ds_put_hex_dump(&s, actions, max_actions * OFP_ACTION_ALIGN, 0, false); - VLOG_WARN("bad action at offset %#"PRIxPTR" (%s):\n%s", - (char *)bad_action - (char *)actions, - ofperr_get_name(error), ds_cstr(&s)); - ds_destroy(&s); + /* Push a VLAN tag, if none is present and this form of the action calls + * for such a feature. */ + if (ofp_version > OFP10_VERSION + && vlan_pcp->push_vlan_if_needed + && !vlan_pcp->flow_has_vlan) { + put_OFPAT11_PUSH_VLAN(out, htons(ETH_TYPE_VLAN_8021Q)); + } + + if (ofp_version == OFP10_VERSION) { + put_OFPAT10_SET_VLAN_PCP(out, pcp); + } else if (ofp_version == OFP11_VERSION) { + put_OFPAT11_SET_VLAN_PCP(out, pcp); + } else { + ofpact_put_set_field(out, ofp_version, MFF_VLAN_PCP, pcp); } } -static enum ofperr -ofpacts_from_openflow(const union ofp_action *in, size_t n_in, - enum ofp_version version, struct ofpbuf *out) +static char * OVS_WARN_UNUSED_RESULT +parse_set_vlan_pcp(char *arg, struct ofpbuf *ofpacts, bool push_vlan_if_needed) { - const union ofp_action *a; - size_t left; + struct ofpact_vlan_pcp *vlan_pcp; + uint8_t pcp; + char *error; - enum ofperr (*ofpact_from_openflow)(const union ofp_action *a, - enum ofp_version, - struct ofpbuf *out) = - (version == OFP10_VERSION) ? - ofpact_from_openflow10 : ofpact_from_openflow11; + error = str_to_u8(arg, "VLAN PCP", &pcp); + if (error) { + return error; + } - ACTION_FOR_EACH (a, left, in, n_in) { - enum ofperr error = ofpact_from_openflow(a, version, out); - if (error) { - log_bad_action(in, n_in, a, error); - return error; - } - } - if (left) { - enum ofperr error = OFPERR_OFPBAC_BAD_LEN; - log_bad_action(in, n_in, a, error); - return error; + if (pcp & ~7) { + return xasprintf("%s: not a valid VLAN PCP", arg); } + vlan_pcp = ofpact_put_SET_VLAN_PCP(ofpacts); + vlan_pcp->vlan_pcp = pcp; + vlan_pcp->push_vlan_if_needed = push_vlan_if_needed; + return NULL; +} - ofpact_pad(out); - return 0; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_VLAN_PCP(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return parse_set_vlan_pcp(arg, ofpacts, false); } -/* Attempts to convert 'actions_len' bytes of OpenFlow actions from the - * front of 'openflow' into ofpacts. On success, replaces any existing content - * in 'ofpacts' by the converted ofpacts; on failure, clears 'ofpacts'. - * Returns 0 if successful, otherwise an OpenFlow error. - * - * Actions are processed according to their OpenFlow version which - * is provided in the 'version' parameter. - * - * In most places in OpenFlow 1.1 and 1.2, actions appear encapsulated in - * instructions, so you should call ofpacts_pull_openflow_instructions() - * instead of this function. - * - * The parsed actions are valid generically, but they may not be valid in a - * specific context. For example, port numbers up to OFPP_MAX are valid - * generically, but specific datapaths may only support port numbers in a - * smaller range. Use ofpacts_check() to additional check whether actions are - * valid in a specific context. */ -enum ofperr -ofpacts_pull_openflow_actions(struct ofpbuf *openflow, - unsigned int actions_len, - enum ofp_version version, - struct ofpbuf *ofpacts) { - const union ofp_action *actions; - enum ofperr error; +static void +format_SET_VLAN_PCP(const struct ofpact_vlan_pcp *a, struct ds *s) +{ + ds_put_format(s, "%s:%"PRIu8, + a->push_vlan_if_needed ? "mod_vlan_pcp" : "set_vlan_pcp", + a->vlan_pcp); +} + +/* Strip VLAN actions. */ - ofpbuf_clear(ofpacts); +static enum ofperr +decode_OFPAT_RAW10_STRIP_VLAN(struct ofpbuf *out) +{ + ofpact_put_STRIP_VLAN(out)->ofpact.raw = OFPAT_RAW10_STRIP_VLAN; + return 0; +} - if (actions_len % OFP_ACTION_ALIGN != 0) { - VLOG_WARN_RL(&rl, "OpenFlow message actions length %u is not a " - "multiple of %d", actions_len, OFP_ACTION_ALIGN); - return OFPERR_OFPBRC_BAD_LEN; - } +static enum ofperr +decode_OFPAT_RAW11_POP_VLAN(struct ofpbuf *out) +{ + ofpact_put_STRIP_VLAN(out)->ofpact.raw = OFPAT_RAW11_POP_VLAN; + return 0; +} - actions = ofpbuf_try_pull(openflow, actions_len); - if (actions == NULL) { - VLOG_WARN_RL(&rl, "OpenFlow message actions length %u exceeds " - "remaining message length (%"PRIu32")", - actions_len, ofpbuf_size(openflow)); - return OFPERR_OFPBRC_BAD_LEN; +static void +encode_STRIP_VLAN(const struct ofpact_null *null OVS_UNUSED, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version == OFP10_VERSION) { + put_OFPAT10_STRIP_VLAN(out); + } else { + put_OFPAT11_POP_VLAN(out); } +} - error = ofpacts_from_openflow(actions, actions_len / OFP_ACTION_ALIGN, - version, ofpacts); - if (error) { - ofpbuf_clear(ofpacts); - return error; - } +static char * OVS_WARN_UNUSED_RESULT +parse_STRIP_VLAN(char *arg OVS_UNUSED, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + ofpact_put_STRIP_VLAN(ofpacts)->ofpact.raw = OFPAT_RAW10_STRIP_VLAN; + return NULL; +} - error = ofpacts_verify(ofpbuf_data(ofpacts), ofpbuf_size(ofpacts)); - if (error) { - ofpbuf_clear(ofpacts); - } - return error; +static char * OVS_WARN_UNUSED_RESULT +parse_pop_vlan(struct ofpbuf *ofpacts) +{ + ofpact_put_STRIP_VLAN(ofpacts)->ofpact.raw = OFPAT_RAW11_POP_VLAN; + return NULL; } +static void +format_STRIP_VLAN(const struct ofpact_null *a, struct ds *s) +{ + ds_put_cstr(s, (a->ofpact.raw == OFPAT_RAW11_POP_VLAN + ? "pop_vlan" + : "strip_vlan")); +} -/* OpenFlow 1.1 actions. */ +/* Push VLAN action. */ -/* Parses 'a' to determine its type. On success stores the correct type into - * '*code' and returns 0. On failure returns an OFPERR_* error code and - * '*code' is indeterminate. - * - * The caller must have already verified that 'a''s length is potentially - * correct (that is, a->header.len is nonzero and a multiple of - * OFP_ACTION_ALIGN and no longer than the amount of space allocated to 'a'). - * - * This function verifies that 'a''s length is correct for the type of action - * that it represents. */ static enum ofperr -decode_openflow11_action(const union ofp_action *a, - enum ofputil_action_code *code) +decode_OFPAT_RAW11_PUSH_VLAN(ovs_be16 eth_type, struct ofpbuf *out) { - uint16_t len; - - switch (a->type) { - case CONSTANT_HTONS(OFPAT11_EXPERIMENTER): - return decode_nxast_action(a, code); - -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case CONSTANT_HTONS(ENUM): \ - len = ntohs(a->header.len); \ - if (EXTENSIBLE \ - ? len >= sizeof(struct STRUCT) \ - : len == sizeof(struct STRUCT)) { \ - *code = OFPUTIL_##ENUM; \ - return 0; \ - } else { \ - return OFPERR_OFPBAC_BAD_LEN; \ - } \ - OVS_NOT_REACHED(); -#include "ofp-util.def" + if (eth_type != htons(ETH_TYPE_VLAN_8021Q)) { + /* XXX 802.1AD(QinQ) isn't supported at the moment */ + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + ofpact_put_PUSH_VLAN(out); + return 0; +} - default: - return OFPERR_OFPBAC_BAD_TYPE; +static void +encode_PUSH_VLAN(const struct ofpact_null *null OVS_UNUSED, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version == OFP10_VERSION) { + /* PUSH is a side effect of a SET_VLAN_VID/PCP, which should + * follow this action. */ + } else { + /* XXX ETH_TYPE_VLAN_8021AD case */ + put_OFPAT11_PUSH_VLAN(out, htons(ETH_TYPE_VLAN_8021Q)); } } -static enum ofperr -set_field_from_openflow(const struct ofp12_action_set_field *oasf, - struct ofpbuf *ofpacts) +static char * OVS_WARN_UNUSED_RESULT +parse_PUSH_VLAN(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) { - uint16_t oasf_len = ntohs(oasf->len); - uint32_t oxm_header = ntohl(oasf->dst); - uint8_t oxm_length = NXM_LENGTH(oxm_header); - struct ofpact_set_field *sf; - const struct mf_field *mf; + uint16_t ethertype; + char *error; - /* ofp12_action_set_field is padded to 64 bits by zero */ - if (oasf_len != ROUND_UP(sizeof *oasf + oxm_length, 8)) { - return OFPERR_OFPBAC_BAD_SET_LEN; - } - if (!is_all_zeros((const uint8_t *)oasf + sizeof *oasf + oxm_length, - oasf_len - oxm_length - sizeof *oasf)) { - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; + *usable_protocols &= OFPUTIL_P_OF11_UP; + error = str_to_u16(arg, "ethertype", ðertype); + if (error) { + return error; } - if (NXM_HASMASK(oxm_header)) { - return OFPERR_OFPBAC_BAD_SET_TYPE; - } - mf = mf_from_nxm_header(oxm_header); - if (!mf) { - return OFPERR_OFPBAC_BAD_SET_TYPE; - } - ovs_assert(mf->n_bytes == oxm_length); - /* oxm_length is now validated to be compatible with mf_value. */ - if (!mf->writable) { - VLOG_WARN_RL(&rl, "destination field %s is not writable", mf->name); - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; + if (ethertype != ETH_TYPE_VLAN_8021Q) { + /* XXX ETH_TYPE_VLAN_8021AD case isn't supported */ + return xasprintf("%s: not a valid VLAN ethertype", arg); } - sf = ofpact_put_SET_FIELD(ofpacts); - sf->field = mf; - memcpy(&sf->value, oasf + 1, mf->n_bytes); - /* The value must be valid for match and must have the OFPVID_PRESENT bit - * on for OXM_OF_VLAN_VID. */ - if (!mf_is_value_valid(mf, &sf->value) - || (mf->id == MFF_VLAN_VID - && !(sf->value.be16 & htons(OFPVID12_PRESENT)))) { - struct ds ds = DS_EMPTY_INITIALIZER; - mf_format(mf, &sf->value, NULL, &ds); - VLOG_WARN_RL(&rl, "Invalid value for set field %s: %s", - mf->name, ds_cstr(&ds)); - ds_destroy(&ds); + ofpact_put_PUSH_VLAN(ofpacts); + return NULL; +} - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - } +static void +format_PUSH_VLAN(const struct ofpact_null *a OVS_UNUSED, struct ds *s) +{ + /* XXX 802.1AD case*/ + ds_put_format(s, "push_vlan:%#"PRIx16, ETH_TYPE_VLAN_8021Q); +} + +/* Action structure for OFPAT10_SET_DL_SRC/DST and OFPAT11_SET_DL_SRC/DST. */ +struct ofp_action_dl_addr { + ovs_be16 type; /* Type. */ + ovs_be16 len; /* Length is 16. */ + uint8_t dl_addr[OFP_ETH_ALEN]; /* Ethernet address. */ + uint8_t pad[6]; +}; +OFP_ASSERT(sizeof(struct ofp_action_dl_addr) == 16); + +static enum ofperr +decode_OFPAT_RAW_SET_DL_SRC(const struct ofp_action_dl_addr *a, + struct ofpbuf *out) +{ + memcpy(ofpact_put_SET_ETH_SRC(out)->mac, a->dl_addr, ETH_ADDR_LEN); + return 0; +} + +static enum ofperr +decode_OFPAT_RAW_SET_DL_DST(const struct ofp_action_dl_addr *a, + struct ofpbuf *out) +{ + memcpy(ofpact_put_SET_ETH_DST(out)->mac, a->dl_addr, ETH_ADDR_LEN); return 0; } static void -set_field_to_openflow12(const struct ofpact_set_field *sf, - struct ofpbuf *openflow, - enum ofp_version version) +encode_SET_ETH_addr(const struct ofpact_mac *mac, enum ofp_version ofp_version, + enum ofp_raw_action_type raw, enum mf_field_id field, + struct ofpbuf *out) { - uint16_t padded_value_len = ROUND_UP(sf->field->n_bytes, 8); - struct ofp12_action_set_field *oasf; - char *value; + const uint8_t *addr = mac->mac; - oasf = ofputil_put_OFPAT12_SET_FIELD(openflow); - oasf->dst = htonl(mf_oxm_header(sf->field->id, version)); - oasf->len = htons(sizeof *oasf + padded_value_len); + if (ofp_version < OFP12_VERSION) { + struct ofp_action_dl_addr *oada; - value = ofpbuf_put_zeros(openflow, padded_value_len); - memcpy(value, &sf->value, sf->field->n_bytes); + oada = ofpact_put_raw(out, ofp_version, raw, 0); + memcpy(oada->dl_addr, addr, ETH_ADDR_LEN); + } else { + ofpact_put_set_field(out, ofp_version, field, + eth_addr_to_uint64(addr)); + } } -/* Convert 'sf' to one or two REG_LOADs. */ static void -set_field_to_nxast(const struct ofpact_set_field *sf, struct ofpbuf *openflow) +encode_SET_ETH_SRC(const struct ofpact_mac *mac, enum ofp_version ofp_version, + struct ofpbuf *out) { - const struct mf_field *mf = sf->field; - struct nx_action_reg_load *narl; + encode_SET_ETH_addr(mac, ofp_version, OFPAT_RAW_SET_DL_SRC, MFF_ETH_SRC, + out); - if (mf->n_bits > 64) { - ovs_assert(mf->n_bytes == 16); /* IPv6 addr. */ - /* Split into 64bit chunks */ - /* Lower bits first. */ - narl = ofputil_put_NXAST_REG_LOAD(openflow); - narl->ofs_nbits = nxm_encode_ofs_nbits(0, 64); - narl->dst = htonl(mf->nxm_header); - memcpy(&narl->value, &sf->value.ipv6.s6_addr[8], sizeof narl->value); - /* Higher bits next. */ - narl = ofputil_put_NXAST_REG_LOAD(openflow); - narl->ofs_nbits = nxm_encode_ofs_nbits(64, mf->n_bits - 64); - narl->dst = htonl(mf->nxm_header); - memcpy(&narl->value, &sf->value.ipv6.s6_addr[0], sizeof narl->value); - } else { - narl = ofputil_put_NXAST_REG_LOAD(openflow); - narl->ofs_nbits = nxm_encode_ofs_nbits(0, mf->n_bits); - narl->dst = htonl(mf->nxm_header); - memset(&narl->value, 0, 8 - mf->n_bytes); - memcpy((char*)&narl->value + (8 - mf->n_bytes), - &sf->value, mf->n_bytes); - } } -/* Convert 'sf' to standard OpenFlow 1.1 actions, if we can, falling back - * to Nicira extensions if we must. - * - * We check only meta-flow types that can appear within set field actions and - * that have a mapping to compatible action types. These struct mf_field - * definitions have a defined OXM or NXM header value and specify the field as - * writable. */ static void -set_field_to_openflow11(const struct ofpact_set_field *sf, - struct ofpbuf *openflow) +encode_SET_ETH_DST(const struct ofpact_mac *mac, + enum ofp_version ofp_version, + struct ofpbuf *out) { - switch ((int) sf->field->id) { - case MFF_VLAN_TCI: - /* NXM_OF_VLAN_TCI to OpenFlow 1.1 mapping: - * - * If CFI=1, Add or modify VLAN VID & PCP. - * OpenFlow 1.1 set actions only apply if the packet - * already has VLAN tags. To be sure that is the case - * we have to push a VLAN header. As we do not support - * multiple layers of VLANs, this is a no-op, if a VLAN - * header already exists. This may backfire, however, - * when we start supporting multiple layers of VLANs. - * If CFI=0, strip VLAN header, if any. - */ - if (sf->value.be16 & htons(VLAN_CFI)) { - /* Push a VLAN tag, if one was not seen at action validation - * time. */ - if (!sf->flow_has_vlan) { - ofputil_put_OFPAT11_PUSH_VLAN(openflow)->ethertype - = htons(ETH_TYPE_VLAN_8021Q); - } - ofputil_put_OFPAT11_SET_VLAN_VID(openflow)->vlan_vid - = sf->value.be16 & htons(VLAN_VID_MASK); - ofputil_put_OFPAT11_SET_VLAN_PCP(openflow)->vlan_pcp - = vlan_tci_to_pcp(sf->value.be16); - } else { - /* If the flow did not match on vlan, we have no way of - * knowing if the vlan tag exists, so we must POP just to be - * sure. */ - ofputil_put_OFPAT11_POP_VLAN(openflow); - } - break; + encode_SET_ETH_addr(mac, ofp_version, OFPAT_RAW_SET_DL_DST, MFF_ETH_DST, + out); - case MFF_VLAN_VID: - /* OXM VLAN_PCP to OpenFlow 1.1. - * Set field on OXM_OF_VLAN_VID onlyapplies to an existing vlan - * tag. Clear the OFPVID_PRESENT bit. - */ - ofputil_put_OFPAT11_SET_VLAN_VID(openflow)->vlan_vid - = sf->value.be16 & htons(VLAN_VID_MASK); - break; +} - case MFF_VLAN_PCP: - /* OXM VLAN_PCP to OpenFlow 1.1. - * OXM_OF_VLAN_PCP only applies to existing vlan tag. */ - ofputil_put_OFPAT11_SET_VLAN_PCP(openflow)->vlan_pcp = sf->value.u8; - break; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_ETH_SRC(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_mac(arg, ofpact_put_SET_ETH_SRC(ofpacts)->mac); +} - case MFF_ETH_SRC: - memcpy(ofputil_put_OFPAT11_SET_DL_SRC(openflow)->dl_addr, - sf->value.mac, ETH_ADDR_LEN); - break; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_ETH_DST(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_mac(arg, ofpact_put_SET_ETH_DST(ofpacts)->mac); +} - case MFF_ETH_DST: - memcpy(ofputil_put_OFPAT11_SET_DL_DST(openflow)->dl_addr, - sf->value.mac, ETH_ADDR_LEN); - break; +static void +format_SET_ETH_SRC(const struct ofpact_mac *a, struct ds *s) +{ + ds_put_format(s, "mod_dl_src:"ETH_ADDR_FMT, ETH_ADDR_ARGS(a->mac)); +} - case MFF_MPLS_LABEL: - ofputil_put_OFPAT11_SET_MPLS_LABEL(openflow)->mpls_label = - sf->value.be32; - break; +static void +format_SET_ETH_DST(const struct ofpact_mac *a, struct ds *s) +{ + ds_put_format(s, "mod_dl_dst:"ETH_ADDR_FMT, ETH_ADDR_ARGS(a->mac)); +} + +/* Set IPv4 address actions. */ - case MFF_MPLS_TC: - ofputil_put_OFPAT11_SET_MPLS_TC(openflow)->mpls_tc = sf->value.u8; - break; +static enum ofperr +decode_OFPAT_RAW_SET_NW_SRC(ovs_be32 ipv4, struct ofpbuf *out) +{ + ofpact_put_SET_IPV4_SRC(out)->ipv4 = ipv4; + return 0; +} - case MFF_IPV4_SRC: - ofputil_put_OFPAT11_SET_NW_SRC(openflow)->nw_addr = sf->value.be32; - break; +static enum ofperr +decode_OFPAT_RAW_SET_NW_DST(ovs_be32 ipv4, struct ofpbuf *out) +{ + ofpact_put_SET_IPV4_DST(out)->ipv4 = ipv4; + return 0; +} - case MFF_IPV4_DST: - ofputil_put_OFPAT11_SET_NW_DST(openflow)->nw_addr = sf->value.be32; - break; +static void +encode_SET_IPV4_addr(const struct ofpact_ipv4 *ipv4, + enum ofp_version ofp_version, + enum ofp_raw_action_type raw, enum mf_field_id field, + struct ofpbuf *out) +{ + ovs_be32 addr = ipv4->ipv4; + if (ofp_version < OFP12_VERSION) { + ofpact_put_raw(out, ofp_version, raw, ntohl(addr)); + } else { + ofpact_put_set_field(out, ofp_version, field, ntohl(addr)); + } +} - case MFF_IP_DSCP: - ofputil_put_OFPAT11_SET_NW_TOS(openflow)->nw_tos = sf->value.u8; - break; +static void +encode_SET_IPV4_SRC(const struct ofpact_ipv4 *ipv4, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + encode_SET_IPV4_addr(ipv4, ofp_version, OFPAT_RAW_SET_NW_SRC, MFF_IPV4_SRC, + out); +} - case MFF_IP_DSCP_SHIFTED: - ofputil_put_OFPAT11_SET_NW_TOS(openflow)->nw_tos = sf->value.u8 << 2; - break; +static void +encode_SET_IPV4_DST(const struct ofpact_ipv4 *ipv4, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + encode_SET_IPV4_addr(ipv4, ofp_version, OFPAT_RAW_SET_NW_DST, MFF_IPV4_DST, + out); +} - case MFF_IP_ECN: - ofputil_put_OFPAT11_SET_NW_ECN(openflow)->nw_ecn = sf->value.u8; - break; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_IPV4_SRC(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_ip(arg, &ofpact_put_SET_IPV4_SRC(ofpacts)->ipv4); +} - case MFF_IP_TTL: - ofputil_put_OFPAT11_SET_NW_TTL(openflow)->nw_ttl = sf->value.u8; - break; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_IPV4_DST(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_ip(arg, &ofpact_put_SET_IPV4_DST(ofpacts)->ipv4); +} - case MFF_TCP_SRC: - case MFF_UDP_SRC: - case MFF_SCTP_SRC: - ofputil_put_OFPAT11_SET_TP_SRC(openflow)->tp_port = sf->value.be16; - break; +static void +format_SET_IPV4_SRC(const struct ofpact_ipv4 *a, struct ds *s) +{ + ds_put_format(s, "mod_nw_src:"IP_FMT, IP_ARGS(a->ipv4)); +} - case MFF_TCP_DST: - case MFF_UDP_DST: - case MFF_SCTP_DST: - ofputil_put_OFPAT11_SET_TP_DST(openflow)->tp_port = sf->value.be16; - break; +static void +format_SET_IPV4_DST(const struct ofpact_ipv4 *a, struct ds *s) +{ + ds_put_format(s, "mod_nw_dst:"IP_FMT, IP_ARGS(a->ipv4)); +} + +/* Set IPv4/v6 TOS actions. */ - default: - set_field_to_nxast(sf, openflow); - break; +static enum ofperr +decode_OFPAT_RAW_SET_NW_TOS(uint8_t dscp, struct ofpbuf *out) +{ + if (dscp & ~IP_DSCP_MASK) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } else { + ofpact_put_SET_IP_DSCP(out)->dscp = dscp; + return 0; } } -/* Convert 'sf' to standard OpenFlow 1.0 actions, if we can, falling back - * to Nicira extensions if we must. - * - * We check only meta-flow types that can appear within set field actions and - * that have a mapping to compatible action types. These struct mf_field - * definitions have a defined OXM or NXM header value and specify the field as - * writable. */ static void -set_field_to_openflow10(const struct ofpact_set_field *sf, - struct ofpbuf *openflow) +encode_SET_IP_DSCP(const struct ofpact_dscp *dscp, + enum ofp_version ofp_version, struct ofpbuf *out) { - switch ((int) sf->field->id) { - case MFF_VLAN_TCI: - /* NXM_OF_VLAN_TCI to OpenFlow 1.0 mapping: - * - * If CFI=1, Add or modify VLAN VID & PCP. - * If CFI=0, strip VLAN header, if any. - */ - if (sf->value.be16 & htons(VLAN_CFI)) { - ofputil_put_OFPAT10_SET_VLAN_VID(openflow)->vlan_vid - = sf->value.be16 & htons(VLAN_VID_MASK); - ofputil_put_OFPAT10_SET_VLAN_PCP(openflow)->vlan_pcp - = vlan_tci_to_pcp(sf->value.be16); - } else { - ofputil_put_OFPAT10_STRIP_VLAN(openflow); - } - break; - - case MFF_VLAN_VID: - /* OXM VLAN_VID to OpenFlow 1.0. - * Set field on OXM_OF_VLAN_VID onlyapplies to an existing vlan - * tag. Clear the OFPVID_PRESENT bit. - */ - ofputil_put_OFPAT10_SET_VLAN_VID(openflow)->vlan_vid - = sf->value.be16 & htons(VLAN_VID_MASK); - break; + if (ofp_version < OFP12_VERSION) { + put_OFPAT_SET_NW_TOS(out, ofp_version, dscp->dscp); + } else { + ofpact_put_set_field(out, ofp_version, + MFF_IP_DSCP_SHIFTED, dscp->dscp >> 2); + } +} - case MFF_VLAN_PCP: - /* OXM VLAN_PCP to OpenFlow 1.0. - * OXM_OF_VLAN_PCP only applies to existing vlan tag. */ - ofputil_put_OFPAT10_SET_VLAN_PCP(openflow)->vlan_pcp = sf->value.u8; - break; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_IP_DSCP(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + uint8_t tos; + char *error; - case MFF_ETH_SRC: - memcpy(ofputil_put_OFPAT10_SET_DL_SRC(openflow)->dl_addr, - sf->value.mac, ETH_ADDR_LEN); - break; + error = str_to_u8(arg, "TOS", &tos); + if (error) { + return error; + } - case MFF_ETH_DST: - memcpy(ofputil_put_OFPAT10_SET_DL_DST(openflow)->dl_addr, - sf->value.mac, ETH_ADDR_LEN); - break; + if (tos & ~IP_DSCP_MASK) { + return xasprintf("%s: not a valid TOS", arg); + } + ofpact_put_SET_IP_DSCP(ofpacts)->dscp = tos; + return NULL; +} - case MFF_IPV4_SRC: - ofputil_put_OFPAT10_SET_NW_SRC(openflow)->nw_addr = sf->value.be32; - break; +static void +format_SET_IP_DSCP(const struct ofpact_dscp *a, struct ds *s) +{ + ds_put_format(s, "mod_nw_tos:%d", a->dscp); +} + +/* Set IPv4/v6 ECN actions. */ - case MFF_IPV4_DST: - ofputil_put_OFPAT10_SET_NW_DST(openflow)->nw_addr = sf->value.be32; - break; - - case MFF_IP_DSCP: - ofputil_put_OFPAT10_SET_NW_TOS(openflow)->nw_tos = sf->value.u8; - break; +static enum ofperr +decode_OFPAT_RAW11_SET_NW_ECN(uint8_t ecn, struct ofpbuf *out) +{ + if (ecn & ~IP_ECN_MASK) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } else { + ofpact_put_SET_IP_ECN(out)->ecn = ecn; + return 0; + } +} - case MFF_IP_DSCP_SHIFTED: - ofputil_put_OFPAT10_SET_NW_TOS(openflow)->nw_tos = sf->value.u8 << 2; - break; +static void +encode_SET_IP_ECN(const struct ofpact_ecn *ip_ecn, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + uint8_t ecn = ip_ecn->ecn; + if (ofp_version == OFP10_VERSION) { + /* XXX */ + } else if (ofp_version == OFP11_VERSION) { + put_OFPAT11_SET_NW_ECN(out, ecn); + } else { + ofpact_put_set_field(out, ofp_version, MFF_IP_ECN, ecn); + } +} - case MFF_TCP_SRC: - case MFF_UDP_SRC: - ofputil_put_OFPAT10_SET_TP_SRC(openflow)->tp_port = sf->value.be16; - break; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_IP_ECN(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + uint8_t ecn; + char *error; - case MFF_TCP_DST: - case MFF_UDP_DST: - ofputil_put_OFPAT10_SET_TP_DST(openflow)->tp_port = sf->value.be16; - break; + error = str_to_u8(arg, "ECN", &ecn); + if (error) { + return error; + } - default: - set_field_to_nxast(sf, openflow); - break; + if (ecn & ~IP_ECN_MASK) { + return xasprintf("%s: not a valid ECN", arg); } + ofpact_put_SET_IP_ECN(ofpacts)->ecn = ecn; + return NULL; } static void -set_field_to_openflow(const struct ofpact_set_field *sf, - struct ofpbuf *openflow) +format_SET_IP_ECN(const struct ofpact_ecn *a, struct ds *s) +{ + ds_put_format(s, "mod_nw_ecn:%d", a->ecn); +} + +/* Set IPv4/v6 TTL actions. */ + +static enum ofperr +decode_OFPAT_RAW11_SET_NW_TTL(uint8_t ttl, struct ofpbuf *out) { - struct ofp_header *oh = (struct ofp_header *)openflow->frame; + ofpact_put_SET_IP_TTL(out)->ttl = ttl; + return 0; +} - if (oh->version >= OFP12_VERSION) { - set_field_to_openflow12(sf, openflow, oh->version); - } else if (oh->version == OFP11_VERSION) { - set_field_to_openflow11(sf, openflow); - } else if (oh->version == OFP10_VERSION) { - set_field_to_openflow10(sf, openflow); +static void +encode_SET_IP_TTL(const struct ofpact_ip_ttl *ttl, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version >= OFP11_VERSION) { + put_OFPAT11_SET_NW_TTL(out, ttl->ttl); } else { - OVS_NOT_REACHED(); + /* XXX */ } } -static enum ofperr -output_from_openflow11(const struct ofp11_action_output *oao, - struct ofpbuf *out) +static char * OVS_WARN_UNUSED_RESULT +parse_SET_IP_TTL(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) { - struct ofpact_output *output; - enum ofperr error; - - output = ofpact_put_OUTPUT(out); - output->max_len = ntohs(oao->max_len); + uint8_t ttl; + char *error; - error = ofputil_port_from_ofp11(oao->port, &output->port); + error = str_to_u8(arg, "TTL", &ttl); if (error) { return error; } - return ofpact_check_output_port(output->port, OFPP_MAX); + ofpact_put_SET_IP_TTL(ofpacts)->ttl = ttl; + return NULL; +} + +static void +format_SET_IP_TTL(const struct ofpact_ip_ttl *a, struct ds *s) +{ + ds_put_format(s, "mod_nw_ttl:%d", a->ttl); +} + +/* Set TCP/UDP/SCTP port actions. */ + +static enum ofperr +decode_OFPAT_RAW_SET_TP_SRC(ovs_be16 port, struct ofpbuf *out) +{ + ofpact_put_SET_L4_SRC_PORT(out)->port = ntohs(port); + return 0; } static enum ofperr -ofpact_from_openflow11(const union ofp_action *a, enum ofp_version version, +decode_OFPAT_RAW_SET_TP_DST(ovs_be16 port, struct ofpbuf *out) +{ + ofpact_put_SET_L4_DST_PORT(out)->port = ntohs(port); + return 0; +} + +static void +encode_SET_L4_port(const struct ofpact_l4_port *l4_port, + enum ofp_version ofp_version, enum ofp_raw_action_type raw, + enum mf_field_id field, struct ofpbuf *out) +{ + uint16_t port = l4_port->port; + + if (ofp_version >= OFP12_VERSION && field != MFF_N_IDS) { + ofpact_put_set_field(out, ofp_version, field, port); + } else { + ofpact_put_raw(out, ofp_version, raw, port); + } +} + +static void +encode_SET_L4_SRC_PORT(const struct ofpact_l4_port *l4_port, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + uint8_t proto = l4_port->flow_ip_proto; + enum mf_field_id field = (proto == IPPROTO_TCP ? MFF_TCP_SRC + : proto == IPPROTO_UDP ? MFF_UDP_SRC + : proto == IPPROTO_SCTP ? MFF_SCTP_SRC + : MFF_N_IDS); + + encode_SET_L4_port(l4_port, ofp_version, OFPAT_RAW_SET_TP_SRC, field, out); +} + +static void +encode_SET_L4_DST_PORT(const struct ofpact_l4_port *l4_port, + enum ofp_version ofp_version, struct ofpbuf *out) { - enum ofputil_action_code code; + uint8_t proto = l4_port->flow_ip_proto; + enum mf_field_id field = (proto == IPPROTO_TCP ? MFF_TCP_DST + : proto == IPPROTO_UDP ? MFF_UDP_DST + : proto == IPPROTO_SCTP ? MFF_SCTP_DST + : MFF_N_IDS); + + encode_SET_L4_port(l4_port, ofp_version, OFPAT_RAW_SET_TP_DST, field, out); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_SET_L4_SRC_PORT(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_u16(arg, "source port", + &ofpact_put_SET_L4_SRC_PORT(ofpacts)->port); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_SET_L4_DST_PORT(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_u16(arg, "destination port", + &ofpact_put_SET_L4_DST_PORT(ofpacts)->port); +} + +static void +format_SET_L4_SRC_PORT(const struct ofpact_l4_port *a, struct ds *s) +{ + ds_put_format(s, "mod_tp_src:%d", a->port); +} + +static void +format_SET_L4_DST_PORT(const struct ofpact_l4_port *a, struct ds *s) +{ + ds_put_format(s, "mod_tp_dst:%d", a->port); +} + +/* Action structure for OFPAT_COPY_FIELD. */ +struct ofp15_action_copy_field { + ovs_be16 type; /* OFPAT_COPY_FIELD. */ + ovs_be16 len; /* Length is padded to 64 bits. */ + ovs_be16 n_bits; /* Number of bits to copy. */ + ovs_be16 src_offset; /* Starting bit offset in source. */ + ovs_be16 dst_offset; /* Starting bit offset in destination. */ + uint8_t pad[2]; + /* Followed by: + * - OXM header for source field. + * - OXM header for destination field. + * - Padding with 0-bytes to a multiple of 8 bytes. + * The "pad2" member is the beginning of the above. */ + uint8_t pad2[4]; +}; +OFP_ASSERT(sizeof(struct ofp15_action_copy_field) == 16); + +/* Action structure for OpenFlow 1.3 extension copy-field action.. */ +struct onf_action_copy_field { + ovs_be16 type; /* OFPAT_EXPERIMENTER. */ + ovs_be16 len; /* Length is padded to 64 bits. */ + ovs_be32 experimenter; /* ONF_VENDOR_ID. */ + ovs_be16 exp_type; /* 3200. */ + uint8_t pad[2]; /* Not used. */ + ovs_be16 n_bits; /* Number of bits to copy. */ + ovs_be16 src_offset; /* Starting bit offset in source. */ + ovs_be16 dst_offset; /* Starting bit offset in destination. */ + uint8_t pad2[2]; /* Not used. */ + /* Followed by: + * - OXM header for source field. + * - OXM header for destination field. + * - Padding with 0-bytes (either 0 or 4 of them) to a multiple of 8 bytes. + * The "pad3" member is the beginning of the above. */ + uint8_t pad3[4]; /* Not used. */ +}; +OFP_ASSERT(sizeof(struct onf_action_copy_field) == 24); + +/* Action structure for NXAST_REG_MOVE. + * + * Copies src[src_ofs:src_ofs+n_bits] to dst[dst_ofs:dst_ofs+n_bits], where + * a[b:c] denotes the bits within 'a' numbered 'b' through 'c' (not including + * bit 'c'). Bit numbering starts at 0 for the least-significant bit, 1 for + * the next most significant bit, and so on. + * + * 'src' and 'dst' are nxm_header values with nxm_hasmask=0. (It doesn't make + * sense to use nxm_hasmask=1 because the action does not do any kind of + * matching; it uses the actual value of a field.) + * + * The following nxm_header values are potentially acceptable as 'src': + * + * - NXM_OF_IN_PORT + * - NXM_OF_ETH_DST + * - NXM_OF_ETH_SRC + * - NXM_OF_ETH_TYPE + * - NXM_OF_VLAN_TCI + * - NXM_OF_IP_TOS + * - NXM_OF_IP_PROTO + * - NXM_OF_IP_SRC + * - NXM_OF_IP_DST + * - NXM_OF_TCP_SRC + * - NXM_OF_TCP_DST + * - NXM_OF_UDP_SRC + * - NXM_OF_UDP_DST + * - NXM_OF_ICMP_TYPE + * - NXM_OF_ICMP_CODE + * - NXM_OF_ARP_OP + * - NXM_OF_ARP_SPA + * - NXM_OF_ARP_TPA + * - NXM_NX_TUN_ID + * - NXM_NX_ARP_SHA + * - NXM_NX_ARP_THA + * - NXM_NX_ICMPV6_TYPE + * - NXM_NX_ICMPV6_CODE + * - NXM_NX_ND_SLL + * - NXM_NX_ND_TLL + * - NXM_NX_REG(idx) for idx in the switch's accepted range. + * - NXM_NX_PKT_MARK + * - NXM_NX_TUN_IPV4_SRC + * - NXM_NX_TUN_IPV4_DST + * + * The following nxm_header values are potentially acceptable as 'dst': + * + * - NXM_OF_ETH_DST + * - NXM_OF_ETH_SRC + * - NXM_OF_IP_TOS + * - NXM_OF_IP_SRC + * - NXM_OF_IP_DST + * - NXM_OF_TCP_SRC + * - NXM_OF_TCP_DST + * - NXM_OF_UDP_SRC + * - NXM_OF_UDP_DST + * - NXM_NX_ARP_SHA + * - NXM_NX_ARP_THA + * - NXM_OF_ARP_OP + * - NXM_OF_ARP_SPA + * - NXM_OF_ARP_TPA + * Modifying any of the above fields changes the corresponding packet + * header. + * + * - NXM_OF_IN_PORT + * + * - NXM_NX_REG(idx) for idx in the switch's accepted range. + * + * - NXM_NX_PKT_MARK + * + * - NXM_OF_VLAN_TCI. Modifying this field's value has side effects on the + * packet's 802.1Q header. Setting a value with CFI=0 removes the 802.1Q + * header (if any), ignoring the other bits. Setting a value with CFI=1 + * adds or modifies the 802.1Q header appropriately, setting the TCI field + * to the field's new value (with the CFI bit masked out). + * + * - NXM_NX_TUN_ID, NXM_NX_TUN_IPV4_SRC, NXM_NX_TUN_IPV4_DST. Modifying + * any of these values modifies the corresponding tunnel header field used + * for the packet's next tunnel encapsulation, if allowed by the + * configuration of the output tunnel port. + * + * A given nxm_header value may be used as 'src' or 'dst' only on a flow whose + * nx_match satisfies its prerequisites. For example, NXM_OF_IP_TOS may be + * used only if the flow's nx_match includes an nxm_entry that specifies + * nxm_type=NXM_OF_ETH_TYPE, nxm_hasmask=0, and nxm_value=0x0800. + * + * The switch will reject actions for which src_ofs+n_bits is greater than the + * width of 'src' or dst_ofs+n_bits is greater than the width of 'dst' with + * error type OFPET_BAD_ACTION, code OFPBAC_BAD_ARGUMENT. + * + * This action behaves properly when 'src' overlaps with 'dst', that is, it + * behaves as if 'src' were copied out to a temporary buffer, then the + * temporary buffer copied to 'dst'. + */ +struct nx_action_reg_move { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 24. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_REG_MOVE. */ + ovs_be16 n_bits; /* Number of bits. */ + ovs_be16 src_ofs; /* Starting bit offset in source. */ + ovs_be16 dst_ofs; /* Starting bit offset in destination. */ + /* Followed by: + * - OXM/NXM header for source field (4 or 8 bytes). + * - OXM/NXM header for destination field (4 or 8 bytes). + * - Padding with 0-bytes to a multiple of 8 bytes, if necessary. */ +}; +OFP_ASSERT(sizeof(struct nx_action_reg_move) == 16); + +static enum ofperr +decode_copy_field__(ovs_be16 src_offset, ovs_be16 dst_offset, ovs_be16 n_bits, + const void *action, ovs_be16 action_len, size_t oxm_offset, + struct ofpbuf *ofpacts) +{ + struct ofpact_reg_move *move; enum ofperr error; - struct ofpact_vlan_vid *vlan_vid; - struct ofpact_vlan_pcp *vlan_pcp; + struct ofpbuf b; - error = decode_openflow11_action(a, &code); + move = ofpact_put_REG_MOVE(ofpacts); + move->ofpact.raw = ONFACT_RAW13_COPY_FIELD; + move->src.ofs = ntohs(src_offset); + move->src.n_bits = ntohs(n_bits); + move->dst.ofs = ntohs(dst_offset); + move->dst.n_bits = ntohs(n_bits); + + ofpbuf_use_const(&b, action, ntohs(action_len)); + ofpbuf_pull(&b, oxm_offset); + error = nx_pull_header(&b, &move->src.field, NULL); + if (error) { + return error; + } + error = nx_pull_header(&b, &move->dst.field, NULL); if (error) { return error; } - if (version >= OFP12_VERSION) { - switch ((int)code) { - case OFPUTIL_OFPAT11_SET_VLAN_VID: - case OFPUTIL_OFPAT11_SET_VLAN_PCP: - case OFPUTIL_OFPAT11_SET_DL_SRC: - case OFPUTIL_OFPAT11_SET_DL_DST: - case OFPUTIL_OFPAT11_SET_NW_SRC: - case OFPUTIL_OFPAT11_SET_NW_DST: - case OFPUTIL_OFPAT11_SET_NW_TOS: - case OFPUTIL_OFPAT11_SET_NW_ECN: - case OFPUTIL_OFPAT11_SET_TP_SRC: - case OFPUTIL_OFPAT11_SET_TP_DST: - VLOG_WARN_RL(&rl, "Deprecated action %s received over %s", - ofputil_action_name_from_code(code), - ofputil_version_to_string(version)); - } + if (!is_all_zeros(b.data, b.size)) { + return OFPERR_NXBRC_MUST_BE_ZERO; } - switch (code) { - case OFPUTIL_ACTION_INVALID: -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM: -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#include "ofp-util.def" - OVS_NOT_REACHED(); + return nxm_reg_move_check(move, NULL); +} + +static enum ofperr +decode_OFPAT_RAW15_COPY_FIELD(const struct ofp15_action_copy_field *oacf, + struct ofpbuf *ofpacts) +{ + return decode_copy_field__(oacf->src_offset, oacf->dst_offset, + oacf->n_bits, oacf, oacf->len, + OBJECT_OFFSETOF(oacf, pad2), ofpacts); +} - case OFPUTIL_OFPAT11_OUTPUT: - return output_from_openflow11(&a->ofp11_output, out); +static enum ofperr +decode_ONFACT_RAW13_COPY_FIELD(const struct onf_action_copy_field *oacf, + struct ofpbuf *ofpacts) +{ + return decode_copy_field__(oacf->src_offset, oacf->dst_offset, + oacf->n_bits, oacf, oacf->len, + OBJECT_OFFSETOF(oacf, pad3), ofpacts); +} - case OFPUTIL_OFPAT11_SET_VLAN_VID: - if (a->vlan_vid.vlan_vid & ~htons(0xfff)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - vlan_vid = ofpact_put_SET_VLAN_VID(out); - vlan_vid->vlan_vid = ntohs(a->vlan_vid.vlan_vid); - vlan_vid->push_vlan_if_needed = false; - vlan_vid->ofpact.compat = code; - break; +static enum ofperr +decode_NXAST_RAW_REG_MOVE(const struct nx_action_reg_move *narm, + struct ofpbuf *ofpacts) +{ + struct ofpact_reg_move *move; + enum ofperr error; + struct ofpbuf b; - case OFPUTIL_OFPAT11_SET_VLAN_PCP: - if (a->vlan_pcp.vlan_pcp & ~7) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - vlan_pcp = ofpact_put_SET_VLAN_PCP(out); - vlan_pcp->vlan_pcp = a->vlan_pcp.vlan_pcp; - vlan_pcp->push_vlan_if_needed = false; - vlan_pcp->ofpact.compat = code; - break; + move = ofpact_put_REG_MOVE(ofpacts); + move->ofpact.raw = NXAST_RAW_REG_MOVE; + move->src.ofs = ntohs(narm->src_ofs); + move->src.n_bits = ntohs(narm->n_bits); + move->dst.ofs = ntohs(narm->dst_ofs); + move->dst.n_bits = ntohs(narm->n_bits); + + ofpbuf_use_const(&b, narm, ntohs(narm->len)); + ofpbuf_pull(&b, sizeof *narm); + error = nx_pull_header(&b, &move->src.field, NULL); + if (error) { + return error; + } + error = nx_pull_header(&b, &move->dst.field, NULL); + if (error) { + return error; + } + if (!is_all_zeros(b.data, b.size)) { + return OFPERR_NXBRC_MUST_BE_ZERO; + } - case OFPUTIL_OFPAT11_PUSH_VLAN: - if (a->push.ethertype != htons(ETH_TYPE_VLAN_8021Q)) { - /* XXX 802.1AD(QinQ) isn't supported at the moment */ - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - ofpact_put_PUSH_VLAN(out); - break; + return nxm_reg_move_check(move, NULL); +} - case OFPUTIL_OFPAT11_POP_VLAN: - ofpact_put_STRIP_VLAN(out)->ofpact.compat = code; - break; +static void +encode_REG_MOVE(const struct ofpact_reg_move *move, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + /* For OpenFlow 1.3, the choice of ONFACT_RAW13_COPY_FIELD versus + * NXAST_RAW_REG_MOVE is somewhat difficult. Neither one is guaranteed to + * be supported by every OpenFlow 1.3 implementation. It would be ideal to + * probe for support. Until we have that ability, we currently prefer + * NXAST_RAW_REG_MOVE for backward compatibility with older Open vSwitch + * versions. */ + size_t start_ofs = out->size; + if (ofp_version >= OFP15_VERSION) { + struct ofp15_action_copy_field *copy = put_OFPAT15_COPY_FIELD(out); + copy->n_bits = htons(move->dst.n_bits); + copy->src_offset = htons(move->src.ofs); + copy->dst_offset = htons(move->dst.ofs); + out->size = out->size - sizeof copy->pad2; + nx_put_header(out, move->src.field->id, ofp_version, false); + nx_put_header(out, move->dst.field->id, ofp_version, false); + } else if (ofp_version == OFP13_VERSION + && move->ofpact.raw == ONFACT_RAW13_COPY_FIELD) { + struct onf_action_copy_field *copy = put_ONFACT13_COPY_FIELD(out); + copy->n_bits = htons(move->dst.n_bits); + copy->src_offset = htons(move->src.ofs); + copy->dst_offset = htons(move->dst.ofs); + out->size = out->size - sizeof copy->pad3; + nx_put_header(out, move->src.field->id, ofp_version, false); + nx_put_header(out, move->dst.field->id, ofp_version, false); + } else { + struct nx_action_reg_move *narm = put_NXAST_REG_MOVE(out); + narm->n_bits = htons(move->dst.n_bits); + narm->src_ofs = htons(move->src.ofs); + narm->dst_ofs = htons(move->dst.ofs); + nx_put_header(out, move->src.field->id, 0, false); + nx_put_header(out, move->dst.field->id, 0, false); + } + pad_ofpat(out, start_ofs); +} - case OFPUTIL_OFPAT11_SET_QUEUE: - ofpact_put_SET_QUEUE(out)->queue_id = - ntohl(a->ofp11_set_queue.queue_id); - break; +static char * OVS_WARN_UNUSED_RESULT +parse_REG_MOVE(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_reg_move *move = ofpact_put_REG_MOVE(ofpacts); + const char *full_arg = arg; + char *error; - case OFPUTIL_OFPAT11_SET_DL_SRC: - memcpy(ofpact_put_SET_ETH_SRC(out)->mac, a->dl_addr.dl_addr, - ETH_ADDR_LEN); - break; + error = mf_parse_subfield__(&move->src, &arg); + if (error) { + return error; + } + if (strncmp(arg, "->", 2)) { + return xasprintf("%s: missing `->' following source", full_arg); + } + arg += 2; + error = mf_parse_subfield(&move->dst, arg); + if (error) { + return error; + } - case OFPUTIL_OFPAT11_SET_DL_DST: - memcpy(ofpact_put_SET_ETH_DST(out)->mac, a->dl_addr.dl_addr, - ETH_ADDR_LEN); - break; + if (move->src.n_bits != move->dst.n_bits) { + return xasprintf("%s: source field is %d bits wide but destination is " + "%d bits wide", full_arg, + move->src.n_bits, move->dst.n_bits); + } + return NULL; +} - case OFPUTIL_OFPAT11_DEC_NW_TTL: - dec_ttl_from_openflow(out, code); - break; +static void +format_REG_MOVE(const struct ofpact_reg_move *a, struct ds *s) +{ + nxm_format_reg_move(a, s); +} + +/* Action structure for OFPAT12_SET_FIELD. */ +struct ofp12_action_set_field { + ovs_be16 type; /* OFPAT12_SET_FIELD. */ + ovs_be16 len; /* Length is padded to 64 bits. */ + + /* Followed by: + * - An OXM header, value, and (in OpenFlow 1.5+) optionally a mask. + * - Enough 0-bytes to pad out to a multiple of 64 bits. + * + * The "pad" member is the beginning of the above. */ + uint8_t pad[4]; +}; +OFP_ASSERT(sizeof(struct ofp12_action_set_field) == 8); - case OFPUTIL_OFPAT11_SET_NW_SRC: - ofpact_put_SET_IPV4_SRC(out)->ipv4 = a->nw_addr.nw_addr; - break; +/* Action structure for NXAST_REG_LOAD. + * + * Copies value[0:n_bits] to dst[ofs:ofs+n_bits], where a[b:c] denotes the bits + * within 'a' numbered 'b' through 'c' (not including bit 'c'). Bit numbering + * starts at 0 for the least-significant bit, 1 for the next most significant + * bit, and so on. + * + * 'dst' is an nxm_header with nxm_hasmask=0. See the documentation for + * NXAST_REG_MOVE, above, for the permitted fields and for the side effects of + * loading them. + * + * The 'ofs' and 'n_bits' fields are combined into a single 'ofs_nbits' field + * to avoid enlarging the structure by another 8 bytes. To allow 'n_bits' to + * take a value between 1 and 64 (inclusive) while taking up only 6 bits, it is + * also stored as one less than its true value: + * + * 15 6 5 0 + * +------------------------------+------------------+ + * | ofs | n_bits - 1 | + * +------------------------------+------------------+ + * + * The switch will reject actions for which ofs+n_bits is greater than the + * width of 'dst', or in which any bits in 'value' with value 2**n_bits or + * greater are set to 1, with error type OFPET_BAD_ACTION, code + * OFPBAC_BAD_ARGUMENT. + */ +struct nx_action_reg_load { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 24. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_REG_LOAD. */ + ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ + ovs_be32 dst; /* Destination register. */ + ovs_be64 value; /* Immediate value. */ +}; +OFP_ASSERT(sizeof(struct nx_action_reg_load) == 24); - case OFPUTIL_OFPAT11_SET_NW_DST: - ofpact_put_SET_IPV4_DST(out)->ipv4 = a->nw_addr.nw_addr; - break; +/* Action structure for NXAST_REG_LOAD2. + * + * Compared to OFPAT_SET_FIELD, we can use this to set whole or partial fields + * in any OpenFlow version. Compared to NXAST_REG_LOAD, we can use this to set + * OXM experimenter fields. */ +struct nx_action_reg_load2 { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* At least 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_SET_FIELD. */ + + /* Followed by: + * - An NXM/OXM header, value, and optionally a mask. + * - Enough 0-bytes to pad out to a multiple of 64 bits. + * + * The "pad" member is the beginning of the above. */ + uint8_t pad[6]; +}; +OFP_ASSERT(sizeof(struct nx_action_reg_load2) == 16); - case OFPUTIL_OFPAT11_SET_NW_TOS: - if (a->nw_tos.nw_tos & ~IP_DSCP_MASK) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - ofpact_put_SET_IP_DSCP(out)->dscp = a->nw_tos.nw_tos; - break; +static enum ofperr +decode_ofpat_set_field(const struct ofp12_action_set_field *oasf, + bool may_mask, struct ofpbuf *ofpacts) +{ + struct ofpact_set_field *sf; + enum ofperr error; + struct ofpbuf b; - case OFPUTIL_OFPAT11_SET_NW_ECN: - if (a->nw_ecn.nw_ecn & ~IP_ECN_MASK) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - ofpact_put_SET_IP_ECN(out)->ecn = a->nw_ecn.nw_ecn; - break; + sf = ofpact_put_SET_FIELD(ofpacts); - case OFPUTIL_OFPAT11_SET_NW_TTL: - ofpact_put_SET_IP_TTL(out)->ttl = a->nw_ttl.nw_ttl; - break; + ofpbuf_use_const(&b, oasf, ntohs(oasf->len)); + ofpbuf_pull(&b, OBJECT_OFFSETOF(oasf, pad)); + error = nx_pull_entry(&b, &sf->field, &sf->value, + may_mask ? &sf->mask : NULL); + if (error) { + return (error == OFPERR_OFPBMC_BAD_MASK + ? OFPERR_OFPBAC_BAD_SET_MASK + : error); + } + if (!may_mask) { + memset(&sf->mask, 0xff, sf->field->n_bytes); + } - case OFPUTIL_OFPAT11_SET_TP_SRC: - ofpact_put_SET_L4_SRC_PORT(out)->port = ntohs(a->tp_port.tp_port); - break; + if (!is_all_zeros(b.data, b.size)) { + return OFPERR_OFPBAC_BAD_SET_ARGUMENT; + } - case OFPUTIL_OFPAT11_SET_TP_DST: - ofpact_put_SET_L4_DST_PORT(out)->port = ntohs(a->tp_port.tp_port); - break; + /* OpenFlow says specifically that one may not set OXM_OF_IN_PORT via + * Set-Field. */ + if (sf->field->id == MFF_IN_PORT_OXM) { + return OFPERR_OFPBAC_BAD_SET_ARGUMENT; + } - case OFPUTIL_OFPAT12_SET_FIELD: - return set_field_from_openflow(&a->set_field, out); + /* oxm_length is now validated to be compatible with mf_value. */ + if (!sf->field->writable) { + VLOG_WARN_RL(&rl, "destination field %s is not writable", + sf->field->name); + return OFPERR_OFPBAC_BAD_SET_ARGUMENT; + } - case OFPUTIL_OFPAT11_SET_MPLS_LABEL: - ofpact_put_SET_MPLS_LABEL(out)->label = a->ofp11_mpls_label.mpls_label; - break; + /* The value must be valid for match. OpenFlow 1.5 also says, + * "In an OXM_OF_VLAN_VID set-field action, the OFPVID_PRESENT bit must be + * a 1-bit in oxm_value and in oxm_mask." */ + if (!mf_is_value_valid(sf->field, &sf->value) + || (sf->field->id == MFF_VLAN_VID + && (!(sf->mask.be16 & htons(OFPVID12_PRESENT)) + || !(sf->value.be16 & htons(OFPVID12_PRESENT))))) { + struct ds ds = DS_EMPTY_INITIALIZER; + mf_format(sf->field, &sf->value, NULL, &ds); + VLOG_WARN_RL(&rl, "Invalid value for set field %s: %s", + sf->field->name, ds_cstr(&ds)); + ds_destroy(&ds); - case OFPUTIL_OFPAT11_SET_MPLS_TC: - ofpact_put_SET_MPLS_TC(out)->tc = a->ofp11_mpls_tc.mpls_tc; - break; + return OFPERR_OFPBAC_BAD_SET_ARGUMENT; + } + return 0; +} - case OFPUTIL_OFPAT11_SET_MPLS_TTL: - ofpact_put_SET_MPLS_TTL(out)->ttl = a->ofp11_mpls_ttl.mpls_ttl; - break; +static enum ofperr +decode_OFPAT_RAW12_SET_FIELD(const struct ofp12_action_set_field *oasf, + struct ofpbuf *ofpacts) +{ + return decode_ofpat_set_field(oasf, false, ofpacts); +} - case OFPUTIL_OFPAT11_DEC_MPLS_TTL: - ofpact_put_DEC_MPLS_TTL(out); - break; +static enum ofperr +decode_OFPAT_RAW15_SET_FIELD(const struct ofp12_action_set_field *oasf, + struct ofpbuf *ofpacts) +{ + return decode_ofpat_set_field(oasf, true, ofpacts); +} - case OFPUTIL_OFPAT11_PUSH_MPLS: - error = push_mpls_from_openflow(a->push.ethertype, out); - break; +static enum ofperr +decode_NXAST_RAW_REG_LOAD(const struct nx_action_reg_load *narl, + struct ofpbuf *out) +{ + struct ofpact_set_field *sf = ofpact_put_reg_load(out); + struct mf_subfield dst; + enum ofperr error; - case OFPUTIL_OFPAT11_POP_MPLS: - if (eth_type_mpls(a->ofp11_pop_mpls.ethertype)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; - } - ofpact_put_POP_MPLS(out)->ethertype = a->ofp11_pop_mpls.ethertype; - break; + sf->ofpact.raw = NXAST_RAW_REG_LOAD; - case OFPUTIL_OFPAT11_GROUP: - ofpact_put_GROUP(out)->group_id = ntohl(a->group.group_id); - break; + dst.field = mf_from_nxm_header(ntohl(narl->dst)); + dst.ofs = nxm_decode_ofs(narl->ofs_nbits); + dst.n_bits = nxm_decode_n_bits(narl->ofs_nbits); + error = mf_check_dst(&dst, NULL); + if (error) { + return error; + } -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#include "ofp-util.def" - return ofpact_from_nxast(a, code, out); + /* Reject 'narl' if a bit numbered 'n_bits' or higher is set to 1 in + * narl->value. */ + if (dst.n_bits < 64 && ntohll(narl->value) >> dst.n_bits) { + return OFPERR_OFPBAC_BAD_ARGUMENT; } - return error; + sf->field = dst.field; + bitwise_put(ntohll(narl->value), + &sf->value, dst.field->n_bytes, dst.ofs, + dst.n_bits); + bitwise_put(UINT64_MAX, + &sf->mask, dst.field->n_bytes, dst.ofs, + dst.n_bits); + + return 0; } -/* True if an action sets the value of a field - * in a way that is compatibile with the action set. - * False otherwise. */ -static bool -ofpact_is_set_action(const struct ofpact *a) +static enum ofperr +decode_NXAST_RAW_REG_LOAD2(const struct nx_action_reg_load2 *narl, + struct ofpbuf *out) { - switch (a->type) { - case OFPACT_SET_FIELD: - case OFPACT_REG_LOAD: - case OFPACT_SET_ETH_DST: - case OFPACT_SET_ETH_SRC: - case OFPACT_SET_IP_DSCP: - case OFPACT_SET_IP_ECN: - case OFPACT_SET_IP_TTL: - case OFPACT_SET_IPV4_DST: - case OFPACT_SET_IPV4_SRC: - case OFPACT_SET_L4_DST_PORT: - case OFPACT_SET_L4_SRC_PORT: - case OFPACT_SET_MPLS_LABEL: - case OFPACT_SET_MPLS_TC: - case OFPACT_SET_MPLS_TTL: - case OFPACT_SET_QUEUE: - case OFPACT_SET_TUNNEL: - case OFPACT_SET_VLAN_PCP: - case OFPACT_SET_VLAN_VID: - return true; - case OFPACT_BUNDLE: - case OFPACT_CLEAR_ACTIONS: - case OFPACT_CONTROLLER: - case OFPACT_DEC_MPLS_TTL: - case OFPACT_DEC_TTL: - case OFPACT_ENQUEUE: - case OFPACT_EXIT: - case OFPACT_FIN_TIMEOUT: - case OFPACT_GOTO_TABLE: - case OFPACT_GROUP: - case OFPACT_LEARN: - case OFPACT_METER: - case OFPACT_MULTIPATH: - case OFPACT_NOTE: - case OFPACT_OUTPUT: - case OFPACT_OUTPUT_REG: - case OFPACT_POP_MPLS: - case OFPACT_POP_QUEUE: - case OFPACT_PUSH_MPLS: - case OFPACT_PUSH_VLAN: - case OFPACT_REG_MOVE: - case OFPACT_RESUBMIT: - case OFPACT_SAMPLE: - case OFPACT_STACK_POP: - case OFPACT_STACK_PUSH: - case OFPACT_STRIP_VLAN: - case OFPACT_WRITE_ACTIONS: - case OFPACT_WRITE_METADATA: - return false; - default: - OVS_NOT_REACHED(); - } -} + struct ofpact_set_field *sf; + enum ofperr error; + struct ofpbuf b; -/* True if an action is allowed in the action set. - * False otherwise. */ -static bool -ofpact_is_allowed_in_actions_set(const struct ofpact *a) -{ - switch (a->type) { - case OFPACT_DEC_MPLS_TTL: - case OFPACT_DEC_TTL: - case OFPACT_GROUP: - case OFPACT_OUTPUT: - case OFPACT_POP_MPLS: - case OFPACT_PUSH_MPLS: - case OFPACT_PUSH_VLAN: - case OFPACT_REG_LOAD: - case OFPACT_SET_FIELD: - case OFPACT_SET_ETH_DST: - case OFPACT_SET_ETH_SRC: - case OFPACT_SET_IP_DSCP: - case OFPACT_SET_IP_ECN: - case OFPACT_SET_IP_TTL: - case OFPACT_SET_IPV4_DST: - case OFPACT_SET_IPV4_SRC: - case OFPACT_SET_L4_DST_PORT: - case OFPACT_SET_L4_SRC_PORT: - case OFPACT_SET_MPLS_LABEL: - case OFPACT_SET_MPLS_TC: - case OFPACT_SET_MPLS_TTL: - case OFPACT_SET_QUEUE: - case OFPACT_SET_TUNNEL: - case OFPACT_SET_VLAN_PCP: - case OFPACT_SET_VLAN_VID: - case OFPACT_STRIP_VLAN: - return true; + sf = ofpact_put_SET_FIELD(out); + sf->ofpact.raw = NXAST_RAW_REG_LOAD2; - /* In general these actions are excluded because they are not part of - * the OpenFlow specification nor map to actions that are defined in - * the specification. Thus the order in which they should be applied - * in the action set is undefined. */ - case OFPACT_BUNDLE: - case OFPACT_CONTROLLER: - case OFPACT_ENQUEUE: - case OFPACT_EXIT: - case OFPACT_FIN_TIMEOUT: - case OFPACT_LEARN: - case OFPACT_MULTIPATH: - case OFPACT_NOTE: - case OFPACT_OUTPUT_REG: - case OFPACT_POP_QUEUE: - case OFPACT_REG_MOVE: - case OFPACT_RESUBMIT: - case OFPACT_SAMPLE: - case OFPACT_STACK_POP: - case OFPACT_STACK_PUSH: + ofpbuf_use_const(&b, narl, ntohs(narl->len)); + ofpbuf_pull(&b, OBJECT_OFFSETOF(narl, pad)); + error = nx_pull_entry(&b, &sf->field, &sf->value, &sf->mask); + if (error) { + return error; + } + if (!is_all_zeros(b.data, b.size)) { + return OFPERR_OFPBAC_BAD_SET_ARGUMENT; + } - /* The action set may only include actions and thus - * may not include any instructions */ - case OFPACT_CLEAR_ACTIONS: - case OFPACT_GOTO_TABLE: - case OFPACT_METER: - case OFPACT_WRITE_ACTIONS: - case OFPACT_WRITE_METADATA: - return false; - default: - OVS_NOT_REACHED(); + if (!sf->field->writable) { + VLOG_WARN_RL(&rl, "destination field %s is not writable", + sf->field->name); + return OFPERR_OFPBAC_BAD_SET_ARGUMENT; } + return 0; } -/* Append ofpact 'a' onto the tail of 'out' */ static void -ofpact_copy(struct ofpbuf *out, const struct ofpact *a) +ofpact_put_set_field(struct ofpbuf *openflow, enum ofp_version ofp_version, + enum mf_field_id field, uint64_t value_) { - ofpbuf_put(out, a, OFPACT_ALIGN(a->len)); + struct ofp12_action_set_field *oasf OVS_UNUSED; + int n_bytes = mf_from_id(field)->n_bytes; + size_t start_ofs = openflow->size; + union mf_value value; + + value.be64 = htonll(value_ << (8 * (8 - n_bytes))); + + oasf = put_OFPAT12_SET_FIELD(openflow); + openflow->size = openflow->size - sizeof oasf->pad; + nx_put_entry(openflow, field, ofp_version, &value, NULL); + pad_ofpat(openflow, start_ofs); } -/* Copies the last ofpact whose type is 'filter' from 'in' to 'out'. */ static bool -ofpacts_copy_last(struct ofpbuf *out, const struct ofpbuf *in, - enum ofpact_type filter) +next_load_segment(const struct ofpact_set_field *sf, + struct mf_subfield *dst, uint64_t *value) { - const struct ofpact *target; - const struct ofpact *a; - - target = NULL; - OFPACT_FOR_EACH (a, ofpbuf_data(in), ofpbuf_size(in)) { - if (a->type == filter) { - target = a; + int n_bits = sf->field->n_bits; + int n_bytes = sf->field->n_bytes; + int start = dst->ofs + dst->n_bits; + + if (start < n_bits) { + dst->field = sf->field; + dst->ofs = bitwise_scan(&sf->mask, n_bytes, 1, start, n_bits); + if (dst->ofs < n_bits) { + dst->n_bits = bitwise_scan(&sf->mask, n_bytes, 0, dst->ofs + 1, + MIN(dst->ofs + 64, n_bits)) - dst->ofs; + *value = bitwise_get(&sf->value, n_bytes, dst->ofs, dst->n_bits); + return true; } } - if (target) { - ofpact_copy(out, target); - } - return target != NULL; + return false; } -/* Append all ofpacts, for which 'filter' returns true, from 'in' to 'out'. - * The order of appended ofpacts is preserved between 'in' and 'out' */ +/* Convert 'sf' to a series of REG_LOADs. */ static void -ofpacts_copy_all(struct ofpbuf *out, const struct ofpbuf *in, - bool (*filter)(const struct ofpact *)) +set_field_to_nxast(const struct ofpact_set_field *sf, struct ofpbuf *openflow) { - const struct ofpact *a; + /* If 'sf' cannot be encoded as NXAST_REG_LOAD because it requires an + * experimenter OXM (or if it came in as NXAST_REG_LOAD2), encode as + * NXAST_REG_LOAD2. Otherwise use NXAST_REG_LOAD, which is backward + * compatible. */ + if (sf->ofpact.raw == NXAST_RAW_REG_LOAD2 + || !mf_nxm_header(sf->field->id)) { + struct nx_action_reg_load2 *narl OVS_UNUSED; + size_t start_ofs = openflow->size; + + narl = put_NXAST_REG_LOAD2(openflow); + openflow->size = openflow->size - sizeof narl->pad; + nx_put_entry(openflow, sf->field->id, 0, &sf->value, &sf->mask); + pad_ofpat(openflow, start_ofs); + } else { + struct mf_subfield dst; + uint64_t value; - OFPACT_FOR_EACH (a, ofpbuf_data(in), ofpbuf_size(in)) { - if (filter(a)) { - ofpact_copy(out, a); + dst.ofs = dst.n_bits = 0; + while (next_load_segment(sf, &dst, &value)) { + struct nx_action_reg_load *narl = put_NXAST_REG_LOAD(openflow); + narl->ofs_nbits = nxm_encode_ofs_nbits(dst.ofs, dst.n_bits); + narl->dst = htonl(mf_nxm_header(dst.field->id)); + narl->value = htonll(value); } } } -/* Reads 'action_set', which contains ofpacts accumulated by - * OFPACT_WRITE_ACTIONS instructions, and writes equivalent actions to be - * executed directly into 'action_list'. (These names correspond to the - * "Action Set" and "Action List" terms used in OpenFlow 1.1+.) +/* Convert 'sf', which must set an entire field, to standard OpenFlow 1.0/1.1 + * actions, if we can, falling back to Nicira extensions if we must. * - * In general this involves appending the last instance of each action that is - * adimissible in the action set in the order described in the OpenFlow - * specification. - * - * Exceptions: - * + output action is only appended if no group action was present in 'in'. - * + As a simplification all set actions are copied in the order the are - * provided in 'in' as many set actions applied to a field has the same - * affect as only applying the last action that sets a field and - * duplicates are removed by do_xlate_actions(). - * This has an unwanted side-effect of compsoting multiple - * LOAD_REG actions that touch different regions of the same field. */ -void -ofpacts_execute_action_set(struct ofpbuf *action_list, - const struct ofpbuf *action_set) + * We check only meta-flow types that can appear within set field actions and + * that have a mapping to compatible action types. These struct mf_field + * definitions have a defined OXM or NXM header value and specify the field as + * writable. */ +static void +set_field_to_legacy_openflow(const struct ofpact_set_field *sf, + enum ofp_version ofp_version, + struct ofpbuf *out) { - /* The OpenFlow spec "Action Set" section specifies this order. */ - ofpacts_copy_last(action_list, action_set, OFPACT_STRIP_VLAN); - ofpacts_copy_last(action_list, action_set, OFPACT_POP_MPLS); - ofpacts_copy_last(action_list, action_set, OFPACT_PUSH_MPLS); - ofpacts_copy_last(action_list, action_set, OFPACT_PUSH_VLAN); - ofpacts_copy_last(action_list, action_set, OFPACT_DEC_TTL); - ofpacts_copy_last(action_list, action_set, OFPACT_DEC_MPLS_TTL); - ofpacts_copy_all(action_list, action_set, ofpact_is_set_action); - ofpacts_copy_last(action_list, action_set, OFPACT_SET_QUEUE); + switch ((int) sf->field->id) { + case MFF_VLAN_TCI: { + ovs_be16 tci = sf->value.be16; + bool cfi = (tci & htons(VLAN_CFI)) != 0; + uint16_t vid = vlan_tci_to_vid(tci); + uint8_t pcp = vlan_tci_to_pcp(tci); + + if (ofp_version < OFP11_VERSION) { + /* NXM_OF_VLAN_TCI to OpenFlow 1.0 mapping: + * + * If CFI=1, Add or modify VLAN VID & PCP. + * If CFI=0, strip VLAN header, if any. + */ + if (cfi) { + put_OFPAT10_SET_VLAN_VID(out, vid); + put_OFPAT10_SET_VLAN_PCP(out, pcp); + } else { + put_OFPAT10_STRIP_VLAN(out); + } + } else { + /* NXM_OF_VLAN_TCI to OpenFlow 1.1 mapping: + * + * If CFI=1, Add or modify VLAN VID & PCP. + * OpenFlow 1.1 set actions only apply if the packet + * already has VLAN tags. To be sure that is the case + * we have to push a VLAN header. As we do not support + * multiple layers of VLANs, this is a no-op, if a VLAN + * header already exists. This may backfire, however, + * when we start supporting multiple layers of VLANs. + * If CFI=0, strip VLAN header, if any. + */ + if (cfi) { + /* Push a VLAN tag, if one was not seen at action validation + * time. */ + if (!sf->flow_has_vlan) { + put_OFPAT11_PUSH_VLAN(out, htons(ETH_TYPE_VLAN_8021Q)); + } + put_OFPAT11_SET_VLAN_VID(out, vid); + put_OFPAT11_SET_VLAN_PCP(out, pcp); + } else { + /* If the flow did not match on vlan, we have no way of + * knowing if the vlan tag exists, so we must POP just to be + * sure. */ + put_OFPAT11_POP_VLAN(out); + } + } + break; + } - /* If both OFPACT_GROUP and OFPACT_OUTPUT are present, OpenFlow says that - * we should execute only OFPACT_GROUP. - * - * If neither OFPACT_GROUP nor OFPACT_OUTPUT is present, then we can drop - * all the actions because there's no point in modifying a packet that will - * not be sent anywhere. */ - if (!ofpacts_copy_last(action_list, action_set, OFPACT_GROUP) && - !ofpacts_copy_last(action_list, action_set, OFPACT_OUTPUT)) { - ofpbuf_clear(action_list); + case MFF_VLAN_VID: { + uint16_t vid = ntohs(sf->value.be16) & VLAN_VID_MASK; + if (ofp_version == OFP10_VERSION) { + put_OFPAT10_SET_VLAN_VID(out, vid); + } else { + put_OFPAT11_SET_VLAN_VID(out, vid); + } + break; } -} + case MFF_VLAN_PCP: + if (ofp_version == OFP10_VERSION) { + put_OFPAT10_SET_VLAN_PCP(out, sf->value.u8); + } else { + put_OFPAT11_SET_VLAN_PCP(out, sf->value.u8); + } + break; -static enum ofperr -ofpacts_from_openflow11_for_action_set(const union ofp_action *in, - size_t n_in, enum ofp_version version, - struct ofpbuf *out) -{ - enum ofperr error; - struct ofpact *a; - size_t start = ofpbuf_size(out); + case MFF_ETH_SRC: + memcpy(put_OFPAT_SET_DL_SRC(out, ofp_version)->dl_addr, + sf->value.mac, ETH_ADDR_LEN); + break; - error = ofpacts_from_openflow(in, n_in, version, out); + case MFF_ETH_DST: + memcpy(put_OFPAT_SET_DL_DST(out, ofp_version)->dl_addr, + sf->value.mac, ETH_ADDR_LEN); + break; - if (error) { - return error; - } + case MFF_IPV4_SRC: + put_OFPAT_SET_NW_SRC(out, ofp_version, sf->value.be32); + break; - OFPACT_FOR_EACH (a, ofpact_end(ofpbuf_data(out), start), ofpbuf_size(out) - start) { - if (!ofpact_is_allowed_in_actions_set(a)) { - VLOG_WARN_RL(&rl, "disallowed action in action set"); - return OFPERR_OFPBAC_BAD_TYPE; - } - } + case MFF_IPV4_DST: + put_OFPAT_SET_NW_DST(out, ofp_version, sf->value.be32); + break; - return 0; + case MFF_IP_DSCP: + put_OFPAT_SET_NW_TOS(out, ofp_version, sf->value.u8); + break; + + case MFF_IP_DSCP_SHIFTED: + put_OFPAT_SET_NW_TOS(out, ofp_version, sf->value.u8 << 2); + break; + + case MFF_TCP_SRC: + case MFF_UDP_SRC: + put_OFPAT_SET_TP_SRC(out, sf->value.be16); + break; + + case MFF_TCP_DST: + case MFF_UDP_DST: + put_OFPAT_SET_TP_DST(out, sf->value.be16); + break; + + default: + set_field_to_nxast(sf, out); + break; + } } - -/* OpenFlow 1.1 instructions. */ +static void +set_field_to_set_field(const struct ofpact_set_field *sf, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + struct ofp12_action_set_field *oasf OVS_UNUSED; + size_t start_ofs = out->size; -#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) \ - static inline const struct STRUCT * OVS_UNUSED \ - instruction_get_##ENUM(const struct ofp11_instruction *inst)\ - { \ - ovs_assert(inst->type == htons(ENUM)); \ - return ALIGNED_CAST(struct STRUCT *, inst); \ - } \ - \ - static inline void OVS_UNUSED \ - instruction_init_##ENUM(struct STRUCT *s) \ - { \ - memset(s, 0, sizeof *s); \ - s->type = htons(ENUM); \ - s->len = htons(sizeof *s); \ - } \ - \ - static inline struct STRUCT * OVS_UNUSED \ - instruction_put_##ENUM(struct ofpbuf *buf) \ - { \ - struct STRUCT *s = ofpbuf_put_uninit(buf, sizeof *s); \ - instruction_init_##ENUM(s); \ - return s; \ - } -OVS_INSTRUCTIONS -#undef DEFINE_INST - -struct instruction_type_info { - enum ovs_instruction_type type; - const char *name; -}; - -static const struct instruction_type_info inst_info[] = { -#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) {OVSINST_##ENUM, NAME}, -OVS_INSTRUCTIONS -#undef DEFINE_INST -}; - -const char * -ovs_instruction_name_from_type(enum ovs_instruction_type type) -{ - return inst_info[type].name; + oasf = put_OFPAT12_SET_FIELD(out); + out->size = out->size - sizeof oasf->pad; + nx_put_entry(out, sf->field->id, ofp_version, &sf->value, &sf->mask); + pad_ofpat(out, start_ofs); } -int -ovs_instruction_type_from_name(const char *name) +static void +encode_SET_FIELD(const struct ofpact_set_field *sf, + enum ofp_version ofp_version, struct ofpbuf *out) { - const struct instruction_type_info *p; - for (p = inst_info; p < &inst_info[ARRAY_SIZE(inst_info)]; p++) { - if (!strcasecmp(name, p->name)) { - return p->type; - } + if (ofp_version >= OFP15_VERSION) { + /* OF1.5+ only has Set-Field (reg_load is redundant so we drop it + * entirely). */ + set_field_to_set_field(sf, ofp_version, out); + } else if (sf->ofpact.raw == NXAST_RAW_REG_LOAD || + sf->ofpact.raw == NXAST_RAW_REG_LOAD2) { + /* It came in as reg_load, send it out the same way. */ + set_field_to_nxast(sf, out); + } else if (ofp_version < OFP12_VERSION) { + /* OpenFlow 1.0 and 1.1 don't have Set-Field. */ + set_field_to_legacy_openflow(sf, ofp_version, out); + } else if (is_all_ones((const uint8_t *) &sf->mask, sf->field->n_bytes)) { + /* We're encoding to OpenFlow 1.2, 1.3, or 1.4. The action sets an + * entire field, so encode it as OFPAT_SET_FIELD. */ + set_field_to_set_field(sf, ofp_version, out); + } else { + /* We're encoding to OpenFlow 1.2, 1.3, or 1.4. The action cannot be + * encoded as OFPAT_SET_FIELD because it does not set an entire field, + * so encode it as reg_load. */ + set_field_to_nxast(sf, out); } - return -1; } -enum ovs_instruction_type -ovs_instruction_type_from_ofpact_type(enum ofpact_type type) +/* Parses a "set_field" action with argument 'arg', appending the parsed + * action to 'ofpacts'. + * + * Returns NULL if successful, otherwise a malloc()'d string describing the + * error. The caller is responsible for freeing the returned string. */ +static char * OVS_WARN_UNUSED_RESULT +set_field_parse__(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) { - switch (type) { - case OFPACT_METER: - return OVSINST_OFPIT13_METER; - case OFPACT_CLEAR_ACTIONS: - return OVSINST_OFPIT11_CLEAR_ACTIONS; - case OFPACT_WRITE_ACTIONS: - return OVSINST_OFPIT11_WRITE_ACTIONS; - case OFPACT_WRITE_METADATA: - return OVSINST_OFPIT11_WRITE_METADATA; - case OFPACT_GOTO_TABLE: - return OVSINST_OFPIT11_GOTO_TABLE; - case OFPACT_OUTPUT: - case OFPACT_GROUP: - case OFPACT_CONTROLLER: - case OFPACT_ENQUEUE: - case OFPACT_OUTPUT_REG: - case OFPACT_BUNDLE: - case OFPACT_SET_VLAN_VID: - case OFPACT_SET_VLAN_PCP: - case OFPACT_STRIP_VLAN: - case OFPACT_PUSH_VLAN: - case OFPACT_SET_ETH_SRC: - case OFPACT_SET_ETH_DST: - case OFPACT_SET_IPV4_SRC: - case OFPACT_SET_IPV4_DST: - case OFPACT_SET_IP_DSCP: - case OFPACT_SET_IP_ECN: - case OFPACT_SET_IP_TTL: - case OFPACT_SET_L4_SRC_PORT: - case OFPACT_SET_L4_DST_PORT: - case OFPACT_REG_MOVE: - case OFPACT_REG_LOAD: - case OFPACT_SET_FIELD: - case OFPACT_STACK_PUSH: - case OFPACT_STACK_POP: - case OFPACT_DEC_TTL: - case OFPACT_SET_MPLS_LABEL: - case OFPACT_SET_MPLS_TC: - case OFPACT_SET_MPLS_TTL: - case OFPACT_DEC_MPLS_TTL: - case OFPACT_PUSH_MPLS: - case OFPACT_POP_MPLS: - case OFPACT_SET_TUNNEL: - case OFPACT_SET_QUEUE: - case OFPACT_POP_QUEUE: - case OFPACT_FIN_TIMEOUT: - case OFPACT_RESUBMIT: - case OFPACT_LEARN: - case OFPACT_MULTIPATH: - case OFPACT_NOTE: - case OFPACT_EXIT: - case OFPACT_SAMPLE: - default: - return OVSINST_OFPIT11_APPLY_ACTIONS; + struct ofpact_set_field *sf = ofpact_put_SET_FIELD(ofpacts); + char *value; + char *delim; + char *key; + const struct mf_field *mf; + char *error; + + value = arg; + delim = strstr(arg, "->"); + if (!delim) { + return xasprintf("%s: missing `->'", arg); + } + if (strlen(delim) <= strlen("->")) { + return xasprintf("%s: missing field name following `->'", arg); + } + + key = delim + strlen("->"); + mf = mf_from_name(key); + if (!mf) { + return xasprintf("%s is not a valid OXM field name", key); } + if (!mf->writable) { + return xasprintf("%s is read-only", key); + } + sf->field = mf; + delim[0] = '\0'; + error = mf_parse(mf, value, &sf->value, &sf->mask); + if (error) { + return error; + } + + if (!mf_is_value_valid(mf, &sf->value)) { + return xasprintf("%s is not a valid value for field %s", value, key); + } + + *usable_protocols &= mf->usable_protocols_exact; + return NULL; } -enum ofperr -ovs_instruction_type_from_inst_type(enum ovs_instruction_type *instruction_type, - const uint16_t inst_type) +/* Parses 'arg' as the argument to a "set_field" action, and appends such an + * action to 'ofpacts'. + * + * Returns NULL if successful, otherwise a malloc()'d string describing the + * error. The caller is responsible for freeing the returned string. */ +static char * OVS_WARN_UNUSED_RESULT +parse_SET_FIELD(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) +{ + char *copy = xstrdup(arg); + char *error = set_field_parse__(copy, ofpacts, usable_protocols); + free(copy); + return error; +} + +static char * OVS_WARN_UNUSED_RESULT +parse_reg_load(char *arg, struct ofpbuf *ofpacts) { - switch (inst_type) { + struct ofpact_set_field *sf = ofpact_put_reg_load(ofpacts); + const char *full_arg = arg; + uint64_t value = strtoull(arg, (char **) &arg, 0); + struct mf_subfield dst; + char *error; -#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case ENUM: \ - *instruction_type = OVSINST_##ENUM; \ - return 0; -OVS_INSTRUCTIONS -#undef DEFINE_INST + if (strncmp(arg, "->", 2)) { + return xasprintf("%s: missing `->' following value", full_arg); + } + arg += 2; + error = mf_parse_subfield(&dst, arg); + if (error) { + return error; + } - default: - return OFPERR_OFPBIC_UNKNOWN_INST; + if (dst.n_bits < 64 && (value >> dst.n_bits) != 0) { + return xasprintf("%s: value %"PRIu64" does not fit into %d bits", + full_arg, value, dst.n_bits); } -} -static inline struct ofp11_instruction * -instruction_next(const struct ofp11_instruction *inst) -{ - return ((struct ofp11_instruction *) (void *) - ((uint8_t *) inst + ntohs(inst->len))); + sf->field = dst.field; + memset(&sf->value, 0, sizeof sf->value); + bitwise_put(value, &sf->value, dst.field->n_bytes, dst.ofs, dst.n_bits); + bitwise_put(UINT64_MAX, &sf->mask, + dst.field->n_bytes, dst.ofs, dst.n_bits); + return NULL; } -static inline bool -instruction_is_valid(const struct ofp11_instruction *inst, - size_t n_instructions) +static void +format_SET_FIELD(const struct ofpact_set_field *a, struct ds *s) { - uint16_t len = ntohs(inst->len); - return (!(len % OFP11_INSTRUCTION_ALIGN) - && len >= sizeof *inst - && len / sizeof *inst <= n_instructions); + if (a->ofpact.raw == NXAST_RAW_REG_LOAD) { + struct mf_subfield dst; + uint64_t value; + + dst.ofs = dst.n_bits = 0; + while (next_load_segment(a, &dst, &value)) { + ds_put_format(s, "load:%#"PRIx64"->", value); + mf_format_subfield(&dst, s); + ds_put_char(s, ','); + } + ds_chomp(s, ','); + } else { + ds_put_cstr(s, "set_field:"); + mf_format(a->field, &a->value, &a->mask, s); + ds_put_format(s, "->%s", a->field->name); + } } -/* This macro is careful to check for instructions with bad lengths. */ -#define INSTRUCTION_FOR_EACH(ITER, LEFT, INSTRUCTIONS, N_INSTRUCTIONS) \ - for ((ITER) = (INSTRUCTIONS), (LEFT) = (N_INSTRUCTIONS); \ - (LEFT) > 0 && instruction_is_valid(ITER, LEFT); \ - ((LEFT) -= (ntohs((ITER)->len) \ - / sizeof(struct ofp11_instruction)), \ - (ITER) = instruction_next(ITER))) +/* Appends an OFPACT_SET_FIELD ofpact to 'ofpacts' and returns it. The ofpact + * is marked such that, if possible, it will be translated to OpenFlow as + * NXAST_REG_LOAD extension actions rather than OFPAT_SET_FIELD, either because + * that was the way that the action was expressed when it came into OVS or for + * backward compatibility. */ +struct ofpact_set_field * +ofpact_put_reg_load(struct ofpbuf *ofpacts) +{ + struct ofpact_set_field *sf = ofpact_put_SET_FIELD(ofpacts); + sf->ofpact.raw = NXAST_RAW_REG_LOAD; + return sf; +} + +/* Action structure for NXAST_STACK_PUSH and NXAST_STACK_POP. + * + * Pushes (or pops) field[offset: offset + n_bits] to (or from) + * top of the stack. + */ +struct nx_action_stack { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_STACK_PUSH or NXAST_STACK_POP. */ + ovs_be16 offset; /* Bit offset into the field. */ + /* Followed by: + * - OXM/NXM header for field to push or pop (4 or 8 bytes). + * - ovs_be16 'n_bits', the number of bits to extract from the field. + * - Enough 0-bytes to pad out the action to 24 bytes. */ + uint8_t pad[12]; /* See above. */ +}; +OFP_ASSERT(sizeof(struct nx_action_stack) == 24); static enum ofperr -decode_openflow11_instruction(const struct ofp11_instruction *inst, - enum ovs_instruction_type *type) +decode_stack_action(const struct nx_action_stack *nasp, + struct ofpact_stack *stack_action) { - uint16_t len = ntohs(inst->len); - - switch (inst->type) { - case CONSTANT_HTONS(OFPIT11_EXPERIMENTER): - return OFPERR_OFPBIC_BAD_EXPERIMENTER; + enum ofperr error; + struct ofpbuf b; -#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case CONSTANT_HTONS(ENUM): \ - if (EXTENSIBLE \ - ? len >= sizeof(struct STRUCT) \ - : len == sizeof(struct STRUCT)) { \ - *type = OVSINST_##ENUM; \ - return 0; \ - } else { \ - return OFPERR_OFPBIC_BAD_LEN; \ - } -OVS_INSTRUCTIONS -#undef DEFINE_INST + stack_action->subfield.ofs = ntohs(nasp->offset); - default: - return OFPERR_OFPBIC_UNKNOWN_INST; + ofpbuf_use_const(&b, nasp, sizeof *nasp); + ofpbuf_pull(&b, OBJECT_OFFSETOF(nasp, pad)); + error = nx_pull_header(&b, &stack_action->subfield.field, NULL); + if (error) { + return error; + } + stack_action->subfield.n_bits = ntohs(*(const ovs_be16 *) b.data); + ofpbuf_pull(&b, 2); + if (!is_all_zeros(b.data, b.size)) { + return OFPERR_NXBRC_MUST_BE_ZERO; } + + return 0; } static enum ofperr -decode_openflow11_instructions(const struct ofp11_instruction insts[], - size_t n_insts, - const struct ofp11_instruction *out[]) +decode_NXAST_RAW_STACK_PUSH(const struct nx_action_stack *nasp, + struct ofpbuf *ofpacts) { - const struct ofp11_instruction *inst; - size_t left; + struct ofpact_stack *push = ofpact_put_STACK_PUSH(ofpacts); + enum ofperr error = decode_stack_action(nasp, push); + return error ? error : nxm_stack_push_check(push, NULL); +} - memset(out, 0, N_OVS_INSTRUCTIONS * sizeof *out); - INSTRUCTION_FOR_EACH (inst, left, insts, n_insts) { - enum ovs_instruction_type type; - enum ofperr error; +static enum ofperr +decode_NXAST_RAW_STACK_POP(const struct nx_action_stack *nasp, + struct ofpbuf *ofpacts) +{ + struct ofpact_stack *pop = ofpact_put_STACK_POP(ofpacts); + enum ofperr error = decode_stack_action(nasp, pop); + return error ? error : nxm_stack_pop_check(pop, NULL); +} - error = decode_openflow11_instruction(inst, &type); - if (error) { - return error; - } +static void +encode_STACK_op(const struct ofpact_stack *stack_action, + struct nx_action_stack *nasp) +{ + struct ofpbuf b; + ovs_be16 n_bits; - if (out[type]) { - return OFPERR_ONFBIC_DUP_INSTRUCTION; - } - out[type] = inst; - } + nasp->offset = htons(stack_action->subfield.ofs); - if (left) { - VLOG_WARN_RL(&rl, "bad instruction format at offset %"PRIuSIZE, - (n_insts - left) * sizeof *inst); - return OFPERR_OFPBIC_BAD_LEN; - } - return 0; + ofpbuf_use_stack(&b, nasp, ntohs(nasp->len)); + ofpbuf_put_uninit(&b, OBJECT_OFFSETOF(nasp, pad)); + nx_put_header(&b, stack_action->subfield.field->id, 0, false); + n_bits = htons(stack_action->subfield.n_bits); + ofpbuf_put(&b, &n_bits, sizeof n_bits); } static void -get_actions_from_instruction(const struct ofp11_instruction *inst, - const union ofp_action **actions, - size_t *max_actions) +encode_STACK_PUSH(const struct ofpact_stack *stack, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { - *actions = ALIGNED_CAST(const union ofp_action *, inst + 1); - *max_actions = (ntohs(inst->len) - sizeof *inst) / OFP11_INSTRUCTION_ALIGN; + encode_STACK_op(stack, put_NXAST_STACK_PUSH(out)); } -enum ofperr -ofpacts_pull_openflow_instructions(struct ofpbuf *openflow, - unsigned int instructions_len, - enum ofp_version version, - struct ofpbuf *ofpacts) +static void +encode_STACK_POP(const struct ofpact_stack *stack, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { - const struct ofp11_instruction *instructions; - const struct ofp11_instruction *insts[N_OVS_INSTRUCTIONS]; - enum ofperr error; + encode_STACK_op(stack, put_NXAST_STACK_POP(out)); +} - ofpbuf_clear(ofpacts); +static char * OVS_WARN_UNUSED_RESULT +parse_STACK_PUSH(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return nxm_parse_stack_action(ofpact_put_STACK_PUSH(ofpacts), arg); +} - if (instructions_len % OFP11_INSTRUCTION_ALIGN != 0) { - VLOG_WARN_RL(&rl, "OpenFlow message instructions length %u is not a " - "multiple of %d", - instructions_len, OFP11_INSTRUCTION_ALIGN); - error = OFPERR_OFPBIC_BAD_LEN; - goto exit; - } +static char * OVS_WARN_UNUSED_RESULT +parse_STACK_POP(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return nxm_parse_stack_action(ofpact_put_STACK_POP(ofpacts), arg); +} - instructions = ofpbuf_try_pull(openflow, instructions_len); - if (instructions == NULL) { - VLOG_WARN_RL(&rl, "OpenFlow message instructions length %u exceeds " - "remaining message length (%"PRIu32")", - instructions_len, ofpbuf_size(openflow)); - error = OFPERR_OFPBIC_BAD_LEN; - goto exit; - } +static void +format_STACK_PUSH(const struct ofpact_stack *a, struct ds *s) +{ + nxm_format_stack_push(a, s); +} - error = decode_openflow11_instructions( - instructions, instructions_len / OFP11_INSTRUCTION_ALIGN, - insts); - if (error) { - goto exit; - } +static void +format_STACK_POP(const struct ofpact_stack *a, struct ds *s) +{ + nxm_format_stack_pop(a, s); +} + +/* Action structure for NXAST_DEC_TTL_CNT_IDS. + * + * If the packet is not IPv4 or IPv6, does nothing. For IPv4 or IPv6, if the + * TTL or hop limit is at least 2, decrements it by 1. Otherwise, if TTL or + * hop limit is 0 or 1, sends a packet-in to the controllers with each of the + * 'n_controllers' controller IDs specified in 'cnt_ids'. + * + * (This differs from NXAST_DEC_TTL in that for NXAST_DEC_TTL the packet-in is + * sent only to controllers with id 0.) + */ +struct nx_action_cnt_ids { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length including slaves. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_DEC_TTL_CNT_IDS. */ - if (insts[OVSINST_OFPIT13_METER]) { - const struct ofp13_instruction_meter *oim; - struct ofpact_meter *om; + ovs_be16 n_controllers; /* Number of controllers. */ + uint8_t zeros[4]; /* Must be zero. */ - oim = ALIGNED_CAST(const struct ofp13_instruction_meter *, - insts[OVSINST_OFPIT13_METER]); + /* Followed by 1 or more controller ids. + * + * uint16_t cnt_ids[]; // Controller ids. + * uint8_t pad[]; // Must be 0 to 8-byte align cnt_ids[]. + */ +}; +OFP_ASSERT(sizeof(struct nx_action_cnt_ids) == 16); - om = ofpact_put_METER(ofpacts); - om->meter_id = ntohl(oim->meter_id); +static enum ofperr +decode_OFPAT_RAW_DEC_NW_TTL(struct ofpbuf *out) +{ + uint16_t id = 0; + struct ofpact_cnt_ids *ids; + enum ofperr error = 0; + + ids = ofpact_put_DEC_TTL(out); + ids->n_controllers = 1; + ofpbuf_put(out, &id, sizeof id); + ids = out->header; + ofpact_update_len(out, &ids->ofpact); + return error; +} + +static enum ofperr +decode_NXAST_RAW_DEC_TTL_CNT_IDS(const struct nx_action_cnt_ids *nac_ids, + struct ofpbuf *out) +{ + struct ofpact_cnt_ids *ids; + size_t ids_size; + int i; + + ids = ofpact_put_DEC_TTL(out); + ids->ofpact.raw = NXAST_RAW_DEC_TTL_CNT_IDS; + ids->n_controllers = ntohs(nac_ids->n_controllers); + ids_size = ntohs(nac_ids->len) - sizeof *nac_ids; + + if (!is_all_zeros(nac_ids->zeros, sizeof nac_ids->zeros)) { + return OFPERR_NXBRC_MUST_BE_ZERO; } - if (insts[OVSINST_OFPIT11_APPLY_ACTIONS]) { - const union ofp_action *actions; - size_t max_actions; - get_actions_from_instruction(insts[OVSINST_OFPIT11_APPLY_ACTIONS], - &actions, &max_actions); - error = ofpacts_from_openflow(actions, max_actions, version, ofpacts); - if (error) { - goto exit; - } + if (ids_size < ids->n_controllers * sizeof(ovs_be16)) { + VLOG_WARN_RL(&rl, "Nicira action dec_ttl_cnt_ids only has %"PRIuSIZE" " + "bytes allocated for controller ids. %"PRIuSIZE" bytes " + "are required for %"PRIu16" controllers.", + ids_size, ids->n_controllers * sizeof(ovs_be16), + ids->n_controllers); + return OFPERR_OFPBAC_BAD_LEN; } - if (insts[OVSINST_OFPIT11_CLEAR_ACTIONS]) { - instruction_get_OFPIT11_CLEAR_ACTIONS( - insts[OVSINST_OFPIT11_CLEAR_ACTIONS]); - ofpact_put_CLEAR_ACTIONS(ofpacts); + + for (i = 0; i < ids->n_controllers; i++) { + uint16_t id = ntohs(((ovs_be16 *)(nac_ids + 1))[i]); + ofpbuf_put(out, &id, sizeof id); + ids = out->header; } - if (insts[OVSINST_OFPIT11_WRITE_ACTIONS]) { - struct ofpact_nest *on; - const union ofp_action *actions; - size_t max_actions; - size_t start; - ofpact_pad(ofpacts); - start = ofpbuf_size(ofpacts); - on = ofpact_put(ofpacts, OFPACT_WRITE_ACTIONS, - offsetof(struct ofpact_nest, actions)); - get_actions_from_instruction(insts[OVSINST_OFPIT11_WRITE_ACTIONS], - &actions, &max_actions); - error = ofpacts_from_openflow11_for_action_set(actions, max_actions, - version, ofpacts); - if (error) { - goto exit; + ofpact_update_len(out, &ids->ofpact); + + return 0; +} + +static void +encode_DEC_TTL(const struct ofpact_cnt_ids *dec_ttl, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (dec_ttl->ofpact.raw == NXAST_RAW_DEC_TTL_CNT_IDS + || dec_ttl->n_controllers != 1 + || dec_ttl->cnt_ids[0] != 0) { + struct nx_action_cnt_ids *nac_ids = put_NXAST_DEC_TTL_CNT_IDS(out); + int ids_len = ROUND_UP(2 * dec_ttl->n_controllers, OFP_ACTION_ALIGN); + ovs_be16 *ids; + size_t i; + + nac_ids->len = htons(ntohs(nac_ids->len) + ids_len); + nac_ids->n_controllers = htons(dec_ttl->n_controllers); + + ids = ofpbuf_put_zeros(out, ids_len); + for (i = 0; i < dec_ttl->n_controllers; i++) { + ids[i] = htons(dec_ttl->cnt_ids[i]); } - on = ofpbuf_at_assert(ofpacts, start, sizeof *on); - on->ofpact.len = ofpbuf_size(ofpacts) - start; + } else { + put_OFPAT_DEC_NW_TTL(out, ofp_version); } - if (insts[OVSINST_OFPIT11_WRITE_METADATA]) { - const struct ofp11_instruction_write_metadata *oiwm; - struct ofpact_metadata *om; +} - oiwm = ALIGNED_CAST(const struct ofp11_instruction_write_metadata *, - insts[OVSINST_OFPIT11_WRITE_METADATA]); +static void +parse_noargs_dec_ttl(struct ofpbuf *ofpacts) +{ + struct ofpact_cnt_ids *ids; + uint16_t id = 0; - om = ofpact_put_WRITE_METADATA(ofpacts); - om->metadata = oiwm->metadata; - om->mask = oiwm->metadata_mask; - } - if (insts[OVSINST_OFPIT11_GOTO_TABLE]) { - const struct ofp11_instruction_goto_table *oigt; - struct ofpact_goto_table *ogt; + ofpact_put_DEC_TTL(ofpacts); + ofpbuf_put(ofpacts, &id, sizeof id); + ids = ofpacts->header; + ids->n_controllers++; + ofpact_update_len(ofpacts, &ids->ofpact); +} - oigt = instruction_get_OFPIT11_GOTO_TABLE( - insts[OVSINST_OFPIT11_GOTO_TABLE]); - ogt = ofpact_put_GOTO_TABLE(ofpacts); - ogt->table_id = oigt->table_id; +static char * OVS_WARN_UNUSED_RESULT +parse_DEC_TTL(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + if (*arg == '\0') { + parse_noargs_dec_ttl(ofpacts); + } else { + struct ofpact_cnt_ids *ids; + char *cntr; + + ids = ofpact_put_DEC_TTL(ofpacts); + ids->ofpact.raw = NXAST_RAW_DEC_TTL_CNT_IDS; + for (cntr = strtok_r(arg, ", ", &arg); cntr != NULL; + cntr = strtok_r(NULL, ", ", &arg)) { + uint16_t id = atoi(cntr); + + ofpbuf_put(ofpacts, &id, sizeof id); + ids = ofpacts->header; + ids->n_controllers++; + } + if (!ids->n_controllers) { + return xstrdup("dec_ttl_cnt_ids: expected at least one controller " + "id."); + } + ofpact_update_len(ofpacts, &ids->ofpact); } + return NULL; +} - error = ofpacts_verify(ofpbuf_data(ofpacts), ofpbuf_size(ofpacts)); -exit: - if (error) { - ofpbuf_clear(ofpacts); +static void +format_DEC_TTL(const struct ofpact_cnt_ids *a, struct ds *s) +{ + size_t i; + + ds_put_cstr(s, "dec_ttl"); + if (a->ofpact.raw == NXAST_RAW_DEC_TTL_CNT_IDS) { + ds_put_cstr(s, "("); + for (i = 0; i < a->n_controllers; i++) { + if (i) { + ds_put_cstr(s, ","); + } + ds_put_format(s, "%"PRIu16, a->cnt_ids[i]); + } + ds_put_cstr(s, ")"); } - return error; } -/* Checks that 'port' is a valid output port for OFPACT_OUTPUT, given that the - * switch will never have more than 'max_ports' ports. Returns 0 if 'port' is - * valid, otherwise an OpenFlow error code. */ -enum ofperr -ofpact_check_output_port(ofp_port_t port, ofp_port_t max_ports) +/* Set MPLS label actions. */ + +static enum ofperr +decode_OFPAT_RAW_SET_MPLS_LABEL(ovs_be32 label, struct ofpbuf *out) { - switch (port) { - case OFPP_IN_PORT: - case OFPP_TABLE: - case OFPP_NORMAL: - case OFPP_FLOOD: - case OFPP_ALL: - case OFPP_CONTROLLER: - case OFPP_NONE: - case OFPP_LOCAL: - return 0; + ofpact_put_SET_MPLS_LABEL(out)->label = label; + return 0; +} - default: - if (ofp_to_u16(port) < ofp_to_u16(max_ports)) { - return 0; - } - return OFPERR_OFPBAC_BAD_OUT_PORT; +static void +encode_SET_MPLS_LABEL(const struct ofpact_mpls_label *label, + enum ofp_version ofp_version, + struct ofpbuf *out) +{ + if (ofp_version < OFP12_VERSION) { + put_OFPAT_SET_MPLS_LABEL(out, ofp_version, label->label); + } else { + ofpact_put_set_field(out, ofp_version, MFF_MPLS_LABEL, + ntohl(label->label)); } } -/* Removes the protocols that require consistency between match and actions - * (that's everything but OpenFlow 1.0) from '*usable_protocols'. - * - * (An example of an inconsistency between match and actions is a flow that - * does not match on an MPLS Ethertype but has an action that pops an MPLS - * label.) */ +static char * OVS_WARN_UNUSED_RESULT +parse_SET_MPLS_LABEL(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_mpls_label *mpls_label = ofpact_put_SET_MPLS_LABEL(ofpacts); + if (*arg == '\0') { + return xstrdup("set_mpls_label: expected label."); + } + + mpls_label->label = htonl(atoi(arg)); + return NULL; +} + static void -inconsistent_match(enum ofputil_protocol *usable_protocols) +format_SET_MPLS_LABEL(const struct ofpact_mpls_label *a, struct ds *s) { - *usable_protocols &= OFPUTIL_P_OF10_ANY; + ds_put_format(s, "set_mpls_label(%"PRIu32")", ntohl(a->label)); } + +/* Set MPLS TC actions. */ -/* May modify flow->dl_type, flow->nw_proto and flow->vlan_tci, - * caller must restore them. - * - * Modifies some actions, filling in fields that could not be properly set - * without context. */ static enum ofperr -ofpact_check__(enum ofputil_protocol *usable_protocols, struct ofpact *a, - struct flow *flow, ofp_port_t max_ports, - uint8_t table_id, uint8_t n_tables) +decode_OFPAT_RAW_SET_MPLS_TC(uint8_t tc, struct ofpbuf *out) { - const struct ofpact_enqueue *enqueue; - const struct mf_field *mf; + ofpact_put_SET_MPLS_TC(out)->tc = tc; + return 0; +} - switch (a->type) { - case OFPACT_OUTPUT: - return ofpact_check_output_port(ofpact_get_OUTPUT(a)->port, - max_ports); +static void +encode_SET_MPLS_TC(const struct ofpact_mpls_tc *tc, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version < OFP12_VERSION) { + put_OFPAT_SET_MPLS_TC(out, ofp_version, tc->tc); + } else { + ofpact_put_set_field(out, ofp_version, MFF_MPLS_TC, tc->tc); + } +} - case OFPACT_CONTROLLER: - return 0; +static char * OVS_WARN_UNUSED_RESULT +parse_SET_MPLS_TC(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_mpls_tc *mpls_tc = ofpact_put_SET_MPLS_TC(ofpacts); - case OFPACT_ENQUEUE: - enqueue = ofpact_get_ENQUEUE(a); - if (ofp_to_u16(enqueue->port) >= ofp_to_u16(max_ports) - && enqueue->port != OFPP_IN_PORT - && enqueue->port != OFPP_LOCAL) { - return OFPERR_OFPBAC_BAD_OUT_PORT; - } - return 0; + if (*arg == '\0') { + return xstrdup("set_mpls_tc: expected tc."); + } - case OFPACT_OUTPUT_REG: - return mf_check_src(&ofpact_get_OUTPUT_REG(a)->src, flow); + mpls_tc->tc = atoi(arg); + return NULL; +} - case OFPACT_BUNDLE: - return bundle_check(ofpact_get_BUNDLE(a), max_ports, flow); +static void +format_SET_MPLS_TC(const struct ofpact_mpls_tc *a, struct ds *s) +{ + ds_put_format(s, "set_mpls_ttl(%"PRIu8")", a->tc); +} + +/* Set MPLS TTL actions. */ - case OFPACT_SET_VLAN_VID: - /* Remember if we saw a vlan tag in the flow to aid translating to - * OpenFlow 1.1+ if need be. */ - ofpact_get_SET_VLAN_VID(a)->flow_has_vlan = - (flow->vlan_tci & htons(VLAN_CFI)) == htons(VLAN_CFI); - if (!(flow->vlan_tci & htons(VLAN_CFI)) && - !ofpact_get_SET_VLAN_VID(a)->push_vlan_if_needed) { - inconsistent_match(usable_protocols); - } - /* Temporary mark that we have a vlan tag. */ - flow->vlan_tci |= htons(VLAN_CFI); - return 0; +static enum ofperr +decode_OFPAT_RAW_SET_MPLS_TTL(uint8_t ttl, struct ofpbuf *out) +{ + ofpact_put_SET_MPLS_TTL(out)->ttl = ttl; + return 0; +} - case OFPACT_SET_VLAN_PCP: - /* Remember if we saw a vlan tag in the flow to aid translating to - * OpenFlow 1.1+ if need be. */ - ofpact_get_SET_VLAN_PCP(a)->flow_has_vlan = - (flow->vlan_tci & htons(VLAN_CFI)) == htons(VLAN_CFI); - if (!(flow->vlan_tci & htons(VLAN_CFI)) && - !ofpact_get_SET_VLAN_PCP(a)->push_vlan_if_needed) { - inconsistent_match(usable_protocols); - } - /* Temporary mark that we have a vlan tag. */ - flow->vlan_tci |= htons(VLAN_CFI); - return 0; +static void +encode_SET_MPLS_TTL(const struct ofpact_mpls_ttl *ttl, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + put_OFPAT_SET_MPLS_TTL(out, ofp_version, ttl->ttl); +} - case OFPACT_STRIP_VLAN: - if (!(flow->vlan_tci & htons(VLAN_CFI))) { - inconsistent_match(usable_protocols); - } - /* Temporary mark that we have no vlan tag. */ - flow->vlan_tci = htons(0); - return 0; +/* Parses 'arg' as the argument to a "set_mpls_ttl" action, and appends such an + * action to 'ofpacts'. + * + * Returns NULL if successful, otherwise a malloc()'d string describing the + * error. The caller is responsible for freeing the returned string. */ +static char * OVS_WARN_UNUSED_RESULT +parse_SET_MPLS_TTL(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_mpls_ttl *mpls_ttl = ofpact_put_SET_MPLS_TTL(ofpacts); - case OFPACT_PUSH_VLAN: - if (flow->vlan_tci & htons(VLAN_CFI)) { - /* Multiple VLAN headers not supported. */ - return OFPERR_OFPBAC_BAD_TAG; + if (*arg == '\0') { + return xstrdup("set_mpls_ttl: expected ttl."); + } + + mpls_ttl->ttl = atoi(arg); + return NULL; +} + +static void +format_SET_MPLS_TTL(const struct ofpact_mpls_ttl *a, struct ds *s) +{ + ds_put_format(s, "set_mpls_ttl(%"PRIu8")", a->ttl); +} + +/* Decrement MPLS TTL actions. */ + +static enum ofperr +decode_OFPAT_RAW_DEC_MPLS_TTL(struct ofpbuf *out) +{ + ofpact_put_DEC_MPLS_TTL(out); + return 0; +} + +static void +encode_DEC_MPLS_TTL(const struct ofpact_null *null OVS_UNUSED, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + put_OFPAT_DEC_MPLS_TTL(out, ofp_version); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_DEC_MPLS_TTL(char *arg OVS_UNUSED, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + ofpact_put_DEC_MPLS_TTL(ofpacts); + return NULL; +} + +static void +format_DEC_MPLS_TTL(const struct ofpact_null *a OVS_UNUSED, struct ds *s) +{ + ds_put_cstr(s, "dec_mpls_ttl"); +} + +/* Push MPLS label action. */ + +static enum ofperr +decode_OFPAT_RAW_PUSH_MPLS(ovs_be16 ethertype, struct ofpbuf *out) +{ + struct ofpact_push_mpls *oam; + + if (!eth_type_mpls(ethertype)) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + oam = ofpact_put_PUSH_MPLS(out); + oam->ethertype = ethertype; + + return 0; +} + +static void +encode_PUSH_MPLS(const struct ofpact_push_mpls *push_mpls, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + put_OFPAT_PUSH_MPLS(out, ofp_version, push_mpls->ethertype); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_PUSH_MPLS(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + uint16_t ethertype; + char *error; + + error = str_to_u16(arg, "push_mpls", ðertype); + if (!error) { + ofpact_put_PUSH_MPLS(ofpacts)->ethertype = htons(ethertype); + } + return error; +} + +static void +format_PUSH_MPLS(const struct ofpact_push_mpls *a, struct ds *s) +{ + ds_put_format(s, "push_mpls:0x%04"PRIx16, ntohs(a->ethertype)); +} + +/* Pop MPLS label action. */ + +static enum ofperr +decode_OFPAT_RAW_POP_MPLS(ovs_be16 ethertype, struct ofpbuf *out) +{ + ofpact_put_POP_MPLS(out)->ethertype = ethertype; + return 0; +} + +static void +encode_POP_MPLS(const struct ofpact_pop_mpls *pop_mpls, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + put_OFPAT_POP_MPLS(out, ofp_version, pop_mpls->ethertype); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_POP_MPLS(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + uint16_t ethertype; + char *error; + + error = str_to_u16(arg, "pop_mpls", ðertype); + if (!error) { + ofpact_put_POP_MPLS(ofpacts)->ethertype = htons(ethertype); + } + return error; +} + +static void +format_POP_MPLS(const struct ofpact_pop_mpls *a, struct ds *s) +{ + ds_put_format(s, "pop_mpls:0x%04"PRIx16, ntohs(a->ethertype)); +} + +/* Set tunnel ID actions. */ + +static enum ofperr +decode_NXAST_RAW_SET_TUNNEL(uint32_t tun_id, struct ofpbuf *out) +{ + struct ofpact_tunnel *tunnel = ofpact_put_SET_TUNNEL(out); + tunnel->ofpact.raw = NXAST_RAW_SET_TUNNEL; + tunnel->tun_id = tun_id; + return 0; +} + +static enum ofperr +decode_NXAST_RAW_SET_TUNNEL64(uint64_t tun_id, struct ofpbuf *out) +{ + struct ofpact_tunnel *tunnel = ofpact_put_SET_TUNNEL(out); + tunnel->ofpact.raw = NXAST_RAW_SET_TUNNEL64; + tunnel->tun_id = tun_id; + return 0; +} + +static void +encode_SET_TUNNEL(const struct ofpact_tunnel *tunnel, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + uint64_t tun_id = tunnel->tun_id; + + if (ofp_version < OFP12_VERSION) { + if (tun_id <= UINT32_MAX + && tunnel->ofpact.raw != NXAST_RAW_SET_TUNNEL64) { + put_NXAST_SET_TUNNEL(out, tun_id); + } else { + put_NXAST_SET_TUNNEL64(out, tun_id); } - /* Temporary mark that we have a vlan tag. */ - flow->vlan_tci |= htons(VLAN_CFI); + } else { + ofpact_put_set_field(out, ofp_version, MFF_TUN_ID, tun_id); + } +} + +static char * OVS_WARN_UNUSED_RESULT +parse_set_tunnel(char *arg, struct ofpbuf *ofpacts, + enum ofp_raw_action_type raw) +{ + struct ofpact_tunnel *tunnel; + + tunnel = ofpact_put_SET_TUNNEL(ofpacts); + tunnel->ofpact.raw = raw; + return str_to_u64(arg, &tunnel->tun_id); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_SET_TUNNEL(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return parse_set_tunnel(arg, ofpacts, NXAST_RAW_SET_TUNNEL); +} + +static void +format_SET_TUNNEL(const struct ofpact_tunnel *a, struct ds *s) +{ + ds_put_format(s, "set_tunnel%s:%#"PRIx64, + (a->tun_id > UINT32_MAX + || a->ofpact.raw == NXAST_RAW_SET_TUNNEL64 ? "64" : ""), + a->tun_id); +} + +/* Set queue action. */ + +static enum ofperr +decode_OFPAT_RAW_SET_QUEUE(uint32_t queue_id, struct ofpbuf *out) +{ + ofpact_put_SET_QUEUE(out)->queue_id = queue_id; + return 0; +} + +static void +encode_SET_QUEUE(const struct ofpact_queue *queue, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + put_OFPAT_SET_QUEUE(out, ofp_version, queue->queue_id); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_SET_QUEUE(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return str_to_u32(arg, &ofpact_put_SET_QUEUE(ofpacts)->queue_id); +} + +static void +format_SET_QUEUE(const struct ofpact_queue *a, struct ds *s) +{ + ds_put_format(s, "set_queue:%"PRIu32, a->queue_id); +} + +/* Pop queue action. */ + +static enum ofperr +decode_NXAST_RAW_POP_QUEUE(struct ofpbuf *out) +{ + ofpact_put_POP_QUEUE(out); + return 0; +} + +static void +encode_POP_QUEUE(const struct ofpact_null *null OVS_UNUSED, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + put_NXAST_POP_QUEUE(out); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_POP_QUEUE(const char *arg OVS_UNUSED, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + ofpact_put_POP_QUEUE(ofpacts); + return NULL; +} + +static void +format_POP_QUEUE(const struct ofpact_null *a OVS_UNUSED, struct ds *s) +{ + ds_put_cstr(s, "pop_queue"); +} + +/* Action structure for NXAST_FIN_TIMEOUT. + * + * This action changes the idle timeout or hard timeout, or both, of this + * OpenFlow rule when the rule matches a TCP packet with the FIN or RST flag. + * When such a packet is observed, the action reduces the rule's idle timeout + * to 'fin_idle_timeout' and its hard timeout to 'fin_hard_timeout'. This + * action has no effect on an existing timeout that is already shorter than the + * one that the action specifies. A 'fin_idle_timeout' or 'fin_hard_timeout' + * of zero has no effect on the respective timeout. + * + * 'fin_idle_timeout' and 'fin_hard_timeout' are measured in seconds. + * 'fin_hard_timeout' specifies time since the flow's creation, not since the + * receipt of the FIN or RST. + * + * This is useful for quickly discarding learned TCP flows that otherwise will + * take a long time to expire. + * + * This action is intended for use with an OpenFlow rule that matches only a + * single TCP flow. If the rule matches multiple TCP flows (e.g. it wildcards + * all TCP traffic, or all TCP traffic to a particular port), then any FIN or + * RST in any of those flows will cause the entire OpenFlow rule to expire + * early, which is not normally desirable. + */ +struct nx_action_fin_timeout { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_FIN_TIMEOUT. */ + ovs_be16 fin_idle_timeout; /* New idle timeout, if nonzero. */ + ovs_be16 fin_hard_timeout; /* New hard timeout, if nonzero. */ + ovs_be16 pad; /* Must be zero. */ +}; +OFP_ASSERT(sizeof(struct nx_action_fin_timeout) == 16); + +static enum ofperr +decode_NXAST_RAW_FIN_TIMEOUT(const struct nx_action_fin_timeout *naft, + struct ofpbuf *out) +{ + struct ofpact_fin_timeout *oft; + + oft = ofpact_put_FIN_TIMEOUT(out); + oft->fin_idle_timeout = ntohs(naft->fin_idle_timeout); + oft->fin_hard_timeout = ntohs(naft->fin_hard_timeout); + return 0; +} + +static void +encode_FIN_TIMEOUT(const struct ofpact_fin_timeout *fin_timeout, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out) +{ + struct nx_action_fin_timeout *naft = put_NXAST_FIN_TIMEOUT(out); + naft->fin_idle_timeout = htons(fin_timeout->fin_idle_timeout); + naft->fin_hard_timeout = htons(fin_timeout->fin_hard_timeout); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_FIN_TIMEOUT(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_fin_timeout *oft = ofpact_put_FIN_TIMEOUT(ofpacts); + char *key, *value; + + while (ofputil_parse_key_value(&arg, &key, &value)) { + char *error; + + if (!strcmp(key, "idle_timeout")) { + error = str_to_u16(value, key, &oft->fin_idle_timeout); + } else if (!strcmp(key, "hard_timeout")) { + error = str_to_u16(value, key, &oft->fin_hard_timeout); + } else { + error = xasprintf("invalid key '%s' in 'fin_timeout' argument", + key); + } + + if (error) { + return error; + } + } + return NULL; +} + +static void +format_FIN_TIMEOUT(const struct ofpact_fin_timeout *a, struct ds *s) +{ + ds_put_cstr(s, "fin_timeout("); + if (a->fin_idle_timeout) { + ds_put_format(s, "idle_timeout=%"PRIu16",", a->fin_idle_timeout); + } + if (a->fin_hard_timeout) { + ds_put_format(s, "hard_timeout=%"PRIu16",", a->fin_hard_timeout); + } + ds_chomp(s, ','); + ds_put_char(s, ')'); +} + +/* Action structures for NXAST_RESUBMIT and NXAST_RESUBMIT_TABLE. + * + * These actions search one of the switch's flow tables: + * + * - For NXAST_RESUBMIT_TABLE only, if the 'table' member is not 255, then + * it specifies the table to search. + * + * - Otherwise (for NXAST_RESUBMIT_TABLE with a 'table' of 255, or for + * NXAST_RESUBMIT regardless of 'table'), it searches the current flow + * table, that is, the OpenFlow flow table that contains the flow from + * which this action was obtained. If this action did not come from a + * flow table (e.g. it came from an OFPT_PACKET_OUT message), then table 0 + * is the current table. + * + * The flow table lookup uses a flow that may be slightly modified from the + * original lookup: + * + * - For NXAST_RESUBMIT, the 'in_port' member of struct nx_action_resubmit + * is used as the flow's in_port. + * + * - For NXAST_RESUBMIT_TABLE, if the 'in_port' member is not OFPP_IN_PORT, + * then its value is used as the flow's in_port. Otherwise, the original + * in_port is used. + * + * - If actions that modify the flow (e.g. OFPAT_SET_VLAN_VID) precede the + * resubmit action, then the flow is updated with the new values. + * + * Following the lookup, the original in_port is restored. + * + * If the modified flow matched in the flow table, then the corresponding + * actions are executed. Afterward, actions following the resubmit in the + * original set of actions, if any, are executed; any changes made to the + * packet (e.g. changes to VLAN) by secondary actions persist when those + * actions are executed, although the original in_port is restored. + * + * Resubmit actions may be used any number of times within a set of actions. + * + * Resubmit actions may nest to an implementation-defined depth. Beyond this + * implementation-defined depth, further resubmit actions are simply ignored. + * + * NXAST_RESUBMIT ignores 'table' and 'pad'. NXAST_RESUBMIT_TABLE requires + * 'pad' to be all-bits-zero. + * + * Open vSwitch 1.0.1 and earlier did not support recursion. Open vSwitch + * before 1.2.90 did not support NXAST_RESUBMIT_TABLE. + */ +struct nx_action_resubmit { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_RESUBMIT. */ + ovs_be16 in_port; /* New in_port for checking flow table. */ + uint8_t table; /* NXAST_RESUBMIT_TABLE: table to use. */ + uint8_t pad[3]; +}; +OFP_ASSERT(sizeof(struct nx_action_resubmit) == 16); + +static enum ofperr +decode_NXAST_RAW_RESUBMIT(uint16_t port, struct ofpbuf *out) +{ + struct ofpact_resubmit *resubmit; + + resubmit = ofpact_put_RESUBMIT(out); + resubmit->ofpact.raw = NXAST_RAW_RESUBMIT; + resubmit->in_port = u16_to_ofp(port); + resubmit->table_id = 0xff; + return 0; +} + +static enum ofperr +decode_NXAST_RAW_RESUBMIT_TABLE(const struct nx_action_resubmit *nar, + struct ofpbuf *out) +{ + struct ofpact_resubmit *resubmit; + + if (nar->pad[0] || nar->pad[1] || nar->pad[2]) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + resubmit = ofpact_put_RESUBMIT(out); + resubmit->ofpact.raw = NXAST_RAW_RESUBMIT_TABLE; + resubmit->in_port = u16_to_ofp(ntohs(nar->in_port)); + resubmit->table_id = nar->table; + return 0; +} + +static void +encode_RESUBMIT(const struct ofpact_resubmit *resubmit, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + uint16_t in_port = ofp_to_u16(resubmit->in_port); + + if (resubmit->table_id == 0xff + && resubmit->ofpact.raw != NXAST_RAW_RESUBMIT_TABLE) { + put_NXAST_RESUBMIT(out, in_port); + } else { + struct nx_action_resubmit *nar = put_NXAST_RESUBMIT_TABLE(out); + nar->table = resubmit->table_id; + nar->in_port = htons(in_port); + } +} + +static char * OVS_WARN_UNUSED_RESULT +parse_RESUBMIT(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_resubmit *resubmit; + char *in_port_s, *table_s; + + resubmit = ofpact_put_RESUBMIT(ofpacts); + + in_port_s = strsep(&arg, ","); + if (in_port_s && in_port_s[0]) { + if (!ofputil_port_from_string(in_port_s, &resubmit->in_port)) { + return xasprintf("%s: resubmit to unknown port", in_port_s); + } + } else { + resubmit->in_port = OFPP_IN_PORT; + } + + table_s = strsep(&arg, ","); + if (table_s && table_s[0]) { + uint32_t table_id = 0; + char *error; + + error = str_to_u32(table_s, &table_id); + if (error) { + return error; + } + resubmit->table_id = table_id; + } else { + resubmit->table_id = 255; + } + + if (resubmit->in_port == OFPP_IN_PORT && resubmit->table_id == 255) { + return xstrdup("at least one \"in_port\" or \"table\" must be " + "specified on resubmit"); + } + return NULL; +} + +static void +format_RESUBMIT(const struct ofpact_resubmit *a, struct ds *s) +{ + if (a->in_port != OFPP_IN_PORT && a->table_id == 255) { + ds_put_cstr(s, "resubmit:"); + ofputil_format_port(a->in_port, s); + } else { + ds_put_format(s, "resubmit("); + if (a->in_port != OFPP_IN_PORT) { + ofputil_format_port(a->in_port, s); + } + ds_put_char(s, ','); + if (a->table_id != 255) { + ds_put_format(s, "%"PRIu8, a->table_id); + } + ds_put_char(s, ')'); + } +} + +/* Action structure for NXAST_LEARN. + * + * This action adds or modifies a flow in an OpenFlow table, similar to + * OFPT_FLOW_MOD with OFPFC_MODIFY_STRICT as 'command'. The new flow has the + * specified idle timeout, hard timeout, priority, cookie, and flags. The new + * flow's match criteria and actions are built by applying each of the series + * of flow_mod_spec elements included as part of the action. + * + * A flow_mod_spec starts with a 16-bit header. A header that is all-bits-0 is + * a no-op used for padding the action as a whole to a multiple of 8 bytes in + * length. Otherwise, the flow_mod_spec can be thought of as copying 'n_bits' + * bits from a source to a destination. In this case, the header contains + * multiple fields: + * + * 15 14 13 12 11 10 0 + * +------+---+------+---------------------------------+ + * | 0 |src| dst | n_bits | + * +------+---+------+---------------------------------+ + * + * The meaning and format of a flow_mod_spec depends on 'src' and 'dst'. The + * following table summarizes the meaning of each possible combination. + * Details follow the table: + * + * src dst meaning + * --- --- ---------------------------------------------------------- + * 0 0 Add match criteria based on value in a field. + * 1 0 Add match criteria based on an immediate value. + * 0 1 Add NXAST_REG_LOAD action to copy field into a different field. + * 1 1 Add NXAST_REG_LOAD action to load immediate value into a field. + * 0 2 Add OFPAT_OUTPUT action to output to port from specified field. + * All other combinations are undefined and not allowed. + * + * The flow_mod_spec header is followed by a source specification and a + * destination specification. The format and meaning of the source + * specification depends on 'src': + * + * - If 'src' is 0, the source bits are taken from a field in the flow to + * which this action is attached. (This should be a wildcarded field. If + * its value is fully specified then the source bits being copied have + * constant values.) + * + * The source specification is an ovs_be32 'field' and an ovs_be16 'ofs'. + * 'field' is an nxm_header with nxm_hasmask=0, and 'ofs' the starting bit + * offset within that field. The source bits are field[ofs:ofs+n_bits-1]. + * 'field' and 'ofs' are subject to the same restrictions as the source + * field in NXAST_REG_MOVE. + * + * - If 'src' is 1, the source bits are a constant value. The source + * specification is (n_bits+15)/16*2 bytes long. Taking those bytes as a + * number in network order, the source bits are the 'n_bits' + * least-significant bits. The switch will report an error if other bits + * in the constant are nonzero. + * + * The flow_mod_spec destination specification, for 'dst' of 0 or 1, is an + * ovs_be32 'field' and an ovs_be16 'ofs'. 'field' is an nxm_header with + * nxm_hasmask=0 and 'ofs' is a starting bit offset within that field. The + * meaning of the flow_mod_spec depends on 'dst': + * + * - If 'dst' is 0, the flow_mod_spec specifies match criteria for the new + * flow. The new flow matches only if bits field[ofs:ofs+n_bits-1] in a + * packet equal the source bits. 'field' may be any nxm_header with + * nxm_hasmask=0 that is allowed in NXT_FLOW_MOD. + * + * Order is significant. Earlier flow_mod_specs must satisfy any + * prerequisites for matching fields specified later, by copying constant + * values into prerequisite fields. + * + * The switch will reject flow_mod_specs that do not satisfy NXM masking + * restrictions. + * + * - If 'dst' is 1, the flow_mod_spec specifies an NXAST_REG_LOAD action for + * the new flow. The new flow copies the source bits into + * field[ofs:ofs+n_bits-1]. Actions are executed in the same order as the + * flow_mod_specs. + * + * A single NXAST_REG_LOAD action writes no more than 64 bits, so n_bits + * greater than 64 yields multiple NXAST_REG_LOAD actions. + * + * The flow_mod_spec destination spec for 'dst' of 2 (when 'src' is 0) is + * empty. It has the following meaning: + * + * - The flow_mod_spec specifies an OFPAT_OUTPUT action for the new flow. + * The new flow outputs to the OpenFlow port specified by the source field. + * Of the special output ports with value OFPP_MAX or larger, OFPP_IN_PORT, + * OFPP_FLOOD, OFPP_LOCAL, and OFPP_ALL are supported. Other special ports + * may not be used. + * + * Resource Management + * ------------------- + * + * A switch has a finite amount of flow table space available for learning. + * When this space is exhausted, no new learning table entries will be learned + * until some existing flow table entries expire. The controller should be + * prepared to handle this by flooding (which can be implemented as a + * low-priority flow). + * + * If a learned flow matches a single TCP stream with a relatively long + * timeout, one may make the best of resource constraints by setting + * 'fin_idle_timeout' or 'fin_hard_timeout' (both measured in seconds), or + * both, to shorter timeouts. When either of these is specified as a nonzero + * value, OVS adds a NXAST_FIN_TIMEOUT action, with the specified timeouts, to + * the learned flow. + * + * Examples + * -------- + * + * The following examples give a prose description of the flow_mod_specs along + * with informal notation for how those would be represented and a hex dump of + * the bytes that would be required. + * + * These examples could work with various nx_action_learn parameters. Typical + * values would be idle_timeout=OFP_FLOW_PERMANENT, hard_timeout=60, + * priority=OFP_DEFAULT_PRIORITY, flags=0, table_id=10. + * + * 1. Learn input port based on the source MAC, with lookup into + * NXM_NX_REG1[16:31] by resubmit to in_port=99: + * + * Match on in_port=99: + * ovs_be16(src=1, dst=0, n_bits=16), 20 10 + * ovs_be16(99), 00 63 + * ovs_be32(NXM_OF_IN_PORT), ovs_be16(0) 00 00 00 02 00 00 + * + * Match Ethernet destination on Ethernet source from packet: + * ovs_be16(src=0, dst=0, n_bits=48), 00 30 + * ovs_be32(NXM_OF_ETH_SRC), ovs_be16(0) 00 00 04 06 00 00 + * ovs_be32(NXM_OF_ETH_DST), ovs_be16(0) 00 00 02 06 00 00 + * + * Set NXM_NX_REG1[16:31] to the packet's input port: + * ovs_be16(src=0, dst=1, n_bits=16), 08 10 + * ovs_be32(NXM_OF_IN_PORT), ovs_be16(0) 00 00 00 02 00 00 + * ovs_be32(NXM_NX_REG1), ovs_be16(16) 00 01 02 04 00 10 + * + * Given a packet that arrived on port A with Ethernet source address B, + * this would set up the flow "in_port=99, dl_dst=B, + * actions=load:A->NXM_NX_REG1[16..31]". + * + * In syntax accepted by ovs-ofctl, this action is: learn(in_port=99, + * NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], + * load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) + * + * 2. Output to input port based on the source MAC and VLAN VID, with lookup + * into NXM_NX_REG1[16:31]: + * + * Match on same VLAN ID as packet: + * ovs_be16(src=0, dst=0, n_bits=12), 00 0c + * ovs_be32(NXM_OF_VLAN_TCI), ovs_be16(0) 00 00 08 02 00 00 + * ovs_be32(NXM_OF_VLAN_TCI), ovs_be16(0) 00 00 08 02 00 00 + * + * Match Ethernet destination on Ethernet source from packet: + * ovs_be16(src=0, dst=0, n_bits=48), 00 30 + * ovs_be32(NXM_OF_ETH_SRC), ovs_be16(0) 00 00 04 06 00 00 + * ovs_be32(NXM_OF_ETH_DST), ovs_be16(0) 00 00 02 06 00 00 + * + * Output to the packet's input port: + * ovs_be16(src=0, dst=2, n_bits=16), 10 10 + * ovs_be32(NXM_OF_IN_PORT), ovs_be16(0) 00 00 00 02 00 00 + * + * Given a packet that arrived on port A with Ethernet source address B in + * VLAN C, this would set up the flow "dl_dst=B, vlan_vid=C, + * actions=output:A". + * + * In syntax accepted by ovs-ofctl, this action is: + * learn(NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], + * output:NXM_OF_IN_PORT[]) + * + * 3. Here's a recipe for a very simple-minded MAC learning switch. It uses a + * 10-second MAC expiration time to make it easier to see what's going on + * + * ovs-vsctl del-controller br0 + * ovs-ofctl del-flows br0 + * ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, \ + hard_timeout=10, NXM_OF_VLAN_TCI[0..11], \ + NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ + output:NXM_OF_IN_PORT[]), resubmit(,1)" + * ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood" + * + * You can then dump the MAC learning table with: + * + * ovs-ofctl dump-flows br0 table=1 + * + * Usage Advice + * ------------ + * + * For best performance, segregate learned flows into a table that is not used + * for any other flows except possibly for a lowest-priority "catch-all" flow + * (a flow with no match criteria). If different learning actions specify + * different match criteria, use different tables for the learned flows. + * + * The meaning of 'hard_timeout' and 'idle_timeout' can be counterintuitive. + * These timeouts apply to the flow that is added, which means that a flow with + * an idle timeout will expire when no traffic has been sent *to* the learned + * address. This is not usually the intent in MAC learning; instead, we want + * the MAC learn entry to expire when no traffic has been sent *from* the + * learned address. Use a hard timeout for that. + * + * + * Visibility of Changes + * --------------------- + * + * Prior to Open vSwitch 2.4, any changes made by a "learn" action in a given + * flow translation are visible to flow table lookups made later in the flow + * translation. This means that, in the example above, a MAC learned by the + * learn action in table 0 would be found in table 1 (if the packet being + * processed had the same source and destination MAC address). + * + * In Open vSwitch 2.4 and later, changes to a flow table (whether to add or + * modify a flow) by a "learn" action are visible only for later flow + * translations, not for later lookups within the same flow translation. In + * the MAC learning example, a MAC learned by the learn action in table 0 would + * not be found in table 1 if the flow translation would resubmit to table 1 + * after the processing of the learn action, meaning that if this MAC had not + * been learned before then the packet would be flooded. */ +struct nx_action_learn { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* At least 24. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_LEARN. */ + ovs_be16 idle_timeout; /* Idle time before discarding (seconds). */ + ovs_be16 hard_timeout; /* Max time before discarding (seconds). */ + ovs_be16 priority; /* Priority level of flow entry. */ + ovs_be64 cookie; /* Cookie for new flow. */ + ovs_be16 flags; /* NX_LEARN_F_*. */ + uint8_t table_id; /* Table to insert flow entry. */ + uint8_t pad; /* Must be zero. */ + ovs_be16 fin_idle_timeout; /* Idle timeout after FIN, if nonzero. */ + ovs_be16 fin_hard_timeout; /* Hard timeout after FIN, if nonzero. */ + /* Followed by a sequence of flow_mod_spec elements, as described above, + * until the end of the action is reached. */ +}; +OFP_ASSERT(sizeof(struct nx_action_learn) == 32); + +static ovs_be16 +get_be16(const void **pp) +{ + const ovs_be16 *p = *pp; + ovs_be16 value = *p; + *pp = p + 1; + return value; +} + +static ovs_be32 +get_be32(const void **pp) +{ + const ovs_be32 *p = *pp; + ovs_be32 value = get_unaligned_be32(p); + *pp = p + 1; + return value; +} + +static void +get_subfield(int n_bits, const void **p, struct mf_subfield *sf) +{ + sf->field = mf_from_nxm_header(ntohl(get_be32(p))); + sf->ofs = ntohs(get_be16(p)); + sf->n_bits = n_bits; +} + +static unsigned int +learn_min_len(uint16_t header) +{ + int n_bits = header & NX_LEARN_N_BITS_MASK; + int src_type = header & NX_LEARN_SRC_MASK; + int dst_type = header & NX_LEARN_DST_MASK; + unsigned int min_len; + + min_len = 0; + if (src_type == NX_LEARN_SRC_FIELD) { + min_len += sizeof(ovs_be32); /* src_field */ + min_len += sizeof(ovs_be16); /* src_ofs */ + } else { + min_len += DIV_ROUND_UP(n_bits, 16); + } + if (dst_type == NX_LEARN_DST_MATCH || + dst_type == NX_LEARN_DST_LOAD) { + min_len += sizeof(ovs_be32); /* dst_field */ + min_len += sizeof(ovs_be16); /* dst_ofs */ + } + return min_len; +} + +/* Converts 'nal' into a "struct ofpact_learn" and appends that struct to + * 'ofpacts'. Returns 0 if successful, otherwise an OFPERR_*. */ +static enum ofperr +decode_NXAST_RAW_LEARN(const struct nx_action_learn *nal, + struct ofpbuf *ofpacts) +{ + struct ofpact_learn *learn; + const void *p, *end; + + if (nal->pad) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + learn = ofpact_put_LEARN(ofpacts); + + learn->idle_timeout = ntohs(nal->idle_timeout); + learn->hard_timeout = ntohs(nal->hard_timeout); + learn->priority = ntohs(nal->priority); + learn->cookie = nal->cookie; + learn->table_id = nal->table_id; + learn->fin_idle_timeout = ntohs(nal->fin_idle_timeout); + learn->fin_hard_timeout = ntohs(nal->fin_hard_timeout); + + learn->flags = ntohs(nal->flags); + if (learn->flags & ~(NX_LEARN_F_SEND_FLOW_REM | + NX_LEARN_F_DELETE_LEARNED)) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + if (learn->table_id == 0xff) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + end = (char *) nal + ntohs(nal->len); + for (p = nal + 1; p != end; ) { + struct ofpact_learn_spec *spec; + uint16_t header = ntohs(get_be16(&p)); + + if (!header) { + break; + } + + spec = ofpbuf_put_zeros(ofpacts, sizeof *spec); + learn = ofpacts->header; + learn->n_specs++; + + spec->src_type = header & NX_LEARN_SRC_MASK; + spec->dst_type = header & NX_LEARN_DST_MASK; + spec->n_bits = header & NX_LEARN_N_BITS_MASK; + + /* Check for valid src and dst type combination. */ + if (spec->dst_type == NX_LEARN_DST_MATCH || + spec->dst_type == NX_LEARN_DST_LOAD || + (spec->dst_type == NX_LEARN_DST_OUTPUT && + spec->src_type == NX_LEARN_SRC_FIELD)) { + /* OK. */ + } else { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + /* Check that the arguments don't overrun the end of the action. */ + if ((char *) end - (char *) p < learn_min_len(header)) { + return OFPERR_OFPBAC_BAD_LEN; + } + + /* Get the source. */ + if (spec->src_type == NX_LEARN_SRC_FIELD) { + get_subfield(spec->n_bits, &p, &spec->src); + } else { + int p_bytes = 2 * DIV_ROUND_UP(spec->n_bits, 16); + + bitwise_copy(p, p_bytes, 0, + &spec->src_imm, sizeof spec->src_imm, 0, + spec->n_bits); + p = (const uint8_t *) p + p_bytes; + } + + /* Get the destination. */ + if (spec->dst_type == NX_LEARN_DST_MATCH || + spec->dst_type == NX_LEARN_DST_LOAD) { + get_subfield(spec->n_bits, &p, &spec->dst); + } + } + ofpact_update_len(ofpacts, &learn->ofpact); + + if (!is_all_zeros(p, (char *) end - (char *) p)) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + return 0; +} + +static void +put_be16(struct ofpbuf *b, ovs_be16 x) +{ + ofpbuf_put(b, &x, sizeof x); +} + +static void +put_be32(struct ofpbuf *b, ovs_be32 x) +{ + ofpbuf_put(b, &x, sizeof x); +} + +static void +put_u16(struct ofpbuf *b, uint16_t x) +{ + put_be16(b, htons(x)); +} + +static void +put_u32(struct ofpbuf *b, uint32_t x) +{ + put_be32(b, htonl(x)); +} + +static void +encode_LEARN(const struct ofpact_learn *learn, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + const struct ofpact_learn_spec *spec; + struct nx_action_learn *nal; + size_t start_ofs; + + start_ofs = out->size; + nal = put_NXAST_LEARN(out); + nal->idle_timeout = htons(learn->idle_timeout); + nal->hard_timeout = htons(learn->hard_timeout); + nal->fin_idle_timeout = htons(learn->fin_idle_timeout); + nal->fin_hard_timeout = htons(learn->fin_hard_timeout); + nal->priority = htons(learn->priority); + nal->cookie = learn->cookie; + nal->flags = htons(learn->flags); + nal->table_id = learn->table_id; + + for (spec = learn->specs; spec < &learn->specs[learn->n_specs]; spec++) { + put_u16(out, spec->n_bits | spec->dst_type | spec->src_type); + + if (spec->src_type == NX_LEARN_SRC_FIELD) { + put_u32(out, mf_nxm_header(spec->src.field->id)); + put_u16(out, spec->src.ofs); + } else { + size_t n_dst_bytes = 2 * DIV_ROUND_UP(spec->n_bits, 16); + uint8_t *bits = ofpbuf_put_zeros(out, n_dst_bytes); + bitwise_copy(&spec->src_imm, sizeof spec->src_imm, 0, + bits, n_dst_bytes, 0, + spec->n_bits); + } + + if (spec->dst_type == NX_LEARN_DST_MATCH || + spec->dst_type == NX_LEARN_DST_LOAD) { + put_u32(out, mf_nxm_header(spec->dst.field->id)); + put_u16(out, spec->dst.ofs); + } + } + + pad_ofpat(out, start_ofs); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_LEARN(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return learn_parse(arg, ofpacts); +} + +static void +format_LEARN(const struct ofpact_learn *a, struct ds *s) +{ + learn_format(a, s); +} + +/* Action structure for NXAST_CONJUNCTION. */ +struct nx_action_conjunction { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* At least 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* See enum ofp_raw_action_type. */ + uint8_t clause; + uint8_t n_clauses; + ovs_be32 id; +}; +OFP_ASSERT(sizeof(struct nx_action_conjunction) == 16); + +static void +add_conjunction(struct ofpbuf *out, + uint32_t id, uint8_t clause, uint8_t n_clauses) +{ + struct ofpact_conjunction *oc; + + oc = ofpact_put_CONJUNCTION(out); + oc->id = id; + oc->clause = clause; + oc->n_clauses = n_clauses; +} + +static enum ofperr +decode_NXAST_RAW_CONJUNCTION(const struct nx_action_conjunction *nac, + struct ofpbuf *out) +{ + if (nac->n_clauses < 2 || nac->n_clauses > 64 + || nac->clause >= nac->n_clauses) { + return OFPERR_NXBAC_BAD_CONJUNCTION; + } else { + add_conjunction(out, ntohl(nac->id), nac->clause, nac->n_clauses); return 0; + } +} + +static void +encode_CONJUNCTION(const struct ofpact_conjunction *oc, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + struct nx_action_conjunction *nac = put_NXAST_CONJUNCTION(out); + nac->clause = oc->clause; + nac->n_clauses = oc->n_clauses; + nac->id = htonl(oc->id); +} + +static void +format_CONJUNCTION(const struct ofpact_conjunction *oc, struct ds *s) +{ + ds_put_format(s, "conjunction(%"PRIu32",%"PRIu8"/%"PRIu8")", + oc->id, oc->clause + 1, oc->n_clauses); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_CONJUNCTION(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + uint8_t n_clauses; + uint8_t clause; + uint32_t id; + int n; + + if (!ovs_scan(arg, "%"SCNi32" , %"SCNu8" / %"SCNu8" %n", + &id, &clause, &n_clauses, &n) || n != strlen(arg)) { + return xstrdup("\"conjunction\" syntax is \"conjunction(id,i/n)\""); + } + + if (n_clauses < 2) { + return xstrdup("conjunction must have at least 2 clauses"); + } else if (n_clauses > 64) { + return xstrdup("conjunction must have at most 64 clauses"); + } else if (clause < 1) { + return xstrdup("clause index must be positive"); + } else if (clause > n_clauses) { + return xstrdup("clause index must be less than or equal to " + "number of clauses"); + } + + add_conjunction(ofpacts, id, clause - 1, n_clauses); + return NULL; +} + +/* Action structure for NXAST_MULTIPATH. + * + * This action performs the following steps in sequence: + * + * 1. Hashes the fields designated by 'fields', one of NX_HASH_FIELDS_*. + * Refer to the definition of "enum nx_mp_fields" for details. + * + * The 'basis' value is used as a universal hash parameter, that is, + * different values of 'basis' yield different hash functions. The + * particular universal hash function used is implementation-defined. + * + * The hashed fields' values are drawn from the current state of the + * flow, including all modifications that have been made by actions up to + * this point. + * + * 2. Applies the multipath link choice algorithm specified by 'algorithm', + * one of NX_MP_ALG_*. Refer to the definition of "enum nx_mp_algorithm" + * for details. + * + * The output of the algorithm is 'link', an unsigned integer less than + * or equal to 'max_link'. + * + * Some algorithms use 'arg' as an additional argument. + * + * 3. Stores 'link' in dst[ofs:ofs+n_bits]. The format and semantics of + * 'dst' and 'ofs_nbits' are similar to those for the NXAST_REG_LOAD + * action. + * + * The switch will reject actions that have an unknown 'fields', or an unknown + * 'algorithm', or in which ofs+n_bits is greater than the width of 'dst', or + * in which 'max_link' is greater than or equal to 2**n_bits, with error type + * OFPET_BAD_ACTION, code OFPBAC_BAD_ARGUMENT. + */ +struct nx_action_multipath { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 32. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_MULTIPATH. */ + + /* What fields to hash and how. */ + ovs_be16 fields; /* One of NX_HASH_FIELDS_*. */ + ovs_be16 basis; /* Universal hash parameter. */ + ovs_be16 pad0; + + /* Multipath link choice algorithm to apply to hash value. */ + ovs_be16 algorithm; /* One of NX_MP_ALG_*. */ + ovs_be16 max_link; /* Number of output links, minus 1. */ + ovs_be32 arg; /* Algorithm-specific argument. */ + ovs_be16 pad1; + + /* Where to store the result. */ + ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */ + ovs_be32 dst; /* Destination. */ +}; +OFP_ASSERT(sizeof(struct nx_action_multipath) == 32); + +static enum ofperr +decode_NXAST_RAW_MULTIPATH(const struct nx_action_multipath *nam, + struct ofpbuf *out) +{ + uint32_t n_links = ntohs(nam->max_link) + 1; + size_t min_n_bits = log_2_ceil(n_links); + struct ofpact_multipath *mp; + + mp = ofpact_put_MULTIPATH(out); + mp->fields = ntohs(nam->fields); + mp->basis = ntohs(nam->basis); + mp->algorithm = ntohs(nam->algorithm); + mp->max_link = ntohs(nam->max_link); + mp->arg = ntohl(nam->arg); + mp->dst.field = mf_from_nxm_header(ntohl(nam->dst)); + mp->dst.ofs = nxm_decode_ofs(nam->ofs_nbits); + mp->dst.n_bits = nxm_decode_n_bits(nam->ofs_nbits); + + if (!flow_hash_fields_valid(mp->fields)) { + VLOG_WARN_RL(&rl, "unsupported fields %d", (int) mp->fields); + return OFPERR_OFPBAC_BAD_ARGUMENT; + } else if (mp->algorithm != NX_MP_ALG_MODULO_N + && mp->algorithm != NX_MP_ALG_HASH_THRESHOLD + && mp->algorithm != NX_MP_ALG_HRW + && mp->algorithm != NX_MP_ALG_ITER_HASH) { + VLOG_WARN_RL(&rl, "unsupported algorithm %d", (int) mp->algorithm); + return OFPERR_OFPBAC_BAD_ARGUMENT; + } else if (mp->dst.n_bits < min_n_bits) { + VLOG_WARN_RL(&rl, "multipath action requires at least %"PRIuSIZE" bits for " + "%"PRIu32" links", min_n_bits, n_links); + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + return multipath_check(mp, NULL); +} + +static void +encode_MULTIPATH(const struct ofpact_multipath *mp, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + struct nx_action_multipath *nam = put_NXAST_MULTIPATH(out); + + nam->fields = htons(mp->fields); + nam->basis = htons(mp->basis); + nam->algorithm = htons(mp->algorithm); + nam->max_link = htons(mp->max_link); + nam->arg = htonl(mp->arg); + nam->ofs_nbits = nxm_encode_ofs_nbits(mp->dst.ofs, mp->dst.n_bits); + nam->dst = htonl(mf_nxm_header(mp->dst.field->id)); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_MULTIPATH(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + return multipath_parse(ofpact_put_MULTIPATH(ofpacts), arg); +} + +static void +format_MULTIPATH(const struct ofpact_multipath *a, struct ds *s) +{ + multipath_format(a, s); +} + +/* Action structure for NXAST_NOTE. + * + * This action has no effect. It is variable length. The switch does not + * attempt to interpret the user-defined 'note' data in any way. A controller + * can use this action to attach arbitrary metadata to a flow. + * + * This action might go away in the future. + */ +struct nx_action_note { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* A multiple of 8, but at least 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_NOTE. */ + uint8_t note[6]; /* Start of user-defined data. */ + /* Possibly followed by additional user-defined data. */ +}; +OFP_ASSERT(sizeof(struct nx_action_note) == 16); - case OFPACT_SET_ETH_SRC: - case OFPACT_SET_ETH_DST: - return 0; +static enum ofperr +decode_NXAST_RAW_NOTE(const struct nx_action_note *nan, struct ofpbuf *out) +{ + struct ofpact_note *note; + unsigned int length; - case OFPACT_SET_IPV4_SRC: - case OFPACT_SET_IPV4_DST: - if (flow->dl_type != htons(ETH_TYPE_IP)) { - inconsistent_match(usable_protocols); - } - return 0; + length = ntohs(nan->len) - offsetof(struct nx_action_note, note); + note = ofpact_put(out, OFPACT_NOTE, + offsetof(struct ofpact_note, data) + length); + note->length = length; + memcpy(note->data, nan->note, length); - case OFPACT_SET_IP_DSCP: - case OFPACT_SET_IP_ECN: - case OFPACT_SET_IP_TTL: - case OFPACT_DEC_TTL: - if (!is_ip_any(flow)) { - inconsistent_match(usable_protocols); + return 0; +} + +static void +encode_NOTE(const struct ofpact_note *note, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + size_t start_ofs = out->size; + struct nx_action_note *nan; + unsigned int remainder; + unsigned int len; + + put_NXAST_NOTE(out); + out->size = out->size - sizeof nan->note; + + ofpbuf_put(out, note->data, note->length); + + len = out->size - start_ofs; + remainder = len % OFP_ACTION_ALIGN; + if (remainder) { + ofpbuf_put_zeros(out, OFP_ACTION_ALIGN - remainder); + } + nan = ofpbuf_at(out, start_ofs, sizeof *nan); + nan->len = htons(out->size - start_ofs); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_NOTE(const char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_note *note; + + note = ofpact_put_NOTE(ofpacts); + while (*arg != '\0') { + uint8_t byte; + bool ok; + + if (*arg == '.') { + arg++; + } + if (*arg == '\0') { + break; } - return 0; - case OFPACT_SET_L4_SRC_PORT: - if (!is_ip_any(flow) || - (flow->nw_proto != IPPROTO_TCP && flow->nw_proto != IPPROTO_UDP - && flow->nw_proto != IPPROTO_SCTP)) { - inconsistent_match(usable_protocols); + byte = hexits_value(arg, 2, &ok); + if (!ok) { + return xstrdup("bad hex digit in `note' argument"); } - /* Note on which transport protocol the port numbers are set. - * This allows this set action to be converted to an OF1.2 set field - * action. */ - ofpact_get_SET_L4_SRC_PORT(a)->flow_ip_proto = flow->nw_proto; - return 0; + ofpbuf_put(ofpacts, &byte, 1); - case OFPACT_SET_L4_DST_PORT: - if (!is_ip_any(flow) || - (flow->nw_proto != IPPROTO_TCP && flow->nw_proto != IPPROTO_UDP - && flow->nw_proto != IPPROTO_SCTP)) { - inconsistent_match(usable_protocols); + note = ofpacts->header; + note->length++; + + arg += 2; + } + ofpact_update_len(ofpacts, ¬e->ofpact); + return NULL; +} + +static void +format_NOTE(const struct ofpact_note *a, struct ds *s) +{ + size_t i; + + ds_put_cstr(s, "note:"); + for (i = 0; i < a->length; i++) { + if (i) { + ds_put_char(s, '.'); } - /* Note on which transport protocol the port numbers are set. - * This allows this set action to be converted to an OF1.2 set field - * action. */ - ofpact_get_SET_L4_DST_PORT(a)->flow_ip_proto = flow->nw_proto; - return 0; + ds_put_format(s, "%02"PRIx8, a->data[i]); + } +} + +/* Exit action. */ - case OFPACT_REG_MOVE: - return nxm_reg_move_check(ofpact_get_REG_MOVE(a), flow); +static enum ofperr +decode_NXAST_RAW_EXIT(struct ofpbuf *out) +{ + ofpact_put_EXIT(out); + return 0; +} - case OFPACT_REG_LOAD: - return nxm_reg_load_check(ofpact_get_REG_LOAD(a), flow); +static void +encode_EXIT(const struct ofpact_null *null OVS_UNUSED, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + put_NXAST_EXIT(out); +} - case OFPACT_SET_FIELD: - mf = ofpact_get_SET_FIELD(a)->field; - /* Require OXM_OF_VLAN_VID to have an existing VLAN header. */ - if (!mf_are_prereqs_ok(mf, flow) || - (mf->id == MFF_VLAN_VID && !(flow->vlan_tci & htons(VLAN_CFI)))) { - VLOG_WARN_RL(&rl, "set_field %s lacks correct prerequisities", - mf->name); - return OFPERR_OFPBAC_MATCH_INCONSISTENT; +static char * OVS_WARN_UNUSED_RESULT +parse_EXIT(char *arg OVS_UNUSED, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + ofpact_put_EXIT(ofpacts); + return NULL; +} + +static void +format_EXIT(const struct ofpact_null *a OVS_UNUSED, struct ds *s) +{ + ds_put_cstr(s, "exit"); +} + +/* Unroll xlate action. */ + +static void +encode_UNROLL_XLATE(const struct ofpact_unroll_xlate *unroll OVS_UNUSED, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out OVS_UNUSED) +{ + OVS_NOT_REACHED(); +} + +static char * OVS_WARN_UNUSED_RESULT +parse_UNROLL_XLATE(char *arg OVS_UNUSED, struct ofpbuf *ofpacts OVS_UNUSED, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + OVS_NOT_REACHED(); + return NULL; +} + +static void +format_UNROLL_XLATE(const struct ofpact_unroll_xlate *a OVS_UNUSED, + struct ds *s) +{ + ds_put_cstr(s, "unroll_xlate"); +} + +/* Action structure for NXAST_SAMPLE. + * + * Samples matching packets with the given probability and sends them + * each to the set of collectors identified with the given ID. The + * probability is expressed as a number of packets to be sampled out + * of USHRT_MAX packets, and must be >0. + * + * When sending packet samples to IPFIX collectors, the IPFIX flow + * record sent for each sampled packet is associated with the given + * observation domain ID and observation point ID. Each IPFIX flow + * record contain the sampled packet's headers when executing this + * rule. If a sampled packet's headers are modified by previous + * actions in the flow, those modified headers are sent. */ +struct nx_action_sample { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 24. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_SAMPLE. */ + ovs_be16 probability; /* Fraction of packets to sample. */ + ovs_be32 collector_set_id; /* ID of collector set in OVSDB. */ + ovs_be32 obs_domain_id; /* ID of sampling observation domain. */ + ovs_be32 obs_point_id; /* ID of sampling observation point. */ +}; +OFP_ASSERT(sizeof(struct nx_action_sample) == 24); + +static enum ofperr +decode_NXAST_RAW_SAMPLE(const struct nx_action_sample *nas, struct ofpbuf *out) +{ + struct ofpact_sample *sample; + + sample = ofpact_put_SAMPLE(out); + sample->probability = ntohs(nas->probability); + sample->collector_set_id = ntohl(nas->collector_set_id); + sample->obs_domain_id = ntohl(nas->obs_domain_id); + sample->obs_point_id = ntohl(nas->obs_point_id); + + if (sample->probability == 0) { + return OFPERR_OFPBAC_BAD_ARGUMENT; + } + + return 0; +} + +static void +encode_SAMPLE(const struct ofpact_sample *sample, + enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) +{ + struct nx_action_sample *nas; + + nas = put_NXAST_SAMPLE(out); + nas->probability = htons(sample->probability); + nas->collector_set_id = htonl(sample->collector_set_id); + nas->obs_domain_id = htonl(sample->obs_domain_id); + nas->obs_point_id = htonl(sample->obs_point_id); +} + +/* Parses 'arg' as the argument to a "sample" action, and appends such an + * action to 'ofpacts'. + * + * Returns NULL if successful, otherwise a malloc()'d string describing the + * error. The caller is responsible for freeing the returned string. */ +static char * OVS_WARN_UNUSED_RESULT +parse_SAMPLE(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_sample *os = ofpact_put_SAMPLE(ofpacts); + char *key, *value; + + while (ofputil_parse_key_value(&arg, &key, &value)) { + char *error = NULL; + + if (!strcmp(key, "probability")) { + error = str_to_u16(value, "probability", &os->probability); + if (!error && os->probability == 0) { + error = xasprintf("invalid probability value \"%s\"", value); + } + } else if (!strcmp(key, "collector_set_id")) { + error = str_to_u32(value, &os->collector_set_id); + } else if (!strcmp(key, "obs_domain_id")) { + error = str_to_u32(value, &os->obs_domain_id); + } else if (!strcmp(key, "obs_point_id")) { + error = str_to_u32(value, &os->obs_point_id); + } else { + error = xasprintf("invalid key \"%s\" in \"sample\" argument", + key); } - /* Remember if we saw a vlan tag in the flow to aid translating to - * OpenFlow 1.1 if need be. */ - ofpact_get_SET_FIELD(a)->flow_has_vlan = - (flow->vlan_tci & htons(VLAN_CFI)) == htons(VLAN_CFI); - if (mf->id == MFF_VLAN_TCI) { - /* The set field may add or remove the vlan tag, - * Mark the status temporarily. */ - flow->vlan_tci = ofpact_get_SET_FIELD(a)->value.be16; + if (error) { + return error; } - return 0; + } + if (os->probability == 0) { + return xstrdup("non-zero \"probability\" must be specified on sample"); + } + return NULL; +} - case OFPACT_STACK_PUSH: - return nxm_stack_push_check(ofpact_get_STACK_PUSH(a), flow); +static void +format_SAMPLE(const struct ofpact_sample *a, struct ds *s) +{ + ds_put_format(s, "sample(probability=%"PRIu16",collector_set_id=%"PRIu32 + ",obs_domain_id=%"PRIu32",obs_point_id=%"PRIu32")", + a->probability, a->collector_set_id, + a->obs_domain_id, a->obs_point_id); +} + +/* Meter instruction. */ - case OFPACT_STACK_POP: - return nxm_stack_pop_check(ofpact_get_STACK_POP(a), flow); +static void +encode_METER(const struct ofpact_meter *meter, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version >= OFP13_VERSION) { + instruction_put_OFPIT13_METER(out)->meter_id = htonl(meter->meter_id); + } +} - case OFPACT_SET_MPLS_LABEL: - case OFPACT_SET_MPLS_TC: - case OFPACT_SET_MPLS_TTL: - case OFPACT_DEC_MPLS_TTL: - if (!eth_type_mpls(flow->dl_type)) { - inconsistent_match(usable_protocols); - } - return 0; +static char * OVS_WARN_UNUSED_RESULT +parse_METER(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) +{ + *usable_protocols &= OFPUTIL_P_OF13_UP; + return str_to_u32(arg, &ofpact_put_METER(ofpacts)->meter_id); +} - case OFPACT_SET_TUNNEL: - case OFPACT_SET_QUEUE: - case OFPACT_POP_QUEUE: - case OFPACT_RESUBMIT: - return 0; +static void +format_METER(const struct ofpact_meter *a, struct ds *s) +{ + ds_put_format(s, "meter:%"PRIu32, a->meter_id); +} + +/* Clear-Actions instruction. */ - case OFPACT_FIN_TIMEOUT: - if (flow->nw_proto != IPPROTO_TCP) { - inconsistent_match(usable_protocols); - } - return 0; +static void +encode_CLEAR_ACTIONS(const struct ofpact_null *null OVS_UNUSED, + enum ofp_version ofp_version OVS_UNUSED, + struct ofpbuf *out OVS_UNUSED) +{ + if (ofp_version > OFP10_VERSION) { + instruction_put_OFPIT11_CLEAR_ACTIONS(out); + } +} + +static char * OVS_WARN_UNUSED_RESULT +parse_CLEAR_ACTIONS(char *arg OVS_UNUSED, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + ofpact_put_CLEAR_ACTIONS(ofpacts); + return NULL; +} + +static void +format_CLEAR_ACTIONS(const struct ofpact_null *a OVS_UNUSED, struct ds *s) +{ + ds_put_cstr(s, "clear_actions"); +} + +/* Write-Actions instruction. */ + +static void +encode_WRITE_ACTIONS(const struct ofpact_nest *actions, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version > OFP10_VERSION) { + const size_t ofs = out->size; + + instruction_put_OFPIT11_WRITE_ACTIONS(out); + ofpacts_put_openflow_actions(actions->actions, + ofpact_nest_get_action_len(actions), + out, ofp_version); + ofpacts_update_instruction_actions(out, ofs); + } +} + +static char * OVS_WARN_UNUSED_RESULT +parse_WRITE_ACTIONS(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) +{ + struct ofpact_nest *on; + char *error; + size_t ofs; + + /* Pull off existing actions or instructions. */ + ofpact_pad(ofpacts); + ofs = ofpacts->size; + ofpbuf_pull(ofpacts, ofs); + + /* Add a Write-Actions instruction and then pull it off. */ + ofpact_put(ofpacts, OFPACT_WRITE_ACTIONS, sizeof *on); + ofpbuf_pull(ofpacts, sizeof *on); + + /* Parse nested actions. + * + * We pulled off "write-actions" and the previous actions because the + * OFPACT_WRITE_ACTIONS is only partially constructed: its length is such + * that it doesn't actually include the nested actions. That means that + * ofpacts_parse() would reject them as being part of an Apply-Actions that + * follows a Write-Actions, which is an invalid order. */ + error = ofpacts_parse(arg, ofpacts, usable_protocols, false); + + /* Put the Write-Actions back on and update its length. */ + on = ofpbuf_push_uninit(ofpacts, sizeof *on); + on->ofpact.len = ofpacts->size; + + /* Put any previous actions or instructions back on. */ + ofpbuf_push_uninit(ofpacts, ofs); + + return error; +} + +static void +format_WRITE_ACTIONS(const struct ofpact_nest *a, struct ds *s) +{ + ds_put_cstr(s, "write_actions("); + ofpacts_format(a->actions, ofpact_nest_get_action_len(a), s); + ds_put_char(s, ')'); +} + +/* Action structure for NXAST_WRITE_METADATA. + * + * Modifies the 'mask' bits of the metadata value. */ +struct nx_action_write_metadata { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* Length is 32. */ + ovs_be32 vendor; /* NX_VENDOR_ID. */ + ovs_be16 subtype; /* NXAST_WRITE_METADATA. */ + uint8_t zeros[6]; /* Must be zero. */ + ovs_be64 metadata; /* Metadata register. */ + ovs_be64 mask; /* Metadata mask. */ +}; +OFP_ASSERT(sizeof(struct nx_action_write_metadata) == 32); + +static enum ofperr +decode_NXAST_RAW_WRITE_METADATA(const struct nx_action_write_metadata *nawm, + struct ofpbuf *out) +{ + struct ofpact_metadata *om; + + if (!is_all_zeros(nawm->zeros, sizeof nawm->zeros)) { + return OFPERR_NXBRC_MUST_BE_ZERO; + } + + om = ofpact_put_WRITE_METADATA(out); + om->metadata = nawm->metadata; + om->mask = nawm->mask; + + return 0; +} + +static void +encode_WRITE_METADATA(const struct ofpact_metadata *metadata, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version == OFP10_VERSION) { + struct nx_action_write_metadata *nawm; + + nawm = put_NXAST_WRITE_METADATA(out); + nawm->metadata = metadata->metadata; + nawm->mask = metadata->mask; + } else { + struct ofp11_instruction_write_metadata *oiwm; - case OFPACT_LEARN: - return learn_check(ofpact_get_LEARN(a), flow); + oiwm = instruction_put_OFPIT11_WRITE_METADATA(out); + oiwm->metadata = metadata->metadata; + oiwm->metadata_mask = metadata->mask; + } +} - case OFPACT_MULTIPATH: - return multipath_check(ofpact_get_MULTIPATH(a), flow); +static char * OVS_WARN_UNUSED_RESULT +parse_WRITE_METADATA(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) +{ + struct ofpact_metadata *om; + char *mask = strchr(arg, '/'); - case OFPACT_NOTE: - case OFPACT_EXIT: - return 0; + *usable_protocols &= OFPUTIL_P_NXM_OF11_UP; - case OFPACT_PUSH_MPLS: - flow->dl_type = ofpact_get_PUSH_MPLS(a)->ethertype; - /* The packet is now MPLS and the MPLS payload is opaque. - * Thus nothing can be assumed about the network protocol. - * Temporarily mark that we have no nw_proto. */ - flow->nw_proto = 0; - return 0; + om = ofpact_put_WRITE_METADATA(ofpacts); + if (mask) { + char *error; - case OFPACT_POP_MPLS: - if (!eth_type_mpls(flow->dl_type)) { - inconsistent_match(usable_protocols); + *mask = '\0'; + error = str_to_be64(mask + 1, &om->mask); + if (error) { + return error; } - flow->dl_type = ofpact_get_POP_MPLS(a)->ethertype; - return 0; - - case OFPACT_SAMPLE: - return 0; + } else { + om->mask = OVS_BE64_MAX; + } - case OFPACT_CLEAR_ACTIONS: - return 0; + return str_to_be64(arg, &om->metadata); +} - case OFPACT_WRITE_ACTIONS: { - /* Use a temporary copy of 'usable_protocols' because we can't check - * consistency of an action set. */ - struct ofpact_nest *on = ofpact_get_WRITE_ACTIONS(a); - enum ofputil_protocol p = *usable_protocols; - return ofpacts_check(on->actions, ofpact_nest_get_action_len(on), - flow, max_ports, table_id, n_tables, &p); +static void +format_WRITE_METADATA(const struct ofpact_metadata *a, struct ds *s) +{ + ds_put_format(s, "write_metadata:%#"PRIx64, ntohll(a->metadata)); + if (a->mask != OVS_BE64_MAX) { + ds_put_format(s, "/%#"PRIx64, ntohll(a->mask)); } +} + +/* Goto-Table instruction. */ - case OFPACT_WRITE_METADATA: - return 0; +static void +encode_GOTO_TABLE(const struct ofpact_goto_table *goto_table, + enum ofp_version ofp_version, struct ofpbuf *out) +{ + if (ofp_version == OFP10_VERSION) { + struct nx_action_resubmit *nar; - case OFPACT_METER: { - uint32_t mid = ofpact_get_METER(a)->meter_id; - if (mid == 0 || mid > OFPM13_MAX) { - return OFPERR_OFPMMFC_INVALID_METER; - } - return 0; + nar = put_NXAST_RESUBMIT_TABLE(out); + nar->table = goto_table->table_id; + nar->in_port = htons(ofp_to_u16(OFPP_IN_PORT)); + } else { + struct ofp11_instruction_goto_table *oigt; + + oigt = instruction_put_OFPIT11_GOTO_TABLE(out); + oigt->table_id = goto_table->table_id; + memset(oigt->pad, 0, sizeof oigt->pad); } +} - case OFPACT_GOTO_TABLE: { - uint8_t goto_table = ofpact_get_GOTO_TABLE(a)->table_id; - if ((table_id != 255 && goto_table <= table_id) - || (n_tables != 255 && goto_table >= n_tables)) { - return OFPERR_OFPBIC_BAD_TABLE_ID; - } - return 0; +static char * OVS_WARN_UNUSED_RESULT +parse_GOTO_TABLE(char *arg, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols OVS_UNUSED) +{ + struct ofpact_goto_table *ogt = ofpact_put_GOTO_TABLE(ofpacts); + char *table_s = strsep(&arg, ","); + if (!table_s || !table_s[0]) { + return xstrdup("instruction goto-table needs table id"); } + return str_to_u8(table_s, "table", &ogt->table_id); +} - case OFPACT_GROUP: - return 0; +static void +format_GOTO_TABLE(const struct ofpact_goto_table *a, struct ds *s) +{ + ds_put_format(s, "goto_table:%"PRIu8, a->table_id); +} + +static void +log_bad_action(const struct ofp_action_header *actions, size_t actions_len, + const struct ofp_action_header *bad_action, enum ofperr error) +{ + if (!VLOG_DROP_WARN(&rl)) { + struct ds s; - default: - OVS_NOT_REACHED(); + ds_init(&s); + ds_put_hex_dump(&s, actions, actions_len, 0, false); + VLOG_WARN("bad action at offset %#"PRIxPTR" (%s):\n%s", + (char *)bad_action - (char *)actions, + ofperr_get_name(error), ds_cstr(&s)); + ds_destroy(&s); } } -/* Checks that the 'ofpacts_len' bytes of actions in 'ofpacts' are - * appropriate for a packet with the prerequisites satisfied by 'flow' in a - * switch with no more than 'max_ports' ports. - * - * If 'ofpacts' and 'flow' are inconsistent with one another, un-sets in - * '*usable_protocols' the protocols that forbid the inconsistency. (An - * example of an inconsistency between match and actions is a flow that does - * not match on an MPLS Ethertype but has an action that pops an MPLS label.) - * - * May annotate ofpacts with information gathered from the 'flow'. - * - * May temporarily modify 'flow', but restores the changes before returning. */ -enum ofperr -ofpacts_check(struct ofpact ofpacts[], size_t ofpacts_len, - struct flow *flow, ofp_port_t max_ports, - uint8_t table_id, uint8_t n_tables, - enum ofputil_protocol *usable_protocols) +static enum ofperr +ofpacts_decode(const void *actions, size_t actions_len, + enum ofp_version ofp_version, struct ofpbuf *ofpacts) { - struct ofpact *a; - ovs_be16 dl_type = flow->dl_type; - ovs_be16 vlan_tci = flow->vlan_tci; - uint8_t nw_proto = flow->nw_proto; - enum ofperr error = 0; + struct ofpbuf openflow; + + ofpbuf_use_const(&openflow, actions, actions_len); + while (openflow.size) { + const struct ofp_action_header *action = openflow.data; + enum ofp_raw_action_type raw; + enum ofperr error; + uint64_t arg; + + error = ofpact_pull_raw(&openflow, ofp_version, &raw, &arg); + if (!error) { + error = ofpact_decode(action, raw, arg, ofpacts); + } - OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { - error = ofpact_check__(usable_protocols, a, flow, - max_ports, table_id, n_tables); if (error) { - break; + log_bad_action(actions, actions_len, action, error); + return error; } } - /* Restore fields that may have been modified. */ - flow->dl_type = dl_type; - flow->vlan_tci = vlan_tci; - flow->nw_proto = nw_proto; - return error; + + ofpact_pad(ofpacts); + return 0; } -/* Like ofpacts_check(), but reports inconsistencies as - * OFPERR_OFPBAC_MATCH_INCONSISTENT rather than clearing bits. */ -enum ofperr -ofpacts_check_consistency(struct ofpact ofpacts[], size_t ofpacts_len, - struct flow *flow, ofp_port_t max_ports, - uint8_t table_id, uint8_t n_tables, - enum ofputil_protocol usable_protocols) +static enum ofperr +ofpacts_pull_openflow_actions__(struct ofpbuf *openflow, + unsigned int actions_len, + enum ofp_version version, + uint32_t allowed_ovsinsts, + struct ofpbuf *ofpacts) { - enum ofputil_protocol p = usable_protocols; + const struct ofp_action_header *actions; enum ofperr error; - error = ofpacts_check(ofpacts, ofpacts_len, flow, max_ports, - table_id, n_tables, &p); - return (error ? error - : p != usable_protocols ? OFPERR_OFPBAC_MATCH_INCONSISTENT - : 0); + ofpbuf_clear(ofpacts); + + if (actions_len % OFP_ACTION_ALIGN != 0) { + VLOG_WARN_RL(&rl, "OpenFlow message actions length %u is not a " + "multiple of %d", actions_len, OFP_ACTION_ALIGN); + return OFPERR_OFPBRC_BAD_LEN; + } + + actions = ofpbuf_try_pull(openflow, actions_len); + if (actions == NULL) { + VLOG_WARN_RL(&rl, "OpenFlow message actions length %u exceeds " + "remaining message length (%"PRIu32")", + actions_len, openflow->size); + return OFPERR_OFPBRC_BAD_LEN; + } + + error = ofpacts_decode(actions, actions_len, version, ofpacts); + if (error) { + ofpbuf_clear(ofpacts); + return error; + } + + error = ofpacts_verify(ofpacts->data, ofpacts->size, + allowed_ovsinsts); + if (error) { + ofpbuf_clear(ofpacts); + } + return error; } -/* Verifies that the 'ofpacts_len' bytes of actions in 'ofpacts' are - * in the appropriate order as defined by the OpenFlow spec. */ +/* Attempts to convert 'actions_len' bytes of OpenFlow actions from the + * front of 'openflow' into ofpacts. On success, replaces any existing content + * in 'ofpacts' by the converted ofpacts; on failure, clears 'ofpacts'. + * Returns 0 if successful, otherwise an OpenFlow error. + * + * Actions are processed according to their OpenFlow version which + * is provided in the 'version' parameter. + * + * In most places in OpenFlow, actions appear encapsulated in instructions, so + * you should call ofpacts_pull_openflow_instructions() instead of this + * function. + * + * The parsed actions are valid generically, but they may not be valid in a + * specific context. For example, port numbers up to OFPP_MAX are valid + * generically, but specific datapaths may only support port numbers in a + * smaller range. Use ofpacts_check() to additional check whether actions are + * valid in a specific context. */ enum ofperr -ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len) +ofpacts_pull_openflow_actions(struct ofpbuf *openflow, + unsigned int actions_len, + enum ofp_version version, + struct ofpbuf *ofpacts) { - const struct ofpact *a; - enum ovs_instruction_type inst; - - inst = OVSINST_OFPIT13_METER; - OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { - enum ovs_instruction_type next; - - next = ovs_instruction_type_from_ofpact_type(a->type); - if (a > ofpacts - && (inst == OVSINST_OFPIT11_APPLY_ACTIONS - ? next < inst - : next <= inst)) { - const char *name = ovs_instruction_name_from_type(inst); - const char *next_name = ovs_instruction_name_from_type(next); + return ofpacts_pull_openflow_actions__(openflow, actions_len, version, + 1u << OVSINST_OFPIT11_APPLY_ACTIONS, + ofpacts); +} + +/* OpenFlow 1.1 actions. */ - if (next == inst) { - VLOG_WARN("duplicate %s instruction not allowed, for OpenFlow " - "1.1+ compatibility", name); - } else { - VLOG_WARN("invalid instruction ordering: %s must appear " - "before %s, for OpenFlow 1.1+ compatibility", - next_name, name); - } - return OFPERR_OFPBAC_UNSUPPORTED_ORDER; - } - inst = next; +/* True if an action sets the value of a field + * in a way that is compatibile with the action set. + * The field can be set via either a set or a move action. + * False otherwise. */ +static bool +ofpact_is_set_or_move_action(const struct ofpact *a) +{ + switch (a->type) { + case OFPACT_SET_FIELD: + case OFPACT_REG_MOVE: + case OFPACT_SET_ETH_DST: + case OFPACT_SET_ETH_SRC: + case OFPACT_SET_IP_DSCP: + case OFPACT_SET_IP_ECN: + case OFPACT_SET_IP_TTL: + case OFPACT_SET_IPV4_DST: + case OFPACT_SET_IPV4_SRC: + case OFPACT_SET_L4_DST_PORT: + case OFPACT_SET_L4_SRC_PORT: + case OFPACT_SET_MPLS_LABEL: + case OFPACT_SET_MPLS_TC: + case OFPACT_SET_MPLS_TTL: + case OFPACT_SET_QUEUE: + case OFPACT_SET_TUNNEL: + case OFPACT_SET_VLAN_PCP: + case OFPACT_SET_VLAN_VID: + return true; + case OFPACT_BUNDLE: + case OFPACT_CLEAR_ACTIONS: + case OFPACT_CONTROLLER: + case OFPACT_DEC_MPLS_TTL: + case OFPACT_DEC_TTL: + case OFPACT_ENQUEUE: + case OFPACT_EXIT: + case OFPACT_UNROLL_XLATE: + case OFPACT_FIN_TIMEOUT: + case OFPACT_GOTO_TABLE: + case OFPACT_GROUP: + case OFPACT_LEARN: + case OFPACT_CONJUNCTION: + case OFPACT_METER: + case OFPACT_MULTIPATH: + case OFPACT_NOTE: + case OFPACT_OUTPUT: + case OFPACT_OUTPUT_REG: + case OFPACT_POP_MPLS: + case OFPACT_POP_QUEUE: + case OFPACT_PUSH_MPLS: + case OFPACT_PUSH_VLAN: + case OFPACT_RESUBMIT: + case OFPACT_SAMPLE: + case OFPACT_STACK_POP: + case OFPACT_STACK_PUSH: + case OFPACT_STRIP_VLAN: + case OFPACT_WRITE_ACTIONS: + case OFPACT_WRITE_METADATA: + return false; + default: + OVS_NOT_REACHED(); } - - return 0; -} - -/* Converting ofpacts to Nicira OpenFlow extensions. */ - -static void -ofpact_output_reg_to_nxast(const struct ofpact_output_reg *output_reg, - struct ofpbuf *out) -{ - struct nx_action_output_reg *naor = ofputil_put_NXAST_OUTPUT_REG(out); - - naor->ofs_nbits = nxm_encode_ofs_nbits(output_reg->src.ofs, - output_reg->src.n_bits); - naor->src = htonl(output_reg->src.field->nxm_header); - naor->max_len = htons(output_reg->max_len); } -static void -ofpact_resubmit_to_nxast(const struct ofpact_resubmit *resubmit, - struct ofpbuf *out) +/* True if an action is allowed in the action set. + * False otherwise. */ +static bool +ofpact_is_allowed_in_actions_set(const struct ofpact *a) { - struct nx_action_resubmit *nar; - - if (resubmit->table_id == 0xff - && resubmit->ofpact.compat != OFPUTIL_NXAST_RESUBMIT_TABLE) { - nar = ofputil_put_NXAST_RESUBMIT(out); - } else { - nar = ofputil_put_NXAST_RESUBMIT_TABLE(out); - nar->table = resubmit->table_id; - } - nar->in_port = htons(ofp_to_u16(resubmit->in_port)); -} + switch (a->type) { + case OFPACT_DEC_MPLS_TTL: + case OFPACT_DEC_TTL: + case OFPACT_GROUP: + case OFPACT_OUTPUT: + case OFPACT_POP_MPLS: + case OFPACT_PUSH_MPLS: + case OFPACT_PUSH_VLAN: + case OFPACT_REG_MOVE: + case OFPACT_SET_FIELD: + case OFPACT_SET_ETH_DST: + case OFPACT_SET_ETH_SRC: + case OFPACT_SET_IP_DSCP: + case OFPACT_SET_IP_ECN: + case OFPACT_SET_IP_TTL: + case OFPACT_SET_IPV4_DST: + case OFPACT_SET_IPV4_SRC: + case OFPACT_SET_L4_DST_PORT: + case OFPACT_SET_L4_SRC_PORT: + case OFPACT_SET_MPLS_LABEL: + case OFPACT_SET_MPLS_TC: + case OFPACT_SET_MPLS_TTL: + case OFPACT_SET_QUEUE: + case OFPACT_SET_TUNNEL: + case OFPACT_SET_VLAN_PCP: + case OFPACT_SET_VLAN_VID: + case OFPACT_STRIP_VLAN: + return true; -static void -ofpact_set_tunnel_to_nxast(const struct ofpact_tunnel *tunnel, - struct ofpbuf *out) -{ - uint64_t tun_id = tunnel->tun_id; + /* In general these actions are excluded because they are not part of + * the OpenFlow specification nor map to actions that are defined in + * the specification. Thus the order in which they should be applied + * in the action set is undefined. */ + case OFPACT_BUNDLE: + case OFPACT_CONTROLLER: + case OFPACT_ENQUEUE: + case OFPACT_EXIT: + case OFPACT_UNROLL_XLATE: + case OFPACT_FIN_TIMEOUT: + case OFPACT_LEARN: + case OFPACT_CONJUNCTION: + case OFPACT_MULTIPATH: + case OFPACT_NOTE: + case OFPACT_OUTPUT_REG: + case OFPACT_POP_QUEUE: + case OFPACT_RESUBMIT: + case OFPACT_SAMPLE: + case OFPACT_STACK_POP: + case OFPACT_STACK_PUSH: - if (tun_id <= UINT32_MAX - && tunnel->ofpact.compat != OFPUTIL_NXAST_SET_TUNNEL64) { - ofputil_put_NXAST_SET_TUNNEL(out)->tun_id = htonl(tun_id); - } else { - ofputil_put_NXAST_SET_TUNNEL64(out)->tun_id = htonll(tun_id); + /* The action set may only include actions and thus + * may not include any instructions */ + case OFPACT_CLEAR_ACTIONS: + case OFPACT_GOTO_TABLE: + case OFPACT_METER: + case OFPACT_WRITE_ACTIONS: + case OFPACT_WRITE_METADATA: + return false; + default: + OVS_NOT_REACHED(); } } +/* Append ofpact 'a' onto the tail of 'out' */ static void -ofpact_write_metadata_to_nxast(const struct ofpact_metadata *om, - struct ofpbuf *out) +ofpact_copy(struct ofpbuf *out, const struct ofpact *a) { - struct nx_action_write_metadata *nawm; - - nawm = ofputil_put_NXAST_WRITE_METADATA(out); - nawm->metadata = om->metadata; - nawm->mask = om->mask; + ofpbuf_put(out, a, OFPACT_ALIGN(a->len)); } -static void -ofpact_note_to_nxast(const struct ofpact_note *note, struct ofpbuf *out) +/* Copies the last ofpact whose type is 'filter' from 'in' to 'out'. */ +static bool +ofpacts_copy_last(struct ofpbuf *out, const struct ofpbuf *in, + enum ofpact_type filter) { - size_t start_ofs = ofpbuf_size(out); - struct nx_action_note *nan; - unsigned int remainder; - unsigned int len; - - nan = ofputil_put_NXAST_NOTE(out); - ofpbuf_set_size(out, ofpbuf_size(out) - sizeof nan->note); - - ofpbuf_put(out, note->data, note->length); + const struct ofpact *target; + const struct ofpact *a; - len = ofpbuf_size(out) - start_ofs; - remainder = len % OFP_ACTION_ALIGN; - if (remainder) { - ofpbuf_put_zeros(out, OFP_ACTION_ALIGN - remainder); + target = NULL; + OFPACT_FOR_EACH (a, in->data, in->size) { + if (a->type == filter) { + target = a; + } } - nan = ofpbuf_at(out, start_ofs, sizeof *nan); - nan->len = htons(ofpbuf_size(out) - start_ofs); -} - -static void -ofpact_controller_to_nxast(const struct ofpact_controller *oc, - struct ofpbuf *out) -{ - struct nx_action_controller *nac; - - nac = ofputil_put_NXAST_CONTROLLER(out); - nac->max_len = htons(oc->max_len); - nac->controller_id = htons(oc->controller_id); - nac->reason = oc->reason; + if (target) { + ofpact_copy(out, target); + } + return target != NULL; } +/* Append all ofpacts, for which 'filter' returns true, from 'in' to 'out'. + * The order of appended ofpacts is preserved between 'in' and 'out' */ static void -ofpact_dec_ttl_to_nxast(const struct ofpact_cnt_ids *oc_ids, - struct ofpbuf *out) +ofpacts_copy_all(struct ofpbuf *out, const struct ofpbuf *in, + bool (*filter)(const struct ofpact *)) { - if (oc_ids->ofpact.compat == OFPUTIL_NXAST_DEC_TTL) { - ofputil_put_NXAST_DEC_TTL(out); - } else { - struct nx_action_cnt_ids *nac_ids = - ofputil_put_NXAST_DEC_TTL_CNT_IDS(out); - int ids_len = ROUND_UP(2 * oc_ids->n_controllers, OFP_ACTION_ALIGN); - ovs_be16 *ids; - size_t i; - - nac_ids->len = htons(ntohs(nac_ids->len) + ids_len); - nac_ids->n_controllers = htons(oc_ids->n_controllers); + const struct ofpact *a; - ids = ofpbuf_put_zeros(out, ids_len); - for (i = 0; i < oc_ids->n_controllers; i++) { - ids[i] = htons(oc_ids->cnt_ids[i]); + OFPACT_FOR_EACH (a, in->data, in->size) { + if (filter(a)) { + ofpact_copy(out, a); } } } -static void -ofpact_fin_timeout_to_nxast(const struct ofpact_fin_timeout *fin_timeout, - struct ofpbuf *out) -{ - struct nx_action_fin_timeout *naft = ofputil_put_NXAST_FIN_TIMEOUT(out); - naft->fin_idle_timeout = htons(fin_timeout->fin_idle_timeout); - naft->fin_hard_timeout = htons(fin_timeout->fin_hard_timeout); -} - -static void -ofpact_sample_to_nxast(const struct ofpact_sample *os, - struct ofpbuf *out) +/* Reads 'action_set', which contains ofpacts accumulated by + * OFPACT_WRITE_ACTIONS instructions, and writes equivalent actions to be + * executed directly into 'action_list'. (These names correspond to the + * "Action Set" and "Action List" terms used in OpenFlow 1.1+.) + * + * In general this involves appending the last instance of each action that is + * admissible in the action set in the order described in the OpenFlow + * specification. + * + * Exceptions: + * + output action is only appended if no group action was present in 'in'. + * + As a simplification all set actions are copied in the order the are + * provided in 'in' as many set actions applied to a field has the same + * affect as only applying the last action that sets a field and + * duplicates are removed by do_xlate_actions(). + * This has an unwanted side-effect of compsoting multiple + * LOAD_REG actions that touch different regions of the same field. */ +void +ofpacts_execute_action_set(struct ofpbuf *action_list, + const struct ofpbuf *action_set) { - struct nx_action_sample *nas; + /* The OpenFlow spec "Action Set" section specifies this order. */ + ofpacts_copy_last(action_list, action_set, OFPACT_STRIP_VLAN); + ofpacts_copy_last(action_list, action_set, OFPACT_POP_MPLS); + ofpacts_copy_last(action_list, action_set, OFPACT_PUSH_MPLS); + ofpacts_copy_last(action_list, action_set, OFPACT_PUSH_VLAN); + ofpacts_copy_last(action_list, action_set, OFPACT_DEC_TTL); + ofpacts_copy_last(action_list, action_set, OFPACT_DEC_MPLS_TTL); + ofpacts_copy_all(action_list, action_set, ofpact_is_set_or_move_action); + ofpacts_copy_last(action_list, action_set, OFPACT_SET_QUEUE); - nas = ofputil_put_NXAST_SAMPLE(out); - nas->probability = htons(os->probability); - nas->collector_set_id = htonl(os->collector_set_id); - nas->obs_domain_id = htonl(os->obs_domain_id); - nas->obs_point_id = htonl(os->obs_point_id); + /* If both OFPACT_GROUP and OFPACT_OUTPUT are present, OpenFlow says that + * we should execute only OFPACT_GROUP. + * + * If neither OFPACT_GROUP nor OFPACT_OUTPUT is present, then we can drop + * all the actions because there's no point in modifying a packet that will + * not be sent anywhere. */ + if (!ofpacts_copy_last(action_list, action_set, OFPACT_GROUP) && + !ofpacts_copy_last(action_list, action_set, OFPACT_OUTPUT) && + !ofpacts_copy_last(action_list, action_set, OFPACT_RESUBMIT)) { + ofpbuf_clear(action_list); + } } -static void -ofpact_to_nxast(const struct ofpact *a, struct ofpbuf *out) -{ - switch (a->type) { - case OFPACT_CONTROLLER: - ofpact_controller_to_nxast(ofpact_get_CONTROLLER(a), out); - break; - - case OFPACT_OUTPUT_REG: - ofpact_output_reg_to_nxast(ofpact_get_OUTPUT_REG(a), out); - break; - - case OFPACT_BUNDLE: - bundle_to_nxast(ofpact_get_BUNDLE(a), out); - break; - - case OFPACT_REG_MOVE: - nxm_reg_move_to_nxast(ofpact_get_REG_MOVE(a), out); - break; - - case OFPACT_REG_LOAD: - nxm_reg_load_to_nxast(ofpact_get_REG_LOAD(a), out); - break; - - case OFPACT_STACK_PUSH: - nxm_stack_push_to_nxast(ofpact_get_STACK_PUSH(a), out); - break; - - case OFPACT_STACK_POP: - nxm_stack_pop_to_nxast(ofpact_get_STACK_POP(a), out); - break; - - case OFPACT_DEC_TTL: - ofpact_dec_ttl_to_nxast(ofpact_get_DEC_TTL(a), out); - break; - - case OFPACT_SET_MPLS_LABEL: - ofputil_put_NXAST_SET_MPLS_LABEL(out)->label - = ofpact_get_SET_MPLS_LABEL(a)->label; - break; - - case OFPACT_SET_MPLS_TC: - ofputil_put_NXAST_SET_MPLS_TC(out)->tc - = ofpact_get_SET_MPLS_TC(a)->tc; - break; - - case OFPACT_SET_MPLS_TTL: - ofputil_put_NXAST_SET_MPLS_TTL(out)->ttl - = ofpact_get_SET_MPLS_TTL(a)->ttl; - break; - - case OFPACT_DEC_MPLS_TTL: - ofputil_put_NXAST_DEC_MPLS_TTL(out); - break; - - case OFPACT_SET_TUNNEL: - ofpact_set_tunnel_to_nxast(ofpact_get_SET_TUNNEL(a), out); - break; - - case OFPACT_WRITE_METADATA: - ofpact_write_metadata_to_nxast(ofpact_get_WRITE_METADATA(a), out); - break; - - case OFPACT_SET_QUEUE: - ofputil_put_NXAST_SET_QUEUE(out)->queue_id - = htonl(ofpact_get_SET_QUEUE(a)->queue_id); - break; - - case OFPACT_POP_QUEUE: - ofputil_put_NXAST_POP_QUEUE(out); - break; - case OFPACT_FIN_TIMEOUT: - ofpact_fin_timeout_to_nxast(ofpact_get_FIN_TIMEOUT(a), out); - break; +static enum ofperr +ofpacts_decode_for_action_set(const struct ofp_action_header *in, + size_t n_in, enum ofp_version version, + struct ofpbuf *out) +{ + enum ofperr error; + struct ofpact *a; + size_t start = out->size; - case OFPACT_RESUBMIT: - ofpact_resubmit_to_nxast(ofpact_get_RESUBMIT(a), out); - break; + error = ofpacts_decode(in, n_in, version, out); - case OFPACT_LEARN: - learn_to_nxast(ofpact_get_LEARN(a), out); - break; + if (error) { + return error; + } - case OFPACT_MULTIPATH: - multipath_to_nxast(ofpact_get_MULTIPATH(a), out); - break; + OFPACT_FOR_EACH (a, ofpact_end(out->data, start), out->size - start) { + if (!ofpact_is_allowed_in_actions_set(a)) { + VLOG_WARN_RL(&rl, "disallowed action in action set"); + return OFPERR_OFPBAC_BAD_TYPE; + } + } - case OFPACT_NOTE: - ofpact_note_to_nxast(ofpact_get_NOTE(a), out); - break; + return 0; +} + +/* OpenFlow 1.1 instructions. */ - case OFPACT_EXIT: - ofputil_put_NXAST_EXIT(out); - break; +struct instruction_type_info { + enum ovs_instruction_type type; + const char *name; +}; - case OFPACT_PUSH_MPLS: - ofputil_put_NXAST_PUSH_MPLS(out)->ethertype = - ofpact_get_PUSH_MPLS(a)->ethertype; - break; +static const struct instruction_type_info inst_info[] = { +#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) {OVSINST_##ENUM, NAME}, +OVS_INSTRUCTIONS +#undef DEFINE_INST +}; - case OFPACT_POP_MPLS: - ofputil_put_NXAST_POP_MPLS(out)->ethertype = - ofpact_get_POP_MPLS(a)->ethertype; - break; +const char * +ovs_instruction_name_from_type(enum ovs_instruction_type type) +{ + return inst_info[type].name; +} - case OFPACT_SAMPLE: - ofpact_sample_to_nxast(ofpact_get_SAMPLE(a), out); - break; +int +ovs_instruction_type_from_name(const char *name) +{ + const struct instruction_type_info *p; + for (p = inst_info; p < &inst_info[ARRAY_SIZE(inst_info)]; p++) { + if (!strcasecmp(name, p->name)) { + return p->type; + } + } + return -1; +} - case OFPACT_GROUP: +enum ovs_instruction_type +ovs_instruction_type_from_ofpact_type(enum ofpact_type type) +{ + switch (type) { + case OFPACT_METER: + return OVSINST_OFPIT13_METER; + case OFPACT_CLEAR_ACTIONS: + return OVSINST_OFPIT11_CLEAR_ACTIONS; + case OFPACT_WRITE_ACTIONS: + return OVSINST_OFPIT11_WRITE_ACTIONS; + case OFPACT_WRITE_METADATA: + return OVSINST_OFPIT11_WRITE_METADATA; + case OFPACT_GOTO_TABLE: + return OVSINST_OFPIT11_GOTO_TABLE; case OFPACT_OUTPUT: + case OFPACT_GROUP: + case OFPACT_CONTROLLER: case OFPACT_ENQUEUE: + case OFPACT_OUTPUT_REG: + case OFPACT_BUNDLE: case OFPACT_SET_VLAN_VID: case OFPACT_SET_VLAN_PCP: case OFPACT_STRIP_VLAN: @@ -2491,486 +5040,760 @@ case OFPACT_SET_IP_TTL: case OFPACT_SET_L4_SRC_PORT: case OFPACT_SET_L4_DST_PORT: - case OFPACT_WRITE_ACTIONS: - case OFPACT_CLEAR_ACTIONS: - case OFPACT_GOTO_TABLE: - case OFPACT_METER: + case OFPACT_REG_MOVE: case OFPACT_SET_FIELD: - OVS_NOT_REACHED(); + case OFPACT_STACK_PUSH: + case OFPACT_STACK_POP: + case OFPACT_DEC_TTL: + case OFPACT_SET_MPLS_LABEL: + case OFPACT_SET_MPLS_TC: + case OFPACT_SET_MPLS_TTL: + case OFPACT_DEC_MPLS_TTL: + case OFPACT_PUSH_MPLS: + case OFPACT_POP_MPLS: + case OFPACT_SET_TUNNEL: + case OFPACT_SET_QUEUE: + case OFPACT_POP_QUEUE: + case OFPACT_FIN_TIMEOUT: + case OFPACT_RESUBMIT: + case OFPACT_LEARN: + case OFPACT_CONJUNCTION: + case OFPACT_MULTIPATH: + case OFPACT_NOTE: + case OFPACT_EXIT: + case OFPACT_UNROLL_XLATE: + case OFPACT_SAMPLE: + default: + return OVSINST_OFPIT11_APPLY_ACTIONS; } } - -/* Converting ofpacts to OpenFlow 1.0. */ -static void -ofpact_output_to_openflow10(const struct ofpact_output *output, - struct ofpbuf *out) +enum ofperr +ovs_instruction_type_from_inst_type(enum ovs_instruction_type *instruction_type, + const uint16_t inst_type) { - struct ofp10_action_output *oao; + switch (inst_type) { + +#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) \ + case ENUM: \ + *instruction_type = OVSINST_##ENUM; \ + return 0; +OVS_INSTRUCTIONS +#undef DEFINE_INST - oao = ofputil_put_OFPAT10_OUTPUT(out); - oao->port = htons(ofp_to_u16(output->port)); - oao->max_len = htons(output->max_len); + default: + return OFPERR_OFPBIC_UNKNOWN_INST; + } } -static void -ofpact_enqueue_to_openflow10(const struct ofpact_enqueue *enqueue, - struct ofpbuf *out) +/* Two-way translation between OVS's internal "OVSINST_*" representation of + * instructions and the "OFPIT_*" representation used in OpenFlow. */ +struct ovsinst_map { + enum ovs_instruction_type ovsinst; /* Internal name for instruction. */ + int ofpit; /* OFPIT_* number from OpenFlow spec. */ +}; + +static const struct ovsinst_map * +get_ovsinst_map(enum ofp_version version) +{ + /* OpenFlow 1.1 and 1.2 instructions. */ + static const struct ovsinst_map of11[] = { + { OVSINST_OFPIT11_GOTO_TABLE, 1 }, + { OVSINST_OFPIT11_WRITE_METADATA, 2 }, + { OVSINST_OFPIT11_WRITE_ACTIONS, 3 }, + { OVSINST_OFPIT11_APPLY_ACTIONS, 4 }, + { OVSINST_OFPIT11_CLEAR_ACTIONS, 5 }, + { 0, -1 }, + }; + + /* OpenFlow 1.3+ instructions. */ + static const struct ovsinst_map of13[] = { + { OVSINST_OFPIT11_GOTO_TABLE, 1 }, + { OVSINST_OFPIT11_WRITE_METADATA, 2 }, + { OVSINST_OFPIT11_WRITE_ACTIONS, 3 }, + { OVSINST_OFPIT11_APPLY_ACTIONS, 4 }, + { OVSINST_OFPIT11_CLEAR_ACTIONS, 5 }, + { OVSINST_OFPIT13_METER, 6 }, + { 0, -1 }, + }; + + return version < OFP13_VERSION ? of11 : of13; +} + +/* Converts 'ovsinst_bitmap', a bitmap whose bits correspond to OVSINST_* + * values, into a bitmap of instructions suitable for OpenFlow 'version' + * (OFP11_VERSION or later), and returns the result. */ +ovs_be32 +ovsinst_bitmap_to_openflow(uint32_t ovsinst_bitmap, enum ofp_version version) +{ + uint32_t ofpit_bitmap = 0; + const struct ovsinst_map *x; + + for (x = get_ovsinst_map(version); x->ofpit >= 0; x++) { + if (ovsinst_bitmap & (1u << x->ovsinst)) { + ofpit_bitmap |= 1u << x->ofpit; + } + } + return htonl(ofpit_bitmap); +} + +/* Converts 'ofpit_bitmap', a bitmap of instructions from an OpenFlow message + * with the given 'version' (OFP11_VERSION or later) into a bitmap whose bits + * correspond to OVSINST_* values, and returns the result. */ +uint32_t +ovsinst_bitmap_from_openflow(ovs_be32 ofpit_bitmap, enum ofp_version version) { - struct ofp10_action_enqueue *oae; + uint32_t ovsinst_bitmap = 0; + const struct ovsinst_map *x; - oae = ofputil_put_OFPAT10_ENQUEUE(out); - oae->port = htons(ofp_to_u16(enqueue->port)); - oae->queue_id = htonl(enqueue->queue); + for (x = get_ovsinst_map(version); x->ofpit >= 0; x++) { + if (ofpit_bitmap & htonl(1u << x->ofpit)) { + ovsinst_bitmap |= 1u << x->ovsinst; + } + } + return ovsinst_bitmap; } -static void -ofpact_to_openflow10(const struct ofpact *a, struct ofpbuf *out) +static inline struct ofp11_instruction * +instruction_next(const struct ofp11_instruction *inst) { - switch (a->type) { - case OFPACT_OUTPUT: - ofpact_output_to_openflow10(ofpact_get_OUTPUT(a), out); - break; + return ((struct ofp11_instruction *) (void *) + ((uint8_t *) inst + ntohs(inst->len))); +} - case OFPACT_ENQUEUE: - ofpact_enqueue_to_openflow10(ofpact_get_ENQUEUE(a), out); - break; +static inline bool +instruction_is_valid(const struct ofp11_instruction *inst, + size_t n_instructions) +{ + uint16_t len = ntohs(inst->len); + return (!(len % OFP11_INSTRUCTION_ALIGN) + && len >= sizeof *inst + && len / sizeof *inst <= n_instructions); +} - case OFPACT_SET_VLAN_VID: - ofputil_put_OFPAT10_SET_VLAN_VID(out)->vlan_vid - = htons(ofpact_get_SET_VLAN_VID(a)->vlan_vid); - break; +/* This macro is careful to check for instructions with bad lengths. */ +#define INSTRUCTION_FOR_EACH(ITER, LEFT, INSTRUCTIONS, N_INSTRUCTIONS) \ + for ((ITER) = (INSTRUCTIONS), (LEFT) = (N_INSTRUCTIONS); \ + (LEFT) > 0 && instruction_is_valid(ITER, LEFT); \ + ((LEFT) -= (ntohs((ITER)->len) \ + / sizeof(struct ofp11_instruction)), \ + (ITER) = instruction_next(ITER))) - case OFPACT_SET_VLAN_PCP: - ofputil_put_OFPAT10_SET_VLAN_PCP(out)->vlan_pcp - = ofpact_get_SET_VLAN_PCP(a)->vlan_pcp; - break; +static enum ofperr +decode_openflow11_instruction(const struct ofp11_instruction *inst, + enum ovs_instruction_type *type) +{ + uint16_t len = ntohs(inst->len); - case OFPACT_STRIP_VLAN: - ofputil_put_OFPAT10_STRIP_VLAN(out); - break; + switch (inst->type) { + case CONSTANT_HTONS(OFPIT11_EXPERIMENTER): + return OFPERR_OFPBIC_BAD_EXPERIMENTER; - case OFPACT_SET_ETH_SRC: - memcpy(ofputil_put_OFPAT10_SET_DL_SRC(out)->dl_addr, - ofpact_get_SET_ETH_SRC(a)->mac, ETH_ADDR_LEN); - break; +#define DEFINE_INST(ENUM, STRUCT, EXTENSIBLE, NAME) \ + case CONSTANT_HTONS(ENUM): \ + if (EXTENSIBLE \ + ? len >= sizeof(struct STRUCT) \ + : len == sizeof(struct STRUCT)) { \ + *type = OVSINST_##ENUM; \ + return 0; \ + } else { \ + return OFPERR_OFPBIC_BAD_LEN; \ + } +OVS_INSTRUCTIONS +#undef DEFINE_INST - case OFPACT_SET_ETH_DST: - memcpy(ofputil_put_OFPAT10_SET_DL_DST(out)->dl_addr, - ofpact_get_SET_ETH_DST(a)->mac, ETH_ADDR_LEN); - break; + default: + return OFPERR_OFPBIC_UNKNOWN_INST; + } +} - case OFPACT_SET_IPV4_SRC: - ofputil_put_OFPAT10_SET_NW_SRC(out)->nw_addr - = ofpact_get_SET_IPV4_SRC(a)->ipv4; - break; +static enum ofperr +decode_openflow11_instructions(const struct ofp11_instruction insts[], + size_t n_insts, + const struct ofp11_instruction *out[]) +{ + const struct ofp11_instruction *inst; + size_t left; - case OFPACT_SET_IPV4_DST: - ofputil_put_OFPAT10_SET_NW_DST(out)->nw_addr - = ofpact_get_SET_IPV4_DST(a)->ipv4; - break; + memset(out, 0, N_OVS_INSTRUCTIONS * sizeof *out); + INSTRUCTION_FOR_EACH (inst, left, insts, n_insts) { + enum ovs_instruction_type type; + enum ofperr error; - case OFPACT_SET_IP_DSCP: - ofputil_put_OFPAT10_SET_NW_TOS(out)->nw_tos - = ofpact_get_SET_IP_DSCP(a)->dscp; - break; + error = decode_openflow11_instruction(inst, &type); + if (error) { + return error; + } - case OFPACT_SET_L4_SRC_PORT: - ofputil_put_OFPAT10_SET_TP_SRC(out)->tp_port - = htons(ofpact_get_SET_L4_SRC_PORT(a)->port); - break; + if (out[type]) { + return OFPERR_OFPBIC_DUP_INST; + } + out[type] = inst; + } + + if (left) { + VLOG_WARN_RL(&rl, "bad instruction format at offset %"PRIuSIZE, + (n_insts - left) * sizeof *inst); + return OFPERR_OFPBIC_BAD_LEN; + } + return 0; +} + +static void +get_actions_from_instruction(const struct ofp11_instruction *inst, + const struct ofp_action_header **actions, + size_t *actions_len) +{ + *actions = ALIGNED_CAST(const struct ofp_action_header *, inst + 1); + *actions_len = ntohs(inst->len) - sizeof *inst; +} + +enum ofperr +ofpacts_pull_openflow_instructions(struct ofpbuf *openflow, + unsigned int instructions_len, + enum ofp_version version, + struct ofpbuf *ofpacts) +{ + const struct ofp11_instruction *instructions; + const struct ofp11_instruction *insts[N_OVS_INSTRUCTIONS]; + enum ofperr error; + + if (version == OFP10_VERSION) { + return ofpacts_pull_openflow_actions__(openflow, instructions_len, + version, + (1u << N_OVS_INSTRUCTIONS) - 1, + ofpacts); + } + + ofpbuf_clear(ofpacts); + + if (instructions_len % OFP11_INSTRUCTION_ALIGN != 0) { + VLOG_WARN_RL(&rl, "OpenFlow message instructions length %u is not a " + "multiple of %d", + instructions_len, OFP11_INSTRUCTION_ALIGN); + error = OFPERR_OFPBIC_BAD_LEN; + goto exit; + } + + instructions = ofpbuf_try_pull(openflow, instructions_len); + if (instructions == NULL) { + VLOG_WARN_RL(&rl, "OpenFlow message instructions length %u exceeds " + "remaining message length (%"PRIu32")", + instructions_len, openflow->size); + error = OFPERR_OFPBIC_BAD_LEN; + goto exit; + } + + error = decode_openflow11_instructions( + instructions, instructions_len / OFP11_INSTRUCTION_ALIGN, + insts); + if (error) { + goto exit; + } + + if (insts[OVSINST_OFPIT13_METER]) { + const struct ofp13_instruction_meter *oim; + struct ofpact_meter *om; + + oim = ALIGNED_CAST(const struct ofp13_instruction_meter *, + insts[OVSINST_OFPIT13_METER]); + + om = ofpact_put_METER(ofpacts); + om->meter_id = ntohl(oim->meter_id); + } + if (insts[OVSINST_OFPIT11_APPLY_ACTIONS]) { + const struct ofp_action_header *actions; + size_t actions_len; - case OFPACT_SET_L4_DST_PORT: - ofputil_put_OFPAT10_SET_TP_DST(out)->tp_port - = htons(ofpact_get_SET_L4_DST_PORT(a)->port); - break; + get_actions_from_instruction(insts[OVSINST_OFPIT11_APPLY_ACTIONS], + &actions, &actions_len); + error = ofpacts_decode(actions, actions_len, version, ofpacts); + if (error) { + goto exit; + } + } + if (insts[OVSINST_OFPIT11_CLEAR_ACTIONS]) { + instruction_get_OFPIT11_CLEAR_ACTIONS( + insts[OVSINST_OFPIT11_CLEAR_ACTIONS]); + ofpact_put_CLEAR_ACTIONS(ofpacts); + } + if (insts[OVSINST_OFPIT11_WRITE_ACTIONS]) { + struct ofpact_nest *on; + const struct ofp_action_header *actions; + size_t actions_len; + size_t start; - case OFPACT_PUSH_VLAN: - /* PUSH is a side effect of a SET_VLAN_VID/PCP, which should - * follow this action. */ - break; + ofpact_pad(ofpacts); + start = ofpacts->size; + ofpact_put(ofpacts, OFPACT_WRITE_ACTIONS, + offsetof(struct ofpact_nest, actions)); + get_actions_from_instruction(insts[OVSINST_OFPIT11_WRITE_ACTIONS], + &actions, &actions_len); + error = ofpacts_decode_for_action_set(actions, actions_len, + version, ofpacts); + if (error) { + goto exit; + } + on = ofpbuf_at_assert(ofpacts, start, sizeof *on); + on->ofpact.len = ofpacts->size - start; + } + if (insts[OVSINST_OFPIT11_WRITE_METADATA]) { + const struct ofp11_instruction_write_metadata *oiwm; + struct ofpact_metadata *om; - case OFPACT_SET_IP_ECN: - case OFPACT_SET_IP_TTL: - case OFPACT_CLEAR_ACTIONS: - case OFPACT_WRITE_ACTIONS: - case OFPACT_GOTO_TABLE: - case OFPACT_METER: - /* XXX */ - break; + oiwm = ALIGNED_CAST(const struct ofp11_instruction_write_metadata *, + insts[OVSINST_OFPIT11_WRITE_METADATA]); - case OFPACT_GROUP: - break; + om = ofpact_put_WRITE_METADATA(ofpacts); + om->metadata = oiwm->metadata; + om->mask = oiwm->metadata_mask; + } + if (insts[OVSINST_OFPIT11_GOTO_TABLE]) { + const struct ofp11_instruction_goto_table *oigt; + struct ofpact_goto_table *ogt; - case OFPACT_SET_FIELD: - set_field_to_openflow(ofpact_get_SET_FIELD(a), out); - break; + oigt = instruction_get_OFPIT11_GOTO_TABLE( + insts[OVSINST_OFPIT11_GOTO_TABLE]); + ogt = ofpact_put_GOTO_TABLE(ofpacts); + ogt->table_id = oigt->table_id; + } - case OFPACT_CONTROLLER: - case OFPACT_OUTPUT_REG: - case OFPACT_BUNDLE: - case OFPACT_REG_MOVE: - case OFPACT_REG_LOAD: - case OFPACT_STACK_PUSH: - case OFPACT_STACK_POP: - case OFPACT_DEC_TTL: - case OFPACT_SET_MPLS_LABEL: - case OFPACT_SET_MPLS_TC: - case OFPACT_SET_MPLS_TTL: - case OFPACT_DEC_MPLS_TTL: - case OFPACT_SET_TUNNEL: - case OFPACT_WRITE_METADATA: - case OFPACT_SET_QUEUE: - case OFPACT_POP_QUEUE: - case OFPACT_FIN_TIMEOUT: - case OFPACT_RESUBMIT: - case OFPACT_LEARN: - case OFPACT_MULTIPATH: - case OFPACT_NOTE: - case OFPACT_EXIT: - case OFPACT_PUSH_MPLS: - case OFPACT_POP_MPLS: - case OFPACT_SAMPLE: - ofpact_to_nxast(a, out); - break; + error = ofpacts_verify(ofpacts->data, ofpacts->size, + (1u << N_OVS_INSTRUCTIONS) - 1); +exit: + if (error) { + ofpbuf_clear(ofpacts); } + return error; } - -/* Converting ofpacts to OpenFlow 1.1. */ +/* Update the length of the instruction that begins at offset 'ofs' within + * 'openflow' and contains nested actions that extend to the end of 'openflow'. + * If the instruction contains no nested actions, deletes it entirely. */ static void -ofpact_output_to_openflow11(const struct ofpact_output *output, - struct ofpbuf *out) +ofpacts_update_instruction_actions(struct ofpbuf *openflow, size_t ofs) { - struct ofp11_action_output *oao; + struct ofp11_instruction_actions *oia; - oao = ofputil_put_OFPAT11_OUTPUT(out); - oao->port = ofputil_port_to_ofp11(output->port); - oao->max_len = htons(output->max_len); + oia = ofpbuf_at_assert(openflow, ofs, sizeof *oia); + if (openflow->size > ofs + sizeof *oia) { + oia->len = htons(openflow->size - ofs); + } else { + openflow->size = ofs; + } } - -static void -ofpact_dec_ttl_to_openflow11(const struct ofpact_cnt_ids *dec_ttl, - struct ofpbuf *out) + +/* Checks that 'port' is a valid output port for OFPACT_OUTPUT, given that the + * switch will never have more than 'max_ports' ports. Returns 0 if 'port' is + * valid, otherwise an OpenFlow error code. */ +enum ofperr +ofpact_check_output_port(ofp_port_t port, ofp_port_t max_ports) { - if (dec_ttl->n_controllers == 1 && dec_ttl->cnt_ids[0] == 0 - && (!dec_ttl->ofpact.compat || - dec_ttl->ofpact.compat == OFPUTIL_OFPAT11_DEC_NW_TTL)) { - ofputil_put_OFPAT11_DEC_NW_TTL(out); - } else { - ofpact_dec_ttl_to_nxast(dec_ttl, out); + switch (port) { + case OFPP_IN_PORT: + case OFPP_TABLE: + case OFPP_NORMAL: + case OFPP_FLOOD: + case OFPP_ALL: + case OFPP_CONTROLLER: + case OFPP_NONE: + case OFPP_LOCAL: + return 0; + + default: + if (ofp_to_u16(port) < ofp_to_u16(max_ports)) { + return 0; + } + return OFPERR_OFPBAC_BAD_OUT_PORT; } } +/* Removes the protocols that require consistency between match and actions + * (that's everything but OpenFlow 1.0) from '*usable_protocols'. + * + * (An example of an inconsistency between match and actions is a flow that + * does not match on an MPLS Ethertype but has an action that pops an MPLS + * label.) */ static void -ofpact_to_openflow11(const struct ofpact *a, struct ofpbuf *out) +inconsistent_match(enum ofputil_protocol *usable_protocols) +{ + *usable_protocols &= OFPUTIL_P_OF10_ANY; +} + +/* May modify flow->dl_type, flow->nw_proto and flow->vlan_tci, + * caller must restore them. + * + * Modifies some actions, filling in fields that could not be properly set + * without context. */ +static enum ofperr +ofpact_check__(enum ofputil_protocol *usable_protocols, struct ofpact *a, + struct flow *flow, ofp_port_t max_ports, + uint8_t table_id, uint8_t n_tables) { + const struct ofpact_enqueue *enqueue; + const struct mf_field *mf; + switch (a->type) { case OFPACT_OUTPUT: - return ofpact_output_to_openflow11(ofpact_get_OUTPUT(a), out); + return ofpact_check_output_port(ofpact_get_OUTPUT(a)->port, + max_ports); + + case OFPACT_CONTROLLER: + return 0; case OFPACT_ENQUEUE: - /* XXX */ - break; + enqueue = ofpact_get_ENQUEUE(a); + if (ofp_to_u16(enqueue->port) >= ofp_to_u16(max_ports) + && enqueue->port != OFPP_IN_PORT + && enqueue->port != OFPP_LOCAL) { + return OFPERR_OFPBAC_BAD_OUT_PORT; + } + return 0; + + case OFPACT_OUTPUT_REG: + return mf_check_src(&ofpact_get_OUTPUT_REG(a)->src, flow); + + case OFPACT_BUNDLE: + return bundle_check(ofpact_get_BUNDLE(a), max_ports, flow); case OFPACT_SET_VLAN_VID: - /* Push a VLAN tag, if one was not seen at action validation time. */ - if (!ofpact_get_SET_VLAN_VID(a)->flow_has_vlan - && ofpact_get_SET_VLAN_VID(a)->push_vlan_if_needed) { - ofputil_put_OFPAT11_PUSH_VLAN(out)->ethertype - = htons(ETH_TYPE_VLAN_8021Q); + /* Remember if we saw a vlan tag in the flow to aid translating to + * OpenFlow 1.1+ if need be. */ + ofpact_get_SET_VLAN_VID(a)->flow_has_vlan = + (flow->vlan_tci & htons(VLAN_CFI)) == htons(VLAN_CFI); + if (!(flow->vlan_tci & htons(VLAN_CFI)) && + !ofpact_get_SET_VLAN_VID(a)->push_vlan_if_needed) { + inconsistent_match(usable_protocols); } - ofputil_put_OFPAT11_SET_VLAN_VID(out)->vlan_vid - = htons(ofpact_get_SET_VLAN_VID(a)->vlan_vid); - break; + /* Temporary mark that we have a vlan tag. */ + flow->vlan_tci |= htons(VLAN_CFI); + return 0; case OFPACT_SET_VLAN_PCP: - /* Push a VLAN tag, if one was not seen at action validation time. */ - if (!ofpact_get_SET_VLAN_PCP(a)->flow_has_vlan - && ofpact_get_SET_VLAN_PCP(a)->push_vlan_if_needed) { - ofputil_put_OFPAT11_PUSH_VLAN(out)->ethertype - = htons(ETH_TYPE_VLAN_8021Q); + /* Remember if we saw a vlan tag in the flow to aid translating to + * OpenFlow 1.1+ if need be. */ + ofpact_get_SET_VLAN_PCP(a)->flow_has_vlan = + (flow->vlan_tci & htons(VLAN_CFI)) == htons(VLAN_CFI); + if (!(flow->vlan_tci & htons(VLAN_CFI)) && + !ofpact_get_SET_VLAN_PCP(a)->push_vlan_if_needed) { + inconsistent_match(usable_protocols); } - ofputil_put_OFPAT11_SET_VLAN_PCP(out)->vlan_pcp - = ofpact_get_SET_VLAN_PCP(a)->vlan_pcp; - break; + /* Temporary mark that we have a vlan tag. */ + flow->vlan_tci |= htons(VLAN_CFI); + return 0; case OFPACT_STRIP_VLAN: - ofputil_put_OFPAT11_POP_VLAN(out); - break; + if (!(flow->vlan_tci & htons(VLAN_CFI))) { + inconsistent_match(usable_protocols); + } + /* Temporary mark that we have no vlan tag. */ + flow->vlan_tci = htons(0); + return 0; case OFPACT_PUSH_VLAN: - /* XXX ETH_TYPE_VLAN_8021AD case */ - ofputil_put_OFPAT11_PUSH_VLAN(out)->ethertype = - htons(ETH_TYPE_VLAN_8021Q); - break; - - case OFPACT_SET_QUEUE: - ofputil_put_OFPAT11_SET_QUEUE(out)->queue_id - = htonl(ofpact_get_SET_QUEUE(a)->queue_id); - break; + if (flow->vlan_tci & htons(VLAN_CFI)) { + /* Multiple VLAN headers not supported. */ + return OFPERR_OFPBAC_BAD_TAG; + } + /* Temporary mark that we have a vlan tag. */ + flow->vlan_tci |= htons(VLAN_CFI); + return 0; case OFPACT_SET_ETH_SRC: - memcpy(ofputil_put_OFPAT11_SET_DL_SRC(out)->dl_addr, - ofpact_get_SET_ETH_SRC(a)->mac, ETH_ADDR_LEN); - break; - case OFPACT_SET_ETH_DST: - memcpy(ofputil_put_OFPAT11_SET_DL_DST(out)->dl_addr, - ofpact_get_SET_ETH_DST(a)->mac, ETH_ADDR_LEN); - break; + return 0; case OFPACT_SET_IPV4_SRC: - ofputil_put_OFPAT11_SET_NW_SRC(out)->nw_addr - = ofpact_get_SET_IPV4_SRC(a)->ipv4; - break; - case OFPACT_SET_IPV4_DST: - ofputil_put_OFPAT11_SET_NW_DST(out)->nw_addr - = ofpact_get_SET_IPV4_DST(a)->ipv4; - break; + if (flow->dl_type != htons(ETH_TYPE_IP)) { + inconsistent_match(usable_protocols); + } + return 0; case OFPACT_SET_IP_DSCP: - ofputil_put_OFPAT11_SET_NW_TOS(out)->nw_tos - = ofpact_get_SET_IP_DSCP(a)->dscp; - break; - case OFPACT_SET_IP_ECN: - ofputil_put_OFPAT11_SET_NW_ECN(out)->nw_ecn - = ofpact_get_SET_IP_ECN(a)->ecn; - break; - case OFPACT_SET_IP_TTL: - ofputil_put_OFPAT11_SET_NW_TTL(out)->nw_ttl - = ofpact_get_SET_IP_TTL(a)->ttl; - break; + case OFPACT_DEC_TTL: + if (!is_ip_any(flow)) { + inconsistent_match(usable_protocols); + } + return 0; case OFPACT_SET_L4_SRC_PORT: - ofputil_put_OFPAT11_SET_TP_SRC(out)->tp_port - = htons(ofpact_get_SET_L4_SRC_PORT(a)->port); - break; + case OFPACT_SET_L4_DST_PORT: + if (!is_ip_any(flow) || (flow->nw_frag & FLOW_NW_FRAG_LATER) || + (flow->nw_proto != IPPROTO_TCP && flow->nw_proto != IPPROTO_UDP + && flow->nw_proto != IPPROTO_SCTP)) { + inconsistent_match(usable_protocols); + } + /* Note on which transport protocol the port numbers are set. + * This allows this set action to be converted to an OF1.2 set field + * action. */ + if (a->type == OFPACT_SET_L4_SRC_PORT) { + ofpact_get_SET_L4_SRC_PORT(a)->flow_ip_proto = flow->nw_proto; + } else { + ofpact_get_SET_L4_DST_PORT(a)->flow_ip_proto = flow->nw_proto; + } + return 0; + + case OFPACT_REG_MOVE: + return nxm_reg_move_check(ofpact_get_REG_MOVE(a), flow); + + case OFPACT_SET_FIELD: + mf = ofpact_get_SET_FIELD(a)->field; + /* Require OXM_OF_VLAN_VID to have an existing VLAN header. */ + if (!mf_are_prereqs_ok(mf, flow) || + (mf->id == MFF_VLAN_VID && !(flow->vlan_tci & htons(VLAN_CFI)))) { + VLOG_WARN_RL(&rl, "set_field %s lacks correct prerequisities", + mf->name); + return OFPERR_OFPBAC_MATCH_INCONSISTENT; + } + /* Remember if we saw a vlan tag in the flow to aid translating to + * OpenFlow 1.1 if need be. */ + ofpact_get_SET_FIELD(a)->flow_has_vlan = + (flow->vlan_tci & htons(VLAN_CFI)) == htons(VLAN_CFI); + if (mf->id == MFF_VLAN_TCI) { + /* The set field may add or remove the vlan tag, + * Mark the status temporarily. */ + flow->vlan_tci = ofpact_get_SET_FIELD(a)->value.be16; + } + return 0; - case OFPACT_SET_L4_DST_PORT: - ofputil_put_OFPAT11_SET_TP_DST(out)->tp_port - = htons(ofpact_get_SET_L4_DST_PORT(a)->port); - break; + case OFPACT_STACK_PUSH: + return nxm_stack_push_check(ofpact_get_STACK_PUSH(a), flow); - case OFPACT_DEC_TTL: - ofpact_dec_ttl_to_openflow11(ofpact_get_DEC_TTL(a), out); - break; + case OFPACT_STACK_POP: + return nxm_stack_pop_check(ofpact_get_STACK_POP(a), flow); case OFPACT_SET_MPLS_LABEL: - ofputil_put_OFPAT11_SET_MPLS_LABEL(out)->mpls_label - = ofpact_get_SET_MPLS_LABEL(a)->label; - break; - case OFPACT_SET_MPLS_TC: - ofputil_put_OFPAT11_SET_MPLS_TC(out)->mpls_tc - = ofpact_get_SET_MPLS_TC(a)->tc; - break; - case OFPACT_SET_MPLS_TTL: - ofputil_put_OFPAT11_SET_MPLS_TTL(out)->mpls_ttl - = ofpact_get_SET_MPLS_TTL(a)->ttl; - break; - case OFPACT_DEC_MPLS_TTL: - ofputil_put_OFPAT11_DEC_MPLS_TTL(out); - break; - - case OFPACT_WRITE_METADATA: - /* OpenFlow 1.1 uses OFPIT_WRITE_METADATA to express this action. */ - break; - - case OFPACT_PUSH_MPLS: - ofputil_put_OFPAT11_PUSH_MPLS(out)->ethertype = - ofpact_get_PUSH_MPLS(a)->ethertype; - break; - - case OFPACT_POP_MPLS: - ofputil_put_OFPAT11_POP_MPLS(out)->ethertype = - ofpact_get_POP_MPLS(a)->ethertype; - - break; - - case OFPACT_CLEAR_ACTIONS: - case OFPACT_WRITE_ACTIONS: - case OFPACT_GOTO_TABLE: - case OFPACT_METER: - OVS_NOT_REACHED(); - - case OFPACT_GROUP: - ofputil_put_OFPAT11_GROUP(out)->group_id = - htonl(ofpact_get_GROUP(a)->group_id); - break; - - case OFPACT_SET_FIELD: - set_field_to_openflow(ofpact_get_SET_FIELD(a), out); - break; + if (!eth_type_mpls(flow->dl_type)) { + inconsistent_match(usable_protocols); + } + return 0; - case OFPACT_CONTROLLER: - case OFPACT_OUTPUT_REG: - case OFPACT_BUNDLE: - case OFPACT_REG_MOVE: - case OFPACT_REG_LOAD: - case OFPACT_STACK_PUSH: - case OFPACT_STACK_POP: case OFPACT_SET_TUNNEL: + case OFPACT_SET_QUEUE: case OFPACT_POP_QUEUE: - case OFPACT_FIN_TIMEOUT: case OFPACT_RESUBMIT: + return 0; + + case OFPACT_FIN_TIMEOUT: + if (flow->nw_proto != IPPROTO_TCP) { + inconsistent_match(usable_protocols); + } + return 0; + case OFPACT_LEARN: + return learn_check(ofpact_get_LEARN(a), flow); + + case OFPACT_CONJUNCTION: + return 0; + case OFPACT_MULTIPATH: + return multipath_check(ofpact_get_MULTIPATH(a), flow); + case OFPACT_NOTE: case OFPACT_EXIT: + return 0; + + case OFPACT_PUSH_MPLS: + flow->dl_type = ofpact_get_PUSH_MPLS(a)->ethertype; + /* The packet is now MPLS and the MPLS payload is opaque. + * Thus nothing can be assumed about the network protocol. + * Temporarily mark that we have no nw_proto. */ + flow->nw_proto = 0; + return 0; + + case OFPACT_POP_MPLS: + if (!eth_type_mpls(flow->dl_type)) { + inconsistent_match(usable_protocols); + } + flow->dl_type = ofpact_get_POP_MPLS(a)->ethertype; + return 0; + case OFPACT_SAMPLE: - ofpact_to_nxast(a, out); - break; - } -} + return 0; -/* Output deprecated set actions as set_field actions. */ -static void -ofpact_to_openflow12(const struct ofpact *a, struct ofpbuf *out) -{ - enum mf_field_id field; - union mf_value value; - struct ofpact_l4_port *l4port; - uint8_t proto; + case OFPACT_CLEAR_ACTIONS: + return 0; - /* - * Convert actions deprecated in OpenFlow 1.2 to Set Field actions, - * if possible. - */ - switch ((int)a->type) { - case OFPACT_SET_VLAN_VID: - case OFPACT_SET_VLAN_PCP: - case OFPACT_SET_ETH_SRC: - case OFPACT_SET_ETH_DST: - case OFPACT_SET_IPV4_SRC: - case OFPACT_SET_IPV4_DST: - case OFPACT_SET_IP_DSCP: - case OFPACT_SET_IP_ECN: - case OFPACT_SET_L4_SRC_PORT: - case OFPACT_SET_L4_DST_PORT: - case OFPACT_SET_MPLS_LABEL: - case OFPACT_SET_MPLS_TC: - case OFPACT_SET_TUNNEL: /* Convert to a set_field, too. */ + case OFPACT_WRITE_ACTIONS: { + /* Use a temporary copy of 'usable_protocols' because we can't check + * consistency of an action set. */ + struct ofpact_nest *on = ofpact_get_WRITE_ACTIONS(a); + enum ofputil_protocol p = *usable_protocols; + return ofpacts_check(on->actions, ofpact_nest_get_action_len(on), + flow, max_ports, table_id, n_tables, &p); + } - switch ((int)a->type) { + case OFPACT_WRITE_METADATA: + return 0; - case OFPACT_SET_VLAN_VID: - if (!ofpact_get_SET_VLAN_VID(a)->flow_has_vlan && - ofpact_get_SET_VLAN_VID(a)->push_vlan_if_needed) { - ofputil_put_OFPAT11_PUSH_VLAN(out)->ethertype - = htons(ETH_TYPE_VLAN_8021Q); - } - field = MFF_VLAN_VID; - /* Set-Field on OXM_OF_VLAN_VID must have OFPVID_PRESENT set. */ - value.be16 = htons(ofpact_get_SET_VLAN_VID(a)->vlan_vid - | OFPVID12_PRESENT); - break; + case OFPACT_METER: { + uint32_t mid = ofpact_get_METER(a)->meter_id; + if (mid == 0 || mid > OFPM13_MAX) { + return OFPERR_OFPMMFC_INVALID_METER; + } + return 0; + } - case OFPACT_SET_VLAN_PCP: - if (!ofpact_get_SET_VLAN_PCP(a)->flow_has_vlan && - ofpact_get_SET_VLAN_PCP(a)->push_vlan_if_needed) { - ofputil_put_OFPAT11_PUSH_VLAN(out)->ethertype - = htons(ETH_TYPE_VLAN_8021Q); - } - field = MFF_VLAN_PCP; - value.u8 = ofpact_get_SET_VLAN_PCP(a)->vlan_pcp; - break; + case OFPACT_GOTO_TABLE: { + uint8_t goto_table = ofpact_get_GOTO_TABLE(a)->table_id; + if ((table_id != 255 && goto_table <= table_id) + || (n_tables != 255 && goto_table >= n_tables)) { + return OFPERR_OFPBIC_BAD_TABLE_ID; + } + return 0; + } - case OFPACT_SET_ETH_SRC: - field = MFF_ETH_SRC; - memcpy(value.mac, ofpact_get_SET_ETH_SRC(a)->mac, ETH_ADDR_LEN); - break; + case OFPACT_GROUP: + return 0; - case OFPACT_SET_ETH_DST: - field = MFF_ETH_DST; - memcpy(value.mac, ofpact_get_SET_ETH_DST(a)->mac, ETH_ADDR_LEN); - break; + case OFPACT_UNROLL_XLATE: + /* UNROLL is an internal action that should never be seen via + * OpenFlow. */ + return OFPERR_OFPBAC_BAD_TYPE; - case OFPACT_SET_IPV4_SRC: - field = MFF_IPV4_SRC; - value.be32 = ofpact_get_SET_IPV4_SRC(a)->ipv4; - break; + default: + OVS_NOT_REACHED(); + } +} - case OFPACT_SET_IPV4_DST: - field = MFF_IPV4_DST; - value.be32 = ofpact_get_SET_IPV4_DST(a)->ipv4; - break; +/* Checks that the 'ofpacts_len' bytes of actions in 'ofpacts' are + * appropriate for a packet with the prerequisites satisfied by 'flow' in a + * switch with no more than 'max_ports' ports. + * + * If 'ofpacts' and 'flow' are inconsistent with one another, un-sets in + * '*usable_protocols' the protocols that forbid the inconsistency. (An + * example of an inconsistency between match and actions is a flow that does + * not match on an MPLS Ethertype but has an action that pops an MPLS label.) + * + * May annotate ofpacts with information gathered from the 'flow'. + * + * May temporarily modify 'flow', but restores the changes before returning. */ +enum ofperr +ofpacts_check(struct ofpact ofpacts[], size_t ofpacts_len, + struct flow *flow, ofp_port_t max_ports, + uint8_t table_id, uint8_t n_tables, + enum ofputil_protocol *usable_protocols) +{ + struct ofpact *a; + ovs_be16 dl_type = flow->dl_type; + ovs_be16 vlan_tci = flow->vlan_tci; + uint8_t nw_proto = flow->nw_proto; + enum ofperr error = 0; - case OFPACT_SET_IP_DSCP: - field = MFF_IP_DSCP_SHIFTED; /* OXM_OF_IP_DSCP */ - value.u8 = ofpact_get_SET_IP_DSCP(a)->dscp >> 2; + OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { + error = ofpact_check__(usable_protocols, a, flow, + max_ports, table_id, n_tables); + if (error) { break; + } + } + /* Restore fields that may have been modified. */ + flow->dl_type = dl_type; + flow->vlan_tci = vlan_tci; + flow->nw_proto = nw_proto; + return error; +} - case OFPACT_SET_IP_ECN: - field = MFF_IP_ECN; - value.u8 = ofpact_get_SET_IP_ECN(a)->ecn; - break; +/* Like ofpacts_check(), but reports inconsistencies as + * OFPERR_OFPBAC_MATCH_INCONSISTENT rather than clearing bits. */ +enum ofperr +ofpacts_check_consistency(struct ofpact ofpacts[], size_t ofpacts_len, + struct flow *flow, ofp_port_t max_ports, + uint8_t table_id, uint8_t n_tables, + enum ofputil_protocol usable_protocols) +{ + enum ofputil_protocol p = usable_protocols; + enum ofperr error; - case OFPACT_SET_L4_SRC_PORT: - /* We keep track of IP protocol while translating actions to be - * able to translate to the proper OXM type. - * If the IP protocol type is unknown, the translation cannot - * be performed and we will send the action using the original - * action type. */ - l4port = ofpact_get_SET_L4_SRC_PORT(a); - proto = l4port->flow_ip_proto; - field = proto == IPPROTO_TCP ? MFF_TCP_SRC - : proto == IPPROTO_UDP ? MFF_UDP_SRC - : proto == IPPROTO_SCTP ? MFF_SCTP_SRC - : MFF_N_IDS; /* RFC: Unknown IP proto, do not translate. */ - value.be16 = htons(l4port->port); - break; + error = ofpacts_check(ofpacts, ofpacts_len, flow, max_ports, + table_id, n_tables, &p); + return (error ? error + : p != usable_protocols ? OFPERR_OFPBAC_MATCH_INCONSISTENT + : 0); +} - case OFPACT_SET_L4_DST_PORT: - l4port = ofpact_get_SET_L4_DST_PORT(a); - proto = l4port->flow_ip_proto; - field = proto == IPPROTO_TCP ? MFF_TCP_DST - : proto == IPPROTO_UDP ? MFF_UDP_DST - : proto == IPPROTO_SCTP ? MFF_SCTP_DST - : MFF_N_IDS; /* RFC: Unknown IP proto, do not translate. */ - value.be16 = htons(l4port->port); - break; +/* Verifies that the 'ofpacts_len' bytes of actions in 'ofpacts' are in the + * appropriate order as defined by the OpenFlow spec and as required by Open + * vSwitch. + * + * 'allowed_ovsinsts' is a bitmap of OVSINST_* values, in which 1-bits indicate + * instructions that are allowed within 'ofpacts[]'. */ +static enum ofperr +ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len, + uint32_t allowed_ovsinsts) +{ + const struct ofpact *a; + enum ovs_instruction_type inst; - case OFPACT_SET_MPLS_LABEL: - field = MFF_MPLS_LABEL; - value.be32 = ofpact_get_SET_MPLS_LABEL(a)->label; - break; + inst = OVSINST_OFPIT13_METER; + OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { + enum ovs_instruction_type next; - case OFPACT_SET_MPLS_TC: - field = MFF_MPLS_TC; - value.u8 = ofpact_get_SET_MPLS_TC(a)->tc; - break; + if (a->type == OFPACT_CONJUNCTION) { + OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { + if (a->type != OFPACT_CONJUNCTION) { + VLOG_WARN("when conjunction action is present, it must be " + "the only kind of action used (saw '%s' action)", + ofpact_name(a->type)); + return OFPERR_NXBAC_BAD_CONJUNCTION; + } + } + return 0; + } - case OFPACT_SET_TUNNEL: - field = MFF_TUN_ID; - value.be64 = htonll(ofpact_get_SET_TUNNEL(a)->tun_id); - break; + next = ovs_instruction_type_from_ofpact_type(a->type); + if (a > ofpacts + && (inst == OVSINST_OFPIT11_APPLY_ACTIONS + ? next < inst + : next <= inst)) { + const char *name = ovs_instruction_name_from_type(inst); + const char *next_name = ovs_instruction_name_from_type(next); - default: - field = MFF_N_IDS; + if (next == inst) { + VLOG_WARN("duplicate %s instruction not allowed, for OpenFlow " + "1.1+ compatibility", name); + } else { + VLOG_WARN("invalid instruction ordering: %s must appear " + "before %s, for OpenFlow 1.1+ compatibility", + next_name, name); + } + return OFPERR_OFPBAC_UNSUPPORTED_ORDER; } + if (!((1u << next) & allowed_ovsinsts)) { + const char *name = ovs_instruction_name_from_type(next); - /* Put the action out as a set field action, if possible. */ - if (field < MFF_N_IDS) { - uint64_t ofpacts_stub[128 / 8]; - struct ofpbuf sf_act; - struct ofpact_set_field *sf; - - ofpbuf_use_stub(&sf_act, ofpacts_stub, sizeof ofpacts_stub); - sf = ofpact_put_SET_FIELD(&sf_act); - sf->field = mf_from_id(field); - memcpy(&sf->value, &value, sf->field->n_bytes); - set_field_to_openflow(sf, out); - return; + VLOG_WARN("%s instruction not allowed here", name); + return OFPERR_OFPBIC_UNSUP_INST; } + + inst = next; } - ofpact_to_openflow11(a, out); + return 0; +} + +/* Converting ofpacts to OpenFlow. */ + +static void +encode_ofpact(const struct ofpact *a, enum ofp_version ofp_version, + struct ofpbuf *out) +{ + switch (a->type) { +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ + case OFPACT_##ENUM: \ + encode_##ENUM(ofpact_get_##ENUM(a), ofp_version, out); \ + return; + OFPACTS +#undef OFPACT + default: + OVS_NOT_REACHED(); + } } /* Converts the 'ofpacts_len' bytes of ofpacts in 'ofpacts' into OpenFlow @@ -2982,31 +5805,19 @@ enum ofp_version ofp_version) { const struct ofpact *a; - size_t start_size = ofpbuf_size(openflow); - - void (*translate)(const struct ofpact *a, struct ofpbuf *out) = - (ofp_version == OFP10_VERSION) ? ofpact_to_openflow10 : - (ofp_version == OFP11_VERSION) ? ofpact_to_openflow11 : - ofpact_to_openflow12; - - OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { - translate(a, openflow); - } - return ofpbuf_size(openflow) - start_size; -} - -static void -ofpacts_update_instruction_actions(struct ofpbuf *openflow, size_t ofs) -{ - struct ofp11_instruction_actions *oia; - - /* Update the instruction's length (or, if it's empty, delete it). */ - oia = ofpbuf_at_assert(openflow, ofs, sizeof *oia); - if (ofpbuf_size(openflow) > ofs + sizeof *oia) { - oia->len = htons(ofpbuf_size(openflow) - ofs); - } else { - ofpbuf_set_size(openflow, ofs); + size_t start_size = openflow->size; + + OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { + encode_ofpact(a, ofp_version, openflow); } + return openflow->size - start_size; +} + +static enum ovs_instruction_type +ofpact_is_apply_actions(const struct ofpact *a) +{ + return (ovs_instruction_type_from_ofpact_type(a->type) + == OVSINST_OFPIT11_APPLY_ACTIONS); } void @@ -3015,85 +5826,179 @@ struct ofpbuf *openflow, enum ofp_version ofp_version) { + const struct ofpact *end = ofpact_end(ofpacts, ofpacts_len); const struct ofpact *a; - ovs_assert(ofp_version >= OFP11_VERSION); + if (ofp_version == OFP10_VERSION) { + ofpacts_put_openflow_actions(ofpacts, ofpacts_len, openflow, + ofp_version); + return; + } - OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { - switch (ovs_instruction_type_from_ofpact_type(a->type)) { - case OVSINST_OFPIT11_CLEAR_ACTIONS: - instruction_put_OFPIT11_CLEAR_ACTIONS(openflow); - break; + a = ofpacts; + while (a < end) { + if (ofpact_is_apply_actions(a)) { + size_t ofs = openflow->size; - case OVSINST_OFPIT11_GOTO_TABLE: { - struct ofp11_instruction_goto_table *oigt; - oigt = instruction_put_OFPIT11_GOTO_TABLE(openflow); - oigt->table_id = ofpact_get_GOTO_TABLE(a)->table_id; - memset(oigt->pad, 0, sizeof oigt->pad); - break; + instruction_put_OFPIT11_APPLY_ACTIONS(openflow); + do { + encode_ofpact(a, ofp_version, openflow); + a = ofpact_next(a); + } while (a < end && ofpact_is_apply_actions(a)); + ofpacts_update_instruction_actions(openflow, ofs); + } else { + encode_ofpact(a, ofp_version, openflow); + a = ofpact_next(a); } + } +} + +/* Sets of supported actions. */ - case OVSINST_OFPIT11_WRITE_METADATA: { - const struct ofpact_metadata *om; - struct ofp11_instruction_write_metadata *oiwm; - - om = ofpact_get_WRITE_METADATA(a); - oiwm = instruction_put_OFPIT11_WRITE_METADATA(openflow); - oiwm->metadata = om->metadata; - oiwm->metadata_mask = om->mask; - break; - } +/* Two-way translation between OVS's internal "OFPACT_*" representation of + * actions and the "OFPAT_*" representation used in some OpenFlow version. + * (OFPAT_* numbering varies from one OpenFlow version to another, so a given + * instance is specific to one OpenFlow version.) */ +struct ofpact_map { + enum ofpact_type ofpact; /* Internal name for action type. */ + int ofpat; /* OFPAT_* number from OpenFlow spec. */ +}; - case OVSINST_OFPIT13_METER: - if (ofp_version >= OFP13_VERSION) { - const struct ofpact_meter *om; - struct ofp13_instruction_meter *oim; - - om = ofpact_get_METER(a); - oim = instruction_put_OFPIT13_METER(openflow); - oim->meter_id = htonl(om->meter_id); - } - break; +static const struct ofpact_map * +get_ofpact_map(enum ofp_version version) +{ + /* OpenFlow 1.0 actions. */ + static const struct ofpact_map of10[] = { + { OFPACT_OUTPUT, 0 }, + { OFPACT_SET_VLAN_VID, 1 }, + { OFPACT_SET_VLAN_PCP, 2 }, + { OFPACT_STRIP_VLAN, 3 }, + { OFPACT_SET_ETH_SRC, 4 }, + { OFPACT_SET_ETH_DST, 5 }, + { OFPACT_SET_IPV4_SRC, 6 }, + { OFPACT_SET_IPV4_DST, 7 }, + { OFPACT_SET_IP_DSCP, 8 }, + { OFPACT_SET_L4_SRC_PORT, 9 }, + { OFPACT_SET_L4_DST_PORT, 10 }, + { OFPACT_ENQUEUE, 11 }, + { 0, -1 }, + }; + + /* OpenFlow 1.1 actions. */ + static const struct ofpact_map of11[] = { + { OFPACT_OUTPUT, 0 }, + { OFPACT_SET_VLAN_VID, 1 }, + { OFPACT_SET_VLAN_PCP, 2 }, + { OFPACT_SET_ETH_SRC, 3 }, + { OFPACT_SET_ETH_DST, 4 }, + { OFPACT_SET_IPV4_SRC, 5 }, + { OFPACT_SET_IPV4_DST, 6 }, + { OFPACT_SET_IP_DSCP, 7 }, + { OFPACT_SET_IP_ECN, 8 }, + { OFPACT_SET_L4_SRC_PORT, 9 }, + { OFPACT_SET_L4_DST_PORT, 10 }, + /* OFPAT_COPY_TTL_OUT (11) not supported. */ + /* OFPAT_COPY_TTL_IN (12) not supported. */ + { OFPACT_SET_MPLS_LABEL, 13 }, + { OFPACT_SET_MPLS_TC, 14 }, + { OFPACT_SET_MPLS_TTL, 15 }, + { OFPACT_DEC_MPLS_TTL, 16 }, + { OFPACT_PUSH_VLAN, 17 }, + { OFPACT_STRIP_VLAN, 18 }, + { OFPACT_PUSH_MPLS, 19 }, + { OFPACT_POP_MPLS, 20 }, + { OFPACT_SET_QUEUE, 21 }, + { OFPACT_GROUP, 22 }, + { OFPACT_SET_IP_TTL, 23 }, + { OFPACT_DEC_TTL, 24 }, + { 0, -1 }, + }; + + /* OpenFlow 1.2, 1.3, and 1.4 actions. */ + static const struct ofpact_map of12[] = { + { OFPACT_OUTPUT, 0 }, + /* OFPAT_COPY_TTL_OUT (11) not supported. */ + /* OFPAT_COPY_TTL_IN (12) not supported. */ + { OFPACT_SET_MPLS_TTL, 15 }, + { OFPACT_DEC_MPLS_TTL, 16 }, + { OFPACT_PUSH_VLAN, 17 }, + { OFPACT_STRIP_VLAN, 18 }, + { OFPACT_PUSH_MPLS, 19 }, + { OFPACT_POP_MPLS, 20 }, + { OFPACT_SET_QUEUE, 21 }, + { OFPACT_GROUP, 22 }, + { OFPACT_SET_IP_TTL, 23 }, + { OFPACT_DEC_TTL, 24 }, + { OFPACT_SET_FIELD, 25 }, + /* OF1.3+ OFPAT_PUSH_PBB (26) not supported. */ + /* OF1.3+ OFPAT_POP_PBB (27) not supported. */ + { 0, -1 }, + }; + + switch (version) { + case OFP10_VERSION: + return of10; + + case OFP11_VERSION: + return of11; + + case OFP12_VERSION: + case OFP13_VERSION: + case OFP14_VERSION: + case OFP15_VERSION: + default: + return of12; + } +} - case OVSINST_OFPIT11_APPLY_ACTIONS: { - const size_t ofs = ofpbuf_size(openflow); - const size_t ofpacts_len_left = - (uint8_t*)ofpact_end(ofpacts, ofpacts_len) - (uint8_t*)a; - const struct ofpact *action; - const struct ofpact *processed = a; +/* Converts 'ofpacts_bitmap', a bitmap whose bits correspond to OFPACT_* + * values, into a bitmap of actions suitable for OpenFlow 'version', and + * returns the result. */ +ovs_be32 +ofpact_bitmap_to_openflow(uint64_t ofpacts_bitmap, enum ofp_version version) +{ + uint32_t openflow_bitmap = 0; + const struct ofpact_map *x; - instruction_put_OFPIT11_APPLY_ACTIONS(openflow); - OFPACT_FOR_EACH(action, a, ofpacts_len_left) { - if (ovs_instruction_type_from_ofpact_type(action->type) - != OVSINST_OFPIT11_APPLY_ACTIONS) { - break; - } - if (ofp_version == OFP11_VERSION) { - ofpact_to_openflow11(action, openflow); - } else { - ofpact_to_openflow12(action, openflow); - } - processed = action; - } - ofpacts_update_instruction_actions(openflow, ofs); - a = processed; - break; + for (x = get_ofpact_map(version); x->ofpat >= 0; x++) { + if (ofpacts_bitmap & (UINT64_C(1) << x->ofpact)) { + openflow_bitmap |= 1u << x->ofpat; } + } + return htonl(openflow_bitmap); +} - case OVSINST_OFPIT11_WRITE_ACTIONS: { - const size_t ofs = ofpbuf_size(openflow); - const struct ofpact_nest *on; - - on = ofpact_get_WRITE_ACTIONS(a); - instruction_put_OFPIT11_WRITE_ACTIONS(openflow); - ofpacts_put_openflow_actions(on->actions, - ofpact_nest_get_action_len(on), - openflow, ofp_version); - ofpacts_update_instruction_actions(openflow, ofs); +/* Converts 'ofpat_bitmap', a bitmap of actions from an OpenFlow message with + * the given 'version' into a bitmap whose bits correspond to OFPACT_* values, + * and returns the result. */ +uint64_t +ofpact_bitmap_from_openflow(ovs_be32 ofpat_bitmap, enum ofp_version version) +{ + uint64_t ofpact_bitmap = 0; + const struct ofpact_map *x; - break; + for (x = get_ofpact_map(version); x->ofpat >= 0; x++) { + if (ofpat_bitmap & htonl(1u << x->ofpat)) { + ofpact_bitmap |= UINT64_C(1) << x->ofpact; } + } + return ofpact_bitmap; +} + +/* Appends to 's' a string representation of the set of OFPACT_* represented + * by 'ofpacts_bitmap'. */ +void +ofpact_bitmap_format(uint64_t ofpacts_bitmap, struct ds *s) +{ + if (!ofpacts_bitmap) { + ds_put_cstr(s, ""); + } else { + while (ofpacts_bitmap) { + ds_put_format(s, "%s ", + ofpact_name(rightmost_1bit_idx(ofpacts_bitmap))); + ofpacts_bitmap = zero_rightmost_1bit(ofpacts_bitmap); } + ds_chomp(s, ' '); } } @@ -3125,7 +6030,6 @@ case OFPACT_SET_L4_SRC_PORT: case OFPACT_SET_L4_DST_PORT: case OFPACT_REG_MOVE: - case OFPACT_REG_LOAD: case OFPACT_SET_FIELD: case OFPACT_STACK_PUSH: case OFPACT_STACK_POP: @@ -3141,9 +6045,11 @@ case OFPACT_FIN_TIMEOUT: case OFPACT_RESUBMIT: case OFPACT_LEARN: + case OFPACT_CONJUNCTION: case OFPACT_MULTIPATH: case OFPACT_NOTE: case OFPACT_EXIT: + case OFPACT_UNROLL_XLATE: case OFPACT_PUSH_MPLS: case OFPACT_POP_MPLS: case OFPACT_SAMPLE: @@ -3171,411 +6077,72 @@ } } - return false; -} - -/* Returns true if any action in the 'ofpacts_len' bytes of 'ofpacts' outputs - * to 'group', false otherwise. */ -bool -ofpacts_output_to_group(const struct ofpact *ofpacts, size_t ofpacts_len, - uint32_t group_id) -{ - const struct ofpact *a; - - OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { - if (a->type == OFPACT_GROUP - && ofpact_get_GROUP(a)->group_id == group_id) { - return true; - } - } - - return false; -} - -bool -ofpacts_equal(const struct ofpact *a, size_t a_len, - const struct ofpact *b, size_t b_len) -{ - return a_len == b_len && !memcmp(a, b, a_len); -} - -/* Finds the OFPACT_METER action, if any, in the 'ofpacts_len' bytes of - * 'ofpacts'. If found, returns its meter ID; if not, returns 0. - * - * This function relies on the order of 'ofpacts' being correct (as checked by - * ofpacts_verify()). */ -uint32_t -ofpacts_get_meter(const struct ofpact ofpacts[], size_t ofpacts_len) -{ - const struct ofpact *a; - - OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { - enum ovs_instruction_type inst; - - inst = ovs_instruction_type_from_ofpact_type(a->type); - if (a->type == OFPACT_METER) { - return ofpact_get_METER(a)->meter_id; - } else if (inst > OVSINST_OFPIT13_METER) { - break; - } - } - - return 0; -} - -/* Formatting ofpacts. */ - -static void -print_note(const struct ofpact_note *note, struct ds *string) -{ - size_t i; - - ds_put_cstr(string, "note:"); - for (i = 0; i < note->length; i++) { - if (i) { - ds_put_char(string, '.'); - } - ds_put_format(string, "%02"PRIx8, note->data[i]); - } -} - -static void -print_dec_ttl(const struct ofpact_cnt_ids *ids, - struct ds *s) -{ - size_t i; - - ds_put_cstr(s, "dec_ttl"); - if (ids->ofpact.compat == OFPUTIL_NXAST_DEC_TTL_CNT_IDS) { - ds_put_cstr(s, "("); - for (i = 0; i < ids->n_controllers; i++) { - if (i) { - ds_put_cstr(s, ","); - } - ds_put_format(s, "%"PRIu16, ids->cnt_ids[i]); - } - ds_put_cstr(s, ")"); - } -} - -static void -print_fin_timeout(const struct ofpact_fin_timeout *fin_timeout, - struct ds *s) -{ - ds_put_cstr(s, "fin_timeout("); - if (fin_timeout->fin_idle_timeout) { - ds_put_format(s, "idle_timeout=%"PRIu16",", - fin_timeout->fin_idle_timeout); - } - if (fin_timeout->fin_hard_timeout) { - ds_put_format(s, "hard_timeout=%"PRIu16",", - fin_timeout->fin_hard_timeout); - } - ds_chomp(s, ','); - ds_put_char(s, ')'); -} - -static void -ofpact_format(const struct ofpact *a, struct ds *s) -{ - const struct ofpact_enqueue *enqueue; - const struct ofpact_resubmit *resubmit; - const struct ofpact_controller *controller; - const struct ofpact_metadata *metadata; - const struct ofpact_tunnel *tunnel; - const struct ofpact_sample *sample; - const struct ofpact_set_field *set_field; - const struct mf_field *mf; - ofp_port_t port; - - switch (a->type) { - case OFPACT_OUTPUT: - port = ofpact_get_OUTPUT(a)->port; - if (ofp_to_u16(port) < ofp_to_u16(OFPP_MAX)) { - ds_put_format(s, "output:%"PRIu16, port); - } else { - ofputil_format_port(port, s); - if (port == OFPP_CONTROLLER) { - ds_put_format(s, ":%"PRIu16, ofpact_get_OUTPUT(a)->max_len); - } - } - break; - - case OFPACT_CONTROLLER: - controller = ofpact_get_CONTROLLER(a); - if (controller->reason == OFPR_ACTION && - controller->controller_id == 0) { - ds_put_format(s, "CONTROLLER:%"PRIu16, - ofpact_get_CONTROLLER(a)->max_len); - } else { - enum ofp_packet_in_reason reason = controller->reason; - - ds_put_cstr(s, "controller("); - if (reason != OFPR_ACTION) { - char reasonbuf[OFPUTIL_PACKET_IN_REASON_BUFSIZE]; - - ds_put_format(s, "reason=%s,", - ofputil_packet_in_reason_to_string( - reason, reasonbuf, sizeof reasonbuf)); - } - if (controller->max_len != UINT16_MAX) { - ds_put_format(s, "max_len=%"PRIu16",", controller->max_len); - } - if (controller->controller_id != 0) { - ds_put_format(s, "id=%"PRIu16",", controller->controller_id); - } - ds_chomp(s, ','); - ds_put_char(s, ')'); - } - break; - - case OFPACT_ENQUEUE: - enqueue = ofpact_get_ENQUEUE(a); - ds_put_format(s, "enqueue:"); - ofputil_format_port(enqueue->port, s); - ds_put_format(s, ":%"PRIu32, enqueue->queue); - break; - - case OFPACT_OUTPUT_REG: - ds_put_cstr(s, "output:"); - mf_format_subfield(&ofpact_get_OUTPUT_REG(a)->src, s); - break; - - case OFPACT_BUNDLE: - bundle_format(ofpact_get_BUNDLE(a), s); - break; - - case OFPACT_SET_VLAN_VID: - ds_put_format(s, "%s:%"PRIu16, - (a->compat == OFPUTIL_OFPAT11_SET_VLAN_VID - ? "set_vlan_vid" - : "mod_vlan_vid"), - ofpact_get_SET_VLAN_VID(a)->vlan_vid); - break; - - case OFPACT_SET_VLAN_PCP: - ds_put_format(s, "%s:%"PRIu8, - (a->compat == OFPUTIL_OFPAT11_SET_VLAN_PCP - ? "set_vlan_pcp" - : "mod_vlan_pcp"), - ofpact_get_SET_VLAN_PCP(a)->vlan_pcp); - break; - - case OFPACT_STRIP_VLAN: - ds_put_cstr(s, a->compat == OFPUTIL_OFPAT11_POP_VLAN - ? "pop_vlan" : "strip_vlan"); - break; - - case OFPACT_PUSH_VLAN: - /* XXX 802.1AD case*/ - ds_put_format(s, "push_vlan:%#"PRIx16, ETH_TYPE_VLAN_8021Q); - break; - - case OFPACT_SET_ETH_SRC: - ds_put_format(s, "mod_dl_src:"ETH_ADDR_FMT, - ETH_ADDR_ARGS(ofpact_get_SET_ETH_SRC(a)->mac)); - break; - - case OFPACT_SET_ETH_DST: - ds_put_format(s, "mod_dl_dst:"ETH_ADDR_FMT, - ETH_ADDR_ARGS(ofpact_get_SET_ETH_DST(a)->mac)); - break; - - case OFPACT_SET_IPV4_SRC: - ds_put_format(s, "mod_nw_src:"IP_FMT, - IP_ARGS(ofpact_get_SET_IPV4_SRC(a)->ipv4)); - break; - - case OFPACT_SET_IPV4_DST: - ds_put_format(s, "mod_nw_dst:"IP_FMT, - IP_ARGS(ofpact_get_SET_IPV4_DST(a)->ipv4)); - break; - - case OFPACT_SET_IP_DSCP: - ds_put_format(s, "mod_nw_tos:%d", ofpact_get_SET_IP_DSCP(a)->dscp); - break; - - case OFPACT_SET_IP_ECN: - ds_put_format(s, "mod_nw_ecn:%d", ofpact_get_SET_IP_ECN(a)->ecn); - break; - - case OFPACT_SET_IP_TTL: - ds_put_format(s, "mod_nw_ttl:%d", ofpact_get_SET_IP_TTL(a)->ttl); - break; - - case OFPACT_SET_L4_SRC_PORT: - ds_put_format(s, "mod_tp_src:%d", ofpact_get_SET_L4_SRC_PORT(a)->port); - break; - - case OFPACT_SET_L4_DST_PORT: - ds_put_format(s, "mod_tp_dst:%d", ofpact_get_SET_L4_DST_PORT(a)->port); - break; - - case OFPACT_REG_MOVE: - nxm_format_reg_move(ofpact_get_REG_MOVE(a), s); - break; - - case OFPACT_REG_LOAD: - nxm_format_reg_load(ofpact_get_REG_LOAD(a), s); - break; - - case OFPACT_SET_FIELD: - set_field = ofpact_get_SET_FIELD(a); - mf = set_field->field; - ds_put_format(s, "set_field:"); - mf_format(mf, &set_field->value, NULL, s); - ds_put_format(s, "->%s", mf->name); - break; - - case OFPACT_STACK_PUSH: - nxm_format_stack_push(ofpact_get_STACK_PUSH(a), s); - break; - - case OFPACT_STACK_POP: - nxm_format_stack_pop(ofpact_get_STACK_POP(a), s); - break; - - case OFPACT_DEC_TTL: - print_dec_ttl(ofpact_get_DEC_TTL(a), s); - break; - - case OFPACT_SET_MPLS_LABEL: - ds_put_format(s, "set_mpls_label(%"PRIu32")", - ntohl(ofpact_get_SET_MPLS_LABEL(a)->label)); - break; - - case OFPACT_SET_MPLS_TC: - ds_put_format(s, "set_mpls_ttl(%"PRIu8")", - ofpact_get_SET_MPLS_TC(a)->tc); - break; - - case OFPACT_SET_MPLS_TTL: - ds_put_format(s, "set_mpls_ttl(%"PRIu8")", - ofpact_get_SET_MPLS_TTL(a)->ttl); - break; - - case OFPACT_DEC_MPLS_TTL: - ds_put_cstr(s, "dec_mpls_ttl"); - break; - - case OFPACT_SET_TUNNEL: - tunnel = ofpact_get_SET_TUNNEL(a); - ds_put_format(s, "set_tunnel%s:%#"PRIx64, - (tunnel->tun_id > UINT32_MAX - || a->compat == OFPUTIL_NXAST_SET_TUNNEL64 ? "64" : ""), - tunnel->tun_id); - break; - - case OFPACT_SET_QUEUE: - ds_put_format(s, "set_queue:%"PRIu32, - ofpact_get_SET_QUEUE(a)->queue_id); - break; - - case OFPACT_POP_QUEUE: - ds_put_cstr(s, "pop_queue"); - break; - - case OFPACT_FIN_TIMEOUT: - print_fin_timeout(ofpact_get_FIN_TIMEOUT(a), s); - break; - - case OFPACT_RESUBMIT: - resubmit = ofpact_get_RESUBMIT(a); - if (resubmit->in_port != OFPP_IN_PORT && resubmit->table_id == 255) { - ds_put_cstr(s, "resubmit:"); - ofputil_format_port(resubmit->in_port, s); - } else { - ds_put_format(s, "resubmit("); - if (resubmit->in_port != OFPP_IN_PORT) { - ofputil_format_port(resubmit->in_port, s); - } - ds_put_char(s, ','); - if (resubmit->table_id != 255) { - ds_put_format(s, "%"PRIu8, resubmit->table_id); - } - ds_put_char(s, ')'); - } - break; - - case OFPACT_LEARN: - learn_format(ofpact_get_LEARN(a), s); - break; - - case OFPACT_MULTIPATH: - multipath_format(ofpact_get_MULTIPATH(a), s); - break; - - case OFPACT_NOTE: - print_note(ofpact_get_NOTE(a), s); - break; - - case OFPACT_PUSH_MPLS: - ds_put_format(s, "push_mpls:0x%04"PRIx16, - ntohs(ofpact_get_PUSH_MPLS(a)->ethertype)); - break; + return false; +} - case OFPACT_POP_MPLS: - ds_put_format(s, "pop_mpls:0x%04"PRIx16, - ntohs(ofpact_get_POP_MPLS(a)->ethertype)); - break; +/* Returns true if any action in the 'ofpacts_len' bytes of 'ofpacts' outputs + * to 'group', false otherwise. */ +bool +ofpacts_output_to_group(const struct ofpact *ofpacts, size_t ofpacts_len, + uint32_t group_id) +{ + const struct ofpact *a; - case OFPACT_EXIT: - ds_put_cstr(s, "exit"); - break; + OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { + if (a->type == OFPACT_GROUP + && ofpact_get_GROUP(a)->group_id == group_id) { + return true; + } + } - case OFPACT_SAMPLE: - sample = ofpact_get_SAMPLE(a); - ds_put_format( - s, "sample(probability=%"PRIu16",collector_set_id=%"PRIu32 - ",obs_domain_id=%"PRIu32",obs_point_id=%"PRIu32")", - sample->probability, sample->collector_set_id, - sample->obs_domain_id, sample->obs_point_id); - break; + return false; +} - case OFPACT_WRITE_ACTIONS: { - struct ofpact_nest *on = ofpact_get_WRITE_ACTIONS(a); - ds_put_format(s, "%s(", - ovs_instruction_name_from_type( - OVSINST_OFPIT11_WRITE_ACTIONS)); - ofpacts_format(on->actions, ofpact_nest_get_action_len(on), s); - ds_put_char(s, ')'); - break; - } +bool +ofpacts_equal(const struct ofpact *a, size_t a_len, + const struct ofpact *b, size_t b_len) +{ + return a_len == b_len && !memcmp(a, b, a_len); +} - case OFPACT_CLEAR_ACTIONS: - ds_put_format(s, "%s", - ovs_instruction_name_from_type( - OVSINST_OFPIT11_CLEAR_ACTIONS)); - break; +/* Finds the OFPACT_METER action, if any, in the 'ofpacts_len' bytes of + * 'ofpacts'. If found, returns its meter ID; if not, returns 0. + * + * This function relies on the order of 'ofpacts' being correct (as checked by + * ofpacts_verify()). */ +uint32_t +ofpacts_get_meter(const struct ofpact ofpacts[], size_t ofpacts_len) +{ + const struct ofpact *a; - case OFPACT_WRITE_METADATA: - metadata = ofpact_get_WRITE_METADATA(a); - ds_put_format(s, "%s:%#"PRIx64, - ovs_instruction_name_from_type( - OVSINST_OFPIT11_WRITE_METADATA), - ntohll(metadata->metadata)); - if (metadata->mask != OVS_BE64_MAX) { - ds_put_format(s, "/%#"PRIx64, ntohll(metadata->mask)); - } - break; + OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { + enum ovs_instruction_type inst; - case OFPACT_GOTO_TABLE: - ds_put_format(s, "%s:%"PRIu8, - ovs_instruction_name_from_type( - OVSINST_OFPIT11_GOTO_TABLE), - ofpact_get_GOTO_TABLE(a)->table_id); - break; + inst = ovs_instruction_type_from_ofpact_type(a->type); + if (a->type == OFPACT_METER) { + return ofpact_get_METER(a)->meter_id; + } else if (inst > OVSINST_OFPIT13_METER) { + break; + } + } - case OFPACT_METER: - ds_put_format(s, "%s:%"PRIu32, - ovs_instruction_name_from_type(OVSINST_OFPIT13_METER), - ofpact_get_METER(a)->meter_id); - break; + return 0; +} + +/* Formatting ofpacts. */ - case OFPACT_GROUP: - ds_put_format(s, "group:%"PRIu32, - ofpact_get_GROUP(a)->group_id); - break; +static void +ofpact_format(const struct ofpact *a, struct ds *s) +{ + switch (a->type) { +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ + case OFPACT_##ENUM: \ + format_##ENUM(ALIGNED_CAST(const struct STRUCT *, a), s); \ + break; + OFPACTS +#undef OFPACT + default: + OVS_NOT_REACHED(); } } @@ -3609,7 +6176,8 @@ struct ofpact *ofpact; ofpact_pad(ofpacts); - ofpact = ofpacts->frame = ofpbuf_put_uninit(ofpacts, len); + ofpacts->header = ofpbuf_put_uninit(ofpacts, len); + ofpact = ofpacts->header; ofpact_init(ofpact, type, len); return ofpact; } @@ -3619,7 +6187,7 @@ { memset(ofpact, 0, len); ofpact->type = type; - ofpact->compat = OFPUTIL_ACTION_INVALID; + ofpact->raw = -1; ofpact->len = len; } @@ -3632,7 +6200,7 @@ void ofpact_update_len(struct ofpbuf *ofpacts, struct ofpact *ofpact) { - ovs_assert(ofpact == ofpacts->frame); + ovs_assert(ofpact == ofpacts->header); ofpact->len = (char *) ofpbuf_tail(ofpacts) - (char *) ofpact; } @@ -3649,8 +6217,509 @@ void ofpact_pad(struct ofpbuf *ofpacts) { - unsigned int pad = PAD_SIZE(ofpbuf_size(ofpacts), OFPACT_ALIGNTO); + unsigned int pad = PAD_SIZE(ofpacts->size, OFPACT_ALIGNTO); if (pad) { ofpbuf_put_zeros(ofpacts, pad); } } + + + + +static char * OVS_WARN_UNUSED_RESULT +ofpact_parse(enum ofpact_type type, char *value, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) +{ + switch (type) { +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ + case OFPACT_##ENUM: \ + return parse_##ENUM(value, ofpacts, usable_protocols); + OFPACTS +#undef OFPACT + default: + OVS_NOT_REACHED(); + } +} + +static bool +ofpact_type_from_name(const char *name, enum ofpact_type *type) +{ +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ + if (!strcasecmp(name, NAME)) { \ + *type = OFPACT_##ENUM; \ + return true; \ + } + OFPACTS +#undef OFPACT + + return false; +} + +/* Parses 'str' as a series of instructions, and appends them to 'ofpacts'. + * + * Returns NULL if successful, otherwise a malloc()'d string describing the + * error. The caller is responsible for freeing the returned string. */ +static char * OVS_WARN_UNUSED_RESULT +ofpacts_parse__(char *str, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols, + bool allow_instructions) +{ + int prev_inst = -1; + enum ofperr retval; + char *key, *value; + bool drop = false; + char *pos; + + pos = str; + while (ofputil_parse_key_value(&pos, &key, &value)) { + enum ovs_instruction_type inst = OVSINST_OFPIT11_APPLY_ACTIONS; + enum ofpact_type type; + char *error = NULL; + ofp_port_t port; + + if (ofpact_type_from_name(key, &type)) { + error = ofpact_parse(type, value, ofpacts, usable_protocols); + inst = ovs_instruction_type_from_ofpact_type(type); + } else if (!strcasecmp(key, "mod_vlan_vid")) { + error = parse_set_vlan_vid(value, ofpacts, true); + } else if (!strcasecmp(key, "mod_vlan_pcp")) { + error = parse_set_vlan_pcp(value, ofpacts, true); + } else if (!strcasecmp(key, "set_nw_ttl")) { + error = parse_SET_IP_TTL(value, ofpacts, usable_protocols); + } else if (!strcasecmp(key, "pop_vlan")) { + error = parse_pop_vlan(ofpacts); + } else if (!strcasecmp(key, "set_tunnel64")) { + error = parse_set_tunnel(value, ofpacts, + NXAST_RAW_SET_TUNNEL64); + } else if (!strcasecmp(key, "load")) { + error = parse_reg_load(value, ofpacts); + } else if (!strcasecmp(key, "bundle_load")) { + error = parse_bundle_load(value, ofpacts); + } else if (!strcasecmp(key, "drop")) { + drop = true; + } else if (!strcasecmp(key, "apply_actions")) { + return xstrdup("apply_actions is the default instruction"); + } else if (ofputil_port_from_string(key, &port)) { + ofpact_put_OUTPUT(ofpacts)->port = port; + } else { + return xasprintf("unknown action %s", key); + } + if (error) { + return error; + } + + if (inst != OVSINST_OFPIT11_APPLY_ACTIONS) { + if (!allow_instructions) { + return xasprintf("only actions are allowed here (not " + "instruction %s)", + ovs_instruction_name_from_type(inst)); + } + if (inst == prev_inst) { + return xasprintf("instruction %s may be specified only once", + ovs_instruction_name_from_type(inst)); + } + } + if (prev_inst != -1 && inst < prev_inst) { + return xasprintf("instruction %s must be specified before %s", + ovs_instruction_name_from_type(inst), + ovs_instruction_name_from_type(prev_inst)); + } + prev_inst = inst; + } + ofpact_pad(ofpacts); + + if (drop && ofpacts->size) { + return xstrdup("\"drop\" must not be accompanied by any other action " + "or instruction"); + } + + retval = ofpacts_verify(ofpacts->data, ofpacts->size, + (allow_instructions + ? (1u << N_OVS_INSTRUCTIONS) - 1 + : 1u << OVSINST_OFPIT11_APPLY_ACTIONS)); + if (retval) { + return xstrdup("Incorrect instruction ordering"); + } + + return NULL; +} + +static char * OVS_WARN_UNUSED_RESULT +ofpacts_parse(char *str, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols, bool allow_instructions) +{ + uint32_t orig_size = ofpacts->size; + char *error = ofpacts_parse__(str, ofpacts, usable_protocols, + allow_instructions); + if (error) { + ofpacts->size = orig_size; + } + return error; +} + +static char * OVS_WARN_UNUSED_RESULT +ofpacts_parse_copy(const char *s_, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols, + bool allow_instructions) +{ + char *error, *s; + + *usable_protocols = OFPUTIL_P_ANY; + + s = xstrdup(s_); + error = ofpacts_parse(s, ofpacts, usable_protocols, allow_instructions); + free(s); + + return error; +} + +/* Parses 's' as a set of OpenFlow actions and appends the actions to + * 'ofpacts'. + * + * Returns NULL if successful, otherwise a malloc()'d string describing the + * error. The caller is responsible for freeing the returned string. */ +char * OVS_WARN_UNUSED_RESULT +ofpacts_parse_actions(const char *s, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) +{ + return ofpacts_parse_copy(s, ofpacts, usable_protocols, false); +} + +/* Parses 's' as a set of OpenFlow instructions and appends the instructions to + * 'ofpacts'. + * + * Returns NULL if successful, otherwise a malloc()'d string describing the + * error. The caller is responsible for freeing the returned string. */ +char * OVS_WARN_UNUSED_RESULT +ofpacts_parse_instructions(const char *s, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) +{ + return ofpacts_parse_copy(s, ofpacts, usable_protocols, true); +} + +const char * +ofpact_name(enum ofpact_type type) +{ + switch (type) { +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) case OFPACT_##ENUM: return NAME; + OFPACTS +#undef OFPACT + } + return ""; +} + +/* Low-level action decoding and encoding functions. */ + +/* Everything needed to identify a particular OpenFlow action. */ +struct ofpact_hdrs { + uint32_t vendor; /* 0 if standard, otherwise a vendor code. */ + uint16_t type; /* Type if standard, otherwise subtype. */ + uint8_t ofp_version; /* From ofp_header. */ +}; + +/* Information about a particular OpenFlow action. */ +struct ofpact_raw_instance { + /* The action's identity. */ + struct ofpact_hdrs hdrs; + enum ofp_raw_action_type raw; + + /* Looking up the action. */ + struct hmap_node decode_node; /* Based on 'hdrs'. */ + struct hmap_node encode_node; /* Based on 'raw' + 'hdrs.ofp_version'. */ + + /* The action's encoded size. + * + * If this action is fixed-length, 'min_length' == 'max_length'. + * If it is variable length, then 'max_length' is ROUND_DOWN(UINT16_MAX, + * OFP_ACTION_ALIGN) == 65528. */ + unsigned short int min_length; + unsigned short int max_length; + + /* For actions with a simple integer numeric argument, 'arg_ofs' is the + * offset of that argument from the beginning of the action and 'arg_len' + * its length, both in bytes. + * + * For actions that take other forms, these are both zero. */ + unsigned short int arg_ofs; + unsigned short int arg_len; + + /* The name of the action, e.g. "OFPAT_OUTPUT" or "NXAST_RESUBMIT". */ + const char *name; + + /* If this action is deprecated, a human-readable string with a brief + * explanation. */ + const char *deprecation; +}; + +/* Action header. */ +struct ofp_action_header { + /* The meaning of other values of 'type' generally depends on the OpenFlow + * version (see enum ofp_raw_action_type). + * + * Across all OpenFlow versions, OFPAT_VENDOR indicates that 'vendor' + * designates an OpenFlow vendor ID and that the remainder of the action + * structure has a vendor-defined meaning. + */ +#define OFPAT_VENDOR 0xffff + ovs_be16 type; + + /* Always a multiple of 8. */ + ovs_be16 len; + + /* For type == OFPAT_VENDOR only, this is a vendor ID, e.g. NX_VENDOR_ID or + * ONF_VENDOR_ID. Other 'type's use this space for some other purpose. */ + ovs_be32 vendor; +}; +OFP_ASSERT(sizeof(struct ofp_action_header) == 8); + +/* Header for Nicira-defined actions and for ONF vendor extensions. + * + * This cannot be used as an entirely generic vendor extension action header, + * because OpenFlow does not specify the location or size of the action + * subtype; it just happens that ONF extensions and Nicira extensions share + * this format. */ +struct ext_action_header { + ovs_be16 type; /* OFPAT_VENDOR. */ + ovs_be16 len; /* At least 16. */ + ovs_be32 vendor; /* NX_VENDOR_ID or ONF_VENDOR_ID. */ + ovs_be16 subtype; /* See enum ofp_raw_action_type. */ + uint8_t pad[6]; +}; +OFP_ASSERT(sizeof(struct ext_action_header) == 16); + +static bool +ofpact_hdrs_equal(const struct ofpact_hdrs *a, + const struct ofpact_hdrs *b) +{ + return (a->vendor == b->vendor + && a->type == b->type + && a->ofp_version == b->ofp_version); +} + +static uint32_t +ofpact_hdrs_hash(const struct ofpact_hdrs *hdrs) +{ + return hash_2words(hdrs->vendor, (hdrs->type << 16) | hdrs->ofp_version); +} + +#include "ofp-actions.inc2" + +static struct hmap * +ofpact_decode_hmap(void) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + static struct hmap hmap; + + if (ovsthread_once_start(&once)) { + struct ofpact_raw_instance *inst; + + hmap_init(&hmap); + for (inst = all_raw_instances; + inst < &all_raw_instances[ARRAY_SIZE(all_raw_instances)]; + inst++) { + hmap_insert(&hmap, &inst->decode_node, + ofpact_hdrs_hash(&inst->hdrs)); + } + ovsthread_once_done(&once); + } + return &hmap; +} + +static struct hmap * +ofpact_encode_hmap(void) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + static struct hmap hmap; + + if (ovsthread_once_start(&once)) { + struct ofpact_raw_instance *inst; + + hmap_init(&hmap); + for (inst = all_raw_instances; + inst < &all_raw_instances[ARRAY_SIZE(all_raw_instances)]; + inst++) { + hmap_insert(&hmap, &inst->encode_node, + hash_2words(inst->raw, inst->hdrs.ofp_version)); + } + ovsthread_once_done(&once); + } + return &hmap; +} + +static enum ofperr +ofpact_decode_raw(enum ofp_version ofp_version, + const struct ofp_action_header *oah, size_t length, + const struct ofpact_raw_instance **instp) +{ + const struct ofpact_raw_instance *inst; + struct ofpact_hdrs hdrs; + + *instp = NULL; + if (length < sizeof *oah) { + return OFPERR_OFPBAC_BAD_LEN; + } + + /* Get base action type. */ + if (oah->type == htons(OFPAT_VENDOR)) { + /* Get vendor. */ + hdrs.vendor = ntohl(oah->vendor); + if (hdrs.vendor == NX_VENDOR_ID || hdrs.vendor == ONF_VENDOR_ID) { + /* Get extension subtype. */ + const struct ext_action_header *nah; + + nah = ALIGNED_CAST(const struct ext_action_header *, oah); + if (length < sizeof *nah) { + return OFPERR_OFPBAC_BAD_LEN; + } + hdrs.type = ntohs(nah->subtype); + } else { + VLOG_WARN_RL(&rl, "OpenFlow action has unknown vendor %#"PRIx32, + hdrs.vendor); + return OFPERR_OFPBAC_BAD_VENDOR; + } + } else { + hdrs.vendor = 0; + hdrs.type = ntohs(oah->type); + } + + hdrs.ofp_version = ofp_version; + HMAP_FOR_EACH_WITH_HASH (inst, decode_node, ofpact_hdrs_hash(&hdrs), + ofpact_decode_hmap()) { + if (ofpact_hdrs_equal(&hdrs, &inst->hdrs)) { + *instp = inst; + return 0; + } + } + + return (hdrs.vendor + ? OFPERR_OFPBAC_BAD_VENDOR_TYPE + : OFPERR_OFPBAC_BAD_TYPE); +} + +static enum ofperr +ofpact_pull_raw(struct ofpbuf *buf, enum ofp_version ofp_version, + enum ofp_raw_action_type *raw, uint64_t *arg) +{ + const struct ofp_action_header *oah = buf->data; + const struct ofpact_raw_instance *action; + unsigned int length; + enum ofperr error; + + *raw = *arg = 0; + error = ofpact_decode_raw(ofp_version, oah, buf->size, &action); + if (error) { + return error; + } + + if (action->deprecation) { + VLOG_INFO_RL(&rl, "%s is deprecated in %s (%s)", + action->name, ofputil_version_to_string(ofp_version), + action->deprecation); + } + + length = ntohs(oah->len); + if (length > buf->size) { + VLOG_WARN_RL(&rl, "OpenFlow action %s length %u exceeds action buffer " + "length %"PRIu32, action->name, length, buf->size); + return OFPERR_OFPBAC_BAD_LEN; + } + if (length < action->min_length || length > action->max_length) { + VLOG_WARN_RL(&rl, "OpenFlow action %s length %u not in valid range " + "[%hu,%hu]", action->name, length, + action->min_length, action->max_length); + return OFPERR_OFPBAC_BAD_LEN; + } + if (length % 8) { + VLOG_WARN_RL(&rl, "OpenFlow action %s length %u is not a multiple " + "of 8", action->name, length); + return OFPERR_OFPBAC_BAD_LEN; + } + + *raw = action->raw; + *arg = 0; + if (action->arg_len) { + const uint8_t *p; + int i; + + p = ofpbuf_at_assert(buf, action->arg_ofs, action->arg_len); + for (i = 0; i < action->arg_len; i++) { + *arg = (*arg << 8) | p[i]; + } + } + + ofpbuf_pull(buf, length); + + return 0; +} + +static const struct ofpact_raw_instance * +ofpact_raw_lookup(enum ofp_version ofp_version, enum ofp_raw_action_type raw) +{ + const struct ofpact_raw_instance *inst; + + HMAP_FOR_EACH_WITH_HASH (inst, encode_node, hash_2words(raw, ofp_version), + ofpact_encode_hmap()) { + if (inst->raw == raw && inst->hdrs.ofp_version == ofp_version) { + return inst; + } + } + OVS_NOT_REACHED(); +} + +static void * +ofpact_put_raw(struct ofpbuf *buf, enum ofp_version ofp_version, + enum ofp_raw_action_type raw, uint64_t arg) +{ + const struct ofpact_raw_instance *inst; + struct ofp_action_header *oah; + const struct ofpact_hdrs *hdrs; + + inst = ofpact_raw_lookup(ofp_version, raw); + hdrs = &inst->hdrs; + + oah = ofpbuf_put_zeros(buf, inst->min_length); + oah->type = htons(hdrs->vendor ? OFPAT_VENDOR : hdrs->type); + oah->len = htons(inst->min_length); + oah->vendor = htonl(hdrs->vendor); + + switch (hdrs->vendor) { + case 0: + break; + + case NX_VENDOR_ID: + case ONF_VENDOR_ID: { + struct ext_action_header *nah = (struct ext_action_header *) oah; + nah->subtype = htons(hdrs->type); + break; + } + + default: + OVS_NOT_REACHED(); + } + + if (inst->arg_len) { + uint8_t *p = (uint8_t *) oah + inst->arg_ofs + inst->arg_len; + int i; + + for (i = 0; i < inst->arg_len; i++) { + *--p = arg; + arg >>= 8; + } + } else { + ovs_assert(!arg); + } + + return oah; +} + +static void +pad_ofpat(struct ofpbuf *openflow, size_t start_ofs) +{ + struct ofp_action_header *oah; + + ofpbuf_put_zeros(openflow, PAD_SIZE(openflow->size - start_ofs, 8)); + + oah = ofpbuf_at_assert(openflow, start_ofs, sizeof *oah); + oah->len = htons(openflow->size - start_ofs); +} + diff -Nru openvswitch-2.3.1/lib/ofp-actions.h openvswitch-2.4.0~git20150623/lib/ofp-actions.h --- openvswitch-2.3.1/lib/ofp-actions.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-actions.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ * This macro is used directly only internally by this header, but the list is * still of interest to developers. * - * Each DEFINE_OFPACT invocation has the following parameters: + * Each OFPACT invocation has the following parameters: * * 1. , used below in the enum definition of OFPACT_, and * elsewhere. @@ -48,81 +48,84 @@ * * - If "struct " is variable-length, it must be the name of the * flexible array member. + * + * 4. , a quoted string that gives the name of the action, for use in + * parsing actions from text. */ -#define OFPACTS \ - /* Output. */ \ - DEFINE_OFPACT(OUTPUT, ofpact_output, ofpact) \ - DEFINE_OFPACT(GROUP, ofpact_group, ofpact) \ - DEFINE_OFPACT(CONTROLLER, ofpact_controller, ofpact) \ - DEFINE_OFPACT(ENQUEUE, ofpact_enqueue, ofpact) \ - DEFINE_OFPACT(OUTPUT_REG, ofpact_output_reg, ofpact) \ - DEFINE_OFPACT(BUNDLE, ofpact_bundle, slaves) \ - \ - /* Header changes. */ \ - DEFINE_OFPACT(SET_FIELD, ofpact_set_field, ofpact) \ - DEFINE_OFPACT(SET_VLAN_VID, ofpact_vlan_vid, ofpact) \ - DEFINE_OFPACT(SET_VLAN_PCP, ofpact_vlan_pcp, ofpact) \ - DEFINE_OFPACT(STRIP_VLAN, ofpact_null, ofpact) \ - DEFINE_OFPACT(PUSH_VLAN, ofpact_null, ofpact) \ - DEFINE_OFPACT(SET_ETH_SRC, ofpact_mac, ofpact) \ - DEFINE_OFPACT(SET_ETH_DST, ofpact_mac, ofpact) \ - DEFINE_OFPACT(SET_IPV4_SRC, ofpact_ipv4, ofpact) \ - DEFINE_OFPACT(SET_IPV4_DST, ofpact_ipv4, ofpact) \ - DEFINE_OFPACT(SET_IP_DSCP, ofpact_dscp, ofpact) \ - DEFINE_OFPACT(SET_IP_ECN, ofpact_ecn, ofpact) \ - DEFINE_OFPACT(SET_IP_TTL, ofpact_ip_ttl, ofpact) \ - DEFINE_OFPACT(SET_L4_SRC_PORT, ofpact_l4_port, ofpact) \ - DEFINE_OFPACT(SET_L4_DST_PORT, ofpact_l4_port, ofpact) \ - DEFINE_OFPACT(REG_MOVE, ofpact_reg_move, ofpact) \ - DEFINE_OFPACT(REG_LOAD, ofpact_reg_load, ofpact) \ - DEFINE_OFPACT(STACK_PUSH, ofpact_stack, ofpact) \ - DEFINE_OFPACT(STACK_POP, ofpact_stack, ofpact) \ - DEFINE_OFPACT(DEC_TTL, ofpact_cnt_ids, cnt_ids) \ - DEFINE_OFPACT(SET_MPLS_LABEL, ofpact_mpls_label, ofpact) \ - DEFINE_OFPACT(SET_MPLS_TC, ofpact_mpls_tc, ofpact) \ - DEFINE_OFPACT(SET_MPLS_TTL, ofpact_mpls_ttl, ofpact) \ - DEFINE_OFPACT(DEC_MPLS_TTL, ofpact_null, ofpact) \ - DEFINE_OFPACT(PUSH_MPLS, ofpact_push_mpls, ofpact) \ - DEFINE_OFPACT(POP_MPLS, ofpact_pop_mpls, ofpact) \ - \ - /* Metadata. */ \ - DEFINE_OFPACT(SET_TUNNEL, ofpact_tunnel, ofpact) \ - DEFINE_OFPACT(SET_QUEUE, ofpact_queue, ofpact) \ - DEFINE_OFPACT(POP_QUEUE, ofpact_null, ofpact) \ - DEFINE_OFPACT(FIN_TIMEOUT, ofpact_fin_timeout, ofpact) \ - \ - /* Flow table interaction. */ \ - DEFINE_OFPACT(RESUBMIT, ofpact_resubmit, ofpact) \ - DEFINE_OFPACT(LEARN, ofpact_learn, specs) \ - \ - /* Arithmetic. */ \ - DEFINE_OFPACT(MULTIPATH, ofpact_multipath, ofpact) \ - \ - /* Other. */ \ - DEFINE_OFPACT(NOTE, ofpact_note, data) \ - DEFINE_OFPACT(EXIT, ofpact_null, ofpact) \ - DEFINE_OFPACT(SAMPLE, ofpact_sample, ofpact) \ - \ - /* Instructions */ \ - DEFINE_OFPACT(METER, ofpact_meter, ofpact) \ - DEFINE_OFPACT(CLEAR_ACTIONS, ofpact_null, ofpact) \ - DEFINE_OFPACT(WRITE_ACTIONS, ofpact_nest, ofpact) \ - DEFINE_OFPACT(WRITE_METADATA, ofpact_metadata, ofpact) \ - DEFINE_OFPACT(GOTO_TABLE, ofpact_goto_table, ofpact) +#define OFPACTS \ + /* Output. */ \ + OFPACT(OUTPUT, ofpact_output, ofpact, "output") \ + OFPACT(GROUP, ofpact_group, ofpact, "group") \ + OFPACT(CONTROLLER, ofpact_controller, ofpact, "controller") \ + OFPACT(ENQUEUE, ofpact_enqueue, ofpact, "enqueue") \ + OFPACT(OUTPUT_REG, ofpact_output_reg, ofpact, "output_reg") \ + OFPACT(BUNDLE, ofpact_bundle, slaves, "bundle") \ + \ + /* Header changes. */ \ + OFPACT(SET_FIELD, ofpact_set_field, ofpact, "set_field") \ + OFPACT(SET_VLAN_VID, ofpact_vlan_vid, ofpact, "set_vlan_vid") \ + OFPACT(SET_VLAN_PCP, ofpact_vlan_pcp, ofpact, "set_vlan_pcp") \ + OFPACT(STRIP_VLAN, ofpact_null, ofpact, "strip_vlan") \ + OFPACT(PUSH_VLAN, ofpact_null, ofpact, "push_vlan") \ + OFPACT(SET_ETH_SRC, ofpact_mac, ofpact, "mod_dl_src") \ + OFPACT(SET_ETH_DST, ofpact_mac, ofpact, "mod_dl_dst") \ + OFPACT(SET_IPV4_SRC, ofpact_ipv4, ofpact, "mod_nw_src") \ + OFPACT(SET_IPV4_DST, ofpact_ipv4, ofpact, "mod_nw_dst") \ + OFPACT(SET_IP_DSCP, ofpact_dscp, ofpact, "mod_nw_tos") \ + OFPACT(SET_IP_ECN, ofpact_ecn, ofpact, "mod_nw_ecn") \ + OFPACT(SET_IP_TTL, ofpact_ip_ttl, ofpact, "mod_nw_ttl") \ + OFPACT(SET_L4_SRC_PORT, ofpact_l4_port, ofpact, "mod_tp_src") \ + OFPACT(SET_L4_DST_PORT, ofpact_l4_port, ofpact, "mod_tp_dst") \ + OFPACT(REG_MOVE, ofpact_reg_move, ofpact, "move") \ + OFPACT(STACK_PUSH, ofpact_stack, ofpact, "push") \ + OFPACT(STACK_POP, ofpact_stack, ofpact, "pop") \ + OFPACT(DEC_TTL, ofpact_cnt_ids, cnt_ids, "dec_ttl") \ + OFPACT(SET_MPLS_LABEL, ofpact_mpls_label, ofpact, "set_mpls_label") \ + OFPACT(SET_MPLS_TC, ofpact_mpls_tc, ofpact, "set_mpls_tc") \ + OFPACT(SET_MPLS_TTL, ofpact_mpls_ttl, ofpact, "set_mpls_ttl") \ + OFPACT(DEC_MPLS_TTL, ofpact_null, ofpact, "dec_mpls_ttl") \ + OFPACT(PUSH_MPLS, ofpact_push_mpls, ofpact, "push_mpls") \ + OFPACT(POP_MPLS, ofpact_pop_mpls, ofpact, "pop_mpls") \ + \ + /* Metadata. */ \ + OFPACT(SET_TUNNEL, ofpact_tunnel, ofpact, "set_tunnel") \ + OFPACT(SET_QUEUE, ofpact_queue, ofpact, "set_queue") \ + OFPACT(POP_QUEUE, ofpact_null, ofpact, "pop_queue") \ + OFPACT(FIN_TIMEOUT, ofpact_fin_timeout, ofpact, "fin_timeout") \ + \ + /* Flow table interaction. */ \ + OFPACT(RESUBMIT, ofpact_resubmit, ofpact, "resubmit") \ + OFPACT(LEARN, ofpact_learn, specs, "learn") \ + OFPACT(CONJUNCTION, ofpact_conjunction, ofpact, "conjunction") \ + \ + /* Arithmetic. */ \ + OFPACT(MULTIPATH, ofpact_multipath, ofpact, "multipath") \ + \ + /* Other. */ \ + OFPACT(NOTE, ofpact_note, data, "note") \ + OFPACT(EXIT, ofpact_null, ofpact, "exit") \ + OFPACT(SAMPLE, ofpact_sample, ofpact, "sample") \ + OFPACT(UNROLL_XLATE, ofpact_unroll_xlate, ofpact, "unroll_xlate") \ + \ + /* Instructions. */ \ + OFPACT(METER, ofpact_meter, ofpact, "meter") \ + OFPACT(CLEAR_ACTIONS, ofpact_null, ofpact, "clear_actions") \ + OFPACT(WRITE_ACTIONS, ofpact_nest, ofpact, "write_actions") \ + OFPACT(WRITE_METADATA, ofpact_metadata, ofpact, "write_metadata") \ + OFPACT(GOTO_TABLE, ofpact_goto_table, ofpact, "goto_table") /* enum ofpact_type, with a member OFPACT_ for each action. */ enum OVS_PACKED_ENUM ofpact_type { -#define DEFINE_OFPACT(ENUM, STRUCT, MEMBER) OFPACT_##ENUM, +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) OFPACT_##ENUM, OFPACTS -#undef DEFINE_OFPACT +#undef OFPACT }; -/* N_OFPACTS, the number of values of "enum ofpact_type". */ +/* Define N_OFPACTS to the number of types of ofpacts. */ enum { - N_OFPACTS = -#define DEFINE_OFPACT(ENUM, STRUCT, MEMBER) + 1 - OFPACTS -#undef DEFINE_OFPACT +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) + 1 + N_OFPACTS = OFPACTS +#undef OFPACT }; /* Header for an action. @@ -131,14 +134,14 @@ * ofpact", usually followed by other data that describes the action. Actions * are padded out to a multiple of OFPACT_ALIGNTO bytes in length. * - * The 'compat' member is special: + * The 'raw' member is special: * * - Most "struct ofpact"s correspond to one particular kind of OpenFlow * action, at least in a given OpenFlow version. For example, * OFPACT_SET_VLAN_VID corresponds to OFPAT10_SET_VLAN_VID in OpenFlow * 1.0. * - * For such actions, the 'compat' member is not meaningful and generally + * For such actions, the 'raw' member is not meaningful and generally * should be zero. * * - A few "struct ofpact"s correspond to multiple OpenFlow actions. For @@ -149,22 +152,26 @@ * (Otherwise, we'd violate the promise made in DESIGN, in the "Action * Reproduction" section.) * - * For such actions, the 'compat' member should be the original action - * type. (If the action didn't originate from OpenFlow, then setting - * 'compat' to zero should be fine: code to translate the ofpact to - * OpenFlow must tolerate this case.) + * For such actions, the 'raw' member should be the "enum ofp_raw_action" + * originally extracted from the OpenFlow action. (If the action didn't + * originate from OpenFlow, then setting 'raw' to zero should be fine: + * code to translate the ofpact to OpenFlow must tolerate this case.) */ struct ofpact { + /* We want the space advantage of an 8-bit type here on every + * implementation, without giving up the advantage of having a useful type + * on implementations that support packed enums. */ +#ifdef HAVE_PACKED_ENUM enum ofpact_type type; /* OFPACT_*. */ - enum ofputil_action_code compat; /* Original type when added, if any. */ +#else + uint8_t type; /* OFPACT_* */ +#endif + + uint8_t raw; /* Original type when added, if any. */ uint16_t len; /* Length of the action, in bytes, including * struct ofpact, excluding padding. */ }; - -#ifdef __GNUC__ -/* Make sure that OVS_PACKED_ENUM really worked. */ BUILD_ASSERT_DECL(sizeof(struct ofpact) == 4); -#endif /* Alignment. */ #define OFPACT_ALIGNTO 8 @@ -238,6 +245,29 @@ struct mf_subfield src; }; +/* Bundle slave choice algorithm to apply. + * + * In the descriptions below, 'slaves' is the list of possible slaves in the + * order they appear in the OpenFlow action. */ +enum nx_bd_algorithm { + /* Chooses the first live slave listed in the bundle. + * + * O(n_slaves) performance. */ + NX_BD_ALG_ACTIVE_BACKUP = 0, + + /* Highest Random Weight. + * + * for i in [0,n_slaves): + * weights[i] = hash(flow, i) + * slave = { slaves[i] such that weights[i] >= weights[j] for all j != i } + * + * Redistributes 1/n_slaves of traffic when a slave's liveness changes. + * O(n_slaves) performance. + * + * Uses the 'fields' and 'basis' parameters. */ + NX_BD_ALG_HRW = 1 +}; + /* OFPACT_BUNDLE. * * Used for NXAST_BUNDLE. */ @@ -354,23 +384,15 @@ struct mf_subfield subfield; }; -/* OFPACT_REG_LOAD. - * - * Used for NXAST_REG_LOAD. */ -struct ofpact_reg_load { - struct ofpact ofpact; - struct mf_subfield dst; - union mf_subvalue subvalue; /* Least-significant bits are used. */ -}; - /* OFPACT_SET_FIELD. * - * Used for OFPAT12_SET_FIELD. */ + * Used for NXAST_REG_LOAD and OFPAT12_SET_FIELD. */ struct ofpact_set_field { struct ofpact ofpact; const struct mf_field *field; bool flow_has_vlan; /* VLAN present at action validation time. */ union mf_value value; + union mf_value mask; }; /* OFPACT_PUSH_VLAN/MPLS/PBB @@ -440,6 +462,8 @@ struct ofpact actions[]; }; BUILD_ASSERT_DECL(offsetof(struct ofpact_nest, actions) % OFPACT_ALIGNTO == 0); +BUILD_ASSERT_DECL(offsetof(struct ofpact_nest, actions) + == sizeof(struct ofpact_nest)); static inline size_t ofpact_nest_get_action_len(const struct ofpact_nest *on) @@ -471,6 +495,51 @@ struct mf_subfield dst; /* NX_LEARN_DST_MATCH, NX_LEARN_DST_LOAD only. */ }; + +/* Bits for 'flags' in struct nx_action_learn. + * + * If NX_LEARN_F_SEND_FLOW_REM is set, then the learned flows will have their + * OFPFF_SEND_FLOW_REM flag set. + * + * If NX_LEARN_F_DELETE_LEARNED is set, then removing this action will delete + * all the flows from the learn action's 'table_id' that have the learn + * action's 'cookie'. Important points: + * + * - The deleted flows include those created by this action, those created + * by other learn actions with the same 'table_id' and 'cookie', those + * created by flow_mod requests by a controller in the specified table + * with the specified cookie, and those created through any other + * means. + * + * - If multiple flows specify "learn" actions with + * NX_LEARN_F_DELETE_LEARNED with the same 'table_id' and 'cookie', then + * no deletion occurs until all of those "learn" actions are deleted. + * + * - Deleting a flow that contains a learn action is the most obvious way + * to delete a learn action. Modifying a flow's actions, or replacing it + * by a new flow, can also delete a learn action. Finally, replacing a + * learn action with NX_LEARN_F_DELETE_LEARNED with a learn action + * without that flag also effectively deletes the learn action and can + * trigger flow deletion. + * + * NX_LEARN_F_DELETE_LEARNED was added in Open vSwitch 2.4. */ +enum nx_learn_flags { + NX_LEARN_F_SEND_FLOW_REM = 1 << 0, + NX_LEARN_F_DELETE_LEARNED = 1 << 1, +}; + +#define NX_LEARN_N_BITS_MASK 0x3ff + +#define NX_LEARN_SRC_FIELD (0 << 13) /* Copy from field. */ +#define NX_LEARN_SRC_IMMEDIATE (1 << 13) /* Copy from immediate value. */ +#define NX_LEARN_SRC_MASK (1 << 13) + +#define NX_LEARN_DST_MATCH (0 << 11) /* Add match criterion. */ +#define NX_LEARN_DST_LOAD (1 << 11) /* Add NXAST_REG_LOAD action. */ +#define NX_LEARN_DST_OUTPUT (2 << 11) /* Add OFPAT_OUTPUT action. */ +#define NX_LEARN_DST_RESERVED (3 << 11) /* Not yet defined. */ +#define NX_LEARN_DST_MASK (3 << 11) + /* OFPACT_LEARN. * * Used for NXAST_LEARN. */ @@ -481,8 +550,8 @@ uint16_t hard_timeout; /* Max time before discarding (seconds). */ uint16_t priority; /* Priority level of flow entry. */ uint8_t table_id; /* Table to insert flow entry. */ - uint64_t cookie; /* Cookie for new flow. */ - enum ofputil_flow_mod_flags flags; + ovs_be64 cookie; /* Cookie for new flow. */ + enum nx_learn_flags flags; /* NX_LEARN_F_*. */ uint16_t fin_idle_timeout; /* Idle timeout after FIN, if nonzero. */ uint16_t fin_hard_timeout; /* Hard timeout after FIN, if nonzero. */ @@ -490,6 +559,70 @@ struct ofpact_learn_spec specs[]; }; +/* Multipath link choice algorithm to apply. + * + * In the descriptions below, 'n_links' is max_link + 1. */ +enum nx_mp_algorithm { + /* link = hash(flow) % n_links. + * + * Redistributes all traffic when n_links changes. O(1) performance. See + * RFC 2992. + * + * Use UINT16_MAX for max_link to get a raw hash value. */ + NX_MP_ALG_MODULO_N = 0, + + /* link = hash(flow) / (MAX_HASH / n_links). + * + * Redistributes between one-quarter and one-half of traffic when n_links + * changes. O(1) performance. See RFC 2992. + */ + NX_MP_ALG_HASH_THRESHOLD = 1, + + /* Highest Random Weight. + * + * for i in [0,n_links): + * weights[i] = hash(flow, i) + * link = { i such that weights[i] >= weights[j] for all j != i } + * + * Redistributes 1/n_links of traffic when n_links changes. O(n_links) + * performance. If n_links is greater than a threshold (currently 64, but + * subject to change), Open vSwitch will substitute another algorithm + * automatically. See RFC 2992. */ + NX_MP_ALG_HRW = 2, + + /* Iterative Hash. + * + * i = 0 + * repeat: + * i = i + 1 + * link = hash(flow, i) % arg + * while link > max_link + * + * Redistributes 1/n_links of traffic when n_links changes. O(1) + * performance when arg/max_link is bounded by a constant. + * + * Redistributes all traffic when arg changes. + * + * arg must be greater than max_link and for best performance should be no + * more than approximately max_link * 2. If arg is outside the acceptable + * range, Open vSwitch will automatically substitute the least power of 2 + * greater than max_link. + * + * This algorithm is specific to Open vSwitch. + */ + NX_MP_ALG_ITER_HASH = 3, +}; + +/* OFPACT_CONJUNCTION. + * + * Used for NXAST_CONJUNCTION. */ +struct ofpact_conjunction { + struct ofpact ofpact; + uint8_t clause; + uint8_t n_clauses; + uint32_t id; +}; + /* OFPACT_MULTIPATH. * * Used for NXAST_MULTIPATH. */ @@ -583,6 +716,17 @@ uint32_t group_id; }; +/* OFPACT_UNROLL_XLATE. + * + * Used only internally. */ +struct ofpact_unroll_xlate { + struct ofpact ofpact; + + /* Metadata in xlate context, visible to controller via PACKET_INs. */ + uint8_t rule_table_id; /* 0xFF if none. */ + ovs_be64 rule_cookie; /* OVS_BE64_MAX if none. */ +}; + /* Converting OpenFlow to ofpacts. */ enum ofperr ofpacts_pull_openflow_actions(struct ofpbuf *openflow, unsigned int actions_len, @@ -600,7 +744,6 @@ struct flow *, ofp_port_t max_ports, uint8_t table_id, uint8_t n_tables, enum ofputil_protocol usable_protocols); -enum ofperr ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len); enum ofperr ofpact_check_output_port(ofp_port_t port, ofp_port_t max_ports); /* Converting ofpacts to OpenFlow. */ @@ -611,6 +754,11 @@ struct ofpbuf *openflow, enum ofp_version ofp_version); +/* Sets of supported actions. */ +ovs_be32 ofpact_bitmap_to_openflow(uint64_t ofpacts_bitmap, enum ofp_version); +uint64_t ofpact_bitmap_from_openflow(ovs_be32 ofpat_bitmap, enum ofp_version); +void ofpact_bitmap_format(uint64_t ofpacts_bitmap, struct ds *); + /* Working with ofpacts. */ bool ofpacts_output_to_port(const struct ofpact[], size_t ofpacts_len, ofp_port_t port); @@ -620,10 +768,15 @@ const struct ofpact b[], size_t b_len); uint32_t ofpacts_get_meter(const struct ofpact[], size_t ofpacts_len); -/* Formatting ofpacts. - * - * (For parsing ofpacts, see ofp-parse.h.) */ +/* Formatting and parsing ofpacts. */ void ofpacts_format(const struct ofpact[], size_t ofpacts_len, struct ds *); +char *ofpacts_parse_actions(const char *, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) + OVS_WARN_UNUSED_RESULT; +char *ofpacts_parse_instructions(const char *, struct ofpbuf *ofpacts, + enum ofputil_protocol *usable_protocols) + OVS_WARN_UNUSED_RESULT; +const char *ofpact_name(enum ofpact_type); /* Internal use by the helpers below. */ void ofpact_init(struct ofpact *, enum ofpact_type, size_t len); @@ -667,7 +820,7 @@ * An integer constant, the value of OFPACT__RAW_SIZE rounded up to a * multiple of OFPACT_ALIGNTO. */ -#define DEFINE_OFPACT(ENUM, STRUCT, MEMBER) \ +#define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ BUILD_ASSERT_DECL(offsetof(struct STRUCT, ofpact) == 0); \ \ enum { OFPACT_##ENUM##_RAW_SIZE \ @@ -699,12 +852,15 @@ OFPACT_##ENUM##_RAW_SIZE); \ } OFPACTS -#undef DEFINE_OFPACT +#undef OFPACT /* Functions to use after adding ofpacts to a buffer. */ void ofpact_update_len(struct ofpbuf *, struct ofpact *); void ofpact_pad(struct ofpbuf *); +/* Additional functions for composing ofpacts. */ +struct ofpact_set_field *ofpact_put_reg_load(struct ofpbuf *ofpacts); + /* OpenFlow 1.1 instructions. * The order is sorted in execution order. Not in the value of OFPIT11_xxx. * It is enforced on parser from text string. @@ -753,4 +909,8 @@ enum ofperr ovs_instruction_type_from_inst_type( enum ovs_instruction_type *instruction_type, const uint16_t inst_type); +ovs_be32 ovsinst_bitmap_to_openflow(uint32_t ovsinst_bitmap, enum ofp_version); +uint32_t ovsinst_bitmap_from_openflow(ovs_be32 ofpit_bitmap, + enum ofp_version); + #endif /* ofp-actions.h */ diff -Nru openvswitch-2.3.1/lib/ofpbuf.c openvswitch-2.4.0~git20150623/lib/ofpbuf.c --- openvswitch-2.3.1/lib/ofpbuf.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofpbuf.c 2015-06-23 18:46:21.000000000 +0000 @@ -27,8 +27,8 @@ { b->allocated = allocated; b->source = source; - b->frame = NULL; - b->l2_5_ofs = b->l3_ofs = b->l4_ofs = UINT16_MAX; + b->header = NULL; + b->msg = NULL; list_poison(&b->list_node); } @@ -36,9 +36,9 @@ ofpbuf_use__(struct ofpbuf *b, void *base, size_t allocated, enum ofpbuf_source source) { - ofpbuf_set_base(b, base); - ofpbuf_set_data(b, base); - ofpbuf_set_size(b, 0); + b->base = base; + b->data = base; + b->size = 0; ofpbuf_init__(b, allocated, source); } @@ -104,19 +104,7 @@ ofpbuf_use_const(struct ofpbuf *b, const void *data, size_t size) { ofpbuf_use__(b, CONST_CAST(void *, data), size, OFPBUF_STACK); - ofpbuf_set_size(b, size); -} - -/* Initializes 'b' as an empty ofpbuf that contains the 'allocated' bytes of - * memory starting at 'base'. DPDK allocated ofpbuf and *data is allocated - * from one continous memory region, so in memory data start right after - * ofpbuf. Therefore there is special method to free this type of - * buffer. ofpbuf base, data and size are initialized by dpdk rcv() so no - * need to initialize those fields. */ -void -ofpbuf_init_dpdk(struct ofpbuf *b, size_t allocated) -{ - ofpbuf_init__(b, allocated, OFPBUF_DPDK); + b->size = size; } /* Initializes 'b' as an empty ofpbuf with an initial capacity of 'size' @@ -133,9 +121,8 @@ { if (b) { if (b->source == OFPBUF_MALLOC) { - free(ofpbuf_base(b)); + free(b->base); } - ovs_assert(b->source != OFPBUF_DPDK); } } @@ -168,7 +155,7 @@ } /* Creates and returns a new ofpbuf that initially contains a copy of the - * 'ofpbuf_size(buffer)' bytes of data starting at 'buffer->data' with no headroom or + * 'buffer->size' bytes of data starting at 'buffer->data' with no headroom or * tailroom. */ struct ofpbuf * ofpbuf_clone(const struct ofpbuf *buffer) @@ -183,18 +170,16 @@ { struct ofpbuf *new_buffer; - new_buffer = ofpbuf_clone_data_with_headroom(ofpbuf_data(buffer), - ofpbuf_size(buffer), + new_buffer = ofpbuf_clone_data_with_headroom(buffer->data, + buffer->size, headroom); - if (buffer->frame) { + if (buffer->header) { uintptr_t data_delta - = (char *)ofpbuf_data(new_buffer) - (char *)ofpbuf_data(buffer); + = (char *)new_buffer->data - (char *)buffer->data; - new_buffer->frame = (char *) buffer->frame + data_delta; + new_buffer->header = (char *) buffer->header + data_delta; } - new_buffer->l2_5_ofs = buffer->l2_5_ofs; - new_buffer->l3_ofs = buffer->l3_ofs; - new_buffer->l4_ofs = buffer->l4_ofs; + new_buffer->msg = buffer->msg; return new_buffer; } @@ -222,7 +207,7 @@ ofpbuf_copy__(struct ofpbuf *b, uint8_t *new_base, size_t new_headroom, size_t new_tailroom) { - const uint8_t *old_base = ofpbuf_base(b); + const uint8_t *old_base = b->base; size_t old_headroom = ofpbuf_headroom(b); size_t old_tailroom = ofpbuf_tailroom(b); size_t copy_headroom = MIN(old_headroom, new_headroom); @@ -230,7 +215,7 @@ memcpy(&new_base[new_headroom - copy_headroom], &old_base[old_headroom - copy_headroom], - copy_headroom + ofpbuf_size(b) + copy_tailroom); + copy_headroom + b->size + copy_tailroom); } /* Reallocates 'b' so that it has exactly 'new_headroom' and 'new_tailroom' @@ -241,19 +226,16 @@ void *new_base, *new_data; size_t new_allocated; - new_allocated = new_headroom + ofpbuf_size(b) + new_tailroom; + new_allocated = new_headroom + b->size + new_tailroom; switch (b->source) { - case OFPBUF_DPDK: - OVS_NOT_REACHED(); - case OFPBUF_MALLOC: if (new_headroom == ofpbuf_headroom(b)) { - new_base = xrealloc(ofpbuf_base(b), new_allocated); + new_base = xrealloc(b->base, new_allocated); } else { new_base = xmalloc(new_allocated); ofpbuf_copy__(b, new_base, new_headroom, new_tailroom); - free(ofpbuf_base(b)); + free(b->base); } break; @@ -271,16 +253,16 @@ } b->allocated = new_allocated; - ofpbuf_set_base(b, new_base); + b->base = new_base; new_data = (char *) new_base + new_headroom; - if (ofpbuf_data(b) != new_data) { - if (b->frame) { - uintptr_t data_delta = (char *) new_data - (char *) ofpbuf_data(b); + if (b->data != new_data) { + if (b->header) { + uintptr_t data_delta = (char *) new_data - (char *) b->data; - b->frame = (char *) b->frame + data_delta; + b->header = (char *) b->header + data_delta; } - ofpbuf_set_data(b, new_data); + b->data = new_data; } } @@ -306,16 +288,14 @@ } } -/* Trims the size of 'b' to fit its actual content, reducing its tailroom to - * 0. Its headroom, if any, is preserved. +/* Trims the size of 'b' to fit its actual content, reducing its headroom and + * tailroom to 0, if any. * * Buffers not obtained from malloc() are not resized, since that wouldn't save * any memory. */ void ofpbuf_trim(struct ofpbuf *b) { - ovs_assert(b->source != OFPBUF_DPDK); - if (b->source == OFPBUF_MALLOC && (ofpbuf_headroom(b) || ofpbuf_tailroom(b))) { ofpbuf_resize__(b, 0, 0); @@ -327,8 +307,8 @@ void ofpbuf_padto(struct ofpbuf *b, size_t length) { - if (ofpbuf_size(b) < length) { - ofpbuf_put_zeros(b, length - ofpbuf_size(b)); + if (b->size < length) { + ofpbuf_put_zeros(b, length - b->size); } } @@ -344,9 +324,9 @@ : true); if (delta != 0) { - char *dst = (char *) ofpbuf_data(b) + delta; - memmove(dst, ofpbuf_data(b), ofpbuf_size(b)); - ofpbuf_set_data(b, dst); + char *dst = (char *) b->data + delta; + memmove(dst, b->data, b->size); + b->data = dst; } } @@ -359,7 +339,7 @@ void *p; ofpbuf_prealloc_tailroom(b, size); p = ofpbuf_tail(b); - ofpbuf_set_size(b, ofpbuf_size(b) + size); + b->size += size; return p; } @@ -393,7 +373,7 @@ char * ofpbuf_put_hex(struct ofpbuf *b, const char *s, size_t *n) { - size_t initial_size = ofpbuf_size(b); + size_t initial_size = b->size; for (;;) { uint8_t byte; bool ok; @@ -402,7 +382,7 @@ byte = hexits_value(s, 2, &ok); if (!ok) { if (n) { - *n = ofpbuf_size(b) - initial_size; + *n = b->size - initial_size; } return CONST_CAST(char *, s); } @@ -417,20 +397,9 @@ void ofpbuf_reserve(struct ofpbuf *b, size_t size) { - ovs_assert(!ofpbuf_size(b)); + ovs_assert(!b->size); ofpbuf_prealloc_tailroom(b, size); - ofpbuf_set_data(b, (char*)ofpbuf_data(b) + size); -} - -/* Reserves 'size' bytes of headroom so that they can be later allocated with - * ofpbuf_push_uninit() without reallocating the ofpbuf. */ -void -ofpbuf_reserve_with_tailroom(struct ofpbuf *b, size_t headroom, - size_t tailroom) -{ - ovs_assert(!ofpbuf_size(b)); - ofpbuf_prealloc_tailroom(b, headroom + tailroom); - ofpbuf_set_data(b, (char*)ofpbuf_data(b) + headroom); + b->data = (char*)b->data + size; } /* Prefixes 'size' bytes to the head end of 'b', reallocating and copying its @@ -440,9 +409,9 @@ ofpbuf_push_uninit(struct ofpbuf *b, size_t size) { ofpbuf_prealloc_headroom(b, size); - ofpbuf_set_data(b, (char*)ofpbuf_data(b) - size); - ofpbuf_set_size(b, ofpbuf_size(b) + size); - return ofpbuf_data(b); + b->data = (char*)b->data - size; + b->size += size; + return b->data; } /* Prefixes 'size' zeroed bytes to the head end of 'b', reallocating and @@ -474,18 +443,17 @@ ofpbuf_steal_data(struct ofpbuf *b) { void *p; - ovs_assert(b->source != OFPBUF_DPDK); - if (b->source == OFPBUF_MALLOC && ofpbuf_data(b) == ofpbuf_base(b)) { - p = ofpbuf_data(b); + if (b->source == OFPBUF_MALLOC && b->data == b->base) { + p = b->data; } else { - p = xmemdup(ofpbuf_data(b), ofpbuf_size(b)); + p = xmemdup(b->data, b->size); if (b->source == OFPBUF_MALLOC) { - free(ofpbuf_base(b)); + free(b->base); } } - ofpbuf_set_base(b, NULL); - ofpbuf_set_data(b, NULL); + b->base = NULL; + b->data = NULL; return p; } @@ -498,60 +466,20 @@ ds_init(&s); ds_put_format(&s, "size=%"PRIu32", allocated=%"PRIu32", head=%"PRIuSIZE", tail=%"PRIuSIZE"\n", - ofpbuf_size(b), b->allocated, + b->size, b->allocated, ofpbuf_headroom(b), ofpbuf_tailroom(b)); - ds_put_hex_dump(&s, ofpbuf_data(b), MIN(ofpbuf_size(b), maxbytes), 0, false); + ds_put_hex_dump(&s, b->data, MIN(b->size, maxbytes), 0, false); return ds_cstr(&s); } /* Removes each of the "struct ofpbuf"s on 'list' from the list and frees * them. */ void -ofpbuf_list_delete(struct list *list) +ofpbuf_list_delete(struct ovs_list *list) { - struct ofpbuf *b, *next; + struct ofpbuf *b; - LIST_FOR_EACH_SAFE (b, next, list_node, list) { - list_remove(&b->list_node); + LIST_FOR_EACH_POP (b, list_node, list) { ofpbuf_delete(b); } } - -static inline void -ofpbuf_adjust_layer_offset(uint16_t *offset, int increment) -{ - if (*offset != UINT16_MAX) { - *offset += increment; - } -} - -/* Adjust the size of the l2_5 portion of the ofpbuf, updating the l2 - * pointer and the layer offsets. The caller is responsible for - * modifying the contents. */ -void * -ofpbuf_resize_l2_5(struct ofpbuf *b, int increment) -{ - if (increment >= 0) { - ofpbuf_push_uninit(b, increment); - } else { - ofpbuf_pull(b, -increment); - } - - b->frame = ofpbuf_data(b); - /* Adjust layer offsets after l2_5. */ - ofpbuf_adjust_layer_offset(&b->l3_ofs, increment); - ofpbuf_adjust_layer_offset(&b->l4_ofs, increment); - - return b->frame; -} - -/* Adjust the size of the l2 portion of the ofpbuf, updating the l2 - * pointer and the layer offsets. The caller is responsible for - * modifying the contents. */ -void * -ofpbuf_resize_l2(struct ofpbuf *b, int increment) -{ - ofpbuf_resize_l2_5(b, increment); - ofpbuf_adjust_layer_offset(&b->l2_5_ofs, increment); - return b->frame; -} diff -Nru openvswitch-2.3.1/lib/ofpbuf.h openvswitch-2.4.0~git20150623/lib/ofpbuf.h --- openvswitch-2.3.1/lib/ofpbuf.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofpbuf.h 2015-06-23 18:46:21.000000000 +0000 @@ -22,7 +22,6 @@ #include "list.h" #include "packets.h" #include "util.h" -#include "netdev-dpdk.h" #ifdef __cplusplus extern "C" { @@ -32,85 +31,42 @@ OFPBUF_MALLOC, /* Obtained via malloc(). */ OFPBUF_STACK, /* Un-movable stack space or static buffer. */ OFPBUF_STUB, /* Starts on stack, may expand into heap. */ - OFPBUF_DPDK, /* buffer data is from DPDK allocated memory. - ref to build_ofpbuf() in netdev-dpdk. */ }; /* Buffer for holding arbitrary data. An ofpbuf is automatically reallocated * as necessary if it grows too large for the available memory. * - * 'frame' and offset conventions: + * 'header' and 'msg' conventions: * - * Network frames (aka "packets"): 'frame' MUST be set to the start of the - * packet, layer offsets MAY be set as appropriate for the packet. - * Additionally, we assume in many places that the 'frame' and 'data' are - * the same for packets. - * - * OpenFlow messages: 'frame' points to the start of the OpenFlow - * header, while 'l3_ofs' is the length of the OpenFlow header. + * OpenFlow messages: 'header' points to the start of the OpenFlow + * header, while 'msg' is the OpenFlow msg bofy. * When parsing, the 'data' will move past these, as data is being * pulled from the OpenFlow message. * - * Actions: When encoding OVS action lists, the 'frame' is used + * Actions: When encoding OVS action lists, the 'header' is used * as a pointer to the beginning of the current action (see ofpact_put()). * - * rconn: Reuses 'frame' as a private pointer while queuing. + * rconn: Reuses 'header' as a private pointer while queuing. */ struct ofpbuf { -#ifdef DPDK_NETDEV - struct rte_mbuf mbuf; /* DPDK mbuf */ -#else - void *base_; /* First byte of allocated space. */ - void *data_; /* First byte actually in use. */ - uint32_t size_; /* Number of bytes in use. */ -#endif + void *base; /* First byte of allocated space. */ + void *data; /* First byte actually in use. */ + uint32_t size; /* Number of bytes in use. */ uint32_t allocated; /* Number of bytes allocated. */ - void *frame; /* Packet frame start, or NULL. */ - uint16_t l2_5_ofs; /* MPLS label stack offset from 'frame', or - * UINT16_MAX */ - uint16_t l3_ofs; /* Network-level header offset from 'frame', - or UINT16_MAX. */ - uint16_t l4_ofs; /* Transport-level header offset from 'frame', - or UINT16_MAX. */ + void *header; /* OpenFlow header. */ + void *msg; /* message's body */ + struct ovs_list list_node; /* Private list element for use by owner. */ enum ofpbuf_source source; /* Source of memory allocated as 'base'. */ - struct list list_node; /* Private list element for use by owner. */ }; -static inline void * ofpbuf_data(const struct ofpbuf *); -static inline void ofpbuf_set_data(struct ofpbuf *, void *); -static inline void * ofpbuf_base(const struct ofpbuf *); -static inline void ofpbuf_set_base(struct ofpbuf *, void *); - -static inline uint32_t ofpbuf_size(const struct ofpbuf *); -static inline void ofpbuf_set_size(struct ofpbuf *, uint32_t); - -void * ofpbuf_resize_l2(struct ofpbuf *, int increment); -void * ofpbuf_resize_l2_5(struct ofpbuf *, int increment); -static inline void * ofpbuf_l2(const struct ofpbuf *); -static inline void ofpbuf_set_frame(struct ofpbuf *, void *); -static inline void * ofpbuf_l2_5(const struct ofpbuf *); -static inline void ofpbuf_set_l2_5(struct ofpbuf *, void *); -static inline void * ofpbuf_l3(const struct ofpbuf *); -static inline void ofpbuf_set_l3(struct ofpbuf *, void *); -static inline void * ofpbuf_l4(const struct ofpbuf *); -static inline void ofpbuf_set_l4(struct ofpbuf *, void *); -static inline size_t ofpbuf_l4_size(const struct ofpbuf *); -static inline const void *ofpbuf_get_tcp_payload(const struct ofpbuf *); -static inline const void *ofpbuf_get_udp_payload(const struct ofpbuf *); -static inline const void *ofpbuf_get_sctp_payload(const struct ofpbuf *); -static inline const void *ofpbuf_get_icmp_payload(const struct ofpbuf *); - void ofpbuf_use(struct ofpbuf *, void *, size_t); void ofpbuf_use_stack(struct ofpbuf *, void *, size_t); void ofpbuf_use_stub(struct ofpbuf *, void *, size_t); void ofpbuf_use_const(struct ofpbuf *, const void *, size_t); -void ofpbuf_init_dpdk(struct ofpbuf *b, size_t allocated); - void ofpbuf_init(struct ofpbuf *, size_t); void ofpbuf_uninit(struct ofpbuf *); -static inline void *ofpbuf_get_uninit_pointer(struct ofpbuf *); void ofpbuf_reinit(struct ofpbuf *, size_t); struct ofpbuf *ofpbuf_new(size_t); @@ -135,8 +91,6 @@ void *ofpbuf_put(struct ofpbuf *, const void *, size_t); char *ofpbuf_put_hex(struct ofpbuf *, const char *s, size_t *n); void ofpbuf_reserve(struct ofpbuf *, size_t); -void ofpbuf_reserve_with_tailroom(struct ofpbuf *b, size_t headroom, - size_t tailroom); void *ofpbuf_push_uninit(struct ofpbuf *b, size_t); void *ofpbuf_push_zeros(struct ofpbuf *, size_t); void *ofpbuf_push(struct ofpbuf *b, const void *, size_t); @@ -156,29 +110,15 @@ void *ofpbuf_steal_data(struct ofpbuf *); char *ofpbuf_to_string(const struct ofpbuf *, size_t maxbytes); -static inline struct ofpbuf *ofpbuf_from_list(const struct list *); -void ofpbuf_list_delete(struct list *); +static inline struct ofpbuf *ofpbuf_from_list(const struct ovs_list *); +void ofpbuf_list_delete(struct ovs_list *); static inline bool ofpbuf_equal(const struct ofpbuf *, const struct ofpbuf *); -/* Returns a pointer that may be passed to free() to accomplish the same thing - * as ofpbuf_uninit(b). The return value is a null pointer if ofpbuf_uninit() - * would not free any memory. */ -static inline void *ofpbuf_get_uninit_pointer(struct ofpbuf *b) -{ - /* XXX: If 'source' is OFPBUF_DPDK memory gets leaked! */ - return b && b->source == OFPBUF_MALLOC ? ofpbuf_base(b) : NULL; -} - /* Frees memory that 'b' points to, as well as 'b' itself. */ static inline void ofpbuf_delete(struct ofpbuf *b) { if (b) { - if (b->source == OFPBUF_DPDK) { - free_dpdk_buf(b); - return; - } - ofpbuf_uninit(b); free(b); } @@ -189,7 +129,7 @@ static inline void *ofpbuf_at(const struct ofpbuf *b, size_t offset, size_t size) { - return offset + size <= ofpbuf_size(b) ? (char *) ofpbuf_data(b) + offset : NULL; + return offset + size <= b->size ? (char *) b->data + offset : NULL; } /* Returns a pointer to byte 'offset' in 'b', which must contain at least @@ -197,21 +137,21 @@ static inline void *ofpbuf_at_assert(const struct ofpbuf *b, size_t offset, size_t size) { - ovs_assert(offset + size <= ofpbuf_size(b)); - return ((char *) ofpbuf_data(b)) + offset; + ovs_assert(offset + size <= b->size); + return ((char *) b->data) + offset; } -/* Returns the byte following the last byte of data in use in 'b'. */ +/* Returns a pointer to byte following the last byte of data in use in 'b'. */ static inline void *ofpbuf_tail(const struct ofpbuf *b) { - return (char *) ofpbuf_data(b) + ofpbuf_size(b); + return (char *) b->data + b->size; } -/* Returns the byte following the last byte allocated for use (but not - * necessarily in use) by 'b'. */ +/* Returns a pointer to byte following the last byte allocated for use (but + * not necessarily in use) in 'b'. */ static inline void *ofpbuf_end(const struct ofpbuf *b) { - return (char *) ofpbuf_base(b) + b->allocated; + return (char *) b->base + b->allocated; } /* Returns the number of bytes of headroom in 'b', that is, the number of bytes @@ -220,7 +160,7 @@ * headroom is 0.) */ static inline size_t ofpbuf_headroom(const struct ofpbuf *b) { - return (char*)ofpbuf_data(b) - (char*)ofpbuf_base(b); + return (char*)b->data - (char*)b->base; } /* Returns the number of bytes that may be appended to the tail end of ofpbuf @@ -233,18 +173,17 @@ /* Clears any data from 'b'. */ static inline void ofpbuf_clear(struct ofpbuf *b) { - ofpbuf_set_data(b, ofpbuf_base(b)); - ofpbuf_set_size(b, 0); + b->data = b->base; + b->size = 0; } /* Removes 'size' bytes from the head end of 'b', which must contain at least * 'size' bytes of data. Returns the first byte of data removed. */ static inline void *ofpbuf_pull(struct ofpbuf *b, size_t size) { - void *data = ofpbuf_data(b); - ovs_assert(ofpbuf_size(b) >= size); - ofpbuf_set_data(b, (char*)ofpbuf_data(b) + size); - ofpbuf_set_size(b, ofpbuf_size(b) - size); + void *data = b->data; + b->data = (char*)b->data + size; + b->size = b->size - size; return data; } @@ -253,171 +192,20 @@ * null pointer without modifying 'b'. */ static inline void *ofpbuf_try_pull(struct ofpbuf *b, size_t size) { - return ofpbuf_size(b) >= size ? ofpbuf_pull(b, size) : NULL; + return b->size >= size ? ofpbuf_pull(b, size) : NULL; } -static inline struct ofpbuf *ofpbuf_from_list(const struct list *list) +static inline struct ofpbuf *ofpbuf_from_list(const struct ovs_list *list) { return CONTAINER_OF(list, struct ofpbuf, list_node); } static inline bool ofpbuf_equal(const struct ofpbuf *a, const struct ofpbuf *b) { - return ofpbuf_size(a) == ofpbuf_size(b) && - memcmp(ofpbuf_data(a), ofpbuf_data(b), ofpbuf_size(a)) == 0; -} - -/* Get the start if the Ethernet frame. 'l3_ofs' marks the end of the l2 - * headers, so return NULL if it is not set. */ -static inline void * ofpbuf_l2(const struct ofpbuf *b) -{ - return (b->l3_ofs != UINT16_MAX) ? b->frame : NULL; -} - -/* Sets the packet frame start pointer and resets all layer offsets. - * l3 offset must be set before 'l2' can be retrieved. */ -static inline void ofpbuf_set_frame(struct ofpbuf *b, void *packet) -{ - b->frame = packet; - b->l2_5_ofs = UINT16_MAX; - b->l3_ofs = UINT16_MAX; - b->l4_ofs = UINT16_MAX; -} - -static inline void * ofpbuf_l2_5(const struct ofpbuf *b) -{ - return b->l2_5_ofs != UINT16_MAX ? (char *)b->frame + b->l2_5_ofs : NULL; -} - -static inline void ofpbuf_set_l2_5(struct ofpbuf *b, void *l2_5) -{ - b->l2_5_ofs = l2_5 ? (char *)l2_5 - (char *)b->frame : UINT16_MAX; -} - -static inline void * ofpbuf_l3(const struct ofpbuf *b) -{ - return b->l3_ofs != UINT16_MAX ? (char *)b->frame + b->l3_ofs : NULL; -} - -static inline void ofpbuf_set_l3(struct ofpbuf *b, void *l3) -{ - b->l3_ofs = l3 ? (char *)l3 - (char *)b->frame : UINT16_MAX; -} - -static inline void * ofpbuf_l4(const struct ofpbuf *b) -{ - return b->l4_ofs != UINT16_MAX ? (char *)b->frame + b->l4_ofs : NULL; -} - -static inline void ofpbuf_set_l4(struct ofpbuf *b, void *l4) -{ - b->l4_ofs = l4 ? (char *)l4 - (char *)b->frame : UINT16_MAX; -} - -static inline size_t ofpbuf_l4_size(const struct ofpbuf *b) -{ - return b->l4_ofs != UINT16_MAX - ? (const char *)ofpbuf_tail(b) - (const char *)ofpbuf_l4(b) : 0; -} - -static inline const void *ofpbuf_get_tcp_payload(const struct ofpbuf *b) -{ - size_t l4_size = ofpbuf_l4_size(b); - - if (OVS_LIKELY(l4_size >= TCP_HEADER_LEN)) { - struct tcp_header *tcp = ofpbuf_l4(b); - int tcp_len = TCP_OFFSET(tcp->tcp_ctl) * 4; - - if (OVS_LIKELY(tcp_len >= TCP_HEADER_LEN && tcp_len <= l4_size)) { - return (const char *)tcp + tcp_len; - } - } - return NULL; -} - -static inline const void *ofpbuf_get_udp_payload(const struct ofpbuf *b) -{ - return OVS_LIKELY(ofpbuf_l4_size(b) >= UDP_HEADER_LEN) - ? (const char *)ofpbuf_l4(b) + UDP_HEADER_LEN : NULL; + return a->size == b->size && + memcmp(a->data, b->data, a->size) == 0; } -static inline const void *ofpbuf_get_sctp_payload(const struct ofpbuf *b) -{ - return OVS_LIKELY(ofpbuf_l4_size(b) >= SCTP_HEADER_LEN) - ? (const char *)ofpbuf_l4(b) + SCTP_HEADER_LEN : NULL; -} - -static inline const void *ofpbuf_get_icmp_payload(const struct ofpbuf *b) -{ - return OVS_LIKELY(ofpbuf_l4_size(b) >= ICMP_HEADER_LEN) - ? (const char *)ofpbuf_l4(b) + ICMP_HEADER_LEN : NULL; -} - -#ifdef DPDK_NETDEV -static inline void * ofpbuf_data(const struct ofpbuf *b) -{ - return b->mbuf.pkt.data; -} - -static inline void ofpbuf_set_data(struct ofpbuf *b, void *d) -{ - b->mbuf.pkt.data = d; -} - -static inline void * ofpbuf_base(const struct ofpbuf *b) -{ - return b->mbuf.buf_addr; -} - -static inline void ofpbuf_set_base(struct ofpbuf *b, void *d) -{ - b->mbuf.buf_addr = d; -} - -static inline uint32_t ofpbuf_size(const struct ofpbuf *b) -{ - return b->mbuf.pkt.pkt_len; -} - -static inline void ofpbuf_set_size(struct ofpbuf *b, uint32_t v) -{ - b->mbuf.pkt.data_len = v; /* Current seg length. */ - b->mbuf.pkt.pkt_len = v; /* Total length of all segments linked to - * this segment. */ -} - -#else -static inline void * ofpbuf_data(const struct ofpbuf *b) -{ - return b->data_; -} - -static inline void ofpbuf_set_data(struct ofpbuf *b, void *d) -{ - b->data_ = d; -} - -static inline void * ofpbuf_base(const struct ofpbuf *b) -{ - return b->base_; -} - -static inline void ofpbuf_set_base(struct ofpbuf *b, void *d) -{ - b->base_ = d; -} - -static inline uint32_t ofpbuf_size(const struct ofpbuf *b) -{ - return b->size_; -} - -static inline void ofpbuf_set_size(struct ofpbuf *b, uint32_t v) -{ - b->size_ = v; -} -#endif - #ifdef __cplusplus } #endif diff -Nru openvswitch-2.3.1/lib/ofp-errors.c openvswitch-2.4.0~git20150623/lib/ofp-errors.c --- openvswitch-2.3.1/lib/ofp-errors.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-errors.c 2015-06-23 18:46:21.000000000 +0000 @@ -23,7 +23,7 @@ #include "ofp-util.h" #include "ofpbuf.h" #include "openflow/openflow.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ofp_errors); @@ -327,8 +327,8 @@ /* Translate the error type and code into an ofperr. */ error = ofperr_decode(oh->version, vendor, type, code); if (error && payload) { - ofpbuf_init(payload, ofpbuf_size(&b)); - ofpbuf_push(payload, ofpbuf_data(&b), ofpbuf_size(&b)); + ofpbuf_init(payload, b.size); + ofpbuf_push(payload, b.data, b.size); } return error; } diff -Nru openvswitch-2.3.1/lib/ofp-errors.h openvswitch-2.4.0~git20150623/lib/ofp-errors.h --- openvswitch-2.3.1/lib/ofp-errors.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-errors.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,8 @@ #define OFPERR_OFS (1 << 30) -/* OpenFlow error codes. +/* OpenFlow error codes + * -------------------- * * The comments below are parsed by the extract-ofp-errors program at build * time and used to determine the mapping between "enum ofperr" constants and @@ -71,13 +72,46 @@ * - Additional text is a human-readable description of the meaning of each * error, used to explain the error to the user. Any text enclosed in * square brackets is omitted; this can be used to explain rationale for - * choice of error codes in the case where this is desirable. */ + * choice of error codes in the case where this is desirable. + * + * + * Expected duplications + * --------------------- + * + * Occasionally, in one version of OpenFlow a single named error can indicate + * two or more distinct errors, then a later version of OpenFlow splits those + * meanings into different error codes. When that happens, both errors are + * assigned the same value in the earlier version. That is ordinarily a + * mistake, so the build system reports an error. When that happens, add the + * error message to the list of "Expected duplications" below to suppress the + * error. In such a case, the named error defined earlier is how OVS + * interprets the earlier, merged form of the error. + * + * For example, OpenFlow 1.1 defined (3,5) as OFPBIC_UNSUP_EXP_INST, then + * OpenFlow 1.2 broke this error into OFPBIC_BAD_EXPERIMENTER as (3,5) and + * OFPBIC_BAD_EXT_TYPE as (3,6). To allow the OVS code to report just a single + * error code, instead of protocol version dependent errors, this list of + * errors only lists the latter two errors, giving both of them the same code + * (3,5) for OpenFlow 1.1. Then, when OVS serializes either error into + * OpenFlow 1.1, it uses the same code (3,5). In the other direction, when OVS + * deserializes (3,5) from OpenFlow 1.1, it translates it into + * OFPBIC_BAD_EXPERIMENTER (because its definition precedes that of + * OFPBIC_BAD_EXT_TYPE below). See the "encoding OFPBIC_* experimenter errors" + * and "decoding OFPBIC_* experimenter errors" tests in tests/ofp-errors.at for + * full details. + */ enum ofperr { /* Expected duplications. */ /* Expected: 0x0,3,5 in OF1.1 means both OFPBIC_BAD_EXPERIMENTER and * OFPBIC_BAD_EXP_TYPE. */ + /* Expected: 0x0,1,5 in OF1.0 means both OFPBRC_EPERM and + * OFPBRC_IS_SLAVE. */ + + /* Expected: 0x0,1,5 in OF1.1 means both OFPBRC_EPERM and + * OFPBRC_IS_SLAVE. */ + /* ## ------------------ ## */ /* ## OFPET_HELLO_FAILED ## */ /* ## ------------------ ## */ @@ -126,7 +160,7 @@ * code defined the specification. ] */ OFPERR_OFPBRC_BAD_TABLE_ID, - /* OF1.2+(1,10). Denied because controller is slave. */ + /* OF1.0-1.1(1,5), OF1.2+(1,10). Denied because controller is slave. */ OFPERR_OFPBRC_IS_SLAVE, /* NX1.0-1.1(1,514), OF1.2+(1,11). Invalid port. [ A non-standard error @@ -156,21 +190,6 @@ * is not valid. */ OFPERR_NXBRC_BAD_REASON, - /* NX1.0-1.1(1,517), NX1.2+(6). The 'id' in an NXST_FLOW_MONITOR request - * is the same as an existing monitor id (or two monitors in the same - * NXST_FLOW_MONITOR request have the same 'id'). */ - OFPERR_NXBRC_FM_DUPLICATE_ID, - - /* NX1.0-1.1(1,518), NX1.2+(7). The 'flags' in an NXST_FLOW_MONITOR - * request either does not specify at least one of the NXFMF_ADD, - * NXFMF_DELETE, or NXFMF_MODIFY flags, or specifies a flag bit that is not - * defined. */ - OFPERR_NXBRC_FM_BAD_FLAGS, - - /* NX1.0-1.1(1,519), NX1.2+(8). The 'id' in an NXT_FLOW_MONITOR_CANCEL - * request is not the id of any existing monitor. */ - OFPERR_NXBRC_FM_BAD_ID, - /* NX1.0-1.1(1,520), NX1.2+(9). The 'event' in an NXST_FLOW_MONITOR reply * does not specify one of the NXFME_ABBREV, NXFME_ADD, NXFME_DELETE, or * NXFME_MODIFY. */ @@ -237,10 +256,19 @@ * unsupported value, or modifies a read-only field. */ OFPERR_OFPBAC_BAD_SET_ARGUMENT, + /* ONF1.3-1.4(4250), OF1.5+(2,16). Field in Set-Field action has Has-Mask + * bit set to 1. */ + OFPERR_OFPBAC_BAD_SET_MASK, + /* NX1.0-1.1(2,256), NX1.2+(11). Must-be-zero action argument had nonzero * value. */ OFPERR_NXBAC_MUST_BE_ZERO, + /* NX1.0-1.1(2,526), NX1.2+(15). Conjunction action must be only action + * present. conjunction(id, k/n) must satisfy 1 <= k <= n and 2 <= n <= + * 64. */ + OFPERR_NXBAC_BAD_CONJUNCTION, + /* ## --------------------- ## */ /* ## OFPET_BAD_INSTRUCTION ## */ /* ## --------------------- ## */ @@ -248,7 +276,8 @@ /* OF1.1+(3,0). Unknown instruction. */ OFPERR_OFPBIC_UNKNOWN_INST, - /* OF1.1+(3,1). Switch or table does not support the instruction. */ + /* NX1.0(2,257), OF1.1+(3,1). Switch or table does not support the + * instruction. */ OFPERR_OFPBIC_UNSUP_INST, /* OF1.1+(3,2). Invalid Table-ID specified. */ @@ -272,8 +301,8 @@ /* OF1.2+(3,8). Permissions error. */ OFPERR_OFPBIC_EPERM, - /* ONF1.1+(2600). Duplicate instruction. */ - OFPERR_ONFBIC_DUP_INSTRUCTION, + /* NX1.1(3,256), ONF1.2-1.3(2600), OF1.4+(3,9). Duplicate instruction. */ + OFPERR_OFPBIC_DUP_INST, /* ## --------------- ## */ /* ## OFPET_BAD_MATCH ## */ @@ -296,10 +325,11 @@ * arbitrary network address mask. */ OFPERR_OFPBMC_BAD_NW_ADDR_MASK, - /* OF1.1+(4,5). Unsupported wildcard specified in the match. */ + /* NX1.0(1,262), OF1.1+(4,5). Unsupported wildcard specified in the + * match. */ OFPERR_OFPBMC_BAD_WILDCARDS, - /* OF1.1+(4,6). Unsupported field in the match. */ + /* NX1.0(0,263), OF1.1+(4,6). Unsupported field in the match. */ OFPERR_OFPBMC_BAD_FIELD, /* NX1.0(1,258), OF1.1+(4,7). Unsupported value in a match @@ -420,6 +450,14 @@ /* OF1.2+(6,14). Permissions error. */ OFPERR_OFPGMFC_EPERM, + /* OF1.5+(6,15). Invalid bucket identifier used in + * INSERT BUCKET or REMOVE BUCKET command. */ + OFPERR_OFPGMFC_UNKNOWN_BUCKET, + + /* OF1.5+(6,16). Can't insert bucket because a bucket + * already exist with that bucket-id. */ + OFPERR_OFPGMFC_BUCKET_EXISTS, + /* ## --------------------- ## */ /* ## OFPET_PORT_MOD_FAILED ## */ /* ## --------------------- ## */ @@ -567,22 +605,22 @@ * [Known as OFPTFFC_BAD_ARGUMENT in OF1.3.] */ OFPERR_OFPBPC_BAD_VALUE, - /* OF1.4+(14,3). Can't handle this many properties. */ + /* ONF1.3(4443), OF1.4+(14,3). Can't handle this many properties. */ OFPERR_OFPBPC_TOO_MANY, - /* OF1.4+(14,4). A property type was duplicated. */ + /* ONF1.3(4444), OF1.4+(14,4). A property type was duplicated. */ OFPERR_OFPBPC_DUP_TYPE, - /* OF1.4+(14,5). Unknown experimenter id specified. */ + /* ONF1.3(4445), OF1.4+(14,5). Unknown experimenter id specified. */ OFPERR_OFPBPC_BAD_EXPERIMENTER, - /* OF1.4+(14,6). Unknown exp_type for experimenter id. */ + /* ONF1.3(4446), OF1.4+(14,6). Unknown exp_type for experimenter id. */ OFPERR_OFPBPC_BAD_EXP_TYPE, - /* OF1.4+(14,7). Unknown value for experimenter id. */ + /* ONF1.3(4447), OF1.4+(14,7). Unknown value for experimenter id. */ OFPERR_OFPBPC_BAD_EXP_VALUE, - /* OF1.4+(14,8). Permissions error. */ + /* ONF1.3(4448), OF1.4+(14,8). Permissions error. */ OFPERR_OFPBPC_EPERM, /* ## -------------------- ## */ @@ -637,6 +675,38 @@ /* OF1.4+(17,15). Bundle is locking the resource. */ OFPERR_OFPBFC_BUNDLE_IN_PROGRESS, +/* ## ------------------------- ## */ +/* ## OFPET_FLOW_MONITOR_FAILED ## */ +/* ## ------------------------- ## */ + + /* OF1.4+(16,0). Unspecified error. */ + OFPERR_OFPMOFC_UNKNOWN, + + /* NX1.0-1.1(1,517), NX1.2-1.3(6), OF1.4+(16,1). Monitor not added + * because a Monitor ADD attempted to replace an existing Monitor. */ + OFPERR_OFPMOFC_MONITOR_EXISTS, + + /* OF1.4+(16,2). Monitor not added because + * Monitor specified is invalid. */ + OFPERR_OFPMOFC_INVALID_MONITOR, + + /* NX1.0-1.1(1,519), NX1.2-1.3(8), OF1.4+(16,3). Monitor not modified + * because a Monitor MODIFY attempted to modify a non-existent Monitor. */ + OFPERR_OFPMOFC_UNKNOWN_MONITOR, + + /* OF1.4+(16,4). Unsupported or unknown command. */ + OFPERR_OFPMOFC_BAD_COMMAND, + + /* NX1.0-1.1(1,518), NX1.2-1.3(7), OF1.4+(16,5). Flag configuration + * unsupported. */ + OFPERR_OFPMOFC_BAD_FLAGS, + + /* OF1.4+(16,6). Specified table does not exist. */ + OFPERR_OFPMOFC_BAD_TABLE_ID, + + /* OF1.4+(16,7). Error in output port/group. */ + OFPERR_OFPMOFC_BAD_OUT, + /* ## ------------------ ## */ /* ## OFPET_EXPERIMENTER ## */ /* ## ------------------ ## */ diff -Nru openvswitch-2.3.1/lib/ofp-errors.inc openvswitch-2.4.0~git20150623/lib/ofp-errors.inc --- openvswitch-2.3.1/lib/ofp-errors.inc 2014-12-04 05:59:59.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-errors.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,2620 +0,0 @@ -/* Generated automatically; do not modify! -*- buffer-read-only: t -*- */ - -#define OFPERR_N_ERRORS 148 - -struct ofperr_domain { - const char *name; - uint8_t version; - enum ofperr (*decode)(uint32_t vendor, uint16_t type, uint16_t code); - struct triplet errors[OFPERR_N_ERRORS]; -}; - -static const char *error_names[OFPERR_N_ERRORS] = { - "OFPHFC_INCOMPATIBLE", - "OFPHFC_EPERM", - "OFPBRC_BAD_VERSION", - "OFPBRC_BAD_TYPE", - "OFPBRC_BAD_STAT", - "OFPBRC_BAD_VENDOR", - "OFPBRC_BAD_SUBTYPE", - "OFPBRC_EPERM", - "OFPBRC_BAD_LEN", - "OFPBRC_BUFFER_EMPTY", - "OFPBRC_BUFFER_UNKNOWN", - "OFPBRC_BAD_TABLE_ID", - "OFPBRC_IS_SLAVE", - "OFPBRC_BAD_PORT", - "OFPBRC_BAD_PACKET", - "OFPBRC_MULTIPART_BUFFER_OVERFLOW", - "NXBRC_NXM_INVALID", - "NXBRC_NXM_BAD_TYPE", - "NXBRC_MUST_BE_ZERO", - "NXBRC_BAD_REASON", - "NXBRC_FM_DUPLICATE_ID", - "NXBRC_FM_BAD_FLAGS", - "NXBRC_FM_BAD_ID", - "NXBRC_FM_BAD_EVENT", - "NXBRC_UNENCODABLE_ERROR", - "OFPBAC_BAD_TYPE", - "OFPBAC_BAD_LEN", - "OFPBAC_BAD_VENDOR", - "OFPBAC_BAD_VENDOR_TYPE", - "OFPBAC_BAD_OUT_PORT", - "OFPBAC_BAD_ARGUMENT", - "OFPBAC_EPERM", - "OFPBAC_TOO_MANY", - "OFPBAC_BAD_QUEUE", - "OFPBAC_BAD_OUT_GROUP", - "OFPBAC_MATCH_INCONSISTENT", - "OFPBAC_UNSUPPORTED_ORDER", - "OFPBAC_BAD_TAG", - "OFPBAC_BAD_SET_TYPE", - "OFPBAC_BAD_SET_LEN", - "OFPBAC_BAD_SET_ARGUMENT", - "NXBAC_MUST_BE_ZERO", - "OFPBIC_UNKNOWN_INST", - "OFPBIC_UNSUP_INST", - "OFPBIC_BAD_TABLE_ID", - "OFPBIC_UNSUP_METADATA", - "OFPBIC_UNSUP_METADATA_MASK", - "OFPBIC_BAD_EXPERIMENTER", - "OFPBIC_BAD_EXP_TYPE", - "OFPBIC_BAD_LEN", - "OFPBIC_EPERM", - "ONFBIC_DUP_INSTRUCTION", - "OFPBMC_BAD_TYPE", - "OFPBMC_BAD_LEN", - "OFPBMC_BAD_TAG", - "OFPBMC_BAD_DL_ADDR_MASK", - "OFPBMC_BAD_NW_ADDR_MASK", - "OFPBMC_BAD_WILDCARDS", - "OFPBMC_BAD_FIELD", - "OFPBMC_BAD_VALUE", - "OFPBMC_BAD_MASK", - "OFPBMC_BAD_PREREQ", - "OFPBMC_DUP_FIELD", - "OFPBMC_EPERM", - "OFPFMFC_UNKNOWN", - "OFPFMFC_TABLE_FULL", - "OFPFMFC_BAD_TABLE_ID", - "OFPFMFC_OVERLAP", - "OFPFMFC_EPERM", - "OFPFMFC_BAD_TIMEOUT", - "OFPFMFC_BAD_EMERG_TIMEOUT", - "OFPFMFC_BAD_COMMAND", - "OFPFMFC_BAD_FLAGS", - "OFPFMFC_UNSUPPORTED", - "NXFMFC_HARDWARE", - "NXFMFC_BAD_TABLE_ID", - "OFPGMFC_GROUP_EXISTS", - "OFPGMFC_INVALID_GROUP", - "OFPGMFC_WEIGHT_UNSUPPORTED", - "OFPGMFC_OUT_OF_GROUPS", - "OFPGMFC_OUT_OF_BUCKETS", - "OFPGMFC_CHAINING_UNSUPPORTED", - "OFPGMFC_WATCH_UNSUPPORTED", - "OFPGMFC_LOOP", - "OFPGMFC_UNKNOWN_GROUP", - "OFPGMFC_CHAINED_GROUP", - "OFPGMFC_BAD_TYPE", - "OFPGMFC_BAD_COMMAND", - "OFPGMFC_BAD_BUCKET", - "OFPGMFC_BAD_WATCH", - "OFPGMFC_EPERM", - "OFPPMFC_BAD_PORT", - "OFPPMFC_BAD_HW_ADDR", - "OFPPMFC_BAD_CONFIG", - "OFPPMFC_BAD_ADVERTISE", - "OFPPMFC_EPERM", - "OFPTMFC_BAD_TABLE", - "OFPTMFC_BAD_CONFIG", - "OFPTMFC_EPERM", - "OFPQOFC_BAD_PORT", - "OFPQOFC_BAD_QUEUE", - "OFPQOFC_EPERM", - "OFPSCFC_BAD_FLAGS", - "OFPSCFC_BAD_LEN", - "OFPSCFC_EPERM", - "OFPRRFC_STALE", - "OFPRRFC_UNSUP", - "OFPRRFC_BAD_ROLE", - "OFPMMFC_UNKNOWN", - "OFPMMFC_METER_EXISTS", - "OFPMMFC_INVALID_METER", - "OFPMMFC_UNKNOWN_METER", - "OFPMMFC_BAD_COMMAND", - "OFPMMFC_BAD_FLAGS", - "OFPMMFC_BAD_RATE", - "OFPMMFC_BAD_BURST", - "OFPMMFC_BAD_BAND", - "OFPMMFC_BAD_BAND_VALUE", - "OFPMMFC_OUT_OF_METERS", - "OFPMMFC_OUT_OF_BANDS", - "OFPTFFC_BAD_TABLE", - "OFPTFFC_BAD_METADATA", - "OFPTFFC_EPERM", - "OFPBPC_BAD_TYPE", - "OFPBPC_BAD_LEN", - "OFPBPC_BAD_VALUE", - "OFPBPC_TOO_MANY", - "OFPBPC_DUP_TYPE", - "OFPBPC_BAD_EXPERIMENTER", - "OFPBPC_BAD_EXP_TYPE", - "OFPBPC_BAD_EXP_VALUE", - "OFPBPC_EPERM", - "OFPBFC_UNKNOWN", - "OFPBFC_EPERM", - "OFPBFC_BAD_ID", - "OFPBFC_BUNDLE_EXIST", - "OFPBFC_BUNDLE_CLOSED", - "OFPBFC_OUT_OF_BUNDLES", - "OFPBFC_BAD_TYPE", - "OFPBFC_BAD_FLAGS", - "OFPBFC_MSG_BAD_LEN", - "OFPBFC_MSG_BAD_XID", - "OFPBFC_MSG_UNSUP", - "OFPBFC_MSG_CONFLICT", - "OFPBFC_MSG_TOO_MANY", - "OFPBFC_MSG_FAILED", - "OFPBFC_TIMEOUT", - "OFPBFC_BUNDLE_IN_PROGRESS", -}; - -static const char *error_comments[OFPERR_N_ERRORS] = { - "No compatible version.", - "Permissions error.", - "ofp_header.version not supported.", - "ofp_header.type not supported.", - "ofp_stats_msg.type not supported.", - "Vendor not supported (in ofp_vendor_header or ofp_stats_msg).", - "Vendor subtype not supported.", - "Permissions error.", - "Wrong request length for type.", - "Specified buffer has already been used.", - "Specified buffer does not exist.", - "Specified table-id invalid or does not exist. ", - "Denied because controller is slave.", - "Invalid port. ", - "Invalid packet in packet-out.", - "Multipart request overflowed the assigned buffer.", - "Invalid NXM flow match.", - "The nxm_type, or nxm_type taken in combination with nxm_hasmask or nxm_length or both, is invalid or not implemented.", - "Must-be-zero field had nonzero value.", - "The reason in an ofp_port_status message is not valid.", - "The 'id' in an NXST_FLOW_MONITOR request is the same as an existing monitor id (or two monitors in the same NXST_FLOW_MONITOR request have the same 'id').", - "The 'flags' in an NXST_FLOW_MONITOR request either does not specify at least one of the NXFMF_ADD, NXFMF_DELETE, or NXFMF_MODIFY flags, or specifies a flag bit that is not defined.", - "The 'id' in an NXT_FLOW_MONITOR_CANCEL request is not the id of any existing monitor.", - "The 'event' in an NXST_FLOW_MONITOR reply does not specify one of the NXFME_ABBREV, NXFME_ADD, NXFME_DELETE, or NXFME_MODIFY.", - "The error that occurred cannot be represented in this OpenFlow version.", - "Unknown action type.", - "Length problem in actions.", - "Unknown experimenter id specified.", - "Unknown action type for experimenter id.", - "Problem validating output port.", - "Bad action argument.", - "Permissions error.", - "Can't handle this many actions.", - "Problem validating output queue.", - "Invalid group id in forward action.", - "Action can't apply for this match or a prerequisite for use of this field is unmet.", - "Action order is unsupported for the action list in an Apply-Actions instruction", - "Actions uses an unsupported tag/encap.", - "Action uses unknown or unsupported OXM or NXM field.", - "Action references past the end of an OXM or NXM field, or uses a length of zero.", - "Action sets a field to an invalid or unsupported value, or modifies a read-only field.", - "Must-be-zero action argument had nonzero value.", - "Unknown instruction.", - "Switch or table does not support the instruction.", - "Invalid Table-ID specified.", - "Metadata value unsupported by datapath.", - "Metadata mask value unsupported by datapath.", - "Unknown experimenter id specified.", - "Unknown instruction for experimenter id.", - "Length problem in instructions.", - "Permissions error.", - "Duplicate instruction.", - "Unsupported match type specified by the match", - "Length problem in match.", - "Match uses an unsupported tag/encap.", - "Unsupported datalink addr mask - switch does not support arbitrary datalink address mask.", - "Unsupported network addr mask - switch does not support arbitrary network address mask.", - "Unsupported wildcard specified in the match.", - "Unsupported field in the match.", - "Unsupported value in a match field.", - "Unsupported mask specified in the match, field is not dl-address or nw-address.", - "A prerequisite was not met.", - "A field type was duplicated.", - "Permissions error.", - "Unspecified error.", - "Flow not added because of full table(s).", - "Table does not exist", - "Attempted to add overlapping flow with CHECK_OVERLAP flag set.", - "Permissions error.", - "Flow not added because of unsupported idle/hard timeout.", - "Flow not added because of non-zero idle/hard timeout.", - "Unsupported or unknown command.", - "Unsupported or unknown flags.", - "Unsupported action list - cannot process in the order specified.", - "Generic hardware error.", - "A nonexistent table ID was specified in the \"command\" field of struct ofp_flow_mod, when the nxt_flow_mod_table_id extension is enabled.", - "Group not added because a group ADD attempted to replace an already-present group.", - "Group not added because Group specified is invalid.", - "Switch does not support unequal load sharing with select groups.", - "The group table is full.", - "The maximum number of action buckets for a group has been exceeded.", - "Switch does not support groups that forward to groups.", - "This group cannot watch the watch_port or watch_group specified.", - "Group entry would cause a loop.", - "Group not modified because a group MODIFY attempted to modify a non-existent group.", - "Group not deleted because another group is forwarding to it.", - "Unsupported or unknown group type.", - "Unsupported or unknown command.", - "Error in bucket.", - "Error in watch port/group.", - "Permissions error.", - "Specified port does not exist.", - "Specified hardware address does not match the port number.", - "Specified config is invalid.", - "Specified advertise is invalid.", - "Permissions error.", - "Specified table does not exist.", - "Specified config is invalid.", - "Permissions error.", - "Invalid port (or port does not exist).", - "Queue does not exist.", - "Permissions error.", - "Specified flags is invalid.", - "Specified len is invalid.", - "Permissions error.", - "Stale Message: old generation_id.", - "Controller role change unsupported.", - "Invalid role.", - "Unspecified error.", - "Meter not added because a Meter ADD attempted to replace an existing Meter.", - "Meter not added because Meter specified is invalid.", - "Meter not modified because a Meter MODIFY attempted to modify a non-existent Meter.", - "Unsupported or unknown command.", - "Flag configuration unsupported.", - "Rate unsupported.", - "Burst size unsupported.", - "Band unsupported.", - "Band value unsupported.", - "No more meters available.", - "The maximum number of properties for a meter has been exceeded.", - "Specified table does not exist.", - "Invalid metadata mask.", - "Permissions error.", - "Unknown property type. ", - "Length problem in property. ", - "Unsupported property value. ", - "Can't handle this many properties.", - "A property type was duplicated.", - "Unknown experimenter id specified.", - "Unknown exp_type for experimenter id.", - "Unknown value for experimenter id.", - "Permissions error.", - "Unspecified error.", - "Permissions error.", - "Bundle ID doesn't exist.", - "Bundle ID already exists.", - "Bundle ID is closed.", - "Too many bundle IDs.", - "Unsupported of unknown message control type.", - "Unsupported, unknown, or inconsistent flags.", - "Length problem in included message.", - "Inconsistent or duplicate XID.", - "Unsupported message in this bundle.", - "Unsupported message combination in this bundle.", - "Cant handle this many messages in bundle.", - "One message in bundle failed.", - "Bundle is taking too long.", - "Bundle is locking the resource.", -}; - -static enum ofperr -ofperr_of14_decode(uint32_t vendor, uint16_t type, uint16_t code) -{ - switch (((uint64_t) vendor << 32) | (type << 16) | code) { - case (0 << 16) | 0: - return OFPERR_OFPHFC_INCOMPATIBLE; - case (0 << 16) | 1: - return OFPERR_OFPHFC_EPERM; - case (1 << 16) | 0: - return OFPERR_OFPBRC_BAD_VERSION; - case (1 << 16) | 1: - return OFPERR_OFPBRC_BAD_TYPE; - case (1 << 16) | 2: - return OFPERR_OFPBRC_BAD_STAT; - case (1 << 16) | 3: - return OFPERR_OFPBRC_BAD_VENDOR; - case (1 << 16) | 4: - return OFPERR_OFPBRC_BAD_SUBTYPE; - case (1 << 16) | 5: - return OFPERR_OFPBRC_EPERM; - case (1 << 16) | 6: - return OFPERR_OFPBRC_BAD_LEN; - case (1 << 16) | 7: - return OFPERR_OFPBRC_BUFFER_EMPTY; - case (1 << 16) | 8: - return OFPERR_OFPBRC_BUFFER_UNKNOWN; - case (1 << 16) | 9: - return OFPERR_OFPBRC_BAD_TABLE_ID; - case (1 << 16) | 10: - return OFPERR_OFPBRC_IS_SLAVE; - case (1 << 16) | 11: - return OFPERR_OFPBRC_BAD_PORT; - case (1 << 16) | 12: - return OFPERR_OFPBRC_BAD_PACKET; - case (1 << 16) | 13: - return OFPERR_OFPBRC_MULTIPART_BUFFER_OVERFLOW; - case (0x2320ULL << 32) | (2 << 16) | 0: - return OFPERR_NXBRC_NXM_INVALID; - case (0x2320ULL << 32) | (3 << 16) | 0: - return OFPERR_NXBRC_NXM_BAD_TYPE; - case (0x2320ULL << 32) | (4 << 16) | 0: - return OFPERR_NXBRC_MUST_BE_ZERO; - case (0x2320ULL << 32) | (5 << 16) | 0: - return OFPERR_NXBRC_BAD_REASON; - case (0x2320ULL << 32) | (6 << 16) | 0: - return OFPERR_NXBRC_FM_DUPLICATE_ID; - case (0x2320ULL << 32) | (7 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_FLAGS; - case (0x2320ULL << 32) | (8 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_ID; - case (0x2320ULL << 32) | (9 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_EVENT; - case (0x2320ULL << 32) | (10 << 16) | 0: - return OFPERR_NXBRC_UNENCODABLE_ERROR; - case (2 << 16) | 0: - return OFPERR_OFPBAC_BAD_TYPE; - case (2 << 16) | 1: - return OFPERR_OFPBAC_BAD_LEN; - case (2 << 16) | 2: - return OFPERR_OFPBAC_BAD_VENDOR; - case (2 << 16) | 3: - return OFPERR_OFPBAC_BAD_VENDOR_TYPE; - case (2 << 16) | 4: - return OFPERR_OFPBAC_BAD_OUT_PORT; - case (2 << 16) | 5: - return OFPERR_OFPBAC_BAD_ARGUMENT; - case (2 << 16) | 6: - return OFPERR_OFPBAC_EPERM; - case (2 << 16) | 7: - return OFPERR_OFPBAC_TOO_MANY; - case (2 << 16) | 8: - return OFPERR_OFPBAC_BAD_QUEUE; - case (2 << 16) | 9: - return OFPERR_OFPBAC_BAD_OUT_GROUP; - case (2 << 16) | 10: - return OFPERR_OFPBAC_MATCH_INCONSISTENT; - case (2 << 16) | 11: - return OFPERR_OFPBAC_UNSUPPORTED_ORDER; - case (2 << 16) | 12: - return OFPERR_OFPBAC_BAD_TAG; - case (2 << 16) | 13: - return OFPERR_OFPBAC_BAD_SET_TYPE; - case (2 << 16) | 14: - return OFPERR_OFPBAC_BAD_SET_LEN; - case (2 << 16) | 15: - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - case (0x2320ULL << 32) | (11 << 16) | 0: - return OFPERR_NXBAC_MUST_BE_ZERO; - case (3 << 16) | 0: - return OFPERR_OFPBIC_UNKNOWN_INST; - case (3 << 16) | 1: - return OFPERR_OFPBIC_UNSUP_INST; - case (3 << 16) | 2: - return OFPERR_OFPBIC_BAD_TABLE_ID; - case (3 << 16) | 3: - return OFPERR_OFPBIC_UNSUP_METADATA; - case (3 << 16) | 4: - return OFPERR_OFPBIC_UNSUP_METADATA_MASK; - case (3 << 16) | 5: - return OFPERR_OFPBIC_BAD_EXPERIMENTER; - case (3 << 16) | 6: - return OFPERR_OFPBIC_BAD_EXP_TYPE; - case (3 << 16) | 7: - return OFPERR_OFPBIC_BAD_LEN; - case (3 << 16) | 8: - return OFPERR_OFPBIC_EPERM; - case (4 << 16) | 0: - return OFPERR_OFPBMC_BAD_TYPE; - case (4 << 16) | 1: - return OFPERR_OFPBMC_BAD_LEN; - case (4 << 16) | 2: - return OFPERR_OFPBMC_BAD_TAG; - case (4 << 16) | 3: - return OFPERR_OFPBMC_BAD_DL_ADDR_MASK; - case (4 << 16) | 4: - return OFPERR_OFPBMC_BAD_NW_ADDR_MASK; - case (4 << 16) | 5: - return OFPERR_OFPBMC_BAD_WILDCARDS; - case (4 << 16) | 6: - return OFPERR_OFPBMC_BAD_FIELD; - case (4 << 16) | 7: - return OFPERR_OFPBMC_BAD_VALUE; - case (4 << 16) | 8: - return OFPERR_OFPBMC_BAD_MASK; - case (4 << 16) | 9: - return OFPERR_OFPBMC_BAD_PREREQ; - case (4 << 16) | 10: - return OFPERR_OFPBMC_DUP_FIELD; - case (4 << 16) | 11: - return OFPERR_OFPBMC_EPERM; - case (5 << 16) | 0: - return OFPERR_OFPFMFC_UNKNOWN; - case (5 << 16) | 1: - return OFPERR_OFPFMFC_TABLE_FULL; - case (5 << 16) | 2: - return OFPERR_OFPFMFC_BAD_TABLE_ID; - case (5 << 16) | 3: - return OFPERR_OFPFMFC_OVERLAP; - case (5 << 16) | 4: - return OFPERR_OFPFMFC_EPERM; - case (5 << 16) | 5: - return OFPERR_OFPFMFC_BAD_TIMEOUT; - case (5 << 16) | 6: - return OFPERR_OFPFMFC_BAD_COMMAND; - case (5 << 16) | 7: - return OFPERR_OFPFMFC_BAD_FLAGS; - case (0x2320ULL << 32) | (12 << 16) | 0: - return OFPERR_NXFMFC_HARDWARE; - case (0x2320ULL << 32) | (13 << 16) | 0: - return OFPERR_NXFMFC_BAD_TABLE_ID; - case (6 << 16) | 0: - return OFPERR_OFPGMFC_GROUP_EXISTS; - case (6 << 16) | 1: - return OFPERR_OFPGMFC_INVALID_GROUP; - case (6 << 16) | 2: - return OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED; - case (6 << 16) | 3: - return OFPERR_OFPGMFC_OUT_OF_GROUPS; - case (6 << 16) | 4: - return OFPERR_OFPGMFC_OUT_OF_BUCKETS; - case (6 << 16) | 5: - return OFPERR_OFPGMFC_CHAINING_UNSUPPORTED; - case (6 << 16) | 6: - return OFPERR_OFPGMFC_WATCH_UNSUPPORTED; - case (6 << 16) | 7: - return OFPERR_OFPGMFC_LOOP; - case (6 << 16) | 8: - return OFPERR_OFPGMFC_UNKNOWN_GROUP; - case (6 << 16) | 9: - return OFPERR_OFPGMFC_CHAINED_GROUP; - case (6 << 16) | 10: - return OFPERR_OFPGMFC_BAD_TYPE; - case (6 << 16) | 11: - return OFPERR_OFPGMFC_BAD_COMMAND; - case (6 << 16) | 12: - return OFPERR_OFPGMFC_BAD_BUCKET; - case (6 << 16) | 13: - return OFPERR_OFPGMFC_BAD_WATCH; - case (6 << 16) | 14: - return OFPERR_OFPGMFC_EPERM; - case (7 << 16) | 0: - return OFPERR_OFPPMFC_BAD_PORT; - case (7 << 16) | 1: - return OFPERR_OFPPMFC_BAD_HW_ADDR; - case (7 << 16) | 2: - return OFPERR_OFPPMFC_BAD_CONFIG; - case (7 << 16) | 3: - return OFPERR_OFPPMFC_BAD_ADVERTISE; - case (7 << 16) | 4: - return OFPERR_OFPPMFC_EPERM; - case (8 << 16) | 0: - return OFPERR_OFPTMFC_BAD_TABLE; - case (8 << 16) | 1: - return OFPERR_OFPTMFC_BAD_CONFIG; - case (8 << 16) | 2: - return OFPERR_OFPTMFC_EPERM; - case (9 << 16) | 0: - return OFPERR_OFPQOFC_BAD_PORT; - case (9 << 16) | 1: - return OFPERR_OFPQOFC_BAD_QUEUE; - case (9 << 16) | 2: - return OFPERR_OFPQOFC_EPERM; - case (10 << 16) | 0: - return OFPERR_OFPSCFC_BAD_FLAGS; - case (10 << 16) | 1: - return OFPERR_OFPSCFC_BAD_LEN; - case (10 << 16) | 2: - return OFPERR_OFPSCFC_EPERM; - case (11 << 16) | 0: - return OFPERR_OFPRRFC_STALE; - case (11 << 16) | 1: - return OFPERR_OFPRRFC_UNSUP; - case (11 << 16) | 2: - return OFPERR_OFPRRFC_BAD_ROLE; - case (12 << 16) | 0: - return OFPERR_OFPMMFC_UNKNOWN; - case (12 << 16) | 1: - return OFPERR_OFPMMFC_METER_EXISTS; - case (12 << 16) | 2: - return OFPERR_OFPMMFC_INVALID_METER; - case (12 << 16) | 3: - return OFPERR_OFPMMFC_UNKNOWN_METER; - case (12 << 16) | 4: - return OFPERR_OFPMMFC_BAD_COMMAND; - case (12 << 16) | 5: - return OFPERR_OFPMMFC_BAD_FLAGS; - case (12 << 16) | 6: - return OFPERR_OFPMMFC_BAD_RATE; - case (12 << 16) | 7: - return OFPERR_OFPMMFC_BAD_BURST; - case (12 << 16) | 8: - return OFPERR_OFPMMFC_BAD_BAND; - case (12 << 16) | 9: - return OFPERR_OFPMMFC_BAD_BAND_VALUE; - case (12 << 16) | 10: - return OFPERR_OFPMMFC_OUT_OF_METERS; - case (12 << 16) | 11: - return OFPERR_OFPMMFC_OUT_OF_BANDS; - case (13 << 16) | 0: - return OFPERR_OFPTFFC_BAD_TABLE; - case (13 << 16) | 1: - return OFPERR_OFPTFFC_BAD_METADATA; - case (13 << 16) | 5: - return OFPERR_OFPTFFC_EPERM; - case (14 << 16) | 0: - return OFPERR_OFPBPC_BAD_TYPE; - case (14 << 16) | 1: - return OFPERR_OFPBPC_BAD_LEN; - case (14 << 16) | 2: - return OFPERR_OFPBPC_BAD_VALUE; - case (14 << 16) | 3: - return OFPERR_OFPBPC_TOO_MANY; - case (14 << 16) | 4: - return OFPERR_OFPBPC_DUP_TYPE; - case (14 << 16) | 5: - return OFPERR_OFPBPC_BAD_EXPERIMENTER; - case (14 << 16) | 6: - return OFPERR_OFPBPC_BAD_EXP_TYPE; - case (14 << 16) | 7: - return OFPERR_OFPBPC_BAD_EXP_VALUE; - case (14 << 16) | 8: - return OFPERR_OFPBPC_EPERM; - case (17 << 16) | 0: - return OFPERR_OFPBFC_UNKNOWN; - case (17 << 16) | 1: - return OFPERR_OFPBFC_EPERM; - case (17 << 16) | 2: - return OFPERR_OFPBFC_BAD_ID; - case (17 << 16) | 3: - return OFPERR_OFPBFC_BUNDLE_EXIST; - case (17 << 16) | 4: - return OFPERR_OFPBFC_BUNDLE_CLOSED; - case (17 << 16) | 5: - return OFPERR_OFPBFC_OUT_OF_BUNDLES; - case (17 << 16) | 6: - return OFPERR_OFPBFC_BAD_TYPE; - case (17 << 16) | 7: - return OFPERR_OFPBFC_BAD_FLAGS; - case (17 << 16) | 8: - return OFPERR_OFPBFC_MSG_BAD_LEN; - case (17 << 16) | 9: - return OFPERR_OFPBFC_MSG_BAD_XID; - case (17 << 16) | 10: - return OFPERR_OFPBFC_MSG_UNSUP; - case (17 << 16) | 11: - return OFPERR_OFPBFC_MSG_CONFLICT; - case (17 << 16) | 12: - return OFPERR_OFPBFC_MSG_TOO_MANY; - case (17 << 16) | 13: - return OFPERR_OFPBFC_MSG_FAILED; - case (17 << 16) | 14: - return OFPERR_OFPBFC_TIMEOUT; - case (17 << 16) | 15: - return OFPERR_OFPBFC_BUNDLE_IN_PROGRESS; - } - - return 0; -} - -static const struct ofperr_domain ofperr_of14 = { - "OpenFlow 1.4", - 5, - ofperr_of14_decode, - { - { 0x0, 0, 0 }, /* OFPHFC_INCOMPATIBLE */ - { 0x0, 0, 1 }, /* OFPHFC_EPERM */ - { 0x0, 1, 0 }, /* OFPBRC_BAD_VERSION */ - { 0x0, 1, 1 }, /* OFPBRC_BAD_TYPE */ - { 0x0, 1, 2 }, /* OFPBRC_BAD_STAT */ - { 0x0, 1, 3 }, /* OFPBRC_BAD_VENDOR */ - { 0x0, 1, 4 }, /* OFPBRC_BAD_SUBTYPE */ - { 0x0, 1, 5 }, /* OFPBRC_EPERM */ - { 0x0, 1, 6 }, /* OFPBRC_BAD_LEN */ - { 0x0, 1, 7 }, /* OFPBRC_BUFFER_EMPTY */ - { 0x0, 1, 8 }, /* OFPBRC_BUFFER_UNKNOWN */ - { 0x0, 1, 9 }, /* OFPBRC_BAD_TABLE_ID */ - { 0x0, 1, 10 }, /* OFPBRC_IS_SLAVE */ - { 0x0, 1, 11 }, /* OFPBRC_BAD_PORT */ - { 0x0, 1, 12 }, /* OFPBRC_BAD_PACKET */ - { 0x0, 1, 13 }, /* OFPBRC_MULTIPART_BUFFER_OVERFLOW */ - { 0x2320, 2, 0 }, /* NXBRC_NXM_INVALID */ - { 0x2320, 3, 0 }, /* NXBRC_NXM_BAD_TYPE */ - { 0x2320, 4, 0 }, /* NXBRC_MUST_BE_ZERO */ - { 0x2320, 5, 0 }, /* NXBRC_BAD_REASON */ - { 0x2320, 6, 0 }, /* NXBRC_FM_DUPLICATE_ID */ - { 0x2320, 7, 0 }, /* NXBRC_FM_BAD_FLAGS */ - { 0x2320, 8, 0 }, /* NXBRC_FM_BAD_ID */ - { 0x2320, 9, 0 }, /* NXBRC_FM_BAD_EVENT */ - { 0x2320, 10, 0 }, /* NXBRC_UNENCODABLE_ERROR */ - { 0x0, 2, 0 }, /* OFPBAC_BAD_TYPE */ - { 0x0, 2, 1 }, /* OFPBAC_BAD_LEN */ - { 0x0, 2, 2 }, /* OFPBAC_BAD_VENDOR */ - { 0x0, 2, 3 }, /* OFPBAC_BAD_VENDOR_TYPE */ - { 0x0, 2, 4 }, /* OFPBAC_BAD_OUT_PORT */ - { 0x0, 2, 5 }, /* OFPBAC_BAD_ARGUMENT */ - { 0x0, 2, 6 }, /* OFPBAC_EPERM */ - { 0x0, 2, 7 }, /* OFPBAC_TOO_MANY */ - { 0x0, 2, 8 }, /* OFPBAC_BAD_QUEUE */ - { 0x0, 2, 9 }, /* OFPBAC_BAD_OUT_GROUP */ - { 0x0, 2, 10 }, /* OFPBAC_MATCH_INCONSISTENT */ - { 0x0, 2, 11 }, /* OFPBAC_UNSUPPORTED_ORDER */ - { 0x0, 2, 12 }, /* OFPBAC_BAD_TAG */ - { 0x0, 2, 13 }, /* OFPBAC_BAD_SET_TYPE */ - { 0x0, 2, 14 }, /* OFPBAC_BAD_SET_LEN */ - { 0x0, 2, 15 }, /* OFPBAC_BAD_SET_ARGUMENT */ - { 0x2320, 11, 0 }, /* NXBAC_MUST_BE_ZERO */ - { 0x0, 3, 0 }, /* OFPBIC_UNKNOWN_INST */ - { 0x0, 3, 1 }, /* OFPBIC_UNSUP_INST */ - { 0x0, 3, 2 }, /* OFPBIC_BAD_TABLE_ID */ - { 0x0, 3, 3 }, /* OFPBIC_UNSUP_METADATA */ - { 0x0, 3, 4 }, /* OFPBIC_UNSUP_METADATA_MASK */ - { 0x0, 3, 5 }, /* OFPBIC_BAD_EXPERIMENTER */ - { 0x0, 3, 6 }, /* OFPBIC_BAD_EXP_TYPE */ - { 0x0, 3, 7 }, /* OFPBIC_BAD_LEN */ - { 0x0, 3, 8 }, /* OFPBIC_EPERM */ - { 0x4f4e4600, 2600, -1 }, /* ONFBIC_DUP_INSTRUCTION */ - { 0x0, 4, 0 }, /* OFPBMC_BAD_TYPE */ - { 0x0, 4, 1 }, /* OFPBMC_BAD_LEN */ - { 0x0, 4, 2 }, /* OFPBMC_BAD_TAG */ - { 0x0, 4, 3 }, /* OFPBMC_BAD_DL_ADDR_MASK */ - { 0x0, 4, 4 }, /* OFPBMC_BAD_NW_ADDR_MASK */ - { 0x0, 4, 5 }, /* OFPBMC_BAD_WILDCARDS */ - { 0x0, 4, 6 }, /* OFPBMC_BAD_FIELD */ - { 0x0, 4, 7 }, /* OFPBMC_BAD_VALUE */ - { 0x0, 4, 8 }, /* OFPBMC_BAD_MASK */ - { 0x0, 4, 9 }, /* OFPBMC_BAD_PREREQ */ - { 0x0, 4, 10 }, /* OFPBMC_DUP_FIELD */ - { 0x0, 4, 11 }, /* OFPBMC_EPERM */ - { 0x0, 5, 0 }, /* OFPFMFC_UNKNOWN */ - { 0x0, 5, 1 }, /* OFPFMFC_TABLE_FULL */ - { 0x0, 5, 2 }, /* OFPFMFC_BAD_TABLE_ID */ - { 0x0, 5, 3 }, /* OFPFMFC_OVERLAP */ - { 0x0, 5, 4 }, /* OFPFMFC_EPERM */ - { 0x0, 5, 5 }, /* OFPFMFC_BAD_TIMEOUT */ - { -1, -1, -1 }, /* OFPFMFC_BAD_EMERG_TIMEOUT */ - { 0x0, 5, 6 }, /* OFPFMFC_BAD_COMMAND */ - { 0x0, 5, 7 }, /* OFPFMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPFMFC_UNSUPPORTED */ - { 0x2320, 12, 0 }, /* NXFMFC_HARDWARE */ - { 0x2320, 13, 0 }, /* NXFMFC_BAD_TABLE_ID */ - { 0x0, 6, 0 }, /* OFPGMFC_GROUP_EXISTS */ - { 0x0, 6, 1 }, /* OFPGMFC_INVALID_GROUP */ - { 0x0, 6, 2 }, /* OFPGMFC_WEIGHT_UNSUPPORTED */ - { 0x0, 6, 3 }, /* OFPGMFC_OUT_OF_GROUPS */ - { 0x0, 6, 4 }, /* OFPGMFC_OUT_OF_BUCKETS */ - { 0x0, 6, 5 }, /* OFPGMFC_CHAINING_UNSUPPORTED */ - { 0x0, 6, 6 }, /* OFPGMFC_WATCH_UNSUPPORTED */ - { 0x0, 6, 7 }, /* OFPGMFC_LOOP */ - { 0x0, 6, 8 }, /* OFPGMFC_UNKNOWN_GROUP */ - { 0x0, 6, 9 }, /* OFPGMFC_CHAINED_GROUP */ - { 0x0, 6, 10 }, /* OFPGMFC_BAD_TYPE */ - { 0x0, 6, 11 }, /* OFPGMFC_BAD_COMMAND */ - { 0x0, 6, 12 }, /* OFPGMFC_BAD_BUCKET */ - { 0x0, 6, 13 }, /* OFPGMFC_BAD_WATCH */ - { 0x0, 6, 14 }, /* OFPGMFC_EPERM */ - { 0x0, 7, 0 }, /* OFPPMFC_BAD_PORT */ - { 0x0, 7, 1 }, /* OFPPMFC_BAD_HW_ADDR */ - { 0x0, 7, 2 }, /* OFPPMFC_BAD_CONFIG */ - { 0x0, 7, 3 }, /* OFPPMFC_BAD_ADVERTISE */ - { 0x0, 7, 4 }, /* OFPPMFC_EPERM */ - { 0x0, 8, 0 }, /* OFPTMFC_BAD_TABLE */ - { 0x0, 8, 1 }, /* OFPTMFC_BAD_CONFIG */ - { 0x0, 8, 2 }, /* OFPTMFC_EPERM */ - { 0x0, 9, 0 }, /* OFPQOFC_BAD_PORT */ - { 0x0, 9, 1 }, /* OFPQOFC_BAD_QUEUE */ - { 0x0, 9, 2 }, /* OFPQOFC_EPERM */ - { 0x0, 10, 0 }, /* OFPSCFC_BAD_FLAGS */ - { 0x0, 10, 1 }, /* OFPSCFC_BAD_LEN */ - { 0x0, 10, 2 }, /* OFPSCFC_EPERM */ - { 0x0, 11, 0 }, /* OFPRRFC_STALE */ - { 0x0, 11, 1 }, /* OFPRRFC_UNSUP */ - { 0x0, 11, 2 }, /* OFPRRFC_BAD_ROLE */ - { 0x0, 12, 0 }, /* OFPMMFC_UNKNOWN */ - { 0x0, 12, 1 }, /* OFPMMFC_METER_EXISTS */ - { 0x0, 12, 2 }, /* OFPMMFC_INVALID_METER */ - { 0x0, 12, 3 }, /* OFPMMFC_UNKNOWN_METER */ - { 0x0, 12, 4 }, /* OFPMMFC_BAD_COMMAND */ - { 0x0, 12, 5 }, /* OFPMMFC_BAD_FLAGS */ - { 0x0, 12, 6 }, /* OFPMMFC_BAD_RATE */ - { 0x0, 12, 7 }, /* OFPMMFC_BAD_BURST */ - { 0x0, 12, 8 }, /* OFPMMFC_BAD_BAND */ - { 0x0, 12, 9 }, /* OFPMMFC_BAD_BAND_VALUE */ - { 0x0, 12, 10 }, /* OFPMMFC_OUT_OF_METERS */ - { 0x0, 12, 11 }, /* OFPMMFC_OUT_OF_BANDS */ - { 0x0, 13, 0 }, /* OFPTFFC_BAD_TABLE */ - { 0x0, 13, 1 }, /* OFPTFFC_BAD_METADATA */ - { 0x0, 13, 5 }, /* OFPTFFC_EPERM */ - { 0x0, 14, 0 }, /* OFPBPC_BAD_TYPE */ - { 0x0, 14, 1 }, /* OFPBPC_BAD_LEN */ - { 0x0, 14, 2 }, /* OFPBPC_BAD_VALUE */ - { 0x0, 14, 3 }, /* OFPBPC_TOO_MANY */ - { 0x0, 14, 4 }, /* OFPBPC_DUP_TYPE */ - { 0x0, 14, 5 }, /* OFPBPC_BAD_EXPERIMENTER */ - { 0x0, 14, 6 }, /* OFPBPC_BAD_EXP_TYPE */ - { 0x0, 14, 7 }, /* OFPBPC_BAD_EXP_VALUE */ - { 0x0, 14, 8 }, /* OFPBPC_EPERM */ - { 0x0, 17, 0 }, /* OFPBFC_UNKNOWN */ - { 0x0, 17, 1 }, /* OFPBFC_EPERM */ - { 0x0, 17, 2 }, /* OFPBFC_BAD_ID */ - { 0x0, 17, 3 }, /* OFPBFC_BUNDLE_EXIST */ - { 0x0, 17, 4 }, /* OFPBFC_BUNDLE_CLOSED */ - { 0x0, 17, 5 }, /* OFPBFC_OUT_OF_BUNDLES */ - { 0x0, 17, 6 }, /* OFPBFC_BAD_TYPE */ - { 0x0, 17, 7 }, /* OFPBFC_BAD_FLAGS */ - { 0x0, 17, 8 }, /* OFPBFC_MSG_BAD_LEN */ - { 0x0, 17, 9 }, /* OFPBFC_MSG_BAD_XID */ - { 0x0, 17, 10 }, /* OFPBFC_MSG_UNSUP */ - { 0x0, 17, 11 }, /* OFPBFC_MSG_CONFLICT */ - { 0x0, 17, 12 }, /* OFPBFC_MSG_TOO_MANY */ - { 0x0, 17, 13 }, /* OFPBFC_MSG_FAILED */ - { 0x0, 17, 14 }, /* OFPBFC_TIMEOUT */ - { 0x0, 17, 15 }, /* OFPBFC_BUNDLE_IN_PROGRESS */ - }, -}; - -static enum ofperr -ofperr_of15_decode(uint32_t vendor, uint16_t type, uint16_t code) -{ - switch (((uint64_t) vendor << 32) | (type << 16) | code) { - case (0 << 16) | 0: - return OFPERR_OFPHFC_INCOMPATIBLE; - case (0 << 16) | 1: - return OFPERR_OFPHFC_EPERM; - case (1 << 16) | 0: - return OFPERR_OFPBRC_BAD_VERSION; - case (1 << 16) | 1: - return OFPERR_OFPBRC_BAD_TYPE; - case (1 << 16) | 2: - return OFPERR_OFPBRC_BAD_STAT; - case (1 << 16) | 3: - return OFPERR_OFPBRC_BAD_VENDOR; - case (1 << 16) | 4: - return OFPERR_OFPBRC_BAD_SUBTYPE; - case (1 << 16) | 5: - return OFPERR_OFPBRC_EPERM; - case (1 << 16) | 6: - return OFPERR_OFPBRC_BAD_LEN; - case (1 << 16) | 7: - return OFPERR_OFPBRC_BUFFER_EMPTY; - case (1 << 16) | 8: - return OFPERR_OFPBRC_BUFFER_UNKNOWN; - case (1 << 16) | 9: - return OFPERR_OFPBRC_BAD_TABLE_ID; - case (1 << 16) | 10: - return OFPERR_OFPBRC_IS_SLAVE; - case (1 << 16) | 11: - return OFPERR_OFPBRC_BAD_PORT; - case (1 << 16) | 12: - return OFPERR_OFPBRC_BAD_PACKET; - case (1 << 16) | 13: - return OFPERR_OFPBRC_MULTIPART_BUFFER_OVERFLOW; - case (0x2320ULL << 32) | (2 << 16) | 0: - return OFPERR_NXBRC_NXM_INVALID; - case (0x2320ULL << 32) | (3 << 16) | 0: - return OFPERR_NXBRC_NXM_BAD_TYPE; - case (0x2320ULL << 32) | (4 << 16) | 0: - return OFPERR_NXBRC_MUST_BE_ZERO; - case (0x2320ULL << 32) | (5 << 16) | 0: - return OFPERR_NXBRC_BAD_REASON; - case (0x2320ULL << 32) | (6 << 16) | 0: - return OFPERR_NXBRC_FM_DUPLICATE_ID; - case (0x2320ULL << 32) | (7 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_FLAGS; - case (0x2320ULL << 32) | (8 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_ID; - case (0x2320ULL << 32) | (9 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_EVENT; - case (0x2320ULL << 32) | (10 << 16) | 0: - return OFPERR_NXBRC_UNENCODABLE_ERROR; - case (2 << 16) | 0: - return OFPERR_OFPBAC_BAD_TYPE; - case (2 << 16) | 1: - return OFPERR_OFPBAC_BAD_LEN; - case (2 << 16) | 2: - return OFPERR_OFPBAC_BAD_VENDOR; - case (2 << 16) | 3: - return OFPERR_OFPBAC_BAD_VENDOR_TYPE; - case (2 << 16) | 4: - return OFPERR_OFPBAC_BAD_OUT_PORT; - case (2 << 16) | 5: - return OFPERR_OFPBAC_BAD_ARGUMENT; - case (2 << 16) | 6: - return OFPERR_OFPBAC_EPERM; - case (2 << 16) | 7: - return OFPERR_OFPBAC_TOO_MANY; - case (2 << 16) | 8: - return OFPERR_OFPBAC_BAD_QUEUE; - case (2 << 16) | 9: - return OFPERR_OFPBAC_BAD_OUT_GROUP; - case (2 << 16) | 10: - return OFPERR_OFPBAC_MATCH_INCONSISTENT; - case (2 << 16) | 11: - return OFPERR_OFPBAC_UNSUPPORTED_ORDER; - case (2 << 16) | 12: - return OFPERR_OFPBAC_BAD_TAG; - case (2 << 16) | 13: - return OFPERR_OFPBAC_BAD_SET_TYPE; - case (2 << 16) | 14: - return OFPERR_OFPBAC_BAD_SET_LEN; - case (2 << 16) | 15: - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - case (0x2320ULL << 32) | (11 << 16) | 0: - return OFPERR_NXBAC_MUST_BE_ZERO; - case (3 << 16) | 0: - return OFPERR_OFPBIC_UNKNOWN_INST; - case (3 << 16) | 1: - return OFPERR_OFPBIC_UNSUP_INST; - case (3 << 16) | 2: - return OFPERR_OFPBIC_BAD_TABLE_ID; - case (3 << 16) | 3: - return OFPERR_OFPBIC_UNSUP_METADATA; - case (3 << 16) | 4: - return OFPERR_OFPBIC_UNSUP_METADATA_MASK; - case (3 << 16) | 5: - return OFPERR_OFPBIC_BAD_EXPERIMENTER; - case (3 << 16) | 6: - return OFPERR_OFPBIC_BAD_EXP_TYPE; - case (3 << 16) | 7: - return OFPERR_OFPBIC_BAD_LEN; - case (3 << 16) | 8: - return OFPERR_OFPBIC_EPERM; - case (4 << 16) | 0: - return OFPERR_OFPBMC_BAD_TYPE; - case (4 << 16) | 1: - return OFPERR_OFPBMC_BAD_LEN; - case (4 << 16) | 2: - return OFPERR_OFPBMC_BAD_TAG; - case (4 << 16) | 3: - return OFPERR_OFPBMC_BAD_DL_ADDR_MASK; - case (4 << 16) | 4: - return OFPERR_OFPBMC_BAD_NW_ADDR_MASK; - case (4 << 16) | 5: - return OFPERR_OFPBMC_BAD_WILDCARDS; - case (4 << 16) | 6: - return OFPERR_OFPBMC_BAD_FIELD; - case (4 << 16) | 7: - return OFPERR_OFPBMC_BAD_VALUE; - case (4 << 16) | 8: - return OFPERR_OFPBMC_BAD_MASK; - case (4 << 16) | 9: - return OFPERR_OFPBMC_BAD_PREREQ; - case (4 << 16) | 10: - return OFPERR_OFPBMC_DUP_FIELD; - case (4 << 16) | 11: - return OFPERR_OFPBMC_EPERM; - case (5 << 16) | 0: - return OFPERR_OFPFMFC_UNKNOWN; - case (5 << 16) | 1: - return OFPERR_OFPFMFC_TABLE_FULL; - case (5 << 16) | 2: - return OFPERR_OFPFMFC_BAD_TABLE_ID; - case (5 << 16) | 3: - return OFPERR_OFPFMFC_OVERLAP; - case (5 << 16) | 4: - return OFPERR_OFPFMFC_EPERM; - case (5 << 16) | 5: - return OFPERR_OFPFMFC_BAD_TIMEOUT; - case (5 << 16) | 6: - return OFPERR_OFPFMFC_BAD_COMMAND; - case (5 << 16) | 7: - return OFPERR_OFPFMFC_BAD_FLAGS; - case (0x2320ULL << 32) | (12 << 16) | 0: - return OFPERR_NXFMFC_HARDWARE; - case (0x2320ULL << 32) | (13 << 16) | 0: - return OFPERR_NXFMFC_BAD_TABLE_ID; - case (6 << 16) | 0: - return OFPERR_OFPGMFC_GROUP_EXISTS; - case (6 << 16) | 1: - return OFPERR_OFPGMFC_INVALID_GROUP; - case (6 << 16) | 2: - return OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED; - case (6 << 16) | 3: - return OFPERR_OFPGMFC_OUT_OF_GROUPS; - case (6 << 16) | 4: - return OFPERR_OFPGMFC_OUT_OF_BUCKETS; - case (6 << 16) | 5: - return OFPERR_OFPGMFC_CHAINING_UNSUPPORTED; - case (6 << 16) | 6: - return OFPERR_OFPGMFC_WATCH_UNSUPPORTED; - case (6 << 16) | 7: - return OFPERR_OFPGMFC_LOOP; - case (6 << 16) | 8: - return OFPERR_OFPGMFC_UNKNOWN_GROUP; - case (6 << 16) | 9: - return OFPERR_OFPGMFC_CHAINED_GROUP; - case (6 << 16) | 10: - return OFPERR_OFPGMFC_BAD_TYPE; - case (6 << 16) | 11: - return OFPERR_OFPGMFC_BAD_COMMAND; - case (6 << 16) | 12: - return OFPERR_OFPGMFC_BAD_BUCKET; - case (6 << 16) | 13: - return OFPERR_OFPGMFC_BAD_WATCH; - case (6 << 16) | 14: - return OFPERR_OFPGMFC_EPERM; - case (7 << 16) | 0: - return OFPERR_OFPPMFC_BAD_PORT; - case (7 << 16) | 1: - return OFPERR_OFPPMFC_BAD_HW_ADDR; - case (7 << 16) | 2: - return OFPERR_OFPPMFC_BAD_CONFIG; - case (7 << 16) | 3: - return OFPERR_OFPPMFC_BAD_ADVERTISE; - case (7 << 16) | 4: - return OFPERR_OFPPMFC_EPERM; - case (8 << 16) | 0: - return OFPERR_OFPTMFC_BAD_TABLE; - case (8 << 16) | 1: - return OFPERR_OFPTMFC_BAD_CONFIG; - case (8 << 16) | 2: - return OFPERR_OFPTMFC_EPERM; - case (9 << 16) | 0: - return OFPERR_OFPQOFC_BAD_PORT; - case (9 << 16) | 1: - return OFPERR_OFPQOFC_BAD_QUEUE; - case (9 << 16) | 2: - return OFPERR_OFPQOFC_EPERM; - case (10 << 16) | 0: - return OFPERR_OFPSCFC_BAD_FLAGS; - case (10 << 16) | 1: - return OFPERR_OFPSCFC_BAD_LEN; - case (10 << 16) | 2: - return OFPERR_OFPSCFC_EPERM; - case (11 << 16) | 0: - return OFPERR_OFPRRFC_STALE; - case (11 << 16) | 1: - return OFPERR_OFPRRFC_UNSUP; - case (11 << 16) | 2: - return OFPERR_OFPRRFC_BAD_ROLE; - case (12 << 16) | 0: - return OFPERR_OFPMMFC_UNKNOWN; - case (12 << 16) | 1: - return OFPERR_OFPMMFC_METER_EXISTS; - case (12 << 16) | 2: - return OFPERR_OFPMMFC_INVALID_METER; - case (12 << 16) | 3: - return OFPERR_OFPMMFC_UNKNOWN_METER; - case (12 << 16) | 4: - return OFPERR_OFPMMFC_BAD_COMMAND; - case (12 << 16) | 5: - return OFPERR_OFPMMFC_BAD_FLAGS; - case (12 << 16) | 6: - return OFPERR_OFPMMFC_BAD_RATE; - case (12 << 16) | 7: - return OFPERR_OFPMMFC_BAD_BURST; - case (12 << 16) | 8: - return OFPERR_OFPMMFC_BAD_BAND; - case (12 << 16) | 9: - return OFPERR_OFPMMFC_BAD_BAND_VALUE; - case (12 << 16) | 10: - return OFPERR_OFPMMFC_OUT_OF_METERS; - case (12 << 16) | 11: - return OFPERR_OFPMMFC_OUT_OF_BANDS; - case (13 << 16) | 0: - return OFPERR_OFPTFFC_BAD_TABLE; - case (13 << 16) | 1: - return OFPERR_OFPTFFC_BAD_METADATA; - case (13 << 16) | 5: - return OFPERR_OFPTFFC_EPERM; - case (14 << 16) | 0: - return OFPERR_OFPBPC_BAD_TYPE; - case (14 << 16) | 1: - return OFPERR_OFPBPC_BAD_LEN; - case (14 << 16) | 2: - return OFPERR_OFPBPC_BAD_VALUE; - case (14 << 16) | 3: - return OFPERR_OFPBPC_TOO_MANY; - case (14 << 16) | 4: - return OFPERR_OFPBPC_DUP_TYPE; - case (14 << 16) | 5: - return OFPERR_OFPBPC_BAD_EXPERIMENTER; - case (14 << 16) | 6: - return OFPERR_OFPBPC_BAD_EXP_TYPE; - case (14 << 16) | 7: - return OFPERR_OFPBPC_BAD_EXP_VALUE; - case (14 << 16) | 8: - return OFPERR_OFPBPC_EPERM; - case (17 << 16) | 0: - return OFPERR_OFPBFC_UNKNOWN; - case (17 << 16) | 1: - return OFPERR_OFPBFC_EPERM; - case (17 << 16) | 2: - return OFPERR_OFPBFC_BAD_ID; - case (17 << 16) | 3: - return OFPERR_OFPBFC_BUNDLE_EXIST; - case (17 << 16) | 4: - return OFPERR_OFPBFC_BUNDLE_CLOSED; - case (17 << 16) | 5: - return OFPERR_OFPBFC_OUT_OF_BUNDLES; - case (17 << 16) | 6: - return OFPERR_OFPBFC_BAD_TYPE; - case (17 << 16) | 7: - return OFPERR_OFPBFC_BAD_FLAGS; - case (17 << 16) | 8: - return OFPERR_OFPBFC_MSG_BAD_LEN; - case (17 << 16) | 9: - return OFPERR_OFPBFC_MSG_BAD_XID; - case (17 << 16) | 10: - return OFPERR_OFPBFC_MSG_UNSUP; - case (17 << 16) | 11: - return OFPERR_OFPBFC_MSG_CONFLICT; - case (17 << 16) | 12: - return OFPERR_OFPBFC_MSG_TOO_MANY; - case (17 << 16) | 13: - return OFPERR_OFPBFC_MSG_FAILED; - case (17 << 16) | 14: - return OFPERR_OFPBFC_TIMEOUT; - case (17 << 16) | 15: - return OFPERR_OFPBFC_BUNDLE_IN_PROGRESS; - } - - return 0; -} - -static const struct ofperr_domain ofperr_of15 = { - "OpenFlow 1.5", - 6, - ofperr_of15_decode, - { - { 0x0, 0, 0 }, /* OFPHFC_INCOMPATIBLE */ - { 0x0, 0, 1 }, /* OFPHFC_EPERM */ - { 0x0, 1, 0 }, /* OFPBRC_BAD_VERSION */ - { 0x0, 1, 1 }, /* OFPBRC_BAD_TYPE */ - { 0x0, 1, 2 }, /* OFPBRC_BAD_STAT */ - { 0x0, 1, 3 }, /* OFPBRC_BAD_VENDOR */ - { 0x0, 1, 4 }, /* OFPBRC_BAD_SUBTYPE */ - { 0x0, 1, 5 }, /* OFPBRC_EPERM */ - { 0x0, 1, 6 }, /* OFPBRC_BAD_LEN */ - { 0x0, 1, 7 }, /* OFPBRC_BUFFER_EMPTY */ - { 0x0, 1, 8 }, /* OFPBRC_BUFFER_UNKNOWN */ - { 0x0, 1, 9 }, /* OFPBRC_BAD_TABLE_ID */ - { 0x0, 1, 10 }, /* OFPBRC_IS_SLAVE */ - { 0x0, 1, 11 }, /* OFPBRC_BAD_PORT */ - { 0x0, 1, 12 }, /* OFPBRC_BAD_PACKET */ - { 0x0, 1, 13 }, /* OFPBRC_MULTIPART_BUFFER_OVERFLOW */ - { 0x2320, 2, 0 }, /* NXBRC_NXM_INVALID */ - { 0x2320, 3, 0 }, /* NXBRC_NXM_BAD_TYPE */ - { 0x2320, 4, 0 }, /* NXBRC_MUST_BE_ZERO */ - { 0x2320, 5, 0 }, /* NXBRC_BAD_REASON */ - { 0x2320, 6, 0 }, /* NXBRC_FM_DUPLICATE_ID */ - { 0x2320, 7, 0 }, /* NXBRC_FM_BAD_FLAGS */ - { 0x2320, 8, 0 }, /* NXBRC_FM_BAD_ID */ - { 0x2320, 9, 0 }, /* NXBRC_FM_BAD_EVENT */ - { 0x2320, 10, 0 }, /* NXBRC_UNENCODABLE_ERROR */ - { 0x0, 2, 0 }, /* OFPBAC_BAD_TYPE */ - { 0x0, 2, 1 }, /* OFPBAC_BAD_LEN */ - { 0x0, 2, 2 }, /* OFPBAC_BAD_VENDOR */ - { 0x0, 2, 3 }, /* OFPBAC_BAD_VENDOR_TYPE */ - { 0x0, 2, 4 }, /* OFPBAC_BAD_OUT_PORT */ - { 0x0, 2, 5 }, /* OFPBAC_BAD_ARGUMENT */ - { 0x0, 2, 6 }, /* OFPBAC_EPERM */ - { 0x0, 2, 7 }, /* OFPBAC_TOO_MANY */ - { 0x0, 2, 8 }, /* OFPBAC_BAD_QUEUE */ - { 0x0, 2, 9 }, /* OFPBAC_BAD_OUT_GROUP */ - { 0x0, 2, 10 }, /* OFPBAC_MATCH_INCONSISTENT */ - { 0x0, 2, 11 }, /* OFPBAC_UNSUPPORTED_ORDER */ - { 0x0, 2, 12 }, /* OFPBAC_BAD_TAG */ - { 0x0, 2, 13 }, /* OFPBAC_BAD_SET_TYPE */ - { 0x0, 2, 14 }, /* OFPBAC_BAD_SET_LEN */ - { 0x0, 2, 15 }, /* OFPBAC_BAD_SET_ARGUMENT */ - { 0x2320, 11, 0 }, /* NXBAC_MUST_BE_ZERO */ - { 0x0, 3, 0 }, /* OFPBIC_UNKNOWN_INST */ - { 0x0, 3, 1 }, /* OFPBIC_UNSUP_INST */ - { 0x0, 3, 2 }, /* OFPBIC_BAD_TABLE_ID */ - { 0x0, 3, 3 }, /* OFPBIC_UNSUP_METADATA */ - { 0x0, 3, 4 }, /* OFPBIC_UNSUP_METADATA_MASK */ - { 0x0, 3, 5 }, /* OFPBIC_BAD_EXPERIMENTER */ - { 0x0, 3, 6 }, /* OFPBIC_BAD_EXP_TYPE */ - { 0x0, 3, 7 }, /* OFPBIC_BAD_LEN */ - { 0x0, 3, 8 }, /* OFPBIC_EPERM */ - { 0x4f4e4600, 2600, -1 }, /* ONFBIC_DUP_INSTRUCTION */ - { 0x0, 4, 0 }, /* OFPBMC_BAD_TYPE */ - { 0x0, 4, 1 }, /* OFPBMC_BAD_LEN */ - { 0x0, 4, 2 }, /* OFPBMC_BAD_TAG */ - { 0x0, 4, 3 }, /* OFPBMC_BAD_DL_ADDR_MASK */ - { 0x0, 4, 4 }, /* OFPBMC_BAD_NW_ADDR_MASK */ - { 0x0, 4, 5 }, /* OFPBMC_BAD_WILDCARDS */ - { 0x0, 4, 6 }, /* OFPBMC_BAD_FIELD */ - { 0x0, 4, 7 }, /* OFPBMC_BAD_VALUE */ - { 0x0, 4, 8 }, /* OFPBMC_BAD_MASK */ - { 0x0, 4, 9 }, /* OFPBMC_BAD_PREREQ */ - { 0x0, 4, 10 }, /* OFPBMC_DUP_FIELD */ - { 0x0, 4, 11 }, /* OFPBMC_EPERM */ - { 0x0, 5, 0 }, /* OFPFMFC_UNKNOWN */ - { 0x0, 5, 1 }, /* OFPFMFC_TABLE_FULL */ - { 0x0, 5, 2 }, /* OFPFMFC_BAD_TABLE_ID */ - { 0x0, 5, 3 }, /* OFPFMFC_OVERLAP */ - { 0x0, 5, 4 }, /* OFPFMFC_EPERM */ - { 0x0, 5, 5 }, /* OFPFMFC_BAD_TIMEOUT */ - { -1, -1, -1 }, /* OFPFMFC_BAD_EMERG_TIMEOUT */ - { 0x0, 5, 6 }, /* OFPFMFC_BAD_COMMAND */ - { 0x0, 5, 7 }, /* OFPFMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPFMFC_UNSUPPORTED */ - { 0x2320, 12, 0 }, /* NXFMFC_HARDWARE */ - { 0x2320, 13, 0 }, /* NXFMFC_BAD_TABLE_ID */ - { 0x0, 6, 0 }, /* OFPGMFC_GROUP_EXISTS */ - { 0x0, 6, 1 }, /* OFPGMFC_INVALID_GROUP */ - { 0x0, 6, 2 }, /* OFPGMFC_WEIGHT_UNSUPPORTED */ - { 0x0, 6, 3 }, /* OFPGMFC_OUT_OF_GROUPS */ - { 0x0, 6, 4 }, /* OFPGMFC_OUT_OF_BUCKETS */ - { 0x0, 6, 5 }, /* OFPGMFC_CHAINING_UNSUPPORTED */ - { 0x0, 6, 6 }, /* OFPGMFC_WATCH_UNSUPPORTED */ - { 0x0, 6, 7 }, /* OFPGMFC_LOOP */ - { 0x0, 6, 8 }, /* OFPGMFC_UNKNOWN_GROUP */ - { 0x0, 6, 9 }, /* OFPGMFC_CHAINED_GROUP */ - { 0x0, 6, 10 }, /* OFPGMFC_BAD_TYPE */ - { 0x0, 6, 11 }, /* OFPGMFC_BAD_COMMAND */ - { 0x0, 6, 12 }, /* OFPGMFC_BAD_BUCKET */ - { 0x0, 6, 13 }, /* OFPGMFC_BAD_WATCH */ - { 0x0, 6, 14 }, /* OFPGMFC_EPERM */ - { 0x0, 7, 0 }, /* OFPPMFC_BAD_PORT */ - { 0x0, 7, 1 }, /* OFPPMFC_BAD_HW_ADDR */ - { 0x0, 7, 2 }, /* OFPPMFC_BAD_CONFIG */ - { 0x0, 7, 3 }, /* OFPPMFC_BAD_ADVERTISE */ - { 0x0, 7, 4 }, /* OFPPMFC_EPERM */ - { 0x0, 8, 0 }, /* OFPTMFC_BAD_TABLE */ - { 0x0, 8, 1 }, /* OFPTMFC_BAD_CONFIG */ - { 0x0, 8, 2 }, /* OFPTMFC_EPERM */ - { 0x0, 9, 0 }, /* OFPQOFC_BAD_PORT */ - { 0x0, 9, 1 }, /* OFPQOFC_BAD_QUEUE */ - { 0x0, 9, 2 }, /* OFPQOFC_EPERM */ - { 0x0, 10, 0 }, /* OFPSCFC_BAD_FLAGS */ - { 0x0, 10, 1 }, /* OFPSCFC_BAD_LEN */ - { 0x0, 10, 2 }, /* OFPSCFC_EPERM */ - { 0x0, 11, 0 }, /* OFPRRFC_STALE */ - { 0x0, 11, 1 }, /* OFPRRFC_UNSUP */ - { 0x0, 11, 2 }, /* OFPRRFC_BAD_ROLE */ - { 0x0, 12, 0 }, /* OFPMMFC_UNKNOWN */ - { 0x0, 12, 1 }, /* OFPMMFC_METER_EXISTS */ - { 0x0, 12, 2 }, /* OFPMMFC_INVALID_METER */ - { 0x0, 12, 3 }, /* OFPMMFC_UNKNOWN_METER */ - { 0x0, 12, 4 }, /* OFPMMFC_BAD_COMMAND */ - { 0x0, 12, 5 }, /* OFPMMFC_BAD_FLAGS */ - { 0x0, 12, 6 }, /* OFPMMFC_BAD_RATE */ - { 0x0, 12, 7 }, /* OFPMMFC_BAD_BURST */ - { 0x0, 12, 8 }, /* OFPMMFC_BAD_BAND */ - { 0x0, 12, 9 }, /* OFPMMFC_BAD_BAND_VALUE */ - { 0x0, 12, 10 }, /* OFPMMFC_OUT_OF_METERS */ - { 0x0, 12, 11 }, /* OFPMMFC_OUT_OF_BANDS */ - { 0x0, 13, 0 }, /* OFPTFFC_BAD_TABLE */ - { 0x0, 13, 1 }, /* OFPTFFC_BAD_METADATA */ - { 0x0, 13, 5 }, /* OFPTFFC_EPERM */ - { 0x0, 14, 0 }, /* OFPBPC_BAD_TYPE */ - { 0x0, 14, 1 }, /* OFPBPC_BAD_LEN */ - { 0x0, 14, 2 }, /* OFPBPC_BAD_VALUE */ - { 0x0, 14, 3 }, /* OFPBPC_TOO_MANY */ - { 0x0, 14, 4 }, /* OFPBPC_DUP_TYPE */ - { 0x0, 14, 5 }, /* OFPBPC_BAD_EXPERIMENTER */ - { 0x0, 14, 6 }, /* OFPBPC_BAD_EXP_TYPE */ - { 0x0, 14, 7 }, /* OFPBPC_BAD_EXP_VALUE */ - { 0x0, 14, 8 }, /* OFPBPC_EPERM */ - { 0x0, 17, 0 }, /* OFPBFC_UNKNOWN */ - { 0x0, 17, 1 }, /* OFPBFC_EPERM */ - { 0x0, 17, 2 }, /* OFPBFC_BAD_ID */ - { 0x0, 17, 3 }, /* OFPBFC_BUNDLE_EXIST */ - { 0x0, 17, 4 }, /* OFPBFC_BUNDLE_CLOSED */ - { 0x0, 17, 5 }, /* OFPBFC_OUT_OF_BUNDLES */ - { 0x0, 17, 6 }, /* OFPBFC_BAD_TYPE */ - { 0x0, 17, 7 }, /* OFPBFC_BAD_FLAGS */ - { 0x0, 17, 8 }, /* OFPBFC_MSG_BAD_LEN */ - { 0x0, 17, 9 }, /* OFPBFC_MSG_BAD_XID */ - { 0x0, 17, 10 }, /* OFPBFC_MSG_UNSUP */ - { 0x0, 17, 11 }, /* OFPBFC_MSG_CONFLICT */ - { 0x0, 17, 12 }, /* OFPBFC_MSG_TOO_MANY */ - { 0x0, 17, 13 }, /* OFPBFC_MSG_FAILED */ - { 0x0, 17, 14 }, /* OFPBFC_TIMEOUT */ - { 0x0, 17, 15 }, /* OFPBFC_BUNDLE_IN_PROGRESS */ - }, -}; - -static enum ofperr -ofperr_of10_decode(uint32_t vendor, uint16_t type, uint16_t code) -{ - switch (((uint64_t) vendor << 32) | (type << 16) | code) { - case (0 << 16) | 0: - return OFPERR_OFPHFC_INCOMPATIBLE; - case (0 << 16) | 1: - return OFPERR_OFPHFC_EPERM; - case (1 << 16) | 0: - return OFPERR_OFPBRC_BAD_VERSION; - case (1 << 16) | 1: - return OFPERR_OFPBRC_BAD_TYPE; - case (1 << 16) | 2: - return OFPERR_OFPBRC_BAD_STAT; - case (1 << 16) | 3: - return OFPERR_OFPBRC_BAD_VENDOR; - case (1 << 16) | 4: - return OFPERR_OFPBRC_BAD_SUBTYPE; - case (1 << 16) | 5: - return OFPERR_OFPBRC_EPERM; - case (1 << 16) | 6: - return OFPERR_OFPBRC_BAD_LEN; - case (1 << 16) | 7: - return OFPERR_OFPBRC_BUFFER_EMPTY; - case (1 << 16) | 8: - return OFPERR_OFPBRC_BUFFER_UNKNOWN; - case (0x2320ULL << 32) | (1 << 16) | 512: - return OFPERR_OFPBRC_BAD_TABLE_ID; - case (0x2320ULL << 32) | (1 << 16) | 514: - return OFPERR_OFPBRC_BAD_PORT; - case (0x2320ULL << 32) | (1 << 16) | 256: - return OFPERR_NXBRC_NXM_INVALID; - case (0x2320ULL << 32) | (1 << 16) | 257: - return OFPERR_NXBRC_NXM_BAD_TYPE; - case (0x2320ULL << 32) | (1 << 16) | 515: - return OFPERR_NXBRC_MUST_BE_ZERO; - case (0x2320ULL << 32) | (1 << 16) | 516: - return OFPERR_NXBRC_BAD_REASON; - case (0x2320ULL << 32) | (1 << 16) | 517: - return OFPERR_NXBRC_FM_DUPLICATE_ID; - case (0x2320ULL << 32) | (1 << 16) | 518: - return OFPERR_NXBRC_FM_BAD_FLAGS; - case (0x2320ULL << 32) | (1 << 16) | 519: - return OFPERR_NXBRC_FM_BAD_ID; - case (0x2320ULL << 32) | (1 << 16) | 520: - return OFPERR_NXBRC_FM_BAD_EVENT; - case (0x2320ULL << 32) | (1 << 16) | 521: - return OFPERR_NXBRC_UNENCODABLE_ERROR; - case (2 << 16) | 0: - return OFPERR_OFPBAC_BAD_TYPE; - case (2 << 16) | 1: - return OFPERR_OFPBAC_BAD_LEN; - case (2 << 16) | 2: - return OFPERR_OFPBAC_BAD_VENDOR; - case (2 << 16) | 3: - return OFPERR_OFPBAC_BAD_VENDOR_TYPE; - case (2 << 16) | 4: - return OFPERR_OFPBAC_BAD_OUT_PORT; - case (2 << 16) | 5: - return OFPERR_OFPBAC_BAD_ARGUMENT; - case (2 << 16) | 6: - return OFPERR_OFPBAC_EPERM; - case (2 << 16) | 7: - return OFPERR_OFPBAC_TOO_MANY; - case (2 << 16) | 8: - return OFPERR_OFPBAC_BAD_QUEUE; - case (0x2320ULL << 32) | (1 << 16) | 522: - return OFPERR_OFPBAC_MATCH_INCONSISTENT; - case (0x2320ULL << 32) | (1 << 16) | 523: - return OFPERR_OFPBAC_BAD_SET_TYPE; - case (0x2320ULL << 32) | (1 << 16) | 524: - return OFPERR_OFPBAC_BAD_SET_LEN; - case (0x2320ULL << 32) | (1 << 16) | 525: - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - case (0x2320ULL << 32) | (2 << 16) | 256: - return OFPERR_NXBAC_MUST_BE_ZERO; - case (0x2320ULL << 32) | (1 << 16) | 258: - return OFPERR_OFPBMC_BAD_VALUE; - case (0x2320ULL << 32) | (1 << 16) | 259: - return OFPERR_OFPBMC_BAD_MASK; - case (0x2320ULL << 32) | (1 << 16) | 260: - return OFPERR_OFPBMC_BAD_PREREQ; - case (0x2320ULL << 32) | (1 << 16) | 261: - return OFPERR_OFPBMC_DUP_FIELD; - case (3 << 16) | 0: - return OFPERR_OFPFMFC_TABLE_FULL; - case (3 << 16) | 1: - return OFPERR_OFPFMFC_OVERLAP; - case (3 << 16) | 2: - return OFPERR_OFPFMFC_EPERM; - case (3 << 16) | 3: - return OFPERR_OFPFMFC_BAD_EMERG_TIMEOUT; - case (3 << 16) | 4: - return OFPERR_OFPFMFC_BAD_COMMAND; - case (0x2320ULL << 32) | (3 << 16) | 258: - return OFPERR_OFPFMFC_BAD_FLAGS; - case (3 << 16) | 5: - return OFPERR_OFPFMFC_UNSUPPORTED; - case (0x2320ULL << 32) | (5 << 16) | 256: - return OFPERR_NXFMFC_HARDWARE; - case (0x2320ULL << 32) | (5 << 16) | 257: - return OFPERR_NXFMFC_BAD_TABLE_ID; - case (4 << 16) | 0: - return OFPERR_OFPPMFC_BAD_PORT; - case (4 << 16) | 1: - return OFPERR_OFPPMFC_BAD_HW_ADDR; - case (5 << 16) | 0: - return OFPERR_OFPQOFC_BAD_PORT; - case (5 << 16) | 1: - return OFPERR_OFPQOFC_BAD_QUEUE; - case (5 << 16) | 2: - return OFPERR_OFPQOFC_EPERM; - case (0x2320ULL << 32) | (1 << 16) | 513: - return OFPERR_OFPRRFC_BAD_ROLE; - } - - return 0; -} - -static const struct ofperr_domain ofperr_of10 = { - "OpenFlow 1.0", - 1, - ofperr_of10_decode, - { - { 0x0, 0, 0 }, /* OFPHFC_INCOMPATIBLE */ - { 0x0, 0, 1 }, /* OFPHFC_EPERM */ - { 0x0, 1, 0 }, /* OFPBRC_BAD_VERSION */ - { 0x0, 1, 1 }, /* OFPBRC_BAD_TYPE */ - { 0x0, 1, 2 }, /* OFPBRC_BAD_STAT */ - { 0x0, 1, 3 }, /* OFPBRC_BAD_VENDOR */ - { 0x0, 1, 4 }, /* OFPBRC_BAD_SUBTYPE */ - { 0x0, 1, 5 }, /* OFPBRC_EPERM */ - { 0x0, 1, 6 }, /* OFPBRC_BAD_LEN */ - { 0x0, 1, 7 }, /* OFPBRC_BUFFER_EMPTY */ - { 0x0, 1, 8 }, /* OFPBRC_BUFFER_UNKNOWN */ - { 0x2320, 1, 512 }, /* OFPBRC_BAD_TABLE_ID */ - { -1, -1, -1 }, /* OFPBRC_IS_SLAVE */ - { 0x2320, 1, 514 }, /* OFPBRC_BAD_PORT */ - { -1, -1, -1 }, /* OFPBRC_BAD_PACKET */ - { -1, -1, -1 }, /* OFPBRC_MULTIPART_BUFFER_OVERFLOW */ - { 0x2320, 1, 256 }, /* NXBRC_NXM_INVALID */ - { 0x2320, 1, 257 }, /* NXBRC_NXM_BAD_TYPE */ - { 0x2320, 1, 515 }, /* NXBRC_MUST_BE_ZERO */ - { 0x2320, 1, 516 }, /* NXBRC_BAD_REASON */ - { 0x2320, 1, 517 }, /* NXBRC_FM_DUPLICATE_ID */ - { 0x2320, 1, 518 }, /* NXBRC_FM_BAD_FLAGS */ - { 0x2320, 1, 519 }, /* NXBRC_FM_BAD_ID */ - { 0x2320, 1, 520 }, /* NXBRC_FM_BAD_EVENT */ - { 0x2320, 1, 521 }, /* NXBRC_UNENCODABLE_ERROR */ - { 0x0, 2, 0 }, /* OFPBAC_BAD_TYPE */ - { 0x0, 2, 1 }, /* OFPBAC_BAD_LEN */ - { 0x0, 2, 2 }, /* OFPBAC_BAD_VENDOR */ - { 0x0, 2, 3 }, /* OFPBAC_BAD_VENDOR_TYPE */ - { 0x0, 2, 4 }, /* OFPBAC_BAD_OUT_PORT */ - { 0x0, 2, 5 }, /* OFPBAC_BAD_ARGUMENT */ - { 0x0, 2, 6 }, /* OFPBAC_EPERM */ - { 0x0, 2, 7 }, /* OFPBAC_TOO_MANY */ - { 0x0, 2, 8 }, /* OFPBAC_BAD_QUEUE */ - { -1, -1, -1 }, /* OFPBAC_BAD_OUT_GROUP */ - { 0x2320, 1, 522 }, /* OFPBAC_MATCH_INCONSISTENT */ - { -1, -1, -1 }, /* OFPBAC_UNSUPPORTED_ORDER */ - { -1, -1, -1 }, /* OFPBAC_BAD_TAG */ - { 0x2320, 1, 523 }, /* OFPBAC_BAD_SET_TYPE */ - { 0x2320, 1, 524 }, /* OFPBAC_BAD_SET_LEN */ - { 0x2320, 1, 525 }, /* OFPBAC_BAD_SET_ARGUMENT */ - { 0x2320, 2, 256 }, /* NXBAC_MUST_BE_ZERO */ - { -1, -1, -1 }, /* OFPBIC_UNKNOWN_INST */ - { -1, -1, -1 }, /* OFPBIC_UNSUP_INST */ - { -1, -1, -1 }, /* OFPBIC_BAD_TABLE_ID */ - { -1, -1, -1 }, /* OFPBIC_UNSUP_METADATA */ - { -1, -1, -1 }, /* OFPBIC_UNSUP_METADATA_MASK */ - { -1, -1, -1 }, /* OFPBIC_BAD_EXPERIMENTER */ - { -1, -1, -1 }, /* OFPBIC_BAD_EXP_TYPE */ - { -1, -1, -1 }, /* OFPBIC_BAD_LEN */ - { -1, -1, -1 }, /* OFPBIC_EPERM */ - { -1, -1, -1 }, /* ONFBIC_DUP_INSTRUCTION */ - { -1, -1, -1 }, /* OFPBMC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBMC_BAD_LEN */ - { -1, -1, -1 }, /* OFPBMC_BAD_TAG */ - { -1, -1, -1 }, /* OFPBMC_BAD_DL_ADDR_MASK */ - { -1, -1, -1 }, /* OFPBMC_BAD_NW_ADDR_MASK */ - { -1, -1, -1 }, /* OFPBMC_BAD_WILDCARDS */ - { -1, -1, -1 }, /* OFPBMC_BAD_FIELD */ - { 0x2320, 1, 258 }, /* OFPBMC_BAD_VALUE */ - { 0x2320, 1, 259 }, /* OFPBMC_BAD_MASK */ - { 0x2320, 1, 260 }, /* OFPBMC_BAD_PREREQ */ - { 0x2320, 1, 261 }, /* OFPBMC_DUP_FIELD */ - { -1, -1, -1 }, /* OFPBMC_EPERM */ - { -1, -1, -1 }, /* OFPFMFC_UNKNOWN */ - { 0x0, 3, 0 }, /* OFPFMFC_TABLE_FULL */ - { -1, -1, -1 }, /* OFPFMFC_BAD_TABLE_ID */ - { 0x0, 3, 1 }, /* OFPFMFC_OVERLAP */ - { 0x0, 3, 2 }, /* OFPFMFC_EPERM */ - { -1, -1, -1 }, /* OFPFMFC_BAD_TIMEOUT */ - { 0x0, 3, 3 }, /* OFPFMFC_BAD_EMERG_TIMEOUT */ - { 0x0, 3, 4 }, /* OFPFMFC_BAD_COMMAND */ - { 0x2320, 3, 258 }, /* OFPFMFC_BAD_FLAGS */ - { 0x0, 3, 5 }, /* OFPFMFC_UNSUPPORTED */ - { 0x2320, 5, 256 }, /* NXFMFC_HARDWARE */ - { 0x2320, 5, 257 }, /* NXFMFC_BAD_TABLE_ID */ - { -1, -1, -1 }, /* OFPGMFC_GROUP_EXISTS */ - { -1, -1, -1 }, /* OFPGMFC_INVALID_GROUP */ - { -1, -1, -1 }, /* OFPGMFC_WEIGHT_UNSUPPORTED */ - { -1, -1, -1 }, /* OFPGMFC_OUT_OF_GROUPS */ - { -1, -1, -1 }, /* OFPGMFC_OUT_OF_BUCKETS */ - { -1, -1, -1 }, /* OFPGMFC_CHAINING_UNSUPPORTED */ - { -1, -1, -1 }, /* OFPGMFC_WATCH_UNSUPPORTED */ - { -1, -1, -1 }, /* OFPGMFC_LOOP */ - { -1, -1, -1 }, /* OFPGMFC_UNKNOWN_GROUP */ - { -1, -1, -1 }, /* OFPGMFC_CHAINED_GROUP */ - { -1, -1, -1 }, /* OFPGMFC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPGMFC_BAD_COMMAND */ - { -1, -1, -1 }, /* OFPGMFC_BAD_BUCKET */ - { -1, -1, -1 }, /* OFPGMFC_BAD_WATCH */ - { -1, -1, -1 }, /* OFPGMFC_EPERM */ - { 0x0, 4, 0 }, /* OFPPMFC_BAD_PORT */ - { 0x0, 4, 1 }, /* OFPPMFC_BAD_HW_ADDR */ - { -1, -1, -1 }, /* OFPPMFC_BAD_CONFIG */ - { -1, -1, -1 }, /* OFPPMFC_BAD_ADVERTISE */ - { -1, -1, -1 }, /* OFPPMFC_EPERM */ - { -1, -1, -1 }, /* OFPTMFC_BAD_TABLE */ - { -1, -1, -1 }, /* OFPTMFC_BAD_CONFIG */ - { -1, -1, -1 }, /* OFPTMFC_EPERM */ - { 0x0, 5, 0 }, /* OFPQOFC_BAD_PORT */ - { 0x0, 5, 1 }, /* OFPQOFC_BAD_QUEUE */ - { 0x0, 5, 2 }, /* OFPQOFC_EPERM */ - { -1, -1, -1 }, /* OFPSCFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPSCFC_BAD_LEN */ - { -1, -1, -1 }, /* OFPSCFC_EPERM */ - { -1, -1, -1 }, /* OFPRRFC_STALE */ - { -1, -1, -1 }, /* OFPRRFC_UNSUP */ - { 0x2320, 1, 513 }, /* OFPRRFC_BAD_ROLE */ - { -1, -1, -1 }, /* OFPMMFC_UNKNOWN */ - { -1, -1, -1 }, /* OFPMMFC_METER_EXISTS */ - { -1, -1, -1 }, /* OFPMMFC_INVALID_METER */ - { -1, -1, -1 }, /* OFPMMFC_UNKNOWN_METER */ - { -1, -1, -1 }, /* OFPMMFC_BAD_COMMAND */ - { -1, -1, -1 }, /* OFPMMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPMMFC_BAD_RATE */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BURST */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BAND */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BAND_VALUE */ - { -1, -1, -1 }, /* OFPMMFC_OUT_OF_METERS */ - { -1, -1, -1 }, /* OFPMMFC_OUT_OF_BANDS */ - { -1, -1, -1 }, /* OFPTFFC_BAD_TABLE */ - { -1, -1, -1 }, /* OFPTFFC_BAD_METADATA */ - { -1, -1, -1 }, /* OFPTFFC_EPERM */ - { -1, -1, -1 }, /* OFPBPC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_LEN */ - { -1, -1, -1 }, /* OFPBPC_BAD_VALUE */ - { -1, -1, -1 }, /* OFPBPC_TOO_MANY */ - { -1, -1, -1 }, /* OFPBPC_DUP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXPERIMENTER */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_VALUE */ - { -1, -1, -1 }, /* OFPBPC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_UNKNOWN */ - { -1, -1, -1 }, /* OFPBFC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_BAD_ID */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_EXIST */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_CLOSED */ - { -1, -1, -1 }, /* OFPBFC_OUT_OF_BUNDLES */ - { -1, -1, -1 }, /* OFPBFC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_LEN */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_XID */ - { -1, -1, -1 }, /* OFPBFC_MSG_UNSUP */ - { -1, -1, -1 }, /* OFPBFC_MSG_CONFLICT */ - { -1, -1, -1 }, /* OFPBFC_MSG_TOO_MANY */ - { -1, -1, -1 }, /* OFPBFC_MSG_FAILED */ - { -1, -1, -1 }, /* OFPBFC_TIMEOUT */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_IN_PROGRESS */ - }, -}; - -static enum ofperr -ofperr_of11_decode(uint32_t vendor, uint16_t type, uint16_t code) -{ - switch (((uint64_t) vendor << 32) | (type << 16) | code) { - case (0 << 16) | 0: - return OFPERR_OFPHFC_INCOMPATIBLE; - case (0 << 16) | 1: - return OFPERR_OFPHFC_EPERM; - case (1 << 16) | 0: - return OFPERR_OFPBRC_BAD_VERSION; - case (1 << 16) | 1: - return OFPERR_OFPBRC_BAD_TYPE; - case (1 << 16) | 2: - return OFPERR_OFPBRC_BAD_STAT; - case (1 << 16) | 3: - return OFPERR_OFPBRC_BAD_VENDOR; - case (1 << 16) | 4: - return OFPERR_OFPBRC_BAD_SUBTYPE; - case (1 << 16) | 5: - return OFPERR_OFPBRC_EPERM; - case (1 << 16) | 6: - return OFPERR_OFPBRC_BAD_LEN; - case (1 << 16) | 7: - return OFPERR_OFPBRC_BUFFER_EMPTY; - case (1 << 16) | 8: - return OFPERR_OFPBRC_BUFFER_UNKNOWN; - case (1 << 16) | 9: - return OFPERR_OFPBRC_BAD_TABLE_ID; - case (0x2320ULL << 32) | (1 << 16) | 514: - return OFPERR_OFPBRC_BAD_PORT; - case (0x2320ULL << 32) | (1 << 16) | 256: - return OFPERR_NXBRC_NXM_INVALID; - case (0x2320ULL << 32) | (1 << 16) | 257: - return OFPERR_NXBRC_NXM_BAD_TYPE; - case (0x2320ULL << 32) | (1 << 16) | 515: - return OFPERR_NXBRC_MUST_BE_ZERO; - case (0x2320ULL << 32) | (1 << 16) | 516: - return OFPERR_NXBRC_BAD_REASON; - case (0x2320ULL << 32) | (1 << 16) | 517: - return OFPERR_NXBRC_FM_DUPLICATE_ID; - case (0x2320ULL << 32) | (1 << 16) | 518: - return OFPERR_NXBRC_FM_BAD_FLAGS; - case (0x2320ULL << 32) | (1 << 16) | 519: - return OFPERR_NXBRC_FM_BAD_ID; - case (0x2320ULL << 32) | (1 << 16) | 520: - return OFPERR_NXBRC_FM_BAD_EVENT; - case (0x2320ULL << 32) | (1 << 16) | 521: - return OFPERR_NXBRC_UNENCODABLE_ERROR; - case (2 << 16) | 0: - return OFPERR_OFPBAC_BAD_TYPE; - case (2 << 16) | 1: - return OFPERR_OFPBAC_BAD_LEN; - case (2 << 16) | 2: - return OFPERR_OFPBAC_BAD_VENDOR; - case (2 << 16) | 3: - return OFPERR_OFPBAC_BAD_VENDOR_TYPE; - case (2 << 16) | 4: - return OFPERR_OFPBAC_BAD_OUT_PORT; - case (2 << 16) | 5: - return OFPERR_OFPBAC_BAD_ARGUMENT; - case (2 << 16) | 6: - return OFPERR_OFPBAC_EPERM; - case (2 << 16) | 7: - return OFPERR_OFPBAC_TOO_MANY; - case (2 << 16) | 8: - return OFPERR_OFPBAC_BAD_QUEUE; - case (2 << 16) | 9: - return OFPERR_OFPBAC_BAD_OUT_GROUP; - case (2 << 16) | 10: - return OFPERR_OFPBAC_MATCH_INCONSISTENT; - case (2 << 16) | 11: - return OFPERR_OFPBAC_UNSUPPORTED_ORDER; - case (2 << 16) | 12: - return OFPERR_OFPBAC_BAD_TAG; - case (0x2320ULL << 32) | (1 << 16) | 523: - return OFPERR_OFPBAC_BAD_SET_TYPE; - case (0x2320ULL << 32) | (1 << 16) | 524: - return OFPERR_OFPBAC_BAD_SET_LEN; - case (0x2320ULL << 32) | (1 << 16) | 525: - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - case (0x2320ULL << 32) | (2 << 16) | 256: - return OFPERR_NXBAC_MUST_BE_ZERO; - case (3 << 16) | 0: - return OFPERR_OFPBIC_UNKNOWN_INST; - case (3 << 16) | 1: - return OFPERR_OFPBIC_UNSUP_INST; - case (3 << 16) | 2: - return OFPERR_OFPBIC_BAD_TABLE_ID; - case (3 << 16) | 3: - return OFPERR_OFPBIC_UNSUP_METADATA; - case (3 << 16) | 4: - return OFPERR_OFPBIC_UNSUP_METADATA_MASK; - case (3 << 16) | 5: - return OFPERR_OFPBIC_BAD_EXPERIMENTER; - case (4 << 16) | 0: - return OFPERR_OFPBMC_BAD_TYPE; - case (4 << 16) | 1: - return OFPERR_OFPBMC_BAD_LEN; - case (4 << 16) | 2: - return OFPERR_OFPBMC_BAD_TAG; - case (4 << 16) | 3: - return OFPERR_OFPBMC_BAD_DL_ADDR_MASK; - case (4 << 16) | 4: - return OFPERR_OFPBMC_BAD_NW_ADDR_MASK; - case (4 << 16) | 5: - return OFPERR_OFPBMC_BAD_WILDCARDS; - case (4 << 16) | 6: - return OFPERR_OFPBMC_BAD_FIELD; - case (4 << 16) | 7: - return OFPERR_OFPBMC_BAD_VALUE; - case (0x2320ULL << 32) | (1 << 16) | 259: - return OFPERR_OFPBMC_BAD_MASK; - case (0x2320ULL << 32) | (1 << 16) | 260: - return OFPERR_OFPBMC_BAD_PREREQ; - case (0x2320ULL << 32) | (1 << 16) | 261: - return OFPERR_OFPBMC_DUP_FIELD; - case (5 << 16) | 0: - return OFPERR_OFPFMFC_UNKNOWN; - case (5 << 16) | 1: - return OFPERR_OFPFMFC_TABLE_FULL; - case (5 << 16) | 2: - return OFPERR_OFPFMFC_BAD_TABLE_ID; - case (5 << 16) | 3: - return OFPERR_OFPFMFC_OVERLAP; - case (5 << 16) | 4: - return OFPERR_OFPFMFC_EPERM; - case (5 << 16) | 5: - return OFPERR_OFPFMFC_BAD_TIMEOUT; - case (5 << 16) | 6: - return OFPERR_OFPFMFC_BAD_COMMAND; - case (0x2320ULL << 32) | (5 << 16) | 258: - return OFPERR_OFPFMFC_BAD_FLAGS; - case (0x2320ULL << 32) | (5 << 16) | 256: - return OFPERR_NXFMFC_HARDWARE; - case (0x2320ULL << 32) | (5 << 16) | 257: - return OFPERR_NXFMFC_BAD_TABLE_ID; - case (6 << 16) | 0: - return OFPERR_OFPGMFC_GROUP_EXISTS; - case (6 << 16) | 1: - return OFPERR_OFPGMFC_INVALID_GROUP; - case (6 << 16) | 2: - return OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED; - case (6 << 16) | 3: - return OFPERR_OFPGMFC_OUT_OF_GROUPS; - case (6 << 16) | 4: - return OFPERR_OFPGMFC_OUT_OF_BUCKETS; - case (6 << 16) | 5: - return OFPERR_OFPGMFC_CHAINING_UNSUPPORTED; - case (6 << 16) | 6: - return OFPERR_OFPGMFC_WATCH_UNSUPPORTED; - case (6 << 16) | 7: - return OFPERR_OFPGMFC_LOOP; - case (6 << 16) | 8: - return OFPERR_OFPGMFC_UNKNOWN_GROUP; - case (7 << 16) | 0: - return OFPERR_OFPPMFC_BAD_PORT; - case (7 << 16) | 1: - return OFPERR_OFPPMFC_BAD_HW_ADDR; - case (7 << 16) | 2: - return OFPERR_OFPPMFC_BAD_CONFIG; - case (7 << 16) | 3: - return OFPERR_OFPPMFC_BAD_ADVERTISE; - case (8 << 16) | 0: - return OFPERR_OFPTMFC_BAD_TABLE; - case (8 << 16) | 1: - return OFPERR_OFPTMFC_BAD_CONFIG; - case (9 << 16) | 0: - return OFPERR_OFPQOFC_BAD_PORT; - case (9 << 16) | 1: - return OFPERR_OFPQOFC_BAD_QUEUE; - case (9 << 16) | 2: - return OFPERR_OFPQOFC_EPERM; - case (10 << 16) | 0: - return OFPERR_OFPSCFC_BAD_FLAGS; - case (10 << 16) | 1: - return OFPERR_OFPSCFC_BAD_LEN; - case (0x2320ULL << 32) | (1 << 16) | 513: - return OFPERR_OFPRRFC_BAD_ROLE; - } - - return 0; -} - -static const struct ofperr_domain ofperr_of11 = { - "OpenFlow 1.1", - 2, - ofperr_of11_decode, - { - { 0x0, 0, 0 }, /* OFPHFC_INCOMPATIBLE */ - { 0x0, 0, 1 }, /* OFPHFC_EPERM */ - { 0x0, 1, 0 }, /* OFPBRC_BAD_VERSION */ - { 0x0, 1, 1 }, /* OFPBRC_BAD_TYPE */ - { 0x0, 1, 2 }, /* OFPBRC_BAD_STAT */ - { 0x0, 1, 3 }, /* OFPBRC_BAD_VENDOR */ - { 0x0, 1, 4 }, /* OFPBRC_BAD_SUBTYPE */ - { 0x0, 1, 5 }, /* OFPBRC_EPERM */ - { 0x0, 1, 6 }, /* OFPBRC_BAD_LEN */ - { 0x0, 1, 7 }, /* OFPBRC_BUFFER_EMPTY */ - { 0x0, 1, 8 }, /* OFPBRC_BUFFER_UNKNOWN */ - { 0x0, 1, 9 }, /* OFPBRC_BAD_TABLE_ID */ - { -1, -1, -1 }, /* OFPBRC_IS_SLAVE */ - { 0x2320, 1, 514 }, /* OFPBRC_BAD_PORT */ - { -1, -1, -1 }, /* OFPBRC_BAD_PACKET */ - { -1, -1, -1 }, /* OFPBRC_MULTIPART_BUFFER_OVERFLOW */ - { 0x2320, 1, 256 }, /* NXBRC_NXM_INVALID */ - { 0x2320, 1, 257 }, /* NXBRC_NXM_BAD_TYPE */ - { 0x2320, 1, 515 }, /* NXBRC_MUST_BE_ZERO */ - { 0x2320, 1, 516 }, /* NXBRC_BAD_REASON */ - { 0x2320, 1, 517 }, /* NXBRC_FM_DUPLICATE_ID */ - { 0x2320, 1, 518 }, /* NXBRC_FM_BAD_FLAGS */ - { 0x2320, 1, 519 }, /* NXBRC_FM_BAD_ID */ - { 0x2320, 1, 520 }, /* NXBRC_FM_BAD_EVENT */ - { 0x2320, 1, 521 }, /* NXBRC_UNENCODABLE_ERROR */ - { 0x0, 2, 0 }, /* OFPBAC_BAD_TYPE */ - { 0x0, 2, 1 }, /* OFPBAC_BAD_LEN */ - { 0x0, 2, 2 }, /* OFPBAC_BAD_VENDOR */ - { 0x0, 2, 3 }, /* OFPBAC_BAD_VENDOR_TYPE */ - { 0x0, 2, 4 }, /* OFPBAC_BAD_OUT_PORT */ - { 0x0, 2, 5 }, /* OFPBAC_BAD_ARGUMENT */ - { 0x0, 2, 6 }, /* OFPBAC_EPERM */ - { 0x0, 2, 7 }, /* OFPBAC_TOO_MANY */ - { 0x0, 2, 8 }, /* OFPBAC_BAD_QUEUE */ - { 0x0, 2, 9 }, /* OFPBAC_BAD_OUT_GROUP */ - { 0x0, 2, 10 }, /* OFPBAC_MATCH_INCONSISTENT */ - { 0x0, 2, 11 }, /* OFPBAC_UNSUPPORTED_ORDER */ - { 0x0, 2, 12 }, /* OFPBAC_BAD_TAG */ - { 0x2320, 1, 523 }, /* OFPBAC_BAD_SET_TYPE */ - { 0x2320, 1, 524 }, /* OFPBAC_BAD_SET_LEN */ - { 0x2320, 1, 525 }, /* OFPBAC_BAD_SET_ARGUMENT */ - { 0x2320, 2, 256 }, /* NXBAC_MUST_BE_ZERO */ - { 0x0, 3, 0 }, /* OFPBIC_UNKNOWN_INST */ - { 0x0, 3, 1 }, /* OFPBIC_UNSUP_INST */ - { 0x0, 3, 2 }, /* OFPBIC_BAD_TABLE_ID */ - { 0x0, 3, 3 }, /* OFPBIC_UNSUP_METADATA */ - { 0x0, 3, 4 }, /* OFPBIC_UNSUP_METADATA_MASK */ - { 0x0, 3, 5 }, /* OFPBIC_BAD_EXPERIMENTER */ - { 0x0, 3, 5 }, /* OFPBIC_BAD_EXP_TYPE */ - { -1, -1, -1 }, /* OFPBIC_BAD_LEN */ - { -1, -1, -1 }, /* OFPBIC_EPERM */ - { 0x4f4e4600, 2600, -1 }, /* ONFBIC_DUP_INSTRUCTION */ - { 0x0, 4, 0 }, /* OFPBMC_BAD_TYPE */ - { 0x0, 4, 1 }, /* OFPBMC_BAD_LEN */ - { 0x0, 4, 2 }, /* OFPBMC_BAD_TAG */ - { 0x0, 4, 3 }, /* OFPBMC_BAD_DL_ADDR_MASK */ - { 0x0, 4, 4 }, /* OFPBMC_BAD_NW_ADDR_MASK */ - { 0x0, 4, 5 }, /* OFPBMC_BAD_WILDCARDS */ - { 0x0, 4, 6 }, /* OFPBMC_BAD_FIELD */ - { 0x0, 4, 7 }, /* OFPBMC_BAD_VALUE */ - { 0x2320, 1, 259 }, /* OFPBMC_BAD_MASK */ - { 0x2320, 1, 260 }, /* OFPBMC_BAD_PREREQ */ - { 0x2320, 1, 261 }, /* OFPBMC_DUP_FIELD */ - { -1, -1, -1 }, /* OFPBMC_EPERM */ - { 0x0, 5, 0 }, /* OFPFMFC_UNKNOWN */ - { 0x0, 5, 1 }, /* OFPFMFC_TABLE_FULL */ - { 0x0, 5, 2 }, /* OFPFMFC_BAD_TABLE_ID */ - { 0x0, 5, 3 }, /* OFPFMFC_OVERLAP */ - { 0x0, 5, 4 }, /* OFPFMFC_EPERM */ - { 0x0, 5, 5 }, /* OFPFMFC_BAD_TIMEOUT */ - { -1, -1, -1 }, /* OFPFMFC_BAD_EMERG_TIMEOUT */ - { 0x0, 5, 6 }, /* OFPFMFC_BAD_COMMAND */ - { 0x2320, 5, 258 }, /* OFPFMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPFMFC_UNSUPPORTED */ - { 0x2320, 5, 256 }, /* NXFMFC_HARDWARE */ - { 0x2320, 5, 257 }, /* NXFMFC_BAD_TABLE_ID */ - { 0x0, 6, 0 }, /* OFPGMFC_GROUP_EXISTS */ - { 0x0, 6, 1 }, /* OFPGMFC_INVALID_GROUP */ - { 0x0, 6, 2 }, /* OFPGMFC_WEIGHT_UNSUPPORTED */ - { 0x0, 6, 3 }, /* OFPGMFC_OUT_OF_GROUPS */ - { 0x0, 6, 4 }, /* OFPGMFC_OUT_OF_BUCKETS */ - { 0x0, 6, 5 }, /* OFPGMFC_CHAINING_UNSUPPORTED */ - { 0x0, 6, 6 }, /* OFPGMFC_WATCH_UNSUPPORTED */ - { 0x0, 6, 7 }, /* OFPGMFC_LOOP */ - { 0x0, 6, 8 }, /* OFPGMFC_UNKNOWN_GROUP */ - { -1, -1, -1 }, /* OFPGMFC_CHAINED_GROUP */ - { -1, -1, -1 }, /* OFPGMFC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPGMFC_BAD_COMMAND */ - { -1, -1, -1 }, /* OFPGMFC_BAD_BUCKET */ - { -1, -1, -1 }, /* OFPGMFC_BAD_WATCH */ - { -1, -1, -1 }, /* OFPGMFC_EPERM */ - { 0x0, 7, 0 }, /* OFPPMFC_BAD_PORT */ - { 0x0, 7, 1 }, /* OFPPMFC_BAD_HW_ADDR */ - { 0x0, 7, 2 }, /* OFPPMFC_BAD_CONFIG */ - { 0x0, 7, 3 }, /* OFPPMFC_BAD_ADVERTISE */ - { -1, -1, -1 }, /* OFPPMFC_EPERM */ - { 0x0, 8, 0 }, /* OFPTMFC_BAD_TABLE */ - { 0x0, 8, 1 }, /* OFPTMFC_BAD_CONFIG */ - { -1, -1, -1 }, /* OFPTMFC_EPERM */ - { 0x0, 9, 0 }, /* OFPQOFC_BAD_PORT */ - { 0x0, 9, 1 }, /* OFPQOFC_BAD_QUEUE */ - { 0x0, 9, 2 }, /* OFPQOFC_EPERM */ - { 0x0, 10, 0 }, /* OFPSCFC_BAD_FLAGS */ - { 0x0, 10, 1 }, /* OFPSCFC_BAD_LEN */ - { -1, -1, -1 }, /* OFPSCFC_EPERM */ - { -1, -1, -1 }, /* OFPRRFC_STALE */ - { -1, -1, -1 }, /* OFPRRFC_UNSUP */ - { 0x2320, 1, 513 }, /* OFPRRFC_BAD_ROLE */ - { -1, -1, -1 }, /* OFPMMFC_UNKNOWN */ - { -1, -1, -1 }, /* OFPMMFC_METER_EXISTS */ - { -1, -1, -1 }, /* OFPMMFC_INVALID_METER */ - { -1, -1, -1 }, /* OFPMMFC_UNKNOWN_METER */ - { -1, -1, -1 }, /* OFPMMFC_BAD_COMMAND */ - { -1, -1, -1 }, /* OFPMMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPMMFC_BAD_RATE */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BURST */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BAND */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BAND_VALUE */ - { -1, -1, -1 }, /* OFPMMFC_OUT_OF_METERS */ - { -1, -1, -1 }, /* OFPMMFC_OUT_OF_BANDS */ - { -1, -1, -1 }, /* OFPTFFC_BAD_TABLE */ - { -1, -1, -1 }, /* OFPTFFC_BAD_METADATA */ - { -1, -1, -1 }, /* OFPTFFC_EPERM */ - { -1, -1, -1 }, /* OFPBPC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_LEN */ - { -1, -1, -1 }, /* OFPBPC_BAD_VALUE */ - { -1, -1, -1 }, /* OFPBPC_TOO_MANY */ - { -1, -1, -1 }, /* OFPBPC_DUP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXPERIMENTER */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_VALUE */ - { -1, -1, -1 }, /* OFPBPC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_UNKNOWN */ - { -1, -1, -1 }, /* OFPBFC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_BAD_ID */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_EXIST */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_CLOSED */ - { -1, -1, -1 }, /* OFPBFC_OUT_OF_BUNDLES */ - { -1, -1, -1 }, /* OFPBFC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_LEN */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_XID */ - { -1, -1, -1 }, /* OFPBFC_MSG_UNSUP */ - { -1, -1, -1 }, /* OFPBFC_MSG_CONFLICT */ - { -1, -1, -1 }, /* OFPBFC_MSG_TOO_MANY */ - { -1, -1, -1 }, /* OFPBFC_MSG_FAILED */ - { -1, -1, -1 }, /* OFPBFC_TIMEOUT */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_IN_PROGRESS */ - }, -}; - -static enum ofperr -ofperr_of12_decode(uint32_t vendor, uint16_t type, uint16_t code) -{ - switch (((uint64_t) vendor << 32) | (type << 16) | code) { - case (0 << 16) | 0: - return OFPERR_OFPHFC_INCOMPATIBLE; - case (0 << 16) | 1: - return OFPERR_OFPHFC_EPERM; - case (1 << 16) | 0: - return OFPERR_OFPBRC_BAD_VERSION; - case (1 << 16) | 1: - return OFPERR_OFPBRC_BAD_TYPE; - case (1 << 16) | 2: - return OFPERR_OFPBRC_BAD_STAT; - case (1 << 16) | 3: - return OFPERR_OFPBRC_BAD_VENDOR; - case (1 << 16) | 4: - return OFPERR_OFPBRC_BAD_SUBTYPE; - case (1 << 16) | 5: - return OFPERR_OFPBRC_EPERM; - case (1 << 16) | 6: - return OFPERR_OFPBRC_BAD_LEN; - case (1 << 16) | 7: - return OFPERR_OFPBRC_BUFFER_EMPTY; - case (1 << 16) | 8: - return OFPERR_OFPBRC_BUFFER_UNKNOWN; - case (1 << 16) | 9: - return OFPERR_OFPBRC_BAD_TABLE_ID; - case (1 << 16) | 10: - return OFPERR_OFPBRC_IS_SLAVE; - case (1 << 16) | 11: - return OFPERR_OFPBRC_BAD_PORT; - case (1 << 16) | 12: - return OFPERR_OFPBRC_BAD_PACKET; - case (0x2320ULL << 32) | (2 << 16) | 0: - return OFPERR_NXBRC_NXM_INVALID; - case (0x2320ULL << 32) | (3 << 16) | 0: - return OFPERR_NXBRC_NXM_BAD_TYPE; - case (0x2320ULL << 32) | (4 << 16) | 0: - return OFPERR_NXBRC_MUST_BE_ZERO; - case (0x2320ULL << 32) | (5 << 16) | 0: - return OFPERR_NXBRC_BAD_REASON; - case (0x2320ULL << 32) | (6 << 16) | 0: - return OFPERR_NXBRC_FM_DUPLICATE_ID; - case (0x2320ULL << 32) | (7 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_FLAGS; - case (0x2320ULL << 32) | (8 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_ID; - case (0x2320ULL << 32) | (9 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_EVENT; - case (0x2320ULL << 32) | (10 << 16) | 0: - return OFPERR_NXBRC_UNENCODABLE_ERROR; - case (2 << 16) | 0: - return OFPERR_OFPBAC_BAD_TYPE; - case (2 << 16) | 1: - return OFPERR_OFPBAC_BAD_LEN; - case (2 << 16) | 2: - return OFPERR_OFPBAC_BAD_VENDOR; - case (2 << 16) | 3: - return OFPERR_OFPBAC_BAD_VENDOR_TYPE; - case (2 << 16) | 4: - return OFPERR_OFPBAC_BAD_OUT_PORT; - case (2 << 16) | 5: - return OFPERR_OFPBAC_BAD_ARGUMENT; - case (2 << 16) | 6: - return OFPERR_OFPBAC_EPERM; - case (2 << 16) | 7: - return OFPERR_OFPBAC_TOO_MANY; - case (2 << 16) | 8: - return OFPERR_OFPBAC_BAD_QUEUE; - case (2 << 16) | 9: - return OFPERR_OFPBAC_BAD_OUT_GROUP; - case (2 << 16) | 10: - return OFPERR_OFPBAC_MATCH_INCONSISTENT; - case (2 << 16) | 11: - return OFPERR_OFPBAC_UNSUPPORTED_ORDER; - case (2 << 16) | 12: - return OFPERR_OFPBAC_BAD_TAG; - case (2 << 16) | 13: - return OFPERR_OFPBAC_BAD_SET_TYPE; - case (2 << 16) | 14: - return OFPERR_OFPBAC_BAD_SET_LEN; - case (2 << 16) | 15: - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - case (0x2320ULL << 32) | (11 << 16) | 0: - return OFPERR_NXBAC_MUST_BE_ZERO; - case (3 << 16) | 0: - return OFPERR_OFPBIC_UNKNOWN_INST; - case (3 << 16) | 1: - return OFPERR_OFPBIC_UNSUP_INST; - case (3 << 16) | 2: - return OFPERR_OFPBIC_BAD_TABLE_ID; - case (3 << 16) | 3: - return OFPERR_OFPBIC_UNSUP_METADATA; - case (3 << 16) | 4: - return OFPERR_OFPBIC_UNSUP_METADATA_MASK; - case (3 << 16) | 5: - return OFPERR_OFPBIC_BAD_EXPERIMENTER; - case (3 << 16) | 6: - return OFPERR_OFPBIC_BAD_EXP_TYPE; - case (3 << 16) | 7: - return OFPERR_OFPBIC_BAD_LEN; - case (3 << 16) | 8: - return OFPERR_OFPBIC_EPERM; - case (4 << 16) | 0: - return OFPERR_OFPBMC_BAD_TYPE; - case (4 << 16) | 1: - return OFPERR_OFPBMC_BAD_LEN; - case (4 << 16) | 2: - return OFPERR_OFPBMC_BAD_TAG; - case (4 << 16) | 3: - return OFPERR_OFPBMC_BAD_DL_ADDR_MASK; - case (4 << 16) | 4: - return OFPERR_OFPBMC_BAD_NW_ADDR_MASK; - case (4 << 16) | 5: - return OFPERR_OFPBMC_BAD_WILDCARDS; - case (4 << 16) | 6: - return OFPERR_OFPBMC_BAD_FIELD; - case (4 << 16) | 7: - return OFPERR_OFPBMC_BAD_VALUE; - case (4 << 16) | 8: - return OFPERR_OFPBMC_BAD_MASK; - case (4 << 16) | 9: - return OFPERR_OFPBMC_BAD_PREREQ; - case (4 << 16) | 10: - return OFPERR_OFPBMC_DUP_FIELD; - case (4 << 16) | 11: - return OFPERR_OFPBMC_EPERM; - case (5 << 16) | 0: - return OFPERR_OFPFMFC_UNKNOWN; - case (5 << 16) | 1: - return OFPERR_OFPFMFC_TABLE_FULL; - case (5 << 16) | 2: - return OFPERR_OFPFMFC_BAD_TABLE_ID; - case (5 << 16) | 3: - return OFPERR_OFPFMFC_OVERLAP; - case (5 << 16) | 4: - return OFPERR_OFPFMFC_EPERM; - case (5 << 16) | 5: - return OFPERR_OFPFMFC_BAD_TIMEOUT; - case (5 << 16) | 6: - return OFPERR_OFPFMFC_BAD_COMMAND; - case (5 << 16) | 7: - return OFPERR_OFPFMFC_BAD_FLAGS; - case (0x2320ULL << 32) | (12 << 16) | 0: - return OFPERR_NXFMFC_HARDWARE; - case (0x2320ULL << 32) | (13 << 16) | 0: - return OFPERR_NXFMFC_BAD_TABLE_ID; - case (6 << 16) | 0: - return OFPERR_OFPGMFC_GROUP_EXISTS; - case (6 << 16) | 1: - return OFPERR_OFPGMFC_INVALID_GROUP; - case (6 << 16) | 2: - return OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED; - case (6 << 16) | 3: - return OFPERR_OFPGMFC_OUT_OF_GROUPS; - case (6 << 16) | 4: - return OFPERR_OFPGMFC_OUT_OF_BUCKETS; - case (6 << 16) | 5: - return OFPERR_OFPGMFC_CHAINING_UNSUPPORTED; - case (6 << 16) | 6: - return OFPERR_OFPGMFC_WATCH_UNSUPPORTED; - case (6 << 16) | 7: - return OFPERR_OFPGMFC_LOOP; - case (6 << 16) | 8: - return OFPERR_OFPGMFC_UNKNOWN_GROUP; - case (6 << 16) | 9: - return OFPERR_OFPGMFC_CHAINED_GROUP; - case (6 << 16) | 10: - return OFPERR_OFPGMFC_BAD_TYPE; - case (6 << 16) | 11: - return OFPERR_OFPGMFC_BAD_COMMAND; - case (6 << 16) | 12: - return OFPERR_OFPGMFC_BAD_BUCKET; - case (6 << 16) | 13: - return OFPERR_OFPGMFC_BAD_WATCH; - case (6 << 16) | 14: - return OFPERR_OFPGMFC_EPERM; - case (7 << 16) | 0: - return OFPERR_OFPPMFC_BAD_PORT; - case (7 << 16) | 1: - return OFPERR_OFPPMFC_BAD_HW_ADDR; - case (7 << 16) | 2: - return OFPERR_OFPPMFC_BAD_CONFIG; - case (7 << 16) | 3: - return OFPERR_OFPPMFC_BAD_ADVERTISE; - case (7 << 16) | 4: - return OFPERR_OFPPMFC_EPERM; - case (8 << 16) | 0: - return OFPERR_OFPTMFC_BAD_TABLE; - case (8 << 16) | 1: - return OFPERR_OFPTMFC_BAD_CONFIG; - case (8 << 16) | 2: - return OFPERR_OFPTMFC_EPERM; - case (9 << 16) | 0: - return OFPERR_OFPQOFC_BAD_PORT; - case (9 << 16) | 1: - return OFPERR_OFPQOFC_BAD_QUEUE; - case (9 << 16) | 2: - return OFPERR_OFPQOFC_EPERM; - case (10 << 16) | 0: - return OFPERR_OFPSCFC_BAD_FLAGS; - case (10 << 16) | 1: - return OFPERR_OFPSCFC_BAD_LEN; - case (10 << 16) | 2: - return OFPERR_OFPSCFC_EPERM; - case (11 << 16) | 0: - return OFPERR_OFPRRFC_STALE; - case (11 << 16) | 1: - return OFPERR_OFPRRFC_UNSUP; - case (11 << 16) | 2: - return OFPERR_OFPRRFC_BAD_ROLE; - } - - return 0; -} - -static const struct ofperr_domain ofperr_of12 = { - "OpenFlow 1.2", - 3, - ofperr_of12_decode, - { - { 0x0, 0, 0 }, /* OFPHFC_INCOMPATIBLE */ - { 0x0, 0, 1 }, /* OFPHFC_EPERM */ - { 0x0, 1, 0 }, /* OFPBRC_BAD_VERSION */ - { 0x0, 1, 1 }, /* OFPBRC_BAD_TYPE */ - { 0x0, 1, 2 }, /* OFPBRC_BAD_STAT */ - { 0x0, 1, 3 }, /* OFPBRC_BAD_VENDOR */ - { 0x0, 1, 4 }, /* OFPBRC_BAD_SUBTYPE */ - { 0x0, 1, 5 }, /* OFPBRC_EPERM */ - { 0x0, 1, 6 }, /* OFPBRC_BAD_LEN */ - { 0x0, 1, 7 }, /* OFPBRC_BUFFER_EMPTY */ - { 0x0, 1, 8 }, /* OFPBRC_BUFFER_UNKNOWN */ - { 0x0, 1, 9 }, /* OFPBRC_BAD_TABLE_ID */ - { 0x0, 1, 10 }, /* OFPBRC_IS_SLAVE */ - { 0x0, 1, 11 }, /* OFPBRC_BAD_PORT */ - { 0x0, 1, 12 }, /* OFPBRC_BAD_PACKET */ - { -1, -1, -1 }, /* OFPBRC_MULTIPART_BUFFER_OVERFLOW */ - { 0x2320, 2, 0 }, /* NXBRC_NXM_INVALID */ - { 0x2320, 3, 0 }, /* NXBRC_NXM_BAD_TYPE */ - { 0x2320, 4, 0 }, /* NXBRC_MUST_BE_ZERO */ - { 0x2320, 5, 0 }, /* NXBRC_BAD_REASON */ - { 0x2320, 6, 0 }, /* NXBRC_FM_DUPLICATE_ID */ - { 0x2320, 7, 0 }, /* NXBRC_FM_BAD_FLAGS */ - { 0x2320, 8, 0 }, /* NXBRC_FM_BAD_ID */ - { 0x2320, 9, 0 }, /* NXBRC_FM_BAD_EVENT */ - { 0x2320, 10, 0 }, /* NXBRC_UNENCODABLE_ERROR */ - { 0x0, 2, 0 }, /* OFPBAC_BAD_TYPE */ - { 0x0, 2, 1 }, /* OFPBAC_BAD_LEN */ - { 0x0, 2, 2 }, /* OFPBAC_BAD_VENDOR */ - { 0x0, 2, 3 }, /* OFPBAC_BAD_VENDOR_TYPE */ - { 0x0, 2, 4 }, /* OFPBAC_BAD_OUT_PORT */ - { 0x0, 2, 5 }, /* OFPBAC_BAD_ARGUMENT */ - { 0x0, 2, 6 }, /* OFPBAC_EPERM */ - { 0x0, 2, 7 }, /* OFPBAC_TOO_MANY */ - { 0x0, 2, 8 }, /* OFPBAC_BAD_QUEUE */ - { 0x0, 2, 9 }, /* OFPBAC_BAD_OUT_GROUP */ - { 0x0, 2, 10 }, /* OFPBAC_MATCH_INCONSISTENT */ - { 0x0, 2, 11 }, /* OFPBAC_UNSUPPORTED_ORDER */ - { 0x0, 2, 12 }, /* OFPBAC_BAD_TAG */ - { 0x0, 2, 13 }, /* OFPBAC_BAD_SET_TYPE */ - { 0x0, 2, 14 }, /* OFPBAC_BAD_SET_LEN */ - { 0x0, 2, 15 }, /* OFPBAC_BAD_SET_ARGUMENT */ - { 0x2320, 11, 0 }, /* NXBAC_MUST_BE_ZERO */ - { 0x0, 3, 0 }, /* OFPBIC_UNKNOWN_INST */ - { 0x0, 3, 1 }, /* OFPBIC_UNSUP_INST */ - { 0x0, 3, 2 }, /* OFPBIC_BAD_TABLE_ID */ - { 0x0, 3, 3 }, /* OFPBIC_UNSUP_METADATA */ - { 0x0, 3, 4 }, /* OFPBIC_UNSUP_METADATA_MASK */ - { 0x0, 3, 5 }, /* OFPBIC_BAD_EXPERIMENTER */ - { 0x0, 3, 6 }, /* OFPBIC_BAD_EXP_TYPE */ - { 0x0, 3, 7 }, /* OFPBIC_BAD_LEN */ - { 0x0, 3, 8 }, /* OFPBIC_EPERM */ - { 0x4f4e4600, 2600, -1 }, /* ONFBIC_DUP_INSTRUCTION */ - { 0x0, 4, 0 }, /* OFPBMC_BAD_TYPE */ - { 0x0, 4, 1 }, /* OFPBMC_BAD_LEN */ - { 0x0, 4, 2 }, /* OFPBMC_BAD_TAG */ - { 0x0, 4, 3 }, /* OFPBMC_BAD_DL_ADDR_MASK */ - { 0x0, 4, 4 }, /* OFPBMC_BAD_NW_ADDR_MASK */ - { 0x0, 4, 5 }, /* OFPBMC_BAD_WILDCARDS */ - { 0x0, 4, 6 }, /* OFPBMC_BAD_FIELD */ - { 0x0, 4, 7 }, /* OFPBMC_BAD_VALUE */ - { 0x0, 4, 8 }, /* OFPBMC_BAD_MASK */ - { 0x0, 4, 9 }, /* OFPBMC_BAD_PREREQ */ - { 0x0, 4, 10 }, /* OFPBMC_DUP_FIELD */ - { 0x0, 4, 11 }, /* OFPBMC_EPERM */ - { 0x0, 5, 0 }, /* OFPFMFC_UNKNOWN */ - { 0x0, 5, 1 }, /* OFPFMFC_TABLE_FULL */ - { 0x0, 5, 2 }, /* OFPFMFC_BAD_TABLE_ID */ - { 0x0, 5, 3 }, /* OFPFMFC_OVERLAP */ - { 0x0, 5, 4 }, /* OFPFMFC_EPERM */ - { 0x0, 5, 5 }, /* OFPFMFC_BAD_TIMEOUT */ - { -1, -1, -1 }, /* OFPFMFC_BAD_EMERG_TIMEOUT */ - { 0x0, 5, 6 }, /* OFPFMFC_BAD_COMMAND */ - { 0x0, 5, 7 }, /* OFPFMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPFMFC_UNSUPPORTED */ - { 0x2320, 12, 0 }, /* NXFMFC_HARDWARE */ - { 0x2320, 13, 0 }, /* NXFMFC_BAD_TABLE_ID */ - { 0x0, 6, 0 }, /* OFPGMFC_GROUP_EXISTS */ - { 0x0, 6, 1 }, /* OFPGMFC_INVALID_GROUP */ - { 0x0, 6, 2 }, /* OFPGMFC_WEIGHT_UNSUPPORTED */ - { 0x0, 6, 3 }, /* OFPGMFC_OUT_OF_GROUPS */ - { 0x0, 6, 4 }, /* OFPGMFC_OUT_OF_BUCKETS */ - { 0x0, 6, 5 }, /* OFPGMFC_CHAINING_UNSUPPORTED */ - { 0x0, 6, 6 }, /* OFPGMFC_WATCH_UNSUPPORTED */ - { 0x0, 6, 7 }, /* OFPGMFC_LOOP */ - { 0x0, 6, 8 }, /* OFPGMFC_UNKNOWN_GROUP */ - { 0x0, 6, 9 }, /* OFPGMFC_CHAINED_GROUP */ - { 0x0, 6, 10 }, /* OFPGMFC_BAD_TYPE */ - { 0x0, 6, 11 }, /* OFPGMFC_BAD_COMMAND */ - { 0x0, 6, 12 }, /* OFPGMFC_BAD_BUCKET */ - { 0x0, 6, 13 }, /* OFPGMFC_BAD_WATCH */ - { 0x0, 6, 14 }, /* OFPGMFC_EPERM */ - { 0x0, 7, 0 }, /* OFPPMFC_BAD_PORT */ - { 0x0, 7, 1 }, /* OFPPMFC_BAD_HW_ADDR */ - { 0x0, 7, 2 }, /* OFPPMFC_BAD_CONFIG */ - { 0x0, 7, 3 }, /* OFPPMFC_BAD_ADVERTISE */ - { 0x0, 7, 4 }, /* OFPPMFC_EPERM */ - { 0x0, 8, 0 }, /* OFPTMFC_BAD_TABLE */ - { 0x0, 8, 1 }, /* OFPTMFC_BAD_CONFIG */ - { 0x0, 8, 2 }, /* OFPTMFC_EPERM */ - { 0x0, 9, 0 }, /* OFPQOFC_BAD_PORT */ - { 0x0, 9, 1 }, /* OFPQOFC_BAD_QUEUE */ - { 0x0, 9, 2 }, /* OFPQOFC_EPERM */ - { 0x0, 10, 0 }, /* OFPSCFC_BAD_FLAGS */ - { 0x0, 10, 1 }, /* OFPSCFC_BAD_LEN */ - { 0x0, 10, 2 }, /* OFPSCFC_EPERM */ - { 0x0, 11, 0 }, /* OFPRRFC_STALE */ - { 0x0, 11, 1 }, /* OFPRRFC_UNSUP */ - { 0x0, 11, 2 }, /* OFPRRFC_BAD_ROLE */ - { -1, -1, -1 }, /* OFPMMFC_UNKNOWN */ - { -1, -1, -1 }, /* OFPMMFC_METER_EXISTS */ - { -1, -1, -1 }, /* OFPMMFC_INVALID_METER */ - { -1, -1, -1 }, /* OFPMMFC_UNKNOWN_METER */ - { -1, -1, -1 }, /* OFPMMFC_BAD_COMMAND */ - { -1, -1, -1 }, /* OFPMMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPMMFC_BAD_RATE */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BURST */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BAND */ - { -1, -1, -1 }, /* OFPMMFC_BAD_BAND_VALUE */ - { -1, -1, -1 }, /* OFPMMFC_OUT_OF_METERS */ - { -1, -1, -1 }, /* OFPMMFC_OUT_OF_BANDS */ - { -1, -1, -1 }, /* OFPTFFC_BAD_TABLE */ - { -1, -1, -1 }, /* OFPTFFC_BAD_METADATA */ - { -1, -1, -1 }, /* OFPTFFC_EPERM */ - { -1, -1, -1 }, /* OFPBPC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_LEN */ - { -1, -1, -1 }, /* OFPBPC_BAD_VALUE */ - { -1, -1, -1 }, /* OFPBPC_TOO_MANY */ - { -1, -1, -1 }, /* OFPBPC_DUP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXPERIMENTER */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_VALUE */ - { -1, -1, -1 }, /* OFPBPC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_UNKNOWN */ - { -1, -1, -1 }, /* OFPBFC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_BAD_ID */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_EXIST */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_CLOSED */ - { -1, -1, -1 }, /* OFPBFC_OUT_OF_BUNDLES */ - { -1, -1, -1 }, /* OFPBFC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_LEN */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_XID */ - { -1, -1, -1 }, /* OFPBFC_MSG_UNSUP */ - { -1, -1, -1 }, /* OFPBFC_MSG_CONFLICT */ - { -1, -1, -1 }, /* OFPBFC_MSG_TOO_MANY */ - { -1, -1, -1 }, /* OFPBFC_MSG_FAILED */ - { -1, -1, -1 }, /* OFPBFC_TIMEOUT */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_IN_PROGRESS */ - }, -}; - -static enum ofperr -ofperr_of13_decode(uint32_t vendor, uint16_t type, uint16_t code) -{ - switch (((uint64_t) vendor << 32) | (type << 16) | code) { - case (0 << 16) | 0: - return OFPERR_OFPHFC_INCOMPATIBLE; - case (0 << 16) | 1: - return OFPERR_OFPHFC_EPERM; - case (1 << 16) | 0: - return OFPERR_OFPBRC_BAD_VERSION; - case (1 << 16) | 1: - return OFPERR_OFPBRC_BAD_TYPE; - case (1 << 16) | 2: - return OFPERR_OFPBRC_BAD_STAT; - case (1 << 16) | 3: - return OFPERR_OFPBRC_BAD_VENDOR; - case (1 << 16) | 4: - return OFPERR_OFPBRC_BAD_SUBTYPE; - case (1 << 16) | 5: - return OFPERR_OFPBRC_EPERM; - case (1 << 16) | 6: - return OFPERR_OFPBRC_BAD_LEN; - case (1 << 16) | 7: - return OFPERR_OFPBRC_BUFFER_EMPTY; - case (1 << 16) | 8: - return OFPERR_OFPBRC_BUFFER_UNKNOWN; - case (1 << 16) | 9: - return OFPERR_OFPBRC_BAD_TABLE_ID; - case (1 << 16) | 10: - return OFPERR_OFPBRC_IS_SLAVE; - case (1 << 16) | 11: - return OFPERR_OFPBRC_BAD_PORT; - case (1 << 16) | 12: - return OFPERR_OFPBRC_BAD_PACKET; - case (1 << 16) | 13: - return OFPERR_OFPBRC_MULTIPART_BUFFER_OVERFLOW; - case (0x2320ULL << 32) | (2 << 16) | 0: - return OFPERR_NXBRC_NXM_INVALID; - case (0x2320ULL << 32) | (3 << 16) | 0: - return OFPERR_NXBRC_NXM_BAD_TYPE; - case (0x2320ULL << 32) | (4 << 16) | 0: - return OFPERR_NXBRC_MUST_BE_ZERO; - case (0x2320ULL << 32) | (5 << 16) | 0: - return OFPERR_NXBRC_BAD_REASON; - case (0x2320ULL << 32) | (6 << 16) | 0: - return OFPERR_NXBRC_FM_DUPLICATE_ID; - case (0x2320ULL << 32) | (7 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_FLAGS; - case (0x2320ULL << 32) | (8 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_ID; - case (0x2320ULL << 32) | (9 << 16) | 0: - return OFPERR_NXBRC_FM_BAD_EVENT; - case (0x2320ULL << 32) | (10 << 16) | 0: - return OFPERR_NXBRC_UNENCODABLE_ERROR; - case (2 << 16) | 0: - return OFPERR_OFPBAC_BAD_TYPE; - case (2 << 16) | 1: - return OFPERR_OFPBAC_BAD_LEN; - case (2 << 16) | 2: - return OFPERR_OFPBAC_BAD_VENDOR; - case (2 << 16) | 3: - return OFPERR_OFPBAC_BAD_VENDOR_TYPE; - case (2 << 16) | 4: - return OFPERR_OFPBAC_BAD_OUT_PORT; - case (2 << 16) | 5: - return OFPERR_OFPBAC_BAD_ARGUMENT; - case (2 << 16) | 6: - return OFPERR_OFPBAC_EPERM; - case (2 << 16) | 7: - return OFPERR_OFPBAC_TOO_MANY; - case (2 << 16) | 8: - return OFPERR_OFPBAC_BAD_QUEUE; - case (2 << 16) | 9: - return OFPERR_OFPBAC_BAD_OUT_GROUP; - case (2 << 16) | 10: - return OFPERR_OFPBAC_MATCH_INCONSISTENT; - case (2 << 16) | 11: - return OFPERR_OFPBAC_UNSUPPORTED_ORDER; - case (2 << 16) | 12: - return OFPERR_OFPBAC_BAD_TAG; - case (2 << 16) | 13: - return OFPERR_OFPBAC_BAD_SET_TYPE; - case (2 << 16) | 14: - return OFPERR_OFPBAC_BAD_SET_LEN; - case (2 << 16) | 15: - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - case (0x2320ULL << 32) | (11 << 16) | 0: - return OFPERR_NXBAC_MUST_BE_ZERO; - case (3 << 16) | 0: - return OFPERR_OFPBIC_UNKNOWN_INST; - case (3 << 16) | 1: - return OFPERR_OFPBIC_UNSUP_INST; - case (3 << 16) | 2: - return OFPERR_OFPBIC_BAD_TABLE_ID; - case (3 << 16) | 3: - return OFPERR_OFPBIC_UNSUP_METADATA; - case (3 << 16) | 4: - return OFPERR_OFPBIC_UNSUP_METADATA_MASK; - case (3 << 16) | 5: - return OFPERR_OFPBIC_BAD_EXPERIMENTER; - case (3 << 16) | 6: - return OFPERR_OFPBIC_BAD_EXP_TYPE; - case (3 << 16) | 7: - return OFPERR_OFPBIC_BAD_LEN; - case (3 << 16) | 8: - return OFPERR_OFPBIC_EPERM; - case (4 << 16) | 0: - return OFPERR_OFPBMC_BAD_TYPE; - case (4 << 16) | 1: - return OFPERR_OFPBMC_BAD_LEN; - case (4 << 16) | 2: - return OFPERR_OFPBMC_BAD_TAG; - case (4 << 16) | 3: - return OFPERR_OFPBMC_BAD_DL_ADDR_MASK; - case (4 << 16) | 4: - return OFPERR_OFPBMC_BAD_NW_ADDR_MASK; - case (4 << 16) | 5: - return OFPERR_OFPBMC_BAD_WILDCARDS; - case (4 << 16) | 6: - return OFPERR_OFPBMC_BAD_FIELD; - case (4 << 16) | 7: - return OFPERR_OFPBMC_BAD_VALUE; - case (4 << 16) | 8: - return OFPERR_OFPBMC_BAD_MASK; - case (4 << 16) | 9: - return OFPERR_OFPBMC_BAD_PREREQ; - case (4 << 16) | 10: - return OFPERR_OFPBMC_DUP_FIELD; - case (4 << 16) | 11: - return OFPERR_OFPBMC_EPERM; - case (5 << 16) | 0: - return OFPERR_OFPFMFC_UNKNOWN; - case (5 << 16) | 1: - return OFPERR_OFPFMFC_TABLE_FULL; - case (5 << 16) | 2: - return OFPERR_OFPFMFC_BAD_TABLE_ID; - case (5 << 16) | 3: - return OFPERR_OFPFMFC_OVERLAP; - case (5 << 16) | 4: - return OFPERR_OFPFMFC_EPERM; - case (5 << 16) | 5: - return OFPERR_OFPFMFC_BAD_TIMEOUT; - case (5 << 16) | 6: - return OFPERR_OFPFMFC_BAD_COMMAND; - case (5 << 16) | 7: - return OFPERR_OFPFMFC_BAD_FLAGS; - case (0x2320ULL << 32) | (12 << 16) | 0: - return OFPERR_NXFMFC_HARDWARE; - case (0x2320ULL << 32) | (13 << 16) | 0: - return OFPERR_NXFMFC_BAD_TABLE_ID; - case (6 << 16) | 0: - return OFPERR_OFPGMFC_GROUP_EXISTS; - case (6 << 16) | 1: - return OFPERR_OFPGMFC_INVALID_GROUP; - case (6 << 16) | 2: - return OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED; - case (6 << 16) | 3: - return OFPERR_OFPGMFC_OUT_OF_GROUPS; - case (6 << 16) | 4: - return OFPERR_OFPGMFC_OUT_OF_BUCKETS; - case (6 << 16) | 5: - return OFPERR_OFPGMFC_CHAINING_UNSUPPORTED; - case (6 << 16) | 6: - return OFPERR_OFPGMFC_WATCH_UNSUPPORTED; - case (6 << 16) | 7: - return OFPERR_OFPGMFC_LOOP; - case (6 << 16) | 8: - return OFPERR_OFPGMFC_UNKNOWN_GROUP; - case (6 << 16) | 9: - return OFPERR_OFPGMFC_CHAINED_GROUP; - case (6 << 16) | 10: - return OFPERR_OFPGMFC_BAD_TYPE; - case (6 << 16) | 11: - return OFPERR_OFPGMFC_BAD_COMMAND; - case (6 << 16) | 12: - return OFPERR_OFPGMFC_BAD_BUCKET; - case (6 << 16) | 13: - return OFPERR_OFPGMFC_BAD_WATCH; - case (6 << 16) | 14: - return OFPERR_OFPGMFC_EPERM; - case (7 << 16) | 0: - return OFPERR_OFPPMFC_BAD_PORT; - case (7 << 16) | 1: - return OFPERR_OFPPMFC_BAD_HW_ADDR; - case (7 << 16) | 2: - return OFPERR_OFPPMFC_BAD_CONFIG; - case (7 << 16) | 3: - return OFPERR_OFPPMFC_BAD_ADVERTISE; - case (7 << 16) | 4: - return OFPERR_OFPPMFC_EPERM; - case (8 << 16) | 0: - return OFPERR_OFPTMFC_BAD_TABLE; - case (8 << 16) | 1: - return OFPERR_OFPTMFC_BAD_CONFIG; - case (8 << 16) | 2: - return OFPERR_OFPTMFC_EPERM; - case (9 << 16) | 0: - return OFPERR_OFPQOFC_BAD_PORT; - case (9 << 16) | 1: - return OFPERR_OFPQOFC_BAD_QUEUE; - case (9 << 16) | 2: - return OFPERR_OFPQOFC_EPERM; - case (10 << 16) | 0: - return OFPERR_OFPSCFC_BAD_FLAGS; - case (10 << 16) | 1: - return OFPERR_OFPSCFC_BAD_LEN; - case (10 << 16) | 2: - return OFPERR_OFPSCFC_EPERM; - case (11 << 16) | 0: - return OFPERR_OFPRRFC_STALE; - case (11 << 16) | 1: - return OFPERR_OFPRRFC_UNSUP; - case (11 << 16) | 2: - return OFPERR_OFPRRFC_BAD_ROLE; - case (12 << 16) | 0: - return OFPERR_OFPMMFC_UNKNOWN; - case (12 << 16) | 1: - return OFPERR_OFPMMFC_METER_EXISTS; - case (12 << 16) | 2: - return OFPERR_OFPMMFC_INVALID_METER; - case (12 << 16) | 3: - return OFPERR_OFPMMFC_UNKNOWN_METER; - case (12 << 16) | 4: - return OFPERR_OFPMMFC_BAD_COMMAND; - case (12 << 16) | 5: - return OFPERR_OFPMMFC_BAD_FLAGS; - case (12 << 16) | 6: - return OFPERR_OFPMMFC_BAD_RATE; - case (12 << 16) | 7: - return OFPERR_OFPMMFC_BAD_BURST; - case (12 << 16) | 8: - return OFPERR_OFPMMFC_BAD_BAND; - case (12 << 16) | 9: - return OFPERR_OFPMMFC_BAD_BAND_VALUE; - case (12 << 16) | 10: - return OFPERR_OFPMMFC_OUT_OF_METERS; - case (12 << 16) | 11: - return OFPERR_OFPMMFC_OUT_OF_BANDS; - case (13 << 16) | 0: - return OFPERR_OFPTFFC_BAD_TABLE; - case (13 << 16) | 1: - return OFPERR_OFPTFFC_BAD_METADATA; - case (13 << 16) | 5: - return OFPERR_OFPTFFC_EPERM; - case (13 << 16) | 2: - return OFPERR_OFPBPC_BAD_TYPE; - case (13 << 16) | 3: - return OFPERR_OFPBPC_BAD_LEN; - case (13 << 16) | 4: - return OFPERR_OFPBPC_BAD_VALUE; - } - - return 0; -} - -static const struct ofperr_domain ofperr_of13 = { - "OpenFlow 1.3", - 4, - ofperr_of13_decode, - { - { 0x0, 0, 0 }, /* OFPHFC_INCOMPATIBLE */ - { 0x0, 0, 1 }, /* OFPHFC_EPERM */ - { 0x0, 1, 0 }, /* OFPBRC_BAD_VERSION */ - { 0x0, 1, 1 }, /* OFPBRC_BAD_TYPE */ - { 0x0, 1, 2 }, /* OFPBRC_BAD_STAT */ - { 0x0, 1, 3 }, /* OFPBRC_BAD_VENDOR */ - { 0x0, 1, 4 }, /* OFPBRC_BAD_SUBTYPE */ - { 0x0, 1, 5 }, /* OFPBRC_EPERM */ - { 0x0, 1, 6 }, /* OFPBRC_BAD_LEN */ - { 0x0, 1, 7 }, /* OFPBRC_BUFFER_EMPTY */ - { 0x0, 1, 8 }, /* OFPBRC_BUFFER_UNKNOWN */ - { 0x0, 1, 9 }, /* OFPBRC_BAD_TABLE_ID */ - { 0x0, 1, 10 }, /* OFPBRC_IS_SLAVE */ - { 0x0, 1, 11 }, /* OFPBRC_BAD_PORT */ - { 0x0, 1, 12 }, /* OFPBRC_BAD_PACKET */ - { 0x0, 1, 13 }, /* OFPBRC_MULTIPART_BUFFER_OVERFLOW */ - { 0x2320, 2, 0 }, /* NXBRC_NXM_INVALID */ - { 0x2320, 3, 0 }, /* NXBRC_NXM_BAD_TYPE */ - { 0x2320, 4, 0 }, /* NXBRC_MUST_BE_ZERO */ - { 0x2320, 5, 0 }, /* NXBRC_BAD_REASON */ - { 0x2320, 6, 0 }, /* NXBRC_FM_DUPLICATE_ID */ - { 0x2320, 7, 0 }, /* NXBRC_FM_BAD_FLAGS */ - { 0x2320, 8, 0 }, /* NXBRC_FM_BAD_ID */ - { 0x2320, 9, 0 }, /* NXBRC_FM_BAD_EVENT */ - { 0x2320, 10, 0 }, /* NXBRC_UNENCODABLE_ERROR */ - { 0x0, 2, 0 }, /* OFPBAC_BAD_TYPE */ - { 0x0, 2, 1 }, /* OFPBAC_BAD_LEN */ - { 0x0, 2, 2 }, /* OFPBAC_BAD_VENDOR */ - { 0x0, 2, 3 }, /* OFPBAC_BAD_VENDOR_TYPE */ - { 0x0, 2, 4 }, /* OFPBAC_BAD_OUT_PORT */ - { 0x0, 2, 5 }, /* OFPBAC_BAD_ARGUMENT */ - { 0x0, 2, 6 }, /* OFPBAC_EPERM */ - { 0x0, 2, 7 }, /* OFPBAC_TOO_MANY */ - { 0x0, 2, 8 }, /* OFPBAC_BAD_QUEUE */ - { 0x0, 2, 9 }, /* OFPBAC_BAD_OUT_GROUP */ - { 0x0, 2, 10 }, /* OFPBAC_MATCH_INCONSISTENT */ - { 0x0, 2, 11 }, /* OFPBAC_UNSUPPORTED_ORDER */ - { 0x0, 2, 12 }, /* OFPBAC_BAD_TAG */ - { 0x0, 2, 13 }, /* OFPBAC_BAD_SET_TYPE */ - { 0x0, 2, 14 }, /* OFPBAC_BAD_SET_LEN */ - { 0x0, 2, 15 }, /* OFPBAC_BAD_SET_ARGUMENT */ - { 0x2320, 11, 0 }, /* NXBAC_MUST_BE_ZERO */ - { 0x0, 3, 0 }, /* OFPBIC_UNKNOWN_INST */ - { 0x0, 3, 1 }, /* OFPBIC_UNSUP_INST */ - { 0x0, 3, 2 }, /* OFPBIC_BAD_TABLE_ID */ - { 0x0, 3, 3 }, /* OFPBIC_UNSUP_METADATA */ - { 0x0, 3, 4 }, /* OFPBIC_UNSUP_METADATA_MASK */ - { 0x0, 3, 5 }, /* OFPBIC_BAD_EXPERIMENTER */ - { 0x0, 3, 6 }, /* OFPBIC_BAD_EXP_TYPE */ - { 0x0, 3, 7 }, /* OFPBIC_BAD_LEN */ - { 0x0, 3, 8 }, /* OFPBIC_EPERM */ - { 0x4f4e4600, 2600, -1 }, /* ONFBIC_DUP_INSTRUCTION */ - { 0x0, 4, 0 }, /* OFPBMC_BAD_TYPE */ - { 0x0, 4, 1 }, /* OFPBMC_BAD_LEN */ - { 0x0, 4, 2 }, /* OFPBMC_BAD_TAG */ - { 0x0, 4, 3 }, /* OFPBMC_BAD_DL_ADDR_MASK */ - { 0x0, 4, 4 }, /* OFPBMC_BAD_NW_ADDR_MASK */ - { 0x0, 4, 5 }, /* OFPBMC_BAD_WILDCARDS */ - { 0x0, 4, 6 }, /* OFPBMC_BAD_FIELD */ - { 0x0, 4, 7 }, /* OFPBMC_BAD_VALUE */ - { 0x0, 4, 8 }, /* OFPBMC_BAD_MASK */ - { 0x0, 4, 9 }, /* OFPBMC_BAD_PREREQ */ - { 0x0, 4, 10 }, /* OFPBMC_DUP_FIELD */ - { 0x0, 4, 11 }, /* OFPBMC_EPERM */ - { 0x0, 5, 0 }, /* OFPFMFC_UNKNOWN */ - { 0x0, 5, 1 }, /* OFPFMFC_TABLE_FULL */ - { 0x0, 5, 2 }, /* OFPFMFC_BAD_TABLE_ID */ - { 0x0, 5, 3 }, /* OFPFMFC_OVERLAP */ - { 0x0, 5, 4 }, /* OFPFMFC_EPERM */ - { 0x0, 5, 5 }, /* OFPFMFC_BAD_TIMEOUT */ - { -1, -1, -1 }, /* OFPFMFC_BAD_EMERG_TIMEOUT */ - { 0x0, 5, 6 }, /* OFPFMFC_BAD_COMMAND */ - { 0x0, 5, 7 }, /* OFPFMFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPFMFC_UNSUPPORTED */ - { 0x2320, 12, 0 }, /* NXFMFC_HARDWARE */ - { 0x2320, 13, 0 }, /* NXFMFC_BAD_TABLE_ID */ - { 0x0, 6, 0 }, /* OFPGMFC_GROUP_EXISTS */ - { 0x0, 6, 1 }, /* OFPGMFC_INVALID_GROUP */ - { 0x0, 6, 2 }, /* OFPGMFC_WEIGHT_UNSUPPORTED */ - { 0x0, 6, 3 }, /* OFPGMFC_OUT_OF_GROUPS */ - { 0x0, 6, 4 }, /* OFPGMFC_OUT_OF_BUCKETS */ - { 0x0, 6, 5 }, /* OFPGMFC_CHAINING_UNSUPPORTED */ - { 0x0, 6, 6 }, /* OFPGMFC_WATCH_UNSUPPORTED */ - { 0x0, 6, 7 }, /* OFPGMFC_LOOP */ - { 0x0, 6, 8 }, /* OFPGMFC_UNKNOWN_GROUP */ - { 0x0, 6, 9 }, /* OFPGMFC_CHAINED_GROUP */ - { 0x0, 6, 10 }, /* OFPGMFC_BAD_TYPE */ - { 0x0, 6, 11 }, /* OFPGMFC_BAD_COMMAND */ - { 0x0, 6, 12 }, /* OFPGMFC_BAD_BUCKET */ - { 0x0, 6, 13 }, /* OFPGMFC_BAD_WATCH */ - { 0x0, 6, 14 }, /* OFPGMFC_EPERM */ - { 0x0, 7, 0 }, /* OFPPMFC_BAD_PORT */ - { 0x0, 7, 1 }, /* OFPPMFC_BAD_HW_ADDR */ - { 0x0, 7, 2 }, /* OFPPMFC_BAD_CONFIG */ - { 0x0, 7, 3 }, /* OFPPMFC_BAD_ADVERTISE */ - { 0x0, 7, 4 }, /* OFPPMFC_EPERM */ - { 0x0, 8, 0 }, /* OFPTMFC_BAD_TABLE */ - { 0x0, 8, 1 }, /* OFPTMFC_BAD_CONFIG */ - { 0x0, 8, 2 }, /* OFPTMFC_EPERM */ - { 0x0, 9, 0 }, /* OFPQOFC_BAD_PORT */ - { 0x0, 9, 1 }, /* OFPQOFC_BAD_QUEUE */ - { 0x0, 9, 2 }, /* OFPQOFC_EPERM */ - { 0x0, 10, 0 }, /* OFPSCFC_BAD_FLAGS */ - { 0x0, 10, 1 }, /* OFPSCFC_BAD_LEN */ - { 0x0, 10, 2 }, /* OFPSCFC_EPERM */ - { 0x0, 11, 0 }, /* OFPRRFC_STALE */ - { 0x0, 11, 1 }, /* OFPRRFC_UNSUP */ - { 0x0, 11, 2 }, /* OFPRRFC_BAD_ROLE */ - { 0x0, 12, 0 }, /* OFPMMFC_UNKNOWN */ - { 0x0, 12, 1 }, /* OFPMMFC_METER_EXISTS */ - { 0x0, 12, 2 }, /* OFPMMFC_INVALID_METER */ - { 0x0, 12, 3 }, /* OFPMMFC_UNKNOWN_METER */ - { 0x0, 12, 4 }, /* OFPMMFC_BAD_COMMAND */ - { 0x0, 12, 5 }, /* OFPMMFC_BAD_FLAGS */ - { 0x0, 12, 6 }, /* OFPMMFC_BAD_RATE */ - { 0x0, 12, 7 }, /* OFPMMFC_BAD_BURST */ - { 0x0, 12, 8 }, /* OFPMMFC_BAD_BAND */ - { 0x0, 12, 9 }, /* OFPMMFC_BAD_BAND_VALUE */ - { 0x0, 12, 10 }, /* OFPMMFC_OUT_OF_METERS */ - { 0x0, 12, 11 }, /* OFPMMFC_OUT_OF_BANDS */ - { 0x0, 13, 0 }, /* OFPTFFC_BAD_TABLE */ - { 0x0, 13, 1 }, /* OFPTFFC_BAD_METADATA */ - { 0x0, 13, 5 }, /* OFPTFFC_EPERM */ - { 0x0, 13, 2 }, /* OFPBPC_BAD_TYPE */ - { 0x0, 13, 3 }, /* OFPBPC_BAD_LEN */ - { 0x0, 13, 4 }, /* OFPBPC_BAD_VALUE */ - { -1, -1, -1 }, /* OFPBPC_TOO_MANY */ - { -1, -1, -1 }, /* OFPBPC_DUP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXPERIMENTER */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_TYPE */ - { -1, -1, -1 }, /* OFPBPC_BAD_EXP_VALUE */ - { -1, -1, -1 }, /* OFPBPC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_UNKNOWN */ - { -1, -1, -1 }, /* OFPBFC_EPERM */ - { -1, -1, -1 }, /* OFPBFC_BAD_ID */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_EXIST */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_CLOSED */ - { -1, -1, -1 }, /* OFPBFC_OUT_OF_BUNDLES */ - { -1, -1, -1 }, /* OFPBFC_BAD_TYPE */ - { -1, -1, -1 }, /* OFPBFC_BAD_FLAGS */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_LEN */ - { -1, -1, -1 }, /* OFPBFC_MSG_BAD_XID */ - { -1, -1, -1 }, /* OFPBFC_MSG_UNSUP */ - { -1, -1, -1 }, /* OFPBFC_MSG_CONFLICT */ - { -1, -1, -1 }, /* OFPBFC_MSG_TOO_MANY */ - { -1, -1, -1 }, /* OFPBFC_MSG_FAILED */ - { -1, -1, -1 }, /* OFPBFC_TIMEOUT */ - { -1, -1, -1 }, /* OFPBFC_BUNDLE_IN_PROGRESS */ - }, -}; diff -Nru openvswitch-2.3.1/lib/ofp-msgs.c openvswitch-2.4.0~git20150623/lib/ofp-msgs.c --- openvswitch-2.3.1/lib/ofp-msgs.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-msgs.c 2015-06-23 18:46:21.000000000 +0000 @@ -24,7 +24,7 @@ #include "openflow/nicira-ext.h" #include "openflow/openflow.h" #include "ovs-thread.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ofp_msgs); @@ -110,11 +110,9 @@ static ovs_be32 alloc_xid(void) { - static atomic_uint32_t next_xid = ATOMIC_VAR_INIT(1); - uint32_t xid; + static atomic_count next_xid = ATOMIC_COUNT_INIT(1); - atomic_add(&next_xid, 1, &xid); - return htonl(xid); + return htonl(atomic_count_inc(&next_xid)); } static uint32_t @@ -374,7 +372,7 @@ } /* Determines the OFPRAW_* type of the OpenFlow message in 'msg', which starts - * at 'ofpbuf_data(msg)' and has length 'ofpbuf_size(msg)' bytes. On success, + * at 'msg->data' and has length 'msg->size' bytes. On success, * returns 0 and stores the type into '*rawp'. On failure, returns an OFPERR_* * error code and zeros '*rawp'. * @@ -384,8 +382,8 @@ * In addition to setting '*rawp', this function pulls off the OpenFlow header * (including the stats headers, vendor header, and any subtype header) with * ofpbuf_pull(). It also sets 'msg->frame' to the start of the OpenFlow - * header and 'msg->l3' just beyond the headers (that is, to the final value of - * ofpbuf_data(msg)). */ + * header and 'msg->msg' just beyond the headers (that is, to the final value of + * msg->data). */ enum ofperr ofpraw_pull(enum ofpraw *rawp, struct ofpbuf *msg) { @@ -402,12 +400,12 @@ enum ofpraw raw; /* Set default outputs. */ - msg->frame = ofpbuf_data(msg); - ofpbuf_set_l3(msg, msg->frame); + msg->header = msg->data; + msg->msg = msg->header; *rawp = 0; - len = ofpbuf_size(msg); - error = ofphdrs_decode(&hdrs, ofpbuf_data(msg), len); + len = msg->size; + error = ofphdrs_decode(&hdrs, msg->data, len); if (error) { return error; } @@ -419,8 +417,8 @@ info = raw_info_get(raw); instance = raw_instance_get(info, hdrs.version); - msg->frame = ofpbuf_pull(msg, instance->hdrs_len); - ofpbuf_set_l3(msg, ofpbuf_data(msg)); + msg->header = ofpbuf_pull(msg, instance->hdrs_len); + msg->msg = msg->data; min_len = instance->hdrs_len + info->min_body; switch (info->extra_multiple) { @@ -595,7 +593,7 @@ * must specify a valid (raw, version) pair. * * Upon return, 'buf->frame' points to the beginning of the OpenFlow header and - * 'buf->l3' points just after it, to where the message's body will start. The + * 'buf->msg' points just after it, to where the message's body will start. The * caller must actually allocating the body into the space reserved for it, * e.g. with ofpbuf_put_uninit(). */ void @@ -667,17 +665,17 @@ ofpbuf_prealloc_tailroom(buf, (instance->hdrs_len + info->min_body + extra_tailroom)); - buf->frame = ofpbuf_put_uninit(buf, instance->hdrs_len); - ofpbuf_set_l3(buf, ofpbuf_tail(buf)); + buf->header = ofpbuf_put_uninit(buf, instance->hdrs_len); + buf->msg = ofpbuf_tail(buf); - oh = buf->frame; + oh = buf->header; oh->version = version; oh->type = hdrs->type; - oh->length = htons(ofpbuf_size(buf)); + oh->length = htons(buf->size); oh->xid = xid; if (hdrs->type == OFPT_VENDOR) { - struct nicira_header *nh = buf->frame; + struct nicira_header *nh = buf->header; ovs_assert(hdrs->vendor == NX_VENDOR_ID); nh->vendor = htonl(hdrs->vendor); @@ -685,17 +683,17 @@ } else if (version == OFP10_VERSION && (hdrs->type == OFPT10_STATS_REQUEST || hdrs->type == OFPT10_STATS_REPLY)) { - struct ofp10_stats_msg *osm = buf->frame; + struct ofp10_stats_msg *osm = buf->header; osm->type = htons(hdrs->stat); osm->flags = htons(0); if (hdrs->stat == OFPST_VENDOR) { - struct ofp10_vendor_stats_msg *ovsm = buf->frame; + struct ofp10_vendor_stats_msg *ovsm = buf->header; ovsm->vendor = htonl(hdrs->vendor); if (hdrs->vendor == NX_VENDOR_ID) { - struct nicira10_stats_msg *nsm = buf->frame; + struct nicira10_stats_msg *nsm = buf->header; nsm->subtype = htonl(hdrs->subtype); memset(nsm->pad, 0, sizeof nsm->pad); @@ -706,18 +704,18 @@ } else if (version != OFP10_VERSION && (hdrs->type == OFPT11_STATS_REQUEST || hdrs->type == OFPT11_STATS_REPLY)) { - struct ofp11_stats_msg *osm = buf->frame; + struct ofp11_stats_msg *osm = buf->header; osm->type = htons(hdrs->stat); osm->flags = htons(0); memset(osm->pad, 0, sizeof osm->pad); if (hdrs->stat == OFPST_VENDOR) { - struct ofp11_vendor_stats_msg *ovsm = buf->frame; + struct ofp11_vendor_stats_msg *ovsm = buf->header; ovsm->vendor = htonl(hdrs->vendor); if (hdrs->vendor == NX_VENDOR_ID) { - struct nicira11_stats_msg *nsm = buf->frame; + struct nicira11_stats_msg *nsm = buf->header; nsm->subtype = htonl(hdrs->subtype); } else { @@ -794,7 +792,7 @@ } /* Determines the OFPTYPE_* type of the OpenFlow message in 'msg', which starts - * at 'ofpbuf_data(msg)' and has length 'ofpbuf_size(msg)' bytes. On success, + * at 'msg->data' and has length 'msg->size' bytes. On success, * returns 0 and stores the type into '*typep'. On failure, returns an * OFPERR_* error code and zeros '*typep'. * @@ -804,8 +802,8 @@ * In addition to setting '*typep', this function pulls off the OpenFlow header * (including the stats headers, vendor header, and any subtype header) with * ofpbuf_pull(). It also sets 'msg->frame' to the start of the OpenFlow - * header and 'msg->l3' just beyond the headers (that is, to the final value of - * ofpbuf_data(msg)). */ + * header and 'msg->msg' just beyond the headers (that is, to the final value of + * msg->data). */ enum ofperr ofptype_pull(enum ofptype *typep, struct ofpbuf *buf) { @@ -828,15 +826,15 @@ } /* Updates the 'length' field of the OpenFlow message in 'buf' to - * 'ofpbuf_size(buf)'. */ + * 'buf->size'. */ void ofpmsg_update_length(struct ofpbuf *buf) { struct ofp_header *oh = ofpbuf_at_assert(buf, 0, sizeof *oh); - oh->length = htons(ofpbuf_size(buf)); + oh->length = htons(buf->size); } -/* Returns just past the Openflow header (including the stats headers, vendor +/* Returns just past the OpenFlow header (including the stats headers, vendor * header, and any subtype header) in 'oh'. */ const void * ofpmsg_body(const struct ofp_header *oh) @@ -862,7 +860,7 @@ * use calls to the other ofpmp_*() functions to add to the body and split the * message into multiple parts, if necessary. */ void -ofpmp_init(struct list *replies, const struct ofp_header *request) +ofpmp_init(struct ovs_list *replies, const struct ofp_header *request) { struct ofpbuf *msg; @@ -880,11 +878,11 @@ * have not actually been allocated, so the caller must do so with * e.g. ofpbuf_put_uninit(). */ struct ofpbuf * -ofpmp_reserve(struct list *replies, size_t len) +ofpmp_reserve(struct ovs_list *replies, size_t len) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); - if (ofpbuf_size(msg) + len <= UINT16_MAX) { + if (msg->size + len <= UINT16_MAX) { ofpbuf_prealloc_tailroom(msg, len); return msg; } else { @@ -892,16 +890,16 @@ struct ofpbuf *next; struct ofphdrs hdrs; - ofphdrs_decode_assert(&hdrs, ofpbuf_data(msg), ofpbuf_size(msg)); + ofphdrs_decode_assert(&hdrs, msg->data, msg->size); hdrs_len = ofphdrs_len(&hdrs); next = ofpbuf_new(MAX(1024, hdrs_len + len)); - ofpbuf_put(next, ofpbuf_data(msg), hdrs_len); - next->frame = ofpbuf_data(next); - ofpbuf_set_l3(next, ofpbuf_tail(next)); + ofpbuf_put(next, msg->data, hdrs_len); + next->header = next->data; + next->msg = ofpbuf_tail(next); list_push_back(replies, &next->list_node); - *ofpmp_flags__(ofpbuf_data(msg)) |= htons(OFPSF_REPLY_MORE); + *ofpmp_flags__(msg->data) |= htons(OFPSF_REPLY_MORE); return next; } @@ -910,7 +908,7 @@ /* Appends 'len' bytes to the series of statistics replies in 'replies', and * returns the first byte. */ void * -ofpmp_append(struct list *replies, size_t len) +ofpmp_append(struct ovs_list *replies, size_t len) { return ofpbuf_put_uninit(ofpmp_reserve(replies, len), len); } @@ -926,26 +924,26 @@ * the first 'start_ofs' bytes, the second one containing the bytes from that * offset onward. */ void -ofpmp_postappend(struct list *replies, size_t start_ofs) +ofpmp_postappend(struct ovs_list *replies, size_t start_ofs) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); ovs_assert(start_ofs <= UINT16_MAX); - if (ofpbuf_size(msg) > UINT16_MAX) { - size_t len = ofpbuf_size(msg) - start_ofs; + if (msg->size > UINT16_MAX) { + size_t len = msg->size - start_ofs; memcpy(ofpmp_append(replies, len), - (const uint8_t *) ofpbuf_data(msg) + start_ofs, len); - ofpbuf_set_size(msg, start_ofs); + (const uint8_t *) msg->data + start_ofs, len); + msg->size = start_ofs; } } /* Returns the OpenFlow version of the replies being constructed in 'replies', * which should have been initialized by ofpmp_init(). */ enum ofp_version -ofpmp_version(struct list *replies) +ofpmp_version(struct ovs_list *replies) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); - const struct ofp_header *oh = ofpbuf_data(msg); + const struct ofp_header *oh = msg->data; return oh->version; } @@ -953,13 +951,13 @@ /* Determines the OFPRAW_* type of the OpenFlow messages in 'replies', which * should have been initialized by ofpmp_init(). */ enum ofpraw -ofpmp_decode_raw(struct list *replies) +ofpmp_decode_raw(struct ovs_list *replies) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); enum ofperr error; enum ofpraw raw; - error = ofpraw_decode_partial(&raw, ofpbuf_data(msg), ofpbuf_size(msg)); + error = ofpraw_decode_partial(&raw, msg->data, msg->size); ovs_assert(!error); return raw; } diff -Nru openvswitch-2.3.1/lib/ofp-msgs.h openvswitch-2.4.0~git20150623/lib/ofp-msgs.h --- openvswitch-2.3.1/lib/ofp-msgs.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-msgs.h 2015-06-23 18:46:21.000000000 +0000 @@ -42,7 +42,7 @@ #include "ofp-errors.h" #include "util.h" -struct list; +struct ovs_list; /* Raw identifiers for OpenFlow messages. * @@ -148,7 +148,7 @@ OFPRAW_OFPT11_PACKET_IN, /* OFPT 1.2 (10): struct ofp12_packet_in, uint8_t[]. */ OFPRAW_OFPT12_PACKET_IN, - /* OFPT 1.3 (10): struct ofp13_packet_in, uint8_t[]. */ + /* OFPT 1.3+ (10): struct ofp13_packet_in, uint8_t[]. */ OFPRAW_OFPT13_PACKET_IN, /* NXT 1.0+ (17): struct nx_packet_in, uint8_t[]. */ OFPRAW_NXT_PACKET_IN, @@ -172,15 +172,17 @@ /* OFPT 1.1+ (13): struct ofp11_packet_out, uint8_t[]. */ OFPRAW_OFPT11_PACKET_OUT, - /* OFPT 1.0 (14): struct ofp10_flow_mod, struct ofp_action_header[]. */ + /* OFPT 1.0 (14): struct ofp10_flow_mod, uint8_t[8][]. */ OFPRAW_OFPT10_FLOW_MOD, /* OFPT 1.1+ (14): struct ofp11_flow_mod, struct ofp11_instruction[]. */ OFPRAW_OFPT11_FLOW_MOD, /* NXT 1.0+ (13): struct nx_flow_mod, uint8_t[8][]. */ OFPRAW_NXT_FLOW_MOD, - /* OFPT 1.1+ (15): struct ofp11_group_mod, uint8_t[8][]. */ + /* OFPT 1.1-1.4 (15): struct ofp11_group_mod, uint8_t[8][]. */ OFPRAW_OFPT11_GROUP_MOD, + /* OFPT 1.5+ (15): struct ofp15_group_mod, uint8_t[8][]. */ + OFPRAW_OFPT15_GROUP_MOD, /* OFPT 1.0 (15): struct ofp10_port_mod. */ OFPRAW_OFPT10_PORT_MOD, @@ -379,6 +381,16 @@ /* OFPST 1.4+ (13): uint8_t[8][]. */ OFPRAW_OFPST14_PORT_DESC_REPLY, + /* OFPST 1.4+ (16): uint8_t[8][]. */ + OFPRAW_OFPST14_FLOW_MONITOR_REQUEST, + /* NXST 1.0 (2): uint8_t[8][]. */ + OFPRAW_NXST_FLOW_MONITOR_REQUEST, + + /* OFPST 1.4+ (16): uint8_t[8][]. */ + OFPRAW_OFPST14_FLOW_MONITOR_REPLY, + /* NXST 1.0 (2): uint8_t[8][]. */ + OFPRAW_NXST_FLOW_MONITOR_REPLY, + /* Nicira extension messages. * * Nicira extensions that correspond to standard OpenFlow messages are listed @@ -407,17 +419,6 @@ /* NXT 1.0+ (23): void. */ OFPRAW_NXT_FLOW_MONITOR_RESUMED, - -/* Nicira extension statistics. - * - * Nicira extension statistics that correspond to standard OpenFlow statistics - * are listed alongside the standard versions above. */ - - /* NXST 1.0 (2): uint8_t[8][]. */ - OFPRAW_NXST_FLOW_MONITOR_REQUEST, - - /* NXST 1.0 (2): uint8_t[8][]. */ - OFPRAW_NXST_FLOW_MONITOR_REPLY, }; /* Decoding messages into OFPRAW_* values. */ @@ -496,7 +497,8 @@ OFPTYPE_FLOW_MOD, /* OFPRAW_OFPT10_FLOW_MOD. * OFPRAW_OFPT11_FLOW_MOD. * OFPRAW_NXT_FLOW_MOD. */ - OFPTYPE_GROUP_MOD, /* OFPRAW_OFPT11_GROUP_MOD. */ + OFPTYPE_GROUP_MOD, /* OFPRAW_OFPT11_GROUP_MOD. + * OFPRAW_OFPT15_GROUP_MOD. */ OFPTYPE_PORT_MOD, /* OFPRAW_OFPT10_PORT_MOD. * OFPRAW_OFPT11_PORT_MOD. * OFPRAW_OFPT14_PORT_MOD. */ @@ -607,6 +609,11 @@ * OFPRAW_OFPST11_PORT_DESC_REPLY. * OFPRAW_OFPST14_PORT_DESC_REPLY. */ + OFPTYPE_FLOW_MONITOR_STATS_REQUEST, /* OFPRAW_OFPST14_FLOW_MONITOR_REQUEST. + * OFPRAW_NXST_FLOW_MONITOR_REQUEST. */ + OFPTYPE_FLOW_MONITOR_STATS_REPLY, /* OFPRAW_OFPST14_FLOW_MONITOR_REPLY. + * OFPRAW_NXST_FLOW_MONITOR_REPLY. */ + /* Nicira extensions. */ OFPTYPE_SET_FLOW_FORMAT, /* OFPRAW_NXT_SET_FLOW_FORMAT. */ OFPTYPE_FLOW_MOD_TABLE_ID, /* OFPRAW_NXT_FLOW_MOD_TABLE_ID. */ @@ -615,8 +622,6 @@ OFPTYPE_SET_CONTROLLER_ID, /* OFPRAW_NXT_SET_CONTROLLER_ID. */ /* Flow monitor extension. */ - OFPTYPE_FLOW_MONITOR_STATS_REQUEST, /* OFPRAW_NXST_FLOW_MONITOR_REQUEST. */ - OFPTYPE_FLOW_MONITOR_STATS_REPLY, /* OFPRAW_NXST_FLOW_MONITOR_REPLY. */ OFPTYPE_FLOW_MONITOR_CANCEL, /* OFPRAW_NXT_FLOW_MONITOR_CANCEL. */ OFPTYPE_FLOW_MONITOR_PAUSED, /* OFPRAW_NXT_FLOW_MONITOR_PAUSED. */ OFPTYPE_FLOW_MONITOR_RESUMED, /* OFPRAW_NXT_FLOW_MONITOR_RESUMED. */ @@ -656,15 +661,15 @@ * within 64 kB doesn't need any special treatment, so you might as well use * the ofpraw_alloc_*() functions. * - * These functions work with a "struct list" of "struct ofpbuf"s, each of + * These functions work with a "struct ovs_list" of "struct ofpbuf"s, each of * which represents one part of a multipart message. */ -void ofpmp_init(struct list *, const struct ofp_header *request); -struct ofpbuf *ofpmp_reserve(struct list *, size_t len); -void *ofpmp_append(struct list *, size_t len); -void ofpmp_postappend(struct list *, size_t start_ofs); +void ofpmp_init(struct ovs_list *, const struct ofp_header *request); +struct ofpbuf *ofpmp_reserve(struct ovs_list *, size_t len); +void *ofpmp_append(struct ovs_list *, size_t len); +void ofpmp_postappend(struct ovs_list *, size_t start_ofs); -enum ofp_version ofpmp_version(struct list *); -enum ofpraw ofpmp_decode_raw(struct list *); +enum ofp_version ofpmp_version(struct ovs_list *); +enum ofpraw ofpmp_decode_raw(struct ovs_list *); /* Decoding multipart replies. */ uint16_t ofpmp_flags(const struct ofp_header *); diff -Nru openvswitch-2.3.1/lib/ofp-msgs.inc openvswitch-2.4.0~git20150623/lib/ofp-msgs.inc --- openvswitch-2.3.1/lib/ofp-msgs.inc 2014-12-04 05:59:59.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-msgs.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,2865 +0,0 @@ -/* Generated automatically; do not modify! -*- buffer-read-only: t -*- */ - -static struct raw_instance ofpraw_ofpt_hello_instances[] = { - { {0, NULL}, {1, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {2, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {3, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {4, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {5, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {6, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {7, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {8, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {9, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {10, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {11, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {12, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {13, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {14, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {15, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {16, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {17, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {18, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {19, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {20, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {21, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {22, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {23, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {24, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {25, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {26, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {27, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {28, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {29, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {30, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {31, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {32, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {33, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {34, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {35, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {36, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {37, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {38, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {39, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {40, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {41, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {42, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {43, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {44, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {45, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {46, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {47, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {48, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {49, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {50, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {51, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {52, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {53, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {54, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {55, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {56, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {57, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {58, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {59, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {60, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {61, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {62, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {63, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {64, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {65, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {66, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {67, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {68, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {69, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {70, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {71, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {72, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {73, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {74, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {75, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {76, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {77, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {78, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {79, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {80, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {81, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {82, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {83, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {84, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {85, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {86, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {87, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {88, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {89, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {90, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {91, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {92, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {93, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {94, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {95, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {96, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {97, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {98, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {99, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {100, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {101, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {102, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {103, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {104, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {105, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {106, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {107, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {108, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {109, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {110, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {111, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {112, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {113, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {114, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {115, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {116, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {117, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {118, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {119, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {120, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {121, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {122, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {123, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {124, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {125, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {126, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {127, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {128, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {129, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {130, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {131, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {132, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {133, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {134, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {135, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {136, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {137, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {138, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {139, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {140, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {141, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {142, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {143, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {144, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {145, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {146, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {147, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {148, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {149, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {150, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {151, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {152, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {153, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {154, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {155, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {156, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {157, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {158, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {159, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {160, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {161, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {162, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {163, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {164, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {165, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {166, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {167, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {168, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {169, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {170, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {171, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {172, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {173, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {174, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {175, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {176, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {177, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {178, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {179, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {180, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {181, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {182, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {183, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {184, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {185, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {186, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {187, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {188, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {189, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {190, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {191, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {192, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {193, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {194, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {195, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {196, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {197, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {198, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {199, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {200, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {201, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {202, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {203, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {204, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {205, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {206, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {207, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {208, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {209, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {210, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {211, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {212, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {213, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {214, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {215, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {216, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {217, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {218, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {219, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {220, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {221, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {222, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {223, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {224, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {225, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {226, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {227, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {228, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {229, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {230, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {231, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {232, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {233, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {234, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {235, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {236, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {237, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {238, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {239, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {240, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {241, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {242, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {243, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {244, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {245, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {246, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {247, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {248, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {249, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {250, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {251, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {252, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {253, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {254, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, - { {0, NULL}, {255, 0, 0, 0x0, 0}, OFPRAW_OFPT_HELLO, 0 }, -}; -static struct raw_instance ofpraw_ofpt_error_instances[] = { - { {0, NULL}, {1, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {2, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {3, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {4, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {5, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {6, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {7, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {8, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {9, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {10, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {11, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {12, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {13, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {14, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {15, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {16, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {17, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {18, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {19, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {20, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {21, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {22, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {23, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {24, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {25, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {26, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {27, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {28, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {29, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {30, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {31, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {32, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {33, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {34, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {35, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {36, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {37, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {38, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {39, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {40, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {41, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {42, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {43, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {44, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {45, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {46, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {47, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {48, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {49, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {50, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {51, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {52, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {53, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {54, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {55, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {56, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {57, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {58, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {59, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {60, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {61, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {62, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {63, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {64, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {65, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {66, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {67, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {68, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {69, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {70, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {71, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {72, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {73, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {74, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {75, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {76, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {77, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {78, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {79, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {80, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {81, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {82, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {83, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {84, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {85, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {86, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {87, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {88, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {89, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {90, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {91, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {92, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {93, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {94, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {95, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {96, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {97, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {98, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {99, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {100, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {101, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {102, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {103, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {104, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {105, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {106, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {107, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {108, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {109, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {110, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {111, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {112, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {113, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {114, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {115, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {116, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {117, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {118, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {119, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {120, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {121, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {122, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {123, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {124, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {125, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {126, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {127, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {128, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {129, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {130, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {131, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {132, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {133, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {134, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {135, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {136, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {137, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {138, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {139, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {140, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {141, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {142, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {143, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {144, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {145, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {146, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {147, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {148, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {149, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {150, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {151, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {152, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {153, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {154, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {155, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {156, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {157, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {158, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {159, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {160, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {161, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {162, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {163, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {164, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {165, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {166, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {167, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {168, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {169, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {170, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {171, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {172, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {173, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {174, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {175, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {176, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {177, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {178, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {179, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {180, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {181, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {182, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {183, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {184, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {185, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {186, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {187, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {188, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {189, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {190, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {191, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {192, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {193, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {194, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {195, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {196, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {197, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {198, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {199, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {200, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {201, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {202, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {203, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {204, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {205, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {206, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {207, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {208, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {209, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {210, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {211, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {212, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {213, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {214, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {215, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {216, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {217, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {218, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {219, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {220, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {221, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {222, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {223, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {224, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {225, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {226, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {227, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {228, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {229, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {230, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {231, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {232, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {233, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {234, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {235, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {236, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {237, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {238, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {239, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {240, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {241, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {242, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {243, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {244, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {245, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {246, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {247, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {248, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {249, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {250, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {251, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {252, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {253, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {254, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, - { {0, NULL}, {255, 1, 0, 0x0, 0}, OFPRAW_OFPT_ERROR, 0 }, -}; -static struct raw_instance ofpraw_ofpt_echo_request_instances[] = { - { {0, NULL}, {1, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {2, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {3, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {4, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {5, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {6, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {7, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {8, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {9, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {10, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {11, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {12, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {13, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {14, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {15, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {16, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {17, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {18, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {19, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {20, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {21, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {22, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {23, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {24, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {25, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {26, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {27, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {28, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {29, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {30, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {31, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {32, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {33, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {34, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {35, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {36, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {37, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {38, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {39, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {40, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {41, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {42, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {43, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {44, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {45, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {46, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {47, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {48, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {49, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {50, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {51, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {52, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {53, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {54, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {55, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {56, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {57, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {58, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {59, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {60, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {61, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {62, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {63, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {64, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {65, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {66, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {67, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {68, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {69, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {70, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {71, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {72, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {73, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {74, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {75, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {76, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {77, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {78, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {79, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {80, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {81, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {82, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {83, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {84, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {85, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {86, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {87, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {88, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {89, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {90, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {91, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {92, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {93, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {94, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {95, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {96, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {97, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {98, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {99, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {100, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {101, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {102, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {103, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {104, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {105, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {106, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {107, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {108, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {109, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {110, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {111, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {112, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {113, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {114, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {115, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {116, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {117, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {118, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {119, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {120, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {121, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {122, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {123, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {124, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {125, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {126, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {127, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {128, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {129, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {130, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {131, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {132, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {133, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {134, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {135, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {136, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {137, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {138, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {139, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {140, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {141, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {142, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {143, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {144, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {145, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {146, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {147, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {148, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {149, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {150, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {151, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {152, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {153, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {154, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {155, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {156, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {157, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {158, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {159, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {160, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {161, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {162, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {163, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {164, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {165, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {166, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {167, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {168, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {169, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {170, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {171, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {172, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {173, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {174, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {175, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {176, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {177, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {178, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {179, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {180, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {181, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {182, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {183, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {184, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {185, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {186, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {187, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {188, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {189, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {190, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {191, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {192, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {193, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {194, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {195, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {196, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {197, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {198, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {199, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {200, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {201, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {202, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {203, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {204, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {205, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {206, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {207, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {208, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {209, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {210, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {211, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {212, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {213, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {214, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {215, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {216, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {217, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {218, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {219, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {220, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {221, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {222, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {223, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {224, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {225, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {226, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {227, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {228, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {229, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {230, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {231, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {232, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {233, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {234, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {235, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {236, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {237, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {238, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {239, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {240, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {241, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {242, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {243, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {244, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {245, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {246, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {247, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {248, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {249, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {250, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {251, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {252, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {253, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {254, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, - { {0, NULL}, {255, 2, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt_echo_reply_instances[] = { - { {0, NULL}, {1, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {2, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {3, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {4, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {5, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {6, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {7, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {8, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {9, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {10, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {11, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {12, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {13, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {14, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {15, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {16, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {17, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {18, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {19, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {20, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {21, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {22, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {23, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {24, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {25, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {26, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {27, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {28, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {29, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {30, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {31, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {32, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {33, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {34, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {35, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {36, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {37, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {38, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {39, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {40, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {41, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {42, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {43, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {44, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {45, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {46, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {47, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {48, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {49, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {50, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {51, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {52, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {53, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {54, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {55, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {56, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {57, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {58, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {59, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {60, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {61, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {62, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {63, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {64, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {65, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {66, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {67, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {68, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {69, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {70, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {71, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {72, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {73, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {74, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {75, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {76, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {77, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {78, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {79, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {80, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {81, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {82, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {83, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {84, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {85, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {86, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {87, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {88, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {89, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {90, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {91, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {92, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {93, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {94, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {95, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {96, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {97, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {98, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {99, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {100, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {101, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {102, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {103, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {104, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {105, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {106, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {107, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {108, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {109, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {110, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {111, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {112, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {113, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {114, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {115, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {116, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {117, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {118, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {119, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {120, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {121, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {122, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {123, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {124, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {125, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {126, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {127, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {128, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {129, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {130, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {131, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {132, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {133, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {134, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {135, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {136, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {137, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {138, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {139, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {140, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {141, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {142, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {143, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {144, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {145, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {146, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {147, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {148, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {149, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {150, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {151, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {152, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {153, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {154, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {155, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {156, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {157, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {158, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {159, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {160, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {161, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {162, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {163, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {164, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {165, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {166, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {167, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {168, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {169, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {170, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {171, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {172, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {173, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {174, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {175, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {176, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {177, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {178, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {179, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {180, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {181, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {182, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {183, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {184, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {185, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {186, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {187, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {188, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {189, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {190, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {191, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {192, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {193, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {194, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {195, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {196, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {197, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {198, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {199, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {200, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {201, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {202, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {203, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {204, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {205, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {206, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {207, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {208, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {209, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {210, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {211, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {212, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {213, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {214, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {215, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {216, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {217, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {218, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {219, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {220, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {221, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {222, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {223, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {224, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {225, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {226, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {227, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {228, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {229, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {230, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {231, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {232, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {233, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {234, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {235, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {236, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {237, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {238, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {239, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {240, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {241, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {242, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {243, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {244, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {245, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {246, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {247, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {248, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {249, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {250, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {251, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {252, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {253, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {254, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, - { {0, NULL}, {255, 3, 0, 0x0, 0}, OFPRAW_OFPT_ECHO_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt_features_request_instances[] = { - { {0, NULL}, {1, 5, 0, 0x0, 0}, OFPRAW_OFPT_FEATURES_REQUEST, 0 }, - { {0, NULL}, {2, 5, 0, 0x0, 0}, OFPRAW_OFPT_FEATURES_REQUEST, 0 }, - { {0, NULL}, {3, 5, 0, 0x0, 0}, OFPRAW_OFPT_FEATURES_REQUEST, 0 }, - { {0, NULL}, {4, 5, 0, 0x0, 0}, OFPRAW_OFPT_FEATURES_REQUEST, 0 }, - { {0, NULL}, {5, 5, 0, 0x0, 0}, OFPRAW_OFPT_FEATURES_REQUEST, 0 }, - { {0, NULL}, {6, 5, 0, 0x0, 0}, OFPRAW_OFPT_FEATURES_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_features_reply_instances[] = { - { {0, NULL}, {1, 6, 0, 0x0, 0}, OFPRAW_OFPT10_FEATURES_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_features_reply_instances[] = { - { {0, NULL}, {2, 6, 0, 0x0, 0}, OFPRAW_OFPT11_FEATURES_REPLY, 0 }, - { {0, NULL}, {3, 6, 0, 0x0, 0}, OFPRAW_OFPT11_FEATURES_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt13_features_reply_instances[] = { - { {0, NULL}, {4, 6, 0, 0x0, 0}, OFPRAW_OFPT13_FEATURES_REPLY, 0 }, - { {0, NULL}, {5, 6, 0, 0x0, 0}, OFPRAW_OFPT13_FEATURES_REPLY, 0 }, - { {0, NULL}, {6, 6, 0, 0x0, 0}, OFPRAW_OFPT13_FEATURES_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt_get_config_request_instances[] = { - { {0, NULL}, {1, 7, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {2, 7, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {3, 7, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {4, 7, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {5, 7, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {6, 7, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt_get_config_reply_instances[] = { - { {0, NULL}, {1, 8, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {2, 8, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {3, 8, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {4, 8, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {5, 8, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {6, 8, 0, 0x0, 0}, OFPRAW_OFPT_GET_CONFIG_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt_set_config_instances[] = { - { {0, NULL}, {1, 9, 0, 0x0, 0}, OFPRAW_OFPT_SET_CONFIG, 0 }, - { {0, NULL}, {2, 9, 0, 0x0, 0}, OFPRAW_OFPT_SET_CONFIG, 0 }, - { {0, NULL}, {3, 9, 0, 0x0, 0}, OFPRAW_OFPT_SET_CONFIG, 0 }, - { {0, NULL}, {4, 9, 0, 0x0, 0}, OFPRAW_OFPT_SET_CONFIG, 0 }, - { {0, NULL}, {5, 9, 0, 0x0, 0}, OFPRAW_OFPT_SET_CONFIG, 0 }, - { {0, NULL}, {6, 9, 0, 0x0, 0}, OFPRAW_OFPT_SET_CONFIG, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_packet_in_instances[] = { - { {0, NULL}, {1, 10, 0, 0x0, 0}, OFPRAW_OFPT10_PACKET_IN, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_packet_in_instances[] = { - { {0, NULL}, {2, 10, 0, 0x0, 0}, OFPRAW_OFPT11_PACKET_IN, 0 }, -}; -static struct raw_instance ofpraw_ofpt12_packet_in_instances[] = { - { {0, NULL}, {3, 10, 0, 0x0, 0}, OFPRAW_OFPT12_PACKET_IN, 0 }, -}; -static struct raw_instance ofpraw_ofpt13_packet_in_instances[] = { - { {0, NULL}, {4, 10, 0, 0x0, 0}, OFPRAW_OFPT13_PACKET_IN, 0 }, -}; -static struct raw_instance ofpraw_nxt_packet_in_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 17}, OFPRAW_NXT_PACKET_IN, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 17}, OFPRAW_NXT_PACKET_IN, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 17}, OFPRAW_NXT_PACKET_IN, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 17}, OFPRAW_NXT_PACKET_IN, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 17}, OFPRAW_NXT_PACKET_IN, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 17}, OFPRAW_NXT_PACKET_IN, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_flow_removed_instances[] = { - { {0, NULL}, {1, 11, 0, 0x0, 0}, OFPRAW_OFPT10_FLOW_REMOVED, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_flow_removed_instances[] = { - { {0, NULL}, {2, 11, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_REMOVED, 0 }, - { {0, NULL}, {3, 11, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_REMOVED, 0 }, - { {0, NULL}, {4, 11, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_REMOVED, 0 }, - { {0, NULL}, {5, 11, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_REMOVED, 0 }, - { {0, NULL}, {6, 11, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_REMOVED, 0 }, -}; -static struct raw_instance ofpraw_nxt_flow_removed_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 14}, OFPRAW_NXT_FLOW_REMOVED, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 14}, OFPRAW_NXT_FLOW_REMOVED, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 14}, OFPRAW_NXT_FLOW_REMOVED, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 14}, OFPRAW_NXT_FLOW_REMOVED, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 14}, OFPRAW_NXT_FLOW_REMOVED, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 14}, OFPRAW_NXT_FLOW_REMOVED, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_port_status_instances[] = { - { {0, NULL}, {1, 12, 0, 0x0, 0}, OFPRAW_OFPT10_PORT_STATUS, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_port_status_instances[] = { - { {0, NULL}, {2, 12, 0, 0x0, 0}, OFPRAW_OFPT11_PORT_STATUS, 0 }, - { {0, NULL}, {3, 12, 0, 0x0, 0}, OFPRAW_OFPT11_PORT_STATUS, 0 }, - { {0, NULL}, {4, 12, 0, 0x0, 0}, OFPRAW_OFPT11_PORT_STATUS, 0 }, -}; -static struct raw_instance ofpraw_ofpt14_port_status_instances[] = { - { {0, NULL}, {5, 12, 0, 0x0, 0}, OFPRAW_OFPT14_PORT_STATUS, 0 }, - { {0, NULL}, {6, 12, 0, 0x0, 0}, OFPRAW_OFPT14_PORT_STATUS, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_packet_out_instances[] = { - { {0, NULL}, {1, 13, 0, 0x0, 0}, OFPRAW_OFPT10_PACKET_OUT, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_packet_out_instances[] = { - { {0, NULL}, {2, 13, 0, 0x0, 0}, OFPRAW_OFPT11_PACKET_OUT, 0 }, - { {0, NULL}, {3, 13, 0, 0x0, 0}, OFPRAW_OFPT11_PACKET_OUT, 0 }, - { {0, NULL}, {4, 13, 0, 0x0, 0}, OFPRAW_OFPT11_PACKET_OUT, 0 }, - { {0, NULL}, {5, 13, 0, 0x0, 0}, OFPRAW_OFPT11_PACKET_OUT, 0 }, - { {0, NULL}, {6, 13, 0, 0x0, 0}, OFPRAW_OFPT11_PACKET_OUT, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_flow_mod_instances[] = { - { {0, NULL}, {1, 14, 0, 0x0, 0}, OFPRAW_OFPT10_FLOW_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_flow_mod_instances[] = { - { {0, NULL}, {2, 14, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_MOD, 0 }, - { {0, NULL}, {3, 14, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_MOD, 0 }, - { {0, NULL}, {4, 14, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_MOD, 0 }, - { {0, NULL}, {5, 14, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_MOD, 0 }, - { {0, NULL}, {6, 14, 0, 0x0, 0}, OFPRAW_OFPT11_FLOW_MOD, 0 }, -}; -static struct raw_instance ofpraw_nxt_flow_mod_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 13}, OFPRAW_NXT_FLOW_MOD, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 13}, OFPRAW_NXT_FLOW_MOD, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 13}, OFPRAW_NXT_FLOW_MOD, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 13}, OFPRAW_NXT_FLOW_MOD, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 13}, OFPRAW_NXT_FLOW_MOD, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 13}, OFPRAW_NXT_FLOW_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_group_mod_instances[] = { - { {0, NULL}, {2, 15, 0, 0x0, 0}, OFPRAW_OFPT11_GROUP_MOD, 0 }, - { {0, NULL}, {3, 15, 0, 0x0, 0}, OFPRAW_OFPT11_GROUP_MOD, 0 }, - { {0, NULL}, {4, 15, 0, 0x0, 0}, OFPRAW_OFPT11_GROUP_MOD, 0 }, - { {0, NULL}, {5, 15, 0, 0x0, 0}, OFPRAW_OFPT11_GROUP_MOD, 0 }, - { {0, NULL}, {6, 15, 0, 0x0, 0}, OFPRAW_OFPT11_GROUP_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_port_mod_instances[] = { - { {0, NULL}, {1, 15, 0, 0x0, 0}, OFPRAW_OFPT10_PORT_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_port_mod_instances[] = { - { {0, NULL}, {2, 16, 0, 0x0, 0}, OFPRAW_OFPT11_PORT_MOD, 0 }, - { {0, NULL}, {3, 16, 0, 0x0, 0}, OFPRAW_OFPT11_PORT_MOD, 0 }, - { {0, NULL}, {4, 16, 0, 0x0, 0}, OFPRAW_OFPT11_PORT_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt14_port_mod_instances[] = { - { {0, NULL}, {5, 16, 0, 0x0, 0}, OFPRAW_OFPT14_PORT_MOD, 0 }, - { {0, NULL}, {6, 16, 0, 0x0, 0}, OFPRAW_OFPT14_PORT_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_table_mod_instances[] = { - { {0, NULL}, {2, 17, 0, 0x0, 0}, OFPRAW_OFPT11_TABLE_MOD, 0 }, - { {0, NULL}, {3, 17, 0, 0x0, 0}, OFPRAW_OFPT11_TABLE_MOD, 0 }, - { {0, NULL}, {4, 17, 0, 0x0, 0}, OFPRAW_OFPT11_TABLE_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt14_table_mod_instances[] = { - { {0, NULL}, {5, 17, 0, 0x0, 0}, OFPRAW_OFPT14_TABLE_MOD, 0 }, - { {0, NULL}, {6, 17, 0, 0x0, 0}, OFPRAW_OFPT14_TABLE_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_barrier_request_instances[] = { - { {0, NULL}, {1, 18, 0, 0x0, 0}, OFPRAW_OFPT10_BARRIER_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_barrier_request_instances[] = { - { {0, NULL}, {2, 20, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REQUEST, 0 }, - { {0, NULL}, {3, 20, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REQUEST, 0 }, - { {0, NULL}, {4, 20, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REQUEST, 0 }, - { {0, NULL}, {5, 20, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REQUEST, 0 }, - { {0, NULL}, {6, 20, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_barrier_reply_instances[] = { - { {0, NULL}, {1, 19, 0, 0x0, 0}, OFPRAW_OFPT10_BARRIER_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_barrier_reply_instances[] = { - { {0, NULL}, {2, 21, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REPLY, 0 }, - { {0, NULL}, {3, 21, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REPLY, 0 }, - { {0, NULL}, {4, 21, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REPLY, 0 }, - { {0, NULL}, {5, 21, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REPLY, 0 }, - { {0, NULL}, {6, 21, 0, 0x0, 0}, OFPRAW_OFPT11_BARRIER_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_queue_get_config_request_instances[] = { - { {0, NULL}, {1, 20, 0, 0x0, 0}, OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_queue_get_config_request_instances[] = { - { {0, NULL}, {2, 22, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {3, 22, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {4, 22, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {5, 22, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST, 0 }, - { {0, NULL}, {6, 22, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt10_queue_get_config_reply_instances[] = { - { {0, NULL}, {1, 21, 0, 0x0, 0}, OFPRAW_OFPT10_QUEUE_GET_CONFIG_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt11_queue_get_config_reply_instances[] = { - { {0, NULL}, {2, 23, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {3, 23, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {4, 23, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {5, 23, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY, 0 }, - { {0, NULL}, {6, 23, 0, 0x0, 0}, OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt12_role_request_instances[] = { - { {0, NULL}, {3, 24, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REQUEST, 0 }, - { {0, NULL}, {4, 24, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REQUEST, 0 }, - { {0, NULL}, {5, 24, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REQUEST, 0 }, - { {0, NULL}, {6, 24, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_nxt_role_request_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 10}, OFPRAW_NXT_ROLE_REQUEST, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 10}, OFPRAW_NXT_ROLE_REQUEST, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 10}, OFPRAW_NXT_ROLE_REQUEST, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 10}, OFPRAW_NXT_ROLE_REQUEST, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 10}, OFPRAW_NXT_ROLE_REQUEST, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 10}, OFPRAW_NXT_ROLE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt12_role_reply_instances[] = { - { {0, NULL}, {3, 25, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REPLY, 0 }, - { {0, NULL}, {4, 25, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REPLY, 0 }, - { {0, NULL}, {5, 25, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REPLY, 0 }, - { {0, NULL}, {6, 25, 0, 0x0, 0}, OFPRAW_OFPT12_ROLE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_nxt_role_reply_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 11}, OFPRAW_NXT_ROLE_REPLY, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 11}, OFPRAW_NXT_ROLE_REPLY, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 11}, OFPRAW_NXT_ROLE_REPLY, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 11}, OFPRAW_NXT_ROLE_REPLY, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 11}, OFPRAW_NXT_ROLE_REPLY, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 11}, OFPRAW_NXT_ROLE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt13_get_async_request_instances[] = { - { {0, NULL}, {4, 26, 0, 0x0, 0}, OFPRAW_OFPT13_GET_ASYNC_REQUEST, 0 }, - { {0, NULL}, {5, 26, 0, 0x0, 0}, OFPRAW_OFPT13_GET_ASYNC_REQUEST, 0 }, - { {0, NULL}, {6, 26, 0, 0x0, 0}, OFPRAW_OFPT13_GET_ASYNC_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpt13_get_async_reply_instances[] = { - { {0, NULL}, {4, 27, 0, 0x0, 0}, OFPRAW_OFPT13_GET_ASYNC_REPLY, 0 }, - { {0, NULL}, {5, 27, 0, 0x0, 0}, OFPRAW_OFPT13_GET_ASYNC_REPLY, 0 }, - { {0, NULL}, {6, 27, 0, 0x0, 0}, OFPRAW_OFPT13_GET_ASYNC_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpt13_set_async_instances[] = { - { {0, NULL}, {4, 28, 0, 0x0, 0}, OFPRAW_OFPT13_SET_ASYNC, 0 }, - { {0, NULL}, {5, 28, 0, 0x0, 0}, OFPRAW_OFPT13_SET_ASYNC, 0 }, - { {0, NULL}, {6, 28, 0, 0x0, 0}, OFPRAW_OFPT13_SET_ASYNC, 0 }, -}; -static struct raw_instance ofpraw_nxt_set_async_config_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 19}, OFPRAW_NXT_SET_ASYNC_CONFIG, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 19}, OFPRAW_NXT_SET_ASYNC_CONFIG, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 19}, OFPRAW_NXT_SET_ASYNC_CONFIG, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 19}, OFPRAW_NXT_SET_ASYNC_CONFIG, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 19}, OFPRAW_NXT_SET_ASYNC_CONFIG, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 19}, OFPRAW_NXT_SET_ASYNC_CONFIG, 0 }, -}; -static struct raw_instance ofpraw_ofpt13_meter_mod_instances[] = { - { {0, NULL}, {4, 29, 0, 0x0, 0}, OFPRAW_OFPT13_METER_MOD, 0 }, - { {0, NULL}, {5, 29, 0, 0x0, 0}, OFPRAW_OFPT13_METER_MOD, 0 }, - { {0, NULL}, {6, 29, 0, 0x0, 0}, OFPRAW_OFPT13_METER_MOD, 0 }, -}; -static struct raw_instance ofpraw_ofpt14_role_status_instances[] = { - { {0, NULL}, {5, 30, 0, 0x0, 0}, OFPRAW_OFPT14_ROLE_STATUS, 0 }, - { {0, NULL}, {6, 30, 0, 0x0, 0}, OFPRAW_OFPT14_ROLE_STATUS, 0 }, -}; -static struct raw_instance ofpraw_ofpt14_bundle_control_instances[] = { - { {0, NULL}, {5, 33, 0, 0x0, 0}, OFPRAW_OFPT14_BUNDLE_CONTROL, 0 }, - { {0, NULL}, {6, 33, 0, 0x0, 0}, OFPRAW_OFPT14_BUNDLE_CONTROL, 0 }, -}; -static struct raw_instance ofpraw_ofpt14_bundle_add_message_instances[] = { - { {0, NULL}, {5, 34, 0, 0x0, 0}, OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE, 0 }, - { {0, NULL}, {6, 34, 0, 0x0, 0}, OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE, 0 }, -}; -static struct raw_instance ofpraw_ofpst_desc_request_instances[] = { - { {0, NULL}, {1, 16, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REQUEST, 0 }, - { {0, NULL}, {2, 18, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REQUEST, 0 }, - { {0, NULL}, {3, 18, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REQUEST, 0 }, - { {0, NULL}, {4, 18, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REQUEST, 0 }, - { {0, NULL}, {5, 18, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REQUEST, 0 }, - { {0, NULL}, {6, 18, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst_desc_reply_instances[] = { - { {0, NULL}, {1, 17, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REPLY, 0 }, - { {0, NULL}, {2, 19, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REPLY, 0 }, - { {0, NULL}, {3, 19, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REPLY, 0 }, - { {0, NULL}, {4, 19, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REPLY, 0 }, - { {0, NULL}, {5, 19, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REPLY, 0 }, - { {0, NULL}, {6, 19, 0, 0x0, 0}, OFPRAW_OFPST_DESC_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_flow_request_instances[] = { - { {0, NULL}, {1, 16, 1, 0x0, 0}, OFPRAW_OFPST10_FLOW_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_flow_request_instances[] = { - { {0, NULL}, {2, 18, 1, 0x0, 0}, OFPRAW_OFPST11_FLOW_REQUEST, 0 }, - { {0, NULL}, {3, 18, 1, 0x0, 0}, OFPRAW_OFPST11_FLOW_REQUEST, 0 }, - { {0, NULL}, {4, 18, 1, 0x0, 0}, OFPRAW_OFPST11_FLOW_REQUEST, 0 }, - { {0, NULL}, {5, 18, 1, 0x0, 0}, OFPRAW_OFPST11_FLOW_REQUEST, 0 }, - { {0, NULL}, {6, 18, 1, 0x0, 0}, OFPRAW_OFPST11_FLOW_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_nxst_flow_request_instances[] = { - { {0, NULL}, {1, 16, 65535, 0x2320, 0}, OFPRAW_NXST_FLOW_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_flow_reply_instances[] = { - { {0, NULL}, {1, 17, 1, 0x0, 0}, OFPRAW_OFPST10_FLOW_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_flow_reply_instances[] = { - { {0, NULL}, {2, 19, 1, 0x0, 0}, OFPRAW_OFPST11_FLOW_REPLY, 0 }, - { {0, NULL}, {3, 19, 1, 0x0, 0}, OFPRAW_OFPST11_FLOW_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_flow_reply_instances[] = { - { {0, NULL}, {4, 19, 1, 0x0, 0}, OFPRAW_OFPST13_FLOW_REPLY, 0 }, - { {0, NULL}, {5, 19, 1, 0x0, 0}, OFPRAW_OFPST13_FLOW_REPLY, 0 }, - { {0, NULL}, {6, 19, 1, 0x0, 0}, OFPRAW_OFPST13_FLOW_REPLY, 0 }, -}; -static struct raw_instance ofpraw_nxst_flow_reply_instances[] = { - { {0, NULL}, {1, 17, 65535, 0x2320, 0}, OFPRAW_NXST_FLOW_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_aggregate_request_instances[] = { - { {0, NULL}, {1, 16, 2, 0x0, 0}, OFPRAW_OFPST10_AGGREGATE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_aggregate_request_instances[] = { - { {0, NULL}, {2, 18, 2, 0x0, 0}, OFPRAW_OFPST11_AGGREGATE_REQUEST, 0 }, - { {0, NULL}, {3, 18, 2, 0x0, 0}, OFPRAW_OFPST11_AGGREGATE_REQUEST, 0 }, - { {0, NULL}, {4, 18, 2, 0x0, 0}, OFPRAW_OFPST11_AGGREGATE_REQUEST, 0 }, - { {0, NULL}, {5, 18, 2, 0x0, 0}, OFPRAW_OFPST11_AGGREGATE_REQUEST, 0 }, - { {0, NULL}, {6, 18, 2, 0x0, 0}, OFPRAW_OFPST11_AGGREGATE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_nxst_aggregate_request_instances[] = { - { {0, NULL}, {1, 16, 65535, 0x2320, 1}, OFPRAW_NXST_AGGREGATE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst_aggregate_reply_instances[] = { - { {0, NULL}, {1, 17, 2, 0x0, 0}, OFPRAW_OFPST_AGGREGATE_REPLY, 0 }, - { {0, NULL}, {2, 19, 2, 0x0, 0}, OFPRAW_OFPST_AGGREGATE_REPLY, 0 }, - { {0, NULL}, {3, 19, 2, 0x0, 0}, OFPRAW_OFPST_AGGREGATE_REPLY, 0 }, - { {0, NULL}, {4, 19, 2, 0x0, 0}, OFPRAW_OFPST_AGGREGATE_REPLY, 0 }, - { {0, NULL}, {5, 19, 2, 0x0, 0}, OFPRAW_OFPST_AGGREGATE_REPLY, 0 }, - { {0, NULL}, {6, 19, 2, 0x0, 0}, OFPRAW_OFPST_AGGREGATE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_nxst_aggregate_reply_instances[] = { - { {0, NULL}, {1, 17, 65535, 0x2320, 1}, OFPRAW_NXST_AGGREGATE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst_table_request_instances[] = { - { {0, NULL}, {1, 16, 3, 0x0, 0}, OFPRAW_OFPST_TABLE_REQUEST, 0 }, - { {0, NULL}, {2, 18, 3, 0x0, 0}, OFPRAW_OFPST_TABLE_REQUEST, 0 }, - { {0, NULL}, {3, 18, 3, 0x0, 0}, OFPRAW_OFPST_TABLE_REQUEST, 0 }, - { {0, NULL}, {4, 18, 3, 0x0, 0}, OFPRAW_OFPST_TABLE_REQUEST, 0 }, - { {0, NULL}, {5, 18, 3, 0x0, 0}, OFPRAW_OFPST_TABLE_REQUEST, 0 }, - { {0, NULL}, {6, 18, 3, 0x0, 0}, OFPRAW_OFPST_TABLE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_table_reply_instances[] = { - { {0, NULL}, {1, 17, 3, 0x0, 0}, OFPRAW_OFPST10_TABLE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_table_reply_instances[] = { - { {0, NULL}, {2, 19, 3, 0x0, 0}, OFPRAW_OFPST11_TABLE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst12_table_reply_instances[] = { - { {0, NULL}, {3, 19, 3, 0x0, 0}, OFPRAW_OFPST12_TABLE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_table_reply_instances[] = { - { {0, NULL}, {4, 19, 3, 0x0, 0}, OFPRAW_OFPST13_TABLE_REPLY, 0 }, - { {0, NULL}, {5, 19, 3, 0x0, 0}, OFPRAW_OFPST13_TABLE_REPLY, 0 }, - { {0, NULL}, {6, 19, 3, 0x0, 0}, OFPRAW_OFPST13_TABLE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_port_request_instances[] = { - { {0, NULL}, {1, 16, 4, 0x0, 0}, OFPRAW_OFPST10_PORT_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_port_request_instances[] = { - { {0, NULL}, {2, 18, 4, 0x0, 0}, OFPRAW_OFPST11_PORT_REQUEST, 0 }, - { {0, NULL}, {3, 18, 4, 0x0, 0}, OFPRAW_OFPST11_PORT_REQUEST, 0 }, - { {0, NULL}, {4, 18, 4, 0x0, 0}, OFPRAW_OFPST11_PORT_REQUEST, 0 }, - { {0, NULL}, {5, 18, 4, 0x0, 0}, OFPRAW_OFPST11_PORT_REQUEST, 0 }, - { {0, NULL}, {6, 18, 4, 0x0, 0}, OFPRAW_OFPST11_PORT_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_port_reply_instances[] = { - { {0, NULL}, {1, 17, 4, 0x0, 0}, OFPRAW_OFPST10_PORT_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_port_reply_instances[] = { - { {0, NULL}, {2, 19, 4, 0x0, 0}, OFPRAW_OFPST11_PORT_REPLY, 0 }, - { {0, NULL}, {3, 19, 4, 0x0, 0}, OFPRAW_OFPST11_PORT_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_port_reply_instances[] = { - { {0, NULL}, {4, 19, 4, 0x0, 0}, OFPRAW_OFPST13_PORT_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst14_port_reply_instances[] = { - { {0, NULL}, {5, 19, 4, 0x0, 0}, OFPRAW_OFPST14_PORT_REPLY, 0 }, - { {0, NULL}, {6, 19, 4, 0x0, 0}, OFPRAW_OFPST14_PORT_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_queue_request_instances[] = { - { {0, NULL}, {1, 16, 5, 0x0, 0}, OFPRAW_OFPST10_QUEUE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_queue_request_instances[] = { - { {0, NULL}, {2, 18, 5, 0x0, 0}, OFPRAW_OFPST11_QUEUE_REQUEST, 0 }, - { {0, NULL}, {3, 18, 5, 0x0, 0}, OFPRAW_OFPST11_QUEUE_REQUEST, 0 }, - { {0, NULL}, {4, 18, 5, 0x0, 0}, OFPRAW_OFPST11_QUEUE_REQUEST, 0 }, - { {0, NULL}, {5, 18, 5, 0x0, 0}, OFPRAW_OFPST11_QUEUE_REQUEST, 0 }, - { {0, NULL}, {6, 18, 5, 0x0, 0}, OFPRAW_OFPST11_QUEUE_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_queue_reply_instances[] = { - { {0, NULL}, {1, 17, 5, 0x0, 0}, OFPRAW_OFPST10_QUEUE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_queue_reply_instances[] = { - { {0, NULL}, {2, 19, 5, 0x0, 0}, OFPRAW_OFPST11_QUEUE_REPLY, 0 }, - { {0, NULL}, {3, 19, 5, 0x0, 0}, OFPRAW_OFPST11_QUEUE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_queue_reply_instances[] = { - { {0, NULL}, {4, 19, 5, 0x0, 0}, OFPRAW_OFPST13_QUEUE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst14_queue_reply_instances[] = { - { {0, NULL}, {5, 19, 5, 0x0, 0}, OFPRAW_OFPST14_QUEUE_REPLY, 0 }, - { {0, NULL}, {6, 19, 5, 0x0, 0}, OFPRAW_OFPST14_QUEUE_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_group_request_instances[] = { - { {0, NULL}, {2, 18, 6, 0x0, 0}, OFPRAW_OFPST11_GROUP_REQUEST, 0 }, - { {0, NULL}, {3, 18, 6, 0x0, 0}, OFPRAW_OFPST11_GROUP_REQUEST, 0 }, - { {0, NULL}, {4, 18, 6, 0x0, 0}, OFPRAW_OFPST11_GROUP_REQUEST, 0 }, - { {0, NULL}, {5, 18, 6, 0x0, 0}, OFPRAW_OFPST11_GROUP_REQUEST, 0 }, - { {0, NULL}, {6, 18, 6, 0x0, 0}, OFPRAW_OFPST11_GROUP_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_group_reply_instances[] = { - { {0, NULL}, {2, 19, 6, 0x0, 0}, OFPRAW_OFPST11_GROUP_REPLY, 0 }, - { {0, NULL}, {3, 19, 6, 0x0, 0}, OFPRAW_OFPST11_GROUP_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_group_reply_instances[] = { - { {0, NULL}, {4, 19, 6, 0x0, 0}, OFPRAW_OFPST13_GROUP_REPLY, 0 }, - { {0, NULL}, {5, 19, 6, 0x0, 0}, OFPRAW_OFPST13_GROUP_REPLY, 0 }, - { {0, NULL}, {6, 19, 6, 0x0, 0}, OFPRAW_OFPST13_GROUP_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_group_desc_request_instances[] = { - { {0, NULL}, {2, 18, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REQUEST, 0 }, - { {0, NULL}, {3, 18, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REQUEST, 0 }, - { {0, NULL}, {4, 18, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REQUEST, 0 }, - { {0, NULL}, {5, 18, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst15_group_desc_request_instances[] = { - { {0, NULL}, {6, 18, 7, 0x0, 0}, OFPRAW_OFPST15_GROUP_DESC_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_group_desc_reply_instances[] = { - { {0, NULL}, {2, 19, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REPLY, 0 }, - { {0, NULL}, {3, 19, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REPLY, 0 }, - { {0, NULL}, {4, 19, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REPLY, 0 }, - { {0, NULL}, {5, 19, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REPLY, 0 }, - { {0, NULL}, {6, 19, 7, 0x0, 0}, OFPRAW_OFPST11_GROUP_DESC_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst12_group_features_request_instances[] = { - { {0, NULL}, {3, 18, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REQUEST, 0 }, - { {0, NULL}, {4, 18, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REQUEST, 0 }, - { {0, NULL}, {5, 18, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REQUEST, 0 }, - { {0, NULL}, {6, 18, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst12_group_features_reply_instances[] = { - { {0, NULL}, {3, 19, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REPLY, 0 }, - { {0, NULL}, {4, 19, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REPLY, 0 }, - { {0, NULL}, {5, 19, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REPLY, 0 }, - { {0, NULL}, {6, 19, 8, 0x0, 0}, OFPRAW_OFPST12_GROUP_FEATURES_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_meter_request_instances[] = { - { {0, NULL}, {4, 18, 9, 0x0, 0}, OFPRAW_OFPST13_METER_REQUEST, 0 }, - { {0, NULL}, {5, 18, 9, 0x0, 0}, OFPRAW_OFPST13_METER_REQUEST, 0 }, - { {0, NULL}, {6, 18, 9, 0x0, 0}, OFPRAW_OFPST13_METER_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_meter_reply_instances[] = { - { {0, NULL}, {4, 19, 9, 0x0, 0}, OFPRAW_OFPST13_METER_REPLY, 0 }, - { {0, NULL}, {5, 19, 9, 0x0, 0}, OFPRAW_OFPST13_METER_REPLY, 0 }, - { {0, NULL}, {6, 19, 9, 0x0, 0}, OFPRAW_OFPST13_METER_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_meter_config_request_instances[] = { - { {0, NULL}, {4, 18, 10, 0x0, 0}, OFPRAW_OFPST13_METER_CONFIG_REQUEST, 0 }, - { {0, NULL}, {5, 18, 10, 0x0, 0}, OFPRAW_OFPST13_METER_CONFIG_REQUEST, 0 }, - { {0, NULL}, {6, 18, 10, 0x0, 0}, OFPRAW_OFPST13_METER_CONFIG_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_meter_config_reply_instances[] = { - { {0, NULL}, {4, 19, 10, 0x0, 0}, OFPRAW_OFPST13_METER_CONFIG_REPLY, 0 }, - { {0, NULL}, {5, 19, 10, 0x0, 0}, OFPRAW_OFPST13_METER_CONFIG_REPLY, 0 }, - { {0, NULL}, {6, 19, 10, 0x0, 0}, OFPRAW_OFPST13_METER_CONFIG_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_meter_features_request_instances[] = { - { {0, NULL}, {4, 18, 11, 0x0, 0}, OFPRAW_OFPST13_METER_FEATURES_REQUEST, 0 }, - { {0, NULL}, {5, 18, 11, 0x0, 0}, OFPRAW_OFPST13_METER_FEATURES_REQUEST, 0 }, - { {0, NULL}, {6, 18, 11, 0x0, 0}, OFPRAW_OFPST13_METER_FEATURES_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_meter_features_reply_instances[] = { - { {0, NULL}, {4, 19, 11, 0x0, 0}, OFPRAW_OFPST13_METER_FEATURES_REPLY, 0 }, - { {0, NULL}, {5, 19, 11, 0x0, 0}, OFPRAW_OFPST13_METER_FEATURES_REPLY, 0 }, - { {0, NULL}, {6, 19, 11, 0x0, 0}, OFPRAW_OFPST13_METER_FEATURES_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_table_features_request_instances[] = { - { {0, NULL}, {4, 18, 12, 0x0, 0}, OFPRAW_OFPST13_TABLE_FEATURES_REQUEST, 0 }, - { {0, NULL}, {5, 18, 12, 0x0, 0}, OFPRAW_OFPST13_TABLE_FEATURES_REQUEST, 0 }, - { {0, NULL}, {6, 18, 12, 0x0, 0}, OFPRAW_OFPST13_TABLE_FEATURES_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst13_table_features_reply_instances[] = { - { {0, NULL}, {4, 19, 12, 0x0, 0}, OFPRAW_OFPST13_TABLE_FEATURES_REPLY, 0 }, - { {0, NULL}, {5, 19, 12, 0x0, 0}, OFPRAW_OFPST13_TABLE_FEATURES_REPLY, 0 }, - { {0, NULL}, {6, 19, 12, 0x0, 0}, OFPRAW_OFPST13_TABLE_FEATURES_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_port_desc_request_instances[] = { - { {0, NULL}, {1, 16, 13, 0x0, 0}, OFPRAW_OFPST10_PORT_DESC_REQUEST, 0 }, - { {0, NULL}, {2, 18, 13, 0x0, 0}, OFPRAW_OFPST10_PORT_DESC_REQUEST, 0 }, - { {0, NULL}, {3, 18, 13, 0x0, 0}, OFPRAW_OFPST10_PORT_DESC_REQUEST, 0 }, - { {0, NULL}, {4, 18, 13, 0x0, 0}, OFPRAW_OFPST10_PORT_DESC_REQUEST, 0 }, - { {0, NULL}, {5, 18, 13, 0x0, 0}, OFPRAW_OFPST10_PORT_DESC_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst15_port_desc_request_instances[] = { - { {0, NULL}, {6, 18, 13, 0x0, 0}, OFPRAW_OFPST15_PORT_DESC_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_ofpst10_port_desc_reply_instances[] = { - { {0, NULL}, {1, 17, 13, 0x0, 0}, OFPRAW_OFPST10_PORT_DESC_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst11_port_desc_reply_instances[] = { - { {0, NULL}, {2, 19, 13, 0x0, 0}, OFPRAW_OFPST11_PORT_DESC_REPLY, 0 }, - { {0, NULL}, {3, 19, 13, 0x0, 0}, OFPRAW_OFPST11_PORT_DESC_REPLY, 0 }, - { {0, NULL}, {4, 19, 13, 0x0, 0}, OFPRAW_OFPST11_PORT_DESC_REPLY, 0 }, -}; -static struct raw_instance ofpraw_ofpst14_port_desc_reply_instances[] = { - { {0, NULL}, {5, 19, 13, 0x0, 0}, OFPRAW_OFPST14_PORT_DESC_REPLY, 0 }, - { {0, NULL}, {6, 19, 13, 0x0, 0}, OFPRAW_OFPST14_PORT_DESC_REPLY, 0 }, -}; -static struct raw_instance ofpraw_nxt_set_flow_format_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 12}, OFPRAW_NXT_SET_FLOW_FORMAT, 0 }, -}; -static struct raw_instance ofpraw_nxt_flow_mod_table_id_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 15}, OFPRAW_NXT_FLOW_MOD_TABLE_ID, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 15}, OFPRAW_NXT_FLOW_MOD_TABLE_ID, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 15}, OFPRAW_NXT_FLOW_MOD_TABLE_ID, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 15}, OFPRAW_NXT_FLOW_MOD_TABLE_ID, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 15}, OFPRAW_NXT_FLOW_MOD_TABLE_ID, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 15}, OFPRAW_NXT_FLOW_MOD_TABLE_ID, 0 }, -}; -static struct raw_instance ofpraw_nxt_set_packet_in_format_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 16}, OFPRAW_NXT_SET_PACKET_IN_FORMAT, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 16}, OFPRAW_NXT_SET_PACKET_IN_FORMAT, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 16}, OFPRAW_NXT_SET_PACKET_IN_FORMAT, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 16}, OFPRAW_NXT_SET_PACKET_IN_FORMAT, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 16}, OFPRAW_NXT_SET_PACKET_IN_FORMAT, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 16}, OFPRAW_NXT_SET_PACKET_IN_FORMAT, 0 }, -}; -static struct raw_instance ofpraw_nxt_flow_age_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 18}, OFPRAW_NXT_FLOW_AGE, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 18}, OFPRAW_NXT_FLOW_AGE, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 18}, OFPRAW_NXT_FLOW_AGE, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 18}, OFPRAW_NXT_FLOW_AGE, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 18}, OFPRAW_NXT_FLOW_AGE, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 18}, OFPRAW_NXT_FLOW_AGE, 0 }, -}; -static struct raw_instance ofpraw_nxt_set_controller_id_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 20}, OFPRAW_NXT_SET_CONTROLLER_ID, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 20}, OFPRAW_NXT_SET_CONTROLLER_ID, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 20}, OFPRAW_NXT_SET_CONTROLLER_ID, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 20}, OFPRAW_NXT_SET_CONTROLLER_ID, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 20}, OFPRAW_NXT_SET_CONTROLLER_ID, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 20}, OFPRAW_NXT_SET_CONTROLLER_ID, 0 }, -}; -static struct raw_instance ofpraw_nxt_flow_monitor_cancel_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 21}, OFPRAW_NXT_FLOW_MONITOR_CANCEL, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 21}, OFPRAW_NXT_FLOW_MONITOR_CANCEL, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 21}, OFPRAW_NXT_FLOW_MONITOR_CANCEL, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 21}, OFPRAW_NXT_FLOW_MONITOR_CANCEL, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 21}, OFPRAW_NXT_FLOW_MONITOR_CANCEL, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 21}, OFPRAW_NXT_FLOW_MONITOR_CANCEL, 0 }, -}; -static struct raw_instance ofpraw_nxt_flow_monitor_paused_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 22}, OFPRAW_NXT_FLOW_MONITOR_PAUSED, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 22}, OFPRAW_NXT_FLOW_MONITOR_PAUSED, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 22}, OFPRAW_NXT_FLOW_MONITOR_PAUSED, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 22}, OFPRAW_NXT_FLOW_MONITOR_PAUSED, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 22}, OFPRAW_NXT_FLOW_MONITOR_PAUSED, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 22}, OFPRAW_NXT_FLOW_MONITOR_PAUSED, 0 }, -}; -static struct raw_instance ofpraw_nxt_flow_monitor_resumed_instances[] = { - { {0, NULL}, {1, 4, 0, 0x2320, 23}, OFPRAW_NXT_FLOW_MONITOR_RESUMED, 0 }, - { {0, NULL}, {2, 4, 0, 0x2320, 23}, OFPRAW_NXT_FLOW_MONITOR_RESUMED, 0 }, - { {0, NULL}, {3, 4, 0, 0x2320, 23}, OFPRAW_NXT_FLOW_MONITOR_RESUMED, 0 }, - { {0, NULL}, {4, 4, 0, 0x2320, 23}, OFPRAW_NXT_FLOW_MONITOR_RESUMED, 0 }, - { {0, NULL}, {5, 4, 0, 0x2320, 23}, OFPRAW_NXT_FLOW_MONITOR_RESUMED, 0 }, - { {0, NULL}, {6, 4, 0, 0x2320, 23}, OFPRAW_NXT_FLOW_MONITOR_RESUMED, 0 }, -}; -static struct raw_instance ofpraw_nxst_flow_monitor_request_instances[] = { - { {0, NULL}, {1, 16, 65535, 0x2320, 2}, OFPRAW_NXST_FLOW_MONITOR_REQUEST, 0 }, -}; -static struct raw_instance ofpraw_nxst_flow_monitor_reply_instances[] = { - { {0, NULL}, {1, 17, 65535, 0x2320, 2}, OFPRAW_NXST_FLOW_MONITOR_REPLY, 0 }, -}; - -static struct raw_info raw_infos[] = { - { - ofpraw_ofpt_hello_instances, - 1, 255, -#line 109 "./lib/ofp-msgs.h" - 0, -#line 109 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1608 "lib/ofp-msgs.inc" - OFPTYPE_HELLO, - "OFPT_HELLO", - }, - { - ofpraw_ofpt_error_instances, - 1, 255, -#line 112 "./lib/ofp-msgs.h" - sizeof(struct ofp_error_msg), -#line 112 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1619 "lib/ofp-msgs.inc" - OFPTYPE_ERROR, - "OFPT_ERROR", - }, - { - ofpraw_ofpt_echo_request_instances, - 1, 255, -#line 115 "./lib/ofp-msgs.h" - 0, -#line 115 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1630 "lib/ofp-msgs.inc" - OFPTYPE_ECHO_REQUEST, - "OFPT_ECHO_REQUEST", - }, - { - ofpraw_ofpt_echo_reply_instances, - 1, 255, -#line 118 "./lib/ofp-msgs.h" - 0, -#line 118 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1641 "lib/ofp-msgs.inc" - OFPTYPE_ECHO_REPLY, - "OFPT_ECHO_REPLY", - }, - { - ofpraw_ofpt_features_request_instances, - 1, 6, -#line 126 "./lib/ofp-msgs.h" - 0, -#line 126 "./lib/ofp-msgs.h" - 0, -#line 1652 "lib/ofp-msgs.inc" - OFPTYPE_FEATURES_REQUEST, - "OFPT_FEATURES_REQUEST", - }, - { - ofpraw_ofpt10_features_reply_instances, - 1, 1, -#line 129 "./lib/ofp-msgs.h" - sizeof(struct ofp_switch_features), -#line 129 "./lib/ofp-msgs.h" - sizeof(struct ofp10_phy_port), -#line 1663 "lib/ofp-msgs.inc" - OFPTYPE_FEATURES_REPLY, - "OFPT_FEATURES_REPLY", - }, - { - ofpraw_ofpt11_features_reply_instances, - 2, 3, -#line 131 "./lib/ofp-msgs.h" - sizeof(struct ofp_switch_features), -#line 131 "./lib/ofp-msgs.h" - sizeof(struct ofp11_port), -#line 1674 "lib/ofp-msgs.inc" - OFPTYPE_FEATURES_REPLY, - "OFPT_FEATURES_REPLY", - }, - { - ofpraw_ofpt13_features_reply_instances, - 4, 6, -#line 133 "./lib/ofp-msgs.h" - sizeof(struct ofp_switch_features), -#line 133 "./lib/ofp-msgs.h" - 0, -#line 1685 "lib/ofp-msgs.inc" - OFPTYPE_FEATURES_REPLY, - "OFPT_FEATURES_REPLY", - }, - { - ofpraw_ofpt_get_config_request_instances, - 1, 6, -#line 136 "./lib/ofp-msgs.h" - 0, -#line 136 "./lib/ofp-msgs.h" - 0, -#line 1696 "lib/ofp-msgs.inc" - OFPTYPE_GET_CONFIG_REQUEST, - "OFPT_GET_CONFIG_REQUEST", - }, - { - ofpraw_ofpt_get_config_reply_instances, - 1, 6, -#line 139 "./lib/ofp-msgs.h" - sizeof(struct ofp_switch_config), -#line 139 "./lib/ofp-msgs.h" - 0, -#line 1707 "lib/ofp-msgs.inc" - OFPTYPE_GET_CONFIG_REPLY, - "OFPT_GET_CONFIG_REPLY", - }, - { - ofpraw_ofpt_set_config_instances, - 1, 6, -#line 142 "./lib/ofp-msgs.h" - sizeof(struct ofp_switch_config), -#line 142 "./lib/ofp-msgs.h" - 0, -#line 1718 "lib/ofp-msgs.inc" - OFPTYPE_SET_CONFIG, - "OFPT_SET_CONFIG", - }, - { - ofpraw_ofpt10_packet_in_instances, - 1, 1, -#line 145 "./lib/ofp-msgs.h" - offsetof(struct ofp10_packet_in, data), -#line 145 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1729 "lib/ofp-msgs.inc" - OFPTYPE_PACKET_IN, - "OFPT_PACKET_IN", - }, - { - ofpraw_ofpt11_packet_in_instances, - 2, 2, -#line 147 "./lib/ofp-msgs.h" - sizeof(struct ofp11_packet_in), -#line 147 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1740 "lib/ofp-msgs.inc" - OFPTYPE_PACKET_IN, - "OFPT_PACKET_IN", - }, - { - ofpraw_ofpt12_packet_in_instances, - 3, 3, -#line 149 "./lib/ofp-msgs.h" - sizeof(struct ofp12_packet_in), -#line 149 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1751 "lib/ofp-msgs.inc" - OFPTYPE_PACKET_IN, - "OFPT_PACKET_IN", - }, - { - ofpraw_ofpt13_packet_in_instances, - 4, 4, -#line 151 "./lib/ofp-msgs.h" - sizeof(struct ofp13_packet_in), -#line 151 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1762 "lib/ofp-msgs.inc" - OFPTYPE_PACKET_IN, - "OFPT_PACKET_IN", - }, - { - ofpraw_nxt_packet_in_instances, - 1, 6, -#line 153 "./lib/ofp-msgs.h" - sizeof(struct nx_packet_in), -#line 153 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1773 "lib/ofp-msgs.inc" - OFPTYPE_PACKET_IN, - "NXT_PACKET_IN", - }, - { - ofpraw_ofpt10_flow_removed_instances, - 1, 1, -#line 156 "./lib/ofp-msgs.h" - sizeof(struct ofp10_flow_removed), -#line 156 "./lib/ofp-msgs.h" - 0, -#line 1784 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_REMOVED, - "OFPT_FLOW_REMOVED", - }, - { - ofpraw_ofpt11_flow_removed_instances, - 2, 6, -#line 158 "./lib/ofp-msgs.h" - sizeof(struct ofp11_flow_removed), -#line 158 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 1795 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_REMOVED, - "OFPT_FLOW_REMOVED", - }, - { - ofpraw_nxt_flow_removed_instances, - 1, 6, -#line 160 "./lib/ofp-msgs.h" - sizeof(struct nx_flow_removed), -#line 160 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 1806 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_REMOVED, - "NXT_FLOW_REMOVED", - }, - { - ofpraw_ofpt10_port_status_instances, - 1, 1, -#line 163 "./lib/ofp-msgs.h" - sizeof(struct ofp_port_status) + sizeof(struct ofp10_phy_port), -#line 163 "./lib/ofp-msgs.h" - 0, -#line 1817 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATUS, - "OFPT_PORT_STATUS", - }, - { - ofpraw_ofpt11_port_status_instances, - 2, 4, -#line 165 "./lib/ofp-msgs.h" - sizeof(struct ofp_port_status) + sizeof(struct ofp11_port), -#line 165 "./lib/ofp-msgs.h" - 0, -#line 1828 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATUS, - "OFPT_PORT_STATUS", - }, - { - ofpraw_ofpt14_port_status_instances, - 5, 6, -#line 167 "./lib/ofp-msgs.h" - sizeof(struct ofp_port_status) + sizeof(struct ofp14_port), -#line 167 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 1839 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATUS, - "OFPT_PORT_STATUS", - }, - { - ofpraw_ofpt10_packet_out_instances, - 1, 1, -#line 170 "./lib/ofp-msgs.h" - sizeof(struct ofp10_packet_out), -#line 170 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1850 "lib/ofp-msgs.inc" - OFPTYPE_PACKET_OUT, - "OFPT_PACKET_OUT", - }, - { - ofpraw_ofpt11_packet_out_instances, - 2, 6, -#line 172 "./lib/ofp-msgs.h" - sizeof(struct ofp11_packet_out), -#line 172 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 1861 "lib/ofp-msgs.inc" - OFPTYPE_PACKET_OUT, - "OFPT_PACKET_OUT", - }, - { - ofpraw_ofpt10_flow_mod_instances, - 1, 1, -#line 175 "./lib/ofp-msgs.h" - sizeof(struct ofp10_flow_mod), -#line 175 "./lib/ofp-msgs.h" - sizeof(struct ofp_action_header), -#line 1872 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MOD, - "OFPT_FLOW_MOD", - }, - { - ofpraw_ofpt11_flow_mod_instances, - 2, 6, -#line 177 "./lib/ofp-msgs.h" - sizeof(struct ofp11_flow_mod), -#line 177 "./lib/ofp-msgs.h" - sizeof(struct ofp11_instruction), -#line 1883 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MOD, - "OFPT_FLOW_MOD", - }, - { - ofpraw_nxt_flow_mod_instances, - 1, 6, -#line 179 "./lib/ofp-msgs.h" - sizeof(struct nx_flow_mod), -#line 179 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 1894 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MOD, - "NXT_FLOW_MOD", - }, - { - ofpraw_ofpt11_group_mod_instances, - 2, 6, -#line 182 "./lib/ofp-msgs.h" - sizeof(struct ofp11_group_mod), -#line 182 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 1905 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_MOD, - "OFPT_GROUP_MOD", - }, - { - ofpraw_ofpt10_port_mod_instances, - 1, 1, -#line 185 "./lib/ofp-msgs.h" - sizeof(struct ofp10_port_mod), -#line 185 "./lib/ofp-msgs.h" - 0, -#line 1916 "lib/ofp-msgs.inc" - OFPTYPE_PORT_MOD, - "OFPT_PORT_MOD", - }, - { - ofpraw_ofpt11_port_mod_instances, - 2, 4, -#line 187 "./lib/ofp-msgs.h" - sizeof(struct ofp11_port_mod), -#line 187 "./lib/ofp-msgs.h" - 0, -#line 1927 "lib/ofp-msgs.inc" - OFPTYPE_PORT_MOD, - "OFPT_PORT_MOD", - }, - { - ofpraw_ofpt14_port_mod_instances, - 5, 6, -#line 189 "./lib/ofp-msgs.h" - sizeof(struct ofp14_port_mod), -#line 189 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 1938 "lib/ofp-msgs.inc" - OFPTYPE_PORT_MOD, - "OFPT_PORT_MOD", - }, - { - ofpraw_ofpt11_table_mod_instances, - 2, 4, -#line 192 "./lib/ofp-msgs.h" - sizeof(struct ofp11_table_mod), -#line 192 "./lib/ofp-msgs.h" - 0, -#line 1949 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_MOD, - "OFPT_TABLE_MOD", - }, - { - ofpraw_ofpt14_table_mod_instances, - 5, 6, -#line 194 "./lib/ofp-msgs.h" - sizeof(struct ofp14_table_mod), -#line 194 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 1960 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_MOD, - "OFPT_TABLE_MOD", - }, - { - ofpraw_ofpt10_barrier_request_instances, - 1, 1, -#line 197 "./lib/ofp-msgs.h" - 0, -#line 197 "./lib/ofp-msgs.h" - 0, -#line 1971 "lib/ofp-msgs.inc" - OFPTYPE_BARRIER_REQUEST, - "OFPT_BARRIER_REQUEST", - }, - { - ofpraw_ofpt11_barrier_request_instances, - 2, 6, -#line 199 "./lib/ofp-msgs.h" - 0, -#line 199 "./lib/ofp-msgs.h" - 0, -#line 1982 "lib/ofp-msgs.inc" - OFPTYPE_BARRIER_REQUEST, - "OFPT_BARRIER_REQUEST", - }, - { - ofpraw_ofpt10_barrier_reply_instances, - 1, 1, -#line 202 "./lib/ofp-msgs.h" - 0, -#line 202 "./lib/ofp-msgs.h" - 0, -#line 1993 "lib/ofp-msgs.inc" - OFPTYPE_BARRIER_REPLY, - "OFPT_BARRIER_REPLY", - }, - { - ofpraw_ofpt11_barrier_reply_instances, - 2, 6, -#line 204 "./lib/ofp-msgs.h" - 0, -#line 204 "./lib/ofp-msgs.h" - 0, -#line 2004 "lib/ofp-msgs.inc" - OFPTYPE_BARRIER_REPLY, - "OFPT_BARRIER_REPLY", - }, - { - ofpraw_ofpt10_queue_get_config_request_instances, - 1, 1, -#line 207 "./lib/ofp-msgs.h" - sizeof(struct ofp10_queue_get_config_request), -#line 207 "./lib/ofp-msgs.h" - 0, -#line 2015 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_GET_CONFIG_REQUEST, - "OFPT_QUEUE_GET_CONFIG_REQUEST", - }, - { - ofpraw_ofpt11_queue_get_config_request_instances, - 2, 6, -#line 209 "./lib/ofp-msgs.h" - sizeof(struct ofp11_queue_get_config_request), -#line 209 "./lib/ofp-msgs.h" - 0, -#line 2026 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_GET_CONFIG_REQUEST, - "OFPT_QUEUE_GET_CONFIG_REQUEST", - }, - { - ofpraw_ofpt10_queue_get_config_reply_instances, - 1, 1, -#line 212 "./lib/ofp-msgs.h" - sizeof(struct ofp10_queue_get_config_reply), -#line 212 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2037 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_GET_CONFIG_REPLY, - "OFPT_QUEUE_GET_CONFIG_REPLY", - }, - { - ofpraw_ofpt11_queue_get_config_reply_instances, - 2, 6, -#line 214 "./lib/ofp-msgs.h" - sizeof(struct ofp11_queue_get_config_reply), -#line 214 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2048 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_GET_CONFIG_REPLY, - "OFPT_QUEUE_GET_CONFIG_REPLY", - }, - { - ofpraw_ofpt12_role_request_instances, - 3, 6, -#line 217 "./lib/ofp-msgs.h" - sizeof(struct ofp12_role_request), -#line 217 "./lib/ofp-msgs.h" - 0, -#line 2059 "lib/ofp-msgs.inc" - OFPTYPE_ROLE_REQUEST, - "OFPT_ROLE_REQUEST", - }, - { - ofpraw_nxt_role_request_instances, - 1, 6, -#line 219 "./lib/ofp-msgs.h" - sizeof(struct nx_role_request), -#line 219 "./lib/ofp-msgs.h" - 0, -#line 2070 "lib/ofp-msgs.inc" - OFPTYPE_ROLE_REQUEST, - "NXT_ROLE_REQUEST", - }, - { - ofpraw_ofpt12_role_reply_instances, - 3, 6, -#line 222 "./lib/ofp-msgs.h" - sizeof(struct ofp12_role_request), -#line 222 "./lib/ofp-msgs.h" - 0, -#line 2081 "lib/ofp-msgs.inc" - OFPTYPE_ROLE_REPLY, - "OFPT_ROLE_REPLY", - }, - { - ofpraw_nxt_role_reply_instances, - 1, 6, -#line 224 "./lib/ofp-msgs.h" - sizeof(struct nx_role_request), -#line 224 "./lib/ofp-msgs.h" - 0, -#line 2092 "lib/ofp-msgs.inc" - OFPTYPE_ROLE_REPLY, - "NXT_ROLE_REPLY", - }, - { - ofpraw_ofpt13_get_async_request_instances, - 4, 6, -#line 227 "./lib/ofp-msgs.h" - 0, -#line 227 "./lib/ofp-msgs.h" - 0, -#line 2103 "lib/ofp-msgs.inc" - OFPTYPE_GET_ASYNC_REQUEST, - "OFPT_GET_ASYNC_REQUEST", - }, - { - ofpraw_ofpt13_get_async_reply_instances, - 4, 6, -#line 229 "./lib/ofp-msgs.h" - sizeof(struct ofp13_async_config), -#line 229 "./lib/ofp-msgs.h" - 0, -#line 2114 "lib/ofp-msgs.inc" - OFPTYPE_GET_ASYNC_REPLY, - "OFPT_GET_ASYNC_REPLY", - }, - { - ofpraw_ofpt13_set_async_instances, - 4, 6, -#line 231 "./lib/ofp-msgs.h" - sizeof(struct ofp13_async_config), -#line 231 "./lib/ofp-msgs.h" - 0, -#line 2125 "lib/ofp-msgs.inc" - OFPTYPE_SET_ASYNC_CONFIG, - "OFPT_SET_ASYNC", - }, - { - ofpraw_nxt_set_async_config_instances, - 1, 6, -#line 233 "./lib/ofp-msgs.h" - sizeof(struct nx_async_config), -#line 233 "./lib/ofp-msgs.h" - 0, -#line 2136 "lib/ofp-msgs.inc" - OFPTYPE_SET_ASYNC_CONFIG, - "NXT_SET_ASYNC_CONFIG", - }, - { - ofpraw_ofpt13_meter_mod_instances, - 4, 6, -#line 236 "./lib/ofp-msgs.h" - sizeof(struct ofp13_meter_mod), -#line 236 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2147 "lib/ofp-msgs.inc" - OFPTYPE_METER_MOD, - "OFPT_METER_MOD", - }, - { - ofpraw_ofpt14_role_status_instances, - 5, 6, -#line 239 "./lib/ofp-msgs.h" - sizeof(struct ofp14_role_status), -#line 239 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2158 "lib/ofp-msgs.inc" - OFPTYPE_ROLE_STATUS, - "OFPT_ROLE_STATUS", - }, - { - ofpraw_ofpt14_bundle_control_instances, - 5, 6, -#line 242 "./lib/ofp-msgs.h" - sizeof(struct ofp14_bundle_ctrl_msg), -#line 242 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2169 "lib/ofp-msgs.inc" - OFPTYPE_BUNDLE_CONTROL, - "OFPT_BUNDLE_CONTROL", - }, - { - ofpraw_ofpt14_bundle_add_message_instances, - 5, 6, -#line 245 "./lib/ofp-msgs.h" - sizeof(struct ofp14_bundle_ctrl_msg), -#line 245 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 2180 "lib/ofp-msgs.inc" - OFPTYPE_BUNDLE_ADD_MESSAGE, - "OFPT_BUNDLE_ADD_MESSAGE", - }, - { - ofpraw_ofpst_desc_request_instances, - 1, 6, -#line 250 "./lib/ofp-msgs.h" - 0, -#line 250 "./lib/ofp-msgs.h" - 0, -#line 2191 "lib/ofp-msgs.inc" - OFPTYPE_DESC_STATS_REQUEST, - "OFPST_DESC request", - }, - { - ofpraw_ofpst_desc_reply_instances, - 1, 6, -#line 253 "./lib/ofp-msgs.h" - sizeof(struct ofp_desc_stats), -#line 253 "./lib/ofp-msgs.h" - 0, -#line 2202 "lib/ofp-msgs.inc" - OFPTYPE_DESC_STATS_REPLY, - "OFPST_DESC reply", - }, - { - ofpraw_ofpst10_flow_request_instances, - 1, 1, -#line 256 "./lib/ofp-msgs.h" - sizeof(struct ofp10_flow_stats_request), -#line 256 "./lib/ofp-msgs.h" - 0, -#line 2213 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_STATS_REQUEST, - "OFPST_FLOW request", - }, - { - ofpraw_ofpst11_flow_request_instances, - 2, 6, -#line 258 "./lib/ofp-msgs.h" - sizeof(struct ofp11_flow_stats_request), -#line 258 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2224 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_STATS_REQUEST, - "OFPST_FLOW request", - }, - { - ofpraw_nxst_flow_request_instances, - 1, 1, -#line 260 "./lib/ofp-msgs.h" - sizeof(struct nx_flow_stats_request), -#line 260 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2235 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_STATS_REQUEST, - "NXST_FLOW request", - }, - { - ofpraw_ofpst10_flow_reply_instances, - 1, 1, -#line 263 "./lib/ofp-msgs.h" - 0, -#line 263 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 2246 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_STATS_REPLY, - "OFPST_FLOW reply", - }, - { - ofpraw_ofpst11_flow_reply_instances, - 2, 3, -#line 265 "./lib/ofp-msgs.h" - 0, -#line 265 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 2257 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_STATS_REPLY, - "OFPST_FLOW reply", - }, - { - ofpraw_ofpst13_flow_reply_instances, - 4, 6, -#line 267 "./lib/ofp-msgs.h" - 0, -#line 267 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 2268 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_STATS_REPLY, - "OFPST_FLOW reply", - }, - { - ofpraw_nxst_flow_reply_instances, - 1, 1, -#line 269 "./lib/ofp-msgs.h" - 0, -#line 269 "./lib/ofp-msgs.h" - sizeof(uint8_t), -#line 2279 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_STATS_REPLY, - "NXST_FLOW reply", - }, - { - ofpraw_ofpst10_aggregate_request_instances, - 1, 1, -#line 272 "./lib/ofp-msgs.h" - sizeof(struct ofp10_flow_stats_request), -#line 272 "./lib/ofp-msgs.h" - 0, -#line 2290 "lib/ofp-msgs.inc" - OFPTYPE_AGGREGATE_STATS_REQUEST, - "OFPST_AGGREGATE request", - }, - { - ofpraw_ofpst11_aggregate_request_instances, - 2, 6, -#line 274 "./lib/ofp-msgs.h" - sizeof(struct ofp11_flow_stats_request), -#line 274 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2301 "lib/ofp-msgs.inc" - OFPTYPE_AGGREGATE_STATS_REQUEST, - "OFPST_AGGREGATE request", - }, - { - ofpraw_nxst_aggregate_request_instances, - 1, 1, -#line 276 "./lib/ofp-msgs.h" - sizeof(struct nx_flow_stats_request), -#line 276 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2312 "lib/ofp-msgs.inc" - OFPTYPE_AGGREGATE_STATS_REQUEST, - "NXST_AGGREGATE request", - }, - { - ofpraw_ofpst_aggregate_reply_instances, - 1, 6, -#line 279 "./lib/ofp-msgs.h" - sizeof(struct ofp_aggregate_stats_reply), -#line 279 "./lib/ofp-msgs.h" - 0, -#line 2323 "lib/ofp-msgs.inc" - OFPTYPE_AGGREGATE_STATS_REPLY, - "OFPST_AGGREGATE reply", - }, - { - ofpraw_nxst_aggregate_reply_instances, - 1, 1, -#line 281 "./lib/ofp-msgs.h" - sizeof(struct ofp_aggregate_stats_reply), -#line 281 "./lib/ofp-msgs.h" - 0, -#line 2334 "lib/ofp-msgs.inc" - OFPTYPE_AGGREGATE_STATS_REPLY, - "NXST_AGGREGATE reply", - }, - { - ofpraw_ofpst_table_request_instances, - 1, 6, -#line 284 "./lib/ofp-msgs.h" - 0, -#line 284 "./lib/ofp-msgs.h" - 0, -#line 2345 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_STATS_REQUEST, - "OFPST_TABLE request", - }, - { - ofpraw_ofpst10_table_reply_instances, - 1, 1, -#line 287 "./lib/ofp-msgs.h" - 0, -#line 287 "./lib/ofp-msgs.h" - sizeof(struct ofp10_table_stats), -#line 2356 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_STATS_REPLY, - "OFPST_TABLE reply", - }, - { - ofpraw_ofpst11_table_reply_instances, - 2, 2, -#line 289 "./lib/ofp-msgs.h" - 0, -#line 289 "./lib/ofp-msgs.h" - sizeof(struct ofp11_table_stats), -#line 2367 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_STATS_REPLY, - "OFPST_TABLE reply", - }, - { - ofpraw_ofpst12_table_reply_instances, - 3, 3, -#line 291 "./lib/ofp-msgs.h" - 0, -#line 291 "./lib/ofp-msgs.h" - sizeof(struct ofp12_table_stats), -#line 2378 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_STATS_REPLY, - "OFPST_TABLE reply", - }, - { - ofpraw_ofpst13_table_reply_instances, - 4, 6, -#line 293 "./lib/ofp-msgs.h" - 0, -#line 293 "./lib/ofp-msgs.h" - sizeof(struct ofp13_table_stats), -#line 2389 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_STATS_REPLY, - "OFPST_TABLE reply", - }, - { - ofpraw_ofpst10_port_request_instances, - 1, 1, -#line 296 "./lib/ofp-msgs.h" - sizeof(struct ofp10_port_stats_request), -#line 296 "./lib/ofp-msgs.h" - 0, -#line 2400 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATS_REQUEST, - "OFPST_PORT request", - }, - { - ofpraw_ofpst11_port_request_instances, - 2, 6, -#line 298 "./lib/ofp-msgs.h" - sizeof(struct ofp11_port_stats_request), -#line 298 "./lib/ofp-msgs.h" - 0, -#line 2411 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATS_REQUEST, - "OFPST_PORT request", - }, - { - ofpraw_ofpst10_port_reply_instances, - 1, 1, -#line 301 "./lib/ofp-msgs.h" - 0, -#line 301 "./lib/ofp-msgs.h" - sizeof(struct ofp10_port_stats), -#line 2422 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATS_REPLY, - "OFPST_PORT reply", - }, - { - ofpraw_ofpst11_port_reply_instances, - 2, 3, -#line 303 "./lib/ofp-msgs.h" - 0, -#line 303 "./lib/ofp-msgs.h" - sizeof(struct ofp11_port_stats), -#line 2433 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATS_REPLY, - "OFPST_PORT reply", - }, - { - ofpraw_ofpst13_port_reply_instances, - 4, 4, -#line 305 "./lib/ofp-msgs.h" - 0, -#line 305 "./lib/ofp-msgs.h" - sizeof(struct ofp13_port_stats), -#line 2444 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATS_REPLY, - "OFPST_PORT reply", - }, - { - ofpraw_ofpst14_port_reply_instances, - 5, 6, -#line 307 "./lib/ofp-msgs.h" - 0, -#line 307 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2455 "lib/ofp-msgs.inc" - OFPTYPE_PORT_STATS_REPLY, - "OFPST_PORT reply", - }, - { - ofpraw_ofpst10_queue_request_instances, - 1, 1, -#line 310 "./lib/ofp-msgs.h" - sizeof(struct ofp10_queue_stats_request), -#line 310 "./lib/ofp-msgs.h" - 0, -#line 2466 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_STATS_REQUEST, - "OFPST_QUEUE request", - }, - { - ofpraw_ofpst11_queue_request_instances, - 2, 6, -#line 312 "./lib/ofp-msgs.h" - sizeof(struct ofp11_queue_stats_request), -#line 312 "./lib/ofp-msgs.h" - 0, -#line 2477 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_STATS_REQUEST, - "OFPST_QUEUE request", - }, - { - ofpraw_ofpst10_queue_reply_instances, - 1, 1, -#line 315 "./lib/ofp-msgs.h" - 0, -#line 315 "./lib/ofp-msgs.h" - sizeof(struct ofp10_queue_stats), -#line 2488 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_STATS_REPLY, - "OFPST_QUEUE reply", - }, - { - ofpraw_ofpst11_queue_reply_instances, - 2, 3, -#line 317 "./lib/ofp-msgs.h" - 0, -#line 317 "./lib/ofp-msgs.h" - sizeof(struct ofp11_queue_stats), -#line 2499 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_STATS_REPLY, - "OFPST_QUEUE reply", - }, - { - ofpraw_ofpst13_queue_reply_instances, - 4, 4, -#line 319 "./lib/ofp-msgs.h" - 0, -#line 319 "./lib/ofp-msgs.h" - sizeof(struct ofp13_queue_stats), -#line 2510 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_STATS_REPLY, - "OFPST_QUEUE reply", - }, - { - ofpraw_ofpst14_queue_reply_instances, - 5, 6, -#line 321 "./lib/ofp-msgs.h" - 0, -#line 321 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2521 "lib/ofp-msgs.inc" - OFPTYPE_QUEUE_STATS_REPLY, - "OFPST_QUEUE reply", - }, - { - ofpraw_ofpst11_group_request_instances, - 2, 6, -#line 324 "./lib/ofp-msgs.h" - sizeof(struct ofp11_group_stats_request), -#line 324 "./lib/ofp-msgs.h" - 0, -#line 2532 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_STATS_REQUEST, - "OFPST_GROUP request", - }, - { - ofpraw_ofpst11_group_reply_instances, - 2, 3, -#line 327 "./lib/ofp-msgs.h" - 0, -#line 327 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2543 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_STATS_REPLY, - "OFPST_GROUP reply", - }, - { - ofpraw_ofpst13_group_reply_instances, - 4, 6, -#line 329 "./lib/ofp-msgs.h" - 0, -#line 329 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2554 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_STATS_REPLY, - "OFPST_GROUP reply", - }, - { - ofpraw_ofpst11_group_desc_request_instances, - 2, 5, -#line 332 "./lib/ofp-msgs.h" - 0, -#line 332 "./lib/ofp-msgs.h" - 0, -#line 2565 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_DESC_STATS_REQUEST, - "OFPST_GROUP_DESC request", - }, - { - ofpraw_ofpst15_group_desc_request_instances, - 6, 6, -#line 334 "./lib/ofp-msgs.h" - sizeof(ovs_be32), -#line 334 "./lib/ofp-msgs.h" - 0, -#line 2576 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_DESC_STATS_REQUEST, - "OFPST_GROUP_DESC request", - }, - { - ofpraw_ofpst11_group_desc_reply_instances, - 2, 6, -#line 337 "./lib/ofp-msgs.h" - 0, -#line 337 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2587 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_DESC_STATS_REPLY, - "OFPST_GROUP_DESC reply", - }, - { - ofpraw_ofpst12_group_features_request_instances, - 3, 6, -#line 340 "./lib/ofp-msgs.h" - 0, -#line 340 "./lib/ofp-msgs.h" - 0, -#line 2598 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_FEATURES_STATS_REQUEST, - "OFPST_GROUP_FEATURES request", - }, - { - ofpraw_ofpst12_group_features_reply_instances, - 3, 6, -#line 343 "./lib/ofp-msgs.h" - sizeof(struct ofp12_group_features_stats), -#line 343 "./lib/ofp-msgs.h" - 0, -#line 2609 "lib/ofp-msgs.inc" - OFPTYPE_GROUP_FEATURES_STATS_REPLY, - "OFPST_GROUP_FEATURES reply", - }, - { - ofpraw_ofpst13_meter_request_instances, - 4, 6, -#line 346 "./lib/ofp-msgs.h" - sizeof(struct ofp13_meter_multipart_request), -#line 346 "./lib/ofp-msgs.h" - 0, -#line 2620 "lib/ofp-msgs.inc" - OFPTYPE_METER_STATS_REQUEST, - "OFPST_METER request", - }, - { - ofpraw_ofpst13_meter_reply_instances, - 4, 6, -#line 349 "./lib/ofp-msgs.h" - 0, -#line 349 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2631 "lib/ofp-msgs.inc" - OFPTYPE_METER_STATS_REPLY, - "OFPST_METER reply", - }, - { - ofpraw_ofpst13_meter_config_request_instances, - 4, 6, -#line 352 "./lib/ofp-msgs.h" - sizeof(struct ofp13_meter_multipart_request), -#line 352 "./lib/ofp-msgs.h" - 0, -#line 2642 "lib/ofp-msgs.inc" - OFPTYPE_METER_CONFIG_STATS_REQUEST, - "OFPST_METER_CONFIG request", - }, - { - ofpraw_ofpst13_meter_config_reply_instances, - 4, 6, -#line 355 "./lib/ofp-msgs.h" - 0, -#line 355 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2653 "lib/ofp-msgs.inc" - OFPTYPE_METER_CONFIG_STATS_REPLY, - "OFPST_METER_CONFIG reply", - }, - { - ofpraw_ofpst13_meter_features_request_instances, - 4, 6, -#line 358 "./lib/ofp-msgs.h" - 0, -#line 358 "./lib/ofp-msgs.h" - 0, -#line 2664 "lib/ofp-msgs.inc" - OFPTYPE_METER_FEATURES_STATS_REQUEST, - "OFPST_METER_FEATURES request", - }, - { - ofpraw_ofpst13_meter_features_reply_instances, - 4, 6, -#line 361 "./lib/ofp-msgs.h" - sizeof(struct ofp13_meter_features), -#line 361 "./lib/ofp-msgs.h" - 0, -#line 2675 "lib/ofp-msgs.inc" - OFPTYPE_METER_FEATURES_STATS_REPLY, - "OFPST_METER_FEATURES reply", - }, - { - ofpraw_ofpst13_table_features_request_instances, - 4, 6, -#line 364 "./lib/ofp-msgs.h" - 0, -#line 364 "./lib/ofp-msgs.h" - 0, -#line 2686 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_FEATURES_STATS_REQUEST, - "OFPST_TABLE_FEATURES request", - }, - { - ofpraw_ofpst13_table_features_reply_instances, - 4, 6, -#line 367 "./lib/ofp-msgs.h" - sizeof(struct ofp13_table_features), -#line 367 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2697 "lib/ofp-msgs.inc" - OFPTYPE_TABLE_FEATURES_STATS_REPLY, - "OFPST_TABLE_FEATURES reply", - }, - { - ofpraw_ofpst10_port_desc_request_instances, - 1, 5, -#line 370 "./lib/ofp-msgs.h" - 0, -#line 370 "./lib/ofp-msgs.h" - 0, -#line 2708 "lib/ofp-msgs.inc" - OFPTYPE_PORT_DESC_STATS_REQUEST, - "OFPST_PORT_DESC request", - }, - { - ofpraw_ofpst15_port_desc_request_instances, - 6, 6, -#line 372 "./lib/ofp-msgs.h" - sizeof(ovs_be32), -#line 372 "./lib/ofp-msgs.h" - 0, -#line 2719 "lib/ofp-msgs.inc" - OFPTYPE_PORT_DESC_STATS_REQUEST, - "OFPST_PORT_DESC request", - }, - { - ofpraw_ofpst10_port_desc_reply_instances, - 1, 1, -#line 375 "./lib/ofp-msgs.h" - 0, -#line 375 "./lib/ofp-msgs.h" - sizeof(struct ofp10_phy_port), -#line 2730 "lib/ofp-msgs.inc" - OFPTYPE_PORT_DESC_STATS_REPLY, - "OFPST_PORT_DESC reply", - }, - { - ofpraw_ofpst11_port_desc_reply_instances, - 2, 4, -#line 377 "./lib/ofp-msgs.h" - 0, -#line 377 "./lib/ofp-msgs.h" - sizeof(struct ofp11_port), -#line 2741 "lib/ofp-msgs.inc" - OFPTYPE_PORT_DESC_STATS_REPLY, - "OFPST_PORT_DESC reply", - }, - { - ofpraw_ofpst14_port_desc_reply_instances, - 5, 6, -#line 379 "./lib/ofp-msgs.h" - 0, -#line 379 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2752 "lib/ofp-msgs.inc" - OFPTYPE_PORT_DESC_STATS_REPLY, - "OFPST_PORT_DESC reply", - }, - { - ofpraw_nxt_set_flow_format_instances, - 1, 1, -#line 387 "./lib/ofp-msgs.h" - sizeof(struct nx_set_flow_format), -#line 387 "./lib/ofp-msgs.h" - 0, -#line 2763 "lib/ofp-msgs.inc" - OFPTYPE_SET_FLOW_FORMAT, - "NXT_SET_FLOW_FORMAT", - }, - { - ofpraw_nxt_flow_mod_table_id_instances, - 1, 6, -#line 390 "./lib/ofp-msgs.h" - sizeof(struct nx_flow_mod_table_id), -#line 390 "./lib/ofp-msgs.h" - 0, -#line 2774 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MOD_TABLE_ID, - "NXT_FLOW_MOD_TABLE_ID", - }, - { - ofpraw_nxt_set_packet_in_format_instances, - 1, 6, -#line 393 "./lib/ofp-msgs.h" - sizeof(struct nx_set_packet_in_format), -#line 393 "./lib/ofp-msgs.h" - 0, -#line 2785 "lib/ofp-msgs.inc" - OFPTYPE_SET_PACKET_IN_FORMAT, - "NXT_SET_PACKET_IN_FORMAT", - }, - { - ofpraw_nxt_flow_age_instances, - 1, 6, -#line 396 "./lib/ofp-msgs.h" - 0, -#line 396 "./lib/ofp-msgs.h" - 0, -#line 2796 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_AGE, - "NXT_FLOW_AGE", - }, - { - ofpraw_nxt_set_controller_id_instances, - 1, 6, -#line 399 "./lib/ofp-msgs.h" - sizeof(struct nx_controller_id), -#line 399 "./lib/ofp-msgs.h" - 0, -#line 2807 "lib/ofp-msgs.inc" - OFPTYPE_SET_CONTROLLER_ID, - "NXT_SET_CONTROLLER_ID", - }, - { - ofpraw_nxt_flow_monitor_cancel_instances, - 1, 6, -#line 402 "./lib/ofp-msgs.h" - sizeof(struct nx_flow_monitor_cancel), -#line 402 "./lib/ofp-msgs.h" - 0, -#line 2818 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MONITOR_CANCEL, - "NXT_FLOW_MONITOR_CANCEL", - }, - { - ofpraw_nxt_flow_monitor_paused_instances, - 1, 6, -#line 405 "./lib/ofp-msgs.h" - 0, -#line 405 "./lib/ofp-msgs.h" - 0, -#line 2829 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MONITOR_PAUSED, - "NXT_FLOW_MONITOR_PAUSED", - }, - { - ofpraw_nxt_flow_monitor_resumed_instances, - 1, 6, -#line 408 "./lib/ofp-msgs.h" - 0, -#line 408 "./lib/ofp-msgs.h" - 0, -#line 2840 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MONITOR_RESUMED, - "NXT_FLOW_MONITOR_RESUMED", - }, - { - ofpraw_nxst_flow_monitor_request_instances, - 1, 1, -#line 416 "./lib/ofp-msgs.h" - 0, -#line 416 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2851 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MONITOR_STATS_REQUEST, - "NXST_FLOW_MONITOR request", - }, - { - ofpraw_nxst_flow_monitor_reply_instances, - 1, 1, -#line 419 "./lib/ofp-msgs.h" - 0, -#line 419 "./lib/ofp-msgs.h" - sizeof(uint8_t[8]), -#line 2862 "lib/ofp-msgs.inc" - OFPTYPE_FLOW_MONITOR_STATS_REPLY, - "NXST_FLOW_MONITOR reply", - }, -}; diff -Nru openvswitch-2.3.1/lib/ofp-parse.c openvswitch-2.4.0~git20150623/lib/ofp-parse.c --- openvswitch-2.3.1/lib/ofp-parse.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-parse.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ #include #include -#include "bundle.h" #include "byte-order.h" #include "dynamic-string.h" #include "learn.h" @@ -38,7 +37,7 @@ #include "packets.h" #include "simap.h" #include "socket-util.h" -#include "vconn.h" +#include "openvswitch/vconn.h" /* Parses 'str' as an 8-bit unsigned integer into '*valuep'. * @@ -46,7 +45,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT str_to_u8(const char *str, const char *name, uint8_t *valuep) { int value; @@ -64,7 +63,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT str_to_u16(const char *str, const char *name, uint16_t *valuep) { int value; @@ -80,7 +79,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT str_to_u32(const char *str, uint32_t *valuep) { char *tail; @@ -103,7 +102,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT str_to_u64(const char *str, uint64_t *valuep) { char *tail; @@ -127,7 +126,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT str_to_be64(const char *str, ovs_be64 *valuep) { uint64_t value = 0; @@ -144,8 +143,8 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -str_to_mac(const char *str, uint8_t mac[6]) +char * OVS_WARN_UNUSED_RESULT +str_to_mac(const char *str, uint8_t mac[ETH_ADDR_LEN]) { if (!ovs_scan(str, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(mac))) { return xasprintf("invalid mac address %s", str); @@ -157,7 +156,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT str_to_ip(const char *str, ovs_be32 *ip) { struct in_addr in_addr; @@ -169,1003 +168,6 @@ return NULL; } -/* Parses 'arg' as the argument to an "enqueue" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_enqueue(char *arg, struct ofpbuf *ofpacts) -{ - char *sp = NULL; - char *port = strtok_r(arg, ":q,", &sp); - char *queue = strtok_r(NULL, "", &sp); - struct ofpact_enqueue *enqueue; - - if (port == NULL || queue == NULL) { - return xstrdup("\"enqueue\" syntax is \"enqueue:PORT:QUEUE\" or " - "\"enqueue(PORT,QUEUE)\""); - } - - enqueue = ofpact_put_ENQUEUE(ofpacts); - if (!ofputil_port_from_string(port, &enqueue->port)) { - return xasprintf("%s: enqueue to unknown port", port); - } - return str_to_u32(queue, &enqueue->queue); -} - -/* Parses 'arg' as the argument to an "output" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_output(const char *arg, struct ofpbuf *ofpacts) -{ - if (strchr(arg, '[')) { - struct ofpact_output_reg *output_reg; - - output_reg = ofpact_put_OUTPUT_REG(ofpacts); - output_reg->max_len = UINT16_MAX; - return mf_parse_subfield(&output_reg->src, arg); - } else { - struct ofpact_output *output; - - output = ofpact_put_OUTPUT(ofpacts); - if (!ofputil_port_from_string(arg, &output->port)) { - return xasprintf("%s: output to unknown port", arg); - } - output->max_len = output->port == OFPP_CONTROLLER ? UINT16_MAX : 0; - return NULL; - } -} - -/* Parses 'arg' as the argument to an "resubmit" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_resubmit(char *arg, struct ofpbuf *ofpacts) -{ - struct ofpact_resubmit *resubmit; - char *in_port_s, *table_s; - - resubmit = ofpact_put_RESUBMIT(ofpacts); - - in_port_s = strsep(&arg, ","); - if (in_port_s && in_port_s[0]) { - if (!ofputil_port_from_string(in_port_s, &resubmit->in_port)) { - return xasprintf("%s: resubmit to unknown port", in_port_s); - } - } else { - resubmit->in_port = OFPP_IN_PORT; - } - - table_s = strsep(&arg, ","); - if (table_s && table_s[0]) { - uint32_t table_id = 0; - char *error; - - error = str_to_u32(table_s, &table_id); - if (error) { - return error; - } - resubmit->table_id = table_id; - } else { - resubmit->table_id = 255; - } - - if (resubmit->in_port == OFPP_IN_PORT && resubmit->table_id == 255) { - return xstrdup("at least one \"in_port\" or \"table\" must be " - "specified on resubmit"); - } - return NULL; -} - -/* Parses 'arg' as the argument to a "note" action, and appends such an action - * to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_note(const char *arg, struct ofpbuf *ofpacts) -{ - struct ofpact_note *note; - - note = ofpact_put_NOTE(ofpacts); - while (*arg != '\0') { - uint8_t byte; - bool ok; - - if (*arg == '.') { - arg++; - } - if (*arg == '\0') { - break; - } - - byte = hexits_value(arg, 2, &ok); - if (!ok) { - return xstrdup("bad hex digit in `note' argument"); - } - ofpbuf_put(ofpacts, &byte, 1); - - note = ofpacts->frame; - note->length++; - - arg += 2; - } - ofpact_update_len(ofpacts, ¬e->ofpact); - return NULL; -} - -/* Parses 'arg' as the argument to a "fin_timeout" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_fin_timeout(struct ofpbuf *b, char *arg) -{ - struct ofpact_fin_timeout *oft = ofpact_put_FIN_TIMEOUT(b); - char *key, *value; - - while (ofputil_parse_key_value(&arg, &key, &value)) { - char *error; - - if (!strcmp(key, "idle_timeout")) { - error = str_to_u16(value, key, &oft->fin_idle_timeout); - } else if (!strcmp(key, "hard_timeout")) { - error = str_to_u16(value, key, &oft->fin_hard_timeout); - } else { - error = xasprintf("invalid key '%s' in 'fin_timeout' argument", - key); - } - - if (error) { - return error; - } - } - return NULL; -} - -/* Parses 'arg' as the argument to a "controller" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_controller(struct ofpbuf *b, char *arg) -{ - enum ofp_packet_in_reason reason = OFPR_ACTION; - uint16_t controller_id = 0; - uint16_t max_len = UINT16_MAX; - - if (!arg[0]) { - /* Use defaults. */ - } else if (strspn(arg, "0123456789") == strlen(arg)) { - char *error = str_to_u16(arg, "max_len", &max_len); - if (error) { - return error; - } - } else { - char *name, *value; - - while (ofputil_parse_key_value(&arg, &name, &value)) { - if (!strcmp(name, "reason")) { - if (!ofputil_packet_in_reason_from_string(value, &reason)) { - return xasprintf("unknown reason \"%s\"", value); - } - } else if (!strcmp(name, "max_len")) { - char *error = str_to_u16(value, "max_len", &max_len); - if (error) { - return error; - } - } else if (!strcmp(name, "id")) { - char *error = str_to_u16(value, "id", &controller_id); - if (error) { - return error; - } - } else { - return xasprintf("unknown key \"%s\" parsing controller " - "action", name); - } - } - } - - if (reason == OFPR_ACTION && controller_id == 0) { - struct ofpact_output *output; - - output = ofpact_put_OUTPUT(b); - output->port = OFPP_CONTROLLER; - output->max_len = max_len; - } else { - struct ofpact_controller *controller; - - controller = ofpact_put_CONTROLLER(b); - controller->max_len = max_len; - controller->reason = reason; - controller->controller_id = controller_id; - } - - return NULL; -} - -static void -parse_noargs_dec_ttl(struct ofpbuf *b) -{ - struct ofpact_cnt_ids *ids; - uint16_t id = 0; - - ids = ofpact_put_DEC_TTL(b); - ofpbuf_put(b, &id, sizeof id); - ids = b->frame; - ids->n_controllers++; - ofpact_update_len(b, &ids->ofpact); -} - -/* Parses 'arg' as the argument to a "dec_ttl" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_dec_ttl(struct ofpbuf *b, char *arg) -{ - if (*arg == '\0') { - parse_noargs_dec_ttl(b); - } else { - struct ofpact_cnt_ids *ids; - char *cntr; - - ids = ofpact_put_DEC_TTL(b); - ids->ofpact.compat = OFPUTIL_NXAST_DEC_TTL_CNT_IDS; - for (cntr = strtok_r(arg, ", ", &arg); cntr != NULL; - cntr = strtok_r(NULL, ", ", &arg)) { - uint16_t id = atoi(cntr); - - ofpbuf_put(b, &id, sizeof id); - ids = b->frame; - ids->n_controllers++; - } - if (!ids->n_controllers) { - return xstrdup("dec_ttl_cnt_ids: expected at least one controller " - "id."); - } - ofpact_update_len(b, &ids->ofpact); - } - return NULL; -} - -/* Parses 'arg' as the argument to a "set_mpls_label" action, and appends such - * an action to 'b'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_set_mpls_label(struct ofpbuf *b, const char *arg) -{ - struct ofpact_mpls_label *mpls_label = ofpact_put_SET_MPLS_LABEL(b); - - if (*arg == '\0') { - return xstrdup("parse_set_mpls_label: expected label."); - } - - mpls_label->label = htonl(atoi(arg)); - return NULL; -} - -/* Parses 'arg' as the argument to a "set_mpls_tc" action, and appends such an - * action to 'b'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_set_mpls_tc(struct ofpbuf *b, const char *arg) -{ - struct ofpact_mpls_tc *mpls_tc = ofpact_put_SET_MPLS_TC(b); - - if (*arg == '\0') { - return xstrdup("parse_set_mpls_tc: expected tc."); - } - - mpls_tc->tc = atoi(arg); - return NULL; -} - -/* Parses 'arg' as the argument to a "set_mpls_ttl" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_set_mpls_ttl(struct ofpbuf *b, const char *arg) -{ - struct ofpact_mpls_ttl *mpls_ttl = ofpact_put_SET_MPLS_TTL(b); - - if (*arg == '\0') { - return xstrdup("parse_set_mpls_ttl: expected ttl."); - } - - mpls_ttl->ttl = atoi(arg); - return NULL; -} - -/* Parses a "set_field" action with argument 'arg', appending the parsed - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -set_field_parse__(char *arg, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - struct ofpact_set_field *sf = ofpact_put_SET_FIELD(ofpacts); - char *value; - char *delim; - char *key; - const struct mf_field *mf; - char *error; - - value = arg; - delim = strstr(arg, "->"); - if (!delim) { - return xasprintf("%s: missing `->'", arg); - } - if (strlen(delim) <= strlen("->")) { - return xasprintf("%s: missing field name following `->'", arg); - } - - key = delim + strlen("->"); - mf = mf_from_name(key); - if (!mf) { - return xasprintf("%s is not a valid OXM field name", key); - } - if (!mf->writable) { - return xasprintf("%s is read-only", key); - } - sf->field = mf; - delim[0] = '\0'; - error = mf_parse_value(mf, value, &sf->value); - if (error) { - return error; - } - - if (!mf_is_value_valid(mf, &sf->value)) { - return xasprintf("%s is not a valid value for field %s", value, key); - } - - *usable_protocols &= mf->usable_protocols; - return NULL; -} - -/* Parses 'arg' as the argument to a "set_field" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -set_field_parse(const char *arg, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - char *copy = xstrdup(arg); - char *error = set_field_parse__(copy, ofpacts, usable_protocols); - free(copy); - return error; -} - -/* Parses 'arg' as the argument to a "write_metadata" instruction, and appends - * such an action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_metadata(struct ofpbuf *b, char *arg) -{ - struct ofpact_metadata *om; - char *mask = strchr(arg, '/'); - - om = ofpact_put_WRITE_METADATA(b); - - if (mask) { - char *error; - - *mask = '\0'; - error = str_to_be64(mask + 1, &om->mask); - if (error) { - return error; - } - } else { - om->mask = OVS_BE64_MAX; - } - - return str_to_be64(arg, &om->metadata); -} - -/* Parses 'arg' as the argument to a "sample" action, and appends such an - * action to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_sample(struct ofpbuf *b, char *arg) -{ - struct ofpact_sample *os = ofpact_put_SAMPLE(b); - char *key, *value; - - while (ofputil_parse_key_value(&arg, &key, &value)) { - char *error = NULL; - - if (!strcmp(key, "probability")) { - error = str_to_u16(value, "probability", &os->probability); - if (!error && os->probability == 0) { - error = xasprintf("invalid probability value \"%s\"", value); - } - } else if (!strcmp(key, "collector_set_id")) { - error = str_to_u32(value, &os->collector_set_id); - } else if (!strcmp(key, "obs_domain_id")) { - error = str_to_u32(value, &os->obs_domain_id); - } else if (!strcmp(key, "obs_point_id")) { - error = str_to_u32(value, &os->obs_point_id); - } else { - error = xasprintf("invalid key \"%s\" in \"sample\" argument", - key); - } - if (error) { - return error; - } - } - if (os->probability == 0) { - return xstrdup("non-zero \"probability\" must be specified on sample"); - } - return NULL; -} - -/* Parses 'arg' as the argument to action 'code', and appends such an action to - * 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_named_action(enum ofputil_action_code code, - char *arg, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - size_t orig_size = ofpbuf_size(ofpacts); - struct ofpact_tunnel *tunnel; - struct ofpact_vlan_vid *vlan_vid; - struct ofpact_vlan_pcp *vlan_pcp; - char *error = NULL; - uint16_t ethertype = 0; - uint16_t vid = 0; - uint8_t tos = 0; - uint8_t ecn = 0; - uint8_t ttl = 0; - uint8_t pcp = 0; - - switch (code) { - case OFPUTIL_ACTION_INVALID: - OVS_NOT_REACHED(); - - case OFPUTIL_OFPAT10_OUTPUT: - case OFPUTIL_OFPAT11_OUTPUT: - case OFPUTIL_OFPAT13_OUTPUT: - error = parse_output(arg, ofpacts); - break; - - case OFPUTIL_OFPAT10_SET_VLAN_VID: - case OFPUTIL_OFPAT11_SET_VLAN_VID: - error = str_to_u16(arg, "VLAN VID", &vid); - if (error) { - return error; - } - - if (vid & ~VLAN_VID_MASK) { - return xasprintf("%s: not a valid VLAN VID", arg); - } - vlan_vid = ofpact_put_SET_VLAN_VID(ofpacts); - vlan_vid->vlan_vid = vid; - vlan_vid->ofpact.compat = code; - vlan_vid->push_vlan_if_needed = code == OFPUTIL_OFPAT10_SET_VLAN_VID; - break; - - case OFPUTIL_OFPAT10_SET_VLAN_PCP: - case OFPUTIL_OFPAT11_SET_VLAN_PCP: - error = str_to_u8(arg, "VLAN PCP", &pcp); - if (error) { - return error; - } - - if (pcp & ~7) { - return xasprintf("%s: not a valid VLAN PCP", arg); - } - vlan_pcp = ofpact_put_SET_VLAN_PCP(ofpacts); - vlan_pcp->vlan_pcp = pcp; - vlan_pcp->ofpact.compat = code; - vlan_pcp->push_vlan_if_needed = code == OFPUTIL_OFPAT10_SET_VLAN_PCP; - break; - - case OFPUTIL_OFPAT12_SET_FIELD: - case OFPUTIL_OFPAT13_SET_FIELD: - return set_field_parse(arg, ofpacts, usable_protocols); - - case OFPUTIL_OFPAT10_STRIP_VLAN: - case OFPUTIL_OFPAT11_POP_VLAN: - case OFPUTIL_OFPAT13_POP_VLAN: - ofpact_put_STRIP_VLAN(ofpacts)->ofpact.compat = code; - break; - - case OFPUTIL_OFPAT11_PUSH_VLAN: - case OFPUTIL_OFPAT13_PUSH_VLAN: - *usable_protocols &= OFPUTIL_P_OF11_UP; - error = str_to_u16(arg, "ethertype", ðertype); - if (error) { - return error; - } - - if (ethertype != ETH_TYPE_VLAN_8021Q) { - /* XXX ETH_TYPE_VLAN_8021AD case isn't supported */ - return xasprintf("%s: not a valid VLAN ethertype", arg); - } - - ofpact_put_PUSH_VLAN(ofpacts); - break; - - case OFPUTIL_OFPAT11_SET_QUEUE: - case OFPUTIL_OFPAT13_SET_QUEUE: - error = str_to_u32(arg, &ofpact_put_SET_QUEUE(ofpacts)->queue_id); - break; - - case OFPUTIL_OFPAT10_SET_DL_SRC: - case OFPUTIL_OFPAT11_SET_DL_SRC: - error = str_to_mac(arg, ofpact_put_SET_ETH_SRC(ofpacts)->mac); - break; - - case OFPUTIL_OFPAT10_SET_DL_DST: - case OFPUTIL_OFPAT11_SET_DL_DST: - error = str_to_mac(arg, ofpact_put_SET_ETH_DST(ofpacts)->mac); - break; - - case OFPUTIL_OFPAT10_SET_NW_SRC: - case OFPUTIL_OFPAT11_SET_NW_SRC: - error = str_to_ip(arg, &ofpact_put_SET_IPV4_SRC(ofpacts)->ipv4); - break; - - case OFPUTIL_OFPAT10_SET_NW_DST: - case OFPUTIL_OFPAT11_SET_NW_DST: - error = str_to_ip(arg, &ofpact_put_SET_IPV4_DST(ofpacts)->ipv4); - break; - - case OFPUTIL_OFPAT10_SET_NW_TOS: - case OFPUTIL_OFPAT11_SET_NW_TOS: - error = str_to_u8(arg, "TOS", &tos); - if (error) { - return error; - } - - if (tos & ~IP_DSCP_MASK) { - return xasprintf("%s: not a valid TOS", arg); - } - ofpact_put_SET_IP_DSCP(ofpacts)->dscp = tos; - break; - - case OFPUTIL_OFPAT11_SET_NW_ECN: - error = str_to_u8(arg, "ECN", &ecn); - if (error) { - return error; - } - - if (ecn & ~IP_ECN_MASK) { - return xasprintf("%s: not a valid ECN", arg); - } - ofpact_put_SET_IP_ECN(ofpacts)->ecn = ecn; - break; - - case OFPUTIL_OFPAT11_SET_NW_TTL: - case OFPUTIL_OFPAT13_SET_NW_TTL: - error = str_to_u8(arg, "TTL", &ttl); - if (error) { - return error; - } - - ofpact_put_SET_IP_TTL(ofpacts)->ttl = ttl; - break; - - case OFPUTIL_OFPAT11_DEC_NW_TTL: - case OFPUTIL_OFPAT13_DEC_NW_TTL: - OVS_NOT_REACHED(); - - case OFPUTIL_OFPAT10_SET_TP_SRC: - case OFPUTIL_OFPAT11_SET_TP_SRC: - error = str_to_u16(arg, "source port", - &ofpact_put_SET_L4_SRC_PORT(ofpacts)->port); - break; - - case OFPUTIL_OFPAT10_SET_TP_DST: - case OFPUTIL_OFPAT11_SET_TP_DST: - error = str_to_u16(arg, "destination port", - &ofpact_put_SET_L4_DST_PORT(ofpacts)->port); - break; - - case OFPUTIL_OFPAT10_ENQUEUE: - error = parse_enqueue(arg, ofpacts); - break; - - case OFPUTIL_NXAST_RESUBMIT: - error = parse_resubmit(arg, ofpacts); - break; - - case OFPUTIL_NXAST_SET_TUNNEL: - case OFPUTIL_NXAST_SET_TUNNEL64: - tunnel = ofpact_put_SET_TUNNEL(ofpacts); - tunnel->ofpact.compat = code; - error = str_to_u64(arg, &tunnel->tun_id); - break; - - case OFPUTIL_NXAST_WRITE_METADATA: - error = parse_metadata(ofpacts, arg); - break; - - case OFPUTIL_NXAST_SET_QUEUE: - error = str_to_u32(arg, &ofpact_put_SET_QUEUE(ofpacts)->queue_id); - break; - - case OFPUTIL_NXAST_POP_QUEUE: - ofpact_put_POP_QUEUE(ofpacts); - break; - - case OFPUTIL_NXAST_REG_MOVE: - error = nxm_parse_reg_move(ofpact_put_REG_MOVE(ofpacts), arg); - break; - - case OFPUTIL_NXAST_REG_LOAD: - error = nxm_parse_reg_load(ofpact_put_REG_LOAD(ofpacts), arg); - break; - - case OFPUTIL_NXAST_NOTE: - error = parse_note(arg, ofpacts); - break; - - case OFPUTIL_NXAST_MULTIPATH: - error = multipath_parse(ofpact_put_MULTIPATH(ofpacts), arg); - break; - - case OFPUTIL_NXAST_BUNDLE: - error = bundle_parse(arg, ofpacts); - break; - - case OFPUTIL_NXAST_BUNDLE_LOAD: - error = bundle_parse_load(arg, ofpacts); - break; - - case OFPUTIL_NXAST_RESUBMIT_TABLE: - case OFPUTIL_NXAST_OUTPUT_REG: - case OFPUTIL_NXAST_DEC_TTL_CNT_IDS: - OVS_NOT_REACHED(); - - case OFPUTIL_NXAST_LEARN: - error = learn_parse(arg, ofpacts); - break; - - case OFPUTIL_NXAST_EXIT: - ofpact_put_EXIT(ofpacts); - break; - - case OFPUTIL_NXAST_DEC_TTL: - error = parse_dec_ttl(ofpacts, arg); - break; - - case OFPUTIL_NXAST_SET_MPLS_LABEL: - case OFPUTIL_OFPAT11_SET_MPLS_LABEL: - error = parse_set_mpls_label(ofpacts, arg); - break; - - case OFPUTIL_NXAST_SET_MPLS_TC: - case OFPUTIL_OFPAT11_SET_MPLS_TC: - error = parse_set_mpls_tc(ofpacts, arg); - break; - - case OFPUTIL_NXAST_SET_MPLS_TTL: - case OFPUTIL_OFPAT11_SET_MPLS_TTL: - case OFPUTIL_OFPAT13_SET_MPLS_TTL: - error = parse_set_mpls_ttl(ofpacts, arg); - break; - - case OFPUTIL_OFPAT11_DEC_MPLS_TTL: - case OFPUTIL_OFPAT13_DEC_MPLS_TTL: - case OFPUTIL_NXAST_DEC_MPLS_TTL: - ofpact_put_DEC_MPLS_TTL(ofpacts); - break; - - case OFPUTIL_NXAST_FIN_TIMEOUT: - error = parse_fin_timeout(ofpacts, arg); - break; - - case OFPUTIL_NXAST_CONTROLLER: - error = parse_controller(ofpacts, arg); - break; - - case OFPUTIL_OFPAT11_PUSH_MPLS: - case OFPUTIL_OFPAT13_PUSH_MPLS: - case OFPUTIL_NXAST_PUSH_MPLS: - error = str_to_u16(arg, "push_mpls", ðertype); - if (!error) { - ofpact_put_PUSH_MPLS(ofpacts)->ethertype = htons(ethertype); - } - break; - - case OFPUTIL_OFPAT11_POP_MPLS: - case OFPUTIL_OFPAT13_POP_MPLS: - case OFPUTIL_NXAST_POP_MPLS: - error = str_to_u16(arg, "pop_mpls", ðertype); - if (!error) { - ofpact_put_POP_MPLS(ofpacts)->ethertype = htons(ethertype); - } - break; - - case OFPUTIL_OFPAT11_GROUP: - case OFPUTIL_OFPAT13_GROUP: - error = str_to_u32(arg, &ofpact_put_GROUP(ofpacts)->group_id); - break; - - /* FIXME when implement OFPAT13_* */ - case OFPUTIL_OFPAT13_COPY_TTL_OUT: - case OFPUTIL_OFPAT13_COPY_TTL_IN: - case OFPUTIL_OFPAT13_PUSH_PBB: - case OFPUTIL_OFPAT13_POP_PBB: - OVS_NOT_REACHED(); - - case OFPUTIL_NXAST_STACK_PUSH: - error = nxm_parse_stack_action(ofpact_put_STACK_PUSH(ofpacts), arg); - break; - case OFPUTIL_NXAST_STACK_POP: - error = nxm_parse_stack_action(ofpact_put_STACK_POP(ofpacts), arg); - break; - - case OFPUTIL_NXAST_SAMPLE: - error = parse_sample(ofpacts, arg); - break; - } - - if (error) { - ofpbuf_set_size(ofpacts, orig_size); - } - return error; -} - -/* Parses action 'act', with argument 'arg', and appends a parsed version to - * 'ofpacts'. - * - * 'n_actions' specifies the number of actions already parsed (for proper - * handling of "drop" actions). - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -str_to_ofpact__(char *pos, char *act, char *arg, - struct ofpbuf *ofpacts, int n_actions, - enum ofputil_protocol *usable_protocols) -{ - int code = ofputil_action_code_from_name(act); - if (code >= 0) { - return parse_named_action(code, arg, ofpacts, usable_protocols); - } else if (!strcasecmp(act, "drop")) { - if (n_actions) { - return xstrdup("Drop actions must not be preceded by other " - "actions"); - } else if (ofputil_parse_key_value(&pos, &act, &arg)) { - return xstrdup("Drop actions must not be followed by other " - "actions"); - } - } else { - ofp_port_t port; - if (ofputil_port_from_string(act, &port)) { - ofpact_put_OUTPUT(ofpacts)->port = port; - } else { - return xasprintf("Unknown action: %s", act); - } - } - - return NULL; -} - -/* Parses 'str' as a series of actions, and appends them to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -str_to_ofpacts__(char *str, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - size_t orig_size = ofpbuf_size(ofpacts); - char *pos, *act, *arg; - int n_actions; - - pos = str; - n_actions = 0; - while (ofputil_parse_key_value(&pos, &act, &arg)) { - char *error = str_to_ofpact__(pos, act, arg, ofpacts, n_actions, - usable_protocols); - if (error) { - ofpbuf_set_size(ofpacts, orig_size); - return error; - } - n_actions++; - } - - ofpact_pad(ofpacts); - return NULL; -} - - -/* Parses 'str' as a series of actions, and appends them to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -str_to_ofpacts(char *str, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - size_t orig_size = ofpbuf_size(ofpacts); - char *error_s; - enum ofperr error; - - error_s = str_to_ofpacts__(str, ofpacts, usable_protocols); - if (error_s) { - return error_s; - } - - error = ofpacts_verify(ofpbuf_data(ofpacts), ofpbuf_size(ofpacts)); - if (error) { - ofpbuf_set_size(ofpacts, orig_size); - return xstrdup("Incorrect action ordering"); - } - - return NULL; -} - -/* Parses 'arg' as the argument to instruction 'type', and appends such an - * instruction to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -parse_named_instruction(enum ovs_instruction_type type, - char *arg, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - char *error_s = NULL; - enum ofperr error; - - *usable_protocols &= OFPUTIL_P_OF11_UP; - - switch (type) { - case OVSINST_OFPIT11_APPLY_ACTIONS: - OVS_NOT_REACHED(); /* This case is handled by str_to_inst_ofpacts() */ - break; - - case OVSINST_OFPIT11_WRITE_ACTIONS: { - struct ofpact_nest *on; - size_t ofs; - - ofpact_pad(ofpacts); - ofs = ofpbuf_size(ofpacts); - on = ofpact_put(ofpacts, OFPACT_WRITE_ACTIONS, - offsetof(struct ofpact_nest, actions)); - error_s = str_to_ofpacts__(arg, ofpacts, usable_protocols); - - on = ofpbuf_at_assert(ofpacts, ofs, sizeof *on); - on->ofpact.len = ofpbuf_size(ofpacts) - ofs; - - if (error_s) { - ofpbuf_set_size(ofpacts, ofs); - } - break; - } - - case OVSINST_OFPIT11_CLEAR_ACTIONS: - ofpact_put_CLEAR_ACTIONS(ofpacts); - break; - - case OVSINST_OFPIT13_METER: - *usable_protocols &= OFPUTIL_P_OF13_UP; - error_s = str_to_u32(arg, &ofpact_put_METER(ofpacts)->meter_id); - break; - - case OVSINST_OFPIT11_WRITE_METADATA: - *usable_protocols &= OFPUTIL_P_NXM_OF11_UP; - error_s = parse_metadata(ofpacts, arg); - break; - - case OVSINST_OFPIT11_GOTO_TABLE: { - struct ofpact_goto_table *ogt = ofpact_put_GOTO_TABLE(ofpacts); - char *table_s = strsep(&arg, ","); - if (!table_s || !table_s[0]) { - return xstrdup("instruction goto-table needs table id"); - } - error_s = str_to_u8(table_s, "table", &ogt->table_id); - break; - } - } - - if (error_s) { - return error_s; - } - - /* If write_metadata is specified as an action AND an instruction, ofpacts - could be invalid. */ - error = ofpacts_verify(ofpbuf_data(ofpacts), ofpbuf_size(ofpacts)); - if (error) { - return xstrdup("Incorrect instruction ordering"); - } - return NULL; -} - -/* Parses 'str' as a series of instructions, and appends them to 'ofpacts'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT -str_to_inst_ofpacts(char *str, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - size_t orig_size = ofpbuf_size(ofpacts); - char *pos, *inst, *arg; - int type; - const char *prev_inst = NULL; - int prev_type = -1; - int n_actions = 0; - - pos = str; - while (ofputil_parse_key_value(&pos, &inst, &arg)) { - type = ovs_instruction_type_from_name(inst); - if (type < 0) { - char *error = str_to_ofpact__(pos, inst, arg, ofpacts, n_actions, - usable_protocols); - if (error) { - ofpbuf_set_size(ofpacts, orig_size); - return error; - } - - type = OVSINST_OFPIT11_APPLY_ACTIONS; - if (prev_type == type) { - n_actions++; - continue; - } - } else if (type == OVSINST_OFPIT11_APPLY_ACTIONS) { - ofpbuf_set_size(ofpacts, orig_size); - return xasprintf("%s isn't supported. Just write actions then " - "it is interpreted as apply_actions", inst); - } else { - char *error = parse_named_instruction(type, arg, ofpacts, - usable_protocols); - if (error) { - ofpbuf_set_size(ofpacts, orig_size); - return error; - } - } - - if (type <= prev_type) { - ofpbuf_set_size(ofpacts, orig_size); - if (type == prev_type) { - return xasprintf("instruction %s may be specified only once", - inst); - } else { - return xasprintf("instruction %s must be specified before %s", - inst, prev_inst); - } - } - - prev_inst = inst; - prev_type = type; - n_actions++; - } - ofpact_pad(ofpacts); - - return NULL; -} - struct protocol { const char *name; uint16_t dl_type; @@ -1210,7 +212,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_field(const struct mf_field *mf, const char *s, struct match *match, enum ofputil_protocol *usable_protocols) { @@ -1224,13 +226,28 @@ return error; } -static char * WARN_UNUSED_RESULT +static char * +extract_actions(char *s) +{ + s = strstr(s, "action"); + if (s) { + *s = '\0'; + s = strchr(s + 1, '='); + return s ? s + 1 : NULL; + } else { + return NULL; + } +} + + +static char * OVS_WARN_UNUSED_RESULT parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string, enum ofputil_protocol *usable_protocols) { enum { F_OUT_PORT = 1 << 0, F_ACTIONS = 1 << 1, + F_IMPORTANCE = 1 << 2, F_TIMEOUT = 1 << 3, F_PRIORITY = 1 << 4, F_FLAGS = 1 << 5, @@ -1241,13 +258,36 @@ *usable_protocols = OFPUTIL_P_ANY; + if (command == -2) { + size_t len; + + string += strspn(string, " \t\r\n"); /* Skip white space. */ + len = strcspn(string, ", \t\r\n"); /* Get length of the first token. */ + + if (!strncmp(string, "add", len)) { + command = OFPFC_ADD; + } else if (!strncmp(string, "delete", len)) { + command = OFPFC_DELETE; + } else if (!strncmp(string, "delete_strict", len)) { + command = OFPFC_DELETE_STRICT; + } else if (!strncmp(string, "modify", len)) { + command = OFPFC_MODIFY; + } else if (!strncmp(string, "modify_strict", len)) { + command = OFPFC_MODIFY_STRICT; + } else { + len = 0; + command = OFPFC_ADD; + } + string += len; + } + switch (command) { case -1: fields = F_OUT_PORT; break; case OFPFC_ADD: - fields = F_ACTIONS | F_TIMEOUT | F_PRIORITY | F_FLAGS; + fields = F_ACTIONS | F_TIMEOUT | F_PRIORITY | F_FLAGS | F_IMPORTANCE; break; case OFPFC_DELETE: @@ -1288,20 +328,14 @@ fm->buffer_id = UINT32_MAX; fm->out_port = OFPP_ANY; fm->flags = 0; + fm->importance = 0; fm->out_group = OFPG11_ANY; + fm->delete_reason = OFPRR_DELETE; if (fields & F_ACTIONS) { - act_str = strstr(string, "action"); - if (!act_str) { - return xstrdup("must specify an action"); - } - *act_str = '\0'; - - act_str = strchr(act_str + 1, '='); + act_str = extract_actions(string); if (!act_str) { return xstrdup("must specify an action"); } - - act_str++; } for (name = strtok_r(string, "=, \t\r\n", &save_ptr); name; name = strtok_r(NULL, "=, \t\r\n", &save_ptr)) { @@ -1342,7 +376,7 @@ if (fm->table_id != 0xff) { *usable_protocols &= OFPUTIL_P_TID; } - } else if (!strcmp(name, "out_port")) { + } else if (fields & F_OUT_PORT && !strcmp(name, "out_port")) { if (!ofputil_port_from_string(value, &fm->out_port)) { error = xasprintf("%s is not a valid OpenFlow port", value); @@ -1356,6 +390,8 @@ error = str_to_u16(value, name, &fm->idle_timeout); } else if (fields & F_TIMEOUT && !strcmp(name, "hard_timeout")) { error = str_to_u16(value, name, &fm->hard_timeout); + } else if (fields & F_IMPORTANCE && !strcmp(name, "importance")) { + error = str_to_u16(value, name, &fm->importance); } else if (!strcmp(name, "cookie")) { char *mask = strchr(value, '/'); @@ -1428,15 +464,18 @@ fm->new_cookie = htonll(0); } if (fields & F_ACTIONS) { + enum ofputil_protocol action_usable_protocols; struct ofpbuf ofpacts; char *error; ofpbuf_init(&ofpacts, 32); - error = str_to_inst_ofpacts(act_str, &ofpacts, usable_protocols); + error = ofpacts_parse_instructions(act_str, &ofpacts, + &action_usable_protocols); + *usable_protocols &= action_usable_protocols; if (!error) { enum ofperr err; - err = ofpacts_check(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &fm->match.flow, + err = ofpacts_check(ofpacts.data, ofpacts.size, &fm->match.flow, OFPP_MAX, fm->table_id, 255, usable_protocols); if (!err && !usable_protocols) { err = OFPERR_OFPBAC_MATCH_INCONSISTENT; @@ -1452,7 +491,7 @@ return error; } - fm->ofpacts_len = ofpbuf_size(&ofpacts); + fm->ofpacts_len = ofpacts.size; fm->ofpacts = ofpbuf_steal_data(&ofpacts); } else { fm->ofpacts_len = 0; @@ -1470,9 +509,13 @@ * constant for 'command'. To parse syntax for an OFPST_FLOW or * OFPST_AGGREGATE (or NXST_FLOW or NXST_AGGREGATE), use -1 for 'command'. * + * If 'command' is given as -2, 'str_' may begin with a command name ("add", + * "modify", "delete", "modify_strict", or "delete_strict"). A missing command + * name is treated as "add". + * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_ofp_str(struct ofputil_flow_mod *fm, int command, const char *str_, enum ofputil_protocol *usable_protocols) { @@ -1489,7 +532,7 @@ return error; } -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_ofp_meter_mod_str__(struct ofputil_meter_mod *mm, char *string, struct ofpbuf *bands, int command, enum ofputil_protocol *usable_protocols) @@ -1575,7 +618,8 @@ if (error) { return error; } - if (mm->meter.meter_id > OFPM13_MAX) { + if (mm->meter.meter_id > OFPM13_MAX + || !mm->meter.meter_id) { return xasprintf("invalid value for %s", name); } } @@ -1692,7 +736,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_ofp_meter_mod_str(struct ofputil_meter_mod *mm, const char *str_, int command, enum ofputil_protocol *usable_protocols) { @@ -1712,16 +756,16 @@ return error; } -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_flow_monitor_request__(struct ofputil_flow_monitor_request *fmr, const char *str_, char *string, enum ofputil_protocol *usable_protocols) { - static atomic_uint32_t id = ATOMIC_VAR_INIT(0); + static atomic_count id = ATOMIC_COUNT_INIT(0); char *save_ptr = NULL; char *name; - atomic_add(&id, 1, &fmr->id); + fmr->id = atomic_count_inc(&id); fmr->flags = (NXFMF_INITIAL | NXFMF_ADD | NXFMF_DELETE | NXFMF_MODIFY | NXFMF_OWN | NXFMF_ACTIONS); @@ -1786,7 +830,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_flow_monitor_request(struct ofputil_flow_monitor_request *fmr, const char *str_, enum ofputil_protocol *usable_protocols) @@ -1798,37 +842,22 @@ return error; } -/* Parses 's' as a set of OpenFlow actions and appends the actions to - * 'actions'. - * - * Returns NULL if successful, otherwise a malloc()'d string describing the - * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT -parse_ofpacts(const char *s_, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) -{ - char *s = xstrdup(s_); - char *error; - - *usable_protocols = OFPUTIL_P_ANY; - - error = str_to_ofpacts(s, ofpacts, usable_protocols); - free(s); - - return error; -} - /* Parses 'string' as an OFPT_FLOW_MOD or NXT_FLOW_MOD with command 'command' * (one of OFPFC_*) into 'fm'. * + * If 'command' is given as -2, 'string' may begin with a command name ("add", + * "modify", "delete", "modify_strict", or "delete_strict"). A missing command + * name is treated as "add". + * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_ofp_flow_mod_str(struct ofputil_flow_mod *fm, const char *string, - uint16_t command, + int command, enum ofputil_protocol *usable_protocols) { char *error = parse_ofp_str(fm, command, string, usable_protocols); + if (!error) { /* Normalize a copy of the match. This ensures that non-normalized * flows get logged but doesn't affect what gets sent to the switch, so @@ -1846,7 +875,7 @@ * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_ofp_table_mod(struct ofputil_table_mod *tm, const char *table_id, const char *flow_miss_handling, enum ofputil_protocol *usable_protocols) @@ -1864,16 +893,17 @@ } if (strcmp(flow_miss_handling, "controller") == 0) { - tm->config = OFPTC11_TABLE_MISS_CONTROLLER; + tm->miss_config = OFPUTIL_TABLE_MISS_CONTROLLER; } else if (strcmp(flow_miss_handling, "continue") == 0) { - tm->config = OFPTC11_TABLE_MISS_CONTINUE; + tm->miss_config = OFPUTIL_TABLE_MISS_CONTINUE; } else if (strcmp(flow_miss_handling, "drop") == 0) { - tm->config = OFPTC11_TABLE_MISS_DROP; + tm->miss_config = OFPUTIL_TABLE_MISS_DROP; } else { return xasprintf("invalid flow_miss_handling %s", flow_miss_handling); } - if (tm->table_id == 0xfe && tm->config == OFPTC11_TABLE_MISS_CONTINUE) { + if (tm->table_id == 0xfe + && tm->miss_config == OFPUTIL_TABLE_MISS_CONTINUE) { return xstrdup("last table's flow miss handling can not be continue"); } @@ -1885,10 +915,14 @@ * type (one of OFPFC_*). Stores each flow_mod in '*fm', an array allocated * on the caller's behalf, and the number of flow_mods in '*n_fms'. * + * If 'command' is given as -2, each line may start with a command name + * ("add", "modify", "delete", "modify_strict", or "delete_strict"). A missing + * command name is treated as "add". + * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT -parse_ofp_flow_mod_file(const char *file_name, uint16_t command, +char * OVS_WARN_UNUSED_RESULT +parse_ofp_flow_mod_file(const char *file_name, int command, struct ofputil_flow_mod **fms, size_t *n_fms, enum ofputil_protocol *usable_protocols) { @@ -1948,7 +982,7 @@ return NULL; } -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *fsr, bool aggregate, const char *string, enum ofputil_protocol *usable_protocols) @@ -2088,68 +1122,152 @@ return error; } -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_bucket_str(struct ofputil_bucket *bucket, char *str_, enum ofputil_protocol *usable_protocols) { + char *pos, *key, *value; struct ofpbuf ofpacts; - char *pos, *act, *arg; - int n_actions; + struct ds actions; + char *error; bucket->weight = 1; + bucket->bucket_id = OFPG15_BUCKET_ALL; bucket->watch_port = OFPP_ANY; bucket->watch_group = OFPG11_ANY; - pos = str_; - n_actions = 0; - ofpbuf_init(&ofpacts, 64); - while (ofputil_parse_key_value(&pos, &act, &arg)) { - char *error = NULL; + ds_init(&actions); - if (!strcasecmp(act, "weight")) { - error = str_to_u16(arg, "weight", &bucket->weight); - } else if (!strcasecmp(act, "watch_port")) { - if (!ofputil_port_from_string(arg, &bucket->watch_port) + pos = str_; + error = NULL; + while (ofputil_parse_key_value(&pos, &key, &value)) { + if (!strcasecmp(key, "weight")) { + error = str_to_u16(value, "weight", &bucket->weight); + } else if (!strcasecmp(key, "watch_port")) { + if (!ofputil_port_from_string(value, &bucket->watch_port) || (ofp_to_u16(bucket->watch_port) >= ofp_to_u16(OFPP_MAX) && bucket->watch_port != OFPP_ANY)) { - error = xasprintf("%s: invalid watch_port", arg); + error = xasprintf("%s: invalid watch_port", value); } - } else if (!strcasecmp(act, "watch_group")) { - error = str_to_u32(arg, &bucket->watch_group); + } else if (!strcasecmp(key, "watch_group")) { + error = str_to_u32(value, &bucket->watch_group); if (!error && bucket->watch_group > OFPG_MAX) { error = xasprintf("invalid watch_group id %"PRIu32, bucket->watch_group); } + } else if (!strcasecmp(key, "bucket_id")) { + error = str_to_u32(value, &bucket->bucket_id); + if (!error && bucket->bucket_id > OFPG15_BUCKET_MAX) { + error = xasprintf("invalid bucket_id id %"PRIu32, + bucket->bucket_id); + } + *usable_protocols &= OFPUTIL_P_OF15_UP; + } else if (!strcasecmp(key, "action") || !strcasecmp(key, "actions")) { + ds_put_format(&actions, "%s,", value); } else { - error = str_to_ofpact__(pos, act, arg, &ofpacts, n_actions, - usable_protocols); - n_actions++; + ds_put_format(&actions, "%s(%s),", key, value); } if (error) { - ofpbuf_uninit(&ofpacts); + ds_destroy(&actions); return error; } } - ofpact_pad(&ofpacts); - bucket->ofpacts = ofpbuf_data(&ofpacts); - bucket->ofpacts_len = ofpbuf_size(&ofpacts); + if (!actions.length) { + return xstrdup("bucket must specify actions"); + } + ds_chomp(&actions, ','); + + ofpbuf_init(&ofpacts, 0); + error = ofpacts_parse_actions(ds_cstr(&actions), &ofpacts, + usable_protocols); + ds_destroy(&actions); + if (error) { + ofpbuf_uninit(&ofpacts); + return error; + } + bucket->ofpacts = ofpacts.data; + bucket->ofpacts_len = ofpacts.size; + + return NULL; +} + +static char * OVS_WARN_UNUSED_RESULT +parse_select_group_field(char *s, struct field_array *fa, + enum ofputil_protocol *usable_protocols) +{ + char *save_ptr = NULL; + char *name; + + for (name = strtok_r(s, "=, \t\r\n", &save_ptr); name; + name = strtok_r(NULL, "=, \t\r\n", &save_ptr)) { + const struct mf_field *mf = mf_from_name(name); + + if (mf) { + char *error; + const char *value_str; + union mf_value value; + + if (bitmap_is_set(fa->used.bm, mf->id)) { + return xasprintf("%s: duplicate field", name); + } + + value_str = strtok_r(NULL, ", \t\r\n", &save_ptr); + if (value_str) { + error = mf_parse_value(mf, value_str, &value); + if (error) { + return error; + } + + /* The mask cannot be all-zeros */ + if (is_all_zeros(&value, mf->n_bytes)) { + return xasprintf("%s: values are wildcards here " + "and must not be all-zeros", s); + } + + /* The values parsed are masks for fields used + * by the selection method */ + if (!mf_is_mask_valid(mf, &value)) { + return xasprintf("%s: invalid mask for field %s", + value_str, mf->name); + } + } else { + memset(&value, 0xff, mf->n_bytes); + } + + field_array_set(mf->id, &value, fa); + + if (is_all_ones(&value, mf->n_bytes)) { + *usable_protocols &= mf->usable_protocols_exact; + } else if (mf->usable_protocols_bitwise == mf->usable_protocols_cidr + || ip_is_cidr(value.be32)) { + *usable_protocols &= mf->usable_protocols_cidr; + } else { + *usable_protocols &= mf->usable_protocols_bitwise; + } + } else { + return xasprintf("%s: unknown field %s", s, name); + } + } return NULL; } -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command, char *string, enum ofputil_protocol *usable_protocols) { enum { - F_GROUP_TYPE = 1 << 0, - F_BUCKETS = 1 << 1, + F_GROUP_TYPE = 1 << 0, + F_BUCKETS = 1 << 1, + F_COMMAND_BUCKET_ID = 1 << 2, + F_COMMAND_BUCKET_ID_ALL = 1 << 3, } fields; char *save_ptr = NULL; bool had_type = false; + bool had_command_bucket_id = false; char *name; struct ofputil_bucket *bucket; char *error = NULL; @@ -2169,6 +1287,16 @@ fields = F_GROUP_TYPE | F_BUCKETS; break; + case OFPGC15_INSERT_BUCKET: + fields = F_BUCKETS | F_COMMAND_BUCKET_ID; + *usable_protocols &= OFPUTIL_P_OF15_UP; + break; + + case OFPGC15_REMOVE_BUCKET: + fields = F_COMMAND_BUCKET_ID | F_COMMAND_BUCKET_ID_ALL; + *usable_protocols &= OFPUTIL_P_OF15_UP; + break; + default: OVS_NOT_REACHED(); } @@ -2176,6 +1304,7 @@ memset(gm, 0, sizeof *gm); gm->command = command; gm->group_id = OFPG_ANY; + gm->command_bucket_id = OFPG15_BUCKET_ALL; list_init(&gm->buckets); if (command == OFPGC11_DELETE && string[0] == '\0') { gm->group_id = OFPG_ALL; @@ -2185,7 +1314,7 @@ *usable_protocols = OFPUTIL_P_OF11_UP; if (fields & F_BUCKETS) { - char *bkt_str = strstr(string, "bucket"); + char *bkt_str = strstr(string, "bucket="); if (bkt_str) { *bkt_str = '\0'; @@ -2201,7 +1330,7 @@ } bkt_str++; - next_bkt_str = strstr(bkt_str, "bucket"); + next_bkt_str = strstr(bkt_str, "bucket="); if (next_bkt_str) { *next_bkt_str = '\0'; } @@ -2228,11 +1357,42 @@ goto out; } - if (!strcmp(name, "group_id")) { + if (!strcmp(name, "command_bucket_id")) { + if (!(fields & F_COMMAND_BUCKET_ID)) { + error = xstrdup("command bucket id is not needed"); + goto out; + } + if (!strcmp(value, "all")) { + gm->command_bucket_id = OFPG15_BUCKET_ALL; + } else if (!strcmp(value, "first")) { + gm->command_bucket_id = OFPG15_BUCKET_FIRST; + } else if (!strcmp(value, "last")) { + gm->command_bucket_id = OFPG15_BUCKET_LAST; + } else { + error = str_to_u32(value, &gm->command_bucket_id); + if (error) { + goto out; + } + if (gm->command_bucket_id > OFPG15_BUCKET_MAX + && (gm->command_bucket_id != OFPG15_BUCKET_FIRST + && gm->command_bucket_id != OFPG15_BUCKET_LAST + && gm->command_bucket_id != OFPG15_BUCKET_ALL)) { + error = xasprintf("invalid command bucket id %"PRIu32, + gm->command_bucket_id); + goto out; + } + } + if (gm->command_bucket_id == OFPG15_BUCKET_ALL + && !(fields & F_COMMAND_BUCKET_ID_ALL)) { + error = xstrdup("command_bucket_id=all is not permitted"); + goto out; + } + had_command_bucket_id = true; + } else if (!strcmp(name, "group_id")) { if(!strcmp(value, "all")) { gm->group_id = OFPG_ALL; } else { - char *error = str_to_u32(value, &gm->group_id); + error = str_to_u32(value, &gm->group_id); if (error) { goto out; } @@ -2264,6 +1424,42 @@ } else if (!strcmp(name, "bucket")) { error = xstrdup("bucket is not needed"); goto out; + } else if (!strcmp(name, "selection_method")) { + if (!(fields & F_GROUP_TYPE)) { + error = xstrdup("selection method is not needed"); + goto out; + } + if (strlen(value) >= NTR_MAX_SELECTION_METHOD_LEN) { + error = xasprintf("selection method is longer than %u" + " bytes long", + NTR_MAX_SELECTION_METHOD_LEN - 1); + goto out; + } + memset(gm->props.selection_method, '\0', + NTR_MAX_SELECTION_METHOD_LEN); + strcpy(gm->props.selection_method, value); + *usable_protocols &= OFPUTIL_P_OF15_UP; + } else if (!strcmp(name, "selection_method_param")) { + if (!(fields & F_GROUP_TYPE)) { + error = xstrdup("selection method param is not needed"); + goto out; + } + error = str_to_u64(value, &gm->props.selection_method_param); + if (error) { + goto out; + } + *usable_protocols &= OFPUTIL_P_OF15_UP; + } else if (!strcmp(name, "fields")) { + if (!(fields & F_GROUP_TYPE)) { + error = xstrdup("fields are not needed"); + goto out; + } + error = parse_select_group_field(value, &gm->props.fields, + usable_protocols); + if (error) { + goto out; + } + *usable_protocols &= OFPUTIL_P_OF15_UP; } else { error = xasprintf("unknown keyword %s", name); goto out; @@ -2278,6 +1474,16 @@ goto out; } + if (fields & F_COMMAND_BUCKET_ID) { + if (!(fields & F_COMMAND_BUCKET_ID_ALL || had_command_bucket_id)) { + error = xstrdup("must specify a command bucket id"); + goto out; + } + } else if (had_command_bucket_id) { + error = xstrdup("command bucket id is not needed"); + goto out; + } + /* Validate buckets. */ LIST_FOR_EACH (bucket, list_node, &gm->buckets) { if (bucket->weight != 1 && gm->type != OFPGT11_SELECT) { @@ -2296,7 +1502,7 @@ return error; } -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_ofp_group_mod_str(struct ofputil_group_mod *gm, uint16_t command, const char *str_, enum ofputil_protocol *usable_protocols) @@ -2312,7 +1518,7 @@ return error; } -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT parse_ofp_group_mod_file(const char *file_name, uint16_t command, struct ofputil_group_mod **gms, size_t *n_gms, enum ofputil_protocol *usable_protocols) @@ -2340,12 +1546,14 @@ char *error; if (*n_gms >= allocated_gms) { + struct ofputil_group_mod *new_gms; size_t i; - *gms = x2nrealloc(*gms, &allocated_gms, sizeof **gms); + new_gms = x2nrealloc(*gms, &allocated_gms, sizeof **gms); for (i = 0; i < *n_gms; i++) { - list_moved(&(*gms)[i].buckets); + list_moved(&new_gms[i].buckets, &(*gms)[i].buckets); } + *gms = new_gms; } error = parse_ofp_group_mod_str(&(*gms)[*n_gms], command, ds_cstr(&s), &usable); diff -Nru openvswitch-2.3.1/lib/ofp-parse.h openvswitch-2.4.0~git20150623/lib/ofp-parse.h --- openvswitch-2.3.1/lib/ofp-parse.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-parse.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ #include #include #include "compiler.h" +#include "openvswitch/types.h" +#include "packets.h" struct flow; struct ofpbuf; @@ -37,31 +39,27 @@ char *parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *parse_ofp_flow_mod_str(struct ofputil_flow_mod *, const char *string, - uint16_t command, + int command, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *parse_ofp_table_mod(struct ofputil_table_mod *, const char *table_id, const char *flow_miss_handling, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; -char *parse_ofp_flow_mod_file(const char *file_name, uint16_t command, +char *parse_ofp_flow_mod_file(const char *file_name, int command, struct ofputil_flow_mod **fms, size_t *n_fms, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *, bool aggregate, const char *string, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; - -char *parse_ofpacts(const char *, struct ofpbuf *ofpacts, - enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *parse_ofp_exact_flow(struct flow *flow, struct flow *mask, const char *s, const struct simap *portno_names); @@ -69,21 +67,31 @@ char *parse_ofp_meter_mod_str(struct ofputil_meter_mod *, const char *string, int command, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *parse_flow_monitor_request(struct ofputil_flow_monitor_request *, const char *, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *parse_ofp_group_mod_file(const char *file_name, uint16_t command, struct ofputil_group_mod **gms, size_t *n_gms, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *parse_ofp_group_mod_str(struct ofputil_group_mod *, uint16_t command, const char *string, enum ofputil_protocol *usable_protocols) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; + +char *str_to_u8(const char *str, const char *name, uint8_t *valuep) + OVS_WARN_UNUSED_RESULT; +char *str_to_u16(const char *str, const char *name, uint16_t *valuep) + OVS_WARN_UNUSED_RESULT; +char *str_to_u32(const char *str, uint32_t *valuep) OVS_WARN_UNUSED_RESULT; +char *str_to_u64(const char *str, uint64_t *valuep) OVS_WARN_UNUSED_RESULT; +char *str_to_be64(const char *str, ovs_be64 *valuep) OVS_WARN_UNUSED_RESULT; +char *str_to_mac(const char *str, uint8_t mac[ETH_ADDR_LEN]) OVS_WARN_UNUSED_RESULT; +char *str_to_ip(const char *str, ovs_be32 *ip) OVS_WARN_UNUSED_RESULT; #endif /* ofp-parse.h */ diff -Nru openvswitch-2.3.1/lib/ofp-print.c openvswitch-2.4.0~git20150623/lib/ofp-print.c --- openvswitch-2.3.1/lib/ofp-print.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-print.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,13 +37,14 @@ #include "netdev.h" #include "nx-match.h" #include "ofp-actions.h" +#include "ofpbuf.h" #include "ofp-errors.h" #include "ofp-msgs.h" #include "ofp-util.h" -#include "ofpbuf.h" #include "openflow/openflow.h" #include "openflow/nicira-ext.h" #include "packets.h" +#include "dp-packet.h" #include "type-props.h" #include "unaligned.h" #include "odp-util.h" @@ -51,7 +52,9 @@ static void ofp_print_queue_name(struct ds *string, uint32_t port); static void ofp_print_error(struct ds *, enum ofperr); - +static void ofp_print_table_features(struct ds *, + const struct ofputil_table_features *, + const struct ofputil_table_stats *); /* Returns a string that represents the contents of the Ethernet frame in the * 'len' bytes starting at 'data'. The caller must free the returned string.*/ @@ -59,27 +62,34 @@ ofp_packet_to_string(const void *data, size_t len) { struct ds ds = DS_EMPTY_INITIALIZER; - const struct pkt_metadata md = PKT_METADATA_INITIALIZER(0); - struct ofpbuf buf; + struct dp_packet buf; struct flow flow; size_t l4_size; - ofpbuf_use_const(&buf, data, len); - flow_extract(&buf, &md, &flow); + dp_packet_use_const(&buf, data, len); + flow_extract(&buf, &flow); flow_format(&ds, &flow); - l4_size = ofpbuf_l4_size(&buf); + l4_size = dp_packet_l4_size(&buf); if (flow.nw_proto == IPPROTO_TCP && l4_size >= TCP_HEADER_LEN) { - struct tcp_header *th = ofpbuf_l4(&buf); + struct tcp_header *th = dp_packet_l4(&buf); ds_put_format(&ds, " tcp_csum:%"PRIx16, ntohs(th->tcp_csum)); } else if (flow.nw_proto == IPPROTO_UDP && l4_size >= UDP_HEADER_LEN) { - struct udp_header *uh = ofpbuf_l4(&buf); + struct udp_header *uh = dp_packet_l4(&buf); ds_put_format(&ds, " udp_csum:%"PRIx16, ntohs(uh->udp_csum)); } else if (flow.nw_proto == IPPROTO_SCTP && l4_size >= SCTP_HEADER_LEN) { - struct sctp_header *sh = ofpbuf_l4(&buf); + struct sctp_header *sh = dp_packet_l4(&buf); ds_put_format(&ds, " sctp_csum:%"PRIx32, ntohl(get_16aligned_be32(&sh->sctp_csum))); + } else if (flow.nw_proto == IPPROTO_ICMP && l4_size >= ICMP_HEADER_LEN) { + struct icmp_header *icmph = dp_packet_l4(&buf); + ds_put_format(&ds, " icmp_csum:%"PRIx16, + ntohs(icmph->icmp_csum)); + } else if (flow.nw_proto == IPPROTO_ICMPV6 && l4_size >= ICMP6_HEADER_LEN) { + struct icmp6_header *icmp6h = dp_packet_l4(&buf); + ds_put_format(&ds, " icmp6_csum:%"PRIx16, + ntohs(icmp6h->icmp6_cksum)); } ds_put_char(&ds, '\n'); @@ -94,7 +104,6 @@ char reasonbuf[OFPUTIL_PACKET_IN_REASON_BUFSIZE]; struct ofputil_packet_in pin; int error; - int i; error = ofputil_decode_packet_in(&pin, oh); if (error) { @@ -110,34 +119,9 @@ ds_put_format(string, " cookie=0x%"PRIx64, ntohll(pin.cookie)); } - ds_put_format(string, " total_len=%"PRIuSIZE" in_port=", pin.total_len); - ofputil_format_port(pin.fmd.in_port, string); + ds_put_format(string, " total_len=%"PRIuSIZE" ", pin.total_len); - if (pin.fmd.tun_id != htonll(0)) { - ds_put_format(string, " tun_id=0x%"PRIx64, ntohll(pin.fmd.tun_id)); - } - - if (pin.fmd.tun_src != htonl(0)) { - ds_put_format(string, " tun_src="IP_FMT, IP_ARGS(pin.fmd.tun_src)); - } - - if (pin.fmd.tun_dst != htonl(0)) { - ds_put_format(string, " tun_dst="IP_FMT, IP_ARGS(pin.fmd.tun_dst)); - } - - if (pin.fmd.metadata != htonll(0)) { - ds_put_format(string, " metadata=0x%"PRIx64, ntohll(pin.fmd.metadata)); - } - - for (i = 0; i < FLOW_N_REGS; i++) { - if (pin.fmd.regs[i]) { - ds_put_format(string, " reg%d=0x%"PRIx32, i, pin.fmd.regs[i]); - } - } - - if (pin.fmd.pkt_mark != 0) { - ds_put_format(string, " pkt_mark=0x%"PRIx32, pin.fmd.pkt_mark); - } + match_format(&pin.flow_metadata, string, OFP_DEFAULT_PRIORITY); ds_put_format(string, " (via %s)", ofputil_packet_in_reason_to_string(pin.reason, reasonbuf, @@ -467,45 +451,6 @@ return NULL; } -static const char * -ofputil_action_bitmap_to_name(uint32_t bit) -{ - enum ofputil_action_bitmap action = bit; - - switch (action) { - case OFPUTIL_A_OUTPUT: return "OUTPUT"; - case OFPUTIL_A_SET_VLAN_VID: return "SET_VLAN_VID"; - case OFPUTIL_A_SET_VLAN_PCP: return "SET_VLAN_PCP"; - case OFPUTIL_A_STRIP_VLAN: return "STRIP_VLAN"; - case OFPUTIL_A_SET_DL_SRC: return "SET_DL_SRC"; - case OFPUTIL_A_SET_DL_DST: return "SET_DL_DST"; - case OFPUTIL_A_SET_NW_SRC: return "SET_NW_SRC"; - case OFPUTIL_A_SET_NW_DST: return "SET_NW_DST"; - case OFPUTIL_A_SET_NW_ECN: return "SET_NW_ECN"; - case OFPUTIL_A_SET_NW_TOS: return "SET_NW_TOS"; - case OFPUTIL_A_SET_TP_SRC: return "SET_TP_SRC"; - case OFPUTIL_A_SET_TP_DST: return "SET_TP_DST"; - case OFPUTIL_A_SET_FIELD: return "SET_FIELD"; - case OFPUTIL_A_ENQUEUE: return "ENQUEUE"; - case OFPUTIL_A_COPY_TTL_OUT: return "COPY_TTL_OUT"; - case OFPUTIL_A_COPY_TTL_IN: return "COPY_TTL_IN"; - case OFPUTIL_A_SET_MPLS_LABEL: return "SET_MPLS_LABEL"; - case OFPUTIL_A_SET_MPLS_TC: return "SET_MPLS_TC"; - case OFPUTIL_A_SET_MPLS_TTL: return "SET_MPLS_TTL"; - case OFPUTIL_A_DEC_MPLS_TTL: return "DEC_MPLS_TTL"; - case OFPUTIL_A_PUSH_VLAN: return "PUSH_VLAN"; - case OFPUTIL_A_POP_VLAN: return "POP_VLAN"; - case OFPUTIL_A_PUSH_MPLS: return "PUSH_MPLS"; - case OFPUTIL_A_POP_MPLS: return "POP_MPLS"; - case OFPUTIL_A_SET_QUEUE: return "SET_QUEUE"; - case OFPUTIL_A_GROUP: return "GROUP"; - case OFPUTIL_A_SET_NW_TTL: return "SET_NW_TTL"; - case OFPUTIL_A_DEC_NW_TTL: return "DEC_NW_TTL"; - } - - return NULL; -} - static void ofp_print_switch_features(struct ds *string, const struct ofp_header *oh) { @@ -536,8 +481,7 @@ switch ((enum ofp_version)oh->version) { case OFP10_VERSION: ds_put_cstr(string, "actions: "); - ofp_print_bit_names(string, features.actions, - ofputil_action_bitmap_to_name, ' '); + ofpact_bitmap_format(features.ofpacts, string); ds_put_char(string, '\n'); break; case OFP11_VERSION: @@ -578,7 +522,7 @@ static void print_wild(struct ds *string, const char *leader, int is_wild, int verbosity, const char *format, ...) - PRINTF_FORMAT(5, 6); + OVS_PRINTF_FORMAT(5, 6); static void print_wild(struct ds *string, const char *leader, int is_wild, int verbosity, const char *format, ...) @@ -725,9 +669,7 @@ print_wild(&f, "tp_dst=", w & OFPFW10_TP_DST, verbosity, "%d", ntohs(om->tp_dst)); } - if (ds_last(&f) == ',') { - f.length--; - } + ds_chomp(&f, ','); return ds_cstr(&f); } @@ -845,6 +787,9 @@ if (fm.hard_timeout != OFP_FLOW_PERMANENT) { ds_put_format(s, "hard:%"PRIu16" ", fm.hard_timeout); } + if (fm.importance != 0) { + ds_put_format(s, "importance:%"PRIu16" ", fm.importance); + } if (fm.priority != OFP_DEFAULT_PRIORITY && need_priority) { ds_put_format(s, "pri:%"PRIu16" ", fm.priority); } @@ -920,6 +865,7 @@ return "eviction"; case OFPRR_METER_DELETE: return "meter_delete"; + case OVS_OFPRR_NONE: default: snprintf(reasonbuf, bufsize, "%d", (int) reason); return reasonbuf; @@ -997,22 +943,21 @@ } static void -ofp_print_table_miss_config(struct ds *string, const uint32_t config) +ofp_print_table_miss_config(struct ds *string, enum ofputil_table_miss miss) { - uint32_t table_miss_config = config & OFPTC11_TABLE_MISS_MASK; - - switch (table_miss_config) { - case OFPTC11_TABLE_MISS_CONTROLLER: + switch (miss) { + case OFPUTIL_TABLE_MISS_CONTROLLER: ds_put_cstr(string, "controller\n"); break; - case OFPTC11_TABLE_MISS_CONTINUE: + case OFPUTIL_TABLE_MISS_CONTINUE: ds_put_cstr(string, "continue\n"); break; - case OFPTC11_TABLE_MISS_DROP: + case OFPUTIL_TABLE_MISS_DROP: ds_put_cstr(string, "drop\n"); break; + case OFPUTIL_TABLE_MISS_DEFAULT: default: - ds_put_cstr(string, "Unknown\n"); + ds_put_format(string, "Unknown (%d)\n", miss); break; } } @@ -1035,8 +980,10 @@ ds_put_format(string, " table_id=%"PRIu8, pm.table_id); } - ds_put_cstr(string, ", flow_miss_config="); - ofp_print_table_miss_config(string, pm.config); + if (pm.miss_config != OFPUTIL_TABLE_MISS_DEFAULT) { + ds_put_cstr(string, ", flow_miss_config="); + ofp_print_table_miss_config(string, pm.miss_config); + } } static void @@ -1374,9 +1321,9 @@ ds_put_format(string, " %s\n", ofperr_get_name(error)); if (error == OFPERR_OFPHFC_INCOMPATIBLE || error == OFPERR_OFPHFC_EPERM) { - ds_put_printable(string, ofpbuf_data(&payload), ofpbuf_size(&payload)); + ds_put_printable(string, payload.data, payload.size); } else { - s = ofp_to_string(ofpbuf_data(&payload), ofpbuf_size(&payload), 1); + s = ofp_to_string(payload.data, payload.size, 1); ds_put_cstr(string, s); free(s); } @@ -1468,6 +1415,9 @@ if (fs->flags) { ofp_print_flow_flags(string, fs->flags); } + if (fs->importance != 0) { + ds_put_format(string, "importance=%"PRIu16", ", fs->importance); + } if (fs->idle_age >= 0) { ds_put_format(string, "idle_age=%d, ", fs->idle_age); } @@ -1613,216 +1563,27 @@ } static void -ofp_print_one_ofpst_table_reply(struct ds *string, enum ofp_version ofp_version, - const char *name, struct ofp12_table_stats *ts) -{ - char name_[OFP_MAX_TABLE_NAME_LEN + 1]; - - /* ofp13_table_stats is different */ - if (ofp_version > OFP12_VERSION) { - return; - } - - ovs_strlcpy(name_, name, sizeof name_); - - ds_put_format(string, " %d: %-8s: ", ts->table_id, name_); - ds_put_format(string, "wild=0x%05"PRIx64", ", ntohll(ts->wildcards)); - ds_put_format(string, "max=%6"PRIu32", ", ntohl(ts->max_entries)); - ds_put_format(string, "active=%"PRIu32"\n", ntohl(ts->active_count)); - ds_put_cstr(string, " "); - ds_put_format(string, "lookup=%"PRIu64", ", ntohll(ts->lookup_count)); - ds_put_format(string, "matched=%"PRIu64"\n", ntohll(ts->matched_count)); - - if (ofp_version < OFP11_VERSION) { - return; - } - - ds_put_cstr(string, " "); - ds_put_format(string, "match=0x%08"PRIx64", ", ntohll(ts->match)); - ds_put_format(string, "instructions=0x%08"PRIx32", ", - ntohl(ts->instructions)); - ds_put_format(string, "config=0x%08"PRIx32"\n", ntohl(ts->config)); - ds_put_cstr(string, " "); - ds_put_format(string, "write_actions=0x%08"PRIx32", ", - ntohl(ts->write_actions)); - ds_put_format(string, "apply_actions=0x%08"PRIx32"\n", - ntohl(ts->apply_actions)); - - if (ofp_version < OFP12_VERSION) { - return; - } - - ds_put_cstr(string, " "); - ds_put_format(string, "write_setfields=0x%016"PRIx64"\n", - ntohll(ts->write_setfields)); - ds_put_cstr(string, " "); - ds_put_format(string, "apply_setfields=0x%016"PRIx64"\n", - ntohll(ts->apply_setfields)); - ds_put_cstr(string, " "); - ds_put_format(string, "metadata_match=0x%016"PRIx64"\n", - ntohll(ts->metadata_match)); - ds_put_cstr(string, " "); - ds_put_format(string, "metadata_write=0x%016"PRIx64"\n", - ntohll(ts->metadata_write)); -} - -static void -ofp_print_ofpst_table_reply13(struct ds *string, const struct ofp_header *oh, - int verbosity) -{ - struct ofp13_table_stats *ts; - struct ofpbuf b; - size_t n; - - ofpbuf_use_const(&b, oh, ntohs(oh->length)); - ofpraw_pull_assert(&b); - - n = ofpbuf_size(&b) / sizeof *ts; - ds_put_format(string, " %"PRIuSIZE" tables\n", n); - if (verbosity < 1) { - return; - } - - for (;;) { - ts = ofpbuf_try_pull(&b, sizeof *ts); - if (!ts) { - return; - } - ds_put_format(string, - " %d: active=%"PRIu32", lookup=%"PRIu64 \ - ", matched=%"PRIu64"\n", - ts->table_id, ntohl(ts->active_count), - ntohll(ts->lookup_count), ntohll(ts->matched_count)); - } -} - -static void -ofp_print_ofpst_table_reply12(struct ds *string, const struct ofp_header *oh, - int verbosity) -{ - struct ofp12_table_stats *ts; - struct ofpbuf b; - size_t n; - - ofpbuf_use_const(&b, oh, ntohs(oh->length)); - ofpraw_pull_assert(&b); - - n = ofpbuf_size(&b) / sizeof *ts; - ds_put_format(string, " %"PRIuSIZE" tables\n", n); - if (verbosity < 1) { - return; - } - - for (;;) { - ts = ofpbuf_try_pull(&b, sizeof *ts); - if (!ts) { - return; - } - - ofp_print_one_ofpst_table_reply(string, OFP12_VERSION, ts->name, ts); - } -} - -static void -ofp_print_ofpst_table_reply11(struct ds *string, const struct ofp_header *oh, - int verbosity) -{ - struct ofp11_table_stats *ts; - struct ofpbuf b; - size_t n; - - ofpbuf_use_const(&b, oh, ntohs(oh->length)); - ofpraw_pull_assert(&b); - - n = ofpbuf_size(&b) / sizeof *ts; - ds_put_format(string, " %"PRIuSIZE" tables\n", n); - if (verbosity < 1) { - return; - } - - for (;;) { - struct ofp12_table_stats ts12; - - ts = ofpbuf_try_pull(&b, sizeof *ts); - if (!ts) { - return; - } - - ts12.table_id = ts->table_id; - ts12.wildcards = htonll(ntohl(ts->wildcards)); - ts12.max_entries = ts->max_entries; - ts12.active_count = ts->active_count; - ts12.lookup_count = ts->lookup_count; - ts12.matched_count = ts->matched_count; - ts12.match = htonll(ntohl(ts->match)); - ts12.instructions = ts->instructions; - ts12.config = ts->config; - ts12.write_actions = ts->write_actions; - ts12.apply_actions = ts->apply_actions; - ofp_print_one_ofpst_table_reply(string, OFP11_VERSION, ts->name, &ts12); - } -} - -static void -ofp_print_ofpst_table_reply10(struct ds *string, const struct ofp_header *oh, - int verbosity) +ofp_print_table_stats_reply(struct ds *string, const struct ofp_header *oh) { - struct ofp10_table_stats *ts; struct ofpbuf b; - size_t n; ofpbuf_use_const(&b, oh, ntohs(oh->length)); ofpraw_pull_assert(&b); - n = ofpbuf_size(&b) / sizeof *ts; - ds_put_format(string, " %"PRIuSIZE" tables\n", n); - if (verbosity < 1) { - return; - } - for (;;) { - struct ofp12_table_stats ts12; + struct ofputil_table_features features; + struct ofputil_table_stats stats; + int retval; - ts = ofpbuf_try_pull(&b, sizeof *ts); - if (!ts) { + retval = ofputil_decode_table_stats_reply(&b, &stats, &features); + if (retval) { + if (retval != EOF) { + ofp_print_error(string, retval); + } return; } - ts12.table_id = ts->table_id; - ts12.wildcards = htonll(ntohl(ts->wildcards)); - ts12.max_entries = ts->max_entries; - ts12.active_count = ts->active_count; - ts12.lookup_count = get_32aligned_be64(&ts->lookup_count); - ts12.matched_count = get_32aligned_be64(&ts->matched_count); - ofp_print_one_ofpst_table_reply(string, OFP10_VERSION, ts->name, &ts12); - } -} - -static void -ofp_print_ofpst_table_reply(struct ds *string, const struct ofp_header *oh, - int verbosity) -{ - switch ((enum ofp_version)oh->version) { - case OFP15_VERSION: - case OFP14_VERSION: - case OFP13_VERSION: - ofp_print_ofpst_table_reply13(string, oh, verbosity); - break; - - case OFP12_VERSION: - ofp_print_ofpst_table_reply12(string, oh, verbosity); - break; - - case OFP11_VERSION: - ofp_print_ofpst_table_reply11(string, oh, verbosity); - break; - - case OFP10_VERSION: - ofp_print_ofpst_table_reply10(string, oh, verbosity); - break; - - default: - OVS_NOT_REACHED(); + ofp_print_table_features(string, &features, &stats); } } @@ -1929,23 +1690,14 @@ } static void -ofp_print_stats_request(struct ds *string, const struct ofp_header *oh) -{ - uint16_t flags = ofpmp_flags(oh); - - if (flags) { - ds_put_format(string, " ***unknown flags 0x%04"PRIx16"***", flags); - } -} - -static void -ofp_print_stats_reply(struct ds *string, const struct ofp_header *oh) +ofp_print_stats(struct ds *string, const struct ofp_header *oh) { uint16_t flags = ofpmp_flags(oh); if (flags) { ds_put_cstr(string, " flags="); - if (flags & OFPSF_REPLY_MORE) { + if ((!ofpmsg_is_stat_request(oh) || oh->version >= OFP13_VERSION) + && (flags & OFPSF_REPLY_MORE)) { ds_put_cstr(string, "[more]"); flags &= ~OFPSF_REPLY_MORE; } @@ -2341,22 +2093,78 @@ } static void +ofp_print_bucket_id(struct ds *s, const char *label, uint32_t bucket_id, + enum ofp_version ofp_version) +{ + if (ofp_version < OFP15_VERSION) { + return; + } + + ds_put_cstr(s, label); + + switch (bucket_id) { + case OFPG15_BUCKET_FIRST: + ds_put_cstr(s, "first"); + break; + case OFPG15_BUCKET_LAST: + ds_put_cstr(s, "last"); + break; + case OFPG15_BUCKET_ALL: + ds_put_cstr(s, "all"); + break; + default: + ds_put_format(s, "%"PRIu32, bucket_id); + break; + } + + ds_put_char(s, ','); +} + +static void ofp_print_group(struct ds *s, uint32_t group_id, uint8_t type, - struct list *p_buckets) + struct ovs_list *p_buckets, struct ofputil_group_props *props, + enum ofp_version ofp_version, bool suppress_type) { - static const char *type_str[] = { "all", "select", "indirect", - "ff", "unknown" }; struct ofputil_bucket *bucket; - ds_put_format(s, "group_id=%"PRIu32",type=%s", - group_id, type_str[type > 4 ? 4 : type]); + ds_put_format(s, "group_id=%"PRIu32, group_id); + + if (!suppress_type) { + static const char *type_str[] = { "all", "select", "indirect", + "ff", "unknown" }; + ds_put_format(s, ",type=%s", type_str[type > 4 ? 4 : type]); + } + + if (props->selection_method[0]) { + size_t mark, start; + + ds_put_format(s, ",selection_method=%s,", props->selection_method); + if (props->selection_method_param) { + ds_put_format(s, "selection_method_param=%"PRIu64",", + props->selection_method_param); + } + + /* Allow rewinding to immediately before the trailing ',' */ + mark = s->length - 1; + + ds_put_cstr(s, "fields="); + start = s->length; + oxm_format_field_array(s, &props->fields); + if (s->length == start) { + ds_truncate(s, mark); + } + } + if (!p_buckets) { return; } + ds_put_char(s, ','); + LIST_FOR_EACH (bucket, list_node, p_buckets) { - ds_put_cstr(s, ",bucket="); + ds_put_cstr(s, "bucket="); + ofp_print_bucket_id(s, "bucket_id:", bucket->bucket_id, ofp_version); if (bucket->weight != 1) { ds_put_format(s, "weight:%"PRIu16",", bucket->weight); } @@ -2369,7 +2177,10 @@ ds_put_cstr(s, "actions="); ofpacts_format(bucket->ofpacts, bucket->ofpacts_len, s); + ds_put_char(s, ','); } + + ds_chomp(s, ','); } static void @@ -2401,7 +2212,8 @@ ds_put_char(s, '\n'); ds_put_char(s, ' '); - ofp_print_group(s, gd.group_id, gd.type, &gd.buckets); + ofp_print_group(s, gd.group_id, gd.type, &gd.buckets, &gd.props, + oh->version, false); ofputil_bucket_list_destroy(&gd.buckets); } } @@ -2468,10 +2280,23 @@ } } +static const char * +group_type_to_string(enum ofp11_group_type type) +{ + switch (type) { + case OFPGT11_ALL: return "all"; + case OFPGT11_SELECT: return "select"; + case OFPGT11_INDIRECT: return "indirect"; + case OFPGT11_FF: return "fast failover"; + default: OVS_NOT_REACHED(); + } +} + static void ofp_print_group_features(struct ds *string, const struct ofp_header *oh) { struct ofputil_group_features features; + int i; ofputil_decode_group_features_reply(oh, &features); @@ -2480,32 +2305,15 @@ ds_put_format(string, " Capabilities: 0x%"PRIx32"\n", features.capabilities); - if (features.types & (1u << OFPGT11_ALL)) { - ds_put_format(string, " All group :\n"); - ds_put_format(string, - " max_groups = %#"PRIx32" actions=0x%08"PRIx32"\n", - features.max_groups[0], features.actions[0]); - } - - if (features.types & (1u << OFPGT11_SELECT)) { - ds_put_format(string, " Select group :\n"); - ds_put_format(string, " max_groups = %#"PRIx32" " - "actions=0x%08"PRIx32"\n", - features.max_groups[1], features.actions[1]); - } - - if (features.types & (1u << OFPGT11_INDIRECT)) { - ds_put_format(string, " Indirect group :\n"); - ds_put_format(string, " max_groups = %#"PRIx32" " - "actions=0x%08"PRIx32"\n", - features.max_groups[2], features.actions[2]); - } - - if (features.types & (1u << OFPGT11_FF)) { - ds_put_format(string, " Fast Failover group :\n"); - ds_put_format(string, " max_groups = %#"PRIx32" " - "actions=0x%08"PRIx32"\n", - features.max_groups[3], features.actions[3]); + for (i = 0; i < OFPGT12_N_TYPES; i++) { + if (features.types & (1u << i)) { + ds_put_format(string, " %s group:\n", group_type_to_string(i)); + ds_put_format(string, " max_groups=%#"PRIx32"\n", + features.max_groups[i]); + ds_put_format(string, " actions: "); + ofpact_bitmap_format(features.ofpacts[i], string); + ds_put_char(string, '\n'); + } } } @@ -2514,6 +2322,7 @@ { struct ofputil_group_mod gm; int error; + bool bucket_command = false; error = ofputil_decode_group_mod(oh, &gm); if (error) { @@ -2537,57 +2346,64 @@ ds_put_cstr(s, "DEL"); break; + case OFPGC15_INSERT_BUCKET: + ds_put_cstr(s, "INSERT_BUCKET"); + bucket_command = true; + break; + + case OFPGC15_REMOVE_BUCKET: + ds_put_cstr(s, "REMOVE_BUCKET"); + bucket_command = true; + break; + default: ds_put_format(s, "cmd:%"PRIu16"", gm.command); } ds_put_char(s, ' '); - ofp_print_group(s, gm.group_id, gm.type, &gm.buckets); - ofputil_bucket_list_destroy(&gm.buckets); -} - -static const char * -ofp13_action_to_string(uint32_t bit) -{ - switch (bit) { -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case 1u << ENUM: return NAME; -#include "ofp-util.def" + if (bucket_command) { + ofp_print_bucket_id(s, "command_bucket_id:", + gm.command_bucket_id, oh->version); } - return NULL; + + ofp_print_group(s, gm.group_id, gm.type, &gm.buckets, &gm.props, + oh->version, bucket_command); + ofputil_bucket_list_destroy(&gm.buckets); } static void print_table_action_features(struct ds *s, const struct ofputil_table_action_features *taf) { - ds_put_cstr(s, " actions: "); - ofp_print_bit_names(s, taf->actions, ofp13_action_to_string, ','); - ds_put_char(s, '\n'); + if (taf->ofpacts) { + ds_put_cstr(s, " actions: "); + ofpact_bitmap_format(taf->ofpacts, s); + ds_put_char(s, '\n'); + } - ds_put_cstr(s, " supported on Set-Field: "); - if (taf->set_fields) { + if (!bitmap_is_all_zeros(taf->set_fields.bm, MFF_N_IDS)) { int i; - for (i = 0; i < MFF_N_IDS; i++) { - uint64_t bit = UINT64_C(1) << i; - - if (taf->set_fields & bit) { - ds_put_format(s, "%s,", mf_from_id(i)->name); - } + ds_put_cstr(s, " supported on Set-Field:"); + BITMAP_FOR_EACH_1 (i, MFF_N_IDS, taf->set_fields.bm) { + ds_put_format(s, " %s", mf_from_id(i)->name); } - ds_chomp(s, ','); - } else { - ds_put_cstr(s, "none"); + ds_put_char(s, '\n'); } - ds_put_char(s, '\n'); } static bool table_action_features_equal(const struct ofputil_table_action_features *a, const struct ofputil_table_action_features *b) { - return a->actions == b->actions && a->set_fields == b->set_fields; + return (a->ofpacts == b->ofpacts + && bitmap_equal(a->set_fields.bm, b->set_fields.bm, MFF_N_IDS)); +} + +static bool +table_action_features_empty(const struct ofputil_table_action_features *taf) +{ + return !taf->ofpacts && bitmap_is_all_zeros(taf->set_fields.bm, MFF_N_IDS); } static void @@ -2596,24 +2412,26 @@ { int start, end; - ds_put_cstr(s, " next tables: "); - for (start = bitmap_scan(tif->next, 1, 0, 255); start < 255; - start = bitmap_scan(tif->next, 1, end, 255)) { - end = bitmap_scan(tif->next, 0, start + 1, 255); - if (end == start + 1) { - ds_put_format(s, "%d,", start); - } else { - ds_put_format(s, "%d-%d,", start, end - 1); + if (!bitmap_is_all_zeros(tif->next, 255)) { + ds_put_cstr(s, " next tables: "); + for (start = bitmap_scan(tif->next, 1, 0, 255); start < 255; + start = bitmap_scan(tif->next, 1, end, 255)) { + end = bitmap_scan(tif->next, 0, start + 1, 255); + if (end == start + 1) { + ds_put_format(s, "%d,", start); + } else { + ds_put_format(s, "%d-%d,", start, end - 1); + } } + ds_chomp(s, ','); + if (ds_last(s) == ' ') { + ds_put_cstr(s, "none"); + } + ds_put_char(s, '\n'); } - ds_chomp(s, ','); - if (ds_last(s) == ' ') { - ds_put_cstr(s, "none"); - } - ds_put_char(s, '\n'); - ds_put_cstr(s, " instructions: "); if (tif->instructions) { + ds_put_cstr(s, " instructions: "); int i; for (i = 0; i < 32; i++) { @@ -2622,19 +2440,18 @@ } } ds_chomp(s, ','); - } else { - ds_put_cstr(s, "none"); + ds_put_char(s, '\n'); } - ds_put_char(s, '\n'); - if (table_action_features_equal(&tif->write, &tif->apply)) { - ds_put_cstr(s, " Write-Actions and Apply-Actions features:\n"); - print_table_action_features(s, &tif->write); - } else { + if (!table_action_features_equal(&tif->write, &tif->apply)) { ds_put_cstr(s, " Write-Actions features:\n"); print_table_action_features(s, &tif->write); ds_put_cstr(s, " Apply-Actions features:\n"); print_table_action_features(s, &tif->apply); + } else if (tif->write.ofpacts + || !bitmap_is_all_zeros(tif->write.set_fields.bm, MFF_N_IDS)) { + ds_put_cstr(s, " Write-Actions and Apply-Actions features:\n"); + print_table_action_features(s, &tif->write); } } @@ -2649,8 +2466,77 @@ && table_action_features_equal(&a->apply, &b->apply)); } +static bool +table_instruction_features_empty( + const struct ofputil_table_instruction_features *tif) +{ + return (bitmap_is_all_zeros(tif->next, 255) + && !tif->instructions + && table_action_features_empty(&tif->write) + && table_action_features_empty(&tif->apply)); +} + static void -ofp_print_table_features(struct ds *s, const struct ofp_header *oh) +ofp_print_table_features(struct ds *s, + const struct ofputil_table_features *features, + const struct ofputil_table_stats *stats) +{ + int i; + + ds_put_format(s, "\n table %"PRIu8, features->table_id); + if (features->name[0]) { + ds_put_format(s, " (\"%s\")", features->name); + } + ds_put_cstr(s, ":\n"); + if (stats) { + ds_put_format(s, " active=%"PRIu32", ", stats->active_count); + ds_put_format(s, "lookup=%"PRIu64", ", stats->lookup_count); + ds_put_format(s, "matched=%"PRIu64"\n", stats->matched_count); + } + if (features->metadata_match || features->metadata_match) { + ds_put_format(s, " metadata: match=%#"PRIx64" write=%#"PRIx64"\n", + ntohll(features->metadata_match), + ntohll(features->metadata_write)); + } + + if (features->miss_config != OFPUTIL_TABLE_MISS_DEFAULT) { + ds_put_cstr(s, " config="); + ofp_print_table_miss_config(s, features->miss_config); + } + + if (features->max_entries) { + ds_put_format(s, " max_entries=%"PRIu32"\n", features->max_entries); + } + + if (!table_instruction_features_equal(&features->nonmiss, + &features->miss)) { + ds_put_cstr(s, " instructions (other than table miss):\n"); + print_table_instruction_features(s, &features->nonmiss); + ds_put_cstr(s, " instructions (table miss):\n"); + print_table_instruction_features(s, &features->miss); + } else if (!table_instruction_features_empty(&features->nonmiss)) { + ds_put_cstr(s, " instructions (table miss and others):\n"); + print_table_instruction_features(s, &features->nonmiss); + } + + if (!bitmap_is_all_zeros(features->match.bm, MFF_N_IDS)){ + ds_put_cstr(s, " matching:\n"); + BITMAP_FOR_EACH_1 (i, MFF_N_IDS, features->match.bm) { + const struct mf_field *f = mf_from_id(i); + bool mask = bitmap_is_set(features->mask.bm, i); + bool wildcard = bitmap_is_set(features->wildcard.bm, i); + + ds_put_format(s, " %s: %s\n", + f->name, + (mask ? "arbitrary mask" + : wildcard ? "exact match or wildcard" + : "must exact match")); + } + } +} + +static void +ofp_print_table_features_reply(struct ds *s, const struct ofp_header *oh) { struct ofpbuf b; @@ -2659,7 +2545,6 @@ for (;;) { struct ofputil_table_features tf; int retval; - int i; retval = ofputil_decode_table_features(&b, &tf, true); if (retval) { @@ -2668,41 +2553,7 @@ } return; } - - ds_put_format(s, "\n table %"PRIu8":\n", tf.table_id); - ds_put_format(s, " name=\"%s\"\n", tf.name); - ds_put_format(s, " metadata: match=%#"PRIx64" write=%#"PRIx64"\n", - ntohll(tf.metadata_match), ntohll(tf.metadata_write)); - - ds_put_cstr(s, " config="); - ofp_print_table_miss_config(s, tf.config); - - ds_put_format(s, " max_entries=%"PRIu32"\n", tf.max_entries); - - if (table_instruction_features_equal(&tf.nonmiss, &tf.miss)) { - ds_put_cstr(s, " instructions (table miss and others):\n"); - print_table_instruction_features(s, &tf.nonmiss); - } else { - ds_put_cstr(s, " instructions (other than table miss):\n"); - print_table_instruction_features(s, &tf.nonmiss); - ds_put_cstr(s, " instructions (table miss):\n"); - print_table_instruction_features(s, &tf.miss); - } - - ds_put_cstr(s, " matching:\n"); - for (i = 0; i < MFF_N_IDS; i++) { - uint64_t bit = UINT64_C(1) << i; - - if (tf.match & bit) { - const struct mf_field *f = mf_from_id(i); - - ds_put_format(s, " %s: %s\n", - f->name, - (tf.mask ? "arbitrary mask" - : tf.wildcard ? "exact match or wildcard" - : "must exact match")); - } - } + ofp_print_table_features(s, &tf, NULL); } } @@ -2772,7 +2623,7 @@ struct ofputil_bundle_add_msg badd; char *msg; - error = ofputil_decode_bundle_add(oh, &badd); + error = ofputil_decode_bundle_add(oh, &badd, NULL); if (error) { ofp_print_error(s, error); return; @@ -2800,7 +2651,7 @@ switch (ofptype_from_ofpraw(raw)) { case OFPTYPE_GROUP_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_group_request(string, oh); break; @@ -2809,7 +2660,7 @@ break; case OFPTYPE_GROUP_DESC_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_group_desc_request(string, oh); break; @@ -2818,7 +2669,7 @@ break; case OFPTYPE_GROUP_FEATURES_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); break; case OFPTYPE_GROUP_FEATURES_STATS_REPLY: @@ -2831,7 +2682,7 @@ case OFPTYPE_TABLE_FEATURES_STATS_REQUEST: case OFPTYPE_TABLE_FEATURES_STATS_REPLY: - ofp_print_table_features(string, oh); + ofp_print_table_features_reply(string, oh); break; case OFPTYPE_HELLO: @@ -2916,87 +2767,87 @@ case OFPTYPE_METER_STATS_REQUEST: case OFPTYPE_METER_CONFIG_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); ofp_print_meter_stats_request(string, oh); break; case OFPTYPE_METER_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_meter_stats_reply(string, oh); break; case OFPTYPE_METER_CONFIG_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_meter_config_reply(string, oh); break; case OFPTYPE_METER_FEATURES_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_meter_features_reply(string, oh); break; case OFPTYPE_DESC_STATS_REQUEST: case OFPTYPE_METER_FEATURES_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); break; case OFPTYPE_FLOW_STATS_REQUEST: case OFPTYPE_AGGREGATE_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); ofp_print_flow_stats_request(string, oh); break; case OFPTYPE_TABLE_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); break; case OFPTYPE_PORT_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_port_request(string, oh); break; case OFPTYPE_QUEUE_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_queue_request(string, oh); break; case OFPTYPE_DESC_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_desc_reply(string, oh); break; case OFPTYPE_FLOW_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_flow_stats_reply(string, oh); break; case OFPTYPE_QUEUE_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_queue_reply(string, oh, verbosity); break; case OFPTYPE_PORT_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_port_reply(string, oh, verbosity); break; case OFPTYPE_TABLE_STATS_REPLY: - ofp_print_stats_reply(string, oh); - ofp_print_ofpst_table_reply(string, oh, verbosity); + ofp_print_stats(string, oh); + ofp_print_table_stats_reply(string, oh); break; case OFPTYPE_AGGREGATE_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_aggregate_stats_reply(string, oh); break; case OFPTYPE_PORT_DESC_STATS_REQUEST: - ofp_print_stats_request(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_port_desc_request(string, oh); break; case OFPTYPE_PORT_DESC_STATS_REPLY: - ofp_print_stats_reply(string, oh); + ofp_print_stats(string, oh); ofp_print_ofpst_port_desc_reply(string, oh); break; diff -Nru openvswitch-2.3.1/lib/ofp-util.c openvswitch-2.4.0~git20150623/lib/ofp-util.c --- openvswitch-2.3.1/lib/ofp-util.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-util.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,16 +32,18 @@ #include "multipath.h" #include "netdev.h" #include "nx-match.h" +#include "id-pool.h" #include "ofp-actions.h" #include "ofp-errors.h" #include "ofp-msgs.h" #include "ofp-util.h" #include "ofpbuf.h" +#include "openflow/netronome-ext.h" #include "packets.h" #include "random.h" #include "unaligned.h" #include "type-props.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #include "bitmap.h" VLOG_DEFINE_THIS_MODULE(ofp_util); @@ -50,41 +52,72 @@ * in the peer and so there's not much point in showing a lot of them. */ static struct vlog_rate_limit bad_ofmsg_rl = VLOG_RATE_LIMIT_INIT(1, 5); +static enum ofputil_table_miss ofputil_table_miss_from_config( + ovs_be32 config_, enum ofp_version); + struct ofp_prop_header { ovs_be16 type; ovs_be16 len; }; +struct ofp_prop_experimenter { + ovs_be16 type; /* OFP*_EXPERIMENTER. */ + ovs_be16 length; /* Length in bytes of this property. */ + ovs_be32 experimenter; /* Experimenter ID which takes the same form as + * in struct ofp_experimenter_header. */ + ovs_be32 exp_type; /* Experimenter defined. */ +}; + /* Pulls a property, beginning with struct ofp_prop_header, from the beginning * of 'msg'. Stores the type of the property in '*typep' and, if 'property' is * nonnull, the entire property, including the header, in '*property'. Returns - * 0 if successful, otherwise an error code. */ + * 0 if successful, otherwise an error code. + * + * This function pulls the property's stated size padded out to a multiple of + * 'alignment' bytes. The common case in OpenFlow is an 'alignment' of 8, so + * you can use ofputil_pull_property() for that case. */ static enum ofperr -ofputil_pull_property(struct ofpbuf *msg, struct ofpbuf *property, - uint16_t *typep) +ofputil_pull_property__(struct ofpbuf *msg, struct ofpbuf *property, + unsigned int alignment, uint16_t *typep) { struct ofp_prop_header *oph; + unsigned int padded_len; unsigned int len; - if (ofpbuf_size(msg) < sizeof *oph) { + if (msg->size < sizeof *oph) { return OFPERR_OFPBPC_BAD_LEN; } - oph = ofpbuf_data(msg); + oph = msg->data; len = ntohs(oph->len); - if (len < sizeof *oph || ROUND_UP(len, 8) > ofpbuf_size(msg)) { + padded_len = ROUND_UP(len, alignment); + if (len < sizeof *oph || padded_len > msg->size) { return OFPERR_OFPBPC_BAD_LEN; } *typep = ntohs(oph->type); if (property) { - ofpbuf_use_const(property, ofpbuf_data(msg), len); + ofpbuf_use_const(property, msg->data, len); } - ofpbuf_pull(msg, ROUND_UP(len, 8)); + ofpbuf_pull(msg, padded_len); return 0; } -static void PRINTF_FORMAT(2, 3) +/* Pulls a property, beginning with struct ofp_prop_header, from the beginning + * of 'msg'. Stores the type of the property in '*typep' and, if 'property' is + * nonnull, the entire property, including the header, in '*property'. Returns + * 0 if successful, otherwise an error code. + * + * This function pulls the property's stated size padded out to a multiple of + * 8 bytes, which is the common case for OpenFlow properties. */ +static enum ofperr +ofputil_pull_property(struct ofpbuf *msg, struct ofpbuf *property, + uint16_t *typep) +{ + return ofputil_pull_property__(msg, property, 8, typep); +} + +static void OVS_PRINTF_FORMAT(2, 3) log_property(bool loose, const char *message, ...) { enum vlog_level level = loose ? VLL_DBG : VLL_WARN; @@ -97,6 +130,36 @@ } } +static size_t +start_property(struct ofpbuf *msg, uint16_t type) +{ + size_t start_ofs = msg->size; + struct ofp_prop_header *oph; + + oph = ofpbuf_put_uninit(msg, sizeof *oph); + oph->type = htons(type); + oph->len = htons(4); /* May be updated later by end_property(). */ + return start_ofs; +} + +static void +end_property(struct ofpbuf *msg, size_t start_ofs) +{ + struct ofp_prop_header *oph; + + oph = ofpbuf_at_assert(msg, start_ofs, sizeof *oph); + oph->len = htons(msg->size - start_ofs); + ofpbuf_padto(msg, ROUND_UP(msg->size, 8)); +} + +static void +put_bitmap_properties(struct ofpbuf *msg, uint64_t bitmap) +{ + for (; bitmap; bitmap = zero_rightmost_1bit(bitmap)) { + start_property(msg, rightmost_1bit_idx(bitmap)); + } +} + /* Given the wildcard bit count in the least-significant 6 of 'wcbits', returns * an IP netmask with a 1 in each bit that must match and a 0 in each bit that * is wildcarded. @@ -132,7 +195,7 @@ void ofputil_wildcard_from_ofpfw10(uint32_t ofpfw, struct flow_wildcards *wc) { - BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26); + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); /* Initialize most of wc. */ flow_wildcards_init_catchall(wc); @@ -312,10 +375,10 @@ ofputil_pull_ofp11_match(struct ofpbuf *buf, struct match *match, uint16_t *padded_match_len) { - struct ofp11_match_header *omh = ofpbuf_data(buf); + struct ofp11_match_header *omh = buf->data; uint16_t match_len; - if (ofpbuf_size(buf) < sizeof *omh) { + if (buf->size < sizeof *omh) { return OFPERR_OFPBMC_BAD_LEN; } @@ -325,7 +388,7 @@ case OFPMT_STANDARD: { struct ofp11_match *om; - if (match_len != sizeof *om || ofpbuf_size(buf) < sizeof *om) { + if (match_len != sizeof *om || buf->size < sizeof *om) { return OFPERR_OFPBMC_BAD_LEN; } om = ofpbuf_pull(buf, sizeof *om); @@ -1299,15 +1362,15 @@ ofpbuf_pull(&msg, sizeof *oh); *allowed_versions = version_bitmap_from_version(oh->version); - while (ofpbuf_size(&msg)) { + while (msg.size) { const struct ofp_hello_elem_header *oheh; unsigned int len; - if (ofpbuf_size(&msg) < sizeof *oheh) { + if (msg.size < sizeof *oheh) { return false; } - oheh = ofpbuf_data(&msg); + oheh = msg.data; len = ntohs(oheh->length); if (len < sizeof *oheh || !ofpbuf_try_pull(&msg, ROUND_UP(len, 8))) { return false; @@ -1596,6 +1659,9 @@ struct ofpbuf b; enum ofpraw raw; + /* Ignored for non-delete actions */ + fm->delete_reason = OFPRR_DELETE; + ofpbuf_use_const(&b, oh, ntohs(oh->length)); raw = ofpraw_pull_assert(&b); if (raw == OFPRAW_OFPT11_FLOW_MOD) { @@ -1609,12 +1675,6 @@ return error; } - error = ofpacts_pull_openflow_instructions(&b, ofpbuf_size(&b), oh->version, - ofpacts); - if (error) { - return error; - } - /* Translate the message. */ fm->priority = ntohs(ofm->priority); if (ofm->command == OFPFC_ADD @@ -1650,6 +1710,11 @@ fm->idle_timeout = ntohs(ofm->idle_timeout); fm->hard_timeout = ntohs(ofm->hard_timeout); + if (oh->version >= OFP14_VERSION && ofm->command == OFPFC_ADD) { + fm->importance = ntohs(ofm->importance); + } else { + fm->importance = 0; + } fm->buffer_id = ntohl(ofm->buffer_id); error = ofputil_port_from_ofp11(ofm->out_port, &fm->out_port); if (error) { @@ -1675,13 +1740,6 @@ ofputil_match_from_ofp10_match(&ofm->match, &fm->match); ofputil_normalize_match(&fm->match); - /* Now get the actions. */ - error = ofpacts_pull_openflow_actions(&b, ofpbuf_size(&b), oh->version, - ofpacts); - if (error) { - return error; - } - /* OpenFlow 1.0 says that exact-match rules have to have the * highest possible priority. */ fm->priority = (ofm->match.wildcards & htonl(OFPFW10_ALL) @@ -1695,6 +1753,7 @@ fm->new_cookie = ofm->cookie; fm->idle_timeout = ntohs(ofm->idle_timeout); fm->hard_timeout = ntohs(ofm->hard_timeout); + fm->importance = 0; fm->buffer_id = ntohl(ofm->buffer_id); fm->out_port = u16_to_ofp(ntohs(ofm->out_port)); fm->out_group = OFPG11_ANY; @@ -1710,11 +1769,6 @@ if (error) { return error; } - error = ofpacts_pull_openflow_actions(&b, ofpbuf_size(&b), oh->version, - ofpacts); - if (error) { - return error; - } /* Translate the message. */ command = ntohs(nfm->command); @@ -1727,6 +1781,7 @@ fm->new_cookie = nfm->cookie; fm->idle_timeout = ntohs(nfm->idle_timeout); fm->hard_timeout = ntohs(nfm->hard_timeout); + fm->importance = 0; fm->buffer_id = ntohl(nfm->buffer_id); fm->out_port = u16_to_ofp(ntohs(nfm->out_port)); fm->out_group = OFPG11_ANY; @@ -1740,13 +1795,26 @@ fm->command = command & 0xff; fm->table_id = command >> 8; } else { + if (command > 0xff) { + VLOG_WARN_RL(&bad_ofmsg_rl, "flow_mod has explicit table_id " + "but flow_mod_table_id extension is not enabled"); + } fm->command = command; fm->table_id = 0xff; } } - fm->ofpacts = ofpbuf_data(ofpacts); - fm->ofpacts_len = ofpbuf_size(ofpacts); + if (fm->command > OFPFC_DELETE_STRICT) { + return OFPERR_OFPFMFC_BAD_COMMAND; + } + + error = ofpacts_pull_openflow_instructions(&b, b.size, + oh->version, ofpacts); + if (error) { + return error; + } + fm->ofpacts = ofpacts->data; + fm->ofpacts_len = ofpacts->size; error = ofputil_decode_flow_mod_flags(raw_flags, fm->command, oh->version, &fm->flags); @@ -1844,9 +1912,9 @@ mm->meter.flags & OFPMF13_PKTPS) { return OFPERR_OFPMMFC_BAD_FLAGS; } - mm->meter.bands = ofpbuf_data(bands); + mm->meter.bands = bands->data; - error = ofputil_pull_bands(&b, ofpbuf_size(&b), &mm->meter.n_bands, bands); + error = ofputil_pull_bands(&b, b.size, &mm->meter.n_bands, bands); if (error) { return error; } @@ -1918,25 +1986,25 @@ /* Encode a meter stat for 'mc' and append it to 'replies'. */ void -ofputil_append_meter_config(struct list *replies, +ofputil_append_meter_config(struct ovs_list *replies, const struct ofputil_meter_config *mc) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); - size_t start_ofs = ofpbuf_size(msg); + size_t start_ofs = msg->size; struct ofp13_meter_config *reply = ofpbuf_put_uninit(msg, sizeof *reply); reply->flags = htons(mc->flags); reply->meter_id = htonl(mc->meter_id); ofputil_put_bands(mc->n_bands, mc->bands, msg); - reply->length = htons(ofpbuf_size(msg) - start_ofs); + reply->length = htons(msg->size - start_ofs); ofpmp_postappend(replies, start_ofs); } /* Encode a meter stat for 'ms' and append it to 'replies'. */ void -ofputil_append_meter_stats(struct list *replies, +ofputil_append_meter_stats(struct ovs_list *replies, const struct ofputil_meter_stats *ms) { struct ofp13_meter_stats *reply; @@ -1984,11 +2052,11 @@ enum ofperr err; /* Pull OpenFlow headers for the first call. */ - if (!msg->frame) { + if (!msg->header) { ofpraw_pull_assert(msg); } - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } @@ -1996,7 +2064,7 @@ if (!omc) { VLOG_WARN_RL(&bad_ofmsg_rl, "OFPMP_METER_CONFIG reply has %"PRIu32" leftover bytes at end", - ofpbuf_size(msg)); + msg->size); return OFPERR_OFPBRC_BAD_LEN; } @@ -2008,7 +2076,7 @@ } mc->meter_id = ntohl(omc->meter_id); mc->flags = ntohs(omc->flags); - mc->bands = ofpbuf_data(bands); + mc->bands = bands->data; return 0; } @@ -2060,11 +2128,11 @@ enum ofperr err; /* Pull OpenFlow headers for the first call. */ - if (!msg->frame) { + if (!msg->header) { ofpraw_pull_assert(msg); } - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } @@ -2072,7 +2140,7 @@ if (!oms) { VLOG_WARN_RL(&bad_ofmsg_rl, "OFPMP_METER reply has %"PRIu32" leftover bytes at end", - ofpbuf_size(msg)); + msg->size); return OFPERR_OFPBRC_BAD_LEN; } @@ -2088,7 +2156,7 @@ ms->byte_in_count = ntohll(oms->byte_in_count); ms->duration_sec = ntohl(oms->duration_sec); ms->duration_nsec = ntohl(oms->duration_nsec); - ms->bands = ofpbuf_data(bands); + ms->bands = bands->data; return 0; } @@ -2186,7 +2254,7 @@ || fm->command == OFPFC_ADD) { ofm->cookie = fm->new_cookie; } else { - ofm->cookie = fm->cookie; + ofm->cookie = fm->cookie & fm->cookie_mask; } ofm->cookie_mask = fm->cookie_mask; if (fm->table_id != OFPTT_ALL @@ -2205,6 +2273,11 @@ ofm->out_port = ofputil_port_to_ofp11(fm->out_port); ofm->out_group = htonl(fm->out_group); ofm->flags = raw_flags; + if (version >= OFP14_VERSION && fm->command == OFPFC_ADD) { + ofm->importance = htons(fm->importance); + } else { + ofm->importance = 0; + } ofputil_put_ofp11_match(msg, &fm->match, protocol); ofpacts_put_openflow_instructions(fm->ofpacts, fm->ofpacts_len, msg, version); @@ -2243,7 +2316,7 @@ nfm->command = ofputil_tid_command(fm, protocol); nfm->cookie = fm->new_cookie; match_len = nx_put_match(msg, &fm->match, fm->cookie, fm->cookie_mask); - nfm = ofpbuf_l3(msg); + nfm = msg->msg; nfm->idle_timeout = htons(fm->idle_timeout); nfm->hard_timeout = htons(fm->hard_timeout); nfm->priority = htons(fm->priority); @@ -2317,7 +2390,7 @@ if (error) { return error; } - if (ofpbuf_size(b)) { + if (b->size) { return OFPERR_OFPBRC_BAD_LEN; } @@ -2373,12 +2446,12 @@ switch ((int) raw) { case OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST: - qgcr10 = ofpbuf_data(&b); + qgcr10 = b.data; *port = u16_to_ofp(ntohs(qgcr10->port)); return 0; case OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST: - qgcr11 = ofpbuf_data(&b); + qgcr11 = b.data; return ofputil_port_from_ofp11(qgcr11->port, port); } @@ -2447,36 +2520,36 @@ ofputil_append_queue_get_config_reply(struct ofpbuf *reply, const struct ofputil_queue_config *oqc) { - const struct ofp_header *oh = ofpbuf_data(reply); + const struct ofp_header *oh = reply->data; size_t start_ofs, len_ofs; ovs_be16 *len; - start_ofs = ofpbuf_size(reply); + start_ofs = reply->size; if (oh->version < OFP12_VERSION) { struct ofp10_packet_queue *opq10; opq10 = ofpbuf_put_zeros(reply, sizeof *opq10); opq10->queue_id = htonl(oqc->queue_id); - len_ofs = (char *) &opq10->len - (char *) ofpbuf_data(reply); + len_ofs = (char *) &opq10->len - (char *) reply->data; } else { struct ofp11_queue_get_config_reply *qgcr11; struct ofp12_packet_queue *opq12; ovs_be32 port; - qgcr11 = ofpbuf_l3(reply); + qgcr11 = reply->msg; port = qgcr11->port; opq12 = ofpbuf_put_zeros(reply, sizeof *opq12); opq12->port = port; opq12->queue_id = htonl(oqc->queue_id); - len_ofs = (char *) &opq12->len - (char *) ofpbuf_data(reply); + len_ofs = (char *) &opq12->len - (char *) reply->data; } put_queue_rate(reply, OFPQT_MIN_RATE, oqc->min_rate); put_queue_rate(reply, OFPQT_MAX_RATE, oqc->max_rate); len = ofpbuf_at(reply, len_ofs, sizeof *len); - *len = htons(ofpbuf_size(reply) - start_ofs); + *len = htons(reply->size - start_ofs); } /* Decodes the initial part of an OFPT_QUEUE_GET_CONFIG_REPLY from 'reply' and @@ -2535,14 +2608,14 @@ unsigned int opq_len; unsigned int len; - if (!ofpbuf_size(reply)) { + if (!reply->size) { return EOF; } queue->min_rate = UINT16_MAX; queue->max_rate = UINT16_MAX; - oh = reply->frame; + oh = reply->header; if (oh->version < OFP12_VERSION) { const struct ofp10_packet_queue *opq10; @@ -2565,7 +2638,7 @@ opq_len = sizeof *opq12; } - if (len < opq_len || len > ofpbuf_size(reply) + opq_len || len % 8) { + if (len < opq_len || len > reply->size + opq_len || len % 8) { return OFPERR_OFPBRC_BAD_LEN; } len -= opq_len; @@ -2578,7 +2651,7 @@ hdr = ofpbuf_at_assert(reply, 0, sizeof *hdr); prop_len = ntohs(hdr->len); - if (prop_len < sizeof *hdr || prop_len > ofpbuf_size(reply) || prop_len % 8) { + if (prop_len < sizeof *hdr || prop_len > reply->size || prop_len % 8) { return OFPERR_OFPBRC_BAD_LEN; } @@ -2620,10 +2693,10 @@ raw = ofpraw_pull_assert(&b); switch ((int) raw) { case OFPRAW_OFPST10_FLOW_REQUEST: - return ofputil_decode_ofpst10_flow_request(fsr, ofpbuf_data(&b), false); + return ofputil_decode_ofpst10_flow_request(fsr, b.data, false); case OFPRAW_OFPST10_AGGREGATE_REQUEST: - return ofputil_decode_ofpst10_flow_request(fsr, ofpbuf_data(&b), true); + return ofputil_decode_ofpst10_flow_request(fsr, b.data, true); case OFPRAW_OFPST11_FLOW_REQUEST: return ofputil_decode_ofpst11_flow_request(fsr, &b, false); @@ -2704,7 +2777,7 @@ match_len = nx_put_match(msg, &fsr->match, fsr->cookie, fsr->cookie_mask); - nfsr = ofpbuf_l3(msg); + nfsr = msg->msg; nfsr->out_port = htons(ofp_to_u16(fsr->out_port)); nfsr->match_len = htons(match_len); nfsr->table_id = fsr->table_id; @@ -2745,18 +2818,18 @@ struct ofpbuf *ofpacts) { const struct ofp_header *oh; + size_t instructions_len; enum ofperr error; enum ofpraw raw; - error = (msg->frame - ? ofpraw_decode(&raw, msg->frame) + error = (msg->header ? ofpraw_decode(&raw, msg->header) : ofpraw_pull(&raw, msg)); if (error) { return error; } - oh = msg->frame; + oh = msg->header; - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } else if (raw == OFPRAW_OFPST11_FLOW_REPLY || raw == OFPRAW_OFPST13_FLOW_REPLY) { @@ -2767,7 +2840,7 @@ ofs = ofpbuf_try_pull(msg, sizeof *ofs); if (!ofs) { VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply has %"PRIu32" leftover " - "bytes at end", ofpbuf_size(msg)); + "bytes at end", msg->size); return EINVAL; } @@ -2782,13 +2855,7 @@ VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply bad match"); return EINVAL; } - - if (ofpacts_pull_openflow_instructions(msg, length - sizeof *ofs - - padded_match_len, oh->version, - ofpacts)) { - VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply bad instructions"); - return EINVAL; - } + instructions_len = length - sizeof *ofs - padded_match_len; fs->priority = ntohs(ofs->priority); fs->table_id = ofs->table_id; @@ -2796,6 +2863,11 @@ fs->duration_nsec = ntohl(ofs->duration_nsec); fs->idle_timeout = ntohs(ofs->idle_timeout); fs->hard_timeout = ntohs(ofs->hard_timeout); + if (oh->version >= OFP14_VERSION) { + fs->importance = ntohs(ofs->importance); + } else { + fs->importance = 0; + } if (raw == OFPRAW_OFPST13_FLOW_REPLY) { error = ofputil_decode_flow_mod_flags(ofs->flags, -1, oh->version, &fs->flags); @@ -2817,7 +2889,7 @@ ofs = ofpbuf_try_pull(msg, sizeof *ofs); if (!ofs) { VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply has %"PRIu32" leftover " - "bytes at end", ofpbuf_size(msg)); + "bytes at end", msg->size); return EINVAL; } @@ -2827,11 +2899,7 @@ "length %"PRIuSIZE, length); return EINVAL; } - - if (ofpacts_pull_openflow_actions(msg, length - sizeof *ofs, - oh->version, ofpacts)) { - return EINVAL; - } + instructions_len = length - sizeof *ofs; fs->cookie = get_32aligned_be64(&ofs->cookie); ofputil_match_from_ofp10_match(&ofs->match, &fs->match); @@ -2841,6 +2909,7 @@ fs->duration_nsec = ntohl(ofs->duration_nsec); fs->idle_timeout = ntohs(ofs->idle_timeout); fs->hard_timeout = ntohs(ofs->hard_timeout); + fs->importance = 0; fs->idle_age = -1; fs->hard_age = -1; fs->packet_count = ntohll(get_32aligned_be64(&ofs->packet_count)); @@ -2848,12 +2917,12 @@ fs->flags = 0; } else if (raw == OFPRAW_NXST_FLOW_REPLY) { const struct nx_flow_stats *nfs; - size_t match_len, actions_len, length; + size_t match_len, length; nfs = ofpbuf_try_pull(msg, sizeof *nfs); if (!nfs) { VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW reply has %"PRIu32" leftover " - "bytes at end", ofpbuf_size(msg)); + "bytes at end", msg->size); return EINVAL; } @@ -2867,12 +2936,7 @@ if (nx_pull_match(msg, match_len, &fs->match, NULL, NULL)) { return EINVAL; } - - actions_len = length - sizeof *nfs - ROUND_UP(match_len, 8); - if (ofpacts_pull_openflow_actions(msg, actions_len, oh->version, - ofpacts)) { - return EINVAL; - } + instructions_len = length - sizeof *nfs - ROUND_UP(match_len, 8); fs->cookie = nfs->cookie; fs->table_id = nfs->table_id; @@ -2881,6 +2945,7 @@ fs->priority = ntohs(nfs->priority); fs->idle_timeout = ntohs(nfs->idle_timeout); fs->hard_timeout = ntohs(nfs->hard_timeout); + fs->importance = 0; fs->idle_age = -1; fs->hard_age = -1; if (flow_age_extension) { @@ -2898,8 +2963,13 @@ OVS_NOT_REACHED(); } - fs->ofpacts = ofpbuf_data(ofpacts); - fs->ofpacts_len = ofpbuf_size(ofpacts); + if (ofpacts_pull_openflow_instructions(msg, instructions_len, oh->version, + ofpacts)) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply bad instructions"); + return EINVAL; + } + fs->ofpacts = ofpacts->data; + fs->ofpacts_len = ofpacts->size; return 0; } @@ -2919,10 +2989,10 @@ * have been initialized with ofpmp_init(). */ void ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *fs, - struct list *replies) + struct ovs_list *replies) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); - size_t start_ofs = ofpbuf_size(reply); + size_t start_ofs = reply->size; enum ofp_version version = ofpmp_version(replies); enum ofpraw raw = ofpmp_decode_raw(replies); @@ -2935,7 +3005,7 @@ version); ofs = ofpbuf_at_assert(reply, start_ofs, sizeof *ofs); - ofs->length = htons(ofpbuf_size(reply) - start_ofs); + ofs->length = htons(reply->size - start_ofs); ofs->table_id = fs->table_id; ofs->pad = 0; ofs->duration_sec = htonl(fs->duration_sec); @@ -2943,6 +3013,11 @@ ofs->priority = htons(fs->priority); ofs->idle_timeout = htons(fs->idle_timeout); ofs->hard_timeout = htons(fs->hard_timeout); + if (version >= OFP14_VERSION) { + ofs->importance = htons(fs->importance); + } else { + ofs->importance = 0; + } if (raw == OFPRAW_OFPST13_FLOW_REPLY) { ofs->flags = ofputil_encode_flow_mod_flags(fs->flags, version); } else { @@ -2959,7 +3034,7 @@ ofpacts_put_openflow_actions(fs->ofpacts, fs->ofpacts_len, reply, version); ofs = ofpbuf_at_assert(reply, start_ofs, sizeof *ofs); - ofs->length = htons(ofpbuf_size(reply) - start_ofs); + ofs->length = htons(reply->size - start_ofs); ofs->table_id = fs->table_id; ofs->pad = 0; ofputil_match_to_ofp10_match(&fs->match, &ofs->match); @@ -2983,7 +3058,7 @@ ofpacts_put_openflow_actions(fs->ofpacts, fs->ofpacts_len, reply, version); nfs = ofpbuf_at_assert(reply, start_ofs, sizeof *nfs); - nfs->length = htons(ofpbuf_size(reply) - start_ofs); + nfs->length = htons(reply->size - start_ofs); nfs->table_id = fs->table_id; nfs->pad = 0; nfs->duration_sec = htonl(fs->duration_sec); @@ -3049,7 +3124,7 @@ ofpbuf_use_const(&msg, reply, ntohs(reply->length)); ofpraw_pull_assert(&msg); - asr = ofpbuf_l3(&msg); + asr = msg.msg; stats->packet_count = ntohll(get_32aligned_be64(&asr->packet_count)); stats->byte_count = ntohll(get_32aligned_be64(&asr->byte_count)); stats->flow_count = ntohl(asr->flow_count); @@ -3116,7 +3191,7 @@ if (error) { return error; } - if (ofpbuf_size(&b)) { + if (b.size) { return OFPERR_OFPBRC_BAD_LEN; } @@ -3145,6 +3220,11 @@ enum ofputil_protocol protocol) { struct ofpbuf *msg; + enum ofp_flow_removed_reason reason = fr->reason; + + if (reason == OFPRR_METER_DELETE && !(protocol & OFPUTIL_P_OF14_UP)) { + reason = OFPRR_DELETE; + } switch (protocol) { case OFPUTIL_P_OF11_STD: @@ -3161,7 +3241,7 @@ ofr = ofpbuf_put_zeros(msg, sizeof *ofr); ofr->cookie = fr->cookie; ofr->priority = htons(fr->priority); - ofr->reason = fr->reason; + ofr->reason = reason; ofr->table_id = fr->table_id; ofr->duration_sec = htonl(fr->duration_sec); ofr->duration_nsec = htonl(fr->duration_nsec); @@ -3183,7 +3263,7 @@ ofputil_match_to_ofp10_match(&fr->match, &ofr->match); ofr->cookie = fr->cookie; ofr->priority = htons(fr->priority); - ofr->reason = fr->reason; + ofr->reason = reason; ofr->duration_sec = htonl(fr->duration_sec); ofr->duration_nsec = htonl(fr->duration_nsec); ofr->idle_timeout = htons(fr->idle_timeout); @@ -3199,13 +3279,13 @@ msg = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_REMOVED, OFP10_VERSION, htonl(0), NXM_TYPICAL_LEN); - nfr = ofpbuf_put_zeros(msg, sizeof *nfr); + ofpbuf_put_zeros(msg, sizeof *nfr); match_len = nx_put_match(msg, &fr->match, 0, 0); - nfr = ofpbuf_l3(msg); + nfr = msg->msg; nfr->cookie = fr->cookie; nfr->priority = htons(fr->priority); - nfr->reason = fr->reason; + nfr->reason = reason; nfr->table_id = fr->table_id + 1; nfr->duration_sec = htonl(fr->duration_sec); nfr->duration_nsec = htonl(fr->duration_nsec); @@ -3223,22 +3303,6 @@ return msg; } -static void -ofputil_decode_packet_in_finish(struct ofputil_packet_in *pin, - struct match *match, struct ofpbuf *b) -{ - pin->packet = ofpbuf_data(b); - pin->packet_len = ofpbuf_size(b); - - pin->fmd.in_port = match->flow.in_port.ofp_port; - pin->fmd.tun_id = match->flow.tunnel.tun_id; - pin->fmd.tun_src = match->flow.tunnel.ip_src; - pin->fmd.tun_dst = match->flow.tunnel.ip_dst; - pin->fmd.metadata = match->flow.metadata; - memcpy(pin->fmd.regs, match->flow.regs, sizeof pin->fmd.regs); - pin->fmd.pkt_mark = match->flow.pkt_mark; -} - enum ofperr ofputil_decode_packet_in(struct ofputil_packet_in *pin, const struct ofp_header *oh) @@ -3253,7 +3317,6 @@ raw = ofpraw_pull_assert(&b); if (raw == OFPRAW_OFPT13_PACKET_IN || raw == OFPRAW_OFPT12_PACKET_IN) { const struct ofp13_packet_in *opi; - struct match match; int error; size_t packet_in_size; @@ -3264,7 +3327,7 @@ } opi = ofpbuf_pull(&b, packet_in_size); - error = oxm_pull_match_loose(&b, &match); + error = oxm_pull_match_loose(&b, &pin->flow_metadata); if (error) { return error; } @@ -3282,44 +3345,48 @@ pin->cookie = opi->cookie; } - ofputil_decode_packet_in_finish(pin, &match, &b); + pin->packet = b.data; + pin->packet_len = b.size; } else if (raw == OFPRAW_OFPT10_PACKET_IN) { const struct ofp10_packet_in *opi; opi = ofpbuf_pull(&b, offsetof(struct ofp10_packet_in, data)); pin->packet = opi->data; - pin->packet_len = ofpbuf_size(&b); + pin->packet_len = b.size; - pin->fmd.in_port = u16_to_ofp(ntohs(opi->in_port)); + match_init_catchall(&pin->flow_metadata); + match_set_in_port(&pin->flow_metadata, u16_to_ofp(ntohs(opi->in_port))); pin->reason = opi->reason; pin->buffer_id = ntohl(opi->buffer_id); pin->total_len = ntohs(opi->total_len); } else if (raw == OFPRAW_OFPT11_PACKET_IN) { const struct ofp11_packet_in *opi; + ofp_port_t in_port; enum ofperr error; opi = ofpbuf_pull(&b, sizeof *opi); - pin->packet = ofpbuf_data(&b); - pin->packet_len = ofpbuf_size(&b); + pin->packet = b.data; + pin->packet_len = b.size; pin->buffer_id = ntohl(opi->buffer_id); - error = ofputil_port_from_ofp11(opi->in_port, &pin->fmd.in_port); + error = ofputil_port_from_ofp11(opi->in_port, &in_port); if (error) { return error; } + match_init_catchall(&pin->flow_metadata); + match_set_in_port(&pin->flow_metadata, in_port); pin->total_len = ntohs(opi->total_len); pin->reason = opi->reason; pin->table_id = opi->table_id; } else if (raw == OFPRAW_NXT_PACKET_IN) { const struct nx_packet_in *npi; - struct match match; int error; npi = ofpbuf_pull(&b, sizeof *npi); - error = nx_pull_match_loose(&b, ntohs(npi->match_len), &match, NULL, - NULL); + error = nx_pull_match_loose(&b, ntohs(npi->match_len), + &pin->flow_metadata, NULL, NULL); if (error) { return error; } @@ -3335,7 +3402,8 @@ pin->buffer_id = ntohl(npi->buffer_id); pin->total_len = ntohs(npi->total_len); - ofputil_decode_packet_in_finish(pin, &match, &b); + pin->packet = b.data; + pin->packet_len = b.size; } else { OVS_NOT_REACHED(); } @@ -3343,39 +3411,6 @@ return 0; } -static void -ofputil_packet_in_to_match(const struct ofputil_packet_in *pin, - struct match *match) -{ - int i; - - match_init_catchall(match); - if (pin->fmd.tun_id != htonll(0)) { - match_set_tun_id(match, pin->fmd.tun_id); - } - if (pin->fmd.tun_src != htonl(0)) { - match_set_tun_src(match, pin->fmd.tun_src); - } - if (pin->fmd.tun_dst != htonl(0)) { - match_set_tun_dst(match, pin->fmd.tun_dst); - } - if (pin->fmd.metadata != htonll(0)) { - match_set_metadata(match, pin->fmd.metadata); - } - - for (i = 0; i < FLOW_N_REGS; i++) { - if (pin->fmd.regs[i]) { - match_set_reg(match, i, pin->fmd.regs[i]); - } - } - - if (pin->fmd.pkt_mark != 0) { - match_set_pkt_mark(match, pin->fmd.pkt_mark); - } - - match_set_in_port(match, pin->fmd.in_port); -} - static struct ofpbuf * ofputil_encode_ofp10_packet_in(const struct ofputil_packet_in *pin) { @@ -3386,7 +3421,7 @@ htonl(0), pin->packet_len); opi = ofpbuf_put_zeros(packet, offsetof(struct ofp10_packet_in, data)); opi->total_len = htons(pin->total_len); - opi->in_port = htons(ofp_to_u16(pin->fmd.in_port)); + opi->in_port = htons(ofp_to_u16(pin->flow_metadata.flow.in_port.ofp_port)); opi->reason = pin->reason; opi->buffer_id = htonl(pin->buffer_id); @@ -3400,21 +3435,17 @@ { struct nx_packet_in *npi; struct ofpbuf *packet; - struct match match; size_t match_len; - ofputil_packet_in_to_match(pin, &match); - /* The final argument is just an estimate of the space required. */ packet = ofpraw_alloc_xid(OFPRAW_NXT_PACKET_IN, OFP10_VERSION, - htonl(0), (sizeof(struct flow_metadata) * 2 - + 2 + pin->packet_len)); + htonl(0), NXM_TYPICAL_LEN + 2 + pin->packet_len); ofpbuf_put_zeros(packet, sizeof *npi); - match_len = nx_put_match(packet, &match, 0, 0); + match_len = nx_put_match(packet, &pin->flow_metadata, 0, 0); ofpbuf_put_zeros(packet, 2); ofpbuf_put(packet, pin->packet, pin->packet_len); - npi = ofpbuf_l3(packet); + npi = packet->msg; npi->buffer_id = htonl(pin->buffer_id); npi->total_len = htons(pin->total_len); npi->reason = pin->reason; @@ -3435,7 +3466,7 @@ htonl(0), pin->packet_len); opi = ofpbuf_put_zeros(packet, sizeof *opi); opi->buffer_id = htonl(pin->buffer_id); - opi->in_port = ofputil_port_to_ofp11(pin->fmd.in_port); + opi->in_port = ofputil_port_to_ofp11(pin->flow_metadata.flow.in_port.ofp_port); opi->in_phy_port = opi->in_port; opi->total_len = htons(pin->total_len); opi->reason = pin->reason; @@ -3451,7 +3482,6 @@ enum ofputil_protocol protocol) { struct ofp13_packet_in *opi; - struct match match; enum ofpraw packet_in_raw; enum ofp_version packet_in_version; size_t packet_in_size; @@ -3463,27 +3493,25 @@ packet_in_size = sizeof (struct ofp12_packet_in); } else { packet_in_raw = OFPRAW_OFPT13_PACKET_IN; - packet_in_version = OFP13_VERSION; + packet_in_version = ofputil_protocol_to_ofp_version(protocol); packet_in_size = sizeof (struct ofp13_packet_in); } - ofputil_packet_in_to_match(pin, &match); - /* The final argument is just an estimate of the space required. */ packet = ofpraw_alloc_xid(packet_in_raw, packet_in_version, - htonl(0), (sizeof(struct flow_metadata) * 2 - + 2 + pin->packet_len)); + htonl(0), NXM_TYPICAL_LEN + 2 + pin->packet_len); ofpbuf_put_zeros(packet, packet_in_size); - oxm_put_match(packet, &match, ofputil_protocol_to_ofp_version(protocol)); + oxm_put_match(packet, &pin->flow_metadata, + ofputil_protocol_to_ofp_version(protocol)); ofpbuf_put_zeros(packet, 2); ofpbuf_put(packet, pin->packet, pin->packet_len); - opi = ofpbuf_l3(packet); + opi = packet->msg; opi->pi.buffer_id = htonl(pin->buffer_id); opi->pi.total_len = htons(pin->total_len); opi->pi.reason = pin->reason; opi->pi.table_id = pin->table_id; - if (protocol == OFPUTIL_P_OF13_OXM) { + if (protocol != OFPUTIL_P_OF12_OXM) { opi->cookie = pin->cookie; } @@ -3542,6 +3570,12 @@ return "action"; case OFPR_INVALID_TTL: return "invalid_ttl"; + case OFPR_ACTION_SET: + return "action_set"; + case OFPR_GROUP: + return "group"; + case OFPR_PACKET_OUT: + return "packet_out"; case OFPR_N_REASONS: default: @@ -3628,12 +3662,12 @@ return OFPERR_OFPBRC_BAD_PORT; } - po->ofpacts = ofpbuf_data(ofpacts); - po->ofpacts_len = ofpbuf_size(ofpacts); + po->ofpacts = ofpacts->data; + po->ofpacts_len = ofpacts->size; if (po->buffer_id == UINT32_MAX) { - po->packet = ofpbuf_data(&b); - po->packet_len = ofpbuf_size(&b); + po->packet = b.data; + po->packet_len = b.size; } else { po->packet = NULL; po->packet_len = 0; @@ -3755,9 +3789,9 @@ parse_ofp14_port_ethernet_property(const struct ofpbuf *payload, struct ofputil_phy_port *pp) { - struct ofp14_port_desc_prop_ethernet *eth = ofpbuf_data(payload); + struct ofp14_port_desc_prop_ethernet *eth = payload->data; - if (ofpbuf_size(payload) != sizeof *eth) { + if (payload->size != sizeof *eth) { return OFPERR_OFPBPC_BAD_LEN; } @@ -3786,7 +3820,7 @@ } len = ntohs(op->length); - if (len < sizeof *op || len - sizeof *op > ofpbuf_size(msg)) { + if (len < sizeof *op || len - sizeof *op > msg->size) { return OFPERR_OFPBRC_BAD_LEN; } len -= sizeof *op; @@ -3802,7 +3836,7 @@ pp->config = ntohl(op->config) & OFPPC11_ALL; pp->state = ntohl(op->state) & OFPPS11_ALL; - while (ofpbuf_size(&properties) > 0) { + while (properties.size > 0) { struct ofpbuf payload; enum ofperr error; uint16_t type; @@ -3984,10 +4018,10 @@ void ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp, - struct list *replies) + struct ovs_list *replies) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); - size_t start_ofs = ofpbuf_size(reply); + size_t start_ofs = reply->size; ofputil_put_phy_port(ofpmp_version(replies), pp, reply); ofpmp_postappend(replies, start_ofs); @@ -4004,46 +4038,10 @@ BUILD_ASSERT_DECL((int) OFPUTIL_C_QUEUE_STATS == OFPC_QUEUE_STATS); BUILD_ASSERT_DECL((int) OFPUTIL_C_ARP_MATCH_IP == OFPC_ARP_MATCH_IP); -struct ofputil_action_bit_translation { - enum ofputil_action_bitmap ofputil_bit; - int of_bit; -}; - -static const struct ofputil_action_bit_translation of10_action_bits[] = { - { OFPUTIL_A_OUTPUT, OFPAT10_OUTPUT }, - { OFPUTIL_A_SET_VLAN_VID, OFPAT10_SET_VLAN_VID }, - { OFPUTIL_A_SET_VLAN_PCP, OFPAT10_SET_VLAN_PCP }, - { OFPUTIL_A_STRIP_VLAN, OFPAT10_STRIP_VLAN }, - { OFPUTIL_A_SET_DL_SRC, OFPAT10_SET_DL_SRC }, - { OFPUTIL_A_SET_DL_DST, OFPAT10_SET_DL_DST }, - { OFPUTIL_A_SET_NW_SRC, OFPAT10_SET_NW_SRC }, - { OFPUTIL_A_SET_NW_DST, OFPAT10_SET_NW_DST }, - { OFPUTIL_A_SET_NW_TOS, OFPAT10_SET_NW_TOS }, - { OFPUTIL_A_SET_TP_SRC, OFPAT10_SET_TP_SRC }, - { OFPUTIL_A_SET_TP_DST, OFPAT10_SET_TP_DST }, - { OFPUTIL_A_ENQUEUE, OFPAT10_ENQUEUE }, - { 0, 0 }, -}; - -static enum ofputil_action_bitmap -decode_action_bits(ovs_be32 of_actions, - const struct ofputil_action_bit_translation *x) -{ - enum ofputil_action_bitmap ofputil_actions; - - ofputil_actions = 0; - for (; x->ofputil_bit; x++) { - if (of_actions & htonl(1u << x->of_bit)) { - ofputil_actions |= x->ofputil_bit; - } - } - return ofputil_actions; -} - static uint32_t ofputil_capabilities_mask(enum ofp_version ofp_version) { - /* Handle capabilities whose bit is unique for all Open Flow versions */ + /* Handle capabilities whose bit is unique for all OpenFlow versions */ switch (ofp_version) { case OFP10_VERSION: case OFP11_VERSION: @@ -4088,13 +4086,14 @@ if (osf->capabilities & htonl(OFPC10_STP)) { features->capabilities |= OFPUTIL_C_STP; } - features->actions = decode_action_bits(osf->actions, of10_action_bits); + features->ofpacts = ofpact_bitmap_from_openflow(osf->actions, + OFP10_VERSION); } else if (raw == OFPRAW_OFPT11_FEATURES_REPLY || raw == OFPRAW_OFPT13_FEATURES_REPLY) { if (osf->capabilities & htonl(OFPC11_GROUP_STATS)) { features->capabilities |= OFPUTIL_C_GROUP_STATS; } - features->actions = 0; + features->ofpacts = 0; if (raw == OFPRAW_OFPT13_FEATURES_REPLY) { features->auxiliary_id = osf->auxiliary_id; } @@ -4120,7 +4119,7 @@ bool ofputil_switch_features_has_ports(struct ofpbuf *b) { - struct ofp_header *oh = ofpbuf_data(b); + struct ofp_header *oh = b->data; size_t phy_port_size; if (oh->version >= OFP13_VERSION) { @@ -4140,26 +4139,11 @@ /* The feature reply has no room for more ports. Probably the list is * truncated. Drop the ports and tell the caller to retrieve them with * OFPST_PORT_DESC. */ - ofpbuf_set_size(b, sizeof *oh + sizeof(struct ofp_switch_features)); + b->size = sizeof *oh + sizeof(struct ofp_switch_features); ofpmsg_update_length(b); return false; } -static ovs_be32 -encode_action_bits(enum ofputil_action_bitmap ofputil_actions, - const struct ofputil_action_bit_translation *x) -{ - uint32_t of_actions; - - of_actions = 0; - for (; x->ofputil_bit; x++) { - if (ofputil_actions & x->ofputil_bit) { - of_actions |= 1 << x->of_bit; - } - } - return htonl(of_actions); -} - /* Returns a buffer owned by the caller that encodes 'features' in the format * required by 'protocol' with the given 'xid'. The caller should append port * information to the buffer with subsequent calls to @@ -4204,7 +4188,8 @@ if (features->capabilities & OFPUTIL_C_STP) { osf->capabilities |= htonl(OFPC10_STP); } - osf->actions = encode_action_bits(features->actions, of10_action_bits); + osf->actions = ofpact_bitmap_to_openflow(features->ofpacts, + OFP10_VERSION); break; case OFP13_VERSION: case OFP14_VERSION: @@ -4231,16 +4216,16 @@ ofputil_put_switch_features_port(const struct ofputil_phy_port *pp, struct ofpbuf *b) { - const struct ofp_header *oh = ofpbuf_data(b); + const struct ofp_header *oh = b->data; if (oh->version < OFP13_VERSION) { /* Try adding a port description to the message, but drop it again if * the buffer overflows. (This possibility for overflow is why * OpenFlow 1.3+ moved port descriptions into a multipart message.) */ - size_t start_ofs = ofpbuf_size(b); + size_t start_ofs = b->size; ofputil_put_phy_port(oh->version, pp, b); - if (ofpbuf_size(b) > UINT16_MAX) { - ofpbuf_set_size(b, start_ofs); + if (b->size > UINT16_MAX) { + b->size = start_ofs; } } } @@ -4320,9 +4305,9 @@ parse_port_mod_ethernet_property(struct ofpbuf *property, struct ofputil_port_mod *pm) { - struct ofp14_port_mod_prop_ethernet *eth = ofpbuf_data(property); + struct ofp14_port_mod_prop_ethernet *eth = property->data; - if (ofpbuf_size(property) != sizeof *eth) { + if (property->size != sizeof *eth) { return OFPERR_OFPBRC_BAD_LEN; } @@ -4343,7 +4328,7 @@ raw = ofpraw_pull_assert(&b); if (raw == OFPRAW_OFPT10_PORT_MOD) { - const struct ofp10_port_mod *opm = ofpbuf_data(&b); + const struct ofp10_port_mod *opm = b.data; pm->port_no = u16_to_ofp(ntohs(opm->port_no)); memcpy(pm->hw_addr, opm->hw_addr, ETH_ADDR_LEN); @@ -4351,7 +4336,7 @@ pm->mask = ntohl(opm->mask) & OFPPC10_ALL; pm->advertise = netdev_port_features_from_ofp10(opm->advertise); } else if (raw == OFPRAW_OFPT11_PORT_MOD) { - const struct ofp11_port_mod *opm = ofpbuf_data(&b); + const struct ofp11_port_mod *opm = b.data; enum ofperr error; error = ofputil_port_from_ofp11(opm->port_no, &pm->port_no); @@ -4378,7 +4363,7 @@ pm->config = ntohl(opm->config) & OFPPC11_ALL; pm->mask = ntohl(opm->mask) & OFPPC11_ALL; - while (ofpbuf_size(&b) > 0) { + while (b.size > 0) { struct ofpbuf property; enum ofperr error; uint16_t type; @@ -4481,10 +4466,12 @@ return b; } + +/* Table features. */ static enum ofperr pull_table_feature_property(struct ofpbuf *msg, struct ofpbuf *payload, - uint16_t *typep) + uint16_t *typep) { enum ofperr error; @@ -4496,20 +4483,25 @@ } static enum ofperr -parse_table_ids(struct ofpbuf *payload, uint32_t *ids) +parse_action_bitmap(struct ofpbuf *payload, enum ofp_version ofp_version, + uint64_t *ofpacts) { - uint16_t type; + uint32_t types = 0; + + while (payload->size > 0) { + uint16_t type; + enum ofperr error; - *ids = 0; - while (ofpbuf_size(payload) > 0) { - enum ofperr error = pull_table_feature_property(payload, NULL, &type); + error = ofputil_pull_property__(payload, NULL, 1, &type); if (error) { return error; } - if (type < CHAR_BIT * sizeof *ids) { - *ids |= 1u << type; + if (type < CHAR_BIT * sizeof types) { + types |= 1u << type; } } + + *ofpacts = ofpact_bitmap_from_openflow(htonl(types), ofp_version); return 0; } @@ -4517,12 +4509,21 @@ parse_instruction_ids(struct ofpbuf *payload, bool loose, uint32_t *insts) { *insts = 0; - while (ofpbuf_size(payload) > 0) { + while (payload->size > 0) { enum ovs_instruction_type inst; enum ofperr error; uint16_t ofpit; - error = pull_table_feature_property(payload, NULL, &ofpit); + /* OF1.3 and OF1.4 aren't clear about padding in the instruction IDs. + * It seems clear that they aren't padded to 8 bytes, though, because + * both standards say that "non-experimenter instructions are 4 bytes" + * and do not mention any padding before the first instruction ID. + * (There wouldn't be any point in padding to 8 bytes if the IDs were + * aligned on an odd 4-byte boundary.) + * + * Anyway, we just assume they're all glommed together on byte + * boundaries. */ + error = ofputil_pull_property__(payload, NULL, 1, &ofpit); if (error) { return error; } @@ -4544,8 +4545,8 @@ size_t i; memset(next_tables, 0, bitmap_n_bytes(255)); - for (i = 0; i < ofpbuf_size(payload); i++) { - uint8_t id = ((const uint8_t *) ofpbuf_data(payload))[i]; + for (i = 0; i < payload->size; i++) { + uint8_t id = ((const uint8_t *) payload->data)[i]; if (id >= 255) { return OFPERR_OFPBPC_BAD_VALUE; } @@ -4555,68 +4556,32 @@ } static enum ofperr -parse_oxm(struct ofpbuf *b, bool loose, - const struct mf_field **fieldp, bool *hasmask) -{ - ovs_be32 *oxmp; - uint32_t oxm; - - oxmp = ofpbuf_try_pull(b, sizeof *oxmp); - if (!oxmp) { - return OFPERR_OFPBPC_BAD_LEN; - } - oxm = ntohl(*oxmp); - - /* Determine '*hasmask'. If 'oxm' is masked, convert it to the equivalent - * unmasked version, because the table of OXM fields we support only has - * masked versions of fields that we support with masks, but we should be - * able to parse the masked versions of those here. */ - *hasmask = NXM_HASMASK(oxm); - if (*hasmask) { - if (NXM_LENGTH(oxm) & 1) { - return OFPERR_OFPBPC_BAD_VALUE; - } - oxm = NXM_HEADER(NXM_VENDOR(oxm), NXM_FIELD(oxm), NXM_LENGTH(oxm) / 2); - } - - *fieldp = mf_from_nxm_header(oxm); - if (!*fieldp) { - log_property(loose, "unknown OXM field %#"PRIx32, ntohl(*oxmp)); - } - return *fieldp ? 0 : OFPERR_OFPBMC_BAD_FIELD; -} - -static enum ofperr parse_oxms(struct ofpbuf *payload, bool loose, - uint64_t *exactp, uint64_t *maskedp) + struct mf_bitmap *exactp, struct mf_bitmap *maskedp) { - uint64_t exact, masked; + struct mf_bitmap exact = MF_BITMAP_INITIALIZER; + struct mf_bitmap masked = MF_BITMAP_INITIALIZER; - exact = masked = 0; - while (ofpbuf_size(payload) > 0) { + while (payload->size > 0) { const struct mf_field *field; enum ofperr error; bool hasmask; - error = parse_oxm(payload, loose, &field, &hasmask); + error = nx_pull_header(payload, &field, &hasmask); if (!error) { - if (hasmask) { - masked |= UINT64_C(1) << field->id; - } else { - exact |= UINT64_C(1) << field->id; - } + bitmap_set1(hasmask ? masked.bm : exact.bm, field->id); } else if (error != OFPERR_OFPBMC_BAD_FIELD || !loose) { return error; } } if (exactp) { *exactp = exact; - } else if (exact) { + } else if (!bitmap_is_all_zeros(exact.bm, MFF_N_IDS)) { return OFPERR_OFPBMC_BAD_MASK; } if (maskedp) { *maskedp = masked; - } else if (masked) { + } else if (!bitmap_is_all_zeros(masked.bm, MFF_N_IDS)) { return OFPERR_OFPBMC_BAD_MASK; } return 0; @@ -4642,27 +4607,33 @@ ofputil_decode_table_features(struct ofpbuf *msg, struct ofputil_table_features *tf, bool loose) { + const struct ofp_header *oh; struct ofp13_table_features *otf; + struct ofpbuf properties; unsigned int len; - if (!msg->frame) { + memset(tf, 0, sizeof *tf); + + if (!msg->header) { ofpraw_pull_assert(msg); } + oh = msg->header; - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } - if (ofpbuf_size(msg) < sizeof *otf) { + if (msg->size < sizeof *otf) { return OFPERR_OFPBPC_BAD_LEN; } - otf = ofpbuf_data(msg); + otf = msg->data; len = ntohs(otf->length); - if (len < sizeof *otf || len % 8 || len > ofpbuf_size(msg)) { + if (len < sizeof *otf || len % 8 || len > msg->size) { return OFPERR_OFPBPC_BAD_LEN; } - ofpbuf_pull(msg, sizeof *otf); + ofpbuf_use_const(&properties, ofpbuf_pull(msg, len), len); + ofpbuf_pull(&properties, sizeof *otf); tf->table_id = otf->table_id; if (tf->table_id == OFPTT_ALL) { @@ -4672,15 +4643,15 @@ ovs_strlcpy(tf->name, otf->name, OFP_MAX_TABLE_NAME_LEN); tf->metadata_match = otf->metadata_match; tf->metadata_write = otf->metadata_write; - tf->config = ntohl(otf->config); + tf->miss_config = ofputil_table_miss_from_config(otf->config, oh->version); tf->max_entries = ntohl(otf->max_entries); - while (ofpbuf_size(msg) > 0) { + while (properties.size > 0) { struct ofpbuf payload; enum ofperr error; uint16_t type; - error = pull_table_feature_property(msg, &payload, &type); + error = pull_table_feature_property(&properties, &payload, &type); if (error) { return error; } @@ -4704,17 +4675,21 @@ break; case OFPTFPT13_WRITE_ACTIONS: - error = parse_table_ids(&payload, &tf->nonmiss.write.actions); + error = parse_action_bitmap(&payload, oh->version, + &tf->nonmiss.write.ofpacts); break; case OFPTFPT13_WRITE_ACTIONS_MISS: - error = parse_table_ids(&payload, &tf->miss.write.actions); + error = parse_action_bitmap(&payload, oh->version, + &tf->miss.write.ofpacts); break; case OFPTFPT13_APPLY_ACTIONS: - error = parse_table_ids(&payload, &tf->nonmiss.apply.actions); + error = parse_action_bitmap(&payload, oh->version, + &tf->nonmiss.apply.ofpacts); break; case OFPTFPT13_APPLY_ACTIONS_MISS: - error = parse_table_ids(&payload, &tf->miss.apply.actions); + error = parse_action_bitmap(&payload, oh->version, + &tf->miss.apply.ofpacts); break; case OFPTFPT13_MATCH: @@ -4756,15 +4731,17 @@ /* Fix inconsistencies: * - * - Turn off 'mask' and 'wildcard' bits that are not in 'match', - * because a field must be matchable to be masked or wildcarded. + * - Turn on 'match' bits that are set in 'mask', because maskable + * fields are matchable. * * - Turn on 'wildcard' bits that are set in 'mask', because a field - * that is arbitrarily maskable can be wildcarded entirely. */ - tf->mask &= tf->match; - tf->wildcard &= tf->match; - - tf->wildcard |= tf->mask; + * that is arbitrarily maskable can be wildcarded entirely. + * + * - Turn off 'wildcard' bits that are not in 'match', because a field + * must be matchable for it to be meaningfully wildcarded. */ + bitmap_or(tf->match.bm, tf->mask.bm, MFF_N_IDS); + bitmap_or(tf->wildcard.bm, tf->mask.bm, MFF_N_IDS); + bitmap_and(tf->wildcard.bm, tf->match.bm, MFF_N_IDS); return 0; } @@ -4795,8 +4772,157 @@ return request; } +static void +put_fields_property(struct ofpbuf *reply, + const struct mf_bitmap *fields, + const struct mf_bitmap *masks, + enum ofp13_table_feature_prop_type property, + enum ofp_version version) +{ + size_t start_ofs; + int field; + + start_ofs = start_property(reply, property); + BITMAP_FOR_EACH_1 (field, MFF_N_IDS, fields->bm) { + nx_put_header(reply, field, version, + masks && bitmap_is_set(masks->bm, field)); + } + end_property(reply, start_ofs); +} + +static void +put_table_action_features(struct ofpbuf *reply, + const struct ofputil_table_action_features *taf, + enum ofp13_table_feature_prop_type actions_type, + enum ofp13_table_feature_prop_type set_fields_type, + int miss_offset, enum ofp_version version) +{ + size_t start_ofs; + + start_ofs = start_property(reply, actions_type + miss_offset); + put_bitmap_properties(reply, + ntohl(ofpact_bitmap_to_openflow(taf->ofpacts, + version))); + end_property(reply, start_ofs); + + put_fields_property(reply, &taf->set_fields, NULL, + set_fields_type + miss_offset, version); +} + +static void +put_table_instruction_features( + struct ofpbuf *reply, const struct ofputil_table_instruction_features *tif, + int miss_offset, enum ofp_version version) +{ + size_t start_ofs; + uint8_t table_id; + + start_ofs = start_property(reply, OFPTFPT13_INSTRUCTIONS + miss_offset); + put_bitmap_properties(reply, + ntohl(ovsinst_bitmap_to_openflow(tif->instructions, + version))); + end_property(reply, start_ofs); + + start_ofs = start_property(reply, OFPTFPT13_NEXT_TABLES + miss_offset); + BITMAP_FOR_EACH_1 (table_id, 255, tif->next) { + ofpbuf_put(reply, &table_id, 1); + } + end_property(reply, start_ofs); + + put_table_action_features(reply, &tif->write, + OFPTFPT13_WRITE_ACTIONS, + OFPTFPT13_WRITE_SETFIELD, miss_offset, version); + put_table_action_features(reply, &tif->apply, + OFPTFPT13_APPLY_ACTIONS, + OFPTFPT13_APPLY_SETFIELD, miss_offset, version); +} + +void +ofputil_append_table_features_reply(const struct ofputil_table_features *tf, + struct ovs_list *replies) +{ + struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); + enum ofp_version version = ofpmp_version(replies); + size_t start_ofs = reply->size; + struct ofp13_table_features *otf; + + otf = ofpbuf_put_zeros(reply, sizeof *otf); + otf->table_id = tf->table_id; + ovs_strlcpy(otf->name, tf->name, sizeof otf->name); + otf->metadata_match = tf->metadata_match; + otf->metadata_write = tf->metadata_write; + otf->config = ofputil_table_miss_to_config(tf->miss_config, version); + otf->max_entries = htonl(tf->max_entries); + + put_table_instruction_features(reply, &tf->nonmiss, 0, version); + put_table_instruction_features(reply, &tf->miss, 1, version); + + put_fields_property(reply, &tf->match, &tf->mask, + OFPTFPT13_MATCH, version); + put_fields_property(reply, &tf->wildcard, NULL, + OFPTFPT13_WILDCARDS, version); + + otf = ofpbuf_at_assert(reply, start_ofs, sizeof *otf); + otf->length = htons(reply->size - start_ofs); + ofpmp_postappend(replies, start_ofs); +} + /* ofputil_table_mod */ +/* Given 'config', taken from an OpenFlow 'version' message that specifies + * table configuration (a table mod, table stats, or table features message), + * returns the table miss configuration that it specifies. */ +static enum ofputil_table_miss +ofputil_table_miss_from_config(ovs_be32 config_, enum ofp_version version) +{ + uint32_t config = ntohl(config_); + + if (version < OFP13_VERSION) { + switch (config & OFPTC11_TABLE_MISS_MASK) { + case OFPTC11_TABLE_MISS_CONTROLLER: + return OFPUTIL_TABLE_MISS_CONTROLLER; + + case OFPTC11_TABLE_MISS_CONTINUE: + return OFPUTIL_TABLE_MISS_CONTINUE; + + case OFPTC11_TABLE_MISS_DROP: + return OFPUTIL_TABLE_MISS_DROP; + + default: + VLOG_WARN_RL(&bad_ofmsg_rl, "bad table miss config %d", config); + return OFPUTIL_TABLE_MISS_CONTROLLER; + } + } else { + return OFPUTIL_TABLE_MISS_DEFAULT; + } +} + +/* Given a table miss configuration, returns the corresponding OpenFlow table + * configuration for use in an OpenFlow message of the given 'version'. */ +ovs_be32 +ofputil_table_miss_to_config(enum ofputil_table_miss miss, + enum ofp_version version) +{ + if (version < OFP13_VERSION) { + switch (miss) { + case OFPUTIL_TABLE_MISS_CONTROLLER: + case OFPUTIL_TABLE_MISS_DEFAULT: + return htonl(OFPTC11_TABLE_MISS_CONTROLLER); + + case OFPUTIL_TABLE_MISS_CONTINUE: + return htonl(OFPTC11_TABLE_MISS_CONTINUE); + + case OFPUTIL_TABLE_MISS_DROP: + return htonl(OFPTC11_TABLE_MISS_DROP); + + default: + OVS_NOT_REACHED(); + } + } else { + return htonl(0); + } +} + /* Decodes the OpenFlow "table mod" message in '*oh' into an abstract form in * '*pm'. Returns 0 if successful, otherwise an OFPERR_* value. */ enum ofperr @@ -4810,15 +4936,17 @@ raw = ofpraw_pull_assert(&b); if (raw == OFPRAW_OFPT11_TABLE_MOD) { - const struct ofp11_table_mod *otm = ofpbuf_data(&b); + const struct ofp11_table_mod *otm = b.data; pm->table_id = otm->table_id; - pm->config = ntohl(otm->config); + pm->miss_config = ofputil_table_miss_from_config(otm->config, + oh->version); } else if (raw == OFPRAW_OFPT14_TABLE_MOD) { const struct ofp14_table_mod *otm = ofpbuf_pull(&b, sizeof *otm); pm->table_id = otm->table_id; - pm->config = ntohl(otm->config); + pm->miss_config = ofputil_table_miss_from_config(otm->config, + oh->version); /* We do not understand any properties yet, so we do not bother * parsing them. */ } else { @@ -4852,7 +4980,8 @@ b = ofpraw_alloc(OFPRAW_OFPT11_TABLE_MOD, ofp_version, 0); otm = ofpbuf_put_zeros(b, sizeof *otm); otm->table_id = pm->table_id; - otm->config = htonl(pm->config); + otm->config = ofputil_table_miss_to_config(pm->miss_config, + ofp_version); break; } case OFP14_VERSION: @@ -4862,7 +4991,8 @@ b = ofpraw_alloc(OFPRAW_OFPT14_TABLE_MOD, ofp_version, 0); otm = ofpbuf_put_zeros(b, sizeof *otm); otm->table_id = pm->table_id; - otm->config = htonl(pm->config); + otm->config = ofputil_table_miss_to_config(pm->miss_config, + ofp_version); break; } default: @@ -4889,7 +5019,7 @@ if (raw == OFPRAW_OFPT12_ROLE_REQUEST || raw == OFPRAW_OFPT12_ROLE_REPLY) { - const struct ofp12_role_request *orr = ofpbuf_l3(&b); + const struct ofp12_role_request *orr = b.msg; if (orr->role != htonl(OFPCR12_ROLE_NOCHANGE) && orr->role != htonl(OFPCR12_ROLE_EQUAL) && @@ -4910,7 +5040,7 @@ } } else if (raw == OFPRAW_NXT_ROLE_REQUEST || raw == OFPRAW_NXT_ROLE_REPLY) { - const struct nx_role_request *nrr = ofpbuf_l3(&b); + const struct nx_role_request *nrr = b.msg; BUILD_ASSERT(NX_ROLE_OTHER + 1 == OFPCR12_ROLE_EQUAL); BUILD_ASSERT(NX_ROLE_MASTER + 1 == OFPCR12_ROLE_MASTER); @@ -5008,7 +5138,7 @@ raw = ofpraw_pull_assert(&b); ovs_assert(raw == OFPRAW_OFPT14_ROLE_STATUS); - r = ofpbuf_l3(&b); + r = b.msg; if (r->role != htonl(OFPCR12_ROLE_NOCHANGE) && r->role != htonl(OFPCR12_ROLE_EQUAL) && r->role != htonl(OFPCR12_ROLE_MASTER) && @@ -5025,179 +5155,421 @@ /* Table stats. */ +/* OpenFlow 1.0 and 1.1 don't distinguish between a field that cannot be + * matched and a field that must be wildcarded. This function returns a bitmap + * that contains both kinds of fields. */ +static struct mf_bitmap +wild_or_nonmatchable_fields(const struct ofputil_table_features *features) +{ + struct mf_bitmap wc = features->match; + bitmap_not(wc.bm, MFF_N_IDS); + bitmap_or(wc.bm, features->wildcard.bm, MFF_N_IDS); + return wc; +} + +struct ofp10_wc_map { + enum ofp10_flow_wildcards wc10; + enum mf_field_id mf; +}; + +static const struct ofp10_wc_map ofp10_wc_map[] = { + { OFPFW10_IN_PORT, MFF_IN_PORT }, + { OFPFW10_DL_VLAN, MFF_VLAN_VID }, + { OFPFW10_DL_SRC, MFF_ETH_SRC }, + { OFPFW10_DL_DST, MFF_ETH_DST}, + { OFPFW10_DL_TYPE, MFF_ETH_TYPE }, + { OFPFW10_NW_PROTO, MFF_IP_PROTO }, + { OFPFW10_TP_SRC, MFF_TCP_SRC }, + { OFPFW10_TP_DST, MFF_TCP_DST }, + { OFPFW10_NW_SRC_MASK, MFF_IPV4_SRC }, + { OFPFW10_NW_DST_MASK, MFF_IPV4_DST }, + { OFPFW10_DL_VLAN_PCP, MFF_VLAN_PCP }, + { OFPFW10_NW_TOS, MFF_IP_DSCP }, +}; + +static ovs_be32 +mf_bitmap_to_of10(const struct mf_bitmap *fields) +{ + const struct ofp10_wc_map *p; + uint32_t wc10 = 0; + + for (p = ofp10_wc_map; p < &ofp10_wc_map[ARRAY_SIZE(ofp10_wc_map)]; p++) { + if (bitmap_is_set(fields->bm, p->mf)) { + wc10 |= p->wc10; + } + } + return htonl(wc10); +} + +static struct mf_bitmap +mf_bitmap_from_of10(ovs_be32 wc10_) +{ + struct mf_bitmap fields = MF_BITMAP_INITIALIZER; + const struct ofp10_wc_map *p; + uint32_t wc10 = ntohl(wc10_); + + for (p = ofp10_wc_map; p < &ofp10_wc_map[ARRAY_SIZE(ofp10_wc_map)]; p++) { + if (wc10 & p->wc10) { + bitmap_set1(fields.bm, p->mf); + } + } + return fields; +} + static void -ofputil_put_ofp10_table_stats(const struct ofp12_table_stats *in, +ofputil_put_ofp10_table_stats(const struct ofputil_table_stats *stats, + const struct ofputil_table_features *features, struct ofpbuf *buf) { - struct wc_map { - enum ofp10_flow_wildcards wc10; - enum oxm12_ofb_match_fields mf12; - }; - - static const struct wc_map wc_map[] = { - { OFPFW10_IN_PORT, OFPXMT12_OFB_IN_PORT }, - { OFPFW10_DL_VLAN, OFPXMT12_OFB_VLAN_VID }, - { OFPFW10_DL_SRC, OFPXMT12_OFB_ETH_SRC }, - { OFPFW10_DL_DST, OFPXMT12_OFB_ETH_DST}, - { OFPFW10_DL_TYPE, OFPXMT12_OFB_ETH_TYPE }, - { OFPFW10_NW_PROTO, OFPXMT12_OFB_IP_PROTO }, - { OFPFW10_TP_SRC, OFPXMT12_OFB_TCP_SRC }, - { OFPFW10_TP_DST, OFPXMT12_OFB_TCP_DST }, - { OFPFW10_NW_SRC_MASK, OFPXMT12_OFB_IPV4_SRC }, - { OFPFW10_NW_DST_MASK, OFPXMT12_OFB_IPV4_DST }, - { OFPFW10_DL_VLAN_PCP, OFPXMT12_OFB_VLAN_PCP }, - { OFPFW10_NW_TOS, OFPXMT12_OFB_IP_DSCP }, - }; - + struct mf_bitmap wc = wild_or_nonmatchable_fields(features); struct ofp10_table_stats *out; - const struct wc_map *p; out = ofpbuf_put_zeros(buf, sizeof *out); - out->table_id = in->table_id; - ovs_strlcpy(out->name, in->name, sizeof out->name); - out->wildcards = 0; - for (p = wc_map; p < &wc_map[ARRAY_SIZE(wc_map)]; p++) { - if (in->wildcards & htonll(1ULL << p->mf12)) { - out->wildcards |= htonl(p->wc10); + out->table_id = features->table_id; + ovs_strlcpy(out->name, features->name, sizeof out->name); + out->wildcards = mf_bitmap_to_of10(&wc); + out->max_entries = htonl(features->max_entries); + out->active_count = htonl(stats->active_count); + put_32aligned_be64(&out->lookup_count, htonll(stats->lookup_count)); + put_32aligned_be64(&out->matched_count, htonll(stats->matched_count)); +} + +struct ofp11_wc_map { + enum ofp11_flow_match_fields wc11; + enum mf_field_id mf; +}; + +static const struct ofp11_wc_map ofp11_wc_map[] = { + { OFPFMF11_IN_PORT, MFF_IN_PORT }, + { OFPFMF11_DL_VLAN, MFF_VLAN_VID }, + { OFPFMF11_DL_VLAN_PCP, MFF_VLAN_PCP }, + { OFPFMF11_DL_TYPE, MFF_ETH_TYPE }, + { OFPFMF11_NW_TOS, MFF_IP_DSCP }, + { OFPFMF11_NW_PROTO, MFF_IP_PROTO }, + { OFPFMF11_TP_SRC, MFF_TCP_SRC }, + { OFPFMF11_TP_DST, MFF_TCP_DST }, + { OFPFMF11_MPLS_LABEL, MFF_MPLS_LABEL }, + { OFPFMF11_MPLS_TC, MFF_MPLS_TC }, + /* I don't know what OFPFMF11_TYPE means. */ + { OFPFMF11_DL_SRC, MFF_ETH_SRC }, + { OFPFMF11_DL_DST, MFF_ETH_DST }, + { OFPFMF11_NW_SRC, MFF_IPV4_SRC }, + { OFPFMF11_NW_DST, MFF_IPV4_DST }, + { OFPFMF11_METADATA, MFF_METADATA }, +}; + +static ovs_be32 +mf_bitmap_to_of11(const struct mf_bitmap *fields) +{ + const struct ofp11_wc_map *p; + uint32_t wc11 = 0; + + for (p = ofp11_wc_map; p < &ofp11_wc_map[ARRAY_SIZE(ofp11_wc_map)]; p++) { + if (bitmap_is_set(fields->bm, p->mf)) { + wc11 |= p->wc11; } } - out->max_entries = in->max_entries; - out->active_count = in->active_count; - put_32aligned_be64(&out->lookup_count, in->lookup_count); - put_32aligned_be64(&out->matched_count, in->matched_count); + return htonl(wc11); } -static ovs_be32 -oxm12_to_ofp11_flow_match_fields(ovs_be64 oxm12) +static struct mf_bitmap +mf_bitmap_from_of11(ovs_be32 wc11_) { - struct map { - enum ofp11_flow_match_fields fmf11; - enum oxm12_ofb_match_fields mf12; - }; - - static const struct map map[] = { - { OFPFMF11_IN_PORT, OFPXMT12_OFB_IN_PORT }, - { OFPFMF11_DL_VLAN, OFPXMT12_OFB_VLAN_VID }, - { OFPFMF11_DL_VLAN_PCP, OFPXMT12_OFB_VLAN_PCP }, - { OFPFMF11_DL_TYPE, OFPXMT12_OFB_ETH_TYPE }, - { OFPFMF11_NW_TOS, OFPXMT12_OFB_IP_DSCP }, - { OFPFMF11_NW_PROTO, OFPXMT12_OFB_IP_PROTO }, - { OFPFMF11_TP_SRC, OFPXMT12_OFB_TCP_SRC }, - { OFPFMF11_TP_DST, OFPXMT12_OFB_TCP_DST }, - { OFPFMF11_MPLS_LABEL, OFPXMT12_OFB_MPLS_LABEL }, - { OFPFMF11_MPLS_TC, OFPXMT12_OFB_MPLS_TC }, - /* I don't know what OFPFMF11_TYPE means. */ - { OFPFMF11_DL_SRC, OFPXMT12_OFB_ETH_SRC }, - { OFPFMF11_DL_DST, OFPXMT12_OFB_ETH_DST }, - { OFPFMF11_NW_SRC, OFPXMT12_OFB_IPV4_SRC }, - { OFPFMF11_NW_DST, OFPXMT12_OFB_IPV4_DST }, - { OFPFMF11_METADATA, OFPXMT12_OFB_METADATA }, - }; - - const struct map *p; - uint32_t fmf11; - - fmf11 = 0; - for (p = map; p < &map[ARRAY_SIZE(map)]; p++) { - if (oxm12 & htonll(1ULL << p->mf12)) { - fmf11 |= p->fmf11; + struct mf_bitmap fields = MF_BITMAP_INITIALIZER; + const struct ofp11_wc_map *p; + uint32_t wc11 = ntohl(wc11_); + + for (p = ofp11_wc_map; p < &ofp11_wc_map[ARRAY_SIZE(ofp11_wc_map)]; p++) { + if (wc11 & p->wc11) { + bitmap_set1(fields.bm, p->mf); } } - return htonl(fmf11); + return fields; } static void -ofputil_put_ofp11_table_stats(const struct ofp12_table_stats *in, +ofputil_put_ofp11_table_stats(const struct ofputil_table_stats *stats, + const struct ofputil_table_features *features, struct ofpbuf *buf) { + struct mf_bitmap wc = wild_or_nonmatchable_fields(features); struct ofp11_table_stats *out; out = ofpbuf_put_zeros(buf, sizeof *out); - out->table_id = in->table_id; - ovs_strlcpy(out->name, in->name, sizeof out->name); - out->wildcards = oxm12_to_ofp11_flow_match_fields(in->wildcards); - out->match = oxm12_to_ofp11_flow_match_fields(in->match); - out->instructions = in->instructions; - out->write_actions = in->write_actions; - out->apply_actions = in->apply_actions; - out->config = in->config; - out->max_entries = in->max_entries; - out->active_count = in->active_count; - out->lookup_count = in->lookup_count; - out->matched_count = in->matched_count; + out->table_id = features->table_id; + ovs_strlcpy(out->name, features->name, sizeof out->name); + out->wildcards = mf_bitmap_to_of11(&wc); + out->match = mf_bitmap_to_of11(&features->match); + out->instructions = ovsinst_bitmap_to_openflow( + features->nonmiss.instructions, OFP11_VERSION); + out->write_actions = ofpact_bitmap_to_openflow( + features->nonmiss.write.ofpacts, OFP11_VERSION); + out->apply_actions = ofpact_bitmap_to_openflow( + features->nonmiss.apply.ofpacts, OFP11_VERSION); + out->config = htonl(features->miss_config); + out->max_entries = htonl(features->max_entries); + out->active_count = htonl(stats->active_count); + out->lookup_count = htonll(stats->lookup_count); + out->matched_count = htonll(stats->matched_count); } static void -ofputil_put_ofp12_table_stats(const struct ofp12_table_stats *in, +ofputil_put_ofp12_table_stats(const struct ofputil_table_stats *stats, + const struct ofputil_table_features *features, struct ofpbuf *buf) { - struct ofp12_table_stats *out = ofpbuf_put(buf, in, sizeof *in); + struct ofp12_table_stats *out; - /* Trim off OF1.3-only capabilities. */ - out->match &= htonll(OFPXMT12_MASK); - out->wildcards &= htonll(OFPXMT12_MASK); - out->write_setfields &= htonll(OFPXMT12_MASK); - out->apply_setfields &= htonll(OFPXMT12_MASK); + out = ofpbuf_put_zeros(buf, sizeof *out); + out->table_id = features->table_id; + ovs_strlcpy(out->name, features->name, sizeof out->name); + out->match = oxm_bitmap_from_mf_bitmap(&features->match, OFP12_VERSION); + out->wildcards = oxm_bitmap_from_mf_bitmap(&features->wildcard, + OFP12_VERSION); + out->write_actions = ofpact_bitmap_to_openflow( + features->nonmiss.write.ofpacts, OFP12_VERSION); + out->apply_actions = ofpact_bitmap_to_openflow( + features->nonmiss.apply.ofpacts, OFP12_VERSION); + out->write_setfields = oxm_bitmap_from_mf_bitmap( + &features->nonmiss.write.set_fields, OFP12_VERSION); + out->apply_setfields = oxm_bitmap_from_mf_bitmap( + &features->nonmiss.apply.set_fields, OFP12_VERSION); + out->metadata_match = features->metadata_match; + out->metadata_write = features->metadata_write; + out->instructions = ovsinst_bitmap_to_openflow( + features->nonmiss.instructions, OFP12_VERSION); + out->config = ofputil_table_miss_to_config(features->miss_config, + OFP12_VERSION); + out->max_entries = htonl(features->max_entries); + out->active_count = htonl(stats->active_count); + out->lookup_count = htonll(stats->lookup_count); + out->matched_count = htonll(stats->matched_count); } static void -ofputil_put_ofp13_table_stats(const struct ofp12_table_stats *in, +ofputil_put_ofp13_table_stats(const struct ofputil_table_stats *stats, struct ofpbuf *buf) { struct ofp13_table_stats *out; - /* OF 1.3 splits table features off the ofp_table_stats, - * so there is not much here. */ - - out = ofpbuf_put_uninit(buf, sizeof *out); - out->table_id = in->table_id; - out->active_count = in->active_count; - out->lookup_count = in->lookup_count; - out->matched_count = in->matched_count; + out = ofpbuf_put_zeros(buf, sizeof *out); + out->table_id = stats->table_id; + out->active_count = htonl(stats->active_count); + out->lookup_count = htonll(stats->lookup_count); + out->matched_count = htonll(stats->matched_count); } struct ofpbuf * -ofputil_encode_table_stats_reply(const struct ofp12_table_stats stats[], int n, - const struct ofp_header *request) +ofputil_encode_table_stats_reply(const struct ofp_header *request) { - struct ofpbuf *reply; - int i; + return ofpraw_alloc_stats_reply(request, 0); +} - reply = ofpraw_alloc_stats_reply(request, n * sizeof *stats); +void +ofputil_append_table_stats_reply(struct ofpbuf *reply, + const struct ofputil_table_stats *stats, + const struct ofputil_table_features *features) +{ + struct ofp_header *oh = reply->header; - for (i = 0; i < n; i++) { - switch ((enum ofp_version) request->version) { - case OFP10_VERSION: - ofputil_put_ofp10_table_stats(&stats[i], reply); - break; + ovs_assert(stats->table_id == features->table_id); - case OFP11_VERSION: - ofputil_put_ofp11_table_stats(&stats[i], reply); - break; + switch ((enum ofp_version) oh->version) { + case OFP10_VERSION: + ofputil_put_ofp10_table_stats(stats, features, reply); + break; - case OFP12_VERSION: - ofputil_put_ofp12_table_stats(&stats[i], reply); - break; + case OFP11_VERSION: + ofputil_put_ofp11_table_stats(stats, features, reply); + break; - case OFP13_VERSION: - case OFP14_VERSION: - case OFP15_VERSION: - ofputil_put_ofp13_table_stats(&stats[i], reply); - break; + case OFP12_VERSION: + ofputil_put_ofp12_table_stats(stats, features, reply); + break; - default: - OVS_NOT_REACHED(); - } - } + case OFP13_VERSION: + case OFP14_VERSION: + case OFP15_VERSION: + ofputil_put_ofp13_table_stats(stats, reply); + break; - return reply; + default: + OVS_NOT_REACHED(); + } } - -/* ofputil_flow_monitor_request */ -/* Converts an NXST_FLOW_MONITOR request in 'msg' into an abstract - * ofputil_flow_monitor_request in 'rq'. - * +static int +ofputil_decode_ofp10_table_stats(struct ofpbuf *msg, + struct ofputil_table_stats *stats, + struct ofputil_table_features *features) +{ + struct ofp10_table_stats *ots; + + ots = ofpbuf_try_pull(msg, sizeof *ots); + if (!ots) { + return OFPERR_OFPBRC_BAD_LEN; + } + + features->table_id = ots->table_id; + ovs_strlcpy(features->name, ots->name, sizeof features->name); + features->max_entries = ntohl(ots->max_entries); + features->match = features->wildcard = mf_bitmap_from_of10(ots->wildcards); + + stats->table_id = ots->table_id; + stats->active_count = ntohl(ots->active_count); + stats->lookup_count = ntohll(get_32aligned_be64(&ots->lookup_count)); + stats->matched_count = ntohll(get_32aligned_be64(&ots->matched_count)); + + return 0; +} + +static int +ofputil_decode_ofp11_table_stats(struct ofpbuf *msg, + struct ofputil_table_stats *stats, + struct ofputil_table_features *features) +{ + struct ofp11_table_stats *ots; + + ots = ofpbuf_try_pull(msg, sizeof *ots); + if (!ots) { + return OFPERR_OFPBRC_BAD_LEN; + } + + features->table_id = ots->table_id; + ovs_strlcpy(features->name, ots->name, sizeof features->name); + features->max_entries = ntohl(ots->max_entries); + features->nonmiss.instructions = ovsinst_bitmap_from_openflow( + ots->instructions, OFP11_VERSION); + features->nonmiss.write.ofpacts = ofpact_bitmap_from_openflow( + ots->write_actions, OFP11_VERSION); + features->nonmiss.apply.ofpacts = ofpact_bitmap_from_openflow( + ots->write_actions, OFP11_VERSION); + features->miss = features->nonmiss; + features->miss_config = ofputil_table_miss_from_config(ots->config, + OFP11_VERSION); + features->match = mf_bitmap_from_of11(ots->match); + features->wildcard = mf_bitmap_from_of11(ots->wildcards); + bitmap_or(features->match.bm, features->wildcard.bm, MFF_N_IDS); + + stats->table_id = ots->table_id; + stats->active_count = ntohl(ots->active_count); + stats->lookup_count = ntohll(ots->lookup_count); + stats->matched_count = ntohll(ots->matched_count); + + return 0; +} + +static int +ofputil_decode_ofp12_table_stats(struct ofpbuf *msg, + struct ofputil_table_stats *stats, + struct ofputil_table_features *features) +{ + struct ofp12_table_stats *ots; + + ots = ofpbuf_try_pull(msg, sizeof *ots); + if (!ots) { + return OFPERR_OFPBRC_BAD_LEN; + } + + features->table_id = ots->table_id; + ovs_strlcpy(features->name, ots->name, sizeof features->name); + features->metadata_match = ots->metadata_match; + features->metadata_write = ots->metadata_write; + features->miss_config = ofputil_table_miss_from_config(ots->config, + OFP12_VERSION); + features->max_entries = ntohl(ots->max_entries); + + features->nonmiss.instructions = ovsinst_bitmap_from_openflow( + ots->instructions, OFP12_VERSION); + features->nonmiss.write.ofpacts = ofpact_bitmap_from_openflow( + ots->write_actions, OFP12_VERSION); + features->nonmiss.apply.ofpacts = ofpact_bitmap_from_openflow( + ots->apply_actions, OFP12_VERSION); + features->nonmiss.write.set_fields = oxm_bitmap_to_mf_bitmap( + ots->write_setfields, OFP12_VERSION); + features->nonmiss.apply.set_fields = oxm_bitmap_to_mf_bitmap( + ots->apply_setfields, OFP12_VERSION); + features->miss = features->nonmiss; + + features->match = oxm_bitmap_to_mf_bitmap(ots->match, OFP12_VERSION); + features->wildcard = oxm_bitmap_to_mf_bitmap(ots->wildcards, + OFP12_VERSION); + bitmap_or(features->match.bm, features->wildcard.bm, MFF_N_IDS); + + stats->table_id = ots->table_id; + stats->active_count = ntohl(ots->active_count); + stats->lookup_count = ntohll(ots->lookup_count); + stats->matched_count = ntohll(ots->matched_count); + + return 0; +} + +static int +ofputil_decode_ofp13_table_stats(struct ofpbuf *msg, + struct ofputil_table_stats *stats, + struct ofputil_table_features *features) +{ + struct ofp13_table_stats *ots; + + ots = ofpbuf_try_pull(msg, sizeof *ots); + if (!ots) { + return OFPERR_OFPBRC_BAD_LEN; + } + + features->table_id = ots->table_id; + + stats->table_id = ots->table_id; + stats->active_count = ntohl(ots->active_count); + stats->lookup_count = ntohll(ots->lookup_count); + stats->matched_count = ntohll(ots->matched_count); + + return 0; +} + +int +ofputil_decode_table_stats_reply(struct ofpbuf *msg, + struct ofputil_table_stats *stats, + struct ofputil_table_features *features) +{ + const struct ofp_header *oh; + + if (!msg->header) { + ofpraw_pull_assert(msg); + } + oh = msg->header; + + if (!msg->size) { + return EOF; + } + + memset(stats, 0, sizeof *stats); + memset(features, 0, sizeof *features); + + switch ((enum ofp_version) oh->version) { + case OFP10_VERSION: + return ofputil_decode_ofp10_table_stats(msg, stats, features); + + case OFP11_VERSION: + return ofputil_decode_ofp11_table_stats(msg, stats, features); + + case OFP12_VERSION: + return ofputil_decode_ofp12_table_stats(msg, stats, features); + + case OFP13_VERSION: + case OFP14_VERSION: + case OFP15_VERSION: + return ofputil_decode_ofp13_table_stats(msg, stats, features); + + default: + OVS_NOT_REACHED(); + } +} + +/* ofputil_flow_monitor_request */ + +/* Converts an NXST_FLOW_MONITOR request in 'msg' into an abstract + * ofputil_flow_monitor_request in 'rq'. + * * Multiple NXST_FLOW_MONITOR requests can be packed into a single OpenFlow * message. Calling this function multiple times for a single 'msg' iterates * through the requests. The caller must initially leave 'msg''s layer @@ -5212,18 +5584,18 @@ struct nx_flow_monitor_request *nfmr; uint16_t flags; - if (!msg->frame) { + if (!msg->header) { ofpraw_pull_assert(msg); } - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } nfmr = ofpbuf_try_pull(msg, sizeof *nfmr); if (!nfmr) { VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR request has %"PRIu32" " - "leftover bytes at end", ofpbuf_size(msg)); + "leftover bytes at end", msg->size); return OFPERR_OFPBRC_BAD_LEN; } @@ -5233,7 +5605,7 @@ | NXFMF_MODIFY | NXFMF_ACTIONS | NXFMF_OWN)) { VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR has bad flags %#"PRIx16, flags); - return OFPERR_NXBRC_FM_BAD_FLAGS; + return OFPERR_OFPMOFC_BAD_FLAGS; } if (!is_all_zeros(nfmr->zeros, sizeof nfmr->zeros)) { @@ -5256,11 +5628,11 @@ size_t start_ofs; int match_len; - if (!ofpbuf_size(msg)) { + if (!msg->size) { ofpraw_put(OFPRAW_NXST_FLOW_MONITOR_REQUEST, OFP10_VERSION, msg); } - start_ofs = ofpbuf_size(msg); + start_ofs = msg->size; ofpbuf_put_zeros(msg, sizeof *nfmr); match_len = nx_put_match(msg, &rq->match, htonll(0), htonll(0)); @@ -5296,24 +5668,24 @@ unsigned int length; struct ofp_header *oh; - if (!msg->frame) { + if (!msg->header) { ofpraw_pull_assert(msg); } - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } - if (ofpbuf_size(msg) < sizeof(struct nx_flow_update_header)) { + if (msg->size < sizeof(struct nx_flow_update_header)) { goto bad_len; } - oh = msg->frame; + oh = msg->header; - nfuh = ofpbuf_data(msg); + nfuh = msg->data; update->event = ntohs(nfuh->event); length = ntohs(nfuh->length); - if (length > ofpbuf_size(msg) || length % 8) { + if (length > msg->size || length % 8) { goto bad_len; } @@ -5364,8 +5736,8 @@ return error; } - update->ofpacts = ofpbuf_data(ofpacts); - update->ofpacts_len = ofpbuf_size(ofpacts); + update->ofpacts = ofpacts->data; + update->ofpacts_len = ofpacts->size; return 0; } else { VLOG_WARN_RL(&bad_ofmsg_rl, @@ -5376,7 +5748,7 @@ bad_len: VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR reply has %"PRIu32" " - "leftover bytes at end", ofpbuf_size(msg)); + "leftover bytes at end", msg->size); return OFPERR_OFPBRC_BAD_LEN; } @@ -5401,7 +5773,7 @@ } void -ofputil_start_flow_update(struct list *replies) +ofputil_start_flow_update(struct ovs_list *replies) { struct ofpbuf *msg; @@ -5414,7 +5786,7 @@ void ofputil_append_flow_update(const struct ofputil_flow_update *update, - struct list *replies) + struct ovs_list *replies) { enum ofp_version version = ofpmp_version(replies); struct nx_flow_update_header *nfuh; @@ -5422,7 +5794,7 @@ size_t start_ofs; msg = ofpbuf_from_list(list_back(replies)); - start_ofs = ofpbuf_size(msg); + start_ofs = msg->size; if (update->event == NXFME_ABBREV) { struct nx_flow_update_abbrev *nfua; @@ -5448,7 +5820,7 @@ } nfuh = ofpbuf_at_assert(msg, start_ofs, sizeof *nfuh); - nfuh->length = htons(ofpbuf_size(msg) - start_ofs); + nfuh->length = htons(msg->size - start_ofs); nfuh->event = htons(update->event); ofpmp_postappend(replies, start_ofs); @@ -5474,14 +5846,14 @@ msg = ofpraw_alloc(OFPRAW_OFPT10_PACKET_OUT, OFP10_VERSION, size); ofpbuf_put_zeros(msg, sizeof *opo); - actions_ofs = ofpbuf_size(msg); + actions_ofs = msg->size; ofpacts_put_openflow_actions(po->ofpacts, po->ofpacts_len, msg, ofp_version); - opo = ofpbuf_l3(msg); + opo = msg->msg; opo->buffer_id = htonl(po->buffer_id); opo->in_port = htons(ofp_to_u16(po->in_port)); - opo->actions_len = htons(ofpbuf_size(msg) - actions_ofs); + opo->actions_len = htons(msg->size - actions_ofs); break; } @@ -5497,7 +5869,7 @@ ofpbuf_put_zeros(msg, sizeof *opo); len = ofpacts_put_openflow_actions(po->ofpacts, po->ofpacts_len, msg, ofp_version); - opo = ofpbuf_l3(msg); + opo = msg->msg; opo->buffer_id = htonl(po->buffer_id); opo->in_port = ofputil_port_to_ofp11(po->in_port); opo->actions_len = htons(len); @@ -5536,8 +5908,8 @@ ofpbuf_use_const(&rq_buf, rq, ntohs(rq->length)); ofpraw_pull_assert(&rq_buf); - reply = ofpraw_alloc_reply(OFPRAW_OFPT_ECHO_REPLY, rq, ofpbuf_size(&rq_buf)); - ofpbuf_put(reply, ofpbuf_data(&rq_buf), ofpbuf_size(&rq_buf)); + reply = ofpraw_alloc_reply(OFPRAW_OFPT_ECHO_REPLY, rq, rq_buf.size); + ofpbuf_put(reply, rq_buf.data, rq_buf.size); return reply; } @@ -5643,7 +6015,8 @@ OFPUTIL_NAMED_PORT(ALL) \ OFPUTIL_NAMED_PORT(CONTROLLER) \ OFPUTIL_NAMED_PORT(LOCAL) \ - OFPUTIL_NAMED_PORT(ANY) + OFPUTIL_NAMED_PORT(ANY) \ + OFPUTIL_NAMED_PORT(UNSET) /* For backwards compatibility, so that "none" is recognized as OFPP_ANY */ #define OFPUTIL_NAMED_PORTS_WITH_NONE \ @@ -5837,127 +6210,12 @@ } case OFP14_VERSION: case OFP15_VERSION: - return ofpbuf_size(b) ? ofputil_pull_ofp14_port(pp, b) : EOF; - default: - OVS_NOT_REACHED(); - } -} - -/* ofp-util.def lists the mapping from names to action. */ -static const char *const names[OFPUTIL_N_ACTIONS] = { - NULL, -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) NAME, -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) NAME, -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) NAME, -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) NAME, -#include "ofp-util.def" -}; - -/* Returns the 'enum ofputil_action_code' corresponding to 'name' (e.g. if - * 'name' is "output" then the return value is OFPUTIL_OFPAT10_OUTPUT), or -1 - * if 'name' is not the name of any action. */ -int -ofputil_action_code_from_name(const char *name) -{ - const char *const *p; - - for (p = names; p < &names[ARRAY_SIZE(names)]; p++) { - if (*p && !strcasecmp(name, *p)) { - return p - names; - } - } - return -1; -} - -/* Returns name corresponding to the 'enum ofputil_action_code', - * or "Unkonwn action", if the name is not available. */ -const char * -ofputil_action_name_from_code(enum ofputil_action_code code) -{ - return code < (int)OFPUTIL_N_ACTIONS && names[code] ? names[code] - : "Unknown action"; -} - -enum ofputil_action_code -ofputil_action_code_from_ofp13_action(enum ofp13_action_type type) -{ - switch (type) { - -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case ENUM: \ - return OFPUTIL_##ENUM; -#include "ofp-util.def" - + return b->size ? ofputil_pull_ofp14_port(pp, b) : EOF; default: - return OFPUTIL_ACTION_INVALID; - } -} - -/* Appends an action of the type specified by 'code' to 'buf' and returns the - * action. Initializes the parts of 'action' that identify it as having type - * and length 'sizeof *action' and zeros the rest. For actions that - * have variable length, the length used and cleared is that of struct - * . */ -void * -ofputil_put_action(enum ofputil_action_code code, struct ofpbuf *buf) -{ - switch (code) { - case OFPUTIL_ACTION_INVALID: -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM: -#include "ofp-util.def" OVS_NOT_REACHED(); - -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) \ - case OFPUTIL_##ENUM: return ofputil_put_##ENUM(buf); -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case OFPUTIL_##ENUM: return ofputil_put_##ENUM(buf); -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - case OFPUTIL_##ENUM: return ofputil_put_##ENUM(buf); -#include "ofp-util.def" } - OVS_NOT_REACHED(); } -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) \ - void \ - ofputil_init_##ENUM(struct STRUCT *s) \ - { \ - memset(s, 0, sizeof *s); \ - s->type = htons(ENUM); \ - s->len = htons(sizeof *s); \ - } \ - \ - struct STRUCT * \ - ofputil_put_##ENUM(struct ofpbuf *buf) \ - { \ - struct STRUCT *s = ofpbuf_put_uninit(buf, sizeof *s); \ - ofputil_init_##ENUM(s); \ - return s; \ - } -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - OFPAT10_ACTION(ENUM, STRUCT, NAME) -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - OFPAT10_ACTION(ENUM, STRUCT, NAME) -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - void \ - ofputil_init_##ENUM(struct STRUCT *s) \ - { \ - memset(s, 0, sizeof *s); \ - s->type = htons(OFPAT10_VENDOR); \ - s->len = htons(sizeof *s); \ - s->vendor = htonl(NX_VENDOR_ID); \ - s->subtype = htons(ENUM); \ - } \ - \ - struct STRUCT * \ - ofputil_put_##ENUM(struct ofpbuf *buf) \ - { \ - struct STRUCT *s = ofpbuf_put_uninit(buf, sizeof *s); \ - ofputil_init_##ENUM(s); \ - return s; \ - } -#include "ofp-util.def" - static void ofputil_normalize_match__(struct match *match, bool may_log) { @@ -6162,7 +6420,7 @@ } /* Encode a dump ports request for 'port', the encoded message - * will be for Open Flow version 'ofp_version'. Returns message + * will be for OpenFlow version 'ofp_version'. Returns message * as a struct ofpbuf. Returns encoded message on success, NULL on error */ struct ofpbuf * ofputil_encode_dump_ports_request(enum ofp_version ofp_version, ofp_port_t port) @@ -6246,7 +6504,7 @@ static void ofputil_append_ofp14_port_stats(const struct ofputil_port_stats *ops, - struct list *replies) + struct ovs_list *replies) { struct ofp14_port_stats_prop_ethernet *eth; struct ofp14_port_stats *ps14; @@ -6281,7 +6539,7 @@ /* Encode a ports stat for 'ops' and append it to 'replies'. */ void -ofputil_append_port_stat(struct list *replies, +ofputil_append_port_stat(struct ovs_list *replies, const struct ofputil_port_stats *ops) { switch (ofpmp_version(replies)) { @@ -6383,9 +6641,9 @@ parse_ofp14_port_stats_ethernet_property(const struct ofpbuf *payload, struct ofputil_port_stats *ops) { - const struct ofp14_port_stats_prop_ethernet *eth = ofpbuf_data(payload); + const struct ofp14_port_stats_prop_ethernet *eth = payload->data; - if (ofpbuf_size(payload) != sizeof *eth) { + if (payload->size != sizeof *eth) { return OFPERR_OFPBPC_BAD_LEN; } @@ -6412,7 +6670,7 @@ } len = ntohs(ps14->length); - if (len < sizeof *ps14 || len - sizeof *ps14 > ofpbuf_size(msg)) { + if (len < sizeof *ps14 || len - sizeof *ps14 > msg->size) { return OFPERR_OFPBRC_BAD_LEN; } len -= sizeof *ps14; @@ -6438,7 +6696,7 @@ ops->stats.rx_crc_errors = UINT64_MAX; ops->stats.collisions = UINT64_MAX; - while (ofpbuf_size(&properties) > 0) { + while (properties.size > 0) { struct ofpbuf payload; enum ofperr error; uint16_t type; @@ -6500,14 +6758,13 @@ enum ofperr error; enum ofpraw raw; - error = (msg->frame - ? ofpraw_decode(&raw, msg->frame) + error = (msg->header ? ofpraw_decode(&raw, msg->header) : ofpraw_pull(&raw, msg)); if (error) { return error; } - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } else if (raw == OFPRAW_OFPST14_PORT_REPLY) { return ofputil_pull_ofp14_port_stats(ps, msg); @@ -6541,7 +6798,7 @@ bad_len: VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_PORT reply has %"PRIu32" leftover " - "bytes at end", ofpbuf_size(msg)); + "bytes at end", msg->size); return OFPERR_OFPBRC_BAD_LEN; } @@ -6575,17 +6832,117 @@ /* Frees all of the "struct ofputil_bucket"s in the 'buckets' list. */ void -ofputil_bucket_list_destroy(struct list *buckets) +ofputil_bucket_list_destroy(struct ovs_list *buckets) { - struct ofputil_bucket *bucket, *next_bucket; + struct ofputil_bucket *bucket; - LIST_FOR_EACH_SAFE (bucket, next_bucket, list_node, buckets) { - list_remove(&bucket->list_node); + LIST_FOR_EACH_POP (bucket, list_node, buckets) { free(bucket->ofpacts); free(bucket); } } +/* Clones 'bucket' and its ofpacts data */ +static struct ofputil_bucket * +ofputil_bucket_clone_data(const struct ofputil_bucket *bucket) +{ + struct ofputil_bucket *new; + + new = xmemdup(bucket, sizeof *bucket); + new->ofpacts = xmemdup(bucket->ofpacts, bucket->ofpacts_len); + + return new; +} + +/* Clones each of the buckets in the list 'src' appending them + * in turn to 'dest' which should be an initialised list. + * An exception is that if the pointer value of a bucket in 'src' + * matches 'skip' then it is not cloned or appended to 'dest'. + * This allows all of 'src' or 'all of 'src' except 'skip' to + * be cloned and appended to 'dest'. */ +void +ofputil_bucket_clone_list(struct ovs_list *dest, const struct ovs_list *src, + const struct ofputil_bucket *skip) +{ + struct ofputil_bucket *bucket; + + LIST_FOR_EACH (bucket, list_node, src) { + struct ofputil_bucket *new_bucket; + + if (bucket == skip) { + continue; + } + + new_bucket = ofputil_bucket_clone_data(bucket); + list_push_back(dest, &new_bucket->list_node); + } +} + +/* Find a bucket in the list 'buckets' whose bucket id is 'bucket_id' + * Returns the first bucket found or NULL if no buckets are found. */ +struct ofputil_bucket * +ofputil_bucket_find(const struct ovs_list *buckets, uint32_t bucket_id) +{ + struct ofputil_bucket *bucket; + + if (bucket_id > OFPG15_BUCKET_MAX) { + return NULL; + } + + LIST_FOR_EACH (bucket, list_node, buckets) { + if (bucket->bucket_id == bucket_id) { + return bucket; + } + } + + return NULL; +} + +/* Returns true if more than one bucket in the list 'buckets' + * have the same bucket id. Returns false otherwise. */ +bool +ofputil_bucket_check_duplicate_id(const struct ovs_list *buckets) +{ + struct ofputil_bucket *i, *j; + + LIST_FOR_EACH (i, list_node, buckets) { + LIST_FOR_EACH_REVERSE (j, list_node, buckets) { + if (i == j) { + break; + } + if (i->bucket_id == j->bucket_id) { + return true; + } + } + } + + return false; +} + +/* Returns the bucket at the front of the list 'buckets'. + * Undefined if 'buckets is empty. */ +struct ofputil_bucket * +ofputil_bucket_list_front(const struct ovs_list *buckets) +{ + static struct ofputil_bucket *bucket; + + ASSIGN_CONTAINER(bucket, list_front(buckets), list_node); + + return bucket; +} + +/* Returns the bucket at the back of the list 'buckets'. + * Undefined if 'buckets is empty. */ +struct ofputil_bucket * +ofputil_bucket_list_back(const struct ovs_list *buckets) +{ + static struct ofputil_bucket *bucket; + + ASSIGN_CONTAINER(bucket, list_back(buckets), list_node); + + return bucket; +} + /* Returns an OpenFlow group stats request for OpenFlow version 'ofp_version', * that requests stats for group 'group_id'. (Use OFPG_ALL to request stats * for all groups.) @@ -6619,6 +6976,13 @@ return request; } +void +ofputil_uninit_group_desc(struct ofputil_group_desc *gd) +{ + ofputil_bucket_list_destroy(&gd->buckets); + free(&gd->props.fields); +} + /* Decodes the OpenFlow group description request in 'oh', returning the group * whose description is requested, or OFPG_ALL if stats for all groups was * requested. */ @@ -6719,7 +7083,7 @@ * replies already begun in 'replies' and appends it to the list. 'replies' * must have originally been initialized with ofpmp_init(). */ void -ofputil_append_group_stats(struct list *replies, +ofputil_append_group_stats(struct ovs_list *replies, const struct ofputil_group_stats *gs) { size_t bucket_counter_size; @@ -6792,20 +7156,18 @@ { struct ofp12_group_features_stats *ogf; struct ofpbuf *reply; + int i; reply = ofpraw_alloc_xid(OFPRAW_OFPST12_GROUP_FEATURES_REPLY, request->version, request->xid, 0); ogf = ofpbuf_put_zeros(reply, sizeof *ogf); ogf->types = htonl(features->types); ogf->capabilities = htonl(features->capabilities); - ogf->max_groups[0] = htonl(features->max_groups[0]); - ogf->max_groups[1] = htonl(features->max_groups[1]); - ogf->max_groups[2] = htonl(features->max_groups[2]); - ogf->max_groups[3] = htonl(features->max_groups[3]); - ogf->actions[0] = htonl(features->actions[0]); - ogf->actions[1] = htonl(features->actions[1]); - ogf->actions[2] = htonl(features->actions[2]); - ogf->actions[3] = htonl(features->actions[3]); + for (i = 0; i < OFPGT12_N_TYPES; i++) { + ogf->max_groups[i] = htonl(features->max_groups[i]); + ogf->actions[i] = ofpact_bitmap_to_openflow(features->ofpacts[i], + request->version); + } return reply; } @@ -6816,17 +7178,15 @@ struct ofputil_group_features *features) { const struct ofp12_group_features_stats *ogf = ofpmsg_body(oh); + int i; features->types = ntohl(ogf->types); features->capabilities = ntohl(ogf->capabilities); - features->max_groups[0] = ntohl(ogf->max_groups[0]); - features->max_groups[1] = ntohl(ogf->max_groups[1]); - features->max_groups[2] = ntohl(ogf->max_groups[2]); - features->max_groups[3] = ntohl(ogf->max_groups[3]); - features->actions[0] = ntohl(ogf->actions[0]); - features->actions[1] = ntohl(ogf->actions[1]); - features->actions[2] = ntohl(ogf->actions[2]); - features->actions[3] = ntohl(ogf->actions[3]); + for (i = 0; i < OFPGT12_N_TYPES; i++) { + features->max_groups[i] = ntohl(ogf->max_groups[i]); + features->ofpacts[i] = ofpact_bitmap_from_openflow( + ogf->actions[i], oh->version); + } } /* Parse a group status request message into a 32 bit OpenFlow 1.1 @@ -6865,14 +7225,13 @@ size_t i; gs->bucket_stats = NULL; - error = (msg->frame - ? ofpraw_decode(&raw, msg->frame) + error = (msg->header ? ofpraw_decode(&raw, msg->header) : ofpraw_pull(&raw, msg)); if (error) { return error; } - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } @@ -6898,7 +7257,7 @@ if (!ogs11) { VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply has %"PRIu32" leftover bytes at end", - ofpraw_get_name(raw), ofpbuf_size(msg)); + ofpraw_get_name(raw), msg->size); return OFPERR_OFPBRC_BAD_LEN; } length = ntohs(ogs11->length); @@ -6917,7 +7276,7 @@ obc = ofpbuf_try_pull(msg, gs->n_buckets * sizeof *obc); if (!obc) { VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply has %"PRIu32" leftover bytes at end", - ofpraw_get_name(raw), ofpbuf_size(msg)); + ofpraw_get_name(raw), msg->size); return OFPERR_OFPBRC_BAD_LEN; } @@ -6930,49 +7289,203 @@ return 0; } -/* Appends a group stats reply that contains the data in 'gds' to those already - * present in the list of ofpbufs in 'replies'. 'replies' should have been - * initialized with ofpmp_init(). */ -void -ofputil_append_group_desc_reply(const struct ofputil_group_desc *gds, - struct list *buckets, - struct list *replies) +static void +ofputil_put_ofp11_bucket(const struct ofputil_bucket *bucket, + struct ofpbuf *openflow, enum ofp_version ofp_version) +{ + struct ofp11_bucket *ob; + size_t start; + + start = openflow->size; + ofpbuf_put_zeros(openflow, sizeof *ob); + ofpacts_put_openflow_actions(bucket->ofpacts, bucket->ofpacts_len, + openflow, ofp_version); + ob = ofpbuf_at_assert(openflow, start, sizeof *ob); + ob->len = htons(openflow->size - start); + ob->weight = htons(bucket->weight); + ob->watch_port = ofputil_port_to_ofp11(bucket->watch_port); + ob->watch_group = htonl(bucket->watch_group); +} + +static void +ofputil_put_ofp15_group_bucket_prop_weight(ovs_be16 weight, + struct ofpbuf *openflow) +{ + size_t start_ofs; + struct ofp15_group_bucket_prop_weight *prop; + + start_ofs = start_property(openflow, OFPGBPT15_WEIGHT); + ofpbuf_put_zeros(openflow, sizeof *prop - sizeof(struct ofp_prop_header)); + prop = ofpbuf_at_assert(openflow, start_ofs, sizeof *prop); + prop->weight = weight; + end_property(openflow, start_ofs); +} + +static void +ofputil_put_ofp15_group_bucket_prop_watch(ovs_be32 watch, uint16_t type, + struct ofpbuf *openflow) +{ + size_t start_ofs; + struct ofp15_group_bucket_prop_watch *prop; + + start_ofs = start_property(openflow, type); + ofpbuf_put_zeros(openflow, sizeof *prop - sizeof(struct ofp_prop_header)); + prop = ofpbuf_at_assert(openflow, start_ofs, sizeof *prop); + prop->watch = watch; + end_property(openflow, start_ofs); +} + +static void +ofputil_put_ofp15_bucket(const struct ofputil_bucket *bucket, + uint32_t bucket_id, enum ofp11_group_type group_type, + struct ofpbuf *openflow, enum ofp_version ofp_version) +{ + struct ofp15_bucket *ob; + size_t start, actions_start, actions_len; + + start = openflow->size; + ofpbuf_put_zeros(openflow, sizeof *ob); + + actions_start = openflow->size; + ofpacts_put_openflow_actions(bucket->ofpacts, bucket->ofpacts_len, + openflow, ofp_version); + actions_len = openflow->size - actions_start; + + if (group_type == OFPGT11_SELECT) { + ofputil_put_ofp15_group_bucket_prop_weight(htons(bucket->weight), + openflow); + } + if (bucket->watch_port != OFPP_ANY) { + ovs_be32 port = ofputil_port_to_ofp11(bucket->watch_port); + ofputil_put_ofp15_group_bucket_prop_watch(port, + OFPGBPT15_WATCH_PORT, + openflow); + } + if (bucket->watch_group != OFPG_ANY) { + ovs_be32 group = htonl(bucket->watch_group); + ofputil_put_ofp15_group_bucket_prop_watch(group, + OFPGBPT15_WATCH_GROUP, + openflow); + } + + ob = ofpbuf_at_assert(openflow, start, sizeof *ob); + ob->len = htons(openflow->size - start); + ob->action_array_len = htons(actions_len); + ob->bucket_id = htonl(bucket_id); +} + +static void +ofputil_put_group_prop_ntr_selection_method(enum ofp_version ofp_version, + const struct ofputil_group_props *gp, + struct ofpbuf *openflow) +{ + struct ntr_group_prop_selection_method *prop; + size_t start; + + start = openflow->size; + ofpbuf_put_zeros(openflow, sizeof *prop); + oxm_put_field_array(openflow, &gp->fields, ofp_version); + prop = ofpbuf_at_assert(openflow, start, sizeof *prop); + prop->type = htons(OFPGPT15_EXPERIMENTER); + prop->experimenter = htonl(NTR_VENDOR_ID); + prop->exp_type = htonl(NTRT_SELECTION_METHOD); + strcpy(prop->selection_method, gp->selection_method); + prop->selection_method_param = htonll(gp->selection_method_param); + end_property(openflow, start); +} + +static void +ofputil_append_ofp11_group_desc_reply(const struct ofputil_group_desc *gds, + const struct ovs_list *buckets, + struct ovs_list *replies, + enum ofp_version version) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); - enum ofp_version version = ofpmp_version(replies); struct ofp11_group_desc_stats *ogds; struct ofputil_bucket *bucket; size_t start_ogds; - start_ogds = ofpbuf_size(reply); + start_ogds = reply->size; ofpbuf_put_zeros(reply, sizeof *ogds); LIST_FOR_EACH (bucket, list_node, buckets) { - struct ofp11_bucket *ob; - size_t start_ob; + ofputil_put_ofp11_bucket(bucket, reply, version); + } + ogds = ofpbuf_at_assert(reply, start_ogds, sizeof *ogds); + ogds->length = htons(reply->size - start_ogds); + ogds->type = gds->type; + ogds->group_id = htonl(gds->group_id); + + ofpmp_postappend(replies, start_ogds); +} + +static void +ofputil_append_ofp15_group_desc_reply(const struct ofputil_group_desc *gds, + const struct ovs_list *buckets, + struct ovs_list *replies, + enum ofp_version version) +{ + struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); + struct ofp15_group_desc_stats *ogds; + struct ofputil_bucket *bucket; + size_t start_ogds, start_buckets; - start_ob = ofpbuf_size(reply); - ofpbuf_put_zeros(reply, sizeof *ob); - ofpacts_put_openflow_actions(bucket->ofpacts, bucket->ofpacts_len, - reply, version); - ob = ofpbuf_at_assert(reply, start_ob, sizeof *ob); - ob->len = htons(ofpbuf_size(reply) - start_ob); - ob->weight = htons(bucket->weight); - ob->watch_port = ofputil_port_to_ofp11(bucket->watch_port); - ob->watch_group = htonl(bucket->watch_group); + start_ogds = reply->size; + ofpbuf_put_zeros(reply, sizeof *ogds); + start_buckets = reply->size; + LIST_FOR_EACH (bucket, list_node, buckets) { + ofputil_put_ofp15_bucket(bucket, bucket->bucket_id, + gds->type, reply, version); } ogds = ofpbuf_at_assert(reply, start_ogds, sizeof *ogds); - ogds->length = htons(ofpbuf_size(reply) - start_ogds); + ogds->length = htons(reply->size - start_ogds); ogds->type = gds->type; ogds->group_id = htonl(gds->group_id); + ogds->bucket_list_len = htons(reply->size - start_buckets); + + /* Add group properties */ + if (gds->props.selection_method[0]) { + ofputil_put_group_prop_ntr_selection_method(version, &gds->props, + reply); + } ofpmp_postappend(replies, start_ogds); } +/* Appends a group stats reply that contains the data in 'gds' to those already + * present in the list of ofpbufs in 'replies'. 'replies' should have been + * initialized with ofpmp_init(). */ +void +ofputil_append_group_desc_reply(const struct ofputil_group_desc *gds, + const struct ovs_list *buckets, + struct ovs_list *replies) +{ + enum ofp_version version = ofpmp_version(replies); + + switch (version) + { + case OFP11_VERSION: + case OFP12_VERSION: + case OFP13_VERSION: + case OFP14_VERSION: + ofputil_append_ofp11_group_desc_reply(gds, buckets, replies, version); + break; + + case OFP15_VERSION: + ofputil_append_ofp15_group_desc_reply(gds, buckets, replies, version); + break; + + case OFP10_VERSION: + default: + OVS_NOT_REACHED(); + } +} + static enum ofperr -ofputil_pull_buckets(struct ofpbuf *msg, size_t buckets_length, - enum ofp_version version, struct list *buckets) +ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length, + enum ofp_version version, struct ovs_list *buckets) { struct ofp11_bucket *ob; + uint32_t bucket_id = 0; list_init(buckets); while (buckets_length > 0) { @@ -7021,121 +7534,752 @@ return OFPERR_OFPGMFC_BAD_WATCH; } bucket->watch_group = ntohl(ob->watch_group); + bucket->bucket_id = bucket_id++; + bucket->ofpacts = ofpbuf_steal_data(&ofpacts); - bucket->ofpacts_len = ofpbuf_size(&ofpacts); + bucket->ofpacts_len = ofpacts.size; list_push_back(buckets, &bucket->list_node); } return 0; } -/* Converts a group description reply in 'msg' into an abstract - * ofputil_group_desc in 'gd'. - * - * Multiple group description replies can be packed into a single OpenFlow - * message. Calling this function multiple times for a single 'msg' iterates - * through the replies. The caller must initially leave 'msg''s layer pointers - * null and not modify them between calls. - * - * Returns 0 if successful, EOF if no replies were left in this 'msg', - * otherwise a positive errno value. */ -int -ofputil_decode_group_desc_reply(struct ofputil_group_desc *gd, - struct ofpbuf *msg, enum ofp_version version) +static enum ofperr +parse_ofp15_group_bucket_prop_weight(const struct ofpbuf *payload, + ovs_be16 *weight) { - struct ofp11_group_desc_stats *ogds; - size_t length; + struct ofp15_group_bucket_prop_weight *prop = payload->data; - if (!msg->frame) { - ofpraw_pull_assert(msg); + if (payload->size != sizeof *prop) { + log_property(false, "OpenFlow bucket weight property length " + "%u is not valid", payload->size); + return OFPERR_OFPBPC_BAD_LEN; } - if (!ofpbuf_size(msg)) { - return EOF; - } + *weight = prop->weight; - ogds = ofpbuf_try_pull(msg, sizeof *ogds); - if (!ogds) { - VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply has %"PRIu32" " - "leftover bytes at end", ofpbuf_size(msg)); - return OFPERR_OFPBRC_BAD_LEN; - } + return 0; +} + +static enum ofperr +parse_ofp15_group_bucket_prop_watch(const struct ofpbuf *payload, + ovs_be32 *watch) +{ + struct ofp15_group_bucket_prop_watch *prop = payload->data; + + if (payload->size != sizeof *prop) { + log_property(false, "OpenFlow bucket watch port or group " + "property length %u is not valid", payload->size); + return OFPERR_OFPBPC_BAD_LEN; + } + + *watch = prop->watch; + + return 0; +} + +static enum ofperr +ofputil_pull_ofp15_buckets(struct ofpbuf *msg, size_t buckets_length, + enum ofp_version version, struct ovs_list *buckets) +{ + struct ofp15_bucket *ob; + + list_init(buckets); + while (buckets_length > 0) { + struct ofputil_bucket *bucket = NULL; + struct ofpbuf ofpacts; + enum ofperr err = OFPERR_OFPGMFC_BAD_BUCKET; + struct ofpbuf properties; + size_t ob_len, actions_len, properties_len; + ovs_be32 watch_port = ofputil_port_to_ofp11(OFPP_ANY); + ovs_be32 watch_group = htonl(OFPG_ANY); + ovs_be16 weight = htons(1); + + ofpbuf_init(&ofpacts, 0); + + ob = ofpbuf_try_pull(msg, sizeof *ob); + if (!ob) { + VLOG_WARN_RL(&bad_ofmsg_rl, "buckets end with %"PRIuSIZE + " leftover bytes", buckets_length); + goto err; + } + + ob_len = ntohs(ob->len); + actions_len = ntohs(ob->action_array_len); + + if (ob_len < sizeof *ob) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OpenFlow message bucket length " + "%"PRIuSIZE" is not valid", ob_len); + goto err; + } else if (ob_len > buckets_length) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OpenFlow message bucket length " + "%"PRIuSIZE" exceeds remaining buckets data size %" + PRIuSIZE, ob_len, buckets_length); + goto err; + } else if (actions_len > ob_len - sizeof *ob) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OpenFlow message bucket actions " + "length %"PRIuSIZE" exceeds remaining bucket " + "data size %"PRIuSIZE, actions_len, + ob_len - sizeof *ob); + goto err; + } + buckets_length -= ob_len; + + err = ofpacts_pull_openflow_actions(msg, actions_len, version, + &ofpacts); + if (err) { + goto err; + } + + properties_len = ob_len - sizeof *ob - actions_len; + ofpbuf_use_const(&properties, ofpbuf_pull(msg, properties_len), + properties_len); + + while (properties.size > 0) { + struct ofpbuf payload; + uint16_t type; + + err = ofputil_pull_property(&properties, &payload, &type); + if (err) { + goto err; + } + + switch (type) { + case OFPGBPT15_WEIGHT: + err = parse_ofp15_group_bucket_prop_weight(&payload, &weight); + break; + + case OFPGBPT15_WATCH_PORT: + err = parse_ofp15_group_bucket_prop_watch(&payload, + &watch_port); + break; + + case OFPGBPT15_WATCH_GROUP: + err = parse_ofp15_group_bucket_prop_watch(&payload, + &watch_group); + break; + + default: + log_property(false, "unknown group bucket property %"PRIu16, + type); + err = OFPERR_OFPBPC_BAD_TYPE; + break; + } + + if (err) { + goto err; + } + } + + bucket = xzalloc(sizeof *bucket); + + bucket->weight = ntohs(weight); + err = ofputil_port_from_ofp11(watch_port, &bucket->watch_port); + if (err) { + err = OFPERR_OFPGMFC_BAD_WATCH; + goto err; + } + bucket->watch_group = ntohl(watch_group); + bucket->bucket_id = ntohl(ob->bucket_id); + if (bucket->bucket_id > OFPG15_BUCKET_MAX) { + VLOG_WARN_RL(&bad_ofmsg_rl, "bucket id (%u) is out of range", + bucket->bucket_id); + err = OFPERR_OFPGMFC_BAD_BUCKET; + goto err; + } + + bucket->ofpacts = ofpbuf_steal_data(&ofpacts); + bucket->ofpacts_len = ofpacts.size; + list_push_back(buckets, &bucket->list_node); + + continue; + + err: + free(bucket); + ofpbuf_uninit(&ofpacts); + ofputil_bucket_list_destroy(buckets); + return err; + } + + if (ofputil_bucket_check_duplicate_id(buckets)) { + VLOG_WARN_RL(&bad_ofmsg_rl, "Duplicate bucket id"); + ofputil_bucket_list_destroy(buckets); + return OFPERR_OFPGMFC_BAD_BUCKET; + } + + return 0; +} + +static void +ofputil_init_group_properties(struct ofputil_group_props *gp) +{ + memset(gp, 0, sizeof *gp); +} + +static enum ofperr +parse_group_prop_ntr_selection_method(struct ofpbuf *payload, + enum ofp11_group_type group_type, + enum ofp15_group_mod_command group_cmd, + struct ofputil_group_props *gp) +{ + struct ntr_group_prop_selection_method *prop = payload->data; + size_t fields_len, method_len; + enum ofperr error; + + switch (group_type) { + case OFPGT11_SELECT: + break; + case OFPGT11_ALL: + case OFPGT11_INDIRECT: + case OFPGT11_FF: + log_property(false, "ntr selection method property is only allowed " + "for select groups"); + return OFPERR_OFPBPC_BAD_VALUE; + default: + OVS_NOT_REACHED(); + } + + switch (group_cmd) { + case OFPGC15_ADD: + case OFPGC15_MODIFY: + break; + case OFPGC15_DELETE: + case OFPGC15_INSERT_BUCKET: + case OFPGC15_REMOVE_BUCKET: + log_property(false, "ntr selection method property is only allowed " + "for add and delete group modifications"); + return OFPERR_OFPBPC_BAD_VALUE; + default: + OVS_NOT_REACHED(); + } + + if (payload->size < sizeof *prop) { + log_property(false, "ntr selection method property length " + "%u is not valid", payload->size); + return OFPERR_OFPBPC_BAD_LEN; + } + + method_len = strnlen(prop->selection_method, NTR_MAX_SELECTION_METHOD_LEN); + + if (method_len == NTR_MAX_SELECTION_METHOD_LEN) { + log_property(false, "ntr selection method is not null terminated"); + return OFPERR_OFPBPC_BAD_VALUE; + } + + if (strcmp("hash", prop->selection_method)) { + log_property(false, "ntr selection method '%s' is not supported", + prop->selection_method); + return OFPERR_OFPBPC_BAD_VALUE; + } + + strcpy(gp->selection_method, prop->selection_method); + gp->selection_method_param = ntohll(prop->selection_method_param); + + if (!method_len && gp->selection_method_param) { + log_property(false, "ntr selection method parameter is non-zero but " + "selection method is empty"); + return OFPERR_OFPBPC_BAD_VALUE; + } + + ofpbuf_pull(payload, sizeof *prop); + + fields_len = ntohs(prop->length) - sizeof *prop; + if (!method_len && fields_len) { + log_property(false, "ntr selection method parameter is zero " + "but fields are provided"); + return OFPERR_OFPBPC_BAD_VALUE; + } + + error = oxm_pull_field_array(payload->data, fields_len, + &gp->fields); + if (error) { + log_property(false, "ntr selection method fields are invalid"); + return error; + } + + return 0; +} + +static enum ofperr +parse_group_prop_ntr(struct ofpbuf *payload, uint32_t exp_type, + enum ofp11_group_type group_type, + enum ofp15_group_mod_command group_cmd, + struct ofputil_group_props *gp) +{ + enum ofperr error; + + switch (exp_type) { + case NTRT_SELECTION_METHOD: + error = parse_group_prop_ntr_selection_method(payload, group_type, + group_cmd, gp); + break; + + default: + log_property(false, "unknown group property ntr experimenter type " + "%"PRIu32, exp_type); + error = OFPERR_OFPBPC_BAD_TYPE; + break; + } + + return error; +} + +static enum ofperr +parse_ofp15_group_prop_exp(struct ofpbuf *payload, + enum ofp11_group_type group_type, + enum ofp15_group_mod_command group_cmd, + struct ofputil_group_props *gp) +{ + struct ofp_prop_experimenter *prop = payload->data; + uint16_t experimenter; + uint32_t exp_type; + enum ofperr error; + + if (payload->size < sizeof *prop) { + return OFPERR_OFPBPC_BAD_LEN; + } + + experimenter = ntohl(prop->experimenter); + exp_type = ntohl(prop->exp_type); + + switch (experimenter) { + case NTR_VENDOR_ID: + error = parse_group_prop_ntr(payload, exp_type, group_type, + group_cmd, gp); + break; + + default: + log_property(false, "unknown group property experimenter %"PRIu16, + experimenter); + error = OFPERR_OFPBPC_BAD_EXPERIMENTER; + break; + } + + return error; +} + +static enum ofperr +parse_ofp15_group_properties(struct ofpbuf *msg, + enum ofp11_group_type group_type, + enum ofp15_group_mod_command group_cmd, + struct ofputil_group_props *gp, + size_t properties_len) +{ + struct ofpbuf properties; + + ofpbuf_use_const(&properties, ofpbuf_pull(msg, properties_len), + properties_len); + + while (properties.size > 0) { + struct ofpbuf payload; + enum ofperr error; + uint16_t type; + + error = ofputil_pull_property(&properties, &payload, &type); + if (error) { + return error; + } + + switch (type) { + case OFPGPT15_EXPERIMENTER: + error = parse_ofp15_group_prop_exp(&payload, group_type, + group_cmd, gp); + break; + + default: + log_property(false, "unknown group property %"PRIu16, type); + error = OFPERR_OFPBPC_BAD_TYPE; + break; + } + + if (error) { + return error; + } + } + + return 0; +} + +static int +ofputil_decode_ofp11_group_desc_reply(struct ofputil_group_desc *gd, + struct ofpbuf *msg, + enum ofp_version version) +{ + struct ofp11_group_desc_stats *ogds; + size_t length; + + if (!msg->header) { + ofpraw_pull_assert(msg); + } + + if (!msg->size) { + return EOF; + } + + ogds = ofpbuf_try_pull(msg, sizeof *ogds); + if (!ogds) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply has %"PRIu32" " + "leftover bytes at end", msg->size); + return OFPERR_OFPBRC_BAD_LEN; + } gd->type = ogds->type; gd->group_id = ntohl(ogds->group_id); length = ntohs(ogds->length); - if (length < sizeof *ogds || length - sizeof *ogds > ofpbuf_size(msg)) { + if (length < sizeof *ogds || length - sizeof *ogds > msg->size) { VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply claims invalid " "length %"PRIuSIZE, length); return OFPERR_OFPBRC_BAD_LEN; } - return ofputil_pull_buckets(msg, length - sizeof *ogds, version, - &gd->buckets); + return ofputil_pull_ofp11_buckets(msg, length - sizeof *ogds, version, + &gd->buckets); } -/* Converts abstract group mod 'gm' into a message for OpenFlow version - * 'ofp_version' and returns the message. */ -struct ofpbuf * -ofputil_encode_group_mod(enum ofp_version ofp_version, - const struct ofputil_group_mod *gm) +static int +ofputil_decode_ofp15_group_desc_reply(struct ofputil_group_desc *gd, + struct ofpbuf *msg, + enum ofp_version version) +{ + struct ofp15_group_desc_stats *ogds; + uint16_t length, bucket_list_len; + int error; + + if (!msg->header) { + ofpraw_pull_assert(msg); + } + + if (!msg->size) { + return EOF; + } + + ogds = ofpbuf_try_pull(msg, sizeof *ogds); + if (!ogds) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply has %"PRIu32" " + "leftover bytes at end", msg->size); + return OFPERR_OFPBRC_BAD_LEN; + } + gd->type = ogds->type; + gd->group_id = ntohl(ogds->group_id); + + length = ntohs(ogds->length); + if (length < sizeof *ogds || length - sizeof *ogds > msg->size) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply claims invalid " + "length %u", length); + return OFPERR_OFPBRC_BAD_LEN; + } + + bucket_list_len = ntohs(ogds->bucket_list_len); + if (length < bucket_list_len + sizeof *ogds) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply claims invalid " + "bucket list length %u", bucket_list_len); + return OFPERR_OFPBRC_BAD_LEN; + } + error = ofputil_pull_ofp15_buckets(msg, bucket_list_len, version, + &gd->buckets); + if (error) { + return error; + } + + /* By definition group desc messages don't have a group mod command. + * However, parse_group_prop_ntr_selection_method() checks to make sure + * that the command is OFPGC15_ADD or OFPGC15_DELETE to guard + * against group mod messages with other commands supplying + * a NTR selection method group experimenter property. + * Such properties are valid for group desc replies so + * claim that the group mod command is OFPGC15_ADD to + * satisfy the check in parse_group_prop_ntr_selection_method() */ + return parse_ofp15_group_properties(msg, gd->type, OFPGC15_ADD, &gd->props, + msg->size); +} + +/* Converts a group description reply in 'msg' into an abstract + * ofputil_group_desc in 'gd'. + * + * Multiple group description replies can be packed into a single OpenFlow + * message. Calling this function multiple times for a single 'msg' iterates + * through the replies. The caller must initially leave 'msg''s layer pointers + * null and not modify them between calls. + * + * Returns 0 if successful, EOF if no replies were left in this 'msg', + * otherwise a positive errno value. */ +int +ofputil_decode_group_desc_reply(struct ofputil_group_desc *gd, + struct ofpbuf *msg, enum ofp_version version) +{ + ofputil_init_group_properties(&gd->props); + + switch (version) + { + case OFP11_VERSION: + case OFP12_VERSION: + case OFP13_VERSION: + case OFP14_VERSION: + return ofputil_decode_ofp11_group_desc_reply(gd, msg, version); + + case OFP15_VERSION: + return ofputil_decode_ofp15_group_desc_reply(gd, msg, version); + + case OFP10_VERSION: + default: + OVS_NOT_REACHED(); + } +} + +void +ofputil_uninit_group_mod(struct ofputil_group_mod *gm) +{ + ofputil_bucket_list_destroy(&gm->buckets); +} + +static struct ofpbuf * +ofputil_encode_ofp11_group_mod(enum ofp_version ofp_version, + const struct ofputil_group_mod *gm) { struct ofpbuf *b; struct ofp11_group_mod *ogm; size_t start_ogm; - size_t start_bucket; struct ofputil_bucket *bucket; - struct ofp11_bucket *ob; - switch (ofp_version) { - case OFP10_VERSION: { - if (gm->command == OFPGC11_ADD) { - ovs_fatal(0, "add-group needs OpenFlow 1.1 or later " - "(\'-O OpenFlow11\')"); - } else if (gm->command == OFPGC11_MODIFY) { - ovs_fatal(0, "mod-group needs OpenFlow 1.1 or later " - "(\'-O OpenFlow11\')"); + b = ofpraw_alloc(OFPRAW_OFPT11_GROUP_MOD, ofp_version, 0); + start_ogm = b->size; + ofpbuf_put_zeros(b, sizeof *ogm); + + LIST_FOR_EACH (bucket, list_node, &gm->buckets) { + ofputil_put_ofp11_bucket(bucket, b, ofp_version); + } + ogm = ofpbuf_at_assert(b, start_ogm, sizeof *ogm); + ogm->command = htons(gm->command); + ogm->type = gm->type; + ogm->group_id = htonl(gm->group_id); + + return b; +} + +static struct ofpbuf * +ofputil_encode_ofp15_group_mod(enum ofp_version ofp_version, + const struct ofputil_group_mod *gm) +{ + struct ofpbuf *b; + struct ofp15_group_mod *ogm; + size_t start_ogm; + struct ofputil_bucket *bucket; + struct id_pool *bucket_ids = NULL; + + b = ofpraw_alloc(OFPRAW_OFPT15_GROUP_MOD, ofp_version, 0); + start_ogm = b->size; + ofpbuf_put_zeros(b, sizeof *ogm); + + LIST_FOR_EACH (bucket, list_node, &gm->buckets) { + uint32_t bucket_id; + + /* Generate a bucket id if none was supplied */ + if (bucket->bucket_id > OFPG15_BUCKET_MAX) { + if (!bucket_ids) { + const struct ofputil_bucket *bkt; + + bucket_ids = id_pool_create(0, OFPG15_BUCKET_MAX + 1); + + /* Mark all bucket_ids that are present in gm + * as used in the pool. */ + LIST_FOR_EACH_REVERSE (bkt, list_node, &gm->buckets) { + if (bkt == bucket) { + break; + } + if (bkt->bucket_id <= OFPG15_BUCKET_MAX) { + id_pool_add(bucket_ids, bkt->bucket_id); + } + } + } + + if (!id_pool_alloc_id(bucket_ids, &bucket_id)) { + OVS_NOT_REACHED(); + } } else { - ovs_fatal(0, "del-groups needs OpenFlow 1.1 or later " - "(\'-O OpenFlow11\')"); + bucket_id = bucket->bucket_id; } + + ofputil_put_ofp15_bucket(bucket, bucket_id, gm->type, b, ofp_version); } + ogm = ofpbuf_at_assert(b, start_ogm, sizeof *ogm); + ogm->command = htons(gm->command); + ogm->type = gm->type; + ogm->group_id = htonl(gm->group_id); + ogm->command_bucket_id = htonl(gm->command_bucket_id); + ogm->bucket_array_len = htons(b->size - start_ogm - sizeof *ogm); + + /* Add group properties */ + if (gm->props.selection_method[0]) { + ofputil_put_group_prop_ntr_selection_method(ofp_version, &gm->props, b); + } + + id_pool_destroy(bucket_ids); + return b; +} + +static void +bad_group_cmd(enum ofp15_group_mod_command cmd) +{ + const char *opt_version; + const char *version; + const char *cmd_str; + + switch (cmd) { + case OFPGC15_ADD: + case OFPGC15_MODIFY: + case OFPGC15_DELETE: + version = "1.1"; + opt_version = "11"; + break; + + case OFPGC15_INSERT_BUCKET: + case OFPGC15_REMOVE_BUCKET: + version = "1.5"; + opt_version = "15"; + break; + + default: + OVS_NOT_REACHED(); + } + + switch (cmd) { + case OFPGC15_ADD: + cmd_str = "add-group"; + break; + + case OFPGC15_MODIFY: + cmd_str = "mod-group"; + break; + + case OFPGC15_DELETE: + cmd_str = "del-group"; + break; + + case OFPGC15_INSERT_BUCKET: + cmd_str = "insert-bucket"; + break; + + case OFPGC15_REMOVE_BUCKET: + cmd_str = "remove-bucket"; + break; + + default: + OVS_NOT_REACHED(); + } + + ovs_fatal(0, "%s needs OpenFlow %s or later (\'-O OpenFlow%s\')", + cmd_str, version, opt_version); + +} + +/* Converts abstract group mod 'gm' into a message for OpenFlow version + * 'ofp_version' and returns the message. */ +struct ofpbuf * +ofputil_encode_group_mod(enum ofp_version ofp_version, + const struct ofputil_group_mod *gm) +{ + + switch (ofp_version) { + case OFP10_VERSION: + bad_group_cmd(gm->command); case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: case OFP14_VERSION: + if (gm->command > OFPGC11_DELETE) { + bad_group_cmd(gm->command); + } + return ofputil_encode_ofp11_group_mod(ofp_version, gm); + case OFP15_VERSION: - b = ofpraw_alloc(OFPRAW_OFPT11_GROUP_MOD, ofp_version, 0); - start_ogm = ofpbuf_size(b); - ofpbuf_put_zeros(b, sizeof *ogm); - - LIST_FOR_EACH (bucket, list_node, &gm->buckets) { - start_bucket = ofpbuf_size(b); - ofpbuf_put_zeros(b, sizeof *ob); - if (bucket->ofpacts && bucket->ofpacts_len) { - ofpacts_put_openflow_actions(bucket->ofpacts, - bucket->ofpacts_len, b, - ofp_version); - } - ob = ofpbuf_at_assert(b, start_bucket, sizeof *ob); - ob->len = htons(ofpbuf_size(b) - start_bucket);; - ob->weight = htons(bucket->weight); - ob->watch_port = ofputil_port_to_ofp11(bucket->watch_port); - ob->watch_group = htonl(bucket->watch_group); - } - ogm = ofpbuf_at_assert(b, start_ogm, sizeof *ogm); - ogm->command = htons(gm->command); - ogm->type = gm->type; - ogm->group_id = htonl(gm->group_id); + return ofputil_encode_ofp15_group_mod(ofp_version, gm); + default: + OVS_NOT_REACHED(); + } +} + +static enum ofperr +ofputil_pull_ofp11_group_mod(struct ofpbuf *msg, enum ofp_version ofp_version, + struct ofputil_group_mod *gm) +{ + const struct ofp11_group_mod *ogm; + enum ofperr error; + + ogm = ofpbuf_pull(msg, sizeof *ogm); + gm->command = ntohs(ogm->command); + gm->type = ogm->type; + gm->group_id = ntohl(ogm->group_id); + gm->command_bucket_id = OFPG15_BUCKET_ALL; + + error = ofputil_pull_ofp11_buckets(msg, msg->size, ofp_version, + &gm->buckets); + + /* OF1.3.5+ prescribes an error when an OFPGC_DELETE includes buckets. */ + if (!error + && ofp_version >= OFP13_VERSION + && gm->command == OFPGC11_DELETE + && !list_is_empty(&gm->buckets)) { + error = OFPERR_OFPGMFC_INVALID_GROUP; + } + + return error; +} + +static enum ofperr +ofputil_pull_ofp15_group_mod(struct ofpbuf *msg, enum ofp_version ofp_version, + struct ofputil_group_mod *gm) +{ + const struct ofp15_group_mod *ogm; + uint16_t bucket_list_len; + enum ofperr error = OFPERR_OFPGMFC_BAD_BUCKET; + + ogm = ofpbuf_pull(msg, sizeof *ogm); + gm->command = ntohs(ogm->command); + gm->type = ogm->type; + gm->group_id = ntohl(ogm->group_id); + + gm->command_bucket_id = ntohl(ogm->command_bucket_id); + switch (gm->command) { + case OFPGC15_REMOVE_BUCKET: + if (gm->command_bucket_id == OFPG15_BUCKET_ALL) { + error = 0; + } + /* Fall through */ + case OFPGC15_INSERT_BUCKET: + if (gm->command_bucket_id <= OFPG15_BUCKET_MAX || + gm->command_bucket_id == OFPG15_BUCKET_FIRST + || gm->command_bucket_id == OFPG15_BUCKET_LAST) { + error = 0; + } break; + case OFPGC11_ADD: + case OFPGC11_MODIFY: + case OFPGC11_DELETE: default: - OVS_NOT_REACHED(); + if (gm->command_bucket_id == OFPG15_BUCKET_ALL) { + error = 0; + } + break; + } + if (error) { + VLOG_WARN_RL(&bad_ofmsg_rl, + "group command bucket id (%u) is out of range", + gm->command_bucket_id); + return OFPERR_OFPGMFC_BAD_BUCKET; } - return b; + bucket_list_len = ntohs(ogm->bucket_array_len); + error = ofputil_pull_ofp15_buckets(msg, bucket_list_len, ofp_version, + &gm->buckets); + if (error) { + return error; + } + + return parse_ofp15_group_properties(msg, gm->type, gm->command, &gm->props, + msg->size); } /* Converts OpenFlow group mod message 'oh' into an abstract group mod in @@ -7144,7 +8288,7 @@ ofputil_decode_group_mod(const struct ofp_header *oh, struct ofputil_group_mod *gm) { - const struct ofp11_group_mod *ogm; + enum ofp_version ofp_version = oh->version; struct ofpbuf msg; struct ofputil_bucket *bucket; enum ofperr err; @@ -7152,16 +8296,59 @@ ofpbuf_use_const(&msg, oh, ntohs(oh->length)); ofpraw_pull_assert(&msg); - ogm = ofpbuf_pull(&msg, sizeof *ogm); - gm->command = ntohs(ogm->command); - gm->type = ogm->type; - gm->group_id = ntohl(ogm->group_id); + ofputil_init_group_properties(&gm->props); + + switch (ofp_version) + { + case OFP11_VERSION: + case OFP12_VERSION: + case OFP13_VERSION: + case OFP14_VERSION: + err = ofputil_pull_ofp11_group_mod(&msg, ofp_version, gm); + break; + + case OFP15_VERSION: + err = ofputil_pull_ofp15_group_mod(&msg, ofp_version, gm); + break; + + case OFP10_VERSION: + default: + OVS_NOT_REACHED(); + } - err = ofputil_pull_buckets(&msg, ofpbuf_size(&msg), oh->version, &gm->buckets); if (err) { return err; } + switch (gm->type) { + case OFPGT11_INDIRECT: + if (!list_is_singleton(&gm->buckets)) { + return OFPERR_OFPGMFC_OUT_OF_BUCKETS; + } + break; + case OFPGT11_ALL: + case OFPGT11_SELECT: + case OFPGT11_FF: + break; + default: + OVS_NOT_REACHED(); + } + + switch (gm->command) { + case OFPGC11_ADD: + case OFPGC11_MODIFY: + case OFPGC11_DELETE: + case OFPGC15_INSERT_BUCKET: + break; + case OFPGC15_REMOVE_BUCKET: + if (!list_is_empty(&gm->buckets)) { + return OFPERR_OFPGMFC_BAD_BUCKET; + } + break; + default: + OVS_NOT_REACHED(); + } + LIST_FOR_EACH (bucket, list_node, &gm->buckets) { switch (gm->type) { case OFPGT11_ALL: @@ -7218,9 +8405,9 @@ } } -/* Encode a queue statsrequest for 'oqsr', the encoded message - * will be fore Open Flow version 'ofp_version'. Returns message - * as a struct ofpbuf. Returns encoded message on success, NULL on error */ +/* Encode a queue stats request for 'oqsr', the encoded message + * will be for OpenFlow version 'ofp_version'. Returns message + * as a struct ofpbuf. Returns encoded message on success, NULL on error. */ struct ofpbuf * ofputil_encode_queue_stats_request(enum ofp_version ofp_version, const struct ofputil_queue_stats_request *oqsr) @@ -7334,7 +8521,7 @@ } len = ntohs(qs14->length); - if (len < sizeof *qs14 || len - sizeof *qs14 > ofpbuf_size(msg)) { + if (len < sizeof *qs14 || len - sizeof *qs14 > msg->size) { return OFPERR_OFPBRC_BAD_LEN; } ofpbuf_pull(msg, len - sizeof *qs14); @@ -7360,14 +8547,13 @@ enum ofperr error; enum ofpraw raw; - error = (msg->frame - ? ofpraw_decode(&raw, msg->frame) + error = (msg->header ? ofpraw_decode(&raw, msg->header) : ofpraw_pull(&raw, msg)); if (error) { return error; } - if (!ofpbuf_size(msg)) { + if (!msg->size) { return EOF; } else if (raw == OFPRAW_OFPST14_QUEUE_REPLY) { return ofputil_pull_ofp14_queue_stats(qs, msg); @@ -7401,7 +8587,7 @@ bad_len: VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_QUEUE reply has %"PRIu32" leftover " - "bytes at end", ofpbuf_size(msg)); + "bytes at end", msg->size); return OFPERR_OFPBRC_BAD_LEN; } @@ -7454,7 +8640,7 @@ /* Encode a queue stat for 'oqs' and append it to 'replies'. */ void -ofputil_append_queue_stat(struct list *replies, +ofputil_append_queue_stat(struct ovs_list *replies, const struct ofputil_queue_stats *oqs) { switch (ofpmp_version(replies)) { @@ -7501,7 +8687,7 @@ raw = ofpraw_pull_assert(&b); ovs_assert(raw == OFPRAW_OFPT14_BUNDLE_CONTROL); - m = ofpbuf_l3(&b); + m = b.msg; msg->bundle_id = ntohl(m->bundle_id); msg->type = ntohs(m->type); msg->flags = ntohs(m->flags); @@ -7510,6 +8696,36 @@ } struct ofpbuf * +ofputil_encode_bundle_ctrl_request(enum ofp_version ofp_version, + struct ofputil_bundle_ctrl_msg *bc) +{ + struct ofpbuf *request; + struct ofp14_bundle_ctrl_msg *m; + + switch (ofp_version) { + case OFP10_VERSION: + case OFP11_VERSION: + case OFP12_VERSION: + case OFP13_VERSION: + ovs_fatal(0, "bundles need OpenFlow 1.4 or later " + "(\'-O OpenFlow14\')"); + case OFP14_VERSION: + case OFP15_VERSION: + request = ofpraw_alloc(OFPRAW_OFPT14_BUNDLE_CONTROL, ofp_version, 0); + m = ofpbuf_put_zeros(request, sizeof *m); + + m->bundle_id = htonl(bc->bundle_id); + m->type = htons(bc->type); + m->flags = htons(bc->flags); + break; + default: + OVS_NOT_REACHED(); + } + + return request; +} + +struct ofpbuf * ofputil_encode_bundle_ctrl_reply(const struct ofp_header *oh, struct ofputil_bundle_ctrl_msg *msg) { @@ -7526,14 +8742,103 @@ return buf; } +/* Return true for bundlable state change requests, false for other messages. + */ +static bool +ofputil_is_bundlable(enum ofptype type) +{ + switch (type) { + /* Minimum required by OpenFlow 1.4. */ + case OFPTYPE_PORT_MOD: + case OFPTYPE_FLOW_MOD: + return true; + + /* Nice to have later. */ + case OFPTYPE_FLOW_MOD_TABLE_ID: + case OFPTYPE_GROUP_MOD: + case OFPTYPE_TABLE_MOD: + case OFPTYPE_METER_MOD: + case OFPTYPE_PACKET_OUT: + + /* Not to be bundlable. */ + case OFPTYPE_ECHO_REQUEST: + case OFPTYPE_FEATURES_REQUEST: + case OFPTYPE_GET_CONFIG_REQUEST: + case OFPTYPE_SET_CONFIG: + case OFPTYPE_BARRIER_REQUEST: + case OFPTYPE_ROLE_REQUEST: + case OFPTYPE_ECHO_REPLY: + case OFPTYPE_SET_FLOW_FORMAT: + case OFPTYPE_SET_PACKET_IN_FORMAT: + case OFPTYPE_SET_CONTROLLER_ID: + case OFPTYPE_FLOW_AGE: + case OFPTYPE_FLOW_MONITOR_CANCEL: + case OFPTYPE_SET_ASYNC_CONFIG: + case OFPTYPE_GET_ASYNC_REQUEST: + case OFPTYPE_DESC_STATS_REQUEST: + case OFPTYPE_FLOW_STATS_REQUEST: + case OFPTYPE_AGGREGATE_STATS_REQUEST: + case OFPTYPE_TABLE_STATS_REQUEST: + case OFPTYPE_TABLE_FEATURES_STATS_REQUEST: + case OFPTYPE_PORT_STATS_REQUEST: + case OFPTYPE_QUEUE_STATS_REQUEST: + case OFPTYPE_PORT_DESC_STATS_REQUEST: + case OFPTYPE_FLOW_MONITOR_STATS_REQUEST: + case OFPTYPE_METER_STATS_REQUEST: + case OFPTYPE_METER_CONFIG_STATS_REQUEST: + case OFPTYPE_METER_FEATURES_STATS_REQUEST: + case OFPTYPE_GROUP_STATS_REQUEST: + case OFPTYPE_GROUP_DESC_STATS_REQUEST: + case OFPTYPE_GROUP_FEATURES_STATS_REQUEST: + case OFPTYPE_QUEUE_GET_CONFIG_REQUEST: + case OFPTYPE_BUNDLE_CONTROL: + case OFPTYPE_BUNDLE_ADD_MESSAGE: + case OFPTYPE_HELLO: + case OFPTYPE_ERROR: + case OFPTYPE_FEATURES_REPLY: + case OFPTYPE_GET_CONFIG_REPLY: + case OFPTYPE_PACKET_IN: + case OFPTYPE_FLOW_REMOVED: + case OFPTYPE_PORT_STATUS: + case OFPTYPE_BARRIER_REPLY: + case OFPTYPE_QUEUE_GET_CONFIG_REPLY: + case OFPTYPE_DESC_STATS_REPLY: + case OFPTYPE_FLOW_STATS_REPLY: + case OFPTYPE_QUEUE_STATS_REPLY: + case OFPTYPE_PORT_STATS_REPLY: + case OFPTYPE_TABLE_STATS_REPLY: + case OFPTYPE_AGGREGATE_STATS_REPLY: + case OFPTYPE_PORT_DESC_STATS_REPLY: + case OFPTYPE_ROLE_REPLY: + case OFPTYPE_FLOW_MONITOR_PAUSED: + case OFPTYPE_FLOW_MONITOR_RESUMED: + case OFPTYPE_FLOW_MONITOR_STATS_REPLY: + case OFPTYPE_GET_ASYNC_REPLY: + case OFPTYPE_GROUP_STATS_REPLY: + case OFPTYPE_GROUP_DESC_STATS_REPLY: + case OFPTYPE_GROUP_FEATURES_STATS_REPLY: + case OFPTYPE_METER_STATS_REPLY: + case OFPTYPE_METER_CONFIG_STATS_REPLY: + case OFPTYPE_METER_FEATURES_STATS_REPLY: + case OFPTYPE_TABLE_FEATURES_STATS_REPLY: + case OFPTYPE_ROLE_STATUS: + break; + } + + return false; +} + enum ofperr ofputil_decode_bundle_add(const struct ofp_header *oh, - struct ofputil_bundle_add_msg *msg) + struct ofputil_bundle_add_msg *msg, + enum ofptype *type_ptr) { const struct ofp14_bundle_ctrl_msg *m; struct ofpbuf b; enum ofpraw raw; size_t inner_len; + enum ofperr error; + enum ofptype type; ofpbuf_use_const(&b, oh, ntohs(oh->length)); raw = ofpraw_pull_assert(&b); @@ -7543,11 +8848,29 @@ msg->bundle_id = ntohl(m->bundle_id); msg->flags = ntohs(m->flags); - msg->msg = ofpbuf_data(&b); + msg->msg = b.data; inner_len = ntohs(msg->msg->length); - if (inner_len < sizeof(struct ofp_header) || inner_len > ofpbuf_size(&b)) { + if (inner_len < sizeof(struct ofp_header) || inner_len > b.size) { return OFPERR_OFPBFC_MSG_BAD_LEN; } + if (msg->msg->xid != oh->xid) { + return OFPERR_OFPBFC_MSG_BAD_XID; + } + + /* Reject unbundlable messages. */ + if (!type_ptr) { + type_ptr = &type; + } + error = ofptype_decode(type_ptr, msg->msg); + if (error) { + VLOG_WARN_RL(&bad_ofmsg_rl, "OFPT14_BUNDLE_ADD_MESSAGE contained " + "message is unparsable (%s)", ofperr_get_name(error)); + return OFPERR_OFPBFC_MSG_UNSUP; /* 'error' would be confusing. */ + } + + if (!ofputil_is_bundlable(*type_ptr)) { + return OFPERR_OFPBFC_MSG_UNSUP; + } return 0; } @@ -7559,7 +8882,9 @@ struct ofpbuf *request; struct ofp14_bundle_ctrl_msg *m; - request = ofpraw_alloc(OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE, ofp_version, 0); + /* Must use the same xid as the embedded message. */ + request = ofpraw_alloc_xid(OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE, ofp_version, + msg->msg->xid, 0); m = ofpbuf_put_zeros(request, sizeof *m); m->bundle_id = htonl(msg->bundle_id); diff -Nru openvswitch-2.3.1/lib/ofp-util.def openvswitch-2.4.0~git20150623/lib/ofp-util.def --- openvswitch-2.3.1/lib/ofp-util.def 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-util.def 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* -*- c -*- */ - -#ifndef OFPAT10_ACTION -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) -#endif -OFPAT10_ACTION(OFPAT10_OUTPUT, ofp10_action_output, "output") -OFPAT10_ACTION(OFPAT10_SET_VLAN_VID, ofp_action_vlan_vid, "mod_vlan_vid") -OFPAT10_ACTION(OFPAT10_SET_VLAN_PCP, ofp_action_vlan_pcp, "mod_vlan_pcp") -OFPAT10_ACTION(OFPAT10_STRIP_VLAN, ofp_action_header, "strip_vlan") -OFPAT10_ACTION(OFPAT10_SET_DL_SRC, ofp_action_dl_addr, "mod_dl_src") -OFPAT10_ACTION(OFPAT10_SET_DL_DST, ofp_action_dl_addr, "mod_dl_dst") -OFPAT10_ACTION(OFPAT10_SET_NW_SRC, ofp_action_nw_addr, "mod_nw_src") -OFPAT10_ACTION(OFPAT10_SET_NW_DST, ofp_action_nw_addr, "mod_nw_dst") -OFPAT10_ACTION(OFPAT10_SET_NW_TOS, ofp_action_nw_tos, "mod_nw_tos") -OFPAT10_ACTION(OFPAT10_SET_TP_SRC, ofp_action_tp_port, "mod_tp_src") -OFPAT10_ACTION(OFPAT10_SET_TP_DST, ofp_action_tp_port, "mod_tp_dst") -OFPAT10_ACTION(OFPAT10_ENQUEUE, ofp10_action_enqueue, "enqueue") - -#ifndef OFPAT11_ACTION -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) -#endif -OFPAT11_ACTION(OFPAT11_OUTPUT, ofp11_action_output, 0, "output") -OFPAT11_ACTION(OFPAT11_SET_VLAN_VID, ofp_action_vlan_vid, 0, "set_vlan_vid") -OFPAT11_ACTION(OFPAT11_SET_VLAN_PCP, ofp_action_vlan_pcp, 0, "set_vlan_pcp") -OFPAT11_ACTION(OFPAT11_SET_DL_SRC, ofp_action_dl_addr, 0, "mod_dl_src") -OFPAT11_ACTION(OFPAT11_SET_DL_DST, ofp_action_dl_addr, 0, "mod_dl_dst") -OFPAT11_ACTION(OFPAT11_SET_NW_SRC, ofp_action_nw_addr, 0, "mod_nw_src") -OFPAT11_ACTION(OFPAT11_SET_NW_DST, ofp_action_nw_addr, 0, "mod_nw_dst") -OFPAT11_ACTION(OFPAT11_SET_NW_TOS, ofp_action_nw_tos, 0, "mod_nw_tos") -OFPAT11_ACTION(OFPAT11_SET_NW_ECN, ofp11_action_nw_ecn, 0, "mod_nw_ecn") -OFPAT11_ACTION(OFPAT11_SET_TP_SRC, ofp_action_tp_port, 0, "mod_tp_src") -OFPAT11_ACTION(OFPAT11_SET_TP_DST, ofp_action_tp_port, 0, "mod_tp_dst") -OFPAT11_ACTION(OFPAT11_SET_MPLS_LABEL, ofp11_action_mpls_label, 0, "set_mpls_label") -OFPAT11_ACTION(OFPAT11_SET_MPLS_TC, ofp11_action_mpls_tc, 0, "set_mpls_tc") -OFPAT11_ACTION(OFPAT11_SET_MPLS_TTL, ofp11_action_mpls_ttl, 0, "set_mpls_ttl") -OFPAT11_ACTION(OFPAT11_DEC_MPLS_TTL, ofp_action_header, 0, "dec_mpls_ttl") -OFPAT11_ACTION(OFPAT11_PUSH_VLAN, ofp11_action_push, 0, "push_vlan") -OFPAT11_ACTION(OFPAT11_POP_VLAN, ofp_action_header, 0, "pop_vlan") -OFPAT11_ACTION(OFPAT11_PUSH_MPLS, ofp11_action_push, 0, "push_mpls") -OFPAT11_ACTION(OFPAT11_POP_MPLS, ofp11_action_pop_mpls, 0, "pop_mpls") -OFPAT11_ACTION(OFPAT11_SET_QUEUE, ofp11_action_set_queue, 0, "set_queue") -OFPAT11_ACTION(OFPAT11_SET_NW_TTL, ofp11_action_nw_ttl, 0, "mod_nw_ttl") -OFPAT11_ACTION(OFPAT11_DEC_NW_TTL, ofp_action_header, 0, NULL) -OFPAT11_ACTION(OFPAT12_SET_FIELD, ofp12_action_set_field, 1, "set_field") -OFPAT11_ACTION(OFPAT11_GROUP, ofp11_action_group, 0, "group") - -#ifndef OFPAT13_ACTION -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) -#endif -OFPAT13_ACTION(OFPAT13_OUTPUT, ofp11_action_output, 0, "output") -OFPAT13_ACTION(OFPAT13_COPY_TTL_OUT, ofp_action_header, 0, "copy_ttl_out") -OFPAT13_ACTION(OFPAT13_COPY_TTL_IN, ofp_action_header, 0, "copy_ttl_in") -OFPAT13_ACTION(OFPAT13_SET_MPLS_TTL, ofp11_action_mpls_ttl, 0, "set_mpls_ttl") -OFPAT13_ACTION(OFPAT13_DEC_MPLS_TTL, ofp_action_header, 0, "dec_mpls_ttl") -OFPAT13_ACTION(OFPAT13_PUSH_VLAN, ofp11_action_push, 0, "push_vlan") -OFPAT13_ACTION(OFPAT13_POP_VLAN, ofp_action_header, 0, "pop_vlan") -OFPAT13_ACTION(OFPAT13_PUSH_MPLS, ofp11_action_push, 0, "push_mpls") -OFPAT13_ACTION(OFPAT13_POP_MPLS, ofp11_action_pop_mpls, 0, "pop_mpls") -OFPAT13_ACTION(OFPAT13_SET_QUEUE, ofp11_action_set_queue, 0, "set_queue") -OFPAT13_ACTION(OFPAT13_GROUP, ofp11_action_group, 0, "group") -OFPAT13_ACTION(OFPAT13_SET_NW_TTL, ofp11_action_nw_ttl, 0, "set_nw_ttl") -OFPAT13_ACTION(OFPAT13_DEC_NW_TTL, ofp_action_header, 0, "dec_nw_ttl") -OFPAT13_ACTION(OFPAT13_SET_FIELD, ofp12_action_set_field, 1, "set_field") -OFPAT13_ACTION(OFPAT13_PUSH_PBB, ofp11_action_push, 0, "push_pbb") -OFPAT13_ACTION(OFPAT13_POP_PBB, ofp_action_header, 0, "pop_pbb") - -#ifndef NXAST_ACTION -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) -#endif -NXAST_ACTION(NXAST_RESUBMIT, nx_action_resubmit, 0, "resubmit") -NXAST_ACTION(NXAST_SET_TUNNEL, nx_action_set_tunnel, 0, "set_tunnel") -NXAST_ACTION(NXAST_SET_QUEUE, nx_action_set_queue, 0, "set_queue") -NXAST_ACTION(NXAST_POP_QUEUE, nx_action_pop_queue, 0, "pop_queue") -NXAST_ACTION(NXAST_REG_MOVE, nx_action_reg_move, 0, "move") -NXAST_ACTION(NXAST_REG_LOAD, nx_action_reg_load, 0, "load") -NXAST_ACTION(NXAST_STACK_PUSH, nx_action_stack, 0, "push") -NXAST_ACTION(NXAST_STACK_POP, nx_action_stack, 0, "pop") -NXAST_ACTION(NXAST_NOTE, nx_action_note, 1, "note") -NXAST_ACTION(NXAST_SET_TUNNEL64, nx_action_set_tunnel64, 0, "set_tunnel64") -NXAST_ACTION(NXAST_MULTIPATH, nx_action_multipath, 0, "multipath") -NXAST_ACTION(NXAST_BUNDLE, nx_action_bundle, 1, "bundle") -NXAST_ACTION(NXAST_BUNDLE_LOAD, nx_action_bundle, 1, "bundle_load") -NXAST_ACTION(NXAST_RESUBMIT_TABLE, nx_action_resubmit, 0, NULL) -NXAST_ACTION(NXAST_OUTPUT_REG, nx_action_output_reg, 0, NULL) -NXAST_ACTION(NXAST_LEARN, nx_action_learn, 1, "learn") -NXAST_ACTION(NXAST_EXIT, nx_action_header, 0, "exit") -NXAST_ACTION(NXAST_DEC_TTL, nx_action_header, 0, "dec_ttl") -NXAST_ACTION(NXAST_FIN_TIMEOUT, nx_action_fin_timeout, 0, "fin_timeout") -NXAST_ACTION(NXAST_CONTROLLER, nx_action_controller, 0, "controller") -NXAST_ACTION(NXAST_DEC_TTL_CNT_IDS, nx_action_cnt_ids, 1, NULL) -NXAST_ACTION(NXAST_WRITE_METADATA, nx_action_write_metadata, 0, - "write_metadata") -NXAST_ACTION(NXAST_SET_MPLS_LABEL, nx_action_mpls_label, 0, "set_mpls_label") -NXAST_ACTION(NXAST_SET_MPLS_TC, nx_action_mpls_tc, 0, "set_mpls_tc") -NXAST_ACTION(NXAST_SET_MPLS_TTL, nx_action_mpls_ttl, 0, "set_mpls_ttl") -NXAST_ACTION(NXAST_DEC_MPLS_TTL, nx_action_header, 0, "dec_mpls_ttl") -NXAST_ACTION(NXAST_PUSH_MPLS, nx_action_push_mpls, 0, "push_mpls") -NXAST_ACTION(NXAST_POP_MPLS, nx_action_pop_mpls, 0, "pop_mpls") -NXAST_ACTION(NXAST_SAMPLE, nx_action_sample, 0, "sample") - -#undef OFPAT10_ACTION -#undef OFPAT11_ACTION -#undef OFPAT13_ACTION -#undef NXAST_ACTION diff -Nru openvswitch-2.3.1/lib/ofp-util.h openvswitch-2.4.0~git20150623/lib/ofp-util.h --- openvswitch-2.3.1/lib/ofp-util.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-util.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,9 @@ #include "flow.h" #include "list.h" #include "match.h" +#include "meta-flow.h" #include "netdev.h" +#include "openflow/netronome-ext.h" #include "openflow/nicira-ext.h" #include "openvswitch/types.h" #include "type-props.h" @@ -163,8 +165,8 @@ /* A bitmap of version numbers * * Bit offsets correspond to ofp_version numbers which in turn correspond to - * wire-protocol numbers for Open Flow versions.. E.g. (1u << OFP11_VERSION) - * is the mask for Open Flow 1.1. If the bit for a version is set then it is + * wire-protocol numbers for OpenFlow versions, e.g. (1u << OFP11_VERSION) + * is the mask for OpenFlow 1.1. If the bit for a version is set then it is * allowed, otherwise it is disallowed. */ void ofputil_format_version_bitmap(struct ds *msg, uint32_t bitmap); @@ -216,6 +218,8 @@ /* Work with ofp11_match. */ enum ofperr ofputil_pull_ofp11_match(struct ofpbuf *, struct match *, uint16_t *padded_match_len); +enum ofperr ofputil_pull_ofp11_mask(struct ofpbuf *, struct match *, + struct mf_bitmap *bm); enum ofperr ofputil_match_from_ofp11_match(const struct ofp11_match *, struct match *); int ofputil_put_ofp11_match(struct ofpbuf *, const struct match *, @@ -267,10 +271,10 @@ * The handling of cookies across multiple versions of OpenFlow is a bit * confusing. See DESIGN for the details. */ struct ofputil_flow_mod { - struct list list_node; /* For queuing flow_mods. */ + struct ovs_list list_node; /* For queuing flow_mods. */ struct match match; - unsigned int priority; + int priority; /* Cookie matching. The flow_mod affects only flows that have cookies that * bitwise match 'cookie' bits in positions where 'cookie_mask has 1-bits. @@ -305,8 +309,12 @@ ofp_port_t out_port; uint32_t out_group; enum ofputil_flow_mod_flags flags; + uint16_t importance; /* Eviction precedence. */ struct ofpact *ofpacts; /* Series of "struct ofpact"s. */ size_t ofpacts_len; /* Length of ofpacts, in bytes. */ + + /* Reason for delete; ignored for non-delete commands */ + enum ofp_flow_removed_reason delete_reason; }; enum ofperr ofputil_decode_flow_mod(struct ofputil_flow_mod *, @@ -351,6 +359,7 @@ const struct ofpact *ofpacts; size_t ofpacts_len; enum ofputil_flow_mod_flags flags; + uint16_t importance; /* Eviction precedence. */ }; int ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *, @@ -358,7 +367,7 @@ bool flow_age_extension, struct ofpbuf *ofpacts); void ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *, - struct list *replies); + struct ovs_list *replies); /* Aggregate stats reply, independent of protocol. */ struct ofputil_aggregate_stats { @@ -404,7 +413,7 @@ const void *packet; size_t packet_len; /* Number of bytes in 'packet'. */ size_t total_len; /* Size of packet, pre-truncation. */ - struct flow_metadata fmd; + struct match flow_metadata; /* Identifies a buffer in the switch that contains the full packet, to * allow the controller to reference it later without having to send the @@ -524,37 +533,6 @@ OFPUTIL_C_PORT_BLOCKED = 1 << 8, /* Switch will block looping ports */ }; -enum ofputil_action_bitmap { - OFPUTIL_A_OUTPUT = 1 << 0, - OFPUTIL_A_SET_VLAN_VID = 1 << 1, - OFPUTIL_A_SET_VLAN_PCP = 1 << 2, - OFPUTIL_A_STRIP_VLAN = 1 << 3, - OFPUTIL_A_SET_DL_SRC = 1 << 4, - OFPUTIL_A_SET_DL_DST = 1 << 5, - OFPUTIL_A_SET_NW_SRC = 1 << 6, - OFPUTIL_A_SET_NW_DST = 1 << 7, - OFPUTIL_A_SET_NW_ECN = 1 << 8, - OFPUTIL_A_SET_NW_TOS = 1 << 9, - OFPUTIL_A_SET_TP_SRC = 1 << 10, - OFPUTIL_A_SET_TP_DST = 1 << 11, - OFPUTIL_A_ENQUEUE = 1 << 12, - OFPUTIL_A_COPY_TTL_OUT = 1 << 13, - OFPUTIL_A_COPY_TTL_IN = 1 << 14, - OFPUTIL_A_SET_MPLS_LABEL = 1 << 15, - OFPUTIL_A_SET_MPLS_TC = 1 << 16, - OFPUTIL_A_SET_MPLS_TTL = 1 << 17, - OFPUTIL_A_DEC_MPLS_TTL = 1 << 18, - OFPUTIL_A_PUSH_VLAN = 1 << 19, - OFPUTIL_A_POP_VLAN = 1 << 20, - OFPUTIL_A_PUSH_MPLS = 1 << 21, - OFPUTIL_A_POP_MPLS = 1 << 22, - OFPUTIL_A_SET_QUEUE = 1 << 23, - OFPUTIL_A_GROUP = 1 << 24, - OFPUTIL_A_SET_NW_TTL = 1 << 25, - OFPUTIL_A_DEC_NW_TTL = 1 << 26, - OFPUTIL_A_SET_FIELD = 1 << 27, -}; - /* Abstract ofp_switch_features. */ struct ofputil_switch_features { uint64_t datapath_id; /* Datapath unique ID. */ @@ -562,7 +540,7 @@ uint8_t n_tables; /* Number of tables supported by datapath. */ uint8_t auxiliary_id; /* Identify auxiliary connections */ enum ofputil_capabilities capabilities; - enum ofputil_action_bitmap actions; + uint64_t ofpacts; /* Bitmap of OFPACT_* bits. */ }; enum ofperr ofputil_decode_switch_features(const struct ofp_header *, @@ -605,10 +583,39 @@ struct ofpbuf *ofputil_encode_port_mod(const struct ofputil_port_mod *, enum ofputil_protocol); +/* Abstract version of OFPTC11_TABLE_MISS_*. + * + * OpenFlow 1.0 always sends packets that miss to the next flow table, or to + * the controller if they miss in the last flow table. + * + * OpenFlow 1.1 and 1.2 can configure table miss behavior via a "table-mod" + * that specifies "send to controller", "miss", or "drop". + * + * OpenFlow 1.3 and later never sends packets that miss to the controller. + */ +enum ofputil_table_miss { + /* Protocol-specific default behavior. On OpenFlow 1.0 through 1.2 + * connections, the packet is sent to the controller, and on OpenFlow 1.3 + * and later connections, the packet is dropped. + * + * This is also used as a result of decoding OpenFlow 1.3+ "config" values + * in table-mods, to indicate that no table-miss was specified. */ + OFPUTIL_TABLE_MISS_DEFAULT, /* Protocol default behavior. */ + + /* These constants have the same meanings as those in OpenFlow with the + * same names. */ + OFPUTIL_TABLE_MISS_CONTROLLER, /* Send to controller. */ + OFPUTIL_TABLE_MISS_CONTINUE, /* Go to next table. */ + OFPUTIL_TABLE_MISS_DROP, /* Drop the packet. */ +}; + +ovs_be32 ofputil_table_miss_to_config(enum ofputil_table_miss, + enum ofp_version); + /* Abstract ofp_table_mod. */ struct ofputil_table_mod { uint8_t table_id; /* ID of the table, 0xff indicates all tables. */ - enum ofp_table_config config; + enum ofputil_table_miss miss_config; }; enum ofperr ofputil_decode_table_mod(const struct ofp_header *, @@ -623,7 +630,7 @@ char name[OFP_MAX_TABLE_NAME_LEN]; ovs_be64 metadata_match; /* Bits of metadata table can match. */ ovs_be64 metadata_write; /* Bits of metadata table can write. */ - uint32_t config; /* Bitmap of OFPTC_* values */ + enum ofputil_table_miss miss_config; uint32_t max_entries; /* Max number of entries supported. */ /* Table features related to instructions. There are two instances: @@ -646,8 +653,8 @@ * - 'apply' reports features available in an "apply_actions" * instruction. */ struct ofputil_table_action_features { - uint32_t actions; /* Bitmap of supported OFPAT*. */ - uint64_t set_fields; /* Bitmap of MFF_* "set-field" supports. */ + uint64_t ofpacts; /* Bitmap of supported OFPACT_*. */ + struct mf_bitmap set_fields; /* Fields for "set-field". */ } write, apply; } nonmiss, miss; @@ -670,21 +677,17 @@ * * Other combinations do not make sense. */ - uint64_t match; /* Fields that may be matched. */ - uint64_t mask; /* Subset of 'match' that may have masks. */ - uint64_t wildcard; /* Subset of 'match' that may be wildcarded. */ + struct mf_bitmap match; /* Fields that may be matched. */ + struct mf_bitmap mask; /* Subset of 'match' that may have masks. */ + struct mf_bitmap wildcard; /* Subset of 'match' that may be wildcarded. */ }; int ofputil_decode_table_features(struct ofpbuf *, struct ofputil_table_features *, bool loose); -struct ofpbuf *ofputil_encode_table_features_request( - enum ofp_version ofp_version); -void ofputil_append_table_features_reply( - const struct ofputil_table_features *tf, - struct list *replies); +struct ofpbuf *ofputil_encode_table_features_request(enum ofp_version); -uint16_t table_feature_prop_get_size(enum ofp13_table_feature_prop_type type); -char *table_feature_prop_get_name(enum ofp13_table_feature_prop_type type); +void ofputil_append_table_features_reply( + const struct ofputil_table_features *tf, struct ovs_list *replies); /* Meter band configuration for all supported band types. */ struct ofputil_meter_band { @@ -746,10 +749,10 @@ void ofputil_decode_meter_request(const struct ofp_header *, uint32_t *meter_id); -void ofputil_append_meter_config(struct list *replies, +void ofputil_append_meter_config(struct ovs_list *replies, const struct ofputil_meter_config *); -void ofputil_append_meter_stats(struct list *replies, +void ofputil_append_meter_stats(struct ovs_list *replies, const struct ofputil_meter_stats *); enum ofputil_meter_request_type { @@ -797,14 +800,28 @@ enum ofperr ofputil_decode_role_status(const struct ofp_header *oh, struct ofputil_role_status *rs); + /* Abstract table stats. * - * For now we use ofp12_table_stats as a superset of the other protocol - * versions' table stats. */ - -struct ofpbuf *ofputil_encode_table_stats_reply( - const struct ofp12_table_stats[], int n, - const struct ofp_header *request); + * This corresponds to the OpenFlow 1.3 table statistics structure, which only + * includes actual statistics. In earlier versions of OpenFlow, several + * members describe table features, so this structure has to be paired with + * struct ofputil_table_features to get all information. */ +struct ofputil_table_stats { + uint8_t table_id; /* Identifier of table. */ + uint32_t active_count; /* Number of active entries. */ + uint64_t lookup_count; /* Number of packets looked up in table. */ + uint64_t matched_count; /* Number of packets that hit table. */ +}; + +struct ofpbuf *ofputil_encode_table_stats_reply(const struct ofp_header *rq); +void ofputil_append_table_stats_reply(struct ofpbuf *reply, + const struct ofputil_table_stats *, + const struct ofputil_table_features *); + +int ofputil_decode_table_stats_reply(struct ofpbuf *reply, + struct ofputil_table_stats *, + struct ofputil_table_features *); /* Queue configuration request. */ struct ofpbuf *ofputil_encode_queue_get_config_request(enum ofp_version, @@ -869,9 +886,9 @@ int ofputil_decode_flow_update(struct ofputil_flow_update *, struct ofpbuf *msg, struct ofpbuf *ofpacts); -void ofputil_start_flow_update(struct list *replies); +void ofputil_start_flow_update(struct ovs_list *replies); void ofputil_append_flow_update(const struct ofputil_flow_update *, - struct list *replies); + struct ovs_list *replies); /* Abstract nx_flow_monitor_cancel. */ uint32_t ofputil_decode_flow_monitor_cancel(const struct ofp_header *); @@ -884,7 +901,7 @@ enum ofp_version ofp_version, ofp_port_t); void ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp, - struct list *replies); + struct ovs_list *replies); /* Encoding simple OpenFlow messages. */ struct ofpbuf *make_echo_request(enum ofp_version); @@ -898,99 +915,6 @@ /* Actions. */ -/* The type of an action. - * - * For each implemented OFPAT10_* and NXAST_* action type, there is a - * corresponding constant prefixed with OFPUTIL_, e.g.: - * - * OFPUTIL_OFPAT10_OUTPUT - * OFPUTIL_OFPAT10_SET_VLAN_VID - * OFPUTIL_OFPAT10_SET_VLAN_PCP - * OFPUTIL_OFPAT10_STRIP_VLAN - * OFPUTIL_OFPAT10_SET_DL_SRC - * OFPUTIL_OFPAT10_SET_DL_DST - * OFPUTIL_OFPAT10_SET_NW_SRC - * OFPUTIL_OFPAT10_SET_NW_DST - * OFPUTIL_OFPAT10_SET_NW_TOS - * OFPUTIL_OFPAT10_SET_TP_SRC - * OFPUTIL_OFPAT10_SET_TP_DST - * OFPUTIL_OFPAT10_ENQUEUE - * OFPUTIL_NXAST_RESUBMIT - * OFPUTIL_NXAST_SET_TUNNEL - * OFPUTIL_NXAST_SET_METADATA - * OFPUTIL_NXAST_SET_QUEUE - * OFPUTIL_NXAST_POP_QUEUE - * OFPUTIL_NXAST_REG_MOVE - * OFPUTIL_NXAST_REG_LOAD - * OFPUTIL_NXAST_NOTE - * OFPUTIL_NXAST_SET_TUNNEL64 - * OFPUTIL_NXAST_MULTIPATH - * OFPUTIL_NXAST_BUNDLE - * OFPUTIL_NXAST_BUNDLE_LOAD - * OFPUTIL_NXAST_RESUBMIT_TABLE - * OFPUTIL_NXAST_OUTPUT_REG - * OFPUTIL_NXAST_LEARN - * OFPUTIL_NXAST_DEC_TTL - * OFPUTIL_NXAST_FIN_TIMEOUT - * - * (The above list helps developers who want to "grep" for these definitions.) - */ -enum OVS_PACKED_ENUM ofputil_action_code { - OFPUTIL_ACTION_INVALID, -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) OFPUTIL_##ENUM, -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM, -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM, -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM, -#include "ofp-util.def" -}; - -/* The number of values of "enum ofputil_action_code". */ -enum { -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) + 1 -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1 -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1 -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1 - OFPUTIL_N_ACTIONS = 1 -#include "ofp-util.def" -}; - -int ofputil_action_code_from_name(const char *); -const char * ofputil_action_name_from_code(enum ofputil_action_code code); -enum ofputil_action_code ofputil_action_code_from_ofp13_action( - enum ofp13_action_type type); - -void *ofputil_put_action(enum ofputil_action_code, struct ofpbuf *buf); - -/* For each OpenFlow action that has a corresponding action structure - * struct , this defines two functions: - * - * void ofputil_init_(struct *action); - * - * Initializes the parts of 'action' that identify it as having type - * and length 'sizeof *action' and zeros the rest. For actions that have - * variable length, the length used and cleared is that of struct . - * - * struct *ofputil_put_(struct ofpbuf *buf); - * - * Appends a new 'action', of length 'sizeof(struct )', to 'buf', - * initializes it with ofputil_init_(), and returns it. - */ -#define OFPAT10_ACTION(ENUM, STRUCT, NAME) \ - void ofputil_init_##ENUM(struct STRUCT *); \ - struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *); -#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - void ofputil_init_##ENUM(struct STRUCT *); \ - struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *); -#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - void ofputil_init_##ENUM(struct STRUCT *); \ - struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *); -#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ - void ofputil_init_##ENUM(struct STRUCT *); \ - struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *); -#include "ofp-util.def" - -#define OFP_ACTION_ALIGN 8 /* Alignment of ofp_actions. */ - bool action_outputs_to_port(const union ofp_action *, ovs_be16 port); enum ofperr ofputil_pull_actions(struct ofpbuf *, unsigned int actions_len, @@ -1012,7 +936,7 @@ struct ofpbuf *ofputil_encode_dump_ports_request(enum ofp_version ofp_version, ofp_port_t port); -void ofputil_append_port_stat(struct list *replies, +void ofputil_append_port_stat(struct ovs_list *replies, const struct ofputil_port_stats *ops); size_t ofputil_count_port_stats(const struct ofp_header *); int ofputil_decode_port_stats(struct ofputil_port_stats *, struct ofpbuf *msg); @@ -1047,12 +971,17 @@ size_t ofputil_count_queue_stats(const struct ofp_header *); int ofputil_decode_queue_stats(struct ofputil_queue_stats *qs, struct ofpbuf *msg); -void ofputil_append_queue_stat(struct list *replies, +void ofputil_append_queue_stat(struct ovs_list *replies, const struct ofputil_queue_stats *oqs); +struct bucket_counter { + uint64_t packet_count; /* Number of packets processed by bucket. */ + uint64_t byte_count; /* Number of bytes processed by bucket. */ +}; + /* Bucket for use in groups. */ struct ofputil_bucket { - struct list list_node; + struct ovs_list list_node; uint16_t weight; /* Relative weight, for "select" groups. */ ofp_port_t watch_port; /* Port whose state affects whether this bucket * is live. Only required for fast failover @@ -1060,21 +989,32 @@ uint32_t watch_group; /* Group whose state affects whether this * bucket is live. Only required for fast * failover groups. */ + uint32_t bucket_id; /* Bucket Id used to identify bucket*/ struct ofpact *ofpacts; /* Series of "struct ofpact"s. */ size_t ofpacts_len; /* Length of ofpacts, in bytes. */ + + struct bucket_counter stats; +}; + +/* Protocol-independent group_mod. */ +struct ofputil_group_props { + /* NTR selection method */ + char selection_method[NTR_MAX_SELECTION_METHOD_LEN]; + uint64_t selection_method_param; + struct field_array fields; }; /* Protocol-independent group_mod. */ struct ofputil_group_mod { - uint16_t command; /* One of OFPGC11_*. */ + uint16_t command; /* One of OFPGC15_*. */ uint8_t type; /* One of OFPGT11_*. */ uint32_t group_id; /* Group identifier. */ - struct list buckets; /* Contains "struct ofputil_bucket"s. */ -}; - -struct bucket_counter { - uint64_t packet_count; /* Number of packets processed by bucket. */ - uint64_t byte_count; /* Number of bytes processed by bucket. */ + uint32_t command_bucket_id; /* Bucket Id used as part of + * OFPGC15_INSERT_BUCKET and + * OFPGC15_REMOVE_BUCKET commands + * execution.*/ + struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */ + struct ofputil_group_props props; /* Group properties. */ }; /* Group stats reply, independent of protocol. */ @@ -1096,19 +1036,26 @@ uint32_t types; /* Bitmap of OFPGT_* values supported. */ uint32_t capabilities; /* Bitmap of OFPGFC12_* capability supported. */ uint32_t max_groups[4]; /* Maximum number of groups for each type. */ - - /* Bitmaps of OFPAT_* that are supported. OF1.2+ actions only. */ - uint32_t actions[4]; + uint64_t ofpacts[4]; /* Bitmaps of supported OFPACT_* */ }; /* Group desc reply, independent of protocol. */ struct ofputil_group_desc { uint8_t type; /* One of OFPGT_*. */ uint32_t group_id; /* Group identifier. */ - struct list buckets; /* Contains "struct ofputil_bucket"s. */ + struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */ + struct ofputil_group_props props; /* Group properties. */ }; -void ofputil_bucket_list_destroy(struct list *buckets); +void ofputil_bucket_list_destroy(struct ovs_list *buckets); +void ofputil_bucket_clone_list(struct ovs_list *dest, + const struct ovs_list *src, + const struct ofputil_bucket *); +struct ofputil_bucket *ofputil_bucket_find(const struct ovs_list *, + uint32_t bucket_id); +bool ofputil_bucket_check_duplicate_id(const struct ovs_list *); +struct ofputil_bucket *ofputil_bucket_list_front(const struct ovs_list *); +struct ofputil_bucket *ofputil_bucket_list_back(const struct ovs_list *); static inline bool ofputil_bucket_has_liveness(const struct ofputil_bucket *bucket) @@ -1121,13 +1068,14 @@ uint32_t group_id); enum ofperr ofputil_decode_group_stats_request( const struct ofp_header *request, uint32_t *group_id); -void ofputil_append_group_stats(struct list *replies, +void ofputil_append_group_stats(struct ovs_list *replies, const struct ofputil_group_stats *); struct ofpbuf *ofputil_encode_group_features_request(enum ofp_version); struct ofpbuf *ofputil_encode_group_features_reply( const struct ofputil_group_features *, const struct ofp_header *request); void ofputil_decode_group_features_reply(const struct ofp_header *, struct ofputil_group_features *); +void ofputil_uninit_group_mod(struct ofputil_group_mod *gm); struct ofpbuf *ofputil_encode_group_mod(enum ofp_version ofp_version, const struct ofputil_group_mod *gm); @@ -1137,6 +1085,7 @@ int ofputil_decode_group_stats_reply(struct ofpbuf *, struct ofputil_group_stats *); +void ofputil_uninit_group_desc(struct ofputil_group_desc *gd); uint32_t ofputil_decode_group_desc_request(const struct ofp_header *); struct ofpbuf *ofputil_encode_group_desc_request(enum ofp_version, uint32_t group_id); @@ -1145,8 +1094,8 @@ struct ofpbuf *, enum ofp_version); void ofputil_append_group_desc_reply(const struct ofputil_group_desc *, - struct list *buckets, - struct list *replies); + const struct ovs_list *buckets, + struct ovs_list *replies); struct ofputil_bundle_ctrl_msg { uint32_t bundle_id; @@ -1160,9 +1109,13 @@ const struct ofp_header *msg; }; +enum ofptype; + enum ofperr ofputil_decode_bundle_ctrl(const struct ofp_header *, struct ofputil_bundle_ctrl_msg *); +struct ofpbuf *ofputil_encode_bundle_ctrl_request(enum ofp_version, + struct ofputil_bundle_ctrl_msg *); struct ofpbuf *ofputil_encode_bundle_ctrl_reply(const struct ofp_header *, struct ofputil_bundle_ctrl_msg *); @@ -1170,5 +1123,6 @@ struct ofputil_bundle_add_msg *msg); enum ofperr ofputil_decode_bundle_add(const struct ofp_header *, - struct ofputil_bundle_add_msg *); + struct ofputil_bundle_add_msg *, + enum ofptype *type); #endif /* ofp-util.h */ diff -Nru openvswitch-2.3.1/lib/ofp-version-opt.c openvswitch-2.4.0~git20150623/lib/ofp-version-opt.c --- openvswitch-2.3.1/lib/ofp-version-opt.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-version-opt.c 2015-06-23 18:46:21.000000000 +0000 @@ -27,6 +27,13 @@ } void +add_allowed_ofp_versions(uint32_t bitmap) +{ + assert_single_threaded(); + allowed_versions |= bitmap; +} + +void ofp_version_usage(void) { struct ds msg = DS_EMPTY_INITIALIZER; diff -Nru openvswitch-2.3.1/lib/ofp-version-opt.h openvswitch-2.4.0~git20150623/lib/ofp-version-opt.h --- openvswitch-2.3.1/lib/ofp-version-opt.h 2013-09-05 23:33:16.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ofp-version-opt.h 2015-06-23 18:46:21.000000000 +0000 @@ -21,6 +21,7 @@ uint32_t get_allowed_ofp_versions(void); void set_allowed_ofp_versions(const char *string); void mask_allowed_ofp_versions(uint32_t); +void add_allowed_ofp_versions(uint32_t); void ofp_version_usage(void); #endif diff -Nru openvswitch-2.3.1/lib/ovs-atomic-clang.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-clang.h --- openvswitch-2.3.1/lib/ovs-atomic-clang.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-clang.h 2015-06-23 18:46:21.000000000 +0000 @@ -53,6 +53,20 @@ (*(DST) = __c11_atomic_load(SRC, ORDER), \ (void) 0) +#define atomic_compare_exchange_strong(DST, EXP, SRC) \ + atomic_compare_exchange_strong_explicit(DST, EXP, SRC, \ + memory_order_seq_cst, \ + memory_order_seq_cst) +#define atomic_compare_exchange_strong_explicit(DST, EXP, SRC, ORD1, ORD2) \ + __c11_atomic_compare_exchange_strong(DST, EXP, SRC, ORD1, ORD2) + +#define atomic_compare_exchange_weak(DST, EXP, SRC) \ + atomic_compare_exchange_weak_explicit(DST, EXP, SRC, \ + memory_order_seq_cst, \ + memory_order_seq_cst) +#define atomic_compare_exchange_weak_explicit(DST, EXP, SRC, ORD1, ORD2) \ + __c11_atomic_compare_exchange_weak(DST, EXP, SRC, ORD1, ORD2) + #define atomic_add(RMW, ARG, ORIG) \ atomic_add_explicit(RMW, ARG, ORIG, memory_order_seq_cst) #define atomic_sub(RMW, ARG, ORIG) \ diff -Nru openvswitch-2.3.1/lib/ovs-atomic-gcc4.7+.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-gcc4.7+.h --- openvswitch-2.3.1/lib/ovs-atomic-gcc4.7+.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-gcc4.7+.h 2015-06-23 18:46:21.000000000 +0000 @@ -47,6 +47,20 @@ (*(DST) = __atomic_load_n(SRC, ORDER), \ (void) 0) +#define atomic_compare_exchange_strong(DST, EXP, SRC) \ + atomic_compare_exchange_strong_explicit(DST, EXP, SRC, \ + memory_order_seq_cst, \ + memory_order_seq_cst) +#define atomic_compare_exchange_strong_explicit(DST, EXP, SRC, ORD1, ORD2) \ + __atomic_compare_exchange_n(DST, EXP, SRC, false, ORD1, ORD2) + +#define atomic_compare_exchange_weak(DST, EXP, SRC) \ + atomic_compare_exchange_weak_explicit(DST, EXP, SRC, \ + memory_order_seq_cst, \ + memory_order_seq_cst) +#define atomic_compare_exchange_weak_explicit(DST, EXP, SRC, ORD1, ORD2) \ + __atomic_compare_exchange_n(DST, EXP, SRC, true, ORD1, ORD2) + #define atomic_add(RMW, OPERAND, ORIG) \ atomic_add_explicit(RMW, OPERAND, ORIG, memory_order_seq_cst) #define atomic_sub(RMW, OPERAND, ORIG) \ diff -Nru openvswitch-2.3.1/lib/ovs-atomic-gcc4+.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-gcc4+.h --- openvswitch-2.3.1/lib/ovs-atomic-gcc4+.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-gcc4+.h 2015-06-23 18:46:21.000000000 +0000 @@ -63,7 +63,7 @@ } static inline void -atomic_signal_fence(memory_order order OVS_UNUSED) +atomic_signal_fence(memory_order order) { if (order != memory_order_relaxed) { asm volatile("" : : : "memory"); @@ -72,7 +72,7 @@ #define atomic_is_lock_free(OBJ) \ ((void) *(OBJ), \ - IF_LOCKLESS_ATOMIC(OBJ, true, false)) + IS_LOCKLESS_ATOMIC(*(OBJ)) ? 2 : 0) #define atomic_store(DST, SRC) \ atomic_store_explicit(DST, SRC, memory_order_seq_cst) @@ -80,14 +80,13 @@ ({ \ typeof(DST) dst__ = (DST); \ typeof(SRC) src__ = (SRC); \ - memory_order order__ = (ORDER); \ \ if (IS_LOCKLESS_ATOMIC(*dst__)) { \ - atomic_thread_fence(order__); \ - *dst__ = src__; \ - atomic_thread_fence_if_seq_cst(order__); \ + atomic_thread_fence(ORDER); \ + *(typeof(*(DST)) volatile *)dst__ = src__; \ + atomic_thread_fence_if_seq_cst(ORDER); \ } else { \ - atomic_store_locked(DST, SRC); \ + atomic_store_locked(dst__, src__); \ } \ (void) 0; \ }) @@ -97,17 +96,38 @@ ({ \ typeof(DST) dst__ = (DST); \ typeof(SRC) src__ = (SRC); \ - memory_order order__ = (ORDER); \ \ if (IS_LOCKLESS_ATOMIC(*src__)) { \ - atomic_thread_fence_if_seq_cst(order__); \ - *dst__ = *src__; \ + atomic_thread_fence_if_seq_cst(ORDER); \ + *dst__ = *(typeof(*(SRC)) volatile *)src__; \ } else { \ - atomic_read_locked(SRC, DST); \ + atomic_read_locked(src__, dst__); \ } \ (void) 0; \ }) +#define atomic_compare_exchange_strong(DST, EXP, SRC) \ + ({ \ + typeof(DST) dst__ = (DST); \ + typeof(EXP) expp__ = (EXP); \ + typeof(SRC) src__ = (SRC); \ + typeof(SRC) exp__ = *expp__; \ + typeof(SRC) ret__; \ + \ + ret__ = __sync_val_compare_and_swap(dst__, exp__, src__); \ + if (ret__ != exp__) { \ + *expp__ = ret__; \ + } \ + ret__ == exp__; \ + }) +#define atomic_compare_exchange_strong_explicit(DST, EXP, SRC, ORD1, ORD2) \ + ((void) (ORD1), (void) (ORD2), \ + atomic_compare_exchange_strong(DST, EXP, SRC)) +#define atomic_compare_exchange_weak \ + atomic_compare_exchange_strong +#define atomic_compare_exchange_weak_explicit \ + atomic_compare_exchange_strong_explicit + #define atomic_op__(RMW, OP, ARG, ORIG) \ ({ \ typeof(RMW) rmw__ = (RMW); \ @@ -117,13 +137,14 @@ if (IS_LOCKLESS_ATOMIC(*rmw__)) { \ *orig__ = __sync_fetch_and_##OP(rmw__, arg__); \ } else { \ - atomic_op_locked(RMW, OP, ARG, ORIG); \ + atomic_op_locked(rmw__, OP, arg__, orig__); \ } \ + (void) 0; \ }) #define atomic_add(RMW, ARG, ORIG) atomic_op__(RMW, add, ARG, ORIG) #define atomic_sub(RMW, ARG, ORIG) atomic_op__(RMW, sub, ARG, ORIG) -#define atomic_or( RMW, ARG, ORIG) atomic_op__(RMW, or, ARG, ORIG) +#define atomic_or(RMW, ARG, ORIG) atomic_op__(RMW, or, ARG, ORIG) #define atomic_xor(RMW, ARG, ORIG) atomic_op__(RMW, xor, ARG, ORIG) #define atomic_and(RMW, ARG, ORIG) atomic_op__(RMW, and, ARG, ORIG) @@ -146,27 +167,37 @@ #define ATOMIC_FLAG_INIT { false } static inline bool -atomic_flag_test_and_set(volatile atomic_flag *object) -{ - return __sync_lock_test_and_set(&object->b, 1); -} - -static inline bool atomic_flag_test_and_set_explicit(volatile atomic_flag *object, - memory_order order OVS_UNUSED) + memory_order order) { - return atomic_flag_test_and_set(object); -} + bool old; -static inline void -atomic_flag_clear(volatile atomic_flag *object) -{ - __sync_lock_release(&object->b); + /* __sync_lock_test_and_set() by itself is an acquire barrier. + * For anything higher additional barriers are needed. */ + if (order > memory_order_acquire) { + atomic_thread_fence(order); + } + old = __sync_lock_test_and_set(&object->b, 1); + atomic_thread_fence_if_seq_cst(order); + + return old; } +#define atomic_flag_test_and_set(FLAG) \ + atomic_flag_test_and_set_explicit(FLAG, memory_order_seq_cst) + static inline void atomic_flag_clear_explicit(volatile atomic_flag *object, - memory_order order OVS_UNUSED) + memory_order order) { - atomic_flag_clear(object); + /* __sync_lock_release() by itself is a release barrier. For + * anything else additional barrier may be needed. */ + if (order != memory_order_release) { + atomic_thread_fence(order); + } + __sync_lock_release(&object->b); + atomic_thread_fence_if_seq_cst(order); } + +#define atomic_flag_clear(FLAG) \ + atomic_flag_clear_explicit(FLAG, memory_order_seq_cst) diff -Nru openvswitch-2.3.1/lib/ovs-atomic.h openvswitch-2.4.0~git20150623/lib/ovs-atomic.h --- openvswitch-2.3.1/lib/ovs-atomic.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic.h 2015-06-23 18:46:21.000000000 +0000 @@ -109,7 +109,30 @@ * * memory_order_relaxed: * - * Compiler barrier only. Does not imply any CPU memory ordering. + * Only atomicity is provided, does not imply any memory ordering with + * respect to any other variable (atomic or not). Relaxed accesses to + * the same atomic variable will be performed in the program order. + * The compiler and CPU are free to move memory accesses to other + * variables past the atomic operation. + * + * memory_order_consume: + * + * Memory accesses with data dependency on the result of the consume + * operation (atomic_read_explicit, or a load operation preceding a + * atomic_thread_fence) will not be moved prior to the consume + * barrier. Non-data-dependent loads and stores can be reordered to + * happen before the the consume barrier. + * + * RCU is the prime example of the use of the consume barrier: The + * consume barrier guarantees that reads from a RCU protected object + * are performed after the RCU protected pointer is read. A + * corresponding release barrier is used to store the modified RCU + * protected pointer after the RCU protected object has been fully + * constructed. The synchronization between these barriers prevents + * the RCU "consumer" from seeing uninitialized data. + * + * May not be used with atomic_store_explicit(), as consume semantics + * applies only to atomic loads. * * memory_order_acquire: * @@ -117,26 +140,50 @@ * barrier. Memory accesses before an acquire barrier *can* be moved * after it. * + * An atomic_thread_fence with memory_order_acquire does not have a + * load operation by itself; it prevents all following memory accesses + * from moving prior to preceding loads. + * + * May not be used with atomic_store_explicit(), as acquire semantics + * applies only to atomic loads. + * * memory_order_release: * * Memory accesses before a release barrier cannot be moved after the * barrier. Memory accesses after a release barrier *can* be moved * before it. * + * An atomic_thread_fence with memory_order_release does not have a + * store operation by itself; it prevents all preceding memory accesses + * from moving past subsequent stores. + * + * May not be used with atomic_read_explicit(), as release semantics + * applies only to atomic stores. + * * memory_order_acq_rel: * * Memory accesses cannot be moved across an acquire-release barrier in * either direction. * - * memory_order_seq_cst: + * May only be used with atomic read-modify-write operations, as both + * load and store operation is required for acquire-release semantics. * - * Prevents movement of memory accesses like an acquire-release barrier, - * but whereas acquire-release synchronizes cooperating threads, - * sequential-consistency synchronizes the whole system. + * An atomic_thread_fence with memory_order_acq_rel does not have + * either load or store operation by itself; it prevents all following + * memory accesses from moving prior to preceding loads and all + * preceding memory accesses from moving past subsequent stores. * - * memory_order_consume: + * memory_order_seq_cst: * - * A slight relaxation of memory_order_acquire. + * Prevents movement of memory accesses like an acquire-release barrier, + * but whereas acquire-release synchronizes cooperating threads (using + * the same atomic variable), sequential-consistency synchronizes the + * whole system, providing a total order for stores on all atomic + * variables. + * + * OVS atomics require the memory_order to be passed as a compile-time constant + * value, as some compiler implementations may perform poorly if the memory + * order parameter is passed in as a run-time value. * * The following functions insert explicit barriers. Most of the other atomic * functions also include barriers. @@ -161,7 +208,7 @@ * In this section, A is an atomic type and C is the corresponding non-atomic * type. * - * The "store" primitives match C11: + * The "store" and "compare_exchange" primitives match C11: * * void atomic_store(A *object, C value); * void atomic_store_explicit(A *object, C value, memory_order); @@ -169,6 +216,32 @@ * Atomically stores 'value' into '*object', respecting the given * memory order (or memory_order_seq_cst for atomic_store()). * + * bool atomic_compare_exchange_strong(A *object, C *expected, C desired); + * bool atomic_compare_exchange_weak(A *object, C *expected, C desired); + * bool atomic_compare_exchange_strong_explicit(A *object, C *expected, + * C desired, + * memory_order success, + * memory_order failure); + * bool atomic_compare_exchange_weak_explicit(A *object, C *expected, + * C desired, + * memory_order success, + * memory_order failure); + * + * Atomically loads '*object' and compares it with '*expected' and if + * equal, stores 'desired' into '*object' (an atomic read-modify-write + * operation) and returns true, and if non-equal, stores the actual + * value of '*object' into '*expected' (an atomic load operation) and + * returns false. The memory order for the successful case (atomic + * read-modify-write operation) is 'success', and for the unsuccessful + * case (atomic load operation) 'failure'. 'failure' may not be + * stronger than 'success'. + * + * The weak forms may fail (returning false) also when '*object' equals + * '*expected'. The strong form can be implemented by the weak form in + * a loop. Some platforms can implement the weak form more + * efficiently, so it should be used if the application will need to + * loop anyway. + * * The following primitives differ from the C11 ones (and have different names) * because there does not appear to be a way to implement the standard * primitives in standard C: @@ -248,15 +321,24 @@ #if __CHECKER__ /* sparse doesn't understand some GCC extensions we use. */ #include "ovs-atomic-pthreads.h" - #elif HAVE_STDATOMIC_H - #include "ovs-atomic-c11.h" #elif __has_extension(c_atomic) #include "ovs-atomic-clang.h" + #elif HAVE_STDATOMIC_H + #include "ovs-atomic-c11.h" #elif __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 #include "ovs-atomic-gcc4.7+.h" + #elif __GNUC__ && defined(__x86_64__) + #include "ovs-atomic-x86_64.h" + #elif __GNUC__ && defined(__i386__) + #include "ovs-atomic-i586.h" #elif HAVE_GCC4_ATOMICS #include "ovs-atomic-gcc4+.h" + #elif _MSC_VER && _M_IX86 >= 500 + #include "ovs-atomic-msvc.h" #else + /* ovs-atomic-pthreads implementation is provided for portability. + * It might be too slow for real use because Open vSwitch is + * optimized for platforms where real atomic ops are available. */ #include "ovs-atomic-pthreads.h" #endif #undef IN_OVS_ATOMIC_H @@ -299,6 +381,96 @@ typedef ATOMIC(int16_t) atomic_int16_t; typedef ATOMIC(int32_t) atomic_int32_t; +/* Relaxed atomic operations. + * + * When an operation on an atomic variable is not expected to synchronize + * with operations on other (atomic or non-atomic) variables, no memory + * barriers are needed and the relaxed memory ordering can be used. These + * macros make such uses less daunting, but not invisible. */ +#define atomic_store_relaxed(VAR, VALUE) \ + atomic_store_explicit(VAR, VALUE, memory_order_relaxed) +#define atomic_read_relaxed(VAR, DST) \ + atomic_read_explicit(VAR, DST, memory_order_relaxed) +#define atomic_compare_exchange_strong_relaxed(DST, EXP, SRC) \ + atomic_compare_exchange_strong_explicit(DST, EXP, SRC, \ + memory_order_relaxed, \ + memory_order_relaxed) +#define atomic_compare_exchange_weak_relaxed(DST, EXP, SRC) \ + atomic_compare_exchange_weak_explicit(DST, EXP, SRC, \ + memory_order_relaxed, \ + memory_order_relaxed) +#define atomic_add_relaxed(RMW, ARG, ORIG) \ + atomic_add_explicit(RMW, ARG, ORIG, memory_order_relaxed) +#define atomic_sub_relaxed(RMW, ARG, ORIG) \ + atomic_sub_explicit(RMW, ARG, ORIG, memory_order_relaxed) +#define atomic_or_relaxed(RMW, ARG, ORIG) \ + atomic_or_explicit(RMW, ARG, ORIG, memory_order_relaxed) +#define atomic_xor_relaxed(RMW, ARG, ORIG) \ + atomic_xor_explicit(RMW, ARG, ORIG, memory_order_relaxed) +#define atomic_and_relaxed(RMW, ARG, ORIG) \ + atomic_and_explicit(RMW, ARG, ORIG, memory_order_relaxed) +#define atomic_flag_test_and_set_relaxed(FLAG) \ + atomic_flag_test_and_set_explicit(FLAG, memory_order_relaxed) +#define atomic_flag_clear_relaxed(FLAG) \ + atomic_flag_clear_explicit(FLAG, memory_order_relaxed) + +/* A simplified atomic count. Does not provide any synchronization with any + * other variables. + * + * Typically a counter is not used to synchronize the state of any other + * variables (with the notable exception of reference count, below). + * This abstraction releaves the user from the memory order considerations, + * and may make the code easier to read. + * + * We only support the unsigned int counters, as those are the most common. */ +typedef struct atomic_count { + atomic_uint count; +} atomic_count; + +#define ATOMIC_COUNT_INIT(VALUE) { VALUE } + +static inline void +atomic_count_init(atomic_count *count, unsigned int value) +{ + atomic_init(&count->count, value); +} + +static inline unsigned int +atomic_count_inc(atomic_count *count) +{ + unsigned int old; + + atomic_add_relaxed(&count->count, 1, &old); + + return old; +} + +static inline unsigned int +atomic_count_dec(atomic_count *count) +{ + unsigned int old; + + atomic_sub_relaxed(&count->count, 1, &old); + + return old; +} + +static inline unsigned int +atomic_count_get(atomic_count *count) +{ + unsigned int value; + + atomic_read_relaxed(&count->count, &value); + + return value; +} + +static inline void +atomic_count_set(atomic_count *count, unsigned int value) +{ + atomic_store_relaxed(&count->count, value); +} + /* Reference count. */ struct ovs_refcount { atomic_uint count; @@ -311,13 +483,17 @@ atomic_init(&refcount->count, 1); } -/* Increments 'refcount'. */ +/* Increments 'refcount'. + * + * Does not provide a memory barrier, as the calling thread must have + * protected access to the object already. */ static inline void ovs_refcount_ref(struct ovs_refcount *refcount) { unsigned int old_refcount; - atomic_add(&refcount->count, 1, &old_refcount); + atomic_add_explicit(&refcount->count, 1, &old_refcount, + memory_order_relaxed); ovs_assert(old_refcount > 0); } @@ -328,18 +504,34 @@ * // ...uninitialize object... * free(object); * } - */ + * + * Provides a release barrier making the preceding loads and stores to not be + * reordered after the unref, and in case of the last reference provides also + * an acquire barrier to keep all the following uninitialization from being + * reordered before the atomic decrement operation. Together these synchronize + * any concurrent unref operations between each other. */ static inline unsigned int ovs_refcount_unref(struct ovs_refcount *refcount) { unsigned int old_refcount; - atomic_sub(&refcount->count, 1, &old_refcount); + atomic_sub_explicit(&refcount->count, 1, &old_refcount, + memory_order_release); ovs_assert(old_refcount > 0); + if (old_refcount == 1) { + /* 'memory_order_release' above means that there are no (reordered) + * accesses to the protected object from any thread at this point. + * An acquire barrier is needed to keep all subsequent access to the + * object's memory from being reordered before the atomic operation + * above. */ + atomic_thread_fence(memory_order_acquire); + } return old_refcount; } -/* Reads and returns 'ref_count_''s current reference count. +/* Reads and returns 'refcount_''s current reference count. + * + * Does not provide a memory barrier. * * Rarely useful. */ static inline unsigned int @@ -349,8 +541,82 @@ = CONST_CAST(struct ovs_refcount *, refcount_); unsigned int count; - atomic_read(&refcount->count, &count); + atomic_read_explicit(&refcount->count, &count, memory_order_relaxed); return count; } +/* Increments 'refcount', but only if it is non-zero. + * + * This may only be called for an object which is RCU protected during + * this call. This implies that its possible destruction is postponed + * until all current RCU threads quiesce. + * + * Returns false if the refcount was zero. In this case the object may + * be safely accessed until the current thread quiesces, but no additional + * references to the object may be taken. + * + * Does not provide a memory barrier, as the calling thread must have + * RCU protected access to the object already. + * + * It is critical that we never increment a zero refcount to a + * non-zero value, as whenever a refcount reaches the zero value, the + * protected object may be irrevocably scheduled for deletion. */ +static inline bool +ovs_refcount_try_ref_rcu(struct ovs_refcount *refcount) +{ + unsigned int count; + + atomic_read_explicit(&refcount->count, &count, memory_order_relaxed); + do { + if (count == 0) { + return false; + } + } while (!atomic_compare_exchange_weak_explicit(&refcount->count, &count, + count + 1, + memory_order_relaxed, + memory_order_relaxed)); + return true; +} + +/* Decrements 'refcount' and returns the previous reference count. To + * be used only when a memory barrier is already provided for the + * protected object independently. + * + * For example: + * + * if (ovs_refcount_unref_relaxed(&object->ref_cnt) == 1) { + * // Schedule uninitialization and freeing of the object: + * ovsrcu_postpone(destructor_function, object); + * } + * + * Here RCU quiescing already provides a full memory barrier. No additional + * barriers are needed here. + * + * Or: + * + * if (stp && ovs_refcount_unref_relaxed(&stp->ref_cnt) == 1) { + * ovs_mutex_lock(&mutex); + * list_remove(&stp->node); + * ovs_mutex_unlock(&mutex); + * free(stp->name); + * free(stp); + * } + * + * Here a mutex is used to guard access to all of 'stp' apart from + * 'ref_cnt'. Hence all changes to 'stp' by other threads must be + * visible when we get the mutex, and no access after the unlock can + * be reordered to happen prior the lock operation. No additional + * barriers are needed here. + */ +static inline unsigned int +ovs_refcount_unref_relaxed(struct ovs_refcount *refcount) +{ + unsigned int old_refcount; + + atomic_sub_explicit(&refcount->count, 1, &old_refcount, + memory_order_relaxed); + ovs_assert(old_refcount > 0); + return old_refcount; +} + #endif /* ovs-atomic.h */ diff -Nru openvswitch-2.3.1/lib/ovs-atomic-i586.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-i586.h --- openvswitch-2.3.1/lib/ovs-atomic-i586.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-i586.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This header implements atomic operation primitives on 32-bit 586+ with GCC. + */ +#ifndef IN_OVS_ATOMIC_H +#error "This header should only be included indirectly via ovs-atomic.h." +#endif + +#define OVS_ATOMIC_I586_IMPL 1 + +/* + * These assumptions have been adopted from the x86_64 Memory model: + * + * - 1, 2, and 4 byte loads and stores are atomic on aligned memory. + * - Loads are not reordered with other loads. + * - Stores are not reordered with OLDER loads. + * - Loads may be reordered with OLDER stores to a different memory location, + * but not with OLDER stores to the same memory location. + * - Stores are not reordered with other stores, except maybe for special + * instructions not emitted by compilers, or by the stores performed by + * a single fast string operation (e.g., "stos"). As long as the atomic + * stores are not combined with any other stores, even the allowed reordering + * of the stores by a single fast string operation is not a problem. + * - Neither loads nor stores are reordered with locked instructions. + * - Stores by a single processor are observed in the same order by all + * processors. + * - (Unlocked) Stores from different processors are NOT ordered. + * - Memory ordering obeys causality (memory ordering respects transitive + * visibility). + * - Any two stores are seen in a consistent order by processors other than + * the those performing the stores. + * - Locked instructions have total order. + * + * These rules imply that: + * + * - Locked instructions are not needed for aligned loads or stores to make + * them atomic for sizes upto 4 bytes. 8 byte objects need locked + * instructions. + * - All stores have release semantics; none of the preceding stores or loads + * can be reordered with following stores. Following loads could still be + * reordered to happen before the store, but that is not a violation of the + * release semantics. + * - All loads from a given memory location have acquire semantics with + * respect to the stores on the same memory location; none of the following + * loads or stores can be reordered with the load. Preceding stores to a + * different memory location MAY be reordered with the load, but that is not + * a violation of the acquire semantics (i.e., the loads and stores of two + * critical sections guarded by a different memory location can overlap). + * - Locked instructions serve as CPU memory barriers by themselves. + * - Locked stores implement the sequential consistency memory order. Using + * locked instructions when seq_cst memory order is requested allows normal + * loads to observe the stores in the same (total) order without using CPU + * memory barrier after the loads. + * + * NOTE: Some older AMD Opteron processors have a bug that violates the + * acquire semantics described above. The bug manifests as an unlocked + * read-modify-write operation following a "semaphore operation" operating + * on data that existed before entering the critical section; i.e., the + * preceding "semaphore operation" fails to function as an acquire barrier. + * The affected CPUs are AMD family 15, models 32 to 63. + * + * Ref. http://support.amd.com/TechDocs/25759.pdf errata #147. + */ + +/* Barriers. */ + +#define compiler_barrier() asm volatile(" " : : : "memory") +#define cpu_barrier() asm volatile("lock; addl $0,(%%esp)" ::: "memory", "cc") + +/* + * The 'volatile' keyword prevents the compiler from keeping the atomic + * value in a register, and generates a new memory access for each atomic + * operation. This allows the implementations of memory_order_relaxed and + * memory_order_consume to avoid issuing a compiler memory barrier, allowing + * full optimization of all surrounding non-atomic variables. + * + * The placement of the 'volatile' keyword after the 'TYPE' below is highly + * significant when the TYPE is a pointer type. In that case we want the + * pointer to be declared volatile, not the data type that is being pointed + * at! + * + * Attribute aligned is used to tell the compiler to align 64-bit data + * on a 8-byte boundary. This allows more efficient atomic access, as the + * the CPU guarantees such memory accesses to be atomic. */ +#define ATOMIC(TYPE) TYPE volatile __attribute__((aligned(sizeof(TYPE)))) + +/* Memory ordering. Must be passed in as a constant. */ +typedef enum { + memory_order_relaxed, + memory_order_consume, + memory_order_acquire, + memory_order_release, + memory_order_acq_rel, + memory_order_seq_cst +} memory_order; + +#define ATOMIC_BOOL_LOCK_FREE 2 +#define ATOMIC_CHAR_LOCK_FREE 2 +#define ATOMIC_SHORT_LOCK_FREE 2 +#define ATOMIC_INT_LOCK_FREE 2 +#define ATOMIC_LONG_LOCK_FREE 2 +#define ATOMIC_LLONG_LOCK_FREE 2 +#define ATOMIC_POINTER_LOCK_FREE 2 + +#define IS_LOCKLESS_ATOMIC(OBJECT) \ + (sizeof(OBJECT) <= 8 && IS_POW2(sizeof(OBJECT))) + +#define ATOMIC_VAR_INIT(VALUE) VALUE +#define atomic_init(OBJECT, VALUE) (*(OBJECT) = (VALUE), (void) 0) + +/* + * The memory_model_relaxed does not need a compiler barrier, if the + * atomic operation can otherwise be guaranteed to not be moved with + * respect to other atomic operations on the same memory location. Using + * the 'volatile' keyword in the definition of the atomic types + * accomplishes this, as memory accesses to volatile data may not be + * optimized away, or be reordered with other volatile accesses. + * + * On x86 also memory_order_consume is automatic, and data dependency on a + * volatile atomic variable means that the compiler optimizations should not + * cause problems. That is, the compiler should not speculate the value of + * the atomic_read, as it is going to read it from the memory anyway. + * This allows omiting the compiler memory barrier on atomic_reads with + * memory_order_consume. This matches the definition of + * smp_read_barrier_depends() in Linux kernel as a nop for x86, and its usage + * in rcu_dereference(). + * + * We use this same logic below to choose inline assembly statements with or + * without a compiler memory barrier. + */ +static inline void +atomic_compiler_barrier(memory_order order) +{ + if (order > memory_order_consume) { + compiler_barrier(); + } +} + +static inline void +atomic_thread_fence(memory_order order) +{ + if (order == memory_order_seq_cst) { + cpu_barrier(); + } else { + atomic_compiler_barrier(order); + } +} + +static inline void +atomic_signal_fence(memory_order order) +{ + atomic_compiler_barrier(order); +} + +#define atomic_is_lock_free(OBJ) \ + ((void) *(OBJ), \ + IS_LOCKLESS_ATOMIC(*(OBJ)) ? 2 : 0) + +/* The 8-byte atomic exchange uses cmpxchg8b with the SRC (ax:dx) as + * the expected value (bx:cx), which will get replaced by the current + * value in the likely case it did not match, after which we keep + * trying until the swap succeeds. */ + +#if defined(__PIC__) +/* ebx may not be clobbered when compiled with -fPIC, must save and + * restore it. Furthermore, 'DST' may be addressed via ebx, so the + * address must be passed via a register so that it remains valid also + * after changing ebx. */ +#define atomic_exchange_8__(DST, SRC, CLOB) \ + uint32_t temp____; \ + \ + asm volatile(" movl %%ebx,%2 ; " \ + " movl %%eax,%%ebx ; " \ + " movl %%edx,%%ecx ; " \ + "1: " \ + "lock; cmpxchg8b (%0); " \ + " jne 1b ; " \ + " movl %2,%%ebx ; " \ + " # atomic_exchange_8__ " \ + : "+r" (DST), /* 0 */ \ + "+A" (SRC), /* 1 */ \ + "=mr" (temp____) /* 2 */ \ + :: "ecx", CLOB, "cc") + +#else +#define atomic_exchange_8__(DST, SRC, CLOB) \ + asm volatile(" movl %%eax,%%ebx ; " \ + " movl %%edx,%%ecx ; " \ + "1: " \ + "lock; cmpxchg8b %0 ; " \ + " jne 1b ; " \ + " # atomic_exchange_8__ " \ + : "+m" (*DST), /* 0 */ \ + "+A" (SRC) /* 1 */ \ + :: "ebx", "ecx", CLOB, "cc") +#endif + +#define atomic_exchange__(DST, SRC, ORDER) \ + ({ \ + typeof(DST) dst___ = (DST); \ + typeof(*(DST)) src___ = (SRC); \ + \ + if ((ORDER) > memory_order_consume) { \ + if (sizeof(*(DST)) == 8) { \ + atomic_exchange_8__(dst___, src___, "memory"); \ + } else { \ + asm volatile("xchg %1,%0 ; " \ + "# atomic_exchange__" \ + : "+r" (src___), /* 0 */ \ + "+m" (*dst___) /* 1 */ \ + :: "memory"); \ + } \ + } else { \ + if (sizeof(*(DST)) == 8) { \ + atomic_exchange_8__(dst___, src___, "cc"); \ + } else { \ + asm volatile("xchg %1,%0 ; " \ + "# atomic_exchange__" \ + : "+r" (src___), /* 0 */ \ + "+m" (*dst___)); /* 1 */ \ + } \ + } \ + src___; \ + }) + +#if defined(__SSE__) +/* SSE registers are 128-bit wide, and moving the lowest 64-bits of an SSE + * register to proerly aligned memory is atomic. See ATOMIC(TYPE) above. */ +#define atomic_store_8__(DST, SRC) \ + asm volatile("movq %1,%0 ; # atomic_store_8__" \ + : "=m" (*DST) /* 0 */ \ + : "x" (SRC)) /* 1, SSE */ +#else +/* Locked 64-bit exchange is available on all i586 CPUs. */ +#define atomic_store_8__(DST, SRC) \ + atomic_exchange_8__(DST, SRC, "cc") +#endif + +#define atomic_store_explicit(DST, SRC, ORDER) \ + ({ \ + typeof(DST) dst__ = (DST); \ + typeof(*(DST)) src__ = (SRC); \ + \ + if ((ORDER) != memory_order_seq_cst) { \ + atomic_compiler_barrier(ORDER); \ + if (sizeof(*(DST)) == 8) { \ + atomic_store_8__(dst__, src__); \ + } else { \ + *dst__ = src__; \ + } \ + } else { \ + atomic_exchange__(dst__, src__, ORDER); \ + } \ + (void) 0; \ + }) +#define atomic_store(DST, SRC) \ + atomic_store_explicit(DST, SRC, memory_order_seq_cst) + +#if defined(__SSE__) +/* SSE registers are 128-bit wide, and moving 64-bits from properly aligned + * memory to an SSE register is atomic. See ATOMIC(TYPE) above. */ +#define atomic_read_8__(SRC, DST) \ + ({ \ + typeof(*(DST)) res__; \ + \ + asm ("movq %1,%0 ; # atomic_read_8__" \ + : "=x" (res__) /* 0, SSE. */ \ + : "m" (*SRC)); /* 1 */ \ + *(DST) = res__; \ + }) +#else +/* Must use locked cmpxchg8b (available on all i586 CPUs) if compiled w/o sse + * support. Compare '*DST' to a random value in bx:cx and returns the actual + * value in ax:dx. The registers bx and cx are only read, so they are not + * clobbered. */ +#define atomic_read_8__(SRC, DST) \ + ({ \ + typeof(*(DST)) res__; \ + \ + asm (" movl %%ebx,%%eax ; " \ + " movl %%ecx,%%edx ; " \ + "lock; cmpxchg8b %1 ; " \ + "# atomic_read_8__ " \ + : "=&A" (res__), /* 0 */ \ + "+m" (*SRC) /* 1 */ \ + : : "cc"); \ + *(DST) = res__; \ + }) +#endif + +#define atomic_read_explicit(SRC, DST, ORDER) \ + ({ \ + typeof(DST) dst__ = (DST); \ + typeof(SRC) src__ = (SRC); \ + \ + if (sizeof(*(DST)) <= 4) { \ + *dst__ = *src__; \ + } else { \ + atomic_read_8__(SRC, DST); \ + } \ + atomic_compiler_barrier(ORDER); \ + (void) 0; \ + }) +#define atomic_read(SRC, DST) \ + atomic_read_explicit(SRC, DST, memory_order_seq_cst) + +#if defined(__PIC__) +/* ebx may not be used as an input when compiled with -fPIC, must save + * and restore it. Furthermore, 'DST' may be addressed via ebx, so + * the address must be passed via a register so that it remains valid + * also after changing ebx. */ +#define atomic_compare_exchange_8__(DST, EXP, SRC, RES, CLOB) \ + asm volatile(" xchgl %%ebx,%3 ; " \ + "lock; cmpxchg8b (%1) ; " \ + " xchgl %3,%%ebx ; " \ + " sete %0 " \ + "# atomic_compare_exchange_8__" \ + : "=q" (RES), /* 0 */ \ + "+r" (DST), /* 1 */ \ + "+A" (EXP) /* 2 */ \ + : "r" ((uint32_t)SRC), /* 3 */ \ + "c" ((uint32_t)((uint64_t)SRC >> 32)) /* 4 */ \ + : CLOB, "cc") +#else +#define atomic_compare_exchange_8__(DST, EXP, SRC, RES, CLOB) \ + asm volatile("lock; cmpxchg8b %1 ; " \ + " sete %0 " \ + "# atomic_compare_exchange_8__" \ + : "=q" (RES), /* 0 */ \ + "+m" (*DST), /* 1 */ \ + "+A" (EXP) /* 2 */ \ + : "b" ((uint32_t)SRC), /* 3 */ \ + "c" ((uint32_t)((uint64_t)SRC >> 32)) /* 4 */ \ + : CLOB, "cc") +#endif + +#define atomic_compare_exchange__(DST, EXP, SRC, RES, CLOB) \ + asm volatile("lock; cmpxchg %3,%1 ; " \ + " sete %0 " \ + "# atomic_compare_exchange__" \ + : "=q" (RES), /* 0 */ \ + "+m" (*DST), /* 1 */ \ + "+a" (EXP) /* 2 */ \ + : "r" (SRC) /* 3 */ \ + : CLOB, "cc") + +/* ORD_FAIL is ignored, as atomic_compare_exchange__ already implements + * at least as strong a barrier as allowed for ORD_FAIL in all cases. */ +#define atomic_compare_exchange_strong_explicit(DST, EXP, SRC, ORDER, ORD_FAIL) \ + ({ \ + typeof(DST) dst__ = (DST); \ + typeof(DST) expp__ = (EXP); \ + typeof(*(DST)) src__ = (SRC); \ + typeof(*(DST)) exp__ = *expp__; \ + uint8_t res__; \ + (void)ORD_FAIL; \ + \ + if ((ORDER) > memory_order_consume) { \ + if (sizeof(*(DST)) <= 4) { \ + atomic_compare_exchange__(dst__, exp__, src__, res__, \ + "memory"); \ + } else { \ + atomic_compare_exchange_8__(dst__, exp__, src__, res__, \ + "memory"); \ + } \ + } else { \ + if (sizeof(*(DST)) <= 4) { \ + atomic_compare_exchange__(dst__, exp__, src__, res__, \ + "cc"); \ + } else { \ + atomic_compare_exchange_8__(dst__, exp__, src__, res__, \ + "cc"); \ + } \ + } \ + if (!res__) { \ + *expp__ = exp__; \ + } \ + (bool)res__; \ + }) +#define atomic_compare_exchange_strong(DST, EXP, SRC) \ + atomic_compare_exchange_strong_explicit(DST, EXP, SRC, \ + memory_order_seq_cst, \ + memory_order_seq_cst) +#define atomic_compare_exchange_weak \ + atomic_compare_exchange_strong +#define atomic_compare_exchange_weak_explicit \ + atomic_compare_exchange_strong_explicit + +#define atomic_add__(RMW, ARG, CLOB) \ + asm volatile("lock; xadd %0,%1 ; " \ + "# atomic_add__ " \ + : "+r" (ARG), /* 0 */ \ + "+m" (*RMW) /* 1 */ \ + :: CLOB, "cc") + +#define atomic_add_32__(RMW, ARG, ORIG, ORDER) \ + ({ \ + typeof(RMW) rmw__ = (RMW); \ + typeof(*(RMW)) arg__ = (ARG); \ + \ + if ((ORDER) > memory_order_consume) { \ + atomic_add__(rmw__, arg__, "memory"); \ + } else { \ + atomic_add__(rmw__, arg__, "cc"); \ + } \ + *(ORIG) = arg__; \ + }) + +/* We could use simple locked instructions if the original value was not + * needed. */ +#define atomic_op__(RMW, OP, ARG, ORIG, ORDER) \ + ({ \ + typeof(RMW) rmw__ = (RMW); \ + typeof(ARG) arg__ = (ARG); \ + \ + typeof(*(RMW)) val__; \ + \ + atomic_read_explicit(rmw__, &val__, memory_order_relaxed); \ + do { \ + } while (!atomic_compare_exchange_weak_explicit(rmw__, &val__, \ + val__ OP arg__, \ + ORDER, \ + memory_order_relaxed)); \ + *(ORIG) = val__; \ + }) + +#define atomic_add_explicit(RMW, ARG, ORIG, ORDER) \ + (sizeof(*(RMW)) <= 4 \ + ? atomic_add_32__(RMW, ARG, ORIG, ORDER) \ + : atomic_op__(RMW, +, ARG, ORIG, ORDER)) +#define atomic_add(RMW, ARG, ORIG) \ + atomic_add_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_sub_explicit(RMW, ARG, ORIG, ORDER) \ + (sizeof(*(RMW)) <= 4 \ + ? atomic_add_32__(RMW, -(ARG), ORIG, ORDER) \ + : atomic_op__(RMW, -, ARG, ORIG, ORDER)) +#define atomic_sub(RMW, ARG, ORIG) \ + atomic_sub_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_or_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_op__(RMW, |, ARG, ORIG, ORDER) +#define atomic_or(RMW, ARG, ORIG) \ + atomic_or_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_xor_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_op__(RMW, ^, ARG, ORIG, ORDER) +#define atomic_xor(RMW, ARG, ORIG) \ + atomic_xor_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_and_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_op__(RMW, &, ARG, ORIG, ORDER) +#define atomic_and(RMW, ARG, ORIG) \ + atomic_and_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + + +/* atomic_flag */ + +typedef ATOMIC(int) atomic_flag; +#define ATOMIC_FLAG_INIT { false } + +#define atomic_flag_test_and_set_explicit(FLAG, ORDER) \ + ((bool)atomic_exchange__(FLAG, 1, ORDER)) +#define atomic_flag_test_and_set(FLAG) \ + atomic_flag_test_and_set_explicit(FLAG, memory_order_seq_cst) + +#define atomic_flag_clear_explicit(FLAG, ORDER) \ + atomic_store_explicit(FLAG, 0, ORDER) +#define atomic_flag_clear(FLAG) \ + atomic_flag_clear_explicit(FLAG, memory_order_seq_cst) diff -Nru openvswitch-2.3.1/lib/ovs-atomic-locked.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-locked.h --- openvswitch-2.3.1/lib/ovs-atomic-locked.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-locked.h 2015-06-23 18:46:21.000000000 +0000 @@ -20,6 +20,17 @@ atomic_unlock__(SRC), \ (void) 0) +/* XXX: Evaluates EXP multiple times. */ +#define atomic_compare_exchange_locked(DST, EXP, SRC) \ + (atomic_lock__(DST), \ + (*(DST) == *(EXP) \ + ? (*(DST) = (SRC), \ + atomic_unlock__(DST), \ + true) \ + : (*(EXP) = *(DST), \ + atomic_unlock__(DST), \ + false))) + #define atomic_op_locked_add += #define atomic_op_locked_sub -= #define atomic_op_locked_or |= diff -Nru openvswitch-2.3.1/lib/ovs-atomic-msvc.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-msvc.h --- openvswitch-2.3.1/lib/ovs-atomic-msvc.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-msvc.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,404 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This header implements atomic operation primitives for MSVC + * on i586 or greater platforms (32 bit). */ +#ifndef IN_OVS_ATOMIC_H +#error "This header should only be included indirectly via ovs-atomic.h." +#endif + +/* From msdn documentation: With Visual Studio 2003, volatile to volatile + * references are ordered; the compiler will not re-order volatile variable + * access. With Visual Studio 2005, the compiler also uses acquire semantics + * for read operations on volatile variables and release semantics for write + * operations on volatile variables (when supported by the CPU). + * + * Though there is no clear documentation that states that anything greater + * than VS 2005 has the same behavior as described above, looking through MSVCs + * C++ atomics library in VS2013 shows that the compiler still takes + * acquire/release semantics on volatile variables. */ +#define ATOMIC(TYPE) TYPE volatile + +typedef enum { + memory_order_relaxed, + memory_order_consume, + memory_order_acquire, + memory_order_release, + memory_order_acq_rel, + memory_order_seq_cst +} memory_order; + +#define ATOMIC_BOOL_LOCK_FREE 2 +#define ATOMIC_CHAR_LOCK_FREE 2 +#define ATOMIC_SHORT_LOCK_FREE 2 +#define ATOMIC_INT_LOCK_FREE 2 +#define ATOMIC_LONG_LOCK_FREE 2 +#define ATOMIC_LLONG_LOCK_FREE 2 +#define ATOMIC_POINTER_LOCK_FREE 2 + +#define IS_LOCKLESS_ATOMIC(OBJECT) \ + (sizeof(OBJECT) <= 8 && IS_POW2(sizeof(OBJECT))) + +#define ATOMIC_VAR_INIT(VALUE) (VALUE) +#define atomic_init(OBJECT, VALUE) (*(OBJECT) = (VALUE), (void) 0) + +static inline void +atomic_compiler_barrier(memory_order order) +{ + /* In case of 'memory_order_consume', it is implicitly assumed that + * the compiler will not move instructions that have data-dependency + * on the variable in question before the barrier. */ + if (order > memory_order_consume) { + _ReadWriteBarrier(); + } +} + +static inline void +atomic_thread_fence(memory_order order) +{ + /* x86 is strongly ordered and acquire/release semantics come + * automatically. */ + atomic_compiler_barrier(order); + if (order == memory_order_seq_cst) { + MemoryBarrier(); + atomic_compiler_barrier(order); + } +} + +static inline void +atomic_signal_fence(memory_order order) +{ + atomic_compiler_barrier(order); +} + +/* 1, 2 and 4 bytes loads and stores are atomic on aligned memory. In addition, + * since the compiler automatically takes acquire and release semantics on + * volatile variables, for any order lesser than 'memory_order_seq_cst', we + * can directly assign or read values. */ + +#define atomic_store32(DST, SRC, ORDER) \ + if (ORDER == memory_order_seq_cst) { \ + InterlockedExchange((int32_t volatile *) (DST), \ + (int32_t) (SRC)); \ + } else { \ + *(DST) = (SRC); \ + } + +/* MSVC converts 64 bit writes into two instructions. So there is + * a possibility that an interrupt can make a 64 bit write non-atomic even + * when 8 byte aligned. So use InterlockedExchange64(). + * + * For atomic stores, 'consume' and 'acquire' semantics are not valid. But we + * are using 'Exchange' to get atomic stores here and we only have + * InterlockedExchange64(), InterlockedExchangeNoFence64() and + * InterlockedExchange64Acquire() available. So we are forced to use + * InterlockedExchange64() which uses full memory barrier for everything + * greater than 'memory_order_relaxed'. */ +#define atomic_store64(DST, SRC, ORDER) \ + if (ORDER == memory_order_relaxed) { \ + InterlockedExchangeNoFence64((int64_t volatile *) (DST), \ + (int64_t) (SRC)); \ + } else { \ + InterlockedExchange64((int64_t volatile *) (DST), (int64_t) (SRC));\ + } + +/* Used for 8 and 16 bit variations. */ +#define atomic_storeX(X, DST, SRC, ORDER) \ + if (ORDER == memory_order_seq_cst) { \ + InterlockedExchange##X((int##X##_t volatile *) (DST), \ + (int##X##_t) (SRC)); \ + } else { \ + *(DST) = (SRC); \ + } + +#define atomic_store(DST, SRC) \ + atomic_store_explicit(DST, SRC, memory_order_seq_cst) + +#define atomic_store_explicit(DST, SRC, ORDER) \ + if (sizeof *(DST) == 1) { \ + atomic_storeX(8, DST, SRC, ORDER) \ + } else if (sizeof *(DST) == 2) { \ + atomic_storeX(16, DST, SRC, ORDER) \ + } else if (sizeof *(DST) == 4) { \ + atomic_store32(DST, SRC, ORDER) \ + } else if (sizeof *(DST) == 8) { \ + atomic_store64(DST, SRC, ORDER) \ + } else { \ + abort(); \ + } + +/* On x86, for 'memory_order_seq_cst', if stores are locked, the corresponding + * reads don't need to be locked (based on the following in Intel Developers + * manual: + * “Locked operations are atomic with respect to all other memory operations + * and all externally visible events. Only instruction fetch and page table + * accesses can pass locked instructions. Locked instructions can be used to + * synchronize data written by one processor and read by another processor. + * For the P6 family processors, locked operations serialize all outstanding + * load and store operations (that is, wait for them to complete). This rule + * is also true for the Pentium 4 and Intel Xeon processors, with one + * exception. Load operations that reference weakly ordered memory types + * (such as the WC memory type) may not be serialized."). */ + + /* For 8, 16 and 32 bit variations. */ +#define atomic_readX(SRC, DST, ORDER) \ + *(DST) = *(SRC); + +/* MSVC converts 64 bit reads into two instructions. So there is + * a possibility that an interrupt can make a 64 bit read non-atomic even + * when 8 byte aligned. So use fully memory barrier InterlockedOr64(). */ +#define atomic_read64(SRC, DST, ORDER) \ + __pragma (warning(push)) \ + __pragma (warning(disable:4047)) \ + *(DST) = InterlockedOr64((int64_t volatile *) (SRC), 0); \ + __pragma (warning(pop)) + +#define atomic_read(SRC, DST) \ + atomic_read_explicit(SRC, DST, memory_order_seq_cst) + +#define atomic_read_explicit(SRC, DST, ORDER) \ + if (sizeof *(DST) == 1 || sizeof *(DST) == 2 || sizeof *(DST) == 4) { \ + atomic_readX(SRC, DST, ORDER) \ + } else if (sizeof *(DST) == 8) { \ + atomic_read64(SRC, DST, ORDER) \ + } else { \ + abort(); \ + } + +/* For add, sub, and logical operations, for 8, 16 and 64 bit data types, + * functions for all the different memory orders does not exist + * (though documentation exists for some of them). The MSVC C++ library which + * implements the c11 atomics simply calls the full memory barrier function + * for everything in x86(see xatomic.h). So do the same here. */ + +/* For 8, 16 and 64 bit variations. */ +#define atomic_op(OP, X, RMW, ARG, ORIG, ORDER) \ + atomic_##OP##_generic(X, RMW, ARG, ORIG, ORDER) + +/* Arithmetic addition calls. */ + +#define atomic_add32(RMW, ARG, ORIG, ORDER) \ + *(ORIG) = InterlockedExchangeAdd((int32_t volatile *) (RMW), \ + (int32_t) (ARG)); + +/* For 8, 16 and 64 bit variations. */ +#define atomic_add_generic(X, RMW, ARG, ORIG, ORDER) \ + *(ORIG) = _InterlockedExchangeAdd##X((int##X##_t volatile *) (RMW), \ + (int##X##_t) (ARG)); + +#define atomic_add(RMW, ARG, ORIG) \ + atomic_add_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_add_explicit(RMW, ARG, ORIG, ORDER) \ + if (sizeof *(RMW) == 1) { \ + atomic_op(add, 8, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 2) { \ + atomic_op(add, 16, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 4) { \ + atomic_add32(RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 8) { \ + atomic_op(add, 64, RMW, ARG, ORIG, ORDER) \ + } else { \ + abort(); \ + } + +/* Arithmetic subtraction calls. */ + +#define atomic_sub(RMW, ARG, ORIG) \ + atomic_add_explicit(RMW, (0 - (ARG)), ORIG, memory_order_seq_cst) + +#define atomic_sub_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_add_explicit(RMW, (0 - (ARG)), ORIG, ORDER) + +/* Logical 'and' calls. */ + +#define atomic_and32(RMW, ARG, ORIG, ORDER) \ + *(ORIG) = InterlockedAnd((int32_t volatile *) (RMW), (int32_t) (ARG)); + +/* For 8, 16 and 64 bit variations. */ +#define atomic_and_generic(X, RMW, ARG, ORIG, ORDER) \ + *(ORIG) = InterlockedAnd##X((int##X##_t volatile *) (RMW), \ + (int##X##_t) (ARG)); + +#define atomic_and(RMW, ARG, ORIG) \ + atomic_and_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_and_explicit(RMW, ARG, ORIG, ORDER) \ + if (sizeof *(RMW) == 1) { \ + atomic_op(and, 8, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 2) { \ + atomic_op(and, 16, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 4) { \ + atomic_and32(RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 8) { \ + atomic_op(and, 64, RMW, ARG, ORIG, ORDER) \ + } else { \ + abort(); \ + } + +/* Logical 'Or' calls. */ + +#define atomic_or32(RMW, ARG, ORIG, ORDER) \ + *(ORIG) = InterlockedOr((int32_t volatile *) (RMW), (int32_t) (ARG)); + +/* For 8, 16 and 64 bit variations. */ +#define atomic_or_generic(X, RMW, ARG, ORIG, ORDER) \ + *(ORIG) = InterlockedOr##X((int##X##_t volatile *) (RMW), \ + (int##X##_t) (ARG)); + +#define atomic_or(RMW, ARG, ORIG) \ + atomic_or_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_or_explicit(RMW, ARG, ORIG, ORDER) \ + if (sizeof *(RMW) == 1) { \ + atomic_op(or, 8, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 2) { \ + atomic_op(or, 16, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 4) { \ + atomic_or32(RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 8) { \ + atomic_op(or, 64, RMW, ARG, ORIG, ORDER) \ + } else { \ + abort(); \ + } + +/* Logical Xor calls. */ + +#define atomic_xor32(RMW, ARG, ORIG, ORDER) \ + *(ORIG) = InterlockedXor((int32_t volatile *) (RMW), (int32_t) (ARG)); + +/* For 8, 16 and 64 bit variations. */ +#define atomic_xor_generic(X, RMW, ARG, ORIG, ORDER) \ + *(ORIG) = InterlockedXor##X((int##X##_t volatile *) (RMW), \ + (int##X##_t) (ARG)); + +#define atomic_xor(RMW, ARG, ORIG) \ + atomic_xor_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_xor_explicit(RMW, ARG, ORIG, ORDER) \ + if (sizeof *(RMW) == 1) { \ + atomic_op(xor, 8, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 2) { \ + atomic_op(xor, 16, RMW, ARG, ORIG, ORDER) \ + } else if (sizeof *(RMW) == 4) { \ + atomic_xor32(RMW, ARG, ORIG, ORDER); \ + } else if (sizeof *(RMW) == 8) { \ + atomic_op(xor, 64, RMW, ARG, ORIG, ORDER) \ + } else { \ + abort(); \ + } + +#define atomic_compare_exchange_strong(DST, EXP, SRC) \ + atomic_compare_exchange_strong_explicit(DST, EXP, SRC, \ + memory_order_seq_cst, \ + memory_order_seq_cst) + +#define atomic_compare_exchange_weak atomic_compare_exchange_strong +#define atomic_compare_exchange_weak_explicit \ + atomic_compare_exchange_strong_explicit + +/* MSVCs c++ compiler implements c11 atomics and looking through its + * implementation (in xatomic.h), orders are ignored for x86 platform. + * Do the same here. */ +static inline bool +atomic_compare_exchange8(int8_t volatile *dst, int8_t *expected, int8_t src) +{ + int8_t previous = _InterlockedCompareExchange8(dst, src, *expected); + if (previous == *expected) { + return true; + } else { + *expected = previous; + return false; + } +} + +static inline bool +atomic_compare_exchange16(int16_t volatile *dst, int16_t *expected, + int16_t src) +{ + int16_t previous = InterlockedCompareExchange16(dst, src, *expected); + if (previous == *expected) { + return true; + } else { + *expected = previous; + return false; + } +} + +static inline bool +atomic_compare_exchange32(int32_t volatile *dst, int32_t *expected, + int32_t src) +{ + int32_t previous = InterlockedCompareExchange(dst, src, *expected); + if (previous == *expected) { + return true; + } else { + *expected = previous; + return false; + } +} + +static inline bool +atomic_compare_exchange64(int64_t volatile *dst, int64_t *expected, + int64_t src) +{ + int64_t previous = InterlockedCompareExchange64(dst, src, *expected); + if (previous == *expected) { + return true; + } else { + *expected = previous; + return false; + } +} + +static inline bool +atomic_compare_unreachable() +{ + return true; +} + +#define atomic_compare_exchange_strong_explicit(DST, EXP, SRC, ORD1, ORD2) \ + (sizeof *(DST) == 1 \ + ? atomic_compare_exchange8((int8_t volatile *) (DST), (int8_t *) (EXP), \ + (int8_t) (SRC)) \ + : (sizeof *(DST) == 2 \ + ? atomic_compare_exchange16((int16_t volatile *) (DST), \ + (int16_t *) (EXP), (int16_t) (SRC)) \ + : (sizeof *(DST) == 4 \ + ? atomic_compare_exchange32((int32_t volatile *) (DST), \ + (int32_t *) (EXP), (int32_t) (SRC)) \ + : (sizeof *(DST) == 8 \ + ? atomic_compare_exchange64((int64_t volatile *) (DST), \ + (int64_t *) (EXP), (int64_t) (SRC)) \ + : ovs_fatal(0, "atomic operation with size greater than 8 bytes"), \ + atomic_compare_unreachable())))) + + +/* atomic_flag */ + +typedef ATOMIC(int32_t) atomic_flag; +#define ATOMIC_FLAG_INIT 0 + +#define atomic_flag_test_and_set(FLAG) \ + (bool) InterlockedBitTestAndSet(FLAG, 0) + +#define atomic_flag_test_and_set_explicit(FLAG, ORDER) \ + atomic_flag_test_and_set(FLAG) + +#define atomic_flag_clear_explicit(FLAG, ORDER) \ + atomic_flag_clear() +#define atomic_flag_clear(FLAG) \ + InterlockedBitTestAndReset(FLAG, 0) diff -Nru openvswitch-2.3.1/lib/ovs-atomic-pthreads.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-pthreads.h --- openvswitch-2.3.1/lib/ovs-atomic-pthreads.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-pthreads.h 2015-06-23 18:46:21.000000000 +0000 @@ -67,6 +67,16 @@ #define atomic_read_explicit(SRC, DST, ORDER) \ ((void) (ORDER), atomic_read(SRC, DST)) +#define atomic_compare_exchange_strong(DST, EXP, SRC) \ + atomic_compare_exchange_locked(DST, EXP, SRC) +#define atomic_compare_exchange_strong_explicit(DST, EXP, SRC, ORD1, ORD2) \ + ((void) (ORD1), (void) (ORD2), \ + atomic_compare_exchange_strong(DST, EXP, SRC)) +#define atomic_compare_exchange_weak \ + atomic_compare_exchange_strong +#define atomic_compare_exchange_weak_explicit \ + atomic_compare_exchange_strong_explicit + #define atomic_add(RMW, ARG, ORIG) atomic_op_locked(RMW, add, ARG, ORIG) #define atomic_sub(RMW, ARG, ORIG) atomic_op_locked(RMW, sub, ARG, ORIG) #define atomic_or( RMW, ARG, ORIG) atomic_op_locked(RMW, or, ARG, ORIG) diff -Nru openvswitch-2.3.1/lib/ovs-atomic-x86_64.h openvswitch-2.4.0~git20150623/lib/ovs-atomic-x86_64.h --- openvswitch-2.3.1/lib/ovs-atomic-x86_64.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-atomic-x86_64.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This header implements atomic operation primitives on x86_64 with GCC. */ +#ifndef IN_OVS_ATOMIC_H +#error "This header should only be included indirectly via ovs-atomic.h." +#endif + +#define OVS_ATOMIC_X86_64_IMPL 1 + +/* + * x86_64 Memory model (http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.html): + * + * - 1, 2, 4, and 8 byte loads and stores are atomic on aligned memory. + * - Loads are not reordered with other loads. + * - Stores are not reordered with OLDER loads. + * - Loads may be reordered with OLDER stores to a different memory location, + * but not with OLDER stores to the same memory location. + * - Stores are not reordered with other stores, except for special + * instructions (CLFLUSH, streaming stores, fast string operations). + * Most of these are not emitted by compilers, and as long as the + * atomic stores are not combined with any other stores, even the allowed + * reordering of the stores by a single fast string operation (e.g., "stos") + * is not a problem. + * - Neither loads nor stores are reordered with locked instructions. + * - Loads cannot pass earlier LFENCE or MFENCE instructions. + * - Stores cannot pass earlier LFENCE, SFENCE, or MFENCE instructions. + * - LFENCE instruction cannot pass earlier loads. + * - SFENCE instruction cannot pass earlier stores. + * - MFENCE instruction cannot pass earlier loads or stores. + * - Stores by a single processor are observed in the same order by all + * processors. + * - (Unlocked) Stores from different processors are NOT ordered. + * - Memory ordering obeys causality (memory ordering respects transitive + * visibility). + * - Any two stores are seen in a consistent order by processors other than + * the those performing the stores. + * - Locked instructions have total order. + * + * These rules imply that: + * + * - Locked instructions are not needed for aligned loads or stores to make + * them atomic. + * - All stores have release semantics; none of the preceding stores or loads + * can be reordered with following stores. Following loads could still be + * reordered to happen before the store, but that is not a violation of the + * release semantics. + * - All loads from a given memory location have acquire semantics with + * respect to the stores on the same memory location; none of the following + * loads or stores can be reordered with the load. Preceding stores to a + * different memory location MAY be reordered with the load, but that is not + * a violation of the acquire semantics (i.e., the loads and stores of two + * critical sections guarded by a different memory location can overlap). + * - Locked instructions serve as CPU memory barriers by themselves. + * - Locked stores implement the sequential consistency memory order. Using + * locked instructions when seq_cst memory order is requested allows normal + * loads to observe the stores in the same (total) order without using CPU + * memory barrier after the loads. + * + * NOTE: Some older AMD Opteron processors have a bug that violates the + * acquire semantics described above. The bug manifests as an unlocked + * read-modify-write operation following a "semaphore operation" operating + * on data that existed before entering the critical section; i.e., the + * preceding "semaphore operation" fails to function as an acquire barrier. + * The affected CPUs are AMD family 15, models 32 to 63. + * + * Ref. http://support.amd.com/TechDocs/25759.pdf errata #147. + */ + +/* Barriers. */ + +#define compiler_barrier() asm volatile(" " : : : "memory") +#define cpu_barrier() asm volatile("mfence;" : : : "memory") + +/* + * The 'volatile' keyword prevents the compiler from keeping the atomic + * value in a register, and generates a new memory access for each atomic + * operation. This allows the implementations of memory_order_relaxed and + * memory_order_consume to avoid issuing a compiler memory barrier, allowing + * full optimization of all surrounding non-atomic variables. + * + * The placement of the 'volatile' keyword after the 'TYPE' below is highly + * significant when the TYPE is a pointer type. In that case we want the + * pointer to be declared volatile, not the data type that is being pointed + * at! + */ +#define ATOMIC(TYPE) TYPE volatile + +/* Memory ordering. Must be passed in as a constant. */ +typedef enum { + memory_order_relaxed, + memory_order_consume, + memory_order_acquire, + memory_order_release, + memory_order_acq_rel, + memory_order_seq_cst +} memory_order; + +#define ATOMIC_BOOL_LOCK_FREE 2 +#define ATOMIC_CHAR_LOCK_FREE 2 +#define ATOMIC_SHORT_LOCK_FREE 2 +#define ATOMIC_INT_LOCK_FREE 2 +#define ATOMIC_LONG_LOCK_FREE 2 +#define ATOMIC_LLONG_LOCK_FREE 2 +#define ATOMIC_POINTER_LOCK_FREE 2 + +#define IS_LOCKLESS_ATOMIC(OBJECT) \ + (sizeof(OBJECT) <= 8 && IS_POW2(sizeof(OBJECT))) + +#define ATOMIC_VAR_INIT(VALUE) VALUE +#define atomic_init(OBJECT, VALUE) (*(OBJECT) = (VALUE), (void) 0) + +/* + * The memory_model_relaxed does not need a compiler barrier, if the + * atomic operation can otherwise be guaranteed to not be moved with + * respect to other atomic operations on the same memory location. Using + * the 'volatile' keyword in the definition of the atomic types + * accomplishes this, as memory accesses to volatile data may not be + * optimized away, or be reordered with other volatile accesses. + * + * On x86 also memory_order_consume is automatic, and data dependency on a + * volatile atomic variable means that the compiler optimizations should not + * cause problems. That is, the compiler should not speculate the value of + * the atomic_read, as it is going to read it from the memory anyway. + * This allows omiting the compiler memory barrier on atomic_reads with + * memory_order_consume. This matches the definition of + * smp_read_barrier_depends() in Linux kernel as a nop for x86, and its usage + * in rcu_dereference(). + * + * We use this same logic below to choose inline assembly statements with or + * without a compiler memory barrier. + */ +static inline void +atomic_compiler_barrier(memory_order order) +{ + if (order > memory_order_consume) { + compiler_barrier(); + } +} + +static inline void +atomic_thread_fence(memory_order order) +{ + if (order == memory_order_seq_cst) { + cpu_barrier(); + } else { + atomic_compiler_barrier(order); + } +} + +static inline void +atomic_signal_fence(memory_order order) +{ + atomic_compiler_barrier(order); +} + +#define atomic_is_lock_free(OBJ) \ + ((void) *(OBJ), \ + IS_LOCKLESS_ATOMIC(*(OBJ)) ? 2 : 0) + +#define atomic_exchange__(DST, SRC, ORDER) \ + ({ \ + typeof(DST) dst___ = (DST); \ + typeof(*(DST)) src___ = (SRC); \ + \ + if ((ORDER) > memory_order_consume) { \ + asm volatile("xchg %1,%0 ; " \ + "# atomic_exchange__" \ + : "+r" (src___), /* 0 */ \ + "+m" (*dst___) /* 1 */ \ + :: "memory"); \ + } else { \ + asm volatile("xchg %1,%0 ; " \ + "# atomic_exchange__" \ + : "+r" (src___), /* 0 */ \ + "+m" (*dst___)); /* 1 */ \ + } \ + src___; \ + }) + +/* Atomic store: Valid memory models are: + * + * memory_order_relaxed, memory_order_release, and + * memory_order_seq_cst. */ +#define atomic_store_explicit(DST, SRC, ORDER) \ + ({ \ + typeof(DST) dst__ = (DST); \ + typeof(*(DST)) src__ = (SRC); \ + \ + if ((ORDER) != memory_order_seq_cst) { \ + atomic_compiler_barrier(ORDER); \ + *dst__ = src__; \ + } else { \ + atomic_exchange__(dst__, src__, ORDER); \ + } \ + (void) 0; \ + }) +#define atomic_store(DST, SRC) \ + atomic_store_explicit(DST, SRC, memory_order_seq_cst) + +/* Atomic read: Valid memory models are: + * + * memory_order_relaxed, memory_order_consume, memory_model_acquire, + * and memory_order_seq_cst. */ +#define atomic_read_explicit(SRC, DST, ORDER) \ + ({ \ + typeof(DST) dst__ = (DST); \ + typeof(SRC) src__ = (SRC); \ + \ + *dst__ = *src__; \ + atomic_compiler_barrier(ORDER); \ + (void) 0; \ + }) +#define atomic_read(SRC, DST) \ + atomic_read_explicit(SRC, DST, memory_order_seq_cst) + +#define atomic_compare_exchange__(DST, EXP, SRC, RES, CLOB) \ + asm volatile("lock; cmpxchg %3,%1 ; " \ + " sete %0 " \ + "# atomic_compare_exchange__" \ + : "=q" (RES), /* 0 */ \ + "+m" (*DST), /* 1 */ \ + "+a" (EXP) /* 2 */ \ + : "r" (SRC) /* 3 */ \ + : CLOB, "cc") + +/* All memory models are valid for read-modify-write operations. + * + * Valid memory models for the read operation of the current value in + * the failure case are the same as for atomic read, but can not be + * stronger than the success memory model. + * ORD_FAIL is ignored, as atomic_compare_exchange__ already implements + * at least as strong a barrier as allowed for ORD_FAIL in all cases. */ +#define atomic_compare_exchange_strong_explicit(DST, EXP, SRC, ORDER, ORD_FAIL) \ + ({ \ + typeof(DST) dst__ = (DST); \ + typeof(DST) expp__ = (EXP); \ + typeof(*(DST)) src__ = (SRC); \ + typeof(*(DST)) exp__ = *expp__; \ + uint8_t res__; \ + (void)ORD_FAIL; \ + \ + if ((ORDER) > memory_order_consume) { \ + atomic_compare_exchange__(dst__, exp__, src__, res__, \ + "memory"); \ + } else { \ + atomic_compare_exchange__(dst__, exp__, src__, res__, \ + "cc"); \ + } \ + if (!res__) { \ + *expp__ = exp__; \ + } \ + (bool)res__; \ + }) +#define atomic_compare_exchange_strong(DST, EXP, SRC) \ + atomic_compare_exchange_strong_explicit(DST, EXP, SRC, \ + memory_order_seq_cst, \ + memory_order_seq_cst) +#define atomic_compare_exchange_weak \ + atomic_compare_exchange_strong +#define atomic_compare_exchange_weak_explicit \ + atomic_compare_exchange_strong_explicit + +#define atomic_add__(RMW, ARG, CLOB) \ + asm volatile("lock; xadd %0,%1 ; " \ + "# atomic_add__ " \ + : "+r" (ARG), /* 0 */ \ + "+m" (*RMW) /* 1 */ \ + :: CLOB, "cc") + +#define atomic_add_explicit(RMW, ARG, ORIG, ORDER) \ + ({ \ + typeof(RMW) rmw__ = (RMW); \ + typeof(*(RMW)) arg__ = (ARG); \ + \ + if ((ORDER) > memory_order_consume) { \ + atomic_add__(rmw__, arg__, "memory"); \ + } else { \ + atomic_add__(rmw__, arg__, "cc"); \ + } \ + *(ORIG) = arg__; \ + }) +#define atomic_add(RMW, ARG, ORIG) \ + atomic_add_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_sub_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_add_explicit(RMW, -(ARG), ORIG, ORDER) +#define atomic_sub(RMW, ARG, ORIG) \ + atomic_sub_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +/* We could use simple locked instructions if the original value was not + * needed. */ +#define atomic_op__(RMW, OP, ARG, ORIG, ORDER) \ + ({ \ + typeof(RMW) rmw__ = (RMW); \ + typeof(ARG) arg__ = (ARG); \ + \ + typeof(*(RMW)) val__; \ + \ + atomic_read_explicit(rmw__, &val__, memory_order_relaxed); \ + do { \ + } while (!atomic_compare_exchange_weak_explicit(rmw__, &val__, \ + val__ OP arg__, \ + ORDER, \ + memory_order_relaxed)); \ + *(ORIG) = val__; \ + }) + +#define atomic_or_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_op__(RMW, |, ARG, ORIG, ORDER) +#define atomic_or(RMW, ARG, ORIG) \ + atomic_or_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_xor_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_op__(RMW, ^, ARG, ORIG, ORDER) +#define atomic_xor(RMW, ARG, ORIG) \ + atomic_xor_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + +#define atomic_and_explicit(RMW, ARG, ORIG, ORDER) \ + atomic_op__(RMW, &, ARG, ORIG, ORDER) +#define atomic_and(RMW, ARG, ORIG) \ + atomic_and_explicit(RMW, ARG, ORIG, memory_order_seq_cst) + + +/* atomic_flag */ + +typedef ATOMIC(int) atomic_flag; +#define ATOMIC_FLAG_INIT { false } + +#define atomic_flag_test_and_set_explicit(FLAG, ORDER) \ + ((bool)atomic_exchange__(FLAG, 1, ORDER)) +#define atomic_flag_test_and_set(FLAG) \ + atomic_flag_test_and_set_explicit(FLAG, memory_order_seq_cst) + +#define atomic_flag_clear_explicit(FLAG, ORDER) \ + atomic_store_explicit(FLAG, 0, ORDER) +#define atomic_flag_clear(FLAG) \ + atomic_flag_clear_explicit(FLAG, memory_order_seq_cst) diff -Nru openvswitch-2.3.1/lib/ovsdb-data.c openvswitch-2.4.0~git20150623/lib/ovsdb-data.c --- openvswitch-2.3.1/lib/ovsdb-data.c 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-data.c 2015-06-23 18:46:21.000000000 +0000 @@ -304,7 +304,7 @@ } } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT ovsdb_atom_parse_uuid(struct uuid *uuid, const struct json *json, struct ovsdb_symbol_table *symtab, const struct ovsdb_base_type *base) @@ -343,7 +343,7 @@ return error0; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT ovsdb_atom_from_json__(union ovsdb_atom *atom, const struct ovsdb_base_type *base, const struct json *json, diff -Nru openvswitch-2.3.1/lib/ovsdb-data.h openvswitch-2.4.0~git20150623/lib/ovsdb-data.h --- openvswitch-2.3.1/lib/ovsdb-data.h 2014-10-09 20:14:01.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-data.h 2015-06-23 18:46:21.000000000 +0000 @@ -85,14 +85,14 @@ const struct ovsdb_base_type *, const struct json *, struct ovsdb_symbol_table *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_atom_to_json(const union ovsdb_atom *, enum ovsdb_atomic_type); char *ovsdb_atom_from_string(union ovsdb_atom *, const struct ovsdb_base_type *, const char *, struct ovsdb_symbol_table *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void ovsdb_atom_to_string(const union ovsdb_atom *, enum ovsdb_atomic_type, struct ds *); void ovsdb_atom_to_bare(const union ovsdb_atom *, enum ovsdb_atomic_type, @@ -100,7 +100,7 @@ struct ovsdb_error *ovsdb_atom_check_constraints( const union ovsdb_atom *, const struct ovsdb_base_type *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; /* An instance of an OVSDB type (given by struct ovsdb_type). * @@ -142,7 +142,7 @@ /* Checking and maintaining invariants. */ struct ovsdb_error *ovsdb_datum_sort(struct ovsdb_datum *, enum ovsdb_atomic_type key_type) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void ovsdb_datum_sort_assert(struct ovsdb_datum *, enum ovsdb_atomic_type key_type); @@ -153,21 +153,21 @@ struct ovsdb_error *ovsdb_datum_check_constraints( const struct ovsdb_datum *, const struct ovsdb_type *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; /* Type conversion. */ struct ovsdb_error *ovsdb_datum_from_json(struct ovsdb_datum *, const struct ovsdb_type *, const struct json *, struct ovsdb_symbol_table *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_datum_to_json(const struct ovsdb_datum *, const struct ovsdb_type *); char *ovsdb_datum_from_string(struct ovsdb_datum *, const struct ovsdb_type *, const char *, struct ovsdb_symbol_table *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void ovsdb_datum_to_string(const struct ovsdb_datum *, const struct ovsdb_type *, struct ds *); void ovsdb_datum_to_bare(const struct ovsdb_datum *, @@ -255,7 +255,7 @@ * * Used by ovsdb_atom_from_string() and ovsdb_datum_from_string(). */ -char *ovsdb_token_parse(const char **, char **outp) WARN_UNUSED_RESULT; +char *ovsdb_token_parse(const char **, char **outp) OVS_WARN_UNUSED_RESULT; bool ovsdb_token_is_delim(unsigned char); #endif /* ovsdb-data.h */ diff -Nru openvswitch-2.3.1/lib/ovsdb-error.c openvswitch-2.4.0~git20150623/lib/ovsdb-error.c --- openvswitch-2.3.1/lib/ovsdb-error.c 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-error.c 2015-06-23 18:46:21.000000000 +0000 @@ -23,7 +23,7 @@ #include "dynamic-string.h" #include "json.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovsdb_error); diff -Nru openvswitch-2.3.1/lib/ovsdb-error.h openvswitch-2.4.0~git20150623/lib/ovsdb-error.h --- openvswitch-2.3.1/lib/ovsdb-error.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-error.h 2015-06-23 18:46:21.000000000 +0000 @@ -21,25 +21,25 @@ struct json; struct ovsdb_error *ovsdb_error(const char *tag, const char *details, ...) - PRINTF_FORMAT(2, 3) - WARN_UNUSED_RESULT; + OVS_PRINTF_FORMAT(2, 3) + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_io_error(int error, const char *details, ...) - PRINTF_FORMAT(2, 3) - WARN_UNUSED_RESULT; + OVS_PRINTF_FORMAT(2, 3) + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_syntax_error(const struct json *, const char *tag, const char *details, ...) - PRINTF_FORMAT(3, 4) - WARN_UNUSED_RESULT; + OVS_PRINTF_FORMAT(3, 4) + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_wrap_error(struct ovsdb_error *error, const char *details, ...) - PRINTF_FORMAT(2, 3); + OVS_PRINTF_FORMAT(2, 3); struct ovsdb_error *ovsdb_internal_error(struct ovsdb_error *error, const char *file, int line, const char *details, ...) - PRINTF_FORMAT(4, 5) - WARN_UNUSED_RESULT; + OVS_PRINTF_FORMAT(4, 5) + OVS_WARN_UNUSED_RESULT; /* Returns a pointer to an ovsdb_error that represents an internal error for * the current file name and line number with MSG as the associated message. @@ -57,7 +57,7 @@ void ovsdb_error_destroy(struct ovsdb_error *); struct ovsdb_error *ovsdb_error_clone(const struct ovsdb_error *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; char *ovsdb_error_to_string(const struct ovsdb_error *); struct json *ovsdb_error_to_json(const struct ovsdb_error *); diff -Nru openvswitch-2.3.1/lib/ovsdb-idl.c openvswitch-2.4.0~git20150623/lib/ovsdb-idl.c --- openvswitch-2.3.1/lib/ovsdb-idl.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-idl.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,13 +28,17 @@ #include "fatal-signal.h" #include "json.h" #include "jsonrpc.h" +#include "ovsdb/ovsdb.h" +#include "ovsdb/table.h" #include "ovsdb-data.h" #include "ovsdb-error.h" #include "ovsdb-idl-provider.h" +#include "ovsdb-parser.h" #include "poll-loop.h" #include "shash.h" +#include "sset.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovsdb_idl); @@ -65,22 +69,31 @@ * tables. */ struct ovsdb_idl_arc { - struct list src_node; /* In src->src_arcs list. */ - struct list dst_node; /* In dst->dst_arcs list. */ + struct ovs_list src_node; /* In src->src_arcs list. */ + struct ovs_list dst_node; /* In dst->dst_arcs list. */ struct ovsdb_idl_row *src; /* Source row. */ struct ovsdb_idl_row *dst; /* Destination row. */ }; +enum ovsdb_idl_state { + IDL_S_SCHEMA_REQUESTED, + IDL_S_MONITOR_REQUESTED, + IDL_S_MONITORING +}; + struct ovsdb_idl { const struct ovsdb_idl_class *class; struct jsonrpc_session *session; struct shash table_by_name; struct ovsdb_idl_table *tables; /* Contains "struct ovsdb_idl_table *"s.*/ - struct json *monitor_request_id; - unsigned int last_monitor_request_seqno; unsigned int change_seqno; bool verify_write_only; + /* Session state. */ + unsigned int state_seqno; + enum ovsdb_idl_state state; + struct json *request_id; + /* Database locking. */ char *lock_name; /* Name of lock we need, NULL if none. */ bool has_lock; /* Has db server told us we have the lock? */ @@ -124,7 +137,9 @@ static struct vlog_rate_limit semantic_rl = VLOG_RATE_LIMIT_INIT(1, 5); static void ovsdb_idl_clear(struct ovsdb_idl *); -static void ovsdb_idl_send_monitor_request(struct ovsdb_idl *); +static void ovsdb_idl_send_schema_request(struct ovsdb_idl *); +static void ovsdb_idl_send_monitor_request(struct ovsdb_idl *, + const struct json *schema_json); static void ovsdb_idl_parse_update(struct ovsdb_idl *, const struct json *); static struct ovsdb_error *ovsdb_idl_parse_update__(struct ovsdb_idl *, const struct json *); @@ -214,7 +229,10 @@ hmap_init(&table->rows); table->idl = idl; } - idl->last_monitor_request_seqno = UINT_MAX; + + idl->state_seqno = UINT_MAX; + idl->request_id = NULL; + hmap_init(&idl->outstanding_txns); return idl; @@ -239,7 +257,7 @@ } shash_destroy(&idl->table_by_name); free(idl->tables); - json_destroy(idl->monitor_request_id); + json_destroy(idl->request_id); free(idl->lock_name); json_destroy(idl->lock_request_id); hmap_destroy(&idl->outstanding_txns); @@ -298,14 +316,17 @@ unsigned int seqno; seqno = jsonrpc_session_get_seqno(idl->session); - if (idl->last_monitor_request_seqno != seqno) { - idl->last_monitor_request_seqno = seqno; + if (idl->state_seqno != seqno) { + idl->state_seqno = seqno; + json_destroy(idl->request_id); + idl->request_id = NULL; ovsdb_idl_txn_abort_all(idl); - ovsdb_idl_send_monitor_request(idl); + + ovsdb_idl_send_schema_request(idl); + idl->state = IDL_S_SCHEMA_REQUESTED; if (idl->lock_name) { ovsdb_idl_send_lock_request(idl); } - break; } msg = jsonrpc_session_recv(idl->session); @@ -321,14 +342,31 @@ /* Database contents changed. */ ovsdb_idl_parse_update(idl, msg->params->u.array.elems[1]); } else if (msg->type == JSONRPC_REPLY - && idl->monitor_request_id - && json_equal(idl->monitor_request_id, msg->id)) { - /* Reply to our "monitor" request. */ - idl->change_seqno++; - json_destroy(idl->monitor_request_id); - idl->monitor_request_id = NULL; - ovsdb_idl_clear(idl); - ovsdb_idl_parse_update(idl, msg->result); + && idl->request_id + && json_equal(idl->request_id, msg->id)) { + switch (idl->state) { + case IDL_S_SCHEMA_REQUESTED: + /* Reply to our "get_schema" request. */ + json_destroy(idl->request_id); + idl->request_id = NULL; + ovsdb_idl_send_monitor_request(idl, msg->result); + idl->state = IDL_S_MONITOR_REQUESTED; + break; + + case IDL_S_MONITOR_REQUESTED: + /* Reply to our "monitor" request. */ + idl->change_seqno++; + json_destroy(idl->request_id); + idl->request_id = NULL; + idl->state = IDL_S_MONITORING; + ovsdb_idl_clear(idl); + ovsdb_idl_parse_update(idl, msg->result); + break; + + case IDL_S_MONITORING: + default: + OVS_NOT_REACHED(); + } } else if (msg->type == JSONRPC_REPLY && idl->lock_request_id && json_equal(idl->lock_request_id, msg->id)) { @@ -430,12 +468,16 @@ idl->verify_write_only = true; } +/* Returns true if 'idl' is currently connected or trying to connect. */ bool ovsdb_idl_is_alive(const struct ovsdb_idl *idl) { return jsonrpc_session_is_alive(idl->session); } +/* Returns the last error reported on a connection by 'idl'. The return value + * is 0 only if no connection made by 'idl' has ever encountered an error. See + * jsonrpc_get_status() for return value interpretation. */ int ovsdb_idl_get_last_error(const struct ovsdb_idl *idl) { @@ -551,8 +593,107 @@ } static void -ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl) +ovsdb_idl_send_schema_request(struct ovsdb_idl *idl) +{ + struct jsonrpc_msg *msg; + + json_destroy(idl->request_id); + msg = jsonrpc_create_request( + "get_schema", + json_array_create_1(json_string_create(idl->class->database)), + &idl->request_id); + jsonrpc_session_send(idl->session, msg); +} + +static void +log_error(struct ovsdb_error *error) +{ + char *s = ovsdb_error_to_string(error); + VLOG_WARN("error parsing database schema: %s", s); + free(s); + ovsdb_error_destroy(error); +} + +/* Frees 'schema', which is in the format returned by parse_schema(). */ +static void +free_schema(struct shash *schema) +{ + if (schema) { + struct shash_node *node, *next; + + SHASH_FOR_EACH_SAFE (node, next, schema) { + struct sset *sset = node->data; + sset_destroy(sset); + free(sset); + shash_delete(schema, node); + } + shash_destroy(schema); + free(schema); + } +} + +/* Parses 'schema_json', an OVSDB schema in JSON format as described in RFC + * 7047, to obtain the names of its rows and columns. If successful, returns + * an shash whose keys are table names and whose values are ssets, where each + * sset contains the names of its table's columns. On failure (due to a parse + * error), returns NULL. + * + * It would also be possible to use the general-purpose OVSDB schema parser in + * ovsdb-server, but that's overkill, possibly too strict for the current use + * case, and would require restructuring ovsdb-server to separate the schema + * code from the rest. */ +static struct shash * +parse_schema(const struct json *schema_json) +{ + struct ovsdb_parser parser; + const struct json *tables_json; + struct ovsdb_error *error; + struct shash_node *node; + struct shash *schema; + + ovsdb_parser_init(&parser, schema_json, "database schema"); + tables_json = ovsdb_parser_member(&parser, "tables", OP_OBJECT); + error = ovsdb_parser_destroy(&parser); + if (error) { + log_error(error); + return NULL; + } + + schema = xmalloc(sizeof *schema); + shash_init(schema); + SHASH_FOR_EACH (node, json_object(tables_json)) { + const char *table_name = node->name; + const struct json *json = node->data; + const struct json *columns_json; + + ovsdb_parser_init(&parser, json, "table schema for table %s", + table_name); + columns_json = ovsdb_parser_member(&parser, "columns", OP_OBJECT); + error = ovsdb_parser_destroy(&parser); + if (error) { + log_error(error); + free_schema(schema); + return NULL; + } + + struct sset *columns = xmalloc(sizeof *columns); + sset_init(columns); + + struct shash_node *node2; + SHASH_FOR_EACH (node2, json_object(columns_json)) { + const char *column_name = node2->name; + sset_add(columns, column_name); + } + shash_add(schema, table_name, columns); + } + return schema; +} + +static void +ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, + const struct json *schema_json) { + struct shash *schema = parse_schema(schema_json); struct json *monitor_requests; struct jsonrpc_msg *msg; size_t i; @@ -562,12 +703,25 @@ const struct ovsdb_idl_table *table = &idl->tables[i]; const struct ovsdb_idl_table_class *tc = table->class; struct json *monitor_request, *columns; + const struct sset *table_schema; size_t j; + table_schema = (schema + ? shash_find_data(schema, table->class->name) + : NULL); + columns = table->need_table ? json_array_create_empty() : NULL; for (j = 0; j < tc->n_columns; j++) { const struct ovsdb_idl_column *column = &tc->columns[j]; if (table->modes[j] & OVSDB_IDL_MONITOR) { + if (table_schema + && !sset_contains(table_schema, column->name)) { + VLOG_WARN("%s table in %s database lacks %s column " + "(database needs upgrade?)", + table->class->name, idl->class->database, + column->name); + continue; + } if (!columns) { columns = json_array_create_empty(); } @@ -576,18 +730,27 @@ } if (columns) { + if (schema && !table_schema) { + VLOG_WARN("%s database lacks %s table " + "(database needs upgrade?)", + idl->class->database, table->class->name); + json_destroy(columns); + continue; + } + monitor_request = json_object_create(); json_object_put(monitor_request, "columns", columns); json_object_put(monitor_requests, tc->name, monitor_request); } } + free_schema(schema); - json_destroy(idl->monitor_request_id); + json_destroy(idl->request_id); msg = jsonrpc_create_request( "monitor", json_array_create_3(json_string_create(idl->class->database), json_null_create(), monitor_requests), - &idl->monitor_request_id); + &idl->request_id); jsonrpc_session_send(idl->session, msg); } @@ -1196,6 +1359,21 @@ return ovsdb_idl_read(row, column); } +/* Returns true if the field represented by 'column' in 'row' may be modified, + * false if it is immutable. + * + * Normally, whether a field is mutable is controlled by its column's schema. + * However, an immutable column can be set to any initial value at the time of + * insertion, so if 'row' is a new row (one that is being added as part of the + * current transaction, supposing that a transaction is in progress) then even + * its "immutable" fields are actually mutable. */ +bool +ovsdb_idl_is_mutable(const struct ovsdb_idl_row *row, + const struct ovsdb_idl_column *column) +{ + return column->mutable || (row->new && !row->old); +} + /* Returns false if 'row' was obtained from the IDL, true if it was initialized * to all-zero-bits by some other entity. If 'row' was set up some other way * then the return value is indeterminate. */ @@ -2370,11 +2548,11 @@ ovsdb_idl_update_has_lock(struct ovsdb_idl *idl, bool new_has_lock) { if (new_has_lock && !idl->has_lock) { - if (!idl->monitor_request_id) { + if (idl->state == IDL_S_MONITORING) { idl->change_seqno++; } else { - /* We're waiting for a monitor reply, so don't signal that the - * database changed. The monitor reply will increment change_seqno + /* We're setting up a session, so don't signal that the database + * changed. Finalizing the session will increment change_seqno * anyhow. */ } idl->is_lock_contended = false; diff -Nru openvswitch-2.3.1/lib/ovsdb-idl.h openvswitch-2.4.0~git20150623/lib/ovsdb-idl.h --- openvswitch-2.3.1/lib/ovsdb-idl.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-idl.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,10 @@ * raw JSON into data structures that are easier for clients to digest. Most * notably, references to rows via UUID become C pointers. * + * The IDL always presents a consistent snapshot of the database to its client, + * that is, it won't present the effects of some part of a transaction applied + * at the database server without presenting all of its effects. + * * The IDL also assists with issuing database transactions. The client creates * a transaction, manipulates the IDL data structures, and commits or aborts * the transaction. The IDL then composes and issues the necessary JSON-RPC @@ -115,6 +119,8 @@ const struct ovsdb_idl_column *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); +bool ovsdb_idl_is_mutable(const struct ovsdb_idl_row *, + const struct ovsdb_idl_column *); bool ovsdb_idl_row_is_synthetic(const struct ovsdb_idl_row *); @@ -187,7 +193,7 @@ struct ovsdb_idl_txn *ovsdb_idl_txn_create(struct ovsdb_idl *); void ovsdb_idl_txn_add_comment(struct ovsdb_idl_txn *, const char *, ...) - PRINTF_FORMAT (2, 3); + OVS_PRINTF_FORMAT (2, 3); void ovsdb_idl_txn_set_dry_run(struct ovsdb_idl_txn *); void ovsdb_idl_txn_increment(struct ovsdb_idl_txn *, const struct ovsdb_idl_row *, diff -Nru openvswitch-2.3.1/lib/ovsdb-idl-provider.h openvswitch-2.4.0~git20150623/lib/ovsdb-idl-provider.h --- openvswitch-2.3.1/lib/ovsdb-idl-provider.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-idl-provider.h 2015-06-23 18:46:21.000000000 +0000 @@ -26,8 +26,8 @@ struct ovsdb_idl_row { struct hmap_node hmap_node; /* In struct ovsdb_idl_table's 'rows'. */ struct uuid uuid; /* Row "_uuid" field. */ - struct list src_arcs; /* Forward arcs (ovsdb_idl_arc.src_node). */ - struct list dst_arcs; /* Backward arcs (ovsdb_idl_arc.dst_node). */ + struct ovs_list src_arcs; /* Forward arcs (ovsdb_idl_arc.src_node). */ + struct ovs_list dst_arcs; /* Backward arcs (ovsdb_idl_arc.dst_node). */ struct ovsdb_idl_table *table; /* Containing table. */ struct ovsdb_datum *old; /* Committed data (null if orphaned). */ diff -Nru openvswitch-2.3.1/lib/ovsdb-parser.c openvswitch-2.4.0~git20150623/lib/ovsdb-parser.c --- openvswitch-2.3.1/lib/ovsdb-parser.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-parser.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2011, 2013 Nicira, Inc. +/* Copyright (c) 2009, 2011, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,6 +127,15 @@ } struct ovsdb_error * +ovsdb_parser_destroy(struct ovsdb_parser *parser) +{ + free(parser->name); + sset_destroy(&parser->used); + + return parser->error; +} + +struct ovsdb_error * ovsdb_parser_finish(struct ovsdb_parser *parser) { if (!parser->error) { @@ -157,8 +166,5 @@ } } - free(parser->name); - sset_destroy(&parser->used); - - return parser->error; + return ovsdb_parser_destroy(parser); } diff -Nru openvswitch-2.3.1/lib/ovsdb-parser.h openvswitch-2.4.0~git20150623/lib/ovsdb-parser.h --- openvswitch-2.3.1/lib/ovsdb-parser.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-parser.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,18 +61,19 @@ void ovsdb_parser_init(struct ovsdb_parser *, const struct json *, const char *name, ...) - PRINTF_FORMAT(3, 4); + OVS_PRINTF_FORMAT(3, 4); const struct json *ovsdb_parser_member(struct ovsdb_parser *, const char *name, enum ovsdb_parser_types); void ovsdb_parser_raise_error(struct ovsdb_parser *parser, const char *format, ...) - PRINTF_FORMAT(2, 3); + OVS_PRINTF_FORMAT(2, 3); bool ovsdb_parser_has_error(const struct ovsdb_parser *); struct ovsdb_error *ovsdb_parser_get_error(const struct ovsdb_parser *); struct ovsdb_error *ovsdb_parser_finish(struct ovsdb_parser *) - WARN_UNUSED_RESULT; -void ovsdb_parser_destroy(struct ovsdb_parser *); + OVS_WARN_UNUSED_RESULT; +struct ovsdb_error *ovsdb_parser_destroy(struct ovsdb_parser *) + OVS_WARN_UNUSED_RESULT; bool ovsdb_parser_is_id(const char *string); diff -Nru openvswitch-2.3.1/lib/ovsdb-types.h openvswitch-2.4.0~git20150623/lib/ovsdb-types.h --- openvswitch-2.3.1/lib/ovsdb-types.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovsdb-types.h 2015-06-23 18:46:21.000000000 +0000 @@ -105,7 +105,7 @@ struct ovsdb_error *ovsdb_base_type_from_json(struct ovsdb_base_type *, const struct json *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_base_type_to_json(const struct ovsdb_base_type *); static inline bool ovsdb_base_type_is_ref(const struct ovsdb_base_type *); @@ -152,6 +152,8 @@ static inline bool ovsdb_type_is_scalar(const struct ovsdb_type *); static inline bool ovsdb_type_is_optional(const struct ovsdb_type *); +static inline bool ovsdb_type_is_optional_scalar( + const struct ovsdb_type *); static inline bool ovsdb_type_is_composite(const struct ovsdb_type *); static inline bool ovsdb_type_is_set(const struct ovsdb_type *); static inline bool ovsdb_type_is_map(const struct ovsdb_type *); @@ -160,7 +162,7 @@ struct ovsdb_error *ovsdb_type_from_json(struct ovsdb_type *, const struct json *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_type_to_json(const struct ovsdb_type *); /* Inline function implementations. */ @@ -202,6 +204,13 @@ return type->n_min == 0; } +static inline bool ovsdb_type_is_optional_scalar( + const struct ovsdb_type *type) +{ + return (type->value.type == OVSDB_TYPE_VOID + && type->n_min == 0 && type->n_max == 1); +} + static inline bool ovsdb_type_is_composite(const struct ovsdb_type *type) { return type->n_max > 1; diff -Nru openvswitch-2.3.1/lib/ovs-lldp.c openvswitch-2.4.0~git20150623/lib/ovs-lldp.c --- openvswitch-2.3.1/lib/ovs-lldp.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-lldp.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,961 @@ +/* + * Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2014 WindRiver, Inc. + * Copyright (c) 2015 Avaya, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Implementation of Auto Attach. + * Based on sample implementation in 802.1ab. Above copyright and license + * applies to all modifications. + * Limitations: + * - No support for multiple bridge. + * - Auto Attach state machine not implemented. + * - Auto Attach and LLDP code are bundled together. The plan is to decoupled + * them. + */ + +#include +#include "ovs-lldp.h" +#include +#include +#include +#include +#include +#include +#include "dynamic-string.h" +#include "flow.h" +#include "list.h" +#include "lldp/lldpd.h" +#include "lldp/lldpd-structs.h" +#include "netdev.h" +#include "openvswitch/types.h" +#include "packets.h" +#include "poll-loop.h" +#include "smap.h" +#include "unixctl.h" +#include "util.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(ovs_lldp); + +#define LLDP_PROTOCOL_ID 0x0000 +#define LLDP_PROTOCOL_VERSION 0x00 +#define LLDP_TYPE_CONFIG 0x00 +#define LLDP_CHASSIS_TTL 120 +#define ETH_TYPE_LLDP 0x88cc +#define MINIMUM_ETH_PACKET_SIZE 68 + +#define AA_STATUS_MULTIPLE \ + AA_STATUS(ACTIVE,2,Active) \ + AA_STATUS(REJECT_GENERIC,3,Reject (Generic)) \ + AA_STATUS(REJECT_AA_RES_NOTAVAIL,4,Reject (AA resources unavailable)) \ + AA_STATUS(REJECT_INVALID,6,Reject (Invalid)) \ + AA_STATUS(REJECT_VLAN_RES_UNAVAIL,8,Reject (VLAN resources unavailable)) \ + AA_STATUS(REJECT_VLAN_APP_ISSUE,9,Reject (Application interaction issue)) \ + AA_STATUS(PENDING,255,Pending) + +enum aa_status { +#define AA_STATUS(NAME, VALUE, STR) AA_STATUS_##NAME = VALUE, + AA_STATUS_MULTIPLE +#undef AA_STATUS + AA_STATUS_N_MULTIPLE +}; + +/* Internal structure for an Auto Attach mapping. + */ +struct aa_mapping_internal { + struct hmap_node hmap_node_isid; + struct hmap_node hmap_node_aux; + uint32_t isid; + uint16_t vlan; + void *aux; + enum aa_status status; +}; + +static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; + +/* Hash map of all LLDP instances keyed by name (port at the moment). + */ +static struct hmap all_lldps__ = HMAP_INITIALIZER(&all_lldps__); +static struct hmap *const all_lldps OVS_GUARDED_BY(mutex) = &all_lldps__; + +/* Hash map of all the Auto Attach mappings. Global at the moment (but will + * be per bridge). Used when adding a new port to a bridge so that we can + * properly install all the configured mapping on the port and export them + * To the Auto Attach server via LLDP. + */ +static struct hmap all_mappings__ = HMAP_INITIALIZER(&all_mappings__); +static struct hmap *const all_mappings OVS_GUARDED_BY(mutex) = &all_mappings__; + +static struct lldp_aa_element_system_id system_id_null; + +/* Convert an LLDP chassis ID to a string. + */ +static void +chassisid_to_string(uint8_t *array, size_t len, char **str) +{ + unsigned int i; + + *str = xmalloc(len * 3); + + for (i = 0; i < len; i++) { + snprintf(&(*str)[i * 3], 4, "%02x:", array[i]); + } + (*str)[(i * 3) - 1] = '\0'; +} + +/* Find an Auto Attach mapping keyed by I-SID. + */ +static struct aa_mapping_internal * +mapping_find_by_isid(struct lldp *lldp, uint32_t isid) + OVS_REQUIRES(mutex) +{ + struct aa_mapping_internal *m; + + HMAP_FOR_EACH_IN_BUCKET (m, hmap_node_isid, hash_int(isid, 0), + &lldp->mappings_by_isid) { + if (isid == m->isid) { + return m; + } + } + + return NULL; +} + +/* Find an Auto Attach mapping keyed by aux. aux is an opaque pointer created + * by the bridge that refers to an OVSDB mapping record. + */ +static struct aa_mapping_internal * +mapping_find_by_aux(struct lldp *lldp, const void *aux) OVS_REQUIRES(mutex) +{ + struct aa_mapping_internal *m; + + HMAP_FOR_EACH_IN_BUCKET (m, hmap_node_aux, hash_pointer(aux, 0), + &lldp->mappings_by_aux) { + if (aux == m->aux) { + return m; + } + } + + return NULL; +} + +/* Convert an Auto Attach request status to a string. + */ +static char * +aa_status_to_str(uint8_t status) +{ + switch (status) { +#define AA_STATUS(NAME, VALUE, STR) case AA_STATUS_##NAME: return #STR; + AA_STATUS_MULTIPLE +#undef AA_STATUS + default: return "Undefined"; + } +} + +/* Display LLDP and Auto Attach statistics. + */ +static void +aa_print_lldp_and_aa_stats(struct ds *ds, struct lldp *lldp) + OVS_REQUIRES(mutex) +{ + struct lldpd_hardware *hw; + + ds_put_format(ds, "Statistics: %s\n", lldp->name); + + if (!lldp->lldpd) { + return; + } + + LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) { + ds_put_format(ds, "\ttx cnt: %"PRIu64"\n", hw->h_tx_cnt); + ds_put_format(ds, "\trx cnt: %"PRIu64"\n", hw->h_rx_cnt); + ds_put_format(ds, "\trx discarded cnt: %"PRIu64"\n", + hw->h_rx_discarded_cnt); + ds_put_format(ds, "\trx unrecognized cnt: %"PRIu64"\n", + hw->h_rx_unrecognized_cnt); + ds_put_format(ds, "\tageout cnt: %"PRIu64"\n", hw->h_ageout_cnt); + ds_put_format(ds, "\tinsert cnt: %"PRIu64"\n", hw->h_insert_cnt); + ds_put_format(ds, "\tdelete cnt: %"PRIu64"\n", hw->h_delete_cnt); + ds_put_format(ds, "\tdrop cnt: %"PRIu64"\n", hw->h_drop_cnt); + } +} + +static void +aa_print_element_status_port(struct ds *ds, struct lldpd_hardware *hw) +{ + struct lldpd_port *port; + + LIST_FOR_EACH (port, p_entries, &hw->h_rports) { + if (memcmp(&port->p_element.system_id, + &system_id_null, + sizeof port->p_element.system_id)) { + const char *none_str = ""; + const char *descr = NULL; + char *id = NULL; + char *system; + + if (port->p_chassis) { + if (port->p_chassis->c_id_len > 0) { + chassisid_to_string(port->p_chassis->c_id, + port->p_chassis->c_id_len, &id); + } + + descr = port->p_chassis->c_descr; + } + + chassisid_to_string((uint8_t *) &port->p_element.system_id, + sizeof port->p_element.system_id, &system); + + ds_put_format(ds, "\tAuto Attach Primary Server Id: %s\n", + id ? id : none_str); + ds_put_format(ds, "\tAuto Attach Primary Server Descr: %s\n", + descr ? descr : none_str); + ds_put_format(ds, "\tAuto Attach Primary Server System Id: %s\n", + system); + + free(id); + free(system); + } + } +} + +/* Auto Attach server broadcast an LLDP message periodically. Display + * the discovered server. + */ +static void +aa_print_element_status(struct ds *ds, struct lldp *lldp) OVS_REQUIRES(mutex) +{ + struct lldpd_hardware *hw; + + ds_put_format(ds, "LLDP: %s\n", lldp->name); + + if (!lldp->lldpd) { + return; + } + + LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) { + aa_print_element_status_port(ds, hw); + } +} + +static void +aa_print_isid_status_port_isid(struct lldp *lldp, struct lldpd_port *port) + OVS_REQUIRES(mutex) +{ + struct lldpd_aa_isid_vlan_maps_tlv *mapping; + + if (list_is_empty(&port->p_isid_vlan_maps)) { + return; + } + + LIST_FOR_EACH (mapping, m_entries, &port->p_isid_vlan_maps) { + uint32_t isid = mapping->isid_vlan_data.isid; + struct aa_mapping_internal *m = mapping_find_by_isid(lldp, isid); + + VLOG_INFO("h_rport: isid=%u, vlan=%u, status=%d", + isid, + mapping->isid_vlan_data.vlan, + mapping->isid_vlan_data.status); + + /* Update the status of our internal state for the mapping. */ + if (m) { + VLOG_INFO("Setting status for ISID=%"PRIu32" to %"PRIu16, + isid, mapping->isid_vlan_data.status); + m->status = mapping->isid_vlan_data.status; + } else { + VLOG_WARN("Couldn't find mapping for I-SID=%"PRIu32, isid); + } + } +} + +static void +aa_print_isid_status_port(struct lldp *lldp, struct lldpd_hardware *hw) + OVS_REQUIRES(mutex) +{ + struct lldpd_port *port; + + LIST_FOR_EACH (port, p_entries, &hw->h_rports) { + aa_print_isid_status_port_isid(lldp, port); + } +} + +/* The Auto Attach server will broadcast the status of the configured mappings + * via LLDP. Display the status. + */ +static void +aa_print_isid_status(struct ds *ds, struct lldp *lldp) OVS_REQUIRES(mutex) +{ + struct lldpd_hardware *hw; + struct aa_mapping_internal *m; + + if (!lldp->lldpd) { + return; + } + + ds_put_format(ds, "LLDP: %s\n", lldp->name); + + LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) { + aa_print_isid_status_port(lldp, hw); + } + + ds_put_format(ds, "%-8s %-4s %-11s %-8s\n", + "I-SID", + "VLAN", + "Source", + "Status"); + ds_put_format(ds, "-------- ---- ----------- --------\n"); + + HMAP_FOR_EACH (m, hmap_node_isid, &lldp->mappings_by_isid) { + ds_put_format(ds, "%-8"PRIu32" %-4"PRIu16" %-11s %-11s\n", + m->isid, m->vlan, "Switch", aa_status_to_str(m->status)); + } +} + +static void +aa_unixctl_status(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) + OVS_EXCLUDED(mutex) +{ + struct lldp *lldp; + struct ds ds = DS_EMPTY_INITIALIZER; + + ovs_mutex_lock(&mutex); + + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + aa_print_element_status(&ds, lldp); + } + unixctl_command_reply(conn, ds_cstr(&ds)); + ds_destroy(&ds); + + ovs_mutex_unlock(&mutex); +} + +static void +aa_unixctl_show_isid(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) + OVS_EXCLUDED(mutex) +{ + struct lldp *lldp; + struct ds ds = DS_EMPTY_INITIALIZER; + + ovs_mutex_lock(&mutex); + + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + aa_print_isid_status(&ds, lldp); + } + unixctl_command_reply(conn, ds_cstr(&ds)); + ds_destroy(&ds); + + ovs_mutex_unlock(&mutex); +} + +static void +aa_unixctl_statistics(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) + OVS_EXCLUDED(mutex) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + struct lldp *lldp; + + ovs_mutex_lock(&mutex); + + /* Cycle through all ports and dump the stats for each one */ + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + aa_print_lldp_and_aa_stats(&ds, lldp); + } + + ovs_mutex_unlock(&mutex); + + unixctl_command_reply(conn, ds_cstr(&ds)); +} + +/* An Auto Attach mapping was configured. Populate the corresponding + * structures in the LLDP hardware. + */ +static void +update_mapping_on_lldp(struct lldp *lldp, struct lldpd_hardware *hardware, + struct aa_mapping_internal *m) +{ + struct lldpd_aa_isid_vlan_maps_tlv *lm = xzalloc(sizeof *lm); + + VLOG_INFO("\t\t hardware->h_ifname=%s", hardware->h_ifname); + + lm->isid_vlan_data.isid = m->isid; + lm->isid_vlan_data.vlan = m->vlan; + + list_push_back(&hardware->h_lport.p_isid_vlan_maps, &lm->m_entries); + + /* TODO Should be done in the Auto Attach state machine when a mapping goes + * from "pending" to "active". + */ + struct bridge_aa_vlan *node = xmalloc(sizeof *node); + + node->port_name = xstrdup(hardware->h_ifname); + node->vlan = m->vlan; + node->oper = BRIDGE_AA_VLAN_OPER_ADD; + + list_push_back(&lldp->active_mapping_queue, &node->list_node); +} + +/* Bridge will poll the list of VLAN that needs to be auto configure based on + * the Auto Attach mappings that have been exchanged with the server. + */ +int +aa_get_vlan_queued(struct ovs_list *list) +{ + struct lldp *lldp; + + ovs_mutex_lock(&mutex); + + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + struct bridge_aa_vlan *node; + + LIST_FOR_EACH_POP (node, list_node, &lldp->active_mapping_queue) { + struct bridge_aa_vlan *copy; + + copy = xmalloc(sizeof *copy); + copy->port_name = xstrdup(node->port_name); + copy->vlan = node->vlan; + copy->oper = node->oper; + + list_push_back(list, ©->list_node); + + /* Cleanup */ + free(node->port_name); + free(node); + } + } + + ovs_mutex_unlock(&mutex); + + return 0; +} + +/* Bridge will poll whether or not VLAN have been auto-configured. + */ +unsigned int +aa_get_vlan_queue_size(void) +{ + struct lldp *lldp; + unsigned int size = 0; + + ovs_mutex_lock(&mutex); + + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + size += list_size(&lldp->active_mapping_queue); + } + + ovs_mutex_unlock(&mutex); + + return size; +} + +/* Configure Auto Attach. + */ +int +aa_configure(const struct aa_settings *s) +{ + struct lldp *lldp; + + ovs_mutex_lock(&mutex); + + /* TODO Change all instances for now */ + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + struct lldpd_chassis *chassis; + + LIST_FOR_EACH (chassis, list, &lldp->lldpd->g_chassis) { + /* System Description */ + free(chassis->c_descr); + chassis->c_descr = s && s->system_description[0] ? + xstrdup(s->system_description) : xstrdup(PACKAGE_STRING); + + /* System Name */ + if (s) { + free(chassis->c_name); + chassis->c_name = xstrdup(s->system_name); + } + } + } + + ovs_mutex_unlock(&mutex); + + return 0; +} + +/* Add a new Auto Attach mapping. + */ +int +aa_mapping_register(void *aux, const struct aa_mapping_settings *s) +{ + struct aa_mapping_internal *bridge_m; + struct lldp *lldp; + + VLOG_INFO("Adding mapping ISID=%"PRIu32", VLAN=%"PRIu16", aux=%p", + s->isid, s->vlan, aux); + + ovs_mutex_lock(&mutex); + + /* TODO These mappings should be stores per bridge. This is used + * When a port is added. Auto Attach mappings need to be added on this + * port. + */ + bridge_m = xzalloc(sizeof *bridge_m); + bridge_m->isid = s->isid; + bridge_m->vlan = s->vlan; + bridge_m->aux = aux; + bridge_m->status = AA_STATUS_PENDING; + hmap_insert(all_mappings, &bridge_m->hmap_node_isid, + hash_int(bridge_m->isid, 0)); + + + /* Update mapping on the all the LLDP instances. */ + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + struct lldpd_hardware *hw; + struct aa_mapping_internal *m; + + VLOG_INFO("\t lldp->name=%s", lldp->name); + + if (mapping_find_by_isid(lldp, s->isid)) { + continue; + } + + m = xzalloc(sizeof *m); + m->isid = s->isid; + m->vlan = s->vlan; + m->status = AA_STATUS_PENDING; + m->aux = aux; + hmap_insert(&lldp->mappings_by_isid, &m->hmap_node_isid, + hash_int(m->isid, 0)); + hmap_insert(&lldp->mappings_by_aux, + &m->hmap_node_aux, + hash_pointer(m->aux, 0)); + + /* Configure the mapping on each port of the LLDP stack. */ + LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) { + update_mapping_on_lldp(lldp, hw, m); + } + } + + ovs_mutex_unlock(&mutex); + + return 0; +} + +static void +aa_mapping_unregister_mapping(struct lldp *lldp, + struct lldpd_hardware *hw, + struct aa_mapping_internal *m) +{ + struct lldpd_aa_isid_vlan_maps_tlv *lm, *lm_next; + + LIST_FOR_EACH_SAFE (lm, lm_next, m_entries, + &hw->h_lport.p_isid_vlan_maps) { + uint32_t isid = lm->isid_vlan_data.isid; + + if (isid == m->isid) { + VLOG_INFO("\t\t Removing lport, isid=%u, vlan=%u", + isid, + lm->isid_vlan_data.vlan); + + list_remove(&lm->m_entries); + + /* TODO Should be done in the AA SM when a mapping goes + * from "pending" to "active". + */ + struct bridge_aa_vlan *node = xmalloc(sizeof *node); + + node->port_name = xstrdup(hw->h_ifname); + node->vlan = m->vlan; + node->oper = BRIDGE_AA_VLAN_OPER_REMOVE; + + list_push_back(&lldp->active_mapping_queue, &node->list_node); + + break; + } + } +} + +/* Remove an existing Auto Attach mapping. + */ +int +aa_mapping_unregister(void *aux) +{ + struct lldp *lldp; + + VLOG_INFO("Removing mapping aux=%p", aux); + + ovs_mutex_lock(&mutex); + + HMAP_FOR_EACH (lldp, hmap_node, all_lldps) { + struct lldpd_hardware *hw; + struct aa_mapping_internal *m = mapping_find_by_aux(lldp, aux); + + /* Remove from internal hash tables. */ + if (m) { + uint32_t isid = m->isid; + uint16_t vlan = m->vlan; + struct aa_mapping_internal *p = mapping_find_by_isid(lldp, isid); + + VLOG_INFO("\t Removing mapping ISID=%"PRIu32", VLAN=%"PRIu16 + " (lldp->name=%s)", isid, vlan, lldp->name); + + if (p) { + hmap_remove(&lldp->mappings_by_isid, &p->hmap_node_isid); + } + + hmap_remove(&lldp->mappings_by_aux, &m->hmap_node_aux); + + /* Remove from all the lldp instances */ + LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) { + VLOG_INFO("\t\t hardware->h_ifname=%s", hw->h_ifname); + aa_mapping_unregister_mapping(lldp, hw, m); + } + free(m); + + /* Remove from the all_mappings */ + HMAP_FOR_EACH (m, hmap_node_isid, all_mappings) { + if (m && isid == m->isid && vlan == m->vlan) { + hmap_remove(all_mappings, &m->hmap_node_isid); + break; + } + } + } + } + + ovs_mutex_unlock(&mutex); + + return 0; +} + +void +lldp_init(void) +{ + unixctl_command_register("autoattach/status", "[bridge]", 0, 1, + aa_unixctl_status, NULL); + unixctl_command_register("autoattach/show-isid", "[bridge]", 0, 1, + aa_unixctl_show_isid, NULL); + unixctl_command_register("autoattach/statistics", "[bridge]", 0, 1, + aa_unixctl_statistics, NULL); +} + +/* Returns true if 'lldp' should process packets from 'flow'. Sets + * fields in 'wc' that were used to make the determination. + */ +bool +lldp_should_process_flow(struct lldp *lldp, const struct flow *flow) +{ + return (flow->dl_type == htons(ETH_TYPE_LLDP) && lldp->enabled); +} + + +/* Process an LLDP packet that was received on a bridge port. + */ +void +lldp_process_packet(struct lldp *lldp, const struct dp_packet *p) +{ + if (lldp) { + lldpd_recv(lldp->lldpd, lldpd_first_hardware(lldp->lldpd), + (char *) dp_packet_data(p), dp_packet_size(p)); + } +} + +/* This code is called periodically to check if the LLDP module has an LLDP + * message it wishes to send. It is called several times every second. + */ +bool +lldp_should_send_packet(struct lldp *cfg) OVS_EXCLUDED(mutex) +{ + bool ret; + + ovs_mutex_lock(&mutex); + ret = timer_expired(&cfg->tx_timer); + ovs_mutex_unlock(&mutex); + + /* LLDP must be enabled */ + ret &= cfg->enabled; + + return ret; +} + +/* Returns the next wake up time. + */ +long long int +lldp_wake_time(const struct lldp *lldp) OVS_EXCLUDED(mutex) +{ + long long int retval; + + if (!lldp || !lldp->enabled) { + return LLONG_MAX; + } + + ovs_mutex_lock(&mutex); + retval = lldp->tx_timer.t; + ovs_mutex_unlock(&mutex); + + return retval; +} + +/* Put the monitor thread to sleep until it's next wake time. + */ +long long int +lldp_wait(struct lldp *lldp) OVS_EXCLUDED(mutex) +{ + long long int wake_time = lldp_wake_time(lldp); + poll_timer_wait_until(wake_time); + return wake_time; +} + +/* Prepare the LLDP packet to be sent on a bridge port. + */ +void +lldp_put_packet(struct lldp *lldp, struct dp_packet *packet, + uint8_t eth_src[ETH_ADDR_LEN]) OVS_EXCLUDED(mutex) +{ + struct lldpd *mylldpd = lldp->lldpd; + struct lldpd_hardware *hw = lldpd_first_hardware(mylldpd); + static const uint8_t eth_addr_lldp[6] = + {0x01, 0x80, 0xC2, 0x00, 0x00, 0x0e}; + + ovs_mutex_lock(&mutex); + + eth_compose(packet, eth_addr_lldp, eth_src, ETH_TYPE_LLDP, 0); + + lldpd_send(hw, packet); + + timer_set_duration(&lldp->tx_timer, lldp->lldpd->g_config.c_tx_interval); + ovs_mutex_unlock(&mutex); +} + +/* Configures the LLDP stack. + */ +bool +lldp_configure(struct lldp *lldp, const struct smap *cfg) OVS_EXCLUDED(mutex) +{ + if (lldp) { + if (cfg && smap_get_bool(cfg, "enable", false)) { + lldp->enabled = true; + } else { + lldp->enabled = false; + } + + ovs_mutex_lock(&mutex); + timer_set_expired(&lldp->tx_timer); + timer_set_duration(&lldp->tx_timer, LLDP_DEFAULT_TRANSMIT_INTERVAL_MS); + lldp->lldpd->g_config.c_tx_interval = + LLDP_DEFAULT_TRANSMIT_INTERVAL_MS; + ovs_mutex_unlock(&mutex); + } + + return true; +} + +/* Create an LLDP stack instance. At the moment there is one per bridge port. + */ +struct lldp * +lldp_create(const struct netdev *netdev, + const uint32_t mtu, + const struct smap *cfg) OVS_EXCLUDED(mutex) +{ + struct lldp *lldp; + struct lldpd_chassis *lchassis; + struct lldpd_hardware *hw; + struct aa_mapping_internal *m; + + if (!cfg || !smap_get_bool(cfg, "enable", false)) { + return NULL; + } + + lldp = xzalloc(sizeof *lldp); + lldp->name = xstrdup(netdev_get_name(netdev)); + lldp->lldpd = xzalloc(sizeof *lldp->lldpd); + + hmap_init(&lldp->mappings_by_isid); + hmap_init(&lldp->mappings_by_aux); + list_init(&lldp->active_mapping_queue); + + lchassis = xzalloc(sizeof *lchassis); + lchassis->c_cap_available = LLDP_CAP_BRIDGE; + lchassis->c_cap_enabled = LLDP_CAP_BRIDGE; + lchassis->c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR; + lchassis->c_id_len = ETH_ADDR_LEN; + lchassis->c_id = xmalloc(ETH_ADDR_LEN); + netdev_get_etheraddr(netdev, lchassis->c_id); + + list_init(&lchassis->c_mgmt); + lchassis->c_ttl = lldp->lldpd->g_config.c_tx_interval * + lldp->lldpd->g_config.c_tx_hold; + lchassis->c_ttl = LLDP_CHASSIS_TTL; + lldpd_assign_cfg_to_protocols(lldp->lldpd); + list_init(&lldp->lldpd->g_chassis); + list_push_back(&lldp->lldpd->g_chassis, &lchassis->list); + + if ((hw = lldpd_alloc_hardware(lldp->lldpd, + (char *) netdev_get_name(netdev), + 0)) == NULL) { + VLOG_WARN("Unable to allocate space for %s", + (char *) netdev_get_name(netdev)); + out_of_memory(); + } + + ovs_refcount_init(&lldp->ref_cnt); +#ifndef _WIN32 + hw->h_flags |= IFF_RUNNING; +#endif + hw->h_mtu = mtu; + hw->h_lport.p_id_subtype = LLDP_PORTID_SUBTYPE_IFNAME; + hw->h_lport.p_id = xstrdup(netdev_get_name(netdev)); + + /* p_id is not necessarily a null terminated string. */ + hw->h_lport.p_id_len = strlen(netdev_get_name(netdev)); + + /* Auto Attach element tlv */ + hw->h_lport.p_element.type = LLDP_TLV_AA_ELEM_TYPE_CLIENT_VIRTUAL_SWITCH; + hw->h_lport.p_element.mgmt_vlan = 0; + memcpy(&hw->h_lport.p_element.system_id.system_mac, + lchassis->c_id, lchassis->c_id_len); + hw->h_lport.p_element.system_id.conn_type = + LLDP_TLV_AA_ELEM_CONN_TYPE_SINGLE; + hw->h_lport.p_element.system_id.rsvd = 0; + hw->h_lport.p_element.system_id.rsvd2[0] = 0; + hw->h_lport.p_element.system_id.rsvd2[1] = 0; + + list_init(&hw->h_lport.p_isid_vlan_maps); + list_init(&lldp->lldpd->g_hardware); + list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries); + + ovs_mutex_lock(&mutex); + + /* Update port with Auto Attach mappings configured. */ + HMAP_FOR_EACH (m, hmap_node_isid, all_mappings) { + struct aa_mapping_internal *p; + + if (mapping_find_by_isid(lldp, m->isid)) { + continue; + } + + p = xmemdup(m, sizeof *p); + hmap_insert(&lldp->mappings_by_isid, &p->hmap_node_isid, + hash_int(p->isid, 0)); + hmap_insert(&lldp->mappings_by_aux, + &p->hmap_node_aux, + hash_pointer(p->aux, 0)); + + update_mapping_on_lldp(lldp, hw, p); + } + + hmap_insert(all_lldps, &lldp->hmap_node, + hash_string(netdev_get_name(netdev), 0)); + + ovs_mutex_unlock(&mutex); + + return lldp; +} + + +struct lldp * +lldp_create_dummy(void) +{ + struct lldp *lldp; + struct lldpd_chassis *lchassis; + struct lldpd_hardware *hw; + + lldp = xzalloc(sizeof *lldp); + lldp->name = "dummy-lldp"; + lldp->lldpd = xzalloc(sizeof *lldp->lldpd); + + hmap_init(&lldp->mappings_by_isid); + hmap_init(&lldp->mappings_by_aux); + list_init(&lldp->active_mapping_queue); + + lchassis = xzalloc(sizeof *lchassis); + lchassis->c_cap_available = LLDP_CAP_BRIDGE; + lchassis->c_cap_enabled = LLDP_CAP_BRIDGE; + lchassis->c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR; + lchassis->c_id_len = ETH_ADDR_LEN; + lchassis->c_id = xmalloc(ETH_ADDR_LEN); + + list_init(&lchassis->c_mgmt); + lchassis->c_ttl = LLDP_CHASSIS_TTL; + lldpd_assign_cfg_to_protocols(lldp->lldpd); + list_init(&lldp->lldpd->g_chassis); + list_push_back(&lldp->lldpd->g_chassis, &lchassis->list); + + hw = lldpd_alloc_hardware(lldp->lldpd, "dummy-hw", 0); + + ovs_refcount_init(&lldp->ref_cnt); +#ifndef _WIN32 + hw->h_flags |= IFF_RUNNING; +#endif + hw->h_mtu = 1500; + hw->h_lport.p_id_subtype = LLDP_PORTID_SUBTYPE_IFNAME; + hw->h_lport.p_id = "dummy-port"; + + /* p_id is not necessarily a null terminated string. */ + hw->h_lport.p_id_len = strlen(hw->h_lport.p_id); + + /* Auto Attach element tlv */ + hw->h_lport.p_element.type = LLDP_TLV_AA_ELEM_TYPE_CLIENT_VIRTUAL_SWITCH; + hw->h_lport.p_element.mgmt_vlan = 0; + memcpy(&hw->h_lport.p_element.system_id.system_mac, + lchassis->c_id, lchassis->c_id_len); + hw->h_lport.p_element.system_id.conn_type = + LLDP_TLV_AA_ELEM_CONN_TYPE_SINGLE; + hw->h_lport.p_element.system_id.rsvd = 0; + hw->h_lport.p_element.system_id.rsvd2[0] = 0; + hw->h_lport.p_element.system_id.rsvd2[1] = 0; + + list_init(&hw->h_lport.p_isid_vlan_maps); + list_init(&lldp->lldpd->g_hardware); + list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries); + + return lldp; +} + +/* Unreference a specific LLDP instance. + */ +void +lldp_unref(struct lldp *lldp) +{ + if (!lldp) { + return; + } + + ovs_mutex_lock(&mutex); + if (ovs_refcount_unref_relaxed(&lldp->ref_cnt) != 1) { + ovs_mutex_unlock(&mutex); + return; + } + + hmap_remove(all_lldps, &lldp->hmap_node); + ovs_mutex_unlock(&mutex); + + lldpd_cleanup(lldp->lldpd); + free(lldp->lldpd); + free(lldp->name); + free(lldp); +} + +/* Unreference a specific LLDP instance. + */ +struct lldp * +lldp_ref(const struct lldp *lldp_) +{ + struct lldp *lldp = CONST_CAST(struct lldp *, lldp_); + if (lldp) { + ovs_refcount_ref(&lldp->ref_cnt); + } + return lldp; +} diff -Nru openvswitch-2.3.1/lib/ovs-lldp.h openvswitch-2.4.0~git20150623/lib/ovs-lldp.h --- openvswitch-2.3.1/lib/ovs-lldp.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-lldp.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2015 Nicira, Inc. + * Copyright (c) 2014 Wind River Systems, Inc. + * Copyright (c) 2015 Avaya, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OVS_LLDP_H +#define OVS_LLDP_H + +#include +#include "dp-packet.h" +#include "hmap.h" +#include "list.h" +#include "lldp/lldpd.h" +#include "ovs-atomic.h" +#include "packets.h" +#include "timer.h" + +/* Transmit every LLDPD_TX_INTERVAL seconds. */ +#define LLDP_DEFAULT_TRANSMIT_INTERVAL_MS (LLDPD_TX_INTERVAL * 1000) + +struct flow; +struct netdev; +struct smap; + +/* Structure per LLDP instance (at the moment per port when enabled). + */ +struct lldp { + struct hmap_node hmap_node; /* Node in all_lldps list. */ + struct lldpd *lldpd; + char *name; /* Name of the port. */ + struct timer tx_timer; /* Send LLDP when expired. */ + struct hmap mappings_by_isid; /* "struct" indexed by ISID */ + struct hmap mappings_by_aux; /* "struct" indexed by aux */ + struct ovs_list active_mapping_queue; + struct ovs_refcount ref_cnt; + bool enabled; /* LLDP enabled on port */ +}; + +/* Configuration specific to Auto Attach. + */ +struct aa_settings { + char *system_description; + char *system_name; +}; + +/* Configuration of Auto Attach mappings. + */ +struct aa_mapping_settings { + uint32_t isid; + uint16_t vlan; +}; + +enum bridge_aa_vlan_oper { + BRIDGE_AA_VLAN_OPER_UNDEF, + BRIDGE_AA_VLAN_OPER_ADD, + BRIDGE_AA_VLAN_OPER_REMOVE +}; + +/* Bridge Auto Attach operations. Mostly for adding/removing VLAN on + * the trunk port connected to the Auto Attach server. + */ +struct bridge_aa_vlan { + struct ovs_list list_node; + char *port_name; + uint16_t vlan; + enum bridge_aa_vlan_oper oper; +}; + +void lldp_init(void); +long long int lldp_wait(struct lldp *lldp); +long long int lldp_wake_time(const struct lldp *lldp); +void lldp_run(struct lldpd *cfg); +bool lldp_should_send_packet(struct lldp *cfg); +bool lldp_should_process_flow(struct lldp *lldp, const struct flow *flow); +bool lldp_configure(struct lldp *lldp, const struct smap *cfg); +void lldp_process_packet(struct lldp *cfg, const struct dp_packet *); +void lldp_put_packet(struct lldp *lldp, struct dp_packet *packet, + uint8_t eth_src[ETH_ADDR_LEN]); +void lldpd_assign_cfg_to_protocols(struct lldpd *cfg); +struct lldp * lldp_create(const struct netdev *netdev, const uint32_t mtu, + const struct smap *cfg); +struct lldp * lldp_ref(const struct lldp *lldp_); +void lldp_unref(struct lldp *lldp); + +int aa_get_vlan_queued(struct ovs_list *list); +unsigned int aa_get_vlan_queue_size(void); +int aa_configure(const struct aa_settings *s); +int aa_mapping_register(void *aux, const struct aa_mapping_settings *s); +int aa_mapping_unregister(void *aux); + +/* Used by unit tests */ +struct lldp * lldp_create_dummy(void); + +#endif /* OVS_LLDP_H */ diff -Nru openvswitch-2.3.1/lib/ovs-numa.c openvswitch-2.4.0~git20150623/lib/ovs-numa.c --- openvswitch-2.3.1/lib/ovs-numa.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-numa.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,454 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* On non-Linux, these functions are defined inline in ovs-numa.h. */ +#ifdef __linux__ + +#include +#include "ovs-numa.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "hash.h" +#include "hmap.h" +#include "list.h" +#include "ovs-thread.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(ovs_numa); + +/* ovs-numa module + * =============== + * + * This module stores the affinity information of numa nodes and cpu cores. + * It also provides functions to bookkeep the pin of threads on cpu cores. + * + * It is assumed that the numa node ids and cpu core ids all start from 0 and + * range continuously. So, for example, if 'ovs_numa_get_n_cores()' returns N, + * user can assume core ids from 0 to N-1 are all valid and there is a + * 'struct cpu_core' for each id. + * + * NOTE, this module should only be used by the main thread. + * + * NOTE, the assumption above will fail when cpu hotplug is used. In that + * case ovs-numa will not function correctly. For now, add a TODO entry + * for addressing it in the future. + * + * TODO: Fix ovs-numa when cpu hotplug is used. + */ + +#define MAX_NUMA_NODES 128 + +/* numa node. */ +struct numa_node { + struct hmap_node hmap_node; /* In the 'all_numa_nodes'. */ + struct ovs_list cores; /* List of cpu cores on the numa node. */ + int numa_id; /* numa node id. */ +}; + +/* Cpu core on a numa node. */ +struct cpu_core { + struct hmap_node hmap_node;/* In the 'all_cpu_cores'. */ + struct ovs_list list_node; /* In 'numa_node->cores' list. */ + struct numa_node *numa; /* numa node containing the core. */ + unsigned core_id; /* Core id. */ + bool available; /* If the core can be pinned. */ + bool pinned; /* If a thread has been pinned to the core. */ +}; + +/* Contains all 'struct numa_node's. */ +static struct hmap all_numa_nodes = HMAP_INITIALIZER(&all_numa_nodes); +/* Contains all 'struct cpu_core's. */ +static struct hmap all_cpu_cores = HMAP_INITIALIZER(&all_cpu_cores); +/* True if numa node and core info are correctly extracted. */ +static bool found_numa_and_core; + +/* Returns true if 'str' contains all digits. Returns false otherwise. */ +static bool +contain_all_digits(const char *str) +{ + return str[strspn(str, "0123456789")] == '\0'; +} + +/* Discovers all numa nodes and the corresponding cpu cores. + * Constructs the 'struct numa_node' and 'struct cpu_core'. */ +static void +discover_numa_and_core(void) +{ + int n_cpus = 0; + int i; + + for (i = 0; i < MAX_NUMA_NODES; i++) { + DIR *dir; + char* path; + + /* Constructs the path to node /sys/devices/system/nodeX. */ + path = xasprintf("/sys/devices/system/node/node%d", i); + dir = opendir(path); + + /* Creates 'struct numa_node' if the 'dir' is non-null. */ + if (dir) { + struct numa_node *n = xzalloc(sizeof *n); + struct dirent *subdir; + + hmap_insert(&all_numa_nodes, &n->hmap_node, hash_int(i, 0)); + list_init(&n->cores); + n->numa_id = i; + + while ((subdir = readdir(dir)) != NULL) { + if (!strncmp(subdir->d_name, "cpu", 3) + && contain_all_digits(subdir->d_name + 3)){ + struct cpu_core *c = xzalloc(sizeof *c); + unsigned core_id; + + core_id = strtoul(subdir->d_name + 3, NULL, 10); + hmap_insert(&all_cpu_cores, &c->hmap_node, + hash_int(core_id, 0)); + list_insert(&n->cores, &c->list_node); + c->core_id = core_id; + c->numa = n; + c->available = true; + n_cpus++; + } + } + VLOG_INFO("Discovered %"PRIuSIZE" CPU cores on NUMA node %d", + list_size(&n->cores), n->numa_id); + free(path); + closedir(dir); + } else { + if (errno != ENOENT) { + VLOG_WARN("opendir(%s) failed (%s)", path, + ovs_strerror(errno)); + } + free(path); + break; + } + } + + VLOG_INFO("Discovered %"PRIuSIZE" NUMA nodes and %d CPU cores", + hmap_count(&all_numa_nodes), n_cpus); + if (hmap_count(&all_numa_nodes) && hmap_count(&all_cpu_cores)) { + found_numa_and_core = true; + } +} + +/* Gets 'struct cpu_core' by 'core_id'. */ +static struct cpu_core* +get_core_by_core_id(unsigned core_id) +{ + struct cpu_core *core = NULL; + + if (ovs_numa_core_id_is_valid(core_id)) { + core = CONTAINER_OF(hmap_first_with_hash(&all_cpu_cores, + hash_int(core_id, 0)), + struct cpu_core, hmap_node); + } + + return core; +} + +/* Gets 'struct numa_node' by 'numa_id'. */ +static struct numa_node* +get_numa_by_numa_id(int numa_id) +{ + struct numa_node *numa = NULL; + + if (ovs_numa_numa_id_is_valid(numa_id)) { + numa = CONTAINER_OF(hmap_first_with_hash(&all_numa_nodes, + hash_int(numa_id, 0)), + struct numa_node, hmap_node); + } + + return numa; +} + + +/* Extracts the numa node and core info from the 'sysfs'. */ +void +ovs_numa_init(void) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + + if (ovsthread_once_start(&once)) { + discover_numa_and_core(); + ovsthread_once_done(&once); + } +} + +bool +ovs_numa_numa_id_is_valid(int numa_id) +{ + return found_numa_and_core && numa_id < ovs_numa_get_n_numas(); +} + +bool +ovs_numa_core_id_is_valid(unsigned core_id) +{ + return found_numa_and_core && core_id < ovs_numa_get_n_cores(); +} + +bool +ovs_numa_core_is_pinned(unsigned core_id) +{ + struct cpu_core *core = get_core_by_core_id(core_id); + + if (core) { + return core->pinned; + } + + return false; +} + +/* Returns the number of numa nodes. */ +int +ovs_numa_get_n_numas(void) +{ + return found_numa_and_core ? hmap_count(&all_numa_nodes) + : OVS_NUMA_UNSPEC; +} + +/* Returns the number of cpu cores. */ +int +ovs_numa_get_n_cores(void) +{ + return found_numa_and_core ? hmap_count(&all_cpu_cores) + : OVS_CORE_UNSPEC; +} + +/* Given 'core_id', returns the corresponding numa node id. Returns + * OVS_NUMA_UNSPEC if 'core_id' is invalid. */ +int +ovs_numa_get_numa_id(unsigned core_id) +{ + struct cpu_core *core = get_core_by_core_id(core_id); + + if (core) { + return core->numa->numa_id; + } + + return OVS_NUMA_UNSPEC; +} + +/* Returns the number of cpu cores on numa node. Returns OVS_CORE_UNSPEC + * if 'numa_id' is invalid. */ +int +ovs_numa_get_n_cores_on_numa(int numa_id) +{ + struct numa_node *numa = get_numa_by_numa_id(numa_id); + + if (numa) { + return list_size(&numa->cores); + } + + return OVS_CORE_UNSPEC; +} + +/* Returns the number of cpu cores that are available and unpinned + * on numa node. Returns OVS_CORE_UNSPEC if 'numa_id' is invalid. */ +int +ovs_numa_get_n_unpinned_cores_on_numa(int numa_id) +{ + struct numa_node *numa = get_numa_by_numa_id(numa_id); + + if (numa) { + struct cpu_core *core; + int count = 0; + + LIST_FOR_EACH(core, list_node, &numa->cores) { + if (core->available && !core->pinned) { + count++; + } + } + return count; + } + + return OVS_CORE_UNSPEC; +} + +/* Given 'core_id', tries to pin that core. Returns true, if succeeds. + * False, if the core has already been pinned, or if it is invalid or + * not available. */ +bool +ovs_numa_try_pin_core_specific(unsigned core_id) +{ + struct cpu_core *core = get_core_by_core_id(core_id); + + if (core) { + if (core->available && !core->pinned) { + core->pinned = true; + return true; + } + } + + return false; +} + +/* Searches through all cores for an unpinned and available core. Returns + * the 'core_id' if found and sets the 'core->pinned' to true. Otherwise, + * returns OVS_CORE_UNSPEC. */ +unsigned +ovs_numa_get_unpinned_core_any(void) +{ + struct cpu_core *core; + + HMAP_FOR_EACH(core, hmap_node, &all_cpu_cores) { + if (core->available && !core->pinned) { + core->pinned = true; + return core->core_id; + } + } + + return OVS_CORE_UNSPEC; +} + +/* Searches through all cores on numa node with 'numa_id' for an + * unpinned and available core. Returns the core_id if found and + * sets the 'core->pinned' to true. Otherwise, returns OVS_CORE_UNSPEC. */ +unsigned +ovs_numa_get_unpinned_core_on_numa(int numa_id) +{ + struct numa_node *numa = get_numa_by_numa_id(numa_id); + + if (numa) { + struct cpu_core *core; + + LIST_FOR_EACH(core, list_node, &numa->cores) { + if (core->available && !core->pinned) { + core->pinned = true; + return core->core_id; + } + } + } + + return OVS_CORE_UNSPEC; +} + +/* Unpins the core with 'core_id'. */ +void +ovs_numa_unpin_core(unsigned core_id) +{ + struct cpu_core *core = get_core_by_core_id(core_id); + + if (core) { + core->pinned = false; + } +} + +/* Given the 'numa_id', returns dump of all cores on the numa node. */ +struct ovs_numa_dump * +ovs_numa_dump_cores_on_numa(int numa_id) +{ + struct ovs_numa_dump *dump = NULL; + struct numa_node *numa = get_numa_by_numa_id(numa_id); + + if (numa) { + struct cpu_core *core; + + dump = xmalloc(sizeof *dump); + list_init(&dump->dump); + LIST_FOR_EACH(core, list_node, &numa->cores) { + struct ovs_numa_info *info = xmalloc(sizeof *info); + + info->numa_id = numa->numa_id; + info->core_id = core->core_id; + list_insert(&dump->dump, &info->list_node); + } + } + + return dump; +} + +void +ovs_numa_dump_destroy(struct ovs_numa_dump *dump) +{ + struct ovs_numa_info *iter; + + LIST_FOR_EACH_POP (iter, list_node, &dump->dump) { + free(iter); + } + + free(dump); +} + +/* Reads the cpu mask configuration from 'cmask' and sets the + * 'available' of corresponding cores. For unspecified cores, + * sets 'available' to false. */ +void +ovs_numa_set_cpu_mask(const char *cmask) +{ + int core_id = 0; + int i; + + if (!found_numa_and_core) { + return; + } + + /* If no mask specified, resets the 'available' to true for all cores. */ + if (!cmask) { + struct cpu_core *core; + + HMAP_FOR_EACH(core, hmap_node, &all_cpu_cores) { + core->available = true; + } + + return; + } + + for (i = strlen(cmask) - 1; i >= 0; i--) { + char hex = toupper(cmask[i]); + int bin, j; + + if (hex >= '0' && hex <= '9') { + bin = hex - '0'; + } else if (hex >= 'A' && hex <= 'F') { + bin = hex - 'A' + 10; + } else { + bin = 0; + VLOG_WARN("Invalid cpu mask: %c", cmask[i]); + } + + for (j = 0; j < 4; j++) { + struct cpu_core *core; + + core = CONTAINER_OF(hmap_first_with_hash(&all_cpu_cores, + hash_int(core_id++, 0)), + struct cpu_core, hmap_node); + core->available = (bin >> j) & 0x1; + + if (core_id >= hmap_count(&all_cpu_cores)) { + return; + } + } + } + + /* For unspecified cores, sets 'available' to false. */ + while (core_id < hmap_count(&all_cpu_cores)) { + struct cpu_core *core; + + core = CONTAINER_OF(hmap_first_with_hash(&all_cpu_cores, + hash_int(core_id++, 0)), + struct cpu_core, hmap_node); + core->available = false; + } +} + +#endif /* __linux__ */ diff -Nru openvswitch-2.3.1/lib/ovs-numa.h openvswitch-2.4.0~git20150623/lib/ovs-numa.h --- openvswitch-2.3.1/lib/ovs-numa.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-numa.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OVS_NUMA_H +#define OVS_NUMA_H 1 + +#include +#include + +#include "compiler.h" +#include "list.h" + +#define OVS_CORE_UNSPEC INT_MAX +#define OVS_NUMA_UNSPEC INT_MAX + +/* Dump of a list of 'struct ovs_numa_info'. */ +struct ovs_numa_dump { + struct ovs_list dump; +}; + +/* A numa_id - core_id pair. */ +struct ovs_numa_info { + struct ovs_list list_node; + int numa_id; + unsigned core_id; +}; + +#ifdef __linux__ + +void ovs_numa_init(void); +bool ovs_numa_numa_id_is_valid(int numa_id); +bool ovs_numa_core_id_is_valid(unsigned core_id); +bool ovs_numa_core_is_pinned(unsigned core_id); +int ovs_numa_get_n_numas(void); +void ovs_numa_set_cpu_mask(const char *cmask); +int ovs_numa_get_n_cores(void); +int ovs_numa_get_numa_id(unsigned core_id); +int ovs_numa_get_n_cores_on_numa(int numa_id); +int ovs_numa_get_n_unpinned_cores_on_numa(int numa_id); +bool ovs_numa_try_pin_core_specific(unsigned core_id); +unsigned ovs_numa_get_unpinned_core_any(void); +unsigned ovs_numa_get_unpinned_core_on_numa(int numa_id); +void ovs_numa_unpin_core(unsigned core_id); +struct ovs_numa_dump *ovs_numa_dump_cores_on_numa(int numa_id); +void ovs_numa_dump_destroy(struct ovs_numa_dump *); + +#define FOR_EACH_CORE_ON_NUMA(ITER, DUMP) \ + LIST_FOR_EACH((ITER), list_node, &(DUMP)->dump) + +#else + +static inline void +ovs_numa_init(void) +{ + /* Nothing */ +} + +static inline bool +ovs_numa_numa_id_is_valid(int numa_id OVS_UNUSED) +{ + return false; +} + +static inline bool +ovs_numa_core_id_is_valid(unsigned core_id OVS_UNUSED) +{ + return false; +} + +static inline bool +ovs_numa_core_is_pinned(unsigned core_id OVS_UNUSED) +{ + return false; +} + +static inline void +ovs_numa_set_cpu_mask(const char *cmask OVS_UNUSED) +{ + /* Nothing */ +} + +static inline int +ovs_numa_get_n_numas(void) +{ + return OVS_NUMA_UNSPEC; +} + +static inline int +ovs_numa_get_n_cores(void) +{ + return OVS_CORE_UNSPEC; +} + +static inline int +ovs_numa_get_numa_id(unsigned core_id OVS_UNUSED) +{ + return OVS_NUMA_UNSPEC; +} + +static inline int +ovs_numa_get_n_cores_on_numa(int numa_id OVS_UNUSED) +{ + return OVS_CORE_UNSPEC; +} + +static inline int +ovs_numa_get_n_unpinned_cores_on_numa(int numa_id OVS_UNUSED) +{ + return OVS_CORE_UNSPEC; +} + +static inline bool +ovs_numa_try_pin_core_specific(unsigned core_id OVS_UNUSED) +{ + return false; +} + +static inline unsigned +ovs_numa_get_unpinned_core_any(void) +{ + return OVS_CORE_UNSPEC; +} + +static inline unsigned +ovs_numa_get_unpinned_core_on_numa(int numa_id OVS_UNUSED) +{ + return OVS_CORE_UNSPEC; +} + +static inline void +ovs_numa_unpin_core(unsigned core_id OVS_UNUSED) +{ + /* Nothing */ +} + +static inline struct ovs_numa_dump * +ovs_numa_dump_cores_on_numa(int numa_id OVS_UNUSED) +{ + return NULL; +} + +static inline void +ovs_numa_dump_destroy(struct ovs_numa_dump *dump OVS_UNUSED) +{ + /* Nothing */ +} + +/* No loop. */ +#define FOR_EACH_CORE_ON_NUMA(ITER, DUMP) \ + for ((ITER) = NULL; (ITER);) + +#endif /* __linux__ */ +#endif /* ovs-thead.h */ diff -Nru openvswitch-2.3.1/lib/ovs-rcu.c openvswitch-2.4.0~git20150623/lib/ovs-rcu.c --- openvswitch-2.3.1/lib/ovs-rcu.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-rcu.c 2015-06-23 18:46:21.000000000 +0000 @@ -16,13 +16,14 @@ #include #include "ovs-rcu.h" +#include "fatal-signal.h" #include "guarded-list.h" #include "list.h" #include "ovs-thread.h" #include "poll-loop.h" #include "seq.h" #include "timeval.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovs_rcu); @@ -32,13 +33,13 @@ }; struct ovsrcu_cbset { - struct list list_node; + struct ovs_list list_node; struct ovsrcu_cb cbs[16]; int n_cbs; }; struct ovsrcu_perthread { - struct list list_node; /* In global list. */ + struct ovs_list list_node; /* In global list. */ struct ovs_mutex mutex; uint64_t seqno; @@ -49,25 +50,24 @@ static struct seq *global_seqno; static pthread_key_t perthread_key; -static struct list ovsrcu_threads; +static struct ovs_list ovsrcu_threads; static struct ovs_mutex ovsrcu_threads_mutex; static struct guarded_list flushed_cbsets; static struct seq *flushed_cbsets_seq; -static void ovsrcu_init(void); +static void ovsrcu_init_module(void); static void ovsrcu_flush_cbset(struct ovsrcu_perthread *); static void ovsrcu_unregister__(struct ovsrcu_perthread *); static bool ovsrcu_call_postponed(void); static void *ovsrcu_postpone_thread(void *arg OVS_UNUSED); -static void ovsrcu_synchronize(void); static struct ovsrcu_perthread * ovsrcu_perthread_get(void) { struct ovsrcu_perthread *perthread; - ovsrcu_init(); + ovsrcu_init_module(); perthread = pthread_getspecific(perthread_key); if (!perthread) { @@ -121,7 +121,7 @@ { struct ovsrcu_perthread *perthread; - ovsrcu_init(); + ovsrcu_init_module(); perthread = pthread_getspecific(perthread_key); if (perthread) { pthread_setspecific(perthread_key, NULL); @@ -132,12 +132,20 @@ } /* Indicates a momentary quiescent state. See "Details" near the top of - * ovs-rcu.h. */ + * ovs-rcu.h. + * + * Provides a full memory barrier via seq_change(). + */ void ovsrcu_quiesce(void) { - ovsrcu_init(); - ovsrcu_perthread_get()->seqno = seq_read(global_seqno); + struct ovsrcu_perthread *perthread; + + perthread = ovsrcu_perthread_get(); + perthread->seqno = seq_read(global_seqno); + if (perthread->cbset) { + ovsrcu_flush_cbset(perthread); + } seq_change(global_seqno); ovsrcu_quiesced(); @@ -146,11 +154,11 @@ bool ovsrcu_is_quiescent(void) { - ovsrcu_init(); + ovsrcu_init_module(); return pthread_getspecific(perthread_key) == NULL; } -static void +void ovsrcu_synchronize(void) { unsigned int warning_threshold = 1000; @@ -204,6 +212,19 @@ /* Registers 'function' to be called, passing 'aux' as argument, after the * next grace period. * + * The call is guaranteed to happen after the next time all participating + * threads have quiesced at least once, but there is no quarantee that all + * registered functions are called as early as possible, or that the functions + * registered by different threads would be called in the order the + * registrations took place. In particular, even if two threads provably + * register a function each in a specific order, the functions may still be + * called in the opposite order, depending on the timing of when the threads + * call ovsrcu_quiesce(), how many functions they postpone, and when the + * ovs-rcu thread happens to grab the functions to be called. + * + * All functions registered by a single thread are guaranteed to execute in the + * registering order, however. + * * This function is more conveniently called through the ovsrcu_postpone() * macro, which provides a type-safe way to allow 'function''s parameter to be * any pointer type. */ @@ -232,8 +253,8 @@ static bool ovsrcu_call_postponed(void) { - struct ovsrcu_cbset *cbset, *next_cbset; - struct list cbsets; + struct ovsrcu_cbset *cbset; + struct ovs_list cbsets; guarded_list_pop_all(&flushed_cbsets, &cbsets); if (list_is_empty(&cbsets)) { @@ -242,13 +263,12 @@ ovsrcu_synchronize(); - LIST_FOR_EACH_SAFE (cbset, next_cbset, list_node, &cbsets) { + LIST_FOR_EACH_POP (cbset, list_node, &cbsets) { struct ovsrcu_cb *cb; for (cb = cbset->cbs; cb < &cbset->cbs[cbset->n_cbs]; cb++) { cb->function(cb->aux); } - list_remove(&cbset->list_node); free(cbset); } @@ -307,13 +327,26 @@ ovsrcu_unregister__(perthread); } +/* Cancels the callback to ovsrcu_thread_exit_cb(). + * + * Cancelling the call to the destructor during the main thread exit + * is needed while using pthreads-win32 library in Windows. It has been + * observed that in pthreads-win32, a call to the destructor during + * main thread exit causes undefined behavior. */ +static void +ovsrcu_cancel_thread_exit_cb(void *aux OVS_UNUSED) +{ + pthread_setspecific(perthread_key, NULL); +} + static void -ovsrcu_init(void) +ovsrcu_init_module(void) { static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; if (ovsthread_once_start(&once)) { global_seqno = seq_create(); xpthread_key_create(&perthread_key, ovsrcu_thread_exit_cb); + fatal_signal_add_hook(ovsrcu_cancel_thread_exit_cb, NULL, NULL, true); list_init(&ovsrcu_threads); ovs_mutex_init(&ovsrcu_threads_mutex); diff -Nru openvswitch-2.3.1/lib/ovs-rcu.h openvswitch-2.4.0~git20150623/lib/ovs-rcu.h --- openvswitch-2.3.1/lib/ovs-rcu.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-rcu.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Nicira, Inc. + * Copyright (c) 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,15 +60,28 @@ * * When a quiescient state has occurred in every thread, we say that a "grace * period" has occurred. Following a grace period, all of the callbacks - * postponed before the start of the grace period may be invoked. OVS takes + * postponed before the start of the grace period MAY be invoked. OVS takes * care of this automatically through the RCU mechanism: while a process still * has only a single thread, it invokes the postponed callbacks directly from * ovsrcu_quiesce() and ovsrcu_quiesce_start(); after additional threads have * been created, it creates an extra helper thread to invoke callbacks. * + * Please note that while a postponed function call is guaranteed to happen + * after the next time all participating threads have quiesced at least once, + * there is no quarantee that all postponed functions are called as early as + * possible, or that the functions postponed by different threads would be + * called in the order the registrations took place. In particular, even if + * two threads provably postpone a function each in a specific order, the + * postponed functions may still be called in the opposite order, depending on + * the timing of when the threads call ovsrcu_quiesce(), how many functions + * they postpone, and when the ovs-rcu thread happens to grab the functions to + * be called. * - * Use - * --- + * All functions postponed by a single thread are guaranteed to execute in the + * order they were postponed, however. + * + * Usage + * ----- * * Use OVSRCU_TYPE(TYPE) to declare a pointer to RCU-protected data, e.g. the * following declares an RCU-protected "struct flow *" named flowp: @@ -78,27 +91,35 @@ * Use ovsrcu_get(TYPE, VAR) to read an RCU-protected pointer, e.g. to read the * pointer variable declared above: * - * struct flow *flow = ovsrcu_get(struct flow *, flowp); + * struct flow *flow = ovsrcu_get(struct flow *, &flowp); + * + * If the pointer variable is currently protected against change (because + * the current thread holds a mutex that protects it), ovsrcu_get_protected() + * may be used instead. Only on the Alpha architecture is this likely to + * generate different code, but it may be useful documentation. + * + * (With GNU C or Clang, you get a compiler error if TYPE is wrong; other + * compilers will merrily carry along accepting the wrong type.) * * Use ovsrcu_set() to write an RCU-protected pointer and ovsrcu_postpone() to - * free the previous data. If more than one thread can write the pointer, then - * some form of external synchronization, e.g. a mutex, is needed to prevent - * writers from interfering with one another. For example, to write the - * pointer variable declared above while safely freeing the old value: + * free the previous data. ovsrcu_set_hidden() can be used on RCU protected + * data not visible to any readers yet, but will be made visible by a later + * ovsrcu_set(). ovsrcu_init() can be used to initialize RCU pointers when + * no readers are yet executing. If more than one thread can write the + * pointer, then some form of external synchronization, e.g. a mutex, is + * needed to prevent writers from interfering with one another. For example, + * to write the pointer variable declared above while safely freeing the old + * value: * * static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; * - * static void - * free_flow(struct flow *flow) - * { - * free(flow); - * } + * OVSRCU_TYPE(struct flow *) flowp; * * void * change_flow(struct flow *new_flow) * { * ovs_mutex_lock(&mutex); - * ovsrcu_postpone(free_flow, + * ovsrcu_postpone(free, * ovsrcu_get_protected(struct flow *, &flowp)); * ovsrcu_set(&flowp, new_flow); * ovs_mutex_unlock(&mutex); @@ -109,39 +130,23 @@ #include "compiler.h" #include "ovs-atomic.h" -/* Use OVSRCU_TYPE(TYPE) to declare a pointer to RCU-protected data, e.g. the - * following declares an RCU-protected "struct flow *" named flowp: - * - * OVSRCU_TYPE(struct flow *) flowp; - * - * Use ovsrcu_get(TYPE, VAR) to read an RCU-protected pointer, e.g. to read the - * pointer variable declared above: - * - * struct flow *flow = ovsrcu_get(struct flow *, flowp); - * - * If the pointer variable is currently protected against change (because - * the current thread holds a mutex that protects it), ovsrcu_get_protected() - * may be used instead. Only on the Alpha architecture is this likely to - * generate different code, but it may be useful documentation. - * - * (With GNU C or Clang, you get a compiler error if TYPE is wrong; other - * compilers will merrily carry along accepting the wrong type.) - */ #if __GNUC__ #define OVSRCU_TYPE(TYPE) struct { ATOMIC(TYPE) p; } +#define OVSRCU_INITIALIZER(VALUE) { ATOMIC_VAR_INIT(VALUE) } #define ovsrcu_get__(TYPE, VAR, ORDER) \ ({ \ TYPE value__; \ + typeof(VAR) ovsrcu_var = (VAR); \ \ - atomic_read_explicit(CONST_CAST(ATOMIC(TYPE) *, &(VAR)->p), \ + atomic_read_explicit(CONST_CAST(ATOMIC(TYPE) *, &ovsrcu_var->p), \ &value__, ORDER); \ \ value__; \ }) #define ovsrcu_get(TYPE, VAR) \ - CONST_CAST(TYPE, ovsrcu_get__(TYPE, VAR, memory_order_consume)) + ovsrcu_get__(TYPE, VAR, memory_order_consume) #define ovsrcu_get_protected(TYPE, VAR) \ - CONST_CAST(TYPE, ovsrcu_get__(TYPE, VAR, memory_order_relaxed)) + ovsrcu_get__(TYPE, VAR, memory_order_relaxed) /* 'VALUE' may be an atomic operation, which must be evaluated before * any of the body of the atomic_store_explicit. Since the type of @@ -159,6 +164,7 @@ #else /* not GNU C */ struct ovsrcu_pointer { ATOMIC(void *) p; }; #define OVSRCU_TYPE(TYPE) struct ovsrcu_pointer +#define OVSRCU_INITIALIZER(VALUE) { ATOMIC_VAR_INIT(VALUE) } static inline void * ovsrcu_get__(const struct ovsrcu_pointer *pointer, memory_order order) { @@ -187,8 +193,18 @@ #define ovsrcu_set(VAR, VALUE) \ ovsrcu_set__(VAR, VALUE, memory_order_release) +/* This can be used for initializing RCU pointers before any readers can + * see them. A later ovsrcu_set() needs to make the bigger structure this + * is part of visible to the readers. */ +#define ovsrcu_set_hidden(VAR, VALUE) \ + ovsrcu_set__(VAR, VALUE, memory_order_relaxed) + +/* This can be used for initializing RCU pointers before any readers are + * executing. */ +#define ovsrcu_init(VAR, VALUE) atomic_init(&(VAR)->p, VALUE) + /* Calls FUNCTION passing ARG as its pointer-type argument following the next - * grace period. See "Usage" above for example. */ + * grace period. See "Usage" above for an example. */ void ovsrcu_postpone__(void (*function)(void *aux), void *aux); #define ovsrcu_postpone(FUNCTION, ARG) \ ((void) sizeof((FUNCTION)(ARG), 1), \ @@ -201,4 +217,8 @@ void ovsrcu_quiesce(void); bool ovsrcu_is_quiescent(void); +/* Synchronization. Waits for all non-quiescent threads to quiesce at least + * once. This can block for a relatively long time. */ +void ovsrcu_synchronize(void); + #endif /* ovs-rcu.h */ diff -Nru openvswitch-2.3.1/lib/ovs-router.c openvswitch-2.4.0~git20150623/lib/ovs-router.c --- openvswitch-2.3.1/lib/ovs-router.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-router.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "classifier.h" +#include "command-line.h" +#include "compiler.h" +#include "dpif.h" +#include "dynamic-string.h" +#include "netdev.h" +#include "packets.h" +#include "seq.h" +#include "ovs-router.h" +#include "ovs-thread.h" +#include "route-table.h" +#include "unixctl.h" +#include "util.h" + +static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; +static struct classifier cls; + +struct ovs_router_entry { + struct cls_rule cr; + char output_bridge[IFNAMSIZ]; + ovs_be32 gw; + ovs_be32 nw_addr; + uint8_t plen; + uint8_t priority; +}; + +static struct ovs_router_entry * +ovs_router_entry_cast(const struct cls_rule *cr) +{ + if (offsetof(struct ovs_router_entry, cr) == 0) { + return CONTAINER_OF(cr, struct ovs_router_entry, cr); + } else { + return cr ? CONTAINER_OF(cr, struct ovs_router_entry, cr) : NULL; + } +} + +bool +ovs_router_lookup(ovs_be32 ip_dst, char output_bridge[], ovs_be32 *gw) +{ + const struct cls_rule *cr; + struct flow flow = {.nw_dst = ip_dst}; + + cr = classifier_lookup(&cls, CLS_MAX_VERSION, &flow, NULL); + if (cr) { + struct ovs_router_entry *p = ovs_router_entry_cast(cr); + + ovs_strlcpy(output_bridge, p->output_bridge, IFNAMSIZ); + *gw = p->gw; + return true; + } + return route_table_fallback_lookup(ip_dst, output_bridge, gw); +} + +static void +rt_entry_free(struct ovs_router_entry *p) +{ + cls_rule_destroy(&p->cr); + free(p); +} + +static void rt_init_match(struct match *match, ovs_be32 ip_dst, uint8_t plen) +{ + ovs_be32 mask; + + mask = be32_prefix_mask(plen); + + ip_dst &= mask; /* Clear out insignificant bits. */ + memset(match, 0, sizeof *match); + match->flow.nw_dst = ip_dst; + match->wc.masks.nw_dst = mask; +} + +static void +ovs_router_insert__(uint8_t priority, ovs_be32 ip_dst, uint8_t plen, + const char output_bridge[], + ovs_be32 gw) +{ + const struct cls_rule *cr; + struct ovs_router_entry *p; + struct match match; + + rt_init_match(&match, ip_dst, plen); + + p = xzalloc(sizeof *p); + ovs_strlcpy(p->output_bridge, output_bridge, sizeof p->output_bridge); + p->gw = gw; + p->nw_addr = match.flow.nw_dst; + p->plen = plen; + p->priority = priority; + /* Longest prefix matches first. */ + cls_rule_init(&p->cr, &match, priority, CLS_MIN_VERSION); + + ovs_mutex_lock(&mutex); + cr = classifier_replace(&cls, &p->cr, NULL, 0); + ovs_mutex_unlock(&mutex); + + if (cr) { + /* An old rule with the same match was displaced. */ + ovsrcu_postpone(rt_entry_free, ovs_router_entry_cast(cr)); + } + seq_change(tnl_conf_seq); +} + +void +ovs_router_insert(ovs_be32 ip_dst, uint8_t plen, const char output_bridge[], + ovs_be32 gw) +{ + ovs_router_insert__(plen, ip_dst, plen, output_bridge, gw); +} + +static bool +rt_entry_delete(uint8_t priority, ovs_be32 ip_dst, uint8_t plen) +{ + const struct cls_rule *cr; + struct cls_rule rule; + struct match match; + + rt_init_match(&match, ip_dst, plen); + + cls_rule_init(&rule, &match, priority, CLS_MIN_VERSION); + + /* Find the exact rule. */ + cr = classifier_find_rule_exactly(&cls, &rule); + if (cr) { + /* Remove it. */ + ovs_mutex_lock(&mutex); + cr = classifier_remove(&cls, cr); + ovs_mutex_unlock(&mutex); + + if (cr) { + ovsrcu_postpone(rt_entry_free, ovs_router_entry_cast(cr)); + return true; + } + } + return false; +} + +static bool +scan_ipv4_route(const char *s, ovs_be32 *addr, unsigned int *plen) +{ + int len, max_plen, n; + int slen = strlen(s); + uint8_t *ip = (uint8_t *)addr; + + *addr = htonl(0); + if (!ovs_scan(s, "%"SCNu8"%n", &ip[0], &n)) { + return false; + } + len = n; + max_plen = 8; + for (int i = 1; i < 4; i++) { + if (ovs_scan(s + len, ".%"SCNu8"%n", &ip[i], &n)) { + len += n; + max_plen += 8; + } else { + break; + } + } + if (len == slen && max_plen == 32) { + *plen = 32; + return true; + } + if (ovs_scan(s + len, "/%u%n", plen, &n) + && len + n == slen && *plen <= max_plen) { + return true; + } + return false; +} + +static void +ovs_router_add(struct unixctl_conn *conn, int argc, + const char *argv[], void *aux OVS_UNUSED) +{ + ovs_be32 ip, gw; + unsigned int plen; + + if (scan_ipv4_route(argv[1], &ip, &plen)) { + if (argc > 3) { + inet_pton(AF_INET, argv[3], (struct in_addr *)&gw); + } else { + gw = 0; + } + ovs_router_insert__(plen + 32, ip, plen, argv[2], gw); + unixctl_command_reply(conn, "OK"); + } else { + unixctl_command_reply(conn, "Invalid parameters"); + } +} + +static void +ovs_router_del(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[], void *aux OVS_UNUSED) +{ + ovs_be32 ip; + unsigned int plen; + + if (scan_ipv4_route(argv[1], &ip, &plen)) { + + if (rt_entry_delete(plen + 32, ip, plen)) { + unixctl_command_reply(conn, "OK"); + seq_change(tnl_conf_seq); + } else { + unixctl_command_reply(conn, "Not found"); + } + } else { + unixctl_command_reply(conn, "Invalid parameters"); + } +} + +static void +ovs_router_show(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +{ + struct ovs_router_entry *rt; + struct ds ds = DS_EMPTY_INITIALIZER; + + ds_put_format(&ds, "Route Table:\n"); + CLS_FOR_EACH(rt, cr, &cls) { + if (rt->priority == rt->plen) { + ds_put_format(&ds, "Cached: "); + } else { + ds_put_format(&ds, "User: "); + } + ds_put_format(&ds, IP_FMT"/%"PRIu16" dev %s", + IP_ARGS(rt->nw_addr), rt->plen, + rt->output_bridge); + if (rt->gw) { + ds_put_format(&ds, " GW "IP_FMT, IP_ARGS(rt->gw)); + } + ds_put_format(&ds, "\n"); + } + unixctl_command_reply(conn, ds_cstr(&ds)); + ds_destroy(&ds); +} + +static void +ovs_router_lookup_cmd(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[], void *aux OVS_UNUSED) +{ + ovs_be32 ip; + unsigned int plen; + + if (scan_ipv4_route(argv[1], &ip, &plen) && plen == 32) { + char iface[IFNAMSIZ]; + ovs_be32 gw; + + if (ovs_router_lookup(ip, iface, &gw)) { + struct ds ds = DS_EMPTY_INITIALIZER; + + ds_put_format(&ds, "gateway " IP_FMT "\n", IP_ARGS(gw)); + ds_put_format(&ds, "dev %s\n", iface); + unixctl_command_reply(conn, ds_cstr(&ds)); + } else { + unixctl_command_reply(conn, "Not found"); + } + } else { + unixctl_command_reply(conn, "Invalid parameters"); + } +} + +void +ovs_router_flush(void) +{ + struct ovs_router_entry *rt; + + ovs_mutex_lock(&mutex); + classifier_defer(&cls); + CLS_FOR_EACH(rt, cr, &cls) { + if (rt->priority == rt->plen) { + if (classifier_remove(&cls, &rt->cr)) { + ovsrcu_postpone(rt_entry_free, rt); + } + } + } + classifier_publish(&cls); + ovs_mutex_unlock(&mutex); + seq_change(tnl_conf_seq); +} + +/* May not be called more than once. */ +void +ovs_router_init(void) +{ + classifier_init(&cls, NULL); + unixctl_command_register("ovs/route/add", "ipv4_addr/prefix_len out_br_name gw", 2, 3, + ovs_router_add, NULL); + unixctl_command_register("ovs/route/show", "", 0, 0, ovs_router_show, NULL); + unixctl_command_register("ovs/route/del", "ipv4_addr/prefix_len", 1, 1, ovs_router_del, + NULL); + unixctl_command_register("ovs/route/lookup", "ipv4_addr", 1, 1, + ovs_router_lookup_cmd, NULL); +} diff -Nru openvswitch-2.3.1/lib/ovs-router.h openvswitch-2.4.0~git20150623/lib/ovs-router.h --- openvswitch-2.3.1/lib/ovs-router.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-router.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OVS_TNL_ROUTER_H +#define OVS_TNL_ROUTER_H 1 + +#include "util.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool ovs_router_lookup(ovs_be32 ip_dst, char out_dev[], ovs_be32 *gw); +void ovs_router_init(void); +void ovs_router_insert(ovs_be32 ip_dst, uint8_t plen, + const char output_bridge[], ovs_be32 gw); +void ovs_router_flush(void); +#ifdef __cplusplus +} +#endif + +#endif diff -Nru openvswitch-2.3.1/lib/ovs-thread.c openvswitch-2.4.0~git20150623/lib/ovs-thread.c --- openvswitch-2.3.1/lib/ovs-thread.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-thread.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014 Nicira, Inc. + * Copyright (c) 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,16 @@ #include "ovs-thread.h" #include #include +#ifndef _WIN32 +#include +#endif #include #include #include "compiler.h" +#include "fatal-signal.h" #include "hash.h" +#include "list.h" +#include "netdev-dpdk.h" #include "ovs-rcu.h" #include "poll-loop.h" #include "seq.h" @@ -34,7 +40,7 @@ * cut-and-paste. Since "sparse" is just a checker, not a compiler, it * doesn't matter that we don't define them. */ #else -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovs_thread); @@ -174,6 +180,10 @@ XPTHREAD_FUNC1(pthread_key_delete, pthread_key_t); XPTHREAD_FUNC2(pthread_setspecific, pthread_key_t, const void *); +#ifndef _WIN32 +XPTHREAD_FUNC3(pthread_sigmask, int, const sigset_t *, sigset_t *); +#endif + static void ovs_mutex_init__(const struct ovs_mutex *l_, int type) { @@ -258,7 +268,7 @@ ovs_barrier_init(struct ovs_barrier *barrier, uint32_t size) { barrier->size = size; - atomic_init(&barrier->count, 0); + atomic_count_init(&barrier->count, 0); barrier->seq = seq_create(); } @@ -270,24 +280,30 @@ } /* Makes the calling thread block on the 'barrier' until all - * 'barrier->size' threads hit the barrier. */ + * 'barrier->size' threads hit the barrier. + * ovs_barrier provides the necessary acquire-release semantics to make + * the effects of prior memory accesses of all the participating threads + * visible on return and to prevent the following memory accesses to be + * reordered before the ovs_barrier_block(). */ void ovs_barrier_block(struct ovs_barrier *barrier) { uint64_t seq = seq_read(barrier->seq); uint32_t orig; - atomic_add(&barrier->count, 1, &orig); + orig = atomic_count_inc(&barrier->count); if (orig + 1 == barrier->size) { - atomic_store(&barrier->count, 0); + atomic_count_set(&barrier->count, 0); + /* seq_change() serves as a release barrier against the other threads, + * so the zeroed count is visible to them as they continue. */ seq_change(barrier->seq); - } - - /* To prevent thread from waking up by other event, - * keeps waiting for the change of 'barrier->seq'. */ - while (seq == seq_read(barrier->seq)) { - seq_wait(barrier->seq, seq); - poll_block(); + } else { + /* To prevent thread from waking up by other event, + * keeps waiting for the change of 'barrier->seq'. */ + while (seq == seq_read(barrier->seq)) { + seq_wait(barrier->seq, seq); + poll_block(); + } } } @@ -302,13 +318,13 @@ static void * ovsthread_wrapper(void *aux_) { - static atomic_uint next_id = ATOMIC_VAR_INIT(1); + static atomic_count next_id = ATOMIC_COUNT_INIT(1); struct ovsthread_aux *auxp = aux_; struct ovsthread_aux aux; unsigned int id; - atomic_add(&next_id, 1, &id); + id = atomic_count_inc(&next_id); *ovsthread_id_get() = id; aux = *auxp; @@ -316,7 +332,9 @@ /* The order of the following calls is important, because * ovsrcu_quiesce_end() saves a copy of the thread name. */ - set_subprogram_name("%s%u", aux.name, id); + char *subprogram_name = xasprintf("%s%u", aux.name, id); + set_subprogram_name(subprogram_name); + free(subprogram_name); ovsrcu_quiesce_end(); return aux.start(aux.arg); @@ -351,17 +369,23 @@ ovsthread_once_start__(struct ovsthread_once *once) { ovs_mutex_lock(&once->mutex); - if (!ovsthread_once_is_done__(once)) { - return false; + /* Mutex synchronizes memory, so we get the current value of 'done'. */ + if (!once->done) { + return true; } ovs_mutex_unlock(&once->mutex); - return true; + return false; } void ovsthread_once_done(struct ovsthread_once *once) { - atomic_store(&once->done, true); + /* We need release semantics here, so that the following store may not + * be moved ahead of any of the preceding initialization operations. + * A release atomic_thread_fence provides that prior memory accesses + * will not be reordered to take place after the following store. */ + atomic_thread_fence(memory_order_release); + once->done = true; ovs_mutex_unlock(&once->mutex); } @@ -569,7 +593,7 @@ /* A piece of thread-specific data. */ struct ovsthread_key { - struct list list_node; /* In 'inuse_keys' or 'free_keys'. */ + struct ovs_list list_node; /* In 'inuse_keys' or 'free_keys'. */ void (*destructor)(void *); /* Called at thread exit. */ /* Indexes into the per-thread array in struct ovsthread_key_slots. @@ -579,7 +603,7 @@ /* Per-thread data structure. */ struct ovsthread_key_slots { - struct list list_node; /* In 'slots_list'. */ + struct ovs_list list_node; /* In 'slots_list'. */ void **p1[L1_SIZE]; }; @@ -598,15 +622,15 @@ * * Together, 'inuse_keys' and 'free_keys' hold an ovsthread_key for every index * from 0 to n_keys - 1, inclusive. */ -static struct list inuse_keys OVS_GUARDED_BY(key_mutex) - = LIST_INITIALIZER(&inuse_keys); -static struct list free_keys OVS_GUARDED_BY(key_mutex) - = LIST_INITIALIZER(&free_keys); +static struct ovs_list inuse_keys OVS_GUARDED_BY(key_mutex) + = OVS_LIST_INITIALIZER(&inuse_keys); +static struct ovs_list free_keys OVS_GUARDED_BY(key_mutex) + = OVS_LIST_INITIALIZER(&free_keys); static unsigned int n_keys OVS_GUARDED_BY(key_mutex); /* All existing struct ovsthread_key_slots. */ -static struct list slots_list OVS_GUARDED_BY(key_mutex) - = LIST_INITIALIZER(&slots_list); +static struct ovs_list slots_list OVS_GUARDED_BY(key_mutex) + = OVS_LIST_INITIALIZER(&slots_list); static void * clear_slot(struct ovsthread_key_slots *slots, unsigned int index) @@ -647,6 +671,18 @@ free(slots); } +/* Cancels the callback to ovsthread_key_destruct__(). + * + * Cancelling the call to the destructor during the main thread exit + * is needed while using pthreads-win32 library in Windows. It has been + * observed that in pthreads-win32, a call to the destructor during + * main thread exit causes undefined behavior. */ +static void +ovsthread_cancel_ovsthread_key_destruct__(void *aux OVS_UNUSED) +{ + pthread_setspecific(tsd_key, NULL); +} + /* Initializes '*keyp' as a thread-specific data key. The data items are * initially null in all threads. * @@ -663,6 +699,8 @@ if (ovsthread_once_start(&once)) { xpthread_key_create(&tsd_key, ovsthread_key_destruct__); + fatal_signal_add_hook(ovsthread_cancel_ovsthread_key_destruct__, + NULL, NULL, true); ovsthread_once_done(&once); } diff -Nru openvswitch-2.3.1/lib/ovs-thread.h openvswitch-2.4.0~git20150623/lib/ovs-thread.h --- openvswitch-2.3.1/lib/ovs-thread.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/ovs-thread.h 2015-06-23 18:46:21.000000000 +0000 @@ -21,60 +21,18 @@ #include #include #include "ovs-atomic.h" +#include "openvswitch/thread.h" #include "util.h" struct seq; -/* Mutex. */ -struct OVS_LOCKABLE ovs_mutex { - pthread_mutex_t lock; - const char *where; /* NULL if and only if uninitialized. */ -}; - /* Poll-block()-able barrier similar to pthread_barrier_t. */ struct ovs_barrier { uint32_t size; /* Number of threads to wait. */ - atomic_uint32_t count; /* Number of threads already hit the barrier. */ + atomic_count count; /* Number of threads already hit the barrier. */ struct seq *seq; }; -/* "struct ovs_mutex" initializer. */ -#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP -#define OVS_MUTEX_INITIALIZER { PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, \ - "" } -#else -#define OVS_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, "" } -#endif - -#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP -#define OVS_ADAPTIVE_MUTEX_INITIALIZER \ - { PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP, "" } -#else -#define OVS_ADAPTIVE_MUTEX_INITIALIZER OVS_MUTEX_INITIALIZER -#endif - -/* ovs_mutex functions analogous to pthread_mutex_*() functions. - * - * Most of these functions abort the process with an error message on any - * error. ovs_mutex_trylock() is an exception: it passes through a 0 or EBUSY - * return value to the caller and aborts on any other error. */ -void ovs_mutex_init(const struct ovs_mutex *); -void ovs_mutex_init_recursive(const struct ovs_mutex *); -void ovs_mutex_init_adaptive(const struct ovs_mutex *); -void ovs_mutex_destroy(const struct ovs_mutex *); -void ovs_mutex_unlock(const struct ovs_mutex *mutex) OVS_RELEASES(mutex); -void ovs_mutex_lock_at(const struct ovs_mutex *mutex, const char *where) - OVS_ACQUIRES(mutex); -#define ovs_mutex_lock(mutex) \ - ovs_mutex_lock_at(mutex, SOURCE_LOCATOR) - -int ovs_mutex_trylock_at(const struct ovs_mutex *mutex, const char *where) - OVS_TRY_LOCK(0, mutex); -#define ovs_mutex_trylock(mutex) \ - ovs_mutex_trylock_at(mutex, SOURCE_LOCATOR) - -void ovs_mutex_cond_wait(pthread_cond_t *, const struct ovs_mutex *); - /* Wrappers for pthread_mutex_*() that abort the process on any error. * This is still needed when ovs-atomic-pthreads.h is used. */ void xpthread_mutex_lock(pthread_mutex_t *mutex); @@ -130,22 +88,22 @@ void ovs_rwlock_wrlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_ACQ_WRLOCK(rwlock); #define ovs_rwlock_wrlock(rwlock) \ - ovs_rwlock_wrlock_at(rwlock, SOURCE_LOCATOR) + ovs_rwlock_wrlock_at(rwlock, OVS_SOURCE_LOCATOR) int ovs_rwlock_trywrlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_TRY_WRLOCK(0, rwlock); #define ovs_rwlock_trywrlock(rwlock) \ - ovs_rwlock_trywrlock_at(rwlock, SOURCE_LOCATOR) + ovs_rwlock_trywrlock_at(rwlock, OVS_SOURCE_LOCATOR) void ovs_rwlock_rdlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_ACQ_RDLOCK(rwlock); #define ovs_rwlock_rdlock(rwlock) \ - ovs_rwlock_rdlock_at(rwlock, SOURCE_LOCATOR) + ovs_rwlock_rdlock_at(rwlock, OVS_SOURCE_LOCATOR) int ovs_rwlock_tryrdlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_TRY_RDLOCK(0, rwlock); #define ovs_rwlock_tryrdlock(rwlock) \ - ovs_rwlock_tryrdlock_at(rwlock, SOURCE_LOCATOR) + ovs_rwlock_tryrdlock_at(rwlock, OVS_SOURCE_LOCATOR) /* ovs_barrier functions analogous to pthread_barrier_*() functions. */ void ovs_barrier_init(struct ovs_barrier *, uint32_t count); @@ -164,6 +122,10 @@ void xpthread_key_delete(pthread_key_t); void xpthread_setspecific(pthread_key_t, const void *); +#ifndef _WIN32 +void xpthread_sigmask(int, const sigset_t *, sigset_t *); +#endif + pthread_t ovs_thread_create(const char *name, void *(*)(void *), void *); void xpthread_join(pthread_t, void **); @@ -496,80 +458,6 @@ void ovsthread_setspecific(ovsthread_key_t, const void *); void *ovsthread_getspecific(ovsthread_key_t); -/* Convenient once-only execution. - * - * - * Problem - * ======= - * - * POSIX provides pthread_once_t and pthread_once() as primitives for running a - * set of code only once per process execution. They are used like this: - * - * static void run_once(void) { ...initialization... } - * static pthread_once_t once = PTHREAD_ONCE_INIT; - * ... - * pthread_once(&once, run_once); - * - * pthread_once() does not allow passing any parameters to the initialization - * function, which is often inconvenient, because it means that the function - * can only access data declared at file scope. - * - * - * Solution - * ======== - * - * Use ovsthread_once, like this, instead: - * - * static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; - * - * if (ovsthread_once_start(&once)) { - * ...initialization... - * ovsthread_once_done(&once); - * } - */ - -struct ovsthread_once { - atomic_bool done; - struct ovs_mutex mutex; -}; - -#define OVSTHREAD_ONCE_INITIALIZER \ - { \ - ATOMIC_VAR_INIT(false), \ - OVS_MUTEX_INITIALIZER, \ - } - -static inline bool ovsthread_once_start(struct ovsthread_once *once) - OVS_TRY_LOCK(true, once->mutex); -void ovsthread_once_done(struct ovsthread_once *once) - OVS_RELEASES(once->mutex); - -bool ovsthread_once_start__(struct ovsthread_once *once) - OVS_TRY_LOCK(false, once->mutex); - -static inline bool -ovsthread_once_is_done__(struct ovsthread_once *once) -{ - bool done; - - atomic_read_explicit(&once->done, &done, memory_order_relaxed); - return done; -} - -/* Returns true if this is the first call to ovsthread_once_start() for - * 'once'. In this case, the caller should perform whatever initialization - * actions it needs to do, then call ovsthread_once_done() for 'once'. - * - * Returns false if this is not the first call to ovsthread_once_start() for - * 'once'. In this case, the call will not return until after - * ovsthread_once_done() has been called. */ -static inline bool -ovsthread_once_start(struct ovsthread_once *once) -{ - return OVS_UNLIKELY(!ovsthread_once_is_done__(once) - && !ovsthread_once_start__(once)); -} - /* Thread ID. * * pthread_t isn't so nice for some purposes. Its size and representation are @@ -622,11 +510,11 @@ bool single_threaded(void); void assert_single_threaded_at(const char *where); -#define assert_single_threaded() assert_single_threaded_at(SOURCE_LOCATOR) +#define assert_single_threaded() assert_single_threaded_at(OVS_SOURCE_LOCATOR) #ifndef _WIN32 pid_t xfork_at(const char *where); -#define xfork() xfork_at(SOURCE_LOCATOR) +#define xfork() xfork_at(OVS_SOURCE_LOCATOR) #endif void forbid_forking(const char *reason); diff -Nru openvswitch-2.3.1/lib/packets.c openvswitch-2.4.0~git20150623/lib/packets.c --- openvswitch-2.3.1/lib/packets.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/packets.c 2015-06-23 18:46:21.000000000 +0000 @@ -28,9 +28,9 @@ #include "flow.h" #include "hmap.h" #include "dynamic-string.h" -#include "ofpbuf.h" #include "ovs-thread.h" #include "odp-util.h" +#include "dp-packet.h" #include "unaligned.h" const struct in6_addr in6addr_exact = IN6ADDR_EXACT_INIT; @@ -145,21 +145,21 @@ * The returned packet has enough headroom to insert an 802.1Q VLAN header if * desired. */ void -compose_rarp(struct ofpbuf *b, const uint8_t eth_src[ETH_ADDR_LEN]) +compose_rarp(struct dp_packet *b, const uint8_t eth_src[ETH_ADDR_LEN]) { struct eth_header *eth; struct arp_eth_header *arp; - ofpbuf_clear(b); - ofpbuf_prealloc_tailroom(b, 2 + ETH_HEADER_LEN + VLAN_HEADER_LEN + dp_packet_clear(b); + dp_packet_prealloc_tailroom(b, 2 + ETH_HEADER_LEN + VLAN_HEADER_LEN + ARP_ETH_HEADER_LEN); - ofpbuf_reserve(b, 2 + VLAN_HEADER_LEN); - eth = ofpbuf_put_uninit(b, sizeof *eth); + dp_packet_reserve(b, 2 + VLAN_HEADER_LEN); + eth = dp_packet_put_uninit(b, sizeof *eth); memcpy(eth->eth_dst, eth_addr_broadcast, ETH_ADDR_LEN); memcpy(eth->eth_src, eth_src, ETH_ADDR_LEN); eth->eth_type = htons(ETH_TYPE_RARP); - arp = ofpbuf_put_uninit(b, sizeof *arp); + arp = dp_packet_put_uninit(b, sizeof *arp); arp->ar_hrd = htons(ARP_HRD_ETHERNET); arp->ar_pro = htons(ARP_PRO_IP); arp->ar_hln = sizeof arp->ar_sha; @@ -170,8 +170,8 @@ memcpy(arp->ar_tha, eth_src, ETH_ADDR_LEN); put_16aligned_be32(&arp->ar_tpa, htonl(0)); - ofpbuf_set_frame(b, eth); - ofpbuf_set_l3(b, arp); + dp_packet_reset_offsets(b); + dp_packet_set_l3(b, arp); } /* Insert VLAN header according to given TCI. Packet passed must be Ethernet @@ -179,12 +179,12 @@ * * Also adjusts the layer offsets accordingly. */ void -eth_push_vlan(struct ofpbuf *packet, ovs_be16 tpid, ovs_be16 tci) +eth_push_vlan(struct dp_packet *packet, ovs_be16 tpid, ovs_be16 tci) { struct vlan_eth_header *veh; /* Insert new 802.1Q header. */ - veh = ofpbuf_resize_l2(packet, VLAN_HEADER_LEN); + veh = dp_packet_resize_l2(packet, VLAN_HEADER_LEN); memmove(veh, (char *)veh + VLAN_HEADER_LEN, 2 * ETH_ADDR_LEN); veh->veth_type = tpid; veh->veth_tci = tci & htons(~VLAN_CFI); @@ -192,44 +192,44 @@ /* Removes outermost VLAN header (if any is present) from 'packet'. * - * 'packet->l2_5' should initially point to 'packet''s outer-most MPLS header - * or may be NULL if there are no MPLS headers. */ + * 'packet->l2_5' should initially point to 'packet''s outer-most VLAN header + * or may be NULL if there are no VLAN headers. */ void -eth_pop_vlan(struct ofpbuf *packet) +eth_pop_vlan(struct dp_packet *packet) { - struct vlan_eth_header *veh = ofpbuf_l2(packet); + struct vlan_eth_header *veh = dp_packet_l2(packet); - if (veh && ofpbuf_size(packet) >= sizeof *veh - && veh->veth_type == htons(ETH_TYPE_VLAN)) { + if (veh && dp_packet_size(packet) >= sizeof *veh + && eth_type_vlan(veh->veth_type)) { memmove((char *)veh + VLAN_HEADER_LEN, veh, 2 * ETH_ADDR_LEN); - ofpbuf_resize_l2(packet, -VLAN_HEADER_LEN); + dp_packet_resize_l2(packet, -VLAN_HEADER_LEN); } } /* Set ethertype of the packet. */ static void -set_ethertype(struct ofpbuf *packet, ovs_be16 eth_type) +set_ethertype(struct dp_packet *packet, ovs_be16 eth_type) { - struct eth_header *eh = ofpbuf_l2(packet); + struct eth_header *eh = dp_packet_l2(packet); if (!eh) { return; } - if (eh->eth_type == htons(ETH_TYPE_VLAN)) { + if (eth_type_vlan(eh->eth_type)) { ovs_be16 *p; - char *l2_5 = ofpbuf_l2_5(packet); + char *l2_5 = dp_packet_l2_5(packet); p = ALIGNED_CAST(ovs_be16 *, - (l2_5 ? l2_5 : (char *)ofpbuf_l3(packet)) - 2); + (l2_5 ? l2_5 : (char *)dp_packet_l3(packet)) - 2); *p = eth_type; } else { eh->eth_type = eth_type; } } -static bool is_mpls(struct ofpbuf *packet) +static bool is_mpls(struct dp_packet *packet) { return packet->l2_5_ofs != UINT16_MAX; } @@ -282,11 +282,11 @@ /* Set MPLS label stack entry to outermost MPLS header.*/ void -set_mpls_lse(struct ofpbuf *packet, ovs_be32 mpls_lse) +set_mpls_lse(struct dp_packet *packet, ovs_be32 mpls_lse) { /* Packet type should be MPLS to set label stack entry. */ if (is_mpls(packet)) { - struct mpls_hdr *mh = ofpbuf_l2_5(packet); + struct mpls_hdr *mh = dp_packet_l2_5(packet); /* Update mpls label stack entry. */ put_16aligned_be32(&mh->mpls_lse, mpls_lse); @@ -297,7 +297,7 @@ * header. If 'packet' does not already have any MPLS labels, then its * Ethertype is changed to 'ethtype' (which must be an MPLS Ethertype). */ void -push_mpls(struct ofpbuf *packet, ovs_be16 ethtype, ovs_be32 lse) +push_mpls(struct dp_packet *packet, ovs_be16 ethtype, ovs_be32 lse) { char * header; size_t len; @@ -315,7 +315,7 @@ /* Push new MPLS shim header onto packet. */ len = packet->l2_5_ofs; - header = ofpbuf_resize_l2_5(packet, MPLS_HLEN); + header = dp_packet_resize_l2_5(packet, MPLS_HLEN); memmove(header, header + MPLS_HLEN, len); memcpy(header + len, &lse, sizeof lse); } @@ -325,19 +325,19 @@ * Ethertype to 'ethtype' (which ordinarily should not be an MPLS * Ethertype). */ void -pop_mpls(struct ofpbuf *packet, ovs_be16 ethtype) +pop_mpls(struct dp_packet *packet, ovs_be16 ethtype) { if (is_mpls(packet)) { - struct mpls_hdr *mh = ofpbuf_l2_5(packet); + struct mpls_hdr *mh = dp_packet_l2_5(packet); size_t len = packet->l2_5_ofs; set_ethertype(packet, ethtype); if (get_16aligned_be32(&mh->mpls_lse) & htonl(MPLS_BOS_MASK)) { - ofpbuf_set_l2_5(packet, NULL); + dp_packet_set_l2_5(packet, NULL); } /* Shift the l2 header forward. */ - memmove((char*)ofpbuf_data(packet) + MPLS_HLEN, ofpbuf_data(packet), len); - ofpbuf_resize_l2_5(packet, -MPLS_HLEN); + memmove((char*)dp_packet_data(packet) + MPLS_HLEN, dp_packet_data(packet), len); + dp_packet_resize_l2_5(packet, -MPLS_HLEN); } } @@ -347,21 +347,21 @@ * * Aligns the L3 header of '*packetp' on a 32-bit boundary. */ const char * -eth_from_hex(const char *hex, struct ofpbuf **packetp) +eth_from_hex(const char *hex, struct dp_packet **packetp) { - struct ofpbuf *packet; + struct dp_packet *packet; /* Use 2 bytes of headroom to 32-bit align the L3 header. */ - packet = *packetp = ofpbuf_new_with_headroom(strlen(hex) / 2, 2); + packet = *packetp = dp_packet_new_with_headroom(strlen(hex) / 2, 2); - if (ofpbuf_put_hex(packet, hex, NULL)[0] != '\0') { - ofpbuf_delete(packet); + if (dp_packet_put_hex(packet, hex, NULL)[0] != '\0') { + dp_packet_delete(packet); *packetp = NULL; return "Trailing garbage in packet data"; } - if (ofpbuf_size(packet) < ETH_HEADER_LEN) { - ofpbuf_delete(packet); + if (dp_packet_size(packet) < ETH_HEADER_LEN) { + dp_packet_delete(packet); *packetp = NULL; return "Packet data too short for Ethernet"; } @@ -559,46 +559,46 @@ * The returned packet has enough headroom to insert an 802.1Q VLAN header if * desired. */ void * -eth_compose(struct ofpbuf *b, const uint8_t eth_dst[ETH_ADDR_LEN], +eth_compose(struct dp_packet *b, const uint8_t eth_dst[ETH_ADDR_LEN], const uint8_t eth_src[ETH_ADDR_LEN], uint16_t eth_type, size_t size) { void *data; struct eth_header *eth; - ofpbuf_clear(b); + dp_packet_clear(b); /* The magic 2 here ensures that the L3 header (when it is added later) * will be 32-bit aligned. */ - ofpbuf_prealloc_tailroom(b, 2 + ETH_HEADER_LEN + VLAN_HEADER_LEN + size); - ofpbuf_reserve(b, 2 + VLAN_HEADER_LEN); - eth = ofpbuf_put_uninit(b, ETH_HEADER_LEN); - data = ofpbuf_put_uninit(b, size); + dp_packet_prealloc_tailroom(b, 2 + ETH_HEADER_LEN + VLAN_HEADER_LEN + size); + dp_packet_reserve(b, 2 + VLAN_HEADER_LEN); + eth = dp_packet_put_uninit(b, ETH_HEADER_LEN); + data = dp_packet_put_uninit(b, size); memcpy(eth->eth_dst, eth_dst, ETH_ADDR_LEN); memcpy(eth->eth_src, eth_src, ETH_ADDR_LEN); eth->eth_type = htons(eth_type); - ofpbuf_set_frame(b, eth); - ofpbuf_set_l3(b, data); + dp_packet_reset_offsets(b); + dp_packet_set_l3(b, data); return data; } static void -packet_set_ipv4_addr(struct ofpbuf *packet, +packet_set_ipv4_addr(struct dp_packet *packet, ovs_16aligned_be32 *addr, ovs_be32 new_addr) { - struct ip_header *nh = ofpbuf_l3(packet); + struct ip_header *nh = dp_packet_l3(packet); ovs_be32 old_addr = get_16aligned_be32(addr); - size_t l4_size = ofpbuf_l4_size(packet); + size_t l4_size = dp_packet_l4_size(packet); if (nh->ip_proto == IPPROTO_TCP && l4_size >= TCP_HEADER_LEN) { - struct tcp_header *th = ofpbuf_l4(packet); + struct tcp_header *th = dp_packet_l4(packet); th->tcp_csum = recalc_csum32(th->tcp_csum, old_addr, new_addr); } else if (nh->ip_proto == IPPROTO_UDP && l4_size >= UDP_HEADER_LEN ) { - struct udp_header *uh = ofpbuf_l4(packet); + struct udp_header *uh = dp_packet_l4(packet); if (uh->udp_csum) { uh->udp_csum = recalc_csum32(uh->udp_csum, old_addr, new_addr); @@ -616,13 +616,13 @@ * * This function assumes that L3 and L4 offsets are set in the packet. */ static bool -packet_rh_present(struct ofpbuf *packet) +packet_rh_present(struct dp_packet *packet) { const struct ovs_16aligned_ip6_hdr *nh; int nexthdr; size_t len; size_t remaining; - uint8_t *data = ofpbuf_l3(packet); + uint8_t *data = dp_packet_l3(packet); remaining = packet->l4_ofs - packet->l3_ofs; @@ -697,17 +697,17 @@ } static void -packet_update_csum128(struct ofpbuf *packet, uint8_t proto, +packet_update_csum128(struct dp_packet *packet, uint8_t proto, ovs_16aligned_be32 addr[4], const ovs_be32 new_addr[4]) { - size_t l4_size = ofpbuf_l4_size(packet); + size_t l4_size = dp_packet_l4_size(packet); if (proto == IPPROTO_TCP && l4_size >= TCP_HEADER_LEN) { - struct tcp_header *th = ofpbuf_l4(packet); + struct tcp_header *th = dp_packet_l4(packet); th->tcp_csum = recalc_csum128(th->tcp_csum, addr, new_addr); } else if (proto == IPPROTO_UDP && l4_size >= UDP_HEADER_LEN) { - struct udp_header *uh = ofpbuf_l4(packet); + struct udp_header *uh = dp_packet_l4(packet); if (uh->udp_csum) { uh->udp_csum = recalc_csum128(uh->udp_csum, addr, new_addr); @@ -717,14 +717,14 @@ } } else if (proto == IPPROTO_ICMPV6 && l4_size >= sizeof(struct icmp6_header)) { - struct icmp6_header *icmp = ofpbuf_l4(packet); + struct icmp6_header *icmp = dp_packet_l4(packet); icmp->icmp6_cksum = recalc_csum128(icmp->icmp6_cksum, addr, new_addr); } } static void -packet_set_ipv6_addr(struct ofpbuf *packet, uint8_t proto, +packet_set_ipv6_addr(struct dp_packet *packet, uint8_t proto, ovs_16aligned_be32 addr[4], const ovs_be32 new_addr[4], bool recalculate_csum) { @@ -755,10 +755,10 @@ * 'packet' must contain a valid IPv4 packet with correctly populated l[347] * markers. */ void -packet_set_ipv4(struct ofpbuf *packet, ovs_be32 src, ovs_be32 dst, +packet_set_ipv4(struct dp_packet *packet, ovs_be32 src, ovs_be32 dst, uint8_t tos, uint8_t ttl) { - struct ip_header *nh = ofpbuf_l3(packet); + struct ip_header *nh = dp_packet_l3(packet); if (get_16aligned_be32(&nh->ip_src) != src) { packet_set_ipv4_addr(packet, &nh->ip_src, src); @@ -790,11 +790,11 @@ * appropriate. 'packet' must contain a valid IPv6 packet with correctly * populated l[34] offsets. */ void -packet_set_ipv6(struct ofpbuf *packet, uint8_t proto, const ovs_be32 src[4], +packet_set_ipv6(struct dp_packet *packet, uint8_t proto, const ovs_be32 src[4], const ovs_be32 dst[4], uint8_t key_tc, ovs_be32 key_fl, uint8_t key_hl) { - struct ovs_16aligned_ip6_hdr *nh = ofpbuf_l3(packet); + struct ovs_16aligned_ip6_hdr *nh = dp_packet_l3(packet); if (memcmp(&nh->ip6_src, src, sizeof(ovs_be32[4]))) { packet_set_ipv6_addr(packet, proto, nh->ip6_src.be32, src, true); @@ -825,9 +825,9 @@ * the TCP header contained in 'packet'. 'packet' must be a valid TCP packet * with its l4 offset properly populated. */ void -packet_set_tcp_port(struct ofpbuf *packet, ovs_be16 src, ovs_be16 dst) +packet_set_tcp_port(struct dp_packet *packet, ovs_be16 src, ovs_be16 dst) { - struct tcp_header *th = ofpbuf_l4(packet); + struct tcp_header *th = dp_packet_l4(packet); packet_set_port(&th->tcp_src, src, &th->tcp_csum); packet_set_port(&th->tcp_dst, dst, &th->tcp_csum); @@ -837,9 +837,9 @@ * the UDP header contained in 'packet'. 'packet' must be a valid UDP packet * with its l4 offset properly populated. */ void -packet_set_udp_port(struct ofpbuf *packet, ovs_be16 src, ovs_be16 dst) +packet_set_udp_port(struct dp_packet *packet, ovs_be16 src, ovs_be16 dst) { - struct udp_header *uh = ofpbuf_l4(packet); + struct udp_header *uh = dp_packet_l4(packet); if (uh->udp_csum) { packet_set_port(&uh->udp_src, src, &uh->udp_csum); @@ -858,11 +858,11 @@ * the SCTP header contained in 'packet'. 'packet' must be a valid SCTP packet * with its l4 offset properly populated. */ void -packet_set_sctp_port(struct ofpbuf *packet, ovs_be16 src, ovs_be16 dst) +packet_set_sctp_port(struct dp_packet *packet, ovs_be16 src, ovs_be16 dst) { - struct sctp_header *sh = ofpbuf_l4(packet); + struct sctp_header *sh = dp_packet_l4(packet); ovs_be32 old_csum, old_correct_csum, new_csum; - uint16_t tp_len = ofpbuf_l4_size(packet); + uint16_t tp_len = dp_packet_l4_size(packet); old_csum = get_16aligned_be32(&sh->sctp_csum); put_16aligned_be32(&sh->sctp_csum, 0); @@ -875,6 +875,58 @@ put_16aligned_be32(&sh->sctp_csum, old_csum ^ old_correct_csum ^ new_csum); } +void +packet_set_nd(struct dp_packet *packet, const ovs_be32 target[4], + const uint8_t sll[ETH_ADDR_LEN], + const uint8_t tll[ETH_ADDR_LEN]) { + struct ovs_nd_msg *ns; + struct ovs_nd_opt *nd_opt; + int bytes_remain = dp_packet_l4_size(packet); + + if (OVS_UNLIKELY(bytes_remain < sizeof(*ns))) { + return; + } + + ns = dp_packet_l4(packet); + nd_opt = &ns->options[0]; + bytes_remain -= sizeof(*ns); + + if (memcmp(&ns->target, target, sizeof(ovs_be32[4]))) { + packet_set_ipv6_addr(packet, IPPROTO_ICMPV6, + ns->target.be32, + target, true); + } + + while (bytes_remain >= ND_OPT_LEN && nd_opt->nd_opt_len != 0) { + if (nd_opt->nd_opt_type == ND_OPT_SOURCE_LINKADDR + && nd_opt->nd_opt_len == 1) { + if (memcmp(nd_opt->nd_opt_data, sll, ETH_ADDR_LEN)) { + ovs_be16 *csum = &(ns->icmph.icmp6_cksum); + + *csum = recalc_csum48(*csum, nd_opt->nd_opt_data, sll); + memcpy(nd_opt->nd_opt_data, sll, ETH_ADDR_LEN); + } + + /* A packet can only contain one SLL or TLL option */ + break; + } else if (nd_opt->nd_opt_type == ND_OPT_TARGET_LINKADDR + && nd_opt->nd_opt_len == 1) { + if (memcmp(nd_opt->nd_opt_data, tll, ETH_ADDR_LEN)) { + ovs_be16 *csum = &(ns->icmph.icmp6_cksum); + + *csum = recalc_csum48(*csum, nd_opt->nd_opt_data, tll); + memcpy(nd_opt->nd_opt_data, tll, ETH_ADDR_LEN); + } + + /* A packet can only contain one SLL or TLL option */ + break; + } + + nd_opt += nd_opt->nd_opt_len; + bytes_remain -= nd_opt->nd_opt_len * ND_OPT_LEN; + } +} + const char * packet_tcp_flag_to_string(uint32_t flag) { @@ -956,3 +1008,52 @@ ds_put_cstr(s, "[800]"); } } + +#define ARP_PACKET_SIZE (2 + ETH_HEADER_LEN + VLAN_HEADER_LEN + \ + ARP_ETH_HEADER_LEN) + +void +compose_arp(struct dp_packet *b, const uint8_t eth_src[ETH_ADDR_LEN], + ovs_be32 ip_src, ovs_be32 ip_dst) +{ + struct eth_header *eth; + struct arp_eth_header *arp; + + dp_packet_clear(b); + dp_packet_prealloc_tailroom(b, ARP_PACKET_SIZE); + dp_packet_reserve(b, 2 + VLAN_HEADER_LEN); + + eth = dp_packet_put_uninit(b, sizeof *eth); + memcpy(eth->eth_dst, eth_addr_broadcast, ETH_ADDR_LEN); + memcpy(eth->eth_src, eth_src, ETH_ADDR_LEN); + eth->eth_type = htons(ETH_TYPE_ARP); + + arp = dp_packet_put_uninit(b, sizeof *arp); + arp->ar_hrd = htons(ARP_HRD_ETHERNET); + arp->ar_pro = htons(ARP_PRO_IP); + arp->ar_hln = sizeof arp->ar_sha; + arp->ar_pln = sizeof arp->ar_spa; + arp->ar_op = htons(ARP_OP_REQUEST); + memcpy(arp->ar_sha, eth_src, ETH_ADDR_LEN); + memset(arp->ar_tha, 0, ETH_ADDR_LEN); + + put_16aligned_be32(&arp->ar_spa, ip_src); + put_16aligned_be32(&arp->ar_tpa, ip_dst); + + dp_packet_reset_offsets(b); + dp_packet_set_l3(b, arp); +} + +uint32_t +packet_csum_pseudoheader(const struct ip_header *ip) +{ + uint32_t partial = 0; + + partial = csum_add32(partial, get_16aligned_be32(&ip->ip_src)); + partial = csum_add32(partial, get_16aligned_be32(&ip->ip_dst)); + partial = csum_add16(partial, htons(ip->ip_proto)); + partial = csum_add16(partial, htons(ntohs(ip->ip_tot_len) - + IP_IHL(ip->ip_ihl_ver) * 4)); + + return partial; +} diff -Nru openvswitch-2.3.1/lib/packets.h openvswitch-2.4.0~git20150623/lib/packets.h --- openvswitch-2.3.1/lib/packets.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/packets.h 2015-06-23 18:46:21.000000000 +0000 @@ -28,7 +28,7 @@ #include "hash.h" #include "util.h" -struct ofpbuf; +struct dp_packet; struct ds; /* Tunnel information used in flow key and metadata. */ @@ -39,6 +39,11 @@ uint16_t flags; uint8_t ip_tos; uint8_t ip_ttl; + ovs_be16 tp_src; + ovs_be16 tp_dst; + ovs_be16 gbp_id; + uint8_t gbp_flags; + uint8_t pad1[5]; /* Pad to 64 bits. */ }; /* Unfortunately, a "struct flow" sometimes has to handle OpenFlow port @@ -63,7 +68,7 @@ }; #define PKT_METADATA_INITIALIZER(PORT) \ - (struct pkt_metadata){ 0, 0, { 0, 0, 0, 0, 0, 0}, 0, 0, {(PORT)} } + (struct pkt_metadata){ .in_port.odp_port = PORT } bool dpid_from_string(const char *s, uint64_t *dpidp); @@ -81,23 +86,23 @@ static const uint8_t eth_addr_bfd[ETH_ADDR_LEN] OVS_UNUSED = { 0x00, 0x23, 0x20, 0x00, 0x00, 0x01 }; -static inline bool eth_addr_is_broadcast(const uint8_t ea[6]) +static inline bool eth_addr_is_broadcast(const uint8_t ea[ETH_ADDR_LEN]) { return (ea[0] & ea[1] & ea[2] & ea[3] & ea[4] & ea[5]) == 0xff; } -static inline bool eth_addr_is_multicast(const uint8_t ea[6]) +static inline bool eth_addr_is_multicast(const uint8_t ea[ETH_ADDR_LEN]) { return ea[0] & 1; } -static inline bool eth_addr_is_local(const uint8_t ea[6]) +static inline bool eth_addr_is_local(const uint8_t ea[ETH_ADDR_LEN]) { /* Local if it is either a locally administered address or a Nicira random * address. */ return ea[0] & 2 || (ea[0] == 0x00 && ea[1] == 0x23 && ea[2] == 0x20 && ea[3] & 0x80); } -static inline bool eth_addr_is_zero(const uint8_t ea[6]) +static inline bool eth_addr_is_zero(const uint8_t ea[ETH_ADDR_LEN]) { return !(ea[0] | ea[1] | ea[2] | ea[3] | ea[4] | ea[5]); } @@ -182,21 +187,21 @@ bool eth_addr_is_reserved(const uint8_t ea[ETH_ADDR_LEN]); bool eth_addr_from_string(const char *, uint8_t ea[ETH_ADDR_LEN]); -void compose_rarp(struct ofpbuf *, const uint8_t eth_src[ETH_ADDR_LEN]); +void compose_rarp(struct dp_packet *, const uint8_t eth_src[ETH_ADDR_LEN]); -void eth_push_vlan(struct ofpbuf *, ovs_be16 tpid, ovs_be16 tci); -void eth_pop_vlan(struct ofpbuf *); +void eth_push_vlan(struct dp_packet *, ovs_be16 tpid, ovs_be16 tci); +void eth_pop_vlan(struct dp_packet *); -const char *eth_from_hex(const char *hex, struct ofpbuf **packetp); +const char *eth_from_hex(const char *hex, struct dp_packet **packetp); void eth_format_masked(const uint8_t eth[ETH_ADDR_LEN], const uint8_t mask[ETH_ADDR_LEN], struct ds *s); void eth_addr_bitand(const uint8_t src[ETH_ADDR_LEN], const uint8_t mask[ETH_ADDR_LEN], uint8_t dst[ETH_ADDR_LEN]); -void set_mpls_lse(struct ofpbuf *, ovs_be32 label); -void push_mpls(struct ofpbuf *packet, ovs_be16 ethtype, ovs_be32 lse); -void pop_mpls(struct ofpbuf *, ovs_be16 ethtype); +void set_mpls_lse(struct dp_packet *, ovs_be32 label); +void push_mpls(struct dp_packet *packet, ovs_be16 ethtype, ovs_be32 lse); +void pop_mpls(struct dp_packet *, ovs_be16 ethtype); void set_mpls_lse_ttl(ovs_be32 *lse, uint8_t ttl); void set_mpls_lse_tc(ovs_be32 *lse, uint8_t tc); @@ -234,6 +239,7 @@ #define ETH_TYPE_IP 0x0800 #define ETH_TYPE_ARP 0x0806 +#define ETH_TYPE_TEB 0x6558 #define ETH_TYPE_VLAN_8021Q 0x8100 #define ETH_TYPE_VLAN ETH_TYPE_VLAN_8021Q #define ETH_TYPE_VLAN_8021AD 0x88a8 @@ -249,6 +255,13 @@ eth_type == htons(ETH_TYPE_MPLS_MCAST); } +static inline bool eth_type_vlan(ovs_be16 eth_type) +{ + return eth_type == htons(ETH_TYPE_VLAN_8021Q) || + eth_type == htons(ETH_TYPE_VLAN_8021AD); +} + + /* Minimum value for an Ethernet type. Values below this are IEEE 802.2 frame * lengths. */ #define ETH_TYPE_MIN 0x600 @@ -280,6 +293,11 @@ }); BUILD_ASSERT_DECL(LLC_HEADER_LEN == sizeof(struct llc_header)); +/* LLC field values used for STP frames. */ +#define STP_LLC_SSAP 0x42 +#define STP_LLC_DSAP 0x42 +#define STP_LLC_CNTL 0x03 + #define SNAP_ORG_ETHERNET "\0\0" /* The compiler adds a null byte, so sizeof(SNAP_ORG_ETHERNET) == 3. */ #define SNAP_HEADER_LEN 5 @@ -446,6 +464,11 @@ { return (ip & htonl(0xf0000000)) == htonl(0xe0000000); } +static inline bool +ip_is_local_multicast(ovs_be32 ip) +{ + return (ip & htonl(0xffffff00)) == htonl(0xe0000000); +} int ip_count_cidr_bits(ovs_be32 netmask); void ip_format_masked(ovs_be32 ip, ovs_be32 mask, struct ds *); @@ -486,6 +509,7 @@ ovs_16aligned_be32 ip_src; ovs_16aligned_be32 ip_dst; }; + BUILD_ASSERT_DECL(IP_HEADER_LEN == sizeof(struct ip_header)); #define ICMP_HEADER_LEN 8 @@ -504,10 +528,50 @@ } frag; ovs_16aligned_be32 gateway; } icmp_fields; - uint8_t icmp_data[0]; }; BUILD_ASSERT_DECL(ICMP_HEADER_LEN == sizeof(struct icmp_header)); +#define IGMP_HEADER_LEN 8 +struct igmp_header { + uint8_t igmp_type; + uint8_t igmp_code; + ovs_be16 igmp_csum; + ovs_16aligned_be32 group; +}; +BUILD_ASSERT_DECL(IGMP_HEADER_LEN == sizeof(struct igmp_header)); + +#define IGMPV3_HEADER_LEN 8 +struct igmpv3_header { + uint8_t type; + uint8_t rsvr1; + ovs_be16 csum; + ovs_be16 rsvr2; + ovs_be16 ngrp; +}; +BUILD_ASSERT_DECL(IGMPV3_HEADER_LEN == sizeof(struct igmpv3_header)); + +#define IGMPV3_RECORD_LEN 8 +struct igmpv3_record { + uint8_t type; + uint8_t aux_len; + ovs_be16 nsrcs; + ovs_16aligned_be32 maddr; +}; +BUILD_ASSERT_DECL(IGMPV3_RECORD_LEN == sizeof(struct igmpv3_record)); + +#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ +#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ +#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x12 */ +#define IGMP_HOST_LEAVE_MESSAGE 0x17 +#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x12 */ + +#define IGMPV3_MODE_IS_INCLUDE 1 +#define IGMPV3_MODE_IS_EXCLUDE 2 +#define IGMPV3_CHANGE_TO_INCLUDE_MODE 3 +#define IGMPV3_CHANGE_TO_EXCLUDE_MODE 4 +#define IGMPV3_ALLOW_NEW_SOURCES 5 +#define IGMPV3_BLOCK_OLD_SOURCES 6 + #define SCTP_HEADER_LEN 12 struct sctp_header { ovs_be16 sctp_src; @@ -614,10 +678,30 @@ uint8_t icmp6_type; uint8_t icmp6_code; ovs_be16 icmp6_cksum; - uint8_t icmp6_data[0]; }; BUILD_ASSERT_DECL(ICMP6_HEADER_LEN == sizeof(struct icmp6_header)); +/* Neighbor Discovery option field. + * ND options are always a multiple of 8 bytes in size. */ +#define ND_OPT_LEN 8 +struct ovs_nd_opt { + uint8_t nd_opt_type; /* Values defined in icmp6.h */ + uint8_t nd_opt_len; /* in units of 8 octets (the size of this struct) */ + uint8_t nd_opt_data[6]; /* Ethernet address in the case of SLL or TLL options */ +}; +BUILD_ASSERT_DECL(ND_OPT_LEN == sizeof(struct ovs_nd_opt)); + +/* Like struct nd_msg (from ndisc.h), but whereas that struct requires 32-bit + * alignment, this one only requires 16-bit alignment. */ +#define ND_MSG_LEN 24 +struct ovs_nd_msg { + struct icmp6_header icmph; + ovs_16aligned_be32 rco_flags; + union ovs_16aligned_in6_addr target; + struct ovs_nd_opt options[0]; +}; +BUILD_ASSERT_DECL(ND_MSG_LEN == sizeof(struct ovs_nd_msg)); + /* The IPv6 flow label is in the lower 20 bits of the first 32-bit word. */ #define IPV6_LABEL_MASK 0x000fffff @@ -663,6 +747,67 @@ || dl_type == htons(ETH_TYPE_IPV6); } +/* Tunnel header */ +#define GENEVE_CRIT_OPT_TYPE (1 << 7) +struct geneve_opt { + ovs_be16 opt_class; + uint8_t type; +#ifdef WORDS_BIGENDIAN + uint8_t r1:1; + uint8_t r2:1; + uint8_t r3:1; + uint8_t length:5; +#else + uint8_t length:5; + uint8_t r3:1; + uint8_t r2:1; + uint8_t r1:1; +#endif + /* Option data */ +}; + +struct genevehdr { +#ifdef WORDS_BIGENDIAN + uint8_t ver:2; + uint8_t opt_len:6; + uint8_t oam:1; + uint8_t critical:1; + uint8_t rsvd1:6; +#else + uint8_t opt_len:6; + uint8_t ver:2; + uint8_t rsvd1:6; + uint8_t critical:1; + uint8_t oam:1; +#endif + ovs_be16 proto_type; + ovs_16aligned_be32 vni; + struct geneve_opt options[]; +}; + +/* GRE protocol header */ +struct gre_base_hdr { + ovs_be16 flags; + ovs_be16 protocol; +}; + +#define GRE_CSUM 0x8000 +#define GRE_ROUTING 0x4000 +#define GRE_KEY 0x2000 +#define GRE_SEQ 0x1000 +#define GRE_STRICT 0x0800 +#define GRE_REC 0x0700 +#define GRE_FLAGS 0x00F8 +#define GRE_VERSION 0x0007 + +/* VXLAN protocol header */ +struct vxlanhdr { + ovs_16aligned_be32 vx_flags; + ovs_16aligned_be32 vx_vni; +}; + +#define VXLAN_FLAGS 0x08000000 /* struct vxlanhdr.vx_flags required value. */ + void format_ipv6_addr(char *addr_str, const struct in6_addr *addr); void print_ipv6_addr(struct ds *string, const struct in6_addr *addr); void print_ipv6_masked(struct ds *string, const struct in6_addr *addr, @@ -673,22 +818,27 @@ int ipv6_count_cidr_bits(const struct in6_addr *netmask); bool ipv6_is_cidr(const struct in6_addr *netmask); -void *eth_compose(struct ofpbuf *, const uint8_t eth_dst[ETH_ADDR_LEN], +void *eth_compose(struct dp_packet *, const uint8_t eth_dst[ETH_ADDR_LEN], const uint8_t eth_src[ETH_ADDR_LEN], uint16_t eth_type, size_t size); -void *snap_compose(struct ofpbuf *, const uint8_t eth_dst[ETH_ADDR_LEN], +void *snap_compose(struct dp_packet *, const uint8_t eth_dst[ETH_ADDR_LEN], const uint8_t eth_src[ETH_ADDR_LEN], unsigned int oui, uint16_t snap_type, size_t size); -void packet_set_ipv4(struct ofpbuf *, ovs_be32 src, ovs_be32 dst, uint8_t tos, +void packet_set_ipv4(struct dp_packet *, ovs_be32 src, ovs_be32 dst, uint8_t tos, uint8_t ttl); -void packet_set_ipv6(struct ofpbuf *, uint8_t proto, const ovs_be32 src[4], +void packet_set_ipv6(struct dp_packet *, uint8_t proto, const ovs_be32 src[4], const ovs_be32 dst[4], uint8_t tc, ovs_be32 fl, uint8_t hlmit); -void packet_set_tcp_port(struct ofpbuf *, ovs_be16 src, ovs_be16 dst); -void packet_set_udp_port(struct ofpbuf *, ovs_be16 src, ovs_be16 dst); -void packet_set_sctp_port(struct ofpbuf *, ovs_be16 src, ovs_be16 dst); +void packet_set_tcp_port(struct dp_packet *, ovs_be16 src, ovs_be16 dst); +void packet_set_udp_port(struct dp_packet *, ovs_be16 src, ovs_be16 dst); +void packet_set_sctp_port(struct dp_packet *, ovs_be16 src, ovs_be16 dst); +void packet_set_nd(struct dp_packet *, const ovs_be32 target[4], + const uint8_t sll[6], const uint8_t tll[6]); void packet_format_tcp_flags(struct ds *, uint16_t); const char *packet_tcp_flag_to_string(uint32_t flag); +void compose_arp(struct dp_packet *b, const uint8_t eth_src[ETH_ADDR_LEN], + ovs_be32 ip_src, ovs_be32 ip_dst); +uint32_t packet_csum_pseudoheader(const struct ip_header *); #endif /* packets.h */ diff -Nru openvswitch-2.3.1/lib/pcap-file.c openvswitch-2.4.0~git20150623/lib/pcap-file.c --- openvswitch-2.3.1/lib/pcap-file.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/pcap-file.c 2015-06-23 18:46:21.000000000 +0000 @@ -23,13 +23,13 @@ #include #include "byte-order.h" #include "compiler.h" +#include "dp-packet.h" #include "flow.h" #include "hmap.h" -#include "ofpbuf.h" #include "packets.h" #include "timeval.h" #include "unaligned.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(pcap); @@ -133,10 +133,10 @@ } int -ovs_pcap_read(FILE *file, struct ofpbuf **bufp, long long int *when) +ovs_pcap_read(FILE *file, struct dp_packet **bufp, long long int *when) { struct pcaprec_hdr prh; - struct ofpbuf *buf; + struct dp_packet *buf; void *data; size_t len; bool swap; @@ -176,13 +176,13 @@ } /* Read packet. */ - buf = ofpbuf_new(len); - data = ofpbuf_put_uninit(buf, len); + buf = dp_packet_new(len); + data = dp_packet_put_uninit(buf, len); if (fread(data, len, 1, file) != 1) { int error = ferror(file) ? errno : EOF; VLOG_WARN("failed to read pcap packet: %s", ovs_retval_to_string(error)); - ofpbuf_delete(buf); + dp_packet_delete(buf); return error; } *bufp = buf; @@ -190,7 +190,7 @@ } void -ovs_pcap_write(FILE *file, struct ofpbuf *buf) +ovs_pcap_write(FILE *file, struct dp_packet *buf) { struct pcaprec_hdr prh; struct timeval tv; @@ -198,10 +198,10 @@ xgettimeofday(&tv); prh.ts_sec = tv.tv_sec; prh.ts_usec = tv.tv_usec; - prh.incl_len = ofpbuf_size(buf); - prh.orig_len = ofpbuf_size(buf); + prh.incl_len = dp_packet_size(buf); + prh.orig_len = dp_packet_size(buf); ignore(fwrite(&prh, sizeof prh, 1, file)); - ignore(fwrite(ofpbuf_data(buf), ofpbuf_size(buf), 1, file)); + ignore(fwrite(dp_packet_data(buf), dp_packet_size(buf), 1, file)); } struct tcp_key { @@ -213,7 +213,7 @@ struct hmap_node hmap_node; struct tcp_key key; uint32_t seq_no; - struct ofpbuf payload; + struct dp_packet payload; }; struct tcp_reader { @@ -224,7 +224,7 @@ tcp_stream_destroy(struct tcp_reader *r, struct tcp_stream *stream) { hmap_remove(&r->streams, &stream->hmap_node); - ofpbuf_uninit(&stream->payload); + dp_packet_uninit(&stream->payload); free(stream); } @@ -276,7 +276,7 @@ hmap_insert(&r->streams, &stream->hmap_node, hash); memcpy(&stream->key, key, sizeof *key); stream->seq_no = 0; - ofpbuf_init(&stream->payload, 2048); + dp_packet_init(&stream->payload, 2048); return stream; } @@ -284,35 +284,35 @@ * extracted the packet's headers into 'flow', using flow_extract(). * * If 'packet' is a TCP packet, then the reader attempts to reconstruct the - * data stream. If successful, it returns an ofpbuf that represents the data - * stream so far. The caller may examine the data in the ofpbuf and pull off + * data stream. If successful, it returns an dp_packet that represents the data + * stream so far. The caller may examine the data in the dp_packet and pull off * any data that it has fully processed. The remaining data that the caller * does not pull off will be presented again in future calls if more data * arrives in the stream. * * Returns null if 'packet' doesn't add new data to a TCP stream. */ -struct ofpbuf * +struct dp_packet * tcp_reader_run(struct tcp_reader *r, const struct flow *flow, - const struct ofpbuf *packet) + const struct dp_packet *packet) { struct tcp_stream *stream; struct tcp_header *tcp; - struct ofpbuf *payload; + struct dp_packet *payload; unsigned int l7_length; struct tcp_key key; uint32_t hash; uint32_t seq; uint8_t flags; - const char *l7 = ofpbuf_get_tcp_payload(packet); + const char *l7 = dp_packet_get_tcp_payload(packet); if (flow->dl_type != htons(ETH_TYPE_IP) || flow->nw_proto != IPPROTO_TCP || !l7) { return NULL; } - tcp = ofpbuf_l4(packet); + tcp = dp_packet_l4(packet); flags = TCP_FLAGS(tcp->tcp_ctl); - l7_length = (char *) ofpbuf_tail(packet) - l7; + l7_length = (char *) dp_packet_tail(packet) - l7; seq = ntohl(get_16aligned_be32(&tcp->tcp_seq)); /* Construct key. */ @@ -336,7 +336,7 @@ payload = &stream->payload; if (flags & TCP_SYN || !stream->seq_no) { - ofpbuf_clear(payload); + dp_packet_clear(payload); stream->seq_no = seq + 1; return NULL; } else if (flags & (TCP_FIN | TCP_RST)) { @@ -346,9 +346,9 @@ /* Shift all of the existing payload to the very beginning of the * allocated space, so that we reuse allocated space instead of * continually expanding it. */ - ofpbuf_shift(payload, (char *) ofpbuf_base(payload) - (char *) ofpbuf_data(payload)); + dp_packet_shift(payload, (char *) dp_packet_base(payload) - (char *) dp_packet_data(payload)); - ofpbuf_put(payload, l7, l7_length); + dp_packet_put(payload, l7, l7_length); stream->seq_no += l7_length; return payload; } else { diff -Nru openvswitch-2.3.1/lib/pcap-file.h openvswitch-2.4.0~git20150623/lib/pcap-file.h --- openvswitch-2.3.1/lib/pcap-file.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/pcap-file.h 2015-06-23 18:46:21.000000000 +0000 @@ -20,20 +20,20 @@ #include struct flow; -struct ofpbuf; +struct dp_packet; /* PCAP file reading and writing. */ FILE *ovs_pcap_open(const char *file_name, const char *mode); int ovs_pcap_read_header(FILE *); void ovs_pcap_write_header(FILE *); -int ovs_pcap_read(FILE *, struct ofpbuf **, long long int *when); -void ovs_pcap_write(FILE *, struct ofpbuf *); +int ovs_pcap_read(FILE *, struct dp_packet **, long long int *when); +void ovs_pcap_write(FILE *, struct dp_packet *); /* Extracting TCP stream data from an Ethernet packet capture. */ struct tcp_reader *tcp_reader_open(void); void tcp_reader_close(struct tcp_reader *); -struct ofpbuf *tcp_reader_run(struct tcp_reader *, const struct flow *, - const struct ofpbuf *); +struct dp_packet *tcp_reader_run(struct tcp_reader *, const struct flow *, + const struct dp_packet *); #endif /* pcap-file.h */ diff -Nru openvswitch-2.3.1/lib/perf-counter.c openvswitch-2.4.0~git20150623/lib/perf-counter.c --- openvswitch-2.3.1/lib/perf-counter.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/perf-counter.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This implementation only applies to the Linux platform. */ + +#include +#if defined(__linux__) && defined(HAVE_LINUX_PERF_EVENT_H) + +#include +#include +#include +#include +#include +#include +#include +#include "dynamic-string.h" +#include "perf-counter.h" +#include "shash.h" +#include "util.h" + +static struct shash perf_counters; +static int fd__ = 0; + +uint64_t +perf_counter_read(uint64_t *counter) +{ + int size = sizeof *counter; + + if (fd__ <= 0 || read(fd__, counter, size) < size) { + *counter = 0; + } + + return *counter; +} + +static long +perf_event_open(struct perf_event_attr *hw_event, pid_t pid, + int cpu, int group_fd, unsigned long flags) +{ + int ret; + + ret = syscall(__NR_perf_event_open, hw_event, pid, cpu, + group_fd, flags); + return ret; +} + +/* Set up perf event counters to read user space instruction counters + * only for this process, on all cpus. */ +static void +perf_event_setup(void) +{ + struct perf_event_attr pe; + + memset(&pe, 0, sizeof(struct perf_event_attr)); + pe.type = PERF_TYPE_HARDWARE; + pe.size = sizeof(struct perf_event_attr); + pe.config = PERF_COUNT_HW_INSTRUCTIONS; + pe.disabled = 1; + pe.exclude_kernel = 1; + pe.exclude_hv = 1; + + fd__ = perf_event_open(&pe, 0, -1, -1, 0); + if (fd__ > 0) { + ioctl(fd__, PERF_EVENT_IOC_RESET, 0); + ioctl(fd__, PERF_EVENT_IOC_ENABLE, 0); + } +} + +static void +perf_counter_init(struct perf_counter *counter) +{ + counter->once = true; + shash_add_assert(&perf_counters, counter->name, counter); +} + +void +perf_counter_accumulate(struct perf_counter *counter, uint64_t start_count) +{ + uint64_t end_count; + + if (!counter->once) { + perf_counter_init(counter); + } + + counter->n_events++; + perf_counter_read(&end_count); + counter->total_count += end_count - start_count; +} + +static void +perf_counter_to_ds(struct ds *ds, struct perf_counter *pfc) +{ + double ratio; + + if (pfc->n_events) { + ratio = (double)pfc->total_count / (double)pfc->n_events; + } else { + ratio = 0.0; + } + + ds_put_format(ds, "%-40s%12"PRIu64"%12"PRIu64"%12.1f\n", + pfc->name, pfc->n_events, pfc->total_count, ratio); +} + +static void +perf_counters_to_ds(struct ds *ds) +{ + const char *err_str; + const struct shash_node **sorted; + int i; + + err_str = NULL; + if (fd__ == -1) { + err_str = "performance counter is not supported on this platfrom"; + } else if (!shash_count(&perf_counters)) { + err_str = "performance counter has never been hit"; + } + + if (err_str) { + ds_put_format(ds, "%s\n", err_str); + return; + } + + /* Display counters in alphabetical order. */ + sorted = shash_sort(&perf_counters); + for (i = 0; i < shash_count(&perf_counters); i++) { + perf_counter_to_ds(ds, sorted[i]->data); + } + free(sorted); +} + +/* + * Caller is responsible for free memory. + */ +char * +perf_counters_to_string() +{ + struct ds ds; + + ds_init(&ds); + perf_counters_to_ds(&ds); + return ds_steal_cstr(&ds); +} + +void +perf_counters_init(void) +{ + shash_init(&perf_counters); + perf_event_setup(); +} + +void +perf_counters_clear(void) +{ + struct shash_node *node; + + SHASH_FOR_EACH (node, &perf_counters) { + struct perf_counter *perf = node->data; + + perf->n_events = 0; + perf->total_count = 0; + } +} + +void +perf_counters_destroy() +{ + struct shash_node *node, *next; + + if (fd__ != -1) { + ioctl(fd__, PERF_EVENT_IOC_DISABLE, 0); + close(fd__); + } + + SHASH_FOR_EACH_SAFE (node, next, &perf_counters) { + shash_delete(&perf_counters, node); + } + + shash_destroy(&perf_counters); +} +#endif diff -Nru openvswitch-2.3.1/lib/perf-counter.h openvswitch-2.4.0~git20150623/lib/perf-counter.h --- openvswitch-2.3.1/lib/perf-counter.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/perf-counter.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __PERF_COUNTER_H +#define __PERF_COUNTER_H 1 + +/* Motivation + * ========== + * + * It is sometimes desirable to gain performance insights of a program + * by using hardware counters. Recent Linux kernels started to support + * a set of portable API for configuring and access those counter across + * multiple platforms. + * + * APIs provided by perf-counter.h provides a set of APIs that are + * semi-integrated into OVS user spaces. The infrastructure that initializes, + * cleanup, display and clear them at run time is provided. However the + * sample points are not. A programmer needs insert sample points when needed. + * + * Since there is no pre configured sample points, there is no run time + * over head for the released product. + * + * Limitations + * =========== + * - Hard coded to sample CPU cycle count in user space only. + * - Only one counter is sampled. + * - Useful macros are only provided for function profiling. + * - show and clear command applies to all counters, there is no way + * to select a sub-set of counter. + * + * Those are not fundamental limits, but only limited by current + * implementation. + * + * Function instruction counter sample point Usage + * ================================================ + * + * There are two macros provided: + * + * Macro 'PERF_FUNCTON_COUNT_BEGIN' needs to be inserted towards the + * beginning of the function where local variables are declared. + * + * Macro 'PERF_FUNCTON_COUNT_END' needs to appear in the same function, + * some where below 'PERF_FUNCTION_COUNT_BEGIN', usually towards of + * a function. + * + * For example: + * + * void my_func() { + * int some_local_variable; + * + * PERF_FUNCTION_COUNT_BEGIN; + * + * < implementation > + * + * PERF_FUNCTION_COUNT_END + * } + * + * This will maintain the number of times 'my_func()' is called, total + * number of instructions '' executed during all those calls. + * + * Currently there are two limitation: + * 1). At most one pair can appear in the same variable scope. + * 2). The Macros use function name as the counter name for display. + * Thus, all functions in one annotation session are required to + * have unique names. + * + * Note, there is no requirement for those macros to be balanced. + * For example: + * + * void my_func(int i){ + * + * PERF_FUNCTION_COUNT_BEGIN; + * + * if (i == 300) { + * PERF_FUNCTION_COUNT_END; + * return; + * } else { + * + * } + * } + * will work just fine. + */ + +#if defined(__linux__) && defined(HAVE_LINUX_PERF_EVENT_H) +struct perf_counter { + const char *name; + bool once; + uint64_t n_events; + uint64_t total_count; +}; + +#define PERF_COUNTER_ONCE_INITIALIZER(name) \ + { \ + name, \ + false, \ + 0, \ + 0, \ + } + +void perf_counters_init(void); +void perf_counters_destroy(void); +void perf_counters_clear(void); + +uint64_t perf_counter_read(uint64_t *counter); +void perf_counter_accumulate(struct perf_counter *counter, + uint64_t start_count); +char *perf_counters_to_string(void); + +/* User access macros. */ +#define PERF_FUNCTION_BEGIN \ + static struct perf_counter x__ = PERF_COUNTER_ONCE_INITIALIZER(__func__); \ + uint64_t start_count__ = perf_counter_read(&start_count__); \ + +#define PERF_FUNCTION_END \ + perf_counter_accumulate(&x__, start_count__); + +#else + +#define PERF_FUNCTON_BEGIN +#define PERF_FUNCTON_END + +static inline void perf_counters_init(void) {} +static inline void perf_counters_destroy(void) {} +static inline void perf_counters_clear(void) {} +static inline char * +perf_counters_to_string(void) +{ + return xstrdup("Not Supported on this platform. Only available on Linux (version >= 2.6.32)"); +} + +#endif + +#endif diff -Nru openvswitch-2.3.1/lib/poll-loop.c openvswitch-2.4.0~git20150623/lib/poll-loop.c --- openvswitch-2.3.1/lib/poll-loop.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/poll-loop.c 2015-06-23 18:46:21.000000000 +0000 @@ -29,13 +29,13 @@ #include "seq.h" #include "socket-util.h" #include "timeval.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #include "hmap.h" #include "hash.h" VLOG_DEFINE_THIS_MODULE(poll_loop); -COVERAGE_DEFINE(poll_fd_wait); +COVERAGE_DEFINE(poll_create_node); COVERAGE_DEFINE(poll_zero_timeout); struct poll_node { @@ -59,11 +59,12 @@ /* Look up the node with same fd and wevent. */ static struct poll_node * -find_poll_node(struct poll_loop *loop, int fd, uint32_t wevent) +find_poll_node(struct poll_loop *loop, int fd, HANDLE wevent) { struct poll_node *node; - HMAP_FOR_EACH_WITH_HASH (node, hmap_node, hash_2words(fd, wevent), + HMAP_FOR_EACH_WITH_HASH (node, hmap_node, + hash_2words(fd, (uint32_t)wevent), &loop->poll_nodes) { if (node->pollfd.fd == fd && node->wevent == wevent) { return node; @@ -77,54 +78,91 @@ * Registers 'fd' as waiting for the specified 'events' (which should be * POLLIN or POLLOUT or POLLIN | POLLOUT). The following call to * poll_block() will wake up when 'fd' becomes ready for one or more of the - * requested events. the 'fd's are given to poll() function later. + * requested events. The 'fd's are given to poll() function later. * * On Windows system: * - * If both 'wevent' handle and 'fd' is specified, associate the 'fd' with - * with that 'wevent' for 'events' (implemented in poll_block()). - * In case of no 'fd' specified, wake up on any event on that 'wevent'. - * These wevents are given to the WaitForMultipleObjects() to be polled. - * The event registration is one-shot: only the following call to - * poll_block() is affected. The event will need to be re-registered after - * poll_block() is called if it is to persist. + * If 'fd' is specified, create a new 'wevent'. Association of 'fd' and + * 'wevent' for 'events' happens in poll_block(). If 'wevent' is specified, + * it is assumed that it is unrelated to any sockets and poll_block() + * will wake up on any event on that 'wevent'. It is an error to pass + * both 'wevent' and 'fd'. + * + * The event registration is one-shot: only the following call to + * poll_block() is affected. The event will need to be re-registered after + * poll_block() is called if it is to persist. * * ('where' is used in debug logging. Commonly one would use poll_fd_wait() to * automatically provide the caller's source file and line number for * 'where'.) */ -void -poll_fd_wait_at(int fd, HANDLE wevent, short int events, const char *where) +static void +poll_create_node(int fd, HANDLE wevent, short int events, const char *where) { struct poll_loop *loop = poll_loop(); struct poll_node *node; - COVERAGE_INC(poll_fd_wait); + COVERAGE_INC(poll_create_node); -#ifdef _WIN32 - /* Null event cannot be polled. */ - if (wevent == 0) { - VLOG_ERR("No event to wait fd %d", fd); - return; - } -#else - wevent = 0; -#endif + /* Both 'fd' and 'wevent' cannot be set. */ + ovs_assert(!fd != !wevent); - /* Check for duplicate. If found, "or" the event. */ + /* Check for duplicate. If found, "or" the events. */ node = find_poll_node(loop, fd, wevent); if (node) { node->pollfd.events |= events; } else { node = xzalloc(sizeof *node); hmap_insert(&loop->poll_nodes, &node->hmap_node, - hash_2words(fd, wevent)); + hash_2words(fd, (uint32_t)wevent)); node->pollfd.fd = fd; node->pollfd.events = events; +#ifdef _WIN32 + if (!wevent) { + wevent = CreateEvent(NULL, FALSE, FALSE, NULL); + } +#endif node->wevent = wevent; node->where = where; } } +/* Registers 'fd' as waiting for the specified 'events' (which should be POLLIN + * or POLLOUT or POLLIN | POLLOUT). The following call to poll_block() will + * wake up when 'fd' becomes ready for one or more of the requested events. + * + * On Windows, 'fd' must be a socket. + * + * The event registration is one-shot: only the following call to poll_block() + * is affected. The event will need to be re-registered after poll_block() is + * called if it is to persist. + * + * ('where' is used in debug logging. Commonly one would use poll_fd_wait() to + * automatically provide the caller's source file and line number for + * 'where'.) */ +void +poll_fd_wait_at(int fd, short int events, const char *where) +{ + poll_create_node(fd, 0, events, where); +} + +#ifdef _WIN32 +/* Registers for the next call to poll_block() to wake up when 'wevent' is + * signaled. + * + * The event registration is one-shot: only the following call to poll_block() + * is affected. The event will need to be re-registered after poll_block() is + * called if it is to persist. + * + * ('where' is used in debug logging. Commonly one would use + * poll_wevent_wait() to automatically provide the caller's source file and + * line number for 'where'.) */ +void +poll_wevent_wait_at(HANDLE wevent, const char *where) +{ + poll_create_node(0, wevent, 0, where); +} +#endif /* _WIN32 */ + /* Causes the following call to poll_block() to block for no more than 'msec' * milliseconds. If 'msec' is nonpositive, the following call to poll_block() * will not block at all. @@ -258,6 +296,12 @@ HMAP_FOR_EACH_SAFE (node, next, hmap_node, &loop->poll_nodes) { hmap_remove(&loop->poll_nodes, &node->hmap_node); +#ifdef _WIN32 + if (node->wevent && node->pollfd.fd) { + WSAEventSelect(node->pollfd.fd, NULL, 0); + CloseHandle(node->wevent); + } +#endif free(node); } } @@ -284,7 +328,7 @@ COVERAGE_INC(poll_zero_timeout); } - timewarp_wait(); + timewarp_run(); pollfds = xmalloc(hmap_count(&loop->poll_nodes) * sizeof *pollfds); #ifdef _WIN32 diff -Nru openvswitch-2.3.1/lib/poll-loop.h openvswitch-2.4.0~git20150623/lib/poll-loop.h --- openvswitch-2.3.1/lib/poll-loop.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/poll-loop.h 2015-06-23 18:46:21.000000000 +0000 @@ -50,22 +50,22 @@ * caller to supply a location explicitly, which is useful if the caller's own * caller would be more useful in log output. See timer_wait_at() for an * example. */ -void poll_fd_wait_at(int fd, HANDLE wevent, short int events, const char *where); -#ifndef _WIN32 -#define poll_fd_wait(fd, events) poll_fd_wait_at(fd, 0, events, SOURCE_LOCATOR) -#endif -#define poll_fd_wait_event(fd, wevent, events) \ - poll_fd_wait_at(fd, wevent, events, SOURCE_LOCATOR) +void poll_fd_wait_at(int fd, short int events, const char *where); +#define poll_fd_wait(fd, events) poll_fd_wait_at(fd, events, OVS_SOURCE_LOCATOR) + +#ifdef _WIN32 +#define poll_wevent_wait(wevent) poll_wevent_wait_at(wevent, OVS_SOURCE_LOCATOR) +#endif /* _WIN32 */ void poll_timer_wait_at(long long int msec, const char *where); -#define poll_timer_wait(msec) poll_timer_wait_at(msec, SOURCE_LOCATOR) +#define poll_timer_wait(msec) poll_timer_wait_at(msec, OVS_SOURCE_LOCATOR) void poll_timer_wait_until_at(long long int msec, const char *where); #define poll_timer_wait_until(msec) \ - poll_timer_wait_until_at(msec, SOURCE_LOCATOR) + poll_timer_wait_until_at(msec, OVS_SOURCE_LOCATOR) void poll_immediate_wake_at(const char *where); -#define poll_immediate_wake() poll_immediate_wake_at(SOURCE_LOCATOR) +#define poll_immediate_wake() poll_immediate_wake_at(OVS_SOURCE_LOCATOR) /* Wait until an event occurs. */ void poll_block(void); diff -Nru openvswitch-2.3.1/lib/process.c openvswitch-2.4.0~git20150623/lib/process.c --- openvswitch-2.3.1/lib/process.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/process.c 2015-06-23 18:46:21.000000000 +0000 @@ -34,14 +34,14 @@ #include "signals.h" #include "socket-util.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(process); COVERAGE_DEFINE(process_start); struct process { - struct list node; + struct ovs_list node; char *name; pid_t pid; @@ -54,7 +54,7 @@ static int fds[2]; /* All processes. */ -static struct list all_processes = LIST_INITIALIZER(&all_processes); +static struct ovs_list all_processes = OVS_LIST_INITIALIZER(&all_processes); static void sigchld_handler(int signr OVS_UNUSED); @@ -227,6 +227,7 @@ #ifndef _WIN32 pid_t pid; int error; + sigset_t prev_mask; assert_single_threaded(); @@ -237,14 +238,15 @@ return error; } + fatal_signal_block(&prev_mask); pid = fork(); if (pid < 0) { VLOG_WARN("fork failed: %s", ovs_strerror(errno)); - return errno; + error = errno; } else if (pid) { /* Running in parent process. */ *pp = process_register(argv[0], pid); - return 0; + error = 0; } else { /* Running in child process. */ int fd_max = get_max_fds(); @@ -254,11 +256,14 @@ for (fd = 3; fd < fd_max; fd++) { close(fd); } + xpthread_sigmask(SIG_SETMASK, &prev_mask, NULL); execvp(argv[0], argv); fprintf(stderr, "execvp(\"%s\") failed: %s\n", argv[0], ovs_strerror(errno)); _exit(1); } + xpthread_sigmask(SIG_SETMASK, &prev_mask, NULL); + return error; #else *pp = NULL; return ENOSYS; diff -Nru openvswitch-2.3.1/lib/pvector.c openvswitch-2.4.0~git20150623/lib/pvector.c --- openvswitch-2.3.1/lib/pvector.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/pvector.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "pvector.h" + +static struct pvector_impl * +pvector_impl_get(const struct pvector *pvec) +{ + return ovsrcu_get(struct pvector_impl *, &pvec->impl); +} + +static struct pvector_impl * +pvector_impl_alloc(size_t size) +{ + struct pvector_impl *impl; + + impl = xmalloc(sizeof *impl + size * sizeof impl->vector[0]); + impl->size = 0; + impl->allocated = size; + + return impl; +} + +static struct pvector_impl * +pvector_impl_dup(struct pvector_impl *old) +{ + struct pvector_impl *impl; + size_t alloc = old->size + PVECTOR_EXTRA_ALLOC; + + impl = xmalloc(sizeof *impl + alloc * sizeof impl->vector[0]); + impl->allocated = alloc; + impl->size = old->size; + memcpy(impl->vector, old->vector, old->size * sizeof old->vector[0]); + return impl; +} + +/* Initializes 'pvec' as an empty concurrent priority vector. */ +void +pvector_init(struct pvector *pvec) +{ + ovsrcu_set(&pvec->impl, pvector_impl_alloc(PVECTOR_EXTRA_ALLOC)); + pvec->temp = NULL; +} + +/* Destroys 'pvec'. + * + * The client is responsible for destroying any data previously held in + * 'pvec'. */ +void +pvector_destroy(struct pvector *pvec) +{ + free(pvec->temp); + pvec->temp = NULL; + ovsrcu_postpone(free, pvector_impl_get(pvec)); + ovsrcu_set(&pvec->impl, NULL); /* Poison. */ +} + +/* Iterators for callers that need the 'index' afterward. */ +#define PVECTOR_IMPL_FOR_EACH(ENTRY, INDEX, IMPL) \ + for ((INDEX) = 0; \ + (INDEX) < (IMPL)->size \ + && ((ENTRY) = &(IMPL)->vector[INDEX], true); \ + (INDEX)++) + +static int +pvector_entry_cmp(const void *a_, const void *b_) +{ + const struct pvector_entry *ap = a_; + const struct pvector_entry *bp = b_; + int a = ap->priority; + int b = bp->priority; + + return a > b ? -1 : a < b; +} + +static void +pvector_impl_sort(struct pvector_impl *impl) +{ + qsort(impl->vector, impl->size, sizeof *impl->vector, pvector_entry_cmp); + /* Trim gaps. */ + while (impl->size && impl->vector[impl->size - 1].priority == INT_MIN) { + impl->size = impl->size - 1; + } +} + +/* Returns the index of the 'ptr' in the vector, or -1 if none is found. */ +static int +pvector_impl_find(struct pvector_impl *impl, void *target) +{ + const struct pvector_entry *entry; + int index; + + PVECTOR_IMPL_FOR_EACH (entry, index, impl) { + if (entry->ptr == target) { + return index; + } + } + return -1; +} + +void +pvector_insert(struct pvector *pvec, void *ptr, int priority) +{ + struct pvector_impl *temp = pvec->temp; + struct pvector_impl *old = pvector_impl_get(pvec); + + ovs_assert(ptr != NULL); + + /* Check if can add to the end without reallocation. */ + if (!temp && old->allocated > old->size && + (!old->size || priority <= old->vector[old->size - 1].priority)) { + old->vector[old->size].ptr = ptr; + old->vector[old->size].priority = priority; + /* Size increment must not be visible to the readers before the new + * entry is stored. */ + atomic_thread_fence(memory_order_release); + ++old->size; + } else { + if (!temp) { + temp = pvector_impl_dup(old); + pvec->temp = temp; + } else if (temp->size == temp->allocated) { + temp = pvector_impl_dup(temp); + free(pvec->temp); + pvec->temp = temp; + } + /* Insert at the end, publish will sort. */ + temp->vector[temp->size].ptr = ptr; + temp->vector[temp->size].priority = priority; + temp->size += 1; + } +} + +void +pvector_remove(struct pvector *pvec, void *ptr) +{ + struct pvector_impl *temp = pvec->temp; + int index; + + if (!temp) { + temp = pvector_impl_dup(pvector_impl_get(pvec)); + pvec->temp = temp; + } + ovs_assert(temp->size > 0); + index = pvector_impl_find(temp, ptr); + ovs_assert(index >= 0); + /* Now at the index of the entry to be deleted. + * Clear in place, publish will sort and clean these off. */ + temp->vector[index].ptr = NULL; + temp->vector[index].priority = INT_MIN; +} + +/* Change entry's 'priority' and keep the vector ordered. */ +void +pvector_change_priority(struct pvector *pvec, void *ptr, int priority) +{ + struct pvector_impl *old = pvec->temp; + int index; + + if (!old) { + old = pvector_impl_get(pvec); + } + + index = pvector_impl_find(old, ptr); + + ovs_assert(index >= 0); + /* Now at the index of the entry to be updated. */ + + /* Check if can not update in place. */ + if ((priority > old->vector[index].priority && index > 0 + && priority > old->vector[index - 1].priority) + || (priority < old->vector[index].priority && index < old->size - 1 + && priority < old->vector[index + 1].priority)) { + /* Have to use a temp. */ + if (!pvec->temp) { + /* Have to reallocate to reorder. */ + pvec->temp = pvector_impl_dup(old); + old = pvec->temp; + /* Publish will sort. */ + } + } + old->vector[index].priority = priority; +} + +/* Make the modified pvector available for iteration. */ +void pvector_publish__(struct pvector *pvec) +{ + struct pvector_impl *temp = pvec->temp; + + pvec->temp = NULL; + pvector_impl_sort(temp); /* Also removes gaps. */ + ovsrcu_postpone(free, ovsrcu_get_protected(struct pvector_impl *, + &pvec->impl)); + ovsrcu_set(&pvec->impl, temp); +} diff -Nru openvswitch-2.3.1/lib/pvector.h openvswitch-2.4.0~git20150623/lib/pvector.h --- openvswitch-2.3.1/lib/pvector.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/pvector.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PVECTOR_H +#define PVECTOR_H 1 + +#include +#include +#include +#include "ovs-rcu.h" +#include "util.h" + +/* Concurrent Priority Vector + * ========================== + * + * Concurrent priority vector holds non-NULL pointers to objects in an + * increasing priority order and allows readers to traverse the vector without + * being concerned about writers modifying the vector as they are traversing + * it. + * + * The priority order is maintained as a linear vector of elements to allow + * for efficient memory prefetching. + * + * Concurrency is implemented with OVS RCU so that the readers can assume + * that once they have taken a pointer to the vector with + * pvector_cursor_init(), the 'size' member will not decrease, so that + * they can safely read 'size' entries from 'vector', and find that each + * entry has a valid, non-NULL 'ptr', and the vector is in order from highest + * to lowest 'priority'. The 'priority' values can change any time, but only + * so that the order of the entries does not change, so readers can use + * 'priority' values read at any time after acquisition of the vector pointer. + * + * Writers can concurrently add entries to the end of the vector, incrementing + * 'size', or update the 'priority' value of an entry, but only if that does + * not change the ordering of the entries. Writers will never change the 'ptr' + * values, or decrement the 'size' on a copy that readers have access to. + * + * Most modifications are internally staged at the 'temp' vector, from which + * they can be published at 'impl' by calling pvector_publish(). This saves + * unnecessary memory allocations when many changes are done back-to-back. + * 'temp' may contain NULL pointers and it may be in unsorted order. It is + * sorted before it is published at 'impl', which also removes the NULLs from + * the published vector. + * + * Clients should not use priority INT_MIN. + */ + +struct pvector_entry { + int priority; + void *ptr; +}; + +/* Writers will preallocate space for some entries at the end to avoid future + * reallocations. */ +enum { PVECTOR_EXTRA_ALLOC = 4 }; + +struct pvector_impl { + size_t size; /* Number of entries in the vector. */ + size_t allocated; /* Number of allocated entries. */ + struct pvector_entry vector[]; +}; + +/* Concurrent priority vector. */ +struct pvector { + OVSRCU_TYPE(struct pvector_impl *) impl; + struct pvector_impl *temp; +}; + +/* Initialization. */ +void pvector_init(struct pvector *); +void pvector_destroy(struct pvector *); + +/* Insertion and deletion. These work on 'temp'. */ +void pvector_insert(struct pvector *, void *, int priority); +void pvector_change_priority(struct pvector *, void *, int priority); +void pvector_remove(struct pvector *, void *); + +/* Make the modified pvector available for iteration. */ +static inline void pvector_publish(struct pvector *); + +/* Count. These operate on the published pvector. */ +static inline size_t pvector_count(const struct pvector *); +static inline bool pvector_is_empty(const struct pvector *); + +/* Iteration. + * + * + * Thread-safety + * ============= + * + * Iteration is safe even in a pvector that is changing concurrently. + * Multiple writers must exclude each other via e.g., a mutex. + * + * Example + * ======= + * + * struct my_node { + * int data; + * }; + * + * struct my_node elem1, elem2, *iter; + * struct pvector my_pvector; + * + * pvector_init(&my_pvector); + * ...add data... + * pvector_insert(&my_pvector, &elem1, 1); + * pvector_insert(&my_pvector, &elem2, 2); + * ... + * PVECTOR_FOR_EACH (iter, &my_pvector) { + * ...operate on '*iter'... + * ...elem2 to be seen before elem1... + * } + * ... + * pvector_destroy(&my_pvector); + * + * There is no PVECTOR_FOR_EACH_SAFE variant as iteration is performed on RCU + * protected instance of the priority vector. Any concurrent modifications + * that would be disruptive for readers (such as deletions), will be performed + * on a new instance. To see any of the modifications, a new iteration loop + * has to be started. + * + * The PVECTOR_FOR_EACH_PRIORITY limits the iteration to entries with higher + * than given priority and allows for object lookahead. + * + * The iteration loop must be completed without entering the OVS RCU quiescent + * period. That is, an old iteration loop must not be continued after any + * blocking IO (VLOG is non-blocking, so that is OK). + */ +struct pvector_cursor { + size_t size; /* Number of entries in the vector. */ + size_t entry_idx; /* Current index. */ + const struct pvector_entry *vector; +}; + +static inline struct pvector_cursor pvector_cursor_init(const struct pvector *, + size_t n_ahead, + size_t obj_size); +static inline void *pvector_cursor_next(struct pvector_cursor *, + int stop_at_priority, + size_t n_ahead, size_t obj_size); +static inline void pvector_cursor_lookahead(const struct pvector_cursor *, + int n, size_t size); + +#define PVECTOR_FOR_EACH(PTR, PVECTOR) \ + for (struct pvector_cursor cursor__ = pvector_cursor_init(PVECTOR, 0, 0); \ + ((PTR) = pvector_cursor_next(&cursor__, INT_MIN, 0, 0)) != NULL; ) + +/* Loop while priority is higher than 'PRIORITY' and prefetch objects + * of size 'SZ' 'N' objects ahead from the current object. */ +#define PVECTOR_FOR_EACH_PRIORITY(PTR, PRIORITY, N, SZ, PVECTOR) \ + for (struct pvector_cursor cursor__ = pvector_cursor_init(PVECTOR, N, SZ); \ + ((PTR) = pvector_cursor_next(&cursor__, PRIORITY, N, SZ)) != NULL; ) + +#define PVECTOR_CURSOR_FOR_EACH(PTR, CURSOR, PVECTOR) \ + for (*(CURSOR) = pvector_cursor_init(PVECTOR, 0, 0); \ + ((PTR) = pvector_cursor_next(CURSOR, INT_MIN, 0, 0)) != NULL; ) + +#define PVECTOR_CURSOR_FOR_EACH_CONTINUE(PTR, CURSOR) \ + for (; ((PTR) = pvector_cursor_next(CURSOR, INT_MIN, 0, 0)) != NULL; ) + + +/* Inline implementations. */ + +static inline struct pvector_cursor +pvector_cursor_init(const struct pvector *pvec, + size_t n_ahead, size_t obj_size) +{ + const struct pvector_impl *impl; + struct pvector_cursor cursor; + + impl = ovsrcu_get(struct pvector_impl *, &pvec->impl); + + ovs_prefetch_range(impl->vector, impl->size * sizeof impl->vector[0]); + + cursor.size = impl->size; + cursor.vector = impl->vector; + cursor.entry_idx = -1; + + for (size_t i = 0; i < n_ahead; i++) { + /* Prefetch the first objects. */ + pvector_cursor_lookahead(&cursor, i, obj_size); + } + return cursor; +} + +static inline void *pvector_cursor_next(struct pvector_cursor *cursor, + int stop_at_priority, + size_t n_ahead, size_t obj_size) +{ + if (++cursor->entry_idx < cursor->size && + cursor->vector[cursor->entry_idx].priority > stop_at_priority) { + if (n_ahead) { + pvector_cursor_lookahead(cursor, n_ahead, obj_size); + } + return cursor->vector[cursor->entry_idx].ptr; + } + return NULL; +} + +static inline void pvector_cursor_lookahead(const struct pvector_cursor *cursor, + int n, size_t size) +{ + if (cursor->entry_idx + n < cursor->size) { + ovs_prefetch_range(cursor->vector[cursor->entry_idx + n].ptr, size); + } +} + +static inline size_t pvector_count(const struct pvector *pvec) +{ + return ovsrcu_get(struct pvector_impl *, &pvec->impl)->size; +} + +static inline bool pvector_is_empty(const struct pvector *pvec) +{ + return pvector_count(pvec) == 0; +} + +void pvector_publish__(struct pvector *); + +/* Make the modified pvector available for iteration. */ +static inline void pvector_publish(struct pvector *pvec) +{ + if (pvec->temp) { + pvector_publish__(pvec); + } +} + +#endif /* pvector.h */ diff -Nru openvswitch-2.3.1/lib/rconn.c openvswitch-2.4.0~git20150623/lib/rconn.c --- openvswitch-2.3.1/lib/rconn.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rconn.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ #include "sat-math.h" #include "timeval.h" #include "util.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(rconn); @@ -95,14 +95,13 @@ char *target; /* vconn name, passed to vconn_open(). */ bool reliable; - struct list txq; /* Contains "struct ofpbuf"s. */ + struct ovs_list txq; /* Contains "struct ofpbuf"s. */ int backoff; int max_backoff; time_t backoff_deadline; time_t last_connected; time_t last_disconnected; - unsigned int packets_sent; unsigned int seqno; int last_error; @@ -119,7 +118,6 @@ /* These values are simply for statistics reporting, not used directly by * anything internal to the rconn (or ofproto for that matter). */ - unsigned int packets_received; unsigned int n_attempted_connections, n_successful_connections; time_t creation_time; unsigned long int total_time_connected; @@ -137,8 +135,8 @@ uint8_t dscp; /* Messages sent or received are copied to the monitor connections. */ -#define MAX_MONITORS 8 - struct vconn *monitors[8]; +#define MAXIMUM_MONITORS 8 + struct vconn *monitors[MAXIMUM_MONITORS]; size_t n_monitors; uint32_t allowed_versions; @@ -262,12 +260,9 @@ rc->last_disconnected = TIME_MIN; rc->seqno = 0; - rc->packets_sent = 0; - rc->probably_admitted = false; rc->last_admitted = time_now(); - rc->packets_received = 0; rc->n_attempted_connections = 0; rc->n_successful_connections = 0; rc->creation_time = time_now(); @@ -714,7 +709,6 @@ rc->last_admitted = time_now(); } rc->last_activity = time_now(); - rc->packets_received++; if (rc->state == S_IDLE) { state_transition(rc, S_ACTIVE); } @@ -751,11 +745,11 @@ copy_to_monitor(rc, b); if (counter) { - rconn_packet_counter_inc(counter, ofpbuf_size(b)); + rconn_packet_counter_inc(counter, b->size); } /* Reuse 'frame' as a private pointer while 'b' is in txq. */ - ofpbuf_set_frame(b, counter); + b->header = counter; list_push_back(&rc->txq, &b->list_node); @@ -831,15 +825,6 @@ return error; } -/* Returns the total number of packets successfully sent on the underlying - * vconn. A packet is not counted as sent while it is still queued in the - * rconn, only when it has been successfuly passed to the vconn. */ -unsigned int -rconn_packets_sent(const struct rconn *rc) -{ - return rc->packets_sent; -} - /* Adds 'vconn' to 'rc' as a monitoring connection, to which all messages sent * and received on 'rconn' will be copied. 'rc' takes ownership of 'vconn'. */ void @@ -964,14 +949,6 @@ return version; } -/* Returns the total number of packets successfully received by the underlying - * vconn. */ -unsigned int -rconn_packets_received(const struct rconn *rc) -{ - return rc->packets_received; -} - /* Returns a string representing the internal state of 'rc'. The caller must * not modify or free the string. */ const char * @@ -1136,19 +1113,19 @@ OVS_REQUIRES(rc->mutex) { struct ofpbuf *msg = ofpbuf_from_list(rc->txq.next); - unsigned int n_bytes = ofpbuf_size(msg); - struct rconn_packet_counter *counter = msg->frame; + unsigned int n_bytes = msg->size; + struct rconn_packet_counter *counter = msg->header; int retval; /* Eagerly remove 'msg' from the txq. We can't remove it from the list * after sending, if sending is successful, because it is then owned by the * vconn, which might have freed it already. */ list_remove(&msg->list_node); - ofpbuf_set_frame(msg, NULL); + msg->header = NULL; retval = vconn_send(rc->vconn, msg); if (retval) { - ofpbuf_set_frame(msg, counter); + msg->header = counter; list_push_front(&rc->txq, &msg->list_node); if (retval != EAGAIN) { report_error(rc, retval); @@ -1157,7 +1134,6 @@ return retval; } COVERAGE_INC(rconn_sent); - rc->packets_sent++; if (counter) { rconn_packet_counter_dec(counter, n_bytes); } @@ -1171,7 +1147,14 @@ report_error(struct rconn *rc, int error) OVS_REQUIRES(rc->mutex) { - if (error == EOF) { + /* On Windows, when a peer terminates without calling a closesocket() + * on socket fd, we get WSAECONNRESET. Don't print warning messages + * for that case. */ + if (error == EOF +#ifdef _WIN32 + || error == WSAECONNRESET +#endif + ) { /* If 'rc' isn't reliable, then we don't really expect this connection * to last forever anyway (probably it's a connection that we received * via accept()), so use DBG level to avoid cluttering the logs. */ @@ -1243,9 +1226,9 @@ } while (!list_is_empty(&rc->txq)) { struct ofpbuf *b = ofpbuf_from_list(list_pop_front(&rc->txq)); - struct rconn_packet_counter *counter = b->frame; + struct rconn_packet_counter *counter = b->header; if (counter) { - rconn_packet_counter_dec(counter, ofpbuf_size(b)); + rconn_packet_counter_dec(counter, b->size); } COVERAGE_INC(rconn_discarded); ofpbuf_delete(b); @@ -1355,7 +1338,7 @@ enum ofptype type; enum ofperr error; - error = ofptype_decode(&type, ofpbuf_data(b)); + error = ofptype_decode(&type, b->data); if (error) { return false; } @@ -1382,8 +1365,6 @@ case OFPTYPE_GROUP_FEATURES_STATS_REPLY: case OFPTYPE_TABLE_FEATURES_STATS_REQUEST: case OFPTYPE_TABLE_FEATURES_STATS_REPLY: - case OFPTYPE_BUNDLE_CONTROL: - case OFPTYPE_BUNDLE_ADD_MESSAGE: return false; case OFPTYPE_PACKET_IN: @@ -1431,6 +1412,8 @@ case OFPTYPE_FLOW_MONITOR_CANCEL: case OFPTYPE_FLOW_MONITOR_PAUSED: case OFPTYPE_FLOW_MONITOR_RESUMED: + case OFPTYPE_BUNDLE_CONTROL: + case OFPTYPE_BUNDLE_ADD_MESSAGE: default: return true; } diff -Nru openvswitch-2.3.1/lib/rconn.h openvswitch-2.4.0~git20150623/lib/rconn.h --- openvswitch-2.3.1/lib/rconn.h 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rconn.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,8 +69,6 @@ int rconn_send(struct rconn *, struct ofpbuf *, struct rconn_packet_counter *); int rconn_send_with_limit(struct rconn *, struct ofpbuf *, struct rconn_packet_counter *, int queue_limit); -unsigned int rconn_packets_sent(const struct rconn *); -unsigned int rconn_packets_received(const struct rconn *); void rconn_add_monitor(struct rconn *, struct vconn *); diff -Nru openvswitch-2.3.1/lib/rculist.h openvswitch-2.4.0~git20150623/lib/rculist.h --- openvswitch-2.3.1/lib/rculist.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rculist.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,399 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef RCULIST_H +#define RCULIST_H 1 + +/* A single writer multiple RCU-reader doubly linked list. + * + * RCU readers may iterate over the list at the same time as a writer is + * modifying the list. Multiple writers can be supported by use of mutual + * exclusion, but rculist does not provide that, as the user of rculist + * typically does that already. + * + * To be RCU-friendly, the struct rculist instances must be freed via + * ovsrcu_postpone(). + * + * The API is almost the same as for struct ovs_list, with the following + * exeptions: + * + * - The 'prev' pointer may not be accessed by the user. + * - The 'next' pointer should be accessed via rculist_next() by readers, and + * rculist_next_protected() by the writer. + * - No rculist_moved(): due to the memory management limitation stated above, + * rculist instances may not be reallocated, as realloc may instantly free + * the old memory. + * - rculist_front() returns a const pointer to accommodate for an RCU reader. + * - rculist_splice_hidden(): Spliced elements may not have been visible to + * RCU readers before the operation. + * - rculist_poison(): Only poisons the 'prev' pointer. + * + * The following functions are variations of the struct ovs_list functions with + * similar names, but are now restricted to the writer use: + * + * - rculist_back_protected() + * - rculist_is_short_protected() + * - rculist_is_singleton_protected() + */ + +#include +#include +#include "ovs-rcu.h" +#include "util.h" + +/* A non-existing mutex to make it more difficult for an user to accidentally + * keep using the 'prev' pointer. This may be helpful when porting code from + * struct ovs_list to rculist. */ +extern struct ovs_mutex rculist_fake_mutex; + +/* Doubly linked list head or element. */ +struct rculist { + /* Previous list element. */ + struct rculist *prev OVS_GUARDED_BY(rculist_fake_mutex); + + /* Next list element. */ + OVSRCU_TYPE(struct rculist *) next; +}; + +/* Easier access to 'next' member. */ +static inline const struct rculist *rculist_next(const struct rculist *); +static inline struct rculist *rculist_next_protected(const struct rculist *); + +/* List initialization. */ +#define RCUOVS_LIST_INITIALIZER(LIST) { LIST, OVSRCU_INITIALIZER(LIST) } + +static inline void rculist_init(struct rculist *list); +static inline void rculist_poison(struct rculist *elem); + +/* List insertion. */ +static inline void rculist_insert(struct rculist *list, struct rculist *elem); +static inline void rculist_splice_hidden(struct rculist *before, + struct rculist *first, + struct rculist *last); +static inline void rculist_push_front(struct rculist *list, + struct rculist *elem); +static inline void rculist_push_back(struct rculist *list, + struct rculist *elem); +static inline void rculist_replace(struct rculist *replacement, + struct rculist *replaced); +static inline void rculist_move(struct rculist *dst, struct rculist *src); + +/* List removal. */ +static inline struct rculist *rculist_remove(struct rculist *elem); +static inline struct rculist *rculist_pop_front(struct rculist *list); +static inline struct rculist *rculist_pop_back(struct rculist *list); + +/* List elements. */ +static inline const struct rculist *rculist_front(const struct rculist *); +static inline struct rculist *rculist_back_protected(const struct rculist *); + +/* List properties. */ +static inline size_t rculist_size(const struct rculist *); +static inline bool rculist_is_empty(const struct rculist *); +static inline bool rculist_is_singleton_protected(const struct rculist *); +static inline bool rculist_is_short_protected(const struct rculist *); + + +/* Inline implementations. */ + +static inline const struct rculist * +rculist_next(const struct rculist *list) +{ + return ovsrcu_get(struct rculist *, &list->next); +} + +static inline struct rculist * +rculist_next_protected(const struct rculist *list) + +{ + return ovsrcu_get_protected(struct rculist *, &list->next); +} + +static inline void +rculist_init(struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + list->prev = list; + ovsrcu_init(&list->next, list); +} + +#define RCULIST_POISON (struct rculist *)(UINTPTR_MAX / 0xf * 0xc) + +/* Initializes 'list' with pointers that will (probably) cause segfaults if + * dereferenced and, better yet, show up clearly in a debugger. */ +static inline void +rculist_poison(struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + list->prev = RCULIST_POISON; +} + +/* Initializes 'list' with pointers that will (probably) cause segfaults if + * dereferenced and, better yet, show up clearly in a debugger. + * + * This variant poisons also the next pointer, so this may not be called if + * this list element is still visible to RCU readers. */ +static inline void +rculist_poison__(struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + rculist_poison(list); + ovsrcu_set_hidden(&list->next, RCULIST_POISON); +} + +/* rculist insertion. */ +static inline void +rculist_insert(struct rculist *before, struct rculist *elem) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + elem->prev = before->prev; + ovsrcu_set_hidden(&elem->next, before); + ovsrcu_set(&before->prev->next, elem); + before->prev = elem; +} + +/* Removes elements 'first' though 'last' (exclusive) from their current list, + * which may NOT be visible to any other threads (== be hidden from them), + * then inserts them just before 'before'. */ +static inline void +rculist_splice_hidden(struct rculist *before, struct rculist *first, + struct rculist *last) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + struct rculist *last_next; + + if (first == last) { + return; + } + last = last->prev; + + /* Cleanly remove 'first'...'last' from its current list. */ + last_next = rculist_next_protected(last); + last_next->prev = first->prev; + ovsrcu_set_hidden(&first->prev->next, last_next); + + /* Splice 'first'...'last' into new list. */ + first->prev = before->prev; + ovsrcu_set(&last->next, before); + ovsrcu_set(&before->prev->next, first); + before->prev = last; +} + +/* Inserts 'elem' at the beginning of 'list', so that it becomes the front in + * 'list'. */ +static inline void +rculist_push_front(struct rculist *list, struct rculist *elem) +{ + rculist_insert(rculist_next_protected(list), elem); +} + +/* Inserts 'elem' at the end of 'list', so that it becomes the back in + * 'list'. */ +static inline void +rculist_push_back(struct rculist *list, struct rculist *elem) +{ + rculist_insert(list, elem); +} + +/* Puts 'element' in the position currently occupied by 'position'. + * + * Afterward, 'position' is not linked to from the list any more, but still + * links to the nodes in the list, and may still be referenced by other threads + * until all other threads quiesce. The replaced node ('position') may not be + * re-inserted, re-initialized, or deleted until after all other threads have + * quiesced (use ovsrcu_postpone). */ +static inline void +rculist_replace(struct rculist *element, struct rculist *position) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + struct rculist *position_next = rculist_next_protected(position); + + ovsrcu_set_hidden(&element->next, position_next); + position_next->prev = element; + element->prev = position->prev; + ovsrcu_set(&element->prev->next, element); + rculist_poison(position); +} + +/* Initializes 'dst' with the contents of 'src', compensating for moving it + * around in memory. The effect is that, if 'src' was the head of a list, now + * 'dst' is the head of a list containing the same elements. + * + * Memory for 'src' must be kept around until the next RCU quiescent period. + * rculist cannot be simply reallocated, so there is no rculist_moved(). */ +static inline void +rculist_move(struct rculist *dst, struct rculist *src) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + if (!rculist_is_empty(src)) { + struct rculist *src_next = rculist_next_protected(src); + + dst->prev = src->prev; + ovsrcu_set_hidden(&dst->next, src_next); + + src_next->prev = dst; + ovsrcu_set(&src->prev->next, dst); + } else { + rculist_init(dst); + } + rculist_poison(src); +} + +/* Removes 'elem' from its list and returns the element that followed it. + * Has no effect when 'elem' is initialized, but not in a list. + * Undefined behavior if 'elem' is not initialized. + * + * Afterward, 'elem' is not linked to from the list any more, but still links + * to the nodes in the list, and may still be referenced by other threads until + * all other threads quiesce. The removed node ('elem') may not be + * re-inserted, re-initialized, or deleted until after all other threads have + * quiesced (use ovsrcu_postpone). + */ +static inline struct rculist * +rculist_remove(struct rculist *elem) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + struct rculist *elem_next = rculist_next_protected(elem); + + elem_next->prev = elem->prev; + ovsrcu_set(&elem->prev->next, elem_next); + rculist_poison(elem); + return elem_next; +} + +/* Removes the front element from 'list' and returns it. Undefined behavior if + * 'list' is empty before removal. + * + * Afterward, teh returned former first node is not linked to from the list any + * more, but still links to the nodes in the list, and may still be referenced + * by other threads until all other threads quiesce. The returned node may not + * be re-inserted, re-initialized, or deleted until after all other threads + * have quiesced (use ovsrcu_postpone). */ +static inline struct rculist * +rculist_pop_front(struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + struct rculist *front = rculist_next_protected(list); + rculist_remove(front); + return front; +} + +/* Removes the back element from 'list' and returns it. + * Undefined behavior if 'list' is empty before removal. + * + * Afterward, teh returned former last node is not linked to from the list any + * more, but still links to the nodes in the list, and may still be referenced + * by other threads until all other threads quiesce. The returned node may not + * be re-inserted, re-initialized, or deleted until after all other threads + * have quiesced (use ovsrcu_postpone). */ +static inline struct rculist * +rculist_pop_back(struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + struct rculist *back = list->prev; + rculist_remove(back); + return back; +} + +/* Returns the front element in 'list_'. + * Undefined behavior if 'list_' is empty. */ +static inline const struct rculist * +rculist_front(const struct rculist *list) +{ + ovs_assert(!rculist_is_empty(list)); + + return rculist_next(list); +} + +/* Returns the back element in 'list_'. + * Returns the 'list_' itself, if 'list_' is empty. */ +static inline struct rculist * +rculist_back_protected(const struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + return CONST_CAST(struct rculist *, list)->prev; +} + +/* Returns the number of elements in 'list'. + * Runs in O(n) in the number of elements. */ +static inline size_t +rculist_size(const struct rculist *list) +{ + const struct rculist *e; + size_t cnt = 0; + + for (e = rculist_next(list); e != list; e = rculist_next(e)) { + cnt++; + } + return cnt; +} + +/* Returns true if 'list' is empty, false otherwise. */ +static inline bool +rculist_is_empty(const struct rculist *list) +{ + return rculist_next(list) == list; +} + +/* Returns true if 'list' has 0 or 1 elements, false otherwise. */ +static inline bool +rculist_is_short_protected(const struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + return rculist_next_protected(list) == list->prev; +} + +/* Returns true if 'list' has exactly 1 element, false otherwise. */ +static inline bool +rculist_is_singleton_protected(const struct rculist *list) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + const struct rculist *list_next = rculist_next_protected(list); + + return list_next == list->prev && list_next != list; +} + +#define RCULIST_FOR_EACH(ITER, MEMBER, RCULIST) \ + for (INIT_CONTAINER(ITER, rculist_next(RCULIST), MEMBER); \ + &(ITER)->MEMBER != (RCULIST); \ + ASSIGN_CONTAINER(ITER, rculist_next(&(ITER)->MEMBER), MEMBER)) +#define RCULIST_FOR_EACH_CONTINUE(ITER, MEMBER, RCULIST) \ + for (ASSIGN_CONTAINER(ITER, rculist_next(&(ITER)->MEMBER), MEMBER); \ + &(ITER)->MEMBER != (RCULIST); \ + ASSIGN_CONTAINER(ITER, rculist_next(&(ITER)->MEMBER), MEMBER)) + +#define RCULIST_FOR_EACH_REVERSE_PROTECTED(ITER, MEMBER, RCULIST) \ + for (INIT_CONTAINER(ITER, (RCULIST)->prev, MEMBER); \ + &(ITER)->MEMBER != (RCULIST); \ + ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER)) +#define RCULIST_FOR_EACH_REVERSE_PROTECTED_CONTINUE(ITER, MEMBER, RCULIST) \ + for (ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER); \ + &(ITER)->MEMBER != (RCULIST); \ + ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER)) + +#define RCULIST_FOR_EACH_PROTECTED(ITER, MEMBER, RCULIST) \ + for (INIT_CONTAINER(ITER, rculist_next_protected(RCULIST), MEMBER); \ + &(ITER)->MEMBER != (RCULIST); \ + ASSIGN_CONTAINER(ITER, rculist_next_protected(&(ITER)->MEMBER), \ + MEMBER)) + +#define RCULIST_FOR_EACH_SAFE_PROTECTED(ITER, NEXT, MEMBER, RCULIST) \ + for (INIT_CONTAINER(ITER, rculist_next_protected(RCULIST), MEMBER); \ + (&(ITER)->MEMBER != (RCULIST) \ + ? INIT_CONTAINER(NEXT, rculist_next_protected(&(ITER)->MEMBER), \ + MEMBER), 1 : 0); \ + (ITER) = (NEXT)) + +#endif /* rculist.h */ diff -Nru openvswitch-2.3.1/lib/reconnect.c openvswitch-2.4.0~git20150623/lib/reconnect.c --- openvswitch-2.3.1/lib/reconnect.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/reconnect.c 2015-06-23 18:46:21.000000000 +0000 @@ -20,7 +20,7 @@ #include #include "poll-loop.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(reconnect); diff -Nru openvswitch-2.3.1/lib/route-table-bsd.c openvswitch-2.4.0~git20150623/lib/route-table-bsd.c --- openvswitch-2.3.1/lib/route-table-bsd.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/route-table-bsd.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,16 +26,20 @@ #include #include +#include +#include #include #include +#include "ovs-router.h" +#include "packets.h" +#include "openvswitch/vlog.h" #include "util.h" -static int pid; -static unsigned int register_count = 0; +VLOG_DEFINE_THIS_MODULE(route_table_bsd); bool -route_table_get_name(ovs_be32 ip, char name[IFNAMSIZ]) +route_table_fallback_lookup(ovs_be32 ip, char name[], ovs_be32 *gw) { struct { struct rt_msghdr rtm; @@ -47,14 +51,21 @@ struct sockaddr_in *sin; struct sockaddr *sa; static int seq; - int i, len, namelen, rtsock; + int i, namelen, rtsock; + ssize_t len; + const pid_t pid = getpid(); + bool got_ifp = false; + unsigned int retry_count = 5; /* arbitrary */ + + VLOG_DBG("looking route up for " IP_FMT " pid %" PRIuMAX, + IP_ARGS(ip), (uintmax_t)pid); rtsock = socket(PF_ROUTE, SOCK_RAW, 0); if (rtsock < 0) return false; +retry: memset(&rtmsg, 0, sizeof(rtmsg)); - rtm->rtm_msglen = sizeof(struct rt_msghdr) + sizeof(struct sockaddr_in); rtm->rtm_version = RTM_VERSION; rtm->rtm_type = RTM_GET; @@ -66,22 +77,67 @@ sin->sin_family = AF_INET; sin->sin_addr.s_addr = ip; - if ((write(rtsock, (char *)&rtmsg, rtm->rtm_msglen)) < 0) { + len = write(rtsock, (char *)&rtmsg, rtm->rtm_msglen); + if (len == -1) { + if (errno == ENOBUFS && retry_count-- > 0) { + VLOG_INFO("Recoverable error writing to routing socket: %s", + ovs_strerror(errno)); + usleep(500 * 1000); /* arbitrary */ + goto retry; + } + VLOG_ERR("Error writing to routing socket: %s", ovs_strerror(errno)); + close(rtsock); + return false; + } + if (len != rtm->rtm_msglen) { + VLOG_ERR("Short write to routing socket"); close(rtsock); return false; } do { + struct pollfd pfd; + int ret; + + memset(&pfd, 0, sizeof(pfd)); + pfd.fd = rtsock; + pfd.events = POLLIN; + /* + * The timeout value below is somehow arbitrary. + * It's to detect the lost of routing messages due to + * buffer exhaustion etc. The routing socket is not + * reliable. + */ + ret = poll(&pfd, 1, 500); + if (ret == -1) { + VLOG_ERR("Error polling on routing socket: %s", + ovs_strerror(errno)); + close(rtsock); + return false; + } + if (ret == 0) { + if (retry_count-- > 0) { + VLOG_INFO("Timeout; resending routing message"); + goto retry; + } + close(rtsock); + return false; + } len = read(rtsock, (char *)&rtmsg, sizeof(rtmsg)); + if (len > 0) { + VLOG_DBG("got rtmsg pid %" PRIuMAX " seq %d", + (uintmax_t)rtmsg.rtm.rtm_pid, + rtmsg.rtm.rtm_seq); + } } while (len > 0 && (rtmsg.rtm.rtm_seq != seq || rtmsg.rtm.rtm_pid != pid)); - close(rtsock); - - if (len < 0) { + if (len == -1) { + VLOG_ERR("Error reading from routing socket: %s", ovs_strerror(errno)); return false; } + *gw = 0; sa = (struct sockaddr *)(rtm + 1); for (i = 1; i; i <<= 1) { if (rtm->rtm_addrs & i) { @@ -93,7 +149,14 @@ namelen = IFNAMSIZ - 1; memcpy(name, ifp->sdl_data, namelen); name[namelen] = '\0'; - return true; + VLOG_DBG("got ifp %s", name); + got_ifp = true; + } else if (i == RTA_GATEWAY && sa->sa_family == AF_INET) { + const struct sockaddr_in *sin_dst = + ALIGNED_CAST(struct sockaddr_in *, sa); + + *gw = sin_dst->sin_addr.s_addr; + VLOG_DBG("got gateway " IP_FMT, IP_ARGS(*gw)); } #if defined(__FreeBSD__) sa = (struct sockaddr *)((char *)sa + SA_SIZE(sa)); @@ -104,7 +167,7 @@ #endif } } - return false; + return got_ifp; } uint64_t @@ -114,20 +177,9 @@ } void -route_table_register(void) -{ - if (!register_count) - { - pid = getpid(); - } - - register_count++; -} - -void -route_table_unregister(void) +route_table_init(void) { - register_count--; + ovs_router_init(); } void diff -Nru openvswitch-2.3.1/lib/route-table.c openvswitch-2.4.0~git20150623/lib/route-table.c --- openvswitch-2.3.1/lib/route-table.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/route-table.c 2015-06-23 18:46:21.000000000 +0000 @@ -18,19 +18,20 @@ #include "route-table.h" +#include #include #include #include #include #include "hash.h" -#include "hmap.h" #include "netlink.h" #include "netlink-notifier.h" #include "netlink-socket.h" #include "ofpbuf.h" +#include "ovs-router.h" #include "rtnetlink-link.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(route_table); @@ -39,8 +40,9 @@ unsigned char rtm_dst_len; /* Extracted from Netlink attributes. */ - uint32_t rta_dst; /* Destination in host byte order. 0 if missing. */ - int rta_oif; /* Output interface index. */ + ovs_be32 rta_dst; /* 0 if missing. */ + ovs_be32 rta_gw; + char ifname[IFNAMSIZ]; /* Interface name. */ }; /* A digested version of a route message sent down by the kernel to indicate @@ -51,18 +53,6 @@ struct route_data rd; /* Data parsed from this message. */ }; -struct route_node { - struct hmap_node node; /* Node in route_map. */ - struct route_data rd; /* Data associated with this node. */ -}; - -struct name_node { - struct hmap_node node; /* Node in name_map. */ - uint32_t ifi_index; /* Kernel interface index. */ - - char ifname[IFNAMSIZ]; /* Interface name. */ -}; - static struct ovs_mutex route_table_mutex = OVS_MUTEX_INITIALIZER; static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); @@ -70,102 +60,21 @@ * every time route_table_reset() is called. */ static uint64_t rt_change_seq; -static unsigned int register_count = 0; static struct nln *nln = NULL; static struct route_table_msg rtmsg; static struct nln_notifier *route_notifier = NULL; static struct nln_notifier *name_notifier = NULL; static bool route_table_valid = false; -static bool name_table_valid = false; -static struct hmap route_map; -static struct hmap name_map; static int route_table_reset(void); -static bool route_table_get_ifindex(ovs_be32 ip, int *) - OVS_REQUIRES(route_table_mutex); static void route_table_handle_msg(const struct route_table_msg *); static bool route_table_parse(struct ofpbuf *, struct route_table_msg *); static void route_table_change(const struct route_table_msg *, void *); -static struct route_node *route_node_lookup(const struct route_data *); -static struct route_node *route_node_lookup_by_ip(uint32_t ip); static void route_map_clear(void); -static uint32_t hash_route_data(const struct route_data *); static void name_table_init(void); -static void name_table_uninit(void); -static int name_table_reset(void); static void name_table_change(const struct rtnetlink_link_change *, void *); -static void name_map_clear(void); -static struct name_node *name_node_lookup(int ifi_index); - -/* Populates 'name' with the name of the interface traffic destined for 'ip' - * is likely to egress out of (see route_table_get_ifindex). - * - * Returns true if successful, otherwise false. */ -bool -route_table_get_name(ovs_be32 ip, char name[IFNAMSIZ]) - OVS_EXCLUDED(route_table_mutex) -{ - int ifindex; - - ovs_mutex_lock(&route_table_mutex); - - if (!name_table_valid) { - name_table_reset(); - } - - if (route_table_get_ifindex(ip, &ifindex)) { - struct name_node *nn; - - nn = name_node_lookup(ifindex); - if (nn) { - ovs_strlcpy(name, nn->ifname, IFNAMSIZ); - ovs_mutex_unlock(&route_table_mutex); - return true; - } - } - - ovs_mutex_unlock(&route_table_mutex); - return false; -} - -/* Populates 'ifindex' with the interface index traffic destined for 'ip' is - * likely to egress. There is no hard guarantee that traffic destined for 'ip' - * will egress out the specified interface. 'ifindex' may refer to an - * interface which is not physical (such as a bridge port). - * - * Returns true if successful, otherwise false. */ -static bool -route_table_get_ifindex(ovs_be32 ip_, int *ifindex) - OVS_REQUIRES(route_table_mutex) -{ - struct route_node *rn; - uint32_t ip = ntohl(ip_); - - *ifindex = 0; - - if (!route_table_valid) { - route_table_reset(); - } - - rn = route_node_lookup_by_ip(ip); - - if (rn) { - *ifindex = rn->rd.rta_oif; - return true; - } - - /* Choose a default route. */ - HMAP_FOR_EACH(rn, node, &route_map) { - if (rn->rd.rta_dst == 0 && rn->rd.rtm_dst_len == 0) { - *ifindex = rn->rd.rta_oif; - return true; - } - } - - return false; -} uint64_t route_table_get_change_seq(void) @@ -176,50 +85,24 @@ /* Users of the route_table module should register themselves with this * function before making any other route_table function calls. */ void -route_table_register(void) +route_table_init(void) OVS_EXCLUDED(route_table_mutex) { ovs_mutex_lock(&route_table_mutex); - if (!register_count) { - ovs_assert(!nln); - ovs_assert(!route_notifier); - - nln = nln_create(NETLINK_ROUTE, RTNLGRP_IPV4_ROUTE, - (nln_parse_func *) route_table_parse, &rtmsg); - - route_notifier = - nln_notifier_create(nln, (nln_notify_func *) route_table_change, - NULL); - - hmap_init(&route_map); - route_table_reset(); - name_table_init(); - } + ovs_assert(!nln); + ovs_assert(!route_notifier); - register_count++; - ovs_mutex_unlock(&route_table_mutex); -} + ovs_router_init(); + nln = nln_create(NETLINK_ROUTE, RTNLGRP_IPV4_ROUTE, + (nln_parse_func *) route_table_parse, &rtmsg); + + route_notifier = + nln_notifier_create(nln, (nln_notify_func *) route_table_change, + NULL); -/* Users of the route_table module should unregister themselves with this - * function when they will no longer be making any more route_table fuction - * calls. */ -void -route_table_unregister(void) - OVS_EXCLUDED(route_table_mutex) -{ - ovs_mutex_lock(&route_table_mutex); - register_count--; + route_table_reset(); + name_table_init(); - if (!register_count) { - nln_notifier_destroy(route_notifier); - route_notifier = NULL; - nln_destroy(nln); - nln = NULL; - - route_map_clear(); - hmap_destroy(&route_map); - name_table_uninit(); - } ovs_mutex_unlock(&route_table_mutex); } @@ -297,6 +180,7 @@ static const struct nl_policy policy[] = { [RTA_DST] = { .type = NL_A_U32, .optional = true }, [RTA_OIF] = { .type = NL_A_U32, .optional = false }, + [RTA_GATEWAY] = { .type = NL_A_U32, .optional = true }, }; struct nlattr *attrs[ARRAY_SIZE(policy)]; @@ -307,8 +191,9 @@ if (parsed) { const struct rtmsg *rtm; const struct nlmsghdr *nlmsg; + int rta_oif; /* Output interface index. */ - nlmsg = ofpbuf_data(buf); + nlmsg = buf->data; rtm = ofpbuf_at(buf, NLMSG_HDRLEN, sizeof *rtm); if (rtm->rtm_family != AF_INET) { @@ -327,15 +212,26 @@ rtm->rtm_type != RTN_LOCAL) { change->relevant = false; } - change->nlmsg_type = nlmsg->nlmsg_type; change->rd.rtm_dst_len = rtm->rtm_dst_len; - change->rd.rta_oif = nl_attr_get_u32(attrs[RTA_OIF]); + rta_oif = nl_attr_get_u32(attrs[RTA_OIF]); + + if (!if_indextoname(rta_oif, change->rd.ifname)) { + int error = errno; + + VLOG_DBG_RL(&rl, "Could not find interface name[%u]: %s", + rta_oif, ovs_strerror(error)); + return false; + } if (attrs[RTA_DST]) { - change->rd.rta_dst = ntohl(nl_attr_get_be32(attrs[RTA_DST])); + change->rd.rta_dst = nl_attr_get_be32(attrs[RTA_DST]); + } + if (attrs[RTA_GATEWAY]) { + change->rd.rta_gw = nl_attr_get_be32(attrs[RTA_GATEWAY]); } + } else { VLOG_DBG_RL(&rl, "received unparseable rtnetlink route message"); } @@ -353,131 +249,38 @@ static void route_table_handle_msg(const struct route_table_msg *change) { - if (change->relevant && change->nlmsg_type == RTM_NEWROUTE && - !route_node_lookup(&change->rd)) { - struct route_node *rn; - - rn = xzalloc(sizeof *rn); - memcpy(&rn->rd, &change->rd, sizeof change->rd); + if (change->relevant && change->nlmsg_type == RTM_NEWROUTE) { + const struct route_data *rd = &change->rd; - hmap_insert(&route_map, &rn->node, hash_route_data(&rn->rd)); + ovs_router_insert(rd->rta_dst, rd->rtm_dst_len, + rd->ifname, rd->rta_gw); } } -static struct route_node * -route_node_lookup(const struct route_data *rd) -{ - struct route_node *rn; - - HMAP_FOR_EACH_WITH_HASH(rn, node, hash_route_data(rd), &route_map) { - if (!memcmp(&rn->rd, rd, sizeof *rd)) { - return rn; - } - } - - return NULL; -} - -static struct route_node * -route_node_lookup_by_ip(uint32_t ip) -{ - int dst_len; - struct route_node *rn, *rn_ret; - - dst_len = -1; - rn_ret = NULL; - - HMAP_FOR_EACH(rn, node, &route_map) { - uint32_t mask = 0xffffffff << (32 - rn->rd.rtm_dst_len); - - if (rn->rd.rta_dst == 0 && rn->rd.rtm_dst_len == 0) { - /* Default route. */ - continue; - } - - if (rn->rd.rtm_dst_len > dst_len && - (ip & mask) == (rn->rd.rta_dst & mask)) { - rn_ret = rn; - dst_len = rn->rd.rtm_dst_len; - } - } - - return rn_ret; -} - static void route_map_clear(void) { - struct route_node *rn, *rn_next; - - HMAP_FOR_EACH_SAFE(rn, rn_next, node, &route_map) { - hmap_remove(&route_map, &rn->node); - free(rn); - } + ovs_router_flush(); } -static uint32_t -hash_route_data(const struct route_data *rd) +bool +route_table_fallback_lookup(ovs_be32 ip_dst OVS_UNUSED, + char output_bridge[] OVS_UNUSED, + ovs_be32 *gw) { - return hash_bytes(rd, sizeof *rd, 0); + *gw = 0; + return false; } + /* name_table . */ static void name_table_init(void) { - hmap_init(&name_map); name_notifier = rtnetlink_link_notifier_create(name_table_change, NULL); - name_table_valid = false; -} - -static void -name_table_uninit(void) -{ - rtnetlink_link_notifier_destroy(name_notifier); - name_notifier = NULL; - name_map_clear(); - hmap_destroy(&name_map); } -static int -name_table_reset(void) -{ - struct nl_dump dump; - struct rtgenmsg *rtmsg; - uint64_t reply_stub[NL_DUMP_BUFSIZE / 8]; - struct ofpbuf request, reply, buf; - - name_table_valid = true; - name_map_clear(); - - ofpbuf_init(&request, 0); - nl_msg_put_nlmsghdr(&request, sizeof *rtmsg, RTM_GETLINK, NLM_F_REQUEST); - rtmsg = ofpbuf_put_zeros(&request, sizeof *rtmsg); - rtmsg->rtgen_family = AF_INET; - - nl_dump_start(&dump, NETLINK_ROUTE, &request); - ofpbuf_uninit(&request); - - ofpbuf_use_stub(&buf, reply_stub, sizeof reply_stub); - while (nl_dump_next(&dump, &reply, &buf)) { - struct rtnetlink_link_change change; - - if (rtnetlink_link_parse(&reply, &change) - && change.nlmsg_type == RTM_NEWLINK - && !name_node_lookup(change.ifi_index)) { - struct name_node *nn; - - nn = xzalloc(sizeof *nn); - nn->ifi_index = change.ifi_index; - ovs_strlcpy(nn->ifname, change.ifname, IFNAMSIZ); - hmap_insert(&name_map, &nn->node, hash_int(nn->ifi_index, 0)); - } - } - ofpbuf_uninit(&buf); - return nl_dump_done(&dump); -} static void name_table_change(const struct rtnetlink_link_change *change OVS_UNUSED, @@ -486,30 +289,4 @@ /* Changes to interface status can cause routing table changes that some * versions of the linux kernel do not advertise for some reason. */ route_table_valid = false; - name_table_valid = false; -} - -static struct name_node * -name_node_lookup(int ifi_index) -{ - struct name_node *nn; - - HMAP_FOR_EACH_WITH_HASH(nn, node, hash_int(ifi_index, 0), &name_map) { - if (nn->ifi_index == ifi_index) { - return nn; - } - } - - return NULL; -} - -static void -name_map_clear(void) -{ - struct name_node *nn, *nn_next; - - HMAP_FOR_EACH_SAFE(nn, nn_next, node, &name_map) { - hmap_remove(&name_map, &nn->node); - free(nn); - } } diff -Nru openvswitch-2.3.1/lib/route-table.h openvswitch-2.4.0~git20150623/lib/route-table.h --- openvswitch-2.3.1/lib/route-table.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/route-table.h 2015-06-23 18:46:21.000000000 +0000 @@ -25,11 +25,10 @@ #include "openvswitch/types.h" -bool route_table_get_name(ovs_be32 ip, char name[IFNAMSIZ]); uint64_t route_table_get_change_seq(void); -void route_table_register(void); -void route_table_unregister(void); +void route_table_init(void); void route_table_run(void); void route_table_wait(void); +bool route_table_fallback_lookup(ovs_be32, char [], ovs_be32 *); #endif /* route-table.h */ diff -Nru openvswitch-2.3.1/lib/route-table-stub.c openvswitch-2.4.0~git20150623/lib/route-table-stub.c --- openvswitch-2.3.1/lib/route-table-stub.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/route-table-stub.c 2015-06-23 18:46:21.000000000 +0000 @@ -13,14 +13,17 @@ * limitations under the License. */ #include -#include "route-table.h" #include "compiler.h" +#include "ovs-router.h" +#include "route-table.h" bool -route_table_get_name(ovs_be32 ip OVS_UNUSED, char name[IFNAMSIZ] OVS_UNUSED) +route_table_fallback_lookup(ovs_be32 ip_dst OVS_UNUSED, + char output_bridge[] OVS_UNUSED, + ovs_be32 *gw) { - name[0] = '\0'; + *gw = 0; return false; } @@ -31,13 +34,9 @@ } void -route_table_register(void) -{ -} - -void -route_table_unregister(void) +route_table_init(void) { + ovs_router_init(); } void diff -Nru openvswitch-2.3.1/lib/rstp.c openvswitch-2.4.0~git20150623/lib/rstp.c --- openvswitch-2.3.1/lib/rstp.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rstp.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,1522 @@ +/* + * Copyright (c) 2011-2014 M3S, Srl - Italy + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Rapid Spanning Tree Protocol (IEEE 802.1D-2004) public interface. + * + * Authors: + * Martino Fornasa + * Daniele Venturino + * + * References to IEEE 802.1D-2004 standard are enclosed in square brackets. + * E.g. [17.3], [Table 17-1], etc. + * + */ + +#include + +#include "rstp.h" +#include "rstp-common.h" +#include "rstp-state-machines.h" +#include +#include +#include +#include +#include +#include "byte-order.h" +#include "connectivity.h" +#include "ofpbuf.h" +#include "ofproto/ofproto.h" +#include "dp-packet.h" +#include "packets.h" +#include "seq.h" +#include "unixctl.h" +#include "util.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(rstp); + +struct ovs_mutex rstp_mutex = OVS_MUTEX_INITIALIZER; + +static struct ovs_list all_rstps__ = OVS_LIST_INITIALIZER(&all_rstps__); +static struct ovs_list *const all_rstps OVS_GUARDED_BY(rstp_mutex) = &all_rstps__; + +/* Internal use only. */ +static void rstp_set_bridge_address__(struct rstp *, rstp_identifier) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_priority__(struct rstp *, int new_priority) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_ageing_time__(struct rstp *, int new_ageing_time) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_force_protocol_version__(struct rstp *, + enum rstp_force_protocol_version) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_hello_time__(struct rstp *) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_max_age__(struct rstp *, int new_max_age) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_forward_delay__(struct rstp *, int new_forward_delay) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_transmit_hold_count__(struct rstp *, + int new_transmit_hold_count) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_migrate_time__(struct rstp *) + OVS_REQUIRES(rstp_mutex); +static void rstp_set_bridge_times__(struct rstp *, int new_forward_delay, + int new_hello_time, int new_max_age, + int new_message_age) + OVS_REQUIRES(rstp_mutex); + +static struct rstp_port *rstp_get_port__(struct rstp *rstp, + uint16_t port_number) + OVS_REQUIRES(rstp_mutex); +static void set_port_id__(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static void update_port_enabled__(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static void set_bridge_priority__(struct rstp *) + OVS_REQUIRES(rstp_mutex); +static void reinitialize_rstp__(struct rstp *) + OVS_REQUIRES(rstp_mutex); +static bool is_port_number_available__(struct rstp *, int, struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static uint16_t rstp_first_free_number__(struct rstp *, struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static void rstp_initialize_port_defaults__(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_priority__(struct rstp_port *, int priority) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_port_number__(struct rstp_port *, + uint16_t port_number) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_path_cost__(struct rstp_port *, uint32_t path_cost) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_administrative_bridge_port__(struct rstp_port *, + uint8_t admin_port_state, + bool initializing) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_admin_edge__(struct rstp_port *, bool admin_edge) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_auto_edge__(struct rstp_port *, bool auto_edge) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_admin_point_to_point_mac__(struct rstp_port *, + enum rstp_admin_point_to_point_mac_state admin_p2p_mac_state) + OVS_REQUIRES(rstp_mutex); +static void rstp_port_set_mcheck__(struct rstp_port *, bool mcheck) + OVS_REQUIRES(rstp_mutex); +static void reinitialize_port__(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex); + +const char * +rstp_state_name(enum rstp_state state) +{ + switch (state) { + case RSTP_DISABLED: + return "Disabled"; + case RSTP_LEARNING: + return "Learning"; + case RSTP_FORWARDING: + return "Forwarding"; + case RSTP_DISCARDING: + return "Discarding"; + default: + return "Unknown"; + } +} + +const char * +rstp_port_role_name(enum rstp_port_role role) +{ + switch (role) { + case ROLE_ROOT: + return "Root"; + case ROLE_DESIGNATED: + return "Designated"; + case ROLE_ALTERNATE: + return "Alternate"; + case ROLE_BACKUP: + return "Backup"; + case ROLE_DISABLED: + return "Disabled"; + default: + return "Unknown"; + } +} + +/* Caller has to hold a reference to prevent 'rstp' from being deleted + * while taking a new reference. */ +struct rstp * +rstp_ref(struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + if (rstp) { + ovs_refcount_ref(&rstp->ref_cnt); + } + return rstp; +} + +/* Frees RSTP struct when reference count reaches zero. */ +void +rstp_unref(struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + if (rstp && ovs_refcount_unref_relaxed(&rstp->ref_cnt) == 1) { + ovs_mutex_lock(&rstp_mutex); + + /* Each RSTP port points back to struct rstp without holding a + * reference for that pointer. This is OK as we never move + * ports from one bridge to another, and holders always + * release their ports before releasing the bridge. This + * means that there should be not ports at this time. */ + ovs_assert(hmap_is_empty(&rstp->ports)); + + list_remove(&rstp->node); + ovs_mutex_unlock(&rstp_mutex); + free(rstp->name); + free(rstp); + } +} + +/* Returns the port number. Mutex is needed to guard against + * concurrent reinitialization (which can temporarily clear the + * port_number). */ +int +rstp_port_get_number(const struct rstp_port *p) + OVS_EXCLUDED(rstp_mutex) +{ + int number; + + ovs_mutex_lock(&rstp_mutex); + number = p->port_number; + ovs_mutex_unlock(&rstp_mutex); + + return number; +} + +static void rstp_unixctl_tcn(struct unixctl_conn *, int argc, + const char *argv[], void *aux); + +/* Decrements the State Machines' timers. */ +void +rstp_tick_timers(struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + decrease_rstp_port_timers__(rstp); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Processes an incoming BPDU. */ +void +rstp_port_received_bpdu(struct rstp_port *rp, const void *bpdu, + size_t bpdu_size) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + /* Only process packets on ports that have RSTP enabled. */ + if (rp && rp->rstp_state != RSTP_DISABLED) { + process_received_bpdu__(rp, bpdu, bpdu_size); + } + ovs_mutex_unlock(&rstp_mutex); +} + +void +rstp_init(void) + OVS_EXCLUDED(rstp_mutex) +{ + unixctl_command_register("rstp/tcn", "[bridge]", 0, 1, rstp_unixctl_tcn, + NULL); +} + +/* Creates and returns a new RSTP instance that initially has no ports. */ +struct rstp * +rstp_create(const char *name, rstp_identifier bridge_address, + void (*send_bpdu)(struct dp_packet *bpdu, void *port_aux, + void *rstp_aux), + void *aux) + OVS_EXCLUDED(rstp_mutex) +{ + struct rstp *rstp; + + VLOG_DBG("Creating RSTP instance"); + + rstp = xzalloc(sizeof *rstp); + rstp->name = xstrdup(name); + + /* Initialize the ports map before calling any setters, + * so that the state machines will see an empty ports map. */ + hmap_init(&rstp->ports); + + ovs_mutex_lock(&rstp_mutex); + /* Set bridge address. */ + rstp_set_bridge_address__(rstp, bridge_address); + /* Set default parameters values. */ + rstp_set_bridge_priority__(rstp, RSTP_DEFAULT_PRIORITY); + rstp_set_bridge_ageing_time__(rstp, RSTP_DEFAULT_AGEING_TIME); + rstp_set_bridge_force_protocol_version__(rstp, FPV_DEFAULT); + rstp_set_bridge_forward_delay__(rstp, RSTP_DEFAULT_BRIDGE_FORWARD_DELAY); + rstp_set_bridge_hello_time__(rstp); + rstp_set_bridge_max_age__(rstp, RSTP_DEFAULT_BRIDGE_MAX_AGE); + rstp_set_bridge_migrate_time__(rstp); + rstp_set_bridge_transmit_hold_count__(rstp, + RSTP_DEFAULT_TRANSMIT_HOLD_COUNT); + rstp_set_bridge_times__(rstp, RSTP_DEFAULT_BRIDGE_FORWARD_DELAY, + RSTP_BRIDGE_HELLO_TIME, + RSTP_DEFAULT_BRIDGE_MAX_AGE, 0); + rstp->send_bpdu = send_bpdu; + rstp->aux = aux; + rstp->changes = false; + rstp->begin = true; + + ovs_refcount_init(&rstp->ref_cnt); + + list_push_back(all_rstps, &rstp->node); + ovs_mutex_unlock(&rstp_mutex); + + VLOG_DBG("RSTP instance creation done"); + return rstp; +} + +/* Called by rstp_set_bridge_address() and rstp_set_bridge_priority(), + * it updates the bridge priority vector according to the values passed by + * those setters. + */ +static void +set_bridge_priority__(struct rstp *rstp) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + + rstp->bridge_priority.root_bridge_id = rstp->bridge_identifier; + rstp->bridge_priority.designated_bridge_id = rstp->bridge_identifier; + VLOG_DBG("%s: new bridge identifier: "RSTP_ID_FMT"", rstp->name, + RSTP_ID_ARGS(rstp->bridge_identifier)); + + /* [17.13] When the bridge address changes, recalculates all priority + * vectors. + */ + HMAP_FOR_EACH (p, node, &rstp->ports) { + p->selected = false; + p->reselect = true; + } + rstp->changes = true; + updt_roles_tree__(rstp); +} + +/* Sets the bridge address. */ +static void +rstp_set_bridge_address__(struct rstp *rstp, rstp_identifier bridge_address) + OVS_REQUIRES(rstp_mutex) +{ + VLOG_DBG("%s: set bridge address to: "RSTP_ID_FMT"", rstp->name, + RSTP_ID_ARGS(bridge_address)); + if (rstp->address != bridge_address) { + rstp->address = bridge_address; + rstp->bridge_identifier &= 0xffff000000000000ULL; + rstp->bridge_identifier |= bridge_address; + set_bridge_priority__(rstp); + } +} + +/* Sets the bridge address. */ +void +rstp_set_bridge_address(struct rstp *rstp, rstp_identifier bridge_address) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_set_bridge_address__(rstp, bridge_address); + ovs_mutex_unlock(&rstp_mutex); +} + +const char * +rstp_get_name(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + char *name; + + ovs_mutex_lock(&rstp_mutex); + name = rstp->name; + ovs_mutex_unlock(&rstp_mutex); + return name; +} + +rstp_identifier +rstp_get_bridge_id(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + rstp_identifier bridge_id; + + ovs_mutex_lock(&rstp_mutex); + bridge_id = rstp->bridge_identifier; + ovs_mutex_unlock(&rstp_mutex); + + return bridge_id; +} + +/* Sets the bridge priority. */ +static void +rstp_set_bridge_priority__(struct rstp *rstp, int new_priority) + OVS_REQUIRES(rstp_mutex) +{ + new_priority = ROUND_DOWN(new_priority, RSTP_PRIORITY_STEP); + + if (rstp->priority != new_priority + && new_priority >= RSTP_MIN_PRIORITY + && new_priority <= RSTP_MAX_PRIORITY) { + VLOG_DBG("%s: set bridge priority to %d", rstp->name, new_priority); + + rstp->priority = new_priority; + rstp->bridge_identifier &= 0x0000ffffffffffffULL; + rstp->bridge_identifier |= (uint64_t)new_priority << 48; + set_bridge_priority__(rstp); + } +} + +void +rstp_set_bridge_priority(struct rstp *rstp, int new_priority) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_set_bridge_priority__(rstp, new_priority); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Sets the bridge ageing time. */ +static void +rstp_set_bridge_ageing_time__(struct rstp *rstp, int new_ageing_time) + OVS_REQUIRES(rstp_mutex) +{ + if (new_ageing_time >= RSTP_MIN_AGEING_TIME + && new_ageing_time <= RSTP_MAX_AGEING_TIME) { + VLOG_DBG("%s: set ageing time to %d", rstp->name, new_ageing_time); + + rstp->ageing_time = new_ageing_time; + } +} + +void +rstp_set_bridge_ageing_time(struct rstp *rstp, int new_ageing_time) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_set_bridge_ageing_time__(rstp, new_ageing_time); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Reinitializes RSTP when switching from RSTP mode to STP mode + * or vice versa. + */ +static void +reinitialize_rstp__(struct rstp *rstp) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp temp; + static struct hmap ports; + struct rstp_port *p; + + /* Copy rstp in temp */ + temp = *rstp; + ports = rstp->ports; + + /* stop and clear rstp */ + memset(rstp, 0, sizeof(struct rstp)); + + /* Initialize rstp. */ + rstp->name = temp.name; + + /* Initialize the ports hmap before calling any setters, + * so that the state machines will see an empty ports list. */ + hmap_init(&rstp->ports); + + /* Set bridge address. */ + rstp_set_bridge_address__(rstp, temp.address); + /* Set default parameters values. */ + rstp_set_bridge_priority__(rstp, RSTP_DEFAULT_PRIORITY); + rstp_set_bridge_ageing_time__(rstp, RSTP_DEFAULT_AGEING_TIME); + rstp_set_bridge_forward_delay__(rstp, RSTP_DEFAULT_BRIDGE_FORWARD_DELAY); + rstp_set_bridge_hello_time__(rstp); + rstp_set_bridge_max_age__(rstp, RSTP_DEFAULT_BRIDGE_MAX_AGE); + rstp_set_bridge_migrate_time__(rstp); + rstp_set_bridge_transmit_hold_count__(rstp, + RSTP_DEFAULT_TRANSMIT_HOLD_COUNT); + rstp_set_bridge_times__(rstp, RSTP_DEFAULT_BRIDGE_FORWARD_DELAY, + RSTP_BRIDGE_HELLO_TIME, + RSTP_DEFAULT_BRIDGE_MAX_AGE, 0); + + rstp->send_bpdu = temp.send_bpdu; + rstp->aux = temp.aux; + rstp->node = temp.node; + rstp->changes = false; + rstp->begin = true; + + /* Restore ports. */ + rstp->ports = ports; + + HMAP_FOR_EACH (p, node, &rstp->ports) { + reinitialize_port__(p); + } + + rstp->ref_cnt = temp.ref_cnt; +} + +/* Sets the force protocol version parameter. */ +static void +rstp_set_bridge_force_protocol_version__(struct rstp *rstp, + enum rstp_force_protocol_version new_force_protocol_version) + OVS_REQUIRES(rstp_mutex) +{ + if (new_force_protocol_version != rstp->force_protocol_version && + (new_force_protocol_version == FPV_STP_COMPATIBILITY || + new_force_protocol_version == FPV_DEFAULT)) { + VLOG_DBG("%s: set bridge Force Protocol Version to %d", rstp->name, + new_force_protocol_version); + + /* [17.13] The Spanning Tree Protocol Entity shall be reinitialized, + * as specified by the assertion of BEGIN (17.18.1) in the state + * machine specification. + */ + reinitialize_rstp__(rstp); + rstp->force_protocol_version = new_force_protocol_version; + if (rstp->force_protocol_version < 2) { + rstp->stp_version = true; + rstp->rstp_version = false; + } else { + rstp->stp_version = false; + rstp->rstp_version = true; + } + rstp->changes = true; + move_rstp__(rstp); + } +} + +void +rstp_set_bridge_force_protocol_version(struct rstp *rstp, + enum rstp_force_protocol_version new_force_protocol_version) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_set_bridge_force_protocol_version__(rstp, new_force_protocol_version); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Sets the bridge Hello Time parameter. */ +static void +rstp_set_bridge_hello_time__(struct rstp *rstp) + OVS_REQUIRES(rstp_mutex) +{ + VLOG_DBG("%s: set RSTP Hello Time to %d", rstp->name, + RSTP_BRIDGE_HELLO_TIME); + /* 2 is the only acceptable value. */ + rstp->bridge_hello_time = RSTP_BRIDGE_HELLO_TIME; +} + +/* Sets the bridge max age parameter. */ +static void +rstp_set_bridge_max_age__(struct rstp *rstp, int new_max_age) + OVS_REQUIRES(rstp_mutex) +{ + if (rstp->bridge_max_age != new_max_age + && new_max_age >= RSTP_MIN_BRIDGE_MAX_AGE + && new_max_age <= RSTP_MAX_BRIDGE_MAX_AGE) { + /* [17.13] */ + if ((2 * (rstp->bridge_forward_delay - 1) >= new_max_age) + && (new_max_age >= 2 * rstp->bridge_hello_time)) { + VLOG_DBG("%s: set RSTP bridge Max Age to %d", rstp->name, + new_max_age); + + rstp->bridge_max_age = new_max_age; + rstp->bridge_times.max_age = new_max_age; + rstp->changes = true; + updt_roles_tree__(rstp); + } + } +} + +void +rstp_set_bridge_max_age(struct rstp *rstp, int new_max_age) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_set_bridge_max_age__(rstp, new_max_age); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Sets the bridge forward delay parameter. */ +static void +rstp_set_bridge_forward_delay__(struct rstp *rstp, int new_forward_delay) + OVS_REQUIRES(rstp_mutex) +{ + if (rstp->bridge_forward_delay != new_forward_delay + && new_forward_delay >= RSTP_MIN_BRIDGE_FORWARD_DELAY + && new_forward_delay <= RSTP_MAX_BRIDGE_FORWARD_DELAY) { + if (2 * (new_forward_delay - 1) >= rstp->bridge_max_age) { + VLOG_DBG("%s: set RSTP Forward Delay to %d", rstp->name, + new_forward_delay); + rstp->bridge_forward_delay = new_forward_delay; + rstp->bridge_times.forward_delay = new_forward_delay; + rstp->changes = true; + updt_roles_tree__(rstp); + } + } +} + +void +rstp_set_bridge_forward_delay(struct rstp *rstp, int new_forward_delay) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_set_bridge_forward_delay__(rstp, new_forward_delay); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Sets the bridge transmit hold count parameter. */ +static void +rstp_set_bridge_transmit_hold_count__(struct rstp *rstp, + int new_transmit_hold_count) + OVS_REQUIRES(rstp_mutex) +{ + if (rstp->transmit_hold_count != new_transmit_hold_count + && new_transmit_hold_count >= RSTP_MIN_TRANSMIT_HOLD_COUNT + && new_transmit_hold_count <= RSTP_MAX_TRANSMIT_HOLD_COUNT) { + struct rstp_port *p; + + VLOG_DBG("%s: set RSTP Transmit Hold Count to %d", rstp->name, + new_transmit_hold_count); + /* Resetting txCount on all ports [17.13]. */ + + rstp->transmit_hold_count = new_transmit_hold_count; + HMAP_FOR_EACH (p, node, &rstp->ports) { + p->tx_count = 0; + } + } +} + +void +rstp_set_bridge_transmit_hold_count(struct rstp *rstp, + int new_transmit_hold_count) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_set_bridge_transmit_hold_count__(rstp, new_transmit_hold_count); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Sets the bridge migrate time parameter. */ +static void +rstp_set_bridge_migrate_time__(struct rstp *rstp) + OVS_REQUIRES(rstp_mutex) +{ + VLOG_DBG("%s: set RSTP Migrate Time to %d", rstp->name, + RSTP_MIGRATE_TIME); + /* 3 is the only acceptable value */ + rstp->migrate_time = RSTP_MIGRATE_TIME; +} + +/* Sets the bridge times. */ +static void +rstp_set_bridge_times__(struct rstp *rstp, int new_forward_delay, + int new_hello_time, int new_max_age, + int new_message_age) + OVS_REQUIRES(rstp_mutex) +{ + VLOG_DBG("%s: set RSTP times to (%d, %d, %d, %d)", rstp->name, + new_forward_delay, new_hello_time, new_max_age, new_message_age); + if (new_forward_delay >= RSTP_MIN_BRIDGE_FORWARD_DELAY + && new_forward_delay <= RSTP_MAX_BRIDGE_FORWARD_DELAY) { + rstp->bridge_times.forward_delay = new_forward_delay; + } + if (new_hello_time == RSTP_BRIDGE_HELLO_TIME) { + rstp->bridge_times.hello_time = new_hello_time; + } + if (new_max_age >= RSTP_MIN_BRIDGE_MAX_AGE + && new_max_age <= RSTP_MAX_BRIDGE_MAX_AGE) { + rstp->bridge_times.max_age = new_max_age; + } + rstp->bridge_times.message_age = new_message_age; +} + +/* Sets the port id, it is called by rstp_port_set_port_number__() or + * rstp_port_set_priority__(). + */ +static void +set_port_id__(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *rstp; + + rstp = p->rstp; + /* [9.2.7] Port identifier. */ + p->port_id = p->port_number | (p->priority << 8); + VLOG_DBG("%s: new RSTP port id "RSTP_PORT_ID_FMT"", rstp->name, + p->port_id); +} + +/* Sets the port priority. */ +static void +rstp_port_set_priority__(struct rstp_port *port, int priority) + OVS_REQUIRES(rstp_mutex) +{ + if (port->priority != priority + && priority >= RSTP_MIN_PORT_PRIORITY + && priority <= RSTP_MAX_PORT_PRIORITY) { + VLOG_DBG("%s, port %u: set RSTP port priority to %d", port->rstp->name, + port->port_number, priority); + + priority -= priority % RSTP_STEP_PORT_PRIORITY; + port->priority = priority; + set_port_id__(port); + port->selected = false; + port->reselect = true; + } +} + +/* Checks if a port number is available. */ +static bool +is_port_number_available__(struct rstp *rstp, int n, struct rstp_port *port) + OVS_REQUIRES(rstp_mutex) +{ + if (n >= 1 && n <= RSTP_MAX_PORTS) { + struct rstp_port *p = rstp_get_port__(rstp, n); + + return p == NULL || p == port; + } + return false; +} + +static uint16_t +rstp_first_free_number__(struct rstp *rstp, struct rstp_port *rstp_port) + OVS_REQUIRES(rstp_mutex) +{ + int free_number = 1; + + while (free_number <= RSTP_MAX_PORTS) { + if (is_port_number_available__(rstp, free_number, rstp_port)) { + return free_number; + } + free_number++; + } + VLOG_DBG("%s, No free port number available.", rstp->name); + return 0; +} + +/* Sets the port number. */ +static void +rstp_port_set_port_number__(struct rstp_port *port, uint16_t port_number) + OVS_REQUIRES(rstp_mutex) +{ + int old_port_number = port->port_number; + + /* If new_port_number is available, use it, otherwise use the first free + * available port number. */ + if (port->port_number != port_number || port_number == 0) { + port->port_number = + is_port_number_available__(port->rstp, port_number, port) + ? port_number + : rstp_first_free_number__(port->rstp, port); + + if (port->port_number != old_port_number) { + set_port_id__(port); + /* [17.13] is not clear. I suppose that a port number change + * should trigger reselection like a port priority change. */ + port->selected = false; + port->reselect = true; + + /* Adjust the ports hmap. */ + if (!hmap_node_is_null(&port->node)) { + hmap_remove(&port->rstp->ports, &port->node); + } + hmap_insert(&port->rstp->ports, &port->node, + hash_int(port->port_number, 0)); + + VLOG_DBG("%s: set new RSTP port number %d", port->rstp->name, + port->port_number); + } + } +} + +/* Converts the link speed to a port path cost [Table 17-3]. */ +uint32_t +rstp_convert_speed_to_cost(unsigned int speed) +{ + uint32_t value; + + value = speed >= 10000000 ? 2 /* 10 Tb/s. */ + : speed >= 1000000 ? 20 /* 1 Tb/s. */ + : speed >= 100000 ? 200 /* 100 Gb/s. */ + : speed >= 10000 ? 2000 /* 10 Gb/s. */ + : speed >= 1000 ? 20000 /* 1 Gb/s. */ + : speed >= 100 ? 200000 /* 100 Mb/s. */ + : speed >= 10 ? 2000000 /* 10 Mb/s. */ + : speed >= 1 ? 20000000 /* 1 Mb/s. */ + : RSTP_DEFAULT_PORT_PATH_COST; /* 100 Mb/s. */ + + return value; +} + +/* Sets the port path cost. */ +static void +rstp_port_set_path_cost__(struct rstp_port *port, uint32_t path_cost) + OVS_REQUIRES(rstp_mutex) +{ + if (port->port_path_cost != path_cost + && path_cost >= RSTP_MIN_PORT_PATH_COST + && path_cost <= RSTP_MAX_PORT_PATH_COST) { + VLOG_DBG("%s, port %u, set RSTP port path cost to %d", + port->rstp->name, port->port_number, path_cost); + + port->port_path_cost = path_cost; + port->selected = false; + port->reselect = true; + } +} + +/* Gets the root path cost. */ +uint32_t +rstp_get_root_path_cost(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + uint32_t cost; + + ovs_mutex_lock(&rstp_mutex); + cost = rstp->root_priority.root_path_cost; + ovs_mutex_unlock(&rstp_mutex); + return cost; +} + +/* Finds a port which needs to flush its own MAC learning table. A NULL + * pointer is returned if no port needs to flush its MAC learning table. + * '*port' needs to be NULL in the first call to start the iteration. If + * '*port' is passed as non-NULL, it must be the value set by the last + * invocation of this function. + * + * This function may only be called by the thread that creates and deletes + * ports. Otherwise this function is not thread safe, as the returned + * '*port' could become stale before it is used in the next invocation. */ +void * +rstp_check_and_reset_fdb_flush(struct rstp *rstp, struct rstp_port **port) + OVS_EXCLUDED(rstp_mutex) +{ + void *aux = NULL; + + ovs_mutex_lock(&rstp_mutex); + if (*port == NULL) { + struct rstp_port *p; + + HMAP_FOR_EACH (p, node, &rstp->ports) { + if (p->fdb_flush) { + aux = p->aux; + *port = p; + goto out; + } + } + } else { /* continue */ + struct rstp_port *p = *port; + + HMAP_FOR_EACH_CONTINUE (p, node, &rstp->ports) { + if (p->fdb_flush) { + aux = p->aux; + *port = p; + goto out; + } + } + } + /* No port needs flushing. */ + *port = NULL; +out: + /* fdb_flush should be reset by the filtering database + * once the entries are removed if rstp_version is TRUE, and + * immediately if stp_version is TRUE.*/ + if (*port != NULL) { + (*port)->fdb_flush = false; + } + ovs_mutex_unlock(&rstp_mutex); + + return aux; +} + +/* Finds a port whose state has changed, and returns the aux pointer set for + * the port. A NULL pointer is returned when no changed port is found. On + * return '*portp' contains the pointer to the rstp port that changed, or NULL + * if no changed port can be found. + * + * If '*portp' is passed as non-NULL, it must be the value set by the last + * invocation of this function. + * + * This function may only be called by the thread that creates and deletes + * ports. Otherwise this function is not thread safe, as the returned + * '*portp' could become stale before it is used in the next invocation. */ +void * +rstp_get_next_changed_port_aux(struct rstp *rstp, struct rstp_port **portp) +{ + void *aux = NULL; + + ovs_mutex_lock(&rstp_mutex); + if (*portp == NULL) { + struct rstp_port *p; + + HMAP_FOR_EACH (p, node, &rstp->ports) { + if (p->state_changed) { + p->state_changed = false; + aux = p->aux; + *portp = p; + goto out; + } + } + } else { /* continue */ + struct rstp_port *p = *portp; + + HMAP_FOR_EACH_CONTINUE (p, node, &rstp->ports) { + if (p->state_changed) { + p->state_changed = false; + aux = p->aux; + *portp = p; + goto out; + } + } + } + /* No changed port found. */ + *portp = NULL; +out: + ovs_mutex_unlock(&rstp_mutex); + + return aux; +} + +bool +rstp_shift_root_learned_address(struct rstp *rstp) +{ + bool ret; + + ovs_mutex_lock(&rstp_mutex); + ret = rstp->root_changed; + ovs_mutex_unlock(&rstp_mutex); + + return ret; +} + +void * +rstp_get_old_root_aux(struct rstp *rstp) +{ + void *aux; + + ovs_mutex_lock(&rstp_mutex); + aux = rstp->old_root_aux; + ovs_mutex_unlock(&rstp_mutex); + + return aux; +} + +void * +rstp_get_new_root_aux(struct rstp *rstp) +{ + void *aux; + + ovs_mutex_lock(&rstp_mutex); + aux = rstp->new_root_aux; + ovs_mutex_unlock(&rstp_mutex); + + return aux; +} + +void +rstp_reset_root_changed(struct rstp *rstp) +{ + ovs_mutex_lock(&rstp_mutex); + rstp->root_changed = false; + ovs_mutex_unlock(&rstp_mutex); +} + +/* Returns the port in 'rstp' with number 'port_number'. + * + * XXX: May only be called while concurrent deletion of ports is excluded. */ +static struct rstp_port * +rstp_get_port__(struct rstp *rstp, uint16_t port_number) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *port; + + ovs_assert(rstp && port_number > 0 && port_number <= RSTP_MAX_PORTS); + + HMAP_FOR_EACH_WITH_HASH (port, node, hash_int(port_number, 0), + &rstp->ports) { + if (port->port_number == port_number) { + return port; + } + } + return NULL; +} + +struct rstp_port * +rstp_get_port(struct rstp *rstp, uint16_t port_number) + OVS_EXCLUDED(rstp_mutex) +{ + struct rstp_port *p; + + ovs_mutex_lock(&rstp_mutex); + p = rstp_get_port__(rstp, port_number); + ovs_mutex_unlock(&rstp_mutex); + return p; +} + +void * +rstp_get_port_aux__(struct rstp *rstp, uint16_t port_number) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + p = rstp_get_port__(rstp, port_number); + if (p) { + return p->aux; + } + return NULL; +} + +/* Updates the port_enabled parameter. */ +static void +update_port_enabled__(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + if (p->mac_operational && p->is_administrative_bridge_port + == RSTP_ADMIN_BRIDGE_PORT_STATE_ENABLED) { + p->port_enabled = true; + } else { + p->port_enabled = false; + } +} + +/* Sets the port MAC_Operational parameter [6.4.2]. */ +void +rstp_port_set_mac_operational(struct rstp_port *p, bool new_mac_operational) + OVS_EXCLUDED(rstp_mutex) +{ + struct rstp *rstp; + + ovs_mutex_lock(&rstp_mutex); + rstp = p->rstp; + if (p->mac_operational != new_mac_operational) { + p->mac_operational = new_mac_operational; + update_port_enabled__(p); + rstp->changes = true; + move_rstp__(rstp); + } + ovs_mutex_unlock(&rstp_mutex); +} + +/* Sets the port Administrative Bridge Port parameter. */ +static void +rstp_port_set_administrative_bridge_port__(struct rstp_port *p, + uint8_t admin_port_state, + bool initializing) + OVS_REQUIRES(rstp_mutex) +{ + VLOG_DBG("%s, port %u: set RSTP port admin-port-state to %d", + p->rstp->name, p->port_number, admin_port_state); + + if (p->is_administrative_bridge_port != admin_port_state + && (admin_port_state == RSTP_ADMIN_BRIDGE_PORT_STATE_DISABLED + || admin_port_state == RSTP_ADMIN_BRIDGE_PORT_STATE_ENABLED)) { + p->is_administrative_bridge_port = admin_port_state; + update_port_enabled__(p); + + if (!initializing) { + struct rstp *rstp = p->rstp; + + rstp->changes = true; + move_rstp__(rstp); + } + } +} + +/* Sets the port oper_point_to_point_mac parameter. */ +static void +rstp_port_set_oper_point_to_point_mac__(struct rstp_port *p, + uint8_t new_oper_p2p_mac) + OVS_REQUIRES(rstp_mutex) +{ + if (p->oper_point_to_point_mac != new_oper_p2p_mac + && (new_oper_p2p_mac == RSTP_OPER_P2P_MAC_STATE_DISABLED + || new_oper_p2p_mac == RSTP_OPER_P2P_MAC_STATE_ENABLED)) { + + p->oper_point_to_point_mac = new_oper_p2p_mac; + update_port_enabled__(p); + } +} + +/* Initializes a port with the defaults values for its parameters. */ +static void +rstp_initialize_port_defaults__(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + rstp_port_set_administrative_bridge_port__(p, + RSTP_ADMIN_BRIDGE_PORT_STATE_ENABLED, + true); + rstp_port_set_oper_point_to_point_mac__(p, + RSTP_OPER_P2P_MAC_STATE_ENABLED); + rstp_port_set_path_cost__(p, RSTP_DEFAULT_PORT_PATH_COST); + rstp_port_set_admin_edge__(p, false); + rstp_port_set_auto_edge__(p, true); + rstp_port_set_mcheck__(p, false); + + /* Initialize state machines. */ + p->port_receive_sm_state = PORT_RECEIVE_SM_INIT; + p->port_protocol_migration_sm_state = PORT_PROTOCOL_MIGRATION_SM_INIT; + p->bridge_detection_sm_state = BRIDGE_DETECTION_SM_INIT; + p->port_transmit_sm_state = PORT_TRANSMIT_SM_INIT; + p->port_information_sm_state = PORT_INFORMATION_SM_INIT; + p->port_role_transition_sm_state = PORT_ROLE_TRANSITION_SM_INIT; + p->port_state_transition_sm_state = PORT_STATE_TRANSITION_SM_INIT; + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_INIT; + p->uptime = 0; + +} + +static void +reinitialize_port__(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port temp_port; + struct rstp *rstp; + + rstp = p->rstp; + temp_port = *p; + memset(p, 0, sizeof(struct rstp_port)); + + p->ref_cnt = temp_port.ref_cnt; + p->rstp = rstp; + p->node = temp_port.node; + p->aux = temp_port.aux; + p->port_number = temp_port.port_number; + p->port_priority = temp_port.port_priority; + p->port_id = temp_port.port_id; + p->rstp_state = RSTP_DISCARDING; + + rstp_initialize_port_defaults__(p); + + VLOG_DBG("%s: RSTP port "RSTP_PORT_ID_FMT" reinitialized.", rstp->name, + p->port_id); +} + +void +reinitialize_port(struct rstp_port *p) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + reinitialize_port__(p); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Sets the port state. */ +void +rstp_port_set_state__(struct rstp_port *p, enum rstp_state state) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *rstp; + + rstp = p->rstp; + VLOG_DBG("%s, port %u: set RSTP port state %s -> %s", rstp->name, + p->port_number, + rstp_state_name(p->rstp_state), rstp_state_name(state)); + + if (state != p->rstp_state && !p->state_changed) { + p->state_changed = true; + seq_change(connectivity_seq_get()); + } + p->rstp_state = state; +} + +void +rstp_port_set_state(struct rstp_port *p, enum rstp_state state) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_port_set_state__(p, state); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Adds a RSTP port. */ +struct rstp_port * +rstp_add_port(struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + struct rstp_port *p = xzalloc(sizeof *p); + + ovs_refcount_init(&p->ref_cnt); + hmap_node_nullify(&p->node); + + ovs_mutex_lock(&rstp_mutex); + p->rstp = rstp; + rstp_port_set_priority__(p, RSTP_DEFAULT_PORT_PRIORITY); + rstp_port_set_port_number__(p, 0); + p->aux = NULL; + rstp_initialize_port_defaults__(p); + VLOG_DBG("%s: RSTP port "RSTP_PORT_ID_FMT" initialized.", rstp->name, + p->port_id); + + rstp_port_set_state__(p, RSTP_DISCARDING); + rstp->changes = true; + move_rstp__(rstp); + VLOG_DBG("%s: added port "RSTP_PORT_ID_FMT"", rstp->name, p->port_id); + ovs_mutex_unlock(&rstp_mutex); + return p; +} + +/* Caller has to hold a reference to prevent 'rstp_port' from being deleted + * while taking a new reference. */ +struct rstp_port * +rstp_port_ref(const struct rstp_port *rp_) + OVS_EXCLUDED(rstp_mutex) +{ + struct rstp_port *rp = CONST_CAST(struct rstp_port *, rp_); + + if (rp) { + ovs_refcount_ref(&rp->ref_cnt); + } + return rp; +} + +/* Frees RSTP struct. This can be caller by any thread. */ +void +rstp_port_unref(struct rstp_port *rp) + OVS_EXCLUDED(rstp_mutex) +{ + if (rp && ovs_refcount_unref_relaxed(&rp->ref_cnt) == 1) { + struct rstp *rstp; + + ovs_mutex_lock(&rstp_mutex); + rstp = rp->rstp; + rstp_port_set_state__(rp, RSTP_DISABLED); + hmap_remove(&rstp->ports, &rp->node); + VLOG_DBG("%s: removed port "RSTP_PORT_ID_FMT"", rstp->name, + rp->port_id); + ovs_mutex_unlock(&rstp_mutex); + free(rp); + } +} + +/* Sets the port Admin Edge parameter. */ +static void +rstp_port_set_admin_edge__(struct rstp_port *port, bool admin_edge) + OVS_REQUIRES(rstp_mutex) +{ + if (port->admin_edge != admin_edge) { + VLOG_DBG("%s, port %u: set RSTP Admin Edge to %d", port->rstp->name, + port->port_number, admin_edge); + + port->admin_edge = admin_edge; + } +} + +/* Sets the port Auto Edge parameter. */ +static void +rstp_port_set_auto_edge__(struct rstp_port *port, bool auto_edge) + OVS_REQUIRES(rstp_mutex) +{ + if (port->auto_edge != auto_edge) { + VLOG_DBG("%s, port %u: set RSTP Auto Edge to %d", port->rstp->name, + port->port_number, auto_edge); + + port->auto_edge = auto_edge; + } +} + +/* Sets the port admin_point_to_point_mac parameter. */ +static void rstp_port_set_admin_point_to_point_mac__(struct rstp_port *port, + enum rstp_admin_point_to_point_mac_state admin_p2p_mac_state) + OVS_REQUIRES(rstp_mutex) +{ + VLOG_DBG("%s, port %u: set RSTP port admin-point-to-point-mac to %d", + port->rstp->name, port->port_number, admin_p2p_mac_state); + if (port->admin_point_to_point_mac != admin_p2p_mac_state) { + if (admin_p2p_mac_state == RSTP_ADMIN_P2P_MAC_FORCE_TRUE) { + port->admin_point_to_point_mac = admin_p2p_mac_state; + rstp_port_set_oper_point_to_point_mac__( + port, RSTP_OPER_P2P_MAC_STATE_ENABLED); + } else if (admin_p2p_mac_state == RSTP_ADMIN_P2P_MAC_FORCE_FALSE) { + port->admin_point_to_point_mac = admin_p2p_mac_state; + rstp_port_set_oper_point_to_point_mac__( + port, RSTP_OPER_P2P_MAC_STATE_DISABLED); + } else if (admin_p2p_mac_state == RSTP_ADMIN_P2P_MAC_AUTO) { + /* If adminPointToPointMAC is set to Auto, then the value of + * operPointToPointMAC is determined in accordance with the + * specific procedures defined for the MAC entity concerned, as + * defined in 6.5. If these procedures determine that the MAC + * entity is connected to a point-to-point LAN, then + * operPointToPointMAC is set TRUE; otherwise it is set FALSE. + * In the absence of a specific definition of how to determine + * whether the MAC is connected to a point-to-point LAN or not, + * the value of operPointToPointMAC shall be FALSE. */ + port->admin_point_to_point_mac = admin_p2p_mac_state; + rstp_port_set_oper_point_to_point_mac__( + port, RSTP_OPER_P2P_MAC_STATE_DISABLED); + } + } +} + +/* Sets the port mcheck parameter. + * [17.19.13] May be set by management to force the Port Protocol Migration + * state machine to transmit RST BPDUs for a MigrateTime (17.13.9) period, to + * test whether all STP Bridges (17.4) on the attached LAN have been removed + * and the Port can continue to transmit RSTP BPDUs. Setting mcheck has no + * effect if stpVersion (17.20.12) is TRUE, i.e., the Bridge is operating in + * STP Compatibility mode. + */ +static void +rstp_port_set_mcheck__(struct rstp_port *port, bool mcheck) + OVS_REQUIRES(rstp_mutex) +{ + if (mcheck == true && port->rstp->force_protocol_version >= 2) { + port->mcheck = true; + + VLOG_DBG("%s, port %u: set RSTP mcheck to %d", port->rstp->name, + port->port_number, mcheck); + } +} + +/* Returns the designated bridge id. */ +rstp_identifier +rstp_get_designated_id(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + rstp_identifier designated_id; + + ovs_mutex_lock(&rstp_mutex); + designated_id = rstp->root_priority.designated_bridge_id; + ovs_mutex_unlock(&rstp_mutex); + + return designated_id; +} + +/* Returns the root bridge id. */ +rstp_identifier +rstp_get_root_id(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + rstp_identifier root_id; + + ovs_mutex_lock(&rstp_mutex); + root_id = rstp->root_priority.root_bridge_id; + ovs_mutex_unlock(&rstp_mutex); + + return root_id; +} + +/* Returns the designated port id. */ +uint16_t +rstp_get_designated_port_id(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + uint16_t designated_port_id; + + ovs_mutex_lock(&rstp_mutex); + designated_port_id = rstp->root_priority.designated_port_id; + ovs_mutex_unlock(&rstp_mutex); + + return designated_port_id; +} + +/* Return the bridge port id. */ +uint16_t +rstp_get_bridge_port_id(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + uint16_t bridge_port_id; + + ovs_mutex_lock(&rstp_mutex); + bridge_port_id = rstp->root_priority.bridge_port_id; + ovs_mutex_unlock(&rstp_mutex); + + return bridge_port_id; +} + +/* Returns true if the bridge believes to the be root of the spanning tree, + * false otherwise. + */ +bool +rstp_is_root_bridge(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + bool is_root; + + ovs_mutex_lock(&rstp_mutex); + is_root = rstp->bridge_identifier == + rstp->root_priority.designated_bridge_id; + ovs_mutex_unlock(&rstp_mutex); + + return is_root; +} + +/* Returns the bridge ID of the bridge currently believed to be the root. */ +rstp_identifier +rstp_get_designated_root(const struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + rstp_identifier designated_root; + + ovs_mutex_lock(&rstp_mutex); + designated_root = rstp->root_priority.designated_bridge_id; + ovs_mutex_unlock(&rstp_mutex); + + return designated_root; +} + +/* Returns the port connecting 'rstp' to the root bridge, or a null pointer if + * there is no such port. + */ +struct rstp_port * +rstp_get_root_port(struct rstp *rstp) + OVS_EXCLUDED(rstp_mutex) +{ + struct rstp_port *p; + + ovs_mutex_lock(&rstp_mutex); + HMAP_FOR_EACH (p, node, &rstp->ports) { + if (p->port_id == rstp->root_port_id) { + ovs_mutex_unlock(&rstp_mutex); + return p; + } + } + ovs_mutex_unlock(&rstp_mutex); + return NULL; +} + +/* Returns the state of port 'p'. */ +enum rstp_state +rstp_port_get_state(const struct rstp_port *p) + OVS_EXCLUDED(rstp_mutex) +{ + enum rstp_state state; + + ovs_mutex_lock(&rstp_mutex); + state = p->rstp_state; + ovs_mutex_unlock(&rstp_mutex); + + return state; +} + +/* Retrieves port status. */ +void +rstp_port_get_status(const struct rstp_port *p, uint16_t *id, + enum rstp_state *state, enum rstp_port_role *role, + rstp_identifier *designated_bridge_id, + uint16_t *designated_port_id, + uint32_t *designated_path_cost, int *tx_count, + int *rx_count, int *error_count, int *uptime) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + *id = p->port_id; + *state = p->rstp_state; + *role = p->role; + + *designated_bridge_id = p->port_priority.designated_bridge_id; + *designated_port_id = p->port_priority.designated_port_id; + *designated_path_cost = p->port_priority.root_path_cost; + + *tx_count = p->tx_count; + *rx_count = p->rx_rstp_bpdu_cnt; + *error_count = p->error_count; + *uptime = p->uptime; + ovs_mutex_unlock(&rstp_mutex); +} + +void +rstp_port_set(struct rstp_port *port, uint16_t port_num, int priority, + uint32_t path_cost, bool is_admin_edge, bool is_auto_edge, + enum rstp_admin_point_to_point_mac_state admin_p2p_mac_state, + bool admin_port_state, bool do_mcheck, void *aux) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + port->aux = aux; + rstp_port_set_priority__(port, priority); + rstp_port_set_port_number__(port, port_num); + rstp_port_set_path_cost__(port, path_cost); + rstp_port_set_admin_edge__(port, is_admin_edge); + rstp_port_set_auto_edge__(port, is_auto_edge); + rstp_port_set_admin_point_to_point_mac__(port, admin_p2p_mac_state); + rstp_port_set_administrative_bridge_port__(port, admin_port_state, false); + rstp_port_set_mcheck__(port, do_mcheck); + ovs_mutex_unlock(&rstp_mutex); +} + +/* Individual setters only used by test-rstp.c. */ +void +rstp_port_set_priority(struct rstp_port *port, int priority) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_port_set_priority__(port, priority); + ovs_mutex_unlock(&rstp_mutex); +} + +void +rstp_port_set_path_cost(struct rstp_port *port, uint32_t path_cost) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + rstp_port_set_path_cost__(port, path_cost); + ovs_mutex_unlock(&rstp_mutex); +} + +void +rstp_port_set_aux(struct rstp_port *port, void *aux) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + port->aux = aux; + ovs_mutex_unlock(&rstp_mutex); +} + +/* Unixctl. */ +static struct rstp * +rstp_find(const char *name) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *rstp; + + LIST_FOR_EACH (rstp, node, all_rstps) { + if (!strcmp(rstp->name, name)) { + return rstp; + } + } + return NULL; +} + +static void +rstp_unixctl_tcn(struct unixctl_conn *conn, int argc, + const char *argv[], void *aux OVS_UNUSED) + OVS_EXCLUDED(rstp_mutex) +{ + ovs_mutex_lock(&rstp_mutex); + if (argc > 1) { + struct rstp *rstp = rstp_find(argv[1]); + if (!rstp) { + unixctl_command_reply_error(conn, "No such RSTP object"); + goto out; + } + rstp->changes = true; + move_rstp__(rstp); + } else { + struct rstp *rstp; + LIST_FOR_EACH (rstp, node, all_rstps) { + rstp->changes = true; + move_rstp__(rstp); + } + } + unixctl_command_reply(conn, "OK"); + +out: + ovs_mutex_unlock(&rstp_mutex); +} diff -Nru openvswitch-2.3.1/lib/rstp-common.h openvswitch-2.4.0~git20150623/lib/rstp-common.h --- openvswitch-2.3.1/lib/rstp-common.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rstp-common.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,877 @@ +/* + * Copyright (c) 2011-2014 M3S, Srl - Italy + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Rapid Spanning Tree Protocol (IEEE 802.1D-2004) common header file. + * + * Authors: + * Martino Fornasa + * Daniele Venturino + * + * References to IEEE 802.1D-2004 standard are enclosed in square brackets. + * E.g. [17.3], [Table 17-1], etc. + * + */ + +#ifndef RSTP_COMMON_H +#define RSTP_COMMON_H 1 + +#include "rstp.h" +#include +#include +#include "hmap.h" +#include "list.h" +#include "ovs-atomic.h" +#include "packets.h" + +enum admin_port_state { + RSTP_ADMIN_BRIDGE_PORT_STATE_DISABLED = 0, + RSTP_ADMIN_BRIDGE_PORT_STATE_ENABLED = 1 +}; + +enum oper_p2p_mac_state { + RSTP_OPER_P2P_MAC_STATE_DISABLED = 0, + RSTP_OPER_P2P_MAC_STATE_ENABLED = 1 +}; + +/* State enumerations for state machines defined in rstp-state-machines.c */ +enum port_receive_state_machine { + PORT_RECEIVE_SM_INIT, + PORT_RECEIVE_SM_DISCARD_EXEC, + PORT_RECEIVE_SM_DISCARD, + PORT_RECEIVE_SM_RECEIVE_EXEC, + PORT_RECEIVE_SM_RECEIVE +}; +enum port_transmit_state_machine { + PORT_TRANSMIT_SM_INIT, + PORT_TRANSMIT_SM_TRANSMIT_INIT_EXEC, + PORT_TRANSMIT_SM_TRANSMIT_INIT, + PORT_TRANSMIT_SM_TRANSMIT_PERIODIC_EXEC, + PORT_TRANSMIT_SM_TRANSMIT_PERIODIC, + PORT_TRANSMIT_SM_IDLE_EXEC, + PORT_TRANSMIT_SM_IDLE, + PORT_TRANSMIT_SM_TRANSMIT_CONFIG_EXEC, + PORT_TRANSMIT_SM_TRANSMIT_CONFIG, + PORT_TRANSMIT_SM_TRANSMIT_TCN_EXEC, + PORT_TRANSMIT_SM_TRANSMIT_TCN, + PORT_TRANSMIT_SM_TRANSMIT_RSTP_EXEC, + PORT_TRANSMIT_SM_TRANSMIT_RSTP +}; +enum bridge_detection_state_machine { + BRIDGE_DETECTION_SM_INIT, + BRIDGE_DETECTION_SM_EDGE_EXEC, + BRIDGE_DETECTION_SM_EDGE, + BRIDGE_DETECTION_SM_NOT_EDGE_EXEC, + BRIDGE_DETECTION_SM_NOT_EDGE +}; +enum port_protocol_migration_state_machine { + PORT_PROTOCOL_MIGRATION_SM_INIT, + PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP_EXEC, + PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP, + PORT_PROTOCOL_MIGRATION_SM_SELECTING_STP_EXEC, + PORT_PROTOCOL_MIGRATION_SM_SELECTING_STP, + PORT_PROTOCOL_MIGRATION_SM_SENSING_EXEC, + PORT_PROTOCOL_MIGRATION_SM_SENSING +}; +enum port_information_state_machine { + PORT_INFORMATION_SM_INIT, + PORT_INFORMATION_SM_DISABLED_EXEC, + PORT_INFORMATION_SM_DISABLED, + PORT_INFORMATION_SM_AGED_EXEC, + PORT_INFORMATION_SM_AGED, + PORT_INFORMATION_SM_UPDATE_EXEC, + PORT_INFORMATION_SM_UPDATE, + PORT_INFORMATION_SM_CURRENT_EXEC, + PORT_INFORMATION_SM_CURRENT, + PORT_INFORMATION_SM_RECEIVE_EXEC, + PORT_INFORMATION_SM_RECEIVE, + PORT_INFORMATION_SM_OTHER_EXEC, + PORT_INFORMATION_SM_OTHER, + PORT_INFORMATION_SM_NOT_DESIGNATED_EXEC, + PORT_INFORMATION_SM_NOT_DESIGNATED, + PORT_INFORMATION_SM_INFERIOR_DESIGNATED_EXEC, + PORT_INFORMATION_SM_INFERIOR_DESIGNATED, + PORT_INFORMATION_SM_REPEATED_DESIGNATED_EXEC, + PORT_INFORMATION_SM_REPEATED_DESIGNATED, + PORT_INFORMATION_SM_SUPERIOR_DESIGNATED_EXEC, + PORT_INFORMATION_SM_SUPERIOR_DESIGNATED +}; +enum port_role_selection_state_machine { + PORT_ROLE_SELECTION_SM_INIT, + PORT_ROLE_SELECTION_SM_INIT_BRIDGE_EXEC, + PORT_ROLE_SELECTION_SM_INIT_BRIDGE, + PORT_ROLE_SELECTION_SM_ROLE_SELECTION_EXEC, + PORT_ROLE_SELECTION_SM_ROLE_SELECTION +}; +enum port_role_transition_state_machine { + PORT_ROLE_TRANSITION_SM_INIT, + PORT_ROLE_TRANSITION_SM_INIT_PORT_EXEC, + PORT_ROLE_TRANSITION_SM_DISABLE_PORT_EXEC, + PORT_ROLE_TRANSITION_SM_DISABLE_PORT, + PORT_ROLE_TRANSITION_SM_DISABLED_PORT_EXEC, + PORT_ROLE_TRANSITION_SM_DISABLED_PORT, + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC, + PORT_ROLE_TRANSITION_SM_ROOT_PORT, + PORT_ROLE_TRANSITION_SM_REROOT_EXEC, + PORT_ROLE_TRANSITION_SM_ROOT_AGREED_EXEC, + PORT_ROLE_TRANSITION_SM_ROOT_PROPOSED_EXEC, + PORT_ROLE_TRANSITION_SM_ROOT_FORWARD_EXEC, + PORT_ROLE_TRANSITION_SM_ROOT_LEARN_EXEC, + PORT_ROLE_TRANSITION_SM_REROOTED_EXEC, + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC, + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT, + PORT_ROLE_TRANSITION_SM_DESIGNATED_RETIRED_EXEC, + PORT_ROLE_TRANSITION_SM_DESIGNATED_SYNCED_EXEC, + PORT_ROLE_TRANSITION_SM_DESIGNATED_PROPOSE_EXEC, + PORT_ROLE_TRANSITION_SM_DESIGNATED_FORWARD_EXEC, + PORT_ROLE_TRANSITION_SM_DESIGNATED_LEARN_EXEC, + PORT_ROLE_TRANSITION_SM_DESIGNATED_DISCARD_EXEC, + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC, + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT, + PORT_ROLE_TRANSITION_SM_ALTERNATE_AGREED_EXEC, + PORT_ROLE_TRANSITION_SM_ALTERNATE_PROPOSED_EXEC, + PORT_ROLE_TRANSITION_SM_BLOCK_PORT_EXEC, + PORT_ROLE_TRANSITION_SM_BLOCK_PORT, + PORT_ROLE_TRANSITION_SM_BACKUP_PORT_EXEC +}; +enum port_state_transition_state_machine { + PORT_STATE_TRANSITION_SM_INIT, + PORT_STATE_TRANSITION_SM_DISCARDING_EXEC, + PORT_STATE_TRANSITION_SM_DISCARDING, + PORT_STATE_TRANSITION_SM_LEARNING_EXEC, + PORT_STATE_TRANSITION_SM_LEARNING, + PORT_STATE_TRANSITION_SM_FORWARDING_EXEC, + PORT_STATE_TRANSITION_SM_FORWARDING +}; +enum topology_change_state_machine { + TOPOLOGY_CHANGE_SM_INIT, + TOPOLOGY_CHANGE_SM_INACTIVE_EXEC, + TOPOLOGY_CHANGE_SM_INACTIVE, + TOPOLOGY_CHANGE_SM_LEARNING_EXEC, + TOPOLOGY_CHANGE_SM_LEARNING, + TOPOLOGY_CHANGE_SM_DETECTED_EXEC, + TOPOLOGY_CHANGE_SM_ACTIVE_EXEC, + TOPOLOGY_CHANGE_SM_ACTIVE, + TOPOLOGY_CHANGE_SM_ACKNOWLEDGED_EXEC, + TOPOLOGY_CHANGE_SM_PROPAGATING_EXEC, + TOPOLOGY_CHANGE_SM_NOTIFIED_TC_EXEC, + TOPOLOGY_CHANGE_SM_NOTIFIED_TCN_EXEC, +}; + + +/* [17.18.4, 17.13, Table 17-1]. */ +struct rstp_times { + /* [17.13.5 - Bridge Forward Delay] The delay (expressed in seconds) used + * by STP Bridges (17.4) to transition Root and Designated Ports to + * Forwarding (Table 17-1). + * Default = 15.0 s. Values in range 4.0 - 30.0 + */ + uint16_t forward_delay; + + /* [17.13.6 - Bridge Hello Time] + * The interval between periodic transmissions of Configuration Messages + * by Designated Ports (Table 17-1). + * Default = 2.0 s. Fixed value + */ + uint16_t hello_time; + + /* [17.13.8 - Bridge Max Age] + * The maximum age of the information transmitted by the Bridge when it is + * the Root Bridge (Table 17-1). + * Default = 20.0 s. Values in range 6.0 - 40.0 */ + uint16_t max_age; + + uint16_t message_age; +}; + +/* Priority vector [17.6] */ +struct rstp_priority_vector { + rstp_identifier root_bridge_id; + uint32_t root_path_cost; + rstp_identifier designated_bridge_id; + uint16_t designated_port_id; + uint16_t bridge_port_id; +}; + +enum rstp_bpdu_type { + CONFIGURATION_BPDU = 0x0, + TOPOLOGY_CHANGE_NOTIFICATION_BPDU = 0x80, + RAPID_SPANNING_TREE_BPDU = 0x2 +}; + +enum rstp_bpdu_flag { + BPDU_FLAG_TOPCHANGE = 0x01, + BPDU_FLAG_PROPOSAL = 0x02, + BPDU_FLAG_LEARNING = 0x10, + BPDU_FLAG_FORWARDING = 0x20, + BPDU_FLAG_AGREEMENT = 0x40, + BPDU_FLAG_TOPCHANGEACK = 0x80 +}; + +/* Rapid Spanning Tree BPDU [9.3.3] */ +OVS_PACKED( +struct rstp_bpdu { + ovs_be16 protocol_identifier; + uint8_t protocol_version_identifier; + uint8_t bpdu_type; + uint8_t flags; + ovs_be64 root_bridge_id; + ovs_be32 root_path_cost; + ovs_be64 designated_bridge_id; + ovs_be16 designated_port_id; + ovs_be16 message_age; + ovs_be16 max_age; + ovs_be16 hello_time; + ovs_be16 forward_delay; + uint8_t version1_length; + uint8_t padding[7]; +}); + +enum rstp_info_is { + INFO_IS_DISABLED, + INFO_IS_RECEIVED, + INFO_IS_AGED, + INFO_IS_MINE +}; + +enum rstp_rcvd_info { + SUPERIOR_DESIGNATED_INFO, + REPEATED_DESIGNATED_INFO, + INFERIOR_DESIGNATED_INFO, + INFERIOR_ROOT_ALTERNATE_INFO, + OTHER_INFO +}; + +struct rstp_port { + struct ovs_refcount ref_cnt; + + struct rstp *rstp OVS_GUARDED_BY(rstp_mutex); + struct hmap_node node OVS_GUARDED_BY(rstp_mutex); /* In rstp->ports. */ + void *aux OVS_GUARDED_BY(rstp_mutex); + struct rstp_bpdu received_bpdu_buffer OVS_GUARDED_BY(rstp_mutex); + /************************************************************************* + * MAC status parameters + ************************************************************************/ + /* [6.4.2 - MAC_Operational] + * The value of this parameter is TRUE if [...] the MAC entity can be used + * to transmit and/or receive frames, and its use is permitted by + * management. + */ + bool mac_operational OVS_GUARDED_BY(rstp_mutex); + + /* [14.8.2.2] Administrative Bridge Port State */ + bool is_administrative_bridge_port OVS_GUARDED_BY(rstp_mutex); + + /* [6.4.3 - operPointToPointMAC] + * a) True. The MAC is connected to a point-to-point LAN; i.e., there is + * at most one other system attached to the LAN. + * b) False. The MAC is connected to a non-point-to-point LAN; i.e., + * there can be more than one other system attached to the LAN. + * + * If adminPointToPointMAC is set to ForceTrue, then operPointToPointMAC + * shall be set True. If adminPointToPointMAC is set to ForceFalse, then + * operPointToPointMAC shall be set False. + */ + bool oper_point_to_point_mac OVS_GUARDED_BY(rstp_mutex); + + /* [6.4.3 - adminPointToPointMAC] + * a) ForceTrue. The administrator requires the MAC to be treated as if it + * is connected to a point-to-point LAN, regardless of any indications + * to the contrary that are generated by the MAC entity. + * b) ForceFalse. The administrator requires the MAC to be treated as + * connected to a non-point-to-point LAN, regardless of any indications + * to the contrary that are generated by the MAC entity. + * c) Auto. The administrator requires the point-to-point status of the + * MAC to be determined in accordance with the specific MAC procedures + * defined in 6.5. + */ + enum rstp_admin_point_to_point_mac_state admin_point_to_point_mac OVS_GUARDED_BY(rstp_mutex); + + + /************************************************************************* + * [17.3 - RSTP performance parameters] Set by management actions on the + * bridge + *************************************************************************/ + + /* [17.13.1 - Admin Edge Port] + * The AdminEdgePort parameter for the Port (14.8.2). + */ + bool admin_edge OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.3 - AutoEdge] + * The AutoEdgePort parameter for the Port (14.8.2). + */ + bool auto_edge OVS_GUARDED_BY(rstp_mutex); + + + /************************************************************************* + * The following variables are set by management actions on the bridge + ************************************************************************/ + + /* Port number and priority + * >=1 (max 12 bits [9.2.7]) + */ + uint16_t port_number OVS_GUARDED_BY(rstp_mutex); + + /* Port priority + * Range: 0-240 in steps of 16 (table 17-2) + */ + uint8_t priority OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.11 - PortPathCost] + * The Port's contribution, when it is the Root Port, to the Root Path Cost + * (17.3.1, 17.5, 17.6) for the Bridge. + */ + uint32_t port_path_cost OVS_GUARDED_BY(rstp_mutex); + + /************************************************************************* + * The following variables are defined in [17.17 - State machine timers] + ************************************************************************/ + /* [17.17.1 - edgeDelayWhile] + * The Edge Delay timer. The time remaining, in the absence of a received + * BPDU, before this port is identified as an operEdgePort. + */ + uint16_t edge_delay_while OVS_GUARDED_BY(rstp_mutex); + + /* [17.17.2 - fdWhile] + * The Forward Delay timer. Used to delay Port State transitions until + * other Bridges have received spanning tree information. + */ + uint16_t fd_while OVS_GUARDED_BY(rstp_mutex); + + /* [17.17.3 - helloWhen] + * The Hello timer. Used to ensure that at least one BPDU is transmitted by + * a Designated Port in each HelloTime period. + */ + uint16_t hello_when OVS_GUARDED_BY(rstp_mutex); + + /* [17.17.4 - mdelayWhile] + * The Migration Delay timer. Used by the Port Protocol Migration state + * machine to allow time for another RSTP Bridge on the same LAN to + * synchronize its migration state with this Port before the receipt of a + * BPDU can cause this Port to change the BPDU types it transmits. + * Initialized to MigrateTime (17.13.9). + */ + uint16_t mdelay_while OVS_GUARDED_BY(rstp_mutex); + + /* [17.17.5 - rbWhile] + * The Recent Backup timer. Maintained at its initial value, twice + * HelloTime, while the Port is a Backup Port. + */ + uint16_t rb_while OVS_GUARDED_BY(rstp_mutex); + + /* [17.17.6 - rcvdInfoWhile] + * The Received Info timer. The time remaining before the spanning tree + * information received by this Port [portPriority (17.19.21) and portTimes + * (17.19.22)] is aged out if not refreshed by the receipt of a further + * Configuration Message. + */ + uint16_t rcvd_info_while OVS_GUARDED_BY(rstp_mutex); + + /* [17.17.7 - rrWhile] + * The Recent Root timer. + */ + uint16_t rr_while OVS_GUARDED_BY(rstp_mutex); + + /* [17.17.8 - tcWhile] + * The Topology Change timer. TCN Messages are sent while this timer is + * running. + */ + uint16_t tc_while OVS_GUARDED_BY(rstp_mutex); + + + /************************************************************************* + * The following variables are defined in [17.19 - Per-Port variables] + ************************************************************************/ + + /* [17.19.1 - ageingTime] + * Filtering database entries for this Port are aged out after ageingTime + * has elapsed since they were first created or refreshed by the Learning + * Process. + * The value of this parameter is normally Ageing Time (7.9.2, Table 7-5), + * and is changed to FwdDelay (17.20.6) for a period of FwdDelay after + * fdbFlush (17.19.7) is set by the topology change state machine if + * stpVersion (17.19.7) is TRUE. + */ + uint32_t ageing_time OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.2 - agree] + * Set if synced is set for all other Ports. An RST BPDU with the Agreement + * flag set is transmitted and proposed is reset when agree is first set, + * and when proposed is set. + * Initialized by Port Information state machine. + */ + bool agree OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.3 - agreed] + * Set when an RST BPDU is received with a Port Role of Root, Alternate, or + * Backup Port, the Agreement flag set, and a message priority the same or + * worse than the port priority. When agreed is set, the Designated Port + * knows that its neighbouring Bridge has confirmed that it can proceed to + * the Forwarding state without further delay. + * Initialized by Port Information state machine. + */ + bool agreed OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.4 - designatedPriority] + * The first four components of the Port's designated priority vector + * value, as defined in 17.6. The fifth component of the designated + * priority vector value is portId (17.19.19). + * (Fifth component of the structure must not be used) + */ + struct rstp_priority_vector designated_priority_vector OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.5 - designatedTimes] + * The designatedTimes variable comprises the set of timer parameter values + * (Message Age, Max Age, Forward Delay, and Hello Time) that used to + * update Port Times when updtInfo is set. Updated by the updtRolesTree() + * procedure (17.21.25). + */ + struct rstp_times designated_times OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.6 - disputed] */ + bool disputed OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.7 - fdbFlush] + * A boolean. Set by the topology change state machine to instruct the + * filtering database to remove all entries for this Port, immediately if + * rstpVersion (17.20.11) is TRUE, or by rapid ageing (17.19.1) if + * stpVersion (17.20.12) is TRUE. Reset by the filtering database once the + * entries are + * removed if rstpVersion is TRUE, and immediately if stpVersion is TRUE. + */ + uint8_t fdb_flush OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.8 - forward] + * Initialized by Port State Transition state machine. + */ + bool forward OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.9 - forwarding] + * Initialized by Port State Transition state machine. + */ + bool forwarding OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.10 - infoIs] + * A variable that takes the values Mine, Aged, Received, or Disabled, to + * indicate the origin/state of the Port's Spanning Tree information + * (portInfo) held for the Port, as follows: + * a) If infoIs is Received, the port has received current (not aged out) + * information from the Designated Bridge for the attached LAN (a + * point-to-point bridge link being a special case of a LAN). + * b) If infoIs is Mine, information for the port has been derived from + * the Root Port for the Bridge (with the addition of root port cost + * information). This includes the possibility that the Root Port is + * "Port 0," i.e., the bridge is the Root Bridge for the Bridged Local + * Area Network. + * c) If infoIs is Aged, information from the Root Bridge has been aged + * out. Just as for "reselect" (see 17.19.34), the state machine does + * not formally allow the "Aged" state to persist. However, if there is + * a delay in recomputing the new root port, correct processing of a + * received BPDU is specified. + * d) Finally if the port is disabled, infoIs is Disabled. + */ + enum rstp_info_is info_is OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.11 - learn] + * Initialized by Port State Transition state machine. + */ + bool learn OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.12 - learning] + * Initialized by Port State Transition state machine. + */ + bool learning OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.13 - mcheck] + * A boolean. May be set by management to force the Port Protocol Migration + * state machine to transmit RST BPDUs for a MigrateTime (17.13.9) period, + * to test whether all STP Bridges (17.4) on the attached LAN have been + * removed and the Port can continue to transmit RSTP BPDUs. Setting mcheck + * has no effect if stpVersion (17.20.12) is TRUE, i.e., the Bridge is + * operating in STP Compatibility mode. + */ + bool mcheck OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.14 - msgPriority] + * The first four components of the message priority vector conveyed in a + * received BPDU, as defined in 17.6. + * (Fifth component of the structure must not be used). + */ + struct rstp_priority_vector msg_priority OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.15 - msgTimes] + * The msgTimes variable comprises the timer parameter values (Message Age, + * Max Age, Forward Delay, and Hello Time) conveyed in a received BPDU. + */ + struct rstp_times msg_times OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.16 - newInfo] + * A boolean. Set if a BPDU is to be transmitted. Reset by the Port + * Transmit state machine. + */ + bool new_info OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.17 - operEdge] + * A boolean. The value of the operEdgePort parameter, as determined by the + * operation of the Bridge Detection state machine (17.25). + */ + bool oper_edge OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.18 - portEnabled] + * A boolean. Set if the Bridge's MAC Relay Entity and Spanning Tree + * Protocol Entity can use the MAC Service provided by the Port's MAC + * entity to transmit and receive frames to and from the attached LAN, + * i.e., portEnabled is TRUE if and only if: + * a) MAC_Operational (6.4.2) is TRUE; and + * b) Administrative Bridge Port State (14.8.2.2) for the Port is + * Enabled; and + * c) AuthControlledPortStatus is Authorized [if the port is a network + * access port (IEEE Std 802.1X)]. + */ + bool port_enabled OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.19 - portId] + * The Port Identifier. This variable forms the fifth component of the port + * priority and designated priority vectors defined in 17.6. + */ + uint16_t port_id OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.21 - portPriority] + * The first four components of the Port's port priority vector value, as + * defined in 17.6. + * (Fifth component of the structure must not be used) + */ + struct rstp_priority_vector port_priority OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.22 - portTimes] + * The portTimes variable comprises the Port's timer parameter values + * (Message Age, Max Age, Forward Delay, and Hello Time). These timer + * values are used in BPDUs transmitted from the Port. + */ + struct rstp_times port_times OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.23 - proposed] + * Set when an RST BPDU with a Designated Port role and the Proposal flag + * set is received. If agree is not set, proposed causes sync to be set for + * all other Ports.of the Bridge. + */ + bool proposed OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.24 - proposing] + * Set by a Designated Port that is not Forwarding, and conveyed to the + * Root Port or Alternate Port of a neighboring Bridge in the Proposal flag + * of an RST BPDU (9.3.3). + */ + bool proposing OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.25 - rcvdBPDU] + * A boolean. Set by system dependent processes, this variable notifies the + * Port Receive state machine (17.23) when a valid (9.3.4) Configuration, + * TCN, or RST BPDU (9.3.1, 9.3.2, 9.3.3) is received on the Port. Reset + * by the Port Receive state machine. + */ + bool rcvd_bpdu OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.26 - rcvdInfo] + * Set to the result of the rcvInfo() procedure (17.21.8). + */ + enum rstp_rcvd_info rcvd_info OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.27 - rcvdMsg] */ + bool rcvd_msg OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.28 - rcvdRSTP] */ + bool rcvd_rstp OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.29 - rcvdSTP] */ + bool rcvd_stp OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.30 - rcvdTc] */ + bool rcvd_tc OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.31 - rcvdTcAck] */ + bool rcvd_tc_ack OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.32 - rcvdTcn] */ + bool rcvd_tcn OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.33 - reRoot] */ + bool re_root OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.34 - reselect] */ + bool reselect OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.35 - role] + * The assigned Port Role (17.7). + */ + enum rstp_port_role role OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.36 - selected] + * A boolean. See 17.28, 17.21.16. + */ + bool selected OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.37 - selectedRole] + * The newly computed role for the Port (17.7, 17.28, 17.21.25, 17.19.35). + */ + enum rstp_port_role selected_role OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.38 - sendRSTP] + * A boolean. See 17.24, 17.26. + */ + bool send_rstp OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.39 - sync] + * A boolean. See 17.10. + */ + bool sync OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.40 - synced] + * A boolean. See 17.10. + */ + bool synced OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.41 - tcAck] + * A boolean. Set if a Configuration Message with a topology change + * acknowledge flag set is to be transmitted. + */ + bool tc_ack OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.42 - tcProp] + * A boolean. Set by the Topology Change state machine of any other Port, + * to indicate that a topology change should be propagated through this + * Port. + */ + bool tc_prop OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.43 - tick] + * A boolean. See 17.22. + */ + bool tick OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.44 - txCount] + * A counter. Incremented by the Port Transmission (17.26) state machine on + * every BPDU transmission, and decremented used by the Port Timers state + * machine (17.22) once a second. Transmissions are delayed if txCount + * reaches TxHoldCount (17.13.12). + */ + uint16_t tx_count OVS_GUARDED_BY(rstp_mutex); + + /* [17.19.45 - updtInfo] + * A boolean. Set by the Port Role Selection state machine (17.28, + * 17.21.25) to tell the Port Information state machine that it should copy + * designatedPriority to portPriority and designatedTimes to portTimes. + */ + bool updt_info OVS_GUARDED_BY(rstp_mutex); + + /* Counter for RSTP received frames - for rstpd */ + uint32_t rx_rstp_bpdu_cnt; + + /* Counter for bad RSTP received frames */ + uint32_t error_count OVS_GUARDED_BY(rstp_mutex); + + /* [14.8.2.1.3] Outputs + * a) Uptime count in seconds of the time elapsed since the Port was last + * reset or initialized. + */ + uint32_t uptime OVS_GUARDED_BY(rstp_mutex); + + enum rstp_state rstp_state OVS_GUARDED_BY(rstp_mutex); + bool state_changed OVS_GUARDED_BY(rstp_mutex); + + /* Per-port state machines state */ + enum port_receive_state_machine port_receive_sm_state OVS_GUARDED_BY(rstp_mutex); + enum port_protocol_migration_state_machine port_protocol_migration_sm_state OVS_GUARDED_BY(rstp_mutex); + enum bridge_detection_state_machine bridge_detection_sm_state OVS_GUARDED_BY(rstp_mutex); + enum port_transmit_state_machine port_transmit_sm_state OVS_GUARDED_BY(rstp_mutex); + enum port_information_state_machine port_information_sm_state OVS_GUARDED_BY(rstp_mutex); + enum port_role_transition_state_machine port_role_transition_sm_state OVS_GUARDED_BY(rstp_mutex); + enum port_state_transition_state_machine port_state_transition_sm_state OVS_GUARDED_BY(rstp_mutex); + enum topology_change_state_machine topology_change_sm_state OVS_GUARDED_BY(rstp_mutex); +}; + +struct rstp { + struct ovs_list node OVS_GUARDED_BY(rstp_mutex); /* In rstp instances list */ + char *name; /* Bridge name. */ + + /* Changes in last SM execution. */ + bool changes OVS_GUARDED_BY(rstp_mutex); + + /* Per-bridge state machines state */ + enum port_role_selection_state_machine port_role_selection_sm_state OVS_GUARDED_BY(rstp_mutex); + + /* Bridge MAC address + * (stored in the least significant 48 bits of rstp_identifier). + */ + rstp_identifier address OVS_GUARDED_BY(rstp_mutex); /* [7.12.5] */ + + /* Bridge priority */ + uint16_t priority OVS_GUARDED_BY(rstp_mutex); /* Valid values: 0-61440 in steps of 4096 */ + + /************************************************************************* + * [17.3 - RSTP performance parameters] + ************************************************************************/ + + /* [17.13] + * The Spanning Tree Protocol Entity shall be reinitialized, as specified + * by the assertion of BEGIN (17.18.1) in the state machine specification, + * if the following parameters are modified: + * a) Force Protocol Version (17.13.4) + * + * The spanning tree priority vectors and Port Role assignments for a + * Bridge shall be recomputed, as specified by the operation of the Port + * Role Selection state machine (17.28) by clearing selected (17.19.36) and + * setting reselect (17.19.34) for any Port or Ports for which the + * following parameters are modified: + * b) Bridge Identifier Priority (17.13.7) + * c) Port Identifier Priority (17.13.10) + * d) Port Path Cost (17.13.11) + * + * If the Transmit Hold Count is modified the value of txCount (17.19.44) + * for all Ports shall be set to zero. + * + * The RSTP specification permits changes in other performance parameters + * without exceptional actions. + */ + + + /* [17.13.2 - Ageing Time] + * The Ageing Time parameter for the Bridge (7.9.2, Table 7-5). + */ + uint32_t ageing_time OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.4 - Force Protocol Version] + * The Force Protocol Version parameter for the Bridge (17.4, 14.8.1). + * This can take the value 0 (STP Compatibility mode) or 2 (the default, + * normal operation). + */ + enum rstp_force_protocol_version force_protocol_version OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.5 - Bridge Forward Delay] + * The delay used by STP Bridges (17.4) to transition Root and Designated + * Ports to Forwarding (Table 17-1). + */ + uint16_t bridge_forward_delay OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.6 - Bridge Hello Time] + * The interval between periodic transmissions of Configuration Messages + * by Designated Ports (Table 17-1). + */ + uint16_t bridge_hello_time OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.8 - Bridge Max Age] + * The maximum age of the information transmitted by the Bridge when it is + * the Root Bridge (Table 17-1). + */ + uint16_t bridge_max_age OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.9 - Migrate Time] + * The initial value of the mdelayWhile and edgeDelayWhile timers (17.17.4, + * 17.17.1), fixed for all RSTP implementations conforming to this + * specification (Table 17-1). + */ + uint16_t migrate_time OVS_GUARDED_BY(rstp_mutex); + + /* [17.13.12 - Transmit Hold Count] + * The Transmit Hold Count (Table 17-1) used by the Port Transmit state + * machine to limit transmission rate. + */ + uint16_t transmit_hold_count OVS_GUARDED_BY(rstp_mutex); + + + /************************************************************************* + * The following variables are defined in [17.18 - Per-Bridge variables] + ************************************************************************/ + + /* [17.18.1 - BEGIN] + * A Boolean controlled by the system initialization (17.16). If TRUE + * causes all state machines, including per Port state machines, to + * continuously execute their initial state. + */ + bool begin OVS_GUARDED_BY(rstp_mutex); + + /* [17.18.2 BridgeIdentifier] + * The unique Bridge Identifier assigned to this Bridge, comprising two + * components: the Bridge Identifier Priority, which may be modified by + * management (see 9.2.5 and 14.8.1.2) and is the more significant when + * Bridge Identifiers are compared, and a component derived from the Bridge + * Address (7.12.5), which guarantees uniqueness of the Bridge Identifiers + * of different Bridges. + */ + rstp_identifier bridge_identifier OVS_GUARDED_BY(rstp_mutex); + + /* [17.8.3 BridgePriority] + * The bridge priority vector, as defined in 17.6. The first (RootBridgeID) + * and third (DesignatedBridgeID) components are both equal to the value + * of the Bridge Identifier (17.18.2). The other components are zero. + */ + struct rstp_priority_vector bridge_priority OVS_GUARDED_BY(rstp_mutex); + + /* [17.18.4 - BridgeTimes] + * BridgeTimes comprises four components: the current values of Bridge + * Forward Delay, Bridge Hello Time, Bridge Max Age (17.13, Table 17-1), + * and a Message Age of zero. + */ + struct rstp_times bridge_times OVS_GUARDED_BY(rstp_mutex); + + /* [17.18.6 - rootPriority] + * The first four components of the Bridge's root priority vector, as + * defined in 17.6. + */ + struct rstp_priority_vector root_priority OVS_GUARDED_BY(rstp_mutex); + + /* [17.18.5 - rootPortId] + * The Port Identifier of the Root Port. This is the fifth component of + * the root priority vector, as defined in 17.6. + */ + uint16_t root_port_id OVS_GUARDED_BY(rstp_mutex); + + /* [17.18.7 - rootTimes] + * The rootTimes variable comprises the Bridge's operational timer + * parameter values (Message Age, Max Age, Forward Delay, and Hello Time), + * derived from the values stored in portTimes (17.19.22) for the Root Port + * or from BridgeTimes (17.18.4). + */ + struct rstp_times root_times OVS_GUARDED_BY(rstp_mutex); + + /* 17.20 State machine conditions and parameters */ + + /* [17.20.11] rstpVersion + * TRUE if Force Protocol Version (17.13.4) is greater than or equal to 2. + */ + bool rstp_version OVS_GUARDED_BY(rstp_mutex); + + /* [17.20.12] stpVersion + * TRUE if Force Protocol Version (17.13.4) is less than 2. + */ + bool stp_version OVS_GUARDED_BY(rstp_mutex); + + /* Ports */ + struct hmap ports OVS_GUARDED_BY(rstp_mutex); + + struct ovs_refcount ref_cnt; + + /* Interface to client. */ + void (*send_bpdu)(struct dp_packet *bpdu, void *port_aux, void *rstp_aux); + void *aux; + + bool root_changed; + void *old_root_aux; + void *new_root_aux; +}; + +#endif /* rstp-common.h */ diff -Nru openvswitch-2.3.1/lib/rstp.h openvswitch-2.4.0~git20150623/lib/rstp.h --- openvswitch-2.3.1/lib/rstp.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rstp.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2011-2014 M3S, Srl - Italy + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Rapid Spanning Tree Protocol (IEEE 802.1D-2004) public interface (header + * file). + * + * Authors: + * Martino Fornasa + * Daniele Venturino + * + * References to IEEE 802.1D-2004 standard are enclosed in square brackets. + * E.g. [17.3], [Table 17-1], etc. + * + */ + +#ifndef RSTP_H +#define RSTP_H 1 + +#include +#include +#include "compiler.h" +#include "util.h" + +/* Thread Safety: Callers passing in RSTP and RSTP port object + * pointers must hold a reference to the passed object to ensure that + * the object does not become stale while it is being accessed. */ + +extern struct ovs_mutex rstp_mutex; + +#define RSTP_MAX_PORTS 4095 + +struct dp_packet; + +/* Bridge priority defaults [Table 17-2] */ +#define RSTP_MIN_PRIORITY 0 +#define RSTP_MAX_PRIORITY 61440 +#define RSTP_PRIORITY_STEP 4096 +#define RSTP_DEFAULT_PRIORITY 32768 + +/* Port priority defaults [Table 17-2] */ +#define RSTP_MIN_PORT_PRIORITY 0 +#define RSTP_MAX_PORT_PRIORITY 240 +#define RSTP_STEP_PORT_PRIORITY 16 +#define RSTP_DEFAULT_PORT_PRIORITY 128 + +/* Performance parameters defaults. [Table 7-5] and [Table 17-1] + * These values are expressed in seconds. + */ +#define RSTP_DEFAULT_AGEING_TIME 300 +#define RSTP_MIN_AGEING_TIME 10 +#define RSTP_MAX_AGEING_TIME 1000000 + +#define RSTP_DEFAULT_BRIDGE_MAX_AGE 20 +#define RSTP_MIN_BRIDGE_MAX_AGE 6 +#define RSTP_MAX_BRIDGE_MAX_AGE 40 + +#define RSTP_DEFAULT_BRIDGE_FORWARD_DELAY 15 +#define RSTP_MIN_BRIDGE_FORWARD_DELAY 4 +#define RSTP_MAX_BRIDGE_FORWARD_DELAY 30 + +#define RSTP_DEFAULT_TRANSMIT_HOLD_COUNT 6 +#define RSTP_MIN_TRANSMIT_HOLD_COUNT 1 +#define RSTP_MAX_TRANSMIT_HOLD_COUNT 10 + +#define RSTP_BRIDGE_HELLO_TIME 2 /* Value is fixed [Table 17-1] */ + +#define RSTP_MIGRATE_TIME 3 /* Value is fixed [Table 17-1] */ + +/* Port path cost [Table 17-3] */ +#define RSTP_MIN_PORT_PATH_COST 1 +#define RSTP_MAX_PORT_PATH_COST 200000000 +#define RSTP_DEFAULT_PORT_PATH_COST 200000 + +/* RSTP Bridge identifier [9.2.5]. Top four most significant bits are a + * priority value. The next most significant twelve bits are a locally + * assigned system ID extension. Bottom 48 bits are MAC address of bridge. + */ +typedef uint64_t rstp_identifier; + +#define RSTP_ID_FMT "%01"PRIx8".%03"PRIx16".%012"PRIx64 +#define RSTP_ID_ARGS(rstp_id) \ + (uint8_t)((rstp_id) >> 60), \ + (uint16_t)(((rstp_id) & 0x0fff000000000000ULL) >> 48), \ + (uint64_t)((rstp_id) & 0xffffffffffffULL) + +#define RSTP_PORT_ID_FMT "%04"PRIx16 + +enum rstp_state { + RSTP_DISABLED, + RSTP_LEARNING, + RSTP_FORWARDING, + RSTP_DISCARDING +}; + +/* Force Protocol Version [17.13.4] */ +enum rstp_force_protocol_version { + FPV_STP_COMPATIBILITY = 0, + FPV_DEFAULT = 2 +}; + +enum rstp_port_role { + ROLE_ROOT, + ROLE_DESIGNATED, + ROLE_ALTERNATE, + ROLE_BACKUP, + ROLE_DISABLED +}; + +enum rstp_admin_point_to_point_mac_state { + RSTP_ADMIN_P2P_MAC_FORCE_FALSE, + RSTP_ADMIN_P2P_MAC_FORCE_TRUE, + RSTP_ADMIN_P2P_MAC_AUTO +}; + +struct rstp; +struct rstp_port; +struct ofproto_rstp_settings; + +const char *rstp_state_name(enum rstp_state); +const char *rstp_port_role_name(enum rstp_port_role); +static inline bool rstp_forward_in_state(enum rstp_state); +static inline bool rstp_learn_in_state(enum rstp_state); +static inline bool rstp_should_manage_bpdu(enum rstp_state state); + +void rstp_init(void) + OVS_EXCLUDED(rstp_mutex); + +struct rstp * rstp_create(const char *, rstp_identifier bridge_id, + void (*send_bpdu)(struct dp_packet *, void *port_aux, + void *rstp_aux), + void *aux) + OVS_EXCLUDED(rstp_mutex); + +struct rstp *rstp_ref(struct rstp *) + OVS_EXCLUDED(rstp_mutex); +void rstp_unref(struct rstp *) + OVS_EXCLUDED(rstp_mutex); + +/* Functions used outside RSTP, to call functions defined in + rstp-state-machines.h */ +void rstp_tick_timers(struct rstp *) + OVS_EXCLUDED(rstp_mutex); +void rstp_port_received_bpdu(struct rstp_port *, const void *bpdu, + size_t bpdu_size) + OVS_EXCLUDED(rstp_mutex); +void *rstp_check_and_reset_fdb_flush(struct rstp *, struct rstp_port **) + OVS_EXCLUDED(rstp_mutex); +void *rstp_get_next_changed_port_aux(struct rstp *, struct rstp_port **) + OVS_EXCLUDED(rstp_mutex); +void rstp_port_set_mac_operational(struct rstp_port *, + bool new_mac_operational) + OVS_EXCLUDED(rstp_mutex); +bool rstp_shift_root_learned_address(struct rstp *) + OVS_EXCLUDED(rstp_mutex); +void *rstp_get_old_root_aux(struct rstp *) + OVS_EXCLUDED(rstp_mutex); +void *rstp_get_new_root_aux(struct rstp *) + OVS_EXCLUDED(rstp_mutex); +void rstp_reset_root_changed(struct rstp *) + OVS_EXCLUDED(rstp_mutex); + +/* Bridge setters */ +void rstp_set_bridge_address(struct rstp *, rstp_identifier bridge_address) + OVS_EXCLUDED(rstp_mutex); +void rstp_set_bridge_priority(struct rstp *, int new_priority) + OVS_EXCLUDED(rstp_mutex); +void rstp_set_bridge_ageing_time(struct rstp *, int new_ageing_time) + OVS_EXCLUDED(rstp_mutex); +void rstp_set_bridge_force_protocol_version(struct rstp *, + enum rstp_force_protocol_version) + OVS_EXCLUDED(rstp_mutex); +void rstp_set_bridge_max_age(struct rstp *, int new_max_age) + OVS_EXCLUDED(rstp_mutex); +void rstp_set_bridge_forward_delay(struct rstp *, int new_forward_delay) + OVS_EXCLUDED(rstp_mutex); +void rstp_set_bridge_transmit_hold_count(struct rstp *, + int new_transmit_hold_count) + OVS_EXCLUDED(rstp_mutex); + +/* Bridge getters */ +const char * rstp_get_name(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +rstp_identifier rstp_get_root_id(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +rstp_identifier rstp_get_bridge_id(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +rstp_identifier rstp_get_designated_id(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +uint32_t rstp_get_root_path_cost(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +uint16_t rstp_get_designated_port_id(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +uint16_t rstp_get_bridge_port_id(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +struct rstp_port * rstp_get_root_port(struct rstp *) + OVS_EXCLUDED(rstp_mutex); +rstp_identifier rstp_get_designated_root(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); +bool rstp_is_root_bridge(const struct rstp *) + OVS_EXCLUDED(rstp_mutex); + +/* RSTP ports */ +struct rstp_port * rstp_add_port(struct rstp *) + OVS_EXCLUDED(rstp_mutex); +struct rstp_port *rstp_port_ref(const struct rstp_port *) + OVS_EXCLUDED(rstp_mutex); +void rstp_port_unref(struct rstp_port *) + OVS_EXCLUDED(rstp_mutex); + +uint32_t rstp_convert_speed_to_cost(unsigned int speed); + +void rstp_port_set(struct rstp_port *, uint16_t port_num, int priority, + uint32_t path_cost, bool is_admin_edge, bool is_auto_edge, + enum rstp_admin_point_to_point_mac_state admin_p2p_mac_state, + bool admin_port_state, bool do_mcheck, void *aux) + OVS_EXCLUDED(rstp_mutex); + +enum rstp_state rstp_port_get_state(const struct rstp_port *) + OVS_EXCLUDED(rstp_mutex); + +void rstp_port_get_status(const struct rstp_port *, uint16_t *id, + enum rstp_state *state, enum rstp_port_role *role, + rstp_identifier *designated_bridge_id, + uint16_t *designated_port_id, + uint32_t *designated_path_cost, int *tx_count, + int *rx_count, int *error_count, int *uptime) + OVS_EXCLUDED(rstp_mutex); + +void * rstp_get_port_aux__(struct rstp *rstp, uint16_t port_number) + OVS_REQUIRES(rstp_mutex); + + +/* Internal API for rstp-state-machines.c */ + +void rstp_port_set_state__(struct rstp_port *, enum rstp_state state) + OVS_REQUIRES(rstp_mutex); + + +/* Internal API for test-rstp.c */ + +struct rstp_port *rstp_get_port(struct rstp *rstp, uint16_t port_number) + OVS_EXCLUDED(rstp_mutex); +void reinitialize_port(struct rstp_port *p) + OVS_EXCLUDED(rstp_mutex); + +int rstp_port_get_number(const struct rstp_port *) + OVS_EXCLUDED(rstp_mutex); +void rstp_port_set_priority(struct rstp_port *port, int priority) + OVS_EXCLUDED(rstp_mutex); +void rstp_port_set_aux(struct rstp_port *p, void *aux) + OVS_EXCLUDED(rstp_mutex); +void rstp_port_set_path_cost(struct rstp_port *port, uint32_t path_cost) + OVS_EXCLUDED(rstp_mutex); +void rstp_port_set_state(struct rstp_port *p, enum rstp_state state) + OVS_EXCLUDED(rstp_mutex); + + +/* Inline functions. */ +/* Returns true if 'state' is one in which BPDU packets should be received + * and transmitted on a port, false otherwise. + */ +static inline bool +rstp_should_manage_bpdu(enum rstp_state state) +{ + return (state == RSTP_DISCARDING || state == RSTP_LEARNING || + state == RSTP_FORWARDING); +} + +/* Returns true if 'state' is one in which packets received on a port should + * be forwarded, false otherwise. + */ +static inline bool +rstp_forward_in_state(enum rstp_state state) +{ + return (state == RSTP_FORWARDING); +} + +/* Returns true if 'state' is one in which MAC learning should be done on + * packets received on a port, false otherwise. + */ +static inline bool +rstp_learn_in_state(enum rstp_state state) +{ + return (state == RSTP_LEARNING || state == RSTP_FORWARDING); +} + +#endif /* rstp.h */ diff -Nru openvswitch-2.3.1/lib/rstp-state-machines.c openvswitch-2.4.0~git20150623/lib/rstp-state-machines.c --- openvswitch-2.3.1/lib/rstp-state-machines.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rstp-state-machines.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2218 @@ +/* + * Copyright (c) 2011-2014 M3S, Srl - Italy + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Rapid Spanning Tree Protocol (IEEE 802.1D-2004) state machines + * implementation. + * + * Authors: + * Martino Fornasa + * Daniele Venturino + * + * References to IEEE 802.1D-2004 standard are enclosed in square brackets. + * E.g. [17.3], [Table 17-1], etc. + * + */ + +#include +#include "rstp.h" +#include "rstp-state-machines.h" +#include +#include +#include +#include +#include +#include "byte-order.h" +#include "connectivity.h" +#include "ofpbuf.h" +#include "dp-packet.h" +#include "packets.h" +#include "seq.h" +#include "unixctl.h" +#include "util.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(rstp_sm); + +#define ROLE_FLAG_MASK 0xC +#define ROLE_FLAG_SHIFT 2 + +enum port_flag { + PORT_UNKN = 0, + PORT_ALT_BACK = 1, + PORT_ROOT = 2, + PORT_DES = 3 +}; + +enum bpdu_size { + CONFIGURATION_BPDU_SIZE = 35, + TOPOLOGY_CHANGE_NOTIFICATION_BPDU_SIZE = 4, + RAPID_SPANNING_TREE_BPDU_SIZE = 36 +}; + +/* Same is a subset of SUPERIOR, so can be used as a boolean when the + * distinction is not significant. */ +enum vector_comparison { + INFERIOR = 0, + SUPERIOR = 1, + SAME = 2 +}; + +static void decrement_timer(uint16_t *); +static void rstp_send_bpdu(struct rstp_port *, const void *, size_t) + OVS_REQUIRES(rstp_mutex); +static int validate_received_bpdu(struct rstp_port *, const void *, size_t) + OVS_REQUIRES(rstp_mutex); +static ovs_be16 time_encode(uint8_t); +static uint8_t time_decode(ovs_be16); +static enum vector_comparison +compare_rstp_priority_vectors(const struct rstp_priority_vector *, + const struct rstp_priority_vector *); +static bool rstp_times_equal(struct rstp_times *, struct rstp_times *); + +/* Per-Bridge State Machine */ +static int port_role_selection_sm(struct rstp *) + OVS_REQUIRES(rstp_mutex); +/* Per-Port State Machines */ +static int port_receive_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static int port_protocol_migration_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static int bridge_detection_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static int port_transmit_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static int port_information_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static int port_role_transition_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static int port_state_transition_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +static int topology_change_sm(struct rstp_port *) + OVS_REQUIRES(rstp_mutex); +/* port_timers_sm() not defined as a state machine */ + +void +process_received_bpdu__(struct rstp_port *p, const void *bpdu_, + size_t bpdu_size) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *rstp = p->rstp; + struct rstp_bpdu *bpdu = (struct rstp_bpdu *)bpdu_; + + if (!p->port_enabled) { + return; + } + if (p->rcvd_bpdu) { + return; + } + + /* [9.2.9 Encoding of Port Role values] + * NOTE. If the Unknown value of the Port Role parameter is received, the + * state machines will effectively treat the RST BPDU as if it were a + * Configuration BPDU. + */ + if (bpdu->bpdu_type == RAPID_SPANNING_TREE_BPDU) { + uint8_t role = (bpdu->flags & ROLE_FLAG_MASK) >> ROLE_FLAG_SHIFT; + + if (role == PORT_UNKN) { + bpdu->bpdu_type = CONFIGURATION_BPDU; + } + } + + if (validate_received_bpdu(p, bpdu, bpdu_size) == 0) { + p->rcvd_bpdu = true; + p->rx_rstp_bpdu_cnt++; + + memcpy(&p->received_bpdu_buffer, bpdu, sizeof(struct rstp_bpdu)); + + rstp->changes = true; + move_rstp__(rstp); + } else { + VLOG_DBG("%s, port %u: Bad STP or RSTP BPDU received", p->rstp->name, + p->port_number); + p->error_count++; + } +} + +/* Returns 0 on success. */ +static int +validate_received_bpdu(struct rstp_port *p, const void *bpdu, size_t bpdu_size) + OVS_REQUIRES(rstp_mutex) +{ + /* Validation of received BPDU, see [9.3.4]. */ + const struct rstp_bpdu *temp; + + temp = bpdu; + if (bpdu_size < TOPOLOGY_CHANGE_NOTIFICATION_BPDU_SIZE || + ntohs(temp->protocol_identifier) != 0) { + return -1; + } else { + if (temp->bpdu_type == CONFIGURATION_BPDU + && bpdu_size >= CONFIGURATION_BPDU_SIZE + && (time_decode(temp->message_age) < time_decode(temp->max_age))) { + if ((ntohll(temp->designated_bridge_id) != + p->rstp->bridge_identifier) + || ((ntohll(temp->designated_bridge_id) == + p->rstp->bridge_identifier) + && (ntohs(temp->designated_port_id) != p->port_id))) { + return 0; + } else { + return -1; + } + } else if (temp->bpdu_type == TOPOLOGY_CHANGE_NOTIFICATION_BPDU) { + return 0; + } else if (temp->bpdu_type == RAPID_SPANNING_TREE_BPDU && + bpdu_size >= RAPID_SPANNING_TREE_BPDU_SIZE) { + return 0; + } else { + return -1; + } + } +} + +/* + * move_rstp__() + * This method is invoked to move the State Machines. The SMs move only if the + * boolean 'changes' is true, meaning that something changed and the SMs need + * to work to process this change. + * The boolean 'changes' is set every time a SM modifies its state, a BPDU is + * received, a timer expires or port down event is detected. If a parameter is + * set by management, then 'changes' is set. + */ +#define MAX_RSTP_ITERATIONS 1000 /* safeguard */ +int +move_rstp__(struct rstp *rstp) + OVS_REQUIRES(rstp_mutex) +{ + int num_iterations; + num_iterations = 0; + + while (rstp->changes == true && num_iterations < MAX_RSTP_ITERATIONS) { + struct rstp_port *p; + + VLOG_DBG("%s: move_rstp()", rstp->name); + + rstp->changes = false; + port_role_selection_sm(rstp); + HMAP_FOR_EACH (p, node, &rstp->ports) { + if (p->rstp_state != RSTP_DISABLED) { + port_receive_sm(p); + bridge_detection_sm(p); + port_information_sm(p); + port_role_transition_sm(p); + port_state_transition_sm(p); + topology_change_sm(p); + port_transmit_sm(p); + port_protocol_migration_sm(p); + } + } + num_iterations++; + seq_change(connectivity_seq_get()); + } + if (num_iterations >= MAX_RSTP_ITERATIONS) { + VLOG_ERR("%s: move_rstp() reached the iteration safeguard limit!", + rstp->name); + } + return 0; +} + +void decrease_rstp_port_timers__(struct rstp *r) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + + HMAP_FOR_EACH (p, node, &r->ports) { + decrement_timer(&p->hello_when); + decrement_timer(&p->tc_while); + decrement_timer(&p->fd_while); + decrement_timer(&p->rcvd_info_while); + decrement_timer(&p->rr_while); + decrement_timer(&p->rb_while); + decrement_timer(&p->mdelay_while); + decrement_timer(&p->edge_delay_while); + decrement_timer(&p->tx_count); + p->uptime += 1; + } + r->changes = true; + move_rstp__(r); +} + +static void +decrement_timer(uint16_t *timer) +{ + if (*timer != 0) { + *timer -= 1; + } +} + +/* Bridge State Machine. */ +/* [17.28] Port Role Selection state machine. */ + +static void +updt_role_disabled_tree(struct rstp *r) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + + HMAP_FOR_EACH (p, node, &r->ports) { + p->selected_role = ROLE_DISABLED; + } +} + +static void +clear_reselect_tree(struct rstp *r) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + + HMAP_FOR_EACH (p, node, &r->ports) { + p->reselect = false; + } +} + +void +updt_roles_tree__(struct rstp *r) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + int vsel; + struct rstp_priority_vector best_vector, candidate_vector; + enum rstp_port_role new_root_old_role = ROLE_DESIGNATED; + uint16_t old_root_port_number = 0; + uint16_t new_root_port_number = 0; + + old_root_port_number = r->root_port_id & 0x00ff; + if (old_root_port_number) { + r->old_root_aux = rstp_get_port_aux__(r, old_root_port_number); + } + vsel = -1; + best_vector = r->bridge_priority; + /* Letter c1) */ + r->root_times = r->bridge_times; + /* Letters a) b) c) */ + HMAP_FOR_EACH (p, node, &r->ports) { + uint32_t old_root_path_cost; + uint32_t root_path_cost; + + if (p->info_is != INFO_IS_RECEIVED) { + continue; + } + /* [17.6] */ + candidate_vector = p->port_priority; + candidate_vector.bridge_port_id = p->port_id; + old_root_path_cost = candidate_vector.root_path_cost; + root_path_cost = old_root_path_cost + p->port_path_cost; + candidate_vector.root_path_cost = root_path_cost; + + if ((candidate_vector.designated_bridge_id & 0xffffffffffffULL) == + (r->bridge_priority.designated_bridge_id & 0xffffffffffffULL)) { + continue; + } + if (compare_rstp_priority_vectors(&candidate_vector, + &best_vector) == SUPERIOR) { + best_vector = candidate_vector; + r->root_times = p->port_times; + r->root_times.message_age++; + vsel = p->port_number; + new_root_old_role = p->role; + } + } + r->root_priority = best_vector; + r->root_port_id = best_vector.bridge_port_id; + VLOG_DBG("%s: new Root is "RSTP_ID_FMT, r->name, + RSTP_ID_ARGS(r->root_priority.root_bridge_id)); + new_root_port_number = r->root_port_id & 0x00ff; + if (new_root_port_number) { + r->new_root_aux = rstp_get_port_aux__(r, new_root_port_number); + } + /* Shift learned MAC addresses from an old Root Port to an existing + * Alternate Port. */ + if (!r->root_changed + && new_root_old_role == ROLE_ALTERNATE + && new_root_port_number + && old_root_port_number + && new_root_port_number != old_root_port_number) { + r->root_changed = true; + } + /* Letters d) e) */ + HMAP_FOR_EACH (p, node, &r->ports) { + p->designated_priority_vector.root_bridge_id = + r->root_priority.root_bridge_id; + p->designated_priority_vector.root_path_cost = + r->root_priority.root_path_cost; + p->designated_priority_vector.designated_bridge_id = + r->bridge_identifier; + p->designated_priority_vector.designated_port_id = + p->port_id; + p->designated_times = r->root_times; + p->designated_times.hello_time = r->bridge_times.hello_time; + } + HMAP_FOR_EACH (p, node, &r->ports) { + switch (p->info_is) { + case INFO_IS_DISABLED: + p->selected_role = ROLE_DISABLED; + break; + case INFO_IS_AGED: + p->updt_info = true; + p->selected_role = ROLE_DESIGNATED; + break; + case INFO_IS_MINE: + p->selected_role = ROLE_DESIGNATED; + if (compare_rstp_priority_vectors( + &p->port_priority, &p->designated_priority_vector) != SAME + || !rstp_times_equal(&p->designated_times, &r->root_times)) { + p->updt_info = true; + } + break; + case INFO_IS_RECEIVED: + if (vsel == p->port_number) { /* Letter i) */ + p->selected_role = ROLE_ROOT; + p->updt_info = false; + } else if (compare_rstp_priority_vectors( + &p->designated_priority_vector, + &p->port_priority) == INFERIOR) { + if (p->port_priority.designated_bridge_id != + r->bridge_identifier) { + p->selected_role = ROLE_ALTERNATE; + p->updt_info = false; + } else { + p->selected_role = ROLE_BACKUP; + p->updt_info = false; + } + } else { + p->selected_role = ROLE_DESIGNATED; + p->updt_info = true; + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + } + seq_change(connectivity_seq_get()); +} + +static void +set_selected_tree(struct rstp *r) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + + HMAP_FOR_EACH (p, node, &r->ports) { + if (p->reselect) { + return; + } + } + HMAP_FOR_EACH (p, node, &r->ports) { + p->selected = true; + } +} + +static int +port_role_selection_sm(struct rstp *r) + OVS_REQUIRES(rstp_mutex) +{ + enum port_role_selection_state_machine old_state; + struct rstp_port *p; + + old_state = r->port_role_selection_sm_state; + + switch (r->port_role_selection_sm_state) { + case PORT_ROLE_SELECTION_SM_INIT: + if (r->begin) { + r->port_role_selection_sm_state = + PORT_ROLE_SELECTION_SM_INIT_BRIDGE_EXEC; + } + break; + case PORT_ROLE_SELECTION_SM_INIT_BRIDGE_EXEC: + updt_role_disabled_tree(r); + r->port_role_selection_sm_state = PORT_ROLE_SELECTION_SM_INIT_BRIDGE; + /* no break */ + case PORT_ROLE_SELECTION_SM_INIT_BRIDGE: + r->port_role_selection_sm_state = + PORT_ROLE_SELECTION_SM_ROLE_SELECTION_EXEC; + break; + case PORT_ROLE_SELECTION_SM_ROLE_SELECTION_EXEC: + clear_reselect_tree(r); + updt_roles_tree__(r); + set_selected_tree(r); + r->port_role_selection_sm_state = + PORT_ROLE_SELECTION_SM_ROLE_SELECTION; + /* no break */ + case PORT_ROLE_SELECTION_SM_ROLE_SELECTION: + HMAP_FOR_EACH (p, node, &r->ports) { + if (p->reselect) { + r->port_role_selection_sm_state = + PORT_ROLE_SELECTION_SM_ROLE_SELECTION_EXEC; + break; + } + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != r->port_role_selection_sm_state) { + r->changes = true; + VLOG_DBG("%s: Port_role_selection_sm %d -> %d", r->name, + old_state, r->port_role_selection_sm_state); + } + return 0; +} + +/* Port State Machines */ + +/* [17.23 - Port receive state machine] */ + +static void +updt_bpdu_version(struct rstp_port *p) /* [17.21.22] */ + OVS_REQUIRES(rstp_mutex) +{ + switch (p->received_bpdu_buffer.bpdu_type) { + case CONFIGURATION_BPDU: + case TOPOLOGY_CHANGE_NOTIFICATION_BPDU: + p->rcvd_rstp = false; + p->rcvd_stp = true; + break; + case RAPID_SPANNING_TREE_BPDU: + p->rcvd_rstp = true; + p->rcvd_stp = false; + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } +} + +static int +port_receive_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum port_receive_state_machine old_state; + struct rstp *r; + + old_state = p->port_receive_sm_state; + r = p->rstp; + + switch (p->port_receive_sm_state) { + case PORT_RECEIVE_SM_INIT: + if (r->begin || ((p->rcvd_bpdu || (p->edge_delay_while != + r->migrate_time)) && !p->port_enabled)) { + p->port_receive_sm_state = PORT_RECEIVE_SM_DISCARD_EXEC; + } + break; + case PORT_RECEIVE_SM_DISCARD_EXEC: + p->rcvd_bpdu = p->rcvd_rstp = p->rcvd_stp = false; + p->rcvd_msg = false; + p->edge_delay_while = r->migrate_time; + p->port_receive_sm_state = PORT_RECEIVE_SM_DISCARD; + /* no break */ + case PORT_RECEIVE_SM_DISCARD: + if ((p->rcvd_bpdu || (p->edge_delay_while != r->migrate_time)) + && !p->port_enabled) { + /* Global transition. */ + p->port_receive_sm_state = PORT_RECEIVE_SM_DISCARD_EXEC; + } else if (p->rcvd_bpdu && p->port_enabled) { + p->port_receive_sm_state = PORT_RECEIVE_SM_RECEIVE_EXEC; + } + break; + case PORT_RECEIVE_SM_RECEIVE_EXEC: + updt_bpdu_version(p); + p->oper_edge = p->rcvd_bpdu = false; + p->rcvd_msg = true; + p->edge_delay_while = r->migrate_time; + p->port_receive_sm_state = PORT_RECEIVE_SM_RECEIVE; + /* no break */ + case PORT_RECEIVE_SM_RECEIVE: + if ((p->rcvd_bpdu || (p->edge_delay_while != r->migrate_time)) + && !p->port_enabled) { + /* Global transition. */ + p->port_receive_sm_state = PORT_RECEIVE_SM_DISCARD_EXEC; + } else if (p->rcvd_bpdu && p->port_enabled && !p->rcvd_msg) { + p->port_receive_sm_state = PORT_RECEIVE_SM_RECEIVE_EXEC; + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->port_receive_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: Port_receive_sm %d -> %d", p->rstp->name, + p->port_number, old_state, p->port_receive_sm_state); + } + return 0; +} + +/* [17.24 - Port Protocol Migration state machine] */ +static int +port_protocol_migration_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum port_protocol_migration_state_machine old_state; + struct rstp *r; + + old_state = p->port_protocol_migration_sm_state; + r = p->rstp; + + switch (p->port_protocol_migration_sm_state) { + case PORT_PROTOCOL_MIGRATION_SM_INIT: + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP_EXEC; + /* no break */ + case PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP_EXEC: + p->mcheck = false; + p->send_rstp = r->rstp_version; + p->mdelay_while = r->migrate_time; + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP; + /* no break */ + case PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP: + if (p->mdelay_while == 0) { + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_SENSING_EXEC; + } else if ((p->mdelay_while != r->migrate_time) && !p->port_enabled) { + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP_EXEC; + } + break; + case PORT_PROTOCOL_MIGRATION_SM_SELECTING_STP_EXEC: + p->send_rstp = false; + p->mdelay_while = r->migrate_time; + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_SELECTING_STP; + /* no break */ + case PORT_PROTOCOL_MIGRATION_SM_SELECTING_STP: + if ((p->mdelay_while == 0) || (!p->port_enabled) || p->mcheck) { + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_SENSING_EXEC; + } + break; + case PORT_PROTOCOL_MIGRATION_SM_SENSING_EXEC: + p->rcvd_rstp = false; + p->rcvd_stp = false; + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_SENSING; + /* no break */ + case PORT_PROTOCOL_MIGRATION_SM_SENSING: + if (!p->port_enabled || p->mcheck || ((r->rstp_version) && + !p->send_rstp && p->rcvd_rstp)) { + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_CHECKING_RSTP_EXEC; + } else if (p->send_rstp && p->rcvd_stp) { + p->port_protocol_migration_sm_state = + PORT_PROTOCOL_MIGRATION_SM_SELECTING_STP_EXEC; + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->port_protocol_migration_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: port_protocol_migration_sm %d -> %d", + p->rstp->name, p->port_number, old_state, + p->port_protocol_migration_sm_state); + } + + return 0; +} + +/* [17.25 - Bridge Detection state machine] */ +static int +bridge_detection_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum bridge_detection_state_machine old_state; + struct rstp *r; + + old_state = p->bridge_detection_sm_state; + r = p->rstp; + + switch (p->bridge_detection_sm_state) { + case BRIDGE_DETECTION_SM_INIT: + if (r->begin && p->admin_edge) { + p->bridge_detection_sm_state = BRIDGE_DETECTION_SM_EDGE_EXEC; + } else if (r->begin && !p->admin_edge) { + p->bridge_detection_sm_state = BRIDGE_DETECTION_SM_NOT_EDGE_EXEC; + } + break; + case BRIDGE_DETECTION_SM_EDGE_EXEC: + p->oper_edge = true; + p->bridge_detection_sm_state = BRIDGE_DETECTION_SM_EDGE; + /* no break */ + case BRIDGE_DETECTION_SM_EDGE: + if ((!p->port_enabled && !p->admin_edge) || !p->oper_edge) { + p->bridge_detection_sm_state = BRIDGE_DETECTION_SM_NOT_EDGE_EXEC; + } + break; + case BRIDGE_DETECTION_SM_NOT_EDGE_EXEC: + p->oper_edge = false; + p->bridge_detection_sm_state = BRIDGE_DETECTION_SM_NOT_EDGE; + /* no break */ + case BRIDGE_DETECTION_SM_NOT_EDGE: + if ((!p->port_enabled && p->admin_edge) + || ((p->edge_delay_while == 0) && p->auto_edge && p->send_rstp + && p->proposing)) { + p->bridge_detection_sm_state = BRIDGE_DETECTION_SM_EDGE_EXEC; + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->bridge_detection_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: bridge_detection_sm %d -> %d", p->rstp->name, + p->port_number, old_state, p->bridge_detection_sm_state); + } + return 0; +} + +/* [17.26 - Port Transmit state machine] */ +static void +rstp_send_bpdu(struct rstp_port *p, const void *bpdu, size_t bpdu_size) + OVS_REQUIRES(rstp_mutex) +{ + struct eth_header *eth; + struct llc_header *llc; + struct dp_packet *pkt; + + /* Skeleton. */ + pkt = dp_packet_new(ETH_HEADER_LEN + LLC_HEADER_LEN + bpdu_size); + eth = dp_packet_put_zeros(pkt, sizeof *eth); + llc = dp_packet_put_zeros(pkt, sizeof *llc); + dp_packet_reset_offsets(pkt); + dp_packet_set_l3(pkt, dp_packet_put(pkt, bpdu, bpdu_size)); + + /* 802.2 header. */ + memcpy(eth->eth_dst, eth_addr_stp, ETH_ADDR_LEN); + /* p->rstp->send_bpdu() must fill in source address. */ + eth->eth_type = htons(dp_packet_size(pkt) - ETH_HEADER_LEN); + + /* LLC header. */ + llc->llc_dsap = STP_LLC_DSAP; + llc->llc_ssap = STP_LLC_SSAP; + llc->llc_cntl = STP_LLC_CNTL; + p->rstp->send_bpdu(pkt, p->aux, p->rstp->aux); +} + +static void +record_agreement(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *r; + + r = p->rstp; + if (r->rstp_version && p->oper_point_to_point_mac && + ((p->received_bpdu_buffer.flags & BPDU_FLAG_AGREEMENT))) { + p->agreed = true; + p->proposing = false; + } else { + p->agreed = false; + } +} + +static void +set_tc_flags(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + /* Sets rcvd_tc and/or rcvd_tc_ack if the Topology Change and/or Topology + * Change Acknowledgment flags, respectively, are set in a ConfigBPDU or + * RST BPDU. + */ + if (p->received_bpdu_buffer.bpdu_type == CONFIGURATION_BPDU || + p->received_bpdu_buffer.bpdu_type == RAPID_SPANNING_TREE_BPDU) { + if ((p->received_bpdu_buffer.flags & BPDU_FLAG_TOPCHANGE) != 0) { + p->rcvd_tc = true; + } + if ((p->received_bpdu_buffer.flags & BPDU_FLAG_TOPCHANGEACK) != 0) { + p->rcvd_tc_ack = true; + } + } + /* Sets rcvd_tcn true if the BPDU is a TCN BPDU. */ + if (p->received_bpdu_buffer.bpdu_type + == TOPOLOGY_CHANGE_NOTIFICATION_BPDU) { + p->rcvd_tcn = true; + } +} + +static void +record_dispute(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + if ((p->received_bpdu_buffer.flags & BPDU_FLAG_LEARNING) != 0) { + /* 802.1D-2004 says to set the agreed flag and to clear the proposing + * flag. 802.1q-2008 instead says to set the disputed variable and to + * clear the agreed variable. */ + p->disputed = true; + p->agreed = false; + } +} + +static void +record_proposal(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum port_flag role = + ((p->received_bpdu_buffer.flags) & ROLE_FLAG_MASK) >> ROLE_FLAG_SHIFT; + + if ((role == PORT_DES) + && ((p->received_bpdu_buffer.flags & BPDU_FLAG_PROPOSAL) != 0)) { + p->proposed = true; + } +} + +static void +record_priority(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + p->port_priority.root_bridge_id = p->msg_priority.root_bridge_id; + p->port_priority.root_path_cost = p->msg_priority.root_path_cost; + p->port_priority.designated_bridge_id = + p->msg_priority.designated_bridge_id; + p->port_priority.designated_port_id = p->msg_priority.designated_port_id; +} + +static void +record_times(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + p->port_times = p->msg_times; + if (p->msg_times.hello_time == 0) { + p->port_times.hello_time = 1; + } +} + +static void +updt_rcvd_info_while(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + /* [17.21.23] + * The value assigned to rcvdInfoWhile is the three times the Hello Time, + * if Message Age, incremented by 1 second and rounded to the nearest whole + * second, does not exceed Max Age, and is zero otherwise. + */ + if (p->port_times.message_age < p->port_times.max_age) { + p->rcvd_info_while = p->port_times.hello_time * 3; + } else { + p->rcvd_info_while = 0; + } +} + +/* Times are internally held in seconds, while the protocol uses 1/256 seconds. + * time_encode() is used to convert time values sent in bpdus, while + * time_decode() is used to convert time values received in bpdus. + */ +static ovs_be16 +time_encode(uint8_t value) +{ + return htons(value * 256); +} + +static uint8_t +time_decode(ovs_be16 encoded) +{ + return ntohs(encoded) / 256; +} + +/* [17.21.19] */ +static void +tx_config(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_bpdu bpdu; + + bpdu.protocol_identifier = htons(0); + bpdu.protocol_version_identifier = 0; + bpdu.bpdu_type = CONFIGURATION_BPDU; + bpdu.root_bridge_id = htonll(p->designated_priority_vector.root_bridge_id); + bpdu.root_path_cost = htonl(p->designated_priority_vector.root_path_cost); + bpdu.designated_bridge_id = + htonll(p->designated_priority_vector.designated_bridge_id); + bpdu.designated_port_id = + htons(p->designated_priority_vector.designated_port_id); + bpdu.message_age = time_encode(p->designated_times.message_age); + bpdu.max_age = time_encode(p->designated_times.max_age); + bpdu.hello_time = time_encode(p->designated_times.hello_time); + bpdu.forward_delay = time_encode(p->designated_times.forward_delay); + bpdu.flags = 0; + if (p->tc_while != 0) { + bpdu.flags |= BPDU_FLAG_TOPCHANGE; + } + if (p->tc_ack != 0) { + bpdu.flags |= BPDU_FLAG_TOPCHANGEACK; + } + rstp_send_bpdu(p, &bpdu, sizeof(struct rstp_bpdu)); +} + +/* [17.21.20] */ +static void +tx_rstp(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_bpdu bpdu; + + bpdu.protocol_identifier = htons(0); + bpdu.protocol_version_identifier = 2; + bpdu.bpdu_type = RAPID_SPANNING_TREE_BPDU; + bpdu.root_bridge_id = htonll(p->designated_priority_vector.root_bridge_id); + bpdu.root_path_cost = htonl(p->designated_priority_vector.root_path_cost); + bpdu.designated_bridge_id = + htonll(p->designated_priority_vector.designated_bridge_id); + bpdu.designated_port_id = + htons(p->designated_priority_vector.designated_port_id); + bpdu.message_age = time_encode(p->designated_times.message_age); + bpdu.max_age = time_encode(p->designated_times.max_age); + bpdu.hello_time = time_encode(p->designated_times.hello_time); + bpdu.forward_delay = time_encode(p->designated_times.forward_delay); + bpdu.flags = 0; + + switch (p->role) { + case ROLE_ROOT: + bpdu.flags = PORT_ROOT << ROLE_FLAG_SHIFT; + break; + case ROLE_DESIGNATED: + bpdu.flags = PORT_DES << ROLE_FLAG_SHIFT; + break; + case ROLE_ALTERNATE: + case ROLE_BACKUP: + bpdu.flags = PORT_ALT_BACK << ROLE_FLAG_SHIFT; + break; + case ROLE_DISABLED: + /* Should not happen! */ + VLOG_ERR("%s transmitting bpdu in disabled role on port " + RSTP_PORT_ID_FMT, p->rstp->name, p->port_id); + break; + } + if (p->agree) { + bpdu.flags |= BPDU_FLAG_AGREEMENT; + } + if (p->proposing) { + bpdu.flags |= BPDU_FLAG_PROPOSAL; + } + if (p->tc_while != 0) { + bpdu.flags |= BPDU_FLAG_TOPCHANGE; + } + if (p->learning) { + bpdu.flags |= BPDU_FLAG_LEARNING; + } + if (p->forwarding) { + bpdu.flags |= BPDU_FLAG_FORWARDING; + } + bpdu.version1_length = 0; + rstp_send_bpdu(p, &bpdu, sizeof(struct rstp_bpdu)); +} + +/* [17.21.21] */ +static void +tx_tcn(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_bpdu bpdu; + + memset(&bpdu, 0, sizeof(struct rstp_bpdu)); + + bpdu.protocol_identifier = htons(0); + bpdu.protocol_version_identifier = 0; + bpdu.bpdu_type = TOPOLOGY_CHANGE_NOTIFICATION_BPDU; + rstp_send_bpdu(p, &bpdu, sizeof(struct rstp_bpdu)); +} + +static int +port_transmit_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum port_transmit_state_machine old_state; + struct rstp *r; + + old_state = p->port_transmit_sm_state; + r = p->rstp; + + switch (p->port_transmit_sm_state) { + case PORT_TRANSMIT_SM_INIT: + if (r->begin) { + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_INIT_EXEC; + } + break; + case PORT_TRANSMIT_SM_TRANSMIT_INIT_EXEC: + p->new_info = true; + p->tx_count = 0; + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_INIT; + /* no break */ + case PORT_TRANSMIT_SM_TRANSMIT_INIT: + p->port_transmit_sm_state = PORT_TRANSMIT_SM_IDLE_EXEC; + break; + case PORT_TRANSMIT_SM_TRANSMIT_PERIODIC_EXEC: + p->new_info = p->new_info || (p->role == ROLE_DESIGNATED || + (p->role == ROLE_ROOT && p->tc_while != 0)); + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_PERIODIC; + /* no break */ + case PORT_TRANSMIT_SM_TRANSMIT_PERIODIC: + p->port_transmit_sm_state = PORT_TRANSMIT_SM_IDLE_EXEC; + break; + case PORT_TRANSMIT_SM_IDLE_EXEC: + p->hello_when = r->bridge_hello_time; + p->port_transmit_sm_state = PORT_TRANSMIT_SM_IDLE; + /* no break */ + case PORT_TRANSMIT_SM_IDLE: + if (p->role == ROLE_DISABLED) { + VLOG_DBG("%s, port %u: port_transmit_sm ROLE == DISABLED.", + p->rstp->name, p->port_number); + break; + } else if (p->send_rstp && p->new_info + && p->tx_count < r->transmit_hold_count + && p->hello_when != 0 && p->selected && !p->updt_info) { + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_RSTP_EXEC; + } else if (p->hello_when == 0 && p->selected && !p->updt_info) { + p->port_transmit_sm_state = + PORT_TRANSMIT_SM_TRANSMIT_PERIODIC_EXEC; + } else if (!p->send_rstp && p->new_info && p->role == ROLE_ROOT + && p->tx_count < r->transmit_hold_count + && p->hello_when != 0 && p->selected && !p->updt_info) { + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_TCN_EXEC; + } else if (!p->send_rstp && p->new_info && p->role == ROLE_DESIGNATED + && p->tx_count < r->transmit_hold_count + && p->hello_when != 0 && p->selected && !p->updt_info) { + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_CONFIG_EXEC; + } + break; + case PORT_TRANSMIT_SM_TRANSMIT_CONFIG_EXEC: + p->new_info = false; + tx_config(p); + p->tx_count += 1; + p->tc_ack = false; + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_CONFIG; + /* no break */ + case PORT_TRANSMIT_SM_TRANSMIT_CONFIG: + p->port_transmit_sm_state = PORT_TRANSMIT_SM_IDLE_EXEC; + break; + case PORT_TRANSMIT_SM_TRANSMIT_TCN_EXEC: + p->new_info = false; + tx_tcn(p); + p->tx_count += 1; + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_TCN; + /* no break */ + case PORT_TRANSMIT_SM_TRANSMIT_TCN: + p->port_transmit_sm_state = PORT_TRANSMIT_SM_IDLE_EXEC; + break; + case PORT_TRANSMIT_SM_TRANSMIT_RSTP_EXEC: + p->new_info = false; + tx_rstp(p); + p->tx_count += 1; + p->tc_ack = false; + p->port_transmit_sm_state = PORT_TRANSMIT_SM_TRANSMIT_RSTP; + /* no break */ + case PORT_TRANSMIT_SM_TRANSMIT_RSTP: + p->port_transmit_sm_state = PORT_TRANSMIT_SM_IDLE_EXEC; + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->port_transmit_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: port_transmit_sm %d -> %d", p->rstp->name, + p->port_number, old_state, p->port_transmit_sm_state); + } + return 0; +} + +/* [17.27 Port Information state machine] */ +#define RECEIVED 0 +#define MINE 1 + +static int +rcv_info(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum vector_comparison cp; + bool ct; + enum port_flag role; + + p->msg_priority.root_bridge_id = + ntohll(p->received_bpdu_buffer.root_bridge_id); + p->msg_priority.root_path_cost = + ntohl(p->received_bpdu_buffer.root_path_cost); + p->msg_priority.designated_bridge_id = + ntohll(p->received_bpdu_buffer.designated_bridge_id); + p->msg_priority.designated_port_id = + ntohs(p->received_bpdu_buffer.designated_port_id); + + p->msg_times.forward_delay = + time_decode(p->received_bpdu_buffer.forward_delay); + p->msg_times.hello_time = time_decode(p->received_bpdu_buffer.hello_time); + p->msg_times.max_age = time_decode(p->received_bpdu_buffer.max_age); + p->msg_times.message_age = + time_decode(p->received_bpdu_buffer.message_age); + + cp = compare_rstp_priority_vectors(&p->msg_priority, &p->port_priority); + ct = rstp_times_equal(&p->port_times, &p->msg_times); + /* Configuration BPDU conveys a Designated Port Role. */ + if (p->received_bpdu_buffer.bpdu_type == CONFIGURATION_BPDU) { + role = PORT_DES; + } else { + role = + (p->received_bpdu_buffer.flags & ROLE_FLAG_MASK) >> ROLE_FLAG_SHIFT; + } + + /* 802.1D-2004 does not report this behaviour. + * 802.1Q-2008 says set rcvdTcn. */ + if (p->received_bpdu_buffer.bpdu_type == + TOPOLOGY_CHANGE_NOTIFICATION_BPDU) { + p->rcvd_tcn = true; + return OTHER_INFO; + } + + /* Returns SuperiorDesignatedInfo if: + * a) The received message conveys a Designated Port Role, and + * 1) The message priority is superior (17.6) to the Port.s port priority + * vector, or + * 2) The message priority vector is the same as the Port.s port priority + * vector, and any of the received timer parameter values (msg_times. + * 17.19.15) differ from those already held for the Port (port_times + * 17.19.22). + * NOTE: Configuration BPDU explicitly conveys a Designated Port Role. + */ + if (role == PORT_DES && (cp == SUPERIOR || (cp == SAME && ct == false))) { + return SUPERIOR_DESIGNATED_INFO; + + /* Returns RepeatedDesignatedInfo if: + * b) The received message conveys Designated Port Role, and a message + * priority vector and timer parameters that are the same as the + * Port's port priority vector or timer values. */ + } else if (role == PORT_DES && cp == SAME && ct == true) { + return REPEATED_DESIGNATED_INFO; + + /* Returns InferiorDesignatedInfo if: + * c) The received message conveys a Designated Port Role, and a + * message priority vector that is worse than the Port's port + * priority vector. */ + } else if (role == PORT_DES && cp == INFERIOR) { + return INFERIOR_DESIGNATED_INFO; + + /* Returns InferiorRootAlternateInfo if: + * d) The received message conveys a Root Port, Alternate Port, or + * Backup Port Role and a message priority that is the same as or + * worse than the port priority vector. */ + } else if ((role == PORT_ROOT || role == PORT_ALT_BACK) && + (cp == INFERIOR || cp == SAME)) { + return INFERIOR_ROOT_ALTERNATE_INFO; + + /* Otherwise, returns OtherInfo. */ + } else { + return OTHER_INFO; + } +} + +static int +better_or_same_info(struct rstp_port *p, int new_info_is) + OVS_REQUIRES(rstp_mutex) +{ + return + (new_info_is == RECEIVED && p->info_is == INFO_IS_RECEIVED + && compare_rstp_priority_vectors(&p->msg_priority, + &p->port_priority)) + || (new_info_is == MINE && p->info_is == INFO_IS_MINE + && compare_rstp_priority_vectors(&p->designated_priority_vector, + &p->port_priority)); +} + +static int +port_information_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum port_information_state_machine old_state; + struct rstp *r; + struct rstp_port *p1; + + old_state = p->port_information_sm_state; + r = p->rstp; + + switch (p->port_information_sm_state) { + case PORT_INFORMATION_SM_INIT: + if (r->begin + || (!p->port_enabled && p->info_is != INFO_IS_DISABLED)) { + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } + break; + case PORT_INFORMATION_SM_DISABLED_EXEC: + p->rcvd_msg = false; + p->proposing = p->proposed = p->agree = p->agreed = false; + p->rcvd_info_while = 0; + p->info_is = INFO_IS_DISABLED; + p->reselect = true; + p->selected = false; + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED; + /* no break */ + case PORT_INFORMATION_SM_DISABLED: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else if (p->port_enabled) { + p->port_information_sm_state = PORT_INFORMATION_SM_AGED_EXEC; + } else if (p->rcvd_msg) { + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } + break; + case PORT_INFORMATION_SM_AGED_EXEC: + p->info_is = INFO_IS_AGED; + p->reselect = true; + p->selected = false; + p->port_information_sm_state = PORT_INFORMATION_SM_AGED; + /* no break */ + case PORT_INFORMATION_SM_AGED: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else if (p->selected && p->updt_info) { + p->port_information_sm_state = PORT_INFORMATION_SM_UPDATE_EXEC; + } + break; + case PORT_INFORMATION_SM_UPDATE_EXEC: + p->proposing = p->proposed = false; + /* MINE is not specified in Standard 802.1D-2004. */ + p->agreed = p->agreed && better_or_same_info(p, MINE); + p->synced = p->synced && p->agreed; + p->port_priority.root_bridge_id = + p->designated_priority_vector.root_bridge_id; + p->port_priority.root_path_cost = + p->designated_priority_vector.root_path_cost; + p->port_priority.designated_bridge_id = + p->designated_priority_vector.designated_bridge_id; + p->port_priority.designated_port_id = + p->designated_priority_vector.designated_port_id; + p->port_times = p->designated_times; + p->updt_info = false; + p->info_is = INFO_IS_MINE; + p->new_info = true; + p->port_information_sm_state = PORT_INFORMATION_SM_UPDATE; + /* no break */ + case PORT_INFORMATION_SM_UPDATE: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else { + p->port_information_sm_state = PORT_INFORMATION_SM_CURRENT_EXEC; + } + break; + case PORT_INFORMATION_SM_CURRENT_EXEC: + p->port_information_sm_state = PORT_INFORMATION_SM_CURRENT; + /* no break */ + case PORT_INFORMATION_SM_CURRENT: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else if (p->rcvd_msg && !p->updt_info) { + p->port_information_sm_state = PORT_INFORMATION_SM_RECEIVE_EXEC; + } else if (p->selected && p->updt_info) { + p->port_information_sm_state = PORT_INFORMATION_SM_UPDATE_EXEC; + } else if ((p->info_is == INFO_IS_RECEIVED) && + (p->rcvd_info_while == 0) && !p->updt_info && + !p->rcvd_msg) { + p->port_information_sm_state = PORT_INFORMATION_SM_AGED_EXEC; + } + break; + case PORT_INFORMATION_SM_RECEIVE_EXEC: + p->rcvd_info = rcv_info(p); + p->port_information_sm_state = PORT_INFORMATION_SM_RECEIVE; + /* no break */ + case PORT_INFORMATION_SM_RECEIVE: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else { + switch (p->rcvd_info) { + case SUPERIOR_DESIGNATED_INFO: + /* 802.1q-2008 has a checkBPDUConsistency() function, called on + * a BPDU reception. checkBPDUConsistency() clears the agreed + * variable if the received message priority vector is superior + * to the port priority vector, the BPDU is an ST BPDU or an + * RST BPDU, its port role is Designated and its Learning flag + * is set. */ + if (p->received_bpdu_buffer.flags & BPDU_FLAG_LEARNING) { + HMAP_FOR_EACH (p1, node, &r->ports) { + if (p1->port_number != p->port_number) { + p1->agreed = false; + } + } + } + p->port_information_sm_state = + PORT_INFORMATION_SM_SUPERIOR_DESIGNATED_EXEC; + break; + case REPEATED_DESIGNATED_INFO: + p->port_information_sm_state = + PORT_INFORMATION_SM_REPEATED_DESIGNATED_EXEC; + break; + case INFERIOR_DESIGNATED_INFO: + p->port_information_sm_state = + PORT_INFORMATION_SM_INFERIOR_DESIGNATED_EXEC; + break; + case INFERIOR_ROOT_ALTERNATE_INFO: + p->port_information_sm_state = + PORT_INFORMATION_SM_NOT_DESIGNATED_EXEC; + break; + case OTHER_INFO: + p->port_information_sm_state = PORT_INFORMATION_SM_OTHER_EXEC; + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + } + break; + case PORT_INFORMATION_SM_OTHER_EXEC: + p->rcvd_msg = false; + p->port_information_sm_state = PORT_INFORMATION_SM_OTHER; + /* no break */ + case PORT_INFORMATION_SM_OTHER: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else { + p->port_information_sm_state = PORT_INFORMATION_SM_CURRENT_EXEC; + } + break; + case PORT_INFORMATION_SM_NOT_DESIGNATED_EXEC: + record_agreement(p); + set_tc_flags(p); + p->rcvd_msg = false; + p->port_information_sm_state = PORT_INFORMATION_SM_NOT_DESIGNATED; + /* no break */ + case PORT_INFORMATION_SM_NOT_DESIGNATED: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else { + p->port_information_sm_state = PORT_INFORMATION_SM_CURRENT_EXEC; + } + break; + case PORT_INFORMATION_SM_INFERIOR_DESIGNATED_EXEC: + record_dispute(p); + p->rcvd_msg = false; + p->port_information_sm_state = PORT_INFORMATION_SM_INFERIOR_DESIGNATED; + /* no break */ + case PORT_INFORMATION_SM_INFERIOR_DESIGNATED: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else { + p->port_information_sm_state = PORT_INFORMATION_SM_CURRENT_EXEC; + } + break; + case PORT_INFORMATION_SM_REPEATED_DESIGNATED_EXEC: + record_proposal(p); + set_tc_flags(p); + /* This record_agreement() is missing in 802.1D-2004, but it's present + * in 802.1q-2008. */ + record_agreement(p); + updt_rcvd_info_while(p); + p->rcvd_msg = false; + p->port_information_sm_state = PORT_INFORMATION_SM_REPEATED_DESIGNATED; + /* no break */ + case PORT_INFORMATION_SM_REPEATED_DESIGNATED: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else { + p->port_information_sm_state = PORT_INFORMATION_SM_CURRENT_EXEC; + } + break; + case PORT_INFORMATION_SM_SUPERIOR_DESIGNATED_EXEC: + p->agreed = p->proposing = false; + record_proposal(p); + set_tc_flags(p); + /* RECEIVED is not specified in Standard 802.1D-2004. */ + p->agree = p->agree && better_or_same_info(p, RECEIVED); + /* This record_agreement() and the synced assignment are missing in + * 802.1D-2004, but they're present in 802.1q-2008. */ + record_agreement(p); + p->synced = p->synced && p->agreed; + record_priority(p); + record_times(p); + updt_rcvd_info_while(p); + p->info_is = INFO_IS_RECEIVED; + p->reselect = true; + p->selected = false; + p->rcvd_msg = false; + p->port_information_sm_state = PORT_INFORMATION_SM_SUPERIOR_DESIGNATED; + /* no break */ + case PORT_INFORMATION_SM_SUPERIOR_DESIGNATED: + if (!p->port_enabled && p->info_is != INFO_IS_DISABLED) { + /* Global transition. */ + p->port_information_sm_state = PORT_INFORMATION_SM_DISABLED_EXEC; + } else { + p->port_information_sm_state = PORT_INFORMATION_SM_CURRENT_EXEC; + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->port_information_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: Port_information_sm %d -> %d", p->rstp->name, + p->port_number, old_state, p->port_information_sm_state); + } + return 0; +} + +/* [17.29 Port Role Transitions state machine] */ + +static void +set_re_root_tree(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *r; + struct rstp_port *p1; + + r = p->rstp; + HMAP_FOR_EACH (p1, node, &r->ports) { + p1->re_root = true; + } +} + +static void +set_sync_tree(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *r; + struct rstp_port *p1; + + r = p->rstp; + HMAP_FOR_EACH (p1, node, &r->ports) { + p1->sync = true; + } +} + +static int +hello_time(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + return p->designated_times.hello_time; +} + +static int +fwd_delay(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + return p->designated_times.forward_delay; +} + +static int +forward_delay(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + if (p->send_rstp) { + return hello_time(p); + } else { + return fwd_delay(p); + } +} + +static int +edge_delay(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *r; + + r = p->rstp; + if (p->oper_point_to_point_mac == 1) { + return r->migrate_time; + } else { + return p->designated_times.max_age; + } +} + +static int +check_selected_role_change(struct rstp_port *p, int current_role_state) + OVS_REQUIRES(rstp_mutex) +{ + if (p->selected && !p->updt_info && p->role != p->selected_role + && p->selected_role != current_role_state) { + VLOG_DBG("%s, port %u: case: current = %s role = %s selected = %d", + p->rstp->name, p->port_number, + rstp_port_role_name(current_role_state), + rstp_port_role_name(p->role), p->selected_role); + switch (p->selected_role) { + case ROLE_ROOT: + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + return true; + case ROLE_DESIGNATED: + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC; + return true; + case ROLE_ALTERNATE: + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_BLOCK_PORT_EXEC; + return true; + case ROLE_BACKUP: + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_BLOCK_PORT_EXEC; + return true; + case ROLE_DISABLED: + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DISABLE_PORT_EXEC; + return true; + } + } + return false; +} + +static int +re_rooted(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *r; + struct rstp_port *p1; + + r = p->rstp; + HMAP_FOR_EACH (p1, node, &r->ports) { + if ((p1 != p) && (p1->rr_while != 0)) { + return false; + } + } + return true; +} + +static int +all_synced(struct rstp *r) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp_port *p; + + HMAP_FOR_EACH (p, node, &r->ports) { + if (!(p->selected && p->role == p->selected_role && + (p->role == ROLE_ROOT || p->synced == true))) { + return false; + } + } + return true; +} + +static int +port_role_transition_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum port_role_transition_state_machine old_state; + struct rstp *r; + enum rstp_port_role last_role; + + old_state = p->port_role_transition_sm_state; + r = p->rstp; + last_role = p->role; + + switch (p->port_role_transition_sm_state) { + case PORT_ROLE_TRANSITION_SM_INIT: + if (r->begin) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_INIT_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_INIT_PORT_EXEC: + p->role = ROLE_DISABLED; + p->learn = p->forward = false; + p->synced = false; + p->sync = p->re_root = true; + p->rr_while = p->designated_times.forward_delay; + p->fd_while = p->designated_times.max_age; + p->rb_while = 0; + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DISABLE_PORT_EXEC; + break; + case PORT_ROLE_TRANSITION_SM_DISABLE_PORT_EXEC: + p->role = p->selected_role; + p->learn = p->forward = false; + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DISABLE_PORT; + /* no break */ + case PORT_ROLE_TRANSITION_SM_DISABLE_PORT: + if (check_selected_role_change(p, ROLE_DISABLED)) { + /* Global transition. */ + } else if (p->selected && !p->updt_info && !p->learning + && !p->forwarding) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DISABLED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_DISABLED_PORT_EXEC: + p->fd_while = p->designated_times.max_age; + p->synced = true; + p->rr_while = 0; + p->sync = p->re_root = false; + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DISABLED_PORT; + /* no break */ + case PORT_ROLE_TRANSITION_SM_DISABLED_PORT: + if (check_selected_role_change(p, ROLE_DISABLED)) { + /* Global transition. */ + } else if (p->selected && !p->updt_info + && (p->fd_while != p->designated_times.max_age || p->sync + || p->re_root || !p->synced)) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DISABLED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC: + p->role = ROLE_ROOT; + p->rr_while = p->designated_times.forward_delay; + p->port_role_transition_sm_state = PORT_ROLE_TRANSITION_SM_ROOT_PORT; + /* no break */ + case PORT_ROLE_TRANSITION_SM_ROOT_PORT: + if (check_selected_role_change(p, ROLE_ROOT)) { + /* Global transition. */ + } else if (p->selected && !p->updt_info) { + if (p->rr_while != p->designated_times.forward_delay) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + break; + } else if (p->re_root && p->forward) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_REROOTED_EXEC; + break; + } else if ((p->fd_while == 0 + || ((re_rooted(p) && p->rb_while == 0) + && r->rstp_version)) && !p->learn) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_LEARN_EXEC; + break; + } else if ((p->fd_while == 0 + || ((re_rooted(p) && p->rb_while == 0) + && r->rstp_version)) && p->learn && !p->forward) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_FORWARD_EXEC; + break; + } else if (p->proposed && !p->agree) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PROPOSED_EXEC; + break; + } else if ((all_synced(r) && !p->agree) || + (p->proposed && p->agree)) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_AGREED_EXEC; + break; + } else if (!p->forward && !p->re_root) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_REROOT_EXEC; + break; + } + } + break; + case PORT_ROLE_TRANSITION_SM_REROOT_EXEC: + if (check_selected_role_change(p, ROLE_ROOT)) { + /* Global transition. */ + } else { + set_re_root_tree(p); + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_ROOT_AGREED_EXEC: + if (check_selected_role_change(p, ROLE_ROOT)) { + /* Global transition. */ + } else { + p->proposed = p->sync = false; + p->agree = p->new_info = true; + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_ROOT_PROPOSED_EXEC: + set_sync_tree(p); + p->proposed = false; + if (check_selected_role_change(p, ROLE_ROOT)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_ROOT_FORWARD_EXEC: + p->fd_while = 0; + p->forward = true; + if (check_selected_role_change(p, ROLE_ROOT)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_ROOT_LEARN_EXEC: + p->fd_while = forward_delay(p); + p->learn = true; + if (check_selected_role_change(p, ROLE_ROOT)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_REROOTED_EXEC: + p->re_root = false; + if (check_selected_role_change(p, ROLE_ROOT)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ROOT_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC: + p->role = ROLE_DESIGNATED; + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT; + /* no break */ + case PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT: + if (check_selected_role_change(p, ROLE_DESIGNATED)) { + /* Global transition. */ + } else if (p->selected && !p->updt_info) { + if (((p->sync && !p->synced) + || (p->re_root && p->rr_while != 0) || p->disputed) + && !p->oper_edge && (p->learn || p->forward)) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_DISCARD_EXEC; + } else if ((p->fd_while == 0 || p->agreed || p->oper_edge) + && (p->rr_while == 0 || !p->re_root) + && !p->sync && !p->learn) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_LEARN_EXEC; + } else if ((p->fd_while == 0 || p->agreed || p->oper_edge) + && (p->rr_while == 0 || !p->re_root) + && !p->sync && (p->learn && !p->forward)) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_FORWARD_EXEC; + } else if (!p->forward && !p->agreed && !p->proposing && + !p->oper_edge) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PROPOSE_EXEC; + } else if ((!p->learning && !p->forwarding && !p->synced) + || (p->agreed && !p->synced) + || (p->oper_edge && !p->synced) + || (p->sync && p->synced)) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_SYNCED_EXEC; + } else if (p->rr_while == 0 && p->re_root) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_RETIRED_EXEC; + } + } + break; + case PORT_ROLE_TRANSITION_SM_DESIGNATED_RETIRED_EXEC: + p->re_root = false; + if (check_selected_role_change(p, ROLE_DESIGNATED)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_DESIGNATED_SYNCED_EXEC: + p->rr_while = 0; + p->synced = true; + p->sync = false; + if (check_selected_role_change(p, ROLE_DESIGNATED)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_DESIGNATED_PROPOSE_EXEC: + p->proposing = true; + p->edge_delay_while = edge_delay(p); + p->new_info = true; + if (check_selected_role_change(p, ROLE_DESIGNATED)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_DESIGNATED_FORWARD_EXEC: + p->forward = true; + p->fd_while = 0; + p->agreed = p->send_rstp; + if (check_selected_role_change(p, ROLE_DESIGNATED)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_DESIGNATED_LEARN_EXEC: + p->learn = true; + p->fd_while = forward_delay(p); + if (check_selected_role_change(p, ROLE_DESIGNATED)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_DESIGNATED_DISCARD_EXEC: + p->learn = p->forward = p->disputed = false; + p->fd_while = forward_delay(p); + if (check_selected_role_change(p, ROLE_DESIGNATED)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_DESIGNATED_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC: + p->fd_while = p->designated_times.forward_delay; + p->synced = true; + p->rr_while = 0; + p->sync = p->re_root = false; + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT; + /* no break */ + case PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT: + if (check_selected_role_change(p, ROLE_ALTERNATE)) { + /* Global transition. */ + } else if (p->selected && !p->updt_info) { + if (p->rb_while != 2 * p->designated_times.hello_time + && p->role == ROLE_BACKUP) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_BACKUP_PORT_EXEC; + } else if ((p->fd_while != forward_delay(p)) || p->sync + || p->re_root || !p->synced) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC; + } else if (p->proposed && !p->agree) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_PROPOSED_EXEC; + } else if ((all_synced(r) && !p->agree) + || (p->proposed && p->agree)) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_AGREED_EXEC; + } + } + break; + case PORT_ROLE_TRANSITION_SM_ALTERNATE_AGREED_EXEC: + p->proposed = false; + p->agree = true; + p->new_info = true; + if (check_selected_role_change(p, ROLE_ALTERNATE)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_ALTERNATE_PROPOSED_EXEC: + set_sync_tree(p); + p->proposed = false; + if (check_selected_role_change(p, ROLE_ALTERNATE)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_BLOCK_PORT_EXEC: + p->role = p->selected_role; + p->learn = p->forward = false; + p->port_role_transition_sm_state = PORT_ROLE_TRANSITION_SM_BLOCK_PORT; + /* no break */ + case PORT_ROLE_TRANSITION_SM_BLOCK_PORT: + if (check_selected_role_change(p, ROLE_ALTERNATE)) { + /* Global transition. */ + } else if (p->selected && !p->updt_info && !p->learning && + !p->forwarding) { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC; + } + break; + case PORT_ROLE_TRANSITION_SM_BACKUP_PORT_EXEC: + p->rb_while = 2 * p->designated_times.hello_time; + if (check_selected_role_change(p, ROLE_ALTERNATE)) { + /* Global transition. */ + } else { + p->port_role_transition_sm_state = + PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC; + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->port_role_transition_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: Port_role_transition_sm %d -> %d", + p->rstp->name, p->port_number, old_state, + p->port_role_transition_sm_state); + } + if (last_role != p->role) { + VLOG_DBG("%s, port %u, port role ["RSTP_PORT_ID_FMT"] = %s", + p->rstp->name, p->port_number, p->port_id, + rstp_port_role_name(p->role)); + } + return 0; +} + +/* [17.30 - Port state transition state machine] */ + +static void +enable_learning(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + /* [17.21.6 enableLearning()] An implementation dependent procedure that + * causes the Learning Process (7.8) to start learning from frames received + * on the Port. The procedure does not complete until learning has been + * enabled. + */ + rstp_port_set_state__(p, RSTP_LEARNING); +} + +static void +enable_forwarding(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + /* [17.21.5 enableForwarding()] An implementation dependent procedure that + * causes the Forwarding Process (7.7) to start forwarding frames through + * the Port. The procedure does not complete until forwarding has been + * enabled. + */ + rstp_port_set_state__(p, RSTP_FORWARDING); +} + +static void +disable_learning(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + /* [17.21.4 - disableLearning()] An implementation dependent procedure that + * causes the Learning Process (7.8) to stop learning from the source + * address of frames received on the Port. The procedure does not complete + * until learning has stopped. + */ + rstp_port_set_state__(p, RSTP_DISCARDING); +} + +static void +disable_forwarding(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + /* [17.21.3 - disableForwarding()] An implementation dependent procedure + * that causes the Forwarding Process (7.7) to stop forwarding frames + * through the Port. The procedure does not complete until forwarding has + * stopped. + */ + rstp_port_set_state__(p, RSTP_DISCARDING); +} + +static int +port_state_transition_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum port_state_transition_state_machine old_state; + struct rstp *r; + + old_state = p->port_state_transition_sm_state; + r = p->rstp; + + switch (p->port_state_transition_sm_state) { + case PORT_STATE_TRANSITION_SM_INIT: + if (r->begin) { + p->port_state_transition_sm_state = + PORT_STATE_TRANSITION_SM_DISCARDING_EXEC; + } + break; + case PORT_STATE_TRANSITION_SM_DISCARDING_EXEC: + disable_learning(p); + p->learning = false; + disable_forwarding(p); + p->forwarding = false; + p->port_state_transition_sm_state = + PORT_STATE_TRANSITION_SM_DISCARDING; + /* no break */ + case PORT_STATE_TRANSITION_SM_DISCARDING: + if (p->learn) { + p->port_state_transition_sm_state = + PORT_STATE_TRANSITION_SM_LEARNING_EXEC; + } + break; + case PORT_STATE_TRANSITION_SM_LEARNING_EXEC: + enable_learning(p); + p->learning = true; + p->port_state_transition_sm_state = PORT_STATE_TRANSITION_SM_LEARNING; + /* no break */ + case PORT_STATE_TRANSITION_SM_LEARNING: + if (!p->learn) { + p->port_state_transition_sm_state = + PORT_STATE_TRANSITION_SM_DISCARDING_EXEC; + } else if (p->forward) { + p->port_state_transition_sm_state = + PORT_STATE_TRANSITION_SM_FORWARDING_EXEC; + } + break; + case PORT_STATE_TRANSITION_SM_FORWARDING_EXEC: + enable_forwarding(p); + p->forwarding = true; + p->port_state_transition_sm_state = + PORT_STATE_TRANSITION_SM_FORWARDING; + /* no break */ + case PORT_STATE_TRANSITION_SM_FORWARDING: + if (!p->forward) { + p->port_state_transition_sm_state = + PORT_STATE_TRANSITION_SM_DISCARDING_EXEC; + } + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->port_state_transition_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: Port_state_transition_sm %d -> %d", + p->rstp->name, p->port_number, old_state, + p->port_state_transition_sm_state); + } + return 0; +} + +/* [17.31 - Topology Change state machine] */ + +static void +new_tc_while(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *r; + + r = p->rstp; + if (p->tc_while == 0 && p->send_rstp == true) { + p->tc_while = r->bridge_hello_time + 1; + p->new_info = true; + } else if (p->tc_while == 0 && p->send_rstp == false) { + p->tc_while = r->bridge_max_age + r->bridge_forward_delay; + } +} + +/* [17.21.18 setTcPropTree()] + * Sets tcprop for all Ports except the Port that called the procedure. + */ +static void +set_tc_prop_tree(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + struct rstp *r; + struct rstp_port *p1; + + r = p->rstp; + HMAP_FOR_EACH (p1, node, &r->ports) { + /* Set tc_prop on every port, except the one calling this + * function. */ + if (p1->port_number != p->port_number) { + p1->tc_prop = true; + } + } +} + +static void +set_tc_prop_bridge(struct rstp_port *p) /* not specified in 802.1D-2004. */ + OVS_REQUIRES(rstp_mutex) +{ + set_tc_prop_tree(p); /* see 802.1w-2001. */ +} + +static int +topology_change_sm(struct rstp_port *p) + OVS_REQUIRES(rstp_mutex) +{ + enum topology_change_state_machine old_state; + struct rstp *r; + + old_state = p->topology_change_sm_state; + r = p->rstp; + + switch (p->topology_change_sm_state) { + case TOPOLOGY_CHANGE_SM_INIT: + if (r->begin) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_INACTIVE_EXEC; + } + break; + case TOPOLOGY_CHANGE_SM_INACTIVE_EXEC: + p->fdb_flush = true; + p->tc_while = 0; + p->tc_ack = false; + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_INACTIVE; + /* no break */ + case TOPOLOGY_CHANGE_SM_INACTIVE: + if (p->learn && !p->fdb_flush) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_LEARNING_EXEC; + } + break; + case TOPOLOGY_CHANGE_SM_LEARNING_EXEC: + p->rcvd_tc = p->rcvd_tcn = p->rcvd_tc_ack = false; + p->tc_prop = p->rcvd_tc_ack = false; + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_LEARNING; + /* no break */ + case TOPOLOGY_CHANGE_SM_LEARNING: + if (p->role != ROLE_ROOT && p->role != ROLE_DESIGNATED && + !(p->learn || p->learning) && !(p->rcvd_tc || p->rcvd_tcn || + p->rcvd_tc_ack || p->tc_prop)) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_INACTIVE_EXEC; + } else if (p->rcvd_tc || p->rcvd_tcn || p->rcvd_tc_ack || p->tc_prop) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_LEARNING_EXEC; + } else if ((p->role == ROLE_ROOT || p->role == ROLE_DESIGNATED) + && p->forward && !p->oper_edge) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_DETECTED_EXEC; + } + break; + case TOPOLOGY_CHANGE_SM_DETECTED_EXEC: + new_tc_while(p); + set_tc_prop_tree(p); + p->new_info = true; + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_ACTIVE_EXEC; + /* no break */ + case TOPOLOGY_CHANGE_SM_ACTIVE_EXEC: + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_ACTIVE; + /* no break */ + case TOPOLOGY_CHANGE_SM_ACTIVE: + if ((p->role != ROLE_ROOT && p->role != ROLE_DESIGNATED) + || p->oper_edge) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_LEARNING_EXEC; + } else if (p->rcvd_tcn) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_NOTIFIED_TCN_EXEC; + } else if (p->rcvd_tc) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_NOTIFIED_TC_EXEC; + } else if (p->tc_prop && !p->oper_edge) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_PROPAGATING_EXEC; + } else if (p->rcvd_tc_ack) { + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_ACKNOWLEDGED_EXEC; + } + break; + case TOPOLOGY_CHANGE_SM_ACKNOWLEDGED_EXEC: + p->tc_while = 0; + p->rcvd_tc_ack = false; + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_ACTIVE; + break; + case TOPOLOGY_CHANGE_SM_PROPAGATING_EXEC: + new_tc_while(p); + p->fdb_flush = true; + p->tc_prop = false; + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_ACTIVE; + break; + case TOPOLOGY_CHANGE_SM_NOTIFIED_TC_EXEC: + p->rcvd_tcn = p->rcvd_tc = false; + if (p->role == ROLE_DESIGNATED) { + p->tc_ack = true; + } + set_tc_prop_bridge(p); + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_ACTIVE; + break; + case TOPOLOGY_CHANGE_SM_NOTIFIED_TCN_EXEC: + new_tc_while(p); + p->topology_change_sm_state = TOPOLOGY_CHANGE_SM_NOTIFIED_TC_EXEC; + break; + default: + OVS_NOT_REACHED(); + /* no break */ + } + if (old_state != p->topology_change_sm_state) { + r->changes = true; + VLOG_DBG("%s, port %u: Topology_change_sm %d -> %d", p->rstp->name, + p->port_number, old_state, p->topology_change_sm_state); + } + return 0; +} + +/**************************************************************************** + * [17.6] Priority vector calculation helper functions + ****************************************************************************/ + +/* compare_rstp_priority_vectors() compares two struct rstp_priority_vectors + * and returns a value indicating if the first rstp_priority_vector is + * superior, same or inferior to the second one. + * + * Zero return value indicates INFERIOR, a non-zero return value indicates + * SUPERIOR. When it makes a difference the non-zero return value SAME + * indicates the priority vectors are identical (a subset of SUPERIOR). + */ +static enum vector_comparison +compare_rstp_priority_vectors(const struct rstp_priority_vector *v1, + const struct rstp_priority_vector *v2) +{ + VLOG_DBG("v1: "RSTP_ID_FMT", %u, "RSTP_ID_FMT", %d, %d", + RSTP_ID_ARGS(v1->root_bridge_id), v1->root_path_cost, + RSTP_ID_ARGS(v1->designated_bridge_id), v1->designated_port_id, + v1->bridge_port_id); + VLOG_DBG("v2: "RSTP_ID_FMT", %u, "RSTP_ID_FMT", %d, %d", + RSTP_ID_ARGS(v2->root_bridge_id), v2->root_path_cost, + RSTP_ID_ARGS(v2->designated_bridge_id), v2->designated_port_id, + v2->bridge_port_id); + + /* [17.6] + * This message priority vector is superior to the port priority vector and + * will replace it if, and only if, the message priority vector is better + * than the port priority vector, or the message has been transmitted from + * the same Designated Bridge and Designated Port as the port priority + * vector, i.e., if the following is true: + * + * ((RD < RootBridgeID)) || + * ((RD == RootBridgeID) && (RPCD < RootPathCost)) || + * ((RD == RootBridgeID) && (RPCD == RootPathCost) && + * (D < designated_bridge_id)) || + * ((RD == RootBridgeID) && (RPCD == RootPathCost) && + * (D == designated_bridge_id) && (PD < designated_port_id)) || + * ((D == designated_bridge_id.BridgeAddress) && + * (PD == designated_port_id.PortNumber)) + */ + if ((v1->root_bridge_id < v2->root_bridge_id) + || (v1->root_bridge_id == v2->root_bridge_id + && v1->root_path_cost < v2->root_path_cost) + || (v1->root_bridge_id == v2->root_bridge_id + && v1->root_path_cost == v2->root_path_cost + && v1->designated_bridge_id < v2->designated_bridge_id) + || (v1->root_bridge_id == v2->root_bridge_id + && v1->root_path_cost == v2->root_path_cost + && v1->designated_bridge_id == v2->designated_bridge_id + && v1->designated_port_id < v2->designated_port_id) + || (v1->designated_bridge_id == v2->designated_bridge_id + && v1->designated_port_id == v2->designated_port_id)) { + /* SAME is a subset of SUPERIOR. */ + if (v1->root_bridge_id == v2->root_bridge_id + && v1->root_path_cost == v2->root_path_cost + && v1->designated_bridge_id == v2->designated_bridge_id + && v1->designated_port_id == v2->designated_port_id) { + if (v1->bridge_port_id < v2->bridge_port_id) { + VLOG_DBG("superior"); + return SUPERIOR; + } + else if (v1->bridge_port_id > v2->bridge_port_id) { + VLOG_DBG("inferior"); + return INFERIOR; + } + VLOG_DBG("superior_same"); + return SAME; + } + VLOG_DBG("superior"); + return SUPERIOR; + } + + VLOG_DBG("inferior"); + return INFERIOR; +} + +static bool +rstp_times_equal(struct rstp_times *t1, struct rstp_times *t2) +{ + return t1->forward_delay == t2->forward_delay + && t1->hello_time == t2->hello_time + && t1->max_age == t2->max_age + && t1->message_age == t2->message_age; +} diff -Nru openvswitch-2.3.1/lib/rstp-state-machines.h openvswitch-2.4.0~git20150623/lib/rstp-state-machines.h --- openvswitch-2.3.1/lib/rstp-state-machines.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rstp-state-machines.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2011-2014 M3S, Srl - Italy + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Rapid Spanning Tree Protocol (IEEE 802.1D-2004) state machines + * implementation (header file). + * + * Authors: + * Martino Fornasa + * Daniele Venturino + * + * References to IEEE 802.1D-2004 standard are enclosed in square brackets. + * E.g. [17.3], [Table 17-1], etc. + * + */ + +#ifndef RSTP_STATE_MACHINES_H +#define RSTP_STATE_MACHINES_H 1 + +#include "rstp-common.h" + +/* Methods called by the Forwarding Layer, through functions of rstp.h. */ +int move_rstp__(struct rstp *) + OVS_REQUIRES(rstp_mutex); +void decrease_rstp_port_timers__(struct rstp *) + OVS_REQUIRES(rstp_mutex); +void process_received_bpdu__(struct rstp_port *, const void *, size_t) + OVS_REQUIRES(rstp_mutex); + +void updt_roles_tree__(struct rstp *) + OVS_REQUIRES(rstp_mutex); + +#endif /* rstp-state-machines.h */ diff -Nru openvswitch-2.3.1/lib/rtbsd.c openvswitch-2.4.0~git20150623/lib/rtbsd.c --- openvswitch-2.3.1/lib/rtbsd.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rtbsd.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,20 +26,23 @@ #include "coverage.h" #include "socket-util.h" #include "poll-loop.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #include "rtbsd.h" VLOG_DEFINE_THIS_MODULE(rtbsd); COVERAGE_DEFINE(rtbsd_changed); +static struct ovs_mutex rtbsd_mutex = OVS_MUTEX_INITIALIZER; + /* PF_ROUTE socket. */ static int notify_sock = -1; /* All registered notifiers. */ -static struct list all_notifiers = LIST_INITIALIZER(&all_notifiers); +static struct ovs_list all_notifiers = OVS_LIST_INITIALIZER(&all_notifiers); -static void rtbsd_report_change(const struct if_msghdr *); -static void rtbsd_report_notify_error(void); +static void rtbsd_report_change(const struct if_msghdr *) + OVS_REQUIRES(rtbsd_mutex); +static void rtbsd_report_notify_error(void) OVS_REQUIRES(rtbsd_mutex); /* Registers 'cb' to be called with auxiliary data 'aux' with network device * change notifications. The notifier is stored in 'notifier', which the @@ -49,53 +52,63 @@ int rtbsd_notifier_register(struct rtbsd_notifier *notifier, rtbsd_notify_func *cb, void *aux) + OVS_EXCLUDED(rtbsd_mutex) { + int error = 0; + + ovs_mutex_lock(&rtbsd_mutex); if (notify_sock < 0) { - int error; notify_sock = socket(PF_ROUTE, SOCK_RAW, 0); if (notify_sock < 0) { VLOG_WARN("could not create PF_ROUTE socket: %s", ovs_strerror(errno)); - return errno; + error = errno; + goto out; } error = set_nonblocking(notify_sock); if (error) { VLOG_WARN("error set_nonblocking PF_ROUTE socket: %s", ovs_strerror(error)); - return error; + goto out; } - } else { - /* Catch up on notification work so that the new notifier won't - * receive any stale notifications. XXX*/ - rtbsd_notifier_run(); } list_push_back(&all_notifiers, ¬ifier->node); notifier->cb = cb; notifier->aux = aux; - return 0; + +out: + ovs_mutex_unlock(&rtbsd_mutex); + return error; } /* Cancels notification on 'notifier', which must have previously been * registered with rtbsd_notifier_register(). */ void rtbsd_notifier_unregister(struct rtbsd_notifier *notifier) + OVS_EXCLUDED(rtbsd_mutex) { + ovs_mutex_lock(&rtbsd_mutex); list_remove(¬ifier->node); if (list_is_empty(&all_notifiers)) { close(notify_sock); notify_sock = -1; } + ovs_mutex_unlock(&rtbsd_mutex); } /* Calls all of the registered notifiers, passing along any as-yet-unreported * netdev change events. */ void rtbsd_notifier_run(void) + OVS_EXCLUDED(rtbsd_mutex) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); struct if_msghdr msg; + + ovs_mutex_lock(&rtbsd_mutex); if (notify_sock < 0) { + ovs_mutex_unlock(&rtbsd_mutex); return; } @@ -114,6 +127,7 @@ rtbsd_report_change(&msg); } } else if (errno == EAGAIN) { + ovs_mutex_unlock(&rtbsd_mutex); return; } else { if (errno == ENOBUFS) { @@ -131,14 +145,18 @@ * ready. */ void rtbsd_notifier_wait(void) + OVS_EXCLUDED(rtbsd_mutex) { + ovs_mutex_lock(&rtbsd_mutex); if (notify_sock >= 0) { poll_fd_wait(notify_sock, POLLIN); } + ovs_mutex_unlock(&rtbsd_mutex); } static void rtbsd_report_change(const struct if_msghdr *msg) + OVS_REQUIRES(rtbsd_mutex) { struct rtbsd_notifier *notifier; struct rtbsd_change change; @@ -158,6 +176,7 @@ /* If an error occurs the notifiers' callbacks are called with NULL changes */ static void rtbsd_report_notify_error(void) + OVS_REQUIRES(rtbsd_mutex) { struct rtbsd_notifier *notifier; diff -Nru openvswitch-2.3.1/lib/rtbsd.h openvswitch-2.4.0~git20150623/lib/rtbsd.h --- openvswitch-2.3.1/lib/rtbsd.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rtbsd.h 2015-06-23 18:46:21.000000000 +0000 @@ -44,7 +44,7 @@ typedef void rtbsd_notify_func(const struct rtbsd_change *, void *aux); struct rtbsd_notifier { - struct list node; + struct ovs_list node; rtbsd_notify_func *cb; void *aux; }; diff -Nru openvswitch-2.3.1/lib/rtnetlink-link.c openvswitch-2.4.0~git20150623/lib/rtnetlink-link.c --- openvswitch-2.3.1/lib/rtnetlink-link.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/rtnetlink-link.c 2015-06-23 18:46:21.000000000 +0000 @@ -58,7 +58,7 @@ const struct nlmsghdr *nlmsg; const struct ifinfomsg *ifinfo; - nlmsg = ofpbuf_data(buf); + nlmsg = buf->data; ifinfo = ofpbuf_at(buf, NLMSG_HDRLEN, sizeof *ifinfo); change->nlmsg_type = nlmsg->nlmsg_type; diff -Nru openvswitch-2.3.1/lib/sat-math.h openvswitch-2.4.0~git20150623/lib/sat-math.h --- openvswitch-2.3.1/lib/sat-math.h 2013-10-18 20:33:47.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/sat-math.h 2015-06-23 18:46:21.000000000 +0000 @@ -18,6 +18,7 @@ #define SAT_MATH_H 1 #include +#include "openvswitch/util.h" /* Saturating addition: overflow yields UINT_MAX. */ static inline unsigned int @@ -33,15 +34,10 @@ return x >= y ? x - y : 0; } -/* Saturating multiplication of "unsigned int"s: overflow yields UINT_MAX. */ -#define SAT_MUL(X, Y) \ - ((Y) == 0 ? 0 \ - : (X) <= UINT_MAX / (Y) ? (unsigned int) (X) * (unsigned int) (Y) \ - : UINT_MAX) static inline unsigned int sat_mul(unsigned int x, unsigned int y) { - return SAT_MUL(x, y); + return OVS_SAT_MUL(x, y); } #endif /* sat-math.h */ diff -Nru openvswitch-2.3.1/lib/seq.c openvswitch-2.4.0~git20150623/lib/seq.c --- openvswitch-2.3.1/lib/seq.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/seq.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Nicira, Inc. + * Copyright (c) 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,15 +39,15 @@ struct hmap_node hmap_node OVS_GUARDED; /* In 'seq->waiters'. */ unsigned int ovsthread_id OVS_GUARDED; /* Key in 'waiters' hmap. */ - struct seq_thread *thread OVS_GUARDED; /* Thread preparing to wait. */ - struct list list_node OVS_GUARDED; /* In 'thread->waiters'. */ + struct seq_thread *thread OVS_GUARDED; /* Thread preparing to wait. */ + struct ovs_list list_node OVS_GUARDED; /* In 'thread->waiters'. */ uint64_t value OVS_GUARDED; /* seq->value we're waiting to change. */ }; /* A thread that might be waiting on one or more seqs. */ struct seq_thread { - struct list waiters OVS_GUARDED; /* Contains 'struct seq_waiter's. */ + struct ovs_list waiters OVS_GUARDED; /* Contains 'struct seq_waiter's. */ struct latch latch OVS_GUARDED; /* Wakeup latch for this thread. */ bool waiting OVS_GUARDED; /* True if latch_wait() already called. */ }; @@ -125,7 +125,7 @@ } static void -seq_wait__(struct seq *seq, uint64_t value) +seq_wait__(struct seq *seq, uint64_t value, const char *where) OVS_REQUIRES(seq_mutex) { unsigned int id = ovsthread_id_self(); @@ -137,7 +137,7 @@ if (waiter->value != value) { /* The current value is different from the value we've already * waited for, */ - poll_immediate_wake(); + poll_immediate_wake_at(where); } else { /* Already waiting on 'value', nothing more to do. */ } @@ -154,7 +154,7 @@ list_push_back(&waiter->thread->waiters, &waiter->list_node); if (!waiter->thread->waiting) { - latch_wait(&waiter->thread->latch); + latch_wait_at(&waiter->thread->latch, where); waiter->thread->waiting = true; } } @@ -165,18 +165,22 @@ * * seq_read() and seq_wait() can be used together to yield a race-free wakeup * when an object changes, even without an ability to lock the object. See - * Usage in seq.h for details. */ + * Usage in seq.h for details. + * + * ('where' is used in debug logging. Commonly one would use seq_wait() to + * automatically provide the caller's source file and line number for + * 'where'.) */ void -seq_wait(const struct seq *seq_, uint64_t value) +seq_wait_at(const struct seq *seq_, uint64_t value, const char *where) OVS_EXCLUDED(seq_mutex) { struct seq *seq = CONST_CAST(struct seq *, seq_); ovs_mutex_lock(&seq_mutex); if (value == seq->value) { - seq_wait__(seq, value); + seq_wait__(seq, value, where); } else { - poll_immediate_wake(); + poll_immediate_wake_at(where); } ovs_mutex_unlock(&seq_mutex); } diff -Nru openvswitch-2.3.1/lib/seq.h openvswitch-2.4.0~git20150623/lib/seq.h --- openvswitch-2.3.1/lib/seq.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/seq.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Nicira, Inc. + * Copyright (c) 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ * e.g.: * * struct ovs_mutex mutex; - * struct list queue OVS_GUARDED_BY(mutex); + * struct ovs_list queue OVS_GUARDED_BY(mutex); * struct seq nonempty_seq; * * To add an element to the queue: @@ -107,10 +107,15 @@ * Thread-safety * ============= * - * Fully thread safe. + * Fully thread safe. seq_change() synchronizes with seq_read() and + * seq_wait() on the same variable in release-acquire fashion. That + * is, all effects of the memory accesses performed by a thread prior + * to seq_change() are visible to the threads returning from + * seq_read() or seq_wait() observing that change. */ #include +#include "util.h" /* For implementation of an object with a sequence number attached. */ struct seq *seq_create(void); @@ -119,7 +124,9 @@ /* For observers. */ uint64_t seq_read(const struct seq *); -void seq_wait(const struct seq *, uint64_t value); + +void seq_wait_at(const struct seq *, uint64_t value, const char *where); +#define seq_wait(seq, value) seq_wait_at(seq, value, OVS_SOURCE_LOCATOR) /* For poll_block() internal use. */ void seq_woke(void); diff -Nru openvswitch-2.3.1/lib/sflow_agent.c openvswitch-2.4.0~git20150623/lib/sflow_agent.c --- openvswitch-2.3.1/lib/sflow_agent.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/sflow_agent.c 2015-06-23 18:46:21.000000000 +0000 @@ -363,6 +363,21 @@ return NULL; } +/*_________________-----------------------------------__________________ + _________________ sfl_agent_getPollerByBridgePort __________________ + -----------------___________________________________------------------ +*/ + +SFLPoller *sfl_agent_getPollerByBridgePort(SFLAgent *agent, uint32_t port_no) +{ + /* find it and return it */ + SFLPoller *pl = agent->pollers; + for(; pl != NULL; pl = pl->nxt) + if(pl->bridgePort == port_no) return pl; + /* not found */ + return NULL; +} + /*_________________---------------------------__________________ _________________ sfl_agent_getReceiver __________________ -----------------___________________________------------------ diff -Nru openvswitch-2.3.1/lib/sflow_api.h openvswitch-2.4.0~git20150623/lib/sflow_api.h --- openvswitch-2.3.1/lib/sflow_api.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/sflow_api.h 2015-06-23 18:46:21.000000000 +0000 @@ -281,6 +281,7 @@ to get counters if it is not the same as the global ifIndex */ void sfl_poller_set_bridgePort(SFLPoller *poller, u_int32_t port_no); u_int32_t sfl_poller_get_bridgePort(SFLPoller *poller); +SFLPoller *sfl_agent_getPollerByBridgePort(SFLAgent *agent, u_int32_t port_no); /* call this to indicate a discontinuity with a counter like samplePool so that the sflow collector will ignore the next delta */ diff -Nru openvswitch-2.3.1/lib/sflow.h openvswitch-2.4.0~git20150623/lib/sflow.h --- openvswitch-2.3.1/lib/sflow.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/sflow.h 2015-06-23 18:46:21.000000000 +0000 @@ -271,6 +271,10 @@ innermost. */ } SFLExtended_vlan_tunnel; +typedef struct _SFLExtended_vni { + uint32_t vni; /* virtual network identifier */ +} SFLExtended_vni; + enum SFLFlow_type_tag { /* enterprise = 0, format = ... */ SFLFLOW_HEADER = 1, /* Packet headers are sampled */ @@ -289,6 +293,10 @@ SFLFLOW_EX_MPLS_FTN = 1010, SFLFLOW_EX_MPLS_LDP_FEC = 1011, SFLFLOW_EX_VLAN_TUNNEL = 1012, /* VLAN stack */ + SFLFLOW_EX_IPV4_TUNNEL_EGRESS = 1023, /* http://sflow.org/sflow_tunnels.txt */ + SFLFLOW_EX_IPV4_TUNNEL_INGRESS = 1024, + SFLFLOW_EX_VNI_EGRESS = 1029, + SFLFLOW_EX_VNI_INGRESS = 1030, }; typedef union _SFLFlow_type { @@ -308,6 +316,7 @@ SFLExtended_mpls_FTN mpls_ftn; SFLExtended_mpls_LDP_FEC mpls_ldp_fec; SFLExtended_vlan_tunnel vlan_tunnel; + SFLExtended_vni tunnel_vni; } SFLFlow_type; typedef struct _SFLFlow_sample_element { @@ -386,6 +395,9 @@ /* Counter types */ +#define SFL_UNDEF_COUNTER(c) c=-1 +#define SFL_UNDEF_GAUGE(c) c=0 + /* Generic interface counters - see RFC 1573, 2233 */ typedef struct _SFLIf_counters { @@ -414,6 +426,8 @@ u_int32_t ifPromiscuousMode; } SFLIf_counters; +#define SFL_CTR_GENERIC_XDR_SIZE 88 + /* Ethernet interface counters - see RFC 2358 */ typedef struct _SFLEthernet_counters { u_int32_t dot3StatsAlignmentErrors; @@ -431,6 +445,8 @@ u_int32_t dot3StatsSymbolErrors; } SFLEthernet_counters; +#define SFL_CTR_ETHERNET_XDR_SIZE 52 + /* Token ring counters - see RFC 1748 */ typedef struct _SFLTokenring_counters { @@ -482,6 +498,79 @@ u_int32_t discards; } SFLVlan_counters; +/* OpenFlow port */ +typedef struct { + u_int64_t datapath_id; + u_int32_t port_no; +} SFLOpenFlowPort; + +#define SFL_CTR_OPENFLOWPORT_XDR_SIZE 12 + +/* port name */ +typedef struct { + SFLString portName; +} SFLPortName; + +#define SFL_MAX_PORTNAME_LEN 255 + +/* LAG Port Statistics - see http://sflow.org/sflow_lag.txt */ +/* opaque = counter_data; enterprise = 0; format = 7 */ + +typedef union _SFLLACP_portState { + uint32_t all; + struct { + uint8_t actorAdmin; + uint8_t actorOper; + uint8_t partnerAdmin; + uint8_t partnerOper; + } v; +} SFLLACP_portState; + +typedef struct _SFLLACP_counters { + uint8_t actorSystemID[8]; /* 6 bytes + 2 pad */ + uint8_t partnerSystemID[8]; /* 6 bytes + 2 pad */ + uint32_t attachedAggID; + SFLLACP_portState portState; + uint32_t LACPDUsRx; + uint32_t markerPDUsRx; + uint32_t markerResponsePDUsRx; + uint32_t unknownRx; + uint32_t illegalRx; + uint32_t LACPDUsTx; + uint32_t markerPDUsTx; + uint32_t markerResponsePDUsTx; +} SFLLACP_counters; + +#define SFL_CTR_LACP_XDR_SIZE 56 + +/* Application resource counters */ + +typedef struct _SFLAPPResources_counters { + uint32_t user_time; /* in milliseconds */ + uint32_t system_time; /* in milliseconds */ + uint64_t mem_used; + uint64_t mem_max; + uint32_t fd_open; + uint32_t fd_max; + uint32_t conn_open; + uint32_t conn_max; +} SFLAPPResources_counters; + +#define SFL_CTR_APP_RESOURCES_XDR_SIZE 40 + +/* OVS datapath stats */ + +typedef struct _SFLOVSDP_counters { + uint32_t n_hit; + uint32_t n_missed; + uint32_t n_lost; + uint32_t n_mask_hit; + uint32_t n_flows; + uint32_t n_masks; +} SFLOVSDP_counters; + +#define SFL_CTR_OVSDP_XDR_SIZE 24 + /* Counters data */ enum SFLCounters_type_tag { @@ -490,7 +579,12 @@ SFLCOUNTERS_ETHERNET = 2, SFLCOUNTERS_TOKENRING = 3, SFLCOUNTERS_VG = 4, - SFLCOUNTERS_VLAN = 5 + SFLCOUNTERS_VLAN = 5, + SFLCOUNTERS_LACP = 7, + SFLCOUNTERS_OPENFLOWPORT = 1004, + SFLCOUNTERS_PORTNAME = 1005, + SFLCOUNTERS_APP_RESOURCES = 2203, + SFLCOUNTERS_OVSDP = 2207 }; typedef union _SFLCounters_type { @@ -499,6 +593,11 @@ SFLTokenring_counters tokenring; SFLVg_counters vg; SFLVlan_counters vlan; + SFLLACP_counters lacp; + SFLOpenFlowPort ofPort; + SFLPortName portName; + SFLAPPResources_counters appResources; + SFLOVSDP_counters ovsdp; } SFLCounters_type; typedef struct _SFLCounters_sample_element { diff -Nru openvswitch-2.3.1/lib/sflow_receiver.c openvswitch-2.4.0~git20150623/lib/sflow_receiver.c --- openvswitch-2.3.1/lib/sflow_receiver.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/sflow_receiver.c 2015-06-23 18:46:21.000000000 +0000 @@ -464,6 +464,14 @@ case SFLFLOW_EX_MPLS_FTN: elemSiz = mplsFtnEncodingLength(&elem->flowType.mpls_ftn); break; case SFLFLOW_EX_MPLS_LDP_FEC: elemSiz = mplsLdpFecEncodingLength(&elem->flowType.mpls_ldp_fec); break; case SFLFLOW_EX_VLAN_TUNNEL: elemSiz = vlanTunnelEncodingLength(&elem->flowType.vlan_tunnel); break; + case SFLFLOW_EX_IPV4_TUNNEL_EGRESS: + case SFLFLOW_EX_IPV4_TUNNEL_INGRESS: + elemSiz = sizeof(SFLSampled_ipv4); + break; + case SFLFLOW_EX_VNI_EGRESS: + case SFLFLOW_EX_VNI_INGRESS: + elemSiz = sizeof(SFLExtended_vni); + break; default: sflError(receiver, "unexpected packet_data_tag"); return -1; @@ -560,6 +568,8 @@ putNet32(receiver, elem->flowType.ethernet.eth_type); break; case SFLFLOW_IPV4: + case SFLFLOW_EX_IPV4_TUNNEL_EGRESS: + case SFLFLOW_EX_IPV4_TUNNEL_INGRESS: putNet32(receiver, elem->flowType.ipv4.length); putNet32(receiver, elem->flowType.ipv4.protocol); put32(receiver, elem->flowType.ipv4.src_ip.addr); @@ -591,6 +601,11 @@ case SFLFLOW_EX_MPLS_FTN: putMplsFtn(receiver, &elem->flowType.mpls_ftn); break; case SFLFLOW_EX_MPLS_LDP_FEC: putMplsLdpFec(receiver, &elem->flowType.mpls_ldp_fec); break; case SFLFLOW_EX_VLAN_TUNNEL: putVlanTunnel(receiver, &elem->flowType.vlan_tunnel); break; + case SFLFLOW_EX_VNI_EGRESS: + case SFLFLOW_EX_VNI_INGRESS: + putNet32(receiver, elem->flowType.tunnel_vni.vni); + break; + default: sflError(receiver, "unexpected packet_data_tag"); return -1; @@ -629,11 +644,16 @@ cs->num_elements++; siz += 8; /* tag, length */ switch(elem->tag) { - case SFLCOUNTERS_GENERIC: elemSiz = sizeof(elem->counterBlock.generic); break; - case SFLCOUNTERS_ETHERNET: elemSiz = sizeof(elem->counterBlock.ethernet); break; + case SFLCOUNTERS_GENERIC: elemSiz = SFL_CTR_GENERIC_XDR_SIZE; break; + case SFLCOUNTERS_ETHERNET: elemSiz = SFL_CTR_ETHERNET_XDR_SIZE; break; case SFLCOUNTERS_TOKENRING: elemSiz = sizeof(elem->counterBlock.tokenring); break; case SFLCOUNTERS_VG: elemSiz = sizeof(elem->counterBlock.vg); break; case SFLCOUNTERS_VLAN: elemSiz = sizeof(elem->counterBlock.vlan); break; + case SFLCOUNTERS_LACP: elemSiz = SFL_CTR_LACP_XDR_SIZE; break; + case SFLCOUNTERS_OPENFLOWPORT: elemSiz = SFL_CTR_OPENFLOWPORT_XDR_SIZE; break; + case SFLCOUNTERS_PORTNAME: elemSiz = stringEncodingLength(&elem->counterBlock.portName.portName); break; + case SFLCOUNTERS_APP_RESOURCES: elemSiz = SFL_CTR_APP_RESOURCES_XDR_SIZE; break; + case SFLCOUNTERS_OVSDP: elemSiz = SFL_CTR_OVSDP_XDR_SIZE; break; default: sflError(receiver, "unexpected counters_tag"); return -1; @@ -735,6 +755,45 @@ putNet32(receiver, elem->counterBlock.vlan.broadcastPkts); putNet32(receiver, elem->counterBlock.vlan.discards); break; + case SFLCOUNTERS_LACP: + putMACAddress(receiver, elem->counterBlock.lacp.actorSystemID); + putMACAddress(receiver, elem->counterBlock.lacp.partnerSystemID); + putNet32(receiver, elem->counterBlock.lacp.attachedAggID); + put32(receiver, elem->counterBlock.lacp.portState.all); + putNet32(receiver, elem->counterBlock.lacp.LACPDUsRx); + putNet32(receiver, elem->counterBlock.lacp.markerPDUsRx); + putNet32(receiver, elem->counterBlock.lacp.markerResponsePDUsRx); + putNet32(receiver, elem->counterBlock.lacp.unknownRx); + putNet32(receiver, elem->counterBlock.lacp.illegalRx); + putNet32(receiver, elem->counterBlock.lacp.LACPDUsTx); + putNet32(receiver, elem->counterBlock.lacp.markerPDUsTx); + putNet32(receiver, elem->counterBlock.lacp.markerResponsePDUsTx); + break; + case SFLCOUNTERS_OPENFLOWPORT: + putNet64(receiver, elem->counterBlock.ofPort.datapath_id); + putNet32(receiver, elem->counterBlock.ofPort.port_no); + break; + case SFLCOUNTERS_PORTNAME: + putString(receiver, &elem->counterBlock.portName.portName); + break; + case SFLCOUNTERS_APP_RESOURCES: + putNet32(receiver, elem->counterBlock.appResources.user_time); + putNet32(receiver, elem->counterBlock.appResources.system_time); + putNet64(receiver, elem->counterBlock.appResources.mem_used); + putNet64(receiver, elem->counterBlock.appResources.mem_max); + putNet32(receiver, elem->counterBlock.appResources.fd_open); + putNet32(receiver, elem->counterBlock.appResources.fd_max); + putNet32(receiver, elem->counterBlock.appResources.conn_open); + putNet32(receiver, elem->counterBlock.appResources.conn_max); + break; + case SFLCOUNTERS_OVSDP: + putNet32(receiver, elem->counterBlock.ovsdp.n_hit); + putNet32(receiver, elem->counterBlock.ovsdp.n_missed); + putNet32(receiver, elem->counterBlock.ovsdp.n_lost); + putNet32(receiver, elem->counterBlock.ovsdp.n_mask_hit); + putNet32(receiver, elem->counterBlock.ovsdp.n_flows); + putNet32(receiver, elem->counterBlock.ovsdp.n_masks); + break; default: sflError(receiver, "unexpected counters_tag"); return -1; diff -Nru openvswitch-2.3.1/lib/signals.c openvswitch-2.4.0~git20150623/lib/signals.c --- openvswitch-2.3.1/lib/signals.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/signals.c 2015-06-23 18:46:21.000000000 +0000 @@ -25,7 +25,7 @@ #include "socket-util.h" #include "type-props.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(signals); diff -Nru openvswitch-2.3.1/lib/smap.c openvswitch-2.4.0~git20150623/lib/smap.c --- openvswitch-2.3.1/lib/smap.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/smap.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 Nicira, Inc. +/* Copyright (c) 2012, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,6 +53,15 @@ hash_bytes(key, key_len, 0)); } +/* Adds 'key' paired with 'value' to 'smap'. Takes ownership of 'key' and + * 'value' (which will eventually be freed with free()). It is the caller's + * responsibility to avoid duplicate keys if desirable. */ +struct smap_node * +smap_add_nocopy(struct smap *smap, char *key, char *value) +{ + return smap_add__(smap, key, value, hash_bytes(key, strlen(key), 0)); +} + /* Attempts to add 'key' to 'smap' associated with 'value'. If 'key' already * exists in 'smap', does nothing and returns false. Otherwise, performs the * addition and returns true. */ diff -Nru openvswitch-2.3.1/lib/smap.h openvswitch-2.4.0~git20150623/lib/smap.h --- openvswitch-2.3.1/lib/smap.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/smap.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 Nicira, Inc. +/* Copyright (c) 2012, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,9 +42,10 @@ void smap_destroy(struct smap *); struct smap_node *smap_add(struct smap *, const char *, const char *); +struct smap_node *smap_add_nocopy(struct smap *, char *, char *); bool smap_add_once(struct smap *, const char *, const char *); void smap_add_format(struct smap *, const char *key, const char *, ...) - PRINTF_FORMAT(3, 4); + OVS_PRINTF_FORMAT(3, 4); void smap_replace(struct smap *, const char *, const char *); void smap_remove(struct smap *, const char *); diff -Nru openvswitch-2.3.1/lib/socket-util.c openvswitch-2.4.0~git20150623/lib/socket-util.c --- openvswitch-2.3.1/lib/socket-util.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/socket-util.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,24 +21,23 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include #include #include #include "dynamic-string.h" -#include "fatal-signal.h" #include "ovs-thread.h" #include "packets.h" #include "poll-loop.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #ifdef __linux__ #include #endif @@ -49,23 +48,6 @@ VLOG_DEFINE_THIS_MODULE(socket_util); -/* #ifdefs make it a pain to maintain code: you have to try to build both ways. - * Thus, this file compiles all of the code regardless of the target, by - * writing "if (LINUX)" instead of "#ifdef __linux__". */ -#ifdef __linux__ -#define LINUX 1 -#else -#define LINUX 0 -#endif - -#ifndef O_DIRECTORY -#define O_DIRECTORY 0 -#endif - -/* Maximum length of the sun_path member in a struct sockaddr_un, excluding - * space for a null terminator. */ -#define MAX_UN_LEN (sizeof(((struct sockaddr_un *) 0)->sun_path) - 1) - static int getsockopt_int(int fd, int level, int option, const char *optname, int *valuep); @@ -106,46 +88,52 @@ } } +void +setsockopt_tcp_nodelay(int fd) +{ + int on = 1; + int retval; + + retval = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on); + if (retval) { + retval = sock_errno(); + VLOG_ERR("setsockopt(TCP_NODELAY): %s", sock_strerror(retval)); + } +} + +/* Sets the DSCP value of socket 'fd' to 'dscp', which must be 63 or less. + * 'family' must indicate the socket's address family (AF_INET or AF_INET6, to + * do anything useful). */ int -set_dscp(int fd, uint8_t dscp) +set_dscp(int fd, int family, uint8_t dscp) { + int retval; int val; - bool success; + +#ifdef _WIN32 + /* XXX: Consider using QoS2 APIs for Windows to set dscp. */ + return 0; +#endif if (dscp > 63) { return EINVAL; } - - /* Note: this function is used for both of IPv4 and IPv6 sockets */ - success = false; val = dscp << 2; - if (setsockopt(fd, IPPROTO_IP, IP_TOS, &val, sizeof val)) { -#ifndef _WIN32 - if (sock_errno() != ENOPROTOOPT) { -#else - if (sock_errno() != WSAENOPROTOOPT) { -#endif - return sock_errno(); - } - } else { - success = true; - } - if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &val, sizeof val)) { -#ifndef _WIN32 - if (sock_errno() != ENOPROTOOPT) { -#else - if (sock_errno() != WSAENOPROTOOPT) { -#endif - return sock_errno(); - } - } else { - success = true; - } - if (!success) { + + switch (family) { + case AF_INET: + retval = setsockopt(fd, IPPROTO_IP, IP_TOS, &val, sizeof val); + break; + + case AF_INET6: + retval = setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &val, sizeof val); + break; + + default: return ENOPROTOOPT; } - return 0; + return retval ? sock_errno() : 0; } /* Translates 'host_name', which must be a string representation of an IP @@ -277,43 +265,6 @@ } } -#ifndef _WIN32 -/* Drain all the data currently in the receive queue of a datagram socket (and - * possibly additional data). There is no way to know how many packets are in - * the receive queue, but we do know that the total number of bytes queued does - * not exceed the receive buffer size, so we pull packets until none are left - * or we've read that many bytes. */ -int -drain_rcvbuf(int fd) -{ - int rcvbuf; - - rcvbuf = get_socket_rcvbuf(fd); - if (rcvbuf < 0) { - return -rcvbuf; - } - - while (rcvbuf > 0) { - /* In Linux, specifying MSG_TRUNC in the flags argument causes the - * datagram length to be returned, even if that is longer than the - * buffer provided. Thus, we can use a 1-byte buffer to discard the - * incoming datagram and still be able to account how many bytes were - * removed from the receive buffer. - * - * On other Unix-like OSes, MSG_TRUNC has no effect in the flags - * argument. */ - char buffer[LINUX ? 1 : 2048]; - ssize_t n_bytes = recv(fd, buffer, sizeof buffer, - MSG_TRUNC | MSG_DONTWAIT); - if (n_bytes <= 0 || n_bytes >= rcvbuf) { - break; - } - rcvbuf -= n_bytes; - } - return 0; -} -#endif - /* Returns the size of socket 'sock''s receive buffer (SO_RCVBUF), or a * negative errno value if an error occurs. */ int @@ -344,269 +295,6 @@ } } -#ifndef _WIN32 -/* Attempts to shorten 'name' by opening a file descriptor for the directory - * part of the name and indirecting through /proc/self/fd//. - * On systems with Linux-like /proc, this works as long as isn't too - * long. - * - * On success, returns 0 and stores the short name in 'short_name' and a - * directory file descriptor to eventually be closed in '*dirfpd'. */ -static int -shorten_name_via_proc(const char *name, char short_name[MAX_UN_LEN + 1], - int *dirfdp) -{ - char *dir, *base; - int dirfd; - int len; - - if (!LINUX) { - return ENAMETOOLONG; - } - - dir = dir_name(name); - dirfd = open(dir, O_DIRECTORY | O_RDONLY); - if (dirfd < 0) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); - int error = errno; - - VLOG_WARN_RL(&rl, "%s: open failed (%s)", dir, ovs_strerror(error)); - free(dir); - - return error; - } - free(dir); - - base = base_name(name); - len = snprintf(short_name, MAX_UN_LEN + 1, - "/proc/self/fd/%d/%s", dirfd, base); - free(base); - - if (len >= 0 && len <= MAX_UN_LEN) { - *dirfdp = dirfd; - return 0; - } else { - close(dirfd); - return ENAMETOOLONG; - } -} - -/* Attempts to shorten 'name' by creating a symlink for the directory part of - * the name and indirecting through /. This works on - * systems that support symlinks, as long as isn't too long. - * - * On success, returns 0 and stores the short name in 'short_name' and the - * symbolic link to eventually delete in 'linkname'. */ -static int -shorten_name_via_symlink(const char *name, char short_name[MAX_UN_LEN + 1], - char linkname[MAX_UN_LEN + 1]) -{ - char *abs, *dir, *base; - const char *tmpdir; - int error; - int i; - - abs = abs_file_name(NULL, name); - dir = dir_name(abs); - base = base_name(abs); - free(abs); - - tmpdir = getenv("TMPDIR"); - if (tmpdir == NULL) { - tmpdir = "/tmp"; - } - - for (i = 0; i < 1000; i++) { - int len; - - len = snprintf(linkname, MAX_UN_LEN + 1, - "%s/ovs-un-c-%"PRIu32, tmpdir, random_uint32()); - error = (len < 0 || len > MAX_UN_LEN ? ENAMETOOLONG - : symlink(dir, linkname) ? errno - : 0); - if (error != EEXIST) { - break; - } - } - - if (!error) { - int len; - - fatal_signal_add_file_to_unlink(linkname); - - len = snprintf(short_name, MAX_UN_LEN + 1, "%s/%s", linkname, base); - if (len < 0 || len > MAX_UN_LEN) { - fatal_signal_unlink_file_now(linkname); - error = ENAMETOOLONG; - } - } - - if (error) { - linkname[0] = '\0'; - } - free(dir); - free(base); - - return error; -} - -/* Stores in '*un' a sockaddr_un that refers to file 'name'. Stores in - * '*un_len' the size of the sockaddr_un. - * - * Returns 0 on success, otherwise a positive errno value. - * - * Uses '*dirfdp' and 'linkname' to store references to data when the caller no - * longer needs to use 'un'. On success, freeing these references with - * free_sockaddr_un() is mandatory to avoid a leak; on failure, freeing them is - * unnecessary but harmless. */ -static int -make_sockaddr_un(const char *name, struct sockaddr_un *un, socklen_t *un_len, - int *dirfdp, char linkname[MAX_UN_LEN + 1]) -{ - char short_name[MAX_UN_LEN + 1]; - - *dirfdp = -1; - linkname[0] = '\0'; - if (strlen(name) > MAX_UN_LEN) { - /* 'name' is too long to fit in a sockaddr_un. Try a workaround. */ - int error = shorten_name_via_proc(name, short_name, dirfdp); - if (error == ENAMETOOLONG) { - error = shorten_name_via_symlink(name, short_name, linkname); - } - if (error) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); - - VLOG_WARN_RL(&rl, "Unix socket name %s is longer than maximum " - "%"PRIuSIZE" bytes", name, MAX_UN_LEN); - return error; - } - - name = short_name; - } - - un->sun_family = AF_UNIX; - ovs_strzcpy(un->sun_path, name, sizeof un->sun_path); - *un_len = (offsetof(struct sockaddr_un, sun_path) - + strlen (un->sun_path) + 1); - return 0; -} - -/* Clean up after make_sockaddr_un(). */ -static void -free_sockaddr_un(int dirfd, const char *linkname) -{ - if (dirfd >= 0) { - close(dirfd); - } - if (linkname[0]) { - fatal_signal_unlink_file_now(linkname); - } -} - -/* Binds Unix domain socket 'fd' to a file with permissions 0700. */ -static int -bind_unix_socket(int fd, struct sockaddr *sun, socklen_t sun_len) -{ - /* According to _Unix Network Programming_, umask should affect bind(). */ - mode_t old_umask = umask(0077); - int error = bind(fd, sun, sun_len) ? errno : 0; - umask(old_umask); - return error; -} - -/* Creates a Unix domain socket in the given 'style' (either SOCK_DGRAM or - * SOCK_STREAM) that is bound to '*bind_path' (if 'bind_path' is non-null) and - * connected to '*connect_path' (if 'connect_path' is non-null). If 'nonblock' - * is true, the socket is made non-blocking. - * - * Returns the socket's fd if successful, otherwise a negative errno value. */ -int -make_unix_socket(int style, bool nonblock, - const char *bind_path, const char *connect_path) -{ - int error; - int fd; - - fd = socket(PF_UNIX, style, 0); - if (fd < 0) { - return -errno; - } - - /* Set nonblocking mode right away, if we want it. This prevents blocking - * in connect(), if connect_path != NULL. (In turn, that's a corner case: - * it will only happen if style is SOCK_STREAM or SOCK_SEQPACKET, and only - * if a backlog of un-accepted connections has built up in the kernel.) */ - if (nonblock) { - error = set_nonblocking(fd); - if (error) { - goto error; - } - } - - if (bind_path) { - char linkname[MAX_UN_LEN + 1]; - struct sockaddr_un un; - socklen_t un_len; - int dirfd; - - if (unlink(bind_path) && errno != ENOENT) { - VLOG_WARN("unlinking \"%s\": %s\n", - bind_path, ovs_strerror(errno)); - } - fatal_signal_add_file_to_unlink(bind_path); - - error = make_sockaddr_un(bind_path, &un, &un_len, &dirfd, linkname); - if (!error) { - error = bind_unix_socket(fd, (struct sockaddr *) &un, un_len); - } - free_sockaddr_un(dirfd, linkname); - - if (error) { - goto error; - } - } - - if (connect_path) { - char linkname[MAX_UN_LEN + 1]; - struct sockaddr_un un; - socklen_t un_len; - int dirfd; - - error = make_sockaddr_un(connect_path, &un, &un_len, &dirfd, linkname); - if (!error - && connect(fd, (struct sockaddr*) &un, un_len) - && errno != EINPROGRESS) { - error = errno; - } - free_sockaddr_un(dirfd, linkname); - - if (error) { - goto error; - } - } - - return fd; - -error: - if (error == EAGAIN) { - error = EPROTO; - } - if (bind_path) { - fatal_signal_unlink_file_now(bind_path); - } - close(fd); - return -error; -} - -int -get_unix_name_len(socklen_t sun_len) -{ - return (sun_len >= offsetof(struct sockaddr_un, sun_path) - ? sun_len - offsetof(struct sockaddr_un, sun_path) - : 0); -} -#endif /* _WIN32 */ - ovs_be32 guess_netmask(ovs_be32 ip_) { @@ -778,7 +466,7 @@ /* The dscp bits must be configured before connect() to ensure that the * TOS field is set during the connection establishment. If set after * connect(), the handshake SYN frames will be sent with a TOS of 0. */ - error = set_dscp(fd, dscp); + error = set_dscp(fd, ss.ss_family, dscp); if (error) { VLOG_ERR("%s: set_dscp: %s", target, sock_strerror(error)); goto exit; @@ -871,10 +559,14 @@ * * 'dscp' becomes the DSCP bits in the IP headers for the new connection. It * should be in the range [0, 63] and will automatically be shifted to the - * appropriately place in the IP tos field. */ + * appropriately place in the IP tos field. + * + * If 'kernel_print_port' is true and the port is dynamically assigned by + * the kernel, print the chosen port. */ int inet_open_passive(int style, const char *target, int default_port, - struct sockaddr_storage *ssp, uint8_t dscp) + struct sockaddr_storage *ssp, uint8_t dscp, + bool kernel_print_port) { bool kernel_chooses_port; struct sockaddr_storage ss; @@ -915,7 +607,7 @@ /* The dscp bits must be configured before connect() to ensure that the TOS * field is set during the connection establishment. If set after * connect(), the handshake SYN frames will be sent with a TOS of 0. */ - error = set_dscp(fd, dscp); + error = set_dscp(fd, ss.ss_family, dscp); if (error) { VLOG_ERR("%s: set_dscp: %s", target, sock_strerror(error)); goto error; @@ -935,7 +627,7 @@ VLOG_ERR("%s: getsockname: %s", target, sock_strerror(error)); goto error; } - if (kernel_chooses_port) { + if (kernel_chooses_port && kernel_print_port) { VLOG_INFO("%s: listening on port %"PRIu16, target, ss_get_port(&ss)); } @@ -1057,24 +749,6 @@ } } -#ifndef _WIN32 -void -xpipe(int fds[2]) -{ - if (pipe(fds)) { - VLOG_FATAL("failed to create pipe (%s)", ovs_strerror(errno)); - } -} - -void -xpipe_nonblocking(int fds[2]) -{ - xpipe(fds); - xset_nonblocking(fds[0]); - xset_nonblocking(fds[1]); -} -#endif - static int getsockopt_int(int fd, int level, int option, const char *optname, int *valuep) { @@ -1241,46 +915,6 @@ return ds_steal_cstr(&string); } -#ifndef _WIN32 -/* Calls ioctl() on an AF_INET sock, passing the specified 'command' and - * 'arg'. Returns 0 if successful, otherwise a positive errno value. */ -int -af_inet_ioctl(unsigned long int command, const void *arg) -{ - static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; - static int sock; - - if (ovsthread_once_start(&once)) { - sock = socket(AF_INET, SOCK_DGRAM, 0); - if (sock < 0) { - int error = sock_errno(); - VLOG_ERR("failed to create inet socket: %s", sock_strerror(error)); - sock = -error; - } - ovsthread_once_done(&once); - } - - return (sock < 0 ? -sock - : ioctl(sock, command, arg) == -1 ? errno - : 0); -} - -int -af_inet_ifreq_ioctl(const char *name, struct ifreq *ifr, unsigned long int cmd, - const char *cmd_name) -{ - int error; - - ovs_strzcpy(ifr->ifr_name, name, sizeof ifr->ifr_name); - error = af_inet_ioctl(cmd, ifr); - if (error) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); - VLOG_DBG_RL(&rl, "%s: ioctl(%s) failed: %s", name, cmd_name, - ovs_strerror(error)); - } - return error; -} -#endif /* sockaddr_storage helpers. */ diff -Nru openvswitch-2.3.1/lib/socket-util.h openvswitch-2.4.0~git20150623/lib/socket-util.h --- openvswitch-2.3.1/lib/socket-util.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/socket-util.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,8 @@ int set_nonblocking(int fd); void xset_nonblocking(int fd); -int set_dscp(int fd, uint8_t dscp); +void setsockopt_tcp_nodelay(int fd); +int set_dscp(int fd, int family, uint8_t dscp); int lookup_ip(const char *host_name, struct in_addr *address); int lookup_ipv6(const char *host_name, struct in6_addr *address); @@ -38,15 +39,7 @@ int get_socket_rcvbuf(int sock); int check_connection_completion(int fd); -#ifndef _WIN32 -int drain_rcvbuf(int fd); -#endif void drain_fd(int fd, size_t n_packets); -#ifndef _WIN32 -int make_unix_socket(int style, bool nonblock, - const char *bind_path, const char *connect_path); -int get_unix_name_len(socklen_t sun_len); -#endif ovs_be32 guess_netmask(ovs_be32 ip); bool inet_parse_active(const char *target, uint16_t default_port, @@ -57,7 +50,8 @@ bool inet_parse_passive(const char *target, int default_port, struct sockaddr_storage *ssp); int inet_open_passive(int style, const char *target, int default_port, - struct sockaddr_storage *ssp, uint8_t dscp); + struct sockaddr_storage *ssp, uint8_t dscp, + bool kernel_print_port); int read_fully(int fd, void *, size_t, size_t *bytes_read); int write_fully(int fd, const void *, size_t, size_t *bytes_written); @@ -65,11 +59,6 @@ int fsync_parent_dir(const char *file_name); int get_mtime(const char *file_name, struct timespec *mtime); -#ifndef _WIN32 -void xpipe(int fds[2]); -void xpipe_nonblocking(int fds[2]); -#endif - char *describe_fd(int fd); /* Default value of dscp bits for connection between controller and manager. @@ -77,14 +66,6 @@ * in is used. */ #define DSCP_DEFAULT (IPTOS_PREC_INTERNETCONTROL >> 2) -#ifndef _WIN32 -/* Helpers for calling ioctl() on an AF_INET socket. */ -struct ifreq; -int af_inet_ioctl(unsigned long int command, const void *arg); -int af_inet_ifreq_ioctl(const char *name, struct ifreq *, - unsigned long int cmd, const char *cmd_name); -#endif - /* Functions for working with sockaddr_storage that might contain an IPv4 or * IPv6 address. */ uint16_t ss_get_port(const struct sockaddr_storage *); @@ -94,6 +75,25 @@ size_t ss_length(const struct sockaddr_storage *); const char *sock_strerror(int error); +#ifndef _WIN32 +void xpipe(int fds[2]); +void xpipe_nonblocking(int fds[2]); + +int drain_rcvbuf(int fd); + +int make_unix_socket(int style, bool nonblock, + const char *bind_path, const char *connect_path); +int get_unix_name_len(socklen_t sun_len); + +/* Helpers for calling ioctl() on an AF_INET socket. */ +struct ifreq; +int af_inet_ioctl(unsigned long int command, const void *arg); +int af_inet_ifreq_ioctl(const char *name, struct ifreq *, + unsigned long int cmd, const char *cmd_name); + +#define closesocket close +#endif + #ifdef _WIN32 /* Windows defines the 'optval' argument as char * instead of void *. */ #define setsockopt(sock, level, optname, optval, optlen) \ @@ -124,8 +124,4 @@ #endif } -#ifndef _WIN32 -#define closesocket close -#endif - #endif /* socket-util.h */ diff -Nru openvswitch-2.3.1/lib/socket-util-unix.c openvswitch-2.4.0~git20150623/lib/socket-util-unix.c --- openvswitch-2.3.1/lib/socket-util-unix.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/socket-util-unix.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,434 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "socket-util.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fatal-signal.h" +#include "random.h" +#include "util.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(socket_util_unix); + +/* #ifdefs make it a pain to maintain code: you have to try to build both ways. + * Thus, this file compiles all of the code regardless of the target, by + * writing "if (LINUX)" instead of "#ifdef __linux__". */ +#ifdef __linux__ +#define LINUX 1 +#else +#define LINUX 0 +#endif + +#ifndef O_DIRECTORY +#define O_DIRECTORY 0 +#endif + +/* Maximum length of the sun_path member in a struct sockaddr_un, excluding + * space for a null terminator. */ +#define MAX_UN_LEN (sizeof(((struct sockaddr_un *) 0)->sun_path) - 1) + +void +xpipe(int fds[2]) +{ + if (pipe(fds)) { + VLOG_FATAL("failed to create pipe (%s)", ovs_strerror(errno)); + } +} + +void +xpipe_nonblocking(int fds[2]) +{ + xpipe(fds); + xset_nonblocking(fds[0]); + xset_nonblocking(fds[1]); +} + +/* Drain all the data currently in the receive queue of a datagram socket (and + * possibly additional data). There is no way to know how many packets are in + * the receive queue, but we do know that the total number of bytes queued does + * not exceed the receive buffer size, so we pull packets until none are left + * or we've read that many bytes. */ +int +drain_rcvbuf(int fd) +{ + int rcvbuf; + + rcvbuf = get_socket_rcvbuf(fd); + if (rcvbuf < 0) { + return -rcvbuf; + } + + while (rcvbuf > 0) { + /* In Linux, specifying MSG_TRUNC in the flags argument causes the + * datagram length to be returned, even if that is longer than the + * buffer provided. Thus, we can use a 1-byte buffer to discard the + * incoming datagram and still be able to account how many bytes were + * removed from the receive buffer. + * + * On other Unix-like OSes, MSG_TRUNC has no effect in the flags + * argument. */ + char buffer[LINUX ? 1 : 2048]; + ssize_t n_bytes = recv(fd, buffer, sizeof buffer, + MSG_TRUNC | MSG_DONTWAIT); + if (n_bytes <= 0 || n_bytes >= rcvbuf) { + break; + } + rcvbuf -= n_bytes; + } + return 0; +} + +/* Attempts to shorten 'name' by opening a file descriptor for the directory + * part of the name and indirecting through /proc/self/fd//. + * On systems with Linux-like /proc, this works as long as isn't too + * long. + * + * On success, returns 0 and stores the short name in 'short_name' and a + * directory file descriptor to eventually be closed in '*dirfpd'. */ +static int +shorten_name_via_proc(const char *name, char short_name[MAX_UN_LEN + 1], + int *dirfdp) +{ + char *dir, *base; + int dirfd; + int len; + + if (!LINUX) { + return ENAMETOOLONG; + } + + dir = dir_name(name); + dirfd = open(dir, O_DIRECTORY | O_RDONLY); + if (dirfd < 0) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + int error = errno; + + VLOG_WARN_RL(&rl, "%s: open failed (%s)", dir, ovs_strerror(error)); + free(dir); + + return error; + } + free(dir); + + base = base_name(name); + len = snprintf(short_name, MAX_UN_LEN + 1, + "/proc/self/fd/%d/%s", dirfd, base); + free(base); + + if (len >= 0 && len <= MAX_UN_LEN) { + *dirfdp = dirfd; + return 0; + } else { + close(dirfd); + return ENAMETOOLONG; + } +} + +/* Attempts to shorten 'name' by creating a symlink for the directory part of + * the name and indirecting through /. This works on + * systems that support symlinks, as long as isn't too long. + * + * On success, returns 0 and stores the short name in 'short_name' and the + * symbolic link to eventually delete in 'linkname'. */ +static int +shorten_name_via_symlink(const char *name, char short_name[MAX_UN_LEN + 1], + char linkname[MAX_UN_LEN + 1]) +{ + char *abs, *dir, *base; + const char *tmpdir; + int error; + int i; + + abs = abs_file_name(NULL, name); + dir = dir_name(abs); + base = base_name(abs); + free(abs); + + tmpdir = getenv("TMPDIR"); + if (tmpdir == NULL) { + tmpdir = "/tmp"; + } + + for (i = 0; i < 1000; i++) { + int len; + + len = snprintf(linkname, MAX_UN_LEN + 1, + "%s/ovs-un-c-%"PRIu32, tmpdir, random_uint32()); + error = (len < 0 || len > MAX_UN_LEN ? ENAMETOOLONG + : symlink(dir, linkname) ? errno + : 0); + if (error != EEXIST) { + break; + } + } + + if (!error) { + int len; + + fatal_signal_add_file_to_unlink(linkname); + + len = snprintf(short_name, MAX_UN_LEN + 1, "%s/%s", linkname, base); + if (len < 0 || len > MAX_UN_LEN) { + fatal_signal_unlink_file_now(linkname); + error = ENAMETOOLONG; + } + } + + if (error) { + linkname[0] = '\0'; + } + free(dir); + free(base); + + return error; +} + +/* Stores in '*un' a sockaddr_un that refers to file 'name'. Stores in + * '*un_len' the size of the sockaddr_un. + * + * Returns 0 on success, otherwise a positive errno value. + * + * Uses '*dirfdp' and 'linkname' to store references to data when the caller no + * longer needs to use 'un'. On success, freeing these references with + * free_sockaddr_un() is mandatory to avoid a leak; on failure, freeing them is + * unnecessary but harmless. */ +static int +make_sockaddr_un(const char *name, struct sockaddr_un *un, socklen_t *un_len, + int *dirfdp, char linkname[MAX_UN_LEN + 1]) +{ + char short_name[MAX_UN_LEN + 1]; + + *dirfdp = -1; + linkname[0] = '\0'; + if (strlen(name) > MAX_UN_LEN) { + /* 'name' is too long to fit in a sockaddr_un. Try a workaround. */ + int error = shorten_name_via_proc(name, short_name, dirfdp); + if (error == ENAMETOOLONG) { + error = shorten_name_via_symlink(name, short_name, linkname); + } + if (error) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + + VLOG_WARN_RL(&rl, "Unix socket name %s is longer than maximum " + "%"PRIuSIZE" bytes", name, MAX_UN_LEN); + return error; + } + + name = short_name; + } + + un->sun_family = AF_UNIX; + ovs_strzcpy(un->sun_path, name, sizeof un->sun_path); + *un_len = (offsetof(struct sockaddr_un, sun_path) + + strlen (un->sun_path) + 1); + return 0; +} + +/* Clean up after make_sockaddr_un(). */ +static void +free_sockaddr_un(int dirfd, const char *linkname) +{ + if (dirfd >= 0) { + close(dirfd); + } + if (linkname[0]) { + fatal_signal_unlink_file_now(linkname); + } +} + +/* Binds Unix domain socket 'fd' to a file with permissions 0700. */ +static int +bind_unix_socket(int fd, struct sockaddr *sun, socklen_t sun_len) +{ + const mode_t mode = 0700; + if (LINUX) { + /* On Linux, the fd's permissions become the file's permissions. + * fchmod() does not affect other files, like umask() does. */ + if (fchmod(fd, mode)) { + return errno; + } + + /* Must be after fchmod(). */ + if (bind(fd, sun, sun_len)) { + return errno; + } + return 0; + } else { + /* On FreeBSD and NetBSD, only the umask affects permissions. The + * umask is process-wide rather than thread-specific, so we have to use + * a subprocess for safety. */ + pid_t pid = fork(); + + if (!pid) { + umask(mode ^ 0777); + _exit(bind(fd, sun, sun_len) ? errno : 0); + } else if (pid > 0) { + int status; + int error; + + do { + error = waitpid(pid, &status, 0) < 0 ? errno : 0; + } while (error == EINTR); + + return (error ? error + : WIFEXITED(status) ? WEXITSTATUS(status) + : WIFSIGNALED(status) ? EINTR + : ECHILD /* WTF? */); + } else { + return errno; + } + } +} + +/* Creates a Unix domain socket in the given 'style' (either SOCK_DGRAM or + * SOCK_STREAM) that is bound to '*bind_path' (if 'bind_path' is non-null) and + * connected to '*connect_path' (if 'connect_path' is non-null). If 'nonblock' + * is true, the socket is made non-blocking. + * + * Returns the socket's fd if successful, otherwise a negative errno value. */ +int +make_unix_socket(int style, bool nonblock, + const char *bind_path, const char *connect_path) +{ + int error; + int fd; + + fd = socket(PF_UNIX, style, 0); + if (fd < 0) { + return -errno; + } + + /* Set nonblocking mode right away, if we want it. This prevents blocking + * in connect(), if connect_path != NULL. (In turn, that's a corner case: + * it will only happen if style is SOCK_STREAM or SOCK_SEQPACKET, and only + * if a backlog of un-accepted connections has built up in the kernel.) */ + if (nonblock) { + error = set_nonblocking(fd); + if (error) { + goto error; + } + } + + if (bind_path) { + char linkname[MAX_UN_LEN + 1]; + struct sockaddr_un un; + socklen_t un_len; + int dirfd; + + if (unlink(bind_path) && errno != ENOENT) { + VLOG_WARN("unlinking \"%s\": %s\n", + bind_path, ovs_strerror(errno)); + } + fatal_signal_add_file_to_unlink(bind_path); + + error = make_sockaddr_un(bind_path, &un, &un_len, &dirfd, linkname); + if (!error) { + error = bind_unix_socket(fd, (struct sockaddr *) &un, un_len); + } + free_sockaddr_un(dirfd, linkname); + + if (error) { + goto error; + } + } + + if (connect_path) { + char linkname[MAX_UN_LEN + 1]; + struct sockaddr_un un; + socklen_t un_len; + int dirfd; + + error = make_sockaddr_un(connect_path, &un, &un_len, &dirfd, linkname); + if (!error + && connect(fd, (struct sockaddr*) &un, un_len) + && errno != EINPROGRESS) { + error = errno; + } + free_sockaddr_un(dirfd, linkname); + + if (error) { + goto error; + } + } + + return fd; + +error: + if (error == EAGAIN) { + error = EPROTO; + } + if (bind_path) { + fatal_signal_unlink_file_now(bind_path); + } + close(fd); + return -error; +} + +int +get_unix_name_len(socklen_t sun_len) +{ + return (sun_len >= offsetof(struct sockaddr_un, sun_path) + ? sun_len - offsetof(struct sockaddr_un, sun_path) + : 0); +} + +/* Calls ioctl() on an AF_INET sock, passing the specified 'command' and + * 'arg'. Returns 0 if successful, otherwise a positive errno value. */ +int +af_inet_ioctl(unsigned long int command, const void *arg) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + static int sock; + + if (ovsthread_once_start(&once)) { + sock = socket(AF_INET, SOCK_DGRAM, 0); + if (sock < 0) { + int error = sock_errno(); + VLOG_ERR("failed to create inet socket: %s", sock_strerror(error)); + sock = -error; + } + ovsthread_once_done(&once); + } + + return (sock < 0 ? -sock + : ioctl(sock, command, arg) == -1 ? errno + : 0); +} + +int +af_inet_ifreq_ioctl(const char *name, struct ifreq *ifr, unsigned long int cmd, + const char *cmd_name) +{ + int error; + + ovs_strzcpy(ifr->ifr_name, name, sizeof ifr->ifr_name); + error = af_inet_ioctl(cmd, ifr); + if (error) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); + VLOG_DBG_RL(&rl, "%s: ioctl(%s) failed: %s", name, cmd_name, + ovs_strerror(error)); + } + return error; +} diff -Nru openvswitch-2.3.1/lib/sset.c openvswitch-2.4.0~git20150623/lib/sset.c --- openvswitch-2.3.1/lib/sset.c 2013-10-18 20:33:47.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/sset.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -269,21 +269,12 @@ return SSET_NODE_FROM_HMAP_NODE(hmap_node); } -static int -compare_string_pointers(const void *a_, const void *b_) -{ - const char *const *a = a_; - const char *const *b = b_; - - return strcmp(*a, *b); -} - -/* Returns a null-terminated array of pointers to the strings in 'set', sorted - * alphabetically. The caller must free the returned array when it is no +/* Returns a null-terminated array of pointers to the strings in 'set', in no + * particular order. The caller must free the returned array when it is no * longer needed, but the strings in the array belong to 'set' and thus must * not be modified or freed. */ const char ** -sset_sort(const struct sset *set) +sset_array(const struct sset *set) { size_t n = sset_count(set); const char **array; @@ -298,7 +289,26 @@ ovs_assert(i == n); array[n] = NULL; - qsort(array, n, sizeof *array, compare_string_pointers); + return array; +} + +static int +compare_string_pointers(const void *a_, const void *b_) +{ + const char *const *a = a_; + const char *const *b = b_; + + return strcmp(*a, *b); +} +/* Returns a null-terminated array of pointers to the strings in 'set', sorted + * alphabetically. The caller must free the returned array when it is no + * longer needed, but the strings in the array belong to 'set' and thus must + * not be modified or freed. */ +const char ** +sset_sort(const struct sset *set) +{ + const char **array = sset_array(set); + qsort(array, sset_count(set), sizeof *array, compare_string_pointers); return array; } diff -Nru openvswitch-2.3.1/lib/sset.h openvswitch-2.4.0~git20150623/lib/sset.h --- openvswitch-2.3.1/lib/sset.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/sset.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,6 +80,7 @@ : false); \ (NAME) = (NEXT)) +const char **sset_array(const struct sset *); const char **sset_sort(const struct sset *); /* Implementation helper macros. */ diff -Nru openvswitch-2.3.1/lib/stp.c openvswitch-2.4.0~git20150623/lib/stp.c --- openvswitch-2.3.1/lib/stp.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stp.c 2015-06-23 18:46:21.000000000 +0000 @@ -28,14 +28,18 @@ #include "byte-order.h" #include "connectivity.h" #include "ofpbuf.h" +#include "ovs-atomic.h" +#include "dp-packet.h" #include "packets.h" #include "seq.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(stp); +static struct vlog_rate_limit stp_rl = VLOG_RATE_LIMIT_INIT(60, 60); + #define STP_PROTOCOL_ID 0x0000 #define STP_PROTOCOL_VERSION 0x00 #define STP_TYPE_CONFIG 0x00 @@ -82,6 +86,7 @@ struct stp_port { struct stp *stp; + char *port_name; /* Human-readable name for log messages. */ void *aux; /* Auxiliary data the user may retrieve. */ int port_id; /* 8.5.5.1: Unique port identifier. */ enum stp_state state; /* 8.5.5.2: Current state. */ @@ -106,7 +111,7 @@ }; struct stp { - struct list node; /* Node in all_stps list. */ + struct ovs_list node; /* Node in all_stps list. */ /* Static bridge data. */ char *name; /* Human-readable name for log messages. */ @@ -140,15 +145,15 @@ /* Interface to client. */ bool fdb_needs_flush; /* MAC learning tables needs flushing. */ struct stp_port *first_changed_port; - void (*send_bpdu)(struct ofpbuf *bpdu, int port_no, void *aux); + void (*send_bpdu)(struct dp_packet *bpdu, int port_no, void *aux); void *aux; struct ovs_refcount ref_cnt; }; static struct ovs_mutex mutex; -static struct list all_stps__ = LIST_INITIALIZER(&all_stps__); -static struct list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__; +static struct ovs_list all_stps__ = OVS_LIST_INITIALIZER(&all_stps__); +static struct ovs_list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__; #define FOR_EACH_ENABLED_PORT(PORT, STP) \ for ((PORT) = stp_next_enabled_port((STP), (STP)->ports); \ @@ -254,7 +259,7 @@ */ struct stp * stp_create(const char *name, stp_identifier bridge_id, - void (*send_bpdu)(struct ofpbuf *bpdu, int port_no, void *aux), + void (*send_bpdu)(struct dp_packet *bpdu, int port_no, void *aux), void *aux) { static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; @@ -327,11 +332,17 @@ void stp_unref(struct stp *stp) { - if (stp && ovs_refcount_unref(&stp->ref_cnt) == 1) { + if (stp && ovs_refcount_unref_relaxed(&stp->ref_cnt) == 1) { + size_t i; + ovs_mutex_lock(&mutex); list_remove(&stp->node); ovs_mutex_unlock(&mutex); free(stp->name); + + for (i = 0; i < STP_MAX_PORTS; i++) { + free(stp->ports[i].port_name); + } free(stp); } } @@ -664,24 +675,20 @@ /* Returns true if 'state' is one in which packets received on a port should * be forwarded, false otherwise. - * - * Returns true if 'state' is STP_DISABLED, since presumably in that case the - * port should still work, just not have STP applied to it. */ + */ bool stp_forward_in_state(enum stp_state state) { - return (state & (STP_DISABLED | STP_FORWARDING)) != 0; + return (state & STP_FORWARDING) != 0; } /* Returns true if 'state' is one in which MAC learning should be done on * packets received on a port, false otherwise. - * - * Returns true if 'state' is STP_DISABLED, since presumably in that case the - * port should still work, just not have STP applied to it. */ + */ bool stp_learn_in_state(enum stp_state state) { - return (state & (STP_DISABLED | STP_LEARNING | STP_FORWARDING)) != 0; + return (state & (STP_LEARNING | STP_FORWARDING)) != 0; } /* Returns true if 'state' is one in which bpdus should be forwarded on a @@ -795,6 +802,18 @@ return stp; } +void +stp_port_set_name(struct stp_port *p, const char *name) +{ + char *old; + + ovs_mutex_lock(&mutex); + old = p->port_name; + p->port_name = xstrdup(name); + free(old); + ovs_mutex_unlock(&mutex); +} + /* Sets the 'aux' member of 'p'. * * The 'aux' member will be reset to NULL when stp_port_disable() is @@ -1019,6 +1038,8 @@ return; } if (p->hold_timer.active) { + VLOG_DBG_RL(&stp_rl, "bridge: %s, port: %s, transmit config bpdu pending", + stp->name, p->port_name); p->config_pending = true; } else { struct stp_config_bpdu config; @@ -1049,6 +1070,8 @@ if (ntohs(config.message_age) < stp->max_age) { p->topology_change_ack = false; p->config_pending = false; + VLOG_DBG_RL(&stp_rl, "bridge: %s, port: %s, transmit config bpdu", + stp->name, p->port_name); stp_send_bpdu(p, &config, sizeof config); stp_start_timer(&p->hold_timer, 0); } @@ -1119,9 +1142,12 @@ { struct stp_port *p = stp->root_port; struct stp_tcn_bpdu tcn_bpdu; + if (!p) { return; } + VLOG_DBG_RL(&stp_rl, "bridge: %s, root port: %s, transmit tcn", stp->name, + p->port_name); tcn_bpdu.header.protocol_id = htons(STP_PROTOCOL_ID); tcn_bpdu.header.protocol_version = STP_PROTOCOL_VERSION; tcn_bpdu.header.bpdu_type = STP_TYPE_TCN; @@ -1367,6 +1393,9 @@ { struct stp *stp = p->stp; bool root = stp_is_root_bridge(stp); + + VLOG_DBG_RL(&stp_rl, "bridge: %s, port: %s, message age timer expired", + stp->name, p->port_name); stp_become_designated_port(p); stp_configuration_update(stp); stp_port_state_selection(stp); @@ -1438,7 +1467,12 @@ { ovs_assert(state & (STP_DISABLED | STP_BLOCKING)); stp_become_designated_port(p); - stp_set_port_state(p, state); + + if (!p->state && state == STP_DISABLED) { + p->state = state; /* Do not trigger state change when initializing. */ + } else { + stp_set_port_state(p, state); + } p->topology_change_ack = false; p->config_pending = false; p->change_detection_enabled = true; @@ -1536,19 +1570,19 @@ { struct eth_header *eth; struct llc_header *llc; - struct ofpbuf *pkt; + struct dp_packet *pkt; /* Skeleton. */ - pkt = ofpbuf_new(ETH_HEADER_LEN + LLC_HEADER_LEN + bpdu_size); - eth = ofpbuf_put_zeros(pkt, sizeof *eth); - llc = ofpbuf_put_zeros(pkt, sizeof *llc); - ofpbuf_set_frame(pkt, eth); - ofpbuf_set_l3(pkt, ofpbuf_put(pkt, bpdu, bpdu_size)); + pkt = dp_packet_new(ETH_HEADER_LEN + LLC_HEADER_LEN + bpdu_size); + eth = dp_packet_put_zeros(pkt, sizeof *eth); + llc = dp_packet_put_zeros(pkt, sizeof *llc); + dp_packet_reset_offsets(pkt); + dp_packet_set_l3(pkt, dp_packet_put(pkt, bpdu, bpdu_size)); /* 802.2 header. */ memcpy(eth->eth_dst, eth_addr_stp, ETH_ADDR_LEN); /* p->stp->send_bpdu() must fill in source address. */ - eth->eth_type = htons(ofpbuf_size(pkt) - ETH_HEADER_LEN); + eth->eth_type = htons(dp_packet_size(pkt) - ETH_HEADER_LEN); /* LLC header. */ llc->llc_dsap = STP_LLC_DSAP; diff -Nru openvswitch-2.3.1/lib/stp.h openvswitch-2.4.0~git20150623/lib/stp.h --- openvswitch-2.3.1/lib/stp.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stp.h 2015-06-23 18:46:21.000000000 +0000 @@ -25,12 +25,7 @@ #include "compiler.h" #include "util.h" -struct ofpbuf; - -/* LLC field values used for STP frames. */ -#define STP_LLC_SSAP 0x42 -#define STP_LLC_DSAP 0x42 -#define STP_LLC_CNTL 0x03 +struct dp_packet; /* Bridge and port priorities that should be used by default. */ #define STP_DEFAULT_BRIDGE_PRIORITY 32768 @@ -57,7 +52,7 @@ #define STP_MAX_PORTS 255 void stp_init(void); struct stp *stp_create(const char *name, stp_identifier bridge_id, - void (*send_bpdu)(struct ofpbuf *bpdu, int port_no, + void (*send_bpdu)(struct dp_packet *bpdu, int port_no, void *aux), void *aux); struct stp *stp_ref(const struct stp *); @@ -146,6 +141,7 @@ void stp_received_bpdu(struct stp_port *, const void *bpdu, size_t bpdu_size); struct stp *stp_port_get_stp(struct stp_port *); +void stp_port_set_name(struct stp_port *, const char *); void stp_port_set_aux(struct stp_port *, void *); void *stp_port_get_aux(struct stp_port *); int stp_port_no(const struct stp_port *); diff -Nru openvswitch-2.3.1/lib/stream.c openvswitch-2.4.0~git20150623/lib/stream.c --- openvswitch-2.3.1/lib/stream.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ #include "random.h" #include "socket-util.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(stream); @@ -75,27 +75,6 @@ #endif }; -#ifdef _WIN32 -static void -do_winsock_start(void) -{ - WSADATA wsaData; - int error; - - error = WSAStartup(MAKEWORD(2, 2), &wsaData); - if (error != 0) { - VLOG_FATAL("WSAStartup failed: %s", sock_strerror(sock_errno())); - } -} - -static void -winsock_start(void) -{ - static pthread_once_t once = PTHREAD_ONCE_INIT; - pthread_once(&once, do_winsock_start); -} -#endif - /* Check the validity of the stream class structures. */ static void check_stream_classes(void) @@ -234,10 +213,6 @@ COVERAGE_INC(stream_open); -#ifdef _WIN32 - winsock_start(); -#endif - /* Look up the class. */ error = stream_lookup_class(name, &class); if (!class) { @@ -528,10 +503,6 @@ COVERAGE_INC(pstream_open); -#ifdef _WIN32 - winsock_start(); -#endif - /* Look up the class. */ error = pstream_lookup_class(name, &class); if (!class) { @@ -621,15 +592,6 @@ (pstream->class->wait)(pstream); } -int -pstream_set_dscp(struct pstream *pstream, uint8_t dscp) -{ - if (pstream->class->set_dscp) { - return pstream->class->set_dscp(pstream, dscp); - } - return 0; -} - /* Returns the transport port on which 'pstream' is listening, or 0 if the * concept doesn't apply. */ ovs_be16 @@ -714,13 +676,13 @@ if ((!strncmp(name_, "tcp:", 4) || !strncmp(name_, "ssl:", 4)) && count_fields(name_) < 3) { - if (default_port == OFP_OLD_PORT) { - VLOG_WARN_ONCE("The default OpenFlow port number will change " - "from %d to %d in a future release", + if (default_port == OFP_PORT) { + VLOG_WARN_ONCE("The default OpenFlow port number has changed " + "from %d to %d", OFP_OLD_PORT, OFP_PORT); - } else if (default_port == OVSDB_OLD_PORT) { - VLOG_WARN_ONCE("The default OVSDB port number will change " - "from %d to %d in a future release", + } else if (default_port == OVSDB_PORT) { + VLOG_WARN_ONCE("The default OVSDB port number has changed " + "from %d to %d", OVSDB_OLD_PORT, OVSDB_PORT); } name = xasprintf("%s:%d", name_, default_port); diff -Nru openvswitch-2.3.1/lib/stream-fd.c openvswitch-2.4.0~git20150623/lib/stream-fd.c --- openvswitch-2.3.1/lib/stream-fd.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-fd.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "stream-fd.h" +#include +#include +#include +#include +#include +#include +#include +#include "fatal-signal.h" +#include "poll-loop.h" +#include "socket-util.h" +#include "util.h" +#include "stream-provider.h" +#include "stream.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(stream_fd); + +/* Active file descriptor stream. */ + +struct stream_fd +{ + struct stream stream; + int fd; + int fd_type; +}; + +static const struct stream_class stream_fd_class; + +static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 25); + +static void maybe_unlink_and_free(char *path); + +/* Creates a new stream named 'name' that will send and receive data on 'fd' + * and stores a pointer to the stream in '*streamp'. Initial connection status + * 'connect_status' is interpreted as described for stream_init(). 'fd_type' + * tells whether the socket is TCP or Unix domain socket. + * + * Returns 0 if successful, otherwise a positive errno value. (The current + * implementation never fails.) */ +int +new_fd_stream(const char *name, int fd, int connect_status, int fd_type, + struct stream **streamp) +{ + struct stream_fd *s; + + s = xmalloc(sizeof *s); + stream_init(&s->stream, &stream_fd_class, connect_status, name); + s->fd = fd; + s->fd_type = fd_type; + *streamp = &s->stream; + return 0; +} + +static struct stream_fd * +stream_fd_cast(struct stream *stream) +{ + stream_assert_class(stream, &stream_fd_class); + return CONTAINER_OF(stream, struct stream_fd, stream); +} + +static void +fd_close(struct stream *stream) +{ + struct stream_fd *s = stream_fd_cast(stream); + closesocket(s->fd); + free(s); +} + +static int +fd_connect(struct stream *stream) +{ + struct stream_fd *s = stream_fd_cast(stream); + int retval = check_connection_completion(s->fd); + if (retval == 0 && s->fd_type == AF_INET) { + setsockopt_tcp_nodelay(s->fd); + } + return retval; +} + +static ssize_t +fd_recv(struct stream *stream, void *buffer, size_t n) +{ + struct stream_fd *s = stream_fd_cast(stream); + ssize_t retval; + int error; + + retval = recv(s->fd, buffer, n, 0); + if (retval < 0) { + error = sock_errno(); +#ifdef _WIN32 + if (error == WSAEWOULDBLOCK) { + error = EAGAIN; + } +#endif + if (error != EAGAIN) { + VLOG_DBG_RL(&rl, "recv: %s", sock_strerror(error)); + } + return -error; + } + return retval; +} + +static ssize_t +fd_send(struct stream *stream, const void *buffer, size_t n) +{ + struct stream_fd *s = stream_fd_cast(stream); + ssize_t retval; + int error; + + retval = send(s->fd, buffer, n, 0); + if (retval < 0) { + error = sock_errno(); +#ifdef _WIN32 + if (error == WSAEWOULDBLOCK) { + error = EAGAIN; + } +#endif + if (error != EAGAIN) { + VLOG_DBG_RL(&rl, "send: %s", sock_strerror(error)); + } + return -error; + } + return (retval > 0 ? retval : -EAGAIN); +} + +static void +fd_wait(struct stream *stream, enum stream_wait_type wait) +{ + struct stream_fd *s = stream_fd_cast(stream); + switch (wait) { + case STREAM_CONNECT: + case STREAM_SEND: + poll_fd_wait(s->fd, POLLOUT); + break; + + case STREAM_RECV: + poll_fd_wait(s->fd, POLLIN); + break; + + default: + OVS_NOT_REACHED(); + } +} + +static const struct stream_class stream_fd_class = { + "fd", /* name */ + false, /* needs_probes */ + NULL, /* open */ + fd_close, /* close */ + fd_connect, /* connect */ + fd_recv, /* recv */ + fd_send, /* send */ + NULL, /* run */ + NULL, /* run_wait */ + fd_wait, /* wait */ +}; + +/* Passive file descriptor stream. */ + +struct fd_pstream +{ + struct pstream pstream; + int fd; + int (*accept_cb)(int fd, const struct sockaddr_storage *, size_t ss_len, + struct stream **); + char *unlink_path; +}; + +static const struct pstream_class fd_pstream_class; + +static struct fd_pstream * +fd_pstream_cast(struct pstream *pstream) +{ + pstream_assert_class(pstream, &fd_pstream_class); + return CONTAINER_OF(pstream, struct fd_pstream, pstream); +} + +/* Creates a new pstream named 'name' that will accept new socket connections + * on 'fd' and stores a pointer to the stream in '*pstreamp'. + * + * When a connection has been accepted, 'accept_cb' will be called with the new + * socket fd 'fd' and the remote address of the connection 'sa' and 'sa_len'. + * accept_cb must return 0 if the connection is successful, in which case it + * must initialize '*streamp' to the new stream, or a positive errno value on + * error. In either case accept_cb takes ownership of the 'fd' passed in. + * + * When '*pstreamp' is closed, then 'unlink_path' (if nonnull) will be passed + * to fatal_signal_unlink_file_now() and freed with free(). + * + * Returns 0 if successful, otherwise a positive errno value. (The current + * implementation never fails.) */ +int +new_fd_pstream(const char *name, int fd, + int (*accept_cb)(int fd, const struct sockaddr_storage *ss, + size_t ss_len, struct stream **streamp), + char *unlink_path, struct pstream **pstreamp) +{ + struct fd_pstream *ps = xmalloc(sizeof *ps); + pstream_init(&ps->pstream, &fd_pstream_class, name); + ps->fd = fd; + ps->accept_cb = accept_cb; + ps->unlink_path = unlink_path; + *pstreamp = &ps->pstream; + return 0; +} + +static void +pfd_close(struct pstream *pstream) +{ + struct fd_pstream *ps = fd_pstream_cast(pstream); + closesocket(ps->fd); + maybe_unlink_and_free(ps->unlink_path); + free(ps); +} + +static int +pfd_accept(struct pstream *pstream, struct stream **new_streamp) +{ + struct fd_pstream *ps = fd_pstream_cast(pstream); + struct sockaddr_storage ss; + socklen_t ss_len = sizeof ss; + int new_fd; + int retval; + + new_fd = accept(ps->fd, (struct sockaddr *) &ss, &ss_len); + if (new_fd < 0) { + retval = sock_errno(); +#ifdef _WIN32 + if (retval == WSAEWOULDBLOCK) { + retval = EAGAIN; + } +#endif + if (retval != EAGAIN) { + VLOG_DBG_RL(&rl, "accept: %s", sock_strerror(retval)); + } + return retval; + } + + retval = set_nonblocking(new_fd); + if (retval) { + closesocket(new_fd); + return retval; + } + + return ps->accept_cb(new_fd, &ss, ss_len, new_streamp); +} + +static void +pfd_wait(struct pstream *pstream) +{ + struct fd_pstream *ps = fd_pstream_cast(pstream); + poll_fd_wait(ps->fd, POLLIN); +} + +static const struct pstream_class fd_pstream_class = { + "pstream", + false, + NULL, + pfd_close, + pfd_accept, + pfd_wait, +}; + +/* Helper functions. */ +static void +maybe_unlink_and_free(char *path) +{ + if (path) { + fatal_signal_unlink_file_now(path); + free(path); + } +} diff -Nru openvswitch-2.3.1/lib/stream-fd.h openvswitch-2.4.0~git20150623/lib/stream-fd.h --- openvswitch-2.3.1/lib/stream-fd.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-fd.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2012, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2012, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,11 +29,10 @@ struct sockaddr_storage; int new_fd_stream(const char *name, int fd, int connect_status, - struct stream **streamp); + int fd_type, struct stream **streamp); int new_fd_pstream(const char *name, int fd, int (*accept_cb)(int fd, const struct sockaddr_storage *ss, size_t ss_len, struct stream **), - int (*set_dscp_cb)(int fd, uint8_t dscp), char *unlink_path, struct pstream **pstreamp); diff -Nru openvswitch-2.3.1/lib/stream-fd-unix.c openvswitch-2.4.0~git20150623/lib/stream-fd-unix.c --- openvswitch-2.3.1/lib/stream-fd-unix.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-fd-unix.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2014 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "stream-fd.h" -#include -#include -#include -#include -#include -#include -#include -#include "fatal-signal.h" -#include "poll-loop.h" -#include "socket-util.h" -#include "util.h" -#include "stream-provider.h" -#include "stream.h" -#include "vlog.h" - -VLOG_DEFINE_THIS_MODULE(stream_fd); - -/* Active file descriptor stream. */ - -struct stream_fd -{ - struct stream stream; - int fd; -}; - -static const struct stream_class stream_fd_class; - -static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 25); - -static void maybe_unlink_and_free(char *path); - -/* Creates a new stream named 'name' that will send and receive data on 'fd' - * and stores a pointer to the stream in '*streamp'. Initial connection status - * 'connect_status' is interpreted as described for stream_init(). - * - * Returns 0 if successful, otherwise a positive errno value. (The current - * implementation never fails.) */ -int -new_fd_stream(const char *name, int fd, int connect_status, - struct stream **streamp) -{ - struct stream_fd *s; - - s = xmalloc(sizeof *s); - stream_init(&s->stream, &stream_fd_class, connect_status, name); - s->fd = fd; - *streamp = &s->stream; - return 0; -} - -static struct stream_fd * -stream_fd_cast(struct stream *stream) -{ - stream_assert_class(stream, &stream_fd_class); - return CONTAINER_OF(stream, struct stream_fd, stream); -} - -static void -fd_close(struct stream *stream) -{ - struct stream_fd *s = stream_fd_cast(stream); - close(s->fd); - free(s); -} - -static int -fd_connect(struct stream *stream) -{ - struct stream_fd *s = stream_fd_cast(stream); - return check_connection_completion(s->fd); -} - -static ssize_t -fd_recv(struct stream *stream, void *buffer, size_t n) -{ - struct stream_fd *s = stream_fd_cast(stream); - ssize_t retval; - - retval = read(s->fd, buffer, n); - return retval >= 0 ? retval : -errno; -} - -static ssize_t -fd_send(struct stream *stream, const void *buffer, size_t n) -{ - struct stream_fd *s = stream_fd_cast(stream); - ssize_t retval; - - retval = write(s->fd, buffer, n); - return (retval > 0 ? retval - : retval == 0 ? -EAGAIN - : -errno); -} - -static void -fd_wait(struct stream *stream, enum stream_wait_type wait) -{ - struct stream_fd *s = stream_fd_cast(stream); - switch (wait) { - case STREAM_CONNECT: - case STREAM_SEND: - poll_fd_wait(s->fd, POLLOUT); - break; - - case STREAM_RECV: - poll_fd_wait(s->fd, POLLIN); - break; - - default: - OVS_NOT_REACHED(); - } -} - -static const struct stream_class stream_fd_class = { - "fd", /* name */ - false, /* needs_probes */ - NULL, /* open */ - fd_close, /* close */ - fd_connect, /* connect */ - fd_recv, /* recv */ - fd_send, /* send */ - NULL, /* run */ - NULL, /* run_wait */ - fd_wait, /* wait */ -}; - -/* Passive file descriptor stream. */ - -struct fd_pstream -{ - struct pstream pstream; - int fd; - int (*accept_cb)(int fd, const struct sockaddr_storage *, size_t ss_len, - struct stream **); - int (*set_dscp_cb)(int fd, uint8_t dscp); - char *unlink_path; -}; - -static const struct pstream_class fd_pstream_class; - -static struct fd_pstream * -fd_pstream_cast(struct pstream *pstream) -{ - pstream_assert_class(pstream, &fd_pstream_class); - return CONTAINER_OF(pstream, struct fd_pstream, pstream); -} - -/* Creates a new pstream named 'name' that will accept new socket connections - * on 'fd' and stores a pointer to the stream in '*pstreamp'. - * - * When a connection has been accepted, 'accept_cb' will be called with the new - * socket fd 'fd' and the remote address of the connection 'sa' and 'sa_len'. - * accept_cb must return 0 if the connection is successful, in which case it - * must initialize '*streamp' to the new stream, or a positive errno value on - * error. In either case accept_cb takes ownership of the 'fd' passed in. - * - * When '*pstreamp' is closed, then 'unlink_path' (if nonnull) will be passed - * to fatal_signal_unlink_file_now() and freed with free(). - * - * Returns 0 if successful, otherwise a positive errno value. (The current - * implementation never fails.) */ -int -new_fd_pstream(const char *name, int fd, - int (*accept_cb)(int fd, const struct sockaddr_storage *ss, - size_t ss_len, struct stream **streamp), - int (*set_dscp_cb)(int fd, uint8_t dscp), - char *unlink_path, struct pstream **pstreamp) -{ - struct fd_pstream *ps = xmalloc(sizeof *ps); - pstream_init(&ps->pstream, &fd_pstream_class, name); - ps->fd = fd; - ps->accept_cb = accept_cb; - ps->set_dscp_cb = set_dscp_cb; - ps->unlink_path = unlink_path; - *pstreamp = &ps->pstream; - return 0; -} - -static void -pfd_close(struct pstream *pstream) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - close(ps->fd); - maybe_unlink_and_free(ps->unlink_path); - free(ps); -} - -static int -pfd_accept(struct pstream *pstream, struct stream **new_streamp) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - struct sockaddr_storage ss; - socklen_t ss_len = sizeof ss; - int new_fd; - int retval; - - new_fd = accept(ps->fd, (struct sockaddr *) &ss, &ss_len); - if (new_fd < 0) { - retval = errno; - if (retval != EAGAIN) { - VLOG_DBG_RL(&rl, "accept: %s", ovs_strerror(retval)); - } - return retval; - } - - retval = set_nonblocking(new_fd); - if (retval) { - close(new_fd); - return retval; - } - - return ps->accept_cb(new_fd, &ss, ss_len, new_streamp); -} - -static void -pfd_wait(struct pstream *pstream) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - poll_fd_wait(ps->fd, POLLIN); -} - -static int -pfd_set_dscp(struct pstream *pstream, uint8_t dscp) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - if (ps->set_dscp_cb) { - return ps->set_dscp_cb(ps->fd, dscp); - } - return 0; -} - -static const struct pstream_class fd_pstream_class = { - "pstream", - false, - NULL, - pfd_close, - pfd_accept, - pfd_wait, - pfd_set_dscp, -}; - -/* Helper functions. */ -static void -maybe_unlink_and_free(char *path) -{ - if (path) { - fatal_signal_unlink_file_now(path); - free(path); - } -} diff -Nru openvswitch-2.3.1/lib/stream-fd-windows.c openvswitch-2.4.0~git20150623/lib/stream-fd-windows.c --- openvswitch-2.3.1/lib/stream-fd-windows.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-fd-windows.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2014 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "stream-fd.h" -#include -#include -#include -#include -#include -#include -#include -#include "fatal-signal.h" -#include "poll-loop.h" -#include "socket-util.h" -#include "stream.h" -#include "stream-provider.h" -#include "util.h" -#include "vlog.h" - -VLOG_DEFINE_THIS_MODULE(stream_fd_windows); - -/* Active file descriptor stream. */ - -struct stream_fd -{ - struct stream stream; - int fd; - HANDLE wevent; -}; - -static const struct stream_class stream_fd_class; - -static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 25); - -/* Creates a new stream named 'name' that will send and receive data on 'fd' - * and stores a pointer to the stream in '*streamp'. Initial connection status - * 'connect_status' is interpreted as described for stream_init(). - * - * Returns 0 if successful, otherwise a positive errno value. (The current - * implementation never fails.) */ -int -new_fd_stream(const char *name, int fd, int connect_status, - struct stream **streamp) -{ - struct stream_fd *s; - - s = xmalloc(sizeof *s); - stream_init(&s->stream, &stream_fd_class, connect_status, name); - s->fd = fd; - s->wevent = CreateEvent(NULL, FALSE, FALSE, NULL); - *streamp = &s->stream; - return 0; -} - -static struct stream_fd * -stream_fd_cast(struct stream *stream) -{ - stream_assert_class(stream, &stream_fd_class); - return CONTAINER_OF(stream, struct stream_fd, stream); -} - -static void -fd_close(struct stream *stream) -{ - struct stream_fd *s = stream_fd_cast(stream); - WSAEventSelect(s->fd, NULL, 0); - CloseHandle(s->wevent); - closesocket(s->fd); - free(s); -} - -static int -fd_connect(struct stream *stream) -{ - struct stream_fd *s = stream_fd_cast(stream); - return check_connection_completion(s->fd); -} - -static ssize_t -fd_recv(struct stream *stream, void *buffer, size_t n) -{ - struct stream_fd *s = stream_fd_cast(stream); - ssize_t retval; - - retval = recv(s->fd, buffer, n, 0); - if (retval < 0) { - retval = -sock_errno(); - } - if (retval == -WSAEWOULDBLOCK) { - return -EAGAIN; - } - return retval; -} - -static ssize_t -fd_send(struct stream *stream, const void *buffer, size_t n) -{ - struct stream_fd *s = stream_fd_cast(stream); - ssize_t retval; - - retval = send(s->fd, buffer, n, 0); - if (retval < 0) { - retval = -sock_errno(); - } - if (retval == -WSAEWOULDBLOCK) { - return -EAGAIN; - } - - return retval; -} - -static void -fd_wait(struct stream *stream, enum stream_wait_type wait) -{ - struct stream_fd *s = stream_fd_cast(stream); - switch (wait) { - case STREAM_CONNECT: - case STREAM_SEND: - poll_fd_wait_event(s->fd, s->wevent, POLLOUT); - break; - - case STREAM_RECV: - poll_fd_wait_event(s->fd, s->wevent, POLLIN); - break; - - default: - OVS_NOT_REACHED(); - } -} - -static const struct stream_class stream_fd_class = { - "fd", /* name */ - false, /* needs_probes */ - NULL, /* open */ - fd_close, /* close */ - fd_connect, /* connect */ - fd_recv, /* recv */ - fd_send, /* send */ - NULL, /* run */ - NULL, /* run_wait */ - fd_wait, /* wait */ -}; - -/* Passive file descriptor stream. */ - -struct fd_pstream -{ - struct pstream pstream; - int fd; - HANDLE wevent; - int (*accept_cb)(int fd, const struct sockaddr_storage *, size_t ss_len, - struct stream **); - int (*set_dscp_cb)(int fd, uint8_t dscp); - char *unlink_path; -}; - -static const struct pstream_class fd_pstream_class; - -static struct fd_pstream * -fd_pstream_cast(struct pstream *pstream) -{ - pstream_assert_class(pstream, &fd_pstream_class); - return CONTAINER_OF(pstream, struct fd_pstream, pstream); -} - -/* Creates a new pstream named 'name' that will accept new socket connections - * on 'fd' and stores a pointer to the stream in '*pstreamp'. - * - * When a connection has been accepted, 'accept_cb' will be called with the new - * socket fd 'fd' and the remote address of the connection 'sa' and 'sa_len'. - * accept_cb must return 0 if the connection is successful, in which case it - * must initialize '*streamp' to the new stream, or a positive errno value on - * error. In either case accept_cb takes ownership of the 'fd' passed in. - * - * When '*pstreamp' is closed, then 'unlink_path' (if nonnull) will be passed - * to fatal_signal_unlink_file_now() and freed with free(). - * - * Returns 0 if successful, otherwise a positive errno value. (The current - * implementation never fails.) */ -int -new_fd_pstream(const char *name, int fd, - int (*accept_cb)(int fd, const struct sockaddr_storage *ss, - size_t ss_len, struct stream **streamp), - int (*set_dscp_cb)(int fd, uint8_t dscp), - char *unlink_path, struct pstream **pstreamp) -{ - struct fd_pstream *ps = xmalloc(sizeof *ps); - pstream_init(&ps->pstream, &fd_pstream_class, name); - ps->fd = fd; - ps->wevent = CreateEvent(NULL, FALSE, FALSE, NULL); - ps->accept_cb = accept_cb; - ps->set_dscp_cb = set_dscp_cb; - ps->unlink_path = unlink_path; - *pstreamp = &ps->pstream; - return 0; -} - -static void -pfd_close(struct pstream *pstream) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - WSAEventSelect(ps->fd, NULL, 0); - CloseHandle(ps->wevent); - closesocket(ps->fd); - free(ps); -} - -static int -pfd_accept(struct pstream *pstream, struct stream **new_streamp) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - struct sockaddr_storage ss; - socklen_t ss_len = sizeof ss; - int new_fd; - int retval; - - new_fd = accept(ps->fd, (struct sockaddr *) &ss, &ss_len); - if (new_fd < 0) { - retval = sock_errno(); - if (retval == WSAEWOULDBLOCK) { - return EAGAIN; - } - return retval; - } - - retval = set_nonblocking(new_fd); - if (retval) { - closesocket(new_fd); - return retval; - } - - return ps->accept_cb(new_fd, &ss, ss_len, new_streamp); -} - -static void -pfd_wait(struct pstream *pstream) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - poll_fd_wait_event(ps->fd, ps->wevent, POLLIN); -} - -static int -pfd_set_dscp(struct pstream *pstream, uint8_t dscp) -{ - struct fd_pstream *ps = fd_pstream_cast(pstream); - if (ps->set_dscp_cb) { - return ps->set_dscp_cb(ps->fd, dscp); - } - return 0; -} - -static const struct pstream_class fd_pstream_class = { - "pstream", - false, - NULL, - pfd_close, - pfd_accept, - pfd_wait, - pfd_set_dscp, -}; diff -Nru openvswitch-2.3.1/lib/stream.h openvswitch-2.4.0~git20150623/lib/stream.h --- openvswitch-2.3.1/lib/stream.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,11 +22,12 @@ #include #include #include "openvswitch/types.h" -#include "vlog.h" #include "socket-util.h" +#include "util.h" struct pstream; struct stream; +struct vlog_module; void stream_usage(const char *name, bool active, bool passive, bool bootstrap); @@ -65,7 +66,6 @@ int pstream_accept(struct pstream *, struct stream **); int pstream_accept_block(struct pstream *, struct stream **); void pstream_wait(struct pstream *); -int pstream_set_dscp(struct pstream *, uint8_t dscp); ovs_be16 pstream_get_bound_port(const struct pstream *); diff -Nru openvswitch-2.3.1/lib/stream-nossl.c openvswitch-2.4.0~git20150623/lib/stream-nossl.c --- openvswitch-2.3.1/lib/stream-nossl.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-nossl.c 2015-06-23 18:46:21.000000000 +0000 @@ -16,7 +16,7 @@ #include #include "stream-ssl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(stream_nossl); @@ -28,7 +28,7 @@ return false; } -static void NO_RETURN +OVS_NO_RETURN static void nossl_option(const char *detail) { VLOG_FATAL("%s specified but Open vSwitch was built without SSL support", diff -Nru openvswitch-2.3.1/lib/stream-provider.h openvswitch-2.4.0~git20150623/lib/stream-provider.h --- openvswitch-2.3.1/lib/stream-provider.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-provider.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -183,9 +183,6 @@ /* Arranges for the poll loop to wake up when a connection is ready to be * accepted on 'pstream'. */ void (*wait)(struct pstream *pstream); - - /* Set DSCP value of the listening socket. */ - int (*set_dscp)(struct pstream *pstream, uint8_t dscp); }; /* Active and passive stream classes. */ diff -Nru openvswitch-2.3.1/lib/stream-ssl.c openvswitch-2.4.0~git20150623/lib/stream-ssl.c --- openvswitch-2.3.1/lib/stream-ssl.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-ssl.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ #include "stream-provider.h" #include "stream.h" #include "timeval.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #ifdef _WIN32 /* Ref: https://www.openssl.org/support/faq.html#PROG2 @@ -82,7 +82,6 @@ enum ssl_state state; enum session_type type; int fd; - HANDLE wevent; SSL *ssl; struct ofpbuf *txbuf; unsigned int session_nr; @@ -200,7 +199,6 @@ const void *, size_t, SSL *, void *sslv_); static bool update_ssl_config(struct ssl_config_file *, const char *file_name); static int sock_errno(void); -static void clear_handle(int fd, HANDLE wevent); static short int want_to_poll_events(int want) @@ -224,11 +222,8 @@ new_ssl_stream(const char *name, int fd, enum session_type type, enum ssl_state state, struct stream **streamp) { - struct sockaddr_storage local; - socklen_t local_len = sizeof local; struct ssl_stream *sslv; SSL *ssl = NULL; - int on = 1; int retval; /* Check for all the needful configuration. */ @@ -254,19 +249,11 @@ goto error; } - /* Get the local IP and port information */ - retval = getsockname(fd, (struct sockaddr *) &local, &local_len); - if (retval) { - memset(&local, 0, sizeof local); - } - - /* Disable Nagle. */ - retval = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on); - if (retval) { - retval = sock_errno(); - VLOG_ERR("%s: setsockopt(TCP_NODELAY): %s", name, - sock_strerror(retval)); - goto error; + /* Disable Nagle. + * On windows platforms, this can only be called upon TCP connected. + */ + if (state == STATE_SSL_CONNECTING) { + setsockopt_tcp_nodelay(fd); } /* Create and configure OpenSSL stream. */ @@ -291,11 +278,6 @@ sslv->state = state; sslv->type = type; sslv->fd = fd; -#ifdef _WIN32 - sslv->wevent = CreateEvent(NULL, FALSE, FALSE, NULL); -#else - sslv->wevent = 0; -#endif sslv->ssl = ssl; sslv->txbuf = NULL; sslv->rx_want = sslv->tx_want = SSL_NOTHING; @@ -335,7 +317,7 @@ return error; } - error = inet_open_active(SOCK_STREAM, suffix, OFP_OLD_PORT, NULL, &fd, + error = inet_open_active(SOCK_STREAM, suffix, OFP_PORT, NULL, &fd, dscp); if (fd >= 0) { int state = error ? STATE_TCP_CONNECTING : STATE_SSL_CONNECTING; @@ -455,6 +437,7 @@ return retval; } sslv->state = STATE_SSL_CONNECTING; + setsockopt_tcp_nodelay(sslv->fd); /* Fall through. */ case STATE_SSL_CONNECTING: @@ -524,7 +507,6 @@ ERR_clear_error(); SSL_free(sslv->ssl); - clear_handle(sslv->fd, sslv->wevent); closesocket(sslv->fd); free(sslv); } @@ -652,15 +634,14 @@ for (;;) { int old_state = SSL_get_state(sslv->ssl); - int ret = SSL_write(sslv->ssl, - ofpbuf_data(sslv->txbuf), ofpbuf_size(sslv->txbuf)); + int ret = SSL_write(sslv->ssl, sslv->txbuf->data, sslv->txbuf->size); if (old_state != SSL_get_state(sslv->ssl)) { sslv->rx_want = SSL_NOTHING; } sslv->tx_want = SSL_NOTHING; if (ret > 0) { ofpbuf_pull(sslv->txbuf, ret); - if (ofpbuf_size(sslv->txbuf) == 0) { + if (sslv->txbuf->size == 0) { return 0; } } else { @@ -717,8 +698,7 @@ struct ssl_stream *sslv = ssl_stream_cast(stream); if (sslv->tx_want != SSL_NOTHING) { - poll_fd_wait_event(sslv->fd, sslv->wevent, - want_to_poll_events(sslv->tx_want)); + poll_fd_wait(sslv->fd, want_to_poll_events(sslv->tx_want)); } } @@ -734,14 +714,14 @@ } else { switch (sslv->state) { case STATE_TCP_CONNECTING: - poll_fd_wait_event(sslv->fd, sslv->wevent, POLLOUT); + poll_fd_wait(sslv->fd, POLLOUT); break; case STATE_SSL_CONNECTING: /* ssl_connect() called SSL_accept() or SSL_connect(), which * set up the status that we test here. */ - poll_fd_wait_event(sslv->fd, sslv->wevent, - want_to_poll_events(SSL_want(sslv->ssl))); + poll_fd_wait(sslv->fd, + want_to_poll_events(SSL_want(sslv->ssl))); break; default: @@ -752,8 +732,7 @@ case STREAM_RECV: if (sslv->rx_want != SSL_NOTHING) { - poll_fd_wait_event(sslv->fd, sslv->wevent, - want_to_poll_events(sslv->rx_want)); + poll_fd_wait(sslv->fd, want_to_poll_events(sslv->rx_want)); } else { poll_immediate_wake(); } @@ -793,7 +772,6 @@ { struct pstream pstream; int fd; - HANDLE wevent; }; const struct pstream_class pssl_pstream_class; @@ -822,7 +800,7 @@ return retval; } - fd = inet_open_passive(SOCK_STREAM, suffix, OFP_OLD_PORT, &ss, dscp); + fd = inet_open_passive(SOCK_STREAM, suffix, OFP_PORT, &ss, dscp, true); if (fd < 0) { return -fd; } @@ -835,11 +813,6 @@ pstream_init(&pssl->pstream, &pssl_pstream_class, bound_name); pstream_set_bound_port(&pssl->pstream, htons(port)); pssl->fd = fd; -#ifdef _WIN32 - pssl->wevent = CreateEvent(NULL, FALSE, FALSE, NULL); -#else - pssl->wevent = 0; -#endif *pstreamp = &pssl->pstream; return 0; } @@ -848,7 +821,6 @@ pssl_close(struct pstream *pstream) { struct pssl_pstream *pssl = pssl_pstream_cast(pstream); - clear_handle(pssl->fd, pssl->wevent); closesocket(pssl->fd); free(pssl); } @@ -895,14 +867,7 @@ pssl_wait(struct pstream *pstream) { struct pssl_pstream *pssl = pssl_pstream_cast(pstream); - poll_fd_wait_event(pssl->fd, pssl->wevent, POLLIN); -} - -static int -pssl_set_dscp(struct pstream *pstream, uint8_t dscp) -{ - struct pssl_pstream *pssl = pssl_pstream_cast(pstream); - return set_dscp(pssl->fd, dscp); + poll_fd_wait(pssl->fd, POLLIN); } const struct pstream_class pssl_pstream_class = { @@ -912,7 +877,6 @@ pssl_close, pssl_accept, pssl_wait, - pssl_set_dscp, }; /* @@ -1427,16 +1391,3 @@ ds_destroy(&details); } - -static void -clear_handle(int fd OVS_UNUSED, HANDLE wevent OVS_UNUSED) -{ -#ifdef _WIN32 - if (fd) { - WSAEventSelect(fd, NULL, 0); - } - if (wevent) { - CloseHandle(wevent); - } -#endif -} diff -Nru openvswitch-2.3.1/lib/stream-tcp.c openvswitch-2.4.0~git20150623/lib/stream-tcp.c --- openvswitch-2.3.1/lib/stream-tcp.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-tcp.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -32,7 +31,7 @@ #include "util.h" #include "stream-provider.h" #include "stream-fd.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(stream_tcp); @@ -42,27 +41,11 @@ new_tcp_stream(const char *name, int fd, int connect_status, struct stream **streamp) { - struct sockaddr_storage local; - socklen_t local_len = sizeof local; - int on = 1; - int retval; - - /* Get the local IP and port information */ - retval = getsockname(fd, (struct sockaddr *) &local, &local_len); - if (retval) { - memset(&local, 0, sizeof local); - } - - retval = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on); - if (retval) { - int error = sock_errno(); - VLOG_ERR("%s: setsockopt(TCP_NODELAY): %s", - name, sock_strerror(error)); - closesocket(fd); - return error; + if (connect_status == 0) { + setsockopt_tcp_nodelay(fd); } - return new_fd_stream(name, fd, connect_status, streamp); + return new_fd_stream(name, fd, connect_status, AF_INET, streamp); } static int @@ -106,7 +89,7 @@ if (!strchr(suffix, ':')) { path = xasprintf("%s/%s", ovs_rundir(), suffix); } else { - path = strdup(suffix); + path = xstrdup(suffix); } file = fopen(path, "r"); @@ -154,27 +137,31 @@ size_t, struct stream **streamp); static int -ptcp_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp, - uint8_t dscp) +new_pstream(char *suffix, const char *name, struct pstream **pstreamp, + int dscp, char *unlink_path, bool kernel_print_port) { char bound_name[SS_NTOP_BUFSIZE + 16]; char addrbuf[SS_NTOP_BUFSIZE]; struct sockaddr_storage ss; - uint16_t port; int error; + uint16_t port; int fd; + char *conn_name = CONST_CAST(char *, name); - fd = inet_open_passive(SOCK_STREAM, suffix, -1, &ss, dscp); + fd = inet_open_passive(SOCK_STREAM, suffix, -1, &ss, dscp, + kernel_print_port); if (fd < 0) { return -fd; } port = ss_get_port(&ss); - snprintf(bound_name, sizeof bound_name, "ptcp:%"PRIu16":%s", - port, ss_format_address(&ss, addrbuf, sizeof addrbuf)); + if (!conn_name) { + snprintf(bound_name, sizeof bound_name, "ptcp:%"PRIu16":%s", + port, ss_format_address(&ss, addrbuf, sizeof addrbuf)); + conn_name = bound_name; + } - error = new_fd_pstream(bound_name, fd, ptcp_accept, set_dscp, NULL, - pstreamp); + error = new_fd_pstream(conn_name, fd, ptcp_accept, unlink_path, pstreamp); if (!error) { pstream_set_bound_port(*pstreamp, htons(port)); } @@ -182,6 +169,13 @@ } static int +ptcp_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp, + uint8_t dscp) +{ + return new_pstream(suffix, NULL, pstreamp, dscp, NULL, true); +} + +static int ptcp_accept(int fd, const struct sockaddr_storage *ss, size_t ss_len OVS_UNUSED, struct stream **streamp) { @@ -201,13 +195,12 @@ NULL, NULL, NULL, - NULL, }; #ifdef _WIN32 static int -pwindows_open(const char *name OVS_UNUSED, char *suffix, - struct pstream **pstreamp, uint8_t dscp) +pwindows_open(const char *name, char *suffix, struct pstream **pstreamp, + uint8_t dscp) { int error; char *suffix_new, *path; @@ -215,19 +208,20 @@ struct pstream *listener; suffix_new = xstrdup("0:127.0.0.1"); - error = ptcp_open(name, suffix_new, pstreamp, dscp); - if (error) { - goto exit; - } - listener = *pstreamp; /* If the path does not contain a ':', assume it is relative to * OVS_RUNDIR. */ if (!strchr(suffix, ':')) { path = xasprintf("%s/%s", ovs_rundir(), suffix); } else { - path = strdup(suffix); + path = xstrdup(suffix); + } + + error = new_pstream(suffix_new, name, pstreamp, dscp, path, false); + if (error) { + goto exit; } + listener = *pstreamp; file = fopen(path, "w"); if (!file) { @@ -244,7 +238,6 @@ goto exit; } fclose(file); - free(path); exit: free(suffix_new); @@ -258,6 +251,5 @@ NULL, NULL, NULL, - NULL, }; #endif diff -Nru openvswitch-2.3.1/lib/stream-unix.c openvswitch-2.4.0~git20150623/lib/stream-unix.c --- openvswitch-2.3.1/lib/stream-unix.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/stream-unix.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ #include "util.h" #include "stream-provider.h" #include "stream-fd.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(stream_unix); @@ -57,7 +57,8 @@ } free(connect_path); - return new_fd_stream(name, fd, check_connection_completion(fd), streamp); + return new_fd_stream(name, fd, check_connection_completion(fd), + AF_UNIX, streamp); } const struct stream_class unix_stream_class = { @@ -93,7 +94,7 @@ return errno; } - if (listen(fd, 10) < 0) { + if (listen(fd, 64) < 0) { error = errno; VLOG_ERR("%s: listen: %s", name, ovs_strerror(error)); close(fd); @@ -101,7 +102,7 @@ return error; } - return new_fd_pstream(name, fd, punix_accept, NULL, bind_path, pstreamp); + return new_fd_pstream(name, fd, punix_accept, bind_path, pstreamp); } static int @@ -117,7 +118,7 @@ } else { strcpy(name, "unix"); } - return new_fd_stream(name, fd, 0, streamp); + return new_fd_stream(name, fd, 0, AF_UNIX, streamp); } const struct pstream_class punix_pstream_class = { @@ -127,6 +128,5 @@ NULL, NULL, NULL, - NULL, }; diff -Nru openvswitch-2.3.1/lib/svec.c openvswitch-2.4.0~git20150623/lib/svec.c --- openvswitch-2.3.1/lib/svec.c 2013-10-18 20:33:47.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/svec.c 2015-06-23 18:46:21.000000000 +0000 @@ -21,7 +21,7 @@ #include #include "dynamic-string.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(svec); diff -Nru openvswitch-2.3.1/lib/table.h openvswitch-2.4.0~git20150623/lib/table.h --- openvswitch-2.3.1/lib/table.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/table.h 2015-06-23 18:46:21.000000000 +0000 @@ -41,7 +41,7 @@ void table_set_timestamp(struct table *, bool timestamp); void table_add_column(struct table *, const char *heading, ...) - PRINTF_FORMAT(2, 3); + OVS_PRINTF_FORMAT(2, 3); void table_add_row(struct table *); /* Table cells. */ diff -Nru openvswitch-2.3.1/lib/timer.h openvswitch-2.4.0~git20150623/lib/timer.h --- openvswitch-2.3.1/lib/timer.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/timer.h 2015-06-23 18:46:21.000000000 +0000 @@ -28,7 +28,7 @@ long long int timer_msecs_until_expired(const struct timer *); void timer_wait_at(const struct timer *, const char *where); -#define timer_wait(timer) timer_wait_at(timer, SOURCE_LOCATOR) +#define timer_wait(timer) timer_wait_at(timer, OVS_SOURCE_LOCATOR) /* Causes 'timer' to expire when 'duration' milliseconds have passed. * diff -Nru openvswitch-2.3.1/lib/timeval.c openvswitch-2.4.0~git20150623/lib/timeval.c --- openvswitch-2.3.1/lib/timeval.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/timeval.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ #include "seq.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(timeval); @@ -53,9 +53,17 @@ #endif /* Number of 100 ns intervals from January 1, 1601 till January 1, 1970. */ -static ULARGE_INTEGER unix_epoch; +const static unsigned long long unix_epoch = 116444736000000000; #endif /* _WIN32 */ +/* Structure set by unixctl time/warp command. */ +struct large_warp { + struct unixctl_conn *conn; /* Connection waiting for warp response. */ + long long int total_warp; /* Total offset to be added to monotonic time. */ + long long int warp; /* 'total_warp' offset done in steps of 'warp'. */ + unsigned int main_thread_id; /* Identification for the main thread. */ +}; + struct clock { clockid_t id; /* CLOCK_MONOTONIC or CLOCK_REALTIME. */ @@ -65,6 +73,8 @@ struct timespec warp OVS_GUARDED; /* Offset added for unit tests. */ bool stopped OVS_GUARDED; /* Disable real-time updates if true. */ struct timespec cache OVS_GUARDED; /* Last time read from kernel. */ + struct large_warp large_warp OVS_GUARDED; /* Connection information waiting + for warp response. */ }; /* Our clocks. */ @@ -92,6 +102,7 @@ static void log_poll_interval(long long int last_wakeup); static struct rusage *get_recent_rusage(void); +static int getrusage_thread(struct rusage *); static void refresh_rusage(void); static void timespec_add(struct timespec *sum, const struct timespec *a, const struct timespec *b); @@ -104,7 +115,6 @@ ovs_mutex_init(&c->mutex); atomic_init(&c->slow_path, false); xclock_gettime(c->id, &c->cache); - timewarp_seq = seq_create(); } static void @@ -112,18 +122,9 @@ { struct timespec ts; -#ifdef _WIN32 - /* Calculate number of 100-nanosecond intervals till 01/01/1970. */ - SYSTEMTIME unix_epoch_st = { 1970, 1, 0, 1, 0, 0, 0, 0}; - FILETIME unix_epoch_ft; - - SystemTimeToFileTime(&unix_epoch_st, &unix_epoch_ft); - unix_epoch.LowPart = unix_epoch_ft.dwLowDateTime; - unix_epoch.HighPart = unix_epoch_ft.dwHighDateTime; -#endif - coverage_init(); + timewarp_seq = seq_create(); init_clock(&monotonic_clock, (!clock_gettime(CLOCK_MONOTONIC, &ts) ? CLOCK_MONOTONIC : CLOCK_REALTIME)); @@ -146,7 +147,7 @@ time_init(); - atomic_read_explicit(&c->slow_path, &slow_path, memory_order_relaxed); + atomic_read_relaxed(&c->slow_path, &slow_path); if (!slow_path) { xclock_gettime(c->id, ts); } else { @@ -405,12 +406,14 @@ ULARGE_INTEGER current_time = xgetfiletime(); /* Time from Epoch to now. */ - ts->tv_sec = (current_time.QuadPart - unix_epoch.QuadPart) / 10000000; - ts->tv_nsec = ((current_time.QuadPart - unix_epoch.QuadPart) % + ts->tv_sec = (current_time.QuadPart - unix_epoch) / 10000000; + ts->tv_nsec = ((current_time.QuadPart - unix_epoch) % 10000000) * 100; } else { return -1; } + + return 0; } #endif /* _WIN32 */ @@ -424,8 +427,8 @@ #else ULARGE_INTEGER current_time = xgetfiletime(); - tv->tv_sec = (current_time.QuadPart - unix_epoch.QuadPart) / 10000000; - tv->tv_usec = ((current_time.QuadPart - unix_epoch.QuadPart) % + tv->tv_sec = (current_time.QuadPart - unix_epoch) / 10000000; + tv->tv_usec = ((current_time.QuadPart - unix_epoch) % 10000000) / 10; #endif } @@ -440,16 +443,77 @@ } } -/* Makes threads wait on timewarp_seq and be waken up when time is warped. - * This function will be no-op unless timeval_dummy_register() is called. */ +static void +msec_to_timespec(long long int ms, struct timespec *ts) +{ + ts->tv_sec = ms / 1000; + ts->tv_nsec = (ms % 1000) * 1000 * 1000; +} + +static void +timewarp_work(void) +{ + struct clock *c = &monotonic_clock; + struct timespec warp; + + ovs_mutex_lock(&c->mutex); + if (!c->large_warp.conn) { + ovs_mutex_unlock(&c->mutex); + return; + } + + if (c->large_warp.total_warp >= c->large_warp.warp) { + msec_to_timespec(c->large_warp.warp, &warp); + timespec_add(&c->warp, &c->warp, &warp); + c->large_warp.total_warp -= c->large_warp.warp; + } else if (c->large_warp.total_warp) { + msec_to_timespec(c->large_warp.total_warp, &warp); + timespec_add(&c->warp, &c->warp, &warp); + c->large_warp.total_warp = 0; + } else { + /* c->large_warp.total_warp is 0. */ + msec_to_timespec(c->large_warp.warp, &warp); + timespec_add(&c->warp, &c->warp, &warp); + } + + if (!c->large_warp.total_warp) { + unixctl_command_reply(c->large_warp.conn, "warped"); + c->large_warp.conn = NULL; + } + + ovs_mutex_unlock(&c->mutex); + seq_change(timewarp_seq); + + /* give threads (eg. monitor) some chances to run */ +#ifndef _WIN32 + poll(NULL, 0, 10); +#else + Sleep(10); +#endif +} + +/* Perform work needed for "timewarp_seq"'s producer and consumers. */ void -timewarp_wait(void) +timewarp_run(void) { + /* The function is a no-op unless timeval_dummy_register() is called. */ if (timewarp_enabled) { - uint64_t *last_seq = last_seq_get(); + unsigned int thread_id; + ovs_mutex_lock(&monotonic_clock.mutex); + thread_id = monotonic_clock.large_warp.main_thread_id; + ovs_mutex_unlock(&monotonic_clock.mutex); + + if (thread_id != ovsthread_id_self()) { + /* For threads other than the thread that changes the sequence, + * wait on it. */ + uint64_t *last_seq = last_seq_get(); - *last_seq = seq_read(timewarp_seq); - seq_wait(timewarp_seq, *last_seq); + *last_seq = seq_read(timewarp_seq); + seq_wait(timewarp_seq, *last_seq); + } else { + /* Work on adding the remaining warps. */ + timewarp_work(); + } } } @@ -497,31 +561,35 @@ const struct rusage *last_rusage = get_recent_rusage(); struct rusage rusage; - getrusage(RUSAGE_SELF, &rusage); - VLOG_WARN("Unreasonably long %lldms poll interval" - " (%lldms user, %lldms system)", - interval, - timeval_diff_msec(&rusage.ru_utime, - &last_rusage->ru_utime), - timeval_diff_msec(&rusage.ru_stime, - &last_rusage->ru_stime)); - if (rusage.ru_minflt > last_rusage->ru_minflt - || rusage.ru_majflt > last_rusage->ru_majflt) { - VLOG_WARN("faults: %ld minor, %ld major", - rusage.ru_minflt - last_rusage->ru_minflt, - rusage.ru_majflt - last_rusage->ru_majflt); - } - if (rusage.ru_inblock > last_rusage->ru_inblock - || rusage.ru_oublock > last_rusage->ru_oublock) { - VLOG_WARN("disk: %ld reads, %ld writes", - rusage.ru_inblock - last_rusage->ru_inblock, - rusage.ru_oublock - last_rusage->ru_oublock); - } - if (rusage.ru_nvcsw > last_rusage->ru_nvcsw - || rusage.ru_nivcsw > last_rusage->ru_nivcsw) { - VLOG_WARN("context switches: %ld voluntary, %ld involuntary", - rusage.ru_nvcsw - last_rusage->ru_nvcsw, - rusage.ru_nivcsw - last_rusage->ru_nivcsw); + if (!getrusage_thread(&rusage)) { + VLOG_WARN("Unreasonably long %lldms poll interval" + " (%lldms user, %lldms system)", + interval, + timeval_diff_msec(&rusage.ru_utime, + &last_rusage->ru_utime), + timeval_diff_msec(&rusage.ru_stime, + &last_rusage->ru_stime)); + + if (rusage.ru_minflt > last_rusage->ru_minflt + || rusage.ru_majflt > last_rusage->ru_majflt) { + VLOG_WARN("faults: %ld minor, %ld major", + rusage.ru_minflt - last_rusage->ru_minflt, + rusage.ru_majflt - last_rusage->ru_majflt); + } + if (rusage.ru_inblock > last_rusage->ru_inblock + || rusage.ru_oublock > last_rusage->ru_oublock) { + VLOG_WARN("disk: %ld reads, %ld writes", + rusage.ru_inblock - last_rusage->ru_inblock, + rusage.ru_oublock - last_rusage->ru_oublock); + } + if (rusage.ru_nvcsw > last_rusage->ru_nvcsw + || rusage.ru_nivcsw > last_rusage->ru_nivcsw) { + VLOG_WARN("context switches: %ld voluntary, %ld involuntary", + rusage.ru_nvcsw - last_rusage->ru_nvcsw, + rusage.ru_nivcsw - last_rusage->ru_nivcsw); + } + } else { + VLOG_WARN("Unreasonably long %lldms poll interval", interval); } coverage_log(); } @@ -618,7 +686,7 @@ void *aux OVS_UNUSED) { ovs_mutex_lock(&monotonic_clock.mutex); - atomic_store(&monotonic_clock.slow_path, true); + atomic_store_relaxed(&monotonic_clock.slow_path, true); monotonic_clock.stopped = true; xclock_gettime(monotonic_clock.id, &monotonic_clock.cache); ovs_mutex_unlock(&monotonic_clock.mutex); @@ -630,35 +698,37 @@ * number of milliseconds. Unless "time/stop" has also been executed, the * monotonic clock continues to tick forward at the normal rate afterward. * + * "time/warp LARGE_MSECS MSECS" is a variation of the above command. It + * advances the current monotonic time by LARGE_MSECS. This is done MSECS + * at a time in each run of the main thread. This gives other threads + * time to run after the clock has been advanced by MSECS. + * * Does not affect wall clock readings. */ static void timeval_warp_cb(struct unixctl_conn *conn, int argc OVS_UNUSED, const char *argv[], void *aux OVS_UNUSED) { - struct timespec ts; - int msecs; - - msecs = atoi(argv[1]); - if (msecs <= 0) { + long long int total_warp = argc > 2 ? atoll(argv[1]) : 0; + long long int msecs = argc > 2 ? atoll(argv[2]) : atoll(argv[1]); + if (msecs <= 0 || total_warp < 0) { unixctl_command_reply_error(conn, "invalid MSECS"); return; } - ts.tv_sec = msecs / 1000; - ts.tv_nsec = (msecs % 1000) * 1000 * 1000; - ovs_mutex_lock(&monotonic_clock.mutex); - atomic_store(&monotonic_clock.slow_path, true); - timespec_add(&monotonic_clock.warp, &monotonic_clock.warp, &ts); + if (monotonic_clock.large_warp.conn) { + ovs_mutex_unlock(&monotonic_clock.mutex); + unixctl_command_reply_error(conn, "A previous warp in progress"); + return; + } + atomic_store_relaxed(&monotonic_clock.slow_path, true); + monotonic_clock.large_warp.conn = conn; + monotonic_clock.large_warp.total_warp = total_warp; + monotonic_clock.large_warp.warp = msecs; + monotonic_clock.large_warp.main_thread_id = ovsthread_id_self(); ovs_mutex_unlock(&monotonic_clock.mutex); - seq_change(timewarp_seq); - /* give threads (eg. monitor) some chances to run */ -#ifndef _WIN32 - poll(NULL, 0, 10); -#else - Sleep(10); -#endif - unixctl_command_reply(conn, "warped"); + + timewarp_work(); } void @@ -666,7 +736,7 @@ { timewarp_enabled = true; unixctl_command_register("time/stop", "", 0, 0, timeval_stop_cb, NULL); - unixctl_command_register("time/warp", "MSECS", 1, 1, + unixctl_command_register("time/warp", "[large_msecs] msecs", 1, 2, timeval_warp_cb, NULL); } diff -Nru openvswitch-2.3.1/lib/timeval.h openvswitch-2.4.0~git20150623/lib/timeval.h --- openvswitch-2.3.1/lib/timeval.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/timeval.h 2015-06-23 18:46:21.000000000 +0000 @@ -74,7 +74,7 @@ long long int time_boot_msec(void); -void timewarp_wait(void); +void timewarp_run(void); #ifdef __cplusplus } diff -Nru openvswitch-2.3.1/lib/tnl-arp-cache.c openvswitch-2.4.0~git20150623/lib/tnl-arp-cache.c --- openvswitch-2.3.1/lib/tnl-arp-cache.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/tnl-arp-cache.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "bitmap.h" +#include "cmap.h" +#include "coverage.h" +#include "dpif-netdev.h" +#include "dynamic-string.h" +#include "errno.h" +#include "flow.h" +#include "netdev.h" +#include "ovs-thread.h" +#include "packets.h" +#include "poll-loop.h" +#include "seq.h" +#include "timeval.h" +#include "tnl-arp-cache.h" +#include "unaligned.h" +#include "unixctl.h" +#include "util.h" +#include "openvswitch/vlog.h" + + +/* In seconds */ +#define ARP_ENTRY_DEFAULT_IDLE_TIME (15 * 60) + +struct tnl_arp_entry { + struct cmap_node cmap_node; + ovs_be32 ip; + uint8_t mac[ETH_ADDR_LEN]; + time_t expires; /* Expiration time. */ + char br_name[IFNAMSIZ]; +}; + +static struct cmap table; +static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; + +static struct tnl_arp_entry * +tnl_arp_lookup__(const char br_name[IFNAMSIZ], ovs_be32 dst) +{ + struct tnl_arp_entry *arp; + + CMAP_FOR_EACH_WITH_HASH (arp, cmap_node, (OVS_FORCE uint32_t) dst, &table) { + if (arp->ip == dst && !strcmp(arp->br_name, br_name)) { + arp->expires = time_now() + ARP_ENTRY_DEFAULT_IDLE_TIME; + return arp; + } + } + return NULL; +} + +int +tnl_arp_lookup(const char br_name[IFNAMSIZ], ovs_be32 dst, + uint8_t mac[ETH_ADDR_LEN]) +{ + struct tnl_arp_entry *arp; + int res = ENOENT; + + arp = tnl_arp_lookup__(br_name, dst); + if (arp) { + memcpy(mac, arp->mac, ETH_ADDR_LEN); + res = 0; + } + + return res; +} + +static void +arp_entry_free(struct tnl_arp_entry *arp) +{ + free(arp); +} + +static void +tnl_arp_delete(struct tnl_arp_entry *arp) +{ + cmap_remove(&table, &arp->cmap_node, (OVS_FORCE uint32_t) arp->ip); + ovsrcu_postpone(arp_entry_free, arp); +} + +int +tnl_arp_snoop(const struct flow *flow, struct flow_wildcards *wc, + const char name[IFNAMSIZ]) +{ + struct tnl_arp_entry *arp; + + if (flow->dl_type != htons(ETH_TYPE_ARP)) { + return EINVAL; + } + + /* Exact Match on all ARP flows. */ + memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); + memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src); + memset(&wc->masks.arp_sha, 0xff, sizeof wc->masks.arp_sha); + + ovs_mutex_lock(&mutex); + arp = tnl_arp_lookup__(name, flow->nw_src); + if (arp) { + if (!memcmp(arp->mac, flow->arp_sha, ETH_ADDR_LEN)) { + arp->expires = time_now() + ARP_ENTRY_DEFAULT_IDLE_TIME; + ovs_mutex_unlock(&mutex); + return 0; + } + tnl_arp_delete(arp); + seq_change(tnl_conf_seq); + } + + arp = xmalloc(sizeof *arp); + + arp->ip = flow->nw_src; + memcpy(arp->mac, flow->arp_sha, ETH_ADDR_LEN); + arp->expires = time_now() + ARP_ENTRY_DEFAULT_IDLE_TIME; + ovs_strlcpy(arp->br_name, name, sizeof arp->br_name); + cmap_insert(&table, &arp->cmap_node, (OVS_FORCE uint32_t) arp->ip); + ovs_mutex_unlock(&mutex); + return 0; +} + +void +tnl_arp_cache_run(void) +{ + struct tnl_arp_entry *arp; + bool changed = false; + + ovs_mutex_lock(&mutex); + CMAP_FOR_EACH(arp, cmap_node, &table) { + if (arp->expires <= time_now()) { + tnl_arp_delete(arp); + changed = true; + } + } + ovs_mutex_unlock(&mutex); + + if (changed) { + seq_change(tnl_conf_seq); + } +} + +static void +tnl_arp_cache_flush(struct unixctl_conn *conn OVS_UNUSED, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +{ + struct tnl_arp_entry *arp; + bool changed = false; + + ovs_mutex_lock(&mutex); + CMAP_FOR_EACH(arp, cmap_node, &table) { + tnl_arp_delete(arp); + changed = true; + } + ovs_mutex_unlock(&mutex); + if (changed) { + seq_change(tnl_conf_seq); + } + unixctl_command_reply(conn, "OK"); +} + +#define MAX_IP_ADDR_LEN 17 + +static void +tnl_arp_cache_show(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + struct tnl_arp_entry *arp; + + ds_put_cstr(&ds, "IP MAC Bridge\n"); + ds_put_cstr(&ds, "=============================================\n"); + ovs_mutex_lock(&mutex); + CMAP_FOR_EACH(arp, cmap_node, &table) { + int start_len, need_ws; + + start_len = ds.length; + ds_put_format(&ds, IP_FMT, IP_ARGS(arp->ip)); + + need_ws = MAX_IP_ADDR_LEN - (ds.length - start_len); + ds_put_char_multiple(&ds, ' ', need_ws); + + ds_put_format(&ds, ETH_ADDR_FMT" %s\n", + ETH_ADDR_ARGS(arp->mac), arp->br_name); + + } + ovs_mutex_unlock(&mutex); + unixctl_command_reply(conn, ds_cstr(&ds)); + ds_destroy(&ds); +} + +void +tnl_arp_cache_init(void) +{ + cmap_init(&table); + + unixctl_command_register("tnl/arp/show", "", 0, 0, tnl_arp_cache_show, NULL); + unixctl_command_register("tnl/arp/flush", "", 0, 0, tnl_arp_cache_flush, NULL); +} diff -Nru openvswitch-2.3.1/lib/tnl-arp-cache.h openvswitch-2.4.0~git20150623/lib/tnl-arp-cache.h --- openvswitch-2.3.1/lib/tnl-arp-cache.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/tnl-arp-cache.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TNL_ARP_CACHE_H +#define TNL_ARP_CACHE_H 1 + +#include + +#include +#include +#include +#include +#include +#include + +#include "flow.h" +#include "netdev.h" +#include "packets.h" +#include "util.h" + +int tnl_arp_snoop(const struct flow *flow, struct flow_wildcards *wc, + const char dev_name[]); +int tnl_arp_lookup(const char dev_name[], ovs_be32 dst, uint8_t mac[ETH_ADDR_LEN]); +void tnl_arp_cache_init(void); +void tnl_arp_cache_run(void); + +#endif diff -Nru openvswitch-2.3.1/lib/tnl-ports.c openvswitch-2.4.0~git20150623/lib/tnl-ports.c --- openvswitch-2.3.1/lib/tnl-ports.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/tnl-ports.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2014, 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "classifier.h" +#include "dynamic-string.h" +#include "hash.h" +#include "ofpbuf.h" +#include "ovs-thread.h" +#include "odp-util.h" +#include "tnl-arp-cache.h" +#include "tnl-ports.h" +#include "ovs-thread.h" +#include "unixctl.h" +#include "util.h" + +static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; +static struct classifier cls; /* Tunnel ports. */ + +struct tnl_port_in { + struct cls_rule cr; + odp_port_t portno; + struct ovs_refcount ref_cnt; + char dev_name[IFNAMSIZ]; +}; + +static struct tnl_port_in * +tnl_port_cast(const struct cls_rule *cr) +{ + BUILD_ASSERT_DECL(offsetof(struct tnl_port_in, cr) == 0); + + return CONTAINER_OF(cr, struct tnl_port_in, cr); +} + +static void +tnl_port_free(struct tnl_port_in *p) +{ + cls_rule_destroy(&p->cr); + free(p); +} + +static void +tnl_port_init_flow(struct flow *flow, ovs_be32 ip_dst, ovs_be16 udp_port) +{ + memset(flow, 0, sizeof *flow); + flow->dl_type = htons(ETH_TYPE_IP); + if (udp_port) { + flow->nw_proto = IPPROTO_UDP; + } else { + flow->nw_proto = IPPROTO_GRE; + } + flow->tp_dst = udp_port; + /* When matching on incoming flow from remove tnl end point, + * our dst ip address is source ip for them. */ + flow->nw_src = ip_dst; +} + +void +tnl_port_map_insert(odp_port_t port, ovs_be32 ip_dst, ovs_be16 udp_port, + const char dev_name[]) +{ + const struct cls_rule *cr; + struct tnl_port_in *p; + struct match match; + + memset(&match, 0, sizeof match); + tnl_port_init_flow(&match.flow, ip_dst, udp_port); + + ovs_mutex_lock(&mutex); + do { + cr = classifier_lookup(&cls, CLS_MAX_VERSION, &match.flow, NULL); + p = tnl_port_cast(cr); + /* Try again if the rule was released before we get the reference. */ + } while (p && !ovs_refcount_try_ref_rcu(&p->ref_cnt)); + + if (!p) { + p = xzalloc(sizeof *p); + p->portno = port; + + match.wc.masks.dl_type = OVS_BE16_MAX; + match.wc.masks.nw_proto = 0xff; + match.wc.masks.nw_frag = 0xff; /* XXX: No fragments support. */ + match.wc.masks.tp_dst = OVS_BE16_MAX; + match.wc.masks.nw_src = OVS_BE32_MAX; + + cls_rule_init(&p->cr, &match, 0, CLS_MIN_VERSION); /* Priority == 0. */ + ovs_refcount_init(&p->ref_cnt); + ovs_strlcpy(p->dev_name, dev_name, sizeof p->dev_name); + + classifier_insert(&cls, &p->cr, NULL, 0); + } + ovs_mutex_unlock(&mutex); +} + +static void +tnl_port_unref(const struct cls_rule *cr) +{ + struct tnl_port_in *p = tnl_port_cast(cr); + + if (cr && ovs_refcount_unref_relaxed(&p->ref_cnt) == 1) { + ovs_mutex_lock(&mutex); + if (classifier_remove(&cls, cr)) { + ovsrcu_postpone(tnl_port_free, p); + } + ovs_mutex_unlock(&mutex); + } +} + +void +tnl_port_map_delete(ovs_be32 ip_dst, ovs_be16 udp_port) +{ + const struct cls_rule *cr; + struct flow flow; + + tnl_port_init_flow(&flow, ip_dst, udp_port); + + cr = classifier_lookup(&cls, CLS_MAX_VERSION, &flow, NULL); + tnl_port_unref(cr); +} + +/* 'flow' is non-const to allow for temporary modifications during the lookup. + * Any changes are restored before returning. */ +odp_port_t +tnl_port_map_lookup(struct flow *flow, struct flow_wildcards *wc) +{ + const struct cls_rule *cr = classifier_lookup(&cls, CLS_MAX_VERSION, flow, + wc); + + return (cr) ? tnl_port_cast(cr)->portno : ODPP_NONE; +} + +static void +tnl_port_show(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + const struct tnl_port_in *p; + + ds_put_format(&ds, "Listening ports:\n"); + CLS_FOR_EACH(p, cr, &cls) { + struct odputil_keybuf keybuf; + struct odputil_keybuf maskbuf; + struct flow flow; + const struct nlattr *key, *mask; + size_t key_len, mask_len; + struct flow_wildcards wc; + struct ofpbuf buf; + + ds_put_format(&ds, "%s (%"PRIu32") : ", p->dev_name, p->portno); + minimask_expand(&p->cr.match.mask, &wc); + miniflow_expand(&p->cr.match.flow, &flow); + + /* Key. */ + ofpbuf_use_stack(&buf, &keybuf, sizeof keybuf); + odp_flow_key_from_flow(&buf, &flow, &wc.masks, + flow.in_port.odp_port, true); + key = buf.data; + key_len = buf.size; + /* mask*/ + ofpbuf_use_stack(&buf, &maskbuf, sizeof maskbuf); + odp_flow_key_from_mask(&buf, &wc.masks, &flow, + odp_to_u32(wc.masks.in_port.odp_port), + SIZE_MAX, false); + mask = buf.data; + mask_len = buf.size; + + /* build string. */ + odp_flow_format(key, key_len, mask, mask_len, NULL, &ds, false); + ds_put_format(&ds, "\n"); + } + unixctl_command_reply(conn, ds_cstr(&ds)); + ds_destroy(&ds); +} + +void +tnl_port_map_init(void) +{ + classifier_init(&cls, flow_segment_u64s); + unixctl_command_register("tnl/ports/show", "", 0, 0, tnl_port_show, NULL); +} diff -Nru openvswitch-2.3.1/lib/tnl-ports.h openvswitch-2.4.0~git20150623/lib/tnl-ports.h --- openvswitch-2.3.1/lib/tnl-ports.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/tnl-ports.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TNL_PORT_H +#define TNL_PORT_H 1 + +#include +#include + +#include "flow.h" +#include "packets.h" +#include "util.h" + +odp_port_t tnl_port_map_lookup(struct flow *flow, struct flow_wildcards *wc); + +void tnl_port_map_insert(odp_port_t port, ovs_be32 ip_dst, ovs_be16 udp_port, + const char dev_name[]); + +void tnl_port_map_delete(ovs_be32 ip_dst, ovs_be16 udp_port); + +void tnl_port_map_init(void); + +#endif diff -Nru openvswitch-2.3.1/lib/token-bucket.c openvswitch-2.4.0~git20150623/lib/token-bucket.c --- openvswitch-2.3.1/lib/token-bucket.c 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/token-bucket.c 2015-06-23 18:46:21.000000000 +0000 @@ -16,7 +16,7 @@ #include -#include "token-bucket.h" +#include "openvswitch/token-bucket.h" #include "poll-loop.h" #include "sat-math.h" diff -Nru openvswitch-2.3.1/lib/token-bucket.h openvswitch-2.4.0~git20150623/lib/token-bucket.h --- openvswitch-2.3.1/lib/token-bucket.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/token-bucket.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2012 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TOKEN_BUCKET_H -#define TOKEN_BUCKET_H 1 - -#include -#include - -struct token_bucket { - /* Configuration settings. */ - unsigned int rate; /* Tokens added per millisecond. */ - unsigned int burst; /* Max cumulative tokens credit. */ - - /* Current status. */ - unsigned int tokens; /* Current number of tokens. */ - long long int last_fill; /* Last time tokens added. */ -}; - -#define TOKEN_BUCKET_INIT(RATE, BURST) { RATE, BURST, 0, LLONG_MIN } - -void token_bucket_init(struct token_bucket *, - unsigned int rate, unsigned int burst); -void token_bucket_set(struct token_bucket *, - unsigned int rate, unsigned int burst); -bool token_bucket_withdraw(struct token_bucket *, unsigned int n); -void token_bucket_wait(struct token_bucket *, unsigned int n); - -#endif /* token-bucket.h */ diff -Nru openvswitch-2.3.1/lib/unaligned.h openvswitch-2.4.0~git20150623/lib/unaligned.h --- openvswitch-2.3.1/lib/unaligned.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/unaligned.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011 Nicira, Inc. + * Copyright (c) 2010, 2011, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,27 @@ static inline void put_unaligned_be32(ovs_be32 *, ovs_be32); static inline void put_unaligned_be64(ovs_be64 *, ovs_be64); +/* uint64_t get_unaligned_u64(uint64_t *p); + * + * Returns the value of the possibly misaligned uint64_t at 'p'. 'p' may + * actually be any type that points to a 64-bit integer. That is, on Unix-like + * 32-bit ABIs, it may point to an "unsigned long long int", and on Unix-like + * 64-bit ABIs, it may point to an "unsigned long int" or an "unsigned long + * long int". + * + * This is special-cased because on some Linux targets, the kernel __u64 is + * unsigned long long int and the userspace uint64_t is unsigned long int, so + * that any single function prototype would fail to accept one or the other. + * + * Below, "sizeof (*(P) % 1)" verifies that *P has an integer type, since + * operands to % must be integers. + */ +#define get_unaligned_u64(P) \ + (BUILD_ASSERT(sizeof *(P) == 8), \ + BUILD_ASSERT_GCCONLY(!TYPE_IS_SIGNED(typeof(*(P)))), \ + (void) sizeof (*(P) % 1), \ + get_unaligned_u64__((const uint64_t *) (P))) + #ifdef __GNUC__ /* GCC implementations. */ #define GCC_UNALIGNED_ACCESSORS(TYPE, ABBREV) \ @@ -136,32 +157,23 @@ * accessors. */ #define get_unaligned_be16 get_unaligned_u16 #define get_unaligned_be32 get_unaligned_u32 -#define get_unaligned_be64 get_unaligned_u64 #define put_unaligned_be16 put_unaligned_u16 #define put_unaligned_be32 put_unaligned_u32 #define put_unaligned_be64 put_unaligned_u64 -#endif -/* uint64_t get_unaligned_u64(uint64_t *p); - * - * Returns the value of the possibly misaligned uint64_t at 'p'. 'p' may - * actually be any type that points to a 64-bit integer. That is, on Unix-like - * 32-bit ABIs, it may point to an "unsigned long long int", and on Unix-like - * 64-bit ABIs, it may point to an "unsigned long int" or an "unsigned long - * long int". - * - * This is special-cased because on some Linux targets, the kernel __u64 is - * unsigned long long int and the userspace uint64_t is unsigned long int, so - * that any single function prototype would fail to accept one or the other. - * - * Below, "sizeof (*(P) % 1)" verifies that *P has an integer type, since - * operands to % must be integers. - */ -#define get_unaligned_u64(P) \ - (BUILD_ASSERT(sizeof *(P) == 8), \ - BUILD_ASSERT_GCCONLY(!TYPE_IS_SIGNED(typeof(*(P)))), \ - (void) sizeof (*(P) % 1), \ - get_unaligned_u64__((const uint64_t *) (P))) +/* We do not #define get_unaligned_be64 as for the other be functions above, + * because such a definition would mean that get_unaligned_be64() would have a + * different interface in each branch of the #if: with GCC it would take a + * "ovs_be64 *", with other compilers any pointer-to-64-bit-type (but not void + * *). The latter means code like "get_unaligned_be64(ofpbuf_data(b))" would + * work with GCC but not with other compilers, which is surprising and + * undesirable. Hence this wrapper function. */ +static inline ovs_be64 +get_unaligned_be64(const ovs_be64 *p) +{ + return get_unaligned_u64(p); +} +#endif /* Stores 'x' at possibly misaligned address 'p'. * diff -Nru openvswitch-2.3.1/lib/unicode.h openvswitch-2.4.0~git20150623/lib/unicode.h --- openvswitch-2.3.1/lib/unicode.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/unicode.h 2015-06-23 18:46:21.000000000 +0000 @@ -53,6 +53,6 @@ int utf16_decode_surrogate_pair(int leading, int trailing); size_t utf8_length(const char *); -char *utf8_validate(const char *, size_t *lengthp) WARN_UNUSED_RESULT; +char *utf8_validate(const char *, size_t *lengthp) OVS_WARN_UNUSED_RESULT; #endif /* unicode.h */ diff -Nru openvswitch-2.3.1/lib/unixctl.c openvswitch-2.4.0~git20150623/lib/unixctl.c --- openvswitch-2.3.1/lib/unixctl.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/unixctl.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ #include "stream.h" #include "stream-provider.h" #include "svec.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(unixctl); @@ -44,7 +44,7 @@ }; struct unixctl_conn { - struct list node; + struct ovs_list node; struct jsonrpc *rpc; /* Only one request can be in progress at a time. While the request is @@ -55,7 +55,7 @@ /* Server for control connection. */ struct unixctl_server { struct pstream *listener; - struct list conns; + struct ovs_list conns; }; static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5); @@ -63,8 +63,8 @@ static struct shash commands = SHASH_INITIALIZER(&commands); static void -unixctl_help(struct unixctl_conn *conn, int argc OVS_UNUSED, - const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +unixctl_list_commands(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) { struct ds ds = DS_EMPTY_INITIALIZER; const struct shash_node **nodes = shash_sort(&commands); @@ -88,12 +88,12 @@ unixctl_version(struct unixctl_conn *conn, int argc OVS_UNUSED, const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) { - unixctl_command_reply(conn, get_program_version()); + unixctl_command_reply(conn, ovs_get_program_version()); } /* Registers a unixctl command with the given 'name'. 'usage' describes the * arguments to the command; it is used only for presentation to the user in - * "help" output. + * "list-commands" output. * * 'cb' is called when the command is received. It is passed an array * containing the command name and arguments, plus a copy of 'aux'. Normally @@ -224,7 +224,7 @@ #ifndef _WIN32 abs_path = abs_file_name(ovs_rundir(), path); #else - abs_path = strdup(path); + abs_path = xstrdup(path); #endif punix_path = xasprintf("punix:%s", abs_path); free(abs_path); @@ -243,7 +243,8 @@ goto exit; } - unixctl_command_register("help", "", 0, 0, unixctl_help, NULL); + unixctl_command_register("list-commands", "", 0, 0, unixctl_list_commands, + NULL); unixctl_command_register("version", "", 0, 0, unixctl_version, NULL); server = xmalloc(sizeof *server); @@ -438,7 +439,7 @@ int error; #ifdef _WIN32 - abs_path = strdup(path); + abs_path = xstrdup(path); #else abs_path = abs_file_name(ovs_rundir(), path); #endif diff -Nru openvswitch-2.3.1/lib/util.c openvswitch-2.4.0~git20150623/lib/util.c --- openvswitch-2.3.1/lib/util.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/util.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,8 @@ #include "coverage.h" #include "ovs-rcu.h" #include "ovs-thread.h" -#include "vlog.h" +#include "socket-util.h" +#include "openvswitch/vlog.h" #ifdef HAVE_PTHREAD_SET_NAME_NP #include #endif @@ -447,18 +448,19 @@ * * The 'date' and 'time' arguments should likely be called with * "__DATE__" and "__TIME__" to use the time the binary was built. - * Alternatively, the "set_program_name" macro may be called to do this + * Alternatively, the "ovs_set_program_name" macro may be called to do this * automatically. */ void -set_program_name__(const char *argv0, const char *version, const char *date, - const char *time) +ovs_set_program_name__(const char *argv0, const char *version, const char *date, + const char *time) { char *basename; #ifdef _WIN32 size_t max_len = strlen(argv0) + 1; SetErrorMode(GetErrorMode() | SEM_NOGPFAULTERRORBOX); + _set_output_format(_TWO_DIGIT_EXPONENT); basename = xmalloc(max_len); _splitpath_s(argv0, NULL, 0, NULL, 0, basename, max_len, NULL, 0); @@ -469,9 +471,15 @@ assert_single_threaded(); free(program_name); + /* Remove libtool prefix, if it is there */ + if (strncmp(basename, "lt-", 3) == 0) { + char *tmp_name = basename; + basename = xstrdup(basename + 3); + free(tmp_name); + } program_name = basename; - free(program_version); + free(program_version); if (!strcmp(version, VERSION)) { program_version = xasprintf("%s (Open vSwitch) "VERSION"\n" "Compiled %s %s\n", @@ -492,24 +500,13 @@ return name ? name : ""; } -/* Sets the formatted value of 'format' as the name of the currently running - * thread or process. (This appears in log messages and may also be visible in - * system process listings and debuggers.) */ +/* Sets 'subprogram_name' as the name of the currently running thread or + * process. (This appears in log messages and may also be visible in system + * process listings and debuggers.) */ void -set_subprogram_name(const char *format, ...) +set_subprogram_name(const char *subprogram_name) { - char *pname; - - if (format) { - va_list args; - - va_start(args, format); - pname = xvasprintf(format, args); - va_end(args); - } else { - pname = xstrdup(program_name); - } - + char *pname = xstrdup(subprogram_name ? subprogram_name : program_name); free(subprogram_name_set(pname)); #if HAVE_GLIBC_PTHREAD_SETNAME_NP @@ -525,11 +522,20 @@ * caller must not modify or free the returned string. */ const char * -get_program_version(void) +ovs_get_program_version(void) { return program_version; } +/* Returns a pointer to a string describing the program name. The + * caller must not modify or free the returned string. + */ +const char * +ovs_get_program_name(void) +{ + return program_name; +} + /* Print the version information for the program. */ void ovs_print_version(uint8_t min_ofp, uint8_t max_ofp) @@ -634,11 +640,11 @@ long long ll; bool ok = str_to_llong(s, base, &ll); if (!ok || ll < 0 || ll > UINT_MAX) { - *u = 0; - return false; + *u = 0; + return false; } else { - *u = ll; - return true; + *u = ll; + return true; } } @@ -699,32 +705,109 @@ } /* Returns the integer value of the 'n' hexadecimal digits starting at 's', or - * UINT_MAX if one of those "digits" is not really a hex digit. If 'ok' is - * nonnull, '*ok' is set to true if the conversion succeeds or to false if a - * non-hex digit is detected. */ -unsigned int + * UINTMAX_MAX if one of those "digits" is not really a hex digit. Sets '*ok' + * to true if the conversion succeeds or to false if a non-hex digit is + * detected. */ +uintmax_t hexits_value(const char *s, size_t n, bool *ok) { - unsigned int value; + uintmax_t value; size_t i; value = 0; for (i = 0; i < n; i++) { int hexit = hexit_value(s[i]); if (hexit < 0) { - if (ok) { - *ok = false; - } - return UINT_MAX; + *ok = false; + return UINTMAX_MAX; } value = (value << 4) + hexit; } - if (ok) { - *ok = true; - } + *ok = true; return value; } +/* Parses the string in 's' as an integer in either hex or decimal format and + * puts the result right justified in the array 'valuep' that is 'field_width' + * big. If the string is in hex format, the value may be arbitrarily large; + * integers are limited to 64-bit values. (The rationale is that decimal is + * likely to represent a number and 64 bits is a reasonable maximum whereas + * hex could either be a number or a byte string.) + * + * On return 'tail' points to the first character in the string that was + * not parsed as part of the value. ERANGE is returned if the value is too + * large to fit in the given field. */ +int +parse_int_string(const char *s, uint8_t *valuep, int field_width, char **tail) +{ + unsigned long long int integer; + int i; + + if (!strncmp(s, "0x", 2) || !strncmp(s, "0X", 2)) { + uint8_t *hexit_str; + int len = 0; + int val_idx; + int err = 0; + + s += 2; + hexit_str = xmalloc(field_width * 2); + + for (;;) { + uint8_t hexit; + bool ok; + + s += strspn(s, " \t\r\n"); + hexit = hexits_value(s, 1, &ok); + if (!ok) { + *tail = CONST_CAST(char *, s); + break; + } + + if (hexit != 0 || len) { + if (DIV_ROUND_UP(len + 1, 2) > field_width) { + err = ERANGE; + goto free; + } + + hexit_str[len] = hexit; + len++; + } + s++; + } + + val_idx = field_width; + for (i = len - 1; i >= 0; i -= 2) { + val_idx--; + valuep[val_idx] = hexit_str[i]; + if (i > 0) { + valuep[val_idx] += hexit_str[i - 1] << 4; + } + } + + memset(valuep, 0, val_idx); + +free: + free(hexit_str); + return err; + } + + errno = 0; + integer = strtoull(s, tail, 0); + if (errno) { + return errno; + } + + for (i = field_width - 1; i >= 0; i--) { + valuep[i] = integer; + integer >>= 8; + } + if (integer) { + return ERANGE; + } + + return 0; +} + /* Returns the current working directory as a malloc()'d string, or a null * pointer if the current working directory cannot be determined. */ char * @@ -768,6 +851,7 @@ : "."); } +#ifndef _WIN32 /* Returns the directory name portion of 'file_name' as a malloc()'d string, * similar to the POSIX dirname() function but thread-safe. */ char * @@ -809,6 +893,7 @@ return xmemdup0(file_name + start, end - start); } +#endif /* _WIN32 */ /* If 'file_name' starts with '/', returns a copy of 'file_name'. Otherwise, * returns an absolute path to 'file_name' considering it relative to 'dir', @@ -945,7 +1030,7 @@ } /* Returns the number of trailing 0-bits in 'n'. Undefined if 'n' == 0. */ -#if __GNUC__ >= 4 +#if __GNUC__ >= 4 || _MSC_VER /* Defined inline in util.h. */ #else /* Returns the number of trailing 0-bits in 'n'. Undefined if 'n' == 0. */ @@ -1021,8 +1106,9 @@ /* Returns true if the 'n' bytes starting at 'p' are zeros. */ bool -is_all_zeros(const uint8_t *p, size_t n) +is_all_zeros(const void *p_, size_t n) { + const uint8_t *p = p_; size_t i; for (i = 0; i < n; i++) { @@ -1035,8 +1121,9 @@ /* Returns true if the 'n' bytes starting at 'p' are 0xff. */ bool -is_all_ones(const uint8_t *p, size_t n) +is_all_ones(const void *p_, size_t n) { + const uint8_t *p = p_; size_t i; for (i = 0; i < n; i++) { @@ -1267,6 +1354,35 @@ return true; } +/* Scans the bits in 'p' that have bit offsets 'start' through 'end' + * (inclusive) for the first bit with value 'target'. If one is found, returns + * its offset, otherwise 'end'. 'p' is 'len' bytes long. + * + * If you consider all of 'p' to be a single unsigned integer in network byte + * order, then bit N is the bit with value 2**N. That is, bit 0 is the bit + * with value 1 in p[len - 1], bit 1 is the bit with value 2, bit 2 is the bit + * with value 4, ..., bit 8 is the bit with value 1 in p[len - 2], and so on. + * + * Required invariant: + * start <= end + */ +unsigned int +bitwise_scan(const void *p_, unsigned int len, bool target, unsigned int start, + unsigned int end) +{ + const uint8_t *p = p_; + unsigned int ofs; + + for (ofs = start; ofs < end; ofs++) { + bool bit = (p[len - (ofs / 8 + 1)] & (1u << (ofs % 8))) != 0; + if (bit == target) { + break; + } + } + return ofs; +} + + /* Copies the 'n_bits' low-order bits of 'value' into the 'n_bits' bits * starting at bit 'dst_ofs' in 'dst', which is 'dst_len' bytes long. * @@ -1576,34 +1692,13 @@ return s + n; } -/* This is an implementation of the standard sscanf() function, with the - * following exceptions: - * - * - It returns true if the entire format was successfully scanned and - * converted, false if any conversion failed. - * - * - The standard doesn't define sscanf() behavior when an out-of-range value - * is scanned, e.g. if a "%"PRIi8 conversion scans "-1" or "0x1ff". Some - * implementations consider this an error and stop scanning. This - * implementation never considers an out-of-range value an error; instead, - * it stores the least-significant bits of the converted value in the - * destination, e.g. the value 255 for both examples earlier. - * - * - Only single-byte characters are supported, that is, the 'l' modifier - * on %s, %[, and %c is not supported. The GNU extension 'a' modifier is - * also not supported. - * - * - %p is not supported. - */ -bool -ovs_scan(const char *s, const char *format, ...) +static bool +ovs_scan__(const char *s, int *n, const char *format, va_list *args) { const char *const start = s; bool ok = false; const char *p; - va_list args; - va_start(args, format); p = format; while (*p != '\0') { struct scan_spec spec; @@ -1698,24 +1793,24 @@ } switch (c) { case 'd': - s = scan_int(s, &spec, 10, &args); + s = scan_int(s, &spec, 10, args); break; case 'i': - s = scan_int(s, &spec, 0, &args); + s = scan_int(s, &spec, 0, args); break; case 'o': - s = scan_int(s, &spec, 8, &args); + s = scan_int(s, &spec, 8, args); break; case 'u': - s = scan_int(s, &spec, 10, &args); + s = scan_int(s, &spec, 10, args); break; case 'x': case 'X': - s = scan_int(s, &spec, 16, &args); + s = scan_int(s, &spec, 16, args); break; case 'e': @@ -1723,24 +1818,24 @@ case 'g': case 'E': case 'G': - s = scan_float(s, &spec, &args); + s = scan_float(s, &spec, args); break; case 's': - s = scan_string(s, &spec, &args); + s = scan_string(s, &spec, args); break; case '[': - s = scan_set(s, &spec, &p, &args); + s = scan_set(s, &spec, &p, args); break; case 'c': - s = scan_chars(s, &spec, &args); + s = scan_chars(s, &spec, args); break; case 'n': if (spec.type != SCAN_DISCARD) { - *va_arg(args, int *) = s - start; + *va_arg(*args, int *) = s - start; } break; } @@ -1749,13 +1844,66 @@ goto exit; } } - ok = true; + if (n) { + *n = s - start; + } + ok = true; exit: - va_end(args); return ok; } +/* This is an implementation of the standard sscanf() function, with the + * following exceptions: + * + * - It returns true if the entire format was successfully scanned and + * converted, false if any conversion failed. + * + * - The standard doesn't define sscanf() behavior when an out-of-range value + * is scanned, e.g. if a "%"PRIi8 conversion scans "-1" or "0x1ff". Some + * implementations consider this an error and stop scanning. This + * implementation never considers an out-of-range value an error; instead, + * it stores the least-significant bits of the converted value in the + * destination, e.g. the value 255 for both examples earlier. + * + * - Only single-byte characters are supported, that is, the 'l' modifier + * on %s, %[, and %c is not supported. The GNU extension 'a' modifier is + * also not supported. + * + * - %p is not supported. + */ +bool +ovs_scan(const char *s, const char *format, ...) +{ + va_list args; + bool res; + + va_start(args, format); + res = ovs_scan__(s, NULL, format, &args); + va_end(args); + return res; +} + +/* + * This function is similar to ovs_scan(), with an extra parameter `n` added to + * return the number of scanned characters. + */ +bool +ovs_scan_len(const char *s, int *n, const char *format, ...) +{ + va_list args; + bool success; + int n1; + + va_start(args, format); + success = ovs_scan__(s + *n, &n1, format, &args); + va_end(args); + if (success) { + *n = *n + n1; + } + return success; +} + void xsleep(unsigned int seconds) { @@ -1800,4 +1948,14 @@ } return 0; } + +OVS_CONSTRUCTOR(winsock_start) { + WSADATA wsaData; + int error; + + error = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (error != 0) { + VLOG_FATAL("WSAStartup failed: %s", sock_strerror(sock_errno())); + } +} #endif diff -Nru openvswitch-2.3.1/lib/util.h openvswitch-2.4.0~git20150623/lib/util.h --- openvswitch-2.3.1/lib/util.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/util.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #ifndef UTIL_H #define UTIL_H 1 +#include #include #include #include @@ -26,9 +27,9 @@ #include #include #include -#include "byte-order.h" #include "compiler.h" #include "openvswitch/types.h" +#include "openvswitch/util.h" #ifndef va_copy #ifdef __va_copy @@ -66,16 +67,17 @@ #define BUILD_ASSERT_DECL_GCCONLY(EXPR) ((void) 0) #endif -/* Like the standard assert macro, except: - * - * - Writes the failure message to the log. - * - * - Not affected by NDEBUG. */ +/* Like the standard assert macro, except writes the failure message to the + * log. */ +#ifndef NDEBUG #define ovs_assert(CONDITION) \ if (!OVS_LIKELY(CONDITION)) { \ - ovs_assert_failure(SOURCE_LOCATOR, __func__, #CONDITION); \ + ovs_assert_failure(OVS_SOURCE_LOCATOR, __func__, #CONDITION); \ } -void ovs_assert_failure(const char *, const char *, const char *) NO_RETURN; +#else +#define ovs_assert(CONDITION) ((void) (CONDITION)) +#endif +OVS_NO_RETURN void ovs_assert_failure(const char *, const char *, const char *); /* Casts 'pointer' to 'type' and issues a compiler warning if the cast changes * anything other than an outermost "const" or "volatile" qualifier. @@ -173,14 +175,6 @@ #define OVS_NOT_REACHED() abort() -/* Expands to a string that looks like ":", e.g. "tmp.c:10". - * - * See http://c-faq.com/ansi/stringize.html for an explanation of STRINGIZE and - * STRINGIZE2. */ -#define SOURCE_LOCATOR __FILE__ ":" STRINGIZE(__LINE__) -#define STRINGIZE(ARG) STRINGIZE2(ARG) -#define STRINGIZE2(ARG) #ARG - /* Given a pointer-typed lvalue OBJECT, expands to a pointer type that may be * assigned to OBJECT. */ #ifdef __GNUC__ @@ -205,6 +199,9 @@ ((char *) &(OBJECT)->MEMBER - (char *) (OBJECT)) #endif +/* Yields the size of MEMBER within STRUCT. */ +#define MEMBER_SIZEOF(STRUCT, MEMBER) (sizeof(((STRUCT *) NULL)->MEMBER)) + /* Given POINTER, the address of the given MEMBER in a STRUCT object, returns the STRUCT object. */ #define CONTAINER_OF(POINTER, STRUCT, MEMBER) \ @@ -229,6 +226,13 @@ #define ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER) \ ((OBJECT) = OBJECT_CONTAINING(POINTER, OBJECT, MEMBER), (void) 0) +/* As explained in the comment above OBJECT_OFFSETOF(), non-GNUC compilers + * like MSVC will complain about un-initialized variables if OBJECT + * hasn't already been initialized. To prevent such warnings, INIT_CONTAINER() + * can be used as a wrapper around ASSIGN_CONTAINER. */ +#define INIT_CONTAINER(OBJECT, POINTER, MEMBER) \ + ((OBJECT) = NULL, ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER)) + /* Given ATTR, and TYPE, cast the ATTR to TYPE by first casting ATTR to * (void *). This is to suppress the alignment warning issued by clang. */ #define ALIGNED_CAST(TYPE, ATTR) ((TYPE) (void *) (ATTR)) @@ -250,22 +254,23 @@ #define PRIXSIZE "zX" #endif +#ifndef _WIN32 +typedef uint32_t HANDLE; +#endif + #ifdef __cplusplus extern "C" { #endif -void set_program_name__(const char *name, const char *version, - const char *date, const char *time); #define set_program_name(name) \ - set_program_name__(name, VERSION, __DATE__, __TIME__) + ovs_set_program_name(name, OVS_PACKAGE_VERSION) const char *get_subprogram_name(void); -void set_subprogram_name(const char *format, ...) PRINTF_FORMAT(1, 2); + void set_subprogram_name(const char *); -const char *get_program_version(void); void ovs_print_version(uint8_t min_ofp, uint8_t max_ofp); -void out_of_memory(void) NO_RETURN; +OVS_NO_RETURN void out_of_memory(void); void *xmalloc(size_t) MALLOC_LIKE; void *xcalloc(size_t, size_t) MALLOC_LIKE; void *xzalloc(size_t) MALLOC_LIKE; @@ -273,8 +278,8 @@ void *xmemdup(const void *, size_t) MALLOC_LIKE; char *xmemdup0(const char *, size_t) MALLOC_LIKE; char *xstrdup(const char *) MALLOC_LIKE; -char *xasprintf(const char *format, ...) PRINTF_FORMAT(1, 2) MALLOC_LIKE; -char *xvasprintf(const char *format, va_list) PRINTF_FORMAT(1, 0) MALLOC_LIKE; +char *xasprintf(const char *format, ...) OVS_PRINTF_FORMAT(1, 2) MALLOC_LIKE; +char *xvasprintf(const char *format, va_list) OVS_PRINTF_FORMAT(1, 0) MALLOC_LIKE; void *x2nrealloc(void *p, size_t *n, size_t s); void *xmalloc_cacheline(size_t) MALLOC_LIKE; @@ -284,17 +289,17 @@ void ovs_strlcpy(char *dst, const char *src, size_t size); void ovs_strzcpy(char *dst, const char *src, size_t size); -void ovs_abort(int err_no, const char *format, ...) - PRINTF_FORMAT(2, 3) NO_RETURN; -void ovs_abort_valist(int err_no, const char *format, va_list) - PRINTF_FORMAT(2, 0) NO_RETURN; -void ovs_fatal(int err_no, const char *format, ...) - PRINTF_FORMAT(2, 3) NO_RETURN; -void ovs_fatal_valist(int err_no, const char *format, va_list) - PRINTF_FORMAT(2, 0) NO_RETURN; -void ovs_error(int err_no, const char *format, ...) PRINTF_FORMAT(2, 3); +OVS_NO_RETURN void ovs_abort(int err_no, const char *format, ...) + OVS_PRINTF_FORMAT(2, 3); +OVS_NO_RETURN void ovs_abort_valist(int err_no, const char *format, va_list) + OVS_PRINTF_FORMAT(2, 0); +OVS_NO_RETURN void ovs_fatal(int err_no, const char *format, ...) + OVS_PRINTF_FORMAT(2, 3); +OVS_NO_RETURN void ovs_fatal_valist(int err_no, const char *format, va_list) + OVS_PRINTF_FORMAT(2, 0); +void ovs_error(int err_no, const char *format, ...) OVS_PRINTF_FORMAT(2, 3); void ovs_error_valist(int err_no, const char *format, va_list) - PRINTF_FORMAT(2, 0); + OVS_PRINTF_FORMAT(2, 0); const char *ovs_retval_to_string(int); const char *ovs_strerror(int); void ovs_hex_dump(FILE *, const void *, size_t, uintptr_t offset, bool ascii); @@ -304,18 +309,24 @@ bool str_to_llong(const char *, int base, long long *); bool str_to_uint(const char *, int base, unsigned int *); -bool ovs_scan(const char *s, const char *format, ...) SCANF_FORMAT(2, 3); +bool ovs_scan(const char *s, const char *format, ...) OVS_SCANF_FORMAT(2, 3); +bool ovs_scan_len(const char *s, int *n, const char *format, ...); bool str_to_double(const char *, double *); int hexit_value(int c); -unsigned int hexits_value(const char *s, size_t n, bool *ok); +uintmax_t hexits_value(const char *s, size_t n, bool *ok); + +int parse_int_string(const char *s, uint8_t *valuep, int field_width, + char **tail); const char *english_list_delimiter(size_t index, size_t total); char *get_cwd(void); +#ifndef _WIN32 char *dir_name(const char *file_name); char *base_name(const char *file_name); +#endif char *abs_file_name(const char *dir, const char *file_name); char *follow_symlinks(const char *filename); @@ -342,6 +353,42 @@ { return __builtin_clzll(n); } +#elif _MSC_VER +static inline int +raw_ctz(uint64_t n) +{ +#ifdef _WIN64 + unsigned long r = 0; + _BitScanForward64(&r, n); + return r; +#else + unsigned long low = n, high, r = 0; + if (_BitScanForward(&r, low)) { + return r; + } + high = n >> 32; + _BitScanForward(&r, high); + return r + 32; +#endif +} + +static inline int +raw_clz64(uint64_t n) +{ +#ifdef _WIN64 + unsigned long r = 0; + _BitScanReverse64(&r, n); + return 63 - r; +#else + unsigned long low, high = n >> 32, r = 0; + if (_BitScanReverse(&r, high)) { + return 31 - r; + } + low = n; + _BitScanReverse(&r, low); + return 63 - r; +#endif +} #else /* Defined in util.c. */ int raw_ctz(uint64_t n); @@ -464,7 +511,7 @@ * * Unlike the other functions for rightmost 1-bits, this function only works * with 32-bit integers. */ -static inline uint32_t +static inline int rightmost_1bit_idx(uint32_t x) { return ctz32(x); @@ -488,8 +535,8 @@ return htonl((uint64_t)UINT32_MAX << (32 - plen)); } -bool is_all_zeros(const uint8_t *, size_t); -bool is_all_ones(const uint8_t *, size_t); +bool is_all_zeros(const void *, size_t); +bool is_all_ones(const void *, size_t); void bitwise_copy(const void *src, unsigned int src_len, unsigned int src_ofs, void *dst, unsigned int dst_len, unsigned int dst_ofs, unsigned int n_bits); @@ -499,12 +546,21 @@ unsigned int n_bits); bool bitwise_is_all_zeros(const void *, unsigned int len, unsigned int ofs, unsigned int n_bits); +unsigned int bitwise_scan(const void *, unsigned int len, + bool target, unsigned int start, unsigned int end); void bitwise_put(uint64_t value, void *dst, unsigned int dst_len, unsigned int dst_ofs, unsigned int n_bits); uint64_t bitwise_get(const void *src, unsigned int src_len, unsigned int src_ofs, unsigned int n_bits); +/* Returns non-zero if the parameters have equal value. */ +static inline int +ovs_u128_equals(const ovs_u128 *a, const ovs_u128 *b) +{ + return (a->u64.hi == b->u64.hi) && (a->u64.lo == b->u64.lo); +} + void xsleep(unsigned int seconds); #ifdef _WIN32 diff -Nru openvswitch-2.3.1/lib/uuid.c openvswitch-2.4.0~git20150623/lib/uuid.c --- openvswitch-2.3.1/lib/uuid.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/uuid.c 2015-06-23 18:46:21.000000000 +0000 @@ -98,6 +98,12 @@ /* AES output is exactly 16 bytes, so we encrypt directly into 'uuid'. */ aes128_encrypt(&key, copy, uuid); + uuid_set_bits_v4(uuid); +} + +void +uuid_set_bits_v4(struct uuid *uuid) +{ /* Set bits to indicate a random UUID. See RFC 4122 section 4.4. */ uuid->parts[2] &= ~0xc0000000; uuid->parts[2] |= 0x80000000; diff -Nru openvswitch-2.3.1/lib/uuid.h openvswitch-2.4.0~git20150623/lib/uuid.h --- openvswitch-2.3.1/lib/uuid.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/uuid.h 2015-06-23 18:46:21.000000000 +0000 @@ -78,5 +78,6 @@ int uuid_compare_3way(const struct uuid *, const struct uuid *); bool uuid_from_string(struct uuid *, const char *); bool uuid_from_string_prefix(struct uuid *, const char *); +void uuid_set_bits_v4(struct uuid *); #endif /* uuid.h */ diff -Nru openvswitch-2.3.1/lib/vconn-active.man openvswitch-2.4.0~git20150623/lib/vconn-active.man --- openvswitch-2.3.1/lib/vconn-active.man 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vconn-active.man 2015-06-23 18:46:21.000000000 +0000 @@ -3,12 +3,10 @@ The specified \fIport\fR on the host at the given \fIip\fR, which must be expressed as an IP address (not a DNS name) in IPv4 or IPv6 address format. Wrap IPv6 addresses in square brackets, -e.g. \fBtcp:[::1]:6633\fR. For \fBssl\fR, the \fB\-\-private\-key\fR, +e.g. \fBtcp:[::1]:6653\fR. For \fBssl\fR, the \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory. .IP -If \fIport\fR is not specified, it currently defaults to 6633. In the -future, the default will change to 6653, which is the IANA-defined -value. +If \fIport\fR is not specified, it defaults to 6653. .TP \fBunix:\fIfile\fR On POSIX, a Unix domain server socket named \fIfile\fR. diff -Nru openvswitch-2.3.1/lib/vconn.c openvswitch-2.4.0~git20150623/lib/vconn.c --- openvswitch-2.3.1/lib/vconn.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vconn.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ #include "poll-loop.h" #include "random.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #include "socket-util.h" VLOG_DEFINE_THIS_MODULE(vconn); @@ -138,10 +138,10 @@ if (active) { printf("Active OpenFlow connection methods:\n"); printf(" tcp:IP[:PORT] " - "PORT (default: %d) at remote IP\n", OFP_OLD_PORT); + "PORT (default: %d) at remote IP\n", OFP_PORT); #ifdef HAVE_OPENSSL printf(" ssl:IP[:PORT] " - "SSL PORT (default: %d) at remote IP\n", OFP_OLD_PORT); + "SSL PORT (default: %d) at remote IP\n", OFP_PORT); #endif printf(" unix:FILE Unix domain socket named FILE\n"); } @@ -150,11 +150,11 @@ printf("Passive OpenFlow connection methods:\n"); printf(" ptcp:[PORT][:IP] " "listen to TCP PORT (default: %d) on IP\n", - OFP_OLD_PORT); + OFP_PORT); #ifdef HAVE_OPENSSL printf(" pssl:[PORT][:IP] " "listen for SSL on PORT (default: %d) on IP\n", - OFP_OLD_PORT); + OFP_PORT); #endif printf(" punix:FILE " "listen on Unix domain socket FILE\n"); @@ -252,7 +252,7 @@ } /* Success. */ - ovs_assert(vconn->state != VCS_CONNECTING || vconn->class->connect); + ovs_assert(vconn->state != VCS_CONNECTING || vconn->vclass->connect); *vconnp = vconn; return 0; @@ -272,8 +272,8 @@ vconn_connect(vconn); } - if (vconn->class->run) { - (vconn->class->run)(vconn); + if (vconn->vclass->run) { + (vconn->vclass->run)(vconn); } } @@ -288,8 +288,8 @@ vconn_connect_wait(vconn); } - if (vconn->class->run_wait) { - (vconn->class->run_wait)(vconn); + if (vconn->vclass->run_wait) { + (vconn->vclass->run_wait)(vconn); } } @@ -331,7 +331,7 @@ { if (vconn != NULL) { char *name = vconn->name; - (vconn->class->close)(vconn); + (vconn->vclass->close)(vconn); free(name); } } @@ -394,7 +394,7 @@ static void vcs_connecting(struct vconn *vconn) { - int retval = (vconn->class->connect)(vconn); + int retval = (vconn->vclass->connect)(vconn); ovs_assert(retval != EINPROGRESS); if (!retval) { vconn->state = VCS_SEND_HELLO; @@ -456,16 +456,16 @@ enum ofptype type; enum ofperr error; - error = ofptype_decode(&type, ofpbuf_data(b)); + error = ofptype_decode(&type, b->data); if (!error && type == OFPTYPE_HELLO) { char *peer_s, *local_s; uint32_t common_versions; - if (!ofputil_decode_hello(ofpbuf_data(b), &vconn->peer_versions)) { + if (!ofputil_decode_hello(b->data, &vconn->peer_versions)) { struct ds msg = DS_EMPTY_INITIALIZER; ds_put_format(&msg, "%s: unknown data in hello:\n", vconn->name); - ds_put_hex_dump(&msg, ofpbuf_data(b), ofpbuf_size(b), 0, true); + ds_put_hex_dump(&msg, b->data, b->size, 0, true); VLOG_WARN_RL(&bad_ofmsg_rl, "%s", ds_cstr(&msg)); ds_destroy(&msg); } @@ -495,7 +495,7 @@ ofpbuf_delete(b); return; } else { - char *s = ofp_to_string(ofpbuf_data(b), ofpbuf_size(b), 1); + char *s = ofp_to_string(b->data, b->size, 1); VLOG_WARN_RL(&bad_ofmsg_rl, "%s: received message while expecting hello: %s", vconn->name, s); @@ -598,11 +598,11 @@ retval = do_recv(vconn, &msg); } if (!retval && !vconn->recv_any_version) { - const struct ofp_header *oh = ofpbuf_data(msg); + const struct ofp_header *oh = msg->data; if (oh->version != vconn->version) { enum ofptype type; - if (ofptype_decode(&type, ofpbuf_data(msg)) + if (ofptype_decode(&type, msg->data) || (type != OFPTYPE_HELLO && type != OFPTYPE_ERROR && type != OFPTYPE_ECHO_REQUEST && @@ -637,11 +637,11 @@ static int do_recv(struct vconn *vconn, struct ofpbuf **msgp) { - int retval = (vconn->class->recv)(vconn, msgp); + int retval = (vconn->vclass->recv)(vconn, msgp); if (!retval) { COVERAGE_INC(vconn_received); if (VLOG_IS_DBG_ENABLED()) { - char *s = ofp_to_string(ofpbuf_data(*msgp), ofpbuf_size(*msgp), 1); + char *s = ofp_to_string((*msgp)->data, (*msgp)->size, 1); VLOG_DBG_RL(&ofmsg_rl, "%s: received: %s", vconn->name, s); free(s); } @@ -674,15 +674,15 @@ { int retval; - ovs_assert(ofpbuf_size(msg) >= sizeof(struct ofp_header)); + ovs_assert(msg->size >= sizeof(struct ofp_header)); ofpmsg_update_length(msg); if (!VLOG_IS_DBG_ENABLED()) { COVERAGE_INC(vconn_sent); - retval = (vconn->class->send)(vconn, msg); + retval = (vconn->vclass->send)(vconn, msg); } else { - char *s = ofp_to_string(ofpbuf_data(msg), ofpbuf_size(msg), 1); - retval = (vconn->class->send)(vconn, msg); + char *s = ofp_to_string(msg->data, msg->size, 1); + retval = (vconn->vclass->send)(vconn, msg); if (retval != EAGAIN) { VLOG_DBG_RL(&ofmsg_rl, "%s: sent (%s): %s", vconn->name, ovs_strerror(retval), s); @@ -744,18 +744,15 @@ return retval; } -/* Waits until a message with a transaction ID matching 'xid' is received on - * 'vconn'. Returns 0 if successful, in which case the reply is stored in - * '*replyp' for the caller to examine and free. Otherwise returns a positive - * errno value, or EOF, and sets '*replyp' to null. - * - * 'request' is always destroyed, regardless of the return value. */ -int -vconn_recv_xid(struct vconn *vconn, ovs_be32 xid, struct ofpbuf **replyp) +static int +vconn_recv_xid__(struct vconn *vconn, ovs_be32 xid, struct ofpbuf **replyp, + void (*error_reporter)(const struct ofp_header *)) { for (;;) { ovs_be32 recv_xid; struct ofpbuf *reply; + const struct ofp_header *oh; + enum ofptype type; int error; error = vconn_recv_block(vconn, &reply); @@ -763,19 +760,54 @@ *replyp = NULL; return error; } - recv_xid = ((struct ofp_header *) ofpbuf_data(reply))->xid; + oh = reply->data; + recv_xid = oh->xid; if (xid == recv_xid) { *replyp = reply; return 0; } - VLOG_DBG_RL(&bad_ofmsg_rl, "%s: received reply with xid %08"PRIx32 - " != expected %08"PRIx32, - vconn->name, ntohl(recv_xid), ntohl(xid)); + error = ofptype_decode(&type, oh); + if (!error && type == OFPTYPE_ERROR && error_reporter) { + error_reporter(oh); + } else { + VLOG_DBG_RL(&bad_ofmsg_rl, "%s: received reply with xid %08"PRIx32 + " != expected %08"PRIx32, + vconn->name, ntohl(recv_xid), ntohl(xid)); + } ofpbuf_delete(reply); } } +/* Waits until a message with a transaction ID matching 'xid' is received on + * 'vconn'. Returns 0 if successful, in which case the reply is stored in + * '*replyp' for the caller to examine and free. Otherwise returns a positive + * errno value, or EOF, and sets '*replyp' to null. + * + * 'request' is always destroyed, regardless of the return value. */ +int +vconn_recv_xid(struct vconn *vconn, ovs_be32 xid, struct ofpbuf **replyp) +{ + return vconn_recv_xid__(vconn, xid, replyp, NULL); +} + +static int +vconn_transact__(struct vconn *vconn, struct ofpbuf *request, + struct ofpbuf **replyp, + void (*error_reporter)(const struct ofp_header *)) +{ + ovs_be32 send_xid = ((struct ofp_header *) request->data)->xid; + int error; + + *replyp = NULL; + error = vconn_send_block(vconn, request); + if (error) { + ofpbuf_delete(request); + } + return error ? error : vconn_recv_xid__(vconn, send_xid, replyp, + error_reporter); +} + /* Sends 'request' to 'vconn' and blocks until it receives a reply with a * matching transaction ID. Returns 0 if successful, in which case the reply * is stored in '*replyp' for the caller to examine and free. Otherwise @@ -790,15 +822,7 @@ vconn_transact(struct vconn *vconn, struct ofpbuf *request, struct ofpbuf **replyp) { - ovs_be32 send_xid = ((struct ofp_header *) ofpbuf_data(request))->xid; - int error; - - *replyp = NULL; - error = vconn_send_block(vconn, request); - if (error) { - ofpbuf_delete(request); - } - return error ? error : vconn_recv_xid(vconn, send_xid, replyp); + return vconn_transact__(vconn, request, replyp, NULL); } /* Sends 'request' followed by a barrier request to 'vconn', then blocks until @@ -824,7 +848,7 @@ *replyp = NULL; /* Send request. */ - request_xid = ((struct ofp_header *) ofpbuf_data(request))->xid; + request_xid = ((struct ofp_header *) request->data)->xid; error = vconn_send_block(vconn, request); if (error) { ofpbuf_delete(request); @@ -833,7 +857,7 @@ /* Send barrier. */ barrier = ofputil_encode_barrier_request(vconn_get_version(vconn)); - barrier_xid = ((struct ofp_header *) ofpbuf_data(barrier))->xid; + barrier_xid = ((struct ofp_header *) barrier->data)->xid; error = vconn_send_block(vconn, barrier); if (error) { ofpbuf_delete(barrier); @@ -852,7 +876,7 @@ return error; } - msg_xid = ((struct ofp_header *) ofpbuf_data(msg))->xid; + msg_xid = ((struct ofp_header *) msg->data)->xid; if (msg_xid == request_xid) { if (*replyp) { VLOG_WARN_RL(&bad_ofmsg_rl, "%s: duplicate replies with " @@ -878,16 +902,14 @@ * All of the requests on 'requests' are always destroyed, regardless of the * return value. */ int -vconn_transact_multiple_noreply(struct vconn *vconn, struct list *requests, +vconn_transact_multiple_noreply(struct vconn *vconn, struct ovs_list *requests, struct ofpbuf **replyp) { - struct ofpbuf *request, *next; + struct ofpbuf *request; - LIST_FOR_EACH_SAFE (request, next, list_node, requests) { + LIST_FOR_EACH_POP (request, list_node, requests) { int error; - list_remove(&request->list_node); - error = vconn_transact_noreply(vconn, request, replyp); if (error || *replyp) { ofpbuf_list_delete(requests); @@ -899,6 +921,179 @@ return 0; } +static enum ofperr +vconn_bundle_reply_validate(struct ofpbuf *reply, + struct ofputil_bundle_ctrl_msg *request, + void (*error_reporter)(const struct ofp_header *)) +{ + const struct ofp_header *oh; + enum ofptype type; + enum ofperr error; + struct ofputil_bundle_ctrl_msg rbc; + + oh = reply->data; + error = ofptype_decode(&type, oh); + if (error) { + return error; + } + + if (type == OFPTYPE_ERROR) { + error_reporter(oh); + return ofperr_decode_msg(oh, NULL); + } + if (type != OFPTYPE_BUNDLE_CONTROL) { + return OFPERR_OFPBRC_BAD_TYPE; + } + + error = ofputil_decode_bundle_ctrl(oh, &rbc); + if (error) { + return error; + } + + if (rbc.bundle_id != request->bundle_id) { + return OFPERR_OFPBFC_BAD_ID; + } + + if (rbc.type != request->type + 1) { + return OFPERR_OFPBFC_BAD_TYPE; + } + + return 0; +} + +/* Send bundle control message 'bc' of 'type' via 'vconn', and wait for either + * an error or the corresponding bundle control message response. + * + * 'error_reporter' is called for any error responses received, which may be + * also regarding earlier OpenFlow messages than this bundle control message. + * + * Returns errno value, or 0 when successful. */ +static int +vconn_bundle_control_transact(struct vconn *vconn, + struct ofputil_bundle_ctrl_msg *bc, + uint16_t type, + void (*error_reporter)(const struct ofp_header *)) +{ + struct ofpbuf *request, *reply; + int error; + enum ofperr ofperr; + + bc->type = type; + request = ofputil_encode_bundle_ctrl_request(vconn->version, bc); + ofpmsg_update_length(request); + error = vconn_transact__(vconn, request, &reply, error_reporter); + if (error) { + return error; + } + + ofperr = vconn_bundle_reply_validate(reply, bc, error_reporter); + if (ofperr) { + VLOG_WARN_RL(&bad_ofmsg_rl, "Bundle %s failed (%s).", + type == OFPBCT_OPEN_REQUEST ? "open" + : type == OFPBCT_CLOSE_REQUEST ? "close" + : type == OFPBCT_COMMIT_REQUEST ? "commit" + : type == OFPBCT_DISCARD_REQUEST ? "discard" + : "control message", + ofperr_to_string(ofperr)); + } + ofpbuf_delete(reply); + + return ofperr ? EPROTO : 0; +} + +/* Checks if error responses can be received on 'vconn'. */ +static void +vconn_recv_error(struct vconn *vconn, + void (*error_reporter)(const struct ofp_header *)) +{ + int error; + + do { + struct ofpbuf *reply; + + error = vconn_recv(vconn, &reply); + if (!error) { + const struct ofp_header *oh; + enum ofptype type; + enum ofperr ofperr; + + oh = reply->data; + ofperr = ofptype_decode(&type, oh); + if (!ofperr && type == OFPTYPE_ERROR) { + error_reporter(oh); + } else { + VLOG_DBG_RL(&bad_ofmsg_rl, + "%s: received unexpected reply with xid %08"PRIx32, + vconn->name, ntohl(oh->xid)); + } + ofpbuf_delete(reply); + } + } while (!error); +} + +static int +vconn_bundle_add_msg(struct vconn *vconn, struct ofputil_bundle_ctrl_msg *bc, + struct ofpbuf *msg, + void (*error_reporter)(const struct ofp_header *)) +{ + struct ofputil_bundle_add_msg bam; + struct ofpbuf *request; + int error; + + bam.bundle_id = bc->bundle_id; + bam.flags = bc->flags; + bam.msg = msg->data; + + request = ofputil_encode_bundle_add(vconn->version, &bam); + ofpmsg_update_length(request); + + error = vconn_send_block(vconn, request); + if (!error) { + /* Check for an error return, so that the socket buffer does not become + * full of errors. */ + vconn_recv_error(vconn, error_reporter); + } + return error; +} + +int +vconn_bundle_transact(struct vconn *vconn, struct ovs_list *requests, + uint16_t flags, + void (*error_reporter)(const struct ofp_header *)) +{ + struct ofputil_bundle_ctrl_msg bc; + struct ofpbuf *request; + int error; + + memset(&bc, 0, sizeof bc); + bc.flags = flags; + error = vconn_bundle_control_transact(vconn, &bc, OFPBCT_OPEN_REQUEST, + error_reporter); + if (error) { + return error; + } + + LIST_FOR_EACH (request, list_node, requests) { + error = vconn_bundle_add_msg(vconn, &bc, request, error_reporter); + if (error) { + break; + } + } + + if (!error) { + error = vconn_bundle_control_transact(vconn, &bc, + OFPBCT_COMMIT_REQUEST, + error_reporter); + } else { + /* Do not overwrite the error code from vconn_bundle_add_msg(). + * Any error in discard should be either reported or logged, so it + * should not get lost. */ + vconn_bundle_control_transact(vconn, &bc, OFPBCT_DISCARD_REQUEST, + error_reporter); + } + return error; +} + void vconn_wait(struct vconn *vconn, enum vconn_wait_type wait) { @@ -925,7 +1120,7 @@ poll_immediate_wake(); return; } - (vconn->class->wait)(vconn, wait); + (vconn->vclass->wait)(vconn, wait); } void @@ -1047,7 +1242,7 @@ { if (pvconn != NULL) { char *name = pvconn->name; - (pvconn->class->close)(pvconn); + (pvconn->pvclass->close)(pvconn); free(name); } } @@ -1065,12 +1260,12 @@ int pvconn_accept(struct pvconn *pvconn, struct vconn **new_vconn) { - int retval = (pvconn->class->accept)(pvconn, new_vconn); + int retval = (pvconn->pvclass->accept)(pvconn, new_vconn); if (retval) { *new_vconn = NULL; } else { ovs_assert((*new_vconn)->state != VCS_CONNECTING - || (*new_vconn)->class->connect); + || (*new_vconn)->vclass->connect); } return retval; } @@ -1078,7 +1273,7 @@ void pvconn_wait(struct pvconn *pvconn) { - (pvconn->class->wait)(pvconn); + (pvconn->pvclass->wait)(pvconn); } /* Initializes 'vconn' as a new vconn named 'name', implemented via 'class'. @@ -1103,7 +1298,7 @@ int connect_status, const char *name, uint32_t allowed_versions) { memset(vconn, 0, sizeof *vconn); - vconn->class = class; + vconn->vclass = class; vconn->state = (connect_status == EAGAIN ? VCS_CONNECTING : !connect_status ? VCS_SEND_HELLO : VCS_DISCONNECTED); @@ -1117,7 +1312,7 @@ pvconn_init(struct pvconn *pvconn, const struct pvconn_class *class, const char *name, uint32_t allowed_versions) { - pvconn->class = class; + pvconn->pvclass = class; pvconn->name = xstrdup(name); pvconn->allowed_versions = allowed_versions; } diff -Nru openvswitch-2.3.1/lib/vconn.h openvswitch-2.4.0~git20150623/lib/vconn.h --- openvswitch-2.3.1/lib/vconn.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vconn.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef VCONN_H -#define VCONN_H 1 - -#include -#include "openvswitch/types.h" -#include "openflow/openflow.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct list; -struct ofpbuf; -struct pvconn; -struct vconn; - -void vconn_usage(bool active, bool passive, bool bootstrap); - -/* Active vconns: virtual connections to OpenFlow devices. */ -int vconn_verify_name(const char *name); -int vconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp, - struct vconn **vconnp); -void vconn_close(struct vconn *); -const char *vconn_get_name(const struct vconn *); - -uint32_t vconn_get_allowed_versions(const struct vconn *vconn); -void vconn_set_allowed_versions(struct vconn *vconn, - uint32_t allowed_versions); -int vconn_get_version(const struct vconn *); -void vconn_set_recv_any_version(struct vconn *); - -int vconn_connect(struct vconn *); -int vconn_recv(struct vconn *, struct ofpbuf **); -int vconn_send(struct vconn *, struct ofpbuf *); -int vconn_recv_xid(struct vconn *, ovs_be32 xid, struct ofpbuf **); -int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **); -int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **); -int vconn_transact_multiple_noreply(struct vconn *, struct list *requests, - struct ofpbuf **replyp); - -void vconn_run(struct vconn *); -void vconn_run_wait(struct vconn *); - -int vconn_get_status(const struct vconn *); - -int vconn_open_block(const char *name, uint32_t allowed_versions, uint8_t dscp, - struct vconn **); -int vconn_connect_block(struct vconn *); -int vconn_send_block(struct vconn *, struct ofpbuf *); -int vconn_recv_block(struct vconn *, struct ofpbuf **); - -enum vconn_wait_type { - WAIT_CONNECT, - WAIT_RECV, - WAIT_SEND -}; -void vconn_wait(struct vconn *, enum vconn_wait_type); -void vconn_connect_wait(struct vconn *); -void vconn_recv_wait(struct vconn *); -void vconn_send_wait(struct vconn *); - -/* Passive vconns: virtual listeners for incoming OpenFlow connections. */ -int pvconn_verify_name(const char *name); -int pvconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp, - struct pvconn **pvconnp); -const char *pvconn_get_name(const struct pvconn *); -void pvconn_close(struct pvconn *); -int pvconn_accept(struct pvconn *, struct vconn **); -void pvconn_wait(struct pvconn *); - -#ifdef __cplusplus -} -#endif - -#endif /* vconn.h */ diff -Nru openvswitch-2.3.1/lib/vconn-passive.man openvswitch-2.4.0~git20150623/lib/vconn-passive.man --- openvswitch-2.3.1/lib/vconn-passive.man 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vconn-passive.man 2015-06-23 18:46:21.000000000 +0000 @@ -1,10 +1,9 @@ .IP "\fBpssl:\fR[\fIport\fR][\fB:\fIip\fR]" .IQ "\fBptcp:\fR[\fIport\fR][\fB:\fIip\fR]" Listens for OpenFlow connections on \fIport\fR. The default -\fIport\fR is 6633, but a future version of Open vSwitch will change -the default to the IANA-defined port 6653. By default, connections +\fIport\fR is 6653. By default, connections are allowed from any IPv4 address. Specify \fIip\fR as an IPv4 -address or a bracketed IPv6 address (e.g. \fBptcp:6633:[::1]\fR). DNS +address or a bracketed IPv6 address (e.g. \fBptcp:6653:[::1]\fR). DNS names may not be used. For \fBpssl\fR, the \fB\-\-private\-key\fR,\fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory. diff -Nru openvswitch-2.3.1/lib/vconn-provider.h openvswitch-2.4.0~git20150623/lib/vconn-provider.h --- openvswitch-2.3.1/lib/vconn-provider.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vconn-provider.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,17 +20,15 @@ /* Provider interface to vconns, which provide a virtual connection to an * OpenFlow device. */ -#include "vconn.h" +#include "openvswitch/vconn.h" #include "util.h" #include "openflow/openflow-common.h" /* Active virtual connection to an OpenFlow device. */ -/* Active virtual connection to an OpenFlow device. - * - * This structure should be treated as opaque by vconn implementations. */ +/* This structure should be treated as opaque by vconn implementations. */ struct vconn { - const struct vconn_class *class; + const struct vconn_class *vclass; int state; int error; @@ -47,9 +45,9 @@ const char *name, uint32_t allowed_versions); void vconn_free_data(struct vconn *vconn); static inline void vconn_assert_class(const struct vconn *vconn, - const struct vconn_class *class) + const struct vconn_class *vclass) { - ovs_assert(vconn->class == class); + ovs_assert(vconn->vclass == vclass); } struct vconn_class { @@ -130,21 +128,20 @@ void (*wait)(struct vconn *vconn, enum vconn_wait_type type); }; -/* Passive virtual connection to an OpenFlow device. - * - * This structure should be treated as opaque by vconn implementations. */ +/* Passive virtual connection to an OpenFlow device. */ + +/* This structure should be treated as opaque by vconn implementations. */ struct pvconn { - const struct pvconn_class *class; + const struct pvconn_class *pvclass; char *name; uint32_t allowed_versions; }; - -void pvconn_init(struct pvconn *pvconn, const struct pvconn_class *class, +void pvconn_init(struct pvconn *pvconn, const struct pvconn_class *pvclass, const char *name, uint32_t allowed_versions); static inline void pvconn_assert_class(const struct pvconn *pvconn, - const struct pvconn_class *class) + const struct pvconn_class *pvclass) { - ovs_assert(pvconn->class == class); + ovs_assert(pvconn->pvclass == pvclass); } struct pvconn_class { diff -Nru openvswitch-2.3.1/lib/vconn-stream.c openvswitch-2.4.0~git20150623/lib/vconn-stream.c --- openvswitch-2.3.1/lib/vconn-stream.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vconn-stream.c 2015-06-23 18:46:21.000000000 +0000 @@ -29,8 +29,8 @@ #include "stream.h" #include "util.h" #include "vconn-provider.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(vconn_stream); @@ -78,7 +78,7 @@ struct stream *stream; int error; - error = stream_open_with_default_port(name, OFP_OLD_PORT, &stream, dscp); + error = stream_open_with_default_port(name, OFP_PORT, &stream, dscp); if (!error) { error = stream_connect(stream); if (!error || error == EAGAIN) { @@ -103,7 +103,7 @@ struct vconn_stream *s = vconn_stream_cast(vconn); if ((vconn->error == EPROTO || s->n_packets < 1) && s->rxbuf) { - stream_report_content(ofpbuf_data(s->rxbuf), ofpbuf_size(s->rxbuf), STREAM_OPENFLOW, + stream_report_content(s->rxbuf->data, s->rxbuf->size, STREAM_OPENFLOW, THIS_MODULE, vconn_get_name(vconn)); } @@ -126,14 +126,14 @@ struct ofpbuf *rx = s->rxbuf; int want_bytes, retval; - want_bytes = rx_len - ofpbuf_size(rx); + want_bytes = rx_len - rx->size; ofpbuf_prealloc_tailroom(rx, want_bytes); retval = stream_recv(s->stream, ofpbuf_tail(rx), want_bytes); if (retval > 0) { - ofpbuf_set_size(rx, ofpbuf_size(rx) + retval); + rx->size += retval; return retval == want_bytes ? 0 : EAGAIN; } else if (retval == 0) { - if (ofpbuf_size(rx)) { + if (rx->size) { VLOG_ERR_RL(&rl, "connection dropped mid-packet"); return EPROTO; } @@ -156,7 +156,7 @@ } /* Read ofp_header. */ - if (ofpbuf_size(s->rxbuf) < sizeof(struct ofp_header)) { + if (s->rxbuf->size < sizeof(struct ofp_header)) { int retval = vconn_stream_recv__(s, sizeof(struct ofp_header)); if (retval) { return retval; @@ -164,12 +164,12 @@ } /* Read payload. */ - oh = ofpbuf_data(s->rxbuf); + oh = s->rxbuf->data; rx_len = ntohs(oh->length); if (rx_len < sizeof(struct ofp_header)) { VLOG_ERR_RL(&rl, "received too-short ofp_header (%d bytes)", rx_len); return EPROTO; - } else if (ofpbuf_size(s->rxbuf) < rx_len) { + } else if (s->rxbuf->size < rx_len) { int retval = vconn_stream_recv__(s, rx_len); if (retval) { return retval; @@ -199,8 +199,8 @@ return EAGAIN; } - retval = stream_send(s->stream, ofpbuf_data(buffer), ofpbuf_size(buffer)); - if (retval == ofpbuf_size(buffer)) { + retval = stream_send(s->stream, buffer->data, buffer->size); + if (retval == buffer->size) { ofpbuf_delete(buffer); return 0; } else if (retval >= 0 || retval == -EAGAIN) { @@ -225,7 +225,7 @@ return; } - retval = stream_send(s->stream, ofpbuf_data(s->txbuf), ofpbuf_size(s->txbuf)); + retval = stream_send(s->stream, s->txbuf->data, s->txbuf->size); if (retval < 0) { if (retval != -EAGAIN) { VLOG_ERR_RL(&rl, "send: %s", ovs_strerror(-retval)); @@ -234,7 +234,7 @@ } } else if (retval > 0) { ofpbuf_pull(s->txbuf, retval); - if (!ofpbuf_size(s->txbuf)) { + if (!s->txbuf->size) { vconn_stream_clear_txbuf(s); return; } @@ -311,8 +311,7 @@ struct pstream *pstream; int error; - error = pstream_open_with_default_port(name, OFP_OLD_PORT, - &pstream, dscp); + error = pstream_open_with_default_port(name, OFP_PORT, &pstream, dscp); if (error) { return error; } diff -Nru openvswitch-2.3.1/lib/vlandev.c openvswitch-2.4.0~git20150623/lib/vlandev.c --- openvswitch-2.3.1/lib/vlandev.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vlandev.c 2015-06-23 18:46:21.000000000 +0000 @@ -27,7 +27,7 @@ #include "hash.h" #include "shash.h" #include "socket-util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(vlandev); diff -Nru openvswitch-2.3.1/lib/vlog.c openvswitch-2.4.0~git20150623/lib/vlog.c --- openvswitch-2.3.1/lib/vlog.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vlog.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,7 +15,7 @@ */ #include -#include "vlog.h" +#include "openvswitch/vlog.h" #include #include #include @@ -75,23 +75,23 @@ BUILD_ASSERT_DECL(LOG_LOCAL0 == (16 << 3)); /* The log modules. */ -struct list vlog_modules = LIST_INITIALIZER(&vlog_modules); +struct ovs_list vlog_modules = OVS_LIST_INITIALIZER(&vlog_modules); -/* Protects the 'pattern' in all "struct facility"s, so that a race between +/* Protects the 'pattern' in all "struct destination"s, so that a race between * changing and reading the pattern does not cause an access to freed * memory. */ static struct ovs_rwlock pattern_rwlock = OVS_RWLOCK_INITIALIZER; -/* Information about each facility. */ -struct facility { +/* Information about each destination. */ +struct destination { const char *name; /* Name. */ char *pattern OVS_GUARDED_BY(pattern_rwlock); /* Current pattern. */ bool default_pattern; /* Whether current pattern is the default. */ }; -static struct facility facilities[VLF_N_FACILITIES] = { -#define VLOG_FACILITY(NAME, PATTERN) {#NAME, PATTERN, true}, - VLOG_FACILITIES -#undef VLOG_FACILITY +static struct destination destinations[VLF_N_DESTINATIONS] = { +#define VLOG_DESTINATION(NAME, PATTERN) {#NAME, PATTERN, true}, + VLOG_DESTINATIONS +#undef VLOG_DESTINATION }; /* Sequence number for the message currently being composed. */ @@ -110,10 +110,45 @@ /* Syslog export configuration. */ static int syslog_fd OVS_GUARDED_BY(pattern_rwlock) = -1; +/* Log facility configuration. */ +static atomic_int log_facility = ATOMIC_VAR_INIT(0); + +/* Facility name and its value. */ +struct vlog_facility { + char *name; /* Name. */ + unsigned int value; /* Facility associated with 'name'. */ +}; +static struct vlog_facility vlog_facilities[] = { + {"kern", LOG_KERN}, + {"user", LOG_USER}, + {"mail", LOG_MAIL}, + {"daemon", LOG_DAEMON}, + {"auth", LOG_AUTH}, + {"syslog", LOG_SYSLOG}, + {"lpr", LOG_LPR}, + {"news", LOG_NEWS}, + {"uucp", LOG_UUCP}, + {"clock", LOG_CRON}, + {"ftp", LOG_FTP}, + {"ntp", 12<<3}, + {"audit", 13<<3}, + {"alert", 14<<3}, + {"clock2", 15<<3}, + {"local0", LOG_LOCAL0}, + {"local1", LOG_LOCAL1}, + {"local2", LOG_LOCAL2}, + {"local3", LOG_LOCAL3}, + {"local4", LOG_LOCAL4}, + {"local5", LOG_LOCAL5}, + {"local6", LOG_LOCAL6}, + {"local7", LOG_LOCAL7} +}; +static bool vlog_facility_exists(const char* facility, int *value); + static void format_log_message(const struct vlog_module *, enum vlog_level, const char *pattern, const char *message, va_list, struct ds *) - PRINTF_FORMAT(4, 0); + OVS_PRINTF_FORMAT(4, 0); /* Searches the 'n_names' in 'names'. Returns the index of a match for * 'target', or 'n_names' if no name matches. */ @@ -147,29 +182,34 @@ return search_name_array(name, level_names, ARRAY_SIZE(level_names)); } -/* Returns the name for logging facility 'facility'. */ +/* Returns the name for logging destination 'destination'. */ const char * -vlog_get_facility_name(enum vlog_facility facility) +vlog_get_destination_name(enum vlog_destination destination) { - assert(facility < VLF_N_FACILITIES); - return facilities[facility].name; + assert(destination < VLF_N_DESTINATIONS); + return destinations[destination].name; } -/* Returns the logging facility named 'name', or VLF_N_FACILITIES if 'name' is - * not the name of a logging facility. */ -enum vlog_facility -vlog_get_facility_val(const char *name) +/* Returns the logging destination named 'name', or VLF_N_DESTINATIONS if + * 'name' is not the name of a logging destination. */ +enum vlog_destination +vlog_get_destination_val(const char *name) { size_t i; - for (i = 0; i < VLF_N_FACILITIES; i++) { - if (!strcasecmp(facilities[i].name, name)) { + for (i = 0; i < VLF_N_DESTINATIONS; i++) { + if (!strcasecmp(destinations[i].name, name)) { break; } } return i; } +void vlog_insert_module(struct ovs_list *vlog) +{ + list_insert(&vlog_modules, vlog); +} + /* Returns the name for logging module 'module'. */ const char * vlog_get_module_name(const struct vlog_module *module) @@ -193,23 +233,25 @@ return NULL; } -/* Returns the current logging level for the given 'module' and 'facility'. */ +/* Returns the current logging level for the given 'module' and + * 'destination'. */ enum vlog_level -vlog_get_level(const struct vlog_module *module, enum vlog_facility facility) +vlog_get_level(const struct vlog_module *module, + enum vlog_destination destination) { - assert(facility < VLF_N_FACILITIES); - return module->levels[facility]; + assert(destination < VLF_N_DESTINATIONS); + return module->levels[destination]; } static void update_min_level(struct vlog_module *module) OVS_REQUIRES(&log_file_mutex) { - enum vlog_facility facility; + enum vlog_destination destination; module->min_level = VLL_OFF; - for (facility = 0; facility < VLF_N_FACILITIES; facility++) { - if (log_fd >= 0 || facility != VLF_FILE) { - enum vlog_level level = module->levels[facility]; + for (destination = 0; destination < VLF_N_DESTINATIONS; destination++) { + if (log_fd >= 0 || destination != VLF_FILE) { + enum vlog_level level = module->levels[destination]; if (level > module->min_level) { module->min_level = level; } @@ -218,47 +260,49 @@ } static void -set_facility_level(enum vlog_facility facility, struct vlog_module *module, - enum vlog_level level) +set_destination_level(enum vlog_destination destination, + struct vlog_module *module, enum vlog_level level) { - assert(facility >= 0 && facility < VLF_N_FACILITIES); + assert(destination >= 0 && destination < VLF_N_DESTINATIONS); assert(level < VLL_N_LEVELS); ovs_mutex_lock(&log_file_mutex); if (!module) { struct vlog_module *mp; LIST_FOR_EACH (mp, list, &vlog_modules) { - mp->levels[facility] = level; + mp->levels[destination] = level; update_min_level(mp); } } else { - module->levels[facility] = level; + module->levels[destination] = level; update_min_level(module); } ovs_mutex_unlock(&log_file_mutex); } -/* Sets the logging level for the given 'module' and 'facility' to 'level'. A - * null 'module' or a 'facility' of VLF_ANY_FACILITY is treated as a wildcard - * across all modules or facilities, respectively. */ +/* Sets the logging level for the given 'module' and 'destination' to 'level'. + * A null 'module' or a 'destination' of VLF_ANY_DESTINATION is treated as a + * wildcard across all modules or destinations, respectively. */ void -vlog_set_levels(struct vlog_module *module, enum vlog_facility facility, +vlog_set_levels(struct vlog_module *module, enum vlog_destination destination, enum vlog_level level) { - assert(facility < VLF_N_FACILITIES || facility == VLF_ANY_FACILITY); - if (facility == VLF_ANY_FACILITY) { - for (facility = 0; facility < VLF_N_FACILITIES; facility++) { - set_facility_level(facility, module, level); + assert(destination < VLF_N_DESTINATIONS || + destination == VLF_ANY_DESTINATION); + if (destination == VLF_ANY_DESTINATION) { + for (destination = 0; destination < VLF_N_DESTINATIONS; + destination++) { + set_destination_level(destination, module, level); } } else { - set_facility_level(facility, module, level); + set_destination_level(destination, module, level); } } static void -do_set_pattern(enum vlog_facility facility, const char *pattern) +do_set_pattern(enum vlog_destination destination, const char *pattern) { - struct facility *f = &facilities[facility]; + struct destination *f = &destinations[destination]; ovs_rwlock_wrlock(&pattern_rwlock); if (!f->default_pattern) { @@ -270,17 +314,19 @@ ovs_rwlock_unlock(&pattern_rwlock); } -/* Sets the pattern for the given 'facility' to 'pattern'. */ +/* Sets the pattern for the given 'destination' to 'pattern'. */ void -vlog_set_pattern(enum vlog_facility facility, const char *pattern) +vlog_set_pattern(enum vlog_destination destination, const char *pattern) { - assert(facility < VLF_N_FACILITIES || facility == VLF_ANY_FACILITY); - if (facility == VLF_ANY_FACILITY) { - for (facility = 0; facility < VLF_N_FACILITIES; facility++) { - do_set_pattern(facility, pattern); + assert(destination < VLF_N_DESTINATIONS || + destination == VLF_ANY_DESTINATION); + if (destination == VLF_ANY_DESTINATION) { + for (destination = 0; destination < VLF_N_DESTINATIONS; + destination++) { + do_set_pattern(destination, pattern); } } else { - do_set_pattern(facility, pattern); + do_set_pattern(destination, pattern); } } @@ -392,36 +438,44 @@ word = strtok_r(s, " ,:\t", &save_ptr); if (word && !strcasecmp(word, "PATTERN")) { - enum vlog_facility facility; + enum vlog_destination destination; word = strtok_r(NULL, " ,:\t", &save_ptr); if (!word) { - msg = xstrdup("missing facility"); + msg = xstrdup("missing destination"); goto exit; } - facility = (!strcasecmp(word, "ANY") - ? VLF_ANY_FACILITY - : vlog_get_facility_val(word)); - if (facility == VLF_N_FACILITIES) { - msg = xasprintf("unknown facility \"%s\"", word); + destination = (!strcasecmp(word, "ANY") + ? VLF_ANY_DESTINATION + : vlog_get_destination_val(word)); + if (destination == VLF_N_DESTINATIONS) { + msg = xasprintf("unknown destination \"%s\"", word); goto exit; } - vlog_set_pattern(facility, save_ptr); + vlog_set_pattern(destination, save_ptr); + } else if (word && !strcasecmp(word, "FACILITY")) { + int value; + + if (!vlog_facility_exists(save_ptr, &value)) { + msg = xstrdup("invalid facility"); + goto exit; + } + atomic_store_explicit(&log_facility, value, memory_order_relaxed); } else { struct vlog_module *module = NULL; enum vlog_level level = VLL_N_LEVELS; - enum vlog_facility facility = VLF_N_FACILITIES; + enum vlog_destination destination = VLF_N_DESTINATIONS; for (; word != NULL; word = strtok_r(NULL, " ,:\t", &save_ptr)) { if (!strcasecmp(word, "ANY")) { continue; - } else if (vlog_get_facility_val(word) != VLF_N_FACILITIES) { - if (facility != VLF_N_FACILITIES) { - msg = xstrdup("cannot specify multiple facilities"); + } else if (vlog_get_destination_val(word) != VLF_N_DESTINATIONS) { + if (destination != VLF_N_DESTINATIONS) { + msg = xstrdup("cannot specify multiple destinations"); goto exit; } - facility = vlog_get_facility_val(word); + destination = vlog_get_destination_val(word); } else if (vlog_get_level_val(word) != VLL_N_LEVELS) { if (level != VLL_N_LEVELS) { msg = xstrdup("cannot specify multiple levels"); @@ -435,18 +489,19 @@ } module = vlog_module_from_name(word); } else { - msg = xasprintf("no facility, level, or module \"%s\"", word); + msg = xasprintf("no destination, level, or module \"%s\"", + word); goto exit; } } - if (facility == VLF_N_FACILITIES) { - facility = VLF_ANY_FACILITY; + if (destination == VLF_N_DESTINATIONS) { + destination = VLF_ANY_DESTINATION; } if (level == VLL_N_LEVELS) { level = VLL_DBG; } - vlog_set_levels(module, facility, level); + vlog_set_levels(module, destination, level); } exit: @@ -475,7 +530,7 @@ ovs_fatal(0, "processing \"%s\": %s", arg, msg); } } else { - vlog_set_levels(NULL, VLF_ANY_FACILITY, VLL_DBG); + vlog_set_levels(NULL, VLF_ANY_DESTINATION, VLL_DBG); } } @@ -495,6 +550,22 @@ ovs_rwlock_unlock(&pattern_rwlock); } +/* Returns 'false' if 'facility' is not a valid string. If 'facility' + * is a valid string, sets 'value' with the integer value of 'facility' + * and returns 'true'. */ +static bool +vlog_facility_exists(const char* facility, int *value) +{ + size_t i; + for (i = 0; i < ARRAY_SIZE(vlog_facilities); i++) { + if (!strcasecmp(vlog_facilities[i].name, facility)) { + *value = vlog_facilities[i].value; + return true; + } + } + return false; +} + static void vlog_unixctl_set(struct unixctl_conn *conn, int argc, const char *argv[], void *aux OVS_UNUSED) @@ -602,6 +673,7 @@ if (ovsthread_once_start(&once)) { static char *program_name_copy; long long int now; + int facility; /* Do initialization work that needs to be done before any logging * occurs. We want to keep this really minimal because any attempt to @@ -613,7 +685,9 @@ * a pointer to the private copy to suppress memory leak warnings in * case openlog() does make its own copy.) */ program_name_copy = program_name ? xstrdup(program_name) : NULL; - openlog(program_name_copy, LOG_NDELAY, LOG_DAEMON); + atomic_read_explicit(&log_facility, &facility, memory_order_relaxed); + openlog(program_name_copy, LOG_NDELAY, + facility ? facility : LOG_DAEMON); ovsthread_once_done(&once); /* Now do anything that we want to happen only once but doesn't have to @@ -627,7 +701,7 @@ } unixctl_command_register( - "vlog/set", "{spec | PATTERN:facility:pattern}", + "vlog/set", "{spec | PATTERN:destination:pattern}", 1, INT_MAX, vlog_unixctl_set, NULL); unixctl_command_register("vlog/list", "", 0, 0, vlog_unixctl_list, NULL); @@ -727,6 +801,7 @@ char tmp[128]; va_list args; const char *p; + int facility; ds_clear(s); for (p = pattern; *p != '\0'; ) { @@ -761,7 +836,10 @@ ds_put_cstr(s, program_name); break; case 'B': - ds_put_format(s, "%d", LOG_LOCAL0 + syslog_levels[level]); + atomic_read_explicit(&log_facility, &facility, + memory_order_relaxed); + facility = facility ? facility : LOG_LOCAL0; + ds_put_format(s, "%d", facility + syslog_levels[level]); break; case 'c': p = fetch_braces(p, "", tmp, sizeof tmp); @@ -874,8 +952,9 @@ ovs_rwlock_rdlock(&pattern_rwlock); if (log_to_console) { - format_log_message(module, level, facilities[VLF_CONSOLE].pattern, - message, args, &s); + format_log_message(module, level, + destinations[VLF_CONSOLE].pattern, message, + args, &s); ds_put_char(&s, '\n'); fputs(ds_cstr(&s), stderr); } @@ -884,12 +963,15 @@ int syslog_level = syslog_levels[level]; char *save_ptr = NULL; char *line; + int facility; - format_log_message(module, level, facilities[VLF_SYSLOG].pattern, + format_log_message(module, level, destinations[VLF_SYSLOG].pattern, message, args, &s); for (line = strtok_r(s.string, "\n", &save_ptr); line; line = strtok_r(NULL, "\n", &save_ptr)) { - syslog(syslog_level, "%s", line); + atomic_read_explicit(&log_facility, &facility, + memory_order_relaxed); + syslog(syslog_level|facility, "%s", line); } if (syslog_fd >= 0) { @@ -902,7 +984,7 @@ } if (log_to_file) { - format_log_message(module, level, facilities[VLF_FILE].pattern, + format_log_message(module, level, destinations[VLF_FILE].pattern, message, args, &s); ds_put_char(&s, '\n'); @@ -939,7 +1021,7 @@ /* Logs 'message' to 'module' at maximum verbosity, then exits with a failure * exit code. Always writes the message to stderr, even if the console - * facility is disabled. + * destination is disabled. * * Choose this function instead of vlog_abort_valist() if the daemon monitoring * facility shouldn't automatically restart the current daemon. */ @@ -959,7 +1041,7 @@ /* Logs 'message' to 'module' at maximum verbosity, then exits with a failure * exit code. Always writes the message to stderr, even if the console - * facility is disabled. + * destination is disabled. * * Choose this function instead of vlog_abort() if the daemon monitoring * facility shouldn't automatically restart the current daemon. */ @@ -974,7 +1056,7 @@ } /* Logs 'message' to 'module' at maximum verbosity, then calls abort(). Always - * writes the message to stderr, even if the console facility is disabled. + * writes the message to stderr, even if the console destination is disabled. * * Choose this function instead of vlog_fatal_valist() if the daemon monitoring * facility should automatically restart the current daemon. */ @@ -993,7 +1075,7 @@ } /* Logs 'message' to 'module' at maximum verbosity, then calls abort(). Always - * writes the message to stderr, even if the console facility is disabled. + * writes the message to stderr, even if the console destination is disabled. * * Choose this function instead of vlog_fatal() if the daemon monitoring * facility should automatically restart the current daemon. */ diff -Nru openvswitch-2.3.1/lib/vlog.h openvswitch-2.4.0~git20150623/lib/vlog.h --- openvswitch-2.3.1/lib/vlog.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vlog.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef VLOG_H -#define VLOG_H 1 - -/* Logging. - * - * - * Thread-safety - * ============= - * - * Fully thread safe. - */ - -#include -#include -#include -#include -#include "compiler.h" -#include "ovs-thread.h" -#include "sat-math.h" -#include "token-bucket.h" -#include "util.h" -#include "list.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Logging severity levels. - * - * ovs-appctl(8) defines each of the log levels. */ -#define VLOG_LEVELS \ - VLOG_LEVEL(OFF, LOG_ALERT, 1) \ - VLOG_LEVEL(EMER, LOG_ALERT, 1) \ - VLOG_LEVEL(ERR, LOG_ERR, 3) \ - VLOG_LEVEL(WARN, LOG_WARNING, 4) \ - VLOG_LEVEL(INFO, LOG_NOTICE, 5) \ - VLOG_LEVEL(DBG, LOG_DEBUG, 7) -enum vlog_level { -#define VLOG_LEVEL(NAME, SYSLOG_LEVEL, RFC5424_LEVEL) VLL_##NAME, - VLOG_LEVELS -#undef VLOG_LEVEL - VLL_N_LEVELS -}; - -const char *vlog_get_level_name(enum vlog_level); -enum vlog_level vlog_get_level_val(const char *name); - -/* Facilities that we can log to. */ -#define VLOG_FACILITIES \ - VLOG_FACILITY(SYSLOG, "ovs|%05N|%c%T|%p|%m") \ - VLOG_FACILITY(CONSOLE, "%D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m") \ - VLOG_FACILITY(FILE, "%D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m") -enum vlog_facility { -#define VLOG_FACILITY(NAME, PATTERN) VLF_##NAME, - VLOG_FACILITIES -#undef VLOG_FACILITY - VLF_N_FACILITIES, - VLF_ANY_FACILITY = -1 -}; - -const char *vlog_get_facility_name(enum vlog_facility); -enum vlog_facility vlog_get_facility_val(const char *name); - -/* A log module. */ -struct vlog_module { - struct list list; - const char *name; /* User-visible name. */ - int levels[VLF_N_FACILITIES]; /* Minimum log level for each facility. */ - int min_level; /* Minimum log level for any facility. */ - bool honor_rate_limits; /* Set false to ignore rate limits. */ -}; - -/* Global list of all logging modules */ -extern struct list vlog_modules; - -/* Creates and initializes a global instance of a module named MODULE. */ -#define VLOG_DEFINE_MODULE(MODULE) \ - VLOG_DEFINE_MODULE__(MODULE) \ - OVS_CONSTRUCTOR(init_##MODULE) { \ - list_insert(&vlog_modules, &VLM_##MODULE.list); \ - } \ - -const char *vlog_get_module_name(const struct vlog_module *); -struct vlog_module *vlog_module_from_name(const char *name); - -/* Rate-limiter for log messages. */ -struct vlog_rate_limit { - struct token_bucket token_bucket; - time_t first_dropped; /* Time first message was dropped. */ - time_t last_dropped; /* Time of most recent message drop. */ - unsigned int n_dropped; /* Number of messages dropped. */ - struct ovs_mutex mutex; /* Mutual exclusion for rate limit. */ -}; - -/* Number of tokens to emit a message. We add 'rate' tokens per millisecond, - * thus 60,000 tokens are required to emit one message per minute. */ -#define VLOG_MSG_TOKENS (60 * 1000) - -/* Initializer for a struct vlog_rate_limit, to set up a maximum rate of RATE - * messages per minute and a maximum burst size of BURST messages. */ -#define VLOG_RATE_LIMIT_INIT(RATE, BURST) \ - { \ - TOKEN_BUCKET_INIT(RATE, SAT_MUL(BURST, VLOG_MSG_TOKENS)), \ - 0, /* first_dropped */ \ - 0, /* last_dropped */ \ - 0, /* n_dropped */ \ - OVS_MUTEX_INITIALIZER /* mutex */ \ - } - -/* Configuring how each module logs messages. */ -enum vlog_level vlog_get_level(const struct vlog_module *, enum vlog_facility); -void vlog_set_levels(struct vlog_module *, - enum vlog_facility, enum vlog_level); -char *vlog_set_levels_from_string(const char *) WARN_UNUSED_RESULT; -void vlog_set_levels_from_string_assert(const char *); -char *vlog_get_levels(void); -bool vlog_is_enabled(const struct vlog_module *, enum vlog_level); -bool vlog_should_drop(const struct vlog_module *, enum vlog_level, - struct vlog_rate_limit *); -void vlog_set_verbosity(const char *arg); - -/* Configuring log facilities. */ -void vlog_set_pattern(enum vlog_facility, const char *pattern); -int vlog_set_log_file(const char *file_name); -int vlog_reopen_log_file(void); - -/* Configure syslog target. */ -void vlog_set_syslog_target(const char *target); - -/* Initialization. */ -void vlog_init(void); -void vlog_enable_async(void); - -/* Functions for actual logging. */ -void vlog(const struct vlog_module *, enum vlog_level, const char *format, ...) - PRINTF_FORMAT (3, 4); -void vlog_valist(const struct vlog_module *, enum vlog_level, - const char *, va_list) - PRINTF_FORMAT (3, 0); - -void vlog_fatal(const struct vlog_module *, const char *format, ...) - PRINTF_FORMAT (2, 3) NO_RETURN; -void vlog_fatal_valist(const struct vlog_module *, const char *format, va_list) - PRINTF_FORMAT (2, 0) NO_RETURN; - -void vlog_abort(const struct vlog_module *, const char *format, ...) - PRINTF_FORMAT (2, 3) NO_RETURN; -void vlog_abort_valist(const struct vlog_module *, const char *format, va_list) - PRINTF_FORMAT (2, 0) NO_RETURN; - -void vlog_rate_limit(const struct vlog_module *, enum vlog_level, - struct vlog_rate_limit *, const char *, ...) - PRINTF_FORMAT (4, 5); - -/* Creates and initializes a global instance of a module named MODULE, and - * defines a static variable named THIS_MODULE that points to it, for use with - * the convenience macros below. */ -#define VLOG_DEFINE_THIS_MODULE(MODULE) \ - VLOG_DEFINE_MODULE(MODULE); \ - static struct vlog_module *const THIS_MODULE = &VLM_##MODULE - -/* Convenience macros. These assume that THIS_MODULE points to a "struct - * vlog_module" for the current module, as set up by e.g. the - * VLOG_DEFINE_MODULE macro above. - * - * Guaranteed to preserve errno. - */ -#define VLOG_FATAL(...) vlog_fatal(THIS_MODULE, __VA_ARGS__) -#define VLOG_ABORT(...) vlog_abort(THIS_MODULE, __VA_ARGS__) -#define VLOG_EMER(...) VLOG(VLL_EMER, __VA_ARGS__) -#define VLOG_ERR(...) VLOG(VLL_ERR, __VA_ARGS__) -#define VLOG_WARN(...) VLOG(VLL_WARN, __VA_ARGS__) -#define VLOG_INFO(...) VLOG(VLL_INFO, __VA_ARGS__) -#define VLOG_DBG(...) VLOG(VLL_DBG, __VA_ARGS__) - -/* More convenience macros, for testing whether a given level is enabled in - * THIS_MODULE. When constructing a log message is expensive, this enables it - * to be skipped. */ -#define VLOG_IS_ERR_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_ERR) -#define VLOG_IS_WARN_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_WARN) -#define VLOG_IS_INFO_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_INFO) -#define VLOG_IS_DBG_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_DBG) - -/* Convenience macros for rate-limiting. - * Guaranteed to preserve errno. - */ -#define VLOG_ERR_RL(RL, ...) VLOG_RL(RL, VLL_ERR, __VA_ARGS__) -#define VLOG_WARN_RL(RL, ...) VLOG_RL(RL, VLL_WARN, __VA_ARGS__) -#define VLOG_INFO_RL(RL, ...) VLOG_RL(RL, VLL_INFO, __VA_ARGS__) -#define VLOG_DBG_RL(RL, ...) VLOG_RL(RL, VLL_DBG, __VA_ARGS__) - -#define VLOG_DROP_ERR(RL) vlog_should_drop(THIS_MODULE, VLL_ERR, RL) -#define VLOG_DROP_WARN(RL) vlog_should_drop(THIS_MODULE, VLL_WARN, RL) -#define VLOG_DROP_INFO(RL) vlog_should_drop(THIS_MODULE, VLL_INFO, RL) -#define VLOG_DROP_DBG(RL) vlog_should_drop(THIS_MODULE, VLL_DBG, RL) - -/* Macros for logging at most once per execution. */ -#define VLOG_ERR_ONCE(...) VLOG_ONCE(VLL_ERR, __VA_ARGS__) -#define VLOG_WARN_ONCE(...) VLOG_ONCE(VLL_WARN, __VA_ARGS__) -#define VLOG_INFO_ONCE(...) VLOG_ONCE(VLL_INFO, __VA_ARGS__) -#define VLOG_DBG_ONCE(...) VLOG_ONCE(VLL_DBG, __VA_ARGS__) - -/* Command line processing. */ -#define VLOG_OPTION_ENUMS \ - OPT_LOG_FILE, \ - OPT_SYSLOG_TARGET - -#define VLOG_LONG_OPTIONS \ - {"verbose", optional_argument, NULL, 'v'}, \ - {"log-file", optional_argument, NULL, OPT_LOG_FILE}, \ - {"syslog-target", optional_argument, NULL, OPT_SYSLOG_TARGET} - -#define VLOG_OPTION_HANDLERS \ - case 'v': \ - vlog_set_verbosity(optarg); \ - break; \ - case OPT_LOG_FILE: \ - vlog_set_log_file(optarg); \ - break; \ - case OPT_SYSLOG_TARGET: \ - vlog_set_syslog_target(optarg); \ - break; - -void vlog_usage(void); - -/* Implementation details. */ -#define VLOG(LEVEL, ...) \ - do { \ - enum vlog_level level__ = LEVEL; \ - if (THIS_MODULE->min_level >= level__) { \ - vlog(THIS_MODULE, level__, __VA_ARGS__); \ - } \ - } while (0) -#define VLOG_RL(RL, LEVEL, ...) \ - do { \ - enum vlog_level level__ = LEVEL; \ - if (THIS_MODULE->min_level >= level__) { \ - vlog_rate_limit(THIS_MODULE, level__, RL, __VA_ARGS__); \ - } \ - } while (0) -#define VLOG_ONCE(LEVEL, ...) \ - do { \ - static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; \ - if (ovsthread_once_start(&once)) { \ - vlog(THIS_MODULE, LEVEL, __VA_ARGS__); \ - ovsthread_once_done(&once); \ - } \ - } while (0) - -#define VLOG_DEFINE_MODULE__(MODULE) \ - extern struct vlog_module VLM_##MODULE; \ - struct vlog_module VLM_##MODULE = \ - { \ - LIST_INITIALIZER(&VLM_##MODULE.list), \ - #MODULE, /* name */ \ - { VLL_INFO, VLL_INFO, VLL_INFO }, /* levels */ \ - VLL_INFO, /* min_level */ \ - true /* honor_rate_limits */ \ - }; - -#ifdef __cplusplus -} -#endif - - -#endif /* vlog.h */ diff -Nru openvswitch-2.3.1/lib/vlog.man openvswitch-2.4.0~git20150623/lib/vlog.man --- openvswitch-2.3.1/lib/vlog.man 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vlog.man 2015-06-23 18:46:21.000000000 +0000 @@ -7,7 +7,7 @@ .IQ "\fB\-\-verbose=\fR[\fIspec\fR] . Sets logging levels. Without any \fIspec\fR, sets the log level for -every module and facility to \fBdbg\fR. Otherwise, \fIspec\fR is a +every module and destination to \fBdbg\fR. Otherwise, \fIspec\fR is a list of words separated by spaces or commas or colons, up to one from each category below: . @@ -49,11 +49,22 @@ Sets the maximum logging verbosity level, equivalent to \fB\-\-verbose=dbg\fR. . -.IP "\fB\-vPATTERN:\fIfacility\fB:\fIpattern\fR" -.IQ "\fB\-\-verbose=PATTERN:\fIfacility\fB:\fIpattern\fR" -Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Refer to +.IP "\fB\-vPATTERN:\fIdestination\fB:\fIpattern\fR" +.IQ "\fB\-\-verbose=PATTERN:\fIdestination\fB:\fIpattern\fR" +Sets the log pattern for \fIdestination\fR to \fIpattern\fR. Refer to \fBovs\-appctl\fR(8) for a description of the valid syntax for \fIpattern\fR. . +.IP "\fB\-vFACILITY:\fIfacility\fR" +.IQ "\fB\-\-verbose=FACILITY:\fIfacility\fR" +Sets the RFC5424 facility of the log message. \fIfacility\fR can be one of +\fBkern\fR, \fBuser\fR, \fBmail\fR, \fBdaemon\fR, \fBauth\fR, \fBsyslog\fR, +\fBlpr\fR, \fBnews\fR, \fBuucp\fR, \fBclock\fR, \fBftp\fR, \fBntp\fR, +\fBaudit\fR, \fBalert\fR, \fBclock2\fR, \fBlocal0\fR, \fBlocal1\fR, +\fBlocal2\fR, \fBlocal3\fR, \fBlocal4\fR, \fBlocal5\fR, \fBlocal6\fR or +\fBlocal7\fR. If this option is not specified, \fBdaemon\fR is used as +the default for the local system syslog and \fBlocal0\fR is used while sending +a message to the target provided via the \fB\-\-syslog\-target\fR option. +. .TP \fB\-\-log\-file\fR[\fB=\fIfile\fR] Enables logging to a file. If \fIfile\fR is specified, then it is diff -Nru openvswitch-2.3.1/lib/vlog-syn.man openvswitch-2.4.0~git20150623/lib/vlog-syn.man --- openvswitch-2.3.1/lib/vlog-syn.man 2011-12-21 21:20:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vlog-syn.man 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ .IP "Logging options:" -[\fB\-v\fR[\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]]]\&... +[\fB\-v\fR[\fImodule\fR[\fB:\fIdestination\fR[\fB:\fIlevel\fR]]]]\&... .br -[\fB\-\-verbose[=\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]]]\&... +[\fB\-\-verbose[=\fImodule\fR[\fB:\fIdestination\fR[\fB:\fIlevel\fR]]]]\&... .br [\fB\-\-log\-file\fR[\fB=\fIfile\fR]] diff -Nru openvswitch-2.3.1/lib/vlog-unixctl.man openvswitch-2.4.0~git20150623/lib/vlog-unixctl.man --- openvswitch-2.3.1/lib/vlog-unixctl.man 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vlog-unixctl.man 2015-06-23 18:46:21.000000000 +0000 @@ -7,7 +7,7 @@ These commands manage \fB\*(PN\fR's logging settings. .IP "\fBvlog/set\fR [\fIspec\fR]" Sets logging levels. Without any \fIspec\fR, sets the log level for -every module and facility to \fBdbg\fR. Otherwise, \fIspec\fR is a +every module and destination to \fBdbg\fR. Otherwise, \fIspec\fR is a list of words separated by spaces or commas or colons, up to one from each category below: . @@ -44,8 +44,8 @@ For compatibility with older versions of OVS, \fBany\fR is accepted as a word but has no effect. .RE -.IP "\fBvlog/set PATTERN:\fIfacility\fB:\fIpattern\fR" -Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Refer to +.IP "\fBvlog/set PATTERN:\fIdestination\fB:\fIpattern\fR" +Sets the log pattern for \fIdestination\fR to \fIpattern\fR. Refer to \fBovs\-appctl\fR(8) for a description of the valid syntax for \fIpattern\fR. . .IP "\fBvlog/list\fR" diff -Nru openvswitch-2.3.1/lib/vswitch-idl.c openvswitch-2.4.0~git20150623/lib/vswitch-idl.c --- openvswitch-2.3.1/lib/vswitch-idl.c 2014-12-04 05:59:58.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vswitch-idl.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,14135 +0,0 @@ -/* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - -#include -#include "lib/vswitch-idl.h" -#include -#include "ovs-thread.h" -#include "ovsdb-data.h" -#include "ovsdb-error.h" -#include "util.h" - -#ifdef __CHECKER__ -/* Sparse dislikes sizeof(bool) ("warning: expression using sizeof bool"). */ -enum { sizeof_bool = 1 }; -#else -enum { sizeof_bool = sizeof(bool) }; -#endif - -static bool inited; - - -static struct ovsrec_bridge * -ovsrec_bridge_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_bridge, header_) : NULL; -} - -static struct ovsrec_controller * -ovsrec_controller_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_controller, header_) : NULL; -} - -static struct ovsrec_flow_sample_collector_set * -ovsrec_flow_sample_collector_set_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_flow_sample_collector_set, header_) : NULL; -} - -static struct ovsrec_flow_table * -ovsrec_flow_table_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_flow_table, header_) : NULL; -} - -static struct ovsrec_ipfix * -ovsrec_ipfix_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_ipfix, header_) : NULL; -} - -static struct ovsrec_interface * -ovsrec_interface_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_interface, header_) : NULL; -} - -static struct ovsrec_manager * -ovsrec_manager_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_manager, header_) : NULL; -} - -static struct ovsrec_mirror * -ovsrec_mirror_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_mirror, header_) : NULL; -} - -static struct ovsrec_netflow * -ovsrec_netflow_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_netflow, header_) : NULL; -} - -static struct ovsrec_open_vswitch * -ovsrec_open_vswitch_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_open_vswitch, header_) : NULL; -} - -static struct ovsrec_port * -ovsrec_port_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_port, header_) : NULL; -} - -static struct ovsrec_qos * -ovsrec_qos_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_qos, header_) : NULL; -} - -static struct ovsrec_queue * -ovsrec_queue_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_queue, header_) : NULL; -} - -static struct ovsrec_ssl * -ovsrec_ssl_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_ssl, header_) : NULL; -} - -static struct ovsrec_sflow * -ovsrec_sflow_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct ovsrec_sflow, header_) : NULL; -} - -/* Bridge table. */ - -static void -ovsrec_bridge_parse_controller(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - row->controller = NULL; - row->n_controller = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_controller *keyRow = ovsrec_controller_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_CONTROLLER], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_controller) { - row->controller = xmalloc(datum->n * sizeof *row->controller); - } - row->controller[row->n_controller] = keyRow; - row->n_controller++; - } - } -} - -static void -ovsrec_bridge_parse_datapath_id(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->datapath_id = datum->keys[0].string; - } else { - row->datapath_id = NULL; - } -} - -static void -ovsrec_bridge_parse_datapath_type(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->datapath_type = datum->keys[0].string; - } else { - row->datapath_type = ""; - } -} - -static void -ovsrec_bridge_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_bridge_parse_fail_mode(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->fail_mode = datum->keys[0].string; - } else { - row->fail_mode = NULL; - } -} - -static void -ovsrec_bridge_parse_flood_vlans(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t n = MIN(4096, datum->n); - size_t i; - - ovs_assert(inited); - row->flood_vlans = NULL; - row->n_flood_vlans = 0; - for (i = 0; i < n; i++) { - if (!row->n_flood_vlans) { - row->flood_vlans = xmalloc(n * sizeof *row->flood_vlans); - } - row->flood_vlans[row->n_flood_vlans] = datum->keys[i].integer; - row->n_flood_vlans++; - } -} - -static void -ovsrec_bridge_parse_flow_tables(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_flow_tables = NULL; - row->value_flow_tables = NULL; - row->n_flow_tables = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_flow_table *valueRow = ovsrec_flow_table_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_FLOW_TABLE], &datum->values[i].uuid)); - if (valueRow) { - if (!row->n_flow_tables) { - row->key_flow_tables = xmalloc(datum->n * sizeof *row->key_flow_tables); - row->value_flow_tables = xmalloc(datum->n * sizeof *row->value_flow_tables); - } - row->key_flow_tables[row->n_flow_tables] = datum->keys[i].integer; - row->value_flow_tables[row->n_flow_tables] = valueRow; - row->n_flow_tables++; - } - } -} - -static void -ovsrec_bridge_parse_ipfix(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ipfix = ovsrec_ipfix_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_IPFIX], &datum->keys[0].uuid)); - } else { - row->ipfix = NULL; - } -} - -static void -ovsrec_bridge_parse_mirrors(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - row->mirrors = NULL; - row->n_mirrors = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_mirror *keyRow = ovsrec_mirror_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_MIRROR], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_mirrors) { - row->mirrors = xmalloc(datum->n * sizeof *row->mirrors); - } - row->mirrors[row->n_mirrors] = keyRow; - row->n_mirrors++; - } - } -} - -static void -ovsrec_bridge_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -ovsrec_bridge_parse_netflow(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->netflow = ovsrec_netflow_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_NETFLOW], &datum->keys[0].uuid)); - } else { - row->netflow = NULL; - } -} - -static void -ovsrec_bridge_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_bridge_parse_ports(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - row->ports = NULL; - row->n_ports = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_port *keyRow = ovsrec_port_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_PORT], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_ports) { - row->ports = xmalloc(datum->n * sizeof *row->ports); - } - row->ports[row->n_ports] = keyRow; - row->n_ports++; - } - } -} - -static void -ovsrec_bridge_parse_protocols(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - row->protocols = NULL; - row->n_protocols = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_protocols) { - row->protocols = xmalloc(datum->n * sizeof *row->protocols); - } - row->protocols[row->n_protocols] = datum->keys[i].string; - row->n_protocols++; - } -} - -static void -ovsrec_bridge_parse_sflow(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->sflow = ovsrec_sflow_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_SFLOW], &datum->keys[0].uuid)); - } else { - row->sflow = NULL; - } -} - -static void -ovsrec_bridge_parse_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_bridge_parse_stp_enable(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->stp_enable = datum->keys[0].boolean; - } else { - row->stp_enable = false; - } -} - -static void -ovsrec_bridge_unparse_controller(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - free(row->controller); -} - -static void -ovsrec_bridge_unparse_datapath_id(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_unparse_datapath_type(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_bridge_unparse_fail_mode(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_unparse_flood_vlans(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - free(row->flood_vlans); -} - -static void -ovsrec_bridge_unparse_flow_tables(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - free(row->key_flow_tables); - free(row->value_flow_tables); -} - -static void -ovsrec_bridge_unparse_ipfix(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_unparse_mirrors(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - free(row->mirrors); -} - -static void -ovsrec_bridge_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_unparse_netflow(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_bridge_unparse_ports(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - free(row->ports); -} - -static void -ovsrec_bridge_unparse_protocols(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - free(row->protocols); -} - -static void -ovsrec_bridge_unparse_sflow(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_unparse_status(struct ovsdb_idl_row *row_) -{ - struct ovsrec_bridge *row = ovsrec_bridge_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->status); -} - -static void -ovsrec_bridge_unparse_stp_enable(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_bridge_init__(struct ovsdb_idl_row *row) -{ - ovsrec_bridge_init(ovsrec_bridge_cast(row)); -} - -void -ovsrec_bridge_init(struct ovsrec_bridge *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); - smap_init(&row->other_config); - smap_init(&row->status); -} - -const struct ovsrec_bridge * -ovsrec_bridge_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_bridge_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_BRIDGE], uuid)); -} - -const struct ovsrec_bridge * -ovsrec_bridge_first(const struct ovsdb_idl *idl) -{ - return ovsrec_bridge_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_BRIDGE])); -} - -const struct ovsrec_bridge * -ovsrec_bridge_next(const struct ovsrec_bridge *row) -{ - return ovsrec_bridge_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_bridge_delete(const struct ovsrec_bridge *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_bridge * -ovsrec_bridge_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_bridge_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_BRIDGE], NULL)); -} - - -void -ovsrec_bridge_verify_controller(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_CONTROLLER]); -} - -void -ovsrec_bridge_verify_datapath_id(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_DATAPATH_ID]); -} - -void -ovsrec_bridge_verify_datapath_type(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_DATAPATH_TYPE]); -} - -void -ovsrec_bridge_verify_external_ids(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_EXTERNAL_IDS]); -} - -void -ovsrec_bridge_verify_fail_mode(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FAIL_MODE]); -} - -void -ovsrec_bridge_verify_flood_vlans(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FLOOD_VLANS]); -} - -void -ovsrec_bridge_verify_flow_tables(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FLOW_TABLES]); -} - -void -ovsrec_bridge_verify_ipfix(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_IPFIX]); -} - -void -ovsrec_bridge_verify_mirrors(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_MIRRORS]); -} - -void -ovsrec_bridge_verify_name(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_NAME]); -} - -void -ovsrec_bridge_verify_netflow(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_NETFLOW]); -} - -void -ovsrec_bridge_verify_other_config(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_OTHER_CONFIG]); -} - -void -ovsrec_bridge_verify_ports(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_PORTS]); -} - -void -ovsrec_bridge_verify_protocols(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_PROTOCOLS]); -} - -void -ovsrec_bridge_verify_sflow(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_SFLOW]); -} - -void -ovsrec_bridge_verify_status(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_STATUS]); -} - -void -ovsrec_bridge_verify_stp_enable(const struct ovsrec_bridge *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_STP_ENABLE]); -} - -/* Returns the controller column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes controller's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_controller(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_controller); -} - -/* Returns the datapath_id column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes datapath_id's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_datapath_id(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_datapath_id); -} - -/* Returns the datapath_type column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes datapath_type's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_datapath_type(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_datapath_type); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_external_ids(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_external_ids); -} - -/* Returns the fail_mode column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes fail_mode's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_fail_mode(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_fail_mode); -} - -/* Returns the flood_vlans column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes flood_vlans's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_flood_vlans(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_flood_vlans); -} - -/* Returns the flow_tables column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * 'value_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes flow_tables's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_flow_tables(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - ovs_assert(value_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_flow_tables); -} - -/* Returns the ipfix column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes ipfix's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_ipfix(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_ipfix); -} - -/* Returns the mirrors column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes mirrors's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_mirrors(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_mirrors); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_name(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_name); -} - -/* Returns the netflow column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes netflow's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_netflow(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_netflow); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_other_config(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_other_config); -} - -/* Returns the ports column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes ports's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_ports(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_ports); -} - -/* Returns the protocols column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes protocols's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_protocols(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_protocols); -} - -/* Returns the sflow column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes sflow's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_sflow(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_sflow); -} - -/* Returns the status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_status(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_status); -} - -/* Returns the stp_enable column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes stp_enable's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_bridge_get_stp_enable(const struct ovsrec_bridge *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_bridge_col_stp_enable); -} - -void -ovsrec_bridge_set_controller(const struct ovsrec_bridge *row, struct ovsrec_controller **controller, size_t n_controller) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_controller; - datum.keys = n_controller ? xmalloc(n_controller * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_controller; i++) { - datum.keys[i].uuid = controller[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_CONTROLLER], &datum); -} - -void -ovsrec_bridge_set_datapath_id(const struct ovsrec_bridge *row, const char *datapath_id) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (datapath_id) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, datapath_id); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_DATAPATH_ID], &datum); -} - -void -ovsrec_bridge_set_datapath_type(const struct ovsrec_bridge *row, const char *datapath_type) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, datapath_type); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_DATAPATH_TYPE], &datum); -} - -void -ovsrec_bridge_set_external_ids(const struct ovsrec_bridge *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_bridge_set_fail_mode(const struct ovsrec_bridge *row, const char *fail_mode) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (fail_mode) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, fail_mode); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FAIL_MODE], &datum); -} - -void -ovsrec_bridge_set_flood_vlans(const struct ovsrec_bridge *row, const int64_t *flood_vlans, size_t n_flood_vlans) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_flood_vlans; - datum.keys = n_flood_vlans ? xmalloc(n_flood_vlans * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_flood_vlans; i++) { - datum.keys[i].integer = flood_vlans[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FLOOD_VLANS], &datum); -} - -void -ovsrec_bridge_set_flow_tables(const struct ovsrec_bridge *row, const int64_t *key_flow_tables, struct ovsrec_flow_table **value_flow_tables, size_t n_flow_tables) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_flow_tables; - datum.keys = n_flow_tables ? xmalloc(n_flow_tables * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_flow_tables * sizeof *datum.values); - for (i = 0; i < n_flow_tables; i++) { - datum.keys[i].integer = key_flow_tables[i]; - datum.values[i].uuid = value_flow_tables[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_UUID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FLOW_TABLES], &datum); -} - -void -ovsrec_bridge_set_ipfix(const struct ovsrec_bridge *row, const struct ovsrec_ipfix *ipfix) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (ipfix) { - datum.n = 1; - datum.keys = &key; - key.uuid = ipfix->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_IPFIX], &datum); -} - -void -ovsrec_bridge_set_mirrors(const struct ovsrec_bridge *row, struct ovsrec_mirror **mirrors, size_t n_mirrors) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_mirrors; - datum.keys = n_mirrors ? xmalloc(n_mirrors * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_mirrors; i++) { - datum.keys[i].uuid = mirrors[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_MIRRORS], &datum); -} - -void -ovsrec_bridge_set_name(const struct ovsrec_bridge *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_NAME], &datum); -} - -void -ovsrec_bridge_set_netflow(const struct ovsrec_bridge *row, const struct ovsrec_netflow *netflow) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (netflow) { - datum.n = 1; - datum.keys = &key; - key.uuid = netflow->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_NETFLOW], &datum); -} - -void -ovsrec_bridge_set_other_config(const struct ovsrec_bridge *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_OTHER_CONFIG], - &datum); -} - - -void -ovsrec_bridge_set_ports(const struct ovsrec_bridge *row, struct ovsrec_port **ports, size_t n_ports) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_ports; - datum.keys = n_ports ? xmalloc(n_ports * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_ports; i++) { - datum.keys[i].uuid = ports[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_PORTS], &datum); -} - -void -ovsrec_bridge_set_protocols(const struct ovsrec_bridge *row, char **protocols, size_t n_protocols) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_protocols; - datum.keys = n_protocols ? xmalloc(n_protocols * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_protocols; i++) { - datum.keys[i].string = xstrdup(protocols[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_PROTOCOLS], &datum); -} - -void -ovsrec_bridge_set_sflow(const struct ovsrec_bridge *row, const struct ovsrec_sflow *sflow) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (sflow) { - datum.n = 1; - datum.keys = &key; - key.uuid = sflow->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_SFLOW], &datum); -} - -void -ovsrec_bridge_set_status(const struct ovsrec_bridge *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_STATUS], - &datum); -} - - -void -ovsrec_bridge_set_stp_enable(const struct ovsrec_bridge *row, bool stp_enable) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = stp_enable; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_bridge_columns[OVSREC_BRIDGE_COL_STP_ENABLE], &datum); -} - -struct ovsdb_idl_column ovsrec_bridge_columns[OVSREC_BRIDGE_N_COLUMNS]; - -static void -ovsrec_bridge_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_bridge_col_controller. */ - c = &ovsrec_bridge_col_controller; - c->name = "controller"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Controller"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_controller; - c->unparse = ovsrec_bridge_unparse_controller; - - /* Initialize ovsrec_bridge_col_datapath_id. */ - c = &ovsrec_bridge_col_datapath_id; - c->name = "datapath_id"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_bridge_parse_datapath_id; - c->unparse = ovsrec_bridge_unparse_datapath_id; - - /* Initialize ovsrec_bridge_col_datapath_type. */ - c = &ovsrec_bridge_col_datapath_type; - c->name = "datapath_type"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_bridge_parse_datapath_type; - c->unparse = ovsrec_bridge_unparse_datapath_type; - - /* Initialize ovsrec_bridge_col_external_ids. */ - c = &ovsrec_bridge_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_external_ids; - c->unparse = ovsrec_bridge_unparse_external_ids; - - /* Initialize ovsrec_bridge_col_fail_mode. */ - c = &ovsrec_bridge_col_fail_mode; - c->name = "fail_mode"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("secure"); - c->type.key.enum_->keys[1].string = xstrdup("standalone"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_bridge_parse_fail_mode; - c->unparse = ovsrec_bridge_unparse_fail_mode; - - /* Initialize ovsrec_bridge_col_flood_vlans. */ - c = &ovsrec_bridge_col_flood_vlans; - c->name = "flood_vlans"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4095); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 4096; - c->mutable = true; - c->parse = ovsrec_bridge_parse_flood_vlans; - c->unparse = ovsrec_bridge_unparse_flood_vlans; - - /* Initialize ovsrec_bridge_col_flow_tables. */ - c = &ovsrec_bridge_col_flow_tables; - c->name = "flow_tables"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(254); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_UUID); - c->type.value.u.uuid.refTableName = "Flow_Table"; - c->type.value.u.uuid.refType = OVSDB_REF_STRONG; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_flow_tables; - c->unparse = ovsrec_bridge_unparse_flow_tables; - - /* Initialize ovsrec_bridge_col_ipfix. */ - c = &ovsrec_bridge_col_ipfix; - c->name = "ipfix"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "IPFIX"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_bridge_parse_ipfix; - c->unparse = ovsrec_bridge_unparse_ipfix; - - /* Initialize ovsrec_bridge_col_mirrors. */ - c = &ovsrec_bridge_col_mirrors; - c->name = "mirrors"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Mirror"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_mirrors; - c->unparse = ovsrec_bridge_unparse_mirrors; - - /* Initialize ovsrec_bridge_col_name. */ - c = &ovsrec_bridge_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = false; - c->parse = ovsrec_bridge_parse_name; - c->unparse = ovsrec_bridge_unparse_name; - - /* Initialize ovsrec_bridge_col_netflow. */ - c = &ovsrec_bridge_col_netflow; - c->name = "netflow"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "NetFlow"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_bridge_parse_netflow; - c->unparse = ovsrec_bridge_unparse_netflow; - - /* Initialize ovsrec_bridge_col_other_config. */ - c = &ovsrec_bridge_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_other_config; - c->unparse = ovsrec_bridge_unparse_other_config; - - /* Initialize ovsrec_bridge_col_ports. */ - c = &ovsrec_bridge_col_ports; - c->name = "ports"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Port"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_ports; - c->unparse = ovsrec_bridge_unparse_ports; - - /* Initialize ovsrec_bridge_col_protocols. */ - c = &ovsrec_bridge_col_protocols; - c->name = "protocols"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 6; - c->type.key.enum_->keys = xmalloc(6 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("OpenFlow10"); - c->type.key.enum_->keys[1].string = xstrdup("OpenFlow11"); - c->type.key.enum_->keys[2].string = xstrdup("OpenFlow12"); - c->type.key.enum_->keys[3].string = xstrdup("OpenFlow13"); - c->type.key.enum_->keys[4].string = xstrdup("OpenFlow14"); - c->type.key.enum_->keys[5].string = xstrdup("OpenFlow15"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_protocols; - c->unparse = ovsrec_bridge_unparse_protocols; - - /* Initialize ovsrec_bridge_col_sflow. */ - c = &ovsrec_bridge_col_sflow; - c->name = "sflow"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "sFlow"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_bridge_parse_sflow; - c->unparse = ovsrec_bridge_unparse_sflow; - - /* Initialize ovsrec_bridge_col_status. */ - c = &ovsrec_bridge_col_status; - c->name = "status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_bridge_parse_status; - c->unparse = ovsrec_bridge_unparse_status; - - /* Initialize ovsrec_bridge_col_stp_enable. */ - c = &ovsrec_bridge_col_stp_enable; - c->name = "stp_enable"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_bridge_parse_stp_enable; - c->unparse = ovsrec_bridge_unparse_stp_enable; -} - -/* Controller table. */ - -static void -ovsrec_controller_parse_connection_mode(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->connection_mode = datum->keys[0].string; - } else { - row->connection_mode = NULL; - } -} - -static void -ovsrec_controller_parse_controller_burst_limit(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->controller_burst_limit = NULL; - row->n_controller_burst_limit = 0; - for (i = 0; i < n; i++) { - if (!row->n_controller_burst_limit) { - row->controller_burst_limit = xmalloc(n * sizeof *row->controller_burst_limit); - } - row->controller_burst_limit[row->n_controller_burst_limit] = datum->keys[i].integer; - row->n_controller_burst_limit++; - } -} - -static void -ovsrec_controller_parse_controller_rate_limit(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->controller_rate_limit = NULL; - row->n_controller_rate_limit = 0; - for (i = 0; i < n; i++) { - if (!row->n_controller_rate_limit) { - row->controller_rate_limit = xmalloc(n * sizeof *row->controller_rate_limit); - } - row->controller_rate_limit[row->n_controller_rate_limit] = datum->keys[i].integer; - row->n_controller_rate_limit++; - } -} - -static void -ovsrec_controller_parse_enable_async_messages(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->enable_async_messages = NULL; - row->n_enable_async_messages = 0; - for (i = 0; i < n; i++) { - if (!row->n_enable_async_messages) { - row->enable_async_messages = xmalloc(n * sizeof_bool); - } - row->enable_async_messages[row->n_enable_async_messages] = datum->keys[i].boolean; - row->n_enable_async_messages++; - } -} - -static void -ovsrec_controller_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_controller_parse_inactivity_probe(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->inactivity_probe = NULL; - row->n_inactivity_probe = 0; - for (i = 0; i < n; i++) { - if (!row->n_inactivity_probe) { - row->inactivity_probe = xmalloc(n * sizeof *row->inactivity_probe); - } - row->inactivity_probe[row->n_inactivity_probe] = datum->keys[i].integer; - row->n_inactivity_probe++; - } -} - -static void -ovsrec_controller_parse_is_connected(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->is_connected = datum->keys[0].boolean; - } else { - row->is_connected = false; - } -} - -static void -ovsrec_controller_parse_local_gateway(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->local_gateway = datum->keys[0].string; - } else { - row->local_gateway = NULL; - } -} - -static void -ovsrec_controller_parse_local_ip(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->local_ip = datum->keys[0].string; - } else { - row->local_ip = NULL; - } -} - -static void -ovsrec_controller_parse_local_netmask(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->local_netmask = datum->keys[0].string; - } else { - row->local_netmask = NULL; - } -} - -static void -ovsrec_controller_parse_max_backoff(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->max_backoff = NULL; - row->n_max_backoff = 0; - for (i = 0; i < n; i++) { - if (!row->n_max_backoff) { - row->max_backoff = xmalloc(n * sizeof *row->max_backoff); - } - row->max_backoff[row->n_max_backoff] = datum->keys[i].integer; - row->n_max_backoff++; - } -} - -static void -ovsrec_controller_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_controller_parse_role(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->role = datum->keys[0].string; - } else { - row->role = NULL; - } -} - -static void -ovsrec_controller_parse_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_controller_parse_target(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->target = datum->keys[0].string; - } else { - row->target = ""; - } -} - -static void -ovsrec_controller_unparse_connection_mode(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_controller_unparse_controller_burst_limit(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - free(row->controller_burst_limit); -} - -static void -ovsrec_controller_unparse_controller_rate_limit(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - free(row->controller_rate_limit); -} - -static void -ovsrec_controller_unparse_enable_async_messages(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - free(row->enable_async_messages); -} - -static void -ovsrec_controller_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_controller_unparse_inactivity_probe(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - free(row->inactivity_probe); -} - -static void -ovsrec_controller_unparse_is_connected(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_controller_unparse_local_gateway(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_controller_unparse_local_ip(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_controller_unparse_local_netmask(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_controller_unparse_max_backoff(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - free(row->max_backoff); -} - -static void -ovsrec_controller_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_controller_unparse_role(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_controller_unparse_status(struct ovsdb_idl_row *row_) -{ - struct ovsrec_controller *row = ovsrec_controller_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->status); -} - -static void -ovsrec_controller_unparse_target(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_controller_init__(struct ovsdb_idl_row *row) -{ - ovsrec_controller_init(ovsrec_controller_cast(row)); -} - -void -ovsrec_controller_init(struct ovsrec_controller *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); - smap_init(&row->other_config); - smap_init(&row->status); -} - -const struct ovsrec_controller * -ovsrec_controller_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_controller_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_CONTROLLER], uuid)); -} - -const struct ovsrec_controller * -ovsrec_controller_first(const struct ovsdb_idl *idl) -{ - return ovsrec_controller_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_CONTROLLER])); -} - -const struct ovsrec_controller * -ovsrec_controller_next(const struct ovsrec_controller *row) -{ - return ovsrec_controller_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_controller_delete(const struct ovsrec_controller *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_controller * -ovsrec_controller_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_controller_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_CONTROLLER], NULL)); -} - - -void -ovsrec_controller_verify_connection_mode(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONNECTION_MODE]); -} - -void -ovsrec_controller_verify_controller_burst_limit(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONTROLLER_BURST_LIMIT]); -} - -void -ovsrec_controller_verify_controller_rate_limit(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONTROLLER_RATE_LIMIT]); -} - -void -ovsrec_controller_verify_enable_async_messages(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_ENABLE_ASYNC_MESSAGES]); -} - -void -ovsrec_controller_verify_external_ids(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_EXTERNAL_IDS]); -} - -void -ovsrec_controller_verify_inactivity_probe(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_INACTIVITY_PROBE]); -} - -void -ovsrec_controller_verify_is_connected(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_IS_CONNECTED]); -} - -void -ovsrec_controller_verify_local_gateway(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_GATEWAY]); -} - -void -ovsrec_controller_verify_local_ip(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_IP]); -} - -void -ovsrec_controller_verify_local_netmask(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_NETMASK]); -} - -void -ovsrec_controller_verify_max_backoff(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_MAX_BACKOFF]); -} - -void -ovsrec_controller_verify_other_config(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_OTHER_CONFIG]); -} - -void -ovsrec_controller_verify_role(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_ROLE]); -} - -void -ovsrec_controller_verify_status(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_STATUS]); -} - -void -ovsrec_controller_verify_target(const struct ovsrec_controller *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_TARGET]); -} - -/* Returns the connection_mode column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes connection_mode's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_connection_mode(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_connection_mode); -} - -/* Returns the controller_burst_limit column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes controller_burst_limit's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_controller_burst_limit(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_controller_burst_limit); -} - -/* Returns the controller_rate_limit column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes controller_rate_limit's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_controller_rate_limit(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_controller_rate_limit); -} - -/* Returns the enable_async_messages column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes enable_async_messages's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_enable_async_messages(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_enable_async_messages); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_external_ids(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_external_ids); -} - -/* Returns the inactivity_probe column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes inactivity_probe's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_inactivity_probe(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_inactivity_probe); -} - -/* Returns the is_connected column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes is_connected's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_is_connected(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_is_connected); -} - -/* Returns the local_gateway column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes local_gateway's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_local_gateway(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_local_gateway); -} - -/* Returns the local_ip column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes local_ip's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_local_ip(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_local_ip); -} - -/* Returns the local_netmask column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes local_netmask's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_local_netmask(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_local_netmask); -} - -/* Returns the max_backoff column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes max_backoff's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_max_backoff(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_max_backoff); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_other_config(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_other_config); -} - -/* Returns the role column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes role's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_role(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_role); -} - -/* Returns the status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_status(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_status); -} - -/* Returns the target column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes target's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_controller_get_target(const struct ovsrec_controller *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_controller_col_target); -} - -void -ovsrec_controller_set_connection_mode(const struct ovsrec_controller *row, const char *connection_mode) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (connection_mode) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, connection_mode); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONNECTION_MODE], &datum); -} - -void -ovsrec_controller_set_controller_burst_limit(const struct ovsrec_controller *row, const int64_t *controller_burst_limit, size_t n_controller_burst_limit) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_controller_burst_limit) { - datum.n = 1; - datum.keys = &key; - key.integer = *controller_burst_limit; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONTROLLER_BURST_LIMIT], &datum); -} - -void -ovsrec_controller_set_controller_rate_limit(const struct ovsrec_controller *row, const int64_t *controller_rate_limit, size_t n_controller_rate_limit) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_controller_rate_limit) { - datum.n = 1; - datum.keys = &key; - key.integer = *controller_rate_limit; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONTROLLER_RATE_LIMIT], &datum); -} - -void -ovsrec_controller_set_enable_async_messages(const struct ovsrec_controller *row, const bool *enable_async_messages, size_t n_enable_async_messages) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_enable_async_messages) { - datum.n = 1; - datum.keys = &key; - key.boolean = *enable_async_messages; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_ENABLE_ASYNC_MESSAGES], &datum); -} - -void -ovsrec_controller_set_external_ids(const struct ovsrec_controller *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_controller_set_inactivity_probe(const struct ovsrec_controller *row, const int64_t *inactivity_probe, size_t n_inactivity_probe) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_inactivity_probe) { - datum.n = 1; - datum.keys = &key; - key.integer = *inactivity_probe; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_INACTIVITY_PROBE], &datum); -} - -void -ovsrec_controller_set_is_connected(const struct ovsrec_controller *row, bool is_connected) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = is_connected; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_IS_CONNECTED], &datum); -} - -void -ovsrec_controller_set_local_gateway(const struct ovsrec_controller *row, const char *local_gateway) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (local_gateway) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, local_gateway); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_GATEWAY], &datum); -} - -void -ovsrec_controller_set_local_ip(const struct ovsrec_controller *row, const char *local_ip) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (local_ip) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, local_ip); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_IP], &datum); -} - -void -ovsrec_controller_set_local_netmask(const struct ovsrec_controller *row, const char *local_netmask) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (local_netmask) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, local_netmask); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_NETMASK], &datum); -} - -void -ovsrec_controller_set_max_backoff(const struct ovsrec_controller *row, const int64_t *max_backoff, size_t n_max_backoff) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_max_backoff) { - datum.n = 1; - datum.keys = &key; - key.integer = *max_backoff; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_MAX_BACKOFF], &datum); -} - -void -ovsrec_controller_set_other_config(const struct ovsrec_controller *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_OTHER_CONFIG], - &datum); -} - - -void -ovsrec_controller_set_role(const struct ovsrec_controller *row, const char *role) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (role) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, role); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_ROLE], &datum); -} - -void -ovsrec_controller_set_status(const struct ovsrec_controller *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_STATUS], - &datum); -} - - -void -ovsrec_controller_set_target(const struct ovsrec_controller *row, const char *target) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, target); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_controller_columns[OVSREC_CONTROLLER_COL_TARGET], &datum); -} - -struct ovsdb_idl_column ovsrec_controller_columns[OVSREC_CONTROLLER_N_COLUMNS]; - -static void -ovsrec_controller_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_controller_col_connection_mode. */ - c = &ovsrec_controller_col_connection_mode; - c->name = "connection_mode"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("in-band"); - c->type.key.enum_->keys[1].string = xstrdup("out-of-band"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_connection_mode; - c->unparse = ovsrec_controller_unparse_connection_mode; - - /* Initialize ovsrec_controller_col_controller_burst_limit. */ - c = &ovsrec_controller_col_controller_burst_limit; - c->name = "controller_burst_limit"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(25); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_controller_burst_limit; - c->unparse = ovsrec_controller_unparse_controller_burst_limit; - - /* Initialize ovsrec_controller_col_controller_rate_limit. */ - c = &ovsrec_controller_col_controller_rate_limit; - c->name = "controller_rate_limit"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(100); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_controller_rate_limit; - c->unparse = ovsrec_controller_unparse_controller_rate_limit; - - /* Initialize ovsrec_controller_col_enable_async_messages. */ - c = &ovsrec_controller_col_enable_async_messages; - c->name = "enable_async_messages"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_enable_async_messages; - c->unparse = ovsrec_controller_unparse_enable_async_messages; - - /* Initialize ovsrec_controller_col_external_ids. */ - c = &ovsrec_controller_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_controller_parse_external_ids; - c->unparse = ovsrec_controller_unparse_external_ids; - - /* Initialize ovsrec_controller_col_inactivity_probe. */ - c = &ovsrec_controller_col_inactivity_probe; - c->name = "inactivity_probe"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_inactivity_probe; - c->unparse = ovsrec_controller_unparse_inactivity_probe; - - /* Initialize ovsrec_controller_col_is_connected. */ - c = &ovsrec_controller_col_is_connected; - c->name = "is_connected"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_is_connected; - c->unparse = ovsrec_controller_unparse_is_connected; - - /* Initialize ovsrec_controller_col_local_gateway. */ - c = &ovsrec_controller_col_local_gateway; - c->name = "local_gateway"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_local_gateway; - c->unparse = ovsrec_controller_unparse_local_gateway; - - /* Initialize ovsrec_controller_col_local_ip. */ - c = &ovsrec_controller_col_local_ip; - c->name = "local_ip"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_local_ip; - c->unparse = ovsrec_controller_unparse_local_ip; - - /* Initialize ovsrec_controller_col_local_netmask. */ - c = &ovsrec_controller_col_local_netmask; - c->name = "local_netmask"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_local_netmask; - c->unparse = ovsrec_controller_unparse_local_netmask; - - /* Initialize ovsrec_controller_col_max_backoff. */ - c = &ovsrec_controller_col_max_backoff; - c->name = "max_backoff"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(1000); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_max_backoff; - c->unparse = ovsrec_controller_unparse_max_backoff; - - /* Initialize ovsrec_controller_col_other_config. */ - c = &ovsrec_controller_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_controller_parse_other_config; - c->unparse = ovsrec_controller_unparse_other_config; - - /* Initialize ovsrec_controller_col_role. */ - c = &ovsrec_controller_col_role; - c->name = "role"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 3; - c->type.key.enum_->keys = xmalloc(3 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("master"); - c->type.key.enum_->keys[1].string = xstrdup("other"); - c->type.key.enum_->keys[2].string = xstrdup("slave"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_role; - c->unparse = ovsrec_controller_unparse_role; - - /* Initialize ovsrec_controller_col_status. */ - c = &ovsrec_controller_col_status; - c->name = "status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_controller_parse_status; - c->unparse = ovsrec_controller_unparse_status; - - /* Initialize ovsrec_controller_col_target. */ - c = &ovsrec_controller_col_target; - c->name = "target"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_controller_parse_target; - c->unparse = ovsrec_controller_unparse_target; -} - -/* Flow_Sample_Collector_Set table. */ - -static void -ovsrec_flow_sample_collector_set_parse_bridge(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_sample_collector_set *row = ovsrec_flow_sample_collector_set_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bridge = ovsrec_bridge_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_BRIDGE], &datum->keys[0].uuid)); - } else { - row->bridge = NULL; - } -} - -static void -ovsrec_flow_sample_collector_set_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_sample_collector_set *row = ovsrec_flow_sample_collector_set_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_flow_sample_collector_set_parse_id(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_sample_collector_set *row = ovsrec_flow_sample_collector_set_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->id = datum->keys[0].integer; - } else { - row->id = 0; - } -} - -static void -ovsrec_flow_sample_collector_set_parse_ipfix(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_sample_collector_set *row = ovsrec_flow_sample_collector_set_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ipfix = ovsrec_ipfix_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_IPFIX], &datum->keys[0].uuid)); - } else { - row->ipfix = NULL; - } -} - -static void -ovsrec_flow_sample_collector_set_unparse_bridge(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_flow_sample_collector_set_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_flow_sample_collector_set *row = ovsrec_flow_sample_collector_set_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_flow_sample_collector_set_unparse_id(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_flow_sample_collector_set_unparse_ipfix(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_flow_sample_collector_set_init__(struct ovsdb_idl_row *row) -{ - ovsrec_flow_sample_collector_set_init(ovsrec_flow_sample_collector_set_cast(row)); -} - -void -ovsrec_flow_sample_collector_set_init(struct ovsrec_flow_sample_collector_set *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); -} - -const struct ovsrec_flow_sample_collector_set * -ovsrec_flow_sample_collector_set_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_flow_sample_collector_set_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_FLOW_SAMPLE_COLLECTOR_SET], uuid)); -} - -const struct ovsrec_flow_sample_collector_set * -ovsrec_flow_sample_collector_set_first(const struct ovsdb_idl *idl) -{ - return ovsrec_flow_sample_collector_set_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_FLOW_SAMPLE_COLLECTOR_SET])); -} - -const struct ovsrec_flow_sample_collector_set * -ovsrec_flow_sample_collector_set_next(const struct ovsrec_flow_sample_collector_set *row) -{ - return ovsrec_flow_sample_collector_set_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_flow_sample_collector_set_delete(const struct ovsrec_flow_sample_collector_set *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_flow_sample_collector_set * -ovsrec_flow_sample_collector_set_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_flow_sample_collector_set_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_FLOW_SAMPLE_COLLECTOR_SET], NULL)); -} - - -void -ovsrec_flow_sample_collector_set_verify_bridge(const struct ovsrec_flow_sample_collector_set *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_BRIDGE]); -} - -void -ovsrec_flow_sample_collector_set_verify_external_ids(const struct ovsrec_flow_sample_collector_set *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_EXTERNAL_IDS]); -} - -void -ovsrec_flow_sample_collector_set_verify_id(const struct ovsrec_flow_sample_collector_set *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_ID]); -} - -void -ovsrec_flow_sample_collector_set_verify_ipfix(const struct ovsrec_flow_sample_collector_set *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_IPFIX]); -} - -/* Returns the bridge column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes bridge's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_sample_collector_set_get_bridge(const struct ovsrec_flow_sample_collector_set *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_sample_collector_set_col_bridge); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_sample_collector_set_get_external_ids(const struct ovsrec_flow_sample_collector_set *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_sample_collector_set_col_external_ids); -} - -/* Returns the id column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes id's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_sample_collector_set_get_id(const struct ovsrec_flow_sample_collector_set *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_sample_collector_set_col_id); -} - -/* Returns the ipfix column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes ipfix's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_sample_collector_set_get_ipfix(const struct ovsrec_flow_sample_collector_set *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_sample_collector_set_col_ipfix); -} - -void -ovsrec_flow_sample_collector_set_set_bridge(const struct ovsrec_flow_sample_collector_set *row, const struct ovsrec_bridge *bridge) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = bridge->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_BRIDGE], &datum); -} - -void -ovsrec_flow_sample_collector_set_set_external_ids(const struct ovsrec_flow_sample_collector_set *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_flow_sample_collector_set_set_id(const struct ovsrec_flow_sample_collector_set *row, int64_t id) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = id; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_ID], &datum); -} - -void -ovsrec_flow_sample_collector_set_set_ipfix(const struct ovsrec_flow_sample_collector_set *row, const struct ovsrec_ipfix *ipfix) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (ipfix) { - datum.n = 1; - datum.keys = &key; - key.uuid = ipfix->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_IPFIX], &datum); -} - -struct ovsdb_idl_column ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_N_COLUMNS]; - -static void -ovsrec_flow_sample_collector_set_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_flow_sample_collector_set_col_bridge. */ - c = &ovsrec_flow_sample_collector_set_col_bridge; - c->name = "bridge"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Bridge"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_flow_sample_collector_set_parse_bridge; - c->unparse = ovsrec_flow_sample_collector_set_unparse_bridge; - - /* Initialize ovsrec_flow_sample_collector_set_col_external_ids. */ - c = &ovsrec_flow_sample_collector_set_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_flow_sample_collector_set_parse_external_ids; - c->unparse = ovsrec_flow_sample_collector_set_unparse_external_ids; - - /* Initialize ovsrec_flow_sample_collector_set_col_id. */ - c = &ovsrec_flow_sample_collector_set_col_id; - c->name = "id"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4294967295); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_flow_sample_collector_set_parse_id; - c->unparse = ovsrec_flow_sample_collector_set_unparse_id; - - /* Initialize ovsrec_flow_sample_collector_set_col_ipfix. */ - c = &ovsrec_flow_sample_collector_set_col_ipfix; - c->name = "ipfix"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "IPFIX"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_flow_sample_collector_set_parse_ipfix; - c->unparse = ovsrec_flow_sample_collector_set_unparse_ipfix; -} - -/* Flow_Table table. */ - -static void -ovsrec_flow_table_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_flow_table_parse_flow_limit(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->flow_limit = NULL; - row->n_flow_limit = 0; - for (i = 0; i < n; i++) { - if (!row->n_flow_limit) { - row->flow_limit = xmalloc(n * sizeof *row->flow_limit); - } - row->flow_limit[row->n_flow_limit] = datum->keys[i].integer; - row->n_flow_limit++; - } -} - -static void -ovsrec_flow_table_parse_groups(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - size_t i; - - ovs_assert(inited); - row->groups = NULL; - row->n_groups = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_groups) { - row->groups = xmalloc(datum->n * sizeof *row->groups); - } - row->groups[row->n_groups] = datum->keys[i].string; - row->n_groups++; - } -} - -static void -ovsrec_flow_table_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = NULL; - } -} - -static void -ovsrec_flow_table_parse_overflow_policy(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->overflow_policy = datum->keys[0].string; - } else { - row->overflow_policy = NULL; - } -} - -static void -ovsrec_flow_table_parse_prefixes(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - size_t n = MIN(3, datum->n); - size_t i; - - ovs_assert(inited); - row->prefixes = NULL; - row->n_prefixes = 0; - for (i = 0; i < n; i++) { - if (!row->n_prefixes) { - row->prefixes = xmalloc(n * sizeof *row->prefixes); - } - row->prefixes[row->n_prefixes] = datum->keys[i].string; - row->n_prefixes++; - } -} - -static void -ovsrec_flow_table_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_flow_table_unparse_flow_limit(struct ovsdb_idl_row *row_) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - - ovs_assert(inited); - free(row->flow_limit); -} - -static void -ovsrec_flow_table_unparse_groups(struct ovsdb_idl_row *row_) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - - ovs_assert(inited); - free(row->groups); -} - -static void -ovsrec_flow_table_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_flow_table_unparse_overflow_policy(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_flow_table_unparse_prefixes(struct ovsdb_idl_row *row_) -{ - struct ovsrec_flow_table *row = ovsrec_flow_table_cast(row_); - - ovs_assert(inited); - free(row->prefixes); -} - -static void -ovsrec_flow_table_init__(struct ovsdb_idl_row *row) -{ - ovsrec_flow_table_init(ovsrec_flow_table_cast(row)); -} - -void -ovsrec_flow_table_init(struct ovsrec_flow_table *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); -} - -const struct ovsrec_flow_table * -ovsrec_flow_table_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_flow_table_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_FLOW_TABLE], uuid)); -} - -const struct ovsrec_flow_table * -ovsrec_flow_table_first(const struct ovsdb_idl *idl) -{ - return ovsrec_flow_table_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_FLOW_TABLE])); -} - -const struct ovsrec_flow_table * -ovsrec_flow_table_next(const struct ovsrec_flow_table *row) -{ - return ovsrec_flow_table_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_flow_table_delete(const struct ovsrec_flow_table *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_flow_table * -ovsrec_flow_table_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_flow_table_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_FLOW_TABLE], NULL)); -} - - -void -ovsrec_flow_table_verify_external_ids(const struct ovsrec_flow_table *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_EXTERNAL_IDS]); -} - -void -ovsrec_flow_table_verify_flow_limit(const struct ovsrec_flow_table *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_FLOW_LIMIT]); -} - -void -ovsrec_flow_table_verify_groups(const struct ovsrec_flow_table *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_GROUPS]); -} - -void -ovsrec_flow_table_verify_name(const struct ovsrec_flow_table *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_NAME]); -} - -void -ovsrec_flow_table_verify_overflow_policy(const struct ovsrec_flow_table *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_OVERFLOW_POLICY]); -} - -void -ovsrec_flow_table_verify_prefixes(const struct ovsrec_flow_table *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_PREFIXES]); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_table_get_external_ids(const struct ovsrec_flow_table *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_table_col_external_ids); -} - -/* Returns the flow_limit column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes flow_limit's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_table_get_flow_limit(const struct ovsrec_flow_table *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_table_col_flow_limit); -} - -/* Returns the groups column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes groups's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_table_get_groups(const struct ovsrec_flow_table *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_table_col_groups); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_table_get_name(const struct ovsrec_flow_table *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_table_col_name); -} - -/* Returns the overflow_policy column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes overflow_policy's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_table_get_overflow_policy(const struct ovsrec_flow_table *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_table_col_overflow_policy); -} - -/* Returns the prefixes column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes prefixes's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_flow_table_get_prefixes(const struct ovsrec_flow_table *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_flow_table_col_prefixes); -} - -void -ovsrec_flow_table_set_external_ids(const struct ovsrec_flow_table *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_flow_table_set_flow_limit(const struct ovsrec_flow_table *row, const int64_t *flow_limit, size_t n_flow_limit) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_flow_limit) { - datum.n = 1; - datum.keys = &key; - key.integer = *flow_limit; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_FLOW_LIMIT], &datum); -} - -void -ovsrec_flow_table_set_groups(const struct ovsrec_flow_table *row, char **groups, size_t n_groups) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_groups; - datum.keys = n_groups ? xmalloc(n_groups * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_groups; i++) { - datum.keys[i].string = xstrdup(groups[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_GROUPS], &datum); -} - -void -ovsrec_flow_table_set_name(const struct ovsrec_flow_table *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (name) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_NAME], &datum); -} - -void -ovsrec_flow_table_set_overflow_policy(const struct ovsrec_flow_table *row, const char *overflow_policy) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (overflow_policy) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, overflow_policy); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_OVERFLOW_POLICY], &datum); -} - -void -ovsrec_flow_table_set_prefixes(const struct ovsrec_flow_table *row, char **prefixes, size_t n_prefixes) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_prefixes; - datum.keys = n_prefixes ? xmalloc(n_prefixes * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_prefixes; i++) { - datum.keys[i].string = xstrdup(prefixes[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_PREFIXES], &datum); -} - -struct ovsdb_idl_column ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_N_COLUMNS]; - -static void -ovsrec_flow_table_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_flow_table_col_external_ids. */ - c = &ovsrec_flow_table_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_flow_table_parse_external_ids; - c->unparse = ovsrec_flow_table_unparse_external_ids; - - /* Initialize ovsrec_flow_table_col_flow_limit. */ - c = &ovsrec_flow_table_col_flow_limit; - c->name = "flow_limit"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_flow_table_parse_flow_limit; - c->unparse = ovsrec_flow_table_unparse_flow_limit; - - /* Initialize ovsrec_flow_table_col_groups. */ - c = &ovsrec_flow_table_col_groups; - c->name = "groups"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_flow_table_parse_groups; - c->unparse = ovsrec_flow_table_unparse_groups; - - /* Initialize ovsrec_flow_table_col_name. */ - c = &ovsrec_flow_table_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_flow_table_parse_name; - c->unparse = ovsrec_flow_table_unparse_name; - - /* Initialize ovsrec_flow_table_col_overflow_policy. */ - c = &ovsrec_flow_table_col_overflow_policy; - c->name = "overflow_policy"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("evict"); - c->type.key.enum_->keys[1].string = xstrdup("refuse"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_flow_table_parse_overflow_policy; - c->unparse = ovsrec_flow_table_unparse_overflow_policy; - - /* Initialize ovsrec_flow_table_col_prefixes. */ - c = &ovsrec_flow_table_col_prefixes; - c->name = "prefixes"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 3; - c->mutable = true; - c->parse = ovsrec_flow_table_parse_prefixes; - c->unparse = ovsrec_flow_table_unparse_prefixes; -} - -/* IPFIX table. */ - -static void -ovsrec_ipfix_parse_cache_active_timeout(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->cache_active_timeout = NULL; - row->n_cache_active_timeout = 0; - for (i = 0; i < n; i++) { - if (!row->n_cache_active_timeout) { - row->cache_active_timeout = xmalloc(n * sizeof *row->cache_active_timeout); - } - row->cache_active_timeout[row->n_cache_active_timeout] = datum->keys[i].integer; - row->n_cache_active_timeout++; - } -} - -static void -ovsrec_ipfix_parse_cache_max_flows(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->cache_max_flows = NULL; - row->n_cache_max_flows = 0; - for (i = 0; i < n; i++) { - if (!row->n_cache_max_flows) { - row->cache_max_flows = xmalloc(n * sizeof *row->cache_max_flows); - } - row->cache_max_flows[row->n_cache_max_flows] = datum->keys[i].integer; - row->n_cache_max_flows++; - } -} - -static void -ovsrec_ipfix_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_ipfix_parse_obs_domain_id(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->obs_domain_id = NULL; - row->n_obs_domain_id = 0; - for (i = 0; i < n; i++) { - if (!row->n_obs_domain_id) { - row->obs_domain_id = xmalloc(n * sizeof *row->obs_domain_id); - } - row->obs_domain_id[row->n_obs_domain_id] = datum->keys[i].integer; - row->n_obs_domain_id++; - } -} - -static void -ovsrec_ipfix_parse_obs_point_id(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->obs_point_id = NULL; - row->n_obs_point_id = 0; - for (i = 0; i < n; i++) { - if (!row->n_obs_point_id) { - row->obs_point_id = xmalloc(n * sizeof *row->obs_point_id); - } - row->obs_point_id[row->n_obs_point_id] = datum->keys[i].integer; - row->n_obs_point_id++; - } -} - -static void -ovsrec_ipfix_parse_sampling(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->sampling = NULL; - row->n_sampling = 0; - for (i = 0; i < n; i++) { - if (!row->n_sampling) { - row->sampling = xmalloc(n * sizeof *row->sampling); - } - row->sampling[row->n_sampling] = datum->keys[i].integer; - row->n_sampling++; - } -} - -static void -ovsrec_ipfix_parse_targets(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - size_t i; - - ovs_assert(inited); - row->targets = NULL; - row->n_targets = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_targets) { - row->targets = xmalloc(datum->n * sizeof *row->targets); - } - row->targets[row->n_targets] = datum->keys[i].string; - row->n_targets++; - } -} - -static void -ovsrec_ipfix_unparse_cache_active_timeout(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - - ovs_assert(inited); - free(row->cache_active_timeout); -} - -static void -ovsrec_ipfix_unparse_cache_max_flows(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - - ovs_assert(inited); - free(row->cache_max_flows); -} - -static void -ovsrec_ipfix_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_ipfix_unparse_obs_domain_id(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - - ovs_assert(inited); - free(row->obs_domain_id); -} - -static void -ovsrec_ipfix_unparse_obs_point_id(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - - ovs_assert(inited); - free(row->obs_point_id); -} - -static void -ovsrec_ipfix_unparse_sampling(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - - ovs_assert(inited); - free(row->sampling); -} - -static void -ovsrec_ipfix_unparse_targets(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ipfix *row = ovsrec_ipfix_cast(row_); - - ovs_assert(inited); - free(row->targets); -} - -static void -ovsrec_ipfix_init__(struct ovsdb_idl_row *row) -{ - ovsrec_ipfix_init(ovsrec_ipfix_cast(row)); -} - -void -ovsrec_ipfix_init(struct ovsrec_ipfix *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); -} - -const struct ovsrec_ipfix * -ovsrec_ipfix_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_ipfix_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_IPFIX], uuid)); -} - -const struct ovsrec_ipfix * -ovsrec_ipfix_first(const struct ovsdb_idl *idl) -{ - return ovsrec_ipfix_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_IPFIX])); -} - -const struct ovsrec_ipfix * -ovsrec_ipfix_next(const struct ovsrec_ipfix *row) -{ - return ovsrec_ipfix_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_ipfix_delete(const struct ovsrec_ipfix *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_ipfix * -ovsrec_ipfix_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_ipfix_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_IPFIX], NULL)); -} - - -void -ovsrec_ipfix_verify_cache_active_timeout(const struct ovsrec_ipfix *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_CACHE_ACTIVE_TIMEOUT]); -} - -void -ovsrec_ipfix_verify_cache_max_flows(const struct ovsrec_ipfix *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_CACHE_MAX_FLOWS]); -} - -void -ovsrec_ipfix_verify_external_ids(const struct ovsrec_ipfix *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_EXTERNAL_IDS]); -} - -void -ovsrec_ipfix_verify_obs_domain_id(const struct ovsrec_ipfix *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_OBS_DOMAIN_ID]); -} - -void -ovsrec_ipfix_verify_obs_point_id(const struct ovsrec_ipfix *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_OBS_POINT_ID]); -} - -void -ovsrec_ipfix_verify_sampling(const struct ovsrec_ipfix *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_SAMPLING]); -} - -void -ovsrec_ipfix_verify_targets(const struct ovsrec_ipfix *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_TARGETS]); -} - -/* Returns the cache_active_timeout column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes cache_active_timeout's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ipfix_get_cache_active_timeout(const struct ovsrec_ipfix *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_ipfix_col_cache_active_timeout); -} - -/* Returns the cache_max_flows column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes cache_max_flows's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ipfix_get_cache_max_flows(const struct ovsrec_ipfix *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_ipfix_col_cache_max_flows); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ipfix_get_external_ids(const struct ovsrec_ipfix *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_ipfix_col_external_ids); -} - -/* Returns the obs_domain_id column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes obs_domain_id's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ipfix_get_obs_domain_id(const struct ovsrec_ipfix *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_ipfix_col_obs_domain_id); -} - -/* Returns the obs_point_id column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes obs_point_id's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ipfix_get_obs_point_id(const struct ovsrec_ipfix *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_ipfix_col_obs_point_id); -} - -/* Returns the sampling column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes sampling's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ipfix_get_sampling(const struct ovsrec_ipfix *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_ipfix_col_sampling); -} - -/* Returns the targets column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes targets's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ipfix_get_targets(const struct ovsrec_ipfix *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_ipfix_col_targets); -} - -void -ovsrec_ipfix_set_cache_active_timeout(const struct ovsrec_ipfix *row, const int64_t *cache_active_timeout, size_t n_cache_active_timeout) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_cache_active_timeout) { - datum.n = 1; - datum.keys = &key; - key.integer = *cache_active_timeout; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_CACHE_ACTIVE_TIMEOUT], &datum); -} - -void -ovsrec_ipfix_set_cache_max_flows(const struct ovsrec_ipfix *row, const int64_t *cache_max_flows, size_t n_cache_max_flows) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_cache_max_flows) { - datum.n = 1; - datum.keys = &key; - key.integer = *cache_max_flows; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_CACHE_MAX_FLOWS], &datum); -} - -void -ovsrec_ipfix_set_external_ids(const struct ovsrec_ipfix *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_ipfix_set_obs_domain_id(const struct ovsrec_ipfix *row, const int64_t *obs_domain_id, size_t n_obs_domain_id) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_obs_domain_id) { - datum.n = 1; - datum.keys = &key; - key.integer = *obs_domain_id; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_OBS_DOMAIN_ID], &datum); -} - -void -ovsrec_ipfix_set_obs_point_id(const struct ovsrec_ipfix *row, const int64_t *obs_point_id, size_t n_obs_point_id) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_obs_point_id) { - datum.n = 1; - datum.keys = &key; - key.integer = *obs_point_id; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_OBS_POINT_ID], &datum); -} - -void -ovsrec_ipfix_set_sampling(const struct ovsrec_ipfix *row, const int64_t *sampling, size_t n_sampling) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_sampling) { - datum.n = 1; - datum.keys = &key; - key.integer = *sampling; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_SAMPLING], &datum); -} - -void -ovsrec_ipfix_set_targets(const struct ovsrec_ipfix *row, char **targets, size_t n_targets) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_targets; - datum.keys = n_targets ? xmalloc(n_targets * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_targets; i++) { - datum.keys[i].string = xstrdup(targets[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_ipfix_columns[OVSREC_IPFIX_COL_TARGETS], &datum); -} - -struct ovsdb_idl_column ovsrec_ipfix_columns[OVSREC_IPFIX_N_COLUMNS]; - -static void -ovsrec_ipfix_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_ipfix_col_cache_active_timeout. */ - c = &ovsrec_ipfix_col_cache_active_timeout; - c->name = "cache_active_timeout"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4200); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ipfix_parse_cache_active_timeout; - c->unparse = ovsrec_ipfix_unparse_cache_active_timeout; - - /* Initialize ovsrec_ipfix_col_cache_max_flows. */ - c = &ovsrec_ipfix_col_cache_max_flows; - c->name = "cache_max_flows"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4294967295); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ipfix_parse_cache_max_flows; - c->unparse = ovsrec_ipfix_unparse_cache_max_flows; - - /* Initialize ovsrec_ipfix_col_external_ids. */ - c = &ovsrec_ipfix_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_ipfix_parse_external_ids; - c->unparse = ovsrec_ipfix_unparse_external_ids; - - /* Initialize ovsrec_ipfix_col_obs_domain_id. */ - c = &ovsrec_ipfix_col_obs_domain_id; - c->name = "obs_domain_id"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4294967295); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ipfix_parse_obs_domain_id; - c->unparse = ovsrec_ipfix_unparse_obs_domain_id; - - /* Initialize ovsrec_ipfix_col_obs_point_id. */ - c = &ovsrec_ipfix_col_obs_point_id; - c->name = "obs_point_id"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4294967295); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ipfix_parse_obs_point_id; - c->unparse = ovsrec_ipfix_unparse_obs_point_id; - - /* Initialize ovsrec_ipfix_col_sampling. */ - c = &ovsrec_ipfix_col_sampling; - c->name = "sampling"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(1); - c->type.key.u.integer.max = INT64_C(4294967295); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ipfix_parse_sampling; - c->unparse = ovsrec_ipfix_unparse_sampling; - - /* Initialize ovsrec_ipfix_col_targets. */ - c = &ovsrec_ipfix_col_targets; - c->name = "targets"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_ipfix_parse_targets; - c->unparse = ovsrec_ipfix_unparse_targets; -} - -/* Interface table. */ - -static void -ovsrec_interface_parse_admin_state(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->admin_state = datum->keys[0].string; - } else { - row->admin_state = NULL; - } -} - -static void -ovsrec_interface_parse_bfd(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->bfd); - for (i = 0; i < datum->n; i++) { - smap_add(&row->bfd, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_interface_parse_bfd_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->bfd_status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->bfd_status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_interface_parse_cfm_fault(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->cfm_fault = NULL; - row->n_cfm_fault = 0; - for (i = 0; i < n; i++) { - if (!row->n_cfm_fault) { - row->cfm_fault = xmalloc(n * sizeof_bool); - } - row->cfm_fault[row->n_cfm_fault] = datum->keys[i].boolean; - row->n_cfm_fault++; - } -} - -static void -ovsrec_interface_parse_cfm_fault_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - row->cfm_fault_status = NULL; - row->n_cfm_fault_status = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_cfm_fault_status) { - row->cfm_fault_status = xmalloc(datum->n * sizeof *row->cfm_fault_status); - } - row->cfm_fault_status[row->n_cfm_fault_status] = datum->keys[i].string; - row->n_cfm_fault_status++; - } -} - -static void -ovsrec_interface_parse_cfm_flap_count(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->cfm_flap_count = NULL; - row->n_cfm_flap_count = 0; - for (i = 0; i < n; i++) { - if (!row->n_cfm_flap_count) { - row->cfm_flap_count = xmalloc(n * sizeof *row->cfm_flap_count); - } - row->cfm_flap_count[row->n_cfm_flap_count] = datum->keys[i].integer; - row->n_cfm_flap_count++; - } -} - -static void -ovsrec_interface_parse_cfm_health(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->cfm_health = NULL; - row->n_cfm_health = 0; - for (i = 0; i < n; i++) { - if (!row->n_cfm_health) { - row->cfm_health = xmalloc(n * sizeof *row->cfm_health); - } - row->cfm_health[row->n_cfm_health] = datum->keys[i].integer; - row->n_cfm_health++; - } -} - -static void -ovsrec_interface_parse_cfm_mpid(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->cfm_mpid = NULL; - row->n_cfm_mpid = 0; - for (i = 0; i < n; i++) { - if (!row->n_cfm_mpid) { - row->cfm_mpid = xmalloc(n * sizeof *row->cfm_mpid); - } - row->cfm_mpid[row->n_cfm_mpid] = datum->keys[i].integer; - row->n_cfm_mpid++; - } -} - -static void -ovsrec_interface_parse_cfm_remote_mpids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - row->cfm_remote_mpids = NULL; - row->n_cfm_remote_mpids = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_cfm_remote_mpids) { - row->cfm_remote_mpids = xmalloc(datum->n * sizeof *row->cfm_remote_mpids); - } - row->cfm_remote_mpids[row->n_cfm_remote_mpids] = datum->keys[i].integer; - row->n_cfm_remote_mpids++; - } -} - -static void -ovsrec_interface_parse_cfm_remote_opstate(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->cfm_remote_opstate = datum->keys[0].string; - } else { - row->cfm_remote_opstate = NULL; - } -} - -static void -ovsrec_interface_parse_duplex(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->duplex = datum->keys[0].string; - } else { - row->duplex = NULL; - } -} - -static void -ovsrec_interface_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_interface_parse_ifindex(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->ifindex = NULL; - row->n_ifindex = 0; - for (i = 0; i < n; i++) { - if (!row->n_ifindex) { - row->ifindex = xmalloc(n * sizeof *row->ifindex); - } - row->ifindex[row->n_ifindex] = datum->keys[i].integer; - row->n_ifindex++; - } -} - -static void -ovsrec_interface_parse_ingress_policing_burst(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ingress_policing_burst = datum->keys[0].integer; - } else { - row->ingress_policing_burst = 0; - } -} - -static void -ovsrec_interface_parse_ingress_policing_rate(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ingress_policing_rate = datum->keys[0].integer; - } else { - row->ingress_policing_rate = 0; - } -} - -static void -ovsrec_interface_parse_lacp_current(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->lacp_current = NULL; - row->n_lacp_current = 0; - for (i = 0; i < n; i++) { - if (!row->n_lacp_current) { - row->lacp_current = xmalloc(n * sizeof_bool); - } - row->lacp_current[row->n_lacp_current] = datum->keys[i].boolean; - row->n_lacp_current++; - } -} - -static void -ovsrec_interface_parse_link_resets(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->link_resets = NULL; - row->n_link_resets = 0; - for (i = 0; i < n; i++) { - if (!row->n_link_resets) { - row->link_resets = xmalloc(n * sizeof *row->link_resets); - } - row->link_resets[row->n_link_resets] = datum->keys[i].integer; - row->n_link_resets++; - } -} - -static void -ovsrec_interface_parse_link_speed(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->link_speed = NULL; - row->n_link_speed = 0; - for (i = 0; i < n; i++) { - if (!row->n_link_speed) { - row->link_speed = xmalloc(n * sizeof *row->link_speed); - } - row->link_speed[row->n_link_speed] = datum->keys[i].integer; - row->n_link_speed++; - } -} - -static void -ovsrec_interface_parse_link_state(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->link_state = datum->keys[0].string; - } else { - row->link_state = NULL; - } -} - -static void -ovsrec_interface_parse_mac(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->mac = datum->keys[0].string; - } else { - row->mac = NULL; - } -} - -static void -ovsrec_interface_parse_mac_in_use(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->mac_in_use = datum->keys[0].string; - } else { - row->mac_in_use = NULL; - } -} - -static void -ovsrec_interface_parse_mtu(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->mtu = NULL; - row->n_mtu = 0; - for (i = 0; i < n; i++) { - if (!row->n_mtu) { - row->mtu = xmalloc(n * sizeof *row->mtu); - } - row->mtu[row->n_mtu] = datum->keys[i].integer; - row->n_mtu++; - } -} - -static void -ovsrec_interface_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -ovsrec_interface_parse_ofport(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->ofport = NULL; - row->n_ofport = 0; - for (i = 0; i < n; i++) { - if (!row->n_ofport) { - row->ofport = xmalloc(n * sizeof *row->ofport); - } - row->ofport[row->n_ofport] = datum->keys[i].integer; - row->n_ofport++; - } -} - -static void -ovsrec_interface_parse_ofport_request(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->ofport_request = NULL; - row->n_ofport_request = 0; - for (i = 0; i < n; i++) { - if (!row->n_ofport_request) { - row->ofport_request = xmalloc(n * sizeof *row->ofport_request); - } - row->ofport_request[row->n_ofport_request] = datum->keys[i].integer; - row->n_ofport_request++; - } -} - -static void -ovsrec_interface_parse_options(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->options); - for (i = 0; i < datum->n; i++) { - smap_add(&row->options, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_interface_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_interface_parse_statistics(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_statistics = NULL; - row->value_statistics = NULL; - row->n_statistics = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_statistics) { - row->key_statistics = xmalloc(datum->n * sizeof *row->key_statistics); - row->value_statistics = xmalloc(datum->n * sizeof *row->value_statistics); - } - row->key_statistics[row->n_statistics] = datum->keys[i].string; - row->value_statistics[row->n_statistics] = datum->values[i].integer; - row->n_statistics++; - } -} - -static void -ovsrec_interface_parse_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_interface_parse_type(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->type = datum->keys[0].string; - } else { - row->type = ""; - } -} - -static void -ovsrec_interface_unparse_admin_state(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_bfd(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->bfd); -} - -static void -ovsrec_interface_unparse_bfd_status(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->bfd_status); -} - -static void -ovsrec_interface_unparse_cfm_fault(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->cfm_fault); -} - -static void -ovsrec_interface_unparse_cfm_fault_status(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->cfm_fault_status); -} - -static void -ovsrec_interface_unparse_cfm_flap_count(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->cfm_flap_count); -} - -static void -ovsrec_interface_unparse_cfm_health(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->cfm_health); -} - -static void -ovsrec_interface_unparse_cfm_mpid(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->cfm_mpid); -} - -static void -ovsrec_interface_unparse_cfm_remote_mpids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->cfm_remote_mpids); -} - -static void -ovsrec_interface_unparse_cfm_remote_opstate(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_duplex(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_interface_unparse_ifindex(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->ifindex); -} - -static void -ovsrec_interface_unparse_ingress_policing_burst(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_ingress_policing_rate(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_lacp_current(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->lacp_current); -} - -static void -ovsrec_interface_unparse_link_resets(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->link_resets); -} - -static void -ovsrec_interface_unparse_link_speed(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->link_speed); -} - -static void -ovsrec_interface_unparse_link_state(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_mac(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_mac_in_use(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_mtu(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->mtu); -} - -static void -ovsrec_interface_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_unparse_ofport(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->ofport); -} - -static void -ovsrec_interface_unparse_ofport_request(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->ofport_request); -} - -static void -ovsrec_interface_unparse_options(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->options); -} - -static void -ovsrec_interface_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_interface_unparse_statistics(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - free(row->key_statistics); - free(row->value_statistics); -} - -static void -ovsrec_interface_unparse_status(struct ovsdb_idl_row *row_) -{ - struct ovsrec_interface *row = ovsrec_interface_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->status); -} - -static void -ovsrec_interface_unparse_type(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_interface_init__(struct ovsdb_idl_row *row) -{ - ovsrec_interface_init(ovsrec_interface_cast(row)); -} - -void -ovsrec_interface_init(struct ovsrec_interface *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->bfd); - smap_init(&row->bfd_status); - smap_init(&row->external_ids); - smap_init(&row->options); - smap_init(&row->other_config); - smap_init(&row->status); -} - -const struct ovsrec_interface * -ovsrec_interface_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_interface_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_INTERFACE], uuid)); -} - -const struct ovsrec_interface * -ovsrec_interface_first(const struct ovsdb_idl *idl) -{ - return ovsrec_interface_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_INTERFACE])); -} - -const struct ovsrec_interface * -ovsrec_interface_next(const struct ovsrec_interface *row) -{ - return ovsrec_interface_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_interface_delete(const struct ovsrec_interface *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_interface * -ovsrec_interface_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_interface_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_INTERFACE], NULL)); -} - - -void -ovsrec_interface_verify_admin_state(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_ADMIN_STATE]); -} - -void -ovsrec_interface_verify_bfd(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_BFD]); -} - -void -ovsrec_interface_verify_bfd_status(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_BFD_STATUS]); -} - -void -ovsrec_interface_verify_cfm_fault(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FAULT]); -} - -void -ovsrec_interface_verify_cfm_fault_status(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FAULT_STATUS]); -} - -void -ovsrec_interface_verify_cfm_flap_count(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FLAP_COUNT]); -} - -void -ovsrec_interface_verify_cfm_health(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_HEALTH]); -} - -void -ovsrec_interface_verify_cfm_mpid(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_MPID]); -} - -void -ovsrec_interface_verify_cfm_remote_mpids(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_REMOTE_MPIDS]); -} - -void -ovsrec_interface_verify_cfm_remote_opstate(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_REMOTE_OPSTATE]); -} - -void -ovsrec_interface_verify_duplex(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_DUPLEX]); -} - -void -ovsrec_interface_verify_external_ids(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_EXTERNAL_IDS]); -} - -void -ovsrec_interface_verify_ifindex(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_IFINDEX]); -} - -void -ovsrec_interface_verify_ingress_policing_burst(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_INGRESS_POLICING_BURST]); -} - -void -ovsrec_interface_verify_ingress_policing_rate(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_INGRESS_POLICING_RATE]); -} - -void -ovsrec_interface_verify_lacp_current(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LACP_CURRENT]); -} - -void -ovsrec_interface_verify_link_resets(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_RESETS]); -} - -void -ovsrec_interface_verify_link_speed(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_SPEED]); -} - -void -ovsrec_interface_verify_link_state(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_STATE]); -} - -void -ovsrec_interface_verify_mac(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_MAC]); -} - -void -ovsrec_interface_verify_mac_in_use(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_MAC_IN_USE]); -} - -void -ovsrec_interface_verify_mtu(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_MTU]); -} - -void -ovsrec_interface_verify_name(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_NAME]); -} - -void -ovsrec_interface_verify_ofport(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OFPORT]); -} - -void -ovsrec_interface_verify_ofport_request(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OFPORT_REQUEST]); -} - -void -ovsrec_interface_verify_options(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OPTIONS]); -} - -void -ovsrec_interface_verify_other_config(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OTHER_CONFIG]); -} - -void -ovsrec_interface_verify_statistics(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_STATISTICS]); -} - -void -ovsrec_interface_verify_status(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_STATUS]); -} - -void -ovsrec_interface_verify_type(const struct ovsrec_interface *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_TYPE]); -} - -/* Returns the admin_state column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes admin_state's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_admin_state(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_admin_state); -} - -/* Returns the bfd column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bfd's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_bfd(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_bfd); -} - -/* Returns the bfd_status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bfd_status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_bfd_status(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_bfd_status); -} - -/* Returns the cfm_fault column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes cfm_fault's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_cfm_fault(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_cfm_fault); -} - -/* Returns the cfm_fault_status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes cfm_fault_status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_cfm_fault_status(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_cfm_fault_status); -} - -/* Returns the cfm_flap_count column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes cfm_flap_count's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_cfm_flap_count(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_cfm_flap_count); -} - -/* Returns the cfm_health column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes cfm_health's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_cfm_health(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_cfm_health); -} - -/* Returns the cfm_mpid column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes cfm_mpid's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_cfm_mpid(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_cfm_mpid); -} - -/* Returns the cfm_remote_mpids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes cfm_remote_mpids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_cfm_remote_mpids(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_cfm_remote_mpids); -} - -/* Returns the cfm_remote_opstate column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes cfm_remote_opstate's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_cfm_remote_opstate(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_cfm_remote_opstate); -} - -/* Returns the duplex column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes duplex's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_duplex(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_duplex); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_external_ids(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_external_ids); -} - -/* Returns the ifindex column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes ifindex's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_ifindex(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_ifindex); -} - -/* Returns the ingress_policing_burst column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes ingress_policing_burst's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_ingress_policing_burst(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_ingress_policing_burst); -} - -/* Returns the ingress_policing_rate column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes ingress_policing_rate's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_ingress_policing_rate(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_ingress_policing_rate); -} - -/* Returns the lacp_current column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes lacp_current's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_lacp_current(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_lacp_current); -} - -/* Returns the link_resets column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes link_resets's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_link_resets(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_link_resets); -} - -/* Returns the link_speed column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes link_speed's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_link_speed(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_link_speed); -} - -/* Returns the link_state column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes link_state's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_link_state(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_link_state); -} - -/* Returns the mac column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes mac's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_mac(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_mac); -} - -/* Returns the mac_in_use column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes mac_in_use's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_mac_in_use(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_mac_in_use); -} - -/* Returns the mtu column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes mtu's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_mtu(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_mtu); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_name(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_name); -} - -/* Returns the ofport column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes ofport's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_ofport(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_ofport); -} - -/* Returns the ofport_request column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes ofport_request's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_ofport_request(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_ofport_request); -} - -/* Returns the options column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes options's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_options(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_options); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_other_config(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_other_config); -} - -/* Returns the statistics column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes statistics's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_statistics(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_statistics); -} - -/* Returns the status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_status(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_status); -} - -/* Returns the type column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes type's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_interface_get_type(const struct ovsrec_interface *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_interface_col_type); -} - -void -ovsrec_interface_set_admin_state(const struct ovsrec_interface *row, const char *admin_state) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (admin_state) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, admin_state); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_ADMIN_STATE], &datum); -} - -void -ovsrec_interface_set_bfd(const struct ovsrec_interface *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_interface_columns[OVSREC_INTERFACE_COL_BFD], - &datum); -} - - -void -ovsrec_interface_set_bfd_status(const struct ovsrec_interface *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_interface_columns[OVSREC_INTERFACE_COL_BFD_STATUS], - &datum); -} - - -void -ovsrec_interface_set_cfm_fault(const struct ovsrec_interface *row, const bool *cfm_fault, size_t n_cfm_fault) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_cfm_fault) { - datum.n = 1; - datum.keys = &key; - key.boolean = *cfm_fault; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FAULT], &datum); -} - -void -ovsrec_interface_set_cfm_fault_status(const struct ovsrec_interface *row, char **cfm_fault_status, size_t n_cfm_fault_status) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_cfm_fault_status; - datum.keys = n_cfm_fault_status ? xmalloc(n_cfm_fault_status * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_cfm_fault_status; i++) { - datum.keys[i].string = xstrdup(cfm_fault_status[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FAULT_STATUS], &datum); -} - -void -ovsrec_interface_set_cfm_flap_count(const struct ovsrec_interface *row, const int64_t *cfm_flap_count, size_t n_cfm_flap_count) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_cfm_flap_count) { - datum.n = 1; - datum.keys = &key; - key.integer = *cfm_flap_count; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FLAP_COUNT], &datum); -} - -void -ovsrec_interface_set_cfm_health(const struct ovsrec_interface *row, const int64_t *cfm_health, size_t n_cfm_health) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_cfm_health) { - datum.n = 1; - datum.keys = &key; - key.integer = *cfm_health; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_HEALTH], &datum); -} - -void -ovsrec_interface_set_cfm_mpid(const struct ovsrec_interface *row, const int64_t *cfm_mpid, size_t n_cfm_mpid) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_cfm_mpid) { - datum.n = 1; - datum.keys = &key; - key.integer = *cfm_mpid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_MPID], &datum); -} - -void -ovsrec_interface_set_cfm_remote_mpids(const struct ovsrec_interface *row, const int64_t *cfm_remote_mpids, size_t n_cfm_remote_mpids) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_cfm_remote_mpids; - datum.keys = n_cfm_remote_mpids ? xmalloc(n_cfm_remote_mpids * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_cfm_remote_mpids; i++) { - datum.keys[i].integer = cfm_remote_mpids[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_REMOTE_MPIDS], &datum); -} - -void -ovsrec_interface_set_cfm_remote_opstate(const struct ovsrec_interface *row, const char *cfm_remote_opstate) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (cfm_remote_opstate) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, cfm_remote_opstate); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_REMOTE_OPSTATE], &datum); -} - -void -ovsrec_interface_set_duplex(const struct ovsrec_interface *row, const char *duplex) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (duplex) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, duplex); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_DUPLEX], &datum); -} - -void -ovsrec_interface_set_external_ids(const struct ovsrec_interface *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_interface_columns[OVSREC_INTERFACE_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_interface_set_ifindex(const struct ovsrec_interface *row, const int64_t *ifindex, size_t n_ifindex) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_ifindex) { - datum.n = 1; - datum.keys = &key; - key.integer = *ifindex; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_IFINDEX], &datum); -} - -void -ovsrec_interface_set_ingress_policing_burst(const struct ovsrec_interface *row, int64_t ingress_policing_burst) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = ingress_policing_burst; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_INGRESS_POLICING_BURST], &datum); -} - -void -ovsrec_interface_set_ingress_policing_rate(const struct ovsrec_interface *row, int64_t ingress_policing_rate) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = ingress_policing_rate; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_INGRESS_POLICING_RATE], &datum); -} - -void -ovsrec_interface_set_lacp_current(const struct ovsrec_interface *row, const bool *lacp_current, size_t n_lacp_current) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_lacp_current) { - datum.n = 1; - datum.keys = &key; - key.boolean = *lacp_current; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LACP_CURRENT], &datum); -} - -void -ovsrec_interface_set_link_resets(const struct ovsrec_interface *row, const int64_t *link_resets, size_t n_link_resets) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_link_resets) { - datum.n = 1; - datum.keys = &key; - key.integer = *link_resets; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_RESETS], &datum); -} - -void -ovsrec_interface_set_link_speed(const struct ovsrec_interface *row, const int64_t *link_speed, size_t n_link_speed) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_link_speed) { - datum.n = 1; - datum.keys = &key; - key.integer = *link_speed; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_SPEED], &datum); -} - -void -ovsrec_interface_set_link_state(const struct ovsrec_interface *row, const char *link_state) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (link_state) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, link_state); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_STATE], &datum); -} - -void -ovsrec_interface_set_mac(const struct ovsrec_interface *row, const char *mac) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (mac) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, mac); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_MAC], &datum); -} - -void -ovsrec_interface_set_mac_in_use(const struct ovsrec_interface *row, const char *mac_in_use) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (mac_in_use) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, mac_in_use); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_MAC_IN_USE], &datum); -} - -void -ovsrec_interface_set_mtu(const struct ovsrec_interface *row, const int64_t *mtu, size_t n_mtu) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_mtu) { - datum.n = 1; - datum.keys = &key; - key.integer = *mtu; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_MTU], &datum); -} - -void -ovsrec_interface_set_name(const struct ovsrec_interface *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_NAME], &datum); -} - -void -ovsrec_interface_set_ofport(const struct ovsrec_interface *row, const int64_t *ofport, size_t n_ofport) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_ofport) { - datum.n = 1; - datum.keys = &key; - key.integer = *ofport; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OFPORT], &datum); -} - -void -ovsrec_interface_set_ofport_request(const struct ovsrec_interface *row, const int64_t *ofport_request, size_t n_ofport_request) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_ofport_request) { - datum.n = 1; - datum.keys = &key; - key.integer = *ofport_request; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OFPORT_REQUEST], &datum); -} - -void -ovsrec_interface_set_options(const struct ovsrec_interface *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OPTIONS], - &datum); -} - - -void -ovsrec_interface_set_other_config(const struct ovsrec_interface *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_interface_columns[OVSREC_INTERFACE_COL_OTHER_CONFIG], - &datum); -} - - -void -ovsrec_interface_set_statistics(const struct ovsrec_interface *row, char **key_statistics, const int64_t *value_statistics, size_t n_statistics) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_statistics; - datum.keys = n_statistics ? xmalloc(n_statistics * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_statistics * sizeof *datum.values); - for (i = 0; i < n_statistics; i++) { - datum.keys[i].string = xstrdup(key_statistics[i]); - datum.values[i].integer = value_statistics[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_INTEGER); - ovsdb_idl_txn_write(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_STATISTICS], &datum); -} - -void -ovsrec_interface_set_status(const struct ovsrec_interface *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_interface_columns[OVSREC_INTERFACE_COL_STATUS], - &datum); -} - - -void -ovsrec_interface_set_type(const struct ovsrec_interface *row, const char *type) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, type); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_interface_columns[OVSREC_INTERFACE_COL_TYPE], &datum); -} - -struct ovsdb_idl_column ovsrec_interface_columns[OVSREC_INTERFACE_N_COLUMNS]; - -static void -ovsrec_interface_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_interface_col_admin_state. */ - c = &ovsrec_interface_col_admin_state; - c->name = "admin_state"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("down"); - c->type.key.enum_->keys[1].string = xstrdup("up"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_admin_state; - c->unparse = ovsrec_interface_unparse_admin_state; - - /* Initialize ovsrec_interface_col_bfd. */ - c = &ovsrec_interface_col_bfd; - c->name = "bfd"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_bfd; - c->unparse = ovsrec_interface_unparse_bfd; - - /* Initialize ovsrec_interface_col_bfd_status. */ - c = &ovsrec_interface_col_bfd_status; - c->name = "bfd_status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_bfd_status; - c->unparse = ovsrec_interface_unparse_bfd_status; - - /* Initialize ovsrec_interface_col_cfm_fault. */ - c = &ovsrec_interface_col_cfm_fault; - c->name = "cfm_fault"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_cfm_fault; - c->unparse = ovsrec_interface_unparse_cfm_fault; - - /* Initialize ovsrec_interface_col_cfm_fault_status. */ - c = &ovsrec_interface_col_cfm_fault_status; - c->name = "cfm_fault_status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_cfm_fault_status; - c->unparse = ovsrec_interface_unparse_cfm_fault_status; - - /* Initialize ovsrec_interface_col_cfm_flap_count. */ - c = &ovsrec_interface_col_cfm_flap_count; - c->name = "cfm_flap_count"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_cfm_flap_count; - c->unparse = ovsrec_interface_unparse_cfm_flap_count; - - /* Initialize ovsrec_interface_col_cfm_health. */ - c = &ovsrec_interface_col_cfm_health; - c->name = "cfm_health"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(100); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_cfm_health; - c->unparse = ovsrec_interface_unparse_cfm_health; - - /* Initialize ovsrec_interface_col_cfm_mpid. */ - c = &ovsrec_interface_col_cfm_mpid; - c->name = "cfm_mpid"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_cfm_mpid; - c->unparse = ovsrec_interface_unparse_cfm_mpid; - - /* Initialize ovsrec_interface_col_cfm_remote_mpids. */ - c = &ovsrec_interface_col_cfm_remote_mpids; - c->name = "cfm_remote_mpids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_cfm_remote_mpids; - c->unparse = ovsrec_interface_unparse_cfm_remote_mpids; - - /* Initialize ovsrec_interface_col_cfm_remote_opstate. */ - c = &ovsrec_interface_col_cfm_remote_opstate; - c->name = "cfm_remote_opstate"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("down"); - c->type.key.enum_->keys[1].string = xstrdup("up"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_cfm_remote_opstate; - c->unparse = ovsrec_interface_unparse_cfm_remote_opstate; - - /* Initialize ovsrec_interface_col_duplex. */ - c = &ovsrec_interface_col_duplex; - c->name = "duplex"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("full"); - c->type.key.enum_->keys[1].string = xstrdup("half"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_duplex; - c->unparse = ovsrec_interface_unparse_duplex; - - /* Initialize ovsrec_interface_col_external_ids. */ - c = &ovsrec_interface_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_external_ids; - c->unparse = ovsrec_interface_unparse_external_ids; - - /* Initialize ovsrec_interface_col_ifindex. */ - c = &ovsrec_interface_col_ifindex; - c->name = "ifindex"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4294967295); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_ifindex; - c->unparse = ovsrec_interface_unparse_ifindex; - - /* Initialize ovsrec_interface_col_ingress_policing_burst. */ - c = &ovsrec_interface_col_ingress_policing_burst; - c->name = "ingress_policing_burst"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_ingress_policing_burst; - c->unparse = ovsrec_interface_unparse_ingress_policing_burst; - - /* Initialize ovsrec_interface_col_ingress_policing_rate. */ - c = &ovsrec_interface_col_ingress_policing_rate; - c->name = "ingress_policing_rate"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_ingress_policing_rate; - c->unparse = ovsrec_interface_unparse_ingress_policing_rate; - - /* Initialize ovsrec_interface_col_lacp_current. */ - c = &ovsrec_interface_col_lacp_current; - c->name = "lacp_current"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_lacp_current; - c->unparse = ovsrec_interface_unparse_lacp_current; - - /* Initialize ovsrec_interface_col_link_resets. */ - c = &ovsrec_interface_col_link_resets; - c->name = "link_resets"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_link_resets; - c->unparse = ovsrec_interface_unparse_link_resets; - - /* Initialize ovsrec_interface_col_link_speed. */ - c = &ovsrec_interface_col_link_speed; - c->name = "link_speed"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_link_speed; - c->unparse = ovsrec_interface_unparse_link_speed; - - /* Initialize ovsrec_interface_col_link_state. */ - c = &ovsrec_interface_col_link_state; - c->name = "link_state"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("down"); - c->type.key.enum_->keys[1].string = xstrdup("up"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_link_state; - c->unparse = ovsrec_interface_unparse_link_state; - - /* Initialize ovsrec_interface_col_mac. */ - c = &ovsrec_interface_col_mac; - c->name = "mac"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_mac; - c->unparse = ovsrec_interface_unparse_mac; - - /* Initialize ovsrec_interface_col_mac_in_use. */ - c = &ovsrec_interface_col_mac_in_use; - c->name = "mac_in_use"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_mac_in_use; - c->unparse = ovsrec_interface_unparse_mac_in_use; - - /* Initialize ovsrec_interface_col_mtu. */ - c = &ovsrec_interface_col_mtu; - c->name = "mtu"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_mtu; - c->unparse = ovsrec_interface_unparse_mtu; - - /* Initialize ovsrec_interface_col_name. */ - c = &ovsrec_interface_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = false; - c->parse = ovsrec_interface_parse_name; - c->unparse = ovsrec_interface_unparse_name; - - /* Initialize ovsrec_interface_col_ofport. */ - c = &ovsrec_interface_col_ofport; - c->name = "ofport"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_ofport; - c->unparse = ovsrec_interface_unparse_ofport; - - /* Initialize ovsrec_interface_col_ofport_request. */ - c = &ovsrec_interface_col_ofport_request; - c->name = "ofport_request"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(1); - c->type.key.u.integer.max = INT64_C(65279); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_ofport_request; - c->unparse = ovsrec_interface_unparse_ofport_request; - - /* Initialize ovsrec_interface_col_options. */ - c = &ovsrec_interface_col_options; - c->name = "options"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_options; - c->unparse = ovsrec_interface_unparse_options; - - /* Initialize ovsrec_interface_col_other_config. */ - c = &ovsrec_interface_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_other_config; - c->unparse = ovsrec_interface_unparse_other_config; - - /* Initialize ovsrec_interface_col_statistics. */ - c = &ovsrec_interface_col_statistics; - c->name = "statistics"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_INTEGER); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_statistics; - c->unparse = ovsrec_interface_unparse_statistics; - - /* Initialize ovsrec_interface_col_status. */ - c = &ovsrec_interface_col_status; - c->name = "status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_interface_parse_status; - c->unparse = ovsrec_interface_unparse_status; - - /* Initialize ovsrec_interface_col_type. */ - c = &ovsrec_interface_col_type; - c->name = "type"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_interface_parse_type; - c->unparse = ovsrec_interface_unparse_type; -} - -/* Manager table. */ - -static void -ovsrec_manager_parse_connection_mode(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->connection_mode = datum->keys[0].string; - } else { - row->connection_mode = NULL; - } -} - -static void -ovsrec_manager_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_manager_parse_inactivity_probe(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->inactivity_probe = NULL; - row->n_inactivity_probe = 0; - for (i = 0; i < n; i++) { - if (!row->n_inactivity_probe) { - row->inactivity_probe = xmalloc(n * sizeof *row->inactivity_probe); - } - row->inactivity_probe[row->n_inactivity_probe] = datum->keys[i].integer; - row->n_inactivity_probe++; - } -} - -static void -ovsrec_manager_parse_is_connected(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->is_connected = datum->keys[0].boolean; - } else { - row->is_connected = false; - } -} - -static void -ovsrec_manager_parse_max_backoff(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->max_backoff = NULL; - row->n_max_backoff = 0; - for (i = 0; i < n; i++) { - if (!row->n_max_backoff) { - row->max_backoff = xmalloc(n * sizeof *row->max_backoff); - } - row->max_backoff[row->n_max_backoff] = datum->keys[i].integer; - row->n_max_backoff++; - } -} - -static void -ovsrec_manager_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_manager_parse_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_manager_parse_target(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->target = datum->keys[0].string; - } else { - row->target = ""; - } -} - -static void -ovsrec_manager_unparse_connection_mode(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_manager_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_manager_unparse_inactivity_probe(struct ovsdb_idl_row *row_) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - free(row->inactivity_probe); -} - -static void -ovsrec_manager_unparse_is_connected(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_manager_unparse_max_backoff(struct ovsdb_idl_row *row_) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - free(row->max_backoff); -} - -static void -ovsrec_manager_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_manager_unparse_status(struct ovsdb_idl_row *row_) -{ - struct ovsrec_manager *row = ovsrec_manager_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->status); -} - -static void -ovsrec_manager_unparse_target(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_manager_init__(struct ovsdb_idl_row *row) -{ - ovsrec_manager_init(ovsrec_manager_cast(row)); -} - -void -ovsrec_manager_init(struct ovsrec_manager *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); - smap_init(&row->other_config); - smap_init(&row->status); -} - -const struct ovsrec_manager * -ovsrec_manager_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_manager_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_MANAGER], uuid)); -} - -const struct ovsrec_manager * -ovsrec_manager_first(const struct ovsdb_idl *idl) -{ - return ovsrec_manager_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_MANAGER])); -} - -const struct ovsrec_manager * -ovsrec_manager_next(const struct ovsrec_manager *row) -{ - return ovsrec_manager_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_manager_delete(const struct ovsrec_manager *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_manager * -ovsrec_manager_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_manager_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_MANAGER], NULL)); -} - - -void -ovsrec_manager_verify_connection_mode(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_CONNECTION_MODE]); -} - -void -ovsrec_manager_verify_external_ids(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_EXTERNAL_IDS]); -} - -void -ovsrec_manager_verify_inactivity_probe(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_INACTIVITY_PROBE]); -} - -void -ovsrec_manager_verify_is_connected(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_IS_CONNECTED]); -} - -void -ovsrec_manager_verify_max_backoff(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_MAX_BACKOFF]); -} - -void -ovsrec_manager_verify_other_config(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_OTHER_CONFIG]); -} - -void -ovsrec_manager_verify_status(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_STATUS]); -} - -void -ovsrec_manager_verify_target(const struct ovsrec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_TARGET]); -} - -/* Returns the connection_mode column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes connection_mode's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_connection_mode(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_connection_mode); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_external_ids(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_external_ids); -} - -/* Returns the inactivity_probe column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes inactivity_probe's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_inactivity_probe(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_inactivity_probe); -} - -/* Returns the is_connected column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes is_connected's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_is_connected(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_is_connected); -} - -/* Returns the max_backoff column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes max_backoff's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_max_backoff(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_max_backoff); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_other_config(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_other_config); -} - -/* Returns the status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_status(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_status); -} - -/* Returns the target column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes target's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_manager_get_target(const struct ovsrec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_manager_col_target); -} - -void -ovsrec_manager_set_connection_mode(const struct ovsrec_manager *row, const char *connection_mode) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (connection_mode) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, connection_mode); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_CONNECTION_MODE], &datum); -} - -void -ovsrec_manager_set_external_ids(const struct ovsrec_manager *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_manager_columns[OVSREC_MANAGER_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_manager_set_inactivity_probe(const struct ovsrec_manager *row, const int64_t *inactivity_probe, size_t n_inactivity_probe) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_inactivity_probe) { - datum.n = 1; - datum.keys = &key; - key.integer = *inactivity_probe; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_INACTIVITY_PROBE], &datum); -} - -void -ovsrec_manager_set_is_connected(const struct ovsrec_manager *row, bool is_connected) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = is_connected; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_IS_CONNECTED], &datum); -} - -void -ovsrec_manager_set_max_backoff(const struct ovsrec_manager *row, const int64_t *max_backoff, size_t n_max_backoff) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_max_backoff) { - datum.n = 1; - datum.keys = &key; - key.integer = *max_backoff; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_MAX_BACKOFF], &datum); -} - -void -ovsrec_manager_set_other_config(const struct ovsrec_manager *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_manager_columns[OVSREC_MANAGER_COL_OTHER_CONFIG], - &datum); -} - - -void -ovsrec_manager_set_status(const struct ovsrec_manager *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_manager_columns[OVSREC_MANAGER_COL_STATUS], - &datum); -} - - -void -ovsrec_manager_set_target(const struct ovsrec_manager *row, const char *target) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, target); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_manager_columns[OVSREC_MANAGER_COL_TARGET], &datum); -} - -struct ovsdb_idl_column ovsrec_manager_columns[OVSREC_MANAGER_N_COLUMNS]; - -static void -ovsrec_manager_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_manager_col_connection_mode. */ - c = &ovsrec_manager_col_connection_mode; - c->name = "connection_mode"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 2; - c->type.key.enum_->keys = xmalloc(2 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("in-band"); - c->type.key.enum_->keys[1].string = xstrdup("out-of-band"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_manager_parse_connection_mode; - c->unparse = ovsrec_manager_unparse_connection_mode; - - /* Initialize ovsrec_manager_col_external_ids. */ - c = &ovsrec_manager_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_manager_parse_external_ids; - c->unparse = ovsrec_manager_unparse_external_ids; - - /* Initialize ovsrec_manager_col_inactivity_probe. */ - c = &ovsrec_manager_col_inactivity_probe; - c->name = "inactivity_probe"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_manager_parse_inactivity_probe; - c->unparse = ovsrec_manager_unparse_inactivity_probe; - - /* Initialize ovsrec_manager_col_is_connected. */ - c = &ovsrec_manager_col_is_connected; - c->name = "is_connected"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_manager_parse_is_connected; - c->unparse = ovsrec_manager_unparse_is_connected; - - /* Initialize ovsrec_manager_col_max_backoff. */ - c = &ovsrec_manager_col_max_backoff; - c->name = "max_backoff"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(1000); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_manager_parse_max_backoff; - c->unparse = ovsrec_manager_unparse_max_backoff; - - /* Initialize ovsrec_manager_col_other_config. */ - c = &ovsrec_manager_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_manager_parse_other_config; - c->unparse = ovsrec_manager_unparse_other_config; - - /* Initialize ovsrec_manager_col_status. */ - c = &ovsrec_manager_col_status; - c->name = "status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_manager_parse_status; - c->unparse = ovsrec_manager_unparse_status; - - /* Initialize ovsrec_manager_col_target. */ - c = &ovsrec_manager_col_target; - c->name = "target"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_manager_parse_target; - c->unparse = ovsrec_manager_unparse_target; -} - -/* Mirror table. */ - -static void -ovsrec_mirror_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_mirror_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -ovsrec_mirror_parse_output_port(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->output_port = ovsrec_port_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_PORT], &datum->keys[0].uuid)); - } else { - row->output_port = NULL; - } -} - -static void -ovsrec_mirror_parse_output_vlan(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->output_vlan = NULL; - row->n_output_vlan = 0; - for (i = 0; i < n; i++) { - if (!row->n_output_vlan) { - row->output_vlan = xmalloc(n * sizeof *row->output_vlan); - } - row->output_vlan[row->n_output_vlan] = datum->keys[i].integer; - row->n_output_vlan++; - } -} - -static void -ovsrec_mirror_parse_select_all(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->select_all = datum->keys[0].boolean; - } else { - row->select_all = false; - } -} - -static void -ovsrec_mirror_parse_select_dst_port(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - size_t i; - - ovs_assert(inited); - row->select_dst_port = NULL; - row->n_select_dst_port = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_port *keyRow = ovsrec_port_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_PORT], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_select_dst_port) { - row->select_dst_port = xmalloc(datum->n * sizeof *row->select_dst_port); - } - row->select_dst_port[row->n_select_dst_port] = keyRow; - row->n_select_dst_port++; - } - } -} - -static void -ovsrec_mirror_parse_select_src_port(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - size_t i; - - ovs_assert(inited); - row->select_src_port = NULL; - row->n_select_src_port = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_port *keyRow = ovsrec_port_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_PORT], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_select_src_port) { - row->select_src_port = xmalloc(datum->n * sizeof *row->select_src_port); - } - row->select_src_port[row->n_select_src_port] = keyRow; - row->n_select_src_port++; - } - } -} - -static void -ovsrec_mirror_parse_select_vlan(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - size_t n = MIN(4096, datum->n); - size_t i; - - ovs_assert(inited); - row->select_vlan = NULL; - row->n_select_vlan = 0; - for (i = 0; i < n; i++) { - if (!row->n_select_vlan) { - row->select_vlan = xmalloc(n * sizeof *row->select_vlan); - } - row->select_vlan[row->n_select_vlan] = datum->keys[i].integer; - row->n_select_vlan++; - } -} - -static void -ovsrec_mirror_parse_statistics(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_statistics = NULL; - row->value_statistics = NULL; - row->n_statistics = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_statistics) { - row->key_statistics = xmalloc(datum->n * sizeof *row->key_statistics); - row->value_statistics = xmalloc(datum->n * sizeof *row->value_statistics); - } - row->key_statistics[row->n_statistics] = datum->keys[i].string; - row->value_statistics[row->n_statistics] = datum->values[i].integer; - row->n_statistics++; - } -} - -static void -ovsrec_mirror_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_mirror_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_mirror_unparse_output_port(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_mirror_unparse_output_vlan(struct ovsdb_idl_row *row_) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - free(row->output_vlan); -} - -static void -ovsrec_mirror_unparse_select_all(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_mirror_unparse_select_dst_port(struct ovsdb_idl_row *row_) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - free(row->select_dst_port); -} - -static void -ovsrec_mirror_unparse_select_src_port(struct ovsdb_idl_row *row_) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - free(row->select_src_port); -} - -static void -ovsrec_mirror_unparse_select_vlan(struct ovsdb_idl_row *row_) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - free(row->select_vlan); -} - -static void -ovsrec_mirror_unparse_statistics(struct ovsdb_idl_row *row_) -{ - struct ovsrec_mirror *row = ovsrec_mirror_cast(row_); - - ovs_assert(inited); - free(row->key_statistics); - free(row->value_statistics); -} - -static void -ovsrec_mirror_init__(struct ovsdb_idl_row *row) -{ - ovsrec_mirror_init(ovsrec_mirror_cast(row)); -} - -void -ovsrec_mirror_init(struct ovsrec_mirror *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); -} - -const struct ovsrec_mirror * -ovsrec_mirror_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_mirror_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_MIRROR], uuid)); -} - -const struct ovsrec_mirror * -ovsrec_mirror_first(const struct ovsdb_idl *idl) -{ - return ovsrec_mirror_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_MIRROR])); -} - -const struct ovsrec_mirror * -ovsrec_mirror_next(const struct ovsrec_mirror *row) -{ - return ovsrec_mirror_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_mirror_delete(const struct ovsrec_mirror *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_mirror * -ovsrec_mirror_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_mirror_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_MIRROR], NULL)); -} - - -void -ovsrec_mirror_verify_external_ids(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_EXTERNAL_IDS]); -} - -void -ovsrec_mirror_verify_name(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_NAME]); -} - -void -ovsrec_mirror_verify_output_port(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_OUTPUT_PORT]); -} - -void -ovsrec_mirror_verify_output_vlan(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_OUTPUT_VLAN]); -} - -void -ovsrec_mirror_verify_select_all(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_ALL]); -} - -void -ovsrec_mirror_verify_select_dst_port(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_DST_PORT]); -} - -void -ovsrec_mirror_verify_select_src_port(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_SRC_PORT]); -} - -void -ovsrec_mirror_verify_select_vlan(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_VLAN]); -} - -void -ovsrec_mirror_verify_statistics(const struct ovsrec_mirror *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_STATISTICS]); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_external_ids(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_external_ids); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_name(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_name); -} - -/* Returns the output_port column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes output_port's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_output_port(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_output_port); -} - -/* Returns the output_vlan column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes output_vlan's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_output_vlan(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_output_vlan); -} - -/* Returns the select_all column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes select_all's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_select_all(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_select_all); -} - -/* Returns the select_dst_port column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes select_dst_port's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_select_dst_port(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_select_dst_port); -} - -/* Returns the select_src_port column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes select_src_port's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_select_src_port(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_select_src_port); -} - -/* Returns the select_vlan column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes select_vlan's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_select_vlan(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_select_vlan); -} - -/* Returns the statistics column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes statistics's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_mirror_get_statistics(const struct ovsrec_mirror *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_mirror_col_statistics); -} - -void -ovsrec_mirror_set_external_ids(const struct ovsrec_mirror *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_mirror_columns[OVSREC_MIRROR_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_mirror_set_name(const struct ovsrec_mirror *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_NAME], &datum); -} - -void -ovsrec_mirror_set_output_port(const struct ovsrec_mirror *row, const struct ovsrec_port *output_port) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (output_port) { - datum.n = 1; - datum.keys = &key; - key.uuid = output_port->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_OUTPUT_PORT], &datum); -} - -void -ovsrec_mirror_set_output_vlan(const struct ovsrec_mirror *row, const int64_t *output_vlan, size_t n_output_vlan) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_output_vlan) { - datum.n = 1; - datum.keys = &key; - key.integer = *output_vlan; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_OUTPUT_VLAN], &datum); -} - -void -ovsrec_mirror_set_select_all(const struct ovsrec_mirror *row, bool select_all) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = select_all; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_ALL], &datum); -} - -void -ovsrec_mirror_set_select_dst_port(const struct ovsrec_mirror *row, struct ovsrec_port **select_dst_port, size_t n_select_dst_port) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_select_dst_port; - datum.keys = n_select_dst_port ? xmalloc(n_select_dst_port * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_select_dst_port; i++) { - datum.keys[i].uuid = select_dst_port[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_DST_PORT], &datum); -} - -void -ovsrec_mirror_set_select_src_port(const struct ovsrec_mirror *row, struct ovsrec_port **select_src_port, size_t n_select_src_port) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_select_src_port; - datum.keys = n_select_src_port ? xmalloc(n_select_src_port * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_select_src_port; i++) { - datum.keys[i].uuid = select_src_port[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_SRC_PORT], &datum); -} - -void -ovsrec_mirror_set_select_vlan(const struct ovsrec_mirror *row, const int64_t *select_vlan, size_t n_select_vlan) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_select_vlan; - datum.keys = n_select_vlan ? xmalloc(n_select_vlan * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_select_vlan; i++) { - datum.keys[i].integer = select_vlan[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_VLAN], &datum); -} - -void -ovsrec_mirror_set_statistics(const struct ovsrec_mirror *row, char **key_statistics, const int64_t *value_statistics, size_t n_statistics) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_statistics; - datum.keys = n_statistics ? xmalloc(n_statistics * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_statistics * sizeof *datum.values); - for (i = 0; i < n_statistics; i++) { - datum.keys[i].string = xstrdup(key_statistics[i]); - datum.values[i].integer = value_statistics[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_INTEGER); - ovsdb_idl_txn_write(&row->header_, &ovsrec_mirror_columns[OVSREC_MIRROR_COL_STATISTICS], &datum); -} - -struct ovsdb_idl_column ovsrec_mirror_columns[OVSREC_MIRROR_N_COLUMNS]; - -static void -ovsrec_mirror_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_mirror_col_external_ids. */ - c = &ovsrec_mirror_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_mirror_parse_external_ids; - c->unparse = ovsrec_mirror_unparse_external_ids; - - /* Initialize ovsrec_mirror_col_name. */ - c = &ovsrec_mirror_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_mirror_parse_name; - c->unparse = ovsrec_mirror_unparse_name; - - /* Initialize ovsrec_mirror_col_output_port. */ - c = &ovsrec_mirror_col_output_port; - c->name = "output_port"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Port"; - c->type.key.u.uuid.refType = OVSDB_REF_WEAK; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_mirror_parse_output_port; - c->unparse = ovsrec_mirror_unparse_output_port; - - /* Initialize ovsrec_mirror_col_output_vlan. */ - c = &ovsrec_mirror_col_output_vlan; - c->name = "output_vlan"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(1); - c->type.key.u.integer.max = INT64_C(4095); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_mirror_parse_output_vlan; - c->unparse = ovsrec_mirror_unparse_output_vlan; - - /* Initialize ovsrec_mirror_col_select_all. */ - c = &ovsrec_mirror_col_select_all; - c->name = "select_all"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_mirror_parse_select_all; - c->unparse = ovsrec_mirror_unparse_select_all; - - /* Initialize ovsrec_mirror_col_select_dst_port. */ - c = &ovsrec_mirror_col_select_dst_port; - c->name = "select_dst_port"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Port"; - c->type.key.u.uuid.refType = OVSDB_REF_WEAK; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_mirror_parse_select_dst_port; - c->unparse = ovsrec_mirror_unparse_select_dst_port; - - /* Initialize ovsrec_mirror_col_select_src_port. */ - c = &ovsrec_mirror_col_select_src_port; - c->name = "select_src_port"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Port"; - c->type.key.u.uuid.refType = OVSDB_REF_WEAK; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_mirror_parse_select_src_port; - c->unparse = ovsrec_mirror_unparse_select_src_port; - - /* Initialize ovsrec_mirror_col_select_vlan. */ - c = &ovsrec_mirror_col_select_vlan; - c->name = "select_vlan"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4095); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 4096; - c->mutable = true; - c->parse = ovsrec_mirror_parse_select_vlan; - c->unparse = ovsrec_mirror_unparse_select_vlan; - - /* Initialize ovsrec_mirror_col_statistics. */ - c = &ovsrec_mirror_col_statistics; - c->name = "statistics"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_INTEGER); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_mirror_parse_statistics; - c->unparse = ovsrec_mirror_unparse_statistics; -} - -/* NetFlow table. */ - -static void -ovsrec_netflow_parse_active_timeout(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->active_timeout = datum->keys[0].integer; - } else { - row->active_timeout = 0; - } -} - -static void -ovsrec_netflow_parse_add_id_to_interface(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->add_id_to_interface = datum->keys[0].boolean; - } else { - row->add_id_to_interface = false; - } -} - -static void -ovsrec_netflow_parse_engine_id(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->engine_id = NULL; - row->n_engine_id = 0; - for (i = 0; i < n; i++) { - if (!row->n_engine_id) { - row->engine_id = xmalloc(n * sizeof *row->engine_id); - } - row->engine_id[row->n_engine_id] = datum->keys[i].integer; - row->n_engine_id++; - } -} - -static void -ovsrec_netflow_parse_engine_type(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->engine_type = NULL; - row->n_engine_type = 0; - for (i = 0; i < n; i++) { - if (!row->n_engine_type) { - row->engine_type = xmalloc(n * sizeof *row->engine_type); - } - row->engine_type[row->n_engine_type] = datum->keys[i].integer; - row->n_engine_type++; - } -} - -static void -ovsrec_netflow_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_netflow_parse_targets(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - size_t i; - - ovs_assert(inited); - row->targets = NULL; - row->n_targets = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_targets) { - row->targets = xmalloc(datum->n * sizeof *row->targets); - } - row->targets[row->n_targets] = datum->keys[i].string; - row->n_targets++; - } -} - -static void -ovsrec_netflow_unparse_active_timeout(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_netflow_unparse_add_id_to_interface(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_netflow_unparse_engine_id(struct ovsdb_idl_row *row_) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - - ovs_assert(inited); - free(row->engine_id); -} - -static void -ovsrec_netflow_unparse_engine_type(struct ovsdb_idl_row *row_) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - - ovs_assert(inited); - free(row->engine_type); -} - -static void -ovsrec_netflow_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_netflow_unparse_targets(struct ovsdb_idl_row *row_) -{ - struct ovsrec_netflow *row = ovsrec_netflow_cast(row_); - - ovs_assert(inited); - free(row->targets); -} - -static void -ovsrec_netflow_init__(struct ovsdb_idl_row *row) -{ - ovsrec_netflow_init(ovsrec_netflow_cast(row)); -} - -void -ovsrec_netflow_init(struct ovsrec_netflow *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); -} - -const struct ovsrec_netflow * -ovsrec_netflow_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_netflow_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_NETFLOW], uuid)); -} - -const struct ovsrec_netflow * -ovsrec_netflow_first(const struct ovsdb_idl *idl) -{ - return ovsrec_netflow_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_NETFLOW])); -} - -const struct ovsrec_netflow * -ovsrec_netflow_next(const struct ovsrec_netflow *row) -{ - return ovsrec_netflow_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_netflow_delete(const struct ovsrec_netflow *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_netflow * -ovsrec_netflow_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_netflow_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_NETFLOW], NULL)); -} - - -void -ovsrec_netflow_verify_active_timeout(const struct ovsrec_netflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ACTIVE_TIMEOUT]); -} - -void -ovsrec_netflow_verify_add_id_to_interface(const struct ovsrec_netflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ADD_ID_TO_INTERFACE]); -} - -void -ovsrec_netflow_verify_engine_id(const struct ovsrec_netflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ENGINE_ID]); -} - -void -ovsrec_netflow_verify_engine_type(const struct ovsrec_netflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ENGINE_TYPE]); -} - -void -ovsrec_netflow_verify_external_ids(const struct ovsrec_netflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_EXTERNAL_IDS]); -} - -void -ovsrec_netflow_verify_targets(const struct ovsrec_netflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_TARGETS]); -} - -/* Returns the active_timeout column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes active_timeout's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_netflow_get_active_timeout(const struct ovsrec_netflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_netflow_col_active_timeout); -} - -/* Returns the add_id_to_interface column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes add_id_to_interface's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_netflow_get_add_id_to_interface(const struct ovsrec_netflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_netflow_col_add_id_to_interface); -} - -/* Returns the engine_id column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes engine_id's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_netflow_get_engine_id(const struct ovsrec_netflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_netflow_col_engine_id); -} - -/* Returns the engine_type column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes engine_type's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_netflow_get_engine_type(const struct ovsrec_netflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_netflow_col_engine_type); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_netflow_get_external_ids(const struct ovsrec_netflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_netflow_col_external_ids); -} - -/* Returns the targets column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes targets's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_netflow_get_targets(const struct ovsrec_netflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_netflow_col_targets); -} - -void -ovsrec_netflow_set_active_timeout(const struct ovsrec_netflow *row, int64_t active_timeout) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = active_timeout; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ACTIVE_TIMEOUT], &datum); -} - -void -ovsrec_netflow_set_add_id_to_interface(const struct ovsrec_netflow *row, bool add_id_to_interface) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = add_id_to_interface; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ADD_ID_TO_INTERFACE], &datum); -} - -void -ovsrec_netflow_set_engine_id(const struct ovsrec_netflow *row, const int64_t *engine_id, size_t n_engine_id) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_engine_id) { - datum.n = 1; - datum.keys = &key; - key.integer = *engine_id; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ENGINE_ID], &datum); -} - -void -ovsrec_netflow_set_engine_type(const struct ovsrec_netflow *row, const int64_t *engine_type, size_t n_engine_type) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_engine_type) { - datum.n = 1; - datum.keys = &key; - key.integer = *engine_type; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ENGINE_TYPE], &datum); -} - -void -ovsrec_netflow_set_external_ids(const struct ovsrec_netflow *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_netflow_set_targets(const struct ovsrec_netflow *row, char **targets, size_t n_targets) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_targets; - datum.keys = n_targets ? xmalloc(n_targets * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_targets; i++) { - datum.keys[i].string = xstrdup(targets[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_netflow_columns[OVSREC_NETFLOW_COL_TARGETS], &datum); -} - -struct ovsdb_idl_column ovsrec_netflow_columns[OVSREC_NETFLOW_N_COLUMNS]; - -static void -ovsrec_netflow_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_netflow_col_active_timeout. */ - c = &ovsrec_netflow_col_active_timeout; - c->name = "active_timeout"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(-1); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_netflow_parse_active_timeout; - c->unparse = ovsrec_netflow_unparse_active_timeout; - - /* Initialize ovsrec_netflow_col_add_id_to_interface. */ - c = &ovsrec_netflow_col_add_id_to_interface; - c->name = "add_id_to_interface"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_netflow_parse_add_id_to_interface; - c->unparse = ovsrec_netflow_unparse_add_id_to_interface; - - /* Initialize ovsrec_netflow_col_engine_id. */ - c = &ovsrec_netflow_col_engine_id; - c->name = "engine_id"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(255); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_netflow_parse_engine_id; - c->unparse = ovsrec_netflow_unparse_engine_id; - - /* Initialize ovsrec_netflow_col_engine_type. */ - c = &ovsrec_netflow_col_engine_type; - c->name = "engine_type"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(255); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_netflow_parse_engine_type; - c->unparse = ovsrec_netflow_unparse_engine_type; - - /* Initialize ovsrec_netflow_col_external_ids. */ - c = &ovsrec_netflow_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_netflow_parse_external_ids; - c->unparse = ovsrec_netflow_unparse_external_ids; - - /* Initialize ovsrec_netflow_col_targets. */ - c = &ovsrec_netflow_col_targets; - c->name = "targets"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_netflow_parse_targets; - c->unparse = ovsrec_netflow_unparse_targets; -} - -/* Open_vSwitch table. */ - -static void -ovsrec_open_vswitch_parse_bridges(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - size_t i; - - ovs_assert(inited); - row->bridges = NULL; - row->n_bridges = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_bridge *keyRow = ovsrec_bridge_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_BRIDGE], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_bridges) { - row->bridges = xmalloc(datum->n * sizeof *row->bridges); - } - row->bridges[row->n_bridges] = keyRow; - row->n_bridges++; - } - } -} - -static void -ovsrec_open_vswitch_parse_cur_cfg(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->cur_cfg = datum->keys[0].integer; - } else { - row->cur_cfg = 0; - } -} - -static void -ovsrec_open_vswitch_parse_db_version(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->db_version = datum->keys[0].string; - } else { - row->db_version = NULL; - } -} - -static void -ovsrec_open_vswitch_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_open_vswitch_parse_manager_options(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - size_t i; - - ovs_assert(inited); - row->manager_options = NULL; - row->n_manager_options = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_manager *keyRow = ovsrec_manager_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_MANAGER], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_manager_options) { - row->manager_options = xmalloc(datum->n * sizeof *row->manager_options); - } - row->manager_options[row->n_manager_options] = keyRow; - row->n_manager_options++; - } - } -} - -static void -ovsrec_open_vswitch_parse_next_cfg(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->next_cfg = datum->keys[0].integer; - } else { - row->next_cfg = 0; - } -} - -static void -ovsrec_open_vswitch_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_open_vswitch_parse_ovs_version(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ovs_version = datum->keys[0].string; - } else { - row->ovs_version = NULL; - } -} - -static void -ovsrec_open_vswitch_parse_ssl(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ssl = ovsrec_ssl_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_SSL], &datum->keys[0].uuid)); - } else { - row->ssl = NULL; - } -} - -static void -ovsrec_open_vswitch_parse_statistics(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->statistics); - for (i = 0; i < datum->n; i++) { - smap_add(&row->statistics, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_open_vswitch_parse_system_type(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->system_type = datum->keys[0].string; - } else { - row->system_type = NULL; - } -} - -static void -ovsrec_open_vswitch_parse_system_version(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->system_version = datum->keys[0].string; - } else { - row->system_version = NULL; - } -} - -static void -ovsrec_open_vswitch_unparse_bridges(struct ovsdb_idl_row *row_) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - free(row->bridges); -} - -static void -ovsrec_open_vswitch_unparse_cur_cfg(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_open_vswitch_unparse_db_version(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_open_vswitch_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_open_vswitch_unparse_manager_options(struct ovsdb_idl_row *row_) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - free(row->manager_options); -} - -static void -ovsrec_open_vswitch_unparse_next_cfg(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_open_vswitch_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_open_vswitch_unparse_ovs_version(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_open_vswitch_unparse_ssl(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_open_vswitch_unparse_statistics(struct ovsdb_idl_row *row_) -{ - struct ovsrec_open_vswitch *row = ovsrec_open_vswitch_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->statistics); -} - -static void -ovsrec_open_vswitch_unparse_system_type(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_open_vswitch_unparse_system_version(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_open_vswitch_init__(struct ovsdb_idl_row *row) -{ - ovsrec_open_vswitch_init(ovsrec_open_vswitch_cast(row)); -} - -void -ovsrec_open_vswitch_init(struct ovsrec_open_vswitch *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); - smap_init(&row->other_config); - smap_init(&row->statistics); -} - -const struct ovsrec_open_vswitch * -ovsrec_open_vswitch_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_open_vswitch_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_OPEN_VSWITCH], uuid)); -} - -const struct ovsrec_open_vswitch * -ovsrec_open_vswitch_first(const struct ovsdb_idl *idl) -{ - return ovsrec_open_vswitch_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_OPEN_VSWITCH])); -} - -const struct ovsrec_open_vswitch * -ovsrec_open_vswitch_next(const struct ovsrec_open_vswitch *row) -{ - return ovsrec_open_vswitch_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_open_vswitch_delete(const struct ovsrec_open_vswitch *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_open_vswitch * -ovsrec_open_vswitch_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_open_vswitch_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_OPEN_VSWITCH], NULL)); -} - - -void -ovsrec_open_vswitch_verify_bridges(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_BRIDGES]); -} - -void -ovsrec_open_vswitch_verify_cur_cfg(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_CUR_CFG]); -} - -void -ovsrec_open_vswitch_verify_db_version(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_DB_VERSION]); -} - -void -ovsrec_open_vswitch_verify_external_ids(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_EXTERNAL_IDS]); -} - -void -ovsrec_open_vswitch_verify_manager_options(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_MANAGER_OPTIONS]); -} - -void -ovsrec_open_vswitch_verify_next_cfg(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_NEXT_CFG]); -} - -void -ovsrec_open_vswitch_verify_other_config(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_OTHER_CONFIG]); -} - -void -ovsrec_open_vswitch_verify_ovs_version(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_OVS_VERSION]); -} - -void -ovsrec_open_vswitch_verify_ssl(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SSL]); -} - -void -ovsrec_open_vswitch_verify_statistics(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_STATISTICS]); -} - -void -ovsrec_open_vswitch_verify_system_type(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SYSTEM_TYPE]); -} - -void -ovsrec_open_vswitch_verify_system_version(const struct ovsrec_open_vswitch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SYSTEM_VERSION]); -} - -/* Returns the bridges column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes bridges's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_bridges(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_bridges); -} - -/* Returns the cur_cfg column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes cur_cfg's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_cur_cfg(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_cur_cfg); -} - -/* Returns the db_version column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes db_version's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_db_version(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_db_version); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_external_ids(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_external_ids); -} - -/* Returns the manager_options column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes manager_options's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_manager_options(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_manager_options); -} - -/* Returns the next_cfg column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes next_cfg's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_next_cfg(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_next_cfg); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_other_config(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_other_config); -} - -/* Returns the ovs_version column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes ovs_version's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_ovs_version(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_ovs_version); -} - -/* Returns the ssl column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes ssl's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_ssl(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_ssl); -} - -/* Returns the statistics column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes statistics's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_statistics(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_statistics); -} - -/* Returns the system_type column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes system_type's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_system_type(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_system_type); -} - -/* Returns the system_version column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes system_version's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_open_vswitch_get_system_version(const struct ovsrec_open_vswitch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_open_vswitch_col_system_version); -} - -void -ovsrec_open_vswitch_set_bridges(const struct ovsrec_open_vswitch *row, struct ovsrec_bridge **bridges, size_t n_bridges) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_bridges; - datum.keys = n_bridges ? xmalloc(n_bridges * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_bridges; i++) { - datum.keys[i].uuid = bridges[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_BRIDGES], &datum); -} - -void -ovsrec_open_vswitch_set_cur_cfg(const struct ovsrec_open_vswitch *row, int64_t cur_cfg) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = cur_cfg; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_CUR_CFG], &datum); -} - -void -ovsrec_open_vswitch_set_db_version(const struct ovsrec_open_vswitch *row, const char *db_version) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (db_version) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, db_version); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_DB_VERSION], &datum); -} - -void -ovsrec_open_vswitch_set_external_ids(const struct ovsrec_open_vswitch *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_open_vswitch_set_manager_options(const struct ovsrec_open_vswitch *row, struct ovsrec_manager **manager_options, size_t n_manager_options) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_manager_options; - datum.keys = n_manager_options ? xmalloc(n_manager_options * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_manager_options; i++) { - datum.keys[i].uuid = manager_options[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_MANAGER_OPTIONS], &datum); -} - -void -ovsrec_open_vswitch_set_next_cfg(const struct ovsrec_open_vswitch *row, int64_t next_cfg) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = next_cfg; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_NEXT_CFG], &datum); -} - -void -ovsrec_open_vswitch_set_other_config(const struct ovsrec_open_vswitch *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_OTHER_CONFIG], - &datum); -} - - -void -ovsrec_open_vswitch_set_ovs_version(const struct ovsrec_open_vswitch *row, const char *ovs_version) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (ovs_version) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, ovs_version); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_OVS_VERSION], &datum); -} - -void -ovsrec_open_vswitch_set_ssl(const struct ovsrec_open_vswitch *row, const struct ovsrec_ssl *ssl) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (ssl) { - datum.n = 1; - datum.keys = &key; - key.uuid = ssl->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SSL], &datum); -} - -void -ovsrec_open_vswitch_set_statistics(const struct ovsrec_open_vswitch *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_STATISTICS], - &datum); -} - - -void -ovsrec_open_vswitch_set_system_type(const struct ovsrec_open_vswitch *row, const char *system_type) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (system_type) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, system_type); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SYSTEM_TYPE], &datum); -} - -void -ovsrec_open_vswitch_set_system_version(const struct ovsrec_open_vswitch *row, const char *system_version) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (system_version) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, system_version); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SYSTEM_VERSION], &datum); -} - -struct ovsdb_idl_column ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_N_COLUMNS]; - -static void -ovsrec_open_vswitch_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_open_vswitch_col_bridges. */ - c = &ovsrec_open_vswitch_col_bridges; - c->name = "bridges"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Bridge"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_bridges; - c->unparse = ovsrec_open_vswitch_unparse_bridges; - - /* Initialize ovsrec_open_vswitch_col_cur_cfg. */ - c = &ovsrec_open_vswitch_col_cur_cfg; - c->name = "cur_cfg"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_cur_cfg; - c->unparse = ovsrec_open_vswitch_unparse_cur_cfg; - - /* Initialize ovsrec_open_vswitch_col_db_version. */ - c = &ovsrec_open_vswitch_col_db_version; - c->name = "db_version"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_db_version; - c->unparse = ovsrec_open_vswitch_unparse_db_version; - - /* Initialize ovsrec_open_vswitch_col_external_ids. */ - c = &ovsrec_open_vswitch_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_external_ids; - c->unparse = ovsrec_open_vswitch_unparse_external_ids; - - /* Initialize ovsrec_open_vswitch_col_manager_options. */ - c = &ovsrec_open_vswitch_col_manager_options; - c->name = "manager_options"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Manager"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_manager_options; - c->unparse = ovsrec_open_vswitch_unparse_manager_options; - - /* Initialize ovsrec_open_vswitch_col_next_cfg. */ - c = &ovsrec_open_vswitch_col_next_cfg; - c->name = "next_cfg"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_next_cfg; - c->unparse = ovsrec_open_vswitch_unparse_next_cfg; - - /* Initialize ovsrec_open_vswitch_col_other_config. */ - c = &ovsrec_open_vswitch_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_other_config; - c->unparse = ovsrec_open_vswitch_unparse_other_config; - - /* Initialize ovsrec_open_vswitch_col_ovs_version. */ - c = &ovsrec_open_vswitch_col_ovs_version; - c->name = "ovs_version"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_ovs_version; - c->unparse = ovsrec_open_vswitch_unparse_ovs_version; - - /* Initialize ovsrec_open_vswitch_col_ssl. */ - c = &ovsrec_open_vswitch_col_ssl; - c->name = "ssl"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "SSL"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_ssl; - c->unparse = ovsrec_open_vswitch_unparse_ssl; - - /* Initialize ovsrec_open_vswitch_col_statistics. */ - c = &ovsrec_open_vswitch_col_statistics; - c->name = "statistics"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_statistics; - c->unparse = ovsrec_open_vswitch_unparse_statistics; - - /* Initialize ovsrec_open_vswitch_col_system_type. */ - c = &ovsrec_open_vswitch_col_system_type; - c->name = "system_type"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_system_type; - c->unparse = ovsrec_open_vswitch_unparse_system_type; - - /* Initialize ovsrec_open_vswitch_col_system_version. */ - c = &ovsrec_open_vswitch_col_system_version; - c->name = "system_version"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_open_vswitch_parse_system_version; - c->unparse = ovsrec_open_vswitch_unparse_system_version; -} - -/* Port table. */ - -static void -ovsrec_port_parse_bond_active_slave(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bond_active_slave = datum->keys[0].string; - } else { - row->bond_active_slave = NULL; - } -} - -static void -ovsrec_port_parse_bond_downdelay(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bond_downdelay = datum->keys[0].integer; - } else { - row->bond_downdelay = 0; - } -} - -static void -ovsrec_port_parse_bond_fake_iface(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bond_fake_iface = datum->keys[0].boolean; - } else { - row->bond_fake_iface = false; - } -} - -static void -ovsrec_port_parse_bond_mode(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bond_mode = datum->keys[0].string; - } else { - row->bond_mode = NULL; - } -} - -static void -ovsrec_port_parse_bond_updelay(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bond_updelay = datum->keys[0].integer; - } else { - row->bond_updelay = 0; - } -} - -static void -ovsrec_port_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_port_parse_fake_bridge(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->fake_bridge = datum->keys[0].boolean; - } else { - row->fake_bridge = false; - } -} - -static void -ovsrec_port_parse_interfaces(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - size_t i; - - ovs_assert(inited); - row->interfaces = NULL; - row->n_interfaces = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_interface *keyRow = ovsrec_interface_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_INTERFACE], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_interfaces) { - row->interfaces = xmalloc(datum->n * sizeof *row->interfaces); - } - row->interfaces[row->n_interfaces] = keyRow; - row->n_interfaces++; - } - } -} - -static void -ovsrec_port_parse_lacp(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->lacp = datum->keys[0].string; - } else { - row->lacp = NULL; - } -} - -static void -ovsrec_port_parse_mac(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->mac = datum->keys[0].string; - } else { - row->mac = NULL; - } -} - -static void -ovsrec_port_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -ovsrec_port_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_port_parse_qos(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->qos = ovsrec_qos_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_QOS], &datum->keys[0].uuid)); - } else { - row->qos = NULL; - } -} - -static void -ovsrec_port_parse_statistics(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_statistics = NULL; - row->value_statistics = NULL; - row->n_statistics = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_statistics) { - row->key_statistics = xmalloc(datum->n * sizeof *row->key_statistics); - row->value_statistics = xmalloc(datum->n * sizeof *row->value_statistics); - } - row->key_statistics[row->n_statistics] = datum->keys[i].string; - row->value_statistics[row->n_statistics] = datum->values[i].integer; - row->n_statistics++; - } -} - -static void -ovsrec_port_parse_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_port_parse_tag(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->tag = NULL; - row->n_tag = 0; - for (i = 0; i < n; i++) { - if (!row->n_tag) { - row->tag = xmalloc(n * sizeof *row->tag); - } - row->tag[row->n_tag] = datum->keys[i].integer; - row->n_tag++; - } -} - -static void -ovsrec_port_parse_trunks(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - size_t n = MIN(4096, datum->n); - size_t i; - - ovs_assert(inited); - row->trunks = NULL; - row->n_trunks = 0; - for (i = 0; i < n; i++) { - if (!row->n_trunks) { - row->trunks = xmalloc(n * sizeof *row->trunks); - } - row->trunks[row->n_trunks] = datum->keys[i].integer; - row->n_trunks++; - } -} - -static void -ovsrec_port_parse_vlan_mode(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->vlan_mode = datum->keys[0].string; - } else { - row->vlan_mode = NULL; - } -} - -static void -ovsrec_port_unparse_bond_active_slave(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_bond_downdelay(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_bond_fake_iface(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_bond_mode(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_bond_updelay(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_port_unparse_fake_bridge(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_interfaces(struct ovsdb_idl_row *row_) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - free(row->interfaces); -} - -static void -ovsrec_port_unparse_lacp(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_mac(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_port_unparse_qos(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_unparse_statistics(struct ovsdb_idl_row *row_) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - free(row->key_statistics); - free(row->value_statistics); -} - -static void -ovsrec_port_unparse_status(struct ovsdb_idl_row *row_) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->status); -} - -static void -ovsrec_port_unparse_tag(struct ovsdb_idl_row *row_) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - free(row->tag); -} - -static void -ovsrec_port_unparse_trunks(struct ovsdb_idl_row *row_) -{ - struct ovsrec_port *row = ovsrec_port_cast(row_); - - ovs_assert(inited); - free(row->trunks); -} - -static void -ovsrec_port_unparse_vlan_mode(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_port_init__(struct ovsdb_idl_row *row) -{ - ovsrec_port_init(ovsrec_port_cast(row)); -} - -void -ovsrec_port_init(struct ovsrec_port *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); - smap_init(&row->other_config); - smap_init(&row->status); -} - -const struct ovsrec_port * -ovsrec_port_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_port_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_PORT], uuid)); -} - -const struct ovsrec_port * -ovsrec_port_first(const struct ovsdb_idl *idl) -{ - return ovsrec_port_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_PORT])); -} - -const struct ovsrec_port * -ovsrec_port_next(const struct ovsrec_port *row) -{ - return ovsrec_port_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_port_delete(const struct ovsrec_port *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_port * -ovsrec_port_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_port_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_PORT], NULL)); -} - - -void -ovsrec_port_verify_bond_active_slave(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_ACTIVE_SLAVE]); -} - -void -ovsrec_port_verify_bond_downdelay(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_DOWNDELAY]); -} - -void -ovsrec_port_verify_bond_fake_iface(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_FAKE_IFACE]); -} - -void -ovsrec_port_verify_bond_mode(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_MODE]); -} - -void -ovsrec_port_verify_bond_updelay(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_UPDELAY]); -} - -void -ovsrec_port_verify_external_ids(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_EXTERNAL_IDS]); -} - -void -ovsrec_port_verify_fake_bridge(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_FAKE_BRIDGE]); -} - -void -ovsrec_port_verify_interfaces(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_INTERFACES]); -} - -void -ovsrec_port_verify_lacp(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_LACP]); -} - -void -ovsrec_port_verify_mac(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_MAC]); -} - -void -ovsrec_port_verify_name(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_NAME]); -} - -void -ovsrec_port_verify_other_config(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_OTHER_CONFIG]); -} - -void -ovsrec_port_verify_qos(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_QOS]); -} - -void -ovsrec_port_verify_statistics(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_STATISTICS]); -} - -void -ovsrec_port_verify_status(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_STATUS]); -} - -void -ovsrec_port_verify_tag(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_TAG]); -} - -void -ovsrec_port_verify_trunks(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_TRUNKS]); -} - -void -ovsrec_port_verify_vlan_mode(const struct ovsrec_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_VLAN_MODE]); -} - -/* Returns the bond_active_slave column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bond_active_slave's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_bond_active_slave(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_bond_active_slave); -} - -/* Returns the bond_downdelay column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes bond_downdelay's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_bond_downdelay(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_bond_downdelay); -} - -/* Returns the bond_fake_iface column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes bond_fake_iface's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_bond_fake_iface(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_bond_fake_iface); -} - -/* Returns the bond_mode column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bond_mode's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_bond_mode(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_bond_mode); -} - -/* Returns the bond_updelay column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes bond_updelay's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_bond_updelay(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_bond_updelay); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_external_ids(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_external_ids); -} - -/* Returns the fake_bridge column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes fake_bridge's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_fake_bridge(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_fake_bridge); -} - -/* Returns the interfaces column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes interfaces's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_interfaces(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_interfaces); -} - -/* Returns the lacp column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes lacp's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_lacp(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_lacp); -} - -/* Returns the mac column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes mac's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_mac(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_mac); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_name(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_name); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_other_config(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_other_config); -} - -/* Returns the qos column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes qos's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_qos(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_qos); -} - -/* Returns the statistics column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes statistics's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_statistics(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_statistics); -} - -/* Returns the status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_status(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_status); -} - -/* Returns the tag column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes tag's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_tag(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_tag); -} - -/* Returns the trunks column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes trunks's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_trunks(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_trunks); -} - -/* Returns the vlan_mode column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes vlan_mode's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_port_get_vlan_mode(const struct ovsrec_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_port_col_vlan_mode); -} - -void -ovsrec_port_set_bond_active_slave(const struct ovsrec_port *row, const char *bond_active_slave) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (bond_active_slave) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, bond_active_slave); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_ACTIVE_SLAVE], &datum); -} - -void -ovsrec_port_set_bond_downdelay(const struct ovsrec_port *row, int64_t bond_downdelay) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = bond_downdelay; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_DOWNDELAY], &datum); -} - -void -ovsrec_port_set_bond_fake_iface(const struct ovsrec_port *row, bool bond_fake_iface) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = bond_fake_iface; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_FAKE_IFACE], &datum); -} - -void -ovsrec_port_set_bond_mode(const struct ovsrec_port *row, const char *bond_mode) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (bond_mode) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, bond_mode); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_MODE], &datum); -} - -void -ovsrec_port_set_bond_updelay(const struct ovsrec_port *row, int64_t bond_updelay) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = bond_updelay; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_BOND_UPDELAY], &datum); -} - -void -ovsrec_port_set_external_ids(const struct ovsrec_port *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_port_columns[OVSREC_PORT_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_port_set_fake_bridge(const struct ovsrec_port *row, bool fake_bridge) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = fake_bridge; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_FAKE_BRIDGE], &datum); -} - -void -ovsrec_port_set_interfaces(const struct ovsrec_port *row, struct ovsrec_interface **interfaces, size_t n_interfaces) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_interfaces; - datum.keys = n_interfaces ? xmalloc(n_interfaces * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_interfaces; i++) { - datum.keys[i].uuid = interfaces[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_INTERFACES], &datum); -} - -void -ovsrec_port_set_lacp(const struct ovsrec_port *row, const char *lacp) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (lacp) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, lacp); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_LACP], &datum); -} - -void -ovsrec_port_set_mac(const struct ovsrec_port *row, const char *mac) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (mac) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, mac); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_MAC], &datum); -} - -void -ovsrec_port_set_name(const struct ovsrec_port *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_NAME], &datum); -} - -void -ovsrec_port_set_other_config(const struct ovsrec_port *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_port_columns[OVSREC_PORT_COL_OTHER_CONFIG], - &datum); -} - - -void -ovsrec_port_set_qos(const struct ovsrec_port *row, const struct ovsrec_qos *qos) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (qos) { - datum.n = 1; - datum.keys = &key; - key.uuid = qos->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_QOS], &datum); -} - -void -ovsrec_port_set_statistics(const struct ovsrec_port *row, char **key_statistics, const int64_t *value_statistics, size_t n_statistics) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_statistics; - datum.keys = n_statistics ? xmalloc(n_statistics * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_statistics * sizeof *datum.values); - for (i = 0; i < n_statistics; i++) { - datum.keys[i].string = xstrdup(key_statistics[i]); - datum.values[i].integer = value_statistics[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_INTEGER); - ovsdb_idl_txn_write(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_STATISTICS], &datum); -} - -void -ovsrec_port_set_status(const struct ovsrec_port *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_port_columns[OVSREC_PORT_COL_STATUS], - &datum); -} - - -void -ovsrec_port_set_tag(const struct ovsrec_port *row, const int64_t *tag, size_t n_tag) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_tag) { - datum.n = 1; - datum.keys = &key; - key.integer = *tag; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_TAG], &datum); -} - -void -ovsrec_port_set_trunks(const struct ovsrec_port *row, const int64_t *trunks, size_t n_trunks) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_trunks; - datum.keys = n_trunks ? xmalloc(n_trunks * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_trunks; i++) { - datum.keys[i].integer = trunks[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_TRUNKS], &datum); -} - -void -ovsrec_port_set_vlan_mode(const struct ovsrec_port *row, const char *vlan_mode) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (vlan_mode) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, vlan_mode); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_port_columns[OVSREC_PORT_COL_VLAN_MODE], &datum); -} - -struct ovsdb_idl_column ovsrec_port_columns[OVSREC_PORT_N_COLUMNS]; - -static void -ovsrec_port_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_port_col_bond_active_slave. */ - c = &ovsrec_port_col_bond_active_slave; - c->name = "bond_active_slave"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_bond_active_slave; - c->unparse = ovsrec_port_unparse_bond_active_slave; - - /* Initialize ovsrec_port_col_bond_downdelay. */ - c = &ovsrec_port_col_bond_downdelay; - c->name = "bond_downdelay"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_bond_downdelay; - c->unparse = ovsrec_port_unparse_bond_downdelay; - - /* Initialize ovsrec_port_col_bond_fake_iface. */ - c = &ovsrec_port_col_bond_fake_iface; - c->name = "bond_fake_iface"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_bond_fake_iface; - c->unparse = ovsrec_port_unparse_bond_fake_iface; - - /* Initialize ovsrec_port_col_bond_mode. */ - c = &ovsrec_port_col_bond_mode; - c->name = "bond_mode"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 3; - c->type.key.enum_->keys = xmalloc(3 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("active-backup"); - c->type.key.enum_->keys[1].string = xstrdup("balance-slb"); - c->type.key.enum_->keys[2].string = xstrdup("balance-tcp"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_bond_mode; - c->unparse = ovsrec_port_unparse_bond_mode; - - /* Initialize ovsrec_port_col_bond_updelay. */ - c = &ovsrec_port_col_bond_updelay; - c->name = "bond_updelay"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_bond_updelay; - c->unparse = ovsrec_port_unparse_bond_updelay; - - /* Initialize ovsrec_port_col_external_ids. */ - c = &ovsrec_port_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_port_parse_external_ids; - c->unparse = ovsrec_port_unparse_external_ids; - - /* Initialize ovsrec_port_col_fake_bridge. */ - c = &ovsrec_port_col_fake_bridge; - c->name = "fake_bridge"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_fake_bridge; - c->unparse = ovsrec_port_unparse_fake_bridge; - - /* Initialize ovsrec_port_col_interfaces. */ - c = &ovsrec_port_col_interfaces; - c->name = "interfaces"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Interface"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_port_parse_interfaces; - c->unparse = ovsrec_port_unparse_interfaces; - - /* Initialize ovsrec_port_col_lacp. */ - c = &ovsrec_port_col_lacp; - c->name = "lacp"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 3; - c->type.key.enum_->keys = xmalloc(3 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("active"); - c->type.key.enum_->keys[1].string = xstrdup("off"); - c->type.key.enum_->keys[2].string = xstrdup("passive"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_lacp; - c->unparse = ovsrec_port_unparse_lacp; - - /* Initialize ovsrec_port_col_mac. */ - c = &ovsrec_port_col_mac; - c->name = "mac"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_mac; - c->unparse = ovsrec_port_unparse_mac; - - /* Initialize ovsrec_port_col_name. */ - c = &ovsrec_port_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = false; - c->parse = ovsrec_port_parse_name; - c->unparse = ovsrec_port_unparse_name; - - /* Initialize ovsrec_port_col_other_config. */ - c = &ovsrec_port_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_port_parse_other_config; - c->unparse = ovsrec_port_unparse_other_config; - - /* Initialize ovsrec_port_col_qos. */ - c = &ovsrec_port_col_qos; - c->name = "qos"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "QoS"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_qos; - c->unparse = ovsrec_port_unparse_qos; - - /* Initialize ovsrec_port_col_statistics. */ - c = &ovsrec_port_col_statistics; - c->name = "statistics"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_INTEGER); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_port_parse_statistics; - c->unparse = ovsrec_port_unparse_statistics; - - /* Initialize ovsrec_port_col_status. */ - c = &ovsrec_port_col_status; - c->name = "status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_port_parse_status; - c->unparse = ovsrec_port_unparse_status; - - /* Initialize ovsrec_port_col_tag. */ - c = &ovsrec_port_col_tag; - c->name = "tag"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4095); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_tag; - c->unparse = ovsrec_port_unparse_tag; - - /* Initialize ovsrec_port_col_trunks. */ - c = &ovsrec_port_col_trunks; - c->name = "trunks"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4095); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 4096; - c->mutable = true; - c->parse = ovsrec_port_parse_trunks; - c->unparse = ovsrec_port_unparse_trunks; - - /* Initialize ovsrec_port_col_vlan_mode. */ - c = &ovsrec_port_col_vlan_mode; - c->name = "vlan_mode"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 4; - c->type.key.enum_->keys = xmalloc(4 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("access"); - c->type.key.enum_->keys[1].string = xstrdup("native-tagged"); - c->type.key.enum_->keys[2].string = xstrdup("native-untagged"); - c->type.key.enum_->keys[3].string = xstrdup("trunk"); - c->type.key.enum_->values = NULL; - ovsdb_datum_sort_assert(c->type.key.enum_, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_port_parse_vlan_mode; - c->unparse = ovsrec_port_unparse_vlan_mode; -} - -/* QoS table. */ - -static void -ovsrec_qos_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_qos *row = ovsrec_qos_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_qos_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_qos *row = ovsrec_qos_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_qos_parse_queues(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_qos *row = ovsrec_qos_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_queues = NULL; - row->value_queues = NULL; - row->n_queues = 0; - for (i = 0; i < datum->n; i++) { - struct ovsrec_queue *valueRow = ovsrec_queue_cast(ovsdb_idl_get_row_arc(row_, &ovsrec_table_classes[OVSREC_TABLE_QUEUE], &datum->values[i].uuid)); - if (valueRow) { - if (!row->n_queues) { - row->key_queues = xmalloc(datum->n * sizeof *row->key_queues); - row->value_queues = xmalloc(datum->n * sizeof *row->value_queues); - } - row->key_queues[row->n_queues] = datum->keys[i].integer; - row->value_queues[row->n_queues] = valueRow; - row->n_queues++; - } - } -} - -static void -ovsrec_qos_parse_type(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_qos *row = ovsrec_qos_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->type = datum->keys[0].string; - } else { - row->type = ""; - } -} - -static void -ovsrec_qos_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_qos *row = ovsrec_qos_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_qos_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_qos *row = ovsrec_qos_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_qos_unparse_queues(struct ovsdb_idl_row *row_) -{ - struct ovsrec_qos *row = ovsrec_qos_cast(row_); - - ovs_assert(inited); - free(row->key_queues); - free(row->value_queues); -} - -static void -ovsrec_qos_unparse_type(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_qos_init__(struct ovsdb_idl_row *row) -{ - ovsrec_qos_init(ovsrec_qos_cast(row)); -} - -void -ovsrec_qos_init(struct ovsrec_qos *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); - smap_init(&row->other_config); -} - -const struct ovsrec_qos * -ovsrec_qos_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_qos_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_QOS], uuid)); -} - -const struct ovsrec_qos * -ovsrec_qos_first(const struct ovsdb_idl *idl) -{ - return ovsrec_qos_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_QOS])); -} - -const struct ovsrec_qos * -ovsrec_qos_next(const struct ovsrec_qos *row) -{ - return ovsrec_qos_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_qos_delete(const struct ovsrec_qos *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_qos * -ovsrec_qos_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_qos_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_QOS], NULL)); -} - - -void -ovsrec_qos_verify_external_ids(const struct ovsrec_qos *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_qos_columns[OVSREC_QOS_COL_EXTERNAL_IDS]); -} - -void -ovsrec_qos_verify_other_config(const struct ovsrec_qos *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_qos_columns[OVSREC_QOS_COL_OTHER_CONFIG]); -} - -void -ovsrec_qos_verify_queues(const struct ovsrec_qos *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_qos_columns[OVSREC_QOS_COL_QUEUES]); -} - -void -ovsrec_qos_verify_type(const struct ovsrec_qos *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_qos_columns[OVSREC_QOS_COL_TYPE]); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_qos_get_external_ids(const struct ovsrec_qos *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_qos_col_external_ids); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_qos_get_other_config(const struct ovsrec_qos *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_qos_col_other_config); -} - -/* Returns the queues column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * 'value_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes queues's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_qos_get_queues(const struct ovsrec_qos *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - ovs_assert(value_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &ovsrec_qos_col_queues); -} - -/* Returns the type column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes type's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_qos_get_type(const struct ovsrec_qos *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_qos_col_type); -} - -void -ovsrec_qos_set_external_ids(const struct ovsrec_qos *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_qos_columns[OVSREC_QOS_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_qos_set_other_config(const struct ovsrec_qos *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_qos_columns[OVSREC_QOS_COL_OTHER_CONFIG], - &datum); -} - - -void -ovsrec_qos_set_queues(const struct ovsrec_qos *row, const int64_t *key_queues, struct ovsrec_queue **value_queues, size_t n_queues) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_queues; - datum.keys = n_queues ? xmalloc(n_queues * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_queues * sizeof *datum.values); - for (i = 0; i < n_queues; i++) { - datum.keys[i].integer = key_queues[i]; - datum.values[i].uuid = value_queues[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_UUID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_qos_columns[OVSREC_QOS_COL_QUEUES], &datum); -} - -void -ovsrec_qos_set_type(const struct ovsrec_qos *row, const char *type) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, type); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_qos_columns[OVSREC_QOS_COL_TYPE], &datum); -} - -struct ovsdb_idl_column ovsrec_qos_columns[OVSREC_QOS_N_COLUMNS]; - -static void -ovsrec_qos_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_qos_col_external_ids. */ - c = &ovsrec_qos_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_qos_parse_external_ids; - c->unparse = ovsrec_qos_unparse_external_ids; - - /* Initialize ovsrec_qos_col_other_config. */ - c = &ovsrec_qos_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_qos_parse_other_config; - c->unparse = ovsrec_qos_unparse_other_config; - - /* Initialize ovsrec_qos_col_queues. */ - c = &ovsrec_qos_col_queues; - c->name = "queues"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4294967295); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_UUID); - c->type.value.u.uuid.refTableName = "Queue"; - c->type.value.u.uuid.refType = OVSDB_REF_STRONG; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_qos_parse_queues; - c->unparse = ovsrec_qos_unparse_queues; - - /* Initialize ovsrec_qos_col_type. */ - c = &ovsrec_qos_col_type; - c->name = "type"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_qos_parse_type; - c->unparse = ovsrec_qos_unparse_type; -} - -/* Queue table. */ - -static void -ovsrec_queue_parse_dscp(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_queue *row = ovsrec_queue_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->dscp = NULL; - row->n_dscp = 0; - for (i = 0; i < n; i++) { - if (!row->n_dscp) { - row->dscp = xmalloc(n * sizeof *row->dscp); - } - row->dscp[row->n_dscp] = datum->keys[i].integer; - row->n_dscp++; - } -} - -static void -ovsrec_queue_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_queue *row = ovsrec_queue_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_queue_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_queue *row = ovsrec_queue_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_queue_unparse_dscp(struct ovsdb_idl_row *row_) -{ - struct ovsrec_queue *row = ovsrec_queue_cast(row_); - - ovs_assert(inited); - free(row->dscp); -} - -static void -ovsrec_queue_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_queue *row = ovsrec_queue_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_queue_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct ovsrec_queue *row = ovsrec_queue_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -ovsrec_queue_init__(struct ovsdb_idl_row *row) -{ - ovsrec_queue_init(ovsrec_queue_cast(row)); -} - -void -ovsrec_queue_init(struct ovsrec_queue *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); - smap_init(&row->other_config); -} - -const struct ovsrec_queue * -ovsrec_queue_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_queue_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_QUEUE], uuid)); -} - -const struct ovsrec_queue * -ovsrec_queue_first(const struct ovsdb_idl *idl) -{ - return ovsrec_queue_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_QUEUE])); -} - -const struct ovsrec_queue * -ovsrec_queue_next(const struct ovsrec_queue *row) -{ - return ovsrec_queue_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_queue_delete(const struct ovsrec_queue *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_queue * -ovsrec_queue_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_queue_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_QUEUE], NULL)); -} - - -void -ovsrec_queue_verify_dscp(const struct ovsrec_queue *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_queue_columns[OVSREC_QUEUE_COL_DSCP]); -} - -void -ovsrec_queue_verify_external_ids(const struct ovsrec_queue *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_queue_columns[OVSREC_QUEUE_COL_EXTERNAL_IDS]); -} - -void -ovsrec_queue_verify_other_config(const struct ovsrec_queue *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_queue_columns[OVSREC_QUEUE_COL_OTHER_CONFIG]); -} - -/* Returns the dscp column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes dscp's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_queue_get_dscp(const struct ovsrec_queue *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_queue_col_dscp); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_queue_get_external_ids(const struct ovsrec_queue *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_queue_col_external_ids); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_queue_get_other_config(const struct ovsrec_queue *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_queue_col_other_config); -} - -void -ovsrec_queue_set_dscp(const struct ovsrec_queue *row, const int64_t *dscp, size_t n_dscp) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_dscp) { - datum.n = 1; - datum.keys = &key; - key.integer = *dscp; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_queue_columns[OVSREC_QUEUE_COL_DSCP], &datum); -} - -void -ovsrec_queue_set_external_ids(const struct ovsrec_queue *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_queue_columns[OVSREC_QUEUE_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_queue_set_other_config(const struct ovsrec_queue *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_queue_columns[OVSREC_QUEUE_COL_OTHER_CONFIG], - &datum); -} - - -struct ovsdb_idl_column ovsrec_queue_columns[OVSREC_QUEUE_N_COLUMNS]; - -static void -ovsrec_queue_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_queue_col_dscp. */ - c = &ovsrec_queue_col_dscp; - c->name = "dscp"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(63); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_queue_parse_dscp; - c->unparse = ovsrec_queue_unparse_dscp; - - /* Initialize ovsrec_queue_col_external_ids. */ - c = &ovsrec_queue_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_queue_parse_external_ids; - c->unparse = ovsrec_queue_unparse_external_ids; - - /* Initialize ovsrec_queue_col_other_config. */ - c = &ovsrec_queue_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_queue_parse_other_config; - c->unparse = ovsrec_queue_unparse_other_config; -} - -/* SSL table. */ - -static void -ovsrec_ssl_parse_bootstrap_ca_cert(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ssl *row = ovsrec_ssl_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bootstrap_ca_cert = datum->keys[0].boolean; - } else { - row->bootstrap_ca_cert = false; - } -} - -static void -ovsrec_ssl_parse_ca_cert(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ssl *row = ovsrec_ssl_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ca_cert = datum->keys[0].string; - } else { - row->ca_cert = ""; - } -} - -static void -ovsrec_ssl_parse_certificate(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ssl *row = ovsrec_ssl_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->certificate = datum->keys[0].string; - } else { - row->certificate = ""; - } -} - -static void -ovsrec_ssl_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ssl *row = ovsrec_ssl_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_ssl_parse_private_key(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_ssl *row = ovsrec_ssl_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->private_key = datum->keys[0].string; - } else { - row->private_key = ""; - } -} - -static void -ovsrec_ssl_unparse_bootstrap_ca_cert(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_ssl_unparse_ca_cert(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_ssl_unparse_certificate(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_ssl_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_ssl *row = ovsrec_ssl_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_ssl_unparse_private_key(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_ssl_init__(struct ovsdb_idl_row *row) -{ - ovsrec_ssl_init(ovsrec_ssl_cast(row)); -} - -void -ovsrec_ssl_init(struct ovsrec_ssl *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); -} - -const struct ovsrec_ssl * -ovsrec_ssl_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_ssl_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_SSL], uuid)); -} - -const struct ovsrec_ssl * -ovsrec_ssl_first(const struct ovsdb_idl *idl) -{ - return ovsrec_ssl_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_SSL])); -} - -const struct ovsrec_ssl * -ovsrec_ssl_next(const struct ovsrec_ssl *row) -{ - return ovsrec_ssl_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_ssl_delete(const struct ovsrec_ssl *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_ssl * -ovsrec_ssl_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_ssl_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_SSL], NULL)); -} - - -void -ovsrec_ssl_verify_bootstrap_ca_cert(const struct ovsrec_ssl *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_BOOTSTRAP_CA_CERT]); -} - -void -ovsrec_ssl_verify_ca_cert(const struct ovsrec_ssl *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_CA_CERT]); -} - -void -ovsrec_ssl_verify_certificate(const struct ovsrec_ssl *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_CERTIFICATE]); -} - -void -ovsrec_ssl_verify_external_ids(const struct ovsrec_ssl *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_EXTERNAL_IDS]); -} - -void -ovsrec_ssl_verify_private_key(const struct ovsrec_ssl *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_PRIVATE_KEY]); -} - -/* Returns the bootstrap_ca_cert column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes bootstrap_ca_cert's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ssl_get_bootstrap_ca_cert(const struct ovsrec_ssl *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &ovsrec_ssl_col_bootstrap_ca_cert); -} - -/* Returns the ca_cert column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes ca_cert's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ssl_get_ca_cert(const struct ovsrec_ssl *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_ssl_col_ca_cert); -} - -/* Returns the certificate column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes certificate's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ssl_get_certificate(const struct ovsrec_ssl *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_ssl_col_certificate); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ssl_get_external_ids(const struct ovsrec_ssl *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_ssl_col_external_ids); -} - -/* Returns the private_key column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes private_key's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_ssl_get_private_key(const struct ovsrec_ssl *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_ssl_col_private_key); -} - -void -ovsrec_ssl_set_bootstrap_ca_cert(const struct ovsrec_ssl *row, bool bootstrap_ca_cert) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = bootstrap_ca_cert; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_BOOTSTRAP_CA_CERT], &datum); -} - -void -ovsrec_ssl_set_ca_cert(const struct ovsrec_ssl *row, const char *ca_cert) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, ca_cert); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_CA_CERT], &datum); -} - -void -ovsrec_ssl_set_certificate(const struct ovsrec_ssl *row, const char *certificate) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, certificate); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_CERTIFICATE], &datum); -} - -void -ovsrec_ssl_set_external_ids(const struct ovsrec_ssl *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_ssl_columns[OVSREC_SSL_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_ssl_set_private_key(const struct ovsrec_ssl *row, const char *private_key) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, private_key); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_ssl_columns[OVSREC_SSL_COL_PRIVATE_KEY], &datum); -} - -struct ovsdb_idl_column ovsrec_ssl_columns[OVSREC_SSL_N_COLUMNS]; - -static void -ovsrec_ssl_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_ssl_col_bootstrap_ca_cert. */ - c = &ovsrec_ssl_col_bootstrap_ca_cert; - c->name = "bootstrap_ca_cert"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ssl_parse_bootstrap_ca_cert; - c->unparse = ovsrec_ssl_unparse_bootstrap_ca_cert; - - /* Initialize ovsrec_ssl_col_ca_cert. */ - c = &ovsrec_ssl_col_ca_cert; - c->name = "ca_cert"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ssl_parse_ca_cert; - c->unparse = ovsrec_ssl_unparse_ca_cert; - - /* Initialize ovsrec_ssl_col_certificate. */ - c = &ovsrec_ssl_col_certificate; - c->name = "certificate"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ssl_parse_certificate; - c->unparse = ovsrec_ssl_unparse_certificate; - - /* Initialize ovsrec_ssl_col_external_ids. */ - c = &ovsrec_ssl_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_ssl_parse_external_ids; - c->unparse = ovsrec_ssl_unparse_external_ids; - - /* Initialize ovsrec_ssl_col_private_key. */ - c = &ovsrec_ssl_col_private_key; - c->name = "private_key"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_ssl_parse_private_key; - c->unparse = ovsrec_ssl_unparse_private_key; -} - -/* sFlow table. */ - -static void -ovsrec_sflow_parse_agent(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->agent = datum->keys[0].string; - } else { - row->agent = NULL; - } -} - -static void -ovsrec_sflow_parse_external_ids(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->external_ids); - for (i = 0; i < datum->n; i++) { - smap_add(&row->external_ids, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -ovsrec_sflow_parse_header(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->header = NULL; - row->n_header = 0; - for (i = 0; i < n; i++) { - if (!row->n_header) { - row->header = xmalloc(n * sizeof *row->header); - } - row->header[row->n_header] = datum->keys[i].integer; - row->n_header++; - } -} - -static void -ovsrec_sflow_parse_polling(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->polling = NULL; - row->n_polling = 0; - for (i = 0; i < n; i++) { - if (!row->n_polling) { - row->polling = xmalloc(n * sizeof *row->polling); - } - row->polling[row->n_polling] = datum->keys[i].integer; - row->n_polling++; - } -} - -static void -ovsrec_sflow_parse_sampling(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->sampling = NULL; - row->n_sampling = 0; - for (i = 0; i < n; i++) { - if (!row->n_sampling) { - row->sampling = xmalloc(n * sizeof *row->sampling); - } - row->sampling[row->n_sampling] = datum->keys[i].integer; - row->n_sampling++; - } -} - -static void -ovsrec_sflow_parse_targets(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - size_t i; - - ovs_assert(inited); - row->targets = NULL; - row->n_targets = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_targets) { - row->targets = xmalloc(datum->n * sizeof *row->targets); - } - row->targets[row->n_targets] = datum->keys[i].string; - row->n_targets++; - } -} - -static void -ovsrec_sflow_unparse_agent(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -ovsrec_sflow_unparse_external_ids(struct ovsdb_idl_row *row_) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->external_ids); -} - -static void -ovsrec_sflow_unparse_header(struct ovsdb_idl_row *row_) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - - ovs_assert(inited); - free(row->header); -} - -static void -ovsrec_sflow_unparse_polling(struct ovsdb_idl_row *row_) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - - ovs_assert(inited); - free(row->polling); -} - -static void -ovsrec_sflow_unparse_sampling(struct ovsdb_idl_row *row_) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - - ovs_assert(inited); - free(row->sampling); -} - -static void -ovsrec_sflow_unparse_targets(struct ovsdb_idl_row *row_) -{ - struct ovsrec_sflow *row = ovsrec_sflow_cast(row_); - - ovs_assert(inited); - free(row->targets); -} - -static void -ovsrec_sflow_init__(struct ovsdb_idl_row *row) -{ - ovsrec_sflow_init(ovsrec_sflow_cast(row)); -} - -void -ovsrec_sflow_init(struct ovsrec_sflow *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->external_ids); -} - -const struct ovsrec_sflow * -ovsrec_sflow_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return ovsrec_sflow_cast(ovsdb_idl_get_row_for_uuid(idl, &ovsrec_table_classes[OVSREC_TABLE_SFLOW], uuid)); -} - -const struct ovsrec_sflow * -ovsrec_sflow_first(const struct ovsdb_idl *idl) -{ - return ovsrec_sflow_cast(ovsdb_idl_first_row(idl, &ovsrec_table_classes[OVSREC_TABLE_SFLOW])); -} - -const struct ovsrec_sflow * -ovsrec_sflow_next(const struct ovsrec_sflow *row) -{ - return ovsrec_sflow_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -ovsrec_sflow_delete(const struct ovsrec_sflow *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct ovsrec_sflow * -ovsrec_sflow_insert(struct ovsdb_idl_txn *txn) -{ - return ovsrec_sflow_cast(ovsdb_idl_txn_insert(txn, &ovsrec_table_classes[OVSREC_TABLE_SFLOW], NULL)); -} - - -void -ovsrec_sflow_verify_agent(const struct ovsrec_sflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_AGENT]); -} - -void -ovsrec_sflow_verify_external_ids(const struct ovsrec_sflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_EXTERNAL_IDS]); -} - -void -ovsrec_sflow_verify_header(const struct ovsrec_sflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_HEADER]); -} - -void -ovsrec_sflow_verify_polling(const struct ovsrec_sflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_POLLING]); -} - -void -ovsrec_sflow_verify_sampling(const struct ovsrec_sflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_SAMPLING]); -} - -void -ovsrec_sflow_verify_targets(const struct ovsrec_sflow *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_TARGETS]); -} - -/* Returns the agent column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes agent's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_sflow_get_agent(const struct ovsrec_sflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_sflow_col_agent); -} - -/* Returns the external_ids column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes external_ids's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_sflow_get_external_ids(const struct ovsrec_sflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_sflow_col_external_ids); -} - -/* Returns the header column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes header's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_sflow_get_header(const struct ovsrec_sflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_sflow_col_header); -} - -/* Returns the polling column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes polling's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_sflow_get_polling(const struct ovsrec_sflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_sflow_col_polling); -} - -/* Returns the sampling column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes sampling's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_sflow_get_sampling(const struct ovsrec_sflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &ovsrec_sflow_col_sampling); -} - -/* Returns the targets column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes targets's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -ovsrec_sflow_get_targets(const struct ovsrec_sflow *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &ovsrec_sflow_col_targets); -} - -void -ovsrec_sflow_set_agent(const struct ovsrec_sflow *row, const char *agent) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (agent) { - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, agent); - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_AGENT], &datum); -} - -void -ovsrec_sflow_set_external_ids(const struct ovsrec_sflow *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &ovsrec_sflow_columns[OVSREC_SFLOW_COL_EXTERNAL_IDS], - &datum); -} - - -void -ovsrec_sflow_set_header(const struct ovsrec_sflow *row, const int64_t *header, size_t n_header) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_header) { - datum.n = 1; - datum.keys = &key; - key.integer = *header; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_HEADER], &datum); -} - -void -ovsrec_sflow_set_polling(const struct ovsrec_sflow *row, const int64_t *polling, size_t n_polling) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_polling) { - datum.n = 1; - datum.keys = &key; - key.integer = *polling; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_POLLING], &datum); -} - -void -ovsrec_sflow_set_sampling(const struct ovsrec_sflow *row, const int64_t *sampling, size_t n_sampling) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_sampling) { - datum.n = 1; - datum.keys = &key; - key.integer = *sampling; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_SAMPLING], &datum); -} - -void -ovsrec_sflow_set_targets(const struct ovsrec_sflow *row, char **targets, size_t n_targets) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_targets; - datum.keys = n_targets ? xmalloc(n_targets * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_targets; i++) { - datum.keys[i].string = xstrdup(targets[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &ovsrec_sflow_columns[OVSREC_SFLOW_COL_TARGETS], &datum); -} - -struct ovsdb_idl_column ovsrec_sflow_columns[OVSREC_SFLOW_N_COLUMNS]; - -static void -ovsrec_sflow_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize ovsrec_sflow_col_agent. */ - c = &ovsrec_sflow_col_agent; - c->name = "agent"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_sflow_parse_agent; - c->unparse = ovsrec_sflow_unparse_agent; - - /* Initialize ovsrec_sflow_col_external_ids. */ - c = &ovsrec_sflow_col_external_ids; - c->name = "external_ids"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_sflow_parse_external_ids; - c->unparse = ovsrec_sflow_unparse_external_ids; - - /* Initialize ovsrec_sflow_col_header. */ - c = &ovsrec_sflow_col_header; - c->name = "header"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_sflow_parse_header; - c->unparse = ovsrec_sflow_unparse_header; - - /* Initialize ovsrec_sflow_col_polling. */ - c = &ovsrec_sflow_col_polling; - c->name = "polling"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_sflow_parse_polling; - c->unparse = ovsrec_sflow_unparse_polling; - - /* Initialize ovsrec_sflow_col_sampling. */ - c = &ovsrec_sflow_col_sampling; - c->name = "sampling"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = ovsrec_sflow_parse_sampling; - c->unparse = ovsrec_sflow_unparse_sampling; - - /* Initialize ovsrec_sflow_col_targets. */ - c = &ovsrec_sflow_col_targets; - c->name = "targets"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = ovsrec_sflow_parse_targets; - c->unparse = ovsrec_sflow_unparse_targets; -} - -struct ovsdb_idl_table_class ovsrec_table_classes[OVSREC_N_TABLES] = { - {"Bridge", false, - ovsrec_bridge_columns, ARRAY_SIZE(ovsrec_bridge_columns), - sizeof(struct ovsrec_bridge), ovsrec_bridge_init__}, - {"Controller", false, - ovsrec_controller_columns, ARRAY_SIZE(ovsrec_controller_columns), - sizeof(struct ovsrec_controller), ovsrec_controller_init__}, - {"Flow_Sample_Collector_Set", true, - ovsrec_flow_sample_collector_set_columns, ARRAY_SIZE(ovsrec_flow_sample_collector_set_columns), - sizeof(struct ovsrec_flow_sample_collector_set), ovsrec_flow_sample_collector_set_init__}, - {"Flow_Table", false, - ovsrec_flow_table_columns, ARRAY_SIZE(ovsrec_flow_table_columns), - sizeof(struct ovsrec_flow_table), ovsrec_flow_table_init__}, - {"IPFIX", false, - ovsrec_ipfix_columns, ARRAY_SIZE(ovsrec_ipfix_columns), - sizeof(struct ovsrec_ipfix), ovsrec_ipfix_init__}, - {"Interface", false, - ovsrec_interface_columns, ARRAY_SIZE(ovsrec_interface_columns), - sizeof(struct ovsrec_interface), ovsrec_interface_init__}, - {"Manager", false, - ovsrec_manager_columns, ARRAY_SIZE(ovsrec_manager_columns), - sizeof(struct ovsrec_manager), ovsrec_manager_init__}, - {"Mirror", false, - ovsrec_mirror_columns, ARRAY_SIZE(ovsrec_mirror_columns), - sizeof(struct ovsrec_mirror), ovsrec_mirror_init__}, - {"NetFlow", false, - ovsrec_netflow_columns, ARRAY_SIZE(ovsrec_netflow_columns), - sizeof(struct ovsrec_netflow), ovsrec_netflow_init__}, - {"Open_vSwitch", true, - ovsrec_open_vswitch_columns, ARRAY_SIZE(ovsrec_open_vswitch_columns), - sizeof(struct ovsrec_open_vswitch), ovsrec_open_vswitch_init__}, - {"Port", false, - ovsrec_port_columns, ARRAY_SIZE(ovsrec_port_columns), - sizeof(struct ovsrec_port), ovsrec_port_init__}, - {"QoS", true, - ovsrec_qos_columns, ARRAY_SIZE(ovsrec_qos_columns), - sizeof(struct ovsrec_qos), ovsrec_qos_init__}, - {"Queue", true, - ovsrec_queue_columns, ARRAY_SIZE(ovsrec_queue_columns), - sizeof(struct ovsrec_queue), ovsrec_queue_init__}, - {"SSL", false, - ovsrec_ssl_columns, ARRAY_SIZE(ovsrec_ssl_columns), - sizeof(struct ovsrec_ssl), ovsrec_ssl_init__}, - {"sFlow", false, - ovsrec_sflow_columns, ARRAY_SIZE(ovsrec_sflow_columns), - sizeof(struct ovsrec_sflow), ovsrec_sflow_init__}, -}; - -struct ovsdb_idl_class ovsrec_idl_class = { - "Open_vSwitch", ovsrec_table_classes, ARRAY_SIZE(ovsrec_table_classes) -}; - -void -ovsrec_init(void) -{ - if (inited) { - return; - } - assert_single_threaded(); - inited = true; - - ovsrec_bridge_columns_init(); - ovsrec_controller_columns_init(); - ovsrec_flow_sample_collector_set_columns_init(); - ovsrec_flow_table_columns_init(); - ovsrec_ipfix_columns_init(); - ovsrec_interface_columns_init(); - ovsrec_manager_columns_init(); - ovsrec_mirror_columns_init(); - ovsrec_netflow_columns_init(); - ovsrec_open_vswitch_columns_init(); - ovsrec_port_columns_init(); - ovsrec_qos_columns_init(); - ovsrec_queue_columns_init(); - ovsrec_ssl_columns_init(); - ovsrec_sflow_columns_init(); -} - -/* Return the schema version. The caller must not free the returned value. */ -const char * -ovsrec_get_db_version(void) -{ - return "7.6.2"; -} - diff -Nru openvswitch-2.3.1/lib/vswitch-idl.h openvswitch-2.4.0~git20150623/lib/vswitch-idl.h --- openvswitch-2.3.1/lib/vswitch-idl.h 2014-12-04 05:59:58.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vswitch-idl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1843 +0,0 @@ -/* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - -#ifndef OVSREC_IDL_HEADER -#define OVSREC_IDL_HEADER 1 - -#include -#include -#include -#include "ovsdb-data.h" -#include "ovsdb-idl-provider.h" -#include "smap.h" -#include "uuid.h" - -/* Bridge table. */ -struct ovsrec_bridge { - struct ovsdb_idl_row header_; - - /* controller column. */ - struct ovsrec_controller **controller; - size_t n_controller; - - /* datapath_id column. */ - char *datapath_id; - - /* datapath_type column. */ - char *datapath_type; /* Always nonnull. */ - - /* external_ids column. */ - struct smap external_ids; - - /* fail_mode column. */ - char *fail_mode; - - /* flood_vlans column. */ - int64_t *flood_vlans; - size_t n_flood_vlans; - - /* flow_tables column. */ - int64_t *key_flow_tables; - struct ovsrec_flow_table **value_flow_tables; - size_t n_flow_tables; - - /* ipfix column. */ - struct ovsrec_ipfix *ipfix; - - /* mirrors column. */ - struct ovsrec_mirror **mirrors; - size_t n_mirrors; - - /* name column. */ - char *name; /* Always nonnull. */ - - /* netflow column. */ - struct ovsrec_netflow *netflow; - - /* other_config column. */ - struct smap other_config; - - /* ports column. */ - struct ovsrec_port **ports; - size_t n_ports; - - /* protocols column. */ - char **protocols; - size_t n_protocols; - - /* sflow column. */ - struct ovsrec_sflow *sflow; - - /* status column. */ - struct smap status; - - /* stp_enable column. */ - bool stp_enable; -}; - -enum { - OVSREC_BRIDGE_COL_CONTROLLER, - OVSREC_BRIDGE_COL_DATAPATH_ID, - OVSREC_BRIDGE_COL_DATAPATH_TYPE, - OVSREC_BRIDGE_COL_EXTERNAL_IDS, - OVSREC_BRIDGE_COL_FAIL_MODE, - OVSREC_BRIDGE_COL_FLOOD_VLANS, - OVSREC_BRIDGE_COL_FLOW_TABLES, - OVSREC_BRIDGE_COL_IPFIX, - OVSREC_BRIDGE_COL_MIRRORS, - OVSREC_BRIDGE_COL_NAME, - OVSREC_BRIDGE_COL_NETFLOW, - OVSREC_BRIDGE_COL_OTHER_CONFIG, - OVSREC_BRIDGE_COL_PORTS, - OVSREC_BRIDGE_COL_PROTOCOLS, - OVSREC_BRIDGE_COL_SFLOW, - OVSREC_BRIDGE_COL_STATUS, - OVSREC_BRIDGE_COL_STP_ENABLE, - OVSREC_BRIDGE_N_COLUMNS -}; - -#define ovsrec_bridge_col_status (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_STATUS]) -#define ovsrec_bridge_col_fail_mode (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FAIL_MODE]) -#define ovsrec_bridge_col_datapath_id (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_DATAPATH_ID]) -#define ovsrec_bridge_col_datapath_type (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_DATAPATH_TYPE]) -#define ovsrec_bridge_col_sflow (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_SFLOW]) -#define ovsrec_bridge_col_mirrors (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_MIRRORS]) -#define ovsrec_bridge_col_ipfix (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_IPFIX]) -#define ovsrec_bridge_col_other_config (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_OTHER_CONFIG]) -#define ovsrec_bridge_col_flood_vlans (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FLOOD_VLANS]) -#define ovsrec_bridge_col_controller (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_CONTROLLER]) -#define ovsrec_bridge_col_netflow (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_NETFLOW]) -#define ovsrec_bridge_col_stp_enable (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_STP_ENABLE]) -#define ovsrec_bridge_col_flow_tables (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_FLOW_TABLES]) -#define ovsrec_bridge_col_external_ids (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_EXTERNAL_IDS]) -#define ovsrec_bridge_col_ports (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_PORTS]) -#define ovsrec_bridge_col_protocols (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_PROTOCOLS]) -#define ovsrec_bridge_col_name (ovsrec_bridge_columns[OVSREC_BRIDGE_COL_NAME]) - -extern struct ovsdb_idl_column ovsrec_bridge_columns[OVSREC_BRIDGE_N_COLUMNS]; - -const struct ovsrec_bridge *ovsrec_bridge_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_bridge *ovsrec_bridge_first(const struct ovsdb_idl *); -const struct ovsrec_bridge *ovsrec_bridge_next(const struct ovsrec_bridge *); -#define OVSREC_BRIDGE_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_bridge_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_bridge_next(ROW)) -#define OVSREC_BRIDGE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_bridge_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_bridge_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_bridge_init(struct ovsrec_bridge *); -void ovsrec_bridge_delete(const struct ovsrec_bridge *); -struct ovsrec_bridge *ovsrec_bridge_insert(struct ovsdb_idl_txn *); - -void ovsrec_bridge_verify_controller(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_datapath_id(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_datapath_type(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_external_ids(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_fail_mode(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_flood_vlans(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_flow_tables(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_ipfix(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_mirrors(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_name(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_netflow(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_other_config(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_ports(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_protocols(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_sflow(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_status(const struct ovsrec_bridge *); -void ovsrec_bridge_verify_stp_enable(const struct ovsrec_bridge *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_bridge directly.) */ -const struct ovsdb_datum *ovsrec_bridge_get_controller(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_datapath_id(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_datapath_type(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_external_ids(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_bridge_get_fail_mode(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_flood_vlans(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_flow_tables(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_bridge_get_ipfix(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_mirrors(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_name(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_netflow(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_other_config(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_bridge_get_ports(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_protocols(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_sflow(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_bridge_get_status(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_bridge_get_stp_enable(const struct ovsrec_bridge *, enum ovsdb_atomic_type key_type); - -void ovsrec_bridge_set_controller(const struct ovsrec_bridge *, struct ovsrec_controller **controller, size_t n_controller); -void ovsrec_bridge_set_datapath_id(const struct ovsrec_bridge *, const char *datapath_id); -void ovsrec_bridge_set_datapath_type(const struct ovsrec_bridge *, const char *datapath_type); -void ovsrec_bridge_set_external_ids(const struct ovsrec_bridge *, const struct smap *); -void ovsrec_bridge_set_fail_mode(const struct ovsrec_bridge *, const char *fail_mode); -void ovsrec_bridge_set_flood_vlans(const struct ovsrec_bridge *, const int64_t *flood_vlans, size_t n_flood_vlans); -void ovsrec_bridge_set_flow_tables(const struct ovsrec_bridge *, const int64_t *key_flow_tables, struct ovsrec_flow_table **value_flow_tables, size_t n_flow_tables); -void ovsrec_bridge_set_ipfix(const struct ovsrec_bridge *, const struct ovsrec_ipfix *ipfix); -void ovsrec_bridge_set_mirrors(const struct ovsrec_bridge *, struct ovsrec_mirror **mirrors, size_t n_mirrors); -void ovsrec_bridge_set_name(const struct ovsrec_bridge *, const char *name); -void ovsrec_bridge_set_netflow(const struct ovsrec_bridge *, const struct ovsrec_netflow *netflow); -void ovsrec_bridge_set_other_config(const struct ovsrec_bridge *, const struct smap *); -void ovsrec_bridge_set_ports(const struct ovsrec_bridge *, struct ovsrec_port **ports, size_t n_ports); -void ovsrec_bridge_set_protocols(const struct ovsrec_bridge *, char **protocols, size_t n_protocols); -void ovsrec_bridge_set_sflow(const struct ovsrec_bridge *, const struct ovsrec_sflow *sflow); -void ovsrec_bridge_set_status(const struct ovsrec_bridge *, const struct smap *); -void ovsrec_bridge_set_stp_enable(const struct ovsrec_bridge *, bool stp_enable); - - -/* Controller table. */ -struct ovsrec_controller { - struct ovsdb_idl_row header_; - - /* connection_mode column. */ - char *connection_mode; - - /* controller_burst_limit column. */ - int64_t *controller_burst_limit; - size_t n_controller_burst_limit; - - /* controller_rate_limit column. */ - int64_t *controller_rate_limit; - size_t n_controller_rate_limit; - - /* enable_async_messages column. */ - bool *enable_async_messages; - size_t n_enable_async_messages; - - /* external_ids column. */ - struct smap external_ids; - - /* inactivity_probe column. */ - int64_t *inactivity_probe; - size_t n_inactivity_probe; - - /* is_connected column. */ - bool is_connected; - - /* local_gateway column. */ - char *local_gateway; - - /* local_ip column. */ - char *local_ip; - - /* local_netmask column. */ - char *local_netmask; - - /* max_backoff column. */ - int64_t *max_backoff; - size_t n_max_backoff; - - /* other_config column. */ - struct smap other_config; - - /* role column. */ - char *role; - - /* status column. */ - struct smap status; - - /* target column. */ - char *target; /* Always nonnull. */ -}; - -enum { - OVSREC_CONTROLLER_COL_CONNECTION_MODE, - OVSREC_CONTROLLER_COL_CONTROLLER_BURST_LIMIT, - OVSREC_CONTROLLER_COL_CONTROLLER_RATE_LIMIT, - OVSREC_CONTROLLER_COL_ENABLE_ASYNC_MESSAGES, - OVSREC_CONTROLLER_COL_EXTERNAL_IDS, - OVSREC_CONTROLLER_COL_INACTIVITY_PROBE, - OVSREC_CONTROLLER_COL_IS_CONNECTED, - OVSREC_CONTROLLER_COL_LOCAL_GATEWAY, - OVSREC_CONTROLLER_COL_LOCAL_IP, - OVSREC_CONTROLLER_COL_LOCAL_NETMASK, - OVSREC_CONTROLLER_COL_MAX_BACKOFF, - OVSREC_CONTROLLER_COL_OTHER_CONFIG, - OVSREC_CONTROLLER_COL_ROLE, - OVSREC_CONTROLLER_COL_STATUS, - OVSREC_CONTROLLER_COL_TARGET, - OVSREC_CONTROLLER_N_COLUMNS -}; - -#define ovsrec_controller_col_max_backoff (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_MAX_BACKOFF]) -#define ovsrec_controller_col_status (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_STATUS]) -#define ovsrec_controller_col_target (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_TARGET]) -#define ovsrec_controller_col_local_ip (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_IP]) -#define ovsrec_controller_col_connection_mode (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONNECTION_MODE]) -#define ovsrec_controller_col_other_config (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_OTHER_CONFIG]) -#define ovsrec_controller_col_controller_rate_limit (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONTROLLER_RATE_LIMIT]) -#define ovsrec_controller_col_inactivity_probe (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_INACTIVITY_PROBE]) -#define ovsrec_controller_col_local_netmask (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_NETMASK]) -#define ovsrec_controller_col_role (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_ROLE]) -#define ovsrec_controller_col_controller_burst_limit (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_CONTROLLER_BURST_LIMIT]) -#define ovsrec_controller_col_external_ids (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_EXTERNAL_IDS]) -#define ovsrec_controller_col_local_gateway (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_LOCAL_GATEWAY]) -#define ovsrec_controller_col_is_connected (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_IS_CONNECTED]) -#define ovsrec_controller_col_enable_async_messages (ovsrec_controller_columns[OVSREC_CONTROLLER_COL_ENABLE_ASYNC_MESSAGES]) - -extern struct ovsdb_idl_column ovsrec_controller_columns[OVSREC_CONTROLLER_N_COLUMNS]; - -const struct ovsrec_controller *ovsrec_controller_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_controller *ovsrec_controller_first(const struct ovsdb_idl *); -const struct ovsrec_controller *ovsrec_controller_next(const struct ovsrec_controller *); -#define OVSREC_CONTROLLER_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_controller_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_controller_next(ROW)) -#define OVSREC_CONTROLLER_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_controller_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_controller_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_controller_init(struct ovsrec_controller *); -void ovsrec_controller_delete(const struct ovsrec_controller *); -struct ovsrec_controller *ovsrec_controller_insert(struct ovsdb_idl_txn *); - -void ovsrec_controller_verify_connection_mode(const struct ovsrec_controller *); -void ovsrec_controller_verify_controller_burst_limit(const struct ovsrec_controller *); -void ovsrec_controller_verify_controller_rate_limit(const struct ovsrec_controller *); -void ovsrec_controller_verify_enable_async_messages(const struct ovsrec_controller *); -void ovsrec_controller_verify_external_ids(const struct ovsrec_controller *); -void ovsrec_controller_verify_inactivity_probe(const struct ovsrec_controller *); -void ovsrec_controller_verify_is_connected(const struct ovsrec_controller *); -void ovsrec_controller_verify_local_gateway(const struct ovsrec_controller *); -void ovsrec_controller_verify_local_ip(const struct ovsrec_controller *); -void ovsrec_controller_verify_local_netmask(const struct ovsrec_controller *); -void ovsrec_controller_verify_max_backoff(const struct ovsrec_controller *); -void ovsrec_controller_verify_other_config(const struct ovsrec_controller *); -void ovsrec_controller_verify_role(const struct ovsrec_controller *); -void ovsrec_controller_verify_status(const struct ovsrec_controller *); -void ovsrec_controller_verify_target(const struct ovsrec_controller *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_controller directly.) */ -const struct ovsdb_datum *ovsrec_controller_get_connection_mode(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_controller_burst_limit(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_controller_rate_limit(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_enable_async_messages(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_external_ids(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_controller_get_inactivity_probe(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_is_connected(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_local_gateway(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_local_ip(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_local_netmask(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_max_backoff(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_other_config(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_controller_get_role(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_controller_get_status(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_controller_get_target(const struct ovsrec_controller *, enum ovsdb_atomic_type key_type); - -void ovsrec_controller_set_connection_mode(const struct ovsrec_controller *, const char *connection_mode); -void ovsrec_controller_set_controller_burst_limit(const struct ovsrec_controller *, const int64_t *controller_burst_limit, size_t n_controller_burst_limit); -void ovsrec_controller_set_controller_rate_limit(const struct ovsrec_controller *, const int64_t *controller_rate_limit, size_t n_controller_rate_limit); -void ovsrec_controller_set_enable_async_messages(const struct ovsrec_controller *, const bool *enable_async_messages, size_t n_enable_async_messages); -void ovsrec_controller_set_external_ids(const struct ovsrec_controller *, const struct smap *); -void ovsrec_controller_set_inactivity_probe(const struct ovsrec_controller *, const int64_t *inactivity_probe, size_t n_inactivity_probe); -void ovsrec_controller_set_is_connected(const struct ovsrec_controller *, bool is_connected); -void ovsrec_controller_set_local_gateway(const struct ovsrec_controller *, const char *local_gateway); -void ovsrec_controller_set_local_ip(const struct ovsrec_controller *, const char *local_ip); -void ovsrec_controller_set_local_netmask(const struct ovsrec_controller *, const char *local_netmask); -void ovsrec_controller_set_max_backoff(const struct ovsrec_controller *, const int64_t *max_backoff, size_t n_max_backoff); -void ovsrec_controller_set_other_config(const struct ovsrec_controller *, const struct smap *); -void ovsrec_controller_set_role(const struct ovsrec_controller *, const char *role); -void ovsrec_controller_set_status(const struct ovsrec_controller *, const struct smap *); -void ovsrec_controller_set_target(const struct ovsrec_controller *, const char *target); - - -/* Flow_Sample_Collector_Set table. */ -struct ovsrec_flow_sample_collector_set { - struct ovsdb_idl_row header_; - - /* bridge column. */ - struct ovsrec_bridge *bridge; - - /* external_ids column. */ - struct smap external_ids; - - /* id column. */ - int64_t id; - - /* ipfix column. */ - struct ovsrec_ipfix *ipfix; -}; - -enum { - OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_BRIDGE, - OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_EXTERNAL_IDS, - OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_ID, - OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_IPFIX, - OVSREC_FLOW_SAMPLE_COLLECTOR_SET_N_COLUMNS -}; - -#define ovsrec_flow_sample_collector_set_col_bridge (ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_BRIDGE]) -#define ovsrec_flow_sample_collector_set_col_external_ids (ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_EXTERNAL_IDS]) -#define ovsrec_flow_sample_collector_set_col_id (ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_ID]) -#define ovsrec_flow_sample_collector_set_col_ipfix (ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_COL_IPFIX]) - -extern struct ovsdb_idl_column ovsrec_flow_sample_collector_set_columns[OVSREC_FLOW_SAMPLE_COLLECTOR_SET_N_COLUMNS]; - -const struct ovsrec_flow_sample_collector_set *ovsrec_flow_sample_collector_set_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_flow_sample_collector_set *ovsrec_flow_sample_collector_set_first(const struct ovsdb_idl *); -const struct ovsrec_flow_sample_collector_set *ovsrec_flow_sample_collector_set_next(const struct ovsrec_flow_sample_collector_set *); -#define OVSREC_FLOW_SAMPLE_COLLECTOR_SET_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_flow_sample_collector_set_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_flow_sample_collector_set_next(ROW)) -#define OVSREC_FLOW_SAMPLE_COLLECTOR_SET_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_flow_sample_collector_set_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_flow_sample_collector_set_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_flow_sample_collector_set_init(struct ovsrec_flow_sample_collector_set *); -void ovsrec_flow_sample_collector_set_delete(const struct ovsrec_flow_sample_collector_set *); -struct ovsrec_flow_sample_collector_set *ovsrec_flow_sample_collector_set_insert(struct ovsdb_idl_txn *); - -void ovsrec_flow_sample_collector_set_verify_bridge(const struct ovsrec_flow_sample_collector_set *); -void ovsrec_flow_sample_collector_set_verify_external_ids(const struct ovsrec_flow_sample_collector_set *); -void ovsrec_flow_sample_collector_set_verify_id(const struct ovsrec_flow_sample_collector_set *); -void ovsrec_flow_sample_collector_set_verify_ipfix(const struct ovsrec_flow_sample_collector_set *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_flow_sample_collector_set directly.) */ -const struct ovsdb_datum *ovsrec_flow_sample_collector_set_get_bridge(const struct ovsrec_flow_sample_collector_set *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_flow_sample_collector_set_get_external_ids(const struct ovsrec_flow_sample_collector_set *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_flow_sample_collector_set_get_id(const struct ovsrec_flow_sample_collector_set *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_flow_sample_collector_set_get_ipfix(const struct ovsrec_flow_sample_collector_set *, enum ovsdb_atomic_type key_type); - -void ovsrec_flow_sample_collector_set_set_bridge(const struct ovsrec_flow_sample_collector_set *, const struct ovsrec_bridge *bridge); -void ovsrec_flow_sample_collector_set_set_external_ids(const struct ovsrec_flow_sample_collector_set *, const struct smap *); -void ovsrec_flow_sample_collector_set_set_id(const struct ovsrec_flow_sample_collector_set *, int64_t id); -void ovsrec_flow_sample_collector_set_set_ipfix(const struct ovsrec_flow_sample_collector_set *, const struct ovsrec_ipfix *ipfix); - - -/* Flow_Table table. */ -struct ovsrec_flow_table { - struct ovsdb_idl_row header_; - - /* external_ids column. */ - struct smap external_ids; - - /* flow_limit column. */ - int64_t *flow_limit; - size_t n_flow_limit; - - /* groups column. */ - char **groups; - size_t n_groups; - - /* name column. */ - char *name; - - /* overflow_policy column. */ - char *overflow_policy; - - /* prefixes column. */ - char **prefixes; - size_t n_prefixes; -}; - -enum { - OVSREC_FLOW_TABLE_COL_EXTERNAL_IDS, - OVSREC_FLOW_TABLE_COL_FLOW_LIMIT, - OVSREC_FLOW_TABLE_COL_GROUPS, - OVSREC_FLOW_TABLE_COL_NAME, - OVSREC_FLOW_TABLE_COL_OVERFLOW_POLICY, - OVSREC_FLOW_TABLE_COL_PREFIXES, - OVSREC_FLOW_TABLE_N_COLUMNS -}; - -#define ovsrec_flow_table_col_overflow_policy (ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_OVERFLOW_POLICY]) -#define ovsrec_flow_table_col_name (ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_NAME]) -#define ovsrec_flow_table_col_flow_limit (ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_FLOW_LIMIT]) -#define ovsrec_flow_table_col_prefixes (ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_PREFIXES]) -#define ovsrec_flow_table_col_groups (ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_GROUPS]) -#define ovsrec_flow_table_col_external_ids (ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_COL_EXTERNAL_IDS]) - -extern struct ovsdb_idl_column ovsrec_flow_table_columns[OVSREC_FLOW_TABLE_N_COLUMNS]; - -const struct ovsrec_flow_table *ovsrec_flow_table_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_flow_table *ovsrec_flow_table_first(const struct ovsdb_idl *); -const struct ovsrec_flow_table *ovsrec_flow_table_next(const struct ovsrec_flow_table *); -#define OVSREC_FLOW_TABLE_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_flow_table_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_flow_table_next(ROW)) -#define OVSREC_FLOW_TABLE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_flow_table_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_flow_table_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_flow_table_init(struct ovsrec_flow_table *); -void ovsrec_flow_table_delete(const struct ovsrec_flow_table *); -struct ovsrec_flow_table *ovsrec_flow_table_insert(struct ovsdb_idl_txn *); - -void ovsrec_flow_table_verify_external_ids(const struct ovsrec_flow_table *); -void ovsrec_flow_table_verify_flow_limit(const struct ovsrec_flow_table *); -void ovsrec_flow_table_verify_groups(const struct ovsrec_flow_table *); -void ovsrec_flow_table_verify_name(const struct ovsrec_flow_table *); -void ovsrec_flow_table_verify_overflow_policy(const struct ovsrec_flow_table *); -void ovsrec_flow_table_verify_prefixes(const struct ovsrec_flow_table *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_flow_table directly.) */ -const struct ovsdb_datum *ovsrec_flow_table_get_external_ids(const struct ovsrec_flow_table *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_flow_table_get_flow_limit(const struct ovsrec_flow_table *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_flow_table_get_groups(const struct ovsrec_flow_table *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_flow_table_get_name(const struct ovsrec_flow_table *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_flow_table_get_overflow_policy(const struct ovsrec_flow_table *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_flow_table_get_prefixes(const struct ovsrec_flow_table *, enum ovsdb_atomic_type key_type); - -void ovsrec_flow_table_set_external_ids(const struct ovsrec_flow_table *, const struct smap *); -void ovsrec_flow_table_set_flow_limit(const struct ovsrec_flow_table *, const int64_t *flow_limit, size_t n_flow_limit); -void ovsrec_flow_table_set_groups(const struct ovsrec_flow_table *, char **groups, size_t n_groups); -void ovsrec_flow_table_set_name(const struct ovsrec_flow_table *, const char *name); -void ovsrec_flow_table_set_overflow_policy(const struct ovsrec_flow_table *, const char *overflow_policy); -void ovsrec_flow_table_set_prefixes(const struct ovsrec_flow_table *, char **prefixes, size_t n_prefixes); - - -/* IPFIX table. */ -struct ovsrec_ipfix { - struct ovsdb_idl_row header_; - - /* cache_active_timeout column. */ - int64_t *cache_active_timeout; - size_t n_cache_active_timeout; - - /* cache_max_flows column. */ - int64_t *cache_max_flows; - size_t n_cache_max_flows; - - /* external_ids column. */ - struct smap external_ids; - - /* obs_domain_id column. */ - int64_t *obs_domain_id; - size_t n_obs_domain_id; - - /* obs_point_id column. */ - int64_t *obs_point_id; - size_t n_obs_point_id; - - /* sampling column. */ - int64_t *sampling; - size_t n_sampling; - - /* targets column. */ - char **targets; - size_t n_targets; -}; - -enum { - OVSREC_IPFIX_COL_CACHE_ACTIVE_TIMEOUT, - OVSREC_IPFIX_COL_CACHE_MAX_FLOWS, - OVSREC_IPFIX_COL_EXTERNAL_IDS, - OVSREC_IPFIX_COL_OBS_DOMAIN_ID, - OVSREC_IPFIX_COL_OBS_POINT_ID, - OVSREC_IPFIX_COL_SAMPLING, - OVSREC_IPFIX_COL_TARGETS, - OVSREC_IPFIX_N_COLUMNS -}; - -#define ovsrec_ipfix_col_obs_point_id (ovsrec_ipfix_columns[OVSREC_IPFIX_COL_OBS_POINT_ID]) -#define ovsrec_ipfix_col_cache_active_timeout (ovsrec_ipfix_columns[OVSREC_IPFIX_COL_CACHE_ACTIVE_TIMEOUT]) -#define ovsrec_ipfix_col_cache_max_flows (ovsrec_ipfix_columns[OVSREC_IPFIX_COL_CACHE_MAX_FLOWS]) -#define ovsrec_ipfix_col_obs_domain_id (ovsrec_ipfix_columns[OVSREC_IPFIX_COL_OBS_DOMAIN_ID]) -#define ovsrec_ipfix_col_sampling (ovsrec_ipfix_columns[OVSREC_IPFIX_COL_SAMPLING]) -#define ovsrec_ipfix_col_external_ids (ovsrec_ipfix_columns[OVSREC_IPFIX_COL_EXTERNAL_IDS]) -#define ovsrec_ipfix_col_targets (ovsrec_ipfix_columns[OVSREC_IPFIX_COL_TARGETS]) - -extern struct ovsdb_idl_column ovsrec_ipfix_columns[OVSREC_IPFIX_N_COLUMNS]; - -const struct ovsrec_ipfix *ovsrec_ipfix_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_ipfix *ovsrec_ipfix_first(const struct ovsdb_idl *); -const struct ovsrec_ipfix *ovsrec_ipfix_next(const struct ovsrec_ipfix *); -#define OVSREC_IPFIX_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_ipfix_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_ipfix_next(ROW)) -#define OVSREC_IPFIX_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_ipfix_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_ipfix_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_ipfix_init(struct ovsrec_ipfix *); -void ovsrec_ipfix_delete(const struct ovsrec_ipfix *); -struct ovsrec_ipfix *ovsrec_ipfix_insert(struct ovsdb_idl_txn *); - -void ovsrec_ipfix_verify_cache_active_timeout(const struct ovsrec_ipfix *); -void ovsrec_ipfix_verify_cache_max_flows(const struct ovsrec_ipfix *); -void ovsrec_ipfix_verify_external_ids(const struct ovsrec_ipfix *); -void ovsrec_ipfix_verify_obs_domain_id(const struct ovsrec_ipfix *); -void ovsrec_ipfix_verify_obs_point_id(const struct ovsrec_ipfix *); -void ovsrec_ipfix_verify_sampling(const struct ovsrec_ipfix *); -void ovsrec_ipfix_verify_targets(const struct ovsrec_ipfix *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_ipfix directly.) */ -const struct ovsdb_datum *ovsrec_ipfix_get_cache_active_timeout(const struct ovsrec_ipfix *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ipfix_get_cache_max_flows(const struct ovsrec_ipfix *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ipfix_get_external_ids(const struct ovsrec_ipfix *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_ipfix_get_obs_domain_id(const struct ovsrec_ipfix *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ipfix_get_obs_point_id(const struct ovsrec_ipfix *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ipfix_get_sampling(const struct ovsrec_ipfix *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ipfix_get_targets(const struct ovsrec_ipfix *, enum ovsdb_atomic_type key_type); - -void ovsrec_ipfix_set_cache_active_timeout(const struct ovsrec_ipfix *, const int64_t *cache_active_timeout, size_t n_cache_active_timeout); -void ovsrec_ipfix_set_cache_max_flows(const struct ovsrec_ipfix *, const int64_t *cache_max_flows, size_t n_cache_max_flows); -void ovsrec_ipfix_set_external_ids(const struct ovsrec_ipfix *, const struct smap *); -void ovsrec_ipfix_set_obs_domain_id(const struct ovsrec_ipfix *, const int64_t *obs_domain_id, size_t n_obs_domain_id); -void ovsrec_ipfix_set_obs_point_id(const struct ovsrec_ipfix *, const int64_t *obs_point_id, size_t n_obs_point_id); -void ovsrec_ipfix_set_sampling(const struct ovsrec_ipfix *, const int64_t *sampling, size_t n_sampling); -void ovsrec_ipfix_set_targets(const struct ovsrec_ipfix *, char **targets, size_t n_targets); - - -/* Interface table. */ -struct ovsrec_interface { - struct ovsdb_idl_row header_; - - /* admin_state column. */ - char *admin_state; - - /* bfd column. */ - struct smap bfd; - - /* bfd_status column. */ - struct smap bfd_status; - - /* cfm_fault column. */ - bool *cfm_fault; - size_t n_cfm_fault; - - /* cfm_fault_status column. */ - char **cfm_fault_status; - size_t n_cfm_fault_status; - - /* cfm_flap_count column. */ - int64_t *cfm_flap_count; - size_t n_cfm_flap_count; - - /* cfm_health column. */ - int64_t *cfm_health; - size_t n_cfm_health; - - /* cfm_mpid column. */ - int64_t *cfm_mpid; - size_t n_cfm_mpid; - - /* cfm_remote_mpids column. */ - int64_t *cfm_remote_mpids; - size_t n_cfm_remote_mpids; - - /* cfm_remote_opstate column. */ - char *cfm_remote_opstate; - - /* duplex column. */ - char *duplex; - - /* external_ids column. */ - struct smap external_ids; - - /* ifindex column. */ - int64_t *ifindex; - size_t n_ifindex; - - /* ingress_policing_burst column. */ - int64_t ingress_policing_burst; - - /* ingress_policing_rate column. */ - int64_t ingress_policing_rate; - - /* lacp_current column. */ - bool *lacp_current; - size_t n_lacp_current; - - /* link_resets column. */ - int64_t *link_resets; - size_t n_link_resets; - - /* link_speed column. */ - int64_t *link_speed; - size_t n_link_speed; - - /* link_state column. */ - char *link_state; - - /* mac column. */ - char *mac; - - /* mac_in_use column. */ - char *mac_in_use; - - /* mtu column. */ - int64_t *mtu; - size_t n_mtu; - - /* name column. */ - char *name; /* Always nonnull. */ - - /* ofport column. */ - int64_t *ofport; - size_t n_ofport; - - /* ofport_request column. */ - int64_t *ofport_request; - size_t n_ofport_request; - - /* options column. */ - struct smap options; - - /* other_config column. */ - struct smap other_config; - - /* statistics column. */ - char **key_statistics; - int64_t *value_statistics; - size_t n_statistics; - - /* status column. */ - struct smap status; - - /* type column. */ - char *type; /* Always nonnull. */ -}; - -enum { - OVSREC_INTERFACE_COL_ADMIN_STATE, - OVSREC_INTERFACE_COL_BFD, - OVSREC_INTERFACE_COL_BFD_STATUS, - OVSREC_INTERFACE_COL_CFM_FAULT, - OVSREC_INTERFACE_COL_CFM_FAULT_STATUS, - OVSREC_INTERFACE_COL_CFM_FLAP_COUNT, - OVSREC_INTERFACE_COL_CFM_HEALTH, - OVSREC_INTERFACE_COL_CFM_MPID, - OVSREC_INTERFACE_COL_CFM_REMOTE_MPIDS, - OVSREC_INTERFACE_COL_CFM_REMOTE_OPSTATE, - OVSREC_INTERFACE_COL_DUPLEX, - OVSREC_INTERFACE_COL_EXTERNAL_IDS, - OVSREC_INTERFACE_COL_IFINDEX, - OVSREC_INTERFACE_COL_INGRESS_POLICING_BURST, - OVSREC_INTERFACE_COL_INGRESS_POLICING_RATE, - OVSREC_INTERFACE_COL_LACP_CURRENT, - OVSREC_INTERFACE_COL_LINK_RESETS, - OVSREC_INTERFACE_COL_LINK_SPEED, - OVSREC_INTERFACE_COL_LINK_STATE, - OVSREC_INTERFACE_COL_MAC, - OVSREC_INTERFACE_COL_MAC_IN_USE, - OVSREC_INTERFACE_COL_MTU, - OVSREC_INTERFACE_COL_NAME, - OVSREC_INTERFACE_COL_OFPORT, - OVSREC_INTERFACE_COL_OFPORT_REQUEST, - OVSREC_INTERFACE_COL_OPTIONS, - OVSREC_INTERFACE_COL_OTHER_CONFIG, - OVSREC_INTERFACE_COL_STATISTICS, - OVSREC_INTERFACE_COL_STATUS, - OVSREC_INTERFACE_COL_TYPE, - OVSREC_INTERFACE_N_COLUMNS -}; - -#define ovsrec_interface_col_cfm_remote_opstate (ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_REMOTE_OPSTATE]) -#define ovsrec_interface_col_link_state (ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_STATE]) -#define ovsrec_interface_col_cfm_fault (ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FAULT]) -#define ovsrec_interface_col_ofport_request (ovsrec_interface_columns[OVSREC_INTERFACE_COL_OFPORT_REQUEST]) -#define ovsrec_interface_col_ingress_policing_rate (ovsrec_interface_columns[OVSREC_INTERFACE_COL_INGRESS_POLICING_RATE]) -#define ovsrec_interface_col_link_resets (ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_RESETS]) -#define ovsrec_interface_col_statistics (ovsrec_interface_columns[OVSREC_INTERFACE_COL_STATISTICS]) -#define ovsrec_interface_col_bfd (ovsrec_interface_columns[OVSREC_INTERFACE_COL_BFD]) -#define ovsrec_interface_col_duplex (ovsrec_interface_columns[OVSREC_INTERFACE_COL_DUPLEX]) -#define ovsrec_interface_col_cfm_health (ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_HEALTH]) -#define ovsrec_interface_col_bfd_status (ovsrec_interface_columns[OVSREC_INTERFACE_COL_BFD_STATUS]) -#define ovsrec_interface_col_type (ovsrec_interface_columns[OVSREC_INTERFACE_COL_TYPE]) -#define ovsrec_interface_col_lacp_current (ovsrec_interface_columns[OVSREC_INTERFACE_COL_LACP_CURRENT]) -#define ovsrec_interface_col_status (ovsrec_interface_columns[OVSREC_INTERFACE_COL_STATUS]) -#define ovsrec_interface_col_ingress_policing_burst (ovsrec_interface_columns[OVSREC_INTERFACE_COL_INGRESS_POLICING_BURST]) -#define ovsrec_interface_col_mac_in_use (ovsrec_interface_columns[OVSREC_INTERFACE_COL_MAC_IN_USE]) -#define ovsrec_interface_col_mac (ovsrec_interface_columns[OVSREC_INTERFACE_COL_MAC]) -#define ovsrec_interface_col_admin_state (ovsrec_interface_columns[OVSREC_INTERFACE_COL_ADMIN_STATE]) -#define ovsrec_interface_col_external_ids (ovsrec_interface_columns[OVSREC_INTERFACE_COL_EXTERNAL_IDS]) -#define ovsrec_interface_col_ofport (ovsrec_interface_columns[OVSREC_INTERFACE_COL_OFPORT]) -#define ovsrec_interface_col_name (ovsrec_interface_columns[OVSREC_INTERFACE_COL_NAME]) -#define ovsrec_interface_col_other_config (ovsrec_interface_columns[OVSREC_INTERFACE_COL_OTHER_CONFIG]) -#define ovsrec_interface_col_link_speed (ovsrec_interface_columns[OVSREC_INTERFACE_COL_LINK_SPEED]) -#define ovsrec_interface_col_mtu (ovsrec_interface_columns[OVSREC_INTERFACE_COL_MTU]) -#define ovsrec_interface_col_cfm_flap_count (ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FLAP_COUNT]) -#define ovsrec_interface_col_cfm_mpid (ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_MPID]) -#define ovsrec_interface_col_ifindex (ovsrec_interface_columns[OVSREC_INTERFACE_COL_IFINDEX]) -#define ovsrec_interface_col_options (ovsrec_interface_columns[OVSREC_INTERFACE_COL_OPTIONS]) -#define ovsrec_interface_col_cfm_fault_status (ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_FAULT_STATUS]) -#define ovsrec_interface_col_cfm_remote_mpids (ovsrec_interface_columns[OVSREC_INTERFACE_COL_CFM_REMOTE_MPIDS]) - -extern struct ovsdb_idl_column ovsrec_interface_columns[OVSREC_INTERFACE_N_COLUMNS]; - -const struct ovsrec_interface *ovsrec_interface_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_interface *ovsrec_interface_first(const struct ovsdb_idl *); -const struct ovsrec_interface *ovsrec_interface_next(const struct ovsrec_interface *); -#define OVSREC_INTERFACE_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_interface_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_interface_next(ROW)) -#define OVSREC_INTERFACE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_interface_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_interface_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_interface_init(struct ovsrec_interface *); -void ovsrec_interface_delete(const struct ovsrec_interface *); -struct ovsrec_interface *ovsrec_interface_insert(struct ovsdb_idl_txn *); - -void ovsrec_interface_verify_admin_state(const struct ovsrec_interface *); -void ovsrec_interface_verify_bfd(const struct ovsrec_interface *); -void ovsrec_interface_verify_bfd_status(const struct ovsrec_interface *); -void ovsrec_interface_verify_cfm_fault(const struct ovsrec_interface *); -void ovsrec_interface_verify_cfm_fault_status(const struct ovsrec_interface *); -void ovsrec_interface_verify_cfm_flap_count(const struct ovsrec_interface *); -void ovsrec_interface_verify_cfm_health(const struct ovsrec_interface *); -void ovsrec_interface_verify_cfm_mpid(const struct ovsrec_interface *); -void ovsrec_interface_verify_cfm_remote_mpids(const struct ovsrec_interface *); -void ovsrec_interface_verify_cfm_remote_opstate(const struct ovsrec_interface *); -void ovsrec_interface_verify_duplex(const struct ovsrec_interface *); -void ovsrec_interface_verify_external_ids(const struct ovsrec_interface *); -void ovsrec_interface_verify_ifindex(const struct ovsrec_interface *); -void ovsrec_interface_verify_ingress_policing_burst(const struct ovsrec_interface *); -void ovsrec_interface_verify_ingress_policing_rate(const struct ovsrec_interface *); -void ovsrec_interface_verify_lacp_current(const struct ovsrec_interface *); -void ovsrec_interface_verify_link_resets(const struct ovsrec_interface *); -void ovsrec_interface_verify_link_speed(const struct ovsrec_interface *); -void ovsrec_interface_verify_link_state(const struct ovsrec_interface *); -void ovsrec_interface_verify_mac(const struct ovsrec_interface *); -void ovsrec_interface_verify_mac_in_use(const struct ovsrec_interface *); -void ovsrec_interface_verify_mtu(const struct ovsrec_interface *); -void ovsrec_interface_verify_name(const struct ovsrec_interface *); -void ovsrec_interface_verify_ofport(const struct ovsrec_interface *); -void ovsrec_interface_verify_ofport_request(const struct ovsrec_interface *); -void ovsrec_interface_verify_options(const struct ovsrec_interface *); -void ovsrec_interface_verify_other_config(const struct ovsrec_interface *); -void ovsrec_interface_verify_statistics(const struct ovsrec_interface *); -void ovsrec_interface_verify_status(const struct ovsrec_interface *); -void ovsrec_interface_verify_type(const struct ovsrec_interface *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_interface directly.) */ -const struct ovsdb_datum *ovsrec_interface_get_admin_state(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_bfd(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_interface_get_bfd_status(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_interface_get_cfm_fault(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_cfm_fault_status(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_cfm_flap_count(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_cfm_health(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_cfm_mpid(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_cfm_remote_mpids(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_cfm_remote_opstate(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_duplex(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_external_ids(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_interface_get_ifindex(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_ingress_policing_burst(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_ingress_policing_rate(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_lacp_current(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_link_resets(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_link_speed(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_link_state(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_mac(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_mac_in_use(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_mtu(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_name(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_ofport(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_ofport_request(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_interface_get_options(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_interface_get_other_config(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_interface_get_statistics(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_interface_get_status(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_interface_get_type(const struct ovsrec_interface *, enum ovsdb_atomic_type key_type); - -void ovsrec_interface_set_admin_state(const struct ovsrec_interface *, const char *admin_state); -void ovsrec_interface_set_bfd(const struct ovsrec_interface *, const struct smap *); -void ovsrec_interface_set_bfd_status(const struct ovsrec_interface *, const struct smap *); -void ovsrec_interface_set_cfm_fault(const struct ovsrec_interface *, const bool *cfm_fault, size_t n_cfm_fault); -void ovsrec_interface_set_cfm_fault_status(const struct ovsrec_interface *, char **cfm_fault_status, size_t n_cfm_fault_status); -void ovsrec_interface_set_cfm_flap_count(const struct ovsrec_interface *, const int64_t *cfm_flap_count, size_t n_cfm_flap_count); -void ovsrec_interface_set_cfm_health(const struct ovsrec_interface *, const int64_t *cfm_health, size_t n_cfm_health); -void ovsrec_interface_set_cfm_mpid(const struct ovsrec_interface *, const int64_t *cfm_mpid, size_t n_cfm_mpid); -void ovsrec_interface_set_cfm_remote_mpids(const struct ovsrec_interface *, const int64_t *cfm_remote_mpids, size_t n_cfm_remote_mpids); -void ovsrec_interface_set_cfm_remote_opstate(const struct ovsrec_interface *, const char *cfm_remote_opstate); -void ovsrec_interface_set_duplex(const struct ovsrec_interface *, const char *duplex); -void ovsrec_interface_set_external_ids(const struct ovsrec_interface *, const struct smap *); -void ovsrec_interface_set_ifindex(const struct ovsrec_interface *, const int64_t *ifindex, size_t n_ifindex); -void ovsrec_interface_set_ingress_policing_burst(const struct ovsrec_interface *, int64_t ingress_policing_burst); -void ovsrec_interface_set_ingress_policing_rate(const struct ovsrec_interface *, int64_t ingress_policing_rate); -void ovsrec_interface_set_lacp_current(const struct ovsrec_interface *, const bool *lacp_current, size_t n_lacp_current); -void ovsrec_interface_set_link_resets(const struct ovsrec_interface *, const int64_t *link_resets, size_t n_link_resets); -void ovsrec_interface_set_link_speed(const struct ovsrec_interface *, const int64_t *link_speed, size_t n_link_speed); -void ovsrec_interface_set_link_state(const struct ovsrec_interface *, const char *link_state); -void ovsrec_interface_set_mac(const struct ovsrec_interface *, const char *mac); -void ovsrec_interface_set_mac_in_use(const struct ovsrec_interface *, const char *mac_in_use); -void ovsrec_interface_set_mtu(const struct ovsrec_interface *, const int64_t *mtu, size_t n_mtu); -void ovsrec_interface_set_name(const struct ovsrec_interface *, const char *name); -void ovsrec_interface_set_ofport(const struct ovsrec_interface *, const int64_t *ofport, size_t n_ofport); -void ovsrec_interface_set_ofport_request(const struct ovsrec_interface *, const int64_t *ofport_request, size_t n_ofport_request); -void ovsrec_interface_set_options(const struct ovsrec_interface *, const struct smap *); -void ovsrec_interface_set_other_config(const struct ovsrec_interface *, const struct smap *); -void ovsrec_interface_set_statistics(const struct ovsrec_interface *, char **key_statistics, const int64_t *value_statistics, size_t n_statistics); -void ovsrec_interface_set_status(const struct ovsrec_interface *, const struct smap *); -void ovsrec_interface_set_type(const struct ovsrec_interface *, const char *type); - - -/* Manager table. */ -struct ovsrec_manager { - struct ovsdb_idl_row header_; - - /* connection_mode column. */ - char *connection_mode; - - /* external_ids column. */ - struct smap external_ids; - - /* inactivity_probe column. */ - int64_t *inactivity_probe; - size_t n_inactivity_probe; - - /* is_connected column. */ - bool is_connected; - - /* max_backoff column. */ - int64_t *max_backoff; - size_t n_max_backoff; - - /* other_config column. */ - struct smap other_config; - - /* status column. */ - struct smap status; - - /* target column. */ - char *target; /* Always nonnull. */ -}; - -enum { - OVSREC_MANAGER_COL_CONNECTION_MODE, - OVSREC_MANAGER_COL_EXTERNAL_IDS, - OVSREC_MANAGER_COL_INACTIVITY_PROBE, - OVSREC_MANAGER_COL_IS_CONNECTED, - OVSREC_MANAGER_COL_MAX_BACKOFF, - OVSREC_MANAGER_COL_OTHER_CONFIG, - OVSREC_MANAGER_COL_STATUS, - OVSREC_MANAGER_COL_TARGET, - OVSREC_MANAGER_N_COLUMNS -}; - -#define ovsrec_manager_col_max_backoff (ovsrec_manager_columns[OVSREC_MANAGER_COL_MAX_BACKOFF]) -#define ovsrec_manager_col_status (ovsrec_manager_columns[OVSREC_MANAGER_COL_STATUS]) -#define ovsrec_manager_col_target (ovsrec_manager_columns[OVSREC_MANAGER_COL_TARGET]) -#define ovsrec_manager_col_connection_mode (ovsrec_manager_columns[OVSREC_MANAGER_COL_CONNECTION_MODE]) -#define ovsrec_manager_col_other_config (ovsrec_manager_columns[OVSREC_MANAGER_COL_OTHER_CONFIG]) -#define ovsrec_manager_col_inactivity_probe (ovsrec_manager_columns[OVSREC_MANAGER_COL_INACTIVITY_PROBE]) -#define ovsrec_manager_col_external_ids (ovsrec_manager_columns[OVSREC_MANAGER_COL_EXTERNAL_IDS]) -#define ovsrec_manager_col_is_connected (ovsrec_manager_columns[OVSREC_MANAGER_COL_IS_CONNECTED]) - -extern struct ovsdb_idl_column ovsrec_manager_columns[OVSREC_MANAGER_N_COLUMNS]; - -const struct ovsrec_manager *ovsrec_manager_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_manager *ovsrec_manager_first(const struct ovsdb_idl *); -const struct ovsrec_manager *ovsrec_manager_next(const struct ovsrec_manager *); -#define OVSREC_MANAGER_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_manager_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_manager_next(ROW)) -#define OVSREC_MANAGER_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_manager_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_manager_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_manager_init(struct ovsrec_manager *); -void ovsrec_manager_delete(const struct ovsrec_manager *); -struct ovsrec_manager *ovsrec_manager_insert(struct ovsdb_idl_txn *); - -void ovsrec_manager_verify_connection_mode(const struct ovsrec_manager *); -void ovsrec_manager_verify_external_ids(const struct ovsrec_manager *); -void ovsrec_manager_verify_inactivity_probe(const struct ovsrec_manager *); -void ovsrec_manager_verify_is_connected(const struct ovsrec_manager *); -void ovsrec_manager_verify_max_backoff(const struct ovsrec_manager *); -void ovsrec_manager_verify_other_config(const struct ovsrec_manager *); -void ovsrec_manager_verify_status(const struct ovsrec_manager *); -void ovsrec_manager_verify_target(const struct ovsrec_manager *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_manager directly.) */ -const struct ovsdb_datum *ovsrec_manager_get_connection_mode(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_manager_get_external_ids(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_manager_get_inactivity_probe(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_manager_get_is_connected(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_manager_get_max_backoff(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_manager_get_other_config(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_manager_get_status(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_manager_get_target(const struct ovsrec_manager *, enum ovsdb_atomic_type key_type); - -void ovsrec_manager_set_connection_mode(const struct ovsrec_manager *, const char *connection_mode); -void ovsrec_manager_set_external_ids(const struct ovsrec_manager *, const struct smap *); -void ovsrec_manager_set_inactivity_probe(const struct ovsrec_manager *, const int64_t *inactivity_probe, size_t n_inactivity_probe); -void ovsrec_manager_set_is_connected(const struct ovsrec_manager *, bool is_connected); -void ovsrec_manager_set_max_backoff(const struct ovsrec_manager *, const int64_t *max_backoff, size_t n_max_backoff); -void ovsrec_manager_set_other_config(const struct ovsrec_manager *, const struct smap *); -void ovsrec_manager_set_status(const struct ovsrec_manager *, const struct smap *); -void ovsrec_manager_set_target(const struct ovsrec_manager *, const char *target); - - -/* Mirror table. */ -struct ovsrec_mirror { - struct ovsdb_idl_row header_; - - /* external_ids column. */ - struct smap external_ids; - - /* name column. */ - char *name; /* Always nonnull. */ - - /* output_port column. */ - struct ovsrec_port *output_port; - - /* output_vlan column. */ - int64_t *output_vlan; - size_t n_output_vlan; - - /* select_all column. */ - bool select_all; - - /* select_dst_port column. */ - struct ovsrec_port **select_dst_port; - size_t n_select_dst_port; - - /* select_src_port column. */ - struct ovsrec_port **select_src_port; - size_t n_select_src_port; - - /* select_vlan column. */ - int64_t *select_vlan; - size_t n_select_vlan; - - /* statistics column. */ - char **key_statistics; - int64_t *value_statistics; - size_t n_statistics; -}; - -enum { - OVSREC_MIRROR_COL_EXTERNAL_IDS, - OVSREC_MIRROR_COL_NAME, - OVSREC_MIRROR_COL_OUTPUT_PORT, - OVSREC_MIRROR_COL_OUTPUT_VLAN, - OVSREC_MIRROR_COL_SELECT_ALL, - OVSREC_MIRROR_COL_SELECT_DST_PORT, - OVSREC_MIRROR_COL_SELECT_SRC_PORT, - OVSREC_MIRROR_COL_SELECT_VLAN, - OVSREC_MIRROR_COL_STATISTICS, - OVSREC_MIRROR_N_COLUMNS -}; - -#define ovsrec_mirror_col_output_port (ovsrec_mirror_columns[OVSREC_MIRROR_COL_OUTPUT_PORT]) -#define ovsrec_mirror_col_select_src_port (ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_SRC_PORT]) -#define ovsrec_mirror_col_statistics (ovsrec_mirror_columns[OVSREC_MIRROR_COL_STATISTICS]) -#define ovsrec_mirror_col_name (ovsrec_mirror_columns[OVSREC_MIRROR_COL_NAME]) -#define ovsrec_mirror_col_select_all (ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_ALL]) -#define ovsrec_mirror_col_select_dst_port (ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_DST_PORT]) -#define ovsrec_mirror_col_external_ids (ovsrec_mirror_columns[OVSREC_MIRROR_COL_EXTERNAL_IDS]) -#define ovsrec_mirror_col_output_vlan (ovsrec_mirror_columns[OVSREC_MIRROR_COL_OUTPUT_VLAN]) -#define ovsrec_mirror_col_select_vlan (ovsrec_mirror_columns[OVSREC_MIRROR_COL_SELECT_VLAN]) - -extern struct ovsdb_idl_column ovsrec_mirror_columns[OVSREC_MIRROR_N_COLUMNS]; - -const struct ovsrec_mirror *ovsrec_mirror_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_mirror *ovsrec_mirror_first(const struct ovsdb_idl *); -const struct ovsrec_mirror *ovsrec_mirror_next(const struct ovsrec_mirror *); -#define OVSREC_MIRROR_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_mirror_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_mirror_next(ROW)) -#define OVSREC_MIRROR_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_mirror_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_mirror_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_mirror_init(struct ovsrec_mirror *); -void ovsrec_mirror_delete(const struct ovsrec_mirror *); -struct ovsrec_mirror *ovsrec_mirror_insert(struct ovsdb_idl_txn *); - -void ovsrec_mirror_verify_external_ids(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_name(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_output_port(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_output_vlan(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_select_all(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_select_dst_port(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_select_src_port(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_select_vlan(const struct ovsrec_mirror *); -void ovsrec_mirror_verify_statistics(const struct ovsrec_mirror *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_mirror directly.) */ -const struct ovsdb_datum *ovsrec_mirror_get_external_ids(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_mirror_get_name(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_mirror_get_output_port(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_mirror_get_output_vlan(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_mirror_get_select_all(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_mirror_get_select_dst_port(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_mirror_get_select_src_port(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_mirror_get_select_vlan(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_mirror_get_statistics(const struct ovsrec_mirror *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); - -void ovsrec_mirror_set_external_ids(const struct ovsrec_mirror *, const struct smap *); -void ovsrec_mirror_set_name(const struct ovsrec_mirror *, const char *name); -void ovsrec_mirror_set_output_port(const struct ovsrec_mirror *, const struct ovsrec_port *output_port); -void ovsrec_mirror_set_output_vlan(const struct ovsrec_mirror *, const int64_t *output_vlan, size_t n_output_vlan); -void ovsrec_mirror_set_select_all(const struct ovsrec_mirror *, bool select_all); -void ovsrec_mirror_set_select_dst_port(const struct ovsrec_mirror *, struct ovsrec_port **select_dst_port, size_t n_select_dst_port); -void ovsrec_mirror_set_select_src_port(const struct ovsrec_mirror *, struct ovsrec_port **select_src_port, size_t n_select_src_port); -void ovsrec_mirror_set_select_vlan(const struct ovsrec_mirror *, const int64_t *select_vlan, size_t n_select_vlan); -void ovsrec_mirror_set_statistics(const struct ovsrec_mirror *, char **key_statistics, const int64_t *value_statistics, size_t n_statistics); - - -/* NetFlow table. */ -struct ovsrec_netflow { - struct ovsdb_idl_row header_; - - /* active_timeout column. */ - int64_t active_timeout; - - /* add_id_to_interface column. */ - bool add_id_to_interface; - - /* engine_id column. */ - int64_t *engine_id; - size_t n_engine_id; - - /* engine_type column. */ - int64_t *engine_type; - size_t n_engine_type; - - /* external_ids column. */ - struct smap external_ids; - - /* targets column. */ - char **targets; - size_t n_targets; -}; - -enum { - OVSREC_NETFLOW_COL_ACTIVE_TIMEOUT, - OVSREC_NETFLOW_COL_ADD_ID_TO_INTERFACE, - OVSREC_NETFLOW_COL_ENGINE_ID, - OVSREC_NETFLOW_COL_ENGINE_TYPE, - OVSREC_NETFLOW_COL_EXTERNAL_IDS, - OVSREC_NETFLOW_COL_TARGETS, - OVSREC_NETFLOW_N_COLUMNS -}; - -#define ovsrec_netflow_col_engine_id (ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ENGINE_ID]) -#define ovsrec_netflow_col_active_timeout (ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ACTIVE_TIMEOUT]) -#define ovsrec_netflow_col_add_id_to_interface (ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ADD_ID_TO_INTERFACE]) -#define ovsrec_netflow_col_external_ids (ovsrec_netflow_columns[OVSREC_NETFLOW_COL_EXTERNAL_IDS]) -#define ovsrec_netflow_col_targets (ovsrec_netflow_columns[OVSREC_NETFLOW_COL_TARGETS]) -#define ovsrec_netflow_col_engine_type (ovsrec_netflow_columns[OVSREC_NETFLOW_COL_ENGINE_TYPE]) - -extern struct ovsdb_idl_column ovsrec_netflow_columns[OVSREC_NETFLOW_N_COLUMNS]; - -const struct ovsrec_netflow *ovsrec_netflow_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_netflow *ovsrec_netflow_first(const struct ovsdb_idl *); -const struct ovsrec_netflow *ovsrec_netflow_next(const struct ovsrec_netflow *); -#define OVSREC_NETFLOW_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_netflow_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_netflow_next(ROW)) -#define OVSREC_NETFLOW_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_netflow_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_netflow_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_netflow_init(struct ovsrec_netflow *); -void ovsrec_netflow_delete(const struct ovsrec_netflow *); -struct ovsrec_netflow *ovsrec_netflow_insert(struct ovsdb_idl_txn *); - -void ovsrec_netflow_verify_active_timeout(const struct ovsrec_netflow *); -void ovsrec_netflow_verify_add_id_to_interface(const struct ovsrec_netflow *); -void ovsrec_netflow_verify_engine_id(const struct ovsrec_netflow *); -void ovsrec_netflow_verify_engine_type(const struct ovsrec_netflow *); -void ovsrec_netflow_verify_external_ids(const struct ovsrec_netflow *); -void ovsrec_netflow_verify_targets(const struct ovsrec_netflow *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_netflow directly.) */ -const struct ovsdb_datum *ovsrec_netflow_get_active_timeout(const struct ovsrec_netflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_netflow_get_add_id_to_interface(const struct ovsrec_netflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_netflow_get_engine_id(const struct ovsrec_netflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_netflow_get_engine_type(const struct ovsrec_netflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_netflow_get_external_ids(const struct ovsrec_netflow *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_netflow_get_targets(const struct ovsrec_netflow *, enum ovsdb_atomic_type key_type); - -void ovsrec_netflow_set_active_timeout(const struct ovsrec_netflow *, int64_t active_timeout); -void ovsrec_netflow_set_add_id_to_interface(const struct ovsrec_netflow *, bool add_id_to_interface); -void ovsrec_netflow_set_engine_id(const struct ovsrec_netflow *, const int64_t *engine_id, size_t n_engine_id); -void ovsrec_netflow_set_engine_type(const struct ovsrec_netflow *, const int64_t *engine_type, size_t n_engine_type); -void ovsrec_netflow_set_external_ids(const struct ovsrec_netflow *, const struct smap *); -void ovsrec_netflow_set_targets(const struct ovsrec_netflow *, char **targets, size_t n_targets); - - -/* Open_vSwitch table. */ -struct ovsrec_open_vswitch { - struct ovsdb_idl_row header_; - - /* bridges column. */ - struct ovsrec_bridge **bridges; - size_t n_bridges; - - /* cur_cfg column. */ - int64_t cur_cfg; - - /* db_version column. */ - char *db_version; - - /* external_ids column. */ - struct smap external_ids; - - /* manager_options column. */ - struct ovsrec_manager **manager_options; - size_t n_manager_options; - - /* next_cfg column. */ - int64_t next_cfg; - - /* other_config column. */ - struct smap other_config; - - /* ovs_version column. */ - char *ovs_version; - - /* ssl column. */ - struct ovsrec_ssl *ssl; - - /* statistics column. */ - struct smap statistics; - - /* system_type column. */ - char *system_type; - - /* system_version column. */ - char *system_version; -}; - -enum { - OVSREC_OPEN_VSWITCH_COL_BRIDGES, - OVSREC_OPEN_VSWITCH_COL_CUR_CFG, - OVSREC_OPEN_VSWITCH_COL_DB_VERSION, - OVSREC_OPEN_VSWITCH_COL_EXTERNAL_IDS, - OVSREC_OPEN_VSWITCH_COL_MANAGER_OPTIONS, - OVSREC_OPEN_VSWITCH_COL_NEXT_CFG, - OVSREC_OPEN_VSWITCH_COL_OTHER_CONFIG, - OVSREC_OPEN_VSWITCH_COL_OVS_VERSION, - OVSREC_OPEN_VSWITCH_COL_SSL, - OVSREC_OPEN_VSWITCH_COL_STATISTICS, - OVSREC_OPEN_VSWITCH_COL_SYSTEM_TYPE, - OVSREC_OPEN_VSWITCH_COL_SYSTEM_VERSION, - OVSREC_OPEN_VSWITCH_N_COLUMNS -}; - -#define ovsrec_open_vswitch_col_bridges (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_BRIDGES]) -#define ovsrec_open_vswitch_col_statistics (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_STATISTICS]) -#define ovsrec_open_vswitch_col_db_version (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_DB_VERSION]) -#define ovsrec_open_vswitch_col_next_cfg (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_NEXT_CFG]) -#define ovsrec_open_vswitch_col_ovs_version (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_OVS_VERSION]) -#define ovsrec_open_vswitch_col_other_config (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_OTHER_CONFIG]) -#define ovsrec_open_vswitch_col_ssl (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SSL]) -#define ovsrec_open_vswitch_col_manager_options (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_MANAGER_OPTIONS]) -#define ovsrec_open_vswitch_col_external_ids (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_EXTERNAL_IDS]) -#define ovsrec_open_vswitch_col_system_version (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SYSTEM_VERSION]) -#define ovsrec_open_vswitch_col_cur_cfg (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_CUR_CFG]) -#define ovsrec_open_vswitch_col_system_type (ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_SYSTEM_TYPE]) - -extern struct ovsdb_idl_column ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_N_COLUMNS]; - -const struct ovsrec_open_vswitch *ovsrec_open_vswitch_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_open_vswitch *ovsrec_open_vswitch_first(const struct ovsdb_idl *); -const struct ovsrec_open_vswitch *ovsrec_open_vswitch_next(const struct ovsrec_open_vswitch *); -#define OVSREC_OPEN_VSWITCH_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_open_vswitch_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_open_vswitch_next(ROW)) -#define OVSREC_OPEN_VSWITCH_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_open_vswitch_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_open_vswitch_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_open_vswitch_init(struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_delete(const struct ovsrec_open_vswitch *); -struct ovsrec_open_vswitch *ovsrec_open_vswitch_insert(struct ovsdb_idl_txn *); - -void ovsrec_open_vswitch_verify_bridges(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_cur_cfg(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_db_version(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_external_ids(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_manager_options(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_next_cfg(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_other_config(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_ovs_version(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_ssl(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_statistics(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_system_type(const struct ovsrec_open_vswitch *); -void ovsrec_open_vswitch_verify_system_version(const struct ovsrec_open_vswitch *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_open_vswitch directly.) */ -const struct ovsdb_datum *ovsrec_open_vswitch_get_bridges(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_cur_cfg(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_db_version(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_external_ids(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_manager_options(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_next_cfg(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_other_config(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_ovs_version(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_ssl(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_statistics(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_system_type(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_open_vswitch_get_system_version(const struct ovsrec_open_vswitch *, enum ovsdb_atomic_type key_type); - -void ovsrec_open_vswitch_set_bridges(const struct ovsrec_open_vswitch *, struct ovsrec_bridge **bridges, size_t n_bridges); -void ovsrec_open_vswitch_set_cur_cfg(const struct ovsrec_open_vswitch *, int64_t cur_cfg); -void ovsrec_open_vswitch_set_db_version(const struct ovsrec_open_vswitch *, const char *db_version); -void ovsrec_open_vswitch_set_external_ids(const struct ovsrec_open_vswitch *, const struct smap *); -void ovsrec_open_vswitch_set_manager_options(const struct ovsrec_open_vswitch *, struct ovsrec_manager **manager_options, size_t n_manager_options); -void ovsrec_open_vswitch_set_next_cfg(const struct ovsrec_open_vswitch *, int64_t next_cfg); -void ovsrec_open_vswitch_set_other_config(const struct ovsrec_open_vswitch *, const struct smap *); -void ovsrec_open_vswitch_set_ovs_version(const struct ovsrec_open_vswitch *, const char *ovs_version); -void ovsrec_open_vswitch_set_ssl(const struct ovsrec_open_vswitch *, const struct ovsrec_ssl *ssl); -void ovsrec_open_vswitch_set_statistics(const struct ovsrec_open_vswitch *, const struct smap *); -void ovsrec_open_vswitch_set_system_type(const struct ovsrec_open_vswitch *, const char *system_type); -void ovsrec_open_vswitch_set_system_version(const struct ovsrec_open_vswitch *, const char *system_version); - - -/* Port table. */ -struct ovsrec_port { - struct ovsdb_idl_row header_; - - /* bond_active_slave column. */ - char *bond_active_slave; - - /* bond_downdelay column. */ - int64_t bond_downdelay; - - /* bond_fake_iface column. */ - bool bond_fake_iface; - - /* bond_mode column. */ - char *bond_mode; - - /* bond_updelay column. */ - int64_t bond_updelay; - - /* external_ids column. */ - struct smap external_ids; - - /* fake_bridge column. */ - bool fake_bridge; - - /* interfaces column. */ - struct ovsrec_interface **interfaces; - size_t n_interfaces; - - /* lacp column. */ - char *lacp; - - /* mac column. */ - char *mac; - - /* name column. */ - char *name; /* Always nonnull. */ - - /* other_config column. */ - struct smap other_config; - - /* qos column. */ - struct ovsrec_qos *qos; - - /* statistics column. */ - char **key_statistics; - int64_t *value_statistics; - size_t n_statistics; - - /* status column. */ - struct smap status; - - /* tag column. */ - int64_t *tag; - size_t n_tag; - - /* trunks column. */ - int64_t *trunks; - size_t n_trunks; - - /* vlan_mode column. */ - char *vlan_mode; -}; - -enum { - OVSREC_PORT_COL_BOND_ACTIVE_SLAVE, - OVSREC_PORT_COL_BOND_DOWNDELAY, - OVSREC_PORT_COL_BOND_FAKE_IFACE, - OVSREC_PORT_COL_BOND_MODE, - OVSREC_PORT_COL_BOND_UPDELAY, - OVSREC_PORT_COL_EXTERNAL_IDS, - OVSREC_PORT_COL_FAKE_BRIDGE, - OVSREC_PORT_COL_INTERFACES, - OVSREC_PORT_COL_LACP, - OVSREC_PORT_COL_MAC, - OVSREC_PORT_COL_NAME, - OVSREC_PORT_COL_OTHER_CONFIG, - OVSREC_PORT_COL_QOS, - OVSREC_PORT_COL_STATISTICS, - OVSREC_PORT_COL_STATUS, - OVSREC_PORT_COL_TAG, - OVSREC_PORT_COL_TRUNKS, - OVSREC_PORT_COL_VLAN_MODE, - OVSREC_PORT_N_COLUMNS -}; - -#define ovsrec_port_col_status (ovsrec_port_columns[OVSREC_PORT_COL_STATUS]) -#define ovsrec_port_col_statistics (ovsrec_port_columns[OVSREC_PORT_COL_STATISTICS]) -#define ovsrec_port_col_qos (ovsrec_port_columns[OVSREC_PORT_COL_QOS]) -#define ovsrec_port_col_name (ovsrec_port_columns[OVSREC_PORT_COL_NAME]) -#define ovsrec_port_col_bond_downdelay (ovsrec_port_columns[OVSREC_PORT_COL_BOND_DOWNDELAY]) -#define ovsrec_port_col_interfaces (ovsrec_port_columns[OVSREC_PORT_COL_INTERFACES]) -#define ovsrec_port_col_other_config (ovsrec_port_columns[OVSREC_PORT_COL_OTHER_CONFIG]) -#define ovsrec_port_col_bond_active_slave (ovsrec_port_columns[OVSREC_PORT_COL_BOND_ACTIVE_SLAVE]) -#define ovsrec_port_col_bond_fake_iface (ovsrec_port_columns[OVSREC_PORT_COL_BOND_FAKE_IFACE]) -#define ovsrec_port_col_lacp (ovsrec_port_columns[OVSREC_PORT_COL_LACP]) -#define ovsrec_port_col_mac (ovsrec_port_columns[OVSREC_PORT_COL_MAC]) -#define ovsrec_port_col_tag (ovsrec_port_columns[OVSREC_PORT_COL_TAG]) -#define ovsrec_port_col_trunks (ovsrec_port_columns[OVSREC_PORT_COL_TRUNKS]) -#define ovsrec_port_col_vlan_mode (ovsrec_port_columns[OVSREC_PORT_COL_VLAN_MODE]) -#define ovsrec_port_col_external_ids (ovsrec_port_columns[OVSREC_PORT_COL_EXTERNAL_IDS]) -#define ovsrec_port_col_fake_bridge (ovsrec_port_columns[OVSREC_PORT_COL_FAKE_BRIDGE]) -#define ovsrec_port_col_bond_updelay (ovsrec_port_columns[OVSREC_PORT_COL_BOND_UPDELAY]) -#define ovsrec_port_col_bond_mode (ovsrec_port_columns[OVSREC_PORT_COL_BOND_MODE]) - -extern struct ovsdb_idl_column ovsrec_port_columns[OVSREC_PORT_N_COLUMNS]; - -const struct ovsrec_port *ovsrec_port_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_port *ovsrec_port_first(const struct ovsdb_idl *); -const struct ovsrec_port *ovsrec_port_next(const struct ovsrec_port *); -#define OVSREC_PORT_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_port_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_port_next(ROW)) -#define OVSREC_PORT_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_port_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_port_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_port_init(struct ovsrec_port *); -void ovsrec_port_delete(const struct ovsrec_port *); -struct ovsrec_port *ovsrec_port_insert(struct ovsdb_idl_txn *); - -void ovsrec_port_verify_bond_active_slave(const struct ovsrec_port *); -void ovsrec_port_verify_bond_downdelay(const struct ovsrec_port *); -void ovsrec_port_verify_bond_fake_iface(const struct ovsrec_port *); -void ovsrec_port_verify_bond_mode(const struct ovsrec_port *); -void ovsrec_port_verify_bond_updelay(const struct ovsrec_port *); -void ovsrec_port_verify_external_ids(const struct ovsrec_port *); -void ovsrec_port_verify_fake_bridge(const struct ovsrec_port *); -void ovsrec_port_verify_interfaces(const struct ovsrec_port *); -void ovsrec_port_verify_lacp(const struct ovsrec_port *); -void ovsrec_port_verify_mac(const struct ovsrec_port *); -void ovsrec_port_verify_name(const struct ovsrec_port *); -void ovsrec_port_verify_other_config(const struct ovsrec_port *); -void ovsrec_port_verify_qos(const struct ovsrec_port *); -void ovsrec_port_verify_statistics(const struct ovsrec_port *); -void ovsrec_port_verify_status(const struct ovsrec_port *); -void ovsrec_port_verify_tag(const struct ovsrec_port *); -void ovsrec_port_verify_trunks(const struct ovsrec_port *); -void ovsrec_port_verify_vlan_mode(const struct ovsrec_port *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_port directly.) */ -const struct ovsdb_datum *ovsrec_port_get_bond_active_slave(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_bond_downdelay(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_bond_fake_iface(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_bond_mode(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_bond_updelay(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_external_ids(const struct ovsrec_port *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_port_get_fake_bridge(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_interfaces(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_lacp(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_mac(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_name(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_other_config(const struct ovsrec_port *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_port_get_qos(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_statistics(const struct ovsrec_port *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_port_get_status(const struct ovsrec_port *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_port_get_tag(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_trunks(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_port_get_vlan_mode(const struct ovsrec_port *, enum ovsdb_atomic_type key_type); - -void ovsrec_port_set_bond_active_slave(const struct ovsrec_port *, const char *bond_active_slave); -void ovsrec_port_set_bond_downdelay(const struct ovsrec_port *, int64_t bond_downdelay); -void ovsrec_port_set_bond_fake_iface(const struct ovsrec_port *, bool bond_fake_iface); -void ovsrec_port_set_bond_mode(const struct ovsrec_port *, const char *bond_mode); -void ovsrec_port_set_bond_updelay(const struct ovsrec_port *, int64_t bond_updelay); -void ovsrec_port_set_external_ids(const struct ovsrec_port *, const struct smap *); -void ovsrec_port_set_fake_bridge(const struct ovsrec_port *, bool fake_bridge); -void ovsrec_port_set_interfaces(const struct ovsrec_port *, struct ovsrec_interface **interfaces, size_t n_interfaces); -void ovsrec_port_set_lacp(const struct ovsrec_port *, const char *lacp); -void ovsrec_port_set_mac(const struct ovsrec_port *, const char *mac); -void ovsrec_port_set_name(const struct ovsrec_port *, const char *name); -void ovsrec_port_set_other_config(const struct ovsrec_port *, const struct smap *); -void ovsrec_port_set_qos(const struct ovsrec_port *, const struct ovsrec_qos *qos); -void ovsrec_port_set_statistics(const struct ovsrec_port *, char **key_statistics, const int64_t *value_statistics, size_t n_statistics); -void ovsrec_port_set_status(const struct ovsrec_port *, const struct smap *); -void ovsrec_port_set_tag(const struct ovsrec_port *, const int64_t *tag, size_t n_tag); -void ovsrec_port_set_trunks(const struct ovsrec_port *, const int64_t *trunks, size_t n_trunks); -void ovsrec_port_set_vlan_mode(const struct ovsrec_port *, const char *vlan_mode); - - -/* QoS table. */ -struct ovsrec_qos { - struct ovsdb_idl_row header_; - - /* external_ids column. */ - struct smap external_ids; - - /* other_config column. */ - struct smap other_config; - - /* queues column. */ - int64_t *key_queues; - struct ovsrec_queue **value_queues; - size_t n_queues; - - /* type column. */ - char *type; /* Always nonnull. */ -}; - -enum { - OVSREC_QOS_COL_EXTERNAL_IDS, - OVSREC_QOS_COL_OTHER_CONFIG, - OVSREC_QOS_COL_QUEUES, - OVSREC_QOS_COL_TYPE, - OVSREC_QOS_N_COLUMNS -}; - -#define ovsrec_qos_col_external_ids (ovsrec_qos_columns[OVSREC_QOS_COL_EXTERNAL_IDS]) -#define ovsrec_qos_col_other_config (ovsrec_qos_columns[OVSREC_QOS_COL_OTHER_CONFIG]) -#define ovsrec_qos_col_type (ovsrec_qos_columns[OVSREC_QOS_COL_TYPE]) -#define ovsrec_qos_col_queues (ovsrec_qos_columns[OVSREC_QOS_COL_QUEUES]) - -extern struct ovsdb_idl_column ovsrec_qos_columns[OVSREC_QOS_N_COLUMNS]; - -const struct ovsrec_qos *ovsrec_qos_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_qos *ovsrec_qos_first(const struct ovsdb_idl *); -const struct ovsrec_qos *ovsrec_qos_next(const struct ovsrec_qos *); -#define OVSREC_QOS_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_qos_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_qos_next(ROW)) -#define OVSREC_QOS_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_qos_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_qos_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_qos_init(struct ovsrec_qos *); -void ovsrec_qos_delete(const struct ovsrec_qos *); -struct ovsrec_qos *ovsrec_qos_insert(struct ovsdb_idl_txn *); - -void ovsrec_qos_verify_external_ids(const struct ovsrec_qos *); -void ovsrec_qos_verify_other_config(const struct ovsrec_qos *); -void ovsrec_qos_verify_queues(const struct ovsrec_qos *); -void ovsrec_qos_verify_type(const struct ovsrec_qos *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_qos directly.) */ -const struct ovsdb_datum *ovsrec_qos_get_external_ids(const struct ovsrec_qos *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_qos_get_other_config(const struct ovsrec_qos *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_qos_get_queues(const struct ovsrec_qos *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_qos_get_type(const struct ovsrec_qos *, enum ovsdb_atomic_type key_type); - -void ovsrec_qos_set_external_ids(const struct ovsrec_qos *, const struct smap *); -void ovsrec_qos_set_other_config(const struct ovsrec_qos *, const struct smap *); -void ovsrec_qos_set_queues(const struct ovsrec_qos *, const int64_t *key_queues, struct ovsrec_queue **value_queues, size_t n_queues); -void ovsrec_qos_set_type(const struct ovsrec_qos *, const char *type); - - -/* Queue table. */ -struct ovsrec_queue { - struct ovsdb_idl_row header_; - - /* dscp column. */ - int64_t *dscp; - size_t n_dscp; - - /* external_ids column. */ - struct smap external_ids; - - /* other_config column. */ - struct smap other_config; -}; - -enum { - OVSREC_QUEUE_COL_DSCP, - OVSREC_QUEUE_COL_EXTERNAL_IDS, - OVSREC_QUEUE_COL_OTHER_CONFIG, - OVSREC_QUEUE_N_COLUMNS -}; - -#define ovsrec_queue_col_external_ids (ovsrec_queue_columns[OVSREC_QUEUE_COL_EXTERNAL_IDS]) -#define ovsrec_queue_col_other_config (ovsrec_queue_columns[OVSREC_QUEUE_COL_OTHER_CONFIG]) -#define ovsrec_queue_col_dscp (ovsrec_queue_columns[OVSREC_QUEUE_COL_DSCP]) - -extern struct ovsdb_idl_column ovsrec_queue_columns[OVSREC_QUEUE_N_COLUMNS]; - -const struct ovsrec_queue *ovsrec_queue_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_queue *ovsrec_queue_first(const struct ovsdb_idl *); -const struct ovsrec_queue *ovsrec_queue_next(const struct ovsrec_queue *); -#define OVSREC_QUEUE_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_queue_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_queue_next(ROW)) -#define OVSREC_QUEUE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_queue_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_queue_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_queue_init(struct ovsrec_queue *); -void ovsrec_queue_delete(const struct ovsrec_queue *); -struct ovsrec_queue *ovsrec_queue_insert(struct ovsdb_idl_txn *); - -void ovsrec_queue_verify_dscp(const struct ovsrec_queue *); -void ovsrec_queue_verify_external_ids(const struct ovsrec_queue *); -void ovsrec_queue_verify_other_config(const struct ovsrec_queue *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_queue directly.) */ -const struct ovsdb_datum *ovsrec_queue_get_dscp(const struct ovsrec_queue *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_queue_get_external_ids(const struct ovsrec_queue *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_queue_get_other_config(const struct ovsrec_queue *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); - -void ovsrec_queue_set_dscp(const struct ovsrec_queue *, const int64_t *dscp, size_t n_dscp); -void ovsrec_queue_set_external_ids(const struct ovsrec_queue *, const struct smap *); -void ovsrec_queue_set_other_config(const struct ovsrec_queue *, const struct smap *); - - -/* SSL table. */ -struct ovsrec_ssl { - struct ovsdb_idl_row header_; - - /* bootstrap_ca_cert column. */ - bool bootstrap_ca_cert; - - /* ca_cert column. */ - char *ca_cert; /* Always nonnull. */ - - /* certificate column. */ - char *certificate; /* Always nonnull. */ - - /* external_ids column. */ - struct smap external_ids; - - /* private_key column. */ - char *private_key; /* Always nonnull. */ -}; - -enum { - OVSREC_SSL_COL_BOOTSTRAP_CA_CERT, - OVSREC_SSL_COL_CA_CERT, - OVSREC_SSL_COL_CERTIFICATE, - OVSREC_SSL_COL_EXTERNAL_IDS, - OVSREC_SSL_COL_PRIVATE_KEY, - OVSREC_SSL_N_COLUMNS -}; - -#define ovsrec_ssl_col_ca_cert (ovsrec_ssl_columns[OVSREC_SSL_COL_CA_CERT]) -#define ovsrec_ssl_col_private_key (ovsrec_ssl_columns[OVSREC_SSL_COL_PRIVATE_KEY]) -#define ovsrec_ssl_col_bootstrap_ca_cert (ovsrec_ssl_columns[OVSREC_SSL_COL_BOOTSTRAP_CA_CERT]) -#define ovsrec_ssl_col_external_ids (ovsrec_ssl_columns[OVSREC_SSL_COL_EXTERNAL_IDS]) -#define ovsrec_ssl_col_certificate (ovsrec_ssl_columns[OVSREC_SSL_COL_CERTIFICATE]) - -extern struct ovsdb_idl_column ovsrec_ssl_columns[OVSREC_SSL_N_COLUMNS]; - -const struct ovsrec_ssl *ovsrec_ssl_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_ssl *ovsrec_ssl_first(const struct ovsdb_idl *); -const struct ovsrec_ssl *ovsrec_ssl_next(const struct ovsrec_ssl *); -#define OVSREC_SSL_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_ssl_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_ssl_next(ROW)) -#define OVSREC_SSL_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_ssl_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_ssl_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_ssl_init(struct ovsrec_ssl *); -void ovsrec_ssl_delete(const struct ovsrec_ssl *); -struct ovsrec_ssl *ovsrec_ssl_insert(struct ovsdb_idl_txn *); - -void ovsrec_ssl_verify_bootstrap_ca_cert(const struct ovsrec_ssl *); -void ovsrec_ssl_verify_ca_cert(const struct ovsrec_ssl *); -void ovsrec_ssl_verify_certificate(const struct ovsrec_ssl *); -void ovsrec_ssl_verify_external_ids(const struct ovsrec_ssl *); -void ovsrec_ssl_verify_private_key(const struct ovsrec_ssl *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_ssl directly.) */ -const struct ovsdb_datum *ovsrec_ssl_get_bootstrap_ca_cert(const struct ovsrec_ssl *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ssl_get_ca_cert(const struct ovsrec_ssl *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ssl_get_certificate(const struct ovsrec_ssl *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_ssl_get_external_ids(const struct ovsrec_ssl *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_ssl_get_private_key(const struct ovsrec_ssl *, enum ovsdb_atomic_type key_type); - -void ovsrec_ssl_set_bootstrap_ca_cert(const struct ovsrec_ssl *, bool bootstrap_ca_cert); -void ovsrec_ssl_set_ca_cert(const struct ovsrec_ssl *, const char *ca_cert); -void ovsrec_ssl_set_certificate(const struct ovsrec_ssl *, const char *certificate); -void ovsrec_ssl_set_external_ids(const struct ovsrec_ssl *, const struct smap *); -void ovsrec_ssl_set_private_key(const struct ovsrec_ssl *, const char *private_key); - - -/* sFlow table. */ -struct ovsrec_sflow { - struct ovsdb_idl_row header_; - - /* agent column. */ - char *agent; - - /* external_ids column. */ - struct smap external_ids; - - /* header column. */ - int64_t *header; - size_t n_header; - - /* polling column. */ - int64_t *polling; - size_t n_polling; - - /* sampling column. */ - int64_t *sampling; - size_t n_sampling; - - /* targets column. */ - char **targets; - size_t n_targets; -}; - -enum { - OVSREC_SFLOW_COL_AGENT, - OVSREC_SFLOW_COL_EXTERNAL_IDS, - OVSREC_SFLOW_COL_HEADER, - OVSREC_SFLOW_COL_POLLING, - OVSREC_SFLOW_COL_SAMPLING, - OVSREC_SFLOW_COL_TARGETS, - OVSREC_SFLOW_N_COLUMNS -}; - -#define ovsrec_sflow_col_agent (ovsrec_sflow_columns[OVSREC_SFLOW_COL_AGENT]) -#define ovsrec_sflow_col_sampling (ovsrec_sflow_columns[OVSREC_SFLOW_COL_SAMPLING]) -#define ovsrec_sflow_col_header (ovsrec_sflow_columns[OVSREC_SFLOW_COL_HEADER]) -#define ovsrec_sflow_col_polling (ovsrec_sflow_columns[OVSREC_SFLOW_COL_POLLING]) -#define ovsrec_sflow_col_external_ids (ovsrec_sflow_columns[OVSREC_SFLOW_COL_EXTERNAL_IDS]) -#define ovsrec_sflow_col_targets (ovsrec_sflow_columns[OVSREC_SFLOW_COL_TARGETS]) - -extern struct ovsdb_idl_column ovsrec_sflow_columns[OVSREC_SFLOW_N_COLUMNS]; - -const struct ovsrec_sflow *ovsrec_sflow_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct ovsrec_sflow *ovsrec_sflow_first(const struct ovsdb_idl *); -const struct ovsrec_sflow *ovsrec_sflow_next(const struct ovsrec_sflow *); -#define OVSREC_SFLOW_FOR_EACH(ROW, IDL) \ - for ((ROW) = ovsrec_sflow_first(IDL); \ - (ROW); \ - (ROW) = ovsrec_sflow_next(ROW)) -#define OVSREC_SFLOW_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = ovsrec_sflow_first(IDL); \ - (ROW) ? ((NEXT) = ovsrec_sflow_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void ovsrec_sflow_init(struct ovsrec_sflow *); -void ovsrec_sflow_delete(const struct ovsrec_sflow *); -struct ovsrec_sflow *ovsrec_sflow_insert(struct ovsdb_idl_txn *); - -void ovsrec_sflow_verify_agent(const struct ovsrec_sflow *); -void ovsrec_sflow_verify_external_ids(const struct ovsrec_sflow *); -void ovsrec_sflow_verify_header(const struct ovsrec_sflow *); -void ovsrec_sflow_verify_polling(const struct ovsrec_sflow *); -void ovsrec_sflow_verify_sampling(const struct ovsrec_sflow *); -void ovsrec_sflow_verify_targets(const struct ovsrec_sflow *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of ovsrec_sflow directly.) */ -const struct ovsdb_datum *ovsrec_sflow_get_agent(const struct ovsrec_sflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_sflow_get_external_ids(const struct ovsrec_sflow *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *ovsrec_sflow_get_header(const struct ovsrec_sflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_sflow_get_polling(const struct ovsrec_sflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_sflow_get_sampling(const struct ovsrec_sflow *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *ovsrec_sflow_get_targets(const struct ovsrec_sflow *, enum ovsdb_atomic_type key_type); - -void ovsrec_sflow_set_agent(const struct ovsrec_sflow *, const char *agent); -void ovsrec_sflow_set_external_ids(const struct ovsrec_sflow *, const struct smap *); -void ovsrec_sflow_set_header(const struct ovsrec_sflow *, const int64_t *header, size_t n_header); -void ovsrec_sflow_set_polling(const struct ovsrec_sflow *, const int64_t *polling, size_t n_polling); -void ovsrec_sflow_set_sampling(const struct ovsrec_sflow *, const int64_t *sampling, size_t n_sampling); -void ovsrec_sflow_set_targets(const struct ovsrec_sflow *, char **targets, size_t n_targets); - - -enum { - OVSREC_TABLE_BRIDGE, - OVSREC_TABLE_CONTROLLER, - OVSREC_TABLE_FLOW_SAMPLE_COLLECTOR_SET, - OVSREC_TABLE_FLOW_TABLE, - OVSREC_TABLE_IPFIX, - OVSREC_TABLE_INTERFACE, - OVSREC_TABLE_MANAGER, - OVSREC_TABLE_MIRROR, - OVSREC_TABLE_NETFLOW, - OVSREC_TABLE_OPEN_VSWITCH, - OVSREC_TABLE_PORT, - OVSREC_TABLE_QOS, - OVSREC_TABLE_QUEUE, - OVSREC_TABLE_SSL, - OVSREC_TABLE_SFLOW, - OVSREC_N_TABLES -}; - -#define ovsrec_table_bridge (ovsrec_table_classes[OVSREC_TABLE_BRIDGE]) -#define ovsrec_table_qos (ovsrec_table_classes[OVSREC_TABLE_QOS]) -#define ovsrec_table_sflow (ovsrec_table_classes[OVSREC_TABLE_SFLOW]) -#define ovsrec_table_flow_sample_collector_set (ovsrec_table_classes[OVSREC_TABLE_FLOW_SAMPLE_COLLECTOR_SET]) -#define ovsrec_table_ipfix (ovsrec_table_classes[OVSREC_TABLE_IPFIX]) -#define ovsrec_table_open_vswitch (ovsrec_table_classes[OVSREC_TABLE_OPEN_VSWITCH]) -#define ovsrec_table_controller (ovsrec_table_classes[OVSREC_TABLE_CONTROLLER]) -#define ovsrec_table_flow_table (ovsrec_table_classes[OVSREC_TABLE_FLOW_TABLE]) -#define ovsrec_table_queue (ovsrec_table_classes[OVSREC_TABLE_QUEUE]) -#define ovsrec_table_ssl (ovsrec_table_classes[OVSREC_TABLE_SSL]) -#define ovsrec_table_manager (ovsrec_table_classes[OVSREC_TABLE_MANAGER]) -#define ovsrec_table_mirror (ovsrec_table_classes[OVSREC_TABLE_MIRROR]) -#define ovsrec_table_interface (ovsrec_table_classes[OVSREC_TABLE_INTERFACE]) -#define ovsrec_table_netflow (ovsrec_table_classes[OVSREC_TABLE_NETFLOW]) -#define ovsrec_table_port (ovsrec_table_classes[OVSREC_TABLE_PORT]) - -extern struct ovsdb_idl_table_class ovsrec_table_classes[OVSREC_N_TABLES]; - -extern struct ovsdb_idl_class ovsrec_idl_class; - -void ovsrec_init(void); - -const char * ovsrec_get_db_version(void); - -#endif /* OVSREC_IDL_HEADER */ diff -Nru openvswitch-2.3.1/lib/vswitch-idl.ovsidl openvswitch-2.4.0~git20150623/lib/vswitch-idl.ovsidl --- openvswitch-2.3.1/lib/vswitch-idl.ovsidl 2014-12-04 05:59:58.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vswitch-idl.ovsidl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"cksum":"3478940432 20717","idlHeader":"\"lib/vswitch-idl.h\"","idlPrefix":"ovsrec_","name":"Open_vSwitch","tables":{"Bridge":{"columns":{"controller":{"type":{"key":{"refTable":"Controller","type":"uuid"},"max":"unlimited","min":0}},"datapath_id":{"ephemeral":true,"type":{"key":"string","max":1,"min":0}},"datapath_type":{"type":"string"},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"fail_mode":{"type":{"key":{"enum":["set",["standalone","secure"]],"type":"string"},"max":1,"min":0}},"flood_vlans":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"max":4096,"min":0}},"flow_tables":{"type":{"key":{"maxInteger":254,"minInteger":0,"type":"integer"},"max":"unlimited","min":0,"value":{"refTable":"Flow_Table","type":"uuid"}}},"ipfix":{"type":{"key":{"refTable":"IPFIX","type":"uuid"},"max":1,"min":0}},"mirrors":{"type":{"key":{"refTable":"Mirror","type":"uuid"},"max":"unlimited","min":0}},"name":{"mutable":false,"type":"string"},"netflow":{"type":{"key":{"refTable":"NetFlow","type":"uuid"},"max":1,"min":0}},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"ports":{"type":{"key":{"refTable":"Port","type":"uuid"},"max":"unlimited","min":0}},"protocols":{"type":{"key":{"enum":["set",["OpenFlow10","OpenFlow11","OpenFlow12","OpenFlow13","OpenFlow14","OpenFlow15"]],"type":"string"},"max":"unlimited","min":0}},"sflow":{"type":{"key":{"refTable":"sFlow","type":"uuid"},"max":1,"min":0}},"status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"stp_enable":{"type":"boolean"}},"indexes":[["name"]]},"Controller":{"columns":{"connection_mode":{"type":{"key":{"enum":["set",["in-band","out-of-band"]],"type":"string"},"max":1,"min":0}},"controller_burst_limit":{"type":{"key":{"minInteger":25,"type":"integer"},"max":1,"min":0}},"controller_rate_limit":{"type":{"key":{"minInteger":100,"type":"integer"},"max":1,"min":0}},"enable_async_messages":{"type":{"key":{"type":"boolean"},"max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"inactivity_probe":{"type":{"key":"integer","max":1,"min":0}},"is_connected":{"ephemeral":true,"type":"boolean"},"local_gateway":{"type":{"key":{"type":"string"},"max":1,"min":0}},"local_ip":{"type":{"key":{"type":"string"},"max":1,"min":0}},"local_netmask":{"type":{"key":{"type":"string"},"max":1,"min":0}},"max_backoff":{"type":{"key":{"minInteger":1000,"type":"integer"},"max":1,"min":0}},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"role":{"ephemeral":true,"type":{"key":{"enum":["set",["other","master","slave"]],"type":"string"},"max":1,"min":0}},"status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"target":{"type":"string"}}},"Flow_Sample_Collector_Set":{"columns":{"bridge":{"type":{"key":{"refTable":"Bridge","type":"uuid"},"max":1,"min":1}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"id":{"type":{"key":{"maxInteger":4294967295,"minInteger":0,"type":"integer"},"max":1,"min":1}},"ipfix":{"type":{"key":{"refTable":"IPFIX","type":"uuid"},"max":1,"min":0}}},"indexes":[["id","bridge"]],"isRoot":true},"Flow_Table":{"columns":{"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"flow_limit":{"type":{"key":{"minInteger":0,"type":"integer"},"max":1,"min":0}},"groups":{"type":{"key":"string","max":"unlimited","min":0}},"name":{"type":{"key":"string","max":1,"min":0}},"overflow_policy":{"type":{"key":{"enum":["set",["refuse","evict"]],"type":"string"},"max":1,"min":0}},"prefixes":{"type":{"key":"string","max":3,"min":0}}}},"IPFIX":{"columns":{"cache_active_timeout":{"type":{"key":{"maxInteger":4200,"minInteger":0,"type":"integer"},"max":1,"min":0}},"cache_max_flows":{"type":{"key":{"maxInteger":4294967295,"minInteger":0,"type":"integer"},"max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"obs_domain_id":{"type":{"key":{"maxInteger":4294967295,"minInteger":0,"type":"integer"},"max":1,"min":0}},"obs_point_id":{"type":{"key":{"maxInteger":4294967295,"minInteger":0,"type":"integer"},"max":1,"min":0}},"sampling":{"type":{"key":{"maxInteger":4294967295,"minInteger":1,"type":"integer"},"max":1,"min":0}},"targets":{"type":{"key":"string","max":"unlimited","min":0}}}},"Interface":{"columns":{"admin_state":{"ephemeral":true,"type":{"key":{"enum":["set",["up","down"]],"type":"string"},"max":1,"min":0}},"bfd":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"bfd_status":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"cfm_fault":{"ephemeral":true,"type":{"key":{"type":"boolean"},"max":1,"min":0}},"cfm_fault_status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0}},"cfm_flap_count":{"type":{"key":{"type":"integer"},"max":1,"min":0}},"cfm_health":{"ephemeral":true,"type":{"key":{"maxInteger":100,"minInteger":0,"type":"integer"},"max":1,"min":0}},"cfm_mpid":{"type":{"key":{"type":"integer"},"max":1,"min":0}},"cfm_remote_mpids":{"ephemeral":true,"type":{"key":{"type":"integer"},"max":"unlimited","min":0}},"cfm_remote_opstate":{"ephemeral":true,"type":{"key":{"enum":["set",["up","down"]],"type":"string"},"max":1,"min":0}},"duplex":{"ephemeral":true,"type":{"key":{"enum":["set",["half","full"]],"type":"string"},"max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"ifindex":{"ephemeral":true,"type":{"key":{"maxInteger":4294967295,"minInteger":0,"type":"integer"},"max":1,"min":0}},"ingress_policing_burst":{"type":{"key":{"minInteger":0,"type":"integer"}}},"ingress_policing_rate":{"type":{"key":{"minInteger":0,"type":"integer"}}},"lacp_current":{"ephemeral":true,"type":{"key":{"type":"boolean"},"max":1,"min":0}},"link_resets":{"ephemeral":true,"type":{"key":{"type":"integer"},"max":1,"min":0}},"link_speed":{"ephemeral":true,"type":{"key":"integer","max":1,"min":0}},"link_state":{"ephemeral":true,"type":{"key":{"enum":["set",["up","down"]],"type":"string"},"max":1,"min":0}},"mac":{"type":{"key":{"type":"string"},"max":1,"min":0}},"mac_in_use":{"ephemeral":true,"type":{"key":{"type":"string"},"max":1,"min":0}},"mtu":{"ephemeral":true,"type":{"key":"integer","max":1,"min":0}},"name":{"mutable":false,"type":"string"},"ofport":{"type":{"key":"integer","max":1,"min":0}},"ofport_request":{"type":{"key":{"maxInteger":65279,"minInteger":1,"type":"integer"},"max":1,"min":0}},"options":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"statistics":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"integer"}},"status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"type":{"type":"string"}},"indexes":[["name"]]},"Manager":{"columns":{"connection_mode":{"type":{"key":{"enum":["set",["in-band","out-of-band"]],"type":"string"},"max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"inactivity_probe":{"type":{"key":"integer","max":1,"min":0}},"is_connected":{"ephemeral":true,"type":"boolean"},"max_backoff":{"type":{"key":{"minInteger":1000,"type":"integer"},"max":1,"min":0}},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"target":{"type":"string"}},"indexes":[["target"]]},"Mirror":{"columns":{"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"name":{"type":"string"},"output_port":{"type":{"key":{"refTable":"Port","refType":"weak","type":"uuid"},"max":1,"min":0}},"output_vlan":{"type":{"key":{"maxInteger":4095,"minInteger":1,"type":"integer"},"max":1,"min":0}},"select_all":{"type":"boolean"},"select_dst_port":{"type":{"key":{"refTable":"Port","refType":"weak","type":"uuid"},"max":"unlimited","min":0}},"select_src_port":{"type":{"key":{"refTable":"Port","refType":"weak","type":"uuid"},"max":"unlimited","min":0}},"select_vlan":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"max":4096,"min":0}},"statistics":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"integer"}}}},"NetFlow":{"columns":{"active_timeout":{"type":{"key":{"minInteger":-1,"type":"integer"}}},"add_id_to_interface":{"type":"boolean"},"engine_id":{"type":{"key":{"maxInteger":255,"minInteger":0,"type":"integer"},"max":1,"min":0}},"engine_type":{"type":{"key":{"maxInteger":255,"minInteger":0,"type":"integer"},"max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"targets":{"type":{"key":{"type":"string"},"max":"unlimited","min":1}}}},"Open_vSwitch":{"columns":{"bridges":{"type":{"key":{"refTable":"Bridge","type":"uuid"},"max":"unlimited","min":0}},"cur_cfg":{"type":"integer"},"db_version":{"type":{"key":{"type":"string"},"max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"manager_options":{"type":{"key":{"refTable":"Manager","type":"uuid"},"max":"unlimited","min":0}},"next_cfg":{"type":"integer"},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"ovs_version":{"type":{"key":{"type":"string"},"max":1,"min":0}},"ssl":{"type":{"key":{"refTable":"SSL","type":"uuid"},"max":1,"min":0}},"statistics":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"system_type":{"type":{"key":{"type":"string"},"max":1,"min":0}},"system_version":{"type":{"key":{"type":"string"},"max":1,"min":0}}},"isRoot":true,"maxRows":1},"Port":{"columns":{"bond_active_slave":{"type":{"key":{"type":"string"},"max":1,"min":0}},"bond_downdelay":{"type":"integer"},"bond_fake_iface":{"type":"boolean"},"bond_mode":{"type":{"key":{"enum":["set",["balance-tcp","balance-slb","active-backup"]],"type":"string"},"max":1,"min":0}},"bond_updelay":{"type":"integer"},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"fake_bridge":{"type":"boolean"},"interfaces":{"type":{"key":{"refTable":"Interface","type":"uuid"},"max":"unlimited","min":1}},"lacp":{"type":{"key":{"enum":["set",["active","passive","off"]],"type":"string"},"max":1,"min":0}},"mac":{"type":{"key":{"type":"string"},"max":1,"min":0}},"name":{"mutable":false,"type":"string"},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"qos":{"type":{"key":{"refTable":"QoS","type":"uuid"},"max":1,"min":0}},"statistics":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"integer"}},"status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"tag":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"max":1,"min":0}},"trunks":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"max":4096,"min":0}},"vlan_mode":{"type":{"key":{"enum":["set",["trunk","access","native-tagged","native-untagged"]],"type":"string"},"max":1,"min":0}}},"indexes":[["name"]]},"QoS":{"columns":{"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"queues":{"type":{"key":{"maxInteger":4294967295,"minInteger":0,"type":"integer"},"max":"unlimited","min":0,"value":{"refTable":"Queue","type":"uuid"}}},"type":{"type":"string"}},"isRoot":true},"Queue":{"columns":{"dscp":{"type":{"key":{"maxInteger":63,"minInteger":0,"type":"integer"},"max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}}},"isRoot":true},"SSL":{"columns":{"bootstrap_ca_cert":{"type":"boolean"},"ca_cert":{"type":"string"},"certificate":{"type":"string"},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"private_key":{"type":"string"}},"maxRows":1},"sFlow":{"columns":{"agent":{"type":{"key":"string","max":1,"min":0}},"external_ids":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"header":{"type":{"key":"integer","max":1,"min":0}},"polling":{"type":{"key":"integer","max":1,"min":0}},"sampling":{"type":{"key":"integer","max":1,"min":0}},"targets":{"type":{"key":"string","max":"unlimited","min":1}}}}},"version":"7.6.2"} diff -Nru openvswitch-2.3.1/lib/vtep-idl.ann openvswitch-2.4.0~git20150623/lib/vtep-idl.ann --- openvswitch-2.3.1/lib/vtep-idl.ann 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vtep-idl.ann 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -# -*- python -*- - -# This code, when invoked by "ovsdb-idlc annotate" (by the build -# process), annotates vswitch.ovsschema with additional data that give -# the ovsdb-idl engine information about the types involved, so that -# it can generate more programmer-friendly data structures. - -s["idlPrefix"] = "vteprec_" -s["idlHeader"] = "\"lib/vtep-idl.h\"" diff -Nru openvswitch-2.3.1/lib/vtep-idl.c openvswitch-2.4.0~git20150623/lib/vtep-idl.c --- openvswitch-2.3.1/lib/vtep-idl.c 2014-10-12 23:47:59.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vtep-idl.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,5980 +0,0 @@ -/* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - -#include -#include "lib/vtep-idl.h" -#include -#include "ovs-thread.h" -#include "ovsdb-data.h" -#include "ovsdb-error.h" -#include "util.h" - -#ifdef __CHECKER__ -/* Sparse dislikes sizeof(bool) ("warning: expression using sizeof bool"). */ -enum { sizeof_bool = 1 }; -#else -enum { sizeof_bool = sizeof(bool) }; -#endif - -static bool inited; - - -static struct vteprec_arp_sources_local * -vteprec_arp_sources_local_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_arp_sources_local, header_) : NULL; -} - -static struct vteprec_arp_sources_remote * -vteprec_arp_sources_remote_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_arp_sources_remote, header_) : NULL; -} - -static struct vteprec_global * -vteprec_global_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_global, header_) : NULL; -} - -static struct vteprec_logical_binding_stats * -vteprec_logical_binding_stats_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_logical_binding_stats, header_) : NULL; -} - -static struct vteprec_logical_router * -vteprec_logical_router_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_logical_router, header_) : NULL; -} - -static struct vteprec_logical_switch * -vteprec_logical_switch_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_logical_switch, header_) : NULL; -} - -static struct vteprec_manager * -vteprec_manager_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_manager, header_) : NULL; -} - -static struct vteprec_mcast_macs_local * -vteprec_mcast_macs_local_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_mcast_macs_local, header_) : NULL; -} - -static struct vteprec_mcast_macs_remote * -vteprec_mcast_macs_remote_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_mcast_macs_remote, header_) : NULL; -} - -static struct vteprec_physical_locator * -vteprec_physical_locator_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_physical_locator, header_) : NULL; -} - -static struct vteprec_physical_locator_set * -vteprec_physical_locator_set_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_physical_locator_set, header_) : NULL; -} - -static struct vteprec_physical_port * -vteprec_physical_port_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_physical_port, header_) : NULL; -} - -static struct vteprec_physical_switch * -vteprec_physical_switch_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_physical_switch, header_) : NULL; -} - -static struct vteprec_tunnel * -vteprec_tunnel_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_tunnel, header_) : NULL; -} - -static struct vteprec_ucast_macs_local * -vteprec_ucast_macs_local_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_ucast_macs_local, header_) : NULL; -} - -static struct vteprec_ucast_macs_remote * -vteprec_ucast_macs_remote_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct vteprec_ucast_macs_remote, header_) : NULL; -} - -/* Arp_Sources_Local table. */ - -static void -vteprec_arp_sources_local_parse_locator(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_arp_sources_local *row = vteprec_arp_sources_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->locator = vteprec_physical_locator_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], &datum->keys[0].uuid)); - } else { - row->locator = NULL; - } -} - -static void -vteprec_arp_sources_local_parse_src_mac(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_arp_sources_local *row = vteprec_arp_sources_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->src_mac = datum->keys[0].string; - } else { - row->src_mac = ""; - } -} - -static void -vteprec_arp_sources_local_unparse_locator(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_arp_sources_local_unparse_src_mac(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_arp_sources_local_init__(struct ovsdb_idl_row *row) -{ - vteprec_arp_sources_local_init(vteprec_arp_sources_local_cast(row)); -} - -void -vteprec_arp_sources_local_init(struct vteprec_arp_sources_local *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_arp_sources_local * -vteprec_arp_sources_local_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_arp_sources_local_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_LOCAL], uuid)); -} - -const struct vteprec_arp_sources_local * -vteprec_arp_sources_local_first(const struct ovsdb_idl *idl) -{ - return vteprec_arp_sources_local_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_LOCAL])); -} - -const struct vteprec_arp_sources_local * -vteprec_arp_sources_local_next(const struct vteprec_arp_sources_local *row) -{ - return vteprec_arp_sources_local_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_arp_sources_local_delete(const struct vteprec_arp_sources_local *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_arp_sources_local * -vteprec_arp_sources_local_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_arp_sources_local_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_LOCAL], NULL)); -} - - -void -vteprec_arp_sources_local_verify_locator(const struct vteprec_arp_sources_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_COL_LOCATOR]); -} - -void -vteprec_arp_sources_local_verify_src_mac(const struct vteprec_arp_sources_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_COL_SRC_MAC]); -} - -/* Returns the locator column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes locator's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_arp_sources_local_get_locator(const struct vteprec_arp_sources_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_arp_sources_local_col_locator); -} - -/* Returns the src_mac column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes src_mac's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_arp_sources_local_get_src_mac(const struct vteprec_arp_sources_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_arp_sources_local_col_src_mac); -} - -void -vteprec_arp_sources_local_set_locator(const struct vteprec_arp_sources_local *row, const struct vteprec_physical_locator *locator) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = locator->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_COL_LOCATOR], &datum); -} - -void -vteprec_arp_sources_local_set_src_mac(const struct vteprec_arp_sources_local *row, const char *src_mac) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, src_mac); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_COL_SRC_MAC], &datum); -} - -struct ovsdb_idl_column vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_N_COLUMNS]; - -static void -vteprec_arp_sources_local_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_arp_sources_local_col_locator. */ - c = &vteprec_arp_sources_local_col_locator; - c->name = "locator"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_arp_sources_local_parse_locator; - c->unparse = vteprec_arp_sources_local_unparse_locator; - - /* Initialize vteprec_arp_sources_local_col_src_mac. */ - c = &vteprec_arp_sources_local_col_src_mac; - c->name = "src_mac"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_arp_sources_local_parse_src_mac; - c->unparse = vteprec_arp_sources_local_unparse_src_mac; -} - -/* Arp_Sources_Remote table. */ - -static void -vteprec_arp_sources_remote_parse_locator(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_arp_sources_remote *row = vteprec_arp_sources_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->locator = vteprec_physical_locator_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], &datum->keys[0].uuid)); - } else { - row->locator = NULL; - } -} - -static void -vteprec_arp_sources_remote_parse_src_mac(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_arp_sources_remote *row = vteprec_arp_sources_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->src_mac = datum->keys[0].string; - } else { - row->src_mac = ""; - } -} - -static void -vteprec_arp_sources_remote_unparse_locator(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_arp_sources_remote_unparse_src_mac(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_arp_sources_remote_init__(struct ovsdb_idl_row *row) -{ - vteprec_arp_sources_remote_init(vteprec_arp_sources_remote_cast(row)); -} - -void -vteprec_arp_sources_remote_init(struct vteprec_arp_sources_remote *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_arp_sources_remote * -vteprec_arp_sources_remote_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_arp_sources_remote_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_REMOTE], uuid)); -} - -const struct vteprec_arp_sources_remote * -vteprec_arp_sources_remote_first(const struct ovsdb_idl *idl) -{ - return vteprec_arp_sources_remote_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_REMOTE])); -} - -const struct vteprec_arp_sources_remote * -vteprec_arp_sources_remote_next(const struct vteprec_arp_sources_remote *row) -{ - return vteprec_arp_sources_remote_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_arp_sources_remote_delete(const struct vteprec_arp_sources_remote *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_arp_sources_remote * -vteprec_arp_sources_remote_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_arp_sources_remote_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_REMOTE], NULL)); -} - - -void -vteprec_arp_sources_remote_verify_locator(const struct vteprec_arp_sources_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_COL_LOCATOR]); -} - -void -vteprec_arp_sources_remote_verify_src_mac(const struct vteprec_arp_sources_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_COL_SRC_MAC]); -} - -/* Returns the locator column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes locator's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_arp_sources_remote_get_locator(const struct vteprec_arp_sources_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_arp_sources_remote_col_locator); -} - -/* Returns the src_mac column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes src_mac's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_arp_sources_remote_get_src_mac(const struct vteprec_arp_sources_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_arp_sources_remote_col_src_mac); -} - -void -vteprec_arp_sources_remote_set_locator(const struct vteprec_arp_sources_remote *row, const struct vteprec_physical_locator *locator) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = locator->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_COL_LOCATOR], &datum); -} - -void -vteprec_arp_sources_remote_set_src_mac(const struct vteprec_arp_sources_remote *row, const char *src_mac) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, src_mac); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_COL_SRC_MAC], &datum); -} - -struct ovsdb_idl_column vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_N_COLUMNS]; - -static void -vteprec_arp_sources_remote_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_arp_sources_remote_col_locator. */ - c = &vteprec_arp_sources_remote_col_locator; - c->name = "locator"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_arp_sources_remote_parse_locator; - c->unparse = vteprec_arp_sources_remote_unparse_locator; - - /* Initialize vteprec_arp_sources_remote_col_src_mac. */ - c = &vteprec_arp_sources_remote_col_src_mac; - c->name = "src_mac"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_arp_sources_remote_parse_src_mac; - c->unparse = vteprec_arp_sources_remote_unparse_src_mac; -} - -/* Global table. */ - -static void -vteprec_global_parse_managers(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_global *row = vteprec_global_cast(row_); - size_t i; - - ovs_assert(inited); - row->managers = NULL; - row->n_managers = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_manager *keyRow = vteprec_manager_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_MANAGER], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_managers) { - row->managers = xmalloc(datum->n * sizeof *row->managers); - } - row->managers[row->n_managers] = keyRow; - row->n_managers++; - } - } -} - -static void -vteprec_global_parse_switches(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_global *row = vteprec_global_cast(row_); - size_t i; - - ovs_assert(inited); - row->switches = NULL; - row->n_switches = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_physical_switch *keyRow = vteprec_physical_switch_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_SWITCH], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_switches) { - row->switches = xmalloc(datum->n * sizeof *row->switches); - } - row->switches[row->n_switches] = keyRow; - row->n_switches++; - } - } -} - -static void -vteprec_global_unparse_managers(struct ovsdb_idl_row *row_) -{ - struct vteprec_global *row = vteprec_global_cast(row_); - - ovs_assert(inited); - free(row->managers); -} - -static void -vteprec_global_unparse_switches(struct ovsdb_idl_row *row_) -{ - struct vteprec_global *row = vteprec_global_cast(row_); - - ovs_assert(inited); - free(row->switches); -} - -static void -vteprec_global_init__(struct ovsdb_idl_row *row) -{ - vteprec_global_init(vteprec_global_cast(row)); -} - -void -vteprec_global_init(struct vteprec_global *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_global * -vteprec_global_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_global_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_GLOBAL], uuid)); -} - -const struct vteprec_global * -vteprec_global_first(const struct ovsdb_idl *idl) -{ - return vteprec_global_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_GLOBAL])); -} - -const struct vteprec_global * -vteprec_global_next(const struct vteprec_global *row) -{ - return vteprec_global_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_global_delete(const struct vteprec_global *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_global * -vteprec_global_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_global_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_GLOBAL], NULL)); -} - - -void -vteprec_global_verify_managers(const struct vteprec_global *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_global_columns[VTEPREC_GLOBAL_COL_MANAGERS]); -} - -void -vteprec_global_verify_switches(const struct vteprec_global *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_global_columns[VTEPREC_GLOBAL_COL_SWITCHES]); -} - -/* Returns the managers column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes managers's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_global_get_managers(const struct vteprec_global *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_global_col_managers); -} - -/* Returns the switches column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes switches's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_global_get_switches(const struct vteprec_global *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_global_col_switches); -} - -void -vteprec_global_set_managers(const struct vteprec_global *row, struct vteprec_manager **managers, size_t n_managers) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_managers; - datum.keys = n_managers ? xmalloc(n_managers * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_managers; i++) { - datum.keys[i].uuid = managers[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_global_columns[VTEPREC_GLOBAL_COL_MANAGERS], &datum); -} - -void -vteprec_global_set_switches(const struct vteprec_global *row, struct vteprec_physical_switch **switches, size_t n_switches) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_switches; - datum.keys = n_switches ? xmalloc(n_switches * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_switches; i++) { - datum.keys[i].uuid = switches[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_global_columns[VTEPREC_GLOBAL_COL_SWITCHES], &datum); -} - -struct ovsdb_idl_column vteprec_global_columns[VTEPREC_GLOBAL_N_COLUMNS]; - -static void -vteprec_global_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_global_col_managers. */ - c = &vteprec_global_col_managers; - c->name = "managers"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Manager"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_global_parse_managers; - c->unparse = vteprec_global_unparse_managers; - - /* Initialize vteprec_global_col_switches. */ - c = &vteprec_global_col_switches; - c->name = "switches"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Switch"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_global_parse_switches; - c->unparse = vteprec_global_unparse_switches; -} - -/* Logical_Binding_Stats table. */ - -static void -vteprec_logical_binding_stats_parse_bytes_from_local(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_binding_stats *row = vteprec_logical_binding_stats_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bytes_from_local = datum->keys[0].integer; - } else { - row->bytes_from_local = 0; - } -} - -static void -vteprec_logical_binding_stats_parse_bytes_to_local(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_binding_stats *row = vteprec_logical_binding_stats_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->bytes_to_local = datum->keys[0].integer; - } else { - row->bytes_to_local = 0; - } -} - -static void -vteprec_logical_binding_stats_parse_packets_from_local(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_binding_stats *row = vteprec_logical_binding_stats_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->packets_from_local = datum->keys[0].integer; - } else { - row->packets_from_local = 0; - } -} - -static void -vteprec_logical_binding_stats_parse_packets_to_local(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_binding_stats *row = vteprec_logical_binding_stats_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->packets_to_local = datum->keys[0].integer; - } else { - row->packets_to_local = 0; - } -} - -static void -vteprec_logical_binding_stats_unparse_bytes_from_local(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_binding_stats_unparse_bytes_to_local(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_binding_stats_unparse_packets_from_local(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_binding_stats_unparse_packets_to_local(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_binding_stats_init__(struct ovsdb_idl_row *row) -{ - vteprec_logical_binding_stats_init(vteprec_logical_binding_stats_cast(row)); -} - -void -vteprec_logical_binding_stats_init(struct vteprec_logical_binding_stats *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_logical_binding_stats * -vteprec_logical_binding_stats_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_logical_binding_stats_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_BINDING_STATS], uuid)); -} - -const struct vteprec_logical_binding_stats * -vteprec_logical_binding_stats_first(const struct ovsdb_idl *idl) -{ - return vteprec_logical_binding_stats_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_BINDING_STATS])); -} - -const struct vteprec_logical_binding_stats * -vteprec_logical_binding_stats_next(const struct vteprec_logical_binding_stats *row) -{ - return vteprec_logical_binding_stats_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_logical_binding_stats_delete(const struct vteprec_logical_binding_stats *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_logical_binding_stats * -vteprec_logical_binding_stats_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_logical_binding_stats_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_BINDING_STATS], NULL)); -} - - -void -vteprec_logical_binding_stats_verify_bytes_from_local(const struct vteprec_logical_binding_stats *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_FROM_LOCAL]); -} - -void -vteprec_logical_binding_stats_verify_bytes_to_local(const struct vteprec_logical_binding_stats *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_TO_LOCAL]); -} - -void -vteprec_logical_binding_stats_verify_packets_from_local(const struct vteprec_logical_binding_stats *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_FROM_LOCAL]); -} - -void -vteprec_logical_binding_stats_verify_packets_to_local(const struct vteprec_logical_binding_stats *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_TO_LOCAL]); -} - -/* Returns the bytes_from_local column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes bytes_from_local's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_binding_stats_get_bytes_from_local(const struct vteprec_logical_binding_stats *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &vteprec_logical_binding_stats_col_bytes_from_local); -} - -/* Returns the bytes_to_local column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes bytes_to_local's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_binding_stats_get_bytes_to_local(const struct vteprec_logical_binding_stats *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &vteprec_logical_binding_stats_col_bytes_to_local); -} - -/* Returns the packets_from_local column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes packets_from_local's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_binding_stats_get_packets_from_local(const struct vteprec_logical_binding_stats *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &vteprec_logical_binding_stats_col_packets_from_local); -} - -/* Returns the packets_to_local column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes packets_to_local's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_binding_stats_get_packets_to_local(const struct vteprec_logical_binding_stats *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &vteprec_logical_binding_stats_col_packets_to_local); -} - -void -vteprec_logical_binding_stats_set_bytes_from_local(const struct vteprec_logical_binding_stats *row, int64_t bytes_from_local) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = bytes_from_local; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_FROM_LOCAL], &datum); -} - -void -vteprec_logical_binding_stats_set_bytes_to_local(const struct vteprec_logical_binding_stats *row, int64_t bytes_to_local) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = bytes_to_local; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_TO_LOCAL], &datum); -} - -void -vteprec_logical_binding_stats_set_packets_from_local(const struct vteprec_logical_binding_stats *row, int64_t packets_from_local) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = packets_from_local; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_FROM_LOCAL], &datum); -} - -void -vteprec_logical_binding_stats_set_packets_to_local(const struct vteprec_logical_binding_stats *row, int64_t packets_to_local) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = packets_to_local; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_TO_LOCAL], &datum); -} - -struct ovsdb_idl_column vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_N_COLUMNS]; - -static void -vteprec_logical_binding_stats_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_logical_binding_stats_col_bytes_from_local. */ - c = &vteprec_logical_binding_stats_col_bytes_from_local; - c->name = "bytes_from_local"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_binding_stats_parse_bytes_from_local; - c->unparse = vteprec_logical_binding_stats_unparse_bytes_from_local; - - /* Initialize vteprec_logical_binding_stats_col_bytes_to_local. */ - c = &vteprec_logical_binding_stats_col_bytes_to_local; - c->name = "bytes_to_local"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_binding_stats_parse_bytes_to_local; - c->unparse = vteprec_logical_binding_stats_unparse_bytes_to_local; - - /* Initialize vteprec_logical_binding_stats_col_packets_from_local. */ - c = &vteprec_logical_binding_stats_col_packets_from_local; - c->name = "packets_from_local"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_binding_stats_parse_packets_from_local; - c->unparse = vteprec_logical_binding_stats_unparse_packets_from_local; - - /* Initialize vteprec_logical_binding_stats_col_packets_to_local. */ - c = &vteprec_logical_binding_stats_col_packets_to_local; - c->name = "packets_to_local"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_binding_stats_parse_packets_to_local; - c->unparse = vteprec_logical_binding_stats_unparse_packets_to_local; -} - -/* Logical_Router table. */ - -static void -vteprec_logical_router_parse_description(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_router *row = vteprec_logical_router_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->description = datum->keys[0].string; - } else { - row->description = ""; - } -} - -static void -vteprec_logical_router_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_router *row = vteprec_logical_router_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -vteprec_logical_router_parse_static_routes(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_router *row = vteprec_logical_router_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->static_routes); - for (i = 0; i < datum->n; i++) { - smap_add(&row->static_routes, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -vteprec_logical_router_parse_switch_binding(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_router *row = vteprec_logical_router_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_switch_binding = NULL; - row->value_switch_binding = NULL; - row->n_switch_binding = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_logical_switch *valueRow = vteprec_logical_switch_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], &datum->values[i].uuid)); - if (valueRow) { - if (!row->n_switch_binding) { - row->key_switch_binding = xmalloc(datum->n * sizeof *row->key_switch_binding); - row->value_switch_binding = xmalloc(datum->n * sizeof *row->value_switch_binding); - } - row->key_switch_binding[row->n_switch_binding] = datum->keys[i].string; - row->value_switch_binding[row->n_switch_binding] = valueRow; - row->n_switch_binding++; - } - } -} - -static void -vteprec_logical_router_unparse_description(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_router_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_router_unparse_static_routes(struct ovsdb_idl_row *row_) -{ - struct vteprec_logical_router *row = vteprec_logical_router_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->static_routes); -} - -static void -vteprec_logical_router_unparse_switch_binding(struct ovsdb_idl_row *row_) -{ - struct vteprec_logical_router *row = vteprec_logical_router_cast(row_); - - ovs_assert(inited); - free(row->key_switch_binding); - free(row->value_switch_binding); -} - -static void -vteprec_logical_router_init__(struct ovsdb_idl_row *row) -{ - vteprec_logical_router_init(vteprec_logical_router_cast(row)); -} - -void -vteprec_logical_router_init(struct vteprec_logical_router *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->static_routes); -} - -const struct vteprec_logical_router * -vteprec_logical_router_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_logical_router_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_ROUTER], uuid)); -} - -const struct vteprec_logical_router * -vteprec_logical_router_first(const struct ovsdb_idl *idl) -{ - return vteprec_logical_router_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_ROUTER])); -} - -const struct vteprec_logical_router * -vteprec_logical_router_next(const struct vteprec_logical_router *row) -{ - return vteprec_logical_router_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_logical_router_delete(const struct vteprec_logical_router *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_logical_router * -vteprec_logical_router_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_logical_router_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_ROUTER], NULL)); -} - - -void -vteprec_logical_router_verify_description(const struct vteprec_logical_router *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_DESCRIPTION]); -} - -void -vteprec_logical_router_verify_name(const struct vteprec_logical_router *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_NAME]); -} - -void -vteprec_logical_router_verify_static_routes(const struct vteprec_logical_router *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_STATIC_ROUTES]); -} - -void -vteprec_logical_router_verify_switch_binding(const struct vteprec_logical_router *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_SWITCH_BINDING]); -} - -/* Returns the description column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes description's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_router_get_description(const struct vteprec_logical_router *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_logical_router_col_description); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_router_get_name(const struct vteprec_logical_router *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_logical_router_col_name); -} - -/* Returns the static_routes column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes static_routes's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_router_get_static_routes(const struct vteprec_logical_router *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_logical_router_col_static_routes); -} - -/* Returns the switch_binding column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes switch_binding's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_router_get_switch_binding(const struct vteprec_logical_router *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_logical_router_col_switch_binding); -} - -void -vteprec_logical_router_set_description(const struct vteprec_logical_router *row, const char *description) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, description); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_DESCRIPTION], &datum); -} - -void -vteprec_logical_router_set_name(const struct vteprec_logical_router *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_NAME], &datum); -} - -void -vteprec_logical_router_set_static_routes(const struct vteprec_logical_router *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_STATIC_ROUTES], - &datum); -} - - -void -vteprec_logical_router_set_switch_binding(const struct vteprec_logical_router *row, char **key_switch_binding, struct vteprec_logical_switch **value_switch_binding, size_t n_switch_binding) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_switch_binding; - datum.keys = n_switch_binding ? xmalloc(n_switch_binding * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_switch_binding * sizeof *datum.values); - for (i = 0; i < n_switch_binding; i++) { - datum.keys[i].string = xstrdup(key_switch_binding[i]); - datum.values[i].uuid = value_switch_binding[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_UUID); - ovsdb_idl_txn_write(&row->header_, &vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_SWITCH_BINDING], &datum); -} - -struct ovsdb_idl_column vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_N_COLUMNS]; - -static void -vteprec_logical_router_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_logical_router_col_description. */ - c = &vteprec_logical_router_col_description; - c->name = "description"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_router_parse_description; - c->unparse = vteprec_logical_router_unparse_description; - - /* Initialize vteprec_logical_router_col_name. */ - c = &vteprec_logical_router_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_router_parse_name; - c->unparse = vteprec_logical_router_unparse_name; - - /* Initialize vteprec_logical_router_col_static_routes. */ - c = &vteprec_logical_router_col_static_routes; - c->name = "static_routes"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_logical_router_parse_static_routes; - c->unparse = vteprec_logical_router_unparse_static_routes; - - /* Initialize vteprec_logical_router_col_switch_binding. */ - c = &vteprec_logical_router_col_switch_binding; - c->name = "switch_binding"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_UUID); - c->type.value.u.uuid.refTableName = "Logical_Switch"; - c->type.value.u.uuid.refType = OVSDB_REF_STRONG; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_logical_router_parse_switch_binding; - c->unparse = vteprec_logical_router_unparse_switch_binding; -} - -/* Logical_Switch table. */ - -static void -vteprec_logical_switch_parse_description(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_switch *row = vteprec_logical_switch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->description = datum->keys[0].string; - } else { - row->description = ""; - } -} - -static void -vteprec_logical_switch_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_switch *row = vteprec_logical_switch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -vteprec_logical_switch_parse_tunnel_key(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_logical_switch *row = vteprec_logical_switch_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->tunnel_key = NULL; - row->n_tunnel_key = 0; - for (i = 0; i < n; i++) { - if (!row->n_tunnel_key) { - row->tunnel_key = xmalloc(n * sizeof *row->tunnel_key); - } - row->tunnel_key[row->n_tunnel_key] = datum->keys[i].integer; - row->n_tunnel_key++; - } -} - -static void -vteprec_logical_switch_unparse_description(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_switch_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_logical_switch_unparse_tunnel_key(struct ovsdb_idl_row *row_) -{ - struct vteprec_logical_switch *row = vteprec_logical_switch_cast(row_); - - ovs_assert(inited); - free(row->tunnel_key); -} - -static void -vteprec_logical_switch_init__(struct ovsdb_idl_row *row) -{ - vteprec_logical_switch_init(vteprec_logical_switch_cast(row)); -} - -void -vteprec_logical_switch_init(struct vteprec_logical_switch *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_logical_switch * -vteprec_logical_switch_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_logical_switch_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], uuid)); -} - -const struct vteprec_logical_switch * -vteprec_logical_switch_first(const struct ovsdb_idl *idl) -{ - return vteprec_logical_switch_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH])); -} - -const struct vteprec_logical_switch * -vteprec_logical_switch_next(const struct vteprec_logical_switch *row) -{ - return vteprec_logical_switch_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_logical_switch_delete(const struct vteprec_logical_switch *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_logical_switch * -vteprec_logical_switch_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_logical_switch_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], NULL)); -} - - -void -vteprec_logical_switch_verify_description(const struct vteprec_logical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_DESCRIPTION]); -} - -void -vteprec_logical_switch_verify_name(const struct vteprec_logical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_NAME]); -} - -void -vteprec_logical_switch_verify_tunnel_key(const struct vteprec_logical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_TUNNEL_KEY]); -} - -/* Returns the description column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes description's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_switch_get_description(const struct vteprec_logical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_logical_switch_col_description); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_switch_get_name(const struct vteprec_logical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_logical_switch_col_name); -} - -/* Returns the tunnel_key column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes tunnel_key's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_logical_switch_get_tunnel_key(const struct vteprec_logical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &vteprec_logical_switch_col_tunnel_key); -} - -void -vteprec_logical_switch_set_description(const struct vteprec_logical_switch *row, const char *description) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, description); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_DESCRIPTION], &datum); -} - -void -vteprec_logical_switch_set_name(const struct vteprec_logical_switch *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_NAME], &datum); -} - -void -vteprec_logical_switch_set_tunnel_key(const struct vteprec_logical_switch *row, const int64_t *tunnel_key, size_t n_tunnel_key) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_tunnel_key) { - datum.n = 1; - datum.keys = &key; - key.integer = *tunnel_key; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_TUNNEL_KEY], &datum); -} - -struct ovsdb_idl_column vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_N_COLUMNS]; - -static void -vteprec_logical_switch_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_logical_switch_col_description. */ - c = &vteprec_logical_switch_col_description; - c->name = "description"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_switch_parse_description; - c->unparse = vteprec_logical_switch_unparse_description; - - /* Initialize vteprec_logical_switch_col_name. */ - c = &vteprec_logical_switch_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_switch_parse_name; - c->unparse = vteprec_logical_switch_unparse_name; - - /* Initialize vteprec_logical_switch_col_tunnel_key. */ - c = &vteprec_logical_switch_col_tunnel_key; - c->name = "tunnel_key"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_logical_switch_parse_tunnel_key; - c->unparse = vteprec_logical_switch_unparse_tunnel_key; -} - -/* Manager table. */ - -static void -vteprec_manager_parse_inactivity_probe(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->inactivity_probe = NULL; - row->n_inactivity_probe = 0; - for (i = 0; i < n; i++) { - if (!row->n_inactivity_probe) { - row->inactivity_probe = xmalloc(n * sizeof *row->inactivity_probe); - } - row->inactivity_probe[row->n_inactivity_probe] = datum->keys[i].integer; - row->n_inactivity_probe++; - } -} - -static void -vteprec_manager_parse_is_connected(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->is_connected = datum->keys[0].boolean; - } else { - row->is_connected = false; - } -} - -static void -vteprec_manager_parse_max_backoff(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->max_backoff = NULL; - row->n_max_backoff = 0; - for (i = 0; i < n; i++) { - if (!row->n_max_backoff) { - row->max_backoff = xmalloc(n * sizeof *row->max_backoff); - } - row->max_backoff[row->n_max_backoff] = datum->keys[i].integer; - row->n_max_backoff++; - } -} - -static void -vteprec_manager_parse_other_config(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->other_config); - for (i = 0; i < datum->n; i++) { - smap_add(&row->other_config, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -vteprec_manager_parse_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -vteprec_manager_parse_target(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->target = datum->keys[0].string; - } else { - row->target = ""; - } -} - -static void -vteprec_manager_unparse_inactivity_probe(struct ovsdb_idl_row *row_) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - - ovs_assert(inited); - free(row->inactivity_probe); -} - -static void -vteprec_manager_unparse_is_connected(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_manager_unparse_max_backoff(struct ovsdb_idl_row *row_) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - - ovs_assert(inited); - free(row->max_backoff); -} - -static void -vteprec_manager_unparse_other_config(struct ovsdb_idl_row *row_) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->other_config); -} - -static void -vteprec_manager_unparse_status(struct ovsdb_idl_row *row_) -{ - struct vteprec_manager *row = vteprec_manager_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->status); -} - -static void -vteprec_manager_unparse_target(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_manager_init__(struct ovsdb_idl_row *row) -{ - vteprec_manager_init(vteprec_manager_cast(row)); -} - -void -vteprec_manager_init(struct vteprec_manager *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->other_config); - smap_init(&row->status); -} - -const struct vteprec_manager * -vteprec_manager_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_manager_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_MANAGER], uuid)); -} - -const struct vteprec_manager * -vteprec_manager_first(const struct ovsdb_idl *idl) -{ - return vteprec_manager_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_MANAGER])); -} - -const struct vteprec_manager * -vteprec_manager_next(const struct vteprec_manager *row) -{ - return vteprec_manager_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_manager_delete(const struct vteprec_manager *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_manager * -vteprec_manager_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_manager_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_MANAGER], NULL)); -} - - -void -vteprec_manager_verify_inactivity_probe(const struct vteprec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_INACTIVITY_PROBE]); -} - -void -vteprec_manager_verify_is_connected(const struct vteprec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_IS_CONNECTED]); -} - -void -vteprec_manager_verify_max_backoff(const struct vteprec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_MAX_BACKOFF]); -} - -void -vteprec_manager_verify_other_config(const struct vteprec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_OTHER_CONFIG]); -} - -void -vteprec_manager_verify_status(const struct vteprec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_STATUS]); -} - -void -vteprec_manager_verify_target(const struct vteprec_manager *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_TARGET]); -} - -/* Returns the inactivity_probe column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes inactivity_probe's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_manager_get_inactivity_probe(const struct vteprec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &vteprec_manager_col_inactivity_probe); -} - -/* Returns the is_connected column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes is_connected's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_manager_get_is_connected(const struct vteprec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &vteprec_manager_col_is_connected); -} - -/* Returns the max_backoff column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes max_backoff's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_manager_get_max_backoff(const struct vteprec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &vteprec_manager_col_max_backoff); -} - -/* Returns the other_config column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes other_config's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_manager_get_other_config(const struct vteprec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_manager_col_other_config); -} - -/* Returns the status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_manager_get_status(const struct vteprec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_manager_col_status); -} - -/* Returns the target column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes target's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_manager_get_target(const struct vteprec_manager *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_manager_col_target); -} - -void -vteprec_manager_set_inactivity_probe(const struct vteprec_manager *row, const int64_t *inactivity_probe, size_t n_inactivity_probe) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_inactivity_probe) { - datum.n = 1; - datum.keys = &key; - key.integer = *inactivity_probe; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_INACTIVITY_PROBE], &datum); -} - -void -vteprec_manager_set_is_connected(const struct vteprec_manager *row, bool is_connected) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = is_connected; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_IS_CONNECTED], &datum); -} - -void -vteprec_manager_set_max_backoff(const struct vteprec_manager *row, const int64_t *max_backoff, size_t n_max_backoff) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_max_backoff) { - datum.n = 1; - datum.keys = &key; - key.integer = *max_backoff; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_MAX_BACKOFF], &datum); -} - -void -vteprec_manager_set_other_config(const struct vteprec_manager *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &vteprec_manager_columns[VTEPREC_MANAGER_COL_OTHER_CONFIG], - &datum); -} - - -void -vteprec_manager_set_status(const struct vteprec_manager *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &vteprec_manager_columns[VTEPREC_MANAGER_COL_STATUS], - &datum); -} - - -void -vteprec_manager_set_target(const struct vteprec_manager *row, const char *target) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, target); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_manager_columns[VTEPREC_MANAGER_COL_TARGET], &datum); -} - -struct ovsdb_idl_column vteprec_manager_columns[VTEPREC_MANAGER_N_COLUMNS]; - -static void -vteprec_manager_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_manager_col_inactivity_probe. */ - c = &vteprec_manager_col_inactivity_probe; - c->name = "inactivity_probe"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_manager_parse_inactivity_probe; - c->unparse = vteprec_manager_unparse_inactivity_probe; - - /* Initialize vteprec_manager_col_is_connected. */ - c = &vteprec_manager_col_is_connected; - c->name = "is_connected"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_manager_parse_is_connected; - c->unparse = vteprec_manager_unparse_is_connected; - - /* Initialize vteprec_manager_col_max_backoff. */ - c = &vteprec_manager_col_max_backoff; - c->name = "max_backoff"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(1000); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_manager_parse_max_backoff; - c->unparse = vteprec_manager_unparse_max_backoff; - - /* Initialize vteprec_manager_col_other_config. */ - c = &vteprec_manager_col_other_config; - c->name = "other_config"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_manager_parse_other_config; - c->unparse = vteprec_manager_unparse_other_config; - - /* Initialize vteprec_manager_col_status. */ - c = &vteprec_manager_col_status; - c->name = "status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_manager_parse_status; - c->unparse = vteprec_manager_unparse_status; - - /* Initialize vteprec_manager_col_target. */ - c = &vteprec_manager_col_target; - c->name = "target"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_manager_parse_target; - c->unparse = vteprec_manager_unparse_target; -} - -/* Mcast_Macs_Local table. */ - -static void -vteprec_mcast_macs_local_parse_MAC(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_local *row = vteprec_mcast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->MAC = datum->keys[0].string; - } else { - row->MAC = ""; - } -} - -static void -vteprec_mcast_macs_local_parse_ipaddr(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_local *row = vteprec_mcast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ipaddr = datum->keys[0].string; - } else { - row->ipaddr = ""; - } -} - -static void -vteprec_mcast_macs_local_parse_locator_set(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_local *row = vteprec_mcast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->locator_set = vteprec_physical_locator_set_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR_SET], &datum->keys[0].uuid)); - } else { - row->locator_set = NULL; - } -} - -static void -vteprec_mcast_macs_local_parse_logical_switch(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_local *row = vteprec_mcast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->logical_switch = vteprec_logical_switch_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], &datum->keys[0].uuid)); - } else { - row->logical_switch = NULL; - } -} - -static void -vteprec_mcast_macs_local_unparse_MAC(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_local_unparse_ipaddr(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_local_unparse_locator_set(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_local_unparse_logical_switch(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_local_init__(struct ovsdb_idl_row *row) -{ - vteprec_mcast_macs_local_init(vteprec_mcast_macs_local_cast(row)); -} - -void -vteprec_mcast_macs_local_init(struct vteprec_mcast_macs_local *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_mcast_macs_local * -vteprec_mcast_macs_local_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_mcast_macs_local_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_LOCAL], uuid)); -} - -const struct vteprec_mcast_macs_local * -vteprec_mcast_macs_local_first(const struct ovsdb_idl *idl) -{ - return vteprec_mcast_macs_local_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_LOCAL])); -} - -const struct vteprec_mcast_macs_local * -vteprec_mcast_macs_local_next(const struct vteprec_mcast_macs_local *row) -{ - return vteprec_mcast_macs_local_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_mcast_macs_local_delete(const struct vteprec_mcast_macs_local *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_mcast_macs_local * -vteprec_mcast_macs_local_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_mcast_macs_local_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_LOCAL], NULL)); -} - - -void -vteprec_mcast_macs_local_verify_MAC(const struct vteprec_mcast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_MAC]); -} - -void -vteprec_mcast_macs_local_verify_ipaddr(const struct vteprec_mcast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_IPADDR]); -} - -void -vteprec_mcast_macs_local_verify_locator_set(const struct vteprec_mcast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_LOCATOR_SET]); -} - -void -vteprec_mcast_macs_local_verify_logical_switch(const struct vteprec_mcast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_LOGICAL_SWITCH]); -} - -/* Returns the MAC column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes MAC's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_local_get_MAC(const struct vteprec_mcast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_local_col_MAC); -} - -/* Returns the ipaddr column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes ipaddr's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_local_get_ipaddr(const struct vteprec_mcast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_local_col_ipaddr); -} - -/* Returns the locator_set column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes locator_set's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_local_get_locator_set(const struct vteprec_mcast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_local_col_locator_set); -} - -/* Returns the logical_switch column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes logical_switch's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_local_get_logical_switch(const struct vteprec_mcast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_local_col_logical_switch); -} - -void -vteprec_mcast_macs_local_set_MAC(const struct vteprec_mcast_macs_local *row, const char *MAC) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, MAC); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_MAC], &datum); -} - -void -vteprec_mcast_macs_local_set_ipaddr(const struct vteprec_mcast_macs_local *row, const char *ipaddr) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, ipaddr); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_IPADDR], &datum); -} - -void -vteprec_mcast_macs_local_set_locator_set(const struct vteprec_mcast_macs_local *row, const struct vteprec_physical_locator_set *locator_set) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = locator_set->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_LOCATOR_SET], &datum); -} - -void -vteprec_mcast_macs_local_set_logical_switch(const struct vteprec_mcast_macs_local *row, const struct vteprec_logical_switch *logical_switch) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = logical_switch->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_LOGICAL_SWITCH], &datum); -} - -struct ovsdb_idl_column vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_N_COLUMNS]; - -static void -vteprec_mcast_macs_local_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_mcast_macs_local_col_MAC. */ - c = &vteprec_mcast_macs_local_col_MAC; - c->name = "MAC"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_local_parse_MAC; - c->unparse = vteprec_mcast_macs_local_unparse_MAC; - - /* Initialize vteprec_mcast_macs_local_col_ipaddr. */ - c = &vteprec_mcast_macs_local_col_ipaddr; - c->name = "ipaddr"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_local_parse_ipaddr; - c->unparse = vteprec_mcast_macs_local_unparse_ipaddr; - - /* Initialize vteprec_mcast_macs_local_col_locator_set. */ - c = &vteprec_mcast_macs_local_col_locator_set; - c->name = "locator_set"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator_Set"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_local_parse_locator_set; - c->unparse = vteprec_mcast_macs_local_unparse_locator_set; - - /* Initialize vteprec_mcast_macs_local_col_logical_switch. */ - c = &vteprec_mcast_macs_local_col_logical_switch; - c->name = "logical_switch"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Logical_Switch"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_local_parse_logical_switch; - c->unparse = vteprec_mcast_macs_local_unparse_logical_switch; -} - -/* Mcast_Macs_Remote table. */ - -static void -vteprec_mcast_macs_remote_parse_MAC(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_remote *row = vteprec_mcast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->MAC = datum->keys[0].string; - } else { - row->MAC = ""; - } -} - -static void -vteprec_mcast_macs_remote_parse_ipaddr(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_remote *row = vteprec_mcast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ipaddr = datum->keys[0].string; - } else { - row->ipaddr = ""; - } -} - -static void -vteprec_mcast_macs_remote_parse_locator_set(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_remote *row = vteprec_mcast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->locator_set = vteprec_physical_locator_set_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR_SET], &datum->keys[0].uuid)); - } else { - row->locator_set = NULL; - } -} - -static void -vteprec_mcast_macs_remote_parse_logical_switch(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_mcast_macs_remote *row = vteprec_mcast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->logical_switch = vteprec_logical_switch_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], &datum->keys[0].uuid)); - } else { - row->logical_switch = NULL; - } -} - -static void -vteprec_mcast_macs_remote_unparse_MAC(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_remote_unparse_ipaddr(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_remote_unparse_locator_set(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_remote_unparse_logical_switch(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_mcast_macs_remote_init__(struct ovsdb_idl_row *row) -{ - vteprec_mcast_macs_remote_init(vteprec_mcast_macs_remote_cast(row)); -} - -void -vteprec_mcast_macs_remote_init(struct vteprec_mcast_macs_remote *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_mcast_macs_remote * -vteprec_mcast_macs_remote_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_mcast_macs_remote_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_REMOTE], uuid)); -} - -const struct vteprec_mcast_macs_remote * -vteprec_mcast_macs_remote_first(const struct ovsdb_idl *idl) -{ - return vteprec_mcast_macs_remote_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_REMOTE])); -} - -const struct vteprec_mcast_macs_remote * -vteprec_mcast_macs_remote_next(const struct vteprec_mcast_macs_remote *row) -{ - return vteprec_mcast_macs_remote_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_mcast_macs_remote_delete(const struct vteprec_mcast_macs_remote *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_mcast_macs_remote * -vteprec_mcast_macs_remote_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_mcast_macs_remote_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_REMOTE], NULL)); -} - - -void -vteprec_mcast_macs_remote_verify_MAC(const struct vteprec_mcast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_MAC]); -} - -void -vteprec_mcast_macs_remote_verify_ipaddr(const struct vteprec_mcast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_IPADDR]); -} - -void -vteprec_mcast_macs_remote_verify_locator_set(const struct vteprec_mcast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_LOCATOR_SET]); -} - -void -vteprec_mcast_macs_remote_verify_logical_switch(const struct vteprec_mcast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_LOGICAL_SWITCH]); -} - -/* Returns the MAC column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes MAC's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_remote_get_MAC(const struct vteprec_mcast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_remote_col_MAC); -} - -/* Returns the ipaddr column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes ipaddr's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_remote_get_ipaddr(const struct vteprec_mcast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_remote_col_ipaddr); -} - -/* Returns the locator_set column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes locator_set's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_remote_get_locator_set(const struct vteprec_mcast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_remote_col_locator_set); -} - -/* Returns the logical_switch column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes logical_switch's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_mcast_macs_remote_get_logical_switch(const struct vteprec_mcast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_mcast_macs_remote_col_logical_switch); -} - -void -vteprec_mcast_macs_remote_set_MAC(const struct vteprec_mcast_macs_remote *row, const char *MAC) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, MAC); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_MAC], &datum); -} - -void -vteprec_mcast_macs_remote_set_ipaddr(const struct vteprec_mcast_macs_remote *row, const char *ipaddr) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, ipaddr); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_IPADDR], &datum); -} - -void -vteprec_mcast_macs_remote_set_locator_set(const struct vteprec_mcast_macs_remote *row, const struct vteprec_physical_locator_set *locator_set) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = locator_set->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_LOCATOR_SET], &datum); -} - -void -vteprec_mcast_macs_remote_set_logical_switch(const struct vteprec_mcast_macs_remote *row, const struct vteprec_logical_switch *logical_switch) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = logical_switch->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_LOGICAL_SWITCH], &datum); -} - -struct ovsdb_idl_column vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_N_COLUMNS]; - -static void -vteprec_mcast_macs_remote_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_mcast_macs_remote_col_MAC. */ - c = &vteprec_mcast_macs_remote_col_MAC; - c->name = "MAC"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_remote_parse_MAC; - c->unparse = vteprec_mcast_macs_remote_unparse_MAC; - - /* Initialize vteprec_mcast_macs_remote_col_ipaddr. */ - c = &vteprec_mcast_macs_remote_col_ipaddr; - c->name = "ipaddr"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_remote_parse_ipaddr; - c->unparse = vteprec_mcast_macs_remote_unparse_ipaddr; - - /* Initialize vteprec_mcast_macs_remote_col_locator_set. */ - c = &vteprec_mcast_macs_remote_col_locator_set; - c->name = "locator_set"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator_Set"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_remote_parse_locator_set; - c->unparse = vteprec_mcast_macs_remote_unparse_locator_set; - - /* Initialize vteprec_mcast_macs_remote_col_logical_switch. */ - c = &vteprec_mcast_macs_remote_col_logical_switch; - c->name = "logical_switch"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Logical_Switch"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_mcast_macs_remote_parse_logical_switch; - c->unparse = vteprec_mcast_macs_remote_unparse_logical_switch; -} - -/* Physical_Locator table. */ - -static void -vteprec_physical_locator_parse_dst_ip(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_locator *row = vteprec_physical_locator_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->dst_ip = datum->keys[0].string; - } else { - row->dst_ip = ""; - } -} - -static void -vteprec_physical_locator_parse_encapsulation_type(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_locator *row = vteprec_physical_locator_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->encapsulation_type = datum->keys[0].string; - } else { - row->encapsulation_type = ""; - } -} - -static void -vteprec_physical_locator_unparse_dst_ip(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_physical_locator_unparse_encapsulation_type(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_physical_locator_init__(struct ovsdb_idl_row *row) -{ - vteprec_physical_locator_init(vteprec_physical_locator_cast(row)); -} - -void -vteprec_physical_locator_init(struct vteprec_physical_locator *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_physical_locator * -vteprec_physical_locator_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_physical_locator_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], uuid)); -} - -const struct vteprec_physical_locator * -vteprec_physical_locator_first(const struct ovsdb_idl *idl) -{ - return vteprec_physical_locator_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR])); -} - -const struct vteprec_physical_locator * -vteprec_physical_locator_next(const struct vteprec_physical_locator *row) -{ - return vteprec_physical_locator_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_physical_locator_delete(const struct vteprec_physical_locator *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_physical_locator * -vteprec_physical_locator_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_physical_locator_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], NULL)); -} - - -void -vteprec_physical_locator_verify_dst_ip(const struct vteprec_physical_locator *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_COL_DST_IP]); -} - -void -vteprec_physical_locator_verify_encapsulation_type(const struct vteprec_physical_locator *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_COL_ENCAPSULATION_TYPE]); -} - -/* Returns the dst_ip column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes dst_ip's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_locator_get_dst_ip(const struct vteprec_physical_locator *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_locator_col_dst_ip); -} - -/* Returns the encapsulation_type column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes encapsulation_type's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_locator_get_encapsulation_type(const struct vteprec_physical_locator *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_locator_col_encapsulation_type); -} - -void -vteprec_physical_locator_set_dst_ip(const struct vteprec_physical_locator *row, const char *dst_ip) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, dst_ip); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_COL_DST_IP], &datum); -} - -void -vteprec_physical_locator_set_encapsulation_type(const struct vteprec_physical_locator *row, const char *encapsulation_type) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, encapsulation_type); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_COL_ENCAPSULATION_TYPE], &datum); -} - -struct ovsdb_idl_column vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_N_COLUMNS]; - -static void -vteprec_physical_locator_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_physical_locator_col_dst_ip. */ - c = &vteprec_physical_locator_col_dst_ip; - c->name = "dst_ip"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = false; - c->parse = vteprec_physical_locator_parse_dst_ip; - c->unparse = vteprec_physical_locator_unparse_dst_ip; - - /* Initialize vteprec_physical_locator_col_encapsulation_type. */ - c = &vteprec_physical_locator_col_encapsulation_type; - c->name = "encapsulation_type"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.enum_ = xmalloc(sizeof *c->type.key.enum_); - c->type.key.enum_->n = 1; - c->type.key.enum_->keys = xmalloc(1 * sizeof *c->type.key.enum_->keys); - c->type.key.enum_->keys[0].string = xstrdup("vxlan_over_ipv4"); - c->type.key.enum_->values = NULL; - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = false; - c->parse = vteprec_physical_locator_parse_encapsulation_type; - c->unparse = vteprec_physical_locator_unparse_encapsulation_type; -} - -/* Physical_Locator_Set table. */ - -static void -vteprec_physical_locator_set_parse_locators(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_locator_set *row = vteprec_physical_locator_set_cast(row_); - size_t i; - - ovs_assert(inited); - row->locators = NULL; - row->n_locators = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_physical_locator *keyRow = vteprec_physical_locator_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_locators) { - row->locators = xmalloc(datum->n * sizeof *row->locators); - } - row->locators[row->n_locators] = keyRow; - row->n_locators++; - } - } -} - -static void -vteprec_physical_locator_set_unparse_locators(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_locator_set *row = vteprec_physical_locator_set_cast(row_); - - ovs_assert(inited); - free(row->locators); -} - -static void -vteprec_physical_locator_set_init__(struct ovsdb_idl_row *row) -{ - vteprec_physical_locator_set_init(vteprec_physical_locator_set_cast(row)); -} - -void -vteprec_physical_locator_set_init(struct vteprec_physical_locator_set *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_physical_locator_set * -vteprec_physical_locator_set_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_physical_locator_set_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR_SET], uuid)); -} - -const struct vteprec_physical_locator_set * -vteprec_physical_locator_set_first(const struct ovsdb_idl *idl) -{ - return vteprec_physical_locator_set_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR_SET])); -} - -const struct vteprec_physical_locator_set * -vteprec_physical_locator_set_next(const struct vteprec_physical_locator_set *row) -{ - return vteprec_physical_locator_set_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_physical_locator_set_delete(const struct vteprec_physical_locator_set *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_physical_locator_set * -vteprec_physical_locator_set_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_physical_locator_set_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR_SET], NULL)); -} - - -void -vteprec_physical_locator_set_verify_locators(const struct vteprec_physical_locator_set *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_locator_set_columns[VTEPREC_PHYSICAL_LOCATOR_SET_COL_LOCATORS]); -} - -/* Returns the locators column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes locators's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_locator_set_get_locators(const struct vteprec_physical_locator_set *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_physical_locator_set_col_locators); -} - -void -vteprec_physical_locator_set_set_locators(const struct vteprec_physical_locator_set *row, struct vteprec_physical_locator **locators, size_t n_locators) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_locators; - datum.keys = n_locators ? xmalloc(n_locators * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_locators; i++) { - datum.keys[i].uuid = locators[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_locator_set_columns[VTEPREC_PHYSICAL_LOCATOR_SET_COL_LOCATORS], &datum); -} - -struct ovsdb_idl_column vteprec_physical_locator_set_columns[VTEPREC_PHYSICAL_LOCATOR_SET_N_COLUMNS]; - -static void -vteprec_physical_locator_set_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_physical_locator_set_col_locators. */ - c = &vteprec_physical_locator_set_col_locators; - c->name = "locators"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = UINT_MAX; - c->mutable = false; - c->parse = vteprec_physical_locator_set_parse_locators; - c->unparse = vteprec_physical_locator_set_unparse_locators; -} - -/* Physical_Port table. */ - -static void -vteprec_physical_port_parse_description(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->description = datum->keys[0].string; - } else { - row->description = ""; - } -} - -static void -vteprec_physical_port_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -vteprec_physical_port_parse_port_fault_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - size_t i; - - ovs_assert(inited); - row->port_fault_status = NULL; - row->n_port_fault_status = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_port_fault_status) { - row->port_fault_status = xmalloc(datum->n * sizeof *row->port_fault_status); - } - row->port_fault_status[row->n_port_fault_status] = datum->keys[i].string; - row->n_port_fault_status++; - } -} - -static void -vteprec_physical_port_parse_vlan_bindings(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_vlan_bindings = NULL; - row->value_vlan_bindings = NULL; - row->n_vlan_bindings = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_logical_switch *valueRow = vteprec_logical_switch_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], &datum->values[i].uuid)); - if (valueRow) { - if (!row->n_vlan_bindings) { - row->key_vlan_bindings = xmalloc(datum->n * sizeof *row->key_vlan_bindings); - row->value_vlan_bindings = xmalloc(datum->n * sizeof *row->value_vlan_bindings); - } - row->key_vlan_bindings[row->n_vlan_bindings] = datum->keys[i].integer; - row->value_vlan_bindings[row->n_vlan_bindings] = valueRow; - row->n_vlan_bindings++; - } - } -} - -static void -vteprec_physical_port_parse_vlan_stats(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - size_t i; - - ovs_assert(inited); - row->key_vlan_stats = NULL; - row->value_vlan_stats = NULL; - row->n_vlan_stats = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_logical_binding_stats *valueRow = vteprec_logical_binding_stats_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_BINDING_STATS], &datum->values[i].uuid)); - if (valueRow) { - if (!row->n_vlan_stats) { - row->key_vlan_stats = xmalloc(datum->n * sizeof *row->key_vlan_stats); - row->value_vlan_stats = xmalloc(datum->n * sizeof *row->value_vlan_stats); - } - row->key_vlan_stats[row->n_vlan_stats] = datum->keys[i].integer; - row->value_vlan_stats[row->n_vlan_stats] = valueRow; - row->n_vlan_stats++; - } - } -} - -static void -vteprec_physical_port_unparse_description(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_physical_port_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_physical_port_unparse_port_fault_status(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - - ovs_assert(inited); - free(row->port_fault_status); -} - -static void -vteprec_physical_port_unparse_vlan_bindings(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - - ovs_assert(inited); - free(row->key_vlan_bindings); - free(row->value_vlan_bindings); -} - -static void -vteprec_physical_port_unparse_vlan_stats(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_port *row = vteprec_physical_port_cast(row_); - - ovs_assert(inited); - free(row->key_vlan_stats); - free(row->value_vlan_stats); -} - -static void -vteprec_physical_port_init__(struct ovsdb_idl_row *row) -{ - vteprec_physical_port_init(vteprec_physical_port_cast(row)); -} - -void -vteprec_physical_port_init(struct vteprec_physical_port *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_physical_port * -vteprec_physical_port_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_physical_port_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_PORT], uuid)); -} - -const struct vteprec_physical_port * -vteprec_physical_port_first(const struct ovsdb_idl *idl) -{ - return vteprec_physical_port_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_PORT])); -} - -const struct vteprec_physical_port * -vteprec_physical_port_next(const struct vteprec_physical_port *row) -{ - return vteprec_physical_port_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_physical_port_delete(const struct vteprec_physical_port *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_physical_port * -vteprec_physical_port_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_physical_port_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_PORT], NULL)); -} - - -void -vteprec_physical_port_verify_description(const struct vteprec_physical_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_DESCRIPTION]); -} - -void -vteprec_physical_port_verify_name(const struct vteprec_physical_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_NAME]); -} - -void -vteprec_physical_port_verify_port_fault_status(const struct vteprec_physical_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS]); -} - -void -vteprec_physical_port_verify_vlan_bindings(const struct vteprec_physical_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_BINDINGS]); -} - -void -vteprec_physical_port_verify_vlan_stats(const struct vteprec_physical_port *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_STATS]); -} - -/* Returns the description column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes description's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_port_get_description(const struct vteprec_physical_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_port_col_description); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_port_get_name(const struct vteprec_physical_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_port_col_name); -} - -/* Returns the port_fault_status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes port_fault_status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_port_get_port_fault_status(const struct vteprec_physical_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_port_col_port_fault_status); -} - -/* Returns the vlan_bindings column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * 'value_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes vlan_bindings's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_port_get_vlan_bindings(const struct vteprec_physical_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - ovs_assert(value_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_physical_port_col_vlan_bindings); -} - -/* Returns the vlan_stats column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * 'value_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes vlan_stats's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_port_get_vlan_stats(const struct vteprec_physical_port *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - ovs_assert(value_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_physical_port_col_vlan_stats); -} - -void -vteprec_physical_port_set_description(const struct vteprec_physical_port *row, const char *description) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, description); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_DESCRIPTION], &datum); -} - -void -vteprec_physical_port_set_name(const struct vteprec_physical_port *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_NAME], &datum); -} - -void -vteprec_physical_port_set_port_fault_status(const struct vteprec_physical_port *row, char **port_fault_status, size_t n_port_fault_status) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_port_fault_status; - datum.keys = n_port_fault_status ? xmalloc(n_port_fault_status * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_port_fault_status; i++) { - datum.keys[i].string = xstrdup(port_fault_status[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS], &datum); -} - -void -vteprec_physical_port_set_vlan_bindings(const struct vteprec_physical_port *row, const int64_t *key_vlan_bindings, struct vteprec_logical_switch **value_vlan_bindings, size_t n_vlan_bindings) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_vlan_bindings; - datum.keys = n_vlan_bindings ? xmalloc(n_vlan_bindings * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_vlan_bindings * sizeof *datum.values); - for (i = 0; i < n_vlan_bindings; i++) { - datum.keys[i].integer = key_vlan_bindings[i]; - datum.values[i].uuid = value_vlan_bindings[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_UUID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_BINDINGS], &datum); -} - -void -vteprec_physical_port_set_vlan_stats(const struct vteprec_physical_port *row, const int64_t *key_vlan_stats, struct vteprec_logical_binding_stats **value_vlan_stats, size_t n_vlan_stats) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_vlan_stats; - datum.keys = n_vlan_stats ? xmalloc(n_vlan_stats * sizeof *datum.keys) : NULL; - datum.values = xmalloc(n_vlan_stats * sizeof *datum.values); - for (i = 0; i < n_vlan_stats; i++) { - datum.keys[i].integer = key_vlan_stats[i]; - datum.values[i].uuid = value_vlan_stats[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_UUID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_STATS], &datum); -} - -struct ovsdb_idl_column vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_N_COLUMNS]; - -static void -vteprec_physical_port_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_physical_port_col_description. */ - c = &vteprec_physical_port_col_description; - c->name = "description"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_physical_port_parse_description; - c->unparse = vteprec_physical_port_unparse_description; - - /* Initialize vteprec_physical_port_col_name. */ - c = &vteprec_physical_port_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_physical_port_parse_name; - c->unparse = vteprec_physical_port_unparse_name; - - /* Initialize vteprec_physical_port_col_port_fault_status. */ - c = &vteprec_physical_port_col_port_fault_status; - c->name = "port_fault_status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_port_parse_port_fault_status; - c->unparse = vteprec_physical_port_unparse_port_fault_status; - - /* Initialize vteprec_physical_port_col_vlan_bindings. */ - c = &vteprec_physical_port_col_vlan_bindings; - c->name = "vlan_bindings"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4095); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_UUID); - c->type.value.u.uuid.refTableName = "Logical_Switch"; - c->type.value.u.uuid.refType = OVSDB_REF_STRONG; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_port_parse_vlan_bindings; - c->unparse = vteprec_physical_port_unparse_vlan_bindings; - - /* Initialize vteprec_physical_port_col_vlan_stats. */ - c = &vteprec_physical_port_col_vlan_stats; - c->name = "vlan_stats"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - c->type.key.u.integer.min = INT64_C(0); - c->type.key.u.integer.max = INT64_C(4095); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_UUID); - c->type.value.u.uuid.refTableName = "Logical_Binding_Stats"; - c->type.value.u.uuid.refType = OVSDB_REF_STRONG; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_port_parse_vlan_stats; - c->unparse = vteprec_physical_port_unparse_vlan_stats; -} - -/* Physical_Switch table. */ - -static void -vteprec_physical_switch_parse_description(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->description = datum->keys[0].string; - } else { - row->description = ""; - } -} - -static void -vteprec_physical_switch_parse_management_ips(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - size_t i; - - ovs_assert(inited); - row->management_ips = NULL; - row->n_management_ips = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_management_ips) { - row->management_ips = xmalloc(datum->n * sizeof *row->management_ips); - } - row->management_ips[row->n_management_ips] = datum->keys[i].string; - row->n_management_ips++; - } -} - -static void -vteprec_physical_switch_parse_name(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->name = datum->keys[0].string; - } else { - row->name = ""; - } -} - -static void -vteprec_physical_switch_parse_ports(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - size_t i; - - ovs_assert(inited); - row->ports = NULL; - row->n_ports = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_physical_port *keyRow = vteprec_physical_port_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_PORT], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_ports) { - row->ports = xmalloc(datum->n * sizeof *row->ports); - } - row->ports[row->n_ports] = keyRow; - row->n_ports++; - } - } -} - -static void -vteprec_physical_switch_parse_switch_fault_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - size_t i; - - ovs_assert(inited); - row->switch_fault_status = NULL; - row->n_switch_fault_status = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_switch_fault_status) { - row->switch_fault_status = xmalloc(datum->n * sizeof *row->switch_fault_status); - } - row->switch_fault_status[row->n_switch_fault_status] = datum->keys[i].string; - row->n_switch_fault_status++; - } -} - -static void -vteprec_physical_switch_parse_tunnel_ips(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - size_t i; - - ovs_assert(inited); - row->tunnel_ips = NULL; - row->n_tunnel_ips = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_tunnel_ips) { - row->tunnel_ips = xmalloc(datum->n * sizeof *row->tunnel_ips); - } - row->tunnel_ips[row->n_tunnel_ips] = datum->keys[i].string; - row->n_tunnel_ips++; - } -} - -static void -vteprec_physical_switch_parse_tunnels(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - size_t i; - - ovs_assert(inited); - row->tunnels = NULL; - row->n_tunnels = 0; - for (i = 0; i < datum->n; i++) { - struct vteprec_tunnel *keyRow = vteprec_tunnel_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_TUNNEL], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_tunnels) { - row->tunnels = xmalloc(datum->n * sizeof *row->tunnels); - } - row->tunnels[row->n_tunnels] = keyRow; - row->n_tunnels++; - } - } -} - -static void -vteprec_physical_switch_unparse_description(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_physical_switch_unparse_management_ips(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - - ovs_assert(inited); - free(row->management_ips); -} - -static void -vteprec_physical_switch_unparse_name(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_physical_switch_unparse_ports(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - - ovs_assert(inited); - free(row->ports); -} - -static void -vteprec_physical_switch_unparse_switch_fault_status(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - - ovs_assert(inited); - free(row->switch_fault_status); -} - -static void -vteprec_physical_switch_unparse_tunnel_ips(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - - ovs_assert(inited); - free(row->tunnel_ips); -} - -static void -vteprec_physical_switch_unparse_tunnels(struct ovsdb_idl_row *row_) -{ - struct vteprec_physical_switch *row = vteprec_physical_switch_cast(row_); - - ovs_assert(inited); - free(row->tunnels); -} - -static void -vteprec_physical_switch_init__(struct ovsdb_idl_row *row) -{ - vteprec_physical_switch_init(vteprec_physical_switch_cast(row)); -} - -void -vteprec_physical_switch_init(struct vteprec_physical_switch *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_physical_switch * -vteprec_physical_switch_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_physical_switch_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_SWITCH], uuid)); -} - -const struct vteprec_physical_switch * -vteprec_physical_switch_first(const struct ovsdb_idl *idl) -{ - return vteprec_physical_switch_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_SWITCH])); -} - -const struct vteprec_physical_switch * -vteprec_physical_switch_next(const struct vteprec_physical_switch *row) -{ - return vteprec_physical_switch_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_physical_switch_delete(const struct vteprec_physical_switch *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_physical_switch * -vteprec_physical_switch_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_physical_switch_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_SWITCH], NULL)); -} - - -void -vteprec_physical_switch_verify_description(const struct vteprec_physical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_DESCRIPTION]); -} - -void -vteprec_physical_switch_verify_management_ips(const struct vteprec_physical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_MANAGEMENT_IPS]); -} - -void -vteprec_physical_switch_verify_name(const struct vteprec_physical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_NAME]); -} - -void -vteprec_physical_switch_verify_ports(const struct vteprec_physical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_PORTS]); -} - -void -vteprec_physical_switch_verify_switch_fault_status(const struct vteprec_physical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS]); -} - -void -vteprec_physical_switch_verify_tunnel_ips(const struct vteprec_physical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNEL_IPS]); -} - -void -vteprec_physical_switch_verify_tunnels(const struct vteprec_physical_switch *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS]); -} - -/* Returns the description column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes description's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_switch_get_description(const struct vteprec_physical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_description); -} - -/* Returns the management_ips column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes management_ips's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_switch_get_management_ips(const struct vteprec_physical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_management_ips); -} - -/* Returns the name column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes name's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_switch_get_name(const struct vteprec_physical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_name); -} - -/* Returns the ports column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes ports's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_switch_get_ports(const struct vteprec_physical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_ports); -} - -/* Returns the switch_fault_status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes switch_fault_status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_switch_get_switch_fault_status(const struct vteprec_physical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_switch_fault_status); -} - -/* Returns the tunnel_ips column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes tunnel_ips's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_switch_get_tunnel_ips(const struct vteprec_physical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_tunnel_ips); -} - -/* Returns the tunnels column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes tunnels's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_physical_switch_get_tunnels(const struct vteprec_physical_switch *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_tunnels); -} - -void -vteprec_physical_switch_set_description(const struct vteprec_physical_switch *row, const char *description) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, description); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_DESCRIPTION], &datum); -} - -void -vteprec_physical_switch_set_management_ips(const struct vteprec_physical_switch *row, char **management_ips, size_t n_management_ips) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_management_ips; - datum.keys = n_management_ips ? xmalloc(n_management_ips * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_management_ips; i++) { - datum.keys[i].string = xstrdup(management_ips[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_MANAGEMENT_IPS], &datum); -} - -void -vteprec_physical_switch_set_name(const struct vteprec_physical_switch *row, const char *name) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, name); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_NAME], &datum); -} - -void -vteprec_physical_switch_set_ports(const struct vteprec_physical_switch *row, struct vteprec_physical_port **ports, size_t n_ports) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_ports; - datum.keys = n_ports ? xmalloc(n_ports * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_ports; i++) { - datum.keys[i].uuid = ports[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_PORTS], &datum); -} - -void -vteprec_physical_switch_set_switch_fault_status(const struct vteprec_physical_switch *row, char **switch_fault_status, size_t n_switch_fault_status) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_switch_fault_status; - datum.keys = n_switch_fault_status ? xmalloc(n_switch_fault_status * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_switch_fault_status; i++) { - datum.keys[i].string = xstrdup(switch_fault_status[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS], &datum); -} - -void -vteprec_physical_switch_set_tunnel_ips(const struct vteprec_physical_switch *row, char **tunnel_ips, size_t n_tunnel_ips) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_tunnel_ips; - datum.keys = n_tunnel_ips ? xmalloc(n_tunnel_ips * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_tunnel_ips; i++) { - datum.keys[i].string = xstrdup(tunnel_ips[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNEL_IPS], &datum); -} - -void -vteprec_physical_switch_set_tunnels(const struct vteprec_physical_switch *row, struct vteprec_tunnel **tunnels, size_t n_tunnels) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_tunnels; - datum.keys = n_tunnels ? xmalloc(n_tunnels * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_tunnels; i++) { - datum.keys[i].uuid = tunnels[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS], &datum); -} - -struct ovsdb_idl_column vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_N_COLUMNS]; - -static void -vteprec_physical_switch_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_physical_switch_col_description. */ - c = &vteprec_physical_switch_col_description; - c->name = "description"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_physical_switch_parse_description; - c->unparse = vteprec_physical_switch_unparse_description; - - /* Initialize vteprec_physical_switch_col_management_ips. */ - c = &vteprec_physical_switch_col_management_ips; - c->name = "management_ips"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_switch_parse_management_ips; - c->unparse = vteprec_physical_switch_unparse_management_ips; - - /* Initialize vteprec_physical_switch_col_name. */ - c = &vteprec_physical_switch_col_name; - c->name = "name"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_physical_switch_parse_name; - c->unparse = vteprec_physical_switch_unparse_name; - - /* Initialize vteprec_physical_switch_col_ports. */ - c = &vteprec_physical_switch_col_ports; - c->name = "ports"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Port"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_switch_parse_ports; - c->unparse = vteprec_physical_switch_unparse_ports; - - /* Initialize vteprec_physical_switch_col_switch_fault_status. */ - c = &vteprec_physical_switch_col_switch_fault_status; - c->name = "switch_fault_status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_switch_parse_switch_fault_status; - c->unparse = vteprec_physical_switch_unparse_switch_fault_status; - - /* Initialize vteprec_physical_switch_col_tunnel_ips. */ - c = &vteprec_physical_switch_col_tunnel_ips; - c->name = "tunnel_ips"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_switch_parse_tunnel_ips; - c->unparse = vteprec_physical_switch_unparse_tunnel_ips; - - /* Initialize vteprec_physical_switch_col_tunnels. */ - c = &vteprec_physical_switch_col_tunnels; - c->name = "tunnels"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Tunnel"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_physical_switch_parse_tunnels; - c->unparse = vteprec_physical_switch_unparse_tunnels; -} - -/* Tunnel table. */ - -static void -vteprec_tunnel_parse_bfd_config_local(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->bfd_config_local); - for (i = 0; i < datum->n; i++) { - smap_add(&row->bfd_config_local, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -vteprec_tunnel_parse_bfd_config_remote(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->bfd_config_remote); - for (i = 0; i < datum->n; i++) { - smap_add(&row->bfd_config_remote, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -vteprec_tunnel_parse_bfd_params(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->bfd_params); - for (i = 0; i < datum->n; i++) { - smap_add(&row->bfd_params, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -vteprec_tunnel_parse_bfd_status(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - size_t i; - - ovs_assert(inited); - smap_init(&row->bfd_status); - for (i = 0; i < datum->n; i++) { - smap_add(&row->bfd_status, - datum->keys[i].string, - datum->values[i].string); - } -} - -static void -vteprec_tunnel_parse_local(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->local = vteprec_physical_locator_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], &datum->keys[0].uuid)); - } else { - row->local = NULL; - } -} - -static void -vteprec_tunnel_parse_remote(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->remote = vteprec_physical_locator_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], &datum->keys[0].uuid)); - } else { - row->remote = NULL; - } -} - -static void -vteprec_tunnel_unparse_bfd_config_local(struct ovsdb_idl_row *row_) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->bfd_config_local); -} - -static void -vteprec_tunnel_unparse_bfd_config_remote(struct ovsdb_idl_row *row_) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->bfd_config_remote); -} - -static void -vteprec_tunnel_unparse_bfd_params(struct ovsdb_idl_row *row_) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->bfd_params); -} - -static void -vteprec_tunnel_unparse_bfd_status(struct ovsdb_idl_row *row_) -{ - struct vteprec_tunnel *row = vteprec_tunnel_cast(row_); - - ovs_assert(inited); - smap_destroy(&row->bfd_status); -} - -static void -vteprec_tunnel_unparse_local(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_tunnel_unparse_remote(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_tunnel_init__(struct ovsdb_idl_row *row) -{ - vteprec_tunnel_init(vteprec_tunnel_cast(row)); -} - -void -vteprec_tunnel_init(struct vteprec_tunnel *row) -{ - memset(row, 0, sizeof *row); - smap_init(&row->bfd_config_local); - smap_init(&row->bfd_config_remote); - smap_init(&row->bfd_params); - smap_init(&row->bfd_status); -} - -const struct vteprec_tunnel * -vteprec_tunnel_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_tunnel_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_TUNNEL], uuid)); -} - -const struct vteprec_tunnel * -vteprec_tunnel_first(const struct ovsdb_idl *idl) -{ - return vteprec_tunnel_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_TUNNEL])); -} - -const struct vteprec_tunnel * -vteprec_tunnel_next(const struct vteprec_tunnel *row) -{ - return vteprec_tunnel_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_tunnel_delete(const struct vteprec_tunnel *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_tunnel * -vteprec_tunnel_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_tunnel_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_TUNNEL], NULL)); -} - - -void -vteprec_tunnel_verify_bfd_config_local(const struct vteprec_tunnel *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_CONFIG_LOCAL]); -} - -void -vteprec_tunnel_verify_bfd_config_remote(const struct vteprec_tunnel *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_CONFIG_REMOTE]); -} - -void -vteprec_tunnel_verify_bfd_params(const struct vteprec_tunnel *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_PARAMS]); -} - -void -vteprec_tunnel_verify_bfd_status(const struct vteprec_tunnel *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_STATUS]); -} - -void -vteprec_tunnel_verify_local(const struct vteprec_tunnel *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_LOCAL]); -} - -void -vteprec_tunnel_verify_remote(const struct vteprec_tunnel *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_REMOTE]); -} - -/* Returns the bfd_config_local column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bfd_config_local's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_tunnel_get_bfd_config_local(const struct vteprec_tunnel *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_tunnel_col_bfd_config_local); -} - -/* Returns the bfd_config_remote column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bfd_config_remote's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_tunnel_get_bfd_config_remote(const struct vteprec_tunnel *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_tunnel_col_bfd_config_remote); -} - -/* Returns the bfd_params column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bfd_params's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_tunnel_get_bfd_params(const struct vteprec_tunnel *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_tunnel_col_bfd_params); -} - -/* Returns the bfd_status column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * 'value_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes bfd_status's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_tunnel_get_bfd_status(const struct vteprec_tunnel *row, - enum ovsdb_atomic_type key_type OVS_UNUSED, - enum ovsdb_atomic_type value_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - ovs_assert(value_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_tunnel_col_bfd_status); -} - -/* Returns the local column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes local's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_tunnel_get_local(const struct vteprec_tunnel *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_tunnel_col_local); -} - -/* Returns the remote column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes remote's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_tunnel_get_remote(const struct vteprec_tunnel *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_tunnel_col_remote); -} - -void -vteprec_tunnel_set_bfd_config_local(const struct vteprec_tunnel *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_CONFIG_LOCAL], - &datum); -} - - -void -vteprec_tunnel_set_bfd_config_remote(const struct vteprec_tunnel *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_CONFIG_REMOTE], - &datum); -} - - -void -vteprec_tunnel_set_bfd_params(const struct vteprec_tunnel *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_PARAMS], - &datum); -} - - -void -vteprec_tunnel_set_bfd_status(const struct vteprec_tunnel *row, const struct smap *smap) -{ - struct ovsdb_datum datum; - - ovs_assert(inited); - if (smap) { - struct smap_node *node; - size_t i; - - datum.n = smap_count(smap); - datum.keys = xmalloc(datum.n * sizeof *datum.keys); - datum.values = xmalloc(datum.n * sizeof *datum.values); - - i = 0; - SMAP_FOR_EACH (node, smap) { - datum.keys[i].string = xstrdup(node->key); - datum.values[i].string = xstrdup(node->value); - i++; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); - } else { - ovsdb_datum_init_empty(&datum); - } - ovsdb_idl_txn_write(&row->header_, - &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_STATUS], - &datum); -} - - -void -vteprec_tunnel_set_local(const struct vteprec_tunnel *row, const struct vteprec_physical_locator *local) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = local->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_LOCAL], &datum); -} - -void -vteprec_tunnel_set_remote(const struct vteprec_tunnel *row, const struct vteprec_physical_locator *remote) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = remote->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_REMOTE], &datum); -} - -struct ovsdb_idl_column vteprec_tunnel_columns[VTEPREC_TUNNEL_N_COLUMNS]; - -static void -vteprec_tunnel_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_tunnel_col_bfd_config_local. */ - c = &vteprec_tunnel_col_bfd_config_local; - c->name = "bfd_config_local"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_tunnel_parse_bfd_config_local; - c->unparse = vteprec_tunnel_unparse_bfd_config_local; - - /* Initialize vteprec_tunnel_col_bfd_config_remote. */ - c = &vteprec_tunnel_col_bfd_config_remote; - c->name = "bfd_config_remote"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_tunnel_parse_bfd_config_remote; - c->unparse = vteprec_tunnel_unparse_bfd_config_remote; - - /* Initialize vteprec_tunnel_col_bfd_params. */ - c = &vteprec_tunnel_col_bfd_params; - c->name = "bfd_params"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_tunnel_parse_bfd_params; - c->unparse = vteprec_tunnel_unparse_bfd_params; - - /* Initialize vteprec_tunnel_col_bfd_status. */ - c = &vteprec_tunnel_col_bfd_status; - c->name = "bfd_status"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_STRING); - c->type.value.u.string.minLen = 0; - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = vteprec_tunnel_parse_bfd_status; - c->unparse = vteprec_tunnel_unparse_bfd_status; - - /* Initialize vteprec_tunnel_col_local. */ - c = &vteprec_tunnel_col_local; - c->name = "local"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_tunnel_parse_local; - c->unparse = vteprec_tunnel_unparse_local; - - /* Initialize vteprec_tunnel_col_remote. */ - c = &vteprec_tunnel_col_remote; - c->name = "remote"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_tunnel_parse_remote; - c->unparse = vteprec_tunnel_unparse_remote; -} - -/* Ucast_Macs_Local table. */ - -static void -vteprec_ucast_macs_local_parse_MAC(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_local *row = vteprec_ucast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->MAC = datum->keys[0].string; - } else { - row->MAC = ""; - } -} - -static void -vteprec_ucast_macs_local_parse_ipaddr(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_local *row = vteprec_ucast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ipaddr = datum->keys[0].string; - } else { - row->ipaddr = ""; - } -} - -static void -vteprec_ucast_macs_local_parse_locator(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_local *row = vteprec_ucast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->locator = vteprec_physical_locator_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], &datum->keys[0].uuid)); - } else { - row->locator = NULL; - } -} - -static void -vteprec_ucast_macs_local_parse_logical_switch(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_local *row = vteprec_ucast_macs_local_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->logical_switch = vteprec_logical_switch_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], &datum->keys[0].uuid)); - } else { - row->logical_switch = NULL; - } -} - -static void -vteprec_ucast_macs_local_unparse_MAC(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_local_unparse_ipaddr(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_local_unparse_locator(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_local_unparse_logical_switch(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_local_init__(struct ovsdb_idl_row *row) -{ - vteprec_ucast_macs_local_init(vteprec_ucast_macs_local_cast(row)); -} - -void -vteprec_ucast_macs_local_init(struct vteprec_ucast_macs_local *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_ucast_macs_local * -vteprec_ucast_macs_local_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_ucast_macs_local_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_LOCAL], uuid)); -} - -const struct vteprec_ucast_macs_local * -vteprec_ucast_macs_local_first(const struct ovsdb_idl *idl) -{ - return vteprec_ucast_macs_local_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_LOCAL])); -} - -const struct vteprec_ucast_macs_local * -vteprec_ucast_macs_local_next(const struct vteprec_ucast_macs_local *row) -{ - return vteprec_ucast_macs_local_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_ucast_macs_local_delete(const struct vteprec_ucast_macs_local *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_ucast_macs_local * -vteprec_ucast_macs_local_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_ucast_macs_local_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_LOCAL], NULL)); -} - - -void -vteprec_ucast_macs_local_verify_MAC(const struct vteprec_ucast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_MAC]); -} - -void -vteprec_ucast_macs_local_verify_ipaddr(const struct vteprec_ucast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_IPADDR]); -} - -void -vteprec_ucast_macs_local_verify_locator(const struct vteprec_ucast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_LOCATOR]); -} - -void -vteprec_ucast_macs_local_verify_logical_switch(const struct vteprec_ucast_macs_local *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_LOGICAL_SWITCH]); -} - -/* Returns the MAC column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes MAC's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_local_get_MAC(const struct vteprec_ucast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_local_col_MAC); -} - -/* Returns the ipaddr column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes ipaddr's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_local_get_ipaddr(const struct vteprec_ucast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_local_col_ipaddr); -} - -/* Returns the locator column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes locator's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_local_get_locator(const struct vteprec_ucast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_local_col_locator); -} - -/* Returns the logical_switch column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes logical_switch's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_local_get_logical_switch(const struct vteprec_ucast_macs_local *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_local_col_logical_switch); -} - -void -vteprec_ucast_macs_local_set_MAC(const struct vteprec_ucast_macs_local *row, const char *MAC) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, MAC); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_MAC], &datum); -} - -void -vteprec_ucast_macs_local_set_ipaddr(const struct vteprec_ucast_macs_local *row, const char *ipaddr) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, ipaddr); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_IPADDR], &datum); -} - -void -vteprec_ucast_macs_local_set_locator(const struct vteprec_ucast_macs_local *row, const struct vteprec_physical_locator *locator) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = locator->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_LOCATOR], &datum); -} - -void -vteprec_ucast_macs_local_set_logical_switch(const struct vteprec_ucast_macs_local *row, const struct vteprec_logical_switch *logical_switch) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = logical_switch->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_LOGICAL_SWITCH], &datum); -} - -struct ovsdb_idl_column vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_N_COLUMNS]; - -static void -vteprec_ucast_macs_local_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_ucast_macs_local_col_MAC. */ - c = &vteprec_ucast_macs_local_col_MAC; - c->name = "MAC"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_local_parse_MAC; - c->unparse = vteprec_ucast_macs_local_unparse_MAC; - - /* Initialize vteprec_ucast_macs_local_col_ipaddr. */ - c = &vteprec_ucast_macs_local_col_ipaddr; - c->name = "ipaddr"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_local_parse_ipaddr; - c->unparse = vteprec_ucast_macs_local_unparse_ipaddr; - - /* Initialize vteprec_ucast_macs_local_col_locator. */ - c = &vteprec_ucast_macs_local_col_locator; - c->name = "locator"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_local_parse_locator; - c->unparse = vteprec_ucast_macs_local_unparse_locator; - - /* Initialize vteprec_ucast_macs_local_col_logical_switch. */ - c = &vteprec_ucast_macs_local_col_logical_switch; - c->name = "logical_switch"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Logical_Switch"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_local_parse_logical_switch; - c->unparse = vteprec_ucast_macs_local_unparse_logical_switch; -} - -/* Ucast_Macs_Remote table. */ - -static void -vteprec_ucast_macs_remote_parse_MAC(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_remote *row = vteprec_ucast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->MAC = datum->keys[0].string; - } else { - row->MAC = ""; - } -} - -static void -vteprec_ucast_macs_remote_parse_ipaddr(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_remote *row = vteprec_ucast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->ipaddr = datum->keys[0].string; - } else { - row->ipaddr = ""; - } -} - -static void -vteprec_ucast_macs_remote_parse_locator(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_remote *row = vteprec_ucast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->locator = vteprec_physical_locator_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR], &datum->keys[0].uuid)); - } else { - row->locator = NULL; - } -} - -static void -vteprec_ucast_macs_remote_parse_logical_switch(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct vteprec_ucast_macs_remote *row = vteprec_ucast_macs_remote_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->logical_switch = vteprec_logical_switch_cast(ovsdb_idl_get_row_arc(row_, &vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH], &datum->keys[0].uuid)); - } else { - row->logical_switch = NULL; - } -} - -static void -vteprec_ucast_macs_remote_unparse_MAC(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_remote_unparse_ipaddr(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_remote_unparse_locator(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_remote_unparse_logical_switch(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -vteprec_ucast_macs_remote_init__(struct ovsdb_idl_row *row) -{ - vteprec_ucast_macs_remote_init(vteprec_ucast_macs_remote_cast(row)); -} - -void -vteprec_ucast_macs_remote_init(struct vteprec_ucast_macs_remote *row) -{ - memset(row, 0, sizeof *row); -} - -const struct vteprec_ucast_macs_remote * -vteprec_ucast_macs_remote_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return vteprec_ucast_macs_remote_cast(ovsdb_idl_get_row_for_uuid(idl, &vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_REMOTE], uuid)); -} - -const struct vteprec_ucast_macs_remote * -vteprec_ucast_macs_remote_first(const struct ovsdb_idl *idl) -{ - return vteprec_ucast_macs_remote_cast(ovsdb_idl_first_row(idl, &vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_REMOTE])); -} - -const struct vteprec_ucast_macs_remote * -vteprec_ucast_macs_remote_next(const struct vteprec_ucast_macs_remote *row) -{ - return vteprec_ucast_macs_remote_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -vteprec_ucast_macs_remote_delete(const struct vteprec_ucast_macs_remote *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct vteprec_ucast_macs_remote * -vteprec_ucast_macs_remote_insert(struct ovsdb_idl_txn *txn) -{ - return vteprec_ucast_macs_remote_cast(ovsdb_idl_txn_insert(txn, &vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_REMOTE], NULL)); -} - - -void -vteprec_ucast_macs_remote_verify_MAC(const struct vteprec_ucast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_MAC]); -} - -void -vteprec_ucast_macs_remote_verify_ipaddr(const struct vteprec_ucast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_IPADDR]); -} - -void -vteprec_ucast_macs_remote_verify_locator(const struct vteprec_ucast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_LOCATOR]); -} - -void -vteprec_ucast_macs_remote_verify_logical_switch(const struct vteprec_ucast_macs_remote *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_LOGICAL_SWITCH]); -} - -/* Returns the MAC column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes MAC's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_remote_get_MAC(const struct vteprec_ucast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_remote_col_MAC); -} - -/* Returns the ipaddr column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes ipaddr's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_remote_get_ipaddr(const struct vteprec_ucast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_remote_col_ipaddr); -} - -/* Returns the locator column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes locator's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_remote_get_locator(const struct vteprec_ucast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_remote_col_locator); -} - -/* Returns the logical_switch column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes logical_switch's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -vteprec_ucast_macs_remote_get_logical_switch(const struct vteprec_ucast_macs_remote *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &vteprec_ucast_macs_remote_col_logical_switch); -} - -void -vteprec_ucast_macs_remote_set_MAC(const struct vteprec_ucast_macs_remote *row, const char *MAC) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, MAC); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_MAC], &datum); -} - -void -vteprec_ucast_macs_remote_set_ipaddr(const struct vteprec_ucast_macs_remote *row, const char *ipaddr) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, ipaddr); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_IPADDR], &datum); -} - -void -vteprec_ucast_macs_remote_set_locator(const struct vteprec_ucast_macs_remote *row, const struct vteprec_physical_locator *locator) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = locator->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_LOCATOR], &datum); -} - -void -vteprec_ucast_macs_remote_set_logical_switch(const struct vteprec_ucast_macs_remote *row, const struct vteprec_logical_switch *logical_switch) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = logical_switch->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_LOGICAL_SWITCH], &datum); -} - -struct ovsdb_idl_column vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_N_COLUMNS]; - -static void -vteprec_ucast_macs_remote_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize vteprec_ucast_macs_remote_col_MAC. */ - c = &vteprec_ucast_macs_remote_col_MAC; - c->name = "MAC"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_remote_parse_MAC; - c->unparse = vteprec_ucast_macs_remote_unparse_MAC; - - /* Initialize vteprec_ucast_macs_remote_col_ipaddr. */ - c = &vteprec_ucast_macs_remote_col_ipaddr; - c->name = "ipaddr"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_remote_parse_ipaddr; - c->unparse = vteprec_ucast_macs_remote_unparse_ipaddr; - - /* Initialize vteprec_ucast_macs_remote_col_locator. */ - c = &vteprec_ucast_macs_remote_col_locator; - c->name = "locator"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Physical_Locator"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_remote_parse_locator; - c->unparse = vteprec_ucast_macs_remote_unparse_locator; - - /* Initialize vteprec_ucast_macs_remote_col_logical_switch. */ - c = &vteprec_ucast_macs_remote_col_logical_switch; - c->name = "logical_switch"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "Logical_Switch"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = vteprec_ucast_macs_remote_parse_logical_switch; - c->unparse = vteprec_ucast_macs_remote_unparse_logical_switch; -} - -struct ovsdb_idl_table_class vteprec_table_classes[VTEPREC_N_TABLES] = { - {"Arp_Sources_Local", true, - vteprec_arp_sources_local_columns, ARRAY_SIZE(vteprec_arp_sources_local_columns), - sizeof(struct vteprec_arp_sources_local), vteprec_arp_sources_local_init__}, - {"Arp_Sources_Remote", true, - vteprec_arp_sources_remote_columns, ARRAY_SIZE(vteprec_arp_sources_remote_columns), - sizeof(struct vteprec_arp_sources_remote), vteprec_arp_sources_remote_init__}, - {"Global", true, - vteprec_global_columns, ARRAY_SIZE(vteprec_global_columns), - sizeof(struct vteprec_global), vteprec_global_init__}, - {"Logical_Binding_Stats", false, - vteprec_logical_binding_stats_columns, ARRAY_SIZE(vteprec_logical_binding_stats_columns), - sizeof(struct vteprec_logical_binding_stats), vteprec_logical_binding_stats_init__}, - {"Logical_Router", true, - vteprec_logical_router_columns, ARRAY_SIZE(vteprec_logical_router_columns), - sizeof(struct vteprec_logical_router), vteprec_logical_router_init__}, - {"Logical_Switch", true, - vteprec_logical_switch_columns, ARRAY_SIZE(vteprec_logical_switch_columns), - sizeof(struct vteprec_logical_switch), vteprec_logical_switch_init__}, - {"Manager", false, - vteprec_manager_columns, ARRAY_SIZE(vteprec_manager_columns), - sizeof(struct vteprec_manager), vteprec_manager_init__}, - {"Mcast_Macs_Local", true, - vteprec_mcast_macs_local_columns, ARRAY_SIZE(vteprec_mcast_macs_local_columns), - sizeof(struct vteprec_mcast_macs_local), vteprec_mcast_macs_local_init__}, - {"Mcast_Macs_Remote", true, - vteprec_mcast_macs_remote_columns, ARRAY_SIZE(vteprec_mcast_macs_remote_columns), - sizeof(struct vteprec_mcast_macs_remote), vteprec_mcast_macs_remote_init__}, - {"Physical_Locator", false, - vteprec_physical_locator_columns, ARRAY_SIZE(vteprec_physical_locator_columns), - sizeof(struct vteprec_physical_locator), vteprec_physical_locator_init__}, - {"Physical_Locator_Set", false, - vteprec_physical_locator_set_columns, ARRAY_SIZE(vteprec_physical_locator_set_columns), - sizeof(struct vteprec_physical_locator_set), vteprec_physical_locator_set_init__}, - {"Physical_Port", false, - vteprec_physical_port_columns, ARRAY_SIZE(vteprec_physical_port_columns), - sizeof(struct vteprec_physical_port), vteprec_physical_port_init__}, - {"Physical_Switch", false, - vteprec_physical_switch_columns, ARRAY_SIZE(vteprec_physical_switch_columns), - sizeof(struct vteprec_physical_switch), vteprec_physical_switch_init__}, - {"Tunnel", false, - vteprec_tunnel_columns, ARRAY_SIZE(vteprec_tunnel_columns), - sizeof(struct vteprec_tunnel), vteprec_tunnel_init__}, - {"Ucast_Macs_Local", true, - vteprec_ucast_macs_local_columns, ARRAY_SIZE(vteprec_ucast_macs_local_columns), - sizeof(struct vteprec_ucast_macs_local), vteprec_ucast_macs_local_init__}, - {"Ucast_Macs_Remote", true, - vteprec_ucast_macs_remote_columns, ARRAY_SIZE(vteprec_ucast_macs_remote_columns), - sizeof(struct vteprec_ucast_macs_remote), vteprec_ucast_macs_remote_init__}, -}; - -struct ovsdb_idl_class vteprec_idl_class = { - "hardware_vtep", vteprec_table_classes, ARRAY_SIZE(vteprec_table_classes) -}; - -void -vteprec_init(void) -{ - if (inited) { - return; - } - assert_single_threaded(); - inited = true; - - vteprec_arp_sources_local_columns_init(); - vteprec_arp_sources_remote_columns_init(); - vteprec_global_columns_init(); - vteprec_logical_binding_stats_columns_init(); - vteprec_logical_router_columns_init(); - vteprec_logical_switch_columns_init(); - vteprec_manager_columns_init(); - vteprec_mcast_macs_local_columns_init(); - vteprec_mcast_macs_remote_columns_init(); - vteprec_physical_locator_columns_init(); - vteprec_physical_locator_set_columns_init(); - vteprec_physical_port_columns_init(); - vteprec_physical_switch_columns_init(); - vteprec_tunnel_columns_init(); - vteprec_ucast_macs_local_columns_init(); - vteprec_ucast_macs_remote_columns_init(); -} - -/* Return the schema version. The caller must not free the returned value. */ -const char * -vteprec_get_db_version(void) -{ - return "1.3.0"; -} - diff -Nru openvswitch-2.3.1/lib/vtep-idl.h openvswitch-2.4.0~git20150623/lib/vtep-idl.h --- openvswitch-2.3.1/lib/vtep-idl.h 2014-10-12 23:47:59.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vtep-idl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1117 +0,0 @@ -/* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - -#ifndef VTEPREC_IDL_HEADER -#define VTEPREC_IDL_HEADER 1 - -#include -#include -#include -#include "ovsdb-data.h" -#include "ovsdb-idl-provider.h" -#include "smap.h" -#include "uuid.h" - -/* Arp_Sources_Local table. */ -struct vteprec_arp_sources_local { - struct ovsdb_idl_row header_; - - /* locator column. */ - struct vteprec_physical_locator *locator; - - /* src_mac column. */ - char *src_mac; /* Always nonnull. */ -}; - -enum { - VTEPREC_ARP_SOURCES_LOCAL_COL_LOCATOR, - VTEPREC_ARP_SOURCES_LOCAL_COL_SRC_MAC, - VTEPREC_ARP_SOURCES_LOCAL_N_COLUMNS -}; - -#define vteprec_arp_sources_local_col_locator (vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_COL_LOCATOR]) -#define vteprec_arp_sources_local_col_src_mac (vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_COL_SRC_MAC]) - -extern struct ovsdb_idl_column vteprec_arp_sources_local_columns[VTEPREC_ARP_SOURCES_LOCAL_N_COLUMNS]; - -const struct vteprec_arp_sources_local *vteprec_arp_sources_local_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_arp_sources_local *vteprec_arp_sources_local_first(const struct ovsdb_idl *); -const struct vteprec_arp_sources_local *vteprec_arp_sources_local_next(const struct vteprec_arp_sources_local *); -#define VTEPREC_ARP_SOURCES_LOCAL_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_arp_sources_local_first(IDL); \ - (ROW); \ - (ROW) = vteprec_arp_sources_local_next(ROW)) -#define VTEPREC_ARP_SOURCES_LOCAL_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_arp_sources_local_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_arp_sources_local_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_arp_sources_local_init(struct vteprec_arp_sources_local *); -void vteprec_arp_sources_local_delete(const struct vteprec_arp_sources_local *); -struct vteprec_arp_sources_local *vteprec_arp_sources_local_insert(struct ovsdb_idl_txn *); - -void vteprec_arp_sources_local_verify_locator(const struct vteprec_arp_sources_local *); -void vteprec_arp_sources_local_verify_src_mac(const struct vteprec_arp_sources_local *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_arp_sources_local directly.) */ -const struct ovsdb_datum *vteprec_arp_sources_local_get_locator(const struct vteprec_arp_sources_local *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_arp_sources_local_get_src_mac(const struct vteprec_arp_sources_local *, enum ovsdb_atomic_type key_type); - -void vteprec_arp_sources_local_set_locator(const struct vteprec_arp_sources_local *, const struct vteprec_physical_locator *locator); -void vteprec_arp_sources_local_set_src_mac(const struct vteprec_arp_sources_local *, const char *src_mac); - - -/* Arp_Sources_Remote table. */ -struct vteprec_arp_sources_remote { - struct ovsdb_idl_row header_; - - /* locator column. */ - struct vteprec_physical_locator *locator; - - /* src_mac column. */ - char *src_mac; /* Always nonnull. */ -}; - -enum { - VTEPREC_ARP_SOURCES_REMOTE_COL_LOCATOR, - VTEPREC_ARP_SOURCES_REMOTE_COL_SRC_MAC, - VTEPREC_ARP_SOURCES_REMOTE_N_COLUMNS -}; - -#define vteprec_arp_sources_remote_col_locator (vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_COL_LOCATOR]) -#define vteprec_arp_sources_remote_col_src_mac (vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_COL_SRC_MAC]) - -extern struct ovsdb_idl_column vteprec_arp_sources_remote_columns[VTEPREC_ARP_SOURCES_REMOTE_N_COLUMNS]; - -const struct vteprec_arp_sources_remote *vteprec_arp_sources_remote_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_arp_sources_remote *vteprec_arp_sources_remote_first(const struct ovsdb_idl *); -const struct vteprec_arp_sources_remote *vteprec_arp_sources_remote_next(const struct vteprec_arp_sources_remote *); -#define VTEPREC_ARP_SOURCES_REMOTE_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_arp_sources_remote_first(IDL); \ - (ROW); \ - (ROW) = vteprec_arp_sources_remote_next(ROW)) -#define VTEPREC_ARP_SOURCES_REMOTE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_arp_sources_remote_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_arp_sources_remote_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_arp_sources_remote_init(struct vteprec_arp_sources_remote *); -void vteprec_arp_sources_remote_delete(const struct vteprec_arp_sources_remote *); -struct vteprec_arp_sources_remote *vteprec_arp_sources_remote_insert(struct ovsdb_idl_txn *); - -void vteprec_arp_sources_remote_verify_locator(const struct vteprec_arp_sources_remote *); -void vteprec_arp_sources_remote_verify_src_mac(const struct vteprec_arp_sources_remote *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_arp_sources_remote directly.) */ -const struct ovsdb_datum *vteprec_arp_sources_remote_get_locator(const struct vteprec_arp_sources_remote *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_arp_sources_remote_get_src_mac(const struct vteprec_arp_sources_remote *, enum ovsdb_atomic_type key_type); - -void vteprec_arp_sources_remote_set_locator(const struct vteprec_arp_sources_remote *, const struct vteprec_physical_locator *locator); -void vteprec_arp_sources_remote_set_src_mac(const struct vteprec_arp_sources_remote *, const char *src_mac); - - -/* Global table. */ -struct vteprec_global { - struct ovsdb_idl_row header_; - - /* managers column. */ - struct vteprec_manager **managers; - size_t n_managers; - - /* switches column. */ - struct vteprec_physical_switch **switches; - size_t n_switches; -}; - -enum { - VTEPREC_GLOBAL_COL_MANAGERS, - VTEPREC_GLOBAL_COL_SWITCHES, - VTEPREC_GLOBAL_N_COLUMNS -}; - -#define vteprec_global_col_switches (vteprec_global_columns[VTEPREC_GLOBAL_COL_SWITCHES]) -#define vteprec_global_col_managers (vteprec_global_columns[VTEPREC_GLOBAL_COL_MANAGERS]) - -extern struct ovsdb_idl_column vteprec_global_columns[VTEPREC_GLOBAL_N_COLUMNS]; - -const struct vteprec_global *vteprec_global_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_global *vteprec_global_first(const struct ovsdb_idl *); -const struct vteprec_global *vteprec_global_next(const struct vteprec_global *); -#define VTEPREC_GLOBAL_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_global_first(IDL); \ - (ROW); \ - (ROW) = vteprec_global_next(ROW)) -#define VTEPREC_GLOBAL_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_global_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_global_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_global_init(struct vteprec_global *); -void vteprec_global_delete(const struct vteprec_global *); -struct vteprec_global *vteprec_global_insert(struct ovsdb_idl_txn *); - -void vteprec_global_verify_managers(const struct vteprec_global *); -void vteprec_global_verify_switches(const struct vteprec_global *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_global directly.) */ -const struct ovsdb_datum *vteprec_global_get_managers(const struct vteprec_global *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_global_get_switches(const struct vteprec_global *, enum ovsdb_atomic_type key_type); - -void vteprec_global_set_managers(const struct vteprec_global *, struct vteprec_manager **managers, size_t n_managers); -void vteprec_global_set_switches(const struct vteprec_global *, struct vteprec_physical_switch **switches, size_t n_switches); - - -/* Logical_Binding_Stats table. */ -struct vteprec_logical_binding_stats { - struct ovsdb_idl_row header_; - - /* bytes_from_local column. */ - int64_t bytes_from_local; - - /* bytes_to_local column. */ - int64_t bytes_to_local; - - /* packets_from_local column. */ - int64_t packets_from_local; - - /* packets_to_local column. */ - int64_t packets_to_local; -}; - -enum { - VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_FROM_LOCAL, - VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_TO_LOCAL, - VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_FROM_LOCAL, - VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_TO_LOCAL, - VTEPREC_LOGICAL_BINDING_STATS_N_COLUMNS -}; - -#define vteprec_logical_binding_stats_col_bytes_to_local (vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_TO_LOCAL]) -#define vteprec_logical_binding_stats_col_bytes_from_local (vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_BYTES_FROM_LOCAL]) -#define vteprec_logical_binding_stats_col_packets_from_local (vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_FROM_LOCAL]) -#define vteprec_logical_binding_stats_col_packets_to_local (vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_COL_PACKETS_TO_LOCAL]) - -extern struct ovsdb_idl_column vteprec_logical_binding_stats_columns[VTEPREC_LOGICAL_BINDING_STATS_N_COLUMNS]; - -const struct vteprec_logical_binding_stats *vteprec_logical_binding_stats_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_logical_binding_stats *vteprec_logical_binding_stats_first(const struct ovsdb_idl *); -const struct vteprec_logical_binding_stats *vteprec_logical_binding_stats_next(const struct vteprec_logical_binding_stats *); -#define VTEPREC_LOGICAL_BINDING_STATS_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_logical_binding_stats_first(IDL); \ - (ROW); \ - (ROW) = vteprec_logical_binding_stats_next(ROW)) -#define VTEPREC_LOGICAL_BINDING_STATS_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_logical_binding_stats_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_logical_binding_stats_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_logical_binding_stats_init(struct vteprec_logical_binding_stats *); -void vteprec_logical_binding_stats_delete(const struct vteprec_logical_binding_stats *); -struct vteprec_logical_binding_stats *vteprec_logical_binding_stats_insert(struct ovsdb_idl_txn *); - -void vteprec_logical_binding_stats_verify_bytes_from_local(const struct vteprec_logical_binding_stats *); -void vteprec_logical_binding_stats_verify_bytes_to_local(const struct vteprec_logical_binding_stats *); -void vteprec_logical_binding_stats_verify_packets_from_local(const struct vteprec_logical_binding_stats *); -void vteprec_logical_binding_stats_verify_packets_to_local(const struct vteprec_logical_binding_stats *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_logical_binding_stats directly.) */ -const struct ovsdb_datum *vteprec_logical_binding_stats_get_bytes_from_local(const struct vteprec_logical_binding_stats *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_logical_binding_stats_get_bytes_to_local(const struct vteprec_logical_binding_stats *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_logical_binding_stats_get_packets_from_local(const struct vteprec_logical_binding_stats *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_logical_binding_stats_get_packets_to_local(const struct vteprec_logical_binding_stats *, enum ovsdb_atomic_type key_type); - -void vteprec_logical_binding_stats_set_bytes_from_local(const struct vteprec_logical_binding_stats *, int64_t bytes_from_local); -void vteprec_logical_binding_stats_set_bytes_to_local(const struct vteprec_logical_binding_stats *, int64_t bytes_to_local); -void vteprec_logical_binding_stats_set_packets_from_local(const struct vteprec_logical_binding_stats *, int64_t packets_from_local); -void vteprec_logical_binding_stats_set_packets_to_local(const struct vteprec_logical_binding_stats *, int64_t packets_to_local); - - -/* Logical_Router table. */ -struct vteprec_logical_router { - struct ovsdb_idl_row header_; - - /* description column. */ - char *description; /* Always nonnull. */ - - /* name column. */ - char *name; /* Always nonnull. */ - - /* static_routes column. */ - struct smap static_routes; - - /* switch_binding column. */ - char **key_switch_binding; - struct vteprec_logical_switch **value_switch_binding; - size_t n_switch_binding; -}; - -enum { - VTEPREC_LOGICAL_ROUTER_COL_DESCRIPTION, - VTEPREC_LOGICAL_ROUTER_COL_NAME, - VTEPREC_LOGICAL_ROUTER_COL_STATIC_ROUTES, - VTEPREC_LOGICAL_ROUTER_COL_SWITCH_BINDING, - VTEPREC_LOGICAL_ROUTER_N_COLUMNS -}; - -#define vteprec_logical_router_col_switch_binding (vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_SWITCH_BINDING]) -#define vteprec_logical_router_col_description (vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_DESCRIPTION]) -#define vteprec_logical_router_col_static_routes (vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_STATIC_ROUTES]) -#define vteprec_logical_router_col_name (vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_COL_NAME]) - -extern struct ovsdb_idl_column vteprec_logical_router_columns[VTEPREC_LOGICAL_ROUTER_N_COLUMNS]; - -const struct vteprec_logical_router *vteprec_logical_router_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_logical_router *vteprec_logical_router_first(const struct ovsdb_idl *); -const struct vteprec_logical_router *vteprec_logical_router_next(const struct vteprec_logical_router *); -#define VTEPREC_LOGICAL_ROUTER_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_logical_router_first(IDL); \ - (ROW); \ - (ROW) = vteprec_logical_router_next(ROW)) -#define VTEPREC_LOGICAL_ROUTER_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_logical_router_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_logical_router_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_logical_router_init(struct vteprec_logical_router *); -void vteprec_logical_router_delete(const struct vteprec_logical_router *); -struct vteprec_logical_router *vteprec_logical_router_insert(struct ovsdb_idl_txn *); - -void vteprec_logical_router_verify_description(const struct vteprec_logical_router *); -void vteprec_logical_router_verify_name(const struct vteprec_logical_router *); -void vteprec_logical_router_verify_static_routes(const struct vteprec_logical_router *); -void vteprec_logical_router_verify_switch_binding(const struct vteprec_logical_router *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_logical_router directly.) */ -const struct ovsdb_datum *vteprec_logical_router_get_description(const struct vteprec_logical_router *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_logical_router_get_name(const struct vteprec_logical_router *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_logical_router_get_static_routes(const struct vteprec_logical_router *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_logical_router_get_switch_binding(const struct vteprec_logical_router *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); - -void vteprec_logical_router_set_description(const struct vteprec_logical_router *, const char *description); -void vteprec_logical_router_set_name(const struct vteprec_logical_router *, const char *name); -void vteprec_logical_router_set_static_routes(const struct vteprec_logical_router *, const struct smap *); -void vteprec_logical_router_set_switch_binding(const struct vteprec_logical_router *, char **key_switch_binding, struct vteprec_logical_switch **value_switch_binding, size_t n_switch_binding); - - -/* Logical_Switch table. */ -struct vteprec_logical_switch { - struct ovsdb_idl_row header_; - - /* description column. */ - char *description; /* Always nonnull. */ - - /* name column. */ - char *name; /* Always nonnull. */ - - /* tunnel_key column. */ - int64_t *tunnel_key; - size_t n_tunnel_key; -}; - -enum { - VTEPREC_LOGICAL_SWITCH_COL_DESCRIPTION, - VTEPREC_LOGICAL_SWITCH_COL_NAME, - VTEPREC_LOGICAL_SWITCH_COL_TUNNEL_KEY, - VTEPREC_LOGICAL_SWITCH_N_COLUMNS -}; - -#define vteprec_logical_switch_col_tunnel_key (vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_TUNNEL_KEY]) -#define vteprec_logical_switch_col_description (vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_DESCRIPTION]) -#define vteprec_logical_switch_col_name (vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_COL_NAME]) - -extern struct ovsdb_idl_column vteprec_logical_switch_columns[VTEPREC_LOGICAL_SWITCH_N_COLUMNS]; - -const struct vteprec_logical_switch *vteprec_logical_switch_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_logical_switch *vteprec_logical_switch_first(const struct ovsdb_idl *); -const struct vteprec_logical_switch *vteprec_logical_switch_next(const struct vteprec_logical_switch *); -#define VTEPREC_LOGICAL_SWITCH_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_logical_switch_first(IDL); \ - (ROW); \ - (ROW) = vteprec_logical_switch_next(ROW)) -#define VTEPREC_LOGICAL_SWITCH_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_logical_switch_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_logical_switch_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_logical_switch_init(struct vteprec_logical_switch *); -void vteprec_logical_switch_delete(const struct vteprec_logical_switch *); -struct vteprec_logical_switch *vteprec_logical_switch_insert(struct ovsdb_idl_txn *); - -void vteprec_logical_switch_verify_description(const struct vteprec_logical_switch *); -void vteprec_logical_switch_verify_name(const struct vteprec_logical_switch *); -void vteprec_logical_switch_verify_tunnel_key(const struct vteprec_logical_switch *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_logical_switch directly.) */ -const struct ovsdb_datum *vteprec_logical_switch_get_description(const struct vteprec_logical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_logical_switch_get_name(const struct vteprec_logical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_logical_switch_get_tunnel_key(const struct vteprec_logical_switch *, enum ovsdb_atomic_type key_type); - -void vteprec_logical_switch_set_description(const struct vteprec_logical_switch *, const char *description); -void vteprec_logical_switch_set_name(const struct vteprec_logical_switch *, const char *name); -void vteprec_logical_switch_set_tunnel_key(const struct vteprec_logical_switch *, const int64_t *tunnel_key, size_t n_tunnel_key); - - -/* Manager table. */ -struct vteprec_manager { - struct ovsdb_idl_row header_; - - /* inactivity_probe column. */ - int64_t *inactivity_probe; - size_t n_inactivity_probe; - - /* is_connected column. */ - bool is_connected; - - /* max_backoff column. */ - int64_t *max_backoff; - size_t n_max_backoff; - - /* other_config column. */ - struct smap other_config; - - /* status column. */ - struct smap status; - - /* target column. */ - char *target; /* Always nonnull. */ -}; - -enum { - VTEPREC_MANAGER_COL_INACTIVITY_PROBE, - VTEPREC_MANAGER_COL_IS_CONNECTED, - VTEPREC_MANAGER_COL_MAX_BACKOFF, - VTEPREC_MANAGER_COL_OTHER_CONFIG, - VTEPREC_MANAGER_COL_STATUS, - VTEPREC_MANAGER_COL_TARGET, - VTEPREC_MANAGER_N_COLUMNS -}; - -#define vteprec_manager_col_max_backoff (vteprec_manager_columns[VTEPREC_MANAGER_COL_MAX_BACKOFF]) -#define vteprec_manager_col_status (vteprec_manager_columns[VTEPREC_MANAGER_COL_STATUS]) -#define vteprec_manager_col_target (vteprec_manager_columns[VTEPREC_MANAGER_COL_TARGET]) -#define vteprec_manager_col_other_config (vteprec_manager_columns[VTEPREC_MANAGER_COL_OTHER_CONFIG]) -#define vteprec_manager_col_inactivity_probe (vteprec_manager_columns[VTEPREC_MANAGER_COL_INACTIVITY_PROBE]) -#define vteprec_manager_col_is_connected (vteprec_manager_columns[VTEPREC_MANAGER_COL_IS_CONNECTED]) - -extern struct ovsdb_idl_column vteprec_manager_columns[VTEPREC_MANAGER_N_COLUMNS]; - -const struct vteprec_manager *vteprec_manager_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_manager *vteprec_manager_first(const struct ovsdb_idl *); -const struct vteprec_manager *vteprec_manager_next(const struct vteprec_manager *); -#define VTEPREC_MANAGER_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_manager_first(IDL); \ - (ROW); \ - (ROW) = vteprec_manager_next(ROW)) -#define VTEPREC_MANAGER_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_manager_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_manager_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_manager_init(struct vteprec_manager *); -void vteprec_manager_delete(const struct vteprec_manager *); -struct vteprec_manager *vteprec_manager_insert(struct ovsdb_idl_txn *); - -void vteprec_manager_verify_inactivity_probe(const struct vteprec_manager *); -void vteprec_manager_verify_is_connected(const struct vteprec_manager *); -void vteprec_manager_verify_max_backoff(const struct vteprec_manager *); -void vteprec_manager_verify_other_config(const struct vteprec_manager *); -void vteprec_manager_verify_status(const struct vteprec_manager *); -void vteprec_manager_verify_target(const struct vteprec_manager *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_manager directly.) */ -const struct ovsdb_datum *vteprec_manager_get_inactivity_probe(const struct vteprec_manager *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_manager_get_is_connected(const struct vteprec_manager *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_manager_get_max_backoff(const struct vteprec_manager *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_manager_get_other_config(const struct vteprec_manager *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_manager_get_status(const struct vteprec_manager *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_manager_get_target(const struct vteprec_manager *, enum ovsdb_atomic_type key_type); - -void vteprec_manager_set_inactivity_probe(const struct vteprec_manager *, const int64_t *inactivity_probe, size_t n_inactivity_probe); -void vteprec_manager_set_is_connected(const struct vteprec_manager *, bool is_connected); -void vteprec_manager_set_max_backoff(const struct vteprec_manager *, const int64_t *max_backoff, size_t n_max_backoff); -void vteprec_manager_set_other_config(const struct vteprec_manager *, const struct smap *); -void vteprec_manager_set_status(const struct vteprec_manager *, const struct smap *); -void vteprec_manager_set_target(const struct vteprec_manager *, const char *target); - - -/* Mcast_Macs_Local table. */ -struct vteprec_mcast_macs_local { - struct ovsdb_idl_row header_; - - /* MAC column. */ - char *MAC; /* Always nonnull. */ - - /* ipaddr column. */ - char *ipaddr; /* Always nonnull. */ - - /* locator_set column. */ - struct vteprec_physical_locator_set *locator_set; - - /* logical_switch column. */ - struct vteprec_logical_switch *logical_switch; -}; - -enum { - VTEPREC_MCAST_MACS_LOCAL_COL_MAC, - VTEPREC_MCAST_MACS_LOCAL_COL_IPADDR, - VTEPREC_MCAST_MACS_LOCAL_COL_LOCATOR_SET, - VTEPREC_MCAST_MACS_LOCAL_COL_LOGICAL_SWITCH, - VTEPREC_MCAST_MACS_LOCAL_N_COLUMNS -}; - -#define vteprec_mcast_macs_local_col_ipaddr (vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_IPADDR]) -#define vteprec_mcast_macs_local_col_MAC (vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_MAC]) -#define vteprec_mcast_macs_local_col_locator_set (vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_LOCATOR_SET]) -#define vteprec_mcast_macs_local_col_logical_switch (vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_COL_LOGICAL_SWITCH]) - -extern struct ovsdb_idl_column vteprec_mcast_macs_local_columns[VTEPREC_MCAST_MACS_LOCAL_N_COLUMNS]; - -const struct vteprec_mcast_macs_local *vteprec_mcast_macs_local_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_mcast_macs_local *vteprec_mcast_macs_local_first(const struct ovsdb_idl *); -const struct vteprec_mcast_macs_local *vteprec_mcast_macs_local_next(const struct vteprec_mcast_macs_local *); -#define VTEPREC_MCAST_MACS_LOCAL_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_mcast_macs_local_first(IDL); \ - (ROW); \ - (ROW) = vteprec_mcast_macs_local_next(ROW)) -#define VTEPREC_MCAST_MACS_LOCAL_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_mcast_macs_local_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_mcast_macs_local_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_mcast_macs_local_init(struct vteprec_mcast_macs_local *); -void vteprec_mcast_macs_local_delete(const struct vteprec_mcast_macs_local *); -struct vteprec_mcast_macs_local *vteprec_mcast_macs_local_insert(struct ovsdb_idl_txn *); - -void vteprec_mcast_macs_local_verify_MAC(const struct vteprec_mcast_macs_local *); -void vteprec_mcast_macs_local_verify_ipaddr(const struct vteprec_mcast_macs_local *); -void vteprec_mcast_macs_local_verify_locator_set(const struct vteprec_mcast_macs_local *); -void vteprec_mcast_macs_local_verify_logical_switch(const struct vteprec_mcast_macs_local *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_mcast_macs_local directly.) */ -const struct ovsdb_datum *vteprec_mcast_macs_local_get_MAC(const struct vteprec_mcast_macs_local *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_mcast_macs_local_get_ipaddr(const struct vteprec_mcast_macs_local *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_mcast_macs_local_get_locator_set(const struct vteprec_mcast_macs_local *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_mcast_macs_local_get_logical_switch(const struct vteprec_mcast_macs_local *, enum ovsdb_atomic_type key_type); - -void vteprec_mcast_macs_local_set_MAC(const struct vteprec_mcast_macs_local *, const char *MAC); -void vteprec_mcast_macs_local_set_ipaddr(const struct vteprec_mcast_macs_local *, const char *ipaddr); -void vteprec_mcast_macs_local_set_locator_set(const struct vteprec_mcast_macs_local *, const struct vteprec_physical_locator_set *locator_set); -void vteprec_mcast_macs_local_set_logical_switch(const struct vteprec_mcast_macs_local *, const struct vteprec_logical_switch *logical_switch); - - -/* Mcast_Macs_Remote table. */ -struct vteprec_mcast_macs_remote { - struct ovsdb_idl_row header_; - - /* MAC column. */ - char *MAC; /* Always nonnull. */ - - /* ipaddr column. */ - char *ipaddr; /* Always nonnull. */ - - /* locator_set column. */ - struct vteprec_physical_locator_set *locator_set; - - /* logical_switch column. */ - struct vteprec_logical_switch *logical_switch; -}; - -enum { - VTEPREC_MCAST_MACS_REMOTE_COL_MAC, - VTEPREC_MCAST_MACS_REMOTE_COL_IPADDR, - VTEPREC_MCAST_MACS_REMOTE_COL_LOCATOR_SET, - VTEPREC_MCAST_MACS_REMOTE_COL_LOGICAL_SWITCH, - VTEPREC_MCAST_MACS_REMOTE_N_COLUMNS -}; - -#define vteprec_mcast_macs_remote_col_ipaddr (vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_IPADDR]) -#define vteprec_mcast_macs_remote_col_MAC (vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_MAC]) -#define vteprec_mcast_macs_remote_col_locator_set (vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_LOCATOR_SET]) -#define vteprec_mcast_macs_remote_col_logical_switch (vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_COL_LOGICAL_SWITCH]) - -extern struct ovsdb_idl_column vteprec_mcast_macs_remote_columns[VTEPREC_MCAST_MACS_REMOTE_N_COLUMNS]; - -const struct vteprec_mcast_macs_remote *vteprec_mcast_macs_remote_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_mcast_macs_remote *vteprec_mcast_macs_remote_first(const struct ovsdb_idl *); -const struct vteprec_mcast_macs_remote *vteprec_mcast_macs_remote_next(const struct vteprec_mcast_macs_remote *); -#define VTEPREC_MCAST_MACS_REMOTE_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_mcast_macs_remote_first(IDL); \ - (ROW); \ - (ROW) = vteprec_mcast_macs_remote_next(ROW)) -#define VTEPREC_MCAST_MACS_REMOTE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_mcast_macs_remote_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_mcast_macs_remote_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_mcast_macs_remote_init(struct vteprec_mcast_macs_remote *); -void vteprec_mcast_macs_remote_delete(const struct vteprec_mcast_macs_remote *); -struct vteprec_mcast_macs_remote *vteprec_mcast_macs_remote_insert(struct ovsdb_idl_txn *); - -void vteprec_mcast_macs_remote_verify_MAC(const struct vteprec_mcast_macs_remote *); -void vteprec_mcast_macs_remote_verify_ipaddr(const struct vteprec_mcast_macs_remote *); -void vteprec_mcast_macs_remote_verify_locator_set(const struct vteprec_mcast_macs_remote *); -void vteprec_mcast_macs_remote_verify_logical_switch(const struct vteprec_mcast_macs_remote *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_mcast_macs_remote directly.) */ -const struct ovsdb_datum *vteprec_mcast_macs_remote_get_MAC(const struct vteprec_mcast_macs_remote *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_mcast_macs_remote_get_ipaddr(const struct vteprec_mcast_macs_remote *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_mcast_macs_remote_get_locator_set(const struct vteprec_mcast_macs_remote *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_mcast_macs_remote_get_logical_switch(const struct vteprec_mcast_macs_remote *, enum ovsdb_atomic_type key_type); - -void vteprec_mcast_macs_remote_set_MAC(const struct vteprec_mcast_macs_remote *, const char *MAC); -void vteprec_mcast_macs_remote_set_ipaddr(const struct vteprec_mcast_macs_remote *, const char *ipaddr); -void vteprec_mcast_macs_remote_set_locator_set(const struct vteprec_mcast_macs_remote *, const struct vteprec_physical_locator_set *locator_set); -void vteprec_mcast_macs_remote_set_logical_switch(const struct vteprec_mcast_macs_remote *, const struct vteprec_logical_switch *logical_switch); - - -/* Physical_Locator table. */ -struct vteprec_physical_locator { - struct ovsdb_idl_row header_; - - /* dst_ip column. */ - char *dst_ip; /* Always nonnull. */ - - /* encapsulation_type column. */ - char *encapsulation_type; /* Always nonnull. */ -}; - -enum { - VTEPREC_PHYSICAL_LOCATOR_COL_DST_IP, - VTEPREC_PHYSICAL_LOCATOR_COL_ENCAPSULATION_TYPE, - VTEPREC_PHYSICAL_LOCATOR_N_COLUMNS -}; - -#define vteprec_physical_locator_col_dst_ip (vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_COL_DST_IP]) -#define vteprec_physical_locator_col_encapsulation_type (vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_COL_ENCAPSULATION_TYPE]) - -extern struct ovsdb_idl_column vteprec_physical_locator_columns[VTEPREC_PHYSICAL_LOCATOR_N_COLUMNS]; - -const struct vteprec_physical_locator *vteprec_physical_locator_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_physical_locator *vteprec_physical_locator_first(const struct ovsdb_idl *); -const struct vteprec_physical_locator *vteprec_physical_locator_next(const struct vteprec_physical_locator *); -#define VTEPREC_PHYSICAL_LOCATOR_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_physical_locator_first(IDL); \ - (ROW); \ - (ROW) = vteprec_physical_locator_next(ROW)) -#define VTEPREC_PHYSICAL_LOCATOR_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_physical_locator_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_physical_locator_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_physical_locator_init(struct vteprec_physical_locator *); -void vteprec_physical_locator_delete(const struct vteprec_physical_locator *); -struct vteprec_physical_locator *vteprec_physical_locator_insert(struct ovsdb_idl_txn *); - -void vteprec_physical_locator_verify_dst_ip(const struct vteprec_physical_locator *); -void vteprec_physical_locator_verify_encapsulation_type(const struct vteprec_physical_locator *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_physical_locator directly.) */ -const struct ovsdb_datum *vteprec_physical_locator_get_dst_ip(const struct vteprec_physical_locator *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_locator_get_encapsulation_type(const struct vteprec_physical_locator *, enum ovsdb_atomic_type key_type); - -void vteprec_physical_locator_set_dst_ip(const struct vteprec_physical_locator *, const char *dst_ip); -void vteprec_physical_locator_set_encapsulation_type(const struct vteprec_physical_locator *, const char *encapsulation_type); - - -/* Physical_Locator_Set table. */ -struct vteprec_physical_locator_set { - struct ovsdb_idl_row header_; - - /* locators column. */ - struct vteprec_physical_locator **locators; - size_t n_locators; -}; - -enum { - VTEPREC_PHYSICAL_LOCATOR_SET_COL_LOCATORS, - VTEPREC_PHYSICAL_LOCATOR_SET_N_COLUMNS -}; - -#define vteprec_physical_locator_set_col_locators (vteprec_physical_locator_set_columns[VTEPREC_PHYSICAL_LOCATOR_SET_COL_LOCATORS]) - -extern struct ovsdb_idl_column vteprec_physical_locator_set_columns[VTEPREC_PHYSICAL_LOCATOR_SET_N_COLUMNS]; - -const struct vteprec_physical_locator_set *vteprec_physical_locator_set_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_physical_locator_set *vteprec_physical_locator_set_first(const struct ovsdb_idl *); -const struct vteprec_physical_locator_set *vteprec_physical_locator_set_next(const struct vteprec_physical_locator_set *); -#define VTEPREC_PHYSICAL_LOCATOR_SET_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_physical_locator_set_first(IDL); \ - (ROW); \ - (ROW) = vteprec_physical_locator_set_next(ROW)) -#define VTEPREC_PHYSICAL_LOCATOR_SET_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_physical_locator_set_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_physical_locator_set_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_physical_locator_set_init(struct vteprec_physical_locator_set *); -void vteprec_physical_locator_set_delete(const struct vteprec_physical_locator_set *); -struct vteprec_physical_locator_set *vteprec_physical_locator_set_insert(struct ovsdb_idl_txn *); - -void vteprec_physical_locator_set_verify_locators(const struct vteprec_physical_locator_set *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_physical_locator_set directly.) */ -const struct ovsdb_datum *vteprec_physical_locator_set_get_locators(const struct vteprec_physical_locator_set *, enum ovsdb_atomic_type key_type); - -void vteprec_physical_locator_set_set_locators(const struct vteprec_physical_locator_set *, struct vteprec_physical_locator **locators, size_t n_locators); - - -/* Physical_Port table. */ -struct vteprec_physical_port { - struct ovsdb_idl_row header_; - - /* description column. */ - char *description; /* Always nonnull. */ - - /* name column. */ - char *name; /* Always nonnull. */ - - /* port_fault_status column. */ - char **port_fault_status; - size_t n_port_fault_status; - - /* vlan_bindings column. */ - int64_t *key_vlan_bindings; - struct vteprec_logical_switch **value_vlan_bindings; - size_t n_vlan_bindings; - - /* vlan_stats column. */ - int64_t *key_vlan_stats; - struct vteprec_logical_binding_stats **value_vlan_stats; - size_t n_vlan_stats; -}; - -enum { - VTEPREC_PHYSICAL_PORT_COL_DESCRIPTION, - VTEPREC_PHYSICAL_PORT_COL_NAME, - VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS, - VTEPREC_PHYSICAL_PORT_COL_VLAN_BINDINGS, - VTEPREC_PHYSICAL_PORT_COL_VLAN_STATS, - VTEPREC_PHYSICAL_PORT_N_COLUMNS -}; - -#define vteprec_physical_port_col_name (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_NAME]) -#define vteprec_physical_port_col_port_fault_status (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS]) -#define vteprec_physical_port_col_vlan_bindings (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_BINDINGS]) -#define vteprec_physical_port_col_vlan_stats (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_STATS]) -#define vteprec_physical_port_col_description (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_DESCRIPTION]) - -extern struct ovsdb_idl_column vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_N_COLUMNS]; - -const struct vteprec_physical_port *vteprec_physical_port_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_physical_port *vteprec_physical_port_first(const struct ovsdb_idl *); -const struct vteprec_physical_port *vteprec_physical_port_next(const struct vteprec_physical_port *); -#define VTEPREC_PHYSICAL_PORT_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_physical_port_first(IDL); \ - (ROW); \ - (ROW) = vteprec_physical_port_next(ROW)) -#define VTEPREC_PHYSICAL_PORT_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_physical_port_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_physical_port_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_physical_port_init(struct vteprec_physical_port *); -void vteprec_physical_port_delete(const struct vteprec_physical_port *); -struct vteprec_physical_port *vteprec_physical_port_insert(struct ovsdb_idl_txn *); - -void vteprec_physical_port_verify_description(const struct vteprec_physical_port *); -void vteprec_physical_port_verify_name(const struct vteprec_physical_port *); -void vteprec_physical_port_verify_port_fault_status(const struct vteprec_physical_port *); -void vteprec_physical_port_verify_vlan_bindings(const struct vteprec_physical_port *); -void vteprec_physical_port_verify_vlan_stats(const struct vteprec_physical_port *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_physical_port directly.) */ -const struct ovsdb_datum *vteprec_physical_port_get_description(const struct vteprec_physical_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_port_get_name(const struct vteprec_physical_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_port_get_port_fault_status(const struct vteprec_physical_port *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_port_get_vlan_bindings(const struct vteprec_physical_port *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_physical_port_get_vlan_stats(const struct vteprec_physical_port *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); - -void vteprec_physical_port_set_description(const struct vteprec_physical_port *, const char *description); -void vteprec_physical_port_set_name(const struct vteprec_physical_port *, const char *name); -void vteprec_physical_port_set_port_fault_status(const struct vteprec_physical_port *, char **port_fault_status, size_t n_port_fault_status); -void vteprec_physical_port_set_vlan_bindings(const struct vteprec_physical_port *, const int64_t *key_vlan_bindings, struct vteprec_logical_switch **value_vlan_bindings, size_t n_vlan_bindings); -void vteprec_physical_port_set_vlan_stats(const struct vteprec_physical_port *, const int64_t *key_vlan_stats, struct vteprec_logical_binding_stats **value_vlan_stats, size_t n_vlan_stats); - - -/* Physical_Switch table. */ -struct vteprec_physical_switch { - struct ovsdb_idl_row header_; - - /* description column. */ - char *description; /* Always nonnull. */ - - /* management_ips column. */ - char **management_ips; - size_t n_management_ips; - - /* name column. */ - char *name; /* Always nonnull. */ - - /* ports column. */ - struct vteprec_physical_port **ports; - size_t n_ports; - - /* switch_fault_status column. */ - char **switch_fault_status; - size_t n_switch_fault_status; - - /* tunnel_ips column. */ - char **tunnel_ips; - size_t n_tunnel_ips; - - /* tunnels column. */ - struct vteprec_tunnel **tunnels; - size_t n_tunnels; -}; - -enum { - VTEPREC_PHYSICAL_SWITCH_COL_DESCRIPTION, - VTEPREC_PHYSICAL_SWITCH_COL_MANAGEMENT_IPS, - VTEPREC_PHYSICAL_SWITCH_COL_NAME, - VTEPREC_PHYSICAL_SWITCH_COL_PORTS, - VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS, - VTEPREC_PHYSICAL_SWITCH_COL_TUNNEL_IPS, - VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS, - VTEPREC_PHYSICAL_SWITCH_N_COLUMNS -}; - -#define vteprec_physical_switch_col_management_ips (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_MANAGEMENT_IPS]) -#define vteprec_physical_switch_col_description (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_DESCRIPTION]) -#define vteprec_physical_switch_col_tunnel_ips (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNEL_IPS]) -#define vteprec_physical_switch_col_switch_fault_status (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS]) -#define vteprec_physical_switch_col_ports (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_PORTS]) -#define vteprec_physical_switch_col_tunnels (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS]) -#define vteprec_physical_switch_col_name (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_NAME]) - -extern struct ovsdb_idl_column vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_N_COLUMNS]; - -const struct vteprec_physical_switch *vteprec_physical_switch_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_physical_switch *vteprec_physical_switch_first(const struct ovsdb_idl *); -const struct vteprec_physical_switch *vteprec_physical_switch_next(const struct vteprec_physical_switch *); -#define VTEPREC_PHYSICAL_SWITCH_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_physical_switch_first(IDL); \ - (ROW); \ - (ROW) = vteprec_physical_switch_next(ROW)) -#define VTEPREC_PHYSICAL_SWITCH_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_physical_switch_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_physical_switch_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_physical_switch_init(struct vteprec_physical_switch *); -void vteprec_physical_switch_delete(const struct vteprec_physical_switch *); -struct vteprec_physical_switch *vteprec_physical_switch_insert(struct ovsdb_idl_txn *); - -void vteprec_physical_switch_verify_description(const struct vteprec_physical_switch *); -void vteprec_physical_switch_verify_management_ips(const struct vteprec_physical_switch *); -void vteprec_physical_switch_verify_name(const struct vteprec_physical_switch *); -void vteprec_physical_switch_verify_ports(const struct vteprec_physical_switch *); -void vteprec_physical_switch_verify_switch_fault_status(const struct vteprec_physical_switch *); -void vteprec_physical_switch_verify_tunnel_ips(const struct vteprec_physical_switch *); -void vteprec_physical_switch_verify_tunnels(const struct vteprec_physical_switch *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_physical_switch directly.) */ -const struct ovsdb_datum *vteprec_physical_switch_get_description(const struct vteprec_physical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_switch_get_management_ips(const struct vteprec_physical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_switch_get_name(const struct vteprec_physical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_switch_get_ports(const struct vteprec_physical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_switch_get_switch_fault_status(const struct vteprec_physical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_switch_get_tunnel_ips(const struct vteprec_physical_switch *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_physical_switch_get_tunnels(const struct vteprec_physical_switch *, enum ovsdb_atomic_type key_type); - -void vteprec_physical_switch_set_description(const struct vteprec_physical_switch *, const char *description); -void vteprec_physical_switch_set_management_ips(const struct vteprec_physical_switch *, char **management_ips, size_t n_management_ips); -void vteprec_physical_switch_set_name(const struct vteprec_physical_switch *, const char *name); -void vteprec_physical_switch_set_ports(const struct vteprec_physical_switch *, struct vteprec_physical_port **ports, size_t n_ports); -void vteprec_physical_switch_set_switch_fault_status(const struct vteprec_physical_switch *, char **switch_fault_status, size_t n_switch_fault_status); -void vteprec_physical_switch_set_tunnel_ips(const struct vteprec_physical_switch *, char **tunnel_ips, size_t n_tunnel_ips); -void vteprec_physical_switch_set_tunnels(const struct vteprec_physical_switch *, struct vteprec_tunnel **tunnels, size_t n_tunnels); - - -/* Tunnel table. */ -struct vteprec_tunnel { - struct ovsdb_idl_row header_; - - /* bfd_config_local column. */ - struct smap bfd_config_local; - - /* bfd_config_remote column. */ - struct smap bfd_config_remote; - - /* bfd_params column. */ - struct smap bfd_params; - - /* bfd_status column. */ - struct smap bfd_status; - - /* local column. */ - struct vteprec_physical_locator *local; - - /* remote column. */ - struct vteprec_physical_locator *remote; -}; - -enum { - VTEPREC_TUNNEL_COL_BFD_CONFIG_LOCAL, - VTEPREC_TUNNEL_COL_BFD_CONFIG_REMOTE, - VTEPREC_TUNNEL_COL_BFD_PARAMS, - VTEPREC_TUNNEL_COL_BFD_STATUS, - VTEPREC_TUNNEL_COL_LOCAL, - VTEPREC_TUNNEL_COL_REMOTE, - VTEPREC_TUNNEL_N_COLUMNS -}; - -#define vteprec_tunnel_col_remote (vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_REMOTE]) -#define vteprec_tunnel_col_bfd_config_local (vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_CONFIG_LOCAL]) -#define vteprec_tunnel_col_bfd_params (vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_PARAMS]) -#define vteprec_tunnel_col_bfd_status (vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_STATUS]) -#define vteprec_tunnel_col_local (vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_LOCAL]) -#define vteprec_tunnel_col_bfd_config_remote (vteprec_tunnel_columns[VTEPREC_TUNNEL_COL_BFD_CONFIG_REMOTE]) - -extern struct ovsdb_idl_column vteprec_tunnel_columns[VTEPREC_TUNNEL_N_COLUMNS]; - -const struct vteprec_tunnel *vteprec_tunnel_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_tunnel *vteprec_tunnel_first(const struct ovsdb_idl *); -const struct vteprec_tunnel *vteprec_tunnel_next(const struct vteprec_tunnel *); -#define VTEPREC_TUNNEL_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_tunnel_first(IDL); \ - (ROW); \ - (ROW) = vteprec_tunnel_next(ROW)) -#define VTEPREC_TUNNEL_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_tunnel_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_tunnel_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_tunnel_init(struct vteprec_tunnel *); -void vteprec_tunnel_delete(const struct vteprec_tunnel *); -struct vteprec_tunnel *vteprec_tunnel_insert(struct ovsdb_idl_txn *); - -void vteprec_tunnel_verify_bfd_config_local(const struct vteprec_tunnel *); -void vteprec_tunnel_verify_bfd_config_remote(const struct vteprec_tunnel *); -void vteprec_tunnel_verify_bfd_params(const struct vteprec_tunnel *); -void vteprec_tunnel_verify_bfd_status(const struct vteprec_tunnel *); -void vteprec_tunnel_verify_local(const struct vteprec_tunnel *); -void vteprec_tunnel_verify_remote(const struct vteprec_tunnel *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_tunnel directly.) */ -const struct ovsdb_datum *vteprec_tunnel_get_bfd_config_local(const struct vteprec_tunnel *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_tunnel_get_bfd_config_remote(const struct vteprec_tunnel *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_tunnel_get_bfd_params(const struct vteprec_tunnel *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_tunnel_get_bfd_status(const struct vteprec_tunnel *, enum ovsdb_atomic_type key_type, enum ovsdb_atomic_type value_type); -const struct ovsdb_datum *vteprec_tunnel_get_local(const struct vteprec_tunnel *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_tunnel_get_remote(const struct vteprec_tunnel *, enum ovsdb_atomic_type key_type); - -void vteprec_tunnel_set_bfd_config_local(const struct vteprec_tunnel *, const struct smap *); -void vteprec_tunnel_set_bfd_config_remote(const struct vteprec_tunnel *, const struct smap *); -void vteprec_tunnel_set_bfd_params(const struct vteprec_tunnel *, const struct smap *); -void vteprec_tunnel_set_bfd_status(const struct vteprec_tunnel *, const struct smap *); -void vteprec_tunnel_set_local(const struct vteprec_tunnel *, const struct vteprec_physical_locator *local); -void vteprec_tunnel_set_remote(const struct vteprec_tunnel *, const struct vteprec_physical_locator *remote); - - -/* Ucast_Macs_Local table. */ -struct vteprec_ucast_macs_local { - struct ovsdb_idl_row header_; - - /* MAC column. */ - char *MAC; /* Always nonnull. */ - - /* ipaddr column. */ - char *ipaddr; /* Always nonnull. */ - - /* locator column. */ - struct vteprec_physical_locator *locator; - - /* logical_switch column. */ - struct vteprec_logical_switch *logical_switch; -}; - -enum { - VTEPREC_UCAST_MACS_LOCAL_COL_MAC, - VTEPREC_UCAST_MACS_LOCAL_COL_IPADDR, - VTEPREC_UCAST_MACS_LOCAL_COL_LOCATOR, - VTEPREC_UCAST_MACS_LOCAL_COL_LOGICAL_SWITCH, - VTEPREC_UCAST_MACS_LOCAL_N_COLUMNS -}; - -#define vteprec_ucast_macs_local_col_locator (vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_LOCATOR]) -#define vteprec_ucast_macs_local_col_MAC (vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_MAC]) -#define vteprec_ucast_macs_local_col_ipaddr (vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_IPADDR]) -#define vteprec_ucast_macs_local_col_logical_switch (vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_COL_LOGICAL_SWITCH]) - -extern struct ovsdb_idl_column vteprec_ucast_macs_local_columns[VTEPREC_UCAST_MACS_LOCAL_N_COLUMNS]; - -const struct vteprec_ucast_macs_local *vteprec_ucast_macs_local_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_ucast_macs_local *vteprec_ucast_macs_local_first(const struct ovsdb_idl *); -const struct vteprec_ucast_macs_local *vteprec_ucast_macs_local_next(const struct vteprec_ucast_macs_local *); -#define VTEPREC_UCAST_MACS_LOCAL_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_ucast_macs_local_first(IDL); \ - (ROW); \ - (ROW) = vteprec_ucast_macs_local_next(ROW)) -#define VTEPREC_UCAST_MACS_LOCAL_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_ucast_macs_local_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_ucast_macs_local_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_ucast_macs_local_init(struct vteprec_ucast_macs_local *); -void vteprec_ucast_macs_local_delete(const struct vteprec_ucast_macs_local *); -struct vteprec_ucast_macs_local *vteprec_ucast_macs_local_insert(struct ovsdb_idl_txn *); - -void vteprec_ucast_macs_local_verify_MAC(const struct vteprec_ucast_macs_local *); -void vteprec_ucast_macs_local_verify_ipaddr(const struct vteprec_ucast_macs_local *); -void vteprec_ucast_macs_local_verify_locator(const struct vteprec_ucast_macs_local *); -void vteprec_ucast_macs_local_verify_logical_switch(const struct vteprec_ucast_macs_local *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_ucast_macs_local directly.) */ -const struct ovsdb_datum *vteprec_ucast_macs_local_get_MAC(const struct vteprec_ucast_macs_local *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_ucast_macs_local_get_ipaddr(const struct vteprec_ucast_macs_local *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_ucast_macs_local_get_locator(const struct vteprec_ucast_macs_local *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_ucast_macs_local_get_logical_switch(const struct vteprec_ucast_macs_local *, enum ovsdb_atomic_type key_type); - -void vteprec_ucast_macs_local_set_MAC(const struct vteprec_ucast_macs_local *, const char *MAC); -void vteprec_ucast_macs_local_set_ipaddr(const struct vteprec_ucast_macs_local *, const char *ipaddr); -void vteprec_ucast_macs_local_set_locator(const struct vteprec_ucast_macs_local *, const struct vteprec_physical_locator *locator); -void vteprec_ucast_macs_local_set_logical_switch(const struct vteprec_ucast_macs_local *, const struct vteprec_logical_switch *logical_switch); - - -/* Ucast_Macs_Remote table. */ -struct vteprec_ucast_macs_remote { - struct ovsdb_idl_row header_; - - /* MAC column. */ - char *MAC; /* Always nonnull. */ - - /* ipaddr column. */ - char *ipaddr; /* Always nonnull. */ - - /* locator column. */ - struct vteprec_physical_locator *locator; - - /* logical_switch column. */ - struct vteprec_logical_switch *logical_switch; -}; - -enum { - VTEPREC_UCAST_MACS_REMOTE_COL_MAC, - VTEPREC_UCAST_MACS_REMOTE_COL_IPADDR, - VTEPREC_UCAST_MACS_REMOTE_COL_LOCATOR, - VTEPREC_UCAST_MACS_REMOTE_COL_LOGICAL_SWITCH, - VTEPREC_UCAST_MACS_REMOTE_N_COLUMNS -}; - -#define vteprec_ucast_macs_remote_col_locator (vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_LOCATOR]) -#define vteprec_ucast_macs_remote_col_MAC (vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_MAC]) -#define vteprec_ucast_macs_remote_col_ipaddr (vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_IPADDR]) -#define vteprec_ucast_macs_remote_col_logical_switch (vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_COL_LOGICAL_SWITCH]) - -extern struct ovsdb_idl_column vteprec_ucast_macs_remote_columns[VTEPREC_UCAST_MACS_REMOTE_N_COLUMNS]; - -const struct vteprec_ucast_macs_remote *vteprec_ucast_macs_remote_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct vteprec_ucast_macs_remote *vteprec_ucast_macs_remote_first(const struct ovsdb_idl *); -const struct vteprec_ucast_macs_remote *vteprec_ucast_macs_remote_next(const struct vteprec_ucast_macs_remote *); -#define VTEPREC_UCAST_MACS_REMOTE_FOR_EACH(ROW, IDL) \ - for ((ROW) = vteprec_ucast_macs_remote_first(IDL); \ - (ROW); \ - (ROW) = vteprec_ucast_macs_remote_next(ROW)) -#define VTEPREC_UCAST_MACS_REMOTE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = vteprec_ucast_macs_remote_first(IDL); \ - (ROW) ? ((NEXT) = vteprec_ucast_macs_remote_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void vteprec_ucast_macs_remote_init(struct vteprec_ucast_macs_remote *); -void vteprec_ucast_macs_remote_delete(const struct vteprec_ucast_macs_remote *); -struct vteprec_ucast_macs_remote *vteprec_ucast_macs_remote_insert(struct ovsdb_idl_txn *); - -void vteprec_ucast_macs_remote_verify_MAC(const struct vteprec_ucast_macs_remote *); -void vteprec_ucast_macs_remote_verify_ipaddr(const struct vteprec_ucast_macs_remote *); -void vteprec_ucast_macs_remote_verify_locator(const struct vteprec_ucast_macs_remote *); -void vteprec_ucast_macs_remote_verify_logical_switch(const struct vteprec_ucast_macs_remote *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of vteprec_ucast_macs_remote directly.) */ -const struct ovsdb_datum *vteprec_ucast_macs_remote_get_MAC(const struct vteprec_ucast_macs_remote *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_ucast_macs_remote_get_ipaddr(const struct vteprec_ucast_macs_remote *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_ucast_macs_remote_get_locator(const struct vteprec_ucast_macs_remote *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *vteprec_ucast_macs_remote_get_logical_switch(const struct vteprec_ucast_macs_remote *, enum ovsdb_atomic_type key_type); - -void vteprec_ucast_macs_remote_set_MAC(const struct vteprec_ucast_macs_remote *, const char *MAC); -void vteprec_ucast_macs_remote_set_ipaddr(const struct vteprec_ucast_macs_remote *, const char *ipaddr); -void vteprec_ucast_macs_remote_set_locator(const struct vteprec_ucast_macs_remote *, const struct vteprec_physical_locator *locator); -void vteprec_ucast_macs_remote_set_logical_switch(const struct vteprec_ucast_macs_remote *, const struct vteprec_logical_switch *logical_switch); - - -enum { - VTEPREC_TABLE_ARP_SOURCES_LOCAL, - VTEPREC_TABLE_ARP_SOURCES_REMOTE, - VTEPREC_TABLE_GLOBAL, - VTEPREC_TABLE_LOGICAL_BINDING_STATS, - VTEPREC_TABLE_LOGICAL_ROUTER, - VTEPREC_TABLE_LOGICAL_SWITCH, - VTEPREC_TABLE_MANAGER, - VTEPREC_TABLE_MCAST_MACS_LOCAL, - VTEPREC_TABLE_MCAST_MACS_REMOTE, - VTEPREC_TABLE_PHYSICAL_LOCATOR, - VTEPREC_TABLE_PHYSICAL_LOCATOR_SET, - VTEPREC_TABLE_PHYSICAL_PORT, - VTEPREC_TABLE_PHYSICAL_SWITCH, - VTEPREC_TABLE_TUNNEL, - VTEPREC_TABLE_UCAST_MACS_LOCAL, - VTEPREC_TABLE_UCAST_MACS_REMOTE, - VTEPREC_N_TABLES -}; - -#define vteprec_table_mcast_macs_remote (vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_REMOTE]) -#define vteprec_table_global (vteprec_table_classes[VTEPREC_TABLE_GLOBAL]) -#define vteprec_table_physical_locator (vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR]) -#define vteprec_table_physical_locator_set (vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_LOCATOR_SET]) -#define vteprec_table_tunnel (vteprec_table_classes[VTEPREC_TABLE_TUNNEL]) -#define vteprec_table_mcast_macs_local (vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_LOCAL]) -#define vteprec_table_physical_switch (vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_SWITCH]) -#define vteprec_table_logical_router (vteprec_table_classes[VTEPREC_TABLE_LOGICAL_ROUTER]) -#define vteprec_table_manager (vteprec_table_classes[VTEPREC_TABLE_MANAGER]) -#define vteprec_table_ucast_macs_local (vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_LOCAL]) -#define vteprec_table_logical_switch (vteprec_table_classes[VTEPREC_TABLE_LOGICAL_SWITCH]) -#define vteprec_table_ucast_macs_remote (vteprec_table_classes[VTEPREC_TABLE_UCAST_MACS_REMOTE]) -#define vteprec_table_arp_sources_remote (vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_REMOTE]) -#define vteprec_table_arp_sources_local (vteprec_table_classes[VTEPREC_TABLE_ARP_SOURCES_LOCAL]) -#define vteprec_table_physical_port (vteprec_table_classes[VTEPREC_TABLE_PHYSICAL_PORT]) -#define vteprec_table_logical_binding_stats (vteprec_table_classes[VTEPREC_TABLE_LOGICAL_BINDING_STATS]) - -extern struct ovsdb_idl_table_class vteprec_table_classes[VTEPREC_N_TABLES]; - -extern struct ovsdb_idl_class vteprec_idl_class; - -void vteprec_init(void); - -const char * vteprec_get_db_version(void); - -#endif /* VTEPREC_IDL_HEADER */ diff -Nru openvswitch-2.3.1/lib/vtep-idl.ovsidl openvswitch-2.4.0~git20150623/lib/vtep-idl.ovsidl --- openvswitch-2.3.1/lib/vtep-idl.ovsidl 2014-10-12 23:47:58.000000000 +0000 +++ openvswitch-2.4.0~git20150623/lib/vtep-idl.ovsidl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"cksum":"58544667 7319","idlHeader":"\"lib/vtep-idl.h\"","idlPrefix":"vteprec_","name":"hardware_vtep","tables":{"Arp_Sources_Local":{"columns":{"locator":{"type":{"key":{"refTable":"Physical_Locator","type":"uuid"}}},"src_mac":{"type":"string"}},"isRoot":true},"Arp_Sources_Remote":{"columns":{"locator":{"type":{"key":{"refTable":"Physical_Locator","type":"uuid"}}},"src_mac":{"type":"string"}},"isRoot":true},"Global":{"columns":{"managers":{"type":{"key":{"refTable":"Manager","type":"uuid"},"max":"unlimited","min":0}},"switches":{"type":{"key":{"refTable":"Physical_Switch","type":"uuid"},"max":"unlimited","min":0}}},"isRoot":true,"maxRows":1},"Logical_Binding_Stats":{"columns":{"bytes_from_local":{"type":"integer"},"bytes_to_local":{"type":"integer"},"packets_from_local":{"type":"integer"},"packets_to_local":{"type":"integer"}}},"Logical_Router":{"columns":{"description":{"type":"string"},"name":{"type":"string"},"static_routes":{"type":{"key":{"type":"string"},"max":"unlimited","min":0,"value":{"type":"string"}}},"switch_binding":{"type":{"key":{"type":"string"},"max":"unlimited","min":0,"value":{"refTable":"Logical_Switch","type":"uuid"}}}},"indexes":[["name"]],"isRoot":true},"Logical_Switch":{"columns":{"description":{"type":"string"},"name":{"type":"string"},"tunnel_key":{"type":{"key":"integer","max":1,"min":0}}},"indexes":[["name"]],"isRoot":true},"Manager":{"columns":{"inactivity_probe":{"type":{"key":"integer","max":1,"min":0}},"is_connected":{"ephemeral":true,"type":"boolean"},"max_backoff":{"type":{"key":{"minInteger":1000,"type":"integer"},"max":1,"min":0}},"other_config":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"target":{"type":"string"}},"indexes":[["target"]],"isRoot":false},"Mcast_Macs_Local":{"columns":{"MAC":{"type":"string"},"ipaddr":{"type":"string"},"locator_set":{"type":{"key":{"refTable":"Physical_Locator_Set","type":"uuid"}}},"logical_switch":{"type":{"key":{"refTable":"Logical_Switch","type":"uuid"}}}},"isRoot":true},"Mcast_Macs_Remote":{"columns":{"MAC":{"type":"string"},"ipaddr":{"type":"string"},"locator_set":{"type":{"key":{"refTable":"Physical_Locator_Set","type":"uuid"}}},"logical_switch":{"type":{"key":{"refTable":"Logical_Switch","type":"uuid"}}}},"isRoot":true},"Physical_Locator":{"columns":{"dst_ip":{"mutable":false,"type":"string"},"encapsulation_type":{"mutable":false,"type":{"key":{"enum":["set",["vxlan_over_ipv4"]],"type":"string"}}}},"indexes":[["encapsulation_type","dst_ip"]]},"Physical_Locator_Set":{"columns":{"locators":{"mutable":false,"type":{"key":{"refTable":"Physical_Locator","type":"uuid"},"max":"unlimited","min":1}}}},"Physical_Port":{"columns":{"description":{"type":"string"},"name":{"type":"string"},"port_fault_status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0}},"vlan_bindings":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"max":"unlimited","min":0,"value":{"refTable":"Logical_Switch","type":"uuid"}}},"vlan_stats":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"max":"unlimited","min":0,"value":{"refTable":"Logical_Binding_Stats","type":"uuid"}}}}},"Physical_Switch":{"columns":{"description":{"type":"string"},"management_ips":{"type":{"key":{"type":"string"},"max":"unlimited","min":0}},"name":{"type":"string"},"ports":{"type":{"key":{"refTable":"Physical_Port","type":"uuid"},"max":"unlimited","min":0}},"switch_fault_status":{"ephemeral":true,"type":{"key":"string","max":"unlimited","min":0}},"tunnel_ips":{"type":{"key":{"type":"string"},"max":"unlimited","min":0}},"tunnels":{"type":{"key":{"refTable":"Tunnel","type":"uuid"},"max":"unlimited","min":0}}},"indexes":[["name"]]},"Tunnel":{"columns":{"bfd_config_local":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"bfd_config_remote":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"bfd_params":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"bfd_status":{"type":{"key":"string","max":"unlimited","min":0,"value":"string"}},"local":{"type":{"key":{"refTable":"Physical_Locator","type":"uuid"}}},"remote":{"type":{"key":{"refTable":"Physical_Locator","type":"uuid"}}}}},"Ucast_Macs_Local":{"columns":{"MAC":{"type":"string"},"ipaddr":{"type":"string"},"locator":{"type":{"key":{"refTable":"Physical_Locator","type":"uuid"}}},"logical_switch":{"type":{"key":{"refTable":"Logical_Switch","type":"uuid"}}}},"isRoot":true},"Ucast_Macs_Remote":{"columns":{"MAC":{"type":"string"},"ipaddr":{"type":"string"},"locator":{"type":{"key":{"refTable":"Physical_Locator","type":"uuid"}}},"logical_switch":{"type":{"key":{"refTable":"Logical_Switch","type":"uuid"}}}},"isRoot":true}},"version":"1.3.0"} diff -Nru openvswitch-2.3.1/m4/.gitignore openvswitch-2.4.0~git20150623/m4/.gitignore --- openvswitch-2.3.1/m4/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/m4/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,5 @@ +/libtool.m4 +/ltoptions.m4 +/ltsugar.m4 +/ltversion.m4 +/lt~obsolete.m4 diff -Nru openvswitch-2.3.1/m4/libtool.m4 openvswitch-2.4.0~git20150623/m4/libtool.m4 --- openvswitch-2.3.1/m4/libtool.m4 2014-12-04 05:59:39.000000000 +0000 +++ openvswitch-2.4.0~git20150623/m4/libtool.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,7851 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 57 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_REPLACE_SHELLFNS - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[[4-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - _LT_TAGVAR(link_all_deplibs, $1)=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - gnu*) - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine which file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS diff -Nru openvswitch-2.3.1/m4/lt~obsolete.m4 openvswitch-2.4.0~git20150623/m4/lt~obsolete.m4 --- openvswitch-2.3.1/m4/lt~obsolete.m4 2014-12-04 05:59:39.000000000 +0000 +++ openvswitch-2.4.0~git20150623/m4/lt~obsolete.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff -Nru openvswitch-2.3.1/m4/ltoptions.m4 openvswitch-2.4.0~git20150623/m4/ltoptions.m4 --- openvswitch-2.3.1/m4/ltoptions.m4 2014-12-04 05:59:39.000000000 +0000 +++ openvswitch-2.4.0~git20150623/m4/ltoptions.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,369 +0,0 @@ -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 7 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) diff -Nru openvswitch-2.3.1/m4/ltsugar.m4 openvswitch-2.4.0~git20150623/m4/ltsugar.m4 --- openvswitch-2.3.1/m4/ltsugar.m4 2014-12-04 05:59:39.000000000 +0000 +++ openvswitch-2.4.0~git20150623/m4/ltsugar.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) diff -Nru openvswitch-2.3.1/m4/ltversion.m4 openvswitch-2.4.0~git20150623/m4/ltversion.m4 --- openvswitch-2.3.1/m4/ltversion.m4 2014-12-04 05:59:39.000000000 +0000 +++ openvswitch-2.4.0~git20150623/m4/ltversion.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# @configure_input@ - -# serial 3293 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) diff -Nru openvswitch-2.3.1/m4/openvswitch.m4 openvswitch-2.4.0~git20150623/m4/openvswitch.m4 --- openvswitch-2.3.1/m4/openvswitch.m4 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/m4/openvswitch.m4 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ # -*- autoconf -*- -# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. +# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,8 +30,20 @@ esac], [coverage=false]) if $coverage; then - CFLAGS="$CFLAGS -O0 --coverage" - LDFLAGS="$LDFLAGS --coverage" + # Autoconf by default puts "-g -O2" in CFLAGS. We need to remove the -O2 + # option for coverage to be useful. This does it without otherwise + # interfering with anything that the user might have put there. + old_CFLAGS=$CFLAGS + CFLAGS= + for option in $old_CFLAGS; do + case $option in + (-O2) ;; + (*) CFLAGS="$CFLAGS $option" ;; + esac + done + + OVS_CFLAGS="$OVS_CFLAGS --coverage" + OVS_LDFLAGS="$OVS_LDFLAGS --coverage" fi]) dnl Checks for --enable-ndebug and defines NDEBUG if it is specified. @@ -86,12 +98,49 @@ AC_MSG_ERROR([pthread directory not specified]) ] ) + AC_ARG_WITH([debug], + [AS_HELP_STRING([--with-debug], + [Build without compiler optimizations])], + [ + MSVC_CFLAGS="-O0" + AC_SUBST([MSVC_CFLAGS]) + ], [ + MSVC_CFLAGS="-O2" + AC_SUBST([MSVC_CFLAGS]) + ] + ) + AC_DEFINE([WIN32], [1], [Define to 1 if building on WIN32.]) AH_BOTTOM([#ifdef WIN32 #include "include/windows/windefs.h" #endif]) fi]) +dnl OVS_CHECK_WINDOWS +dnl +dnl Configure Visual Studio solution build +AC_DEFUN([OVS_CHECK_VISUAL_STUDIO_DDK], [ +AC_ARG_WITH([vstudiotarget], + [AS_HELP_STRING([--with-vstudiotarget=target_type], + [Target type: Debug/Release])], + [ + case "$withval" in + "Release") ;; + "Debug") ;; + *) AC_MSG_ERROR([No valid Visual Studio configuration found]) ;; + esac + + VSTUDIO_CONFIG=$withval + ], [ + VSTUDIO_CONFIG= + ] + ) + + AC_SUBST([VSTUDIO_CONFIG]) + AC_DEFINE([VSTUDIO_DDK], [1], [System uses the Visual Studio build target.]) + AM_CONDITIONAL([VSTUDIO_DDK], [test -n "$VSTUDIO_CONFIG"]) +]) + dnl Checks for Netlink support. AC_DEFUN([OVS_CHECK_NETLINK], [AC_CHECK_HEADER([linux/netlink.h], @@ -192,25 +241,9 @@ [AC_DEFINE([HAVE_BACKTRACE], [1], [Define to 1 if you have backtrace(3).])])]) -dnl Checks for __malloc_hook, etc., supported by glibc. -AC_DEFUN([OVS_CHECK_MALLOC_HOOKS], - [AC_CACHE_CHECK( - [whether libc supports hooks for malloc and related functions], - [ovs_cv_malloc_hooks], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [#include - ], - [(void) __malloc_hook; - (void) __realloc_hook; - (void) __free_hook;])], - [ovs_cv_malloc_hooks=yes], - [ovs_cv_malloc_hooks=no])]) - if test $ovs_cv_malloc_hooks = yes; then - AC_DEFINE([HAVE_MALLOC_HOOKS], [1], - [Define to 1 if you have __malloc_hook, __realloc_hook, and - __free_hook in .]) - fi]) +dnl Defines HAVE_PERF_EVENT if linux/perf_event.h is found. +AC_DEFUN([OVS_CHECK_PERF_EVENT], + [AC_CHECK_HEADERS([linux/perf_event.h])]) dnl Checks for valgrind/valgrind.h. AC_DEFUN([OVS_CHECK_VALGRIND], @@ -225,7 +258,7 @@ ovs_cv_python=$PYTHON else ovs_cv_python=no - for binary in python python2.4 python2.5; do + for binary in python python2.4 python2.5 python2.7; do ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR for dir in $PATH; do IFS=$ovs_save_IFS @@ -449,3 +482,12 @@ AC_DEFUN([OVS_CHECK_INCLUDE_NEXT], [AC_REQUIRE([gl_CHECK_NEXT_HEADERS]) gl_CHECK_NEXT_HEADERS([$1])]) + +dnl OVS_CHECK_PRAGMA_MESSAGE +AC_DEFUN([OVS_CHECK_PRAGMA_MESSAGE], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[_Pragma("message(\"Checking for pragma message\")") + ]])], + [AC_DEFINE(HAVE_PRAGMA_MESSAGE,1,[Define if compiler supports #pragma + message directive])]) + ]) diff -Nru openvswitch-2.3.1/Makefile.am openvswitch-2.4.0~git20150623/Makefile.am --- openvswitch-2.3.1/Makefile.am 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/Makefile.am 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. +# Copyright (C) 2007-2015 Nicira, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -11,14 +11,18 @@ AM_CPPFLAGS = $(SSL_CFLAGS) AM_LDFLAGS = $(SSL_LDFLAGS) +AM_LDFLAGS += $(OVS_LDFLAGS) if WIN32 AM_CPPFLAGS += -I $(top_srcdir)/include/windows +AM_CPPFLAGS += -I $(top_srcdir)/datapath-windows/include AM_CPPFLAGS += $(PTHREAD_INCLUDES) +AM_CPPFLAGS += $(MSVC_CFLAGS) AM_LDFLAGS += $(PTHREAD_LDFLAGS) endif AM_CPPFLAGS += -I $(top_srcdir)/include +AM_CPPFLAGS += -I $(top_builddir)/include AM_CPPFLAGS += -I $(top_srcdir)/lib AM_CPPFLAGS += -I $(top_builddir)/lib @@ -26,6 +30,11 @@ AM_CFLAGS = -Wstrict-prototypes AM_CFLAGS += $(WARNING_FLAGS) +AM_CFLAGS += $(OVS_CFLAGS) + +if DPDK_NETDEV +AM_CFLAGS += -D_FILE_OFFSET_BITS=64 +endif if NDEBUG AM_CPPFLAGS += -DNDEBUG @@ -56,37 +65,53 @@ CLEAN_LOCAL = DISTCLEANFILES = PYCOV_CLEAN_FILES = build-aux/check-structs,cover + +# A list of Markdown-formatted documentation that will automatically be +# included in the "make dist-docs" output. +docs = \ + appveyor.yml \ + CONTRIBUTING.md \ + CodingStyle.md \ + DESIGN.md \ + FAQ.md \ + INSTALL.md \ + INSTALL.Debian.md \ + INSTALL.Docker.md \ + INSTALL.DPDK.md \ + INSTALL.Fedora.md \ + INSTALL.KVM.md \ + INSTALL.Libvirt.md \ + INSTALL.NetBSD.md \ + INSTALL.RHEL.md \ + INSTALL.SSL.md \ + INSTALL.XenServer.md \ + INSTALL.userspace.md \ + INSTALL.Windows.md \ + IntegrationGuide.md \ + OPENFLOW-1.1+.md \ + PORTING.md \ + README.md \ + README-lisp.md \ + README-native-tunneling.md \ + REPORTING-BUGS.md \ + SECURITY.md \ + TODO.md \ + WHY-OVS.md EXTRA_DIST = \ - BUILD.Windows \ - CONTRIBUTING \ - CodingStyle \ - DESIGN \ - FAQ \ - INSTALL \ - INSTALL.Debian \ - INSTALL.DPDK \ - INSTALL.Fedora \ - INSTALL.KVM \ - INSTALL.Libvirt \ - INSTALL.NetBSD \ - INSTALL.RHEL \ - INSTALL.SSL \ - INSTALL.XenServer \ - INSTALL.userspace \ - IntegrationGuide \ + $(docs) \ NOTICE \ - OPENFLOW-1.1+ \ - PORTING \ - README-lisp \ - REPORTING-BUGS \ - TODO \ - WHY-OVS \ + .travis.yml \ + .travis/build.sh \ + .travis/prepare.sh \ boot.sh \ build-aux/cccl \ + build-aux/dist-docs \ build-aux/sodepends.pl \ build-aux/soexpand.pl \ + build-aux/xml2nroff \ $(MAN_FRAGMENTS) \ - $(MAN_ROOTS) + $(MAN_ROOTS) \ + Vagrantfile bin_PROGRAMS = sbin_PROGRAMS = bin_SCRIPTS = @@ -112,11 +137,16 @@ pkgdata_DATA = sbin_SCRIPTS = scripts_SCRIPTS = +completion_SCRIPTS = scripts_DATA = SUFFIXES = check_DATA = +check_SCRIPTS = +pkgconfig_DATA = scriptsdir = $(pkgdatadir)/scripts +completiondir = $(sysconfdir)/bash_completion.d +pkgconfigdir = $(libdir)/pkgconfig # This ensures that files added to EXTRA_DIST are always distributed, # even if they are inside an Automake if...endif conditional block that is @@ -129,7 +159,7 @@ SUFFIXES += .in .in: - $(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \ + $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \ sed \ -e 's,[@]PKIDIR[@],$(PKIDIR),g' \ -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ @@ -148,7 +178,7 @@ @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \ chmod +x $@.tmp; \ fi - $(AM_V_GEN) mv $@.tmp $@ + $(AM_V_at) mv $@.tmp $@ .PHONY: clean-pycov clean-pycov: @@ -172,7 +202,7 @@ LC_ALL=C sort -u > all-gitfiles; \ LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \ if test -s missing-distfiles; then \ - echo "The distribution is missing the following files:"; \ + echo "The following files are in git but not the distribution:"; \ cat missing-distfiles; \ exit 1; \ fi; \ @@ -197,7 +227,7 @@ @cd $(srcdir); \ if test -e .git && (git --version) >/dev/null 2>&1 && \ git --no-pager grep -L '#include ' `git ls-files | grep '\.c$$' | \ - grep -vE '^datapath|^lib/sflow|^third-party'`; \ + grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows'`; \ then \ echo "See above for list of violations of the rule that"; \ echo "every C source file must #include ."; \ @@ -208,12 +238,14 @@ # Check for printf() type modifiers that MSVC doesn't support. ALL_LOCAL += printf-check printf-check: - @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ - git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files $(srcdir) | grep '\.[ch]$$'`; \ + @cd $(srcdir); \ + if test -e .git && (git --version) >/dev/null 2>&1 && \ + git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \ + grep -vE '^datapath|^lib/sflow|^third-party'`; \ then \ echo "See above for list of violations of the rule that"; \ echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \ - echo "forbidden. See CodingStyle for replacements."; \ + echo "forbidden. See CodingStyle.md for replacements."; \ exit 1; \ fi .PHONY: printf-check @@ -243,11 +275,29 @@ fi .PHONY: check-assert-h-usage +# Check that LITTLE_ENDIAN and BIG_ENDIAN are not used unless BYTE_ORDER is +# also mentioned. ( always defines the former two constants. They +# must be compared to BYTE_ORDER to get the machine's correct endianness. But +# it is better to use WORDS_BIGENDIAN.) +ALL_LOCAL += check-endian +check-endian: + @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ + (cd $(srcdir) && git --no-pager grep -l -E \ + -e 'BIG_ENDIAN|LITTLE_ENDIAN' --and --not -e 'BYTE_ORDER' | \ + $(EGREP) -v '^datapath/'); \ + then \ + echo "See above for list of files that misuse LITTLE""_ENDIAN"; \ + echo "or BIG""_ENDIAN. Please use WORDS_BIGENDIAN instead."; \ + exit 1; \ + fi +.PHONY: check-endian + ALL_LOCAL += thread-safety-check thread-safety-check: - @if test -e '$(srcdir)'/.git && (git --version) >/dev/null 2>&1 && \ - grep -n -f '$(srcdir)'/build-aux/thread-safety-blacklist \ - `git ls-files '$(srcdir)' | grep '\.[ch]$$' \ + @cd $(srcdir); \ + if test -e .git && (git --version) >/dev/null 2>&1 && \ + grep -n -f build-aux/thread-safety-blacklist \ + `git ls-files | grep '\.[ch]$$' \ | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \ | $(EGREP) -v ':[ ]*/?\*'; \ then \ @@ -282,6 +332,18 @@ fi CLEANFILES += manpage-dep-check +if VSTUDIO_DDK +ALL_LOCAL += ovsext_make +ovsext_make: datapath-windows/ovsext.sln + MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8$(VSTUDIO_CONFIG)" + MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8.1$(VSTUDIO_CONFIG)" + +CLEAN_LOCAL += ovsext_clean +ovsext_clean: datapath-windows/ovsext.sln + MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8$(VSTUDIO_CONFIG)" + MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8.1$(VSTUDIO_CONFIG)" +endif + dist-hook: $(DIST_HOOKS) all-local: $(ALL_LOCAL) clean-local: $(CLEAN_LOCAL) @@ -294,6 +356,11 @@ cd datapath/linux && $(MAKE) modules_install endif +dist-docs: + VERSION=$(VERSION) $(srcdir)/build-aux/dist-docs $(srcdir) $(docs) +.PHONY: dist-docs + +include Documentation/automake.mk include m4/automake.mk include lib/automake.mk include ofproto/automake.mk @@ -310,3 +377,6 @@ include python/compat/automake.mk include tutorial/automake.mk include vtep/automake.mk +include datapath-windows/automake.mk +include datapath-windows/include/automake.mk +include windows/automake.mk diff -Nru openvswitch-2.3.1/Makefile.in openvswitch-2.4.0~git20150623/Makefile.in --- openvswitch-2.3.1/Makefile.in 2014-12-04 05:59:57.000000000 +0000 +++ openvswitch-2.4.0~git20150623/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,5014 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -# Generated automatically -- do not modify! -*- buffer-read-only: t -*- - -# Copyright (C) 2013 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -# Copyright (C) 2013 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - - - - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@WIN32_TRUE@am__append_1 = -I $(top_srcdir)/include/windows \ -@WIN32_TRUE@ $(PTHREAD_INCLUDES) -@WIN32_TRUE@am__append_2 = $(PTHREAD_LDFLAGS) -@NDEBUG_TRUE@am__append_3 = -DNDEBUG -@NDEBUG_TRUE@am__append_4 = -fomit-frame-pointer -bin_PROGRAMS = utilities/ovs-appctl$(EXEEXT) \ - utilities/ovs-dpctl$(EXEEXT) utilities/ovs-ofctl$(EXEEXT) \ - utilities/ovs-vsctl$(EXEEXT) utilities/ovs-benchmark$(EXEEXT) \ - ovsdb/ovsdb-tool$(EXEEXT) ovsdb/ovsdb-client$(EXEEXT) \ - vtep/vtep-ctl$(EXEEXT) -sbin_PROGRAMS = $(am__EXEEXT_2) vswitchd/ovs-vswitchd$(EXEEXT) \ - ovsdb/ovsdb-server$(EXEEXT) -noinst_PROGRAMS = $(am__EXEEXT_1) tests/test-controller$(EXEEXT) \ - tests/test-ovsdb$(EXEEXT) tests/ovstest$(EXEEXT) \ - tests/test-strtok_r$(EXEEXT) tests/test-type-props$(EXEEXT) - -# If we're checked out from a Git repository, make sure that every -# file that is in Git is distributed. -# -# We only enable this check when GNU make is in use because the -# Makefile in datapath/linux, needed to get the list of files to -# distribute, requires GNU make extensions. -@GNU_MAKE_TRUE@am__append_5 = dist-hook-git -@GNU_MAKE_TRUE@am__append_6 = all-distfiles all-gitfiles \ -@GNU_MAKE_TRUE@ missing-distfiles distfiles -@HAVE_GROFF_TRUE@am__append_7 = manpage-check -@HAVE_GROFF_TRUE@am__append_8 = manpage-check -DIST_COMMON = README $(am__configure_deps) $(am__noinst_HEADERS_DIST) \ - $(dist_check_SCRIPTS) $(dist_man_MANS) $(dist_noinst_SCRIPTS) \ - $(dist_pkgdata_DATA) $(dist_pkgdata_SCRIPTS) \ - $(dist_sbin_SCRIPTS) $(dist_scripts_DATA) \ - $(dist_scripts_SCRIPTS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/debian/automake.mk $(srcdir)/include/automake.mk \ - $(srcdir)/include/linux/automake.mk \ - $(srcdir)/include/openflow/automake.mk \ - $(srcdir)/include/openvswitch/automake.mk \ - $(srcdir)/include/sparse/automake.mk \ - $(srcdir)/include/windows/automake.mk \ - $(srcdir)/lib/automake.mk $(srcdir)/m4/automake.mk \ - $(srcdir)/manpages.mk $(srcdir)/ofproto/automake.mk \ - $(srcdir)/ovsdb/automake.mk $(srcdir)/python/automake.mk \ - $(srcdir)/python/compat/automake.mk $(srcdir)/rhel/automake.mk \ - $(srcdir)/tests/automake.mk $(srcdir)/third-party/automake.mk \ - $(srcdir)/tutorial/automake.mk $(srcdir)/utilities/automake.mk \ - $(srcdir)/utilities/bugtool/automake.mk \ - $(srcdir)/vswitchd/automake.mk $(srcdir)/vtep/automake.mk \ - $(srcdir)/xenserver/automake.mk $(top_srcdir)/configure \ - $(top_srcdir)/datapath/linux/Kbuild.in \ - $(top_srcdir)/datapath/linux/Makefile.in \ - $(top_srcdir)/datapath/linux/Makefile.main.in \ - $(top_srcdir)/lib/stdio.h.in $(top_srcdir)/lib/string.h.in \ - $(top_srcdir)/tests/atlocal.in AUTHORS COPYING INSTALL NEWS \ - TODO build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/ltmain.sh build-aux/missing -@WIN32_TRUE@am__append_9 = ${PTHREAD_LIBS} -@WIN32_TRUE@am__append_10 = \ -@WIN32_TRUE@ lib/daemon-windows.c \ -@WIN32_TRUE@ lib/getopt_long.c \ -@WIN32_TRUE@ lib/getrusage-windows.c \ -@WIN32_TRUE@ lib/latch-windows.c \ -@WIN32_TRUE@ lib/route-table-stub.c \ -@WIN32_TRUE@ lib/strsep.c \ -@WIN32_TRUE@ lib/stream-fd-windows.c - -@WIN32_FALSE@am__append_11 = \ -@WIN32_FALSE@ lib/daemon-unix.c \ -@WIN32_FALSE@ lib/latch-unix.c \ -@WIN32_FALSE@ lib/signals.c \ -@WIN32_FALSE@ lib/signals.h \ -@WIN32_FALSE@ lib/stream-fd-unix.c \ -@WIN32_FALSE@ lib/stream-unix.c - -@HAVE_WNO_UNUSED_TRUE@am__append_12 = -Wno-unused -@HAVE_WNO_UNUSED_PARAMETER_TRUE@am__append_13 = -Wno-unused-parameter -@LINUX_TRUE@am__append_14 = \ -@LINUX_TRUE@ lib/dpif-linux.c \ -@LINUX_TRUE@ lib/dpif-linux.h \ -@LINUX_TRUE@ lib/netdev-linux.c \ -@LINUX_TRUE@ lib/netdev-linux.h \ -@LINUX_TRUE@ lib/netlink-notifier.c \ -@LINUX_TRUE@ lib/netlink-notifier.h \ -@LINUX_TRUE@ lib/netlink-protocol.h \ -@LINUX_TRUE@ lib/netlink-socket.c \ -@LINUX_TRUE@ lib/netlink-socket.h \ -@LINUX_TRUE@ lib/rtnetlink-link.c \ -@LINUX_TRUE@ lib/rtnetlink-link.h \ -@LINUX_TRUE@ lib/route-table.c \ -@LINUX_TRUE@ lib/route-table.h - -@DPDK_NETDEV_TRUE@am__append_15 = \ -@DPDK_NETDEV_TRUE@ lib/netdev-dpdk.c \ -@DPDK_NETDEV_TRUE@ lib/netdev-dpdk.h - -@HAVE_POSIX_AIO_TRUE@am__append_16 = lib/async-append-aio.c -@HAVE_POSIX_AIO_FALSE@am__append_17 = lib/async-append-null.c -@ESX_TRUE@am__append_18 = \ -@ESX_TRUE@ lib/route-table-stub.c - -@HAVE_IF_DL_TRUE@am__append_19 = \ -@HAVE_IF_DL_TRUE@ lib/netdev-bsd.c \ -@HAVE_IF_DL_TRUE@ lib/rtbsd.c \ -@HAVE_IF_DL_TRUE@ lib/rtbsd.h \ -@HAVE_IF_DL_TRUE@ lib/route-table-bsd.c - -@HAVE_OPENSSL_TRUE@am__append_20 = lib/stream-ssl.c -@HAVE_OPENSSL_TRUE@am__append_21 = lib/dhparams.c -@HAVE_OPENSSL_FALSE@am__append_22 = lib/stream-nossl.c -@WIN32_TRUE@am__append_23 = ${PTHREAD_LIBS} -@HAVE_PYTHON_TRUE@am__append_24 = \ -@HAVE_PYTHON_TRUE@ utilities/ovs-dpctl-top \ -@HAVE_PYTHON_TRUE@ utilities/ovs-l3ping \ -@HAVE_PYTHON_TRUE@ utilities/ovs-parse-backtrace \ -@HAVE_PYTHON_TRUE@ utilities/ovs-pcap \ -@HAVE_PYTHON_TRUE@ utilities/ovs-tcpundump \ -@HAVE_PYTHON_TRUE@ utilities/ovs-test \ -@HAVE_PYTHON_TRUE@ utilities/ovs-vlan-test - -@LINUX_TRUE@am__append_25 = utilities/ovs-vlan-bug-workaround -@LINUX_TRUE@am__append_26 = utilities/nlmon -@HAVE_PYTHON_TRUE@am__append_27 = utilities/bugtool/ovs-bugtool -@HAVE_PYTHON_TRUE@am__append_28 = utilities/bugtool/ovs-bugtool -@HAVE_PYTHON_TRUE@am__append_29 = utilities/bugtool/ovs-bugtool.8 -@HAVE_PYTHON_TRUE@am__append_30 = utilities/bugtool/ovs-bugtool.8.in -@HAVE_PYTHON_TRUE@am__append_31 = utilities/bugtool/ovs-bugtool.8 -@HAVE_PYTHON_TRUE@am__append_32 = $(bugtool_scripts) -@HAVE_PYTHON_TRUE@am__append_33 = bugtool-install-data-local -@HAVE_PYTHON_TRUE@am__append_34 = bugtool-uninstall-local -@WIN32_FALSE@am__append_35 = \ -@WIN32_FALSE@ tests/test-unix-socket.c - -@HAVE_OPENSSL_TRUE@am__append_36 = $(TESTPKI_FILES) -@HAVE_OPENSSL_TRUE@am__append_37 = $(TESTPKI_FILES) tests/ovs-pki.log -@HAVE_OPENSSL_TRUE@am__append_38 = clean-pki -@HAVE_PYTHON_TRUE@am__append_39 = .h .hstamp -@HAVE_PYTHON_TRUE@am__append_40 = $(HSTAMP_FILES) -@HAVE_PYTHON_TRUE@am__append_41 = $(HSTAMP_FILES) -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@am__append_42 = vswitchd/vswitch.gv vswitchd/vswitch.pic -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@am__append_43 = vtep/vtep.gv vtep/vtep.pic -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ - $(top_srcdir)/m4/ax_check_openssl.m4 \ - $(top_srcdir)/m4/ax_func_posix_memalign.m4 \ - $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/openvswitch.m4 $(top_srcdir)/m4/compat.at \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = lib/stdio.h lib/string.h datapath/linux/Kbuild \ - datapath/linux/Makefile datapath/linux/Makefile.main \ - tests/atlocal -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sbindir)" \ - "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(sbindir)" \ - "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ - "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(scriptsdir)" \ - "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" \ - "$(DESTDIR)$(scriptsdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -@WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -lib_libopenvswitch_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) -am__lib_libopenvswitch_la_SOURCES_DIST = lib/aes128.c lib/aes128.h \ - lib/async-append.h lib/backtrace.c lib/backtrace.h lib/bfd.c \ - lib/bfd.h lib/bitmap.c lib/bitmap.h lib/bundle.c lib/bundle.h \ - lib/byte-order.h lib/byteq.c lib/byteq.h lib/cfm.c lib/cfm.h \ - lib/classifier.c lib/classifier.h lib/command-line.c \ - lib/command-line.h lib/compiler.h lib/connectivity.c \ - lib/connectivity.h lib/coverage.c lib/coverage.h lib/crc32c.c \ - lib/crc32c.h lib/csum.c lib/csum.h lib/daemon.c lib/daemon.h \ - lib/daemon-private.h lib/dhcp.h lib/dummy.c lib/dummy.h \ - lib/dhparams.h lib/dirs.h lib/dpif-netdev.c lib/dpif-netdev.h \ - lib/dpif-provider.h lib/dpif.c lib/dpif.h lib/heap.c \ - lib/heap.h lib/dynamic-string.c lib/dynamic-string.h \ - lib/entropy.c lib/entropy.h lib/fat-rwlock.c lib/fat-rwlock.h \ - lib/fatal-signal.c lib/fatal-signal.h lib/flow.c lib/flow.h \ - lib/guarded-list.c lib/guarded-list.h lib/hash.c lib/hash.h \ - lib/hindex.c lib/hindex.h lib/hmap.c lib/hmap.h lib/hmapx.c \ - lib/hmapx.h lib/jhash.c lib/jhash.h lib/json.c lib/json.h \ - lib/jsonrpc.c lib/jsonrpc.h lib/lacp.c lib/lacp.h lib/latch.h \ - lib/learn.c lib/learn.h lib/learning-switch.c \ - lib/learning-switch.h lib/list.c lib/list.h lib/lockfile.c \ - lib/lockfile.h lib/mac-learning.c lib/mac-learning.h \ - lib/match.c lib/match.h lib/memory.c lib/memory.h \ - lib/meta-flow.c lib/meta-flow.h lib/multipath.c \ - lib/multipath.h lib/netdev-dummy.c lib/netdev-provider.h \ - lib/netdev-vport.c lib/netdev-vport.h lib/netdev.c \ - lib/netdev.h lib/netflow.h lib/netlink.c lib/netlink.h \ - lib/nx-match.c lib/nx-match.h lib/odp-execute.c \ - lib/odp-execute.h lib/odp-util.c lib/odp-util.h \ - lib/ofp-actions.c lib/ofp-actions.h lib/ofp-errors.c \ - lib/ofp-errors.h lib/ofp-msgs.c lib/ofp-msgs.h lib/ofp-parse.c \ - lib/ofp-parse.h lib/ofp-print.c lib/ofp-print.h lib/ofp-util.c \ - lib/ofp-util.def lib/ofp-util.h lib/ofp-version-opt.h \ - lib/ofp-version-opt.c lib/ofpbuf.c lib/ofpbuf.h \ - lib/ovs-atomic-c11.h lib/ovs-atomic-clang.h \ - lib/ovs-atomic-flag-gcc4.7+.h lib/ovs-atomic-gcc4+.h \ - lib/ovs-atomic-gcc4.7+.h lib/ovs-atomic-locked.c \ - lib/ovs-atomic-locked.h lib/ovs-atomic-pthreads.h \ - lib/ovs-atomic.h lib/ovs-rcu.c lib/ovs-rcu.h lib/ovs-thread.c \ - lib/ovs-thread.h lib/ovsdb-data.c lib/ovsdb-data.h \ - lib/ovsdb-error.c lib/ovsdb-error.h lib/ovsdb-idl-provider.h \ - lib/ovsdb-idl.c lib/ovsdb-idl.h lib/ovsdb-parser.c \ - lib/ovsdb-parser.h lib/ovsdb-types.c lib/ovsdb-types.h \ - lib/packets.c lib/packets.h lib/pcap-file.c lib/pcap-file.h \ - lib/poll-loop.c lib/poll-loop.h lib/process.c lib/process.h \ - lib/random.c lib/random.h lib/rconn.c lib/rconn.h \ - lib/reconnect.c lib/reconnect.h lib/sat-math.h lib/seq.c \ - lib/seq.h lib/sha1.c lib/sha1.h lib/shash.c lib/shash.h \ - lib/simap.c lib/simap.h lib/smap.c lib/smap.h \ - lib/socket-util.c lib/socket-util.h lib/sort.c lib/sort.h \ - lib/sset.c lib/sset.h lib/stp.c lib/stp.h lib/stream-fd.h \ - lib/stream-provider.h lib/stream-ssl.h lib/stream-tcp.c \ - lib/stream.c lib/stream.h lib/stdio.c lib/string.c lib/svec.c \ - lib/svec.h lib/table.c lib/table.h lib/tag.c lib/tag.h \ - lib/timer.c lib/timer.h lib/timeval.c lib/timeval.h \ - lib/token-bucket.c lib/token-bucket.h lib/type-props.h \ - lib/unaligned.h lib/unicode.c lib/unicode.h lib/unixctl.c \ - lib/unixctl.h lib/util.c lib/util.h lib/uuid.c lib/uuid.h \ - lib/valgrind.h lib/vconn-provider.h lib/vconn-stream.c \ - lib/vconn.c lib/vconn.h lib/vlan-bitmap.c lib/vlan-bitmap.h \ - lib/vlandev.c lib/vlandev.h lib/vlog.c lib/vlog.h \ - lib/vswitch-idl.c lib/vswitch-idl.h lib/vtep-idl.c \ - lib/vtep-idl.h lib/daemon-windows.c lib/getopt_long.c \ - lib/getrusage-windows.c lib/latch-windows.c \ - lib/route-table-stub.c lib/strsep.c lib/stream-fd-windows.c \ - lib/daemon-unix.c lib/latch-unix.c lib/signals.c lib/signals.h \ - lib/stream-fd-unix.c lib/stream-unix.c lib/dpif-linux.c \ - lib/dpif-linux.h lib/netdev-linux.c lib/netdev-linux.h \ - lib/netlink-notifier.c lib/netlink-notifier.h \ - lib/netlink-protocol.h lib/netlink-socket.c \ - lib/netlink-socket.h lib/rtnetlink-link.c lib/rtnetlink-link.h \ - lib/route-table.c lib/route-table.h lib/netdev-dpdk.c \ - lib/netdev-dpdk.h lib/async-append-aio.c \ - lib/async-append-null.c lib/netdev-bsd.c lib/rtbsd.c \ - lib/rtbsd.h lib/route-table-bsd.c lib/stream-ssl.c \ - lib/stream-nossl.c -am__dirstamp = $(am__leading_dot)dirstamp -@WIN32_TRUE@am__objects_1 = lib/daemon-windows.lo lib/getopt_long.lo \ -@WIN32_TRUE@ lib/getrusage-windows.lo lib/latch-windows.lo \ -@WIN32_TRUE@ lib/route-table-stub.lo lib/strsep.lo \ -@WIN32_TRUE@ lib/stream-fd-windows.lo -@WIN32_FALSE@am__objects_2 = lib/daemon-unix.lo lib/latch-unix.lo \ -@WIN32_FALSE@ lib/signals.lo lib/stream-fd-unix.lo \ -@WIN32_FALSE@ lib/stream-unix.lo -@LINUX_TRUE@am__objects_3 = lib/dpif-linux.lo lib/netdev-linux.lo \ -@LINUX_TRUE@ lib/netlink-notifier.lo lib/netlink-socket.lo \ -@LINUX_TRUE@ lib/rtnetlink-link.lo lib/route-table.lo -@DPDK_NETDEV_TRUE@am__objects_4 = lib/netdev-dpdk.lo -@HAVE_POSIX_AIO_TRUE@am__objects_5 = lib/async-append-aio.lo -@HAVE_POSIX_AIO_FALSE@am__objects_6 = lib/async-append-null.lo -@ESX_TRUE@am__objects_7 = lib/route-table-stub.lo -@HAVE_IF_DL_TRUE@am__objects_8 = lib/netdev-bsd.lo lib/rtbsd.lo \ -@HAVE_IF_DL_TRUE@ lib/route-table-bsd.lo -@HAVE_OPENSSL_TRUE@am__objects_9 = lib/stream-ssl.lo -@HAVE_OPENSSL_FALSE@am__objects_10 = lib/stream-nossl.lo -am_lib_libopenvswitch_la_OBJECTS = lib/aes128.lo lib/backtrace.lo \ - lib/bfd.lo lib/bitmap.lo lib/bundle.lo lib/byteq.lo lib/cfm.lo \ - lib/classifier.lo lib/command-line.lo lib/connectivity.lo \ - lib/coverage.lo lib/crc32c.lo lib/csum.lo lib/daemon.lo \ - lib/dummy.lo lib/dpif-netdev.lo lib/dpif.lo lib/heap.lo \ - lib/dynamic-string.lo lib/entropy.lo lib/fat-rwlock.lo \ - lib/fatal-signal.lo lib/flow.lo lib/guarded-list.lo \ - lib/hash.lo lib/hindex.lo lib/hmap.lo lib/hmapx.lo \ - lib/jhash.lo lib/json.lo lib/jsonrpc.lo lib/lacp.lo \ - lib/learn.lo lib/learning-switch.lo lib/list.lo \ - lib/lockfile.lo lib/mac-learning.lo lib/match.lo lib/memory.lo \ - lib/meta-flow.lo lib/multipath.lo lib/netdev-dummy.lo \ - lib/netdev-vport.lo lib/netdev.lo lib/netlink.lo \ - lib/nx-match.lo lib/odp-execute.lo lib/odp-util.lo \ - lib/ofp-actions.lo lib/ofp-errors.lo lib/ofp-msgs.lo \ - lib/ofp-parse.lo lib/ofp-print.lo lib/ofp-util.lo \ - lib/ofp-version-opt.lo lib/ofpbuf.lo lib/ovs-atomic-locked.lo \ - lib/ovs-rcu.lo lib/ovs-thread.lo lib/ovsdb-data.lo \ - lib/ovsdb-error.lo lib/ovsdb-idl.lo lib/ovsdb-parser.lo \ - lib/ovsdb-types.lo lib/packets.lo lib/pcap-file.lo \ - lib/poll-loop.lo lib/process.lo lib/random.lo lib/rconn.lo \ - lib/reconnect.lo lib/seq.lo lib/sha1.lo lib/shash.lo \ - lib/simap.lo lib/smap.lo lib/socket-util.lo lib/sort.lo \ - lib/sset.lo lib/stp.lo lib/stream-tcp.lo lib/stream.lo \ - lib/stdio.lo lib/string.lo lib/svec.lo lib/table.lo lib/tag.lo \ - lib/timer.lo lib/timeval.lo lib/token-bucket.lo lib/unicode.lo \ - lib/unixctl.lo lib/util.lo lib/uuid.lo lib/vconn-stream.lo \ - lib/vconn.lo lib/vlan-bitmap.lo lib/vlandev.lo lib/vlog.lo \ - lib/vswitch-idl.lo lib/vtep-idl.lo $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) $(am__objects_4) \ - $(am__objects_5) $(am__objects_6) $(am__objects_7) \ - $(am__objects_8) $(am__objects_9) $(am__objects_10) -@HAVE_OPENSSL_TRUE@am__objects_11 = lib/dhparams.lo -nodist_lib_libopenvswitch_la_OBJECTS = lib/dirs.lo $(am__objects_11) -lib_libopenvswitch_la_OBJECTS = $(am_lib_libopenvswitch_la_OBJECTS) \ - $(nodist_lib_libopenvswitch_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -lib_libopenvswitch_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(lib_libopenvswitch_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -lib_libsflow_la_LIBADD = -am_lib_libsflow_la_OBJECTS = lib/lib_libsflow_la-sflow_agent.lo \ - lib/lib_libsflow_la-sflow_sampler.lo \ - lib/lib_libsflow_la-sflow_poller.lo \ - lib/lib_libsflow_la-sflow_receiver.lo -lib_libsflow_la_OBJECTS = $(am_lib_libsflow_la_OBJECTS) -lib_libsflow_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(lib_libsflow_la_CFLAGS) $(CFLAGS) $(lib_libsflow_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -ofproto_libofproto_la_DEPENDENCIES = lib/libsflow.la \ - $(am__DEPENDENCIES_2) -am_ofproto_libofproto_la_OBJECTS = \ - ofproto/ofproto_libofproto_la-bond.lo \ - ofproto/ofproto_libofproto_la-collectors.lo \ - ofproto/ofproto_libofproto_la-connmgr.lo \ - ofproto/ofproto_libofproto_la-fail-open.lo \ - ofproto/ofproto_libofproto_la-in-band.lo \ - ofproto/ofproto_libofproto_la-names.lo \ - ofproto/ofproto_libofproto_la-netflow.lo \ - ofproto/ofproto_libofproto_la-ofproto.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo \ - ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo \ - ofproto/ofproto_libofproto_la-pktbuf.lo \ - ofproto/ofproto_libofproto_la-pinsched.lo \ - ofproto/ofproto_libofproto_la-tunnel.lo \ - ofproto/ofproto_libofproto_la-bundles.lo -ofproto_libofproto_la_OBJECTS = $(am_ofproto_libofproto_la_OBJECTS) -ofproto_libofproto_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) \ - $(ofproto_libofproto_la_LDFLAGS) $(LDFLAGS) -o $@ -ovsdb_libovsdb_la_LIBADD = -am_ovsdb_libovsdb_la_OBJECTS = ovsdb/ovsdb_libovsdb_la-column.lo \ - ovsdb/ovsdb_libovsdb_la-condition.lo \ - ovsdb/ovsdb_libovsdb_la-execution.lo \ - ovsdb/ovsdb_libovsdb_la-file.lo \ - ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo \ - ovsdb/ovsdb_libovsdb_la-log.lo \ - ovsdb/ovsdb_libovsdb_la-mutation.lo \ - ovsdb/ovsdb_libovsdb_la-ovsdb.lo \ - ovsdb/ovsdb_libovsdb_la-query.lo \ - ovsdb/ovsdb_libovsdb_la-row.lo \ - ovsdb/ovsdb_libovsdb_la-server.lo \ - ovsdb/ovsdb_libovsdb_la-table.lo \ - ovsdb/ovsdb_libovsdb_la-trigger.lo \ - ovsdb/ovsdb_libovsdb_la-transaction.lo -ovsdb_libovsdb_la_OBJECTS = $(am_ovsdb_libovsdb_la_OBJECTS) -ovsdb_libovsdb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) \ - $(ovsdb_libovsdb_la_LDFLAGS) $(LDFLAGS) -o $@ -@LINUX_TRUE@am__EXEEXT_1 = utilities/nlmon$(EXEEXT) -@LINUX_TRUE@am__EXEEXT_2 = utilities/ovs-vlan-bug-workaround$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS) -am_ovsdb_ovsdb_client_OBJECTS = ovsdb/ovsdb-client.$(OBJEXT) -ovsdb_ovsdb_client_OBJECTS = $(am_ovsdb_ovsdb_client_OBJECTS) -ovsdb_ovsdb_client_DEPENDENCIES = ovsdb/libovsdb.la \ - lib/libopenvswitch.la -am_ovsdb_ovsdb_server_OBJECTS = ovsdb/ovsdb-server.$(OBJEXT) -ovsdb_ovsdb_server_OBJECTS = $(am_ovsdb_ovsdb_server_OBJECTS) -ovsdb_ovsdb_server_DEPENDENCIES = ovsdb/libovsdb.la \ - lib/libopenvswitch.la -am_ovsdb_ovsdb_tool_OBJECTS = ovsdb/ovsdb-tool.$(OBJEXT) -ovsdb_ovsdb_tool_OBJECTS = $(am_ovsdb_ovsdb_tool_OBJECTS) -ovsdb_ovsdb_tool_DEPENDENCIES = ovsdb/libovsdb.la \ - lib/libopenvswitch.la -am__tests_ovstest_SOURCES_DIST = tests/ovstest.c tests/ovstest.h \ - tests/test-aes128.c tests/test-atomic.c tests/test-bundle.c \ - tests/test-byte-order.c tests/test-classifier.c \ - tests/test-csum.c tests/test-file_name.c tests/test-flows.c \ - tests/test-hash.c tests/test-heap.c tests/test-hindex.c \ - tests/test-hmap.c tests/test-json.c tests/test-jsonrpc.c \ - tests/test-list.c tests/test-lockfile.c tests/test-multipath.c \ - tests/test-netflow.c tests/test-odp.c tests/test-packets.c \ - tests/test-random.c tests/test-reconnect.c tests/test-sflow.c \ - tests/test-sha1.c tests/test-stp.c tests/test-util.c \ - tests/test-uuid.c tests/test-vconn.c tests/test-unix-socket.c -@WIN32_FALSE@am__objects_12 = tests/test-unix-socket.$(OBJEXT) -am_tests_ovstest_OBJECTS = tests/ovstest.$(OBJEXT) \ - tests/test-aes128.$(OBJEXT) tests/test-atomic.$(OBJEXT) \ - tests/test-bundle.$(OBJEXT) tests/test-byte-order.$(OBJEXT) \ - tests/test-classifier.$(OBJEXT) tests/test-csum.$(OBJEXT) \ - tests/test-file_name.$(OBJEXT) tests/test-flows.$(OBJEXT) \ - tests/test-hash.$(OBJEXT) tests/test-heap.$(OBJEXT) \ - tests/test-hindex.$(OBJEXT) tests/test-hmap.$(OBJEXT) \ - tests/test-json.$(OBJEXT) tests/test-jsonrpc.$(OBJEXT) \ - tests/test-list.$(OBJEXT) tests/test-lockfile.$(OBJEXT) \ - tests/test-multipath.$(OBJEXT) tests/test-netflow.$(OBJEXT) \ - tests/test-odp.$(OBJEXT) tests/test-packets.$(OBJEXT) \ - tests/test-random.$(OBJEXT) tests/test-reconnect.$(OBJEXT) \ - tests/test-sflow.$(OBJEXT) tests/test-sha1.$(OBJEXT) \ - tests/test-stp.$(OBJEXT) tests/test-util.$(OBJEXT) \ - tests/test-uuid.$(OBJEXT) tests/test-vconn.$(OBJEXT) \ - $(am__objects_12) -tests_ovstest_OBJECTS = $(am_tests_ovstest_OBJECTS) -tests_ovstest_DEPENDENCIES = lib/libopenvswitch.la -am_tests_test_controller_OBJECTS = tests/test-controller.$(OBJEXT) -tests_test_controller_OBJECTS = $(am_tests_test_controller_OBJECTS) -tests_test_controller_DEPENDENCIES = lib/libopenvswitch.la -am_tests_test_ovsdb_OBJECTS = tests/test-ovsdb.$(OBJEXT) \ - tests/idltest.$(OBJEXT) -tests_test_ovsdb_OBJECTS = $(am_tests_test_ovsdb_OBJECTS) -tests_test_ovsdb_DEPENDENCIES = ovsdb/libovsdb.la \ - lib/libopenvswitch.la -am_tests_test_strtok_r_OBJECTS = tests/test-strtok_r.$(OBJEXT) -tests_test_strtok_r_OBJECTS = $(am_tests_test_strtok_r_OBJECTS) -tests_test_strtok_r_LDADD = $(LDADD) -am_tests_test_type_props_OBJECTS = tests/test-type-props.$(OBJEXT) -tests_test_type_props_OBJECTS = $(am_tests_test_type_props_OBJECTS) -tests_test_type_props_LDADD = $(LDADD) -am__utilities_nlmon_SOURCES_DIST = utilities/nlmon.c -@LINUX_TRUE@am_utilities_nlmon_OBJECTS = utilities/nlmon.$(OBJEXT) -utilities_nlmon_OBJECTS = $(am_utilities_nlmon_OBJECTS) -@LINUX_TRUE@utilities_nlmon_DEPENDENCIES = lib/libopenvswitch.la -am_utilities_ovs_appctl_OBJECTS = utilities/ovs-appctl.$(OBJEXT) -utilities_ovs_appctl_OBJECTS = $(am_utilities_ovs_appctl_OBJECTS) -utilities_ovs_appctl_DEPENDENCIES = lib/libopenvswitch.la -am_utilities_ovs_benchmark_OBJECTS = \ - utilities/ovs-benchmark.$(OBJEXT) -utilities_ovs_benchmark_OBJECTS = \ - $(am_utilities_ovs_benchmark_OBJECTS) -utilities_ovs_benchmark_DEPENDENCIES = lib/libopenvswitch.la -am_utilities_ovs_dpctl_OBJECTS = utilities/ovs-dpctl.$(OBJEXT) -utilities_ovs_dpctl_OBJECTS = $(am_utilities_ovs_dpctl_OBJECTS) -utilities_ovs_dpctl_DEPENDENCIES = lib/libopenvswitch.la -am_utilities_ovs_ofctl_OBJECTS = utilities/ovs-ofctl.$(OBJEXT) -utilities_ovs_ofctl_OBJECTS = $(am_utilities_ovs_ofctl_OBJECTS) -utilities_ovs_ofctl_DEPENDENCIES = ofproto/libofproto.la \ - lib/libopenvswitch.la -am__utilities_ovs_vlan_bug_workaround_SOURCES_DIST = \ - utilities/ovs-vlan-bug-workaround.c -@LINUX_TRUE@am_utilities_ovs_vlan_bug_workaround_OBJECTS = \ -@LINUX_TRUE@ utilities/ovs-vlan-bug-workaround.$(OBJEXT) -utilities_ovs_vlan_bug_workaround_OBJECTS = \ - $(am_utilities_ovs_vlan_bug_workaround_OBJECTS) -@LINUX_TRUE@utilities_ovs_vlan_bug_workaround_DEPENDENCIES = \ -@LINUX_TRUE@ lib/libopenvswitch.la -am_utilities_ovs_vsctl_OBJECTS = utilities/ovs-vsctl.$(OBJEXT) -utilities_ovs_vsctl_OBJECTS = $(am_utilities_ovs_vsctl_OBJECTS) -utilities_ovs_vsctl_DEPENDENCIES = lib/libopenvswitch.la -am_vswitchd_ovs_vswitchd_OBJECTS = vswitchd/bridge.$(OBJEXT) \ - vswitchd/ovs-vswitchd.$(OBJEXT) \ - vswitchd/system-stats.$(OBJEXT) vswitchd/xenserver.$(OBJEXT) -vswitchd_ovs_vswitchd_OBJECTS = $(am_vswitchd_ovs_vswitchd_OBJECTS) -vswitchd_ovs_vswitchd_DEPENDENCIES = ofproto/libofproto.la \ - lib/libsflow.la lib/libopenvswitch.la -am_vtep_vtep_ctl_OBJECTS = vtep/vtep-ctl.$(OBJEXT) -vtep_vtep_ctl_OBJECTS = $(am_vtep_vtep_ctl_OBJECTS) -vtep_vtep_ctl_DEPENDENCIES = lib/libopenvswitch.la -SCRIPTS = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS) \ - $(dist_pkgdata_SCRIPTS) $(dist_sbin_SCRIPTS) \ - $(dist_scripts_SCRIPTS) $(noinst_SCRIPTS) $(sbin_SCRIPTS) \ - $(scripts_SCRIPTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(lib_libopenvswitch_la_SOURCES) \ - $(nodist_lib_libopenvswitch_la_SOURCES) \ - $(lib_libsflow_la_SOURCES) $(ofproto_libofproto_la_SOURCES) \ - $(ovsdb_libovsdb_la_SOURCES) $(ovsdb_ovsdb_client_SOURCES) \ - $(ovsdb_ovsdb_server_SOURCES) $(ovsdb_ovsdb_tool_SOURCES) \ - $(tests_ovstest_SOURCES) $(tests_test_controller_SOURCES) \ - $(tests_test_ovsdb_SOURCES) $(tests_test_strtok_r_SOURCES) \ - $(tests_test_type_props_SOURCES) $(utilities_nlmon_SOURCES) \ - $(utilities_ovs_appctl_SOURCES) \ - $(utilities_ovs_benchmark_SOURCES) \ - $(utilities_ovs_dpctl_SOURCES) $(utilities_ovs_ofctl_SOURCES) \ - $(utilities_ovs_vlan_bug_workaround_SOURCES) \ - $(utilities_ovs_vsctl_SOURCES) \ - $(vswitchd_ovs_vswitchd_SOURCES) $(vtep_vtep_ctl_SOURCES) -DIST_SOURCES = $(am__lib_libopenvswitch_la_SOURCES_DIST) \ - $(lib_libsflow_la_SOURCES) $(ofproto_libofproto_la_SOURCES) \ - $(ovsdb_libovsdb_la_SOURCES) $(ovsdb_ovsdb_client_SOURCES) \ - $(ovsdb_ovsdb_server_SOURCES) $(ovsdb_ovsdb_tool_SOURCES) \ - $(am__tests_ovstest_SOURCES_DIST) \ - $(tests_test_controller_SOURCES) $(tests_test_ovsdb_SOURCES) \ - $(tests_test_strtok_r_SOURCES) \ - $(tests_test_type_props_SOURCES) \ - $(am__utilities_nlmon_SOURCES_DIST) \ - $(utilities_ovs_appctl_SOURCES) \ - $(utilities_ovs_benchmark_SOURCES) \ - $(utilities_ovs_dpctl_SOURCES) $(utilities_ovs_ofctl_SOURCES) \ - $(am__utilities_ovs_vlan_bug_workaround_SOURCES_DIST) \ - $(utilities_ovs_vsctl_SOURCES) \ - $(vswitchd_ovs_vswitchd_SOURCES) $(vtep_vtep_ctl_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -man1dir = $(mandir)/man1 -man5dir = $(mandir)/man5 -man8dir = $(mandir)/man8 -NROFF = nroff -MANS = $(dist_man_MANS) $(man_MANS) -DATA = $(dist_pkgdata_DATA) $(dist_scripts_DATA) \ - $(nobase_pkgdata_DATA) $(noinst_DATA) $(pkgdata_DATA) \ - $(scripts_DATA) -am__noinst_HEADERS_DIST = BUILD.Windows CONTRIBUTING CodingStyle \ - DESIGN FAQ INSTALL INSTALL.Debian INSTALL.DPDK INSTALL.Fedora \ - INSTALL.KVM INSTALL.Libvirt INSTALL.NetBSD INSTALL.RHEL \ - INSTALL.SSL INSTALL.XenServer INSTALL.userspace \ - IntegrationGuide NOTICE OPENFLOW-1.1+ PORTING README-lisp \ - REPORTING-BUGS TODO WHY-OVS boot.sh build-aux/cccl \ - build-aux/sodepends.pl build-aux/soexpand.pl lib/common.man \ - lib/common-syn.man lib/coverage-unixctl.man lib/daemon.man \ - lib/daemon-syn.man lib/memory-unixctl.man lib/ofp-version.man \ - lib/ovs.tmac lib/service.man lib/service-syn.man \ - lib/ssl-bootstrap.man lib/ssl-bootstrap-syn.man \ - lib/ssl-peer-ca-cert.man lib/ssl.man lib/ssl-syn.man \ - lib/table.man lib/unixctl.man lib/unixctl-syn.man \ - lib/vconn-active.man lib/vconn-passive.man \ - lib/vlog-unixctl.man lib/vlog-syn.man lib/vlog.man \ - ofproto/ofproto-unixctl.man ofproto/ofproto-dpif-unixctl.man \ - utilities/ovs-vlan-bugs.man ovsdb/remote-active.man \ - ovsdb/remote-passive.man utilities/ovs-appctl.8.in \ - utilities/ovs-benchmark.1.in utilities/ovs-ctl.8 \ - utilities/ovs-dpctl.8.in utilities/ovs-dpctl-top.8.in \ - utilities/ovs-l3ping.8.in utilities/ovs-ofctl.8.in \ - utilities/ovs-parse-backtrace.8 utilities/ovs-pcap.1.in \ - utilities/ovs-pki.8.in utilities/ovs-tcpundump.1.in \ - utilities/ovs-vlan-bug-workaround.8.in utilities/ovs-test.8.in \ - utilities/ovs-vlan-test.8.in utilities/ovs-vsctl.8.in \ - utilities/bugtool/ovs-bugtool.8.in tests/test-controller.8.in \ - vswitchd/ovs-vswitchd.8.in ovsdb/ovsdb-tool.1.in \ - ovsdb/ovsdb-client.1.in ovsdb/ovsdb-server.1.in \ - ovsdb/ovsdb-idlc.1 vtep/vtep-ctl.8.in \ - build-aux/thread-safety-blacklist m4/absolute-header.m4 \ - m4/include_next.m4 lib/stdio.h.in lib/string.h.in \ - lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem lib/dirs.c.in \ - $(srcdir)/lib/vswitch-idl.ann $(srcdir)/lib/vtep-idl.ann \ - build-aux/extract-ofp-errors lib/ofp-errors.inc \ - build-aux/extract-ofp-msgs lib/ofp-msgs.inc ofproto/ipfix.xml \ - utilities/ovs-check-dead-ifs.in utilities/ovs-ctl.in \ - utilities/ovs-dev.py utilities/ovs-dpctl-top.in \ - utilities/ovs-l3ping.in utilities/ovs-lib.in \ - utilities/ovs-parse-backtrace.in utilities/ovs-pcap.in \ - utilities/ovs-pki.in utilities/ovs-save \ - utilities/ovs-tcpundump.in utilities/ovs-test.in \ - utilities/ovs-vlan-test.in \ - utilities/bugtool/plugins/kernel-info/openvswitch.xml \ - utilities/bugtool/plugins/network-status/openvswitch.xml \ - utilities/bugtool/plugins/system-configuration.xml \ - utilities/bugtool/plugins/system-logs/openvswitch.xml \ - utilities/bugtool/plugins/system-configuration/openvswitch.xml \ - utilities/bugtool/ovs-bugtool-bfd-show \ - utilities/bugtool/ovs-bugtool-cfm-show \ - utilities/bugtool/ovs-bugtool-coverage-show \ - utilities/bugtool/ovs-bugtool-lacp-show \ - utilities/bugtool/ovs-bugtool-list-dbs \ - utilities/bugtool/ovs-bugtool-memory-show \ - utilities/bugtool/ovs-bugtool-tc-class-show \ - utilities/bugtool/ovs-bugtool-vsctl-show \ - utilities/bugtool/ovs-bugtool-ovsdb-dump \ - utilities/bugtool/ovs-bugtool-daemons-ver \ - utilities/bugtool/ovs-bugtool-ovs-ofctl-show \ - utilities/bugtool/ovs-bugtool-ovs-ofctl-dump-flows \ - utilities/bugtool/ovs-bugtool-ovs-appctl-dpif \ - utilities/bugtool/ovs-bugtool-bond-show \ - utilities/bugtool/ovs-bugtool.in tests/testsuite.at \ - tests/ovsdb-macros.at tests/library.at tests/heap.at \ - tests/bundle.at tests/classifier.at tests/check-structs.at \ - tests/daemon.at tests/daemon-py.at tests/ofp-actions.at \ - tests/ofp-print.at tests/ofp-util.at tests/ofp-errors.at \ - tests/ovs-ofctl.at tests/odp.at tests/multipath.at \ - tests/bfd.at tests/cfm.at tests/lacp.at tests/learn.at \ - tests/vconn.at tests/file_name.at tests/aes128.at \ - tests/unixctl-py.at tests/uuid.at tests/json.at \ - tests/jsonrpc.at tests/jsonrpc-py.at tests/tunnel.at \ - tests/lockfile.at tests/reconnect.at tests/ovs-vswitchd.at \ - tests/ofproto-dpif.at tests/vlan-splinters.at \ - tests/ofproto-macros.at tests/ofproto.at tests/ovsdb.at \ - tests/ovsdb-log.at tests/ovsdb-types.at tests/ovsdb-data.at \ - tests/ovsdb-column.at tests/ovsdb-table.at tests/ovsdb-row.at \ - tests/ovsdb-schema.at tests/ovsdb-condition.at \ - tests/ovsdb-mutation.at tests/ovsdb-query.at \ - tests/ovsdb-transaction.at tests/ovsdb-execution.at \ - tests/ovsdb-trigger.at tests/ovsdb-tool.at \ - tests/ovsdb-server.at tests/ovsdb-monitor.at \ - tests/ovsdb-idl.at tests/ovs-vsctl.at \ - tests/ovs-monitor-ipsec.at tests/ovs-xapi-sync.at tests/stp.at \ - tests/interface-reconfigure.at tests/vlog.at tests/vtep-ctl.at \ - $(srcdir)/tests/testsuite tests/atlocal.in \ - $(srcdir)/package.m4 tests/valgrind-wrapper.in \ - tests/glibc.supp tests/openssl.supp tests/run-oftest \ - tests/run-ryu tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl \ - tests/idltest.ovsschema tests/idltest.ann tests/appctl.py \ - tests/test-daemon.py tests/test-json.py tests/test-jsonrpc.py \ - tests/test-ovsdb.py tests/test-reconnect.py \ - tests/MockXenAPI.py tests/test-unix-socket.py \ - tests/test-unixctl.py tests/test-vlog.py \ - build-aux/check-structs third-party/README \ - third-party/ofp-tcpdump.patch debian/changelog debian/compat \ - debian/control debian/control.modules.in debian/copyright \ - debian/copyright.in debian/dkms.conf.in debian/dirs \ - debian/openvswitch-common.dirs debian/openvswitch-common.docs \ - debian/openvswitch-common.install \ - debian/openvswitch-common.manpages \ - debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in \ - debian/openvswitch-datapath-dkms.postinst \ - debian/openvswitch-datapath-dkms.prerm \ - debian/openvswitch-datapath-source.README.Debian \ - debian/openvswitch-datapath-source.copyright \ - debian/openvswitch-datapath-source.dirs \ - debian/openvswitch-datapath-source.install \ - debian/openvswitch-ipsec.dirs debian/openvswitch-ipsec.init \ - debian/openvswitch-ipsec.install debian/openvswitch-pki.dirs \ - debian/openvswitch-pki.postinst debian/openvswitch-pki.postrm \ - debian/openvswitch-switch.README.Debian \ - debian/openvswitch-switch.dirs debian/openvswitch-switch.init \ - debian/openvswitch-switch.install \ - debian/openvswitch-switch.logrotate \ - debian/openvswitch-switch.manpages \ - debian/openvswitch-switch.postinst \ - debian/openvswitch-switch.postrm \ - debian/openvswitch-switch.template \ - debian/openvswitch-switch.links debian/openvswitch-test.dirs \ - debian/openvswitch-test.install \ - debian/openvswitch-test.manpages \ - debian/openvswitch-vtep.default debian/openvswitch-vtep.dirs \ - debian/openvswitch-vtep.init debian/openvswitch-vtep.install \ - debian/openvswitch-vtep.manpages debian/ovs-monitor-ipsec \ - debian/python-openvswitch.dirs \ - debian/python-openvswitch.install debian/rules \ - debian/rules.modules debian/ifupdown.sh debian/source/format \ - vswitchd/INTERNALS vswitchd/vswitch.ovsschema \ - vswitchd/vswitch.xml ovsdb/ovsdb-idlc.in \ - $(srcdir)/lib/vswitch-idl.c $(srcdir)/lib/vswitch-idl.h \ - $(srcdir)/lib/vswitch-idl.ovsidl $(srcdir)/lib/vtep-idl.c \ - $(srcdir)/lib/vtep-idl.h $(srcdir)/lib/vtep-idl.ovsidl \ - tests/idltest.c tests/idltest.h tests/idltest.ovsidl \ - ovsdb/ovsdb-doc ovsdb/ovsdb-dot.in ovsdb/dot2pic \ - rhel/README.RHEL rhel/automake.mk rhel/etc_init.d_openvswitch \ - rhel/etc_logrotate.d_openvswitch \ - rhel/etc_sysconfig_network-scripts_ifdown-ovs \ - rhel/etc_sysconfig_network-scripts_ifup-ovs \ - rhel/openvswitch-kmod-rhel6.spec \ - rhel/openvswitch-kmod-rhel6.spec.in \ - rhel/openvswitch-kmod.files rhel/openvswitch-kmod-fedora.spec \ - rhel/openvswitch-kmod-fedora.spec.in rhel/openvswitch.spec \ - rhel/openvswitch.spec.in rhel/openvswitch-fedora.spec \ - rhel/openvswitch-fedora.spec.in \ - rhel/usr_share_openvswitch_scripts_sysconfig.template \ - rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ - rhel/usr_lib_systemd_system_openvswitch.service \ - rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \ - xenserver/GPLv2 xenserver/LICENSE xenserver/README \ - xenserver/automake.mk xenserver/etc_init.d_openvswitch \ - xenserver/etc_init.d_openvswitch-xapi-update \ - xenserver/etc_logrotate.d_openvswitch \ - xenserver/etc_profile.d_openvswitch.sh \ - xenserver/etc_xapi.d_plugins_openvswitch-cfg-update \ - xenserver/etc_xensource_scripts_vif \ - xenserver/openvswitch-xen.spec \ - xenserver/openvswitch-xen.spec.in \ - xenserver/opt_xensource_libexec_InterfaceReconfigure.py \ - xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \ - xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \ - xenserver/opt_xensource_libexec_interface-reconfigure \ - xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \ - xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync \ - xenserver/usr_share_openvswitch_scripts_sysconfig.template \ - python/ovs/__init__.py python/ovs/daemon.py \ - python/ovs/db/__init__.py python/ovs/db/data.py \ - python/ovs/db/error.py python/ovs/db/idl.py \ - python/ovs/db/parser.py python/ovs/db/schema.py \ - python/ovs/db/types.py python/ovs/fatal_signal.py \ - python/ovs/json.py python/ovs/jsonrpc.py python/ovs/ovsuuid.py \ - python/ovs/poller.py python/ovs/process.py \ - python/ovs/reconnect.py python/ovs/socket_util.py \ - python/ovs/stream.py python/ovs/timeval.py \ - python/ovs/unixctl/__init__.py python/ovs/unixctl/client.py \ - python/ovs/unixctl/server.py python/ovs/util.py \ - python/ovs/version.py python/ovs/vlog.py python/ovs/dirs.py \ - python/ovstest/__init__.py python/ovstest/args.py \ - python/ovstest/rpcserver.py python/ovstest/tcp.py \ - python/ovstest/tests.py python/ovstest/udp.py \ - python/ovstest/util.py python/ovstest/vswitch.py \ - python/ovs/dirs.py.template python/compat/uuid.py \ - python/compat/argparse.py tutorial/Tutorial \ - tutorial/ovs-sandbox tutorial/t-setup tutorial/t-stage0 \ - tutorial/t-stage1 tutorial/t-stage2 tutorial/t-stage3 \ - tutorial/t-stage4 vtep/ovs-vtep vtep/README.ovs-vtep \ - vtep/vtep.ovsschema vtep/vtep.xml include/linux/if_ether.h \ - include/linux/openvswitch.h include/linux/types.h \ - include/openflow/nicira-ext.h include/openflow/openflow-1.0.h \ - include/openflow/openflow-1.1.h \ - include/openflow/openflow-1.2.h \ - include/openflow/openflow-1.3.h \ - include/openflow/openflow-1.4.h \ - include/openflow/openflow-common.h include/openflow/openflow.h \ - include/openvswitch/types.h include/sparse/arpa/inet.h \ - include/sparse/assert.h include/sparse/math.h \ - include/sparse/netinet/in.h include/sparse/netinet/ip6.h \ - include/sparse/netpacket/packet.h include/sparse/pthread.h \ - include/sparse/sys/socket.h include/sparse/sys/wait.h \ - include/windows/arpa/inet.h include/windows/dirent.h \ - include/windows/getopt.h include/windows/net/if.h \ - include/windows/netdb.h include/windows/netinet/icmp6.h \ - include/windows/netinet/in.h \ - include/windows/netinet/in_systm.h \ - include/windows/netinet/ip.h include/windows/netinet/ip6.h \ - include/windows/netinet/tcp.h include/windows/poll.h \ - include/windows/strings.h include/windows/syslog.h \ - include/windows/sys/ioctl.h include/windows/sys/resource.h \ - include/windows/sys/socket.h include/windows/sys/time.h \ - include/windows/sys/uio.h include/windows/sys/un.h \ - include/windows/sys/wait.h include/windows/unistd.h \ - include/windows/windefs.h -HEADERS = $(noinst_HEADERS) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOM4TE = @AUTOM4TE@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CGCCFLAGS = @CGCCFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DBDIR = @DBDIR@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_OPENSSL = @HAVE_OPENSSL@ -HAVE_PYTHON = @HAVE_PYTHON@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KARCH = @KARCH@ -KBUILD = @KBUILD@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LOGDIR = @LOGDIR@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ -NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ -NEXT_STDIO_H = @NEXT_STDIO_H@ -NEXT_STRING_H = @NEXT_STRING_H@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PKG_CONFIG = @PKG_CONFIG@ -PKIDIR = @PKIDIR@ -PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ -PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ -PTHREAD_INCLUDES = @PTHREAD_INCLUDES@ -PTHREAD_LDFLAGS = @PTHREAD_LDFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -PYTHON = @PYTHON@ -RANLIB = @RANLIB@ -RUNDIR = @RUNDIR@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SPARSE = @SPARSE@ -SPARSEFLAGS = @SPARSEFLAGS@ -SPARSE_EXTRA_INCLUDES = @SPARSE_EXTRA_INCLUDES@ -SSL_INCLUDES = @SSL_INCLUDES@ -SSL_LDFLAGS = @SSL_LDFLAGS@ -SSL_LIBS = @SSL_LIBS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WARNING_FLAGS = @WARNING_FLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = foreign subdir-objects -ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = datapath -AM_CPPFLAGS = $(SSL_CFLAGS) $(am__append_1) -I $(top_srcdir)/include \ - -I $(top_srcdir)/lib -I $(top_builddir)/lib $(SSL_INCLUDES) \ - $(am__append_3) -AM_LDFLAGS = $(SSL_LDFLAGS) $(am__append_2) -AM_CFLAGS = -Wstrict-prototypes $(WARNING_FLAGS) $(am__append_4) -@WIN32_FALSE@psep = ":" -@WIN32_TRUE@psep = ";" -@INCLUDE_PYTHON_COMPAT_FALSE@run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \ -@INCLUDE_PYTHON_COMPAT_FALSE@ PYTHONDONTWRITEBYTECODE=yes \ -@INCLUDE_PYTHON_COMPAT_FALSE@ $(PYTHON) -# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo -# files. Creating .py[co] works OK for any given version of Open -# vSwitch, but it causes trouble if you switch from a version with -# foo/__init__.py into an (older) version with plain foo.py, since -# foo/__init__.pyc will cause Python to ignore foo.py. -@INCLUDE_PYTHON_COMPAT_TRUE@run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$(top_srcdir)/python/compat$(psep)$$PYTHONPATH \ -@INCLUDE_PYTHON_COMPAT_TRUE@ PYTHONDONTWRITEBYTECODE=yes \ -@INCLUDE_PYTHON_COMPAT_TRUE@ $(PYTHON) - -# Check that every .c file includes . - -# Check for printf() type modifiers that MSVC doesn't support. - -# Check that certain data structures are always declared "static". - -# Check that assert.h is not used outside a whitelist of files. - -# Version checking for vswitch.ovsschema. - -# Version checking for vtep.ovsschema. -ALL_LOCAL = $(am__append_5) config-h-check printf-check static-check \ - check-assert-h-usage thread-safety-check $(am__append_7) \ - $(am__append_41) check-debian-changelog-version \ - vswitchd/vswitch.ovsschema.stamp \ - $(srcdir)/python/ovs/version.py $(srcdir)/python/ovs/dirs.py \ - vtep/vtep.ovsschema.stamp -BUILT_SOURCES = ofproto/ipfix-entities.def $(OVSIDL_BUILT) - -# Clean up generated files from older OVS versions. (This is important so that -# #include "vswitch-idl.h" doesn't get the wrong copy.) -CLEANFILES = $(am__append_6) $(am__append_8) manpage-dep-check \ - $(nodist_lib_libopenvswitch_la_SOURCES) \ - ofproto/ipfix-entities.def $(am__append_28) \ - $(valgrind_wrappers) $(am__append_37) $(am__append_40) \ - vswitchd/vswitch.ovsschema.stamp vswitchd/vswitch-idl.c \ - vswitchd/vswitch-idl.h vtep/vtep.ovsschema.stamp -CLEAN_LOCAL = clean-pycov $(am__append_38) -DISTCLEANFILES = utilities/ovs-appctl.8 utilities/ovs-ctl \ - utilities/ovs-benchmark.1 utilities/ovs-check-dead-ifs \ - utilities/ovs-dpctl.8 utilities/ovs-dpctl-top \ - utilities/ovs-dpctl-top.8 utilities/ovs-l3ping \ - utilities/ovs-l3ping.8 utilities/ovs-lib utilities/ovs-ofctl.8 \ - utilities/ovs-parse-backtrace utilities/ovs-pcap \ - utilities/ovs-pcap.1 utilities/ovs-pki utilities/ovs-pki.8 \ - utilities/ovs-tcpundump utilities/ovs-tcpundump.1 \ - utilities/ovs-test utilities/ovs-test.8 \ - utilities/ovs-vlan-test utilities/ovs-vlan-test.8 \ - utilities/ovs-vlan-bug-workaround.8 utilities/ovs-vsctl.8 \ - $(am__append_31) tests/atconfig tests/atlocal \ - tests/test-controller.8 debian/copyright \ - vswitchd/ovs-vswitchd.8 $(am__append_42) \ - vswitchd/ovs-vswitchd.conf.db.5 ovsdb/ovsdb-tool.1 \ - ovsdb/ovsdb-client.1 ovsdb/ovsdb-server.1 ovsdb/ovsdb-idlc \ - ovsdb/ovsdb-dot vtep/vtep-ctl.8 $(am__append_43) vtep/vtep.5 -PYCOV_CLEAN_FILES = build-aux/check-structs,cover \ - $(CHECK_PYFILES:.py=.py,cover) .coverage \ - $(PYFILES:.py=.py,cover) - -# IPFIX entity definition macros generation from IANA's XML definition. - -# vswitch schema and IDL - -# vswitch schema documentation - -# ovsdb-doc - -# ovsdb-dot - -# VTEP schema and IDL - -# VTEP schema documentation -EXTRA_DIST = BUILD.Windows CONTRIBUTING CodingStyle DESIGN FAQ INSTALL \ - INSTALL.Debian INSTALL.DPDK INSTALL.Fedora INSTALL.KVM \ - INSTALL.Libvirt INSTALL.NetBSD INSTALL.RHEL INSTALL.SSL \ - INSTALL.XenServer INSTALL.userspace IntegrationGuide NOTICE \ - OPENFLOW-1.1+ PORTING README-lisp REPORTING-BUGS TODO WHY-OVS \ - boot.sh build-aux/cccl build-aux/sodepends.pl \ - build-aux/soexpand.pl $(MAN_FRAGMENTS) $(MAN_ROOTS) \ - build-aux/thread-safety-blacklist m4/absolute-header.m4 \ - m4/include_next.m4 lib/stdio.h.in lib/string.h.in \ - lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem lib/dirs.c.in \ - $(srcdir)/lib/vswitch-idl.ann $(srcdir)/lib/vtep-idl.ann \ - build-aux/extract-ofp-errors lib/ofp-errors.inc \ - build-aux/extract-ofp-msgs lib/ofp-msgs.inc ofproto/ipfix.xml \ - utilities/ovs-check-dead-ifs.in utilities/ovs-ctl.in \ - utilities/ovs-dev.py utilities/ovs-dpctl-top.in \ - utilities/ovs-l3ping.in utilities/ovs-lib.in \ - utilities/ovs-parse-backtrace.in utilities/ovs-pcap.in \ - utilities/ovs-pki.in utilities/ovs-save \ - utilities/ovs-tcpundump.in utilities/ovs-test.in \ - utilities/ovs-vlan-test.in $(bugtool_plugins) \ - $(bugtool_scripts) utilities/bugtool/ovs-bugtool.in \ - $(TESTSUITE_AT) $(TESTSUITE) tests/atlocal.in \ - $(srcdir)/package.m4 $(srcdir)/tests/testsuite \ - tests/valgrind-wrapper.in tests/glibc.supp tests/openssl.supp \ - tests/run-oftest tests/run-ryu tests/uuidfilt.pl \ - tests/ovsdb-monitor-sort.pl $(IDLTEST_IDL_FILES) \ - $(CHECK_PYFILES) build-aux/check-structs third-party/README \ - third-party/ofp-tcpdump.patch debian/changelog debian/compat \ - debian/control debian/control.modules.in debian/copyright \ - debian/copyright.in debian/dkms.conf.in debian/dirs \ - debian/openvswitch-common.dirs debian/openvswitch-common.docs \ - debian/openvswitch-common.install \ - debian/openvswitch-common.manpages \ - debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in \ - debian/openvswitch-datapath-dkms.postinst \ - debian/openvswitch-datapath-dkms.prerm \ - debian/openvswitch-datapath-source.README.Debian \ - debian/openvswitch-datapath-source.copyright \ - debian/openvswitch-datapath-source.dirs \ - debian/openvswitch-datapath-source.install \ - debian/openvswitch-ipsec.dirs debian/openvswitch-ipsec.init \ - debian/openvswitch-ipsec.install debian/openvswitch-pki.dirs \ - debian/openvswitch-pki.postinst debian/openvswitch-pki.postrm \ - debian/openvswitch-switch.README.Debian \ - debian/openvswitch-switch.dirs debian/openvswitch-switch.init \ - debian/openvswitch-switch.install \ - debian/openvswitch-switch.logrotate \ - debian/openvswitch-switch.manpages \ - debian/openvswitch-switch.postinst \ - debian/openvswitch-switch.postrm \ - debian/openvswitch-switch.template \ - debian/openvswitch-switch.links debian/openvswitch-test.dirs \ - debian/openvswitch-test.install \ - debian/openvswitch-test.manpages \ - debian/openvswitch-vtep.default debian/openvswitch-vtep.dirs \ - debian/openvswitch-vtep.init debian/openvswitch-vtep.install \ - debian/openvswitch-vtep.manpages debian/ovs-monitor-ipsec \ - debian/python-openvswitch.dirs \ - debian/python-openvswitch.install debian/rules \ - debian/rules.modules debian/ifupdown.sh debian/source/format \ - vswitchd/INTERNALS vswitchd/vswitch.ovsschema \ - vswitchd/vswitch.xml ovsdb/ovsdb-idlc.in $(OVSIDL_BUILT) \ - ovsdb/ovsdb-doc ovsdb/ovsdb-dot.in ovsdb/dot2pic \ - rhel/README.RHEL rhel/automake.mk rhel/etc_init.d_openvswitch \ - rhel/etc_logrotate.d_openvswitch \ - rhel/etc_sysconfig_network-scripts_ifdown-ovs \ - rhel/etc_sysconfig_network-scripts_ifup-ovs \ - rhel/openvswitch-kmod-rhel6.spec \ - rhel/openvswitch-kmod-rhel6.spec.in \ - rhel/openvswitch-kmod.files rhel/openvswitch-kmod-fedora.spec \ - rhel/openvswitch-kmod-fedora.spec.in rhel/openvswitch.spec \ - rhel/openvswitch.spec.in rhel/openvswitch-fedora.spec \ - rhel/openvswitch-fedora.spec.in \ - rhel/usr_share_openvswitch_scripts_sysconfig.template \ - rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ - rhel/usr_lib_systemd_system_openvswitch.service \ - rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \ - xenserver/GPLv2 xenserver/LICENSE xenserver/README \ - xenserver/automake.mk xenserver/etc_init.d_openvswitch \ - xenserver/etc_init.d_openvswitch-xapi-update \ - xenserver/etc_logrotate.d_openvswitch \ - xenserver/etc_profile.d_openvswitch.sh \ - xenserver/etc_xapi.d_plugins_openvswitch-cfg-update \ - xenserver/etc_xensource_scripts_vif \ - xenserver/openvswitch-xen.spec \ - xenserver/openvswitch-xen.spec.in \ - xenserver/opt_xensource_libexec_InterfaceReconfigure.py \ - xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \ - xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \ - xenserver/opt_xensource_libexec_interface-reconfigure \ - xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \ - xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync \ - xenserver/usr_share_openvswitch_scripts_sysconfig.template \ - $(PYFILES) python/ovs/dirs.py python/ovs/dirs.py.template \ - python/compat/uuid.py python/compat/argparse.py \ - tutorial/Tutorial tutorial/ovs-sandbox tutorial/t-setup \ - tutorial/t-stage0 tutorial/t-stage1 tutorial/t-stage2 \ - tutorial/t-stage3 tutorial/t-stage4 vtep/ovs-vtep \ - vtep/README.ovs-vtep vtep/vtep.ovsschema vtep/vtep.xml -bin_SCRIPTS = utilities/ovs-pki $(am__append_24) -DIST_HOOKS = check-debian-changelog-version -dist_man_MANS = vtep/vtep.5 -dist_pkgdata_DATA = -dist_pkgdata_SCRIPTS = -dist_sbin_SCRIPTS = -dist_scripts_SCRIPTS = -dist_scripts_DATA = -INSTALL_DATA_LOCAL = lib-install-data-local $(am__append_33) -UNINSTALL_LOCAL = $(am__append_34) ovs-uninstall-local -# ovsdb-tool.1 -# ovsdb-client.1 -# ovsdb-server.1 -man_MANS = utilities/ovs-appctl.8 utilities/ovs-benchmark.1 \ - utilities/ovs-ctl.8 utilities/ovs-dpctl.8 \ - utilities/ovs-dpctl-top.8 utilities/ovs-l3ping.8 \ - utilities/ovs-ofctl.8 utilities/ovs-parse-backtrace.8 \ - utilities/ovs-pcap.1 utilities/ovs-pki.8 \ - utilities/ovs-tcpundump.1 utilities/ovs-vlan-bug-workaround.8 \ - utilities/ovs-test.8 utilities/ovs-vlan-test.8 \ - utilities/ovs-vsctl.8 $(am__append_29) vswitchd/ovs-vswitchd.8 \ - vswitchd/ovs-vswitchd.conf.db.5 ovsdb/ovsdb-tool.1 \ - ovsdb/ovsdb-client.1 ovsdb/ovsdb-server.1 vtep/vtep-ctl.8 -MAN_FRAGMENTS = lib/common.man lib/common-syn.man \ - lib/coverage-unixctl.man lib/daemon.man lib/daemon-syn.man \ - lib/memory-unixctl.man lib/ofp-version.man lib/ovs.tmac \ - lib/service.man lib/service-syn.man lib/ssl-bootstrap.man \ - lib/ssl-bootstrap-syn.man lib/ssl-peer-ca-cert.man lib/ssl.man \ - lib/ssl-syn.man lib/table.man lib/unixctl.man \ - lib/unixctl-syn.man lib/vconn-active.man lib/vconn-passive.man \ - lib/vlog-unixctl.man lib/vlog-syn.man lib/vlog.man \ - ofproto/ofproto-unixctl.man ofproto/ofproto-dpif-unixctl.man \ - utilities/ovs-vlan-bugs.man ovsdb/remote-active.man \ - ovsdb/remote-passive.man -MAN_ROOTS = utilities/ovs-appctl.8.in utilities/ovs-benchmark.1.in \ - utilities/ovs-ctl.8 utilities/ovs-dpctl.8.in \ - utilities/ovs-dpctl-top.8.in utilities/ovs-l3ping.8.in \ - utilities/ovs-ofctl.8.in utilities/ovs-parse-backtrace.8 \ - utilities/ovs-pcap.1.in utilities/ovs-pki.8.in \ - utilities/ovs-tcpundump.1.in \ - utilities/ovs-vlan-bug-workaround.8.in utilities/ovs-test.8.in \ - utilities/ovs-vlan-test.8.in utilities/ovs-vsctl.8.in \ - $(am__append_30) tests/test-controller.8.in \ - vswitchd/ovs-vswitchd.8.in ovsdb/ovsdb-tool.1.in \ - ovsdb/ovsdb-client.1.in ovsdb/ovsdb-server.1.in \ - ovsdb/ovsdb-idlc.1 vtep/vtep-ctl.8.in -noinst_DATA = - -# This ensures that files added to EXTRA_DIST are always distributed, -# even if they are inside an Automake if...endif conditional block that is -# disabled by some particular "configure" run. For more information, see: -# http://article.gmane.org/gmane.comp.sysutils.automake.general/10891 -noinst_HEADERS = $(EXTRA_DIST) include/linux/if_ether.h \ - include/linux/openvswitch.h include/linux/types.h \ - include/openflow/nicira-ext.h include/openflow/openflow-1.0.h \ - include/openflow/openflow-1.1.h \ - include/openflow/openflow-1.2.h \ - include/openflow/openflow-1.3.h \ - include/openflow/openflow-1.4.h \ - include/openflow/openflow-common.h include/openflow/openflow.h \ - include/openvswitch/types.h include/sparse/arpa/inet.h \ - include/sparse/assert.h include/sparse/math.h \ - include/sparse/netinet/in.h include/sparse/netinet/ip6.h \ - include/sparse/netpacket/packet.h include/sparse/pthread.h \ - include/sparse/sys/socket.h include/sparse/sys/wait.h \ - include/windows/arpa/inet.h include/windows/dirent.h \ - include/windows/getopt.h include/windows/net/if.h \ - include/windows/netdb.h include/windows/netinet/icmp6.h \ - include/windows/netinet/in.h \ - include/windows/netinet/in_systm.h \ - include/windows/netinet/ip.h include/windows/netinet/ip6.h \ - include/windows/netinet/tcp.h include/windows/poll.h \ - include/windows/strings.h include/windows/syslog.h \ - include/windows/sys/ioctl.h include/windows/sys/resource.h \ - include/windows/sys/socket.h include/windows/sys/time.h \ - include/windows/sys/uio.h include/windows/sys/un.h \ - include/windows/sys/wait.h include/windows/unistd.h \ - include/windows/windefs.h - -# libovsdb -lib_LTLIBRARIES = lib/libopenvswitch.la lib/libsflow.la \ - ofproto/libofproto.la ovsdb/libovsdb.la -noinst_man_MANS = tests/test-controller.8 - -# ovsdb-idlc -noinst_SCRIPTS = ovsdb/ovsdb-idlc ovsdb/ovsdb-dot - -# vswitch IDL - -# idltest schema and IDL -OVSIDL_BUILT = $(srcdir)/lib/vswitch-idl.c $(srcdir)/lib/vswitch-idl.h \ - $(srcdir)/lib/vswitch-idl.ovsidl $(srcdir)/lib/vtep-idl.c \ - $(srcdir)/lib/vtep-idl.h $(srcdir)/lib/vtep-idl.ovsidl \ - tests/idltest.c tests/idltest.h tests/idltest.ovsidl -pkgdata_DATA = vswitchd/vswitch.ovsschema vtep/vtep.ovsschema -sbin_SCRIPTS = $(am__append_27) - -# ovs-vtep -scripts_SCRIPTS = utilities/ovs-check-dead-ifs utilities/ovs-ctl \ - utilities/ovs-save $(am__append_32) vtep/ovs-vtep -scripts_DATA = utilities/ovs-lib -SUFFIXES = .in $(am__append_39) .ovsidl .ovsschema -check_DATA = $(am__append_36) -scriptsdir = $(pkgdatadir)/scripts -ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */' -ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n' -lib_libopenvswitch_la_LIBADD = $(SSL_LIBS) $(am__append_9) -lib_libopenvswitch_la_LDFLAGS = -release $(VERSION) -lib_libopenvswitch_la_SOURCES = lib/aes128.c lib/aes128.h \ - lib/async-append.h lib/backtrace.c lib/backtrace.h lib/bfd.c \ - lib/bfd.h lib/bitmap.c lib/bitmap.h lib/bundle.c lib/bundle.h \ - lib/byte-order.h lib/byteq.c lib/byteq.h lib/cfm.c lib/cfm.h \ - lib/classifier.c lib/classifier.h lib/command-line.c \ - lib/command-line.h lib/compiler.h lib/connectivity.c \ - lib/connectivity.h lib/coverage.c lib/coverage.h lib/crc32c.c \ - lib/crc32c.h lib/csum.c lib/csum.h lib/daemon.c lib/daemon.h \ - lib/daemon-private.h lib/dhcp.h lib/dummy.c lib/dummy.h \ - lib/dhparams.h lib/dirs.h lib/dpif-netdev.c lib/dpif-netdev.h \ - lib/dpif-provider.h lib/dpif.c lib/dpif.h lib/heap.c \ - lib/heap.h lib/dynamic-string.c lib/dynamic-string.h \ - lib/entropy.c lib/entropy.h lib/fat-rwlock.c lib/fat-rwlock.h \ - lib/fatal-signal.c lib/fatal-signal.h lib/flow.c lib/flow.h \ - lib/guarded-list.c lib/guarded-list.h lib/hash.c lib/hash.h \ - lib/hindex.c lib/hindex.h lib/hmap.c lib/hmap.h lib/hmapx.c \ - lib/hmapx.h lib/jhash.c lib/jhash.h lib/json.c lib/json.h \ - lib/jsonrpc.c lib/jsonrpc.h lib/lacp.c lib/lacp.h lib/latch.h \ - lib/learn.c lib/learn.h lib/learning-switch.c \ - lib/learning-switch.h lib/list.c lib/list.h lib/lockfile.c \ - lib/lockfile.h lib/mac-learning.c lib/mac-learning.h \ - lib/match.c lib/match.h lib/memory.c lib/memory.h \ - lib/meta-flow.c lib/meta-flow.h lib/multipath.c \ - lib/multipath.h lib/netdev-dummy.c lib/netdev-provider.h \ - lib/netdev-vport.c lib/netdev-vport.h lib/netdev.c \ - lib/netdev.h lib/netflow.h lib/netlink.c lib/netlink.h \ - lib/nx-match.c lib/nx-match.h lib/odp-execute.c \ - lib/odp-execute.h lib/odp-util.c lib/odp-util.h \ - lib/ofp-actions.c lib/ofp-actions.h lib/ofp-errors.c \ - lib/ofp-errors.h lib/ofp-msgs.c lib/ofp-msgs.h lib/ofp-parse.c \ - lib/ofp-parse.h lib/ofp-print.c lib/ofp-print.h lib/ofp-util.c \ - lib/ofp-util.def lib/ofp-util.h lib/ofp-version-opt.h \ - lib/ofp-version-opt.c lib/ofpbuf.c lib/ofpbuf.h \ - lib/ovs-atomic-c11.h lib/ovs-atomic-clang.h \ - lib/ovs-atomic-flag-gcc4.7+.h lib/ovs-atomic-gcc4+.h \ - lib/ovs-atomic-gcc4.7+.h lib/ovs-atomic-locked.c \ - lib/ovs-atomic-locked.h lib/ovs-atomic-pthreads.h \ - lib/ovs-atomic.h lib/ovs-rcu.c lib/ovs-rcu.h lib/ovs-thread.c \ - lib/ovs-thread.h lib/ovsdb-data.c lib/ovsdb-data.h \ - lib/ovsdb-error.c lib/ovsdb-error.h lib/ovsdb-idl-provider.h \ - lib/ovsdb-idl.c lib/ovsdb-idl.h lib/ovsdb-parser.c \ - lib/ovsdb-parser.h lib/ovsdb-types.c lib/ovsdb-types.h \ - lib/packets.c lib/packets.h lib/pcap-file.c lib/pcap-file.h \ - lib/poll-loop.c lib/poll-loop.h lib/process.c lib/process.h \ - lib/random.c lib/random.h lib/rconn.c lib/rconn.h \ - lib/reconnect.c lib/reconnect.h lib/sat-math.h lib/seq.c \ - lib/seq.h lib/sha1.c lib/sha1.h lib/shash.c lib/shash.h \ - lib/simap.c lib/simap.h lib/smap.c lib/smap.h \ - lib/socket-util.c lib/socket-util.h lib/sort.c lib/sort.h \ - lib/sset.c lib/sset.h lib/stp.c lib/stp.h lib/stream-fd.h \ - lib/stream-provider.h lib/stream-ssl.h lib/stream-tcp.c \ - lib/stream.c lib/stream.h lib/stdio.c lib/string.c lib/svec.c \ - lib/svec.h lib/table.c lib/table.h lib/tag.c lib/tag.h \ - lib/timer.c lib/timer.h lib/timeval.c lib/timeval.h \ - lib/token-bucket.c lib/token-bucket.h lib/type-props.h \ - lib/unaligned.h lib/unicode.c lib/unicode.h lib/unixctl.c \ - lib/unixctl.h lib/util.c lib/util.h lib/uuid.c lib/uuid.h \ - lib/valgrind.h lib/vconn-provider.h lib/vconn-stream.c \ - lib/vconn.c lib/vconn.h lib/vlan-bitmap.c lib/vlan-bitmap.h \ - lib/vlandev.c lib/vlandev.h lib/vlog.c lib/vlog.h \ - lib/vswitch-idl.c lib/vswitch-idl.h lib/vtep-idl.c \ - lib/vtep-idl.h $(am__append_10) $(am__append_11) \ - $(am__append_14) $(am__append_15) $(am__append_16) \ - $(am__append_17) $(am__append_18) $(am__append_19) \ - $(am__append_20) $(am__append_22) -nodist_lib_libopenvswitch_la_SOURCES = lib/dirs.c $(am__append_21) -lib_libsflow_la_LDFLAGS = -release $(VERSION) -lib_libsflow_la_SOURCES = \ - lib/sflow_api.h \ - lib/sflow.h \ - lib/sflow_agent.c \ - lib/sflow_sampler.c \ - lib/sflow_poller.c \ - lib/sflow_receiver.c - -lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS) -lib_libsflow_la_CFLAGS = $(AM_CFLAGS) $(am__append_12) \ - $(am__append_13) -VSWITCH_IDL_FILES = \ - $(srcdir)/vswitchd/vswitch.ovsschema \ - $(srcdir)/lib/vswitch-idl.ann - -VTEP_IDL_FILES = \ - $(srcdir)/vtep/vtep.ovsschema \ - $(srcdir)/lib/vtep-idl.ann - -ofproto_libofproto_la_LDFLAGS = -release $(VERSION) - -# Distribute this generated file in order not to require Python at -# build time if ofproto/ipfix.xml is not modified. -ofproto_libofproto_la_SOURCES = ofproto/bond.c ofproto/bond.h \ - ofproto/collectors.c ofproto/collectors.h ofproto/connmgr.c \ - ofproto/connmgr.h ofproto/fail-open.c ofproto/fail-open.h \ - ofproto/in-band.c ofproto/in-band.h ofproto/names.c \ - ofproto/netflow.c ofproto/netflow.h ofproto/ofproto.c \ - ofproto/ofproto.h ofproto/ofproto-dpif.c \ - ofproto/ofproto-dpif.h ofproto/ofproto-dpif-ipfix.c \ - ofproto/ofproto-dpif-ipfix.h ofproto/ofproto-dpif-mirror.c \ - ofproto/ofproto-dpif-mirror.h ofproto/ofproto-dpif-monitor.c \ - ofproto/ofproto-dpif-monitor.h ofproto/ofproto-dpif-rid.c \ - ofproto/ofproto-dpif-rid.h ofproto/ofproto-dpif-sflow.c \ - ofproto/ofproto-dpif-sflow.h ofproto/ofproto-dpif-upcall.c \ - ofproto/ofproto-dpif-upcall.h ofproto/ofproto-dpif-xlate.c \ - ofproto/ofproto-dpif-xlate.h ofproto/ofproto-provider.h \ - ofproto/pktbuf.c ofproto/pktbuf.h ofproto/pinsched.c \ - ofproto/pinsched.h ofproto/tunnel.c ofproto/tunnel.h \ - ofproto/bundles.c ofproto/bundles.h ofproto/ipfix-entities.def -ofproto_libofproto_la_CPPFLAGS = $(AM_CPPFLAGS) -ofproto_libofproto_la_CFLAGS = $(AM_CFLAGS) -ofproto_libofproto_la_LIBADD = lib/libsflow.la $(am__append_23) -dist_noinst_SCRIPTS = ofproto/ipfix-gen-entities -utilities_ovs_appctl_SOURCES = utilities/ovs-appctl.c -utilities_ovs_appctl_LDADD = lib/libopenvswitch.la -utilities_ovs_dpctl_SOURCES = utilities/ovs-dpctl.c -utilities_ovs_dpctl_LDADD = lib/libopenvswitch.la -utilities_ovs_ofctl_SOURCES = utilities/ovs-ofctl.c -utilities_ovs_ofctl_LDADD = \ - ofproto/libofproto.la \ - lib/libopenvswitch.la - -utilities_ovs_vsctl_SOURCES = utilities/ovs-vsctl.c -utilities_ovs_vsctl_LDADD = lib/libopenvswitch.la -@LINUX_TRUE@utilities_ovs_vlan_bug_workaround_SOURCES = utilities/ovs-vlan-bug-workaround.c -@LINUX_TRUE@utilities_ovs_vlan_bug_workaround_LDADD = lib/libopenvswitch.la -@LINUX_TRUE@utilities_nlmon_SOURCES = utilities/nlmon.c -@LINUX_TRUE@utilities_nlmon_LDADD = lib/libopenvswitch.la -utilities_ovs_benchmark_SOURCES = utilities/ovs-benchmark.c -utilities_ovs_benchmark_LDADD = lib/libopenvswitch.la -@HAVE_PYTHON_TRUE@bugtool_plugins = \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/plugins/kernel-info/openvswitch.xml \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/plugins/network-status/openvswitch.xml \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/plugins/system-configuration.xml \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/plugins/system-logs/openvswitch.xml \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/plugins/system-configuration/openvswitch.xml - -@HAVE_PYTHON_TRUE@bugtool_scripts = \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-bfd-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-cfm-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-coverage-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-lacp-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-list-dbs \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-memory-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-tc-class-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-vsctl-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-ovsdb-dump \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-daemons-ver \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-ovs-ofctl-show \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-ovs-ofctl-dump-flows \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-ovs-appctl-dpif \ -@HAVE_PYTHON_TRUE@ utilities/bugtool/ovs-bugtool-bond-show - -@HAVE_PYTHON_TRUE@bugtoolpluginsdir = $(pkgdatadir)/bugtool-plugins -TESTSUITE_AT = \ - tests/testsuite.at \ - tests/ovsdb-macros.at \ - tests/library.at \ - tests/heap.at \ - tests/bundle.at \ - tests/classifier.at \ - tests/check-structs.at \ - tests/daemon.at \ - tests/daemon-py.at \ - tests/ofp-actions.at \ - tests/ofp-print.at \ - tests/ofp-util.at \ - tests/ofp-errors.at \ - tests/ovs-ofctl.at \ - tests/odp.at \ - tests/multipath.at \ - tests/bfd.at \ - tests/cfm.at \ - tests/lacp.at \ - tests/learn.at \ - tests/vconn.at \ - tests/file_name.at \ - tests/aes128.at \ - tests/unixctl-py.at \ - tests/uuid.at \ - tests/json.at \ - tests/jsonrpc.at \ - tests/jsonrpc-py.at \ - tests/tunnel.at \ - tests/lockfile.at \ - tests/reconnect.at \ - tests/ovs-vswitchd.at \ - tests/ofproto-dpif.at \ - tests/vlan-splinters.at \ - tests/ofproto-macros.at \ - tests/ofproto.at \ - tests/ovsdb.at \ - tests/ovsdb-log.at \ - tests/ovsdb-types.at \ - tests/ovsdb-data.at \ - tests/ovsdb-column.at \ - tests/ovsdb-table.at \ - tests/ovsdb-row.at \ - tests/ovsdb-schema.at \ - tests/ovsdb-condition.at \ - tests/ovsdb-mutation.at \ - tests/ovsdb-query.at \ - tests/ovsdb-transaction.at \ - tests/ovsdb-execution.at \ - tests/ovsdb-trigger.at \ - tests/ovsdb-tool.at \ - tests/ovsdb-server.at \ - tests/ovsdb-monitor.at \ - tests/ovsdb-idl.at \ - tests/ovs-vsctl.at \ - tests/ovs-monitor-ipsec.at \ - tests/ovs-xapi-sync.at \ - tests/stp.at \ - tests/interface-reconfigure.at \ - tests/vlog.at \ - tests/vtep-ctl.at - -TESTSUITE = $(srcdir)/tests/testsuite -AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests - -# Python Coverage support. -# Requires coverage.py http://nedbatchelder.com/code/coverage/. -COVERAGE = coverage -COVERAGE_FILE = '$(abs_srcdir)/.coverage' - -# valgrind support -valgrind_wrappers = \ - tests/valgrind/ovs-appctl \ - tests/valgrind/ovs-ofctl \ - tests/valgrind/ovstest \ - tests/valgrind/ovs-vsctl \ - tests/valgrind/ovs-vswitchd \ - tests/valgrind/ovsdb-client \ - tests/valgrind/ovsdb-server \ - tests/valgrind/ovsdb-tool \ - tests/valgrind/test-aes128 \ - tests/valgrind/test-atomic \ - tests/valgrind/test-bundle \ - tests/valgrind/test-byte-order \ - tests/valgrind/test-classifier \ - tests/valgrind/test-csum \ - tests/valgrind/test-file_name \ - tests/valgrind/test-flows \ - tests/valgrind/test-hash \ - tests/valgrind/test-hindex \ - tests/valgrind/test-hmap \ - tests/valgrind/test-json \ - tests/valgrind/test-jsonrpc \ - tests/valgrind/test-list \ - tests/valgrind/test-lockfile \ - tests/valgrind/test-multipath \ - tests/valgrind/test-odp \ - tests/valgrind/test-ovsdb \ - tests/valgrind/test-packets \ - tests/valgrind/test-random \ - tests/valgrind/test-reconnect \ - tests/valgrind/test-sha1 \ - tests/valgrind/test-stp \ - tests/valgrind/test-type-props \ - tests/valgrind/test-unix-socket \ - tests/valgrind/test-uuid \ - tests/valgrind/test-vconn - -VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \ - --suppressions=$(abs_top_srcdir)/tests/glibc.supp \ - --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20 - -AUTOTEST = $(AUTOM4TE) --language=autotest -tests_test_controller_SOURCES = tests/test-controller.c -tests_test_controller_LDADD = lib/libopenvswitch.la -tests_test_ovsdb_SOURCES = \ - tests/test-ovsdb.c \ - tests/idltest.c \ - tests/idltest.h - -tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la -IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann -tests_ovstest_SOURCES = tests/ovstest.c tests/ovstest.h \ - tests/test-aes128.c tests/test-atomic.c tests/test-bundle.c \ - tests/test-byte-order.c tests/test-classifier.c \ - tests/test-csum.c tests/test-file_name.c tests/test-flows.c \ - tests/test-hash.c tests/test-heap.c tests/test-hindex.c \ - tests/test-hmap.c tests/test-json.c tests/test-jsonrpc.c \ - tests/test-list.c tests/test-lockfile.c tests/test-multipath.c \ - tests/test-netflow.c tests/test-odp.c tests/test-packets.c \ - tests/test-random.c tests/test-reconnect.c tests/test-sflow.c \ - tests/test-sha1.c tests/test-stp.c tests/test-util.c \ - tests/test-uuid.c tests/test-vconn.c $(am__append_35) -tests_ovstest_LDADD = lib/libopenvswitch.la -dist_check_SCRIPTS = tests/flowgen.pl -tests_test_strtok_r_SOURCES = tests/test-strtok_r.c -tests_test_type_props_SOURCES = tests/test-type-props.c - -# Python tests. -CHECK_PYFILES = \ - tests/appctl.py \ - tests/test-daemon.py \ - tests/test-json.py \ - tests/test-jsonrpc.py \ - tests/test-ovsdb.py \ - tests/test-reconnect.py \ - tests/MockXenAPI.py \ - tests/test-unix-socket.py \ - tests/test-unixctl.py \ - tests/test-vlog.py - -@HAVE_OPENSSL_TRUE@TESTPKI_FILES = \ -@HAVE_OPENSSL_TRUE@ tests/testpki-cacert.pem \ -@HAVE_OPENSSL_TRUE@ tests/testpki-cert.pem \ -@HAVE_OPENSSL_TRUE@ tests/testpki-privkey.pem \ -@HAVE_OPENSSL_TRUE@ tests/testpki-req.pem \ -@HAVE_OPENSSL_TRUE@ tests/testpki-cert2.pem \ -@HAVE_OPENSSL_TRUE@ tests/testpki-privkey2.pem \ -@HAVE_OPENSSL_TRUE@ tests/testpki-req2.pem - -@HAVE_OPENSSL_TRUE@OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log -@HAVE_PYTHON_TRUE@HSTAMP_FILES = \ -@HAVE_PYTHON_TRUE@ include/openflow/nicira-ext.hstamp \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.0.hstamp \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.1.hstamp \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.2.hstamp \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.3.hstamp \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.4.hstamp \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-common.hstamp \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow.hstamp - -vswitchd_ovs_vswitchd_SOURCES = \ - vswitchd/bridge.c \ - vswitchd/bridge.h \ - vswitchd/ovs-vswitchd.c \ - vswitchd/system-stats.c \ - vswitchd/system-stats.h \ - vswitchd/xenserver.c \ - vswitchd/xenserver.h - -vswitchd_ovs_vswitchd_LDADD = \ - ofproto/libofproto.la \ - lib/libsflow.la \ - lib/libopenvswitch.la - -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@VSWITCH_PIC = vswitchd/vswitch.pic -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@VSWITCH_DOT_DIAGRAM_ARG = --er-diagram=$(VSWITCH_PIC) -ovsdb_libovsdb_la_LDFLAGS = -release $(VERSION) -ovsdb_libovsdb_la_SOURCES = \ - ovsdb/column.c \ - ovsdb/column.h \ - ovsdb/condition.c \ - ovsdb/condition.h \ - ovsdb/execution.c \ - ovsdb/file.c \ - ovsdb/file.h \ - ovsdb/jsonrpc-server.c \ - ovsdb/jsonrpc-server.h \ - ovsdb/log.c \ - ovsdb/log.h \ - ovsdb/mutation.c \ - ovsdb/mutation.h \ - ovsdb/ovsdb.c \ - ovsdb/ovsdb.h \ - ovsdb/query.c \ - ovsdb/query.h \ - ovsdb/row.c \ - ovsdb/row.h \ - ovsdb/server.c \ - ovsdb/server.h \ - ovsdb/table.c \ - ovsdb/table.h \ - ovsdb/trigger.c \ - ovsdb/trigger.h \ - ovsdb/transaction.c \ - ovsdb/transaction.h - -ovsdb_libovsdb_la_CFLAGS = $(AM_CFLAGS) -ovsdb_libovsdb_la_CPPFLAGS = $(AM_CPPFLAGS) -ovsdb_ovsdb_tool_SOURCES = ovsdb/ovsdb-tool.c -ovsdb_ovsdb_tool_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la -ovsdb_ovsdb_client_SOURCES = ovsdb/ovsdb-client.c -ovsdb_ovsdb_client_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la -ovsdb_ovsdb_server_SOURCES = ovsdb/ovsdb-server.c -ovsdb_ovsdb_server_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la -OVSDB_IDLC = $(run_python) $(srcdir)/ovsdb/ovsdb-idlc.in -OVSDB_DOC = $(run_python) $(srcdir)/ovsdb/ovsdb-doc -OVSDB_DOT = $(run_python) $(srcdir)/ovsdb/ovsdb-dot.in -update_rhel_spec = \ - ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \ - < $(srcdir)/rhel/$(@F).in > $(@F).tmp || exit 1; \ - if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi - -ovstest_pyfiles = \ - python/ovstest/__init__.py \ - python/ovstest/args.py \ - python/ovstest/rpcserver.py \ - python/ovstest/tcp.py \ - python/ovstest/tests.py \ - python/ovstest/udp.py \ - python/ovstest/util.py \ - python/ovstest/vswitch.py - -ovs_pyfiles = \ - python/ovs/__init__.py \ - python/ovs/daemon.py \ - python/ovs/db/__init__.py \ - python/ovs/db/data.py \ - python/ovs/db/error.py \ - python/ovs/db/idl.py \ - python/ovs/db/parser.py \ - python/ovs/db/schema.py \ - python/ovs/db/types.py \ - python/ovs/fatal_signal.py \ - python/ovs/json.py \ - python/ovs/jsonrpc.py \ - python/ovs/ovsuuid.py \ - python/ovs/poller.py \ - python/ovs/process.py \ - python/ovs/reconnect.py \ - python/ovs/socket_util.py \ - python/ovs/stream.py \ - python/ovs/timeval.py \ - python/ovs/unixctl/__init__.py \ - python/ovs/unixctl/client.py \ - python/ovs/unixctl/server.py \ - python/ovs/util.py \ - python/ovs/version.py \ - python/ovs/vlog.py - -PYFILES = $(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles) -@HAVE_PYTHON_TRUE@nobase_pkgdata_DATA = $(ovs_pyfiles) $(ovstest_pyfiles) -vtep_vtep_ctl_SOURCES = vtep/vtep-ctl.c -vtep_vtep_ctl_LDADD = lib/libopenvswitch.la -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@VTEP_PIC = vtep/vtep.pic -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@VTEP_DOT_DIAGRAM_ARG = --er-diagram=$(VTEP_PIC) -all: $(BUILT_SOURCES) config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -.SUFFIXES: .in .h .hstamp .ovsidl .ovsschema .c .lo .o .obj -am--refresh: - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/manpages.mk $(srcdir)/m4/automake.mk $(srcdir)/lib/automake.mk $(srcdir)/ofproto/automake.mk $(srcdir)/utilities/automake.mk $(srcdir)/utilities/bugtool/automake.mk $(srcdir)/tests/automake.mk $(srcdir)/include/automake.mk $(srcdir)/include/linux/automake.mk $(srcdir)/include/openflow/automake.mk $(srcdir)/include/openvswitch/automake.mk $(srcdir)/include/sparse/automake.mk $(srcdir)/include/windows/automake.mk $(srcdir)/third-party/automake.mk $(srcdir)/debian/automake.mk $(srcdir)/vswitchd/automake.mk $(srcdir)/ovsdb/automake.mk $(srcdir)/rhel/automake.mk $(srcdir)/xenserver/automake.mk $(srcdir)/python/automake.mk $(srcdir)/python/compat/automake.mk $(srcdir)/tutorial/automake.mk $(srcdir)/vtep/automake.mk $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -lib/stdio.h: $(top_builddir)/config.status $(top_srcdir)/lib/stdio.h.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -lib/string.h: $(top_builddir)/config.status $(top_srcdir)/lib/string.h.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -datapath/linux/Kbuild: $(top_builddir)/config.status $(top_srcdir)/datapath/linux/Kbuild.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -datapath/linux/Makefile: $(top_builddir)/config.status $(top_srcdir)/datapath/linux/Makefile.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -datapath/linux/Makefile.main: $(top_builddir)/config.status $(top_srcdir)/datapath/linux/Makefile.main.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -tests/atlocal: $(top_builddir)/config.status $(top_srcdir)/tests/atlocal.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -lib/$(am__dirstamp): - @$(MKDIR_P) lib - @: > lib/$(am__dirstamp) -lib/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) lib/$(DEPDIR) - @: > lib/$(DEPDIR)/$(am__dirstamp) -lib/aes128.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/backtrace.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/bfd.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/bitmap.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/bundle.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/byteq.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/cfm.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/classifier.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/command-line.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/connectivity.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/coverage.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/crc32c.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/csum.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/daemon.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/dummy.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/dpif-netdev.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/dpif.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/heap.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/dynamic-string.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/entropy.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/fat-rwlock.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/fatal-signal.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/flow.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/guarded-list.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/hash.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/hindex.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/hmap.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/hmapx.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/jhash.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/json.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/jsonrpc.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/lacp.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/learn.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/learning-switch.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/list.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/lockfile.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/mac-learning.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/match.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/memory.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/meta-flow.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/multipath.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/netdev-dummy.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/netdev-vport.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/netdev.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/netlink.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/nx-match.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/odp-execute.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/odp-util.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ofp-actions.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ofp-errors.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ofp-msgs.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ofp-parse.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ofp-print.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ofp-util.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ofp-version-opt.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/ofpbuf.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ovs-atomic-locked.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/ovs-rcu.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ovs-thread.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ovsdb-data.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ovsdb-error.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ovsdb-idl.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ovsdb-parser.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/ovsdb-types.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/packets.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/pcap-file.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/poll-loop.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/process.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/random.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/rconn.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/reconnect.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/seq.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/sha1.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/shash.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/simap.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/smap.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/socket-util.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/sort.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/sset.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/stp.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/stream-tcp.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/stream.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/stdio.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/string.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/svec.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/table.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/tag.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/timer.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/timeval.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/token-bucket.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/unicode.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/unixctl.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/util.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/uuid.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/vconn-stream.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/vconn.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/vlan-bitmap.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/vlandev.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/vlog.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/vswitch-idl.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/vtep-idl.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/daemon-windows.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/getopt_long.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/getrusage-windows.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/latch-windows.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/route-table-stub.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/strsep.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/stream-fd-windows.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/daemon-unix.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/latch-unix.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/signals.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/stream-fd-unix.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/stream-unix.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/dpif-linux.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/netdev-linux.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/netlink-notifier.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/netlink-socket.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/rtnetlink-link.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/route-table.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/netdev-dpdk.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/async-append-aio.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/async-append-null.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/netdev-bsd.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/rtbsd.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/route-table-bsd.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/stream-ssl.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/stream-nossl.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/dirs.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/dhparams.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) -lib/libopenvswitch.la: $(lib_libopenvswitch_la_OBJECTS) $(lib_libopenvswitch_la_DEPENDENCIES) lib/$(am__dirstamp) - $(AM_V_CCLD)$(lib_libopenvswitch_la_LINK) -rpath $(libdir) $(lib_libopenvswitch_la_OBJECTS) $(lib_libopenvswitch_la_LIBADD) $(LIBS) -lib/lib_libsflow_la-sflow_agent.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/lib_libsflow_la-sflow_sampler.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/lib_libsflow_la-sflow_poller.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/lib_libsflow_la-sflow_receiver.lo: lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/libsflow.la: $(lib_libsflow_la_OBJECTS) $(lib_libsflow_la_DEPENDENCIES) lib/$(am__dirstamp) - $(AM_V_CCLD)$(lib_libsflow_la_LINK) -rpath $(libdir) $(lib_libsflow_la_OBJECTS) $(lib_libsflow_la_LIBADD) $(LIBS) -ofproto/$(am__dirstamp): - @$(MKDIR_P) ofproto - @: > ofproto/$(am__dirstamp) -ofproto/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) ofproto/$(DEPDIR) - @: > ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-bond.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-collectors.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-connmgr.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-fail-open.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-in-band.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-names.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-netflow.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo: \ - ofproto/$(am__dirstamp) ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-pktbuf.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-pinsched.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-tunnel.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/ofproto_libofproto_la-bundles.lo: ofproto/$(am__dirstamp) \ - ofproto/$(DEPDIR)/$(am__dirstamp) -ofproto/libofproto.la: $(ofproto_libofproto_la_OBJECTS) $(ofproto_libofproto_la_DEPENDENCIES) ofproto/$(am__dirstamp) - $(AM_V_CCLD)$(ofproto_libofproto_la_LINK) -rpath $(libdir) $(ofproto_libofproto_la_OBJECTS) $(ofproto_libofproto_la_LIBADD) $(LIBS) -ovsdb/$(am__dirstamp): - @$(MKDIR_P) ovsdb - @: > ovsdb/$(am__dirstamp) -ovsdb/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) ovsdb/$(DEPDIR) - @: > ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-column.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-condition.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-execution.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-file.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-log.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-mutation.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-ovsdb.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-query.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-row.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-server.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-table.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-trigger.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb_libovsdb_la-transaction.lo: ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/libovsdb.la: $(ovsdb_libovsdb_la_OBJECTS) $(ovsdb_libovsdb_la_DEPENDENCIES) ovsdb/$(am__dirstamp) - $(AM_V_CCLD)$(ovsdb_libovsdb_la_LINK) -rpath $(libdir) $(ovsdb_libovsdb_la_OBJECTS) $(ovsdb_libovsdb_la_LIBADD) $(LIBS) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -install-sbinPROGRAMS: $(sbin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" - @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-sbinPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(sbindir)" && rm -f $$files - -clean-sbinPROGRAMS: - @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -ovsdb/ovsdb-client.$(OBJEXT): ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb-client$(EXEEXT): $(ovsdb_ovsdb_client_OBJECTS) $(ovsdb_ovsdb_client_DEPENDENCIES) ovsdb/$(am__dirstamp) - @rm -f ovsdb/ovsdb-client$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(ovsdb_ovsdb_client_OBJECTS) $(ovsdb_ovsdb_client_LDADD) $(LIBS) -ovsdb/ovsdb-server.$(OBJEXT): ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb-server$(EXEEXT): $(ovsdb_ovsdb_server_OBJECTS) $(ovsdb_ovsdb_server_DEPENDENCIES) ovsdb/$(am__dirstamp) - @rm -f ovsdb/ovsdb-server$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(ovsdb_ovsdb_server_OBJECTS) $(ovsdb_ovsdb_server_LDADD) $(LIBS) -ovsdb/ovsdb-tool.$(OBJEXT): ovsdb/$(am__dirstamp) \ - ovsdb/$(DEPDIR)/$(am__dirstamp) -ovsdb/ovsdb-tool$(EXEEXT): $(ovsdb_ovsdb_tool_OBJECTS) $(ovsdb_ovsdb_tool_DEPENDENCIES) ovsdb/$(am__dirstamp) - @rm -f ovsdb/ovsdb-tool$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(ovsdb_ovsdb_tool_OBJECTS) $(ovsdb_ovsdb_tool_LDADD) $(LIBS) -tests/$(am__dirstamp): - @$(MKDIR_P) tests - @: > tests/$(am__dirstamp) -tests/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/$(DEPDIR) - @: > tests/$(DEPDIR)/$(am__dirstamp) -tests/ovstest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-aes128.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-atomic.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-bundle.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-byte-order.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-classifier.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-csum.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-file_name.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-flows.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-hash.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-heap.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-hindex.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-hmap.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-json.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-jsonrpc.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-list.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-lockfile.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-multipath.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-netflow.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-odp.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-packets.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-random.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-reconnect.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-sflow.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-sha1.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-stp.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-util.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-uuid.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-vconn.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-unix-socket.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/ovstest$(EXEEXT): $(tests_ovstest_OBJECTS) $(tests_ovstest_DEPENDENCIES) tests/$(am__dirstamp) - @rm -f tests/ovstest$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(tests_ovstest_OBJECTS) $(tests_ovstest_LDADD) $(LIBS) -tests/test-controller.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-controller$(EXEEXT): $(tests_test_controller_OBJECTS) $(tests_test_controller_DEPENDENCIES) tests/$(am__dirstamp) - @rm -f tests/test-controller$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(tests_test_controller_OBJECTS) $(tests_test_controller_LDADD) $(LIBS) -tests/test-ovsdb.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/idltest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-ovsdb$(EXEEXT): $(tests_test_ovsdb_OBJECTS) $(tests_test_ovsdb_DEPENDENCIES) tests/$(am__dirstamp) - @rm -f tests/test-ovsdb$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(tests_test_ovsdb_OBJECTS) $(tests_test_ovsdb_LDADD) $(LIBS) -tests/test-strtok_r.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-strtok_r$(EXEEXT): $(tests_test_strtok_r_OBJECTS) $(tests_test_strtok_r_DEPENDENCIES) tests/$(am__dirstamp) - @rm -f tests/test-strtok_r$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(tests_test_strtok_r_OBJECTS) $(tests_test_strtok_r_LDADD) $(LIBS) -tests/test-type-props.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/test-type-props$(EXEEXT): $(tests_test_type_props_OBJECTS) $(tests_test_type_props_DEPENDENCIES) tests/$(am__dirstamp) - @rm -f tests/test-type-props$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(tests_test_type_props_OBJECTS) $(tests_test_type_props_LDADD) $(LIBS) -utilities/$(am__dirstamp): - @$(MKDIR_P) utilities - @: > utilities/$(am__dirstamp) -utilities/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) utilities/$(DEPDIR) - @: > utilities/$(DEPDIR)/$(am__dirstamp) -utilities/nlmon.$(OBJEXT): utilities/$(am__dirstamp) \ - utilities/$(DEPDIR)/$(am__dirstamp) -utilities/nlmon$(EXEEXT): $(utilities_nlmon_OBJECTS) $(utilities_nlmon_DEPENDENCIES) utilities/$(am__dirstamp) - @rm -f utilities/nlmon$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(utilities_nlmon_OBJECTS) $(utilities_nlmon_LDADD) $(LIBS) -utilities/ovs-appctl.$(OBJEXT): utilities/$(am__dirstamp) \ - utilities/$(DEPDIR)/$(am__dirstamp) -utilities/ovs-appctl$(EXEEXT): $(utilities_ovs_appctl_OBJECTS) $(utilities_ovs_appctl_DEPENDENCIES) utilities/$(am__dirstamp) - @rm -f utilities/ovs-appctl$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(utilities_ovs_appctl_OBJECTS) $(utilities_ovs_appctl_LDADD) $(LIBS) -utilities/ovs-benchmark.$(OBJEXT): utilities/$(am__dirstamp) \ - utilities/$(DEPDIR)/$(am__dirstamp) -utilities/ovs-benchmark$(EXEEXT): $(utilities_ovs_benchmark_OBJECTS) $(utilities_ovs_benchmark_DEPENDENCIES) utilities/$(am__dirstamp) - @rm -f utilities/ovs-benchmark$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(utilities_ovs_benchmark_OBJECTS) $(utilities_ovs_benchmark_LDADD) $(LIBS) -utilities/ovs-dpctl.$(OBJEXT): utilities/$(am__dirstamp) \ - utilities/$(DEPDIR)/$(am__dirstamp) -utilities/ovs-dpctl$(EXEEXT): $(utilities_ovs_dpctl_OBJECTS) $(utilities_ovs_dpctl_DEPENDENCIES) utilities/$(am__dirstamp) - @rm -f utilities/ovs-dpctl$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(utilities_ovs_dpctl_OBJECTS) $(utilities_ovs_dpctl_LDADD) $(LIBS) -utilities/ovs-ofctl.$(OBJEXT): utilities/$(am__dirstamp) \ - utilities/$(DEPDIR)/$(am__dirstamp) -utilities/ovs-ofctl$(EXEEXT): $(utilities_ovs_ofctl_OBJECTS) $(utilities_ovs_ofctl_DEPENDENCIES) utilities/$(am__dirstamp) - @rm -f utilities/ovs-ofctl$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(utilities_ovs_ofctl_OBJECTS) $(utilities_ovs_ofctl_LDADD) $(LIBS) -utilities/ovs-vlan-bug-workaround.$(OBJEXT): \ - utilities/$(am__dirstamp) utilities/$(DEPDIR)/$(am__dirstamp) -utilities/ovs-vlan-bug-workaround$(EXEEXT): $(utilities_ovs_vlan_bug_workaround_OBJECTS) $(utilities_ovs_vlan_bug_workaround_DEPENDENCIES) utilities/$(am__dirstamp) - @rm -f utilities/ovs-vlan-bug-workaround$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(utilities_ovs_vlan_bug_workaround_OBJECTS) $(utilities_ovs_vlan_bug_workaround_LDADD) $(LIBS) -utilities/ovs-vsctl.$(OBJEXT): utilities/$(am__dirstamp) \ - utilities/$(DEPDIR)/$(am__dirstamp) -utilities/ovs-vsctl$(EXEEXT): $(utilities_ovs_vsctl_OBJECTS) $(utilities_ovs_vsctl_DEPENDENCIES) utilities/$(am__dirstamp) - @rm -f utilities/ovs-vsctl$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(utilities_ovs_vsctl_OBJECTS) $(utilities_ovs_vsctl_LDADD) $(LIBS) -vswitchd/$(am__dirstamp): - @$(MKDIR_P) vswitchd - @: > vswitchd/$(am__dirstamp) -vswitchd/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) vswitchd/$(DEPDIR) - @: > vswitchd/$(DEPDIR)/$(am__dirstamp) -vswitchd/bridge.$(OBJEXT): vswitchd/$(am__dirstamp) \ - vswitchd/$(DEPDIR)/$(am__dirstamp) -vswitchd/ovs-vswitchd.$(OBJEXT): vswitchd/$(am__dirstamp) \ - vswitchd/$(DEPDIR)/$(am__dirstamp) -vswitchd/system-stats.$(OBJEXT): vswitchd/$(am__dirstamp) \ - vswitchd/$(DEPDIR)/$(am__dirstamp) -vswitchd/xenserver.$(OBJEXT): vswitchd/$(am__dirstamp) \ - vswitchd/$(DEPDIR)/$(am__dirstamp) -vswitchd/ovs-vswitchd$(EXEEXT): $(vswitchd_ovs_vswitchd_OBJECTS) $(vswitchd_ovs_vswitchd_DEPENDENCIES) vswitchd/$(am__dirstamp) - @rm -f vswitchd/ovs-vswitchd$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(vswitchd_ovs_vswitchd_OBJECTS) $(vswitchd_ovs_vswitchd_LDADD) $(LIBS) -vtep/$(am__dirstamp): - @$(MKDIR_P) vtep - @: > vtep/$(am__dirstamp) -vtep/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) vtep/$(DEPDIR) - @: > vtep/$(DEPDIR)/$(am__dirstamp) -vtep/vtep-ctl.$(OBJEXT): vtep/$(am__dirstamp) \ - vtep/$(DEPDIR)/$(am__dirstamp) -vtep/vtep-ctl$(EXEEXT): $(vtep_vtep_ctl_OBJECTS) $(vtep_vtep_ctl_DEPENDENCIES) vtep/$(am__dirstamp) - @rm -f vtep/vtep-ctl$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(vtep_vtep_ctl_OBJECTS) $(vtep_vtep_ctl_LDADD) $(LIBS) -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files -install-dist_pkgdataSCRIPTS: $(dist_pkgdata_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" - @list='$(dist_pkgdata_SCRIPTS)'; test -n "$(pkgdatadir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgdatadir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgdatadir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_pkgdataSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_pkgdata_SCRIPTS)'; test -n "$(pkgdatadir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files -install-dist_sbinSCRIPTS: $(dist_sbin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" - @list='$(dist_sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_sbinSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(sbindir)" && rm -f $$files -install-dist_scriptsSCRIPTS: $(dist_scripts_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(scriptsdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptsdir)" - @list='$(dist_scripts_SCRIPTS)'; test -n "$(scriptsdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(scriptsdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(scriptsdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_scriptsSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_scripts_SCRIPTS)'; test -n "$(scriptsdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(scriptsdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(scriptsdir)" && rm -f $$files -install-sbinSCRIPTS: $(sbin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" - @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-sbinSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(sbindir)" && rm -f $$files -install-scriptsSCRIPTS: $(scripts_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(scriptsdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptsdir)" - @list='$(scripts_SCRIPTS)'; test -n "$(scriptsdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(scriptsdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(scriptsdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-scriptsSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(scripts_SCRIPTS)'; test -n "$(scriptsdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(scriptsdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(scriptsdir)" && rm -f $$files - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f lib/aes128.$(OBJEXT) - -rm -f lib/aes128.lo - -rm -f lib/async-append-aio.$(OBJEXT) - -rm -f lib/async-append-aio.lo - -rm -f lib/async-append-null.$(OBJEXT) - -rm -f lib/async-append-null.lo - -rm -f lib/backtrace.$(OBJEXT) - -rm -f lib/backtrace.lo - -rm -f lib/bfd.$(OBJEXT) - -rm -f lib/bfd.lo - -rm -f lib/bitmap.$(OBJEXT) - -rm -f lib/bitmap.lo - -rm -f lib/bundle.$(OBJEXT) - -rm -f lib/bundle.lo - -rm -f lib/byteq.$(OBJEXT) - -rm -f lib/byteq.lo - -rm -f lib/cfm.$(OBJEXT) - -rm -f lib/cfm.lo - -rm -f lib/classifier.$(OBJEXT) - -rm -f lib/classifier.lo - -rm -f lib/command-line.$(OBJEXT) - -rm -f lib/command-line.lo - -rm -f lib/connectivity.$(OBJEXT) - -rm -f lib/connectivity.lo - -rm -f lib/coverage.$(OBJEXT) - -rm -f lib/coverage.lo - -rm -f lib/crc32c.$(OBJEXT) - -rm -f lib/crc32c.lo - -rm -f lib/csum.$(OBJEXT) - -rm -f lib/csum.lo - -rm -f lib/daemon-unix.$(OBJEXT) - -rm -f lib/daemon-unix.lo - -rm -f lib/daemon-windows.$(OBJEXT) - -rm -f lib/daemon-windows.lo - -rm -f lib/daemon.$(OBJEXT) - -rm -f lib/daemon.lo - -rm -f lib/dhparams.$(OBJEXT) - -rm -f lib/dhparams.lo - -rm -f lib/dirs.$(OBJEXT) - -rm -f lib/dirs.lo - -rm -f lib/dpif-linux.$(OBJEXT) - -rm -f lib/dpif-linux.lo - -rm -f lib/dpif-netdev.$(OBJEXT) - -rm -f lib/dpif-netdev.lo - -rm -f lib/dpif.$(OBJEXT) - -rm -f lib/dpif.lo - -rm -f lib/dummy.$(OBJEXT) - -rm -f lib/dummy.lo - -rm -f lib/dynamic-string.$(OBJEXT) - -rm -f lib/dynamic-string.lo - -rm -f lib/entropy.$(OBJEXT) - -rm -f lib/entropy.lo - -rm -f lib/fat-rwlock.$(OBJEXT) - -rm -f lib/fat-rwlock.lo - -rm -f lib/fatal-signal.$(OBJEXT) - -rm -f lib/fatal-signal.lo - -rm -f lib/flow.$(OBJEXT) - -rm -f lib/flow.lo - -rm -f lib/getopt_long.$(OBJEXT) - -rm -f lib/getopt_long.lo - -rm -f lib/getrusage-windows.$(OBJEXT) - -rm -f lib/getrusage-windows.lo - -rm -f lib/guarded-list.$(OBJEXT) - -rm -f lib/guarded-list.lo - -rm -f lib/hash.$(OBJEXT) - -rm -f lib/hash.lo - -rm -f lib/heap.$(OBJEXT) - -rm -f lib/heap.lo - -rm -f lib/hindex.$(OBJEXT) - -rm -f lib/hindex.lo - -rm -f lib/hmap.$(OBJEXT) - -rm -f lib/hmap.lo - -rm -f lib/hmapx.$(OBJEXT) - -rm -f lib/hmapx.lo - -rm -f lib/jhash.$(OBJEXT) - -rm -f lib/jhash.lo - -rm -f lib/json.$(OBJEXT) - -rm -f lib/json.lo - -rm -f lib/jsonrpc.$(OBJEXT) - -rm -f lib/jsonrpc.lo - -rm -f lib/lacp.$(OBJEXT) - -rm -f lib/lacp.lo - -rm -f lib/latch-unix.$(OBJEXT) - -rm -f lib/latch-unix.lo - -rm -f lib/latch-windows.$(OBJEXT) - -rm -f lib/latch-windows.lo - -rm -f lib/learn.$(OBJEXT) - -rm -f lib/learn.lo - -rm -f lib/learning-switch.$(OBJEXT) - -rm -f lib/learning-switch.lo - -rm -f lib/lib_libsflow_la-sflow_agent.$(OBJEXT) - -rm -f lib/lib_libsflow_la-sflow_agent.lo - -rm -f lib/lib_libsflow_la-sflow_poller.$(OBJEXT) - -rm -f lib/lib_libsflow_la-sflow_poller.lo - -rm -f lib/lib_libsflow_la-sflow_receiver.$(OBJEXT) - -rm -f lib/lib_libsflow_la-sflow_receiver.lo - -rm -f lib/lib_libsflow_la-sflow_sampler.$(OBJEXT) - -rm -f lib/lib_libsflow_la-sflow_sampler.lo - -rm -f lib/list.$(OBJEXT) - -rm -f lib/list.lo - -rm -f lib/lockfile.$(OBJEXT) - -rm -f lib/lockfile.lo - -rm -f lib/mac-learning.$(OBJEXT) - -rm -f lib/mac-learning.lo - -rm -f lib/match.$(OBJEXT) - -rm -f lib/match.lo - -rm -f lib/memory.$(OBJEXT) - -rm -f lib/memory.lo - -rm -f lib/meta-flow.$(OBJEXT) - -rm -f lib/meta-flow.lo - -rm -f lib/multipath.$(OBJEXT) - -rm -f lib/multipath.lo - -rm -f lib/netdev-bsd.$(OBJEXT) - -rm -f lib/netdev-bsd.lo - -rm -f lib/netdev-dpdk.$(OBJEXT) - -rm -f lib/netdev-dpdk.lo - -rm -f lib/netdev-dummy.$(OBJEXT) - -rm -f lib/netdev-dummy.lo - -rm -f lib/netdev-linux.$(OBJEXT) - -rm -f lib/netdev-linux.lo - -rm -f lib/netdev-vport.$(OBJEXT) - -rm -f lib/netdev-vport.lo - -rm -f lib/netdev.$(OBJEXT) - -rm -f lib/netdev.lo - -rm -f lib/netlink-notifier.$(OBJEXT) - -rm -f lib/netlink-notifier.lo - -rm -f lib/netlink-socket.$(OBJEXT) - -rm -f lib/netlink-socket.lo - -rm -f lib/netlink.$(OBJEXT) - -rm -f lib/netlink.lo - -rm -f lib/nx-match.$(OBJEXT) - -rm -f lib/nx-match.lo - -rm -f lib/odp-execute.$(OBJEXT) - -rm -f lib/odp-execute.lo - -rm -f lib/odp-util.$(OBJEXT) - -rm -f lib/odp-util.lo - -rm -f lib/ofp-actions.$(OBJEXT) - -rm -f lib/ofp-actions.lo - -rm -f lib/ofp-errors.$(OBJEXT) - -rm -f lib/ofp-errors.lo - -rm -f lib/ofp-msgs.$(OBJEXT) - -rm -f lib/ofp-msgs.lo - -rm -f lib/ofp-parse.$(OBJEXT) - -rm -f lib/ofp-parse.lo - -rm -f lib/ofp-print.$(OBJEXT) - -rm -f lib/ofp-print.lo - -rm -f lib/ofp-util.$(OBJEXT) - -rm -f lib/ofp-util.lo - -rm -f lib/ofp-version-opt.$(OBJEXT) - -rm -f lib/ofp-version-opt.lo - -rm -f lib/ofpbuf.$(OBJEXT) - -rm -f lib/ofpbuf.lo - -rm -f lib/ovs-atomic-locked.$(OBJEXT) - -rm -f lib/ovs-atomic-locked.lo - -rm -f lib/ovs-rcu.$(OBJEXT) - -rm -f lib/ovs-rcu.lo - -rm -f lib/ovs-thread.$(OBJEXT) - -rm -f lib/ovs-thread.lo - -rm -f lib/ovsdb-data.$(OBJEXT) - -rm -f lib/ovsdb-data.lo - -rm -f lib/ovsdb-error.$(OBJEXT) - -rm -f lib/ovsdb-error.lo - -rm -f lib/ovsdb-idl.$(OBJEXT) - -rm -f lib/ovsdb-idl.lo - -rm -f lib/ovsdb-parser.$(OBJEXT) - -rm -f lib/ovsdb-parser.lo - -rm -f lib/ovsdb-types.$(OBJEXT) - -rm -f lib/ovsdb-types.lo - -rm -f lib/packets.$(OBJEXT) - -rm -f lib/packets.lo - -rm -f lib/pcap-file.$(OBJEXT) - -rm -f lib/pcap-file.lo - -rm -f lib/poll-loop.$(OBJEXT) - -rm -f lib/poll-loop.lo - -rm -f lib/process.$(OBJEXT) - -rm -f lib/process.lo - -rm -f lib/random.$(OBJEXT) - -rm -f lib/random.lo - -rm -f lib/rconn.$(OBJEXT) - -rm -f lib/rconn.lo - -rm -f lib/reconnect.$(OBJEXT) - -rm -f lib/reconnect.lo - -rm -f lib/route-table-bsd.$(OBJEXT) - -rm -f lib/route-table-bsd.lo - -rm -f lib/route-table-stub.$(OBJEXT) - -rm -f lib/route-table-stub.lo - -rm -f lib/route-table.$(OBJEXT) - -rm -f lib/route-table.lo - -rm -f lib/rtbsd.$(OBJEXT) - -rm -f lib/rtbsd.lo - -rm -f lib/rtnetlink-link.$(OBJEXT) - -rm -f lib/rtnetlink-link.lo - -rm -f lib/seq.$(OBJEXT) - -rm -f lib/seq.lo - -rm -f lib/sha1.$(OBJEXT) - -rm -f lib/sha1.lo - -rm -f lib/shash.$(OBJEXT) - -rm -f lib/shash.lo - -rm -f lib/signals.$(OBJEXT) - -rm -f lib/signals.lo - -rm -f lib/simap.$(OBJEXT) - -rm -f lib/simap.lo - -rm -f lib/smap.$(OBJEXT) - -rm -f lib/smap.lo - -rm -f lib/socket-util.$(OBJEXT) - -rm -f lib/socket-util.lo - -rm -f lib/sort.$(OBJEXT) - -rm -f lib/sort.lo - -rm -f lib/sset.$(OBJEXT) - -rm -f lib/sset.lo - -rm -f lib/stdio.$(OBJEXT) - -rm -f lib/stdio.lo - -rm -f lib/stp.$(OBJEXT) - -rm -f lib/stp.lo - -rm -f lib/stream-fd-unix.$(OBJEXT) - -rm -f lib/stream-fd-unix.lo - -rm -f lib/stream-fd-windows.$(OBJEXT) - -rm -f lib/stream-fd-windows.lo - -rm -f lib/stream-nossl.$(OBJEXT) - -rm -f lib/stream-nossl.lo - -rm -f lib/stream-ssl.$(OBJEXT) - -rm -f lib/stream-ssl.lo - -rm -f lib/stream-tcp.$(OBJEXT) - -rm -f lib/stream-tcp.lo - -rm -f lib/stream-unix.$(OBJEXT) - -rm -f lib/stream-unix.lo - -rm -f lib/stream.$(OBJEXT) - -rm -f lib/stream.lo - -rm -f lib/string.$(OBJEXT) - -rm -f lib/string.lo - -rm -f lib/strsep.$(OBJEXT) - -rm -f lib/strsep.lo - -rm -f lib/svec.$(OBJEXT) - -rm -f lib/svec.lo - -rm -f lib/table.$(OBJEXT) - -rm -f lib/table.lo - -rm -f lib/tag.$(OBJEXT) - -rm -f lib/tag.lo - -rm -f lib/timer.$(OBJEXT) - -rm -f lib/timer.lo - -rm -f lib/timeval.$(OBJEXT) - -rm -f lib/timeval.lo - -rm -f lib/token-bucket.$(OBJEXT) - -rm -f lib/token-bucket.lo - -rm -f lib/unicode.$(OBJEXT) - -rm -f lib/unicode.lo - -rm -f lib/unixctl.$(OBJEXT) - -rm -f lib/unixctl.lo - -rm -f lib/util.$(OBJEXT) - -rm -f lib/util.lo - -rm -f lib/uuid.$(OBJEXT) - -rm -f lib/uuid.lo - -rm -f lib/vconn-stream.$(OBJEXT) - -rm -f lib/vconn-stream.lo - -rm -f lib/vconn.$(OBJEXT) - -rm -f lib/vconn.lo - -rm -f lib/vlan-bitmap.$(OBJEXT) - -rm -f lib/vlan-bitmap.lo - -rm -f lib/vlandev.$(OBJEXT) - -rm -f lib/vlandev.lo - -rm -f lib/vlog.$(OBJEXT) - -rm -f lib/vlog.lo - -rm -f lib/vswitch-idl.$(OBJEXT) - -rm -f lib/vswitch-idl.lo - -rm -f lib/vtep-idl.$(OBJEXT) - -rm -f lib/vtep-idl.lo - -rm -f ofproto/ofproto_libofproto_la-bond.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-bond.lo - -rm -f ofproto/ofproto_libofproto_la-bundles.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-bundles.lo - -rm -f ofproto/ofproto_libofproto_la-collectors.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-collectors.lo - -rm -f ofproto/ofproto_libofproto_la-connmgr.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-connmgr.lo - -rm -f ofproto/ofproto_libofproto_la-fail-open.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-fail-open.lo - -rm -f ofproto/ofproto_libofproto_la-in-band.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-in-band.lo - -rm -f ofproto/ofproto_libofproto_la-names.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-names.lo - -rm -f ofproto/ofproto_libofproto_la-netflow.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-netflow.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-rid.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto-dpif.lo - -rm -f ofproto/ofproto_libofproto_la-ofproto.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-ofproto.lo - -rm -f ofproto/ofproto_libofproto_la-pinsched.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-pinsched.lo - -rm -f ofproto/ofproto_libofproto_la-pktbuf.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-pktbuf.lo - -rm -f ofproto/ofproto_libofproto_la-tunnel.$(OBJEXT) - -rm -f ofproto/ofproto_libofproto_la-tunnel.lo - -rm -f ovsdb/ovsdb-client.$(OBJEXT) - -rm -f ovsdb/ovsdb-server.$(OBJEXT) - -rm -f ovsdb/ovsdb-tool.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-column.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-column.lo - -rm -f ovsdb/ovsdb_libovsdb_la-condition.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-condition.lo - -rm -f ovsdb/ovsdb_libovsdb_la-execution.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-execution.lo - -rm -f ovsdb/ovsdb_libovsdb_la-file.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-file.lo - -rm -f ovsdb/ovsdb_libovsdb_la-jsonrpc-server.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo - -rm -f ovsdb/ovsdb_libovsdb_la-log.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-log.lo - -rm -f ovsdb/ovsdb_libovsdb_la-mutation.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-mutation.lo - -rm -f ovsdb/ovsdb_libovsdb_la-ovsdb.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-ovsdb.lo - -rm -f ovsdb/ovsdb_libovsdb_la-query.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-query.lo - -rm -f ovsdb/ovsdb_libovsdb_la-row.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-row.lo - -rm -f ovsdb/ovsdb_libovsdb_la-server.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-server.lo - -rm -f ovsdb/ovsdb_libovsdb_la-table.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-table.lo - -rm -f ovsdb/ovsdb_libovsdb_la-transaction.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-transaction.lo - -rm -f ovsdb/ovsdb_libovsdb_la-trigger.$(OBJEXT) - -rm -f ovsdb/ovsdb_libovsdb_la-trigger.lo - -rm -f tests/idltest.$(OBJEXT) - -rm -f tests/ovstest.$(OBJEXT) - -rm -f tests/test-aes128.$(OBJEXT) - -rm -f tests/test-atomic.$(OBJEXT) - -rm -f tests/test-bundle.$(OBJEXT) - -rm -f tests/test-byte-order.$(OBJEXT) - -rm -f tests/test-classifier.$(OBJEXT) - -rm -f tests/test-controller.$(OBJEXT) - -rm -f tests/test-csum.$(OBJEXT) - -rm -f tests/test-file_name.$(OBJEXT) - -rm -f tests/test-flows.$(OBJEXT) - -rm -f tests/test-hash.$(OBJEXT) - -rm -f tests/test-heap.$(OBJEXT) - -rm -f tests/test-hindex.$(OBJEXT) - -rm -f tests/test-hmap.$(OBJEXT) - -rm -f tests/test-json.$(OBJEXT) - -rm -f tests/test-jsonrpc.$(OBJEXT) - -rm -f tests/test-list.$(OBJEXT) - -rm -f tests/test-lockfile.$(OBJEXT) - -rm -f tests/test-multipath.$(OBJEXT) - -rm -f tests/test-netflow.$(OBJEXT) - -rm -f tests/test-odp.$(OBJEXT) - -rm -f tests/test-ovsdb.$(OBJEXT) - -rm -f tests/test-packets.$(OBJEXT) - -rm -f tests/test-random.$(OBJEXT) - -rm -f tests/test-reconnect.$(OBJEXT) - -rm -f tests/test-sflow.$(OBJEXT) - -rm -f tests/test-sha1.$(OBJEXT) - -rm -f tests/test-stp.$(OBJEXT) - -rm -f tests/test-strtok_r.$(OBJEXT) - -rm -f tests/test-type-props.$(OBJEXT) - -rm -f tests/test-unix-socket.$(OBJEXT) - -rm -f tests/test-util.$(OBJEXT) - -rm -f tests/test-uuid.$(OBJEXT) - -rm -f tests/test-vconn.$(OBJEXT) - -rm -f utilities/nlmon.$(OBJEXT) - -rm -f utilities/ovs-appctl.$(OBJEXT) - -rm -f utilities/ovs-benchmark.$(OBJEXT) - -rm -f utilities/ovs-dpctl.$(OBJEXT) - -rm -f utilities/ovs-ofctl.$(OBJEXT) - -rm -f utilities/ovs-vlan-bug-workaround.$(OBJEXT) - -rm -f utilities/ovs-vsctl.$(OBJEXT) - -rm -f vswitchd/bridge.$(OBJEXT) - -rm -f vswitchd/ovs-vswitchd.$(OBJEXT) - -rm -f vswitchd/system-stats.$(OBJEXT) - -rm -f vswitchd/xenserver.$(OBJEXT) - -rm -f vtep/vtep-ctl.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/aes128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/async-append-aio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/async-append-null.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/backtrace.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bfd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bundle.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/byteq.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/cfm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/classifier.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/command-line.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/connectivity.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/coverage.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/crc32c.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/csum.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/daemon-unix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/daemon-windows.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/daemon.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dhparams.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dpif-linux.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dpif-netdev.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dpif.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dummy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dynamic-string.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/entropy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fat-rwlock.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fatal-signal.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/flow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt_long.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getrusage-windows.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/guarded-list.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/heap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hindex.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hmapx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/jhash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/json.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/jsonrpc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lacp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/latch-unix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/latch-windows.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/learn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/learning-switch.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libsflow_la-sflow_agent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libsflow_la-sflow_poller.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libsflow_la-sflow_receiver.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libsflow_la-sflow_sampler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/list.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lockfile.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mac-learning.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/match.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/memory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/meta-flow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/multipath.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netdev-bsd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netdev-dpdk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netdev-dummy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netdev-linux.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netdev-vport.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netdev.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netlink-notifier.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netlink-socket.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/netlink.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/nx-match.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/odp-execute.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/odp-util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofp-actions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofp-errors.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofp-msgs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofp-parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofp-print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofp-util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofp-version-opt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ofpbuf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovs-atomic-locked.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovs-rcu.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovs-thread.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovsdb-data.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovsdb-error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovsdb-idl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovsdb-parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ovsdb-types.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/packets.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pcap-file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/poll-loop.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/process.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/random.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/rconn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/reconnect.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/route-table-bsd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/route-table-stub.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/route-table.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/rtbsd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/rtnetlink-link.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/seq.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sha1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/shash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signals.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/simap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/smap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/socket-util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sort.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stdio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stream-fd-unix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stream-fd-windows.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stream-nossl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stream-ssl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stream-tcp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stream-unix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/string.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strsep.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/svec.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/table.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/tag.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/timer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/timeval.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/token-bucket.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unicode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unixctl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/uuid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vconn-stream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vconn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vlan-bitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vlandev.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vlog.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vswitch-idl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vtep-idl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-bond.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-bundles.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-collectors.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-connmgr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-fail-open.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-in-band.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-names.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-netflow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-ipfix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-mirror.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-monitor.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-rid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-sflow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-upcall.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-xlate.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-pinsched.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-pktbuf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ofproto/$(DEPDIR)/ofproto_libofproto_la-tunnel.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb-client.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb-server.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb-tool.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-column.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-condition.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-execution.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-jsonrpc-server.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-log.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-mutation.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-ovsdb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-query.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-row.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-server.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-table.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-transaction.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-trigger.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/idltest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/ovstest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-aes128.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-atomic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-bundle.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-byte-order.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-classifier.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-controller.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-csum.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-file_name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-flows.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-hash.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-heap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-hindex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-hmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-json.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-jsonrpc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-lockfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-multipath.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-netflow.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-odp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-ovsdb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-packets.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-random.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-reconnect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-sflow.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-sha1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-stp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-strtok_r.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-type-props.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-unix-socket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-uuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-vconn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@utilities/$(DEPDIR)/nlmon.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@utilities/$(DEPDIR)/ovs-appctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@utilities/$(DEPDIR)/ovs-benchmark.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@utilities/$(DEPDIR)/ovs-dpctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@utilities/$(DEPDIR)/ovs-ofctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@utilities/$(DEPDIR)/ovs-vlan-bug-workaround.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@utilities/$(DEPDIR)/ovs-vsctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@vswitchd/$(DEPDIR)/bridge.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@vswitchd/$(DEPDIR)/ovs-vswitchd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@vswitchd/$(DEPDIR)/system-stats.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@vswitchd/$(DEPDIR)/xenserver.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@vtep/$(DEPDIR)/vtep-ctl.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -lib/lib_libsflow_la-sflow_agent.lo: lib/sflow_agent.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -MT lib/lib_libsflow_la-sflow_agent.lo -MD -MP -MF lib/$(DEPDIR)/lib_libsflow_la-sflow_agent.Tpo -c -o lib/lib_libsflow_la-sflow_agent.lo `test -f 'lib/sflow_agent.c' || echo '$(srcdir)/'`lib/sflow_agent.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lib/$(DEPDIR)/lib_libsflow_la-sflow_agent.Tpo lib/$(DEPDIR)/lib_libsflow_la-sflow_agent.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/sflow_agent.c' object='lib/lib_libsflow_la-sflow_agent.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -c -o lib/lib_libsflow_la-sflow_agent.lo `test -f 'lib/sflow_agent.c' || echo '$(srcdir)/'`lib/sflow_agent.c - -lib/lib_libsflow_la-sflow_sampler.lo: lib/sflow_sampler.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -MT lib/lib_libsflow_la-sflow_sampler.lo -MD -MP -MF lib/$(DEPDIR)/lib_libsflow_la-sflow_sampler.Tpo -c -o lib/lib_libsflow_la-sflow_sampler.lo `test -f 'lib/sflow_sampler.c' || echo '$(srcdir)/'`lib/sflow_sampler.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lib/$(DEPDIR)/lib_libsflow_la-sflow_sampler.Tpo lib/$(DEPDIR)/lib_libsflow_la-sflow_sampler.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/sflow_sampler.c' object='lib/lib_libsflow_la-sflow_sampler.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -c -o lib/lib_libsflow_la-sflow_sampler.lo `test -f 'lib/sflow_sampler.c' || echo '$(srcdir)/'`lib/sflow_sampler.c - -lib/lib_libsflow_la-sflow_poller.lo: lib/sflow_poller.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -MT lib/lib_libsflow_la-sflow_poller.lo -MD -MP -MF lib/$(DEPDIR)/lib_libsflow_la-sflow_poller.Tpo -c -o lib/lib_libsflow_la-sflow_poller.lo `test -f 'lib/sflow_poller.c' || echo '$(srcdir)/'`lib/sflow_poller.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lib/$(DEPDIR)/lib_libsflow_la-sflow_poller.Tpo lib/$(DEPDIR)/lib_libsflow_la-sflow_poller.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/sflow_poller.c' object='lib/lib_libsflow_la-sflow_poller.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -c -o lib/lib_libsflow_la-sflow_poller.lo `test -f 'lib/sflow_poller.c' || echo '$(srcdir)/'`lib/sflow_poller.c - -lib/lib_libsflow_la-sflow_receiver.lo: lib/sflow_receiver.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -MT lib/lib_libsflow_la-sflow_receiver.lo -MD -MP -MF lib/$(DEPDIR)/lib_libsflow_la-sflow_receiver.Tpo -c -o lib/lib_libsflow_la-sflow_receiver.lo `test -f 'lib/sflow_receiver.c' || echo '$(srcdir)/'`lib/sflow_receiver.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lib/$(DEPDIR)/lib_libsflow_la-sflow_receiver.Tpo lib/$(DEPDIR)/lib_libsflow_la-sflow_receiver.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/sflow_receiver.c' object='lib/lib_libsflow_la-sflow_receiver.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libsflow_la_CPPFLAGS) $(CPPFLAGS) $(lib_libsflow_la_CFLAGS) $(CFLAGS) -c -o lib/lib_libsflow_la-sflow_receiver.lo `test -f 'lib/sflow_receiver.c' || echo '$(srcdir)/'`lib/sflow_receiver.c - -ofproto/ofproto_libofproto_la-bond.lo: ofproto/bond.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-bond.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-bond.Tpo -c -o ofproto/ofproto_libofproto_la-bond.lo `test -f 'ofproto/bond.c' || echo '$(srcdir)/'`ofproto/bond.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-bond.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-bond.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/bond.c' object='ofproto/ofproto_libofproto_la-bond.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-bond.lo `test -f 'ofproto/bond.c' || echo '$(srcdir)/'`ofproto/bond.c - -ofproto/ofproto_libofproto_la-collectors.lo: ofproto/collectors.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-collectors.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-collectors.Tpo -c -o ofproto/ofproto_libofproto_la-collectors.lo `test -f 'ofproto/collectors.c' || echo '$(srcdir)/'`ofproto/collectors.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-collectors.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-collectors.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/collectors.c' object='ofproto/ofproto_libofproto_la-collectors.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-collectors.lo `test -f 'ofproto/collectors.c' || echo '$(srcdir)/'`ofproto/collectors.c - -ofproto/ofproto_libofproto_la-connmgr.lo: ofproto/connmgr.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-connmgr.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-connmgr.Tpo -c -o ofproto/ofproto_libofproto_la-connmgr.lo `test -f 'ofproto/connmgr.c' || echo '$(srcdir)/'`ofproto/connmgr.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-connmgr.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-connmgr.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/connmgr.c' object='ofproto/ofproto_libofproto_la-connmgr.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-connmgr.lo `test -f 'ofproto/connmgr.c' || echo '$(srcdir)/'`ofproto/connmgr.c - -ofproto/ofproto_libofproto_la-fail-open.lo: ofproto/fail-open.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-fail-open.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-fail-open.Tpo -c -o ofproto/ofproto_libofproto_la-fail-open.lo `test -f 'ofproto/fail-open.c' || echo '$(srcdir)/'`ofproto/fail-open.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-fail-open.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-fail-open.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/fail-open.c' object='ofproto/ofproto_libofproto_la-fail-open.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-fail-open.lo `test -f 'ofproto/fail-open.c' || echo '$(srcdir)/'`ofproto/fail-open.c - -ofproto/ofproto_libofproto_la-in-band.lo: ofproto/in-band.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-in-band.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-in-band.Tpo -c -o ofproto/ofproto_libofproto_la-in-band.lo `test -f 'ofproto/in-band.c' || echo '$(srcdir)/'`ofproto/in-band.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-in-band.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-in-band.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/in-band.c' object='ofproto/ofproto_libofproto_la-in-band.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-in-band.lo `test -f 'ofproto/in-band.c' || echo '$(srcdir)/'`ofproto/in-band.c - -ofproto/ofproto_libofproto_la-names.lo: ofproto/names.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-names.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-names.Tpo -c -o ofproto/ofproto_libofproto_la-names.lo `test -f 'ofproto/names.c' || echo '$(srcdir)/'`ofproto/names.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-names.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-names.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/names.c' object='ofproto/ofproto_libofproto_la-names.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-names.lo `test -f 'ofproto/names.c' || echo '$(srcdir)/'`ofproto/names.c - -ofproto/ofproto_libofproto_la-netflow.lo: ofproto/netflow.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-netflow.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-netflow.Tpo -c -o ofproto/ofproto_libofproto_la-netflow.lo `test -f 'ofproto/netflow.c' || echo '$(srcdir)/'`ofproto/netflow.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-netflow.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-netflow.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/netflow.c' object='ofproto/ofproto_libofproto_la-netflow.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-netflow.lo `test -f 'ofproto/netflow.c' || echo '$(srcdir)/'`ofproto/netflow.c - -ofproto/ofproto_libofproto_la-ofproto.lo: ofproto/ofproto.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto.lo `test -f 'ofproto/ofproto.c' || echo '$(srcdir)/'`ofproto/ofproto.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto.c' object='ofproto/ofproto_libofproto_la-ofproto.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto.lo `test -f 'ofproto/ofproto.c' || echo '$(srcdir)/'`ofproto/ofproto.c - -ofproto/ofproto_libofproto_la-ofproto-dpif.lo: ofproto/ofproto-dpif.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif.lo `test -f 'ofproto/ofproto-dpif.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif.lo `test -f 'ofproto/ofproto-dpif.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif.c - -ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo: ofproto/ofproto-dpif-ipfix.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-ipfix.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo `test -f 'ofproto/ofproto-dpif-ipfix.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-ipfix.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-ipfix.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-ipfix.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif-ipfix.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-ipfix.lo `test -f 'ofproto/ofproto-dpif-ipfix.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-ipfix.c - -ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo: ofproto/ofproto-dpif-mirror.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-mirror.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo `test -f 'ofproto/ofproto-dpif-mirror.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-mirror.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-mirror.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-mirror.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif-mirror.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-mirror.lo `test -f 'ofproto/ofproto-dpif-mirror.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-mirror.c - -ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo: ofproto/ofproto-dpif-monitor.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-monitor.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo `test -f 'ofproto/ofproto-dpif-monitor.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-monitor.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-monitor.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-monitor.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif-monitor.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-monitor.lo `test -f 'ofproto/ofproto-dpif-monitor.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-monitor.c - -ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo: ofproto/ofproto-dpif-rid.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-rid.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo `test -f 'ofproto/ofproto-dpif-rid.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-rid.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-rid.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-rid.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif-rid.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-rid.lo `test -f 'ofproto/ofproto-dpif-rid.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-rid.c - -ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo: ofproto/ofproto-dpif-sflow.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-sflow.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo `test -f 'ofproto/ofproto-dpif-sflow.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-sflow.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-sflow.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-sflow.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif-sflow.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-sflow.lo `test -f 'ofproto/ofproto-dpif-sflow.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-sflow.c - -ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo: ofproto/ofproto-dpif-upcall.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-upcall.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo `test -f 'ofproto/ofproto-dpif-upcall.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-upcall.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-upcall.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-upcall.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif-upcall.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-upcall.lo `test -f 'ofproto/ofproto-dpif-upcall.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-upcall.c - -ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo: ofproto/ofproto-dpif-xlate.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-xlate.Tpo -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo `test -f 'ofproto/ofproto-dpif-xlate.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-xlate.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-xlate.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-ofproto-dpif-xlate.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/ofproto-dpif-xlate.c' object='ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-ofproto-dpif-xlate.lo `test -f 'ofproto/ofproto-dpif-xlate.c' || echo '$(srcdir)/'`ofproto/ofproto-dpif-xlate.c - -ofproto/ofproto_libofproto_la-pktbuf.lo: ofproto/pktbuf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-pktbuf.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-pktbuf.Tpo -c -o ofproto/ofproto_libofproto_la-pktbuf.lo `test -f 'ofproto/pktbuf.c' || echo '$(srcdir)/'`ofproto/pktbuf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-pktbuf.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-pktbuf.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/pktbuf.c' object='ofproto/ofproto_libofproto_la-pktbuf.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-pktbuf.lo `test -f 'ofproto/pktbuf.c' || echo '$(srcdir)/'`ofproto/pktbuf.c - -ofproto/ofproto_libofproto_la-pinsched.lo: ofproto/pinsched.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-pinsched.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-pinsched.Tpo -c -o ofproto/ofproto_libofproto_la-pinsched.lo `test -f 'ofproto/pinsched.c' || echo '$(srcdir)/'`ofproto/pinsched.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-pinsched.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-pinsched.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/pinsched.c' object='ofproto/ofproto_libofproto_la-pinsched.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-pinsched.lo `test -f 'ofproto/pinsched.c' || echo '$(srcdir)/'`ofproto/pinsched.c - -ofproto/ofproto_libofproto_la-tunnel.lo: ofproto/tunnel.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-tunnel.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-tunnel.Tpo -c -o ofproto/ofproto_libofproto_la-tunnel.lo `test -f 'ofproto/tunnel.c' || echo '$(srcdir)/'`ofproto/tunnel.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-tunnel.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-tunnel.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/tunnel.c' object='ofproto/ofproto_libofproto_la-tunnel.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-tunnel.lo `test -f 'ofproto/tunnel.c' || echo '$(srcdir)/'`ofproto/tunnel.c - -ofproto/ofproto_libofproto_la-bundles.lo: ofproto/bundles.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -MT ofproto/ofproto_libofproto_la-bundles.lo -MD -MP -MF ofproto/$(DEPDIR)/ofproto_libofproto_la-bundles.Tpo -c -o ofproto/ofproto_libofproto_la-bundles.lo `test -f 'ofproto/bundles.c' || echo '$(srcdir)/'`ofproto/bundles.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ofproto/$(DEPDIR)/ofproto_libofproto_la-bundles.Tpo ofproto/$(DEPDIR)/ofproto_libofproto_la-bundles.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ofproto/bundles.c' object='ofproto/ofproto_libofproto_la-bundles.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ofproto_libofproto_la_CPPFLAGS) $(CPPFLAGS) $(ofproto_libofproto_la_CFLAGS) $(CFLAGS) -c -o ofproto/ofproto_libofproto_la-bundles.lo `test -f 'ofproto/bundles.c' || echo '$(srcdir)/'`ofproto/bundles.c - -ovsdb/ovsdb_libovsdb_la-column.lo: ovsdb/column.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-column.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-column.Tpo -c -o ovsdb/ovsdb_libovsdb_la-column.lo `test -f 'ovsdb/column.c' || echo '$(srcdir)/'`ovsdb/column.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-column.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-column.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/column.c' object='ovsdb/ovsdb_libovsdb_la-column.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-column.lo `test -f 'ovsdb/column.c' || echo '$(srcdir)/'`ovsdb/column.c - -ovsdb/ovsdb_libovsdb_la-condition.lo: ovsdb/condition.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-condition.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-condition.Tpo -c -o ovsdb/ovsdb_libovsdb_la-condition.lo `test -f 'ovsdb/condition.c' || echo '$(srcdir)/'`ovsdb/condition.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-condition.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-condition.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/condition.c' object='ovsdb/ovsdb_libovsdb_la-condition.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-condition.lo `test -f 'ovsdb/condition.c' || echo '$(srcdir)/'`ovsdb/condition.c - -ovsdb/ovsdb_libovsdb_la-execution.lo: ovsdb/execution.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-execution.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-execution.Tpo -c -o ovsdb/ovsdb_libovsdb_la-execution.lo `test -f 'ovsdb/execution.c' || echo '$(srcdir)/'`ovsdb/execution.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-execution.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-execution.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/execution.c' object='ovsdb/ovsdb_libovsdb_la-execution.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-execution.lo `test -f 'ovsdb/execution.c' || echo '$(srcdir)/'`ovsdb/execution.c - -ovsdb/ovsdb_libovsdb_la-file.lo: ovsdb/file.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-file.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-file.Tpo -c -o ovsdb/ovsdb_libovsdb_la-file.lo `test -f 'ovsdb/file.c' || echo '$(srcdir)/'`ovsdb/file.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-file.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-file.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/file.c' object='ovsdb/ovsdb_libovsdb_la-file.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-file.lo `test -f 'ovsdb/file.c' || echo '$(srcdir)/'`ovsdb/file.c - -ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo: ovsdb/jsonrpc-server.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-jsonrpc-server.Tpo -c -o ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo `test -f 'ovsdb/jsonrpc-server.c' || echo '$(srcdir)/'`ovsdb/jsonrpc-server.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-jsonrpc-server.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-jsonrpc-server.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/jsonrpc-server.c' object='ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-jsonrpc-server.lo `test -f 'ovsdb/jsonrpc-server.c' || echo '$(srcdir)/'`ovsdb/jsonrpc-server.c - -ovsdb/ovsdb_libovsdb_la-log.lo: ovsdb/log.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-log.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-log.Tpo -c -o ovsdb/ovsdb_libovsdb_la-log.lo `test -f 'ovsdb/log.c' || echo '$(srcdir)/'`ovsdb/log.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-log.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-log.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/log.c' object='ovsdb/ovsdb_libovsdb_la-log.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-log.lo `test -f 'ovsdb/log.c' || echo '$(srcdir)/'`ovsdb/log.c - -ovsdb/ovsdb_libovsdb_la-mutation.lo: ovsdb/mutation.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-mutation.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-mutation.Tpo -c -o ovsdb/ovsdb_libovsdb_la-mutation.lo `test -f 'ovsdb/mutation.c' || echo '$(srcdir)/'`ovsdb/mutation.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-mutation.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-mutation.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/mutation.c' object='ovsdb/ovsdb_libovsdb_la-mutation.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-mutation.lo `test -f 'ovsdb/mutation.c' || echo '$(srcdir)/'`ovsdb/mutation.c - -ovsdb/ovsdb_libovsdb_la-ovsdb.lo: ovsdb/ovsdb.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-ovsdb.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-ovsdb.Tpo -c -o ovsdb/ovsdb_libovsdb_la-ovsdb.lo `test -f 'ovsdb/ovsdb.c' || echo '$(srcdir)/'`ovsdb/ovsdb.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-ovsdb.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-ovsdb.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/ovsdb.c' object='ovsdb/ovsdb_libovsdb_la-ovsdb.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-ovsdb.lo `test -f 'ovsdb/ovsdb.c' || echo '$(srcdir)/'`ovsdb/ovsdb.c - -ovsdb/ovsdb_libovsdb_la-query.lo: ovsdb/query.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-query.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-query.Tpo -c -o ovsdb/ovsdb_libovsdb_la-query.lo `test -f 'ovsdb/query.c' || echo '$(srcdir)/'`ovsdb/query.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-query.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-query.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/query.c' object='ovsdb/ovsdb_libovsdb_la-query.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-query.lo `test -f 'ovsdb/query.c' || echo '$(srcdir)/'`ovsdb/query.c - -ovsdb/ovsdb_libovsdb_la-row.lo: ovsdb/row.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-row.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-row.Tpo -c -o ovsdb/ovsdb_libovsdb_la-row.lo `test -f 'ovsdb/row.c' || echo '$(srcdir)/'`ovsdb/row.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-row.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-row.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/row.c' object='ovsdb/ovsdb_libovsdb_la-row.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-row.lo `test -f 'ovsdb/row.c' || echo '$(srcdir)/'`ovsdb/row.c - -ovsdb/ovsdb_libovsdb_la-server.lo: ovsdb/server.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-server.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-server.Tpo -c -o ovsdb/ovsdb_libovsdb_la-server.lo `test -f 'ovsdb/server.c' || echo '$(srcdir)/'`ovsdb/server.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-server.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-server.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/server.c' object='ovsdb/ovsdb_libovsdb_la-server.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-server.lo `test -f 'ovsdb/server.c' || echo '$(srcdir)/'`ovsdb/server.c - -ovsdb/ovsdb_libovsdb_la-table.lo: ovsdb/table.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-table.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-table.Tpo -c -o ovsdb/ovsdb_libovsdb_la-table.lo `test -f 'ovsdb/table.c' || echo '$(srcdir)/'`ovsdb/table.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-table.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-table.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/table.c' object='ovsdb/ovsdb_libovsdb_la-table.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-table.lo `test -f 'ovsdb/table.c' || echo '$(srcdir)/'`ovsdb/table.c - -ovsdb/ovsdb_libovsdb_la-trigger.lo: ovsdb/trigger.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-trigger.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-trigger.Tpo -c -o ovsdb/ovsdb_libovsdb_la-trigger.lo `test -f 'ovsdb/trigger.c' || echo '$(srcdir)/'`ovsdb/trigger.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-trigger.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-trigger.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/trigger.c' object='ovsdb/ovsdb_libovsdb_la-trigger.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-trigger.lo `test -f 'ovsdb/trigger.c' || echo '$(srcdir)/'`ovsdb/trigger.c - -ovsdb/ovsdb_libovsdb_la-transaction.lo: ovsdb/transaction.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -MT ovsdb/ovsdb_libovsdb_la-transaction.lo -MD -MP -MF ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-transaction.Tpo -c -o ovsdb/ovsdb_libovsdb_la-transaction.lo `test -f 'ovsdb/transaction.c' || echo '$(srcdir)/'`ovsdb/transaction.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-transaction.Tpo ovsdb/$(DEPDIR)/ovsdb_libovsdb_la-transaction.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ovsdb/transaction.c' object='ovsdb/ovsdb_libovsdb_la-transaction.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ovsdb_libovsdb_la_CPPFLAGS) $(CPPFLAGS) $(ovsdb_libovsdb_la_CFLAGS) $(CFLAGS) -c -o ovsdb/ovsdb_libovsdb_la-transaction.lo `test -f 'ovsdb/transaction.c' || echo '$(srcdir)/'`ovsdb/transaction.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -rm -rf lib/.libs lib/_libs - -rm -rf ofproto/.libs ofproto/_libs - -rm -rf ovsdb/.libs ovsdb/_libs - -rm -rf tests/.libs tests/_libs - -rm -rf utilities/.libs utilities/_libs - -rm -rf vswitchd/.libs vswitchd/_libs - -rm -rf vtep/.libs vtep/_libs - -distclean-libtool: - -rm -f libtool config.lt -install-man1: $(dist_man_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list=''; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } -install-man5: $(dist_man_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" - @list=''; test -n "$(man5dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.5[a-z]*$$/p'; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ - done; } - -uninstall-man5: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man5dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.5[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man5dir)" && rm -f $$files; } -install-man8: $(dist_man_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" - @list=''; test -n "$(man8dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.8[a-z]*$$/p'; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ - done; } - -uninstall-man8: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man8dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.8[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } -install-dist_pkgdataDATA: $(dist_pkgdata_DATA) - @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ - done - -uninstall-dist_pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files -install-dist_scriptsDATA: $(dist_scripts_DATA) - @$(NORMAL_INSTALL) - test -z "$(scriptsdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptsdir)" - @list='$(dist_scripts_DATA)'; test -n "$(scriptsdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(scriptsdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(scriptsdir)" || exit $$?; \ - done - -uninstall-dist_scriptsDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_scripts_DATA)'; test -n "$(scriptsdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(scriptsdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(scriptsdir)" && rm -f $$files -install-nobase_pkgdataDATA: $(nobase_pkgdata_DATA) - @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" - @list='$(nobase_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - $(am__nobase_list) | while read dir files; do \ - xfiles=; for file in $$files; do \ - if test -f "$$file"; then xfiles="$$xfiles $$file"; \ - else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ - test -z "$$xfiles" || { \ - test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(pkgdatadir)/$$dir'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)/$$dir"; }; \ - echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(pkgdatadir)/$$dir'"; \ - $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(pkgdatadir)/$$dir" || exit $$?; }; \ - done - -uninstall-nobase_pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(nobase_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files -install-pkgdataDATA: $(pkgdata_DATA) - @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" - @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ - done - -uninstall-pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files -install-scriptsDATA: $(scripts_DATA) - @$(NORMAL_INSTALL) - test -z "$(scriptsdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptsdir)" - @list='$(scripts_DATA)'; test -n "$(scriptsdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(scriptsdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(scriptsdir)" || exit $$?; \ - done - -uninstall-scriptsDATA: - @$(NORMAL_UNINSTALL) - @list='$(scripts_DATA)'; test -n "$(scriptsdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(scriptsdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(scriptsdir)" && rm -f $$files - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(dist_check_SCRIPTS) $(check_DATA) - $(MAKE) $(AM_MAKEFLAGS) check-local -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ - $(HEADERS) config.h all-local -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(scriptsdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f lib/$(DEPDIR)/$(am__dirstamp) - -rm -f lib/$(am__dirstamp) - -rm -f ofproto/$(DEPDIR)/$(am__dirstamp) - -rm -f ofproto/$(am__dirstamp) - -rm -f ovsdb/$(DEPDIR)/$(am__dirstamp) - -rm -f ovsdb/$(am__dirstamp) - -rm -f tests/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/$(am__dirstamp) - -rm -f utilities/$(DEPDIR)/$(am__dirstamp) - -rm -f utilities/$(am__dirstamp) - -rm -f vswitchd/$(DEPDIR)/$(am__dirstamp) - -rm -f vswitchd/$(am__dirstamp) - -rm -f vtep/$(DEPDIR)/$(am__dirstamp) - -rm -f vtep/$(am__dirstamp) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-recursive - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-local clean-noinstPROGRAMS \ - clean-sbinPROGRAMS mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf lib/$(DEPDIR) ofproto/$(DEPDIR) ovsdb/$(DEPDIR) tests/$(DEPDIR) utilities/$(DEPDIR) vswitchd/$(DEPDIR) vtep/$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-data-local install-dist_pkgdataDATA \ - install-dist_pkgdataSCRIPTS install-dist_scriptsDATA \ - install-dist_scriptsSCRIPTS install-man \ - install-nobase_pkgdataDATA install-pkgdataDATA \ - install-scriptsDATA install-scriptsSCRIPTS - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-binSCRIPTS \ - install-dist_sbinSCRIPTS install-libLTLIBRARIES \ - install-sbinPROGRAMS install-sbinSCRIPTS - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: install-man1 install-man5 install-man8 - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf lib/$(DEPDIR) ofproto/$(DEPDIR) ovsdb/$(DEPDIR) tests/$(DEPDIR) utilities/$(DEPDIR) vswitchd/$(DEPDIR) vtep/$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-dist_pkgdataDATA uninstall-dist_pkgdataSCRIPTS \ - uninstall-dist_sbinSCRIPTS uninstall-dist_scriptsDATA \ - uninstall-dist_scriptsSCRIPTS uninstall-libLTLIBRARIES \ - uninstall-local uninstall-man uninstall-nobase_pkgdataDATA \ - uninstall-pkgdataDATA uninstall-sbinPROGRAMS \ - uninstall-sbinSCRIPTS uninstall-scriptsDATA \ - uninstall-scriptsSCRIPTS - -uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ - check-am ctags-recursive install install-am install-strip \ - tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am all-local am--refresh check check-am check-local \ - clean clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-local clean-noinstPROGRAMS \ - clean-sbinPROGRAMS ctags ctags-recursive dist dist-all \ - dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-binSCRIPTS install-data \ - install-data-am install-data-local install-dist_pkgdataDATA \ - install-dist_pkgdataSCRIPTS install-dist_sbinSCRIPTS \ - install-dist_scriptsDATA install-dist_scriptsSCRIPTS \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-man1 install-man5 \ - install-man8 install-nobase_pkgdataDATA install-pdf \ - install-pdf-am install-pkgdataDATA install-ps install-ps-am \ - install-sbinPROGRAMS install-sbinSCRIPTS install-scriptsDATA \ - install-scriptsSCRIPTS install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-dist_pkgdataDATA uninstall-dist_pkgdataSCRIPTS \ - uninstall-dist_sbinSCRIPTS uninstall-dist_scriptsDATA \ - uninstall-dist_scriptsSCRIPTS uninstall-libLTLIBRARIES \ - uninstall-local uninstall-man uninstall-man1 uninstall-man5 \ - uninstall-man8 uninstall-nobase_pkgdataDATA \ - uninstall-pkgdataDATA uninstall-sbinPROGRAMS \ - uninstall-sbinSCRIPTS uninstall-scriptsDATA \ - uninstall-scriptsSCRIPTS - -.in: - $(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \ - sed \ - -e 's,[@]PKIDIR[@],$(PKIDIR),g' \ - -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ - -e 's,[@]DBDIR[@],$(DBDIR),g' \ - -e 's,[@]PERL[@],$(PERL),g' \ - -e 's,[@]PYTHON[@],$(PYTHON),g' \ - -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ - -e 's,[@]VERSION[@],$(VERSION),g' \ - -e 's,[@]localstatedir[@],$(localstatedir),g' \ - -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ - -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ - -e 's,[@]bindir[@],$(bindir),g' \ - -e 's,[@]sbindir[@],$(sbindir),g' \ - -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \ - > $@.tmp - @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \ - chmod +x $@.tmp; \ - fi - $(AM_V_GEN) mv $@.tmp $@ - -.PHONY: clean-pycov -clean-pycov: - cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES) -@GNU_MAKE_TRUE@dist-hook-git: distfiles -@GNU_MAKE_TRUE@ @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ -@GNU_MAKE_TRUE@ (cd datapath && $(MAKE) distfiles); \ -@GNU_MAKE_TRUE@ (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \ -@GNU_MAKE_TRUE@ LC_ALL=C sort -u > all-distfiles; \ -@GNU_MAKE_TRUE@ (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \ -@GNU_MAKE_TRUE@ LC_ALL=C sort -u > all-gitfiles; \ -@GNU_MAKE_TRUE@ LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \ -@GNU_MAKE_TRUE@ if test -s missing-distfiles; then \ -@GNU_MAKE_TRUE@ echo "The distribution is missing the following files:"; \ -@GNU_MAKE_TRUE@ cat missing-distfiles; \ -@GNU_MAKE_TRUE@ exit 1; \ -@GNU_MAKE_TRUE@ fi; \ -@GNU_MAKE_TRUE@ fi -# The following is based on commands for the Automake "distdir" target. -@GNU_MAKE_TRUE@distfiles: Makefile -@GNU_MAKE_TRUE@ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ -@GNU_MAKE_TRUE@ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ -@GNU_MAKE_TRUE@ list='$(DISTFILES)'; \ -@GNU_MAKE_TRUE@ for file in $$list; do echo $$file; done | \ -@GNU_MAKE_TRUE@ sed -e "s|^$$srcdirstrip/||;t" \ -@GNU_MAKE_TRUE@ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \ -@GNU_MAKE_TRUE@ LC_ALL=C sort -u > $@ -.PHONY: dist-hook-git -config-h-check: - @cd $(srcdir); \ - if test -e .git && (git --version) >/dev/null 2>&1 && \ - git --no-pager grep -L '#include ' `git ls-files | grep '\.c$$' | \ - grep -vE '^datapath|^lib/sflow|^third-party'`; \ - then \ - echo "See above for list of violations of the rule that"; \ - echo "every C source file must #include ."; \ - exit 1; \ - fi -.PHONY: config-h-check -printf-check: - @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ - git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files $(srcdir) | grep '\.[ch]$$'`; \ - then \ - echo "See above for list of violations of the rule that"; \ - echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \ - echo "forbidden. See CodingStyle for replacements."; \ - exit 1; \ - fi -.PHONY: printf-check -static-check: - @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ - git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \ - then \ - echo "See above for list of violations of the rule that "; \ - echo "certain data structures must always be 'static'"; \ - exit 1; \ - fi -.PHONY: static-check -check-assert-h-usage: - @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ - (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \ - $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \ - then \ - echo "Files listed above unexpectedly #include <""assert.h"">."; \ - echo "Please use ovs_assert (from util.h) instead of assert."; \ - exit 1; \ - fi -.PHONY: check-assert-h-usage -thread-safety-check: - @if test -e '$(srcdir)'/.git && (git --version) >/dev/null 2>&1 && \ - grep -n -f '$(srcdir)'/build-aux/thread-safety-blacklist \ - `git ls-files '$(srcdir)' | grep '\.[ch]$$' \ - | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \ - | $(EGREP) -v ':[ ]*/?\*'; \ - then \ - echo "See above for list of calls to functions that are"; \ - echo "blacklisted due to thread safety issues"; \ - exit 1; \ - fi -@HAVE_GROFF_TRUE@manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS) -@HAVE_GROFF_TRUE@ @error=false; \ -@HAVE_GROFF_TRUE@ for manpage in $?; do \ -@HAVE_GROFF_TRUE@ LANG=en_US.UTF-8 groff -w mac -w delim -w escape -w input -w missing -w tab -T utf8 -man -p -z $$manpage >$@.tmp 2>&1; \ -@HAVE_GROFF_TRUE@ if grep warning: $@.tmp; then error=:; fi; \ -@HAVE_GROFF_TRUE@ rm -f $@.tmp; \ -@HAVE_GROFF_TRUE@ done; \ -@HAVE_GROFF_TRUE@ if $$error; then exit 1; else touch $@; fi -@HAVE_GROFF_TRUE@ $(AM_V_GEN) touch -c $@ - -ovsdb/ovsdb-client.1: \ - ovsdb/ovsdb-client.1.in \ - lib/common-syn.man \ - lib/common.man \ - lib/daemon-syn.man \ - lib/daemon.man \ - lib/ssl-bootstrap-syn.man \ - lib/ssl-bootstrap.man \ - lib/ssl-syn.man \ - lib/ssl.man \ - lib/table.man \ - lib/vlog-syn.man \ - lib/vlog.man \ - ovsdb/remote-active.man \ - ovsdb/remote-passive.man -ovsdb/ovsdb-client.1.in: -lib/common-syn.man: -lib/common.man: -lib/daemon-syn.man: -lib/daemon.man: -lib/ssl-bootstrap-syn.man: -lib/ssl-bootstrap.man: -lib/ssl-syn.man: -lib/ssl.man: -lib/table.man: -lib/vlog-syn.man: -lib/vlog.man: -ovsdb/remote-active.man: -ovsdb/remote-passive.man: - -ovsdb/ovsdb-server.1: \ - ovsdb/ovsdb-server.1.in \ - lib/common-syn.man \ - lib/common.man \ - lib/coverage-unixctl.man \ - lib/daemon-syn.man \ - lib/daemon.man \ - lib/memory-unixctl.man \ - lib/service-syn.man \ - lib/service.man \ - lib/ssl-bootstrap-syn.man \ - lib/ssl-bootstrap.man \ - lib/ssl-syn.man \ - lib/ssl.man \ - lib/unixctl-syn.man \ - lib/unixctl.man \ - lib/vlog-syn.man \ - lib/vlog-unixctl.man \ - lib/vlog.man \ - ovsdb/remote-active.man \ - ovsdb/remote-passive.man -ovsdb/ovsdb-server.1.in: -lib/common-syn.man: -lib/common.man: -lib/coverage-unixctl.man: -lib/daemon-syn.man: -lib/daemon.man: -lib/memory-unixctl.man: -lib/service-syn.man: -lib/service.man: -lib/ssl-bootstrap-syn.man: -lib/ssl-bootstrap.man: -lib/ssl-syn.man: -lib/ssl.man: -lib/unixctl-syn.man: -lib/unixctl.man: -lib/vlog-syn.man: -lib/vlog-unixctl.man: -lib/vlog.man: -ovsdb/remote-active.man: -ovsdb/remote-passive.man: - -ovsdb/ovsdb-tool.1: \ - ovsdb/ovsdb-tool.1.in \ - lib/common-syn.man \ - lib/common.man \ - lib/vlog-syn.man \ - lib/vlog.man -ovsdb/ovsdb-tool.1.in: -lib/common-syn.man: -lib/common.man: -lib/vlog-syn.man: -lib/vlog.man: - -tests/test-controller.8: \ - tests/test-controller.8.in \ - lib/common.man \ - lib/daemon.man \ - lib/ssl-peer-ca-cert.man \ - lib/ssl.man \ - lib/unixctl.man \ - lib/vconn-active.man \ - lib/vconn-passive.man \ - lib/vlog.man -tests/test-controller.8.in: -lib/common.man: -lib/daemon.man: -lib/ssl-peer-ca-cert.man: -lib/ssl.man: -lib/unixctl.man: -lib/vconn-active.man: -lib/vconn-passive.man: -lib/vlog.man: - -utilities/bugtool/ovs-bugtool.8: \ - utilities/bugtool/ovs-bugtool.8.in -utilities/bugtool/ovs-bugtool.8.in: - -utilities/ovs-appctl.8: \ - utilities/ovs-appctl.8.in \ - lib/common.man -utilities/ovs-appctl.8.in: -lib/common.man: - -utilities/ovs-benchmark.1: \ - utilities/ovs-benchmark.1.in \ - lib/ovs.tmac -utilities/ovs-benchmark.1.in: -lib/ovs.tmac: - -utilities/ovs-dpctl-top.8: \ - utilities/ovs-dpctl-top.8.in -utilities/ovs-dpctl-top.8.in: - -utilities/ovs-dpctl.8: \ - utilities/ovs-dpctl.8.in \ - lib/common.man \ - lib/vlog.man -utilities/ovs-dpctl.8.in: -lib/common.man: -lib/vlog.man: - -utilities/ovs-l3ping.8: \ - utilities/ovs-l3ping.8.in \ - lib/common-syn.man \ - lib/common.man -utilities/ovs-l3ping.8.in: -lib/common-syn.man: -lib/common.man: - -utilities/ovs-ofctl.8: \ - utilities/ovs-ofctl.8.in \ - lib/common.man \ - lib/daemon.man \ - lib/ofp-version.man \ - lib/ssl.man \ - lib/unixctl.man \ - lib/vconn-active.man \ - lib/vlog.man -utilities/ovs-ofctl.8.in: -lib/common.man: -lib/daemon.man: -lib/ofp-version.man: -lib/ssl.man: -lib/unixctl.man: -lib/vconn-active.man: -lib/vlog.man: - -utilities/ovs-pcap.1: \ - utilities/ovs-pcap.1.in \ - lib/common-syn.man \ - lib/common.man -utilities/ovs-pcap.1.in: -lib/common-syn.man: -lib/common.man: - -utilities/ovs-pki.8: \ - utilities/ovs-pki.8.in -utilities/ovs-pki.8.in: - -utilities/ovs-tcpundump.1: \ - utilities/ovs-tcpundump.1.in \ - lib/common-syn.man \ - lib/common.man -utilities/ovs-tcpundump.1.in: -lib/common-syn.man: -lib/common.man: - -utilities/ovs-test.8: \ - utilities/ovs-test.8.in \ - lib/common-syn.man \ - lib/common.man \ - utilities/ovs-vlan-bugs.man -utilities/ovs-test.8.in: -lib/common-syn.man: -lib/common.man: -utilities/ovs-vlan-bugs.man: - -utilities/ovs-vlan-bug-workaround.8: \ - utilities/ovs-vlan-bug-workaround.8.in \ - lib/common.man \ - utilities/ovs-vlan-bugs.man -utilities/ovs-vlan-bug-workaround.8.in: -lib/common.man: -utilities/ovs-vlan-bugs.man: - -utilities/ovs-vlan-test.8: \ - utilities/ovs-vlan-test.8.in \ - lib/common-syn.man \ - lib/common.man \ - utilities/ovs-vlan-bugs.man -utilities/ovs-vlan-test.8.in: -lib/common-syn.man: -lib/common.man: -utilities/ovs-vlan-bugs.man: - -utilities/ovs-vsctl.8: \ - utilities/ovs-vsctl.8.in \ - lib/common.man \ - lib/ssl-bootstrap.man \ - lib/ssl-peer-ca-cert.man \ - lib/ssl.man \ - lib/table.man \ - lib/vconn-active.man \ - lib/vconn-passive.man \ - lib/vlog.man \ - ovsdb/remote-active.man \ - ovsdb/remote-active.man \ - ovsdb/remote-passive.man \ - ovsdb/remote-passive.man -utilities/ovs-vsctl.8.in: -lib/common.man: -lib/ssl-bootstrap.man: -lib/ssl-peer-ca-cert.man: -lib/ssl.man: -lib/table.man: -lib/vconn-active.man: -lib/vconn-passive.man: -lib/vlog.man: -ovsdb/remote-active.man: -ovsdb/remote-active.man: -ovsdb/remote-passive.man: -ovsdb/remote-passive.man: - -vswitchd/ovs-vswitchd.8: \ - vswitchd/ovs-vswitchd.8.in \ - lib/common.man \ - lib/coverage-unixctl.man \ - lib/daemon.man \ - lib/memory-unixctl.man \ - lib/service.man \ - lib/ssl-bootstrap.man \ - lib/ssl.man \ - lib/vlog-unixctl.man \ - lib/vlog.man \ - ofproto/ofproto-dpif-unixctl.man \ - ofproto/ofproto-unixctl.man \ - ovsdb/remote-active.man \ - ovsdb/remote-passive.man -vswitchd/ovs-vswitchd.8.in: -lib/common.man: -lib/coverage-unixctl.man: -lib/daemon.man: -lib/memory-unixctl.man: -lib/service.man: -lib/ssl-bootstrap.man: -lib/ssl.man: -lib/vlog-unixctl.man: -lib/vlog.man: -ofproto/ofproto-dpif-unixctl.man: -ofproto/ofproto-unixctl.man: -ovsdb/remote-active.man: -ovsdb/remote-passive.man: - -vtep/vtep-ctl.8: \ - vtep/vtep-ctl.8.in \ - lib/common.man \ - lib/ssl-bootstrap.man \ - lib/ssl-peer-ca-cert.man \ - lib/ssl.man \ - lib/table.man \ - lib/vlog.man \ - ovsdb/remote-active.man \ - ovsdb/remote-active.man \ - ovsdb/remote-passive.man \ - ovsdb/remote-passive.man -vtep/vtep-ctl.8.in: -lib/common.man: -lib/ssl-bootstrap.man: -lib/ssl-peer-ca-cert.man: -lib/ssl.man: -lib/table.man: -lib/vlog.man: -ovsdb/remote-active.man: -ovsdb/remote-active.man: -ovsdb/remote-passive.man: -ovsdb/remote-passive.man: - -$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl - @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp - @if cmp -s $(@F).tmp $@; then \ - touch $@; \ - rm -f $(@F).tmp; \ - else \ - mv $(@F).tmp $@; \ - fi - -dist-hook: $(DIST_HOOKS) -all-local: $(ALL_LOCAL) -clean-local: $(CLEAN_LOCAL) -install-data-local: $(INSTALL_DATA_LOCAL) -uninstall-local: $(UNINSTALL_LOCAL) -.PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL) - -modules_install: -@LINUX_ENABLED_TRUE@ cd datapath/linux && $(MAKE) modules_install -@HAVE_OPENSSL_TRUE@lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem -@HAVE_OPENSSL_TRUE@ (echo '#include "lib/dhparams.h"' && \ -@HAVE_OPENSSL_TRUE@ openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \ -@HAVE_OPENSSL_TRUE@ openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \ -@HAVE_OPENSSL_TRUE@ openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \ -@HAVE_OPENSSL_TRUE@ | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp -@HAVE_OPENSSL_TRUE@ mv lib/dhparams.c.tmp lib/dhparams.c -$(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES) - $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp - mv $@.tmp $@ -$(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES) - $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp - mv $@.tmp $@ - -lib/dirs.c: lib/dirs.c.in Makefile - ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \ - -e 's,[@]srcdir[@],$(srcdir),g' \ - -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \ - -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \ - -e 's,[@]DBDIR[@],"$(DBDIR)",g' \ - -e 's,[@]bindir[@],"$(bindir)",g' \ - -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \ - -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \ - > lib/dirs.c.tmp - mv lib/dirs.c.tmp lib/dirs.c - -$(srcdir)/lib/ofp-errors.inc: \ - lib/ofp-errors.h include/openflow/openflow-common.h \ - $(srcdir)/build-aux/extract-ofp-errors - $(run_python) $(srcdir)/build-aux/extract-ofp-errors \ - $(srcdir)/lib/ofp-errors.h \ - $(srcdir)/include/openflow/openflow-common.h > $@.tmp - mv $@.tmp $@ -$(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc - -$(srcdir)/lib/ofp-msgs.inc: \ - lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs - $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \ - $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@ -$(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc -lib-install-data-local: - $(MKDIR_P) $(DESTDIR)$(RUNDIR) - $(MKDIR_P) $(DESTDIR)$(PKIDIR) - $(MKDIR_P) $(DESTDIR)$(LOGDIR) - $(MKDIR_P) $(DESTDIR)$(DBDIR) -ofproto/ipfix-entities.def: ofproto/ipfix.xml ofproto/ipfix-gen-entities - $(run_python) $(srcdir)/ofproto/ipfix-gen-entities $< > $@.tmp - mv $@.tmp $@ - -utilities/ovs-lib: $(top_builddir)/config.status -@HAVE_PYTHON_TRUE@bugtool-install-data-local: -@HAVE_PYTHON_TRUE@ for plugin in $(bugtool_plugins); do \ -@HAVE_PYTHON_TRUE@ stem=`echo "$$plugin" | sed 's,utilities/bugtool/plugins/,,'`; \ -@HAVE_PYTHON_TRUE@ dir=`expr "$$stem" : '\(.*\)/[^/]*$$'`; \ -@HAVE_PYTHON_TRUE@ $(MKDIR_P) "$(DESTDIR)$(bugtoolpluginsdir)/$$dir"; \ -@HAVE_PYTHON_TRUE@ $(INSTALL_DATA) "$(srcdir)/$$plugin" "$(DESTDIR)$(bugtoolpluginsdir)/$$stem"; \ -@HAVE_PYTHON_TRUE@ done -@HAVE_PYTHON_TRUE@bugtool-uninstall-local: -@HAVE_PYTHON_TRUE@ for plugin in $(bugtool_plugins); do \ -@HAVE_PYTHON_TRUE@ stem=`echo "$$plugin" | sed 's,utilities/bugtool/plugins/,,'`; \ -@HAVE_PYTHON_TRUE@ rm -f "$(DESTDIR)$(bugtoolpluginsdir)/$$stem"; \ -@HAVE_PYTHON_TRUE@ done -@HAVE_PYTHON_TRUE@ for plugin in $(bugtool_plugins); do \ -@HAVE_PYTHON_TRUE@ stem=`echo "$$plugin" | sed 's,utilities/bugtool/plugins/,,'`; \ -@HAVE_PYTHON_TRUE@ dir=`expr "$$stem" : '\(.*\)/[^/]*$$'`; \ -@HAVE_PYTHON_TRUE@ rmdir "$(DESTDIR)$(bugtoolpluginsdir)/$$dir"; \ -@HAVE_PYTHON_TRUE@ done; exit 0 - -check-local: tests/atconfig tests/atlocal $(TESTSUITE) - $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS) -check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov - PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS) - @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate - @echo - @echo '----------------------------------------------------------------------' - @echo 'Annotated coverage source has the ",cover" extension.' - @echo '----------------------------------------------------------------------' - @echo - @COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report - -$(valgrind_wrappers): tests/valgrind-wrapper.in - @test -d tests/valgrind || mkdir tests/valgrind - sed -e 's,[@]wrap_program[@],$@,' \ - $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp - chmod +x $@.tmp - mv $@.tmp $@ -check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \ - $(valgrind_wrappers) $(check_DATA) - $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS) - @echo - @echo '----------------------------------------------------------------------' - @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*' - @echo '----------------------------------------------------------------------' - -# OFTest support. - -check-oftest: all - srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-oftest - -# Ryu support. -check-ryu: all - srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-ryu - -clean-local: - test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean -$(TESTSUITE): package.m4 $(TESTSUITE_AT) - $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at - mv $@.tmp $@ - -# The `:;' works around a Bash 3.2 bug when the output is not writeable. -$(srcdir)/package.m4: $(top_srcdir)/configure.ac - :;{ \ - echo '# Signature of the current package.' && \ - echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \ - echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \ - echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \ - echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \ - echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \ - } >'$(srcdir)/package.m4' -tests/idltest.ovsidl: $(IDLTEST_IDL_FILES) - $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp - mv $@.tmp $@ - -tests/idltest.c: tests/idltest.h - -@HAVE_OPENSSL_TRUE@tests/testpki-cacert.pem: tests/pki/stamp; cp tests/pki/switchca/cacert.pem $@ -@HAVE_OPENSSL_TRUE@tests/testpki-cert.pem: tests/pki/stamp; cp tests/pki/test-cert.pem $@ -@HAVE_OPENSSL_TRUE@tests/testpki-req.pem: tests/pki/stamp; cp tests/pki/test-req.pem $@ -@HAVE_OPENSSL_TRUE@tests/testpki-privkey.pem: tests/pki/stamp; cp tests/pki/test-privkey.pem $@ -@HAVE_OPENSSL_TRUE@tests/testpki-cert2.pem: tests/pki/stamp; cp tests/pki/test2-cert.pem $@ -@HAVE_OPENSSL_TRUE@tests/testpki-req2.pem: tests/pki/stamp; cp tests/pki/test2-req.pem $@ -@HAVE_OPENSSL_TRUE@tests/testpki-privkey2.pem: tests/pki/stamp; cp tests/pki/test2-privkey.pem $@ -@HAVE_OPENSSL_TRUE@tests/pki/stamp: -@HAVE_OPENSSL_TRUE@ rm -f tests/pki/stamp -@HAVE_OPENSSL_TRUE@ rm -rf tests/pki -@HAVE_OPENSSL_TRUE@ $(OVS_PKI) init -@HAVE_OPENSSL_TRUE@ $(OVS_PKI) req+sign tests/pki/test -@HAVE_OPENSSL_TRUE@ $(OVS_PKI) req+sign tests/pki/test2 -@HAVE_OPENSSL_TRUE@ : > tests/pki/stamp -@HAVE_OPENSSL_TRUE@clean-pki: -@HAVE_OPENSSL_TRUE@ rm -f tests/pki/stamp -@HAVE_OPENSSL_TRUE@ rm -rf tests/pki - -@HAVE_PYTHON_TRUE@.h.hstamp: -@HAVE_PYTHON_TRUE@ $(run_python) $(srcdir)/build-aux/check-structs -I$(srcdir)/include $< -@HAVE_PYTHON_TRUE@ touch $@ -@HAVE_PYTHON_TRUE@$(HSTAMP_FILES): build-aux/check-structs - -@HAVE_PYTHON_TRUE@include/openflow/openflow-1.0.hstamp: \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-common.h -@HAVE_PYTHON_TRUE@include/openflow/openflow-1.1.hstamp: \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-common.h -@HAVE_PYTHON_TRUE@include/openflow/openflow-1.2.hstamp: \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-common.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.1.h -@HAVE_PYTHON_TRUE@include/openflow/openflow-1.3.hstamp: \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-common.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.1.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.2.h -@HAVE_PYTHON_TRUE@include/openflow/openflow-1.4.hstamp: \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.4.h -@HAVE_PYTHON_TRUE@include/openflow/nicira-ext.hstamp: \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-common.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.0.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.1.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.2.h \ -@HAVE_PYTHON_TRUE@ include/openflow/openflow-1.3.h - -check-debian-changelog-version: - @DEB_VERSION=`echo '$(VERSION)' | sed 's/pre/~pre/'`; \ - if $(FGREP) '($(DEB_VERSION)' $(srcdir)/debian/changelog >/dev/null; \ - then \ - :; \ - else \ - echo "Update debian/changelog to mention version $(VERSION)"; \ - exit 1; \ - fi - -$(srcdir)/debian/copyright: AUTHORS debian/copyright.in - { sed -n -e '/%AUTHORS%/q' -e p < $(srcdir)/debian/copyright.in; \ - sed '1,/^$$/d' $(srcdir)/AUTHORS | \ - sed -n -e '/^$$/q' -e 's/^/ /p'; \ - sed -e '1,/%AUTHORS%/d' $(srcdir)/debian/copyright.in; \ - } > $@ - -# vswitch E-R diagram -# -# If "python" or "dot" is not available, then we do not add graphical diagram -# to the documentation. -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@ $(OVSDB_DOT) --no-arrows $(srcdir)/vswitchd/vswitch.ovsschema > $@ -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@vswitchd/vswitch.pic: vswitchd/vswitch.gv ovsdb/dot2pic -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@ (dot -T plain < vswitchd/vswitch.gv | $(PERL) $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp; -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@ mv $@.tmp $@ -vswitchd/ovs-vswitchd.conf.db.5: \ - ovsdb/ovsdb-doc vswitchd/vswitch.xml vswitchd/vswitch.ovsschema \ - $(VSWITCH_PIC) - $(OVSDB_DOC) \ - --title="ovs-vswitchd.conf.db" \ - $(VSWITCH_DOT_DIAGRAM_ARG) \ - --version=$(VERSION) \ - $(srcdir)/vswitchd/vswitch.ovsschema \ - $(srcdir)/vswitchd/vswitch.xml > $@.tmp - mv $@.tmp $@ -vswitchd/vswitch.ovsschema.stamp: vswitchd/vswitch.ovsschema - @sum=`sed '/cksum/d' $? | cksum`; \ - expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ - if test "X$$sum" = "X$$expected"; then \ - touch $@; \ - else \ - ln=`sed -n '/"cksum":/=' $?`; \ - echo >&2 "$?:$$ln: checksum \"$$sum\" does not match (you should probably update the version number and fix the checksum)"; \ - exit 1; \ - fi -.ovsidl.c: - $(OVSDB_IDLC) c-idl-source $< > $@.tmp - mv $@.tmp $@ -.ovsidl.h: - $(OVSDB_IDLC) c-idl-header $< > $@.tmp - mv $@.tmp $@ - -# This must be done late: macros in targets are expanded when the -# target line is read, so if this file were to be included before some -# other file that added to OVSIDL_BUILT, then those files wouldn't get -# the dependency. -# -# However, current versions of Automake seem to output all variable -# assignments before any targets, so it doesn't seem to be a problem, -# at least for now. -$(OVSIDL_BUILT): ovsdb/ovsdb-idlc.in - -$(srcdir)/rhel/openvswitch-kmod-rhel6.spec: rhel/openvswitch-kmod-rhel6.spec.in $(top_builddir)/config.status - $(update_rhel_spec) - -$(srcdir)/rhel/openvswitch-kmod-fedora.spec: rhel/openvswitch-kmod-fedora.spec.in $(top_builddir)/config.status - $(update_rhel_spec) - -$(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in $(top_builddir)/config.status - $(update_rhel_spec) - -$(srcdir)/rhel/openvswitch-fedora.spec: rhel/openvswitch-fedora.spec.in $(top_builddir)/config.status - $(update_rhel_spec) - -$(srcdir)/xenserver/openvswitch-xen.spec: xenserver/openvswitch-xen.spec.in $(top_builddir)/config.status - ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \ - < $(srcdir)/xenserver/$(@F).in > $(@F).tmp || exit 1; \ - if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi -@HAVE_PYTHON_TRUE@ovs-install-data-local: -@HAVE_PYTHON_TRUE@ $(MKDIR_P) python/ovs -@HAVE_PYTHON_TRUE@ sed \ -@HAVE_PYTHON_TRUE@ -e '/^##/d' \ -@HAVE_PYTHON_TRUE@ -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ -@HAVE_PYTHON_TRUE@ -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ -@HAVE_PYTHON_TRUE@ -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ -@HAVE_PYTHON_TRUE@ -e 's,[@]bindir[@],$(bindir),g' \ -@HAVE_PYTHON_TRUE@ -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ -@HAVE_PYTHON_TRUE@ -e 's,[@]DBDIR[@],$(DBDIR),g' \ -@HAVE_PYTHON_TRUE@ < $(srcdir)/python/ovs/dirs.py.template \ -@HAVE_PYTHON_TRUE@ > python/ovs/dirs.py.tmp -@HAVE_PYTHON_TRUE@ $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs -@HAVE_PYTHON_TRUE@ $(INSTALL_DATA) python/ovs/dirs.py.tmp $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py -@HAVE_PYTHON_TRUE@ rm python/ovs/dirs.py.tmp -@HAVE_PYTHON_FALSE@ovs-install-data-local: -@HAVE_PYTHON_FALSE@ @: -install-data-local: ovs-install-data-local -ovs-uninstall-local: - rm -f $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py -$(srcdir)/python/ovs/version.py: config.status - $(ro_shell) > $(@F).tmp - echo 'VERSION = "$(VERSION)"' >> $(@F).tmp - if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi -$(srcdir)/python/ovs/dirs.py: python/ovs/dirs.py.template - sed \ - -e '/^##/d' \ - -e 's,[@]pkgdatadir[@],/usr/local/share/openvswitch,g' \ - -e 's,[@]RUNDIR[@],/var/run,g' \ - -e 's,[@]LOGDIR[@],/usr/local/var/log,g' \ - -e 's,[@]bindir[@],/usr/local/bin,g' \ - -e 's,[@]sysconfdir[@],/usr/local/etc,g' \ - -e 's,[@]DBDIR[@],/usr/local/etc/openvswitch,g' \ - < $? > $@.tmp - mv $@.tmp $@ - -sandbox: all - cd $(srcdir)/tutorial && ./ovs-sandbox -b $(abs_builddir) - -# VTEP E-R diagram -# -# If "python" or "dot" is not available, then we do not add graphical diagram -# to the documentation. -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@vtep/vtep.gv: ovsdb/ovsdb-dot.in vtep/vtep.ovsschema -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@ $(OVSDB_DOT) --no-arrows $(srcdir)/vtep/vtep.ovsschema > $@ -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@vtep/vtep.pic: vtep/vtep.gv ovsdb/dot2pic -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@ (dot -T plain < vtep/vtep.gv | $(PERL) $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp; -@HAVE_DOT_TRUE@@HAVE_PYTHON_TRUE@ mv $@.tmp $@ -$(srcdir)/vtep/vtep.5: \ - ovsdb/ovsdb-doc vtep/vtep.xml vtep/vtep.ovsschema $(VTEP_PIC) - $(OVSDB_DOC) \ - --title="vtep" \ - $(VTEP_DOT_DIAGRAM_ARG) \ - --version=$(VERSION) \ - $(srcdir)/vtep/vtep.ovsschema \ - $(srcdir)/vtep/vtep.xml > $@.tmp - mv $@.tmp $@ -vtep/vtep.ovsschema.stamp: vtep/vtep.ovsschema - @sum=`sed '/cksum/d' $? | cksum`; \ - expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ - if test "X$$sum" = "X$$expected"; then \ - touch $@; \ - else \ - ln=`sed -n '/"cksum":/=' $?`; \ - echo >&2 "$?:$$ln: checksum \"$$sum\" does not match (you should probably update the version number and fix the checksum)"; \ - exit 1; \ - fi - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru openvswitch-2.3.1/manpages.mk openvswitch-2.4.0~git20150623/manpages.mk --- openvswitch-2.3.1/manpages.mk 2014-12-04 05:59:57.000000000 +0000 +++ openvswitch-2.4.0~git20150623/manpages.mk 2015-06-23 18:46:21.000000000 +0000 @@ -84,26 +84,6 @@ lib/vlog-syn.man: lib/vlog.man: -tests/test-controller.8: \ - tests/test-controller.8.in \ - lib/common.man \ - lib/daemon.man \ - lib/ssl-peer-ca-cert.man \ - lib/ssl.man \ - lib/unixctl.man \ - lib/vconn-active.man \ - lib/vconn-passive.man \ - lib/vlog.man -tests/test-controller.8.in: -lib/common.man: -lib/daemon.man: -lib/ssl-peer-ca-cert.man: -lib/ssl.man: -lib/unixctl.man: -lib/vconn-active.man: -lib/vconn-passive.man: -lib/vlog.man: - utilities/bugtool/ovs-bugtool.8: \ utilities/bugtool/ovs-bugtool.8.in utilities/bugtool/ovs-bugtool.8.in: @@ -127,9 +107,11 @@ utilities/ovs-dpctl.8: \ utilities/ovs-dpctl.8.in \ lib/common.man \ + lib/dpctl.man \ lib/vlog.man utilities/ovs-dpctl.8.in: lib/common.man: +lib/dpctl.man: lib/vlog.man: utilities/ovs-l3ping.8: \ @@ -188,6 +170,28 @@ lib/common.man: utilities/ovs-vlan-bugs.man: +utilities/ovs-testcontroller.8: \ + utilities/ovs-testcontroller.8.in \ + lib/common.man \ + lib/daemon.man \ + lib/ofp-version.man \ + lib/ssl-peer-ca-cert.man \ + lib/ssl.man \ + lib/unixctl.man \ + lib/vconn-active.man \ + lib/vconn-passive.man \ + lib/vlog.man +utilities/ovs-testcontroller.8.in: +lib/common.man: +lib/daemon.man: +lib/ofp-version.man: +lib/ssl-peer-ca-cert.man: +lib/ssl.man: +lib/unixctl.man: +lib/vconn-active.man: +lib/vconn-passive.man: +lib/vlog.man: + utilities/ovs-vlan-bug-workaround.8: \ utilities/ovs-vlan-bug-workaround.8.in \ lib/common.man \ @@ -239,13 +243,16 @@ lib/common.man \ lib/coverage-unixctl.man \ lib/daemon.man \ + lib/dpctl.man \ lib/memory-unixctl.man \ lib/service.man \ lib/ssl-bootstrap.man \ lib/ssl.man \ + lib/unixctl.man \ lib/vlog-unixctl.man \ lib/vlog.man \ ofproto/ofproto-dpif-unixctl.man \ + ofproto/ofproto-tnl-unixctl.man \ ofproto/ofproto-unixctl.man \ ovsdb/remote-active.man \ ovsdb/remote-passive.man @@ -253,13 +260,16 @@ lib/common.man: lib/coverage-unixctl.man: lib/daemon.man: +lib/dpctl.man: lib/memory-unixctl.man: lib/service.man: lib/ssl-bootstrap.man: lib/ssl.man: +lib/unixctl.man: lib/vlog-unixctl.man: lib/vlog.man: ofproto/ofproto-dpif-unixctl.man: +ofproto/ofproto-tnl-unixctl.man: ofproto/ofproto-unixctl.man: ovsdb/remote-active.man: ovsdb/remote-passive.man: diff -Nru openvswitch-2.3.1/NEWS openvswitch-2.4.0~git20150623/NEWS --- openvswitch-2.3.1/NEWS 2014-12-04 05:58:33.000000000 +0000 +++ openvswitch-2.4.0~git20150623/NEWS 2015-06-23 18:46:21.000000000 +0000 @@ -1,10 +1,110 @@ -v2.3.1 - 03 Dec 2014 +v2.4.0 - xx xxx xxxx --------------------- - - Compatibility with autoconf 2.63 (previously >=2.64) + - Flow table modifications are now atomic, meaning that each packet + now sees a coherent version of the OpenFlow pipeline. For + example, if a controller removes all flows with a single OpenFlow + "flow_mod", no packet sees an intermediate version of the OpenFlow + pipeline where only some of the flows have been deleted. + - Added support for SFQ, FQ_CoDel and CoDel qdiscs. + - Add bash command-line completion support for ovs-vsctl Please check + utilities/ovs-command-compgen.INSTALL.md for how to use. + - The MAC learning feature now includes per-port fairness to mitigate + MAC flooding attacks. + - New support for a "conjunctive match" OpenFlow extension, which + allows constructing OpenFlow matches of the form "field1 in + {a,b,c...} AND field2 in {d,e,f...}" and generalizations. For details, + see documentation for the "conjunction" action in ovs-ofctl(8). + - Add bash command-line completion support for ovs-appctl/ovs-dpctl/ + ovs-ofctl/ovsdb-tool commands. Please check + utilities/ovs-command-compgen.INSTALL.md for how to use. + - The "learn" action supports a new flag "delete_learned" that causes + the learned flows to be deleted when the flow with the "learn" action + is deleted. + - Basic support for the Geneve tunneling protocol. It is not yet + possible to generate or match options. This is planned for a future + release. The protocol is documented at + http://tools.ietf.org/html/draft-gross-geneve-00 + - The OVS database now reports controller rate limiting statistics. + - sflow now exports information about LACP-based bonds, port names, and + OpenFlow port numbers, as well as datapath performance counters. + - ovs-dpctl functionality is now available for datapaths integrated + into ovs-vswitchd, via ovs-appctl. Some existing ovs-appctl + commands are now redundant and will be removed in a future + release. See ovs-vswitchd(8) for details. + - OpenFlow: + * OpenFlow 1.4 bundles are now supported for flow mods and port + mods. For flow mods, both 'atomic' and 'ordered' bundle flags + are trivially supported, as all bundled messages are executed + in the order they were added and all flow table modifications + are now atomic to the datapath. Port mods may not appear in + atomic bundles, as port status modifications are not atomic. + * IPv6 flow label and neighbor discovery fields are now modifiable. + * OpenFlow 1.5 extended registers are now supported. + * The OpenFlow 1.5 actset_output field is now supported. + * OpenFlow 1.5 Copy-Field action is now supported. + * OpenFlow 1.5 masked Set-Field action is now supported. + * OpenFlow 1.3+ table features requests are now supported (read-only). + * Nicira extension "move" actions may now be included in action sets. + * "resubmit" actions may now be included in action sets. The resubmit + is executed last, and only if the action set has no "output" or "group" + action. + * OpenFlow 1.4+ flow "importance" is now maintained in the flow table. + * A new Netronome extension to OpenFlow 1.5+ allows control over the + fields hashed for OpenFlow select groups. See "selection_method" and + related options in ovs-ofctl(8) for details. + - ovs-ofctl has a new '--bundle' option that makes the flow mod commands + ('add-flow', 'add-flows', 'mod-flows', 'del-flows', and 'replace-flows') + use an OpenFlow 1.4 bundle to operate the modifications as a single + atomic transaction. If any of the flow mods in a transaction fail, none + of them are executed. All flow mods in a bundle appear to datapath + lookups simultaneously. + - ovs-ofctl 'add-flow' and 'add-flows' commands now accept arbitrary flow + mods as an input by allowing the flow specification to start with an + explicit 'add', 'modify', 'modify_strict', 'delete', or 'delete_strict' + keyword. A missing keyword is treated as 'add', so this is fully + backwards compatible. With the new '--bundle' option all the flow mods + are executed as a single atomic transaction using an OpenFlow 1.4 bundle. - ovs-pki: Changed message digest algorithm from MD5 to SHA-1 because MD5 is no longer secure and some operating systems have started to disable it in OpenSSL. + - ovsdb-server: New OVSDB protocol extension allows inequality tests on + "optional scalar" columns. See ovsdb-server(1) for details. + - ovs-vsctl now permits immutable columns in a new row to be modified in + the same transaction that creates the row. + - test-controller has been renamed ovs-testcontroller at request of users + who find it useful for testing basic OpenFlow setups. It is still not + a necessary or desirable part of most Open vSwitch deployments. + - Support for travis-ci.org based continuous integration builds has been + added. Build failures are reported to build@openvswitch.org. See INSTALL.md + file for additional details. + - Support for the Rapid Spanning Tree Protocol (IEEE 802.1D-2004). + The implementation has been tested successfully against the Ixia Automated + Network Validation Library (ANVL). + - Stats are no longer updated on fake bond interface. - Keep active bond slave selection across OVS restart. + - A simple wrapper script, 'ovs-docker', to integrate OVS with Docker + containers. If and when there is a native integration of Open vSwitch + with Docker, the wrapper script will be retired. + - Added support for DPDK Tunneling. VXLAN, GRE, and Geneve are supported + protocols. This is generic tunneling mechanism for userspace datapath. + - Support for multicast snooping (IGMPv1, IGMPv2 and IGMPv3) + - Support for Linux kernels up to 4.0.x + - The documentation now use the term 'destination' to mean one of syslog, + console or file for vlog logging instead of the previously used term + 'facility'. + - Support for VXLAN Group Policy extension + - Initial support for the IETF Auto-Attach SPBM draft standard. This + contains rudimentary support for the LLDP protocol as needed for + Auto-Attach. + - The default OpenFlow and OVSDB ports are now the IANA-assigned + numbers. OpenFlow is 6653 and OVSDB is 6640. + - Support for DPDK vHost. + - Support for outer UDP checksums in Geneve and VXLAN. + - The kernel vports with dependencies are no longer part of the overall + openvswitch.ko but built and loaded automatically as individual kernel + modules (vport-*.ko). + - Support for STT tunneling. + v2.3.0 - 14 Aug 2014 --------------------- @@ -19,6 +119,7 @@ packets with the larger number of masks, but when paired with an older kernel module, some workloads may perform worse with the new userspace. + - Compatibility with autoconf 2.63 (previously >=2.64) v2.2.0 - Internal Release --------------------- @@ -27,19 +128,22 @@ configured properly. - ovs-vsctl now reports when ovs-vswitchd fails to create a new port or bridge. + - Port creation and configuration errors are now stored in a new error + column of the Interface table and included in 'ovs-vsctl show'. - The "ovsdbmonitor" graphical tool has been removed, because it was poorly maintained and not widely used. - New "check-ryu" Makefile target for running Ryu tests for OpenFlow - controllers against Open vSwitch. See INSTALL for details. + controllers against Open vSwitch. See INSTALL.md for details. - Added IPFIX support for SCTP flows and templates for ICMPv4/v6 flows. - Upon the receipt of a SIGHUP signal, ovs-vswitchd no longer reopens its log file (it will terminate instead). Please use 'ovs-appctl vlog/reopen' instead. - Support for Linux kernels up to 3.14. From Kernel 3.12 onwards OVS uses tunnel API for GRE and VXLAN. - - Added experimental DPDK support. + - Added DPDK support. - Added support for custom vlog patterns in Python + v2.1.0 - 19 Mar 2014 --------------------- - Address prefix tracking support for flow tables. New columns @@ -82,6 +186,7 @@ * ovs-vswitchd now honors changes to the "ofport_request" column in the Interface table by changing the port's OpenFlow port number. + * The Open vSwitch software switch now supports OpenFlow groups. - ovs-vswitchd.conf.db.5 man page will contain graphviz/dot diagram only if graphviz package was installed at the build time. - Support for Linux kernels up to 3.11 diff -Nru openvswitch-2.3.1/NOTICE openvswitch-2.4.0~git20150623/NOTICE --- openvswitch-2.3.1/NOTICE 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/NOTICE 2015-06-23 18:46:21.000000000 +0000 @@ -22,3 +22,19 @@ m4/include_next.m4 and m4/absolute-header.m4 Copyright (C) 2006-2013 Free Software Foundation, Inc. + +Rapid Spanning Tree Protocol (RSTP) implementation +Copyright (c) 2011-2014 M3S, Srl - Italy + +LLDP implementation +Copyright (c) 2008, 2012 Vincent Bernat + +LLDP includes code used from the Net::CDP project based on the ISC license +Copyright (c) 2014 Michael Chapman + +LLDP includes code used from the ladvd project based on the ISC license +Copyright (c) 2008, 2009, 2010 Sten Spans + +Auto Attach implementation +Copyright (c) 2014, 2015 WindRiver, Inc +Copyright (c) 2014, 2015 Avaya, Inc diff -Nru openvswitch-2.3.1/ofproto/automake.mk openvswitch-2.4.0~git20150623/ofproto/automake.mk --- openvswitch-2.3.1/ofproto/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. +# Copyright (C) 2009, 2010, 2011, 2012, 2014 Nicira, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -6,7 +6,10 @@ # without warranty of any kind. lib_LTLIBRARIES += ofproto/libofproto.la -ofproto_libofproto_la_LDFLAGS = -release $(VERSION) +ofproto_libofproto_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/ofproto/libofproto.sym \ + $(AM_LDFLAGS) ofproto_libofproto_la_SOURCES = \ ofproto/bond.c \ ofproto/bond.h \ @@ -56,6 +59,8 @@ ofproto_libofproto_la_LIBADD += ${PTHREAD_LIBS} endif +pkgconfig_DATA += \ + $(srcdir)/ofproto/libofproto.pc # Distribute this generated file in order not to require Python at # build time if ofproto/ipfix.xml is not modified. @@ -65,11 +70,15 @@ CLEANFILES += ofproto/ipfix-entities.def -MAN_FRAGMENTS += ofproto/ofproto-unixctl.man ofproto/ofproto-dpif-unixctl.man +MAN_FRAGMENTS += ofproto/ofproto-unixctl.man ofproto/ofproto-dpif-unixctl.man \ + ofproto/ofproto-tnl-unixctl.man # IPFIX entity definition macros generation from IANA's XML definition. EXTRA_DIST += ofproto/ipfix.xml dist_noinst_SCRIPTS = ofproto/ipfix-gen-entities ofproto/ipfix-entities.def: ofproto/ipfix.xml ofproto/ipfix-gen-entities - $(run_python) $(srcdir)/ofproto/ipfix-gen-entities $< > $@.tmp + $(AM_V_GEN)$(run_python) $(srcdir)/ofproto/ipfix-gen-entities $< > $@.tmp && \ mv $@.tmp $@ + +# IPFIX enterprise entity definition macros. +EXTRA_DIST += ofproto/ipfix-enterprise-entities.def diff -Nru openvswitch-2.3.1/ofproto/bond.c openvswitch-2.4.0~git20150623/ofproto/bond.c --- openvswitch-2.3.1/ofproto/bond.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/bond.c 2015-06-23 18:46:21.000000000 +0000 @@ -28,6 +28,7 @@ #include "ofpbuf.h" #include "ofproto/ofproto-provider.h" #include "ofproto/ofproto-dpif.h" +#include "ofproto/ofproto-dpif-rid.h" #include "connectivity.h" #include "coverage.h" #include "dynamic-string.h" @@ -39,13 +40,14 @@ #include "odp-util.h" #include "ofpbuf.h" #include "packets.h" +#include "dp-packet.h" #include "poll-loop.h" #include "seq.h" #include "match.h" #include "shash.h" #include "timeval.h" #include "unixctl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(bond); @@ -56,7 +58,6 @@ /* Bit-mask for hashing a flow down to a bucket. */ #define BOND_MASK 0xff #define BOND_BUCKETS (BOND_MASK + 1) -#define RECIRC_RULE_PRIORITY 20 /* Priority level for internal rules */ /* A hash bucket for mapping a flow to a slave. * "struct bond" has an array of BOND_BUCKETS of these. */ @@ -64,7 +65,7 @@ struct bond_slave *slave; /* Assigned slave, NULL if unassigned. */ uint64_t tx_bytes /* Count of bytes recently transmitted. */ OVS_GUARDED_BY(rwlock); - struct list list_node; /* In bond_slave's 'entries' list. */ + struct ovs_list list_node; /* In bond_slave's 'entries' list. */ /* Recirculation. * @@ -78,13 +79,13 @@ /* A bond slave, that is, one of the links comprising a bond. */ struct bond_slave { struct hmap_node hmap_node; /* In struct bond's slaves hmap. */ - struct list list_node; /* In struct bond's enabled_slaves list. */ + struct ovs_list list_node; /* In struct bond's enabled_slaves list. */ struct bond *bond; /* The bond that contains this slave. */ void *aux; /* Client-provided handle for this slave. */ struct netdev *netdev; /* Network device, owned by the client. */ unsigned int change_seq; /* Tracks changes in 'netdev'. */ - ofp_port_t ofp_port; /* Open flow port number */ + ofp_port_t ofp_port; /* OpenFlow port number. */ char *name; /* Name (a copy of netdev_get_name(netdev)). */ /* Link status. */ @@ -93,8 +94,8 @@ bool may_enable; /* Client considers this slave bondable. */ /* Rebalancing info. Used only by bond_rebalance(). */ - struct list bal_node; /* In bond_rebalance()'s 'bals' list. */ - struct list entries; /* 'struct bond_entry's assigned here. */ + struct ovs_list bal_node; /* In bond_rebalance()'s 'bals' list. */ + struct ovs_list entries; /* 'struct bond_entry's assigned here. */ uint64_t tx_bytes; /* Sum across 'tx_bytes' of entries. */ }; @@ -114,7 +115,7 @@ * (To prevent the bond_slave from disappearing they must also hold * 'rwlock'.) */ struct ovs_mutex mutex OVS_ACQ_AFTER(rwlock); - struct list enabled_slaves OVS_GUARDED; /* Contains struct bond_slaves. */ + struct ovs_list enabled_slaves OVS_GUARDED; /* Contains struct bond_slaves. */ /* Bonding info. */ enum bond_mode balance; /* Balancing mode, one of BM_*. */ @@ -142,7 +143,6 @@ uint8_t active_slave_mac[ETH_ADDR_LEN]; /* The MAC address of the active interface. */ /* Legacy compatibility. */ - long long int next_fake_iface_update; /* LLONG_MAX if disabled. */ bool lacp_fallback_ab; /* Fallback to active-backup on LACP failure. */ struct ovs_refcount ref_cnt; @@ -187,8 +187,6 @@ struct flow_wildcards *, uint16_t vlan) OVS_REQ_RDLOCK(rwlock); -static void bond_update_fake_slave_stats(struct bond *) - OVS_REQ_RDLOCK(rwlock); /* Attempts to parse 's' as the name of a bond balancing mode. If successful, * stores the mode in '*balance' and returns true. Otherwise returns false @@ -238,7 +236,6 @@ hmap_init(&bond->slaves); list_init(&bond->enabled_slaves); ovs_mutex_init(&bond->mutex); - bond->next_fake_iface_update = LLONG_MAX; ovs_refcount_init(&bond->ref_cnt); bond->recirc_id = 0; @@ -266,7 +263,7 @@ struct bond_slave *slave, *next_slave; struct bond_pr_rule_op *pr_op, *next_op; - if (!bond || ovs_refcount_unref(&bond->ref_cnt) != 1) { + if (!bond || ovs_refcount_unref_relaxed(&bond->ref_cnt) != 1) { return; } @@ -293,7 +290,7 @@ hmap_destroy(&bond->pr_rule_ops); if (bond->recirc_id) { - ofproto_dpif_free_recirc_id(bond->ofproto, bond->recirc_id); + recirc_free_id(bond->recirc_id); } free(bond); @@ -325,6 +322,7 @@ static void update_recirc_rules(struct bond *bond) + OVS_REQ_WRLOCK(rwlock) { struct match match; struct bond_pr_rule_op *pr_op, *next_op; @@ -361,7 +359,7 @@ ofpact_put_OUTPUT(&ofpacts)->port = pr_op->out_ofport; error = ofproto_dpif_add_internal_flow(bond->ofproto, &pr_op->match, - RECIRC_RULE_PRIORITY, + RECIRC_RULE_PRIORITY, 0, &ofpacts, pr_op->pr_rule); if (error) { char *err_s = match_to_string(&pr_op->match, @@ -442,14 +440,6 @@ revalidate = true; } - if (s->fake_iface) { - if (bond->next_fake_iface_update == LLONG_MAX) { - bond->next_fake_iface_update = time_msec(); - } - } else { - bond->next_fake_iface_update = LLONG_MAX; - } - if (bond->bond_revalidate) { revalidate = true; bond->bond_revalidate = false; @@ -457,10 +447,10 @@ if (bond->balance != BM_AB) { if (!bond->recirc_id) { - bond->recirc_id = ofproto_dpif_alloc_recirc_id(bond->ofproto); + bond->recirc_id = recirc_alloc_id(bond->ofproto); } } else if (bond->recirc_id) { - ofproto_dpif_free_recirc_id(bond->ofproto, bond->recirc_id); + recirc_free_id(bond->recirc_id); bond->recirc_id = 0; } @@ -478,13 +468,13 @@ } static struct bond_slave * -bond_find_slave_by_mac(const struct bond *bond, const uint8_t mac[6]) +bond_find_slave_by_mac(const struct bond *bond, const uint8_t mac[ETH_ADDR_LEN]) { struct bond_slave *slave; /* Find the last active slave */ HMAP_FOR_EACH(slave, hmap_node, &bond->slaves) { - uint8_t slave_mac[6]; + uint8_t slave_mac[ETH_ADDR_LEN]; if (netdev_get_etheraddr(slave->netdev, slave_mac)) { continue; @@ -501,7 +491,7 @@ static void bond_active_slave_changed(struct bond *bond) { - uint8_t mac[6]; + uint8_t mac[ETH_ADDR_LEN]; netdev_get_etheraddr(bond->active_slave->netdev, mac); memcpy(bond->active_slave_mac, mac, sizeof bond->active_slave_mac); @@ -658,12 +648,6 @@ bond_choose_active_slave(bond); } - /* Update fake bond interface stats. */ - if (time_msec() >= bond->next_fake_iface_update) { - bond_update_fake_slave_stats(bond); - bond->next_fake_iface_update = time_msec() + 1000; - } - revalidate = bond->bond_revalidate; bond->bond_revalidate = false; ovs_rwlock_unlock(&rwlock); @@ -686,10 +670,6 @@ seq_wait(connectivity_seq_get(), slave->change_seq); } - if (bond->next_fake_iface_update != LLONG_MAX) { - poll_timer_wait_until(bond->next_fake_iface_update); - } - if (bond->bond_revalidate) { poll_immediate_wake(); } @@ -740,13 +720,13 @@ * See bond_should_send_learning_packets() for description of usage. The * caller should send the composed packet on the port associated with * port_aux and takes ownership of the returned ofpbuf. */ -struct ofpbuf * +struct dp_packet * bond_compose_learning_packet(struct bond *bond, const uint8_t eth_src[ETH_ADDR_LEN], uint16_t vlan, void **port_aux) { struct bond_slave *slave; - struct ofpbuf *packet; + struct dp_packet *packet; struct flow flow; ovs_rwlock_rdlock(&rwlock); @@ -755,7 +735,7 @@ memcpy(flow.dl_src, eth_src, ETH_ADDR_LEN); slave = choose_output_slave(bond, &flow, NULL, vlan); - packet = ofpbuf_new(0); + packet = dp_packet_new(0); compose_rarp(packet, eth_src); if (vlan) { eth_push_vlan(packet, htons(ETH_TYPE_VLAN), htons(vlan)); @@ -946,8 +926,9 @@ } } -void -bond_update_post_recirc_rules(struct bond* bond, const bool force) +static void +bond_update_post_recirc_rules__(struct bond* bond, const bool force) + OVS_REQ_WRLOCK(rwlock) { struct bond_entry *e; bool update_rules = force; /* Always update rules if caller forces it. */ @@ -968,6 +949,14 @@ update_recirc_rules(bond); } } + +void +bond_update_post_recirc_rules(struct bond* bond, const bool force) +{ + ovs_rwlock_wrlock(&rwlock); + bond_update_post_recirc_rules__(bond, force); + ovs_rwlock_unlock(&rwlock); +} /* Rebalancing. */ @@ -991,13 +980,13 @@ } static struct bond_slave * -bond_slave_from_bal_node(struct list *bal) OVS_REQ_RDLOCK(rwlock) +bond_slave_from_bal_node(struct ovs_list *bal) OVS_REQ_RDLOCK(rwlock) { return CONTAINER_OF(bal, struct bond_slave, bal_node); } static void -log_bals(struct bond *bond, const struct list *bals) +log_bals(struct bond *bond, const struct ovs_list *bals) OVS_REQ_RDLOCK(rwlock) { if (VLOG_IS_DBG_ENABLED()) { @@ -1106,7 +1095,7 @@ /* Inserts 'slave' into 'bals' so that descending order of 'tx_bytes' is * maintained. */ static void -insert_bal(struct list *bals, struct bond_slave *slave) +insert_bal(struct ovs_list *bals, struct bond_slave *slave) { struct bond_slave *pos; @@ -1121,7 +1110,7 @@ /* Removes 'slave' from its current list and then inserts it into 'bals' so * that descending order of 'tx_bytes' is maintained. */ static void -reinsert_bal(struct list *bals, struct bond_slave *slave) +reinsert_bal(struct ovs_list *bals, struct bond_slave *slave) { list_remove(&slave->bal_node); insert_bal(bals, slave); @@ -1138,7 +1127,7 @@ { struct bond_slave *slave; struct bond_entry *e; - struct list bals; + struct ovs_list bals; bool rebalanced = false; bool use_recirc; @@ -1226,7 +1215,7 @@ } if (use_recirc && rebalanced) { - bond_update_post_recirc_rules(bond,true); + bond_update_post_recirc_rules__(bond,true); } done: @@ -1756,7 +1745,7 @@ static struct bond_slave * get_enabled_slave(struct bond *bond) { - struct list *node; + struct ovs_list *node; ovs_mutex_lock(&bond->mutex); if (list_is_empty(&bond->enabled_slaves)) { @@ -1877,43 +1866,6 @@ } } -/* Attempts to make the sum of the bond slaves' statistics appear on the fake - * bond interface. */ -static void -bond_update_fake_slave_stats(struct bond *bond) -{ - struct netdev_stats bond_stats; - struct bond_slave *slave; - struct netdev *bond_dev; - - memset(&bond_stats, 0, sizeof bond_stats); - - HMAP_FOR_EACH (slave, hmap_node, &bond->slaves) { - struct netdev_stats slave_stats; - - if (!netdev_get_stats(slave->netdev, &slave_stats)) { - /* XXX: We swap the stats here because they are swapped back when - * reported by the internal device. The reason for this is - * internal devices normally represent packets going into the - * system but when used as fake bond device they represent packets - * leaving the system. We really should do this in the internal - * device itself because changing it here reverses the counts from - * the perspective of the switch. However, the internal device - * doesn't know what type of device it represents so we have to do - * it here for now. */ - bond_stats.tx_packets += slave_stats.rx_packets; - bond_stats.tx_bytes += slave_stats.rx_bytes; - bond_stats.rx_packets += slave_stats.tx_packets; - bond_stats.rx_bytes += slave_stats.tx_bytes; - } - } - - if (!netdev_open(bond->name, "system", &bond_dev)) { - netdev_set_stats(bond_dev, &bond_stats); - netdev_close(bond_dev); - } -} - /* * Return true if bond has unstored active slave change. * If return true, 'mac' will store the bond's current active slave's diff -Nru openvswitch-2.3.1/ofproto/bond.h openvswitch-2.4.0~git20150623/ofproto/bond.h --- openvswitch-2.3.1/ofproto/bond.h 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/bond.h 2015-06-23 18:46:21.000000000 +0000 @@ -52,11 +52,10 @@ int up_delay; /* ms before enabling an up slave. */ int down_delay; /* ms before disabling a down slave. */ - /* Legacy compatibility. */ - bool fake_iface; /* Update fake stats for netdev 'name'? */ bool lacp_fallback_ab_cfg; /* Fallback to active-backup on LACP failure. */ - uint8_t active_slave_mac[6];/* The MAC address of the interface + uint8_t active_slave_mac[ETH_ADDR_LEN]; + /* The MAC address of the interface that was active during the last ovs run. */ }; @@ -82,11 +81,11 @@ /* Special MAC learning support for SLB bonding. */ bool bond_should_send_learning_packets(struct bond *); -struct ofpbuf *bond_compose_learning_packet(struct bond *, +struct dp_packet *bond_compose_learning_packet(struct bond *, const uint8_t eth_src[ETH_ADDR_LEN], uint16_t vlan, void **port_aux); -bool bond_get_changed_active_slave(const char *name, uint8_t mac[6], - bool force); +bool bond_get_changed_active_slave(const char *name, uint8_t mac[ETH_ADDR_LEN], + bool force); /* Packet processing. */ enum bond_verdict { diff -Nru openvswitch-2.3.1/ofproto/bundles.c openvswitch-2.4.0~git20150623/ofproto/bundles.c --- openvswitch-2.3.1/ofproto/bundles.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/bundles.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,7 @@ /* * Copyright (c) 2013, 2014 Alexandru Copot , with support from IXIA. * Copyright (c) 2013, 2014 Daniel Baluta + * Copyright (c) 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,53 +35,13 @@ #include "simap.h" #include "stream.h" #include "timeval.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" #include "bundles.h" VLOG_DEFINE_THIS_MODULE(bundles); -enum bundle_state { - BS_OPEN, - BS_CLOSED -}; - -struct ofp_bundle { - struct hmap_node node; /* In struct ofconn's "bundles" hmap. */ - uint32_t id; - uint16_t flags; - enum bundle_state state; - - /* List of 'struct bundle_message's */ - struct list msg_list; -}; - -struct bundle_message { - struct ofp_header *msg; - struct list node; /* Element in 'struct ofp_bundles's msg_list */ -}; - -static uint32_t -bundle_hash(uint32_t id) -{ - return hash_int(id, 0); -} - -static struct ofp_bundle * -ofp_bundle_find(struct hmap *bundles, uint32_t id) -{ - struct ofp_bundle *bundle; - - HMAP_FOR_EACH_IN_BUCKET(bundle, node, bundle_hash(id), bundles) { - if (bundle->id == id) { - return bundle; - } - } - - return NULL; -} - static struct ofp_bundle * ofp_bundle_create(uint32_t id, uint16_t flags) { @@ -90,90 +51,73 @@ bundle->id = id; bundle->flags = flags; + bundle->state = BS_OPEN; list_init(&bundle->msg_list); return bundle; } -static void -ofp_bundle_remove(struct ofconn *ofconn, struct ofp_bundle *item) -{ - struct bundle_message *msg, *next; - struct hmap *bundles; - - LIST_FOR_EACH_SAFE (msg, next, node, &item->msg_list) { - list_remove(&msg->node); - free(msg->msg); - free(msg); - } - - bundles = ofconn_get_bundles(ofconn); - hmap_remove(bundles, &item->node); - - free(item); -} - void -ofp_bundle_remove_all(struct ofconn *ofconn) +ofp_bundle_remove__(struct ofconn *ofconn, struct ofp_bundle *bundle, + bool success) { - struct ofp_bundle *b, *next; - struct hmap *bundles; - - bundles = ofconn_get_bundles(ofconn); + struct ofp_bundle_entry *msg; - HMAP_FOR_EACH_SAFE (b, next, node, bundles) { - ofp_bundle_remove(ofconn, b); + LIST_FOR_EACH_POP (msg, node, &bundle->msg_list) { + if (success && msg->type == OFPTYPE_FLOW_MOD) { + /* Tell connmgr about successful flow mods. */ + ofconn_report_flow_mod(ofconn, msg->fm.command); + } + ofp_bundle_entry_free(msg); } + + ofconn_remove_bundle(ofconn, bundle); + free(bundle); } enum ofperr ofp_bundle_open(struct ofconn *ofconn, uint32_t id, uint16_t flags) { - struct hmap *bundles; struct ofp_bundle *bundle; + enum ofperr error; - bundles = ofconn_get_bundles(ofconn); - bundle = ofp_bundle_find(bundles, id); + bundle = ofconn_get_bundle(ofconn, id); if (bundle) { VLOG_INFO("Bundle %x already exists.", id); - ofp_bundle_remove(ofconn, bundle); + ofp_bundle_remove__(ofconn, bundle, false); return OFPERR_OFPBFC_BAD_ID; } - /* TODO: Check the limit of open bundles */ - bundle = ofp_bundle_create(id, flags); - bundle->state = BS_OPEN; - - bundles = ofconn_get_bundles(ofconn); - hmap_insert(bundles, &bundle->node, bundle_hash(id)); + error = ofconn_insert_bundle(ofconn, bundle); + if (error) { + free(bundle); + } - return 0; + return error; } enum ofperr ofp_bundle_close(struct ofconn *ofconn, uint32_t id, uint16_t flags) { - struct hmap *bundles; struct ofp_bundle *bundle; - bundles = ofconn_get_bundles(ofconn); - bundle = ofp_bundle_find(bundles, id); + bundle = ofconn_get_bundle(ofconn, id); if (!bundle) { return OFPERR_OFPBFC_BAD_ID; } if (bundle->state == BS_CLOSED) { - ofp_bundle_remove(ofconn, bundle); + ofp_bundle_remove__(ofconn, bundle, false); return OFPERR_OFPBFC_BUNDLE_CLOSED; } if (bundle->flags != flags) { - ofp_bundle_remove(ofconn, bundle); + ofp_bundle_remove__(ofconn, bundle, false); return OFPERR_OFPBFC_BAD_FLAGS; } @@ -182,70 +126,46 @@ } enum ofperr -ofp_bundle_commit(struct ofconn *ofconn, uint32_t id, uint16_t flags) -{ - struct hmap *bundles; - struct ofp_bundle *bundle; - - bundles = ofconn_get_bundles(ofconn); - bundle = ofp_bundle_find(bundles, id); - - if (!bundle) { - return OFPERR_OFPBFC_BAD_ID; - } - if (bundle->flags != flags) { - ofp_bundle_remove(ofconn, bundle); - return OFPERR_OFPBFC_BAD_FLAGS; - } - - /* TODO: actual commit */ - - return OFPERR_OFPBFC_MSG_UNSUP; -} - -enum ofperr ofp_bundle_discard(struct ofconn *ofconn, uint32_t id) { - struct hmap *bundles; struct ofp_bundle *bundle; - bundles = ofconn_get_bundles(ofconn); - bundle = ofp_bundle_find(bundles, id); + bundle = ofconn_get_bundle(ofconn, id); if (!bundle) { return OFPERR_OFPBFC_BAD_ID; } - ofp_bundle_remove(ofconn, bundle); + ofp_bundle_remove__(ofconn, bundle, false); return 0; } enum ofperr -ofp_bundle_add_message(struct ofconn *ofconn, struct ofputil_bundle_add_msg *badd) +ofp_bundle_add_message(struct ofconn *ofconn, uint32_t id, uint16_t flags, + struct ofp_bundle_entry *bmsg) { - struct hmap *bundles; struct ofp_bundle *bundle; - struct bundle_message *bmsg; - bundles = ofconn_get_bundles(ofconn); - bundle = ofp_bundle_find(bundles, badd->bundle_id); + bundle = ofconn_get_bundle(ofconn, id); if (!bundle) { - bundle = ofp_bundle_create(badd->bundle_id, badd->flags); - bundle->state = BS_OPEN; - - bundles = ofconn_get_bundles(ofconn); - hmap_insert(bundles, &bundle->node, bundle_hash(badd->bundle_id)); - } + enum ofperr error; - if (bundle->state == BS_CLOSED) { - ofp_bundle_remove(ofconn, bundle); + bundle = ofp_bundle_create(id, flags); + error = ofconn_insert_bundle(ofconn, bundle); + if (error) { + free(bundle); + return error; + } + } else if (bundle->state == BS_CLOSED) { + ofp_bundle_remove__(ofconn, bundle, false); return OFPERR_OFPBFC_BUNDLE_CLOSED; + } else if (flags != bundle->flags) { + ofp_bundle_remove__(ofconn, bundle, false); + return OFPERR_OFPBFC_BAD_FLAGS; } - bmsg = xmalloc(sizeof *bmsg); - bmsg->msg = xmemdup(badd->msg, ntohs(badd->msg->length)); list_push_back(&bundle->msg_list, &bmsg->node); return 0; } diff -Nru openvswitch-2.3.1/ofproto/bundles.h openvswitch-2.4.0~git20150623/ofproto/bundles.h --- openvswitch-2.3.1/ofproto/bundles.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/bundles.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,7 @@ /* * Copyright (c) 2013, 2014 Alexandru Copot , with support from IXIA. * Copyright (c) 2013, 2014 Daniel Baluta + * Copyright (c) 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,27 +21,86 @@ #include -#include "ofp-msgs.h" #include "connmgr.h" +#include "ofp-msgs.h" #include "ofp-util.h" +#include "ofproto-provider.h" +#include "util.h" #ifdef __cplusplus extern "C" { #endif +struct ofp_bundle_entry { + struct ovs_list node; + enum ofptype type; /* OFPTYPE_FLOW_MOD or OFPTYPE_PORT_MOD. */ + long long version; /* Version in which the changes take + * effect. */ + union { + struct ofputil_flow_mod fm; /* 'fm.ofpacts' must be malloced. */ + struct ofputil_port_mod pm; + }; + + /* Used during commit. */ + struct ofport *port; /* Affected port. */ + struct rule_collection old_rules; /* Affected rules. */ + struct rule_collection new_rules; /* Replacement rules. */ + + /* OpenFlow header and some of the message contents for error reporting. */ + struct ofp_header ofp_msg[DIV_ROUND_UP(64, sizeof(struct ofp_header))]; +}; + +enum bundle_state { + BS_OPEN, + BS_CLOSED +}; + +struct ofp_bundle { + struct hmap_node node; /* In struct ofconn's "bundles" hmap. */ + uint32_t id; + uint16_t flags; + enum bundle_state state; + + /* List of 'struct bundle_message's */ + struct ovs_list msg_list; +}; + +static inline struct ofp_bundle_entry *ofp_bundle_entry_alloc( + enum ofptype type, const struct ofp_header *oh); +static inline void ofp_bundle_entry_free(struct ofp_bundle_entry *); + +enum ofperr ofp_bundle_open(struct ofconn *, uint32_t id, uint16_t flags); +enum ofperr ofp_bundle_close(struct ofconn *, uint32_t id, uint16_t flags); +enum ofperr ofp_bundle_discard(struct ofconn *, uint32_t id); +enum ofperr ofp_bundle_add_message(struct ofconn *, uint32_t id, + uint16_t flags, struct ofp_bundle_entry *); + +void ofp_bundle_remove__(struct ofconn *, struct ofp_bundle *, bool success); + +static inline struct ofp_bundle_entry * +ofp_bundle_entry_alloc(enum ofptype type, const struct ofp_header *oh) +{ + struct ofp_bundle_entry *entry = xmalloc(sizeof *entry); -enum ofperr ofp_bundle_open(struct ofconn *ofconn, uint32_t id, uint16_t flags); - -enum ofperr ofp_bundle_close(struct ofconn *ofconn, uint32_t id, uint16_t flags); + entry->type = type; + entry->version = 0; -enum ofperr ofp_bundle_commit(struct ofconn *ofconn, uint32_t id, uint16_t flags); + /* Max 64 bytes for error reporting. */ + memcpy(entry->ofp_msg, oh, MIN(ntohs(oh->length), sizeof entry->ofp_msg)); -enum ofperr ofp_bundle_discard(struct ofconn *ofconn, uint32_t id); - -enum ofperr ofp_bundle_add_message(struct ofconn *ofconn, - struct ofputil_bundle_add_msg *badd); + return entry; +} -void ofp_bundle_remove_all(struct ofconn *ofconn); +static inline void +ofp_bundle_entry_free(struct ofp_bundle_entry *entry) +{ + if (entry) { + if (entry->type == OFPTYPE_FLOW_MOD) { + free(entry->fm.ofpacts); + } + free(entry); + } +} #ifdef __cplusplus } diff -Nru openvswitch-2.3.1/ofproto/collectors.c openvswitch-2.4.0~git20150623/ofproto/collectors.c --- openvswitch-2.3.1/ofproto/collectors.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/collectors.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,7 +26,7 @@ #include "socket-util.h" #include "sset.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(collectors); diff -Nru openvswitch-2.3.1/ofproto/connmgr.c openvswitch-2.4.0~git20150623/ofproto/connmgr.c --- openvswitch-2.3.1/ofproto/connmgr.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/connmgr.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,8 +39,8 @@ #include "simap.h" #include "stream.h" #include "timeval.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" #include "bundles.h" @@ -60,7 +60,7 @@ struct ofconn { /* Configuration that persists from one connection to the next. */ - struct list node; /* In struct connmgr's "all_conns" list. */ + struct ovs_list node; /* In struct connmgr's "all_conns" list. */ struct hmap_node hmap_node; /* In struct connmgr's "controllers" map. */ struct connmgr *connmgr; /* Connection's manager. */ @@ -76,11 +76,6 @@ enum ofputil_protocol protocol; /* Current protocol variant. */ enum nx_packet_in_format packet_in_format; /* OFPT_PACKET_IN format. */ - /* Asynchronous flow table operation support. */ - struct list opgroups; /* Contains pending "ofopgroups", if any. */ - struct ofpbuf *blocked; /* Postponed OpenFlow message, if any. */ - bool retry; /* True if 'blocked' is ready to try again. */ - /* OFPT_PACKET_IN related data. */ struct rconn_packet_counter *packet_in_counter; /* # queued on 'rconn'. */ #define N_SCHEDULERS 2 @@ -136,7 +131,7 @@ * * When 'updates' is nonempty, 'sent_abbrev_update' is true if 'updates' * contains an update event of type NXFME_ABBREV and false otherwise.. */ - struct list updates OVS_GUARDED_BY(ofproto_mutex); + struct ovs_list updates OVS_GUARDED_BY(ofproto_mutex); bool sent_abbrev_update OVS_GUARDED_BY(ofproto_mutex); /* Active bundles. Contains "struct ofp_bundle"s. */ @@ -153,9 +148,9 @@ const struct ofproto_controller *); static void ofconn_run(struct ofconn *, - bool (*handle_openflow)(struct ofconn *, + void (*handle_openflow)(struct ofconn *, const struct ofpbuf *ofp_msg)); -static void ofconn_wait(struct ofconn *, bool handling_openflow); +static void ofconn_wait(struct ofconn *); static void ofconn_log_flow_mods(struct ofconn *); @@ -167,7 +162,7 @@ static void ofconn_send(const struct ofconn *, struct ofpbuf *, struct rconn_packet_counter *); -static void do_send_packet_ins(struct ofconn *, struct list *txq); +static void do_send_packet_ins(struct ofconn *, struct ovs_list *txq); /* A listener for incoming OpenFlow "service" connections. */ struct ofservice { @@ -200,8 +195,8 @@ char *local_port_name; /* OpenFlow connections. */ - struct hmap controllers; /* All OFCONN_PRIMARY controllers. */ - struct list all_conns; /* All controllers. */ + struct hmap controllers; /* All OFCONN_PRIMARY controllers. */ + struct ovs_list all_conns; /* All controllers. */ uint64_t master_election_id; /* monotonically increasing sequence number * for master election */ bool master_election_id_defined; @@ -304,23 +299,13 @@ free(mgr); } -/* Does all of the periodic maintenance required by 'mgr'. - * - * If 'handle_openflow' is nonnull, calls 'handle_openflow' for each message - * received on an OpenFlow connection, passing along the OpenFlow connection - * itself and the message that was sent. If 'handle_openflow' returns true, - * the message is considered to be fully processed. If 'handle_openflow' - * returns false, the message is considered not to have been processed at all; - * it will be stored and re-presented to 'handle_openflow' following the next - * call to connmgr_retry(). 'handle_openflow' must not modify or free the - * message. - * - * If 'handle_openflow' is NULL, no OpenFlow messages will be processed and - * other activities that could affect the flow table (in-band processing, - * fail-open processing) are suppressed too. */ +/* Does all of the periodic maintenance required by 'mgr'. Calls + * 'handle_openflow' for each message received on an OpenFlow connection, + * passing along the OpenFlow connection itself and the message that was sent. + * 'handle_openflow' must not modify or free the message. */ void connmgr_run(struct connmgr *mgr, - bool (*handle_openflow)(struct ofconn *, + void (*handle_openflow)(struct ofconn *, const struct ofpbuf *ofp_msg)) OVS_EXCLUDED(ofproto_mutex) { @@ -328,7 +313,7 @@ struct ofservice *ofservice; size_t i; - if (handle_openflow && mgr->in_band) { + if (mgr->in_band) { if (!in_band_run(mgr->in_band)) { in_band_destroy(mgr->in_band); mgr->in_band = NULL; @@ -342,7 +327,7 @@ /* Fail-open maintenance. Do this after processing the ofconns since * fail-open checks the status of the controller rconn. */ - if (handle_openflow && mgr->fail_open) { + if (mgr->fail_open) { fail_open_run(mgr->fail_open); } @@ -387,26 +372,22 @@ } } -/* Causes the poll loop to wake up when connmgr_run() needs to run. - * - * If 'handling_openflow' is true, arriving OpenFlow messages and other - * activities that affect the flow table will wake up the poll loop. If - * 'handling_openflow' is false, they will not. */ +/* Causes the poll loop to wake up when connmgr_run() needs to run. */ void -connmgr_wait(struct connmgr *mgr, bool handling_openflow) +connmgr_wait(struct connmgr *mgr) { struct ofservice *ofservice; struct ofconn *ofconn; size_t i; LIST_FOR_EACH (ofconn, node, &mgr->all_conns) { - ofconn_wait(ofconn, handling_openflow); + ofconn_wait(ofconn); } ofmonitor_wait(mgr); - if (handling_openflow && mgr->in_band) { + if (mgr->in_band) { in_band_wait(mgr->in_band); } - if (handling_openflow && mgr->fail_open) { + if (mgr->fail_open) { fail_open_wait(mgr->fail_open); } HMAP_FOR_EACH (ofservice, node, &mgr->services) { @@ -433,7 +414,10 @@ packets += rconn_count_txqlen(ofconn->rconn); for (i = 0; i < N_SCHEDULERS; i++) { - packets += pinsched_count_txqlen(ofconn->schedulers[i]); + struct pinsched_stats stats; + + pinsched_get_stats(ofconn->schedulers[i], &stats); + packets += stats.n_queued;; } packets += pktbuf_count_packets(ofconn->pktbuf); } @@ -447,19 +431,6 @@ { return ofconn->connmgr->ofproto; } - -/* If processing of OpenFlow messages was blocked on any 'mgr' ofconns by - * returning false to the 'handle_openflow' callback to connmgr_run(), this - * re-enables them. */ -void -connmgr_retry(struct connmgr *mgr) -{ - struct ofconn *ofconn; - - LIST_FOR_EACH (ofconn, node, &mgr->all_conns) { - ofconn->retry = true; - } -} /* OpenFlow configuration. */ @@ -503,34 +474,50 @@ time_t last_connection = rconn_get_last_connection(rconn); time_t last_disconnect = rconn_get_last_disconnect(rconn); int last_error = rconn_get_last_error(rconn); + int i; shash_add(info, target, cinfo); cinfo->is_connected = rconn_is_connected(rconn); cinfo->role = ofconn->role; - cinfo->pairs.n = 0; - + smap_init(&cinfo->pairs); if (last_error) { - cinfo->pairs.keys[cinfo->pairs.n] = "last_error"; - cinfo->pairs.values[cinfo->pairs.n++] - = xstrdup(ovs_retval_to_string(last_error)); + smap_add(&cinfo->pairs, "last_error", + ovs_retval_to_string(last_error)); } - cinfo->pairs.keys[cinfo->pairs.n] = "state"; - cinfo->pairs.values[cinfo->pairs.n++] - = xstrdup(rconn_get_state(rconn)); + smap_add(&cinfo->pairs, "state", rconn_get_state(rconn)); if (last_connection != TIME_MIN) { - cinfo->pairs.keys[cinfo->pairs.n] = "sec_since_connect"; - cinfo->pairs.values[cinfo->pairs.n++] - = xasprintf("%ld", (long int) (now - last_connection)); + smap_add_format(&cinfo->pairs, "sec_since_connect", + "%ld", (long int) (now - last_connection)); } if (last_disconnect != TIME_MIN) { - cinfo->pairs.keys[cinfo->pairs.n] = "sec_since_disconnect"; - cinfo->pairs.values[cinfo->pairs.n++] - = xasprintf("%ld", (long int) (now - last_disconnect)); + smap_add_format(&cinfo->pairs, "sec_since_disconnect", + "%ld", (long int) (now - last_disconnect)); + } + + for (i = 0; i < N_SCHEDULERS; i++) { + if (ofconn->schedulers[i]) { + const char *name = i ? "miss" : "action"; + struct pinsched_stats stats; + + pinsched_get_stats(ofconn->schedulers[i], &stats); + smap_add_nocopy(&cinfo->pairs, + xasprintf("packet-in-%s-backlog", name), + xasprintf("%u", stats.n_queued)); + smap_add_nocopy(&cinfo->pairs, + xasprintf("packet-in-%s-bypassed", name), + xasprintf("%llu", stats.n_normal)); + smap_add_nocopy(&cinfo->pairs, + xasprintf("packet-in-%s-queued", name), + xasprintf("%llu", stats.n_limited)); + smap_add_nocopy(&cinfo->pairs, + xasprintf("packet-in-%s-dropped", name), + xasprintf("%llu", stats.n_queue_dropped)); + } } } } @@ -543,9 +530,7 @@ SHASH_FOR_EACH (node, info) { struct ofproto_controller_info *cinfo = node->data; - while (cinfo->pairs.n) { - free(CONST_CAST(char *, cinfo->pairs.values[--cinfo->pairs.n])); - } + smap_destroy(&cinfo->pairs); free(cinfo); } shash_destroy(info); @@ -749,12 +734,15 @@ /* Add all the remotes. */ HMAP_FOR_EACH (ofconn, hmap_node, &mgr->controllers) { const char *target = rconn_get_target(ofconn->rconn); - struct sockaddr_storage ss; + union { + struct sockaddr_storage ss; + struct sockaddr_in in; + } sa; if (ofconn->band == OFPROTO_IN_BAND - && stream_parse_target_with_default_port(target, OFP_OLD_PORT, &ss) - && ss.ss_family == AF_INET) { - addrs[n_addrs++] = *(struct sockaddr_in *) &ss; + && stream_parse_target_with_default_port(target, OFP_PORT, &sa.ss) + && sa.ss.ss_family == AF_INET) { + addrs[n_addrs++] = sa.in; } } for (i = 0; i < mgr->n_extra_remotes; i++) { @@ -1007,6 +995,18 @@ ofconn_set_protocol(struct ofconn *ofconn, enum ofputil_protocol protocol) { ofconn->protocol = protocol; + if (!(protocol & OFPUTIL_P_OF14_UP)) { + uint32_t *master = ofconn->master_async_config; + uint32_t *slave = ofconn->slave_async_config; + + /* OFPR_ACTION_SET is not supported before OF1.4 */ + master[OAM_PACKET_IN] &= ~(1u << OFPR_ACTION_SET); + slave [OAM_PACKET_IN] &= ~(1u << OFPR_ACTION_SET); + + /* OFPR_GROUP is not supported before OF1.4 */ + master[OAM_PACKET_IN] &= ~(1u << OFPR_GROUP); + slave [OAM_PACKET_IN] &= ~(1u << OFPR_GROUP); + } } /* Returns the currently configured packet in format for 'ofconn', one of @@ -1067,6 +1067,13 @@ uint32_t *master_masks, uint32_t *slave_masks) { size_t size = sizeof ofconn->master_async_config; + + /* Make sure we know the protocol version and the async_config + * masks are properly updated by calling ofconn_get_protocol() */ + if (OFPUTIL_P_NONE == ofconn_get_protocol(ofconn)){ + OVS_NOT_REACHED(); + } + memcpy(master_masks, ofconn->master_async_config, size); memcpy(slave_masks, ofconn->slave_async_config, size); } @@ -1084,12 +1091,11 @@ /* Sends each of the messages in list 'replies' on 'ofconn' in order, * accounting them as replies. */ void -ofconn_send_replies(const struct ofconn *ofconn, struct list *replies) +ofconn_send_replies(const struct ofconn *ofconn, struct ovs_list *replies) { - struct ofpbuf *reply, *next; + struct ofpbuf *reply; - LIST_FOR_EACH_SAFE (reply, next, list_node, replies) { - list_remove(&reply->list_node); + LIST_FOR_EACH_POP (reply, list_node, replies) { ofconn_send_reply(ofconn, reply); } } @@ -1125,7 +1131,7 @@ /* Same as pktbuf_retrieve(), using the pktbuf owned by 'ofconn'. */ enum ofperr ofconn_pktbuf_retrieve(struct ofconn *ofconn, uint32_t id, - struct ofpbuf **bufferp, ofp_port_t *in_port) + struct dp_packet **bufferp, ofp_port_t *in_port) { return pktbuf_retrieve(ofconn->pktbuf, id, bufferp, in_port); } @@ -1162,35 +1168,56 @@ } ofconn->last_op = now; } + +/* OpenFlow 1.4 bundles. */ -/* Returns true if 'ofconn' has any pending opgroups. */ -bool -ofconn_has_pending_opgroups(const struct ofconn *ofconn) +static inline uint32_t +bundle_hash(uint32_t id) { - return !list_is_empty(&ofconn->opgroups); + return hash_int(id, 0); } -/* Adds 'ofconn_node' to 'ofconn''s list of pending opgroups. - * - * If 'ofconn' is destroyed or its connection drops, then 'ofconn' will remove - * 'ofconn_node' from the list and re-initialize it with list_init(). The - * client may, therefore, use list_is_empty(ofconn_node) to determine whether - * 'ofconn_node' is still associated with an active ofconn. - * - * The client may also remove ofconn_node from the list itself, with - * list_remove(). */ -void -ofconn_add_opgroup(struct ofconn *ofconn, struct list *ofconn_node) +struct ofp_bundle * +ofconn_get_bundle(struct ofconn *ofconn, uint32_t id) +{ + struct ofp_bundle *bundle; + + HMAP_FOR_EACH_IN_BUCKET(bundle, node, bundle_hash(id), &ofconn->bundles) { + if (bundle->id == id) { + return bundle; + } + } + + return NULL; +} + +enum ofperr +ofconn_insert_bundle(struct ofconn *ofconn, struct ofp_bundle *bundle) { - list_push_back(&ofconn->opgroups, ofconn_node); + /* XXX: Check the limit of open bundles */ + + hmap_insert(&ofconn->bundles, &bundle->node, bundle_hash(bundle->id)); + + return 0; } -struct hmap * -ofconn_get_bundles(struct ofconn *ofconn) +enum ofperr +ofconn_remove_bundle(struct ofconn *ofconn, struct ofp_bundle *bundle) { - return &ofconn->bundles; + hmap_remove(&ofconn->bundles, &bundle->node); + + return 0; } +static void +bundle_remove_all(struct ofconn *ofconn) +{ + struct ofp_bundle *b, *next; + + HMAP_FOR_EACH_SAFE (b, next, node, &ofconn->bundles) { + ofp_bundle_remove__(ofconn, b, false); + } +} /* Private ofconn functions. */ @@ -1213,8 +1240,6 @@ ofconn->type = type; ofconn->enable_async_msgs = enable_async_msgs; - list_init(&ofconn->opgroups); - hmap_init(&ofconn->monitors); list_init(&ofconn->updates); @@ -1240,18 +1265,6 @@ ofconn_set_protocol(ofconn, OFPUTIL_P_NONE); ofconn->packet_in_format = NXPIF_OPENFLOW10; - /* Disassociate 'ofconn' from all of the ofopgroups that it initiated that - * have not yet completed. (Those ofopgroups will still run to completion - * in the usual way, but any errors that they run into will not be reported - * on any OpenFlow channel.) - * - * Also discard any blocked operation on 'ofconn'. */ - while (!list_is_empty(&ofconn->opgroups)) { - list_init(list_pop_front(&ofconn->opgroups)); - } - ofpbuf_delete(ofconn->blocked); - ofconn->blocked = NULL; - rconn_packet_counter_destroy(ofconn->packet_in_counter); ofconn->packet_in_counter = rconn_packet_counter_create(); for (i = 0; i < N_SCHEDULERS; i++) { @@ -1282,7 +1295,10 @@ /* "master" and "other" roles get all asynchronous messages by default, * except that the controller needs to enable nonstandard "packet-in" * reasons itself. */ - master[OAM_PACKET_IN] = (1u << OFPR_NO_MATCH) | (1u << OFPR_ACTION); + master[OAM_PACKET_IN] = ((1u << OFPR_NO_MATCH) + | (1u << OFPR_ACTION) + | (1u << OFPR_ACTION_SET) + | (1u << OFPR_GROUP)); master[OAM_PORT_STATUS] = ((1u << OFPPR_ADD) | (1u << OFPPR_DELETE) | (1u << OFPPR_MODIFY)); @@ -1327,7 +1343,8 @@ hmap_remove(&ofconn->connmgr->controllers, &ofconn->hmap_node); } - ofp_bundle_remove_all(ofconn); + bundle_remove_all(ofconn); + hmap_destroy(&ofconn->bundles); hmap_destroy(&ofconn->monitors); list_remove(&ofconn->node); @@ -1369,19 +1386,19 @@ ofconn_may_recv(const struct ofconn *ofconn) { int count = rconn_packet_counter_n_packets(ofconn->reply_counter); - return (!ofconn->blocked || ofconn->retry) && count < OFCONN_REPLY_MAX; + return count < OFCONN_REPLY_MAX; } static void ofconn_run(struct ofconn *ofconn, - bool (*handle_openflow)(struct ofconn *, + void (*handle_openflow)(struct ofconn *, const struct ofpbuf *ofp_msg)) { struct connmgr *mgr = ofconn->connmgr; size_t i; for (i = 0; i < N_SCHEDULERS; i++) { - struct list txq; + struct ovs_list txq; pinsched_run(ofconn->schedulers[i], &txq); do_send_packet_ins(ofconn, &txq); @@ -1389,31 +1406,20 @@ rconn_run(ofconn->rconn); - if (handle_openflow) { - /* Limit the number of iterations to avoid starving other tasks. */ - for (i = 0; i < 50 && ofconn_may_recv(ofconn); i++) { - struct ofpbuf *of_msg; - - of_msg = (ofconn->blocked - ? ofconn->blocked - : rconn_recv(ofconn->rconn)); - if (!of_msg) { - break; - } - if (mgr->fail_open) { - fail_open_maybe_recover(mgr->fail_open); - } + /* Limit the number of iterations to avoid starving other tasks. */ + for (i = 0; i < 50 && ofconn_may_recv(ofconn); i++) { + struct ofpbuf *of_msg = rconn_recv(ofconn->rconn); + if (!of_msg) { + break; + } - if (handle_openflow(ofconn, of_msg)) { - ofpbuf_delete(of_msg); - ofconn->blocked = NULL; - } else { - ofconn->blocked = of_msg; - ofconn->retry = false; - } + if (mgr->fail_open) { + fail_open_maybe_recover(mgr->fail_open); } - } + handle_openflow(ofconn, of_msg); + ofpbuf_delete(of_msg); + } if (time_msec() >= ofconn->next_op_report) { ofconn_log_flow_mods(ofconn); @@ -1429,7 +1435,7 @@ } static void -ofconn_wait(struct ofconn *ofconn, bool handling_openflow) +ofconn_wait(struct ofconn *ofconn) { int i; @@ -1437,7 +1443,7 @@ pinsched_wait(ofconn->schedulers[i]); } rconn_run_wait(ofconn->rconn); - if (handling_openflow && ofconn_may_recv(ofconn)) { + if (ofconn_may_recv(ofconn)) { rconn_recv_wait(ofconn->rconn); } if (ofconn->next_op_report != LLONG_MAX) { @@ -1542,14 +1548,11 @@ enum ofputil_protocol protocol = ofconn_get_protocol(ofconn); if (protocol != OFPUTIL_P_NONE - && ofputil_protocol_to_ofp_version(protocol) >= OFP13_VERSION) { - enum ofproto_table_config config; - - config = ofproto_table_get_config(ofconn->connmgr->ofproto, - pin->up.table_id); - if (config == OFPROTO_TABLE_MISS_DEFAULT) { - return false; - } + && ofputil_protocol_to_ofp_version(protocol) >= OFP13_VERSION + && (ofproto_table_get_miss_config(ofconn->connmgr->ofproto, + pin->up.table_id) + == OFPUTIL_TABLE_MISS_DEFAULT)) { + return false; } } return true; @@ -1712,16 +1715,31 @@ static enum ofp_packet_in_reason wire_reason(struct ofconn *ofconn, const struct ofproto_packet_in *pin) { - if (pin->miss_type == OFPROTO_PACKET_IN_MISS_FLOW - && pin->up.reason == OFPR_ACTION) { - enum ofputil_protocol protocol = ofconn_get_protocol(ofconn); + enum ofputil_protocol protocol = ofconn_get_protocol(ofconn); - if (protocol != OFPUTIL_P_NONE - && ofputil_protocol_to_ofp_version(protocol) >= OFP13_VERSION) { - return OFPR_NO_MATCH; - } + if (pin->miss_type == OFPROTO_PACKET_IN_MISS_FLOW + && pin->up.reason == OFPR_ACTION + && protocol != OFPUTIL_P_NONE + && ofputil_protocol_to_ofp_version(protocol) >= OFP13_VERSION) { + return OFPR_NO_MATCH; + } + + switch (pin->up.reason) { + case OFPR_ACTION_SET: + case OFPR_GROUP: + case OFPR_PACKET_OUT: + if (!(protocol & OFPUTIL_P_OF14_UP)) { + /* Only supported in OF1.4+ */ + return OFPR_ACTION; + } + /* Fall through. */ + case OFPR_NO_MATCH: + case OFPR_ACTION: + case OFPR_INVALID_TTL: + case OFPR_N_REASONS: + default: + return pin->up.reason; } - return pin->up.reason; } /* Given 'pin', sends an OFPT_PACKET_IN message to each OpenFlow controller as @@ -1738,7 +1756,7 @@ enum ofp_packet_in_reason reason = wire_reason(ofconn, pin); if (ofconn_wants_packet_in_on_miss(ofconn, pin) - && ofconn_receives_async_msg(ofconn, OAM_PACKET_IN, pin->up.reason) + && ofconn_receives_async_msg(ofconn, OAM_PACKET_IN, reason) && ofconn->controller_id == pin->controller_id) { schedule_packet_in(ofconn, *pin, reason); } @@ -1746,13 +1764,11 @@ } static void -do_send_packet_ins(struct ofconn *ofconn, struct list *txq) +do_send_packet_ins(struct ofconn *ofconn, struct ovs_list *txq) { - struct ofpbuf *pin, *next_pin; - - LIST_FOR_EACH_SAFE (pin, next_pin, list_node, txq) { - list_remove(&pin->list_node); + struct ofpbuf *pin; + LIST_FOR_EACH_POP (pin, list_node, txq) { if (rconn_send_with_limit(ofconn->rconn, pin, ofconn->packet_in_counter, 100) == EAGAIN) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5); @@ -1771,7 +1787,7 @@ { struct connmgr *mgr = ofconn->connmgr; uint16_t controller_max_len; - struct list txq; + struct ovs_list txq; pin.up.total_len = pin.up.packet_len; @@ -1794,7 +1810,7 @@ } else { pin.up.buffer_id = pktbuf_save(ofconn->pktbuf, pin.up.packet, pin.up.packet_len, - pin.up.fmd.in_port); + pin.up.flow_metadata.flow.in_port.ofp_port); } /* Figure out how much of the packet to send. @@ -1807,7 +1823,7 @@ /* Make OFPT_PACKET_IN and hand over to packet scheduler. */ pinsched_send(ofconn->schedulers[pin.up.reason == OFPR_NO_MATCH ? 0 : 1], - pin.up.fmd.in_port, + pin.up.flow_metadata.flow.in_port.ofp_port, ofputil_encode_packet_in(&pin.up, ofconn_get_protocol(ofconn), ofconn->packet_in_format), @@ -2002,12 +2018,29 @@ ofpact_pad(&ofpacts); match_init_catchall(&match); - ofproto_add_flow(mgr->ofproto, &match, 0, ofpbuf_data(&ofpacts), - ofpbuf_size(&ofpacts)); + ofproto_add_flow(mgr->ofproto, &match, 0, ofpacts.data, + ofpacts.size); ofpbuf_uninit(&ofpacts); } } + +/* Returns the number of hidden rules created by the in-band and fail-open + * implementations in table 0. (Subtracting this count from the number of + * rules in the table 0 classifier, as maintained in struct oftable, yields + * the number of flows that OVS should report via OpenFlow for table 0.) */ +int +connmgr_count_hidden_rules(const struct connmgr *mgr) +{ + int n_hidden = 0; + if (mgr->in_band) { + n_hidden += in_band_count_rules(mgr->in_band); + } + if (mgr->fail_open) { + n_hidden += fail_open_count_rules(mgr->fail_open); + } + return n_hidden; +} /* Creates a new ofservice for 'target' in 'mgr'. Returns 0 if successful, * otherwise a positive errno value. @@ -2106,7 +2139,7 @@ m = ofmonitor_lookup(ofconn, request->id); if (m) { - return OFPERR_NXBRC_FM_DUPLICATE_ID; + return OFPERR_OFPMOFC_MONITOR_EXISTS; } m = xmalloc(sizeof *m); @@ -2152,12 +2185,17 @@ ofmonitor_report(struct connmgr *mgr, struct rule *rule, enum nx_flow_update_event event, enum ofp_flow_removed_reason reason, - const struct ofconn *abbrev_ofconn, ovs_be32 abbrev_xid) + const struct ofconn *abbrev_ofconn, ovs_be32 abbrev_xid, + const struct rule_actions *old_actions) OVS_REQUIRES(ofproto_mutex) { enum nx_flow_monitor_flags update; struct ofconn *ofconn; + if (rule_is_hidden(rule)) { + return; + } + switch (event) { case NXFME_ADDED: update = NXFMF_ADD; @@ -2194,7 +2232,11 @@ HMAP_FOR_EACH (m, ofconn_node, &ofconn->monitors) { if (m->flags & update && (m->table_id == 0xff || m->table_id == rule->table_id) - && ofoperation_has_out_port(rule->pending, m->out_port) + && (ofproto_rule_has_out_port(rule, m->out_port) + || (old_actions + && ofpacts_output_to_port(old_actions->ofpacts, + old_actions->ofpacts_len, + m->out_port))) && cls_rule_is_loose_match(&rule->cr, &m->match)) { flags |= m->flags; } @@ -2206,7 +2248,8 @@ ofconn->sent_abbrev_update = false; } - if (ofconn != abbrev_ofconn || ofconn->monitor_paused) { + if (flags & NXFMF_OWN || ofconn != abbrev_ofconn + || ofconn->monitor_paused) { struct ofputil_flow_update fu; struct match match; @@ -2252,12 +2295,11 @@ struct ofconn *ofconn; LIST_FOR_EACH (ofconn, node, &mgr->all_conns) { - struct ofpbuf *msg, *next; + struct ofpbuf *msg; - LIST_FOR_EACH_SAFE (msg, next, list_node, &ofconn->updates) { + LIST_FOR_EACH_POP (msg, list_node, &ofconn->updates) { unsigned int n_bytes; - list_remove(&msg->list_node); ofconn_send(ofconn, msg, ofconn->monitor_counter); n_bytes = rconn_packet_counter_n_bytes(ofconn->monitor_counter); if (!ofconn->monitor_paused && n_bytes > 128 * 1024) { @@ -2280,7 +2322,7 @@ struct rule_collection rules; struct ofpbuf *resumed; struct ofmonitor *m; - struct list msgs; + struct ovs_list msgs; rule_collection_init(&rules); HMAP_FOR_EACH (m, ofconn_node, &ofconn->monitors) { diff -Nru openvswitch-2.3.1/ofproto/connmgr.h openvswitch-2.4.0~git20150623/ofproto/connmgr.h --- openvswitch-2.3.1/ofproto/connmgr.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/connmgr.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ #include "ofp-errors.h" #include "ofp-util.h" #include "ofproto.h" +#include "ofproto-provider.h" #include "openflow/nicira-ext.h" #include "openvswitch/types.h" struct nlattr; struct ofconn; -struct ofopgroup; struct rule; struct simap; struct sset; @@ -84,7 +84,7 @@ /* A packet_in, with extra members to assist in queuing and routing it. */ struct ofproto_packet_in { struct ofputil_packet_in up; - struct list list_node; /* For queuing. */ + struct ovs_list list_node; /* For queuing. */ uint16_t controller_id; /* Controller ID to send to. */ int send_len; /* Length that the action requested sending. */ enum ofproto_packet_in_miss_type miss_type; @@ -96,9 +96,9 @@ void connmgr_destroy(struct connmgr *); void connmgr_run(struct connmgr *, - bool (*handle_openflow)(struct ofconn *, + void (*handle_openflow)(struct ofconn *, const struct ofpbuf *ofp_msg)); -void connmgr_wait(struct connmgr *, bool handling_openflow); +void connmgr_wait(struct connmgr *); void connmgr_get_memory_usage(const struct connmgr *, struct simap *usage); @@ -149,17 +149,18 @@ uint32_t *slave_masks); void ofconn_send_reply(const struct ofconn *, struct ofpbuf *); -void ofconn_send_replies(const struct ofconn *, struct list *); +void ofconn_send_replies(const struct ofconn *, struct ovs_list *); void ofconn_send_error(const struct ofconn *, const struct ofp_header *request, enum ofperr); enum ofperr ofconn_pktbuf_retrieve(struct ofconn *, uint32_t id, - struct ofpbuf **bufferp, ofp_port_t *in_port); + struct dp_packet **bufferp, ofp_port_t *in_port); -bool ofconn_has_pending_opgroups(const struct ofconn *); -void ofconn_add_opgroup(struct ofconn *, struct list *); +struct ofp_bundle; -struct hmap *ofconn_get_bundles(struct ofconn *ofconn); +struct ofp_bundle *ofconn_get_bundle(struct ofconn *, uint32_t id); +enum ofperr ofconn_insert_bundle(struct ofconn *, struct ofp_bundle *); +enum ofperr ofconn_remove_bundle(struct ofconn *, struct ofp_bundle *); /* Logging flow_mod summaries. */ void ofconn_report_flow_mod(struct ofconn *, enum ofp_flow_mod_command); @@ -196,6 +197,8 @@ /* Fail-open and in-band implementation. */ void connmgr_flushed(struct connmgr *); +int connmgr_count_hidden_rules(const struct connmgr *); + /* A flow monitor managed by NXST_FLOW_MONITOR and related requests. */ struct ofmonitor { struct ofconn *ofconn; /* Owning 'ofconn'. */ @@ -222,7 +225,8 @@ void ofmonitor_report(struct connmgr *, struct rule *, enum nx_flow_update_event, enum ofp_flow_removed_reason, - const struct ofconn *abbrev_ofconn, ovs_be32 abbrev_xid) + const struct ofconn *abbrev_ofconn, ovs_be32 abbrev_xid, + const struct rule_actions *old_actions) OVS_REQUIRES(ofproto_mutex); void ofmonitor_flush(struct connmgr *) OVS_REQUIRES(ofproto_mutex); @@ -232,7 +236,7 @@ struct rule_collection *) OVS_REQUIRES(ofproto_mutex); void ofmonitor_compose_refresh_updates(struct rule_collection *rules, - struct list *msgs) + struct ovs_list *msgs) OVS_REQUIRES(ofproto_mutex); #endif /* connmgr.h */ diff -Nru openvswitch-2.3.1/ofproto/fail-open.c openvswitch-2.4.0~git20150623/ofproto/fail-open.c --- openvswitch-2.3.1/ofproto/fail-open.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/fail-open.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,17 +23,18 @@ #include "flow.h" #include "mac-learning.h" #include "odp-util.h" +#include "ofpbuf.h" #include "ofp-actions.h" #include "ofp-util.h" -#include "ofpbuf.h" #include "ofproto.h" #include "ofproto-provider.h" #include "pktbuf.h" +#include "dp-packet.h" #include "poll-loop.h" #include "rconn.h" #include "timeval.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(fail_open); @@ -76,6 +77,7 @@ int last_disconn_secs; long long int next_bogus_packet_in; struct rconn_packet_counter *bogus_packet_counter; + bool fail_open_active; }; static void fail_open_recover(struct fail_open *); @@ -118,22 +120,23 @@ { struct ofproto_packet_in pin; uint8_t mac[ETH_ADDR_LEN]; - struct ofpbuf b; + struct dp_packet b; - ofpbuf_init(&b, 128); + dp_packet_init(&b, 128); eth_addr_nicira_random(mac); compose_rarp(&b, mac); memset(&pin, 0, sizeof pin); - pin.up.packet = ofpbuf_data(&b); - pin.up.packet_len = ofpbuf_size(&b); + pin.up.packet = dp_packet_data(&b); + pin.up.packet_len = dp_packet_size(&b); pin.up.reason = OFPR_NO_MATCH; - pin.up.fmd.in_port = OFPP_LOCAL; - pin.send_len = ofpbuf_size(&b); + match_init_catchall(&pin.up.flow_metadata); + match_set_in_port(&pin.up.flow_metadata, OFPP_LOCAL); + pin.send_len = dp_packet_size(&b); pin.miss_type = OFPROTO_PACKET_IN_NO_MISS; connmgr_send_packet_in(fo->connmgr, &pin); - ofpbuf_uninit(&b); + dp_packet_uninit(&b); } /* Enter fail-open mode if we should be in it. */ @@ -230,10 +233,19 @@ match_init_catchall(&match); ofproto_add_flow(fo->ofproto, &match, FAIL_OPEN_PRIORITY, - ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts)); + ofpacts.data, ofpacts.size); ofpbuf_uninit(&ofpacts); } + fo->fail_open_active = open; +} + +/* Returns the number of fail-open rules currently installed in the flow + * table. */ +int +fail_open_count_rules(const struct fail_open *fo) +{ + return fo->fail_open_active != 0; } /* Creates and returns a new struct fail_open for 'ofproto' and 'mgr'. */ @@ -246,6 +258,7 @@ fo->last_disconn_secs = 0; fo->next_bogus_packet_in = LLONG_MAX; fo->bogus_packet_counter = rconn_packet_counter_create(); + fo->fail_open_active = false; return fo; } diff -Nru openvswitch-2.3.1/ofproto/fail-open.h openvswitch-2.4.0~git20150623/ofproto/fail-open.h --- openvswitch-2.3.1/ofproto/fail-open.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/fail-open.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,4 +47,6 @@ void fail_open_maybe_recover(struct fail_open *) OVS_EXCLUDED(ofproto_mutex); void fail_open_flushed(struct fail_open *) OVS_EXCLUDED(ofproto_mutex); +int fail_open_count_rules(const struct fail_open *); + #endif /* fail-open.h */ diff -Nru openvswitch-2.3.1/ofproto/.gitignore openvswitch-2.4.0~git20150623/ofproto/.gitignore --- openvswitch-2.3.1/ofproto/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,4 @@ +/Makefile +/Makefile.in +/ipfix-entities.def +/libofproto.pc diff -Nru openvswitch-2.3.1/ofproto/in-band.c openvswitch-2.4.0~git20150623/ofproto/in-band.c --- openvswitch-2.3.1/ofproto/in-band.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/in-band.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ #include "packets.h" #include "poll-loop.h" #include "timeval.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(in_band); @@ -83,7 +83,7 @@ struct in_band_rule { struct hmap_node hmap_node; /* In struct in_band's "rules" hmap. */ struct match match; - unsigned int priority; + int priority; enum in_band_op op; }; @@ -119,8 +119,8 @@ retval = netdev_get_next_hop(ib->local_netdev, &r->remote_addr.sin_addr, &next_hop_inaddr, &next_hop_dev); if (retval) { - VLOG_WARN("cannot find route for controller ("IP_FMT"): %s", - IP_ARGS(r->remote_addr.sin_addr.s_addr), + VLOG_WARN("%s: cannot find route for controller ("IP_FMT"): %s", + ib->ofproto->name, IP_ARGS(r->remote_addr.sin_addr.s_addr), ovs_strerror(retval)); return 1; } @@ -136,9 +136,10 @@ retval = netdev_open(next_hop_dev, "system", &r->remote_netdev); if (retval) { - VLOG_WARN_RL(&rl, "cannot open netdev %s (next hop " + VLOG_WARN_RL(&rl, "%s: cannot open netdev %s (next hop " "to controller "IP_FMT"): %s", - next_hop_dev, IP_ARGS(r->remote_addr.sin_addr.s_addr), + ib->ofproto->name, next_hop_dev, + IP_ARGS(r->remote_addr.sin_addr.s_addr), ovs_strerror(retval)); free(next_hop_dev); return 1; @@ -150,8 +151,9 @@ retval = netdev_arp_lookup(r->remote_netdev, next_hop_inaddr.s_addr, r->remote_mac); if (retval) { - VLOG_DBG_RL(&rl, "cannot look up remote MAC address ("IP_FMT"): %s", - IP_ARGS(next_hop_inaddr.s_addr), ovs_strerror(retval)); + VLOG_DBG_RL(&rl, "%s: cannot look up remote MAC address ("IP_FMT"): %s", + ib->ofproto->name, IP_ARGS(next_hop_inaddr.s_addr), + ovs_strerror(retval)); } /* If we don't have a MAC address, then refresh quickly, since we probably @@ -188,8 +190,9 @@ any_changes = true; if (!eth_addr_is_zero(r->remote_mac) && !eth_addr_equals(r->last_remote_mac, r->remote_mac)) { - VLOG_DBG("remote MAC address changed from "ETH_ADDR_FMT + VLOG_DBG("%s: remote MAC address changed from "ETH_ADDR_FMT " to "ETH_ADDR_FMT, + ib->ofproto->name, ETH_ADDR_ARGS(r->last_remote_mac), ETH_ADDR_ARGS(r->remote_mac)); memcpy(r->last_remote_mac, r->remote_mac, ETH_ADDR_LEN); @@ -235,8 +238,16 @@ && flow->tp_dst == htons(DHCP_CLIENT_PORT)); } +/* Returns the number of in-band rules currently installed in the flow + * table. */ +int +in_band_count_rules(const struct in_band *ib) +{ + return hmap_count(&ib->rules); +} + static void -add_rule(struct in_band *ib, const struct match *match, unsigned int priority) +add_rule(struct in_band *ib, const struct match *match, int priority) { uint32_t hash = match_hash(match, 0); struct in_band_rule *rule; @@ -382,17 +393,13 @@ switch (rule->op) { case ADD: ofproto_add_flow(ib->ofproto, &rule->match, rule->priority, - ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts)); + ofpacts.data, ofpacts.size); break; case DEL: - if (ofproto_delete_flow(ib->ofproto, - &rule->match, rule->priority)) { - /* ofproto doesn't have the rule anymore so there's no reason - * for us to track it any longer. */ - hmap_remove(&ib->rules, &rule->hmap_node); - free(rule); - } + ofproto_delete_flow(ib->ofproto, &rule->match, rule->priority); + hmap_remove(&ib->rules, &rule->hmap_node); + free(rule); break; } } @@ -421,8 +428,8 @@ *in_bandp = NULL; error = netdev_open(local_name, "internal", &local_netdev); if (error) { - VLOG_ERR("failed to initialize in-band control: cannot open " - "datapath local port %s (%s)", + VLOG_ERR("%s: failed to initialize in-band control: cannot open " + "datapath local port %s (%s)", ofproto->name, local_name, ovs_strerror(error)); return error; } diff -Nru openvswitch-2.3.1/ofproto/in-band.h openvswitch-2.4.0~git20150623/ofproto/in-band.h --- openvswitch-2.3.1/ofproto/in-band.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/in-band.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,4 +42,6 @@ bool in_band_must_output_to_local_port(const struct flow *); +int in_band_count_rules(const struct in_band *); + #endif /* in-band.h */ diff -Nru openvswitch-2.3.1/ofproto/ipfix-enterprise-entities.def openvswitch-2.4.0~git20150623/ofproto/ipfix-enterprise-entities.def --- openvswitch-2.3.1/ofproto/ipfix-enterprise-entities.def 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ipfix-enterprise-entities.def 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,16 @@ +/* IPFIX enterprise entities. */ +#ifndef IPFIX_ENTERPRISE_ENTITY +#define IPFIX_ENTERPRISE_ENTITY(ENUM, ID, SIZE, NAME, ENTERPRISE) +#endif + +#define IPFIX_ENTERPRISE_VMWARE 6876 + +IPFIX_ENTERPRISE_ENTITY(TUNNEL_TYPE, 891, 1, tunnelType, IPFIX_ENTERPRISE_VMWARE) +IPFIX_ENTERPRISE_ENTITY(TUNNEL_KEY, 892, 0, tunnelKey, IPFIX_ENTERPRISE_VMWARE) +IPFIX_ENTERPRISE_ENTITY(TUNNEL_SOURCE_IPV4_ADDRESS, 893, 4, tunnelSourceIPv4Address, IPFIX_ENTERPRISE_VMWARE) +IPFIX_ENTERPRISE_ENTITY(TUNNEL_DESTINATION_IPV4_ADDRESS, 894, 4, tunnelDestinationIPv4Address, IPFIX_ENTERPRISE_VMWARE) +IPFIX_ENTERPRISE_ENTITY(TUNNEL_PROTOCOL_IDENTIFIER, 895, 1, tunnelProtocolIdentifier, IPFIX_ENTERPRISE_VMWARE) +IPFIX_ENTERPRISE_ENTITY(TUNNEL_SOURCE_TRANSPORT_PORT, 896, 2, tunnelSourceTransportPort, IPFIX_ENTERPRISE_VMWARE) +IPFIX_ENTERPRISE_ENTITY(TUNNEL_DESTINATION_TRANSPORT_PORT, 897, 2, tunnelDestinationTransportPort, IPFIX_ENTERPRISE_VMWARE) + +#undef IPFIX_ENTERPRISE_ENTITY diff -Nru openvswitch-2.3.1/ofproto/ipfix-entities.def openvswitch-2.4.0~git20150623/ofproto/ipfix-entities.def --- openvswitch-2.3.1/ofproto/ipfix-entities.def 2014-11-29 19:16:21.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ipfix-entities.def 1970-01-01 00:00:00.000000000 +0000 @@ -1,347 +0,0 @@ -/* IPFIX entities. */ -#ifndef IPFIX_ENTITY -#define IPFIX_ENTITY(ENUM, ID, SIZE, NAME) -#endif - -IPFIX_ENTITY(OCTET_DELTA_COUNT, 1, 8, octetDeltaCount) -IPFIX_ENTITY(PACKET_DELTA_COUNT, 2, 8, packetDeltaCount) -IPFIX_ENTITY(DELTA_FLOW_COUNT, 3, 8, deltaFlowCount) -IPFIX_ENTITY(PROTOCOL_IDENTIFIER, 4, 1, protocolIdentifier) -IPFIX_ENTITY(IP_CLASS_OF_SERVICE, 5, 1, ipClassOfService) -IPFIX_ENTITY(TCP_CONTROL_BITS, 6, 1, tcpControlBits) -IPFIX_ENTITY(SOURCE_TRANSPORT_PORT, 7, 2, sourceTransportPort) -IPFIX_ENTITY(SOURCE_IPV4_ADDRESS, 8, 4, sourceIPv4Address) -IPFIX_ENTITY(SOURCE_IPV4_PREFIX_LENGTH, 9, 1, sourceIPv4PrefixLength) -IPFIX_ENTITY(INGRESS_INTERFACE, 10, 4, ingressInterface) -IPFIX_ENTITY(DESTINATION_TRANSPORT_PORT, 11, 2, destinationTransportPort) -IPFIX_ENTITY(DESTINATION_IPV4_ADDRESS, 12, 4, destinationIPv4Address) -IPFIX_ENTITY(DESTINATION_IPV4_PREFIX_LENGTH, 13, 1, destinationIPv4PrefixLength) -IPFIX_ENTITY(EGRESS_INTERFACE, 14, 4, egressInterface) -IPFIX_ENTITY(IP_NEXT_HOP_IPV4_ADDRESS, 15, 4, ipNextHopIPv4Address) -IPFIX_ENTITY(BGP_SOURCE_AS_NUMBER, 16, 4, bgpSourceAsNumber) -IPFIX_ENTITY(BGP_DESTINATION_AS_NUMBER, 17, 4, bgpDestinationAsNumber) -IPFIX_ENTITY(BGP_NEXT_HOP_IPV4_ADDRESS, 18, 4, bgpNextHopIPv4Address) -IPFIX_ENTITY(POST_MCAST_PACKET_DELTA_COUNT, 19, 8, postMCastPacketDeltaCount) -IPFIX_ENTITY(POST_MCAST_OCTET_DELTA_COUNT, 20, 8, postMCastOctetDeltaCount) -IPFIX_ENTITY(FLOW_END_SYS_UP_TIME, 21, 4, flowEndSysUpTime) -IPFIX_ENTITY(FLOW_START_SYS_UP_TIME, 22, 4, flowStartSysUpTime) -IPFIX_ENTITY(POST_OCTET_DELTA_COUNT, 23, 8, postOctetDeltaCount) -IPFIX_ENTITY(POST_PACKET_DELTA_COUNT, 24, 8, postPacketDeltaCount) -IPFIX_ENTITY(MINIMUM_IP_TOTAL_LENGTH, 25, 8, minimumIpTotalLength) -IPFIX_ENTITY(MAXIMUM_IP_TOTAL_LENGTH, 26, 8, maximumIpTotalLength) -IPFIX_ENTITY(SOURCE_IPV6_ADDRESS, 27, 16, sourceIPv6Address) -IPFIX_ENTITY(DESTINATION_IPV6_ADDRESS, 28, 16, destinationIPv6Address) -IPFIX_ENTITY(SOURCE_IPV6_PREFIX_LENGTH, 29, 1, sourceIPv6PrefixLength) -IPFIX_ENTITY(DESTINATION_IPV6_PREFIX_LENGTH, 30, 1, destinationIPv6PrefixLength) -IPFIX_ENTITY(FLOW_LABEL_IPV6, 31, 4, flowLabelIPv6) -IPFIX_ENTITY(ICMP_TYPE_CODE_IPV4, 32, 2, icmpTypeCodeIPv4) -IPFIX_ENTITY(IGMP_TYPE, 33, 1, igmpType) -IPFIX_ENTITY(FLOW_ACTIVE_TIMEOUT, 36, 2, flowActiveTimeout) -IPFIX_ENTITY(FLOW_IDLE_TIMEOUT, 37, 2, flowIdleTimeout) -IPFIX_ENTITY(EXPORTED_OCTET_TOTAL_COUNT, 40, 8, exportedOctetTotalCount) -IPFIX_ENTITY(EXPORTED_MESSAGE_TOTAL_COUNT, 41, 8, exportedMessageTotalCount) -IPFIX_ENTITY(EXPORTED_FLOW_RECORD_TOTAL_COUNT, 42, 8, exportedFlowRecordTotalCount) -IPFIX_ENTITY(SOURCE_IPV4_PREFIX, 44, 4, sourceIPv4Prefix) -IPFIX_ENTITY(DESTINATION_IPV4_PREFIX, 45, 4, destinationIPv4Prefix) -IPFIX_ENTITY(MPLS_TOP_LABEL_TYPE, 46, 1, mplsTopLabelType) -IPFIX_ENTITY(MPLS_TOP_LABEL_IPV4_ADDRESS, 47, 4, mplsTopLabelIPv4Address) -IPFIX_ENTITY(MINIMUM_TTL, 52, 1, minimumTTL) -IPFIX_ENTITY(MAXIMUM_TTL, 53, 1, maximumTTL) -IPFIX_ENTITY(FRAGMENT_IDENTIFICATION, 54, 4, fragmentIdentification) -IPFIX_ENTITY(POST_IP_CLASS_OF_SERVICE, 55, 1, postIpClassOfService) -IPFIX_ENTITY(SOURCE_MAC_ADDRESS, 56, 6, sourceMacAddress) -IPFIX_ENTITY(POST_DESTINATION_MAC_ADDRESS, 57, 6, postDestinationMacAddress) -IPFIX_ENTITY(VLAN_ID, 58, 2, vlanId) -IPFIX_ENTITY(POST_VLAN_ID, 59, 2, postVlanId) -IPFIX_ENTITY(IP_VERSION, 60, 1, ipVersion) -IPFIX_ENTITY(FLOW_DIRECTION, 61, 1, flowDirection) -IPFIX_ENTITY(IP_NEXT_HOP_IPV6_ADDRESS, 62, 16, ipNextHopIPv6Address) -IPFIX_ENTITY(BGP_NEXT_HOP_IPV6_ADDRESS, 63, 16, bgpNextHopIPv6Address) -IPFIX_ENTITY(IPV6_EXTENSION_HEADERS, 64, 4, ipv6ExtensionHeaders) -IPFIX_ENTITY(MPLS_TOP_LABEL_STACK_SECTION, 70, 0, mplsTopLabelStackSection) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION2, 71, 0, mplsLabelStackSection2) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION3, 72, 0, mplsLabelStackSection3) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION4, 73, 0, mplsLabelStackSection4) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION5, 74, 0, mplsLabelStackSection5) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION6, 75, 0, mplsLabelStackSection6) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION7, 76, 0, mplsLabelStackSection7) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION8, 77, 0, mplsLabelStackSection8) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION9, 78, 0, mplsLabelStackSection9) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION10, 79, 0, mplsLabelStackSection10) -IPFIX_ENTITY(DESTINATION_MAC_ADDRESS, 80, 6, destinationMacAddress) -IPFIX_ENTITY(POST_SOURCE_MAC_ADDRESS, 81, 6, postSourceMacAddress) -IPFIX_ENTITY(INTERFACE_NAME, 82, 0, interfaceName) -IPFIX_ENTITY(INTERFACE_DESCRIPTION, 83, 0, interfaceDescription) -IPFIX_ENTITY(OCTET_TOTAL_COUNT, 85, 8, octetTotalCount) -IPFIX_ENTITY(PACKET_TOTAL_COUNT, 86, 8, packetTotalCount) -IPFIX_ENTITY(FRAGMENT_OFFSET, 88, 2, fragmentOffset) -IPFIX_ENTITY(MPLS_VPN_ROUTE_DISTINGUISHER, 90, 0, mplsVpnRouteDistinguisher) -IPFIX_ENTITY(MPLS_TOP_LABEL_PREFIX_LENGTH, 91, 1, mplsTopLabelPrefixLength) -IPFIX_ENTITY(APPLICATION_DESCRIPTION, 94, 0, applicationDescription) -IPFIX_ENTITY(APPLICATION_ID, 95, 0, applicationId) -IPFIX_ENTITY(APPLICATION_NAME, 96, 0, applicationName) -IPFIX_ENTITY(POST_IP_DIFF_SERV_CODE_POINT, 98, 1, postIpDiffServCodePoint) -IPFIX_ENTITY(MULTICAST_REPLICATION_FACTOR, 99, 4, multicastReplicationFactor) -IPFIX_ENTITY(CLASSIFICATION_ENGINE_ID, 101, 1, classificationEngineId) -IPFIX_ENTITY(BGP_NEXT_ADJACENT_AS_NUMBER, 128, 4, bgpNextAdjacentAsNumber) -IPFIX_ENTITY(BGP_PREV_ADJACENT_AS_NUMBER, 129, 4, bgpPrevAdjacentAsNumber) -IPFIX_ENTITY(EXPORTER_IPV4_ADDRESS, 130, 4, exporterIPv4Address) -IPFIX_ENTITY(EXPORTER_IPV6_ADDRESS, 131, 16, exporterIPv6Address) -IPFIX_ENTITY(DROPPED_OCTET_DELTA_COUNT, 132, 8, droppedOctetDeltaCount) -IPFIX_ENTITY(DROPPED_PACKET_DELTA_COUNT, 133, 8, droppedPacketDeltaCount) -IPFIX_ENTITY(DROPPED_OCTET_TOTAL_COUNT, 134, 8, droppedOctetTotalCount) -IPFIX_ENTITY(DROPPED_PACKET_TOTAL_COUNT, 135, 8, droppedPacketTotalCount) -IPFIX_ENTITY(FLOW_END_REASON, 136, 1, flowEndReason) -IPFIX_ENTITY(COMMON_PROPERTIES_ID, 137, 8, commonPropertiesId) -IPFIX_ENTITY(OBSERVATION_POINT_ID, 138, 4, observationPointId) -IPFIX_ENTITY(ICMP_TYPE_CODE_IPV6, 139, 2, icmpTypeCodeIPv6) -IPFIX_ENTITY(MPLS_TOP_LABEL_IPV6_ADDRESS, 140, 16, mplsTopLabelIPv6Address) -IPFIX_ENTITY(LINE_CARD_ID, 141, 4, lineCardId) -IPFIX_ENTITY(PORT_ID, 142, 4, portId) -IPFIX_ENTITY(METERING_PROCESS_ID, 143, 4, meteringProcessId) -IPFIX_ENTITY(EXPORTING_PROCESS_ID, 144, 4, exportingProcessId) -IPFIX_ENTITY(TEMPLATE_ID, 145, 2, templateId) -IPFIX_ENTITY(WLAN_CHANNEL_ID, 146, 1, wlanChannelId) -IPFIX_ENTITY(WLAN_SSID, 147, 0, wlanSSID) -IPFIX_ENTITY(FLOW_ID, 148, 8, flowId) -IPFIX_ENTITY(OBSERVATION_DOMAIN_ID, 149, 4, observationDomainId) -IPFIX_ENTITY(FLOW_START_SECONDS, 150, 4, flowStartSeconds) -IPFIX_ENTITY(FLOW_END_SECONDS, 151, 4, flowEndSeconds) -IPFIX_ENTITY(FLOW_START_MILLISECONDS, 152, 8, flowStartMilliseconds) -IPFIX_ENTITY(FLOW_END_MILLISECONDS, 153, 8, flowEndMilliseconds) -IPFIX_ENTITY(FLOW_START_MICROSECONDS, 154, 8, flowStartMicroseconds) -IPFIX_ENTITY(FLOW_END_MICROSECONDS, 155, 8, flowEndMicroseconds) -IPFIX_ENTITY(FLOW_START_NANOSECONDS, 156, 8, flowStartNanoseconds) -IPFIX_ENTITY(FLOW_END_NANOSECONDS, 157, 8, flowEndNanoseconds) -IPFIX_ENTITY(FLOW_START_DELTA_MICROSECONDS, 158, 4, flowStartDeltaMicroseconds) -IPFIX_ENTITY(FLOW_END_DELTA_MICROSECONDS, 159, 4, flowEndDeltaMicroseconds) -IPFIX_ENTITY(SYSTEM_INIT_TIME_MILLISECONDS, 160, 8, systemInitTimeMilliseconds) -IPFIX_ENTITY(FLOW_DURATION_MILLISECONDS, 161, 4, flowDurationMilliseconds) -IPFIX_ENTITY(FLOW_DURATION_MICROSECONDS, 162, 4, flowDurationMicroseconds) -IPFIX_ENTITY(OBSERVED_FLOW_TOTAL_COUNT, 163, 8, observedFlowTotalCount) -IPFIX_ENTITY(IGNORED_PACKET_TOTAL_COUNT, 164, 8, ignoredPacketTotalCount) -IPFIX_ENTITY(IGNORED_OCTET_TOTAL_COUNT, 165, 8, ignoredOctetTotalCount) -IPFIX_ENTITY(NOT_SENT_FLOW_TOTAL_COUNT, 166, 8, notSentFlowTotalCount) -IPFIX_ENTITY(NOT_SENT_PACKET_TOTAL_COUNT, 167, 8, notSentPacketTotalCount) -IPFIX_ENTITY(NOT_SENT_OCTET_TOTAL_COUNT, 168, 8, notSentOctetTotalCount) -IPFIX_ENTITY(DESTINATION_IPV6_PREFIX, 169, 16, destinationIPv6Prefix) -IPFIX_ENTITY(SOURCE_IPV6_PREFIX, 170, 16, sourceIPv6Prefix) -IPFIX_ENTITY(POST_OCTET_TOTAL_COUNT, 171, 8, postOctetTotalCount) -IPFIX_ENTITY(POST_PACKET_TOTAL_COUNT, 172, 8, postPacketTotalCount) -IPFIX_ENTITY(FLOW_KEY_INDICATOR, 173, 8, flowKeyIndicator) -IPFIX_ENTITY(POST_MCAST_PACKET_TOTAL_COUNT, 174, 8, postMCastPacketTotalCount) -IPFIX_ENTITY(POST_MCAST_OCTET_TOTAL_COUNT, 175, 8, postMCastOctetTotalCount) -IPFIX_ENTITY(ICMP_TYPE_IPV4, 176, 1, icmpTypeIPv4) -IPFIX_ENTITY(ICMP_CODE_IPV4, 177, 1, icmpCodeIPv4) -IPFIX_ENTITY(ICMP_TYPE_IPV6, 178, 1, icmpTypeIPv6) -IPFIX_ENTITY(ICMP_CODE_IPV6, 179, 1, icmpCodeIPv6) -IPFIX_ENTITY(UDP_SOURCE_PORT, 180, 2, udpSourcePort) -IPFIX_ENTITY(UDP_DESTINATION_PORT, 181, 2, udpDestinationPort) -IPFIX_ENTITY(TCP_SOURCE_PORT, 182, 2, tcpSourcePort) -IPFIX_ENTITY(TCP_DESTINATION_PORT, 183, 2, tcpDestinationPort) -IPFIX_ENTITY(TCP_SEQUENCE_NUMBER, 184, 4, tcpSequenceNumber) -IPFIX_ENTITY(TCP_ACKNOWLEDGEMENT_NUMBER, 185, 4, tcpAcknowledgementNumber) -IPFIX_ENTITY(TCP_WINDOW_SIZE, 186, 2, tcpWindowSize) -IPFIX_ENTITY(TCP_URGENT_POINTER, 187, 2, tcpUrgentPointer) -IPFIX_ENTITY(TCP_HEADER_LENGTH, 188, 1, tcpHeaderLength) -IPFIX_ENTITY(IP_HEADER_LENGTH, 189, 1, ipHeaderLength) -IPFIX_ENTITY(TOTAL_LENGTH_IPV4, 190, 2, totalLengthIPv4) -IPFIX_ENTITY(PAYLOAD_LENGTH_IPV6, 191, 2, payloadLengthIPv6) -IPFIX_ENTITY(IP_TTL, 192, 1, ipTTL) -IPFIX_ENTITY(NEXT_HEADER_IPV6, 193, 1, nextHeaderIPv6) -IPFIX_ENTITY(MPLS_PAYLOAD_LENGTH, 194, 4, mplsPayloadLength) -IPFIX_ENTITY(IP_DIFF_SERV_CODE_POINT, 195, 1, ipDiffServCodePoint) -IPFIX_ENTITY(IP_PRECEDENCE, 196, 1, ipPrecedence) -IPFIX_ENTITY(FRAGMENT_FLAGS, 197, 1, fragmentFlags) -IPFIX_ENTITY(OCTET_DELTA_SUM_OF_SQUARES, 198, 8, octetDeltaSumOfSquares) -IPFIX_ENTITY(OCTET_TOTAL_SUM_OF_SQUARES, 199, 8, octetTotalSumOfSquares) -IPFIX_ENTITY(MPLS_TOP_LABEL_TTL, 200, 1, mplsTopLabelTTL) -IPFIX_ENTITY(MPLS_LABEL_STACK_LENGTH, 201, 4, mplsLabelStackLength) -IPFIX_ENTITY(MPLS_LABEL_STACK_DEPTH, 202, 4, mplsLabelStackDepth) -IPFIX_ENTITY(MPLS_TOP_LABEL_EXP, 203, 1, mplsTopLabelExp) -IPFIX_ENTITY(IP_PAYLOAD_LENGTH, 204, 4, ipPayloadLength) -IPFIX_ENTITY(UDP_MESSAGE_LENGTH, 205, 2, udpMessageLength) -IPFIX_ENTITY(IS_MULTICAST, 206, 1, isMulticast) -IPFIX_ENTITY(IPV4_IHL, 207, 1, ipv4IHL) -IPFIX_ENTITY(IPV4_OPTIONS, 208, 4, ipv4Options) -IPFIX_ENTITY(TCP_OPTIONS, 209, 8, tcpOptions) -IPFIX_ENTITY(PADDING_OCTETS, 210, 0, paddingOctets) -IPFIX_ENTITY(COLLECTOR_IPV4_ADDRESS, 211, 4, collectorIPv4Address) -IPFIX_ENTITY(COLLECTOR_IPV6_ADDRESS, 212, 16, collectorIPv6Address) -IPFIX_ENTITY(EXPORT_INTERFACE, 213, 4, exportInterface) -IPFIX_ENTITY(EXPORT_PROTOCOL_VERSION, 214, 1, exportProtocolVersion) -IPFIX_ENTITY(EXPORT_TRANSPORT_PROTOCOL, 215, 1, exportTransportProtocol) -IPFIX_ENTITY(COLLECTOR_TRANSPORT_PORT, 216, 2, collectorTransportPort) -IPFIX_ENTITY(EXPORTER_TRANSPORT_PORT, 217, 2, exporterTransportPort) -IPFIX_ENTITY(TCP_SYN_TOTAL_COUNT, 218, 8, tcpSynTotalCount) -IPFIX_ENTITY(TCP_FIN_TOTAL_COUNT, 219, 8, tcpFinTotalCount) -IPFIX_ENTITY(TCP_RST_TOTAL_COUNT, 220, 8, tcpRstTotalCount) -IPFIX_ENTITY(TCP_PSH_TOTAL_COUNT, 221, 8, tcpPshTotalCount) -IPFIX_ENTITY(TCP_ACK_TOTAL_COUNT, 222, 8, tcpAckTotalCount) -IPFIX_ENTITY(TCP_URG_TOTAL_COUNT, 223, 8, tcpUrgTotalCount) -IPFIX_ENTITY(IP_TOTAL_LENGTH, 224, 8, ipTotalLength) -IPFIX_ENTITY(POST_NATSOURCE_IPV4_ADDRESS, 225, 4, postNATSourceIPv4Address) -IPFIX_ENTITY(POST_NATDESTINATION_IPV4_ADDRESS, 226, 4, postNATDestinationIPv4Address) -IPFIX_ENTITY(POST_NAPTSOURCE_TRANSPORT_PORT, 227, 2, postNAPTSourceTransportPort) -IPFIX_ENTITY(POST_NAPTDESTINATION_TRANSPORT_PORT, 228, 2, postNAPTDestinationTransportPort) -IPFIX_ENTITY(NAT_ORIGINATING_ADDRESS_REALM, 229, 1, natOriginatingAddressRealm) -IPFIX_ENTITY(NAT_EVENT, 230, 1, natEvent) -IPFIX_ENTITY(INITIATOR_OCTETS, 231, 8, initiatorOctets) -IPFIX_ENTITY(RESPONDER_OCTETS, 232, 8, responderOctets) -IPFIX_ENTITY(FIREWALL_EVENT, 233, 1, firewallEvent) -IPFIX_ENTITY(INGRESS_VRFID, 234, 4, ingressVRFID) -IPFIX_ENTITY(EGRESS_VRFID, 235, 4, egressVRFID) -IPFIX_ENTITY(V_RFNAME, 236, 0, VRFname) -IPFIX_ENTITY(POST_MPLS_TOP_LABEL_EXP, 237, 1, postMplsTopLabelExp) -IPFIX_ENTITY(TCP_WINDOW_SCALE, 238, 2, tcpWindowScale) -IPFIX_ENTITY(BIFLOW_DIRECTION, 239, 1, biflowDirection) -IPFIX_ENTITY(ETHERNET_HEADER_LENGTH, 240, 1, ethernetHeaderLength) -IPFIX_ENTITY(ETHERNET_PAYLOAD_LENGTH, 241, 2, ethernetPayloadLength) -IPFIX_ENTITY(ETHERNET_TOTAL_LENGTH, 242, 2, ethernetTotalLength) -IPFIX_ENTITY(DOT1Q_VLAN_ID, 243, 2, dot1qVlanId) -IPFIX_ENTITY(DOT1Q_PRIORITY, 244, 1, dot1qPriority) -IPFIX_ENTITY(DOT1Q_CUSTOMER_VLAN_ID, 245, 2, dot1qCustomerVlanId) -IPFIX_ENTITY(DOT1Q_CUSTOMER_PRIORITY, 246, 1, dot1qCustomerPriority) -IPFIX_ENTITY(METRO_EVC_ID, 247, 0, metroEvcId) -IPFIX_ENTITY(METRO_EVC_TYPE, 248, 1, metroEvcType) -IPFIX_ENTITY(PSEUDO_WIRE_ID, 249, 4, pseudoWireId) -IPFIX_ENTITY(PSEUDO_WIRE_TYPE, 250, 2, pseudoWireType) -IPFIX_ENTITY(PSEUDO_WIRE_CONTROL_WORD, 251, 4, pseudoWireControlWord) -IPFIX_ENTITY(INGRESS_PHYSICAL_INTERFACE, 252, 4, ingressPhysicalInterface) -IPFIX_ENTITY(EGRESS_PHYSICAL_INTERFACE, 253, 4, egressPhysicalInterface) -IPFIX_ENTITY(POST_DOT1Q_VLAN_ID, 254, 2, postDot1qVlanId) -IPFIX_ENTITY(POST_DOT1Q_CUSTOMER_VLAN_ID, 255, 2, postDot1qCustomerVlanId) -IPFIX_ENTITY(ETHERNET_TYPE, 256, 2, ethernetType) -IPFIX_ENTITY(POST_IP_PRECEDENCE, 257, 1, postIpPrecedence) -IPFIX_ENTITY(COLLECTION_TIME_MILLISECONDS, 258, 8, collectionTimeMilliseconds) -IPFIX_ENTITY(EXPORT_SCTP_STREAM_ID, 259, 2, exportSctpStreamId) -IPFIX_ENTITY(MAX_EXPORT_SECONDS, 260, 4, maxExportSeconds) -IPFIX_ENTITY(MAX_FLOW_END_SECONDS, 261, 4, maxFlowEndSeconds) -IPFIX_ENTITY(MESSAGE_MD5_CHECKSUM, 262, 0, messageMD5Checksum) -IPFIX_ENTITY(MESSAGE_SCOPE, 263, 1, messageScope) -IPFIX_ENTITY(MIN_EXPORT_SECONDS, 264, 4, minExportSeconds) -IPFIX_ENTITY(MIN_FLOW_START_SECONDS, 265, 4, minFlowStartSeconds) -IPFIX_ENTITY(OPAQUE_OCTETS, 266, 0, opaqueOctets) -IPFIX_ENTITY(SESSION_SCOPE, 267, 1, sessionScope) -IPFIX_ENTITY(MAX_FLOW_END_MICROSECONDS, 268, 8, maxFlowEndMicroseconds) -IPFIX_ENTITY(MAX_FLOW_END_MILLISECONDS, 269, 8, maxFlowEndMilliseconds) -IPFIX_ENTITY(MAX_FLOW_END_NANOSECONDS, 270, 8, maxFlowEndNanoseconds) -IPFIX_ENTITY(MIN_FLOW_START_MICROSECONDS, 271, 8, minFlowStartMicroseconds) -IPFIX_ENTITY(MIN_FLOW_START_MILLISECONDS, 272, 8, minFlowStartMilliseconds) -IPFIX_ENTITY(MIN_FLOW_START_NANOSECONDS, 273, 8, minFlowStartNanoseconds) -IPFIX_ENTITY(COLLECTOR_CERTIFICATE, 274, 0, collectorCertificate) -IPFIX_ENTITY(EXPORTER_CERTIFICATE, 275, 0, exporterCertificate) -IPFIX_ENTITY(DATA_RECORDS_RELIABILITY, 276, 1, dataRecordsReliability) -IPFIX_ENTITY(OBSERVATION_POINT_TYPE, 277, 1, observationPointType) -IPFIX_ENTITY(CONNECTION_COUNT_NEW, 278, 4, connectionCountNew) -IPFIX_ENTITY(CONNECTION_SUM_DURATION, 279, 8, connectionSumDuration) -IPFIX_ENTITY(CONNECTION_TRANSACTION_ID, 280, 8, connectionTransactionId) -IPFIX_ENTITY(POST_NATSOURCE_IPV6_ADDRESS, 281, 16, postNATSourceIPv6Address) -IPFIX_ENTITY(POST_NATDESTINATION_IPV6_ADDRESS, 282, 16, postNATDestinationIPv6Address) -IPFIX_ENTITY(NAT_POOL_ID, 283, 4, natPoolId) -IPFIX_ENTITY(NAT_POOL_NAME, 284, 0, natPoolName) -IPFIX_ENTITY(ANONYMIZATION_FLAGS, 285, 2, anonymizationFlags) -IPFIX_ENTITY(ANONYMIZATION_TECHNIQUE, 286, 2, anonymizationTechnique) -IPFIX_ENTITY(INFORMATION_ELEMENT_INDEX, 287, 2, informationElementIndex) -IPFIX_ENTITY(P2P_TECHNOLOGY, 288, 0, p2pTechnology) -IPFIX_ENTITY(TUNNEL_TECHNOLOGY, 289, 0, tunnelTechnology) -IPFIX_ENTITY(ENCRYPTED_TECHNOLOGY, 290, 0, encryptedTechnology) -IPFIX_ENTITY(BASIC_LIST, 291, 0, basicList) -IPFIX_ENTITY(SUB_TEMPLATE_LIST, 292, 0, subTemplateList) -IPFIX_ENTITY(SUB_TEMPLATE_MULTI_LIST, 293, 0, subTemplateMultiList) -IPFIX_ENTITY(BGP_VALIDITY_STATE, 294, 1, bgpValidityState) -IPFIX_ENTITY(I_PSEC_SPI, 295, 4, IPSecSPI) -IPFIX_ENTITY(GRE_KEY, 296, 4, greKey) -IPFIX_ENTITY(NAT_TYPE, 297, 1, natType) -IPFIX_ENTITY(INITIATOR_PACKETS, 298, 8, initiatorPackets) -IPFIX_ENTITY(RESPONDER_PACKETS, 299, 8, responderPackets) -IPFIX_ENTITY(OBSERVATION_DOMAIN_NAME, 300, 0, observationDomainName) -IPFIX_ENTITY(SELECTION_SEQUENCE_ID, 301, 8, selectionSequenceId) -IPFIX_ENTITY(SELECTOR_ID, 302, 8, selectorId) -IPFIX_ENTITY(INFORMATION_ELEMENT_ID, 303, 2, informationElementId) -IPFIX_ENTITY(SELECTOR_ALGORITHM, 304, 2, selectorAlgorithm) -IPFIX_ENTITY(SAMPLING_PACKET_INTERVAL, 305, 4, samplingPacketInterval) -IPFIX_ENTITY(SAMPLING_PACKET_SPACE, 306, 4, samplingPacketSpace) -IPFIX_ENTITY(SAMPLING_TIME_INTERVAL, 307, 4, samplingTimeInterval) -IPFIX_ENTITY(SAMPLING_TIME_SPACE, 308, 4, samplingTimeSpace) -IPFIX_ENTITY(SAMPLING_SIZE, 309, 4, samplingSize) -IPFIX_ENTITY(SAMPLING_POPULATION, 310, 4, samplingPopulation) -IPFIX_ENTITY(SAMPLING_PROBABILITY, 311, 8, samplingProbability) -IPFIX_ENTITY(DATA_LINK_FRAME_SIZE, 312, 2, dataLinkFrameSize) -IPFIX_ENTITY(IP_HEADER_PACKET_SECTION, 313, 0, ipHeaderPacketSection) -IPFIX_ENTITY(IP_PAYLOAD_PACKET_SECTION, 314, 0, ipPayloadPacketSection) -IPFIX_ENTITY(DATA_LINK_FRAME_SECTION, 315, 0, dataLinkFrameSection) -IPFIX_ENTITY(MPLS_LABEL_STACK_SECTION, 316, 0, mplsLabelStackSection) -IPFIX_ENTITY(MPLS_PAYLOAD_PACKET_SECTION, 317, 0, mplsPayloadPacketSection) -IPFIX_ENTITY(SELECTOR_ID_TOTAL_PKTS_OBSERVED, 318, 8, selectorIdTotalPktsObserved) -IPFIX_ENTITY(SELECTOR_ID_TOTAL_PKTS_SELECTED, 319, 8, selectorIdTotalPktsSelected) -IPFIX_ENTITY(ABSOLUTE_ERROR, 320, 8, absoluteError) -IPFIX_ENTITY(RELATIVE_ERROR, 321, 8, relativeError) -IPFIX_ENTITY(OBSERVATION_TIME_SECONDS, 322, 4, observationTimeSeconds) -IPFIX_ENTITY(OBSERVATION_TIME_MILLISECONDS, 323, 8, observationTimeMilliseconds) -IPFIX_ENTITY(OBSERVATION_TIME_MICROSECONDS, 324, 8, observationTimeMicroseconds) -IPFIX_ENTITY(OBSERVATION_TIME_NANOSECONDS, 325, 8, observationTimeNanoseconds) -IPFIX_ENTITY(DIGEST_HASH_VALUE, 326, 8, digestHashValue) -IPFIX_ENTITY(HASH_IPPAYLOAD_OFFSET, 327, 8, hashIPPayloadOffset) -IPFIX_ENTITY(HASH_IPPAYLOAD_SIZE, 328, 8, hashIPPayloadSize) -IPFIX_ENTITY(HASH_OUTPUT_RANGE_MIN, 329, 8, hashOutputRangeMin) -IPFIX_ENTITY(HASH_OUTPUT_RANGE_MAX, 330, 8, hashOutputRangeMax) -IPFIX_ENTITY(HASH_SELECTED_RANGE_MIN, 331, 8, hashSelectedRangeMin) -IPFIX_ENTITY(HASH_SELECTED_RANGE_MAX, 332, 8, hashSelectedRangeMax) -IPFIX_ENTITY(HASH_DIGEST_OUTPUT, 333, 1, hashDigestOutput) -IPFIX_ENTITY(HASH_INITIALISER_VALUE, 334, 8, hashInitialiserValue) -IPFIX_ENTITY(SELECTOR_NAME, 335, 0, selectorName) -IPFIX_ENTITY(UPPER_CILIMIT, 336, 8, upperCILimit) -IPFIX_ENTITY(LOWER_CILIMIT, 337, 8, lowerCILimit) -IPFIX_ENTITY(CONFIDENCE_LEVEL, 338, 8, confidenceLevel) -IPFIX_ENTITY(INFORMATION_ELEMENT_DATA_TYPE, 339, 1, informationElementDataType) -IPFIX_ENTITY(INFORMATION_ELEMENT_DESCRIPTION, 340, 0, informationElementDescription) -IPFIX_ENTITY(INFORMATION_ELEMENT_NAME, 341, 0, informationElementName) -IPFIX_ENTITY(INFORMATION_ELEMENT_RANGE_BEGIN, 342, 8, informationElementRangeBegin) -IPFIX_ENTITY(INFORMATION_ELEMENT_RANGE_END, 343, 8, informationElementRangeEnd) -IPFIX_ENTITY(INFORMATION_ELEMENT_SEMANTICS, 344, 1, informationElementSemantics) -IPFIX_ENTITY(INFORMATION_ELEMENT_UNITS, 345, 2, informationElementUnits) -IPFIX_ENTITY(PRIVATE_ENTERPRISE_NUMBER, 346, 4, privateEnterpriseNumber) -IPFIX_ENTITY(VIRTUAL_STATION_INTERFACE_ID, 347, 0, virtualStationInterfaceId) -IPFIX_ENTITY(VIRTUAL_STATION_INTERFACE_NAME, 348, 0, virtualStationInterfaceName) -IPFIX_ENTITY(VIRTUAL_STATION_UUID, 349, 0, virtualStationUUID) -IPFIX_ENTITY(VIRTUAL_STATION_NAME, 350, 0, virtualStationName) -IPFIX_ENTITY(LAYER2_SEGMENT_ID, 351, 8, layer2SegmentId) -IPFIX_ENTITY(LAYER2_OCTET_DELTA_COUNT, 352, 8, layer2OctetDeltaCount) -IPFIX_ENTITY(LAYER2_OCTET_TOTAL_COUNT, 353, 8, layer2OctetTotalCount) -IPFIX_ENTITY(INGRESS_UNICAST_PACKET_TOTAL_COUNT, 354, 8, ingressUnicastPacketTotalCount) -IPFIX_ENTITY(INGRESS_MULTICAST_PACKET_TOTAL_COUNT, 355, 8, ingressMulticastPacketTotalCount) -IPFIX_ENTITY(INGRESS_BROADCAST_PACKET_TOTAL_COUNT, 356, 8, ingressBroadcastPacketTotalCount) -IPFIX_ENTITY(EGRESS_UNICAST_PACKET_TOTAL_COUNT, 357, 8, egressUnicastPacketTotalCount) -IPFIX_ENTITY(EGRESS_BROADCAST_PACKET_TOTAL_COUNT, 358, 8, egressBroadcastPacketTotalCount) -IPFIX_ENTITY(MONITORING_INTERVAL_START_MILLI_SECONDS, 359, 8, monitoringIntervalStartMilliSeconds) -IPFIX_ENTITY(MONITORING_INTERVAL_END_MILLI_SECONDS, 360, 8, monitoringIntervalEndMilliSeconds) -IPFIX_ENTITY(PORT_RANGE_START, 361, 2, portRangeStart) -IPFIX_ENTITY(PORT_RANGE_END, 362, 2, portRangeEnd) -IPFIX_ENTITY(PORT_RANGE_STEP_SIZE, 363, 2, portRangeStepSize) -IPFIX_ENTITY(PORT_RANGE_NUM_PORTS, 364, 2, portRangeNumPorts) -IPFIX_ENTITY(STA_MAC_ADDRESS, 365, 6, staMacAddress) -IPFIX_ENTITY(STA_IPV4_ADDRESS, 366, 4, staIPv4Address) -IPFIX_ENTITY(WTP_MAC_ADDRESS, 367, 6, wtpMacAddress) -IPFIX_ENTITY(INGRESS_INTERFACE_TYPE, 368, 4, ingressInterfaceType) -IPFIX_ENTITY(EGRESS_INTERFACE_TYPE, 369, 4, egressInterfaceType) -IPFIX_ENTITY(RTP_SEQUENCE_NUMBER, 370, 2, rtpSequenceNumber) -IPFIX_ENTITY(USER_NAME, 371, 0, userName) -IPFIX_ENTITY(APPLICATION_CATEGORY_NAME, 372, 0, applicationCategoryName) -IPFIX_ENTITY(APPLICATION_SUB_CATEGORY_NAME, 373, 0, applicationSubCategoryName) -IPFIX_ENTITY(APPLICATION_GROUP_NAME, 374, 0, applicationGroupName) -IPFIX_ENTITY(ORIGINAL_FLOWS_PRESENT, 375, 8, originalFlowsPresent) -IPFIX_ENTITY(ORIGINAL_FLOWS_INITIATED, 376, 8, originalFlowsInitiated) -IPFIX_ENTITY(ORIGINAL_FLOWS_COMPLETED, 377, 8, originalFlowsCompleted) -IPFIX_ENTITY(DISTINCT_COUNT_OF_SOURCE_IPADDRESS, 378, 8, distinctCountOfSourceIPAddress) -IPFIX_ENTITY(DISTINCT_COUNT_OF_DESTINATION_IPADDRESS, 379, 8, distinctCountOfDestinationIPAddress) -IPFIX_ENTITY(DISTINCT_COUNT_OF_SOURCE_IPV4_ADDRESS, 380, 4, distinctCountOfSourceIPv4Address) -IPFIX_ENTITY(DISTINCT_COUNT_OF_DESTINATION_IPV4_ADDRESS, 381, 4, distinctCountOfDestinationIPv4Address) -IPFIX_ENTITY(DISTINCT_COUNT_OF_SOURCE_IPV6_ADDRESS, 382, 8, distinctCountOfSourceIPv6Address) -IPFIX_ENTITY(DISTINCT_COUNT_OF_DESTINATION_IPV6_ADDRESS, 383, 8, distinctCountOfDestinationIPv6Address) -IPFIX_ENTITY(VALUE_DISTRIBUTION_METHOD, 384, 1, valueDistributionMethod) -IPFIX_ENTITY(RFC3550_JITTER_MEAN_MILLISECONDS, 385, 4, rfc3550JitterMeanMilliseconds) -IPFIX_ENTITY(RFC3550_JITTER_MEAN_MICROSECONDS, 386, 4, rfc3550JitterMeanMicroseconds) -IPFIX_ENTITY(RFC3550_JITTER_MEAN_NANOSECONDS, 387, 4, rfc3550JitterMeanNanoseconds) - -#undef IPFIX_ENTITY diff -Nru openvswitch-2.3.1/ofproto/libofproto.pc.in openvswitch-2.4.0~git20150623/ofproto/libofproto.pc.in --- openvswitch-2.3.1/ofproto/libofproto.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/libofproto.pc.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libofproto +Description: OpenFlow library of Open vSwitch +Version: @VERSION@ +Libs: -L${libdir} -lofproto +Libs.private: @LIBS@ +Cflags: -I${includedir} diff -Nru openvswitch-2.3.1/ofproto/libofproto.sym.in openvswitch-2.4.0~git20150623/ofproto/libofproto.sym.in --- openvswitch-2.3.1/ofproto/libofproto.sym.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/libofproto.sym.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,4 @@ +libofproto_@LT_CURRENT@ { +global: + *; +}; diff -Nru openvswitch-2.3.1/ofproto/netflow.c openvswitch-2.4.0~git20150623/ofproto/netflow.c --- openvswitch-2.3.1/ofproto/netflow.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/netflow.c 2015-06-23 18:46:21.000000000 +0000 @@ -33,7 +33,7 @@ #include "socket-util.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(netflow); @@ -79,7 +79,7 @@ }; static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; -static atomic_uint netflow_count = ATOMIC_VAR_INIT(0); +static atomic_count netflow_count = ATOMIC_COUNT_INIT(0); static struct netflow_flow *netflow_flow_lookup(const struct netflow *, const struct flow *) @@ -110,7 +110,7 @@ struct netflow_v5_header *nf_hdr; struct netflow_v5_record *nf_rec; - if (!ofpbuf_size(&nf->packet)) { + if (!nf->packet.size) { struct timespec now; time_wall_timespec(&now); @@ -126,7 +126,7 @@ nf_hdr->sampling_interval = htons(0); } - nf_hdr = ofpbuf_data(&nf->packet); + nf_hdr = nf->packet.data; nf_hdr->count = htons(ntohs(nf_hdr->count) + 1); nf_hdr->flow_seq = htonl(nf->netflow_cnt++); @@ -298,9 +298,9 @@ long long int now = time_msec(); struct netflow_flow *nf_flow, *next; - if (ofpbuf_size(&nf->packet)) { - collectors_send(nf->collectors, ofpbuf_data(&nf->packet), ofpbuf_size(&nf->packet)); - ofpbuf_set_size(&nf->packet, 0); + if (nf->packet.size) { + collectors_send(nf->collectors, nf->packet.data, nf->packet.size); + nf->packet.size = 0; } if (!nf->active_timeout || now < nf->next_timeout) { @@ -339,7 +339,7 @@ if (nf->active_timeout) { poll_timer_wait_until(nf->next_timeout); } - if (ofpbuf_size(&nf->packet)) { + if (nf->packet.size) { poll_immediate_wake(); } ovs_mutex_unlock(&mutex); @@ -381,7 +381,6 @@ netflow_create(void) { struct netflow *nf = xzalloc(sizeof *nf); - int junk; nf->engine_type = 0; nf->engine_id = 0; @@ -392,7 +391,7 @@ hmap_init(&nf->flows); ovs_refcount_init(&nf->ref_cnt); ofpbuf_init(&nf->packet, 1500); - atomic_add(&netflow_count, 1, &junk); + atomic_count_inc(&netflow_count); return nf; } @@ -409,24 +408,22 @@ void netflow_unref(struct netflow *nf) { - if (nf && ovs_refcount_unref(&nf->ref_cnt) == 1) { - int orig; - - atomic_sub(&netflow_count, 1, &orig); + if (nf && ovs_refcount_unref_relaxed(&nf->ref_cnt) == 1) { + atomic_count_dec(&netflow_count); collectors_destroy(nf->collectors); ofpbuf_uninit(&nf->packet); free(nf); } } -/* Returns true if there exist any netflow objects, false otherwise. */ +/* Returns true if there exist any netflow objects, false otherwise. + * Callers must cope with transient false positives, i.e., there is no tight + * synchronization with the count and the actual existence of netflow objects. + */ bool netflow_exists(void) { - int n; - - atomic_read(&netflow_count, &n); - return n > 0; + return atomic_count_get(&netflow_count) > 0; } /* Helpers. */ @@ -458,13 +455,13 @@ { uint32_t hash = 0; - hash = mhash_add(hash, (OVS_FORCE uint32_t) flow->in_port.ofp_port); - hash = mhash_add(hash, ntohl(flow->nw_src)); - hash = mhash_add(hash, ntohl(flow->nw_dst)); - hash = mhash_add(hash, flow->nw_tos); - hash = mhash_add(hash, flow->nw_proto); - hash = mhash_add(hash, ntohs(flow->tp_src)); - hash = mhash_add(hash, ntohs(flow->tp_dst)); + hash = hash_add(hash, (OVS_FORCE uint32_t) flow->in_port.ofp_port); + hash = hash_add(hash, ntohl(flow->nw_src)); + hash = hash_add(hash, ntohl(flow->nw_dst)); + hash = hash_add(hash, flow->nw_tos); + hash = hash_add(hash, flow->nw_proto); + hash = hash_add(hash, ntohs(flow->tp_src)); + hash = hash_add(hash, ntohs(flow->tp_dst)); - return mhash_finish(hash, 28); + return hash_finish(hash, 28); } diff -Nru openvswitch-2.3.1/ofproto/ofproto.c openvswitch-2.4.0~git20150623/ofproto/ofproto.c --- openvswitch-2.3.1/ofproto/ofproto.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009-2015 Nicira, Inc. * Copyright (c) 2010 Jean Tourrilhes - HP-Labs. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -44,6 +44,7 @@ #include "openflow/nicira-ext.h" #include "openflow/openflow.h" #include "ovs-rcu.h" +#include "dp-packet.h" #include "packets.h" #include "pinsched.h" #include "pktbuf.h" @@ -57,7 +58,7 @@ #include "timeval.h" #include "unaligned.h" #include "unixctl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #include "bundles.h" VLOG_DEFINE_THIS_MODULE(ofproto); @@ -69,80 +70,10 @@ COVERAGE_DEFINE(ofproto_reinit_ports); COVERAGE_DEFINE(ofproto_update_port); -enum ofproto_state { - S_OPENFLOW, /* Processing OpenFlow commands. */ - S_EVICT, /* Evicting flows from over-limit tables. */ - S_FLUSH, /* Deleting all flow table rules. */ -}; - -enum ofoperation_type { - OFOPERATION_ADD, - OFOPERATION_DELETE, - OFOPERATION_MODIFY, - OFOPERATION_REPLACE -}; - -/* A single OpenFlow request can execute any number of operations. The - * ofopgroup maintain OpenFlow state common to all of the operations, e.g. the - * ofconn to which an error reply should be sent if necessary. - * - * ofproto initiates some operations internally. These operations are still - * assigned to groups but will not have an associated ofconn. */ -struct ofopgroup { - struct ofproto *ofproto; /* Owning ofproto. */ - struct list ofproto_node; /* In ofproto's "pending" list. */ - struct list ops; /* List of "struct ofoperation"s. */ - int n_running; /* Number of ops still pending. */ - - /* Data needed to send OpenFlow reply on failure or to send a buffered - * packet on success. - * - * If list_is_empty(ofconn_node) then this ofopgroup never had an - * associated ofconn or its ofconn's connection dropped after it initiated - * the operation. In the latter case 'ofconn' is a wild pointer that - * refers to freed memory, so the 'ofconn' member must be used only if - * !list_is_empty(ofconn_node). - */ - struct list ofconn_node; /* In ofconn's list of pending opgroups. */ - struct ofconn *ofconn; /* ofconn for reply (but see note above). */ - struct ofp_header *request; /* Original request (truncated at 64 bytes). */ - uint32_t buffer_id; /* Buffer id from original request. */ -}; - -static struct ofopgroup *ofopgroup_create_unattached(struct ofproto *); -static struct ofopgroup *ofopgroup_create(struct ofproto *, struct ofconn *, - const struct ofp_header *, - uint32_t buffer_id); -static void ofopgroup_submit(struct ofopgroup *); -static void ofopgroup_complete(struct ofopgroup *); - -/* A single flow table operation. */ -struct ofoperation { - struct ofopgroup *group; /* Owning group. */ - struct list group_node; /* In ofopgroup's "ops" list. */ - struct hmap_node hmap_node; /* In ofproto's "deletions" hmap. */ - struct rule *rule; /* Rule being operated upon. */ - enum ofoperation_type type; /* Type of operation. */ - - /* OFOPERATION_MODIFY, OFOPERATION_REPLACE: The old actions, if the actions - * are changing. */ - const struct rule_actions *actions; - - /* OFOPERATION_DELETE. */ - enum ofp_flow_removed_reason reason; /* Reason flow was removed. */ - - ovs_be64 flow_cookie; /* Rule's old flow cookie. */ - uint16_t idle_timeout; /* Rule's old idle timeout. */ - uint16_t hard_timeout; /* Rule's old hard timeout. */ - enum ofputil_flow_mod_flags flags; /* Rule's old flags. */ - enum ofperr error; /* 0 if no error. */ -}; - -static struct ofoperation *ofoperation_create(struct ofopgroup *, - struct rule *, - enum ofoperation_type, - enum ofp_flow_removed_reason); -static void ofoperation_destroy(struct ofoperation *); +/* Default fields to use for prefix tries in each flow table, unless something + * else is configured. */ +const enum mf_field_id default_prefix_fields[2] = + { MFF_IPV4_DST, MFF_IPV4_SRC }; /* oftable. */ static void oftable_init(struct oftable *); @@ -150,16 +81,13 @@ static void oftable_set_name(struct oftable *, const char *name); +static enum ofperr evict_rules_from_table(struct oftable *) + OVS_REQUIRES(ofproto_mutex); static void oftable_disable_eviction(struct oftable *); static void oftable_enable_eviction(struct oftable *, const struct mf_subfield *fields, size_t n_fields); -static void oftable_remove_rule(struct rule *rule) OVS_REQUIRES(ofproto_mutex); -static void oftable_remove_rule__(struct ofproto *, struct rule *) - OVS_REQUIRES(ofproto_mutex); -static void oftable_insert_rule(struct rule *); - /* A set of rules within a single OpenFlow table (oftable) that have the same * values for the oftable's eviction_fields. A rule to be evicted, when one is * needed, is taken from the eviction group that contains the greatest number @@ -182,11 +110,14 @@ struct heap rules; /* Contains "struct rule"s. */ }; -static bool choose_rule_to_evict(struct oftable *table, struct rule **rulep); -static void ofproto_evict(struct ofproto *) OVS_EXCLUDED(ofproto_mutex); -static uint32_t rule_eviction_priority(struct ofproto *ofproto, struct rule *); -static void eviction_group_add_rule(struct rule *); -static void eviction_group_remove_rule(struct rule *); +static bool choose_rule_to_evict(struct oftable *table, struct rule **rulep) + OVS_REQUIRES(ofproto_mutex); +static uint32_t rule_eviction_priority(struct ofproto *ofproto, struct rule *) + OVS_REQUIRES(ofproto_mutex);; +static void eviction_group_add_rule(struct rule *) + OVS_REQUIRES(ofproto_mutex); +static void eviction_group_remove_rule(struct rule *) + OVS_REQUIRES(ofproto_mutex); /* Criteria that flow_mod and other operations use for selecting rules on * which to operate. */ @@ -211,29 +142,70 @@ * If out_group != OFPG_ALL, select only rules that output to out_group. */ ofp_port_t out_port; uint32_t out_group; + + /* If true, collects only rules that are modifiable. */ + bool include_hidden; + bool include_readonly; }; static void rule_criteria_init(struct rule_criteria *, uint8_t table_id, - const struct match *match, - unsigned int priority, + const struct match *match, int priority, + cls_version_t version, ovs_be64 cookie, ovs_be64 cookie_mask, ofp_port_t out_port, uint32_t out_group); +static void rule_criteria_require_rw(struct rule_criteria *, + bool can_write_readonly); static void rule_criteria_destroy(struct rule_criteria *); +static enum ofperr collect_rules_loose(struct ofproto *, + const struct rule_criteria *, + struct rule_collection *); + /* A packet that needs to be passed to rule_execute(). * * (We can't do this immediately from ofopgroup_complete() because that holds * ofproto_mutex, which rule_execute() needs released.) */ struct rule_execute { - struct list list_node; /* In struct ofproto's "rule_executes" list. */ + struct ovs_list list_node; /* In struct ofproto's "rule_executes" list. */ struct rule *rule; /* Owns a reference to the rule. */ ofp_port_t in_port; - struct ofpbuf *packet; /* Owns the packet. */ + struct dp_packet *packet; /* Owns the packet. */ }; static void run_rule_executes(struct ofproto *) OVS_EXCLUDED(ofproto_mutex); static void destroy_rule_executes(struct ofproto *); +struct learned_cookie { + union { + /* In struct ofproto's 'learned_cookies' hmap. */ + struct hmap_node hmap_node OVS_GUARDED_BY(ofproto_mutex); + + /* In 'dead_cookies' list when removed from hmap. */ + struct ovs_list list_node; + } u; + + /* Key. */ + ovs_be64 cookie OVS_GUARDED_BY(ofproto_mutex); + uint8_t table_id OVS_GUARDED_BY(ofproto_mutex); + + /* Number of references from "learn" actions. + * + * When this drops to 0, all of the flows in 'table_id' with the specified + * 'cookie' are deleted. */ + int n OVS_GUARDED_BY(ofproto_mutex); +}; + +static const struct ofpact_learn *next_learn_with_delete( + const struct rule_actions *, const struct ofpact_learn *start); + +static void learned_cookies_inc(struct ofproto *, const struct rule_actions *) + OVS_REQUIRES(ofproto_mutex); +static void learned_cookies_dec(struct ofproto *, const struct rule_actions *, + struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex); +static void learned_cookies_flush(struct ofproto *, struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex); + /* ofport. */ static void ofport_destroy__(struct ofport *) OVS_EXCLUDED(ofproto_mutex); static void ofport_destroy(struct ofport *); @@ -260,24 +232,57 @@ }; /* rule. */ -static void ofproto_rule_send_removed(struct rule *, uint8_t reason); -static bool rule_is_modifiable(const struct rule *rule, - enum ofputil_flow_mod_flags flag); +static void ofproto_rule_send_removed(struct rule *) + OVS_EXCLUDED(ofproto_mutex); +static bool rule_is_readonly(const struct rule *); +static void ofproto_rule_insert__(struct ofproto *, struct rule *) + OVS_REQUIRES(ofproto_mutex); +static void ofproto_rule_remove__(struct ofproto *, struct rule *) + OVS_REQUIRES(ofproto_mutex); + +/* The source of a flow_mod request, in the code that processes flow_mods. + * + * A flow table modification request can be generated externally, via OpenFlow, + * or internally through a function call. This structure indicates the source + * of an OpenFlow-generated flow_mod. For an internal flow_mod, it isn't + * meaningful and thus supplied as NULL. */ +struct flow_mod_requester { + struct ofconn *ofconn; /* Connection on which flow_mod arrived. */ + const struct ofp_header *request; +}; /* OpenFlow. */ -static enum ofperr add_flow(struct ofproto *, struct ofconn *, - struct ofputil_flow_mod *, - const struct ofp_header *); -static void do_add_flow(struct ofproto *, struct ofconn *, - const struct ofp_header *request, uint32_t buffer_id, - struct rule *); -static enum ofperr modify_flows__(struct ofproto *, struct ofconn *, - struct ofputil_flow_mod *, - const struct ofp_header *, - const struct rule_collection *); -static void delete_flow__(struct rule *rule, struct ofopgroup *, - enum ofp_flow_removed_reason) +static enum ofperr replace_rule_create(struct ofproto *, + struct ofputil_flow_mod *, + struct cls_rule *cr, uint8_t table_id, + struct rule *old_rule, + struct rule **new_rule) + OVS_REQUIRES(ofproto_mutex); + +static void replace_rule_start(struct ofproto *, + struct rule *old_rule, + struct rule *new_rule, + struct cls_conjunction *, size_t n_conjs) + OVS_REQUIRES(ofproto_mutex); + +static void replace_rule_revert(struct ofproto *, struct rule *old_rule, + struct rule *new_rule) OVS_REQUIRES(ofproto_mutex); + +static void replace_rule_finish(struct ofproto *, struct ofputil_flow_mod *, + const struct flow_mod_requester *, + struct rule *old_rule, struct rule *new_rule, + struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex); +static void delete_flows__(struct rule_collection *, + enum ofp_flow_removed_reason, + const struct flow_mod_requester *) + OVS_REQUIRES(ofproto_mutex); + +static void send_buffered_packet(const struct flow_mod_requester *, + uint32_t buffer_id, struct rule *) + OVS_REQUIRES(ofproto_mutex); + static bool ofproto_group_exists__(const struct ofproto *ofproto, uint32_t group_id) OVS_REQ_RDLOCK(ofproto->groups_rwlock); @@ -285,10 +290,19 @@ uint32_t group_id) OVS_EXCLUDED(ofproto->groups_rwlock); static enum ofperr add_group(struct ofproto *, struct ofputil_group_mod *); -static bool handle_openflow(struct ofconn *, const struct ofpbuf *); -static enum ofperr handle_flow_mod__(struct ofproto *, struct ofconn *, +static void handle_openflow(struct ofconn *, const struct ofpbuf *); +static enum ofperr do_bundle_flow_mod_start(struct ofproto *, + struct ofputil_flow_mod *, + struct ofp_bundle_entry *) + OVS_REQUIRES(ofproto_mutex); +static void do_bundle_flow_mod_finish(struct ofproto *, + struct ofputil_flow_mod *, + const struct flow_mod_requester *, + struct ofp_bundle_entry *) + OVS_REQUIRES(ofproto_mutex); +static enum ofperr handle_flow_mod__(struct ofproto *, struct ofputil_flow_mod *, - const struct ofp_header *) + const struct flow_mod_requester *) OVS_EXCLUDED(ofproto_mutex); static void calc_duration(long long int start, long long int now, uint32_t *sec, uint32_t *nsec); @@ -299,6 +313,7 @@ static void ofproto_destroy__(struct ofproto *); static void update_mtu(struct ofproto *, struct ofport *); static void meter_delete(struct ofproto *, uint32_t first, uint32_t last); +static void meter_insert_rule(struct rule *); /* unixctl. */ static void ofproto_unixctl_init(void); @@ -315,6 +330,8 @@ unsigned ofproto_max_idle = OFPROTO_MAX_IDLE_DEFAULT; size_t n_handlers, n_revalidators; +size_t n_dpdk_rxqs; +char *pmd_cpu_mask; /* Map from datapath name to struct ofproto, for use by unixctl commands. */ static struct hmap all_ofprotos = HMAP_INITIALIZER(&all_ofprotos); @@ -469,6 +486,14 @@ return class ? class->enumerate_names(type, names) : EAFNOSUPPORT; } +static void +ofproto_bump_tables_version(struct ofproto *ofproto) +{ + ++ofproto->tables_version; + ofproto->ofproto_class->set_tables_version(ofproto, + ofproto->tables_version); +} + int ofproto_create(const char *datapath_name, const char *datapath_type, struct ofproto **ofprotop) @@ -522,13 +547,11 @@ ofproto->eviction_group_timer = LLONG_MIN; ofproto->tables = NULL; ofproto->n_tables = 0; + ofproto->tables_version = CLS_MIN_VERSION; hindex_init(&ofproto->cookies); + hmap_init(&ofproto->learned_cookies); list_init(&ofproto->expirable); ofproto->connmgr = connmgr_create(ofproto, datapath_name, datapath_name); - ofproto->state = S_OPENFLOW; - list_init(&ofproto->pending); - ofproto->n_pending = 0; - hmap_init(&ofproto->deletions); guarded_list_init(&ofproto->rule_executes); ofproto->vlan_bitmap = NULL; ofproto->vlans_changed = false; @@ -537,35 +560,17 @@ hmap_init(&ofproto->groups); ovs_mutex_unlock(&ofproto_mutex); ofproto->ogf.types = 0xf; - ofproto->ogf.capabilities = OFPGFC_CHAINING | OFPGFC_SELECT_LIVENESS | - OFPGFC_SELECT_WEIGHT; - ofproto->ogf.max_groups[OFPGT11_ALL] = OFPG_MAX; - ofproto->ogf.max_groups[OFPGT11_SELECT] = OFPG_MAX; - ofproto->ogf.max_groups[OFPGT11_INDIRECT] = OFPG_MAX; - ofproto->ogf.max_groups[OFPGT11_FF] = OFPG_MAX; - ofproto->ogf.actions[0] = - (1 << OFPAT11_OUTPUT) | - (1 << OFPAT11_COPY_TTL_OUT) | - (1 << OFPAT11_COPY_TTL_IN) | - (1 << OFPAT11_SET_MPLS_TTL) | - (1 << OFPAT11_DEC_MPLS_TTL) | - (1 << OFPAT11_PUSH_VLAN) | - (1 << OFPAT11_POP_VLAN) | - (1 << OFPAT11_PUSH_MPLS) | - (1 << OFPAT11_POP_MPLS) | - (1 << OFPAT11_SET_QUEUE) | - (1 << OFPAT11_GROUP) | - (1 << OFPAT11_SET_NW_TTL) | - (1 << OFPAT11_DEC_NW_TTL) | - (1 << OFPAT12_SET_FIELD); -/* not supported: - * (1 << OFPAT13_PUSH_PBB) | - * (1 << OFPAT13_POP_PBB) */ + ofproto->ogf.capabilities = OFPGFC_SELECT_LIVENESS | OFPGFC_SELECT_WEIGHT; + for (i = 0; i < 4; i++) { + ofproto->ogf.max_groups[i] = OFPG_MAX; + ofproto->ogf.ofpacts[i] = (UINT64_C(1) << N_OFPACTS) - 1; + } error = ofproto->ofproto_class->construct(ofproto); if (error) { VLOG_ERR("failed to open datapath %s: %s", datapath_name, ovs_strerror(error)); + connmgr_destroy(ofproto->connmgr); ofproto_destroy__(ofproto); return error; } @@ -592,6 +597,9 @@ ofproto->meters = xzalloc((ofproto->meter_features.max_meters + 1) * sizeof(struct meter *)); + /* Set the initial tables version. */ + ofproto_bump_tables_version(ofproto); + *ofprotop = ofproto; return 0; } @@ -736,6 +744,47 @@ } } +/* Multicast snooping configuration. */ + +/* Configures multicast snooping on 'ofproto' using the settings + * defined in 's'. If 's' is NULL, disables multicast snooping. + * + * Returns 0 if successful, otherwise a positive errno value. */ +int +ofproto_set_mcast_snooping(struct ofproto *ofproto, + const struct ofproto_mcast_snooping_settings *s) +{ + return (ofproto->ofproto_class->set_mcast_snooping + ? ofproto->ofproto_class->set_mcast_snooping(ofproto, s) + : EOPNOTSUPP); +} + +/* Configures multicast snooping flood settings on 'ofp_port' of 'ofproto'. + * + * Returns 0 if successful, otherwise a positive errno value.*/ +int +ofproto_port_set_mcast_snooping(struct ofproto *ofproto, void *aux, + const struct ofproto_mcast_snooping_port_settings *s) +{ + return (ofproto->ofproto_class->set_mcast_snooping_port + ? ofproto->ofproto_class->set_mcast_snooping_port(ofproto, aux, s) + : EOPNOTSUPP); +} + +void +ofproto_set_n_dpdk_rxqs(int n_rxqs) +{ + n_dpdk_rxqs = MAX(n_rxqs, 0); +} + +void +ofproto_set_cpu_mask(const char *cmask) +{ + free(pmd_cpu_mask); + + pmd_cpu_mask = cmask ? xstrdup(cmask) : NULL; +} + void ofproto_set_threads(int n_handlers_, int n_revalidators_) { @@ -917,6 +966,87 @@ ? ofproto->ofproto_class->get_stp_port_stats(ofport, s) : EOPNOTSUPP); } + +/* Rapid Spanning Tree Protocol (RSTP) configuration. */ + +/* Configures RSTP on 'ofproto' using the settings defined in 's'. If + * 's' is NULL, disables RSTP. + * + * Returns 0 if successful, otherwise a positive errno value. */ +int +ofproto_set_rstp(struct ofproto *ofproto, + const struct ofproto_rstp_settings *s) +{ + if (!ofproto->ofproto_class->set_rstp) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->set_rstp(ofproto, s); + return 0; +} + +/* Retrieves RSTP status of 'ofproto' and stores it in 's'. If the + * 'enabled' member of 's' is false, then the other members are not + * meaningful. + * + * Returns 0 if successful, otherwise a positive errno value. */ +int +ofproto_get_rstp_status(struct ofproto *ofproto, + struct ofproto_rstp_status *s) +{ + if (!ofproto->ofproto_class->get_rstp_status) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->get_rstp_status(ofproto, s); + return 0; +} + +/* Configures RSTP on 'ofp_port' of 'ofproto' using the settings defined + * in 's'. The caller is responsible for assigning RSTP port numbers + * (using the 'port_num' member in the range of 1 through 255, inclusive) + * and ensuring there are no duplicates. If the 's' is NULL, then RSTP + * is disabled on the port. + * + * Returns 0 if successful, otherwise a positive errno value.*/ +int +ofproto_port_set_rstp(struct ofproto *ofproto, ofp_port_t ofp_port, + const struct ofproto_port_rstp_settings *s) +{ + struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); + if (!ofport) { + VLOG_WARN("%s: cannot configure RSTP on nonexistent port %"PRIu16, + ofproto->name, ofp_port); + return ENODEV; + } + + if (!ofproto->ofproto_class->set_rstp_port) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->set_rstp_port(ofport, s); + return 0; +} + +/* Retrieves RSTP port status of 'ofp_port' on 'ofproto' and stores it in + * 's'. If the 'enabled' member in 's' is false, then the other members + * are not meaningful. + * + * Returns 0 if successful, otherwise a positive errno value.*/ +int +ofproto_port_get_rstp_status(struct ofproto *ofproto, ofp_port_t ofp_port, + struct ofproto_port_rstp_status *s) +{ + struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); + if (!ofport) { + VLOG_WARN_RL(&rl, "%s: cannot get RSTP status on nonexistent " + "port %"PRIu16, ofproto->name, ofp_port); + return ENODEV; + } + + if (!ofproto->ofproto_class->get_rstp_port_status) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->get_rstp_port_status(ofport, s); + return 0; +} /* Queue DSCP configuration. */ @@ -945,6 +1075,83 @@ : EOPNOTSUPP); } +/* LLDP configuration. */ +void +ofproto_port_set_lldp(struct ofproto *ofproto, + ofp_port_t ofp_port, + const struct smap *cfg) +{ + struct ofport *ofport; + int error; + + ofport = ofproto_get_port(ofproto, ofp_port); + if (!ofport) { + VLOG_WARN("%s: cannot configure LLDP on nonexistent port %"PRIu16, + ofproto->name, ofp_port); + return; + } + error = (ofproto->ofproto_class->set_lldp + ? ofproto->ofproto_class->set_lldp(ofport, cfg) + : EOPNOTSUPP); + if (error) { + VLOG_WARN("%s: lldp configuration on port %"PRIu16" (%s) failed (%s)", + ofproto->name, ofp_port, netdev_get_name(ofport->netdev), + ovs_strerror(error)); + } +} + +int +ofproto_set_aa(struct ofproto *ofproto, void *aux OVS_UNUSED, + const struct aa_settings *s) +{ + if (!ofproto->ofproto_class->set_aa) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->set_aa(ofproto, s); + return 0; +} + +int +ofproto_aa_mapping_register(struct ofproto *ofproto, void *aux, + const struct aa_mapping_settings *s) +{ + if (!ofproto->ofproto_class->aa_mapping_set) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->aa_mapping_set(ofproto, aux, s); + return 0; +} + +int +ofproto_aa_mapping_unregister(struct ofproto *ofproto, void *aux) +{ + if (!ofproto->ofproto_class->aa_mapping_unset) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->aa_mapping_unset(ofproto, aux); + return 0; +} + +int +ofproto_aa_vlan_get_queued(struct ofproto *ofproto, + struct ovs_list *list) +{ + if (!ofproto->ofproto_class->aa_vlan_get_queued) { + return EOPNOTSUPP; + } + ofproto->ofproto_class->aa_vlan_get_queued(ofproto, list); + return 0; +} + +unsigned int +ofproto_aa_vlan_get_queue_size(struct ofproto *ofproto) +{ + if (!ofproto->ofproto_class->aa_vlan_get_queue_size) { + return EOPNOTSUPP; + } + return ofproto->ofproto_class->aa_vlan_get_queue_size(ofproto); +} + /* Connectivity Fault Management configuration. */ /* Clears the CFM configuration from 'ofp_port' on 'ofproto'. */ @@ -1016,22 +1223,30 @@ } } -/* Populates 'status' with the status of BFD on 'ofport'. If 'force' is set to - * true, status will be returned even if there is no status change since last - * update. - * - * Returns 0 on success. Returns a negative number if there is no status change - * since last update and 'force' is set to false. Returns a positive errno - * otherwise. Has no effect if 'ofp_port' is not an OpenFlow port in 'ofproto'. +/* Checks the status change of BFD on 'ofport'. + * + * Returns true if 'ofproto_class' does not support 'bfd_status_changed'. */ +bool +ofproto_port_bfd_status_changed(struct ofproto *ofproto, ofp_port_t ofp_port) +{ + struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); + return (ofport && ofproto->ofproto_class->bfd_status_changed + ? ofproto->ofproto_class->bfd_status_changed(ofport) + : true); +} + +/* Populates 'status' with the status of BFD on 'ofport'. Returns 0 on + * success. Returns a positive errno otherwise. Has no effect if 'ofp_port' + * is not an OpenFlow port in 'ofproto'. * * The caller must provide and own '*status'. */ int ofproto_port_get_bfd_status(struct ofproto *ofproto, ofp_port_t ofp_port, - bool force, struct smap *status) + struct smap *status) { struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); return (ofport && ofproto->ofproto_class->get_bfd_status - ? ofproto->ofproto_class->get_bfd_status(ofport, force, status) + ? ofproto->ofproto_class->get_bfd_status(ofport, status) : EOPNOTSUPP); } @@ -1047,6 +1262,21 @@ ? ofproto->ofproto_class->port_is_lacp_current(ofport) : -1); } + +int +ofproto_port_get_lacp_stats(const struct ofport *port, struct lacp_slave_stats *stats) +{ + struct ofproto *ofproto = port->ofproto; + int error; + + if (ofproto->ofproto_class->port_get_lacp_stats) { + error = ofproto->ofproto_class->port_get_lacp_stats(port, stats); + } else { + error = EOPNOTSUPP; + } + + return error; +} /* Bundles. */ @@ -1102,7 +1332,8 @@ /* Retrieves statistics from mirror associated with client data pointer * 'aux' in 'ofproto'. Stores packet and byte counts in 'packets' and * 'bytes', respectively. If a particular counters is not supported, - * the appropriate argument is set to UINT64_MAX. */ + * the appropriate argument is set to UINT64_MAX. + */ int ofproto_mirror_get_stats(struct ofproto *ofproto, void *aux, uint64_t *packets, uint64_t *bytes) @@ -1194,27 +1425,15 @@ } table->max_flows = s->max_flows; - fat_rwlock_wrlock(&table->cls.rwlock); - if (classifier_count(&table->cls) > table->max_flows - && table->eviction_fields) { - /* 'table' contains more flows than allowed. We might not be able to - * evict them right away because of the asynchronous nature of flow - * table changes. Schedule eviction for later. */ - switch (ofproto->state) { - case S_OPENFLOW: - ofproto->state = S_EVICT; - break; - case S_EVICT: - case S_FLUSH: - /* We're already deleting flows, nothing more to do. */ - break; - } - } - classifier_set_prefix_fields(&table->cls, - s->prefix_fields, s->n_prefix_fields); + if (classifier_set_prefix_fields(&table->cls, + s->prefix_fields, s->n_prefix_fields)) { + /* XXX: Trigger revalidation. */ + } - fat_rwlock_unlock(&table->cls.rwlock); + ovs_mutex_lock(&ofproto_mutex); + evict_rules_from_table(table); + ovs_mutex_unlock(&ofproto_mutex); } bool @@ -1229,20 +1448,6 @@ connmgr_get_snoops(ofproto->connmgr, snoops); } -static void -ofproto_rule_delete__(struct ofproto *ofproto, struct rule *rule, - uint8_t reason) - OVS_REQUIRES(ofproto_mutex) -{ - struct ofopgroup *group; - - ovs_assert(!rule->pending); - - group = ofopgroup_create_unattached(ofproto); - delete_flow__(rule, group, reason); - ofopgroup_submit(group); -} - /* Deletes 'rule' from 'ofproto'. * * Within an ofproto implementation, this function allows an ofproto @@ -1256,17 +1461,23 @@ ofproto_rule_delete(struct ofproto *ofproto, struct rule *rule) OVS_EXCLUDED(ofproto_mutex) { - struct ofopgroup *group; - + /* This skips the ofmonitor and flow-removed notifications because the + * switch is being deleted and any OpenFlow channels have been or soon will + * be killed. */ ovs_mutex_lock(&ofproto_mutex); - ovs_assert(!rule->pending); - group = ofopgroup_create_unattached(ofproto); - ofoperation_create(group, rule, OFOPERATION_DELETE, OFPRR_DELETE); - oftable_remove_rule__(ofproto, rule); - ofproto->ofproto_class->rule_delete(rule); - ofopgroup_submit(group); + if (!rule->removed) { + /* Make sure there is no postponed removal of the rule. */ + ovs_assert(cls_rule_visible_in_version(&rule->cr, CLS_MAX_VERSION)); + if (!classifier_remove(&rule->ofproto->tables[rule->table_id].cls, + &rule->cr)) { + OVS_NOT_REACHED(); + } + ofproto_rule_remove__(rule->ofproto, rule); + ofproto->ofproto_class->rule_delete(rule); + ofproto_rule_unref(rule); + } ovs_mutex_unlock(&ofproto_mutex); } @@ -1276,28 +1487,36 @@ { struct oftable *table; + /* This will flush all datapath flows. */ if (ofproto->ofproto_class->flush) { ofproto->ofproto_class->flush(ofproto); } + /* XXX: There is a small race window here, where new datapath flows can be + * created by upcall handlers based on the existing flow table. We can not + * call ofproto class flush while holding 'ofproto_mutex' to prevent this, + * as then we could deadlock on syncing with the handler threads waiting on + * the same mutex. */ + ovs_mutex_lock(&ofproto_mutex); OFPROTO_FOR_EACH_TABLE (table, ofproto) { - struct rule *rule, *next_rule; - struct cls_cursor cursor; + struct rule_collection rules; + struct rule *rule; if (table->flags & OFTABLE_HIDDEN) { continue; } - fat_rwlock_rdlock(&table->cls.rwlock); - cls_cursor_init(&cursor, &table->cls, NULL); - fat_rwlock_unlock(&table->cls.rwlock); - CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, cr, &cursor) { - if (!rule->pending) { - ofproto_rule_delete__(ofproto, rule, OFPRR_DELETE); - } + rule_collection_init(&rules); + + CLS_FOR_EACH (rule, cr, &table->cls) { + rule_collection_add(&rules, rule); } + delete_flows__(&rules, OFPRR_DELETE, NULL); } + /* XXX: Concurrent handler threads may insert new learned flows based on + * learn actions of the now deleted flows right after we release + * 'ofproto_mutex'. */ ovs_mutex_unlock(&ofproto_mutex); } @@ -1309,8 +1528,6 @@ { struct oftable *table; - ovs_assert(list_is_empty(&ofproto->pending)); - destroy_rule_executes(ofproto); delete_group(ofproto, OFPG_ALL); @@ -1318,8 +1535,6 @@ ovs_rwlock_destroy(&ofproto->groups_rwlock); hmap_destroy(&ofproto->groups); - connmgr_destroy(ofproto->connmgr); - hmap_remove(&all_ofprotos, &ofproto->hmap_node); free(ofproto->name); free(ofproto->type); @@ -1338,16 +1553,27 @@ } free(ofproto->tables); - hmap_destroy(&ofproto->deletions); - ovs_assert(hindex_is_empty(&ofproto->cookies)); hindex_destroy(&ofproto->cookies); + ovs_assert(hmap_is_empty(&ofproto->learned_cookies)); + hmap_destroy(&ofproto->learned_cookies); + free(ofproto->vlan_bitmap); ofproto->ofproto_class->dealloc(ofproto); } +/* Destroying rules is doubly deferred, must have 'ofproto' around for them. + * - 1st we defer the removal of the rules from the classifier + * - 2nd we defer the actual destruction of the rules. */ +static void +ofproto_destroy_defer__(struct ofproto *ofproto) + OVS_EXCLUDED(ofproto_mutex) +{ + ovsrcu_postpone(ofproto_destroy__, ofproto); +} + void ofproto_destroy(struct ofproto *p) OVS_EXCLUDED(ofproto_mutex) @@ -1377,8 +1603,14 @@ } p->ofproto_class->destruct(p); + + /* We should not postpone this because it involves deleting a listening + * socket which we may want to reopen soon. 'connmgr' should not be used + * by other threads */ + connmgr_destroy(p->connmgr); + /* Destroying rules is deferred, must have 'ofproto' around for them. */ - ovsrcu_postpone(ofproto_destroy__, p); + ovsrcu_postpone(ofproto_destroy_defer__, p); } /* Destroys the datapath with the respective 'name' and 'type'. With the Linux @@ -1437,19 +1669,6 @@ } } -static bool -any_pending_ops(const struct ofproto *p) - OVS_EXCLUDED(ofproto_mutex) -{ - bool b; - - ovs_mutex_lock(&ofproto_mutex); - b = !list_is_empty(&p->pending); - ovs_mutex_unlock(&ofproto_mutex); - - return b; -} - int ofproto_run(struct ofproto *p) { @@ -1472,26 +1691,21 @@ for (i = 0; i < p->n_tables; i++) { struct oftable *table = &p->tables[i]; struct eviction_group *evg; - struct cls_cursor cursor; struct rule *rule; if (!table->eviction_fields) { continue; } - ovs_mutex_lock(&ofproto_mutex); - fat_rwlock_rdlock(&table->cls.rwlock); - - if (classifier_count(&table->cls) > 100000) { + if (table->n_flows > 100000) { static struct vlog_rate_limit count_rl = VLOG_RATE_LIMIT_INIT(1, 1); VLOG_WARN_RL(&count_rl, "Table %"PRIuSIZE" has an excessive" - " number of rules: %d", i, - classifier_count(&table->cls)); + " number of rules: %d", i, table->n_flows); } - cls_cursor_init(&cursor, &table->cls, NULL); - CLS_CURSOR_FOR_EACH (rule, cr, &cursor) { + ovs_mutex_lock(&ofproto_mutex); + CLS_FOR_EACH (rule, cr, &table->cls) { if (rule->idle_timeout || rule->hard_timeout) { if (!rule->eviction_group) { eviction_group_add_rule(rule); @@ -1501,7 +1715,6 @@ } } } - fat_rwlock_unlock(&table->cls.rwlock); HEAP_FOR_EACH (evg, size_node, &table->eviction_groups_by_size) { heap_rebuild(&evg->rules); @@ -1548,31 +1761,7 @@ p->change_seq = new_seq; } - switch (p->state) { - case S_OPENFLOW: - connmgr_run(p->connmgr, handle_openflow); - break; - - case S_EVICT: - connmgr_run(p->connmgr, NULL); - ofproto_evict(p); - if (!any_pending_ops(p)) { - p->state = S_OPENFLOW; - } - break; - - case S_FLUSH: - connmgr_run(p->connmgr, NULL); - ofproto_flush__(p); - if (!any_pending_ops(p)) { - connmgr_flushed(p->connmgr); - p->state = S_OPENFLOW; - } - break; - - default: - OVS_NOT_REACHED(); - } + connmgr_run(p->connmgr, handle_openflow); return error; } @@ -1585,20 +1774,7 @@ p->ofproto_class->port_poll_wait(p); } seq_wait(connectivity_seq_get(), p->change_seq); - - switch (p->state) { - case S_OPENFLOW: - connmgr_wait(p->connmgr, true); - break; - - case S_EVICT: - case S_FLUSH: - connmgr_wait(p->connmgr, false); - if (!any_pending_ops(p)) { - poll_immediate_wake(); - } - break; - } + connmgr_wait(p->connmgr); } bool @@ -1617,16 +1793,9 @@ simap_increase(usage, "ports", hmap_count(&ofproto->ports)); - ovs_mutex_lock(&ofproto_mutex); - simap_increase(usage, "ops", - ofproto->n_pending + hmap_count(&ofproto->deletions)); - ovs_mutex_unlock(&ofproto_mutex); - n_rules = 0; OFPROTO_FOR_EACH_TABLE (table, ofproto) { - fat_rwlock_rdlock(&table->cls.rwlock); - n_rules += classifier_count(&table->cls); - fat_rwlock_unlock(&table->cls.rwlock); + n_rules += table->n_flows; } simap_increase(usage, "rules", n_rules); @@ -1856,7 +2025,7 @@ static void flow_mod_init(struct ofputil_flow_mod *fm, - const struct match *match, unsigned int priority, + const struct match *match, int priority, const struct ofpact *ofpacts, size_t ofpacts_len, enum ofp_flow_mod_command command) { @@ -1870,17 +2039,19 @@ fm->command = command; fm->idle_timeout = 0; fm->hard_timeout = 0; + fm->importance = 0; fm->buffer_id = UINT32_MAX; fm->out_port = OFPP_ANY; fm->out_group = OFPG_ANY; fm->flags = 0; fm->ofpacts = CONST_CAST(struct ofpact *, ofpacts); fm->ofpacts_len = ofpacts_len; + fm->delete_reason = OFPRR_DELETE; } static int simple_flow_mod(struct ofproto *ofproto, - const struct match *match, unsigned int priority, + const struct match *match, int priority, const struct ofpact *ofpacts, size_t ofpacts_len, enum ofp_flow_mod_command command) { @@ -1888,7 +2059,7 @@ flow_mod_init(&fm, match, priority, ofpacts, ofpacts_len, command); - return handle_flow_mod__(ofproto, NULL, &fm, NULL); + return handle_flow_mod__(ofproto, &fm, NULL); } /* Adds a flow to OpenFlow flow table 0 in 'p' that matches 'cls_rule' and @@ -1904,7 +2075,7 @@ * This is a helper function for in-band control and fail-open. */ void ofproto_add_flow(struct ofproto *ofproto, const struct match *match, - unsigned int priority, + int priority, const struct ofpact *ofpacts, size_t ofpacts_len) OVS_EXCLUDED(ofproto_mutex) { @@ -1913,9 +2084,9 @@ /* First do a cheap check whether the rule we're looking for already exists * with the actions that we want. If it does, then we're done. */ - fat_rwlock_rdlock(&ofproto->tables[0].cls.rwlock); rule = rule_from_cls_rule(classifier_find_match_exactly( - &ofproto->tables[0].cls, match, priority)); + &ofproto->tables[0].cls, match, priority, + CLS_MAX_VERSION)); if (rule) { const struct rule_actions *actions = rule_get_actions(rule); must_add = !ofpacts_equal(actions->ofpacts, actions->ofpacts_len, @@ -1923,7 +2094,6 @@ } else { must_add = true; } - fat_rwlock_unlock(&ofproto->tables[0].cls.rwlock); /* If there's no such rule or the rule doesn't have the actions we want, * fall back to a executing a full flow mod. We can't optimize this at @@ -1935,13 +2105,12 @@ } } -/* Executes the flow modification specified in 'fm'. Returns 0 on success, an - * OFPERR_* OpenFlow error code on failure, or OFPROTO_POSTPONE if the - * operation cannot be initiated now but may be retried later. +/* Executes the flow modification specified in 'fm'. Returns 0 on success, or + * an OFPERR_* OpenFlow error code on failure. * * This is a helper function for in-band control and fail-open and the "learn" * action. */ -int +enum ofperr ofproto_flow_mod(struct ofproto *ofproto, struct ofputil_flow_mod *fm) OVS_EXCLUDED(ofproto_mutex) { @@ -1954,10 +2123,9 @@ struct rule *rule; bool done = false; - fat_rwlock_rdlock(&table->cls.rwlock); - rule = rule_from_cls_rule(classifier_find_match_exactly(&table->cls, - &fm->match, - fm->priority)); + rule = rule_from_cls_rule(classifier_find_match_exactly( + &table->cls, &fm->match, fm->priority, + CLS_MAX_VERSION)); if (rule) { /* Reading many of the rule fields and writing on 'modified' * requires the rule->mutex. Also, rule->actions may change @@ -1968,6 +2136,7 @@ actions = rule_get_actions(rule); if (rule->idle_timeout == fm->idle_timeout && rule->hard_timeout == fm->hard_timeout + && rule->importance == fm->importance && rule->flags == (fm->flags & OFPUTIL_FF_STATE) && (!fm->modify_cookie || (fm->new_cookie == rule->flow_cookie)) && ofpacts_equal(fm->ofpacts, fm->ofpacts_len, @@ -1979,23 +2148,22 @@ } ovs_mutex_unlock(&rule->mutex); } - fat_rwlock_unlock(&table->cls.rwlock); if (done) { return 0; } } - return handle_flow_mod__(ofproto, NULL, fm, NULL); + return handle_flow_mod__(ofproto, fm, NULL); } /* Searches for a rule with matching criteria exactly equal to 'target' in * ofproto's table 0 and, if it finds one, deletes it. * * This is a helper function for in-band control and fail-open. */ -bool +void ofproto_delete_flow(struct ofproto *ofproto, - const struct match *target, unsigned int priority) + const struct match *target, int priority) OVS_EXCLUDED(ofproto_mutex) { struct classifier *cls = &ofproto->tables[0].cls; @@ -2003,29 +2171,26 @@ /* First do a cheap check whether the rule we're looking for has already * been deleted. If so, then we're done. */ - fat_rwlock_rdlock(&cls->rwlock); - rule = rule_from_cls_rule(classifier_find_match_exactly(cls, target, - priority)); - fat_rwlock_unlock(&cls->rwlock); + rule = rule_from_cls_rule(classifier_find_match_exactly( + cls, target, priority, CLS_MAX_VERSION)); if (!rule) { - return true; + return; } - /* Fall back to a executing a full flow mod. We can't optimize this at all - * because we didn't take enough locks above to ensure that the flow table - * didn't already change beneath us. */ - return simple_flow_mod(ofproto, target, priority, NULL, 0, - OFPFC_DELETE_STRICT) != OFPROTO_POSTPONE; + /* Execute a flow mod. We can't optimize this at all because we didn't + * take enough locks above to ensure that the flow table didn't already + * change beneath us. */ + simple_flow_mod(ofproto, target, priority, NULL, 0, OFPFC_DELETE_STRICT); } -/* Starts the process of deleting all of the flows from all of ofproto's flow - * tables and then reintroducing the flows required by in-band control and - * fail-open. The process will complete in a later call to ofproto_run(). */ +/* Delete all of the flows from all of ofproto's flow tables, then reintroduce + * the flows required by in-band control and fail-open. */ void ofproto_flush_flows(struct ofproto *ofproto) { COVERAGE_INC(ofproto_flush); - ofproto->state = S_FLUSH; + ofproto_flush__(ofproto); + connmgr_flushed(ofproto->connmgr); } static void @@ -2117,7 +2282,7 @@ /* Opens and returns a netdev for 'ofproto_port' in 'ofproto', or a null * pointer if the netdev cannot be opened. On success, also fills in - * 'opp'. */ + * '*pp'. */ static struct netdev * ofport_open(struct ofproto *ofproto, struct ofproto_port *ofproto_port, @@ -2160,7 +2325,7 @@ } /* Returns true if most fields of 'a' and 'b' are equal. Differences in name, - * port number, and 'config' bits other than OFPUTIL_PS_LINK_DOWN are + * port number, and 'config' bits other than OFPUTIL_PC_PORT_DOWN are * disregarded. */ static bool ofport_equal(const struct ofputil_phy_port *a, @@ -2291,6 +2456,9 @@ if (port->ofproto->ofproto_class->set_stp_port) { port->ofproto->ofproto_class->set_stp_port(port, NULL); } + if (port->ofproto->ofproto_class->set_rstp_port) { + port->ofproto->ofproto_class->set_rstp_port(port, NULL); + } if (port->ofproto->ofproto_class->set_cfm) { port->ofproto->ofproto_class->set_cfm(port, NULL); } @@ -2590,7 +2758,14 @@ static void rule_destroy_cb(struct rule *rule) + OVS_NO_THREAD_SAFETY_ANALYSIS { + /* Send rule removed if needed. */ + if (rule->flags & OFPUTIL_FF_SEND_FLOW_REM + && rule->removed_reason != OVS_OFPRR_NONE + && !rule_is_hidden(rule)) { + ofproto_rule_send_removed(rule); + } rule->ofproto->ofproto_class->rule_destruct(rule); ofproto_rule_destroy__(rule); } @@ -2603,6 +2778,15 @@ } } +bool +ofproto_rule_try_ref(struct rule *rule) +{ + if (rule) { + return ovs_refcount_try_ref_rcu(&rule->ref_count); + } + return false; +} + /* Decrements 'rule''s ref_count and schedules 'rule' to be destroyed if the * ref_count reaches 0. * @@ -2612,29 +2796,111 @@ void ofproto_rule_unref(struct rule *rule) { - if (rule && ovs_refcount_unref(&rule->ref_count) == 1) { + if (rule && ovs_refcount_unref_relaxed(&rule->ref_count) == 1) { ovsrcu_postpone(rule_destroy_cb, rule); } } +static void +remove_rule_rcu__(struct rule *rule) + OVS_REQUIRES(ofproto_mutex) +{ + struct ofproto *ofproto = rule->ofproto; + struct oftable *table = &ofproto->tables[rule->table_id]; + + ovs_assert(!cls_rule_visible_in_version(&rule->cr, CLS_MAX_VERSION)); + if (!classifier_remove(&table->cls, &rule->cr)) { + OVS_NOT_REACHED(); + } + ofproto->ofproto_class->rule_delete(rule); + ofproto_rule_unref(rule); +} + +static void +remove_rule_rcu(struct rule *rule) + OVS_EXCLUDED(ofproto_mutex) +{ + ovs_mutex_lock(&ofproto_mutex); + remove_rule_rcu__(rule); + ovs_mutex_unlock(&ofproto_mutex); +} + +/* Removes and deletes rules from a NULL-terminated array of rule pointers. */ +static void +remove_rules_rcu(struct rule **rules) + OVS_EXCLUDED(ofproto_mutex) +{ + struct rule **orig_rules = rules; + + if (*rules) { + struct ofproto *ofproto = rules[0]->ofproto; + unsigned long tables[BITMAP_N_LONGS(256)]; + struct rule *rule; + size_t table_id; + + memset(tables, 0, sizeof tables); + + ovs_mutex_lock(&ofproto_mutex); + while ((rule = *rules++)) { + /* Defer once for each new table. This defers the subtable cleanup + * until later, so that when removing large number of flows the + * operation is faster. */ + if (!bitmap_is_set(tables, rule->table_id)) { + struct classifier *cls = &ofproto->tables[rule->table_id].cls; + + bitmap_set1(tables, rule->table_id); + classifier_defer(cls); + } + remove_rule_rcu__(rule); + } + + BITMAP_FOR_EACH_1(table_id, 256, tables) { + struct classifier *cls = &ofproto->tables[table_id].cls; + + classifier_publish(cls); + } + ovs_mutex_unlock(&ofproto_mutex); + } + + free(orig_rules); +} + +void +ofproto_group_ref(struct ofgroup *group) +{ + if (group) { + ovs_refcount_ref(&group->ref_count); + } +} + +void +ofproto_group_unref(struct ofgroup *group) +{ + if (group && ovs_refcount_unref(&group->ref_count) == 1) { + group->ofproto->ofproto_class->group_destruct(group); + ofputil_bucket_list_destroy(&group->buckets); + group->ofproto->ofproto_class->group_dealloc(group); + } +} + static uint32_t get_provider_meter_id(const struct ofproto *, uint32_t of_meter_id); /* Creates and returns a new 'struct rule_actions', whose actions are a copy * of from the 'ofpacts_len' bytes of 'ofpacts'. */ const struct rule_actions * -rule_actions_create(const struct ofproto *ofproto, - const struct ofpact *ofpacts, size_t ofpacts_len) +rule_actions_create(const struct ofpact *ofpacts, size_t ofpacts_len) { struct rule_actions *actions; actions = xmalloc(sizeof *actions + ofpacts_len); actions->ofpacts_len = ofpacts_len; - actions->provider_meter_id - = get_provider_meter_id(ofproto, - ofpacts_get_meter(ofpacts, ofpacts_len)); + actions->has_meter = ofpacts_get_meter(ofpacts, ofpacts_len) != 0; memcpy(actions->ofpacts, ofpacts, ofpacts_len); + actions->has_learn_with_delete = (next_learn_with_delete(actions, NULL) + != NULL); + return actions; } @@ -2649,7 +2915,7 @@ /* Returns true if 'rule' has an OpenFlow OFPAT_OUTPUT or OFPAT_ENQUEUE action * that outputs to 'port' (output to OFPP_FLOOD and OFPP_ALL doesn't count). */ -static bool +bool ofproto_rule_has_out_port(const struct rule *rule, ofp_port_t port) OVS_REQUIRES(ofproto_mutex) { @@ -2676,30 +2942,6 @@ } } -/* Returns true if a rule related to 'op' has an OpenFlow OFPAT_OUTPUT or - * OFPAT_ENQUEUE action that outputs to 'out_port'. */ -bool -ofoperation_has_out_port(const struct ofoperation *op, ofp_port_t out_port) - OVS_REQUIRES(ofproto_mutex) -{ - if (ofproto_rule_has_out_port(op->rule, out_port)) { - return true; - } - - switch (op->type) { - case OFOPERATION_ADD: - case OFOPERATION_DELETE: - return false; - - case OFOPERATION_MODIFY: - case OFOPERATION_REPLACE: - return ofpacts_output_to_port(op->actions->ofpacts, - op->actions->ofpacts_len, out_port); - } - - OVS_NOT_REACHED(); -} - static void rule_execute_destroy(struct rule_execute *e) { @@ -2715,13 +2957,13 @@ OVS_EXCLUDED(ofproto_mutex) { struct rule_execute *e, *next; - struct list executes; + struct ovs_list executes; guarded_list_pop_all(&ofproto->rule_executes, &executes); LIST_FOR_EACH_SAFE (e, next, list_node, &executes) { struct flow flow; - flow_extract(e->packet, NULL, &flow); + flow_extract(e->packet, &flow); flow.in_port.ofp_port = e->in_port; ofproto->ofproto_class->rule_execute(e->rule, &flow, e->packet); @@ -2735,44 +2977,134 @@ destroy_rule_executes(struct ofproto *ofproto) { struct rule_execute *e, *next; - struct list executes; + struct ovs_list executes; guarded_list_pop_all(&ofproto->rule_executes, &executes); LIST_FOR_EACH_SAFE (e, next, list_node, &executes) { - ofpbuf_delete(e->packet); + dp_packet_delete(e->packet); rule_execute_destroy(e); } } -/* Returns true if 'rule' should be hidden from the controller. - * - * Rules with priority higher than UINT16_MAX are set up by ofproto itself - * (e.g. by in-band control) and are intentionally hidden from the - * controller. */ static bool -ofproto_rule_is_hidden(const struct rule *rule) +rule_is_readonly(const struct rule *rule) { - return (rule->cr.priority > UINT16_MAX); + const struct oftable *table = &rule->ofproto->tables[rule->table_id]; + return (table->flags & OFTABLE_READONLY) != 0; +} + +static uint32_t +hash_learned_cookie(ovs_be64 cookie_, uint8_t table_id) +{ + uint64_t cookie = (OVS_FORCE uint64_t) cookie_; + return hash_3words(cookie, cookie >> 32, table_id); } -static bool -oftable_is_modifiable(const struct oftable *table, - enum ofputil_flow_mod_flags flags) +static void +learned_cookies_update_one__(struct ofproto *ofproto, + const struct ofpact_learn *learn, + int delta, struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex) { - if (flags & OFPUTIL_FF_NO_READONLY) { - return true; + uint32_t hash = hash_learned_cookie(learn->cookie, learn->table_id); + struct learned_cookie *c; + + HMAP_FOR_EACH_WITH_HASH (c, u.hmap_node, hash, &ofproto->learned_cookies) { + if (c->cookie == learn->cookie && c->table_id == learn->table_id) { + c->n += delta; + ovs_assert(c->n >= 0); + + if (!c->n) { + hmap_remove(&ofproto->learned_cookies, &c->u.hmap_node); + list_push_back(dead_cookies, &c->u.list_node); + } + + return; + } + } + + ovs_assert(delta > 0); + c = xmalloc(sizeof *c); + hmap_insert(&ofproto->learned_cookies, &c->u.hmap_node, hash); + c->cookie = learn->cookie; + c->table_id = learn->table_id; + c->n = delta; +} + +static const struct ofpact_learn * +next_learn_with_delete(const struct rule_actions *actions, + const struct ofpact_learn *start) +{ + const struct ofpact *pos; + + for (pos = start ? ofpact_next(&start->ofpact) : actions->ofpacts; + pos < ofpact_end(actions->ofpacts, actions->ofpacts_len); + pos = ofpact_next(pos)) { + if (pos->type == OFPACT_LEARN) { + const struct ofpact_learn *learn = ofpact_get_LEARN(pos); + if (learn->flags & NX_LEARN_F_DELETE_LEARNED) { + return learn; + } + } } - return !(table->flags & OFTABLE_READONLY); + return NULL; } -static bool -rule_is_modifiable(const struct rule *rule, enum ofputil_flow_mod_flags flags) +static void +learned_cookies_update__(struct ofproto *ofproto, + const struct rule_actions *actions, + int delta, struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex) +{ + if (actions->has_learn_with_delete) { + const struct ofpact_learn *learn; + + for (learn = next_learn_with_delete(actions, NULL); learn; + learn = next_learn_with_delete(actions, learn)) { + learned_cookies_update_one__(ofproto, learn, delta, dead_cookies); + } + } +} + +static void +learned_cookies_inc(struct ofproto *ofproto, + const struct rule_actions *actions) + OVS_REQUIRES(ofproto_mutex) +{ + learned_cookies_update__(ofproto, actions, +1, NULL); +} + +static void +learned_cookies_dec(struct ofproto *ofproto, + const struct rule_actions *actions, + struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex) +{ + learned_cookies_update__(ofproto, actions, -1, dead_cookies); +} + +static void +learned_cookies_flush(struct ofproto *ofproto, struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex) { - const struct oftable *rule_table; + struct learned_cookie *c; - rule_table = &rule->ofproto->tables[rule->table_id]; - return oftable_is_modifiable(rule_table, flags); + LIST_FOR_EACH_POP (c, u.list_node, dead_cookies) { + struct rule_criteria criteria; + struct rule_collection rules; + struct match match; + + match_init_catchall(&match); + rule_criteria_init(&criteria, c->table_id, &match, 0, CLS_MAX_VERSION, + c->cookie, OVS_BE64_MAX, OFPP_ANY, OFPG_ANY); + rule_criteria_require_rw(&criteria, false); + collect_rules_loose(ofproto, &criteria, &rules); + rule_criteria_destroy(&criteria); + delete_flows__(&rules, OFPRR_DELETE, NULL); + + free(c); + } } static enum ofperr @@ -2782,6 +3114,106 @@ return 0; } +static void +query_tables(struct ofproto *ofproto, + struct ofputil_table_features **featuresp, + struct ofputil_table_stats **statsp) +{ + struct mf_bitmap rw_fields = oxm_writable_fields(); + struct mf_bitmap match = oxm_matchable_fields(); + struct mf_bitmap mask = oxm_maskable_fields(); + + struct ofputil_table_features *features; + struct ofputil_table_stats *stats; + int i; + + features = *featuresp = xcalloc(ofproto->n_tables, sizeof *features); + for (i = 0; i < ofproto->n_tables; i++) { + struct ofputil_table_features *f = &features[i]; + + f->table_id = i; + sprintf(f->name, "table%d", i); + f->metadata_match = OVS_BE64_MAX; + f->metadata_write = OVS_BE64_MAX; + atomic_read_relaxed(&ofproto->tables[i].miss_config, &f->miss_config); + f->max_entries = 1000000; + + bool more_tables = false; + for (int j = i + 1; j < ofproto->n_tables; j++) { + if (!(ofproto->tables[j].flags & OFTABLE_HIDDEN)) { + bitmap_set1(f->nonmiss.next, j); + more_tables = true; + } + } + f->nonmiss.instructions = (1u << N_OVS_INSTRUCTIONS) - 1; + if (!more_tables) { + f->nonmiss.instructions &= ~(1u << OVSINST_OFPIT11_GOTO_TABLE); + } + f->nonmiss.write.ofpacts = (UINT64_C(1) << N_OFPACTS) - 1; + f->nonmiss.write.set_fields = rw_fields; + f->nonmiss.apply = f->nonmiss.write; + f->miss = f->nonmiss; + + f->match = match; + f->mask = mask; + f->wildcard = match; + } + + if (statsp) { + stats = *statsp = xcalloc(ofproto->n_tables, sizeof *stats); + for (i = 0; i < ofproto->n_tables; i++) { + struct ofputil_table_stats *s = &stats[i]; + + s->table_id = i; + s->active_count = ofproto->tables[i].n_flows; + if (i == 0) { + s->active_count -= connmgr_count_hidden_rules( + ofproto->connmgr); + } + } + } else { + stats = NULL; + } + + ofproto->ofproto_class->query_tables(ofproto, features, stats); + + for (i = 0; i < ofproto->n_tables; i++) { + const struct oftable *table = &ofproto->tables[i]; + struct ofputil_table_features *f = &features[i]; + + if (table->name) { + ovs_strzcpy(f->name, table->name, sizeof f->name); + } + + if (table->max_flows < f->max_entries) { + f->max_entries = table->max_flows; + } + } +} + +static void +query_switch_features(struct ofproto *ofproto, + bool *arp_match_ip, uint64_t *ofpacts) +{ + struct ofputil_table_features *features, *f; + + *arp_match_ip = false; + *ofpacts = 0; + + query_tables(ofproto, &features, NULL); + for (f = features; f < &features[ofproto->n_tables]; f++) { + *ofpacts |= f->nonmiss.apply.ofpacts | f->miss.apply.ofpacts; + if (bitmap_is_set(f->match.bm, MFF_ARP_SPA) || + bitmap_is_set(f->match.bm, MFF_ARP_TPA)) { + *arp_match_ip = true; + } + } + free(features); + + /* Sanity check. */ + ovs_assert(*ofpacts & (UINT64_C(1) << OFPACT_OUTPUT)); +} + static enum ofperr handle_features_request(struct ofconn *ofconn, const struct ofp_header *oh) { @@ -2791,15 +3223,14 @@ bool arp_match_ip; struct ofpbuf *b; - ofproto->ofproto_class->get_features(ofproto, &arp_match_ip, - &features.actions); - ovs_assert(features.actions & OFPUTIL_A_OUTPUT); /* sanity check */ + query_switch_features(ofproto, &arp_match_ip, &features.ofpacts); features.datapath_id = ofproto->datapath_id; features.n_buffers = pktbuf_capacity(); features.n_tables = ofproto_get_n_visible_tables(ofproto); features.capabilities = (OFPUTIL_C_FLOW_STATS | OFPUTIL_C_TABLE_STATS | - OFPUTIL_C_PORT_STATS | OFPUTIL_C_QUEUE_STATS); + OFPUTIL_C_PORT_STATS | OFPUTIL_C_QUEUE_STATS | + OFPUTIL_C_GROUP_STATS); if (arp_match_ip) { features.capabilities |= OFPUTIL_C_ARP_MATCH_IP; } @@ -2882,7 +3313,7 @@ { if (ofconn_get_type(ofconn) == OFCONN_PRIMARY && ofconn_get_role(ofconn) == OFPCR12_ROLE_SLAVE) { - return OFPERR_OFPBRC_EPERM; + return OFPERR_OFPBRC_IS_SLAVE; } else { return 0; } @@ -2923,7 +3354,7 @@ { struct ofproto *p = ofconn_get_ofproto(ofconn); struct ofputil_packet_out po; - struct ofpbuf *payload; + struct dp_packet *payload; uint64_t ofpacts_stub[1024 / 8]; struct ofpbuf ofpacts; struct flow flow; @@ -2956,18 +3387,18 @@ } } else { /* Ensure that the L3 header is 32-bit aligned. */ - payload = ofpbuf_clone_data_with_headroom(po.packet, po.packet_len, 2); + payload = dp_packet_clone_data_with_headroom(po.packet, po.packet_len, 2); } /* Verify actions against packet, then send packet if successful. */ - flow_extract(payload, NULL, &flow); + flow_extract(payload, &flow); flow.in_port.ofp_port = po.in_port; error = ofproto_check_ofpacts(p, po.ofpacts, po.ofpacts_len); if (!error) { error = p->ofproto_class->packet_out(p, payload, &flow, po.ofpacts, po.ofpacts_len); } - ofpbuf_delete(payload); + dp_packet_delete(payload); exit_free_ofpacts: ofpbuf_uninit(&ofpacts); @@ -3001,9 +3432,34 @@ } static enum ofperr -handle_port_mod(struct ofconn *ofconn, const struct ofp_header *oh) +port_mod_start(struct ofconn *ofconn, struct ofputil_port_mod *pm, + struct ofport **port) { struct ofproto *p = ofconn_get_ofproto(ofconn); + + *port = ofproto_get_port(p, pm->port_no); + if (!*port) { + return OFPERR_OFPPMFC_BAD_PORT; + } + if (!eth_addr_equals((*port)->pp.hw_addr, pm->hw_addr)) { + return OFPERR_OFPPMFC_BAD_HW_ADDR; + } + return 0; +} + +static void +port_mod_finish(struct ofconn *ofconn, struct ofputil_port_mod *pm, + struct ofport *port) +{ + update_port_config(ofconn, port, pm->config, pm->mask); + if (pm->advertise) { + netdev_set_advertisements(port->netdev, pm->advertise); + } +} + +static enum ofperr +handle_port_mod(struct ofconn *ofconn, const struct ofp_header *oh) +{ struct ofputil_port_mod pm; struct ofport *port; enum ofperr error; @@ -3018,18 +3474,11 @@ return error; } - port = ofproto_get_port(p, pm.port_no); - if (!port) { - return OFPERR_OFPPMFC_BAD_PORT; - } else if (!eth_addr_equals(port->pp.hw_addr, pm.hw_addr)) { - return OFPERR_OFPPMFC_BAD_HW_ADDR; - } else { - update_port_config(ofconn, port, pm.config, pm.mask); - if (pm.advertise) { - netdev_set_advertisements(port->netdev, pm.advertise); - } + error = port_mod_start(ofconn, &pm, &port); + if (!error) { + port_mod_finish(ofconn, &pm, port); } - return 0; + return error; } static enum ofperr @@ -3068,69 +3517,61 @@ handle_table_stats_request(struct ofconn *ofconn, const struct ofp_header *request) { - struct ofproto *p = ofconn_get_ofproto(ofconn); - struct ofp12_table_stats *ots; - struct ofpbuf *msg; - int n_tables; + struct ofproto *ofproto = ofconn_get_ofproto(ofconn); + struct ofputil_table_features *features; + struct ofputil_table_stats *stats; + struct ofpbuf *reply; size_t i; - /* Set up default values. - * - * ofp12_table_stats is used as a generic structure as - * it is able to hold all the fields for ofp10_table_stats - * and ofp11_table_stats (and of course itself). - */ - ots = xcalloc(p->n_tables, sizeof *ots); - for (i = 0; i < p->n_tables; i++) { - ots[i].table_id = i; - sprintf(ots[i].name, "table%"PRIuSIZE, i); - ots[i].match = htonll(OFPXMT13_MASK); - ots[i].wildcards = htonll(OFPXMT13_MASK); - ots[i].write_actions = htonl(OFPAT11_OUTPUT); - ots[i].apply_actions = htonl(OFPAT11_OUTPUT); - ots[i].write_setfields = htonll(OFPXMT13_MASK); - ots[i].apply_setfields = htonll(OFPXMT13_MASK); - ots[i].metadata_match = OVS_BE64_MAX; - ots[i].metadata_write = OVS_BE64_MAX; - ots[i].instructions = htonl(OFPIT11_ALL); - ots[i].config = htonl(OFPTC11_TABLE_MISS_MASK); - ots[i].max_entries = htonl(1000000); /* An arbitrary big number. */ - fat_rwlock_rdlock(&p->tables[i].cls.rwlock); - ots[i].active_count = htonl(classifier_count(&p->tables[i].cls)); - fat_rwlock_unlock(&p->tables[i].cls.rwlock); - } - - p->ofproto_class->get_tables(p, ots); - - /* Post-process the tables, dropping hidden tables. */ - n_tables = p->n_tables; - for (i = 0; i < p->n_tables; i++) { - const struct oftable *table = &p->tables[i]; + query_tables(ofproto, &features, &stats); - if (table->flags & OFTABLE_HIDDEN) { - n_tables = i; - break; + reply = ofputil_encode_table_stats_reply(request); + for (i = 0; i < ofproto->n_tables; i++) { + if (!(ofproto->tables[i].flags & OFTABLE_HIDDEN)) { + ofputil_append_table_stats_reply(reply, &stats[i], &features[i]); } + } + ofconn_send_reply(ofconn, reply); - if (table->name) { - ovs_strzcpy(ots[i].name, table->name, sizeof ots[i].name); - } + free(features); + free(stats); - if (table->max_flows < ntohl(ots[i].max_entries)) { - ots[i].max_entries = htonl(table->max_flows); - } + return 0; +} + +static enum ofperr +handle_table_features_request(struct ofconn *ofconn, + const struct ofp_header *request) +{ + struct ofproto *ofproto = ofconn_get_ofproto(ofconn); + struct ofputil_table_features *features; + struct ovs_list replies; + struct ofpbuf msg; + size_t i; + + ofpbuf_use_const(&msg, request, ntohs(request->length)); + ofpraw_pull_assert(&msg); + if (msg.size || ofpmp_more(request)) { + return OFPERR_OFPTFFC_EPERM; } - msg = ofputil_encode_table_stats_reply(ots, n_tables, request); - ofconn_send_reply(ofconn, msg); + query_tables(ofproto, &features, NULL); + + ofpmp_init(&replies, request); + for (i = 0; i < ofproto->n_tables; i++) { + if (!(ofproto->tables[i].flags & OFTABLE_HIDDEN)) { + ofputil_append_table_features_reply(&features[i], &replies); + } + } + ofconn_send_replies(ofconn, &replies); - free(ots); + free(features); return 0; } static void -append_port_stat(struct ofport *port, struct list *replies) +append_port_stat(struct ofport *port, struct ovs_list *replies) { struct ofputil_port_stats ops = { .port_no = port->pp.port_no }; @@ -3148,11 +3589,11 @@ static void handle_port_request(struct ofconn *ofconn, const struct ofp_header *request, ofp_port_t port_no, - void (*cb)(struct ofport *, struct list *replies)) + void (*cb)(struct ofport *, struct ovs_list *replies)) { struct ofproto *ofproto = ofconn_get_ofproto(ofconn); struct ofport *port; - struct list replies; + struct ovs_list replies; ofpmp_init(&replies, request); if (port_no != OFPP_ANY) { @@ -3184,7 +3625,7 @@ } static void -append_port_desc(struct ofport *port, struct list *replies) +append_port_desc(struct ofport *port, struct ovs_list *replies) { ofputil_append_port_desc_stats_reply(&port->pp, replies); } @@ -3225,22 +3666,6 @@ } static void -ofproto_rule_change_cookie(struct ofproto *ofproto, struct rule *rule, - ovs_be64 new_cookie) - OVS_REQUIRES(ofproto_mutex) -{ - if (new_cookie != rule->flow_cookie) { - cookies_remove(ofproto, rule); - - ovs_mutex_lock(&rule->mutex); - rule->flow_cookie = new_cookie; - ovs_mutex_unlock(&rule->mutex); - - cookies_insert(ofproto, rule); - } -} - -static void calc_duration(long long int start, long long int now, uint32_t *sec, uint32_t *nsec) { @@ -3317,20 +3742,51 @@ /* Initializes 'criteria' in a straightforward way based on the other * parameters. * + * By default, the criteria include flows that are read-only, on the assumption + * that the collected flows won't be modified. Call rule_criteria_require_rw() + * if flows will be modified. + * * For "loose" matching, the 'priority' parameter is unimportant and may be * supplied as 0. */ static void rule_criteria_init(struct rule_criteria *criteria, uint8_t table_id, - const struct match *match, unsigned int priority, - ovs_be64 cookie, ovs_be64 cookie_mask, - ofp_port_t out_port, uint32_t out_group) + const struct match *match, int priority, + cls_version_t version, ovs_be64 cookie, + ovs_be64 cookie_mask, ofp_port_t out_port, + uint32_t out_group) { criteria->table_id = table_id; - cls_rule_init(&criteria->cr, match, priority); + cls_rule_init(&criteria->cr, match, priority, version); criteria->cookie = cookie; criteria->cookie_mask = cookie_mask; criteria->out_port = out_port; criteria->out_group = out_group; + + /* We ordinarily want to skip hidden rules, but there has to be a way for + * code internal to OVS to modify and delete them, so if the criteria + * specify a priority that can only be for a hidden flow, then allow hidden + * rules to be selected. (This doesn't allow OpenFlow clients to meddle + * with hidden flows because OpenFlow uses only a 16-bit field to specify + * priority.) */ + criteria->include_hidden = priority > UINT16_MAX; + + /* We assume that the criteria are being used to collect flows for reading + * but not modification. Thus, we should collect read-only flows. */ + criteria->include_readonly = true; +} + +/* By default, criteria initialized by rule_criteria_init() will match flows + * that are read-only, on the assumption that the collected flows won't be + * modified. Call this function to match only flows that are be modifiable. + * + * Specify 'can_write_readonly' as false in ordinary circumstances, true if the + * caller has special privileges that allow it to modify even "read-only" + * flows. */ +static void +rule_criteria_require_rw(struct rule_criteria *criteria, + bool can_write_readonly) +{ + criteria->include_readonly = can_write_readonly; } static void @@ -3389,37 +3845,77 @@ } } +/* Returns a NULL-terminated array of rule pointers, + * destroys 'rules'. */ +static struct rule ** +rule_collection_detach(struct rule_collection *rules) +{ + struct rule **rule_array; + + rule_collection_add(rules, NULL); + + if (rules->rules == rules->stub) { + rules->rules = xmemdup(rules->rules, rules->n * sizeof *rules->rules); + } + + rule_array = rules->rules; + rule_collection_init(rules); + + return rule_array; +} + void rule_collection_destroy(struct rule_collection *rules) { if (rules->rules != rules->stub) { free(rules->rules); } + + /* Make repeated destruction harmless. */ + rule_collection_init(rules); } -static enum ofperr -collect_rule(struct rule *rule, const struct rule_criteria *c, - struct rule_collection *rules) +/* Schedules postponed removal of rules, destroys 'rules'. */ +static void +rule_collection_remove_postponed(struct rule_collection *rules) OVS_REQUIRES(ofproto_mutex) { - /* We ordinarily want to skip hidden rules, but there has to be a way for - * code internal to OVS to modify and delete them, so if the criteria - * specify a priority that can only be for a hidden flow, then allow hidden - * rules to be selected. (This doesn't allow OpenFlow clients to meddle - * with hidden flows because OpenFlow uses only a 16-bit field to specify - * priority.) */ - if (ofproto_rule_is_hidden(rule) && c->cr.priority <= UINT16_MAX) { - return 0; - } else if (rule->pending) { - return OFPROTO_POSTPONE; - } else { - if ((c->table_id == rule->table_id || c->table_id == 0xff) - && ofproto_rule_has_out_port(rule, c->out_port) - && ofproto_rule_has_out_group(rule, c->out_group) - && !((rule->flow_cookie ^ c->cookie) & c->cookie_mask)) { + if (rules->n > 0) { + if (rules->n == 1) { + ovsrcu_postpone(remove_rule_rcu, rules->rules[0]); + } else { + ovsrcu_postpone(remove_rules_rcu, rule_collection_detach(rules)); + } + } +} + +/* Checks whether 'rule' matches 'c' and, if so, adds it to 'rules'. This + * function verifies most of the criteria in 'c' itself, but the caller must + * check 'c->cr' itself. + * + * Rules that have already been marked for removal are not collected. + * + * Increments '*n_readonly' if 'rule' wasn't added because it's read-only (and + * 'c' only includes modifiable rules). */ +static void +collect_rule(struct rule *rule, const struct rule_criteria *c, + struct rule_collection *rules, size_t *n_readonly) + OVS_REQUIRES(ofproto_mutex) +{ + if ((c->table_id == rule->table_id || c->table_id == 0xff) + && ofproto_rule_has_out_port(rule, c->out_port) + && ofproto_rule_has_out_group(rule, c->out_group) + && !((rule->flow_cookie ^ c->cookie) & c->cookie_mask) + && (!rule_is_hidden(rule) || c->include_hidden) + && cls_rule_visible_in_version(&rule->cr, c->cr.version)) { + /* Rule matches all the criteria... */ + if (!rule_is_readonly(rule) || c->include_readonly) { + /* ...add it. */ rule_collection_add(rules, rule); + } else { + /* ...except it's read-only. */ + ++*n_readonly; } - return 0; } } @@ -3428,8 +3924,6 @@ * OFPFC_MODIFY and OFPFC_DELETE requests. Puts the selected rules on list * 'rules'. * - * Hidden rules are always omitted. - * * Returns 0 on success, otherwise an OpenFlow error code. */ static enum ofperr collect_rules_loose(struct ofproto *ofproto, @@ -3439,6 +3933,7 @@ { struct oftable *table; enum ofperr error = 0; + size_t n_readonly = 0; rule_collection_init(rules); @@ -3454,30 +3949,25 @@ hash_cookie(criteria->cookie), &ofproto->cookies) { if (cls_rule_is_loose_match(&rule->cr, &criteria->cr.match)) { - error = collect_rule(rule, criteria, rules); - if (error) { - break; - } + collect_rule(rule, criteria, rules, &n_readonly); } } } else { FOR_EACH_MATCHING_TABLE (table, criteria->table_id, ofproto) { - struct cls_cursor cursor; struct rule *rule; - fat_rwlock_rdlock(&table->cls.rwlock); - cls_cursor_init(&cursor, &table->cls, &criteria->cr); - CLS_CURSOR_FOR_EACH (rule, cr, &cursor) { - error = collect_rule(rule, criteria, rules); - if (error) { - break; - } + CLS_FOR_EACH_TARGET (rule, cr, &table->cls, &criteria->cr) { + collect_rule(rule, criteria, rules, &n_readonly); } - fat_rwlock_unlock(&table->cls.rwlock); } } exit: + if (!error && !rules->n && n_readonly) { + /* We didn't find any rules to modify. We did find some read-only + * rules that we're not allowed to modify, so report that. */ + error = OFPERR_OFPBRC_EPERM; + } if (error) { rule_collection_destroy(rules); } @@ -3489,8 +3979,6 @@ * OFPFC_MODIFY_STRICT and OFPFC_DELETE_STRICT requests. Puts the selected * rules on list 'rules'. * - * Hidden rules are always omitted. - * * Returns 0 on success, otherwise an OpenFlow error code. */ static enum ofperr collect_rules_strict(struct ofproto *ofproto, @@ -3499,7 +3987,8 @@ OVS_REQUIRES(ofproto_mutex) { struct oftable *table; - int error = 0; + size_t n_readonly = 0; + enum ofperr error = 0; rule_collection_init(rules); @@ -3515,30 +4004,27 @@ hash_cookie(criteria->cookie), &ofproto->cookies) { if (cls_rule_equal(&rule->cr, &criteria->cr)) { - error = collect_rule(rule, criteria, rules); - if (error) { - break; - } + collect_rule(rule, criteria, rules, &n_readonly); } } } else { FOR_EACH_MATCHING_TABLE (table, criteria->table_id, ofproto) { struct rule *rule; - fat_rwlock_rdlock(&table->cls.rwlock); rule = rule_from_cls_rule(classifier_find_rule_exactly( &table->cls, &criteria->cr)); - fat_rwlock_unlock(&table->cls.rwlock); if (rule) { - error = collect_rule(rule, criteria, rules); - if (error) { - break; - } + collect_rule(rule, criteria, rules, &n_readonly); } } } exit: + if (!error && !rules->n && n_readonly) { + /* We didn't find any rules to modify. We did find some read-only + * rules that we're not allowed to modify, so report that. */ + error = OFPERR_OFPBRC_EPERM; + } if (error) { rule_collection_destroy(rules); } @@ -3564,7 +4050,7 @@ struct ofputil_flow_stats_request fsr; struct rule_criteria criteria; struct rule_collection rules; - struct list replies; + struct ovs_list replies; enum ofperr error; size_t i; @@ -3573,8 +4059,9 @@ return error; } - rule_criteria_init(&criteria, fsr.table_id, &fsr.match, 0, fsr.cookie, - fsr.cookie_mask, fsr.out_port, fsr.out_group); + rule_criteria_init(&criteria, fsr.table_id, &fsr.match, 0, CLS_MAX_VERSION, + fsr.cookie, fsr.cookie_mask, fsr.out_port, + fsr.out_group); ovs_mutex_lock(&ofproto_mutex); error = collect_rules_loose(ofproto, &criteria, &rules); @@ -3601,6 +4088,7 @@ fs.cookie = rule->flow_cookie; fs.idle_timeout = rule->idle_timeout; fs.hard_timeout = rule->hard_timeout; + fs.importance = rule->importance; created = rule->created; modified = rule->modified; actions = rule_get_actions(rule); @@ -3669,15 +4157,11 @@ struct oftable *table; OFPROTO_FOR_EACH_TABLE (table, p) { - struct cls_cursor cursor; struct rule *rule; - fat_rwlock_rdlock(&table->cls.rwlock); - cls_cursor_init(&cursor, &table->cls, NULL); - CLS_CURSOR_FOR_EACH (rule, cr, &cursor) { + CLS_FOR_EACH (rule, cr, &table->cls) { flow_stats_ds(rule, results); } - fat_rwlock_unlock(&table->cls.rwlock); } } @@ -3690,23 +4174,32 @@ ofproto->ofproto_class->get_netflow_ids(ofproto, engine_type, engine_id); } -/* Checks the status of CFM configured on 'ofp_port' within 'ofproto' and stores - * the port's CFM status in '*status'. If 'force' is set to true, status will - * be returned even if there is no status change since last update. - * - * Returns 0 on success. Returns a negative number if there is no status - * change since last update and 'force' is set to false. Returns positive errno - * if the port did not have CFM configured. +/* Checks the status change of CFM on 'ofport'. + * + * Returns true if 'ofproto_class' does not support 'cfm_status_changed'. */ +bool +ofproto_port_cfm_status_changed(struct ofproto *ofproto, ofp_port_t ofp_port) +{ + struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); + return (ofport && ofproto->ofproto_class->cfm_status_changed + ? ofproto->ofproto_class->cfm_status_changed(ofport) + : true); +} + +/* Checks the status of CFM configured on 'ofp_port' within 'ofproto'. + * Returns 0 if the port's CFM status was successfully stored into + * '*status'. Returns positive errno if the port did not have CFM + * configured. * * The caller must provide and own '*status', and must free 'status->rmps'. * '*status' is indeterminate if the return value is non-zero. */ int ofproto_port_get_cfm_status(const struct ofproto *ofproto, ofp_port_t ofp_port, - bool force, struct ofproto_cfm_status *status) + struct cfm_status *status) { struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); return (ofport && ofproto->ofproto_class->get_cfm_status - ? ofproto->ofproto_class->get_cfm_status(ofport, force, status) + ? ofproto->ofproto_class->get_cfm_status(ofport, status) : EOPNOTSUPP); } @@ -3731,7 +4224,7 @@ } rule_criteria_init(&criteria, request.table_id, &request.match, 0, - request.cookie, request.cookie_mask, + CLS_MAX_VERSION, request.cookie, request.cookie_mask, request.out_port, request.out_group); ovs_mutex_lock(&ofproto_mutex); @@ -3789,7 +4282,7 @@ struct queue_stats_cbdata { struct ofport *ofport; - struct list replies; + struct ovs_list replies; long long int now; }; @@ -3885,80 +4378,94 @@ return error; } -static bool -is_flow_deletion_pending(const struct ofproto *ofproto, - const struct cls_rule *cls_rule, - uint8_t table_id) +static enum ofperr +evict_rules_from_table(struct oftable *table) OVS_REQUIRES(ofproto_mutex) { - if (!hmap_is_empty(&ofproto->deletions)) { - struct ofoperation *op; - - HMAP_FOR_EACH_WITH_HASH (op, hmap_node, - cls_rule_hash(cls_rule, table_id), - &ofproto->deletions) { - if (op->rule->table_id == table_id - && cls_rule_equal(cls_rule, &op->rule->cr)) { - return true; - } + enum ofperr error = 0; + struct rule_collection rules; + unsigned int count = table->n_flows; + unsigned int max_flows = table->max_flows; + + rule_collection_init(&rules); + + while (count-- > max_flows) { + struct rule *rule; + + if (!choose_rule_to_evict(table, &rule)) { + error = OFPERR_OFPFMFC_TABLE_FULL; + break; + } else { + eviction_group_remove_rule(rule); + rule_collection_add(&rules, rule); } } + delete_flows__(&rules, OFPRR_EVICTION, NULL); - return false; + return error; } static bool -should_evict_a_rule(struct oftable *table, unsigned int extra_space) - OVS_REQUIRES(ofproto_mutex) - OVS_NO_THREAD_SAFETY_ANALYSIS +is_conjunction(const struct ofpact *ofpacts, size_t ofpacts_len) { - return classifier_count(&table->cls) + extra_space > table->max_flows; + return ofpacts_len > 0 && ofpacts->type == OFPACT_CONJUNCTION; } -static enum ofperr -evict_rules_from_table(struct ofproto *ofproto, struct oftable *table, - unsigned int extra_space) +static void +get_conjunctions(const struct ofputil_flow_mod *fm, + struct cls_conjunction **conjsp, size_t *n_conjsp) OVS_REQUIRES(ofproto_mutex) { - while (should_evict_a_rule(table, extra_space)) { - struct rule *rule; + struct cls_conjunction *conjs = NULL; + int n_conjs = 0; - if (!choose_rule_to_evict(table, &rule)) { - return OFPERR_OFPFMFC_TABLE_FULL; - } else if (rule->pending) { - return OFPROTO_POSTPONE; - } else { - struct ofopgroup *group = ofopgroup_create_unattached(ofproto); - delete_flow__(rule, group, OFPRR_EVICTION); - ofopgroup_submit(group); + if (is_conjunction(fm->ofpacts, fm->ofpacts_len)) { + const struct ofpact *ofpact; + int i; + + n_conjs = 0; + OFPACT_FOR_EACH (ofpact, fm->ofpacts, fm->ofpacts_len) { + n_conjs++; + } + + conjs = xzalloc(n_conjs * sizeof *conjs); + i = 0; + OFPACT_FOR_EACH (ofpact, fm->ofpacts, fm->ofpacts_len) { + struct ofpact_conjunction *oc = ofpact_get_CONJUNCTION(ofpact); + conjs[i].clause = oc->clause; + conjs[i].n_clauses = oc->n_clauses; + conjs[i].id = oc->id; + i++; } } - return 0; + *conjsp = conjs; + *n_conjsp = n_conjs; } /* Implements OFPFC_ADD and the cases for OFPFC_MODIFY and OFPFC_MODIFY_STRICT * in which no matching flow already exists in the flow table. * - * Adds the flow specified by 'ofm', which is followed by 'n_actions' - * ofp_actions, to the ofproto's flow table. Returns 0 on success, an OpenFlow - * error code on failure, or OFPROTO_POSTPONE if the operation cannot be - * initiated now but may be retried later. + * Adds the flow specified by 'fm', to the ofproto's flow table. Returns 0 on + * success, or an OpenFlow error code on failure. * - * The caller retains ownership of 'fm->ofpacts'. + * On successful return the caller must complete the operation either by + * calling add_flow_finish(), or add_flow_revert() if the operation needs to + * be reverted. * - * 'ofconn' is used to retrieve the packet buffer specified in ofm->buffer_id, - * if any. */ + * The caller retains ownership of 'fm->ofpacts'. */ static enum ofperr -add_flow(struct ofproto *ofproto, struct ofconn *ofconn, - struct ofputil_flow_mod *fm, const struct ofp_header *request) +add_flow_start(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct rule **old_rule, struct rule **new_rule) OVS_REQUIRES(ofproto_mutex) { struct oftable *table; struct cls_rule cr; struct rule *rule; uint8_t table_id; - int error = 0; + struct cls_conjunction *conjs; + size_t n_conjs; + enum ofperr error; if (!check_table_id(ofproto, fm->table_id)) { error = OFPERR_OFPBRC_BAD_TABLE_ID; @@ -3985,85 +4492,138 @@ } table = &ofproto->tables[table_id]; - - if (!oftable_is_modifiable(table, fm->flags)) { + if (table->flags & OFTABLE_READONLY + && !(fm->flags & OFPUTIL_FF_NO_READONLY)) { return OFPERR_OFPBRC_EPERM; } - if (!(fm->flags & OFPUTIL_FF_HIDDEN_FIELDS)) { - if (!match_has_default_hidden_fields(&fm->match)) { - VLOG_WARN_RL(&rl, "%s: (add_flow) only internal flows can set " - "non-default values to hidden fields", ofproto->name); - return OFPERR_OFPBRC_EPERM; - } + if (!(fm->flags & OFPUTIL_FF_HIDDEN_FIELDS) + && !match_has_default_hidden_fields(&fm->match)) { + VLOG_WARN_RL(&rl, "%s: (add_flow) only internal flows can set " + "non-default values to hidden fields", ofproto->name); + return OFPERR_OFPBRC_EPERM; } - cls_rule_init(&cr, &fm->match, fm->priority); + cls_rule_init(&cr, &fm->match, fm->priority, ofproto->tables_version + 1); - /* Transform "add" into "modify" if there's an existing identical flow. */ - fat_rwlock_rdlock(&table->cls.rwlock); + /* Check for the existence of an identical rule. + * This will not return rules earlier marked for removal. */ rule = rule_from_cls_rule(classifier_find_rule_exactly(&table->cls, &cr)); - fat_rwlock_unlock(&table->cls.rwlock); - if (rule) { - cls_rule_destroy(&cr); - if (!rule_is_modifiable(rule, fm->flags)) { - return OFPERR_OFPBRC_EPERM; - } else if (rule->pending) { - return OFPROTO_POSTPONE; - } else { - struct rule_collection rules; - - rule_collection_init(&rules); - rule_collection_add(&rules, rule); - fm->modify_cookie = true; - error = modify_flows__(ofproto, ofconn, fm, request, &rules); - rule_collection_destroy(&rules); + *old_rule = rule; + if (!rule) { + /* Check for overlap, if requested. */ + if (fm->flags & OFPUTIL_FF_CHECK_OVERLAP + && classifier_rule_overlaps(&table->cls, &cr)) { + cls_rule_destroy(&cr); + return OFPERR_OFPFMFC_OVERLAP; + } - return error; + /* If necessary, evict an existing rule to clear out space. */ + if (table->n_flows >= table->max_flows) { + if (!choose_rule_to_evict(table, &rule)) { + error = OFPERR_OFPFMFC_TABLE_FULL; + cls_rule_destroy(&cr); + return error; + } + eviction_group_remove_rule(rule); + /* Marks '*old_rule' as an evicted rule rather than replaced rule. + */ + fm->delete_reason = OFPRR_EVICTION; + *old_rule = rule; } + } else { + fm->modify_cookie = true; } - /* Serialize against pending deletion. */ - if (is_flow_deletion_pending(ofproto, &cr, table_id)) { - cls_rule_destroy(&cr); - return OFPROTO_POSTPONE; + /* Allocate new rule. */ + error = replace_rule_create(ofproto, fm, &cr, table - ofproto->tables, + rule, new_rule); + if (error) { + return error; } - /* Check for overlap, if requested. */ - if (fm->flags & OFPUTIL_FF_CHECK_OVERLAP) { - bool overlaps; + get_conjunctions(fm, &conjs, &n_conjs); + replace_rule_start(ofproto, rule, *new_rule, conjs, n_conjs); + free(conjs); - fat_rwlock_rdlock(&table->cls.rwlock); - overlaps = classifier_rule_overlaps(&table->cls, &cr); - fat_rwlock_unlock(&table->cls.rwlock); + return 0; +} - if (overlaps) { - cls_rule_destroy(&cr); - return OFPERR_OFPFMFC_OVERLAP; - } +/* Revert the effects of add_flow_start(). */ +static void +add_flow_revert(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct rule *old_rule, struct rule *new_rule) + OVS_REQUIRES(ofproto_mutex) +{ + if (old_rule && fm->delete_reason == OFPRR_EVICTION) { + /* Revert the eviction. */ + eviction_group_add_rule(old_rule); } - /* If necessary, evict an existing rule to clear out space. */ - error = evict_rules_from_table(ofproto, table, 1); - if (error) { - cls_rule_destroy(&cr); - return error; + replace_rule_revert(ofproto, old_rule, new_rule); +} + +/* To be called after version bump. */ +static void +add_flow_finish(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + const struct flow_mod_requester *req, + struct rule *old_rule, struct rule *new_rule) + OVS_REQUIRES(ofproto_mutex) +{ + struct ovs_list dead_cookies = OVS_LIST_INITIALIZER(&dead_cookies); + + replace_rule_finish(ofproto, fm, req, old_rule, new_rule, &dead_cookies); + learned_cookies_flush(ofproto, &dead_cookies); + + if (old_rule) { + ovsrcu_postpone(remove_rule_rcu, old_rule); + } else { + if (minimask_get_vid_mask(&new_rule->cr.match.mask) == VLAN_VID_MASK) { + if (ofproto->vlan_bitmap) { + uint16_t vid = miniflow_get_vid(&new_rule->cr.match.flow); + + if (!bitmap_is_set(ofproto->vlan_bitmap, vid)) { + bitmap_set1(ofproto->vlan_bitmap, vid); + ofproto->vlans_changed = true; + } + } else { + ofproto->vlans_changed = true; + } + } + + ofmonitor_report(ofproto->connmgr, new_rule, NXFME_ADDED, 0, + req ? req->ofconn : NULL, + req ? req->request->xid : 0, NULL); } + send_buffered_packet(req, fm->buffer_id, new_rule); +} + +/* OFPFC_MODIFY and OFPFC_MODIFY_STRICT. */ + +/* Create a new rule based on attributes in 'fm', match in 'cr', 'table_id', + * and 'old_rule'. Note that the rule is NOT inserted into a any data + * structures yet. Takes ownership of 'cr'. */ +static enum ofperr +replace_rule_create(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct cls_rule *cr, uint8_t table_id, + struct rule *old_rule, struct rule **new_rule) +{ + struct rule *rule; + enum ofperr error; + /* Allocate new rule. */ rule = ofproto->ofproto_class->rule_alloc(); if (!rule) { - cls_rule_destroy(&cr); - VLOG_WARN_RL(&rl, "%s: failed to create rule (%s)", - ofproto->name, ovs_strerror(error)); - return ENOMEM; + cls_rule_destroy(cr); + VLOG_WARN_RL(&rl, "%s: failed to allocate a rule.", ofproto->name); + return OFPERR_OFPFMFC_UNKNOWN; } /* Initialize base state. */ *CONST_CAST(struct ofproto **, &rule->ofproto) = ofproto; - cls_rule_move(CONST_CAST(struct cls_rule *, &rule->cr), &cr); + cls_rule_move(CONST_CAST(struct cls_rule *, &rule->cr), cr); ovs_refcount_init(&rule->ref_count); - rule->pending = NULL; rule->flow_cookie = fm->new_cookie; rule->created = rule->modified = time_msec(); @@ -4071,12 +4631,13 @@ ovs_mutex_lock(&rule->mutex); rule->idle_timeout = fm->idle_timeout; rule->hard_timeout = fm->hard_timeout; - ovs_mutex_unlock(&rule->mutex); + rule->importance = fm->importance; + rule->removed_reason = OVS_OFPRR_NONE; - *CONST_CAST(uint8_t *, &rule->table_id) = table - ofproto->tables; + *CONST_CAST(uint8_t *, &rule->table_id) = table_id; rule->flags = fm->flags & OFPUTIL_FF_STATE; - ovsrcu_set(&rule->actions, - rule_actions_create(ofproto, fm->ofpacts, fm->ofpacts_len)); + *CONST_CAST(const struct rule_actions **, &rule->actions) + = rule_actions_create(fm->ofpacts, fm->ofpacts_len); list_init(&rule->meter_list_node); rule->eviction_group = NULL; list_init(&rule->expirable); @@ -4084,6 +4645,28 @@ rule->add_seqno = 0; rule->modify_seqno = 0; + /* Copy values from old rule for modify semantics. */ + if (old_rule && fm->delete_reason != OFPRR_EVICTION) { + /* 'fm' says that */ + bool change_cookie = (fm->modify_cookie + && fm->new_cookie != OVS_BE64_MAX + && fm->new_cookie != old_rule->flow_cookie); + + ovs_mutex_lock(&old_rule->mutex); + if (fm->command != OFPFC_ADD) { + rule->idle_timeout = old_rule->idle_timeout; + rule->hard_timeout = old_rule->hard_timeout; + rule->importance = old_rule->importance; + rule->flags = old_rule->flags; + rule->created = old_rule->created; + } + if (!change_cookie) { + rule->flow_cookie = old_rule->flow_cookie; + } + ovs_mutex_unlock(&old_rule->mutex); + } + ovs_mutex_unlock(&rule->mutex); + /* Construct rule, initializing derived state. */ error = ofproto->ofproto_class->rule_construct(rule); if (error) { @@ -4091,293 +4674,444 @@ return error; } - /* Insert rule. */ - do_add_flow(ofproto, ofconn, request, fm->buffer_id, rule); + rule->removed = true; /* Not yet in ofproto data structures. */ - return error; + *new_rule = rule; + return 0; } static void -do_add_flow(struct ofproto *ofproto, struct ofconn *ofconn, - const struct ofp_header *request, uint32_t buffer_id, - struct rule *rule) - OVS_REQUIRES(ofproto_mutex) +replace_rule_start(struct ofproto *ofproto, + struct rule *old_rule, struct rule *new_rule, + struct cls_conjunction *conjs, size_t n_conjs) +{ + struct oftable *table = &ofproto->tables[new_rule->table_id]; + + /* 'old_rule' may be either an evicted rule or replaced rule. */ + if (old_rule) { + /* Mark the old rule for removal in the next version. */ + cls_rule_make_invisible_in_version(&old_rule->cr, + ofproto->tables_version + 1); + } else { + table->n_flows++; + } + /* Insert flow to the classifier, so that later flow_mods may relate + * to it. This is reversible, in case later errors require this to + * be reverted. */ + ofproto_rule_insert__(ofproto, new_rule); + /* Make the new rule visible for classifier lookups only from the next + * version. */ + classifier_insert(&table->cls, &new_rule->cr, conjs, n_conjs); +} + +static void replace_rule_revert(struct ofproto *ofproto, + struct rule *old_rule, struct rule *new_rule) { - struct ofopgroup *group; + struct oftable *table = &ofproto->tables[new_rule->table_id]; - oftable_insert_rule(rule); + if (old_rule) { + /* Restore the original visibility of the old rule. */ + cls_rule_restore_visibility(&old_rule->cr); + } else { + /* Restore table's rule count. */ + table->n_flows--; + } - group = ofopgroup_create(ofproto, ofconn, request, buffer_id); - ofoperation_create(group, rule, OFOPERATION_ADD, 0); - ofproto->ofproto_class->rule_insert(rule); - ofopgroup_submit(group); + /* Remove the new rule immediately. It was never visible to lookups. */ + if (!classifier_remove(&table->cls, &new_rule->cr)) { + OVS_NOT_REACHED(); + } + ofproto_rule_remove__(ofproto, new_rule); + /* The rule was not inserted to the ofproto provider, so we can + * release it without deleting it from the ofproto provider. */ + ofproto_rule_unref(new_rule); +} + +/* Adds the 'new_rule', replacing the 'old_rule'. */ +static void +replace_rule_finish(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + const struct flow_mod_requester *req, + struct rule *old_rule, struct rule *new_rule, + struct ovs_list *dead_cookies) + OVS_REQUIRES(ofproto_mutex) +{ + bool forward_stats = !(fm->flags & OFPUTIL_FF_RESET_COUNTS); + struct rule *replaced_rule; + + replaced_rule = fm->delete_reason != OFPRR_EVICTION ? old_rule : NULL; + + /* Insert the new flow to the ofproto provider. A non-NULL 'replaced_rule' + * is a duplicate rule the 'new_rule' is replacing. The provider should + * link the stats from the old rule to the new one if 'forward_stats' is + * 'true'. The 'replaced_rule' will be deleted right after this call. */ + ofproto->ofproto_class->rule_insert(new_rule, replaced_rule, + forward_stats); + learned_cookies_inc(ofproto, rule_get_actions(new_rule)); + + if (old_rule) { + const struct rule_actions *old_actions = rule_get_actions(old_rule); + + /* Remove the old rule from data structures. Removal from the + * classifier and the deletion of the rule is RCU postponed by the + * caller. */ + ofproto_rule_remove__(ofproto, old_rule); + learned_cookies_dec(ofproto, old_actions, dead_cookies); + + if (replaced_rule) { + enum nx_flow_update_event event = fm->command == OFPFC_ADD + ? NXFME_ADDED : NXFME_MODIFIED; + + bool change_cookie = (fm->modify_cookie + && fm->new_cookie != OVS_BE64_MAX + && fm->new_cookie != old_rule->flow_cookie); + + bool change_actions = !ofpacts_equal(fm->ofpacts, + fm->ofpacts_len, + old_actions->ofpacts, + old_actions->ofpacts_len); + + if (event != NXFME_MODIFIED || change_actions || change_cookie) { + ofmonitor_report(ofproto->connmgr, new_rule, event, 0, + req ? req->ofconn : NULL, + req ? req->request->xid : 0, + change_actions ? old_actions : NULL); + } + } else { + /* XXX: This is slight duplication with delete_flows_finish__() */ + + old_rule->removed_reason = OFPRR_EVICTION; + + ofmonitor_report(ofproto->connmgr, old_rule, NXFME_DELETED, + OFPRR_EVICTION, + req ? req->ofconn : NULL, + req ? req->request->xid : 0, NULL); + } + } } - -/* OFPFC_MODIFY and OFPFC_MODIFY_STRICT. */ -/* Modifies the rules listed in 'rules', changing their actions to match those - * in 'fm'. - * - * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id, - * if any. - * - * Returns 0 on success, otherwise an OpenFlow error code. */ static enum ofperr -modify_flows__(struct ofproto *ofproto, struct ofconn *ofconn, - struct ofputil_flow_mod *fm, const struct ofp_header *request, - const struct rule_collection *rules) +modify_flows_start__(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct rule_collection *old_rules, + struct rule_collection *new_rules) OVS_REQUIRES(ofproto_mutex) { - enum ofoperation_type type; - struct ofopgroup *group; enum ofperr error; - size_t i; - - type = fm->command == OFPFC_ADD ? OFOPERATION_REPLACE : OFOPERATION_MODIFY; - group = ofopgroup_create(ofproto, ofconn, request, fm->buffer_id); - error = OFPERR_OFPBRC_EPERM; - for (i = 0; i < rules->n; i++) { - struct rule *rule = rules->rules[i]; - const struct rule_actions *actions; - struct ofoperation *op; - bool actions_changed; - bool reset_counters; - - /* FIXME: Implement OFPFUTIL_FF_RESET_COUNTS */ - - if (rule_is_modifiable(rule, fm->flags)) { - /* At least one rule is modifiable, don't report EPERM error. */ - error = 0; - } else { - continue; - } - actions = rule_get_actions(rule); - actions_changed = !ofpacts_equal(fm->ofpacts, fm->ofpacts_len, - actions->ofpacts, - actions->ofpacts_len); + rule_collection_init(new_rules); - op = ofoperation_create(group, rule, type, 0); - - if (fm->modify_cookie && fm->new_cookie != OVS_BE64_MAX) { - ofproto_rule_change_cookie(ofproto, rule, fm->new_cookie); - } - if (type == OFOPERATION_REPLACE) { - ovs_mutex_lock(&rule->mutex); - rule->idle_timeout = fm->idle_timeout; - rule->hard_timeout = fm->hard_timeout; - ovs_mutex_unlock(&rule->mutex); + if (old_rules->n > 0) { + struct cls_conjunction *conjs; + size_t n_conjs; + size_t i; - rule->flags = fm->flags & OFPUTIL_FF_STATE; - if (fm->idle_timeout || fm->hard_timeout) { - if (!rule->eviction_group) { - eviction_group_add_rule(rule); - } + /* Create a new 'modified' rule for each old rule. */ + for (i = 0; i < old_rules->n; i++) { + struct rule *old_rule = old_rules->rules[i]; + struct rule *new_rule; + struct cls_rule cr; + + cls_rule_clone_in_version(&cr, &old_rule->cr, + ofproto->tables_version + 1); + error = replace_rule_create(ofproto, fm, &cr, old_rule->table_id, + old_rule, &new_rule); + if (!error) { + rule_collection_add(new_rules, new_rule); } else { - eviction_group_remove_rule(rule); + rule_collection_unref(new_rules); + rule_collection_destroy(new_rules); + return error; } } + ovs_assert(new_rules->n == old_rules->n); - reset_counters = (fm->flags & OFPUTIL_FF_RESET_COUNTS) != 0; - if (actions_changed || reset_counters) { - const struct rule_actions *new_actions; - - op->actions = rule_get_actions(rule); - new_actions = rule_actions_create(ofproto, - fm->ofpacts, fm->ofpacts_len); - - ovsrcu_set(&rule->actions, new_actions); - - rule->ofproto->ofproto_class->rule_modify_actions(rule, - reset_counters); - } else { - ofoperation_complete(op, 0); + get_conjunctions(fm, &conjs, &n_conjs); + for (i = 0; i < old_rules->n; i++) { + replace_rule_start(ofproto, old_rules->rules[i], + new_rules->rules[i], conjs, n_conjs); + } + free(conjs); + } else if (!(fm->cookie_mask != htonll(0) + || fm->new_cookie == OVS_BE64_MAX)) { + /* No match, add a new flow. */ + error = add_flow_start(ofproto, fm, &old_rules->rules[0], + &new_rules->rules[0]); + if (!error) { + ovs_assert(fm->delete_reason == OFPRR_EVICTION + || !old_rules->rules[0]); } + new_rules->n = 1; + } else { + error = 0; } - ofopgroup_submit(group); return error; } -static enum ofperr -modify_flows_add(struct ofproto *ofproto, struct ofconn *ofconn, - struct ofputil_flow_mod *fm, const struct ofp_header *request) - OVS_REQUIRES(ofproto_mutex) -{ - if (fm->cookie_mask != htonll(0) || fm->new_cookie == OVS_BE64_MAX) { - return 0; - } - return add_flow(ofproto, ofconn, fm, request); -} - /* Implements OFPFC_MODIFY. Returns 0 on success or an OpenFlow error code on * failure. * * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id, * if any. */ static enum ofperr -modify_flows_loose(struct ofproto *ofproto, struct ofconn *ofconn, - struct ofputil_flow_mod *fm, - const struct ofp_header *request) +modify_flows_start_loose(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct rule_collection *old_rules, + struct rule_collection *new_rules) OVS_REQUIRES(ofproto_mutex) { struct rule_criteria criteria; - struct rule_collection rules; - int error; + enum ofperr error; - rule_criteria_init(&criteria, fm->table_id, &fm->match, 0, + rule_criteria_init(&criteria, fm->table_id, &fm->match, 0, CLS_MAX_VERSION, fm->cookie, fm->cookie_mask, OFPP_ANY, OFPG11_ANY); - error = collect_rules_loose(ofproto, &criteria, &rules); + rule_criteria_require_rw(&criteria, + (fm->flags & OFPUTIL_FF_NO_READONLY) != 0); + error = collect_rules_loose(ofproto, &criteria, old_rules); rule_criteria_destroy(&criteria); if (!error) { - error = (rules.n > 0 - ? modify_flows__(ofproto, ofconn, fm, request, &rules) - : modify_flows_add(ofproto, ofconn, fm, request)); + error = modify_flows_start__(ofproto, fm, old_rules, new_rules); } - rule_collection_destroy(&rules); - + if (error) { + rule_collection_destroy(old_rules); + } return error; } +static void +modify_flows_revert(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct rule_collection *old_rules, + struct rule_collection *new_rules) + OVS_REQUIRES(ofproto_mutex) +{ + /* Old rules were not changed yet, only need to revert new rules. */ + if (old_rules->n == 0 && new_rules->n == 1) { + add_flow_revert(ofproto, fm, old_rules->rules[0], new_rules->rules[0]); + } else if (old_rules->n > 0) { + for (size_t i = 0; i < old_rules->n; i++) { + replace_rule_revert(ofproto, old_rules->rules[i], + new_rules->rules[i]); + } + rule_collection_destroy(new_rules); + rule_collection_destroy(old_rules); + } +} + +static void +modify_flows_finish(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + const struct flow_mod_requester *req, + struct rule_collection *old_rules, + struct rule_collection *new_rules) + OVS_REQUIRES(ofproto_mutex) +{ + if (old_rules->n == 0 && new_rules->n == 1) { + add_flow_finish(ofproto, fm, req, old_rules->rules[0], + new_rules->rules[0]); + } else if (old_rules->n > 0) { + struct ovs_list dead_cookies = OVS_LIST_INITIALIZER(&dead_cookies); + + ovs_assert(new_rules->n == old_rules->n); + + for (size_t i = 0; i < old_rules->n; i++) { + replace_rule_finish(ofproto, fm, req, old_rules->rules[i], + new_rules->rules[i], &dead_cookies); + } + learned_cookies_flush(ofproto, &dead_cookies); + rule_collection_remove_postponed(old_rules); + + send_buffered_packet(req, fm->buffer_id, new_rules->rules[0]); + rule_collection_destroy(new_rules); + } +} + /* Implements OFPFC_MODIFY_STRICT. Returns 0 on success or an OpenFlow error - * code on failure. - * - * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id, - * if any. */ + * code on failure. */ static enum ofperr -modify_flow_strict(struct ofproto *ofproto, struct ofconn *ofconn, - struct ofputil_flow_mod *fm, - const struct ofp_header *request) +modify_flow_start_strict(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct rule_collection *old_rules, + struct rule_collection *new_rules) OVS_REQUIRES(ofproto_mutex) { struct rule_criteria criteria; - struct rule_collection rules; - int error; + enum ofperr error; rule_criteria_init(&criteria, fm->table_id, &fm->match, fm->priority, - fm->cookie, fm->cookie_mask, OFPP_ANY, OFPG11_ANY); - error = collect_rules_strict(ofproto, &criteria, &rules); + CLS_MAX_VERSION, fm->cookie, fm->cookie_mask, OFPP_ANY, + OFPG11_ANY); + rule_criteria_require_rw(&criteria, + (fm->flags & OFPUTIL_FF_NO_READONLY) != 0); + error = collect_rules_strict(ofproto, &criteria, old_rules); rule_criteria_destroy(&criteria); if (!error) { - if (rules.n == 0) { - error = modify_flows_add(ofproto, ofconn, fm, request); - } else if (rules.n == 1) { - error = modify_flows__(ofproto, ofconn, fm, request, &rules); - } + /* collect_rules_strict() can return max 1 rule. */ + error = modify_flows_start__(ofproto, fm, old_rules, new_rules); } - rule_collection_destroy(&rules); - + if (error) { + rule_collection_destroy(old_rules); + } return error; } /* OFPFC_DELETE implementation. */ static void -delete_flow__(struct rule *rule, struct ofopgroup *group, - enum ofp_flow_removed_reason reason) +delete_flows_start__(struct ofproto *ofproto, + const struct rule_collection *rules) OVS_REQUIRES(ofproto_mutex) { - struct ofproto *ofproto = rule->ofproto; + for (size_t i = 0; i < rules->n; i++) { + struct rule *rule = rules->rules[i]; + struct oftable *table = &ofproto->tables[rule->table_id]; - ofproto_rule_send_removed(rule, reason); + table->n_flows--; + cls_rule_make_invisible_in_version(&rule->cr, + ofproto->tables_version + 1); + } +} - ofoperation_create(group, rule, OFOPERATION_DELETE, reason); - oftable_remove_rule(rule); - ofproto->ofproto_class->rule_delete(rule); +static void +delete_flows_finish__(struct ofproto *ofproto, + struct rule_collection *rules, + enum ofp_flow_removed_reason reason, + const struct flow_mod_requester *req) + OVS_REQUIRES(ofproto_mutex) +{ + if (rules->n) { + struct ovs_list dead_cookies = OVS_LIST_INITIALIZER(&dead_cookies); + + for (size_t i = 0; i < rules->n; i++) { + struct rule *rule = rules->rules[i]; + + /* This value will be used to send the flow removed message right + * before the rule is actually destroyed. */ + rule->removed_reason = reason; + + ofmonitor_report(ofproto->connmgr, rule, NXFME_DELETED, reason, + req ? req->ofconn : NULL, + req ? req->request->xid : 0, NULL); + ofproto_rule_remove__(ofproto, rule); + learned_cookies_dec(ofproto, rule_get_actions(rule), + &dead_cookies); + } + rule_collection_remove_postponed(rules); + + learned_cookies_flush(ofproto, &dead_cookies); + } } /* Deletes the rules listed in 'rules'. - * - * Returns 0 on success, otherwise an OpenFlow error code. */ -static enum ofperr -delete_flows__(struct ofproto *ofproto, struct ofconn *ofconn, - const struct ofp_header *request, - const struct rule_collection *rules, - enum ofp_flow_removed_reason reason) + * The deleted rules will become invisible to the lookups in the next version. + * Destroys 'rules'. */ +static void +delete_flows__(struct rule_collection *rules, + enum ofp_flow_removed_reason reason, + const struct flow_mod_requester *req) OVS_REQUIRES(ofproto_mutex) { - struct ofopgroup *group; - size_t i; + if (rules->n) { + struct ofproto *ofproto = rules->rules[0]->ofproto; - group = ofopgroup_create(ofproto, ofconn, request, UINT32_MAX); - for (i = 0; i < rules->n; i++) { - delete_flow__(rules->rules[i], group, reason); + delete_flows_start__(ofproto, rules); + ofproto_bump_tables_version(ofproto); + delete_flows_finish__(ofproto, rules, reason, req); + ofmonitor_flush(ofproto->connmgr); } - ofopgroup_submit(group); - - return 0; } /* Implements OFPFC_DELETE. */ static enum ofperr -delete_flows_loose(struct ofproto *ofproto, struct ofconn *ofconn, - const struct ofputil_flow_mod *fm, - const struct ofp_header *request) +delete_flows_start_loose(struct ofproto *ofproto, + const struct ofputil_flow_mod *fm, + struct rule_collection *rules) OVS_REQUIRES(ofproto_mutex) { struct rule_criteria criteria; - struct rule_collection rules; enum ofperr error; - rule_criteria_init(&criteria, fm->table_id, &fm->match, 0, - fm->cookie, fm->cookie_mask, - fm->out_port, fm->out_group); - error = collect_rules_loose(ofproto, &criteria, &rules); + rule_criteria_init(&criteria, fm->table_id, &fm->match, 0, CLS_MAX_VERSION, + fm->cookie, fm->cookie_mask, fm->out_port, + fm->out_group); + rule_criteria_require_rw(&criteria, + (fm->flags & OFPUTIL_FF_NO_READONLY) != 0); + error = collect_rules_loose(ofproto, &criteria, rules); rule_criteria_destroy(&criteria); - if (!error && rules.n > 0) { - error = delete_flows__(ofproto, ofconn, request, &rules, OFPRR_DELETE); + if (!error) { + delete_flows_start__(ofproto, rules); } - rule_collection_destroy(&rules); return error; } +static void +delete_flows_revert(struct ofproto *ofproto, + struct rule_collection *rules) + OVS_REQUIRES(ofproto_mutex) +{ + for (size_t i = 0; i < rules->n; i++) { + struct rule *rule = rules->rules[i]; + struct oftable *table = &ofproto->tables[rule->table_id]; + + /* Restore table's rule count. */ + table->n_flows++; + + /* Restore the original visibility of the rule. */ + cls_rule_restore_visibility(&rule->cr); + } + rule_collection_destroy(rules); +} + +static void +delete_flows_finish(struct ofproto *ofproto, + const struct ofputil_flow_mod *fm, + const struct flow_mod_requester *req, + struct rule_collection *rules) + OVS_REQUIRES(ofproto_mutex) +{ + delete_flows_finish__(ofproto, rules, fm->delete_reason, req); +} + /* Implements OFPFC_DELETE_STRICT. */ static enum ofperr -delete_flow_strict(struct ofproto *ofproto, struct ofconn *ofconn, - const struct ofputil_flow_mod *fm, - const struct ofp_header *request) +delete_flow_start_strict(struct ofproto *ofproto, + const struct ofputil_flow_mod *fm, + struct rule_collection *rules) OVS_REQUIRES(ofproto_mutex) { struct rule_criteria criteria; - struct rule_collection rules; enum ofperr error; rule_criteria_init(&criteria, fm->table_id, &fm->match, fm->priority, - fm->cookie, fm->cookie_mask, + CLS_MAX_VERSION, fm->cookie, fm->cookie_mask, fm->out_port, fm->out_group); - error = collect_rules_strict(ofproto, &criteria, &rules); + rule_criteria_require_rw(&criteria, + (fm->flags & OFPUTIL_FF_NO_READONLY) != 0); + error = collect_rules_strict(ofproto, &criteria, rules); rule_criteria_destroy(&criteria); - if (!error && rules.n > 0) { - error = delete_flows__(ofproto, ofconn, request, &rules, OFPRR_DELETE); + if (!error) { + delete_flows_start__(ofproto, rules); } - rule_collection_destroy(&rules); return error; } +/* This may only be called by rule_destroy_cb()! */ static void -ofproto_rule_send_removed(struct rule *rule, uint8_t reason) - OVS_REQUIRES(ofproto_mutex) +ofproto_rule_send_removed(struct rule *rule) + OVS_EXCLUDED(ofproto_mutex) { struct ofputil_flow_removed fr; long long int used; - if (ofproto_rule_is_hidden(rule) || - !(rule->flags & OFPUTIL_FF_SEND_FLOW_REM)) { - return; - } - minimatch_expand(&rule->cr.match, &fr.match); fr.priority = rule->cr.priority; + + ovs_mutex_lock(&ofproto_mutex); fr.cookie = rule->flow_cookie; - fr.reason = reason; + fr.reason = rule->removed_reason; fr.table_id = rule->table_id; calc_duration(rule->created, time_msec(), &fr.duration_sec, &fr.duration_nsec); @@ -4387,29 +5121,26 @@ ovs_mutex_unlock(&rule->mutex); rule->ofproto->ofproto_class->rule_get_stats(rule, &fr.packet_count, &fr.byte_count, &used); - connmgr_send_flow_removed(rule->ofproto->connmgr, &fr); + ovs_mutex_unlock(&ofproto_mutex); } /* Sends an OpenFlow "flow removed" message with the given 'reason' (either * OFPRR_HARD_TIMEOUT or OFPRR_IDLE_TIMEOUT), and then removes 'rule' from its * ofproto. * - * 'rule' must not have a pending operation (that is, 'rule->pending' must be - * NULL). - * * ofproto implementation ->run() functions should use this function to expire * OpenFlow flows. */ void ofproto_rule_expire(struct rule *rule, uint8_t reason) OVS_REQUIRES(ofproto_mutex) { - struct ofproto *ofproto = rule->ofproto; - - ovs_assert(reason == OFPRR_HARD_TIMEOUT || reason == OFPRR_IDLE_TIMEOUT - || reason == OFPRR_DELETE || reason == OFPRR_GROUP_DELETE); + struct rule_collection rules; - ofproto_rule_delete__(ofproto, rule, reason); + rules.rules = rules.stub; + rules.n = 1; + rules.stub[0] = rule; + delete_flows__(&rules, reason, NULL); } /* Reduces '*timeout' to no more than 'max'. A value of zero in either case @@ -4472,7 +5203,11 @@ error = ofproto_check_ofpacts(ofproto, fm.ofpacts, fm.ofpacts_len); } if (!error) { - error = handle_flow_mod__(ofproto, ofconn, &fm, oh); + struct flow_mod_requester req; + + req.ofconn = ofconn; + req.request = oh; + error = handle_flow_mod__(ofproto, &fm, &req); } if (error) { goto exit_free_ofpacts; @@ -4487,48 +5222,20 @@ } static enum ofperr -handle_flow_mod__(struct ofproto *ofproto, struct ofconn *ofconn, - struct ofputil_flow_mod *fm, const struct ofp_header *oh) +handle_flow_mod__(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + const struct flow_mod_requester *req) OVS_EXCLUDED(ofproto_mutex) { + struct ofp_bundle_entry be; enum ofperr error; ovs_mutex_lock(&ofproto_mutex); - if (ofproto->n_pending < 50) { - switch (fm->command) { - case OFPFC_ADD: - error = add_flow(ofproto, ofconn, fm, oh); - break; - - case OFPFC_MODIFY: - error = modify_flows_loose(ofproto, ofconn, fm, oh); - break; - - case OFPFC_MODIFY_STRICT: - error = modify_flow_strict(ofproto, ofconn, fm, oh); - break; - - case OFPFC_DELETE: - error = delete_flows_loose(ofproto, ofconn, fm, oh); - break; - - case OFPFC_DELETE_STRICT: - error = delete_flow_strict(ofproto, ofconn, fm, oh); - break; - - default: - if (fm->command > 0xff) { - VLOG_WARN_RL(&rl, "%s: flow_mod has explicit table_id but " - "flow_mod_table_id extension is not enabled", - ofproto->name); - } - error = OFPERR_OFPFMFC_BAD_COMMAND; - break; - } - } else { - ovs_assert(!list_is_empty(&ofproto->pending)); - error = OFPROTO_POSTPONE; + error = do_bundle_flow_mod_start(ofproto, fm, &be); + if (!error) { + ofproto_bump_tables_version(ofproto); + do_bundle_flow_mod_finish(ofproto, fm, req, &be); } + ofmonitor_flush(ofproto->connmgr); ovs_mutex_unlock(&ofproto_mutex); run_rule_executes(ofproto); @@ -4549,11 +5256,6 @@ } if (request.role != OFPCR12_ROLE_NOCHANGE) { - if (ofconn_get_role(ofconn) != request.role - && ofconn_has_pending_opgroups(ofconn)) { - return OFPROTO_POSTPONE; - } - if (request.have_generation_id && !ofconn_set_master_election_id(ofconn, request.generation_id)) { return OFPERR_OFPRRFC_STALE; @@ -4599,12 +5301,8 @@ cur = ofconn_get_protocol(ofconn); next = ofputil_protocol_set_base(cur, next_base); - if (cur != next && ofconn_has_pending_opgroups(ofconn)) { - /* Avoid sending async messages in surprising protocol. */ - return OFPROTO_POSTPONE; - } - ofconn_set_protocol(ofconn, next); + return 0; } @@ -4620,12 +5318,6 @@ return OFPERR_OFPBRC_EPERM; } - if (format != ofconn_get_packet_in_format(ofconn) - && ofconn_has_pending_opgroups(ofconn)) { - /* Avoid sending async message in surprsing packet in format. */ - return OFPROTO_POSTPONE; - } - ofconn_set_packet_in_format(ofconn, format); return 0; } @@ -4698,10 +5390,6 @@ { struct ofpbuf *buf; - if (ofconn_has_pending_opgroups(ofconn)) { - return OFPROTO_POSTPONE; - } - buf = ofpraw_alloc_reply((oh->version == OFP10_VERSION ? OFPRAW_OFPT10_BARRIER_REPLY : OFPRAW_OFPT11_BARRIER_REPLY), oh, 0); @@ -4712,20 +5400,13 @@ static void ofproto_compose_flow_refresh_update(const struct rule *rule, enum nx_flow_monitor_flags flags, - struct list *msgs) + struct ovs_list *msgs) OVS_REQUIRES(ofproto_mutex) { - struct ofoperation *op = rule->pending; const struct rule_actions *actions; struct ofputil_flow_update fu; struct match match; - if (op && op->type == OFOPERATION_ADD) { - /* We'll report the final flow when the operation completes. Reporting - * it now would cause a duplicate report later. */ - return; - } - fu.event = (flags & (NXFMF_INITIAL | NXFMF_ADD) ? NXFME_ADDED : NXFME_MODIFIED); fu.reason = 0; @@ -4739,30 +5420,7 @@ fu.match = &match; fu.priority = rule->cr.priority; - if (!(flags & NXFMF_ACTIONS)) { - actions = NULL; - } else if (!op) { - actions = rule_get_actions(rule); - } else { - /* An operation is in progress. Use the previous version of the flow's - * actions, so that when the operation commits we report the change. */ - switch (op->type) { - case OFOPERATION_ADD: - OVS_NOT_REACHED(); - - case OFOPERATION_MODIFY: - case OFOPERATION_REPLACE: - actions = op->actions ? op->actions : rule_get_actions(rule); - break; - - case OFOPERATION_DELETE: - actions = rule_get_actions(rule); - break; - - default: - OVS_NOT_REACHED(); - } - } + actions = flags & NXFMF_ACTIONS ? rule_get_actions(rule) : NULL; fu.ofpacts = actions ? actions->ofpacts : NULL; fu.ofpacts_len = actions ? actions->ofpacts_len : 0; @@ -4774,7 +5432,7 @@ void ofmonitor_compose_refresh_updates(struct rule_collection *rules, - struct list *msgs) + struct ovs_list *msgs) OVS_REQUIRES(ofproto_mutex) { size_t i; @@ -4796,13 +5454,11 @@ { enum nx_flow_monitor_flags update; - if (ofproto_rule_is_hidden(rule)) { + if (rule_is_hidden(rule)) { return; } - if (!(rule->pending - ? ofoperation_has_out_port(rule->pending, m->out_port) - : ofproto_rule_has_out_port(rule, m->out_port))) { + if (!ofproto_rule_has_out_port(rule, m->out_port)) { return; } @@ -4835,31 +5491,14 @@ OVS_REQUIRES(ofproto_mutex) { const struct ofproto *ofproto = ofconn_get_ofproto(m->ofconn); - const struct ofoperation *op; const struct oftable *table; struct cls_rule target; - cls_rule_init_from_minimatch(&target, &m->match, 0); + cls_rule_init_from_minimatch(&target, &m->match, 0, CLS_MAX_VERSION); FOR_EACH_MATCHING_TABLE (table, m->table_id, ofproto) { - struct cls_cursor cursor; struct rule *rule; - fat_rwlock_rdlock(&table->cls.rwlock); - cls_cursor_init(&cursor, &table->cls, &target); - CLS_CURSOR_FOR_EACH (rule, cr, &cursor) { - ovs_assert(!rule->pending); /* XXX */ - ofproto_collect_ofmonitor_refresh_rule(m, rule, seqno, rules); - } - fat_rwlock_unlock(&table->cls.rwlock); - } - - HMAP_FOR_EACH (op, hmap_node, &ofproto->deletions) { - struct rule *rule = op->rule; - - if (((m->table_id == 0xff - ? !(ofproto->tables[rule->table_id].flags & OFTABLE_HIDDEN) - : m->table_id == rule->table_id)) - && cls_rule_is_loose_match(&rule->cr, &target.match)) { + CLS_FOR_EACH_TARGET (rule, cr, &table->cls, &target) { ofproto_collect_ofmonitor_refresh_rule(m, rule, seqno, rules); } } @@ -4885,6 +5524,24 @@ } static enum ofperr +flow_monitor_delete(struct ofconn *ofconn, uint32_t id) + OVS_REQUIRES(ofproto_mutex) +{ + struct ofmonitor *m; + enum ofperr error; + + m = ofmonitor_lookup(ofconn, id); + if (m) { + ofmonitor_destroy(m); + error = 0; + } else { + error = OFPERR_OFPMOFC_UNKNOWN_MONITOR; + } + + return error; +} + +static enum ofperr handle_flow_monitor_request(struct ofconn *ofconn, const struct ofp_header *oh) OVS_EXCLUDED(ofproto_mutex) { @@ -4892,12 +5549,11 @@ struct ofmonitor **monitors; size_t n_monitors, allocated_monitors; struct rule_collection rules; - struct list replies; + struct ovs_list replies; enum ofperr error; struct ofpbuf b; size_t i; - error = 0; ofpbuf_use_const(&b, oh, ntohs(oh->length)); monitors = NULL; n_monitors = allocated_monitors = 0; @@ -4964,20 +5620,13 @@ handle_flow_monitor_cancel(struct ofconn *ofconn, const struct ofp_header *oh) OVS_EXCLUDED(ofproto_mutex) { - struct ofmonitor *m; enum ofperr error; uint32_t id; id = ofputil_decode_flow_monitor_cancel(oh); ovs_mutex_lock(&ofproto_mutex); - m = ofmonitor_lookup(ofconn, id); - if (m) { - ofmonitor_destroy(m); - error = 0; - } else { - error = OFPERR_NXBRC_FM_BAD_ID; - } + error = flow_monitor_delete(ofconn, id); ovs_mutex_unlock(&ofproto_mutex); return error; @@ -4986,8 +5635,6 @@ /* Meters implementation. * * Meter table entry, indexed by the OpenFlow meter_id. - * These are always dynamically allocated to allocate enough space for - * the bands. * 'created' is used to compute the duration for meter stats. * 'list rules' is needed so that we can delete the dependent rules when the * meter table entry is deleted. @@ -4995,7 +5642,7 @@ */ struct meter { long long int created; /* Time created. */ - struct list rules; /* List of "struct rule_dpif"s. */ + struct ovs_list rules; /* List of "struct rule_dpif"s. */ ofproto_meter_id provider_meter_id; uint16_t flags; /* Meter flags. */ uint16_t n_bands; /* Number of meter bands. */ @@ -5019,6 +5666,18 @@ return UINT32_MAX; } +/* Finds the meter invoked by 'rule''s actions and adds 'rule' to the meter's + * list of rules. */ +static void +meter_insert_rule(struct rule *rule) +{ + const struct rule_actions *a = rule_get_actions(rule); + uint32_t meter_id = ofpacts_get_meter(a->ofpacts, a->ofpacts_len); + struct meter *meter = rule->ofproto->meters[meter_id]; + + list_insert(&meter->rules, &rule->meter_list_node); +} + static void meter_update(struct meter *meter, const struct ofputil_meter_config *config) { @@ -5106,8 +5765,7 @@ } static enum ofperr -handle_delete_meter(struct ofconn *ofconn, const struct ofp_header *oh, - struct ofputil_meter_mod *mm) +handle_delete_meter(struct ofconn *ofconn, struct ofputil_meter_mod *mm) OVS_EXCLUDED(ofproto_mutex) { struct ofproto *ofproto = ofconn_get_ofproto(ofconn); @@ -5136,24 +5794,16 @@ struct rule *rule; LIST_FOR_EACH (rule, meter_list_node, &meter->rules) { - if (rule->pending) { - error = OFPROTO_POSTPONE; - goto exit; - } rule_collection_add(&rules, rule); } } } - if (rules.n > 0) { - delete_flows__(ofproto, ofconn, oh, &rules, OFPRR_METER_DELETE); - } + delete_flows__(&rules, OFPRR_METER_DELETE, NULL); /* Delete the meters. */ meter_delete(ofproto, first, last); -exit: ovs_mutex_unlock(&ofproto_mutex); - rule_collection_destroy(&rules); return error; } @@ -5207,7 +5857,7 @@ break; case OFPMC13_DELETE: - error = handle_delete_meter(ofconn, oh, &mm); + error = handle_delete_meter(ofconn, &mm); break; default: @@ -5244,7 +5894,7 @@ enum ofptype type) { struct ofproto *ofproto = ofconn_get_ofproto(ofconn); - struct list replies; + struct ovs_list replies; uint64_t bands_stub[256 / 8]; struct ofpbuf bands; uint32_t meter_id, first, last; @@ -5306,47 +5956,38 @@ return 0; } -bool -ofproto_group_lookup(const struct ofproto *ofproto, uint32_t group_id, - struct ofgroup **group) - OVS_TRY_RDLOCK(true, (*group)->rwlock) +static bool +ofproto_group_lookup__(const struct ofproto *ofproto, uint32_t group_id, + struct ofgroup **group) + OVS_REQ_RDLOCK(ofproto->groups_rwlock) { - ovs_rwlock_rdlock(&ofproto->groups_rwlock); HMAP_FOR_EACH_IN_BUCKET (*group, hmap_node, hash_int(group_id, 0), &ofproto->groups) { if ((*group)->group_id == group_id) { - ovs_rwlock_rdlock(&(*group)->rwlock); - ovs_rwlock_unlock(&ofproto->groups_rwlock); return true; } } - ovs_rwlock_unlock(&ofproto->groups_rwlock); + return false; } -void -ofproto_group_release(struct ofgroup *group) - OVS_RELEASES(group->rwlock) +/* If the group exists, this function increments the groups's reference count. + * + * Make sure to call ofproto_group_unref() after no longer needing to maintain + * a reference to the group. */ +bool +ofproto_group_lookup(const struct ofproto *ofproto, uint32_t group_id, + struct ofgroup **group) { - ovs_rwlock_unlock(&group->rwlock); -} + bool found; -static bool -ofproto_group_write_lookup(const struct ofproto *ofproto, uint32_t group_id, - struct ofgroup **group) - OVS_TRY_WRLOCK(true, ofproto->groups_rwlock) - OVS_TRY_WRLOCK(true, (*group)->rwlock) -{ - ovs_rwlock_wrlock(&ofproto->groups_rwlock); - HMAP_FOR_EACH_IN_BUCKET (*group, hmap_node, - hash_int(group_id, 0), &ofproto->groups) { - if ((*group)->group_id == group_id) { - ovs_rwlock_wrlock(&(*group)->rwlock); - return true; - } + ovs_rwlock_rdlock(&ofproto->groups_rwlock); + found = ofproto_group_lookup__(ofproto, group_id, group); + if (found) { + ofproto_group_ref(*group); } ovs_rwlock_unlock(&ofproto->groups_rwlock); - return false; + return found; } static bool @@ -5381,7 +6022,7 @@ group_get_ref_count(struct ofgroup *group) OVS_EXCLUDED(ofproto_mutex) { - struct ofproto *ofproto = group->ofproto; + struct ofproto *ofproto = CONST_CAST(struct ofproto *, group->ofproto); struct rule_criteria criteria; struct rule_collection rules; struct match match; @@ -5389,8 +6030,8 @@ uint32_t count; match_init_catchall(&match); - rule_criteria_init(&criteria, 0xff, &match, 0, htonll(0), htonll(0), - OFPP_ANY, group->group_id); + rule_criteria_init(&criteria, 0xff, &match, 0, CLS_MAX_VERSION, htonll(0), + htonll(0), OFPP_ANY, group->group_id); ovs_mutex_lock(&ofproto_mutex); error = collect_rules_loose(ofproto, &criteria, &rules); ovs_mutex_unlock(&ofproto_mutex); @@ -5403,11 +6044,10 @@ } static void -append_group_stats(struct ofgroup *group, struct list *replies) - OVS_REQ_RDLOCK(group->rwlock) +append_group_stats(struct ofgroup *group, struct ovs_list *replies) { struct ofputil_group_stats ogs; - struct ofproto *ofproto = group->ofproto; + const struct ofproto *ofproto = group->ofproto; long long int now = time_msec(); int error; @@ -5438,25 +6078,23 @@ static void handle_group_request(struct ofconn *ofconn, const struct ofp_header *request, uint32_t group_id, - void (*cb)(struct ofgroup *, struct list *replies)) + void (*cb)(struct ofgroup *, struct ovs_list *replies)) { struct ofproto *ofproto = ofconn_get_ofproto(ofconn); struct ofgroup *group; - struct list replies; + struct ovs_list replies; ofpmp_init(&replies, request); if (group_id == OFPG_ALL) { ovs_rwlock_rdlock(&ofproto->groups_rwlock); HMAP_FOR_EACH (group, hmap_node, &ofproto->groups) { - ovs_rwlock_rdlock(&group->rwlock); cb(group, &replies); - ovs_rwlock_unlock(&group->rwlock); } ovs_rwlock_unlock(&ofproto->groups_rwlock); } else { if (ofproto_group_lookup(ofproto, group_id, &group)) { cb(group, &replies); - ofproto_group_release(group); + ofproto_group_unref(group); } } ofconn_send_replies(ofconn, &replies); @@ -5479,12 +6117,14 @@ } static void -append_group_desc(struct ofgroup *group, struct list *replies) +append_group_desc(struct ofgroup *group, struct ovs_list *replies) { struct ofputil_group_desc gds; gds.group_id = group->group_id; gds.type = group->type; + gds.props = group->props; + ofputil_append_group_desc_reply(&gds, &group->buckets, replies); } @@ -5556,24 +6196,12 @@ return 0; } -/* Implements OFPGC11_ADD - * in which no matching flow already exists in the flow table. - * - * Adds the flow specified by 'ofm', which is followed by 'n_actions' - * ofp_actions, to the ofproto's flow table. Returns 0 on success, an OpenFlow - * error code on failure, or OFPROTO_POSTPONE if the operation cannot be - * initiated now but may be retried later. - * - * Upon successful return, takes ownership of 'fm->ofpacts'. On failure, - * ownership remains with the caller. - * - * 'ofconn' is used to retrieve the packet buffer specified in ofm->buffer_id, - * if any. */ static enum ofperr -add_group(struct ofproto *ofproto, struct ofputil_group_mod *gm) +init_group(struct ofproto *ofproto, struct ofputil_group_mod *gm, + struct ofgroup **ofgroup) { - struct ofgroup *ofgroup; enum ofperr error; + const long long int now = time_msec(); if (gm->group_id > OFPG_MAX) { return OFPERR_OFPGMFC_INVALID_GROUP; @@ -5582,26 +6210,48 @@ return OFPERR_OFPGMFC_BAD_TYPE; } - /* Allocate new group and initialize it. */ - ofgroup = ofproto->ofproto_class->group_alloc(); - if (!ofgroup) { - VLOG_WARN_RL(&rl, "%s: failed to create group", ofproto->name); + *ofgroup = ofproto->ofproto_class->group_alloc(); + if (!*ofgroup) { + VLOG_WARN_RL(&rl, "%s: failed to allocate group", ofproto->name); return OFPERR_OFPGMFC_OUT_OF_GROUPS; } - ovs_rwlock_init(&ofgroup->rwlock); - ofgroup->ofproto = ofproto; - ofgroup->group_id = gm->group_id; - ofgroup->type = gm->type; - ofgroup->created = ofgroup->modified = time_msec(); + (*ofgroup)->ofproto = ofproto; + *CONST_CAST(uint32_t *, &((*ofgroup)->group_id)) = gm->group_id; + *CONST_CAST(enum ofp11_group_type *, &(*ofgroup)->type) = gm->type; + *CONST_CAST(long long int *, &((*ofgroup)->created)) = now; + *CONST_CAST(long long int *, &((*ofgroup)->modified)) = now; + ovs_refcount_init(&(*ofgroup)->ref_count); + + list_move(&(*ofgroup)->buckets, &gm->buckets); + *CONST_CAST(uint32_t *, &(*ofgroup)->n_buckets) = + list_size(&(*ofgroup)->buckets); - list_move(&ofgroup->buckets, &gm->buckets); - ofgroup->n_buckets = list_size(&ofgroup->buckets); + memcpy(CONST_CAST(struct ofputil_group_props *, &(*ofgroup)->props), + &gm->props, sizeof (struct ofputil_group_props)); /* Construct called BEFORE any locks are held. */ - error = ofproto->ofproto_class->group_construct(ofgroup); + error = ofproto->ofproto_class->group_construct(*ofgroup); + if (error) { + ofputil_bucket_list_destroy(&(*ofgroup)->buckets); + ofproto->ofproto_class->group_dealloc(*ofgroup); + } + return error; +} + +/* Implements the OFPGC11_ADD operation specified by 'gm', adding a group to + * 'ofproto''s group table. Returns 0 on success or an OpenFlow error code on + * failure. */ +static enum ofperr +add_group(struct ofproto *ofproto, struct ofputil_group_mod *gm) +{ + struct ofgroup *ofgroup; + enum ofperr error; + + /* Allocate new group and initialize it. */ + error = init_group(ofproto, gm, &ofgroup); if (error) { - goto free_out; + return error; } /* We wrlock as late as possible to minimize the time we jam any other @@ -5631,76 +6281,173 @@ unlock_out: ovs_rwlock_unlock(&ofproto->groups_rwlock); ofproto->ofproto_class->group_destruct(ofgroup); - free_out: ofputil_bucket_list_destroy(&ofgroup->buckets); ofproto->ofproto_class->group_dealloc(ofgroup); return error; } -/* Implements OFPFC_MODIFY. Returns 0 on success or an OpenFlow error code on - * failure. - * - * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id, - * if any. */ -static enum ofperr -modify_group(struct ofproto *ofproto, struct ofputil_group_mod *gm) +/* Adds all of the buckets from 'ofgroup' to 'new_ofgroup'. The buckets + * already in 'new_ofgroup' will be placed just after the (copy of the) bucket + * in 'ofgroup' with bucket ID 'command_bucket_id'. Special + * 'command_bucket_id' values OFPG15_BUCKET_FIRST and OFPG15_BUCKET_LAST are + * also honored. */ +static enum ofperr +copy_buckets_for_insert_bucket(const struct ofgroup *ofgroup, + struct ofgroup *new_ofgroup, + uint32_t command_bucket_id) +{ + struct ofputil_bucket *last = NULL; + + if (command_bucket_id <= OFPG15_BUCKET_MAX) { + /* Check here to ensure that a bucket corresponding to + * command_bucket_id exists in the old bucket list. + * + * The subsequent search of below of new_ofgroup covers + * both buckets in the old bucket list and buckets added + * by the insert buckets group mod message this function processes. */ + if (!ofputil_bucket_find(&ofgroup->buckets, command_bucket_id)) { + return OFPERR_OFPGMFC_UNKNOWN_BUCKET; + } + + if (!list_is_empty(&new_ofgroup->buckets)) { + last = ofputil_bucket_list_back(&new_ofgroup->buckets); + } + } + + ofputil_bucket_clone_list(&new_ofgroup->buckets, &ofgroup->buckets, NULL); + + if (ofputil_bucket_check_duplicate_id(&ofgroup->buckets)) { + VLOG_WARN_RL(&rl, "Duplicate bucket id"); + return OFPERR_OFPGMFC_BUCKET_EXISTS; + } + + /* Rearrange list according to command_bucket_id */ + if (command_bucket_id == OFPG15_BUCKET_LAST) { + struct ofputil_bucket *new_first; + const struct ofputil_bucket *first; + + first = ofputil_bucket_list_front(&ofgroup->buckets); + new_first = ofputil_bucket_find(&new_ofgroup->buckets, + first->bucket_id); + + list_splice(new_ofgroup->buckets.next, &new_first->list_node, + &new_ofgroup->buckets); + } else if (command_bucket_id <= OFPG15_BUCKET_MAX && last) { + struct ofputil_bucket *after; + + /* Presence of bucket is checked above so after should never be NULL */ + after = ofputil_bucket_find(&new_ofgroup->buckets, command_bucket_id); + + list_splice(after->list_node.next, new_ofgroup->buckets.next, + last->list_node.next); + } + + return 0; +} + +/* Appends all of the a copy of all the buckets from 'ofgroup' to 'new_ofgroup' + * with the exception of the bucket whose bucket id is 'command_bucket_id'. + * Special 'command_bucket_id' values OFPG15_BUCKET_FIRST, OFPG15_BUCKET_LAST + * and OFPG15_BUCKET_ALL are also honored. */ +static enum ofperr +copy_buckets_for_remove_bucket(const struct ofgroup *ofgroup, + struct ofgroup *new_ofgroup, + uint32_t command_bucket_id) { - struct ofgroup *ofgroup; - struct ofgroup *victim; - enum ofperr error; + const struct ofputil_bucket *skip = NULL; - if (gm->group_id > OFPG_MAX) { - return OFPERR_OFPGMFC_INVALID_GROUP; + if (command_bucket_id == OFPG15_BUCKET_ALL) { + return 0; } - if (gm->type > OFPGT11_FF) { - return OFPERR_OFPGMFC_BAD_TYPE; + if (command_bucket_id == OFPG15_BUCKET_FIRST) { + if (!list_is_empty(&ofgroup->buckets)) { + skip = ofputil_bucket_list_front(&ofgroup->buckets); + } + } else if (command_bucket_id == OFPG15_BUCKET_LAST) { + if (!list_is_empty(&ofgroup->buckets)) { + skip = ofputil_bucket_list_back(&ofgroup->buckets); + } + } else { + skip = ofputil_bucket_find(&ofgroup->buckets, command_bucket_id); + if (!skip) { + return OFPERR_OFPGMFC_UNKNOWN_BUCKET; + } } - victim = ofproto->ofproto_class->group_alloc(); - if (!victim) { - VLOG_WARN_RL(&rl, "%s: failed to allocate group", ofproto->name); - return OFPERR_OFPGMFC_OUT_OF_GROUPS; + ofputil_bucket_clone_list(&new_ofgroup->buckets, &ofgroup->buckets, skip); + + return 0; +} + +/* Implements OFPGC11_MODIFY, OFPGC15_INSERT_BUCKET and + * OFPGC15_REMOVE_BUCKET. Returns 0 on success or an OpenFlow error code + * on failure. + * + * Note that the group is re-created and then replaces the old group in + * ofproto's ofgroup hash map. Thus, the group is never altered while users of + * the xlate module hold a pointer to the group. */ +static enum ofperr +modify_group(struct ofproto *ofproto, struct ofputil_group_mod *gm) +{ + struct ofgroup *ofgroup, *new_ofgroup, *retiring; + enum ofperr error; + + error = init_group(ofproto, gm, &new_ofgroup); + if (error) { + return error; } - if (!ofproto_group_write_lookup(ofproto, gm->group_id, &ofgroup)) { + retiring = new_ofgroup; + + ovs_rwlock_wrlock(&ofproto->groups_rwlock); + if (!ofproto_group_lookup__(ofproto, gm->group_id, &ofgroup)) { error = OFPERR_OFPGMFC_UNKNOWN_GROUP; - goto free_out; + goto out; } - /* Both group's and its container's write locks held now. - * Also, n_groups[] is protected by ofproto->groups_rwlock. */ + + /* Ofproto's group write lock is held now. */ if (ofgroup->type != gm->type && ofproto->n_groups[gm->type] >= ofproto->ogf.max_groups[gm->type]) { error = OFPERR_OFPGMFC_OUT_OF_GROUPS; - goto unlock_out; + goto out; } - *victim = *ofgroup; - list_move(&victim->buckets, &ofgroup->buckets); + /* Manipulate bucket list for bucket commands */ + if (gm->command == OFPGC15_INSERT_BUCKET) { + error = copy_buckets_for_insert_bucket(ofgroup, new_ofgroup, + gm->command_bucket_id); + } else if (gm->command == OFPGC15_REMOVE_BUCKET) { + error = copy_buckets_for_remove_bucket(ofgroup, new_ofgroup, + gm->command_bucket_id); + } + if (error) { + goto out; + } - ofgroup->type = gm->type; - list_move(&ofgroup->buckets, &gm->buckets); - ofgroup->n_buckets = list_size(&ofgroup->buckets); + /* The group creation time does not change during modification. */ + *CONST_CAST(long long int *, &(new_ofgroup->created)) = ofgroup->created; + *CONST_CAST(long long int *, &(new_ofgroup->modified)) = time_msec(); - error = ofproto->ofproto_class->group_modify(ofgroup, victim); - if (!error) { - ofputil_bucket_list_destroy(&victim->buckets); - ofproto->n_groups[victim->type]--; - ofproto->n_groups[ofgroup->type]++; - ofgroup->modified = time_msec(); - } else { - ofputil_bucket_list_destroy(&ofgroup->buckets); + error = ofproto->ofproto_class->group_modify(new_ofgroup); + if (error) { + goto out; + } - *ofgroup = *victim; - list_move(&ofgroup->buckets, &victim->buckets); + retiring = ofgroup; + /* Replace ofgroup in ofproto's groups hash map with new_ofgroup. */ + hmap_remove(&ofproto->groups, &ofgroup->hmap_node); + hmap_insert(&ofproto->groups, &new_ofgroup->hmap_node, + hash_int(new_ofgroup->group_id, 0)); + if (ofgroup->type != new_ofgroup->type) { + ofproto->n_groups[ofgroup->type]--; + ofproto->n_groups[new_ofgroup->type]++; } - unlock_out: - ovs_rwlock_unlock(&ofgroup->rwlock); +out: + ofproto_group_unref(retiring); ovs_rwlock_unlock(&ofproto->groups_rwlock); - free_out: - ofproto->ofproto_class->group_dealloc(victim); return error; } @@ -5714,25 +6461,18 @@ /* Delete all flow entries containing this group in a group action */ match_init_catchall(&match); flow_mod_init(&fm, &match, 0, NULL, 0, OFPFC_DELETE); + fm.delete_reason = OFPRR_GROUP_DELETE; fm.out_group = ofgroup->group_id; - handle_flow_mod__(ofproto, NULL, &fm, NULL); + handle_flow_mod__(ofproto, &fm, NULL); - /* Must wait until existing readers are done, - * while holding the container's write lock at the same time. */ - ovs_rwlock_wrlock(&ofgroup->rwlock); hmap_remove(&ofproto->groups, &ofgroup->hmap_node); /* No-one can find this group any more. */ ofproto->n_groups[ofgroup->type]--; ovs_rwlock_unlock(&ofproto->groups_rwlock); - - ofproto->ofproto_class->group_destruct(ofgroup); - ofputil_bucket_list_destroy(&ofgroup->buckets); - ovs_rwlock_unlock(&ofgroup->rwlock); - ovs_rwlock_destroy(&ofgroup->rwlock); - ofproto->ofproto_class->group_dealloc(ofgroup); + ofproto_group_unref(ofgroup); } -/* Implements OFPGC_DELETE. */ +/* Implements OFPGC11_DELETE. */ static void delete_group(struct ofproto *ofproto, uint32_t group_id) { @@ -5791,6 +6531,12 @@ delete_group(ofproto, gm.group_id); return 0; + case OFPGC15_INSERT_BUCKET: + return modify_group(ofproto, &gm); + + case OFPGC15_REMOVE_BUCKET: + return modify_group(ofproto, &gm); + default: if (gm.command > OFPGC11_DELETE) { VLOG_WARN_RL(&rl, "%s: Invalid group_mod command type %d", @@ -5800,65 +6546,270 @@ } } -enum ofproto_table_config -ofproto_table_get_config(const struct ofproto *ofproto, uint8_t table_id) +enum ofputil_table_miss +ofproto_table_get_miss_config(const struct ofproto *ofproto, uint8_t table_id) { - unsigned int value; - atomic_read(&ofproto->tables[table_id].config, &value); - return (enum ofproto_table_config)value; + enum ofputil_table_miss value; + + atomic_read_relaxed(&ofproto->tables[table_id].miss_config, &value); + return value; } static enum ofperr table_mod(struct ofproto *ofproto, const struct ofputil_table_mod *tm) { - /* Only accept currently supported configurations */ - if (tm->config & ~OFPTC11_TABLE_MISS_MASK) { - return OFPERR_OFPTMFC_BAD_CONFIG; + if (!check_table_id(ofproto, tm->table_id)) { + return OFPERR_OFPTMFC_BAD_TABLE; + } else if (tm->miss_config != OFPUTIL_TABLE_MISS_DEFAULT) { + if (tm->table_id == OFPTT_ALL) { + int i; + for (i = 0; i < ofproto->n_tables; i++) { + atomic_store_relaxed(&ofproto->tables[i].miss_config, + tm->miss_config); + } + } else { + atomic_store_relaxed(&ofproto->tables[tm->table_id].miss_config, + tm->miss_config); + } } + return 0; +} - if (tm->table_id == OFPTT_ALL) { - int i; - for (i = 0; i < ofproto->n_tables; i++) { - atomic_store(&ofproto->tables[i].config, - (unsigned int)tm->config); - } - } else if (!check_table_id(ofproto, tm->table_id)) { - return OFPERR_OFPTMFC_BAD_TABLE; - } else { - atomic_store(&ofproto->tables[tm->table_id].config, - (unsigned int)tm->config); +static enum ofperr +handle_table_mod(struct ofconn *ofconn, const struct ofp_header *oh) +{ + struct ofproto *ofproto = ofconn_get_ofproto(ofconn); + struct ofputil_table_mod tm; + enum ofperr error; + + error = reject_slave_controller(ofconn); + if (error) { + return error; + } + + error = ofputil_decode_table_mod(oh, &tm); + if (error) { + return error; + } + + return table_mod(ofproto, &tm); +} + +static enum ofperr +do_bundle_flow_mod_start(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct ofp_bundle_entry *be) + OVS_REQUIRES(ofproto_mutex) +{ + switch (fm->command) { + case OFPFC_ADD: + return add_flow_start(ofproto, fm, &be->old_rules.stub[0], + &be->new_rules.stub[0]); + case OFPFC_MODIFY: + return modify_flows_start_loose(ofproto, fm, &be->old_rules, + &be->new_rules); + case OFPFC_MODIFY_STRICT: + return modify_flow_start_strict(ofproto, fm, &be->old_rules, + &be->new_rules); + case OFPFC_DELETE: + return delete_flows_start_loose(ofproto, fm, &be->old_rules); + + case OFPFC_DELETE_STRICT: + return delete_flow_start_strict(ofproto, fm, &be->old_rules); + } + + return OFPERR_OFPFMFC_BAD_COMMAND; +} + +static void +do_bundle_flow_mod_revert(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + struct ofp_bundle_entry *be) + OVS_REQUIRES(ofproto_mutex) +{ + switch (fm->command) { + case OFPFC_ADD: + add_flow_revert(ofproto, fm, be->old_rules.stub[0], + be->new_rules.stub[0]); + break; + + case OFPFC_MODIFY: + case OFPFC_MODIFY_STRICT: + modify_flows_revert(ofproto, fm, &be->old_rules, &be->new_rules); + break; + + case OFPFC_DELETE: + case OFPFC_DELETE_STRICT: + delete_flows_revert(ofproto, &be->old_rules); + break; + + default: + break; } +} + +static void +do_bundle_flow_mod_finish(struct ofproto *ofproto, struct ofputil_flow_mod *fm, + const struct flow_mod_requester *req, + struct ofp_bundle_entry *be) + OVS_REQUIRES(ofproto_mutex) +{ + switch (fm->command) { + case OFPFC_ADD: + add_flow_finish(ofproto, fm, req, be->old_rules.stub[0], + be->new_rules.stub[0]); + break; - return 0; + case OFPFC_MODIFY: + case OFPFC_MODIFY_STRICT: + modify_flows_finish(ofproto, fm, req, &be->old_rules, &be->new_rules); + break; + + case OFPFC_DELETE: + case OFPFC_DELETE_STRICT: + delete_flows_finish(ofproto, fm, req, &be->old_rules); + break; + + default: + break; + } } +/* Commit phases (all while locking ofproto_mutex): + * + * 1. Begin: Gather resources and make changes visible in the next version. + * - Mark affected rules for removal in the next version. + * - Create new replacement rules, make visible in the next + * version. + * - Do not send any events or notifications. + * + * 2. Revert: Fail if any errors are found. After this point no errors are + * possible. No visible changes were made, so rollback is minimal (remove + * added invisible rules, restore visibility of rules marked for removal). + * + * 3. Finish: Make the changes visible for lookups. Insert replacement rules to + * the ofproto provider. Remove replaced and deleted rules from ofproto data + * structures, and Schedule postponed removal of deleted rules from the + * classifier. Send notifications, buffered packets, etc. + */ static enum ofperr -handle_table_mod(struct ofconn *ofconn, const struct ofp_header *oh) +do_bundle_commit(struct ofconn *ofconn, uint32_t id, uint16_t flags) { struct ofproto *ofproto = ofconn_get_ofproto(ofconn); - struct ofputil_table_mod tm; + cls_version_t visible_version = ofproto->tables_version; + struct ofp_bundle *bundle; + struct ofp_bundle_entry *be; enum ofperr error; - error = reject_slave_controller(ofconn); - if (error) { - return error; + bundle = ofconn_get_bundle(ofconn, id); + + if (!bundle) { + return OFPERR_OFPBFC_BAD_ID; } + if (bundle->flags != flags) { + error = OFPERR_OFPBFC_BAD_FLAGS; + } else { + bool prev_is_port_mod = false; - error = ofputil_decode_table_mod(oh, &tm); - if (error) { - return error; + error = 0; + ovs_mutex_lock(&ofproto_mutex); + + /* 1. Begin. */ + LIST_FOR_EACH (be, node, &bundle->msg_list) { + if (be->type == OFPTYPE_PORT_MOD) { + /* Our port mods are not atomic. */ + if (flags & OFPBF_ATOMIC) { + error = OFPERR_OFPBFC_MSG_FAILED; + } else { + prev_is_port_mod = true; + error = port_mod_start(ofconn, &be->pm, &be->port); + } + } else if (be->type == OFPTYPE_FLOW_MOD) { + /* Flow mods between port mods are applied as a single + * version, but the versions are published only after + * we know the commit is successful. */ + if (prev_is_port_mod) { + ++ofproto->tables_version; + } + prev_is_port_mod = false; + error = do_bundle_flow_mod_start(ofproto, &be->fm, be); + } else { + OVS_NOT_REACHED(); + } + if (error) { + break; + } else { + /* Store the version in which the changes should take + * effect. */ + be->version = ofproto->tables_version + 1; + } + } + + if (error) { + /* Send error referring to the original message. */ + if (error) { + ofconn_send_error(ofconn, be->ofp_msg, error); + error = OFPERR_OFPBFC_MSG_FAILED; + } + + /* 2. Revert. Undo all the changes made above. */ + LIST_FOR_EACH_REVERSE_CONTINUE(be, node, &bundle->msg_list) { + if (be->type == OFPTYPE_FLOW_MOD) { + do_bundle_flow_mod_revert(ofproto, &be->fm, be); + } + /* Nothing needs to be reverted for a port mod. */ + } + } else { + /* 4. Finish. */ + LIST_FOR_EACH (be, node, &bundle->msg_list) { + /* Bump the lookup version to the one of the current message. + * This makes all the changes in the bundle at this version + * visible to lookups at once. */ + if (visible_version < be->version) { + visible_version = be->version; + ofproto->ofproto_class->set_tables_version( + ofproto, visible_version); + } + if (be->type == OFPTYPE_FLOW_MOD) { + struct flow_mod_requester req = { ofconn, be->ofp_msg }; + + do_bundle_flow_mod_finish(ofproto, &be->fm, &req, be); + } else if (be->type == OFPTYPE_PORT_MOD) { + /* Perform the actual port mod. This is not atomic, i.e., + * the effects will be immediately seen by upcall + * processing regardless of the lookup version. It should + * be noted that port configuration changes can originate + * also from OVSDB changes asynchronously to all upcall + * processing. */ + port_mod_finish(ofconn, &be->pm, be->port); + } + } + } + + /* Reset the tables_version. */ + ofproto->tables_version = visible_version; + + ofmonitor_flush(ofproto->connmgr); + ovs_mutex_unlock(&ofproto_mutex); + + run_rule_executes(ofproto); } - return table_mod(ofproto, &tm); + /* The bundle is discarded regardless the outcome. */ + ofp_bundle_remove__(ofconn, bundle, !error); + return error; } static enum ofperr handle_bundle_control(struct ofconn *ofconn, const struct ofp_header *oh) { - enum ofperr error; struct ofputil_bundle_ctrl_msg bctrl; - struct ofpbuf *buf; struct ofputil_bundle_ctrl_msg reply; + struct ofpbuf *buf; + enum ofperr error; + + error = reject_slave_controller(ofconn); + if (error) { + return error; + } error = ofputil_decode_bundle_ctrl(oh, &bctrl); if (error) { @@ -5877,7 +6828,7 @@ reply.type = OFPBCT_CLOSE_REPLY;; break; case OFPBCT_COMMIT_REQUEST: - error = ofp_bundle_commit(ofconn, bctrl.bundle_id, bctrl.flags); + error = do_bundle_commit(ofconn, bctrl.bundle_id, bctrl.flags); reply.type = OFPBCT_COMMIT_REPLY; break; case OFPBCT_DISCARD_REQUEST: @@ -5900,26 +6851,67 @@ return error; } - static enum ofperr handle_bundle_add(struct ofconn *ofconn, const struct ofp_header *oh) { + struct ofproto *ofproto = ofconn_get_ofproto(ofconn); enum ofperr error; struct ofputil_bundle_add_msg badd; + struct ofp_bundle_entry *bmsg; + enum ofptype type; - error = ofputil_decode_bundle_add(oh, &badd); + error = reject_slave_controller(ofconn); + if (error) { + return error; + } + + error = ofputil_decode_bundle_add(oh, &badd, &type); if (error) { return error; } - return ofp_bundle_add_message(ofconn, &badd); + bmsg = ofp_bundle_entry_alloc(type, badd.msg); + + if (type == OFPTYPE_PORT_MOD) { + error = ofputil_decode_port_mod(badd.msg, &bmsg->pm, false); + } else if (type == OFPTYPE_FLOW_MOD) { + struct ofpbuf ofpacts; + uint64_t ofpacts_stub[1024 / 8]; + + ofpbuf_use_stub(&ofpacts, ofpacts_stub, sizeof ofpacts_stub); + error = ofputil_decode_flow_mod(&bmsg->fm, badd.msg, + ofconn_get_protocol(ofconn), + &ofpacts, + u16_to_ofp(ofproto->max_ports), + ofproto->n_tables); + /* Move actions to heap. */ + bmsg->fm.ofpacts = ofpbuf_steal_data(&ofpacts); + + if (!error && bmsg->fm.ofpacts_len) { + error = ofproto_check_ofpacts(ofproto, bmsg->fm.ofpacts, + bmsg->fm.ofpacts_len); + } + } else { + OVS_NOT_REACHED(); + } + + if (!error) { + error = ofp_bundle_add_message(ofconn, badd.bundle_id, badd.flags, + bmsg); + } + + if (error) { + ofp_bundle_entry_free(bmsg); + } + + return error; } static enum ofperr handle_openflow__(struct ofconn *ofconn, const struct ofpbuf *msg) OVS_EXCLUDED(ofproto_mutex) { - const struct ofp_header *oh = ofpbuf_data(msg); + const struct ofp_header *oh = msg->data; enum ofptype type; enum ofperr error; @@ -6016,6 +7008,9 @@ case OFPTYPE_TABLE_STATS_REQUEST: return handle_table_stats_request(ofconn, oh); + case OFPTYPE_TABLE_FEATURES_STATS_REQUEST: + return handle_table_features_request(ofconn, oh); + case OFPTYPE_PORT_STATS_REQUEST: return handle_port_stats_request(ofconn, oh); @@ -6080,7 +7075,6 @@ case OFPTYPE_METER_STATS_REPLY: case OFPTYPE_METER_CONFIG_STATS_REPLY: case OFPTYPE_METER_FEATURES_STATS_REPLY: - case OFPTYPE_TABLE_FEATURES_STATS_REQUEST: case OFPTYPE_TABLE_FEATURES_STATS_REPLY: case OFPTYPE_ROLE_STATUS: default: @@ -6092,376 +7086,52 @@ } } -static bool +static void handle_openflow(struct ofconn *ofconn, const struct ofpbuf *ofp_msg) OVS_EXCLUDED(ofproto_mutex) { - int error = handle_openflow__(ofconn, ofp_msg); - if (error && error != OFPROTO_POSTPONE) { - ofconn_send_error(ofconn, ofpbuf_data(ofp_msg), error); + enum ofperr error = handle_openflow__(ofconn, ofp_msg); + + if (error) { + ofconn_send_error(ofconn, ofp_msg->data, error); } COVERAGE_INC(ofproto_recv_openflow); - return error != OFPROTO_POSTPONE; } /* Asynchronous operations. */ -/* Creates and returns a new ofopgroup that is not associated with any - * OpenFlow connection. - * - * The caller should add operations to the returned group with - * ofoperation_create() and then submit it with ofopgroup_submit(). */ -static struct ofopgroup * -ofopgroup_create_unattached(struct ofproto *ofproto) - OVS_REQUIRES(ofproto_mutex) -{ - struct ofopgroup *group = xzalloc(sizeof *group); - group->ofproto = ofproto; - list_init(&group->ofproto_node); - list_init(&group->ops); - list_init(&group->ofconn_node); - return group; -} - -/* Creates and returns a new ofopgroup for 'ofproto'. - * - * If 'ofconn' is NULL, the new ofopgroup is not associated with any OpenFlow - * connection. The 'request' and 'buffer_id' arguments are ignored. - * - * If 'ofconn' is nonnull, then the new ofopgroup is associated with 'ofconn'. - * If the ofopgroup eventually fails, then the error reply will include - * 'request'. If the ofopgroup eventually succeeds, then the packet with - * buffer id 'buffer_id' on 'ofconn' will be sent by 'ofconn''s ofproto. - * - * The caller should add operations to the returned group with - * ofoperation_create() and then submit it with ofopgroup_submit(). */ -static struct ofopgroup * -ofopgroup_create(struct ofproto *ofproto, struct ofconn *ofconn, - const struct ofp_header *request, uint32_t buffer_id) - OVS_REQUIRES(ofproto_mutex) -{ - struct ofopgroup *group = ofopgroup_create_unattached(ofproto); - if (ofconn) { - size_t request_len = ntohs(request->length); - - ovs_assert(ofconn_get_ofproto(ofconn) == ofproto); - - ofconn_add_opgroup(ofconn, &group->ofconn_node); - group->ofconn = ofconn; - group->request = xmemdup(request, MIN(request_len, 64)); - group->buffer_id = buffer_id; - } - return group; -} - -/* Submits 'group' for processing. - * - * If 'group' contains no operations (e.g. none were ever added, or all of the - * ones that were added completed synchronously), then it is destroyed - * immediately. Otherwise it is added to the ofproto's list of pending - * groups. */ -static void -ofopgroup_submit(struct ofopgroup *group) - OVS_REQUIRES(ofproto_mutex) -{ - if (!group->n_running) { - ofopgroup_complete(group); - } else { - list_push_back(&group->ofproto->pending, &group->ofproto_node); - group->ofproto->n_pending++; - } -} - static void -ofopgroup_complete(struct ofopgroup *group) +send_buffered_packet(const struct flow_mod_requester *req, uint32_t buffer_id, + struct rule *rule) OVS_REQUIRES(ofproto_mutex) { - struct ofproto *ofproto = group->ofproto; - - struct ofconn *abbrev_ofconn; - ovs_be32 abbrev_xid; - - struct ofoperation *op, *next_op; - int error; - - ovs_assert(!group->n_running); - - error = 0; - LIST_FOR_EACH (op, group_node, &group->ops) { - if (op->error) { - error = op->error; - break; - } - } - - if (!error && group->ofconn && group->buffer_id != UINT32_MAX) { - LIST_FOR_EACH (op, group_node, &group->ops) { - if (op->type != OFOPERATION_DELETE) { - struct ofpbuf *packet; - ofp_port_t in_port; - - error = ofconn_pktbuf_retrieve(group->ofconn, group->buffer_id, - &packet, &in_port); - if (packet) { - struct rule_execute *re; - - ovs_assert(!error); - - ofproto_rule_ref(op->rule); - - re = xmalloc(sizeof *re); - re->rule = op->rule; - re->in_port = in_port; - re->packet = packet; - - if (!guarded_list_push_back(&ofproto->rule_executes, - &re->list_node, 1024)) { - ofproto_rule_unref(op->rule); - ofpbuf_delete(re->packet); - free(re); - } - } - break; - } - } - } - - if (!error && !list_is_empty(&group->ofconn_node)) { - abbrev_ofconn = group->ofconn; - abbrev_xid = group->request->xid; - } else { - abbrev_ofconn = NULL; - abbrev_xid = htonl(0); - } - LIST_FOR_EACH_SAFE (op, next_op, group_node, &group->ops) { - struct rule *rule = op->rule; - - /* We generally want to report the change to active OpenFlow flow - monitors (e.g. NXST_FLOW_MONITOR). There are three exceptions: - - - The operation failed. - - - The affected rule is not visible to controllers. - - - The operation's only effect was to update rule->modified. */ - if (!(op->error - || ofproto_rule_is_hidden(rule) - || (op->type == OFOPERATION_MODIFY - && !op->actions - && rule->flow_cookie == op->flow_cookie))) { - /* Check that we can just cast from ofoperation_type to - * nx_flow_update_event. */ - enum nx_flow_update_event event_type; - - switch (op->type) { - case OFOPERATION_ADD: - case OFOPERATION_REPLACE: - event_type = NXFME_ADDED; - break; - - case OFOPERATION_DELETE: - event_type = NXFME_DELETED; - break; - - case OFOPERATION_MODIFY: - event_type = NXFME_MODIFIED; - break; - - default: - OVS_NOT_REACHED(); - } + if (req && req->ofconn && buffer_id != UINT32_MAX) { + struct ofproto *ofproto = ofconn_get_ofproto(req->ofconn); + struct dp_packet *packet; + ofp_port_t in_port; + enum ofperr error; + + error = ofconn_pktbuf_retrieve(req->ofconn, buffer_id, &packet, + &in_port); + if (packet) { + struct rule_execute *re; + + ofproto_rule_ref(rule); + + re = xmalloc(sizeof *re); + re->rule = rule; + re->in_port = in_port; + re->packet = packet; - ofmonitor_report(ofproto->connmgr, rule, event_type, - op->reason, abbrev_ofconn, abbrev_xid); - } - - rule->pending = NULL; - - switch (op->type) { - case OFOPERATION_ADD: - if (!op->error) { - uint16_t vid_mask; - - vid_mask = minimask_get_vid_mask(&rule->cr.match.mask); - if (vid_mask == VLAN_VID_MASK) { - if (ofproto->vlan_bitmap) { - uint16_t vid = miniflow_get_vid(&rule->cr.match.flow); - if (!bitmap_is_set(ofproto->vlan_bitmap, vid)) { - bitmap_set1(ofproto->vlan_bitmap, vid); - ofproto->vlans_changed = true; - } - } else { - ofproto->vlans_changed = true; - } - } - } else { - oftable_remove_rule(rule); + if (!guarded_list_push_back(&ofproto->rule_executes, + &re->list_node, 1024)) { ofproto_rule_unref(rule); + dp_packet_delete(re->packet); + free(re); } - break; - - case OFOPERATION_DELETE: - ovs_assert(!op->error); - ofproto_rule_unref(rule); - op->rule = NULL; - break; - - case OFOPERATION_MODIFY: - case OFOPERATION_REPLACE: - if (!op->error) { - long long int now = time_msec(); - - ovs_mutex_lock(&rule->mutex); - rule->modified = now; - if (op->type == OFOPERATION_REPLACE) { - rule->created = now; - } - ovs_mutex_unlock(&rule->mutex); - } else { - ofproto_rule_change_cookie(ofproto, rule, op->flow_cookie); - ovs_mutex_lock(&rule->mutex); - rule->idle_timeout = op->idle_timeout; - rule->hard_timeout = op->hard_timeout; - ovs_mutex_unlock(&rule->mutex); - if (op->actions) { - const struct rule_actions *old_actions; - - ovs_mutex_lock(&rule->mutex); - old_actions = rule_get_actions(rule); - ovsrcu_set(&rule->actions, op->actions); - ovs_mutex_unlock(&rule->mutex); - - op->actions = NULL; - rule_actions_destroy(old_actions); - } - rule->flags = op->flags; - } - break; - - default: - OVS_NOT_REACHED(); - } - - ofoperation_destroy(op); - } - - ofmonitor_flush(ofproto->connmgr); - - if (!list_is_empty(&group->ofproto_node)) { - ovs_assert(ofproto->n_pending > 0); - ofproto->n_pending--; - list_remove(&group->ofproto_node); - } - if (!list_is_empty(&group->ofconn_node)) { - list_remove(&group->ofconn_node); - if (error) { - ofconn_send_error(group->ofconn, group->request, error); + } else { + ofconn_send_error(req->ofconn, req->request, error); } - connmgr_retry(ofproto->connmgr); - } - free(group->request); - free(group); -} - -/* Initiates a new operation on 'rule', of the specified 'type', within - * 'group'. Prior to calling, 'rule' must not have any pending operation. - * - * For a 'type' of OFOPERATION_DELETE, 'reason' should specify the reason that - * the flow is being deleted. For other 'type's, 'reason' is ignored (use 0). - * - * Returns the newly created ofoperation (which is also available as - * rule->pending). */ -static struct ofoperation * -ofoperation_create(struct ofopgroup *group, struct rule *rule, - enum ofoperation_type type, - enum ofp_flow_removed_reason reason) - OVS_REQUIRES(ofproto_mutex) -{ - struct ofproto *ofproto = group->ofproto; - struct ofoperation *op; - - ovs_assert(!rule->pending); - - op = rule->pending = xzalloc(sizeof *op); - op->group = group; - list_push_back(&group->ops, &op->group_node); - op->rule = rule; - op->type = type; - op->reason = reason; - op->flow_cookie = rule->flow_cookie; - ovs_mutex_lock(&rule->mutex); - op->idle_timeout = rule->idle_timeout; - op->hard_timeout = rule->hard_timeout; - ovs_mutex_unlock(&rule->mutex); - op->flags = rule->flags; - - group->n_running++; - - if (type == OFOPERATION_DELETE) { - hmap_insert(&ofproto->deletions, &op->hmap_node, - cls_rule_hash(&rule->cr, rule->table_id)); - } - - return op; -} - -static void -ofoperation_destroy(struct ofoperation *op) - OVS_REQUIRES(ofproto_mutex) -{ - struct ofopgroup *group = op->group; - - if (op->rule) { - op->rule->pending = NULL; - } - if (op->type == OFOPERATION_DELETE) { - hmap_remove(&group->ofproto->deletions, &op->hmap_node); - } - list_remove(&op->group_node); - rule_actions_destroy(op->actions); - free(op); -} - -/* Indicates that 'op' completed with status 'error', which is either 0 to - * indicate success or an OpenFlow error code on failure. - * - * If 'error' is 0, indicating success, the operation will be committed - * permanently to the flow table. - * - * If 'error' is nonzero, then generally the operation will be rolled back: - * - * - If 'op' is an "add flow" operation, ofproto removes the new rule or - * restores the original rule. The caller must have uninitialized any - * derived state in the new rule, as in step 5 of in the "Life Cycle" in - * ofproto/ofproto-provider.h. ofoperation_complete() performs steps 6 and - * and 7 for the new rule, calling its ->rule_dealloc() function. - * - * - If 'op' is a "modify flow" operation, ofproto restores the original - * actions. - * - * - 'op' must not be a "delete flow" operation. Removing a rule is not - * allowed to fail. It must always succeed. - * - * Please see the large comment in ofproto/ofproto-provider.h titled - * "Asynchronous Operation Support" for more information. */ -void -ofoperation_complete(struct ofoperation *op, enum ofperr error) -{ - struct ofopgroup *group = op->group; - - ovs_assert(group->n_running > 0); - ovs_assert(!error || op->type != OFOPERATION_DELETE); - - op->error = error; - if (!--group->n_running && !list_is_empty(&group->ofproto_node)) { - /* This function can be called from ->rule_construct(), in which case - * ofproto_mutex is held, or it can be called from ->run(), in which - * case ofproto_mutex is not held. But only in the latter case can we - * arrive here, so we can safely take ofproto_mutex now. */ - ovs_mutex_lock(&ofproto_mutex); - ovs_assert(op->rule->pending == op); - ofopgroup_complete(group); - ovs_mutex_unlock(&ofproto_mutex); } } @@ -6534,24 +7204,6 @@ return false; } - -/* Searches 'ofproto' for tables that have more flows than their configured - * maximum and that have flow eviction enabled, and evicts as many flows as - * necessary and currently feasible from them. - * - * This triggers only when an OpenFlow table has N flows in it and then the - * client configures a maximum number of flows less than N. */ -static void -ofproto_evict(struct ofproto *ofproto) -{ - struct oftable *table; - - ovs_mutex_lock(&ofproto_mutex); - OFPROTO_FOR_EACH_TABLE (table, ofproto) { - evict_rules_from_table(ofproto, table, 0); - } - ovs_mutex_unlock(&ofproto_mutex); -} /* Eviction groups. */ @@ -6759,9 +7411,16 @@ oftable_init(struct oftable *table) { memset(table, 0, sizeof *table); - classifier_init(&table->cls, flow_segment_u32s); + classifier_init(&table->cls, flow_segment_u64s); table->max_flows = UINT_MAX; - atomic_init(&table->config, (unsigned int)OFPROTO_TABLE_MISS_DEFAULT); + table->n_flows = 0; + atomic_init(&table->miss_config, OFPUTIL_TABLE_MISS_DEFAULT); + + classifier_set_prefix_fields(&table->cls, default_prefix_fields, + ARRAY_SIZE(default_prefix_fields)); + + atomic_init(&table->n_matched, 0); + atomic_init(&table->n_missed, 0); } /* Destroys 'table', including its classifier and eviction groups. @@ -6770,9 +7429,7 @@ static void oftable_destroy(struct oftable *table) { - fat_rwlock_rdlock(&table->cls.rwlock); ovs_assert(classifier_is_empty(&table->cls)); - fat_rwlock_unlock(&table->cls.rwlock); oftable_disable_eviction(table); classifier_destroy(&table->cls); free(table->name); @@ -6833,7 +7490,6 @@ const struct mf_subfield *fields, size_t n_fields) OVS_REQUIRES(ofproto_mutex) { - struct cls_cursor cursor; struct rule *rule; if (table->eviction_fields @@ -6854,76 +7510,52 @@ hmap_init(&table->eviction_groups_by_id); heap_init(&table->eviction_groups_by_size); - fat_rwlock_rdlock(&table->cls.rwlock); - cls_cursor_init(&cursor, &table->cls, NULL); - CLS_CURSOR_FOR_EACH (rule, cr, &cursor) { + CLS_FOR_EACH (rule, cr, &table->cls) { eviction_group_add_rule(rule); } - fat_rwlock_unlock(&table->cls.rwlock); } -/* Removes 'rule' from the oftable that contains it. */ +/* Inserts 'rule' from the ofproto data structures BEFORE caller has inserted + * it to the classifier. */ static void -oftable_remove_rule__(struct ofproto *ofproto, struct rule *rule) +ofproto_rule_insert__(struct ofproto *ofproto, struct rule *rule) OVS_REQUIRES(ofproto_mutex) { - struct classifier *cls = &ofproto->tables[rule->table_id].cls; + const struct rule_actions *actions = rule_get_actions(rule); - fat_rwlock_wrlock(&cls->rwlock); - classifier_remove(cls, CONST_CAST(struct cls_rule *, &rule->cr)); - fat_rwlock_unlock(&cls->rwlock); - - cookies_remove(ofproto, rule); + ovs_assert(rule->removed); - eviction_group_remove_rule(rule); - if (!list_is_empty(&rule->expirable)) { - list_remove(&rule->expirable); + if (rule->hard_timeout || rule->idle_timeout) { + list_insert(&ofproto->expirable, &rule->expirable); } - if (!list_is_empty(&rule->meter_list_node)) { - list_remove(&rule->meter_list_node); - list_init(&rule->meter_list_node); + cookies_insert(ofproto, rule); + eviction_group_add_rule(rule); + if (actions->has_meter) { + meter_insert_rule(rule); } + rule->removed = false; } +/* Removes 'rule' from the ofproto data structures. Caller may have deferred + * the removal from the classifier. */ static void -oftable_remove_rule(struct rule *rule) - OVS_REQUIRES(ofproto_mutex) -{ - oftable_remove_rule__(rule->ofproto, rule); -} - -/* Inserts 'rule' into its oftable, which must not already contain any rule for - * the same cls_rule. */ -static void -oftable_insert_rule(struct rule *rule) +ofproto_rule_remove__(struct ofproto *ofproto, struct rule *rule) OVS_REQUIRES(ofproto_mutex) { - struct ofproto *ofproto = rule->ofproto; - struct oftable *table = &ofproto->tables[rule->table_id]; - const struct rule_actions *actions; - bool may_expire; + ovs_assert(!rule->removed); - ovs_mutex_lock(&rule->mutex); - may_expire = rule->hard_timeout || rule->idle_timeout; - ovs_mutex_unlock(&rule->mutex); + cookies_remove(ofproto, rule); - if (may_expire) { - list_insert(&ofproto->expirable, &rule->expirable); + eviction_group_remove_rule(rule); + if (!list_is_empty(&rule->expirable)) { + list_remove(&rule->expirable); } - - cookies_insert(ofproto, rule); - - actions = rule_get_actions(rule); - if (actions->provider_meter_id != UINT32_MAX) { - uint32_t meter_id = ofpacts_get_meter(actions->ofpacts, - actions->ofpacts_len); - struct meter *meter = ofproto->meters[meter_id]; - list_insert(&meter->rules, &rule->meter_list_node); + if (!list_is_empty(&rule->meter_list_node)) { + list_remove(&rule->meter_list_node); + list_init(&rule->meter_list_node); } - fat_rwlock_wrlock(&table->cls.rwlock); - classifier_insert(&table->cls, CONST_CAST(struct cls_rule *, &rule->cr)); - fat_rwlock_unlock(&table->cls.rwlock); - eviction_group_add_rule(rule); + + rule->removed = true; } /* unixctl commands. */ @@ -6988,19 +7620,16 @@ match_init_catchall(&match); match_set_vlan_vid_masked(&match, htons(VLAN_CFI), htons(VLAN_CFI)); - cls_rule_init(&target, &match, 0); + cls_rule_init(&target, &match, 0, CLS_MAX_VERSION); free(ofproto->vlan_bitmap); ofproto->vlan_bitmap = bitmap_allocate(4096); ofproto->vlans_changed = false; OFPROTO_FOR_EACH_TABLE (oftable, ofproto) { - struct cls_cursor cursor; struct rule *rule; - fat_rwlock_rdlock(&oftable->cls.rwlock); - cls_cursor_init(&cursor, &oftable->cls, &target); - CLS_CURSOR_FOR_EACH (rule, cr, &cursor) { + CLS_FOR_EACH_TARGET (rule, cr, &oftable->cls, &target) { if (minimask_get_vid_mask(&rule->cr.match.mask) == VLAN_VID_MASK) { uint16_t vid = miniflow_get_vid(&rule->cr.match.flow); @@ -7008,8 +7637,9 @@ bitmap_set1(ofproto->vlan_bitmap, vid); } } - fat_rwlock_unlock(&oftable->cls.rwlock); } + + cls_rule_destroy(&target); } /* Returns true if new VLANs have come into use by the flow table since the diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif.c --- openvswitch-2.3.1/ofproto/ofproto-dpif.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include "connmgr.h" #include "coverage.h" #include "cfm.h" +#include "ovs-lldp.h" #include "dpif.h" #include "dynamic-string.h" #include "fail-open.h" @@ -37,6 +38,7 @@ #include "lacp.h" #include "learn.h" #include "mac-learning.h" +#include "mcast-snooping.h" #include "meta-flow.h" #include "multipath.h" #include "netdev-vport.h" @@ -58,6 +60,8 @@ #include "ofproto-dpif-upcall.h" #include "ofproto-dpif-xlate.h" #include "poll-loop.h" +#include "ovs-rcu.h" +#include "ovs-router.h" #include "seq.h" #include "simap.h" #include "smap.h" @@ -66,16 +70,13 @@ #include "unaligned.h" #include "unixctl.h" #include "vlan-bitmap.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ofproto_dpif); COVERAGE_DEFINE(ofproto_dpif_expired); COVERAGE_DEFINE(packet_in_overflow); -/* No bfd/cfm status change. */ -#define NO_STATUS_CHANGE -1 - struct flow_miss; struct rule_dpif { @@ -87,6 +88,21 @@ * recently been processed by a revalidator. */ struct ovs_mutex stats_mutex; struct dpif_flow_stats stats OVS_GUARDED; + + /* In non-NULL, will point to a new rule (for which a reference is held) to + * which all the stats updates should be forwarded. This exists only + * transitionally when flows are replaced. + * + * Protected by stats_mutex. If both 'rule->stats_mutex' and + * 'rule->new_rule->stats_mutex' must be held together, acquire them in that + * order, */ + struct rule_dpif *new_rule OVS_GUARDED; + + /* If non-zero then the recirculation id that has + * been allocated for use with this rule. + * The recirculation id and associated internal flow should + * be freed when the rule is freed */ + uint32_t recirc_id; }; /* RULE_CAST() depends on this. */ @@ -107,7 +123,6 @@ struct ovs_mutex stats_mutex; uint64_t packet_count OVS_GUARDED; /* Number of packets received. */ uint64_t byte_count OVS_GUARDED; /* Number of bytes received. */ - struct bucket_counter *bucket_stats OVS_GUARDED; /* Bucket statistics. */ }; struct ofbundle { @@ -117,7 +132,7 @@ char *name; /* Identifier for log messages. */ /* Configuration. */ - struct list ports; /* Contains "struct ofport"s. */ + struct ovs_list ports; /* Contains "struct ofport"s. */ enum port_vlan_mode vlan_mode; /* VLAN mode */ int vlan; /* -1=trunk port, else a 12-bit VLAN ID. */ unsigned long *trunks; /* Bitmap of trunked VLANs, if 'vlan' == -1. @@ -136,21 +151,28 @@ static void bundle_del_port(struct ofport_dpif *); static void bundle_run(struct ofbundle *); static void bundle_wait(struct ofbundle *); +static void bundle_flush_macs(struct ofbundle *, bool); +static void bundle_move(struct ofbundle *, struct ofbundle *); static void stp_run(struct ofproto_dpif *ofproto); static void stp_wait(struct ofproto_dpif *ofproto); static int set_stp_port(struct ofport *, const struct ofproto_port_stp_settings *); +static void rstp_run(struct ofproto_dpif *ofproto); +static void set_rstp_port(struct ofport *, + const struct ofproto_port_rstp_settings *); + struct ofport_dpif { struct hmap_node odp_port_node; /* In dpif_backer's "odp_to_ofport_map". */ struct ofport up; odp_port_t odp_port; struct ofbundle *bundle; /* Bundle that contains this port, if any. */ - struct list bundle_node; /* In struct ofbundle's "ports" list. */ + struct ovs_list bundle_node;/* In struct ofbundle's "ports" list. */ struct cfm *cfm; /* Connectivity Fault Management, if any. */ struct bfd *bfd; /* BFD, if any. */ + struct lldp *lldp; /* lldp, if any. */ bool may_enable; /* May be enabled in bonds. */ bool is_tunnel; /* This port is a tunnel. */ bool is_layer3; /* This is a layer 3 port. */ @@ -162,6 +184,10 @@ enum stp_state stp_state; /* Always STP_DISABLED if STP not in use. */ long long int stp_state_entered; + /* Rapid Spanning Tree. */ + struct rstp_port *rstp_port; /* Rapid Spanning Tree Protocol, if any. */ + enum rstp_state rstp_state; /* Always RSTP_DISABLED if RSTP not in use. */ + /* Queue to DSCP mapping. */ struct ofproto_port_queue *qdscp; size_t n_qdscp; @@ -208,13 +234,9 @@ static void port_run(struct ofport_dpif *); static int set_bfd(struct ofport *, const struct smap *); static int set_cfm(struct ofport *, const struct cfm_settings *); +static int set_lldp(struct ofport *ofport_, const struct smap *cfg); static void ofport_update_peer(struct ofport_dpif *); -struct dpif_completion { - struct list list_node; - struct ofoperation *op; -}; - /* Reasons that we might need to revalidate every datapath flow, and * corresponding coverage counters. * @@ -226,17 +248,21 @@ enum revalidate_reason { REV_RECONFIGURE = 1, /* Switch configuration changed. */ REV_STP, /* Spanning tree protocol port status change. */ + REV_RSTP, /* RSTP port status change. */ REV_BOND, /* Bonding changed. */ REV_PORT_TOGGLED, /* Port enabled or disabled by CFM, LACP, ...*/ REV_FLOW_TABLE, /* Flow table changed. */ REV_MAC_LEARNING, /* Mac learning changed. */ + REV_MCAST_SNOOPING, /* Multicast snooping changed. */ }; COVERAGE_DEFINE(rev_reconfigure); COVERAGE_DEFINE(rev_stp); +COVERAGE_DEFINE(rev_rstp); COVERAGE_DEFINE(rev_bond); COVERAGE_DEFINE(rev_port_toggled); COVERAGE_DEFINE(rev_flow_table); COVERAGE_DEFINE(rev_mac_learning); +COVERAGE_DEFINE(rev_mcast_snooping); /* All datapaths of a given type share a single dpif backer instance. */ struct dpif_backer { @@ -254,18 +280,12 @@ bool recv_set_enable; /* Enables or disables receiving packets. */ - /* Recirculation. */ - struct recirc_id_pool *rid_pool; /* Recirculation ID pool. */ - bool enable_recirc; /* True if the datapath supports recirculation */ - - /* True if the datapath supports variable-length - * OVS_USERSPACE_ATTR_USERDATA in OVS_ACTION_ATTR_USERSPACE actions. - * False if the datapath supports only 8-byte (or shorter) userdata. */ - bool variable_length_userdata; - - /* Maximum number of MPLS label stack entries that the datapath supports - * in a match */ - size_t max_mpls_depth; + /* Version string of the datapath stored in OVSDB. */ + char *dp_version_string; + + /* Datapath feature support. */ + struct dpif_backer_support support; + struct atomic_count tnl_count; }; /* All existing ofproto_backer instances, indexed by ofproto->up.type. */ @@ -276,6 +296,8 @@ struct ofproto up; struct dpif_backer *backer; + ATOMIC(cls_version_t) tables_version; /* For classifier lookups. */ + uint64_t dump_seq; /* Last read of udpif_dump_seq(). */ /* Special OpenFlow rules. */ @@ -289,6 +311,7 @@ struct dpif_ipfix *ipfix; struct hmap bundles; /* Contains "struct ofbundle"s. */ struct mac_learning *ml; + struct mcast_snooping *ms; bool has_bonded_bundles; bool lacp_enabled; struct mbridge *mbridge; @@ -301,6 +324,10 @@ struct stp *stp; long long int stp_last_tick; + /* Rapid Spanning Tree. */ + struct rstp *rstp; + long long int rstp_last_tick; + /* VLAN splinters. */ struct ovs_mutex vsp_mutex; struct hmap realdev_vid_map OVS_GUARDED; /* (realdev,vid) -> vlandev. */ @@ -322,7 +349,8 @@ /* All existing ofproto_dpif instances, indexed by ->up.name. */ static struct hmap all_ofproto_dpifs = HMAP_INITIALIZER(&all_ofproto_dpifs); -static void ofproto_dpif_unixctl_init(void); +static bool ofproto_use_tnl_push_pop = true; +static void ofproto_unixctl_init(void); static inline struct ofproto_dpif * ofproto_dpif_cast(const struct ofproto *ofproto) @@ -334,19 +362,23 @@ size_t ofproto_dpif_get_max_mpls_depth(const struct ofproto_dpif *ofproto) { - return ofproto->backer->max_mpls_depth; + return ofproto->backer->support.max_mpls_depth; } bool ofproto_dpif_get_enable_recirc(const struct ofproto_dpif *ofproto) { - return ofproto->backer->enable_recirc; + return ofproto->backer->support.recirc; +} + +bool +ofproto_dpif_get_enable_ufid(struct dpif_backer *backer) +{ + return backer->support.ufid; } -static struct ofport_dpif *get_ofp_port(const struct ofproto_dpif *ofproto, - ofp_port_t ofp_port); static void ofproto_trace(struct ofproto_dpif *, struct flow *, - const struct ofpbuf *packet, + const struct dp_packet *packet, const struct ofpact[], size_t ofpacts_len, struct ds *); @@ -489,7 +521,12 @@ return 0; } - dpif_run(backer->dpif); + + if (dpif_run(backer->dpif)) { + backer->need_revalidate = REV_RECONFIGURE; + } + + udpif_run(backer->udpif); /* If vswitchd started with other_config:flow_restore_wait set as "true", * and the configuration has now changed to "false", enable receiving @@ -512,6 +549,8 @@ udpif_set_threads(backer->udpif, n_handlers, n_revalidators); } + dpif_poll_threads_set(backer->dpif, n_dpdk_rxqs, pmd_cpu_mask); + if (backer->need_revalidate) { struct ofproto_dpif *ofproto; struct simap_node *node; @@ -559,7 +598,8 @@ iter->odp_port = node ? u32_to_odp(node->data) : ODPP_NONE; if (tnl_port_reconfigure(iter, iter->up.netdev, - iter->odp_port)) { + iter->odp_port, + ovs_native_tunneling_is_on(ofproto), dp_port)) { backer->need_revalidate = REV_RECONFIGURE; } } @@ -571,12 +611,14 @@ simap_destroy(&tmp_backers); switch (backer->need_revalidate) { - case REV_RECONFIGURE: COVERAGE_INC(rev_reconfigure); break; - case REV_STP: COVERAGE_INC(rev_stp); break; - case REV_BOND: COVERAGE_INC(rev_bond); break; - case REV_PORT_TOGGLED: COVERAGE_INC(rev_port_toggled); break; - case REV_FLOW_TABLE: COVERAGE_INC(rev_flow_table); break; - case REV_MAC_LEARNING: COVERAGE_INC(rev_mac_learning); break; + case REV_RECONFIGURE: COVERAGE_INC(rev_reconfigure); break; + case REV_STP: COVERAGE_INC(rev_stp); break; + case REV_RSTP: COVERAGE_INC(rev_rstp); break; + case REV_BOND: COVERAGE_INC(rev_bond); break; + case REV_PORT_TOGGLED: COVERAGE_INC(rev_port_toggled); break; + case REV_FLOW_TABLE: COVERAGE_INC(rev_flow_table); break; + case REV_MAC_LEARNING: COVERAGE_INC(rev_mac_learning); break; + case REV_MCAST_SNOOPING: COVERAGE_INC(rev_mcast_snooping); break; } backer->need_revalidate = 0; @@ -588,18 +630,15 @@ continue; } - ovs_rwlock_wrlock(&xlate_rwlock); + xlate_txn_start(); xlate_ofproto_set(ofproto, ofproto->up.name, - ofproto->backer->dpif, ofproto->miss_rule, - ofproto->no_packet_in_rule, ofproto->ml, - ofproto->stp, ofproto->mbridge, - ofproto->sflow, ofproto->ipfix, - ofproto->netflow, ofproto->up.frag_handling, + ofproto->backer->dpif, ofproto->ml, + ofproto->stp, ofproto->rstp, ofproto->ms, + ofproto->mbridge, ofproto->sflow, ofproto->ipfix, + ofproto->netflow, ofproto->up.forward_bpdu, connmgr_has_in_band(ofproto->up.connmgr), - ofproto->backer->enable_recirc, - ofproto->backer->variable_length_userdata, - ofproto->backer->max_mpls_depth); + &ofproto->backer->support); HMAP_FOR_EACH (bundle, hmap_node, &ofproto->bundles) { xlate_bundle_set(ofproto, bundle, bundle->name, @@ -615,13 +654,14 @@ : -1; xlate_ofport_set(ofproto, ofport->bundle, ofport, ofport->up.ofp_port, ofport->odp_port, - ofport->up.netdev, ofport->cfm, - ofport->bfd, ofport->peer, stp_port, - ofport->qdscp, ofport->n_qdscp, - ofport->up.pp.config, ofport->up.pp.state, - ofport->is_tunnel, ofport->may_enable); + ofport->up.netdev, ofport->cfm, ofport->bfd, + ofport->lldp, ofport->peer, stp_port, + ofport->rstp_port, ofport->qdscp, + ofport->n_qdscp, ofport->up.pp.config, + ofport->up.pp.state, ofport->is_tunnel, + ofport->may_enable); } - ovs_rwlock_unlock(&xlate_rwlock); + xlate_txn_commit(); } udpif_revalidate(backer->udpif); @@ -783,7 +823,7 @@ static struct ofproto * alloc(void) { - struct ofproto_dpif *ofproto = xmalloc(sizeof *ofproto); + struct ofproto_dpif *ofproto = xzalloc(sizeof *ofproto); return &ofproto->up; } @@ -809,21 +849,20 @@ ovs_rwlock_destroy(&backer->odp_to_ofport_lock); hmap_destroy(&backer->odp_to_ofport_map); shash_find_and_delete(&all_dpif_backers, backer->type); - recirc_id_pool_destroy(backer->rid_pool); free(backer->type); + free(backer->dp_version_string); dpif_close(backer->dpif); free(backer); } /* Datapath port slated for removal from datapath. */ struct odp_garbage { - struct list list_node; + struct ovs_list list_node; odp_port_t odp_port; }; static bool check_variable_length_userdata(struct dpif_backer *backer); -static size_t check_max_mpls_depth(struct dpif_backer *backer); -static bool check_recirc(struct dpif_backer *backer); +static void check_support(struct dpif_backer *backer); static int open_dpif_backer(const char *type, struct dpif_backer **backerp) @@ -832,14 +871,16 @@ struct dpif_port_dump port_dump; struct dpif_port port; struct shash_node *node; - struct list garbage_list; - struct odp_garbage *garbage, *next; + struct ovs_list garbage_list; + struct odp_garbage *garbage; struct sset names; char *backer_name; const char *name; int error; + recirc_init(); + backer = shash_find_data(&all_dpif_backers, type); if (backer) { backer->refcount++; @@ -909,18 +950,15 @@ } dpif_port_dump_done(&port_dump); - LIST_FOR_EACH_SAFE (garbage, next, list_node, &garbage_list) { + LIST_FOR_EACH_POP (garbage, list_node, &garbage_list) { dpif_port_del(backer->dpif, garbage->odp_port); - list_remove(&garbage->list_node); free(garbage); } shash_add(&all_dpif_backers, type, backer); - backer->enable_recirc = check_recirc(backer); - backer->variable_length_userdata = check_variable_length_userdata(backer); - backer->max_mpls_depth = check_max_mpls_depth(backer); - backer->rid_pool = recirc_id_pool_create(); + check_support(backer); + atomic_count_init(&backer->tnl_count, 0); error = dpif_recv_set(backer->dpif, backer->recv_set_enable); if (error) { @@ -934,9 +972,23 @@ udpif_set_threads(backer->udpif, n_handlers, n_revalidators); } + /* This check fails if performed before udpif threads have been set, + * as the kernel module checks that the 'pid' in userspace action + * is non-zero. */ + backer->support.variable_length_userdata + = check_variable_length_userdata(backer); + backer->dp_version_string = dpif_get_dp_version(backer->dpif); + return error; } +bool +ovs_native_tunneling_is_on(struct ofproto_dpif *ofproto) +{ + return ofproto_use_tnl_push_pop && ofproto->backer->support.tnl_push_pop && + atomic_count_get(&ofproto->backer->tnl_count); +} + /* Tests whether 'backer''s datapath supports recirculation. Only newer * datapaths support OVS_KEY_ATTR_RECIRC_ID in keys. We need to disable some * features on older datapaths that don't support this feature. @@ -950,37 +1002,17 @@ struct flow flow; struct odputil_keybuf keybuf; struct ofpbuf key; - int error; - bool enable_recirc = false; + bool enable_recirc; memset(&flow, 0, sizeof flow); flow.recirc_id = 1; flow.dp_hash = 1; ofpbuf_use_stack(&key, &keybuf, sizeof keybuf); - odp_flow_key_from_flow(&key, &flow, NULL, 0); - - error = dpif_flow_put(backer->dpif, DPIF_FP_CREATE, - ofpbuf_data(&key), ofpbuf_size(&key), NULL, 0, NULL, - 0, NULL); - if (error && error != EEXIST) { - if (error != EINVAL) { - VLOG_WARN("%s: Reciculation flow probe failed (%s)", - dpif_name(backer->dpif), ovs_strerror(error)); - } - goto done; - } - - error = dpif_flow_del(backer->dpif, ofpbuf_data(&key), ofpbuf_size(&key), - NULL); - if (error) { - VLOG_WARN("%s: failed to delete recirculation feature probe flow", - dpif_name(backer->dpif)); - } + odp_flow_key_from_flow(&key, &flow, NULL, 0, true); + enable_recirc = dpif_probe_feature(backer->dpif, "recirculation", &key, + NULL); - enable_recirc = true; - -done: if (enable_recirc) { VLOG_INFO("%s: Datapath supports recirculation", dpif_name(backer->dpif)); @@ -992,6 +1024,39 @@ return enable_recirc; } +/* Tests whether 'dpif' supports unique flow ids. We can skip serializing + * some flow attributes for datapaths that support this feature. + * + * Returns true if 'dpif' supports UFID for flow operations. + * Returns false if 'dpif' does not support UFID. */ +static bool +check_ufid(struct dpif_backer *backer) +{ + struct flow flow; + struct odputil_keybuf keybuf; + struct ofpbuf key; + ovs_u128 ufid; + bool enable_ufid; + + memset(&flow, 0, sizeof flow); + flow.dl_type = htons(0x1234); + + ofpbuf_use_stack(&key, &keybuf, sizeof keybuf); + odp_flow_key_from_flow(&key, &flow, NULL, 0, true); + dpif_flow_hash(backer->dpif, key.data, key.size, &ufid); + + enable_ufid = dpif_probe_feature(backer->dpif, "UFID", &key, &ufid); + + if (enable_ufid) { + VLOG_INFO("%s: Datapath supports unique flow ids", + dpif_name(backer->dpif)); + } else { + VLOG_INFO("%s: Datapath does not support unique flow ids", + dpif_name(backer->dpif)); + } + return enable_ufid; +} + /* Tests whether 'backer''s datapath supports variable-length * OVS_USERSPACE_ATTR_USERDATA in OVS_ACTION_ATTR_USERSPACE actions. We need * to disable some features on older datapaths that don't support this @@ -1006,7 +1071,7 @@ struct eth_header *eth; struct ofpbuf actions; struct dpif_execute execute; - struct ofpbuf packet; + struct dp_packet packet; size_t start; int error; @@ -1025,21 +1090,21 @@ nl_msg_end_nested(&actions, start); /* Compose a dummy ethernet packet. */ - ofpbuf_init(&packet, ETH_HEADER_LEN); - eth = ofpbuf_put_zeros(&packet, ETH_HEADER_LEN); + dp_packet_init(&packet, ETH_HEADER_LEN); + eth = dp_packet_put_zeros(&packet, ETH_HEADER_LEN); eth->eth_type = htons(0x1234); /* Execute the actions. On older datapaths this fails with ERANGE, on * newer datapaths it succeeds. */ - execute.actions = ofpbuf_data(&actions); - execute.actions_len = ofpbuf_size(&actions); + execute.actions = actions.data; + execute.actions_len = actions.size; execute.packet = &packet; - execute.md = PKT_METADATA_INITIALIZER(0); execute.needs_help = false; + execute.probe = true; error = dpif_execute(backer->dpif, &execute); - ofpbuf_uninit(&packet); + dp_packet_uninit(&packet); ofpbuf_uninit(&actions); switch (error) { @@ -1079,30 +1144,16 @@ for (n = 0; n < FLOW_MAX_MPLS_LABELS; n++) { struct odputil_keybuf keybuf; struct ofpbuf key; - int error; memset(&flow, 0, sizeof flow); flow.dl_type = htons(ETH_TYPE_MPLS); flow_set_mpls_bos(&flow, n, 1); ofpbuf_use_stack(&key, &keybuf, sizeof keybuf); - odp_flow_key_from_flow(&key, &flow, NULL, 0); - - error = dpif_flow_put(backer->dpif, DPIF_FP_CREATE, - ofpbuf_data(&key), ofpbuf_size(&key), NULL, 0, NULL, 0, NULL); - if (error && error != EEXIST) { - if (error != EINVAL) { - VLOG_WARN("%s: MPLS stack length feature probe failed (%s)", - dpif_name(backer->dpif), ovs_strerror(error)); - } + odp_flow_key_from_flow(&key, &flow, NULL, 0, false); + if (!dpif_probe_feature(backer->dpif, "MPLS", &key, NULL)) { break; } - - error = dpif_flow_del(backer->dpif, ofpbuf_data(&key), ofpbuf_size(&key), NULL); - if (error) { - VLOG_WARN("%s: failed to delete MPLS feature probe flow", - dpif_name(backer->dpif)); - } } VLOG_INFO("%s: MPLS label stack length probed as %d", @@ -1110,6 +1161,68 @@ return n; } +/* Tests whether 'backer''s datapath supports masked data in + * OVS_ACTION_ATTR_SET actions. We need to disable some features on older + * datapaths that don't support this feature. */ +static bool +check_masked_set_action(struct dpif_backer *backer) +{ + struct eth_header *eth; + struct ofpbuf actions; + struct dpif_execute execute; + struct dp_packet packet; + int error; + struct ovs_key_ethernet key, mask; + + /* Compose a set action that will cause an EINVAL error on older + * datapaths that don't support masked set actions. + * Avoid using a full mask, as it could be translated to a non-masked + * set action instead. */ + ofpbuf_init(&actions, 64); + memset(&key, 0x53, sizeof key); + memset(&mask, 0x7f, sizeof mask); + commit_masked_set_action(&actions, OVS_KEY_ATTR_ETHERNET, &key, &mask, + sizeof key); + + /* Compose a dummy ethernet packet. */ + dp_packet_init(&packet, ETH_HEADER_LEN); + eth = dp_packet_put_zeros(&packet, ETH_HEADER_LEN); + eth->eth_type = htons(0x1234); + + /* Execute the actions. On older datapaths this fails with EINVAL, on + * newer datapaths it succeeds. */ + execute.actions = actions.data; + execute.actions_len = actions.size; + execute.packet = &packet; + execute.needs_help = false; + execute.probe = true; + + error = dpif_execute(backer->dpif, &execute); + + dp_packet_uninit(&packet); + ofpbuf_uninit(&actions); + + if (error) { + /* Masked set action is not supported. */ + VLOG_INFO("%s: datapath does not support masked set action feature.", + dpif_name(backer->dpif)); + } + return !error; +} + +static void +check_support(struct dpif_backer *backer) +{ + /* This feature needs to be tested after udpif threads are set. */ + backer->support.variable_length_userdata = false; + + backer->support.recirc = check_recirc(backer); + backer->support.max_mpls_depth = check_max_mpls_depth(backer); + backer->support.masked_set_action = check_masked_set_action(backer); + backer->support.ufid = check_ufid(backer); + backer->support.tnl_push_pop = dpif_supports_tnl_push_pop(backer->dpif); +} + static int construct(struct ofproto *ofproto_) { @@ -1117,18 +1230,24 @@ struct shash_node *node, *next; int error; + /* Tunnel module can get used right after the udpif threads are running. */ + ofproto_tunnel_init(); + error = open_dpif_backer(ofproto->up.type, &ofproto->backer); if (error) { return error; } + atomic_init(&ofproto->tables_version, CLS_MIN_VERSION); ofproto->netflow = NULL; ofproto->sflow = NULL; ofproto->ipfix = NULL; ofproto->stp = NULL; + ofproto->rstp = NULL; ofproto->dump_seq = 0; hmap_init(&ofproto->bundles); ofproto->ml = mac_learning_create(MAC_ENTRY_DEFAULT_IDLE_TIME); + ofproto->ms = NULL; ofproto->mbridge = mbridge_create(); ofproto->has_bonded_bundles = false; ofproto->lacp_enabled = false; @@ -1137,7 +1256,7 @@ guarded_list_init(&ofproto->pins); - ofproto_dpif_unixctl_init(); + ofproto_unixctl_init(); hmap_init(&ofproto->vlandev_map); hmap_init(&ofproto->realdev_vid_map); @@ -1190,7 +1309,8 @@ match_init_catchall(&match); match_set_reg(&match, 0, id); - error = ofproto_dpif_add_internal_flow(ofproto, &match, 0, ofpacts, &rule); + error = ofproto_dpif_add_internal_flow(ofproto, &match, 0, 0, ofpacts, + &rule); *rulep = error ? NULL : rule_dpif_cast(rule); return error; @@ -1203,7 +1323,6 @@ uint64_t ofpacts_stub[128 / 8]; struct ofpbuf ofpacts; struct rule *unused_rulep OVS_UNUSED; - struct ofpact_resubmit *resubmit; struct match match; int error; int id; @@ -1236,34 +1355,16 @@ return error; } - /* Continue non-recirculation rule lookups from table 0. - * - * (priority=2), recirc=0, actions=resubmit(, 0) - */ - resubmit = ofpact_put_RESUBMIT(&ofpacts); - resubmit->ofpact.compat = 0; - resubmit->in_port = OFPP_IN_PORT; - resubmit->table_id = 0; - - match_init_catchall(&match); - match_set_recirc_id(&match, 0); - - error = ofproto_dpif_add_internal_flow(ofproto, &match, 2, &ofpacts, - &unused_rulep); - if (error) { - return error; - } - - /* Drop any run away recirc rule lookups. Recirc_id has to be - * non-zero when reaching this rule. + /* Drop any run away non-recirc rule lookups. Recirc_id has to be + * zero when reaching this rule. * - * (priority=1), *, actions=drop + * (priority=2), recirc_id=0, actions=drop */ ofpbuf_clear(&ofpacts); match_init_catchall(&match); - error = ofproto_dpif_add_internal_flow(ofproto, &match, 1, &ofpacts, + match_set_recirc_id(&match, 0); + error = ofproto_dpif_add_internal_flow(ofproto, &match, 2, 0, &ofpacts, &unused_rulep); - return error; } @@ -1271,15 +1372,15 @@ destruct(struct ofproto *ofproto_) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); - struct rule_dpif *rule, *next_rule; - struct ofproto_packet_in *pin, *next_pin; + struct ofproto_packet_in *pin; + struct rule_dpif *rule; struct oftable *table; - struct list pins; + struct ovs_list pins; ofproto->backer->need_revalidate = REV_RECONFIGURE; - ovs_rwlock_wrlock(&xlate_rwlock); + xlate_txn_start(); xlate_remove_ofproto(ofproto); - ovs_rwlock_unlock(&xlate_rwlock); + xlate_txn_commit(); /* Ensure that the upcall processing threads have no remaining references * to the ofproto or anything in it. */ @@ -1288,30 +1389,28 @@ hmap_remove(&all_ofproto_dpifs, &ofproto->all_ofproto_dpifs_node); OFPROTO_FOR_EACH_TABLE (table, &ofproto->up) { - struct cls_cursor cursor; - - fat_rwlock_rdlock(&table->cls.rwlock); - cls_cursor_init(&cursor, &table->cls, NULL); - fat_rwlock_unlock(&table->cls.rwlock); - CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, up.cr, &cursor) { + CLS_FOR_EACH (rule, up.cr, &table->cls) { ofproto_rule_delete(&ofproto->up, &rule->up); } } guarded_list_pop_all(&ofproto->pins, &pins); - LIST_FOR_EACH_SAFE (pin, next_pin, list_node, &pins) { - list_remove(&pin->list_node); + LIST_FOR_EACH_POP (pin, list_node, &pins) { free(CONST_CAST(void *, pin->up.packet)); free(pin); } guarded_list_destroy(&ofproto->pins); + recirc_free_ofproto(ofproto, ofproto->up.name); + mbridge_unref(ofproto->mbridge); netflow_unref(ofproto->netflow); dpif_sflow_unref(ofproto->sflow); + dpif_ipfix_unref(ofproto->ipfix); hmap_destroy(&ofproto->bundles); mac_learning_unref(ofproto->ml); + mcast_snooping_unref(ofproto->ms); hmap_destroy(&ofproto->vlandev_map); hmap_destroy(&ofproto->realdev_vid_map); @@ -1339,6 +1438,7 @@ ovs_rwlock_wrlock(&ofproto->ml->rwlock); mac_learning_flush(ofproto->ml); ovs_rwlock_unlock(&ofproto->ml->rwlock); + mcast_snooping_mdb_flush(ofproto->ms); } /* Always updates the ofproto->pins_seqno to avoid frequent wakeup during @@ -1350,13 +1450,12 @@ /* Do not perform any periodic activity required by 'ofproto' while * waiting for flow restore to complete. */ if (!ofproto_get_flow_restore_wait()) { - struct ofproto_packet_in *pin, *next_pin; - struct list pins; + struct ofproto_packet_in *pin; + struct ovs_list pins; guarded_list_pop_all(&ofproto->pins, &pins); - LIST_FOR_EACH_SAFE (pin, next_pin, list_node, &pins) { + LIST_FOR_EACH_POP (pin, list_node, &pins) { connmgr_send_packet_in(ofproto->up.connmgr, pin); - list_remove(&pin->list_node); free(CONST_CAST(void *, pin->up.packet)); free(pin); } @@ -1391,12 +1490,17 @@ } stp_run(ofproto); + rstp_run(ofproto); ovs_rwlock_wrlock(&ofproto->ml->rwlock); if (mac_learning_run(ofproto->ml)) { ofproto->backer->need_revalidate = REV_MAC_LEARNING; } ovs_rwlock_unlock(&ofproto->ml->rwlock); + if (mcast_snooping_run(ofproto->ms)) { + ofproto->backer->need_revalidate = REV_MCAST_SNOOPING; + } + new_dump_seq = seq_read(udpif_dump_seq(ofproto->backer->udpif)); if (ofproto->dump_seq != new_dump_seq) { struct rule *rule, *next_rule; @@ -1426,7 +1530,6 @@ } } } - return 0; } @@ -1458,6 +1561,7 @@ ovs_rwlock_rdlock(&ofproto->ml->rwlock); mac_learning_wait(ofproto->ml); ovs_rwlock_unlock(&ofproto->ml->rwlock); + mcast_snooping_wait(ofproto->ms); stp_wait(ofproto); if (ofproto->backer->need_revalidate) { /* Shouldn't happen, but if it does just go around again. */ @@ -1492,50 +1596,40 @@ } static void -get_features(struct ofproto *ofproto_ OVS_UNUSED, - bool *arp_match_ip, enum ofputil_action_bitmap *actions) +query_tables(struct ofproto *ofproto, + struct ofputil_table_features *features, + struct ofputil_table_stats *stats) { - *arp_match_ip = true; - *actions = (OFPUTIL_A_OUTPUT | - OFPUTIL_A_SET_VLAN_VID | - OFPUTIL_A_SET_VLAN_PCP | - OFPUTIL_A_STRIP_VLAN | - OFPUTIL_A_SET_DL_SRC | - OFPUTIL_A_SET_DL_DST | - OFPUTIL_A_SET_NW_SRC | - OFPUTIL_A_SET_NW_DST | - OFPUTIL_A_SET_NW_TOS | - OFPUTIL_A_SET_TP_SRC | - OFPUTIL_A_SET_TP_DST | - OFPUTIL_A_ENQUEUE); + strcpy(features->name, "classifier"); + + if (stats) { + int i; + + for (i = 0; i < ofproto->n_tables; i++) { + unsigned long missed, matched; + + atomic_read_relaxed(&ofproto->tables[i].n_matched, &matched); + atomic_read_relaxed(&ofproto->tables[i].n_missed, &missed); + + stats[i].matched_count = matched; + stats[i].lookup_count = matched + missed; + } + } } static void -get_tables(struct ofproto *ofproto_, struct ofp12_table_stats *ots) +set_tables_version(struct ofproto *ofproto_, cls_version_t version) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); - struct dpif_dp_stats s; - uint64_t n_miss, n_no_pkt_in, n_bytes, n_dropped_frags; - uint64_t n_lookup; - long long int used; - - strcpy(ots->name, "classifier"); - - dpif_get_dp_stats(ofproto->backer->dpif, &s); - rule_get_stats(&ofproto->miss_rule->up, &n_miss, &n_bytes, &used); - rule_get_stats(&ofproto->no_packet_in_rule->up, &n_no_pkt_in, &n_bytes, - &used); - rule_get_stats(&ofproto->drop_frags_rule->up, &n_dropped_frags, &n_bytes, - &used); - n_lookup = s.n_hit + s.n_missed - n_dropped_frags; - ots->lookup_count = htonll(n_lookup); - ots->matched_count = htonll(n_lookup - n_miss - n_no_pkt_in); + + atomic_store_relaxed(&ofproto->tables_version, version); } + static struct ofport * port_alloc(void) { - struct ofport_dpif *port = xmalloc(sizeof *port); + struct ofport_dpif *port = xzalloc(sizeof *port); return &port->up; } @@ -1553,6 +1647,7 @@ struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto); const struct netdev *netdev = port->up.netdev; char namebuf[NETDEV_VPORT_NAME_BUFSIZE]; + const char *dp_port_name; struct dpif_port dpif_port; int error; @@ -1560,9 +1655,12 @@ port->bundle = NULL; port->cfm = NULL; port->bfd = NULL; - port->may_enable = true; + port->lldp = NULL; + port->may_enable = false; port->stp_port = NULL; port->stp_state = STP_DISABLED; + port->rstp_port = NULL; + port->rstp_state = RSTP_DISABLED; port->is_tunnel = false; port->peer = NULL; port->qdscp = NULL; @@ -1574,18 +1672,17 @@ if (netdev_vport_is_patch(netdev)) { /* By bailing out here, we don't submit the port to the sFlow module - * to be considered for counter polling export. This is correct - * because the patch port represents an interface that sFlow considers - * to be "internal" to the switch as a whole, and therefore not an - * candidate for counter polling. */ + * to be considered for counter polling export. This is correct + * because the patch port represents an interface that sFlow considers + * to be "internal" to the switch as a whole, and therefore not a + * candidate for counter polling. */ port->odp_port = ODPP_NONE; ofport_update_peer(port); return 0; } - error = dpif_port_query_by_name(ofproto->backer->dpif, - netdev_vport_get_dpif_port(netdev, namebuf, - sizeof namebuf), + dp_port_name = netdev_vport_get_dpif_port(netdev, namebuf, sizeof namebuf); + error = dpif_port_query_by_name(ofproto->backer->dpif, dp_port_name, &dpif_port); if (error) { return error; @@ -1594,8 +1691,19 @@ port->odp_port = dpif_port.port_no; if (netdev_get_tunnel_config(netdev)) { - tnl_port_add(port, port->up.netdev, port->odp_port); + atomic_count_inc(&ofproto->backer->tnl_count); + error = tnl_port_add(port, port->up.netdev, port->odp_port, + ovs_native_tunneling_is_on(ofproto), dp_port_name); + if (error) { + atomic_count_dec(&ofproto->backer->tnl_count); + dpif_port_destroy(&dpif_port); + return error; + } + port->is_tunnel = true; + if (ofproto->ipfix) { + dpif_ipfix_add_tunnel_port(ofproto->ipfix, port_, port->odp_port); + } } else { /* Sanity-check that a mapping doesn't already exist. This * shouldn't happen for non-tunnel ports. */ @@ -1630,9 +1738,9 @@ const char *dp_port_name; ofproto->backer->need_revalidate = REV_RECONFIGURE; - ovs_rwlock_wrlock(&xlate_rwlock); + xlate_txn_start(); xlate_ofport_remove(port); - ovs_rwlock_unlock(&xlate_rwlock); + xlate_txn_commit(); dp_port_name = netdev_vport_get_dpif_port(port->up.netdev, namebuf, sizeof namebuf); @@ -1657,15 +1765,25 @@ ovs_rwlock_unlock(&ofproto->backer->odp_to_ofport_lock); } + if (port->is_tunnel) { + atomic_count_dec(&ofproto->backer->tnl_count); + } + + if (port->is_tunnel && ofproto->ipfix) { + dpif_ipfix_del_tunnel_port(ofproto->ipfix, port->odp_port); + } + tnl_port_del(port); sset_find_and_delete(&ofproto->ports, devname); sset_find_and_delete(&ofproto->ghost_ports, devname); bundle_remove(port_); set_cfm(port_, NULL); set_bfd(port_, NULL); + set_lldp(port_, NULL); if (port->stp_port) { stp_port_disable(port->stp_port); } + set_rstp_port(port_, NULL); if (ofproto->sflow) { dpif_sflow_del_port(ofproto->sflow, port->odp_port); } @@ -1677,26 +1795,35 @@ port_modified(struct ofport *port_) { struct ofport_dpif *port = ofport_dpif_cast(port_); + char namebuf[NETDEV_VPORT_NAME_BUFSIZE]; + const char *dp_port_name; + struct netdev *netdev = port->up.netdev; if (port->bundle && port->bundle->bond) { - bond_slave_set_netdev(port->bundle->bond, port, port->up.netdev); + bond_slave_set_netdev(port->bundle->bond, port, netdev); } if (port->cfm) { - cfm_set_netdev(port->cfm, port->up.netdev); + cfm_set_netdev(port->cfm, netdev); } if (port->bfd) { - bfd_set_netdev(port->bfd, port->up.netdev); + bfd_set_netdev(port->bfd, netdev); } ofproto_dpif_monitor_port_update(port, port->bfd, port->cfm, - port->up.pp.hw_addr); + port->lldp, port->up.pp.hw_addr); + + dp_port_name = netdev_vport_get_dpif_port(netdev, namebuf, sizeof namebuf); - if (port->is_tunnel && tnl_port_reconfigure(port, port->up.netdev, - port->odp_port)) { - ofproto_dpif_cast(port->up.ofproto)->backer->need_revalidate = - REV_RECONFIGURE; + if (port->is_tunnel) { + struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto); + + if (tnl_port_reconfigure(port, netdev, port->odp_port, + ovs_native_tunneling_is_on(ofproto), + dp_port_name)) { + ofproto->backer->need_revalidate = REV_RECONFIGURE; + } } ofport_update_peer(port); @@ -1728,6 +1855,7 @@ struct dpif_sflow *ds = ofproto->sflow; if (sflow_options) { + uint32_t old_probability = ds ? dpif_sflow_get_probability(ds) : 0; if (!ds) { struct ofport_dpif *ofport; @@ -1735,9 +1863,11 @@ HMAP_FOR_EACH (ofport, up.hmap_node, &ofproto->up.ports) { dpif_sflow_add_port(ds, &ofport->up, ofport->odp_port); } - ofproto->backer->need_revalidate = REV_RECONFIGURE; } dpif_sflow_set_options(ds, sflow_options); + if (dpif_sflow_get_probability(ds) != old_probability) { + ofproto->backer->need_revalidate = REV_RECONFIGURE; + } } else { if (ds) { dpif_sflow_unref(ds); @@ -1758,9 +1888,11 @@ struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); struct dpif_ipfix *di = ofproto->ipfix; bool has_options = bridge_exporter_options || flow_exporters_options; + bool new_di = false; if (has_options && !di) { di = ofproto->ipfix = dpif_ipfix_create(); + new_di = true; } if (di) { @@ -1770,6 +1902,16 @@ di, bridge_exporter_options, flow_exporters_options, n_flow_exporters_options); + /* Add tunnel ports only when a new ipfix created */ + if (new_di == true) { + struct ofport_dpif *ofport; + HMAP_FOR_EACH (ofport, up.hmap_node, &ofproto->up.ports) { + if (ofport->is_tunnel == true) { + dpif_ipfix_add_tunnel_port(di, &ofport->up, ofport->odp_port); + } + } + } + if (!has_options) { dpif_ipfix_unref(di); ofproto->ipfix = NULL; @@ -1783,14 +1925,12 @@ set_cfm(struct ofport *ofport_, const struct cfm_settings *s) { struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); + struct cfm *old = ofport->cfm; int error = 0; if (s) { if (!ofport->cfm) { - struct ofproto_dpif *ofproto; - - ofproto = ofproto_dpif_cast(ofport->up.ofproto); - ofproto->backer->need_revalidate = REV_RECONFIGURE; ofport->cfm = cfm_create(ofport->up.netdev); } @@ -1804,28 +1944,31 @@ cfm_unref(ofport->cfm); ofport->cfm = NULL; out: + if (ofport->cfm != old) { + ofproto->backer->need_revalidate = REV_RECONFIGURE; + } ofproto_dpif_monitor_port_update(ofport, ofport->bfd, ofport->cfm, - ofport->up.pp.hw_addr); + ofport->lldp, ofport->up.pp.hw_addr); return error; } +static bool +cfm_status_changed(struct ofport *ofport_) +{ + struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + + return ofport->cfm ? cfm_check_status_change(ofport->cfm) : true; +} + static int -get_cfm_status(const struct ofport *ofport_, bool force, - struct ofproto_cfm_status *status) +get_cfm_status(const struct ofport *ofport_, + struct cfm_status *status) { struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); int ret = 0; if (ofport->cfm) { - if (cfm_check_status_change(ofport->cfm) || force) { - status->faults = cfm_get_fault(ofport->cfm); - status->flap_count = cfm_get_flap_count(ofport->cfm); - status->remote_opstate = cfm_get_opup(ofport->cfm); - status->health = cfm_get_health(ofport->cfm); - cfm_get_remote_mpids(ofport->cfm, &status->rmps, &status->n_rmps); - } else { - ret = NO_STATUS_CHANGE; - } + cfm_get_status(ofport->cfm, status); } else { ret = ENOENT; } @@ -1847,33 +1990,131 @@ ofproto->backer->need_revalidate = REV_RECONFIGURE; } ofproto_dpif_monitor_port_update(ofport, ofport->bfd, ofport->cfm, - ofport->up.pp.hw_addr); + ofport->lldp, ofport->up.pp.hw_addr); return 0; } +static bool +bfd_status_changed(struct ofport *ofport_) +{ + struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + + return ofport->bfd ? bfd_check_status_change(ofport->bfd) : true; +} + static int -get_bfd_status(struct ofport *ofport_, bool force, struct smap *smap) +get_bfd_status(struct ofport *ofport_, struct smap *smap) { struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); int ret = 0; if (ofport->bfd) { - if (bfd_check_status_change(ofport->bfd) || force) { - bfd_get_status(ofport->bfd, smap); - } else { - ret = NO_STATUS_CHANGE; - } + bfd_get_status(ofport->bfd, smap); } else { ret = ENOENT; } return ret; } + +static int +set_lldp(struct ofport *ofport_, + const struct smap *cfg) +{ + struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + int error = 0; + + if (cfg) { + if (!ofport->lldp) { + struct ofproto_dpif *ofproto; + + ofproto = ofproto_dpif_cast(ofport->up.ofproto); + ofproto->backer->need_revalidate = REV_RECONFIGURE; + ofport->lldp = lldp_create(ofport->up.netdev, ofport_->mtu, cfg); + } + + if (!lldp_configure(ofport->lldp, cfg)) { + error = EINVAL; + } + } + if (error) { + lldp_unref(ofport->lldp); + ofport->lldp = NULL; + } + + ofproto_dpif_monitor_port_update(ofport, + ofport->bfd, + ofport->cfm, + ofport->lldp, + ofport->up.pp.hw_addr); + return error; +} + +static bool +get_lldp_status(const struct ofport *ofport_, + struct lldp_status *status OVS_UNUSED) +{ + struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + + return ofport->lldp ? true : false; +} + +static int +set_aa(struct ofproto *ofproto OVS_UNUSED, + const struct aa_settings *s) +{ + return aa_configure(s); +} + +static int +aa_mapping_set(struct ofproto *ofproto_ OVS_UNUSED, void *aux, + const struct aa_mapping_settings *s) +{ + return aa_mapping_register(aux, s); +} + +static int +aa_mapping_unset(struct ofproto *ofproto OVS_UNUSED, void *aux) +{ + return aa_mapping_unregister(aux); +} + +static int +aa_vlan_get_queued(struct ofproto *ofproto OVS_UNUSED, struct ovs_list *list) +{ + return aa_get_vlan_queued(list); +} + +static unsigned int +aa_vlan_get_queue_size(struct ofproto *ofproto OVS_UNUSED) +{ + return aa_get_vlan_queue_size(); +} + /* Spanning Tree. */ +/* Called while rstp_mutex is held. */ +static void +rstp_send_bpdu_cb(struct dp_packet *pkt, void *ofport_, void *ofproto_) +{ + struct ofproto_dpif *ofproto = ofproto_; + struct ofport_dpif *ofport = ofport_; + struct eth_header *eth = dp_packet_l2(pkt); + + netdev_get_etheraddr(ofport->up.netdev, eth->eth_src); + if (eth_addr_is_zero(eth->eth_src)) { + VLOG_WARN_RL(&rl, "%s port %d: cannot send RSTP BPDU on a port which " + "does not have a configured source MAC address.", + ofproto->up.name, ofp_to_u16(ofport->up.ofp_port)); + } else { + ofproto_dpif_send_packet(ofport, pkt); + } + dp_packet_delete(pkt); +} + static void -send_bpdu_cb(struct ofpbuf *pkt, int port_num, void *ofproto_) +send_bpdu_cb(struct dp_packet *pkt, int port_num, void *ofproto_) { struct ofproto_dpif *ofproto = ofproto_; struct stp_port *sp = stp_get_port(ofproto->stp, port_num); @@ -1884,7 +2125,7 @@ VLOG_WARN_RL(&rl, "%s: cannot send BPDU on unknown port %d", ofproto->up.name, port_num); } else { - struct eth_header *eth = ofpbuf_l2(pkt); + struct eth_header *eth = dp_packet_l2(pkt); netdev_get_etheraddr(ofport->up.netdev, eth->eth_src); if (eth_addr_is_zero(eth->eth_src)) { @@ -1894,56 +2135,198 @@ ofproto_dpif_send_packet(ofport, pkt); } } - ofpbuf_delete(pkt); + dp_packet_delete(pkt); } -/* Configures STP on 'ofproto_' using the settings defined in 's'. */ -static int -set_stp(struct ofproto *ofproto_, const struct ofproto_stp_settings *s) +/* Configure RSTP on 'ofproto_' using the settings defined in 's'. */ +static void +set_rstp(struct ofproto *ofproto_, const struct ofproto_rstp_settings *s) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); /* Only revalidate flows if the configuration changed. */ - if (!s != !ofproto->stp) { + if (!s != !ofproto->rstp) { ofproto->backer->need_revalidate = REV_RECONFIGURE; } if (s) { - if (!ofproto->stp) { - ofproto->stp = stp_create(ofproto_->name, s->system_id, - send_bpdu_cb, ofproto); - ofproto->stp_last_tick = time_msec(); - } - - stp_set_bridge_id(ofproto->stp, s->system_id); - stp_set_bridge_priority(ofproto->stp, s->priority); - stp_set_hello_time(ofproto->stp, s->hello_time); - stp_set_max_age(ofproto->stp, s->max_age); - stp_set_forward_delay(ofproto->stp, s->fwd_delay); - } else { + if (!ofproto->rstp) { + ofproto->rstp = rstp_create(ofproto_->name, s->address, + rstp_send_bpdu_cb, ofproto); + ofproto->rstp_last_tick = time_msec(); + } + rstp_set_bridge_address(ofproto->rstp, s->address); + rstp_set_bridge_priority(ofproto->rstp, s->priority); + rstp_set_bridge_ageing_time(ofproto->rstp, s->ageing_time); + rstp_set_bridge_force_protocol_version(ofproto->rstp, + s->force_protocol_version); + rstp_set_bridge_max_age(ofproto->rstp, s->bridge_max_age); + rstp_set_bridge_forward_delay(ofproto->rstp, s->bridge_forward_delay); + rstp_set_bridge_transmit_hold_count(ofproto->rstp, + s->transmit_hold_count); + } else { struct ofport *ofport; - HMAP_FOR_EACH (ofport, hmap_node, &ofproto->up.ports) { - set_stp_port(ofport, NULL); + set_rstp_port(ofport, NULL); } - - stp_unref(ofproto->stp); - ofproto->stp = NULL; + rstp_unref(ofproto->rstp); + ofproto->rstp = NULL; } - - return 0; } -static int -get_stp_status(struct ofproto *ofproto_, struct ofproto_stp_status *s) +static void +get_rstp_status(struct ofproto *ofproto_, struct ofproto_rstp_status *s) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); - if (ofproto->stp) { + if (ofproto->rstp) { s->enabled = true; - s->bridge_id = stp_get_bridge_id(ofproto->stp); - s->designated_root = stp_get_designated_root(ofproto->stp); - s->root_path_cost = stp_get_root_path_cost(ofproto->stp); + s->root_id = rstp_get_root_id(ofproto->rstp); + s->bridge_id = rstp_get_bridge_id(ofproto->rstp); + s->designated_id = rstp_get_designated_id(ofproto->rstp); + s->root_path_cost = rstp_get_root_path_cost(ofproto->rstp); + s->designated_port_id = rstp_get_designated_port_id(ofproto->rstp); + s->bridge_port_id = rstp_get_bridge_port_id(ofproto->rstp); + } else { + s->enabled = false; + } +} + +static void +update_rstp_port_state(struct ofport_dpif *ofport) +{ + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); + enum rstp_state state; + + /* Figure out new state. */ + state = ofport->rstp_port ? rstp_port_get_state(ofport->rstp_port) + : RSTP_DISABLED; + + /* Update state. */ + if (ofport->rstp_state != state) { + enum ofputil_port_state of_state; + bool fwd_change; + + VLOG_DBG("port %s: RSTP state changed from %s to %s", + netdev_get_name(ofport->up.netdev), + rstp_state_name(ofport->rstp_state), + rstp_state_name(state)); + + if (rstp_learn_in_state(ofport->rstp_state) + != rstp_learn_in_state(state)) { + /* XXX: Learning action flows should also be flushed. */ + if (ofport->bundle) { + if (!rstp_shift_root_learned_address(ofproto->rstp) + || rstp_get_old_root_aux(ofproto->rstp) != ofport) { + bundle_flush_macs(ofport->bundle, false); + } + } + } + fwd_change = rstp_forward_in_state(ofport->rstp_state) + != rstp_forward_in_state(state); + + ofproto->backer->need_revalidate = REV_RSTP; + ofport->rstp_state = state; + + if (fwd_change && ofport->bundle) { + bundle_update(ofport->bundle); + } + + /* Update the RSTP state bits in the OpenFlow port description. */ + of_state = ofport->up.pp.state & ~OFPUTIL_PS_STP_MASK; + of_state |= (state == RSTP_LEARNING ? OFPUTIL_PS_STP_LEARN + : state == RSTP_FORWARDING ? OFPUTIL_PS_STP_FORWARD + : state == RSTP_DISCARDING ? OFPUTIL_PS_STP_LISTEN + : 0); + ofproto_port_set_state(&ofport->up, of_state); + } +} + +static void +rstp_run(struct ofproto_dpif *ofproto) +{ + if (ofproto->rstp) { + long long int now = time_msec(); + long long int elapsed = now - ofproto->rstp_last_tick; + struct rstp_port *rp; + struct ofport_dpif *ofport; + + /* Every second, decrease the values of the timers. */ + if (elapsed >= 1000) { + rstp_tick_timers(ofproto->rstp); + ofproto->rstp_last_tick = now; + } + rp = NULL; + while ((ofport = rstp_get_next_changed_port_aux(ofproto->rstp, &rp))) { + update_rstp_port_state(ofport); + } + rp = NULL; + ofport = NULL; + /* FIXME: This check should be done on-event (i.e., when setting + * p->fdb_flush) and not periodically. + */ + while ((ofport = rstp_check_and_reset_fdb_flush(ofproto->rstp, &rp))) { + if (!rstp_shift_root_learned_address(ofproto->rstp) + || rstp_get_old_root_aux(ofproto->rstp) != ofport) { + bundle_flush_macs(ofport->bundle, false); + } + } + + if (rstp_shift_root_learned_address(ofproto->rstp)) { + bundle_move(((struct ofport_dpif *)rstp_get_old_root_aux(ofproto->rstp))->bundle, + ((struct ofport_dpif *)rstp_get_new_root_aux(ofproto->rstp))->bundle); + rstp_reset_root_changed(ofproto->rstp); + } + } +} + +/* Configures STP on 'ofproto_' using the settings defined in 's'. */ +static int +set_stp(struct ofproto *ofproto_, const struct ofproto_stp_settings *s) +{ + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); + + /* Only revalidate flows if the configuration changed. */ + if (!s != !ofproto->stp) { + ofproto->backer->need_revalidate = REV_RECONFIGURE; + } + + if (s) { + if (!ofproto->stp) { + ofproto->stp = stp_create(ofproto_->name, s->system_id, + send_bpdu_cb, ofproto); + ofproto->stp_last_tick = time_msec(); + } + + stp_set_bridge_id(ofproto->stp, s->system_id); + stp_set_bridge_priority(ofproto->stp, s->priority); + stp_set_hello_time(ofproto->stp, s->hello_time); + stp_set_max_age(ofproto->stp, s->max_age); + stp_set_forward_delay(ofproto->stp, s->fwd_delay); + } else { + struct ofport *ofport; + + HMAP_FOR_EACH (ofport, hmap_node, &ofproto->up.ports) { + set_stp_port(ofport, NULL); + } + + stp_unref(ofproto->stp); + ofproto->stp = NULL; + } + + return 0; +} + +static int +get_stp_status(struct ofproto *ofproto_, struct ofproto_stp_status *s) +{ + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); + + if (ofproto->stp) { + s->enabled = true; + s->bridge_id = stp_get_bridge_id(ofproto->stp); + s->designated_root = stp_get_designated_root(ofproto->stp); + s->root_path_cost = stp_get_root_path_cost(ofproto->stp); } else { s->enabled = false; } @@ -1966,16 +2349,17 @@ enum ofputil_port_state of_state; bool fwd_change; - VLOG_DBG_RL(&rl, "port %s: STP state changed from %s to %s", - netdev_get_name(ofport->up.netdev), - stp_state_name(ofport->stp_state), - stp_state_name(state)); + VLOG_DBG("port %s: STP state changed from %s to %s", + netdev_get_name(ofport->up.netdev), + stp_state_name(ofport->stp_state), + stp_state_name(state)); if (stp_learn_in_state(ofport->stp_state) != stp_learn_in_state(state)) { /* xxx Learning action flows should also be flushed. */ ovs_rwlock_wrlock(&ofproto->ml->rwlock); mac_learning_flush(ofproto->ml); ovs_rwlock_unlock(&ofproto->ml->rwlock); + mcast_snooping_mdb_flush(ofproto->ms); } fwd_change = stp_forward_in_state(ofport->stp_state) != stp_forward_in_state(state); @@ -2018,13 +2402,17 @@ } return 0; } else if (sp && stp_port_no(sp) != s->port_num - && ofport == stp_port_get_aux(sp)) { + && ofport == stp_port_get_aux(sp)) { /* The port-id changed, so disable the old one if it's not * already in use by another port. */ stp_port_disable(sp); } sp = ofport->stp_port = stp_get_port(ofproto->stp, s->port_num); + + /* Set name before enabling the port so that debugging messages can print + * the name. */ + stp_port_set_name(sp, netdev_get_name(ofport->up.netdev)); stp_port_enable(sp); stp_port_set_aux(sp, ofport); @@ -2101,6 +2489,7 @@ ovs_rwlock_wrlock(&ofproto->ml->rwlock); mac_learning_flush(ofproto->ml); ovs_rwlock_unlock(&ofproto->ml->rwlock); + mcast_snooping_mdb_flush(ofproto->ms); } } } @@ -2112,6 +2501,61 @@ poll_timer_wait(1000); } } + +/* Configures RSTP on 'ofport_' using the settings defined in 's'. The + * caller is responsible for assigning RSTP port numbers and ensuring + * there are no duplicates. */ +static void +set_rstp_port(struct ofport *ofport_, + const struct ofproto_port_rstp_settings *s) +{ + struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); + struct rstp_port *rp = ofport->rstp_port; + + if (!s || !s->enable) { + if (rp) { + rstp_port_unref(rp); + ofport->rstp_port = NULL; + update_rstp_port_state(ofport); + } + return; + } + + /* Check if need to add a new port. */ + if (!rp) { + rp = ofport->rstp_port = rstp_add_port(ofproto->rstp); + } + + rstp_port_set(rp, s->port_num, s->priority, s->path_cost, + s->admin_edge_port, s->auto_edge, + s->admin_p2p_mac_state, s->admin_port_state, s->mcheck, + ofport); + update_rstp_port_state(ofport); + /* Synchronize operational status. */ + rstp_port_set_mac_operational(rp, ofport->may_enable); +} + +static void +get_rstp_port_status(struct ofport *ofport_, + struct ofproto_port_rstp_status *s) +{ + struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); + struct rstp_port *rp = ofport->rstp_port; + + if (!ofproto->rstp || !rp) { + s->enabled = false; + return; + } + + s->enabled = true; + rstp_port_get_status(rp, &s->port_id, &s->state, &s->role, + &s->designated_bridge_id, &s->designated_port_id, + &s->designated_path_cost, &s->tx_count, + &s->rx_count, &s->error_count, &s->uptime); +} + static int set_queues(struct ofport *ofport_, const struct ofproto_port_queue *qdscp, @@ -2155,7 +2599,7 @@ ofproto->backer->need_revalidate = REV_RECONFIGURE; ovs_rwlock_wrlock(&ml->rwlock); LIST_FOR_EACH_SAFE (mac, next_mac, lru_node, &ml->lrus) { - if (mac->port.p == bundle) { + if (mac_entry_get_port(ml, mac) == bundle) { if (all_ofprotos) { struct ofproto_dpif *o; @@ -2179,6 +2623,25 @@ ovs_rwlock_unlock(&ml->rwlock); } +static void +bundle_move(struct ofbundle *old, struct ofbundle *new) +{ + struct ofproto_dpif *ofproto = old->ofproto; + struct mac_learning *ml = ofproto->ml; + struct mac_entry *mac, *next_mac; + + ovs_assert(new->ofproto == old->ofproto); + + ofproto->backer->need_revalidate = REV_RECONFIGURE; + ovs_rwlock_wrlock(&ml->rwlock); + LIST_FOR_EACH_SAFE (mac, next_mac, lru_node, &ml->lrus) { + if (mac_entry_get_port(ml, mac) == old) { + mac_entry_set_port(ml, mac, new); + } + } + ovs_rwlock_unlock(&ml->rwlock); +} + static struct ofbundle * bundle_lookup(const struct ofproto_dpif *ofproto, void *aux) { @@ -2202,7 +2665,8 @@ LIST_FOR_EACH (port, bundle_node, &bundle->ports) { if (port->up.pp.config & OFPUTIL_PC_NO_FLOOD || port->is_layer3 - || !stp_forward_in_state(port->stp_state)) { + || (bundle->ofproto->stp && !stp_forward_in_state(port->stp_state)) + || (bundle->ofproto->rstp && !rstp_forward_in_state(port->rstp_state))) { bundle->floodable = false; break; } @@ -2235,7 +2699,7 @@ { struct ofport_dpif *port; - port = get_ofp_port(bundle->ofproto, ofp_port); + port = ofp_port_to_ofport(bundle->ofproto, ofp_port); if (!port) { return false; } @@ -2250,7 +2714,8 @@ list_push_back(&bundle->ports, &port->bundle_node); if (port->up.pp.config & OFPUTIL_PC_NO_FLOOD || port->is_layer3 - || !stp_forward_in_state(port->stp_state)) { + || (bundle->ofproto->stp && !stp_forward_in_state(port->stp_state)) + || (bundle->ofproto->rstp && !rstp_forward_in_state(port->rstp_state))) { bundle->floodable = false; } } @@ -2273,11 +2738,11 @@ } ofproto = bundle->ofproto; - mbridge_unregister_bundle(ofproto->mbridge, bundle->aux); + mbridge_unregister_bundle(ofproto->mbridge, bundle); - ovs_rwlock_wrlock(&xlate_rwlock); + xlate_txn_start(); xlate_bundle_remove(bundle); - ovs_rwlock_unlock(&xlate_rwlock); + xlate_txn_commit(); LIST_FOR_EACH_SAFE (port, next_port, bundle_node, &bundle->ports) { bundle_del_port(port); @@ -2501,16 +2966,16 @@ error = netdev_get_etheraddr(port->up.netdev, ea); if (!error) { - struct ofpbuf packet; + struct dp_packet packet; void *packet_pdu; - ofpbuf_init(&packet, 0); + dp_packet_init(&packet, 0); packet_pdu = eth_compose(&packet, eth_addr_lacp, ea, ETH_TYPE_LACP, pdu_size); memcpy(packet_pdu, pdu, pdu_size); ofproto_dpif_send_packet(port, &packet); - ofpbuf_uninit(&packet); + dp_packet_uninit(&packet); } else { VLOG_ERR_RL(&rl, "port %s: cannot obtain Ethernet address of iface " "%s (%s)", port->bundle->name, @@ -2522,43 +2987,41 @@ bundle_send_learning_packets(struct ofbundle *bundle) { struct ofproto_dpif *ofproto = bundle->ofproto; - struct ofpbuf *learning_packet; int error, n_packets, n_errors; struct mac_entry *e; - struct list packets; + struct pkt_list { + struct ovs_list list_node; + struct ofport_dpif *port; + struct dp_packet *pkt; + } *pkt_node; + struct ovs_list packets; list_init(&packets); ovs_rwlock_rdlock(&ofproto->ml->rwlock); LIST_FOR_EACH (e, lru_node, &ofproto->ml->lrus) { - if (e->port.p != bundle) { - void *port_void; - - learning_packet = bond_compose_learning_packet(bundle->bond, - e->mac, e->vlan, - &port_void); - /* Temporarily use 'frame' as a private pointer (see below). */ - ovs_assert(learning_packet->frame == ofpbuf_data(learning_packet)); - learning_packet->frame = port_void; - list_push_back(&packets, &learning_packet->list_node); + if (mac_entry_get_port(ofproto->ml, e) != bundle) { + pkt_node = xmalloc(sizeof *pkt_node); + pkt_node->pkt = bond_compose_learning_packet(bundle->bond, + e->mac, e->vlan, + (void **)&pkt_node->port); + list_push_back(&packets, &pkt_node->list_node); } } ovs_rwlock_unlock(&ofproto->ml->rwlock); error = n_packets = n_errors = 0; - LIST_FOR_EACH (learning_packet, list_node, &packets) { + LIST_FOR_EACH_POP (pkt_node, list_node, &packets) { int ret; - void *port_void = learning_packet->frame; - /* Restore 'frame'. */ - learning_packet->frame = ofpbuf_data(learning_packet); - ret = ofproto_dpif_send_packet(port_void, learning_packet); + ret = ofproto_dpif_send_packet(pkt_node->port, pkt_node->pkt); + dp_packet_delete(pkt_node->pkt); + free(pkt_node); if (ret) { error = ret; n_errors++; } n_packets++; } - ofpbuf_list_delete(&packets); if (n_errors) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); @@ -2685,11 +3148,63 @@ mac_learning_set_max_entries(ofproto->ml, max_entries); ovs_rwlock_unlock(&ofproto->ml->rwlock); } + +/* Configures multicast snooping on 'ofport' using the settings + * defined in 's'. */ +static int +set_mcast_snooping(struct ofproto *ofproto_, + const struct ofproto_mcast_snooping_settings *s) +{ + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); + + /* Only revalidate flows if the configuration changed. */ + if (!s != !ofproto->ms) { + ofproto->backer->need_revalidate = REV_RECONFIGURE; + } + + if (s) { + if (!ofproto->ms) { + ofproto->ms = mcast_snooping_create(); + } + + ovs_rwlock_wrlock(&ofproto->ms->rwlock); + mcast_snooping_set_idle_time(ofproto->ms, s->idle_time); + mcast_snooping_set_max_entries(ofproto->ms, s->max_entries); + if (mcast_snooping_set_flood_unreg(ofproto->ms, s->flood_unreg)) { + ofproto->backer->need_revalidate = REV_RECONFIGURE; + } + ovs_rwlock_unlock(&ofproto->ms->rwlock); + } else { + mcast_snooping_unref(ofproto->ms); + ofproto->ms = NULL; + } + + return 0; +} + +/* Configures multicast snooping port's flood settings on 'ofproto'. */ +static int +set_mcast_snooping_port(struct ofproto *ofproto_, void *aux, + const struct ofproto_mcast_snooping_port_settings *s) +{ + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); + struct ofbundle *bundle = bundle_lookup(ofproto, aux); + + if (ofproto->ms && s) { + ovs_rwlock_wrlock(&ofproto->ms->rwlock); + mcast_snooping_set_port_flood(ofproto->ms, bundle, s->flood); + mcast_snooping_set_port_flood_reports(ofproto->ms, bundle, + s->flood_reports); + ovs_rwlock_unlock(&ofproto->ms->rwlock); + } + return 0; +} + /* Ports. */ -static struct ofport_dpif * -get_ofp_port(const struct ofproto_dpif *ofproto, ofp_port_t ofp_port) +struct ofport_dpif * +ofp_port_to_ofport(const struct ofproto_dpif *ofproto, ofp_port_t ofp_port) { struct ofport *ofport = ofproto_get_port(&ofproto->up, ofp_port); return ofport ? ofport_dpif_cast(ofport) : NULL; @@ -2795,7 +3310,12 @@ if (ofport->may_enable != enable) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); + ofproto->backer->need_revalidate = REV_PORT_TOGGLED; + + if (ofport->rstp_port) { + rstp_port_set_mac_operational(ofport->rstp_port, enable); + } } ofport->may_enable = enable; @@ -2878,7 +3398,7 @@ port_del(struct ofproto *ofproto_, ofp_port_t ofp_port) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); - struct ofport_dpif *ofport = get_ofp_port(ofproto, ofp_port); + struct ofport_dpif *ofport = ofp_port_to_ofport(ofproto, ofp_port); int error = 0; if (!ofport) { @@ -2943,6 +3463,18 @@ return error; } +static int +port_get_lacp_stats(const struct ofport *ofport_, struct lacp_slave_stats *stats) +{ + struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + if (ofport->bundle && ofport->bundle->lacp) { + if (lacp_get_slave_stats(ofport->bundle->lacp, ofport, stats)) { + return 0; + } + } + return -1; +} + struct port_dump_state { uint32_t bucket; uint32_t offset; @@ -3053,8 +3585,6 @@ long long int now = time_msec(); int reason = -1; - ovs_assert(!rule->up.pending); - hard_timeout = rule->up.hard_timeout; idle_timeout = rule->up.idle_timeout; @@ -3096,7 +3626,7 @@ const struct flow *flow, struct rule_dpif *rule, const struct ofpact *ofpacts, size_t ofpacts_len, - struct ofpbuf *packet) + struct dp_packet *packet) { struct dpif_flow_stats stats; struct xlate_out xout; @@ -3113,24 +3643,27 @@ rule_dpif_credit_stats(rule, &stats); } - xlate_in_init(&xin, ofproto, flow, rule, stats.tcp_flags, packet); + xlate_in_init(&xin, ofproto, flow, flow->in_port.ofp_port, rule, + stats.tcp_flags, packet); xin.ofpacts = ofpacts; xin.ofpacts_len = ofpacts_len; xin.resubmit_stats = &stats; xlate_actions(&xin, &xout); - execute.actions = ofpbuf_data(&xout.odp_actions); - execute.actions_len = ofpbuf_size(&xout.odp_actions); + execute.actions = xout.odp_actions->data; + execute.actions_len = xout.odp_actions->size; + + pkt_metadata_from_flow(&packet->md, flow); execute.packet = packet; - execute.md = pkt_metadata_from_flow(flow); execute.needs_help = (xout.slow & SLOW_ACTION) != 0; + execute.probe = false; /* Fix up in_port. */ in_port = flow->in_port.ofp_port; if (in_port == OFPP_NONE) { in_port = OFPP_LOCAL; } - execute.md.in_port.odp_port = ofp_port_to_odp_port(ofproto, in_port); + execute.packet->md.in_port.odp_port = ofp_port_to_odp_port(ofproto, in_port); error = dpif_execute(ofproto->backer->dpif, &execute); @@ -3144,9 +3677,13 @@ const struct dpif_flow_stats *stats) { ovs_mutex_lock(&rule->stats_mutex); - rule->stats.n_packets += stats->n_packets; - rule->stats.n_bytes += stats->n_bytes; - rule->stats.used = MAX(rule->stats.used, stats->used); + if (OVS_UNLIKELY(rule->new_rule)) { + rule_dpif_credit_stats(rule->new_rule, stats); + } else { + rule->stats.n_packets += stats->n_packets; + rule->stats.n_bytes += stats->n_bytes; + rule->stats.used = MAX(rule->stats.used, stats->used); + } ovs_mutex_unlock(&rule->stats_mutex); } @@ -3164,142 +3701,81 @@ ofproto_rule_reduce_timeouts(&rule->up, idle_timeout, hard_timeout); } -/* Returns 'rule''s actions. The caller owns a reference on the returned - * actions and must eventually release it (with rule_actions_unref()) to avoid - * a memory leak. */ +/* Returns 'rule''s actions. The returned actions are RCU-protected, and can + * be read until the calling thread quiesces. */ const struct rule_actions * rule_dpif_get_actions(const struct rule_dpif *rule) { return rule_get_actions(&rule->up); } -/* Lookup 'flow' in table 0 of 'ofproto''s classifier. - * If 'wc' is non-null, sets the fields that were relevant as part of - * the lookup. Returns the table_id where a match or miss occurred. - * - * The return value will be zero unless there was a miss and - * OFPTC11_TABLE_MISS_CONTINUE is in effect for the sequence of tables - * where misses occur. - * - * The rule is returned in '*rule', which is valid at least until the next - * RCU quiescent period. If the '*rule' needs to stay around longer, - * a non-zero 'take_ref' must be passed in to cause a reference to be taken - * on it before this returns. */ -uint8_t -rule_dpif_lookup(struct ofproto_dpif *ofproto, struct flow *flow, - struct flow_wildcards *wc, struct rule_dpif **rule, - bool take_ref) -{ - enum rule_dpif_lookup_verdict verdict; - enum ofputil_port_config config = 0; - uint8_t table_id; - - if (ofproto_dpif_get_enable_recirc(ofproto)) { - /* Always exactly match recirc_id since datapath supports - * recirculation. */ - if (wc) { - wc->masks.recirc_id = UINT32_MAX; - } - - /* Start looking up from internal table for post recirculation flows - * or packets. We can also simply send all, including normal flows - * or packets to the internal table. They will not match any post - * recirculation rules except the 'catch all' rule that resubmit - * them to table 0. - * - * As an optimization, we send normal flows and packets to table 0 - * directly, saving one table lookup. */ - table_id = flow->recirc_id ? TBL_INTERNAL : 0; +/* Sets 'rule''s recirculation id. */ +static void +rule_dpif_set_recirc_id(struct rule_dpif *rule, uint32_t id) + OVS_REQUIRES(rule->up.mutex) +{ + ovs_assert(!rule->recirc_id || rule->recirc_id == id); + if (rule->recirc_id == id) { + /* Release the new reference to the same id. */ + recirc_free_id(id); } else { - table_id = 0; + rule->recirc_id = id; } +} - verdict = rule_dpif_lookup_from_table(ofproto, flow, wc, true, - &table_id, rule, take_ref); +/* Sets 'rule''s recirculation id. */ +void +rule_set_recirc_id(struct rule *rule_, uint32_t id) +{ + struct rule_dpif *rule = rule_dpif_cast(rule_); - switch (verdict) { - case RULE_DPIF_LOOKUP_VERDICT_MATCH: - return table_id; - case RULE_DPIF_LOOKUP_VERDICT_CONTROLLER: { - struct ofport_dpif *port; + ovs_mutex_lock(&rule->up.mutex); + rule_dpif_set_recirc_id(rule, id); + ovs_mutex_unlock(&rule->up.mutex); +} - port = get_ofp_port(ofproto, flow->in_port.ofp_port); - if (!port) { - VLOG_WARN_RL(&rl, "packet-in on unknown OpenFlow port %"PRIu16, - flow->in_port.ofp_port); - } - config = port ? port->up.pp.config : 0; - break; - } - case RULE_DPIF_LOOKUP_VERDICT_DROP: - config = OFPUTIL_PC_NO_PACKET_IN; - break; - case RULE_DPIF_LOOKUP_VERDICT_DEFAULT: - if (!connmgr_wants_packet_in_on_miss(ofproto->up.connmgr)) { - config = OFPUTIL_PC_NO_PACKET_IN; - } - break; - default: - OVS_NOT_REACHED(); - } +cls_version_t +ofproto_dpif_get_tables_version(struct ofproto_dpif *ofproto OVS_UNUSED) +{ + cls_version_t version; + + atomic_read_relaxed(&ofproto->tables_version, &version); - choose_miss_rule(config, ofproto->miss_rule, - ofproto->no_packet_in_rule, rule, take_ref); - return table_id; + return version; } -/* The returned rule is valid at least until the next RCU quiescent period. - * If the '*rule' needs to stay around longer, a non-zero 'take_ref' must be - * passed in to cause a reference to be taken on it before this returns. */ +/* The returned rule (if any) is valid at least until the next RCU quiescent + * period. If the rule needs to stay around longer, a non-zero 'take_ref' + * must be passed in to cause a reference to be taken on it. + * + * 'flow' is non-const to allow for temporary modifications during the lookup. + * Any changes are restored before returning. */ static struct rule_dpif * -rule_dpif_lookup_in_table(struct ofproto_dpif *ofproto, uint8_t table_id, - const struct flow *flow, struct flow_wildcards *wc, - bool take_ref) +rule_dpif_lookup_in_table(struct ofproto_dpif *ofproto, cls_version_t version, + uint8_t table_id, struct flow *flow, + struct flow_wildcards *wc, bool take_ref) { struct classifier *cls = &ofproto->up.tables[table_id].cls; const struct cls_rule *cls_rule; struct rule_dpif *rule; - fat_rwlock_rdlock(&cls->rwlock); - if (ofproto->up.frag_handling != OFPC_FRAG_NX_MATCH) { - if (wc) { - memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type); - if (is_ip_any(flow)) { - wc->masks.nw_frag |= FLOW_NW_FRAG_MASK; - } - } + do { + cls_rule = classifier_lookup(cls, version, flow, wc); - if (flow->nw_frag & FLOW_NW_FRAG_ANY) { - if (ofproto->up.frag_handling == OFPC_FRAG_NORMAL) { - /* We must pretend that transport ports are unavailable. */ - struct flow ofpc_normal_flow = *flow; - ofpc_normal_flow.tp_src = htons(0); - ofpc_normal_flow.tp_dst = htons(0); - cls_rule = classifier_lookup(cls, &ofpc_normal_flow, wc); - } else { - /* Must be OFPC_FRAG_DROP (we don't have OFPC_FRAG_REASM). */ - cls_rule = &ofproto->drop_frags_rule->up.cr; - } - } else { - cls_rule = classifier_lookup(cls, flow, wc); - } - } else { - cls_rule = classifier_lookup(cls, flow, wc); - } + rule = rule_dpif_cast(rule_from_cls_rule(cls_rule)); - rule = rule_dpif_cast(rule_from_cls_rule(cls_rule)); - if (take_ref) { - rule_dpif_ref(rule); - } - fat_rwlock_unlock(&cls->rwlock); + /* Try again if the rule was released before we get the reference. */ + } while (rule && take_ref && !rule_dpif_try_ref(rule)); return rule; } -/* Look up 'flow' in 'ofproto''s classifier starting from table '*table_id'. - * Stores the rule that was found in '*rule', or NULL if none was found. - * Updates 'wc', if nonnull, to reflect the fields that were used during the - * lookup. +/* Look up 'flow' in 'ofproto''s classifier version 'version', starting from + * table '*table_id'. Returns the rule that was found, which may be one of the + * special rules according to packet miss hadling. If 'may_packet_in' is + * false, returning of the miss_rule (which issues packet ins for the + * controller) is avoided. Updates 'wc', if nonnull, to reflect the fields + * that were used during the lookup. * * If 'honor_table_miss' is true, the first lookup occurs in '*table_id', but * if none is found then the table miss configuration for that table is @@ -3310,85 +3786,122 @@ * If 'honor_table_miss' is false, then only one table lookup occurs, in * '*table_id'. * - * Returns: - * - * - RULE_DPIF_LOOKUP_VERDICT_MATCH if a rule (in '*rule') was found. - * - * - RULE_OFPTC_TABLE_MISS_CONTROLLER if no rule was found and either: - * + 'honor_table_miss' is false - * + a table miss configuration specified that the packet should be - * sent to the controller in this case. - * - * - RULE_DPIF_LOOKUP_VERDICT_DROP if no rule was found, 'honor_table_miss' - * is true and a table miss configuration specified that the packet - * should be dropped in this case. - * - * - RULE_DPIF_LOOKUP_VERDICT_DEFAULT if no rule was found, - * 'honor_table_miss' is true and a table miss configuration has - * not been specified in this case. - * * The rule is returned in '*rule', which is valid at least until the next * RCU quiescent period. If the '*rule' needs to stay around longer, * a non-zero 'take_ref' must be passed in to cause a reference to be taken - * on it before this returns. */ -enum rule_dpif_lookup_verdict + * on it before this returns. + * + * 'in_port' allows the lookup to take place as if the in port had the value + * 'in_port'. This is needed for resubmit action support. + * + * 'flow' is non-const to allow for temporary modifications during the lookup. + * Any changes are restored before returning. */ +struct rule_dpif * rule_dpif_lookup_from_table(struct ofproto_dpif *ofproto, - const struct flow *flow, - struct flow_wildcards *wc, - bool honor_table_miss, - uint8_t *table_id, struct rule_dpif **rule, - bool take_ref) -{ + cls_version_t version, struct flow *flow, + struct flow_wildcards *wc, bool take_ref, + const struct dpif_flow_stats *stats, + uint8_t *table_id, ofp_port_t in_port, + bool may_packet_in, bool honor_table_miss) +{ + ovs_be16 old_tp_src = flow->tp_src, old_tp_dst = flow->tp_dst; + ofp_port_t old_in_port = flow->in_port.ofp_port; + enum ofputil_table_miss miss_config; + struct rule_dpif *rule; uint8_t next_id; + /* We always unwildcard nw_frag (for IP), so they + * need not be unwildcarded here. */ + if (flow->nw_frag & FLOW_NW_FRAG_ANY + && ofproto->up.frag_handling != OFPC_FRAG_NX_MATCH) { + if (ofproto->up.frag_handling == OFPC_FRAG_NORMAL) { + /* We must pretend that transport ports are unavailable. */ + flow->tp_src = htons(0); + flow->tp_dst = htons(0); + } else { + /* Must be OFPC_FRAG_DROP (we don't have OFPC_FRAG_REASM). + * Use the drop_frags_rule (which cannot disappear). */ + rule = ofproto->drop_frags_rule; + if (take_ref) { + rule_dpif_ref(rule); + } + if (stats) { + struct oftable *tbl = &ofproto->up.tables[*table_id]; + unsigned long orig; + + atomic_add_relaxed(&tbl->n_matched, stats->n_packets, &orig); + } + return rule; + } + } + + /* Look up a flow with 'in_port' as the input port. Then restore the + * original input port (otherwise OFPP_NORMAL and OFPP_IN_PORT will + * have surprising behavior). */ + flow->in_port.ofp_port = in_port; + + /* Our current implementation depends on n_tables == N_TABLES, and + * TBL_INTERNAL being the last table. */ + BUILD_ASSERT_DECL(N_TABLES == TBL_INTERNAL + 1); + + miss_config = OFPUTIL_TABLE_MISS_CONTINUE; + for (next_id = *table_id; next_id < ofproto->up.n_tables; next_id++, next_id += (next_id == TBL_INTERNAL)) { *table_id = next_id; - *rule = rule_dpif_lookup_in_table(ofproto, *table_id, flow, wc, - take_ref); - if (*rule) { - return RULE_DPIF_LOOKUP_VERDICT_MATCH; - } else if (!honor_table_miss) { - return RULE_DPIF_LOOKUP_VERDICT_CONTROLLER; - } else { - switch (ofproto_table_get_config(&ofproto->up, *table_id)) { - case OFPROTO_TABLE_MISS_CONTINUE: - break; - - case OFPROTO_TABLE_MISS_CONTROLLER: - return RULE_DPIF_LOOKUP_VERDICT_CONTROLLER; - - case OFPROTO_TABLE_MISS_DROP: - return RULE_DPIF_LOOKUP_VERDICT_DROP; - - case OFPROTO_TABLE_MISS_DEFAULT: - return RULE_DPIF_LOOKUP_VERDICT_DEFAULT; + rule = rule_dpif_lookup_in_table(ofproto, version, next_id, flow, wc, + take_ref); + if (stats) { + struct oftable *tbl = &ofproto->up.tables[next_id]; + unsigned long orig; + + atomic_add_relaxed(rule ? &tbl->n_matched : &tbl->n_missed, + stats->n_packets, &orig); + } + if (rule) { + goto out; /* Match. */ + } + if (honor_table_miss) { + miss_config = ofproto_table_get_miss_config(&ofproto->up, + *table_id); + if (miss_config == OFPUTIL_TABLE_MISS_CONTINUE) { + continue; } } + break; + } + /* Miss. */ + rule = ofproto->no_packet_in_rule; + if (may_packet_in) { + if (miss_config == OFPUTIL_TABLE_MISS_CONTINUE + || miss_config == OFPUTIL_TABLE_MISS_CONTROLLER) { + struct ofport_dpif *port; + + port = ofp_port_to_ofport(ofproto, old_in_port); + if (!port) { + VLOG_WARN_RL(&rl, "packet-in on unknown OpenFlow port %"PRIu16, + old_in_port); + } else if (!(port->up.pp.config & OFPUTIL_PC_NO_PACKET_IN)) { + rule = ofproto->miss_rule; + } + } else if (miss_config == OFPUTIL_TABLE_MISS_DEFAULT && + connmgr_wants_packet_in_on_miss(ofproto->up.connmgr)) { + rule = ofproto->miss_rule; + } } - - return RULE_DPIF_LOOKUP_VERDICT_CONTROLLER; -} - -/* Given a port configuration (specified as zero if there's no port), chooses - * which of 'miss_rule' and 'no_packet_in_rule' should be used in case of a - * flow table miss. - * - * The rule is returned in '*rule', which is valid at least until the next - * RCU quiescent period. If the '*rule' needs to stay around longer, - * a reference must be taken on it (rule_dpif_ref()). - */ -void -choose_miss_rule(enum ofputil_port_config config, struct rule_dpif *miss_rule, - struct rule_dpif *no_packet_in_rule, struct rule_dpif **rule, - bool take_ref) -{ - *rule = config & OFPUTIL_PC_NO_PACKET_IN ? no_packet_in_rule : miss_rule; if (take_ref) { - rule_dpif_ref(*rule); + rule_dpif_ref(rule); } +out: + /* Restore port numbers, as they may have been modified above. */ + flow->tp_src = old_tp_src; + flow->tp_dst = old_tp_dst; + /* Restore the old in port. */ + flow->in_port.ofp_port = old_in_port; + + return rule; } static void @@ -3398,7 +3911,6 @@ struct ofproto_dpif *ofproto = ofproto_dpif_cast(rule->up.ofproto); ofproto->backer->need_revalidate = REV_FLOW_TABLE; - ofoperation_complete(rule->up.pending, 0); } static struct rule_dpif *rule_dpif_cast(const struct rule *rule) @@ -3409,7 +3921,7 @@ static struct rule * rule_alloc(void) { - struct rule_dpif *rule = xmalloc(sizeof *rule); + struct rule_dpif *rule = xzalloc(sizeof *rule); return &rule->up; } @@ -3429,14 +3941,35 @@ rule->stats.n_packets = 0; rule->stats.n_bytes = 0; rule->stats.used = rule->up.modified; + rule->recirc_id = 0; + rule->new_rule = NULL; + return 0; } static void -rule_insert(struct rule *rule_) +rule_insert(struct rule *rule_, struct rule *old_rule_, bool forward_stats) OVS_REQUIRES(ofproto_mutex) { struct rule_dpif *rule = rule_dpif_cast(rule_); + + if (old_rule_ && forward_stats) { + struct rule_dpif *old_rule = rule_dpif_cast(old_rule_); + + ovs_assert(!old_rule->new_rule); + + /* Take a reference to the new rule, and refer all stats updates from + * the old rule to the new rule. */ + rule_dpif_ref(rule); + + ovs_mutex_lock(&old_rule->stats_mutex); + ovs_mutex_lock(&rule->stats_mutex); + old_rule->new_rule = rule; /* Forward future stats. */ + rule->stats = old_rule->stats; /* Transfer stats to the new rule. */ + ovs_mutex_unlock(&rule->stats_mutex); + ovs_mutex_unlock(&old_rule->stats_mutex); + } + complete_operation(rule); } @@ -3450,9 +3983,18 @@ static void rule_destruct(struct rule *rule_) + OVS_NO_THREAD_SAFETY_ANALYSIS { struct rule_dpif *rule = rule_dpif_cast(rule_); + ovs_mutex_destroy(&rule->stats_mutex); + /* Release reference to the new rule, if any. */ + if (rule->new_rule) { + rule_dpif_unref(rule->new_rule); + } + if (rule->recirc_id) { + recirc_free_id(rule->recirc_id); + } } static void @@ -3462,15 +4004,19 @@ struct rule_dpif *rule = rule_dpif_cast(rule_); ovs_mutex_lock(&rule->stats_mutex); - *packets = rule->stats.n_packets; - *bytes = rule->stats.n_bytes; - *used = rule->stats.used; + if (OVS_UNLIKELY(rule->new_rule)) { + rule_get_stats(&rule->new_rule->up, packets, bytes, used); + } else { + *packets = rule->stats.n_packets; + *bytes = rule->stats.n_bytes; + *used = rule->stats.used; + } ovs_mutex_unlock(&rule->stats_mutex); } static void rule_dpif_execute(struct rule_dpif *rule, const struct flow *flow, - struct ofpbuf *packet) + struct dp_packet *packet) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(rule->up.ofproto); @@ -3479,29 +4025,13 @@ static enum ofperr rule_execute(struct rule *rule, const struct flow *flow, - struct ofpbuf *packet) + struct dp_packet *packet) { rule_dpif_execute(rule_dpif_cast(rule), flow, packet); - ofpbuf_delete(packet); + dp_packet_delete(packet); return 0; } -static void -rule_modify_actions(struct rule *rule_, bool reset_counters) - OVS_REQUIRES(ofproto_mutex) -{ - struct rule_dpif *rule = rule_dpif_cast(rule_); - - if (reset_counters) { - ovs_mutex_lock(&rule->stats_mutex); - rule->stats.n_packets = 0; - rule->stats.n_bytes = 0; - ovs_mutex_unlock(&rule->stats_mutex); - } - - complete_operation(rule); -} - static struct group_dpif *group_dpif_cast(const struct ofgroup *group) { return group ? CONTAINER_OF(group, struct group_dpif, up) : NULL; @@ -3525,15 +4055,40 @@ group_construct_stats(struct group_dpif *group) OVS_REQUIRES(group->stats_mutex) { + struct ofputil_bucket *bucket; + const struct ovs_list *buckets; + group->packet_count = 0; group->byte_count = 0; - if (!group->bucket_stats) { - group->bucket_stats = xcalloc(group->up.n_buckets, - sizeof *group->bucket_stats); - } else { - memset(group->bucket_stats, 0, group->up.n_buckets * - sizeof *group->bucket_stats); + + group_dpif_get_buckets(group, &buckets); + LIST_FOR_EACH (bucket, list_node, buckets) { + bucket->stats.packet_count = 0; + bucket->stats.byte_count = 0; + } +} + +void +group_dpif_credit_stats(struct group_dpif *group, + struct ofputil_bucket *bucket, + const struct dpif_flow_stats *stats) +{ + ovs_mutex_lock(&group->stats_mutex); + group->packet_count += stats->n_packets; + group->byte_count += stats->n_bytes; + if (bucket) { + bucket->stats.packet_count += stats->n_packets; + bucket->stats.byte_count += stats->n_bytes; + } else { /* Credit to all buckets */ + const struct ovs_list *buckets; + + group_dpif_get_buckets(group, &buckets); + LIST_FOR_EACH (bucket, list_node, buckets) { + bucket->stats.packet_count += stats->n_packets; + bucket->stats.byte_count += stats->n_bytes; + } } + ovs_mutex_unlock(&group->stats_mutex); } static enum ofperr @@ -3562,36 +4117,16 @@ } static void -group_destruct__(struct group_dpif *group) - OVS_REQUIRES(group->stats_mutex) -{ - free(group->bucket_stats); - group->bucket_stats = NULL; -} - -static void group_destruct(struct ofgroup *group_) { struct group_dpif *group = group_dpif_cast(group_); - ovs_mutex_lock(&group->stats_mutex); - group_destruct__(group); - ovs_mutex_unlock(&group->stats_mutex); ovs_mutex_destroy(&group->stats_mutex); } static enum ofperr -group_modify(struct ofgroup *group_, struct ofgroup *victim_) +group_modify(struct ofgroup *group_) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(group_->ofproto); - struct group_dpif *group = group_dpif_cast(group_); - struct group_dpif *victim = group_dpif_cast(victim_); - - ovs_mutex_lock(&group->stats_mutex); - if (victim->up.n_buckets < group->up.n_buckets) { - group_destruct__(group); - } - group_construct_stats(group); - ovs_mutex_unlock(&group->stats_mutex); ofproto->backer->need_revalidate = REV_FLOW_TABLE; @@ -3602,26 +4137,37 @@ group_get_stats(const struct ofgroup *group_, struct ofputil_group_stats *ogs) { struct group_dpif *group = group_dpif_cast(group_); + struct ofputil_bucket *bucket; + const struct ovs_list *buckets; + struct bucket_counter *bucket_stats; ovs_mutex_lock(&group->stats_mutex); ogs->packet_count = group->packet_count; ogs->byte_count = group->byte_count; - memcpy(ogs->bucket_stats, group->bucket_stats, - group->up.n_buckets * sizeof *group->bucket_stats); + + group_dpif_get_buckets(group, &buckets); + bucket_stats = ogs->bucket_stats; + LIST_FOR_EACH (bucket, list_node, buckets) { + bucket_stats->packet_count = bucket->stats.packet_count; + bucket_stats->byte_count = bucket->stats.byte_count; + bucket_stats++; + } ovs_mutex_unlock(&group->stats_mutex); return 0; } +/* If the group exists, this function increments the groups's reference count. + * + * Make sure to call group_dpif_unref() after no longer needing to maintain + * a reference to the group. */ bool group_dpif_lookup(struct ofproto_dpif *ofproto, uint32_t group_id, struct group_dpif **group) - OVS_TRY_RDLOCK(true, (*group)->up.rwlock) { struct ofgroup *ofgroup; bool found; - *group = NULL; found = ofproto_group_lookup(&ofproto->up, group_id, &ofgroup); *group = found ? group_dpif_cast(ofgroup) : NULL; @@ -3629,15 +4175,8 @@ } void -group_dpif_release(struct group_dpif *group) - OVS_RELEASES(group->up.rwlock) -{ - ofproto_group_release(&group->up); -} - -void group_dpif_get_buckets(const struct group_dpif *group, - const struct list **buckets) + const struct ovs_list **buckets) { *buckets = &group->up.buckets; } @@ -3647,12 +4186,18 @@ { return group->up.type; } + +const char * +group_dpif_get_selection_method(const struct group_dpif *group) +{ + return group->up.props.selection_method; +} /* Sends 'packet' out 'ofport'. * May modify 'packet'. * Returns 0 if successful, otherwise a positive errno value. */ int -ofproto_dpif_send_packet(const struct ofport_dpif *ofport, struct ofpbuf *packet) +ofproto_dpif_send_packet(const struct ofport_dpif *ofport, struct dp_packet *packet) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); int error; @@ -3661,11 +4206,34 @@ ovs_mutex_lock(&ofproto->stats_mutex); ofproto->stats.tx_packets++; - ofproto->stats.tx_bytes += ofpbuf_size(packet); + ofproto->stats.tx_bytes += dp_packet_size(packet); ovs_mutex_unlock(&ofproto->stats_mutex); return error; } + +uint64_t +group_dpif_get_selection_method_param(const struct group_dpif *group) +{ + return group->up.props.selection_method_param; +} + +const struct field_array * +group_dpif_get_fields(const struct group_dpif *group) +{ + return &group->up.props.fields; +} +/* Return the version string of the datapath that backs up + * this 'ofproto'. + */ +static const char * +get_datapath_version(const struct ofproto *ofproto_) +{ + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); + + return ofproto->backer->dp_version_string; +} + static bool set_frag_handling(struct ofproto *ofproto_, enum ofp_config_flags frag_handling) @@ -3680,7 +4248,7 @@ } static enum ofperr -packet_out(struct ofproto *ofproto_, struct ofpbuf *packet, +packet_out(struct ofproto *ofproto_, struct dp_packet *packet, const struct flow *flow, const struct ofpact *ofpacts, size_t ofpacts_len) { @@ -3763,6 +4331,36 @@ unixctl_command_reply(conn, "table successfully flushed"); } +static void +ofproto_unixctl_mcast_snooping_flush(struct unixctl_conn *conn, int argc, + const char *argv[], void *aux OVS_UNUSED) +{ + struct ofproto_dpif *ofproto; + + if (argc > 1) { + ofproto = ofproto_dpif_lookup(argv[1]); + if (!ofproto) { + unixctl_command_reply_error(conn, "no such bridge"); + return; + } + + if (!mcast_snooping_enabled(ofproto->ms)) { + unixctl_command_reply_error(conn, "multicast snooping is disabled"); + return; + } + mcast_snooping_mdb_flush(ofproto->ms); + } else { + HMAP_FOR_EACH (ofproto, all_ofproto_dpifs_node, &all_ofproto_dpifs) { + if (!mcast_snooping_enabled(ofproto->ms)) { + continue; + } + mcast_snooping_mdb_flush(ofproto->ms); + } + } + + unixctl_command_reply(conn, "table successfully flushed"); +} + static struct ofport_dpif * ofbundle_get_a_port(const struct ofbundle *bundle) { @@ -3787,7 +4385,7 @@ ds_put_cstr(&ds, " port VLAN MAC Age\n"); ovs_rwlock_rdlock(&ofproto->ml->rwlock); LIST_FOR_EACH (e, lru_node, &ofproto->ml->lrus) { - struct ofbundle *bundle = e->port.p; + struct ofbundle *bundle = mac_entry_get_port(ofproto->ml, e); char name[OFP_MAX_PORT_NAME_LEN]; ofputil_port_to_string(ofbundle_get_a_port(bundle)->up.ofp_port, @@ -3801,6 +4399,61 @@ ds_destroy(&ds); } +static void +ofproto_unixctl_mcast_snooping_show(struct unixctl_conn *conn, + int argc OVS_UNUSED, + const char *argv[], + void *aux OVS_UNUSED) +{ + struct ds ds = DS_EMPTY_INITIALIZER; + const struct ofproto_dpif *ofproto; + const struct ofbundle *bundle; + const struct mcast_group *grp; + struct mcast_group_bundle *b; + struct mcast_mrouter_bundle *mrouter; + + ofproto = ofproto_dpif_lookup(argv[1]); + if (!ofproto) { + unixctl_command_reply_error(conn, "no such bridge"); + return; + } + + if (!mcast_snooping_enabled(ofproto->ms)) { + unixctl_command_reply_error(conn, "multicast snooping is disabled"); + return; + } + + ds_put_cstr(&ds, " port VLAN GROUP Age\n"); + ovs_rwlock_rdlock(&ofproto->ms->rwlock); + LIST_FOR_EACH (grp, group_node, &ofproto->ms->group_lru) { + LIST_FOR_EACH(b, bundle_node, &grp->bundle_lru) { + char name[OFP_MAX_PORT_NAME_LEN]; + + bundle = b->port; + ofputil_port_to_string(ofbundle_get_a_port(bundle)->up.ofp_port, + name, sizeof name); + ds_put_format(&ds, "%5s %4d "IP_FMT" %3d\n", + name, grp->vlan, IP_ARGS(grp->ip4), + mcast_bundle_age(ofproto->ms, b)); + } + } + + /* ports connected to multicast routers */ + LIST_FOR_EACH(mrouter, mrouter_node, &ofproto->ms->mrouter_lru) { + char name[OFP_MAX_PORT_NAME_LEN]; + + bundle = mrouter->port; + ofputil_port_to_string(ofbundle_get_a_port(bundle)->up.ofp_port, + name, sizeof name); + ds_put_format(&ds, "%5s %4d querier %3d\n", + name, mrouter->vlan, + mcast_mrouter_age(ofproto->ms, mrouter)); + } + ovs_rwlock_unlock(&ofproto->ms->rwlock); + unixctl_command_reply(conn, ds_cstr(&ds)); + ds_destroy(&ds); +} + struct trace_ctx { struct xlate_out xout; struct xlate_in xin; @@ -3874,12 +4527,11 @@ trace_format_odp(struct ds *result, int level, const char *title, struct trace_ctx *trace) { - struct ofpbuf *odp_actions = &trace->xout.odp_actions; + struct ofpbuf *odp_actions = trace->xout.odp_actions; ds_put_char_multiple(result, '\t', level); ds_put_format(result, "%s: ", title); - format_odp_actions(result, ofpbuf_data(odp_actions), - ofpbuf_size(odp_actions)); + format_odp_actions(result, odp_actions->data, odp_actions->size); ds_put_char(result, '\n'); } @@ -3897,18 +4549,36 @@ ds_put_char(result, '\n'); } +static void trace_report(struct xlate_in *xin, const char *s, int recurse); + static void trace_resubmit(struct xlate_in *xin, struct rule_dpif *rule, int recurse) { struct trace_ctx *trace = CONTAINER_OF(xin, struct trace_ctx, xin); struct ds *result = trace->result; + if (!recurse) { + if (rule == xin->ofproto->miss_rule) { + trace_report(xin, "No match, flow generates \"packet in\"s.", + recurse); + } else if (rule == xin->ofproto->no_packet_in_rule) { + trace_report(xin, "No match, packets dropped because " + "OFPPC_NO_PACKET_IN is set on in_port.", recurse); + } else if (rule == xin->ofproto->drop_frags_rule) { + trace_report(xin, "Packets dropped because they are IP " + "fragments and the fragment handling mode is " + "\"drop\".", recurse); + } + } + ds_put_char(result, '\n'); - trace_format_flow(result, recurse + 1, "Resubmitted flow", trace); - trace_format_regs(result, recurse + 1, "Resubmitted regs", trace); - trace_format_odp(result, recurse + 1, "Resubmitted odp", trace); - trace_format_megaflow(result, recurse + 1, "Resubmitted megaflow", trace); - trace_format_rule(result, recurse + 1, rule); + if (recurse) { + trace_format_flow(result, recurse, "Resubmitted flow", trace); + trace_format_regs(result, recurse, "Resubmitted regs", trace); + trace_format_odp(result, recurse, "Resubmitted odp", trace); + trace_format_megaflow(result, recurse, "Resubmitted megaflow", trace); + } + trace_format_rule(result, recurse, rule); } static void @@ -3930,16 +4600,16 @@ * * On success, initializes '*ofprotop' and 'flow' and returns NULL. On failure * returns a nonnull malloced error message. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_flow_and_packet(int argc, const char *argv[], struct ofproto_dpif **ofprotop, struct flow *flow, - struct ofpbuf **packetp) + struct dp_packet **packetp) { const struct dpif_backer *backer = NULL; const char *error = NULL; char *m_err = NULL; struct simap port_names = SIMAP_INITIALIZER(&port_names); - struct ofpbuf *packet; + struct dp_packet *packet; struct ofpbuf odp_key; struct ofpbuf odp_mask; @@ -3948,7 +4618,7 @@ /* Handle "-generate" or a hex string as the last argument. */ if (!strcmp(argv[argc - 1], "-generate")) { - packet = ofpbuf_new(0); + packet = dp_packet_new(0); argc--; } else { error = eth_from_hex(argv[argc - 1], &packet); @@ -4003,17 +4673,25 @@ goto exit; } - if (xlate_receive(backer, NULL, ofpbuf_data(&odp_key), - ofpbuf_size(&odp_key), flow, - ofprotop, NULL, NULL, NULL, NULL)) { + if (odp_flow_key_to_flow(odp_key.data, odp_key.size, flow) == ODP_FIT_ERROR) { + error = "Failed to parse datapath flow key"; + goto exit; + } + + *ofprotop = xlate_lookup_ofproto(backer, flow, + &flow->in_port.ofp_port); + if (*ofprotop == NULL) { error = "Invalid datapath flow"; goto exit; } + + vsp_adjust_flow(*ofprotop, flow, NULL); + } else { char *err = parse_ofp_exact_flow(flow, NULL, argv[argc - 1], NULL); if (err) { - m_err = xasprintf("Bad flow syntax: %s", err); + m_err = xasprintf("Bad openflow flow syntax: %s", err); free(err); goto exit; } else { @@ -4032,14 +4710,13 @@ /* Generate a packet, if requested. */ if (packet) { - if (!ofpbuf_size(packet)) { + if (!dp_packet_size(packet)) { flow_compose(packet, flow); } else { - struct pkt_metadata md = pkt_metadata_from_flow(flow); - /* Use the metadata from the flow and the packet argument * to reconstruct the flow. */ - flow_extract(packet, &md, flow); + pkt_metadata_from_flow(&packet->md, flow); + flow_extract(packet, flow); } } @@ -4048,7 +4725,7 @@ m_err = xstrdup(error); } if (m_err) { - ofpbuf_delete(packet); + dp_packet_delete(packet); packet = NULL; } *packetp = packet; @@ -4063,7 +4740,7 @@ void *aux OVS_UNUSED) { struct ofproto_dpif *ofproto; - struct ofpbuf *packet; + struct dp_packet *packet; char *error; struct flow flow; @@ -4075,7 +4752,7 @@ ofproto_trace(ofproto, &flow, packet, NULL, 0, &result); unixctl_command_reply(conn, ds_cstr(&result)); ds_destroy(&result); - ofpbuf_delete(packet); + dp_packet_delete(packet); } else { unixctl_command_reply_error(conn, error); free(error); @@ -4090,7 +4767,7 @@ struct ofproto_dpif *ofproto; bool enforce_consistency; struct ofpbuf ofpacts; - struct ofpbuf *packet; + struct dp_packet *packet; struct ds result; struct flow flow; uint16_t in_port; @@ -4104,7 +4781,7 @@ ofpbuf_init(&ofpacts, 0); /* Parse actions. */ - error = parse_ofpacts(argv[--argc], &ofpacts, &usable_protocols); + error = ofpacts_parse_actions(argv[--argc], &ofpacts, &usable_protocols); if (error) { unixctl_command_reply_error(conn, error); free(error); @@ -4131,7 +4808,7 @@ /* Do the same checks as handle_packet_out() in ofproto.c. * - * We pass a 'table_id' of 0 to ofproto_check_ofpacts(), which isn't + * We pass a 'table_id' of 0 to ofpacts_check(), which isn't * strictly correct because these actions aren't in any table, but it's OK * because it 'table_id' is used only to check goto_table instructions, but * packet-outs take a list of actions and therefore it can't include @@ -4145,11 +4822,11 @@ goto exit; } if (enforce_consistency) { - retval = ofpacts_check_consistency(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), + retval = ofpacts_check_consistency(ofpacts.data, ofpacts.size, &flow, u16_to_ofp(ofproto->up.max_ports), 0, 0, usable_protocols); } else { - retval = ofpacts_check(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &flow, + retval = ofpacts_check(ofpacts.data, ofpacts.size, &flow, u16_to_ofp(ofproto->up.max_ports), 0, 0, &usable_protocols); } @@ -4162,12 +4839,12 @@ } ofproto_trace(ofproto, &flow, packet, - ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &result); + ofpacts.data, ofpacts.size, &result); unixctl_command_reply(conn, ds_cstr(&result)); exit: ds_destroy(&result); - ofpbuf_delete(packet); + dp_packet_delete(packet); ofpbuf_uninit(&ofpacts); } @@ -4182,11 +4859,10 @@ * trace, otherwise the actions are determined by a flow table lookup. */ static void ofproto_trace(struct ofproto_dpif *ofproto, struct flow *flow, - const struct ofpbuf *packet, + const struct dp_packet *packet, const struct ofpact ofpacts[], size_t ofpacts_len, struct ds *ds) { - struct rule_dpif *rule; struct trace_ctx trace; ds_put_format(ds, "Bridge: %s\n", ofproto->up.name); @@ -4195,65 +4871,45 @@ ds_put_char(ds, '\n'); flow_wildcards_init_catchall(&trace.wc); - if (ofpacts) { - rule = NULL; - } else { - rule_dpif_lookup(ofproto, flow, &trace.wc, &rule, false); - trace_format_rule(ds, 0, rule); - if (rule == ofproto->miss_rule) { - ds_put_cstr(ds, "\nNo match, flow generates \"packet in\"s.\n"); - } else if (rule == ofproto->no_packet_in_rule) { - ds_put_cstr(ds, "\nNo match, packets dropped because " - "OFPPC_NO_PACKET_IN is set on in_port.\n"); - } else if (rule == ofproto->drop_frags_rule) { - ds_put_cstr(ds, "\nPackets dropped because they are IP fragments " - "and the fragment handling mode is \"drop\".\n"); - } - } + trace.result = ds; + trace.key = flow; /* Original flow key, used for megaflow. */ + trace.flow = *flow; /* May be modified by actions. */ + xlate_in_init(&trace.xin, ofproto, flow, flow->in_port.ofp_port, NULL, + ntohs(flow->tcp_flags), packet); + trace.xin.ofpacts = ofpacts; + trace.xin.ofpacts_len = ofpacts_len; + trace.xin.resubmit_hook = trace_resubmit; + trace.xin.report_hook = trace_report; - if (rule || ofpacts) { - trace.result = ds; - trace.key = flow; /* Original flow key, used for megaflow. */ - trace.flow = *flow; /* May be modified by actions. */ - xlate_in_init(&trace.xin, ofproto, flow, rule, ntohs(flow->tcp_flags), - packet); - if (ofpacts) { - trace.xin.ofpacts = ofpacts; - trace.xin.ofpacts_len = ofpacts_len; - } - trace.xin.resubmit_hook = trace_resubmit; - trace.xin.report_hook = trace_report; - - xlate_actions(&trace.xin, &trace.xout); + xlate_actions(&trace.xin, &trace.xout); - ds_put_char(ds, '\n'); - trace_format_flow(ds, 0, "Final flow", &trace); - trace_format_megaflow(ds, 0, "Megaflow", &trace); + ds_put_char(ds, '\n'); + trace_format_flow(ds, 0, "Final flow", &trace); + trace_format_megaflow(ds, 0, "Megaflow", &trace); - ds_put_cstr(ds, "Datapath actions: "); - format_odp_actions(ds, ofpbuf_data(&trace.xout.odp_actions), - ofpbuf_size(&trace.xout.odp_actions)); + ds_put_cstr(ds, "Datapath actions: "); + format_odp_actions(ds, trace.xout.odp_actions->data, + trace.xout.odp_actions->size); - if (trace.xout.slow) { - enum slow_path_reason slow; + if (trace.xout.slow) { + enum slow_path_reason slow; - ds_put_cstr(ds, "\nThis flow is handled by the userspace " - "slow path because it:"); + ds_put_cstr(ds, "\nThis flow is handled by the userspace " + "slow path because it:"); - slow = trace.xout.slow; - while (slow) { - enum slow_path_reason bit = rightmost_1bit(slow); + slow = trace.xout.slow; + while (slow) { + enum slow_path_reason bit = rightmost_1bit(slow); - ds_put_format(ds, "\n\t- %s.", - slow_path_reason_to_explanation(bit)); + ds_put_format(ds, "\n\t- %s.", + slow_path_reason_to_explanation(bit)); - slow &= ~bit; - } + slow &= ~bit; } - - xlate_out_uninit(&trace.xout); } + + xlate_out_uninit(&trace.xout); } /* Store the current ofprotos in 'ofproto_shash'. Returns a sorted list @@ -4383,38 +5039,23 @@ ds_destroy(&ds); } -static bool -ofproto_dpif_contains_flow(const struct ofproto_dpif *ofproto, - const struct nlattr *key, size_t key_len) -{ - struct ofproto_dpif *ofp; - struct flow flow; - - xlate_receive(ofproto->backer, NULL, key, key_len, &flow, &ofp, - NULL, NULL, NULL, NULL); - return ofp == ofproto; -} - static void ofproto_unixctl_dpif_dump_flows(struct unixctl_conn *conn, int argc OVS_UNUSED, const char *argv[], void *aux OVS_UNUSED) { - struct ds ds = DS_EMPTY_INITIALIZER; - const struct dpif_flow_stats *stats; const struct ofproto_dpif *ofproto; - struct dpif_flow_dump flow_dump; - const struct nlattr *actions; - const struct nlattr *mask; - const struct nlattr *key; - size_t actions_len; - size_t mask_len; - size_t key_len; + + struct ds ds = DS_EMPTY_INITIALIZER; bool verbosity = false; + struct dpif_port dpif_port; struct dpif_port_dump port_dump; struct hmap portno_names; - void *state = NULL; + + struct dpif_flow_dump *flow_dump; + struct dpif_flow_dump_thread *flow_dump_thread; + struct dpif_flow f; int error; ofproto = ofproto_dpif_lookup(argv[argc - 1]); @@ -4433,30 +5074,31 @@ } ds_init(&ds); - error = dpif_flow_dump_start(&flow_dump, ofproto->backer->dpif); - if (error) { - goto exit; - } - dpif_flow_dump_state_init(ofproto->backer->dpif, &state); - while (dpif_flow_dump_next(&flow_dump, state, &key, &key_len, - &mask, &mask_len, &actions, &actions_len, - &stats)) { - if (!ofproto_dpif_contains_flow(ofproto, key, key_len)) { + flow_dump = dpif_flow_dump_create(ofproto->backer->dpif, false); + flow_dump_thread = dpif_flow_dump_thread_create(flow_dump); + while (dpif_flow_dump_next(flow_dump_thread, &f, 1)) { + struct flow flow; + + if (odp_flow_key_to_flow(f.key, f.key_len, &flow) == ODP_FIT_ERROR + || xlate_lookup_ofproto(ofproto->backer, &flow, NULL) != ofproto) { continue; } - odp_flow_format(key, key_len, mask, mask_len, &portno_names, &ds, - verbosity); + if (verbosity) { + odp_format_ufid(&f.ufid, &ds); + ds_put_cstr(&ds, " "); + } + odp_flow_format(f.key, f.key_len, f.mask, f.mask_len, + &portno_names, &ds, verbosity); ds_put_cstr(&ds, ", "); - dpif_flow_stats_format(stats, &ds); + dpif_flow_stats_format(&f.stats, &ds); ds_put_cstr(&ds, ", actions:"); - format_odp_actions(&ds, actions, actions_len); + format_odp_actions(&ds, f.actions, f.actions_len); ds_put_char(&ds, '\n'); } - dpif_flow_dump_state_uninit(ofproto->backer->dpif, state); - error = dpif_flow_dump_done(&flow_dump); + dpif_flow_dump_thread_destroy(flow_dump_thread); + error = dpif_flow_dump_destroy(flow_dump); -exit: if (error) { ds_clear(&ds); ds_put_format(&ds, "dpif/dump_flows failed: %s", ovs_strerror(errno)); @@ -4470,7 +5112,36 @@ } static void -ofproto_dpif_unixctl_init(void) +ofproto_revalidate_all_backers(void) +{ + const struct shash_node **backers; + int i; + + backers = shash_sort(&all_dpif_backers); + for (i = 0; i < shash_count(&all_dpif_backers); i++) { + struct dpif_backer *backer = backers[i]->data; + backer->need_revalidate = REV_RECONFIGURE; + } + free(backers); +} + +static void +disable_tnl_push_pop(struct unixctl_conn *conn OVS_UNUSED, int argc OVS_UNUSED, + const char *argv[], void *aux OVS_UNUSED) +{ + if (!strcasecmp(argv[1], "off")) { + ofproto_use_tnl_push_pop = false; + unixctl_command_reply(conn, "Tunnel push-pop off"); + ofproto_revalidate_all_backers(); + } else if (!strcasecmp(argv[1], "on")) { + ofproto_use_tnl_push_pop = true; + unixctl_command_reply(conn, "Tunnel push-pop on"); + ofproto_revalidate_all_backers(); + } +} + +static void +ofproto_unixctl_init(void) { static bool registered; if (registered) { @@ -4490,12 +5161,19 @@ ofproto_unixctl_fdb_flush, NULL); unixctl_command_register("fdb/show", "bridge", 1, 1, ofproto_unixctl_fdb_show, NULL); + unixctl_command_register("mdb/flush", "[bridge]", 0, 1, + ofproto_unixctl_mcast_snooping_flush, NULL); + unixctl_command_register("mdb/show", "bridge", 1, 1, + ofproto_unixctl_mcast_snooping_show, NULL); unixctl_command_register("dpif/dump-dps", "", 0, 0, ofproto_unixctl_dpif_dump_dps, NULL); unixctl_command_register("dpif/show", "", 0, 0, ofproto_unixctl_dpif_show, NULL); unixctl_command_register("dpif/dump-flows", "[-m] bridge", 1, 2, ofproto_unixctl_dpif_dump_flows, NULL); + + unixctl_command_register("ofproto/tnl-push-pop", "[on]|[off]", 1, 1, + disable_tnl_push_pop, NULL); } /* Returns true if 'table' is the table used for internal rules, @@ -4652,11 +5330,13 @@ /* Given 'flow', a flow representing a packet received on 'ofproto', checks * whether 'flow->in_port' represents a Linux VLAN device. If so, changes * 'flow->in_port' to the "real" device backing the VLAN device, sets - * 'flow->vlan_tci' to the VLAN VID, and returns true. Otherwise (which is - * always the case unless VLAN splinters are enabled), returns false without - * making any changes. */ + * 'flow->vlan_tci' to the VLAN VID, and returns true. Optionally pushes the + * appropriate VLAN on 'packet' if provided. Otherwise (which is always the + * case unless VLAN splinters are enabled), returns false without making any + * changes. */ bool -vsp_adjust_flow(const struct ofproto_dpif *ofproto, struct flow *flow) +vsp_adjust_flow(const struct ofproto_dpif *ofproto, struct flow *flow, + struct dp_packet *packet) OVS_EXCLUDED(ofproto->vsp_mutex) { ofp_port_t realdev; @@ -4678,6 +5358,15 @@ * the VLAN device's VLAN ID. */ flow->in_port.ofp_port = realdev; flow->vlan_tci = htons((vid & VLAN_VID_MASK) | VLAN_CFI); + + if (packet) { + /* Make the packet resemble the flow, so that it gets sent to an + * OpenFlow controller properly, so that it looks correct for sFlow, + * and so that flow_extract() will get the correct vlan_tci if it is + * called on 'packet'. */ + eth_push_vlan(packet, htons(ETH_TYPE_VLAN), flow->vlan_tci); + } + return true; } @@ -4732,7 +5421,7 @@ static odp_port_t ofp_port_to_odp_port(const struct ofproto_dpif *ofproto, ofp_port_t ofp_port) { - const struct ofport_dpif *ofport = get_ofp_port(ofproto, ofp_port); + const struct ofport_dpif *ofport = ofp_port_to_ofport(ofproto, ofp_port); return ofport ? ofport->odp_port : ODPP_NONE; } @@ -4767,25 +5456,10 @@ } } -uint32_t -ofproto_dpif_alloc_recirc_id(struct ofproto_dpif *ofproto) -{ - struct dpif_backer *backer = ofproto->backer; - - return recirc_id_alloc(backer->rid_pool); -} - -void -ofproto_dpif_free_recirc_id(struct ofproto_dpif *ofproto, uint32_t recirc_id) -{ - struct dpif_backer *backer = ofproto->backer; - - recirc_id_free(backer->rid_pool, recirc_id); -} - int ofproto_dpif_add_internal_flow(struct ofproto_dpif *ofproto, const struct match *match, int priority, + uint16_t idle_timeout, const struct ofpbuf *ofpacts, struct rule **rulep) { @@ -4801,13 +5475,14 @@ fm.modify_cookie = false; fm.table_id = TBL_INTERNAL; fm.command = OFPFC_ADD; - fm.idle_timeout = 0; + fm.idle_timeout = idle_timeout; fm.hard_timeout = 0; + fm.importance = 0; fm.buffer_id = 0; fm.out_port = 0; fm.flags = OFPUTIL_FF_HIDDEN_FIELDS | OFPUTIL_FF_NO_READONLY; - fm.ofpacts = ofpbuf_data(ofpacts); - fm.ofpacts_len = ofpbuf_size(ofpacts); + fm.ofpacts = ofpacts->data; + fm.ofpacts_len = ofpacts->size; error = ofproto_flow_mod(&ofproto->up, &fm); if (error) { @@ -4817,7 +5492,9 @@ return error; } - rule = rule_dpif_lookup_in_table(ofproto, TBL_INTERNAL, &fm.match.flow, + rule = rule_dpif_lookup_in_table(ofproto, + ofproto_dpif_get_tables_version(ofproto), + TBL_INTERNAL, &fm.match.flow, &fm.match.wc, false); if (rule) { *rulep = &rule->up; @@ -4871,8 +5548,8 @@ NULL, /* get_memory_usage. */ type_get_memory_usage, flush, - get_features, - get_tables, + query_tables, + set_tables_version, port_alloc, port_construct, port_destruct, @@ -4889,6 +5566,7 @@ port_poll, port_poll_wait, port_is_lacp_current, + port_get_lacp_stats, NULL, /* rule_choose_table */ rule_alloc, rule_construct, @@ -4898,7 +5576,6 @@ rule_dealloc, rule_get_stats, rule_execute, - rule_modify_actions, set_frag_handling, packet_out, set_netflow, @@ -4906,14 +5583,27 @@ set_sflow, set_ipfix, set_cfm, + cfm_status_changed, get_cfm_status, + set_lldp, + get_lldp_status, + set_aa, + aa_mapping_set, + aa_mapping_unset, + aa_vlan_get_queued, + aa_vlan_get_queue_size, set_bfd, + bfd_status_changed, get_bfd_status, set_stp, get_stp_status, set_stp_port, get_stp_port_status, get_stp_port_stats, + set_rstp, + get_rstp_status, + set_rstp_port, + get_rstp_port_status, set_queues, bundle_set, bundle_remove, @@ -4923,6 +5613,8 @@ is_mirror_output_bundle, forward_bpdu_changed, set_mac_table_config, + set_mcast_snooping, + set_mcast_snooping_port, set_realdev, NULL, /* meter_get_features */ NULL, /* meter_set */ @@ -4934,4 +5626,5 @@ group_dealloc, /* group_dealloc */ group_modify, /* group_modify */ group_get_stats, /* group_get_stats */ + get_datapath_version, /* get_datapath_version */ }; diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif.h openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif.h --- openvswitch-2.3.1/ofproto/ofproto-dpif.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,9 @@ #include "util.h" #include "ovs-thread.h" +/* Priority for internal rules created to handle recirculation */ +#define RECIRC_RULE_PRIORITY 20 + union user_action_cookie; struct dpif_flow_stats; struct ofproto; @@ -37,24 +40,10 @@ struct OVS_LOCKABLE rule_dpif; struct OVS_LOCKABLE group_dpif; -enum rule_dpif_lookup_verdict { - RULE_DPIF_LOOKUP_VERDICT_MATCH, /* A match occurred. */ - RULE_DPIF_LOOKUP_VERDICT_CONTROLLER, /* A miss occurred and the packet - * should be passed to - * the controller. */ - RULE_DPIF_LOOKUP_VERDICT_DROP, /* A miss occurred and the packet - * should be dropped. */ - RULE_DPIF_LOOKUP_VERDICT_DEFAULT, /* A miss occurred and the packet - * should handled by the default - * miss behaviour. - * For pre-OF1.3 it should be - * forwarded to the controller. - * For OF1.3+ it should be - * dropped. */ -}; - -/* For lock annotation below only. */ -extern struct ovs_rwlock xlate_rwlock; +/* Number of implemented OpenFlow tables. */ +enum { N_TABLES = 255 }; +enum { TBL_INTERNAL = N_TABLES - 1 }; /* Used for internal hidden rules. */ +BUILD_ASSERT_DECL(N_TABLES >= 2 && N_TABLES <= 255); /* Ofproto-dpif -- DPIF based ofproto implementation. * @@ -84,20 +73,46 @@ * Ofproto-dpif-xlate is responsible for translating OpenFlow actions into * datapath actions. */ +/* Stores the various features which the corresponding backer supports. */ +struct dpif_backer_support { + /* True if the datapath supports variable-length + * OVS_USERSPACE_ATTR_USERDATA in OVS_ACTION_ATTR_USERSPACE actions. + * False if the datapath supports only 8-byte (or shorter) userdata. */ + bool variable_length_userdata; + + /* Maximum number of MPLS label stack entries that the datapath supports + * in a match */ + size_t max_mpls_depth; + + /* True if the datapath supports masked data in OVS_ACTION_ATTR_SET + * actions. */ + bool masked_set_action; + + /* True if the datapath supports recirculation. */ + bool recirc; + + /* True if the datapath supports tnl_push and pop actions. */ + bool tnl_push_pop; + + /* True if the datapath supports OVS_FLOW_ATTR_UFID. */ + bool ufid; +}; + size_t ofproto_dpif_get_max_mpls_depth(const struct ofproto_dpif *); bool ofproto_dpif_get_enable_recirc(const struct ofproto_dpif *); +bool ofproto_dpif_get_enable_ufid(struct dpif_backer *backer); -uint8_t rule_dpif_lookup(struct ofproto_dpif *, struct flow *, - struct flow_wildcards *, struct rule_dpif **rule, - bool take_ref); - -enum rule_dpif_lookup_verdict rule_dpif_lookup_from_table(struct ofproto_dpif *, - const struct flow *, - struct flow_wildcards *, - bool force_controller_on_miss, - uint8_t *table_id, - struct rule_dpif **rule, - bool take_ref); +cls_version_t ofproto_dpif_get_tables_version(struct ofproto_dpif *); + +struct rule_dpif *rule_dpif_lookup_from_table(struct ofproto_dpif *, + cls_version_t, struct flow *, + struct flow_wildcards *, + bool take_ref, + const struct dpif_flow_stats *, + uint8_t *table_id, + ofp_port_t in_port, + bool may_packet_in, + bool honor_table_miss); static inline void rule_dpif_ref(struct rule_dpif *); static inline void rule_dpif_unref(struct rule_dpif *); @@ -114,6 +129,7 @@ bool table_is_internal(uint8_t table_id); const struct rule_actions *rule_dpif_get_actions(const struct rule_dpif *); +void rule_set_recirc_id(struct rule *, uint32_t id); ovs_be64 rule_dpif_get_flow_cookie(const struct rule_dpif *rule); @@ -125,113 +141,66 @@ struct rule_dpif *no_packet_in_rule, struct rule_dpif **rule, bool take_ref); +void group_dpif_credit_stats(struct group_dpif *, + struct ofputil_bucket *, + const struct dpif_flow_stats *); bool group_dpif_lookup(struct ofproto_dpif *ofproto, uint32_t group_id, struct group_dpif **group); -void group_dpif_release(struct group_dpif *group); - void group_dpif_get_buckets(const struct group_dpif *group, - const struct list **buckets); + const struct ovs_list **buckets); enum ofp11_group_type group_dpif_get_type(const struct group_dpif *group); +const char *group_dpif_get_selection_method(const struct group_dpif *group); +uint64_t group_dpif_get_selection_method_param(const struct group_dpif *group); +const struct field_array *group_dpif_get_fields(const struct group_dpif *group); bool ofproto_has_vlan_splinters(const struct ofproto_dpif *); ofp_port_t vsp_realdev_to_vlandev(const struct ofproto_dpif *, ofp_port_t realdev_ofp_port, ovs_be16 vlan_tci); -bool vsp_adjust_flow(const struct ofproto_dpif *, struct flow *); +bool vsp_adjust_flow(const struct ofproto_dpif *, struct flow *, + struct dp_packet *packet); int ofproto_dpif_execute_actions(struct ofproto_dpif *, const struct flow *, struct rule_dpif *, const struct ofpact *, - size_t ofpacts_len, struct ofpbuf *) - OVS_EXCLUDED(xlate_rwlock); + size_t ofpacts_len, struct dp_packet *); void ofproto_dpif_send_packet_in(struct ofproto_dpif *, struct ofproto_packet_in *); bool ofproto_dpif_wants_packet_in_on_miss(struct ofproto_dpif *); -int ofproto_dpif_send_packet(const struct ofport_dpif *, struct ofpbuf *); +int ofproto_dpif_send_packet(const struct ofport_dpif *, struct dp_packet *); void ofproto_dpif_flow_mod(struct ofproto_dpif *, struct ofputil_flow_mod *); struct rule_dpif *ofproto_dpif_refresh_rule(struct rule_dpif *); struct ofport_dpif *odp_port_to_ofport(const struct dpif_backer *, odp_port_t); +struct ofport_dpif *ofp_port_to_ofport(const struct ofproto_dpif *, + ofp_port_t); -/* - * Recirculation - * ============= - * - * Recirculation is a technique to allow a frame to re-enter the packet - * processing path for one or multiple times to achieve more flexible packet - * processing in the data path. MPLS handling and selecting bond slave port - * of a bond ports. - * - * Data path and user space interface - * ----------------------------------- - * - * Two new fields, recirc_id and dp_hash, are added to the current flow data - * structure. They are both of type uint32_t. In addition, a new action, - * RECIRC, are added. - * - * The value recirc_id is used to distinguish a packet from multiple - * iterations of recirculation. A packet initially received is considered of - * having recirc_id of 0. Recirc_id is managed by the user space, opaque to - * the data path. - * - * On the other hand, dp_hash can only be computed by the data path, opaque to - * the user space. In fact, user space may not able to recompute the hash - * value. The dp_hash value should be wildcarded when for a newly received - * packet. RECIRC action specifies whether the hash is computed. If computed, - * how many fields to be included in the hash computation. The computed hash - * value is stored into the dp_hash field prior to recirculation. - * - * The RECIRC action computes and set the dp_hash field, set the recirc_id - * field and then reprocess the packet as if it was received on the same input - * port. RECIRC action works like a function call; actions listed behind the - * RECIRC action will be executed after its execution. RECIRC action can be - * nested, data path implementation limits the number of recirculation executed - * to prevent unreasonable nesting depth or infinite loop. - * - * Both flow fields and the RECIRC action are exposed as open flow fields via - * Nicira extensions. - * - * Post recirculation flow - * ------------------------ - * - * At the open flow level, post recirculation rules are always hidden from the - * controller. They are installed in table 254 which is set up as a hidden - * table during boot time. Those rules are managed by the local user space - * program only. - * - * To speed up the classifier look up process, recirc_id is always reflected - * into the metadata field, since recirc_id is required to be exactly matched. - * - * Classifier look up always starts with table 254. A post recirculation flow - * lookup should find its hidden rule within this table. On the other hand, A - * newly received packet should miss all post recirculation rules because its - * recirc_id is zero, then hit a pre-installed lower priority rule to redirect - * classifier to look up starting from table 0: - * - * * , actions=resubmit(,0) - * - * Post recirculation data path flows are managed like other data path flows. - * They are created on demand. Miss handling, stats collection and revalidation - * work the same way as regular flows. - */ - -uint32_t ofproto_dpif_alloc_recirc_id(struct ofproto_dpif *ofproto); -void ofproto_dpif_free_recirc_id(struct ofproto_dpif *ofproto, uint32_t recirc_id); int ofproto_dpif_add_internal_flow(struct ofproto_dpif *, const struct match *, int priority, + uint16_t idle_timeout, const struct ofpbuf *ofpacts, struct rule **rulep); int ofproto_dpif_delete_internal_flow(struct ofproto_dpif *, struct match *, int priority); - -/* Number of implemented OpenFlow tables. */ -enum { N_TABLES = 255 }; -enum { TBL_INTERNAL = N_TABLES - 1 }; /* Used for internal hidden rules. */ -BUILD_ASSERT_DECL(N_TABLES >= 2 && N_TABLES <= 255); - /* struct rule_dpif has struct rule as it's first member. */ #define RULE_CAST(RULE) ((struct rule *)RULE) +#define GROUP_CAST(GROUP) ((struct ofgroup *)GROUP) + +static inline struct group_dpif* group_dpif_ref(struct group_dpif *group) +{ + if (group) { + ofproto_group_ref(GROUP_CAST(group)); + } + return group; +} + +static inline void group_dpif_unref(struct group_dpif *group) +{ + if (group) { + ofproto_group_unref(GROUP_CAST(group)); + } +} static inline void rule_dpif_ref(struct rule_dpif *rule) { @@ -240,6 +209,15 @@ } } +static inline bool rule_dpif_try_ref(struct rule_dpif *rule) +{ + if (rule) { + return ofproto_rule_try_ref(RULE_CAST(rule)); + } + return false; +} + + static inline void rule_dpif_unref(struct rule_dpif *rule) { if (rule) { @@ -265,4 +243,5 @@ #undef RULE_CAST +bool ovs_native_tunneling_is_on(struct ofproto_dpif *ofproto); #endif /* ofproto-dpif.h */ diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-ipfix.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-ipfix.c --- openvswitch-2.3.1/ofproto/ofproto-dpif-ipfix.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-ipfix.c 2015-06-23 18:46:21.000000000 +0000 @@ -25,13 +25,15 @@ #include "list.h" #include "ofpbuf.h" #include "ofproto.h" +#include "ofproto-dpif.h" +#include "dp-packet.h" #include "packets.h" #include "poll-loop.h" #include "sset.h" #include "util.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ipfix); @@ -41,12 +43,47 @@ /* Cf. IETF RFC 5101 Section 10.3.4. */ #define IPFIX_DEFAULT_COLLECTOR_PORT 4739 +/* The standard layer2SegmentId (ID 351) element is included in vDS to send + * the VxLAN tunnel's VNI. It is 64-bit long, the most significant byte is + * used to indicate the type of tunnel (0x01 = VxLAN, 0x02 = GRE) and the three + * least significant bytes hold the value of the layer 2 overlay network + * segment identifier: a 24-bit VxLAN tunnel's VNI or a 24-bit GRE tunnel's + * TNI. This is not compatible with GRE-64 or STT, as implemented in OVS, as + * their tunnel IDs are 64-bit. + * + * Two new enterprise information elements are defined which are similar to + * laryerSegmentId but support 64-bit IDs: + * tunnelType (ID 891) and tunnelKey (ID 892). + * + * The enum dpif_ipfix_tunnel_type is to declare the types supported in the + * tunnelType element. + * The number of ipfix tunnel types includes two reserverd types: 0x04 and 0x06. + */ +enum dpif_ipfix_tunnel_type { + DPIF_IPFIX_TUNNEL_UNKNOWN = 0x00, + DPIF_IPFIX_TUNNEL_VXLAN = 0x01, + DPIF_IPFIX_TUNNEL_GRE = 0x02, + DPIF_IPFIX_TUNNEL_LISP = 0x03, + DPIF_IPFIX_TUNNEL_STT = 0x04, + DPIF_IPFIX_TUNNEL_IPSEC_GRE = 0x05, + DPIF_IPFIX_TUNNEL_GENEVE = 0x07, + NUM_DPIF_IPFIX_TUNNEL +}; + +struct dpif_ipfix_port { + struct hmap_node hmap_node; /* In struct dpif_ipfix's "tunnel_ports" hmap. */ + struct ofport *ofport; /* To retrieve port stats. */ + odp_port_t odp_port; + enum dpif_ipfix_tunnel_type tunnel_type; + uint8_t tunnel_key_length; +}; + struct dpif_ipfix_exporter { struct collectors *collectors; uint32_t seq_number; time_t last_template_set_time; struct hmap cache_flow_key_map; /* ipfix_flow_cache_entry. */ - struct list cache_flow_start_timestamp_list; /* ipfix_flow_cache_entry. */ + struct ovs_list cache_flow_start_timestamp_list; /* ipfix_flow_cache_entry. */ uint32_t cache_active_timeout; /* In seconds. */ uint32_t cache_max_flows; }; @@ -70,6 +107,9 @@ struct dpif_ipfix { struct dpif_ipfix_bridge_exporter bridge_exporter; struct hmap flow_exporter_map; /* dpif_ipfix_flow_exporter_map_node. */ + struct hmap tunnel_ports; /* Contains "struct dpif_ipfix_port"s. + * It makes tunnel port lookups faster in + * sampling upcalls. */ struct ovs_refcount ref_cnt; }; @@ -121,6 +161,11 @@ IPFIX_PROTO_L4_ICMP, NUM_IPFIX_PROTO_L4 }; +enum ipfix_proto_tunnel { + IPFIX_PROTO_NOT_TUNNELED = 0, + IPFIX_PROTO_TUNNELED, /* Support gre, lisp and vxlan. */ + NUM_IPFIX_PROTO_TUNNEL +}; /* Any Template ID > 255 is usable for Template Records. */ #define IPFIX_TEMPLATE_ID_MIN 256 @@ -134,33 +179,63 @@ BUILD_ASSERT_DECL(sizeof(struct ipfix_template_record_header) == 4); enum ipfix_entity_id { +/* standard IPFIX elements */ #define IPFIX_ENTITY(ENUM, ID, SIZE, NAME) IPFIX_ENTITY_ID_##ENUM = ID, #include "ofproto/ipfix-entities.def" +/* non-standard IPFIX elements */ +#define IPFIX_SET_ENTERPRISE(v) (((v) | 0x8000)) +#define IPFIX_ENTERPRISE_ENTITY(ENUM, ID, SIZE, NAME, ENTERPRISE) \ + IPFIX_ENTITY_ID_##ENUM = IPFIX_SET_ENTERPRISE(ID), +#include "ofproto/ipfix-enterprise-entities.def" }; enum ipfix_entity_size { +/* standard IPFIX elements */ #define IPFIX_ENTITY(ENUM, ID, SIZE, NAME) IPFIX_ENTITY_SIZE_##ENUM = SIZE, #include "ofproto/ipfix-entities.def" +/* non-standard IPFIX elements */ +#define IPFIX_ENTERPRISE_ENTITY(ENUM, ID, SIZE, NAME, ENTERPRISE) \ + IPFIX_ENTITY_SIZE_##ENUM = SIZE, +#include "ofproto/ipfix-enterprise-entities.def" +}; + +enum ipfix_entity_enterprise { +/* standard IPFIX elements */ +#define IPFIX_ENTITY(ENUM, ID, SIZE, NAME) IPFIX_ENTITY_ENTERPRISE_##ENUM = 0, +#include "ofproto/ipfix-entities.def" +/* non-standard IPFIX elements */ +#define IPFIX_ENTERPRISE_ENTITY(ENUM, ID, SIZE, NAME, ENTERPRISE) \ + IPFIX_ENTITY_ENTERPRISE_##ENUM = ENTERPRISE, +#include "ofproto/ipfix-enterprise-entities.def" }; OVS_PACKED( struct ipfix_template_field_specifier { ovs_be16 element_id; /* IPFIX_ENTITY_ID_*. */ - ovs_be16 field_length; /* Length of the field's value, in bytes. */ - /* No Enterprise ID, since only standard element IDs are specified. */ + ovs_be16 field_length; /* Length of the field's value, in bytes. + * For Variable-Length element, it should be 65535. + */ + ovs_be32 enterprise; /* Enterprise number */ }); -BUILD_ASSERT_DECL(sizeof(struct ipfix_template_field_specifier) == 4); +BUILD_ASSERT_DECL(sizeof(struct ipfix_template_field_specifier) == 8); + +/* Cf. IETF RFC 5102 Section 5.11.6. */ +enum ipfix_flow_direction { + INGRESS_FLOW = 0x00, + EGRESS_FLOW = 0x01 +}; /* Part of data record flow key for common metadata and Ethernet entities. */ OVS_PACKED( struct ipfix_data_record_flow_key_common { ovs_be32 observation_point_id; /* OBSERVATION_POINT_ID */ - uint8_t source_mac_address[6]; /* SOURCE_MAC_ADDRESS */ - uint8_t destination_mac_address[6]; /* DESTINATION_MAC_ADDRESS */ + uint8_t flow_direction; /* FLOW_DIRECTION */ + uint8_t source_mac_address[ETH_ADDR_LEN]; /* SOURCE_MAC_ADDRESS */ + uint8_t destination_mac_address[ETH_ADDR_LEN]; /* DESTINATION_MAC_ADDRESS */ ovs_be16 ethernet_type; /* ETHERNET_TYPE */ uint8_t ethernet_header_length; /* ETHERNET_HEADER_LENGTH */ }); -BUILD_ASSERT_DECL(sizeof(struct ipfix_data_record_flow_key_common) == 19); +BUILD_ASSERT_DECL(sizeof(struct ipfix_data_record_flow_key_common) == 20); /* Part of data record flow key for VLAN entities. */ OVS_PACKED( @@ -217,6 +292,33 @@ }); BUILD_ASSERT_DECL(sizeof(struct ipfix_data_record_flow_key_icmp) == 2); +/* For the tunnel type that is on the top of IPSec, the protocol identifier + * of the upper tunnel type is used. + */ +static uint8_t tunnel_protocol[NUM_DPIF_IPFIX_TUNNEL] = { + 0, /* reserved */ + IPPROTO_UDP, /* DPIF_IPFIX_TUNNEL_VXLAN */ + IPPROTO_GRE, /* DPIF_IPFIX_TUNNEL_GRE */ + IPPROTO_UDP, /* DPIF_IPFIX_TUNNEL_LISP*/ + IPPROTO_TCP, /* DPIF_IPFIX_TUNNEL_STT*/ + IPPROTO_GRE, /* DPIF_IPFIX_TUNNEL_IPSEC_GRE */ + 0 , /* reserved */ + IPPROTO_UDP, /* DPIF_IPFIX_TUNNEL_GENEVE*/ +}; + +OVS_PACKED( +struct ipfix_data_record_flow_key_tunnel { + ovs_be32 tunnel_source_ipv4_address; /* TUNNEL_SOURCE_IPV4_ADDRESS */ + ovs_be32 tunnel_destination_ipv4_address; /* TUNNEL_DESTINATION_IPV4_ADDRESS */ + uint8_t tunnel_protocol_identifier; /* TUNNEL_PROTOCOL_IDENTIFIER */ + ovs_be16 tunnel_source_transport_port; /* TUNNEL_SOURCE_TRANSPORT_PORT */ + ovs_be16 tunnel_destination_transport_port; /* TUNNEL_DESTINATION_TRANSPORT_PORT */ + uint8_t tunnel_type; /* TUNNEL_TYPE */ + uint8_t tunnel_key_length; /* length of TUNNEL_KEY */ + uint8_t tunnel_key[]; /* data of TUNNEL_KEY */ +}); +BUILD_ASSERT_DECL(sizeof(struct ipfix_data_record_flow_key_tunnel) == 15); + /* Cf. IETF RFC 5102 Section 5.11.3. */ enum ipfix_flow_end_reason { IDLE_TIMEOUT = 0x01, @@ -247,6 +349,15 @@ }); BUILD_ASSERT_DECL(sizeof(struct ipfix_data_record_aggregated_ip) == 32); +/* + * support tunnel key for: + * VxLAN: 24-bit VIN, + * GRE: 32- or 64-bit key, + * LISP: 24-bit instance ID + * STT: 64-bit key + */ +#define MAX_TUNNEL_KEY_LEN 8 + #define MAX_FLOW_KEY_LEN \ (sizeof(struct ipfix_data_record_flow_key_common) \ + sizeof(struct ipfix_data_record_flow_key_vlan) \ @@ -254,7 +365,9 @@ + MAX(sizeof(struct ipfix_data_record_flow_key_ipv4), \ sizeof(struct ipfix_data_record_flow_key_ipv6)) \ + MAX(sizeof(struct ipfix_data_record_flow_key_icmp), \ - sizeof(struct ipfix_data_record_flow_key_transport))) + sizeof(struct ipfix_data_record_flow_key_transport)) \ + + sizeof(struct ipfix_data_record_flow_key_tunnel) \ + + MAX_TUNNEL_KEY_LEN) #define MAX_DATA_RECORD_LEN \ (MAX_FLOW_KEY_LEN \ @@ -268,7 +381,7 @@ (sizeof(struct ipfix_set_header) \ + MAX_DATA_RECORD_LEN) -/* Max length of an IPFIX message. Arbitrarily set to accomodate low +/* Max length of an IPFIX message. Arbitrarily set to accommodate low * MTU. */ #define MAX_MESSAGE_LEN 1024 @@ -285,7 +398,7 @@ /* Flow cache entry. */ struct ipfix_flow_cache_entry { struct hmap_node flow_key_map_node; - struct list cache_flow_start_timestamp_list_node; + struct ovs_list cache_flow_start_timestamp_list_node; struct ipfix_flow_key flow_key; /* Common aggregated elements. */ uint64_t flow_start_timestamp_usec; @@ -315,6 +428,9 @@ && a->sampling_rate == b->sampling_rate && a->cache_active_timeout == b->cache_active_timeout && a->cache_max_flows == b->cache_max_flows + && a->enable_tunnel_sampling == b->enable_tunnel_sampling + && a->enable_input_sampling == b->enable_input_sampling + && a->enable_output_sampling == b->enable_output_sampling && sset_equals(&a->targets, &b->targets)); } @@ -422,6 +538,114 @@ return true; } +static struct dpif_ipfix_port * +dpif_ipfix_find_port(const struct dpif_ipfix *di, + odp_port_t odp_port) OVS_REQUIRES(mutex) +{ + struct dpif_ipfix_port *dip; + + HMAP_FOR_EACH_IN_BUCKET (dip, hmap_node, hash_odp_port(odp_port), + &di->tunnel_ports) { + if (dip->odp_port == odp_port) { + return dip; + } + } + return NULL; +} + +static void +dpif_ipfix_del_port(struct dpif_ipfix *di, + struct dpif_ipfix_port *dip) + OVS_REQUIRES(mutex) +{ + hmap_remove(&di->tunnel_ports, &dip->hmap_node); + free(dip); +} + +void +dpif_ipfix_add_tunnel_port(struct dpif_ipfix *di, struct ofport *ofport, + odp_port_t odp_port) OVS_EXCLUDED(mutex) +{ + struct dpif_ipfix_port *dip; + const char *type; + + ovs_mutex_lock(&mutex); + dip = dpif_ipfix_find_port(di, odp_port); + if (dip) { + dpif_ipfix_del_port(di, dip); + } + + type = netdev_get_type(ofport->netdev); + if (type == NULL) { + goto out; + } + + /* Add to table of tunnel ports. */ + dip = xmalloc(sizeof *dip); + dip->ofport = ofport; + dip->odp_port = odp_port; + if (strcmp(type, "gre") == 0) { + /* 32-bit key gre */ + dip->tunnel_type = DPIF_IPFIX_TUNNEL_GRE; + dip->tunnel_key_length = 4; + } else if (strcmp(type, "gre64") == 0) { + /* 64-bit key gre */ + dip->tunnel_type = DPIF_IPFIX_TUNNEL_GRE; + dip->tunnel_key_length = 8; + } else if (strcmp(type, "ipsec_gre") == 0) { + /* 32-bit key ipsec_gre */ + dip->tunnel_type = DPIF_IPFIX_TUNNEL_IPSEC_GRE; + dip->tunnel_key_length = 4; + } else if (strcmp(type, "ipsec_gre64") == 0) { + /* 64-bit key ipsec_gre */ + dip->tunnel_type = DPIF_IPFIX_TUNNEL_IPSEC_GRE; + dip->tunnel_key_length = 8; + } else if (strcmp(type, "vxlan") == 0) { + dip->tunnel_type = DPIF_IPFIX_TUNNEL_VXLAN; + dip->tunnel_key_length = 3; + } else if (strcmp(type, "lisp") == 0) { + dip->tunnel_type = DPIF_IPFIX_TUNNEL_LISP; + dip->tunnel_key_length = 3; + } else if (strcmp(type, "geneve") == 0) { + dip->tunnel_type = DPIF_IPFIX_TUNNEL_GENEVE; + dip->tunnel_key_length = 3; + } else if (strcmp(type, "stt") == 0) { + dip->tunnel_type = DPIF_IPFIX_TUNNEL_STT; + dip->tunnel_key_length = 8; + } else { + free(dip); + goto out; + } + hmap_insert(&di->tunnel_ports, &dip->hmap_node, hash_odp_port(odp_port)); + +out: + ovs_mutex_unlock(&mutex); +} + +void +dpif_ipfix_del_tunnel_port(struct dpif_ipfix *di, odp_port_t odp_port) + OVS_EXCLUDED(mutex) +{ + struct dpif_ipfix_port *dip; + ovs_mutex_lock(&mutex); + dip = dpif_ipfix_find_port(di, odp_port); + if (dip) { + dpif_ipfix_del_port(di, dip); + } + ovs_mutex_unlock(&mutex); +} + +bool +dpif_ipfix_get_tunnel_port(const struct dpif_ipfix *di, odp_port_t odp_port) + OVS_EXCLUDED(mutex) +{ + struct dpif_ipfix_port *dip; + ovs_mutex_lock(&mutex); + dip = dpif_ipfix_find_port(di, odp_port); + ovs_mutex_unlock(&mutex); + return dip != NULL; +} + static void dpif_ipfix_bridge_exporter_init(struct dpif_ipfix_bridge_exporter *exporter) { @@ -652,6 +876,7 @@ di = xzalloc(sizeof *di); dpif_ipfix_bridge_exporter_init(&di->bridge_exporter); hmap_init(&di->flow_exporter_map); + hmap_init(&di->tunnel_ports); ovs_refcount_init(&di->ref_cnt); return di; } @@ -677,10 +902,50 @@ return ret; } +bool +dpif_ipfix_get_bridge_exporter_input_sampling(const struct dpif_ipfix *di) + OVS_EXCLUDED(mutex) +{ + bool ret = true; + ovs_mutex_lock(&mutex); + if (di->bridge_exporter.options) { + ret = di->bridge_exporter.options->enable_input_sampling; + } + ovs_mutex_unlock(&mutex); + return ret; +} + +bool +dpif_ipfix_get_bridge_exporter_output_sampling(const struct dpif_ipfix *di) + OVS_EXCLUDED(mutex) +{ + bool ret = true; + ovs_mutex_lock(&mutex); + if (di->bridge_exporter.options) { + ret = di->bridge_exporter.options->enable_output_sampling; + } + ovs_mutex_unlock(&mutex); + return ret; +} + +bool +dpif_ipfix_get_bridge_exporter_tunnel_sampling(const struct dpif_ipfix *di) + OVS_EXCLUDED(mutex) +{ + bool ret = false; + ovs_mutex_lock(&mutex); + if (di->bridge_exporter.options) { + ret = di->bridge_exporter.options->enable_tunnel_sampling; + } + ovs_mutex_unlock(&mutex); + return ret; +} + static void dpif_ipfix_clear(struct dpif_ipfix *di) OVS_REQUIRES(mutex) { struct dpif_ipfix_flow_exporter_map_node *exp_node, *exp_next; + struct dpif_ipfix_port *dip, *next; dpif_ipfix_bridge_exporter_clear(&di->bridge_exporter); @@ -689,16 +954,21 @@ dpif_ipfix_flow_exporter_destroy(&exp_node->exporter); free(exp_node); } + + HMAP_FOR_EACH_SAFE (dip, next, hmap_node, &di->tunnel_ports) { + dpif_ipfix_del_port(di, dip); + } } void dpif_ipfix_unref(struct dpif_ipfix *di) OVS_EXCLUDED(mutex) { - if (di && ovs_refcount_unref(&di->ref_cnt) == 1) { + if (di && ovs_refcount_unref_relaxed(&di->ref_cnt) == 1) { ovs_mutex_lock(&mutex); dpif_ipfix_clear(di); dpif_ipfix_bridge_exporter_destroy(&di->bridge_exporter); hmap_destroy(&di->flow_exporter_map); + hmap_destroy(&di->tunnel_ports); free(di); ovs_mutex_unlock(&mutex); } @@ -706,11 +976,11 @@ static void ipfix_init_header(uint32_t export_time_sec, uint32_t seq_number, - uint32_t obs_domain_id, struct ofpbuf *msg) + uint32_t obs_domain_id, struct dp_packet *msg) { struct ipfix_header *hdr; - hdr = ofpbuf_put_zeros(msg, sizeof *hdr); + hdr = dp_packet_put_zeros(msg, sizeof *hdr); hdr->version = htons(IPFIX_VERSION); hdr->length = htons(sizeof *hdr); /* Updated in ipfix_send_msg. */ hdr->export_time = htonl(export_time_sec); @@ -719,56 +989,78 @@ } static void -ipfix_send_msg(const struct collectors *collectors, struct ofpbuf *msg) +ipfix_send_msg(const struct collectors *collectors, struct dp_packet *msg) { struct ipfix_header *hdr; /* Adjust the length in the header. */ - hdr = ofpbuf_data(msg); - hdr->length = htons(ofpbuf_size(msg)); + hdr = dp_packet_data(msg); + hdr->length = htons(dp_packet_size(msg)); - collectors_send(collectors, ofpbuf_data(msg), ofpbuf_size(msg)); - ofpbuf_set_size(msg, 0); + collectors_send(collectors, dp_packet_data(msg), dp_packet_size(msg)); + dp_packet_set_size(msg, 0); } static uint16_t ipfix_get_template_id(enum ipfix_proto_l2 l2, enum ipfix_proto_l3 l3, - enum ipfix_proto_l4 l4) + enum ipfix_proto_l4 l4, enum ipfix_proto_tunnel tunnel) { uint16_t template_id; template_id = l2; template_id = template_id * NUM_IPFIX_PROTO_L3 + l3; template_id = template_id * NUM_IPFIX_PROTO_L4 + l4; + template_id = template_id * NUM_IPFIX_PROTO_TUNNEL + tunnel; return IPFIX_TEMPLATE_ID_MIN + template_id; } static void ipfix_define_template_entity(enum ipfix_entity_id id, - enum ipfix_entity_size size, struct ofpbuf *msg) + enum ipfix_entity_size size, + enum ipfix_entity_enterprise enterprise, + struct dp_packet *msg) { struct ipfix_template_field_specifier *field; + size_t field_size; - field = ofpbuf_put_zeros(msg, sizeof *field); + if (enterprise) { + field_size = sizeof *field; + } else { + /* No enterprise number */ + field_size = sizeof *field - sizeof(ovs_be32); + } + field = dp_packet_put_zeros(msg, field_size); field->element_id = htons(id); - field->field_length = htons(size); + if (size) { + field->field_length = htons(size); + } else { + /* RFC 5101, Section 7. Variable-Length Information Element */ + field->field_length = OVS_BE16_MAX; + } + if (enterprise) { + field->enterprise = htonl(enterprise); + } + } static uint16_t ipfix_define_template_fields(enum ipfix_proto_l2 l2, enum ipfix_proto_l3 l3, - enum ipfix_proto_l4 l4, struct ofpbuf *msg) + enum ipfix_proto_l4 l4, enum ipfix_proto_tunnel tunnel, + struct dp_packet *msg) { uint16_t count = 0; #define DEF(ID) \ { \ ipfix_define_template_entity(IPFIX_ENTITY_ID_##ID, \ - IPFIX_ENTITY_SIZE_##ID, msg); \ + IPFIX_ENTITY_SIZE_##ID, \ + IPFIX_ENTITY_ENTERPRISE_##ID, msg); \ count++; \ } /* 1. Flow key. */ DEF(OBSERVATION_POINT_ID); + DEF(FLOW_DIRECTION); /* Common Ethernet entities. */ DEF(SOURCE_MAC_ADDRESS); @@ -814,6 +1106,16 @@ } } + if (tunnel != IPFIX_PROTO_NOT_TUNNELED) { + DEF(TUNNEL_SOURCE_IPV4_ADDRESS); + DEF(TUNNEL_DESTINATION_IPV4_ADDRESS); + DEF(TUNNEL_PROTOCOL_IDENTIFIER); + DEF(TUNNEL_SOURCE_TRANSPORT_PORT); + DEF(TUNNEL_DESTINATION_TRANSPORT_PORT); + DEF(TUNNEL_TYPE); + DEF(TUNNEL_KEY); + } + /* 2. Flow aggregated data. */ DEF(FLOW_START_DELTA_MICROSECONDS); @@ -829,35 +1131,61 @@ DEF(MAXIMUM_IP_TOTAL_LENGTH); } + #undef DEF return count; } static void -ipfix_send_template_msg(struct dpif_ipfix_exporter *exporter, - uint32_t export_time_sec, uint32_t obs_domain_id) +ipfix_init_template_msg(void *msg_stub, uint32_t export_time_sec, + uint32_t seq_number, uint32_t obs_domain_id, + struct dp_packet *msg, size_t *set_hdr_offset) +{ + struct ipfix_set_header *set_hdr; + + dp_packet_use_stub(msg, msg_stub, sizeof msg_stub); + + ipfix_init_header(export_time_sec, seq_number, obs_domain_id, msg); + *set_hdr_offset = dp_packet_size(msg); + + /* Add a Template Set. */ + set_hdr = dp_packet_put_zeros(msg, sizeof *set_hdr); + set_hdr->set_id = htons(IPFIX_SET_ID_TEMPLATE); +} + +static void +ipfix_send_template_msg(const struct collectors *collectors, + struct dp_packet *msg, size_t set_hdr_offset) +{ + struct ipfix_set_header *set_hdr; + + /* Send template message. */ + set_hdr = (struct ipfix_set_header*) + ((uint8_t*)dp_packet_data(msg) + set_hdr_offset); + set_hdr->length = htons(dp_packet_size(msg) - set_hdr_offset); + + ipfix_send_msg(collectors, msg); + + dp_packet_uninit(msg); +} + +static void +ipfix_send_template_msgs(struct dpif_ipfix_exporter *exporter, + uint32_t export_time_sec, uint32_t obs_domain_id) { uint64_t msg_stub[DIV_ROUND_UP(MAX_MESSAGE_LEN, 8)]; - struct ofpbuf msg; + struct dp_packet msg; size_t set_hdr_offset, tmpl_hdr_offset; - struct ipfix_set_header *set_hdr; struct ipfix_template_record_header *tmpl_hdr; uint16_t field_count; enum ipfix_proto_l2 l2; enum ipfix_proto_l3 l3; enum ipfix_proto_l4 l4; + enum ipfix_proto_tunnel tunnel; - ofpbuf_use_stub(&msg, msg_stub, sizeof msg_stub); - - ipfix_init_header(export_time_sec, exporter->seq_number, obs_domain_id, - &msg); - set_hdr_offset = ofpbuf_size(&msg); - - /* Add a Template Set. */ - set_hdr = ofpbuf_put_zeros(&msg, sizeof *set_hdr); - set_hdr->set_id = htons(IPFIX_SET_ID_TEMPLATE); - + ipfix_init_template_msg(msg_stub, export_time_sec, exporter->seq_number, + obs_domain_id, &msg, &set_hdr_offset); /* Define one template for each possible combination of * protocols. */ for (l2 = 0; l2 < NUM_IPFIX_PROTO_L2; l2++) { @@ -867,27 +1195,44 @@ l4 != IPFIX_PROTO_L4_UNKNOWN) { continue; } - tmpl_hdr_offset = ofpbuf_size(&msg); - tmpl_hdr = ofpbuf_put_zeros(&msg, sizeof *tmpl_hdr); - tmpl_hdr->template_id = htons( - ipfix_get_template_id(l2, l3, l4)); - field_count = ipfix_define_template_fields(l2, l3, l4, &msg); - tmpl_hdr = (struct ipfix_template_record_header*) - ((uint8_t*)ofpbuf_data(&msg) + tmpl_hdr_offset); - tmpl_hdr->field_count = htons(field_count); + for (tunnel = 0; tunnel < NUM_IPFIX_PROTO_TUNNEL; tunnel++) { + /* When the size of the template packet reaches + * MAX_MESSAGE_LEN(1024), send it out. + * And then reinitialize the msg to construct a new + * packet for the following templates. + */ + if (dp_packet_size(&msg) >= MAX_MESSAGE_LEN) { + /* Send template message. */ + ipfix_send_template_msg(exporter->collectors, + &msg, set_hdr_offset); + + /* Reinitialize the template msg. */ + ipfix_init_template_msg(msg_stub, export_time_sec, + exporter->seq_number, + obs_domain_id, &msg, + &set_hdr_offset); + } + + tmpl_hdr_offset = dp_packet_size(&msg); + tmpl_hdr = dp_packet_put_zeros(&msg, sizeof *tmpl_hdr); + tmpl_hdr->template_id = htons( + ipfix_get_template_id(l2, l3, l4, tunnel)); + field_count = + ipfix_define_template_fields(l2, l3, l4, tunnel, &msg); + tmpl_hdr = (struct ipfix_template_record_header*) + ((uint8_t*)dp_packet_data(&msg) + tmpl_hdr_offset); + tmpl_hdr->field_count = htons(field_count); + } } } } - set_hdr = (struct ipfix_set_header*)((uint8_t*)ofpbuf_data(&msg) + set_hdr_offset); - set_hdr->length = htons(ofpbuf_size(&msg) - set_hdr_offset); + /* Send template message. */ + ipfix_send_template_msg(exporter->collectors, &msg, set_hdr_offset); /* XXX: Add Options Template Sets, at least to define a Flow Keys * Option Template. */ - ipfix_send_msg(exporter->collectors, &msg); - - ofpbuf_uninit(&msg); } static inline uint32_t @@ -1019,21 +1364,24 @@ static void ipfix_cache_entry_init(struct ipfix_flow_cache_entry *entry, - struct ofpbuf *packet, const struct flow *flow, + const struct dp_packet *packet, const struct flow *flow, uint64_t packet_delta_count, uint32_t obs_domain_id, - uint32_t obs_point_id) + uint32_t obs_point_id, odp_port_t output_odp_port, + const struct dpif_ipfix_port *tunnel_port, + const struct flow_tnl *tunnel_key) { struct ipfix_flow_key *flow_key; - struct ofpbuf msg; + struct dp_packet msg; enum ipfix_proto_l2 l2; enum ipfix_proto_l3 l3; enum ipfix_proto_l4 l4; + enum ipfix_proto_tunnel tunnel = IPFIX_PROTO_NOT_TUNNELED; uint8_t ethernet_header_length; uint16_t ethernet_total_length; flow_key = &entry->flow_key; - ofpbuf_use_stack(&msg, flow_key->flow_key_msg_part, - sizeof flow_key->flow_key_msg_part); + dp_packet_use_stub(&msg, flow_key->flow_key_msg_part, + sizeof flow_key->flow_key_msg_part); /* Choose the right template ID matching the protocols in the * sampled packet. */ @@ -1075,8 +1423,12 @@ l4 = IPFIX_PROTO_L4_UNKNOWN; } + if (tunnel_port && tunnel_key) { + tunnel = IPFIX_PROTO_TUNNELED; + } + flow_key->obs_domain_id = obs_domain_id; - flow_key->template_id = ipfix_get_template_id(l2, l3, l4); + flow_key->template_id = ipfix_get_template_id(l2, l3, l4, tunnel); /* The fields defined in the ipfix_data_record_* structs and sent * below must match exactly the templates defined in @@ -1084,14 +1436,16 @@ ethernet_header_length = (l2 == IPFIX_PROTO_L2_VLAN) ? VLAN_ETH_HEADER_LEN : ETH_HEADER_LEN; - ethernet_total_length = ofpbuf_size(packet); + ethernet_total_length = dp_packet_size(packet); /* Common Ethernet entities. */ { struct ipfix_data_record_flow_key_common *data_common; - data_common = ofpbuf_put_zeros(&msg, sizeof *data_common); + data_common = dp_packet_put_zeros(&msg, sizeof *data_common); data_common->observation_point_id = htonl(obs_point_id); + data_common->flow_direction = + (output_odp_port == ODPP_NONE) ? INGRESS_FLOW : EGRESS_FLOW; memcpy(data_common->source_mac_address, flow->dl_src, sizeof flow->dl_src); memcpy(data_common->destination_mac_address, flow->dl_dst, @@ -1105,7 +1459,7 @@ uint16_t vlan_id = vlan_tci_to_vid(flow->vlan_tci); uint8_t priority = vlan_tci_to_pcp(flow->vlan_tci); - data_vlan = ofpbuf_put_zeros(&msg, sizeof *data_vlan); + data_vlan = dp_packet_put_zeros(&msg, sizeof *data_vlan); data_vlan->vlan_id = htons(vlan_id); data_vlan->dot1q_vlan_id = htons(vlan_id); data_vlan->dot1q_priority = priority; @@ -1114,7 +1468,7 @@ if (l3 != IPFIX_PROTO_L3_UNKNOWN) { struct ipfix_data_record_flow_key_ip *data_ip; - data_ip = ofpbuf_put_zeros(&msg, sizeof *data_ip); + data_ip = dp_packet_put_zeros(&msg, sizeof *data_ip); data_ip->ip_version = (l3 == IPFIX_PROTO_L3_IPV4) ? 4 : 6; data_ip->ip_ttl = flow->nw_ttl; data_ip->protocol_identifier = flow->nw_proto; @@ -1125,13 +1479,13 @@ if (l3 == IPFIX_PROTO_L3_IPV4) { struct ipfix_data_record_flow_key_ipv4 *data_ipv4; - data_ipv4 = ofpbuf_put_zeros(&msg, sizeof *data_ipv4); + data_ipv4 = dp_packet_put_zeros(&msg, sizeof *data_ipv4); data_ipv4->source_ipv4_address = flow->nw_src; data_ipv4->destination_ipv4_address = flow->nw_dst; } else { /* l3 == IPFIX_PROTO_L3_IPV6 */ struct ipfix_data_record_flow_key_ipv6 *data_ipv6; - data_ipv6 = ofpbuf_put_zeros(&msg, sizeof *data_ipv6); + data_ipv6 = dp_packet_put_zeros(&msg, sizeof *data_ipv6); memcpy(data_ipv6->source_ipv6_address, &flow->ipv6_src, sizeof flow->ipv6_src); memcpy(data_ipv6->destination_ipv6_address, &flow->ipv6_dst, @@ -1143,18 +1497,48 @@ if (l4 == IPFIX_PROTO_L4_TCP_UDP_SCTP) { struct ipfix_data_record_flow_key_transport *data_transport; - data_transport = ofpbuf_put_zeros(&msg, sizeof *data_transport); + data_transport = dp_packet_put_zeros(&msg, sizeof *data_transport); data_transport->source_transport_port = flow->tp_src; data_transport->destination_transport_port = flow->tp_dst; } else if (l4 == IPFIX_PROTO_L4_ICMP) { struct ipfix_data_record_flow_key_icmp *data_icmp; - data_icmp = ofpbuf_put_zeros(&msg, sizeof *data_icmp); + data_icmp = dp_packet_put_zeros(&msg, sizeof *data_icmp); data_icmp->icmp_type = ntohs(flow->tp_src) & 0xff; data_icmp->icmp_code = ntohs(flow->tp_dst) & 0xff; } - flow_key->flow_key_msg_part_size = ofpbuf_size(&msg); + if (tunnel == IPFIX_PROTO_TUNNELED) { + struct ipfix_data_record_flow_key_tunnel *data_tunnel; + const uint8_t *tun_id; + + data_tunnel = dp_packet_put_zeros(&msg, sizeof *data_tunnel + + tunnel_port->tunnel_key_length); + data_tunnel->tunnel_source_ipv4_address = tunnel_key->ip_src; + data_tunnel->tunnel_destination_ipv4_address = tunnel_key->ip_dst; + /* The tunnel_protocol_identifier is from tunnel_proto array, which + * contains protocol_identifiers of each tunnel type. + * For the tunnel type on the top of IPSec, which uses the protocol + * identifier of the upper tunnel type is used, the tcp_src and tcp_dst + * are decided based on the protocol identifiers. + * E.g: + * The protocol identifier of DPIF_IPFIX_TUNNEL_IPSEC_GRE is IPPROTO_GRE, + * and both tp_src and tp_dst are zero. + */ + data_tunnel->tunnel_protocol_identifier = + tunnel_protocol[tunnel_port->tunnel_type]; + data_tunnel->tunnel_source_transport_port = tunnel_key->tp_src; + data_tunnel->tunnel_destination_transport_port = tunnel_key->tp_dst; + data_tunnel->tunnel_type = tunnel_port->tunnel_type; + data_tunnel->tunnel_key_length = tunnel_port->tunnel_key_length; + /* tun_id is in network order, and tunnel key is in low bits. */ + tun_id = (const uint8_t *) &tunnel_key->tun_id; + memcpy(data_tunnel->tunnel_key, + &tun_id[8 - tunnel_port->tunnel_key_length], + tunnel_port->tunnel_key_length); + } + + flow_key->flow_key_msg_part_size = dp_packet_size(&msg); { struct timeval now; @@ -1200,20 +1584,20 @@ ipfix_put_data_set(uint32_t export_time_sec, struct ipfix_flow_cache_entry *entry, enum ipfix_flow_end_reason flow_end_reason, - struct ofpbuf *msg) + struct dp_packet *msg) { size_t set_hdr_offset; struct ipfix_set_header *set_hdr; - set_hdr_offset = ofpbuf_size(msg); + set_hdr_offset = dp_packet_size(msg); /* Put a Data Set. */ - set_hdr = ofpbuf_put_zeros(msg, sizeof *set_hdr); + set_hdr = dp_packet_put_zeros(msg, sizeof *set_hdr); set_hdr->set_id = htons(entry->flow_key.template_id); /* Copy the flow key part of the data record. */ - ofpbuf_put(msg, entry->flow_key.flow_key_msg_part, + dp_packet_put(msg, entry->flow_key.flow_key_msg_part, entry->flow_key.flow_key_msg_part_size); /* Put the non-key part of the data record. */ @@ -1231,7 +1615,7 @@ flow_end_delta_usec = export_time_usec - entry->flow_end_timestamp_usec; - data_aggregated_common = ofpbuf_put_zeros( + data_aggregated_common = dp_packet_put_zeros( msg, sizeof *data_aggregated_common); data_aggregated_common->flow_start_delta_microseconds = htonl( flow_start_delta_usec); @@ -1247,7 +1631,7 @@ if (entry->octet_delta_sum_of_squares) { /* IP packet. */ struct ipfix_data_record_aggregated_ip *data_aggregated_ip; - data_aggregated_ip = ofpbuf_put_zeros( + data_aggregated_ip = dp_packet_put_zeros( msg, sizeof *data_aggregated_ip); data_aggregated_ip->octet_delta_count = htonll( entry->octet_delta_count); @@ -1259,8 +1643,8 @@ entry->maximum_ip_total_length); } - set_hdr = (struct ipfix_set_header*)((uint8_t*)ofpbuf_data(msg) + set_hdr_offset); - set_hdr->length = htons(ofpbuf_size(msg) - set_hdr_offset); + set_hdr = (struct ipfix_set_header*)((uint8_t*)dp_packet_data(msg) + set_hdr_offset); + set_hdr->length = htons(dp_packet_size(msg) - set_hdr_offset); } /* Send an IPFIX message with a single data record. */ @@ -1271,51 +1655,72 @@ enum ipfix_flow_end_reason flow_end_reason) { uint64_t msg_stub[DIV_ROUND_UP(MAX_MESSAGE_LEN, 8)]; - struct ofpbuf msg; - ofpbuf_use_stub(&msg, msg_stub, sizeof msg_stub); + struct dp_packet msg; + dp_packet_use_stub(&msg, msg_stub, sizeof msg_stub); ipfix_init_header(export_time_sec, exporter->seq_number++, entry->flow_key.obs_domain_id, &msg); ipfix_put_data_set(export_time_sec, entry, flow_end_reason, &msg); ipfix_send_msg(exporter->collectors, &msg); - ofpbuf_uninit(&msg); + dp_packet_uninit(&msg); } static void dpif_ipfix_sample(struct dpif_ipfix_exporter *exporter, - struct ofpbuf *packet, const struct flow *flow, + const struct dp_packet *packet, const struct flow *flow, uint64_t packet_delta_count, uint32_t obs_domain_id, - uint32_t obs_point_id) + uint32_t obs_point_id, odp_port_t output_odp_port, + const struct dpif_ipfix_port *tunnel_port, + const struct flow_tnl *tunnel_key) { struct ipfix_flow_cache_entry *entry; /* Create a flow cache entry from the sample. */ entry = xmalloc(sizeof *entry); ipfix_cache_entry_init(entry, packet, flow, packet_delta_count, - obs_domain_id, obs_point_id); + obs_domain_id, obs_point_id, + output_odp_port, tunnel_port, tunnel_key); ipfix_cache_update(exporter, entry); } void -dpif_ipfix_bridge_sample(struct dpif_ipfix *di, struct ofpbuf *packet, - const struct flow *flow) OVS_EXCLUDED(mutex) +dpif_ipfix_bridge_sample(struct dpif_ipfix *di, const struct dp_packet *packet, + const struct flow *flow, + odp_port_t input_odp_port, odp_port_t output_odp_port, + const struct flow_tnl *output_tunnel_key) + OVS_EXCLUDED(mutex) { uint64_t packet_delta_count; + const struct flow_tnl *tunnel_key = NULL; + struct dpif_ipfix_port * tunnel_port = NULL; ovs_mutex_lock(&mutex); /* Use the sampling probability as an approximation of the number * of matched packets. */ packet_delta_count = UINT32_MAX / di->bridge_exporter.probability; + if (di->bridge_exporter.options->enable_tunnel_sampling) { + if (output_odp_port == ODPP_NONE && flow->tunnel.ip_dst) { + /* Input tunnel. */ + tunnel_key = &flow->tunnel; + tunnel_port = dpif_ipfix_find_port(di, input_odp_port); + } + if (output_odp_port != ODPP_NONE && output_tunnel_key) { + /* Output tunnel, output_tunnel_key must be valid. */ + tunnel_key = output_tunnel_key; + tunnel_port = dpif_ipfix_find_port(di, output_odp_port); + } + } dpif_ipfix_sample(&di->bridge_exporter.exporter, packet, flow, packet_delta_count, di->bridge_exporter.options->obs_domain_id, - di->bridge_exporter.options->obs_point_id); + di->bridge_exporter.options->obs_point_id, + output_odp_port, tunnel_port, tunnel_key); ovs_mutex_unlock(&mutex); } void -dpif_ipfix_flow_sample(struct dpif_ipfix *di, struct ofpbuf *packet, +dpif_ipfix_flow_sample(struct dpif_ipfix *di, const struct dp_packet *packet, const struct flow *flow, uint32_t collector_set_id, uint16_t probability, uint32_t obs_domain_id, uint32_t obs_point_id) OVS_EXCLUDED(mutex) @@ -1329,7 +1734,8 @@ node = dpif_ipfix_find_flow_exporter_map_node(di, collector_set_id); if (node) { dpif_ipfix_sample(&node->exporter.exporter, packet, flow, - packet_delta_count, obs_domain_id, obs_point_id); + packet_delta_count, obs_domain_id, obs_point_id, + ODPP_NONE, NULL, NULL); } ovs_mutex_unlock(&mutex); } @@ -1374,8 +1780,8 @@ if (!template_msg_sent && (exporter->last_template_set_time + IPFIX_TEMPLATE_INTERVAL) <= export_time_sec) { - ipfix_send_template_msg(exporter, export_time_sec, - entry->flow_key.obs_domain_id); + ipfix_send_template_msgs(exporter, export_time_sec, + entry->flow_key.obs_domain_id); exporter->last_template_set_time = export_time_sec; template_msg_sent = true; } diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-ipfix.h openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-ipfix.h --- openvswitch-2.3.1/ofproto/ofproto-dpif-ipfix.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-ipfix.h 2015-06-23 18:46:21.000000000 +0000 @@ -19,25 +19,37 @@ #include #include +#include +#include "lib/odp-util.h" struct flow; -struct ofpbuf; +struct dp_packet; struct ofproto_ipfix_bridge_exporter_options; struct ofproto_ipfix_flow_exporter_options; +struct flow_tnl; +struct ofport; struct dpif_ipfix *dpif_ipfix_create(void); struct dpif_ipfix *dpif_ipfix_ref(const struct dpif_ipfix *); void dpif_ipfix_unref(struct dpif_ipfix *); +void dpif_ipfix_add_tunnel_port(struct dpif_ipfix *, struct ofport *, odp_port_t); +void dpif_ipfix_del_tunnel_port(struct dpif_ipfix *, odp_port_t); + uint32_t dpif_ipfix_get_bridge_exporter_probability(const struct dpif_ipfix *); +bool dpif_ipfix_get_bridge_exporter_tunnel_sampling(const struct dpif_ipfix *); +bool dpif_ipfix_get_bridge_exporter_input_sampling(const struct dpif_ipfix *); +bool dpif_ipfix_get_bridge_exporter_output_sampling(const struct dpif_ipfix *); +bool dpif_ipfix_get_tunnel_port(const struct dpif_ipfix *, odp_port_t); void dpif_ipfix_set_options( struct dpif_ipfix *, const struct ofproto_ipfix_bridge_exporter_options *, const struct ofproto_ipfix_flow_exporter_options *, size_t); -void dpif_ipfix_bridge_sample(struct dpif_ipfix *, struct ofpbuf *, - const struct flow *); -void dpif_ipfix_flow_sample(struct dpif_ipfix *, struct ofpbuf *, +void dpif_ipfix_bridge_sample(struct dpif_ipfix *, const struct dp_packet *, + const struct flow *, + odp_port_t, odp_port_t, const struct flow_tnl *); +void dpif_ipfix_flow_sample(struct dpif_ipfix *, const struct dp_packet *, const struct flow *, uint32_t, uint16_t, uint32_t, uint32_t); diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-mirror.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-mirror.c --- openvswitch-2.3.1/ofproto/ofproto-dpif-mirror.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-mirror.c 2015-06-23 18:46:21.000000000 +0000 @@ -22,7 +22,7 @@ #include "hmapx.h" #include "ofproto.h" #include "vlan-bitmap.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ofproto_dpif_mirror); diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-monitor.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-monitor.c --- openvswitch-2.3.1/ofproto/ofproto-dpif-monitor.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-monitor.c 2015-06-23 18:46:21.000000000 +0000 @@ -21,6 +21,7 @@ #include "bfd.h" #include "cfm.h" +#include "dp-packet.h" #include "guarded-list.h" #include "hash.h" #include "heap.h" @@ -28,12 +29,13 @@ #include "latch.h" #include "ofpbuf.h" #include "ofproto-dpif.h" +#include "ovs-lldp.h" #include "ovs-thread.h" #include "poll-loop.h" #include "seq.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ofproto_dpif_monitor); @@ -42,7 +44,7 @@ /* Converts the heap priority to time in millisecond. */ #define PRIO_TO_MSEC(PRIO) (LLONG_MAX - (PRIO)) -/* Monitored port. It owns references to ofport, bfd, cfm structs. */ +/* Monitored port. It owns references to ofport, bfd, cfm, and lldp structs. */ struct mport { struct hmap_node hmap_node; /* In monitor_hmap. */ struct heap_node heap_node; /* In monitor_heap. */ @@ -50,6 +52,7 @@ struct cfm *cfm; /* Reference to cfm. */ struct bfd *bfd; /* Reference to bfd. */ + struct lldp *lldp; /* Reference to lldp. */ uint8_t hw_addr[OFP_ETH_ALEN]; /* Hardware address. */ }; @@ -57,7 +60,7 @@ * 'ofport_dpif'. Note, the pointed object is not protected, so * users should always use the mport_find() to convert it to 'mport'. */ struct send_soon_entry { - struct list list_node; /* In send_soon. */ + struct ovs_list list_node; /* In send_soon. */ const struct ofport_dpif *ofport; }; @@ -69,7 +72,7 @@ /* guarded-list for storing the mports that need to send bfd/cfm control * packet soon. */ -static struct guarded_list send_soon = GUARDED_LIST_INITIALIZER(&send_soon); +static struct guarded_list send_soon = GUARDED_OVS_LIST_INITIALIZER(&send_soon); /* The monitor thread id. */ static pthread_t monitor_tid; @@ -80,17 +83,18 @@ static struct ovs_mutex monitor_mutex = OVS_MUTEX_INITIALIZER; static void *monitor_main(void *); -static void monitor_check_send_soon(struct ofpbuf *); +static void monitor_check_send_soon(struct dp_packet *); static void monitor_run(void); -static void monitor_mport_run(struct mport *, struct ofpbuf *); +static void monitor_mport_run(struct mport *, struct dp_packet *); static void mport_register(const struct ofport_dpif *, struct bfd *, - struct cfm *, uint8_t[ETH_ADDR_LEN]) + struct cfm *, struct lldp *, uint8_t[ETH_ADDR_LEN]) OVS_REQUIRES(monitor_mutex); static void mport_unregister(const struct ofport_dpif *) OVS_REQUIRES(monitor_mutex); static void mport_update(struct mport *, struct bfd *, struct cfm *, - uint8_t[ETH_ADDR_LEN]) OVS_REQUIRES(monitor_mutex); + struct lldp *, uint8_t[ETH_ADDR_LEN]) + OVS_REQUIRES(monitor_mutex); static struct mport *mport_find(const struct ofport_dpif *) OVS_REQUIRES(monitor_mutex); @@ -114,7 +118,7 @@ * if it doesn't exist. Otherwise, just updates its fields. */ static void mport_register(const struct ofport_dpif *ofport, struct bfd *bfd, - struct cfm *cfm, uint8_t *hw_addr) + struct cfm *cfm, struct lldp *lldp, uint8_t *hw_addr) OVS_REQUIRES(monitor_mutex) { struct mport *mport = mport_find(ofport); @@ -125,7 +129,7 @@ hmap_insert(&monitor_hmap, &mport->hmap_node, hash_pointer(ofport, 0)); heap_insert(&monitor_heap, &mport->heap_node, 0); } - mport_update(mport, bfd, cfm, hw_addr); + mport_update(mport, bfd, cfm, lldp, hw_addr); } /* Removes mport from monitor_hmap and monitor_heap and frees it. */ @@ -136,7 +140,7 @@ struct mport *mport = mport_find(ofport); if (mport) { - mport_update(mport, NULL, NULL, NULL); + mport_update(mport, NULL, NULL, NULL, NULL); hmap_remove(&monitor_hmap, &mport->hmap_node); heap_remove(&monitor_heap, &mport->heap_node); free(mport); @@ -146,7 +150,8 @@ /* Updates the fields of an existing mport struct. */ static void mport_update(struct mport *mport, struct bfd *bfd, struct cfm *cfm, - uint8_t hw_addr[ETH_ADDR_LEN]) OVS_REQUIRES(monitor_mutex) + struct lldp *lldp, uint8_t hw_addr[ETH_ADDR_LEN]) + OVS_REQUIRES(monitor_mutex) { ovs_assert(mport); @@ -158,12 +163,16 @@ bfd_unref(mport->bfd); mport->bfd = bfd_ref(bfd); } + if (mport->lldp != lldp) { + lldp_unref(mport->lldp); + mport->lldp = lldp_ref(lldp); + } if (hw_addr && memcmp(mport->hw_addr, hw_addr, ETH_ADDR_LEN)) { memcpy(mport->hw_addr, hw_addr, ETH_ADDR_LEN); } - /* If bfd/cfm is added or reconfigured, move the mport on top of the heap + /* If bfd/cfm/lldp is added or reconfigured, move the mport on top of the heap * so that the monitor thread can run the mport next time it wakes up. */ - if (mport->bfd || mport->cfm) { + if (mport->bfd || mport->cfm || mport->lldp) { heap_change(&monitor_heap, &mport->heap_node, LLONG_MAX); } } @@ -194,9 +203,9 @@ { uint32_t stub[512 / 4]; long long int prio_now; - struct ofpbuf packet; + struct dp_packet packet; - ofpbuf_use_stub(&packet, stub, sizeof stub); + dp_packet_use_stub(&packet, stub, sizeof stub); ovs_mutex_lock(&monitor_mutex); /* The monitor_check_send_soon() needs to be run twice. The first @@ -227,13 +236,13 @@ poll_timer_wait_until(MIN(next_timeout, next_mport_wakeup)); } ovs_mutex_unlock(&monitor_mutex); - ofpbuf_uninit(&packet); + dp_packet_uninit(&packet); } /* Checks the 'send_soon' list for any mport that needs to send cfm/bfd * control packet immediately, and calls monitor_mport_run(). */ static void -monitor_check_send_soon(struct ofpbuf *packet) +monitor_check_send_soon(struct dp_packet *packet) OVS_REQUIRES(monitor_mutex) { while (!guarded_list_is_empty(&send_soon)) { @@ -255,32 +264,45 @@ * on 'mport'. And changes the location of 'mport' in heap based on next * timeout. */ static void -monitor_mport_run(struct mport *mport, struct ofpbuf *packet) +monitor_mport_run(struct mport *mport, struct dp_packet *packet) OVS_REQUIRES(monitor_mutex) { long long int next_wake_time; + long long int bfd_wake_time = LLONG_MAX; + long long int cfm_wake_time = LLONG_MAX; + long long int lldp_wake_time = LLONG_MAX; if (mport->cfm && cfm_should_send_ccm(mport->cfm)) { - ofpbuf_clear(packet); + dp_packet_clear(packet); cfm_compose_ccm(mport->cfm, packet, mport->hw_addr); ofproto_dpif_send_packet(mport->ofport, packet); } if (mport->bfd && bfd_should_send_packet(mport->bfd)) { - ofpbuf_clear(packet); + dp_packet_clear(packet); bfd_put_packet(mport->bfd, packet, mport->hw_addr); ofproto_dpif_send_packet(mport->ofport, packet); } + if (mport->lldp && lldp_should_send_packet(mport->lldp)) { + dp_packet_clear(packet); + lldp_put_packet(mport->lldp, packet, mport->hw_addr); + ofproto_dpif_send_packet(mport->ofport, packet); + } + if (mport->cfm) { cfm_run(mport->cfm); - cfm_wait(mport->cfm); + cfm_wake_time = cfm_wait(mport->cfm); } if (mport->bfd) { bfd_run(mport->bfd); - bfd_wait(mport->bfd); + bfd_wake_time = bfd_wait(mport->bfd); + } + if (mport->lldp) { + lldp_wake_time = lldp_wait(mport->lldp); } /* Computes the next wakeup time for this mport. */ - next_wake_time = MIN(bfd_wake_time(mport->bfd), - cfm_wake_time(mport->cfm)); + next_wake_time = MIN(bfd_wake_time, + cfm_wake_time); + next_wake_time = MIN(next_wake_time, lldp_wake_time); heap_change(&monitor_heap, &mport->heap_node, MSEC_TO_PRIO(next_wake_time)); } @@ -293,13 +315,14 @@ void ofproto_dpif_monitor_port_update(const struct ofport_dpif *ofport, struct bfd *bfd, struct cfm *cfm, + struct lldp *lldp, uint8_t hw_addr[ETH_ADDR_LEN]) { ovs_mutex_lock(&monitor_mutex); - if (!cfm && !bfd) { + if (!cfm && !bfd && !lldp) { mport_unregister(ofport); } else { - mport_register(ofport, bfd, cfm, hw_addr); + mport_register(ofport, bfd, cfm, lldp, hw_addr); } ovs_mutex_unlock(&monitor_mutex); diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-monitor.h openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-monitor.h --- openvswitch-2.3.1/ofproto/ofproto-dpif-monitor.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-monitor.h 2015-06-23 18:46:21.000000000 +0000 @@ -22,12 +22,13 @@ struct bfd; struct cfm; +struct lldp; struct ofport_dpif; void ofproto_dpif_monitor_port_send_soon(const struct ofport_dpif *); void ofproto_dpif_monitor_port_update(const struct ofport_dpif *, struct bfd *, struct cfm *, - uint8_t[OFP_ETH_ALEN]); + struct lldp *, uint8_t[OFP_ETH_ALEN]); #endif /* ofproto-dpif-monitor.h */ diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-rid.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-rid.c --- openvswitch-2.3.1/ofproto/ofproto-dpif-rid.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-rid.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Nicira, Inc. + * Copyright (c) 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,176 +16,350 @@ #include -#include "hmap.h" -#include "hash.h" -#include "ovs-thread.h" +#include "ofpbuf.h" +#include "ofproto-dpif.h" #include "ofproto-dpif-rid.h" +#include "ofproto-provider.h" +#include "openvswitch/vlog.h" -struct rid_map { - struct hmap map; -}; - -struct rid_node { - struct hmap_node node; - uint32_t recirc_id; -}; - -struct rid_pool { - struct rid_map ridmap; - uint32_t base; /* IDs in the range of [base, base + n_ids). */ - uint32_t n_ids; /* Total number of ids in the pool. */ - uint32_t next_free_id; /* Possible next free id. */ -}; - -struct recirc_id_pool { - struct ovs_mutex lock; - struct rid_pool rids; -}; - -#define RECIRC_ID_BASE 300 -#define RECIRC_ID_N_IDS 1024 - -static void rid_pool_init(struct rid_pool *rids, - uint32_t base, uint32_t n_ids); -static void rid_pool_uninit(struct rid_pool *pool); -static uint32_t rid_pool_alloc_id(struct rid_pool *pool); -static void rid_pool_free_id(struct rid_pool *rids, uint32_t rid); -static struct rid_node *rid_pool_find(struct rid_pool *rids, uint32_t id); -static struct rid_node *rid_pool_add(struct rid_pool *rids, uint32_t id); - -struct recirc_id_pool * -recirc_id_pool_create(void) -{ - struct recirc_id_pool *pool; - - pool = xmalloc(sizeof *pool); - rid_pool_init(&pool->rids, RECIRC_ID_BASE, RECIRC_ID_N_IDS); - ovs_mutex_init(&pool->lock); +VLOG_DEFINE_THIS_MODULE(ofproto_dpif_rid); - return pool; -} +static struct ovs_mutex mutex; + +static struct cmap id_map; +static struct cmap metadata_map; + +static struct ovs_list expiring OVS_GUARDED_BY(mutex); +static struct ovs_list expired OVS_GUARDED_BY(mutex); + +static uint32_t next_id OVS_GUARDED_BY(mutex); /* Possible next free id. */ + +#define RECIRC_POOL_STATIC_IDS 1024 void -recirc_id_pool_destroy(struct recirc_id_pool *pool) +recirc_init(void) { - rid_pool_uninit(&pool->rids); - ovs_mutex_destroy(&pool->lock); - free(pool); + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + + if (ovsthread_once_start(&once)) { + ovs_mutex_init(&mutex); + ovs_mutex_lock(&mutex); + next_id = 1; /* 0 is not a valid ID. */ + cmap_init(&id_map); + cmap_init(&metadata_map); + list_init(&expiring); + list_init(&expired); + ovs_mutex_unlock(&mutex); + + ovsthread_once_done(&once); + } + } -uint32_t -recirc_id_alloc(struct recirc_id_pool *pool) +/* This should be called by the revalidator once at each round (every 500ms or + * more). */ +void +recirc_run(void) { - uint32_t id; + static long long int last = 0; + long long int now = time_msec(); - ovs_mutex_lock(&pool->lock); - id = rid_pool_alloc_id(&pool->rids); - ovs_mutex_unlock(&pool->lock); + /* Do maintenance at most 4 times / sec. */ + ovs_mutex_lock(&mutex); + if (now - last > 250) { + struct recirc_id_node *node; + + last = now; + + /* Nodes in 'expiring' and 'expired' lists have the refcount of zero, + * which means that while they can still be found (by id), no new + * references can be taken on them. We have removed the entry from the + * 'metadata_map', at the time when refcount reached zero, causing any + * new translations to allocate a new ID. This allows the expiring + * entry to be safely deleted while any sudden new use of the similar + * recirculation will safely start using a new recirculation ID. When + * the refcount gets to zero, the node is also added to the 'expiring' + * list. At any time after that the nodes in the 'expiring' list can + * be moved to the 'expired' list, from which they are deleted at least + * 250ms afterwards. */ + + /* Delete the expired. These have been lingering for at least 250 ms, + * which should be enough for any ongoing recirculations to be + * finished. */ + LIST_FOR_EACH_POP (node, exp_node, &expired) { + cmap_remove(&id_map, &node->id_node, node->id); + ovsrcu_postpone(free, node); + } - return id; + if (!list_is_empty(&expiring)) { + /* 'expired' is now empty, move nodes in 'expiring' to it. */ + list_splice(&expired, list_front(&expiring), &expiring); + } + } + ovs_mutex_unlock(&mutex); } -void -recirc_id_free(struct recirc_id_pool *pool, uint32_t id) +/* We use the id as the hash value, which works due to cmap internal rehashing. + * We also only insert nodes with unique IDs, so all possible hash collisions + * remain internal to the cmap. */ +static struct recirc_id_node * +recirc_find__(uint32_t id) + OVS_REQUIRES(mutex) { - ovs_mutex_lock(&pool->lock); - rid_pool_free_id(&pool->rids, id); - ovs_mutex_unlock(&pool->lock); + struct cmap_node *node = cmap_find_protected(&id_map, id); + + return node ? CONTAINER_OF(node, struct recirc_id_node, id_node) : NULL; } -static void -rid_pool_init(struct rid_pool *rids, uint32_t base, uint32_t n_ids) +/* Lockless RCU protected lookup. If node is needed accross RCU quiescent + * state, caller should copy the contents. */ +const struct recirc_id_node * +recirc_id_node_find(uint32_t id) { - rids->base = base; - rids->n_ids = n_ids; - rids->next_free_id = base; - hmap_init(&rids->ridmap.map); + const struct cmap_node *node = cmap_find(&id_map, id); + + return node + ? CONTAINER_OF(node, const struct recirc_id_node, id_node) + : NULL; } -static void -rid_pool_uninit(struct rid_pool *rids) +static uint32_t +recirc_metadata_hash(struct ofproto_dpif *ofproto, uint8_t table_id, + struct recirc_metadata *md, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *ofpacts) { - struct rid_node *rid, *next; + uint32_t hash; - HMAP_FOR_EACH_SAFE(rid, next, node, &rids->ridmap.map) { - hmap_remove(&rids->ridmap.map, &rid->node); - free(rid); + BUILD_ASSERT(OFPACT_ALIGNTO == sizeof(uint64_t)); + + hash = hash_pointer(ofproto, 0); + hash = hash_int(table_id, hash); + hash = hash_words64((const uint64_t *)md, sizeof *md / sizeof(uint64_t), + hash); + if (stack && stack->size != 0) { + hash = hash_words64((const uint64_t *)stack->data, + stack->size / sizeof(uint64_t), hash); + } + hash = hash_int(action_set_len, hash); + if (ofpacts_len) { + hash = hash_words64(ALIGNED_CAST(const uint64_t *, ofpacts), + OFPACT_ALIGN(ofpacts_len) / sizeof(uint64_t), + hash); } + return hash; +} - hmap_destroy(&rids->ridmap.map); +static bool +recirc_metadata_equal(const struct recirc_id_node *node, + struct ofproto_dpif *ofproto, uint8_t table_id, + struct recirc_metadata *md, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *ofpacts) +{ + return node->ofproto == ofproto + && node->table_id == table_id + && !memcmp(&node->metadata, md, sizeof *md) + && ((!node->stack && (!stack || stack->size == 0)) + || (node->stack && stack && ofpbuf_equal(node->stack, stack))) + && node->action_set_len == action_set_len + && node->ofpacts_len == ofpacts_len + && (ofpacts_len == 0 || !memcmp(node->ofpacts, ofpacts, ofpacts_len)); } -static struct rid_node * -rid_pool_find(struct rid_pool *rids, uint32_t id) +/* Lockless RCU protected lookup. If node is needed accross RCU quiescent + * state, caller should take a reference. */ +static struct recirc_id_node * +recirc_find_equal(struct ofproto_dpif *ofproto, uint8_t table_id, + struct recirc_metadata *md, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *ofpacts, uint32_t hash) { - size_t hash; - struct rid_node *rid; + struct recirc_id_node *node; - hash = hash_int(id, 0); - HMAP_FOR_EACH_WITH_HASH(rid, node, hash, &rids->ridmap.map) { - if (id == rid->recirc_id) { - return rid; + CMAP_FOR_EACH_WITH_HASH(node, metadata_node, hash, &metadata_map) { + if (recirc_metadata_equal(node, ofproto, table_id, md, stack, + action_set_len, ofpacts_len, ofpacts)) { + return node; } } return NULL; } -static struct rid_node * -rid_pool_add(struct rid_pool *rids, uint32_t id) +static struct recirc_id_node * +recirc_ref_equal(struct ofproto_dpif *ofproto, uint8_t table_id, + struct recirc_metadata *md, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *ofpacts, uint32_t hash) { - struct rid_node *rid = xmalloc(sizeof *rid); - size_t hash; + struct recirc_id_node *node; + + do { + node = recirc_find_equal(ofproto, table_id, md, stack, action_set_len, + ofpacts_len, ofpacts, hash); - rid->recirc_id = id; - hash = hash_int(id, 0); - hmap_insert(&rids->ridmap.map, &rid->node, hash); - return rid; + /* Try again if the node was released before we get the reference. */ + } while (node && !ovs_refcount_try_ref_rcu(&node->refcount)); + + return node; } -static uint32_t -rid_pool_alloc_id(struct rid_pool *rids) +/* Allocate a unique recirculation id for the given set of flow metadata. + * The ID space is 2^^32, so there should never be a situation in which all + * the IDs are used up. We loop until we find a free one. + * hash is recomputed if it is passed in as 0. */ +static struct recirc_id_node * +recirc_alloc_id__(struct ofproto_dpif *ofproto, uint8_t table_id, + struct recirc_metadata *md, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *ofpacts, uint32_t hash) { - uint32_t id; - - if (rids->n_ids == 0) { - return 0; + struct recirc_id_node *node = xzalloc(sizeof *node + + OFPACT_ALIGN(ofpacts_len)); + node->hash = hash; + ovs_refcount_init(&node->refcount); + + node->ofproto = ofproto; + node->table_id = table_id; + memcpy(&node->metadata, md, sizeof node->metadata); + node->stack = (stack && stack->size) ? ofpbuf_clone(stack) : NULL; + node->action_set_len = action_set_len; + node->ofpacts_len = ofpacts_len; + if (ofpacts_len) { + memcpy(node->ofpacts, ofpacts, ofpacts_len); } - if (!(rid_pool_find(rids, rids->next_free_id))) { - id = rids->next_free_id; - goto found_free_id; + ovs_mutex_lock(&mutex); + for (;;) { + /* Claim the next ID. The ID space should be sparse enough for the + allocation to succeed at the first try. We do skip the first + RECIRC_POOL_STATIC_IDS IDs on the later rounds, though, as some of + the initial allocations may be for long term uses (like bonds). */ + node->id = next_id++; + if (OVS_UNLIKELY(!node->id)) { + next_id = RECIRC_POOL_STATIC_IDS + 1; + node->id = next_id++; + } + /* Find if the id is free. */ + if (OVS_LIKELY(!recirc_find__(node->id))) { + break; + } } + cmap_insert(&id_map, &node->id_node, node->id); + cmap_insert(&metadata_map, &node->metadata_node, node->hash); + ovs_mutex_unlock(&mutex); + return node; +} - for(id = rids->base; id < rids->base + rids->n_ids; id++) { - if (!rid_pool_find(rids, id)) { - goto found_free_id; - } +/* Look up an existing ID for the given flow's metadata and optional actions. + */ +uint32_t +recirc_find_id(struct ofproto_dpif *ofproto, uint8_t table_id, + struct recirc_metadata *md, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *ofpacts) +{ + /* Check if an ID with the given metadata already exists. */ + struct recirc_id_node *node; + uint32_t hash; + + hash = recirc_metadata_hash(ofproto, table_id, md, stack, action_set_len, + ofpacts_len, ofpacts); + node = recirc_find_equal(ofproto, table_id, md, stack, action_set_len, + ofpacts_len, ofpacts, hash); + + return node ? node->id : 0; +} + +/* Allocate a unique recirculation id for the given set of flow metadata and + optional actions. */ +uint32_t +recirc_alloc_id_ctx(struct ofproto_dpif *ofproto, uint8_t table_id, + struct recirc_metadata *md, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *ofpacts) +{ + struct recirc_id_node *node; + uint32_t hash; + + /* Look up an existing ID. */ + hash = recirc_metadata_hash(ofproto, table_id, md, stack, action_set_len, + ofpacts_len, ofpacts); + node = recirc_ref_equal(ofproto, table_id, md, stack, action_set_len, + ofpacts_len, ofpacts, hash); + + /* Allocate a new recirc ID if needed. */ + if (!node) { + ovs_assert(action_set_len <= ofpacts_len); + + node = recirc_alloc_id__(ofproto, table_id, md, stack, action_set_len, + ofpacts_len, ofpacts, hash); } - /* Not available. */ - return 0; + return node->id; +} + +/* Allocate a unique recirculation id. */ +uint32_t +recirc_alloc_id(struct ofproto_dpif *ofproto) +{ + struct recirc_metadata md; + struct recirc_id_node *node; + uint32_t hash; + + memset(&md, 0, sizeof md); + md.in_port = OFPP_NONE; + hash = recirc_metadata_hash(ofproto, TBL_INTERNAL, &md, NULL, 0, 0, NULL); + node = recirc_alloc_id__(ofproto, TBL_INTERNAL, &md, NULL, 0, 0, NULL, + hash); + return node->id; +} -found_free_id: - rid_pool_add(rids, id); +void +recirc_id_node_unref(const struct recirc_id_node *node_) + OVS_EXCLUDED(mutex) +{ + struct recirc_id_node *node = CONST_CAST(struct recirc_id_node *, node_); - if (id < rids->base + rids->n_ids) { - rids->next_free_id = id + 1; - } else { - rids->next_free_id = rids->base; + if (node && ovs_refcount_unref(&node->refcount) == 1) { + ovs_mutex_lock(&mutex); + /* Prevent re-use of this node by removing the node from 'metadata_map' + */ + cmap_remove(&metadata_map, &node->metadata_node, node->hash); + /* We keep the node in the 'id_map' so that it can be found as long + * as it lingers, and add it to the 'expiring' list. */ + list_insert(&expiring, &node->exp_node); + ovs_mutex_unlock(&mutex); } +} - return id; +void +recirc_free_id(uint32_t id) +{ + const struct recirc_id_node *node; + + node = recirc_id_node_find(id); + if (node) { + recirc_id_node_unref(node); + } else { + VLOG_ERR("Freeing nonexistent recirculation ID: %"PRIu32, id); + } } -static void -rid_pool_free_id(struct rid_pool *rids, uint32_t id) +/* Called when 'ofproto' is destructed. Checks for and clears any + * recirc_id leak. + * No other thread may have access to the 'ofproto' being destructed. + * All related datapath flows must be deleted before calling this. */ +void +recirc_free_ofproto(struct ofproto_dpif *ofproto, const char *ofproto_name) { - struct rid_node *rid; - if (id > rids->base && (id <= rids->base + rids->n_ids)) { - rid = rid_pool_find(rids, id); - if (rid) { - hmap_remove(&rids->ridmap.map, &rid->node); - free(rid); + struct recirc_id_node *n; + + CMAP_FOR_EACH (n, metadata_node, &metadata_map) { + if (n->ofproto == ofproto) { + VLOG_ERR("recirc_id %"PRIu32 + " left allocated when ofproto (%s)" + " is destructed", n->id, ofproto_name); } } } diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-rid.h openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-rid.h --- openvswitch-2.3.1/ofproto/ofproto-dpif-rid.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-rid.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Nicira, Inc. + * Copyright (c) 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,29 +20,164 @@ #include #include -struct recirc_id_pool; +#include "cmap.h" +#include "list.h" +#include "ofp-actions.h" +#include "ovs-thread.h" + +struct ofproto_dpif; +struct rule; /* - * Recirculation ID pool. - * ====================== - * - * Recirculation ID needs to be unique for each datapath. Recirculation - * ID pool keeps track recirculation ids. + * Recirculation + * ============= * - * Typically, there is one recirculation ID pool for each backer. + * Recirculation is a technique to allow a frame to re-enter the datapath + * packet processing path for one or multiple times to achieve more flexible + * packet processing, such modifying header fields after MPLS POP action and + * selecting bond a slave port for bond ports. + * + * Data path and user space interface + * ----------------------------------- + * + * Recirculation uses two uint32_t fields, recirc_id and dp_hash, and a RECIRC + * action. The value recirc_id is used to select the next packet processing + * steps among multiple instances of recirculation. When a packet initially + * enters the data path it is assigned with recirc_id 0, which indicates no + * recirculation. Recirc_ids are managed by the user space, opaque to the + * data path. + * + * On the other hand, dp_hash can only be computed by the data path, opaque to + * the user space. In fact, user space may not able to recompute the hash + * value. The dp_hash value should be wildcarded for a newly received + * packet. HASH action specifies whether the hash is computed, and if + * computed, how many fields are to be included in the hash computation. The + * computed hash value is stored into the dp_hash field prior to recirculation. + * + * The RECIRC action sets the recirc_id field and then reprocesses the packet + * as if it was received on the same input port. RECIRC action works like a + * function call; actions listed behind the RECIRC action will be executed + * after its execution. RECIRC action can be nested, data path implementation + * limits the number of recirculation executed to prevent unreasonable nesting + * depth or infinite loop. + * + * User space recirculation context + * --------------------------------- + * + * Recirculation is hidden from the OpenFlow controllers. Action translation + * code deduces when recirculation is necessary and issues a data path + * recirculation action. All OpenFlow actions to be performed after + * recirculation are derived from the OpenFlow pipeline and are stored with the + * recirculation ID. When the OpenFlow tables are changed in a way affecting + * the recirculation flows, new recirculation ID with new metadata and actions + * is allocated and the old one is timed out. + * + * Recirculation ID pool + * ---------------------- + * + * Recirculation ID needs to be unique for all data paths. Recirculation ID + * pool keeps track recirculation ids and stores OpenFlow pipeline translation + * context so that flow processing may continue after recirculation. * - * In theory, Recirculation ID can be any uint32_t value, except 0. - * The implementation usually limits it to a smaller range to ease - * debugging. + * A Recirculation ID can be any uint32_t value, except for that the value 0 is + * reserved for 'no recirculation' case. * * Thread-safety - * ============= + * -------------- * * All APIs are thread safe. - * */ -struct recirc_id_pool *recirc_id_pool_create(void); -void recirc_id_pool_destroy(struct recirc_id_pool *pool); -uint32_t recirc_id_alloc(struct recirc_id_pool *pool); -void recirc_id_free(struct recirc_id_pool *pool, uint32_t recirc_id); + +/* Metadata for restoring pipeline context after recirculation. Helpers + * are inlined below to keep them together with the definition for easier + * updates. */ +BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); + +struct recirc_metadata { + /* Metadata in struct flow. */ + struct flow_tnl tunnel; /* Encapsulating tunnel parameters. */ + ovs_be64 metadata; /* OpenFlow Metadata. */ + uint64_t regs[FLOW_N_XREGS]; /* Registers. */ + ofp_port_t in_port; /* Incoming port. */ + ofp_port_t actset_output; /* Output port in action set. */ +}; + +static inline void +recirc_metadata_from_flow(struct recirc_metadata *md, + const struct flow *flow) +{ + memset(md, 0, sizeof *md); + md->tunnel = flow->tunnel; + md->metadata = flow->metadata; + memcpy(md->regs, flow->regs, sizeof md->regs); + md->in_port = flow->in_port.ofp_port; + md->actset_output = flow->actset_output; +} + +static inline void +recirc_metadata_to_flow(const struct recirc_metadata *md, + struct flow *flow) +{ + flow->tunnel = md->tunnel; + flow->metadata = md->metadata; + memcpy(flow->regs, md->regs, sizeof flow->regs); + flow->in_port.ofp_port = md->in_port; + flow->actset_output = md->actset_output; +} + +/* Pool node fields should NOT be modified after placing the node in the pool. + */ +struct recirc_id_node { + struct ovs_list exp_node OVS_GUARDED; + struct cmap_node id_node; + struct cmap_node metadata_node; + uint32_t id; + uint32_t hash; + struct ovs_refcount refcount; + + /* Initial table for post-recirculation processing. */ + uint8_t table_id; + + /* Pipeline context for post-recirculation processing. */ + struct ofproto_dpif *ofproto; /* Post-recirculation bridge. */ + struct recirc_metadata metadata; /* Flow metadata. */ + struct ofpbuf *stack; /* Stack if any. */ + + /* Actions to be translated on recirculation. */ + uint32_t action_set_len; /* How much of 'ofpacts' consists of an + * action set? */ + uint32_t ofpacts_len; /* Size of 'ofpacts', in bytes. */ + struct ofpact ofpacts[]; /* Sequence of "struct ofpacts". */ +}; + +void recirc_init(void); + +/* This is only used for bonds and will go away when bonds implementation is + * updated to use this mechanism instead of internal rules. */ +uint32_t recirc_alloc_id(struct ofproto_dpif *); + +uint32_t recirc_alloc_id_ctx(struct ofproto_dpif *, uint8_t table_id, + struct recirc_metadata *, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *); +uint32_t recirc_find_id(struct ofproto_dpif *, uint8_t table_id, + struct recirc_metadata *, struct ofpbuf *stack, + uint32_t action_set_len, uint32_t ofpacts_len, + const struct ofpact *); +void recirc_free_id(uint32_t recirc_id); +void recirc_free_ofproto(struct ofproto_dpif *, const char *ofproto_name); + +const struct recirc_id_node *recirc_id_node_find(uint32_t recirc_id); + +static inline bool recirc_id_node_try_ref_rcu(const struct recirc_id_node *n_) +{ + struct recirc_id_node *node = CONST_CAST(struct recirc_id_node *, n_); + + return node ? ovs_refcount_try_ref_rcu(&node->refcount) : false; +} + +void recirc_id_node_unref(const struct recirc_id_node *); + +void recirc_run(void); + #endif diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-sflow.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-sflow.c --- openvswitch-2.3.1/ofproto/ofproto-dpif-sflow.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-sflow.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * Copyright (c) 2009 InMon Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +18,7 @@ #include #include "ofproto-dpif-sflow.h" #include +#include #include #include #include @@ -32,18 +33,25 @@ #include "ofproto.h" #include "packets.h" #include "poll-loop.h" +#include "ovs-router.h" #include "route-table.h" #include "sflow_api.h" #include "socket-util.h" #include "timeval.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #include "lib/odp-util.h" #include "ofproto-provider.h" +#include "lacp.h" VLOG_DEFINE_THIS_MODULE(sflow); static struct ovs_mutex mutex; +/* This global var is used to determine which sFlow + sub-agent should send the datapath counters. */ +#define SFLOW_GC_SUBID_UNCLAIMED (uint32_t)-1 +static uint32_t sflow_global_counters_subid = SFLOW_GC_SUBID_UNCLAIMED; + struct dpif_sflow_port { struct hmap_node hmap_node; /* In struct dpif_sflow's "ports" hmap. */ SFLDataSource_instance dsi; /* sFlow library's notion of port number. */ @@ -159,18 +167,137 @@ return NULL; } +/* Call to get the datapath stats. Modeled after the dpctl utility. + * + * It might be more efficient for this module to be given a handle it can use + * to get these stats more efficiently, but this is only going to be called + * once every 20-30 seconds. Return number of datapaths found (normally expect + * 1). */ +static int +sflow_get_dp_stats(struct dpif_sflow *ds OVS_UNUSED, + struct dpif_dp_stats *dp_totals) +{ + struct sset types; + const char *type; + int count = 0; + + memset(dp_totals, 0, sizeof *dp_totals); + sset_init(&types); + dp_enumerate_types(&types); + SSET_FOR_EACH (type, &types) { + struct sset names; + const char *name; + sset_init(&names); + if (dp_enumerate_names(type, &names) == 0) { + SSET_FOR_EACH (name, &names) { + struct dpif *dpif; + if (dpif_open(name, type, &dpif) == 0) { + struct dpif_dp_stats dp_stats; + if (dpif_get_dp_stats(dpif, &dp_stats) == 0) { + count++; + dp_totals->n_hit += dp_stats.n_hit; + dp_totals->n_missed += dp_stats.n_missed; + dp_totals->n_lost += dp_stats.n_lost; + dp_totals->n_flows += dp_stats.n_flows; + dp_totals->n_mask_hit += dp_stats.n_mask_hit; + dp_totals->n_masks += dp_stats.n_masks; + } + dpif_close(dpif); + } + } + sset_destroy(&names); + } + } + sset_destroy(&types); + return count; +} + +/* If there are multiple bridges defined then we need some + minimal artibration to decide which one should send the + global counters. This function allows each sub-agent to + ask if he should do it or not. */ +static bool +sflow_global_counters_subid_test(uint32_t subid) + OVS_REQUIRES(mutex) +{ + if (sflow_global_counters_subid == SFLOW_GC_SUBID_UNCLAIMED) { + /* The role is up for grabs. */ + sflow_global_counters_subid = subid; + } + return (sflow_global_counters_subid == subid); +} + +static void +sflow_global_counters_subid_clear(uint32_t subid) + OVS_REQUIRES(mutex) +{ + if (sflow_global_counters_subid == subid) { + /* The sub-agent that was sending global counters + is going away, so reset to allow another + to take over. */ + sflow_global_counters_subid = SFLOW_GC_SUBID_UNCLAIMED; + } +} + +static void +sflow_agent_get_global_counters(void *ds_, SFLPoller *poller, + SFL_COUNTERS_SAMPLE_TYPE *cs) + OVS_REQUIRES(mutex) +{ + struct dpif_sflow *ds = ds_; + SFLCounters_sample_element dp_elem, res_elem; + struct dpif_dp_stats dp_totals; + struct rusage usage; + + if (!sflow_global_counters_subid_test(poller->agent->subId)) { + /* Another sub-agent is currently responsible for this. */ + return; + } + + /* datapath stats */ + if (sflow_get_dp_stats(ds, &dp_totals)) { + dp_elem.tag = SFLCOUNTERS_OVSDP; + dp_elem.counterBlock.ovsdp.n_hit = dp_totals.n_hit; + dp_elem.counterBlock.ovsdp.n_missed = dp_totals.n_missed; + dp_elem.counterBlock.ovsdp.n_lost = dp_totals.n_lost; + dp_elem.counterBlock.ovsdp.n_mask_hit = dp_totals.n_mask_hit; + dp_elem.counterBlock.ovsdp.n_flows = dp_totals.n_flows; + dp_elem.counterBlock.ovsdp.n_masks = dp_totals.n_masks; + SFLADD_ELEMENT(cs, &dp_elem); + } + + /* resource usage */ + getrusage(RUSAGE_SELF, &usage); + res_elem.tag = SFLCOUNTERS_APP_RESOURCES; + res_elem.counterBlock.appResources.user_time + = timeval_to_msec(&usage.ru_utime); + res_elem.counterBlock.appResources.system_time + = timeval_to_msec(&usage.ru_stime); + res_elem.counterBlock.appResources.mem_used = (usage.ru_maxrss * 1024); + SFL_UNDEF_GAUGE(res_elem.counterBlock.appResources.mem_max); + SFL_UNDEF_GAUGE(res_elem.counterBlock.appResources.fd_open); + SFL_UNDEF_GAUGE(res_elem.counterBlock.appResources.fd_max); + SFL_UNDEF_GAUGE(res_elem.counterBlock.appResources.conn_open); + SFL_UNDEF_GAUGE(res_elem.counterBlock.appResources.conn_max); + + SFLADD_ELEMENT(cs, &res_elem); + sfl_poller_writeCountersSample(poller, cs); +} + static void sflow_agent_get_counters(void *ds_, SFLPoller *poller, SFL_COUNTERS_SAMPLE_TYPE *cs) OVS_REQUIRES(mutex) { struct dpif_sflow *ds = ds_; - SFLCounters_sample_element elem; + SFLCounters_sample_element elem, lacp_elem, of_elem, name_elem; enum netdev_features current; struct dpif_sflow_port *dsp; SFLIf_counters *counters; struct netdev_stats stats; enum netdev_flags flags; + struct lacp_slave_stats lacp_stats; + const char *ifName; dsp = dpif_sflow_find_port(ds, u32_to_odp(poller->bridgePort)); if (!dsp) { @@ -222,6 +349,59 @@ counters->ifPromiscuousMode = 0; SFLADD_ELEMENT(cs, &elem); + + /* Include LACP counters and identifiers if this port is part of a LAG. */ + if (ofproto_port_get_lacp_stats(dsp->ofport, &lacp_stats) == 0) { + memset(&lacp_elem, 0, sizeof lacp_elem); + lacp_elem.tag = SFLCOUNTERS_LACP; + memcpy(&lacp_elem.counterBlock.lacp.actorSystemID, + lacp_stats.dot3adAggPortActorSystemID, + ETH_ADDR_LEN); + memcpy(&lacp_elem.counterBlock.lacp.partnerSystemID, + lacp_stats.dot3adAggPortPartnerOperSystemID, + ETH_ADDR_LEN); + lacp_elem.counterBlock.lacp.attachedAggID = + lacp_stats.dot3adAggPortAttachedAggID; + lacp_elem.counterBlock.lacp.portState.v.actorAdmin = + lacp_stats.dot3adAggPortActorAdminState; + lacp_elem.counterBlock.lacp.portState.v.actorOper = + lacp_stats.dot3adAggPortActorOperState; + lacp_elem.counterBlock.lacp.portState.v.partnerAdmin = + lacp_stats.dot3adAggPortPartnerAdminState; + lacp_elem.counterBlock.lacp.portState.v.partnerOper = + lacp_stats.dot3adAggPortPartnerOperState; + lacp_elem.counterBlock.lacp.LACPDUsRx = + lacp_stats.dot3adAggPortStatsLACPDUsRx; + SFL_UNDEF_COUNTER(lacp_elem.counterBlock.lacp.markerPDUsRx); + SFL_UNDEF_COUNTER(lacp_elem.counterBlock.lacp.markerResponsePDUsRx); + SFL_UNDEF_COUNTER(lacp_elem.counterBlock.lacp.unknownRx); + lacp_elem.counterBlock.lacp.illegalRx = + lacp_stats.dot3adAggPortStatsIllegalRx; + lacp_elem.counterBlock.lacp.LACPDUsTx = + lacp_stats.dot3adAggPortStatsLACPDUsTx; + SFL_UNDEF_COUNTER(lacp_elem.counterBlock.lacp.markerPDUsTx); + SFL_UNDEF_COUNTER(lacp_elem.counterBlock.lacp.markerResponsePDUsTx); + SFLADD_ELEMENT(cs, &lacp_elem); + } + + /* Include Port name. */ + if ((ifName = netdev_get_name(dsp->ofport->netdev)) != NULL) { + memset(&name_elem, 0, sizeof name_elem); + name_elem.tag = SFLCOUNTERS_PORTNAME; + name_elem.counterBlock.portName.portName.str = (char *)ifName; + name_elem.counterBlock.portName.portName.len = strlen(ifName); + SFLADD_ELEMENT(cs, &name_elem); + } + + /* Include OpenFlow DPID and openflow port number. */ + memset(&of_elem, 0, sizeof of_elem); + of_elem.tag = SFLCOUNTERS_OPENFLOWPORT; + of_elem.counterBlock.ofPort.datapath_id = + ofproto_get_datapath_id(dsp->ofport->ofproto); + of_elem.counterBlock.ofPort.port_no = + (OVS_FORCE uint32_t)dsp->ofport->ofp_port; + SFLADD_ELEMENT(cs, &of_elem); + sfl_poller_writeCountersSample(poller, cs); } @@ -253,13 +433,17 @@ } SSET_FOR_EACH (target, targets) { - struct sockaddr_storage ss; + union { + struct sockaddr_storage ss; + struct sockaddr_in sin; + } sa; char name[IFNAMSIZ]; - if (inet_parse_active(target, SFL_DEFAULT_COLLECTOR_PORT, &ss) - && ss.ss_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *) &ss; - if (route_table_get_name(sin->sin_addr.s_addr, name) + if (inet_parse_active(target, SFL_DEFAULT_COLLECTOR_PORT, &sa.ss) + && sa.ss.ss_family == AF_INET) { + ovs_be32 gw; + + if (ovs_router_lookup(sa.sin.sin_addr.s_addr, name, &gw) && !netdev_get_in4_by_name(name, &in4)) { goto success; } @@ -282,6 +466,7 @@ dpif_sflow_clear__(struct dpif_sflow *ds) OVS_REQUIRES(mutex) { if (ds->sflow_agent) { + sflow_global_counters_subid_clear(ds->sflow_agent->subId); sfl_agent_release(ds->sflow_agent); free(ds->sflow_agent); ds->sflow_agent = NULL; @@ -329,7 +514,6 @@ ds->next_tick = time_now() + 1; hmap_init(&ds->ports); ds->probability = 0; - route_table_register(); ovs_refcount_init(&ds->ref_cnt); return ds; @@ -361,10 +545,9 @@ void dpif_sflow_unref(struct dpif_sflow *ds) OVS_EXCLUDED(mutex) { - if (ds && ovs_refcount_unref(&ds->ref_cnt) == 1) { + if (ds && ovs_refcount_unref_relaxed(&ds->ref_cnt) == 1) { struct dpif_sflow_port *dsp, *next; - route_table_unregister(); dpif_sflow_clear(ds); HMAP_FOR_EACH_SAFE (dsp, next, hmap_node, &ds->ports) { dpif_sflow_del_port__(ds, dsp); @@ -457,6 +640,7 @@ SFLDataSource_instance dsi; uint32_t dsIndex; SFLSampler *sampler; + SFLPoller *poller; ovs_mutex_lock(&mutex); if (sset_is_empty(&options->targets) || !options->sampling_rate) { @@ -503,6 +687,7 @@ /* Create agent. */ VLOG_INFO("creating sFlow agent %d", options->sub_id); if (ds->sflow_agent) { + sflow_global_counters_subid_clear(ds->sflow_agent->subId); sfl_agent_release(ds->sflow_agent); } ds->sflow_agent = xcalloc(1, sizeof *ds->sflow_agent); @@ -536,6 +721,13 @@ sfl_sampler_set_sFlowFsMaximumHeaderSize(sampler, ds->options->header_len); sfl_sampler_set_sFlowFsReceiver(sampler, RECEIVER_INDEX); + /* Add a counter poller for the bridge so we can use it to send + global counters such as datapath cache hit/miss stats. */ + poller = sfl_agent_addPoller(ds->sflow_agent, &dsi, ds, + sflow_agent_get_global_counters); + sfl_poller_set_sFlowCpInterval(poller, ds->options->polling_interval); + sfl_poller_set_sFlowCpReceiver(poller, RECEIVER_INDEX); + /* Add pollers for the currently known ifindex-ports */ HMAP_FOR_EACH (dsp, hmap_node, &ds->ports) { dpif_sflow_add_poller(ds, dsp); @@ -561,7 +753,7 @@ } void -dpif_sflow_received(struct dpif_sflow *ds, struct ofpbuf *packet, +dpif_sflow_received(struct dpif_sflow *ds, const struct dp_packet *packet, const struct flow *flow, odp_port_t odp_in_port, const union user_action_cookie *cookie) OVS_EXCLUDED(mutex) @@ -602,12 +794,12 @@ header->header_protocol = SFLHEADER_ETHERNET_ISO8023; /* The frame_length should include the Ethernet FCS (4 bytes), * but it has already been stripped, so we need to add 4 here. */ - header->frame_length = ofpbuf_size(packet) + 4; + header->frame_length = dp_packet_size(packet) + 4; /* Ethernet FCS stripped off. */ header->stripped = 4; - header->header_length = MIN(ofpbuf_size(packet), + header->header_length = MIN(dp_packet_size(packet), sampler->sFlowFsMaximumHeaderSize); - header->header_bytes = ofpbuf_data(packet); + header->header_bytes = dp_packet_data(packet); /* Add extended switch element. */ memset(&switchElem, 0, sizeof(switchElem)); diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-sflow.h openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-sflow.h --- openvswitch-2.3.1/ofproto/ofproto-dpif-sflow.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-sflow.h 2015-06-23 18:46:21.000000000 +0000 @@ -46,10 +46,8 @@ void dpif_sflow_run(struct dpif_sflow *); void dpif_sflow_wait(struct dpif_sflow *); -void dpif_sflow_received(struct dpif_sflow *, - struct ofpbuf *, - const struct flow *, - odp_port_t odp_port, +void dpif_sflow_received(struct dpif_sflow *, const struct dp_packet *, + const struct flow *, odp_port_t odp_port, const union user_action_cookie *); int dpif_sflow_odp_port_to_ifindex(const struct dpif_sflow *, diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-unixctl.man openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-unixctl.man --- openvswitch-2.3.1/ofproto/ofproto-dpif-unixctl.man 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-unixctl.man 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,9 @@ -.SS "DATAPATH COMMANDS" -These commands manage logical datapaths. They are are similar to the -equivalent \fBovs\-dpctl\fR commands. +.SS "DATAPATH DEBUGGING COMMANDS" +These commands query and modify datapaths. They are are similar to +\fBovs\-dpctl\fR(8) commands. \fBdpif/show\fR has the additional +functionality, beyond \fBdpctl/show\fR of printing OpenFlow port +numbers. The other commands are redundant and will be removed in a +future release. . .IP "\fBdpif/dump\-dps\fR" Prints the name of each configured datapath on a separate line. diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-upcall.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-upcall.c --- openvswitch-2.3.1/ofproto/ofproto-dpif-upcall.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-upcall.c 2015-06-23 18:46:21.000000000 +0000 @@ -21,6 +21,7 @@ #include "connmgr.h" #include "coverage.h" +#include "cmap.h" #include "dpif.h" #include "dynamic-string.h" #include "fail-open.h" @@ -37,15 +38,18 @@ #include "poll-loop.h" #include "seq.h" #include "unixctl.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #define MAX_QUEUE_LENGTH 512 -#define FLOW_MISS_MAX_BATCH 50 +#define UPCALL_MAX_BATCH 64 #define REVALIDATE_MAX_BATCH 50 VLOG_DEFINE_THIS_MODULE(ofproto_dpif_upcall); -COVERAGE_DEFINE(upcall_duplicate_flow); +COVERAGE_DEFINE(dumped_duplicate_flow); +COVERAGE_DEFINE(dumped_new_flow); +COVERAGE_DEFINE(handler_duplicate_upcall); +COVERAGE_DEFINE(upcall_ukey_contention); COVERAGE_DEFINE(revalidate_missed_dp_flow); /* A thread that reads upcalls from dpif, forwards each upcall's packet, @@ -56,14 +60,21 @@ uint32_t handler_id; /* Handler id. */ }; +/* In the absence of a multiple-writer multiple-reader datastructure for + * storing ukeys, we use a large number of cmaps, each with its own lock for + * writing. */ +#define N_UMAPS 512 /* per udpif. */ +struct umap { + struct ovs_mutex mutex; /* Take for writing to the following. */ + struct cmap cmap; /* Datapath flow keys. */ +}; + /* A thread that processes datapath flows, updates OpenFlow statistics, and * updates or removes them if necessary. */ struct revalidator { struct udpif *udpif; /* Parent udpif. */ pthread_t thread; /* Thread ID. */ unsigned int id; /* ovsthread_id_self(). */ - struct hmap *ukeys; /* Points into udpif->ukeys for this - revalidator. Used for GC phase. */ }; /* An upcall handler for ofproto_dpif. @@ -83,13 +94,11 @@ * them. */ struct udpif { - struct list list_node; /* In all_udpifs list. */ + struct ovs_list list_node; /* In all_udpifs list. */ struct dpif *dpif; /* Datapath handle. */ struct dpif_backer *backer; /* Opaque dpif_backer pointer. */ - uint32_t secret; /* Random seed for upcall hash. */ - struct handler *handlers; /* Upcall handlers. */ size_t n_handlers; @@ -100,23 +109,19 @@ /* Revalidation. */ struct seq *reval_seq; /* Incremented to force revalidation. */ - bool need_revalidate; /* As indicated by 'reval_seq'. */ bool reval_exit; /* Set by leader on 'exit_latch. */ struct ovs_barrier reval_barrier; /* Barrier used by revalidators. */ - struct dpif_flow_dump dump; /* DPIF flow dump state. */ + struct dpif_flow_dump *dump; /* DPIF flow dump state. */ long long int dump_duration; /* Duration of the last flow dump. */ struct seq *dump_seq; /* Increments each dump iteration. */ + atomic_bool enable_ufid; /* If true, skip dumping flow attrs. */ - /* There are 'n_revalidators' ukey hmaps. Each revalidator retains a - * reference to one of these for garbage collection. + /* There are 'N_UMAPS' maps containing 'struct udpif_key' elements. * * During the flow dump phase, revalidators insert into these with a random * distribution. During the garbage collection phase, each revalidator - * takes care of garbage collecting one of these hmaps. */ - struct { - struct ovs_mutex mutex; /* Guards the following. */ - struct hmap hmap OVS_GUARDED; /* Datapath flow keys. */ - } *ukeys; + * takes care of garbage collecting a slice of these maps. */ + struct umap *ukeys; /* Datapath flow statistics. */ unsigned int max_n_flows; @@ -126,9 +131,15 @@ atomic_uint flow_limit; /* Datapath flow hard limit. */ /* n_flows_mutex prevents multiple threads updating these concurrently. */ - atomic_ulong n_flows; /* Number of flows in the datapath. */ + atomic_uint n_flows; /* Number of flows in the datapath. */ atomic_llong n_flows_timestamp; /* Last time n_flows was updated. */ struct ovs_mutex n_flows_mutex; + + /* Following fields are accessed and modified only from the main thread. */ + struct unixctl_conn **conns; /* Connections waiting on dump_seq. */ + uint64_t conn_seq; /* Corresponds to 'dump_seq' when + conns[n_conns-1] was stored. */ + size_t n_conns; /* Number of connections waiting. */ }; enum upcall_type { @@ -140,79 +151,106 @@ }; struct upcall { - struct flow_miss *flow_miss; /* This upcall's flow_miss. */ + struct ofproto_dpif *ofproto; /* Parent ofproto. */ + const struct recirc_id_node *recirc; /* Recirculation context. */ + bool have_recirc_ref; /* Reference held on recirc ctx? */ + + /* The flow and packet are only required to be constant when using + * dpif-netdev. If a modification is absolutely necessary, a const cast + * may be used with other datapaths. */ + const struct flow *flow; /* Parsed representation of the packet. */ + const ovs_u128 *ufid; /* Unique identifier for 'flow'. */ + unsigned pmd_id; /* Datapath poll mode driver id. */ + const struct dp_packet *packet; /* Packet associated with this upcall. */ + ofp_port_t in_port; /* OpenFlow in port, or OFPP_NONE. */ + + enum dpif_upcall_type type; /* Datapath type of the upcall. */ + const struct nlattr *userdata; /* Userdata for DPIF_UC_ACTION Upcalls. */ + + bool xout_initialized; /* True if 'xout' must be uninitialized. */ + struct xlate_out xout; /* Result of xlate_actions(). */ + struct ofpbuf put_actions; /* Actions 'put' in the fastapath. */ + + struct dpif_ipfix *ipfix; /* IPFIX pointer or NULL. */ + struct dpif_sflow *sflow; /* SFlow pointer or NULL. */ + + bool vsp_adjusted; /* 'packet' and 'flow' were adjusted for + VLAN splinters if true. */ + + struct udpif_key *ukey; /* Revalidator flow cache. */ + bool ukey_persists; /* Set true to keep 'ukey' beyond the + lifetime of this upcall. */ + + uint64_t dump_seq; /* udpif->dump_seq at translation time. */ + uint64_t reval_seq; /* udpif->reval_seq at translation time. */ - /* Raw upcall plus data for keeping track of the memory backing it. */ - struct dpif_upcall dpif_upcall; /* As returned by dpif_recv() */ - struct ofpbuf upcall_buf; /* Owns some data in 'dpif_upcall'. */ - uint64_t upcall_stub[512 / 8]; /* Buffer to reduce need for malloc(). */ + /* Not used by the upcall callback interface. */ + const struct nlattr *key; /* Datapath flow key. */ + size_t key_len; /* Datapath flow key length. */ + const struct nlattr *out_tun_key; /* Datapath output tunnel key. */ }; /* 'udpif_key's are responsible for tracking the little bit of state udpif * needs to do flow expiration which can't be pulled directly from the - * datapath. They may be created or maintained by any revalidator during - * the dump phase, but are owned by a single revalidator, and are destroyed - * by that revalidator during the garbage-collection phase. + * datapath. They may be created by any handler or revalidator thread at any + * time, and read by any revalidator during the dump phase. They are however + * each owned by a single revalidator which takes care of destroying them + * during the garbage-collection phase. * - * While some elements of a udpif_key are protected by a mutex, the ukey itself - * is not. Therefore it is not safe to destroy a udpif_key except when all - * revalidators are in garbage collection phase, or they aren't running. */ + * The mutex within the ukey protects some members of the ukey. The ukey + * itself is protected by RCU and is held within a umap in the parent udpif. + * Adding or removing a ukey from a umap is only safe when holding the + * corresponding umap lock. */ struct udpif_key { - struct hmap_node hmap_node; /* In parent revalidator 'ukeys' map. */ + struct cmap_node cmap_node; /* In parent revalidator 'ukeys' map. */ /* These elements are read only once created, and therefore aren't * protected by a mutex. */ const struct nlattr *key; /* Datapath flow key. */ size_t key_len; /* Length of 'key'. */ + const struct nlattr *mask; /* Datapath flow mask. */ + size_t mask_len; /* Length of 'mask'. */ + struct ofpbuf *actions; /* Datapath flow actions as nlattrs. */ + ovs_u128 ufid; /* Unique flow identifier. */ + bool ufid_present; /* True if 'ufid' is in datapath. */ + uint32_t hash; /* Pre-computed hash for 'key'. */ + unsigned pmd_id; /* Datapath poll mode driver id. */ struct ovs_mutex mutex; /* Guards the following. */ struct dpif_flow_stats stats OVS_GUARDED; /* Last known stats.*/ long long int created OVS_GUARDED; /* Estimate of creation time. */ - bool mark OVS_GUARDED; /* For mark and sweep garbage - collection. */ + uint64_t dump_seq OVS_GUARDED; /* Tracks udpif->dump_seq. */ + uint64_t reval_seq OVS_GUARDED; /* Tracks udpif->reval_seq. */ bool flow_exists OVS_GUARDED; /* Ensures flows are only deleted once. */ struct xlate_cache *xcache OVS_GUARDED; /* Cache for xlate entries that * are affected by this ukey. * Used for stats and learning.*/ - struct odputil_keybuf key_buf; /* Memory for 'key'. */ + union { + struct odputil_keybuf buf; + struct nlattr nla; + } keybuf, maskbuf; + + /* Recirculation IDs with references held by the ukey. */ + unsigned n_recircs; + uint32_t recircs[]; /* 'n_recircs' id's for which references are held. */ }; -/* Flow miss batching. - * - * Some dpifs implement operations faster when you hand them off in a batch. - * To allow batching, "struct flow_miss" queues the dpif-related work needed - * for a given flow. Each "struct flow_miss" corresponds to sending one or - * more packets, plus possibly installing the flow in the dpif. */ -struct flow_miss { - struct hmap_node hmap_node; - struct ofproto_dpif *ofproto; - - struct flow flow; - const struct nlattr *key; - size_t key_len; - enum dpif_upcall_type upcall_type; - struct dpif_flow_stats stats; - odp_port_t odp_in_port; - - uint64_t slow_path_buf[128 / 8]; - struct odputil_keybuf mask_buf; - - struct xlate_out xout; - - bool put; +/* Datapath operation with optional ukey attached. */ +struct ukey_op { + struct udpif_key *ukey; + struct dpif_flow_stats stats; /* Stats for 'op'. */ + struct dpif_op dop; /* Flow operation. */ }; static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); -static struct list all_udpifs = LIST_INITIALIZER(&all_udpifs); +static struct ovs_list all_udpifs = OVS_LIST_INITIALIZER(&all_udpifs); -static size_t read_upcalls(struct handler *, - struct upcall upcalls[FLOW_MISS_MAX_BATCH], - struct flow_miss miss_buf[FLOW_MISS_MAX_BATCH], - struct hmap *); -static void handle_upcalls(struct handler *, struct hmap *, struct upcall *, - size_t n_upcalls); +static size_t recv_upcalls(struct handler *); +static int process_upcall(struct udpif *, struct upcall *, + struct ofpbuf *odp_actions); +static void handle_upcalls(struct udpif *, struct upcall *, size_t n_upcalls); static void udpif_stop_threads(struct udpif *); static void udpif_start_threads(struct udpif *, size_t n_handlers, size_t n_revalidators); @@ -228,14 +266,43 @@ const char *argv[], void *aux); static void upcall_unixctl_enable_megaflows(struct unixctl_conn *, int argc, const char *argv[], void *aux); +static void upcall_unixctl_disable_ufid(struct unixctl_conn *, int argc, + const char *argv[], void *aux); +static void upcall_unixctl_enable_ufid(struct unixctl_conn *, int argc, + const char *argv[], void *aux); static void upcall_unixctl_set_flow_limit(struct unixctl_conn *conn, int argc, const char *argv[], void *aux); +static void upcall_unixctl_dump_wait(struct unixctl_conn *conn, int argc, + const char *argv[], void *aux); +static void upcall_unixctl_purge(struct unixctl_conn *conn, int argc, + const char *argv[], void *aux); + +static struct udpif_key *ukey_create_from_upcall(struct upcall *); +static int ukey_create_from_dpif_flow(const struct udpif *, + const struct dpif_flow *, + struct udpif_key **); +static bool ukey_install_start(struct udpif *, struct udpif_key *ukey); +static bool ukey_install_finish(struct udpif_key *ukey, int error); +static bool ukey_install(struct udpif *udpif, struct udpif_key *ukey); +static struct udpif_key *ukey_lookup(struct udpif *udpif, + const ovs_u128 *ufid); +static int ukey_acquire(struct udpif *, const struct dpif_flow *, + struct udpif_key **result, int *error); +static void ukey_delete__(struct udpif_key *); +static void ukey_delete(struct umap *, struct udpif_key *); +static enum upcall_type classify_upcall(enum dpif_upcall_type type, + const struct nlattr *userdata); + +static int upcall_receive(struct upcall *, const struct dpif_backer *, + const struct dp_packet *packet, enum dpif_upcall_type, + const struct nlattr *userdata, const struct flow *, + const ovs_u128 *ufid, const unsigned pmd_id); +static void upcall_uninit(struct upcall *); -static struct udpif_key *ukey_create(const struct nlattr *key, size_t key_len, - long long int used); -static void ukey_delete(struct revalidator *, struct udpif_key *); +static upcall_callback upcall_cb; static atomic_bool enable_megaflows = ATOMIC_VAR_INIT(true); +static atomic_bool enable_ufid = ATOMIC_VAR_INIT(true); struct udpif * udpif_create(struct dpif_backer *backer, struct dpif *dpif) @@ -250,31 +317,68 @@ upcall_unixctl_disable_megaflows, NULL); unixctl_command_register("upcall/enable-megaflows", "", 0, 0, upcall_unixctl_enable_megaflows, NULL); + unixctl_command_register("upcall/disable-ufid", "", 0, 0, + upcall_unixctl_disable_ufid, NULL); + unixctl_command_register("upcall/enable-ufid", "", 0, 0, + upcall_unixctl_enable_ufid, NULL); unixctl_command_register("upcall/set-flow-limit", "", 1, 1, upcall_unixctl_set_flow_limit, NULL); + unixctl_command_register("revalidator/wait", "", 0, 0, + upcall_unixctl_dump_wait, NULL); + unixctl_command_register("revalidator/purge", "", 0, 0, + upcall_unixctl_purge, NULL); ovsthread_once_done(&once); } udpif->dpif = dpif; udpif->backer = backer; atomic_init(&udpif->flow_limit, MIN(ofproto_flow_limit, 10000)); - udpif->secret = random_uint32(); udpif->reval_seq = seq_create(); udpif->dump_seq = seq_create(); latch_init(&udpif->exit_latch); list_push_back(&all_udpifs, &udpif->list_node); + atomic_init(&udpif->enable_ufid, false); atomic_init(&udpif->n_flows, 0); atomic_init(&udpif->n_flows_timestamp, LLONG_MIN); ovs_mutex_init(&udpif->n_flows_mutex); + udpif->ukeys = xmalloc(N_UMAPS * sizeof *udpif->ukeys); + for (int i = 0; i < N_UMAPS; i++) { + cmap_init(&udpif->ukeys[i].cmap); + ovs_mutex_init(&udpif->ukeys[i].mutex); + } + + dpif_register_upcall_cb(dpif, upcall_cb, udpif); return udpif; } void +udpif_run(struct udpif *udpif) +{ + if (udpif->conns && udpif->conn_seq != seq_read(udpif->dump_seq)) { + int i; + + for (i = 0; i < udpif->n_conns; i++) { + unixctl_command_reply(udpif->conns[i], NULL); + } + free(udpif->conns); + udpif->conns = NULL; + udpif->n_conns = 0; + } +} + +void udpif_destroy(struct udpif *udpif) { udpif_stop_threads(udpif); + for (int i = 0; i < N_UMAPS; i++) { + cmap_destroy(&udpif->ukeys[i].cmap); + ovs_mutex_destroy(&udpif->ukeys[i].mutex); + } + free(udpif->ukeys); + udpif->ukeys = NULL; + list_remove(&udpif->list_node); latch_destroy(&udpif->exit_latch); seq_destroy(udpif->reval_seq); @@ -303,15 +407,14 @@ xpthread_join(udpif->revalidators[i].thread, NULL); } + dpif_disable_upcall(udpif->dpif); + for (i = 0; i < udpif->n_revalidators; i++) { struct revalidator *revalidator = &udpif->revalidators[i]; /* Delete ukeys, and delete all flows from the datapath to prevent * double-counting stats. */ revalidator_purge(revalidator); - - hmap_destroy(&udpif->ukeys[i].hmap); - ovs_mutex_destroy(&udpif->ukeys[i].mutex); } latch_poll(&udpif->exit_latch); @@ -325,9 +428,6 @@ free(udpif->handlers); udpif->handlers = NULL; udpif->n_handlers = 0; - - free(udpif->ukeys); - udpif->ukeys = NULL; } } @@ -339,6 +439,7 @@ { if (udpif && n_handlers && n_revalidators) { size_t i; + bool enable_ufid; udpif->n_handlers = n_handlers; udpif->n_revalidators = n_revalidators; @@ -353,18 +454,18 @@ "handler", udpif_upcall_handler, handler); } + enable_ufid = ofproto_dpif_get_enable_ufid(udpif->backer); + atomic_init(&udpif->enable_ufid, enable_ufid); + dpif_enable_upcall(udpif->dpif); + ovs_barrier_init(&udpif->reval_barrier, udpif->n_revalidators); udpif->reval_exit = false; udpif->revalidators = xzalloc(udpif->n_revalidators * sizeof *udpif->revalidators); - udpif->ukeys = xmalloc(sizeof *udpif->ukeys * n_revalidators); for (i = 0; i < udpif->n_revalidators; i++) { struct revalidator *revalidator = &udpif->revalidators[i]; revalidator->udpif = udpif; - hmap_init(&udpif->ukeys[i].hmap); - ovs_mutex_init(&udpif->ukeys[i].mutex); - revalidator->ukeys = &udpif->ukeys[i].hmap; revalidator->thread = ovs_thread_create( "revalidator", udpif_revalidator, revalidator); } @@ -447,10 +548,8 @@ simap_increase(usage, "handlers", udpif->n_handlers); simap_increase(usage, "revalidators", udpif->n_revalidators); - for (i = 0; i < udpif->n_revalidators; i++) { - ovs_mutex_lock(&udpif->ukeys[i].mutex); - simap_increase(usage, "udpif keys", hmap_count(&udpif->ukeys[i].hmap)); - ovs_mutex_unlock(&udpif->ukeys[i].mutex); + for (i = 0; i < N_UMAPS; i++) { + simap_increase(usage, "udpif keys", cmap_count(&udpif->ukeys[i].cmap)); } } @@ -483,6 +582,15 @@ } } +static bool +udpif_use_ufid(struct udpif *udpif) +{ + bool enable; + + atomic_read_relaxed(&enable_ufid, &enable); + return enable && ofproto_dpif_get_enable_ufid(udpif->backer); +} + static unsigned long udpif_get_n_flows(struct udpif *udpif) @@ -491,22 +599,22 @@ unsigned long flow_count; now = time_msec(); - atomic_read(&udpif->n_flows_timestamp, &time); + atomic_read_relaxed(&udpif->n_flows_timestamp, &time); if (time < now - 100 && !ovs_mutex_trylock(&udpif->n_flows_mutex)) { struct dpif_dp_stats stats; - atomic_store(&udpif->n_flows_timestamp, now); + atomic_store_relaxed(&udpif->n_flows_timestamp, now); dpif_get_dp_stats(udpif->dpif, &stats); flow_count = stats.n_flows; - atomic_store(&udpif->n_flows, flow_count); + atomic_store_relaxed(&udpif->n_flows, flow_count); ovs_mutex_unlock(&udpif->n_flows_mutex); } else { - atomic_read(&udpif->n_flows, &flow_count); + atomic_read_relaxed(&udpif->n_flows, &flow_count); } return flow_count; } -/* The upcall handler thread tries to read a batch of FLOW_MISS_MAX_BATCH +/* The upcall handler thread tries to read a batch of UPCALL_MAX_BATCH * upcalls from dpif, processes the batch and installs corresponding flows * in dpif. */ static void * @@ -514,36 +622,107 @@ { struct handler *handler = arg; struct udpif *udpif = handler->udpif; - struct hmap misses = HMAP_INITIALIZER(&misses); while (!latch_is_set(&handler->udpif->exit_latch)) { - struct upcall upcalls[FLOW_MISS_MAX_BATCH]; - struct flow_miss miss_buf[FLOW_MISS_MAX_BATCH]; - struct flow_miss *miss; - size_t n_upcalls, i; - - n_upcalls = read_upcalls(handler, upcalls, miss_buf, &misses); - if (!n_upcalls) { + if (recv_upcalls(handler)) { + poll_immediate_wake(); + } else { dpif_recv_wait(udpif->dpif, handler->handler_id); latch_wait(&udpif->exit_latch); - poll_block(); - } else { - handle_upcalls(handler, &misses, upcalls, n_upcalls); + } + poll_block(); + } - HMAP_FOR_EACH (miss, hmap_node, &misses) { - xlate_out_uninit(&miss->xout); - } - hmap_clear(&misses); - for (i = 0; i < n_upcalls; i++) { - ofpbuf_uninit(&upcalls[i].dpif_upcall.packet); - ofpbuf_uninit(&upcalls[i].upcall_buf); + return NULL; +} + +static size_t +recv_upcalls(struct handler *handler) +{ + struct udpif *udpif = handler->udpif; + uint64_t recv_stubs[UPCALL_MAX_BATCH][512 / 8]; + struct ofpbuf recv_bufs[UPCALL_MAX_BATCH]; + struct dpif_upcall dupcalls[UPCALL_MAX_BATCH]; + struct upcall upcalls[UPCALL_MAX_BATCH]; + struct flow flows[UPCALL_MAX_BATCH]; + size_t n_upcalls, i; + + n_upcalls = 0; + while (n_upcalls < UPCALL_MAX_BATCH) { + struct ofpbuf *recv_buf = &recv_bufs[n_upcalls]; + struct dpif_upcall *dupcall = &dupcalls[n_upcalls]; + struct upcall *upcall = &upcalls[n_upcalls]; + struct flow *flow = &flows[n_upcalls]; + int error; + + ofpbuf_use_stub(recv_buf, recv_stubs[n_upcalls], + sizeof recv_stubs[n_upcalls]); + if (dpif_recv(udpif->dpif, handler->handler_id, dupcall, recv_buf)) { + ofpbuf_uninit(recv_buf); + break; + } + + if (odp_flow_key_to_flow(dupcall->key, dupcall->key_len, flow) + == ODP_FIT_ERROR) { + goto free_dupcall; + } + + error = upcall_receive(upcall, udpif->backer, &dupcall->packet, + dupcall->type, dupcall->userdata, flow, + &dupcall->ufid, PMD_ID_NULL); + if (error) { + if (error == ENODEV) { + /* Received packet on datapath port for which we couldn't + * associate an ofproto. This can happen if a port is removed + * while traffic is being received. Print a rate-limited + * message in case it happens frequently. */ + dpif_flow_put(udpif->dpif, DPIF_FP_CREATE, dupcall->key, + dupcall->key_len, NULL, 0, NULL, 0, + &dupcall->ufid, PMD_ID_NULL, NULL); + VLOG_INFO_RL(&rl, "received packet on unassociated datapath " + "port %"PRIu32, flow->in_port.odp_port); } + goto free_dupcall; + } + + upcall->key = dupcall->key; + upcall->key_len = dupcall->key_len; + upcall->ufid = &dupcall->ufid; + + upcall->out_tun_key = dupcall->out_tun_key; + + if (vsp_adjust_flow(upcall->ofproto, flow, &dupcall->packet)) { + upcall->vsp_adjusted = true; + } + + pkt_metadata_from_flow(&dupcall->packet.md, flow); + flow_extract(&dupcall->packet, flow); + + error = process_upcall(udpif, upcall, NULL); + if (error) { + goto cleanup; } - coverage_clear(); + + n_upcalls++; + continue; + +cleanup: + upcall_uninit(upcall); +free_dupcall: + dp_packet_uninit(&dupcall->packet); + ofpbuf_uninit(recv_buf); } - hmap_destroy(&misses); - return NULL; + if (n_upcalls) { + handle_upcalls(handler->udpif, upcalls, n_upcalls); + for (i = 0; i < n_upcalls; i++) { + dp_packet_uninit(&dupcalls[i].packet); + ofpbuf_uninit(&recv_bufs[i]); + upcall_uninit(&upcalls[i]); + } + } + + return n_upcalls; } static void * @@ -557,7 +736,6 @@ /* Used only by the leader. */ long long int start_time = 0; uint64_t last_reval_seq = 0; - unsigned int flow_limit = 0; size_t n_flows = 0; revalidator->id = ovsthread_id_self(); @@ -565,8 +743,9 @@ if (leader) { uint64_t reval_seq; + recirc_run(); /* Recirculation cleanup. */ + reval_seq = seq_read(udpif->reval_seq); - udpif->need_revalidate = last_reval_seq != reval_seq; last_reval_seq = reval_seq; n_flows = udpif_get_n_flows(udpif); @@ -580,7 +759,10 @@ start_time = time_msec(); if (!udpif->reval_exit) { - dpif_flow_dump_start(&udpif->dump, udpif->dpif); + bool terse_dump; + + terse_dump = udpif_use_ufid(udpif); + udpif->dump = dpif_flow_dump_create(udpif->dpif, terse_dump); } } @@ -599,13 +781,15 @@ ovs_barrier_block(&udpif->reval_barrier); if (leader) { + unsigned int flow_limit; long long int duration; - dpif_flow_dump_done(&udpif->dump); + atomic_read_relaxed(&udpif->flow_limit, &flow_limit); + + dpif_flow_dump_destroy(udpif->dump); seq_change(udpif->dump_seq); duration = MAX(time_msec() - start_time, 1); - atomic_read(&udpif->flow_limit, &flow_limit); udpif->dump_duration = duration; if (duration > 2000) { flow_limit /= duration / 1000; @@ -616,7 +800,7 @@ flow_limit += 1000; } flow_limit = MIN(ofproto_flow_limit, MAX(flow_limit, 1000)); - atomic_store(&udpif->flow_limit, flow_limit); + atomic_store_relaxed(&udpif->flow_limit, flow_limit); if (duration > 2000) { VLOG_INFO("Spent an unreasonably long %lldms dumping flows", @@ -634,14 +818,13 @@ } static enum upcall_type -classify_upcall(const struct upcall *upcall) +classify_upcall(enum dpif_upcall_type type, const struct nlattr *userdata) { - const struct dpif_upcall *dpif_upcall = &upcall->dpif_upcall; union user_action_cookie cookie; size_t userdata_len; /* First look at the upcall type. */ - switch (dpif_upcall->type) { + switch (type) { case DPIF_UC_ACTION: break; @@ -650,17 +833,16 @@ case DPIF_N_UC_TYPES: default: - VLOG_WARN_RL(&rl, "upcall has unexpected type %"PRIu32, - dpif_upcall->type); + VLOG_WARN_RL(&rl, "upcall has unexpected type %"PRIu32, type); return BAD_UPCALL; } /* "action" upcalls need a closer look. */ - if (!dpif_upcall->userdata) { + if (!userdata) { VLOG_WARN_RL(&rl, "action upcall missing cookie"); return BAD_UPCALL; } - userdata_len = nl_attr_get_size(dpif_upcall->userdata); + userdata_len = nl_attr_get_size(userdata); if (userdata_len < sizeof cookie.type || userdata_len > sizeof cookie) { VLOG_WARN_RL(&rl, "action upcall cookie has unexpected size %"PRIuSIZE, @@ -668,7 +850,7 @@ return BAD_UPCALL; } memset(&cookie, 0, sizeof cookie); - memcpy(&cookie, nl_attr_get(dpif_upcall->userdata), userdata_len); + memcpy(&cookie, nl_attr_get(userdata), userdata_len); if (userdata_len == MAX(8, sizeof cookie.sflow) && cookie.type == USER_ACTION_COOKIE_SFLOW) { return SFLOW_UPCALL; @@ -692,7 +874,7 @@ * initialized with at least 128 bytes of space. */ static void compose_slow_path(struct udpif *udpif, struct xlate_out *xout, - struct flow *flow, odp_port_t odp_in_port, + const struct flow *flow, odp_port_t odp_in_port, struct ofpbuf *buf) { union user_action_cookie cookie; @@ -707,234 +889,304 @@ ? ODPP_NONE : odp_in_port; pid = dpif_port_get_pid(udpif->dpif, port, flow_hash_5tuple(flow, 0)); - odp_put_userspace_action(pid, &cookie, sizeof cookie.slow_path, buf); + odp_put_userspace_action(pid, &cookie, sizeof cookie.slow_path, ODPP_NONE, + buf); } -static struct flow_miss * -flow_miss_find(struct hmap *todo, const struct ofproto_dpif *ofproto, - const struct flow *flow, uint32_t hash) +/* If there is no error, the upcall must be destroyed with upcall_uninit() + * before quiescing, as the referred objects are guaranteed to exist only + * until the calling thread quiesces. Otherwise, do not call upcall_uninit() + * since the 'upcall->put_actions' remains uninitialized. */ +static int +upcall_receive(struct upcall *upcall, const struct dpif_backer *backer, + const struct dp_packet *packet, enum dpif_upcall_type type, + const struct nlattr *userdata, const struct flow *flow, + const ovs_u128 *ufid, const unsigned pmd_id) { - struct flow_miss *miss; + int error; - HMAP_FOR_EACH_WITH_HASH (miss, hmap_node, hash, todo) { - if (miss->ofproto == ofproto && flow_equal(&miss->flow, flow)) { - return miss; - } + error = xlate_lookup(backer, flow, &upcall->ofproto, &upcall->ipfix, + &upcall->sflow, NULL, &upcall->in_port); + if (error) { + return error; } - return NULL; + upcall->recirc = NULL; + upcall->have_recirc_ref = false; + upcall->flow = flow; + upcall->packet = packet; + upcall->ufid = ufid; + upcall->pmd_id = pmd_id; + upcall->type = type; + upcall->userdata = userdata; + ofpbuf_init(&upcall->put_actions, 0); + + upcall->xout_initialized = false; + upcall->vsp_adjusted = false; + upcall->ukey_persists = false; + + upcall->ukey = NULL; + upcall->key = NULL; + upcall->key_len = 0; + + upcall->out_tun_key = NULL; + + return 0; } -/* Reads and classifies upcalls. Returns the number of upcalls successfully - * read. */ -static size_t -read_upcalls(struct handler *handler, - struct upcall upcalls[FLOW_MISS_MAX_BATCH], - struct flow_miss miss_buf[FLOW_MISS_MAX_BATCH], - struct hmap *misses) +static void +upcall_xlate(struct udpif *udpif, struct upcall *upcall, + struct ofpbuf *odp_actions) { - struct udpif *udpif = handler->udpif; - size_t i; - size_t n_misses = 0; - size_t n_upcalls = 0; + struct dpif_flow_stats stats; + struct xlate_in xin; - /* - * Try reading FLOW_MISS_MAX_BATCH upcalls from dpif. - * - * Extract the flow from each upcall. Construct in 'misses' a hash table - * that maps each unique flow to a 'struct flow_miss'. - * - * Most commonly there is a single packet per flow_miss, but there are - * several reasons why there might be more than one, e.g.: + stats.n_packets = 1; + stats.n_bytes = dp_packet_size(upcall->packet); + stats.used = time_msec(); + stats.tcp_flags = ntohs(upcall->flow->tcp_flags); + + xlate_in_init(&xin, upcall->ofproto, upcall->flow, upcall->in_port, NULL, + stats.tcp_flags, upcall->packet); + xin.odp_actions = odp_actions; + + if (upcall->type == DPIF_UC_MISS) { + xin.resubmit_stats = &stats; + + if (xin.recirc) { + /* We may install a datapath flow only if we get a reference to the + * recirculation context (otherwise we could have recirculation + * upcalls using recirculation ID for which no context can be + * found). We may still execute the flow's actions even if we + * don't install the flow. */ + upcall->recirc = xin.recirc; + upcall->have_recirc_ref = recirc_id_node_try_ref_rcu(xin.recirc); + } + } else { + /* For non-miss upcalls, we are either executing actions (one of which + * is an userspace action) for an upcall, in which case the stats have + * already been taken care of, or there's a flow in the datapath which + * this packet was accounted to. Presumably the revalidators will deal + * with pushing its stats eventually. */ + } + + upcall->dump_seq = seq_read(udpif->dump_seq); + upcall->reval_seq = seq_read(udpif->reval_seq); + xlate_actions(&xin, &upcall->xout); + upcall->xout_initialized = true; + + /* Special case for fail-open mode. * - * - The dpif packet interface does not support TSO (or UFO, etc.), so a - * large packet sent to userspace is split into a sequence of smaller - * ones. + * If we are in fail-open mode, but we are connected to a controller too, + * then we should send the packet up to the controller in the hope that it + * will try to set up a flow and thereby allow us to exit fail-open. * - * - A stream of quickly arriving packets in an established "slow-pathed" - * flow. + * See the top-level comment in fail-open.c for more information. * - * - Rarely, a stream of quickly arriving packets in a flow not yet - * established. (This is rare because most protocols do not send - * multiple back-to-back packets before receiving a reply from the - * other end of the connection, which gives OVS a chance to set up a - * datapath flow.) - */ - for (i = 0; i < FLOW_MISS_MAX_BATCH; i++) { - struct upcall *upcall = &upcalls[n_upcalls]; - struct flow_miss *miss = &miss_buf[n_misses]; - struct dpif_upcall *dupcall; - struct ofpbuf *packet; - struct flow_miss *existing_miss; - struct ofproto_dpif *ofproto; - struct dpif_sflow *sflow; - struct dpif_ipfix *ipfix; - struct flow flow; - enum upcall_type type; - odp_port_t odp_in_port; - int error; + * Copy packets before they are modified by execution. */ + if (upcall->xout.fail_open) { + const struct dp_packet *packet = upcall->packet; + struct ofproto_packet_in *pin; + + pin = xmalloc(sizeof *pin); + pin->up.packet = xmemdup(dp_packet_data(packet), dp_packet_size(packet)); + pin->up.packet_len = dp_packet_size(packet); + pin->up.reason = OFPR_NO_MATCH; + pin->up.table_id = 0; + pin->up.cookie = OVS_BE64_MAX; + flow_get_metadata(upcall->flow, &pin->up.flow_metadata); + pin->send_len = 0; /* Not used for flow table misses. */ + pin->miss_type = OFPROTO_PACKET_IN_NO_MISS; + ofproto_dpif_send_packet_in(upcall->ofproto, pin); + } + + if (!upcall->xout.slow) { + ofpbuf_use_const(&upcall->put_actions, + upcall->xout.odp_actions->data, + upcall->xout.odp_actions->size); + } else { + ofpbuf_init(&upcall->put_actions, 0); + compose_slow_path(udpif, &upcall->xout, upcall->flow, + upcall->flow->in_port.odp_port, + &upcall->put_actions); + } - ofpbuf_use_stub(&upcall->upcall_buf, upcall->upcall_stub, - sizeof upcall->upcall_stub); - error = dpif_recv(udpif->dpif, handler->handler_id, - &upcall->dpif_upcall, &upcall->upcall_buf); - if (error) { - ofpbuf_uninit(&upcall->upcall_buf); - break; - } + /* This function is also called for slow-pathed flows. As we are only + * going to create new datapath flows for actual datapath misses, there is + * no point in creating a ukey otherwise. */ + if (upcall->type == DPIF_UC_MISS) { + upcall->ukey = ukey_create_from_upcall(upcall); + } +} - dupcall = &upcall->dpif_upcall; - packet = &dupcall->packet; - error = xlate_receive(udpif->backer, packet, dupcall->key, - dupcall->key_len, &flow, - &ofproto, &ipfix, &sflow, NULL, &odp_in_port); - if (error) { - if (error == ENODEV) { - /* Received packet on datapath port for which we couldn't - * associate an ofproto. This can happen if a port is removed - * while traffic is being received. Print a rate-limited - * message in case it happens frequently. Install a drop flow - * so that future packets of the flow are inexpensively dropped - * in the kernel. */ - VLOG_INFO_RL(&rl, "received packet on unassociated datapath " - "port %"PRIu32, odp_in_port); - dpif_flow_put(udpif->dpif, DPIF_FP_CREATE, - dupcall->key, dupcall->key_len, NULL, 0, NULL, 0, - NULL); +static void +upcall_uninit(struct upcall *upcall) +{ + if (upcall) { + if (upcall->xout_initialized) { + xlate_out_uninit(&upcall->xout); + } + ofpbuf_uninit(&upcall->put_actions); + if (upcall->ukey) { + if (!upcall->ukey_persists) { + ukey_delete__(upcall->ukey); } - goto destroy_upcall; + } else if (upcall->have_recirc_ref) { + /* The reference was transferred to the ukey if one was created. */ + recirc_id_node_unref(upcall->recirc); } + } +} - type = classify_upcall(upcall); - if (type == MISS_UPCALL) { - uint32_t hash; - struct pkt_metadata md = pkt_metadata_from_flow(&flow); - - flow_extract(packet, &md, &miss->flow); - hash = flow_hash(&miss->flow, 0); - existing_miss = flow_miss_find(misses, ofproto, &miss->flow, - hash); - if (!existing_miss) { - hmap_insert(misses, &miss->hmap_node, hash); - miss->ofproto = ofproto; - miss->key = dupcall->key; - miss->key_len = dupcall->key_len; - miss->upcall_type = dupcall->type; - miss->stats.n_packets = 0; - miss->stats.n_bytes = 0; - miss->stats.used = time_msec(); - miss->stats.tcp_flags = 0; - miss->odp_in_port = odp_in_port; - miss->put = false; - n_misses++; - } else { - miss = existing_miss; - } - miss->stats.tcp_flags |= ntohs(miss->flow.tcp_flags); - miss->stats.n_bytes += ofpbuf_size(packet); - miss->stats.n_packets++; - - upcall->flow_miss = miss; - n_upcalls++; - continue; - } - - switch (type) { - case SFLOW_UPCALL: - if (sflow) { - union user_action_cookie cookie; - - memset(&cookie, 0, sizeof cookie); - memcpy(&cookie, nl_attr_get(dupcall->userdata), - sizeof cookie.sflow); - dpif_sflow_received(sflow, packet, &flow, odp_in_port, - &cookie); - } - break; - case IPFIX_UPCALL: - if (ipfix) { - dpif_ipfix_bridge_sample(ipfix, packet, &flow); - } - break; - case FLOW_SAMPLE_UPCALL: - if (ipfix) { - union user_action_cookie cookie; - - memset(&cookie, 0, sizeof cookie); - memcpy(&cookie, nl_attr_get(dupcall->userdata), - sizeof cookie.flow_sample); - - /* The flow reflects exactly the contents of the packet. - * Sample the packet using it. */ - dpif_ipfix_flow_sample(ipfix, packet, &flow, - cookie.flow_sample.collector_set_id, - cookie.flow_sample.probability, - cookie.flow_sample.obs_domain_id, - cookie.flow_sample.obs_point_id); - } - break; - case BAD_UPCALL: - break; - case MISS_UPCALL: - OVS_NOT_REACHED(); +static int +upcall_cb(const struct dp_packet *packet, const struct flow *flow, ovs_u128 *ufid, + unsigned pmd_id, enum dpif_upcall_type type, + const struct nlattr *userdata, struct ofpbuf *actions, + struct flow_wildcards *wc, struct ofpbuf *put_actions, void *aux) +{ + struct udpif *udpif = aux; + unsigned int flow_limit; + struct upcall upcall; + bool megaflow; + int error; + + atomic_read_relaxed(&enable_megaflows, &megaflow); + atomic_read_relaxed(&udpif->flow_limit, &flow_limit); + + error = upcall_receive(&upcall, udpif->backer, packet, type, userdata, + flow, ufid, pmd_id); + if (error) { + return error; + } + + error = process_upcall(udpif, &upcall, actions); + if (error) { + goto out; + } + + if (upcall.xout.slow && put_actions) { + ofpbuf_put(put_actions, upcall.put_actions.data, + upcall.put_actions.size); + } + + if (OVS_LIKELY(wc)) { + if (megaflow) { + /* XXX: This could be avoided with sufficient API changes. */ + *wc = upcall.xout.wc; + } else { + flow_wildcards_init_for_packet(wc, flow); } + } - dpif_ipfix_unref(ipfix); - dpif_sflow_unref(sflow); + if (udpif_get_n_flows(udpif) >= flow_limit) { + error = ENOSPC; + goto out; + } -destroy_upcall: - ofpbuf_uninit(&upcall->dpif_upcall.packet); - ofpbuf_uninit(&upcall->upcall_buf); + /* Prevent miss flow installation if the key has recirculation ID but we + * were not able to get a reference on it. */ + if (type == DPIF_UC_MISS && upcall.recirc && !upcall.have_recirc_ref) { + error = ENOSPC; + goto out; } - return n_upcalls; + if (upcall.ukey && !ukey_install(udpif, upcall.ukey)) { + error = ENOSPC; + } +out: + if (!error) { + upcall.ukey_persists = true; + } + upcall_uninit(&upcall); + return error; } -static void -handle_upcalls(struct handler *handler, struct hmap *misses, - struct upcall *upcalls, size_t n_upcalls) +static int +process_upcall(struct udpif *udpif, struct upcall *upcall, + struct ofpbuf *odp_actions) { - struct udpif *udpif = handler->udpif; - struct dpif_op *opsp[FLOW_MISS_MAX_BATCH * 2]; - struct dpif_op ops[FLOW_MISS_MAX_BATCH * 2]; - struct flow_miss *miss; - size_t n_ops, i; - unsigned int flow_limit; - bool fail_open, may_put; + const struct nlattr *userdata = upcall->userdata; + const struct dp_packet *packet = upcall->packet; + const struct flow *flow = upcall->flow; - atomic_read(&udpif->flow_limit, &flow_limit); - may_put = udpif_get_n_flows(udpif) < flow_limit; + switch (classify_upcall(upcall->type, userdata)) { + case MISS_UPCALL: + upcall_xlate(udpif, upcall, odp_actions); + return 0; - /* Initialize each 'struct flow_miss's ->xout. - * - * We do this per-flow_miss rather than per-packet because, most commonly, - * all the packets in a flow can use the same translation. - * - * We can't do this in the previous loop because we need the TCP flags for - * all the packets in each miss. */ - fail_open = false; - HMAP_FOR_EACH (miss, hmap_node, misses) { - struct xlate_in xin; + case SFLOW_UPCALL: + if (upcall->sflow) { + union user_action_cookie cookie; - xlate_in_init(&xin, miss->ofproto, &miss->flow, NULL, - miss->stats.tcp_flags, NULL); - xin.may_learn = true; + memset(&cookie, 0, sizeof cookie); + memcpy(&cookie, nl_attr_get(userdata), sizeof cookie.sflow); + dpif_sflow_received(upcall->sflow, packet, flow, + flow->in_port.odp_port, &cookie); + } + break; - if (miss->upcall_type == DPIF_UC_MISS) { - xin.resubmit_stats = &miss->stats; - } else { - /* For non-miss upcalls, there's a flow in the datapath which this - * packet was accounted to. Presumably the revalidators will deal - * with pushing its stats eventually. */ + case IPFIX_UPCALL: + if (upcall->ipfix) { + union user_action_cookie cookie; + struct flow_tnl output_tunnel_key; + + memset(&cookie, 0, sizeof cookie); + memcpy(&cookie, nl_attr_get(userdata), sizeof cookie.ipfix); + + if (upcall->out_tun_key) { + memset(&output_tunnel_key, 0, sizeof output_tunnel_key); + odp_tun_key_from_attr(upcall->out_tun_key, + &output_tunnel_key); + } + dpif_ipfix_bridge_sample(upcall->ipfix, packet, flow, + flow->in_port.odp_port, + cookie.ipfix.output_odp_port, + upcall->out_tun_key ? + &output_tunnel_key : NULL); + } + break; + + case FLOW_SAMPLE_UPCALL: + if (upcall->ipfix) { + union user_action_cookie cookie; + + memset(&cookie, 0, sizeof cookie); + memcpy(&cookie, nl_attr_get(userdata), sizeof cookie.flow_sample); + + /* The flow reflects exactly the contents of the packet. + * Sample the packet using it. */ + dpif_ipfix_flow_sample(upcall->ipfix, packet, flow, + cookie.flow_sample.collector_set_id, + cookie.flow_sample.probability, + cookie.flow_sample.obs_domain_id, + cookie.flow_sample.obs_point_id); } + break; - xlate_actions(&xin, &miss->xout); - fail_open = fail_open || miss->xout.fail_open; + case BAD_UPCALL: + break; } - /* Now handle the packets individually in order of arrival. In the common - * case each packet of a miss can share the same actions, but slow-pathed - * packets need to be translated individually: + return EAGAIN; +} + +static void +handle_upcalls(struct udpif *udpif, struct upcall *upcalls, + size_t n_upcalls) +{ + struct dpif_op *opsp[UPCALL_MAX_BATCH * 2]; + struct ukey_op ops[UPCALL_MAX_BATCH * 2]; + unsigned int flow_limit; + size_t n_ops, n_opsp, i; + bool may_put; + bool megaflow; + + atomic_read_relaxed(&udpif->flow_limit, &flow_limit); + atomic_read_relaxed(&enable_megaflows, &megaflow); + + may_put = udpif_get_n_flows(udpif) < flow_limit; + + /* Handle the packets individually in order of arrival. * * - For SLOW_CFM, SLOW_LACP, SLOW_STP, and SLOW_BFD, translation is what * processes received packets for these protocols. @@ -947,156 +1199,110 @@ n_ops = 0; for (i = 0; i < n_upcalls; i++) { struct upcall *upcall = &upcalls[i]; - struct flow_miss *miss = upcall->flow_miss; - struct ofpbuf *packet = &upcall->dpif_upcall.packet; - struct dpif_op *op; - ovs_be16 flow_vlan_tci; - - /* Save a copy of flow.vlan_tci in case it is changed to - * generate proper mega flow masks for VLAN splinter flows. */ - flow_vlan_tci = miss->flow.vlan_tci; - - if (miss->xout.slow) { - struct xlate_in xin; - - xlate_in_init(&xin, miss->ofproto, &miss->flow, NULL, 0, packet); - xlate_actions_for_side_effects(&xin); - } - - if (miss->flow.in_port.ofp_port - != vsp_realdev_to_vlandev(miss->ofproto, - miss->flow.in_port.ofp_port, - miss->flow.vlan_tci)) { - /* This packet was received on a VLAN splinter port. We - * added a VLAN to the packet to make the packet resemble - * the flow, but the actions were composed assuming that - * the packet contained no VLAN. So, we must remove the - * VLAN header from the packet before trying to execute the - * actions. */ - if (ofpbuf_size(&miss->xout.odp_actions)) { - eth_pop_vlan(packet); + const struct dp_packet *packet = upcall->packet; + struct ukey_op *op; + + if (upcall->vsp_adjusted) { + /* This packet was received on a VLAN splinter port. We added a + * VLAN to the packet to make the packet resemble the flow, but the + * actions were composed assuming that the packet contained no + * VLAN. So, we must remove the VLAN header from the packet before + * trying to execute the actions. */ + if (upcall->xout.odp_actions->size) { + eth_pop_vlan(CONST_CAST(struct dp_packet *, upcall->packet)); } /* Remove the flow vlan tags inserted by vlan splinter logic * to ensure megaflow masks generated match the data path flow. */ - miss->flow.vlan_tci = 0; + CONST_CAST(struct flow *, upcall->flow)->vlan_tci = 0; } /* Do not install a flow into the datapath if: * * - The datapath already has too many flows. * - * - An earlier iteration of this loop already put the same flow. - * * - We received this packet via some flow installed in the kernel - * already. */ - if (may_put - && !miss->put - && upcall->dpif_upcall.type == DPIF_UC_MISS) { - struct ofpbuf mask; - bool megaflow; - - miss->put = true; - - atomic_read(&enable_megaflows, &megaflow); - ofpbuf_use_stack(&mask, &miss->mask_buf, sizeof miss->mask_buf); - if (megaflow) { - size_t max_mpls; - - max_mpls = ofproto_dpif_get_max_mpls_depth(miss->ofproto); - odp_flow_key_from_mask(&mask, &miss->xout.wc.masks, - &miss->flow, UINT32_MAX, max_mpls); - } + * already. + * + * - Upcall was a recirculation but we do not have a reference to + * to the recirculation ID. */ + if (may_put && upcall->type == DPIF_UC_MISS && + (!upcall->recirc || upcall->have_recirc_ref)) { + struct udpif_key *ukey = upcall->ukey; + upcall->ukey_persists = true; op = &ops[n_ops++]; - op->type = DPIF_OP_FLOW_PUT; - op->u.flow_put.flags = DPIF_FP_CREATE; - op->u.flow_put.key = miss->key; - op->u.flow_put.key_len = miss->key_len; - op->u.flow_put.mask = ofpbuf_data(&mask); - op->u.flow_put.mask_len = ofpbuf_size(&mask); - op->u.flow_put.stats = NULL; - - if (!miss->xout.slow) { - op->u.flow_put.actions = ofpbuf_data(&miss->xout.odp_actions); - op->u.flow_put.actions_len = ofpbuf_size(&miss->xout.odp_actions); - } else { - struct ofpbuf buf; - ofpbuf_use_stack(&buf, miss->slow_path_buf, - sizeof miss->slow_path_buf); - compose_slow_path(udpif, &miss->xout, &miss->flow, - miss->odp_in_port, &buf); - op->u.flow_put.actions = ofpbuf_data(&buf); - op->u.flow_put.actions_len = ofpbuf_size(&buf); - } + op->ukey = ukey; + op->dop.type = DPIF_OP_FLOW_PUT; + op->dop.u.flow_put.flags = DPIF_FP_CREATE; + op->dop.u.flow_put.key = ukey->key; + op->dop.u.flow_put.key_len = ukey->key_len; + op->dop.u.flow_put.mask = ukey->mask; + op->dop.u.flow_put.mask_len = ukey->mask_len; + op->dop.u.flow_put.ufid = upcall->ufid; + op->dop.u.flow_put.stats = NULL; + op->dop.u.flow_put.actions = ukey->actions->data; + op->dop.u.flow_put.actions_len = ukey->actions->size; } - /* - * The 'miss' may be shared by multiple upcalls. Restore - * the saved flow vlan_tci field before processing the next - * upcall. */ - miss->flow.vlan_tci = flow_vlan_tci; - - if (ofpbuf_size(&miss->xout.odp_actions)) { - + if (upcall->xout.odp_actions->size) { op = &ops[n_ops++]; - op->type = DPIF_OP_EXECUTE; - op->u.execute.packet = packet; - odp_key_to_pkt_metadata(miss->key, miss->key_len, - &op->u.execute.md); - op->u.execute.actions = ofpbuf_data(&miss->xout.odp_actions); - op->u.execute.actions_len = ofpbuf_size(&miss->xout.odp_actions); - op->u.execute.needs_help = (miss->xout.slow & SLOW_ACTION) != 0; + op->ukey = NULL; + op->dop.type = DPIF_OP_EXECUTE; + op->dop.u.execute.packet = CONST_CAST(struct dp_packet *, packet); + odp_key_to_pkt_metadata(upcall->key, upcall->key_len, + &op->dop.u.execute.packet->md); + op->dop.u.execute.actions = upcall->xout.odp_actions->data; + op->dop.u.execute.actions_len = upcall->xout.odp_actions->size; + op->dop.u.execute.needs_help = (upcall->xout.slow & SLOW_ACTION) != 0; + op->dop.u.execute.probe = false; } } - /* Special case for fail-open mode. - * - * If we are in fail-open mode, but we are connected to a controller too, - * then we should send the packet up to the controller in the hope that it - * will try to set up a flow and thereby allow us to exit fail-open. - * - * See the top-level comment in fail-open.c for more information. + /* Execute batch. * - * Copy packets before they are modified by execution. */ - if (fail_open) { - for (i = 0; i < n_upcalls; i++) { - struct upcall *upcall = &upcalls[i]; - struct flow_miss *miss = upcall->flow_miss; - struct ofpbuf *packet = &upcall->dpif_upcall.packet; - struct ofproto_packet_in *pin; - - pin = xmalloc(sizeof *pin); - pin->up.packet = xmemdup(ofpbuf_data(packet), ofpbuf_size(packet)); - pin->up.packet_len = ofpbuf_size(packet); - pin->up.reason = OFPR_NO_MATCH; - pin->up.table_id = 0; - pin->up.cookie = OVS_BE64_MAX; - flow_get_metadata(&miss->flow, &pin->up.fmd); - pin->send_len = 0; /* Not used for flow table misses. */ - pin->miss_type = OFPROTO_PACKET_IN_NO_MISS; - ofproto_dpif_send_packet_in(miss->ofproto, pin); + * We install ukeys before installing the flows, locking them for exclusive + * access by this thread for the period of installation. This ensures that + * other threads won't attempt to delete the flows as we are creating them. + */ + n_opsp = 0; + for (i = 0; i < n_ops; i++) { + struct udpif_key *ukey = ops[i].ukey; + + if (ukey) { + /* If we can't install the ukey, don't install the flow. */ + if (!ukey_install_start(udpif, ukey)) { + ukey_delete__(ukey); + ops[i].ukey = NULL; + continue; + } } + opsp[n_opsp++] = &ops[i].dop; } - - /* Execute batch. */ + dpif_operate(udpif->dpif, opsp, n_opsp); for (i = 0; i < n_ops; i++) { - opsp[i] = &ops[i]; + if (ops[i].ukey) { + ukey_install_finish(ops[i].ukey, ops[i].dop.error); + } } - dpif_operate(udpif->dpif, opsp, n_ops); } -/* Must be called with udpif->ukeys[hash % udpif->n_revalidators].mutex. */ +static uint32_t +get_ufid_hash(const ovs_u128 *ufid) +{ + return ufid->u32[0]; +} + static struct udpif_key * -ukey_lookup__(struct udpif *udpif, const struct nlattr *key, size_t key_len, - uint32_t hash) +ukey_lookup(struct udpif *udpif, const ovs_u128 *ufid) { struct udpif_key *ukey; - struct hmap *hmap = &udpif->ukeys[hash % udpif->n_revalidators].hmap; + int idx = get_ufid_hash(ufid) % N_UMAPS; + struct cmap *cmap = &udpif->ukeys[idx].cmap; - HMAP_FOR_EACH_WITH_HASH (ukey, hmap_node, hash, hmap) { - if (ukey->key_len == key_len && !memcmp(ukey->key, key, key_len)) { + CMAP_FOR_EACH_WITH_HASH (ukey, cmap_node, get_ufid_hash(ufid), cmap) { + if (ovs_u128_equals(&ukey->ufid, ufid)) { return ukey; } } @@ -1104,74 +1310,290 @@ } static struct udpif_key * -ukey_lookup(struct udpif *udpif, const struct nlattr *key, size_t key_len, - uint32_t hash) +ukey_create__(const struct nlattr *key, size_t key_len, + const struct nlattr *mask, size_t mask_len, + bool ufid_present, const ovs_u128 *ufid, + const unsigned pmd_id, const struct ofpbuf *actions, + uint64_t dump_seq, uint64_t reval_seq, long long int used, + const struct recirc_id_node *key_recirc, struct xlate_out *xout) + OVS_NO_THREAD_SAFETY_ANALYSIS { - struct udpif_key *ukey; - uint32_t idx = hash % udpif->n_revalidators; + unsigned n_recircs = (key_recirc ? 1 : 0) + (xout ? xout->n_recircs : 0); + struct udpif_key *ukey = xmalloc(sizeof *ukey + + n_recircs * sizeof *ukey->recircs); - ovs_mutex_lock(&udpif->ukeys[idx].mutex); - ukey = ukey_lookup__(udpif, key, key_len, hash); - ovs_mutex_unlock(&udpif->ukeys[idx].mutex); + memcpy(&ukey->keybuf, key, key_len); + ukey->key = &ukey->keybuf.nla; + ukey->key_len = key_len; + memcpy(&ukey->maskbuf, mask, mask_len); + ukey->mask = &ukey->maskbuf.nla; + ukey->mask_len = mask_len; + ukey->ufid_present = ufid_present; + ukey->ufid = *ufid; + ukey->pmd_id = pmd_id; + ukey->hash = get_ufid_hash(&ukey->ufid); + ukey->actions = ofpbuf_clone(actions); + + ovs_mutex_init(&ukey->mutex); + ukey->dump_seq = dump_seq; + ukey->reval_seq = reval_seq; + ukey->flow_exists = false; + ukey->created = time_msec(); + memset(&ukey->stats, 0, sizeof ukey->stats); + ukey->stats.used = used; + ukey->xcache = NULL; + ukey->n_recircs = n_recircs; + if (key_recirc) { + ukey->recircs[0] = key_recirc->id; + } + if (xout && xout->n_recircs) { + const uint32_t *act_recircs = xlate_out_get_recircs(xout); + + memcpy(ukey->recircs + (key_recirc ? 1 : 0), act_recircs, + xout->n_recircs * sizeof *ukey->recircs); + xlate_out_take_recircs(xout); + } return ukey; } static struct udpif_key * -ukey_create(const struct nlattr *key, size_t key_len, long long int used) +ukey_create_from_upcall(struct upcall *upcall) { - struct udpif_key *ukey = xmalloc(sizeof *ukey); - ovs_mutex_init(&ukey->mutex); + struct odputil_keybuf keystub, maskstub; + struct ofpbuf keybuf, maskbuf; + bool recirc, megaflow; - ukey->key = (struct nlattr *) &ukey->key_buf; - memcpy(&ukey->key_buf, key, key_len); - ukey->key_len = key_len; + if (upcall->key_len) { + ofpbuf_use_const(&keybuf, upcall->key, upcall->key_len); + } else { + /* dpif-netdev doesn't provide a netlink-formatted flow key in the + * upcall, so convert the upcall's flow here. */ + ofpbuf_use_stack(&keybuf, &keystub, sizeof keystub); + odp_flow_key_from_flow(&keybuf, upcall->flow, &upcall->xout.wc.masks, + upcall->flow->in_port.odp_port, true); + } - ovs_mutex_lock(&ukey->mutex); - ukey->mark = false; + atomic_read_relaxed(&enable_megaflows, &megaflow); + recirc = ofproto_dpif_get_enable_recirc(upcall->ofproto); + ofpbuf_use_stack(&maskbuf, &maskstub, sizeof maskstub); + if (megaflow) { + size_t max_mpls; + + max_mpls = ofproto_dpif_get_max_mpls_depth(upcall->ofproto); + odp_flow_key_from_mask(&maskbuf, &upcall->xout.wc.masks, upcall->flow, + UINT32_MAX, max_mpls, recirc); + } + + return ukey_create__(keybuf.data, keybuf.size, maskbuf.data, maskbuf.size, + true, upcall->ufid, upcall->pmd_id, + &upcall->put_actions, upcall->dump_seq, + upcall->reval_seq, 0, + upcall->have_recirc_ref ? upcall->recirc : NULL, + &upcall->xout); +} + +static int +ukey_create_from_dpif_flow(const struct udpif *udpif, + const struct dpif_flow *flow, + struct udpif_key **ukey) +{ + struct dpif_flow full_flow; + struct ofpbuf actions; + uint64_t dump_seq, reval_seq; + uint64_t stub[DPIF_FLOW_BUFSIZE / 8]; + const struct nlattr *a; + unsigned int left; + + if (!flow->key_len || !flow->actions_len) { + struct ofpbuf buf; + int err; + + /* If the key or actions were not provided by the datapath, fetch the + * full flow. */ + ofpbuf_use_stack(&buf, &stub, sizeof stub); + err = dpif_flow_get(udpif->dpif, NULL, 0, &flow->ufid, + flow->pmd_id, &buf, &full_flow); + if (err) { + return err; + } + flow = &full_flow; + } + + /* Check the flow actions for recirculation action. As recirculation + * relies on OVS userspace internal state, we need to delete all old + * datapath flows with recirculation upon OVS restart. */ + NL_ATTR_FOR_EACH_UNSAFE (a, left, flow->actions, flow->actions_len) { + if (nl_attr_type(a) == OVS_ACTION_ATTR_RECIRC) { + return EINVAL; + } + } + + dump_seq = seq_read(udpif->dump_seq); + reval_seq = seq_read(udpif->reval_seq); + ofpbuf_use_const(&actions, &flow->actions, flow->actions_len); + *ukey = ukey_create__(flow->key, flow->key_len, + flow->mask, flow->mask_len, flow->ufid_present, + &flow->ufid, flow->pmd_id, &actions, dump_seq, + reval_seq, flow->stats.used, NULL, NULL); + + return 0; +} + +/* Attempts to insert a ukey into the shared ukey maps. + * + * On success, returns true, installs the ukey and returns it in a locked + * state. Otherwise, returns false. */ +static bool +ukey_install_start(struct udpif *udpif, struct udpif_key *new_ukey) + OVS_TRY_LOCK(true, new_ukey->mutex) +{ + struct umap *umap; + struct udpif_key *old_ukey; + uint32_t idx; + bool locked = false; + + idx = new_ukey->hash % N_UMAPS; + umap = &udpif->ukeys[idx]; + ovs_mutex_lock(&umap->mutex); + old_ukey = ukey_lookup(udpif, &new_ukey->ufid); + if (old_ukey) { + /* Uncommon case: A ukey is already installed with the same UFID. */ + if (old_ukey->key_len == new_ukey->key_len + && !memcmp(old_ukey->key, new_ukey->key, new_ukey->key_len)) { + COVERAGE_INC(handler_duplicate_upcall); + } else { + struct ds ds = DS_EMPTY_INITIALIZER; + + odp_format_ufid(&old_ukey->ufid, &ds); + ds_put_cstr(&ds, " "); + odp_flow_key_format(old_ukey->key, old_ukey->key_len, &ds); + ds_put_cstr(&ds, "\n"); + odp_format_ufid(&new_ukey->ufid, &ds); + ds_put_cstr(&ds, " "); + odp_flow_key_format(new_ukey->key, new_ukey->key_len, &ds); + + VLOG_WARN_RL(&rl, "Conflicting ukey for flows:\n%s", ds_cstr(&ds)); + ds_destroy(&ds); + } + } else { + ovs_mutex_lock(&new_ukey->mutex); + cmap_insert(&umap->cmap, &new_ukey->cmap_node, new_ukey->hash); + locked = true; + } + ovs_mutex_unlock(&umap->mutex); + + return locked; +} + +static void +ukey_install_finish__(struct udpif_key *ukey) OVS_REQUIRES(ukey->mutex) +{ ukey->flow_exists = true; - ukey->created = used ? used : time_msec(); - memset(&ukey->stats, 0, sizeof ukey->stats); - ukey->xcache = NULL; +} + +static bool +ukey_install_finish(struct udpif_key *ukey, int error) + OVS_RELEASES(ukey->mutex) +{ + if (!error) { + ukey_install_finish__(ukey); + } ovs_mutex_unlock(&ukey->mutex); - return ukey; + return !error; } -/* Checks for a ukey in 'udpif->ukeys' with the same 'ukey->key' and 'hash', - * and inserts 'ukey' if it does not exist. - * - * Returns true if 'ukey' was inserted into 'udpif->ukeys', false otherwise. */ static bool -udpif_insert_ukey(struct udpif *udpif, struct udpif_key *ukey, uint32_t hash) +ukey_install(struct udpif *udpif, struct udpif_key *ukey) { - struct udpif_key *duplicate; - uint32_t idx = hash % udpif->n_revalidators; - bool ok; + /* The usual way to keep 'ukey->flow_exists' in sync with the datapath is + * to call ukey_install_start(), install the corresponding datapath flow, + * then call ukey_install_finish(). The netdev interface using upcall_cb() + * doesn't provide a function to separately finish the flow installation, + * so we perform the operations together here. + * + * This is fine currently, as revalidator threads will only delete this + * ukey during revalidator_sweep() and only if the dump_seq is mismatched. + * It is unlikely for a revalidator thread to advance dump_seq and reach + * the next GC phase between ukey creation and flow installation. */ + return ukey_install_start(udpif, ukey) && ukey_install_finish(ukey, 0); +} - ovs_mutex_lock(&udpif->ukeys[idx].mutex); - duplicate = ukey_lookup__(udpif, ukey->key, ukey->key_len, hash); - if (duplicate) { - ok = false; +/* Searches for a ukey in 'udpif->ukeys' that matches 'flow' and attempts to + * lock the ukey. If the ukey does not exist, create it. + * + * Returns 0 on success, setting *result to the matching ukey and returning it + * in a locked state. Otherwise, returns an errno and clears *result. EBUSY + * indicates that another thread is handling this flow. Other errors indicate + * an unexpected condition creating a new ukey. + * + * *error is an output parameter provided to appease the threadsafety analyser, + * and its value matches the return value. */ +static int +ukey_acquire(struct udpif *udpif, const struct dpif_flow *flow, + struct udpif_key **result, int *error) + OVS_TRY_LOCK(0, (*result)->mutex) +{ + struct udpif_key *ukey; + int retval; + + ukey = ukey_lookup(udpif, &flow->ufid); + if (ukey) { + retval = ovs_mutex_trylock(&ukey->mutex); } else { - hmap_insert(&udpif->ukeys[idx].hmap, &ukey->hmap_node, hash); - ok = true; + /* Usually we try to avoid installing flows from revalidator threads, + * because locking on a umap may cause handler threads to block. + * However there are certain cases, like when ovs-vswitchd is + * restarted, where it is desirable to handle flows that exist in the + * datapath gracefully (ie, don't just clear the datapath). */ + bool install; + + retval = ukey_create_from_dpif_flow(udpif, flow, &ukey); + if (retval) { + goto done; + } + install = ukey_install_start(udpif, ukey); + if (install) { + ukey_install_finish__(ukey); + retval = 0; + } else { + ukey_delete__(ukey); + retval = EBUSY; + } } - ovs_mutex_unlock(&udpif->ukeys[idx].mutex); - return ok; +done: + *error = retval; + if (retval) { + *result = NULL; + } else { + *result = ukey; + } + return retval; } static void -ukey_delete(struct revalidator *revalidator, struct udpif_key *ukey) +ukey_delete__(struct udpif_key *ukey) OVS_NO_THREAD_SAFETY_ANALYSIS { - if (revalidator) { - hmap_remove(revalidator->ukeys, &ukey->hmap_node); + if (ukey) { + for (int i = 0; i < ukey->n_recircs; i++) { + recirc_free_id(ukey->recircs[i]); + } + xlate_cache_delete(ukey->xcache); + ofpbuf_delete(ukey->actions); + ovs_mutex_destroy(&ukey->mutex); + free(ukey); } - xlate_cache_delete(ukey->xcache); - ovs_mutex_destroy(&ukey->mutex); - free(ukey); +} + +static void +ukey_delete(struct umap *umap, struct udpif_key *ukey) + OVS_REQUIRES(umap->mutex) +{ + cmap_remove(&umap->cmap, &ukey->cmap_node, ukey->hash); + ovsrcu_postpone(ukey_delete__, ukey); } static bool @@ -1209,9 +1631,7 @@ static bool revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey, - const struct nlattr *mask, size_t mask_len, - const struct nlattr *actions, size_t actions_len, - const struct dpif_flow_stats *stats) + const struct dpif_flow_stats *stats, uint64_t reval_seq) OVS_REQUIRES(ukey->mutex) { uint64_t slow_path_buf[128 / 8]; @@ -1221,29 +1641,31 @@ struct dpif_flow_stats push; struct ofpbuf xout_actions; struct flow flow, dp_mask; - uint32_t *dp32, *xout32; - odp_port_t odp_in_port; + uint64_t *dp64, *xout64; + ofp_port_t ofp_in_port; struct xlate_in xin; long long int last_used; int error; size_t i; - bool may_learn, ok; + bool ok; + bool need_revalidate; ok = false; xoutp = NULL; netflow = NULL; + need_revalidate = (ukey->reval_seq != reval_seq); last_used = ukey->stats.used; push.used = stats->used; push.tcp_flags = stats->tcp_flags; - push.n_packets = stats->n_packets > ukey->stats.n_packets - ? stats->n_packets - ukey->stats.n_packets - : 0; - push.n_bytes = stats->n_bytes > ukey->stats.n_bytes - ? stats->n_bytes - ukey->stats.n_bytes - : 0; + push.n_packets = (stats->n_packets > ukey->stats.n_packets + ? stats->n_packets - ukey->stats.n_packets + : 0); + push.n_bytes = (stats->n_bytes > ukey->stats.n_bytes + ? stats->n_bytes - ukey->stats.n_bytes + : 0); - if (udpif->need_revalidate && last_used + if (need_revalidate && last_used && !should_revalidate(udpif, push.n_packets, last_used)) { ok = false; goto exit; @@ -1251,58 +1673,65 @@ /* We will push the stats, so update the ukey stats cache. */ ukey->stats = *stats; - if (!push.n_packets && !udpif->need_revalidate) { + if (!push.n_packets && !need_revalidate) { ok = true; goto exit; } - may_learn = push.n_packets > 0; - if (ukey->xcache && !udpif->need_revalidate) { - xlate_push_stats(ukey->xcache, may_learn, &push); + if (ukey->xcache && !need_revalidate) { + xlate_push_stats(ukey->xcache, &push); ok = true; goto exit; } - error = xlate_receive(udpif->backer, NULL, ukey->key, ukey->key_len, &flow, - &ofproto, NULL, NULL, &netflow, &odp_in_port); + if (odp_flow_key_to_flow(ukey->key, ukey->key_len, &flow) + == ODP_FIT_ERROR) { + goto exit; + } + + error = xlate_lookup(udpif->backer, &flow, &ofproto, NULL, NULL, &netflow, + &ofp_in_port); if (error) { goto exit; } - if (udpif->need_revalidate) { + if (need_revalidate) { xlate_cache_clear(ukey->xcache); } if (!ukey->xcache) { ukey->xcache = xlate_cache_new(); } - xlate_in_init(&xin, ofproto, &flow, NULL, push.tcp_flags, NULL); - xin.resubmit_stats = push.n_packets ? &push : NULL; + xlate_in_init(&xin, ofproto, &flow, ofp_in_port, NULL, push.tcp_flags, + NULL); + if (push.n_packets) { + xin.resubmit_stats = &push; + xin.may_learn = true; + } xin.xcache = ukey->xcache; - xin.may_learn = may_learn; - xin.skip_wildcards = !udpif->need_revalidate; + xin.skip_wildcards = !need_revalidate; xlate_actions(&xin, &xout); xoutp = &xout; - if (!udpif->need_revalidate) { + if (!need_revalidate) { ok = true; goto exit; } if (!xout.slow) { - ofpbuf_use_const(&xout_actions, ofpbuf_data(&xout.odp_actions), - ofpbuf_size(&xout.odp_actions)); + ofpbuf_use_const(&xout_actions, xout.odp_actions->data, + xout.odp_actions->size); } else { ofpbuf_use_stack(&xout_actions, slow_path_buf, sizeof slow_path_buf); - compose_slow_path(udpif, &xout, &flow, odp_in_port, &xout_actions); + compose_slow_path(udpif, &xout, &flow, flow.in_port.odp_port, + &xout_actions); } - if (actions_len != ofpbuf_size(&xout_actions) - || memcmp(ofpbuf_data(&xout_actions), actions, actions_len)) { + if (!ofpbuf_equal(&xout_actions, ukey->actions)) { goto exit; } - if (odp_flow_key_to_mask(mask, mask_len, &dp_mask, &flow) + if (odp_flow_key_to_mask(ukey->mask, ukey->mask_len, &dp_mask, &flow) == ODP_FIT_ERROR) { goto exit; } @@ -1312,62 +1741,74 @@ * mask in the kernel is more specific i.e. less wildcarded, than what * we've calculated here. This guarantees we don't catch any packets we * shouldn't with the megaflow. */ - dp32 = (uint32_t *) &dp_mask; - xout32 = (uint32_t *) &xout.wc.masks; - for (i = 0; i < FLOW_U32S; i++) { - if ((dp32[i] | xout32[i]) != dp32[i]) { + dp64 = (uint64_t *) &dp_mask; + xout64 = (uint64_t *) &xout.wc.masks; + for (i = 0; i < FLOW_U64S; i++) { + if ((dp64[i] | xout64[i]) != dp64[i]) { goto exit; } } + ok = true; exit: - if (netflow) { - if (!ok) { - netflow_flow_clear(netflow, &flow); - } - netflow_unref(netflow); + if (ok) { + ukey->reval_seq = reval_seq; + } + if (netflow && !ok) { + netflow_flow_clear(netflow, &flow); } xlate_out_uninit(xoutp); return ok; } -struct dump_op { - struct udpif_key *ukey; - struct dpif_flow_stats stats; /* Stats for 'op'. */ - struct dpif_op op; /* Flow del operation. */ -}; +static void +delete_op_init__(struct udpif *udpif, struct ukey_op *op, + const struct dpif_flow *flow) +{ + op->ukey = NULL; + op->dop.type = DPIF_OP_FLOW_DEL; + op->dop.u.flow_del.key = flow->key; + op->dop.u.flow_del.key_len = flow->key_len; + op->dop.u.flow_del.ufid = flow->ufid_present ? &flow->ufid : NULL; + op->dop.u.flow_del.pmd_id = flow->pmd_id; + op->dop.u.flow_del.stats = &op->stats; + op->dop.u.flow_del.terse = udpif_use_ufid(udpif); +} static void -dump_op_init(struct dump_op *op, const struct nlattr *key, size_t key_len, - struct udpif_key *ukey) +delete_op_init(struct udpif *udpif, struct ukey_op *op, struct udpif_key *ukey) { op->ukey = ukey; - op->op.type = DPIF_OP_FLOW_DEL; - op->op.u.flow_del.key = key; - op->op.u.flow_del.key_len = key_len; - op->op.u.flow_del.stats = &op->stats; + op->dop.type = DPIF_OP_FLOW_DEL; + op->dop.u.flow_del.key = ukey->key; + op->dop.u.flow_del.key_len = ukey->key_len; + op->dop.u.flow_del.ufid = ukey->ufid_present ? &ukey->ufid : NULL; + op->dop.u.flow_del.pmd_id = ukey->pmd_id; + op->dop.u.flow_del.stats = &op->stats; + op->dop.u.flow_del.terse = udpif_use_ufid(udpif); } static void -push_dump_ops__(struct udpif *udpif, struct dump_op *ops, size_t n_ops) +push_ukey_ops__(struct udpif *udpif, struct ukey_op *ops, size_t n_ops) { struct dpif_op *opsp[REVALIDATE_MAX_BATCH]; size_t i; ovs_assert(n_ops <= REVALIDATE_MAX_BATCH); for (i = 0; i < n_ops; i++) { - opsp[i] = &ops[i].op; + opsp[i] = &ops[i].dop; } dpif_operate(udpif->dpif, opsp, n_ops); for (i = 0; i < n_ops; i++) { - struct dump_op *op = &ops[i]; + struct ukey_op *op = &ops[i]; struct dpif_flow_stats *push, *stats, push_buf; - stats = op->op.u.flow_del.stats; + stats = op->dop.u.flow_del.stats; + push = &push_buf; + if (op->ukey) { - push = &push_buf; ovs_mutex_lock(&op->ukey->mutex); push->used = MAX(stats->used, op->ukey->stats.used); push->tcp_flags = stats->tcp_flags | op->ukey->stats.tcp_flags; @@ -1379,37 +1820,45 @@ } if (push->n_packets || netflow_exists()) { + const struct nlattr *key = op->dop.u.flow_del.key; + size_t key_len = op->dop.u.flow_del.key_len; struct ofproto_dpif *ofproto; struct netflow *netflow; + ofp_port_t ofp_in_port; struct flow flow; - bool may_learn; + int error; - may_learn = push->n_packets > 0; if (op->ukey) { ovs_mutex_lock(&op->ukey->mutex); if (op->ukey->xcache) { - xlate_push_stats(op->ukey->xcache, may_learn, push); + xlate_push_stats(op->ukey->xcache, push); ovs_mutex_unlock(&op->ukey->mutex); continue; } ovs_mutex_unlock(&op->ukey->mutex); + key = op->ukey->key; + key_len = op->ukey->key_len; } - if (!xlate_receive(udpif->backer, NULL, op->op.u.flow_del.key, - op->op.u.flow_del.key_len, &flow, &ofproto, - NULL, NULL, &netflow, NULL)) { + if (odp_flow_key_to_flow(key, key_len, &flow) + == ODP_FIT_ERROR) { + continue; + } + + error = xlate_lookup(udpif->backer, &flow, &ofproto, NULL, NULL, + &netflow, &ofp_in_port); + if (!error) { struct xlate_in xin; - xlate_in_init(&xin, ofproto, &flow, NULL, push->tcp_flags, - NULL); + xlate_in_init(&xin, ofproto, &flow, ofp_in_port, NULL, + push->tcp_flags, NULL); xin.resubmit_stats = push->n_packets ? push : NULL; - xin.may_learn = may_learn; + xin.may_learn = push->n_packets > 0; xin.skip_wildcards = true; xlate_actions_for_side_effects(&xin); if (netflow) { netflow_flow_clear(netflow, &flow); - netflow_unref(netflow); } } } @@ -1417,187 +1866,209 @@ } static void -push_dump_ops(struct revalidator *revalidator, - struct dump_op *ops, size_t n_ops) +push_ukey_ops(struct udpif *udpif, struct umap *umap, + struct ukey_op *ops, size_t n_ops) { int i; - push_dump_ops__(revalidator->udpif, ops, n_ops); + push_ukey_ops__(udpif, ops, n_ops); + ovs_mutex_lock(&umap->mutex); for (i = 0; i < n_ops; i++) { - ukey_delete(revalidator, ops[i].ukey); + ukey_delete(umap, ops[i].ukey); } + ovs_mutex_unlock(&umap->mutex); +} + +static void +log_unexpected_flow(const struct dpif_flow *flow, int error) +{ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 60); + struct ds ds = DS_EMPTY_INITIALIZER; + + ds_put_format(&ds, "Failed to acquire udpif_key corresponding to " + "unexpected flow (%s): ", ovs_strerror(error)); + odp_format_ufid(&flow->ufid, &ds); + VLOG_WARN_RL(&rl, "%s", ds_cstr(&ds)); } static void revalidate(struct revalidator *revalidator) { struct udpif *udpif = revalidator->udpif; - - struct dump_op ops[REVALIDATE_MAX_BATCH]; - const struct nlattr *key, *mask, *actions; - size_t key_len, mask_len, actions_len; - const struct dpif_flow_stats *stats; - long long int now; + struct dpif_flow_dump_thread *dump_thread; + uint64_t dump_seq, reval_seq; unsigned int flow_limit; - size_t n_ops; - void *state; - n_ops = 0; - now = time_msec(); - atomic_read(&udpif->flow_limit, &flow_limit); - - dpif_flow_dump_state_init(udpif->dpif, &state); - while (dpif_flow_dump_next(&udpif->dump, state, &key, &key_len, &mask, - &mask_len, &actions, &actions_len, &stats)) { - struct udpif_key *ukey; - bool mark, may_destroy; - long long int used, max_idle; - uint32_t hash; - size_t n_flows; - - hash = hash_bytes(key, key_len, udpif->secret); - ukey = ukey_lookup(udpif, key, key_len, hash); - - used = stats->used; - if (!ukey) { - ukey = ukey_create(key, key_len, used); - if (!udpif_insert_ukey(udpif, ukey, hash)) { - /* The same ukey has already been created. This means that - * another revalidator is processing this flow - * concurrently, so don't bother processing it. */ - COVERAGE_INC(upcall_duplicate_flow); - ukey_delete(NULL, ukey); - goto next; - } - } + dump_seq = seq_read(udpif->dump_seq); + reval_seq = seq_read(udpif->reval_seq); + atomic_read_relaxed(&udpif->flow_limit, &flow_limit); + dump_thread = dpif_flow_dump_thread_create(udpif->dump); + for (;;) { + struct ukey_op ops[REVALIDATE_MAX_BATCH]; + int n_ops = 0; - if (ovs_mutex_trylock(&ukey->mutex)) { - /* The flow has been dumped, and is being handled by another - * revalidator concurrently. This can occasionally occur if the - * datapath is changed in the middle of a flow dump. Rather than - * perform the same work twice, skip the flow this time. */ - COVERAGE_INC(upcall_duplicate_flow); - goto next; - } + struct dpif_flow flows[REVALIDATE_MAX_BATCH]; + const struct dpif_flow *f; + int n_dumped; + + long long int max_idle; + long long int now; + size_t n_dp_flows; + bool kill_them_all; - if (ukey->mark || !ukey->flow_exists) { - /* The flow has already been dumped and handled by another - * revalidator during this flow dump operation. Skip it. */ - COVERAGE_INC(upcall_duplicate_flow); - ovs_mutex_unlock(&ukey->mutex); - goto next; + n_dumped = dpif_flow_dump_next(dump_thread, flows, ARRAY_SIZE(flows)); + if (!n_dumped) { + break; } - if (!used) { - used = ukey->created; - } - n_flows = udpif_get_n_flows(udpif); - max_idle = ofproto_max_idle; - if (n_flows > flow_limit) { - max_idle = 100; - } + now = time_msec(); - if ((used && used < now - max_idle) || n_flows > flow_limit * 2) { - mark = false; - } else { - mark = revalidate_ukey(udpif, ukey, mask, mask_len, actions, - actions_len, stats); - } - ukey->mark = ukey->flow_exists = mark; + /* In normal operation we want to keep flows around until they have + * been idle for 'ofproto_max_idle' milliseconds. However: + * + * - If the number of datapath flows climbs above 'flow_limit', + * drop that down to 100 ms to try to bring the flows down to + * the limit. + * + * - If the number of datapath flows climbs above twice + * 'flow_limit', delete all the datapath flows as an emergency + * measure. (We reassess this condition for the next batch of + * datapath flows, so we will recover before all the flows are + * gone.) */ + n_dp_flows = udpif_get_n_flows(udpif); + kill_them_all = n_dp_flows > flow_limit * 2; + max_idle = n_dp_flows > flow_limit ? 100 : ofproto_max_idle; + + for (f = flows; f < &flows[n_dumped]; f++) { + long long int used = f->stats.used; + struct udpif_key *ukey; + bool already_dumped, keep; + int error; + + if (ukey_acquire(udpif, f, &ukey, &error)) { + if (error == EBUSY) { + /* Another thread is processing this flow, so don't bother + * processing it.*/ + COVERAGE_INC(upcall_ukey_contention); + } else { + log_unexpected_flow(f, error); + if (error != ENOENT) { + delete_op_init__(udpif, &ops[n_ops++], f); + } + } + continue; + } - if (!mark) { - dump_op_init(&ops[n_ops++], key, key_len, ukey); - } - ovs_mutex_unlock(&ukey->mutex); + already_dumped = ukey->dump_seq == dump_seq; + if (already_dumped) { + /* The flow has already been handled during this flow dump + * operation. Skip it. */ + if (ukey->xcache) { + COVERAGE_INC(dumped_duplicate_flow); + } else { + COVERAGE_INC(dumped_new_flow); + } + ovs_mutex_unlock(&ukey->mutex); + continue; + } - next: - may_destroy = dpif_flow_dump_next_may_destroy_keys(&udpif->dump, - state); + if (!used) { + used = ukey->created; + } + if (kill_them_all || (used && used < now - max_idle)) { + keep = false; + } else { + keep = revalidate_ukey(udpif, ukey, &f->stats, reval_seq); + } + ukey->dump_seq = dump_seq; + ukey->flow_exists = keep; - /* Only update 'now' immediately before 'buffer' will be updated. - * This gives us the current time relative to the time the datapath - * will write into 'stats'. */ - if (may_destroy) { - now = time_msec(); + if (!keep) { + delete_op_init(udpif, &ops[n_ops++], ukey); + } + ovs_mutex_unlock(&ukey->mutex); } - /* Only do a dpif_operate when we've hit our maximum batch, or when our - * memory is about to be clobbered by the next call to - * dpif_flow_dump_next(). */ - if (n_ops == REVALIDATE_MAX_BATCH || (n_ops && may_destroy)) { - push_dump_ops__(udpif, ops, n_ops); - n_ops = 0; + if (n_ops) { + push_ukey_ops__(udpif, ops, n_ops); } + ovsrcu_quiesce(); } - - if (n_ops) { - push_dump_ops__(udpif, ops, n_ops); - } - - dpif_flow_dump_state_uninit(udpif->dpif, state); + dpif_flow_dump_thread_destroy(dump_thread); } -/* Called with exclusive access to 'revalidator' and 'ukey'. */ static bool -handle_missed_revalidation(struct revalidator *revalidator, +handle_missed_revalidation(struct udpif *udpif, uint64_t reval_seq, struct udpif_key *ukey) - OVS_NO_THREAD_SAFETY_ANALYSIS { - struct udpif *udpif = revalidator->udpif; - struct nlattr *mask, *actions; - size_t mask_len, actions_len; struct dpif_flow_stats stats; - struct ofpbuf *buf; - bool keep = false; + bool keep; COVERAGE_INC(revalidate_missed_dp_flow); - if (!dpif_flow_get(udpif->dpif, ukey->key, ukey->key_len, &buf, - &mask, &mask_len, &actions, &actions_len, &stats)) { - keep = revalidate_ukey(udpif, ukey, mask, mask_len, actions, - actions_len, &stats); - ofpbuf_delete(buf); - } + memset(&stats, 0, sizeof stats); + ovs_mutex_lock(&ukey->mutex); + keep = revalidate_ukey(udpif, ukey, &stats, reval_seq); + ovs_mutex_unlock(&ukey->mutex); return keep; } static void revalidator_sweep__(struct revalidator *revalidator, bool purge) - OVS_NO_THREAD_SAFETY_ANALYSIS { - struct dump_op ops[REVALIDATE_MAX_BATCH]; - struct udpif_key *ukey, *next; - size_t n_ops; + struct udpif *udpif; + uint64_t dump_seq, reval_seq; + int slice; - n_ops = 0; + udpif = revalidator->udpif; + dump_seq = seq_read(udpif->dump_seq); + reval_seq = seq_read(udpif->reval_seq); + slice = revalidator - udpif->revalidators; + ovs_assert(slice < udpif->n_revalidators); + + for (int i = slice; i < N_UMAPS; i += udpif->n_revalidators) { + struct ukey_op ops[REVALIDATE_MAX_BATCH]; + struct udpif_key *ukey; + struct umap *umap = &udpif->ukeys[i]; + size_t n_ops = 0; + + CMAP_FOR_EACH(ukey, cmap_node, &umap->cmap) { + bool flow_exists, seq_mismatch; + + /* Handler threads could be holding a ukey lock while it installs a + * new flow, so don't hang around waiting for access to it. */ + if (ovs_mutex_trylock(&ukey->mutex)) { + continue; + } + flow_exists = ukey->flow_exists; + seq_mismatch = (ukey->dump_seq != dump_seq + && ukey->reval_seq != reval_seq); + ovs_mutex_unlock(&ukey->mutex); - /* During garbage collection, this revalidator completely owns its ukeys - * map, and therefore doesn't need to do any locking. */ - HMAP_FOR_EACH_SAFE (ukey, next, hmap_node, revalidator->ukeys) { - if (ukey->flow_exists) { - bool missed_flow = !ukey->mark; - - ukey->mark = false; - if (purge - || (missed_flow - && revalidator->udpif->need_revalidate - && !handle_missed_revalidation(revalidator, ukey))) { - struct dump_op *op = &ops[n_ops++]; + if (flow_exists + && (purge + || (seq_mismatch + && !handle_missed_revalidation(udpif, reval_seq, + ukey)))) { + struct ukey_op *op = &ops[n_ops++]; - dump_op_init(op, ukey->key, ukey->key_len, ukey); + delete_op_init(udpif, op, ukey); if (n_ops == REVALIDATE_MAX_BATCH) { - push_dump_ops(revalidator, ops, n_ops); + push_ukey_ops(udpif, umap, ops, n_ops); n_ops = 0; } + } else if (!flow_exists) { + ovs_mutex_lock(&umap->mutex); + ukey_delete(umap, ukey); + ovs_mutex_unlock(&umap->mutex); } - } else { - ukey_delete(revalidator, ukey); } - } - if (n_ops) { - push_dump_ops(revalidator, ops, n_ops); + if (n_ops) { + push_ukey_ops(udpif, umap, ops, n_ops); + } + ovsrcu_quiesce(); } } @@ -1622,24 +2093,33 @@ LIST_FOR_EACH (udpif, list_node, &all_udpifs) { unsigned int flow_limit; + bool ufid_enabled; size_t i; - atomic_read(&udpif->flow_limit, &flow_limit); + atomic_read_relaxed(&udpif->flow_limit, &flow_limit); + ufid_enabled = udpif_use_ufid(udpif); ds_put_format(&ds, "%s:\n", dpif_name(udpif->dpif)); ds_put_format(&ds, "\tflows : (current %lu)" " (avg %u) (max %u) (limit %u)\n", udpif_get_n_flows(udpif), udpif->avg_n_flows, udpif->max_n_flows, flow_limit); ds_put_format(&ds, "\tdump duration : %lldms\n", udpif->dump_duration); - + ds_put_format(&ds, "\tufid enabled : "); + if (ufid_enabled) { + ds_put_format(&ds, "true\n"); + } else { + ds_put_format(&ds, "false\n"); + } ds_put_char(&ds, '\n'); + for (i = 0; i < n_revalidators; i++) { struct revalidator *revalidator = &udpif->revalidators[i]; + int j, elements = 0; - ovs_mutex_lock(&udpif->ukeys[i].mutex); - ds_put_format(&ds, "\t%u: (keys %"PRIuSIZE")\n", - revalidator->id, hmap_count(&udpif->ukeys[i].hmap)); - ovs_mutex_unlock(&udpif->ukeys[i].mutex); + for (j = i; j < N_UMAPS; j += n_revalidators) { + elements += cmap_count(&udpif->ukeys[j].cmap); + } + ds_put_format(&ds, "\t%u: (keys %d)\n", revalidator->id, elements); } } @@ -1657,7 +2137,7 @@ const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) { - atomic_store(&enable_megaflows, false); + atomic_store_relaxed(&enable_megaflows, false); udpif_flush_all_datapaths(); unixctl_command_reply(conn, "megaflows disabled"); } @@ -1672,11 +2152,36 @@ const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) { - atomic_store(&enable_megaflows, true); + atomic_store_relaxed(&enable_megaflows, true); udpif_flush_all_datapaths(); unixctl_command_reply(conn, "megaflows enabled"); } +/* Disable skipping flow attributes during flow dump. + * + * This command is only needed for advanced debugging, so it's not + * documented in the man page. */ +static void +upcall_unixctl_disable_ufid(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +{ + atomic_store_relaxed(&enable_ufid, false); + unixctl_command_reply(conn, "Datapath dumping tersely using UFID disabled"); +} + +/* Re-enable skipping flow attributes during flow dump. + * + * This command is only needed for advanced debugging, so it's not documented + * in the man page. */ +static void +upcall_unixctl_enable_ufid(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +{ + atomic_store_relaxed(&enable_ufid, true); + unixctl_command_reply(conn, "Datapath dumping tersely using UFID enabled " + "for supported datapaths"); +} + /* Set the flow limit. * * This command is only needed for advanced debugging, so it's not @@ -1692,9 +2197,45 @@ unsigned int flow_limit = atoi(argv[1]); LIST_FOR_EACH (udpif, list_node, &all_udpifs) { - atomic_store(&udpif->flow_limit, flow_limit); + atomic_store_relaxed(&udpif->flow_limit, flow_limit); } ds_put_format(&ds, "set flow_limit to %u\n", flow_limit); unixctl_command_reply(conn, ds_cstr(&ds)); ds_destroy(&ds); } + +static void +upcall_unixctl_dump_wait(struct unixctl_conn *conn, + int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, + void *aux OVS_UNUSED) +{ + if (list_is_singleton(&all_udpifs)) { + struct udpif *udpif = NULL; + size_t len; + + udpif = OBJECT_CONTAINING(list_front(&all_udpifs), udpif, list_node); + len = (udpif->n_conns + 1) * sizeof *udpif->conns; + udpif->conn_seq = seq_read(udpif->dump_seq); + udpif->conns = xrealloc(udpif->conns, len); + udpif->conns[udpif->n_conns++] = conn; + } else { + unixctl_command_reply_error(conn, "can't wait on multiple udpifs."); + } +} + +static void +upcall_unixctl_purge(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED) +{ + struct udpif *udpif; + + LIST_FOR_EACH (udpif, list_node, &all_udpifs) { + int n; + + for (n = 0; n < udpif->n_revalidators; n++) { + revalidator_purge(&udpif->revalidators[n]); + } + } + unixctl_command_reply(conn, ""); +} diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-upcall.h openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-upcall.h --- openvswitch-2.3.1/ofproto/ofproto-dpif-upcall.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-upcall.h 2015-06-23 18:46:21.000000000 +0000 @@ -19,6 +19,8 @@ struct dpif; struct dpif_backer; +struct dpif_upcall; +struct ofpbuf; struct seq; struct simap; @@ -27,6 +29,7 @@ * table. */ struct udpif *udpif_create(struct dpif_backer *, struct dpif *); +void udpif_run(struct udpif *udpif); void udpif_set_threads(struct udpif *, size_t n_handlers, size_t n_revalidators); void udpif_synchronize(struct udpif *); diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-xlate.c openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-xlate.c --- openvswitch-2.3.1/ofproto/ofproto-dpif-xlate.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-xlate.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ #include "ofproto/ofproto-dpif-xlate.h" #include +#include +#include +#include +#include +#include "tnl-arp-cache.h" #include "bfd.h" #include "bitmap.h" #include "bond.h" @@ -26,13 +31,16 @@ #include "cfm.h" #include "connmgr.h" #include "coverage.h" +#include "dp-packet.h" #include "dpif.h" #include "dynamic-string.h" #include "in-band.h" #include "lacp.h" #include "learn.h" #include "list.h" +#include "ovs-lldp.h" #include "mac-learning.h" +#include "mcast-snooping.h" #include "meta-flow.h" #include "multipath.h" #include "netdev-vport.h" @@ -46,13 +54,14 @@ #include "ofproto/ofproto-dpif-sflow.h" #include "ofproto/ofproto-dpif.h" #include "ofproto/ofproto-provider.h" +#include "ovs-router.h" +#include "tnl-ports.h" #include "tunnel.h" -#include "vlog.h" +#include "openvswitch/vlog.h" COVERAGE_DEFINE(xlate_actions); COVERAGE_DEFINE(xlate_actions_oversize); COVERAGE_DEFINE(xlate_actions_too_many_output); -COVERAGE_DEFINE(xlate_actions_mpls_overflow); VLOG_DEFINE_THIS_MODULE(ofproto_dpif_xlate); @@ -66,53 +75,39 @@ * recursive or not. */ #define MAX_RESUBMITS (MAX_RESUBMIT_RECURSION * MAX_RESUBMIT_RECURSION) -struct ovs_rwlock xlate_rwlock = OVS_RWLOCK_INITIALIZER; - struct xbridge { struct hmap_node hmap_node; /* Node in global 'xbridges' map. */ struct ofproto_dpif *ofproto; /* Key in global 'xbridges' map. */ - struct list xbundles; /* Owned xbundles. */ + struct ovs_list xbundles; /* Owned xbundles. */ struct hmap xports; /* Indexed by ofp_port. */ char *name; /* Name used in log messages. */ struct dpif *dpif; /* Datapath interface. */ struct mac_learning *ml; /* Mac learning handle. */ + struct mcast_snooping *ms; /* Multicast Snooping handle. */ struct mbridge *mbridge; /* Mirroring. */ struct dpif_sflow *sflow; /* SFlow handle, or null. */ struct dpif_ipfix *ipfix; /* Ipfix handle, or null. */ struct netflow *netflow; /* Netflow handle, or null. */ struct stp *stp; /* STP or null if disabled. */ + struct rstp *rstp; /* RSTP or null if disabled. */ - /* Special rules installed by ofproto-dpif. */ - struct rule_dpif *miss_rule; - struct rule_dpif *no_packet_in_rule; - - enum ofp_config_flags frag; /* Fragmentation handling. */ bool has_in_band; /* Bridge has in band control? */ bool forward_bpdu; /* Bridge forwards STP BPDUs? */ - /* True if the datapath supports recirculation. */ - bool enable_recirc; - - /* True if the datapath supports variable-length - * OVS_USERSPACE_ATTR_USERDATA in OVS_ACTION_ATTR_USERSPACE actions. - * False if the datapath supports only 8-byte (or shorter) userdata. */ - bool variable_length_userdata; - - /* Number of MPLS label stack entries that the datapath supports - * in matches. */ - size_t max_mpls_depth; + /* Datapath feature support. */ + struct dpif_backer_support support; }; struct xbundle { struct hmap_node hmap_node; /* In global 'xbundles' map. */ struct ofbundle *ofbundle; /* Key in global 'xbundles' map. */ - struct list list_node; /* In parent 'xbridges' list. */ + struct ovs_list list_node; /* In parent 'xbridges' list. */ struct xbridge *xbridge; /* Parent xbridge. */ - struct list xports; /* Contains "struct xport"s. */ + struct ovs_list xports; /* Contains "struct xport"s. */ char *name; /* Name used in log messages. */ struct bond *bond; /* Nonnull iff more than one port. */ @@ -135,7 +130,7 @@ odp_port_t odp_port; /* Datapath port number or ODPP_NONE. */ - struct list bundle_node; /* In parent xbundle (if it exists). */ + struct ovs_list bundle_node; /* In parent xbundle (if it exists). */ struct xbundle *xbundle; /* Parent xbundle or null. */ struct netdev *netdev; /* 'ofport''s netdev. */ @@ -146,6 +141,7 @@ enum ofputil_port_config config; /* OpenFlow port configuration. */ enum ofputil_port_state state; /* OpenFlow port state. */ int stp_port_no; /* STP port number or -1 if not in use. */ + struct rstp_port *rstp_port; /* RSTP port or null. */ struct hmap skb_priorities; /* Map of 'skb_priority_to_dscp's. */ @@ -154,6 +150,7 @@ struct cfm *cfm; /* CFM handle or null. */ struct bfd *bfd; /* BFD handle or null. */ + struct lldp *lldp; /* LLDP handle or null. */ }; struct xlate_ctx { @@ -162,6 +159,9 @@ const struct xbridge *xbridge; + /* Flow tables version at the beginning of the translation. */ + cls_version_t tables_version; + /* Flow at the last commit. */ struct flow base_flow; @@ -185,28 +185,143 @@ int recurse; /* Current resubmit nesting depth. */ int resubmits; /* Total number of resubmits. */ bool in_group; /* Currently translating ofgroup, if true. */ + bool in_action_set; /* Currently translating action_set, if true. */ - uint32_t orig_skb_priority; /* Priority when packet arrived. */ uint8_t table_id; /* OpenFlow table ID where flow was found. */ + ovs_be64 rule_cookie; /* Cookie of the rule being translated. */ + uint32_t orig_skb_priority; /* Priority when packet arrived. */ uint32_t sflow_n_outputs; /* Number of output ports. */ odp_port_t sflow_odp_port; /* Output port for composing sFlow action. */ uint16_t user_cookie_offset;/* Used for user_action_cookie fixup. */ bool exit; /* No further actions should be processed. */ - bool use_recirc; /* Should generate recirc? */ - struct xlate_recirc recirc; /* Information used for generating - * recirculation actions */ + /* These are used for non-bond recirculation. The recirculation IDs are + * stored in xout and must be associated with a datapath flow (ukey), + * otherwise they will be freed when the xout is uninitialized. + * + * + * Steps in Recirculation Translation + * ================================== + * + * At some point during translation, the code recognizes the need for + * recirculation. For example, recirculation is necessary when, after + * popping the last MPLS label, an action or a match tries to examine or + * modify a field that has been newly revealed following the MPLS label. + * + * The simplest part of the work to be done is to commit existing changes to + * the packet, which produces datapath actions corresponding to the changes, + * and after this, add an OVS_ACTION_ATTR_RECIRC datapath action. + * + * The main problem here is preserving state. When the datapath executes + * OVS_ACTION_ATTR_RECIRC, it will upcall to userspace to get a translation + * for the post-recirculation actions. At this point userspace has to + * resume the translation where it left off, which means that it has to + * execute the following: + * + * - The action that prompted recirculation, and any actions following + * it within the same flow. + * + * - If the action that prompted recirculation was invoked within a + * NXAST_RESUBMIT, then any actions following the resubmit. These + * "resubmit"s can be nested, so this has to go all the way up the + * control stack. + * + * - The OpenFlow 1.1+ action set. + * + * State that actions and flow table lookups can depend on, such as the + * following, must also be preserved: + * + * - Metadata fields (input port, registers, OF1.1+ metadata, ...). + * + * - Action set, stack + * + * - The table ID and cookie of the flow being translated at each level + * of the control stack (since OFPAT_CONTROLLER actions send these to + * the controller). + * + * Translation allows for the control of this state preservation via these + * members. When a need for recirculation is identified, the translation + * process: + * + * 1. Sets 'recirc_action_offset' to the current size of 'action_set'. The + * action set is part of what needs to be preserved, so this allows the + * action set and the additional state to share the 'action_set' buffer. + * Later steps can tell that setup for recirculation is in progress from + * the nonnegative value of 'recirc_action_offset'. + * + * 2. Sets 'exit' to true to tell later steps that we're exiting from the + * translation process. + * + * 3. Adds an OFPACT_UNROLL_XLATE action to 'action_set'. This action + * holds the current table ID and cookie so that they can be restored + * during a post-recirculation upcall translation. + * + * 4. Adds the action that prompted recirculation and any actions following + * it within the same flow to 'action_set', so that they can be executed + * during a post-recirculation upcall translation. + * + * 5. Returns. + * + * 6. The action that prompted recirculation might be nested in a stack of + * nested "resubmit"s that have actions remaining. Each of these notices + * that we're exiting (from 'exit') and that recirculation setup is in + * progress (from 'recirc_action_offset') and responds by adding more + * OFPACT_UNROLL_XLATE actions to 'action_set', as necessary, and any + * actions that were yet unprocessed. + * + * The caller stores all the state produced by this process associated with + * the recirculation ID. For post-recirculation upcall translation, the + * caller passes it back in for the new translation to execute. The + * process yielded a set of ofpacts that can be translated directly, so it + * is not much of a special case at that point. + */ + int recirc_action_offset; /* Offset in 'action_set' to actions to be + * executed after recirculation, or -1. */ + int last_unroll_offset; /* Offset in 'action_set' to the latest unroll + * action, or -1. */ + + /* True if a packet was but is no longer MPLS (due to an MPLS pop action). + * This is a trigger for recirculation in cases where translating an action + * or looking up a flow requires access to the fields of the packet after + * the MPLS label stack that was originally present. */ + bool was_mpls; /* OpenFlow 1.1+ action set. * * 'action_set' accumulates "struct ofpact"s added by OFPACT_WRITE_ACTIONS. * When translation is otherwise complete, ofpacts_execute_action_set() * converts it to a set of "struct ofpact"s that can be translated into - * datapath actions. */ + * datapath actions. */ + bool action_set_has_group; /* Action set contains OFPACT_GROUP? */ struct ofpbuf action_set; /* Action set. */ uint64_t action_set_stub[1024 / 8]; }; +static void xlate_action_set(struct xlate_ctx *ctx); + +static void +ctx_trigger_recirculation(struct xlate_ctx *ctx) +{ + ctx->exit = true; + ctx->recirc_action_offset = ctx->action_set.size; +} + +static bool +ctx_first_recirculation_action(const struct xlate_ctx *ctx) +{ + return ctx->recirc_action_offset == ctx->action_set.size; +} + +static inline bool +exit_recirculates(const struct xlate_ctx *ctx) +{ + /* When recirculating the 'recirc_action_offset' has a non-negative value. + */ + return ctx->recirc_action_offset >= 0; +} + +static void compose_recirculate_action(struct xlate_ctx *ctx); + /* A controller may use OFPP_NONE as the ingress port to indicate that * it did not arrive on a "real" port. 'ofpp_none_bundle' exists for * when an input bundle is needed for validation (e.g., mirroring or @@ -236,6 +351,8 @@ XC_LEARN, XC_NORMAL, XC_FIN_TIMEOUT, + XC_GROUP, + XC_TNL_ARP, }; /* xlate_cache entries hold enough information to perform the side effects of @@ -281,6 +398,14 @@ uint16_t idle; uint16_t hard; } fin; + struct { + struct group_dpif *group; + struct ofputil_bucket *bucket; + } group; + struct { + char br_name[IFNAMSIZ]; + ovs_be32 d_ip; + } tnl_arp_cache; } u; }; @@ -294,17 +419,24 @@ struct ofpbuf entries; }; -static struct hmap xbridges = HMAP_INITIALIZER(&xbridges); -static struct hmap xbundles = HMAP_INITIALIZER(&xbundles); -static struct hmap xports = HMAP_INITIALIZER(&xports); +/* Xlate config contains hash maps of all bridges, bundles and ports. + * Xcfgp contains the pointer to the current xlate configuration. + * When the main thread needs to change the configuration, it copies xcfgp to + * new_xcfg and edits new_xcfg. This enables the use of RCU locking which + * does not block handler and revalidator threads. */ +struct xlate_cfg { + struct hmap xbridges; + struct hmap xbundles; + struct hmap xports; +}; +static OVSRCU_TYPE(struct xlate_cfg *) xcfgp = OVSRCU_INITIALIZER(NULL); +static struct xlate_cfg *new_xcfg = NULL; static bool may_receive(const struct xport *, struct xlate_ctx *); static void do_xlate_actions(const struct ofpact *, size_t ofpacts_len, struct xlate_ctx *); -static void xlate_actions__(struct xlate_in *, struct xlate_out *) - OVS_REQ_RDLOCK(xlate_rwlock); static void xlate_normal(struct xlate_ctx *); -static void xlate_report(struct xlate_ctx *, const char *); +static inline void xlate_report(struct xlate_ctx *, const char *); static void xlate_table_action(struct xlate_ctx *, ofp_port_t in_port, uint8_t table_id, bool may_packet_in, bool honor_table_miss); @@ -312,51 +444,124 @@ static uint16_t input_vid_to_vlan(const struct xbundle *, uint16_t vid); static void output_normal(struct xlate_ctx *, const struct xbundle *, uint16_t vlan); -static void compose_output_action(struct xlate_ctx *, ofp_port_t ofp_port); -static struct xbridge *xbridge_lookup(const struct ofproto_dpif *); -static struct xbundle *xbundle_lookup(const struct ofbundle *); -static struct xport *xport_lookup(const struct ofport_dpif *); +/* Optional bond recirculation parameter to compose_output_action(). */ +struct xlate_bond_recirc { + uint32_t recirc_id; /* !0 Use recirculation instead of output. */ + uint8_t hash_alg; /* !0 Compute hash for recirc before. */ + uint32_t hash_basis; /* Compute hash for recirc before. */ +}; + +static void compose_output_action(struct xlate_ctx *, ofp_port_t ofp_port, + const struct xlate_bond_recirc *xr); + +static struct xbridge *xbridge_lookup(struct xlate_cfg *, + const struct ofproto_dpif *); +static struct xbundle *xbundle_lookup(struct xlate_cfg *, + const struct ofbundle *); +static struct xport *xport_lookup(struct xlate_cfg *, + const struct ofport_dpif *); static struct xport *get_ofp_port(const struct xbridge *, ofp_port_t ofp_port); static struct skb_priority_to_dscp *get_skb_priority(const struct xport *, uint32_t skb_priority); static void clear_skb_priorities(struct xport *); +static size_t count_skb_priorities(const struct xport *); static bool dscp_from_skb_priority(const struct xport *, uint32_t skb_priority, uint8_t *dscp); static struct xc_entry *xlate_cache_add_entry(struct xlate_cache *xc, enum xc_type type); +static void xlate_xbridge_init(struct xlate_cfg *, struct xbridge *); +static void xlate_xbundle_init(struct xlate_cfg *, struct xbundle *); +static void xlate_xport_init(struct xlate_cfg *, struct xport *); +static void xlate_xbridge_set(struct xbridge *, struct dpif *, + const struct mac_learning *, struct stp *, + struct rstp *, const struct mcast_snooping *, + const struct mbridge *, + const struct dpif_sflow *, + const struct dpif_ipfix *, + const struct netflow *, + bool forward_bpdu, bool has_in_band, + const struct dpif_backer_support *); +static void xlate_xbundle_set(struct xbundle *xbundle, + enum port_vlan_mode vlan_mode, int vlan, + unsigned long *trunks, bool use_priority_tags, + const struct bond *bond, const struct lacp *lacp, + bool floodable); +static void xlate_xport_set(struct xport *xport, odp_port_t odp_port, + const struct netdev *netdev, const struct cfm *cfm, + const struct bfd *bfd, const struct lldp *lldp, + int stp_port_no, const struct rstp_port *rstp_port, + enum ofputil_port_config config, + enum ofputil_port_state state, bool is_tunnel, + bool may_enable); +static void xlate_xbridge_remove(struct xlate_cfg *, struct xbridge *); +static void xlate_xbundle_remove(struct xlate_cfg *, struct xbundle *); +static void xlate_xport_remove(struct xlate_cfg *, struct xport *); +static void xlate_xbridge_copy(struct xbridge *); +static void xlate_xbundle_copy(struct xbridge *, struct xbundle *); +static void xlate_xport_copy(struct xbridge *, struct xbundle *, + struct xport *); +static void xlate_xcfg_free(struct xlate_cfg *); -void -xlate_ofproto_set(struct ofproto_dpif *ofproto, const char *name, - struct dpif *dpif, struct rule_dpif *miss_rule, - struct rule_dpif *no_packet_in_rule, +static inline void +xlate_report(struct xlate_ctx *ctx, const char *s) +{ + if (OVS_UNLIKELY(ctx->xin->report_hook)) { + ctx->xin->report_hook(ctx->xin, s, ctx->recurse); + } +} + +static void +xlate_xbridge_init(struct xlate_cfg *xcfg, struct xbridge *xbridge) +{ + list_init(&xbridge->xbundles); + hmap_init(&xbridge->xports); + hmap_insert(&xcfg->xbridges, &xbridge->hmap_node, + hash_pointer(xbridge->ofproto, 0)); +} + +static void +xlate_xbundle_init(struct xlate_cfg *xcfg, struct xbundle *xbundle) +{ + list_init(&xbundle->xports); + list_insert(&xbundle->xbridge->xbundles, &xbundle->list_node); + hmap_insert(&xcfg->xbundles, &xbundle->hmap_node, + hash_pointer(xbundle->ofbundle, 0)); +} + +static void +xlate_xport_init(struct xlate_cfg *xcfg, struct xport *xport) +{ + hmap_init(&xport->skb_priorities); + hmap_insert(&xcfg->xports, &xport->hmap_node, + hash_pointer(xport->ofport, 0)); + hmap_insert(&xport->xbridge->xports, &xport->ofp_node, + hash_ofp_port(xport->ofp_port)); +} + +static void +xlate_xbridge_set(struct xbridge *xbridge, + struct dpif *dpif, const struct mac_learning *ml, struct stp *stp, + struct rstp *rstp, const struct mcast_snooping *ms, const struct mbridge *mbridge, const struct dpif_sflow *sflow, const struct dpif_ipfix *ipfix, - const struct netflow *netflow, enum ofp_config_flags frag, + const struct netflow *netflow, bool forward_bpdu, bool has_in_band, - bool enable_recirc, - bool variable_length_userdata, - size_t max_mpls_depth) + const struct dpif_backer_support *support) { - struct xbridge *xbridge = xbridge_lookup(ofproto); - - if (!xbridge) { - xbridge = xzalloc(sizeof *xbridge); - xbridge->ofproto = ofproto; - - hmap_insert(&xbridges, &xbridge->hmap_node, hash_pointer(ofproto, 0)); - hmap_init(&xbridge->xports); - list_init(&xbridge->xbundles); - } - if (xbridge->ml != ml) { mac_learning_unref(xbridge->ml); xbridge->ml = mac_learning_ref(ml); } + if (xbridge->ms != ms) { + mcast_snooping_unref(xbridge->ms); + xbridge->ms = mcast_snooping_ref(ms); + } + if (xbridge->mbridge != mbridge) { mbridge_unref(xbridge->mbridge); xbridge->mbridge = mbridge_ref(mbridge); @@ -377,29 +582,280 @@ xbridge->stp = stp_ref(stp); } + if (xbridge->rstp != rstp) { + rstp_unref(xbridge->rstp); + xbridge->rstp = rstp_ref(rstp); + } + if (xbridge->netflow != netflow) { netflow_unref(xbridge->netflow); xbridge->netflow = netflow_ref(netflow); } - free(xbridge->name); - xbridge->name = xstrdup(name); - xbridge->dpif = dpif; xbridge->forward_bpdu = forward_bpdu; xbridge->has_in_band = has_in_band; - xbridge->frag = frag; - xbridge->miss_rule = miss_rule; - xbridge->no_packet_in_rule = no_packet_in_rule; - xbridge->enable_recirc = enable_recirc; - xbridge->variable_length_userdata = variable_length_userdata; - xbridge->max_mpls_depth = max_mpls_depth; + xbridge->support = *support; +} + +static void +xlate_xbundle_set(struct xbundle *xbundle, + enum port_vlan_mode vlan_mode, int vlan, + unsigned long *trunks, bool use_priority_tags, + const struct bond *bond, const struct lacp *lacp, + bool floodable) +{ + ovs_assert(xbundle->xbridge); + + xbundle->vlan_mode = vlan_mode; + xbundle->vlan = vlan; + xbundle->trunks = trunks; + xbundle->use_priority_tags = use_priority_tags; + xbundle->floodable = floodable; + + if (xbundle->bond != bond) { + bond_unref(xbundle->bond); + xbundle->bond = bond_ref(bond); + } + + if (xbundle->lacp != lacp) { + lacp_unref(xbundle->lacp); + xbundle->lacp = lacp_ref(lacp); + } +} + +static void +xlate_xport_set(struct xport *xport, odp_port_t odp_port, + const struct netdev *netdev, const struct cfm *cfm, + const struct bfd *bfd, const struct lldp *lldp, int stp_port_no, + const struct rstp_port* rstp_port, + enum ofputil_port_config config, enum ofputil_port_state state, + bool is_tunnel, bool may_enable) +{ + xport->config = config; + xport->state = state; + xport->stp_port_no = stp_port_no; + xport->is_tunnel = is_tunnel; + xport->may_enable = may_enable; + xport->odp_port = odp_port; + + if (xport->rstp_port != rstp_port) { + rstp_port_unref(xport->rstp_port); + xport->rstp_port = rstp_port_ref(rstp_port); + } + + if (xport->cfm != cfm) { + cfm_unref(xport->cfm); + xport->cfm = cfm_ref(cfm); + } + + if (xport->bfd != bfd) { + bfd_unref(xport->bfd); + xport->bfd = bfd_ref(bfd); + } + + if (xport->lldp != lldp) { + lldp_unref(xport->lldp); + xport->lldp = lldp_ref(lldp); + } + + if (xport->netdev != netdev) { + netdev_close(xport->netdev); + xport->netdev = netdev_ref(netdev); + } } +static void +xlate_xbridge_copy(struct xbridge *xbridge) +{ + struct xbundle *xbundle; + struct xport *xport; + struct xbridge *new_xbridge = xzalloc(sizeof *xbridge); + new_xbridge->ofproto = xbridge->ofproto; + new_xbridge->name = xstrdup(xbridge->name); + xlate_xbridge_init(new_xcfg, new_xbridge); + + xlate_xbridge_set(new_xbridge, + xbridge->dpif, xbridge->ml, xbridge->stp, + xbridge->rstp, xbridge->ms, xbridge->mbridge, + xbridge->sflow, xbridge->ipfix, xbridge->netflow, + xbridge->forward_bpdu, xbridge->has_in_band, + &xbridge->support); + LIST_FOR_EACH (xbundle, list_node, &xbridge->xbundles) { + xlate_xbundle_copy(new_xbridge, xbundle); + } + + /* Copy xports which are not part of a xbundle */ + HMAP_FOR_EACH (xport, ofp_node, &xbridge->xports) { + if (!xport->xbundle) { + xlate_xport_copy(new_xbridge, NULL, xport); + } + } +} + +static void +xlate_xbundle_copy(struct xbridge *xbridge, struct xbundle *xbundle) +{ + struct xport *xport; + struct xbundle *new_xbundle = xzalloc(sizeof *xbundle); + new_xbundle->ofbundle = xbundle->ofbundle; + new_xbundle->xbridge = xbridge; + new_xbundle->name = xstrdup(xbundle->name); + xlate_xbundle_init(new_xcfg, new_xbundle); + + xlate_xbundle_set(new_xbundle, xbundle->vlan_mode, + xbundle->vlan, xbundle->trunks, + xbundle->use_priority_tags, xbundle->bond, xbundle->lacp, + xbundle->floodable); + LIST_FOR_EACH (xport, bundle_node, &xbundle->xports) { + xlate_xport_copy(xbridge, new_xbundle, xport); + } +} + +static void +xlate_xport_copy(struct xbridge *xbridge, struct xbundle *xbundle, + struct xport *xport) +{ + struct skb_priority_to_dscp *pdscp, *new_pdscp; + struct xport *new_xport = xzalloc(sizeof *xport); + new_xport->ofport = xport->ofport; + new_xport->ofp_port = xport->ofp_port; + new_xport->xbridge = xbridge; + xlate_xport_init(new_xcfg, new_xport); + + xlate_xport_set(new_xport, xport->odp_port, xport->netdev, xport->cfm, + xport->bfd, xport->lldp, xport->stp_port_no, + xport->rstp_port, xport->config, xport->state, + xport->is_tunnel, xport->may_enable); + + if (xport->peer) { + struct xport *peer = xport_lookup(new_xcfg, xport->peer->ofport); + if (peer) { + new_xport->peer = peer; + new_xport->peer->peer = new_xport; + } + } + + if (xbundle) { + new_xport->xbundle = xbundle; + list_insert(&new_xport->xbundle->xports, &new_xport->bundle_node); + } + + HMAP_FOR_EACH (pdscp, hmap_node, &xport->skb_priorities) { + new_pdscp = xmalloc(sizeof *pdscp); + new_pdscp->skb_priority = pdscp->skb_priority; + new_pdscp->dscp = pdscp->dscp; + hmap_insert(&new_xport->skb_priorities, &new_pdscp->hmap_node, + hash_int(new_pdscp->skb_priority, 0)); + } +} + +/* Sets the current xlate configuration to new_xcfg and frees the old xlate + * configuration in xcfgp. + * + * This needs to be called after editing the xlate configuration. + * + * Functions that edit the new xlate configuration are + * xlate__set and xlate__remove. + * + * A sample workflow: + * + * xlate_txn_start(); + * ... + * edit_xlate_configuration(); + * ... + * xlate_txn_commit(); */ void -xlate_remove_ofproto(struct ofproto_dpif *ofproto) +xlate_txn_commit(void) +{ + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + + ovsrcu_set(&xcfgp, new_xcfg); + ovsrcu_synchronize(); + xlate_xcfg_free(xcfg); + new_xcfg = NULL; +} + +/* Copies the current xlate configuration in xcfgp to new_xcfg. + * + * This needs to be called prior to editing the xlate configuration. */ +void +xlate_txn_start(void) +{ + struct xbridge *xbridge; + struct xlate_cfg *xcfg; + + ovs_assert(!new_xcfg); + + new_xcfg = xmalloc(sizeof *new_xcfg); + hmap_init(&new_xcfg->xbridges); + hmap_init(&new_xcfg->xbundles); + hmap_init(&new_xcfg->xports); + + xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + if (!xcfg) { + return; + } + + HMAP_FOR_EACH (xbridge, hmap_node, &xcfg->xbridges) { + xlate_xbridge_copy(xbridge); + } +} + + +static void +xlate_xcfg_free(struct xlate_cfg *xcfg) +{ + struct xbridge *xbridge, *next_xbridge; + + if (!xcfg) { + return; + } + + HMAP_FOR_EACH_SAFE (xbridge, next_xbridge, hmap_node, &xcfg->xbridges) { + xlate_xbridge_remove(xcfg, xbridge); + } + + hmap_destroy(&xcfg->xbridges); + hmap_destroy(&xcfg->xbundles); + hmap_destroy(&xcfg->xports); + free(xcfg); +} + +void +xlate_ofproto_set(struct ofproto_dpif *ofproto, const char *name, + struct dpif *dpif, + const struct mac_learning *ml, struct stp *stp, + struct rstp *rstp, const struct mcast_snooping *ms, + const struct mbridge *mbridge, + const struct dpif_sflow *sflow, + const struct dpif_ipfix *ipfix, + const struct netflow *netflow, + bool forward_bpdu, bool has_in_band, + const struct dpif_backer_support *support) +{ + struct xbridge *xbridge; + + ovs_assert(new_xcfg); + + xbridge = xbridge_lookup(new_xcfg, ofproto); + if (!xbridge) { + xbridge = xzalloc(sizeof *xbridge); + xbridge->ofproto = ofproto; + + xlate_xbridge_init(new_xcfg, xbridge); + } + + free(xbridge->name); + xbridge->name = xstrdup(name); + + xlate_xbridge_set(xbridge, dpif, ml, stp, rstp, ms, mbridge, sflow, ipfix, + netflow, forward_bpdu, has_in_band, support); +} + +static void +xlate_xbridge_remove(struct xlate_cfg *xcfg, struct xbridge *xbridge) { - struct xbridge *xbridge = xbridge_lookup(ofproto); struct xbundle *xbundle, *next_xbundle; struct xport *xport, *next_xport; @@ -408,81 +864,78 @@ } HMAP_FOR_EACH_SAFE (xport, next_xport, ofp_node, &xbridge->xports) { - xlate_ofport_remove(xport->ofport); + xlate_xport_remove(xcfg, xport); } LIST_FOR_EACH_SAFE (xbundle, next_xbundle, list_node, &xbridge->xbundles) { - xlate_bundle_remove(xbundle->ofbundle); + xlate_xbundle_remove(xcfg, xbundle); } - hmap_remove(&xbridges, &xbridge->hmap_node); + hmap_remove(&xcfg->xbridges, &xbridge->hmap_node); mac_learning_unref(xbridge->ml); + mcast_snooping_unref(xbridge->ms); mbridge_unref(xbridge->mbridge); dpif_sflow_unref(xbridge->sflow); dpif_ipfix_unref(xbridge->ipfix); stp_unref(xbridge->stp); + rstp_unref(xbridge->rstp); hmap_destroy(&xbridge->xports); free(xbridge->name); free(xbridge); } void +xlate_remove_ofproto(struct ofproto_dpif *ofproto) +{ + struct xbridge *xbridge; + + ovs_assert(new_xcfg); + + xbridge = xbridge_lookup(new_xcfg, ofproto); + xlate_xbridge_remove(new_xcfg, xbridge); +} + +void xlate_bundle_set(struct ofproto_dpif *ofproto, struct ofbundle *ofbundle, const char *name, enum port_vlan_mode vlan_mode, int vlan, unsigned long *trunks, bool use_priority_tags, const struct bond *bond, const struct lacp *lacp, bool floodable) { - struct xbundle *xbundle = xbundle_lookup(ofbundle); + struct xbundle *xbundle; + + ovs_assert(new_xcfg); + xbundle = xbundle_lookup(new_xcfg, ofbundle); if (!xbundle) { xbundle = xzalloc(sizeof *xbundle); xbundle->ofbundle = ofbundle; - xbundle->xbridge = xbridge_lookup(ofproto); + xbundle->xbridge = xbridge_lookup(new_xcfg, ofproto); - hmap_insert(&xbundles, &xbundle->hmap_node, hash_pointer(ofbundle, 0)); - list_insert(&xbundle->xbridge->xbundles, &xbundle->list_node); - list_init(&xbundle->xports); + xlate_xbundle_init(new_xcfg, xbundle); } - ovs_assert(xbundle->xbridge); - free(xbundle->name); xbundle->name = xstrdup(name); - xbundle->vlan_mode = vlan_mode; - xbundle->vlan = vlan; - xbundle->trunks = trunks; - xbundle->use_priority_tags = use_priority_tags; - xbundle->floodable = floodable; - - if (xbundle->bond != bond) { - bond_unref(xbundle->bond); - xbundle->bond = bond_ref(bond); - } - - if (xbundle->lacp != lacp) { - lacp_unref(xbundle->lacp); - xbundle->lacp = lacp_ref(lacp); - } + xlate_xbundle_set(xbundle, vlan_mode, vlan, trunks, + use_priority_tags, bond, lacp, floodable); } -void -xlate_bundle_remove(struct ofbundle *ofbundle) +static void +xlate_xbundle_remove(struct xlate_cfg *xcfg, struct xbundle *xbundle) { - struct xbundle *xbundle = xbundle_lookup(ofbundle); - struct xport *xport, *next; + struct xport *xport; if (!xbundle) { return; } - LIST_FOR_EACH_SAFE (xport, next, bundle_node, &xbundle->xports) { - list_remove(&xport->bundle_node); + LIST_FOR_EACH_POP (xport, bundle_node, &xbundle->xports) { xport->xbundle = NULL; } - hmap_remove(&xbundles, &xbundle->hmap_node); + hmap_remove(&xcfg->xbundles, &xbundle->hmap_node); list_remove(&xbundle->list_node); bond_unref(xbundle->bond); lacp_unref(xbundle->lacp); @@ -491,59 +944,53 @@ } void +xlate_bundle_remove(struct ofbundle *ofbundle) +{ + struct xbundle *xbundle; + + ovs_assert(new_xcfg); + + xbundle = xbundle_lookup(new_xcfg, ofbundle); + xlate_xbundle_remove(new_xcfg, xbundle); +} + +void xlate_ofport_set(struct ofproto_dpif *ofproto, struct ofbundle *ofbundle, struct ofport_dpif *ofport, ofp_port_t ofp_port, odp_port_t odp_port, const struct netdev *netdev, const struct cfm *cfm, const struct bfd *bfd, - struct ofport_dpif *peer, int stp_port_no, + const struct lldp *lldp, struct ofport_dpif *peer, + int stp_port_no, const struct rstp_port *rstp_port, const struct ofproto_port_queue *qdscp_list, size_t n_qdscp, enum ofputil_port_config config, enum ofputil_port_state state, bool is_tunnel, bool may_enable) { - struct xport *xport = xport_lookup(ofport); size_t i; + struct xport *xport; + ovs_assert(new_xcfg); + + xport = xport_lookup(new_xcfg, ofport); if (!xport) { xport = xzalloc(sizeof *xport); xport->ofport = ofport; - xport->xbridge = xbridge_lookup(ofproto); + xport->xbridge = xbridge_lookup(new_xcfg, ofproto); xport->ofp_port = ofp_port; - hmap_init(&xport->skb_priorities); - hmap_insert(&xports, &xport->hmap_node, hash_pointer(ofport, 0)); - hmap_insert(&xport->xbridge->xports, &xport->ofp_node, - hash_ofp_port(xport->ofp_port)); + xlate_xport_init(new_xcfg, xport); } ovs_assert(xport->ofp_port == ofp_port); - xport->config = config; - xport->state = state; - xport->stp_port_no = stp_port_no; - xport->is_tunnel = is_tunnel; - xport->may_enable = may_enable; - xport->odp_port = odp_port; - - if (xport->netdev != netdev) { - netdev_close(xport->netdev); - xport->netdev = netdev_ref(netdev); - } - - if (xport->cfm != cfm) { - cfm_unref(xport->cfm); - xport->cfm = cfm_ref(cfm); - } - - if (xport->bfd != bfd) { - bfd_unref(xport->bfd); - xport->bfd = bfd_ref(bfd); - } + xlate_xport_set(xport, odp_port, netdev, cfm, bfd, lldp, + stp_port_no, rstp_port, config, state, is_tunnel, + may_enable); if (xport->peer) { xport->peer->peer = NULL; } - xport->peer = xport_lookup(peer); + xport->peer = xport_lookup(new_xcfg, peer); if (xport->peer) { xport->peer->peer = xport; } @@ -551,7 +998,7 @@ if (xport->xbundle) { list_remove(&xport->bundle_node); } - xport->xbundle = xbundle_lookup(ofbundle); + xport->xbundle = xbundle_lookup(new_xcfg, ofbundle); if (xport->xbundle) { list_insert(&xport->xbundle->xports, &xport->bundle_node); } @@ -574,11 +1021,9 @@ } } -void -xlate_ofport_remove(struct ofport_dpif *ofport) +static void +xlate_xport_remove(struct xlate_cfg *xcfg, struct xport *xport) { - struct xport *xport = xport_lookup(ofport); - if (!xport) { return; } @@ -595,110 +1040,116 @@ clear_skb_priorities(xport); hmap_destroy(&xport->skb_priorities); - hmap_remove(&xports, &xport->hmap_node); + hmap_remove(&xcfg->xports, &xport->hmap_node); hmap_remove(&xport->xbridge->xports, &xport->ofp_node); netdev_close(xport->netdev); + rstp_port_unref(xport->rstp_port); cfm_unref(xport->cfm); bfd_unref(xport->bfd); + lldp_unref(xport->lldp); free(xport); } -/* Given a datpath, packet, and flow metadata ('backer', 'packet', and 'key' - * respectively), populates 'flow' with the result of odp_flow_key_to_flow(). - * Optionally populates 'ofproto' with the ofproto_dpif, 'odp_in_port' with - * the datapath in_port, that 'packet' ingressed, and 'ipfix', 'sflow', and - * 'netflow' with the appropriate handles for those protocols if they're - * enabled. Caller is responsible for unrefing them. - * - * If 'ofproto' is nonnull, requires 'flow''s in_port to exist. Otherwise sets - * 'flow''s in_port to OFPP_NONE. - * - * This function does post-processing on data returned from - * odp_flow_key_to_flow() to help make VLAN splinters transparent to the rest - * of the upcall processing logic. In particular, if the extracted in_port is - * a VLAN splinter port, it replaces flow->in_port by the "real" port, sets - * flow->vlan_tci correctly for the VLAN of the VLAN splinter port, and pushes - * a VLAN header onto 'packet' (if it is nonnull). - * - * Similarly, this function also includes some logic to help with tunnels. It - * may modify 'flow' as necessary to make the tunneling implementation - * transparent to the upcall processing logic. - * - * Returns 0 if successful, ENODEV if the parsed flow has no associated ofport, - * or some other positive errno if there are other problems. */ -int -xlate_receive(const struct dpif_backer *backer, struct ofpbuf *packet, - const struct nlattr *key, size_t key_len, struct flow *flow, - struct ofproto_dpif **ofproto, struct dpif_ipfix **ipfix, - struct dpif_sflow **sflow, struct netflow **netflow, - odp_port_t *odp_in_port) +void +xlate_ofport_remove(struct ofport_dpif *ofport) { - const struct xport *xport; - int error = ENODEV; + struct xport *xport; - ovs_rwlock_rdlock(&xlate_rwlock); - if (odp_flow_key_to_flow(key, key_len, flow) == ODP_FIT_ERROR) { - error = EINVAL; - goto exit; - } + ovs_assert(new_xcfg); - if (odp_in_port) { - *odp_in_port = flow->in_port.odp_port; - } + xport = xport_lookup(new_xcfg, ofport); + xlate_xport_remove(new_xcfg, xport); +} - xport = xport_lookup(tnl_port_should_receive(flow) +static struct ofproto_dpif * +xlate_lookup_ofproto_(const struct dpif_backer *backer, const struct flow *flow, + ofp_port_t *ofp_in_port, const struct xport **xportp) +{ + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + const struct xport *xport; + + xport = xport_lookup(xcfg, tnl_port_should_receive(flow) ? tnl_port_receive(flow) : odp_port_to_ofport(backer, flow->in_port.odp_port)); - - flow->in_port.ofp_port = xport ? xport->ofp_port : OFPP_NONE; - if (!xport) { - goto exit; + if (OVS_UNLIKELY(!xport)) { + return NULL; } + *xportp = xport; + if (ofp_in_port) { + *ofp_in_port = xport->ofp_port; + } + return xport->xbridge->ofproto; +} - if (vsp_adjust_flow(xport->xbridge->ofproto, flow)) { - if (packet) { - /* Make the packet resemble the flow, so that it gets sent to - * an OpenFlow controller properly, so that it looks correct - * for sFlow, and so that flow_extract() will get the correct - * vlan_tci if it is called on 'packet'. */ - eth_push_vlan(packet, htons(ETH_TYPE_VLAN), flow->vlan_tci); - } +/* Given a datapath and flow metadata ('backer', and 'flow' respectively) + * returns the corresponding struct ofproto_dpif and OpenFlow port number. */ +struct ofproto_dpif * +xlate_lookup_ofproto(const struct dpif_backer *backer, const struct flow *flow, + ofp_port_t *ofp_in_port) +{ + const struct xport *xport; + + return xlate_lookup_ofproto_(backer, flow, ofp_in_port, &xport); +} + +/* Given a datapath and flow metadata ('backer', and 'flow' respectively), + * optionally populates 'ofproto' with the ofproto_dpif, 'ofp_in_port' with the + * openflow in_port, and 'ipfix', 'sflow', and 'netflow' with the appropriate + * handles for those protocols if they're enabled. Caller may use the returned + * pointers until quiescing, for longer term use additional references must + * be taken. + * + * Returns 0 if successful, ENODEV if the parsed flow has no associated ofproto. + */ +int +xlate_lookup(const struct dpif_backer *backer, const struct flow *flow, + struct ofproto_dpif **ofprotop, struct dpif_ipfix **ipfix, + struct dpif_sflow **sflow, struct netflow **netflow, + ofp_port_t *ofp_in_port) +{ + struct ofproto_dpif *ofproto; + const struct xport *xport; + + ofproto = xlate_lookup_ofproto_(backer, flow, ofp_in_port, &xport); + + if (!ofproto) { + return ENODEV; } - error = 0; - if (ofproto) { - *ofproto = xport->xbridge->ofproto; + if (ofprotop) { + *ofprotop = ofproto; } if (ipfix) { - *ipfix = dpif_ipfix_ref(xport->xbridge->ipfix); + *ipfix = xport ? xport->xbridge->ipfix : NULL; } if (sflow) { - *sflow = dpif_sflow_ref(xport->xbridge->sflow); + *sflow = xport ? xport->xbridge->sflow : NULL; } if (netflow) { - *netflow = netflow_ref(xport->xbridge->netflow); + *netflow = xport ? xport->xbridge->netflow : NULL; } -exit: - ovs_rwlock_unlock(&xlate_rwlock); - return error; + return 0; } static struct xbridge * -xbridge_lookup(const struct ofproto_dpif *ofproto) +xbridge_lookup(struct xlate_cfg *xcfg, const struct ofproto_dpif *ofproto) { + struct hmap *xbridges; struct xbridge *xbridge; - if (!ofproto) { + if (!ofproto || !xcfg) { return NULL; } + xbridges = &xcfg->xbridges; + HMAP_FOR_EACH_IN_BUCKET (xbridge, hmap_node, hash_pointer(ofproto, 0), - &xbridges) { + xbridges) { if (xbridge->ofproto == ofproto) { return xbridge; } @@ -707,16 +1158,19 @@ } static struct xbundle * -xbundle_lookup(const struct ofbundle *ofbundle) +xbundle_lookup(struct xlate_cfg *xcfg, const struct ofbundle *ofbundle) { + struct hmap *xbundles; struct xbundle *xbundle; - if (!ofbundle) { + if (!ofbundle || !xcfg) { return NULL; } + xbundles = &xcfg->xbundles; + HMAP_FOR_EACH_IN_BUCKET (xbundle, hmap_node, hash_pointer(ofbundle, 0), - &xbundles) { + xbundles) { if (xbundle->ofbundle == ofbundle) { return xbundle; } @@ -725,16 +1179,19 @@ } static struct xport * -xport_lookup(const struct ofport_dpif *ofport) +xport_lookup(struct xlate_cfg *xcfg, const struct ofport_dpif *ofport) { + struct hmap *xports; struct xport *xport; - if (!ofport) { + if (!ofport || !xcfg) { return NULL; } + xports = &xcfg->xports; + HMAP_FOR_EACH_IN_BUCKET (xport, hmap_node, hash_pointer(ofport, 0), - &xports) { + xports) { if (xport->ofport == ofport) { return xport; } @@ -754,14 +1211,18 @@ xport_stp_learn_state(const struct xport *xport) { struct stp_port *sp = xport_get_stp_port(xport); - return stp_learn_in_state(sp ? stp_port_get_state(sp) : STP_DISABLED); + return sp + ? stp_learn_in_state(stp_port_get_state(sp)) + : true; } static bool xport_stp_forward_state(const struct xport *xport) { struct stp_port *sp = xport_get_stp_port(xport); - return stp_forward_in_state(sp ? stp_port_get_state(sp) : STP_DISABLED); + return sp + ? stp_forward_in_state(stp_port_get_state(sp)) + : true; } static bool @@ -782,11 +1243,11 @@ } static void -stp_process_packet(const struct xport *xport, const struct ofpbuf *packet) +stp_process_packet(const struct xport *xport, const struct dp_packet *packet) { struct stp_port *sp = xport_get_stp_port(xport); - struct ofpbuf payload = *packet; - struct eth_header *eth = ofpbuf_data(&payload); + struct dp_packet payload = *packet; + struct eth_header *eth = dp_packet_data(&payload); /* Sink packets on ports that have STP disabled when the bridge has * STP enabled. */ @@ -795,12 +1256,64 @@ } /* Trim off padding on payload. */ - if (ofpbuf_size(&payload) > ntohs(eth->eth_type) + ETH_HEADER_LEN) { - ofpbuf_set_size(&payload, ntohs(eth->eth_type) + ETH_HEADER_LEN); + if (dp_packet_size(&payload) > ntohs(eth->eth_type) + ETH_HEADER_LEN) { + dp_packet_set_size(&payload, ntohs(eth->eth_type) + ETH_HEADER_LEN); + } + + if (dp_packet_try_pull(&payload, ETH_HEADER_LEN + LLC_HEADER_LEN)) { + stp_received_bpdu(sp, dp_packet_data(&payload), dp_packet_size(&payload)); + } +} + +static enum rstp_state +xport_get_rstp_port_state(const struct xport *xport) +{ + return xport->rstp_port + ? rstp_port_get_state(xport->rstp_port) + : RSTP_DISABLED; +} + +static bool +xport_rstp_learn_state(const struct xport *xport) +{ + return xport->xbridge->rstp && xport->rstp_port + ? rstp_learn_in_state(xport_get_rstp_port_state(xport)) + : true; +} + +static bool +xport_rstp_forward_state(const struct xport *xport) +{ + return xport->xbridge->rstp && xport->rstp_port + ? rstp_forward_in_state(xport_get_rstp_port_state(xport)) + : true; +} + +static bool +xport_rstp_should_manage_bpdu(const struct xport *xport) +{ + return rstp_should_manage_bpdu(xport_get_rstp_port_state(xport)); +} + +static void +rstp_process_packet(const struct xport *xport, const struct dp_packet *packet) +{ + struct dp_packet payload = *packet; + struct eth_header *eth = dp_packet_data(&payload); + + /* Sink packets on ports that have no RSTP. */ + if (!xport->rstp_port) { + return; + } + + /* Trim off padding on payload. */ + if (dp_packet_size(&payload) > ntohs(eth->eth_type) + ETH_HEADER_LEN) { + dp_packet_set_size(&payload, ntohs(eth->eth_type) + ETH_HEADER_LEN); } - if (ofpbuf_try_pull(&payload, ETH_HEADER_LEN + LLC_HEADER_LEN)) { - stp_received_bpdu(sp, ofpbuf_data(&payload), ofpbuf_size(&payload)); + if (dp_packet_try_pull(&payload, ETH_HEADER_LEN + LLC_HEADER_LEN)) { + rstp_port_received_bpdu(xport->rstp_port, dp_packet_data(&payload), + dp_packet_size(&payload)); } } @@ -828,18 +1341,11 @@ static bool odp_port_is_alive(const struct xlate_ctx *ctx, ofp_port_t ofp_port) { - struct xport *xport; - - xport = get_ofp_port(ctx->xbridge, ofp_port); - if (!xport || xport->config & OFPUTIL_PC_PORT_DOWN || - xport->state & OFPUTIL_PS_LINK_DOWN) { - return false; - } - - return true; + struct xport *xport = get_ofp_port(ctx->xbridge, ofp_port); + return xport && xport->may_enable; } -static const struct ofputil_bucket * +static struct ofputil_bucket * group_first_live_bucket(const struct xlate_ctx *, const struct group_dpif *, int depth); @@ -847,24 +1353,23 @@ group_is_alive(const struct xlate_ctx *ctx, uint32_t group_id, int depth) { struct group_dpif *group; - bool hit; - hit = group_dpif_lookup(ctx->xbridge->ofproto, group_id, &group); - if (!hit) { - return false; - } + if (group_dpif_lookup(ctx->xbridge->ofproto, group_id, &group)) { + struct ofputil_bucket *bucket; - hit = group_first_live_bucket(ctx, group, depth) != NULL; + bucket = group_first_live_bucket(ctx, group, depth); + group_dpif_unref(group); + return bucket == NULL; + } - group_dpif_release(group); - return hit; + return false; } #define MAX_LIVENESS_RECURSION 128 /* Arbitrary limit */ static bool bucket_is_alive(const struct xlate_ctx *ctx, - const struct ofputil_bucket *bucket, int depth) + struct ofputil_bucket *bucket, int depth) { if (depth >= MAX_LIVENESS_RECURSION) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); @@ -874,19 +1379,19 @@ return false; } - return !ofputil_bucket_has_liveness(bucket) || - (bucket->watch_port != OFPP_ANY && - odp_port_is_alive(ctx, bucket->watch_port)) || - (bucket->watch_group != OFPG_ANY && - group_is_alive(ctx, bucket->watch_group, depth + 1)); + return (!ofputil_bucket_has_liveness(bucket) + || (bucket->watch_port != OFPP_ANY + && odp_port_is_alive(ctx, bucket->watch_port)) + || (bucket->watch_group != OFPG_ANY + && group_is_alive(ctx, bucket->watch_group, depth + 1))); } -static const struct ofputil_bucket * +static struct ofputil_bucket * group_first_live_bucket(const struct xlate_ctx *ctx, const struct group_dpif *group, int depth) { struct ofputil_bucket *bucket; - const struct list *buckets; + const struct ovs_list *buckets; group_dpif_get_buckets(group, &buckets); LIST_FOR_EACH (bucket, list_node, buckets) { @@ -898,17 +1403,17 @@ return NULL; } -static const struct ofputil_bucket * +static struct ofputil_bucket * group_best_live_bucket(const struct xlate_ctx *ctx, const struct group_dpif *group, uint32_t basis) { - const struct ofputil_bucket *best_bucket = NULL; + struct ofputil_bucket *best_bucket = NULL; uint32_t best_score = 0; int i = 0; - const struct ofputil_bucket *bucket; - const struct list *buckets; + struct ofputil_bucket *bucket; + const struct ovs_list *buckets; group_dpif_get_buckets(group, &buckets); LIST_FOR_EACH (bucket, list_node, buckets) { @@ -1033,7 +1538,7 @@ "%s, which is reserved exclusively for mirroring", ctx->xbridge->name, in_xbundle->name); } - ofpbuf_clear(&ctx->xout->odp_actions); + ofpbuf_clear(ctx->xout->odp_actions); return; } @@ -1077,7 +1582,8 @@ mirrors &= ~dup_mirrors; ctx->xout->mirrors |= dup_mirrors; if (out) { - struct xbundle *out_xbundle = xbundle_lookup(out); + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + struct xbundle *out_xbundle = xbundle_lookup(xcfg, out); if (out_xbundle) { output_normal(ctx, out_xbundle, vlan); } @@ -1209,27 +1715,28 @@ uint16_t vid; ovs_be16 tci, old_tci; struct xport *xport; + struct xlate_bond_recirc xr; + bool use_recirc = false; vid = output_vlan_to_vid(out_xbundle, vlan); if (list_is_empty(&out_xbundle->xports)) { /* Partially configured bundle with no slaves. Drop the packet. */ return; } else if (!out_xbundle->bond) { - ctx->use_recirc = false; xport = CONTAINER_OF(list_front(&out_xbundle->xports), struct xport, bundle_node); } else { - struct ofport_dpif *ofport; - struct xlate_recirc *xr = &ctx->recirc; + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); struct flow_wildcards *wc = &ctx->xout->wc; + struct ofport_dpif *ofport; - if (ctx->xbridge->enable_recirc) { - ctx->use_recirc = bond_may_recirc( - out_xbundle->bond, &xr->recirc_id, &xr->hash_basis); + if (ctx->xbridge->support.recirc) { + use_recirc = bond_may_recirc( + out_xbundle->bond, &xr.recirc_id, &xr.hash_basis); - if (ctx->use_recirc) { + if (use_recirc) { /* Only TCP mode uses recirculation. */ - xr->hash_alg = OVS_HASH_ALG_L4; + xr.hash_alg = OVS_HASH_ALG_L4; bond_update_post_recirc_rules(out_xbundle->bond, false); /* Recirculation does not require unmasking hash fields. */ @@ -1239,16 +1746,16 @@ ofport = bond_choose_output_slave(out_xbundle->bond, &ctx->xin->flow, wc, vid); - xport = xport_lookup(ofport); + xport = xport_lookup(xcfg, ofport); if (!xport) { /* No slaves enabled, so drop packet. */ return; } - /* If ctx->xout->use_recirc is set, the main thread will handle stats + /* If use_recirc is set, the main thread will handle stats * accounting for this bond. */ - if (!ctx->use_recirc) { + if (!use_recirc) { if (ctx->xin->resubmit_stats) { bond_account(out_xbundle->bond, &ctx->xin->flow, vid, ctx->xin->resubmit_stats->n_bytes); @@ -1276,7 +1783,7 @@ } *flow_tci = tci; - compose_output_action(ctx, xport->ofp_port); + compose_output_action(ctx, xport->ofp_port, use_recirc ? &xr : NULL); *flow_tci = old_tci; } @@ -1308,6 +1815,67 @@ } } +/* Determines whether packets in 'flow' within 'xbridge' should be forwarded or + * dropped. Returns true if they may be forwarded, false if they should be + * dropped. + * + * 'in_port' must be the xport that corresponds to flow->in_port. + * 'in_port' must be part of a bundle (e.g. in_port->bundle must be nonnull). + * + * 'vlan' must be the VLAN that corresponds to flow->vlan_tci on 'in_port', as + * returned by input_vid_to_vlan(). It must be a valid VLAN for 'in_port', as + * checked by input_vid_is_valid(). + * + * May also add tags to '*tags', although the current implementation only does + * so in one special case. + */ +static bool +is_admissible(struct xlate_ctx *ctx, struct xport *in_port, + uint16_t vlan) +{ + struct xbundle *in_xbundle = in_port->xbundle; + const struct xbridge *xbridge = ctx->xbridge; + struct flow *flow = &ctx->xin->flow; + + /* Drop frames for reserved multicast addresses + * only if forward_bpdu option is absent. */ + if (!xbridge->forward_bpdu && eth_addr_is_reserved(flow->dl_dst)) { + xlate_report(ctx, "packet has reserved destination MAC, dropping"); + return false; + } + + if (in_xbundle->bond) { + struct mac_entry *mac; + + switch (bond_check_admissibility(in_xbundle->bond, in_port->ofport, + flow->dl_dst)) { + case BV_ACCEPT: + break; + + case BV_DROP: + xlate_report(ctx, "bonding refused admissibility, dropping"); + return false; + + case BV_DROP_IF_MOVED: + ovs_rwlock_rdlock(&xbridge->ml->rwlock); + mac = mac_learning_lookup(xbridge->ml, flow->dl_src, vlan); + if (mac + && mac_entry_get_port(xbridge->ml, mac) != in_xbundle->ofbundle + && (!is_gratuitous_arp(flow, &ctx->xout->wc) + || mac_entry_is_grat_arp_locked(mac))) { + ovs_rwlock_unlock(&xbridge->ml->rwlock); + xlate_report(ctx, "SLB bond thinks this packet looped back, " + "dropping"); + return false; + } + ovs_rwlock_unlock(&xbridge->ml->rwlock); + break; + } + } + + return true; +} + /* Checks whether a MAC learning update is necessary for MAC learning table * 'ml' given that a packet matching 'flow' was received on 'in_xbundle' in * 'vlan'. @@ -1346,7 +1914,7 @@ } } - return mac->port.p != in_xbundle->ofbundle; + return mac_entry_get_port(ml, mac) != in_xbundle->ofbundle; } @@ -1382,7 +1950,7 @@ } } - if (mac->port.p != in_xbundle->ofbundle) { + if (mac_entry_get_port(xbridge->ml, mac) != in_xbundle->ofbundle) { /* The log messages here could actually be useful in debugging, * so keep the rate limit relatively high. */ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300); @@ -1392,95 +1960,238 @@ xbridge->name, ETH_ADDR_ARGS(flow->dl_src), in_xbundle->name, vlan); - mac->port.p = in_xbundle->ofbundle; - mac_learning_changed(xbridge->ml); + mac_entry_set_port(xbridge->ml, mac, in_xbundle->ofbundle); + } +} + +static void +update_learning_table(const struct xbridge *xbridge, + const struct flow *flow, struct flow_wildcards *wc, + int vlan, struct xbundle *in_xbundle) +{ + bool need_update; + + /* Don't learn the OFPP_NONE port. */ + if (in_xbundle == &ofpp_none_bundle) { + return; + } + + /* First try the common case: no change to MAC learning table. */ + ovs_rwlock_rdlock(&xbridge->ml->rwlock); + need_update = is_mac_learning_update_needed(xbridge->ml, flow, wc, vlan, + in_xbundle); + ovs_rwlock_unlock(&xbridge->ml->rwlock); + + if (need_update) { + /* Slow path: MAC learning table might need an update. */ + ovs_rwlock_wrlock(&xbridge->ml->rwlock); + update_learning_table__(xbridge, flow, wc, vlan, in_xbundle); + ovs_rwlock_unlock(&xbridge->ml->rwlock); + } +} + +/* Updates multicast snooping table 'ms' given that a packet matching 'flow' + * was received on 'in_xbundle' in 'vlan' and is either Report or Query. */ +static void +update_mcast_snooping_table__(const struct xbridge *xbridge, + const struct flow *flow, + struct mcast_snooping *ms, + ovs_be32 ip4, int vlan, + struct xbundle *in_xbundle, + const struct dp_packet *packet) + OVS_REQ_WRLOCK(ms->rwlock) +{ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(60, 30); + int count; + + switch (ntohs(flow->tp_src)) { + case IGMP_HOST_MEMBERSHIP_REPORT: + case IGMPV2_HOST_MEMBERSHIP_REPORT: + if (mcast_snooping_add_group(ms, ip4, vlan, in_xbundle->ofbundle)) { + VLOG_DBG_RL(&rl, "bridge %s: multicast snooping learned that " + IP_FMT" is on port %s in VLAN %d", + xbridge->name, IP_ARGS(ip4), in_xbundle->name, vlan); + } + break; + case IGMP_HOST_LEAVE_MESSAGE: + if (mcast_snooping_leave_group(ms, ip4, vlan, in_xbundle->ofbundle)) { + VLOG_DBG_RL(&rl, "bridge %s: multicast snooping leaving " + IP_FMT" is on port %s in VLAN %d", + xbridge->name, IP_ARGS(ip4), in_xbundle->name, vlan); + } + break; + case IGMP_HOST_MEMBERSHIP_QUERY: + if (flow->nw_src && mcast_snooping_add_mrouter(ms, vlan, + in_xbundle->ofbundle)) { + VLOG_DBG_RL(&rl, "bridge %s: multicast snooping query from " + IP_FMT" is on port %s in VLAN %d", + xbridge->name, IP_ARGS(flow->nw_src), + in_xbundle->name, vlan); + } + break; + case IGMPV3_HOST_MEMBERSHIP_REPORT: + if ((count = mcast_snooping_add_report(ms, packet, vlan, + in_xbundle->ofbundle))) { + VLOG_DBG_RL(&rl, "bridge %s: multicast snooping processed %d " + "addresses on port %s in VLAN %d", + xbridge->name, count, in_xbundle->name, vlan); + } + break; + } +} + +/* Updates multicast snooping table 'ms' given that a packet matching 'flow' + * was received on 'in_xbundle' in 'vlan'. */ +static void +update_mcast_snooping_table(const struct xbridge *xbridge, + const struct flow *flow, int vlan, + struct xbundle *in_xbundle, + const struct dp_packet *packet) +{ + struct mcast_snooping *ms = xbridge->ms; + struct xlate_cfg *xcfg; + struct xbundle *mcast_xbundle; + struct mcast_port_bundle *fport; + + /* Don't learn the OFPP_NONE port. */ + if (in_xbundle == &ofpp_none_bundle) { + return; + } + + /* Don't learn from flood ports */ + mcast_xbundle = NULL; + ovs_rwlock_wrlock(&ms->rwlock); + xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + LIST_FOR_EACH(fport, node, &ms->fport_list) { + mcast_xbundle = xbundle_lookup(xcfg, fport->port); + if (mcast_xbundle == in_xbundle) { + break; + } + } + + if (!mcast_xbundle || mcast_xbundle != in_xbundle) { + update_mcast_snooping_table__(xbridge, flow, ms, flow->igmp_group_ip4, + vlan, in_xbundle, packet); } + ovs_rwlock_unlock(&ms->rwlock); } +/* send the packet to ports having the multicast group learned */ static void -update_learning_table(const struct xbridge *xbridge, - const struct flow *flow, struct flow_wildcards *wc, - int vlan, struct xbundle *in_xbundle) +xlate_normal_mcast_send_group(struct xlate_ctx *ctx, + struct mcast_snooping *ms OVS_UNUSED, + struct mcast_group *grp, + struct xbundle *in_xbundle, uint16_t vlan) + OVS_REQ_RDLOCK(ms->rwlock) { - bool need_update; + struct xlate_cfg *xcfg; + struct mcast_group_bundle *b; + struct xbundle *mcast_xbundle; - /* Don't learn the OFPP_NONE port. */ - if (in_xbundle == &ofpp_none_bundle) { - return; + xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + LIST_FOR_EACH(b, bundle_node, &grp->bundle_lru) { + mcast_xbundle = xbundle_lookup(xcfg, b->port); + if (mcast_xbundle && mcast_xbundle != in_xbundle) { + xlate_report(ctx, "forwarding to mcast group port"); + output_normal(ctx, mcast_xbundle, vlan); + } else if (!mcast_xbundle) { + xlate_report(ctx, "mcast group port is unknown, dropping"); + } else { + xlate_report(ctx, "mcast group port is input port, dropping"); + } } +} - /* First try the common case: no change to MAC learning table. */ - ovs_rwlock_rdlock(&xbridge->ml->rwlock); - need_update = is_mac_learning_update_needed(xbridge->ml, flow, wc, vlan, - in_xbundle); - ovs_rwlock_unlock(&xbridge->ml->rwlock); +/* send the packet to ports connected to multicast routers */ +static void +xlate_normal_mcast_send_mrouters(struct xlate_ctx *ctx, + struct mcast_snooping *ms, + struct xbundle *in_xbundle, uint16_t vlan) + OVS_REQ_RDLOCK(ms->rwlock) +{ + struct xlate_cfg *xcfg; + struct mcast_mrouter_bundle *mrouter; + struct xbundle *mcast_xbundle; - if (need_update) { - /* Slow path: MAC learning table might need an update. */ - ovs_rwlock_wrlock(&xbridge->ml->rwlock); - update_learning_table__(xbridge, flow, wc, vlan, in_xbundle); - ovs_rwlock_unlock(&xbridge->ml->rwlock); + xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + LIST_FOR_EACH(mrouter, mrouter_node, &ms->mrouter_lru) { + mcast_xbundle = xbundle_lookup(xcfg, mrouter->port); + if (mcast_xbundle && mcast_xbundle != in_xbundle) { + xlate_report(ctx, "forwarding to mcast router port"); + output_normal(ctx, mcast_xbundle, vlan); + } else if (!mcast_xbundle) { + xlate_report(ctx, "mcast router port is unknown, dropping"); + } else { + xlate_report(ctx, "mcast router port is input port, dropping"); + } } } -/* Determines whether packets in 'flow' within 'xbridge' should be forwarded or - * dropped. Returns true if they may be forwarded, false if they should be - * dropped. - * - * 'in_port' must be the xport that corresponds to flow->in_port. - * 'in_port' must be part of a bundle (e.g. in_port->bundle must be nonnull). - * - * 'vlan' must be the VLAN that corresponds to flow->vlan_tci on 'in_port', as - * returned by input_vid_to_vlan(). It must be a valid VLAN for 'in_port', as - * checked by input_vid_is_valid(). - * - * May also add tags to '*tags', although the current implementation only does - * so in one special case. - */ -static bool -is_admissible(struct xlate_ctx *ctx, struct xport *in_port, - uint16_t vlan) +/* send the packet to ports flagged to be flooded */ +static void +xlate_normal_mcast_send_fports(struct xlate_ctx *ctx, + struct mcast_snooping *ms, + struct xbundle *in_xbundle, uint16_t vlan) + OVS_REQ_RDLOCK(ms->rwlock) { - struct xbundle *in_xbundle = in_port->xbundle; - const struct xbridge *xbridge = ctx->xbridge; - struct flow *flow = &ctx->xin->flow; + struct xlate_cfg *xcfg; + struct mcast_port_bundle *fport; + struct xbundle *mcast_xbundle; - /* Drop frames for reserved multicast addresses - * only if forward_bpdu option is absent. */ - if (!xbridge->forward_bpdu && eth_addr_is_reserved(flow->dl_dst)) { - xlate_report(ctx, "packet has reserved destination MAC, dropping"); - return false; + xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + LIST_FOR_EACH(fport, node, &ms->fport_list) { + mcast_xbundle = xbundle_lookup(xcfg, fport->port); + if (mcast_xbundle && mcast_xbundle != in_xbundle) { + xlate_report(ctx, "forwarding to mcast flood port"); + output_normal(ctx, mcast_xbundle, vlan); + } else if (!mcast_xbundle) { + xlate_report(ctx, "mcast flood port is unknown, dropping"); + } else { + xlate_report(ctx, "mcast flood port is input port, dropping"); + } } +} - if (in_xbundle->bond) { - struct mac_entry *mac; +/* forward the Reports to configured ports */ +static void +xlate_normal_mcast_send_rports(struct xlate_ctx *ctx, + struct mcast_snooping *ms, + struct xbundle *in_xbundle, uint16_t vlan) + OVS_REQ_RDLOCK(ms->rwlock) +{ + struct xlate_cfg *xcfg; + struct mcast_port_bundle *rport; + struct xbundle *mcast_xbundle; - switch (bond_check_admissibility(in_xbundle->bond, in_port->ofport, - flow->dl_dst)) { - case BV_ACCEPT: - break; + xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + LIST_FOR_EACH(rport, node, &ms->rport_list) { + mcast_xbundle = xbundle_lookup(xcfg, rport->port); + if (mcast_xbundle && mcast_xbundle != in_xbundle) { + xlate_report(ctx, "forwarding Report to mcast flagged port"); + output_normal(ctx, mcast_xbundle, vlan); + } else if (!mcast_xbundle) { + xlate_report(ctx, "mcast port is unknown, dropping the Report"); + } else { + xlate_report(ctx, "mcast port is input port, dropping the Report"); + } + } +} - case BV_DROP: - xlate_report(ctx, "bonding refused admissibility, dropping"); - return false; +static void +xlate_normal_flood(struct xlate_ctx *ctx, struct xbundle *in_xbundle, + uint16_t vlan) +{ + struct xbundle *xbundle; - case BV_DROP_IF_MOVED: - ovs_rwlock_rdlock(&xbridge->ml->rwlock); - mac = mac_learning_lookup(xbridge->ml, flow->dl_src, vlan); - if (mac && mac->port.p != in_xbundle->ofbundle && - (!is_gratuitous_arp(flow, &ctx->xout->wc) - || mac_entry_is_grat_arp_locked(mac))) { - ovs_rwlock_unlock(&xbridge->ml->rwlock); - xlate_report(ctx, "SLB bond thinks this packet looped back, " - "dropping"); - return false; - } - ovs_rwlock_unlock(&xbridge->ml->rwlock); - break; + LIST_FOR_EACH (xbundle, list_node, &ctx->xbridge->xbundles) { + if (xbundle != in_xbundle + && xbundle_includes_vlan(xbundle, vlan) + && xbundle->floodable + && !xbundle_mirror_out(ctx->xbridge, xbundle)) { + output_normal(ctx, xbundle, vlan); } } - - return true; + ctx->xout->nf_output_iface = NF_OUT_FLOOD; } static void @@ -1561,34 +2272,95 @@ } /* Determine output bundle. */ - ovs_rwlock_rdlock(&ctx->xbridge->ml->rwlock); - mac = mac_learning_lookup(ctx->xbridge->ml, flow->dl_dst, vlan); - mac_port = mac ? mac->port.p : NULL; - ovs_rwlock_unlock(&ctx->xbridge->ml->rwlock); - - if (mac_port) { - struct xbundle *mac_xbundle = xbundle_lookup(mac_port); - if (mac_xbundle && mac_xbundle != in_xbundle) { - xlate_report(ctx, "forwarding to learned port"); - output_normal(ctx, mac_xbundle, vlan); - } else if (!mac_xbundle) { - xlate_report(ctx, "learned port is unknown, dropping"); + if (mcast_snooping_enabled(ctx->xbridge->ms) + && !eth_addr_is_broadcast(flow->dl_dst) + && eth_addr_is_multicast(flow->dl_dst) + && flow->dl_type == htons(ETH_TYPE_IP)) { + struct mcast_snooping *ms = ctx->xbridge->ms; + struct mcast_group *grp; + + if (flow->nw_proto == IPPROTO_IGMP) { + if (mcast_snooping_is_membership(flow->tp_src) || + mcast_snooping_is_query(flow->tp_src)) { + if (ctx->xin->may_learn) { + update_mcast_snooping_table(ctx->xbridge, flow, vlan, + in_xbundle, ctx->xin->packet); + } + /* + * IGMP packets need to take the slow path, in order to be + * processed for mdb updates. That will prevent expires + * firing off even after hosts have sent reports. + */ + ctx->xout->slow |= SLOW_ACTION; + } + + if (mcast_snooping_is_membership(flow->tp_src)) { + ovs_rwlock_rdlock(&ms->rwlock); + xlate_normal_mcast_send_mrouters(ctx, ms, in_xbundle, vlan); + /* RFC4541: section 2.1.1, item 1: A snooping switch should + * forward IGMP Membership Reports only to those ports where + * multicast routers are attached. Alternatively stated: a + * snooping switch should not forward IGMP Membership Reports + * to ports on which only hosts are attached. + * An administrative control may be provided to override this + * restriction, allowing the report messages to be flooded to + * other ports. */ + xlate_normal_mcast_send_rports(ctx, ms, in_xbundle, vlan); + ovs_rwlock_unlock(&ms->rwlock); + } else { + xlate_report(ctx, "multicast traffic, flooding"); + xlate_normal_flood(ctx, in_xbundle, vlan); + } + return; } else { - xlate_report(ctx, "learned port is input port, dropping"); + if (ip_is_local_multicast(flow->nw_dst)) { + /* RFC4541: section 2.1.2, item 2: Packets with a dst IP + * address in the 224.0.0.x range which are not IGMP must + * be forwarded on all ports */ + xlate_report(ctx, "RFC4541: section 2.1.2, item 2, flooding"); + xlate_normal_flood(ctx, in_xbundle, vlan); + return; + } } - } else { - struct xbundle *xbundle; - xlate_report(ctx, "no learned MAC for destination, flooding"); - LIST_FOR_EACH (xbundle, list_node, &ctx->xbridge->xbundles) { - if (xbundle != in_xbundle - && xbundle_includes_vlan(xbundle, vlan) - && xbundle->floodable - && !xbundle_mirror_out(ctx->xbridge, xbundle)) { - output_normal(ctx, xbundle, vlan); + /* forwarding to group base ports */ + ovs_rwlock_rdlock(&ms->rwlock); + grp = mcast_snooping_lookup(ms, flow->nw_dst, vlan); + if (grp) { + xlate_normal_mcast_send_group(ctx, ms, grp, in_xbundle, vlan); + xlate_normal_mcast_send_fports(ctx, ms, in_xbundle, vlan); + xlate_normal_mcast_send_mrouters(ctx, ms, in_xbundle, vlan); + } else { + if (mcast_snooping_flood_unreg(ms)) { + xlate_report(ctx, "unregistered multicast, flooding"); + xlate_normal_flood(ctx, in_xbundle, vlan); + } else { + xlate_normal_mcast_send_mrouters(ctx, ms, in_xbundle, vlan); + xlate_normal_mcast_send_fports(ctx, ms, in_xbundle, vlan); } } - ctx->xout->nf_output_iface = NF_OUT_FLOOD; + ovs_rwlock_unlock(&ms->rwlock); + } else { + ovs_rwlock_rdlock(&ctx->xbridge->ml->rwlock); + mac = mac_learning_lookup(ctx->xbridge->ml, flow->dl_dst, vlan); + mac_port = mac ? mac_entry_get_port(ctx->xbridge->ml, mac) : NULL; + ovs_rwlock_unlock(&ctx->xbridge->ml->rwlock); + + if (mac_port) { + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + struct xbundle *mac_xbundle = xbundle_lookup(xcfg, mac_port); + if (mac_xbundle && mac_xbundle != in_xbundle) { + xlate_report(ctx, "forwarding to learned port"); + output_normal(ctx, mac_xbundle, vlan); + } else if (!mac_xbundle) { + xlate_report(ctx, "learned port is unknown, dropping"); + } else { + xlate_report(ctx, "learned port is input port, dropping"); + } + } else { + xlate_report(ctx, "no learned MAC for destination, flooding"); + xlate_normal_flood(ctx, in_xbundle, vlan); + } } } @@ -1602,7 +2374,8 @@ const struct flow *flow, const uint32_t probability, const union user_action_cookie *cookie, - const size_t cookie_size) + const size_t cookie_size, + const odp_port_t tunnel_out_port) { size_t sample_offset, actions_offset; odp_port_t odp_port; @@ -1619,7 +2392,7 @@ pid = dpif_port_get_pid(xbridge->dpif, odp_port, flow_hash_5tuple(flow, 0)); cookie_offset = odp_put_userspace_action(pid, cookie, cookie_size, - odp_actions); + tunnel_out_port, odp_actions); nl_msg_end_nested(odp_actions, actions_offset); nl_msg_end_nested(odp_actions, sample_offset); @@ -1677,7 +2450,7 @@ odp_port == ODPP_NONE ? 0 : 1, &cookie); return compose_sample_action(xbridge, odp_actions, flow, probability, - &cookie, sizeof cookie.sflow); + &cookie, sizeof cookie.sflow, ODPP_NONE); } static void @@ -1693,29 +2466,54 @@ } static void -compose_ipfix_cookie(union user_action_cookie *cookie) +compose_ipfix_cookie(union user_action_cookie *cookie, + odp_port_t output_odp_port) { cookie->type = USER_ACTION_COOKIE_IPFIX; + cookie->ipfix.output_odp_port = output_odp_port; } /* Compose SAMPLE action for IPFIX bridge sampling. */ static void compose_ipfix_action(const struct xbridge *xbridge, struct ofpbuf *odp_actions, - const struct flow *flow) + const struct flow *flow, + odp_port_t output_odp_port) { uint32_t probability; union user_action_cookie cookie; + odp_port_t tunnel_out_port = ODPP_NONE; if (!xbridge->ipfix || flow->in_port.ofp_port == OFPP_NONE) { return; } + /* For input case, output_odp_port is ODPP_NONE, which is an invalid port + * number. */ + if (output_odp_port == ODPP_NONE && + !dpif_ipfix_get_bridge_exporter_input_sampling(xbridge->ipfix)) { + return; + } + + /* For output case, output_odp_port is valid*/ + if (output_odp_port != ODPP_NONE) { + if (!dpif_ipfix_get_bridge_exporter_output_sampling(xbridge->ipfix)) { + return; + } + /* If tunnel sampling is enabled, put an additional option attribute: + * OVS_USERSPACE_ATTR_TUNNEL_OUT_PORT + */ + if (dpif_ipfix_get_bridge_exporter_tunnel_sampling(xbridge->ipfix) && + dpif_ipfix_get_tunnel_port(xbridge->ipfix, output_odp_port) ) { + tunnel_out_port = output_odp_port; + } + } + probability = dpif_ipfix_get_bridge_exporter_probability(xbridge->ipfix); - compose_ipfix_cookie(&cookie); + compose_ipfix_cookie(&cookie, output_odp_port); compose_sample_action(xbridge, odp_actions, flow, probability, - &cookie, sizeof cookie.ipfix); + &cookie, sizeof cookie.ipfix, tunnel_out_port); } /* SAMPLE action for sFlow must be first action in any given list of @@ -1725,7 +2523,7 @@ add_sflow_action(struct xlate_ctx *ctx) { ctx->user_cookie_offset = compose_sflow_action(ctx->xbridge, - &ctx->xout->odp_actions, + ctx->xout->odp_actions, &ctx->xin->flow, ODPP_NONE); ctx->sflow_odp_port = 0; ctx->sflow_n_outputs = 0; @@ -1736,8 +2534,15 @@ static void add_ipfix_action(struct xlate_ctx *ctx) { - compose_ipfix_action(ctx->xbridge, &ctx->xout->odp_actions, - &ctx->xin->flow); + compose_ipfix_action(ctx->xbridge, ctx->xout->odp_actions, + &ctx->xin->flow, ODPP_NONE); +} + +static void +add_ipfix_output_action(struct xlate_ctx *ctx, odp_port_t port) +{ + compose_ipfix_action(ctx->xbridge, ctx->xout->odp_actions, + &ctx->xin->flow, port); } /* Fix SAMPLE action according to data collected while composing ODP actions. @@ -1753,7 +2558,7 @@ return; } - cookie = ofpbuf_at(&ctx->xout->odp_actions, ctx->user_cookie_offset, + cookie = ofpbuf_at(ctx->xout->odp_actions, ctx->user_cookie_offset, sizeof cookie->sflow); ovs_assert(cookie->type == USER_ACTION_COOKIE_SFLOW); @@ -1763,7 +2568,7 @@ static enum slow_path_reason process_special(struct xlate_ctx *ctx, const struct flow *flow, - const struct xport *xport, const struct ofpbuf *packet) + const struct xport *xport, const struct dp_packet *packet) { struct flow_wildcards *wc = &ctx->xout->wc; const struct xbridge *xbridge = ctx->xbridge; @@ -1790,32 +2595,163 @@ lacp_process_packet(xport->xbundle->lacp, xport->ofport, packet); } return SLOW_LACP; - } else if (xbridge->stp && stp_should_process_flow(flow, wc)) { + } else if ((xbridge->stp || xbridge->rstp) && + stp_should_process_flow(flow, wc)) { if (packet) { - stp_process_packet(xport, packet); + xbridge->stp + ? stp_process_packet(xport, packet) + : rstp_process_packet(xport, packet); } return SLOW_STP; + } else if (xport->lldp && lldp_should_process_flow(xport->lldp, flow)) { + if (packet) { + lldp_process_packet(xport->lldp, packet); + } + return SLOW_LLDP; } else { return 0; } } +static int +tnl_route_lookup_flow(const struct flow *oflow, + ovs_be32 *ip, struct xport **out_port) +{ + char out_dev[IFNAMSIZ]; + struct xbridge *xbridge; + struct xlate_cfg *xcfg; + ovs_be32 gw; + + if (!ovs_router_lookup(oflow->tunnel.ip_dst, out_dev, &gw)) { + return -ENOENT; + } + + if (gw) { + *ip = gw; + } else { + *ip = oflow->tunnel.ip_dst; + } + + xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + ovs_assert(xcfg); + + HMAP_FOR_EACH (xbridge, hmap_node, &xcfg->xbridges) { + if (!strncmp(xbridge->name, out_dev, IFNAMSIZ)) { + struct xport *port; + + HMAP_FOR_EACH (port, ofp_node, &xbridge->xports) { + if (!strncmp(netdev_get_name(port->netdev), out_dev, IFNAMSIZ)) { + *out_port = port; + return 0; + } + } + } + } + return -ENOENT; +} + +static int +xlate_flood_packet(struct xbridge *xbridge, struct dp_packet *packet) +{ + struct ofpact_output output; + struct flow flow; + + ofpact_init(&output.ofpact, OFPACT_OUTPUT, sizeof output); + /* Use OFPP_NONE as the in_port to avoid special packet processing. */ + flow_extract(packet, &flow); + flow.in_port.ofp_port = OFPP_NONE; + output.port = OFPP_FLOOD; + output.max_len = 0; + + return ofproto_dpif_execute_actions(xbridge->ofproto, &flow, NULL, + &output.ofpact, sizeof output, + packet); +} + +static void +tnl_send_arp_request(const struct xport *out_dev, const uint8_t eth_src[ETH_ADDR_LEN], + ovs_be32 ip_src, ovs_be32 ip_dst) +{ + struct xbridge *xbridge = out_dev->xbridge; + struct dp_packet packet; + + dp_packet_init(&packet, 0); + compose_arp(&packet, eth_src, ip_src, ip_dst); + + xlate_flood_packet(xbridge, &packet); + dp_packet_uninit(&packet); +} + +static int +build_tunnel_send(const struct xlate_ctx *ctx, const struct xport *xport, + const struct flow *flow, odp_port_t tunnel_odp_port) +{ + struct ovs_action_push_tnl tnl_push_data; + struct xport *out_dev = NULL; + ovs_be32 s_ip, d_ip = 0; + uint8_t smac[ETH_ADDR_LEN]; + uint8_t dmac[ETH_ADDR_LEN]; + int err; + + err = tnl_route_lookup_flow(flow, &d_ip, &out_dev); + if (err) { + return err; + } + + /* Use mac addr of bridge port of the peer. */ + err = netdev_get_etheraddr(out_dev->netdev, smac); + if (err) { + return err; + } + + err = netdev_get_in4(out_dev->netdev, (struct in_addr *) &s_ip, NULL); + if (err) { + return err; + } + + err = tnl_arp_lookup(out_dev->xbridge->name, d_ip, dmac); + if (err) { + tnl_send_arp_request(out_dev, smac, s_ip, d_ip); + return err; + } + if (ctx->xin->xcache) { + struct xc_entry *entry; + + entry = xlate_cache_add_entry(ctx->xin->xcache, XC_TNL_ARP); + ovs_strlcpy(entry->u.tnl_arp_cache.br_name, out_dev->xbridge->name, + sizeof entry->u.tnl_arp_cache.br_name); + entry->u.tnl_arp_cache.d_ip = d_ip; + } + err = tnl_port_build_header(xport->ofport, flow, + dmac, smac, s_ip, &tnl_push_data); + if (err) { + return err; + } + tnl_push_data.tnl_port = odp_to_u32(tunnel_odp_port); + tnl_push_data.out_port = odp_to_u32(out_dev->odp_port); + odp_put_tnl_push_action(ctx->xout->odp_actions, &tnl_push_data); + return 0; +} + static void compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port, - bool check_stp) + const struct xlate_bond_recirc *xr, bool check_stp) { const struct xport *xport = get_ofp_port(ctx->xbridge, ofp_port); struct flow_wildcards *wc = &ctx->xout->wc; struct flow *flow = &ctx->xin->flow; + struct flow_tnl flow_tnl; ovs_be16 flow_vlan_tci; uint32_t flow_pkt_mark; uint8_t flow_nw_tos; odp_port_t out_port, odp_port; + bool tnl_push_pop_send = false; uint8_t dscp; /* If 'struct flow' gets additional metadata, we'll need to zero it out * before traversing a patch port. */ - BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26); + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31); + memset(&flow_tnl, 0, sizeof flow_tnl); if (!xport) { xlate_report(ctx, "Nonexistent output port"); @@ -1825,14 +2761,26 @@ return; } else if (check_stp) { if (is_stp(&ctx->base_flow)) { - if (!xport_stp_should_forward_bpdu(xport)) { - xlate_report(ctx, "STP not in listening state, " - "skipping bpdu output"); + if (!xport_stp_should_forward_bpdu(xport) && + !xport_rstp_should_manage_bpdu(xport)) { + if (ctx->xbridge->stp != NULL) { + xlate_report(ctx, "STP not in listening state, " + "skipping bpdu output"); + } else if (ctx->xbridge->rstp != NULL) { + xlate_report(ctx, "RSTP not managing BPDU in this state, " + "skipping bpdu output"); + } return; } - } else if (!xport_stp_forward_state(xport)) { - xlate_report(ctx, "STP not in forwarding state, " - "skipping output"); + } else if (!xport_stp_forward_state(xport) || + !xport_rstp_forward_state(xport)) { + if (ctx->xbridge->stp != NULL) { + xlate_report(ctx, "STP not in forwarding state, " + "skipping output"); + } else if (ctx->xbridge->rstp != NULL) { + xlate_report(ctx, "RSTP not in forwarding state, " + "skipping output"); + } return; } } @@ -1845,36 +2793,86 @@ if (xport->peer) { const struct xport *peer = xport->peer; struct flow old_flow = ctx->xin->flow; + bool old_was_mpls = ctx->was_mpls; + cls_version_t old_version = ctx->tables_version; enum slow_path_reason special; + struct ofpbuf old_stack = ctx->stack; + union mf_subvalue new_stack[1024 / sizeof(union mf_subvalue)]; + struct ofpbuf old_action_set = ctx->action_set; + uint64_t actset_stub[1024 / 8]; + ofpbuf_use_stub(&ctx->stack, new_stack, sizeof new_stack); + ofpbuf_use_stub(&ctx->action_set, actset_stub, sizeof actset_stub); ctx->xbridge = peer->xbridge; flow->in_port.ofp_port = peer->ofp_port; flow->metadata = htonll(0); memset(&flow->tunnel, 0, sizeof flow->tunnel); memset(flow->regs, 0, sizeof flow->regs); + flow->actset_output = OFPP_UNSET; + + /* The bridge is now known so obtain its table version. */ + ctx->tables_version + = ofproto_dpif_get_tables_version(ctx->xbridge->ofproto); special = process_special(ctx, &ctx->xin->flow, peer, ctx->xin->packet); if (special) { ctx->xout->slow |= special; } else if (may_receive(peer, ctx)) { - if (xport_stp_forward_state(peer)) { + if (xport_stp_forward_state(peer) && xport_rstp_forward_state(peer)) { xlate_table_action(ctx, flow->in_port.ofp_port, 0, true, true); + if (ctx->action_set.size) { + /* Translate action set only if not dropping the packet and + * not recirculating. */ + if (!exit_recirculates(ctx)) { + xlate_action_set(ctx); + } + } + /* Check if need to recirculate. */ + if (exit_recirculates(ctx)) { + compose_recirculate_action(ctx); + } } else { - /* Forwarding is disabled by STP. Let OFPP_NORMAL and the - * learning action look at the packet, then drop it. */ + /* Forwarding is disabled by STP and RSTP. Let OFPP_NORMAL and + * the learning action look at the packet, then drop it. */ struct flow old_base_flow = ctx->base_flow; - size_t old_size = ofpbuf_size(&ctx->xout->odp_actions); + size_t old_size = ctx->xout->odp_actions->size; mirror_mask_t old_mirrors = ctx->xout->mirrors; + xlate_table_action(ctx, flow->in_port.ofp_port, 0, true, true); ctx->xout->mirrors = old_mirrors; ctx->base_flow = old_base_flow; - ofpbuf_set_size(&ctx->xout->odp_actions, old_size); + ctx->xout->odp_actions->size = old_size; + + /* Undo changes that may have been done for recirculation. */ + if (exit_recirculates(ctx)) { + ctx->action_set.size = ctx->recirc_action_offset; + ctx->recirc_action_offset = -1; + ctx->last_unroll_offset = -1; + } } } ctx->xin->flow = old_flow; ctx->xbridge = xport->xbridge; + ofpbuf_uninit(&ctx->action_set); + ctx->action_set = old_action_set; + ofpbuf_uninit(&ctx->stack); + ctx->stack = old_stack; + + /* Restore calling bridge's lookup version. */ + ctx->tables_version = old_version; + + /* The peer bridge popping MPLS should have no effect on the original + * bridge. */ + ctx->was_mpls = old_was_mpls; + + /* The fact that the peer bridge exits (for any reason) does not mean + * that the original bridge should exit. Specifically, if the peer + * bridge recirculates (which typically modifies the packet), the + * original bridge must continue processing with the original, not the + * recirculated packet! */ + ctx->exit = false; if (ctx->xin->resubmit_stats) { netdev_vport_inc_tx(xport->netdev, ctx->xin->resubmit_stats); @@ -1891,7 +2889,6 @@ entry->u.dev.rx = netdev_ref(peer->netdev); entry->u.dev.bfd = bfd_ref(peer->bfd); } - return; } @@ -1899,10 +2896,13 @@ flow_pkt_mark = flow->pkt_mark; flow_nw_tos = flow->nw_tos; - if (dscp_from_skb_priority(xport, flow->skb_priority, &dscp)) { - wc->masks.nw_tos |= IP_DSCP_MASK; - flow->nw_tos &= ~IP_DSCP_MASK; - flow->nw_tos |= dscp; + if (count_skb_priorities(xport)) { + memset(&wc->masks.skb_priority, 0xff, sizeof wc->masks.skb_priority); + if (dscp_from_skb_priority(xport, flow->skb_priority, &dscp)) { + wc->masks.nw_tos |= IP_DSCP_MASK; + flow->nw_tos &= ~IP_DSCP_MASK; + flow->nw_tos |= dscp; + } } if (xport->is_tunnel) { @@ -1910,7 +2910,7 @@ * the Logical (tunnel) Port are not visible for any further * matches, while explicit set actions on tunnel metadata are. */ - struct flow_tnl flow_tnl = flow->tunnel; + flow_tnl = flow->tunnel; odp_port = tnl_port_send(xport->ofport, flow, &ctx->xout->wc); if (odp_port == ODPP_NONE) { xlate_report(ctx, "Tunneling decided against output"); @@ -1930,9 +2930,13 @@ entry->u.dev.tx = netdev_ref(xport->netdev); } out_port = odp_port; - commit_odp_tunnel_action(flow, &ctx->base_flow, - &ctx->xout->odp_actions); - flow->tunnel = flow_tnl; /* Restore tunnel metadata */ + if (ovs_native_tunneling_is_on(ctx->xbridge->ofproto)) { + tnl_push_pop_send = true; + } else { + commit_odp_tunnel_action(flow, &ctx->base_flow, + ctx->xout->odp_actions); + flow->tunnel = flow_tnl; /* Restore tunnel metadata */ + } } else { odp_port = xport->odp_port; out_port = odp_port; @@ -1950,27 +2954,54 @@ } if (out_port != ODPP_NONE) { + bool use_masked = ctx->xbridge->support.masked_set_action; + ctx->xout->slow |= commit_odp_actions(flow, &ctx->base_flow, - &ctx->xout->odp_actions, - &ctx->xout->wc); + ctx->xout->odp_actions, + wc, use_masked); - if (ctx->use_recirc) { + if (xr) { struct ovs_action_hash *act_hash; - struct xlate_recirc *xr = &ctx->recirc; /* Hash action. */ - act_hash = nl_msg_put_unspec_uninit(&ctx->xout->odp_actions, + act_hash = nl_msg_put_unspec_uninit(ctx->xout->odp_actions, OVS_ACTION_ATTR_HASH, sizeof *act_hash); act_hash->hash_alg = xr->hash_alg; act_hash->hash_basis = xr->hash_basis; /* Recirc action. */ - nl_msg_put_u32(&ctx->xout->odp_actions, OVS_ACTION_ATTR_RECIRC, + nl_msg_put_u32(ctx->xout->odp_actions, OVS_ACTION_ATTR_RECIRC, xr->recirc_id); } else { - nl_msg_put_odp_port(&ctx->xout->odp_actions, OVS_ACTION_ATTR_OUTPUT, - out_port); + + if (tnl_push_pop_send) { + build_tunnel_send(ctx, xport, flow, odp_port); + flow->tunnel = flow_tnl; /* Restore tunnel metadata */ + } else { + odp_port_t odp_tnl_port = ODPP_NONE; + + /* XXX: Write better Filter for tunnel port. We can use inport + * int tunnel-port flow to avoid these checks completely. */ + if (ofp_port == OFPP_LOCAL && + ovs_native_tunneling_is_on(ctx->xbridge->ofproto)) { + + odp_tnl_port = tnl_port_map_lookup(flow, wc); + } + + if (odp_tnl_port != ODPP_NONE) { + nl_msg_put_odp_port(ctx->xout->odp_actions, + OVS_ACTION_ATTR_TUNNEL_POP, + odp_tnl_port); + } else { + /* Tunnel push-pop action is not compatible with + * IPFIX action. */ + add_ipfix_output_action(ctx, out_port); + nl_msg_put_odp_port(ctx->xout->odp_actions, + OVS_ACTION_ATTR_OUTPUT, + out_port); + } + } } ctx->sflow_odp_port = odp_port; @@ -1986,15 +3017,17 @@ } static void -compose_output_action(struct xlate_ctx *ctx, ofp_port_t ofp_port) +compose_output_action(struct xlate_ctx *ctx, ofp_port_t ofp_port, + const struct xlate_bond_recirc *xr) { - compose_output_action__(ctx, ofp_port, true); + compose_output_action__(ctx, ofp_port, xr, true); } static void xlate_recursively(struct xlate_ctx *ctx, struct rule_dpif *rule) { struct rule_dpif *old_rule = ctx->rule; + ovs_be64 old_cookie = ctx->rule_cookie; const struct rule_actions *actions; if (ctx->xin->resubmit_stats) { @@ -2004,8 +3037,10 @@ ctx->resubmits++; ctx->recurse++; ctx->rule = rule; + ctx->rule_cookie = rule_dpif_get_flow_cookie(rule); actions = rule_dpif_get_actions(rule); do_xlate_actions(actions->ofpacts, actions->ofpacts_len, ctx); + ctx->rule_cookie = old_cookie; ctx->rule = old_rule; ctx->recurse--; } @@ -2020,9 +3055,9 @@ MAX_RESUBMIT_RECURSION); } else if (ctx->resubmits >= MAX_RESUBMITS + MAX_INTERNAL_RESUBMITS) { VLOG_ERR_RL(&rl, "over %d resubmit actions", MAX_RESUBMITS); - } else if (ofpbuf_size(&ctx->xout->odp_actions) > UINT16_MAX) { + } else if (ctx->xout->odp_actions->size > UINT16_MAX) { VLOG_ERR_RL(&rl, "resubmits yielded over 64 kB of actions"); - } else if (ofpbuf_size(&ctx->stack) >= 65536) { + } else if (ctx->stack.size >= 65536) { VLOG_ERR_RL(&rl, "resubmits yielded over 64 kB of stack"); } else { return true; @@ -2035,63 +3070,31 @@ xlate_table_action(struct xlate_ctx *ctx, ofp_port_t in_port, uint8_t table_id, bool may_packet_in, bool honor_table_miss) { + /* Check if we need to recirculate before matching in a table. */ + if (ctx->was_mpls) { + ctx_trigger_recirculation(ctx); + return; + } if (xlate_resubmit_resource_check(ctx)) { - ofp_port_t old_in_port = ctx->xin->flow.in_port.ofp_port; - bool skip_wildcards = ctx->xin->skip_wildcards; + struct flow_wildcards *wc; uint8_t old_table_id = ctx->table_id; struct rule_dpif *rule; - enum rule_dpif_lookup_verdict verdict; - enum ofputil_port_config config = 0; ctx->table_id = table_id; + wc = (ctx->xin->skip_wildcards) ? NULL : &ctx->xout->wc; - /* Look up a flow with 'in_port' as the input port. Then restore the - * original input port (otherwise OFPP_NORMAL and OFPP_IN_PORT will - * have surprising behavior). */ - ctx->xin->flow.in_port.ofp_port = in_port; - verdict = rule_dpif_lookup_from_table(ctx->xbridge->ofproto, - &ctx->xin->flow, - !skip_wildcards - ? &ctx->xout->wc : NULL, - honor_table_miss, - &ctx->table_id, &rule, - ctx->xin->xcache != NULL); - ctx->xin->flow.in_port.ofp_port = old_in_port; - - if (ctx->xin->resubmit_hook) { - ctx->xin->resubmit_hook(ctx->xin, rule, ctx->recurse); - } - - switch (verdict) { - case RULE_DPIF_LOOKUP_VERDICT_MATCH: - goto match; - case RULE_DPIF_LOOKUP_VERDICT_CONTROLLER: - if (may_packet_in) { - struct xport *xport; - - xport = get_ofp_port(ctx->xbridge, - ctx->xin->flow.in_port.ofp_port); - config = xport ? xport->config : 0; - break; - } - /* Fall through to drop */ - case RULE_DPIF_LOOKUP_VERDICT_DROP: - config = OFPUTIL_PC_NO_PACKET_IN; - break; - case RULE_DPIF_LOOKUP_VERDICT_DEFAULT: - if (!ofproto_dpif_wants_packet_in_on_miss(ctx->xbridge->ofproto)) { - config = OFPUTIL_PC_NO_PACKET_IN; - } - break; - default: - OVS_NOT_REACHED(); - } + rule = rule_dpif_lookup_from_table(ctx->xbridge->ofproto, + ctx->tables_version, + &ctx->xin->flow, wc, + ctx->xin->xcache != NULL, + ctx->xin->resubmit_stats, + &ctx->table_id, in_port, + may_packet_in, honor_table_miss); - choose_miss_rule(config, ctx->xbridge->miss_rule, - ctx->xbridge->no_packet_in_rule, &rule, - ctx->xin->xcache != NULL); + if (OVS_UNLIKELY(ctx->xin->resubmit_hook)) { + ctx->xin->resubmit_hook(ctx->xin, rule, ctx->recurse + 1); + } -match: if (rule) { /* Fill in the cache entry here instead of xlate_recursively * to make the reference counting more explicit. We take a @@ -2114,67 +3117,192 @@ } static void -xlate_group_bucket(struct xlate_ctx *ctx, const struct ofputil_bucket *bucket) +xlate_group_stats(struct xlate_ctx *ctx, struct group_dpif *group, + struct ofputil_bucket *bucket) +{ + if (ctx->xin->resubmit_stats) { + group_dpif_credit_stats(group, bucket, ctx->xin->resubmit_stats); + } + if (ctx->xin->xcache) { + struct xc_entry *entry; + + entry = xlate_cache_add_entry(ctx->xin->xcache, XC_GROUP); + entry->u.group.group = group_dpif_ref(group); + entry->u.group.bucket = bucket; + } +} + +static void +xlate_group_bucket(struct xlate_ctx *ctx, struct ofputil_bucket *bucket) { uint64_t action_list_stub[1024 / 8]; struct ofpbuf action_list, action_set; + struct flow old_flow = ctx->xin->flow; + bool old_was_mpls = ctx->was_mpls; ofpbuf_use_const(&action_set, bucket->ofpacts, bucket->ofpacts_len); ofpbuf_use_stub(&action_list, action_list_stub, sizeof action_list_stub); ofpacts_execute_action_set(&action_list, &action_set); ctx->recurse++; - do_xlate_actions(ofpbuf_data(&action_list), ofpbuf_size(&action_list), ctx); + do_xlate_actions(action_list.data, action_list.size, ctx); ctx->recurse--; ofpbuf_uninit(&action_set); ofpbuf_uninit(&action_list); + + /* Check if need to recirculate. */ + if (exit_recirculates(ctx)) { + compose_recirculate_action(ctx); + } + + /* Roll back flow to previous state. + * This is equivalent to cloning the packet for each bucket. + * + * As a side effect any subsequently applied actions will + * also effectively be applied to a clone of the packet taken + * just before applying the all or indirect group. + * + * Note that group buckets are action sets, hence they cannot modify the + * main action set. Also any stack actions are ignored when executing an + * action set, so group buckets cannot change the stack either. + * However, we do allow resubmit actions in group buckets, which could + * break the above assumptions. It is up to the controller to not mess up + * with the action_set and stack in the tables resubmitted to from + * group buckets. */ + ctx->xin->flow = old_flow; + + /* The group bucket popping MPLS should have no effect after bucket + * execution. */ + ctx->was_mpls = old_was_mpls; + + /* The fact that the group bucket exits (for any reason) does not mean that + * the translation after the group action should exit. Specifically, if + * the group bucket recirculates (which typically modifies the packet), the + * actions after the group action must continue processing with the + * original, not the recirculated packet! */ + ctx->exit = false; } static void xlate_all_group(struct xlate_ctx *ctx, struct group_dpif *group) { - const struct ofputil_bucket *bucket; - const struct list *buckets; - struct flow old_flow = ctx->xin->flow; + struct ofputil_bucket *bucket; + const struct ovs_list *buckets; + + group_dpif_get_buckets(group, &buckets); + + LIST_FOR_EACH (bucket, list_node, buckets) { + xlate_group_bucket(ctx, bucket); + } + xlate_group_stats(ctx, group, NULL); +} + +static void +xlate_ff_group(struct xlate_ctx *ctx, struct group_dpif *group) +{ + struct ofputil_bucket *bucket; + + bucket = group_first_live_bucket(ctx, group, 0); + if (bucket) { + xlate_group_bucket(ctx, bucket); + xlate_group_stats(ctx, group, bucket); + } +} + +static void +xlate_default_select_group(struct xlate_ctx *ctx, struct group_dpif *group) +{ + struct flow_wildcards *wc = &ctx->xout->wc; + struct ofputil_bucket *bucket; + uint32_t basis; + + basis = flow_hash_symmetric_l4(&ctx->xin->flow, 0); + flow_mask_hash_fields(&ctx->xin->flow, wc, NX_HASH_FIELDS_SYMMETRIC_L4); + bucket = group_best_live_bucket(ctx, group, basis); + if (bucket) { + xlate_group_bucket(ctx, bucket); + xlate_group_stats(ctx, group, bucket); + } +} + +static void +xlate_hash_fields_select_group(struct xlate_ctx *ctx, struct group_dpif *group) +{ + struct mf_bitmap hash_fields = MF_BITMAP_INITIALIZER; + struct flow_wildcards *wc = &ctx->xout->wc; + const struct field_array *fields; + struct ofputil_bucket *bucket; + uint32_t basis; + int i; + + fields = group_dpif_get_fields(group); + basis = hash_uint64(group_dpif_get_selection_method_param(group)); + + /* Determine which fields to hash */ + for (i = 0; i < MFF_N_IDS; i++) { + if (bitmap_is_set(fields->used.bm, i)) { + const struct mf_field *mf; + + /* If the field is already present in 'hash_fields' then + * this loop has already checked that it and its pre-requisites + * are present in the flow and its pre-requisites have + * already been added to 'hash_fields'. There is nothing more + * to do here and as an optimisation the loop can continue. */ + if (bitmap_is_set(hash_fields.bm, i)) { + continue; + } + + mf = mf_from_id(i); - group_dpif_get_buckets(group, &buckets); + /* Only hash a field if it and its pre-requisites are present + * in the flow. */ + if (!mf_are_prereqs_ok(mf, &ctx->xin->flow)) { + continue; + } - LIST_FOR_EACH (bucket, list_node, buckets) { - xlate_group_bucket(ctx, bucket); - /* Roll back flow to previous state. - * This is equivalent to cloning the packet for each bucket. - * - * As a side effect any subsequently applied actions will - * also effectively be applied to a clone of the packet taken - * just before applying the all or indirect group. */ - ctx->xin->flow = old_flow; + /* Hash both the field and its pre-requisites */ + mf_bitmap_set_field_and_prereqs(mf, &hash_fields); + } } -} -static void -xlate_ff_group(struct xlate_ctx *ctx, struct group_dpif *group) -{ - const struct ofputil_bucket *bucket; + /* Hash the fields */ + for (i = 0; i < MFF_N_IDS; i++) { + if (bitmap_is_set(hash_fields.bm, i)) { + const struct mf_field *mf = mf_from_id(i); + union mf_value value; + int j; + + mf_get_value(mf, &ctx->xin->flow, &value); + /* This seems inefficient but so does apply_mask() */ + for (j = 0; j < mf->n_bytes; j++) { + ((uint8_t *) &value)[j] &= ((uint8_t *) &fields->value[i])[j]; + } + basis = hash_bytes(&value, mf->n_bytes, basis); - bucket = group_first_live_bucket(ctx, group, 0); + mf_mask_field(mf, &wc->masks); + } + } + + bucket = group_best_live_bucket(ctx, group, basis); if (bucket) { xlate_group_bucket(ctx, bucket); + xlate_group_stats(ctx, group, bucket); } } static void xlate_select_group(struct xlate_ctx *ctx, struct group_dpif *group) { - struct flow_wildcards *wc = &ctx->xout->wc; - const struct ofputil_bucket *bucket; - uint32_t basis; + const char *selection_method = group_dpif_get_selection_method(group); - basis = hash_mac(ctx->xin->flow.dl_dst, 0, 0); - bucket = group_best_live_bucket(ctx, group, basis); - if (bucket) { - memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst); - xlate_group_bucket(ctx, bucket); + if (selection_method[0] == '\0') { + xlate_default_select_group(ctx, group); + } else if (!strcasecmp("hash", selection_method)) { + xlate_hash_fields_select_group(ctx, group); + } else { + /* Parsing of groups should ensure this never happens */ + OVS_NOT_REACHED(); } } @@ -2197,7 +3325,7 @@ default: OVS_NOT_REACHED(); } - group_dpif_release(group); + group_dpif_unref(group); ctx->in_group = false; } @@ -2285,9 +3413,9 @@ } if (all) { - compose_output_action__(ctx, xport->ofp_port, false); + compose_output_action__(ctx, xport->ofp_port, NULL, false); } else if (!(xport->config & OFPUTIL_PC_NO_FLOOD)) { - compose_output_action(ctx, xport->ofp_port); + compose_output_action(ctx, xport->ofp_port, NULL); } } @@ -2300,34 +3428,33 @@ uint16_t controller_id) { struct ofproto_packet_in *pin; - struct ofpbuf *packet; - struct pkt_metadata md = PKT_METADATA_INITIALIZER(0); + struct dp_packet *packet; + bool use_masked; ctx->xout->slow |= SLOW_CONTROLLER; if (!ctx->xin->packet) { return; } - packet = ofpbuf_clone(ctx->xin->packet); + packet = dp_packet_clone(ctx->xin->packet); + use_masked = ctx->xbridge->support.masked_set_action; ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow, - &ctx->xout->odp_actions, - &ctx->xout->wc); + ctx->xout->odp_actions, + &ctx->xout->wc, use_masked); - odp_execute_actions(NULL, packet, false, &md, - ofpbuf_data(&ctx->xout->odp_actions), - ofpbuf_size(&ctx->xout->odp_actions), NULL); + odp_execute_actions(NULL, &packet, 1, false, + ctx->xout->odp_actions->data, + ctx->xout->odp_actions->size, NULL); pin = xmalloc(sizeof *pin); - pin->up.packet_len = ofpbuf_size(packet); - pin->up.packet = ofpbuf_steal_data(packet); + pin->up.packet_len = dp_packet_size(packet); + pin->up.packet = dp_packet_steal_data(packet); pin->up.reason = reason; pin->up.table_id = ctx->table_id; - pin->up.cookie = (ctx->rule - ? rule_dpif_get_flow_cookie(ctx->rule) - : OVS_BE64_MAX); + pin->up.cookie = ctx->rule_cookie; - flow_get_metadata(&ctx->xin->flow, &pin->up.fmd); + flow_get_metadata(&ctx->xin->flow, &pin->up.flow_metadata); pin->controller_id = controller_id; pin->send_len = len; @@ -2348,7 +3475,57 @@ } } ofproto_dpif_send_packet_in(ctx->xbridge->ofproto, pin); - ofpbuf_delete(packet); + dp_packet_delete(packet); +} + +/* Called only when ctx->recirc_action_offset is set. */ +static void +compose_recirculate_action(struct xlate_ctx *ctx) +{ + struct recirc_metadata md; + bool use_masked; + uint32_t id; + + use_masked = ctx->xbridge->support.masked_set_action; + ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow, + ctx->xout->odp_actions, + &ctx->xout->wc, use_masked); + + recirc_metadata_from_flow(&md, &ctx->xin->flow); + + ovs_assert(ctx->recirc_action_offset >= 0); + + /* Only allocate recirculation ID if we have a packet. */ + if (ctx->xin->packet) { + /* Allocate a unique recirc id for the given metadata state in the + * flow. The life-cycle of this recirc id is managed by associating it + * with the udpif key ('ukey') created for each new datapath flow. */ + id = recirc_alloc_id_ctx(ctx->xbridge->ofproto, 0, &md, &ctx->stack, + ctx->recirc_action_offset, + ctx->action_set.size, ctx->action_set.data); + if (!id) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + VLOG_ERR_RL(&rl, "Failed to allocate recirculation id"); + return; + } + xlate_out_add_recirc(ctx->xout, id); + } else { + /* Look up an existing recirc id for the given metadata state in the + * flow. No new reference is taken, as the ID is RCU protected and is + * only required temporarily for verification. */ + id = recirc_find_id(ctx->xbridge->ofproto, 0, &md, &ctx->stack, + ctx->recirc_action_offset, + ctx->action_set.size, ctx->action_set.data); + /* We let zero 'id' to be used in the RECIRC action below, which will + * fail all revalidations as zero is not a valid recirculation ID. */ + } + + nl_msg_put_u32(ctx->xout->odp_actions, OVS_ACTION_ATTR_RECIRC, id); + + /* Undo changes done by recirculation. */ + ctx->action_set.size = ctx->recirc_action_offset; + ctx->recirc_action_offset = -1; + ctx->last_unroll_offset = -1; } static void @@ -2362,9 +3539,11 @@ n = flow_count_mpls_labels(flow, wc); if (!n) { + bool use_masked = ctx->xbridge->support.masked_set_action; + ctx->xout->slow |= commit_odp_actions(flow, &ctx->base_flow, - &ctx->xout->odp_actions, - &ctx->xout->wc); + ctx->xout->odp_actions, + &ctx->xout->wc, use_masked); } else if (n >= FLOW_MAX_MPLS_LABELS) { if (ctx->xin->packet != NULL) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); @@ -2375,9 +3554,6 @@ } ctx->exit = true; return; - } else if (n >= ctx->xbridge->max_mpls_depth) { - COVERAGE_INC(xlate_actions_mpls_overflow); - ctx->xout->slow |= SLOW_ACTION; } flow_push_mpls(flow, n, mpls->ethertype, wc); @@ -2390,7 +3566,11 @@ struct flow *flow = &ctx->xin->flow; int n = flow_count_mpls_labels(flow, wc); - if (!flow_pop_mpls(flow, n, eth_type, wc) && n >= FLOW_MAX_MPLS_LABELS) { + if (flow_pop_mpls(flow, n, eth_type, wc)) { + if (ctx->xbridge->support.recirc) { + ctx->was_mpls = true; + } + } else if (n >= FLOW_MAX_MPLS_LABELS) { if (ctx->xin->packet != NULL) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_WARN_RL(&rl, "bridge %s: dropping packet on which an " @@ -2399,7 +3579,7 @@ ctx->xbridge->name, FLOW_MAX_MPLS_LABELS); } ctx->exit = true; - ofpbuf_clear(&ctx->xout->odp_actions); + ofpbuf_clear(ctx->xout->odp_actions); } } @@ -2460,24 +3640,23 @@ compose_dec_mpls_ttl_action(struct xlate_ctx *ctx) { struct flow *flow = &ctx->xin->flow; - uint8_t ttl = mpls_lse_to_ttl(flow->mpls_lse[0]); struct flow_wildcards *wc = &ctx->xout->wc; - memset(&wc->masks.mpls_lse, 0xff, sizeof wc->masks.mpls_lse); if (eth_type_mpls(flow->dl_type)) { + uint8_t ttl = mpls_lse_to_ttl(flow->mpls_lse[0]); + + wc->masks.mpls_lse[0] |= htonl(MPLS_TTL_MASK); if (ttl > 1) { ttl--; set_mpls_lse_ttl(&flow->mpls_lse[0], ttl); return false; } else { execute_controller_action(ctx, UINT16_MAX, OFPR_INVALID_TTL, 0); - - /* Stop processing for current table. */ - return true; } - } else { - return true; } + + /* Stop processing for current table. */ + return true; } static void @@ -2490,7 +3669,7 @@ switch (port) { case OFPP_IN_PORT: - compose_output_action(ctx, ctx->xin->flow.in_port.ofp_port); + compose_output_action(ctx, ctx->xin->flow.in_port.ofp_port, NULL); break; case OFPP_TABLE: xlate_table_action(ctx, ctx->xin->flow.in_port.ofp_port, @@ -2506,14 +3685,18 @@ flood_packets(ctx, true); break; case OFPP_CONTROLLER: - execute_controller_action(ctx, max_len, OFPR_ACTION, 0); + execute_controller_action(ctx, max_len, + (ctx->in_group ? OFPR_GROUP + : ctx->in_action_set ? OFPR_ACTION_SET + : OFPR_ACTION), + 0); break; case OFPP_NONE: break; case OFPP_LOCAL: default: if (port != ctx->xin->flow.in_port.ofp_port) { - compose_output_action(ctx, port); + compose_output_action(ctx, port, NULL); } else { xlate_report(ctx, "skipping output to input port"); } @@ -2572,7 +3755,7 @@ /* Add datapath actions. */ flow_priority = ctx->xin->flow.skb_priority; ctx->xin->flow.skb_priority = priority; - compose_output_action(ctx, ofp_port); + compose_output_action(ctx, ofp_port, NULL); ctx->xin->flow.skb_priority = flow_priority; /* Update NetFlow output port. */ @@ -2704,28 +3887,31 @@ xlate_sample_action(struct xlate_ctx *ctx, const struct ofpact_sample *os) { - union user_action_cookie cookie; - /* Scale the probability from 16-bit to 32-bit while representing - * the same percentage. */ - uint32_t probability = (os->probability << 16) | os->probability; - - if (!ctx->xbridge->variable_length_userdata) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); - - VLOG_ERR_RL(&rl, "ignoring NXAST_SAMPLE action because datapath " - "lacks support (needs Linux 3.10+ or kernel module from " - "OVS 1.11+)"); - return; - } - - ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow, - &ctx->xout->odp_actions, - &ctx->xout->wc); - - compose_flow_sample_cookie(os->probability, os->collector_set_id, - os->obs_domain_id, os->obs_point_id, &cookie); - compose_sample_action(ctx->xbridge, &ctx->xout->odp_actions, &ctx->xin->flow, - probability, &cookie, sizeof cookie.flow_sample); + union user_action_cookie cookie; + /* Scale the probability from 16-bit to 32-bit while representing + * the same percentage. */ + uint32_t probability = (os->probability << 16) | os->probability; + bool use_masked; + + if (!ctx->xbridge->support.variable_length_userdata) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + + VLOG_ERR_RL(&rl, "ignoring NXAST_SAMPLE action because datapath " + "lacks support (needs Linux 3.10+ or kernel module from " + "OVS 1.11+)"); + return; + } + + use_masked = ctx->xbridge->support.masked_set_action; + ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow, + ctx->xout->odp_actions, + &ctx->xout->wc, use_masked); + + compose_flow_sample_cookie(os->probability, os->collector_set_id, + os->obs_domain_id, os->obs_point_id, &cookie); + compose_sample_action(ctx->xbridge, ctx->xout->odp_actions, + &ctx->xin->flow, probability, &cookie, + sizeof cookie.flow_sample, ODPP_NONE); } static bool @@ -2741,7 +3927,8 @@ * disabled. If just learning is enabled, we need to have * OFPP_NORMAL and the learning action have a look at the packet * before we can drop it. */ - if (!xport_stp_forward_state(xport) && !xport_stp_learn_state(xport)) { + if ((!xport_stp_forward_state(xport) && !xport_stp_learn_state(xport)) || + (!xport_rstp_forward_state(xport) && !xport_rstp_learn_state(xport))) { return false; } @@ -2751,8 +3938,31 @@ static void xlate_write_actions(struct xlate_ctx *ctx, const struct ofpact *a) { - struct ofpact_nest *on = ofpact_get_WRITE_ACTIONS(a); - ofpbuf_put(&ctx->action_set, on->actions, ofpact_nest_get_action_len(on)); + const struct ofpact_nest *on = ofpact_get_WRITE_ACTIONS(a); + size_t on_len = ofpact_nest_get_action_len(on); + const struct ofpact *inner; + + /* Maintain actset_output depending on the contents of the action set: + * + * - OFPP_UNSET, if there is no "output" action. + * + * - The output port, if there is an "output" action and no "group" + * action. + * + * - OFPP_UNSET, if there is a "group" action. + */ + if (!ctx->action_set_has_group) { + OFPACT_FOR_EACH (inner, on->actions, on_len) { + if (inner->type == OFPACT_OUTPUT) { + ctx->xin->flow.actset_output = ofpact_get_OUTPUT(inner)->port; + } else if (inner->type == OFPACT_GROUP) { + ctx->xin->flow.actset_output = OFPP_UNSET; + ctx->action_set_has_group = true; + } + } + } + + ofpbuf_put(&ctx->action_set, on->actions, on_len); ofpact_pad(&ctx->action_set); } @@ -2762,13 +3972,125 @@ uint64_t action_list_stub[1024 / 64]; struct ofpbuf action_list; + ctx->in_action_set = true; ofpbuf_use_stub(&action_list, action_list_stub, sizeof action_list_stub); ofpacts_execute_action_set(&action_list, &ctx->action_set); - do_xlate_actions(ofpbuf_data(&action_list), ofpbuf_size(&action_list), ctx); + /* Clear the action set, as it is not needed any more. */ + ofpbuf_clear(&ctx->action_set); + do_xlate_actions(action_list.data, action_list.size, ctx); + ctx->in_action_set = false; ofpbuf_uninit(&action_list); } static void +recirc_put_unroll_xlate(struct xlate_ctx *ctx) +{ + struct ofpact_unroll_xlate *unroll; + + unroll = ctx->last_unroll_offset < 0 + ? NULL + : ALIGNED_CAST(struct ofpact_unroll_xlate *, + (char *)ctx->action_set.data + ctx->last_unroll_offset); + + /* Restore the table_id and rule cookie for a potential PACKET + * IN if needed. */ + if (!unroll || + (ctx->table_id != unroll->rule_table_id + || ctx->rule_cookie != unroll->rule_cookie)) { + + ctx->last_unroll_offset = ctx->action_set.size; + unroll = ofpact_put_UNROLL_XLATE(&ctx->action_set); + unroll->rule_table_id = ctx->table_id; + unroll->rule_cookie = ctx->rule_cookie; + } +} + + +/* Copy remaining actions to the action_set to be executed after recirculation. + * UNROLL_XLATE action is inserted, if not already done so, before actions that + * may generate PACKET_INs from the current table and without matching another + * rule. */ +static void +recirc_unroll_actions(const struct ofpact *ofpacts, size_t ofpacts_len, + struct xlate_ctx *ctx) +{ + const struct ofpact *a; + + OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { + switch (a->type) { + /* May generate PACKET INs. */ + case OFPACT_OUTPUT_REG: + case OFPACT_GROUP: + case OFPACT_OUTPUT: + case OFPACT_CONTROLLER: + case OFPACT_DEC_MPLS_TTL: + case OFPACT_DEC_TTL: + recirc_put_unroll_xlate(ctx); + break; + + /* These may not generate PACKET INs. */ + case OFPACT_SET_TUNNEL: + case OFPACT_REG_MOVE: + case OFPACT_SET_FIELD: + case OFPACT_STACK_PUSH: + case OFPACT_STACK_POP: + case OFPACT_LEARN: + case OFPACT_WRITE_METADATA: + case OFPACT_RESUBMIT: /* May indirectly generate PACKET INs, */ + case OFPACT_GOTO_TABLE: /* but from a different table and rule. */ + case OFPACT_ENQUEUE: + case OFPACT_SET_VLAN_VID: + case OFPACT_SET_VLAN_PCP: + case OFPACT_STRIP_VLAN: + case OFPACT_PUSH_VLAN: + case OFPACT_SET_ETH_SRC: + case OFPACT_SET_ETH_DST: + case OFPACT_SET_IPV4_SRC: + case OFPACT_SET_IPV4_DST: + case OFPACT_SET_IP_DSCP: + case OFPACT_SET_IP_ECN: + case OFPACT_SET_IP_TTL: + case OFPACT_SET_L4_SRC_PORT: + case OFPACT_SET_L4_DST_PORT: + case OFPACT_SET_QUEUE: + case OFPACT_POP_QUEUE: + case OFPACT_PUSH_MPLS: + case OFPACT_POP_MPLS: + case OFPACT_SET_MPLS_LABEL: + case OFPACT_SET_MPLS_TC: + case OFPACT_SET_MPLS_TTL: + case OFPACT_MULTIPATH: + case OFPACT_BUNDLE: + case OFPACT_EXIT: + case OFPACT_UNROLL_XLATE: + case OFPACT_FIN_TIMEOUT: + case OFPACT_CLEAR_ACTIONS: + case OFPACT_WRITE_ACTIONS: + case OFPACT_METER: + case OFPACT_SAMPLE: + break; + + /* These need not be copied for restoration. */ + case OFPACT_NOTE: + case OFPACT_CONJUNCTION: + continue; + } + /* Copy the action over. */ + ofpbuf_put(&ctx->action_set, a, OFPACT_ALIGN(a->len)); + } +} + +#define CHECK_MPLS_RECIRCULATION() \ + if (ctx->was_mpls) { \ + ctx_trigger_recirculation(ctx); \ + break; \ + } +#define CHECK_MPLS_RECIRCULATION_IF(COND) \ + if (COND) { \ + CHECK_MPLS_RECIRCULATION(); \ + } + +static void do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, struct xlate_ctx *ctx) { @@ -2776,6 +4098,9 @@ struct flow *flow = &ctx->xin->flow; const struct ofpact *a; + if (ovs_native_tunneling_is_on(ctx->xbridge->ofproto)) { + tnl_arp_snoop(flow, wc, ctx->xbridge->name); + } /* dl_type already in the mask, not set below. */ OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { @@ -2785,6 +4110,14 @@ const struct mf_field *mf; if (ctx->exit) { + /* Check if need to store the remaining actions for later + * execution. */ + if (exit_recirculates(ctx)) { + recirc_unroll_actions(a, OFPACT_ALIGN(ofpacts_len - + ((uint8_t *)a - + (uint8_t *)ofpacts)), + ctx); + } break; } @@ -2796,6 +4129,7 @@ case OFPACT_GROUP: if (xlate_group_action(ctx, ofpact_get_GROUP(a)->group_id)) { + /* Group could not be found. */ return; } break; @@ -2808,6 +4142,8 @@ break; case OFPACT_ENQUEUE: + memset(&wc->masks.skb_priority, 0xff, + sizeof wc->masks.skb_priority); xlate_enqueue_action(ctx, ofpact_get_ENQUEUE(a)); break; @@ -2853,6 +4189,7 @@ break; case OFPACT_SET_IPV4_SRC: + CHECK_MPLS_RECIRCULATION(); if (flow->dl_type == htons(ETH_TYPE_IP)) { memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src); flow->nw_src = ofpact_get_SET_IPV4_SRC(a)->ipv4; @@ -2860,6 +4197,7 @@ break; case OFPACT_SET_IPV4_DST: + CHECK_MPLS_RECIRCULATION(); if (flow->dl_type == htons(ETH_TYPE_IP)) { memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst); flow->nw_dst = ofpact_get_SET_IPV4_DST(a)->ipv4; @@ -2867,6 +4205,7 @@ break; case OFPACT_SET_IP_DSCP: + CHECK_MPLS_RECIRCULATION(); if (is_ip_any(flow)) { wc->masks.nw_tos |= IP_DSCP_MASK; flow->nw_tos &= ~IP_DSCP_MASK; @@ -2875,6 +4214,7 @@ break; case OFPACT_SET_IP_ECN: + CHECK_MPLS_RECIRCULATION(); if (is_ip_any(flow)) { wc->masks.nw_tos |= IP_ECN_MASK; flow->nw_tos &= ~IP_ECN_MASK; @@ -2883,6 +4223,7 @@ break; case OFPACT_SET_IP_TTL: + CHECK_MPLS_RECIRCULATION(); if (is_ip_any(flow)) { wc->masks.nw_ttl = 0xff; flow->nw_ttl = ofpact_get_SET_IP_TTL(a)->ttl; @@ -2890,7 +4231,8 @@ break; case OFPACT_SET_L4_SRC_PORT: - if (is_ip_any(flow)) { + CHECK_MPLS_RECIRCULATION(); + if (is_ip_any(flow) && !(flow->nw_frag & FLOW_NW_FRAG_LATER)) { memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); memset(&wc->masks.tp_src, 0xff, sizeof wc->masks.tp_src); flow->tp_src = htons(ofpact_get_SET_L4_SRC_PORT(a)->port); @@ -2898,7 +4240,8 @@ break; case OFPACT_SET_L4_DST_PORT: - if (is_ip_any(flow)) { + CHECK_MPLS_RECIRCULATION(); + if (is_ip_any(flow) && !(flow->nw_frag & FLOW_NW_FRAG_LATER)) { memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst); flow->tp_dst = htons(ofpact_get_SET_L4_DST_PORT(a)->port); @@ -2914,22 +4257,27 @@ break; case OFPACT_SET_QUEUE: + memset(&wc->masks.skb_priority, 0xff, + sizeof wc->masks.skb_priority); xlate_set_queue_action(ctx, ofpact_get_SET_QUEUE(a)->queue_id); break; case OFPACT_POP_QUEUE: + memset(&wc->masks.skb_priority, 0xff, + sizeof wc->masks.skb_priority); flow->skb_priority = ctx->orig_skb_priority; break; case OFPACT_REG_MOVE: + CHECK_MPLS_RECIRCULATION_IF( + mf_is_l3_or_higher(ofpact_get_REG_MOVE(a)->dst.field) || + mf_is_l3_or_higher(ofpact_get_REG_MOVE(a)->src.field)); nxm_execute_reg_move(ofpact_get_REG_MOVE(a), flow, wc); break; - case OFPACT_REG_LOAD: - nxm_execute_reg_load(ofpact_get_REG_LOAD(a), flow, wc); - break; - case OFPACT_SET_FIELD: + CHECK_MPLS_RECIRCULATION_IF( + mf_is_l3_or_higher(ofpact_get_SET_FIELD(a)->field)); set_field = ofpact_get_SET_FIELD(a); mf = set_field->field; @@ -2945,49 +4293,72 @@ && !eth_type_mpls(flow->dl_type)) { break; } - + /* A flow may wildcard nw_frag. Do nothing if setting a trasport + * header field on a packet that does not have them. */ mf_mask_field_and_prereqs(mf, &wc->masks); - mf_set_flow_value(mf, &set_field->value, flow); + if (mf_are_prereqs_ok(mf, flow)) { + mf_set_flow_value_masked(mf, &set_field->value, + &set_field->mask, flow); + } break; case OFPACT_STACK_PUSH: + CHECK_MPLS_RECIRCULATION_IF( + mf_is_l3_or_higher(ofpact_get_STACK_PUSH(a)->subfield.field)); nxm_execute_stack_push(ofpact_get_STACK_PUSH(a), flow, wc, &ctx->stack); break; case OFPACT_STACK_POP: + CHECK_MPLS_RECIRCULATION_IF( + mf_is_l3_or_higher(ofpact_get_STACK_POP(a)->subfield.field)); nxm_execute_stack_pop(ofpact_get_STACK_POP(a), flow, wc, &ctx->stack); break; case OFPACT_PUSH_MPLS: + /* Recirculate if it is an IP packet with a zero ttl. This may + * indicate that the packet was previously MPLS and an MPLS pop + * action converted it to IP. In this case recirculating should + * reveal the IP TTL which is used as the basis for a new MPLS + * LSE. */ + CHECK_MPLS_RECIRCULATION_IF( + !flow_count_mpls_labels(flow, wc) + && flow->nw_ttl == 0 + && is_ip_any(flow)); compose_mpls_push_action(ctx, ofpact_get_PUSH_MPLS(a)); break; case OFPACT_POP_MPLS: + CHECK_MPLS_RECIRCULATION(); compose_mpls_pop_action(ctx, ofpact_get_POP_MPLS(a)->ethertype); break; case OFPACT_SET_MPLS_LABEL: + CHECK_MPLS_RECIRCULATION(); compose_set_mpls_label_action( ctx, ofpact_get_SET_MPLS_LABEL(a)->label); - break; + break; case OFPACT_SET_MPLS_TC: + CHECK_MPLS_RECIRCULATION(); compose_set_mpls_tc_action(ctx, ofpact_get_SET_MPLS_TC(a)->tc); break; case OFPACT_SET_MPLS_TTL: + CHECK_MPLS_RECIRCULATION(); compose_set_mpls_ttl_action(ctx, ofpact_get_SET_MPLS_TTL(a)->ttl); break; case OFPACT_DEC_MPLS_TTL: + CHECK_MPLS_RECIRCULATION(); if (compose_dec_mpls_ttl_action(ctx)) { return; } break; case OFPACT_DEC_TTL: + CHECK_MPLS_RECIRCULATION(); wc->masks.nw_ttl = 0xff; if (compose_dec_ttl(ctx, ofpact_get_DEC_TTL(a))) { return; @@ -2999,10 +4370,12 @@ break; case OFPACT_MULTIPATH: + CHECK_MPLS_RECIRCULATION(); multipath_execute(ofpact_get_MULTIPATH(a), flow, wc); break; case OFPACT_BUNDLE: + CHECK_MPLS_RECIRCULATION(); xlate_bundle_action(ctx, ofpact_get_BUNDLE(a)); break; @@ -3011,14 +4384,34 @@ break; case OFPACT_LEARN: + CHECK_MPLS_RECIRCULATION(); xlate_learn_action(ctx, ofpact_get_LEARN(a)); break; + case OFPACT_CONJUNCTION: { + /* A flow with a "conjunction" action represents part of a special + * kind of "set membership match". Such a flow should not actually + * get executed, but it could via, say, a "packet-out", even though + * that wouldn't be useful. Log it to help debugging. */ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + VLOG_INFO_RL(&rl, "executing no-op conjunction action"); + break; + } + case OFPACT_EXIT: ctx->exit = true; break; + case OFPACT_UNROLL_XLATE: { + struct ofpact_unroll_xlate *unroll = ofpact_get_UNROLL_XLATE(a); + + /* Restore translation context data that was stored earlier. */ + ctx->table_id = unroll->rule_table_id; + ctx->rule_cookie = unroll->rule_cookie; + break; + } case OFPACT_FIN_TIMEOUT: + CHECK_MPLS_RECIRCULATION(); memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); ctx->xout->has_fin_timeout = true; xlate_fin_timeout(ctx, ofpact_get_FIN_TIMEOUT(a)); @@ -3026,6 +4419,8 @@ case OFPACT_CLEAR_ACTIONS: ofpbuf_clear(&ctx->action_set); + ctx->xin->flow.actset_output = OFPP_UNSET; + ctx->action_set_has_group = false; break; case OFPACT_WRITE_ACTIONS: @@ -3045,7 +4440,12 @@ case OFPACT_GOTO_TABLE: { struct ofpact_goto_table *ogt = ofpact_get_GOTO_TABLE(a); - ovs_assert(ctx->table_id < ogt->table_id); + /* Allow ctx->table_id == TBL_INTERNAL, which will be greater + * than ogt->table_id. This is to allow goto_table actions that + * triggered recirculation: ctx->table_id will be TBL_INTERNAL + * after recirculation. */ + ovs_assert(ctx->table_id == TBL_INTERNAL + || ctx->table_id < ogt->table_id); xlate_table_action(ctx, ctx->xin->flow.in_port.ofp_port, ogt->table_id, true, true); break; @@ -3055,16 +4455,29 @@ xlate_sample_action(ctx, ofpact_get_SAMPLE(a)); break; } + + /* Check if need to store this and the remaining actions for later + * execution. */ + if (ctx->exit && ctx_first_recirculation_action(ctx)) { + recirc_unroll_actions(a, OFPACT_ALIGN(ofpacts_len - + ((uint8_t *)a - + (uint8_t *)ofpacts)), + ctx); + break; + } } } void xlate_in_init(struct xlate_in *xin, struct ofproto_dpif *ofproto, - const struct flow *flow, struct rule_dpif *rule, - uint16_t tcp_flags, const struct ofpbuf *packet) + const struct flow *flow, ofp_port_t in_port, + struct rule_dpif *rule, uint16_t tcp_flags, + const struct dp_packet *packet) { xin->ofproto = ofproto; xin->flow = *flow; + xin->flow.in_port.ofp_port = in_port; + xin->flow.actset_output = OFPP_UNSET; xin->packet = packet; xin->may_learn = packet != NULL; xin->rule = rule; @@ -3076,13 +4489,22 @@ xin->report_hook = NULL; xin->resubmit_stats = NULL; xin->skip_wildcards = false; + xin->odp_actions = NULL; + + /* Do recirc lookup. */ + xin->recirc = flow->recirc_id + ? recirc_id_node_find(flow->recirc_id) + : NULL; } void xlate_out_uninit(struct xlate_out *xout) { if (xout) { - ofpbuf_uninit(&xout->odp_actions); + if (xout->odp_actions == &xout->odp_actions_buf) { + ofpbuf_uninit(xout->odp_actions); + } + xlate_out_free_recircs(xout); } } @@ -3097,14 +4519,6 @@ xlate_out_uninit(&xout); } -static void -xlate_report(struct xlate_ctx *ctx, const char *s) -{ - if (ctx->xin->report_hook) { - ctx->xin->report_hook(ctx->xin, s, ctx->recurse); - } -} - void xlate_out_copy(struct xlate_out *dst, const struct xlate_out *src) { @@ -3116,10 +4530,10 @@ dst->nf_output_iface = src->nf_output_iface; dst->mirrors = src->mirrors; - ofpbuf_use_stub(&dst->odp_actions, dst->odp_actions_stub, + dst->odp_actions = &dst->odp_actions_buf; + ofpbuf_use_stub(dst->odp_actions, dst->odp_actions_stub, sizeof dst->odp_actions_stub); - ofpbuf_put(&dst->odp_actions, ofpbuf_data(&src->odp_actions), - ofpbuf_size(&src->odp_actions)); + ofpbuf_put(dst->odp_actions, src->odp_actions->data, src->odp_actions->size); } static struct skb_priority_to_dscp * @@ -3146,6 +4560,12 @@ return pdscp != NULL; } +static size_t +count_skb_priorities(const struct xport *xport) +{ + return hmap_count(&xport->skb_priorities); +} + static void clear_skb_priorities(struct xport *xport) { @@ -3164,8 +4584,8 @@ const struct nlattr *a; unsigned int left; - NL_ATTR_FOR_EACH_UNSAFE (a, left, ofpbuf_data(&ctx->xout->odp_actions), - ofpbuf_size(&ctx->xout->odp_actions)) { + NL_ATTR_FOR_EACH_UNSAFE (a, left, ctx->xout->odp_actions->data, + ctx->xout->odp_actions->size) { if (nl_attr_type(a) == OVS_ACTION_ATTR_OUTPUT && nl_attr_get_odp_port(a) == local_odp_port) { return true; @@ -3174,16 +4594,7 @@ return false; } -/* Thread safe call to xlate_actions__(). */ -void -xlate_actions(struct xlate_in *xin, struct xlate_out *xout) - OVS_EXCLUDED(xlate_rwlock) -{ - ovs_rwlock_rdlock(&xlate_rwlock); - xlate_actions__(xin, xout); - ovs_rwlock_unlock(&xlate_rwlock); -} - +#if defined(__linux__) /* Returns the maximum number of packets that the Linux kernel is willing to * queue up internally to certain kinds of software-implemented ports, or the * default (and rarely modified) value if it cannot be determined. */ @@ -3228,14 +4639,14 @@ size_t left; int n = 0; - NL_ATTR_FOR_EACH_UNSAFE (a, left, ofpbuf_data(odp_actions), - ofpbuf_size(odp_actions)) { + NL_ATTR_FOR_EACH_UNSAFE (a, left, odp_actions->data, odp_actions->size) { if (a->nla_type == OVS_ACTION_ATTR_OUTPUT) { n++; } } return n; } +#endif /* defined(__linux__) */ /* Returns true if 'odp_actions' contains more output actions than the datapath * can reliably handle in one go. On Linux, this is the value of the @@ -3243,10 +4654,10 @@ * packets that the kernel is willing to queue up for processing while the * datapath is processing a set of actions. */ static bool -too_many_output_actions(const struct ofpbuf *odp_actions) +too_many_output_actions(const struct ofpbuf *odp_actions OVS_UNUSED) { #ifdef __linux__ - return (ofpbuf_size(odp_actions) / NL_A_U32_SIZE > netdev_max_backlog() + return (odp_actions->size / NL_A_U32_SIZE > netdev_max_backlog() && count_output_actions(odp_actions) > netdev_max_backlog()); #else /* OSes other than Linux might have similar limits, but we don't know how @@ -3255,22 +4666,21 @@ #endif } -/* Translates the 'ofpacts_len' bytes of "struct ofpacts" starting at 'ofpacts' - * into datapath actions in 'odp_actions', using 'ctx'. - * +/* Translates the flow, actions, or rule in 'xin' into datapath actions in + * 'xout'. * The caller must take responsibility for eventually freeing 'xout', with * xlate_out_uninit(). */ -static void -xlate_actions__(struct xlate_in *xin, struct xlate_out *xout) - OVS_REQ_RDLOCK(xlate_rwlock) +void +xlate_actions(struct xlate_in *xin, struct xlate_out *xout) { - struct flow_wildcards *wc = &xout->wc; + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + struct flow_wildcards *wc = NULL; struct flow *flow = &xin->flow; struct rule_dpif *rule = NULL; - const struct rule_actions *actions = NULL; enum slow_path_reason special; const struct ofpact *ofpacts; + struct xbridge *xbridge; struct xport *in_port; struct flow orig_flow; struct xlate_ctx ctx; @@ -3309,47 +4719,152 @@ ctx.xout->has_fin_timeout = false; ctx.xout->nf_output_iface = NF_OUT_DROP; ctx.xout->mirrors = 0; - ofpbuf_use_stub(&ctx.xout->odp_actions, ctx.xout->odp_actions_stub, - sizeof ctx.xout->odp_actions_stub); - ofpbuf_reserve(&ctx.xout->odp_actions, NL_A_U32_SIZE); + ctx.xout->n_recircs = 0; - ctx.xbridge = xbridge_lookup(xin->ofproto); - if (!ctx.xbridge) { - return; + xout->odp_actions = xin->odp_actions; + if (!xout->odp_actions) { + xout->odp_actions = &xout->odp_actions_buf; + ofpbuf_use_stub(xout->odp_actions, xout->odp_actions_stub, + sizeof xout->odp_actions_stub); } + ofpbuf_reserve(xout->odp_actions, NL_A_U32_SIZE); + xbridge = xbridge_lookup(xcfg, xin->ofproto); + if (!xbridge) { + return; + } + /* 'ctx.xbridge' may be changed by action processing, whereas 'xbridge' + * will remain set on the original input bridge. */ + ctx.xbridge = xbridge; ctx.rule = xin->rule; ctx.base_flow = *flow; memset(&ctx.base_flow.tunnel, 0, sizeof ctx.base_flow.tunnel); ctx.orig_tunnel_ip_dst = flow->tunnel.ip_dst; - flow_wildcards_init_catchall(wc); - memset(&wc->masks.in_port, 0xff, sizeof wc->masks.in_port); - memset(&wc->masks.skb_priority, 0xff, sizeof wc->masks.skb_priority); - memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type); - if (is_ip_any(flow)) { - wc->masks.nw_frag |= FLOW_NW_FRAG_MASK; + if (!xin->skip_wildcards) { + wc = &xout->wc; + flow_wildcards_init_catchall(wc); + memset(&wc->masks.in_port, 0xff, sizeof wc->masks.in_port); + memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type); + if (is_ip_any(flow)) { + wc->masks.nw_frag |= FLOW_NW_FRAG_MASK; + } + if (xbridge->support.recirc) { + /* Always exactly match recirc_id when datapath supports + * recirculation. */ + wc->masks.recirc_id = UINT32_MAX; + } + if (xbridge->netflow) { + netflow_mask_wc(flow, wc); + } } is_icmp = is_icmpv4(flow) || is_icmpv6(flow); tnl_may_send = tnl_xlate_init(&ctx.base_flow, flow, wc); - if (ctx.xbridge->netflow) { - netflow_mask_wc(flow, wc); - } ctx.recurse = 0; ctx.resubmits = 0; ctx.in_group = false; + ctx.in_action_set = false; ctx.orig_skb_priority = flow->skb_priority; ctx.table_id = 0; + ctx.rule_cookie = OVS_BE64_MAX; ctx.exit = false; - ctx.use_recirc = false; + ctx.was_mpls = false; + ctx.recirc_action_offset = -1; + ctx.last_unroll_offset = -1; + + ctx.action_set_has_group = false; + ofpbuf_use_stub(&ctx.action_set, + ctx.action_set_stub, sizeof ctx.action_set_stub); + + ofpbuf_use_stub(&ctx.stack, ctx.init_stack, sizeof ctx.init_stack); + + /* The in_port of the original packet before recirculation. */ + in_port = get_ofp_port(xbridge, flow->in_port.ofp_port); + + if (xin->recirc) { + const struct recirc_id_node *recirc = xin->recirc; + + if (xin->ofpacts_len > 0 || ctx.rule) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + + VLOG_WARN_RL(&rl, "Recirculation conflict (%s)!", + xin->ofpacts_len > 0 + ? "actions" + : "rule"); + return; + } + + /* Set the bridge for post-recirculation processing if needed. */ + if (ctx.xbridge->ofproto != recirc->ofproto) { + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); + const struct xbridge *new_bridge = xbridge_lookup(xcfg, + recirc->ofproto); + + if (OVS_UNLIKELY(!new_bridge)) { + /* Drop the packet if the bridge cannot be found. */ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + VLOG_WARN_RL(&rl, "Recirculation bridge no longer exists."); + return; + } + ctx.xbridge = new_bridge; + } + + /* Set the post-recirculation table id. Note: A table lookup is done + * only if there are no post-recirculation actions. */ + ctx.table_id = recirc->table_id; + + /* Restore pipeline metadata. May change flow's in_port and other + * metadata to the values that existed when recirculation was + * triggered. */ + recirc_metadata_to_flow(&recirc->metadata, flow); + + /* Restore stack, if any. */ + if (recirc->stack) { + ofpbuf_put(&ctx.stack, recirc->stack->data, recirc->stack->size); + } + + /* Restore action set, if any. */ + if (recirc->action_set_len) { + const struct ofpact *a; + + ofpbuf_put(&ctx.action_set, recirc->ofpacts, + recirc->action_set_len); + + OFPACT_FOR_EACH(a, recirc->ofpacts, recirc->action_set_len) { + if (a->type == OFPACT_GROUP) { + ctx.action_set_has_group = true; + break; + } + } + } + + /* Restore recirculation actions. If there are no actions, processing + * will start with a lookup in the table set above. */ + if (recirc->ofpacts_len > recirc->action_set_len) { + xin->ofpacts_len = recirc->ofpacts_len - recirc->action_set_len; + xin->ofpacts = recirc->ofpacts + + recirc->action_set_len / sizeof *recirc->ofpacts; + } + } else if (OVS_UNLIKELY(flow->recirc_id)) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + + VLOG_WARN_RL(&rl, "Recirculation context not found for ID %"PRIx32, + flow->recirc_id); + return; + } + /* The bridge is now known so obtain its table version. */ + ctx.tables_version = ofproto_dpif_get_tables_version(ctx.xbridge->ofproto); if (!xin->ofpacts && !ctx.rule) { - ctx.table_id = rule_dpif_lookup(ctx.xbridge->ofproto, flow, - !xin->skip_wildcards ? wc : NULL, - &rule, ctx.xin->xcache != NULL); + rule = rule_dpif_lookup_from_table(ctx.xbridge->ofproto, + ctx.tables_version, flow, wc, + ctx.xin->xcache != NULL, + ctx.xin->resubmit_stats, + &ctx.table_id, + flow->in_port.ofp_port, true, true); if (ctx.xin->resubmit_stats) { rule_dpif_credit_stats(rule, ctx.xin->resubmit_stats); } @@ -3360,6 +4875,10 @@ entry->u.rule = rule; } ctx.rule = rule; + + if (OVS_UNLIKELY(ctx.xin->resubmit_hook)) { + ctx.xin->resubmit_hook(ctx.xin, rule, 0); + } } xout->fail_open = ctx.rule && rule_dpif_is_fail_open(ctx.rule); @@ -3367,48 +4886,24 @@ ofpacts = xin->ofpacts; ofpacts_len = xin->ofpacts_len; } else if (ctx.rule) { - actions = rule_dpif_get_actions(ctx.rule); + const struct rule_actions *actions = rule_dpif_get_actions(ctx.rule); + ofpacts = actions->ofpacts; ofpacts_len = actions->ofpacts_len; + + ctx.rule_cookie = rule_dpif_get_flow_cookie(ctx.rule); } else { OVS_NOT_REACHED(); } - ofpbuf_use_stub(&ctx.stack, ctx.init_stack, sizeof ctx.init_stack); - ofpbuf_use_stub(&ctx.action_set, - ctx.action_set_stub, sizeof ctx.action_set_stub); - - if (mbridge_has_mirrors(ctx.xbridge->mbridge)) { + if (mbridge_has_mirrors(xbridge->mbridge)) { /* Do this conditionally because the copy is expensive enough that it * shows up in profiles. */ orig_flow = *flow; } - if (flow->nw_frag & FLOW_NW_FRAG_ANY) { - switch (ctx.xbridge->frag) { - case OFPC_FRAG_NORMAL: - /* We must pretend that transport ports are unavailable. */ - flow->tp_src = ctx.base_flow.tp_src = htons(0); - flow->tp_dst = ctx.base_flow.tp_dst = htons(0); - break; - - case OFPC_FRAG_DROP: - return; - - case OFPC_FRAG_REASM: - OVS_NOT_REACHED(); - - case OFPC_FRAG_NX_MATCH: - /* Nothing to do. */ - break; - - case OFPC_INVALID_TTL_TO_CONTROLLER: - OVS_NOT_REACHED(); - } - } - - in_port = get_ofp_port(ctx.xbridge, flow->in_port.ofp_port); - if (in_port && in_port->is_tunnel) { + /* Tunnel stats only for non-recirculated packets. */ + if (!xin->recirc && in_port && in_port->is_tunnel) { if (ctx.xin->resubmit_stats) { netdev_vport_inc_rx(in_port->netdev, ctx.xin->resubmit_stats); if (in_port->bfd) { @@ -3424,65 +4919,93 @@ } } - special = process_special(&ctx, flow, in_port, ctx.xin->packet); - if (special) { + /* Do not perform special processing on recirculated packets, + * as recirculated packets are not really received by the bridge. */ + if (!xin->recirc && + (special = process_special(&ctx, flow, in_port, ctx.xin->packet))) { ctx.xout->slow |= special; } else { size_t sample_actions_len; if (flow->in_port.ofp_port - != vsp_realdev_to_vlandev(ctx.xbridge->ofproto, + != vsp_realdev_to_vlandev(xbridge->ofproto, flow->in_port.ofp_port, flow->vlan_tci)) { ctx.base_flow.vlan_tci = 0; } - add_sflow_action(&ctx); - add_ipfix_action(&ctx); - sample_actions_len = ofpbuf_size(&ctx.xout->odp_actions); + /* Sampling is done only for packets really received by the bridge. */ + if (!xin->recirc) { + add_sflow_action(&ctx); + add_ipfix_action(&ctx); + sample_actions_len = ctx.xout->odp_actions->size; + } else { + sample_actions_len = 0; + } if (tnl_may_send && (!in_port || may_receive(in_port, &ctx))) { do_xlate_actions(ofpacts, ofpacts_len, &ctx); /* We've let OFPP_NORMAL and the learning action look at the * packet, so drop it now if forwarding is disabled. */ - if (in_port && !xport_stp_forward_state(in_port)) { - ofpbuf_set_size(&ctx.xout->odp_actions, sample_actions_len); + if (in_port && (!xport_stp_forward_state(in_port) || + !xport_rstp_forward_state(in_port))) { + /* Drop all actions added by do_xlate_actions() above. */ + ctx.xout->odp_actions->size = sample_actions_len; + + /* Undo changes that may have been done for recirculation. */ + if (exit_recirculates(&ctx)) { + ctx.action_set.size = ctx.recirc_action_offset; + ctx.recirc_action_offset = -1; + ctx.last_unroll_offset = -1; + } + } else if (ctx.action_set.size) { + /* Translate action set only if not dropping the packet and + * not recirculating. */ + if (!exit_recirculates(&ctx)) { + xlate_action_set(&ctx); + } + } + /* Check if need to recirculate. */ + if (exit_recirculates(&ctx)) { + compose_recirculate_action(&ctx); } } - if (ofpbuf_size(&ctx.action_set)) { - xlate_action_set(&ctx); - } - - if (ctx.xbridge->has_in_band + /* Output only fully processed packets. */ + if (!exit_recirculates(&ctx) + && xbridge->has_in_band && in_band_must_output_to_local_port(flow) && !actions_output_to_local_port(&ctx)) { - compose_output_action(&ctx, OFPP_LOCAL); + compose_output_action(&ctx, OFPP_LOCAL, NULL); } - fix_sflow_action(&ctx); - - if (mbridge_has_mirrors(ctx.xbridge->mbridge)) { + if (!xin->recirc) { + fix_sflow_action(&ctx); + } + /* Only mirror fully processed packets. */ + if (!exit_recirculates(&ctx) + && mbridge_has_mirrors(xbridge->mbridge)) { add_mirror_actions(&ctx, &orig_flow); } } - if (nl_attr_oversized(ofpbuf_size(&ctx.xout->odp_actions))) { + if (nl_attr_oversized(ctx.xout->odp_actions->size)) { /* These datapath actions are too big for a Netlink attribute, so we * can't hand them to the kernel directly. dpif_execute() can execute * them one by one with help, so just mark the result as SLOW_ACTION to * prevent the flow from being installed. */ COVERAGE_INC(xlate_actions_oversize); ctx.xout->slow |= SLOW_ACTION; - } else if (too_many_output_actions(&ctx.xout->odp_actions)) { + } else if (too_many_output_actions(ctx.xout->odp_actions)) { COVERAGE_INC(xlate_actions_too_many_output); ctx.xout->slow |= SLOW_ACTION; } - if (mbridge_has_mirrors(ctx.xbridge->mbridge)) { + /* Update mirror stats only for packets really received by the bridge. */ + if (!xin->recirc && mbridge_has_mirrors(xbridge->mbridge)) { if (ctx.xin->resubmit_stats) { - mirror_update_stats(ctx.xbridge->mbridge, xout->mirrors, + mirror_update_stats(xbridge->mbridge, xout->mirrors, ctx.xin->resubmit_stats->n_packets, ctx.xin->resubmit_stats->n_bytes); } @@ -3490,12 +5013,13 @@ struct xc_entry *entry; entry = xlate_cache_add_entry(ctx.xin->xcache, XC_MIRROR); - entry->u.mirror.mbridge = mbridge_ref(ctx.xbridge->mbridge); + entry->u.mirror.mbridge = mbridge_ref(xbridge->mbridge); entry->u.mirror.mirrors = xout->mirrors; } } - if (ctx.xbridge->netflow) { + /* Do netflow only for packets really received by the bridge. */ + if (!xin->recirc && xbridge->netflow) { /* Only update netflow if we don't have controller flow. We don't * report NetFlow expiration messages for such facets because they * are just part of the control logic for the network, not real @@ -3504,7 +5028,7 @@ || ofpacts->type != OFPACT_CONTROLLER || ofpact_next(ofpacts) < ofpact_end(ofpacts, ofpacts_len)) { if (ctx.xin->resubmit_stats) { - netflow_flow_update(ctx.xbridge->netflow, flow, + netflow_flow_update(xbridge->netflow, flow, xout->nf_output_iface, ctx.xin->resubmit_stats); } @@ -3512,7 +5036,7 @@ struct xc_entry *entry; entry = xlate_cache_add_entry(ctx.xin->xcache, XC_NETFLOW); - entry->u.nf.netflow = netflow_ref(ctx.xbridge->netflow); + entry->u.nf.netflow = netflow_ref(xbridge->netflow); entry->u.nf.flow = xmemdup(flow, sizeof *flow); entry->u.nf.iface = xout->nf_output_iface; } @@ -3522,23 +5046,29 @@ ofpbuf_uninit(&ctx.stack); ofpbuf_uninit(&ctx.action_set); - /* Clear the metadata and register wildcard masks, because we won't - * use non-header fields as part of the cache. */ - flow_wildcards_clear_non_packet_fields(wc); - - /* ICMPv4 and ICMPv6 have 8-bit "type" and "code" fields. struct flow uses - * the low 8 bits of the 16-bit tp_src and tp_dst members to represent - * these fields. The datapath interface, on the other hand, represents - * them with just 8 bits each. This means that if the high 8 bits of the - * masks for these fields somehow become set, then they will get chopped - * off by a round trip through the datapath, and revalidation will spot - * that as an inconsistency and delete the flow. Avoid the problem here by - * making sure that only the low 8 bits of either field can be unwildcarded - * for ICMP. - */ - if (is_icmp) { - wc->masks.tp_src &= htons(UINT8_MAX); - wc->masks.tp_dst &= htons(UINT8_MAX); + if (wc) { + /* Clear the metadata and register wildcard masks, because we won't + * use non-header fields as part of the cache. */ + flow_wildcards_clear_non_packet_fields(wc); + + /* ICMPv4 and ICMPv6 have 8-bit "type" and "code" fields. struct flow + * uses the low 8 bits of the 16-bit tp_src and tp_dst members to + * represent these fields. The datapath interface, on the other hand, + * represents them with just 8 bits each. This means that if the high + * 8 bits of the masks for these fields somehow become set, then they + * will get chopped off by a round trip through the datapath, and + * revalidation will spot that as an inconsistency and delete the flow. + * Avoid the problem here by making sure that only the low 8 bits of + * either field can be unwildcarded for ICMP. + */ + if (is_icmp) { + wc->masks.tp_src &= htons(UINT8_MAX); + wc->masks.tp_dst &= htons(UINT8_MAX); + } + /* VLAN_TCI CFI bit must be matched if any of the TCI is matched. */ + if (wc->masks.vlan_tci) { + wc->masks.vlan_tci |= htons(VLAN_CFI); + } } } @@ -3546,26 +5076,24 @@ * May modify 'packet'. * Returns 0 if successful, otherwise a positive errno value. */ int -xlate_send_packet(const struct ofport_dpif *ofport, struct ofpbuf *packet) +xlate_send_packet(const struct ofport_dpif *ofport, struct dp_packet *packet) { + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); struct xport *xport; struct ofpact_output output; struct flow flow; ofpact_init(&output.ofpact, OFPACT_OUTPUT, sizeof output); /* Use OFPP_NONE as the in_port to avoid special packet processing. */ - flow_extract(packet, NULL, &flow); + flow_extract(packet, &flow); flow.in_port.ofp_port = OFPP_NONE; - ovs_rwlock_rdlock(&xlate_rwlock); - xport = xport_lookup(ofport); + xport = xport_lookup(xcfg, ofport); if (!xport) { - ovs_rwlock_unlock(&xlate_rwlock); return EINVAL; } output.port = xport->ofp_port; output.max_len = 0; - ovs_rwlock_unlock(&xlate_rwlock); return ofproto_dpif_execute_actions(xport->xbridge->ofproto, &flow, NULL, &output.ofpact, sizeof output, @@ -3609,11 +5137,12 @@ static void xlate_cache_normal(struct ofproto_dpif *ofproto, struct flow *flow, int vlan) { + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); struct xbridge *xbridge; struct xbundle *xbundle; struct flow_wildcards wc; - xbridge = xbridge_lookup(ofproto); + xbridge = xbridge_lookup(xcfg, ofproto); if (!xbridge) { return; } @@ -3629,11 +5158,16 @@ /* Push stats and perform side effects of flow translation. */ void -xlate_push_stats(struct xlate_cache *xcache, bool may_learn, +xlate_push_stats(struct xlate_cache *xcache, const struct dpif_flow_stats *stats) { struct xc_entry *entry; struct ofpbuf entries = xcache->entries; + uint8_t dmac[ETH_ADDR_LEN]; + + if (!stats->n_packets) { + return; + } XC_ENTRY_FOR_EACH (entry, entries, xcache) { switch (entry->type) { @@ -3657,10 +5191,7 @@ stats->n_packets, stats->n_bytes); break; case XC_LEARN: - if (may_learn) { - ofproto_dpif_flow_mod(entry->u.learn.ofproto, - entry->u.learn.fm); - } + ofproto_dpif_flow_mod(entry->u.learn.ofproto, entry->u.learn.fm); break; case XC_NORMAL: xlate_cache_normal(entry->u.normal.ofproto, entry->u.normal.flow, @@ -3670,6 +5201,14 @@ xlate_fin_timeout__(entry->u.fin.rule, stats->tcp_flags, entry->u.fin.idle, entry->u.fin.hard); break; + case XC_GROUP: + group_dpif_credit_stats(entry->u.group.group, entry->u.group.bucket, + stats); + break; + case XC_TNL_ARP: + /* Lookup arp to avoid arp timeout. */ + tnl_arp_lookup(entry->u.tnl_arp_cache.br_name, entry->u.tnl_arp_cache.d_ip, dmac); + break; default: OVS_NOT_REACHED(); } @@ -3737,6 +5276,11 @@ /* 'u.fin.rule' is always already held as a XC_RULE, which * has already released it's reference above. */ break; + case XC_GROUP: + group_dpif_unref(entry->u.group.group); + break; + case XC_TNL_ARP: + break; default: OVS_NOT_REACHED(); } diff -Nru openvswitch-2.3.1/ofproto/ofproto-dpif-xlate.h openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-xlate.h --- openvswitch-2.3.1/ofproto/ofproto-dpif-xlate.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-dpif-xlate.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,14 +15,17 @@ #ifndef OFPROTO_DPIF_XLATE_H #define OFPROTO_DPIF_XLATE_H 1 +#include "dp-packet.h" #include "flow.h" #include "meta-flow.h" #include "odp-util.h" #include "ofpbuf.h" #include "ofproto-dpif-mirror.h" +#include "ofproto-dpif-rid.h" #include "ofproto-dpif.h" #include "ofproto.h" #include "stp.h" +#include "ovs-lldp.h" struct bfd; struct bond; @@ -31,14 +34,9 @@ struct dpif_ipfix; struct dpif_sflow; struct mac_learning; +struct mcast_snooping; struct xlate_cache; -struct xlate_recirc { - uint32_t recirc_id; /* !0 Use recirculation instead of output. */ - uint8_t hash_alg; /* !0 Compute hash for recirc before. */ - uint32_t hash_basis; /* Compute hash for recirc before. */ -}; - struct xlate_out { /* Wildcards relevant in translation. Any fields that were used to * calculate the action must be set for caching and kernel @@ -57,10 +55,72 @@ ofp_port_t nf_output_iface; /* Output interface index for NetFlow. */ mirror_mask_t mirrors; /* Bitmap of associated mirrors. */ + /* Recirculation IDs on which references are held. */ + unsigned n_recircs; + union { + uint32_t recirc[2]; /* When n_recircs == 1 or 2 */ + uint32_t *recircs; /* When 'n_recircs' > 2 */ + }; + uint64_t odp_actions_stub[256 / 8]; - struct ofpbuf odp_actions; + struct ofpbuf odp_actions_buf; + struct ofpbuf *odp_actions; }; +/* Helpers to abstract the recirculation union away. */ +static inline void +xlate_out_add_recirc(struct xlate_out *xout, uint32_t id) +{ + if (OVS_LIKELY(xout->n_recircs < ARRAY_SIZE(xout->recirc))) { + xout->recirc[xout->n_recircs++] = id; + } else { + if (xout->n_recircs == ARRAY_SIZE(xout->recirc)) { + uint32_t *recircs = xmalloc(sizeof xout->recirc + sizeof id); + + memcpy(recircs, xout->recirc, sizeof xout->recirc); + xout->recircs = recircs; + } else { + xout->recircs = xrealloc(xout->recircs, + (xout->n_recircs + 1) * sizeof id); + } + xout->recircs[xout->n_recircs++] = id; + } +} + +static inline const uint32_t * +xlate_out_get_recircs(const struct xlate_out *xout) +{ + if (OVS_LIKELY(xout->n_recircs <= ARRAY_SIZE(xout->recirc))) { + return xout->recirc; + } else { + return xout->recircs; + } +} + +static inline void +xlate_out_take_recircs(struct xlate_out *xout) +{ + if (OVS_UNLIKELY(xout->n_recircs > ARRAY_SIZE(xout->recirc))) { + free(xout->recircs); + } + xout->n_recircs = 0; +} + +static inline void +xlate_out_free_recircs(struct xlate_out *xout) +{ + if (OVS_LIKELY(xout->n_recircs <= ARRAY_SIZE(xout->recirc))) { + for (int i = 0; i < xout->n_recircs; i++) { + recirc_free_id(xout->recirc[i]); + } + } else { + for (int i = 0; i < xout->n_recircs; i++) { + recirc_free_id(xout->recircs[i]); + } + free(xout->recircs); + } +} + struct xlate_in { struct ofproto_dpif *ofproto; @@ -70,7 +130,7 @@ /* The packet corresponding to 'flow', or a null pointer if we are * revalidating without a packet to refer to. */ - const struct ofpbuf *packet; + const struct dp_packet *packet; /* Should OFPP_NORMAL update the MAC learning table? Should "learn" * actions update the flow table? @@ -134,62 +194,68 @@ * This is normally null so the client has to set it manually after * calling xlate_in_init(). */ struct xlate_cache *xcache; -}; -extern struct ovs_rwlock xlate_rwlock; + /* Allows callers to optionally supply their own buffer for the resulting + * odp_actions stored in xlate_out. If NULL, the default buffer will be + * used. */ + struct ofpbuf *odp_actions; + + /* The recirculation context related to this translation, as returned by + * xlate_lookup. */ + const struct recirc_id_node *recirc; +}; -void xlate_ofproto_set(struct ofproto_dpif *, const char *name, - struct dpif *, struct rule_dpif *miss_rule, - struct rule_dpif *no_packet_in_rule, +void xlate_ofproto_set(struct ofproto_dpif *, const char *name, struct dpif *, const struct mac_learning *, struct stp *, + struct rstp *, const struct mcast_snooping *, const struct mbridge *, const struct dpif_sflow *, const struct dpif_ipfix *, const struct netflow *, - enum ofp_config_flags, bool forward_bpdu, - bool has_in_band, bool enable_recirc, - bool variable_length_userdata, - size_t mpls_label_stack_length) - OVS_REQ_WRLOCK(xlate_rwlock); -void xlate_remove_ofproto(struct ofproto_dpif *) OVS_REQ_WRLOCK(xlate_rwlock); + bool forward_bpdu, bool has_in_band, + const struct dpif_backer_support *support); +void xlate_remove_ofproto(struct ofproto_dpif *); void xlate_bundle_set(struct ofproto_dpif *, struct ofbundle *, const char *name, enum port_vlan_mode, int vlan, unsigned long *trunks, bool use_priority_tags, const struct bond *, const struct lacp *, - bool floodable) OVS_REQ_WRLOCK(xlate_rwlock); -void xlate_bundle_remove(struct ofbundle *) OVS_REQ_WRLOCK(xlate_rwlock); + bool floodable); +void xlate_bundle_remove(struct ofbundle *); void xlate_ofport_set(struct ofproto_dpif *, struct ofbundle *, struct ofport_dpif *, ofp_port_t, odp_port_t, - const struct netdev *, const struct cfm *, - const struct bfd *, struct ofport_dpif *peer, - int stp_port_no, const struct ofproto_port_queue *qdscp, + const struct netdev *, const struct cfm *, const struct bfd *, + const struct lldp *, struct ofport_dpif *peer, + int stp_port_no, const struct rstp_port *rstp_port, + const struct ofproto_port_queue *qdscp, size_t n_qdscp, enum ofputil_port_config, enum ofputil_port_state, bool is_tunnel, - bool may_enable) OVS_REQ_WRLOCK(xlate_rwlock); -void xlate_ofport_remove(struct ofport_dpif *) OVS_REQ_WRLOCK(xlate_rwlock); + bool may_enable); +void xlate_ofport_remove(struct ofport_dpif *); -int xlate_receive(const struct dpif_backer *, struct ofpbuf *packet, - const struct nlattr *key, size_t key_len, - struct flow *, struct ofproto_dpif **, struct dpif_ipfix **, - struct dpif_sflow **, struct netflow **, - odp_port_t *odp_in_port) - OVS_EXCLUDED(xlate_rwlock); +struct ofproto_dpif * xlate_lookup_ofproto(const struct dpif_backer *, + const struct flow *, + ofp_port_t *ofp_in_port); +int xlate_lookup(const struct dpif_backer *, const struct flow *, + struct ofproto_dpif **, struct dpif_ipfix **, + struct dpif_sflow **, struct netflow **, + ofp_port_t *ofp_in_port); -void xlate_actions(struct xlate_in *, struct xlate_out *) - OVS_EXCLUDED(xlate_rwlock); +void xlate_actions(struct xlate_in *, struct xlate_out *); void xlate_in_init(struct xlate_in *, struct ofproto_dpif *, - const struct flow *, struct rule_dpif *, - uint16_t tcp_flags, const struct ofpbuf *packet); + const struct flow *, ofp_port_t in_port, struct rule_dpif *, + uint16_t tcp_flags, const struct dp_packet *packet); void xlate_out_uninit(struct xlate_out *); void xlate_actions_for_side_effects(struct xlate_in *); void xlate_out_copy(struct xlate_out *dst, const struct xlate_out *src); -int xlate_send_packet(const struct ofport_dpif *, struct ofpbuf *); +int xlate_send_packet(const struct ofport_dpif *, struct dp_packet *); struct xlate_cache *xlate_cache_new(void); -void xlate_push_stats(struct xlate_cache *, bool may_learn, - const struct dpif_flow_stats *); +void xlate_push_stats(struct xlate_cache *, const struct dpif_flow_stats *); void xlate_cache_clear(struct xlate_cache *); void xlate_cache_delete(struct xlate_cache *); +void xlate_txn_start(void); +void xlate_txn_commit(void); + #endif /* ofproto-dpif-xlate.h */ diff -Nru openvswitch-2.3.1/ofproto/ofproto.h openvswitch-2.4.0~git20150623/ofproto/ofproto.h --- openvswitch-2.3.1/ofproto/ofproto.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto.h 2015-06-23 18:46:21.000000000 +0000 @@ -27,8 +27,11 @@ #include "flow.h" #include "meta-flow.h" #include "netflow.h" +#include "rstp.h" +#include "smap.h" #include "sset.h" #include "stp.h" +#include "lacp.h" #ifdef __cplusplus extern "C" { @@ -44,15 +47,19 @@ struct shash; struct simap; struct smap; +struct netdev_stats; +struct ovs_list; +struct lldp_status; +struct aa_settings; +struct aa_mapping_settings; + +/* Needed for the lock annotations. */ +extern struct ovs_mutex ofproto_mutex; struct ofproto_controller_info { bool is_connected; enum ofp12_controller_role role; - struct { - const char *keys[4]; - const char *values[4]; - size_t n; - } pairs; + struct smap pairs; }; struct ofproto_sflow_options { @@ -72,6 +79,9 @@ uint32_t obs_point_id; /* Bridge-wide Observation Point ID. */ uint32_t cache_active_timeout; uint32_t cache_max_flows; + bool enable_tunnel_sampling; + bool enable_input_sampling; + bool enable_output_sampling; }; struct ofproto_ipfix_flow_exporter_options { @@ -81,6 +91,52 @@ uint32_t cache_max_flows; }; +struct ofproto_rstp_status { + bool enabled; /* If false, ignore other members. */ + rstp_identifier root_id; + rstp_identifier bridge_id; + rstp_identifier designated_id; + uint32_t root_path_cost; + uint16_t designated_port_id; + uint16_t bridge_port_id; +}; + +struct ofproto_rstp_settings { + rstp_identifier address; + uint16_t priority; + uint32_t ageing_time; + enum rstp_force_protocol_version force_protocol_version; + uint16_t bridge_forward_delay; + uint16_t bridge_max_age; + uint16_t transmit_hold_count; +}; + +struct ofproto_port_rstp_status { + bool enabled; /* If false, ignore other members. */ + uint16_t port_id; + enum rstp_port_role role; + enum rstp_state state; + rstp_identifier designated_bridge_id; + uint16_t designated_port_id; + uint32_t designated_path_cost; + int tx_count; /* Number of BPDUs transmitted. */ + int rx_count; /* Number of valid BPDUs received. */ + int error_count; /* Number of bad BPDUs received. */ + int uptime; +}; + +struct ofproto_port_rstp_settings { + bool enable; + uint16_t port_num; /* In the range 1-4095, inclusive. */ + uint8_t priority; + uint32_t path_cost; + bool admin_edge_port; + bool auto_edge; + bool mcheck; + uint8_t admin_p2p_mac_state; + bool admin_port_state; +}; + struct ofproto_stp_settings { stp_identifier system_id; uint16_t priority; @@ -123,6 +179,20 @@ uint8_t dscp; /* DSCP bits (e.g. [0, 63]). */ }; +struct ofproto_mcast_snooping_settings { + bool flood_unreg; /* If true, flood unregistered packets to all + all ports. If false, send only to ports + connected to multicast routers. */ + unsigned int idle_time; /* Entry is removed after the idle time + * in seconds. */ + unsigned int max_entries; /* Size of the multicast snooping table. */ +}; + +struct ofproto_mcast_snooping_port_settings { + bool flood; /* If true, flood multicast traffic */ + bool flood_reports; /* If true, flood Reports traffic */ +}; + /* How the switch should act if the controller cannot be contacted. */ enum ofproto_fail_mode { OFPROTO_FAIL_SECURE, /* Preserve flow table. */ @@ -214,7 +284,7 @@ ) #define OFPROTO_FLOW_LIMIT_DEFAULT 200000 -#define OFPROTO_MAX_IDLE_DEFAULT 1500 +#define OFPROTO_MAX_IDLE_DEFAULT 10000 /* ms */ const char *ofproto_port_open_type(const char *datapath_type, const char *port_type); @@ -241,7 +311,13 @@ void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu); void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time, size_t max_entries); +int ofproto_set_mcast_snooping(struct ofproto *ofproto, + const struct ofproto_mcast_snooping_settings *s); +int ofproto_port_set_mcast_snooping(struct ofproto *ofproto, void *aux, + const struct ofproto_mcast_snooping_port_settings *s); void ofproto_set_threads(int n_handlers, int n_revalidators); +void ofproto_set_n_dpdk_rxqs(int n_rxqs); +void ofproto_set_cpu_mask(const char *cmask); void ofproto_set_dp_desc(struct ofproto *, const char *dp_desc); int ofproto_set_snoops(struct ofproto *, const struct sset *snoops); int ofproto_set_netflow(struct ofproto *, @@ -256,6 +332,9 @@ int ofproto_set_stp(struct ofproto *, const struct ofproto_stp_settings *); int ofproto_get_stp_status(struct ofproto *, struct ofproto_stp_status *); +int ofproto_set_rstp(struct ofproto *, const struct ofproto_rstp_settings *); +int ofproto_get_rstp_status(struct ofproto *, struct ofproto_rstp_status *); + /* Configuration of ports. */ void ofproto_port_unregister(struct ofproto *, ofp_port_t ofp_port); @@ -264,9 +343,11 @@ const struct cfm_settings *); void ofproto_port_set_bfd(struct ofproto *, ofp_port_t ofp_port, const struct smap *cfg); +bool ofproto_port_bfd_status_changed(struct ofproto *, ofp_port_t ofp_port); int ofproto_port_get_bfd_status(struct ofproto *, ofp_port_t ofp_port, - bool force, struct smap *); + struct smap *); int ofproto_port_is_lacp_current(struct ofproto *, ofp_port_t ofp_port); +int ofproto_port_get_lacp_stats(const struct ofport *, struct lacp_slave_stats *); int ofproto_port_set_stp(struct ofproto *, ofp_port_t ofp_port, const struct ofproto_port_stp_settings *); int ofproto_port_get_stp_status(struct ofproto *, ofp_port_t ofp_port, @@ -276,6 +357,11 @@ int ofproto_port_set_queues(struct ofproto *, ofp_port_t ofp_port, const struct ofproto_port_queue *, size_t n_queues); +int ofproto_port_get_rstp_status(struct ofproto *, ofp_port_t ofp_port, + struct ofproto_port_rstp_status *); + +int ofproto_port_set_rstp(struct ofproto *, ofp_port_t ofp_port, + const struct ofproto_port_rstp_settings *); /* The behaviour of the port regarding VLAN handling */ enum port_vlan_mode { @@ -355,6 +441,16 @@ int ofproto_mirror_get_stats(struct ofproto *, void *aux, uint64_t *packets, uint64_t *bytes); +void ofproto_port_set_lldp(struct ofproto *ofproto, ofp_port_t ofp_port, + const struct smap *cfg); +int ofproto_set_aa(struct ofproto *ofproto, void *aux, + const struct aa_settings *s); +int ofproto_aa_mapping_register(struct ofproto *ofproto, void *aux, + const struct aa_mapping_settings *s); +int ofproto_aa_mapping_unregister(struct ofproto *ofproto, void *aux); +int ofproto_aa_vlan_get_queued(struct ofproto *ofproto, struct ovs_list *list); +unsigned int ofproto_aa_vlan_get_queue_size(struct ofproto *ofproto); + int ofproto_set_flood_vlans(struct ofproto *, unsigned long *flood_vlans); bool ofproto_is_mirror_output_bundle(const struct ofproto *, void *aux); @@ -381,6 +477,9 @@ enum mf_field_id prefix_fields[CLS_MAX_TRIES]; }; +extern const enum mf_field_id default_prefix_fields[2]; +BUILD_ASSERT_DECL(ARRAY_SIZE(default_prefix_fields) <= CLS_MAX_TRIES); + int ofproto_get_n_tables(const struct ofproto *); uint8_t ofproto_get_n_visible_tables(const struct ofproto *); void ofproto_configure_table(struct ofproto *, int table_id, @@ -396,32 +495,11 @@ void ofproto_get_ofproto_controller_info(const struct ofproto *, struct shash *); void ofproto_free_ofproto_controller_info(struct shash *); -/* CFM status query. */ -struct ofproto_cfm_status { - /* 0 if not faulted, otherwise a combination of one or more reasons. */ - enum cfm_fault_reason faults; - - /* 0 if the remote CFM endpoint is operationally down, - * 1 if the remote CFM endpoint is operationally up, - * -1 if we don't know because the remote CFM endpoint is not in extended - * mode. */ - int remote_opstate; - - uint64_t flap_count; - - /* Ordinarily a "health status" in the range 0...100 inclusive, with 0 - * being worst and 100 being best, or -1 if the health status is not - * well-defined. */ - int health; - - /* MPIDs of remote maintenance points whose CCMs have been received. */ - uint64_t *rmps; - size_t n_rmps; -}; +bool ofproto_port_cfm_status_changed(struct ofproto *, ofp_port_t ofp_port); int ofproto_port_get_cfm_status(const struct ofproto *, - ofp_port_t ofp_port, bool force, - struct ofproto_cfm_status *); + ofp_port_t ofp_port, + struct cfm_status *); /* Linux VLAN device support (e.g. "eth0.10" for VLAN 10.) * @@ -437,24 +515,8 @@ /* Table configuration */ -enum ofproto_table_config { - /* Send to controller. */ - OFPROTO_TABLE_MISS_CONTROLLER = OFPTC11_TABLE_MISS_CONTROLLER, - - /* Continue to the next table in the pipeline (OpenFlow 1.0 behavior). */ - OFPROTO_TABLE_MISS_CONTINUE = OFPTC11_TABLE_MISS_CONTINUE, - - /* Drop the packet. */ - OFPROTO_TABLE_MISS_DROP = OFPTC11_TABLE_MISS_DROP, - - /* The default miss behaviour for the OpenFlow version of the controller a - * packet_in message would be sent to.. For pre-OF1.3 controllers, send - * packet_in to controller. For OF1.3+ controllers, drop. */ - OFPROTO_TABLE_MISS_DEFAULT = 3, -}; - -enum ofproto_table_config ofproto_table_get_config(const struct ofproto *, - uint8_t table_id); +enum ofputil_table_miss ofproto_table_get_miss_config(const struct ofproto *, + uint8_t table_id); #ifdef __cplusplus } diff -Nru openvswitch-2.3.1/ofproto/ofproto-provider.h openvswitch-2.4.0~git20150623/ofproto/ofproto-provider.h --- openvswitch-2.3.1/ofproto/ofproto-provider.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-provider.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,6 +54,7 @@ struct ofputil_flow_mod; struct bfd_cfg; struct meter; +struct ofoperation; extern struct ovs_mutex ofproto_mutex; @@ -72,7 +73,7 @@ uint64_t datapath_id; /* Datapath ID. */ bool forward_bpdu; /* Option to allow forwarding of BPDU frames * when NORMAL action is invoked. */ - char *mfr_desc; /* Manufacturer (NULL for default)b. */ + char *mfr_desc; /* Manufacturer (NULL for default). */ char *hw_desc; /* Hardware (NULL for default). */ char *sw_desc; /* Software version (NULL for default). */ char *serial_desc; /* Serial number (NULL for default). */ @@ -92,12 +93,15 @@ long long int eviction_group_timer; /* For rate limited reheapification. */ struct oftable *tables; int n_tables; + cls_version_t tables_version; /* Controls which rules are visible to + * table lookups. */ /* Rules indexed on their cookie values, in all flow tables. */ struct hindex cookies OVS_GUARDED_BY(ofproto_mutex); + struct hmap learned_cookies OVS_GUARDED_BY(ofproto_mutex); /* List of expirable flows, in all flow tables. */ - struct list expirable OVS_GUARDED_BY(ofproto_mutex); + struct ovs_list expirable OVS_GUARDED_BY(ofproto_mutex); /* Meter table. * OpenFlow meters start at 1. To avoid confusion we leave the first @@ -109,22 +113,6 @@ /* OpenFlow connections. */ struct connmgr *connmgr; - /* Flow table operation tracking. - * - * 'state' is meaningful only within ofproto.c, one of the enum - * ofproto_state constants defined there. - * - * 'pending' is the list of "struct ofopgroup"s currently pending. - * - * 'n_pending' is the number of elements in 'pending'. - * - * 'deletions' contains pending ofoperations of type OFOPERATION_DELETE, - * indexed on its rule's flow.*/ - int state; - struct list pending OVS_GUARDED_BY(ofproto_mutex); - unsigned int n_pending OVS_GUARDED_BY(ofproto_mutex); - struct hmap deletions OVS_GUARDED_BY(ofproto_mutex); - /* Delayed rule executions. * * We delay calls to ->ofproto_class->rule_execute() past releasing @@ -210,21 +198,18 @@ * Thread-safety * ============= * - * A cls->rwlock read-lock holder prevents rules from being added or deleted. + * Adding or removing rules requires holding ofproto_mutex. * - * Adding or removing rules requires holding ofproto_mutex AND the cls->rwlock - * write-lock. - * - * cls->rwlock should be held only briefly. For extended access to a rule, - * increment its ref_count with ofproto_rule_ref(). A rule will not be freed - * until its ref_count reaches zero. - * - * Modifying a rule requires the rule's own mutex. Holding cls->rwlock (for - * read or write) does not allow the holder to modify the rule. - * - * Freeing a rule requires ofproto_mutex and the cls->rwlock write-lock. After - * removing the rule from the classifier, release a ref_count from the rule - * ('cls''s reference to the rule). + * Rules in 'cls' are RCU protected. For extended access to a rule, try + * incrementing its ref_count with ofproto_rule_try_ref(), or + * ofproto_rule_ref(), if the rule is still known to be in 'cls'. A rule + * will be freed using ovsrcu_postpone() once its 'ref_count' reaches zero. + * + * Modifying a rule requires the rule's own mutex. + * + * Freeing a rule requires ofproto_mutex. After removing the rule from the + * classifier, release a ref_count from the rule ('cls''s reference to the + * rule). * * Refer to the thread-safety notes on struct rule for more information.*/ struct oftable { @@ -235,6 +220,9 @@ /* Maximum number of flows or UINT_MAX if there is no limit besides any * limit imposed by resource limitations. */ unsigned int max_flows; + /* Current number of flows, not counting temporary duplicates nor deferred + * deletions. */ + unsigned int n_flows; /* These members determine the handling of an attempt to add a flow that * would cause the table to have more than 'max_flows' flows. @@ -258,8 +246,11 @@ struct hmap eviction_groups_by_id; struct heap eviction_groups_by_size; - /* Table config: contains enum ofproto_table_config; accessed atomically. */ - atomic_uint config; + /* Table configuration. */ + ATOMIC(enum ofputil_table_miss) miss_config; + + atomic_ulong n_matched; + atomic_ulong n_missed; }; /* Assigns TABLE to each oftable, in turn, in OFPROTO. @@ -300,19 +291,21 @@ * Rules * ----- * - * A rule 'rule' may be accessed without a risk of being freed by code that - * holds a read-lock or write-lock on 'cls->rwlock' or that owns a reference to - * 'rule->ref_count' (or both). Code that needs to hold onto a rule for a - * while should take 'cls->rwlock', find the rule it needs, increment - * 'rule->ref_count' with ofproto_rule_ref(), and drop 'cls->rwlock'. + * A rule 'rule' may be accessed without a risk of being freed by a thread + * until the thread quiesces (i.e., rules are RCU protected and destructed + * using ovsrcu_postpone()). Code that needs to hold onto a rule for a + * while should increment 'rule->ref_count' either with ofproto_rule_ref() + * (if 'ofproto_mutex' is held), or with ofproto_rule_try_ref() (when some + * other thread might remove the rule from 'cls'). ofproto_rule_try_ref() + * will fail if the rule has already been scheduled for destruction. * * 'rule->ref_count' protects 'rule' from being freed. It doesn't protect the - * rule from being deleted from 'cls' (that's 'cls->rwlock') and it doesn't + * rule from being deleted from 'cls' (that's 'ofproto_mutex') and it doesn't * protect members of 'rule' from modification (that's 'rule->mutex'). * * 'rule->mutex' protects the members of 'rule' from modification. It doesn't - * protect the rule from being deleted from 'cls' (that's 'cls->rwlock') and it - * doesn't prevent the rule from being freed (that's 'rule->ref_count'). + * protect the rule from being deleted from 'cls' (that's 'ofproto_mutex') and + * it doesn't prevent the rule from being freed (that's 'rule->ref_count'). * * Regarding thread safety, the members of a rule fall into the following * categories: @@ -333,6 +326,8 @@ struct ofproto *const ofproto; /* The ofproto that contains this rule. */ const struct cls_rule cr; /* In owning ofproto's classifier. */ const uint8_t table_id; /* Index in ofproto's 'tables' array. */ + bool removed; /* Rule has been removed from the ofproto + * data structures. */ /* Protects members marked OVS_GUARDED. * Readers only need to hold this mutex. @@ -347,9 +342,6 @@ * reference. */ struct ovs_refcount ref_count; - /* Operation now in progress, if nonnull. */ - struct ofoperation *pending OVS_GUARDED_BY(ofproto_mutex); - /* A "flow cookie" is the OpenFlow name for a 64-bit value associated with * a flow.. */ ovs_be64 flow_cookie OVS_GUARDED; @@ -361,6 +353,14 @@ uint16_t hard_timeout OVS_GUARDED; /* In seconds from ->modified. */ uint16_t idle_timeout OVS_GUARDED; /* In seconds from ->used. */ + /* Eviction precedence. */ + uint16_t importance OVS_GUARDED; + + /* Removal reason for sending flow removed message. + * Used only if 'flags' has OFPUTIL_FF_SEND_FLOW_REM set and if the + * value is not OVS_OFPRR_NONE. */ + uint8_t removed_reason; + /* Eviction groups (see comment on struct eviction_group for explanation) . * * 'eviction_group' is this rule's eviction group, or NULL if it is not in @@ -371,10 +371,10 @@ /* OpenFlow actions. See struct rule_actions for more thread-safety * notes. */ - OVSRCU_TYPE(const struct rule_actions *) actions; + const struct rule_actions * const actions; /* In owning meter's 'rules' list. An empty list if there is no meter. */ - struct list meter_list_node OVS_GUARDED_BY(ofproto_mutex); + struct ovs_list meter_list_node OVS_GUARDED_BY(ofproto_mutex); /* Flow monitors (e.g. for NXST_FLOW_MONITOR, related to struct ofmonitor). * @@ -387,7 +387,7 @@ /* Optimisation for flow expiry. In ofproto's 'expirable' list if this * rule is expirable, otherwise empty. */ - struct list expirable OVS_GUARDED_BY(ofproto_mutex); + struct ovs_list expirable OVS_GUARDED_BY(ofproto_mutex); /* Times. Last so that they are more likely close to the stats managed * by the provider. */ @@ -398,10 +398,12 @@ }; void ofproto_rule_ref(struct rule *); +bool ofproto_rule_try_ref(struct rule *); void ofproto_rule_unref(struct rule *); static inline const struct rule_actions * rule_get_actions(const struct rule *); static inline bool rule_is_table_miss(const struct rule *); +static inline bool rule_is_hidden(const struct rule *); /* A set of actions within a "struct rule". * @@ -409,22 +411,32 @@ * Thread-safety * ============= * - * A struct rule_actions may be accessed without a risk of being - * freed by code that holds a read-lock or write-lock on 'rule->mutex' (where - * 'rule' is the rule for which 'rule->actions == actions') or during the RCU - * active period. */ + * A struct rule_actions may be accessed without a risk of being freed by + * code that holds 'rule->mutex' (where 'rule' is the rule for which + * 'rule->actions == actions') or during the RCU active period. + * + * All members are immutable: they do not change during the rule's + * lifetime. */ struct rule_actions { - /* These members are immutable: they do not change during the struct's - * lifetime. */ + /* Flags. + * + * 'has_meter' is true if 'ofpacts' contains an OFPACT_METER action. + * + * 'has_learn_with_delete' is true if 'ofpacts' contains an OFPACT_LEARN + * action whose flags include NX_LEARN_F_DELETE_LEARNED. */ + bool has_meter; + bool has_learn_with_delete; + + /* Actions. */ uint32_t ofpacts_len; /* Size of 'ofpacts', in bytes. */ - uint32_t provider_meter_id; /* Datapath meter_id, or UINT32_MAX. */ struct ofpact ofpacts[]; /* Sequence of "struct ofpacts". */ }; BUILD_ASSERT_DECL(offsetof(struct rule_actions, ofpacts) % OFPACT_ALIGNTO == 0); -const struct rule_actions *rule_actions_create(const struct ofproto *, - const struct ofpact *, size_t); +const struct rule_actions *rule_actions_create(const struct ofpact *, size_t); void rule_actions_destroy(const struct rule_actions *); +bool ofproto_rule_has_out_port(const struct rule *, ofp_port_t port) + OVS_REQUIRES(ofproto_mutex); /* A set of rules to which an OpenFlow operation applies. */ struct rule_collection { @@ -454,6 +466,12 @@ * ofproto-dpif implementation. */ extern size_t n_handlers, n_revalidators; +/* Number of rx queues to be created for each dpdk interface. */ +extern size_t n_dpdk_rxqs; + +/* Cpu mask for pmd threads. */ +extern char *pmd_cpu_mask; + static inline struct rule *rule_from_cls_rule(const struct cls_rule *); void ofproto_rule_expire(struct rule *rule, uint8_t reason) @@ -464,43 +482,44 @@ uint16_t hard_timeout) OVS_EXCLUDED(ofproto_mutex); -void ofoperation_complete(struct ofoperation *, enum ofperr); - -bool ofoperation_has_out_port(const struct ofoperation *, ofp_port_t out_port) - OVS_REQUIRES(ofproto_mutex); - /* A group within a "struct ofproto". * * With few exceptions, ofproto implementations may look at these fields but * should not modify them. */ struct ofgroup { - /* The rwlock is used to prevent groups from being deleted while child - * threads are using them to xlate flows. A read lock means the - * group is currently being used. A write lock means the group is - * in the process of being deleted or updated. Note that since - * a read lock on the groups container is held while searching, and - * a group is ever write locked only while holding a write lock - * on the container, the user's of groups will never face a group - * in the write locked state. */ - struct ovs_rwlock rwlock OVS_ACQ_AFTER(ofproto_mutex); - struct hmap_node hmap_node; /* In struct ofproto's "groups" hmap. */ - struct ofproto *ofproto; /* The ofproto that contains this group. */ - uint32_t group_id; - enum ofp11_group_type type; /* One of OFPGT_*. */ + struct hmap_node hmap_node OVS_GUARDED; /* In ofproto's "groups" hmap. */ + + /* Number of references. + * + * This is needed to keep track of references to the group in the xlate + * module. + * + * If the main thread removes the group from an ofproto, we need to + * guarantee that the group remains accessible to users of + * xlate_group_actions and the xlate_cache, as the xlate_cache will not be + * cleaned up until the corresponding datapath flows are revalidated. */ + struct ovs_refcount ref_count; + + /* No lock is needed to protect the fields below since they are not + * modified after construction. */ + const struct ofproto *ofproto; /* The ofproto that contains this group. */ + const uint32_t group_id; + const enum ofp11_group_type type; /* One of OFPGT_*. */ - long long int created; /* Creation time. */ - long long int modified; /* Time of last modification. */ + const long long int created; /* Creation time. */ + const long long int modified; /* Time of last modification. */ - struct list buckets; /* Contains "struct ofputil_bucket"s. */ - uint32_t n_buckets; + struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */ + const uint32_t n_buckets; + + const struct ofputil_group_props props; }; bool ofproto_group_lookup(const struct ofproto *ofproto, uint32_t group_id, - struct ofgroup **group) - OVS_TRY_RDLOCK(true, (*group)->rwlock); + struct ofgroup **group); -void ofproto_group_release(struct ofgroup *group) - OVS_RELEASES(group->rwlock); +void ofproto_group_ref(struct ofgroup *); +void ofproto_group_unref(struct ofgroup *); /* ofproto class structure, to be defined by each ofproto implementation. * @@ -624,9 +643,10 @@ * may choose to remove it all. */ void (*init)(const struct shash *iface_hints); - /* Enumerates the types of all support ofproto types into 'types'. The - * caller has already initialized 'types' and other ofproto classes might - * already have added names to it. */ + /* Enumerates the types of all supported ofproto types into 'types'. The + * caller has already initialized 'types'. The implementation should add + * its own types to 'types' but not remove any existing ones, because other + * ofproto classes might already have added names to it. */ void (*enumerate_types)(struct sset *types); /* Enumerates the names of all existing datapath of the specified 'type' @@ -721,18 +741,8 @@ * Destruction * =========== * - * If 'ofproto' has any pending asynchronous operations, ->destruct() - * must complete all of them by calling ofoperation_complete(). - * * ->destruct() must also destroy all remaining rules in the ofproto's - * tables, by passing each remaining rule to ofproto_rule_delete(), and - * then complete each of those deletions in turn by calling - * ofoperation_complete(). - * - * (Thus, there is a multi-step process for any rule currently being - * inserted or modified at the beginning of destruction: first - * ofoperation_complete() that operation, then ofproto_rule_delete() the - * rule, then ofoperation_complete() the deletion operation.) + * tables, by passing each remaining rule to ofproto_rule_delete(). * * The client will destroy the flow tables themselves after ->destruct() * returns. @@ -751,9 +761,6 @@ * - Call ofproto_rule_expire() for each OpenFlow flow that has reached * its hard_timeout or idle_timeout, to expire the flow. * - * (But rules that are part of a pending operation, e.g. rules for - * which ->pending is true, may not expire.) - * * Returns 0 if successful, otherwise a positive errno value. */ int (*run)(struct ofproto *ofproto); @@ -785,82 +792,63 @@ * than to do it one by one. */ void (*flush)(struct ofproto *ofproto); - /* Helper for the OpenFlow OFPT_FEATURES_REQUEST request. - * - * The implementation should store true in '*arp_match_ip' if the switch - * supports matching IP addresses inside ARP requests and replies, false - * otherwise. - * - * The implementation should store in '*actions' a bitmap of the supported - * OpenFlow actions. Vendor actions are not included in '*actions'. */ - void (*get_features)(struct ofproto *ofproto, - bool *arp_match_ip, - enum ofputil_action_bitmap *actions); - - /* Helper for the OpenFlow OFPST_TABLE statistics request. + /* Helper for the OpenFlow OFPT_TABLE_FEATURES request. * - * The 'ots' array contains 'ofproto->n_tables' elements. Each element is - * initialized as: + * The 'features' array contains 'ofproto->n_tables' elements. Each + * element is initialized as: * * - 'table_id' to the array index. * * - 'name' to "table#" where # is the table ID. * - * - 'match' and 'wildcards' to OFPXMT12_MASK. - * - * - 'write_actions' and 'apply_actions' to OFPAT12_OUTPUT. - * - * - 'write_setfields' and 'apply_setfields' to OFPXMT12_MASK. - * * - 'metadata_match' and 'metadata_write' to OVS_BE64_MAX. * - * - 'instructions' to OFPIT11_ALL. - * - * - 'config' to OFPTC11_TABLE_MISS_MASK. + * - 'config' to the table miss configuration. * * - 'max_entries' to 1,000,000. * - * - 'active_count' to the classifier_count() for the table. + * - Both 'nonmiss' and 'miss' to: * - * - 'lookup_count' and 'matched_count' to 0. + * * 'next' to all 1-bits for all later tables. * - * The implementation should update any members in each element for which - * it has better values: + * * 'instructions' to all instructions. + * + * * 'write' and 'apply' both to: * - * - 'name' to a more meaningful name. + * - 'ofpacts': All actions. * - * - 'wildcards' to the set of wildcards actually supported by the table - * (if it doesn't support all OpenFlow wildcards). + * - 'set_fields': All fields. * - * - 'instructions' to set the instructions actually supported by - * the table. + * - 'match', 'mask', and 'wildcard' to all fields. * - * - 'write_actions' to set the write actions actually supported by - * the table (if it doesn't support all OpenFlow actions). + * If 'stats' is nonnull, it also contains 'ofproto->n_tables' elements. + * Each element is initialized as: * - * - 'apply_actions' to set the apply actions actually supported by - * the table (if it doesn't support all OpenFlow actions). + * - 'table_id' to the array index. * - * - 'write_setfields' to set the write setfields actually supported by - * the table. + * - 'active_count' to the 'n_flows' of struct ofproto for the table. + * + * - 'lookup_count' and 'matched_count' to 0. * - * - 'apply_setfields' to set the apply setfields actually supported by - * the table. + * The implementation should update any members in each element for which + * it has better values: * - * - 'max_entries' to the maximum number of flows actually supported by - * the hardware. + * - Any member of 'features' to better describe the implementation's + * capabilities. * * - 'lookup_count' to the number of packets looked up in this flow table * so far. * * - 'matched_count' to the number of packets looked up in this flow * table so far that matched one of the flow entries. - * - * All of the members of struct ofp12_table_stats are in network byte - * order. */ - void (*get_tables)(struct ofproto *ofproto, struct ofp12_table_stats *ots); - + void (*query_tables)(struct ofproto *ofproto, + struct ofputil_table_features *features, + struct ofputil_table_stats *stats); + + /* Sets the current tables version the provider should use for classifier + * lookups. */ + void (*set_tables_version)(struct ofproto *ofproto, cls_version_t version); /* ## ---------------- ## */ /* ## ofport Functions ## */ /* ## ---------------- ## */ @@ -1063,9 +1051,18 @@ * problem), or -1 if LACP is not enabled on 'port'. * * This function may be a null pointer if the ofproto implementation does - * not support LACP. */ + * not support LACP. + */ int (*port_is_lacp_current)(const struct ofport *port); + /* Get LACP port stats. Returns -1 if LACP is not enabled on 'port'. + * + * This function may be a null pointer if the ofproto implementation does + * not support LACP. + */ + int (*port_get_lacp_stats)(const struct ofport *port, + struct lacp_slave_stats *stats); + /* ## ----------------------- ## */ /* ## OpenFlow Rule Functions ## */ /* ## ----------------------- ## */ @@ -1098,8 +1095,8 @@ * cycle described above under "Life Cycle". * * After a rule is successfully constructed, it is then inserted. If - * insertion completes successfully, then before it is later destructed, it - * is deleted. + * insertion is successful, then before it is later destructed, it is + * deleted. * * You can think of a rule as having the following extra steps inserted * between "Life Cycle" steps 4 and 5: @@ -1107,9 +1104,10 @@ * 4.1. The client inserts the rule into the flow table, making it * visible in flow table lookups. * - * 4.2. The client calls "rule_insert". Immediately or eventually, the - * implementation calls ofoperation_complete() to indicate that the - * insertion completed. If the operation failed, skip to step 5. + * 4.2. The client calls "rule_insert" to insert the flow. The + * implementation attempts to install the flow in the underlying + * hardware and returns an error code indicate success or failure. + * On failure, go to step 5. * * 4.3. The rule is now installed in the flow table. Eventually it will * be deleted. @@ -1117,67 +1115,9 @@ * 4.4. The client removes the rule from the flow table. It is no longer * visible in flow table lookups. * - * 4.5. The client calls "rule_delete". Immediately or eventually, the - * implementation calls ofoperation_complete() to indicate that the - * deletion completed. Deletion is not allowed to fail, so it must - * be successful. - * - * - * Asynchronous Operation Support - * ============================== - * - * The "insert" and "delete" life-cycle operations on rules can operate - * asynchronously, meaning that ->rule_insert() and ->rule_delete() only - * need to initiate their respective operations and do not need to wait for - * them to complete before they return. ->rule_modify_actions() also - * operates asynchronously. - * - * An ofproto implementation reports the success or failure of an - * asynchronous operation on a rule using the rule's 'pending' member, - * which points to a opaque "struct ofoperation" that represents the - * ongoing operation. When the operation completes, the ofproto - * implementation calls ofoperation_complete(), passing the ofoperation and - * an error indication. - * - * Only the following contexts may call ofoperation_complete(): - * - * - The function called to initiate the operation, e.g. ->rule_insert() - * or ->rule_delete(). This is the best choice if the operation - * completes quickly. - * - * - The implementation's ->run() function. - * - * - The implementation's ->destruct() function. - * - * The ofproto base code updates the flow table optimistically, assuming - * that the operation will probably succeed: - * - * - ofproto adds the rule in the flow table before calling - * ->rule_insert(). - * - * - ofproto updates the rule's actions and other properties before - * calling ->rule_modify_actions(). - * - * - ofproto removes the rule before calling ->rule_delete(). - * - * With one exception, when an asynchronous operation completes with an - * error, ofoperation_complete() backs out the already applied changes: - * - * - If adding a rule in the flow table fails, ofproto removes the new - * rule. - * - * - If modifying a rule fails, ofproto restores the original actions - * (and other properties). - * - * - Removing a rule is not allowed to fail. It must always succeed. - * - * The ofproto base code serializes operations: if any operation is in - * progress on a given rule, ofproto postpones initiating any new operation - * on that rule until the pending operation completes. Therefore, every - * operation must eventually complete through a call to - * ofoperation_complete() to avoid delaying new operations indefinitely - * (including any OpenFlow request that affects the rule in question, even - * just to query its statistics). + * 4.5. The client calls "rule_delete". The implementation uninstalls + * the flow from the underlying hardware. Deletion is not allowed + * to fail. * * * Construction @@ -1193,7 +1133,7 @@ * OpenFlow error code), the ofproto base code will uninitialize and * deallocate 'rule'. See "Rule Life Cycle" above for more details. * - * ->rule_construct() may also: + * ->rule_construct() must also: * * - Validate that the datapath supports the matching rule in 'rule->cr' * datapath. For example, if the rule's table does not support @@ -1202,8 +1142,9 @@ * * - Validate that the datapath can correctly implement 'rule->ofpacts'. * - * Some implementations might need to defer these tasks to ->rule_insert(), - * which is also acceptable. + * After a successful construction the rest of the rule life cycle calls + * may not fail, so ->rule_construct() must also make sure that the rule + * can be inserted in to the datapath. * * * Insertion @@ -1211,35 +1152,19 @@ * * Following successful construction, the ofproto base case inserts 'rule' * into its flow table, then it calls ->rule_insert(). ->rule_insert() - * should set in motion adding the new rule to the datapath flow table. It - * must act as follows: - * - * - If it completes insertion, either by succeeding or failing, it must - * call ofoperation_complete() - * - * - If insertion is only partially complete, then it must return without - * calling ofoperation_complete(). Later, when the insertion is - * complete, the ->run() or ->destruct() function must call - * ofoperation_complete() to report success or failure. - * - * If ->rule_insert() fails, the ofproto base code will remove 'rule' from - * the flow table, destruct, uninitialize, and deallocate 'rule'. See - * "Rule Life Cycle" above for more details. + * must add the new rule to the datapath flow table and return only after + * this is complete. The 'new_rule' may be a duplicate of an 'old_rule'. + * In this case the 'old_rule' is non-null, and the implementation should + * forward rule statistics from the 'old_rule' to the 'new_rule' if + * 'forward_stats' is 'true'. This may not fail. * * * Deletion * ======== * * The ofproto base code removes 'rule' from its flow table before it calls - * ->rule_delete(). ->rule_delete() should set in motion removing 'rule' - * from the datapath flow table. It must act as follows: - * - * - If it completes deletion, it must call ofoperation_complete(). - * - * - If deletion is only partially complete, then it must return without - * calling ofoperation_complete(). Later, when the deletion is - * complete, the ->run() or ->destruct() function must call - * ofoperation_complete(). + * ->rule_delete(). ->rule_delete() must remove 'rule' from the datapath + * flow table and return only after this has completed successfully. * * Rule deletion must not fail. * @@ -1253,7 +1178,9 @@ struct rule *(*rule_alloc)(void); enum ofperr (*rule_construct)(struct rule *rule) /* OVS_REQUIRES(ofproto_mutex) */; - void (*rule_insert)(struct rule *rule) /* OVS_REQUIRES(ofproto_mutex) */; + void (*rule_insert)(struct rule *rule, struct rule *old_rule, + bool forward_stats) + /* OVS_REQUIRES(ofproto_mutex) */; void (*rule_delete)(struct rule *rule) /* OVS_REQUIRES(ofproto_mutex) */; void (*rule_destruct)(struct rule *rule); void (*rule_dealloc)(struct rule *rule); @@ -1283,35 +1210,7 @@ * * Returns 0 if successful, otherwise an OpenFlow error code. */ enum ofperr (*rule_execute)(struct rule *rule, const struct flow *flow, - struct ofpbuf *packet); - - /* When ->rule_modify_actions() is called, the caller has already replaced - * the OpenFlow actions in 'rule' by a new set. (The original actions are - * in rule->pending->actions.) - * - * ->rule_modify_actions() should set the following in motion: - * - * - Validate that the datapath can correctly implement the actions now - * in 'rule'. - * - * - Update the datapath flow table with the new actions. - * - * - Only if 'reset_counters' is true, reset any packet or byte counters - * associated with the rule to zero, so that rule_get_stats() will not - * longer count those packets or bytes. - * - * If the operation synchronously completes, ->rule_modify_actions() may - * call ofoperation_complete() before it returns. Otherwise, ->run() - * should call ofoperation_complete() later, after the operation does - * complete. - * - * If the operation fails, then the base ofproto code will restore the - * original 'actions' and 'n_actions' of 'rule'. - * - * ->rule_modify_actions() should not modify any base members of struct - * rule. */ - void (*rule_modify_actions)(struct rule *rule, bool reset_counters) - /* OVS_REQUIRES(ofproto_mutex) */; + struct dp_packet *packet); /* Changes the OpenFlow IP fragment handling policy to 'frag_handling', * which takes one of the following values, with the corresponding @@ -1382,7 +1281,7 @@ * statistics should not be included in OpenFlow flow statistics. * * Returns 0 if successful, otherwise an OpenFlow error code. */ - enum ofperr (*packet_out)(struct ofproto *ofproto, struct ofpbuf *packet, + enum ofperr (*packet_out)(struct ofproto *ofproto, struct dp_packet *packet, const struct flow *flow, const struct ofpact *ofpacts, size_t ofpacts_len); @@ -1435,22 +1334,90 @@ * support CFM, as does a null pointer. */ int (*set_cfm)(struct ofport *ofport, const struct cfm_settings *s); - /* Checks the status of CFM configured on 'ofport' and stores port's CFM - * status in '*status'. If 'force' is set to true, status will be returned - * even if there is no status change since last update. - * - * Returns 0 on success. Returns a negative number if there is no status - * change since last update and 'force' is set to false. Returns positive - * errno otherwise. - * - * EOPNOTSUPP as a return value indicates that this ofproto_class does not - * support CFM, as does a null pointer. + /* Checks the status change of CFM on 'ofport'. Returns true if + * there is status change since last call or if CFM is not specified. */ + bool (*cfm_status_changed)(struct ofport *ofport); + + /* Populates 'smap' with the status of CFM on 'ofport'. Returns 0 on + * success, or a positive errno. EOPNOTSUPP as a return value indicates + * that this ofproto_class does not support CFM, as does a null pointer. * * The caller must provide and own '*status', and it must free the array * returned in 'status->rmps'. '*status' is indeterminate if the return * value is non-zero. */ - int (*get_cfm_status)(const struct ofport *ofport, bool force, - struct ofproto_cfm_status *status); + int (*get_cfm_status)(const struct ofport *ofport, + struct cfm_status *status); + + /* Configures LLDP on 'ofport'. + * + * EOPNOTSUPP as a return value indicates that this ofproto_class does not + * support LLDP, as does a null pointer. */ + int (*set_lldp)(struct ofport *ofport, const struct smap *cfg); + + /* Checks the status of LLDP configured on 'ofport'. Returns true if the + * port's LLDP status was successfully stored into '*status'. Returns + * false if the port did not have LLDP configured, in which case '*status' + * is indeterminate. + * + * The caller must provide and own '*status'. '*status' is indeterminate + * if the return value is non-zero. */ + bool (*get_lldp_status)(const struct ofport *ofport, + struct lldp_status *status); + + /* Configures Auto Attach. + * + * If 's' is nonnull, configures Auto Attach according to its members. + * + * If 's' is null, removes any Auto Attach configuration. + */ + int (*set_aa)(struct ofproto *ofproto, + const struct aa_settings *s); + + /* If 's' is nonnull, this function registers a mapping associated with + * client data pointer 'aux' in 'ofproto'. If 'aux' is already registered + * then this function updates its configuration to 's'. Otherwise, this + * function registers a new mapping. + * + * An implementation that does not support mapping at all may set + * it to NULL or return EOPNOTSUPP. An implementation that supports + * only a subset of the functionality should implement what it can + * and return 0. + */ + int (*aa_mapping_set)(struct ofproto *ofproto, void *aux, + const struct aa_mapping_settings *s); + + /* If 's' is nonnull, this function unregisters a mapping associated with + * client data pointer 'aux' in 'ofproto'. If 'aux' is already registered + * then this function updates its configuration to 's'. Otherwise, this + * function unregisters a new mapping. + * + * An implementation that does not support mapping at all may set + * it to NULL or return EOPNOTSUPP. An implementation that supports + * only a subset of the functionality should implement what it can + * and return 0. + */ + int (*aa_mapping_unset)(struct ofproto *ofproto, void *aux); + + /* + * Returns the a list of AutoAttach VLAN operations. When Auto Attach is + * enabled, the VLAN associated with an I-SID/VLAN mapping is first + * negotiated with an Auto Attach Server. Once an I-SID VLAN mapping + * becomes active, the corresponding VLAN needs to be communicated to the + * bridge in order to add the VLAN to the trunk port linking the Auto + * Attach Client (in this case openvswitch) and the Auto Attach Server. + * + * The list entries are of type "struct bridge_aa_vlan". Each entry + * specifies the operation (add or remove), the interface on which to + * execute the operation and the VLAN. + */ + int (*aa_vlan_get_queued)(struct ofproto *ofproto, struct ovs_list *list); + + /* + * Returns the current number of entries in the list of VLAN operations + * in the Auto Attach Client (see previous function description + * aa_vlan_get_queued). Returns 0 if Auto Attach is disabled. + */ + unsigned int (*aa_vlan_get_queue_size)(struct ofproto *ofproto); /* Configures BFD on 'ofport'. * @@ -1462,17 +1429,14 @@ * support BFD, as does a null pointer. */ int (*set_bfd)(struct ofport *ofport, const struct smap *cfg); - /* Populates 'smap' with the status of BFD on 'ofport'. If 'force' is set - * to true, status will be returned even if there is no status change since - * last update. - * - * Returns 0 on success. Returns a negative number if there is no status - * change since last update and 'force' is set to false. Returns a positive - * errno otherwise. - * - * EOPNOTSUPP as a return value indicates that this ofproto_class does not - * support BFD, as does a null pointer. */ - int (*get_bfd_status)(struct ofport *ofport, bool force, struct smap *smap); + /* Checks the status change of BFD on 'ofport'. Returns true if there + * is status change since last call or if BFD is not specified. */ + bool (*bfd_status_changed)(struct ofport *ofport); + + /* Populates 'smap' with the status of BFD on 'ofport'. Returns 0 on + * success, or a positive errno. EOPNOTSUPP as a return value indicates + * that this ofproto_class does not support BFD, as does a null pointer. */ + int (*get_bfd_status)(struct ofport *ofport, struct smap *smap); /* Configures spanning tree protocol (STP) on 'ofproto' using the * settings defined in 's'. @@ -1531,6 +1495,53 @@ int (*get_stp_port_stats)(struct ofport *ofport, struct ofproto_port_stp_stats *s); + /* Configures Rapid Spanning Tree Protocol (RSTP) on 'ofproto' using the + * settings defined in 's'. + * + * If 's' is nonnull, configures RSTP according to its members. + * + * If 's' is null, removes any RSTP configuration from 'ofproto'. + * + * EOPNOTSUPP as a return value indicates that this ofproto_class does not + * support RSTP, as does a null pointer. */ + void (*set_rstp)(struct ofproto *ofproto, + const struct ofproto_rstp_settings *s); + + /* Retrieves state of Rapid Spanning Tree Protocol (RSTP) on 'ofproto'. + * + * Stores RSTP state for 'ofproto' in 's'. If the 'enabled' member + * is false, the other member values are not meaningful. + * + * EOPNOTSUPP as a return value indicates that this ofproto_class does not + * support RSTP, as does a null pointer. */ + void (*get_rstp_status)(struct ofproto *ofproto, + struct ofproto_rstp_status *s); + + /* Configures Rapid Spanning Tree Protocol (RSTP) on 'ofport' using the + * settings defined in 's'. + * + * If 's' is nonnull, configures RSTP according to its members. The + * caller is responsible for assigning RSTP port numbers (using the + * 'port_num' member in the range of 1 through 255, inclusive) and + * ensuring there are no duplicates. + * + * If 's' is null, removes any RSTP configuration from 'ofport'. + * + * EOPNOTSUPP as a return value indicates that this ofproto_class does not + * support STP, as does a null pointer. */ + void (*set_rstp_port)(struct ofport *ofport, + const struct ofproto_port_rstp_settings *s); + + /* Retrieves Rapid Spanning Tree Protocol (RSTP) port status of 'ofport'. + * + * Stores RSTP state for 'ofport' in 's'. If the 'enabled' member is + * false, the other member values are not meaningful. + * + * EOPNOTSUPP as a return value indicates that this ofproto_class does not + * support RSTP, as does a null pointer. */ + void (*get_rstp_port_status)(struct ofport *ofport, + struct ofproto_port_rstp_status *s); + /* Registers meta-data associated with the 'n_qdscp' Qualities of Service * 'queues' attached to 'ofport'. This data is not intended to be * sufficient to implement QoS. Instead, providers may use this @@ -1621,6 +1632,32 @@ void (*set_mac_table_config)(struct ofproto *ofproto, unsigned int idle_time, size_t max_entries); + /* Configures multicast snooping on 'ofport' using the settings + * defined in 's'. + * + * If 's' is nonnull, this function updates multicast snooping + * configuration to 's' in 'ofproto'. + * + * If 's' is NULL, this function disables multicast snooping + * on 'ofproto'. + * + * An implementation that does not support multicast snooping may set + * it to NULL or return EOPNOTSUPP. */ + int (*set_mcast_snooping)(struct ofproto *ofproto, + const struct ofproto_mcast_snooping_settings *s); + + /* Configures multicast snooping port's flood setting on 'ofproto'. + * + * If 's' is nonnull, this function updates multicast snooping + * configuration to 's' in 'ofproto'. + * + * If 's' is NULL, this function doesn't change anything. + * + * An implementation that does not support multicast snooping may set + * it to NULL or return EOPNOTSUPP. */ + int (*set_mcast_snooping_port)(struct ofproto *ofproto_, void *aux, + const struct ofproto_mcast_snooping_port_settings *s); + /* Linux VLAN device support (e.g. "eth0.10" for VLAN 10.) * * This is deprecated. It is only for compatibility with broken device drivers @@ -1691,10 +1728,23 @@ void (*group_destruct)(struct ofgroup *); void (*group_dealloc)(struct ofgroup *); - enum ofperr (*group_modify)(struct ofgroup *, struct ofgroup *victim); + enum ofperr (*group_modify)(struct ofgroup *); enum ofperr (*group_get_stats)(const struct ofgroup *, struct ofputil_group_stats *); + +/* ## --------------------- ## */ +/* ## Datapath information ## */ +/* ## --------------------- ## */ + /* Retrieve the version string of the datapath. The version + * string can be NULL if it can not be determined. + * + * The version retuned is read only. The caller should not + * free it. + * + * This function should be NULL if an implementation does not support it. + */ + const char *(*get_datapath_version)(const struct ofproto *); }; extern const struct ofproto_class ofproto_dpif_class; @@ -1702,26 +1752,12 @@ int ofproto_class_register(const struct ofproto_class *); int ofproto_class_unregister(const struct ofproto_class *); -/* ofproto_flow_mod() returns this value if the flow_mod could not be processed - * because it overlaps with an ongoing flow table operation that has not yet - * completed. The caller should retry the operation later. - * - * ofproto.c also uses this value internally for additional (similar) purposes. - * - * This particular value is a good choice because it is large, so that it does - * not collide with any errno value, but not large enough to collide with an - * OFPERR_* value. */ -enum { OFPROTO_POSTPONE = 1 << 16 }; -BUILD_ASSERT_DECL(OFPROTO_POSTPONE < OFPERR_OFS); - -int ofproto_flow_mod(struct ofproto *, struct ofputil_flow_mod *) +enum ofperr ofproto_flow_mod(struct ofproto *, struct ofputil_flow_mod *) OVS_EXCLUDED(ofproto_mutex); -void ofproto_add_flow(struct ofproto *, const struct match *, - unsigned int priority, +void ofproto_add_flow(struct ofproto *, const struct match *, int priority, const struct ofpact *ofpacts, size_t ofpacts_len) OVS_EXCLUDED(ofproto_mutex); -bool ofproto_delete_flow(struct ofproto *, - const struct match *, unsigned int priority) +void ofproto_delete_flow(struct ofproto *, const struct match *, int priority) OVS_EXCLUDED(ofproto_mutex); void ofproto_flush_flows(struct ofproto *); @@ -1729,7 +1765,7 @@ static inline const struct rule_actions * rule_get_actions(const struct rule *rule) { - return ovsrcu_get(const struct rule_actions *, &rule->actions); + return rule->actions; } /* Returns true if 'rule' is an OpenFlow 1.3 "table-miss" rule, false @@ -1744,6 +1780,17 @@ return rule->cr.priority == 0 && cls_rule_is_catchall(&rule->cr); } +/* Returns true if 'rule' should be hidden from the controller. + * + * Rules with priority higher than UINT16_MAX are set up by ofproto itself + * (e.g. by in-band control) and are intentionally hidden from the + * controller. */ +static inline bool +rule_is_hidden(const struct rule *rule) +{ + return rule->cr.priority > UINT16_MAX; +} + static inline struct rule * rule_from_cls_rule(const struct cls_rule *cls_rule) { diff -Nru openvswitch-2.3.1/ofproto/ofproto-tnl-unixctl.man openvswitch-2.4.0~git20150623/ofproto/ofproto-tnl-unixctl.man --- openvswitch-2.3.1/ofproto/ofproto-tnl-unixctl.man 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/ofproto-tnl-unixctl.man 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,27 @@ +.SS "OPENVSWITCH TUNNELING COMMANDS" +These commands query and modify OVS tunnel components. Ref to +README-native-tunneling.md for more info. +. +.IP "\fBovs/route/add ipv4_address/plen output_bridge [GW]\fR" +Adds ipv4_address/plen route to vswitchd routing table. output_bridge +needs to be OVS bridge name. This command is useful if OVS cached +routes does not look right. +. +.IP "\fBovs/route/show\fR" +Print all routes in OVS routing table, This includes routes cached +from system routing table and user configured routes. +. +.IP "\fBovs/route/del ipv4_address/plen\fR" +Delete ipv4_address/plen route from OVS routing table. +. +.IP "\fBtnl/arp/show\fR" +OVS builds ARP cache by snooping are messages. This command shows +ARP cache table. +. +.IP "\fBtnl/arp/flush\fR" +Flush ARP table. +. +.IP "\fBtnl/egress_port_range [num1] [num2]\fR" +Set range for UDP source port used for UDP based Tunnels. For +example VxLAN. If case of zero arguments this command prints +current range in use. diff -Nru openvswitch-2.3.1/ofproto/pinsched.c openvswitch-2.4.0~git20150623/ofproto/pinsched.c --- openvswitch-2.3.1/ofproto/pinsched.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/pinsched.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,13 +31,13 @@ #include "rconn.h" #include "sat-math.h" #include "timeval.h" -#include "token-bucket.h" -#include "vconn.h" +#include "openvswitch/token-bucket.h" +#include "openvswitch/vconn.h" struct pinqueue { struct hmap_node node; /* In struct pinsched's 'queues' hmap. */ - ofp_port_t port_no; /* Port number. */ - struct list packets; /* Contains "struct ofpbuf"s. */ + ofp_port_t port_no; /* Port number. */ + struct ovs_list packets; /* Contains "struct ofpbuf"s. */ int n; /* Number of packets in 'packets'. */ }; @@ -46,12 +46,9 @@ /* One queue per physical port. */ struct hmap queues; /* Contains "struct pinqueue"s. */ - int n_queued; /* Sum over queues[*].n. */ + unsigned int n_queued; /* Sum over queues[*].n. */ struct pinqueue *next_txq; /* Next pinqueue check in round-robin. */ - /* Transmission queue. */ - int n_txq; /* No. of packets waiting in rconn for tx. */ - /* Statistics reporting. */ unsigned long long n_normal; /* # txed w/o rate limit queuing. */ unsigned long long n_limited; /* # queued for rate limiting. */ @@ -186,7 +183,7 @@ void pinsched_send(struct pinsched *ps, ofp_port_t port_no, - struct ofpbuf *packet, struct list *txq) + struct ofpbuf *packet, struct ovs_list *txq) { list_init(txq); if (!ps) { @@ -218,7 +215,7 @@ } void -pinsched_run(struct pinsched *ps, struct list *txq) +pinsched_run(struct pinsched *ps, struct ovs_list *txq) { list_init(txq); if (ps) { @@ -256,7 +253,6 @@ hmap_init(&ps->queues); ps->n_queued = 0; ps->next_txq = NULL; - ps->n_txq = 0; ps->n_normal = 0; ps->n_limited = 0; ps->n_queue_dropped = 0; @@ -299,10 +295,17 @@ } } -/* Returns the number of packets scheduled to be sent eventually by 'ps'. - * Returns 0 if 'ps' is null. */ -unsigned int -pinsched_count_txqlen(const struct pinsched *ps) +/* Retrieves statistics for 'ps'. The statistics will be all zero if 'ps' is + * null. */ +void +pinsched_get_stats(const struct pinsched *ps, struct pinsched_stats *stats) { - return ps ? ps->n_txq : 0; + if (ps) { + stats->n_queued = ps->n_queued; + stats->n_normal = ps->n_normal; + stats->n_limited = ps->n_limited; + stats->n_queue_dropped = ps->n_queue_dropped; + } else { + memset(stats, 0, sizeof *stats); + } } diff -Nru openvswitch-2.3.1/ofproto/pinsched.h openvswitch-2.4.0~git20150623/ofproto/pinsched.h --- openvswitch-2.3.1/ofproto/pinsched.h 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/pinsched.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include #include "flow.h" -struct list; +struct ovs_list; struct ofpbuf; struct pinsched *pinsched_create(int rate_limit, int burst_limit); @@ -29,10 +29,17 @@ void pinsched_set_limits(struct pinsched *, int rate_limit, int burst_limit); void pinsched_destroy(struct pinsched *); void pinsched_send(struct pinsched *, ofp_port_t port_no, struct ofpbuf *, - struct list *txq); -void pinsched_run(struct pinsched *, struct list *txq); + struct ovs_list *txq); +void pinsched_run(struct pinsched *, struct ovs_list *txq); void pinsched_wait(struct pinsched *); -unsigned int pinsched_count_txqlen(const struct pinsched *); +struct pinsched_stats { + unsigned int n_queued; /* # currently queued to send. */ + unsigned long long n_normal; /* # txed w/o rate limit queuing. */ + unsigned long long n_limited; /* # queued for rate limiting. */ + unsigned long long n_queue_dropped; /* # dropped due to queue overflow. */ +}; + +void pinsched_get_stats(const struct pinsched *, struct pinsched_stats *); #endif /* pinsched.h */ diff -Nru openvswitch-2.3.1/ofproto/pktbuf.c openvswitch-2.4.0~git20150623/ofproto/pktbuf.c --- openvswitch-2.3.1/ofproto/pktbuf.c 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/pktbuf.c 2015-06-23 18:46:21.000000000 +0000 @@ -20,11 +20,11 @@ #include #include "coverage.h" #include "ofp-util.h" -#include "ofpbuf.h" +#include "dp-packet.h" #include "timeval.h" #include "util.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(pktbuf); @@ -48,7 +48,7 @@ #define OVERWRITE_MSECS 5000 struct packet { - struct ofpbuf *buffer; + struct dp_packet *buffer; uint32_t cookie; long long int timeout; ofp_port_t in_port; @@ -79,7 +79,7 @@ size_t i; for (i = 0; i < PKTBUF_CNT; i++) { - ofpbuf_delete(pb->packets[i].buffer); + dp_packet_delete(pb->packets[i].buffer); } free(pb); } @@ -112,7 +112,7 @@ if (time_msec() < p->timeout) { return UINT32_MAX; } - ofpbuf_delete(p->buffer); + dp_packet_delete(p->buffer); } /* Don't use maximum cookie value since all-1-bits ID is special. */ @@ -121,7 +121,7 @@ } /* Use 2 bytes of headroom to 32-bit align the L3 header. */ - p->buffer = ofpbuf_clone_data_with_headroom(buffer, buffer_size, 2); + p->buffer = dp_packet_clone_data_with_headroom(buffer, buffer_size, 2); p->timeout = time_msec() + OVERWRITE_MSECS; p->in_port = in_port; @@ -169,7 +169,7 @@ * * On failure, stores NULL in in '*bufferp' and UINT16_MAX in '*in_port'. */ enum ofperr -pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct ofpbuf **bufferp, +pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct dp_packet **bufferp, ofp_port_t *in_port) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 20); @@ -184,12 +184,13 @@ if (!pb) { VLOG_WARN_RL(&rl, "attempt to send buffered packet via connection " "without buffers"); - return OFPERR_OFPBRC_BUFFER_UNKNOWN; + error = OFPERR_OFPBRC_BUFFER_UNKNOWN; + goto error; } p = &pb->packets[id & PKTBUF_MASK]; if (p->cookie == id >> PKTBUF_BITS) { - struct ofpbuf *buffer = p->buffer; + struct dp_packet *buffer = p->buffer; if (buffer) { *bufferp = buffer; if (in_port) { @@ -227,7 +228,7 @@ { struct packet *p = &pb->packets[id & PKTBUF_MASK]; if (p->cookie == id >> PKTBUF_BITS) { - ofpbuf_delete(p->buffer); + dp_packet_delete(p->buffer); p->buffer = NULL; } } diff -Nru openvswitch-2.3.1/ofproto/pktbuf.h openvswitch-2.4.0~git20150623/ofproto/pktbuf.h --- openvswitch-2.3.1/ofproto/pktbuf.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/pktbuf.h 2015-06-23 18:46:21.000000000 +0000 @@ -23,7 +23,7 @@ #include "ofp-errors.h" struct pktbuf; -struct ofpbuf; +struct dp_packet; int pktbuf_capacity(void); @@ -33,7 +33,7 @@ ofp_port_t in_port); uint32_t pktbuf_get_null(void); enum ofperr pktbuf_retrieve(struct pktbuf *, uint32_t id, - struct ofpbuf **bufferp, ofp_port_t *in_port); + struct dp_packet **bufferp, ofp_port_t *in_port); void pktbuf_discard(struct pktbuf *, uint32_t id); unsigned int pktbuf_count_packets(const struct pktbuf *); diff -Nru openvswitch-2.3.1/ofproto/tunnel.c openvswitch-2.4.0~git20150623/ofproto/tunnel.c --- openvswitch-2.3.1/ofproto/tunnel.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/tunnel.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2014 Nicira, Inc. +/* Copyright (c) 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,17 +19,26 @@ #include "byte-order.h" #include "connectivity.h" +#include "csum.h" +#include "dpif.h" #include "dynamic-string.h" +#include "fat-rwlock.h" #include "hash.h" #include "hmap.h" #include "netdev.h" #include "odp-util.h" +#include "ofpbuf.h" #include "packets.h" +#include "route-table.h" #include "seq.h" #include "smap.h" #include "socket-util.h" +#include "tnl-arp-cache.h" +#include "tnl-ports.h" #include "tunnel.h" -#include "vlog.h" +#include "openvswitch/vlog.h" +#include "unaligned.h" +#include "ofproto-dpif.h" VLOG_DEFINE_THIS_MODULE(tunnel); @@ -52,13 +61,13 @@ struct hmap_node match_node; const struct ofport_dpif *ofport; - unsigned int change_seq; + uint64_t change_seq; struct netdev *netdev; struct tnl_match match; }; -static struct ovs_rwlock rwlock = OVS_RWLOCK_INITIALIZER; +static struct fat_rwlock rwlock; /* Tunnel matches. * @@ -122,9 +131,20 @@ OVS_REQ_RDLOCK(rwlock); static void tnl_port_del__(const struct ofport_dpif *) OVS_REQ_WRLOCK(rwlock); +void +ofproto_tunnel_init(void) +{ + static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; + + if (ovsthread_once_start(&once)) { + fat_rwlock_init(&rwlock); + ovsthread_once_done(&once); + } +} + static bool tnl_port_add__(const struct ofport_dpif *ofport, const struct netdev *netdev, - odp_port_t odp_port, bool warn) + odp_port_t odp_port, bool warn, bool native_tnl, const char name[]) OVS_REQ_WRLOCK(rwlock) { const struct netdev_tunnel_config *cfg; @@ -138,7 +158,7 @@ tnl_port = xzalloc(sizeof *tnl_port); tnl_port->ofport = ofport; tnl_port->netdev = netdev_ref(netdev); - tnl_port->change_seq = seq_read(connectivity_seq_get()); + tnl_port->change_seq = netdev_get_change_seq(tnl_port->netdev); tnl_port->match.in_key = cfg->in_key; tnl_port->match.ip_src = cfg->ip_src; @@ -173,19 +193,30 @@ } hmap_insert(*map, &tnl_port->match_node, tnl_hash(&tnl_port->match)); tnl_port_mod_log(tnl_port, "adding"); + + if (native_tnl) { + tnl_port_map_insert(odp_port, tnl_port->match.ip_dst, + cfg->dst_port, name); + } return true; } /* Adds 'ofport' to the module with datapath port number 'odp_port'. 'ofport's * must be added before they can be used by the module. 'ofport' must be a - * tunnel. */ -void + * tunnel. + * + * Returns 0 if successful, otherwise a positive errno value. */ +int tnl_port_add(const struct ofport_dpif *ofport, const struct netdev *netdev, - odp_port_t odp_port) OVS_EXCLUDED(rwlock) + odp_port_t odp_port, bool native_tnl, const char name[]) OVS_EXCLUDED(rwlock) { - ovs_rwlock_wrlock(&rwlock); - tnl_port_add__(ofport, netdev, odp_port, true); - ovs_rwlock_unlock(&rwlock); + bool ok; + + fat_rwlock_wrlock(&rwlock); + ok = tnl_port_add__(ofport, netdev, odp_port, true, native_tnl, name); + fat_rwlock_unlock(&rwlock); + + return ok ? 0 : EEXIST; } /* Checks if the tunnel represented by 'ofport' reconfiguration due to changes @@ -194,25 +225,26 @@ * tnl_port_add(). */ bool tnl_port_reconfigure(const struct ofport_dpif *ofport, - const struct netdev *netdev, odp_port_t odp_port) + const struct netdev *netdev, odp_port_t odp_port, + bool native_tnl, const char name[]) OVS_EXCLUDED(rwlock) { struct tnl_port *tnl_port; bool changed = false; - ovs_rwlock_wrlock(&rwlock); + fat_rwlock_wrlock(&rwlock); tnl_port = tnl_find_ofport(ofport); if (!tnl_port) { - changed = tnl_port_add__(ofport, netdev, odp_port, false); + changed = tnl_port_add__(ofport, netdev, odp_port, false, native_tnl, name); } else if (tnl_port->netdev != netdev || tnl_port->match.odp_port != odp_port - || tnl_port->change_seq != seq_read(connectivity_seq_get())) { + || tnl_port->change_seq != netdev_get_change_seq(tnl_port->netdev)) { VLOG_DBG("reconfiguring %s", tnl_port_get_name(tnl_port)); tnl_port_del__(ofport); - tnl_port_add__(ofport, netdev, odp_port, true); + tnl_port_add__(ofport, netdev, odp_port, true, native_tnl, name); changed = true; } - ovs_rwlock_unlock(&rwlock); + fat_rwlock_unlock(&rwlock); return changed; } @@ -227,8 +259,11 @@ tnl_port = tnl_find_ofport(ofport); if (tnl_port) { + const struct netdev_tunnel_config *cfg = + netdev_get_tunnel_config(tnl_port->netdev); struct hmap **map; + tnl_port_map_delete(tnl_port->match.ip_dst, cfg->dst_port); tnl_port_mod_log(tnl_port, "removing"); map = tnl_match_map(&tnl_port->match); hmap_remove(*map, &tnl_port->match_node); @@ -247,9 +282,9 @@ void tnl_port_del(const struct ofport_dpif *ofport) OVS_EXCLUDED(rwlock) { - ovs_rwlock_wrlock(&rwlock); + fat_rwlock_wrlock(&rwlock); tnl_port_del__(ofport); - ovs_rwlock_unlock(&rwlock); + fat_rwlock_unlock(&rwlock); } /* Looks in the table of tunnels for a tunnel matching the metadata in 'flow'. @@ -265,7 +300,7 @@ const struct ofport_dpif *ofport; struct tnl_port *tnl_port; - ovs_rwlock_rdlock(&rwlock); + fat_rwlock_rdlock(&rwlock); tnl_port = tnl_find(flow); ofport = tnl_port ? tnl_port->ofport : NULL; if (!tnl_port) { @@ -294,7 +329,7 @@ } out: - ovs_rwlock_unlock(&rwlock); + fat_rwlock_unlock(&rwlock); return ofport; } @@ -304,7 +339,9 @@ { if (is_ip_any(base_flow)) { if ((flow->tunnel.ip_tos & IP_ECN_MASK) == IP_ECN_CE) { - wc->masks.nw_tos |= IP_ECN_MASK; + if (wc) { + wc->masks.nw_tos |= IP_ECN_MASK; + } if ((base_flow->nw_tos & IP_ECN_MASK) == IP_ECN_NOT_ECT) { VLOG_WARN_RL(&rl, "dropping tunnel packet marked ECN CE" " but is not ECN capable"); @@ -333,17 +370,22 @@ * always unwildcard the 'in_port', we do not need to unwildcard * the 'tunnel.ip_dst' for non-tunneled packets. */ if (tnl_port_should_receive(flow)) { - wc->masks.tunnel.tun_id = OVS_BE64_MAX; - wc->masks.tunnel.ip_src = OVS_BE32_MAX; - wc->masks.tunnel.ip_dst = OVS_BE32_MAX; - wc->masks.tunnel.flags = (FLOW_TNL_F_DONT_FRAGMENT | - FLOW_TNL_F_CSUM | - FLOW_TNL_F_KEY); - wc->masks.tunnel.ip_tos = UINT8_MAX; - wc->masks.tunnel.ip_ttl = UINT8_MAX; - - memset(&wc->masks.pkt_mark, 0xff, sizeof wc->masks.pkt_mark); + if (wc) { + wc->masks.tunnel.tun_id = OVS_BE64_MAX; + wc->masks.tunnel.ip_src = OVS_BE32_MAX; + wc->masks.tunnel.ip_dst = OVS_BE32_MAX; + wc->masks.tunnel.flags = (FLOW_TNL_F_DONT_FRAGMENT | + FLOW_TNL_F_CSUM | + FLOW_TNL_F_KEY); + wc->masks.tunnel.ip_tos = UINT8_MAX; + wc->masks.tunnel.ip_ttl = UINT8_MAX; + /* The tp_src and tp_dst members in flow_tnl are set to be always + * wildcarded, not to unwildcard them here. */ + wc->masks.tunnel.tp_src = 0; + wc->masks.tunnel.tp_dst = 0; + memset(&wc->masks.pkt_mark, 0xff, sizeof wc->masks.pkt_mark); + } if (!tnl_ecn_ok(base_flow, flow, wc)) { return false; } @@ -367,7 +409,7 @@ char *pre_flow_str = NULL; odp_port_t out_port; - ovs_rwlock_rdlock(&rwlock); + fat_rwlock_rdlock(&rwlock); tnl_port = tnl_find_ofport(ofport); out_port = tnl_port ? tnl_port->match.odp_port : ODPP_NONE; if (!tnl_port) { @@ -401,7 +443,7 @@ } if (cfg->tos_inherit && is_ip_any(flow)) { - wc->masks.nw_tos = IP_DSCP_MASK; + wc->masks.nw_tos |= IP_DSCP_MASK; flow->tunnel.ip_tos = flow->nw_tos & IP_DSCP_MASK; } else { flow->tunnel.ip_tos = cfg->tos; @@ -436,7 +478,7 @@ } out: - ovs_rwlock_unlock(&rwlock); + fat_rwlock_unlock(&rwlock); return out_port; } @@ -635,3 +677,47 @@ { return netdev_get_name(tnl_port->netdev); } + +int +tnl_port_build_header(const struct ofport_dpif *ofport, + const struct flow *tnl_flow, + uint8_t dmac[ETH_ADDR_LEN], + uint8_t smac[ETH_ADDR_LEN], + ovs_be32 ip_src, struct ovs_action_push_tnl *data) +{ + struct tnl_port *tnl_port; + struct eth_header *eth; + struct ip_header *ip; + void *l3; + int res; + + fat_rwlock_rdlock(&rwlock); + tnl_port = tnl_find_ofport(ofport); + ovs_assert(tnl_port); + + /* Build Ethernet and IP headers. */ + memset(data->header, 0, sizeof data->header); + + eth = (struct eth_header *)data->header; + memcpy(eth->eth_dst, dmac, ETH_ADDR_LEN); + memcpy(eth->eth_src, smac, ETH_ADDR_LEN); + eth->eth_type = htons(ETH_TYPE_IP); + + l3 = (eth + 1); + ip = (struct ip_header *) l3; + + ip->ip_ihl_ver = IP_IHL_VER(5, 4); + ip->ip_tos = tnl_flow->tunnel.ip_tos; + ip->ip_ttl = tnl_flow->tunnel.ip_ttl; + ip->ip_frag_off = (tnl_flow->tunnel.flags & FLOW_TNL_F_DONT_FRAGMENT) ? + htons(IP_DF) : 0; + + put_16aligned_be32(&ip->ip_src, ip_src); + put_16aligned_be32(&ip->ip_dst, tnl_flow->tunnel.ip_dst); + + res = netdev_build_header(tnl_port->netdev, data, tnl_flow); + ip->ip_csum = csum(ip, sizeof *ip); + fat_rwlock_unlock(&rwlock); + + return res; +} diff -Nru openvswitch-2.3.1/ofproto/tunnel.h openvswitch-2.4.0~git20150623/ofproto/tunnel.h --- openvswitch-2.3.1/ofproto/tunnel.h 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ofproto/tunnel.h 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Nicira, Inc. +/* Copyright (c) 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,14 +25,16 @@ * These functions emulate tunnel virtual ports based on the outer * header information from the kernel. */ +struct ovs_action_push_tnl; struct ofport_dpif; struct netdev; +void ofproto_tunnel_init(void); bool tnl_port_reconfigure(const struct ofport_dpif *, const struct netdev *, - odp_port_t); + odp_port_t, bool native_tnl, const char name[]); -void tnl_port_add(const struct ofport_dpif *, const struct netdev *, - odp_port_t odp_port); +int tnl_port_add(const struct ofport_dpif *, const struct netdev *, + odp_port_t odp_port, bool native_tnl, const char name[]); void tnl_port_del(const struct ofport_dpif *); const struct ofport_dpif *tnl_port_receive(const struct flow *); @@ -48,4 +50,10 @@ return flow->tunnel.ip_dst != 0; } +int tnl_port_build_header(const struct ofport_dpif *ofport, + const struct flow *tnl_flow, + uint8_t dmac[ETH_ADDR_LEN], + uint8_t smac[ETH_ADDR_LEN], + ovs_be32 ip_src, struct ovs_action_push_tnl *data); + #endif /* tunnel.h */ diff -Nru openvswitch-2.3.1/OPENFLOW-1.1+ openvswitch-2.4.0~git20150623/OPENFLOW-1.1+ --- openvswitch-2.3.1/OPENFLOW-1.1+ 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/OPENFLOW-1.1+ 1970-01-01 00:00:00.000000000 +0000 @@ -1,247 +0,0 @@ - OpenFlow 1.1+ support in Open vSwitch - ===================================== - -Open vSwitch support for OpenFlow 1.1 and beyond is a work in -progress. This file describes the work still to be done. - -The Plan --------- - -OpenFlow version support is not a build-time option. A single build -of Open vSwitch must be able to handle all supported versions of -OpenFlow. Ideally, even at runtime it should be able to support all -protocol versions at the same time on different OpenFlow bridges (and -perhaps even on the same bridge). - -At the same time, it would be a shame to litter the core of the OVS -code with lots of ugly code concerned with the details of various -OpenFlow protocol versions. - -The primary approach to compatibility is to abstract most of the -details of the differences from the core code, by adding a protocol -layer that translates between OF1.x and a slightly higher-level -abstract representation. The core of this approach is the many struct -ofputil_* structures in lib/ofp-util.h. - -As a consequence of this approach, OVS cannot use OpenFlow protocol -definitions that closely resemble those in the OpenFlow specification, -because openflow.h in different versions of the OpenFlow specification -defines the same identifier with different values. Instead, -openflow-common.h contains definitions that are common to all the -specifications and separate protocol version-specific headers contain -protocol-specific definitions renamed so as not to conflict, -e.g. OFPAT10_ENQUEUE and OFPAT11_ENQUEUE for the OpenFlow 1.0 and 1.1 -values for OFPAT_ENQUEUE. Generally, in cases of conflict, the -protocol layer will define a more abstract OFPUTIL_* or struct -ofputil_*. - -Here are the current approaches in a few tricky areas: - - * Port numbering. OpenFlow 1.0 has 16-bit port numbers and later - OpenFlow versions have 32-bit port numbers. For now, OVS - support for later protocol versions requires all port numbers to - fall into the 16-bit range, translating the reserved OFPP_* port - numbers. - - * Actions. OpenFlow 1.0 and later versions have very different - ideas of actions. OVS reconciles by translating all the - versions' actions (and instructions) to and from a common - internal representation. - -OpenFlow 1.1 ------------- - -The list of remaining work items for OpenFlow 1.1 is below. It is -probably incomplete. - - * MPLS. Simon Horman maintains a patch series that adds this - feature. This is partially merged. - [optional for OF1.1+] - - * Match and set double-tagged VLANs (QinQ). This requires kernel - work for reasonable performance. - [optional for OF1.1+] - - * VLANs tagged with 88a8 Ethertype. This requires kernel work for - reasonable performance. - [required for OF1.1+] - -OpenFlow 1.2 ------------- - -OpenFlow 1.2 support requires OpenFlow 1.1 as a prerequisite. All the -additional work specific to Openflow 1.2 are complete. (This is based -on the change log at the end of the OF1.2 spec. I didn't compare the -specs carefully yet.) - -OpenFlow 1.3 ------------- - -OpenFlow 1.3 support requires OpenFlow 1.2 as a prerequisite, plus the -following additional work. (This is based on the change log at the -end of the OF1.3 spec, reusing most of the section titles directly. I -didn't compare the specs carefully yet.) - - * Add support for multipart requests. - Currently we always report OFPBRC_MULTIPART_BUFFER_OVERFLOW. - [optional for OF1.3+] - - * Add OFPMP_TABLE_FEATURES statistics. Alexander Wu has posted a - patch series. [optional for OF1.3+] - - * IPv6 extension header handling support. Fully implementing this - requires kernel support. This likely will take some careful and - probably time-consuming design work. The actual coding, once - that is all done, is probably 2 or 3 days work. - [optional for OF1.3+] - - * Per-flow meters. OpenFlow protocol support is now implemented. - Support for the special OFPM_SLOWPATH and OFPM_CONTROLLER meters - is missing. Support for the software switch is under review. - [optional for OF1.3+] - - * Auxiliary connections. An implementation in generic code might - be a week's worth of work. The value of an implementation in - generic code is questionable, though, since much of the benefit - of axuiliary connections is supposed to be to take advantage of - hardware support. (We could make the kernel module somehow - send packets across the auxiliary connections directly, for - some kind of "hardware" support, if we judged it useful enough.) - [optional for OF1.3+] - - * Provider Backbone Bridge tagging. I don't plan to implement - this (but we'd accept an implementation). - [optional for OF1.3+] - - * On-demand flow counters. I think this might be a real - optimization in some cases for the software switch. - [optional for OF1.3+] - -ONF OpenFlow Exensions for 1.3.X Pack1 --------------------------------------- - -OpenFlow 1.3 has a bunch of ONF extentions. -Many of them are necessary for OpenFlow 1.4 as well. - - * Flow entry notifications - This seems to be modelled after OVS's NXST_FLOW_MONITOR. - [EXT-187] - [required for OF1.4+] - - * Role Status - [EXT-191] - [required for OF1.4+] - - * Flow entry eviction - OVS has flow eviction functionality. - table_mod OFPTC_EVICTION, flow_mod 'importance', and - table_desc ofp_table_mod_prop_eviction need to be implemented. - [EXT-192-e] - [optional for OF1.4+] - - * Vacancy events - [EXT-192-v] - [optional for OF1.4+] - - * Bundle - Transactional modification. OpenFlow 1.4 requires to support - flow_mods and port_mods in a bundle. - (Not related to OVS's 'ofbundle' stuff.) - [EXT-230] - [required for OF1.4+] - - * Table synchronisation - [EXT-232] - [optional for OF1.4+] - - * Group notifications - [EXT-235] - [optional for OF1.4+] - - * Bad flow entry priority error - Probably not so useful to the software switch. - [EXT-236] - [optional for OF1.4+] - - * Set async config error - [EXT-237] - [optional for OF1.4+] - - * PBB UCA header field - [EXT-256] - [optional for OF1.4+] - - * Duplicate instruction error - We already have ONFBIC_DUP_INSTRUCTION. - [EXT-260] - [required for OF1.4+] - - * Multipart timeout error - [EXT-264] - [required for OF1.4+] - -OpenFlow 1.4 ------------- - - * More extensible wire protocol - Many on-wire structures got TLVs. - [EXT-262] - [required for OF1.4+] - - * More descriptive reasons for packet-in - Distinguish OFPR_APPLY_ACTION, OFPR_ACTION_SET, OFPR_GROUP, - OFPR_PACKET_OUT. NO_MATCH was renamed to OFPR_TABLE_MISS. - [EXT-136] - [required for OF1.4+] - - * Optical port properties - [EXT-154] - [optional for OF1.4+] - - * Flow-removed reason for meter delete - Report flow removal due to meter deletion with OFPRR_METER_DELETE. - [EXT-261] - [optional for OF1.4+] - - * Meter notifications - [EXT-235] - [optional for OF1.4+] - -General ------ - - * ovs-ofctl(8) often lists as Nicira extensions features that - later OpenFlow versions support in standard ways. - -How to contribute ------------------ - -If you plan to contribute code for a feature, please let everyone know -on ovs-dev before you start work. This will help avoid duplicating -work. - -Please consider the following: - - * Testing. Please test your code. - - * Unit tests. Please consider writing some. The tests directory - has many examples that you can use as a starting point. - - * ovs-ofctl. If you add a feature that is useful for some - ovs-ofctl command then you should add support for it there. - - * Documentation. If you add a user-visible feature, then you - should document it in the appropriate manpage and mention it in - NEWS as well. - - * Coding style (see the CodingStyle file at the top of the source - tree). - - * The patch submission guidelines (see CONTRIBUTING). I - recommend using "git send-email", which automatically follows a - lot of those guidelines. - -Bug Reporting -------------- - -Please report problems to bugs@openvswitch.org. diff -Nru openvswitch-2.3.1/OPENFLOW-1.1+.md openvswitch-2.4.0~git20150623/OPENFLOW-1.1+.md --- openvswitch-2.3.1/OPENFLOW-1.1+.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/OPENFLOW-1.1+.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,320 @@ +OpenFlow 1.1+ support in Open vSwitch +===================================== + +Open vSwitch support for OpenFlow 1.1 and beyond is a work in +progress. This file describes the work still to be done. + +The Plan +-------- + +OpenFlow version support is not a build-time option. A single build +of Open vSwitch must be able to handle all supported versions of +OpenFlow. Ideally, even at runtime it should be able to support all +protocol versions at the same time on different OpenFlow bridges (and +perhaps even on the same bridge). + +At the same time, it would be a shame to litter the core of the OVS +code with lots of ugly code concerned with the details of various +OpenFlow protocol versions. + +The primary approach to compatibility is to abstract most of the +details of the differences from the core code, by adding a protocol +layer that translates between OF1.x and a slightly higher-level +abstract representation. The core of this approach is the many struct +ofputil_* structures in lib/ofp-util.h. + +As a consequence of this approach, OVS cannot use OpenFlow protocol +definitions that closely resemble those in the OpenFlow specification, +because openflow.h in different versions of the OpenFlow specification +defines the same identifier with different values. Instead, +openflow-common.h contains definitions that are common to all the +specifications and separate protocol version-specific headers contain +protocol-specific definitions renamed so as not to conflict, +e.g. OFPAT10_ENQUEUE and OFPAT11_ENQUEUE for the OpenFlow 1.0 and 1.1 +values for OFPAT_ENQUEUE. Generally, in cases of conflict, the +protocol layer will define a more abstract OFPUTIL_* or struct +ofputil_*. + +Here are the current approaches in a few tricky areas: + + * Port numbering. OpenFlow 1.0 has 16-bit port numbers and later + OpenFlow versions have 32-bit port numbers. For now, OVS + support for later protocol versions requires all port numbers to + fall into the 16-bit range, translating the reserved OFPP_* port + numbers. + + * Actions. OpenFlow 1.0 and later versions have very different + ideas of actions. OVS reconciles by translating all the + versions' actions (and instructions) to and from a common + internal representation. + +OpenFlow 1.1 +------------ + +The list of remaining work items for OpenFlow 1.1 is below. It is +probably incomplete. + + * Match and set double-tagged VLANs (QinQ). This requires kernel + work for reasonable performance. + [optional for OF1.1+] + + * VLANs tagged with 88a8 Ethertype. This requires kernel work for + reasonable performance. + [required for OF1.1+] + +OpenFlow 1.2 +------------ + +OpenFlow 1.2 support requires OpenFlow 1.1 as a prerequisite. All the +additional work specific to Openflow 1.2 are complete. (This is based +on the change log at the end of the OF1.2 spec. I didn't compare the +specs carefully yet.) + +OpenFlow 1.3 +------------ + +OpenFlow 1.3 support requires OpenFlow 1.2 as a prerequisite, plus the +following additional work. (This is based on the change log at the +end of the OF1.3 spec, reusing most of the section titles directly. I +didn't compare the specs carefully yet.) + + * Add support for multipart requests. + Currently we always report OFPBRC_MULTIPART_BUFFER_OVERFLOW. + [optional for OF1.3+] + + * IPv6 extension header handling support. Fully implementing this + requires kernel support. This likely will take some careful and + probably time-consuming design work. The actual coding, once + that is all done, is probably 2 or 3 days work. + [optional for OF1.3+] + + * Per-flow meters. OpenFlow protocol support is now implemented. + Support for the special OFPM_SLOWPATH and OFPM_CONTROLLER meters + is missing. Support for the software switch is under review. + [optional for OF1.3+] + + * Auxiliary connections. An implementation in generic code might + be a week's worth of work. The value of an implementation in + generic code is questionable, though, since much of the benefit + of axuiliary connections is supposed to be to take advantage of + hardware support. (We could make the kernel module somehow + send packets across the auxiliary connections directly, for + some kind of "hardware" support, if we judged it useful enough.) + [optional for OF1.3+] + + * Provider Backbone Bridge tagging. I don't plan to implement + this (but we'd accept an implementation). + [optional for OF1.3+] + + * On-demand flow counters. I think this might be a real + optimization in some cases for the software switch. + [optional for OF1.3+] + +OpenFlow 1.4 & ONF Extensions for 1.3.X Pack1 +--------------------------------------------- + +The following features are both defined as a set of ONF Extensions +for 1.3 and integrated in 1.4. +When defined as an ONF Extension for 1.3, the feature is using the +Experimenter mechanism with the ONF Experimenter ID. +When defined integrated in 1.4, the feature use the standard OpenFlow +structures (for example defined in openflow-1.4.h). +The two definitions for each feature are independant and can exist in +parallel in OVS. + + * Flow entry notifications + This seems to be modelled after OVS's NXST_FLOW_MONITOR. + (Simon Horman is working on this.) + [EXT-187] + [optional for OF1.4+] + + * Role Status + Already implemented as a 1.4 feature. + [EXT-191] + [required for OF1.4+] + + * Flow entry eviction + OVS has flow eviction functionality. + table_mod OFPTC_EVICTION, flow_mod 'importance', and + table_desc ofp_table_mod_prop_eviction need to be implemented. + [EXT-192-e] + [optional for OF1.4+] + + * Vacancy events + [EXT-192-v] + [optional for OF1.4+] + + * Bundle + Transactional modification. OpenFlow 1.4 requires to support + flow_mods and port_mods in a bundle if bundle is supported. + (Not related to OVS's 'ofbundle' stuff.) + Implemented as an OpenFlow 1.4 feature. Only flow_mods and + port_mods are supported in a bundle. If the bundle includes port + mods, it may not specify the OFPBF_ATOMIC flag. Nevertheless, + port mods and flow mods in a bundle are always applied in order + and consecutive flow mods between port mods are made available to + lookups atomically. + [EXT-230] + [optional for OF1.4+] + + * Table synchronisation + Probably not so useful to the software switch. + [EXT-232] + [optional for OF1.4+] + + * Group and Meter change notifications + [EXT-235] + [optional for OF1.4+] + + * Bad flow entry priority error + Probably not so useful to the software switch. + [EXT-236] + [optional for OF1.4+] + + * Set async config error + [EXT-237] + [optional for OF1.4+] + + * PBB UCA header field + See comment on Provider Backbone Bridge in section about OpenFlow 1.3. + [EXT-256] + [optional for OF1.4+] + + * Multipart timeout error + [EXT-264] + [required for OF1.4+] + +OpenFlow 1.4 only +----------------- + +Those features are those only available in OpenFlow 1.4, other +OpenFlow 1.4 features are listed in the previous section. + + * More extensible wire protocol + Many on-wire structures got TLVs. + Already implemented: port desc properties, port mod properties, + port stats properties, table mod properties, + queue stats, unified property errors. + Remaining required: set-async, queue desc + Remaining optional: table desc, table-status + [EXT-262] + [required for OF1.4+] + + * More descriptive reasons for packet-in + Distinguish OFPR_APPLY_ACTION, OFPR_ACTION_SET, OFPR_GROUP, + OFPR_PACKET_OUT. NO_MATCH was renamed to OFPR_TABLE_MISS. + (OFPR_ACTION_SET and OFPR_GROUP are now supported) + [EXT-136] + [required for OF1.4+] + + * Optical port properties + [EXT-154] + [optional for OF1.4+] + +OpenFlow 1.5 & ONF Extensions for 1.3.X Pack2 +--------------------------------------------- + +The following features are both defined as a set of ONF Extensions for +1.3 and integrated in 1.5. Note that this list is not definitive as +those are not yet published. +When defined as an ONF Extension for 1.3, the feature is using the +Experimenter mechanism with the ONF Experimenter ID. +When defined integrated in 1.5, the feature use the standard OpenFlow +structures (for example defined in openflow-1.5.h). +The two definitions for each feature are independant and can exist in +parallel in OVS. + + * Time scheduled bundles + [EXT-340] + [optional for OF1.5+] + +OpenFlow 1.5 only +----------------- + +Those features are those only available in OpenFlow 1.5, other +OpenFlow 1.5 features are listed in the previous section. +Note that this list is not definitive as OpenFlow 1.5 is not yet +published. + + * Egress Tables + [EXT-306] + [optional for OF1.5+] + + * Packet Type aware pipeline + Prototype for OVS was done during specification. + [EXT-112] + [optional for OF1.5+] + + * Extensible Flow Entry Statistics + [EXT-334] + [required for OF1.5+] + + * Flow Entry Statistics Trigger + [EXT-335] + [optional for OF1.5+] + + * Controller connection status + Prototype for OVS was done during specification. + [EXT-454] + [optional for OF1.5+] + + * Meter action + [EXT-379] + [required for OF1.5+ if metering is supported] + + * Enable setting all pipeline fields in packet-out + Prototype for OVS was done during specification. + [EXT-427] + [required for OF1.5+] + + * Port properties for pipeline fields + Prototype for OVS was done during specification. + [EXT-388] + [optional for OF1.5+] + + * Port property for recirculation + Prototype for OVS was done during specification. + [EXT-399] + [optional for OF1.5+] + +General +----- + + * ovs-ofctl(8) often lists as Nicira extensions features that + later OpenFlow versions support in standard ways. + +How to contribute +----------------- + +If you plan to contribute code for a feature, please let everyone know +on ovs-dev before you start work. This will help avoid duplicating +work. + +Please consider the following: + + * Testing. Please test your code. + + * Unit tests. Please consider writing some. The tests directory + has many examples that you can use as a starting point. + + * ovs-ofctl. If you add a feature that is useful for some + ovs-ofctl command then you should add support for it there. + + * Documentation. If you add a user-visible feature, then you + should document it in the appropriate manpage and mention it in + NEWS as well. + + * Coding style (see the [CodingStyle.md] file at the top of the + source tree). + + * The patch submission guidelines (see [CONTRIBUTING.md]). I + recommend using "git send-email", which automatically follows a + lot of those guidelines. + +Bug Reporting +------------- + +Please report problems to bugs@openvswitch.org. + +[CONTRIBUTING.md]:CONTRIBUTING.md +[CodingStyle.md]:CodingStyle.md diff -Nru openvswitch-2.3.1/ovsdb/automake.mk openvswitch-2.4.0~git20150623/ovsdb/automake.mk --- openvswitch-2.3.1/ovsdb/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,9 @@ # libovsdb lib_LTLIBRARIES += ovsdb/libovsdb.la -ovsdb_libovsdb_la_LDFLAGS = -release $(VERSION) +ovsdb_libovsdb_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/ovsdb/libovsdb.sym \ + $(AM_LDFLAGS) ovsdb_libovsdb_la_SOURCES = \ ovsdb/column.c \ ovsdb/column.h \ @@ -17,6 +20,8 @@ ovsdb/mutation.h \ ovsdb/ovsdb.c \ ovsdb/ovsdb.h \ + ovsdb/monitor.c \ + ovsdb/monitor.h \ ovsdb/query.c \ ovsdb/query.h \ ovsdb/row.c \ @@ -32,6 +37,9 @@ ovsdb_libovsdb_la_CFLAGS = $(AM_CFLAGS) ovsdb_libovsdb_la_CPPFLAGS = $(AM_CPPFLAGS) +pkgconfig_DATA += \ + $(srcdir)/ovsdb/libovsdb.pc + MAN_FRAGMENTS += \ ovsdb/remote-active.man \ ovsdb/remote-passive.man @@ -71,11 +79,9 @@ SUFFIXES += .ovsidl .ovsschema OVSDB_IDLC = $(run_python) $(srcdir)/ovsdb/ovsdb-idlc.in .ovsidl.c: - $(OVSDB_IDLC) c-idl-source $< > $@.tmp - mv $@.tmp $@ + $(AM_V_GEN)$(OVSDB_IDLC) c-idl-source $< > $@.tmp && mv $@.tmp $@ .ovsidl.h: - $(OVSDB_IDLC) c-idl-header $< > $@.tmp - mv $@.tmp $@ + $(AM_V_GEN)$(OVSDB_IDLC) c-idl-header $< > $@.tmp && mv $@.tmp $@ EXTRA_DIST += $(OVSIDL_BUILT) BUILT_SOURCES += $(OVSIDL_BUILT) diff -Nru openvswitch-2.3.1/ovsdb/column.h openvswitch-2.4.0~git20150623/ovsdb/column.h --- openvswitch-2.3.1/ovsdb/column.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/column.h 2015-06-23 18:46:21.000000000 +0000 @@ -53,7 +53,7 @@ struct ovsdb_error *ovsdb_column_from_json(const struct json *, const char *name, struct ovsdb_column **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_column_to_json(const struct ovsdb_column *); /* An unordered set of distinct columns. */ diff -Nru openvswitch-2.3.1/ovsdb/condition.c openvswitch-2.4.0~git20150623/ovsdb/condition.c --- openvswitch-2.3.1/ovsdb/condition.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/condition.c 2015-06-23 18:46:21.000000000 +0000 @@ -52,7 +52,7 @@ return NULL; } -static WARN_UNUSED_RESULT struct ovsdb_error * +static OVS_WARN_UNUSED_RESULT struct ovsdb_error * ovsdb_clause_from_json(const struct ovsdb_table_schema *ts, const struct json *json, struct ovsdb_symbol_table *symtab, @@ -93,10 +93,10 @@ case OVSDB_F_LE: case OVSDB_F_GT: case OVSDB_F_GE: - /* XXX should we also allow these operators for types with n_min == 0, - * n_max == 1? (They would always be "false" if the value was - * missing.) */ - if (!ovsdb_type_is_scalar(&type) + /* Allow these operators for types with n_min == 0, n_max == 1. + * (They will always be "false" if the value is missing.) */ + if (!(ovsdb_type_is_scalar(&type) + || ovsdb_type_is_optional_scalar(&type)) || (type.key.type != OVSDB_TYPE_INTEGER && type.key.type != OVSDB_TYPE_REAL)) { char *s = ovsdb_type_to_english(&type); @@ -225,7 +225,21 @@ const struct ovsdb_datum *arg = &c->arg; const struct ovsdb_type *type = &c->column->type; - if (ovsdb_type_is_scalar(type)) { + if (ovsdb_type_is_optional_scalar(type) && field->n == 0) { + switch (c->function) { + case OVSDB_F_LT: + case OVSDB_F_LE: + case OVSDB_F_EQ: + case OVSDB_F_GE: + case OVSDB_F_GT: + case OVSDB_F_INCLUDES: + return false; + case OVSDB_F_NE: + case OVSDB_F_EXCLUDES: + return true; + } + } else if (ovsdb_type_is_scalar(type) + || ovsdb_type_is_optional_scalar(type)) { int cmp = ovsdb_atom_compare_3way(&field->keys[0], &arg->keys[0], type->key.type); switch (c->function) { diff -Nru openvswitch-2.3.1/ovsdb/condition.h openvswitch-2.4.0~git20150623/ovsdb/condition.h --- openvswitch-2.3.1/ovsdb/condition.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/condition.h 2015-06-23 18:46:21.000000000 +0000 @@ -44,7 +44,7 @@ struct ovsdb_error *ovsdb_function_from_string(const char *, enum ovsdb_function *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; const char *ovsdb_function_to_string(enum ovsdb_function); struct ovsdb_clause { @@ -63,7 +63,7 @@ struct ovsdb_error *ovsdb_condition_from_json( const struct ovsdb_table_schema *, const struct json *, struct ovsdb_symbol_table *, - struct ovsdb_condition *) WARN_UNUSED_RESULT; + struct ovsdb_condition *) OVS_WARN_UNUSED_RESULT; struct json *ovsdb_condition_to_json(const struct ovsdb_condition *); void ovsdb_condition_destroy(struct ovsdb_condition *); bool ovsdb_condition_evaluate(const struct ovsdb_row *, diff -Nru openvswitch-2.3.1/ovsdb/execution.c openvswitch-2.4.0~git20150623/ovsdb/execution.c --- openvswitch-2.3.1/ovsdb/execution.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/execution.c 2015-06-23 18:46:21.000000000 +0000 @@ -247,7 +247,7 @@ return table; } -static WARN_UNUSED_RESULT struct ovsdb_error * +static OVS_WARN_UNUSED_RESULT struct ovsdb_error * parse_row(const struct json *json, const struct ovsdb_table *table, struct ovsdb_symbol_table *symtab, struct ovsdb_row **rowp, struct ovsdb_column_set *columns) diff -Nru openvswitch-2.3.1/ovsdb/file.c openvswitch-2.4.0~git20150623/ovsdb/file.c --- openvswitch-2.3.1/ovsdb/file.c 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/file.c 2015-06-23 18:46:21.000000000 +0000 @@ -35,7 +35,7 @@ #include "transaction.h" #include "uuid.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovsdb_file); diff -Nru openvswitch-2.3.1/ovsdb/file.h openvswitch-2.4.0~git20150623/ovsdb/file.h --- openvswitch-2.3.1/ovsdb/file.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/file.h 2015-06-23 18:46:21.000000000 +0000 @@ -26,22 +26,22 @@ struct ovsdb_error *ovsdb_file_open(const char *file_name, bool read_only, struct ovsdb **, struct ovsdb_file **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_file_open_as_schema(const char *file_name, const struct ovsdb_schema *, struct ovsdb **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_file_save_copy(const char *file_name, int locking, const char *comment, const struct ovsdb *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_file_compact(struct ovsdb_file *); struct ovsdb_error *ovsdb_file_read_schema(const char *file_name, struct ovsdb_schema **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; #endif /* ovsdb/file.h */ diff -Nru openvswitch-2.3.1/ovsdb/.gitignore openvswitch-2.4.0~git20150623/ovsdb/.gitignore --- openvswitch-2.3.1/ovsdb/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,10 @@ +/ovsdb-client +/ovsdb-client.1 +/ovsdb-doc +/ovsdb-dot +/ovsdb-idlc +/ovsdb-server +/ovsdb-server.1 +/ovsdb-tool +/ovsdb-tool.1 +/libovsdb.pc diff -Nru openvswitch-2.3.1/ovsdb/jsonrpc-server.c openvswitch-2.4.0~git20150623/ovsdb/jsonrpc-server.c --- openvswitch-2.3.1/ovsdb/jsonrpc-server.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/jsonrpc-server.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,8 @@ #include "timeval.h" #include "transaction.h" #include "trigger.h" -#include "vlog.h" +#include "monitor.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovsdb_jsonrpc_server); @@ -78,8 +79,9 @@ struct ovsdb_jsonrpc_session *); /* Monitors. */ -static struct json *ovsdb_jsonrpc_monitor_create( - struct ovsdb_jsonrpc_session *, struct ovsdb *, struct json *params); +static struct jsonrpc_msg *ovsdb_jsonrpc_monitor_create( + struct ovsdb_jsonrpc_session *, struct ovsdb *, struct json *params, + const struct json *request_id); static struct jsonrpc_msg *ovsdb_jsonrpc_monitor_cancel( struct ovsdb_jsonrpc_session *, struct json_array *params, @@ -87,6 +89,9 @@ static void ovsdb_jsonrpc_monitor_remove_all(struct ovsdb_jsonrpc_session *); static void ovsdb_jsonrpc_monitor_flush_all(struct ovsdb_jsonrpc_session *); static bool ovsdb_jsonrpc_monitor_needs_flush(struct ovsdb_jsonrpc_session *); +static struct json *ovsdb_jsonrpc_monitor_compose_update( + struct ovsdb_jsonrpc_monitor *monitor, bool initial); + /* JSON-RPC database server. */ @@ -102,7 +107,7 @@ struct ovsdb_jsonrpc_remote { struct ovsdb_jsonrpc_server *server; struct pstream *listener; /* Listener, if passive. */ - struct list sessions; /* List of "struct ovsdb_jsonrpc_session"s. */ + struct ovs_list sessions; /* List of "struct ovsdb_jsonrpc_session"s. */ uint8_t dscp; }; @@ -121,7 +126,7 @@ { struct ovsdb_jsonrpc_server *server = xzalloc(sizeof *server); ovsdb_server_init(&server->up); - server->max_sessions = 64; + server->max_sessions = 330; /* Random limit. */ shash_init(&server->remotes); return server; } @@ -198,10 +203,16 @@ struct shash_node *node, *next; SHASH_FOR_EACH_SAFE (node, next, &svr->remotes) { - if (!shash_find(new_remotes, node->name)) { + struct ovsdb_jsonrpc_remote *remote = node->data; + struct ovsdb_jsonrpc_options *options + = shash_find_data(new_remotes, node->name); + + if (!options) { VLOG_INFO("%s: remote deconfigured", node->name); ovsdb_jsonrpc_server_del_remote(node); - } + } else if (options->dscp != remote->dscp) { + ovsdb_jsonrpc_server_del_remote(node); + } } SHASH_FOR_EACH (node, new_remotes) { const struct ovsdb_jsonrpc_options *options = node->data; @@ -308,20 +319,26 @@ SHASH_FOR_EACH (node, &svr->remotes) { struct ovsdb_jsonrpc_remote *remote = node->data; - if (remote->listener && svr->n_sessions < svr->max_sessions) { - struct stream *stream; - int error; - - error = pstream_accept(remote->listener, &stream); - if (!error) { - struct jsonrpc_session *js; - js = jsonrpc_session_open_unreliably(jsonrpc_open(stream), - remote->dscp); - ovsdb_jsonrpc_session_create(remote, js); - } else if (error != EAGAIN) { - VLOG_WARN_RL(&rl, "%s: accept failed: %s", + if (remote->listener) { + if (svr->n_sessions < svr->max_sessions) { + struct stream *stream; + int error; + + error = pstream_accept(remote->listener, &stream); + if (!error) { + struct jsonrpc_session *js; + js = jsonrpc_session_open_unreliably(jsonrpc_open(stream), + remote->dscp); + ovsdb_jsonrpc_session_create(remote, js); + } else if (error != EAGAIN) { + VLOG_WARN_RL(&rl, "%s: accept failed: %s", + pstream_get_name(remote->listener), + ovs_strerror(error)); + } + } else { + VLOG_WARN_RL(&rl, "%s: connection exceeded maximum (%d)", pstream_get_name(remote->listener), - ovs_strerror(error)); + svr->max_sessions); } } @@ -364,7 +381,7 @@ /* JSON-RPC database server session. */ struct ovsdb_jsonrpc_session { - struct list node; /* Element in remote's sessions list. */ + struct ovs_list node; /* Element in remote's sessions list. */ struct ovsdb_session up; struct ovsdb_jsonrpc_remote *remote; @@ -384,8 +401,6 @@ static void ovsdb_jsonrpc_session_wait(struct ovsdb_jsonrpc_session *); static void ovsdb_jsonrpc_session_get_memory_usage( const struct ovsdb_jsonrpc_session *, struct simap *usage); -static void ovsdb_jsonrpc_session_set_options( - struct ovsdb_jsonrpc_session *, const struct ovsdb_jsonrpc_options *); static void ovsdb_jsonrpc_session_got_request(struct ovsdb_jsonrpc_session *, struct jsonrpc_msg *); static void ovsdb_jsonrpc_session_got_notify(struct ovsdb_jsonrpc_session *, @@ -556,7 +571,10 @@ } /* Sets the options for all of the JSON-RPC sessions managed by 'remote' to - * 'options'. */ + * 'options'. + * + * (The dscp value can't be changed directly; the caller must instead close and + * re-open the session.) */ static void ovsdb_jsonrpc_session_set_all_options( struct ovsdb_jsonrpc_remote *remote, @@ -564,22 +582,6 @@ { struct ovsdb_jsonrpc_session *s; - if (remote->listener) { - int error; - - error = pstream_set_dscp(remote->listener, options->dscp); - if (error) { - VLOG_ERR("%s: set_dscp failed %s", - pstream_get_name(remote->listener), ovs_strerror(error)); - } else { - remote->dscp = options->dscp; - } - /* - * XXX race window between setting dscp to listening socket - * and accepting socket. Accepted socket may have old dscp value. - * Ignore this race window for now. - */ - } LIST_FOR_EACH (s, node, &remote->sessions) { ovsdb_jsonrpc_session_set_options(s, options); } @@ -677,7 +679,7 @@ return db; error: - *replyp = jsonrpc_create_reply(ovsdb_error_to_json(error), request->id); + *replyp = jsonrpc_create_error(ovsdb_error_to_json(error), request->id); ovsdb_error_destroy(error); return NULL; } @@ -755,7 +757,7 @@ return jsonrpc_create_reply(result, request->id); error: - reply = jsonrpc_create_reply(ovsdb_error_to_json(error), request->id); + reply = jsonrpc_create_error(ovsdb_error_to_json(error), request->id); ovsdb_error_destroy(error); return reply; } @@ -815,7 +817,7 @@ return jsonrpc_create_reply(json_object_create(), request->id); error: - reply = jsonrpc_create_reply(ovsdb_error_to_json(error), request->id); + reply = jsonrpc_create_error(ovsdb_error_to_json(error), request->id); ovsdb_error_destroy(error); return reply; } @@ -845,9 +847,8 @@ } else if (!strcmp(request->method, "monitor")) { struct ovsdb *db = ovsdb_jsonrpc_lookup_db(s, request, &reply); if (!reply) { - reply = jsonrpc_create_reply( - ovsdb_jsonrpc_monitor_create(s, db, request->params), - request->id); + reply = ovsdb_jsonrpc_monitor_create(s, db, request->params, + request->id); } } else if (!strcmp(request->method, "monitor_cancel")) { reply = ovsdb_jsonrpc_monitor_cancel(s, json_array(request->params), @@ -1029,75 +1030,18 @@ } } -/* JSON-RPC database table monitors. */ - -enum ovsdb_jsonrpc_monitor_selection { - OJMS_INITIAL = 1 << 0, /* All rows when monitor is created. */ - OJMS_INSERT = 1 << 1, /* New rows. */ - OJMS_DELETE = 1 << 2, /* Deleted rows. */ - OJMS_MODIFY = 1 << 3 /* Modified rows. */ -}; - -/* A particular column being monitored. */ -struct ovsdb_jsonrpc_monitor_column { - const struct ovsdb_column *column; - enum ovsdb_jsonrpc_monitor_selection select; -}; - -/* A row that has changed in a monitored table. */ -struct ovsdb_jsonrpc_monitor_row { - struct hmap_node hmap_node; /* In ovsdb_jsonrpc_monitor_table.changes. */ - struct uuid uuid; /* UUID of row that changed. */ - struct ovsdb_datum *old; /* Old data, NULL for an inserted row. */ - struct ovsdb_datum *new; /* New data, NULL for a deleted row. */ -}; - -/* A particular table being monitored. */ -struct ovsdb_jsonrpc_monitor_table { - const struct ovsdb_table *table; - - /* This is the union (bitwise-OR) of the 'select' values in all of the - * members of 'columns' below. */ - enum ovsdb_jsonrpc_monitor_selection select; - - /* Columns being monitored. */ - struct ovsdb_jsonrpc_monitor_column *columns; - size_t n_columns; - - /* Contains 'struct ovsdb_jsonrpc_monitor_row's for rows that have been - * updated but not yet flushed to the jsonrpc connection. */ - struct hmap changes; -}; - -/* A collection of tables being monitored. */ +/* Jsonrpc front end monitor. */ struct ovsdb_jsonrpc_monitor { - struct ovsdb_replica replica; struct ovsdb_jsonrpc_session *session; struct ovsdb *db; struct hmap_node node; /* In ovsdb_jsonrpc_session's "monitors". */ - struct json *monitor_id; - struct shash tables; /* Holds "struct ovsdb_jsonrpc_monitor_table"s. */ + struct ovsdb_monitor *dbmon; + uint64_t unflushed; /* The first transaction that has not been + flushed to the jsonrpc remote client. */ }; -static const struct ovsdb_replica_class ovsdb_jsonrpc_replica_class; - -struct ovsdb_jsonrpc_monitor *ovsdb_jsonrpc_monitor_find( - struct ovsdb_jsonrpc_session *, const struct json *monitor_id); -static void ovsdb_jsonrpc_monitor_destroy(struct ovsdb_replica *); -static struct json *ovsdb_jsonrpc_monitor_get_initial( - const struct ovsdb_jsonrpc_monitor *); - -static bool -parse_bool(struct ovsdb_parser *parser, const char *name, bool default_value) -{ - const struct json *json; - - json = ovsdb_parser_member(parser, name, OP_BOOLEAN | OP_OPTIONAL); - return json ? json_boolean(json) : default_value; -} - -struct ovsdb_jsonrpc_monitor * +static struct ovsdb_jsonrpc_monitor * ovsdb_jsonrpc_monitor_find(struct ovsdb_jsonrpc_session *s, const struct json *monitor_id) { @@ -1112,40 +1056,23 @@ return NULL; } -static void -ovsdb_jsonrpc_add_monitor_column(struct ovsdb_jsonrpc_monitor_table *mt, - const struct ovsdb_column *column, - enum ovsdb_jsonrpc_monitor_selection select, - size_t *allocated_columns) -{ - struct ovsdb_jsonrpc_monitor_column *c; - - if (mt->n_columns >= *allocated_columns) { - mt->columns = x2nrealloc(mt->columns, allocated_columns, - sizeof *mt->columns); - } - - c = &mt->columns[mt->n_columns++]; - c->column = column; - c->select = select; -} - -static int -compare_ovsdb_jsonrpc_monitor_column(const void *a_, const void *b_) +static bool +parse_bool(struct ovsdb_parser *parser, const char *name, bool default_value) { - const struct ovsdb_jsonrpc_monitor_column *a = a_; - const struct ovsdb_jsonrpc_monitor_column *b = b_; + const struct json *json; - return a->column < b->column ? -1 : a->column > b->column; + json = ovsdb_parser_member(parser, name, OP_BOOLEAN | OP_OPTIONAL); + return json ? json_boolean(json) : default_value; } -static struct ovsdb_error * WARN_UNUSED_RESULT -ovsdb_jsonrpc_parse_monitor_request(struct ovsdb_jsonrpc_monitor_table *mt, +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT +ovsdb_jsonrpc_parse_monitor_request(struct ovsdb_monitor *dbmon, + const struct ovsdb_table *table, const struct json *monitor_request, size_t *allocated_columns) { - const struct ovsdb_table_schema *ts = mt->table->schema; - enum ovsdb_jsonrpc_monitor_selection select; + const struct ovsdb_table_schema *ts = table->schema; + enum ovsdb_monitor_selection select; const struct json *columns, *select_json; struct ovsdb_parser parser; struct ovsdb_error *error; @@ -1181,8 +1108,8 @@ } else { select = OJMS_INITIAL | OJMS_INSERT | OJMS_DELETE | OJMS_MODIFY; } - mt->select |= select; + ovsdb_monitor_table_add_select(dbmon, table, select); if (columns) { size_t i; @@ -1201,13 +1128,13 @@ } s = columns->u.array.elems[i]->u.string; - column = shash_find_data(&mt->table->schema->columns, s); + column = shash_find_data(&table->schema->columns, s); if (!column) { return ovsdb_syntax_error(columns, NULL, "%s is not a valid " "column name", s); } - ovsdb_jsonrpc_add_monitor_column(mt, column, select, - allocated_columns); + ovsdb_monitor_add_column(dbmon, table, column, select, + allocated_columns); } } else { struct shash_node *node; @@ -1215,8 +1142,8 @@ SHASH_FOR_EACH (node, &ts->columns) { const struct ovsdb_column *column = node->data; if (column->index != OVSDB_COL_UUID) { - ovsdb_jsonrpc_add_monitor_column(mt, column, select, - allocated_columns); + ovsdb_monitor_add_column(dbmon, table, column, select, + allocated_columns); } } } @@ -1224,11 +1151,13 @@ return NULL; } -static struct json * +static struct jsonrpc_msg * ovsdb_jsonrpc_monitor_create(struct ovsdb_jsonrpc_session *s, struct ovsdb *db, - struct json *params) + struct json *params, + const struct json *request_id) { struct ovsdb_jsonrpc_monitor *m = NULL; + struct ovsdb_monitor *dbmon = NULL; struct json *monitor_id, *monitor_requests; struct ovsdb_error *error = NULL; struct shash_node *node; @@ -1252,17 +1181,16 @@ } m = xzalloc(sizeof *m); - ovsdb_replica_init(&m->replica, &ovsdb_jsonrpc_replica_class); - ovsdb_add_replica(db, &m->replica); m->session = s; m->db = db; + m->dbmon = ovsdb_monitor_create(db, m); + m->unflushed = 0; hmap_insert(&s->monitors, &m->node, json_hash(monitor_id, 0)); m->monitor_id = json_clone(monitor_id); - shash_init(&m->tables); SHASH_FOR_EACH (node, json_object(monitor_requests)) { const struct ovsdb_table *table; - struct ovsdb_jsonrpc_monitor_table *mt; + const char *column_name; size_t allocated_columns; const struct json *mr_value; size_t i; @@ -1274,10 +1202,7 @@ goto error; } - mt = xzalloc(sizeof *mt); - mt->table = table; - hmap_init(&mt->changes); - shash_add(&m->tables, table->schema->name, mt); + ovsdb_monitor_add_table(m->dbmon, table); /* Parse columns. */ mr_value = node->data; @@ -1287,42 +1212,50 @@ for (i = 0; i < array->n; i++) { error = ovsdb_jsonrpc_parse_monitor_request( - mt, array->elems[i], &allocated_columns); + m->dbmon, table, array->elems[i], &allocated_columns); if (error) { goto error; } } } else { error = ovsdb_jsonrpc_parse_monitor_request( - mt, mr_value, &allocated_columns); + m->dbmon, table, mr_value, &allocated_columns); if (error) { goto error; } } - /* Check for duplicate columns. */ - qsort(mt->columns, mt->n_columns, sizeof *mt->columns, - compare_ovsdb_jsonrpc_monitor_column); - for (i = 1; i < mt->n_columns; i++) { - if (mt->columns[i].column == mt->columns[i - 1].column) { - error = ovsdb_syntax_error(mr_value, NULL, "column %s " - "mentioned more than once", - mt->columns[i].column->name); - goto error; - } + column_name = ovsdb_monitor_table_check_duplicates(m->dbmon, table); + + if (column_name) { + error = ovsdb_syntax_error(mr_value, NULL, "column %s " + "mentioned more than once", + column_name); + goto error; } } - return ovsdb_jsonrpc_monitor_get_initial(m); + dbmon = ovsdb_monitor_add(m->dbmon); + if (dbmon != m->dbmon) { + /* Found an exisiting dbmon, reuse the current one. */ + ovsdb_monitor_remove_jsonrpc_monitor(m->dbmon, m); + ovsdb_monitor_add_jsonrpc_monitor(dbmon, m); + m->dbmon = dbmon; + } + + ovsdb_monitor_get_initial(m->dbmon); + json = ovsdb_jsonrpc_monitor_compose_update(m, true); + json = json ? json : json_object_create(); + return jsonrpc_create_reply(json, request_id); error: if (m) { - ovsdb_remove_replica(m->db, &m->replica); + ovsdb_jsonrpc_monitor_destroy(m); } json = ovsdb_error_to_json(error); ovsdb_error_destroy(error); - return json; + return jsonrpc_create_error(json, request_id); } static struct jsonrpc_msg * @@ -1341,7 +1274,7 @@ return jsonrpc_create_error(json_string_create("unknown monitor"), request_id); } else { - ovsdb_remove_replica(m->db, &m->replica); + ovsdb_jsonrpc_monitor_destroy(m); return jsonrpc_create_reply(json_object_create(), request_id); } } @@ -1353,311 +1286,15 @@ struct ovsdb_jsonrpc_monitor *m, *next; HMAP_FOR_EACH_SAFE (m, next, node, &s->monitors) { - ovsdb_remove_replica(m->db, &m->replica); - } -} - -static struct ovsdb_jsonrpc_monitor * -ovsdb_jsonrpc_monitor_cast(struct ovsdb_replica *replica) -{ - ovs_assert(replica->class == &ovsdb_jsonrpc_replica_class); - return CONTAINER_OF(replica, struct ovsdb_jsonrpc_monitor, replica); -} - -struct ovsdb_jsonrpc_monitor_aux { - const struct ovsdb_jsonrpc_monitor *monitor; - struct ovsdb_jsonrpc_monitor_table *mt; -}; - -/* Finds and returns the ovsdb_jsonrpc_monitor_row in 'mt->changes' for the - * given 'uuid', or NULL if there is no such row. */ -static struct ovsdb_jsonrpc_monitor_row * -ovsdb_jsonrpc_monitor_row_find(const struct ovsdb_jsonrpc_monitor_table *mt, - const struct uuid *uuid) -{ - struct ovsdb_jsonrpc_monitor_row *row; - - HMAP_FOR_EACH_WITH_HASH (row, hmap_node, uuid_hash(uuid), &mt->changes) { - if (uuid_equals(uuid, &row->uuid)) { - return row; - } - } - return NULL; -} - -/* Allocates an array of 'mt->n_columns' ovsdb_datums and initializes them as - * copies of the data in 'row' drawn from the columns represented by - * mt->columns[]. Returns the array. - * - * If 'row' is NULL, returns NULL. */ -static struct ovsdb_datum * -clone_monitor_row_data(const struct ovsdb_jsonrpc_monitor_table *mt, - const struct ovsdb_row *row) -{ - struct ovsdb_datum *data; - size_t i; - - if (!row) { - return NULL; - } - - data = xmalloc(mt->n_columns * sizeof *data); - for (i = 0; i < mt->n_columns; i++) { - const struct ovsdb_column *c = mt->columns[i].column; - const struct ovsdb_datum *src = &row->fields[c->index]; - struct ovsdb_datum *dst = &data[i]; - const struct ovsdb_type *type = &c->type; - - ovsdb_datum_clone(dst, src, type); - } - return data; -} - -/* Replaces the mt->n_columns ovsdb_datums in row[] by copies of the data from - * in 'row' drawn from the columns represented by mt->columns[]. */ -static void -update_monitor_row_data(const struct ovsdb_jsonrpc_monitor_table *mt, - const struct ovsdb_row *row, - struct ovsdb_datum *data) -{ - size_t i; - - for (i = 0; i < mt->n_columns; i++) { - const struct ovsdb_column *c = mt->columns[i].column; - const struct ovsdb_datum *src = &row->fields[c->index]; - struct ovsdb_datum *dst = &data[i]; - const struct ovsdb_type *type = &c->type; - - if (!ovsdb_datum_equals(src, dst, type)) { - ovsdb_datum_destroy(dst, type); - ovsdb_datum_clone(dst, src, type); - } - } -} - -/* Frees all of the mt->n_columns ovsdb_datums in data[], using the types taken - * from mt->columns[], plus 'data' itself. */ -static void -free_monitor_row_data(const struct ovsdb_jsonrpc_monitor_table *mt, - struct ovsdb_datum *data) -{ - if (data) { - size_t i; - - for (i = 0; i < mt->n_columns; i++) { - const struct ovsdb_column *c = mt->columns[i].column; - - ovsdb_datum_destroy(&data[i], &c->type); - } - free(data); - } -} - -/* Frees 'row', which must have been created from 'mt'. */ -static void -ovsdb_jsonrpc_monitor_row_destroy(const struct ovsdb_jsonrpc_monitor_table *mt, - struct ovsdb_jsonrpc_monitor_row *row) -{ - if (row) { - free_monitor_row_data(mt, row->old); - free_monitor_row_data(mt, row->new); - free(row); + ovsdb_jsonrpc_monitor_destroy(m); } } -static bool -ovsdb_jsonrpc_monitor_change_cb(const struct ovsdb_row *old, - const struct ovsdb_row *new, - const unsigned long int *changed OVS_UNUSED, - void *aux_) -{ - struct ovsdb_jsonrpc_monitor_aux *aux = aux_; - const struct ovsdb_jsonrpc_monitor *m = aux->monitor; - struct ovsdb_table *table = new ? new->table : old->table; - const struct uuid *uuid = ovsdb_row_get_uuid(new ? new : old); - struct ovsdb_jsonrpc_monitor_row *change; - struct ovsdb_jsonrpc_monitor_table *mt; - - if (!aux->mt || table != aux->mt->table) { - aux->mt = shash_find_data(&m->tables, table->schema->name); - if (!aux->mt) { - /* We don't care about rows in this table at all. Tell the caller - * to skip it. */ - return false; - } - } - mt = aux->mt; - - change = ovsdb_jsonrpc_monitor_row_find(mt, uuid); - if (!change) { - change = xmalloc(sizeof *change); - hmap_insert(&mt->changes, &change->hmap_node, uuid_hash(uuid)); - change->uuid = *uuid; - change->old = clone_monitor_row_data(mt, old); - change->new = clone_monitor_row_data(mt, new); - } else { - if (new) { - update_monitor_row_data(mt, new, change->new); - } else { - free_monitor_row_data(mt, change->new); - change->new = NULL; - - if (!change->old) { - /* This row was added then deleted. Forget about it. */ - hmap_remove(&mt->changes, &change->hmap_node); - free(change); - } - } - } - return true; -} - -/* Returns JSON for a (as described in RFC 7047) for 'row' within - * 'mt', or NULL if no row update should be sent. - * - * The caller should specify 'initial' as true if the returned JSON is going to - * be used as part of the initial reply to a "monitor" request, false if it is - * going to be used as part of an "update" notification. - * - * 'changed' must be a scratch buffer for internal use that is at least - * bitmap_n_bytes(mt->n_columns) bytes long. */ static struct json * -ovsdb_jsonrpc_monitor_compose_row_update( - const struct ovsdb_jsonrpc_monitor_table *mt, - const struct ovsdb_jsonrpc_monitor_row *row, - bool initial, unsigned long int *changed) -{ - enum ovsdb_jsonrpc_monitor_selection type; - struct json *old_json, *new_json; - struct json *row_json; - size_t i; - - type = (initial ? OJMS_INITIAL - : !row->old ? OJMS_INSERT - : !row->new ? OJMS_DELETE - : OJMS_MODIFY); - if (!(mt->select & type)) { - return NULL; - } - - if (type == OJMS_MODIFY) { - size_t n_changes; - - n_changes = 0; - memset(changed, 0, bitmap_n_bytes(mt->n_columns)); - for (i = 0; i < mt->n_columns; i++) { - const struct ovsdb_column *c = mt->columns[i].column; - if (!ovsdb_datum_equals(&row->old[i], &row->new[i], &c->type)) { - bitmap_set1(changed, i); - n_changes++; - } - } - if (!n_changes) { - /* No actual changes: presumably a row changed and then - * changed back later. */ - return NULL; - } - } - - row_json = json_object_create(); - old_json = new_json = NULL; - if (type & (OJMS_DELETE | OJMS_MODIFY)) { - old_json = json_object_create(); - json_object_put(row_json, "old", old_json); - } - if (type & (OJMS_INITIAL | OJMS_INSERT | OJMS_MODIFY)) { - new_json = json_object_create(); - json_object_put(row_json, "new", new_json); - } - for (i = 0; i < mt->n_columns; i++) { - const struct ovsdb_jsonrpc_monitor_column *c = &mt->columns[i]; - - if (!(type & c->select)) { - /* We don't care about this type of change for this - * particular column (but we will care about it for some - * other column). */ - continue; - } - - if ((type == OJMS_MODIFY && bitmap_is_set(changed, i)) - || type == OJMS_DELETE) { - json_object_put(old_json, c->column->name, - ovsdb_datum_to_json(&row->old[i], - &c->column->type)); - } - if (type & (OJMS_INITIAL | OJMS_INSERT | OJMS_MODIFY)) { - json_object_put(new_json, c->column->name, - ovsdb_datum_to_json(&row->new[i], - &c->column->type)); - } - } - - return row_json; -} - -/* Constructs and returns JSON for a object (as described in - * RFC 7047) for all the outstanding changes within 'monitor', and deletes all - * the outstanding changes from 'monitor'. Returns NULL if no update needs to - * be sent. - * - * The caller should specify 'initial' as true if the returned JSON is going to - * be used as part of the initial reply to a "monitor" request, false if it is - * going to be used as part of an "update" notification. */ -static struct json * -ovsdb_jsonrpc_monitor_compose_table_update( - const struct ovsdb_jsonrpc_monitor *monitor, bool initial) +ovsdb_jsonrpc_monitor_compose_update(struct ovsdb_jsonrpc_monitor *m, + bool initial) { - struct shash_node *node; - unsigned long int *changed; - struct json *json; - size_t max_columns; - - max_columns = 0; - SHASH_FOR_EACH (node, &monitor->tables) { - struct ovsdb_jsonrpc_monitor_table *mt = node->data; - - max_columns = MAX(max_columns, mt->n_columns); - } - changed = xmalloc(bitmap_n_bytes(max_columns)); - - json = NULL; - SHASH_FOR_EACH (node, &monitor->tables) { - struct ovsdb_jsonrpc_monitor_table *mt = node->data; - struct ovsdb_jsonrpc_monitor_row *row, *next; - struct json *table_json = NULL; - - HMAP_FOR_EACH_SAFE (row, next, hmap_node, &mt->changes) { - struct json *row_json; - - row_json = ovsdb_jsonrpc_monitor_compose_row_update( - mt, row, initial, changed); - if (row_json) { - char uuid[UUID_LEN + 1]; - - /* Create JSON object for transaction overall. */ - if (!json) { - json = json_object_create(); - } - - /* Create JSON object for transaction on this table. */ - if (!table_json) { - table_json = json_object_create(); - json_object_put(json, mt->table->schema->name, table_json); - } - - /* Add JSON row to JSON table. */ - snprintf(uuid, sizeof uuid, UUID_FMT, UUID_ARGS(&row->uuid)); - json_object_put(table_json, uuid, row_json); - } - - hmap_remove(&mt->changes, &row->hmap_node); - ovsdb_jsonrpc_monitor_row_destroy(mt, row); - } - } - - free(changed); - - return json; + return ovsdb_monitor_get_update(m->dbmon, initial, &m->unflushed); } static bool @@ -1666,20 +1303,23 @@ struct ovsdb_jsonrpc_monitor *m; HMAP_FOR_EACH (m, node, &s->monitors) { - struct shash_node *node; - - SHASH_FOR_EACH (node, &m->tables) { - struct ovsdb_jsonrpc_monitor_table *mt = node->data; - - if (!hmap_is_empty(&mt->changes)) { - return true; - } + if (ovsdb_monitor_needs_flush(m->dbmon, m->unflushed)) { + return true; } } return false; } +void +ovsdb_jsonrpc_monitor_destroy(struct ovsdb_jsonrpc_monitor *m) +{ + json_destroy(m->monitor_id); + hmap_remove(&m->session->monitors, &m->node); + ovsdb_monitor_remove_jsonrpc_monitor(m->dbmon, m); + free(m); +} + static void ovsdb_jsonrpc_monitor_flush_all(struct ovsdb_jsonrpc_session *s) { @@ -1688,7 +1328,7 @@ HMAP_FOR_EACH (m, node, &s->monitors) { struct json *json; - json = ovsdb_jsonrpc_monitor_compose_table_update(m, false); + json = ovsdb_jsonrpc_monitor_compose_update(m, false); if (json) { struct jsonrpc_msg *msg; struct json *params; @@ -1699,78 +1339,3 @@ } } } - -static void -ovsdb_jsonrpc_monitor_init_aux(struct ovsdb_jsonrpc_monitor_aux *aux, - const struct ovsdb_jsonrpc_monitor *m) -{ - aux->monitor = m; - aux->mt = NULL; -} - -static struct ovsdb_error * -ovsdb_jsonrpc_monitor_commit(struct ovsdb_replica *replica, - const struct ovsdb_txn *txn, - bool durable OVS_UNUSED) -{ - struct ovsdb_jsonrpc_monitor *m = ovsdb_jsonrpc_monitor_cast(replica); - struct ovsdb_jsonrpc_monitor_aux aux; - - ovsdb_jsonrpc_monitor_init_aux(&aux, m); - ovsdb_txn_for_each_change(txn, ovsdb_jsonrpc_monitor_change_cb, &aux); - - return NULL; -} - -static struct json * -ovsdb_jsonrpc_monitor_get_initial(const struct ovsdb_jsonrpc_monitor *m) -{ - struct ovsdb_jsonrpc_monitor_aux aux; - struct shash_node *node; - struct json *json; - - ovsdb_jsonrpc_monitor_init_aux(&aux, m); - SHASH_FOR_EACH (node, &m->tables) { - struct ovsdb_jsonrpc_monitor_table *mt = node->data; - - if (mt->select & OJMS_INITIAL) { - struct ovsdb_row *row; - - HMAP_FOR_EACH (row, hmap_node, &mt->table->rows) { - ovsdb_jsonrpc_monitor_change_cb(NULL, row, NULL, &aux); - } - } - } - json = ovsdb_jsonrpc_monitor_compose_table_update(m, true); - return json ? json : json_object_create(); -} - -static void -ovsdb_jsonrpc_monitor_destroy(struct ovsdb_replica *replica) -{ - struct ovsdb_jsonrpc_monitor *m = ovsdb_jsonrpc_monitor_cast(replica); - struct shash_node *node; - - json_destroy(m->monitor_id); - SHASH_FOR_EACH (node, &m->tables) { - struct ovsdb_jsonrpc_monitor_table *mt = node->data; - struct ovsdb_jsonrpc_monitor_row *row, *next; - - HMAP_FOR_EACH_SAFE (row, next, hmap_node, &mt->changes) { - hmap_remove(&mt->changes, &row->hmap_node); - ovsdb_jsonrpc_monitor_row_destroy(mt, row); - } - hmap_destroy(&mt->changes); - - free(mt->columns); - free(mt); - } - shash_destroy(&m->tables); - hmap_remove(&m->session->monitors, &m->node); - free(m); -} - -static const struct ovsdb_replica_class ovsdb_jsonrpc_replica_class = { - ovsdb_jsonrpc_monitor_commit, - ovsdb_jsonrpc_monitor_destroy -}; diff -Nru openvswitch-2.3.1/ovsdb/jsonrpc-server.h openvswitch-2.4.0~git20150623/ovsdb/jsonrpc-server.h --- openvswitch-2.3.1/ovsdb/jsonrpc-server.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/jsonrpc-server.h 2015-06-23 18:46:21.000000000 +0000 @@ -69,4 +69,7 @@ void ovsdb_jsonrpc_server_get_memory_usage(const struct ovsdb_jsonrpc_server *, struct simap *usage); +struct ovsdb_jsonrpc_monitor; +void ovsdb_jsonrpc_monitor_destroy(struct ovsdb_jsonrpc_monitor *); + #endif /* ovsdb/jsonrpc-server.h */ diff -Nru openvswitch-2.3.1/ovsdb/libovsdb.pc.in openvswitch-2.4.0~git20150623/ovsdb/libovsdb.pc.in --- openvswitch-2.3.1/ovsdb/libovsdb.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/libovsdb.pc.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libofproto +Description: OVSDB library of Open vSwitch +Version: @VERSION@ +Libs: -L${libdir} -lovsdb +Libs.private: @LIBS@ +Cflags: -I${includedir} diff -Nru openvswitch-2.3.1/ovsdb/libovsdb.sym.in openvswitch-2.4.0~git20150623/ovsdb/libovsdb.sym.in --- openvswitch-2.3.1/ovsdb/libovsdb.sym.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/libovsdb.sym.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,4 @@ +libovsdb_@LT_CURRENT@ { +global: + *; +}; diff -Nru openvswitch-2.3.1/ovsdb/log.h openvswitch-2.4.0~git20150623/ovsdb/log.h --- openvswitch-2.3.1/ovsdb/log.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/log.h 2015-06-23 18:46:21.000000000 +0000 @@ -31,17 +31,17 @@ struct ovsdb_error *ovsdb_log_open(const char *name, enum ovsdb_log_open_mode, int locking, struct ovsdb_log **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void ovsdb_log_close(struct ovsdb_log *); struct ovsdb_error *ovsdb_log_read(struct ovsdb_log *, struct json **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; void ovsdb_log_unread(struct ovsdb_log *); struct ovsdb_error *ovsdb_log_write(struct ovsdb_log *, struct json *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_log_commit(struct ovsdb_log *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; off_t ovsdb_log_get_offset(const struct ovsdb_log *); diff -Nru openvswitch-2.3.1/ovsdb/monitor.c openvswitch-2.4.0~git20150623/ovsdb/monitor.c --- openvswitch-2.3.1/ovsdb/monitor.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/monitor.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,951 @@ +/* + * Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include "bitmap.h" +#include "column.h" +#include "dynamic-string.h" +#include "json.h" +#include "jsonrpc.h" +#include "ovsdb-error.h" +#include "ovsdb-parser.h" +#include "ovsdb.h" +#include "row.h" +#include "simap.h" +#include "hash.h" +#include "table.h" +#include "hash.h" +#include "timeval.h" +#include "transaction.h" +#include "jsonrpc-server.h" +#include "monitor.h" +#include "openvswitch/vlog.h" + + +static const struct ovsdb_replica_class ovsdb_jsonrpc_replica_class; +static struct hmap ovsdb_monitors = HMAP_INITIALIZER(&ovsdb_monitors); + +/* Backend monitor. + * + * ovsdb_monitor keep track of the ovsdb changes. + */ + +/* A collection of tables being monitored. */ +struct ovsdb_monitor { + struct ovsdb_replica replica; + struct shash tables; /* Holds "struct ovsdb_monitor_table"s. */ + struct ovs_list jsonrpc_monitors; /* Contains "jsonrpc_monitor_node"s. */ + struct ovsdb *db; + uint64_t n_transactions; /* Count number of committed transactions. */ + struct hmap_node hmap_node; /* Elements within ovsdb_monitors. */ + struct hmap json_cache; /* Contains "ovsdb_monitor_json_cache_node"s.*/ +}; + +/* A json object of updates between 'from_txn' and 'dbmon->n_transactions' + * inclusive. */ +struct ovsdb_monitor_json_cache_node { + struct hmap_node hmap_node; /* Elements in json cache. */ + uint64_t from_txn; + struct json *json; /* Null, or a cloned of json */ +}; + +struct jsonrpc_monitor_node { + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor; + struct ovs_list node; +}; + +/* A particular column being monitored. */ +struct ovsdb_monitor_column { + const struct ovsdb_column *column; + enum ovsdb_monitor_selection select; +}; + +/* A row that has changed in a monitored table. */ +struct ovsdb_monitor_row { + struct hmap_node hmap_node; /* In ovsdb_jsonrpc_monitor_table.changes. */ + struct uuid uuid; /* UUID of row that changed. */ + struct ovsdb_datum *old; /* Old data, NULL for an inserted row. */ + struct ovsdb_datum *new; /* New data, NULL for a deleted row. */ +}; + +/* Contains 'struct ovsdb_monitor_row's for rows that have been + * updated but not yet flushed to all the jsonrpc connection. + * + * 'n_refs' represent the number of jsonrpc connections that have + * not received updates. Generate the update for the last jsonprc + * connection will also destroy the whole "struct ovsdb_monitor_changes" + * object. + * + * 'transaction' stores the first update's transaction id. + * */ +struct ovsdb_monitor_changes { + struct ovsdb_monitor_table *mt; + struct hmap rows; + int n_refs; + uint64_t transaction; + struct hmap_node hmap_node; /* Element in ovsdb_monitor_tables' changes + hmap. */ +}; + +/* A particular table being monitored. */ +struct ovsdb_monitor_table { + const struct ovsdb_table *table; + + /* This is the union (bitwise-OR) of the 'select' values in all of the + * members of 'columns' below. */ + enum ovsdb_monitor_selection select; + + /* Columns being monitored. */ + struct ovsdb_monitor_column *columns; + size_t n_columns; + + /* Contains 'ovsdb_monitor_changes' indexed by 'transaction'. */ + struct hmap changes; +}; + +static void ovsdb_monitor_destroy(struct ovsdb_monitor *dbmon); +static struct ovsdb_monitor_changes * ovsdb_monitor_table_add_changes( + struct ovsdb_monitor_table *mt, uint64_t next_txn); +static struct ovsdb_monitor_changes *ovsdb_monitor_table_find_changes( + struct ovsdb_monitor_table *mt, uint64_t unflushed); +static void ovsdb_monitor_changes_destroy( + struct ovsdb_monitor_changes *changes); +static void ovsdb_monitor_table_track_changes(struct ovsdb_monitor_table *mt, + uint64_t unflushed); + +static struct ovsdb_monitor_json_cache_node * +ovsdb_monitor_json_cache_search(const struct ovsdb_monitor *dbmon, + uint64_t from_txn) +{ + struct ovsdb_monitor_json_cache_node *node; + uint32_t hash = hash_uint64(from_txn); + + HMAP_FOR_EACH_WITH_HASH(node, hmap_node, hash, &dbmon->json_cache) { + if (node->from_txn == from_txn) { + return node; + } + } + + return NULL; +} + +static void +ovsdb_monitor_json_cache_insert(struct ovsdb_monitor *dbmon, + uint64_t from_txn, struct json *json) +{ + struct ovsdb_monitor_json_cache_node *node; + uint32_t hash; + + node = xmalloc(sizeof *node); + + hash = hash_uint64(from_txn); + node->from_txn = from_txn; + node->json = json ? json_clone(json) : NULL; + + hmap_insert(&dbmon->json_cache, &node->hmap_node, hash); +} + +static void +ovsdb_monitor_json_cache_flush(struct ovsdb_monitor *dbmon) +{ + struct ovsdb_monitor_json_cache_node *node, *next; + + HMAP_FOR_EACH_SAFE(node, next, hmap_node, &dbmon->json_cache) { + hmap_remove(&dbmon->json_cache, &node->hmap_node); + json_destroy(node->json); + free(node); + } +} + +static int +compare_ovsdb_monitor_column(const void *a_, const void *b_) +{ + const struct ovsdb_monitor_column *a = a_; + const struct ovsdb_monitor_column *b = b_; + + return a->column < b->column ? -1 : a->column > b->column; +} + +static struct ovsdb_monitor * +ovsdb_monitor_cast(struct ovsdb_replica *replica) +{ + ovs_assert(replica->class == &ovsdb_jsonrpc_replica_class); + return CONTAINER_OF(replica, struct ovsdb_monitor, replica); +} + +/* Finds and returns the ovsdb_monitor_row in 'mt->changes->rows' for the + * given 'uuid', or NULL if there is no such row. */ +static struct ovsdb_monitor_row * +ovsdb_monitor_changes_row_find(const struct ovsdb_monitor_changes *changes, + const struct uuid *uuid) +{ + struct ovsdb_monitor_row *row; + + HMAP_FOR_EACH_WITH_HASH (row, hmap_node, uuid_hash(uuid), + &changes->rows) { + if (uuid_equals(uuid, &row->uuid)) { + return row; + } + } + return NULL; +} + +/* Allocates an array of 'mt->n_columns' ovsdb_datums and initializes them as + * copies of the data in 'row' drawn from the columns represented by + * mt->columns[]. Returns the array. + * + * If 'row' is NULL, returns NULL. */ +static struct ovsdb_datum * +clone_monitor_row_data(const struct ovsdb_monitor_table *mt, + const struct ovsdb_row *row) +{ + struct ovsdb_datum *data; + size_t i; + + if (!row) { + return NULL; + } + + data = xmalloc(mt->n_columns * sizeof *data); + for (i = 0; i < mt->n_columns; i++) { + const struct ovsdb_column *c = mt->columns[i].column; + const struct ovsdb_datum *src = &row->fields[c->index]; + struct ovsdb_datum *dst = &data[i]; + const struct ovsdb_type *type = &c->type; + + ovsdb_datum_clone(dst, src, type); + } + return data; +} + +/* Replaces the mt->n_columns ovsdb_datums in row[] by copies of the data from + * in 'row' drawn from the columns represented by mt->columns[]. */ +static void +update_monitor_row_data(const struct ovsdb_monitor_table *mt, + const struct ovsdb_row *row, + struct ovsdb_datum *data) +{ + size_t i; + + for (i = 0; i < mt->n_columns; i++) { + const struct ovsdb_column *c = mt->columns[i].column; + const struct ovsdb_datum *src = &row->fields[c->index]; + struct ovsdb_datum *dst = &data[i]; + const struct ovsdb_type *type = &c->type; + + if (!ovsdb_datum_equals(src, dst, type)) { + ovsdb_datum_destroy(dst, type); + ovsdb_datum_clone(dst, src, type); + } + } +} + +/* Frees all of the mt->n_columns ovsdb_datums in data[], using the types taken + * from mt->columns[], plus 'data' itself. */ +static void +free_monitor_row_data(const struct ovsdb_monitor_table *mt, + struct ovsdb_datum *data) +{ + if (data) { + size_t i; + + for (i = 0; i < mt->n_columns; i++) { + const struct ovsdb_column *c = mt->columns[i].column; + + ovsdb_datum_destroy(&data[i], &c->type); + } + free(data); + } +} + +/* Frees 'row', which must have been created from 'mt'. */ +static void +ovsdb_monitor_row_destroy(const struct ovsdb_monitor_table *mt, + struct ovsdb_monitor_row *row) +{ + if (row) { + free_monitor_row_data(mt, row->old); + free_monitor_row_data(mt, row->new); + free(row); + } +} + +void +ovsdb_monitor_add_jsonrpc_monitor(struct ovsdb_monitor *dbmon, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor) +{ + struct jsonrpc_monitor_node *jm; + + jm = xzalloc(sizeof *jm); + jm->jsonrpc_monitor = jsonrpc_monitor; + list_push_back(&dbmon->jsonrpc_monitors, &jm->node); +} + +struct ovsdb_monitor * +ovsdb_monitor_create(struct ovsdb *db, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor) +{ + struct ovsdb_monitor *dbmon; + + dbmon = xzalloc(sizeof *dbmon); + + ovsdb_replica_init(&dbmon->replica, &ovsdb_jsonrpc_replica_class); + ovsdb_add_replica(db, &dbmon->replica); + list_init(&dbmon->jsonrpc_monitors); + dbmon->db = db; + dbmon->n_transactions = 0; + shash_init(&dbmon->tables); + hmap_node_nullify(&dbmon->hmap_node); + hmap_init(&dbmon->json_cache); + + ovsdb_monitor_add_jsonrpc_monitor(dbmon, jsonrpc_monitor); + return dbmon; +} + +void +ovsdb_monitor_add_table(struct ovsdb_monitor *m, + const struct ovsdb_table *table) +{ + struct ovsdb_monitor_table *mt; + + mt = xzalloc(sizeof *mt); + mt->table = table; + shash_add(&m->tables, table->schema->name, mt); + hmap_init(&mt->changes); +} + +void +ovsdb_monitor_add_column(struct ovsdb_monitor *dbmon, + const struct ovsdb_table *table, + const struct ovsdb_column *column, + enum ovsdb_monitor_selection select, + size_t *allocated_columns) +{ + struct ovsdb_monitor_table *mt; + struct ovsdb_monitor_column *c; + + mt = shash_find_data(&dbmon->tables, table->schema->name); + + if (mt->n_columns >= *allocated_columns) { + mt->columns = x2nrealloc(mt->columns, allocated_columns, + sizeof *mt->columns); + } + + mt->select |= select; + c = &mt->columns[mt->n_columns++]; + c->column = column; + c->select = select; +} + +/* Check for duplicated column names. Return the first + * duplicated column's name if found. Otherwise return + * NULL. */ +const char * OVS_WARN_UNUSED_RESULT +ovsdb_monitor_table_check_duplicates(struct ovsdb_monitor *m, + const struct ovsdb_table *table) +{ + struct ovsdb_monitor_table *mt; + int i; + + mt = shash_find_data(&m->tables, table->schema->name); + + if (mt) { + /* Check for duplicate columns. */ + qsort(mt->columns, mt->n_columns, sizeof *mt->columns, + compare_ovsdb_monitor_column); + for (i = 1; i < mt->n_columns; i++) { + if (mt->columns[i].column == mt->columns[i - 1].column) { + return mt->columns[i].column->name; + } + } + } + + return NULL; +} + +static struct ovsdb_monitor_changes * +ovsdb_monitor_table_add_changes(struct ovsdb_monitor_table *mt, + uint64_t next_txn) +{ + struct ovsdb_monitor_changes *changes; + + changes = xzalloc(sizeof *changes); + + changes->transaction = next_txn; + changes->mt = mt; + changes->n_refs = 1; + hmap_init(&changes->rows); + hmap_insert(&mt->changes, &changes->hmap_node, hash_uint64(next_txn)); + + return changes; +}; + +static struct ovsdb_monitor_changes * +ovsdb_monitor_table_find_changes(struct ovsdb_monitor_table *mt, + uint64_t transaction) +{ + struct ovsdb_monitor_changes *changes; + size_t hash = hash_uint64(transaction); + + HMAP_FOR_EACH_WITH_HASH(changes, hmap_node, hash, &mt->changes) { + if (changes->transaction == transaction) { + return changes; + } + } + + return NULL; +} + +/* Stop currently tracking changes to table 'mt' since 'transaction'. + * + * Return 'true' if the 'transaction' is being tracked. 'false' otherwise. */ +static void +ovsdb_monitor_table_untrack_changes(struct ovsdb_monitor_table *mt, + uint64_t transaction) +{ + struct ovsdb_monitor_changes *changes = + ovsdb_monitor_table_find_changes(mt, transaction); + if (changes) { + if (--changes->n_refs == 0) { + hmap_remove(&mt->changes, &changes->hmap_node); + ovsdb_monitor_changes_destroy(changes); + } + } +} + +/* Start tracking changes to table 'mt' begins from 'transaction' inclusive. + */ +static void +ovsdb_monitor_table_track_changes(struct ovsdb_monitor_table *mt, + uint64_t transaction) +{ + struct ovsdb_monitor_changes *changes; + + changes = ovsdb_monitor_table_find_changes(mt, transaction); + if (changes) { + changes->n_refs++; + } else { + ovsdb_monitor_table_add_changes(mt, transaction); + } +} + +static void +ovsdb_monitor_changes_destroy(struct ovsdb_monitor_changes *changes) +{ + struct ovsdb_monitor_row *row, *next; + + HMAP_FOR_EACH_SAFE (row, next, hmap_node, &changes->rows) { + hmap_remove(&changes->rows, &row->hmap_node); + ovsdb_monitor_row_destroy(changes->mt, row); + } + hmap_destroy(&changes->rows); + free(changes); +} + +/* Returns JSON for a (as described in RFC 7047) for 'row' within + * 'mt', or NULL if no row update should be sent. + * + * The caller should specify 'initial' as true if the returned JSON is going to + * be used as part of the initial reply to a "monitor" request, false if it is + * going to be used as part of an "update" notification. + * + * 'changed' must be a scratch buffer for internal use that is at least + * bitmap_n_bytes(mt->n_columns) bytes long. */ +static struct json * +ovsdb_monitor_compose_row_update( + const struct ovsdb_monitor_table *mt, + const struct ovsdb_monitor_row *row, + bool initial, unsigned long int *changed) +{ + enum ovsdb_monitor_selection type; + struct json *old_json, *new_json; + struct json *row_json; + size_t i; + + type = (initial ? OJMS_INITIAL + : !row->old ? OJMS_INSERT + : !row->new ? OJMS_DELETE + : OJMS_MODIFY); + if (!(mt->select & type)) { + return NULL; + } + + if (type == OJMS_MODIFY) { + size_t n_changes; + + n_changes = 0; + memset(changed, 0, bitmap_n_bytes(mt->n_columns)); + for (i = 0; i < mt->n_columns; i++) { + const struct ovsdb_column *c = mt->columns[i].column; + if (!ovsdb_datum_equals(&row->old[i], &row->new[i], &c->type)) { + bitmap_set1(changed, i); + n_changes++; + } + } + if (!n_changes) { + /* No actual changes: presumably a row changed and then + * changed back later. */ + return NULL; + } + } + + row_json = json_object_create(); + old_json = new_json = NULL; + if (type & (OJMS_DELETE | OJMS_MODIFY)) { + old_json = json_object_create(); + json_object_put(row_json, "old", old_json); + } + if (type & (OJMS_INITIAL | OJMS_INSERT | OJMS_MODIFY)) { + new_json = json_object_create(); + json_object_put(row_json, "new", new_json); + } + for (i = 0; i < mt->n_columns; i++) { + const struct ovsdb_monitor_column *c = &mt->columns[i]; + + if (!(type & c->select)) { + /* We don't care about this type of change for this + * particular column (but we will care about it for some + * other column). */ + continue; + } + + if ((type == OJMS_MODIFY && bitmap_is_set(changed, i)) + || type == OJMS_DELETE) { + json_object_put(old_json, c->column->name, + ovsdb_datum_to_json(&row->old[i], + &c->column->type)); + } + if (type & (OJMS_INITIAL | OJMS_INSERT | OJMS_MODIFY)) { + json_object_put(new_json, c->column->name, + ovsdb_datum_to_json(&row->new[i], + &c->column->type)); + } + } + + return row_json; +} + +/* Constructs and returns JSON for a object (as described in + * RFC 7047) for all the outstanding changes within 'monitor', starting from + * 'transaction'. */ +static struct json* +ovsdb_monitor_compose_update(struct ovsdb_monitor *dbmon, + bool initial, uint64_t transaction) +{ + struct shash_node *node; + unsigned long int *changed; + struct json *json; + size_t max_columns; + + max_columns = 0; + SHASH_FOR_EACH (node, &dbmon->tables) { + struct ovsdb_monitor_table *mt = node->data; + + max_columns = MAX(max_columns, mt->n_columns); + } + changed = xmalloc(bitmap_n_bytes(max_columns)); + + json = NULL; + SHASH_FOR_EACH (node, &dbmon->tables) { + struct ovsdb_monitor_table *mt = node->data; + struct ovsdb_monitor_row *row, *next; + struct ovsdb_monitor_changes *changes; + struct json *table_json = NULL; + + changes = ovsdb_monitor_table_find_changes(mt, transaction); + if (!changes) { + continue; + } + + HMAP_FOR_EACH_SAFE (row, next, hmap_node, &changes->rows) { + struct json *row_json; + + row_json = ovsdb_monitor_compose_row_update( + mt, row, initial, changed); + if (row_json) { + char uuid[UUID_LEN + 1]; + + /* Create JSON object for transaction overall. */ + if (!json) { + json = json_object_create(); + } + + /* Create JSON object for transaction on this table. */ + if (!table_json) { + table_json = json_object_create(); + json_object_put(json, mt->table->schema->name, table_json); + } + + /* Add JSON row to JSON table. */ + snprintf(uuid, sizeof uuid, UUID_FMT, UUID_ARGS(&row->uuid)); + json_object_put(table_json, uuid, row_json); + } + } + } + free(changed); + + return json; +} + +/* Returns JSON for a object (as described in RFC 7047) + * for all the outstanding changes within 'monitor' that starts from + * '*unflushed' transaction id. + * + * The caller should specify 'initial' as true if the returned JSON is going to + * be used as part of the initial reply to a "monitor" request, false if it is + * going to be used as part of an "update" notification. */ +struct json * +ovsdb_monitor_get_update(struct ovsdb_monitor *dbmon, + bool initial, uint64_t *unflushed) +{ + struct ovsdb_monitor_json_cache_node *cache_node; + struct shash_node *node; + struct json *json; + uint64_t prev_txn = *unflushed; + uint64_t next_txn = dbmon->n_transactions + 1; + + /* Return a clone of cached json if one exists. Otherwise, + * generate a new one and add it to the cache. */ + cache_node = ovsdb_monitor_json_cache_search(dbmon, prev_txn); + if (cache_node) { + json = cache_node->json ? json_clone(cache_node->json) : NULL; + } else { + json = ovsdb_monitor_compose_update(dbmon, initial, prev_txn); + ovsdb_monitor_json_cache_insert(dbmon, prev_txn, json); + } + + /* Maintain transaction id of 'changes'. */ + SHASH_FOR_EACH (node, &dbmon->tables) { + struct ovsdb_monitor_table *mt = node->data; + + ovsdb_monitor_table_untrack_changes(mt, prev_txn); + ovsdb_monitor_table_track_changes(mt, next_txn); + } + *unflushed = next_txn; + + return json; +} + +bool +ovsdb_monitor_needs_flush(struct ovsdb_monitor *dbmon, + uint64_t next_transaction) +{ + ovs_assert(next_transaction <= dbmon->n_transactions + 1); + return (next_transaction <= dbmon->n_transactions); +} + +void +ovsdb_monitor_table_add_select(struct ovsdb_monitor *dbmon, + const struct ovsdb_table *table, + enum ovsdb_monitor_selection select) +{ + struct ovsdb_monitor_table * mt; + + mt = shash_find_data(&dbmon->tables, table->schema->name); + mt->select |= select; +} + +struct ovsdb_monitor_aux { + const struct ovsdb_monitor *monitor; + struct ovsdb_monitor_table *mt; +}; + +static void +ovsdb_monitor_init_aux(struct ovsdb_monitor_aux *aux, + const struct ovsdb_monitor *m) +{ + aux->monitor = m; + aux->mt = NULL; +} + +static void +ovsdb_monitor_changes_update(const struct ovsdb_row *old, + const struct ovsdb_row *new, + const struct ovsdb_monitor_table *mt, + struct ovsdb_monitor_changes *changes) +{ + const struct uuid *uuid = ovsdb_row_get_uuid(new ? new : old); + struct ovsdb_monitor_row *change; + + change = ovsdb_monitor_changes_row_find(changes, uuid); + if (!change) { + change = xzalloc(sizeof *change); + hmap_insert(&changes->rows, &change->hmap_node, uuid_hash(uuid)); + change->uuid = *uuid; + change->old = clone_monitor_row_data(mt, old); + change->new = clone_monitor_row_data(mt, new); + } else { + if (new) { + update_monitor_row_data(mt, new, change->new); + } else { + free_monitor_row_data(mt, change->new); + change->new = NULL; + + if (!change->old) { + /* This row was added then deleted. Forget about it. */ + hmap_remove(&changes->rows, &change->hmap_node); + free(change); + } + } + } +} + +static bool +ovsdb_monitor_change_cb(const struct ovsdb_row *old, + const struct ovsdb_row *new, + const unsigned long int *changed OVS_UNUSED, + void *aux_) +{ + struct ovsdb_monitor_aux *aux = aux_; + const struct ovsdb_monitor *m = aux->monitor; + struct ovsdb_table *table = new ? new->table : old->table; + struct ovsdb_monitor_table *mt; + struct ovsdb_monitor_changes *changes; + + if (!aux->mt || table != aux->mt->table) { + aux->mt = shash_find_data(&m->tables, table->schema->name); + if (!aux->mt) { + /* We don't care about rows in this table at all. Tell the caller + * to skip it. */ + return false; + } + } + mt = aux->mt; + + HMAP_FOR_EACH(changes, hmap_node, &mt->changes) { + ovsdb_monitor_changes_update(old, new, mt, changes); + } + return true; +} + +void +ovsdb_monitor_get_initial(const struct ovsdb_monitor *dbmon) +{ + struct ovsdb_monitor_aux aux; + struct shash_node *node; + + ovsdb_monitor_init_aux(&aux, dbmon); + SHASH_FOR_EACH (node, &dbmon->tables) { + struct ovsdb_monitor_table *mt = node->data; + + if (mt->select & OJMS_INITIAL) { + struct ovsdb_row *row; + struct ovsdb_monitor_changes *changes; + + changes = ovsdb_monitor_table_find_changes(mt, 0); + if (!changes) { + changes = ovsdb_monitor_table_add_changes(mt, 0); + HMAP_FOR_EACH (row, hmap_node, &mt->table->rows) { + ovsdb_monitor_changes_update(NULL, row, mt, changes); + } + } else { + changes->n_refs++; + } + } + } +} + +void +ovsdb_monitor_remove_jsonrpc_monitor(struct ovsdb_monitor *dbmon, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor) +{ + struct jsonrpc_monitor_node *jm; + + if (list_is_empty(&dbmon->jsonrpc_monitors)) { + ovsdb_monitor_destroy(dbmon); + return; + } + + /* Find and remove the jsonrpc monitor from the list. */ + LIST_FOR_EACH(jm, node, &dbmon->jsonrpc_monitors) { + if (jm->jsonrpc_monitor == jsonrpc_monitor) { + list_remove(&jm->node); + free(jm); + + /* Destroy ovsdb monitor if this is the last user. */ + if (list_is_empty(&dbmon->jsonrpc_monitors)) { + ovsdb_monitor_destroy(dbmon); + } + + return; + }; + } + + /* Should never reach here. jsonrpc_monitor should be on the list. */ + OVS_NOT_REACHED(); +} + +static bool +ovsdb_monitor_table_equal(const struct ovsdb_monitor_table *a, + const struct ovsdb_monitor_table *b) +{ + size_t i; + + if ((a->table != b->table) || + (a->select != b->select) || + (a->n_columns != b->n_columns)) { + return false; + } + + for (i = 0; i < a->n_columns; i++) { + if ((a->columns[i].column != b->columns[i].column) || + (a->columns[i].select != b->columns[i].select)) { + return false; + } + } + + return true; +} + +static bool +ovsdb_monitor_equal(const struct ovsdb_monitor *a, + const struct ovsdb_monitor *b) +{ + struct shash_node *node; + + if (shash_count(&a->tables) != shash_count(&b->tables)) { + return false; + } + + SHASH_FOR_EACH(node, &a->tables) { + const struct ovsdb_monitor_table *mta = node->data; + const struct ovsdb_monitor_table *mtb; + + mtb = shash_find_data(&b->tables, node->name); + if (!mtb) { + return false; + } + + if (!ovsdb_monitor_table_equal(mta, mtb)) { + return false; + } + } + + return true; +} + +static size_t +ovsdb_monitor_hash(const struct ovsdb_monitor *dbmon, size_t basis) +{ + const struct shash_node **nodes; + size_t i, j, n; + + nodes = shash_sort(&dbmon->tables); + n = shash_count(&dbmon->tables); + + for (i = 0; i < n; i++) { + struct ovsdb_monitor_table *mt = nodes[i]->data; + + basis = hash_pointer(mt->table, basis); + basis = hash_3words(mt->select, mt->n_columns, basis); + + for (j = 0; j < mt->n_columns; j++) { + basis = hash_pointer(mt->columns[j].column, basis); + basis = hash_2words(mt->columns[j].select, basis); + } + } + free(nodes); + + return basis; +} + +struct ovsdb_monitor * +ovsdb_monitor_add(struct ovsdb_monitor *new_dbmon) +{ + struct ovsdb_monitor *dbmon; + size_t hash; + + /* New_dbmon should be associated with only one jsonrpc + * connections. */ + ovs_assert(list_is_singleton(&new_dbmon->jsonrpc_monitors)); + + hash = ovsdb_monitor_hash(new_dbmon, 0); + HMAP_FOR_EACH_WITH_HASH(dbmon, hmap_node, hash, &ovsdb_monitors) { + if (ovsdb_monitor_equal(dbmon, new_dbmon)) { + return dbmon; + } + } + + hmap_insert(&ovsdb_monitors, &new_dbmon->hmap_node, hash); + return new_dbmon; +} + +static void +ovsdb_monitor_destroy(struct ovsdb_monitor *dbmon) +{ + struct shash_node *node; + + list_remove(&dbmon->replica.node); + + if (!hmap_node_is_null(&dbmon->hmap_node)) { + hmap_remove(&ovsdb_monitors, &dbmon->hmap_node); + } + + ovsdb_monitor_json_cache_flush(dbmon); + hmap_destroy(&dbmon->json_cache); + + SHASH_FOR_EACH (node, &dbmon->tables) { + struct ovsdb_monitor_table *mt = node->data; + struct ovsdb_monitor_changes *changes, *next; + + HMAP_FOR_EACH_SAFE (changes, next, hmap_node, &mt->changes) { + hmap_remove(&mt->changes, &changes->hmap_node); + ovsdb_monitor_changes_destroy(changes); + } + free(mt->columns); + free(mt); + } + shash_destroy(&dbmon->tables); + free(dbmon); +} + +static struct ovsdb_error * +ovsdb_monitor_commit(struct ovsdb_replica *replica, + const struct ovsdb_txn *txn, + bool durable OVS_UNUSED) +{ + struct ovsdb_monitor *m = ovsdb_monitor_cast(replica); + struct ovsdb_monitor_aux aux; + + ovsdb_monitor_json_cache_flush(m); + ovsdb_monitor_init_aux(&aux, m); + ovsdb_txn_for_each_change(txn, ovsdb_monitor_change_cb, &aux); + m->n_transactions++; + + return NULL; +} + +static void +ovsdb_monitor_destroy_callback(struct ovsdb_replica *replica) +{ + struct ovsdb_monitor *dbmon = ovsdb_monitor_cast(replica); + struct jsonrpc_monitor_node *jm, *next; + + /* Delete all front end monitors. Removing the last front + * end monitor will also destroy the corresponding 'ovsdb_monitor'. + * ovsdb monitor will also be destroied. */ + LIST_FOR_EACH_SAFE(jm, next, node, &dbmon->jsonrpc_monitors) { + ovsdb_jsonrpc_monitor_destroy(jm->jsonrpc_monitor); + } +} + +static const struct ovsdb_replica_class ovsdb_jsonrpc_replica_class = { + ovsdb_monitor_commit, + ovsdb_monitor_destroy_callback, +}; diff -Nru openvswitch-2.3.1/ovsdb/monitor.h openvswitch-2.4.0~git20150623/ovsdb/monitor.h --- openvswitch-2.3.1/ovsdb/monitor.h 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/monitor.h 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2015 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OVSDB_MONITOR_H +#define OVSDB_MONITOR_H + +struct ovsdb_monitor; + +enum ovsdb_monitor_selection { + OJMS_INITIAL = 1 << 0, /* All rows when monitor is created. */ + OJMS_INSERT = 1 << 1, /* New rows. */ + OJMS_DELETE = 1 << 2, /* Deleted rows. */ + OJMS_MODIFY = 1 << 3 /* Modified rows. */ +}; + + +struct ovsdb_monitor *ovsdb_monitor_create(struct ovsdb *db, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); + +struct ovsdb_monitor *ovsdb_monitor_add(struct ovsdb_monitor *dbmon); + +void ovsdb_monitor_add_jsonrpc_monitor(struct ovsdb_monitor *dbmon, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); + +void ovsdb_monitor_remove_jsonrpc_monitor(struct ovsdb_monitor *dbmon, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); + +void ovsdb_monitor_remove_jsonrpc_monitor(struct ovsdb_monitor *dbmon, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); + +void ovsdb_monitor_add_table(struct ovsdb_monitor *m, + const struct ovsdb_table *table); + +void ovsdb_monitor_add_column(struct ovsdb_monitor *dbmon, + const struct ovsdb_table *table, + const struct ovsdb_column *column, + enum ovsdb_monitor_selection select, + size_t *allocated_columns); + +const char * OVS_WARN_UNUSED_RESULT +ovsdb_monitor_table_check_duplicates(struct ovsdb_monitor *, + const struct ovsdb_table *); + +struct json *ovsdb_monitor_get_update(struct ovsdb_monitor *dbmon, + bool initial, uint64_t *unflushed_transaction); + +void ovsdb_monitor_table_add_select(struct ovsdb_monitor *dbmon, + const struct ovsdb_table *table, + enum ovsdb_monitor_selection select); + +bool ovsdb_monitor_needs_flush(struct ovsdb_monitor *dbmon, + uint64_t next_transaction); + +void ovsdb_monitor_get_initial(const struct ovsdb_monitor *dbmon); +#endif diff -Nru openvswitch-2.3.1/ovsdb/mutation.c openvswitch-2.4.0~git20150623/ovsdb/mutation.c --- openvswitch-2.3.1/ovsdb/mutation.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/mutation.c 2015-06-23 18:46:21.000000000 +0000 @@ -53,7 +53,7 @@ return NULL; } -static WARN_UNUSED_RESULT struct ovsdb_error * +static OVS_WARN_UNUSED_RESULT struct ovsdb_error * type_mismatch(const struct ovsdb_mutation *m, const struct json *json) { struct ovsdb_error *error; @@ -69,7 +69,7 @@ return error; } -static WARN_UNUSED_RESULT struct ovsdb_error * +static OVS_WARN_UNUSED_RESULT struct ovsdb_error * ovsdb_mutation_from_json(const struct ovsdb_table_schema *ts, const struct json *json, struct ovsdb_symbol_table *symtab, diff -Nru openvswitch-2.3.1/ovsdb/mutation.h openvswitch-2.4.0~git20150623/ovsdb/mutation.h --- openvswitch-2.3.1/ovsdb/mutation.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/mutation.h 2015-06-23 18:46:21.000000000 +0000 @@ -43,7 +43,7 @@ struct ovsdb_error *ovsdb_mutator_from_string(const char *, enum ovsdb_mutator *) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; const char *ovsdb_mutator_to_string(enum ovsdb_mutator); struct ovsdb_mutation { @@ -63,10 +63,10 @@ struct ovsdb_error *ovsdb_mutation_set_from_json( const struct ovsdb_table_schema *, const struct json *, struct ovsdb_symbol_table *, - struct ovsdb_mutation_set *) WARN_UNUSED_RESULT; + struct ovsdb_mutation_set *) OVS_WARN_UNUSED_RESULT; struct json *ovsdb_mutation_set_to_json(const struct ovsdb_mutation_set *); void ovsdb_mutation_set_destroy(struct ovsdb_mutation_set *); struct ovsdb_error *ovsdb_mutation_set_execute( - struct ovsdb_row *, const struct ovsdb_mutation_set *) WARN_UNUSED_RESULT; + struct ovsdb_row *, const struct ovsdb_mutation_set *) OVS_WARN_UNUSED_RESULT; #endif /* ovsdb/mutation.h */ diff -Nru openvswitch-2.3.1/ovsdb/ovsdb.c openvswitch-2.4.0~git20150623/ovsdb/ovsdb.c --- openvswitch-2.3.1/ovsdb/ovsdb.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb.c 2015-06-23 18:46:21.000000000 +0000 @@ -103,7 +103,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT ovsdb_schema_check_ref_table(struct ovsdb_column *column, const struct shash *tables, const struct ovsdb_base_type *base, diff -Nru openvswitch-2.3.1/ovsdb/ovsdb-client.c openvswitch-2.4.0~git20150623/ovsdb/ovsdb-client.c --- openvswitch-2.3.1/ovsdb/ovsdb-client.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb-client.c 2015-06-23 18:46:21.000000000 +0000 @@ -47,7 +47,7 @@ #include "timeval.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovsdb_client); @@ -74,7 +74,7 @@ static const struct ovsdb_client_command *get_all_commands(void); -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[]); static struct jsonrpc *open_jsonrpc(const char *server); static void fetch_dbs(struct jsonrpc *, struct svec *dbs); @@ -86,7 +86,7 @@ const char *database; struct jsonrpc *rpc; - proctitle_init(argc, argv); + ovs_cmdl_proctitle_init(argc, argv); set_program_name(argv[0]); parse_options(argc, argv); fatal_ignore_sigpipe(); @@ -183,7 +183,7 @@ TABLE_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { int c; diff -Nru openvswitch-2.3.1/ovsdb/ovsdb-doc openvswitch-2.4.0~git20150623/ovsdb/ovsdb-doc --- openvswitch-2.3.1/ovsdb/ovsdb-doc 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb-doc 2015-06-23 18:46:21.000000000 +0000 @@ -1,9 +1,22 @@ #! /usr/bin/python +# Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from datetime import date import getopt import os -import re import sys import xml.dom.minidom @@ -11,136 +24,9 @@ from ovs.db import error import ovs.db.schema -argv0 = sys.argv[0] - -def textToNroff(s, font=r'\fR'): - def escape(match): - c = match.group(0) - if c.startswith('-'): - if c != '-' or font == r'\fB': - return '\\' + c - else: - return '-' - if c == '\\': - return r'\e' - elif c == '"': - return r'\(dq' - elif c == "'": - return r'\(cq' - else: - raise error.Error("bad escape") - - # Escape - \ " ' as needed by nroff. - s = re.sub('(-[0-9]|[-"\'\\\\])', escape, s) - if s.startswith('.'): - s = '\\' + s - return s - -def escapeNroffLiteral(s): - return r'\fB%s\fR' % textToNroff(s, r'\fB') - -def inlineXmlToNroff(node, font): - if node.nodeType == node.TEXT_NODE: - return textToNroff(node.data, font) - elif node.nodeType == node.ELEMENT_NODE: - if node.tagName in ['code', 'em', 'option']: - s = r'\fB' - for child in node.childNodes: - s += inlineXmlToNroff(child, r'\fB') - return s + font - elif node.tagName == 'ref': - s = r'\fB' - if node.hasAttribute('column'): - s += node.attributes['column'].nodeValue - if node.hasAttribute('key'): - s += ':' + node.attributes['key'].nodeValue - elif node.hasAttribute('table'): - s += node.attributes['table'].nodeValue - elif node.hasAttribute('group'): - s += node.attributes['group'].nodeValue - else: - raise error.Error("'ref' lacks required attributes: %s" % node.attributes.keys()) - return s + font - elif node.tagName == 'var': - s = r'\fI' - for child in node.childNodes: - s += inlineXmlToNroff(child, r'\fI') - return s + font - else: - raise error.Error("element <%s> unknown or invalid here" % node.tagName) - else: - raise error.Error("unknown node %s in inline xml" % node) +from build.nroff import * -def blockXmlToNroff(nodes, para='.PP'): - s = '' - for node in nodes: - if node.nodeType == node.TEXT_NODE: - s += textToNroff(node.data) - s = s.lstrip() - elif node.nodeType == node.ELEMENT_NODE: - if node.tagName in ['ul', 'ol']: - if s != "": - s += "\n" - s += ".RS\n" - i = 0 - for liNode in node.childNodes: - if (liNode.nodeType == node.ELEMENT_NODE - and liNode.tagName == 'li'): - i += 1 - if node.tagName == 'ul': - s += ".IP \\(bu\n" - else: - s += ".IP %d. .25in\n" % i - s += blockXmlToNroff(liNode.childNodes, ".IP") - elif (liNode.nodeType != node.TEXT_NODE - or not liNode.data.isspace()): - raise error.Error("<%s> element may only have
  • children" % node.tagName) - s += ".RE\n" - elif node.tagName == 'dl': - if s != "": - s += "\n" - s += ".RS\n" - prev = "dd" - for liNode in node.childNodes: - if (liNode.nodeType == node.ELEMENT_NODE - and liNode.tagName == 'dt'): - if prev == 'dd': - s += '.TP\n' - else: - s += '.TQ\n' - prev = 'dt' - elif (liNode.nodeType == node.ELEMENT_NODE - and liNode.tagName == 'dd'): - if prev == 'dd': - s += '.IP\n' - prev = 'dd' - elif (liNode.nodeType != node.TEXT_NODE - or not liNode.data.isspace()): - raise error.Error("
    element may only have
    and
    children") - s += blockXmlToNroff(liNode.childNodes, ".IP") - s += ".RE\n" - elif node.tagName == 'p': - if s != "": - if not s.endswith("\n"): - s += "\n" - s += para + "\n" - s += blockXmlToNroff(node.childNodes, para) - elif node.tagName in ('h1', 'h2', 'h3'): - if s != "": - if not s.endswith("\n"): - s += "\n" - nroffTag = {'h1': 'SH', 'h2': 'SS', 'h3': 'ST'}[node.tagName] - s += ".%s " % nroffTag - for child_node in node.childNodes: - s += inlineXmlToNroff(child_node, r'\fR') - s += "\n" - else: - s += inlineXmlToNroff(node, r'\fR') - else: - raise error.Error("unknown node %s in block xml" % node) - if s != "" and not s.endswith('\n'): - s += '\n' - return s +argv0 = sys.argv[0] def typeAndConstraintsToNroff(column): type = column.type.toEnglish(escapeNroffLiteral) @@ -152,7 +38,7 @@ type += " (must be unique within table)" return type -def columnGroupToNroff(table, groupXml): +def columnGroupToNroff(table, groupXml, documented_columns): introNodes = [] columnNodes = [] for node in groupXml.childNodes: @@ -172,6 +58,7 @@ for node in columnNodes: if node.tagName == 'column': name = node.attributes['name'].nodeValue + documented_columns.add(name) column = table.columns[name] if node.hasAttribute('key'): key = node.attributes['key'].nodeValue @@ -219,7 +106,8 @@ summary += [('column', nameNroff, typeNroff)] elif node.tagName == 'group': title = node.attributes["title"].nodeValue - subSummary, subIntro, subBody = columnGroupToNroff(table, node) + subSummary, subIntro, subBody = columnGroupToNroff( + table, node, documented_columns) summary += [('group', title, subSummary)] body += '.ST "%s:"\n' % textToNroff(title) body += subIntro + subBody @@ -242,18 +130,27 @@ tableName = tableXml.attributes['name'].nodeValue table = schema.tables[tableName] + documented_columns = set() s = """.bp .SH "%s TABLE" """ % tableName - summary, intro, body = columnGroupToNroff(table, tableXml) + summary, intro, body = columnGroupToNroff(table, tableXml, + documented_columns) s += intro s += '.SS "Summary:\n' s += tableSummaryToNroff(summary) s += '.SS "Details:\n' s += body + + schema_columns = set(table.columns.keys()) + undocumented_columns = schema_columns - documented_columns + for column in undocumented_columns: + raise error.Error("table %s has undocumented column %s" + % (tableName, column)) + return s -def docsToNroff(schemaFile, xmlFile, erFile, title=None, version=None): +def docsToNroff(schemaFile, xmlFile, erFile, version=None): schema = ovs.db.schema.DbSchema.from_json(ovs.json.from_file(schemaFile)) doc = xml.dom.minidom.parse(xmlFile).documentElement @@ -261,8 +158,10 @@ xmlDate = os.stat(xmlFile).st_mtime d = date.fromtimestamp(max(schemaDate, xmlDate)) - if title == None: - title = schema.name + if doc.hasAttribute('name'): + manpage = doc.attributes['name'].nodeValue + else: + manpage = schema.name if version == None: version = "UNKNOWN" @@ -270,8 +169,9 @@ # Putting '\" p as the first line tells "man" that the manpage # needs to be preprocessed by "pic". s = r''''\" p -.TH "%s" 5 " DB Schema %s" "Open vSwitch %s" "Open vSwitch Manual" .\" -*- nroff -*- +.TH "%s" 5 " DB Schema %s" "Open vSwitch %s" "Open vSwitch Manual" +.fp 5 L CR \\" Make fixed-width font available as \\fL. .de TQ . br . ns @@ -286,7 +186,7 @@ .SH NAME %s \- %s database schema .PP -''' % (title, schema.version, version, textToNroff(schema.name), schema.name) +''' % (manpage, schema.version, version, textToNroff(manpage), schema.name) tables = "" introNodes = [] @@ -306,6 +206,12 @@ else: introNodes += [dbNode] + documented_tables = set((name for (name, title) in summary)) + schema_tables = set(schema.tables.keys()) + undocumented_tables = schema_tables - documented_tables + for table in undocumented_tables: + raise error.Error("undocumented table %s" % table) + s += blockXmlToNroff(introNodes) + "\n" s += r""" @@ -361,7 +267,6 @@ The following options are also available: --er-diagram=DIAGRAM.PIC include E-R diagram from DIAGRAM.PIC - --title=TITLE use TITLE as title instead of schema name --version=VERSION use VERSION to display on document footer -h, --help display this help message\ """ % {'argv0': argv0} @@ -371,20 +276,17 @@ try: try: options, args = getopt.gnu_getopt(sys.argv[1:], 'hV', - ['er-diagram=', 'title=', + ['er-diagram=', 'version=', 'help']) except getopt.GetoptError, geo: sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) sys.exit(1) er_diagram = None - title = None version = None for key, value in options: if key == '--er-diagram': er_diagram = value - elif key == '--title': - title = value elif key == '--version': version = value elif key in ['-h', '--help']: @@ -398,7 +300,7 @@ sys.exit(1) # XXX we should warn about undocumented tables or columns - s = docsToNroff(args[0], args[1], er_diagram, title, version) + s = docsToNroff(args[0], args[1], er_diagram, version) for line in s.split("\n"): line = line.strip() if len(line): diff -Nru openvswitch-2.3.1/ovsdb/ovsdb-dot.in openvswitch-2.4.0~git20150623/ovsdb/ovsdb-dot.in --- openvswitch-2.3.1/ovsdb/ovsdb-dot.in 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb-dot.in 2015-06-23 18:46:21.000000000 +0000 @@ -30,7 +30,6 @@ options = {} options['label'] = '"%s%s"' % (label, arity) if baseType.ref_type == 'weak': - options['constraint'] = 'false' options['style'] = 'dotted' print "\t%s -> %s [%s];" % ( tableName, diff -Nru openvswitch-2.3.1/ovsdb/ovsdb.h openvswitch-2.4.0~git20150623/ovsdb/ovsdb.h --- openvswitch-2.3.1/ovsdb/ovsdb.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb.h 2015-06-23 18:46:21.000000000 +0000 @@ -44,10 +44,10 @@ struct ovsdb_error *ovsdb_schema_from_file(const char *file_name, struct ovsdb_schema **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_schema_from_json(struct json *, struct ovsdb_schema **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_schema_to_json(const struct ovsdb_schema *); bool ovsdb_schema_equal(const struct ovsdb_schema *, @@ -56,11 +56,11 @@ /* Database. */ struct ovsdb { struct ovsdb_schema *schema; - struct list replicas; /* Contains "struct ovsdb_replica"s. */ + struct ovs_list replicas; /* Contains "struct ovsdb_replica"s. */ struct shash tables; /* Contains "struct ovsdb_table *"s. */ /* Triggers. */ - struct list triggers; /* Contains "struct ovsdb_trigger"s. */ + struct ovs_list triggers; /* Contains "struct ovsdb_trigger"s. */ bool run_triggers; }; @@ -79,7 +79,7 @@ /* Database replication. */ struct ovsdb_replica { - struct list node; /* Element in "struct ovsdb" replicas list. */ + struct ovs_list node; /* Element in "struct ovsdb" replicas list. */ const struct ovsdb_replica_class *class; }; diff -Nru openvswitch-2.3.1/ovsdb/ovsdb-idlc.in openvswitch-2.4.0~git20150623/ovsdb/ovsdb-idlc.in --- openvswitch-2.3.1/ovsdb/ovsdb-idlc.in 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb-idlc.in 2015-06-23 18:46:21.000000000 +0000 @@ -21,18 +21,31 @@ sys.stdout.write('\n') def constify(cType, const): - if (const and cType.endswith('*') and not cType.endswith('**')): + if (const + and cType.endswith('*') and + (cType == 'char **' or not cType.endswith('**'))): return 'const %s' % cType else: return cType -def cMembers(prefix, columnName, column, const): +def cMembers(prefix, tableName, columnName, column, const): + comment = "" type = column.type if type.is_smap(): - return [{'name': columnName, - 'type': 'struct smap ', - 'comment': ''}] + comment = """ +/* Sets the "%(c)s" column's value from the "%(t)s" table in 'row' + * to '%(c)s'. + * + * The caller retains ownership of '%(c)s' and everything in it. */""" \ + % {'c': columnName, + 't': tableName} + return (comment, [{'name': columnName, + 'type': 'struct smap ', + 'comment': ''}]) + + comment = """\n/* Sets the "%s" column from the "%s" table in """\ + """'row' to\n""" % (columnName, tableName) if type.n_min == 1 and type.n_max == 1: singleton = True @@ -44,25 +57,65 @@ else: pointer = '*' + if type.value: - key = {'name': "key_%s" % columnName, + keyName = "key_%s" % columnName + valueName = "value_%s" % columnName + + key = {'name': keyName, 'type': constify(type.key.toCType(prefix) + pointer, const), 'comment': ''} - value = {'name': "value_%s" % columnName, + value = {'name': valueName, 'type': constify(type.value.toCType(prefix) + pointer, const), 'comment': ''} + + if singleton: + comment += " * the map with key '%s' and value '%s'\n *" \ + % (keyName, valueName) + else: + comment += " * the map with keys '%s' and values '%s'\n *" \ + % (keyName, valueName) members = [key, value] else: m = {'name': columnName, 'type': constify(type.key.toCType(prefix) + pointer, const), 'comment': type.cDeclComment()} + + if singleton: + comment += " * '%s'" % columnName + else: + comment += " * the '%s' set" % columnName members = [m] if not singleton and not type.is_optional_pointer(): - members.append({'name': 'n_%s' % columnName, + sizeName = "n_%s" % columnName + + comment += " with '%s' entries" % sizeName + members.append({'name': sizeName, 'type': 'size_t ', 'comment': ''}) - return members + + comment += ".\n" + + if type.is_optional() and not type.is_optional_pointer(): + comment += """ * + * '%s' may be 0 or 1; if it is 0, then '%s' + * may be NULL.\n""" \ + % ("n_%s" % columnName, columnName) + + if type.is_optional_pointer(): + comment += """ * + * If "%s" is null, the column will be the empty set, + * otherwise it will contain the specified value.\n""" % columnName + + if type.constraintsToEnglish(): + comment += """ * + * Argument constraints: %s\n""" \ + % type.constraintsToEnglish(lambda s : '"%s"' % s) + + comment += " *\n * The caller retains ownership of the arguments. */" + + return (comment, members) def printCIDLHeader(schemaFile): schema = parseSchema(schemaFile) @@ -90,7 +143,9 @@ print "\tstruct ovsdb_idl_row header_;" for columnName, column in sorted(table.columns.iteritems()): print "\n\t/* %s column. */" % columnName - for member in cMembers(prefix, columnName, column, False): + comment, members = cMembers(prefix, tableName, + columnName, column, False) + for member in members: print "\t%(type)s%(name)s;%(comment)s" % member print "};" @@ -130,10 +185,7 @@ for columnName, column in sorted(table.columns.iteritems()): print 'void %(s)s_verify_%(c)s(const struct %(s)s *);' % {'s': structName, 'c': columnName} - print """ -/* Functions for fetching columns as \"struct ovsdb_datum\"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of %(s)s directly.) */""" % {'s': structName} + print for columnName, column in sorted(table.columns.iteritems()): if column.type.value: valueParam = ', enum ovsdb_atomic_type value_type' @@ -148,8 +200,9 @@ if column.type.is_smap(): args = ['const struct smap *'] else: - args = ['%(type)s%(name)s' % member for member - in cMembers(prefix, columnName, column, True)] + comment, members = cMembers(prefix, tableName, columnName, + column, True) + args = ['%(type)s%(name)s' % member for member in members] print '%s);' % ', '.join(args) print @@ -371,10 +424,11 @@ # Row Initialization function. print """ +/* Clears the contents of 'row' in table "%(t)s". */ void %(s)s_init(struct %(s)s *row) { - memset(row, 0, sizeof *row); """ % {'s': structName} + memset(row, 0, sizeof *row); """ % {'s': structName, 't': tableName} for columnName, column in sorted(table.columns.iteritems()): if column.type.is_smap(): print " smap_init(&row->%s);" % columnName @@ -382,18 +436,28 @@ # First, next functions. print ''' +/* Searches table "%(t)s" in 'idl' for a row with UUID 'uuid'. Returns + * a pointer to the row if there is one, otherwise a null pointer. */ const struct %(s)s * %(s)s_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) { return %(s)s_cast(ovsdb_idl_get_row_for_uuid(idl, &%(p)stable_classes[%(P)sTABLE_%(T)s], uuid)); } +/* Returns a row in table "%(t)s" in 'idl', or a null pointer if that + * table is empty. + * + * Database tables are internally maintained as hash tables, so adding or + * removing rows while traversing the same table can cause some rows to be + * visited twice or not at apply. */ const struct %(s)s * %(s)s_first(const struct ovsdb_idl *idl) { return %(s)s_cast(ovsdb_idl_first_row(idl, &%(p)stable_classes[%(P)sTABLE_%(T)s])); } +/* Returns a row following 'row' within its table, or a null pointer if 'row' + * is the last row in its table. */ const struct %(s)s * %(s)s_next(const struct %(s)s *row) { @@ -401,28 +465,65 @@ }''' % {'s': structName, 'p': prefix, 'P': prefix.upper(), + 't': tableName, 'T': tableName.upper()} print ''' +/* Deletes 'row' from table "%(t)s". 'row' may be freed, so it must not be + * accessed afterward. + * + * The caller must have started a transaction with ovsdb_idl_txn_create(). */ void %(s)s_delete(const struct %(s)s *row) { ovsdb_idl_txn_delete(&row->header_); } +/* Inserts and returns a new row in the table "%(t)s" in the database + * with open transaction 'txn'. + * + * The new row is assigned a randomly generated provisional UUID. + * ovsdb-server will assign a different UUID when 'txn' is committed, + * but the IDL will replace any uses of the provisional UUID in the + * data to be to be committed by the UUID assigned by ovsdb-server. */ struct %(s)s * %(s)s_insert(struct ovsdb_idl_txn *txn) { return %(s)s_cast(ovsdb_idl_txn_insert(txn, &%(p)stable_classes[%(P)sTABLE_%(T)s], NULL)); -} -''' % {'s': structName, - 'p': prefix, - 'P': prefix.upper(), - 'T': tableName.upper()} +}''' % {'s': structName, + 'p': prefix, + 'P': prefix.upper(), + 't': tableName, + 'T': tableName.upper()} # Verify functions. for columnName, column in sorted(table.columns.iteritems()): print ''' +/* Causes the original contents of column "%(c)s" in 'row' to be + * verified as a prerequisite to completing the transaction. That is, if + * "%(c)s" in 'row' changed (or if 'row' was deleted) between the + * time that the IDL originally read its contents and the time that the + * transaction commits, then the transaction aborts and ovsdb_idl_txn_commit() + * returns TXN_AGAIN_WAIT or TXN_AGAIN_NOW (depending on whether the database + * change has already been received). + * + * The intention is that, to ensure that no transaction commits based on dirty + * reads, an application should call this function any time "%(c)s" is + * read as part of a read-modify-write operation. + * + * In some cases this function reduces to a no-op, because the current value + * of "%(c)s" is already known: + * + * - If 'row' is a row created by the current transaction (returned by + * %(s)s_insert()). + * + * - If "%(c)s" has already been modified (with + * %(s)s_set_%(c)s()) within the current transaction. + * + * Because of the latter property, always call this function *before* + * %(s)s_set_%(c)s() for a given read-modify-write. + * + * The caller must have started a transaction with ovsdb_idl_txn_create(). */ void %(s)s_verify_%(c)s(const struct %(s)s *row) { @@ -444,10 +545,11 @@ valueType = '' valueComment = '' print """ -/* Returns the %(c)s column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. +/* Returns the "%(c)s" column's value from the "%(t)s" table in 'row' + * as a struct ovsdb_datum. This is useful occasionally: for example, + * ovsdb_datum_find_key() is an easier and more efficient way to search + * for a given key than implementing the same operation on the "cooked" + * form in 'row'. * * 'key_type' must be %(kt)s.%(vc)s * (This helps to avoid silent bugs if someone changes %(c)s's @@ -458,14 +560,17 @@ * Various kinds of changes can invalidate the returned value: modifying * 'column' within 'row', deleting 'row', or completing an ongoing transaction. * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ + * of it with ovsdb_datum_clone(). + * + * This function is rarely useful, since it is easier to access the value + * directly through the "%(c)s" member in %(s)s. */ const struct ovsdb_datum * %(s)s_get_%(c)s(const struct %(s)s *row, \tenum ovsdb_atomic_type key_type OVS_UNUSED%(v)s) { ovs_assert(key_type == %(kt)s);%(vt)s return ovsdb_idl_read(&row->header_, &%(s)s_col_%(c)s); -}""" % {'s': structName, 'c': columnName, +}""" % {'t': tableName, 's': structName, 'c': columnName, 'kt': column.type.key.toAtomicType(), 'v': valueParam, 'vt': valueType, 'vc': valueComment} @@ -473,24 +578,27 @@ for columnName, column in sorted(table.columns.iteritems()): type = column.type + comment, members = cMembers(prefix, tableName, columnName, + column, True) + if type.is_smap(): - print """ -void -%(s)s_set_%(c)s(const struct %(s)s *row, const struct smap *smap) + print comment + print """void +%(s)s_set_%(c)s(const struct %(s)s *row, const struct smap *%(c)s) { struct ovsdb_datum datum; ovs_assert(inited); - if (smap) { + if (%(c)s) { struct smap_node *node; size_t i; - datum.n = smap_count(smap); + datum.n = smap_count(%(c)s); datum.keys = xmalloc(datum.n * sizeof *datum.keys); datum.values = xmalloc(datum.n * sizeof *datum.values); i = 0; - SMAP_FOR_EACH (node, smap) { + SMAP_FOR_EACH (node, %(c)s) { datum.keys[i].string = xstrdup(node->key); datum.values[i].string = xstrdup(node->value); i++; @@ -503,15 +611,13 @@ &%(s)s_columns[%(S)s_COL_%(C)s], &datum); } -""" % {'s': structName, +""" % {'t': tableName, + 's': structName, 'S': structName.upper(), 'c': columnName, 'C': columnName.upper()} continue - - print '\nvoid' - members = cMembers(prefix, columnName, column, True) keyVar = members[0]['name'] nVar = None valueVar = None @@ -522,6 +628,9 @@ else: if len(members) > 1: nVar = members[1]['name'] + + print comment + print 'void' print '%(s)s_set_%(c)s(const struct %(s)s *row, %(args)s)' % \ {'s': structName, 'c': columnName, 'args': ', '.join(['%(type)s%(name)s' % m for m in members])} diff -Nru openvswitch-2.3.1/ovsdb/ovsdb-server.1.in openvswitch-2.4.0~git20150623/ovsdb/ovsdb-server.1.in --- openvswitch-2.3.1/ovsdb/ovsdb-server.1.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb-server.1.in 2015-06-23 18:46:21.000000000 +0000 @@ -194,6 +194,22 @@ The Open vSwitch JSON parser discards all but the last value for a name that is specified more than once. . +.IP +The definition of allows for implementation extensions. +Currently \fBovsdb\-server\fR uses the following additional "error" +strings which might change in later releases): +. +.RS +.IP "\fBsyntax error\fR or \fBunknown column\fR" +The request could not be parsed as an OVSDB request. An additional +"syntax" member, whose value is a string that contains JSON, may +narrow down the particular syntax that could not be parsed. +.IP "\fBinternal error\fR" +The request triggered a bug in \fBovsdb\-server\fR. +.IP "\fBovsdb error\fR" +A map or set contains a duplicate key. +.RE +. .IP "3.2. Schema Format" RFC 7047 requires the "version" field in . Current versions of \fBovsdb\-server\fR allow it to be omitted (future @@ -227,10 +243,42 @@ active monitors. \fBovsdb\-server\fR rejects attempt to create two monitors with the same identifier. . -.IP "6. IANA Considerations" -\fBovsdb\-server\fR currently defaults to its historical port number -6632. Future versions will adopt IANA-assigned port 6640 as default. - +.IP "5.1. Notation" +For , RFC 7047 only allows the use of \fB!=\fR, \fB==\fR, +\fBincludes\fR, and \fBexcludes\fR operators with set types. Open +vSwitch 2.4 and later extend to allow the use of \fB<\fR, +\fB<=\fR, \fB>=\fR, and \fB>\fR operators with columns with type ``set +of 0 or 1 integer'' and ``set of 0 or 1 real''. These conditions +evaluate to false when the column is empty, and otherwise as described +in RFC 7047 for integer and real types. +. +.SH "BUGS" +. +In Open vSwitch before version 2.4, when \fBovsdb\-server\fR sent +JSON-RPC error responses to some requests, it incorrectly formulated +them with the \fBresult\fR and \fBerror\fR swapped, so that the +response appeared to indicate success (with a nonsensical result) +rather than an error. The requests that suffered from this problem +were: +. +.IP \fBtransact\fR +.IQ \fBget_schema\fR +Only if the request names a nonexistent database. +.IP \fBmonitor\fR +.IQ \fBlock\fR +.IQ \fBunlock\fR +In all error cases. +. +.PP +Of these cases, the only error that a well-written application is +likely to encounter in practice is \fBmonitor\fR of tables or columns +that do not exist, in an situation where the application has been +upgraded but the old database schema is still temporarily in use. To +handle this situation gracefully, we recommend that clients should +treat a \fBmonitor\fR response with a \fBresult\fR that contains an +\fBerror\fR key-value pair as an error (assuming that the database +being monitored does not contain a table named \fBerror\fR). +. .SH "SEE ALSO" . .BR ovsdb\-tool (1). diff -Nru openvswitch-2.3.1/ovsdb/ovsdb-server.c openvswitch-2.4.0~git20150623/ovsdb/ovsdb-server.c --- openvswitch-2.3.1/ovsdb/ovsdb-server.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb-server.c 2015-06-23 18:46:21.000000000 +0000 @@ -26,7 +26,6 @@ #include "command-line.h" #include "daemon.h" #include "dirs.h" -#include "dummy.h" #include "dynamic-string.h" #include "fatal-signal.h" #include "file.h" @@ -54,7 +53,8 @@ #include "trigger.h" #include "util.h" #include "unixctl.h" -#include "vlog.h" +#include "perf-counter.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(ovsdb_server); @@ -77,6 +77,8 @@ static unixctl_cb_func ovsdb_server_exit; static unixctl_cb_func ovsdb_server_compact; static unixctl_cb_func ovsdb_server_reconnect; +static unixctl_cb_func ovsdb_server_perf_counters_clear; +static unixctl_cb_func ovsdb_server_perf_counters_show; struct server_config { struct sset *remotes; @@ -93,11 +95,12 @@ static unixctl_cb_func ovsdb_server_list_databases; static char *open_db(struct server_config *config, const char *filename); +static void close_db(struct db *db); static void parse_options(int *argc, char **argvp[], struct sset *remotes, char **unixctl_pathp, char **run_command); -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static char *reconfigure_remotes(struct ovsdb_jsonrpc_server *, const struct shash *all_dbs, @@ -115,6 +118,83 @@ static void load_config(FILE *config_file, struct sset *remotes, struct sset *db_filenames); +static void +main_loop(struct ovsdb_jsonrpc_server *jsonrpc, struct shash *all_dbs, + struct unixctl_server *unixctl, struct sset *remotes, + struct process *run_process, bool *exiting) +{ + char *remotes_error, *ssl_error; + struct shash_node *node; + long long int status_timer = LLONG_MIN; + + *exiting = false; + ssl_error = NULL; + remotes_error = NULL; + while (!*exiting) { + memory_run(); + if (memory_should_report()) { + struct simap usage; + + simap_init(&usage); + ovsdb_jsonrpc_server_get_memory_usage(jsonrpc, &usage); + SHASH_FOR_EACH(node, all_dbs) { + struct db *db = node->data; + ovsdb_get_memory_usage(db->db, &usage); + } + memory_report(&usage); + simap_destroy(&usage); + } + + /* Run unixctl_server_run() before reconfigure_remotes() because + * ovsdb-server/add-remote and ovsdb-server/remove-remote can change + * the set of remotes that reconfigure_remotes() uses. */ + unixctl_server_run(unixctl); + + report_error_if_changed( + reconfigure_remotes(jsonrpc, all_dbs, remotes), + &remotes_error); + report_error_if_changed(reconfigure_ssl(all_dbs), &ssl_error); + ovsdb_jsonrpc_server_run(jsonrpc); + + SHASH_FOR_EACH(node, all_dbs) { + struct db *db = node->data; + ovsdb_trigger_run(db->db, time_msec()); + } + if (run_process) { + process_run(); + if (process_exited(run_process)) { + *exiting = true; + } + } + + /* update Manager status(es) every 5 seconds */ + if (time_msec() >= status_timer) { + status_timer = time_msec() + 5000; + update_remote_status(jsonrpc, remotes, all_dbs); + } + + memory_wait(); + ovsdb_jsonrpc_server_wait(jsonrpc); + unixctl_server_wait(unixctl); + SHASH_FOR_EACH(node, all_dbs) { + struct db *db = node->data; + ovsdb_trigger_wait(db->db, time_msec()); + } + if (run_process) { + process_wait(run_process); + } + if (*exiting) { + poll_immediate_wake(); + } + poll_timer_wait_until(status_timer); + poll_block(); + if (should_service_stop()) { + *exiting = true; + } + } + +} + int main(int argc, char *argv[]) { @@ -127,16 +207,14 @@ struct process *run_process; bool exiting; int retval; - long long int status_timer = LLONG_MIN; FILE *config_tmpfile; struct server_config server_config; struct shash all_dbs; - struct shash_node *node; - char *remotes_error, *ssl_error; + struct shash_node *node, *next; char *error; int i; - proctitle_init(argc, argv); + ovs_cmdl_proctitle_init(argc, argv); set_program_name(argv[0]); service_start(&argc, &argv); fatal_ignore_sigpipe(); @@ -217,6 +295,8 @@ daemonize_complete(); + perf_counters_init(); + if (!run_command) { /* ovsdb-server is usually a long-running process, in which case it * makes plenty of sense to log the version, but --run makes @@ -243,78 +323,21 @@ ovsdb_server_remove_database, &server_config); unixctl_command_register("ovsdb-server/list-dbs", "", 0, 0, ovsdb_server_list_databases, &all_dbs); + unixctl_command_register("ovsdb-server/perf-counters-show", "", 0, 0, + ovsdb_server_perf_counters_show, NULL); + unixctl_command_register("ovsdb-server/perf-counters-clear", "", 0, 0, + ovsdb_server_perf_counters_clear, NULL); - exiting = false; - ssl_error = NULL; - remotes_error = NULL; - while (!exiting) { - memory_run(); - if (memory_should_report()) { - struct simap usage; - - simap_init(&usage); - ovsdb_jsonrpc_server_get_memory_usage(jsonrpc, &usage); - SHASH_FOR_EACH(node, &all_dbs) { - struct db *db = node->data; - ovsdb_get_memory_usage(db->db, &usage); - } - memory_report(&usage); - simap_destroy(&usage); - } + main_loop(jsonrpc, &all_dbs, unixctl, &remotes, run_process, &exiting); - /* Run unixctl_server_run() before reconfigure_remotes() because - * ovsdb-server/add-remote and ovsdb-server/remove-remote can change - * the set of remotes that reconfigure_remotes() uses. */ - unixctl_server_run(unixctl); - - report_error_if_changed( - reconfigure_remotes(jsonrpc, &all_dbs, &remotes), - &remotes_error); - report_error_if_changed(reconfigure_ssl(&all_dbs), &ssl_error); - ovsdb_jsonrpc_server_run(jsonrpc); - - SHASH_FOR_EACH(node, &all_dbs) { - struct db *db = node->data; - ovsdb_trigger_run(db->db, time_msec()); - } - if (run_process) { - process_run(); - if (process_exited(run_process)) { - exiting = true; - } - } - - /* update Manager status(es) every 5 seconds */ - if (time_msec() >= status_timer) { - status_timer = time_msec() + 5000; - update_remote_status(jsonrpc, &remotes, &all_dbs); - } - - memory_wait(); - ovsdb_jsonrpc_server_wait(jsonrpc); - unixctl_server_wait(unixctl); - SHASH_FOR_EACH(node, &all_dbs) { - struct db *db = node->data; - ovsdb_trigger_wait(db->db, time_msec()); - } - if (run_process) { - process_wait(run_process); - } - if (exiting) { - poll_immediate_wake(); - } - poll_timer_wait_until(status_timer); - poll_block(); - if (should_service_stop()) { - exiting = true; - } - } ovsdb_jsonrpc_server_destroy(jsonrpc); - SHASH_FOR_EACH(node, &all_dbs) { + SHASH_FOR_EACH_SAFE(node, next, &all_dbs) { struct db *db = node->data; - ovsdb_destroy(db->db); + close_db(db); + shash_delete(&all_dbs, node); } sset_destroy(&remotes); + sset_destroy(&db_filenames); unixctl_server_destroy(unixctl); if (run_process && process_exited(run_process)) { @@ -324,7 +347,7 @@ run_command, process_status_msg(status)); } } - + perf_counters_destroy(); service_stop(); return 0; } @@ -359,6 +382,14 @@ return false; } +static void +close_db(struct db *db) +{ + ovsdb_destroy(db->db); + free(db->filename); + free(db); +} + static char * open_db(struct server_config *config, const char *filename) { @@ -387,9 +418,7 @@ } ovsdb_error_destroy(db_error); - ovsdb_destroy(db->db); - free(db->filename); - free(db); + close_db(db); return error; } @@ -408,7 +437,7 @@ return NULL; } -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_db_column__(const struct shash *all_dbs, const char *name_, char *name, const struct db **dbp, @@ -462,7 +491,7 @@ /* Returns NULL if successful, otherwise a malloc()'d string describing the * error. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_db_column(const struct shash *all_dbs, const char *name_, const struct db **dbp, @@ -478,7 +507,7 @@ /* Returns NULL if successful, otherwise a malloc()'d string describing the * error. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_db_string_column(const struct shash *all_dbs, const char *name, const struct db **dbp, @@ -1002,6 +1031,26 @@ } static void +ovsdb_server_perf_counters_show(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, + void *arg_ OVS_UNUSED) +{ + char *s = perf_counters_to_string(); + + unixctl_command_reply(conn, s); + free(s); +} + +static void +ovsdb_server_perf_counters_clear(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, + void *arg_ OVS_UNUSED) +{ + perf_counters_clear(); + unixctl_command_reply(conn, NULL); +} + +static void ovsdb_server_compact(struct unixctl_conn *conn, int argc, const char *argv[], void *dbs_) { @@ -1165,10 +1214,8 @@ ok = ovsdb_jsonrpc_server_remove_db(config->jsonrpc, db->db); ovs_assert(ok); - ovsdb_destroy(db->db); + close_db(db); shash_delete(config->all_dbs, node); - free(db->filename); - free(db); save_config(config); unixctl_command_reply(conn, NULL); @@ -1205,7 +1252,6 @@ OPT_UNIXCTL, OPT_RUN, OPT_BOOTSTRAP_CA_CERT, - OPT_ENABLE_DUMMY, VLOG_OPTION_ENUMS, DAEMON_OPTION_ENUMS }; @@ -1223,10 +1269,9 @@ {"private-key", required_argument, NULL, 'p'}, {"certificate", required_argument, NULL, 'c'}, {"ca-cert", required_argument, NULL, 'C'}, - {"enable-dummy", optional_argument, NULL, OPT_ENABLE_DUMMY}, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); int argc = *argcp; char **argv = *argvp; @@ -1280,10 +1325,6 @@ bootstrap_ca_cert = true; break; - case OPT_ENABLE_DUMMY: - dummy_enable(optarg && !strcmp(optarg, "override")); - break; - case '?': exit(EXIT_FAILURE); diff -Nru openvswitch-2.3.1/ovsdb/ovsdb-tool.c openvswitch-2.4.0~git20150623/ovsdb/ovsdb-tool.c --- openvswitch-2.3.1/ovsdb/ovsdb-tool.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/ovsdb-tool.c 2015-06-23 18:46:21.000000000 +0000 @@ -39,14 +39,14 @@ #include "table.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" /* -m, --more: Verbosity level for "show-log" command output. */ static int show_log_verbosity; -static const struct command *get_all_commands(void); +static const struct ovs_cmdl_command *get_all_commands(void); -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[]); static const char *default_db(void); @@ -55,10 +55,13 @@ int main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { .argc = 0, }; set_program_name(argv[0]); parse_options(argc, argv); fatal_ignore_sigpipe(); - run_command(argc - optind, argv + optind, get_all_commands()); + ctx.argc = argc - optind; + ctx.argv = argv + optind; + ovs_cmdl_run_command(&ctx, get_all_commands()); return 0; } @@ -69,10 +72,11 @@ {"more", no_argument, NULL, 'm'}, {"verbose", optional_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, + {"option", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { int c; @@ -90,6 +94,10 @@ case 'h': usage(); + case 'o': + ovs_cmdl_print_options(long_options); + exit(EXIT_SUCCESS); + case 'V': ovs_print_version(0, 0); exit(EXIT_SUCCESS); @@ -182,10 +190,10 @@ } static void -do_create(int argc, char *argv[]) +do_create(struct ovs_cmdl_context *ctx) { - const char *db_file_name = argc >= 2 ? argv[1] : default_db(); - const char *schema_file_name = argc >= 3 ? argv[2] : default_schema(); + const char *db_file_name = ctx->argc >= 2 ? ctx->argv[1] : default_db(); + const char *schema_file_name = ctx->argc >= 3 ? ctx->argv[2] : default_schema(); struct ovsdb_schema *schema; struct ovsdb_log *log; struct json *json; @@ -249,6 +257,9 @@ /* Replace source. */ if (in_place) { +#ifdef _WIN32 + unlink(src_name); +#endif if (rename(dst_name, src_name)) { ovs_fatal(errno, "failed to rename \"%s\" to \"%s\"", dst_name, src_name); @@ -264,20 +275,20 @@ } static void -do_compact(int argc, char *argv[]) +do_compact(struct ovs_cmdl_context *ctx) { - const char *db = argc >= 2 ? argv[1] : default_db(); - const char *target = argc >= 3 ? argv[2] : NULL; + const char *db = ctx->argc >= 2 ? ctx->argv[1] : default_db(); + const char *target = ctx->argc >= 3 ? ctx->argv[2] : NULL; compact_or_convert(db, target, NULL, "compacted by ovsdb-tool "VERSION); } static void -do_convert(int argc, char *argv[]) +do_convert(struct ovs_cmdl_context *ctx) { - const char *db = argc >= 2 ? argv[1] : default_db(); - const char *schema = argc >= 3 ? argv[2] : default_schema(); - const char *target = argc >= 4 ? argv[3] : NULL; + const char *db = ctx->argc >= 2 ? ctx->argv[1] : default_db(); + const char *schema = ctx->argc >= 3 ? ctx->argv[2] : default_schema(); + const char *target = ctx->argc >= 4 ? ctx->argv[3] : NULL; struct ovsdb_schema *new_schema; check_ovsdb_error(ovsdb_schema_from_file(schema, &new_schema)); @@ -287,10 +298,10 @@ } static void -do_needs_conversion(int argc, char *argv[]) +do_needs_conversion(struct ovs_cmdl_context *ctx) { - const char *db_file_name = argc >= 2 ? argv[1] : default_db(); - const char *schema_file_name = argc >= 3 ? argv[2] : default_schema(); + const char *db_file_name = ctx->argc >= 2 ? ctx->argv[1] : default_db(); + const char *schema_file_name = ctx->argc >= 3 ? ctx->argv[2] : default_schema(); struct ovsdb_schema *schema1, *schema2; check_ovsdb_error(ovsdb_file_read_schema(db_file_name, &schema1)); @@ -301,9 +312,9 @@ } static void -do_db_version(int argc, char *argv[]) +do_db_version(struct ovs_cmdl_context *ctx) { - const char *db_file_name = argc >= 2 ? argv[1] : default_db(); + const char *db_file_name = ctx->argc >= 2 ? ctx->argv[1] : default_db(); struct ovsdb_schema *schema; check_ovsdb_error(ovsdb_file_read_schema(db_file_name, &schema)); @@ -312,9 +323,9 @@ } static void -do_db_cksum(int argc OVS_UNUSED, char *argv[]) +do_db_cksum(struct ovs_cmdl_context *ctx) { - const char *db_file_name = argc >= 2 ? argv[1] : default_db(); + const char *db_file_name = ctx->argc >= 2 ? ctx->argv[1] : default_db(); struct ovsdb_schema *schema; check_ovsdb_error(ovsdb_file_read_schema(db_file_name, &schema)); @@ -323,9 +334,9 @@ } static void -do_schema_version(int argc, char *argv[]) +do_schema_version(struct ovs_cmdl_context *ctx) { - const char *schema_file_name = argc >= 2 ? argv[1] : default_schema(); + const char *schema_file_name = ctx->argc >= 2 ? ctx->argv[1] : default_schema(); struct ovsdb_schema *schema; check_ovsdb_error(ovsdb_schema_from_file(schema_file_name, &schema)); @@ -334,9 +345,9 @@ } static void -do_schema_cksum(int argc, char *argv[]) +do_schema_cksum(struct ovs_cmdl_context *ctx) { - const char *schema_file_name = argc >= 2 ? argv[1] : default_schema(); + const char *schema_file_name = ctx->argc >= 2 ? ctx->argv[1] : default_schema(); struct ovsdb_schema *schema; check_ovsdb_error(ovsdb_schema_from_file(schema_file_name, &schema)); @@ -363,15 +374,15 @@ } static void -do_query(int argc, char *argv[]) +do_query(struct ovs_cmdl_context *ctx) { - transact(true, argc, argv); + transact(true, ctx->argc, ctx->argv); } static void -do_transact(int argc, char *argv[]) +do_transact(struct ovs_cmdl_context *ctx) { - transact(false, argc, argv); + transact(false, ctx->argc, ctx->argv); } static void @@ -487,9 +498,9 @@ } static void -do_show_log(int argc, char *argv[]) +do_show_log(struct ovs_cmdl_context *ctx) { - const char *db_file_name = argc >= 2 ? argv[1] : default_db(); + const char *db_file_name = ctx->argc >= 2 ? ctx->argv[1] : default_db(); struct shash names; struct ovsdb_log *log; struct ovsdb_schema *schema; @@ -550,28 +561,35 @@ } static void -do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_help(struct ovs_cmdl_context *ctx OVS_UNUSED) { usage(); } -static const struct command all_commands[] = { - { "create", 0, 2, do_create }, - { "compact", 0, 2, do_compact }, - { "convert", 0, 3, do_convert }, - { "needs-conversion", 0, 2, do_needs_conversion }, - { "db-version", 0, 1, do_db_version }, - { "db-cksum", 0, 1, do_db_cksum }, - { "schema-version", 0, 1, do_schema_version }, - { "schema-cksum", 0, 1, do_schema_cksum }, - { "query", 1, 2, do_query }, - { "transact", 1, 2, do_transact }, - { "show-log", 0, 1, do_show_log }, - { "help", 0, INT_MAX, do_help }, - { NULL, 0, 0, NULL }, +static void +do_list_commands(struct ovs_cmdl_context *ctx OVS_UNUSED) +{ + ovs_cmdl_print_commands(get_all_commands()); +} + +static const struct ovs_cmdl_command all_commands[] = { + { "create", "[db [schema]]", 0, 2, do_create }, + { "compact", "[db [dst]]", 0, 2, do_compact }, + { "convert", "[db [schema [dst]]]", 0, 3, do_convert }, + { "needs-conversion", NULL, 0, 2, do_needs_conversion }, + { "db-version", "[db]", 0, 1, do_db_version }, + { "db-cksum", "[db]", 0, 1, do_db_cksum }, + { "schema-version", "[schema]", 0, 1, do_schema_version }, + { "schema-cksum", "[schema]", 0, 1, do_schema_cksum }, + { "query", "[db] trns", 1, 2, do_query }, + { "transact", "[db] trns", 1, 2, do_transact }, + { "show-log", "[db]", 0, 1, do_show_log }, + { "help", NULL, 0, INT_MAX, do_help }, + { "list-commands", NULL, 0, INT_MAX, do_list_commands }, + { NULL, NULL, 0, 0, NULL }, }; -static const struct command *get_all_commands(void) +static const struct ovs_cmdl_command *get_all_commands(void) { return all_commands; } diff -Nru openvswitch-2.3.1/ovsdb/query.c openvswitch-2.4.0~git20150623/ovsdb/query.c --- openvswitch-2.3.1/ovsdb/query.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/query.c 2015-06-23 18:46:21.000000000 +0000 @@ -81,7 +81,8 @@ { if (!columns || ovsdb_column_set_contains(columns, OVSDB_COL_UUID)) { /* All the result rows are guaranteed to be distinct anyway. */ - return ovsdb_query_row_set(table, condition, results); + ovsdb_query_row_set(table, condition, results); + return; } else { /* Use hash table to drop duplicates. */ struct ovsdb_row_hash_node *node; diff -Nru openvswitch-2.3.1/ovsdb/remote-active.man openvswitch-2.4.0~git20150623/ovsdb/remote-active.man --- openvswitch-2.3.1/ovsdb/remote-active.man 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/remote-active.man 2015-06-23 18:46:21.000000000 +0000 @@ -2,14 +2,14 @@ The specified SSL \fIport\fR on the host at the given \fIip\fR, which must be expressed as an IP address (not a DNS name) in IPv4 or IPv6 address format. If \fIip\fR is an IPv6 address, then wrap \fIip\fR with square -brackets, e.g.: \fBssl:[::1]:6632\fR. +brackets, e.g.: \fBssl:[::1]:6640\fR. The \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory when this form is used. . .IP "\fBtcp:\fIip\fB:\fIport\fR" Connect to the given TCP \fIport\fR on \fIip\fR, where \fIip\fR can be IPv4 or IPv6 address. If \fIip\fR is an IPv6 address, then wrap \fIip\fR with -square brackets, e.g.: \fBtcp:[::1]:6632\fR. +square brackets, e.g.: \fBtcp:[::1]:6640\fR. . .IP "\fBunix:\fIfile\fR" On POSIX, connect to the Unix domain server socket named \fIfile\fR. diff -Nru openvswitch-2.3.1/ovsdb/remote-passive.man openvswitch-2.4.0~git20150623/ovsdb/remote-passive.man --- openvswitch-2.3.1/ovsdb/remote-passive.man 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/remote-passive.man 2015-06-23 18:46:21.000000000 +0000 @@ -5,7 +5,7 @@ specifying \fIip\fR limits connections to those from the given \fIip\fR, either IPv4 or IPv6 address. If \fIip\fR is an IPv6 address, then wrap \fIip\fR with square brackets, e.g.: -\fBpssl:6632:[::1]\fR. The \fB\-\-private\-key\fR, +\fBpssl:6640:[::1]\fR. The \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory when this form is used. . @@ -16,7 +16,7 @@ \fIip\fR may be specified to listen only for connections to the given \fIip\fR, either IPv4 or IPv6 address. If \fIip\fR is an IPv6 address, then wrap \fIip\fR with square brackets, e.g.: -\fBptcp:6632:[::1]\fR. +\fBptcp:6640:[::1]\fR. . .IP "\fBpunix:\fIfile\fR" On POSIX, listen on the Unix domain server socket named \fIfile\fR for a diff -Nru openvswitch-2.3.1/ovsdb/row.h openvswitch-2.4.0~git20150623/ovsdb/row.h --- openvswitch-2.3.1/ovsdb/row.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/row.h 2015-06-23 18:46:21.000000000 +0000 @@ -36,8 +36,8 @@ * ovsdb_weak_ref" structures are created for them. */ struct ovsdb_weak_ref { - struct list src_node; /* In src->src_refs list. */ - struct list dst_node; /* In destination row's dst_refs list. */ + struct ovs_list src_node; /* In src->src_refs list. */ + struct ovs_list dst_node; /* In destination row's dst_refs list. */ struct ovsdb_row *src; /* Source row. */ }; @@ -48,8 +48,8 @@ struct ovsdb_txn_row *txn_row; /* Transaction that row is in, if any. */ /* Weak references. */ - struct list src_refs; /* Weak references from this row. */ - struct list dst_refs; /* Weak references to this row. */ + struct ovs_list src_refs; /* Weak references from this row. */ + struct ovs_list dst_refs; /* Weak references to this row. */ /* Number of strong refs to this row from other rows, in this table or * other tables, through 'uuid' columns that have a 'refTable' constraint @@ -88,7 +88,7 @@ const struct json *, struct ovsdb_symbol_table *, struct ovsdb_column_set *included) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_row_to_json(const struct ovsdb_row *, const struct ovsdb_column_set *include); diff -Nru openvswitch-2.3.1/ovsdb/server.h openvswitch-2.4.0~git20150623/ovsdb/server.h --- openvswitch-2.3.1/ovsdb/server.h 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/server.h 2015-06-23 18:46:21.000000000 +0000 @@ -28,7 +28,7 @@ * (e.g. jsonrpc-server.c) embed this in a larger data structure. */ struct ovsdb_session { struct ovsdb_server *server; - struct list completions; /* Completed triggers. */ + struct ovs_list completions;/* Completed triggers. */ struct hmap waiters; /* "ovsdb_lock_waiter *"s by lock name. */ }; @@ -46,7 +46,7 @@ struct hmap_node hmap_node; /* In ovsdb_server's "locks" hmap. */ struct ovsdb_server *server; /* The containing server. */ char *name; /* Unique name. */ - struct list waiters; /* Contains "struct ovsdb_lock_waiter"s. */ + struct ovs_list waiters; /* Contains "struct ovsdb_lock_waiter"s. */ }; struct ovsdb_lock_waiter *ovsdb_lock_get_owner(const struct ovsdb_lock *); @@ -66,7 +66,7 @@ char *lock_name; struct ovsdb_session *session; - struct list lock_node; /* In ->lock->waiters's list. */ + struct ovs_list lock_node; /* In ->lock->waiters's list. */ }; struct ovsdb_session *ovsdb_lock_waiter_remove(struct ovsdb_lock_waiter *); diff -Nru openvswitch-2.3.1/ovsdb/table.h openvswitch-2.4.0~git20150623/ovsdb/table.h --- openvswitch-2.3.1/ovsdb/table.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/table.h 2015-06-23 18:46:21.000000000 +0000 @@ -44,7 +44,7 @@ struct ovsdb_error *ovsdb_table_schema_from_json(const struct json *, const char *name, struct ovsdb_table_schema **) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct json *ovsdb_table_schema_to_json(const struct ovsdb_table_schema *, bool default_is_root); diff -Nru openvswitch-2.3.1/ovsdb/transaction.c openvswitch-2.4.0~git20150623/ovsdb/transaction.c --- openvswitch-2.3.1/ovsdb/transaction.c 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/transaction.c 2015-06-23 18:46:21.000000000 +0000 @@ -31,13 +31,13 @@ struct ovsdb_txn { struct ovsdb *db; - struct list txn_tables; /* Contains "struct ovsdb_txn_table"s. */ + struct ovs_list txn_tables; /* Contains "struct ovsdb_txn_table"s. */ struct ds comment; }; /* A table modified by a transaction. */ struct ovsdb_txn_table { - struct list node; /* Element in ovsdb_txn's txn_tables list. */ + struct ovs_list node; /* Element in ovsdb_txn's txn_tables list. */ struct ovsdb_table *table; struct hmap txn_rows; /* Contains "struct ovsdb_txn_row"s. */ @@ -84,10 +84,10 @@ unsigned long changed[]; /* Bits set to 1 for columns that changed. */ }; -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT delete_garbage_row(struct ovsdb_txn *txn, struct ovsdb_txn_row *r); static void ovsdb_txn_row_prefree(struct ovsdb_txn_row *); -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT for_each_txn_row(struct ovsdb_txn *txn, struct ovsdb_error *(*)(struct ovsdb_txn *, struct ovsdb_txn_row *)); @@ -204,7 +204,7 @@ return txn_row; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT ovsdb_txn_adjust_atom_refs(struct ovsdb_txn *txn, const struct ovsdb_row *r, const struct ovsdb_column *c, const struct ovsdb_base_type *base, @@ -244,7 +244,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT ovsdb_txn_adjust_row_refs(struct ovsdb_txn *txn, const struct ovsdb_row *r, const struct ovsdb_column *column, int delta) { @@ -260,7 +260,7 @@ return error; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT update_row_ref_count(struct ovsdb_txn *txn, struct ovsdb_txn_row *r) { struct ovsdb_table *table = r->table; @@ -287,7 +287,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT check_ref_count(struct ovsdb_txn *txn OVS_UNUSED, struct ovsdb_txn_row *r) { if (r->new || !r->n_refs) { @@ -301,7 +301,7 @@ } } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT delete_row_refs(struct ovsdb_txn *txn, const struct ovsdb_row *row, const struct ovsdb_base_type *base, const union ovsdb_atom *atoms, unsigned int n) @@ -343,7 +343,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT delete_garbage_row(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row) { struct shash_node *node; @@ -378,7 +378,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT collect_garbage(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row) { if (txn_row->new && !txn_row->n_refs) { @@ -387,7 +387,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT update_ref_counts(struct ovsdb_txn *txn) { struct ovsdb_error *error; @@ -462,7 +462,7 @@ list_push_back(&src->src_refs, &weak->src_node); } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT assess_weak_refs(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row) { struct ovsdb_table *table; @@ -569,7 +569,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT determine_changes(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row) { struct ovsdb_table *table = txn_row->table; @@ -603,7 +603,7 @@ return NULL; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT check_max_rows(struct ovsdb_txn *txn) { struct ovsdb_txn_table *t; @@ -672,7 +672,7 @@ } } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT duplicate_index_row(const struct ovsdb_column_set *index, const struct ovsdb_row *a, const struct ovsdb_row *b) @@ -711,7 +711,7 @@ return error; } -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT check_index_uniqueness(struct ovsdb_txn *txn OVS_UNUSED, struct ovsdb_txn_row *txn_row) { @@ -1013,7 +1013,7 @@ * (Even though 'cb' is not allowed to delete some txn_rows, it can still * delete any actual row by clearing a txn_row's 'new' member.) */ -static struct ovsdb_error * WARN_UNUSED_RESULT +static struct ovsdb_error * OVS_WARN_UNUSED_RESULT for_each_txn_row(struct ovsdb_txn *txn, struct ovsdb_error *(*cb)(struct ovsdb_txn *, struct ovsdb_txn_row *)) diff -Nru openvswitch-2.3.1/ovsdb/transaction.h openvswitch-2.4.0~git20150623/ovsdb/transaction.h --- openvswitch-2.3.1/ovsdb/transaction.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/transaction.h 2015-06-23 18:46:21.000000000 +0000 @@ -27,7 +27,7 @@ struct ovsdb_txn *ovsdb_txn_create(struct ovsdb *); void ovsdb_txn_abort(struct ovsdb_txn *); struct ovsdb_error *ovsdb_txn_commit(struct ovsdb_txn *, bool durable) - WARN_UNUSED_RESULT; + OVS_WARN_UNUSED_RESULT; struct ovsdb_row *ovsdb_txn_row_modify(struct ovsdb_txn *, const struct ovsdb_row *); diff -Nru openvswitch-2.3.1/ovsdb/trigger.h openvswitch-2.4.0~git20150623/ovsdb/trigger.h --- openvswitch-2.3.1/ovsdb/trigger.h 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/ovsdb/trigger.h 2015-06-23 18:46:21.000000000 +0000 @@ -23,7 +23,7 @@ struct ovsdb_trigger { struct ovsdb_session *session; /* Session that owns this trigger. */ struct ovsdb *db; /* Database on which trigger acts. */ - struct list node; /* !result: in db->triggers; + struct ovs_list node; /* !result: in db->triggers; * result: in session->completions. */ struct json *request; /* Database request. */ struct json *result; /* Result (null if none yet). */ diff -Nru openvswitch-2.3.1/package.m4 openvswitch-2.4.0~git20150623/package.m4 --- openvswitch-2.3.1/package.m4 2014-12-04 06:00:32.000000000 +0000 +++ openvswitch-2.4.0~git20150623/package.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -# Signature of the current package. -m4_define([AT_PACKAGE_NAME], [openvswitch]) -m4_define([AT_PACKAGE_TARNAME], [openvswitch]) -m4_define([AT_PACKAGE_VERSION], [2.3.1]) -m4_define([AT_PACKAGE_STRING], [openvswitch 2.3.1]) -m4_define([AT_PACKAGE_BUGREPORT], [bugs@openvswitch.org]) diff -Nru openvswitch-2.3.1/PORTING openvswitch-2.4.0~git20150623/PORTING --- openvswitch-2.3.1/PORTING 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/PORTING 1970-01-01 00:00:00.000000000 +0000 @@ -1,324 +0,0 @@ - How to Port Open vSwitch to New Software or Hardware - ==================================================== - -Open vSwitch (OVS) is intended to be easily ported to new software and -hardware platforms. This document describes the types of changes that -are most likely to be necessary in porting OVS to Unix-like platforms. -(Porting OVS to other kinds of platforms is likely to be more -difficult.) - - -Vocabulary ----------- - -For historical reasons, different words are used for essentially the -same concept in different areas of the Open vSwitch source tree. Here -is a concordance, indexed by the area of the source tree: - - datapath/ vport --- - vswitchd/ iface port - ofproto/ port bundle - ofproto/bond.c slave bond - lib/lacp.c slave lacp - lib/netdev.c netdev --- - database Interface Port - - -Open vSwitch Architectural Overview ------------------------------------ - -The following diagram shows the very high-level architecture of Open -vSwitch from a porter's perspective. - - +-------------------+ - | ovs-vswitchd |<-->ovsdb-server - +-------------------+ - | ofproto |<-->OpenFlow controllers - +--------+-+--------+ - | netdev | | ofproto| - +--------+ |provider| - | netdev | +--------+ - |provider| - +--------+ - -Some of the components are generic. Modulo bugs or inadequacies, -these components should not need to be modified as part of a port: - - - "ovs-vswitchd" is the main Open vSwitch userspace program, in - vswitchd/. It reads the desired Open vSwitch configuration from - the ovsdb-server program over an IPC channel and passes this - configuration down to the "ofproto" library. It also passes - certain status and statistical information from ofproto back - into the database. - - - "ofproto" is the Open vSwitch library, in ofproto/, that - implements an OpenFlow switch. It talks to OpenFlow controllers - over the network and to switch hardware or software through an - "ofproto provider", explained further below. - - - "netdev" is the Open vSwitch library, in lib/netdev.c, that - abstracts interacting with network devices, that is, Ethernet - interfaces. The netdev library is a thin layer over "netdev - provider" code, explained further below. - -The other components may need attention during a port. You will -almost certainly have to implement a "netdev provider". Depending on -the type of port you are doing and the desired performance, you may -also have to implement an "ofproto provider" or a lower-level -component called a "dpif" provider. - -The following sections talk about these components in more detail. - - -Writing a netdev Provider -------------------------- - -A "netdev provider" implements an operating system and hardware -specific interface to "network devices", e.g. eth0 on Linux. Open -vSwitch must be able to open each port on a switch as a netdev, so you -will need to implement a "netdev provider" that works with your switch -hardware and software. - -struct netdev_class, in lib/netdev-provider.h, defines the interfaces -required to implement a netdev. That structure contains many function -pointers, each of which has a comment that is meant to describe its -behavior in detail. If the requirements are unclear, please report -this as a bug. - -The netdev interface can be divided into a few rough categories: - - * Functions required to properly implement OpenFlow features. For - example, OpenFlow requires the ability to report the Ethernet - hardware address of a port. These functions must be implemented - for minimally correct operation. - - * Functions required to implement optional Open vSwitch features. - For example, the Open vSwitch support for in-band control - requires netdev support for inspecting the TCP/IP stack's ARP - table. These functions must be implemented if the corresponding - OVS features are to work, but may be omitted initially. - - * Functions needed in some implementations but not in others. For - example, most kinds of ports (see below) do not need - functionality to receive packets from a network device. - -The existing netdev implementations may serve as useful examples -during a port: - - * lib/netdev-linux.c implements netdev functionality for Linux - network devices, using Linux kernel calls. It may be a good - place to start for full-featured netdev implementations. - - * lib/netdev-vport.c provides support for "virtual ports" - implemented by the Open vSwitch datapath module for the Linux - kernel. This may serve as a model for minimal netdev - implementations. - - * lib/netdev-dummy.c is a fake netdev implementation useful only - for testing. - - -Porting Strategies ------------------- - -After a netdev provider has been implemented for a system's network -devices, you may choose among three basic porting strategies. - -The lowest-effort strategy is to use the "userspace switch" -implementation built into Open vSwitch. This ought to work, without -writing any more code, as long as the netdev provider that you -implemented supports receiving packets. It yields poor performance, -however, because every packet passes through the ovs-vswitchd process. -See INSTALL.userspace for instructions on how to configure a userspace -switch. - -If the userspace switch is not the right choice for your port, then -you will have to write more code. You may implement either an -"ofproto provider" or a "dpif provider". Which you should choose -depends on a few different factors: - - * Only an ofproto provider can take full advantage of hardware - with built-in support for wildcards (e.g. an ACL table or a - TCAM). - - * A dpif provider can take advantage of the Open vSwitch built-in - implementations of bonding, LACP, 802.1ag, 802.1Q VLANs, and - other features. An ofproto provider has to provide its own - implementations, if the hardware can support them at all. - - * A dpif provider is usually easier to implement, but most - appropriate for software switching. It "explodes" wildcard - rules into exact-match entries (with an optional wildcard mask). - This allows fast hash lookups in software, but makes - inefficient use of TCAMs in hardware that support wildcarding. - -The following sections describe how to implement each kind of port. - - -ofproto Providers ------------------ - -An "ofproto provider" is what ofproto uses to directly monitor and -control an OpenFlow-capable switch. struct ofproto_class, in -ofproto/ofproto-provider.h, defines the interfaces to implement an -ofproto provider for new hardware or software. That structure contains -many function pointers, each of which has a comment that is meant to -describe its behavior in detail. If the requirements are unclear, -please report this as a bug. - -The ofproto provider interface is preliminary. Please let us know if -it seems unsuitable for your purpose. We will try to improve it. - - -Writing a dpif Provider ------------------------ - -Open vSwitch has a built-in ofproto provider named "ofproto-dpif", -which is built on top of a library for manipulating datapaths, called -"dpif". A "datapath" is a simple flow table, one that is only required -to support exact-match flows, that is, flows without wildcards. When a -packet arrives on a network device, the datapath looks for it in this -table. If there is a match, then it performs the associated actions. -If there is no match, the datapath passes the packet up to ofproto-dpif, -which maintains the full OpenFlow flow table. If the packet matches in -this flow table, then ofproto-dpif executes its actions and inserts a -new entry into the dpif flow table. (Otherwise, ofproto-dpif passes the -packet up to ofproto to send the packet to the OpenFlow controller, if -one is configured.) - -When calculating the dpif flow, ofproto-dpif generates an exact-match -flow that describes the missed packet. It makes an effort to figure out -what fields can be wildcarded based on the switch's configuration and -OpenFlow flow table. The dpif is free to ignore the suggested wildcards -and only support the exact-match entry. However, if the dpif supports -wildcarding, then it can use the masks to match multiple flows with -fewer entries and potentially significantly reduce the number of flow -misses handled by ofproto-dpif. - -The "dpif" library in turn delegates much of its functionality to a -"dpif provider". The following diagram shows how dpif providers fit -into the Open vSwitch architecture: - - _ - | +-------------------+ - | | ovs-vswitchd |<-->ovsdb-server - | +-------------------+ - | | ofproto |<-->OpenFlow controllers - | +--------+-+--------+ _ - | | netdev | |ofproto-| | - userspace | +--------+ | dpif | | - | | netdev | +--------+ | - | |provider| | dpif | | - | +---||---+ +--------+ | - | || | dpif | | implementation of - | || |provider| | ofproto provider - |_ || +---||---+ | - || || | - _ +---||-----+---||---+ | - | | |datapath| | - kernel | | +--------+ _| - | | | - |_ +--------||---------+ - || - physical - NIC - -struct dpif_class, in lib/dpif-provider.h, defines the interfaces -required to implement a dpif provider for new hardware or software. -That structure contains many function pointers, each of which has a -comment that is meant to describe its behavior in detail. If the -requirements are unclear, please report this as a bug. - -There are two existing dpif implementations that may serve as -useful examples during a port: - - * lib/dpif-linux.c is a Linux-specific dpif implementation that - talks to an Open vSwitch-specific kernel module (whose sources - are in the "datapath" directory). The kernel module performs - all of the switching work, passing packets that do not match any - flow table entry up to userspace. This dpif implementation is - essentially a wrapper around calls into the kernel module. - - * lib/dpif-netdev.c is a generic dpif implementation that performs - all switching internally. This is how the Open vSwitch - userspace switch is implemented. - - -Miscellaneous Notes -------------------- - -Open vSwitch source code uses uint16_t, uint32_t, and uint64_t as -fixed-width types in host byte order, and ovs_be16, ovs_be32, and -ovs_be64 as fixed-width types in network byte order. Each of the -latter is equivalent to the one of the former, but the difference in -name makes the intended use obvious. - -The default "fail-mode" for Open vSwitch bridges is "standalone", -meaning that, when the OpenFlow controllers cannot be contacted, Open -vSwitch acts as a regular MAC-learning switch. This works well in -virtualization environments where there is normally just one uplink -(either a single physical interface or a bond). In a more general -environment, it can create loops. So, if you are porting to a -general-purpose switch platform, you should consider changing the -default "fail-mode" to "secure", which does not behave this way. See -documentation for the "fail-mode" column in the Bridge table in -ovs-vswitchd.conf.db(5) for more information. - -lib/entropy.c assumes that it can obtain high-quality random number -seeds at startup by reading from /dev/urandom. You will need to -modify it if this is not true on your platform. - -vswitchd/system-stats.c only knows how to obtain some statistics on -Linux. Optionally you may implement them for your platform as well. - - -Why OVS Does Not Support Hybrid Providers ------------------------------------------ - -The "Porting Strategies" section above describes the "ofproto -provider" and "dpif provider" porting strategies. Only an ofproto -provider can take advantage of hardware TCAM support, and only a dpif -provider can take advantage of the OVS built-in implementations of -various features. It is therefore tempting to suggest a hybrid -approach that shares the advantages of both strategies. - -However, Open vSwitch does not support a hybrid approach. Doing so -may be possible, with a significant amount of extra development work, -but it does not yet seem worthwhile, for the reasons explained below. - -First, user surprise is likely when a switch supports a feature only -with a high performance penalty. For example, one user questioned why -adding a particular OpenFlow action to a flow caused a 1,058x slowdown -on a hardware OpenFlow implementation [1]. The action required the -flow to be implemented in software. - -Given that implementing a flow in software on the slow management CPU -of a hardware switch causes a major slowdown, software-implemented -flows would only make sense for very low-volume traffic. But many of -the features built into the OVS software switch implementation would -need to apply to every flow to be useful. There is no value, for -example, in applying bonding or 802.1Q VLAN support only to low-volume -traffic. - -Besides supporting features of OpenFlow actions, a hybrid approach -could also support forms of matching not supported by particular -switching hardware, by sending all packets that might match a rule to -software. But again this can cause an unacceptable slowdown by -forcing bulk traffic through software in the hardware switch's slow -management CPU. Consider, for example, a hardware switch that can -match on the IPv6 Ethernet type but not on fields in IPv6 headers. An -OpenFlow table that matched on the IPv6 Ethernet type would perform -well, but adding a rule that matched only UDPv6 would force every IPv6 -packet to software, slowing down not just UDPv6 but all IPv6 -processing. - -[1] Aaron Rosen, "Modify packet fields extremely slow", - openflow-discuss mailing list, June 26, 2011, archived at - https://mailman.stanford.edu/pipermail/openflow-discuss/2011-June/002386.html. - - -Questions ---------- - -Please direct porting questions to dev@openvswitch.org. We will try -to use questions to improve this porting guide. diff -Nru openvswitch-2.3.1/PORTING.md openvswitch-2.4.0~git20150623/PORTING.md --- openvswitch-2.3.1/PORTING.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/PORTING.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,326 @@ +How to Port Open vSwitch to New Software or Hardware +==================================================== + +Open vSwitch (OVS) is intended to be easily ported to new software and +hardware platforms. This document describes the types of changes that +are most likely to be necessary in porting OVS to Unix-like platforms. +(Porting OVS to other kinds of platforms is likely to be more +difficult.) + + +Vocabulary +---------- + +For historical reasons, different words are used for essentially the +same concept in different areas of the Open vSwitch source tree. Here +is a concordance, indexed by the area of the source tree: + + datapath/ vport --- + vswitchd/ iface port + ofproto/ port bundle + ofproto/bond.c slave bond + lib/lacp.c slave lacp + lib/netdev.c netdev --- + database Interface Port + + +Open vSwitch Architectural Overview +----------------------------------- + +The following diagram shows the very high-level architecture of Open +vSwitch from a porter's perspective. + + +-------------------+ + | ovs-vswitchd |<-->ovsdb-server + +-------------------+ + | ofproto |<-->OpenFlow controllers + +--------+-+--------+ + | netdev | | ofproto| + +--------+ |provider| + | netdev | +--------+ + |provider| + +--------+ + +Some of the components are generic. Modulo bugs or inadequacies, +these components should not need to be modified as part of a port: + + - "ovs-vswitchd" is the main Open vSwitch userspace program, in + vswitchd/. It reads the desired Open vSwitch configuration from + the ovsdb-server program over an IPC channel and passes this + configuration down to the "ofproto" library. It also passes + certain status and statistical information from ofproto back + into the database. + + - "ofproto" is the Open vSwitch library, in ofproto/, that + implements an OpenFlow switch. It talks to OpenFlow controllers + over the network and to switch hardware or software through an + "ofproto provider", explained further below. + + - "netdev" is the Open vSwitch library, in lib/netdev.c, that + abstracts interacting with network devices, that is, Ethernet + interfaces. The netdev library is a thin layer over "netdev + provider" code, explained further below. + +The other components may need attention during a port. You will +almost certainly have to implement a "netdev provider". Depending on +the type of port you are doing and the desired performance, you may +also have to implement an "ofproto provider" or a lower-level +component called a "dpif" provider. + +The following sections talk about these components in more detail. + + +Writing a netdev Provider +------------------------- + +A "netdev provider" implements an operating system and hardware +specific interface to "network devices", e.g. eth0 on Linux. Open +vSwitch must be able to open each port on a switch as a netdev, so you +will need to implement a "netdev provider" that works with your switch +hardware and software. + +struct netdev_class, in lib/netdev-provider.h, defines the interfaces +required to implement a netdev. That structure contains many function +pointers, each of which has a comment that is meant to describe its +behavior in detail. If the requirements are unclear, please report +this as a bug. + +The netdev interface can be divided into a few rough categories: + + * Functions required to properly implement OpenFlow features. For + example, OpenFlow requires the ability to report the Ethernet + hardware address of a port. These functions must be implemented + for minimally correct operation. + + * Functions required to implement optional Open vSwitch features. + For example, the Open vSwitch support for in-band control + requires netdev support for inspecting the TCP/IP stack's ARP + table. These functions must be implemented if the corresponding + OVS features are to work, but may be omitted initially. + + * Functions needed in some implementations but not in others. For + example, most kinds of ports (see below) do not need + functionality to receive packets from a network device. + +The existing netdev implementations may serve as useful examples +during a port: + + * lib/netdev-linux.c implements netdev functionality for Linux + network devices, using Linux kernel calls. It may be a good + place to start for full-featured netdev implementations. + + * lib/netdev-vport.c provides support for "virtual ports" + implemented by the Open vSwitch datapath module for the Linux + kernel. This may serve as a model for minimal netdev + implementations. + + * lib/netdev-dummy.c is a fake netdev implementation useful only + for testing. + + +Porting Strategies +------------------ + +After a netdev provider has been implemented for a system's network +devices, you may choose among three basic porting strategies. + +The lowest-effort strategy is to use the "userspace switch" +implementation built into Open vSwitch. This ought to work, without +writing any more code, as long as the netdev provider that you +implemented supports receiving packets. It yields poor performance, +however, because every packet passes through the ovs-vswitchd process. +See [INSTALL.userspace.md] for instructions on how to configure a +userspace switch. + +If the userspace switch is not the right choice for your port, then +you will have to write more code. You may implement either an +"ofproto provider" or a "dpif provider". Which you should choose +depends on a few different factors: + + * Only an ofproto provider can take full advantage of hardware + with built-in support for wildcards (e.g. an ACL table or a + TCAM). + + * A dpif provider can take advantage of the Open vSwitch built-in + implementations of bonding, LACP, 802.1ag, 802.1Q VLANs, and + other features. An ofproto provider has to provide its own + implementations, if the hardware can support them at all. + + * A dpif provider is usually easier to implement, but most + appropriate for software switching. It "explodes" wildcard + rules into exact-match entries (with an optional wildcard mask). + This allows fast hash lookups in software, but makes + inefficient use of TCAMs in hardware that support wildcarding. + +The following sections describe how to implement each kind of port. + + +ofproto Providers +----------------- + +An "ofproto provider" is what ofproto uses to directly monitor and +control an OpenFlow-capable switch. struct ofproto_class, in +ofproto/ofproto-provider.h, defines the interfaces to implement an +ofproto provider for new hardware or software. That structure contains +many function pointers, each of which has a comment that is meant to +describe its behavior in detail. If the requirements are unclear, +please report this as a bug. + +The ofproto provider interface is preliminary. Please let us know if +it seems unsuitable for your purpose. We will try to improve it. + + +Writing a dpif Provider +----------------------- + +Open vSwitch has a built-in ofproto provider named "ofproto-dpif", +which is built on top of a library for manipulating datapaths, called +"dpif". A "datapath" is a simple flow table, one that is only required +to support exact-match flows, that is, flows without wildcards. When a +packet arrives on a network device, the datapath looks for it in this +table. If there is a match, then it performs the associated actions. +If there is no match, the datapath passes the packet up to ofproto-dpif, +which maintains the full OpenFlow flow table. If the packet matches in +this flow table, then ofproto-dpif executes its actions and inserts a +new entry into the dpif flow table. (Otherwise, ofproto-dpif passes the +packet up to ofproto to send the packet to the OpenFlow controller, if +one is configured.) + +When calculating the dpif flow, ofproto-dpif generates an exact-match +flow that describes the missed packet. It makes an effort to figure out +what fields can be wildcarded based on the switch's configuration and +OpenFlow flow table. The dpif is free to ignore the suggested wildcards +and only support the exact-match entry. However, if the dpif supports +wildcarding, then it can use the masks to match multiple flows with +fewer entries and potentially significantly reduce the number of flow +misses handled by ofproto-dpif. + +The "dpif" library in turn delegates much of its functionality to a +"dpif provider". The following diagram shows how dpif providers fit +into the Open vSwitch architecture: + + _ + | +-------------------+ + | | ovs-vswitchd |<-->ovsdb-server + | +-------------------+ + | | ofproto |<-->OpenFlow controllers + | +--------+-+--------+ _ + | | netdev | |ofproto-| | + userspace | +--------+ | dpif | | + | | netdev | +--------+ | + | |provider| | dpif | | + | +---||---+ +--------+ | + | || | dpif | | implementation of + | || |provider| | ofproto provider + |_ || +---||---+ | + || || | + _ +---||-----+---||---+ | + | | |datapath| | + kernel | | +--------+ _| + | | | + |_ +--------||---------+ + || + physical + NIC + +struct dpif_class, in lib/dpif-provider.h, defines the interfaces +required to implement a dpif provider for new hardware or software. +That structure contains many function pointers, each of which has a +comment that is meant to describe its behavior in detail. If the +requirements are unclear, please report this as a bug. + +There are two existing dpif implementations that may serve as +useful examples during a port: + + * lib/dpif-netlink.c is a Linux-specific dpif implementation that + talks to an Open vSwitch-specific kernel module (whose sources + are in the "datapath" directory). The kernel module performs + all of the switching work, passing packets that do not match any + flow table entry up to userspace. This dpif implementation is + essentially a wrapper around calls into the kernel module. + + * lib/dpif-netdev.c is a generic dpif implementation that performs + all switching internally. This is how the Open vSwitch + userspace switch is implemented. + + +Miscellaneous Notes +------------------- + +Open vSwitch source code uses uint16_t, uint32_t, and uint64_t as +fixed-width types in host byte order, and ovs_be16, ovs_be32, and +ovs_be64 as fixed-width types in network byte order. Each of the +latter is equivalent to the one of the former, but the difference in +name makes the intended use obvious. + +The default "fail-mode" for Open vSwitch bridges is "standalone", +meaning that, when the OpenFlow controllers cannot be contacted, Open +vSwitch acts as a regular MAC-learning switch. This works well in +virtualization environments where there is normally just one uplink +(either a single physical interface or a bond). In a more general +environment, it can create loops. So, if you are porting to a +general-purpose switch platform, you should consider changing the +default "fail-mode" to "secure", which does not behave this way. See +documentation for the "fail-mode" column in the Bridge table in +ovs-vswitchd.conf.db(5) for more information. + +lib/entropy.c assumes that it can obtain high-quality random number +seeds at startup by reading from /dev/urandom. You will need to +modify it if this is not true on your platform. + +vswitchd/system-stats.c only knows how to obtain some statistics on +Linux. Optionally you may implement them for your platform as well. + + +Why OVS Does Not Support Hybrid Providers +----------------------------------------- + +The "Porting Strategies" section above describes the "ofproto +provider" and "dpif provider" porting strategies. Only an ofproto +provider can take advantage of hardware TCAM support, and only a dpif +provider can take advantage of the OVS built-in implementations of +various features. It is therefore tempting to suggest a hybrid +approach that shares the advantages of both strategies. + +However, Open vSwitch does not support a hybrid approach. Doing so +may be possible, with a significant amount of extra development work, +but it does not yet seem worthwhile, for the reasons explained below. + +First, user surprise is likely when a switch supports a feature only +with a high performance penalty. For example, one user questioned why +adding a particular OpenFlow action to a flow caused a 1,058x slowdown +on a hardware OpenFlow implementation [1]. The action required the +flow to be implemented in software. + +Given that implementing a flow in software on the slow management CPU +of a hardware switch causes a major slowdown, software-implemented +flows would only make sense for very low-volume traffic. But many of +the features built into the OVS software switch implementation would +need to apply to every flow to be useful. There is no value, for +example, in applying bonding or 802.1Q VLAN support only to low-volume +traffic. + +Besides supporting features of OpenFlow actions, a hybrid approach +could also support forms of matching not supported by particular +switching hardware, by sending all packets that might match a rule to +software. But again this can cause an unacceptable slowdown by +forcing bulk traffic through software in the hardware switch's slow +management CPU. Consider, for example, a hardware switch that can +match on the IPv6 Ethernet type but not on fields in IPv6 headers. An +OpenFlow table that matched on the IPv6 Ethernet type would perform +well, but adding a rule that matched only UDPv6 would force every IPv6 +packet to software, slowing down not just UDPv6 but all IPv6 +processing. + +[1] Aaron Rosen, "Modify packet fields extremely slow", + openflow-discuss mailing list, June 26, 2011, archived at + https://mailman.stanford.edu/pipermail/openflow-discuss/2011-June/002386.html. + + +Questions +--------- + +Please direct porting questions to dev@openvswitch.org. We will try +to use questions to improve this porting guide. + +[INSTALL.userspace.md]:INSTALL.userspace.md diff -Nru openvswitch-2.3.1/python/automake.mk openvswitch-2.4.0~git20150623/python/automake.mk --- openvswitch-2.3.1/python/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -35,6 +35,17 @@ python/ovs/version.py \ python/ovs/vlog.py +# These python files are used at build time but not runtime, +# so they are not installed. +EXTRA_DIST += \ + python/build/__init__.py \ + python/build/nroff.py + +# PyPI support. +EXTRA_DIST += \ + python/README.rst \ + python/setup.py + PYFILES = $(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles) EXTRA_DIST += $(PYFILES) PYCOV_CLEAN_FILES += $(PYFILES:.py=.py,cover) @@ -56,6 +67,12 @@ $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs $(INSTALL_DATA) python/ovs/dirs.py.tmp $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py rm python/ovs/dirs.py.tmp + +python-sdist: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py + (cd python/ && $(PYTHON) setup.py sdist) + +pypi-upload: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py + (cd python/ && $(PYTHON) setup.py sdist upload) else ovs-install-data-local: @: @@ -68,13 +85,13 @@ ALL_LOCAL += $(srcdir)/python/ovs/version.py $(srcdir)/python/ovs/version.py: config.status - $(ro_shell) > $(@F).tmp - echo 'VERSION = "$(VERSION)"' >> $(@F).tmp + $(AM_V_GEN)$(ro_shell) > $(@F).tmp && \ + echo 'VERSION = "$(VERSION)"' >> $(@F).tmp && \ if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi ALL_LOCAL += $(srcdir)/python/ovs/dirs.py $(srcdir)/python/ovs/dirs.py: python/ovs/dirs.py.template - sed \ + $(AM_V_GEN)sed \ -e '/^##/d' \ -e 's,[@]pkgdatadir[@],/usr/local/share/openvswitch,g' \ -e 's,[@]RUNDIR[@],/var/run,g' \ @@ -82,6 +99,6 @@ -e 's,[@]bindir[@],/usr/local/bin,g' \ -e 's,[@]sysconfdir[@],/usr/local/etc,g' \ -e 's,[@]DBDIR[@],/usr/local/etc/openvswitch,g' \ - < $? > $@.tmp + < $? > $@.tmp && \ mv $@.tmp $@ EXTRA_DIST += python/ovs/dirs.py python/ovs/dirs.py.template diff -Nru openvswitch-2.3.1/python/build/nroff.py openvswitch-2.4.0~git20150623/python/build/nroff.py --- openvswitch-2.3.1/python/build/nroff.py 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/build/nroff.py 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,185 @@ +# Copyright (c) 2010, 2011, 2012, 2015 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re + +from ovs.db import error + +def textToNroff(s, font=r'\fR'): + def escape(match): + c = match.group(0) + + # In Roman type, let -- in XML be \- in nroff. That gives us a way to + # write minus signs, which is important in some places in manpages. + # + # Bold in nroff usually represents literal text, where there's no + # distinction between hyphens and minus sign. The convention in nroff + # appears to be to use a minus sign in such cases, so we follow that + # convention. + # + # Finally, we always output - as a minus sign when it is followed by a + # digit. + if c.startswith('-'): + if c == '--' and font == r'\fR': + return r'\-' + if c != '-' or font in (r'\fB', r'\fL'): + return c.replace('-', r'\-') + else: + return '-' + + if c == '\\': + return r'\e' + elif c == '"': + return r'\(dq' + elif c == "'": + return r'\(cq' + elif c == ".": + # groff(7) says that . can be escaped by \. but in practice groff + # still gives an error with \. at the beginning of a line. + return font + "." + else: + raise error.Error("bad escape") + + # Escape - \ " ' . as needed by nroff. + s = re.sub('(-[0-9]|--|[-"\'\\\\.])', escape, s) + return s + +def escapeNroffLiteral(s, font=r'\fB'): + return font + r'%s\fR' % textToNroff(s, font) + +def inlineXmlToNroff(node, font, to_upper=False): + if node.nodeType == node.TEXT_NODE: + if to_upper: + return textToNroff(node.data.upper(), font) + else: + return textToNroff(node.data, font) + elif node.nodeType == node.ELEMENT_NODE: + if node.tagName in ['code', 'em', 'option']: + s = r'\fB' + for child in node.childNodes: + s += inlineXmlToNroff(child, r'\fB') + return s + font + elif node.tagName == 'ref': + s = r'\fB' + if node.hasAttribute('column'): + s += node.attributes['column'].nodeValue + if node.hasAttribute('key'): + s += ':' + node.attributes['key'].nodeValue + elif node.hasAttribute('table'): + s += node.attributes['table'].nodeValue + elif node.hasAttribute('group'): + s += node.attributes['group'].nodeValue + elif node.hasAttribute('db'): + s += node.attributes['db'].nodeValue + else: + raise error.Error("'ref' lacks required attributes: %s" % node.attributes.keys()) + return s + font + elif node.tagName == 'var' or node.tagName == 'dfn': + s = r'\fI' + for child in node.childNodes: + s += inlineXmlToNroff(child, r'\fI') + return s + font + else: + raise error.Error("element <%s> unknown or invalid here" % node.tagName) + else: + raise error.Error("unknown node %s in inline xml" % node) + +def pre_to_nroff(nodes, para, font): + s = para + '\n.nf\n' + for node in nodes: + if node.nodeType != node.TEXT_NODE: + fatal("
     element may only have text children")
    +        for line in node.data.split('\n'):
    +            s += escapeNroffLiteral(line, font) + '\n.br\n'
    +    s += '.fi\n'
    +    return s
    +
    +def blockXmlToNroff(nodes, para='.PP'):
    +    s = ''
    +    for node in nodes:
    +        if node.nodeType == node.TEXT_NODE:
    +            s += textToNroff(node.data)
    +            s = s.lstrip()
    +        elif node.nodeType == node.ELEMENT_NODE:
    +            if node.tagName in ['ul', 'ol']:
    +                if s != "":
    +                    s += "\n"
    +                s += ".RS\n"
    +                i = 0
    +                for liNode in node.childNodes:
    +                    if (liNode.nodeType == node.ELEMENT_NODE
    +                        and liNode.tagName == 'li'):
    +                        i += 1
    +                        if node.tagName == 'ul':
    +                            s += ".IP \\(bu\n"
    +                        else:
    +                            s += ".IP %d. .25in\n" % i
    +                        s += blockXmlToNroff(liNode.childNodes, ".IP")
    +                    elif (liNode.nodeType != node.TEXT_NODE
    +                          or not liNode.data.isspace()):
    +                        raise error.Error("<%s> element may only have 
  • children" % node.tagName) + s += ".RE\n" + elif node.tagName == 'dl': + if s != "": + s += "\n" + s += ".RS\n" + prev = "dd" + for liNode in node.childNodes: + if (liNode.nodeType == node.ELEMENT_NODE + and liNode.tagName == 'dt'): + if prev == 'dd': + s += '.TP\n' + else: + s += '.TQ .5in\n' + prev = 'dt' + elif (liNode.nodeType == node.ELEMENT_NODE + and liNode.tagName == 'dd'): + if prev == 'dd': + s += '.IP\n' + prev = 'dd' + elif (liNode.nodeType != node.TEXT_NODE + or not liNode.data.isspace()): + raise error.Error("
    element may only have
    and
    children") + s += blockXmlToNroff(liNode.childNodes, ".IP") + s += ".RE\n" + elif node.tagName == 'p': + if s != "": + if not s.endswith("\n"): + s += "\n" + s += para + "\n" + s += blockXmlToNroff(node.childNodes, para) + elif node.tagName in ('h1', 'h2', 'h3'): + if s != "": + if not s.endswith("\n"): + s += "\n" + nroffTag = {'h1': 'SH', 'h2': 'SS', 'h3': 'ST'}[node.tagName] + s += '.%s "' % nroffTag + for child_node in node.childNodes: + s += inlineXmlToNroff(child_node, r'\fR', + to_upper=(nroffTag == 'SH')) + s += '"\n' + elif node.tagName == 'pre': + fixed = node.getAttribute('fixed') + if fixed == 'yes': + font = r'\fL' + else: + font = r'\fB' + s += pre_to_nroff(node.childNodes, para, font) + else: + s += inlineXmlToNroff(node, r'\fR') + else: + raise error.Error("unknown node %s in block xml" % node) + if s != "" and not s.endswith('\n'): + s += '\n' + return s diff -Nru openvswitch-2.3.1/python/.gitignore openvswitch-2.4.0~git20150623/python/.gitignore --- openvswitch-2.3.1/python/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2 @@ +dist/ +*.egg-info diff -Nru openvswitch-2.3.1/python/ovs/db/idl.py openvswitch-2.4.0~git20150623/python/ovs/db/idl.py --- openvswitch-2.3.1/python/ovs/db/idl.py 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/ovs/db/idl.py 2015-06-23 18:46:21.000000000 +0000 @@ -26,8 +26,12 @@ __pychecker__ = 'no-classattr no-objattrs' +ROW_CREATE = "create" +ROW_UPDATE = "update" +ROW_DELETE = "delete" -class Idl: + +class Idl(object): """Open vSwitch Database Interface Definition Language (OVSDB IDL). The OVSDB IDL maintains an in-memory replica of a database. It issues RPC @@ -264,6 +268,17 @@ self.lock_name = lock_name self.__send_lock_request() + def notify(self, event, row, updates=None): + """Hook for implementing create/update/delete notifications + + :param event: The event that was triggered + :type event: ROW_CREATE, ROW_UPDATE, or ROW_DELETE + :param row: The row as it is after the operation has occured + :type row: Row + :param updates: For updates, a Row object with just the changed columns + :type updates: Row + """ + def __clear(self): changed = False @@ -386,6 +401,7 @@ if row: del table.rows[uuid] changed = True + self.notify(ROW_DELETE, row) else: # XXX rate-limit vlog.warn("cannot delete missing row %s from table %s" @@ -401,15 +417,19 @@ % (uuid, table.name)) if self.__row_update(table, row, new): changed = True + self.notify(ROW_CREATE, row) else: + op = ROW_UPDATE if not row: row = self.__create_row(table, uuid) changed = True + op = ROW_CREATE # XXX rate-limit vlog.warn("cannot modify missing row %s in table %s" % (uuid, table.name)) if self.__row_update(table, row, new): changed = True + self.notify(op, row, Row.from_json(self, table, uuid, old)) return changed def __row_update(self, table, row, row_json): @@ -570,6 +590,26 @@ return self._idl.txn._write(self, column, datum) + @classmethod + def from_json(cls, idl, table, uuid, row_json): + data = {} + for column_name, datum_json in row_json.iteritems(): + column = table.columns.get(column_name) + if not column: + # XXX rate-limit + vlog.warn("unknown column %s in table %s" + % (column_name, table.name)) + continue + try: + datum = ovs.db.data.Datum.from_json(column.type, datum_json) + except error.Error, e: + # XXX rate-limit + vlog.warn("error parsing column %s in table %s: %s" + % (column_name, table.name, e)) + continue + data[column_name] = datum + return cls(idl, table, uuid, data) + def verify(self, column_name): """Causes the original contents of column 'column_name' in this row to be verified as a prerequisite to completing the transaction. That is, diff -Nru openvswitch-2.3.1/python/ovs/.gitignore openvswitch-2.4.0~git20150623/python/ovs/.gitignore --- openvswitch-2.3.1/python/ovs/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/ovs/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1 @@ +version.py diff -Nru openvswitch-2.3.1/python/ovs/socket_util.py openvswitch-2.4.0~git20150623/python/ovs/socket_util.py --- openvswitch-2.3.1/python/ovs/socket_util.py 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/ovs/socket_util.py 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2012, 2014 Nicira, Inc. +# Copyright (c) 2010, 2012, 2014, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -213,14 +213,16 @@ is_addr_inet = is_valid_ipv4_address(address[0]) if is_addr_inet: sock = socket.socket(socket.AF_INET, style, 0) + family = socket.AF_INET else: sock = socket.socket(socket.AF_INET6, style, 0) + family = socket.AF_INET6 except socket.error, e: return get_exception_errno(e), None try: set_nonblocking(sock) - set_dscp(sock, dscp) + set_dscp(sock, family, dscp) try: sock.connect(address) except socket.error, e: @@ -292,21 +294,20 @@ % os.strerror(get_exception_errno(e))) -def set_dscp(sock, dscp): +def set_dscp(sock, family, dscp): if dscp > 63: raise ValueError("Invalid dscp %d" % dscp) - # Note: this function is used for both of IPv4 and IPv6 sockets - success = False val = dscp << 2 - try: - sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, val) - except socket.error, e: - if get_exception_errno(e) != errno.ENOPROTOOPT: + if family == socket.AF_INET: + try: + sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, val) + except socket.error, e: raise - success = True - try: - sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_TCLASS, val) - except socket.error, e: - if get_exception_errno(e) != errno.ENOPROTOOPT or not success: + elif family == socket.AF_INET6: + try: + sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_TCLASS, val) + except socket.error, e: raise + else: + raise diff -Nru openvswitch-2.3.1/python/ovs/timeval.py openvswitch-2.4.0~git20150623/python/ovs/timeval.py --- openvswitch-2.3.1/python/ovs/timeval.py 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/ovs/timeval.py 2015-06-23 18:46:21.000000000 +0000 @@ -12,13 +12,65 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys import time +try: + import ctypes + + LIBRT = 'librt.so.1' + clock_gettime_name = 'clock_gettime' + + if sys.platform.startswith("linux"): + CLOCK_MONOTONIC = 1 + time_t = ctypes.c_long + elif sys.platform.startswith("netbsd"): + # NetBSD uses function renaming for ABI versioning. While the proper + # way to get the appropriate version is of course "#include ", + # it is difficult with ctypes. The following is appropriate for + # recent versions of NetBSD, including NetBSD-6. + LIBRT = 'libc.so.12' + clock_gettime_name = '__clock_gettime50' + CLOCK_MONOTONIC = 3 + time_t = ctypes.c_int64 + elif sys.platform.startswith("freebsd"): + CLOCK_MONOTONIC = 4 + time_t = ctypes.c_int64 + else: + raise Exception + + class timespec(ctypes.Structure): + _fields_ = [ + ('tv_sec', time_t), + ('tv_nsec', ctypes.c_long), + ] + + librt = ctypes.CDLL(LIBRT) + clock_gettime = getattr(librt, clock_gettime_name) + clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)] +except: + # Librt shared library could not be loaded + librt = None + +def monotonic(): + if not librt: + return time.time() + + t = timespec() + if clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(t)) == 0: + return t.tv_sec + t.tv_nsec * 1e-9 + # Kernel does not support CLOCK_MONOTONIC + return time.time() + +# Use time.monotonic() if Python version >= 3.3 +if not hasattr(time, 'monotonic'): + time.monotonic = monotonic def msec(): - """Returns the current time, as the amount of time since the epoch, in - milliseconds, as a float.""" - return time.time() * 1000.0 + """ Returns the system's monotonic time if possible, otherwise returns the + current time as the amount of time since the epoch, in milliseconds, as a + float.""" + return time.monotonic() * 1000.0 def postfork(): diff -Nru openvswitch-2.3.1/python/ovs/version.py openvswitch-2.4.0~git20150623/python/ovs/version.py --- openvswitch-2.3.1/python/ovs/version.py 2014-12-04 06:00:32.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/ovs/version.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -# Generated automatically -- do not modify! -*- buffer-read-only: t -*- -VERSION = "2.3.1" diff -Nru openvswitch-2.3.1/python/ovs/vlog.py openvswitch-2.4.0~git20150623/python/ovs/vlog.py --- openvswitch-2.3.1/python/ovs/vlog.py 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/ovs/vlog.py 2015-06-23 18:46:21.000000000 +0000 @@ -26,7 +26,7 @@ import ovs.unixctl import ovs.util -FACILITIES = {"console": "info", "file": "info", "syslog": "info"} +DESTINATIONS = {"console": "info", "file": "info", "syslog": "info"} PATTERNS = { "console": "%D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m", "file": "%D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m", @@ -40,6 +40,11 @@ "emer": logging.CRITICAL, "off": logging.CRITICAL } +FACILITIES = ['auth', 'authpriv', 'cron', 'daemon', 'ftp', 'kern', 'lpr', + 'mail', 'news', 'syslog', 'user', 'uucp', 'local0', 'local1', + 'local2', 'local3', 'local4', 'local5', 'local6', 'local7'] +syslog_facility = "daemon" +syslog_handler = '' def get_level(level_str): @@ -50,7 +55,7 @@ __inited = False __msg_num = 0 __start_time = 0 - __mfl = {} # Module -> facility -> level + __mfl = {} # Module -> destination -> level __log_file = None __file_handler = None __log_patterns = PATTERNS @@ -63,7 +68,7 @@ assert not Vlog.__inited self.name = name.lower() if name not in Vlog.__mfl: - Vlog.__mfl[self.name] = FACILITIES.copy() + Vlog.__mfl[self.name] = DESTINATIONS.copy() def __log(self, level, message, **kwargs): if not Vlog.__inited: @@ -79,8 +84,8 @@ msg = self._build_message(message, f, level, msg_num) logging.getLogger(f).log(level_num, msg, **kwargs) - def _build_message(self, message, facility, level, msg_num): - pattern = self.__log_patterns[facility] + def _build_message(self, message, destination, level, msg_num): + pattern = self.__log_patterns[destination] tmp = pattern tmp = self._format_time(tmp) @@ -216,7 +221,7 @@ Vlog.__start_time = datetime.datetime.utcnow() logging.raiseExceptions = False Vlog.__log_file = log_file - for f in FACILITIES: + for f in DESTINATIONS: logger = logging.getLogger(f) logger.setLevel(logging.DEBUG) @@ -224,9 +229,7 @@ if f == "console": logger.addHandler(logging.StreamHandler(sys.stderr)) elif f == "syslog": - logger.addHandler(logging.handlers.SysLogHandler( - address="/dev/log", - facility=logging.handlers.SysLogHandler.LOG_DAEMON)) + Vlog.add_syslog_handler() elif f == "file" and Vlog.__log_file: Vlog.__file_handler = logging.FileHandler(Vlog.__log_file) logger.addHandler(Vlog.__file_handler) @@ -241,17 +244,17 @@ Vlog._unixctl_vlog_list, None) @staticmethod - def set_level(module, facility, level): - """ Sets the log level of the 'module'-'facility' tuple to 'level'. + def set_level(module, destination, level): + """ Sets the log level of the 'module'-'destination' tuple to 'level'. All three arguments are strings which are interpreted the same as arguments to the --verbose flag. Should be called after all Vlog objects have already been created.""" module = module.lower() - facility = facility.lower() + destination = destination.lower() level = level.lower() - if facility != "any" and facility not in FACILITIES: + if destination != "any" and destination not in DESTINATIONS: return if module != "any" and module not in Vlog.__mfl: @@ -265,47 +268,80 @@ else: modules = [module] - if facility == "any": - facilities = FACILITIES.keys() + if destination == "any": + destinations = DESTINATIONS.keys() else: - facilities = [facility] + destinations = [destination] for m in modules: - for f in facilities: + for f in destinations: Vlog.__mfl[m][f] = level @staticmethod - def set_pattern(facility, pattern): - """ Sets the log pattern of the 'facility' to 'pattern' """ - facility = facility.lower() - Vlog.__log_patterns[facility] = pattern + def set_pattern(destination, pattern): + """ Sets the log pattern of the 'destination' to 'pattern' """ + destination = destination.lower() + Vlog.__log_patterns[destination] = pattern + + @staticmethod + def add_syslog_handler(facility=None): + global syslog_facility, syslog_handler + + # If handler is already added and there is no change in 'facility', + # there is nothing to do. + if (not facility or facility == syslog_facility) and syslog_handler: + return + + logger = logging.getLogger('syslog') + # If there is no infrastructure to support python syslog, increase + # the logging severity level to avoid repeated errors. + if not os.path.exists("/dev/log"): + logger.setLevel(logging.CRITICAL) + return + + if syslog_handler: + logger.removeHandler(syslog_handler) + + if facility: + syslog_facility = facility + + syslog_handler = logging.handlers.SysLogHandler(address="/dev/log", + facility=syslog_facility) + logger.addHandler(syslog_handler) + return @staticmethod def set_levels_from_string(s): module = None level = None - facility = None + destination = None words = re.split('[ :]', s) if words[0] == "pattern": try: - if words[1] in FACILITIES and words[2]: + if words[1] in DESTINATIONS and words[2]: segments = [words[i] for i in range(2, len(words))] pattern = "".join(segments) Vlog.set_pattern(words[1], pattern) return else: - return "Facility %s does not exist" % words[1] + return "Destination %s does not exist" % words[1] except IndexError: - return "Please supply a valid pattern and facility" + return "Please supply a valid pattern and destination" + elif words[0] == "FACILITY": + if words[1] in FACILITIES: + Vlog.add_syslog_handler(words[1]) + return + else: + return "Facility %s is invalid" % words[1] for word in [w.lower() for w in words]: if word == "any": pass - elif word in FACILITIES: - if facility: - return "cannot specify multiple facilities" - facility = word + elif word in DESTINATIONS: + if destination: + return "cannot specify multiple destinations" + destination = word elif word in LEVELS: if level: return "cannot specify multiple levels" @@ -315,9 +351,9 @@ return "cannot specify multiple modules" module = word else: - return "no facility, level, or module \"%s\"" % word + return "no destination, level, or module \"%s\"" % word - Vlog.set_level(module or "any", facility or "any", level or "any") + Vlog.set_level(module or "any", destination or "any", level or "any") @staticmethod def get_levels(): diff -Nru openvswitch-2.3.1/python/README.rst openvswitch-2.4.0~git20150623/python/README.rst --- openvswitch-2.3.1/python/README.rst 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/README.rst 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1 @@ +Python library for working with Open vSwitch diff -Nru openvswitch-2.3.1/python/setup.py openvswitch-2.4.0~git20150623/python/setup.py --- openvswitch-2.3.1/python/setup.py 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/python/setup.py 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,46 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import print_function +import sys + +import setuptools + +VERSION = "unknown" + +try: + # Try to set the version from the generated ovs/version.py + execfile("ovs/version.py") +except IOError: + print("Ensure version.py is created by running make python/ovs/version.py", + file=sys.stderr) + sys.exit(-1) + + +setuptools.setup( + name='ovs', + description='Open vSwitch library', + version=VERSION, + url='http://www.openvswitch.org/', + author='Open vSwitch', + author_email='dev@openvswitch.org', + packages=['ovs', 'ovs.db', 'ovs.unixctl'], + keywords=['openvswitch', 'ovs', 'OVSDB'], + license='Apache 2.0', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Topic :: Database :: Front-Ends', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: System :: Networking', + 'License :: OSI Approved :: Apache Software License' + ] +) diff -Nru openvswitch-2.3.1/README openvswitch-2.4.0~git20150623/README --- openvswitch-2.3.1/README 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ - Open vSwitch - -What is Open vSwitch? ---------------------- - -Open vSwitch is a multilayer software switch licensed under the open -source Apache 2 license. Our goal is to implement a production -quality switch platform that supports standard management interfaces -and opens the forwarding functions to programmatic extension and -control. - -Open vSwitch is well suited to function as a virtual switch in VM -environments. In addition to exposing standard control and visibility -interfaces to the virtual networking layer, it was designed to support -distribution across multiple physical servers. Open vSwitch supports -multiple Linux-based virtualization technologies including -Xen/XenServer, KVM, and VirtualBox. - -The bulk of the code is written in platform-independent C and is -easily ported to other environments. The current release of Open -vSwitch supports the following features: - - * Standard 802.1Q VLAN model with trunk and access ports - * NIC bonding with or without LACP on upstream switch - * NetFlow, sFlow(R), and mirroring for increased visibility - * QoS (Quality of Service) configuration, plus policing - * GRE, GRE over IPSEC, VXLAN, and LISP tunneling - * 802.1ag connectivity fault management - * OpenFlow 1.0 plus numerous extensions - * Transactional configuration database with C and Python bindings - * High-performance forwarding using a Linux kernel module - -The included Linux kernel module supports Linux 2.6.32 and up, with -testing focused on 2.6.32 with Centos and Xen patches. Open vSwitch -also has special support for Citrix XenServer and Red Hat Enterprise -Linux hosts. - -Open vSwitch can also operate, at a cost in performance, entirely in -userspace, without assistance from a kernel module. This userspace -implementation should be easier to port than the kernel-based switch. -It is considered experimental. - -What's here? ------------- - -The main components of this distribution are: - - * ovs-vswitchd, a daemon that implements the switch, along with - a companion Linux kernel module for flow-based switching. - - * ovsdb-server, a lightweight database server that ovs-vswitchd - queries to obtain its configuration. - - * ovs-dpctl, a tool for configuring the switch kernel module. - - * Scripts and specs for building RPMs for Citrix XenServer and Red - Hat Enterprise Linux. The XenServer RPMs allow Open vSwitch to - be installed on a Citrix XenServer host as a drop-in replacement - for its switch, with additional functionality. - - * ovs-vsctl, a utility for querying and updating the configuration - of ovs-vswitchd. - - * ovs-appctl, a utility that sends commands to running Open - vSwitch daemons. - -Open vSwitch also provides some tools: - - * ovs-ofctl, a utility for querying and controlling OpenFlow - switches and controllers. - - * ovs-pki, a utility for creating and managing the public-key - infrastructure for OpenFlow switches. - - * A patch to tcpdump that enables it to parse OpenFlow messages. - -What other documentation is available? --------------------------------------- - -To install Open vSwitch on a regular Linux or FreeBSD host, please -read INSTALL. For specifics around installation on a specific -platform, please see one of these files: - - - INSTALL.Debian - - INSTALL.Fedora - - INSTALL.RHEL - - INSTALL.XenServer - -To use Open vSwitch... - - - ...with KVM on Linux, read INSTALL, read INSTALL.KVM. - - - ...with Libvirt, read INSTALL.Libvirt. - - - ...without using a kernel module, read INSTALL.userspace. - -For answers to common questions, read FAQ. - -To learn how to set up SSL support for Open vSwitch, read INSTALL.SSL. - -To learn about some advanced features of the Open vSwitch software -switch, read the tutorial in tutorial/Tutorial. - -Each Open vSwitch userspace program is accompanied by a manpage. Many -of the manpages are customized to your configuration as part of the -build process, so we recommend building Open vSwitch before reading -the manpages. - -Contact -------- - -bugs@openvswitch.org -http://openvswitch.org/ diff -Nru openvswitch-2.3.1/README-lisp openvswitch-2.4.0~git20150623/README-lisp --- openvswitch-2.3.1/README-lisp 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/README-lisp 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -Using LISP tunneling -==================== - -LISP is a layer 3 tunneling mechanism, meaning that encapsulated packets do -not carry Ethernet headers, and ARP requests shouldn't be sent over the -tunnel. Because of this, there are some additional steps required for setting -up LISP tunnels in Open vSwitch, until support for L3 tunnels will improve. - -This guide assumes tunneling between two VMs connected to OVS bridges on -different hypervisors reachable over IPv4. Of course, more than one VM may be -connected to any of the hypervisors, and a hypervisor may communicate with -several different hypervisors over the same lisp tunneling interface. A LISP -"map-cache" can be implemented using flows, see example at the bottom of this -file. - -There are several scenarios: - - 1) the VMs have IP addresses in the same subnet and the hypervisors are also - in a single subnet (although one different from the VM's); - 2) the VMs have IP addresses in the same subnet but the hypervisors are - separated by a router; - 3) the VMs are in different subnets. - -In cases 1) and 3) ARP resolution can work as normal: ARP traffic is -configured not to go through the LISP tunnel. For case 1) ARP is able to -reach the other VM, if both OVS instances default to MAC address learning. -Case 3) requires the hypervisor be configured as the default router for the -VMs. - -In case 2) the VMs expect ARP replies from each other, but this is not -possible over a layer 3 tunnel. One solution is to have static MAC address -entries preconfigured on the VMs (e.g., `arp -f /etc/ethers` on startup on -Unix based VMs), or have the hypervisor do proxy ARP. In this scenario, the -eth0 interfaces need not be added to the br0 bridge in the examples below. - -On the receiving side, the packet arrives without the original MAC header. -The LISP tunneling code attaches a header with harcoded source and destination -MAC address 02:00:00:00:00:00. This address has all bits set to 0, except the -locally administered bit, in order to avoid potential collisions with existing -allocations. In order for packets to reach their intended destination, the -destination MAC address needs to be rewritten. This can be done using the -flow table. - -See below for an example setup, and the associated flow rules to enable LISP -tunneling. - - +---+ +---+ - |VM1| |VM2| - +---+ +---+ - | | - +--[tap0]--+ +--[tap0]---+ - | | | | - [lisp0] OVS1 [eth0]-----------------[eth0] OVS2 [lisp0] - | | | | - +----------+ +-----------+ - -On each hypervisor, interfaces tap0, eth0, and lisp0 are added to a single -bridge instance, and become numbered 1, 2, and 3 respectively: - - ovs-vsctl add-br br0 - ovs-vsctl add-port br0 tap0 - ovs-vsctl add-port br0 eth0 - ovs-vsctl add-port br0 lisp0 -- set Interface lisp0 type=lisp options:remote_ip=flow options:key=flow - -The last command sets up flow based tunneling on the lisp0 interface. From -the LISP point of view, this is like having the Tunnel Router map cache -implemented as flow rules. - -Flows on br0 should be configured as follows: - - priority=3,dl_dst=02:00:00:00:00:00,action=mod_dl_dst:,output:1 - priority=2,in_port=1,dl_type=0x0806,action=NORMAL - priority=1,in_port=1,dl_type=0x0800,vlan_tci=0,nw_src=,action=set_field:->tun_dst,output:3 - priority=0,action=NORMAL - -The third rule is like a map cache entry: the specified by the -nw_src match field is mapped to the RLOC , which is set as the tunnel -destination for this particular flow. - -Optionally, if you want to use Instance ID in a flow, you can add -"set_tunnel:" to the action list. diff -Nru openvswitch-2.3.1/README-lisp.md openvswitch-2.4.0~git20150623/README-lisp.md --- openvswitch-2.3.1/README-lisp.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/README-lisp.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,81 @@ +Using LISP tunneling +==================== + +LISP is a layer 3 tunneling mechanism, meaning that encapsulated packets do +not carry Ethernet headers, and ARP requests shouldn't be sent over the +tunnel. Because of this, there are some additional steps required for setting +up LISP tunnels in Open vSwitch, until support for L3 tunnels will improve. + +This guide assumes tunneling between two VMs connected to OVS bridges on +different hypervisors reachable over IPv4. Of course, more than one VM may be +connected to any of the hypervisors, and a hypervisor may communicate with +several different hypervisors over the same lisp tunneling interface. A LISP +"map-cache" can be implemented using flows, see example at the bottom of this +file. + +There are several scenarios: + + 1) the VMs have IP addresses in the same subnet and the hypervisors are also + in a single subnet (although one different from the VM's); + 2) the VMs have IP addresses in the same subnet but the hypervisors are + separated by a router; + 3) the VMs are in different subnets. + +In cases 1) and 3) ARP resolution can work as normal: ARP traffic is +configured not to go through the LISP tunnel. For case 1) ARP is able to +reach the other VM, if both OVS instances default to MAC address learning. +Case 3) requires the hypervisor be configured as the default router for the +VMs. + +In case 2) the VMs expect ARP replies from each other, but this is not +possible over a layer 3 tunnel. One solution is to have static MAC address +entries preconfigured on the VMs (e.g., `arp -f /etc/ethers` on startup on +Unix based VMs), or have the hypervisor do proxy ARP. In this scenario, the +eth0 interfaces need not be added to the br0 bridge in the examples below. + +On the receiving side, the packet arrives without the original MAC header. +The LISP tunneling code attaches a header with harcoded source and destination +MAC address 02:00:00:00:00:00. This address has all bits set to 0, except the +locally administered bit, in order to avoid potential collisions with existing +allocations. In order for packets to reach their intended destination, the +destination MAC address needs to be rewritten. This can be done using the +flow table. + +See below for an example setup, and the associated flow rules to enable LISP +tunneling. + + +---+ +---+ + |VM1| |VM2| + +---+ +---+ + | | + +--[tap0]--+ +--[tap0]---+ + | | | | + [lisp0] OVS1 [eth0]-----------------[eth0] OVS2 [lisp0] + | | | | + +----------+ +-----------+ + +On each hypervisor, interfaces tap0, eth0, and lisp0 are added to a single +bridge instance, and become numbered 1, 2, and 3 respectively: + + ovs-vsctl add-br br0 + ovs-vsctl add-port br0 tap0 + ovs-vsctl add-port br0 eth0 + ovs-vsctl add-port br0 lisp0 -- set Interface lisp0 type=lisp options:remote_ip=flow options:key=flow + +The last command sets up flow based tunneling on the lisp0 interface. From +the LISP point of view, this is like having the Tunnel Router map cache +implemented as flow rules. + +Flows on br0 should be configured as follows: + + priority=3,dl_dst=02:00:00:00:00:00,action=mod_dl_dst:,output:1 + priority=2,in_port=1,dl_type=0x0806,action=NORMAL + priority=1,in_port=1,dl_type=0x0800,vlan_tci=0,nw_src=,action=set_field:->tun_dst,output:3 + priority=0,action=NORMAL + +The third rule is like a map cache entry: the specified by the +nw_src match field is mapped to the RLOC , which is set as the tunnel +destination for this particular flow. + +Optionally, if you want to use Instance ID in a flow, you can add +"set_tunnel:" to the action list. diff -Nru openvswitch-2.3.1/README.md openvswitch-2.4.0~git20150623/README.md --- openvswitch-2.3.1/README.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/README.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,128 @@ +Open vSwitch +============ + +Build Status: +------------- + +[![Build Status](https://travis-ci.org/openvswitch/ovs.png)](https://travis-ci.org/openvswitch/ovs) + +What is Open vSwitch? +--------------------- + +Open vSwitch is a multilayer software switch licensed under the open +source Apache 2 license. Our goal is to implement a production +quality switch platform that supports standard management interfaces +and opens the forwarding functions to programmatic extension and +control. + +Open vSwitch is well suited to function as a virtual switch in VM +environments. In addition to exposing standard control and visibility +interfaces to the virtual networking layer, it was designed to support +distribution across multiple physical servers. Open vSwitch supports +multiple Linux-based virtualization technologies including +Xen/XenServer, KVM, and VirtualBox. + +The bulk of the code is written in platform-independent C and is +easily ported to other environments. The current release of Open +vSwitch supports the following features: + +* Standard 802.1Q VLAN model with trunk and access ports +* NIC bonding with or without LACP on upstream switch +* NetFlow, sFlow(R), and mirroring for increased visibility +* QoS (Quality of Service) configuration, plus policing +* Geneve, GRE, GRE over IPSEC, VXLAN, and LISP tunneling +* 802.1ag connectivity fault management +* OpenFlow 1.0 plus numerous extensions +* Transactional configuration database with C and Python bindings +* High-performance forwarding using a Linux kernel module + +The included Linux kernel module supports Linux 2.6.32 and up, with +testing focused on 2.6.32 with Centos and Xen patches. Open vSwitch +also has special support for Citrix XenServer and Red Hat Enterprise +Linux hosts. + +Open vSwitch can also operate, at a cost in performance, entirely in +userspace, without assistance from a kernel module. This userspace +implementation should be easier to port than the kernel-based switch. +It is considered experimental. + +What's here? +------------ + +The main components of this distribution are: + +* ovs-vswitchd, a daemon that implements the switch, along with + a companion Linux kernel module for flow-based switching. +* ovsdb-server, a lightweight database server that ovs-vswitchd + queries to obtain its configuration. +* ovs-dpctl, a tool for configuring the switch kernel module. +* Scripts and specs for building RPMs for Citrix XenServer and Red + Hat Enterprise Linux. The XenServer RPMs allow Open vSwitch to + be installed on a Citrix XenServer host as a drop-in replacement + for its switch, with additional functionality. +* ovs-vsctl, a utility for querying and updating the configuration + of ovs-vswitchd. +* ovs-appctl, a utility that sends commands to running Open + vSwitch daemons. + +Open vSwitch also provides some tools: + +* ovs-ofctl, a utility for querying and controlling OpenFlow + switches and controllers. +* ovs-pki, a utility for creating and managing the public-key + infrastructure for OpenFlow switches. +* ovs-testcontroller, a simple OpenFlow controller that may be useful + for testing (though not for production). +* A patch to tcpdump that enables it to parse OpenFlow messages. + +What other documentation is available? +-------------------------------------- + +To install Open vSwitch on a regular Linux or FreeBSD host, please +read [INSTALL.md]. For specifics around installation on a specific +platform, please see one of these files: + +- [INSTALL.Debian.md] +- [INSTALL.Fedora.md] +- [INSTALL.RHEL.md] +- [INSTALL.XenServer.md] + +To use Open vSwitch... + +- ...with Docker on Linux, read [INSTALL.Docker.md] + +- ...with KVM on Linux, read [INSTALL.md], read [INSTALL.KVM.md] + +- ...with Libvirt, read [INSTALL.Libvirt.md]. + +- ...without using a kernel module, read [INSTALL.userspace.md]. + +For answers to common questions, read [FAQ.md]. + +To learn how to set up SSL support for Open vSwitch, read [INSTALL.SSL.md]. + +To learn about some advanced features of the Open vSwitch software +switch, read the [tutorial/Tutorial.md]. + +Each Open vSwitch userspace program is accompanied by a manpage. Many +of the manpages are customized to your configuration as part of the +build process, so we recommend building Open vSwitch before reading +the manpages. + +Contact +------- + +bugs@openvswitch.org + +[INSTALL.md]:INSTALL.md +[INSTALL.Debian.md]:INSTALL.Debian.md +[INSTALL.Docker.md]:INSTALL.Docker.md +[INSTALL.Fedora.md]:INSTALL.Fedora.md +[INSTALL.KVM.md]:INSTALL.KVM.md +[INSTALL.Libvirt.md]:INSTALL.Libvirt.md +[INSTALL.RHEL.md]:INSTALL.RHEL.md +[INSTALL.SSL.md]:INSTALL.SSL.md +[INSTALL.userspace.md]:INSTALL.userspace.md +[INSTALL.XenServer.md]:INSTALL.XenServer.md +[FAQ.md]:FAQ.md +[tutorial/Tutorial.md]:tutorial/Tutorial.md diff -Nru openvswitch-2.3.1/README-native-tunneling.md openvswitch-2.4.0~git20150623/README-native-tunneling.md --- openvswitch-2.3.1/README-native-tunneling.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/README-native-tunneling.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,85 @@ +Native Tunneling in Open vSwitch userspace +------------------------------------------ + +Open vSwitch supports tunneling in userspace. Tunneling is implemented in +platform independent way. + +Setup: +====== +Setup physical bridges for all physical interfaces. Create integration bridge. +Add VXLAN port to int-bridge. Assign IP address to physical bridge where +VXLAN traffic is expected. + +Example: +======== +Connect to VXLAN tunnel endpoint logical ip: 192.168.1.2 and 192.168.1.1. + +Configure OVS bridges as follows. + +1. Lets assume 172.168.1.2/24 network is reachable via eth1 create physical bridge br-eth1 + assign ip address (172.168.1.1/24) to br-eth1, Add eth1 to br-eth1 +2. Check ovs cached routes using appctl command + ovs-appctl ovs/route/show + Add tunnel route if not present in OVS route table. + ovs-appctl ovs/route/add 172.168.1.1/24 br-eth1 +3. Add integration brdge int-br and add tunnel port using standard syntax. + ovs-vsctl add-port int-br vxlan0 -- set interface vxlan0 type=vxlan options:remote_ip=172.168.1.2 +4. Assign IP address to int-br, So final topology looks like: + + 192.168.1.1/24 + +--------------+ + | int-br | 192.168.1.2/24 + +--------------+ +--------------+ + | vxlan0 | | vxlan0 | + +--------------+ +--------------+ + | | + | | + | | + 172.168.1.1/24 | + +--------------+ | + | br-eth1 | 172.168.1.2/24 + +--------------+ +---------------+ + | eth1 |----------------------------------| eth1 | + +--------------+ +---------------+ + + Host A with OVS. Remote host. + +With this setup, ping to VXLAN target device (192.168.1.2) should work +There are following commands that shows internal tables: + +Tunneling related commands: +=========================== +Tunnel routing table: + To Add route: + ovs-appctl ovs/route/add / + To see all routes configured: + ovs-appctl ovs/route/show + To del route: + ovs-appctl ovs/route/del / + To look up and display the route for a destination: + ovs-appctl ovs/route/lookup + +ARP: + To see arp cache content: + ovs-appctl tnl/arp/show + To flush arp cache: + ovs-appctl tnl/arp/flush + +To check tunnel ports listening in vswitchd: + ovs-appctl tnl/ports/show + +To set range for VxLan udp source port: + To set: + ovs-appctl tnl/egress_port_range + Shows Current range: + ovs-appctl tnl/egress_port_range + +To check datapath ports: + ovs-appctl dpif/show + +To check datapath flows: + ovs-appctl dpif/dump-flows + +Contact +======= +bugs@openvswitch.org diff -Nru openvswitch-2.3.1/REPORTING-BUGS openvswitch-2.4.0~git20150623/REPORTING-BUGS --- openvswitch-2.3.1/REPORTING-BUGS 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/REPORTING-BUGS 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -Reporting Bugs in Open vSwitch -============================== - -We are eager to hear from users about problems that they have -encountered with Open vSwitch. This file documents how best to report -bugs so as to ensure that they can be fixed as quickly as possible. - -Please report bugs by sending email to bugs@openvswitch.org. - -The most important parts of your bug report are the following: - - * What you did that make the problem appear. - - * What you expected to happen. - - * What actually happened. - -Please also include the following information: - - * The Open vSwitch version number (as output by "ovs-vswitchd - --version"). - - * The Git commit number (as output by "git rev-parse HEAD"), - if you built from a Git snapshot. - - * Any local patches or changes you have applied (if any). - -The following are also handy sometimes: - - * The kernel version on which Open vSwitch is running (from - /proc/version) and the distribution and version number of - your OS (e.g. "Centos 5.0"). - - * The contents of the vswitchd configuration database (usually - /etc/openvswitch/conf.db). - - * The output of "ovs-dpctl show". - - * If you have Open vSwitch configured to connect to an - OpenFlow controller, the output of "ovs-ofctl show " - for each configured in the vswitchd configuration - database. - - * A fix or workaround, if you have one. - - * Any other information that you think might be relevant. - -bugs@openvswitch.org is a public mailing list, to which anyone can -subscribe, so please do not include confidential information in your -bug report. - -Contact -------- - -bugs@openvswitch.org -http://openvswitch.org/ diff -Nru openvswitch-2.3.1/REPORTING-BUGS.md openvswitch-2.4.0~git20150623/REPORTING-BUGS.md --- openvswitch-2.3.1/REPORTING-BUGS.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/REPORTING-BUGS.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,58 @@ +Reporting Bugs in Open vSwitch +============================== + +We are eager to hear from users about problems that they have +encountered with Open vSwitch. This file documents how best to report +bugs so as to ensure that they can be fixed as quickly as possible. + +Please report bugs by sending email to bugs@openvswitch.org. + +For reporting security vulnerabilities, please read SECURITY.md. + +The most important parts of your bug report are the following: + + * What you did that make the problem appear. + + * What you expected to happen. + + * What actually happened. + +Please also include the following information: + + * The Open vSwitch version number (as output by `ovs-vswitchd + --version`). + + * The Git commit number (as output by `git rev-parse HEAD`), + if you built from a Git snapshot. + + * Any local patches or changes you have applied (if any). + +The following are also handy sometimes: + + * The kernel version on which Open vSwitch is running (from + `/proc/version`) and the distribution and version number of + your OS (e.g. "Centos 5.0"). + + * The contents of the vswitchd configuration database (usually + `/etc/openvswitch/conf.db`). + + * The output of `ovs-dpctl show`. + + * If you have Open vSwitch configured to connect to an + OpenFlow controller, the output of `ovs-ofctl show ` + for each `` configured in the vswitchd configuration + database. + + * A fix or workaround, if you have one. + + * Any other information that you think might be relevant. + +bugs@openvswitch.org is a public mailing list, to which anyone can +subscribe, so please do not include confidential information in your +bug report. + +Contact +------- + +bugs@openvswitch.org +http://openvswitch.org/ diff -Nru openvswitch-2.3.1/rhel/automake.mk openvswitch-2.4.0~git20150623/rhel/automake.mk --- openvswitch-2.3.1/rhel/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. +# Copyright (C) 2009, 2010, 2011, 2012, 2014 Nicira, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -27,7 +27,7 @@ rhel/usr_lib_systemd_system_openvswitch-nonetwork.service update_rhel_spec = \ - ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \ + $(AM_V_GEN)($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \ < $(srcdir)/rhel/$(@F).in > $(@F).tmp || exit 1; \ if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi diff -Nru openvswitch-2.3.1/rhel/etc_init.d_openvswitch openvswitch-2.4.0~git20150623/rhel/etc_init.d_openvswitch --- openvswitch-2.3.1/rhel/etc_init.d_openvswitch 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/etc_init.d_openvswitch 2015-06-23 18:46:21.000000000 +0000 @@ -19,7 +19,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ### BEGIN INIT INFO -# Provides: openvswitch-switch +# Provides: openvswitch # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 diff -Nru openvswitch-2.3.1/rhel/etc_sysconfig_network-scripts_ifup-ovs openvswitch-2.4.0~git20150623/rhel/etc_sysconfig_network-scripts_ifup-ovs --- openvswitch-2.3.1/rhel/etc_sysconfig_network-scripts_ifup-ovs 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/etc_sysconfig_network-scripts_ifup-ovs 2015-06-23 18:46:21.000000000 +0000 @@ -135,8 +135,7 @@ for _iface in $BOND_IFACES; do /sbin/ifup ${_iface} done - ovs-vsctl -t ${TIMEOUT} -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} - ${OTHERSCRIPT} ${CONFIG} ${2} + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE" ;; OVSTunnel) diff -Nru openvswitch-2.3.1/rhel/.gitignore openvswitch-2.4.0~git20150623/rhel/.gitignore --- openvswitch-2.3.1/rhel/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,5 @@ +openvswitch-kmod-rhel5.spec +openvswitch-kmod-rhel6.spec +openvswitch-kmod-fedora.spec +openvswitch.spec +openvswitch-fedora.spec diff -Nru openvswitch-2.3.1/rhel/openvswitch-fedora.spec openvswitch-2.4.0~git20150623/rhel/openvswitch-fedora.spec --- openvswitch-2.3.1/rhel/openvswitch-fedora.spec 2014-12-04 06:00:32.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/openvswitch-fedora.spec 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -# Generated automatically -- do not modify! -*- buffer-read-only: t -*- -# Spec file for Open vSwitch. - -# Copyright (C) 2009, 2010, 2013, 2014 Nicira Networks, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. -# -# If tests have to be skipped while building, specify the '--without check' -# option. For example: -# rpmbuild -bb --without check rhel/openvswitch-fedora.spec - -#%define kernel 2.6.40.4-5.fc15.x86_64 - -Name: openvswitch -Summary: Open vSwitch -Group: System Environment/Daemons -URL: http://www.openvswitch.org/ -Version: 2.3.1 - -# The entire source code is ASL 2.0 except datapath/ which is GPLv2 -License: ASL 2.0 -Release: 1%{?dist} -Source: openvswitch-%{version}.tar.gz -#Source1: openvswitch-init -Buildroot: /tmp/openvswitch-fedora-rpm - -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units - -%bcond_without check - -%description -Open vSwitch provides standard network bridging functions augmented with -support for the OpenFlow protocol for remote per-flow control of -traffic. - -%prep -%setup -q -n openvswitch-%{version} - -%build -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl -make %{_smp_mflags} - -%install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT -install -d -m 755 $RPM_BUILD_ROOT/etc -install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch -install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \ - $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service -install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \ - $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service -install -m 755 rhel/etc_init.d_openvswitch \ - $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init -install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig -install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d -install -m 755 rhel/etc_logrotate.d_openvswitch \ - $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch -install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d -install -m 644 vswitchd/vswitch.ovsschema \ - $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema -install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts -install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ -install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \ - $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs -install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \ - $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs -install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ - $RPM_BUILD_ROOT/etc/sysconfig/openvswitch -install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts - -install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python -install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python - -install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch - -# Get rid of stuff we don't want to make RPM happy. -(cd "$RPM_BUILD_ROOT" && rm -f usr/lib/lib*) - -%check -%if %{with check} - if make check TESTSUITEFLAGS='%{_smp_mflags}' || - make check TESTSUITEFLAGS='--recheck'; then :; - else - cat tests/testsuite.log - exit 1 - fi -%endif - -%clean -rm -rf $RPM_BUILD_ROOT - -%preun -# Package removal, not upgrade -systemctl stop openvswitch.service -systemctl disable openvswitch.service - -%post -if test ! -e /etc/openvswitch/conf.db; then - install -d -m 755 -o root -g root /etc/openvswitch - - # Create ovs-vswitchd config database - ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \ - /usr/share/openvswitch/vswitch.ovsschema - - # Create initial table in config database - ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \ - '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \ - > /dev/null -fi -# Initial installation -systemctl enable openvswitch.service -systemctl start openvswitch.service - -%postun - -%files -%defattr(-,root,root) -%config /etc/sysconfig/openvswitch -%config /etc/logrotate.d/openvswitch -%{_unitdir}/openvswitch.service -%{_unitdir}/openvswitch-nonetwork.service -%{_datadir}/openvswitch/scripts/openvswitch.init -%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs -%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs -/usr/share/openvswitch/bugtool-plugins/ -/usr/share/openvswitch/python/ovs/__init__.py* -/usr/share/openvswitch/python/ovs/daemon.py* -/usr/share/openvswitch/python/ovs/db/__init__.py* -/usr/share/openvswitch/python/ovs/db/data.py* -/usr/share/openvswitch/python/ovs/db/error.py* -/usr/share/openvswitch/python/ovs/db/idl.py* -/usr/share/openvswitch/python/ovs/db/parser.py* -/usr/share/openvswitch/python/ovs/db/schema.py* -/usr/share/openvswitch/python/ovs/db/types.py* -/usr/share/openvswitch/python/ovs/dirs.py* -/usr/share/openvswitch/python/ovs/fatal_signal.py* -/usr/share/openvswitch/python/ovs/json.py* -/usr/share/openvswitch/python/ovs/jsonrpc.py* -/usr/share/openvswitch/python/ovs/ovsuuid.py* -/usr/share/openvswitch/python/ovs/poller.py* -/usr/share/openvswitch/python/ovs/process.py* -/usr/share/openvswitch/python/ovs/reconnect.py* -/usr/share/openvswitch/python/ovs/socket_util.py* -/usr/share/openvswitch/python/ovs/stream.py* -/usr/share/openvswitch/python/ovs/timeval.py* -/usr/share/openvswitch/python/ovs/util.py* -/usr/share/openvswitch/python/ovs/version.py* -/usr/share/openvswitch/python/ovs/unixctl/__init__.py* -/usr/share/openvswitch/python/ovs/unixctl/client.py* -/usr/share/openvswitch/python/ovs/unixctl/server.py* -/usr/share/openvswitch/python/uuid.py* -/usr/share/openvswitch/python/argparse.py* -/usr/share/openvswitch/python/ovs/vlog.py* -/usr/share/openvswitch/python/ovstest/__init__.py* -/usr/share/openvswitch/python/ovstest/args.py* -/usr/share/openvswitch/python/ovstest/rpcserver.py* -/usr/share/openvswitch/python/ovstest/tcp.py* -/usr/share/openvswitch/python/ovstest/udp.py* -/usr/share/openvswitch/python/ovstest/util.py* -/usr/share/openvswitch/python/ovstest/vswitch.py* -/usr/share/openvswitch/python/ovstest/tests.py* -/usr/share/openvswitch/scripts/ovs-bugtool-* -/usr/share/openvswitch/scripts/ovs-check-dead-ifs -/usr/share/openvswitch/scripts/ovs-lib -/usr/share/openvswitch/scripts/ovs-vtep -%config /usr/share/openvswitch/vswitch.ovsschema -%config /usr/share/openvswitch/vtep.ovsschema -/usr/sbin/ovs-bugtool -/usr/sbin/ovs-vswitchd -/usr/sbin/ovsdb-server -/usr/bin/ovs-appctl -/usr/bin/ovs-dpctl -/usr/bin/ovs-dpctl-top -/usr/bin/ovs-ofctl -/usr/bin/ovs-vsctl -/usr/bin/ovsdb-client -/usr/bin/ovsdb-tool -/usr/bin/ovs-pki -/usr/bin/ovs-test -/usr/bin/ovs-l3ping -/usr/bin/vtep-ctl -%doc /usr/share/man/man8/ovs-pki.8.gz -%doc /usr/share/man/man1/ovsdb-client.1.gz -%doc /usr/share/man/man1/ovsdb-server.1.gz -%doc /usr/share/man/man1/ovsdb-tool.1.gz -%doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz -%doc /usr/share/man/man5/vtep.5.gz -%doc /usr/share/man/man8/ovs-appctl.8.gz -%doc /usr/share/man/man8/ovs-bugtool.8.gz -%doc /usr/share/man/man8/ovs-ctl.8.gz -%doc /usr/share/man/man8/ovs-dpctl.8.gz -%doc /usr/share/man/man8/ovs-dpctl-top.8.gz -%doc /usr/share/man/man8/ovs-ofctl.8.gz -%doc /usr/share/man/man8/ovs-parse-backtrace.8.gz -%doc /usr/share/man/man8/ovs-vsctl.8.gz -%doc /usr/share/man/man8/ovs-vswitchd.8.gz -%doc /usr/share/man/man8/ovs-test.8.gz -%doc /usr/share/man/man8/ovs-l3ping.8.gz -%doc /usr/share/man/man8/vtep-ctl.8.gz -/var/lib/openvswitch -/var/log/openvswitch -/usr/share/openvswitch/scripts/ovs-ctl -%exclude /etc/openvswitch -%exclude /usr/bin/ovs-benchmark -%exclude /usr/bin/ovs-parse-backtrace -%exclude /usr/bin/ovs-pcap -%exclude /usr/bin/ovs-tcpundump -%exclude /usr/bin/ovs-vlan-test -%exclude /usr/sbin/ovs-vlan-bug-workaround -%exclude /usr/share/man/man1/ovs-benchmark.1.gz -%exclude /usr/share/man/man1/ovs-pcap.1.gz -%exclude /usr/share/man/man1/ovs-tcpundump.1.gz -%exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz -%exclude /usr/share/man/man8/ovs-vlan-test.8.gz -%exclude /usr/share/openvswitch/scripts/ovs-save - -%changelog -* Wed Jan 12 2011 Ralf Spenneberg -- First build on F14 diff -Nru openvswitch-2.3.1/rhel/openvswitch-fedora.spec.in openvswitch-2.4.0~git20150623/rhel/openvswitch-fedora.spec.in --- openvswitch-2.3.1/rhel/openvswitch-fedora.spec.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/openvswitch-fedora.spec.in 2015-06-23 18:46:21.000000000 +0000 @@ -13,72 +13,124 @@ #%define kernel 2.6.40.4-5.fc15.x86_64 +# Enable PIE, bz#955181 +%global _hardened_build 1 + Name: openvswitch Summary: Open vSwitch Group: System Environment/Daemons URL: http://www.openvswitch.org/ Version: @VERSION@ -# The entire source code is ASL 2.0 except datapath/ which is GPLv2 -License: ASL 2.0 +# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the +# lib/sflow*.[ch] files are SISSL +# datapath/ is GPLv2 (although not built into any of the binary packages) +# python/compat is Python (although not built into any of the binary packages) +License: ASL 2.0 and LGPLv2+ and SISSL Release: 1%{?dist} -Source: openvswitch-%{version}.tar.gz -#Source1: openvswitch-init -Buildroot: /tmp/openvswitch-fedora-rpm +Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz -Requires(post): systemd-units +BuildRequires: autoconf +BuildRequires: systemd-units openssl openssl-devel +BuildRequires: python python-twisted-core python-zope-interface PyQt4 +BuildRequires: desktop-file-utils +BuildRequires: groff graphviz +# make check dependencies +BuildRequires: procps-ng + +Requires: openssl iproute module-init-tools +#Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3 +#Requires: kernel >= 3.15.0-0 + +Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units +Obsoletes: openvswitch-controller <= 0:2.1.0-1 %bcond_without check %description -Open vSwitch provides standard network bridging functions augmented with +Open vSwitch provides standard network bridging functions and support for the OpenFlow protocol for remote per-flow control of traffic. +%package -n python-openvswitch +Summary: Open vSwitch python bindings +License: ASL 2.0 +BuildArch: noarch +Requires: python + +%description -n python-openvswitch +Python bindings for the Open vSwitch database + +%package test +Summary: Open vSwitch testing utilities +License: ASL 2.0 +BuildArch: noarch +Requires: python-openvswitch = %{version}-%{release} +Requires: python python-twisted-core python-twisted-web + +%description test +Utilities that are useful to diagnose performance and connectivity +issues in Open vSwitch setup. + +%package devel +Summary: Open vSwitch OpenFlow development package (library, headers) +License: ASL 2.0 +Provides: openvswitch-static = %{version}-%{release} + +%description devel +This provides static library, libopenswitch.a and the openvswitch header +files needed to build an external application. + + %prep -%setup -q -n openvswitch-%{version} +%setup -q %build -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl -make %{_smp_mflags} +%configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT -install -d -m 755 $RPM_BUILD_ROOT/etc -install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch -install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \ + +install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch + +install -p -D -m 0644 \ + rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ + $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch +install -p -D -m 0644 \ + rhel/usr_lib_systemd_system_openvswitch.service \ $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service -install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \ +install -p -D -m 0644 \ + rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \ $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service -install -m 755 rhel/etc_init.d_openvswitch \ + +install -m 0755 rhel/etc_init.d_openvswitch \ $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init -install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig -install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d -install -m 755 rhel/etc_logrotate.d_openvswitch \ - $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch -install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d -install -m 644 vswitchd/vswitch.ovsschema \ - $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema -install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts -install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ + +install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \ + $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch + +install -m 0644 vswitchd/vswitch.ovsschema \ + $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema + +install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \ - $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs + $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \ - $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs -install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ - $RPM_BUILD_ROOT/etc/sysconfig/openvswitch -install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts + $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs -install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python -install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python +install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib} +mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \ + $RPM_BUILD_ROOT%{python_sitelib} +rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ -install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch +install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch -# Get rid of stuff we don't want to make RPM happy. -(cd "$RPM_BUILD_ROOT" && rm -f usr/lib/lib*) +touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db +touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf %check %if %{with check} @@ -94,129 +146,131 @@ rm -rf $RPM_BUILD_ROOT %preun -# Package removal, not upgrade -systemctl stop openvswitch.service -systemctl disable openvswitch.service +%if 0%{?systemd_preun:1} + %systemd_preun %{name}.service +%else + if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || : + /bin/systemctl stop %{name}.service >/dev/null 2>&1 || : + fi +%endif + %post -if test ! -e /etc/openvswitch/conf.db; then - install -d -m 755 -o root -g root /etc/openvswitch +%if 0%{?systemd_post:1} + %systemd_post %{name}.service +%else + # Package install, not upgrade + if [ $1 -eq 1 ]; then + /bin/systemctl daemon-reload >dev/null || : + fi +%endif - # Create ovs-vswitchd config database - ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \ - /usr/share/openvswitch/vswitch.ovsschema - - # Create initial table in config database - ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \ - '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \ - > /dev/null -fi -# Initial installation -systemctl enable openvswitch.service -systemctl start openvswitch.service %postun +%if 0%{?systemd_postun_with_restart:1} + %systemd_postun_with_restart %{name}.service +%else + /bin/systemctl daemon-reload >/dev/null 2>&1 || : + if [ "$1" -ge "1" ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : + fi +%endif + + +%files -n python-openvswitch +%{python_sitelib}/ovs +%doc COPYING + +%files test +%{_bindir}/ovs-test +%{_bindir}/ovs-vlan-test +%{_bindir}/ovs-l3ping +%{_mandir}/man8/ovs-test.8* +%{_mandir}/man8/ovs-vlan-test.8* +%{_mandir}/man8/ovs-l3ping.8* +%{python_sitelib}/ovstest + +%files devel +%{_libdir}/*.a +%{_libdir}/*.la +%{_libdir}/pkgconfig/*.pc +%{_includedir}/openvswitch/* +%{_includedir}/openflow/* %files %defattr(-,root,root) -%config /etc/sysconfig/openvswitch -%config /etc/logrotate.d/openvswitch +%{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash +%{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash +%dir %{_sysconfdir}/openvswitch +%config %ghost %{_sysconfdir}/openvswitch/conf.db +%config %ghost %{_sysconfdir}/openvswitch/system-id.conf +%config(noreplace) %{_sysconfdir}/sysconfig/openvswitch +%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch %{_unitdir}/openvswitch.service %{_unitdir}/openvswitch-nonetwork.service %{_datadir}/openvswitch/scripts/openvswitch.init %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs -/usr/share/openvswitch/bugtool-plugins/ -/usr/share/openvswitch/python/ovs/__init__.py* -/usr/share/openvswitch/python/ovs/daemon.py* -/usr/share/openvswitch/python/ovs/db/__init__.py* -/usr/share/openvswitch/python/ovs/db/data.py* -/usr/share/openvswitch/python/ovs/db/error.py* -/usr/share/openvswitch/python/ovs/db/idl.py* -/usr/share/openvswitch/python/ovs/db/parser.py* -/usr/share/openvswitch/python/ovs/db/schema.py* -/usr/share/openvswitch/python/ovs/db/types.py* -/usr/share/openvswitch/python/ovs/dirs.py* -/usr/share/openvswitch/python/ovs/fatal_signal.py* -/usr/share/openvswitch/python/ovs/json.py* -/usr/share/openvswitch/python/ovs/jsonrpc.py* -/usr/share/openvswitch/python/ovs/ovsuuid.py* -/usr/share/openvswitch/python/ovs/poller.py* -/usr/share/openvswitch/python/ovs/process.py* -/usr/share/openvswitch/python/ovs/reconnect.py* -/usr/share/openvswitch/python/ovs/socket_util.py* -/usr/share/openvswitch/python/ovs/stream.py* -/usr/share/openvswitch/python/ovs/timeval.py* -/usr/share/openvswitch/python/ovs/util.py* -/usr/share/openvswitch/python/ovs/version.py* -/usr/share/openvswitch/python/ovs/unixctl/__init__.py* -/usr/share/openvswitch/python/ovs/unixctl/client.py* -/usr/share/openvswitch/python/ovs/unixctl/server.py* -/usr/share/openvswitch/python/uuid.py* -/usr/share/openvswitch/python/argparse.py* -/usr/share/openvswitch/python/ovs/vlog.py* -/usr/share/openvswitch/python/ovstest/__init__.py* -/usr/share/openvswitch/python/ovstest/args.py* -/usr/share/openvswitch/python/ovstest/rpcserver.py* -/usr/share/openvswitch/python/ovstest/tcp.py* -/usr/share/openvswitch/python/ovstest/udp.py* -/usr/share/openvswitch/python/ovstest/util.py* -/usr/share/openvswitch/python/ovstest/vswitch.py* -/usr/share/openvswitch/python/ovstest/tests.py* -/usr/share/openvswitch/scripts/ovs-bugtool-* -/usr/share/openvswitch/scripts/ovs-check-dead-ifs -/usr/share/openvswitch/scripts/ovs-lib -/usr/share/openvswitch/scripts/ovs-vtep -%config /usr/share/openvswitch/vswitch.ovsschema -%config /usr/share/openvswitch/vtep.ovsschema -/usr/sbin/ovs-bugtool -/usr/sbin/ovs-vswitchd -/usr/sbin/ovsdb-server -/usr/bin/ovs-appctl -/usr/bin/ovs-dpctl -/usr/bin/ovs-dpctl-top -/usr/bin/ovs-ofctl -/usr/bin/ovs-vsctl -/usr/bin/ovsdb-client -/usr/bin/ovsdb-tool -/usr/bin/ovs-pki -/usr/bin/ovs-test -/usr/bin/ovs-l3ping -/usr/bin/vtep-ctl -%doc /usr/share/man/man8/ovs-pki.8.gz -%doc /usr/share/man/man1/ovsdb-client.1.gz -%doc /usr/share/man/man1/ovsdb-server.1.gz -%doc /usr/share/man/man1/ovsdb-tool.1.gz -%doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz -%doc /usr/share/man/man5/vtep.5.gz -%doc /usr/share/man/man8/ovs-appctl.8.gz -%doc /usr/share/man/man8/ovs-bugtool.8.gz -%doc /usr/share/man/man8/ovs-ctl.8.gz -%doc /usr/share/man/man8/ovs-dpctl.8.gz -%doc /usr/share/man/man8/ovs-dpctl-top.8.gz -%doc /usr/share/man/man8/ovs-ofctl.8.gz -%doc /usr/share/man/man8/ovs-parse-backtrace.8.gz -%doc /usr/share/man/man8/ovs-vsctl.8.gz -%doc /usr/share/man/man8/ovs-vswitchd.8.gz -%doc /usr/share/man/man8/ovs-test.8.gz -%doc /usr/share/man/man8/ovs-l3ping.8.gz -%doc /usr/share/man/man8/vtep-ctl.8.gz +%{_datadir}/openvswitch/bugtool-plugins/ +%{_datadir}/openvswitch/scripts/ovs-bugtool-* +%{_datadir}/openvswitch/scripts/ovs-check-dead-ifs +%{_datadir}/openvswitch/scripts/ovs-lib +%{_datadir}/openvswitch/scripts/ovs-vtep +%{_datadir}/openvswitch/scripts/ovs-ctl +%config %{_datadir}/openvswitch/vswitch.ovsschema +%config %{_datadir}/openvswitch/vtep.ovsschema +%{_bindir}/ovs-appctl +%{_bindir}/ovs-docker +%{_bindir}/ovs-dpctl +%{_bindir}/ovs-dpctl-top +%{_bindir}/ovs-ofctl +%{_bindir}/ovs-vsctl +%{_bindir}/ovsdb-client +%{_bindir}/ovsdb-tool +%{_bindir}/ovs-testcontroller +%{_bindir}/ovs-pki +%{_bindir}/vtep-ctl +%{_sbindir}/ovs-bugtool +%{_sbindir}/ovs-vswitchd +%{_sbindir}/ovsdb-server +%{_mandir}/man1/ovs-benchmark.1* +%{_mandir}/man1/ovs-pcap.1* +%{_mandir}/man1/ovs-tcpundump.1* +%{_mandir}/man1/ovsdb-client.1* +%{_mandir}/man1/ovsdb-server.1* +%{_mandir}/man1/ovsdb-tool.1* +%{_mandir}/man5/ovs-vswitchd.conf.db.5* +%{_mandir}/man5/vtep.5* +%{_mandir}/man8/vtep-ctl.8* +%{_mandir}/man8/ovs-appctl.8* +%{_mandir}/man8/ovs-bugtool.8* +%{_mandir}/man8/ovs-ctl.8* +%{_mandir}/man8/ovs-dpctl.8* +%{_mandir}/man8/ovs-dpctl-top.8* +%{_mandir}/man8/ovs-ofctl.8* +%{_mandir}/man8/ovs-pki.8* +%{_mandir}/man8/ovs-vsctl.8* +%{_mandir}/man8/ovs-vswitchd.8* +%{_mandir}/man8/ovs-parse-backtrace.8* +%{_mandir}/man8/ovs-testcontroller.8* +%doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md +%doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL /var/lib/openvswitch /var/log/openvswitch -/usr/share/openvswitch/scripts/ovs-ctl -%exclude /etc/openvswitch -%exclude /usr/bin/ovs-benchmark -%exclude /usr/bin/ovs-parse-backtrace -%exclude /usr/bin/ovs-pcap -%exclude /usr/bin/ovs-tcpundump -%exclude /usr/bin/ovs-vlan-test -%exclude /usr/sbin/ovs-vlan-bug-workaround -%exclude /usr/share/man/man1/ovs-benchmark.1.gz -%exclude /usr/share/man/man1/ovs-pcap.1.gz -%exclude /usr/share/man/man1/ovs-tcpundump.1.gz -%exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz -%exclude /usr/share/man/man8/ovs-vlan-test.8.gz -%exclude /usr/share/openvswitch/scripts/ovs-save +%ghost %attr(755,root,root) %{_rundir}/openvswitch +%exclude %{_bindir}/ovs-benchmark +%exclude %{_bindir}/ovs-parse-backtrace +%exclude %{_bindir}/ovs-pcap +%exclude %{_bindir}/ovs-tcpundump +%exclude %{_sbindir}/ovs-vlan-bug-workaround +%exclude %{_mandir}/man1/ovs-benchmark.1.gz +%exclude %{_mandir}/man1/ovs-pcap.1.gz +%exclude %{_mandir}/man1/ovs-tcpundump.1.gz +%exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz +%exclude %{_datadir}/openvswitch/scripts/ovs-save %changelog * Wed Jan 12 2011 Ralf Spenneberg diff -Nru openvswitch-2.3.1/rhel/openvswitch-kmod-fedora.spec openvswitch-2.4.0~git20150623/rhel/openvswitch-kmod-fedora.spec --- openvswitch-2.3.1/rhel/openvswitch-kmod-fedora.spec 2014-12-04 06:00:32.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/openvswitch-kmod-fedora.spec 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -# Generated automatically -- do not modify! -*- buffer-read-only: t -*- -# Spec file for Open vSwitch. - -# Copyright (C) 2009, 2010 Nicira Networks, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -#%define kernel 3.1.5-1.fc16.x86_64 -#define kernel %{kernel_source} -%{?kversion:%define kernel %kversion} - -Name: openvswitch-kmod -Summary: Open vSwitch Kernel Modules -Group: System Environment/Daemons -URL: http://www.openvswitch.org/ -Vendor: OpenSource Security Ralf Spenneberg -Version: 2.3.1 - -# The entire source code is ASL 2.0 except datapath/ which is GPLv2 -License: GPLv2 -Release: 1%{?dist} -Source: openvswitch-%{version}.tar.gz -#Source1: openvswitch-init -Buildroot: /tmp/openvswitch-xen-rpm - -%description -Open vSwitch provides standard network bridging functions augmented with -support for the OpenFlow protocol for remote per-flow control of -traffic. This package contains the kernel modules. - -%prep -%setup -q -n openvswitch-%{version} - -%build -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --with-linux=/lib/modules/%{kernel}/build --enable-ssl -make %{_smp_mflags} -C datapath/linux - -%install -rm -rf $RPM_BUILD_ROOT -make -C datapath/linux modules_install - -install -d -m 755 $RPM_BUILD_ROOT/lib/modules/%{kernel}/kernel/extra/openvswitch -find datapath/linux -name *.ko -exec install -m 755 \{\} $RPM_BUILD_ROOT/lib/modules/%{kernel}/kernel/extra/openvswitch \; - -%clean -rm -rf $RPM_BUILD_ROOT - -%preun - -%post -# Ensure that modprobe will find our modules. -depmod %{kernel} - -%files -%defattr(-,root,root) -/lib/modules/%{kernel}/kernel/extra/openvswitch/openvswitch.ko - -%changelog -* Wed Sep 21 2011 Kyle Mestery -- Updated for F15 -* Wed Jan 12 2011 Ralf Spenneberg -- First build on F14 diff -Nru openvswitch-2.3.1/rhel/openvswitch-kmod-fedora.spec.in openvswitch-2.4.0~git20150623/rhel/openvswitch-kmod-fedora.spec.in --- openvswitch-2.3.1/rhel/openvswitch-kmod-fedora.spec.in 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/openvswitch-kmod-fedora.spec.in 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ # Spec file for Open vSwitch. -# Copyright (C) 2009, 2010 Nicira Networks, Inc. +# Copyright (C) 2009, 2010, 2015 Nicira Networks, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -55,7 +55,7 @@ %files %defattr(-,root,root) -/lib/modules/%{kernel}/kernel/extra/openvswitch/openvswitch.ko +/lib/modules/%{kernel}/kernel/extra/openvswitch/*.ko %changelog * Wed Sep 21 2011 Kyle Mestery diff -Nru openvswitch-2.3.1/rhel/openvswitch-kmod-rhel6.spec openvswitch-2.4.0~git20150623/rhel/openvswitch-kmod-rhel6.spec --- openvswitch-2.3.1/rhel/openvswitch-kmod-rhel6.spec 2014-12-04 06:00:32.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/openvswitch-kmod-rhel6.spec 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -# Generated automatically -- do not modify! -*- buffer-read-only: t -*- -# Spec file for Open vSwitch kernel modules on Red Hat Enterprise -# Linux 6. - -# Copyright (C) 2011, 2012 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. - -%define oname openvswitch - -Name: %{oname}-kmod -Version: 2.3.1 -Release: 1%{?dist} -Summary: Open vSwitch kernel module - -Group: System/Kernel -License: GPLv2 -URL: http://openvswitch.org/ -Source0: %{oname}-%{version}.tar.gz -Source1: %{oname}-kmod.files -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) -BuildRequires: %kernel_module_package_buildreqs - -# Without this we get an empty openvswitch-debuginfo package (whose name -# conflicts with the openvswitch-debuginfo package for OVS userspace). -%undefine _enable_debug_packages - -# Use -D 'kversion 2.6.32-131.6.1.el6.x86_64' to build package -# for specified kernel version. -%{?kversion:%define kernel_version %kversion} - -# Use -D 'kflavors default debug kdump' to build packages for -# specified kernel variants. -%{!?kflavors:%define kflavors default} - -%kernel_module_package -n %{oname} -f %{SOURCE1} %kflavors - -%description -Open vSwitch Linux kernel module. - -%prep - -%setup -n %{oname}-%{version} -cat > %{oname}.conf << EOF -override %{oname} * extra/%{oname} -override %{oname} * weak-updates/%{oname} -EOF - -%build -for flavor in %flavors_to_build; do - mkdir _$flavor - (cd _$flavor && ../configure --with-linux="%{kernel_source $flavor}") - %{__make} -C _$flavor/datapath/linux %{?_smp_mflags} -done - -%install -export INSTALL_MOD_PATH=$RPM_BUILD_ROOT -export INSTALL_MOD_DIR=extra/%{oname} -for flavor in %flavors_to_build ; do - make -C %{kernel_source $flavor} modules_install \ - M="`pwd`"/_$flavor/datapath/linux - - # Cleanup unnecessary kernel-generated module dependency files. - find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \; -done -install -d %{buildroot}%{_sysconfdir}/depmod.d/ -install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/ - -%clean -rm -rf $RPM_BUILD_ROOT diff -Nru openvswitch-2.3.1/rhel/openvswitch.spec openvswitch-2.4.0~git20150623/rhel/openvswitch.spec --- openvswitch-2.3.1/rhel/openvswitch.spec 2014-12-04 06:00:32.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/openvswitch.spec 1970-01-01 00:00:00.000000000 +0000 @@ -1,182 +0,0 @@ -# Generated automatically -- do not modify! -*- buffer-read-only: t -*- -# Spec file for Open vSwitch on Red Hat Enterprise Linux. - -# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without warranty of any kind. -# -# If tests have to be skipped while building, specify the '--without check' -# option. For example: -# rpmbuild -bb --without check rhel/openvswitch.spec - -Name: openvswitch -Summary: Open vSwitch daemon/database/utilities -Group: System Environment/Daemons -URL: http://www.openvswitch.org/ -Vendor: Nicira, Inc. -Version: 2.3.1 - -License: ASL 2.0 -Release: 1 -Source: openvswitch-%{version}.tar.gz -Buildroot: /tmp/openvswitch-rpm -Requires: openvswitch-kmod, logrotate, python -BuildRequires: openssl-devel - -%bcond_without check - -%description -Open vSwitch provides standard network bridging functions and -support for the OpenFlow protocol for remote per-flow control of -traffic. - -%prep -%setup -q - -%build -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl -make %{_smp_mflags} - -%install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT - -rhel_cp() { - base=$1 - mode=$2 - dst=$RPM_BUILD_ROOT/$(echo $base | sed 's,_,/,g') - install -D -m $mode rhel/$base $dst -} -rhel_cp etc_init.d_openvswitch 0755 -rhel_cp etc_logrotate.d_openvswitch 0644 -rhel_cp etc_sysconfig_network-scripts_ifup-ovs 0755 -rhel_cp etc_sysconfig_network-scripts_ifdown-ovs 0755 -rhel_cp usr_share_openvswitch_scripts_sysconfig.template 0644 - -docdir=$RPM_BUILD_ROOT/usr/share/doc/openvswitch-%{version} -install -d -m755 "$docdir" -install -m 0644 FAQ rhel/README.RHEL "$docdir" -install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python -install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python - -# Get rid of stuff we don't want to make RPM happy. -rm \ - $RPM_BUILD_ROOT/usr/bin/ovs-test \ - $RPM_BUILD_ROOT/usr/bin/ovs-l3ping \ - $RPM_BUILD_ROOT/usr/share/man/man8/ovs-test.8 \ - $RPM_BUILD_ROOT/usr/share/man/man8/ovs-l3ping.8 \ - $RPM_BUILD_ROOT/usr/sbin/ovs-vlan-bug-workaround \ - $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8 -(cd "$RPM_BUILD_ROOT" && rm -rf usr/lib) - -install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch - -%check -%if %{with check} - if make check TESTSUITEFLAGS='%{_smp_mflags}' || - make check TESTSUITEFLAGS='--recheck'; then :; - else - cat tests/testsuite.log - exit 1 - fi -%endif - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -# Create default or update existing /etc/sysconfig/openvswitch. -SYSCONFIG=/etc/sysconfig/openvswitch -TEMPLATE=/usr/share/openvswitch/scripts/sysconfig.template -if [ ! -e $SYSCONFIG ]; then - cp $TEMPLATE $SYSCONFIG -else - for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE) - do - if ! grep $var $SYSCONFIG >/dev/null 2>&1; then - echo >> $SYSCONFIG - sed -n "/$var:/,/$var=/p" $TEMPLATE >> $SYSCONFIG - fi - done -fi - -# Ensure all required services are set to run -/sbin/chkconfig --add openvswitch -/sbin/chkconfig openvswitch on - -%preun -if [ "$1" = "0" ]; then # $1 = 0 for uninstall - /sbin/service openvswitch stop - /sbin/chkconfig --del openvswitch -fi - -%postun -if [ "$1" = "0" ]; then # $1 = 0 for uninstall - rm -f /etc/openvswitch/conf.db - rm -f /etc/sysconfig/openvswitch - rm -f /etc/openvswitch/vswitchd.cacert -fi - -exit 0 - -%files -%defattr(-,root,root) -/etc/init.d/openvswitch -%config(noreplace) /etc/logrotate.d/openvswitch -/etc/sysconfig/network-scripts/ifup-ovs -/etc/sysconfig/network-scripts/ifdown-ovs -/usr/bin/ovs-appctl -/usr/bin/ovs-benchmark -/usr/bin/ovs-dpctl -/usr/bin/ovs-dpctl-top -/usr/bin/ovs-ofctl -/usr/bin/ovs-parse-backtrace -/usr/bin/ovs-pcap -/usr/bin/ovs-pki -/usr/bin/ovs-tcpundump -/usr/bin/ovs-vlan-test -/usr/bin/ovs-vsctl -/usr/bin/ovsdb-client -/usr/bin/ovsdb-tool -/usr/bin/vtep-ctl -/usr/sbin/ovs-bugtool -/usr/sbin/ovs-vswitchd -/usr/sbin/ovsdb-server -/usr/share/man/man1/ovs-benchmark.1.gz -/usr/share/man/man1/ovs-pcap.1.gz -/usr/share/man/man1/ovs-tcpundump.1.gz -/usr/share/man/man1/ovsdb-client.1.gz -/usr/share/man/man1/ovsdb-server.1.gz -/usr/share/man/man1/ovsdb-tool.1.gz -/usr/share/man/man5/ovs-vswitchd.conf.db.5.gz -/usr/share/man/man5/vtep.5.gz -/usr/share/man/man8/ovs-appctl.8.gz -/usr/share/man/man8/ovs-bugtool.8.gz -/usr/share/man/man8/ovs-ctl.8.gz -/usr/share/man/man8/ovs-dpctl.8.gz -/usr/share/man/man8/ovs-dpctl-top.8.gz -/usr/share/man/man8/ovs-ofctl.8.gz -/usr/share/man/man8/ovs-parse-backtrace.8.gz -/usr/share/man/man8/ovs-pki.8.gz -/usr/share/man/man8/ovs-vlan-test.8.gz -/usr/share/man/man8/ovs-vsctl.8.gz -/usr/share/man/man8/ovs-vswitchd.8.gz -/usr/share/man/man8/vtep-ctl.8.gz -/usr/share/openvswitch/bugtool-plugins/ -/usr/share/openvswitch/python/ -/usr/share/openvswitch/scripts/ovs-bugtool-* -/usr/share/openvswitch/scripts/ovs-check-dead-ifs -/usr/share/openvswitch/scripts/ovs-ctl -/usr/share/openvswitch/scripts/ovs-lib -/usr/share/openvswitch/scripts/ovs-save -/usr/share/openvswitch/scripts/ovs-vtep -/usr/share/openvswitch/scripts/sysconfig.template -/usr/share/openvswitch/vswitch.ovsschema -/usr/share/openvswitch/vtep.ovsschema -/usr/share/doc/openvswitch-%{version}/FAQ -/usr/share/doc/openvswitch-%{version}/README.RHEL -/var/lib/openvswitch -/var/log/openvswitch diff -Nru openvswitch-2.3.1/rhel/openvswitch.spec.in openvswitch-2.4.0~git20150623/rhel/openvswitch.spec.in --- openvswitch-2.3.1/rhel/openvswitch.spec.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/openvswitch.spec.in 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ # Spec file for Open vSwitch on Red Hat Enterprise Linux. -# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -22,7 +22,7 @@ Release: 1 Source: openvswitch-%{version}.tar.gz Buildroot: /tmp/openvswitch-rpm -Requires: openvswitch-kmod, logrotate, python +Requires: logrotate, python BuildRequires: openssl-devel %bcond_without check @@ -55,14 +55,13 @@ rhel_cp etc_sysconfig_network-scripts_ifdown-ovs 0755 rhel_cp usr_share_openvswitch_scripts_sysconfig.template 0644 -docdir=$RPM_BUILD_ROOT/usr/share/doc/openvswitch-%{version} -install -d -m755 "$docdir" -install -m 0644 FAQ rhel/README.RHEL "$docdir" install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python # Get rid of stuff we don't want to make RPM happy. rm \ + $RPM_BUILD_ROOT/usr/bin/ovs-testcontroller \ + $RPM_BUILD_ROOT/usr/share/man/man8/ovs-testcontroller.8 \ $RPM_BUILD_ROOT/usr/bin/ovs-test \ $RPM_BUILD_ROOT/usr/bin/ovs-l3ping \ $RPM_BUILD_ROOT/usr/share/man/man8/ovs-test.8 \ @@ -70,6 +69,7 @@ $RPM_BUILD_ROOT/usr/sbin/ovs-vlan-bug-workaround \ $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8 (cd "$RPM_BUILD_ROOT" && rm -rf usr/lib) +(cd "$RPM_BUILD_ROOT" && rm -rf usr/include) install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch @@ -123,6 +123,8 @@ %files %defattr(-,root,root) +/etc/bash_completion.d/ovs-appctl-bashcomp.bash +/etc/bash_completion.d/ovs-vsctl-bashcomp.bash /etc/init.d/openvswitch %config(noreplace) /etc/logrotate.d/openvswitch /etc/sysconfig/network-scripts/ifup-ovs @@ -131,6 +133,7 @@ /usr/bin/ovs-benchmark /usr/bin/ovs-dpctl /usr/bin/ovs-dpctl-top +/usr/bin/ovs-docker /usr/bin/ovs-ofctl /usr/bin/ovs-parse-backtrace /usr/bin/ovs-pcap @@ -175,7 +178,7 @@ /usr/share/openvswitch/scripts/sysconfig.template /usr/share/openvswitch/vswitch.ovsschema /usr/share/openvswitch/vtep.ovsschema -/usr/share/doc/openvswitch-%{version}/FAQ -/usr/share/doc/openvswitch-%{version}/README.RHEL +%doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md FAQ.md NEWS +%doc INSTALL.DPDK.md rhel/README.RHEL README-native-tunneling.md /var/lib/openvswitch /var/log/openvswitch diff -Nru openvswitch-2.3.1/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service openvswitch-2.4.0~git20150623/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service --- openvswitch-2.3.1/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service 2015-06-23 18:46:21.000000000 +0000 @@ -11,3 +11,5 @@ ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start \ --system-id=random $OPTIONS ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop +RuntimeDirectory=openvswitch +RuntimeDirectoryMode=0755 diff -Nru openvswitch-2.3.1/SECURITY.md openvswitch-2.4.0~git20150623/SECURITY.md --- openvswitch-2.3.1/SECURITY.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/SECURITY.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,174 @@ +Security Process +================ + +This is a proposed security vulnerability reporting and handling +process for Open vSwitch. It is based on the OpenStack vulnerability +management process described at +https://wiki.openstack.org/wiki/Vulnerability_Management. + +The OVS security team coordinates vulnerability management using the +ovs-security mailing list. Membership in the security team and +subscription to its mailing list consists of a small number of +trustworthy people, as determined by rough consensus of the Open +vSwitch committers on the ovs-committers mailing list. The Open +vSwitch security team should include Open vSwitch committers, to +ensure prompt and accurate vulnerability assessments and patch review. + +We encourage everyone involved in the security process to GPG-sign +their emails. We additionally encourage GPG-encrypting one-on-one +conversations as part of the security process. + + +What is a vulnerability? +------------------------ + +All vulnerabilities are bugs, but not every bug is a vulnerability. +Vulnerabilities compromise one or more of: + + * Confidentiality (personal or corporate confidential data). + * Integrity (trustworthiness and correctness). + * Availability (uptime and service). + +Here are some examples of vulnerabilities to which one would expect to +apply this process: + + * A crafted packet that causes a kernel or userspace crash + (Availability). + + * A flow translation bug that misforwards traffic in a way likely + to hop over security boundaries (Integrity). + + * An OpenFlow protocol bug that allows a controller to read + arbitrary files from the file system (Confidentiality). + + * Misuse of the OpenSSL library that allows bypassing certificate + checks (Integrity). + + * A bug (memory corruption, overflow, ...) that allows one to + modify the behaviour of OVS through external configuration + interfaces such as OVSDB (Integrity). + + * Privileged information is exposed to unprivileged users + (Confidentiality). + +If in doubt, please do use the vulnerability management process. At +worst, the response will be to report the bug through the usual +channels. + + +Step 1: Reception +----------------- + +To report an Open vSwitch vulnerability, send an email to the +ovs-security mailing list (see "Contact" at the end of this document). +A security team member should reply to the reporter acknowledging that +the report has been received. + +Please consider reporting the information mentioned in +REPORTING-BUGS.md, where relevant. + +Reporters may ask for a GPG key while initiating contact with the +security team to deliver more sensitive reports. + +The Linux kernel has its own vulnerability management process: +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SecurityBugs +Handling of vulnerabilities that affect both the Open vSwitch tree and +the upstream Linux kernel should be reported through both processes. +Please send your report as a single email to both the kernel and OVS +security teams to allow those teams to most easily coordinate among +themselves. + + +Step 2: Assessment +------------------ + +The security team should discuss the vulnerability. The reporter +should be included in the discussion (via "CC") to an appropriate +degree. + +The assessment should determine which Open vSwitch versions are +affected (e.g. every version, only the latest release, only unreleased +versions), the privilege required to take advantage of the +vulnerability (e.g. any network user, any local L2 network user, any +local system user, connected OpenFlow controllers), the severity of +the vulnerability, and how the vulnerability may be mitigated (e.g. by +disabling a feature). + +The treatment of the vulnerability could end here if the team +determines that it is not a realistic vulnerability. + + +Step 3a: Document +---------------- + +The security team develops a security advisory document. The document +credits the reporter and describes the vulnerability, including all of +the relevant information from the assessment in step 2. The security +team may, at its discretion, include the reporter (via "CC") in +developing the security advisory document, but in any case should +accept feedback from the reporter before finalizing the document. + +When the document is final, the security team should obtain a CVE for +the vulnerability from a CNA (https://cve.mitre.org/cve/cna.html). + + +Step 3b: Fix +------------ + +Steps 3a and 3b may proceed in parallel. + +The security team develops and obtains (private) reviews for patches +that fix the vulnerability. If necessary, the security team pulls in +additional developers, who must agree to maintain confidentiality. + + +Step 4: Embargoed Disclosure +---------------------------- + +The security advisory and patches are sent to downstream stakeholders, +with an embargo date and time set from the time sent. Downstream +stakeholders are expected not to deploy or disclose patches until +the embargo is passed. + +A disclosure date is negotiated by the security team working with the +bug submitter as well as vendors. However, the Open vSwitch security +team holds the final say when setting a disclosure date. The timeframe +for disclosure is from immediate (esp. if it's already publicly known) +to a few weeks. As a basic default policy, we expect report date to +disclosure date to be 3~5 business days. + +Operating system vendors are obvious downstream stakeholders. It may +not be necessary to be too choosy about who to include: any major Open +vSwitch user who is interested and can be considered trustworthy +enough could be included. To become a downstream stakeholder, email +the ovs-security mailing list. + +If the vulnerability is already public, skip this step. + + +Step 5: Public Disclosure +------------------------- + +When the embargo expires, push the (reviewed) patches to appropriate +branches, post the patches to the ovs-dev mailing list (noting that +they have already been reviewed and applied), post the security +advisory to appropriate mailing lists (ovs-announce, ovs-discuss), and +post the security advisory on the Open vSwitch webpage. + +When the patch is applied to LTS (long-term support) branches, a new +version should be released. + +The security advisory should be GPG-signed by a security team member +with a key that is in a public web of trust. + + +Contact +======= + +Report security vulnerabilities to the ovs-security mailing list: +security@openvswitch.org + +Report problems with this document to the ovs-bugs mailing list: +bugs@openvswitch.org + +Visit http://openvswitch.org/ to learn more about Open vSwitch. diff -Nru openvswitch-2.3.1/tests/atlocal.in openvswitch-2.4.0~git20150623/tests/atlocal.in --- openvswitch-2.3.1/tests/atlocal.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/atlocal.in 2015-06-23 18:46:21.000000000 +0000 @@ -93,12 +93,25 @@ ;; esac -# Check for MINGW platform. +# Check for platform. case `uname` in MINGW*) IS_WIN32="yes" + IS_BSD="no" + ;; +FreeBSD|NetBSD) + IS_WIN32="no" + IS_BSD="yes" ;; *) IS_WIN32="no" + IS_BSD="no" ;; esac + +# XXX: Disable Python related tests on Windows because Open vSwitch code +# written in Python has not been ported to the Windows platform. We will +# need to remove the next block after porting is complete. +if test "$IS_WIN32" = "yes"; then + HAVE_PYTHON="no" +fi diff -Nru openvswitch-2.3.1/tests/auto-attach.at openvswitch-2.4.0~git20150623/tests/auto-attach.at --- openvswitch-2.3.1/tests/auto-attach.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/auto-attach.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,7 @@ +AT_BANNER([auto-attach unit tests]) + +AT_SETUP([auto-attach - packet tests]) +AT_KEYWORDS([auto-attach]) +AT_CHECK(ovstest test-aa, [], [ignore], [ignore]) + +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/automake.mk openvswitch-2.4.0~git20150623/tests/automake.mk --- openvswitch-2.3.1/tests/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,12 +1,22 @@ EXTRA_DIST += \ + $(COMMON_MACROS_AT) \ $(TESTSUITE_AT) \ + $(KMOD_TESTSUITE_AT) \ $(TESTSUITE) \ + $(KMOD_TESTSUITE) \ tests/atlocal.in \ $(srcdir)/package.m4 \ - $(srcdir)/tests/testsuite + $(srcdir)/tests/testsuite \ + $(srcdir)/tests/testsuite.patch + +COMMON_MACROS_AT = \ + tests/ovsdb-macros.at \ + tests/ovs-macros.at \ + tests/ofproto-macros.at + TESTSUITE_AT = \ tests/testsuite.at \ - tests/ovsdb-macros.at \ + tests/completion.at \ tests/library.at \ tests/heap.at \ tests/bundle.at \ @@ -20,10 +30,12 @@ tests/ofp-errors.at \ tests/ovs-ofctl.at \ tests/odp.at \ + tests/mpls-xlate.at \ tests/multipath.at \ tests/bfd.at \ tests/cfm.at \ tests/lacp.at \ + tests/lib.at \ tests/learn.at \ tests/vconn.at \ tests/file_name.at \ @@ -34,12 +46,15 @@ tests/jsonrpc.at \ tests/jsonrpc-py.at \ tests/tunnel.at \ + tests/tunnel-push-pop.at \ tests/lockfile.at \ tests/reconnect.at \ tests/ovs-vswitchd.at \ + tests/dpif-netdev.at \ + tests/dpctl.at \ tests/ofproto-dpif.at \ + tests/bridge.at \ tests/vlan-splinters.at \ - tests/ofproto-macros.at \ tests/ofproto.at \ tests/ovsdb.at \ tests/ovsdb-log.at \ @@ -63,10 +78,20 @@ tests/ovs-monitor-ipsec.at \ tests/ovs-xapi-sync.at \ tests/stp.at \ + tests/rstp.at \ tests/interface-reconfigure.at \ tests/vlog.at \ - tests/vtep-ctl.at + tests/vtep-ctl.at \ + tests/auto-attach.at + +KMOD_TESTSUITE_AT = \ + tests/kmod-testsuite.at \ + tests/kmod-macros.at \ + tests/kmod-traffic.at + TESTSUITE = $(srcdir)/tests/testsuite +TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch +KMOD_TESTSUITE = $(srcdir)/tests/kmod-testsuite DISTCLEANFILES += tests/atconfig tests/atlocal AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests @@ -105,8 +130,8 @@ tests/valgrind/test-bundle \ tests/valgrind/test-byte-order \ tests/valgrind/test-classifier \ + tests/valgrind/test-cmap \ tests/valgrind/test-csum \ - tests/valgrind/test-file_name \ tests/valgrind/test-flows \ tests/valgrind/test-hash \ tests/valgrind/test-hindex \ @@ -121,6 +146,7 @@ tests/valgrind/test-packets \ tests/valgrind/test-random \ tests/valgrind/test-reconnect \ + tests/valgrind/test-rstp \ tests/valgrind/test-sha1 \ tests/valgrind/test-stp \ tests/valgrind/test-type-props \ @@ -130,9 +156,9 @@ $(valgrind_wrappers): tests/valgrind-wrapper.in @test -d tests/valgrind || mkdir tests/valgrind - sed -e 's,[@]wrap_program[@],$@,' \ - $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp - chmod +x $@.tmp + $(AM_V_GEN) sed -e 's,[@]wrap_program[@],$@,' \ + $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp && \ + chmod +x $@.tmp && \ mv $@.tmp $@ CLEANFILES += $(valgrind_wrappers) EXTRA_DIST += tests/valgrind-wrapper.in @@ -152,25 +178,47 @@ # OFTest support. check-oftest: all - srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-oftest + $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-oftest EXTRA_DIST += tests/run-oftest # Ryu support. check-ryu: all - srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-ryu + $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-ryu EXTRA_DIST += tests/run-ryu +# Run kmod tests. Assume kernel modules has been installed or linked into the kernel +check-kernel: all tests/atconfig tests/atlocal $(KMOD_TESTSUITE) + $(SHELL) '$(KMOD_TESTSUITE)' -C tests AUTOTEST_PATH='$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS) + +# Testing the out of tree Kernel module +check-kmod: all tests/atconfig tests/atlocal $(KMOD_TESTSUITE) + $(MAKE) modules_install + modprobe -r openvswitch + $(MAKE) check-kernel + clean-local: test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean AUTOTEST = $(AUTOM4TE) --language=autotest -$(TESTSUITE): package.m4 $(TESTSUITE_AT) - $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at - mv $@.tmp $@ + +if WIN32 +$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) $(TESTSUITE_PATCH) + $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o testsuite.tmp $@.at + patch -p0 testsuite.tmp $(TESTSUITE_PATCH) + $(AM_V_at)mv testsuite.tmp $@ +else +$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) + $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + $(AM_V_at)mv $@.tmp $@ +endif + +$(KMOD_TESTSUITE): package.m4 $(KMOD_TESTSUITE_AT) $(COMMON_MACROS_AT) + $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + $(AM_V_at)mv $@.tmp $@ # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac - :;{ \ + $(AM_V_GEN):;{ \ echo '# Signature of the current package.' && \ echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \ echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \ @@ -179,13 +227,6 @@ echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \ } >'$(srcdir)/package.m4' -noinst_PROGRAMS += tests/test-controller -MAN_ROOTS += tests/test-controller.8.in -DISTCLEANFILES += tests/test-controller.8 -noinst_man_MANS += tests/test-controller.8 -tests_test_controller_SOURCES = tests/test-controller.c -tests_test_controller_LDADD = lib/libopenvswitch.la - noinst_PROGRAMS += tests/test-ovsdb tests_test_ovsdb_SOURCES = \ tests/test-ovsdb.c \ @@ -194,16 +235,28 @@ EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la +noinst_PROGRAMS += tests/test-lib +tests_test_lib_SOURCES = \ + tests/test-lib.c +tests_test_lib_LDADD = lib/libopenvswitch.la + # idltest schema and IDL OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann -EXTRA_DIST += $(IDLTEST_IDL_FILES) +EXTRA_DIST += $(IDLTEST_IDL_FILES) tests/idltest2.ovsschema tests/idltest.ovsidl: $(IDLTEST_IDL_FILES) - $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp + $(AM_V_GEN)$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp && \ mv $@.tmp $@ tests/idltest.c: tests/idltest.h +if DPDK_NETDEV +noinst_PROGRAMS += tests/test-dpdkr +tests_test_dpdkr_SOURCES = \ + tests/dpdk/ring_client.c +tests_test_dpdkr_LDADD = lib/libopenvswitch.la $(LIBS) +endif + noinst_PROGRAMS += tests/ovstest tests_ovstest_SOURCES = \ tests/ovstest.c \ @@ -213,8 +266,8 @@ tests/test-bundle.c \ tests/test-byte-order.c \ tests/test-classifier.c \ + tests/test-cmap.c \ tests/test-csum.c \ - tests/test-file_name.c \ tests/test-flows.c \ tests/test-hash.c \ tests/test-heap.c \ @@ -230,12 +283,15 @@ tests/test-packets.c \ tests/test-random.c \ tests/test-reconnect.c \ + tests/test-rstp.c \ tests/test-sflow.c \ tests/test-sha1.c \ tests/test-stp.c \ tests/test-util.c \ tests/test-uuid.c \ - tests/test-vconn.c + tests/test-bitmap.c \ + tests/test-vconn.c \ + tests/test-aa.c if !WIN32 tests_ovstest_SOURCES += \ @@ -278,21 +334,28 @@ check_DATA += $(TESTPKI_FILES) CLEANFILES += $(TESTPKI_FILES) -tests/testpki-cacert.pem: tests/pki/stamp; cp tests/pki/switchca/cacert.pem $@ -tests/testpki-cert.pem: tests/pki/stamp; cp tests/pki/test-cert.pem $@ -tests/testpki-req.pem: tests/pki/stamp; cp tests/pki/test-req.pem $@ -tests/testpki-privkey.pem: tests/pki/stamp; cp tests/pki/test-privkey.pem $@ -tests/testpki-cert2.pem: tests/pki/stamp; cp tests/pki/test2-cert.pem $@ -tests/testpki-req2.pem: tests/pki/stamp; cp tests/pki/test2-req.pem $@ -tests/testpki-privkey2.pem: tests/pki/stamp; cp tests/pki/test2-privkey.pem $@ +tests/testpki-cacert.pem: tests/pki/stamp + $(AM_V_GEN)cp tests/pki/switchca/cacert.pem $@ +tests/testpki-cert.pem: tests/pki/stamp + $(AM_V_GEN)cp tests/pki/test-cert.pem $@ +tests/testpki-req.pem: tests/pki/stamp + $(AM_V_GEN)cp tests/pki/test-req.pem $@ +tests/testpki-privkey.pem: tests/pki/stamp + $(AM_V_GEN)cp tests/pki/test-privkey.pem $@ +tests/testpki-cert2.pem: tests/pki/stamp + $(AM_V_GEN)cp tests/pki/test2-cert.pem $@ +tests/testpki-req2.pem: tests/pki/stamp + $(AM_V_GEN)cp tests/pki/test2-req.pem $@ +tests/testpki-privkey2.pem: tests/pki/stamp + $(AM_V_GEN)cp tests/pki/test2-privkey.pem $@ OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log tests/pki/stamp: - rm -f tests/pki/stamp - rm -rf tests/pki - $(OVS_PKI) init - $(OVS_PKI) req+sign tests/pki/test - $(OVS_PKI) req+sign tests/pki/test2 + $(AM_V_at)rm -f tests/pki/stamp + $(AM_V_at)rm -rf tests/pki + $(AM_V_GEN)$(OVS_PKI) init && \ + $(OVS_PKI) req+sign tests/pki/test && \ + $(OVS_PKI) req+sign tests/pki/test2 && \ : > tests/pki/stamp CLEANFILES += tests/ovs-pki.log diff -Nru openvswitch-2.3.1/tests/bfd.at openvswitch-2.4.0~git20150623/tests/bfd.at --- openvswitch-2.3.1/tests/bfd.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/bfd.at 2015-06-23 18:46:21.000000000 +0000 @@ -55,18 +55,18 @@ set Interface p0 bfd:enable=true -- \ set Interface p1 bfd:enable=true ]) ovs-appctl time/stop -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 #Verify that BFD has been enabled on both interfaces. BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) AT_CHECK([ ovs-vsctl set interface p0 bfd:enable=false]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p1], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) AT_CHECK([ ovs-vsctl set interface p0 bfd:enable=true]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p1], [true], [false], [none], [up], [Control Detection Time Expired], [none], [up], [No Diagnostic]) BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [Control Detection Time Expired]) @@ -115,13 +115,13 @@ AT_CHECK([ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL']) #Verify that BFD is enabled. -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) #Drop all packets in the br-sw bridge so that the tunnel is down. AT_CHECK([ ovs-ofctl add-flow br-sw 'priority=5,actions=drop' ]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p1], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) BFD_CHECK([p0], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) @@ -129,7 +129,7 @@ AT_CHECK([ovs-ofctl del-flows br-sw], [0]) AT_CHECK([ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL']) #Verify that BFD is back up again. -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p1], [true], [false], [none], [up], [Control Detection Time Expired], [none], [up], [Control Detection Time Expired]) BFD_CHECK([p0], [true], [false], [none], [up], [Control Detection Time Expired], [none], [up], [Control Detection Time Expired]) @@ -142,10 +142,11 @@ # but not received by p1. p0 will receive all BFD packets from p1. AT_CHECK([ ovs-ofctl add-flow br-sw 'in_port=1,priority=5,actions=drop']) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 # Make sure p1 BFD state is down since it received no BFD packets. BFD_CHECK([p1], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 + # p0 will be in init state once it receives "down" BFD message from p1. BFD_CHECK([p0], [false], [false], [none], [init], [Neighbor Signaled Session Down], [none], [down], [Control Detection Time Expired]) @@ -153,12 +154,12 @@ AT_CHECK([ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL']) #Ensure that BFD is back up again. -for i in `seq 0 10`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1100 100 #Bring down the br-bfd0 - br-sw link AT_CHECK([ ovs-ofctl add-flow br-sw 'in_port=2,priority=5,actions=drop']) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p0], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p1], [false], [false], [none], [init], [Neighbor Signaled Session Down], [none], [down], [Control Detection Time Expired]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -177,7 +178,7 @@ options:peer=p1 ]) AT_CHECK([ ovs-vsctl -- set interface p0 bfd:enable=true ]) AT_CHECK([ ovs-vsctl -- set interface p1 bfd:enable=true ]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 #Verify that BFD has been enabled on both interfaces. BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) @@ -185,7 +186,7 @@ #Set cpath_down to true on one interface, make sure the remote interface updates its values. AT_CHECK([ovs-vsctl set interface p0 bfd:cpath_down=true]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 BFD_CHECK([p1], [false], [false], [none], [up], [No Diagnostic], [none], [up], [Concatenated Path Down]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -203,19 +204,19 @@ options:peer=p1 ]) AT_CHECK([ ovs-vsctl -- set interface p0 bfd:enable=true ]) AT_CHECK([ ovs-vsctl -- set interface p1 bfd:enable=true ]) -for i in `seq 0 30`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 3100 100 #Verify that BFD has been enabled on both interfaces. BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) #Edit the min Tx value. AT_CHECK([ovs-vsctl set interface p0 bfd:min_tx=200]) -for i in `seq 0 20`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 2100 100 BFD_CHECK_TX([p0], [1000ms], [200ms], [100ms]) BFD_CHECK_TX([p1], [1000ms], [100ms], [200ms]) #Edit the min Rx value. AT_CHECK([ovs-vsctl set interface p1 bfd:min_rx=300]) -for i in `seq 0 20`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 2100 100 BFD_CHECK_RX([p1], [300ms], [300ms], [1000ms]) BFD_CHECK_RX([p0], [1000ms], [1000ms], [300ms]) @@ -229,7 +230,7 @@ set bridge br0 fail-mode=standalone]) # by default check_tnl_key is false. so we should process a bfd packet with tun_id=1. -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,tp_src=0,tp_dst=0,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no),udp(src=49152/0,dst=3784/0xffff)' -generate], [0], [stdout]) # check that the packet should be handled as BFD packet. AT_CHECK([tail -2 stdout], [0], [dnl This flow is handled by the userspace slow path because it: @@ -238,7 +239,7 @@ # turn on the check_tnl_key. AT_CHECK([ovs-vsctl set interface p1 bfd:check_tnl_key=true]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,tp_src=0,tp_dst=0,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no),udp(src=49152/0,dst=3784/0xffff)' -generate], [0], [stdout]) # check that the packet should be handled as normal packet. AT_CHECK([tail -1 stdout], [0],[dnl Datapath actions: 100 @@ -246,7 +247,7 @@ # set the tunnel key to 0. AT_CHECK([ovs-vsctl set interface p1 options:key=0]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,tp_src=0,tp_dst=0,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no),udp(src=49152/0,dst=3784/0xffff)' -generate], [0], [stdout]) # check that the packet should be handled as BFD packet. AT_CHECK([tail -2 stdout], [0], [dnl This flow is handled by the userspace slow path because it: @@ -269,7 +270,7 @@ ovs-appctl time/stop # wait for a while to stablize everything. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 10000 500 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) @@ -279,18 +280,18 @@ AT_CHECK([ovs-vsctl set interface p0 bfd:decay_min_rx=3000]) # bfd:decay_min_rx is set to 3000ms after the local state of p0 goes up, # so for the first 2000ms, there should be no change. -for i in `seq 0 3`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 2000 500 BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) BFD_CHECK_RX([p0], [500ms], [300ms], [500ms]) # advance the clock by 5000ms. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 5000 500 # now, min_rx should decay to 3000ms. BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) BFD_CHECK_RX([p0], [3000ms], [3000ms], [500ms]) # advance clock by 5000ms and check the the flags are all 'none'. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 5000 500 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) @@ -317,7 +318,7 @@ # this should firstly reset the min_rx and then re-decay to 1000ms. AT_CHECK([ovs-vsctl set Interface p0 bfd:decay_min_rx=1000]) # advance the clock by 10000ms, decay should have happened. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 10000 500 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) @@ -328,7 +329,7 @@ # Test-4 BFD decay: set decay_min_rx to 0 to disable bfd decay. AT_CHECK([ovs-vsctl set Interface p0 bfd:decay_min_rx=0]) # advance the clock by 5000ms. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 10000 500 # min_rx is reset. BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) BFD_CHECK_RX([p0], [500ms], [300ms], [500ms]) @@ -347,7 +348,7 @@ # Test-5 BFD decay: rmt_min_tx is greater than decay_min_rx AT_CHECK([ovs-vsctl set Interface p0 bfd:decay_min_rx=3000 -- set interface p1 bfd:min_tx=5000]) # advance the clock by 10000ms to stable everything. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 10000 500 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) # p0 rx should show 5000ms even if it is in decay. @@ -366,7 +367,7 @@ AT_CHECK([ovs-vsctl set Interface p1 bfd:min_tx=500]) # advance the clock by 20000ms to stable everything. # since p0 has been in decay, now the RX will show 3000ms. -for i in `seq 0 39`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 20000 500 BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) BFD_CHECK_RX([p0], [3000ms], [3000ms], [500ms]) # End of Test-5 ############################################################### @@ -377,19 +378,19 @@ AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false]) # advance the clock by 15000ms to stable everything. -for i in `seq 0 14`; do ovs-appctl time/warp 1000; done +ovs-appctl time/warp 15000 1000 BFD_CHECK([p0], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) BFD_CHECK_TX([p0], [1000ms], [1000ms], [0ms]) BFD_CHECK_RX([p0], [300ms], [300ms], [1ms]) # resume the bfd on p1. the bfd should not go to decay mode direclty. AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true]) -for i in `seq 0 3`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 1500 500 BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) BFD_CHECK_RX([p0], [500ms], [300ms], [500ms]) # since the decay_min_rx is still 3000ms, so after 5000ms, p0 should have decayed. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 5000 500 BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) BFD_CHECK_RX([p0], [3000ms], [3000ms], [500ms]) # End of Test-6 ################################################################ @@ -460,7 +461,7 @@ ovs-appctl time/stop # advance the clock, to stablize the states. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 5000 500 # enable forwarding_if_rx. AT_CHECK([ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true], [0]) @@ -501,7 +502,7 @@ # re-enable bfd on the other end. the states should be up. AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300]) # advance the clock, to stablize the states. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 5000 500 BFD_CHECK([p0], [true], [false], [none], [up], [Control Detection Time Expired], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [Control Detection Time Expired]) BFD_CHECK_TX([p0], [500ms], [500ms], [300ms]) @@ -524,7 +525,7 @@ ovs-appctl time/stop # advance the clock, to stablize the states. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 10000 500 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) @@ -545,7 +546,7 @@ AT_CHECK([ovs-vsctl set interface p0 bfd:decay_min_rx=1000]) # wait for 5000ms to decay. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 5000 500 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) BFD_CHECK_RX([p0], [1000ms], [1000ms], [500ms]) @@ -575,7 +576,7 @@ done # stop receiving for 5000ms. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 BFD_CHECK([p0], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) # reset bfd forwarding_if_rx. @@ -588,7 +589,7 @@ # re-enable bfd on the other end. the states should be up. AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300]) # advance the clock, to stablize the states. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 10000 500 BFD_CHECK([p0], [true], [false], [none], [up], [Control Detection Time Expired], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [Control Detection Time Expired]) BFD_CHECK_TX([p0], [300ms], [300ms], [300ms]) @@ -611,7 +612,7 @@ ovs-appctl time/stop # advance the clock, to stablize the states. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 10000 500 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) @@ -644,7 +645,7 @@ # now enable the bfd on p1 again. AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true], [0]) # advance clock by 5000ms. and p1 and p0 should be all up. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done +ovs-appctl time/warp 5000 500 BFD_CHECK([p0], [true], [false], [none], [up], [Control Detection Time Expired], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [Control Detection Time Expired]) BFD_CHECK_TX([p0], [500ms], [300ms], [500ms]) @@ -683,9 +684,12 @@ set Interface p1 bfd:enable=true bfd:min_tx=100 bfd:min_rx=100]) ovs-appctl time/stop +# Disable the stats update to prevent the race between ovsdb updating +# stats and ovs-vsctl cmd closing the jsonrpc session. +AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:stats-update-interval=50000000]) # Part-1 wait for a while to stablize bfd. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 10100 100 BFD_CHECK([p0], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none], [up], [No Diagnostic]) BFD_CHECK_TX([p0], [100ms], [100ms], [100ms]) @@ -696,7 +700,7 @@ # turn bfd on p1 off, should increment the bfd:flap_count on p0. AT_CHECK([ovs-vsctl set interface p1 bfd:enable=false]) -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 BFD_CHECK([p0], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) BFD_VSCTL_LIST_IFACE([p0], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["2"]) AT_CHECK([ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p"]) @@ -704,7 +708,7 @@ # turn bfd on p1 on again, should increment the bfd:flap_count on p0. # p1 should still have flap_count = "1", since it is reset. AT_CHECK([ovs-vsctl set interface p1 bfd:enable=true]) -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 BFD_VSCTL_LIST_IFACE([p0], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["3"]) BFD_VSCTL_LIST_IFACE([p1], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["1"]) @@ -716,7 +720,7 @@ # turn bfd on p1 off, should not increment the bfd:flap_count on p0, since forwarding_override is on. AT_CHECK([ovs-vsctl set interface p1 bfd:enable=false]) -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 BFD_CHECK([p0], [true], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) BFD_VSCTL_LIST_IFACE([p0], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["3"]) AT_CHECK([ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p"]) @@ -724,7 +728,7 @@ # turn bfd on p1 on again, should not increment the bfd:flap_count on p0, since forwarding override is on. # p1 should still have flap_count = "1", since it is reset. AT_CHECK([ovs-vsctl set interface p1 bfd:enable=true]) -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 BFD_VSCTL_LIST_IFACE([p0], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["3"]) BFD_VSCTL_LIST_IFACE([p1], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["1"]) @@ -735,15 +739,15 @@ # turn bfd on p1 off and on, should increment the bfd:flap_count on p0. AT_CHECK([ovs-vsctl set interface p1 bfd:enable=false]) -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 AT_CHECK([ovs-vsctl set interface p1 bfd:enable=true]) -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 BFD_VSCTL_LIST_IFACE([p0], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["5"]) BFD_VSCTL_LIST_IFACE([p1], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["1"]) # Part-3 now turn on forwarding_if_rx. AT_CHECK([ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true], [0]) -for i in `seq 0 10`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1100 100 # disable the bfd on p1. AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false], [0]) @@ -762,7 +766,7 @@ # stop the traffic for more than 100 * bfd->cfm_min_rx ms, the forwarding flag of p0 should turn false. # and there should be the increment of flap_count. -for i in `seq 0 120`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 12100 100 BFD_CHECK([p0], [false], [false], [none], [down], [Control Detection Time Expired], [none], [down], [No Diagnostic]) BFD_VSCTL_LIST_IFACE([p0], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["6"]) @@ -779,10 +783,10 @@ # turn on the bfd on p1. AT_CHECK([ovs-vsctl set interface p1 bfd:enable=true]) -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 # even though there is no data traffic, since p1 bfd is on again, should increment the flap_count. BFD_VSCTL_LIST_IFACE([p0], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["7"]) BFD_VSCTL_LIST_IFACE([p1], ["s/^.*flap_count=\(.*\), forwarding.*$/\1/p"], ["1"]) OVS_VSWITCHD_STOP -AT_CLEANUP \ No newline at end of file +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/bridge.at openvswitch-2.4.0~git20150623/tests/bridge.at --- openvswitch-2.3.1/tests/bridge.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/bridge.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,38 @@ +AT_BANNER([bridge]) + +dnl When a port disappears from a datapath, e.g. because an admin used +dnl "ovs-dpctl del-port", the bridge code should be resilient enough to +dnl notice and add it back the next time we reconfigure. A prior version +dnl of the code failed to do this, so this test guards against regression. +AT_SETUP([bridge - ports that disappear get added back]) +OVS_VSWITCHD_START + +# Add some ports and make sure that they show up in the datapath. +ADD_OF_PORTS([br0], 1, 2) +AT_CHECK([ovs-appctl dpif/show], [0], [dnl +dummy@ovs-dummy: hit:0 missed:0 + br0: + br0 65534/100: (dummy) + p1 1/1: (dummy) + p2 2/2: (dummy) +]) + +# Delete p1 from the datapath as if by "ovs-dpctl del-port" +# and check that it disappeared. +AT_CHECK([ovs-appctl dpif-dummy/delete-port ovs-dummy p1]) +AT_CHECK([ovs-appctl dpif/show], [0], [dnl +dummy@ovs-dummy: hit:0 missed:0 + br0: + br0 65534/100: (dummy) + p2 2/2: (dummy) +]) + +# Force reconfiguration and make sure that p1 got added back. +AT_CHECK([ovs-vsctl del-port p2]) +AT_CHECK([ovs-appctl dpif/show], [0], [dnl +dummy@ovs-dummy: hit:0 missed:0 + br0: + br0 65534/100: (dummy) + p1 1/1: (dummy) +]) +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/cfm.at openvswitch-2.4.0~git20150623/tests/cfm.at --- openvswitch-2.3.1/tests/cfm.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/cfm.at 2015-06-23 18:46:21.000000000 +0000 @@ -63,12 +63,12 @@ # advance clock to pass the fault check timeout and check cfm # status update in OVSDB. -for i in `seq 0 14`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1500 100 CFM_CHECK_DB([p0], [true], [recv], [1], [], [], [up]) # remove the cfm on p0 and status should be all empty. AT_CHECK([ovs-vsctl remove int p0 cfm_mpid 1]) -for i in `seq 0 4`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 500 100 CFM_CHECK_DB([p0], [[[]]], [], [[[]]], [], [], [[[]]]) OVS_VSWITCHD_STOP @@ -91,18 +91,18 @@ AT_CHECK([ovs-vsctl set Interface p0 cfm_mpid=1]) # check cfm status update in OVSDB. -for i in `seq 0 14`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1500 100 CFM_CHECK_DB([p0], [true], [recv], [1], [], [], [up]) # turn cfm on p1 on, cfm status of p0 and p1 should all go up. AT_CHECK([ovs-vsctl set interface p1 cfm_mpid=2]) -for i in `seq 0 14`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1500 100 CFM_CHECK_DB([p0], [false], [], [2], [], [2], [up]) CFM_CHECK_DB([p1], [false], [], [0], [], [1], [up]) # turn cfm on p1 off, cfm status of p0 should go down again. AT_CHECK([ovs-vsctl remove int p1 cfm_mpid 2]) -for i in `seq 0 14`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1500 100 CFM_CHECK_DB([p0], [true], [recv], [3], [], [], [up]) OVS_VSWITCHD_STOP @@ -123,7 +123,7 @@ ovs-appctl time/stop # wait for a while to stablize cfm. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 10100 100 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [300ms], [2], [up]) CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [300ms], [1], [up]) @@ -166,7 +166,7 @@ ovs-appctl time/stop # wait for a while to stablize cfm. (need a longer time, since in demand mode # the fault interval is (MAX(ccm_interval_ms, 500) * 3.5) ms) -for i in `seq 0 200`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 20100 100 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [300ms], [2], [up]) CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [300ms], [1], [up]) @@ -194,7 +194,7 @@ # now turn on the cfm on p1 again, AT_CHECK([ovs-vsctl set Interface p1 cfm_mpid=2]) # cfm should be up for both p0 and p1 -for i in `seq 0 200`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 20100 100 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [300ms], [2], [up]) CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [300ms], [1], [up]) @@ -228,19 +228,19 @@ ovs-appctl time/stop # wait for a while to stablize cfm. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 10100 100 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [100ms], [2], [up]) CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [100ms], [1], [up]) # turn cfm on p1 off, should increment the cfm_flap_count on p0. AT_CHECK([ovs-vsctl remove interface p1 cfm_mpid 2]) -for i in `seq 0 10`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1100 100 CFM_VSCTL_LIST_IFACE([p0], [cfm_flap_count], [cfm_flap_count : 1]) CFM_VSCTL_LIST_IFACE([p1], [cfm_flap_count], [cfm_flap_count : [[]]]) # turn cfm on p1 on again, should increment the cfm_flap_count on p0. AT_CHECK([ovs-vsctl set interface p1 cfm_mpid=2]) -for i in `seq 0 10`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 1100 100 CFM_VSCTL_LIST_IFACE([p0], [cfm_flap_count], [cfm_flap_count : 2]) OVS_VSWITCHD_STOP @@ -259,7 +259,7 @@ ovs-appctl time/stop # wait for a while to stablize cfm. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 10100 100 CFM_CHECK_EXTENDED([p0], [1], [100], [up], [up], [100ms], [2], [up]) CFM_CHECK_EXTENDED([p1], [2], [100], [up], [up], [100ms], [1], [up]) AT_CHECK([ovs-appctl cfm/show p1 | grep 'fault_override'], [1], [ignore]) @@ -282,4 +282,4 @@ CFM_VSCTL_LIST_IFACE([p1], [cfm_fault_status], [cfm_fault_status : [[]]]) OVS_VSWITCHD_STOP -AT_CLEANUP \ No newline at end of file +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/classifier.at openvswitch-2.4.0~git20150623/tests/classifier.at --- openvswitch-2.3.1/tests/classifier.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/classifier.at 2015-06-23 18:46:21.000000000 +0000 @@ -6,11 +6,15 @@ [single-rule], [rule-replacement], [many-rules-in-one-list], + [versioned many-rules-in-one-list], [many-rules-in-one-table], + [versioned many-rules-in-one-table], [many-rules-in-two-tables], - [many-rules-in-five-tables]], + [versioned many-rules-in-two-tables], + [many-rules-in-five-tables], + [versioned many-rules-in-five-tables]], [AT_SETUP([flow classifier - m4_bpatsubst(testname, [-], [ ])]) - AT_CHECK([ovstest test-classifier testname], [0], [], []) + AT_CHECK([ovstest test-classifier m4_bpatsubst(testname, [versioned], [--versioned])], [0], [], []) AT_CLEANUP])]) AT_BANNER([miniflow unit tests]) @@ -40,22 +44,22 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=2,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=2,nw_dst=192.168.0.0/16,nw_frag=no + [Megaflow: recirc_id=0,tcp,in_port=2,nw_dst=192.168.0.0/16,nw_frag=no Datapath actions: 1 ]) -AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=11.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=192.168.0.2,nw_frag=no + [Megaflow: recirc_id=0,ip,in_port=1,nw_dst=1.0.0.0/1.0.0.0,nw_frag=no Datapath actions: drop ]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=80 + [Megaflow: recirc_id=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=80 Datapath actions: drop ]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=0x40/0xfff0 + [Megaflow: recirc_id=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=0x1/0x1 Datapath actions: 2 ]) OVS_VSWITCHD_STOP @@ -66,14 +70,6 @@ OVS_VSWITCHD_START ADD_OF_PORTS([br0], [1], [2], [3]) AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0], [0], [ignore], []) -AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=ipv6_label], [0]) -AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_src,tun_dst,tun_src], [1], [], -[ovs-vsctl: nw_dst,nw_src,tun_dst,tun_src: 4 value(s) specified but the maximum number is 3 -]) -AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_dst], [1], [], -[ovs-vsctl: nw_dst,nw_dst: set contains duplicate value -]) -AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=nw_dst], [0]) AT_DATA([flows.txt], [dnl table=0 in_port=1 priority=16,tcp,nw_dst=10.1.0.0/255.255.0.0,action=output(3) table=0 in_port=1 priority=32,tcp,nw_dst=10.1.2.0/255.255.255.0,tp_src=79,action=output(2) @@ -87,25 +83,209 @@ table=0 in_port=3 priority=0,ip,action=drop ]) AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) + +# nw_dst and nw_src should be on by default +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) +AT_CHECK([tail -2 stdout], [0], + [Megaflow: recirc_id=0,ip,in_port=1,nw_dst=192.168.0.0/16,nw_frag=no +Datapath actions: drop +]) + +AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=ipv6_label], [0]) +AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_src,tun_dst,tun_src], [1], [], +[ovs-vsctl: nw_dst,nw_src,tun_dst,tun_src: 4 value(s) specified but the maximum number is 3 +]) +AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_dst], [1], [], +[ovs-vsctl: nw_dst,nw_dst: set contains duplicate value +]) + +AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=nw_dst], [0]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=192.168.0.0/16,nw_frag=no + [Megaflow: recirc_id=0,ip,in_port=1,nw_dst=192.168.0.0/16,nw_frag=no Datapath actions: drop ]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=2,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=2,nw_dst=192.168.0.0/16,nw_frag=no + [Megaflow: recirc_id=0,tcp,in_port=2,nw_dst=192.168.0.0/16,nw_frag=no Datapath actions: 1 ]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=80 + [Megaflow: recirc_id=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=80 Datapath actions: drop ]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_src=0x0/0xffc0,tp_dst=0x40/0xfff0 + [Megaflow: recirc_id=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_src=0x0/0x1,tp_dst=0x40/0xfff0 +Datapath actions: 3 +]) +AT_CHECK([ovs-vsctl set Flow_Table t0 prefixes=none], [0]) +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.3.16,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79'], [0], [stdout]) +AT_CHECK([tail -2 stdout], [0], + [Megaflow: recirc_id=0,tcp,in_port=1,nw_dst=10.1.3.16,nw_frag=no Datapath actions: 3 ]) OVS_VSWITCHD_STOP(["/'prefixes' with incompatible field: ipv6_label/d"]) AT_CLEANUP + +AT_BANNER([conjunctive match]) + +AT_SETUP([single conjunctive match]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1, 2, 3, 4, 5) +AT_DATA([flows.txt], [dnl +conj_id=1,actions=3 +priority=100,ip,ip_src=10.0.0.1,actions=conjunction(1,1/2) +priority=100,ip,ip_src=10.0.0.4,actions=conjunction(1,1/2) +priority=100,ip,ip_src=10.0.0.6,actions=conjunction(1,1/2) +priority=100,ip,ip_src=10.0.0.7,actions=conjunction(1,1/2) +priority=100,ip,ip_dst=10.0.0.2,actions=conjunction(1,2/2) +priority=100,ip,ip_dst=10.0.0.5,actions=conjunction(1,2/2) +priority=100,ip,ip_dst=10.0.0.7,actions=conjunction(1,2/2) +priority=100,ip,ip_dst=10.0.0.8,actions=conjunction(1,2/2) +priority=100,ip,ip_src=10.0.0.1,ip_dst=10.0.0.4,actions=4 +priority=100,ip,ip_src=10.0.0.3,ip_dst=10.0.0.5,actions=5 + +priority=0 actions=2 +]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +for src in 0 1 2 3 4 5 6 7; do + for dst in 0 1 2 3 4 5 6 7; do + if test $src$dst = 14; then + out=4 + elif test $src$dst = 35; then + out=5 + else + out=2 + case $src in [[1467]]) case $dst in [[2578]]) out=3 ;; esac ;; esac + fi + AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_type=0x0800,nw_src=10.0.0.$src,nw_dst=10.0.0.$dst"], [0], [stdout]) + AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: $out +]) + done +done +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([multiple conjunctive match]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1, 2, 3, 4, 5) +AT_DATA([flows.txt], [dnl +conj_id=1,actions=1 +conj_id=2,actions=2 +conj_id=3,actions=3 + +priority=5,ip,ip_src=20.0.0.0/8,actions=conjunction(1,1/2),conjunction(2,1/2) +priority=5,ip,ip_src=10.1.0.0/16,actions=conjunction(1,1/2),conjunction(3,2/3) +priority=5,ip,ip_src=10.2.0.0/16,actions=conjunction(1,1/2),conjunction(2,1/2) +priority=5,ip,ip_src=10.1.3.0/24,actions=conjunction(1,1/2),conjunction(3,2/3) +priority=5,ip,ip_src=10.1.4.5/32,actions=conjunction(1,1/2),conjunction(2,1/2) + +priority=5,ip,ip_dst=20.0.0.0/8,actions=conjunction(1,2/2) +priority=5,ip,ip_dst=10.1.0.0/16,actions=conjunction(1,2/2) +priority=5,ip,ip_dst=10.2.0.0/16,actions=conjunction(1,2/2) +priority=5,ip,ip_dst=10.1.3.0/24,actions=conjunction(1,2/2) +priority=5,ip,ip_dst=10.1.4.5/32,actions=conjunction(1,2/2) +priority=5,ip,ip_dst=30.0.0.0/8,actions=conjunction(2,2/2),conjunction(3,1/3) +priority=5,ip,ip_dst=40.5.0.0/16,actions=conjunction(2,2/2),conjunction(3,1/3) + +priority=5,tcp,tcp_dst=80,actions=conjunction(3,3/3) +priority=5,tcp,tcp_dst=443,actions=conjunction(3,3/3) + +priority=5,tcp,tcp_src=80,actions=conjunction(3,3/3) +priority=5,tcp,tcp_src=443,actions=conjunction(3,3/3) + +priority=0,actions=4 +]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +for a0 in \ + '1 20.0.0.1' \ + '2 10.1.0.1' \ + '3 10.2.0.1' \ + '4 10.1.3.1' \ + '5 10.1.4.5' \ + '6 1.2.3.4' +do + for b0 in \ + '1 20.0.0.1' \ + '2 10.1.0.1' \ + '3 10.2.0.1' \ + '4 10.1.3.1' \ + '5 10.1.4.5' \ + '6 30.0.0.1' \ + '7 40.5.0.1' \ + '8 1.2.3.4' + do + for c0 in '1 80' '2 443' '3 8080'; do + for d0 in '1 80' '2 443' '3 8080'; do + set $a0; a=$1 ip_src=$2 + set $b0; b=$1 ip_dst=$2 + set $c0; c=$1 tcp_src=$2 + set $d0; d=$1 tcp_dst=$2 + case $a$b$c$d in + [[12345]][[12345]]??) out=1 ;; + [[135]][[67]]??) out=2 ;; + [[24]][[67]][[12]]? | [[24]][[67]]?[[12]]) out=3 ;; + *) out=4 + esac + AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=5,dl_type=0x0800,nw_proto=6,nw_src=$ip_src,nw_dst=$ip_dst,tcp_src=$tcp_src,tcp_dst=$tcp_dst"], [0], [stdout]) + AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: $out +]) + done + done + done +done +OVS_VSWITCHD_STOP +AT_CLEANUP + +# In conjunctive match, we can find some soft matches that turn out not to be a +# real match. Usually, that's the end of the road--there is no real match. +# But if there is a flow identical to one of the flows that was a soft match, +# except with a lower priority, then we have to try again with that lower +# priority flow. This test checks this special case. +AT_SETUP([conjunctive match priority fallback]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1, 2, 3, 4, 5, 6, 7) +AT_DATA([flows.txt], [dnl +conj_id=1,actions=1 +conj_id=3,actions=3 + +priority=5,ip,ip_src=10.0.0.1,actions=conjunction(1,1/2) +priority=5,ip,ip_src=10.0.0.2,actions=conjunction(1,1/2) +priority=5,ip,ip_dst=10.0.0.1,actions=conjunction(1,2/2) +priority=5,ip,ip_dst=10.0.0.2,actions=conjunction(1,2/2) +priority=5,ip,ip_dst=10.0.0.3,actions=conjunction(1,2/2) + +priority=4,ip,ip_src=10.0.0.3,ip_dst=10.0.0.2,actions=2 + +priority=3,ip,ip_src=10.0.0.1,actions=conjunction(3,1/2) +priority=3,ip,ip_src=10.0.0.3,actions=conjunction(3,1/2) +priority=3,ip,ip_dst=10.0.0.2,actions=conjunction(3,2/2) +priority=3,ip,ip_dst=10.0.0.3,actions=conjunction(3,2/2) +priority=3,ip,ip_dst=10.0.0.4,actions=conjunction(3,2/2) + +priority=2,ip,ip_dst=10.0.0.1,actions=4 + +priority=1,ip,ip_src=10.0.0.1,ip_dst=10.0.0.5,actions=5 + +priority=0,actions=6 +]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +for src in 0 1 2 3; do + for dst in 0 1 2 3 4 5; do + case $src$dst in + [[12]][[123]]) out=1 ;; + 32) out=2 ;; + [[13]][[234]]) out=3 ;; + ?1) out=4 ;; + 15) out=5 ;; + *) out=6 + esac + AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=7,dl_type=0x0800,nw_src=10.0.0.$src,nw_dst=10.0.0.$dst"], [0], [stdout]) + AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: $out +]) + done +done +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/completion.at openvswitch-2.4.0~git20150623/tests/completion.at --- openvswitch-2.3.1/tests/completion.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/completion.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,789 @@ +AT_BANNER([appctl bashcomp unit tests]) + +m4_define([GET_FORMAT], [ +echo "$@" | grep -A 1 -- "Command format" | tail -n+2 +]) + +m4_define([GET_EXPAN], [ +echo "$@" | grep -- "available completions for keyword" \ + | sed -e 's/^[ ]*//g;s/[ ]*$//g' +]) + +m4_define([GET_AVAIL], [ +echo "$@" | sed -e '1,/Available/d' | tail -n+2 +]) + +m4_define([GET_COMP_STR], [ +echo "available completions for keyword \"$1\": $2" \ + | sed -e 's/[ ]*$//g' +]) + +AT_SETUP([appctl-bashcomp - basic verification]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +OVS_VSWITCHD_START + +# complete ovs-appctl [TAB] +# complete ovs-dpctl [TAB] +# complete ovs-ofctl [TAB] +# complete ovsdb-tool [TAB] +m4_foreach( +[test_command], +[[ovs-appctl], +[ovs-dpctl], +[ovs-ofctl], +[ovsdb-tool]], +[ +INPUT="$(bash ovs-appctl-bashcomp.bash debug test_command TAB 2>&1)" +MATCH="$(test_command --option | sort | sed -n '/^--.*/p' | cut -d '=' -f1) +$(test_command list-commands | tail -n +2 | cut -c3- | cut -d ' ' -f1 | sort)" +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +${MATCH} +])]) + + +# complete ovs-appctl --tar[TAB] +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl --tar 2>&1)" +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +--target +]) + + +# complete ovs-appctl --target [TAB] +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl --target TAB 2>&1)" +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +ovs-ofctl +ovs-vswitchd +ovsdb-server +]) + + +# complete ovs-appctl --target ovs-vswitchd [TAB] +# complete ovs-appctl --target ovsdb-server [TAB] +# complete ovs-appctl --target ovs-ofctl [TAB] +AT_CHECK([ovs-ofctl monitor br0 --detach --no-chdir --pidfile]) +m4_foreach( +[target_daemon], +[[ovs-vswitchd], +[ovsdb-server], +[ovs-ofctl]], +[ +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl --target target_daemon TAB 2>&1)" +MATCH="$(ovs-appctl --option | sort | sed -n '/^--.*/p' | cut -d '=' -f1) +$(ovs-appctl --target target_daemon list-commands | tail -n +2 | cut -c3- | cut -d ' ' -f1 | sort)" +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +${MATCH} +])]) +AT_CHECK([ovs-appctl --target ovs-ofctl exit]) +OVS_VSWITCHD_STOP +AT_CLEANUP + + +# complex completion check - bfd/set-forwarding +# bfd/set-forwarding [interface] normal|false|true +# test expansion of 'interface' +AT_SETUP([appctl-bashcomp - complex completion check 1]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +OVS_VSWITCHD_START(add-port br0 p0 -- set Interface p0 type=dummy) + +# check the top level completion. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl bfd/set-forwarding TAB 2>&1)" +MATCH="$(GET_COMP_STR([normal], []) +GET_COMP_STR([false], []) +GET_COMP_STR([true], []) +GET_COMP_STR([interface], [p0]))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +p0 +]) + + +# set argument to 'true', there should be no more completions. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl bfd/set-forwarding true TAB 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e '/./,$!d'], +[0], [dnl +]) + + +# set argument to 'p1', there should still be the completion for booleans. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl bfd/set-forwarding p1 TAB 2>&1)" +MATCH="$(GET_COMP_STR([normal], []) +GET_COMP_STR([false], []) +GET_COMP_STR([true], []))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], [0]) + + +# set argument to 'p1 false', there should still no more completions. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl bfd/set-forwarding p1 false TAB 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e '/./,$!d'], +[0], [dnl +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +# complex completion check - lacp/show +# lacp/show [port] +# test expansion on 'port' +AT_SETUP([appctl-bashcomp - complex completion check 2]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +OVS_VSWITCHD_START(add-port br0 p0 -- set Interface p0 type=dummy \ + -- add-port br0 p1 -- set Interface p1 type=dummy) + +# check the top level completion. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl lacp/show TAB 2>&1)" +MATCH="$(GET_COMP_STR([port], [br0 p0 p1]))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +br0 +p0 +p1 +]) + + +# set argument to 'p1', there should be no more completions. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl lacp/show p1 TAB 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e '/./,$!d'], +[0], [dnl +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +# complex completion check - ofproto/trace +# ofproto/trace {[dp_name] odp_flow | bridge br_flow} [-generate|packet] +# test expansion on 'dp|dp_name' and 'bridge' +AT_SETUP([appctl-bashcomp - complex completion check 3]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +OVS_VSWITCHD_START(add-port br0 p0 -- set Interface p0 type=dummy \ + -- add-port br0 p1 -- set Interface p1 type=dummy) + +# check the top level completion. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ofproto/trace TAB 2>&1)" +MATCH="$(GET_COMP_STR([bridge], [br0]) +GET_COMP_STR([odp_flow], []) +GET_COMP_STR([dp_name], [ovs-dummy]))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +br0 +ovs-dummy +]) + + +# set argument to 'ovs-dummy', should go to the dp-name path. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ofproto/trace ovs-dummy TAB 2>&1)" +MATCH="$(GET_COMP_STR([odp_flow], []))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], [0]) + + +# set odp_flow to some random string, should go to the next level. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ofproto/trace ovs-dummy "in_port(123),mac(),ip,tcp" TAB 2>&1)" +MATCH="$(GET_COMP_STR([-generate], [-generate]) +GET_COMP_STR([packet], []))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +-generate +]) + + +# set packet to some random string, there should be no more completions. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ofproto/trace ovs-dummy "in_port(123),mac(),ip,tcp" "ABSJDFLSDJFOIWEQR" TAB 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e '/./,$!d'], +[0], [dnl +]) + + +# set argument to 'br0', should go to the bridge path. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ofproto/trace br0 TAB 2>&1)" +MATCH="$(GET_COMP_STR([br_flow], []))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], [0]) + + +# set argument to some random string, should go to the odp_flow path. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ofproto/trace "in_port(123),mac(),ip,tcp" TAB 2>&1)" +MATCH="$(GET_COMP_STR([-generate], [-generate]) +GET_COMP_STR([packet], []))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +-generate +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +# complex completion check - vlog/set +# vlog/set {spec | PATTERN:destination:pattern} +# test non expandable arguments +AT_SETUP([appctl-bashcomp - complex completion check 4]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +OVS_VSWITCHD_START + +# check the top level completion. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl vlog/set TAB 2>&1)" +MATCH="$(GET_COMP_STR([PATTERN:destination:pattern], []) +GET_COMP_STR([spec], []))" +AT_CHECK_UNQUOTED([GET_EXPAN(${INPUT})], +[0], [dnl +${MATCH} +]) +# check the available completions. +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], [0]) + + +# set argument to random 'abcd', there should be no more completions. +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl vlog/set abcd TAB 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e '/./,$!d'], +[0], [dnl +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([appctl-bashcomp - negative test]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +OVS_VSWITCHD_START(add-port br0 p0 -- set Interface p0 type=dummy) + +# negative test - incorrect subcommand +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ERROR 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e 's/[ \t]*$//' | sed -e '/./,$!d'], [0]) +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl ERROR TAB 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e 's/[ \t]*$//' | sed -e '/./!d'], +[0], [dnl +]) + + +# negative test - no ovs-vswitchd +# negative test - no ovsdb-server +# negative test - no ovs-ofctl +# should not see any error. +OVS_VSWITCHD_STOP +m4_foreach( +[target_daemon], +[[ovs-vswitchd], +[ovsdb-server], +[ovs-ofctl]], +[ +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl --target target_daemon TAB 2>&1)" +MATCH="$(ovs-appctl --option | sort | sed -n '/^--.*/p' | cut -d '=' -f1)" +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], +[0], [dnl +${MATCH} +]) +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovs-appctl --target target_daemon ERROR SUBCMD TAB 2>&1)" +AT_CHECK_UNQUOTED([echo "$INPUT" | sed -e 's/[ \t]*$//' | sed -e '/./!d'], +[0], [dnl +])]) + + +# negative test - do not match on nested option +INPUT="$(bash ovs-appctl-bashcomp.bash debug ovsdb-tool create TAB 2>&1)" +AT_CHECK_UNQUOTED([GET_AVAIL(${INPUT})], [0]) + +AT_CLEANUP + + +dnl ---------------------------------------------------------------------- +AT_BANNER([vsctl bashcomp unit tests]) + +m4_define([PREPARE_MATCH_NOSPACE], [ +echo "$@" | tr ' ' '\n' | sed -e '/^$/d' | sort -u +]) + +m4_define([PREPARE_MATCH_SPACE], [ +echo "$@" | tr ' ' '\n' | sed -e '/^$/d' | sed -e 's/$/ /g' | sort -u +]) + +AT_SETUP([vsctl-bashcomp - basic verification]) +AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +OVS_VSWITCHD_START + +# complete ovs-vsctl --db=* [TAB] +TMP="$(ovs-vsctl --commands | cut -d',' -f1-2 | tr -d ',[[]]' | tr -s ' ' '\n') +$(ovs-vsctl --options | grep -- '--' | sed -e 's/=.*$/=/g')" +MATCH="$(PREPARE_MATCH_NOSPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "--db=unix:$OVS_RUNDIR/db.sock "], +[0], [dnl +${MATCH} +]) +# complete ovs-vsctl [TAB] +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test ""], +[0], [dnl +${MATCH} +]) + +# complete on global options. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "--dry-run "], +[0], [dnl +${MATCH} +]) +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "--dry-run --pretty "], +[0], [dnl +${MATCH} +]) + +# complete on local options. +TMP="$(ovs-vsctl --commands | grep -- '--may-exist' | cut -d',' -f1-2 | tr -d ',[[]]' | tr -s ' ' '\n' | grep -v -- '--may-exist')" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "--may-exist "], +[0], [dnl +${MATCH} +]) + +# +# test !, +, ?, *. +# +# test !. no following arguments are expanded. +TMP="$(ovsdb-client --no-heading list-tables)" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set "], +[0], [dnl +${MATCH} +]) +# test ?. will show completions for both current and following arguments. +ovs-vsctl br-set-external-id br0 bridge-id br0 +MATCH="$(PREPARE_MATCH_SPACE(bridge-id --))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-get-external-id br0 "], +[0], [dnl +${MATCH} +]) +# test *. argument with this prefix could be completed for zero or more times. +TMP="$(ovs-vsctl --no-heading --columns=_uuid,name list Bridge | tr -d '\"')" +MATCH="$(PREPARE_MATCH_SPACE(${TMP} --))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "destroy Bridge "], +[0], [dnl +${MATCH} +]) +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "destroy Bridge br0 "], +[0], [dnl +${MATCH} +]) +# test +. the first time, an argument is required, after that, it becomes '*'. +TMP="$(ovsdb-client --no-heading list-columns Open_vSwitch Bridge | awk '/key.*value/ { print $1":"; next } { print $1; next }')" +MATCH="$(PREPARE_MATCH_NOSPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 "], +[0], [dnl +${MATCH} +]) +MATCH="$(PREPARE_MATCH_NOSPACE(${TMP} --))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 other_config:random_key=123 "], +[0], [dnl +${MATCH} +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([vsctl-bashcomp - argument completion]) +AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +OVS_VSWITCHD_START( + [add-br br1 -- \ + set bridge br1 datapath-type=dummy -- \ + add-br foo -- \ + set bridge foo datapath-type=dummy -- \ + add-br --weird-br_name -- \ + set bridge --weird-br_name datapath-type=dummy -- \ + add-port br0 br0p0 -- set Interface br0p0 type=dummy -- \ + add-port br0 br0p1 -- set Interface br0p1 type=dummy -- \ + add-port br1 br1p0 -- set Interface br1p0 type=dummy -- \ + add-port br1 br1p1 -- set Interface br1p1 type=dummy -- \ + add-port foo bar -- set Interface bar type=dummy ]) +# +# test completion functions defined in '_OVS_VSCTL_ARG_COMPLETION_FUNCS'. +# therein, the different argument prefixes are also tested at the same time. +# +# A space is appended to each output if completion is configured without +# 'nospace' option. +# + + +# +# test: _ovs_vsctl_complete_table +# +TMP="$(ovsdb-client --no-heading list-tables)" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set "], +[0], [dnl +${MATCH} +]) +MATCH="$(PREPARE_MATCH_SPACE(Open_vSwitch))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Open"], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_record +# +TMP="$(ovs-vsctl --no-heading --columns=_uuid list Open_vSwitch | tr -d '\"')" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Open_vSwitch "], +[0], [dnl +${MATCH} +]) +TMP="$(ovs-vsctl --no-heading --columns=_uuid,name list Bridge | tr -d '\"')" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge "], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_bridge +# +TMP="$(ovs-vsctl list-br)" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-to-vlan "], +[0], [dnl +${MATCH} +]) +# this also helps check the '_ovs_vsctl_check_startswith_string'. +MATCH="$(PREPARE_MATCH_SPACE(--weird-br_name))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-to-vlan --"], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_port +# +TMP="$(ovs-vsctl --no-heading --columns=name list Port | tr -d '\"')" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "port-to-br "], +[0], [dnl +${MATCH} +]) +# complete on ports in particular bridge. +TMP="$(ovs-vsctl list-ports br0)" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "del-port br0 "], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_iface +# +for br in `ovs-vsctl list-br`; do + TMP="${TMP} $(ovs-vsctl list-ifaces $br)" +done +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "iface-to-br "], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_bridge_fail_mode +# +MATCH="$(PREPARE_MATCH_SPACE(standalone secure))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-fail-mode br0 "], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_key +# +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-set-external-id br0 "], +[0], [dnl + +]) +# since there is no key added yet, we will only get our own input. +MATCH="$(PREPARE_MATCH_SPACE(test_key))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-set-external-id br0 test_key"], +[0], [dnl +${MATCH} +]) +# now add a key, as we should see it. +ovs-vsctl br-set-external-id br0 bridge-id br0 +MATCH="$(PREPARE_MATCH_SPACE(bridge-id))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-set-external-id br0 "], +[0], [dnl +${MATCH} +]) +MATCH="$(PREPARE_MATCH_SPACE(bridge-id --))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-get-external-id br0 "], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_value +# +# should just return the user input. +MATCH="$(PREPARE_MATCH_SPACE(test_value --))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "br-set-external-id br0 bridge-id test_value"], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_column +# +TMP="$(ovsdb-client --no-heading list-columns Open_vSwitch Open_vSwitch | tr -d ':' | cut -d' ' -f1)" +UUID="$(ovs-vsctl --no-heading --columns=_uuid list Open_vSwitch | tr -d ' ')" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "clear Open_vSwitch $UUID "], +[0], [dnl +${MATCH} +]) +TMP="$(ovsdb-client --no-heading list-columns Open_vSwitch Bridge | tr -d ':' | cut -d' ' -f1)" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "clear Bridge br0 "], +[0], [dnl +${MATCH} +]) +# the 'clear' command requires one or more (+) COLUMN. +# so, with one specified COLUMN 'other_config', it should still complete on +# COLUMNs, plus '--'. +MATCH="$(PREPARE_MATCH_SPACE(${TMP} --))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "clear Bridge br0 other_config "], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_key_value +# +# with no key available, should always get user input. +MATCH="$(PREPARE_MATCH_NOSPACE(random_key))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add Bridge br0 other_config random_key"], +[0], [dnl +${MATCH} +]) +MATCH="$(PREPARE_MATCH_NOSPACE(abc))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add Bridge br0 other_config random_key=abc"], +[0], [dnl +${MATCH} +]) +# now add two random keys. +ovs-vsctl set Bridge br0 other_config:random_key1=abc other_config:random_val1=xyz +MATCH="$(PREPARE_MATCH_NOSPACE(random_key1= random_val1=))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add Bridge br0 other_config ran"], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_column_optkey_value +# +# at first, we should complete on column. +TMP="$(ovsdb-client --no-heading list-columns Open_vSwitch Bridge | awk '/key.*value/ { print $1":"; next } { print $1; next }')" +MATCH="$(PREPARE_MATCH_NOSPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 "], +[0], [dnl +${MATCH} +]) +MATCH="$(PREPARE_MATCH_NOSPACE(other_config:))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 other"], +[0], [dnl +${MATCH} +]) +# then, with the ':' we should complete on key. +TMP="$(ovs-vsctl --no-heading --columns=other_config list Bridge br0 | tr -d '{\"}' | tr -s ', ' '\n' | cut -d'=' -f1)" +MATCH="$(PREPARE_MATCH_NOSPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 other_config:"], +[0], [dnl +${MATCH} +]) +# finally, if user fill in some value, we should just complete on user input. +MATCH="$(PREPARE_MATCH_NOSPACE(random_val1))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 other_config:random_val1=12345"], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_filename +# +touch private_key certificate +MATCH="$(PREPARE_MATCH_SPACE(private_key))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-ssl priva"], +[0], [dnl +${MATCH} +]) +MATCH="$(PREPARE_MATCH_SPACE(certificate))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-ssl private_key cer"], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_target +# +MATCH="$(PREPARE_MATCH_NOSPACE(pssl: ptcp: punix: ssl: tcp: unix:))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager "], +[0], [dnl +${MATCH} +]) +# filename completion on unix, punix. +MATCH="$(PREPARE_MATCH_NOSPACE(testsuite.log))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager unix:test"], +[0], [dnl +${MATCH} +]) +# no completion on other type, just return available types. +# in real environment, bash will not complete on anything. +MATCH="$(PREPARE_MATCH_NOSPACE(pssl: ptcp: punix: tcp: unix:))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager ssl:something"], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_new +# +# test 'add-br' +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add-br "], +[0], [dnl +--- BEGIN MESSAGE +Enter a new bridge: +> ovs-vsctl add-br --- END MESSAGE +]) +# user input does not change the output. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add-br new-br"], +[0], [dnl +--- BEGIN MESSAGE +Enter a new bridge: +> ovs-vsctl add-br new-br--- END MESSAGE +]) +# after specifying the new bridge name, we should complete on parent bridge. +TMP="$(ovs-vsctl list-br)" +MATCH="$(PREPARE_MATCH_SPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add-br new-br "], +[0], [dnl +${MATCH} +]) +# test 'add-port' +# after specifying the new port name, we should complete on the column part +# of '*COLUMN?:KEY=VALUE'. +TMP="$(ovsdb-client --no-heading list-columns Open_vSwitch Port | awk '/key.*value/ { print $1":"; next } { print $1; next }')" +MATCH="$(PREPARE_MATCH_NOSPACE(${TMP} --))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add-port br0 new-port "], +[0], [dnl +${MATCH} +]) + + +# +# test: _ovs_vsctl_complete_dashdash +# +# after '--', there should be no global options available for completion. +TMP="$(ovs-vsctl --commands | cut -d',' -f1-2 | tr -d ',[[]]' | tr -s ' ' '\n')" +MATCH="$(PREPARE_MATCH_NOSPACE(${TMP}))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "init -- "], +[0], [dnl +${MATCH} +]) +TMP="$(ovs-vsctl --no-heading --columns=name,_uuid list Port | tr -d '\"')" +MATCH="$(PREPARE_MATCH_SPACE(${TMP} newp1 newp2))" +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add-port br0 newp1 -- add-port br1 newp2 -- set Port "], +[0], [dnl +${MATCH} +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([vsctl-bashcomp - negative test]) +AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +OVS_VSWITCHD_START + +# complete non-matching command. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "invalid"], +[0], [dnl + +]) + +# complete after invalid command. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "invalid argu"], +[0], [dnl + +]) + +# complete non-matching end argument. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set INVALID_"], +[0], [dnl + +]) + +# complete after invalid intermediate argument. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set INVALID_TBL "], +[1], [dnl +--- BEGIN MESSAGE +Cannot complete 'INVALID_TBL' at index 3: +> ovs-vsctl set INVALID_TBL --- END MESSAGE]) + +# complete ovs-vsctl --db=wrongdb [TAB] +# should return 1 and show nothing. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "--db=wrongdb"], +[1], []) + +OVS_VSWITCHD_STOP +# delete ovsdb-server and try again. +AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test ""], +[1], []) + +AT_CLEANUP \ No newline at end of file diff -Nru openvswitch-2.3.1/tests/daemon.at openvswitch-2.4.0~git20150623/tests/daemon.at --- openvswitch-2.3.1/tests/daemon.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/daemon.at 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,7 @@ AT_BANNER([daemon unit tests - C]) AT_SETUP([daemon]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) OVSDB_INIT([db]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([expected]) @@ -19,6 +20,7 @@ AT_CLEANUP AT_SETUP([daemon --monitor]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) OVSDB_INIT([db]) AT_CAPTURE_FILE([pid]) AT_CAPTURE_FILE([parent]) @@ -77,12 +79,20 @@ AT_CHECK([kill -0 `cat pid`]) # Kill the daemon and make sure that the pidfile gets deleted. cp pid saved-pid -kill `cat pid` +if test "$IS_WIN32" = "yes"; then + # When a 'kill pid' is done on windows (through 'taskkill //F'), + # pidfiles are not deleted (because it is force kill), so use + # 'ovs-appctl exit' instead + ovs-appctl -t `pwd`/unixctl exit +else + kill `cat pid` +fi OVS_WAIT_WHILE([kill -0 `cat saved-pid`]) AT_CHECK([test ! -e pid]) AT_CLEANUP AT_SETUP([daemon --detach --monitor]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) m4_define([CHECK], [AT_CHECK([$1], [$2], [$3], [$4], [kill `cat daemon monitor`])]) OVSDB_INIT([db]) @@ -141,6 +151,7 @@ AT_CLEANUP AT_SETUP([daemon --detach --monitor startup errors]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_CAPTURE_FILE([pid]) OVSDB_INIT([db]) AT_CHECK([ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --monitor --unixctl="`pwd`"/nonexistent/unixctl db], [1], [], [stderr]) @@ -148,3 +159,29 @@ [0], [ignore], []) AT_CHECK([test ! -s pid]) AT_CLEANUP + +AT_SETUP([daemon --service]) +AT_KEYWORDS([windows-service]) +AT_SKIP_IF([test "$IS_WIN32" != "yes"]) +OVSDB_INIT([db]) +AT_CAPTURE_FILE([pid]) +# To create a Windows service, we need the absolute path for the executable. +abs_path="$(cd $(dirname `which ovsdb-server`); pwd -W; cd $OLDPWD)" + +AT_CHECK([sc create ovsdb-server binpath="$abs_path/ovsdb-server `pwd`/db --log-file=`pwd`/ovsdb-server.log --pidfile=`pwd`/pid --remote=punix:`pwd`/socket --unixctl=`pwd`/unixctl --service"], +[0], [[[SC]] CreateService SUCCESS +]) + +AT_CHECK([sc start ovsdb-server], [0], [ignore]) +OVS_WAIT_UNTIL([test -s pid]) +OVS_WAIT_UNTIL([sc query ovsdb-server | grep STATE | grep RUNNING > /dev/null 2>&1]) +AT_CHECK([kill -0 `cat pid`], [0], [ignore]) +AT_CHECK([ovs-appctl -t `pwd`/unixctl ovsdb-server/list-dbs], [0], +[Open_vSwitch +]) +AT_CHECK([sc stop ovsdb-server], [0], [ignore]) +OVS_WAIT_UNTIL([test ! -s pid]) +AT_CHECK([sc query ovsdb-server | grep STATE | grep STOPPED], [0], [ignore]) +AT_CHECK([sc delete ovsdb-server], [0], [[[SC]] DeleteService SUCCESS +]) +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/dpctl.at openvswitch-2.4.0~git20150623/tests/dpctl.at --- openvswitch-2.3.1/tests/dpctl.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/dpctl.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,85 @@ +AT_BANNER([dpctl]) + +AT_SETUP([dpctl - add-dp del-dp]) +OVS_VSWITCHD_START +AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0]) +AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0], [2], [], + [ovs-vswitchd: add_dp (File exists) +ovs-appctl: ovs-vswitchd: server returned an error +]) +AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0]) +AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0], [2], [], [stderr]) +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], [dnl +ovs-vswitchd: opening datapath (...) +ovs-appctl: ovs-vswitchd: server returned an error +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([dpctl - add-if set-if del-if]) +OVS_VSWITCHD_START([], [], [=override]) +AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0]) +AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl +dummy@br0: + lookups: hit:0 missed:0 lost:0 + flows: 0 + port 0: br0 (internal) +]) +AT_CHECK([ovs-appctl dpctl/add-if dummy@br0 vif1.0,type=dummy,port_no=5]) +AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl +dummy@br0: + lookups: hit:0 missed:0 lost:0 + flows: 0 + port 0: br0 (internal) + port 5: vif1.0 (dummy) +]) +AT_CHECK([ovs-appctl dpctl/add-if dummy@br0 vif1.0,type=dummy], [2], [], + [stderr]) +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], + [ovs-vswitchd: adding vif1.0 to dummy@br0 failed (...) +ovs-appctl: ovs-vswitchd: server returned an error +]) +AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 vif1.0,port_no=5]) +AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 vif1.0,type=system], [2], [], + [ovs-vswitchd: vif1.0: can't change type from dummy to system +ovs-appctl: ovs-vswitchd: server returned an error +]) +AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 br0,type=dummy], [2], [], + [ovs-vswitchd: br0: can't change type from internal to dummy +ovs-appctl: ovs-vswitchd: server returned an error +]) +AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 vif1.0]) +AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl +dummy@br0: + lookups: hit:0 missed:0 lost:0 + flows: 0 + port 0: br0 (internal) +]) +AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 vif1.0], [2], [], + [ovs-vswitchd: no port named vif1.0 +ovs-appctl: ovs-vswitchd: server returned an error +]) +AT_CHECK([ovs-appctl dpctl/show dummy@br0], [0], [dnl +dummy@br0: + lookups: hit:0 missed:0 lost:0 + flows: 0 + port 0: br0 (internal) +]) +AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 nonexistent], [2], [], + [ovs-vswitchd: no port named nonexistent +ovs-appctl: ovs-vswitchd: server returned an error +]) +AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], [stderr]) +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], + [ovs-vswitchd: deleting port br0 from dummy@br0 failed (...) +ovs-appctl: ovs-vswitchd: server returned an error +]) +AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0]) +AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], [stderr]) +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], + [ovs-vswitchd: opening datapath (...) +ovs-appctl: ovs-vswitchd: server returned an error +]) +OVS_VSWITCHD_STOP(["/dummy@br0: port_del failed/d +/dummy@br0: failed to add vif1.0 as port/d"]) +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/dpdk/ring_client.c openvswitch-2.4.0~git20150623/tests/dpdk/ring_client.c --- openvswitch-2.3.1/tests/dpdk/ring_client.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/dpdk/ring_client.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,215 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +/* Number of packets to attempt to read from queue. */ +#define PKT_READ_SIZE ((uint16_t)32) + +/* Define common names for structures shared between ovs_dpdk and client. */ +#define MP_CLIENT_RXQ_NAME "dpdkr%u_tx" +#define MP_CLIENT_TXQ_NAME "dpdkr%u_rx" + +#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1 + +#define BASE_10 10 + +/* Our client id number - tells us which rx queue to read, and tx + * queue to write to. + */ +static uint8_t client_id = 0; + +/* + * Given the rx queue name template above, get the queue name. + */ +static inline const char * +get_rx_queue_name(unsigned id) +{ + /* Buffer for return value. Size calculated by %u being replaced + * by maximum 3 digits (plus an extra byte for safety). + */ + static char buffer[sizeof(MP_CLIENT_RXQ_NAME) + 2]; + + snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_RXQ_NAME, id); + return buffer; +} + +/* + * Given the tx queue name template above, get the queue name. + */ +static inline const char * +get_tx_queue_name(unsigned id) +{ + /* Buffer for return value. Size calculated by %u being replaced + * by maximum 3 digits (plus an extra byte for safety). + */ + static char buffer[sizeof(MP_CLIENT_TXQ_NAME) + 2]; + + snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_TXQ_NAME, id); + return buffer; +} + +/* + * Print a usage message. + */ +static void +usage(const char *progname) +{ + printf("\nUsage: %s [EAL args] -- -n \n", progname); +} + +/* + * Convert the client id number from a string to an int. + */ +static int +parse_client_num(const char *client) +{ + char *end = NULL; + unsigned long temp = 0; + + if (client == NULL || *client == '\0') { + return -1; + } + + temp = strtoul(client, &end, BASE_10); + /* If valid string argument is provided, terminating '/0' character + * is stored in 'end'. */ + if (end == NULL || *end != '\0') { + return -1; + } + + client_id = (uint8_t)temp; + return 0; +} + +/* + * Parse the application arguments to the client app. + */ +static int +parse_app_args(int argc, char *argv[]) +{ + int option_index = 0, opt = 0; + char **argvopt = argv; + const char *progname = NULL; + static struct option lgopts[] = { + {NULL, 0, NULL, 0 } + }; + progname = argv[0]; + + while ((opt = getopt_long(argc, argvopt, "n:", lgopts, + &option_index)) != EOF) { + switch (opt) { + case 'n': + if (parse_client_num(optarg) != 0) { + usage(progname); + return -1; + } + break; + default: + usage(progname); + return -1; + } + } + + return 0; +} + +/* + * Application main function - loops through + * receiving and processing packets. Never returns + */ +int +main(int argc, char *argv[]) +{ + struct rte_ring *rx_ring = NULL; + struct rte_ring *tx_ring = NULL; + int retval = 0; + void *pkts[PKT_READ_SIZE]; + int rslt = 0; + + if ((retval = rte_eal_init(argc, argv)) < 0) { + return -1; + } + + argc -= retval; + argv += retval; + + if (parse_app_args(argc, argv) < 0) { + rte_exit(EXIT_FAILURE, "Invalid command-line arguments\n"); + } + + rx_ring = rte_ring_lookup(get_rx_queue_name(client_id)); + if (rx_ring == NULL) { + rte_exit(EXIT_FAILURE, + "Cannot get RX ring - is server process running?\n"); + } + + tx_ring = rte_ring_lookup(get_tx_queue_name(client_id)); + if (tx_ring == NULL) { + rte_exit(EXIT_FAILURE, + "Cannot get TX ring - is server process running?\n"); + } + + RTE_LOG(INFO, APP, "Finished Process Init.\n"); + + printf("\nClient process %d handling packets\n", client_id); + printf("[Press Ctrl-C to quit ...]\n"); + + for (;;) { + unsigned rx_pkts = PKT_READ_SIZE; + + /* Try dequeuing max possible packets first, if that fails, get the + * most we can. Loop body should only execute once, maximum. + */ + while (unlikely(rte_ring_dequeue_bulk(rx_ring, pkts, rx_pkts) != 0) && + rx_pkts > 0) { + rx_pkts = (uint16_t)RTE_MIN(rte_ring_count(rx_ring), PKT_READ_SIZE); + } + + if (rx_pkts > 0) { + /* blocking enqueue */ + do { + rslt = rte_ring_enqueue_bulk(tx_ring, pkts, rx_pkts); + } while (rslt == -ENOBUFS); + } + } +} diff -Nru openvswitch-2.3.1/tests/dpif-netdev.at openvswitch-2.4.0~git20150623/tests/dpif-netdev.at --- openvswitch-2.3.1/tests/dpif-netdev.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/dpif-netdev.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,129 @@ +AT_BANNER([dpif-netdev]) + +# Strips out uninteresting parts of flow output, as well as parts +# that vary from one run to another (e.g., timing and bond actions). +m4_define([STRIP_XOUT], [[sed ' + s/ufid:[-0-9a-f]* // + s/used:[0-9]*\.[0-9]*/used:0.0/ + s/actions:.*/actions: / + s/packets:[0-9]*/packets:0/ + s/bytes:[0-9]*/bytes:0/ +' | sort]]) +m4_define([FILTER_FLOW_INSTALL], [[ +grep 'flow_add' | sed ' + s/.*flow_add: // +' | sort | uniq]]) +m4_define([FILTER_FLOW_DUMP], [[ +grep 'flow_dump ' | sed ' + s/.*flow_dump // + s/used:[0-9]*\.[0-9]*/used:0.0/ +' | sort | uniq]]) +m4_define([STRIP_METADATA], [[sed 's/metadata=0x[0-9a-f]*/metadata=0x0/']]) + +AT_SETUP([dpif-netdev - dummy interface]) +# Create br0 with interfaces p1 and p7 +# and br1 with interfaces p2 and p8 +# with p1 and p2 connected via unix domain socket +OVS_VSWITCHD_START( + [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \ + add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \ + add-br br1 -- \ + set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ + set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ + fail-mode=secure -- \ + add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \ + add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +AT_CHECK([ovs-ofctl add-flow br0 action=normal]) +AT_CHECK([ovs-ofctl add-flow br1 action=normal]) +ovs-appctl time/stop +ovs-appctl time/warp 5000 +AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +ovs-appctl time/warp 100 +sleep 1 # wait for forwarders process packets + +AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: +recirc_id=0,ip,in_port=2,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +recirc_id=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +recirc_id=0,ip,in_port=8,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([dpif-netdev - miss upcall key matches flow_install]) +OVS_VSWITCHD_START( + [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock + set bridge br0 datapath-type=dummy other-config:datapath-id=1234 \ + fail-mode=secure]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +AT_CHECK([ovs-ofctl add-flow br0 action=normal]) +AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +sleep 1 + +AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl +skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0) +]) +AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +]) + +# Now, the same again without megaflows. +AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled +]) +AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +sleep 1 + +AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl +skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0) +]) +AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl +pkt_mark=0,recirc_id=0,dp_hash=0,skb_priority=0,icmp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0, actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([dpif-netdev - miss upcall key matches flow_dump]) +OVS_VSWITCHD_START( + [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock + set bridge br0 datapath-type=dummy other-config:datapath-id=1234 \ + fail-mode=secure]) +AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled +], []) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +AT_CHECK([ovs-ofctl add-flow br0 action=normal]) +AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +sleep 1 + +AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl +skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0) +]) +AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | STRIP_XOUT], [0], [dnl +skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: +]) + +# Now, the same again without megaflows. +AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled +]) +AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled +], []) +AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +sleep 1 + +AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl +skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0) +]) +AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | STRIP_XOUT], [0], [dnl +skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:0, bytes:0, used:never, actions: +skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/file_name.at openvswitch-2.4.0~git20150623/tests/file_name.at --- openvswitch-2.3.1/tests/file_name.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/file_name.at 2015-06-23 18:46:21.000000000 +0000 @@ -2,8 +2,9 @@ m4_define([CHECK_FILE_NAME], [AT_SETUP([components of "$1" are "$2", "$3"]) + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_KEYWORDS([dir_name base_name]) - AT_CHECK([ovstest test-file_name "AS_ESCAPE($1)"], [0], [$2 + AT_CHECK([ovstest test-util file_name "AS_ESCAPE($1)"], [0], [$2 $3 ]) AT_CLEANUP]) @@ -103,6 +104,7 @@ AT_CLEANUP AT_SETUP([follow_symlinks - nonexistent files]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) CHECK_FOLLOW([nonexistent], [nonexistent]) CHECK_FOLLOW([a/b/c], [a/b/c]) CHECK_FOLLOW([/a/b/c], [/a/b/c]) diff -Nru openvswitch-2.3.1/tests/.gitignore openvswitch-2.4.0~git20150623/tests/.gitignore --- openvswitch-2.3.1/tests/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,51 @@ +*.pem +/Makefile +/Makefile.in +/atconfig +/atlocal +/idltest.c +/idltest.h +/idltest.ovsidl +/kmod-testsuite +/ovstest +/test-dpdkr +/ovs-pki.log +/pki/ +/test-aes128 +/test-atomic +/test-bundle +/test-byte-order +/test-classifier +/test-csum +/test-flows +/test-hash +/test-heap +/test-hindex +/test-hmap +/test-json +/test-jsonrpc +/test-list +/test-lockfile +/test-multipath +/test-netflow +/test-odp +/test-ovsdb +/test-packets +/test-random +/test-reconnect +/test-rstp +/test-sflow +/test-sha1 +/test-stp +/test-strtok_r +/test-timeval +/test-type-props +/test-unix-socket +/test-util +/test-uuid +/test-vconn +/testsuite +/testsuite.dir/ +/testsuite.log +/test-lib +/testsuite.tmp.orig diff -Nru openvswitch-2.3.1/tests/idltest2.ovsschema openvswitch-2.4.0~git20150623/tests/idltest2.ovsschema --- openvswitch-2.3.1/tests/idltest2.ovsschema 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/idltest2.ovsschema 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,85 @@ +{ + "name": "idltest", + "version": "1.2.3", + "tables": { + "link1": { + "columns": { + "i": { + "type": "integer" + }, + "k": { + "type": { + "key": { + "type": "uuid", + "refTable": "link1" + } + } + }, + "ka": { + "type": { + "key": { + "type": "uuid", + "refTable": "link1" + }, + "max": "unlimited", + "min": 0 + } + } + } + }, + "simple": { + "columns": { + "b": { + "type": "boolean" + }, + "ba": { + "type": { + "key": "boolean", + "max": 1, + "min": 0 + } + }, + "i": { + "type": "integer" + }, + "ia": { + "type": { + "key": "integer", + "max": "unlimited", + "min": 0 + } + }, + "r": { + "type": "real" + }, + "ra": { + "type": { + "key": "real", + "max": "unlimited", + "min": 0 + } + }, + "s": { + "type": "string" + }, + "sa": { + "type": { + "key": "string", + "max": "unlimited", + "min": 0 + } + }, + "u": { + "type": "uuid" + }, + "ua": { + "type": { + "key": "uuid", + "max": "unlimited", + "min": 0 + } + } + } + } + } +} diff -Nru openvswitch-2.3.1/tests/idltest.c openvswitch-2.4.0~git20150623/tests/idltest.c --- openvswitch-2.3.1/tests/idltest.c 2014-10-12 23:47:59.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/idltest.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1510 +0,0 @@ -/* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - -#include -#include "tests/idltest.h" -#include -#include "ovs-thread.h" -#include "ovsdb-data.h" -#include "ovsdb-error.h" -#include "util.h" - -#ifdef __CHECKER__ -/* Sparse dislikes sizeof(bool) ("warning: expression using sizeof bool"). */ -enum { sizeof_bool = 1 }; -#else -enum { sizeof_bool = sizeof(bool) }; -#endif - -static bool inited; - - -static struct idltest_link1 * -idltest_link1_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct idltest_link1, header_) : NULL; -} - -static struct idltest_link2 * -idltest_link2_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct idltest_link2, header_) : NULL; -} - -static struct idltest_simple * -idltest_simple_cast(const struct ovsdb_idl_row *row) -{ - return row ? CONTAINER_OF(row, struct idltest_simple, header_) : NULL; -} - -/* link1 table. */ - -static void -idltest_link1_parse_i(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_link1 *row = idltest_link1_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->i = datum->keys[0].integer; - } else { - row->i = 0; - } -} - -static void -idltest_link1_parse_k(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_link1 *row = idltest_link1_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->k = idltest_link1_cast(ovsdb_idl_get_row_arc(row_, &idltest_table_classes[IDLTEST_TABLE_LINK1], &datum->keys[0].uuid)); - } else { - row->k = NULL; - } -} - -static void -idltest_link1_parse_ka(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_link1 *row = idltest_link1_cast(row_); - size_t i; - - ovs_assert(inited); - row->ka = NULL; - row->n_ka = 0; - for (i = 0; i < datum->n; i++) { - struct idltest_link1 *keyRow = idltest_link1_cast(ovsdb_idl_get_row_arc(row_, &idltest_table_classes[IDLTEST_TABLE_LINK1], &datum->keys[i].uuid)); - if (keyRow) { - if (!row->n_ka) { - row->ka = xmalloc(datum->n * sizeof *row->ka); - } - row->ka[row->n_ka] = keyRow; - row->n_ka++; - } - } -} - -static void -idltest_link1_parse_l2(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_link1 *row = idltest_link1_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->l2 = idltest_link2_cast(ovsdb_idl_get_row_arc(row_, &idltest_table_classes[IDLTEST_TABLE_LINK2], &datum->keys[0].uuid)); - } else { - row->l2 = NULL; - } -} - -static void -idltest_link1_unparse_i(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_link1_unparse_k(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_link1_unparse_ka(struct ovsdb_idl_row *row_) -{ - struct idltest_link1 *row = idltest_link1_cast(row_); - - ovs_assert(inited); - free(row->ka); -} - -static void -idltest_link1_unparse_l2(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_link1_init__(struct ovsdb_idl_row *row) -{ - idltest_link1_init(idltest_link1_cast(row)); -} - -void -idltest_link1_init(struct idltest_link1 *row) -{ - memset(row, 0, sizeof *row); -} - -const struct idltest_link1 * -idltest_link1_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return idltest_link1_cast(ovsdb_idl_get_row_for_uuid(idl, &idltest_table_classes[IDLTEST_TABLE_LINK1], uuid)); -} - -const struct idltest_link1 * -idltest_link1_first(const struct ovsdb_idl *idl) -{ - return idltest_link1_cast(ovsdb_idl_first_row(idl, &idltest_table_classes[IDLTEST_TABLE_LINK1])); -} - -const struct idltest_link1 * -idltest_link1_next(const struct idltest_link1 *row) -{ - return idltest_link1_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -idltest_link1_delete(const struct idltest_link1 *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct idltest_link1 * -idltest_link1_insert(struct ovsdb_idl_txn *txn) -{ - return idltest_link1_cast(ovsdb_idl_txn_insert(txn, &idltest_table_classes[IDLTEST_TABLE_LINK1], NULL)); -} - - -void -idltest_link1_verify_i(const struct idltest_link1 *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_I]); -} - -void -idltest_link1_verify_k(const struct idltest_link1 *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_K]); -} - -void -idltest_link1_verify_ka(const struct idltest_link1 *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_KA]); -} - -void -idltest_link1_verify_l2(const struct idltest_link1 *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_L2]); -} - -/* Returns the i column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes i's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_link1_get_i(const struct idltest_link1 *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &idltest_link1_col_i); -} - -/* Returns the k column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes k's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_link1_get_k(const struct idltest_link1 *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &idltest_link1_col_k); -} - -/* Returns the ka column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes ka's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_link1_get_ka(const struct idltest_link1 *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &idltest_link1_col_ka); -} - -/* Returns the l2 column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes l2's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_link1_get_l2(const struct idltest_link1 *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &idltest_link1_col_l2); -} - -void -idltest_link1_set_i(const struct idltest_link1 *row, int64_t i) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = i; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_I], &datum); -} - -void -idltest_link1_set_k(const struct idltest_link1 *row, const struct idltest_link1 *k) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = k->header_.uuid; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_K], &datum); -} - -void -idltest_link1_set_ka(const struct idltest_link1 *row, struct idltest_link1 **ka, size_t n_ka) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_ka; - datum.keys = n_ka ? xmalloc(n_ka * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_ka; i++) { - datum.keys[i].uuid = ka[i]->header_.uuid; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_KA], &datum); -} - -void -idltest_link1_set_l2(const struct idltest_link1 *row, const struct idltest_link2 *l2) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (l2) { - datum.n = 1; - datum.keys = &key; - key.uuid = l2->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_link1_columns[IDLTEST_LINK1_COL_L2], &datum); -} - -struct ovsdb_idl_column idltest_link1_columns[IDLTEST_LINK1_N_COLUMNS]; - -static void -idltest_link1_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize idltest_link1_col_i. */ - c = &idltest_link1_col_i; - c->name = "i"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_link1_parse_i; - c->unparse = idltest_link1_unparse_i; - - /* Initialize idltest_link1_col_k. */ - c = &idltest_link1_col_k; - c->name = "k"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "link1"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_link1_parse_k; - c->unparse = idltest_link1_unparse_k; - - /* Initialize idltest_link1_col_ka. */ - c = &idltest_link1_col_ka; - c->name = "ka"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "link1"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = idltest_link1_parse_ka; - c->unparse = idltest_link1_unparse_ka; - - /* Initialize idltest_link1_col_l2. */ - c = &idltest_link1_col_l2; - c->name = "l2"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "link2"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_link1_parse_l2; - c->unparse = idltest_link1_unparse_l2; -} - -/* link2 table. */ - -static void -idltest_link2_parse_i(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_link2 *row = idltest_link2_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->i = datum->keys[0].integer; - } else { - row->i = 0; - } -} - -static void -idltest_link2_parse_l1(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_link2 *row = idltest_link2_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->l1 = idltest_link1_cast(ovsdb_idl_get_row_arc(row_, &idltest_table_classes[IDLTEST_TABLE_LINK1], &datum->keys[0].uuid)); - } else { - row->l1 = NULL; - } -} - -static void -idltest_link2_unparse_i(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_link2_unparse_l1(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_link2_init__(struct ovsdb_idl_row *row) -{ - idltest_link2_init(idltest_link2_cast(row)); -} - -void -idltest_link2_init(struct idltest_link2 *row) -{ - memset(row, 0, sizeof *row); -} - -const struct idltest_link2 * -idltest_link2_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return idltest_link2_cast(ovsdb_idl_get_row_for_uuid(idl, &idltest_table_classes[IDLTEST_TABLE_LINK2], uuid)); -} - -const struct idltest_link2 * -idltest_link2_first(const struct ovsdb_idl *idl) -{ - return idltest_link2_cast(ovsdb_idl_first_row(idl, &idltest_table_classes[IDLTEST_TABLE_LINK2])); -} - -const struct idltest_link2 * -idltest_link2_next(const struct idltest_link2 *row) -{ - return idltest_link2_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -idltest_link2_delete(const struct idltest_link2 *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct idltest_link2 * -idltest_link2_insert(struct ovsdb_idl_txn *txn) -{ - return idltest_link2_cast(ovsdb_idl_txn_insert(txn, &idltest_table_classes[IDLTEST_TABLE_LINK2], NULL)); -} - - -void -idltest_link2_verify_i(const struct idltest_link2 *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_link2_columns[IDLTEST_LINK2_COL_I]); -} - -void -idltest_link2_verify_l1(const struct idltest_link2 *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_link2_columns[IDLTEST_LINK2_COL_L1]); -} - -/* Returns the i column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes i's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_link2_get_i(const struct idltest_link2 *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &idltest_link2_col_i); -} - -/* Returns the l1 column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes l1's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_link2_get_l1(const struct idltest_link2 *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &idltest_link2_col_l1); -} - -void -idltest_link2_set_i(const struct idltest_link2 *row, int64_t i) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = i; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_link2_columns[IDLTEST_LINK2_COL_I], &datum); -} - -void -idltest_link2_set_l1(const struct idltest_link2 *row, const struct idltest_link1 *l1) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (l1) { - datum.n = 1; - datum.keys = &key; - key.uuid = l1->header_.uuid; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_link2_columns[IDLTEST_LINK2_COL_L1], &datum); -} - -struct ovsdb_idl_column idltest_link2_columns[IDLTEST_LINK2_N_COLUMNS]; - -static void -idltest_link2_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize idltest_link2_col_i. */ - c = &idltest_link2_col_i; - c->name = "i"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_link2_parse_i; - c->unparse = idltest_link2_unparse_i; - - /* Initialize idltest_link2_col_l1. */ - c = &idltest_link2_col_l1; - c->name = "l1"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - c->type.key.u.uuid.refTableName = "link1"; - c->type.key.u.uuid.refType = OVSDB_REF_STRONG; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_link2_parse_l1; - c->unparse = idltest_link2_unparse_l1; -} - -/* simple table. */ - -static void -idltest_simple_parse_b(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->b = datum->keys[0].boolean; - } else { - row->b = false; - } -} - -static void -idltest_simple_parse_ba(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - size_t n = MIN(1, datum->n); - size_t i; - - ovs_assert(inited); - row->ba = NULL; - row->n_ba = 0; - for (i = 0; i < n; i++) { - if (!row->n_ba) { - row->ba = xmalloc(n * sizeof_bool); - } - row->ba[row->n_ba] = datum->keys[i].boolean; - row->n_ba++; - } -} - -static void -idltest_simple_parse_i(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->i = datum->keys[0].integer; - } else { - row->i = 0; - } -} - -static void -idltest_simple_parse_ia(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - size_t i; - - ovs_assert(inited); - row->ia = NULL; - row->n_ia = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_ia) { - row->ia = xmalloc(datum->n * sizeof *row->ia); - } - row->ia[row->n_ia] = datum->keys[i].integer; - row->n_ia++; - } -} - -static void -idltest_simple_parse_r(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->r = datum->keys[0].real; - } else { - row->r = 0.0; - } -} - -static void -idltest_simple_parse_ra(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - size_t i; - - ovs_assert(inited); - row->ra = NULL; - row->n_ra = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_ra) { - row->ra = xmalloc(datum->n * sizeof *row->ra); - } - row->ra[row->n_ra] = datum->keys[i].real; - row->n_ra++; - } -} - -static void -idltest_simple_parse_s(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->s = datum->keys[0].string; - } else { - row->s = ""; - } -} - -static void -idltest_simple_parse_sa(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - size_t i; - - ovs_assert(inited); - row->sa = NULL; - row->n_sa = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_sa) { - row->sa = xmalloc(datum->n * sizeof *row->sa); - } - row->sa[row->n_sa] = datum->keys[i].string; - row->n_sa++; - } -} - -static void -idltest_simple_parse_u(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - if (datum->n >= 1) { - row->u = datum->keys[0].uuid; - } else { - uuid_zero(&row->u); - } -} - -static void -idltest_simple_parse_ua(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - size_t i; - - ovs_assert(inited); - row->ua = NULL; - row->n_ua = 0; - for (i = 0; i < datum->n; i++) { - if (!row->n_ua) { - row->ua = xmalloc(datum->n * sizeof *row->ua); - } - row->ua[row->n_ua] = datum->keys[i].uuid; - row->n_ua++; - } -} - -static void -idltest_simple_unparse_b(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_simple_unparse_ba(struct ovsdb_idl_row *row_) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - free(row->ba); -} - -static void -idltest_simple_unparse_i(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_simple_unparse_ia(struct ovsdb_idl_row *row_) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - free(row->ia); -} - -static void -idltest_simple_unparse_r(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_simple_unparse_ra(struct ovsdb_idl_row *row_) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - free(row->ra); -} - -static void -idltest_simple_unparse_s(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_simple_unparse_sa(struct ovsdb_idl_row *row_) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - free(row->sa); -} - -static void -idltest_simple_unparse_u(struct ovsdb_idl_row *row OVS_UNUSED) -{ - /* Nothing to do. */ -} - -static void -idltest_simple_unparse_ua(struct ovsdb_idl_row *row_) -{ - struct idltest_simple *row = idltest_simple_cast(row_); - - ovs_assert(inited); - free(row->ua); -} - -static void -idltest_simple_init__(struct ovsdb_idl_row *row) -{ - idltest_simple_init(idltest_simple_cast(row)); -} - -void -idltest_simple_init(struct idltest_simple *row) -{ - memset(row, 0, sizeof *row); -} - -const struct idltest_simple * -idltest_simple_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid) -{ - return idltest_simple_cast(ovsdb_idl_get_row_for_uuid(idl, &idltest_table_classes[IDLTEST_TABLE_SIMPLE], uuid)); -} - -const struct idltest_simple * -idltest_simple_first(const struct ovsdb_idl *idl) -{ - return idltest_simple_cast(ovsdb_idl_first_row(idl, &idltest_table_classes[IDLTEST_TABLE_SIMPLE])); -} - -const struct idltest_simple * -idltest_simple_next(const struct idltest_simple *row) -{ - return idltest_simple_cast(ovsdb_idl_next_row(&row->header_)); -} - -void -idltest_simple_delete(const struct idltest_simple *row) -{ - ovsdb_idl_txn_delete(&row->header_); -} - -struct idltest_simple * -idltest_simple_insert(struct ovsdb_idl_txn *txn) -{ - return idltest_simple_cast(ovsdb_idl_txn_insert(txn, &idltest_table_classes[IDLTEST_TABLE_SIMPLE], NULL)); -} - - -void -idltest_simple_verify_b(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_B]); -} - -void -idltest_simple_verify_ba(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_BA]); -} - -void -idltest_simple_verify_i(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_I]); -} - -void -idltest_simple_verify_ia(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_IA]); -} - -void -idltest_simple_verify_r(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_R]); -} - -void -idltest_simple_verify_ra(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_RA]); -} - -void -idltest_simple_verify_s(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_S]); -} - -void -idltest_simple_verify_sa(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_SA]); -} - -void -idltest_simple_verify_u(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_U]); -} - -void -idltest_simple_verify_ua(const struct idltest_simple *row) -{ - ovs_assert(inited); - ovsdb_idl_txn_verify(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_UA]); -} - -/* Returns the b column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes b's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_b(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_b); -} - -/* Returns the ba column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_BOOLEAN. - * (This helps to avoid silent bugs if someone changes ba's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_ba(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_BOOLEAN); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_ba); -} - -/* Returns the i column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes i's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_i(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_i); -} - -/* Returns the ia column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_INTEGER. - * (This helps to avoid silent bugs if someone changes ia's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_ia(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_INTEGER); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_ia); -} - -/* Returns the r column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_REAL. - * (This helps to avoid silent bugs if someone changes r's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_r(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_REAL); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_r); -} - -/* Returns the ra column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_REAL. - * (This helps to avoid silent bugs if someone changes ra's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_ra(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_REAL); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_ra); -} - -/* Returns the s column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes s's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_s(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_s); -} - -/* Returns the sa column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_STRING. - * (This helps to avoid silent bugs if someone changes sa's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_sa(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_STRING); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_sa); -} - -/* Returns the u column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes u's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_u(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_u); -} - -/* Returns the ua column's value in 'row' as a struct ovsdb_datum. - * This is useful occasionally: for example, ovsdb_datum_find_key() is an - * easier and more efficient way to search for a given key than implementing - * the same operation on the "cooked" form in 'row'. - * - * 'key_type' must be OVSDB_TYPE_UUID. - * (This helps to avoid silent bugs if someone changes ua's - * type without updating the caller.) - * - * The caller must not modify or free the returned value. - * - * Various kinds of changes can invalidate the returned value: modifying - * 'column' within 'row', deleting 'row', or completing an ongoing transaction. - * If the returned value is needed for a long time, it is best to make a copy - * of it with ovsdb_datum_clone(). */ -const struct ovsdb_datum * -idltest_simple_get_ua(const struct idltest_simple *row, - enum ovsdb_atomic_type key_type OVS_UNUSED) -{ - ovs_assert(key_type == OVSDB_TYPE_UUID); - return ovsdb_idl_read(&row->header_, &idltest_simple_col_ua); -} - -void -idltest_simple_set_b(const struct idltest_simple *row, bool b) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.boolean = b; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_B], &datum); -} - -void -idltest_simple_set_ba(const struct idltest_simple *row, const bool *ba, size_t n_ba) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - if (n_ba) { - datum.n = 1; - datum.keys = &key; - key.boolean = *ba; - } else { - datum.n = 0; - datum.keys = NULL; - } - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_BA], &datum); -} - -void -idltest_simple_set_i(const struct idltest_simple *row, int64_t i) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.integer = i; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_I], &datum); -} - -void -idltest_simple_set_ia(const struct idltest_simple *row, const int64_t *ia, size_t n_ia) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_ia; - datum.keys = n_ia ? xmalloc(n_ia * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_ia; i++) { - datum.keys[i].integer = ia[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_INTEGER, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_IA], &datum); -} - -void -idltest_simple_set_r(const struct idltest_simple *row, double r) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.real = r; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_R], &datum); -} - -void -idltest_simple_set_ra(const struct idltest_simple *row, const double *ra, size_t n_ra) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_ra; - datum.keys = n_ra ? xmalloc(n_ra * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_ra; i++) { - datum.keys[i].real = ra[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_REAL, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_RA], &datum); -} - -void -idltest_simple_set_s(const struct idltest_simple *row, const char *s) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.string = CONST_CAST(char *, s); - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_S], &datum); -} - -void -idltest_simple_set_sa(const struct idltest_simple *row, char **sa, size_t n_sa) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_sa; - datum.keys = n_sa ? xmalloc(n_sa * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_sa; i++) { - datum.keys[i].string = xstrdup(sa[i]); - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_SA], &datum); -} - -void -idltest_simple_set_u(const struct idltest_simple *row, struct uuid u) -{ - struct ovsdb_datum datum; - union ovsdb_atom key; - - ovs_assert(inited); - datum.n = 1; - datum.keys = &key; - key.uuid = u; - datum.values = NULL; - ovsdb_idl_txn_write_clone(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_U], &datum); -} - -void -idltest_simple_set_ua(const struct idltest_simple *row, const struct uuid *ua, size_t n_ua) -{ - struct ovsdb_datum datum; - size_t i; - - ovs_assert(inited); - datum.n = n_ua; - datum.keys = n_ua ? xmalloc(n_ua * sizeof *datum.keys) : NULL; - datum.values = NULL; - for (i = 0; i < n_ua; i++) { - datum.keys[i].uuid = ua[i]; - } - ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID); - ovsdb_idl_txn_write(&row->header_, &idltest_simple_columns[IDLTEST_SIMPLE_COL_UA], &datum); -} - -struct ovsdb_idl_column idltest_simple_columns[IDLTEST_SIMPLE_N_COLUMNS]; - -static void -idltest_simple_columns_init(void) -{ - struct ovsdb_idl_column *c; - - /* Initialize idltest_simple_col_b. */ - c = &idltest_simple_col_b; - c->name = "b"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_simple_parse_b; - c->unparse = idltest_simple_unparse_b; - - /* Initialize idltest_simple_col_ba. */ - c = &idltest_simple_col_ba; - c->name = "ba"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_BOOLEAN); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_simple_parse_ba; - c->unparse = idltest_simple_unparse_ba; - - /* Initialize idltest_simple_col_i. */ - c = &idltest_simple_col_i; - c->name = "i"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_simple_parse_i; - c->unparse = idltest_simple_unparse_i; - - /* Initialize idltest_simple_col_ia. */ - c = &idltest_simple_col_ia; - c->name = "ia"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_INTEGER); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = idltest_simple_parse_ia; - c->unparse = idltest_simple_unparse_ia; - - /* Initialize idltest_simple_col_r. */ - c = &idltest_simple_col_r; - c->name = "r"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_REAL); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_simple_parse_r; - c->unparse = idltest_simple_unparse_r; - - /* Initialize idltest_simple_col_ra. */ - c = &idltest_simple_col_ra; - c->name = "ra"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_REAL); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = idltest_simple_parse_ra; - c->unparse = idltest_simple_unparse_ra; - - /* Initialize idltest_simple_col_s. */ - c = &idltest_simple_col_s; - c->name = "s"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_simple_parse_s; - c->unparse = idltest_simple_unparse_s; - - /* Initialize idltest_simple_col_sa. */ - c = &idltest_simple_col_sa; - c->name = "sa"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_STRING); - c->type.key.u.string.minLen = 0; - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = idltest_simple_parse_sa; - c->unparse = idltest_simple_unparse_sa; - - /* Initialize idltest_simple_col_u. */ - c = &idltest_simple_col_u; - c->name = "u"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 1; - c->type.n_max = 1; - c->mutable = true; - c->parse = idltest_simple_parse_u; - c->unparse = idltest_simple_unparse_u; - - /* Initialize idltest_simple_col_ua. */ - c = &idltest_simple_col_ua; - c->name = "ua"; - ovsdb_base_type_init(&c->type.key, OVSDB_TYPE_UUID); - ovsdb_base_type_init(&c->type.value, OVSDB_TYPE_VOID); - c->type.n_min = 0; - c->type.n_max = UINT_MAX; - c->mutable = true; - c->parse = idltest_simple_parse_ua; - c->unparse = idltest_simple_unparse_ua; -} - -struct ovsdb_idl_table_class idltest_table_classes[IDLTEST_N_TABLES] = { - {"link1", true, - idltest_link1_columns, ARRAY_SIZE(idltest_link1_columns), - sizeof(struct idltest_link1), idltest_link1_init__}, - {"link2", true, - idltest_link2_columns, ARRAY_SIZE(idltest_link2_columns), - sizeof(struct idltest_link2), idltest_link2_init__}, - {"simple", true, - idltest_simple_columns, ARRAY_SIZE(idltest_simple_columns), - sizeof(struct idltest_simple), idltest_simple_init__}, -}; - -struct ovsdb_idl_class idltest_idl_class = { - "idltest", idltest_table_classes, ARRAY_SIZE(idltest_table_classes) -}; - -void -idltest_init(void) -{ - if (inited) { - return; - } - assert_single_threaded(); - inited = true; - - idltest_link1_columns_init(); - idltest_link2_columns_init(); - idltest_simple_columns_init(); -} - -/* Return the schema version. The caller must not free the returned value. */ -const char * -idltest_get_db_version(void) -{ - return "1.2.3"; -} - diff -Nru openvswitch-2.3.1/tests/idltest.h openvswitch-2.4.0~git20150623/tests/idltest.h --- openvswitch-2.3.1/tests/idltest.h 2014-10-12 23:47:59.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/idltest.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,272 +0,0 @@ -/* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - -#ifndef IDLTEST_IDL_HEADER -#define IDLTEST_IDL_HEADER 1 - -#include -#include -#include -#include "ovsdb-data.h" -#include "ovsdb-idl-provider.h" -#include "smap.h" -#include "uuid.h" - -/* link1 table. */ -struct idltest_link1 { - struct ovsdb_idl_row header_; - - /* i column. */ - int64_t i; - - /* k column. */ - struct idltest_link1 *k; - - /* ka column. */ - struct idltest_link1 **ka; - size_t n_ka; - - /* l2 column. */ - struct idltest_link2 *l2; -}; - -enum { - IDLTEST_LINK1_COL_I, - IDLTEST_LINK1_COL_K, - IDLTEST_LINK1_COL_KA, - IDLTEST_LINK1_COL_L2, - IDLTEST_LINK1_N_COLUMNS -}; - -#define idltest_link1_col_i (idltest_link1_columns[IDLTEST_LINK1_COL_I]) -#define idltest_link1_col_k (idltest_link1_columns[IDLTEST_LINK1_COL_K]) -#define idltest_link1_col_l2 (idltest_link1_columns[IDLTEST_LINK1_COL_L2]) -#define idltest_link1_col_ka (idltest_link1_columns[IDLTEST_LINK1_COL_KA]) - -extern struct ovsdb_idl_column idltest_link1_columns[IDLTEST_LINK1_N_COLUMNS]; - -const struct idltest_link1 *idltest_link1_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct idltest_link1 *idltest_link1_first(const struct ovsdb_idl *); -const struct idltest_link1 *idltest_link1_next(const struct idltest_link1 *); -#define IDLTEST_LINK1_FOR_EACH(ROW, IDL) \ - for ((ROW) = idltest_link1_first(IDL); \ - (ROW); \ - (ROW) = idltest_link1_next(ROW)) -#define IDLTEST_LINK1_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = idltest_link1_first(IDL); \ - (ROW) ? ((NEXT) = idltest_link1_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void idltest_link1_init(struct idltest_link1 *); -void idltest_link1_delete(const struct idltest_link1 *); -struct idltest_link1 *idltest_link1_insert(struct ovsdb_idl_txn *); - -void idltest_link1_verify_i(const struct idltest_link1 *); -void idltest_link1_verify_k(const struct idltest_link1 *); -void idltest_link1_verify_ka(const struct idltest_link1 *); -void idltest_link1_verify_l2(const struct idltest_link1 *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of idltest_link1 directly.) */ -const struct ovsdb_datum *idltest_link1_get_i(const struct idltest_link1 *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_link1_get_k(const struct idltest_link1 *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_link1_get_ka(const struct idltest_link1 *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_link1_get_l2(const struct idltest_link1 *, enum ovsdb_atomic_type key_type); - -void idltest_link1_set_i(const struct idltest_link1 *, int64_t i); -void idltest_link1_set_k(const struct idltest_link1 *, const struct idltest_link1 *k); -void idltest_link1_set_ka(const struct idltest_link1 *, struct idltest_link1 **ka, size_t n_ka); -void idltest_link1_set_l2(const struct idltest_link1 *, const struct idltest_link2 *l2); - - -/* link2 table. */ -struct idltest_link2 { - struct ovsdb_idl_row header_; - - /* i column. */ - int64_t i; - - /* l1 column. */ - struct idltest_link1 *l1; -}; - -enum { - IDLTEST_LINK2_COL_I, - IDLTEST_LINK2_COL_L1, - IDLTEST_LINK2_N_COLUMNS -}; - -#define idltest_link2_col_i (idltest_link2_columns[IDLTEST_LINK2_COL_I]) -#define idltest_link2_col_l1 (idltest_link2_columns[IDLTEST_LINK2_COL_L1]) - -extern struct ovsdb_idl_column idltest_link2_columns[IDLTEST_LINK2_N_COLUMNS]; - -const struct idltest_link2 *idltest_link2_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct idltest_link2 *idltest_link2_first(const struct ovsdb_idl *); -const struct idltest_link2 *idltest_link2_next(const struct idltest_link2 *); -#define IDLTEST_LINK2_FOR_EACH(ROW, IDL) \ - for ((ROW) = idltest_link2_first(IDL); \ - (ROW); \ - (ROW) = idltest_link2_next(ROW)) -#define IDLTEST_LINK2_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = idltest_link2_first(IDL); \ - (ROW) ? ((NEXT) = idltest_link2_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void idltest_link2_init(struct idltest_link2 *); -void idltest_link2_delete(const struct idltest_link2 *); -struct idltest_link2 *idltest_link2_insert(struct ovsdb_idl_txn *); - -void idltest_link2_verify_i(const struct idltest_link2 *); -void idltest_link2_verify_l1(const struct idltest_link2 *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of idltest_link2 directly.) */ -const struct ovsdb_datum *idltest_link2_get_i(const struct idltest_link2 *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_link2_get_l1(const struct idltest_link2 *, enum ovsdb_atomic_type key_type); - -void idltest_link2_set_i(const struct idltest_link2 *, int64_t i); -void idltest_link2_set_l1(const struct idltest_link2 *, const struct idltest_link1 *l1); - - -/* simple table. */ -struct idltest_simple { - struct ovsdb_idl_row header_; - - /* b column. */ - bool b; - - /* ba column. */ - bool *ba; - size_t n_ba; - - /* i column. */ - int64_t i; - - /* ia column. */ - int64_t *ia; - size_t n_ia; - - /* r column. */ - double r; - - /* ra column. */ - double *ra; - size_t n_ra; - - /* s column. */ - char *s; /* Always nonnull. */ - - /* sa column. */ - char **sa; - size_t n_sa; - - /* u column. */ - struct uuid u; - - /* ua column. */ - struct uuid *ua; - size_t n_ua; -}; - -enum { - IDLTEST_SIMPLE_COL_B, - IDLTEST_SIMPLE_COL_BA, - IDLTEST_SIMPLE_COL_I, - IDLTEST_SIMPLE_COL_IA, - IDLTEST_SIMPLE_COL_R, - IDLTEST_SIMPLE_COL_RA, - IDLTEST_SIMPLE_COL_S, - IDLTEST_SIMPLE_COL_SA, - IDLTEST_SIMPLE_COL_U, - IDLTEST_SIMPLE_COL_UA, - IDLTEST_SIMPLE_N_COLUMNS -}; - -#define idltest_simple_col_b (idltest_simple_columns[IDLTEST_SIMPLE_COL_B]) -#define idltest_simple_col_ba (idltest_simple_columns[IDLTEST_SIMPLE_COL_BA]) -#define idltest_simple_col_i (idltest_simple_columns[IDLTEST_SIMPLE_COL_I]) -#define idltest_simple_col_s (idltest_simple_columns[IDLTEST_SIMPLE_COL_S]) -#define idltest_simple_col_r (idltest_simple_columns[IDLTEST_SIMPLE_COL_R]) -#define idltest_simple_col_u (idltest_simple_columns[IDLTEST_SIMPLE_COL_U]) -#define idltest_simple_col_ra (idltest_simple_columns[IDLTEST_SIMPLE_COL_RA]) -#define idltest_simple_col_ia (idltest_simple_columns[IDLTEST_SIMPLE_COL_IA]) -#define idltest_simple_col_sa (idltest_simple_columns[IDLTEST_SIMPLE_COL_SA]) -#define idltest_simple_col_ua (idltest_simple_columns[IDLTEST_SIMPLE_COL_UA]) - -extern struct ovsdb_idl_column idltest_simple_columns[IDLTEST_SIMPLE_N_COLUMNS]; - -const struct idltest_simple *idltest_simple_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); -const struct idltest_simple *idltest_simple_first(const struct ovsdb_idl *); -const struct idltest_simple *idltest_simple_next(const struct idltest_simple *); -#define IDLTEST_SIMPLE_FOR_EACH(ROW, IDL) \ - for ((ROW) = idltest_simple_first(IDL); \ - (ROW); \ - (ROW) = idltest_simple_next(ROW)) -#define IDLTEST_SIMPLE_FOR_EACH_SAFE(ROW, NEXT, IDL) \ - for ((ROW) = idltest_simple_first(IDL); \ - (ROW) ? ((NEXT) = idltest_simple_next(ROW), 1) : 0; \ - (ROW) = (NEXT)) - -void idltest_simple_init(struct idltest_simple *); -void idltest_simple_delete(const struct idltest_simple *); -struct idltest_simple *idltest_simple_insert(struct ovsdb_idl_txn *); - -void idltest_simple_verify_b(const struct idltest_simple *); -void idltest_simple_verify_ba(const struct idltest_simple *); -void idltest_simple_verify_i(const struct idltest_simple *); -void idltest_simple_verify_ia(const struct idltest_simple *); -void idltest_simple_verify_r(const struct idltest_simple *); -void idltest_simple_verify_ra(const struct idltest_simple *); -void idltest_simple_verify_s(const struct idltest_simple *); -void idltest_simple_verify_sa(const struct idltest_simple *); -void idltest_simple_verify_u(const struct idltest_simple *); -void idltest_simple_verify_ua(const struct idltest_simple *); - -/* Functions for fetching columns as "struct ovsdb_datum"s. (This is - rarely useful. More often, it is easier to access columns by using - the members of idltest_simple directly.) */ -const struct ovsdb_datum *idltest_simple_get_b(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_ba(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_i(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_ia(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_r(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_ra(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_s(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_sa(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_u(const struct idltest_simple *, enum ovsdb_atomic_type key_type); -const struct ovsdb_datum *idltest_simple_get_ua(const struct idltest_simple *, enum ovsdb_atomic_type key_type); - -void idltest_simple_set_b(const struct idltest_simple *, bool b); -void idltest_simple_set_ba(const struct idltest_simple *, const bool *ba, size_t n_ba); -void idltest_simple_set_i(const struct idltest_simple *, int64_t i); -void idltest_simple_set_ia(const struct idltest_simple *, const int64_t *ia, size_t n_ia); -void idltest_simple_set_r(const struct idltest_simple *, double r); -void idltest_simple_set_ra(const struct idltest_simple *, const double *ra, size_t n_ra); -void idltest_simple_set_s(const struct idltest_simple *, const char *s); -void idltest_simple_set_sa(const struct idltest_simple *, char **sa, size_t n_sa); -void idltest_simple_set_u(const struct idltest_simple *, struct uuid u); -void idltest_simple_set_ua(const struct idltest_simple *, const struct uuid *ua, size_t n_ua); - - -enum { - IDLTEST_TABLE_LINK1, - IDLTEST_TABLE_LINK2, - IDLTEST_TABLE_SIMPLE, - IDLTEST_N_TABLES -}; - -#define idltest_table_simple (idltest_table_classes[IDLTEST_TABLE_SIMPLE]) -#define idltest_table_link1 (idltest_table_classes[IDLTEST_TABLE_LINK1]) -#define idltest_table_link2 (idltest_table_classes[IDLTEST_TABLE_LINK2]) - -extern struct ovsdb_idl_table_class idltest_table_classes[IDLTEST_N_TABLES]; - -extern struct ovsdb_idl_class idltest_idl_class; - -void idltest_init(void); - -const char * idltest_get_db_version(void); - -#endif /* IDLTEST_IDL_HEADER */ diff -Nru openvswitch-2.3.1/tests/idltest.ovsidl openvswitch-2.4.0~git20150623/tests/idltest.ovsidl --- openvswitch-2.3.1/tests/idltest.ovsidl 2014-10-12 23:47:58.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/idltest.ovsidl 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"idlHeader":"\"tests/idltest.h\"","idlPrefix":"idltest_","name":"idltest","tables":{"link1":{"columns":{"i":{"type":"integer"},"k":{"type":{"key":{"refTable":"link1","type":"uuid"}}},"ka":{"type":{"key":{"refTable":"link1","type":"uuid"},"max":"unlimited","min":0}},"l2":{"type":{"key":{"refTable":"link2","type":"uuid"},"min":0}}}},"link2":{"columns":{"i":{"type":"integer"},"l1":{"type":{"key":{"refTable":"link1","type":"uuid"},"min":0}}}},"simple":{"columns":{"b":{"type":"boolean"},"ba":{"type":{"key":"boolean","max":1,"min":0}},"i":{"type":"integer"},"ia":{"type":{"key":"integer","max":"unlimited","min":0}},"r":{"type":"real"},"ra":{"type":{"key":"real","max":"unlimited","min":0}},"s":{"type":"string"},"sa":{"type":{"key":"string","max":"unlimited","min":0}},"u":{"type":"uuid"},"ua":{"type":{"key":"uuid","max":"unlimited","min":0}}}}},"version":"1.2.3"} diff -Nru openvswitch-2.3.1/tests/interface-reconfigure.at openvswitch-2.4.0~git20150623/tests/interface-reconfigure.at --- openvswitch-2.3.1/tests/interface-reconfigure.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/interface-reconfigure.at 2015-06-23 18:46:21.000000000 +0000 @@ -697,6 +697,7 @@ AT_SETUP([non-VLAN, non-bond]) AT_KEYWORDS([interface-reconfigure]) AT_SKIP_IF([$non_ascii_cwd]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) ifr_setup AT_CHECK([ifr_run --force xenbr2 up], [0], [], [stderr]) @@ -773,6 +774,7 @@ AT_SETUP([VLAN, non-bond]) AT_KEYWORDS([interface-reconfigure]) AT_SKIP_IF([$non_ascii_cwd]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) ifr_setup AT_CHECK([ifr_run --force xapi3 up], [0], [], [stderr]) @@ -847,6 +849,7 @@ AT_SETUP([Bond, non-VLAN]) AT_KEYWORDS([interface-reconfigure]) AT_SKIP_IF([$non_ascii_cwd]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) ifr_setup # Pretend that bond0 exists, even though it would really be created by @@ -936,6 +939,7 @@ AT_SETUP([VLAN on bond]) AT_KEYWORDS([interface-reconfigure]) AT_SKIP_IF([$non_ascii_cwd]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) ifr_setup # Pretend that bond0 exists, even though it would really be created by diff -Nru openvswitch-2.3.1/tests/kmod-macros.at openvswitch-2.4.0~git20150623/tests/kmod-macros.at --- openvswitch-2.3.1/tests/kmod-macros.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/kmod-macros.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,79 @@ +# OVS_KMOD_VSWITCHD_START([vsctl-args], [vsctl-output], [=override]) +# +# Creates a database and starts ovsdb-server, starts ovs-vswitchd +# connected to that database, calls ovs-vsctl to create a bridge named +# br0 with predictable settings, passing 'vsctl-args' as additional +# commands to ovs-vsctl. If 'vsctl-args' causes ovs-vsctl to provide +# output (e.g. because it includes "create" commands) then 'vsctl-output' +# specifies the expected output after filtering through uuidfilt.pl. +# +m4_define([OVS_KMOD_VSWITCHD_START], + [ AT_CHECK([modprobe openvswitch]) + ON_EXIT([modprobe -r openvswitch]) + _OVS_VSWITCHD_START([]) + dnl Add bridges, ports, etc. + AT_CHECK([ovs-vsctl -- add-br br0 -- set bridge br0 protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2]) +]) +# +# +# OVS_KMOD_VSWITCHD_STOP([WHITELIST], [extra_cmds]) +# +# Gracefully stops ovs-vswitchd and ovsdb-server, checking their log files +# for messages with severity WARN or higher and signaling an error if any +# is present. The optional WHITELIST may contain shell-quoted "sed" +# commands to delete any warnings that are actually expected, e.g.: +# +# OVS_KMOD_VSWITCHD_STOP(["/expected error/d"]) +# +# 'extra_cmds' are shell commands to be executed afte OVS_VSWITCHD_STOP() is +# invoked. They can be used to perform additional cleanups such as name space +# removal. +m4_define([OVS_KMOD_VSWITCHD_STOP], + [AT_CHECK([ovs-vsctl del-br br0]) + OVS_VSWITCHD_STOP([$1]) + AT_CHECK([:; $2]) + AT_CHECK([modprobe -r openvswitch]) + ]) + +# DEL_NAMESPACES(ns [, ns ... ]) +# +# Delete namespaces from the running OS +m4_define([DEL_NAMESPACES], + [m4_foreach([ns], [$@], + [ip netns del ns +]) + ] +) +# +# ADD_NAMESPACES(ns [, ns ... ]) +# +# Add new namespaces, if ns exists, the old one +# will be remove before new ones are installed. +m4_define([ADD_NAMESPACES], + [m4_foreach([ns], [$@], + [DEL_NAMESPACES(ns) + AT_CHECK([ip netns add ns]) + ON_EXIT(DEL_NAMESPACES(ns)) + ]) + ] +) + +# ADD_VETH([port], [namespace], [ovs-br], [ip_addr]) +# +# Add a pair of veth ports. 'port' will be added to name space 'namespace', +# and "ovs-'port'" will be added to ovs bridge 'ovs-br'. +# +# The 'port' in 'namespace' will be brought up with static IP address +# with 'ip_addr' in CIDR notation. +# +# The existing 'port' or 'ovs-port' will be removed before new ones are added. +# +m4_define([ADD_VETH], + [ AT_CHECK([ip link add $1 type veth peer name ovs-$1]) + AT_CHECK([ip link set $1 netns $2]) + AT_CHECK([ovs-vsctl add-port $3 ovs-$1]) + AT_CHECK([ip link set dev ovs-$1 up]) + AT_CHECK([ip netns exec $2 ip addr add $4 dev $1]) + AT_CHECK([ip netns exec $2 ip link set dev $1 up]) + ] +) diff -Nru openvswitch-2.3.1/tests/kmod-testsuite.at openvswitch-2.4.0~git20150623/tests/kmod-testsuite.at --- openvswitch-2.3.1/tests/kmod-testsuite.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/kmod-testsuite.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,22 @@ +AT_INIT + +AT_COPYRIGHT([Copyright (c) 2015 Nicira, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License.]) + +m4_include([tests/ovs-macros.at]) +m4_include([tests/ovsdb-macros.at]) +m4_include([tests/ofproto-macros.at]) +m4_include([tests/kmod-macros.at]) + +m4_include([tests/kmod-traffic.at]) diff -Nru openvswitch-2.3.1/tests/kmod-traffic.at openvswitch-2.4.0~git20150623/tests/kmod-traffic.at --- openvswitch-2.3.1/tests/kmod-traffic.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/kmod-traffic.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,16 @@ +AT_BANNER([kmod-sanity]) + +AT_SETUP([kmod - ping between two ports]) +OVS_KMOD_VSWITCHD_START( + [set-fail-mode br0 standalone -- ]) + +ADD_NAMESPACES(at_ns0, at_ns1) + +ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24") +ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24") + +AT_CAPTURE_FILE([ping.output]) +AT_CHECK([ip netns exec at_ns0 bash -c "ping -q -c 3 -i 0.3 -w 2 10.1.1.2 > ping.output"]) + +OVS_KMOD_VSWITCHD_STOP([], DEL_NAMESPACES(at_ns0, at_ns1)) +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/lacp.at openvswitch-2.4.0~git20150623/tests/lacp.at --- openvswitch-2.3.1/tests/lacp.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/lacp.at 2015-06-23 18:46:21.000000000 +0000 @@ -17,9 +17,7 @@ set Interface p1 type=dummy ]) ovs-appctl time/stop -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 +ovs-appctl time/warp 300 100 AT_CHECK([ovs-appctl lacp/show], [0], [dnl ---- p1 ---- @@ -69,9 +67,7 @@ other_config:lacp-aggregation-key=3333 ]) ovs-appctl time/stop -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 +ovs-appctl time/warp 300 100 AT_CHECK([ovs-appctl lacp/show], [0], [stdout]) AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: /' < stdout], [0], [dnl @@ -326,7 +322,7 @@ -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \ -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1]) -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 AT_CHECK( [ovs-appctl lacp/show bond0 ovs-appctl lacp/show bond1 @@ -456,7 +452,7 @@ # Wait 4 more simulated seconds. The LACP state should become # "defaulted" for p0 and p2. -for i in `seq 0 40`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 4100 100 AT_CHECK( [ovs-appctl lacp/show bond0 ovs-appctl lacp/show bond1 diff -Nru openvswitch-2.3.1/tests/learn.at openvswitch-2.4.0~git20150623/tests/learn.at --- openvswitch-2.3.1/tests/learn.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/learn.at 2015-06-23 18:46:21.000000000 +0000 @@ -3,6 +3,9 @@ AT_SETUP([learning action - parsing and formatting]) AT_DATA([flows.txt], [[ actions=learn() +actions=learn(send_flow_rem) +actions=learn(delete_learned) +actions=learn(send_flow_rem,delete_learned) actions=learn(NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], output:NXM_OF_IN_PORT[], load:10->NXM_NX_REG0[5..10]) actions=learn(table=1,idle_timeout=10, hard_timeout=20, fin_idle_timeout=5, fin_hard_timeout=10, priority=10, cookie=0xfedcba9876543210, in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) ]]) @@ -10,8 +13,11 @@ [[usable protocols: any chosen protocol: OpenFlow10-table_id OFPT_FLOW_MOD (xid=0x1): ADD actions=learn(table=1) -OFPT_FLOW_MOD (xid=0x2): ADD actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[],load:0xa->NXM_NX_REG0[5..10]) -OFPT_FLOW_MOD (xid=0x3): ADD actions=learn(table=1,idle_timeout=10,hard_timeout=20,fin_idle_timeout=5,fin_hard_timeout=10,priority=10,cookie=0xfedcba9876543210,in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) +OFPT_FLOW_MOD (xid=0x2): ADD actions=learn(table=1,send_flow_rem) +OFPT_FLOW_MOD (xid=0x3): ADD actions=learn(table=1,delete_learned) +OFPT_FLOW_MOD (xid=0x4): ADD actions=learn(table=1,send_flow_rem,delete_learned) +OFPT_FLOW_MOD (xid=0x5): ADD actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[],load:0xa->NXM_NX_REG0[5..10]) +OFPT_FLOW_MOD (xid=0x6): ADD actions=learn(table=1,idle_timeout=10,hard_timeout=20,fin_idle_timeout=5,fin_hard_timeout=10,priority=10,cookie=0xfedcba9876543210,in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) ]]) AT_CLEANUP @@ -85,6 +91,20 @@ ]]) AT_CLEANUP +AT_SETUP([learning action - too-long immediate value]) +dnl 129 bits is too long. +AT_CHECK([[ovs-ofctl parse-flow 'actions=learn(load:0x1fedbca9876543210fedbca9876543210->NXM_NX_IPV6_DST[])']], + [1], [], [[ovs-ofctl: 0x1fedbca9876543210fedbca9876543210->NXM_NX_IPV6_DST[]: too many bits in immediate value +]]) + +dnl 128 bits is merely a bad prerequisite. +AT_CHECK([[ovs-ofctl parse-flow 'actions=learn(load:0xfedbca9876543210fedbca9876543210->NXM_NX_IPV6_DST[])']], [1], [], [stderr]) +AT_CHECK([sed -e 's/.*|meta_flow|WARN|//' < stderr], [0], + [[destination field ipv6_dst lacks correct prerequisites +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]], [[]]) +AT_CLEANUP + AT_SETUP([learning action - standard VLAN+MAC learning]) OVS_VSWITCHD_START( [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \ @@ -213,9 +233,7 @@ done # Make sure that 15 seconds without refreshing makes the flow time out. -ovs-appctl time/warp 5000 -ovs-appctl time/warp 5000 -ovs-appctl time/warp 5000 +ovs-appctl time/warp 15000 5000 sleep 1 AT_CHECK([ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort], [0], [dnl table=1, priority=0 actions=FLOOD @@ -480,3 +498,131 @@ ]) OVS_VSWITCHD_STOP AT_CLEANUP + +AT_SETUP([learning action - delete_learned feature]) +OVS_VSWITCHD_START + +# Add some initial flows and check that it was successful. +AT_DATA([flows.txt], [dnl + reg0=0x1 actions=learn(delete_learned,cookie=0x123) + reg0=0x2 actions=learn(delete_learned,cookie=0x123) +cookie=0x123, table=1, reg0=0x3 actions=drop +cookie=0x123, table=1, reg0=0x4 actions=drop +cookie=0x123, table=2, reg0=0x5 actions=drop +cookie=0x234, table=1, reg0=0x6 actions=drop +]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x123, table=1, reg0=0x3 actions=drop + cookie=0x123, table=1, reg0=0x4 actions=drop + cookie=0x123, table=2, reg0=0x5 actions=drop + cookie=0x234, table=1, reg0=0x6 actions=drop + reg0=0x1 actions=learn(table=1,delete_learned,cookie=0x123) + reg0=0x2 actions=learn(table=1,delete_learned,cookie=0x123) +NXST_FLOW reply: +]) + +# Delete one of the learn actions. The learned flows should stay, since there +# is another learn action with the identical target. +AT_CHECK([ovs-ofctl del-flows br0 'table=0 reg0=1']) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x123, table=1, reg0=0x3 actions=drop + cookie=0x123, table=1, reg0=0x4 actions=drop + cookie=0x123, table=2, reg0=0x5 actions=drop + cookie=0x234, table=1, reg0=0x6 actions=drop + reg0=0x2 actions=learn(table=1,delete_learned,cookie=0x123) +NXST_FLOW reply: +]) + +# Change the flow with the learn action by adding a second action. The learned +# flows should stay because the learn action is still there. +AT_CHECK([ovs-ofctl mod-flows br0 'table=0 reg0=2 actions=output:1,learn(delete_learned,cookie=0x123)']) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x123, table=1, reg0=0x3 actions=drop + cookie=0x123, table=1, reg0=0x4 actions=drop + cookie=0x123, table=2, reg0=0x5 actions=drop + cookie=0x234, table=1, reg0=0x6 actions=drop + reg0=0x2 actions=output:1,learn(table=1,delete_learned,cookie=0x123) +NXST_FLOW reply: +]) + +# Change the flow with the learn action by replacing its learn action by one +# with a different target. The (previous) learned flows disappear. +AT_CHECK([ovs-ofctl mod-flows br0 'table=0 reg0=2 actions=learn(delete_learned,cookie=0x234)']) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x123, table=2, reg0=0x5 actions=drop + cookie=0x234, table=1, reg0=0x6 actions=drop + reg0=0x2 actions=learn(table=1,delete_learned,cookie=0x234) +NXST_FLOW reply: +]) + +# Use add-flow to replace the flow with the learn action by one with the +# same learn action and an extra action. The (new) learned flow remains. +AT_CHECK([ovs-ofctl add-flow br0 'table=0 reg0=2 actions=learn(delete_learned,cookie=0x234),output:2']) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x123, table=2, reg0=0x5 actions=drop + cookie=0x234, table=1, reg0=0x6 actions=drop + reg0=0x2 actions=learn(table=1,delete_learned,cookie=0x234),output:2 +NXST_FLOW reply: +]) + +# Delete the flow with the learn action. The learned flow disappears too. +AT_CHECK([ovs-ofctl del-flows br0 table=0]) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x123, table=2, reg0=0x5 actions=drop +NXST_FLOW reply: +]) + +# Add a new set of flows to check on a corner case: the learned flows +# contain their own learn actions which cascade to further deletions. +# This can't happen if the learned flows were actually created by a +# learn action, since the learn action has very restricted action +# support, but there's no restriction that the deleted flows were +# created by a learn action. +AT_DATA([flows.txt], [dnl + reg0=0x1 actions=learn(table=1,delete_learned,cookie=0x123) + reg0=0x2 actions=learn(table=2,delete_learned,cookie=0x234) +cookie=0x123, table=1, reg0=0x3 actions=learn(table=3,delete_learned,cookie=0x345) +cookie=0x234, table=2, reg0=0x3 actions=learn(table=4,delete_learned,cookie=0x456) +cookie=0x345, table=3, reg0=0x4 actions=learn(table=5,delete_learned,cookie=0x567) +cookie=0x456, table=4, reg0=0x5 actions=learn(table=5,delete_learned,cookie=0x567) +cookie=0x567, table=5, reg0=0x6 actions=drop +cookie=0x567, table=5, reg0=0x7 actions=drop +cookie=0x567, table=5, reg0=0x8 actions=drop +]) +AT_CHECK([ovs-ofctl del-flows br0]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x123, table=1, reg0=0x3 actions=learn(table=3,delete_learned,cookie=0x345) + cookie=0x234, table=2, reg0=0x3 actions=learn(table=4,delete_learned,cookie=0x456) + cookie=0x345, table=3, reg0=0x4 actions=learn(table=5,delete_learned,cookie=0x567) + cookie=0x456, table=4, reg0=0x5 actions=learn(table=5,delete_learned,cookie=0x567) + cookie=0x567, table=5, reg0=0x6 actions=drop + cookie=0x567, table=5, reg0=0x7 actions=drop + cookie=0x567, table=5, reg0=0x8 actions=drop + reg0=0x1 actions=learn(table=1,delete_learned,cookie=0x123) + reg0=0x2 actions=learn(table=2,delete_learned,cookie=0x234) +NXST_FLOW reply: +]) + +# Deleting the flow with reg0=1 should cascade to delete a few levels +# of learned flows, but the ones with cookie=0x567 stick around +# because of the flow with cookie=0x456. +AT_CHECK([ovs-ofctl del-flows br0 'table=0 reg0=1']) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x234, table=2, reg0=0x3 actions=learn(table=4,delete_learned,cookie=0x456) + cookie=0x456, table=4, reg0=0x5 actions=learn(table=5,delete_learned,cookie=0x567) + cookie=0x567, table=5, reg0=0x6 actions=drop + cookie=0x567, table=5, reg0=0x7 actions=drop + cookie=0x567, table=5, reg0=0x8 actions=drop + reg0=0x2 actions=learn(table=2,delete_learned,cookie=0x234) +NXST_FLOW reply: +]) + +# Deleting the flow with reg0=2 should cascade to delete all the rest: +AT_CHECK([ovs-ofctl del-flows br0 'table=0 reg0=2']) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl +NXST_FLOW reply: +]) +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/lib.at openvswitch-2.4.0~git20150623/tests/lib.at --- openvswitch-2.3.1/tests/lib.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/lib.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,9 @@ +AT_BANNER([Library -- basic]) + +AT_SETUP([successful linking]) +AT_KEYWORDS([libopenvswitch]) +AT_CAPTURE_FILE([log]) +AT_CHECK( + [test-lib], [0], + [], [ignore]) +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/library.at openvswitch-2.4.0~git20150623/tests/library.at --- openvswitch-2.3.1/tests/library.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/library.at 2015-06-23 18:46:21.000000000 +0000 @@ -2,12 +2,12 @@ AT_SETUP([test flow extractor]) AT_CHECK([$PERL `which flowgen.pl` >/dev/null 3>flows 4>pcap]) -AT_CHECK([ovstest test-flows -]) +], [yes]) CHECK_LOCKFILE([lock_twice_blocks_other_process], [1], [lockfile|WARN|.file.~lock~: cannot lock file because this process has already locked it lockfile|WARN|.file.~lock~: child does not inherit lock lockfile|WARN|.file.~lock~: cannot lock file because it is already locked by pid -]) +], [yes]) -CHECK_LOCKFILE([lock_and_unlock_allows_other_process], [1]) +CHECK_LOCKFILE([lock_and_unlock_allows_other_process], [1], [], [yes]) CHECK_LOCKFILE([lock_multiple], [0], [lockfile|WARN|.a.~lock~: cannot lock file because this process has already locked it @@ -44,8 +47,8 @@ lockfile|WARN|.b.~lock~: cannot lock file because this process has already locked it lockfile|WARN|.b.~lock~: cannot lock file because this process has already locked it lockfile|WARN|.a.~lock~: cannot lock file because this process has already locked it -]) +], [yes]) CHECK_LOCKFILE([lock_symlink_to_dir], [0], [lockfile|WARN|dir/.b.~lock~: cannot lock file because this process has already locked it -]) +], [yes]) diff -Nru openvswitch-2.3.1/tests/mpls-xlate.at openvswitch-2.4.0~git20150623/tests/mpls-xlate.at --- openvswitch-2.3.1/tests/mpls-xlate.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/mpls-xlate.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,64 @@ +AT_BANNER([mpls_xlate]) + +AT_SETUP([MPLS xlate action]) + +OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1]) + +AT_CHECK([ovs-appctl dpif/show], [0], [dnl +dummy@ovs-dummy: hit:0 missed:0 + br0: + br0 65534/100: (dummy) + p0 1/1: (dummy) +]) + +dnl Setup single MPLS tags. +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 in_port=local,dl_type=0x0800,action=push_mpls:0x8847,set_field:10-\>mpls_label,output:1]) +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 dl_type=0x8847,in_port=1,mpls_label=20,action=pop_mpls:0x0800,output:LOCAL]) + +dnl Test MPLS push +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: push_mpls(label=10,tc=0,ttl=64,bos=1,eth_type=0x8847),1 +]) + +dnl Test MPLS pop +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x8847),mpls(label=20,tc=0,ttl=64,bos=1)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: pop_mpls(eth_type=0x800),100 +]) + +dnl Setup multiple MPLS tags. +AT_CHECK([ovs-ofctl del-flows br0]) + +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 in_port=local,dl_type=0x0800,action=push_mpls:0x8847,set_field:10-\>mpls_label,push_mpls:0x8847,set_field:20-\>mpls_label,output:1]) +# The resubmits will be executed after recirculation, which preserves the +# register values. +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 cookie=0xa,table=0,dl_type=0x8847,in_port=1,mpls_label=60,action=set_field:10-\>reg0,pop_mpls:0x8847,goto_table:1]) +# The pop_mpls below recirculates from within a resubmit +# After recirculation the (restored) register value is moved to IP ttl. +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 cookie=0xb,table=1,dl_type=0x8847,in_port=1,mpls_label=50,action=push:NXM_NX_REG0[[0..7]],pop_mpls:0x0800,set_field:0-\>nw_ttl,pop:NXM_NX_REG1[[0..7]],move:NXM_NX_REG1[[0..7]]-\>NXM_NX_IP_TTL[[]],output:LOCAL]) + +dnl Double MPLS push +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: push_mpls(label=10,tc=0,ttl=64,bos=1,eth_type=0x8847),push_mpls(label=20,tc=0,ttl=64,bos=0,eth_type=0x8847),1 +]) + +dnl Double MPLS pop +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x8847),mpls(label=60,tc=0/0,ttl=64,bos=0)' -generate], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: pop_mpls(eth_type=0x8847),recirc(0x1) +]) + +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'recirc_id(1),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x8847),mpls(label=50,tc=0/0,ttl=64,bos=0)' -generate], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: pop_mpls(eth_type=0x800),recirc(0x2) +]) + +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'recirc_id(2),in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)' -generate], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: set(ipv4(ttl=10)),100 +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/odp.at openvswitch-2.4.0~git20150623/tests/odp.at --- openvswitch-2.3.1/tests/odp.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/odp.at 2015-06-23 18:46:21.000000000 +0000 @@ -19,9 +19,6 @@ in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80,dst=8080) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=17,tclass=0,hlimit=128,frag=no),udp(src=6630,dst=22) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=1,code=2) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3,sll=00:05:06:07:08:09) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,tll=00:0a:0b:0c:0d:0e) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) @@ -33,52 +30,52 @@ ]) (echo '# Valid forms without tun_id or VLAN header.' - set 's/^/skb_priority(0),skb_mark(0),/' odp-base.txt + set 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt set ' -s/^/skb_priority(0),skb_mark(0),/ +s/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ ' odp-base.txt echo echo '# Valid forms with tunnel header.' - sed 's/^/skb_priority(0),tunnel(tun_id=0x7f10354,src=10.10.10.10,dst=20.20.20.20,tos=0x0,ttl=64,flags(csum,key)),skb_mark(0x1234),/' odp-base.txt + sed 's/^/skb_priority(0),tunnel(tun_id=0x7f10354,src=10.10.10.10,dst=20.20.20.20,ttl=64,flags(csum,key)),skb_mark(0x1234),recirc_id(0),dp_hash(0),/' odp-base.txt echo echo '# Valid forms with VLAN header.' - sed 's/^/skb_priority(0),skb_mark(0),/ + sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ s/$/)/' odp-base.txt echo echo '# Valid forms with MPLS header.' - sed 's/^/skb_priority(0),skb_mark(0),/ + sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ s/\(eth([[^)]]*),?\)/\1,eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt echo echo '# Valid forms with MPLS multicast header.' - sed 's/^/skb_priority(0),skb_mark(0),/ + sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ s/\(eth([[^)]]*),?\)/\1,eth_type(0x8848),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt echo echo '# Valid forms with tunnel and VLAN headers.' - sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,tos=0x8,ttl=128,flags(key)),skb_mark(0),/ + sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,tos=0x8,ttl=128,flags(key)),skb_mark(0),recirc_id(0),dp_hash(0),/ s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ s/$/)/' odp-base.txt echo echo '# Valid forms with QOS priority, tunnel, and VLAN headers.' - sed 's/^/skb_priority(0x1234),tunnel(tun_id=0xfedcba9876543210,src=10.10.10.10,dst=20.20.20.20,tos=0x8,ttl=64,flags(key)),skb_mark(0),/ + sed 's/^/skb_priority(0x1234),tunnel(tun_id=0xfedcba9876543210,src=10.10.10.10,dst=20.20.20.20,tos=0x8,ttl=64,flags(key)),skb_mark(0),recirc_id(0),dp_hash(0),/ s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ s/$/)/' odp-base.txt echo echo '# Valid forms with IP first fragment.' -sed 's/^/skb_priority(0),skb_mark(0),/' odp-base.txt | sed -n 's/,frag=no),/,frag=first),/p' +sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt | sed -n 's/,frag=no),/,frag=first),/p' echo echo '# Valid forms with IP later fragment.' -sed 's/^/skb_priority(0),skb_mark(0),/' odp-base.txt | sed -n 's/,frag=no),.*/,frag=later)/p' +sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt | sed -n 's/,frag=no),.*/,frag=later)/p' ) > odp-in.txt AT_CAPTURE_FILE([odp-in.txt]) @@ -87,8 +84,6 @@ dnl set to zero. This is reflected when the key is formated sed '/bos=0/{ s/^/ODP_FIT_TOO_LITTLE: / -s/mpls(label=100,tc=7,ttl=100,bos=0)/mpls(lse0=0x64e64,lse1=0,lse2=0)/ -s/mpls(label=1000,tc=4,ttl=200,bos=0)/mpls(lse0=0x3e88c8,lse1=0,lse2=0)/ }' < odp-in.txt > odp-out.txt AT_CHECK_UNQUOTED([ovstest test-odp parse-keys < odp-in.txt], [0], [`cat odp-out.txt` @@ -100,15 +95,15 @@ AT_DATA([odp-base.txt], [dnl in_port(1/0xff),eth(src=00:01:02:03:04:05/ff:ff:ff:ff:ff:f0,dst=10:11:12:13:14:15/ff:ff:ff:ff:ff:f0) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff,dst=6632/0xff00) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1/0xf0,code=2/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1/0xf0,code=2) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=17,tclass=0,hlimit=128,frag=no),udp(src=6630/0xff00,dst=22/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=1/0xf0,code=2/0xff) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=1/0xf0,code=2) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3/::250) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3/::250,sll=00:05:06:07:08:09/ff:ff:ff:ff:ff:00) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3/::250,tll=00:0a:0b:0c:0d:0e/ff:ff:ff:ff:ff:00) @@ -122,7 +117,15 @@ echo echo '# Valid forms with tunnel header.' - sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,tos=0\/0xff,ttl=64\/0xff,flags(csum,key)),/' odp-base.txt + sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,ttl=64,vxlan(gbp(id=10\/0xff,flags=0xb)),flags(csum,key)),/' odp-base.txt + + echo + echo '# Valid forms with tunnel header (wildcard flag).' + sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,ttl=64,flags(-df+csum+key)),/' odp-base.txt + + echo + echo '# Valid forms with Geneve header.' + sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,ttl=64,geneve({class=0,type=0,len=4,0xa\/0xff}{class=0xffff,type=0x1,len=4,0xffffffff}),flags(csum,key)),/' odp-base.txt echo echo '# Valid forms with VLAN header.' @@ -165,12 +168,12 @@ dnl We could add a test for invalid forms, but that's less important. AT_DATA([odp-base.txt], [dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff,dst=6632/0xff00) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1/0xf0,code=2/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) ]) @@ -188,20 +191,20 @@ in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff)) ]) AT_DATA([odp-ipv4.txt], [dnl -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) ]) AT_DATA([odp-icmp.txt], [dnl -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) ]) AT_DATA([odp-arp.txt], [dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) ]) AT_DATA([odp-tcp.txt], [dnl -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) ]) AT_DATA([odp-tcp6.txt], [dnl -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no/0xf0) +in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) ]) AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_type=0x1235' < odp-base.txt], [0], [`cat odp-eth-type.txt` @@ -230,21 +233,50 @@ AT_DATA([actions.txt], [dnl 1,2,3 userspace(pid=555666777) +userspace(pid=555666777,tunnel_out_port=10) userspace(pid=6633,sFlow(vid=9,pcp=7,output=10)) +userspace(pid=6633,sFlow(vid=9,pcp=7,output=10),tunnel_out_port=10) userspace(pid=9765,slow_path()) +userspace(pid=9765,slow_path(),tunnel_out_port=10) userspace(pid=9765,slow_path(cfm)) +userspace(pid=9765,slow_path(cfm),tunnel_out_port=10) userspace(pid=1234567,userdata(0102030405060708090a0b0c0d0e0f)) +userspace(pid=1234567,userdata(0102030405060708090a0b0c0d0e0f),tunnel_out_port=10) userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456)) -userspace(pid=6633,ipfix) +userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456),tunnel_out_port=10) +userspace(pid=6633,ipfix(output_port=10)) +userspace(pid=6633,ipfix(output_port=10),tunnel_out_port=10) set(in_port(2)) set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15)) +set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15/ff:ff:ff:00:00:00)) set(eth_type(0x1234)) set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) +set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,ttl=128,frag=no)) +set(ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) +set(ipv4(src=35.8.2.41/255.255.255.0,tos=0x80,ttl=128,frag=no)) +set(ipv4(tos=0/0x3)) +set(ipv4(tos=0x80/0xfc)) +set(ipv4(ttl=128,frag=no)) +set(ipv4(frag=no)) set(tcp(src=80,dst=8080)) +set(tcp(src=80/0xff00,dst=8080)) +set(tcp(src=80)) +set(tcp(dst=8080)) set(udp(src=81,dst=6632)) +set(udp(src=81/0xff00,dst=6632)) +set(udp(src=81)) +set(udp(dst=6633)) set(sctp(src=82,dst=6633)) +set(sctp(src=82/0xff00,dst=6633)) +set(sctp(src=82)) +set(sctp(dst=6632)) set(icmp(type=1,code=2)) set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) +set(ipv6(src=::1,dst=::2)) +set(ipv6(label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) +set(ipv6(label=0,proto=10,hlimit=128)) +set(ipv6(label=0/0xfff,proto=10,tclass=0x70/0x70)) +set(ipv6(label=0)) set(icmpv6(type=1,code=2)) push_vlan(vid=12,pcp=0) push_vlan(vid=13,pcp=5,cfi=0) @@ -252,8 +284,14 @@ push_vlan(tpid=0x9100,vid=13,pcp=5,cfi=0) pop_vlan sample(sample=9.7%,actions(1,2,3,push_vlan(vid=1,pcp=2))) -set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,csum,key))) -set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key))) +set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(df,csum,key))) +set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key))) +tnl_pop(4) +tnl_push(tnl_port(4),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x40),gre((flags=0x2000,proto=0x6558),key=0x1e241)),out_port(1)) +tnl_push(tnl_port(4),header(size=46,type=3,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x40),gre((flags=0xa000,proto=0x6558),csum=0x0,key=0x1e241)),out_port(1)) +tnl_push(tnl_port(6),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x40),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0x8000000,vni=0x1c7)),out_port(1)) +tnl_push(tnl_port(6),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x40),udp(src=0,dst=6081,csum=0x0),geneve(oam,vni=0x1c7)),out_port(1)) +tnl_push(tnl_port(6),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x40),udp(src=0,dst=6081,csum=0xffff),geneve(vni=0x1c7)),out_port(1)) ]) AT_CHECK_UNQUOTED([ovstest test-odp parse-actions < actions.txt], [0], [`cat actions.txt` diff -Nru openvswitch-2.3.1/tests/ofp-actions.at openvswitch-2.4.0~git20150623/tests/ofp-actions.at --- openvswitch-2.3.1/tests/ofp-actions.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ofp-actions.at 2015-06-23 18:46:21.000000000 +0000 @@ -69,10 +69,12 @@ # actions=set_tunnel64:0x885f3298 ffff 0018 00002320 0009 000000000000 00000000885f3298 -# actions=write_metadata:0xfedcba9876543210 +# bad OpenFlow10 actions: OFPBIC_UNSUP_INST +& ofp_actions|WARN|write_metadata instruction not allowed here ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff -# actions=write_metadata:0xfedcba9876543210/0xffff0000ffff0000 +# bad OpenFlow10 actions: OFPBIC_UNSUP_INST +& ofp_actions|WARN|write_metadata instruction not allowed here ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffff0000ffff0000 # actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[]) @@ -117,6 +119,52 @@ # actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) ffff 0018 00002320 001d 3039 00005BA0 00008707 0000B26E +# bad OpenFlow10 actions: OFPBAC_BAD_LEN +& ofp_actions|WARN|OpenFlow action OFPAT_OUTPUT length 240 exceeds action buffer length 8 +& ofp_actions|WARN|bad action at offset 0 (OFPBAC_BAD_LEN): +& 00000000 00 00 00 f0 00 00 00 00- +00 00 00 f0 00 00 00 00 + +# bad OpenFlow10 actions: OFPBAC_BAD_LEN +& ofp_actions|WARN|OpenFlow action OFPAT_OUTPUT length 16 not in valid range [[8,8]] +& ofp_actions|WARN|bad action at offset 0 (OFPBAC_BAD_LEN): +& 00000000 00 00 00 10 ff fe ff ff-00 00 00 00 00 00 00 00 +00 00 00 10 ff fe ff ff 00 00 00 00 00 00 00 00 + +# bad OpenFlow10 actions: OFPBAC_BAD_LEN +& ofp_actions|WARN|OpenFlow action NXAST_DEC_TTL_CNT_IDS length 17 is not a multiple of 8 +ffff 0011 00002320 0015 0001 00000000 0000000000000000 + +]) +sed '/^[[#&]]/d' < test-data > input.txt +sed -n 's/^# //p; /^$/p' < test-data > expout +sed -n 's/^& //p' < test-data > experr +AT_CAPTURE_FILE([input.txt]) +AT_CAPTURE_FILE([expout]) +AT_CAPTURE_FILE([experr]) +AT_CHECK( + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow10 < input.txt], + [0], [expout], [experr]) +AT_CLEANUP + +AT_SETUP([OpenFlow 1.0 "instruction" translations]) +AT_KEYWORDS([ofp-actions OF1.0 instruction]) +AT_DATA([test-data], [dnl +dnl Try a couple of ordinary actions to make sure they're accepted, +dnl but there's no point in retrying all the actions from the previous test. +# actions=LOCAL +0000 0008 fffe 04d2 + +# actions=mod_dl_src:00:11:22:33:44:55 +0004 0010 001122334455 000000000000 + +dnl Now check that write_metadata is accepted. +# actions=write_metadata:0xfedcba9876543210 +ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff + +# actions=write_metadata:0xfedcba9876543210/0xffff0000ffff0000 +ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffff0000ffff0000 + ]) sed '/^[[#&]]/d' < test-data > input.txt sed -n 's/^# //p; /^$/p' < test-data > expout @@ -125,7 +173,7 @@ AT_CAPTURE_FILE([expout]) AT_CAPTURE_FILE([experr]) AT_CHECK( - [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-actions < input.txt], + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-instructions OpenFlow10 < input.txt], [0], [expout], [experr]) AT_CLEANUP @@ -201,53 +249,11 @@ # actions=set_tunnel64:0x885f3298 ffff 0018 00002320 0009 000000000000 00000000885f3298 -dnl OpenFlow 1.1 uses OFPIT_WRITE_METADATA to express the NXAST_WRITE_METADATA -dnl action instead, so parse-ofp11-actions will recognise and drop this action. -# actions=write_metadata:0xfedcba9876543210 -# 0: ff -> (none) -# 1: ff -> (none) -# 2: 00 -> (none) -# 3: 20 -> (none) -# 4: 00 -> (none) -# 5: 00 -> (none) -# 6: 23 -> (none) -# 7: 20 -> (none) -# 8: 00 -> (none) -# 9: 16 -> (none) -# 10: 00 -> (none) -# 11: 00 -> (none) -# 12: 00 -> (none) -# 13: 00 -> (none) -# 14: 00 -> (none) -# 15: 00 -> (none) -# 16: fe -> (none) -# 17: dc -> (none) -# 18: ba -> (none) -# 19: 98 -> (none) -# 20: 76 -> (none) -# 21: 54 -> (none) -# 22: 32 -> (none) -# 23: 10 -> (none) -# 24: ff -> (none) -# 25: ff -> (none) -# 26: ff -> (none) -# 27: ff -> (none) -# 28: ff -> (none) -# 29: ff -> (none) -# 30: ff -> (none) -# 31: ff -> (none) +dnl Write-Metadata is only allowed in contexts that allow instructions. +& ofp_actions|WARN|write_metadata instruction not allowed here +# bad OpenFlow11 actions: OFPBIC_UNSUP_INST ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff -dnl Write-Metadata duplicated. -& ofp_actions|WARN|duplicate write_metadata instruction not allowed, for OpenFlow 1.1+ compatibility -# bad OF1.1 actions: OFPBAC_UNSUPPORTED_ORDER -ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff - -dnl Write-Metadata in wrong position. -& ofp_actions|WARN|invalid instruction ordering: apply_actions must appear before write_metadata, for OpenFlow 1.1+ compatibility -# bad OF1.1 actions: OFPBAC_UNSUPPORTED_ORDER -ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff ffff 0010 00002320 0002 0000 12345678 - # actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[]) ffff 0020 00002320 000a 0000 0032 0000 0000 0000 0000 0000 0000 001f 00010004 @@ -275,10 +281,6 @@ # actions=exit ffff 0010 00002320 0011 000000000000 -dnl NXAST_DEC_TTL -# actions=dec_ttl -ffff 0010 00002320 0012 000000000000 - dnl OpenFlow 1.1 OFPAT_DEC_TTL # actions=dec_ttl 0018 0008 00000000 @@ -303,7 +305,7 @@ AT_CAPTURE_FILE([expout]) AT_CAPTURE_FILE([experr]) AT_CHECK( - [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-actions < input.txt], + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow11 < input.txt], [0], [expout], [experr]) AT_CLEANUP @@ -339,16 +341,16 @@ 0004 0008 00000000 dnl Duplicate instruction type: -# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION +# bad OpenFlow11 instructions: OFPBIC_DUP_INST 0004 0008 00000000 0004 0008 00000000 dnl Instructions not multiple of 8 in length. & ofp_actions|WARN|OpenFlow message instructions length 9 is not a multiple of 8 -# bad OF1.1 instructions: OFPBIC_BAD_LEN +# bad OpenFlow11 instructions: OFPBIC_BAD_LEN 0004 0009 01 00000000 dnl Goto-Table instruction too long. -# bad OF1.1 instructions: OFPBIC_BAD_LEN +# bad OpenFlow11 instructions: OFPBIC_BAD_LEN 0001 0010 01 000000 0000000000000000 dnl Goto-Table 1 instruction non-zero padding @@ -357,7 +359,7 @@ 0001 0008 01 000001 dnl Goto-Table 1 instruction go back to the previous table. -# bad OF1.1 instructions: OFPBIC_BAD_TABLE_ID +# bad OpenFlow11 instructions: OFPBIC_BAD_TABLE_ID 2,0001 0008 01 000000 dnl Goto-Table 1 @@ -368,20 +370,58 @@ # actions=write_metadata:0xfedcba9876543210 0002 0018 00000000 fedcba9876543210 ffffffffffffffff +dnl Write-Metadata as Nicira extension action is transformed into instruction. +# actions=write_metadata:0xfedcba9876543210 +# 1: 04 -> 02 +# 3: 28 -> 18 +# 8: ff -> fe +# 9: ff -> dc +# 10: 00 -> ba +# 11: 20 -> 98 +# 12: 00 -> 76 +# 13: 00 -> 54 +# 14: 23 -> 32 +# 15: 20 -> 10 +# 16: 00 -> ff +# 17: 16 -> ff +# 18: 00 -> ff +# 19: 00 -> ff +# 20: 00 -> ff +# 21: 00 -> ff +# 22: 00 -> ff +# 23: 00 -> ff +# 24: fe -> (none) +# 25: dc -> (none) +# 26: ba -> (none) +# 27: 98 -> (none) +# 28: 76 -> (none) +# 29: 54 -> (none) +# 30: 32 -> (none) +# 31: 10 -> (none) +# 32: ff -> (none) +# 33: ff -> (none) +# 34: ff -> (none) +# 35: ff -> (none) +# 36: ff -> (none) +# 37: ff -> (none) +# 38: ff -> (none) +# 39: ff -> (none) +0004 0028 00000000 ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff + dnl Write-Metadata with mask. # actions=write_metadata:0xfedcba9876543210/0xff00ff00ff00ff00 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 dnl Write-Metadata too short. -# bad OF1.1 instructions: OFPBIC_BAD_LEN +# bad OpenFlow11 instructions: OFPBIC_BAD_LEN 0002 0010 00000000 fedcba9876543210 dnl Write-Metadata too long. -# bad OF1.1 instructions: OFPBIC_BAD_LEN +# bad OpenFlow11 instructions: OFPBIC_BAD_LEN 0002 0020 00000000 fedcba9876543210 ffffffffffffffff 0000000000000000 dnl Write-Metadata duplicated. -# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION +# bad OpenFlow11 instructions: OFPBIC_DUP_INST 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 dnl Write-Metadata in wrong position (OpenFlow 1.1+ disregards the order @@ -441,7 +481,7 @@ 0003 0008 00000000 dnl Clear-Actions too-long -# bad OF1.1 instructions: OFPBIC_BAD_LEN +# bad OpenFlow11 instructions: OFPBIC_BAD_LEN 0005 0010 00000000 0000000000000000 dnl Clear-Actions non-zero padding @@ -459,11 +499,11 @@ 0005 0008 00000000 dnl Experimenter actions not supported yet. -# bad OF1.1 instructions: OFPBIC_BAD_EXPERIMENTER +# bad OpenFlow11 instructions: OFPBIC_BAD_EXPERIMENTER ffff 0008 01 000000 dnl Bad instruction number (0 not assigned). -# bad OF1.1 instructions: OFPBIC_UNKNOWN_INST +# bad OpenFlow11 instructions: OFPBIC_UNKNOWN_INST 0000 0008 01 000000 ]) @@ -474,7 +514,87 @@ AT_CAPTURE_FILE([expout]) AT_CAPTURE_FILE([experr]) AT_CHECK( - [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-instructions < input.txt], + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-instructions OpenFlow11 < input.txt], + [0], [expout], [experr]) +AT_CLEANUP + +dnl Our primary goal here is to verify OpenFlow 1.2-specific changes, +dnl so the list of tests is short. +AT_SETUP([OpenFlow 1.2 action translation]) +AT_KEYWORDS([ofp-actions OF1.2]) +AT_DATA([test-data], [dnl +# actions=LOCAL +0000 0010 fffffffe 04d2 000000000000 + +# bad OpenFlow12 actions: OFPBAC_BAD_SET_MASK +& ofp_actions|WARN|bad action at offset 0 (OFPBAC_BAD_SET_MASK): +& 00000000 00 19 00 18 80 00 09 0c-00 00 00 00 12 34 00 00 +& 00000010 00 00 ff ff 00 00 00 00- +0019 0018 8000090c 000000001234 00000000ffff 00000000 + +]) +sed '/^[[#&]]/d' < test-data > input.txt +sed -n 's/^# //p; /^$/p' < test-data > expout +sed -n 's/^& //p' < test-data > experr +AT_CAPTURE_FILE([input.txt]) +AT_CAPTURE_FILE([expout]) +AT_CAPTURE_FILE([experr]) +AT_CHECK( + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow12 < input.txt], + [0], [expout], [experr]) +AT_CLEANUP + +dnl Our primary goal here is to verify OpenFlow 1.3-specific changes, +dnl so the list of tests is short. +AT_SETUP([OpenFlow 1.3 action translation]) +AT_KEYWORDS([ofp-actions OF1.3]) +AT_DATA([test-data], [dnl +# actions=LOCAL +0000 0010 fffffffe 04d2 000000000000 + +dnl Check the Nicira extension form of "move". +# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[] +ffff 0018 00002320 0006 0010 0000 0000 00000002 00000802 + +dnl Check the ONF extension form of "copy_field". +# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[] +ffff 0020 4f4e4600 0c80 0000 0010 0000 0000 0000 00000002 00000802 00000000 + +]) +sed '/^[[#&]]/d' < test-data > input.txt +sed -n 's/^# //p; /^$/p' < test-data > expout +sed -n 's/^& //p' < test-data > experr +AT_CAPTURE_FILE([input.txt]) +AT_CAPTURE_FILE([expout]) +AT_CAPTURE_FILE([experr]) +AT_CHECK( + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow13 < input.txt], + [0], [expout], [experr]) +AT_CLEANUP + +dnl Our primary goal here is to verify that OpenFlow 1.5-specific changes, +dnl so the list of tests is short. +AT_SETUP([OpenFlow 1.5 action translation]) +AT_KEYWORDS([ofp-actions OF1.5]) +AT_DATA([test-data], [dnl +# actions=LOCAL +0000 0010 fffffffe 04d2 000000000000 + +# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[] +001c 0018 0010 0000 0000 0000 00000002 00000802 00000000 + +# actions=set_field:00:00:00:00:12:34/00:00:00:00:ff:ff->eth_src +0019 0018 8000090c 000000001234 00000000ffff 00000000 + +]) +sed '/^[[#&]]/d' < test-data > input.txt +sed -n 's/^# //p; /^$/p' < test-data > expout +sed -n 's/^& //p' < test-data > experr +AT_CAPTURE_FILE([input.txt]) +AT_CAPTURE_FILE([expout]) +AT_CAPTURE_FILE([experr]) +AT_CHECK( + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow15 < input.txt], [0], [expout], [experr]) AT_CLEANUP @@ -489,3 +609,18 @@ ]) OVS_VSWITCHD_STOP AT_CLEANUP + +AT_SETUP([reg_load <-> set_field translation corner case]) +AT_KEYWORDS([ofp-actions]) +OVS_VSWITCHD_START +dnl In OpenFlow 1.3, set_field always sets all the bits in the field, +dnl but when we translate to NXAST_LOAD we need to only set the bits that +dnl actually exist (e.g. mpls_label only has 20 bits) otherwise OVS rejects +dnl the "load" action as invalid. Check that we do this correctly. +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 mpls,actions=set_field:10-\>mpls_label]) +AT_CHECK([ovs-ofctl -O OpenFlow10 dump-flows br0 | ofctl_strip], [0], [dnl +NXST_FLOW reply: + mpls actions=load:0xa->OXM_OF_MPLS_LABEL[[]] +]) +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ofp-errors.at openvswitch-2.4.0~git20150623/tests/ofp-errors.at --- openvswitch-2.3.1/tests/ofp-errors.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ofp-errors.at 2015-06-23 18:46:21.000000000 +0000 @@ -80,6 +80,16 @@ ]) AT_CLEANUP +AT_SETUP([OFPT_ERROR with type OFPBIC_DUP_INST - OF1.4]) +AT_KEYWORDS([ofp-print ofp-errors]) +AT_CHECK([ovs-ofctl ofp-print 0501001400000000000300090206ccddeeff0011], [0], [dnl +OFPT_ERROR (OF1.4) (xid=0x0): OFPBIC_DUP_INST +OFPT_FEATURES_REPLY (OF1.1) (xid=0xeeff0011): +(***truncated to 8 bytes from 52445***) +00000000 02 06 cc dd ee ff 00 11- |........ | +]) +AT_CLEANUP + dnl OF1.1 had OFPBIC_UNSUP_EXP_INST as 3,5. dnl OF1.2 broke it into OFPBIC_BAD_EXPERIMENTER as 3,5 dnl and OFPBIC_BAD_EXT_TYPE as 3,6. @@ -153,10 +163,29 @@ OFPT_ERROR (OF1.2) (xid=0x55555555): NXBRC_MUST_BE_ZERO OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload ]) + +AT_CHECK([ovs-ofctl ofp-print '0301001812345678 ffff0a28 4f4e4600 0300000812345678'], [0], [dnl +OFPT_ERROR (OF1.2) (xid=0x12345678): OFPBIC_DUP_INST +OFPT_HELLO (OF1.2) (xid=0x12345678): + version bitmap: 0x01, 0x02, 0x03 +]) +AT_CHECK([ovs-ofctl ofp-print '0401001812345678 ffff0a28 4f4e4600 0400000812345678'], [0], [dnl +OFPT_ERROR (OF1.3) (xid=0x12345678): OFPBIC_DUP_INST +OFPT_HELLO (OF1.3) (xid=0x12345678): + version bitmap: 0x01, 0x02, 0x03, 0x04 +]) +AT_CHECK([ovs-ofctl ofp-print '0501001412345678 00030009 0500000812345678'], [0], [dnl +OFPT_ERROR (OF1.4) (xid=0x12345678): OFPBIC_DUP_INST +OFPT_HELLO (OF1.4) (xid=0x12345678): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05 +]) AT_CLEANUP AT_SETUP([encoding experimenter errors]) AT_KEYWORDS([ofp-print ofp-errors]) +# Demonstrate that a Nicira extension error gets encoded correctly +# using the Nicira error extension format in OF1.0 and OF1.1, and +# correctly using the standard experimenter format in OF1.2. AT_CHECK( [ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0100000812345678], [0], [dnl 00000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 @&t@ @@ -172,4 +201,32 @@ 00000000 03 01 00 18 12 34 56 78-ff ff 00 04 00 00 23 20 @&t@ 00000010 03 00 00 08 12 34 56 78- ]) + +# Check that OFPERR_OFPBIC_DUP_INST is: +# - not encodable in OF1.0 (OF1.0 doesn't have instructions, after all). +# - encoded as a Nicira extension in OF1.1. +# - encoded as an ONF extension in OF1.2 and OF1.3. +# - encoded in the standard form in OF1.4. +AT_CHECK( + [ovs-ofctl '-vPATTERN:console:%c|%p|%m' encode-error-reply OFPBIC_DUP_INST 0100000812345678], [0], [dnl +00000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 @&t@ +00000010 00 01 02 09 01 00 00 08-12 34 56 78 @&t@ +], [ofp_errors|ERR|cannot encode OFPBIC_DUP_INST for OpenFlow 1.0 +]) +AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0200000812345678], [0], +[00000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 @&t@ +00000010 00 03 01 00 02 00 00 08-12 34 56 78 @&t@ +]) +AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0300000812345678], [0], +[00000000 03 01 00 18 12 34 56 78-ff ff 0a 28 4f 4e 46 00 @&t@ +00000010 03 00 00 08 12 34 56 78- +]) +AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0400000812345678], [0], +[00000000 04 01 00 18 12 34 56 78-ff ff 0a 28 4f 4e 46 00 @&t@ +00000010 04 00 00 08 12 34 56 78- +]) +AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0500000812345678], [0], +[00000000 05 01 00 14 12 34 56 78-00 03 00 09 05 00 00 08 @&t@ +00000010 12 34 56 78 @&t@ +]) AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ofp-print.at openvswitch-2.4.0~git20150623/tests/ofp-print.at --- openvswitch-2.3.1/tests/ofp-print.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ofp-print.at 2015-06-23 18:46:21.000000000 +0000 @@ -203,7 +203,7 @@ OFPT_FEATURES_REPLY (xid=0x1): dpid:0000505400000001 n_tables:2, n_buffers:256 capabilities: FLOW_STATS TABLE_STATS PORT_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE +actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst 1(eth1): addr:50:54:00:00:00:02 config: 0 state: 0 @@ -447,7 +447,7 @@ 50 02 02 00 26 e8 00 00 00 00 00 00 00 00 \ "], [0], [dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 (via no_match) data_len=60 buffer=0x00000111 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=0x002 tcp_csum:26e8 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=syn tcp_csum:26e8 ]) AT_CLEANUP @@ -461,7 +461,7 @@ 50 10 02 00 26 e8 00 00 00 00 00 00 00 00 \ " 3], [0], [dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 (via no_match) data_len=60 buffer=0x00000111 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=0x010 tcp_csum:26e8 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=ack tcp_csum:26e8 00000000 50 54 00 00 00 06 50 54-00 00 00 05 08 00 45 00 00000010 00 28 bd 12 00 00 40 06-3c 6a c0 a8 00 01 c0 a8 00000020 00 02 27 2f 00 00 78 50-cc 5b 57 af 42 1e 50 10 @@ -480,7 +480,7 @@ 50 02 02 00 26 e8 00 00 00 00 00 00 00 00 \ "], [0], [dnl OFPT_PACKET_IN (OF1.1) (xid=0x0): total_len=60 in_port=3 (via no_match) data_len=60 buffer=0x00000111 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=0x002 tcp_csum:26e8 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=syn tcp_csum:26e8 ]) AT_CLEANUP @@ -494,7 +494,7 @@ 00 00 00 23 20 83 c1 5f 00 00 00 00 \ "], [0], [dnl OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=1,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f +rarp,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=1,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f ]) AT_CLEANUP @@ -508,7 +508,7 @@ 00 00 00 23 20 83 c1 5f 00 00 00 00 \ " 3], [0], [dnl OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f +rarp,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f 00000000 ff ff ff ff ff ff 00 23-20 83 c1 5f 80 35 00 01 00000010 08 00 06 04 00 03 00 23-20 83 c1 5f 00 00 00 00 00000020 00 23 20 83 c1 5f 00 00-00 00 @@ -526,7 +526,37 @@ 00 00 00 00 \ "], [0], [dnl OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f +rarp,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f +]) +AT_CLEANUP + +AT_SETUP([OFPT_PACKET_IN - OF1.4]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +05 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \ +01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \ +ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \ +00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \ +00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \ +00 00 00 00 \ +"], [0], [dnl +OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 +rarp,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f +]) +AT_CLEANUP + +AT_SETUP([OFPT_PACKET_IN - OF1.5]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +06 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \ +01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \ +ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \ +00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \ +00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \ +00 00 00 00 \ +"], [0], [dnl +OFPT_PACKET_IN (OF1.5) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 +rarp,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f ]) AT_CLEANUP @@ -541,7 +571,7 @@ 00 00 00 00 \ " 3], [0], [dnl OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f +rarp,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f 00000000 ff ff ff ff ff ff 00 23-20 83 c1 5f 80 35 00 01 00000010 08 00 06 04 00 03 00 23-20 83 c1 5f 00 00 00 00 00000020 00 23 20 83 c1 5f 00 00-00 00 @@ -666,7 +696,7 @@ 00 00 00 00 \ "], [0], [dnl OFPT_PACKET_OUT (xid=0x0): in_port=1 actions=output:3 data_len=60 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=0x014 tcp_csum:6d75 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=rst|ack tcp_csum:6d75 ]) AT_CLEANUP @@ -681,7 +711,7 @@ 00 00 00 00 \ " 3], [0], [dnl OFPT_PACKET_OUT (xid=0x0): in_port=1 actions=output:3 data_len=60 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=0x014 tcp_csum:6d75 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=rst|ack tcp_csum:6d75 00000000 50 54 00 00 00 05 50 54-00 00 00 06 08 00 45 00 00000010 00 28 00 00 40 00 40 06-b9 7c c0 a8 00 02 c0 a8 00000020 00 01 00 00 2b 60 00 00-00 00 6a 4f 2b 58 50 14 @@ -712,7 +742,7 @@ 00 00 00 00 \ "], [0], [dnl OFPT_PACKET_OUT (OF1.2) (xid=0x8858dfc5): in_port=LOCAL actions=FLOOD data_len=60 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=0x014 tcp_csum:6d75 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=rst|ack tcp_csum:6d75 ]) AT_CLEANUP @@ -890,6 +920,37 @@ ]) AT_CLEANUP +AT_SETUP([OFPT_FLOW_MOD - OF1.2 - experimenter OXM]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ +03 0e 00 48 52 33 45 07 00 00 00 00 00 00 00 00 \ +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \ +ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ +00 01 00 14 ff ff 01 0c 00 00 23 20 01 23 45 67 \ +0f ff ff ff 00 00 00 00 +" 2], [0], [dnl +OFPT_FLOW_MOD (OF1.2) (xid=0x52334507): ADD priority=255,dp_hash=0x1234567/0xfffffff actions=drop +], [dnl +]) +AT_CLEANUP + +AT_SETUP([OFPT_FLOW_MOD - OF1.2 - set-field nd_target, nd_sll]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ +03 0e 00 78 00 00 00 02 00 00 00 00 00 00 00 00 \ +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \ +ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ +00 01 00 14 80 00 0a 02 86 dd 80 00 14 01 3a 80 \ +00 3a 01 87 00 00 00 00 00 04 00 30 00 00 00 00 \ +00 19 00 18 80 00 3e 10 00 00 00 00 00 00 00 00 \ +00 00 00 00 00 00 00 01 00 19 00 10 80 00 40 06 \ +aa aa aa aa aa aa 00 00 +" 2], [0], [dnl +OFPT_FLOW_MOD (OF1.2) (xid=0x2): ADD priority=255,icmp6,icmp_type=135 actions=set_field:::1->nd_target,set_field:aa:aa:aa:aa:aa:aa->nd_sll +], [dnl +]) +AT_CLEANUP + dnl This triggered a buggy "instructions out of order" message earlier. AT_SETUP([OFPT_FLOW_MOD - OF1.3 - meter]) AT_KEYWORDS([ofp-print]) @@ -1057,13 +1118,12 @@ ]) AT_CLEANUP -# ofp_table_mod.config is actually "reserved for future use" in OF1.3. AT_SETUP([OFPT_TABLE_MOD - OF1.3]) AT_KEYWORDS([ofp-print]) AT_CHECK([ovs-ofctl ofp-print "\ 04 11 00 10 00 00 00 02 02 00 00 00 00 00 00 00 \ " 3], [0], [dnl -OFPT_TABLE_MOD (OF1.3) (xid=0x2): table_id=2, flow_miss_config=controller +OFPT_TABLE_MOD (OF1.3) (xid=0x2): table_id=2 ]) AT_CLEANUP @@ -1072,7 +1132,7 @@ AT_CHECK([ovs-ofctl ofp-print "\ 05 11 00 10 00 00 00 02 02 00 00 00 00 00 00 00 \ " 3], [0], [dnl -OFPT_TABLE_MOD (OF1.4) (xid=0x2): table_id=2, flow_miss_config=controller +OFPT_TABLE_MOD (OF1.4) (xid=0x2): table_id=2 ]) AT_CLEANUP @@ -1384,34 +1444,85 @@ 00 3f ff ff 00 10 00 00 00 00 00 0b 00 00 00 00 \ 00 00 00 00 00 00 00 00 00 00 00 00 \ "], [0], [dnl -OFPST_TABLE reply (xid=0x1): 1 tables - 0: classifier: wild=0x3fffff, max=1048576, active=11 - lookup=0, matched=0 +OFPST_TABLE reply (xid=0x1): + table 0 ("classifier"): + active=11, lookup=0, matched=0 + max_entries=1048576 + matching: + in_port: exact match or wildcard + eth_src: exact match or wildcard + eth_dst: exact match or wildcard + eth_type: exact match or wildcard + vlan_vid: exact match or wildcard + vlan_pcp: exact match or wildcard + ip_src: exact match or wildcard + ip_dst: exact match or wildcard + nw_proto: exact match or wildcard + nw_tos: exact match or wildcard + tcp_src: exact match or wildcard + tcp_dst: exact match or wildcard ]) AT_CLEANUP AT_SETUP([OFPST_TABLE reply - OF1.2]) AT_KEYWORDS([ofp-print OFPT_STATS_REPLY]) -(mid="wild=0xfffffffff, max=1000000," - tail=" - match=0xfffffffff, instructions=0x00000007, config=0x00000000 - write_actions=0x00000000, apply_actions=0x00000000 - write_setfields=0x0000000fffffffff - apply_setfields=0x0000000fffffffff - metadata_match=0x0000000000000000 - metadata_write=0x0000000000000000" - echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 255 tables - 0: classifier: $mid active=1 - lookup=74614, matched=106024$tail" +(tail=" + config=controller + max_entries=1000000 + instructions (table miss and others): + instructions: write_metadata,goto_table + Write-Actions and Apply-Actions features: + supported on Set-Field: metadata in_port_oxm eth_src eth_dst eth_type vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_proto ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll + matching: + metadata: exact match or wildcard + in_port_oxm: exact match or wildcard + eth_src: exact match or wildcard + eth_dst: exact match or wildcard + eth_type: exact match or wildcard + vlan_vid: exact match or wildcard + vlan_pcp: exact match or wildcard + mpls_label: exact match or wildcard + mpls_tc: exact match or wildcard + ip_src: exact match or wildcard + ip_dst: exact match or wildcard + ipv6_src: exact match or wildcard + ipv6_dst: exact match or wildcard + ipv6_label: exact match or wildcard + nw_proto: exact match or wildcard + ip_dscp: exact match or wildcard + nw_ecn: exact match or wildcard + arp_op: exact match or wildcard + arp_spa: exact match or wildcard + arp_tpa: exact match or wildcard + arp_sha: exact match or wildcard + arp_tha: exact match or wildcard + tcp_src: exact match or wildcard + tcp_dst: exact match or wildcard + udp_src: exact match or wildcard + udp_dst: exact match or wildcard + sctp_src: exact match or wildcard + sctp_dst: exact match or wildcard + icmp_type: exact match or wildcard + icmp_code: exact match or wildcard + icmpv6_type: exact match or wildcard + icmpv6_code: exact match or wildcard + nd_target: exact match or wildcard + nd_sll: exact match or wildcard + nd_tll: exact match or wildcard" + echo "OFPST_TABLE reply (OF1.2) (xid=0x2): + table 0 (\"classifier\"): + active=1, lookup=74614, matched=106024$tail" x=1 while test $x -lt 254; do - printf " %d: %-8s: $mid active=0 - lookup=0, matched=0$tail + printf " + table %d (\"%s\"): + active=0, lookup=0, matched=0$tail " $x table$x x=`expr $x + 1` done - echo " 254: table254: $mid active=2 - lookup=0, matched=0$tail") > expout + echo " + table 254 (\"table254\"): + active=2, lookup=0, matched=0$tail") > expout (pad32="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" pad7="00 00 00 00 00 00 00 " @@ -1442,7 +1553,7 @@ printf "%02x $pad7" $x printf "%s$pad32" "table$x" | od -A n -t x1 -v -N 32 | tr '\n' ' ' echo -n "$mid 00 00 00 02 $tail") > in -AT_CHECK([ovs-ofctl ofp-print "$(cat in)"], [0], [expout]) +AT_CHECK([ovs-ofctl ofp-print - < in], [0], [expout]) AT_CLEANUP AT_SETUP([OFPST_TABLE reply - OF1.3]) @@ -1453,9 +1564,12 @@ 00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 0c \ 00 00 00 00 00 00 02 01 00 00 00 00 00 00 01 01 \ "], [0], [dnl -OFPST_TABLE reply (OF1.3) (xid=0x1): 2 tables - 0: active=11, lookup=512, matched=256 - 1: active=12, lookup=513, matched=257 +OFPST_TABLE reply (OF1.3) (xid=0x1): + table 0: + active=11, lookup=512, matched=256 + + table 1: + active=12, lookup=513, matched=257 ]) AT_CLEANUP @@ -1892,7 +2006,7 @@ ]) AT_CLEANUP -AT_SETUP([OFPST_GROUP_DESC reply]) +AT_SETUP([OFPST_GROUP_DESC reply - OF1.1]) AT_KEYWORDS([ofp-print OFPT_STATS_REQUEST]) AT_CHECK([ovs-ofctl ofp-print "\ 02 13 00 78 00 00 00 02 00 07 00 00 00 00 00 00 \ @@ -1909,6 +2023,31 @@ ]) AT_CLEANUP +AT_SETUP([OFPST_GROUP_DESC reply - OF1.5]) +AT_KEYWORDS([ofp-print OFPT_STATS_REPLY]) +AT_CHECK([ovs-ofctl ofp-print "\ +06 13 00 d8 00 00 00 02 00 07 00 00 00 00 00 00 \ +00 88 01 00 00 00 20 00 00 78 00 00 00 00 00 00 \ +00 28 00 10 00 00 00 00 00 00 00 10 00 00 00 01 \ +00 00 00 00 00 00 00 00 00 00 00 08 00 64 00 00 \ +00 01 00 08 00 00 00 01 \ +00 28 00 10 00 00 00 01 00 00 00 10 00 00 00 02 \ +00 00 00 00 00 00 00 00 00 00 00 08 00 c8 00 00 \ +00 01 00 08 00 00 00 02 \ +00 28 00 10 00 00 00 02 00 00 00 10 00 00 00 03 \ +00 00 00 00 00 00 00 00 00 00 00 08 00 c8 00 00 \ +00 01 00 08 00 00 00 03 \ +ff ff 00 3b 00 00 15 40 00 00 00 01 00 00 00 00 \ +68 61 73 68 00 00 00 00 00 00 00 00 00 00 00 00 \ +00 00 00 00 00 00 00 00 \ +80 00 18 04 ff ff ff 00 80 00 1a 02 ff ff 80 00 \ +14 01 ff 00 00 00 00 00 \ +"], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5) (xid=0x2): + group_id=8192,type=select,selection_method=hash,fields=ip_dst=255.255.255.0,nw_proto,tcp_src,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3 +]) +AT_CLEANUP + AT_SETUP([OFPST_GROUP_FEATURES request]) AT_KEYWORDS([ofp-print OFPT_STATS_REQUEST]) AT_CHECK([ovs-ofctl ofp-print "\ @@ -1923,20 +2062,24 @@ 03 13 00 38 00 00 00 02 00 08 00 00 00 00 00 00 \ 00 00 00 0f 00 00 00 0f \ 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 \ -00 00 00 01 00 00 00 03 00 00 00 07 00 00 00 0f \ +00 00 00 01 00 02 00 01 00 06 00 01 00 0e 00 01 \ "], [0], [dnl OFPST_GROUP_FEATURES reply (OF1.2) (xid=0x2): Group table: Types: 0xf Capabilities: 0xf - All group : - max_groups = 0x1 actions=0x00000001 - Select group : - max_groups = 0x2 actions=0x00000003 - Indirect group : - max_groups = 0x3 actions=0x00000007 - Fast Failover group : - max_groups = 0x4 actions=0x0000000f + all group: + max_groups=0x1 + actions: output + select group: + max_groups=0x2 + actions: output push_vlan + indirect group: + max_groups=0x3 + actions: output strip_vlan push_vlan + fast failover group: + max_groups=0x4 + actions: output strip_vlan push_vlan push_mpls ]) AT_CLEANUP @@ -2266,17 +2409,15 @@ 80 00 30 06 80 00 32 06 80 00 1a 02 80 00 1c 02 \ 80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \ "], [0], [OFPST_TABLE_FEATURES reply (OF1.3) (xid=0xd5): - table 0: - name="table0" + table 0 ("table0"): metadata: match=0xffffffffffffffff write=0xffffffffffffffff - config=Unknown max_entries=1000000 instructions (table miss and others): next tables: 1-253 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table Write-Actions and Apply-Actions features: - actions: output,copy_ttl_out,copy_ttl_in,set_mpls_ttl,dec_mpls_ttl,push_vlan,pop_vlan,push_mpls,pop_mpls,set_queue,group,set_nw_ttl,dec_nw_ttl,set_field,push_pbb,pop_pbb - supported on Set-Field: tun_id,tun_src,tun_dst,metadata,in_port,in_port_oxm,pkt_mark,reg0,reg1,reg2,reg3,reg4,reg5,reg6,reg7,eth_src,eth_dst,vlan_tci,vlan_vid,vlan_pcp,mpls_label,mpls_tc,ip_src,ip_dst,ipv6_src,ipv6_dst,nw_tos,ip_dscp,nw_ecn,nw_ttl,arp_op,arp_spa,arp_tpa,arp_sha,arp_tha,tcp_src,tcp_dst,udp_src,udp_dst,sctp_src,sctp_dst + actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue + supported on Set-Field: tun_id tun_src tun_dst metadata in_port in_port_oxm pkt_mark reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst matching: tun_id: exact match or wildcard tun_src: exact match or wildcard @@ -2561,8 +2702,8 @@ 00 55 00 56 00 00 00 00 00 00 00 00 50 02 00 00 \ 31 6d 00 00 00 00 00 00 00 00 \ "], [0], [dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 metadata=0x5a5a5a5a5a5a5a5a reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86,tcp_flags=0x002 tcp_csum:316d +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,metadata=0x5a5a5a5a5a5a5a5a,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86,tcp_flags=syn tcp_csum:316d ]) AT_CLEANUP @@ -2582,8 +2723,8 @@ 00 55 00 56 00 00 00 00 00 00 00 00 50 01 00 00 \ 31 6d 00 00 00 00 00 00 00 00 \ " 3], [0], [dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 metadata=0x5a5a5a5a5a5a5a5a reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86,tcp_flags=0x001 tcp_csum:316d +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,metadata=0x5a5a5a5a5a5a5a5a,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d 00000000 82 82 82 82 82 82 80 81-81 81 81 81 81 00 00 50 00000010 08 00 45 00 00 28 00 00-00 00 00 06 32 05 53 53 00000020 53 53 54 54 54 54 00 55-00 56 00 00 00 00 00 00 @@ -2690,7 +2831,7 @@ ]) AT_CLEANUP -AT_SETUP([OFPT_GROUP_MOD]) +AT_SETUP([OFPT_GROUP_MOD - OF1.1]) AT_KEYWORDS([ofp-print]) AT_CHECK([ovs-ofctl ofp-print "\ 02 0f 00 70 11 22 33 44 00 00 01 00 87 65 43 21 \ @@ -2706,6 +2847,45 @@ ]) AT_CLEANUP +AT_SETUP([OFPT_GROUP_MOD add - OF1.5]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +06 0f 00 b8 11 22 33 44 00 00 01 00 87 65 43 21 \ +00 78 00 00 ff ff ff ff 00 28 00 10 00 00 00 00 \ +00 00 00 10 00 00 00 01 00 00 00 00 00 00 00 00 \ +00 00 00 08 00 64 00 00 00 01 00 08 00 00 00 01 \ +00 28 00 10 00 00 00 01 00 00 00 10 00 00 00 02 \ +00 00 00 00 00 00 00 00 00 00 00 08 00 c8 00 00 \ +00 01 00 08 00 00 00 02 00 28 00 10 00 00 00 02 \ +00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ +00 00 00 08 00 c8 00 00 00 01 00 08 00 00 00 03 \ +ff ff 00 28 00 00 15 40 00 00 00 01 00 00 00 00 \ +68 61 73 68 00 00 00 00 00 00 00 00 00 00 00 00 \ +00 00 00 00 00 00 00 07 \ +"], [0], [dnl +OFPT_GROUP_MOD (OF1.5) (xid=0x11223344): + ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3 +]) +AT_CLEANUP + +AT_SETUP([OFPT_GROUP_MOD insert bucket - OF1.5]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +06 0f 00 90 11 22 33 44 00 03 01 00 87 65 43 21 \ +00 78 00 00 ff ff ff fd 00 28 00 10 00 00 00 00 \ +00 00 00 10 00 00 00 01 00 00 00 00 00 00 00 00 \ +00 00 00 08 00 64 00 00 00 01 00 08 00 00 00 01 \ +00 28 00 10 00 00 00 01 00 00 00 10 00 00 00 02 \ +00 00 00 00 00 00 00 00 00 00 00 08 00 c8 00 00 \ +00 01 00 08 00 00 00 02 00 28 00 10 00 00 00 02 \ +00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ +00 00 00 08 00 c8 00 00 00 01 00 08 00 00 00 03 \ +"], [0], [dnl +OFPT_GROUP_MOD (OF1.5) (xid=0x11223344): + INSERT_BUCKET command_bucket_id:first,group_id=2271560481,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3 +]) +AT_CLEANUP + AT_SETUP([NXT_FLOW_REMOVED]) AT_KEYWORDS([ofp-print]) AT_CHECK([ovs-ofctl ofp-print "\ @@ -3055,16 +3235,59 @@ ]) AT_CLEANUP -AT_SETUP([OFPT_BUNDLE_ADD_MESSAGE - OFPT_HELLO]) +AT_SETUP([OFPT_BUNDLE_ADD_MESSAGE - verify xid]) AT_KEYWORDS([ofp-print]) AT_CHECK([ovs-ofctl ofp-print "\ -05 22 00 20 00 00 00 00 \ -00 00 00 01 00 01 00 01 02 00 00 08 00 00 00 00 \ -00 00 00 00 00 00 00 00 \ +05 22 00 20 00 00 00 00 00 00 00 01 00 00 00 01 \ +02 00 00 08 00 00 00 01 00 00 00 00 00 00 00 00 \ +"], [0], [dnl +OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x0): ***decode error: OFPBFC_MSG_BAD_XID*** +]) +AT_CLEANUP + +AT_SETUP([OFPT_BUNDLE_ADD_MESSAGE - reject OFPT_HELLO]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +05 22 00 20 00 00 00 00 00 00 00 01 00 00 00 01 \ +02 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 \ +"], [0], [dnl +OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x0): ***decode error: OFPBFC_MSG_UNSUP*** +]) +AT_CLEANUP + +AT_SETUP([OFPT_BUNDLE_ADD_MESSAGE - FLOW_MOD]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 01 \ +03 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \ +00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \ +ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ +00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \ +50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \ +80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \ +00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \ +00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \ +00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ "], [0], [dnl -OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x0): +OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x2): bundle_id=0x1 flags=atomic -OFPT_HELLO (OF1.1) (xid=0x0): - version bitmap: 0x01, 0x02 +OFPT_FLOW_MOD (OF1.2) (xid=0x2): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 actions=output:3 +]) +AT_CLEANUP + +AT_SETUP([OFPT_BUNDLE_ADD_MESSAGE - PORT_MOD]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +05 22 00 38 00 00 00 03 00 00 00 01 00 00 00 01 \ +05 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \ +50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \ +00 00 00 08 00 00 00 01 +"], [0], [dnl +OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x3): + bundle_id=0x1 flags=atomic +OFPT_PORT_MOD (OF1.4) (xid=0x3):port: 3: addr:50:54:00:00:00:01 + config: PORT_DOWN + mask: PORT_DOWN + advertise: 10MB-HD ]) AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ofproto.at openvswitch-2.4.0~git20150623/tests/ofproto.at --- openvswitch-2.3.1/tests/ofproto.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ofproto.at 2015-06-23 18:46:21.000000000 +0000 @@ -36,7 +36,7 @@ OFPT_FEATURES_REPLY: dpid:fedcba9876543210 n_tables:254, n_buffers:256 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE +actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst LOCAL(br0): addr:aa:55:aa:55:00:00 config: PORT_DOWN state: LINK_DOWN @@ -58,7 +58,7 @@ OFPT_FEATURES_REPLY: dpid:fedcba9876543210 n_tables:254, n_buffers:256 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE +actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst 1(p1): addr:aa:55:aa:55:00:0x config: PORT_DOWN state: LINK_DOWN @@ -263,17 +263,38 @@ dnl This is really bare-bones. dnl It at least checks request and reply serialization and deserialization. -AT_SETUP([ofproto - del group]) +dnl Actions definition listed in both supported formats (w/ actions=) +AT_SETUP([ofproto - no group support (OpenFlow 1.0)]) OVS_VSWITCHD_START AT_DATA([groups.txt], [dnl group_id=1234,type=all,bucket=output:10 -group_id=1235,type=all,bucket=output:10 +group_id=1235,type=all,bucket=actions=output:10 +]) +AT_DATA([stderr], [dnl +ovs-ofctl: none of the usable flow formats (OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10,NXM) +]) +AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt], [1], ,[stderr]) +AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn mod-group br0 'group_id=1234,type=all,bucket=output:10'], [1], ,[stderr]) +AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [1], ,[stderr]) +AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 ], [1], ,[stderr]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. +dnl Actions definition listed in both supported formats (w/ actions=) +AT_SETUP([ofproto - del group (OpenFlow 1.1)]) +OVS_VSWITCHD_START +AT_DATA([groups.txt], [dnl +group_id=1234,type=all,bucket=output:10 +group_id=1235,type=all,bucket=actions=output:10 ]) AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt]) -AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) +AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 ], [0], [stdout]) AT_CHECK([STRIP_XIDS stdout], [0], [dnl -OFPST_GROUP_DESC reply (OF1.5): +OFPST_GROUP_DESC reply (OF1.1): group_id=1234,type=all,bucket=actions=output:10 + group_id=1235,type=all,bucket=actions=output:10 ]) AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234]) AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout]) @@ -292,6 +313,62 @@ AT_CHECK([STRIP_XIDS stdout], [0], [dnl OFPST_GROUP_DESC reply (OF1.1): ]) + +# Negative test. +AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=0xfffffff0], + [1], [], [ovs-ofctl: invalid group id 4294967280 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. +dnl Actions definition listed in both supported formats (w/ actions=) +AT_SETUP([ofproto - add indirect group]) +OVS_VSWITCHD_START +dnl indirect group must have exactly one bucket +AT_DATA([stderr], [dnl +OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP +OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP*** +]) +AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr]) +AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10']) +AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. +dnl Actions definition listed in both supported formats (w/ actions=) +AT_SETUP([ofproto - del group (OpenFlow 1.5)]) +OVS_VSWITCHD_START +AT_DATA([groups.txt], [dnl +group_id=1234,type=select,selection_method=hash,bucket=output:10,bucket=output:11 +group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) +AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): +]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -337,6 +414,121 @@ dnl This is really bare-bones. dnl It at least checks request and reply serialization and deserialization. +dnl Actions definition listed in both supported formats (w/ actions=) +AT_SETUP([ofproto - insert buckets]) +OVS_VSWITCHD_START +AT_DATA([groups.txt], [dnl +group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) +AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15 +]) +AT_DATA([buckets.txt], [dnl +group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21 +]) + +# Negative tests. +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=0xffffff01,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [], + [ovs-ofctl: invalid command bucket id 4294967041 +]) +AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [], + [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15') +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. +dnl Actions definition listed in both supported formats (w/ actions=) +AT_SETUP([ofproto - remove buckets]) +OVS_VSWITCHD_START +AT_DATA([groups.txt], [dnl +group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) +AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15 +]) +AT_DATA([buckets.txt], [dnl +group_id=1234 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_GROUP_DESC reply (OF1.5): + group_id=1234,type=all +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr]) +AT_CHECK([cat stderr | ofctl_strip], [0], [dnl +OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET +OFPT_GROUP_MOD (OF1.5): + REMOVE_BUCKET command_bucket_id:1,group_id=1234 +]) +# Negative test. +AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [], + [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15') +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. AT_SETUP([ofproto - flow mod checks group availability]) OVS_VSWITCHD_START AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10]) @@ -398,22 +590,26 @@ OFPST_GROUP_FEATURES reply (OF1.2): Group table: Types: 0xf - Capabilities: 0x7 - All group : - max_groups = 0xffffff00 actions=0x03ff9801 - Select group : - max_groups = 0xffffff00 actions=0x00000000 - Indirect group : - max_groups = 0xffffff00 actions=0x00000000 - Fast Failover group : - max_groups = 0xffffff00 actions=0x00000000 + Capabilities: 0x3 + all group: + max_groups=0xffffff00 + actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue + select group: + max_groups=0xffffff00 + actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue + indirect group: + max_groups=0xffffff00 + actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue + fast failover group: + max_groups=0xffffff00 + actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue ]) OVS_VSWITCHD_STOP AT_CLEANUP dnl This is really bare-bones. dnl It at least checks request and reply serialization and deserialization. -AT_SETUP([ofproto - group stats]) +AT_SETUP([ofproto - group stats (OpenFlow 1.1)]) OVS_VSWITCHD_START AT_DATA([groups.txt], [dnl group_id=1234,type=all,bucket=output:10 @@ -435,6 +631,54 @@ OVS_VSWITCHD_STOP AT_CLEANUP +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. +AT_SETUP([ofproto - group stats (OpenFlow 1.3)]) +OVS_VSWITCHD_START +AT_DATA([groups.txt], [dnl +group_id=1234,type=all,bucket=output:10 +group_id=1235,type=all,bucket=output:10 +]) +AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt]) +AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234']) +AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl + group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 +OFPST_GROUP reply (OF1.3): +]) +AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl + group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 + group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 +OFPST_GROUP reply (OF1.3): +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. +AT_SETUP([ofproto - group stats (OpenFlow 1.5)]) +OVS_VSWITCHD_START +AT_DATA([groups.txt], [dnl +group_id=1234,type=all,bucket=output:10 +group_id=1235,type=all,bucket=output:10 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234']) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl + group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 +OFPST_GROUP reply (OF1.5): +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl + group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 + group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 +OFPST_GROUP reply (OF1.5): +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto - mod-port (OpenFlow 1.0)]) OVS_VSWITCHD_START for command_config_state in \ @@ -458,7 +702,7 @@ OFPT_FEATURES_REPLY: dpid:fedcba9876543210 n_tables:254, n_buffers:256 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE +actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst LOCAL(br0): addr:aa:55:aa:55:00:00 config: $config state: $state @@ -489,7 +733,7 @@ AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210 n_tables:254, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS +capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS LOCAL(br0): addr:aa:55:aa:55:00:00 config: $config state: $state @@ -520,7 +764,7 @@ AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210 n_tables:254, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS +capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS OFPST_PORT_DESC reply (OF1.4): LOCAL(br0): addr:aa:55:aa:55:00:00 config: $config @@ -617,7 +861,9 @@ OVS_VSWITCHD_START AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop]) AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src]) +AT_CHECK([ovs-ofctl add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll]) AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + table=1, icmp6,in_port=3,icmp_type=136 actions=load:0xa6badbfff00d59fa->NXM_NX_ND_TARGET[[0..63]],load:0xfe8086753097890a->NXM_NX_ND_TARGET[[64..127]],load:0xccddeeff0011->NXM_NX_ND_TLL[[]] table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]] NXST_FLOW reply: ]) @@ -643,6 +889,19 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)]) +OVS_VSWITCHD_START +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll]) +AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl + table=1, icmp6,in_port=3,icmp_type=136 actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa->nd_target,set_field:cc:dd:ee:ff:00:11->nd_tll + table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src +OFPST_FLOW reply (OF1.2): +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto - dump flows with cookie]) OVS_VSWITCHD_START AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1]) @@ -1035,15 +1294,30 @@ AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)]) OVS_VSWITCHD_START # Check the default configuration. -(echo "OFPST_TABLE reply (xid=0x2): 254 tables - 0: classifier: wild=0x3fffff, max=1000000, active=0 - lookup=0, matched=0" - x=1 +(printf "OFPST_TABLE reply (xid=0x2):" + x=0 + name=classifier while test $x -lt 254; do - printf " %d: %-8s: wild=0x3fffff, max=1000000, active=0 - lookup=0, matched=0 -" $x table$x + printf " + table %d (\"%s\"): + active=0, lookup=0, matched=0 + max_entries=1000000 + matching: + in_port: exact match or wildcard + eth_src: exact match or wildcard + eth_dst: exact match or wildcard + eth_type: exact match or wildcard + vlan_vid: exact match or wildcard + vlan_pcp: exact match or wildcard + ip_src: exact match or wildcard + ip_dst: exact match or wildcard + nw_proto: exact match or wildcard + nw_tos: exact match or wildcard + tcp_src: exact match or wildcard + tcp_dst: exact match or wildcard +" $x $name x=`expr $x + 1` + name=table$x done) > expout AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout]) # Change the configuration. @@ -1058,35 +1332,125 @@ ]) # Check that the configuration was updated. mv expout orig-expout -(echo "OFPST_TABLE reply (xid=0x2): 254 tables - 0: main : wild=0x3fffff, max=1000000, active=0 - lookup=0, matched=0 - 1: table1 : wild=0x3fffff, max= 1024, active=0 - lookup=0, matched=0" - tail -n +6 orig-expout) > expout +sed -e 's/classifier/main/ +21s/1000000/1024/' orig-expout > expout AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout]) OVS_VSWITCHD_STOP AT_CLEANUP +dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't +dnl be visible to OpenFlow. This test checks that "dump-flows" and +dnl "dump-tables" don't make them visible. +AT_SETUP([ofproto - hidden rules not in table stats]) +# Use an IP address for a controller that won't actually exist: we +# want to create in-band rules but we do not want to actually connect +# to a controller (because that could mess about with our test). The +# Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice. +OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653]) +for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done + +# Check that no hidden flows are visible in OpenFlow. +AT_CHECK([ovs-ofctl dump-flows br0], [0], [NXST_FLOW reply (xid=0x4): +]) + +# Check that some hidden flows related to 240.0.0.1 are actually in table 0. +# +# We discard flows that mention table_id because we only want table 0 flows, +# which in OVS is implied by the absence of a table_id. +AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout]) +AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0]) + +# Check that dump-tables doesn't count the hidden flows. +(printf "OFPST_TABLE reply (xid=0x2):" + x=0 + name=classifier + while test $x -lt 254; do + printf " + table %d (\"%s\"): + active=0, lookup=0, matched=0 + max_entries=1000000 + matching: + in_port: exact match or wildcard + eth_src: exact match or wildcard + eth_dst: exact match or wildcard + eth_type: exact match or wildcard + vlan_vid: exact match or wildcard + vlan_pcp: exact match or wildcard + ip_src: exact match or wildcard + ip_dst: exact match or wildcard + nw_proto: exact match or wildcard + nw_tos: exact match or wildcard + tcp_src: exact match or wildcard + tcp_dst: exact match or wildcard +" $x $name + x=`expr $x + 1` + name=table$x + done) > expout +AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout]) +OVS_VSWITCHD_STOP(["/cannot find route for controller/d"]) +AT_CLEANUP + AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)]) OVS_VSWITCHD_START # Check the default configuration. -(mid="wild=0xfffffffff, max=1000000," - tail=" - lookup=0, matched=0 - match=0xfffffffff, instructions=0x00000007, config=0x00000003 - write_actions=0x00000000, apply_actions=0x00000000 - write_setfields=0x0000000fffffffff - apply_setfields=0x0000000fffffffff - metadata_match=0xffffffffffffffff - metadata_write=0xffffffffffffffff" - echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables - 0: classifier: $mid active=0$tail" - x=1 +(printf "OFPST_TABLE reply (OF1.2) (xid=0x2):" + x=0 + name=classifier while test $x -lt 254; do - printf " %d: %-8s: $mid active=0$tail -" $x table$x + if test $x = 253; then + goto= + else + goto=,goto_table + fi + echo " + table $x (\"$name\"): + active=0, lookup=0, matched=0 + metadata: match=0xffffffffffffffff write=0xffffffffffffffff + config=controller + max_entries=1000000 + instructions (table miss and others): + instructions: apply_actions,clear_actions,write_actions,write_metadata$goto + Write-Actions and Apply-Actions features: + actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue + supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst nd_target nd_sll nd_tll + matching: + metadata: exact match or wildcard + in_port_oxm: exact match or wildcard + eth_src: exact match or wildcard + eth_dst: exact match or wildcard + eth_type: exact match or wildcard + vlan_vid: exact match or wildcard + vlan_pcp: exact match or wildcard + mpls_label: exact match or wildcard + mpls_tc: exact match or wildcard + ip_src: exact match or wildcard + ip_dst: exact match or wildcard + ipv6_src: exact match or wildcard + ipv6_dst: exact match or wildcard + ipv6_label: exact match or wildcard + nw_proto: exact match or wildcard + ip_dscp: exact match or wildcard + nw_ecn: exact match or wildcard + arp_op: exact match or wildcard + arp_spa: exact match or wildcard + arp_tpa: exact match or wildcard + arp_sha: exact match or wildcard + arp_tha: exact match or wildcard + tcp_src: exact match or wildcard + tcp_dst: exact match or wildcard + udp_src: exact match or wildcard + udp_dst: exact match or wildcard + sctp_src: exact match or wildcard + sctp_dst: exact match or wildcard + icmp_type: exact match or wildcard + icmp_code: exact match or wildcard + icmpv6_type: exact match or wildcard + icmpv6_code: exact match or wildcard + nd_target: exact match or wildcard + nd_sll: exact match or wildcard + nd_tll: exact match or wildcard" x=`expr $x + 1` + name=table$x done) > expout AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout]) # Change the configuration. @@ -1101,15 +1465,128 @@ ]) # Check that the configuration was updated. mv expout orig-expout -(echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables - 0: main : wild=0xfffffffff, max=1000000, active=0" - tail -n +3 orig-expout | head -7 - echo " 1: table1 : wild=0xfffffffff, max= 1024, active=0" - tail -n +11 orig-expout) > expout +sed 's/classifier/main/ +53s/1000000/1024/' < orig-expout > expout AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout]) OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto - table features (OpenFlow 1.3)]) +OVS_VSWITCHD_START +(x=0 + name=classifier + while test $x -lt 254; do + y=`expr $x + 1` + if test $x = 253; then + next= + goto= + else + goto=,goto_table + if test $x = 252; then + next=' + next tables: 253' + else + next=" + next tables: $y-253" + fi + fi + echo " table $x (\"$name\"): + metadata: match=0xffffffffffffffff write=0xffffffffffffffff + max_entries=1000000 + instructions (table miss and others):$next + instructions: meter,apply_actions,clear_actions,write_actions,write_metadata$goto + Write-Actions and Apply-Actions features: + actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue + supported on Set-Field: tun_id tun_src tun_dst tun_gbp_id tun_gbp_flags metadata in_port in_port_oxm pkt_mark reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst nd_target nd_sll nd_tll + matching: + dp_hash: arbitrary mask + recirc_id: exact match or wildcard + conj_id: exact match or wildcard + tun_id: arbitrary mask + tun_src: arbitrary mask + tun_dst: arbitrary mask + tun_gbp_id: arbitrary mask + tun_gbp_flags: arbitrary mask + metadata: arbitrary mask + in_port: exact match or wildcard + in_port_oxm: exact match or wildcard + actset_output: exact match or wildcard + pkt_mark: arbitrary mask + reg0: arbitrary mask + reg1: arbitrary mask + reg2: arbitrary mask + reg3: arbitrary mask + reg4: arbitrary mask + reg5: arbitrary mask + reg6: arbitrary mask + reg7: arbitrary mask + xreg0: arbitrary mask + xreg1: arbitrary mask + xreg2: arbitrary mask + xreg3: arbitrary mask + eth_src: arbitrary mask + eth_dst: arbitrary mask + eth_type: exact match or wildcard + vlan_tci: arbitrary mask + vlan_vid: arbitrary mask + vlan_pcp: exact match or wildcard + mpls_label: exact match or wildcard + mpls_tc: exact match or wildcard + mpls_bos: exact match or wildcard + ip_src: arbitrary mask + ip_dst: arbitrary mask + ipv6_src: arbitrary mask + ipv6_dst: arbitrary mask + ipv6_label: arbitrary mask + nw_proto: exact match or wildcard + nw_tos: exact match or wildcard + ip_dscp: exact match or wildcard + nw_ecn: exact match or wildcard + nw_ttl: exact match or wildcard + ip_frag: arbitrary mask + arp_op: exact match or wildcard + arp_spa: arbitrary mask + arp_tpa: arbitrary mask + arp_sha: arbitrary mask + arp_tha: arbitrary mask + tcp_src: arbitrary mask + tcp_dst: arbitrary mask + tcp_flags: arbitrary mask + udp_src: arbitrary mask + udp_dst: arbitrary mask + sctp_src: arbitrary mask + sctp_dst: arbitrary mask + icmp_type: exact match or wildcard + icmp_code: exact match or wildcard + icmpv6_type: exact match or wildcard + icmpv6_code: exact match or wildcard + nd_target: arbitrary mask + nd_sll: arbitrary mask + nd_tll: arbitrary mask" + x=$y + name=table$x + done) > expout +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d +/^OFPST_TABLE_FEATURES/d'], [0], [expout]) +# Change the configuration. +AT_CHECK( + [ovs-vsctl \ + -- --id=@t0 create Flow_Table name=main \ + -- --id=@t1 create Flow_Table flow-limit=1024 \ + -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ + | ${PERL} $srcdir/uuidfilt.pl], + [0], [<0> +<1> +]) +# Check that the configuration was updated. +mv expout orig-expout +sed 's/classifier/main/ +77s/1000000/1024/' < orig-expout > expout +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d +/^OFPST_TABLE_FEATURES/d'], [0], [expout]) +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)]) OVS_VSWITCHD_START # Configure a maximum of 4 flows. @@ -1281,7 +1758,7 @@ in_port=5 actions=drop OFPST_FLOW reply (OF1.2): ]) -# In Open Flow 1.2 a mod-flow does not ever add a flow and thus +# In OpenFlow 1.2 a mod-flow does not ever add a flow and thus # has no effect on eviction AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop]) AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal]) @@ -1577,21 +2054,21 @@ ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234' if test X"$1" = X"OFPR_ACTION"; then shift; echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" fi # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234' if test X"$1" = X"OFPR_NO_MATCH"; then shift; echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" fi # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) - ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' + ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' if test X"$1" = X"OFPR_INVALID_TTL"; then shift; echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" +udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" fi # OFPT_PORT_STATUS, OFPPR_ADD @@ -1681,21 +2158,21 @@ ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234' if test X"$1" = X"OFPR_ACTION"; then shift; echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" fi # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' if test X"$1" = X"OFPR_NO_MATCH"; then shift; echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" fi # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) - ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' + ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' if test X"$1" = X"OFPR_INVALID_TTL"; then shift; echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" +udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" fi # OFPT_PORT_STATUS, OFPPR_ADD @@ -1785,21 +2262,21 @@ ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234' if test X"$1" = X"OFPR_ACTION"; then shift; echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" fi # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' if test X"$1" = X"OFPR_NO_MATCH"; then shift; echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" fi # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) - ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' + ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' if test X"$1" = X"OFPR_INVALID_TTL"; then shift; echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" +udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" fi # OFPT_PORT_STATUS, OFPPR_ADD @@ -1826,6 +2303,15 @@ if test X"$1" = X"OFPRR_DELETE"; then shift; echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0" fi + + # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE + ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10 + ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234 + ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234 + if test X"$1" = X"OFPRR_DELETE"; then shift; + echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0" + fi + AT_FAIL_IF([test X"$1" != X]) ovs-appctl -t ovs-ofctl ofctl/barrier @@ -1869,6 +2355,79 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)]) +OVS_VSWITCHD_START +AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile]) +check_async () { + printf '\n\n--- check_async %d ---\n\n\n' $1 + INDEX=$1 + shift + + ovs-appctl -t ovs-ofctl ofctl/barrier + ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log + : > expout + + # Other tests are not working with OF 1.5, and message + # format may change, so leave them out. + + # OFPT_PORT_STATUS, OFPPR_ADD + ovs-vsctl add-port br0 test -- set Interface test type=dummy + if test X"$1" = X"OFPPR_ADD"; then shift; + echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: PORT_DOWN + state: LINK_DOWN + speed: 0 Mbps now, 0 Mbps max" + fi + + # OFPT_PORT_STATUS, OFPPR_MODIFY + ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up + if test X"$1" = X"OFPPR_MODIFY"; then shift; + echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: LINK_DOWN + speed: 0 Mbps now, 0 Mbps max +OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max" + fi + + # OFPT_PORT_STATUS, OFPPR_DELETE + ovs-vsctl del-port br0 test + if test X"$1" = X"OFPPR_DELETE"; then shift; + echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max" + fi + + AT_FAIL_IF([test X"$1" != X]) + + ovs-appctl -t ovs-ofctl ofctl/barrier + echo >>expout "OFPT_BARRIER_REPLY (OF1.5):" + + AT_CHECK( + [[sed ' +s/ (xid=0x[0-9a-fA-F]*)// +s/ *duration.*// +s/00:0.$/00:0x/' < monitor.log]], + [0], [expout]) +} + +# It's a service connection so initially there should be no async messages. +check_async 1 + +# If we don't set this, async messages are not received. +# Set miss_send_len to 128, turning on packet-ins for our service connection. +ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080 +check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE + +# Set-async has changed in OF 1.4 and is not yet implemented. + +ovs-appctl -t ovs-ofctl exit +OVS_VSWITCHD_STOP +AT_CLEANUP + dnl This test checks that the role request/response messaging works dnl and that generation_id is handled properly. AT_SETUP([ofproto - controller role (OpenFlow 1.2)]) @@ -2025,9 +2584,9 @@ AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 OFPT_BARRIER_REPLY: ]) @@ -2058,9 +2617,9 @@ AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 OFPT_BARRIER_REPLY (OF1.2): ]) @@ -2091,9 +2650,9 @@ AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 OFPT_BARRIER_REPLY (OF1.1): ]) @@ -2120,8 +2679,8 @@ ovs-appctl -t ovs-ofctl exit AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl -NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 +NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 OFPT_BARRIER_REPLY: ]) @@ -2140,22 +2699,50 @@ ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log AT_CAPTURE_FILE([monitor.log]) -# Send a packet-out with a load action to set some metadata, and forward to controller -AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), controller' '0001020304050010203040501234']) +# Send a packet-out with a set-field action to set some metadata, and forward to controller +AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234']) # Stop the monitor and check its output. ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl -OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 +OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 OFPT_BARRIER_REPLY (OF1.2): ]) OVS_VSWITCHD_STOP AT_CLEANUP +dnl This test checks that metadata is encoded in packet_in structures, +dnl supported by NXAST. +AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)]) +OVS_VSWITCHD_START + +# Start a monitor listening for packet-ins. +AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile]) +ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080 +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log +AT_CAPTURE_FILE([monitor.log]) + +# Send a packet-out with a couple of set-field action to set some metadata, and forward to controller +AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234']) + +# Stop the monitor and check its output. +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl +OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 +OFPT_BARRIER_REPLY (OF1.3): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + dnl This test checks that tunnel metadata is encoded in packet_in structures. AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)]) OVS_VSWITCHD_START @@ -2175,14 +2762,36 @@ ovs-appctl -t ovs-ofctl exit AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl -OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY tun_id=0x1020304 tun_src=127.0.0.1 tun_dst=192.168.0.1 (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 +OFPT_PACKET_IN (OF1.2): total_len=14 tun_id=0x1020304,tun_src=127.0.0.1,tun_dst=192.168.0.1,in_port=ANY (via action) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 OFPT_BARRIER_REPLY (OF1.2): ]) OVS_VSWITCHD_STOP AT_CLEANUP +m4_divert_push([PREPARE_TESTS]) +# Sorts groups of lines that start with a space, without moving them +# past the nearest line that does not start with a space. +multiline_sort () { + ${PERL} -e ' + use warnings; + use strict; + my @buffer = (); + while () { + if (/^ /) { + push(@buffer, $_); + } else { + print $_ foreach sort(@buffer); + print $_; + @buffer = (); + } + } + print $_ foreach sort(@buffer); +' +} +m4_divert_pop([PREPARE_TESTS]) + AT_SETUP([ofproto - flow monitoring]) AT_KEYWORDS([monitor]) OVS_VSWITCHD_START @@ -2226,24 +2835,7 @@ ovs-ofctl del-flows br0 dl_vlan=123 ovs-ofctl del-flows br0 ovs-appctl -t ovs-ofctl ofctl/barrier -sort=' - # Sorts groups of lines that start with a space, without moving them - # past the nearest line that does not start with a space. - use warnings; - use strict; - my @buffer = (); - while () { - if (/^ /) { - push(@buffer, $_); - } else { - print $_ foreach sort(@buffer); - print $_; - @buffer = (); - } - } - print $_ foreach sort(@buffer); -' -AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | ${PERL} -e "$sort"], [0], +AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0], [NXST_FLOW_MONITOR reply (xid=0x0): event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2 NXST_FLOW_MONITOR reply (xid=0x0): @@ -2311,6 +2903,48 @@ OFPT_BARRIER_REPLY: ]) +# Check that our own changes are reported as full updates. +ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log +ovs-ofctl add-flow br0 in_port=1,actions=output:2 +ovs-ofctl add-flow br0 in_port=2,actions=output:1 +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000 +ovs-appctl -t ovs-ofctl ofctl/barrier +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply: +]) +AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0], +[NXST_FLOW_MONITOR reply (xid=0x0): + event=ADDED table=0 cookie=0 in_port=1 actions=output:2 +NXST_FLOW_MONITOR reply (xid=0x0): + event=ADDED table=0 cookie=0 in_port=2 actions=output:1 +OFPT_BARRIER_REPLY: +send: OFPT_FLOW_MOD: DEL priority=0 actions=drop +NXST_FLOW_MONITOR reply (xid=0x0): + event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2 + event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1 +OFPT_BARRIER_REPLY: +]) + +ovs-appctl -t ovs-ofctl exit +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - flow monitoring with !own]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1 + +# Start a monitor watching the flow table and check the initial reply. +ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) +ovs-appctl -t ovs-ofctl ofctl/barrier +AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], + [NXST_FLOW_MONITOR reply: + event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1 +OFPT_BARRIER_REPLY: +]) + # Check that our own changes are reported as abbreviations. ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log ovs-ofctl add-flow br0 in_port=1,actions=output:2 @@ -2336,6 +2970,58 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto - flow monitoring with out_port]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1 +ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1 +ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2 + +# Start a monitor watching the flow table and check the initial reply. +ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) +ovs-appctl -t ovs-ofctl ofctl/barrier +AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], + [NXST_FLOW_MONITOR reply: + event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2 +OFPT_BARRIER_REPLY: +]) + +ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log + +# Add, modify flows and check the updates. +ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop +ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2 +ovs-appctl -t ovs-ofctl ofctl/barrier + +ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2 +ovs-appctl -t ovs-ofctl ofctl/barrier + +ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1 +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2 +ovs-appctl -t ovs-ofctl ofctl/barrier + +AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0], +[NXST_FLOW_MONITOR reply (xid=0x0): + event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2 +OFPT_BARRIER_REPLY: +NXST_FLOW_MONITOR reply (xid=0x0): + event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2 +OFPT_BARRIER_REPLY: +NXST_FLOW_MONITOR reply (xid=0x0): + event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1 +OFPT_BARRIER_REPLY: +NXST_FLOW_MONITOR reply (xid=0x0): + event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2 +OFPT_BARRIER_REPLY: +]) + +ovs-appctl -t ovs-ofctl exit +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto - flow monitoring pause and resume]) AT_KEYWORDS([monitor]) @@ -2494,8 +3180,8 @@ for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do echo ----------------------------------------------------------- echo "Check changing port numbers from $pre to $post" - set_and_check_ofports $pre - set_and_check_ofports $post + set_and_check_specific_ofports $pre + set_and_check_specific_ofports $post done done @@ -2541,13 +3227,13 @@ AT_CAPTURE_FILE([monitor.log]) # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic + bundle_id=0x1 type=OPEN_REQUEST flags=ordered OFPT_BUNDLE_CONTROL (OF1.4): bundle_id=0x1 type=OPEN_REPLY flags=0 OFPT_BARRIER_REPLY (OF1.4): @@ -2565,23 +3251,23 @@ AT_CAPTURE_FILE([monitor.log]) # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [0], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic + bundle_id=0x1 type=OPEN_REQUEST flags=ordered OFPT_BUNDLE_CONTROL (OF1.4): bundle_id=0x1 type=OPEN_REPLY flags=0 OFPT_BARRIER_REPLY (OF1.4): send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic + bundle_id=0x1 type=OPEN_REQUEST flags=ordered OFPT_ERROR (OF1.4): OFPBFC_BAD_ID OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic + bundle_id=0x1 type=OPEN_REQUEST flags=ordered OFPT_BARRIER_REPLY (OF1.4): ]) @@ -2596,16 +3282,16 @@ ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 AT_CAPTURE_FILE([monitor.log]) -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [0], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic + bundle_id=0x1 type=CLOSE_REQUEST flags=ordered OFPT_ERROR (OF1.4): OFPBFC_BAD_ID OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic + bundle_id=0x1 type=CLOSE_REQUEST flags=ordered OFPT_BARRIER_REPLY (OF1.4): ]) @@ -2621,30 +3307,30 @@ AT_CAPTURE_FILE([monitor.log]) # Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [0], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic + bundle_id=0x1 type=OPEN_REQUEST flags=ordered OFPT_BUNDLE_CONTROL (OF1.4): bundle_id=0x1 type=OPEN_REPLY flags=0 OFPT_BARRIER_REPLY (OF1.4): send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic + bundle_id=0x1 type=CLOSE_REQUEST flags=ordered OFPT_BUNDLE_CONTROL (OF1.4): bundle_id=0x1 type=CLOSE_REPLY flags=0 OFPT_BARRIER_REPLY (OF1.4): send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic + bundle_id=0x1 type=CLOSE_REQUEST flags=ordered OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic + bundle_id=0x1 type=CLOSE_REQUEST flags=ordered OFPT_BARRIER_REPLY (OF1.4): ]) @@ -2660,23 +3346,23 @@ AT_CAPTURE_FILE([monitor.log]) # Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [0], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic + bundle_id=0x1 type=OPEN_REQUEST flags=ordered OFPT_BUNDLE_CONTROL (OF1.4): bundle_id=0x1 type=OPEN_REPLY flags=0 OFPT_BARRIER_REPLY (OF1.4): send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=ordered + bundle_id=0x1 type=CLOSE_REQUEST flags=atomic OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=ordered + bundle_id=0x1 type=CLOSE_REQUEST flags=atomic OFPT_BARRIER_REPLY (OF1.4): ]) @@ -2692,16 +3378,16 @@ AT_CAPTURE_FILE([monitor.log]) # Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [0], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=atomic + bundle_id=0x1 type=COMMIT_REQUEST flags=ordered OFPT_ERROR (OF1.4): OFPBFC_BAD_ID OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=atomic + bundle_id=0x1 type=COMMIT_REQUEST flags=ordered OFPT_BARRIER_REPLY (OF1.4): ]) @@ -2717,23 +3403,23 @@ AT_CAPTURE_FILE([monitor.log]) # Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [0], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic + bundle_id=0x1 type=OPEN_REQUEST flags=ordered OFPT_BUNDLE_CONTROL (OF1.4): bundle_id=0x1 type=OPEN_REPLY flags=0 OFPT_BARRIER_REPLY (OF1.4): send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=ordered + bundle_id=0x1 type=COMMIT_REQUEST flags=atomic OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=ordered + bundle_id=0x1 type=COMMIT_REQUEST flags=atomic OFPT_BARRIER_REPLY (OF1.4): ]) @@ -2749,18 +3435,263 @@ AT_CAPTURE_FILE([monitor.log]) # Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01" +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02" ovs-appctl -t ovs-ofctl ofctl/barrier ovs-appctl -t ovs-ofctl exit AT_CHECK([ofctl_strip < monitor.log], [0], [dnl send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=DISCARD_REQUEST flags=atomic + bundle_id=0x1 type=DISCARD_REQUEST flags=ordered OFPT_ERROR (OF1.4): OFPBFC_BAD_ID OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=DISCARD_REQUEST flags=atomic + bundle_id=0x1 type=DISCARD_REQUEST flags=ordered OFPT_BARRIER_REPLY (OF1.4): ]) OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +AT_CHECK([ovs-appctl vlog/set vconn:dbg]) + +AT_CHECK([ovs-ofctl del-flows br0]) + +AT_DATA([flows.txt], [dnl +add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1 +add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2 +add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3 +add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4 +delete +add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5 +add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6 +add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7 +delete in_port=2 dl_src=00:88:99:aa:bb:cc +]) + +AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) + +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5 + idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6 +NXST_FLOW reply: +]) + +AT_DATA([flows.txt], [dnl +modify actions=drop +modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7 +]) + +AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) + +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop + idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 +NXST_FLOW reply: +]) + +# Adding an existing flow acts as a modify, and delete_strict also works. +AT_DATA([flows.txt], [dnl +add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8 +delete_strict in_port=2 dl_src=00:66:77:88:99:aa +add in_port=2 dl_src=00:66:77:88:99:aa actions=drop +]) + +AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) + +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8 + in_port=2,dl_src=00:66:77:88:99:aa actions=drop +NXST_FLOW reply: +]) + +dnl Check logs for OpenFlow trace +# Prevent race. +OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_windows_sub | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3]) +AT_CHECK([print_vconn_debug | vconn_windows_sub | ofctl_strip], [0], [dnl +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO: + version bitmap: 0x01 +vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01) +vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop +vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: +vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO (OF1.4): + version bitmap: 0x01, 0x05 +vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05) +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REPLY flags=0 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REPLY flags=0 +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO: + version bitmap: 0x01 +vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01) +vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm +vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: +vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: +vconn|DBG|unix: received: NXST_FLOW request: +vconn|DBG|unix: sent (Success): NXST_FLOW reply: + idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5 + idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6 +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO (OF1.4): + version bitmap: 0x01, 0x05 +vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05) +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REPLY flags=0 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): MOD actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REPLY flags=0 +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO: + version bitmap: 0x01 +vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01) +vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm +vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: +vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: +vconn|DBG|unix: received: NXST_FLOW request: +vconn|DBG|unix: sent (Success): NXST_FLOW reply: + idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop + idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7 +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO (OF1.4): + version bitmap: 0x01, 0x05 +vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05) +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REPLY flags=0 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REPLY flags=0 +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO: + version bitmap: 0x01 +vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01) +vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm +vconn|DBG|unix: received: OFPT_BARRIER_REQUEST: +vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: +vconn|DBG|unix: received: NXST_FLOW request: +vconn|DBG|unix: sent (Success): NXST_FLOW reply: + idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8 + in_port=2,dl_src=00:66:77:88:99:aa actions=drop +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +AT_CHECK([ovs-ofctl del-flows br0]) + +ovs-ofctl add-flows br0 - <&1 | sed '/|WARN|/d +s/unix:.*br0\.mgmt/unix:br0.mgmt/' | sed 's/(.* error)/(error)/'], +[0], [dnl +OFPT_ERROR (OF1.4) (xid=0xb): OFPBRC_EPERM +OFPT_FLOW_MOD (OF1.4) (xid=0xb): ADD table:254 actions=drop +OFPT_ERROR (OF1.4) (xid=0xd): OFPBFC_MSG_FAILED +OFPT_BUNDLE_CONTROL (OF1.4) (xid=0xd): + bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered +ovs-ofctl: talking to unix:br0.mgmt (error) +]) + +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11 + idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22 + idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33 +NXST_FLOW reply: +]) + +OVS_VSWITCHD_STOP AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ofproto-dpif.at openvswitch-2.4.0~git20150623/tests/ofproto-dpif.at --- openvswitch-2.3.1/tests/ofproto-dpif.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ofproto-dpif.at 2015-06-23 18:46:21.000000000 +0000 @@ -1,60 +1,12 @@ AT_BANNER([ofproto-dpif]) -# Strips out uninteresting parts of flow output, as well as parts -# that vary from one run to another (e.g., timing and bond actions). -m4_define([STRIP_USED], [[sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort]]) -m4_define([STRIP_XOUT], [[sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort]]) -m4_define([FILTER_FLOW_INSTALL], [[ -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq]]) -m4_define([FILTER_FLOW_DUMP], [[ -grep 'flow_dump ' | sed ' - s/.*flow_dump // - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort | uniq]]) - -AT_SETUP([ofproto-dpif - dummy interface]) -# Create br0 with interfaces p1 and p7 -# and br1 with interfaces p2 and p8 -# with p1 and p2 connected via unix domain socket -OVS_VSWITCHD_START( - [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \ - add-br br1 -- \ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ - fail-mode=secure -- \ - add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) - -AT_CHECK([ovs-ofctl add-flow br0 action=normal]) -AT_CHECK([ovs-ofctl add-flow br1 action=normal]) -ovs-appctl time/stop -ovs-appctl time/warp 5000 -AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) -AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) -ovs-appctl time/warp 100 -sleep 1 # wait for forwarders process packets - -AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(2),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -]) +AT_SETUP([ofproto-dpif - revalidator/wait]) +OVS_VSWITCHD_START +AT_CHECK([ovs-appctl revalidator/wait]) OVS_VSWITCHD_STOP AT_CLEANUP -AT_SETUP([ofproto-dpif, active-backup bonding]) +AT_SETUP([ofproto-dpif - active-backup bonding]) # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2 # and br1 with interfaces p3, p4 and p8. # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode. @@ -70,7 +22,8 @@ add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \ add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \ add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +WAIT_FOR_DUMMY_PORTS([p3], [p4]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) AT_CHECK([ovs-ofctl add-flow br0 action=normal]) AT_CHECK([ovs-ofctl add-flow br1 action=normal]) @@ -87,21 +40,20 @@ ovs-appctl time/warp 100 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 +ovs-appctl time/warp 200 100 sleep 1 -AT_CHECK([cat ovs-vswitchd.log | grep 'in_port([[348]])' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:09/00:00:00:00:00:00,tha=50:54:00:00:00:09/00:00:00:00:00:00), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:0b,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:0b/00:00:00:00:00:00,tha=50:54:00:00:00:0b/00:00:00:00:00:00), actions: +AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[348]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl +recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: +recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0d,nw_frag=no, actions: +recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0e,nw_frag=no, actions: +recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=ff:ff:ff:ff:ff:ff, actions: +recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=ff:ff:ff:ff:ff:ff, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP -AT_SETUP([ofproto-dpif, balance-slb bonding]) +AT_SETUP([ofproto-dpif - balance-slb bonding]) # Create br0 with interfaces bond0(p1, p2, p3) and p7, # and br1 with interfaces p4, p5, p6 and p8. # p1 <-> p4, p2 <-> p5, p3 <-> p6 @@ -120,12 +72,11 @@ add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \ add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \ add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --]) - +WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6]) AT_CHECK([ovs-ofctl add-flow br0 action=normal]) AT_CHECK([ovs-ofctl add-flow br1 action=normal]) AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK ]) -ovs-appctl netdev-dummy/set-admin-state up ovs-appctl time/stop ovs-appctl time/warp 100 ( @@ -145,7 +96,7 @@ OVS_VSWITCHD_STOP AT_CLEANUP -AT_SETUP([ofproto-dpif, balance-tcp bonding]) +AT_SETUP([ofproto-dpif - balance-tcp bonding]) # Create br0 with interfaces bond0(p1, p2, p3) and p7, # and br1 with interfaces bond1(p4, p5, p6) and p8. # bond0 <-> bond1 @@ -173,7 +124,7 @@ AT_CHECK([ovs-ofctl add-flow br1 action=normal]) AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled ], []) -sleep 1; +OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"]) ovs-appctl time/stop ovs-appctl time/warp 100 ovs-appctl lacp/show > lacp.txt @@ -181,13 +132,11 @@ ( for i in `seq 0 255` ; do - pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(0x010)" + pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(ack)" AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt]) done ) -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 +ovs-appctl time/warp 300 100 AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt]) AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt]) # Make sure there is resonable distribution to all three ports. @@ -195,6 +144,67 @@ AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24]) AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24]) AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24]) + +OVS_VSWITCHD_STOP() +AT_CLEANUP + +# Makes sure recirculation does not change the way packet is handled. +AT_SETUP([ofproto-dpif - balance-tcp bonding, different recirc flow ]) +OVS_VSWITCHD_START( + [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \ + other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \ + set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \ + set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \ + add-br br1 -- \ + set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ + set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ + fail-mode=standalone -- \ + add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \ + other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \ + set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \ + set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \ + add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \ + add-br br-int -- \ + set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \ + set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \ + fail-mode=secure -- \ + add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \ + add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy +]) +AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK +]) + +# Waits for all ifaces enabled. +OVS_WAIT_UNTIL([test `ovs-appctl bond/show | grep -- "may_enable: true" | wc -l` -ge 4]) + +# The dl_vlan flow should not be ever matched, +# since recirculation should not change the flow handling. +AT_DATA([flows.txt], [dnl +table=0 priority=1 in_port=5 actions=mod_vlan_vid:1,output(101) +table=0 priority=2 in_port=5 dl_vlan=1 actions=drop +]) +AT_CHECK([ovs-ofctl add-flows br-int flows.txt]) + +# Sends a packet to trigger recirculation. +# Should generate recirc_id(0x2),dp_hash(0xc1261ba2/0xff). +AT_CHECK([ovs-appctl netdev-dummy/receive p5 "in_port(5),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1)"]) + +# Collects flow stats. +AT_CHECK([ovs-appctl revalidator/purge], [0]) + +# Checks the flow stats in br1, should only be one flow with non-zero +# 'n_packets' from internal table. +AT_CHECK([ovs-appctl bridge/dump-flows br1 | ofctl_strip | grep -- "n_packets" | grep -- "table_id" | sed -e 's/dp_hash=0x[[0-9a-f]][[0-9a-f]]*/dp_hash=0x0/' -e 's/output:[[0-9]][[0-9]]*/output/'], [0], [dnl +table_id=254, n_packets=1, n_bytes=64, priority=20,recirc_id=0x2,dp_hash=0x0/0xff,actions=output +]) + +# Checks the flow stats in br-int, should be only one match. +AT_CHECK([ovs-ofctl dump-flows br-int | ofctl_strip | sort], [0], [dnl + n_packets=1, n_bytes=60, priority=1,in_port=5 actions=mod_vlan_vid:1,output:101 + priority=2,in_port=5,dl_vlan=1 actions=drop +NXST_FLOW reply: +]) + OVS_VSWITCHD_STOP() AT_CLEANUP @@ -243,8 +253,27 @@ AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128 -Datapath actions: 10,set(ipv4(src=192.168.3.91,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11,set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),13 + [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no +Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND)]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [10], [11], [12], [13]) +AT_DATA([flows.txt], [dnl +table=0 in_port=1,icmp6,icmpv6_type=135 actions=output(10),write_actions(set_field:fe80::3->nd_target,set_field:aa:aa:aa:aa:aa:aa->nd_sll,output(12)),goto_table(1) +table=1 icmp6 actions=write_actions(output(13)),goto_table(2) +table=2 in_port=1,icmp6,icmpv6_type=135 actions=set_field:fe80::4->nd_target,set_field:cc:cc:cc:cc:cc:cc->nd_sll,output(11) +]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt]) +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,icmp6,ipv6_src=fe80::1,ipv6_dst=fe80::2,nw_tos=0,nw_ttl=128,icmpv6_type=135,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11'], [0], [stdout]) +AT_CHECK([tail -4 stdout], [0], + [Megaflow: recirc_id=0,icmp6,in_port=1,nw_frag=no,icmp_type=135,icmp_code=0x0/0xff,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11 +Datapath actions: 10,set(nd(target=fe80::4,sll=cc:cc:cc:cc:cc:cc)),11,set(nd(target=fe80::3,sll=aa:aa:aa:aa:aa:aa)),13 +This flow is handled by the userspace slow path because it: + - Uses action(s) not supported by datapath. ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -259,8 +288,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt]) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=9'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_frag=no,tp_src=8,tp_dst=9 -Datapath actions: 10,set(tcp(src=91,dst=9)),11 + [Megaflow: recirc_id=0,tcp,in_port=1,nw_frag=no,tp_src=8 +Datapath actions: 10,set(tcp(src=91)),11 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -282,9 +311,11 @@ AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11']) AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234']) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) +# Must match on the source address to be able to restore it's value for +# the second bucket AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128 -Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11 + [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no +Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -301,15 +332,29 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - group actions have no effect afterwards]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [10]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=set_field:192.168.3.90->ip_src,output:10']) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234,output:10']) +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2)),10 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto-dpif - all group in action set]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], [1], [10], [11]) AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11']) AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)']) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) +# Must match on the source address to be able to restore it's value for +# the third bucket AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128 -Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11 + [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no +Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -370,6 +415,39 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - select group with hash selection method]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [10], [11]) +AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=hash,fields=eth_dst,bucket=output:10,bucket=output:11']) +AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)']) + +# Try a bunch of different flows and make sure that they get distributed +# at least somewhat. +for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do + AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"], [0], [stdout]) + tail -1 stdout >> results +done +sort results | uniq -c +AT_CHECK([sort results | uniq], [0], + [Datapath actions: 10 +Datapath actions: 11 +]) + +> results +# Try a bunch of different flows and make sure that they are not distributed +# as they only vary a field that is not hashed +for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do + AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:$d,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"], [0], [stdout]) + tail -1 stdout >> results +done +sort results | uniq -c +AT_CHECK([sort results | uniq], [0], + [Datapath actions: 10 +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto-dpif - fast failover group]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], [1], [10], [11]) @@ -382,6 +460,48 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - group stats single bucket]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [10], [11]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0']) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)']) +( +for i in `seq 0 2`; + do + pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)" + AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt]) + done +) +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl + group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=0,byte_count=0 +OFPST_GROUP reply (OF1.2): +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - group stats all buckets]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [10], [11]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11']) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)']) +( +for i in `seq 0 2`; + do + pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)" + AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt]) + done +) +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl + group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=3,byte_count=180 +OFPST_GROUP reply (OF1.2): +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto-dpif - registers]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], [20], [21], [22], [33], [90]) @@ -417,6 +537,122 @@ OVS_VSWITCHD_STOP AT_CLEANUP +dnl Tests that the standardized xregs are mapped onto the legacy OVS registers +dnl in the manner documented in ovs-ofctl(8). +AT_SETUP([ofproto-dpif - extended registers]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [2], [3]) +AT_DATA([flows.txt], [dnl +table=0 actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1) +table=1,reg2=0xfedcba98,reg3=0x76543210 actions=2 + +# These low-priority rules shouldn't match. They're here only to make really +# sure that the test fails if either of the above rules fails to match. +table=0,priority=0 actions=3 +table=1,priority=0 actions=3 +]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - load and move order]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [10], [11]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,move:NXM_NX_REG1[[]]->NXM_OF_IP_SRC[[]],bucket=output:11']) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(load:0xffffffff->NXM_NX_REG1[[]],move:NXM_NX_REG1[[]]->NXM_NX_REG2[[]],group:1234)']) +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) +AT_CHECK([tail -2 stdout], [0], + [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no +Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl Tests that 1.5 copy-field can copy into the standardized xregs. +AT_SETUP([ofproto-dpif - copy-field into extended registers]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [2], [3]) +AT_DATA([flows.txt], [dnl +table=0 actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1) +table=1,xreg0=0x0000505400000005 actions=2 + +# These low-priority rules shouldn't match. They're here only to make really +# sure that the test fails if either of the above rules fails to match. +table=0,priority=0 actions=3 +table=1,priority=0 actions=3 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl Tests that 1.5 set-field with mask in the metadata register. +AT_SETUP([ofproto-dpif - masked set-field into metadata]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [2], [3]) +AT_DATA([flows.txt], [dnl +table=0 actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1) +table=1 actions=set_field:0x6b/0xff->metadata,goto_table(2) +table=2,metadata=0xfafafafa5a5a5a6b actions=2 + +# These low-priority rules shouldn't match. They're here only to make really +# sure that the test fails if either of the above rules fails to match. +table=0,priority=0 actions=3 +table=1,priority=0 actions=3 +table=2,priority=0 actions=3 +]) +AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([ofproto-dpif - actset_output]) +OVS_VSWITCHD_START +ADD_OF_PORTS( + [br0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13]) +AT_DATA([flows.txt], [dnl +table=0,actset_output=unset actions=write_actions(output(2)),goto_table(1) +table=1 actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2) + +# Verify that actset_output got set. +table=2,priority=20,actset_output=2 actions=4,goto_table(3) +table=2,priority=10 actions=5,goto_table(3) + +# Verify that xreg0 got copied properly from actset_output. +table=3,priority=20,xreg0=2 actions=6,goto_table(4) +table=3,priority=10 actions=7,goto_table(4) + +# Verify that adding a group action unsets actset_output. +table=4 actions=write_actions(group(5)),goto_table(5) +table=5,priority=20,actset_output=unset actions=8,goto_table(6) +table=5,priority=10 actions=9,goto_table(6) + +# Verify that adding another output action doesn't change actset_output +# (since there's still a group). +table=6 actions=write_actions(output(3)),goto_table(7) +table=7,priority=20,actset_output=unset actions=10,goto_table(8) +table=7,priority=10 actions=11,goto_table(8) + +# Verify that clearing the action set, then writing an output action, +# causes actset_output to be set again. +table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9) +table=9,priority=20,actset_output=2 actions=12 +table=9,priority=10 actions=13 +]) +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP AT_SETUP([ofproto-dpif - push-pop]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], [20], [21], [22], [33], [90]) @@ -467,20 +703,20 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout]) AT_CHECK([tail -4 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=2 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),2,4 + [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=2,nw_frag=no +Datapath actions: set(ipv4(ttl=1)),2,4 This flow is handled by the userspace slow path because it: - Sends "packet-in" messages to the OpenFlow controller. ]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=3 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)),2,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),3,4 + [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=3,nw_frag=no +Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4 ]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,ipv6,in_port=1,ipv6_src=::1,ipv6_dst=::2,ipv6_label=0x00000,nw_proto=10,nw_tos=112,nw_ecn=0,nw_ttl=128 -Datapath actions: set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=127,frag=no)),2,set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=126,frag=no)),3,4 + [Megaflow: recirc_id=0,ipv6,in_port=1,nw_ttl=128,nw_frag=no +Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4 ]) AT_CAPTURE_FILE([ofctl_monitor.log]) @@ -489,7 +725,7 @@ OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1 +ip,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -577,16 +813,15 @@ --id=@q2 create Queue dscp=2], [0], [ignore]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=9,nw_src=1.1.1.1,nw_dst=2.2.2.2,nw_tos=252,nw_ecn=3,nw_ttl=128 + [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no Datapath actions: dnl 100,dnl -set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,dnl -set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xb,ttl=128,frag=no)),set(skb_priority(0x2)),1,dnl +set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl +set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl 1,dnl -set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,dnl -set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no)),set(skb_priority(0)),1,dnl -set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x3,ttl=128,frag=no)),1,dnl -100 +set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl +set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl +set(ipv4(tos=0/0xfc)),1,100 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -660,19 +895,19 @@ AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(syn)' done OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0 ]) AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) @@ -696,7 +931,7 @@ dnl Test that missed packets are droped for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack,syn)' done OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) @@ -723,23 +958,22 @@ AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(urg,rst)' done OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) AT_CHECK([cat ofctl_monitor.log], [0], [dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0 ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -sleep 1 # wait for revalidator to update stats +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl n_packets=3, n_bytes=180, actions=goto_table:1 OFPST_FLOW reply (OF1.2): @@ -767,8 +1001,7 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -sleep 1 # wait for revalidator to update stats +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl n_packets=3, n_bytes=180, actions=resubmit(1,1) OFPST_FLOW reply (OF1.2): @@ -798,13 +1031,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 ]) dnl Hit table 0, Miss all other tables, sent to controller @@ -818,17 +1051,16 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -sleep 1 # wait for revalidator to update stats +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 OFPST_FLOW reply (OF1.2): @@ -862,13 +1094,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 ]) dnl Hit table 1, Miss all other tables, sent to controller @@ -882,17 +1114,16 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -sleep 1 # wait for revalidator to update stats +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl n_packets=6, n_bytes=360, actions=goto_table:1 table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 @@ -938,8 +1169,7 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -sleep 1 # wait for revalidator to update stats +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl n_packets=6, n_bytes=360, actions=resubmit(1,1) table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 @@ -999,8 +1229,7 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -sleep 1 # wait for revalidator to update stats +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl n_packets=3, n_bytes=180, actions=goto_table:1 OFPST_FLOW reply (OF1.2): @@ -1031,8 +1260,7 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -sleep 1 # wait for revalidator to update stats +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl n_packets=3, n_bytes=180, actions=resubmit(1,1) OFPST_FLOW reply (OF1.2): @@ -1061,17 +1289,6 @@ cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7) cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller -cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller -cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller -cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller -cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller -cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller -cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller -cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller -cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller -cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller -cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller -cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[[]],controller,load:0xc0a88001->OXM_OF_ARP_SPA[[]],controller,load:0x404444444441->OXM_OF_ARP_THA[[]],load:0x01010101->OXM_OF_ARP_SPA[[]],load:0x02020202->OXM_OF_ARP_TPA[[]],controller ]) AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) @@ -1087,13 +1304,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0 ]) dnl Singleton controller action. @@ -1107,13 +1324,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 ]) dnl Modified controller action. @@ -1127,13 +1344,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x001 tcp_csum:0 +tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x001 tcp_csum:0 +tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0 dnl OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x001 tcp_csum:0 +tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0 ]) dnl Modified VLAN controller action. @@ -1147,95 +1364,320 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 ]) -dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) +dnl Checksum TCP. +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log]) -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' +for i in 1 ; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)' done -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) -OVS_APP_EXIT_AND_WAIT(ovs-ofctl) +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18]) +ovs-appctl -t ovs-ofctl exit AT_CHECK([cat ofctl_monitor.log], [0], [dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 -]) - -dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) -OVS_APP_EXIT_AND_WAIT(ovs-ofctl) - -AT_CHECK([cat ofctl_monitor.log], [0], [dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:1a03 +dnl +NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:3205 +dnl +NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=fin tcp_csum:31b8 +dnl +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d +dnl +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d ]) -dnl Modified MPLS controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) - -dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1) +dnl Checksum UDP. +AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:43,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)' +for i in 1 ; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' done -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) -OVS_APP_EXIT_AND_WAIT(ovs-ofctl) +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18]) +ovs-appctl -t ovs-ofctl exit AT_CHECK([cat ofctl_monitor.log], [0], [dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 +NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +udp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 dnl -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 +NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 +dnl +NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 +dnl +NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37 +dnl +NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439 +dnl +NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec +dnl +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1 +dnl +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered) +udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1 ]) -dnl Modified MPLS controller action. +dnl Modified ARP controller action. AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))' + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' done -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) -OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18]) +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Checksum SCTP. +AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +for i in 1 ; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04' +done + +AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore]) +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18]) +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered) +sctp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 reg0=0x1,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +dnl +NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +dnl +NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +dnl +NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +dnl +NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +dnl +NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:dd778f5f +dnl +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56 +dnl +NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered) +sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56 +]) + +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1) + cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535 + cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2) + cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3) + cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4) + cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5) + cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6) + cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7) + cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535 + n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 +NXST_FLOW reply: +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - MPLS handling]) +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy +]) +ON_EXIT([kill `cat ovs-ofctl.pid`]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +AT_DATA([flows.txt], [dnl +cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller +cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller +cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller +cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller +cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller +cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller +cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller +cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller +cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535 +cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller +cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller +cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller + +cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller +cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller +cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller +cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller +cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,OXM_OF_IPV4_SRC[[0..7]]),controller +cookie=0xd dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,OXM_OF_IPV4_SRC[[0..15]],slaves:1,2),controller +cookie=0xd dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,OXM_OF_IPV4_SRC[[]]=OXM_OF_IPV4_DST[[]]),controller + +cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1) +cookie=0xd table=1 arp actions=controller + +cookie=0xdeadbeef table=2 dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48 +cookie=0xd dl_src=60:66:66:66:00:09 actions=resubmit(,2),controller +cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller +cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller + +cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller +cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller +cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller + +cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller +cookie=0xe dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller +cookie=0xe dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller + +cookie=0xe dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller +cookie=0xe dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller +cookie=0xe dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller + +cookie=0xf dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller +cookie=0xf dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller +cookie=0xf dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller + +cookie=0x5 dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller +cookie=0x5 dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller +cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller +]) +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) + +dnl Modified MPLS controller action. +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=17,tos=0,ttl=64,frag=no),udp(src=7777,dst=80)' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +]) + +dnl Modified MPLS controller action. +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 +]) + +dnl Modified MPLS controller action. +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:43,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 +]) + +dnl Modified MPLS controller action. +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 ]) dnl Modified MPLS controller action. @@ -1249,13 +1691,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 ]) dnl Modified MPLS controller action. @@ -1269,13 +1711,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 ]) dnl Modified MPLS controller action. @@ -1289,15 +1731,39 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS controller action. +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:49,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=64,bos=1)' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 +mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816 ]) +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + dnl Modified MPLS controller action. AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) @@ -1309,13 +1775,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 ]) dnl Modified MPLS actions. @@ -1329,13 +1795,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 ]) dnl Modified MPLS ipv6 controller action. @@ -1349,13 +1815,13 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 +mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 +mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 dnl NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 +mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 ]) @@ -1377,204 +1843,1056 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0x000 tcp_csum:7744 +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:02 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 02 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee dnl NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0x000 tcp_csum:7744 +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee dnl NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0x000 tcp_csum:7744 +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee ]) -dnl Checksum TCP. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:03 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 03 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:04 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 04 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:05 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 05 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:76db +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:06 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 06 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:07 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 07 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:08 > ff:ff:ff:ff:ff:ff, ethertype MPLS unicast (0x8847), length 46: MPLS (label 20, exp 0, [S], ttl 32) +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'ff ff ff ff ff ff 60 66 66 66 00 08 88 47 00 01 41 20 00 01 08 00 06 04 00 02 60 66 66 66 00 08 c0 a8 00 01 ff ff ff ff ff ff ff ff ff ff' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered) +arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff +dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered) +arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff +dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered) +arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:09 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 09 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:0a > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0a 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:0b > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0b 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:01:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, [S], ttl 31) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 00 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:01:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, [S], ttl 31) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 01 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:01:02 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, [S], ttl 31) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 02 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:02:00 > 50:54:00:00:02:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, [S], ttl 31) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 00 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:02:01 > 50:54:00:00:02:01, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, [S], ttl 31) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 01 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done + +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:02:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, [S], ttl 31) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 10 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:03:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, ttl 31) +dnl (label 20, exp 0, [S], ttl 30) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 00 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:03:01 > 50:54:00:00:00:00, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, ttl 31) +dnl (label 20, exp 0, [S], ttl 30) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 01 88 48 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as: +dnl 60:66:66:66:03:10 > 50:54:00:00:00:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32) +dnl (label 20, exp 0, ttl 31) +dnl (label 20, exp 0, [S], ttl 30) +dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 10 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:04:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 00 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:04:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 01 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:04:10 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 10 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:05:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 00 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done + +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:05:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:05:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 10 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done + +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered) +mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,CONTROLLER:65535 + cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535 + cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,CONTROLLER:65535 + cookie=0xa, n_packets=3, n_bytes=180, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535 + cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535 + cookie=0xc, n_packets=3, n_bytes=180, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[[]],load:0x7->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=180, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1) + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->NXM_OF_IP_DST[[]],CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:NXM_OF_IP_DST[[]]->NXM_OF_IP_SRC[[]],CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:NXM_OF_IP_DST[[]],pop:NXM_OF_IP_SRC[[]],CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,NXM_OF_IP_SRC[[0..7]]),CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,NXM_OF_IP_SRC[[0..15]],slaves:1,2),CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]]),CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=resubmit(,2),CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 + cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,CONTROLLER:65535 + cookie=0xd, table=1, n_packets=3, n_bytes=168, arp actions=CONTROLLER:65535 + cookie=0xdeadbeef, table=2, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48 + cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535 + cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535 + cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,CONTROLLER:65535 + cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535 + cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535 + cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,CONTROLLER:65535 + cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535 + cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535 +NXST_FLOW reply: +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - MPLS handling with goto_table]) +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy +]) +ON_EXIT([kill `cat ovs-ofctl.pid`]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +AT_DATA([flows.txt], [dnl +table=0 mplsm actions=pop_mpls:0x800,goto_table(1) +table=1 ip,ip_dscp=8 actions=controller +]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt]) + + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1 + table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535 +OFPST_FLOW reply (OF1.2): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - MPLS handling with write_actions]) +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy +]) +ON_EXIT([kill `cat ovs-ofctl.pid`]) + +dnl N.B: The first (and only) action that accesses L3 data after the +dnl pop_mpls action is present in write_actions. This exercises recirculation +dnl triggered in write_actions due to a previous action not in write actions. +AT_CAPTURE_FILE([ofctl_monitor.log]) +AT_DATA([flows.txt], [dnl +mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller) +]) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt]) + +dnl Modified MPLS pop action. +dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as: +dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32) +dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44) +dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4 +AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl +OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +dnl +OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535) +OFPST_FLOW reply (OF1.2): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)]) +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy +]) +ON_EXIT([kill `cat ovs-ofctl.pid`]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +# A table-miss flow has priority 0 and no match +AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER']) + +dnl Singleton controller action. +AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3 ; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 +NXST_FLOW reply: +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)]) +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy +]) +ON_EXIT([kill `cat ovs-ofctl.pid`]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +# A table-miss flow has priority 0 and no match +AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER']) + +dnl Singleton controller action. +AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3 ; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' +done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 +OFPST_FLOW reply (OF1.3): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)]) +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy +]) +ON_EXIT([kill `cat ovs-ofctl.pid`]) + +ovs-appctl time/stop + +AT_CAPTURE_FILE([ofctl_monitor.log]) +# A table-miss flow has priority 0 and no match +AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER']) + +dnl Singleton controller action. +AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +# Become slave (OF 1.3), which should disable everything except port status. +ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001 -for i in 1 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)' +# Ensure that ovs-vswitchd gets a chance to reply before sending another command. +ovs-appctl time/warp 500 100 + +# Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only. +ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000 + +ovs-appctl time/warp 500 100 +for i in 1 2 3 ; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' done -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18]) -OVS_APP_EXIT_AND_WAIT(ovs-ofctl) +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +ovs-appctl -t ovs-ofctl exit +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([cat ofctl_monitor.log], [0], [dnl -NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 -dnl -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 +send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1 +OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1 dnl -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 +send: OFPT_SET_ASYNC (OF1.3) (xid=0x2): + master: + PACKET_IN: (off) + PORT_STATUS: (off) + FLOW_REMOVED: (off) + + slave: + PACKET_IN: no_match + PORT_STATUS: (off) + FLOW_REMOVED: (off) dnl -NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 -dnl -NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:1a03 -dnl -NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:3205 -dnl -NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=0x001 tcp_csum:31b8 +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=0x001 tcp_csum:316d +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=0x001 tcp_csum:316d +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 ]) -dnl Checksum UDP. -AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) - -for i in 1 ; do - ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' -done -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18]) -OVS_APP_EXIT_AND_WAIT(ovs-ofctl) +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -AT_CHECK([cat ofctl_monitor.log], [0], [dnl -NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -dnl -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -dnl -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -dnl -NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -dnl -NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37 -dnl -NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439 -dnl -NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec -dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1 -dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1 +AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 +OFPST_FLOW reply (OF1.3): ]) -dnl Modified ARP controller action. -AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log]) +OVS_VSWITCHD_STOP +AT_CLEANUP -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' -done -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 9]) -OVS_APP_EXIT_AND_WAIT(ovs-ofctl) -AT_CHECK([cat ofctl_monitor.log], [0], [dnl -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 +AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)]) +OVS_VSWITCHD_START([dnl + add-port br0 p1 -- set Interface p1 type=dummy ]) +ON_EXIT([kill `cat ovs-ofctl.pid`]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) +AT_CAPTURE_FILE([ofctl_monitor.log]) +# A table-miss flow has priority 0 and no match +AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER']) -dnl Checksum SCTP. -AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) +dnl Singleton controller action. +AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) -for i in 1 ; do - ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04' +for i in 1 2 3 ; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' done +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +ovs-appctl -t ovs-ofctl exit -OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18]) -OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([cat ofctl_monitor.log], [0], [dnl -NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered) -sctp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 +OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -dnl -NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -dnl -NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -dnl -NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -dnl -NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:7f12662e -dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67 -dnl -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67 +OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 ]) -AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl - cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1) - cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535 - cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2) - cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3) - cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4) - cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5) - cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6) - cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7) - cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,CONTROLLER:65535 - cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535 - cookie=0xc, n_packets=3, n_bytes=180, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[[]],load:0x7->OXM_OF_MPLS_TC[[]],CONTROLLER:65535 - cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535 - cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535 - n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 -NXST_FLOW reply: +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + +AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 +OFPST_FLOW reply (OF1.4): ]) OVS_VSWITCHD_STOP AT_CLEANUP -AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)]) +AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)]) OVS_VSWITCHD_START([dnl add-port br0 p1 -- set Interface p1 type=dummy ]) ON_EXIT([kill `cat ovs-ofctl.pid`]) AT_CAPTURE_FILE([ofctl_monitor.log]) -# A table-miss flow has priority 0 and no match -AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER']) +AT_DATA([flows.txt], [dnl +table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1) +table=1 actions=output(CONTROLLER),goto_table(2) +table=2 actions=group:1234 +]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER']) +AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flows br0 flows.txt]) dnl Singleton controller action. -AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3 ; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' @@ -1582,40 +2900,67 @@ OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) ovs-appctl -t ovs-ofctl exit +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) + AT_CHECK([cat ofctl_monitor.log], [0], [dnl -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 ]) AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl - n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 -NXST_FLOW reply: +AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1 + table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2 + table=2, n_packets=3, n_bytes=180, actions=group:1234 +OFPST_FLOW reply (OF1.3): ]) OVS_VSWITCHD_STOP AT_CLEANUP -AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)]) +AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.4)]) OVS_VSWITCHD_START([dnl add-port br0 p1 -- set Interface p1 type=dummy ]) ON_EXIT([kill `cat ovs-ofctl.pid`]) AT_CAPTURE_FILE([ofctl_monitor.log]) -# A table-miss flow has priority 0 and no match -AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER']) +AT_DATA([flows.txt], [dnl +table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1) +table=1 actions=output(CONTROLLER),goto_table(2) +table=2 actions=group:1234 +]) +AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER']) +AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flows br0 flows.txt]) dnl Singleton controller action. -AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) for i in 1 2 3 ; do ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' @@ -1626,26 +2971,47 @@ AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) AT_CHECK([cat ofctl_monitor.log], [0], [dnl -OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 dnl -OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 +OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 +dnl +OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered) +tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0 ]) AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) -AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl - n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 -OFPST_FLOW reply (OF1.3): +AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1 + table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2 + table=2, n_packets=3, n_bytes=180, actions=group:1234 +OFPST_FLOW reply (OF1.4): ]) OVS_VSWITCHD_STOP AT_CLEANUP + AT_SETUP([ofproto-dpif - ARP modification slow-path]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], [1], [2]) @@ -1661,15 +3027,15 @@ # Check the packets that were output. AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 +arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 ]) OVS_VSWITCHD_STOP @@ -1834,21 +3200,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00 @@ -1867,21 +3233,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 +mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 @@ -1902,21 +3268,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 +mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 +mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 +mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 @@ -1960,7 +3326,7 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -1968,7 +3334,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -1976,7 +3342,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -1997,21 +3363,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2031,7 +3397,7 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2039,7 +3405,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2047,7 +3413,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2068,21 +3434,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2102,7 +3468,7 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2110,7 +3476,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2118,7 +3484,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2139,21 +3505,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2173,7 +3539,7 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2181,7 +3547,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2189,7 +3555,7 @@ 00000040 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2210,21 +3576,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2244,21 +3610,21 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 @@ -2278,28 +3644,28 @@ AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 dnl OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 +mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 ]) -AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535 @@ -2317,15 +3683,14 @@ OVS_VSWITCHD_STOP AT_CLEANUP -AT_SETUP([ofproto-dpif - fragment handling]) +AT_SETUP([ofproto-dpif - fragment handling - trace]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90]) AT_DATA([flows.txt], [dnl -priority=75 tcp ip_frag=no tp_dst=80 actions=output:1 -priority=75 tcp ip_frag=first tp_dst=80 actions=output:2 -priority=75 tcp ip_frag=later tp_dst=80 actions=output:3 -priority=50 tcp ip_frag=no actions=output:4 -priority=50 tcp ip_frag=first actions=output:5 +priority=75 tcp ip_frag=no tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1 +priority=75 tcp ip_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2 +priority=50 tcp ip_frag=no actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4 +priority=50 tcp ip_frag=first actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5 priority=50 tcp ip_frag=later actions=output:6 ]) AT_CHECK([ovs-ofctl replace-flows br0 flows.txt]) @@ -2355,14 +3720,195 @@ : > expout if test $mode = drop && test $type != no; then echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout + echo "Datapath actions: $exp_output" >> expout + elif test $type = later; then + echo "Datapath actions: $exp_output" >> expout + else + echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout fi - echo "Datapath actions: $exp_output" >> expout AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout]) done done OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - fragment handling - upcall]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90]) +AT_DATA([flows.txt], [dnl +priority=75 tcp ip_frag=no tp_dst=80 actions=set_field:81->tcp_dst,output:1 +priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2 +priority=50 tcp ip_frag=no actions=set_field:81->tcp_dst,output:4 +priority=50 tcp ip_frag=first actions=set_field:81->tcp_dst,output:5 +priority=50 tcp ip_frag=later actions=output:6 +]) +AT_CHECK([ovs-ofctl replace-flows br0 flows.txt]) + +base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128" +no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)" +first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)" +later_flow="$base_flow,frag=later)" + +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +mode=normal + +AT_CHECK([ovs-ofctl set-frags br0 $mode]) +for type in no first later; do + eval flow=\$${type}_flow + printf "\n%s\n" "----$mode $type-----" + + AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout]) +done + +AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl +flow-dump from non-dpdk interfaces: +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),5 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6 +]) + +mode=drop + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl set-frags br0 $mode]) +for type in no first later; do + eval flow=\$${type}_flow + printf "\n%s\n" "----$mode $type-----" + + AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout]) +done + +AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl +flow-dump from non-dpdk interfaces: +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop +]) + +mode=nx-match + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl set-frags br0 $mode]) +for type in no first later; do + eval flow=\$${type}_flow + printf "\n%s\n" "----$mode $type-----" + + AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout]) +done + +AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl +flow-dump from non-dpdk interfaces: +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),2 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6 +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - fragment handling - actions]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90]) + +AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_TCP_DST[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr]) +AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl +source field tcp_dst lacks correct prerequisites +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]) + +AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_PKT_REG0[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr]) +AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl +destination field tcp_src lacks correct prerequisites +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]) + +AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr]) +AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl +set_field udp_src lacks correct prerequisities +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]) + +AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr]) +AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl +set_field udp_dst lacks correct prerequisities +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]) + +AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr]) +AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl +set_field sctp_src lacks correct prerequisities +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]) + +AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr]) +AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl +set_field sctp_dst lacks correct prerequisities +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]) + +AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]],NXM_OF_TCP_SRC[[]]=NXM_OF_TCP_DST[[]],output:NXM_NX_REG0[[0..15]]),output:1"], [1], [], [stderr]) +AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl +source field tcp_dst lacks correct prerequisites +ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) +]) + +AT_DATA([flows.txt], [dnl +priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1 +]) +AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt]) + +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +mode=normal + +AT_CHECK([ovs-ofctl set-frags br0 $mode]) +for frag in 4000 6000 6008 4010; do + printf "\n%s\n" "----$mode $frag-----" + + AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 003c 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016 751e267b 00000000 a002 16d0 1736 0000 02 04 05 b4 04 02 08 0a 2d 25 08 5f 00 00 00 00 01 03 03 07"]) +done + +AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl +flow-dump from non-dpdk interfaces: +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=33419), packets:0, bytes:0, used:never, actions:set(tcp(src=33322)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=33419), packets:0, bytes:0, used:never, actions:set(tcp(src=33322)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl set-frags br0 $mode]) +for frag in 4000 6000 6008 4010; do + printf "\n%s\n" "----$mode $frag truncated transport header -----" + + AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"]) +done + +AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl +flow-dump from non-dpdk interfaces: +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl set-frags br0 $mode]) +for frag in 4000 6000 6001 4002; do + printf "\n%s\n" "----$mode $frag missing transport header-----" + + AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"]) +done + +AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl +flow-dump from non-dpdk interfaces: +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0), packets:0, bytes:0, used:never, actions:set(tcp(src=42)),1 +recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1 +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto-dpif - exit]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14]) @@ -2609,7 +4155,7 @@ ]) AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) -odp_flow="in_port(1)" +odp_flow="in_port(p1)" br_flow="in_port=1" # Test command: ofproto/trace odp_flow with in_port as a name. AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout]) @@ -2639,9 +4185,9 @@ AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout]) AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout]) -# This section beflow tests the [-generate] option +# This section below tests the [-generate] option odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)" -br_flow="arp,metadata=0,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=ff:ff:ff:ff:ff:ff" +br_flow="arp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=ff:ff:ff:ff:ff:ff" # Test command: ofproto/trace odp_flow AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout]) @@ -2711,7 +4257,7 @@ ]) AT_CHECK([head -n 2 stdout], [0], [dnl Bridge: br0 -Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 +Flow: pkt_mark=0x2,skb_priority=0x1,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 ]) # Test command: ofproto/trace dp_name odp_flow packet @@ -2722,7 +4268,7 @@ ]) AT_CHECK([head -n 2 stdout], [0], [dnl Bridge: br0 -Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 +Flow: pkt_mark=0x2,skb_priority=0x1,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 ]) # Test command: ofproto/trace br_name br_flow packet @@ -2733,7 +4279,7 @@ ]) AT_CHECK([head -n 2 stdout], [0], [dnl Bridge: br0 -Flow: pkt_mark=0x1,skb_priority=0x2,arp,metadata=0,in_port=2,vlan_tci=0x0000,dl_src=50:54:00:00:00:02,dl_dst=50:54:00:00:00:01,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 +Flow: pkt_mark=0x1,skb_priority=0x2,arp,in_port=2,vlan_tci=0x0000,dl_src=50:54:00:00:00:02,dl_dst=50:54:00:00:00:01,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 ]) OVS_VSWITCHD_STOP @@ -2838,19 +4384,67 @@ ovs-appctl: ovs-vswitchd: server returned an error ]) -# Test incorrect command: ofproto/trace with 4 arguments -AT_CHECK([ovs-appctl ofproto/trace \ - arg1, arg2, arg3, arg4], [2], [stdout],[stderr]) -AT_CHECK([tail -2 stderr], [0], [dnl -"ofproto/trace" command takes at most 3 arguments -ovs-appctl: ovs-vswitchd: server returned an error +# Test incorrect command: ofproto/trace with 4 arguments +AT_CHECK([ovs-appctl ofproto/trace \ + arg1, arg2, arg3, arg4], [2], [stdout],[stderr]) +AT_CHECK([tail -2 stderr], [0], [dnl +"ofproto/trace" command takes at most 3 arguments +ovs-appctl: ovs-vswitchd: server returned an error +]) + +# Test incorrect command: ofproto/trace with 0 argument +AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr]) +AT_CHECK([tail -2 stderr], [0], [dnl +"ofproto/trace" command requires at least 1 arguments +ovs-appctl: ovs-vswitchd: server returned an error +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +# The third test checks that the output of "ovs-dpctl -m" is valid to trace. +AT_SETUP([ofproto-dpif - ofproto/trace from dpctl output]) +OVS_VSWITCHD_START([dnl + set Open_vSwitch . other_config:max-idle=10000 \ + -- add-port br0 p1 -- set Interface p1 type=dummy]) + +AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +ovs-appctl revalidator/wait +AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows1.txt]) + +odp_flow=`cat dp_flows1.txt` +AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 /'], [0], [dnl +Bridge: br0 +Flow: +No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port. + +Rule: table=254 cookie=0 priority=0,reg0=0x2 +OpenFlow actions=drop + +Final flow: +Megaflow: +Datapath actions: drop ]) -# Test incorrect command: ofproto/trace with 0 argument -AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr]) -AT_CHECK([tail -2 stderr], [0], [dnl -"ofproto/trace" command requires at least 1 arguments -ovs-appctl: ovs-vswitchd: server returned an error +dnl Now, try again without megaflows: +ovs-appctl upcall/disable-megaflows + +AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +ovs-appctl revalidator/wait +AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows2.txt]) + +odp_flow=`cat dp_flows2.txt` +AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 /'], [0], [dnl +Bridge: br0 +Flow: +No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port. + +Rule: table=254 cookie=0 priority=0,reg0=0x2 +OpenFlow actions=drop + +Final flow: +Megaflow: +Datapath actions: drop ]) OVS_VSWITCHD_STOP @@ -3035,6 +4629,72 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - MAC table overflow fairness]) +OVS_VSWITCHD_START( + [set bridge br0 fail-mode=standalone other-config:mac-table-size=10]) +ADD_OF_PORTS([br0], 1, 2, 3, 4, 5, 6) + +arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' + +AT_CHECK([ovs-appctl time/stop]) + +# Trace packets with 2 different source MACs arriving on each of the 5 +# ports, filling up the 10-entry learning table. +for i in 0 1 2 3 4 5 6 7 8 9; do + p=`expr $i / 2 + 1` + ovs-appctl ofproto/trace ovs-dummy "in_port($p),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp" -generate + ovs-appctl time/warp 1000 +done + +# Check for the MAC learning entries. +AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort], + [0], [dnl + 1 0 50:54:00:00:00:00 + 1 0 50:54:00:00:00:01 + 2 0 50:54:00:00:00:02 + 2 0 50:54:00:00:00:03 + 3 0 50:54:00:00:00:04 + 3 0 50:54:00:00:00:05 + 4 0 50:54:00:00:00:06 + 4 0 50:54:00:00:00:07 + 5 0 50:54:00:00:00:08 + 5 0 50:54:00:00:00:09 + port VLAN MAC Age +]) + +# Now trace 16 new MACs on another port. +for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do + ovs-appctl ofproto/trace ovs-dummy "in_port(6),eth(src=50:54:00:00:0$i:ff,dst=ff:ff:ff:ff:ff:ff),$arp" -generate + ovs-appctl time/warp 1000 +done + +# Check the results. +# +# Our eviction algorithm on overflow is that an arbitrary (but deterministic) +# one of the ports with the most learned MACs loses the least recently used +# one. Thus, the new port will end up with 3 MACs, 3 of the old ports with 1 +# MAC each, and the other 2 of the old ports with 2 MACs each. +# +# (If someone changes lib/heap.c to do something different with equal-priority +# nodes, then the output below could change, but it would still follow the +# rules explained above.) +AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort], + [0], [dnl + 1 0 50:54:00:00:00:01 + 2 0 50:54:00:00:00:03 + 3 0 50:54:00:00:00:04 + 3 0 50:54:00:00:00:05 + 4 0 50:54:00:00:00:07 + 5 0 50:54:00:00:00:08 + 5 0 50:54:00:00:00:09 + 6 0 50:54:00:00:0d:ff + 6 0 50:54:00:00:0e:ff + 6 0 50:54:00:00:0f:ff + port VLAN MAC Age +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS) # # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector @@ -3042,6 +4702,7 @@ # IP_VERSION_TYPE is used in AT_SETUP m4_define([CHECK_SFLOW_SAMPLING_PACKET], [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector]) + AT_XFAIL_IF([test "$IS_WIN32" = "yes"]) OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone]) ON_EXIT([kill `cat test-sflow.pid`]) @@ -3080,9 +4741,7 @@ dnl sleep long enough to get more than one counter sample dnl from each datasource so we can check sequence numbers - for i in `seq 1 30`; do - ovs-appctl time/warp 100 - done + ovs-appctl time/warp 3000 100 OVS_VSWITCHD_STOP ovs-appctl -t test-sflow exit @@ -3190,7 +4849,7 @@ hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-67-00-00-00-00-00-0A-80-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-01-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-02-00-00-00-00-00-00 ]) - AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\ + AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -18 | sed 's/ /\ /g']], [0], [dnl IFCOUNTERS dgramSeqNo=2 @@ -3330,12 +4989,100 @@ out_discards=0 out_errors=0 promiscuous=0 +OPENFLOWPORT + datapath_id=18364758544493064720 + port_no=1 +OPENFLOWPORT + datapath_id=18364758544493064720 + port_no=1 +OPENFLOWPORT + datapath_id=18364758544493064720 + port_no=2 +OPENFLOWPORT + datapath_id=18364758544493064720 + port_no=2 +OPENFLOWPORT + datapath_id=18364758544493064720 + port_no=65534 +OPENFLOWPORT + datapath_id=18364758544493064720 + port_no=65534 +PORTNAME + portName=br0 +PORTNAME + portName=br0 +PORTNAME + portName=p1 +PORTNAME + portName=p1 +PORTNAME + portName=p2 +PORTNAME + portName=p2 ]) AT_CLEANUP]) CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4]) CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6]) +dnl Test sFlow LAG structures +AT_SETUP([ofproto-dpif - sFlow LACP structures]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) +OVS_VSWITCHD_START([dnl + add-bond br0 bond p1 p2 -- \ + set Port bond lacp=active bond-mode=active-backup \ + other_config:lacp-time="fast" \ + other_config:lacp-system-id=11:22:33:44:55:66 \ + other_config:lacp-system-priority=54321 -- \ + set Interface p1 type=dummy \ + other_config:lacp-port-id=11 \ + other_config:lacp-port-priority=111 \ + other_config:lacp-aggregation-key=3333 -- \ + set Interface p2 type=dummy \ + other_config:lacp-port-id=22 \ + other_config:lacp-port-priority=222 \ + other_config:lacp-aggregation-key=3333 ]) + +ON_EXIT([kill `cat test-sflow.pid`]) +AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore]) +AT_CAPTURE_FILE([sflow.log]) +SFLOW_PORT=`parse_listening_port < test-sflow.log` + +ovs-appctl time/stop + +ovs-vsctl \ + set Interface p1 options:ifindex=1003 -- \ + set Bridge br0 sflow=@sf -- \ + --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \ + header=128 sampling=1 polling=1 + +dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second) +AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore]) +AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_VSWITCHD_STOP +ovs-appctl -t test-sflow exit +AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\ + /g']], [0], [dnl +LACPCOUNTERS + sysID=11:22:33:44:55:66 + partnerID=00:00:00:00:00:00 + aggID=3333 + actorAdmin=0x7 + actorOper=0xbf + partnerAdmin=0x0 + partnerOper=0x2 + LACPUDsRx=0 + markerPDUsRx=4294967295 + markerRespPDUsRx=4294967295 + unknownRx=4294967295 + illegalRx=0 + LACPUDsTx=1 + markerPDUsTx=4294967295 + markerRespPDUsTx=4294967295 +]) + +AT_CLEANUP + # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE) # # Test that basic NetFlow reports flow statistics correctly: @@ -3370,7 +5117,7 @@ done ovs-appctl time/warp 6000 - sleep 1 + ovs-appctl revalidator/wait OVS_VSWITCHD_STOP ovs-appctl -t test-netflow exit @@ -3421,7 +5168,7 @@ ovs-appctl time/warp 10000 - sleep 1 + ovs-appctl revalidator/wait OVS_VSWITCHD_STOP ovs-appctl -t test-netflow exit @@ -3482,9 +5229,8 @@ ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)' done -ovs-appctl time/warp 1000 -sleep 1 # wait for revalidator to update stats - +AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore]) +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout]) AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL @@ -3516,7 +5262,7 @@ OVS_VSWITCHD_STOP AT_CLEANUP -AT_SETUP([idle_age and hard_age increase over time]) +AT_SETUP([ofproto-dpif - idle_age and hard_age increase over time]) OVS_VSWITCHD_START # get_ages DURATION HARD IDLE @@ -3569,9 +5315,7 @@ # occasionally. ovs-appctl time/warp 10000 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)' -ovs-appctl time/warp 1000 -ovs-appctl time/warp 1000 -ovs-appctl time/warp 1000 +ovs-appctl time/warp 3000 1000 sleep 1 get_ages duration4 hard4 idle4 @@ -3610,10 +5354,6 @@ AT_SETUP([ofproto-dpif - fin_timeout]) OVS_VSWITCHD_START -AT_DATA([flows.txt], [dnl -in_port=1 actions=output:2 -in_port=2 actions=mod_vlan_vid:17,output:1 -]) ovs-appctl time/stop AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)']) AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], @@ -3629,7 +5369,7 @@ AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped warped ]) -sleep 1 +AT_CHECK([ovs-appctl revalidator/purge], [0]) AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply: n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5) @@ -3687,23 +5427,42 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)']) AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) -sleep 1 # wait for upcall handlers -AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl -skb_priority(0),recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions:drop -skb_priority(0),recirc_id(0),in_port(2),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions:drop +ovs-appctl revalidator/wait +AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl +recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop +recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop ]) -AT_CHECK([ovs-appctl dpif/dump-flows br1 | sort | STRIP_USED], [0], [dnl -skb_priority(0),recirc_id(0),in_port(3),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions:drop +AT_CHECK([ovs-appctl dpif/dump-flows br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl +recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop ]) -AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sort | STRIP_USED], [0], [dnl -skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(p1),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop -skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(p2),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop +AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | STRIP_UFID | STRIP_USED | sort], [0], [dnl +skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p1),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop +skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p2),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop ]) -AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | sort | STRIP_USED], [0], [dnl -skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(p3),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop +AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | STRIP_UFID | STRIP_USED | sort], [0], [dnl +skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p3),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow]) + +OVS_VSWITCHD_START([add-br br1 -- \ + set bridge br1 datapath-type=dummy fail-mode=secure -- \ + set Open_vSwitch . other_config:max-idle=10000]) +ADD_OF_PORTS([br0], [1], [2]) + +AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) +ovs-appctl revalidator/wait +AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout]) + +UFID=`sed -n 's/\(ufid:[[-0-9a-fA-F]]*\).*/\1/p' stdout` +AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl +recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop ]) OVS_VSWITCHD_STOP @@ -3713,7 +5472,7 @@ OVS_VSWITCHD_START([dnl add-port br0 p1 -- set Interface p1 type=dummy ]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ON_EXIT([kill `cat ovs-ofctl.pid`]) AT_CAPTURE_FILE([ofctl_monitor.log]) @@ -3736,11 +5495,10 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45"]) done sleep 1 # wait for the datapath flow installed -for dl_src in 00 01; do - AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep ":$dl_src/" | STRIP_USED], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller)) +AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl +recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:00,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller)) +recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:01,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller)) ]) -done OVS_VSWITCHD_STOP AT_CLEANUP @@ -3750,7 +5508,7 @@ OVS_VSWITCHD_START([dnl add-port br0 p1 -- set Interface p1 type=dummy ]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ON_EXIT([kill `cat ovs-ofctl.pid`]) AT_CAPTURE_FILE([ofctl_monitor.log]) @@ -3776,11 +5534,10 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45"]) done sleep 1 # wait for the datapath flow installed -for dl_src in 00 01; do - AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep ":$dl_src/" | STRIP_USED], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller)) +AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl +recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:00,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller)) +recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:01,mpls_bos=0,mpls_lse1=82208, actions:userspace(pid=0,slow_path(controller)) ]) -done OVS_VSWITCHD_STOP AT_CLEANUP @@ -3794,8 +5551,10 @@ ADD_OF_PORTS([br0], [2]) ADD_OF_PORTS([br1], [3]) +AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled +], []) AT_CHECK([ovs-appctl time/stop]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2]) AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3]) @@ -3831,16 +5590,16 @@ pbr1 1/none: (patch: peer=pbr0) ]) -AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(100),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:101,3,2 -skb_priority(0),skb_mark(0/0),in_port(101),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:100,2,3 +AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl +recirc_id=0,ip,in_port=100,nw_frag=no, actions:101,3,2 +recirc_id=0,ip,in_port=101,nw_frag=no, actions:100,2,3 ]) -AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | FILTER_FLOW_DUMP], [0], [dnl -skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(100),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:9, bytes:540, used:0.0s, actions:101,3,2 +AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl +skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(100),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:9, bytes:540, used:0.0s, actions:101,3,2 ]) -AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | FILTER_FLOW_DUMP], [0], [dnl -skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(101),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:4, bytes:240, used:0.0s, actions:100,2,3 +AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | STRIP_UFID | FILTER_FLOW_DUMP], [0], [dnl +skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(101),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:4, bytes:240, used:0.0s, actions:100,2,3 ]) AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl @@ -3858,6 +5617,55 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - patch ports - stack]) +OVS_VSWITCHD_START([add-br br1 \ +-- set bridge br1 datapath-type=dummy fail-mode=secure \ +-- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \ +-- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1]) + +ADD_OF_PORTS([br0], [2]) +ADD_OF_PORTS([br1], [3]) + +AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled +], []) +AT_CHECK([ovs-appctl time/stop]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +AT_CHECK([ovs-ofctl add-flow br0 "ip actions=push:OXM_OF_IN_PORT[[0..31]],output:1,pop:OXM_OF_IPV4_SRC[[0..31]],output:2"]) +# Try to pop from empty stack, and push and leave data to stack. +AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"]) + +ovs-appctl netdev-dummy/receive br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' + +AT_CHECK([ovs-appctl time/warp 500], [0], +[warped +]) + +OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1]) + +AT_CHECK([ovs-appctl dpif/show], [0], [dnl +dummy@ovs-dummy: hit:0 missed:1 + br0: + br0 65534/100: (dummy) + p2 2/2: (dummy) + pbr0 1/none: (patch: peer=pbr1) + br1: + br1 65534/101: (dummy) + p3 3/3: (dummy) + pbr1 1/none: (patch: peer=pbr0) +]) + +AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl +recirc_id=0,ip,in_port=100,nw_src=192.168.0.1,nw_frag=no, actions:101,set(ipv4(src=255.255.255.254)),2 +]) + +AT_CHECK([cat ovs-vswitchd.log | grep -e '|nx_match|WARN|' | sed "s/^.*|WARN|//"], [0], [dnl +Failed to pop from an empty stack. On flow +]) + +OVS_VSWITCHD_STOP(["/Failed to pop from an empty stack/d"]) +AT_CLEANUP + AT_SETUP([ofproto-dpif - port duration]) OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13]) ADD_OF_PORTS([br0], 1, 2) @@ -3880,7 +5688,7 @@ AT_SETUP([ofproto-dpif megaflow - port classification]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1 actions=output(2) @@ -3891,14 +5699,14 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - L2 classification]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2) @@ -3908,15 +5716,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b/ff:ff:00:00:00:02,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - L3 classification]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], []) AT_DATA([flows.txt], [dnl @@ -3927,15 +5735,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - IPv6 classification]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], []) AT_DATA([flows.txt], [dnl @@ -3946,15 +5754,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1,dst=2001:db8:3c4d:1:2:3:4:1,label=0,proto=99,tclass=0x70,hlimit=64,frag=no)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff,dst=fe80::2/::,label=0/0,proto=10/0,tclass=0x70/0,hlimit=128/0,frag=no/0xff), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:ffff:fffc::,dst=2001:db8:3c4d:1:2:3:4:1/::,label=0/0,proto=99/0,tclass=0x70/0,hlimit=64/0,frag=no/0xff), actions: +recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:1:2:3:4:5,nw_frag=no, actions: +recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:5:4:3:2:1/0:0:0:4::,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - L4 classification]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1,icmp,icmp_type=8 actions=output(2) @@ -3965,29 +5773,29 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0xff,code=0/0), actions: +recirc_id=0,icmp,in_port=1,nw_frag=no,icmp_type=0x8/0xff, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - normal]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_CHECK([ovs-ofctl add-flow br0 action=normal]) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - mpls]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2 @@ -3998,8 +5806,8 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: +recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:09,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1, actions: +recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:0b,mpls_bos=1, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -4010,7 +5818,7 @@ m4_define([CHECK_MEGAFLOW_NETFLOW], [AT_SETUP([ofproto-dpif megaflow - netflow - $2 collector]) OVS_VSWITCHD_START - AT_CHECK([ovs-appctl vlog/set dpif:dbg]) + AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) dnl NetFlow configuration disables wildcarding relevant fields @@ -4028,8 +5836,8 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: +recirc_id=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_frag=no,icmp_type=0x8/0xff,icmp_code=0x0/0xff, actions: +recirc_id=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_frag=no,icmp_type=0x8/0xff,icmp_code=0x0/0xff, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP]) @@ -4045,15 +5853,15 @@ set interface p3 type=dummy ofport_request=3]) AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK ]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) AT_CHECK([ovs-ofctl add-flow br0 action=normal]) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -4066,15 +5874,15 @@ set interface p3 type=dummy ofport_request=3]) AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK ]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) AT_CHECK([ovs-ofctl add-flow br0 action=normal]) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -4101,7 +5909,7 @@ AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK ]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [7]) AT_CHECK([ovs-ofctl add-flow br0 action=normal]) AT_CHECK([ovs-ofctl add-flow br1 action=normal]) @@ -4111,15 +5919,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: +recirc_id=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - resubmit port action]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1,ip actions=resubmit(90) @@ -4130,15 +5938,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b/ff:ff:00:00:00:02,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - resubmit table action]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1,ip actions=resubmit(,1) @@ -4150,15 +5958,15 @@ 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - goto_table action]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1,ip actions=goto_table(1) @@ -4169,15 +5977,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - mirroring, select_all]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2], [3]) ovs-vsctl \ set Bridge br0 mirrors=@m --\ @@ -4193,14 +6001,14 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2], [3]) ovs-vsctl \ set Bridge br0 mirrors=@m --\ @@ -4215,15 +6023,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8100),vlan(vid=11/0xfff,pcp=7/0x0,cfi=1/1),encap(eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0)), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,dl_vlan=11,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - move action]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90) @@ -4235,15 +6043,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - push action]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2) @@ -4253,15 +6061,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - learning]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1 actions=load:2->NXM_NX_REG0[[0..15]],learn(table=1,priority=65535,NXM_OF_ETH_SRC[[]],NXM_OF_VLAN_TCI[[0..11]],output:NXM_NX_REG0[[0..15]]),output:2 @@ -4280,8 +6088,8 @@ sleep 1 dnl The original flow is missing due to a revalidation. AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -4289,7 +6097,7 @@ AT_SETUP([ofproto-dpif megaflow - tunnels]) OVS_VSWITCHD_START( [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1]) -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \ options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow]) AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \ @@ -4312,16 +6120,16 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0xfd/0x3,ttl=128/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0xfd/0xff,ttl=128/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0x1/0xff,ttl=64/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: +recirc_id=0,ip,in_port=1,nw_ecn=1,nw_frag=no, actions: +recirc_id=0,ip,in_port=3,nw_tos=0,nw_ecn=1,nw_ttl=64,nw_frag=no, actions: +recirc_id=0,ip,in_port=3,nw_tos=252,nw_ecn=1,nw_ttl=128,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - dec_ttl]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], []) AT_DATA([flows.txt], [dnl @@ -4332,15 +6140,15 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8/0,code=0/0), actions: +recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_ttl=64,nw_frag=no, actions: +recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - set dl_dst]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2) @@ -4349,26 +6157,19 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) sleep 1 -dnl The megaflows do not match the same fields, since the first packet -dnl is essentially a no-op. (The new destination MAC is the same as the -dnl original.) The ofproto-dpif library un-wildcards the destination MAC -dnl so that a packet that doesn't need its MAC address changed doesn't -dnl hide one that does. Since the first entry doesn't need to change, -dnl only the destination MAC address is matched (as decided by -dnl ofproto-dpif). The second entry actually updates the destination -dnl MAC, so both the source and destination MAC addresses are -dnl un-wildcarded, since the ODP commit functions update both the source -dnl and destination MAC addresses. -AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/ff:ff:ff:ff:ff:ff),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:2 -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:set(eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a)),2 +dnl The first packet is essentially a no-op, as the new destination MAC is the +dnl same as the original. The second entry actually updates the destination +dnl MAC. +AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl +recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions:2 +recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions:set(eth(dst=50:54:00:00:00:0a)),2 ]) OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto-dpif megaflow - disabled]) OVS_VSWITCHD_START -AT_CHECK([ovs-appctl vlog/set dpif:dbg]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) ADD_OF_PORTS([br0], [1], [2]) AT_DATA([flows.txt], [dnl table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2) @@ -4376,6 +6177,8 @@ ]) AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled ], []) +AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled +], []) AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], []) AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) for i in 1 2 3 4; do @@ -4386,11 +6189,11 @@ fi done sleep 1 -AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl -skb_priority(0),skb_mark(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:2 -skb_priority(0),skb_mark(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:drop +AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl +pkt_mark=0,recirc_id=0,dp_hash=0,skb_priority=0,icmp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0, actions:2 +pkt_mark=0,recirc_id=0,dp_hash=0,skb_priority=0,icmp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0, actions:drop ]) -AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | grep 'packets:3'], [0], [dnl +AT_CHECK([cat ovs-vswitchd.log | STRIP_UFID | FILTER_FLOW_DUMP | grep 'packets:3'], [0], [dnl skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:2 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:drop ]) @@ -4433,7 +6236,7 @@ ovs-appctl time/stop # advance the clock to stablize everything. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 # cfm/show should show 'recv' fault. AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl fault: recv @@ -4456,7 +6259,7 @@ # now disable the bfd on p1. AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false]) # advance the clock to stablize everything. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 # cfm/show should show 'recv' fault. AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl fault: recv @@ -4476,7 +6279,7 @@ AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true]) AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false]) # advance the clock to stablize everything. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done +ovs-appctl time/warp 5000 100 # cfm/show should show 'recv' fault. AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl fault: recv @@ -4560,7 +6363,7 @@ AT_SETUP([ofproto-dpif - infinite resubmit]) OVS_VSWITCHD_START AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3]) -AT_CHECK([ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'], +AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop ]) @@ -4579,7 +6382,7 @@ done echo "in_port=65, actions=local") > flows AT_CHECK([ovs-ofctl add-flows br0 flows]) -AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout]) +AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout]) AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1 ]) OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"]) @@ -4594,7 +6397,7 @@ done echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows AT_CHECK([ovs-ofctl add-flows br0 flows]) -AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout]) +AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout]) AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout], [0], [1 ]) @@ -4613,12 +6416,222 @@ push="push:NXM_NX_REG0[[]]" echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows AT_CHECK([ovs-ofctl add-flows br0 flows]) -AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout]) +AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout]) AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1 ]) OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"]) AT_CLEANUP + +AT_SETUP([ofproto-dpif packet-out controller]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1, 2) + +AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller']) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234']) +done + +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +]) + +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl + dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535 +NXST_FLOW reply: +]) + +(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): + table 0: + active=1, lookup=0, matched=0" + x=1 + while test $x -lt 254; do + echo " + table $x: + active=0, lookup=0, matched=0" + x=`expr $x + 1` + done) > expout +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif packet-out controller (patch port)]) +OVS_VSWITCHD_START( + [-- \ + add-port br0 p1 -- \ + set interface p1 type=patch options:peer=p2 -- \ + add-br br1 -- \ + set bridge br1 datapath-type=dummy -- \ + set bridge br1 fail-mode=secure -- \ + set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \ + add-port br1 p2 -- \ + set interface p2 type=patch options:peer=p1 --]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234']) +done + +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +]) + +(printf "OFPST_TABLE reply (OF1.3) (xid=0x2):" + x=0 + while test $x -lt 254; do + echo " + table $x: + active=0, lookup=0, matched=0" + x=`expr $x + 1` + done) > expout +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout]) + +(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): + table 0: + active=0, lookup=3, matched=0" + x=1 + while test $x -lt 254; do + echo " + table $x: + active=0, lookup=0, matched=0" + x=`expr $x + 1` + done) > expout +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([ofproto-dpif packet-out goto_table]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1, 2) + +AT_DATA([flows.txt], [dnl +table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1) +table=1 dl_dst=50:54:00:00:00:0a actions=controller +]) +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)' +done + +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl + n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1 + table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535 +OFPST_FLOW reply (OF1.3): +]) + +(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): + table 0: + active=1, lookup=3, matched=3 + + table 1: + active=1, lookup=3, matched=3" + x=2 + while test $x -lt 254; do + echo " + table $x: + active=0, lookup=0, matched=0" + x=`expr $x + 1` + done) > expout +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([ofproto-dpif packet-out table-miss (continue)]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1, 2) + +AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller']) +AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) +AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +for i in 1 2 3; do + ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)' +done + +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6]) +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +dnl +NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) +vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234 +]) + +AT_CHECK([ovs-appctl revalidator/purge], [0]) +AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl + table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535 +OFPST_FLOW reply (OF1.1): +]) + +(echo "OFPST_TABLE reply (OF1.3) (xid=0x2): + table 0: + active=0, lookup=3, matched=0 + + table 1: + active=1, lookup=3, matched=3" + x=2 + while test $x -lt 254; do + echo " + table $x: + active=0, lookup=0, matched=0" + x=`expr $x + 1` + done) > expout +AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([ofproto-dpif - ICMPv6]) OVS_VSWITCHD_START ADD_OF_PORTS([br0], 1) @@ -4633,8 +6646,46 @@ AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered) -icmp6,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::260:97ff:fe07:69ea,nd_sll=00:00:86:05:80:da,nd_tll=00:00:00:00:00:00 +icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::260:97ff:fe07:69ea,nd_sll=00:00:86:05:80:da,nd_tll=00:00:00:00:00:00 icmp6_csum:68bd +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update]) +OVS_VSWITCHD_START +ADD_OF_PORTS([br0], 1) +AT_CHECK([ovs-ofctl add-flow br0 icmp6,icmpv6_type=135,action=set_field:fe80::1-\>nd_target,set_field:32:21:14:86:11:74-\>nd_sll,output:controller]) + +AT_CAPTURE_FILE([ofctl_monitor.log]) + +AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da' + +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered) +icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::1,nd_sll=32:21:14:86:11:74,nd_tll=00:00:00:00:00:00 icmp6_csum:19d3 ]) OVS_VSWITCHD_STOP AT_CLEANUP + +# Tests the exact match of CFI bit in installed datapath flows matching VLAN. +AT_SETUP([ofproto-dpif - vlan matching]) +OVS_VSWITCHD_START( + [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +AT_CHECK([ovs-ofctl del-flows br0]) +AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"]) + +AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))']) + +AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[1]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl +recirc_id=0,ip,in_port=1,dl_vlan=10,nw_frag=no, actions: +]) +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ofproto-macros.at openvswitch-2.4.0~git20150623/tests/ofproto-macros.at --- openvswitch-2.3.1/tests/ofproto-macros.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ofproto-macros.at 2015-06-23 18:46:21.000000000 +0000 @@ -15,6 +15,23 @@ ' } +# Filter (multiline) vconn debug messages from ovs-vswitchd.log. +# Use with vconn_windows_sub() and ofctl_strip() +print_vconn_debug () { awk -F\| < ovs-vswitchd.log ' +BEGIN { prt=0 } +/\|vconn\|DBG\|/ { sub(/[ \t]*$/, ""); print $3 "|" $4 "|" $5; prt=1; next } +$4 != "" { prt=0; next } +prt==1 { sub(/[ \t]*$/, ""); print $0 } +' +} + +vconn_windows_sub() { + sed ' +s/tcp:127.0.0.1:[0-9][0-9]*:/unix:/ +s/No error/Success/ +' +} + # parse_listening_port [SERVER] # # Parses the TCP or SSL port on which a server is listening from the @@ -36,27 +53,19 @@ m4_define([STRIP_XIDS], [[sed 's/ (xid=0x[0-9a-fA-F]*)//']]) m4_define([STRIP_DURATION], [[sed 's/\bduration=[0-9.]*s/duration=?s/']]) m4_define([STRIP_USED], [[sed 's/used:[0-9]\.[0-9]*/used:0.0/']]) +m4_define([STRIP_UFID], [[sed 's/ufid:[-0-9a-f]* //']]) m4_define([TESTABLE_LOG], [-vPATTERN:ANY:'%c|%p|%m']) -# OVS_VSWITCHD_START([vsctl-args], [vsctl-output], [=override]) +# _OVS_VSWITCHD_START([vswitchd-aux-args]) # -# Creates a database and starts ovsdb-server, starts ovs-vswitchd -# connected to that database, calls ovs-vsctl to create a bridge named -# br0 with predictable settings, passing 'vsctl-args' as additional -# commands to ovs-vsctl. If 'vsctl-args' causes ovs-vsctl to provide -# output (e.g. because it includes "create" commands) then 'vsctl-output' -# specifies the expected output after filtering through uuidfilt.pl. +# Creates an empty database and starts ovsdb-server. +# Starts ovs-vswitchd, with additional arguments 'vswitchd-aux-args'. # -# If a test needs to use "system" devices (as dummies), then specify -# =override (literally) as the third argument. Otherwise, system devices -# won't work at all (which makes sense because tests should not access a -# system's real Ethernet devices). -m4_define([OVS_VSWITCHD_START], +m4_define([_OVS_VSWITCHD_START], [OVS_RUNDIR=`pwd`; export OVS_RUNDIR OVS_LOGDIR=`pwd`; export OVS_LOGDIR OVS_DBDIR=`pwd`; export OVS_DBDIR OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - ON_EXIT([kill `cat ovsdb-server.pid ovs-vswitchd.pid`]) dnl Create database. touch .conf.db.~lock~ @@ -64,6 +73,7 @@ dnl Start ovsdb-server. AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock], [0], [], [stderr]) + ON_EXIT_UNQUOTED([kill `cat ovsdb-server.pid`]) AT_CHECK([[sed < stderr ' /vlog|INFO|opened log file/d /ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d']]) @@ -73,14 +83,33 @@ AT_CHECK([ovs-vsctl --no-wait init]) dnl Start ovs-vswitchd. - AT_CHECK([ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy$3 --disable-system --log-file -vvconn -vofproto_dpif], [0], [], [stderr]) + AT_CHECK([ovs-vswitchd $1 --detach --no-chdir --pidfile --log-file -vvconn -vofproto_dpif], [0], [], [stderr]) AT_CAPTURE_FILE([ovs-vswitchd.log]) + ON_EXIT_UNQUOTED([kill `cat ovs-vswitchd.pid`]) AT_CHECK([[sed < stderr ' +/ovs_numa|INFO|Discovered /d /vlog|INFO|opened log file/d /vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d /reconnect|INFO|/d /ofproto|INFO|using datapath ID/d /ofproto|INFO|datapath ID changed to fedcba9876543210/d']]) +]) + +# OVS_VSWITCHD_START([vsctl-args], [vsctl-output], [=override]) +# +# Creates a database and starts ovsdb-server, starts ovs-vswitchd +# connected to that database, calls ovs-vsctl to create a bridge named +# br0 with predictable settings, passing 'vsctl-args' as additional +# commands to ovs-vsctl. If 'vsctl-args' causes ovs-vsctl to provide +# output (e.g. because it includes "create" commands) then 'vsctl-output' +# specifies the expected output after filtering through uuidfilt.pl. +# +# If a test needs to use "system" devices (as dummies), then specify +# =override (literally) as the third argument. Otherwise, system devices +# won't work at all (which makes sense because tests should not access a +# system's real Ethernet devices). +m4_define([OVS_VSWITCHD_START], + [_OVS_VSWITCHD_START([--enable-dummy$3 --disable-system]) dnl Add bridges, ports, etc. AT_CHECK([ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2]) @@ -113,6 +142,13 @@ AT_CHECK([ovs-appctl -t ovs-vswitchd exit]) AT_CHECK([ovs-appctl -t ovsdb-server exit])]) +m4_define([OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP], + [AT_CHECK([ovs-appctl ofproto/tnl-push-pop off], [0], [dnl +Tunnel push-pop off +])]) + + [AT_CHECK([ovs-appctl ofproto/tnl-push-pop off])]) + # ADD_OF_PORTS(BRIDGE, OF_PORT[, OF_PORT...]) # # Creates a dummy interface with an OpenFlow port number of OF_PORT and @@ -123,3 +159,12 @@ [ovs-vsctl m4_foreach([of_port], m4_cdr($@), [ \ -- add-port $1 p[]of_port -- set Interface p[]of_port type=dummy ofport_request=of_port])]) + +# WAIT_FOR_DUMMY_PORTS(NETDEV_DUMMY_PORT[, NETDEV_DUMMY_PORT...]) +# +# Wait until the netdev dummy ports are connected to each other +m4_define([WAIT_FOR_DUMMY_PORTS], \ + [m4_foreach([dummy_port], [$@], + [ \ + OVS_WAIT_WHILE([ovs-appctl netdev-dummy/conn-state dummy_port \ + | grep 'unknown\|disconnected'])])]) diff -Nru openvswitch-2.3.1/tests/ovsdb-condition.at openvswitch-2.4.0~git20150623/tests/ovsdb-condition.at --- openvswitch-2.3.1/tests/ovsdb-condition.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovsdb-condition.at 2015-06-23 18:46:21.000000000 +0000 @@ -576,3 +576,84 @@ condition 30: TTT-T -T-T- T---- condition 31: T-T-T ---T- ----- condition 32: ----- T---- ---T-], [condition]) + +OVSDB_CHECK_POSITIVE([evaluating conditions on optional integers], + [[evaluate-conditions \ + '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": 1}}}}' \ + '[[["i", "<", 1]], + [["i", "<=", 1]], + [["i", "==", 1]], + [["i", "!=", 1]], + [["i", ">=", 1]], + [["i", ">", 1]], + [["i", "includes", 1]], + [["i", "excludes", 1]], + [["i", ">", 0], ["i", "<", 2]]]' \ + '[{"i": ["set", []]}, + {"i": ["set", [0]]}, + {"i": ["set", [1]]}, + {"i": ["set", [2]]}]']], + [dnl +condition 0: -T-- +condition 1: -TT- +condition 2: --T- +condition 3: TT-T +condition 4: --TT +condition 5: ---T +condition 6: --T- +condition 7: TT-T +condition 8: --T-], [condition]) + +OVSDB_CHECK_POSITIVE([evaluating conditions on optional strings], + [[evaluate-conditions \ + '{"columns": {"s": {"type": {"key": "string", "min": 0, "max": 1}}}}' \ + '[[["s", "==", ""]], + [["s", "!=", ""]], + [["s", "includes", ""]], + [["s", "excludes", ""]], + [["s", "==", "foo"]], + [["s", "!=", "foo"]], + [["s", "includes", "foo"]], + [["s", "excludes", "foo"]], + [["s", "!=", "foo"], ["s", "!=", ""]]]' \ + '[{"s": ["set", [""]]}, + {"s": ["set", ["foo"]]}, + {"s": ["set", ["xxx"]]}, + {"s": ["set", []]}]']], + [dnl +condition 0: T--- +condition 1: -TTT +condition 2: T--- +condition 3: -TTT +condition 4: -T-- +condition 5: T-TT +condition 6: -T-- +condition 7: T-TT +condition 8: --TT], [condition]) + +OVSDB_CHECK_POSITIVE([evaluating conditions on optional reals], + [[evaluate-conditions \ + '{"columns": {"r": {"type": {"key": "real", "min": 0, "max": 1}}}}' \ + '[[["r", "<", 5.0]], + [["r", "<=", 5.0]], + [["r", "==", 5.0]], + [["r", "!=", 5.0]], + [["r", ">=", 5.0]], + [["r", ">", 5.0]], + [["r", "includes", 5.0]], + [["r", "excludes", 5.0]], + [["r", "!=", 0], ["r", "!=", 5.1]]]' \ + '[{"r": ["set", [0]]}, + {"r": ["set", [5.0]]}, + {"r": ["set", [5.1]]}, + {"r": ["set", []]}]']], + [dnl +condition 0: T--- +condition 1: TT-- +condition 2: -T-- +condition 3: T-TT +condition 4: -TT- +condition 5: --T- +condition 6: -T-- +condition 7: T-TT +condition 8: -T-T], [condition]) diff -Nru openvswitch-2.3.1/tests/ovsdb-data.at openvswitch-2.4.0~git20150623/tests/ovsdb-data.at --- openvswitch-2.3.1/tests/ovsdb-data.at 2013-04-03 11:38:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovsdb-data.at 2015-06-23 18:46:21.000000000 +0000 @@ -286,6 +286,14 @@ [parse-atom-strings '[["string"]]' '"asdf'], ["asdf: missing quote at end of quoted string]) +OVSDB_CHECK_NEGATIVE([quoted string must not contain unescaped quote], + [parse-atom-strings '[["string"]]' '"as"df"'], + ["as"df": quoted string may not include unescaped "]) + +OVSDB_CHECK_NEGATIVE([quoted string must not end with backslash], + [parse-atom-strings '[["string"]]' '"asdf\"'], + ["asdf\": quoted string may not end with backslash]) + OVSDB_CHECK_NEGATIVE([uuids must be valid], [parse-atom-strings '[["uuid"]]' '1234-5678'], ["1234-5678" is not a valid UUID]) diff -Nru openvswitch-2.3.1/tests/ovsdb-idl.at openvswitch-2.4.0~git20150623/tests/ovsdb-idl.at --- openvswitch-2.3.1/tests/ovsdb-idl.at 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovsdb-idl.at 2015-06-23 18:46:21.000000000 +0000 @@ -496,3 +496,95 @@ 002: i=2 k=2 ka=[] l2= uuid=<0> 003: done ]]) + +OVSDB_CHECK_IDL_PY([row-from-json idl, whats this], + [['["idltest", + {"op": "insert", + "table": "simple", + "row": {"i": 1}}, + {"op": "insert", + "table": "simple", + "row": {}}]']], + [['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']], + [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> +001: commit, status=success, events=create|2|None, delete|0|None, update|1|b +002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> +002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> +003: done +]]) + +AT_SETUP([idl handling of missing tables and columns - C]) +AT_KEYWORDS([ovsdb server idl positive]) +OVS_RUNDIR=`pwd`; export OVS_RUNDIR + +# idltest2.ovsschema is the same as idltest.ovsschema, except that +# table link2 and column l2 have been deleted. But the IDL still +# expects them to be there, so this test checks that it properly +# tolerates them being missing. +AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest2.ovsschema], + [0], [stdout], [ignore]) +AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore]) +AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest", + {"op": "insert", + "table": "link1", + "row": {"i": 0, "k": ["named-uuid", "self"]}, + "uuid-name": "self"}]' \ + '["idltest", + {"op": "insert", + "table": "link1", + "row": {"i": 1, "k": ["named-uuid", "row2"]}, + "uuid-name": "row1"}, + {"op": "insert", + "table": "link1", + "row": {"i": 2, "k": ["named-uuid", "row1"]}, + "uuid-name": "row2"}]' \ + '["idltest", + {"op": "update", + "table": "link1", + "where": [["i", "==", 1]], + "row": {"k": ["uuid", "#1#"]}}]' \ + '["idltest", + {"op": "update", + "table": "link1", + "where": [], + "row": {"k": ["uuid", "#0#"]}}]']], + [0], [stdout], [stderr], [kill `cat pid`]) +AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl], [0], + [[000: empty +001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} +002: i=0 k=0 ka=[] l2= uuid=<0> +003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]} +004: i=0 k=0 ka=[] l2= uuid=<0> +004: i=1 k=2 ka=[] l2= uuid=<1> +004: i=2 k=1 ka=[] l2= uuid=<2> +005: {"error":null,"result":[{"count":1}]} +006: i=0 k=0 ka=[] l2= uuid=<0> +006: i=1 k=1 ka=[] l2= uuid=<1> +006: i=2 k=1 ka=[] l2= uuid=<2> +007: {"error":null,"result":[{"count":3}]} +008: i=0 k=0 ka=[] l2= uuid=<0> +008: i=1 k=0 ka=[] l2= uuid=<1> +008: i=2 k=0 ka=[] l2= uuid=<2> +009: done +]], [], [kill `cat pid`]) + +# Check that ovsdb-idl figured out that table link2 and column l2 are missing. +AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl +test-ovsdb|ovsdb_idl|idltest database lacks link2 table (database needs upgrade?) +test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?) +]) + +# Check that ovsdb-idl sent on "monitor" request and that it didn't +# mention that table or column, and (for paranoia) that it did mention another +# table and column. +AT_CHECK([grep -c '"monitor"' stderr], [0], [1 +]) +AT_CHECK([grep '"monitor"' stderr | grep link2], [1]) +AT_CHECK([grep '"monitor"' stderr | grep l2], [1]) +AT_CHECK([grep '"monitor"' stderr | grep -c '"link1"'], [0], [1 +]) +AT_CHECK([grep '"monitor"' stderr | grep -c '"ua"'], [0], [1 +]) +OVSDB_SERVER_SHUTDOWN +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ovsdb-monitor.at openvswitch-2.4.0~git20150623/tests/ovsdb-monitor.at --- openvswitch-2.3.1/tests/ovsdb-monitor.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovsdb-monitor.at 2015-06-23 18:46:21.000000000 +0000 @@ -27,8 +27,14 @@ AT_CAPTURE_FILE([ovsdb-server-log]) AT_CHECK([ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1], [0], [], []) - AT_CHECK([ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket $4 $5 $8 > output], + if test "$IS_WIN32" = "yes"; then + AT_CHECK([ovsdb-client -vjsonrpc --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket $4 $5 $8 > output &], + [0], [ignore], [ignore], [kill `cat server-pid`]) + sleep 1 + else + AT_CHECK([ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket $4 $5 $8 > output], [0], [ignore], [ignore], [kill `cat server-pid`]) + fi m4_foreach([txn], [$6], [AT_CHECK([ovsdb-client transact unix:socket 'txn'], [0], [ignore], [ignore], [kill `cat server-pid client-pid`])]) diff -Nru openvswitch-2.3.1/tests/ovsdb-monitor-sort.pl openvswitch-2.4.0~git20150623/tests/ovsdb-monitor-sort.pl --- openvswitch-2.3.1/tests/ovsdb-monitor-sort.pl 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovsdb-monitor-sort.pl 2015-06-23 18:46:21.000000000 +0000 @@ -30,6 +30,9 @@ print "$_\n" foreach sort { compare_lines($a, $b) } @group; } +if ("$^O" eq "msys") { + $/ = "\r\n"; +} my @group = (); while () { chomp; diff -Nru openvswitch-2.3.1/tests/ovsdb-server.at openvswitch-2.4.0~git20150623/tests/ovsdb-server.at --- openvswitch-2.3.1/tests/ovsdb-server.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovsdb-server.at 2015-06-23 18:46:21.000000000 +0000 @@ -42,6 +42,7 @@ AT_SETUP([truncating corrupted database log]) AT_KEYWORDS([ovsdb server positive unix]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) OVS_RUNDIR=`pwd`; export OVS_RUNDIR ordinal_schema > schema AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore]) @@ -89,6 +90,7 @@ AT_SETUP([truncating database log with bad transaction]) AT_KEYWORDS([ovsdb server positive unix]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) OVS_RUNDIR=`pwd`; export OVS_RUNDIR ordinal_schema > schema AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore]) @@ -161,7 +163,7 @@ ], [ignore], [test ! -e pid || kill `cat pid`]) AT_CHECK( [[ovstest test-jsonrpc request unix:socket get_schema [\"nonexistent\"]]], [0], - [[{"error":null,"id":0,"result":{"details":"get_schema request specifies unknown database nonexistent","error":"unknown database","syntax":"[\"nonexistent\"]"}} + [[{"error":{"details":"get_schema request specifies unknown database nonexistent","error":"unknown database","syntax":"[\"nonexistent\"]"},"id":0,"result":null} ]], [], [test ! -e pid || kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP @@ -194,10 +196,17 @@ AT_CHECK([ovsdb-client list-tables unix:socket ordinals], [0], [ignore], [ignore]) # Add an already added database. -AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/add-db db2], 2, [], +if test $IS_WIN32 = "yes"; then + AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/add-db db2], 2, [], + [I/O error: db2: failed to lock lockfile (Resource deadlock avoided) +ovs-appctl: ovsdb-server: server returned an error +]) +else + AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/add-db db2], 2, [], [db2: already open ovs-appctl: ovsdb-server: server returned an error ]) +fi # Add a non-existing database. AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/add-db db3], 2, [], [stderr]) @@ -246,6 +255,7 @@ AT_SETUP([ovsdb-server/add-db with --monitor]) AT_KEYWORDS([ovsdb server positive]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) # Start ovsdb-server, initially with one db. OVS_RUNDIR=`pwd`; export OVS_RUNDIR OVS_LOGDIR=`pwd`; export OVS_LOGDIR @@ -278,6 +288,7 @@ AT_SETUP([ovsdb-server/add-db and remove-db with --monitor]) AT_KEYWORDS([ovsdb server positive]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) # Start ovsdb-server, initially with one db. OVS_RUNDIR=`pwd`; export OVS_RUNDIR OVS_LOGDIR=`pwd`; export OVS_LOGDIR @@ -349,8 +360,8 @@ "uuid-name": "x", "row": {"target": "punix:socket2"}}]']], [0], [ignore], [ignore]) ON_EXIT([kill `cat ovsdb-server.pid`]) -AT_CHECK([ovsdb-server --enable-dummy --detach --no-chdir --pidfile --remote=db:mydb,Root,managers --remote=db:mydb,Root,manager_options --log-file db], [0], [ignore], [ignore]) -for i in 1 2 3 4 5 6; do ovs-appctl -t ovsdb-server time/warp 1000; done +AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=db:mydb,Root,managers --remote=db:mydb,Root,manager_options --log-file db], [0], [ignore], [ignore]) +ovs-appctl -t ovsdb-server time/warp 6000 1000 AT_CHECK( [[ovsdb-client transact unix:socket1 \ '["mydb", @@ -382,14 +393,22 @@ AT_CHECK([test ! -e socket1]) AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket1]) -OVS_WAIT_UNTIL([test -S socket1]) +if test "$IS_WIN32" = "yes"; then + OVS_WAIT_UNTIL([test -s socket1]) +else + OVS_WAIT_UNTIL([test -S socket1]) +fi AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/list-remotes], [0], [punix:socket1 ]) AT_CHECK([test ! -e socket2]) AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket2]) -OVS_WAIT_UNTIL([test -S socket2]) +if test "$IS_WIN32" = "yes"; then + OVS_WAIT_UNTIL([test -s socket2]) +else + OVS_WAIT_UNTIL([test -S socket2]) +fi AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/list-remotes], [0], [punix:socket1 punix:socket2 @@ -402,7 +421,11 @@ AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/remove-remote punix:socket1]) OVS_WAIT_UNTIL([test ! -e socket1]) -AT_CHECK([test -S socket2]) +if test "$IS_WIN32" = "yes"; then + AT_CHECK([test -s socket2]) +else + AT_CHECK([test -S socket2]) +fi AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/list-remotes], [0], [punix:socket2 ]) @@ -415,6 +438,7 @@ AT_SETUP([ovsdb-server/add-remote with --monitor]) AT_KEYWORDS([ovsdb server positive]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) # Start ovsdb-server, initially with no remotes. OVS_RUNDIR=`pwd`; export OVS_RUNDIR OVS_LOGDIR=`pwd`; export OVS_LOGDIR @@ -445,6 +469,7 @@ AT_SETUP([ovsdb-server/add-remote and remove-remote with --monitor]) AT_KEYWORDS([ovsdb server positive]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) # Start ovsdb-server, initially with no remotes. OVS_RUNDIR=`pwd`; export OVS_RUNDIR OVS_LOGDIR=`pwd`; export OVS_LOGDIR @@ -480,7 +505,10 @@ AT_SETUP([SSL db: implementation]) AT_KEYWORDS([ovsdb server positive ssl $5]) AT_SKIP_IF([test "$HAVE_OPENSSL" = no]) -PKIDIR=$abs_top_builddir/tests +# For this test, we pass PKIDIR through a ovsdb-tool transact and +# msys on Windows does not convert the path style automatically. +# So, do that forcefully with a 'pwd -W' (called through pwd() function). +PKIDIR="$(cd $abs_top_builddir/tests && pwd)" AT_SKIP_IF([expr "$PKIDIR" : ".*[ '\" \\]"]) AT_DATA([schema], @@ -723,6 +751,13 @@ add=`add_ports` AT_CAPTURE_FILE([ovsdb-client.err]) +AT_CAPTURE_FILE([ovsdb-client-nonblock.err]) + + +# Start an ovsdb-client monitoring all changes to the database, +# By default, it is non-blocking, and will get update message +# for each ovsdb-server transaactions. +AT_CHECK([ovsdb-client --detach --no-chdir --pidfile=nonblock.pid monitor ALL >ovsdb-client-nonblock.out 2>ovsdb-client-nonblock.err]) # Start an ovsdb-client monitoring all changes to the database, # make it block to force the buffers to fill up, and then execute @@ -735,8 +770,10 @@ done AT_CHECK([ovs-appctl -t ovsdb-client ovsdb-client/unblock]) OVS_WAIT_UNTIL([grep "\"xyzzy$counter\"" ovsdb-client.out]) +OVS_WAIT_UNTIL([grep "\"xyzzy$counter\"" ovsdb-client-nonblock.out]) AT_CHECK([ovs-appctl -t ovsdb-client exit]) OVS_WAIT_WHILE([test -e ovsdb-client.pid]) +AT_CHECK([kill `cat nonblock.pid`]) # Count the number of updates in the ovsdb-client output, by counting # the number of changes to the Open_vSwitch table. (All of our @@ -745,8 +782,11 @@ # # Check that the counter is what we expect. logged_updates=`grep -c '^Open_vSwitch' ovsdb-client.out` -echo "logged_updates=$logged_updates (expected less than $n_updates)" -AT_CHECK([test $logged_updates -lt $n_updates]) +logged_nonblock_updates=`grep -c '^Open_vSwitch' ovsdb-client-nonblock.out` +echo "logged_nonblock_updates=$logged_nonblock_updates (expected less or equal to $n_updates)" +echo "logged_updates=$logged_updates (expected less than $logged_nonblock_updates)" +AT_CHECK([test $logged_nonblock_updates -le $n_updates]) +AT_CHECK([test $logged_updates -lt $logged_nonblock_updates]) AT_CHECK_UNQUOTED([ovs-vsctl get open_vswitch . system_version], [0], ["xyzzy$counter" ]) @@ -939,6 +979,7 @@ # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS. m4_define([OVSDB_CHECK_EXECUTION], [AT_SETUP([$1]) + AT_SKIP_IF([test "$IS_WIN32" = "yes"]) AT_KEYWORDS([ovsdb server positive transient $5]) OVS_RUNDIR=`pwd`; export OVS_RUNDIR $2 > schema diff -Nru openvswitch-2.3.1/tests/ovsdb-tool.at openvswitch-2.4.0~git20150623/tests/ovsdb-tool.at --- openvswitch-2.3.1/tests/ovsdb-tool.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovsdb-tool.at 2015-06-23 18:46:21.000000000 +0000 @@ -182,8 +182,9 @@ done]], [0], [stdout], [ignore]) dnl Dump out and check the actual database contents. -AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]], - [0], [stdout], [ignore]) +AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], + [0]) +AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl ordinals table _uuid name number @@ -195,6 +196,7 @@ <4> two 2 @&t@ <5> zero 0 @&t@ ]) +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) dnl Now convert the database in-place. touch .db.tmp.~lock~ AT_CHECK([[ovsdb-tool convert db new-schema]], [0], [], [ignore]) @@ -204,8 +206,9 @@ AT_CAPTURE_FILE([db]) AT_CHECK([test `wc -l < db` -eq 4]) dnl And check that the dumped data is the same except for the removed column: -AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]], - [0], [stdout], [ignore]) +AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], + [0]) +AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl ordinals table _uuid number @@ -217,6 +220,7 @@ <4> 4 @&t@ <5> 5 @&t@ ]) +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CLEANUP AT_SETUP([ovsdb-tool convert -- adding a column]) @@ -245,8 +249,9 @@ done]], [0], [stdout], [ignore]) dnl Dump out and check the actual database contents. -AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]], - [0], [stdout], [ignore]) +AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], + [0]) +AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl ordinals table _uuid number @@ -258,6 +263,7 @@ <4> 4 @&t@ <5> 5 @&t@ ]) +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) dnl Now convert the database in-place. touch .db.tmp.~lock~ AT_CHECK([[ovsdb-tool convert db new-schema]], [0], [], [ignore]) @@ -267,8 +273,9 @@ AT_CAPTURE_FILE([db]) AT_CHECK([test `wc -l < db` -eq 4]) dnl And check that the dumped data is the same except for the added column: -AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]], - [0], [stdout], [ignore]) +AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]], + [0]) +AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore]) AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [dnl ordinals table _uuid name number @@ -280,6 +287,7 @@ <4> "" 4 @&t@ <5> "" 5 @&t@ ]) +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CLEANUP AT_SETUP([ovsdb-tool schema-version]) diff -Nru openvswitch-2.3.1/tests/ovs-macros.at openvswitch-2.4.0~git20150623/tests/ovs-macros.at --- openvswitch-2.3.1/tests/ovs-macros.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovs-macros.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,117 @@ +AT_TESTED([ovs-vswitchd]) +AT_TESTED([ovs-vsctl]) +AT_TESTED([perl]) + +m4_include([m4/compat.at]) + +m4_divert_push([PREPARE_TESTS]) +[ +ovs_wait () { + # First try a quick sleep, so that the test completes very quickly + # in the normal case. POSIX doesn't require fractional times to + # work, so this might not work. + sleep 0.1 + ovs_wait_cond && exit 0 + # Then wait up to 10 seconds. + for d in 0 1 2 3 4 5 6 7 8 9; do + sleep 1 + ovs_wait_cond && exit 0 + done + exit 1 +} + +# Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout. +seq () { + while test $1 -le $2; do + echo $1 + set `expr $1 + ${3-1}` $2 $3 + done +} + +if test "$IS_WIN32" = "yes"; then + pwd () { + command pwd -W "$@" + } + + diff () { + command diff --strip-trailing-cr "$@" + } + + kill () { + case "$1" in + -0) + shift + for i in $*; do + # tasklist will always have return code 0. + # If pid does exist, there will be a line with the pid. + if tasklist //fi "PID eq $i" | grep $i >/dev/null; then + : + else + return 1 + fi + done + return 0 + ;; + -[1-9]*) + shift + for i in $*; do + if tasklist //fi "PID eq $i" | grep $i >/dev/null; then + tskill $i + fi + done + ;; + [1-9][0-9]*) + for i in $*; do + if tasklist //fi "PID eq $i" | grep $i >/dev/null; then + tskill $i + fi + done + ;; + esac + } +fi +] +m4_divert_pop([PREPARE_TESTS]) + +m4_define([OVS_WAIT], + [AT_CHECK( + [ovs_wait_cond () { $1 +} +ovs_wait], [0], [ignore], [ignore], [$2])]) +m4_define([OVS_WAIT_UNTIL], [OVS_WAIT([$1], [$2])]) +m4_define([OVS_WAIT_WHILE], + [OVS_WAIT([if $1; then return 1; else return 0; fi], [$2])]) + +dnl OVS_APP_EXIT_AND_WAIT(DAEMON) +dnl +dnl Ask the daemon named DAEMON to exit, via ovs-appctl, and then waits for it +dnl to exit. +m4_define([OVS_APP_EXIT_AND_WAIT], + [ovs-appctl -t $1 exit + OVS_WAIT_WHILE([test -e $1.pid])]) + +m4_define([ON_EXIT__], [trap '. ./cleanup' 0; cat - cleanup << $2 > __cleanup +$1 +EOF +mv __cleanup cleanup +]) + +dnl ON_EXIT([COMMANDS]) +dnl ON_EXIT_UNQUOTED([COMMANDS]) +dnl +dnl Add the shell COMMANDS to a collection executed when the current test +dnl completes, as a cleanup action. (The most common use is to kill a +dnl daemon started by the test. This is important to prevent tests that +dnl start daemons from hanging at exit.) +dnl +dnl The only difference between ON_EXIT and ON_EXIT_UNQUOTED is that only the +dnl latter performs shell variable (e.g. $var) substitution, command +dnl substitution (e.g. `command`), and backslash escaping (e.g. \\ becomes \) +dnl in COMMANDS at the time that ON_EXIT_UNQUOTED is encountered. ON_EXIT, +dnl in contrast, copies the literal COMMANDS and only executes shell expansion +dnl at cleanup time. +dnl +dnl Cleanup commands are executed in the reverse order of execution of +dnl these macros. +m4_define([ON_EXIT], [ON_EXIT__([$1], ['EOF'])]) +m4_define([ON_EXIT_UNQUOTED], [ON_EXIT__([$1], [EOF])]) diff -Nru openvswitch-2.3.1/tests/ovs-ofctl.at openvswitch-2.4.0~git20150623/tests/ovs-ofctl.at --- openvswitch-2.3.1/tests/ovs-ofctl.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovs-ofctl.at 2015-06-23 18:46:21.000000000 +0000 @@ -13,6 +13,10 @@ 'tun_flags=1/1 none' \ 'tun_tos=0 none' \ 'tun_ttl=0 none' \ + 'tun_gbp_id=0 NXM,OXM' \ + 'tun_gbp_id=0/0x1 NXM,OXM' \ + 'tun_gbp_flags=0 NXM,OXM' \ + 'tun_gbp_flags=0/0x1 NXM,OXM' \ 'metadata=0 NXM,OXM,OpenFlow11' \ 'metadata=1/1 NXM,OXM,OpenFlow11' \ 'in_port=1 any' \ @@ -35,6 +39,14 @@ 'reg6=6/1 NXM,OXM' \ 'reg7=7 NXM,OXM' \ 'reg7=7/1 NXM,OXM' \ + 'xreg0=0 NXM,OXM' \ + 'xreg0=0/1 NXM,OXM' \ + 'xreg1=1 NXM,OXM' \ + 'xreg1=1/1 NXM,OXM' \ + 'xreg2=2 NXM,OXM' \ + 'xreg2=2/3 NXM,OXM' \ + 'xreg3=3 NXM,OXM' \ + 'xreg3=3/5 NXM,OXM' \ 'dl_src=00:11:22:33:44:55 any' \ 'dl_src=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \ 'dl_dst=00:11:22:33:44:55 any' \ @@ -61,9 +73,9 @@ 'ip,ip_dst=192.168.0.0/24 any' \ 'ip,ip_dst=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \ 'ipv6,ipv6_src=::1 NXM,OXM' \ - 'ipv6,ipv6_src=::1/::1 NXM,OXM' \ + 'ipv6,ipv6_src=0:0:0:0:0:0:0:1/::1 NXM,OXM' \ 'ipv6,ipv6_dst=::1 NXM,OXM' \ - 'ipv6,ipv6_dst=::1/::1 NXM,OXM' \ + 'ipv6,ipv6_dst=0:0:0:0:0:0:0:1/::1 NXM,OXM' \ 'ipv6,ipv6_label=5 NXM,OXM' \ 'ipv6,ipv6_label=5/1 NXM,OXM' \ 'ip,nw_proto=1 any' \ @@ -128,7 +140,7 @@ AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.0)]) AT_DATA([flows.txt], [[ # comment -tcp,tp_src=123,out_port=5,actions=flood +tcp,tp_src=123,actions=flood in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 @@ -147,7 +159,7 @@ AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [[usable protocols: any chosen protocol: OpenFlow10-table_id -OFPT_FLOW_MOD: ADD tcp,tp_src=123 out_port:5 actions=FLOOD +OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD OFPT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 @@ -165,7 +177,7 @@ AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.1)]) AT_DATA([flows.txt], [[ # comment -tcp,tp_src=123,out_port=5,actions=flood +tcp,tp_src=123,actions=flood in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 @@ -184,7 +196,7 @@ AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [[usable protocols: any chosen protocol: OpenFlow11 -OFPT_FLOW_MOD (OF1.1): ADD tcp,tp_src=123 out_port:5 actions=FLOOD +OFPT_FLOW_MOD (OF1.1): ADD tcp,tp_src=123 actions=FLOOD OFPT_FLOW_MOD (OF1.1): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop OFPT_FLOW_MOD (OF1.1): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 OFPT_FLOW_MOD (OF1.1): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 @@ -582,7 +594,6 @@ NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/ffffffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/00000000) NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014) NXM_OF_IP_SRC_W(C0D80000/FFFF0000) @@ -591,7 +602,6 @@ NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/ffffffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/00000000) NXM_OF_IP_DST(ac100014) NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000) @@ -599,35 +609,30 @@ NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/0000) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231) # TCP destination port NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/0000) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231) # TCP flags NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS(0131) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00F0/0FF0) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(01E2/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00E1/0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_NX_TCP_FLAGS(4321) +NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_NX_TCP_FLAGS(0fff) # UDP source port NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/0000) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823) # UDP destination port NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/FFFF) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/0000) NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293) # ICMP type @@ -652,16 +657,14 @@ NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/00000000) NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) -NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000) +NXM_OF_ARP_SPA_W(C0D80000/FFFF0000) # ARP destination protocol address NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014) NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777) NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/00000000) NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) @@ -684,19 +687,17 @@ # RARP source protocol address NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA(ac100014) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) +NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81200/FFFFFF00) NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/00000000) NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) -NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000) +NXM_OF_ARP_SPA_W(C0D80000/FFFF0000) # RARP destination protocol address NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA(ac100014) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) +NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81200/FFFFFF00) NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/77777777) NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/00000000) NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) @@ -717,14 +718,14 @@ NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000) NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) -NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) +NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffff000000000000) # IPv6 destination NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777) NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) +NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000) NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) # IPv6 Flow Label @@ -737,7 +738,7 @@ NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210) NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/ffffffffffffffffffffffffffffffff) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/00000000000000000000000000000000) +NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(00000000000000000000000000000000/00000000000000000000000000000000) NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef) # ND source hardware address @@ -786,22 +787,30 @@ NXM_NX_COOKIE(00000000abcdef01) NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF) NXM_NX_COOKIE_W(84200000abcdef01/ffffffffffffffff) -NXM_NX_COOKIE_W(84200000abcdef01/0000000000000000) +NXM_NX_COOKIE_W(0000000000000000/0000000000000000) # Tunnel ID. NXM_NX_TUN_ID(00000000abcdef01) NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF) NXM_NX_TUN_ID_W(84200000abcdef01/FFFFFFFFFFFFFFFF) -NXM_NX_TUN_ID_W(84200000abcdef01/0000000000000000) +NXM_NX_TUN_ID_W(0000000000000000/0000000000000000) # Register 0. NXM_NX_REG0(acebdf56) NXM_NX_REG0_W(a0e0d050/f0f0f0f0) NXM_NX_REG0_W(a0e0d050/ffffffff) -NXM_NX_REG0_W(a0e0d050/00000000) +NXM_NX_REG0_W(00000000/00000000) + +# dp_hash (testing experimenter OXM). +NXM_NX_DP_HASH(01234567) +NXOXM_ET_DP_HASH(01234567) # Invalid field number. -01020304(1111/2222) +01020304(1111/3333) + +# Invalid field numbers (experimenter OXM). +ffff020800002320(11112222) +ffff030800002320(1111/3333) # Unimplemented registers. # @@ -823,17 +832,17 @@ NXM_OF_ETH_DST(0002e30f80a4) NXM_OF_ETH_DST_W(010000000000/010000000000) NXM_OF_ETH_DST_W(000000000000/010000000000) -NXM_OF_ETH_DST_W(010000000000/010000000000) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_DST(0002e30f80a4) - +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) -NXM_OF_ETH_DST_W(40125218000a/5a5a5a5a5a5a) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS # eth src NXM_OF_ETH_SRC(020898456ddb) -NXM_OF_ETH_SRC_W(012345014545/ffffff555555) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_SRC(020898456ddb) - +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS # eth type NXM_OF_ETH_TYPE(0800) @@ -847,7 +856,7 @@ NXM_OF_VLAN_TCI(0123) NXM_OF_VLAN_TCI_W(1123/1fff) NXM_OF_VLAN_TCI(1123) - +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_VLAN_TCI_W(f000/f000) NXM_OF_VLAN_TCI_W(0000/e000) @@ -874,18 +883,16 @@ # IP source NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(40080000/5a5a5a5a) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80000) -NXM_OF_ETH_TYPE(0800) nx_pull_match() returned error OFPBMC_BAD_PREREQ nx_pull_match() returned error OFPBMC_BAD_PREREQ # IP destination NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(40080000/5a5a5a5a) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(c0a80000) -NXM_OF_ETH_TYPE(0800) nx_pull_match() returned error OFPBMC_BAD_PREREQ nx_pull_match() returned error OFPBMC_BAD_PREREQ @@ -893,35 +900,30 @@ NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(5050) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06) nx_pull_match() returned error OFPBMC_BAD_PREREQ # TCP destination port NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(fde0) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06) nx_pull_match() returned error OFPBMC_BAD_PREREQ # TCP flags NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0131) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS_W(00f0/0ff0) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(01e2) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06) nx_pull_match() returned error OFPBMC_BAD_PREREQ # UDP source port NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(0132) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11) nx_pull_match() returned error OFPBMC_BAD_PREREQ # UDP destination port NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f) NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(5005) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11) nx_pull_match() returned error OFPBMC_BAD_PREREQ # ICMP type @@ -943,19 +945,17 @@ # ARP source protocol address NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(80a80200/aaaaaa00) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a81234) -NXM_OF_ETH_TYPE(0806) nx_pull_match() returned error OFPBMC_BAD_PREREQ nx_pull_match() returned error OFPBMC_BAD_PREREQ # ARP destination protocol address NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(40201234/77777777) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(c0a81234) -NXM_OF_ETH_TYPE(0806) nx_pull_match() returned error OFPBMC_BAD_PREREQ nx_pull_match() returned error OFPBMC_BAD_PREREQ @@ -979,18 +979,16 @@ # RARP source protocol address NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(ac100014) NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(80a80200/aaaaaa00) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(c0a81234) -NXM_OF_ETH_TYPE(8035) nx_pull_match() returned error OFPBMC_BAD_PREREQ nx_pull_match() returned error OFPBMC_BAD_PREREQ # RARP destination protocol address NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(ac100014) NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(40201234/77777777) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(c0a81234) -NXM_OF_ETH_TYPE(8035) nx_pull_match() returned error OFPBMC_BAD_PREREQ nx_pull_match() returned error OFPBMC_BAD_PREREQ @@ -1008,15 +1006,15 @@ NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) nx_pull_match() returned error OFPBMC_BAD_PREREQ NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(00000818184800000000000000000000/5a5a5a5a5a5a5a5a0000000000000000) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000000) -NXM_OF_ETH_TYPE(86dd) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS nx_pull_match() returned error OFPBMC_BAD_PREREQ # IPv6 destination NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) nx_pull_match() returned error OFPBMC_BAD_PREREQ -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010530344500010000000000000000/77777777777777777777777777777777) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010000000000000000) NXM_OF_ETH_TYPE(86dd) nx_pull_match() returned error OFPBMC_BAD_PREREQ @@ -1029,10 +1027,10 @@ # ND target address NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET_W(00010520080900010000000000040000/0123456789abcdeffedcba9876543210) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87) -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET_W(20000898344400000002000300000005/fedcba98765432100123456789abcdef) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS # ND source hardware address NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005), NXM_NX_ND_SLL(0002e30f80a4) @@ -1058,7 +1056,7 @@ NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02) NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS nx_pull_match() returned error OFPBMC_BAD_VALUE # IPv6 fragments. @@ -1072,7 +1070,7 @@ NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01) NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02) NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) nx_pull_match() returned error OFPBMC_BAD_VALUE @@ -1094,9 +1092,17 @@ NXM_NX_REG0(a0e0d050) +# dp_hash (testing experimenter OXM). +NXM_NX_DP_HASH(01234567) +NXM_NX_DP_HASH(01234567) + # Invalid field number. nx_pull_match() returned error OFPBMC_BAD_FIELD +# Invalid field numbers (experimenter OXM). +nx_pull_match() returned error OFPBMC_BAD_FIELD +nx_pull_match() returned error OFPBMC_BAD_FIELD + # Unimplemented registers. # # This test assumes that at least two registers, but fewer than 16, @@ -1109,12 +1115,12 @@ # Check that at least the first warning made it. (It's rate-limited # so a variable number could show up, especially under valgrind etc.) -AT_CHECK([grep 'has 1-bits in value' stderr | sed 1q], [0], [dnl -nx_match|WARN|NXM/OXM entry NXM_OF_ETH_DST_W(ffffffffffff/010000000000) has 1-bits in value for bits wildcarded by the mask. (Future versions of OVS may report this as an OpenFlow error.) +AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl +nx_match|WARN|Rejecting NXM/OXM entry 0:0:1:1:12 with 1-bits in value for bits wildcarded by the mask. ]) # Check that there wasn't any other stderr output. -AT_CHECK([grep -v 'has 1-bits in value' stderr], [1]) +AT_CHECK([grep -v '1-bits in value' stderr], [1]) AT_CLEANUP AT_SETUP([ovs-ofctl parse-ofp10-match]) @@ -1661,19 +1667,25 @@ AT_SETUP([ovs-ofctl parse-nx-match loose]) AT_KEYWORDS([nx-match]) AT_DATA([nx-match.txt], [dnl -NXM_OF_IN_PORT(0001), 01020304(1111/2222), NXM_OF_ETH_TYPE(0800) +NXM_OF_IN_PORT(0001), 01020304(1111/3333), NXM_OF_ETH_TYPE(0800) +NXM_OF_IN_PORT(0001), ffff020800002320(11112222), NXM_OF_ETH_TYPE(0800) +NXM_OF_IN_PORT(0001), ffff030800002320(1111/3333), NXM_OF_ETH_TYPE(0800) ]) AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl nx_pull_match() returned error OFPBMC_BAD_FIELD +nx_pull_match() returned error OFPBMC_BAD_FIELD +nx_pull_match() returned error OFPBMC_BAD_FIELD ]) AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) +NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) +NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) ]) AT_CLEANUP -AT_SETUP([ovs-ofctl parse-oxm]) +AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.2)]) AT_KEYWORDS([oxm]) AT_DATA([oxm.txt], [dnl @@ -1719,9 +1731,9 @@ OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01) #Bad Pre-Requisite OXM_OF_VLAN_VID_W(1123/1fff) # Packets with VID=123, any PCP. OXM_OF_VLAN_VID_W(1123/ffff) # Packets with VID=123, any PCP. -OXM_OF_VLAN_VID_W(1123/0000) # Packets with or without 802.1Q header -OXM_OF_VLAN_VID_W(1123/1f0f), # Packets with # VID=123 (masked) -OXM_OF_VLAN_VID_W(1123/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP. +OXM_OF_VLAN_VID_W(0000/0000) # Packets with or without 802.1Q header +OXM_OF_VLAN_VID_W(1103/1f0f), # Packets with # VID=123 (masked) +OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP. OXM_OF_VLAN_VID_W(1000/1000) # Packets with any VID, any PCP OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) # Packets with any VID, PCP=1. @@ -1729,7 +1741,7 @@ OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(f0) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(41) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(3f) -OXM_OF_IP_DSCP(f0) +OXM_OF_IP_DSCP(3f) # IP ECN OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03) @@ -1745,15 +1757,15 @@ OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014) OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFFFFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/00000000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(00000000/00000000) OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014) OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000) # IP destination OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFF0000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a80000/FFFF0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFFFFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/00000000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(00000000/00000000) OXM_OF_IPV4_DST(ac100014) OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000) @@ -1761,42 +1773,42 @@ OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/0000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(0000/0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231) # TCP destination port OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/0000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(0000/0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231) # UDP source port OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/0000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0000/0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823) # UDP destination port OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/0000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(0000/0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293) # SCTP source port OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC(8732) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/01FF) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/0000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0000/0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_SCTP_SRC(7823) # SCTP destination port OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST(1782) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/F00F) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/0000) +OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(0000/0000) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_SCTP_DST(1293) # ICMP type @@ -1818,17 +1830,17 @@ # ARP source protocol address OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81200/FFFFFF00) OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFFFF) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/00000000) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(00000000/00000000) OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014) -OXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000) +OXM_OF_ARP_SPA_W(C0D80000/FFFF0000) # ARP destination protocol address OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a81200/FFFFFF00) OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFFFF) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/00000000) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(00000000/00000000) OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014) OXM_OF_ARP_TPA_W(C0D80000/FFFF0000) @@ -1837,23 +1849,23 @@ OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4) OXM_OF_ARP_SHA(0002e30f80a4) OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/ffffffffffff) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/000000000000) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/00000000000f) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000000/000000000000) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000004/00000000000f) # ARP destination hardware address OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4) OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4) OXM_OF_ARP_THA(0002e30f80a4) OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/ffffffffffff) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/000000000000) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/00000000000f) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000000/000000000000) +OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000004/00000000000f) # IPv6 source OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) +OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(00000000000000000000000000000000/00000000000000000000000000000000) OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) # IPv6 destination @@ -1861,7 +1873,7 @@ OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) +OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000) OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) # IPv6 Flow Label @@ -1870,10 +1882,10 @@ OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000ffff0) +OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/000ffff0) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff) OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/00000000) +OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/00000000) # ND source hardware address OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) @@ -1887,8 +1899,33 @@ OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3b) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) +# Registers 0, 1, and 2. +NXM_NX_REG0(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0(a0e0d050) +NXM_NX_REG1(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) + +# Extended registers 0, 1, and 2. +# (For OpenFlow 1.2, OVS transforms these into its extension registers.) +OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) + # Invalid field number. -01020304(1111/2222) +01020304(1111/3333) + +# Invalid field numbers (experimenter OXM). +ffff020800002320(11112222) +ffff030800002320(1111/3333) ]) AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl @@ -1901,17 +1938,17 @@ # metadata OXM_OF_METADATA(5a5a5a5a5a5a5a5a) OXM_OF_METADATA_W(0000000000000000/00000000ffffffff) -OXM_OF_METADATA_W(1234000090ab0000/ffff0000ffff0000) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS OXM_OF_METADATA(1234567890abcdef) - +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS # eth dst OXM_OF_ETH_DST(0002e30f80a4) OXM_OF_ETH_DST_W(010000000000/010000000000) OXM_OF_ETH_DST_W(000000000000/010000000000) -OXM_OF_ETH_DST_W(010000000000/010000000000) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS OXM_OF_ETH_DST(0002e30f80a4) - +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) # eth src @@ -1930,7 +1967,7 @@ OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01) OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_VID_W(0123/0123) -OXM_OF_VLAN_VID_W(0123/0123) +nx_pull_match() returned error OFPBMC_BAD_WILDCARDS OXM_OF_VLAN_VID_W(0123/1123) nx_pull_match() returned error OFPBMC_BAD_PREREQ OXM_OF_VLAN_VID(1123) @@ -2103,32 +2140,198 @@ nx_pull_match() returned error OFPBMC_BAD_PREREQ nx_pull_match() returned error OFPBMC_BAD_PREREQ +# Registers 0, 1, and 2. +NXM_NX_REG0(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0(a0e0d050) +NXM_NX_REG1(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) + +# Extended registers 0, 1, and 2. +# (For OpenFlow 1.2, OVS transforms these into its extension registers.) +NXM_NX_REG0(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0(a0e0d050) +NXM_NX_REG1(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) + # Invalid field number. nx_pull_match() returned error OFPBMC_BAD_FIELD + +# Invalid field numbers (experimenter OXM). +nx_pull_match() returned error OFPBMC_BAD_FIELD +nx_pull_match() returned error OFPBMC_BAD_FIELD ], [stderr]) # Check that at least the first warning made it. (It's rate-limited # so a variable number could show up, especially under valgrind etc.) -AT_CHECK([grep 'has 1-bits in value' stderr | sed 1q], [0], [dnl -nx_match|WARN|NXM/OXM entry OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000) has 1-bits in value for bits wildcarded by the mask. (Future versions of OVS may report this as an OpenFlow error.) +AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl +nx_match|WARN|Rejecting NXM/OXM entry 0:32768:2:1:16 with 1-bits in value for bits wildcarded by the mask. ]) # Check that there wasn't any other stderr output. -AT_CHECK([grep -v 'has 1-bits in value' stderr], [1]) +AT_CHECK([grep -v '1-bits in value' stderr], [1]) +AT_CLEANUP + +AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.3)]) +AT_KEYWORDS([oxm]) +AT_DATA([oxm.txt], [dnl +# actset_output +ONFOXM_ET_ACTSET_OUTPUT(00000000) +ONFOXM_ET_ACTSET_OUTPUT(fffffffe) +ONFOXM_ET_ACTSET_OUTPUT(fffffff7) +OXM_OF_ACTSET_OUTPUT(00000000) +OXM_OF_ACTSET_OUTPUT(fffffffe) +OXM_OF_ACTSET_OUTPUT(fffffff7) +]) +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow13 < oxm.txt], + [0], [dnl +# actset_output +ONFOXM_ET_ACTSET_OUTPUT(00000000) +ONFOXM_ET_ACTSET_OUTPUT(fffffffe) +ONFOXM_ET_ACTSET_OUTPUT(fffffff7) +ONFOXM_ET_ACTSET_OUTPUT(00000000) +ONFOXM_ET_ACTSET_OUTPUT(fffffffe) +ONFOXM_ET_ACTSET_OUTPUT(fffffff7) +], []) +AT_CLEANUP + +AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.5)]) +AT_KEYWORDS([oxm]) +AT_DATA([oxm.txt], [dnl +# Extended registers 0 and 1. +OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) + +# Registers 0, 1, and 2. +# (OpenFlow 1.5 transforms these into the standard "xregs".) +NXM_NX_REG0(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0(a0e0d050) +NXM_NX_REG1(acebdf56) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) +NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) +NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) + +# actset_output +ONFOXM_ET_ACTSET_OUTPUT(00000000) +ONFOXM_ET_ACTSET_OUTPUT(fffffffe) +ONFOXM_ET_ACTSET_OUTPUT(fffffff7) +OXM_OF_ACTSET_OUTPUT(00000000) +OXM_OF_ACTSET_OUTPUT(fffffffe) +OXM_OF_ACTSET_OUTPUT(fffffff7) +]) +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow15 < oxm.txt], + [0], [dnl +# Extended registers 0 and 1. +OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) + +# Registers 0, 1, and 2. +# (OpenFlow 1.5 transforms these into the standard "xregs".) +OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) +OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) +OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) +OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) + +# actset_output +OXM_OF_ACTSET_OUTPUT(00000000) +OXM_OF_ACTSET_OUTPUT(fffffffe) +OXM_OF_ACTSET_OUTPUT(fffffff7) +OXM_OF_ACTSET_OUTPUT(00000000) +OXM_OF_ACTSET_OUTPUT(fffffffe) +OXM_OF_ACTSET_OUTPUT(fffffff7) +], []) AT_CLEANUP AT_SETUP([ovs-ofctl parse-oxm loose]) AT_KEYWORDS([oxm]) AT_DATA([oxm.txt], [dnl -OXM_OF_IN_PORT(00000001), 01020304(1111/2222), OXM_OF_ETH_TYPE(0800) +OXM_OF_IN_PORT(00000001), 01020304(1111/3333), OXM_OF_ETH_TYPE(0800) +OXM_OF_IN_PORT(00000001), ffff020800002320(11112222), OXM_OF_ETH_TYPE(0800) +OXM_OF_IN_PORT(00000001), ffff030800002320(1111/3333), OXM_OF_ETH_TYPE(0800) ]) AT_CHECK([ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl nx_pull_match() returned error OFPBMC_BAD_FIELD +nx_pull_match() returned error OFPBMC_BAD_FIELD +nx_pull_match() returned error OFPBMC_BAD_FIELD ]) AT_CHECK([ovs-ofctl parse-oxm OpenFlow12 < oxm.txt], [0], [dnl OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) +OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) +OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) +]) +AT_CLEANUP + +AT_SETUP([experimenter OXM encoding]) +AT_DATA([oxm.txt], [dnl +NXM_NX_DP_HASH(01234567) +NXOXM_ET_DP_HASH(01234567) + +NXM_NX_DP_HASH_W(01234567/0fffffff) +NXOXM_ET_DP_HASH_W(01234567/0fffffff) +]) + +# To allow for testing experimenter OXM, which doesn't really have many +# examples in the wild, we've defined a variant of NXM_NX_DP_HASH that uses +# the experimenter OXM mechanism, called NXOXM_ET_DP_HASH. We've defined +# it as if it were introduced with OpenFlow 1.5, which gives us the +# opportunity to see that both forms are accepted in all OpenFlow versions +# but the experimenter form is used for encoding in OF1.5+. +# +# First verify that both forms are accepted and NXOXM_ET_DP_HASH is encoded +# in OF1.5. +AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow15 < oxm.txt], [0], [dnl +NXOXM_ET_DP_HASH(01234567) +00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@ +NXOXM_ET_DP_HASH(01234567) +00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@ + +NXOXM_ET_DP_HASH_W(01234567/0fffffff) +00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@ +00000010 0f ff ff ff 00 00 00 00- +NXOXM_ET_DP_HASH_W(01234567/0fffffff) +00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@ +00000010 0f ff ff ff 00 00 00 00- +]) + +# Then verify that both forms are accepted and NXM_NX_DP_HASH is encoded +# in OF1.2. +AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl +NXM_NX_DP_HASH(01234567) +00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@ +NXM_NX_DP_HASH(01234567) +00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@ + +NXM_NX_DP_HASH_W(01234567/0fffffff) +00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@ +NXM_NX_DP_HASH_W(01234567/0fffffff) +00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@ ]) AT_CLEANUP @@ -2141,14 +2344,20 @@ [NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) ]) -# Check that marshaling in OXM for OF1.2 through OF1.4 gives OXM -# headers except for TCP flags, which didn't have an OXM definition until -# OF1.5. -for version in OpenFlow12 OpenFlow13 OpenFlow14; do - AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm $version], [0], - [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) +# Check that marshaling in OXM for OF1.2 gives OXM headers except for +# TCP flags, which didn't have an OXM definition. +AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow12], [0], + [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) +]) + +# Check that marshaling in OXM for OF1.3 and OF1.4 gives OXM headers, +# including the ONF extension for TCP flags introduced in OF1.3. +AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow13], [0], + [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff) +]) +AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow14], [0], + [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff) ]) -done # OpenFlow 1.5 added an OXM header for TCP flags: AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15], [0], @@ -2551,4 +2760,163 @@ ]) OVS_VSWITCHD_STOP +AT_CLEANUP + +dnl Check importance parameter added in OF1.4. +dnl It validates whether importance set via add-flow via OpenFlow1.4+ gets +dnl set or not by validating it againt the dump-flows output via OpenFlow1.4+ +dnl If add-flow or dump-flows is used with later version of OpenFlow prior to 1.4+ +dnl then the importance will be considered zero whether provided as an argument. + +AT_SETUP([ovs-ofctl rule with importance]) +OVS_VSWITCHD_START +dnl Flow with importance parameter added via OF1.4+ and later version +AT_CHECK([ovs-ofctl -O OpenFlow14 add-flow br0 priority=21,importance=21,actions=normal]) +AT_CHECK([ovs-ofctl add-flow br0 priority=22,importance=22,actions=normal]) + +dnl Importance parameter will only be visible of flows that are added via OF1.4+ if dumped via OF1.4+ +AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl + importance=21, priority=21 actions=NORMAL + priority=22 actions=NORMAL +]) + +dnl Importance parameter will not be visible if flow is dumped with previous version prior to OF1.4+ whether added via OF1.4+ +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl + priority=21 actions=NORMAL + priority=22 actions=NORMAL +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + + +dnl Importance parameter added in OF1.4. +dnl This validates whether flows with importance +dnl parameter are getting replaced with "replace-flows" or +dnl not by validating dump-flows output after replace with the expected output. + +AT_SETUP([ovs-ofctl replace-flows with importance]) +OVS_VSWITCHD_START + +dnl Add flows to br0 with importance via OF1.4+. For more details refer "ovs-ofctl rule with importance" test case. +for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt +AT_CHECK([ovs-ofctl -O OpenFlow14 add-flows br0 add-flows.txt]) + +dnl Replace some flows in the bridge. +for i in 1 3 5 7; do echo "dl_vlan=$i,importance=`expr $i + 10`,actions=drop"; done > replace-flows.txt +AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt]) + +dnl Dump them and compare the dump flows output against the expected output. +for i in 1 2 3 4 5 6 7 8; do if [[ `expr $i % 2` -eq 1 ]]; then importance=`expr $i + 10`; else importance=$i; fi; echo " importance=$importance, dl_vlan=$i actions=drop"; done | sort > expout +AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], + [0], [expout]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ovs-ofctl replace-flows with --bundle]) +OVS_VSWITCHD_START + +AT_CHECK([ovs-appctl vlog/set vconn:dbg]) + +dnl Add flows to br0 with importance via OF1.4+, using an OF1.4+ bundle. For more details refer "ovs-ofctl rule with importance" test case. +for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt +AT_CHECK([ovs-ofctl --bundle add-flows br0 add-flows.txt]) + +dnl Replace some flows in the bridge. +for i in 1 3 5 7; do echo "dl_vlan=$i,importance=`expr $i + 10`,actions=drop"; done > replace-flows.txt +AT_CHECK([ovs-ofctl --bundle replace-flows br0 replace-flows.txt]) + +dnl Dump them and compare the dump flows output against the expected output. +for i in 1 2 3 4 5 6 7 8; do if [[ `expr $i % 2` -eq 1 ]]; then importance=`expr $i + 10`; else importance=$i; fi; echo " importance=$importance, dl_vlan=$i actions=drop"; done | sort > expout +AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], + [0], [expout]) + +dnl Check logs for OpenFlow trace +# Prevent race. +OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_windows_sub | test `grep -- "|vconn|DBG|unix: sent (Success): OFPST_FLOW reply" | wc -l` -ge 2]) +# AT_CHECK([sed -n "s/^.*\(|vconn|DBG|.*xid=.*:\).*$/\1/p" ovs-vswitchd.log], [0], [dnl +AT_CHECK([print_vconn_debug | vconn_windows_sub | ofctl_strip], [0], [dnl +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO (OF1.4): + version bitmap: 0x01, 0x05 +vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05) +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REPLY flags=0 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=1 importance:1 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=2 importance:2 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=3 importance:3 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=4 importance:4 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=5 importance:5 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=6 importance:6 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=7 importance:7 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=8 importance:8 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REPLY flags=0 +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO (OF1.4): + version bitmap: 0x01, 0x05 +vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05) +vconn|DBG|unix: received: OFPST_FLOW request (OF1.4): +vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4): +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=OPEN_REPLY flags=0 +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=1 importance:11 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=3 importance:13 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=5 importance:15 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): + bundle_id=0 flags=atomic ordered +OFPT_FLOW_MOD (OF1.4): ADD dl_vlan=7 importance:17 actions=drop +vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered +vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0 type=COMMIT_REPLY flags=0 +vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 +vconn|DBG|unix: received: OFPT_HELLO (OF1.4): + version bitmap: 0x05 +vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05) +vconn|DBG|unix: received: OFPST_FLOW request (OF1.4): +vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4): + importance=2, dl_vlan=2 actions=drop + importance=4, dl_vlan=4 actions=drop + importance=6, dl_vlan=6 actions=drop + importance=8, dl_vlan=8 actions=drop + importance=11, dl_vlan=1 actions=drop + importance=13, dl_vlan=3 actions=drop + importance=15, dl_vlan=5 actions=drop + importance=17, dl_vlan=7 actions=drop +]) + +OVS_VSWITCHD_STOP AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ovstest.c openvswitch-2.4.0~git20150623/tests/ovstest.c --- openvswitch-2.3.1/tests/ovstest.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovstest.c 2015-06-23 18:46:21.000000000 +0000 @@ -17,22 +17,23 @@ /* The mother of all test programs that links with libopevswitch.la */ #include +#undef NDEBUG #include #include #include #include "command-line.h" -#include "ovstest.h" #include "dynamic-string.h" +#include "ovstest.h" #include "util.h" -static struct command *commands = NULL; +static struct ovs_cmdl_command *commands = NULL; static size_t n_commands = 0; static size_t allocated_commands = 0; static void -add_command(struct command *cmd) +add_command(struct ovs_cmdl_command *cmd) { - const struct command nil = {NULL, 0, 0, NULL}; + const struct ovs_cmdl_command nil = {NULL, NULL, 0, 0, NULL}; while (n_commands + 1 >= allocated_commands) { commands = x2nrealloc(commands, &allocated_commands, @@ -59,9 +60,9 @@ } static void -help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +help(struct ovs_cmdl_context *ctx OVS_UNUSED) { - const struct command *p; + const struct ovs_cmdl_command *p; struct ds test_names = DS_EMPTY_INITIALIZER; const int linesize = 70; @@ -85,17 +86,18 @@ static void add_top_level_commands(void) { - struct command help_cmd = {"--help", 0, 0, help}; + struct ovs_cmdl_command help_cmd = {"--help", NULL, 0, 0, help}; add_command(&help_cmd); } void -ovstest_register(const char *test_name, ovstest_func f) +ovstest_register(const char *test_name, ovs_cmdl_handler f) { - struct command test_cmd; + struct ovs_cmdl_command test_cmd; test_cmd.name = test_name; + test_cmd.usage = NULL; test_cmd.min_args = 0; test_cmd.max_args = INT_MAX; test_cmd.handler = f; @@ -123,7 +125,11 @@ add_top_level_commands(); if (argc > 1) { - run_command(argc - 1, argv + 1, commands); + struct ovs_cmdl_context ctx = { + .argc = argc - 1, + .argv = argv + 1, + }; + ovs_cmdl_run_command(&ctx, commands); } cleanup(); diff -Nru openvswitch-2.3.1/tests/ovstest.h openvswitch-2.4.0~git20150623/tests/ovstest.h --- openvswitch-2.3.1/tests/ovstest.h 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovstest.h 2015-06-23 18:46:21.000000000 +0000 @@ -19,6 +19,8 @@ #include "compiler.h" +#include "command-line.h" + /* Overview * ======== * @@ -32,7 +34,7 @@ * ovstest. * * With ovstest, each test programs now becomes a sub program of ovstest. - * For example, 'mytest' program, can now be invoked as 'ovs mytest'. + * For example, 'mytest' program, can now be invoked as 'ovstest mytest'. * * 'ovstest --help' will list all test programs can be invoked. * @@ -41,7 +43,8 @@ */ typedef void (*ovstest_func)(int argc, char *argv[]); -void ovstest_register(const char *test_name, ovstest_func f); + +void ovstest_register(const char *test_name, ovs_cmdl_handler f); /* Usage * ===== @@ -72,8 +75,13 @@ * OVSTEST_REGISTER("my-test", my_test_main); */ #define OVSTEST_REGISTER(name, function) \ + static void \ + ovstest_wrapper_##function##__(struct ovs_cmdl_context *ctx) \ + { \ + function(ctx->argc, ctx->argv); \ + } \ OVS_CONSTRUCTOR(register_##function) { \ - ovstest_register(name, function); \ + ovstest_register(name, ovstest_wrapper_##function##__); \ } #endif diff -Nru openvswitch-2.3.1/tests/ovs-vsctl.at openvswitch-2.4.0~git20150623/tests/ovs-vsctl.at --- openvswitch-2.3.1/tests/ovs-vsctl.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovs-vsctl.at 2015-06-23 18:46:21.000000000 +0000 @@ -159,8 +159,14 @@ [0], [], [stderr]) AT_CHECK([grep -c 'terminating with signal' stderr], [0], [1 ]) -AT_CHECK([kill -l `cat status`], [0], [ALRM +if test "$IS_WIN32" = "yes"; then + AT_CHECK([cat status], [0], [3 ]) +else + # 128 + SIGALRM + AT_CHECK([cat status], [0], [142 +]) +fi dnl Without --retry, we should retry for passive connections. AT_CHECK( @@ -169,8 +175,14 @@ [0], [], [stderr]) AT_CHECK([grep -c 'terminating with signal' stderr], [0], [1 ]) -AT_CHECK([kill -l `cat status`], [0], [ALRM +if test "$IS_WIN32" = "yes"; then + AT_CHECK([cat status], [0], [3 +]) +else + # 128 + SIGALRM + AT_CHECK([cat status], [0], [142 ]) +fi AT_CLEANUP dnl ---------------------------------------------------------------------- @@ -471,6 +483,9 @@ AT_CHECK([RUN_OVS_VSCTL([--may-exist add-br xapi1 xenbr0 10])], [1], [], [ovs-vsctl: "--may-exist add-br xapi1 xenbr0 10" but xapi1 is a VLAN bridge for the wrong VLAN $1 ], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([--may-exist add-br dup xenbr0 $1])], [1], [], + [ovs-vsctl: bridge xenbr0 already has a child VLAN bridge xapi1 on VLAN $1 +], [OVS_VSCTL_CLEANUP]) CHECK_BRIDGES([xapi1, xenbr0, $1], [xenbr0, xenbr0, 0]) CHECK_PORTS([xenbr0], [eth0]) CHECK_IFACES([xenbr0], [eth0]) @@ -620,7 +635,8 @@ AT_KEYWORDS([ovs-vsctl]) OVS_VSCTL_SETUP AT_CHECK( - [RUN_OVS_VSCTL_TOGETHER([--id=@br0 create bridge name=br0], + [RUN_OVS_VSCTL_TOGETHER([--id=@br0 create bridge name=br123], + [set b br123 name=br0], [set o . bridges=@br0])], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) cp stdout out1 @@ -630,21 +646,27 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl out1 out2], [0], [[<0> + _uuid : <0> +auto_attach : [] controller : [] datapath_id : [] datapath_type : "" +datapath_version : "" external_ids : {} fail_mode : [] flood_vlans : [] flow_tables : {} ipfix : [] +mcast_snooping_enable: false mirrors : [] name : "br0" netflow : [] other_config : {} ports : [] protocols : [] +rstp_enable : false +rstp_status : {} sflow : [] status : {} stp_enable : false @@ -832,10 +854,10 @@ AT_CHECK([RUN_OVS_VSCTL([add in br1 name x])], [1], [], [ovs-vsctl: cannot modify read-only column name in table Interface ], [OVS_VSCTL_CLEANUP]) -AT_CHECK([RUN_OVS_VSCTL([set port br1 name br2])], +AT_CHECK([RUN_OVS_VSCTL([set port br0 name=br2])], [1], [], [ovs-vsctl: cannot modify read-only column name in table Port ], [OVS_VSCTL_CLEANUP]) -AT_CHECK([RUN_OVS_VSCTL([remove bridge br1 name br1])], +AT_CHECK([RUN_OVS_VSCTL([remove bridge br0 name br1])], [1], [], [ovs-vsctl: cannot modify read-only column name in table Bridge ], [OVS_VSCTL_CLEANUP]) AT_CHECK([RUN_OVS_VSCTL([remove bridge br1 flood-vlans true])], @@ -1126,20 +1148,25 @@ AT_CHECK([${PERL} $srcdir/uuidfilt.pl stdout], [0], [[<0> _uuid : <1> +auto_attach : [] controller : [] datapath_id : [] datapath_type : "" +datapath_version : "" external_ids : {} fail_mode : [] flood_vlans : [] flow_tables : {} ipfix : [] +mcast_snooping_enable: false mirrors : [] name : "br0" netflow : [] other_config : {} ports : [] protocols : [] +rstp_enable : false +rstp_status : {} sflow : [] status : {} stp_enable : false @@ -1172,8 +1199,9 @@ type : linux-htb ], [], [OVS_VSCTL_CLEANUP]) AT_CHECK([RUN_OVS_VSCTL( - [--columns=other_config list Queue | sort | xargs echo])], [0], -[other_config : {max-rate=100000000, min-rate=100000000} other_config : {min-rate=500000000} + [--columns=other_config list Queue | sort | sed '/^$/d'])], [0], +[other_config : {max-rate="100000000", min-rate="100000000"} +other_config : {min-rate="500000000"} ], [], [OVS_VSCTL_CLEANUP]) AT_CHECK([RUN_OVS_VSCTL( [clear Port a1 qos], @@ -1206,15 +1234,18 @@ [reserved_name], [[ovs-netdev], [ovs-dummy], -[gre_system], -[gre64_system], -[lisp_system], -[vxlan_system]], +[genev_sys], +[gre_sys], +[gre64_sys], +[lisp_sys], +[vxlan_sys]], [ # Try creating the port AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [dnl ovs-vsctl: Error detected while setting up 'reserved_name'. See ovs-vswitchd log for details. ]) +# Prevent race. +OVS_WAIT_UNTIL([test `grep -- "|WARN|" ovs-vswitchd.log | wc -l` -ge 1]) # Detect the warning log message AT_CHECK([sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log], [0], [dnl |bridge|WARN|could not create interface reserved_name, name is reserved @@ -1236,20 +1267,25 @@ -- add-port br0 p3 -- set Interface p3 type=lisp \ options:remote_ip=2.2.2.2 ofport_request=3 \ -- add-port br0 p4 -- set Interface p4 type=vxlan \ - options:remote_ip=2.2.2.2 ofport_request=4]) + options:remote_ip=2.2.2.2 ofport_request=4 \ + -- add-port br0 p5 -- set Interface p5 type=geneve \ + options:remote_ip=2.2.2.2 ofport_request=5]) # Test creating all reserved tunnel port names m4_foreach( [reserved_name], -[[gre_system], -[gre64_system], -[lisp_system], -[vxlan_system]], +[[genev_sys], +[gre_sys], +[gre64_sys], +[lisp_sys], +[vxlan_sys]], [ # Try creating the port AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [dnl ovs-vsctl: Error detected while setting up 'reserved_name'. See ovs-vswitchd log for details. ]) +# Prevent race. +OVS_WAIT_UNTIL([test `grep -- "|WARN|" ovs-vswitchd.log | wc -l` -ge 1]) # Detect the warning log message AT_CHECK([sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log], [0], [dnl |bridge|WARN|could not create interface reserved_name, name is reserved @@ -1260,3 +1296,21 @@ AT_CHECK([ovs-vsctl del-port br0 reserved_name], [0], [], [])]) OVS_VSWITCHD_STOP AT_CLEANUP + +AT_SETUP([naming in db commands]) +OVS_VSCTL_SETUP + +dnl First check that the database commands can refer to row by database UUID. +AT_CHECK([RUN_OVS_VSCTL([add-br br0])]) +uuid=`[]RUN_OVS_VSCTL(get port br0 _uuid)` +AT_CHECK([RUN_OVS_VSCTL([get port $uuid name])], [0], ["br0" +]) + +dnl Next check that, if a database row is given a name that has the same form +dnl as the database UUIDs, the name can still be used to refer to rows. +AT_CHECK([RUN_OVS_VSCTL([add-br 0fcd11a1-2ba8-4b38-a358-4bccf2bf3057])]) +AT_CHECK([RUN_OVS_VSCTL([get interface 0fcd11a1-2ba8-4b38-a358-4bccf2bf3057 type])], [0], [internal +]) + +OVS_VSCTL_CLEANUP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/ovs-vswitchd.at openvswitch-2.4.0~git20150623/tests/ovs-vswitchd.at --- openvswitch-2.3.1/tests/ovs-vswitchd.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/ovs-vswitchd.at 2015-06-23 18:46:21.000000000 +0000 @@ -40,28 +40,28 @@ ovs-appctl time/stop dnl at the beginning, the update of rx_packets should happen every 5 seconds. -for i in `seq 0 10`; do ovs-appctl time/warp 1000; done +ovs-appctl time/warp 11000 1000 OVS_VSCTL_CHECK_RX_PKT([p1], [0]) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) -for i in `seq 0 10`; do ovs-appctl time/warp 1000; done +ovs-appctl time/warp 11000 1000 OVS_VSCTL_CHECK_RX_PKT([p1], [1]) dnl set the stats update interval to 100K ms, the following 'recv' should not be updated. AT_CHECK([ovs-vsctl set O . other_config:stats-update-interval=100000]) -for i in `seq 0 50`; do ovs-appctl time/warp 1000; done +ovs-appctl time/warp 51000 1000 for i in `seq 1 5`; do AT_CHECK([ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) done OVS_VSCTL_CHECK_RX_PKT([p1], [1]) dnl advance the clock by 100K ms, the previous 'recv' should be updated. -for i in `seq 0 99`; do ovs-appctl time/warp 1000; done +ovs-appctl time/warp 100000 1000 OVS_VSCTL_CHECK_RX_PKT([p1], [6]) dnl now remove the configuration. 'recv' one packet. there should be an update after 5000 ms. AT_CHECK([ovs-vsctl clear O . other_config]) AT_CHECK([ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) -for i in `seq 0 10`; do ovs-appctl time/warp 1000; done +ovs-appctl time/warp 11000 1000 OVS_VSCTL_CHECK_RX_PKT([p1], [7]) OVS_VSWITCHD_STOP diff -Nru openvswitch-2.3.1/tests/rstp.at openvswitch-2.4.0~git20150623/tests/rstp.at --- openvswitch-2.3.1/tests/rstp.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/rstp.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,262 @@ +AT_BANNER([Rapid Spanning Tree Protocol unit tests]) + +AT_SETUP([RSTP Single bridge]) +AT_KEYWORDS([RSTP]) +AT_DATA([test-rstp-num1], +[bridge 0 0x111 = a b +run 1000 +check 0 = root +]) +AT_CHECK([ovstest test-rstp test-rstp-num1], [0], []) +AT_CLEANUP + +AT_SETUP([RSTP Link failure]) +AT_KEYWORDS([RSTP]) +AT_DATA([test-rstp-num2], +[bridge 0 0x111 = a b +bridge 1 0x222 = a c +bridge 2 0x333 = b c +run 1000 +check 0 = root +check 1 = F:200000 F +check 2 = F:200000 Di +# Link b goes down +bridge 2 = X c +run 1000 +check 1 = F:200000 F +check 2 = D F:400000 +]) +AT_CHECK([ovstest test-rstp test-rstp-num2], [0], []) +AT_CLEANUP + +AT_SETUP([RSTP Double link Failure]) +AT_KEYWORDS([RSTP]) +AT_DATA([test-rstp-num3], +[bridge 0 0x111 = a b +bridge 1 0x222 = a c d +bridge 2 0x333 = b c e +bridge 3 0x444 = d f +bridge 4 0x555 = e f +run 1000 +check 0 = root +check 1 = F:200000 F F +check 2 = F:200000 Di F +check 3 = F:400000 F +check 4 = F:400000 Di +# Link b goes down +bridge 2 = X c e +run 1000 +check 0 = root +check 1 = F:200000 F F +check 2 = D F:400000 F +check 3 = F:400000 F +check 4 = F:600000 Di +# Link e goes down +bridge 4 = X f +run 1000 +check 0 = root +check 1 = F:200000 F F +check 2 = D F:400000 F +check 3 = F:400000 F +check 4 = D F:600000 +# Link f cost changes +bridge 4 = X f:100000 +run 1000 +check 4 = D F:500000 +# Bridge 4 becomes root and +bridge 4 ^ 31000 +run 1000 +check 4 = root +]) +AT_CHECK([ovstest test-rstp test-rstp-num3], [0], []) +AT_CLEANUP + +AT_SETUP([RSTP example from IEEE 802.1D-2004 figures 17.4 and 17.5]) +AT_KEYWORDS([RSTP]) +AT_DATA([test-rstp-ieee802.1d-2004-fig17.4], +[bridge 0 0x111 = a b e c +bridge 1 0x222 = a b d f +bridge 2 0x333 = c d l j h g +bridge 3 0x444 = e f n m k i +bridge 4 0x555 = g i 0 0 +bridge 5 0x666 = h k 0 0 +bridge 6 0x777 = j m 0 0 +bridge 7 0x888 = l n 0 0 +run 1000 +check 0 = root +check 1 = F:200000 Di F F +check 2 = F:200000 Di F F F F +check 3 = F:200000 Di F F F F +check 4 = F:400000 Di F F +check 5 = F:400000 Di F F +check 6 = F:400000 Di F F +check 7 = F:400000 Di F F + +# Now connect two ports of bridge 7 to the same LAN. +bridge 7 = l n o o +# Same results except for bridge 7: +run 1000 +check 0 = root +check 1 = F:200000 Di F F +check 2 = F:200000 Di F F F F +check 3 = F:200000 Di F F F F +check 4 = F:400000 Di F F +check 5 = F:400000 Di F F +check 6 = F:400000 Di F F +check 7 = F:400000 Di F Di +]) +AT_CHECK([ovstest test-rstp test-rstp-ieee802.1d-2004-fig17.4], [0], []) +AT_CLEANUP + +AT_SETUP([RSTP example from IEEE 802.1D-2004 figure 17.6]) +AT_KEYWORDS([RSTP]) +AT_DATA([test-rstp-ieee802.1d-2004-fig17.6], +[bridge 0 0x111 = a b l +bridge 1 0x222 = b c d +bridge 2 0x333 = d e f +bridge 3 0x444 = f g h +bridge 4 0x555 = j h i +bridge 5 0x666 = l j k +run 1000 +check 0 = root +check 1 = F:200000 F F +check 2 = F:400000 F F +check 3 = F:600000 F Di +check 4 = F:400000 F F +check 5 = F:200000 F F +]) +AT_CHECK([ovstest test-rstp test-rstp-ieee802.1d-2004-fig17.6], [0], []) +AT_CLEANUP + +AT_SETUP([RSTP example from IEEE 802.1D-2004 figure 17.7]) +AT_KEYWORDS([RSTP]) +AT_DATA([test-rstp-ieee802.1d-2004-fig17.7], +[bridge 0 0x000 = b +bridge 1 0x111 = a b d f h g e c +bridge 2 0x222 = g h j l n m k i +run 1000 +check 0 = root +check 1 = F F:200000 F F F F F F +check 2 = Di F:400000 F F F F F F +# Link g priority increment +bridge 1 = a b d f h g^112 e c +run 1000 +check 0 = root +check 1 = F F:200000 F F F F F F +check 2 = F:400000 Di F F F F F F +]) +AT_CHECK([ovstest test-rstp test-rstp-ieee802.1d-2004-fig17.7], [0], []) +AT_CLEANUP + +# Strips out uninteresting parts of flow output, as well as parts +# that vary from one run to another (e.g., timing and bond actions). +m4_define([STRIP_USED], [[sed ' + s/used:[0-9]*\.[0-9]*/used:0.0/ + s/duration=[0-9.]*s*/duration=Xs/ + s/idle_age=[0-9]*,/idle_age=X,/ +']]) +m4_define([FILTER_STP_TOPOLOGY], [[ +grep 'STP state changed' | sed ' + s/.*ofproto_dpif|.*|// +']]) + +AT_SETUP([RSTP - dummy interface]) +# Create br0 with interfaces p1 and p7 +# and br1 with interfaces p2 and p8 +# with p1 and p2 connected via unix domain socket +OVS_VSWITCHD_START( + [set port br0 other_config:rstp-enable=false -- \ + set bridge br0 rstp_enable=true -- \ + add-br br1 -- \ + set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ + set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ + fail-mode=secure -- \ + set port br1 other_config:rstp-enable=false -- \ + set bridge br1 rstp_enable=false -- \ +]) + +AT_CHECK([ovs-vsctl add-port br0 p1 -- \ + set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \ + set port p1 other_config:rstp-enable=true -- \ +]) +AT_CHECK([ovs-vsctl add-port br0 p7 -- \ + set interface p7 ofport_request=7 type=dummy -- \ + set port p7 other_config:rstp-enable=false -- \ +]) +AT_CHECK([ovs-vsctl add-port br1 p2 -- \ + set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \ + set port p2 other_config:rstp-enable=false -- \ +]) +AT_CHECK([ovs-vsctl add-port br1 p8 -- \ + set interface p8 ofport_request=8 type=dummy -- \ + set port p8 other_config:rstp-enable=false -- \ +]) + +# +# RSTP needs link to be in admin-state up, netdev-dummy is by default down +# +AT_CHECK([ovs-appctl netdev-dummy/set-admin-state p1 up], [], [dnl +OK +]) + +# +# Turn RSTP on in br1 after the ports have been added. +# +AT_CHECK([ovs-vsctl set bridge br1 rstp_enable=true]) + +ovs-appctl time/stop + +AT_CHECK([ovs-ofctl add-flow br0 "in_port=7 icmp actions=1"]) +AT_CHECK([ovs-ofctl add-flow br0 "in_port=1 icmp actions=7"]) +AT_CHECK([ovs-ofctl add-flow br1 "in_port=8 icmp actions=2"]) +AT_CHECK([ovs-ofctl add-flow br1 "in_port=2 icmp actions=8"]) + +AT_CHECK([ovs-vsctl set port p2 other_config:rstp-enable=true]) + +OVS_WAIT_UNTIL([test `cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY | wc -l` -ge 2]) +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl +port p1: RSTP state changed from Disabled to Discarding +port p2: RSTP state changed from Disabled to Discarding +]) + +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep STP], [0], [dnl +RSTP not in forwarding state, skipping output +]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep STP], [0], [dnl +RSTP not in forwarding state, skipping output +]) + +# +# RSTP needs link to be in admin-state up, netdev-dummy is by default down +# +AT_CHECK([ovs-appctl netdev-dummy/set-admin-state p2 up], [], [dnl +OK +]) + +# give time for RSTP to move initially + +ovs-appctl time/warp 1000 +ovs-appctl time/warp 1000 + +OVS_WAIT_UNTIL([test `cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY | wc -l` -ge 4]) +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl +port p1: RSTP state changed from Disabled to Discarding +port p2: RSTP state changed from Disabled to Discarding +port p2: RSTP state changed from Discarding to Forwarding +port p1: RSTP state changed from Discarding to Forwarding +]) + +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep Datapath], [0], [dnl +Datapath actions: 1 +]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep Datapath], [0], [dnl +Datapath actions: 2 +]) + +AT_CHECK([ovs-vsctl del-br br1]) + +AT_CHECK([ovs-vsctl del-port br0 p7]) +AT_CHECK([ovs-vsctl del-port br0 p1]) + +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/run-oftest openvswitch-2.4.0~git20150623/tests/run-oftest --- openvswitch-2.3.1/tests/run-oftest 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/run-oftest 2015-06-23 18:46:21.000000000 +0000 @@ -21,7 +21,7 @@ /*) ;; *) srcdir=`pwd`/$srcdir ;; esac -if test ! -e "$srcdir"/WHY-OVS; then +if test ! -e "$srcdir"/WHY-OVS.md; then echo >&2 'source directory not found, please set $srcdir or run via \"make check-oftest' exit 1 fi diff -Nru openvswitch-2.3.1/tests/run-ryu openvswitch-2.4.0~git20150623/tests/run-ryu --- openvswitch-2.3.1/tests/run-ryu 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/run-ryu 2015-06-23 18:46:21.000000000 +0000 @@ -19,7 +19,7 @@ /*) ;; *) srcdir=`pwd`/$srcdir ;; esac -if test ! -e "$srcdir"/WHY-OVS; then +if test ! -e "$srcdir"/WHY-OVS.md; then echo >&2 'source directory not found, please set $srcdir or run via \"make check-ryu' exit 1 fi @@ -77,7 +77,7 @@ datapath-type=dummy fail-mode=secure \ protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' \ other-config:datapath-id=$dpid \ - -- set-controller $bridge tcp:127.0.0.1:6633 \ + -- set-controller $bridge tcp:127.0.0.1:6653 \ -- set controller $bridge connection-mode=out-of-band \ max-backoff=1000 \ -- add-port $bridge $port1 \ @@ -100,7 +100,7 @@ logfile=$sandbox/`echo $app | sed 's,/,.,g'`.log logs="$logs $logfile" - ryu-manager "$app" --log-file="$logfile" & pid=$! + ryu-manager --ofp-tcp-listen-port=6653 "$app" --log-file="$logfile" & pid=$! echo $pid > "$sandbox/ryu.pid" i=0 while sleep 1; do diff -Nru openvswitch-2.3.1/tests/stp.at openvswitch-2.4.0~git20150623/tests/stp.at --- openvswitch-2.3.1/tests/stp.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/stp.at 2015-06-23 18:46:21.000000000 +0000 @@ -364,3 +364,103 @@ stp|INFO|stp333: detected topology change. ]) AT_CLEANUP + +# Strips out uninteresting parts of flow output, as well as parts +# that vary from one run to another (e.g., timing and bond actions). +m4_define([STRIP_USED], [[sed ' + s/used:[0-9]*\.[0-9]*/used:0.0/ + s/duration=[0-9.]*s*/duration=Xs/ + s/idle_age=[0-9]*,/idle_age=X,/ +']]) +m4_define([FILTER_STP_TOPOLOGY], [[ +grep 'STP state change' | sed ' + s/.*ofproto_dpif|.*|// +']]) + +AT_SETUP([STP - dummy interface]) +# Create br0 with interfaces p1 and p7 +# and br1 with interfaces p2 and p8 +# with p1 and p2 connected via unix domain socket +OVS_VSWITCHD_START( + [set port br0 other_config:stp-enable=false -- \ + set bridge br0 stp_enable=true -- \ + add-br br1 -- \ + set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ + set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ + fail-mode=secure -- \ + set port br1 other_config:stp-enable=false -- \ + set bridge br1 stp_enable=true --]) + +AT_CHECK([ovs-appctl vlog/set ofproto_dpif:dbg]) + +AT_CHECK([ovs-vsctl add-port br0 p1 -- \ + set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \ + set port p1 other_config:stp-enable=true -- \ +]) +AT_CHECK([ovs-vsctl add-port br0 p7 -- \ + set interface p7 ofport_request=7 type=dummy -- \ + set port p7 other_config:stp-enable=false -- \ +]) +AT_CHECK([ovs-vsctl add-port br1 p2 -- \ + set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \ + set port p2 other_config:stp-enable=true -- \ +]) +AT_CHECK([ovs-vsctl add-port br1 p8 -- \ + set interface p8 ofport_request=8 type=dummy -- \ + set port p8 other_config:stp-enable=false -- \ +]) + +ovs-appctl time/stop + +AT_CHECK([ovs-ofctl add-flow br0 "in_port=7 icmp actions=1"]) +AT_CHECK([ovs-ofctl add-flow br0 "in_port=1 icmp actions=7"]) +AT_CHECK([ovs-ofctl add-flow br1 "in_port=8 icmp actions=2"]) +AT_CHECK([ovs-ofctl add-flow br1 "in_port=2 icmp actions=8"]) + +# give time for STP to move initially + +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 + +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl +port p1: STP state changed from disabled to listening +port p2: STP state changed from disabled to listening +]) + +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep STP], [0], [dnl +STP not in forwarding state, skipping output +]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep STP], [0], [dnl +STP not in forwarding state, skipping output +]) + +# give time for STP to synchronize + +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 +ovs-appctl time/warp 3000 + +AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl +port p1: STP state changed from disabled to listening +port p2: STP state changed from disabled to listening +port p1: STP state changed from listening to learning +port p2: STP state changed from listening to learning +port p1: STP state changed from learning to forwarding +port p2: STP state changed from learning to forwarding +]) + +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep Datapath], [0], [dnl +Datapath actions: 1 +]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' | grep Datapath], [0], [dnl +Datapath actions: 2 +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/test-aa.c openvswitch-2.4.0~git20150623/tests/test-aa.c --- openvswitch-2.3.1/tests/test-aa.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-aa.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2015 Avaya, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#undef NDEBUG +#include +#include +#include +#include +#include "ovs-lldp.h" +#include "ovstest.h" + +#define ETH_TYPE_LLDP 0x88cc + +/* Dummy MAC addresses */ +static uint8_t chassis_mac[ETH_ADDR_LEN] = { 0x5e, 0x10, 0x8e, 0xe7, 0x84, 0xad }; +static uint8_t eth_src[ETH_ADDR_LEN] = { 0x5e, 0x10, 0x8e, 0xe7, 0x84, 0xad }; + +/* LLDP multicast address */ +static const uint8_t eth_addr_lldp[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x0e}; + +/* Count of tests run */ +static int num_tests = 0; + + +/* + * Helper function to validate port info + */ +static void +check_received_port(struct lldpd_port *sport, + struct lldpd_port *rport) +{ + assert(rport->p_id_subtype == sport->p_id_subtype); + assert(rport->p_id_len == sport->p_id_len); + assert(strncmp(rport->p_id, sport->p_id, sport->p_id_len) == 0); + assert(strcmp(rport->p_descr, sport->p_descr) == 0); + + return; +} + + +/* + * Helper function to validate chassis info + */ +static void +check_received_chassis(struct lldpd_chassis *schassis, + struct lldpd_chassis *rchassis) +{ + assert(rchassis->c_id_subtype == schassis->c_id_subtype); + assert(rchassis->c_id_len == schassis->c_id_len); + assert(memcmp(rchassis->c_id, schassis->c_id, schassis->c_id_len) == 0); + assert(strcmp(rchassis->c_name, schassis->c_name) == 0); + assert(strcmp(rchassis->c_descr, schassis->c_descr) == 0); + assert(rchassis->c_cap_available == schassis->c_cap_available); + assert(rchassis->c_cap_enabled == schassis->c_cap_enabled); + + return; +} + + +/* + * Helper function to validate auto-attach info + */ +static void +check_received_aa(struct lldpd_port *sport, + struct lldpd_port *rport, + struct lldpd_aa_isid_vlan_maps_tlv *smap) +{ + struct lldpd_aa_isid_vlan_maps_tlv *received_map; + int i = 0; + + assert(rport->p_element.type == sport->p_element.type); + assert(rport->p_element.mgmt_vlan == sport->p_element.mgmt_vlan); + assert(rport->p_element.system_id.system_mac[0] == + sport->p_element.system_id.system_mac[0]); + assert(rport->p_element.system_id.system_mac[1] == + sport->p_element.system_id.system_mac[1]); + assert(rport->p_element.system_id.system_mac[2] == + sport->p_element.system_id.system_mac[2]); + assert(rport->p_element.system_id.system_mac[3] == + sport->p_element.system_id.system_mac[3]); + assert(rport->p_element.system_id.system_mac[4] == + sport->p_element.system_id.system_mac[4]); + assert(rport->p_element.system_id.system_mac[5] == + sport->p_element.system_id.system_mac[5]); + assert(rport->p_element.system_id.conn_type == + sport->p_element.system_id.conn_type); + assert(rport->p_element.system_id.rsvd == + sport->p_element.system_id.rsvd); + assert(rport->p_element.system_id.rsvd2[0] == + sport->p_element.system_id.rsvd2[0]); + assert(rport->p_element.system_id.rsvd2[1] == + sport->p_element.system_id.rsvd2[1]); + + /* Should receive 2 mappings */ + assert(!list_is_empty(&rport->p_isid_vlan_maps)); + + /* For each received isid/vlan mapping */ + LIST_FOR_EACH (received_map, m_entries, &rport->p_isid_vlan_maps) { + + /* Validate against mapping sent */ + assert(smap[i].isid_vlan_data.status == + received_map->isid_vlan_data.status); + assert(smap[i].isid_vlan_data.vlan == + received_map->isid_vlan_data.vlan); + assert(smap[i].isid_vlan_data.isid == + received_map->isid_vlan_data.isid); + + /* Next mapping sent */ + i++; + } + assert(i == 2); + + return; +} + + +/* + * Validate basic send/receive processing + */ +static int +test_aa_send(void) +{ + struct lldp *lldp; + struct lldpd_hardware hardware; + struct lldpd_chassis chassis; + + struct lldpd_chassis *nchassis = NULL; + struct lldpd_port *nport = NULL; + + struct lldpd_hardware *hw = NULL; + struct lldpd_chassis *ch = NULL; + + struct lldpd_aa_isid_vlan_maps_tlv map_init[2]; + struct lldpd_aa_isid_vlan_maps_tlv map[2]; + + uint32_t stub[512 / 4]; + struct dp_packet packet; + + int n; + + /* Prepare data used to construct and validate LLDPPDU */ + hardware.h_lport.p_id_subtype = LLDP_PORTID_SUBTYPE_IFNAME; + hardware.h_lport.p_id = "FastEthernet 1/5"; + hardware.h_lport.p_id_len = strlen(hardware.h_lport.p_id); + hardware.h_lport.p_descr = "Fake port description"; + hardware.h_lport.p_mfs = 1516; + + /* Auto attach element discovery info */ + hardware.h_lport.p_element.type = + LLDP_TLV_AA_ELEM_TYPE_CLIENT_VIRTUAL_SWITCH; + hardware.h_lport.p_element.mgmt_vlan = 0xCDC; + hardware.h_lport.p_element.system_id.system_mac[0] = 0x1; + hardware.h_lport.p_element.system_id.system_mac[1] = 0x2; + hardware.h_lport.p_element.system_id.system_mac[2] = 0x3; + hardware.h_lport.p_element.system_id.system_mac[3] = 0x4; + hardware.h_lport.p_element.system_id.system_mac[4] = 0x5; + hardware.h_lport.p_element.system_id.system_mac[5] = 0x6; + + hardware.h_lport.p_element.system_id.conn_type = 0x5; + hardware.h_lport.p_element.system_id.rsvd = 0x3CC; + hardware.h_lport.p_element.system_id.rsvd2[0] = 0xB; + hardware.h_lport.p_element.system_id.rsvd2[1] = 0xE; + + /* Local chassis info */ + chassis.c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR; + chassis.c_id = chassis_mac; + chassis.c_id_len = ETH_ADDR_LEN; + chassis.c_name = "Dummy chassis"; + chassis.c_descr = "Long dummy chassis description"; + chassis.c_cap_available = LLDP_CAP_BRIDGE; + chassis.c_cap_enabled = LLDP_CAP_BRIDGE; + + /* ISID/VLAN mappings */ + map_init[0].isid_vlan_data.status = 0xC; + map_init[0].isid_vlan_data.vlan = 0x64; + map_init[0].isid_vlan_data.isid = 0x010203; + + map_init[1].isid_vlan_data.status = 0xD; + map_init[1].isid_vlan_data.vlan = 0xF; + map_init[1].isid_vlan_data.isid = 0x040506; + + /* Prepare an empty packet buffer */ + dp_packet_use_stub(&packet, stub, sizeof stub); + dp_packet_clear(&packet); + + /* Create a dummy lldp instance */ + lldp = lldp_create_dummy(); + if ((lldp == NULL) || + (lldp->lldpd == NULL) || + list_is_empty(&lldp->lldpd->g_hardware)) { + printf("Error: unable to create dummy lldp instance"); + return 1; + } + + /* Populate instance with local chassis info */ + hw = lldpd_first_hardware(lldp->lldpd); + ch = hw->h_lport.p_chassis; + ch->c_id_subtype = chassis.c_id_subtype; + ch->c_id = chassis.c_id; + ch->c_id_len = chassis.c_id_len; + ch->c_name = chassis.c_name; + ch->c_descr = chassis.c_descr; + ch->c_cap_available = chassis.c_cap_available; + ch->c_cap_enabled = chassis.c_cap_enabled; + + /* Populate instance with local port info */ + hw->h_lport.p_id_subtype = hardware.h_lport.p_id_subtype; + hw->h_lport.p_id = hardware.h_lport.p_id; + hw->h_lport.p_id_len = strlen(hw->h_lport.p_id); + hw->h_lport.p_descr = hardware.h_lport.p_descr; + hw->h_lport.p_mfs = hardware.h_lport.p_mfs; + + /* Populate instance with auto attach element discovery info */ + + hw->h_lport.p_element.type = hardware.h_lport.p_element.type; + hw->h_lport.p_element.mgmt_vlan = hardware.h_lport.p_element.mgmt_vlan; + hw->h_lport.p_element.system_id.system_mac[0] = + hardware.h_lport.p_element.system_id.system_mac[0]; + hw->h_lport.p_element.system_id.system_mac[1] = + hardware.h_lport.p_element.system_id.system_mac[1]; + hw->h_lport.p_element.system_id.system_mac[2] = + hardware.h_lport.p_element.system_id.system_mac[2]; + hw->h_lport.p_element.system_id.system_mac[3] = + hardware.h_lport.p_element.system_id.system_mac[3]; + hw->h_lport.p_element.system_id.system_mac[4] = + hardware.h_lport.p_element.system_id.system_mac[4]; + hw->h_lport.p_element.system_id.system_mac[5] = + hardware.h_lport.p_element.system_id.system_mac[5]; + + hw->h_lport.p_element.system_id.conn_type = + hardware.h_lport.p_element.system_id.conn_type; + hw->h_lport.p_element.system_id.rsvd = + hardware.h_lport.p_element.system_id.rsvd; + hw->h_lport.p_element.system_id.rsvd2[0] = + hardware.h_lport.p_element.system_id.rsvd2[0]; + hw->h_lport.p_element.system_id.rsvd2[1] = + hardware.h_lport.p_element.system_id.rsvd2[1]; + + /* Populate instance with two auto attach isid/vlan mappings */ + map[0].isid_vlan_data.status = map_init[0].isid_vlan_data.status; + map[0].isid_vlan_data.vlan = map_init[0].isid_vlan_data.vlan; + map[0].isid_vlan_data.isid = map_init[0].isid_vlan_data.isid; + + map[1].isid_vlan_data.status = map_init[1].isid_vlan_data.status; + map[1].isid_vlan_data.vlan = map_init[1].isid_vlan_data.vlan; + map[1].isid_vlan_data.isid = map_init[1].isid_vlan_data.isid; + + list_init(&hw->h_lport.p_isid_vlan_maps); + list_push_back(&hw->h_lport.p_isid_vlan_maps, &map[0].m_entries); + list_push_back(&hw->h_lport.p_isid_vlan_maps, &map[1].m_entries); + + /* Construct LLDPPDU (including Ethernet header) */ + eth_compose(&packet, eth_addr_lldp, eth_src, ETH_TYPE_LLDP, 0); + n = lldp_send(lldp->lldpd, hw, &packet); + + if (n == 0) { + printf("Error: unable to build packet\n"); + return 1; + } + + /* Decode the constructed LLDPPDU */ + assert(lldp_decode(NULL, dp_packet_data(&packet), dp_packet_size(&packet), hw, + &nchassis, &nport) != -1); + + /* Expecting returned pointers to allocated structures */ + if (!nchassis || !nport) { + printf("Error: unable to decode packet"); + return 1; + } + + /* Verify chassis values */ + check_received_chassis(&chassis, nchassis); + + /* Verify port values */ + check_received_port(&hardware.h_lport, nport); + + /* Verify auto attach values */ + check_received_aa(&hardware.h_lport, nport, map_init); + + return 0; +} + + +static void +test_aa_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +{ + int num_errors = 0; + + /* Make sure we emit valid auto-attach LLDPPDUs */ + num_tests++; + num_errors += test_aa_send(); + + /* Add more tests here */ + + printf("executed %d tests, %d errors\n", num_tests, num_errors); + + exit(num_errors != 0); +} + +OVSTEST_REGISTER("test-aa", test_aa_main); diff -Nru openvswitch-2.3.1/tests/test-aes128.c openvswitch-2.4.0~git20150623/tests/test-aes128.c --- openvswitch-2.3.1/tests/test-aes128.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-aes128.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,10 +15,11 @@ */ #include -#include +#undef NDEBUG #include "aes128.h" -#include "util.h" +#include #include "ovstest.h" +#include "util.h" static void hex_to_uint8(const char *input, uint8_t *output, size_t n) diff -Nru openvswitch-2.3.1/tests/test-atomic.c openvswitch-2.4.0~git20150623/tests/test-atomic.c --- openvswitch-2.3.1/tests/test-atomic.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-atomic.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,10 +15,16 @@ */ #include - +#undef NDEBUG +#include "fatal-signal.h" #include "ovs-atomic.h" -#include "util.h" #include "ovstest.h" +#include "ovs-thread.h" +#include "timeval.h" +#include "util.h" +#include "openvswitch/vlog.h" + +VLOG_DEFINE_THIS_MODULE(test_atomic); #define TEST_ATOMIC_TYPE(ATOMIC_TYPE, BASE_TYPE) \ { \ @@ -62,6 +68,100 @@ ovs_assert(value == 8); \ } +#define TEST_ATOMIC_TYPE_EXPLICIT(ATOMIC_TYPE, BASE_TYPE, \ + ORDER_READ, ORDER_STORE, ORDER_RMW) \ + { \ + ATOMIC_TYPE x = ATOMIC_VAR_INIT(1); \ + BASE_TYPE value, orig; \ + \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 1); \ + \ + atomic_store_explicit(&x, 2, ORDER_STORE); \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 2); \ + \ + atomic_init(&x, 3); \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 3); \ + \ + atomic_add_explicit(&x, 1, &orig, ORDER_RMW); \ + ovs_assert(orig == 3); \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 4); \ + \ + atomic_sub_explicit(&x, 2, &orig, ORDER_RMW); \ + ovs_assert(orig == 4); \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 2); \ + \ + atomic_or_explicit(&x, 6, &orig, ORDER_RMW); \ + ovs_assert(orig == 2); \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 6); \ + \ + atomic_and_explicit(&x, 10, &orig, ORDER_RMW); \ + ovs_assert(orig == 6); \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 2); \ + \ + atomic_xor_explicit(&x, 10, &orig, ORDER_RMW); \ + ovs_assert(orig == 2); \ + atomic_read_explicit(&x, &value, ORDER_READ); \ + ovs_assert(value == 8); \ + } + + +#define TEST_ATOMIC_ORDER(ORDER_READ, ORDER_STORE, ORDER_RMW) \ + { \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_char, char, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_uchar, unsigned char, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_schar, signed char, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_short, short, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_ushort, unsigned short, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_int, int, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_uint, unsigned int, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_long, long int, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_ulong, unsigned long int, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_llong, long long int, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_ullong, unsigned long long int, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_size_t, size_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_ptrdiff_t, ptrdiff_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_intmax_t, intmax_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_uintmax_t, uintmax_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_intptr_t, intptr_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_uintptr_t, uintptr_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_uint8_t, uint8_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_int8_t, int8_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_uint16_t, uint16_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_int16_t, int16_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_uint32_t, uint32_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + TEST_ATOMIC_TYPE_EXPLICIT(atomic_int32_t, int32_t, \ + ORDER_READ, ORDER_STORE, ORDER_RMW); \ + } + static void test_atomic_flag(void) { @@ -72,9 +172,184 @@ ovs_assert(atomic_flag_test_and_set(&flag) == false); } +static uint32_t a; + +struct atomic_aux { + ATOMIC(uint64_t) count; + uint32_t b; + ATOMIC(uint32_t *) data; + ATOMIC(uint64_t) data64; +}; + +static ATOMIC(struct atomic_aux *) paux = ATOMIC_VAR_INIT(NULL); +static struct atomic_aux *auxes = NULL; + +#define ATOMIC_ITEM_COUNT 1000000 + +static void * +atomic_consumer(void * arg1 OVS_UNUSED) +{ + struct atomic_aux *old_aux = NULL; + uint64_t count; + long long int stop_time = time_msec() + 1000; + + do { + struct atomic_aux *aux; + uint32_t b; + + /* Wait for a new item. We may not be fast enough to process every + * item, but we are guaranteed to see the last one. */ + do { + atomic_read_explicit(&paux, &aux, memory_order_consume); + } while (aux == old_aux); + + b = aux->b; + atomic_read_explicit(&aux->count, &count, memory_order_relaxed); + ovs_assert(b == count + 42); + + old_aux = aux; + } while (count < ATOMIC_ITEM_COUNT - 1 && time_msec() < stop_time); + + if (time_msec() >= stop_time) { + if (count < 10) { + VLOG_WARN("atomic_consumer test stopped due to excessive runtime. " + "Count = %"PRIu64, count); + } + } + + return NULL; +} + +static void * +atomic_producer(void * arg1 OVS_UNUSED) +{ + size_t i; + + for (i = 0; i < ATOMIC_ITEM_COUNT; i++) { + struct atomic_aux *aux = &auxes[i]; + + aux->count = ATOMIC_VAR_INIT(i); + aux->b = i + 42; + + /* Publish the new item. */ + atomic_store_explicit(&paux, aux, memory_order_release); + } + + return NULL; +} static void -test_atomic_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_cons_rel(void) +{ + pthread_t reader, writer; + + atomic_init(&paux, NULL); + + auxes = xmalloc(sizeof *auxes * ATOMIC_ITEM_COUNT); + + reader = ovs_thread_create("consumer", atomic_consumer, NULL); + writer = ovs_thread_create("producer", atomic_producer, NULL); + + xpthread_join(reader, NULL); + xpthread_join(writer, NULL); + + free(auxes); +} + +static void * +atomic_reader(void *aux_) +{ + struct atomic_aux *aux = aux_; + uint64_t count; + uint64_t data; + long long int now = time_msec(); + long long int stop_time = now + 1000; + + do { + /* Non-synchronized add. */ + atomic_add_explicit(&aux->count, 1, &count, memory_order_relaxed); + + do { + atomic_read_explicit(&aux->data64, &data, memory_order_acquire); + } while (!data && (now = time_msec()) < stop_time); + + if (now >= stop_time) { + if (count < 10) { + VLOG_WARN("atomic_reader test stopped due to excessive " + "runtime. Count = %"PRIu64, count); + } + break; + } + + ovs_assert(data == a && data == aux->b && a == aux->b); + + atomic_read_explicit(&aux->count, &count, memory_order_relaxed); + + ovs_assert(count == 2 * a && count == 2 * aux->b && count == 2 * data); + + atomic_store_explicit(&aux->data64, UINT64_C(0), memory_order_release); + } while (count < 2 * ATOMIC_ITEM_COUNT); + + return NULL; +} + +static void * +atomic_writer(void *aux_) +{ + struct atomic_aux *aux = aux_; + uint64_t old_count; + uint64_t data; + size_t i; + long long int now = time_msec(); + long long int stop_time = now + 1000; + + for (i = 0; i < ATOMIC_ITEM_COUNT; i++) { + /* Wait for the reader to be done with the data. */ + do { + atomic_read_explicit(&aux->data64, &data, memory_order_acquire); + } while (data && (now = time_msec()) < stop_time); + + if (now >= stop_time) { + if (i < 10) { + VLOG_WARN("atomic_writer test stopped due to excessive " + "runtime, Count = %"PRIuSIZE, i); + } + break; + } + + a = i + 1; + atomic_add_explicit(&aux->count, 1, &old_count, memory_order_relaxed); + aux->b++; + atomic_store_explicit(&aux->data64, + (i & 1) ? (uint64_t)aux->b : a, memory_order_release); + } + + return NULL; +} + +static void +test_acq_rel(void) +{ + pthread_t reader, writer; + struct atomic_aux *aux = xmalloc(sizeof *aux); + + a = 0; + aux->b = 0; + + aux->count = ATOMIC_VAR_INIT(0); + atomic_init(&aux->data, NULL); + aux->data64 = ATOMIC_VAR_INIT(0); + + reader = ovs_thread_create("reader", atomic_reader, aux); + writer = ovs_thread_create("writer", atomic_writer, aux); + + xpthread_join(reader, NULL); + xpthread_join(writer, NULL); + free(aux); +} + +static void +test_atomic_plain(void) { TEST_ATOMIC_TYPE(atomic_char, char); TEST_ATOMIC_TYPE(atomic_uchar, unsigned char); @@ -99,8 +374,58 @@ TEST_ATOMIC_TYPE(atomic_int16_t, int16_t); TEST_ATOMIC_TYPE(atomic_uint32_t, uint32_t); TEST_ATOMIC_TYPE(atomic_int32_t, int32_t); +} + +static void +test_atomic_relaxed(void) +{ + TEST_ATOMIC_ORDER(memory_order_relaxed, memory_order_relaxed, + memory_order_relaxed); +} + +static void +test_atomic_consume(void) +{ + TEST_ATOMIC_ORDER(memory_order_consume, memory_order_release, + memory_order_release); +} + +static void +test_atomic_acquire(void) +{ + TEST_ATOMIC_ORDER(memory_order_acquire, memory_order_release, + memory_order_release); +} + +static void +test_atomic_acq_rel(void) +{ + TEST_ATOMIC_ORDER(memory_order_acquire, memory_order_release, + memory_order_acq_rel); +} + +static void +test_atomic_seq_cst(void) +{ + TEST_ATOMIC_ORDER(memory_order_seq_cst, memory_order_seq_cst, + memory_order_seq_cst); +} + +static void +test_atomic_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +{ + fatal_signal_init(); + test_atomic_plain(); + test_atomic_relaxed(); + test_atomic_consume(); + test_atomic_acquire(); + test_atomic_acq_rel(); + test_atomic_seq_cst(); test_atomic_flag(); + + test_acq_rel(); + test_cons_rel(); } OVSTEST_REGISTER("test-atomic", test_atomic_main); diff -Nru openvswitch-2.3.1/tests/test-bitmap.c openvswitch-2.4.0~git20150623/tests/test-bitmap.c --- openvswitch-2.3.1/tests/test-bitmap.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-bitmap.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2014 Kmindg + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#undef NDEBUG +#include "bitmap.h" +#include +#include "command-line.h" +#include "ovstest.h" +#include "timeval.h" + +enum { MAX_BITS = 20 * BITMAP_ULONG_BITS }; + +static int +elapsed(const struct timeval *start) +{ + struct timeval end; + + xgettimeofday(&end); + return timeval_to_msec(&end) - timeval_to_msec(start); +} + +/* Tests bitmap_equal. */ +static void +test_bitmap_equal(void) +{ + unsigned long *a, *b; + + a = bitmap_allocate(MAX_BITS); + b = bitmap_allocate(MAX_BITS); + + /* equal test */ + assert(bitmap_equal(a, b, MAX_BITS)); + assert(bitmap_equal(a, b, MAX_BITS - 1)); + assert(bitmap_equal(a, b, MAX_BITS - (BITMAP_ULONG_BITS - 1))); + + bitmap_set_multiple(a, 10 * BITMAP_ULONG_BITS, BITMAP_ULONG_BITS, true); + assert(bitmap_equal(a, b, 10 * BITMAP_ULONG_BITS)); + + /* non-equal test */ + assert(!bitmap_equal(a, b, 11 * BITMAP_ULONG_BITS)); + assert(!bitmap_equal(a, b, 11 * BITMAP_ULONG_BITS - 1)); + assert(!bitmap_equal(a, b, + 11 * BITMAP_ULONG_BITS - (BITMAP_ULONG_BITS - 1))); + + free(b); + free(a); +} + +/* Tests bitmap_scan. */ +static void +test_bitmap_scan(void) +{ + unsigned long *a; + + a = bitmap_allocate(MAX_BITS); + + /* scan for 1 */ + assert(bitmap_scan(a, true, 1, BITMAP_ULONG_BITS) == BITMAP_ULONG_BITS); + assert(bitmap_scan(a, true, BITMAP_ULONG_BITS - 1, BITMAP_ULONG_BITS) + == BITMAP_ULONG_BITS); + assert(bitmap_scan(a, true, 0, BITMAP_ULONG_BITS) == BITMAP_ULONG_BITS); + assert(bitmap_scan(a, true, 0, BITMAP_ULONG_BITS + 1) + == BITMAP_ULONG_BITS + 1); + assert(bitmap_scan(a, true, 0, 2 * BITMAP_ULONG_BITS - 1) + == 2 * BITMAP_ULONG_BITS - 1); + + bitmap_set1(a, MAX_BITS - 1); + assert(bitmap_scan(a, true, 0, MAX_BITS) == MAX_BITS - 1); + bitmap_set1(a, MAX_BITS - BITMAP_ULONG_BITS + 1); + assert(bitmap_scan(a, true, 3, MAX_BITS) + == MAX_BITS - BITMAP_ULONG_BITS + 1); + bitmap_set1(a, BITMAP_ULONG_BITS - 1); + assert(bitmap_scan(a, true, 7, MAX_BITS - 1) == BITMAP_ULONG_BITS - 1); + bitmap_set1(a, 0); + assert(bitmap_scan(a, true, 0, MAX_BITS - 7) == 0); + + bitmap_set_multiple(a, 0, MAX_BITS, true); + + /* scan for 0 */ + assert(bitmap_scan(a, false, 1, BITMAP_ULONG_BITS) == BITMAP_ULONG_BITS); + assert(bitmap_scan(a, false, BITMAP_ULONG_BITS - 1, BITMAP_ULONG_BITS) + == BITMAP_ULONG_BITS); + assert(bitmap_scan(a, false, 0, BITMAP_ULONG_BITS) == BITMAP_ULONG_BITS); + assert(bitmap_scan(a, false, 0, BITMAP_ULONG_BITS + 1) + == BITMAP_ULONG_BITS + 1); + assert(bitmap_scan(a, false, 0, 2 * BITMAP_ULONG_BITS - 1) + == 2 * BITMAP_ULONG_BITS - 1); + + bitmap_set0(a, MAX_BITS - 1); + assert(bitmap_scan(a, false, 0, MAX_BITS) == MAX_BITS - 1); + bitmap_set0(a, MAX_BITS - BITMAP_ULONG_BITS + 1); + assert(bitmap_scan(a, false, 3, MAX_BITS) + == MAX_BITS - BITMAP_ULONG_BITS + 1); + bitmap_set0(a, BITMAP_ULONG_BITS - 1); + assert(bitmap_scan(a, false, 7, MAX_BITS - 1) == BITMAP_ULONG_BITS - 1); + bitmap_set0(a, 0); + assert(bitmap_scan(a, false, 0, MAX_BITS - 7) == 0); + + free(a); +} + +static void +run_test(void (*function)(void)) +{ + function(); + printf("."); +} + +static void +run_tests(struct ovs_cmdl_context *ctx OVS_UNUSED) +{ + run_test(test_bitmap_equal); + run_test(test_bitmap_scan); + printf("\n"); +} + +static void +run_benchmarks(struct ovs_cmdl_context *ctx) +{ + int n_iter = strtol(ctx->argv[1], NULL, 10); + struct timeval start; + + xgettimeofday(&start); + for (int i = 0; i < n_iter; i++) { + test_bitmap_equal(); + } + printf("bitmap equal: %5d ms\n", elapsed(&start)); + + xgettimeofday(&start); + for (int i = 0; i < n_iter; i++) { + test_bitmap_scan(); + } + printf("bitmap scan: %5d ms\n", elapsed(&start)); + printf("\n"); +} + +static const struct ovs_cmdl_command commands[] = { + {"check", NULL, 0, 0, run_tests}, + {"benchmark", NULL, 1, 1, run_benchmarks}, + {NULL, NULL, 0, 0, NULL}, +}; + +static void +test_bitmap_main(int argc, char *argv[]) +{ + struct ovs_cmdl_context ctx = { + .argc = argc - 1, + .argv = argv + 1, + }; + + set_program_name(argv[0]); + ovs_cmdl_run_command(&ctx, commands); +} + +OVSTEST_REGISTER("test-bitmap", test_bitmap_main); diff -Nru openvswitch-2.3.1/tests/test-bundle.c openvswitch-2.4.0~git20150623/tests/test-bundle.c --- openvswitch-2.3.1/tests/test-bundle.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-bundle.c 2015-06-23 18:46:21.000000000 +0000 @@ -14,18 +14,15 @@ */ #include - +#undef NDEBUG #include "bundle.h" - #include #include - #include "flow.h" #include "ofp-actions.h" #include "ofpbuf.h" - -#include "util.h" #include "ovstest.h" +#include "util.h" #define N_FLOWS 50000 #define MAX_SLAVES 8 /* Maximum supported by this test framework. */ @@ -79,7 +76,7 @@ ovs_fatal(0, "%s", error); } - action = ofpbuf_data(&ofpacts); + action = ofpacts.data; bundle = ofpact_get_BUNDLE(xmemdup(action, action->len)); ofpbuf_uninit(&ofpacts); diff -Nru openvswitch-2.3.1/tests/test-byte-order.c openvswitch-2.4.0~git20150623/tests/test-byte-order.c --- openvswitch-2.3.1/tests/test-byte-order.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-byte-order.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,6 +15,7 @@ */ #include +#undef NDEBUG #include "byte-order.h" #include #include diff -Nru openvswitch-2.3.1/tests/test-classifier.c openvswitch-2.4.0~git20150623/tests/test-classifier.c --- openvswitch-2.3.1/tests/test-classifier.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-classifier.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,26 +26,26 @@ */ #include +#undef NDEBUG +#include "classifier.h" +#include #include #include #include "byte-order.h" +#include "classifier-private.h" #include "command-line.h" #include "flow.h" #include "ofp-util.h" +#include "ovstest.h" #include "packets.h" #include "random.h" #include "unaligned.h" -#include "ovstest.h" -#undef NDEBUG -#include +#include "util.h" -/* We need access to classifier internal definitions to be able to fully - * test them. The alternative would be to expose them all in the classifier - * API. */ -#include "classifier.c" +static bool versioned = false; /* Fields in a rule. */ -#define CLS_FIELDS \ +#define CLS_FIELDS \ /* struct flow all-caps */ \ /* member name name */ \ /* ----------- -------- */ \ @@ -90,6 +90,7 @@ }; struct test_rule { + struct ovs_list list_node; int aux; /* Auxiliary data. */ struct cls_rule cls_rule; /* Classifier rule data. */ }; @@ -109,8 +110,8 @@ } } -static struct test_rule *make_rule(int wc_fields, unsigned int priority, - int value_pat); +static struct test_rule *make_rule(int wc_fields, int priority, int value_pat, + long long version); static void free_rule(struct test_rule *); static struct test_rule *clone_rule(const struct test_rule *); @@ -157,7 +158,7 @@ const struct cls_rule *pos = &tcls->rules[i]->cls_rule; if (cls_rule_equal(pos, &rule->cls_rule)) { /* Exact match. */ - free_rule(tcls->rules[i]); + ovsrcu_postpone(free_rule, tcls->rules[i]); tcls->rules[i] = clone_rule(rule); return tcls->rules[i]; } else if (pos->priority < rule->cls_rule.priority) { @@ -311,9 +312,11 @@ static ovs_be16 tp_src_values[] = { CONSTANT_HTONS(49362), CONSTANT_HTONS(80) }; static ovs_be16 tp_dst_values[] = { CONSTANT_HTONS(6667), CONSTANT_HTONS(22) }; -static uint8_t dl_src_values[][6] = { { 0x00, 0x02, 0xe3, 0x0f, 0x80, 0xa4 }, +static uint8_t dl_src_values[][ETH_ADDR_LEN] = { + { 0x00, 0x02, 0xe3, 0x0f, 0x80, 0xa4 }, { 0x5e, 0x33, 0x7f, 0x5f, 0x1e, 0x99 } }; -static uint8_t dl_dst_values[][6] = { { 0x4a, 0x27, 0x71, 0xae, 0x64, 0xc1 }, +static uint8_t dl_dst_values[][ETH_ADDR_LEN] = { + { 0x4a, 0x27, 0x71, 0xae, 0x64, 0xc1 }, { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } }; static uint8_t nw_proto_values[] = { IPPROTO_TCP, IPPROTO_ICMP }; static uint8_t nw_dscp_values[] = { 48, 0 }; @@ -399,15 +402,15 @@ } static void -compare_classifiers(struct classifier *cls, struct tcls *tcls) - OVS_REQ_RDLOCK(cls->rwlock) +compare_classifiers(struct classifier *cls, size_t n_invisible_rules, + long long version, struct tcls *tcls) { static const int confidence = 500; unsigned int i; - assert(classifier_count(cls) == tcls->n_rules); + assert(classifier_count(cls) == tcls->n_rules + n_invisible_rules); for (i = 0; i < confidence; i++) { - struct cls_rule *cr0, *cr1, *cr2; + const struct cls_rule *cr0, *cr1, *cr2; struct flow flow; struct flow_wildcards wc; unsigned int x; @@ -432,7 +435,10 @@ flow.nw_proto = nw_proto_values[get_value(&x, N_NW_PROTO_VALUES)]; flow.nw_tos = nw_dscp_values[get_value(&x, N_NW_DSCP_VALUES)]; - cr0 = classifier_lookup(cls, &flow, &wc); + /* This assertion is here to suppress a GCC 4.9 array-bounds warning */ + ovs_assert(cls->n_tries <= CLS_MAX_TRIES); + + cr0 = classifier_lookup(cls, version, &flow, &wc); cr1 = tcls_lookup(tcls, &flow); assert((cr0 == NULL) == (cr1 == NULL)); if (cr0 != NULL) { @@ -441,8 +447,12 @@ assert(cls_rule_equal(cr0, cr1)); assert(tr0->aux == tr1->aux); + + /* Make sure the rule should have been visible. */ + assert(cr0->cls_match); + assert(cls_match_visible_in_version(cr0->cls_match, version)); } - cr2 = classifier_lookup(cls, &flow, NULL); + cr2 = classifier_lookup(cls, version, &flow, NULL); assert(cr2 == cr0); } } @@ -450,80 +460,206 @@ static void destroy_classifier(struct classifier *cls) { - struct test_rule *rule, *next_rule; - struct cls_cursor cursor; + struct test_rule *rule; - fat_rwlock_wrlock(&cls->rwlock); - cls_cursor_init(&cursor, cls, NULL); - CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, cls_rule, &cursor) { - classifier_remove(cls, &rule->cls_rule); - free_rule(rule); + classifier_defer(cls); + CLS_FOR_EACH (rule, cls_rule, cls) { + if (classifier_remove(cls, &rule->cls_rule)) { + ovsrcu_postpone(free_rule, rule); + } } - fat_rwlock_unlock(&cls->rwlock); classifier_destroy(cls); } static void +pvector_verify(const struct pvector *pvec) +{ + void *ptr OVS_UNUSED; + int prev_priority = INT_MAX; + + PVECTOR_FOR_EACH (ptr, pvec) { + int priority = cursor__.vector[cursor__.entry_idx].priority; + if (priority > prev_priority) { + ovs_abort(0, "Priority vector is out of order (%u > %u)", + priority, prev_priority); + } + prev_priority = priority; + } +} + +static unsigned int +trie_verify(const rcu_trie_ptr *trie, unsigned int ofs, unsigned int n_bits) +{ + const struct trie_node *node = ovsrcu_get(struct trie_node *, trie); + + if (node) { + assert(node->n_rules == 0 || node->n_bits > 0); + ofs += node->n_bits; + assert((ofs > 0 || (ofs == 0 && node->n_bits == 0)) && ofs <= n_bits); + + return node->n_rules + + trie_verify(&node->edges[0], ofs, n_bits) + + trie_verify(&node->edges[1], ofs, n_bits); + } + return 0; +} + +static void +verify_tries(struct classifier *cls) + OVS_NO_THREAD_SAFETY_ANALYSIS +{ + unsigned int n_rules = 0; + int i; + + for (i = 0; i < cls->n_tries; i++) { + n_rules += trie_verify(&cls->tries[i].root, 0, + cls->tries[i].field->n_bits); + } + assert(n_rules <= cls->n_rules); +} + +static void check_tables(const struct classifier *cls, int n_tables, int n_rules, - int n_dups) OVS_REQ_RDLOCK(cls->rwlock) + int n_dups, int n_invisible, long long version) + OVS_NO_THREAD_SAFETY_ANALYSIS { const struct cls_subtable *table; struct test_rule *test_rule; - struct cls_cursor cursor; int found_tables = 0; + int found_tables_with_visible_rules = 0; int found_rules = 0; int found_dups = 0; + int found_invisible = 0; + int found_visible_but_removable = 0; int found_rules2 = 0; - HMAP_FOR_EACH (table, hmap_node, &cls->cls->subtables) { + pvector_verify(&cls->subtables); + CMAP_FOR_EACH (table, cmap_node, &cls->subtables_map) { const struct cls_match *head; - unsigned int max_priority = 0; + int max_priority = INT_MIN; unsigned int max_count = 0; + bool found = false; + bool found_visible_rules = false; + const struct cls_subtable *iter; + + /* Locate the subtable from 'subtables'. */ + PVECTOR_FOR_EACH (iter, &cls->subtables) { + if (iter == table) { + if (found) { + ovs_abort(0, "Subtable %p duplicated in 'subtables'.", + table); + } + found = true; + } + } + if (!found) { + ovs_abort(0, "Subtable %p not found from 'subtables'.", table); + } - assert(!hmap_is_empty(&table->rules)); + assert(!cmap_is_empty(&table->rules)); + assert(trie_verify(&table->ports_trie, 0, table->ports_mask_len) + == (table->ports_mask_len ? cmap_count(&table->rules) : 0)); found_tables++; - HMAP_FOR_EACH (head, hmap_node, &table->rules) { - unsigned int prev_priority = UINT_MAX; - const struct cls_match *rule; + + CMAP_FOR_EACH (head, cmap_node, &table->rules) { + int prev_priority = INT_MAX; + long long prev_version = 0; + const struct cls_match *rule, *prev; + bool found_visible_rules_in_list = false; + + assert(head->priority <= table->max_priority); if (head->priority > max_priority) { max_priority = head->priority; - max_count = 1; - } else if (head->priority == max_priority) { - ++max_count; + max_count = 0; } - found_rules++; - LIST_FOR_EACH (rule, list, &head->list) { - assert(rule->priority < prev_priority); - assert(rule->priority <= table->max_priority); + FOR_EACH_RULE_IN_LIST_PROTECTED(rule, prev, head) { + long long rule_version; + const struct cls_rule *found_rule; + + /* Priority may not increase. */ + assert(rule->priority <= prev_priority); + + if (rule->priority == max_priority) { + ++max_count; + } + + /* Count invisible rules and visible duplicates. */ + if (!cls_match_visible_in_version(rule, version)) { + found_invisible++; + } else { + if (cls_match_is_eventually_invisible(rule)) { + found_visible_but_removable++; + } + if (found_visible_rules_in_list) { + found_dups++; + } + found_visible_rules_in_list = true; + found_visible_rules = true; + } + + /* Rule must be visible in the version it was inserted. */ + rule_version = rule->cls_rule->version; + assert(cls_match_visible_in_version(rule, rule_version)); + + /* We should always find the latest version of the rule, + * unless all rules have been marked for removal. + * Later versions must always be later in the list. */ + found_rule = classifier_find_rule_exactly(cls, rule->cls_rule); + if (found_rule && found_rule != rule->cls_rule) { + + assert(found_rule->priority == rule->priority); + + /* Found rule may not have a lower version. */ + assert(found_rule->version >= rule_version); + + /* This rule must not be visible in the found rule's + * version. */ + assert(!cls_match_visible_in_version(rule, + found_rule->version)); + } + + if (rule->priority == prev_priority) { + /* Exact duplicate rule may not have a lower version. */ + assert(rule_version >= prev_version); + + /* Previous rule must not be visible in rule's version. */ + assert(!cls_match_visible_in_version(prev, rule_version)); + } prev_priority = rule->priority; + prev_version = rule_version; found_rules++; - found_dups++; - assert(classifier_find_rule_exactly(cls, rule->cls_rule) - == rule->cls_rule); } } + + if (found_visible_rules) { + found_tables_with_visible_rules++; + } + assert(table->max_priority == max_priority); assert(table->max_count == max_count); } - assert(found_tables == hmap_count(&cls->cls->subtables)); - assert(n_tables == -1 || n_tables == hmap_count(&cls->cls->subtables)); - assert(n_rules == -1 || found_rules == n_rules); + assert(found_tables == cmap_count(&cls->subtables_map)); + assert(found_tables == pvector_count(&cls->subtables)); + assert(n_tables == -1 || n_tables == found_tables_with_visible_rules); + assert(n_rules == -1 || found_rules == n_rules + found_invisible); assert(n_dups == -1 || found_dups == n_dups); + assert(found_invisible == n_invisible); - cls_cursor_init(&cursor, cls, NULL); - CLS_CURSOR_FOR_EACH (test_rule, cls_rule, &cursor) { + CLS_FOR_EACH (test_rule, cls_rule, cls) { found_rules2++; } - assert(found_rules == found_rules2); + /* Iteration does not see removable rules. */ + assert(found_rules + == found_rules2 + found_visible_but_removable + found_invisible); } static struct test_rule * -make_rule(int wc_fields, unsigned int priority, int value_pat) +make_rule(int wc_fields, int priority, int value_pat, long long version) { const struct cls_field *f; struct test_rule *rule; @@ -568,7 +704,10 @@ } rule = xzalloc(sizeof *rule); - cls_rule_init(&rule->cls_rule, &match, wc_fields ? priority : UINT_MAX); + cls_rule_init(&rule->cls_rule, &match, wc_fields + ? (priority == INT_MIN ? priority + 1 : + priority == INT_MAX ? priority - 1 : priority) + : 0, version); return rule; } @@ -591,11 +730,11 @@ } static void -shuffle(unsigned int *p, size_t n) +shuffle(int *p, size_t n) { for (; n > 1; n--, p++) { - unsigned int *q = &p[random_range(n)]; - unsigned int tmp = *p; + int *q = &p[random_range(n)]; + int tmp = *p; *p = *q; *q = tmp; } @@ -618,35 +757,41 @@ MFF_IPV4_DST, MFF_IPV4_SRC }; +static void +set_prefix_fields(struct classifier *cls) +{ + verify_tries(cls); + classifier_set_prefix_fields(cls, trie_fields, ARRAY_SIZE(trie_fields)); + verify_tries(cls); +} + /* Tests an empty classifier. */ static void -test_empty(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_empty(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct classifier cls; struct tcls tcls; - classifier_init(&cls, flow_segment_u32s); - fat_rwlock_wrlock(&cls.rwlock); - classifier_set_prefix_fields(&cls, trie_fields, ARRAY_SIZE(trie_fields)); + classifier_init(&cls, flow_segment_u64s); + set_prefix_fields(&cls); tcls_init(&tcls); assert(classifier_is_empty(&cls)); assert(tcls_is_empty(&tcls)); - compare_classifiers(&cls, &tcls); - fat_rwlock_unlock(&cls.rwlock); + compare_classifiers(&cls, 0, CLS_MIN_VERSION, &tcls); classifier_destroy(&cls); tcls_destroy(&tcls); } /* Destroys a null classifier. */ static void -test_destroy_null(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_destroy_null(struct ovs_cmdl_context *ctx OVS_UNUSED) { classifier_destroy(NULL); } /* Tests classification with one rule at a time. */ static void -test_single_rule(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_single_rule(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned int wc_fields; /* Hilarious. */ @@ -656,27 +801,24 @@ struct tcls tcls; rule = make_rule(wc_fields, - hash_bytes(&wc_fields, sizeof wc_fields, 0), 0); - - classifier_init(&cls, flow_segment_u32s); - fat_rwlock_wrlock(&cls.rwlock); - classifier_set_prefix_fields(&cls, trie_fields, - ARRAY_SIZE(trie_fields)); + hash_bytes(&wc_fields, sizeof wc_fields, 0), 0, + CLS_MIN_VERSION); + classifier_init(&cls, flow_segment_u64s); + set_prefix_fields(&cls); tcls_init(&tcls); - tcls_rule = tcls_insert(&tcls, rule); - classifier_insert(&cls, &rule->cls_rule); - check_tables(&cls, 1, 1, 0); - compare_classifiers(&cls, &tcls); + + classifier_insert(&cls, &rule->cls_rule, NULL, 0); + compare_classifiers(&cls, 0, CLS_MIN_VERSION, &tcls); + check_tables(&cls, 1, 1, 0, 0, CLS_MIN_VERSION); classifier_remove(&cls, &rule->cls_rule); tcls_remove(&tcls, tcls_rule); assert(classifier_is_empty(&cls)); assert(tcls_is_empty(&tcls)); - compare_classifiers(&cls, &tcls); + compare_classifiers(&cls, 0, CLS_MIN_VERSION, &tcls); - free_rule(rule); - fat_rwlock_unlock(&cls.rwlock); + ovsrcu_postpone(free_rule, rule); classifier_destroy(&cls); tcls_destroy(&tcls); } @@ -684,7 +826,7 @@ /* Tests replacing one rule by another. */ static void -test_rule_replacement(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_rule_replacement(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned int wc_fields; @@ -694,31 +836,35 @@ struct test_rule *rule2; struct tcls tcls; - rule1 = make_rule(wc_fields, OFP_DEFAULT_PRIORITY, UINT_MAX); - rule2 = make_rule(wc_fields, OFP_DEFAULT_PRIORITY, UINT_MAX); + rule1 = make_rule(wc_fields, OFP_DEFAULT_PRIORITY, UINT_MAX, + CLS_MIN_VERSION); + rule2 = make_rule(wc_fields, OFP_DEFAULT_PRIORITY, UINT_MAX, + CLS_MIN_VERSION); rule2->aux += 5; rule2->aux += 5; - classifier_init(&cls, flow_segment_u32s); - fat_rwlock_wrlock(&cls.rwlock); - classifier_set_prefix_fields(&cls, trie_fields, - ARRAY_SIZE(trie_fields)); + classifier_init(&cls, flow_segment_u64s); + set_prefix_fields(&cls); tcls_init(&tcls); tcls_insert(&tcls, rule1); - classifier_insert(&cls, &rule1->cls_rule); - check_tables(&cls, 1, 1, 0); - compare_classifiers(&cls, &tcls); + classifier_insert(&cls, &rule1->cls_rule, NULL, 0); + compare_classifiers(&cls, 0, CLS_MIN_VERSION, &tcls); + check_tables(&cls, 1, 1, 0, 0, CLS_MIN_VERSION); tcls_destroy(&tcls); tcls_init(&tcls); tcls_insert(&tcls, rule2); + assert(test_rule_from_cls_rule( - classifier_replace(&cls, &rule2->cls_rule)) == rule1); - free_rule(rule1); - check_tables(&cls, 1, 1, 0); - compare_classifiers(&cls, &tcls); + classifier_replace(&cls, &rule2->cls_rule, + NULL, 0)) == rule1); + ovsrcu_postpone(free_rule, rule1); + compare_classifiers(&cls, 0, CLS_MIN_VERSION, &tcls); + check_tables(&cls, 1, 1, 0, 0, CLS_MIN_VERSION); + classifier_defer(&cls); + classifier_remove(&cls, &rule2->cls_rule); + tcls_destroy(&tcls); - fat_rwlock_unlock(&cls.rwlock); destroy_classifier(&cls); } } @@ -777,7 +923,7 @@ /* Tests classification with rules that have the same matching criteria. */ static void -test_many_rules_in_one_list (int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_many_rules_in_one_list (struct ovs_cmdl_context *ctx OVS_UNUSED) { enum { N_RULES = 3 }; int n_pris; @@ -804,31 +950,52 @@ int pri_rules[N_RULES]; struct classifier cls; struct tcls tcls; + long long version = CLS_MIN_VERSION; + size_t n_invisible_rules = 0; n_permutations++; for (i = 0; i < N_RULES; i++) { - rules[i] = make_rule(456, pris[i], 0); + rules[i] = make_rule(456, pris[i], 0, version); tcls_rules[i] = NULL; pri_rules[i] = -1; } - classifier_init(&cls, flow_segment_u32s); - fat_rwlock_wrlock(&cls.rwlock); - classifier_set_prefix_fields(&cls, trie_fields, - ARRAY_SIZE(trie_fields)); + classifier_init(&cls, flow_segment_u64s); + set_prefix_fields(&cls); tcls_init(&tcls); for (i = 0; i < ARRAY_SIZE(ops); i++) { + struct test_rule *displaced_rule = NULL; + struct cls_rule *removable_rule = NULL; int j = ops[i]; int m, n; if (!tcls_rules[j]) { - struct test_rule *displaced_rule; - tcls_rules[j] = tcls_insert(&tcls, rules[j]); - displaced_rule = test_rule_from_cls_rule( - classifier_replace(&cls, &rules[j]->cls_rule)); + if (versioned) { + /* Insert the new rule in the next version. */ + *CONST_CAST(cls_version_t *, + &rules[j]->cls_rule.version) + = ++version; + + displaced_rule = test_rule_from_cls_rule( + classifier_find_rule_exactly(&cls, + &rules[j]->cls_rule)); + if (displaced_rule) { + /* Mark the old rule for removal after the current + * version. */ + cls_rule_make_invisible_in_version( + &displaced_rule->cls_rule, version); + n_invisible_rules++; + removable_rule = &displaced_rule->cls_rule; + } + classifier_insert(&cls, &rules[j]->cls_rule, NULL, 0); + } else { + displaced_rule = test_rule_from_cls_rule( + classifier_replace(&cls, &rules[j]->cls_rule, + NULL, 0)); + } if (pri_rules[pris[j]] >= 0) { int k = pri_rules[pris[j]]; assert(displaced_rule != NULL); @@ -840,29 +1007,45 @@ } pri_rules[pris[j]] = j; } else { - classifier_remove(&cls, &rules[j]->cls_rule); + if (versioned) { + /* Mark the rule for removal after the current + * version. */ + cls_rule_make_invisible_in_version( + &rules[j]->cls_rule, version + 1); + ++version; + n_invisible_rules++; + removable_rule = &rules[j]->cls_rule; + } else { + classifier_remove(&cls, &rules[j]->cls_rule); + } tcls_remove(&tcls, tcls_rules[j]); tcls_rules[j] = NULL; pri_rules[pris[j]] = -1; } - + compare_classifiers(&cls, n_invisible_rules, version, &tcls); n = 0; for (m = 0; m < N_RULES; m++) { n += tcls_rules[m] != NULL; } - check_tables(&cls, n > 0, n, n - 1); + check_tables(&cls, n > 0, n, n - 1, n_invisible_rules, + version); - compare_classifiers(&cls, &tcls); + if (versioned && removable_rule) { + /* Removable rule is no longer visible. */ + assert(removable_rule->cls_match); + assert(!cls_match_visible_in_version( + removable_rule->cls_match, version)); + classifier_remove(&cls, removable_rule); + n_invisible_rules--; + } } + classifier_defer(&cls); for (i = 0; i < N_RULES; i++) { - if (rules[i]->cls_rule.cls_match) { - classifier_remove(&cls, &rules[i]->cls_rule); + if (classifier_remove(&cls, &rules[i]->cls_rule)) { + ovsrcu_postpone(free_rule, rules[i]); } - free_rule(rules[i]); } - - fat_rwlock_unlock(&cls.rwlock); classifier_destroy(&cls); tcls_destroy(&tcls); } while (next_permutation(ops, ARRAY_SIZE(ops))); @@ -900,7 +1083,7 @@ /* Tests classification with two rules at a time that fall into the same * table but different lists. */ static void -test_many_rules_in_one_table(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_many_rules_in_one_table(struct ovs_cmdl_context *ctx OVS_UNUSED) { int iteration; @@ -910,6 +1093,8 @@ struct test_rule *tcls_rules[N_RULES]; struct classifier cls; struct tcls tcls; + long long version = CLS_MIN_VERSION; + size_t n_invisible_rules = 0; int value_pats[N_RULES]; int value_mask; int wcf; @@ -920,37 +1105,57 @@ value_mask = ~wcf & ((1u << CLS_N_FIELDS) - 1); } while ((1 << count_ones(value_mask)) < N_RULES); - classifier_init(&cls, flow_segment_u32s); - fat_rwlock_wrlock(&cls.rwlock); - classifier_set_prefix_fields(&cls, trie_fields, - ARRAY_SIZE(trie_fields)); + classifier_init(&cls, flow_segment_u64s); + set_prefix_fields(&cls); tcls_init(&tcls); for (i = 0; i < N_RULES; i++) { - unsigned int priority = random_uint32(); + int priority = random_range(INT_MAX); do { value_pats[i] = random_uint32() & value_mask; } while (array_contains(value_pats, i, value_pats[i])); - rules[i] = make_rule(wcf, priority, value_pats[i]); + ++version; + rules[i] = make_rule(wcf, priority, value_pats[i], version); tcls_rules[i] = tcls_insert(&tcls, rules[i]); - classifier_insert(&cls, &rules[i]->cls_rule); - check_tables(&cls, 1, i + 1, 0); - compare_classifiers(&cls, &tcls); + classifier_insert(&cls, &rules[i]->cls_rule, NULL, 0); + compare_classifiers(&cls, n_invisible_rules, version, &tcls); + + check_tables(&cls, 1, i + 1, 0, n_invisible_rules, version); } for (i = 0; i < N_RULES; i++) { tcls_remove(&tcls, tcls_rules[i]); - classifier_remove(&cls, &rules[i]->cls_rule); - free_rule(rules[i]); + if (versioned) { + /* Mark the rule for removal after the current version. */ + cls_rule_make_invisible_in_version(&rules[i]->cls_rule, + version + 1); + ++version; + n_invisible_rules++; + } else { + classifier_remove(&cls, &rules[i]->cls_rule); + } + compare_classifiers(&cls, n_invisible_rules, version, &tcls); + check_tables(&cls, i < N_RULES - 1, N_RULES - (i + 1), 0, + n_invisible_rules, version); + if (!versioned) { + ovsrcu_postpone(free_rule, rules[i]); + } + } + + if (versioned) { + for (i = 0; i < N_RULES; i++) { + classifier_remove(&cls, &rules[i]->cls_rule); + n_invisible_rules--; - check_tables(&cls, i < N_RULES - 1, N_RULES - (i + 1), 0); - compare_classifiers(&cls, &tcls); + compare_classifiers(&cls, n_invisible_rules, version, &tcls); + check_tables(&cls, 0, 0, 0, n_invisible_rules, version); + ovsrcu_postpone(free_rule, rules[i]); + } } - fat_rwlock_unlock(&cls.rwlock); classifier_destroy(&cls); tcls_destroy(&tcls); } @@ -974,66 +1179,94 @@ } for (iteration = 0; iteration < 30; iteration++) { - unsigned int priorities[MAX_RULES]; + int priorities[MAX_RULES]; struct classifier cls; struct tcls tcls; + long long version = CLS_MIN_VERSION; + size_t n_invisible_rules = 0; + struct ovs_list list = OVS_LIST_INITIALIZER(&list); random_set_seed(iteration + 1); for (i = 0; i < MAX_RULES; i++) { - priorities[i] = i * 129; + priorities[i] = (i * 129) & INT_MAX; } shuffle(priorities, ARRAY_SIZE(priorities)); - classifier_init(&cls, flow_segment_u32s); - fat_rwlock_wrlock(&cls.rwlock); - classifier_set_prefix_fields(&cls, trie_fields, - ARRAY_SIZE(trie_fields)); + classifier_init(&cls, flow_segment_u64s); + set_prefix_fields(&cls); tcls_init(&tcls); for (i = 0; i < MAX_RULES; i++) { struct test_rule *rule; - unsigned int priority = priorities[i]; + int priority = priorities[i]; int wcf = wcfs[random_range(n_tables)]; int value_pat = random_uint32() & ((1u << CLS_N_FIELDS) - 1); - rule = make_rule(wcf, priority, value_pat); + rule = make_rule(wcf, priority, value_pat, version); tcls_insert(&tcls, rule); - classifier_insert(&cls, &rule->cls_rule); - check_tables(&cls, -1, i + 1, -1); - compare_classifiers(&cls, &tcls); + classifier_insert(&cls, &rule->cls_rule, NULL, 0); + compare_classifiers(&cls, n_invisible_rules, version, &tcls); + check_tables(&cls, -1, i + 1, -1, n_invisible_rules, version); } - while (!classifier_is_empty(&cls)) { - struct test_rule *rule, *next_rule; + while (classifier_count(&cls) - n_invisible_rules > 0) { struct test_rule *target; - struct cls_cursor cursor; + struct test_rule *rule; + size_t n_removable_rules = 0; target = clone_rule(tcls.rules[random_range(tcls.n_rules)]); - cls_cursor_init(&cursor, &cls, &target->cls_rule); - CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, cls_rule, &cursor) { - classifier_remove(&cls, &rule->cls_rule); - free_rule(rule); + CLS_FOR_EACH_TARGET (rule, cls_rule, &cls, &target->cls_rule) { + if (versioned) { + /* Mark the rule for removal after the current version. */ + cls_rule_make_invisible_in_version(&rule->cls_rule, + version + 1); + n_removable_rules++; + compare_classifiers(&cls, n_invisible_rules, version, + &tcls); + check_tables(&cls, -1, -1, -1, n_invisible_rules, version); + + list_push_back(&list, &rule->list_node); + } else if (classifier_remove(&cls, &rule->cls_rule)) { + ovsrcu_postpone(free_rule, rule); + } } + + ++version; + n_invisible_rules += n_removable_rules; + tcls_delete_matches(&tcls, &target->cls_rule); - compare_classifiers(&cls, &tcls); - check_tables(&cls, -1, -1, -1); free_rule(target); + + compare_classifiers(&cls, n_invisible_rules, version, &tcls); + check_tables(&cls, -1, -1, -1, n_invisible_rules, version); + } + if (versioned) { + struct test_rule *rule; + + /* Remove rules that are no longer visible. */ + LIST_FOR_EACH_POP (rule, list_node, &list) { + classifier_remove(&cls, &rule->cls_rule); + n_invisible_rules--; + + compare_classifiers(&cls, n_invisible_rules, version, + &tcls); + check_tables(&cls, -1, -1, -1, n_invisible_rules, version); + } } - fat_rwlock_unlock(&cls.rwlock); destroy_classifier(&cls); tcls_destroy(&tcls); } } static void -test_many_rules_in_two_tables(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_many_rules_in_two_tables(struct ovs_cmdl_context *ctx OVS_UNUSED) { test_many_rules_in_n_tables(2); } static void -test_many_rules_in_five_tables(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_many_rules_in_five_tables(struct ovs_cmdl_context *ctx OVS_UNUSED) { test_many_rules_in_n_tables(5); } @@ -1061,6 +1294,8 @@ } } +#define FLOW_U32S (FLOW_U64S * 2) + static bool init_consecutive_values(int n_consecutive, struct flow *flow, unsigned int *idxp) @@ -1191,14 +1426,14 @@ } static void -test_miniflow(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_miniflow(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct flow flow; unsigned int idx; random_set_seed(0xb3faca38); for (idx = 0; next_random_flow(&flow, idx); idx++) { - const uint32_t *flow_u32 = (const uint32_t *) &flow; + const uint64_t *flow_u64 = (const uint64_t *) &flow; struct miniflow miniflow, miniflow2, miniflow3; struct flow flow2, flow3; struct flow_wildcards mask; @@ -1210,9 +1445,8 @@ /* Check that the flow equals its miniflow. */ assert(miniflow_get_vid(&miniflow) == vlan_tci_to_vid(flow.vlan_tci)); - for (i = 0; i < FLOW_U32S; i++) { - assert(MINIFLOW_GET_TYPE(&miniflow, uint32_t, i * 4) - == flow_u32[i]); + for (i = 0; i < FLOW_U64S; i++) { + assert(miniflow_get(&miniflow, i) == flow_u64[i]); } /* Check that the miniflow equals itself. */ @@ -1258,7 +1492,7 @@ } static void -test_minimask_has_extra(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_minimask_has_extra(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct flow_wildcards catchall; struct minimask minicatchall; @@ -1296,7 +1530,7 @@ } static void -test_minimask_combine(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_minimask_combine(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct flow_wildcards catchall; struct minimask minicatchall; @@ -1311,7 +1545,7 @@ for (idx = 0; next_random_flow(&flow, idx); idx++) { struct minimask minimask, minimask2, minicombined; struct flow_wildcards mask, mask2, combined, combined2; - uint32_t storage[FLOW_U32S]; + uint64_t storage[FLOW_U64S]; struct flow flow2; mask.masks = flow; @@ -1336,31 +1570,42 @@ minimask_destroy(&minicatchall); } -static const struct command commands[] = { +static const struct ovs_cmdl_command commands[] = { /* Classifier tests. */ - {"empty", 0, 0, test_empty}, - {"destroy-null", 0, 0, test_destroy_null}, - {"single-rule", 0, 0, test_single_rule}, - {"rule-replacement", 0, 0, test_rule_replacement}, - {"many-rules-in-one-list", 0, 0, test_many_rules_in_one_list}, - {"many-rules-in-one-table", 0, 0, test_many_rules_in_one_table}, - {"many-rules-in-two-tables", 0, 0, test_many_rules_in_two_tables}, - {"many-rules-in-five-tables", 0, 0, test_many_rules_in_five_tables}, + {"empty", NULL, 0, 0, test_empty}, + {"destroy-null", NULL, 0, 0, test_destroy_null}, + {"single-rule", NULL, 0, 0, test_single_rule}, + {"rule-replacement", NULL, 0, 0, test_rule_replacement}, + {"many-rules-in-one-list", NULL, 0, 1, test_many_rules_in_one_list}, + {"many-rules-in-one-table", NULL, 0, 1, test_many_rules_in_one_table}, + {"many-rules-in-two-tables", NULL, 0, 0, test_many_rules_in_two_tables}, + {"many-rules-in-five-tables", NULL, 0, 0, test_many_rules_in_five_tables}, /* Miniflow and minimask tests. */ - {"miniflow", 0, 0, test_miniflow}, - {"minimask_has_extra", 0, 0, test_minimask_has_extra}, - {"minimask_combine", 0, 0, test_minimask_combine}, + {"miniflow", NULL, 0, 0, test_miniflow}, + {"minimask_has_extra", NULL, 0, 0, test_minimask_has_extra}, + {"minimask_combine", NULL, 0, 0, test_minimask_combine}, - {NULL, 0, 0, NULL}, + {NULL, NULL, 0, 0, NULL}, }; static void test_classifier_main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { + .argc = argc - 1, + .argv = argv + 1, + }; set_program_name(argv[0]); + + if (argc > 1 && !strcmp(argv[1], "--versioned")) { + versioned = true; + ctx.argc--; + ctx.argv++; + } + init_values(); - run_command(argc - 1, argv + 1, commands); + ovs_cmdl_run_command(&ctx, commands); } OVSTEST_REGISTER("test-classifier", test_classifier_main); diff -Nru openvswitch-2.3.1/tests/test-cmap.c openvswitch-2.4.0~git20150623/tests/test-cmap.c --- openvswitch-2.3.1/tests/test-cmap.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-cmap.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,657 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2013, 2014 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* A non-exhaustive test for some of the functions and macros declared in + * cmap.h. */ + +#include +#undef NDEBUG +#include "cmap.h" +#include +#include +#include +#include "bitmap.h" +#include "command-line.h" +#include "fat-rwlock.h" +#include "hash.h" +#include "hmap.h" +#include "ovstest.h" +#include "ovs-thread.h" +#include "random.h" +#include "timeval.h" +#include "util.h" + +/* Sample cmap element. */ +struct element { + int value; + struct cmap_node node; +}; + +typedef size_t hash_func(int value); + +static int +compare_ints(const void *a_, const void *b_) +{ + const int *a = a_; + const int *b = b_; + return *a < *b ? -1 : *a > *b; +} + +/* Verifies that 'cmap' contains exactly the 'n' values in 'values'. */ +static void +check_cmap(struct cmap *cmap, const int values[], size_t n, + hash_func *hash) +{ + int *sort_values, *cmap_values, *cmap_values2; + const struct element *e; + size_t i, batch_size; + + struct cmap_position pos = { 0, 0, 0 }; + struct cmap_node *node; + + /* Check that all the values are there in iteration. */ + sort_values = xmalloc(sizeof *sort_values * n); + cmap_values = xmalloc(sizeof *sort_values * n); + cmap_values2 = xmalloc(sizeof *sort_values * n); + + /* Here we test cursor iteration */ + i = 0; + CMAP_FOR_EACH (e, node, cmap) { + assert(i < n); + cmap_values[i++] = e->value; + } + assert(i == n); + + /* Here we test iteration with cmap_next_position() */ + i = 0; + while ((node = cmap_next_position(cmap, &pos))) { + struct element *e = NULL; + e = OBJECT_CONTAINING(node, e, node); + + assert(i < n); + cmap_values2[i++] = e->value; + } + assert(i == n); + + memcpy(sort_values, values, sizeof *sort_values * n); + qsort(sort_values, n, sizeof *sort_values, compare_ints); + qsort(cmap_values, n, sizeof *cmap_values, compare_ints); + qsort(cmap_values2, n, sizeof *cmap_values2, compare_ints); + + for (i = 0; i < n; i++) { + assert(sort_values[i] == cmap_values[i]); + assert(sort_values[i] == cmap_values2[i]); + } + + free(cmap_values2); + free(cmap_values); + free(sort_values); + + /* Check that all the values are there in lookup. */ + for (i = 0; i < n; i++) { + size_t count = 0; + + CMAP_FOR_EACH_WITH_HASH (e, node, hash(values[i]), cmap) { + count += e->value == values[i]; + } + assert(count == 1); + } + + /* Check that all the values are there in batched lookup. */ + batch_size = n % BITMAP_ULONG_BITS + 1; + for (i = 0; i < n; i += batch_size) { + unsigned long map; + uint32_t hashes[sizeof map * CHAR_BIT]; + const struct cmap_node *nodes[sizeof map * CHAR_BIT]; + size_t count = 0; + int k, j; + + j = MIN(n - i, batch_size); /* Actual batch size. */ + map = ~0UL >> (BITMAP_ULONG_BITS - j); + + for (k = 0; k < j; k++) { + hashes[k] = hash(values[i + k]); + } + map = cmap_find_batch(cmap, map, hashes, nodes); + + ULONG_FOR_EACH_1(k, map) { + struct element *e; + + CMAP_NODE_FOR_EACH (e, node, nodes[k]) { + count += e->value == values[i + k]; + } + } + assert(count == j); /* j elements in a batch. */ + } + + /* Check that cmap_first() returns NULL only when cmap_is_empty(). */ + assert(!cmap_first(cmap) == cmap_is_empty(cmap)); + + /* Check counters. */ + assert(cmap_is_empty(cmap) == !n); + assert(cmap_count(cmap) == n); +} + +static void +shuffle(int *p, size_t n) +{ + for (; n > 1; n--, p++) { + int *q = &p[random_range(n)]; + int tmp = *p; + *p = *q; + *q = tmp; + } +} + +/* Prints the values in 'cmap', plus 'name' as a title. */ +static void OVS_UNUSED +print_cmap(const char *name, struct cmap *cmap) +{ + struct cmap_cursor cursor; + struct element *e; + + printf("%s:", name); + CMAP_CURSOR_FOR_EACH (e, node, &cursor, cmap) { + printf(" %d", e->value); + } + printf("\n"); +} + +/* Prints the 'n' values in 'values', plus 'name' as a title. */ +static void OVS_UNUSED +print_ints(const char *name, const int *values, size_t n) +{ + size_t i; + + printf("%s:", name); + for (i = 0; i < n; i++) { + printf(" %d", values[i]); + } + printf("\n"); +} + +static size_t +identity_hash(int value) +{ + return value; +} + +static size_t +good_hash(int value) +{ + return hash_int(value, 0x1234abcd); +} + +static size_t +constant_hash(int value OVS_UNUSED) +{ + return 123; +} + +/* Tests basic cmap insertion and deletion. */ +static void +test_cmap_insert_replace_delete(hash_func *hash) +{ + enum { N_ELEMS = 1000 }; + + struct element elements[N_ELEMS]; + struct element copies[N_ELEMS]; + int values[N_ELEMS]; + struct cmap cmap; + size_t i; + + cmap_init(&cmap); + for (i = 0; i < N_ELEMS; i++) { + elements[i].value = i; + cmap_insert(&cmap, &elements[i].node, hash(i)); + values[i] = i; + check_cmap(&cmap, values, i + 1, hash); + } + shuffle(values, N_ELEMS); + for (i = 0; i < N_ELEMS; i++) { + copies[values[i]].value = values[i]; + cmap_replace(&cmap, &elements[values[i]].node, + &copies[values[i]].node, hash(values[i])); + check_cmap(&cmap, values, N_ELEMS, hash); + } + shuffle(values, N_ELEMS); + for (i = 0; i < N_ELEMS; i++) { + cmap_remove(&cmap, &copies[values[i]].node, hash(values[i])); + check_cmap(&cmap, values + (i + 1), N_ELEMS - (i + 1), hash); + } + cmap_destroy(&cmap); +} + +static void +run_test(void (*function)(hash_func *)) +{ + hash_func *hash_funcs[] = { identity_hash, good_hash, constant_hash }; + size_t i; + + for (i = 0; i < ARRAY_SIZE(hash_funcs); i++) { + function(hash_funcs[i]); + printf("."); + fflush(stdout); + } +} + +static void +run_tests(struct ovs_cmdl_context *ctx) +{ + int n; + int i; + + n = ctx->argc >= 2 ? atoi(ctx->argv[1]) : 100; + for (i = 0; i < n; i++) { + run_test(test_cmap_insert_replace_delete); + } + printf("\n"); +} + +static int n_elems; /* Number of elements to insert. */ +static int n_threads; /* Number of threads to search and mutate. */ +static uint32_t mutation_frac; /* % mutations, as fraction of UINT32_MAX. */ +static int n_batch; /* Number of elements in each batch. */ + +#define N_BATCH_MAX BITMAP_ULONG_BITS + +static void benchmark_cmap(void); +static void benchmark_cmap_batched(void); +static void benchmark_hmap(void); + +static int +elapsed(const struct timeval *start) +{ + struct timeval end; + + xgettimeofday(&end); + return timeval_to_msec(&end) - timeval_to_msec(start); +} + +static void +run_benchmarks(struct ovs_cmdl_context *ctx) +{ + n_elems = strtol(ctx->argv[1], NULL, 10); + n_threads = strtol(ctx->argv[2], NULL, 10); + mutation_frac = strtod(ctx->argv[3], NULL) / 100.0 * UINT32_MAX; + n_batch = ctx->argc > 4 ? strtol(ctx->argv[4], NULL, 10) : 1; + + if (n_batch > N_BATCH_MAX) { + n_batch = N_BATCH_MAX; + } + printf("Benchmarking with n=%d, %d threads, %.2f%% mutations, batch size %d:\n", + n_elems, n_threads, (double) mutation_frac / UINT32_MAX * 100., + n_batch); + + if (n_batch > 0) { + benchmark_cmap_batched(); + } + putchar('\n'); + benchmark_cmap(); + putchar('\n'); + benchmark_hmap(); +} + +/* cmap benchmark. */ + +static struct element * +find(const struct cmap *cmap, int value) +{ + struct element *e; + + CMAP_FOR_EACH_WITH_HASH (e, node, hash_int(value, 0), cmap) { + if (e->value == value) { + return e; + } + } + return NULL; +} + +struct cmap_aux { + struct ovs_mutex mutex; + struct cmap *cmap; +}; + +static void * +search_cmap(void *aux_) +{ + struct cmap_aux *aux = aux_; + size_t i; + + if (mutation_frac) { + for (i = 0; i < n_elems; i++) { + struct element *e; + + if (random_uint32() < mutation_frac) { + ovs_mutex_lock(&aux->mutex); + e = find(aux->cmap, i); + if (e) { + cmap_remove(aux->cmap, &e->node, hash_int(e->value, 0)); + } + ovs_mutex_unlock(&aux->mutex); + } else { + ignore(find(aux->cmap, i)); + } + } + } else { + for (i = 0; i < n_elems; i++) { + ignore(find(aux->cmap, i)); + } + } + return NULL; +} + +static void +benchmark_cmap(void) +{ + struct element *elements; + struct cmap cmap; + struct element *e; + struct timeval start; + pthread_t *threads; + struct cmap_aux aux; + size_t i; + + elements = xmalloc(n_elems * sizeof *elements); + + /* Insertions. */ + xgettimeofday(&start); + cmap_init(&cmap); + for (i = 0; i < n_elems; i++) { + elements[i].value = i; + cmap_insert(&cmap, &elements[i].node, hash_int(i, 0)); + } + printf("cmap insert: %5d ms\n", elapsed(&start)); + + /* Iteration. */ + xgettimeofday(&start); + CMAP_FOR_EACH (e, node, &cmap) { + ignore(e); + } + printf("cmap iterate: %5d ms\n", elapsed(&start)); + + /* Search and mutation. */ + xgettimeofday(&start); + aux.cmap = &cmap; + ovs_mutex_init(&aux.mutex); + threads = xmalloc(n_threads * sizeof *threads); + for (i = 0; i < n_threads; i++) { + threads[i] = ovs_thread_create("search", search_cmap, &aux); + } + for (i = 0; i < n_threads; i++) { + xpthread_join(threads[i], NULL); + } + free(threads); + printf("cmap search: %5d ms\n", elapsed(&start)); + + /* Destruction. */ + xgettimeofday(&start); + CMAP_FOR_EACH (e, node, &cmap) { + cmap_remove(&cmap, &e->node, hash_int(e->value, 0)); + } + cmap_destroy(&cmap); + printf("cmap destroy: %5d ms\n", elapsed(&start)); + + free(elements); +} + +static size_t +find_batch(const struct cmap *cmap, const int value) +{ + size_t i, ret; + const size_t end = MIN(n_batch, n_elems - value); + unsigned long map = ~0; + uint32_t hashes[N_BATCH_MAX]; + const struct cmap_node *nodes[N_BATCH_MAX]; + + if (mutation_frac) { + for (i = 0; i < end; i++) { + if (random_uint32() < mutation_frac) { + break; + } + hashes[i] = hash_int(value + i, 0); + } + } else { + for (i = 0; i < end; i++) { + hashes[i] = hash_int(value + i, 0); + } + } + + ret = i; + + map >>= BITMAP_ULONG_BITS - i; /* Clear excess bits. */ + map = cmap_find_batch(cmap, map, hashes, nodes); + + ULONG_FOR_EACH_1(i, map) { + struct element *e; + + CMAP_NODE_FOR_EACH (e, node, nodes[i]) { + if (OVS_LIKELY(e->value == value + i)) { + ignore(e); /* Found result. */ + break; + } + } + } + return ret; +} + +static void * +search_cmap_batched(void *aux_) +{ + struct cmap_aux *aux = aux_; + size_t i = 0, j; + + for (;;) { + struct element *e; + + j = find_batch(aux->cmap, i); + i += j; + if (i >= n_elems) { + break; + } + if (j < n_batch) { + ovs_mutex_lock(&aux->mutex); + e = find(aux->cmap, i); + if (e) { + cmap_remove(aux->cmap, &e->node, hash_int(e->value, 0)); + } + ovs_mutex_unlock(&aux->mutex); + } + } + + return NULL; +} + +static void +benchmark_cmap_batched(void) +{ + struct element *elements; + struct cmap cmap; + struct element *e; + struct timeval start; + pthread_t *threads; + struct cmap_aux aux; + size_t i; + + elements = xmalloc(n_elems * sizeof *elements); + + /* Insertions. */ + xgettimeofday(&start); + cmap_init(&cmap); + for (i = 0; i < n_elems; i++) { + elements[i].value = i; + cmap_insert(&cmap, &elements[i].node, hash_int(i, 0)); + } + printf("cmap insert: %5d ms\n", elapsed(&start)); + + /* Iteration. */ + xgettimeofday(&start); + CMAP_FOR_EACH (e, node, &cmap) { + ignore(e); + } + printf("cmap iterate: %5d ms\n", elapsed(&start)); + + /* Search and mutation. */ + xgettimeofday(&start); + aux.cmap = &cmap; + ovs_mutex_init(&aux.mutex); + threads = xmalloc(n_threads * sizeof *threads); + for (i = 0; i < n_threads; i++) { + threads[i] = ovs_thread_create("search", search_cmap_batched, &aux); + } + for (i = 0; i < n_threads; i++) { + xpthread_join(threads[i], NULL); + } + free(threads); + printf("batch search: %5d ms\n", elapsed(&start)); + + /* Destruction. */ + xgettimeofday(&start); + CMAP_FOR_EACH (e, node, &cmap) { + cmap_remove(&cmap, &e->node, hash_int(e->value, 0)); + } + cmap_destroy(&cmap); + printf("cmap destroy: %5d ms\n", elapsed(&start)); + + free(elements); +} + +/* hmap benchmark. */ +struct helement { + int value; + struct hmap_node node; +}; + +static struct helement * +hfind(const struct hmap *hmap, int value) +{ + struct helement *e; + + HMAP_FOR_EACH_WITH_HASH (e, node, hash_int(value, 0), hmap) { + if (e->value == value) { + return e; + } + } + return NULL; +} + +struct hmap_aux { + struct hmap *hmap; + struct fat_rwlock fatlock; +}; + +static void * +search_hmap(void *aux_) +{ + struct hmap_aux *aux = aux_; + size_t i; + + if (mutation_frac) { + for (i = 0; i < n_elems; i++) { + if (random_uint32() < mutation_frac) { + struct helement *e; + + fat_rwlock_wrlock(&aux->fatlock); + e = hfind(aux->hmap, i); + if (e) { + hmap_remove(aux->hmap, &e->node); + } + fat_rwlock_unlock(&aux->fatlock); + } else { + fat_rwlock_rdlock(&aux->fatlock); + ignore(hfind(aux->hmap, i)); + fat_rwlock_unlock(&aux->fatlock); + } + } + } else { + for (i = 0; i < n_elems; i++) { + ignore(hfind(aux->hmap, i)); + } + } + return NULL; +} + +static void +benchmark_hmap(void) +{ + struct helement *elements; + struct hmap hmap; + struct helement *e, *next; + struct timeval start; + pthread_t *threads; + struct hmap_aux aux; + size_t i; + + elements = xmalloc(n_elems * sizeof *elements); + + xgettimeofday(&start); + hmap_init(&hmap); + for (i = 0; i < n_elems; i++) { + elements[i].value = i; + hmap_insert(&hmap, &elements[i].node, hash_int(i, 0)); + } + + printf("hmap insert: %5d ms\n", elapsed(&start)); + + xgettimeofday(&start); + HMAP_FOR_EACH (e, node, &hmap) { + ignore(e); + } + printf("hmap iterate: %5d ms\n", elapsed(&start)); + + xgettimeofday(&start); + aux.hmap = &hmap; + fat_rwlock_init(&aux.fatlock); + threads = xmalloc(n_threads * sizeof *threads); + for (i = 0; i < n_threads; i++) { + threads[i] = ovs_thread_create("search", search_hmap, &aux); + } + for (i = 0; i < n_threads; i++) { + xpthread_join(threads[i], NULL); + } + free(threads); + printf("hmap search: %5d ms\n", elapsed(&start)); + + /* Destruction. */ + xgettimeofday(&start); + HMAP_FOR_EACH_SAFE (e, next, node, &hmap) { + hmap_remove(&hmap, &e->node); + } + hmap_destroy(&hmap); + printf("hmap destroy: %5d ms\n", elapsed(&start)); + + free(elements); +} + +static const struct ovs_cmdl_command commands[] = { + {"check", NULL, 0, 1, run_tests}, + {"benchmark", NULL, 3, 4, run_benchmarks}, + {NULL, NULL, 0, 0, NULL}, +}; + +static void +test_cmap_main(int argc, char *argv[]) +{ + struct ovs_cmdl_context ctx = { + .argc = argc - optind, + .argv = argv + optind, + }; + + set_program_name(argv[0]); + ovs_cmdl_run_command(&ctx, commands); +} + +OVSTEST_REGISTER("test-cmap", test_cmap_main); diff -Nru openvswitch-2.3.1/tests/test-controller.8.in openvswitch-2.4.0~git20150623/tests/test-controller.8.in --- openvswitch-2.3.1/tests/test-controller.8.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-controller.8.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ - .\" -*- nroff -*- -.de IQ -. br -. ns -. IP "\\$1" -.. -.TH test\-controller 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual" -.ds PN test\-controller -. -.SH NAME -test\-controller \- simple OpenFlow controller for testing -. -.SH SYNOPSIS -.B test\-controller -[\fIoptions\fR] \fImethod\fR \fB[\fImethod\fR]\&... -. -.SH DESCRIPTION -.PP -\fBtest\-controller\fR is a simple OpenFlow controller. It is very -easy to set up, so it may be suitable for initial testing of -connectivity between an OpenFlow switch and a controller. It may also -be useful for developer testing and debugging of some Open vSwitch -features. -.PP -\fBtest\-controller\fR is not a general-purpose OpenFlow controller. -It does not make sense to deploy it routinely or in production. -\fBtest\-controller\fR does not provide any features that are not -built into Open vSwitch, and lacks many that are built in to Open -vSwitch, so adding it to an Open vSwitch deployment actually reduces -functionality and performance while increasing latency. -.PP -\fBtest\-controller\fR manages any number of remote switches over -OpenFlow protocol, causing them to function as L2 MAC-learning -switches or hub. The switches it controls are specified as one or -more of the following OpenFlow connection methods: -. -.RS -.so lib/vconn-passive.man -.so lib/vconn-active.man -.RE -. -.SH OPTIONS -.IP "\fB\-n\fR" -.IQ "\fB\-\-noflow\fR" -By default, \fBtest\-controller\fR sets up a flow in each OpenFlow switch -whenever it receives a packet whose destination is known due through -MAC learning. This option disables flow setup, so that every packet -in the network passes through the controller. -.IP -This option is most useful for debugging. It reduces switching -performance, so it should not be used in production. -. -.TP -\fB\-\-max\-idle=\fIsecs\fR|\fBpermanent\fR -Sets \fIsecs\fR as the number of seconds that a flow set up by the -controller will remain in the switch's flow table without any matching -packets being seen. If \fBpermanent\fR is specified, which is not -recommended, flows will never expire. The default is 60 seconds. -.IP -This option has no effect when \fB\-n\fR (or \fB\-\-noflow\fR) is in use -(because the controller does not set up flows in that case). -. -.IP "\fB\-H\fR" -.IQ "\fB\-\-hub\fR" -By default, the controller acts as an L2 MAC-learning switch. This -option changes its behavior to that of a hub that floods packets on -all but the incoming port. -.IP -If \fB\-H\fR (or \fB\-\-hub\fR) and \fB\-n\fR (or \fB\-\-noflow\fR) are used -together, then the cumulative effect is that every packet passes -through the controller and every packet is flooded. -.IP -This option is most useful for debugging. It reduces switching -performance, so it should not be used in production. -. -.IP "\fB\-w\fR[\fIwildcard_mask\fR]" -.IQ "\fB\-\-wildcards\fR[\fB=\fIwildcard_mask\fR]\fR" -By default, \fBtest\-controller\fR sets up exact-match flows. This -option allows it to set up wildcarded flows, which may reduce -flow setup latency by causing less traffic to be sent up to the -controller. -.IP -The optional \fIwildcard_mask\fR is an OpenFlow wildcard bitmask in -hexadecimal that specifies the fields to wildcard. If no -\fIwildcard_mask\fR is specified, the default value 0x2820F0 is used -which specifies L2-only switching and wildcards L3 and L4 fields. -Another interesting value is 0x2000EC, which specifies L3-only -switching and wildcards L2 and L4 fields. -.IP -This option has no effect when \fB\-n\fR (or \fB\-\-noflow\fR) is in use -(because the controller does not set up flows in that case). -. -.IP "\fB\-N\fR" -.IQ "\fB\-\-normal\fR" -By default, \fBtest\-controller\fR directs packets to a particular port -or floods them. This option causes it to direct non-flooded packets -to the OpenFlow \fBOFPP_NORMAL\fR port. This allows the switch itself -to make decisions about packet destinations. Support for -\fBOFPP_NORMAL\fR is optional in OpenFlow, so this option may not well -with some non-Open vSwitch switches. -. -.IP "\fB\-\-mute\fR" -Prevents test\-controller from replying to any OpenFlow messages sent -to it by switches. -.IP -This option is only for debugging the Open vSwitch implementation of -``fail open'' mode. It must not be used in production. -. -.IP "\fB\-q \fIid\fR" -.IQ "\fB\-\-queue=\fIid\fR" -By default, \fBtest\-controller\fR uses the default OpenFlow queue for -sending packets and setting up flows. Use one of these options, -supplying \fIid\fR as an OpenFlow queue ID as a decimal number, to -instead use that specific queue. -.IP -This option is incompatible with \fB\-N\fR or \fB\-\-normal\fR and -with \fB\-H\fR or \fB\-\-hub\fR. If more than one is specified then -this option takes precedence. -.IP -This option may be useful for testing or debugging quality of service -setups. -. -.IP "\fB\-Q \fIport-name\fB:\fIqueue-id\fR" -.IP "\fB\-\-port\-queue \fIport-name\fB:\fIqueue-id\fR" -Configures packets received on the port named \fIport-name\fR -(e.g. \fBeth0\fR) to be output on OpenFlow queue ID \fIqueue-id\fR -(specified as a decimal number). For the specified port, this option -overrides the default specified on \fB\-q\fR or \fB\-\-queue\fR. -.IP -This option may be specified any number of times with different -\fIport-name\fR arguments. -.IP -This option is incompatible with \fB\-N\fR or \fB\-\-normal\fR and -with \fB\-H\fR or \fB\-\-hub\fR. If more than one is specified then -this option takes precedence. -.IP -This option may be useful for testing or debugging quality of service -setups. -. -.IP "\fB\-\-with\-flows \fIfile\fR" -When a switch connects, push the flow entries as described in -\fIfile\fR. Each line in \fIfile\fR is a flow entry in the format -described for the \fBadd\-flows\fR command in the \fBFlow Syntax\fR -section of the \fBovs\-ofctl\fR(8) man page. -.IP -Use this option more than once to add flows from multiple files. -. -.SS "Public Key Infrastructure Options" -.so lib/ssl.man -.so lib/ssl-peer-ca-cert.man -.ds DD -.so lib/daemon.man -.so lib/vlog.man -.so lib/unixctl.man -.so lib/common.man -.so so lib/ofp-version.man -. -.SH EXAMPLES -.PP -To bind locally to port 6633 (the default) and wait for incoming -connections from OpenFlow switches: -.IP -\fB% test\-controller ptcp:\fR -.PP -In the future, the default port number will change to 6653, which is the -IANA-defined value. -.SH "BUGS" -.PP -Configuring a Citrix XenServer to connect to a particular controller -only points the remote OVSDB management connection to that controller. -It does not also configure OpenFlow connections, because the manager -is expected to do that over the management protocol. -\fBtest\-controller\fR is not an Open vSwitch manager and does not know -how to do that. -.PP -As a stopgap workaround, \fBovs\-vsctl\fR can wait for an OVSDB -connection and set the controller, e.g.: -.IP -\fB% ovs\-vsctl \-t0 \-\-db=pssl: \-\-certificate=cert.pem -\-\-ca\-cert=none \-\-private\-key=privkey.pem -\-\-peer\-ca\-cert=cacert.pem set\-controller ssl:\fIip\fR -.SH "SEE ALSO" -. -.BR ovs\-appctl (8), -.BR ovs\-ofctl (8), -.BR ovs\-dpctl (8) diff -Nru openvswitch-2.3.1/tests/test-controller.c openvswitch-2.4.0~git20150623/tests/test-controller.c --- openvswitch-2.3.1/tests/test-controller.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-controller.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "command-line.h" -#include "compiler.h" -#include "daemon.h" -#include "fatal-signal.h" -#include "learning-switch.h" -#include "ofp-parse.h" -#include "ofp-version-opt.h" -#include "ofpbuf.h" -#include "openflow/openflow.h" -#include "poll-loop.h" -#include "rconn.h" -#include "simap.h" -#include "stream-ssl.h" -#include "timeval.h" -#include "unixctl.h" -#include "util.h" -#include "vconn.h" -#include "vlog.h" -#include "socket-util.h" -#include "ofp-util.h" - -VLOG_DEFINE_THIS_MODULE(controller); - -#define MAX_SWITCHES 16 -#define MAX_LISTENERS 16 - -struct switch_ { - struct lswitch *lswitch; -}; - -/* -H, --hub: Learn the ports on which MAC addresses appear? */ -static bool learn_macs = true; - -/* -n, --noflow: Set up flows? (If not, every packet is processed at the - * controller.) */ -static bool set_up_flows = true; - -/* -N, --normal: Use "NORMAL" action instead of explicit port? */ -static bool action_normal = false; - -/* -w, --wildcard: 0 to disable wildcard flow entries, an OFPFW10_* bitmask to - * enable specific wildcards, or UINT32_MAX to use the default wildcards. */ -static uint32_t wildcards = 0; - -/* --max-idle: Maximum idle time, in seconds, before flows expire. */ -static int max_idle = 60; - -/* --mute: If true, accept connections from switches but do not reply to any - * of their messages (for debugging fail-open mode). */ -static bool mute = false; - -/* -q, --queue: default OpenFlow queue, none if UINT32_MAX. */ -static uint32_t default_queue = UINT32_MAX; - -/* -Q, --port-queue: map from port name to port number. */ -static struct simap port_queues = SIMAP_INITIALIZER(&port_queues); - -/* --with-flows: Flows to send to switch. */ -static struct ofputil_flow_mod *default_flows; -static size_t n_default_flows; -static enum ofputil_protocol usable_protocols; - -/* --unixctl: Name of unixctl socket, or null to use the default. */ -static char *unixctl_path = NULL; - -static void new_switch(struct switch_ *, struct vconn *); -static void parse_options(int argc, char *argv[]); -static void usage(void) NO_RETURN; - -int -main(int argc, char *argv[]) -{ - struct unixctl_server *unixctl; - struct switch_ switches[MAX_SWITCHES]; - struct pvconn *listeners[MAX_LISTENERS]; - int n_switches, n_listeners; - int retval; - int i; - - proctitle_init(argc, argv); - set_program_name(argv[0]); - parse_options(argc, argv); - fatal_ignore_sigpipe(); - - if (argc - optind < 1) { - ovs_fatal(0, "at least one vconn argument required; " - "use --help for usage"); - } - - n_switches = n_listeners = 0; - for (i = optind; i < argc; i++) { - const char *name = argv[i]; - struct vconn *vconn; - - retval = vconn_open(name, get_allowed_ofp_versions(), DSCP_DEFAULT, - &vconn); - if (!retval) { - if (n_switches >= MAX_SWITCHES) { - ovs_fatal(0, "max %d switch connections", n_switches); - } - new_switch(&switches[n_switches++], vconn); - continue; - } else if (retval == EAFNOSUPPORT) { - struct pvconn *pvconn; - retval = pvconn_open(name, get_allowed_ofp_versions(), - DSCP_DEFAULT, &pvconn); - if (!retval) { - if (n_listeners >= MAX_LISTENERS) { - ovs_fatal(0, "max %d passive connections", n_listeners); - } - listeners[n_listeners++] = pvconn; - } - } - if (retval) { - VLOG_ERR("%s: connect: %s", name, ovs_strerror(retval)); - } - } - if (n_switches == 0 && n_listeners == 0) { - ovs_fatal(0, "no active or passive switch connections"); - } - - daemonize_start(); - - retval = unixctl_server_create(unixctl_path, &unixctl); - if (retval) { - exit(EXIT_FAILURE); - } - - daemonize_complete(); - - while (n_switches > 0 || n_listeners > 0) { - /* Accept connections on listening vconns. */ - for (i = 0; i < n_listeners && n_switches < MAX_SWITCHES; ) { - struct vconn *new_vconn; - - retval = pvconn_accept(listeners[i], &new_vconn); - if (!retval || retval == EAGAIN) { - if (!retval) { - new_switch(&switches[n_switches++], new_vconn); - } - i++; - } else { - pvconn_close(listeners[i]); - listeners[i] = listeners[--n_listeners]; - } - } - - /* Do some switching work. . */ - for (i = 0; i < n_switches; ) { - struct switch_ *this = &switches[i]; - lswitch_run(this->lswitch); - if (lswitch_is_alive(this->lswitch)) { - i++; - } else { - lswitch_destroy(this->lswitch); - switches[i] = switches[--n_switches]; - } - } - - unixctl_server_run(unixctl); - - /* Wait for something to happen. */ - if (n_switches < MAX_SWITCHES) { - for (i = 0; i < n_listeners; i++) { - pvconn_wait(listeners[i]); - } - } - for (i = 0; i < n_switches; i++) { - struct switch_ *sw = &switches[i]; - lswitch_wait(sw->lswitch); - } - unixctl_server_wait(unixctl); - poll_block(); - } - - return 0; -} - -static void -new_switch(struct switch_ *sw, struct vconn *vconn) -{ - struct lswitch_config cfg; - struct rconn *rconn; - - rconn = rconn_create(60, 0, DSCP_DEFAULT, get_allowed_ofp_versions()); - rconn_connect_unreliably(rconn, vconn, NULL); - - cfg.mode = (action_normal ? LSW_NORMAL - : learn_macs ? LSW_LEARN - : LSW_FLOOD); - cfg.wildcards = wildcards; - cfg.max_idle = set_up_flows ? max_idle : -1; - cfg.default_flows = default_flows; - cfg.n_default_flows = n_default_flows; - cfg.usable_protocols = usable_protocols; - cfg.default_queue = default_queue; - cfg.port_queues = &port_queues; - cfg.mute = mute; - sw->lswitch = lswitch_create(rconn, &cfg); -} - -static void -add_port_queue(char *s) -{ - char *save_ptr = NULL; - char *port_name; - char *queue_id; - - port_name = strtok_r(s, ":", &save_ptr); - queue_id = strtok_r(NULL, "", &save_ptr); - if (!queue_id) { - ovs_fatal(0, "argument to -Q or --port-queue should take the form " - "\":\""); - } - - if (!simap_put(&port_queues, port_name, atoi(queue_id))) { - ovs_fatal(0, " arguments for -Q or --port-queue must " - "be unique"); - } -} - -static void -parse_options(int argc, char *argv[]) -{ - enum { - OPT_MAX_IDLE = UCHAR_MAX + 1, - OPT_PEER_CA_CERT, - OPT_MUTE, - OPT_WITH_FLOWS, - OPT_UNIXCTL, - VLOG_OPTION_ENUMS, - DAEMON_OPTION_ENUMS, - OFP_VERSION_OPTION_ENUMS - }; - static const struct option long_options[] = { - {"hub", no_argument, NULL, 'H'}, - {"noflow", no_argument, NULL, 'n'}, - {"normal", no_argument, NULL, 'N'}, - {"wildcards", optional_argument, NULL, 'w'}, - {"max-idle", required_argument, NULL, OPT_MAX_IDLE}, - {"mute", no_argument, NULL, OPT_MUTE}, - {"queue", required_argument, NULL, 'q'}, - {"port-queue", required_argument, NULL, 'Q'}, - {"with-flows", required_argument, NULL, OPT_WITH_FLOWS}, - {"unixctl", required_argument, NULL, OPT_UNIXCTL}, - {"help", no_argument, NULL, 'h'}, - DAEMON_LONG_OPTIONS, - OFP_VERSION_LONG_OPTIONS, - VLOG_LONG_OPTIONS, - STREAM_SSL_LONG_OPTIONS, - {"peer-ca-cert", required_argument, NULL, OPT_PEER_CA_CERT}, - {NULL, 0, NULL, 0}, - }; - char *short_options = long_options_to_short_options(long_options); - - for (;;) { - int indexptr; - char *error; - int c; - - c = getopt_long(argc, argv, short_options, long_options, &indexptr); - if (c == -1) { - break; - } - - switch (c) { - case 'H': - learn_macs = false; - break; - - case 'n': - set_up_flows = false; - break; - - case OPT_MUTE: - mute = true; - break; - - case 'N': - action_normal = true; - break; - - case 'w': - wildcards = optarg ? strtol(optarg, NULL, 16) : UINT32_MAX; - break; - - case OPT_MAX_IDLE: - if (!strcmp(optarg, "permanent")) { - max_idle = OFP_FLOW_PERMANENT; - } else { - max_idle = atoi(optarg); - if (max_idle < 1 || max_idle > 65535) { - ovs_fatal(0, "--max-idle argument must be between 1 and " - "65535 or the word 'permanent'"); - } - } - break; - - case 'q': - default_queue = atoi(optarg); - break; - - case 'Q': - add_port_queue(optarg); - break; - - case OPT_WITH_FLOWS: - error = parse_ofp_flow_mod_file(optarg, OFPFC_ADD, &default_flows, - &n_default_flows, - &usable_protocols); - if (error) { - ovs_fatal(0, "%s", error); - } - break; - - case OPT_UNIXCTL: - unixctl_path = optarg; - break; - - case 'h': - usage(); - - VLOG_OPTION_HANDLERS - OFP_VERSION_OPTION_HANDLERS - DAEMON_OPTION_HANDLERS - - STREAM_SSL_OPTION_HANDLERS - - case OPT_PEER_CA_CERT: - stream_ssl_set_peer_ca_cert_file(optarg); - break; - - case '?': - exit(EXIT_FAILURE); - - default: - abort(); - } - } - free(short_options); - - if (!simap_is_empty(&port_queues) || default_queue != UINT32_MAX) { - if (action_normal) { - ovs_error(0, "queue IDs are incompatible with -N or --normal; " - "not using OFPP_NORMAL"); - action_normal = false; - } - - if (!learn_macs) { - ovs_error(0, "queue IDs are incompatible with -H or --hub; " - "not acting as hub"); - learn_macs = true; - } - } -} - -static void -usage(void) -{ - printf("%s: OpenFlow controller\n" - "usage: %s [OPTIONS] METHOD\n" - "where METHOD is any OpenFlow connection method.\n", - program_name, program_name); - vconn_usage(true, true, false); - daemon_usage(); - ofp_version_usage(); - vlog_usage(); - printf("\nOther options:\n" - " -H, --hub act as hub instead of learning switch\n" - " -n, --noflow pass traffic, but don't add flows\n" - " --max-idle=SECS max idle time for new flows\n" - " -N, --normal use OFPP_NORMAL action\n" - " -w, --wildcards[=MASK] wildcard (specified) bits in flows\n" - " -q, --queue=QUEUE-ID OpenFlow queue ID to use for output\n" - " -Q PORT-NAME:QUEUE-ID use QUEUE-ID for frames from PORT-NAME\n" - " --with-flows FILE use the flows from FILE\n" - " --unixctl=SOCKET override default control socket name\n" - " -h, --help display this help message\n" - " -V, --version display version information\n"); - exit(EXIT_SUCCESS); -} diff -Nru openvswitch-2.3.1/tests/test-csum.c openvswitch-2.4.0~git20150623/tests/test-csum.c --- openvswitch-2.3.1/tests/test-csum.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-csum.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,20 +15,21 @@ */ #include +#undef NDEBUG #include "csum.h" -#include "crc32c.h" +#include #include #include +#include #include #include #include +#include "crc32c.h" +#include "ovstest.h" +#include "packets.h" #include "random.h" #include "unaligned.h" #include "util.h" -#include "ovstest.h" - -#undef NDEBUG -#include struct test_case { char *data; @@ -176,6 +177,37 @@ mark('#'); } +/* Check the IP pseudoheader calculation. */ +static void +test_pseudo(void) +{ + ovs_be16 csum; + /* Try an IP header similar to one that the tunnel code + * might generate. */ + struct ip_header ip = { + .ip_ihl_ver = IP_IHL_VER(5, 4), + .ip_tos = 0, + .ip_tot_len = htons(134), + .ip_id = 0, + .ip_frag_off = htons(IP_DF), + .ip_ttl = 64, + .ip_proto = IPPROTO_UDP, + .ip_csum = htons(0x1265), + .ip_src = { .hi = htons(0x1400), .lo = htons(0x0002) }, + .ip_dst = { .hi = htons(0x1400), .lo = htons(0x0001) } + }; + + csum = csum_finish(packet_csum_pseudoheader(&ip)); + assert(csum == htons(0xd779)); + + /* And also test something totally different to check for + * corner cases. */ + memset(&ip, 0xff, sizeof ip); + csum = csum_finish(packet_csum_pseudoheader(&ip)); + assert(csum == htons(0xff3c)); + + mark('#'); +} static void test_csum_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) @@ -240,6 +272,7 @@ test_rfc1624(); test_crc32c(); + test_pseudo(); /* Test recalc_csum16(). */ for (i = 0; i < 32; i++) { diff -Nru openvswitch-2.3.1/tests/test-file_name.c openvswitch-2.4.0~git20150623/tests/test-file_name.c --- openvswitch-2.3.1/tests/test-file_name.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-file_name.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2009, 2010, 2014 Nicira, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "util.h" -#include -#include "ovstest.h" - -static void -test_filename_main(int argc, char *argv[]) -{ - int i; - - for (i = 1; i < argc; i++) { - char *dir, *base; - - dir = dir_name(argv[i]); - puts(dir); - free(dir); - - base = base_name(argv[i]); - puts(base); - free(base); - } -} - -OVSTEST_REGISTER("test-file_name", test_filename_main); diff -Nru openvswitch-2.3.1/tests/test-flows.c openvswitch-2.4.0~git20150623/tests/test-flows.c --- openvswitch-2.3.1/tests/test-flows.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-flows.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,23 +15,23 @@ */ #include +#undef NDEBUG #include "flow.h" +#include #include #include #include #include "classifier.h" -#include "openflow/openflow.h" -#include "timeval.h" #include "ofpbuf.h" #include "ofp-print.h" #include "ofp-util.h" +#include "openflow/openflow.h" +#include "ovstest.h" +#include "dp-packet.h" #include "pcap-file.h" +#include "timeval.h" #include "util.h" -#include "vlog.h" -#include "ovstest.h" - -#undef NDEBUG -#include +#include "openvswitch/vlog.h" static void test_flows_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) @@ -43,10 +43,13 @@ set_program_name(argv[0]); - flows = stdin; - pcap = fdopen(3, "rb"); + flows = fopen(argv[1], "rb"); + if (!flows) { + ovs_fatal(errno, "failed to open %s", argv[1]); + } + pcap = fopen(argv[2], "rb"); if (!pcap) { - ovs_fatal(errno, "failed to open fd 3 for reading"); + ovs_fatal(errno, "failed to open %s", argv[2]); } retval = ovs_pcap_read_header(pcap); @@ -55,7 +58,7 @@ } while (fread(&expected_match, sizeof expected_match, 1, flows)) { - struct ofpbuf *packet; + struct dp_packet *packet; struct ofp10_match extracted_match; struct match match; struct flow flow; @@ -68,7 +71,7 @@ ovs_fatal(retval, "error reading pcap file"); } - flow_extract(packet, NULL, &flow); + flow_extract(packet, &flow); flow.in_port.ofp_port = u16_to_ofp(1); match_wc_init(&match, &flow); @@ -80,8 +83,8 @@ errors++; printf("mismatch on packet #%d (1-based).\n", n); printf("Packet:\n"); - ofp_print_packet(stdout, ofpbuf_data(packet), ofpbuf_size(packet)); - ovs_hex_dump(stdout, ofpbuf_data(packet), ofpbuf_size(packet), 0, true); + ofp_print_packet(stdout, dp_packet_data(packet), dp_packet_size(packet)); + ovs_hex_dump(stdout, dp_packet_data(packet), dp_packet_size(packet), 0, true); match_print(&match); printf("Expected flow:\n%s\n", exp_s); printf("Actually extracted flow:\n%s\n", got_s); @@ -92,7 +95,7 @@ free(got_s); } - ofpbuf_delete(packet); + dp_packet_delete(packet); } printf("checked %d packets, %d errors\n", n, errors); exit(errors != 0); diff -Nru openvswitch-2.3.1/tests/test-hash.c openvswitch-2.4.0~git20150623/tests/test-hash.c --- openvswitch-2.3.1/tests/test-hash.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-hash.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, 2014 Nicira, Inc. + * Copyright (c) 2009, 2012, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,16 @@ */ #include +#undef NDEBUG +#include "hash.h" +#include #include #include #include #include -#include "hash.h" #include "jhash.h" #include "ovstest.h" -#undef NDEBUG -#include - static void set_bit(uint32_t array[3], int bit) { @@ -36,6 +35,30 @@ } } +/* When bit == n_bits, the function just 0 sets the 'values'. */ +static void +set_bit128(ovs_u128 *values, int bit, int n_bits) +{ + assert(bit >= 0 && bit <= 2048); + memset(values, 0, n_bits/8); + if (bit < n_bits) { + int b = bit % 128; + + if (b < 64) { + values[bit / 128].u64.lo = UINT64_C(1) << (b % 64); + } else { + values[bit / 128].u64.hi = UINT64_C(1) << (b % 64); + } + } +} + +static uint64_t +get_range128(ovs_u128 *value, int ofs, uint64_t mask) +{ + return ((ofs < 64 ? (value->u64.lo >> ofs) : 0) & mask) + | ((ofs <= 64 ? (value->u64.hi << (64 - ofs)) : (value->u64.hi >> (ofs - 64)) & mask)); +} + static uint32_t hash_words_cb(uint32_t input) { @@ -77,7 +100,6 @@ printf("%s(%08"PRIx32") = %08"PRIx32"\n", name, in2, out2); printf("%d bits of output starting at bit %d " "are both 0x%"PRIx32"\n", min_unique, ofs, bits1); - exit(1); } } } @@ -92,15 +114,22 @@ for (i = 0; i <= 96; i++) { for (j = i + 1; j <= 96; j++) { - uint32_t in1[3], in2[3]; - uint32_t out1, out2; + uint32_t in0[3], in1[3], in2[3]; + uint32_t out0,out1, out2; const int min_unique = 12; const uint32_t unique_mask = (UINT32_C(1) << min_unique) - 1; + set_bit(in0, i); set_bit(in1, i); set_bit(in2, j); + out0 = hash(in0, 3, 0); out1 = hash(in1, 3, 0); out2 = hash(in2, 3, 0); + + if (out0 != out1) { + printf("%s hash not the same for non-64 aligned data " + "%08"PRIx32" != %08"PRIx32"\n", name, out0, out1); + } if ((out1 & unique_mask) == (out2 & unique_mask)) { printf("%s has a partial collision:\n", name); printf("hash(1 << %d) == %08"PRIx32"\n", i, out1); @@ -113,61 +142,178 @@ } static void +check_hash_bytes128(void (*hash)(const void *, size_t, uint32_t, ovs_u128 *), + const char *name, const int min_unique) +{ + const uint64_t unique_mask = (UINT64_C(1) << min_unique) - 1; + const int n_bits = sizeof(ovs_u128) * 8; + int i, j; + + for (i = 0; i <= n_bits; i++) { + OVS_PACKED(struct offset_ovs_u128 { + uint32_t a; + ovs_u128 b; + }) in0_data; + ovs_u128 *in0, in1; + ovs_u128 out0, out1; + + in0 = &in0_data.b; + set_bit128(in0, i, n_bits); + set_bit128(&in1, i, n_bits); + hash(in0, sizeof(ovs_u128), 0, &out0); + hash(&in1, sizeof(ovs_u128), 0, &out1); + if (!ovs_u128_equals(&out0, &out1)) { + printf("%s hash not the same for non-64 aligned data " + "%016"PRIx64"%016"PRIx64" != %016"PRIx64"%016"PRIx64"\n", + name, out0.u64.lo, out0.u64.hi, out1.u64.lo, out1.u64.hi); + } + + for (j = i + 1; j <= n_bits; j++) { + ovs_u128 in2; + ovs_u128 out2; + int ofs; + + set_bit128(&in2, j, n_bits); + hash(&in2, sizeof(ovs_u128), 0, &out2); + for (ofs = 0; ofs < 128 - min_unique; ofs++) { + uint64_t bits1 = get_range128(&out1, ofs, unique_mask); + uint64_t bits2 = get_range128(&out2, ofs, unique_mask); + + if (bits1 == bits2) { + printf("%s has a partial collision:\n", name); + printf("hash(1 << %d) == %016"PRIx64"%016"PRIx64"\n", + i, out1.u64.hi, out1.u64.lo); + printf("hash(1 << %d) == %016"PRIx64"%016"PRIx64"\n", + j, out2.u64.hi, out2.u64.lo); + printf("%d bits of output starting at bit %d " + "are both 0x%016"PRIx64"\n", min_unique, ofs, bits1); + } + } + } + } +} + +static void +check_256byte_hash(void (*hash)(const void *, size_t, uint32_t, ovs_u128 *), + const char *name, const int min_unique) +{ + const uint64_t unique_mask = (UINT64_C(1) << min_unique) - 1; + const int n_bits = sizeof(ovs_u128) * 8 * 16; + int i, j; + + for (i = 0; i <= n_bits; i++) { + OVS_PACKED(struct offset_ovs_u128 { + uint32_t a; + ovs_u128 b[16]; + }) in0_data; + ovs_u128 *in0, in1[16]; + ovs_u128 out0, out1; + + in0 = in0_data.b; + set_bit128(in0, i, n_bits); + set_bit128(in1, i, n_bits); + hash(in0, sizeof(ovs_u128) * 16, 0, &out0); + hash(in1, sizeof(ovs_u128) * 16, 0, &out1); + if (!ovs_u128_equals(&out0, &out1)) { + printf("%s hash not the same for non-64 aligned data " + "%016"PRIx64"%016"PRIx64" != %016"PRIx64"%016"PRIx64"\n", + name, out0.u64.lo, out0.u64.hi, out1.u64.lo, out1.u64.hi); + } + + for (j = i + 1; j <= n_bits; j++) { + ovs_u128 in2[16]; + ovs_u128 out2; + + set_bit128(in2, j, n_bits); + hash(in2, sizeof(ovs_u128) * 16, 0, &out2); + if ((out1.u64.lo & unique_mask) == (out2.u64.lo & unique_mask)) { + printf("%s has a partial collision:\n", name); + printf("hash(1 << %4d) == %016"PRIx64"%016"PRIx64"\n", i, + out1.u64.hi, out1.u64.lo); + printf("hash(1 << %4d) == %016"PRIx64"%016"PRIx64"\n", j, + out2.u64.hi, out2.u64.lo); + printf("The low-order %d bits of output are both " + "0x%"PRIx64"\n", min_unique, out1.u64.lo & unique_mask); + } + } + } +} + +static void test_hash_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) { - /* Check that all hashes computed with hash_words with one 1-bit (or no - * 1-bits) set within a single 32-bit word have different values in all - * 11-bit consecutive runs. + /* + * The following tests check that all hashes computed with hash_function + * with one 1-bit (or no 1-bits) set within a X-bit word have different + * values in all N-bit consecutive comparisons. + * + * test_function(hash_function, test_name, N) * * Given a random distribution, the probability of at least one collision - * in any set of 11 bits is approximately + * in any set of N bits is approximately * - * 1 - ((2**11 - 1)/2**11)**C(33,2) - * == 1 - (2047/2048)**528 - * =~ 0.22 + * 1 - (prob of no collisions) + * **(combination of all possible comparisons) + * == 1 - ((2**N - 1)/2**N)**C(X+1,2) + * == p * - * There are 21 ways to pick 11 consecutive bits in a 32-bit word, so if we + * There are (X-N) ways to pick N consecutive bits in a X-bit word, so if we * assumed independence then the chance of having no collisions in any of - * those 11-bit runs would be (1-0.22)**21 =~ .0044. Obviously - * independence must be a bad assumption :-) + * those X-bit runs would be (1-p)**(X-N) == q. If this q is very small + * and we can also find a relatively small 'magic number' N such that there + * is no collision in any comparison, then it means we have a pretty good + * hash function. + * + * The values of each parameters mentioned above for the tested hash + * functions are summarized as follow: + * + * hash_function X N p q + * ------------- --- --- ------- ------- + * + * hash_words_cb 32 11 0.22 0.0044 + * jhash_words_cb 32 11 0.22 0.0044 + * hash_int_cb 32 12 0.12 0.0078 + * hash_bytes128 128 19 0.0156 0.174 + * */ check_word_hash(hash_words_cb, "hash_words", 11); check_word_hash(jhash_words_cb, "jhash_words", 11); + check_word_hash(hash_int_cb, "hash_int", 12); + check_hash_bytes128(hash_bytes128, "hash_bytes128", 19); - /* Check that all hash functions of with one 1-bit (or no 1-bits) set - * within three 32-bit words have different values in their lowest 12 - * bits. + /* + * The following tests check that all hashes computed with hash_function + * with one 1-bit (or no 1-bits) set within Y X-bit word have different + * values in their lowest N bits. + * + * test_function(hash_function, test_name, N) * * Given a random distribution, the probability of at least one collision - * in 12 bits is approximately + * in any set of N bits is approximately * - * 1 - ((2**12 - 1)/2**12)**C(97,2) - * == 1 - (4095/4096)**4656 - * =~ 0.68 + * 1 - (prob of no collisions) + * **(combination of all possible comparisons) + * == 1 - ((2**N - 1)/2**N)**C(Y*X+1,2) + * == p * - * so we are doing pretty well to not have any collisions in 12 bits. - */ - check_3word_hash(hash_words, "hash_words"); - check_3word_hash(jhash_words, "jhash_words"); - - /* Check that all hashes computed with hash_int with one 1-bit (or no - * 1-bits) set within a single 32-bit word have different values in all - * 12-bit consecutive runs. + * If this p is not very small and we can also find a relatively small + * 'magic number' N such that there is no collision in any comparison, + * then it means we have a pretty good hash function. * - * Given a random distribution, the probability of at least one collision - * in any set of 12 bits is approximately + * The values of each parameters mentioned above for the tested hash + * functions are summarized as follow: * - * 1 - ((2**12 - 1)/2**12)**C(33,2) - * == 1 - (4,095/4,096)**528 - * =~ 0.12 + * hash_function Y X N p + * ------------- --- --- --- ------- + * + * hash_words 3 32 12 0.68 + * jhash_words 3 32 12 0.68 + * hash_bytes128 16 128 23 0.22 * - * There are 20 ways to pick 12 consecutive bits in a 32-bit word, so if we - * assumed independence then the chance of having no collisions in any of - * those 12-bit runs would be (1-0.12)**20 =~ 0.078. This refutes our - * assumption of independence, which makes it seem like a good hash - * function. */ - check_word_hash(hash_int_cb, "hash_int", 12); + check_3word_hash(hash_words, "hash_words"); + check_3word_hash(jhash_words, "jhash_words"); + check_256byte_hash(hash_bytes128, "hash_bytes128", 23); } OVSTEST_REGISTER("test-hash", test_hash_main); diff -Nru openvswitch-2.3.1/tests/test-heap.c openvswitch-2.4.0~git20150623/tests/test-heap.c --- openvswitch-2.3.1/tests/test-heap.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-heap.c 2015-06-23 18:46:21.000000000 +0000 @@ -17,17 +17,16 @@ /* A test for for functions and macros declared in heap.h. */ #include +#undef NDEBUG #include "heap.h" +#include #include #include #include #include "command-line.h" +#include "ovstest.h" #include "random.h" #include "util.h" -#include "ovstest.h" - -#undef NDEBUG -#include /* Sample heap element. */ struct element { @@ -274,8 +273,7 @@ } static void -test_heap_insert_delete_same_order(int argc OVS_UNUSED, - char *argv[] OVS_UNUSED) +test_heap_insert_delete_same_order(struct ovs_cmdl_context *ctx OVS_UNUSED) { enum { N_ELEMS = 7 }; @@ -298,8 +296,7 @@ } static void -test_heap_insert_delete_reverse_order(int argc OVS_UNUSED, - char *argv[] OVS_UNUSED) +test_heap_insert_delete_reverse_order(struct ovs_cmdl_context *ctx OVS_UNUSED) { enum { N_ELEMS = 7 }; @@ -328,8 +325,7 @@ } static void -test_heap_insert_delete_every_order(int argc OVS_UNUSED, - char *argv[] OVS_UNUSED) +test_heap_insert_delete_every_order(struct ovs_cmdl_context *ctx OVS_UNUSED) { enum { N_ELEMS = 5 }; @@ -364,8 +360,7 @@ } static void -test_heap_insert_delete_same_order_with_dups(int argc OVS_UNUSED, - char *argv[] OVS_UNUSED) +test_heap_insert_delete_same_order_with_dups(struct ovs_cmdl_context *ctx OVS_UNUSED) { enum { N_ELEMS = 7 }; @@ -411,7 +406,7 @@ } static void -test_heap_raw_insert(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_heap_raw_insert(struct ovs_cmdl_context *ctx OVS_UNUSED) { enum { N_ELEMS = 7 }; @@ -437,7 +432,7 @@ } static void -test_heap_raw_delete(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_heap_raw_delete(struct ovs_cmdl_context *ctx OVS_UNUSED) { enum { N_ELEMS = 16 }; @@ -464,25 +459,31 @@ } } -static const struct command commands[] = { - { "insert-delete-same-order", 0, 0, test_heap_insert_delete_same_order, }, - { "insert-delete-reverse-order", 0, 0, +static const struct ovs_cmdl_command commands[] = { + { "insert-delete-same-order", NULL, 0, 0, + test_heap_insert_delete_same_order, }, + { "insert-delete-reverse-order", NULL, 0, 0, test_heap_insert_delete_reverse_order, }, - { "insert-delete-every-order", 0, 0, + { "insert-delete-every-order", NULL, 0, 0, test_heap_insert_delete_every_order, }, - { "insert-delete-same-order-with-dups", 0, 0, + { "insert-delete-same-order-with-dups", NULL, 0, 0, test_heap_insert_delete_same_order_with_dups, }, - { "raw-insert", 0, 0, test_heap_raw_insert, }, - { "raw-delete", 0, 0, test_heap_raw_delete, }, - { NULL, 0, 0, NULL, }, + { "raw-insert", NULL, 0, 0, test_heap_raw_insert, }, + { "raw-delete", NULL, 0, 0, test_heap_raw_delete, }, + { NULL, NULL, 0, 0, NULL, }, }; static void test_heap_main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { + .argc = argc - 1, + .argv = argv + 1, + }; + set_program_name(argv[0]); - run_command(argc - 1, argv + 1, commands); + ovs_cmdl_run_command(&ctx, commands); } OVSTEST_REGISTER("test-heap", test_heap_main); diff -Nru openvswitch-2.3.1/tests/test-hindex.c openvswitch-2.4.0~git20150623/tests/test-hindex.c --- openvswitch-2.3.1/tests/test-hindex.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-hindex.c 2015-06-23 18:46:21.000000000 +0000 @@ -18,15 +18,14 @@ * hindex.h. */ #include +#undef NDEBUG #include "hindex.h" +#include #include #include "hash.h" +#include "ovstest.h" #include "random.h" #include "util.h" -#include "ovstest.h" - -#undef NDEBUG -#include /* Sample hindex element. */ struct element { diff -Nru openvswitch-2.3.1/tests/test-hmap.c openvswitch-2.4.0~git20150623/tests/test-hmap.c --- openvswitch-2.3.1/tests/test-hmap.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-hmap.c 2015-06-23 18:46:21.000000000 +0000 @@ -18,15 +18,14 @@ * hmap.h. */ #include +#undef NDEBUG #include "hmap.h" +#include #include #include "hash.h" +#include "ovstest.h" #include "random.h" #include "util.h" -#include "ovstest.h" - -#undef NDEBUG -#include /* Sample hmap element. */ struct element { diff -Nru openvswitch-2.3.1/tests/test-json.c openvswitch-2.4.0~git20150623/tests/test-json.c --- openvswitch-2.3.1/tests/test-json.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-json.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,16 +15,15 @@ */ #include - +#undef NDEBUG #include "json.h" - #include #include #include #include - -#include "util.h" #include "ovstest.h" +#include "util.h" + /* --pretty: If set, the JSON output is pretty-printed, instead of printed as * compactly as possible. */ static int pretty = 0; diff -Nru openvswitch-2.3.1/tests/test-jsonrpc.c openvswitch-2.4.0~git20150623/tests/test-jsonrpc.c --- openvswitch-2.3.1/tests/test-jsonrpc.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-jsonrpc.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,37 +15,39 @@ */ #include - +#undef NDEBUG #include "jsonrpc.h" - #include #include #include #include #include - #include "command-line.h" #include "daemon.h" #include "json.h" +#include "ovstest.h" #include "poll-loop.h" #include "stream-ssl.h" #include "stream.h" #include "timeval.h" #include "util.h" -#include "vlog.h" -#include "ovstest.h" +#include "openvswitch/vlog.h" -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[]); -static struct command *get_all_commands(void); +static struct ovs_cmdl_command *get_all_commands(void); static void test_jsonrpc_main(int argc, char *argv[]) { - proctitle_init(argc, argv); + struct ovs_cmdl_context ctx = { .argc = 0, }; + ovs_cmdl_proctitle_init(argc, argv); set_program_name(argv[0]); + service_start(&argc, &argv); parse_options(argc, argv); - run_command(argc - optind, argv + optind, get_all_commands()); + ctx.argc = argc - optind; + ctx.argv = argv + optind; + ovs_cmdl_run_command(&ctx, get_all_commands()); } static void @@ -63,7 +65,7 @@ STREAM_SSL_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { int c = getopt_long(argc, argv, short_options, long_options, NULL); @@ -167,7 +169,7 @@ } static void -do_listen(int argc OVS_UNUSED, char *argv[]) +do_listen(struct ovs_cmdl_context *ctx) { struct pstream *pstream; struct jsonrpc **rpcs; @@ -175,9 +177,9 @@ bool done; int error; - error = jsonrpc_pstream_open(argv[1], &pstream, DSCP_DEFAULT); + error = jsonrpc_pstream_open(ctx->argv[1], &pstream, DSCP_DEFAULT); if (error) { - ovs_fatal(error, "could not listen on \"%s\"", argv[1]); + ovs_fatal(error, "could not listen on \"%s\"", ctx->argv[1]); } daemonize(); @@ -250,7 +252,7 @@ } static void -do_request(int argc OVS_UNUSED, char *argv[]) +do_request(struct ovs_cmdl_context *ctx) { struct jsonrpc_msg *msg; struct jsonrpc *rpc; @@ -260,18 +262,18 @@ char *string; int error; - method = argv[2]; - params = parse_json(argv[3]); + method = ctx->argv[2]; + params = parse_json(ctx->argv[3]); msg = jsonrpc_create_request(method, params, NULL); string = jsonrpc_msg_is_valid(msg); if (string) { ovs_fatal(0, "not a valid JSON-RPC request: %s", string); } - error = stream_open_block(jsonrpc_stream_open(argv[1], &stream, + error = stream_open_block(jsonrpc_stream_open(ctx->argv[1], &stream, DSCP_DEFAULT), &stream); if (error) { - ovs_fatal(error, "could not open \"%s\"", argv[1]); + ovs_fatal(error, "could not open \"%s\"", ctx->argv[1]); } rpc = jsonrpc_open(stream); @@ -290,7 +292,7 @@ } static void -do_notify(int argc OVS_UNUSED, char *argv[]) +do_notify(struct ovs_cmdl_context *ctx) { struct jsonrpc_msg *msg; struct jsonrpc *rpc; @@ -300,18 +302,18 @@ char *string; int error; - method = argv[2]; - params = parse_json(argv[3]); + method = ctx->argv[2]; + params = parse_json(ctx->argv[3]); msg = jsonrpc_create_notify(method, params); string = jsonrpc_msg_is_valid(msg); if (string) { ovs_fatal(0, "not a JSON RPC-valid notification: %s", string); } - error = stream_open_block(jsonrpc_stream_open(argv[1], &stream, + error = stream_open_block(jsonrpc_stream_open(ctx->argv[1], &stream, DSCP_DEFAULT), &stream); if (error) { - ovs_fatal(error, "could not open \"%s\"", argv[1]); + ovs_fatal(error, "could not open \"%s\"", ctx->argv[1]); } rpc = jsonrpc_open(stream); @@ -323,20 +325,20 @@ } static void -do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_help(struct ovs_cmdl_context *ctx OVS_UNUSED) { usage(); } -static struct command all_commands[] = { - { "listen", 1, 1, do_listen }, - { "request", 3, 3, do_request }, - { "notify", 3, 3, do_notify }, - { "help", 0, INT_MAX, do_help }, - { NULL, 0, 0, NULL }, +static struct ovs_cmdl_command all_commands[] = { + { "listen", NULL, 1, 1, do_listen }, + { "request", NULL, 3, 3, do_request }, + { "notify", NULL, 3, 3, do_notify }, + { "help", NULL, 0, INT_MAX, do_help }, + { NULL, NULL, 0, 0, NULL }, }; -static struct command * +static struct ovs_cmdl_command * get_all_commands(void) { return all_commands; diff -Nru openvswitch-2.3.1/tests/test-lib.c openvswitch-2.4.0~git20150623/tests/test-lib.c --- openvswitch-2.3.1/tests/test-lib.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-lib.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2014 Cisco Systems, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void +show_version(void) +{ + printf("%s - %s\n", + ovs_get_program_name(), ovs_get_program_version()); + exit(EXIT_SUCCESS); +} + +static void +usage(void) +{ + printf("%s: Open vSwitch library test utility\n" + "usage: %s [OPTIONS] COMMAND [ARG...]\n\n", + ovs_get_program_name(), ovs_get_program_name()); + vlog_usage(); + exit(EXIT_SUCCESS); +} + +static void +parse_options(int argc, char *argv[]) +{ + static const struct option long_options[] = { + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'V'}, + {"verbose", optional_argument, NULL, 'v'}, + {NULL, 0, NULL, 0}, + }; + char *short_options = "hVv"; + + for (;;) { + int c; + + c = getopt_long(argc, argv, short_options, long_options, NULL); + if (c == -1) { + break; + } + + switch (c) { + case 'V': + show_version(); + break; + + case 'h': + usage(); + break; + + case 'v': + vlog_set_verbosity(optarg); + break; + + case '?': + exit(EXIT_FAILURE); + + default: + abort(); + } + } +} + +int +main(int argc, char *argv[]) +{ + ovs_set_program_name(argv[0], "1.0"); + parse_options(argc, argv); + + return 0; +} diff -Nru openvswitch-2.3.1/tests/test-list.c openvswitch-2.4.0~git20150623/tests/test-list.c --- openvswitch-2.3.1/tests/test-list.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-list.c 2015-06-23 18:46:21.000000000 +0000 @@ -18,23 +18,22 @@ * list.h. */ #include +#undef NDEBUG #include "list.h" +#include #include #include "ovstest.h" -#undef NDEBUG -#include - /* Sample list element. */ struct element { int value; - struct list node; + struct ovs_list node; }; /* Puts the 'n' values in 'values' into 'elements', and then puts those * elements in order into 'list'. */ static void -make_list(struct list *list, struct element elements[], +make_list(struct ovs_list *list, struct element elements[], int values[], size_t n) { size_t i; @@ -50,7 +49,7 @@ /* Verifies that 'list' contains exactly the 'n' values in 'values', in the * specified order. */ static void -check_list(struct list *list, const int values[], size_t n) +check_list(struct ovs_list *list, const int values[], size_t n) { struct element *e; size_t i; @@ -82,7 +81,7 @@ #if 0 /* Prints the values in 'list', plus 'name' as a title. */ static void -print_list(const char *name, struct list *list) +print_list(const char *name, struct ovs_list *list) { struct element *e; @@ -104,7 +103,7 @@ for (n = 0; n <= MAX_ELEMS; n++) { struct element elements[MAX_ELEMS]; int values[MAX_ELEMS]; - struct list list; + struct ovs_list list; make_list(&list, elements, values, n); check_list(&list, values, n); @@ -124,7 +123,7 @@ for (pattern = 0; pattern < 1ul << n; pattern++) { struct element elements[MAX_ELEMS]; int values[MAX_ELEMS]; - struct list list; + struct ovs_list list; struct element *e, *next; size_t values_idx, n_remaining; int i; @@ -160,6 +159,31 @@ } } +/* Tests that LIST_FOR_EACH_POP removes the elements of a list. */ +static void +test_list_for_each_pop(void) +{ + enum { MAX_ELEMS = 10 }; + size_t n; + + for (n = 0; n <= MAX_ELEMS; n++) { + struct element elements[MAX_ELEMS]; + int values[MAX_ELEMS]; + struct ovs_list list; + struct element *e; + size_t n_remaining; + + make_list(&list, elements, values, n); + + n_remaining = n; + LIST_FOR_EACH_POP (e, node, &list) { + n_remaining--; + memmove(values, values + 1, sizeof *values * n_remaining); + check_list(&list, values, n_remaining); + } + } +} + static void run_test(void (*function)(void)) { @@ -172,6 +196,7 @@ { run_test(test_list_construction); run_test(test_list_for_each_safe); + run_test(test_list_for_each_pop); printf("\n"); } diff -Nru openvswitch-2.3.1/tests/test-lockfile.c openvswitch-2.4.0~git20150623/tests/test-lockfile.c --- openvswitch-2.3.1/tests/test-lockfile.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-lockfile.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,20 +15,18 @@ */ #include - +#undef NDEBUG #include "lockfile.h" - #include #include #include #include #include - +#include "ovstest.h" #include "process.h" #include "timeval.h" #include "util.h" -#include "vlog.h" -#include "ovstest.h" +#include "openvswitch/vlog.h" struct test { const char *name; @@ -92,6 +90,7 @@ lockfile_unlock(lockfile); } +#ifndef _WIN32 static enum { PARENT, CHILD } do_fork(void) { @@ -153,27 +152,6 @@ } } -static void -run_lock_multiple(void) -{ - struct lockfile *a, *b, *c, *dummy; - - CHECK(lockfile_lock("a", &a), 0); - CHECK(lockfile_lock("b", &b), 0); - CHECK(lockfile_lock("c", &c), 0); - - lockfile_unlock(a); - CHECK(lockfile_lock("a", &a), 0); - CHECK(lockfile_lock("a", &dummy), EDEADLK); - lockfile_unlock(a); - - lockfile_unlock(b); - CHECK(lockfile_lock("a", &a), 0); - - lockfile_unlock(c); - lockfile_unlock(a); -} - /* Checks that locking a dangling symlink works OK. (It used to hang.) */ static void run_lock_symlink(void) @@ -236,6 +214,29 @@ lockfile_unlock(a); } +#endif /* _WIN32 */ + +static void +run_lock_multiple(void) +{ + struct lockfile *a, *b, *c, *dummy; + + CHECK(lockfile_lock("a", &a), 0); + CHECK(lockfile_lock("b", &b), 0); + CHECK(lockfile_lock("c", &c), 0); + + lockfile_unlock(a); + CHECK(lockfile_lock("a", &a), 0); + CHECK(lockfile_lock("a", &dummy), EDEADLK); + lockfile_unlock(a); + + lockfile_unlock(b); + CHECK(lockfile_lock("a", &a), 0); + + lockfile_unlock(c); + lockfile_unlock(a); +} + static const struct test tests[] = { #define TEST(NAME) { #NAME, run_##NAME } @@ -243,12 +244,14 @@ TEST(lock_and_unlock_twice), TEST(lock_blocks_same_process), TEST(lock_blocks_same_process_twice), +#ifndef _WIN32 TEST(lock_blocks_other_process), TEST(lock_twice_blocks_other_process), TEST(lock_and_unlock_allows_other_process), - TEST(lock_multiple), TEST(lock_symlink), TEST(lock_symlink_to_dir), +#endif /* _WIN32 */ + TEST(lock_multiple), TEST(help), { NULL, NULL } #undef TEST @@ -289,6 +292,7 @@ (tests[i].function)(); n_children = 0; +#ifndef _WIN32 while (wait(&status) > 0) { if (WIFEXITED(status) && WEXITSTATUS(status) == 11) { n_children++; @@ -300,6 +304,7 @@ if (errno != ECHILD) { ovs_fatal(errno, "wait"); } +#endif /* _WIN32 */ printf("%s: success (%d child%s)\n", tests[i].name, n_children, n_children != 1 ? "ren" : ""); diff -Nru openvswitch-2.3.1/tests/test-multipath.c openvswitch-2.4.0~git20150623/tests/test-multipath.c --- openvswitch-2.3.1/tests/test-multipath.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-multipath.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,19 +15,17 @@ */ #include - +#undef NDEBUG #include "multipath.h" - #include #include #include #include #include - #include "flow.h" #include "ofp-actions.h" -#include "util.h" #include "ovstest.h" +#include "util.h" static void test_multipath_main(int argc, char *argv[]) diff -Nru openvswitch-2.3.1/tests/test-netflow.c openvswitch-2.4.0~git20150623/tests/test-netflow.c --- openvswitch-2.3.1/tests/test-netflow.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-netflow.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,27 +15,26 @@ */ #include - +#undef NDEBUG +#include "netflow.h" #include #include #include #include #include - #include "command-line.h" #include "daemon.h" #include "dynamic-string.h" -#include "netflow.h" #include "ofpbuf.h" +#include "ovstest.h" #include "packets.h" #include "poll-loop.h" #include "socket-util.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" -#include "ovstest.h" +#include "openvswitch/vlog.h" -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[]); static unixctl_cb_func test_netflow_exit; @@ -162,8 +161,8 @@ putchar('\n'); } - if (ofpbuf_size(buf)) { - printf("%"PRIu32" extra bytes after last record\n", ofpbuf_size(buf)); + if (buf->size) { + printf("%"PRIu32" extra bytes after last record\n", buf->size); } } @@ -179,8 +178,9 @@ int sock; int n; - proctitle_init(argc, argv); + ovs_cmdl_proctitle_init(argc, argv); set_program_name(argv[0]); + service_start(&argc, &argv); parse_options(argc, argv); if (argc - optind != 1) { @@ -189,7 +189,7 @@ } target = argv[optind]; - sock = inet_open_passive(SOCK_DGRAM, target, 0, NULL, 0); + sock = inet_open_passive(SOCK_DGRAM, target, 0, NULL, 0, true); if (sock < 0) { ovs_fatal(0, "%s: failed to open (%s)", argv[1], ovs_strerror(-sock)); } @@ -214,7 +214,7 @@ ofpbuf_clear(&buf); do { - retval = read(sock, ofpbuf_data(&buf), buf.allocated); + retval = recv(sock, buf.data, buf.allocated, 0); } while (retval < 0 && errno == EINTR); if (retval > 0) { ofpbuf_put_uninit(&buf, retval); @@ -248,7 +248,7 @@ VLOG_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { int c = getopt_long(argc, argv, short_options, long_options, NULL); diff -Nru openvswitch-2.3.1/tests/test-odp.c openvswitch-2.4.0~git20150623/tests/test-odp.c --- openvswitch-2.3.1/tests/test-odp.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-odp.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,18 +15,17 @@ */ #include - +#undef NDEBUG +#include "odp-util.h" #include - #include "dynamic-string.h" #include "flow.h" #include "match.h" -#include "odp-util.h" #include "ofp-parse.h" #include "ofpbuf.h" -#include "util.h" -#include "vlog.h" #include "ovstest.h" +#include "util.h" +#include "openvswitch/vlog.h" static int parse_keys(bool wc_keys) @@ -56,7 +55,7 @@ if (!wc_keys) { /* Convert odp_key to flow. */ - fitness = odp_flow_key_to_flow(ofpbuf_data(&odp_key), ofpbuf_size(&odp_key), &flow); + fitness = odp_flow_key_to_flow(odp_key.data, odp_key.size, &flow); switch (fitness) { case ODP_FIT_PERFECT: break; @@ -77,11 +76,11 @@ ofpbuf_uninit(&odp_key); ofpbuf_init(&odp_key, 0); odp_flow_key_from_flow(&odp_key, &flow, NULL, - flow.in_port.odp_port); + flow.in_port.odp_port, true); - if (ofpbuf_size(&odp_key) > ODPUTIL_FLOW_KEY_BYTES) { + if (odp_key.size > ODPUTIL_FLOW_KEY_BYTES) { printf ("too long: %"PRIu32" > %d\n", - ofpbuf_size(&odp_key), ODPUTIL_FLOW_KEY_BYTES); + odp_key.size, ODPUTIL_FLOW_KEY_BYTES); exit_code = 1; } } @@ -89,10 +88,10 @@ /* Convert odp_key to string. */ ds_init(&out); if (wc_keys) { - odp_flow_format(ofpbuf_data(&odp_key), ofpbuf_size(&odp_key), - ofpbuf_data(&odp_mask), ofpbuf_size(&odp_mask), NULL, &out, false); + odp_flow_format(odp_key.data, odp_key.size, + odp_mask.data, odp_mask.size, NULL, &out, false); } else { - odp_flow_key_format(ofpbuf_data(&odp_key), ofpbuf_size(&odp_key), &out); + odp_flow_key_format(odp_key.data, odp_key.size, &out); } puts(ds_cstr(&out)); ds_destroy(&out); @@ -127,7 +126,7 @@ /* Convert odp_actions back to string. */ ds_init(&out); - format_odp_actions(&out, ofpbuf_data(&odp_actions), ofpbuf_size(&odp_actions)); + format_odp_actions(&out, odp_actions.data, odp_actions.size); puts(ds_cstr(&out)); ds_destroy(&out); @@ -149,7 +148,7 @@ vlog_set_levels_from_string_assert("odp_util:console:dbg"); if (filter_parse && !strncmp(filter_parse, "filter=", 7)) { - filter = strdup(filter_parse+7); + filter = xstrdup(filter_parse + 7); memset(&flow_filter, 0, sizeof(flow_filter)); memset(&wc_filter, 0, sizeof(wc_filter)); @@ -185,8 +184,8 @@ struct match match, match_filter; struct minimatch minimatch; - odp_flow_key_to_flow(ofpbuf_data(&odp_key), ofpbuf_size(&odp_key), &flow); - odp_flow_key_to_mask(ofpbuf_data(&odp_mask), ofpbuf_size(&odp_mask), &wc.masks, + odp_flow_key_to_flow(odp_key.data, odp_key.size, &flow); + odp_flow_key_to_mask(odp_mask.data, odp_mask.size, &wc.masks, &flow); match_init(&match, &flow, &wc); @@ -202,8 +201,8 @@ } /* Convert odp_key to string. */ ds_init(&out); - odp_flow_format(ofpbuf_data(&odp_key), ofpbuf_size(&odp_key), - ofpbuf_data(&odp_mask), ofpbuf_size(&odp_mask), NULL, &out, false); + odp_flow_format(odp_key.data, odp_key.size, + odp_mask.data, odp_mask.size, NULL, &out, false); puts(ds_cstr(&out)); ds_destroy(&out); diff -Nru openvswitch-2.3.1/tests/test-ovsdb.c openvswitch-2.4.0~git20150623/tests/test-ovsdb.c --- openvswitch-2.3.1/tests/test-ovsdb.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-ovsdb.c 2015-06-23 18:46:21.000000000 +0000 @@ -49,18 +49,21 @@ #include "tests/idltest.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[]); -static struct command *get_all_commands(void); +static struct ovs_cmdl_command *get_all_commands(void); int main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { .argc = 0, }; set_program_name(argv[0]); parse_options(argc, argv); - run_command(argc - optind, argv + optind, get_all_commands()); + ctx.argc = argc - optind; + ctx.argv = argv + optind; + ovs_cmdl_run_command(&ctx, get_all_commands()); return 0; } @@ -73,7 +76,7 @@ {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { unsigned long int timeout; @@ -256,10 +259,10 @@ /* Command implementations. */ static void -do_log_io(int argc, char *argv[]) +do_log_io(struct ovs_cmdl_context *ctx) { - const char *name = argv[1]; - char *mode_string = argv[2]; + const char *name = ctx->argv[1]; + char *mode_string = ctx->argv[2]; struct ovsdb_error *error; enum ovsdb_log_open_mode mode; @@ -279,8 +282,8 @@ check_ovsdb_error(ovsdb_log_open(name, mode, -1, &log)); printf("%s: open successful\n", name); - for (i = 3; i < argc; i++) { - const char *command = argv[i]; + for (i = 3; i < ctx->argc; i++) { + const char *command = ctx->argv[i]; if (!strcmp(command, "read")) { struct json *json; @@ -317,7 +320,7 @@ } static void -do_default_atoms(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_default_atoms(struct ovs_cmdl_context *ctx OVS_UNUSED) { int type; @@ -342,7 +345,7 @@ } static void -do_default_data(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_default_data(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned int n_min; int key, value; @@ -382,24 +385,24 @@ } static void -do_parse_atomic_type(int argc OVS_UNUSED, char *argv[]) +do_parse_atomic_type(struct ovs_cmdl_context *ctx) { enum ovsdb_atomic_type type; struct json *json; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_atomic_type_from_json(&type, json)); json_destroy(json); print_and_free_json(ovsdb_atomic_type_to_json(type)); } static void -do_parse_base_type(int argc OVS_UNUSED, char *argv[]) +do_parse_base_type(struct ovs_cmdl_context *ctx) { struct ovsdb_base_type base; struct json *json; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_base_type_from_json(&base, json)); json_destroy(json); print_and_free_json(ovsdb_base_type_to_json(&base)); @@ -407,12 +410,12 @@ } static void -do_parse_type(int argc OVS_UNUSED, char *argv[]) +do_parse_type(struct ovs_cmdl_context *ctx) { struct ovsdb_type type; struct json *json; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_type_from_json(&type, json)); json_destroy(json); print_and_free_json(ovsdb_type_to_json(&type)); @@ -420,21 +423,21 @@ } static void -do_parse_atoms(int argc, char *argv[]) +do_parse_atoms(struct ovs_cmdl_context *ctx) { struct ovsdb_base_type base; struct json *json; int i; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_base_type_from_json(&base, json)); json_destroy(json); - for (i = 2; i < argc; i++) { + for (i = 2; i < ctx->argc; i++) { struct ovsdb_error *error; union ovsdb_atom atom; - json = unbox_json(parse_json(argv[i])); + json = unbox_json(parse_json(ctx->argv[i])); error = ovsdb_atom_from_json(&atom, &base, json, NULL); json_destroy(json); @@ -449,21 +452,21 @@ } static void -do_parse_atom_strings(int argc, char *argv[]) +do_parse_atom_strings(struct ovs_cmdl_context *ctx) { struct ovsdb_base_type base; struct json *json; int i; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_base_type_from_json(&base, json)); json_destroy(json); - for (i = 2; i < argc; i++) { + for (i = 2; i < ctx->argc; i++) { union ovsdb_atom atom; struct ds out; - die_if_error(ovsdb_atom_from_string(&atom, &base, argv[i], NULL)); + die_if_error(ovsdb_atom_from_string(&atom, &base, ctx->argv[i], NULL)); ds_init(&out); ovsdb_atom_to_string(&atom, base.type, &out); @@ -506,27 +509,27 @@ } static void -do_parse_data(int argc, char *argv[]) +do_parse_data(struct ovs_cmdl_context *ctx) { - do_parse_data__(argc, argv, ovsdb_datum_from_json); + do_parse_data__(ctx->argc, ctx->argv, ovsdb_datum_from_json); } static void -do_parse_data_strings(int argc, char *argv[]) +do_parse_data_strings(struct ovs_cmdl_context *ctx) { struct ovsdb_type type; struct json *json; int i; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_type_from_json(&type, json)); json_destroy(json); - for (i = 2; i < argc; i++) { + for (i = 2; i < ctx->argc; i++) { struct ovsdb_datum datum; struct ds out; - die_if_error(ovsdb_datum_from_string(&datum, &type, argv[i], NULL)); + die_if_error(ovsdb_datum_from_string(&datum, &type, ctx->argv[i], NULL)); ds_init(&out); ovsdb_datum_to_string(&datum, &type, &out); @@ -550,7 +553,7 @@ } static void -do_sort_atoms(int argc OVS_UNUSED, char *argv[]) +do_sort_atoms(struct ovs_cmdl_context *ctx) { struct ovsdb_base_type base; union ovsdb_atom *atoms; @@ -558,11 +561,11 @@ size_t n_atoms; int i; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_base_type_from_json(&base, json)); json_destroy(json); - json = unbox_json(parse_json(argv[2])); + json = unbox_json(parse_json(ctx->argv[2])); if (json->type != JSON_ARRAY) { ovs_fatal(0, "second argument must be array"); } @@ -592,36 +595,36 @@ } static void -do_parse_column(int argc OVS_UNUSED, char *argv[]) +do_parse_column(struct ovs_cmdl_context *ctx) { struct ovsdb_column *column; struct json *json; - json = parse_json(argv[2]); - check_ovsdb_error(ovsdb_column_from_json(json, argv[1], &column)); + json = parse_json(ctx->argv[2]); + check_ovsdb_error(ovsdb_column_from_json(json, ctx->argv[1], &column)); json_destroy(json); print_and_free_json(ovsdb_column_to_json(column)); ovsdb_column_destroy(column); } static void -do_parse_table(int argc OVS_UNUSED, char *argv[]) +do_parse_table(struct ovs_cmdl_context *ctx) { struct ovsdb_table_schema *ts; bool default_is_root; struct json *json; - default_is_root = argc > 3 && !strcmp(argv[3], "true"); + default_is_root = ctx->argc > 3 && !strcmp(ctx->argv[3], "true"); - json = parse_json(argv[2]); - check_ovsdb_error(ovsdb_table_schema_from_json(json, argv[1], &ts)); + json = parse_json(ctx->argv[2]); + check_ovsdb_error(ovsdb_table_schema_from_json(json, ctx->argv[1], &ts)); json_destroy(json); print_and_free_json(ovsdb_table_schema_to_json(ts, default_is_root)); ovsdb_table_schema_destroy(ts); } static void -do_parse_rows(int argc, char *argv[]) +do_parse_rows(struct ovs_cmdl_context *ctx) { struct ovsdb_column_set all_columns; struct ovsdb_table_schema *ts; @@ -629,7 +632,7 @@ struct json *json; int i; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); @@ -637,14 +640,14 @@ ovsdb_column_set_init(&all_columns); ovsdb_column_set_add_all(&all_columns, table); - for (i = 2; i < argc; i++) { + for (i = 2; i < ctx->argc; i++) { struct ovsdb_column_set columns; struct ovsdb_row *row; ovsdb_column_set_init(&columns); row = ovsdb_row_create(table); - json = unbox_json(parse_json(argv[i])); + json = unbox_json(parse_json(ctx->argv[i])); check_ovsdb_error(ovsdb_row_from_json(row, json, NULL, &columns)); json_destroy(json); @@ -677,7 +680,7 @@ } static void -do_compare_rows(int argc, char *argv[]) +do_compare_rows(struct ovs_cmdl_context *ctx) { struct ovsdb_column_set all_columns; struct ovsdb_table_schema *ts; @@ -688,7 +691,7 @@ int n_rows; int i, j; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); @@ -696,17 +699,17 @@ ovsdb_column_set_init(&all_columns); ovsdb_column_set_add_all(&all_columns, table); - n_rows = argc - 2; + n_rows = ctx->argc - 2; rows = xmalloc(sizeof *rows * n_rows); names = xmalloc(sizeof *names * n_rows); for (i = 0; i < n_rows; i++) { rows[i] = ovsdb_row_create(table); - json = parse_json(argv[i + 2]); + json = parse_json(ctx->argv[i + 2]); if (json->type != JSON_ARRAY || json->u.array.n != 2 || json->u.array.elems[0]->type != JSON_STRING) { ovs_fatal(0, "\"%s\" does not have expected form " - "[\"name\", {data}]", argv[i]); + "[\"name\", {data}]", ctx->argv[i]); } names[i] = xstrdup(json->u.array.elems[0]->u.string); check_ovsdb_error(ovsdb_row_from_json(rows[i], json->u.array.elems[1], @@ -740,22 +743,22 @@ } static void -do_parse_conditions(int argc, char *argv[]) +do_parse_conditions(struct ovs_cmdl_context *ctx) { struct ovsdb_table_schema *ts; struct json *json; int exit_code = 0; int i; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); - for (i = 2; i < argc; i++) { + for (i = 2; i < ctx->argc; i++) { struct ovsdb_condition cnd; struct ovsdb_error *error; - json = parse_json(argv[i]); + json = parse_json(ctx->argv[i]); error = ovsdb_condition_from_json(ts, json, NULL, &cnd); if (!error) { print_and_free_json(ovsdb_condition_to_json(&cnd)); @@ -776,7 +779,7 @@ } static void -do_evaluate_conditions(int argc OVS_UNUSED, char *argv[]) +do_evaluate_conditions(struct ovs_cmdl_context *ctx) { struct ovsdb_table_schema *ts; struct ovsdb_table *table; @@ -788,14 +791,14 @@ size_t i, j; /* Parse table schema, create table. */ - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); table = ovsdb_table_create(ts); /* Parse conditions. */ - json = parse_json(argv[2]); + json = parse_json(ctx->argv[2]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "CONDITION argument is not JSON array"); } @@ -808,7 +811,7 @@ json_destroy(json); /* Parse rows. */ - json = parse_json(argv[3]); + json = parse_json(ctx->argv[3]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "ROW argument is not JSON array"); } @@ -845,22 +848,22 @@ } static void -do_parse_mutations(int argc, char *argv[]) +do_parse_mutations(struct ovs_cmdl_context *ctx) { struct ovsdb_table_schema *ts; struct json *json; int exit_code = 0; int i; - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); - for (i = 2; i < argc; i++) { + for (i = 2; i < ctx->argc; i++) { struct ovsdb_mutation_set set; struct ovsdb_error *error; - json = parse_json(argv[i]); + json = parse_json(ctx->argv[i]); error = ovsdb_mutation_set_from_json(ts, json, NULL, &set); if (!error) { print_and_free_json(ovsdb_mutation_set_to_json(&set)); @@ -881,7 +884,7 @@ } static void -do_execute_mutations(int argc OVS_UNUSED, char *argv[]) +do_execute_mutations(struct ovs_cmdl_context *ctx) { struct ovsdb_table_schema *ts; struct ovsdb_table *table; @@ -893,14 +896,14 @@ size_t i, j; /* Parse table schema, create table. */ - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); table = ovsdb_table_create(ts); /* Parse mutations. */ - json = parse_json(argv[2]); + json = parse_json(ctx->argv[2]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "MUTATION argument is not JSON array"); } @@ -914,7 +917,7 @@ json_destroy(json); /* Parse rows. */ - json = parse_json(argv[3]); + json = parse_json(ctx->argv[3]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "ROW argument is not JSON array"); } @@ -1007,7 +1010,7 @@ } static void -do_query(int argc OVS_UNUSED, char *argv[]) +do_query(struct ovs_cmdl_context *ctx) { struct do_query_cbdata cbdata; struct ovsdb_table_schema *ts; @@ -1017,14 +1020,14 @@ size_t i; /* Parse table schema, create table. */ - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); table = ovsdb_table_create(ts); /* Parse rows, add to table. */ - json = parse_json(argv[2]); + json = parse_json(ctx->argv[2]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "ROW argument is not JSON array"); } @@ -1046,7 +1049,7 @@ json_destroy(json); /* Parse conditions and execute queries. */ - json = parse_json(argv[3]); + json = parse_json(ctx->argv[3]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "CONDITION argument is not JSON array"); } @@ -1097,7 +1100,7 @@ }; static void -do_query_distinct(int argc OVS_UNUSED, char *argv[]) +do_query_distinct(struct ovs_cmdl_context *ctx) { struct ovsdb_column_set columns; struct ovsdb_table_schema *ts; @@ -1111,20 +1114,20 @@ size_t i; /* Parse table schema, create table. */ - json = unbox_json(parse_json(argv[1])); + json = unbox_json(parse_json(ctx->argv[1])); check_ovsdb_error(ovsdb_table_schema_from_json(json, "mytable", &ts)); json_destroy(json); table = ovsdb_table_create(ts); /* Parse column set. */ - json = parse_json(argv[4]); + json = parse_json(ctx->argv[4]); check_ovsdb_error(ovsdb_column_set_from_json(json, table->schema, &columns)); json_destroy(json); /* Parse rows, add to table. */ - json = parse_json(argv[2]); + json = parse_json(ctx->argv[2]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "ROW argument is not JSON array"); } @@ -1168,7 +1171,7 @@ json_destroy(json); /* Parse conditions and execute queries. */ - json = parse_json(argv[3]); + json = parse_json(ctx->argv[3]); if (json->type != JSON_ARRAY) { ovs_fatal(0, "CONDITION argument is not JSON array"); } @@ -1226,12 +1229,12 @@ } static void -do_parse_schema(int argc OVS_UNUSED, char *argv[]) +do_parse_schema(struct ovs_cmdl_context *ctx) { struct ovsdb_schema *schema; struct json *json; - json = parse_json(argv[1]); + json = parse_json(ctx->argv[1]); check_ovsdb_error(ovsdb_schema_from_json(json, &schema)); json_destroy(json); print_and_free_json(ovsdb_schema_to_json(schema)); @@ -1239,7 +1242,7 @@ } static void -do_execute(int argc OVS_UNUSED, char *argv[]) +do_execute(struct ovs_cmdl_context *ctx) { struct ovsdb_schema *schema; struct json *json; @@ -1247,16 +1250,16 @@ int i; /* Create database. */ - json = parse_json(argv[1]); + json = parse_json(ctx->argv[1]); check_ovsdb_error(ovsdb_schema_from_json(json, &schema)); json_destroy(json); db = ovsdb_create(schema); - for (i = 2; i < argc; i++) { + for (i = 2; i < ctx->argc; i++) { struct json *params, *result; char *s; - params = parse_json(argv[i]); + params = parse_json(ctx->argv[i]); result = ovsdb_execute(db, NULL, params, 0, NULL); s = json_to_string(result, JSSF_SORT); printf("%s\n", s); @@ -1289,7 +1292,7 @@ } static void -do_trigger(int argc OVS_UNUSED, char *argv[]) +do_trigger(struct ovs_cmdl_context *ctx) { struct ovsdb_schema *schema; struct ovsdb_session session; @@ -1301,7 +1304,7 @@ int i; /* Create database. */ - json = parse_json(argv[1]); + json = parse_json(ctx->argv[1]); check_ovsdb_error(ovsdb_schema_from_json(json, &schema)); json_destroy(json); db = ovsdb_create(schema); @@ -1312,8 +1315,8 @@ now = 0; number = 0; - for (i = 2; i < argc; i++) { - struct json *params = parse_json(argv[i]); + for (i = 2; i < ctx->argc; i++) { + struct json *params = parse_json(ctx->argv[i]); if (params->type == JSON_ARRAY && json_array(params)->n == 2 && json_array(params)->elems[0]->type == JSON_STRING @@ -1349,7 +1352,7 @@ } static void -do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_help(struct ovs_cmdl_context *ctx OVS_UNUSED) { usage(); } @@ -1361,14 +1364,14 @@ static struct ovsdb_table *do_transact_table; static void -do_transact_commit(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_transact_commit(struct ovs_cmdl_context *ctx OVS_UNUSED) { ovsdb_error_destroy(ovsdb_txn_commit(do_transact_txn, false)); do_transact_txn = NULL; } static void -do_transact_abort(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_transact_abort(struct ovs_cmdl_context *ctx OVS_UNUSED) { ovsdb_txn_abort(do_transact_txn); do_transact_txn = NULL; @@ -1428,7 +1431,7 @@ } static void -do_transact_insert(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_transact_insert(struct ovs_cmdl_context *ctx) { struct ovsdb_row *row; struct uuid *uuid; @@ -1437,34 +1440,34 @@ /* Set UUID. */ uuid = ovsdb_row_get_uuid_rw(row); - uuid_from_integer(atoi(argv[1]), uuid); + uuid_from_integer(atoi(ctx->argv[1]), uuid); if (ovsdb_table_get_row(do_transact_table, uuid)) { ovs_fatal(0, "table already contains row with UUID "UUID_FMT, UUID_ARGS(uuid)); } - do_transact_set_i_j(row, argv[2], argv[3]); + do_transact_set_i_j(row, ctx->argv[2], ctx->argv[3]); /* Insert row. */ ovsdb_txn_row_insert(do_transact_txn, row); } static void -do_transact_delete(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_transact_delete(struct ovs_cmdl_context *ctx) { - const struct ovsdb_row *row = do_transact_find_row(argv[1]); + const struct ovsdb_row *row = do_transact_find_row(ctx->argv[1]); ovsdb_txn_row_delete(do_transact_txn, row); } static void -do_transact_modify(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_transact_modify(struct ovs_cmdl_context *ctx) { const struct ovsdb_row *row_ro; struct ovsdb_row *row_rw; - row_ro = do_transact_find_row(argv[1]); + row_ro = do_transact_find_row(ctx->argv[1]); row_rw = ovsdb_txn_row_modify(do_transact_txn, row_ro); - do_transact_set_i_j(row_rw, argv[2], argv[3]); + do_transact_set_i_j(row_rw, ctx->argv[2], ctx->argv[3]); } static int @@ -1477,7 +1480,7 @@ } static void -do_transact_print(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_transact_print(struct ovs_cmdl_context *ctx OVS_UNUSED) { const struct ovsdb_row **rows; const struct ovsdb_row *row; @@ -1505,16 +1508,16 @@ } static void -do_transact(int argc, char *argv[]) +do_transact(struct ovs_cmdl_context *ctx) { - static const struct command do_transact_commands[] = { - { "commit", 0, 0, do_transact_commit }, - { "abort", 0, 0, do_transact_abort }, - { "insert", 2, 3, do_transact_insert }, - { "delete", 1, 1, do_transact_delete }, - { "modify", 2, 3, do_transact_modify }, - { "print", 0, 0, do_transact_print }, - { NULL, 0, 0, NULL }, + static const struct ovs_cmdl_command do_transact_commands[] = { + { "commit", NULL, 0, 0, do_transact_commit }, + { "abort", NULL, 0, 0, do_transact_abort }, + { "insert", NULL, 2, 3, do_transact_insert }, + { "delete", NULL, 1, 1, do_transact_delete }, + { "modify", NULL, 2, 3, do_transact_modify }, + { "print", NULL, 0, 0, do_transact_print }, + { NULL, NULL, 0, 0, NULL }, }; struct ovsdb_schema *schema; @@ -1534,13 +1537,14 @@ do_transact_table = ovsdb_get_table(do_transact_db, "mytable"); assert(do_transact_table != NULL); - for (i = 1; i < argc; i++) { + for (i = 1; i < ctx->argc; i++) { struct json *command; size_t n_args; char **args; int j; + struct ovs_cmdl_context transact_ctx = { .argc = 0, }; - command = parse_json(argv[i]); + command = parse_json(ctx->argv[i]); if (command->type != JSON_ARRAY) { ovs_fatal(0, "transaction %d must be JSON array " "with at least 1 element", i); @@ -1569,7 +1573,9 @@ fputs(args[j], stdout); } fputs(":", stdout); - run_command(n_args, args, do_transact_commands); + transact_ctx.argc = n_args; + transact_ctx.argv = args; + ovs_cmdl_run_command(&transact_ctx, do_transact_commands); putchar('\n'); for (j = 0; j < n_args; j++) { @@ -1866,7 +1872,7 @@ } static void -do_idl(int argc, char *argv[]) +do_idl(struct ovs_cmdl_context *ctx) { struct jsonrpc *rpc; struct ovsdb_idl *idl; @@ -1879,14 +1885,14 @@ idltest_init(); - idl = ovsdb_idl_create(argv[1], &idltest_idl_class, true, true); - if (argc > 2) { + idl = ovsdb_idl_create(ctx->argv[1], &idltest_idl_class, true, true); + if (ctx->argc > 2) { struct stream *stream; - error = stream_open_block(jsonrpc_stream_open(argv[1], &stream, + error = stream_open_block(jsonrpc_stream_open(ctx->argv[1], &stream, DSCP_DEFAULT), &stream); if (error) { - ovs_fatal(error, "failed to connect to \"%s\"", argv[1]); + ovs_fatal(error, "failed to connect to \"%s\"", ctx->argv[1]); } rpc = jsonrpc_open(stream); } else { @@ -1896,8 +1902,8 @@ setvbuf(stdout, NULL, _IONBF, 0); symtab = ovsdb_symbol_table_create(); - for (i = 2; i < argc; i++) { - char *arg = argv[i]; + for (i = 2; i < ctx->argc; i++) { + char *arg = ctx->argv[i]; struct jsonrpc_msg *request, *reply; if (*arg == '+') { @@ -1962,38 +1968,38 @@ printf("%03d: done\n", step); } -static struct command all_commands[] = { - { "log-io", 2, INT_MAX, do_log_io }, - { "default-atoms", 0, 0, do_default_atoms }, - { "default-data", 0, 0, do_default_data }, - { "parse-atomic-type", 1, 1, do_parse_atomic_type }, - { "parse-base-type", 1, 1, do_parse_base_type }, - { "parse-type", 1, 1, do_parse_type }, - { "parse-atoms", 2, INT_MAX, do_parse_atoms }, - { "parse-atom-strings", 2, INT_MAX, do_parse_atom_strings }, - { "parse-data", 2, INT_MAX, do_parse_data }, - { "parse-data-strings", 2, INT_MAX, do_parse_data_strings }, - { "sort-atoms", 2, 2, do_sort_atoms }, - { "parse-column", 2, 2, do_parse_column }, - { "parse-table", 2, 3, do_parse_table }, - { "parse-rows", 2, INT_MAX, do_parse_rows }, - { "compare-rows", 2, INT_MAX, do_compare_rows }, - { "parse-conditions", 2, INT_MAX, do_parse_conditions }, - { "evaluate-conditions", 3, 3, do_evaluate_conditions }, - { "parse-mutations", 2, INT_MAX, do_parse_mutations }, - { "execute-mutations", 3, 3, do_execute_mutations }, - { "query", 3, 3, do_query }, - { "query-distinct", 4, 4, do_query_distinct }, - { "transact", 1, INT_MAX, do_transact }, - { "parse-schema", 1, 1, do_parse_schema }, - { "execute", 2, INT_MAX, do_execute }, - { "trigger", 2, INT_MAX, do_trigger }, - { "idl", 1, INT_MAX, do_idl }, - { "help", 0, INT_MAX, do_help }, - { NULL, 0, 0, NULL }, +static struct ovs_cmdl_command all_commands[] = { + { "log-io", NULL, 2, INT_MAX, do_log_io }, + { "default-atoms", NULL, 0, 0, do_default_atoms }, + { "default-data", NULL, 0, 0, do_default_data }, + { "parse-atomic-type", NULL, 1, 1, do_parse_atomic_type }, + { "parse-base-type", NULL, 1, 1, do_parse_base_type }, + { "parse-type", NULL, 1, 1, do_parse_type }, + { "parse-atoms", NULL, 2, INT_MAX, do_parse_atoms }, + { "parse-atom-strings", NULL, 2, INT_MAX, do_parse_atom_strings }, + { "parse-data", NULL, 2, INT_MAX, do_parse_data }, + { "parse-data-strings", NULL, 2, INT_MAX, do_parse_data_strings }, + { "sort-atoms", NULL, 2, 2, do_sort_atoms }, + { "parse-column", NULL, 2, 2, do_parse_column }, + { "parse-table", NULL, 2, 3, do_parse_table }, + { "parse-rows", NULL, 2, INT_MAX, do_parse_rows }, + { "compare-rows", NULL, 2, INT_MAX, do_compare_rows }, + { "parse-conditions", NULL, 2, INT_MAX, do_parse_conditions }, + { "evaluate-conditions", NULL, 3, 3, do_evaluate_conditions }, + { "parse-mutations", NULL, 2, INT_MAX, do_parse_mutations }, + { "execute-mutations", NULL, 3, 3, do_execute_mutations }, + { "query", NULL, 3, 3, do_query }, + { "query-distinct", NULL, 4, 4, do_query_distinct }, + { "transact", NULL, 1, INT_MAX, do_transact }, + { "parse-schema", NULL, 1, 1, do_parse_schema }, + { "execute", NULL, 2, INT_MAX, do_execute }, + { "trigger", NULL, 2, INT_MAX, do_trigger }, + { "idl", NULL, 1, INT_MAX, do_idl }, + { "help", NULL, 0, INT_MAX, do_help }, + { NULL, NULL, 0, 0, NULL }, }; -static struct command * +static struct ovs_cmdl_command * get_all_commands(void) { return all_commands; diff -Nru openvswitch-2.3.1/tests/test-ovsdb.py openvswitch-2.4.0~git20150623/tests/test-ovsdb.py --- openvswitch-2.3.1/tests/test-ovsdb.py 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-ovsdb.py 2015-06-23 18:46:21.000000000 +0000 @@ -228,11 +228,27 @@ def idl_set(idl, commands, step): txn = ovs.db.idl.Transaction(idl) increment = False + events = [] for command in commands.split(','): words = command.split() name = words[0] args = words[1:] + if name == "notifytest": + name = args[0] + args = args[1:] + old_notify = idl.notify + + def notify(event, row, updates=None): + if updates: + upcol = updates._data.keys()[0] + else: + upcol = None + events.append("%s|%s|%s" % (event, row.i, upcol)) + idl.notify = old_notify + + idl.notify = notify + if name == "set": if len(args) != 3: sys.stderr.write('"set" command requires 3 arguments\n') @@ -338,6 +354,10 @@ % (step, ovs.db.idl.Transaction.status_to_string(status))) if increment and status == ovs.db.idl.Transaction.SUCCESS: sys.stdout.write(", increment=%d" % txn.get_increment_new_value()) + if events: + # Event notifications from operations in a single transaction are + # not in a gauranteed order due to update messages being dicts + sys.stdout.write(", events=" + ", ".join(sorted(events))) sys.stdout.write("\n") sys.stdout.flush() diff -Nru openvswitch-2.3.1/tests/test-packets.c openvswitch-2.4.0~git20150623/tests/test-packets.c --- openvswitch-2.3.1/tests/test-packets.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-packets.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,16 +15,14 @@ */ #include +#undef NDEBUG #include "packets.h" +#include #include #include #include #include "ovstest.h" -#undef NDEBUG -#include - - static void test_ipv4_cidr(void) { diff -Nru openvswitch-2.3.1/tests/test-random.c openvswitch-2.4.0~git20150623/tests/test-random.c --- openvswitch-2.3.1/tests/test-random.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-random.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,11 +15,11 @@ */ #include - +#undef NDEBUG #include "random.h" -#include "ovstest.h" #include #include +#include "ovstest.h" static void test_random_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) diff -Nru openvswitch-2.3.1/tests/test-reconnect.c openvswitch-2.4.0~git20150623/tests/test-reconnect.c --- openvswitch-2.3.1/tests/test-reconnect.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-reconnect.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,20 +15,18 @@ */ #include - +#undef NDEBUG #include "reconnect.h" - #include #include #include #include - #include "command-line.h" #include "compiler.h" +#include "ovstest.h" #include "svec.h" #include "util.h" -#include "vlog.h" -#include "ovstest.h" +#include "openvswitch/vlog.h" static struct reconnect *reconnect; static int now; @@ -36,7 +34,7 @@ static void diff_stats(const struct reconnect_stats *old, const struct reconnect_stats *new, int delta); -static const struct command *get_all_commands(void); +static const struct ovs_cmdl_command *get_all_commands(void); static void test_reconnect_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) @@ -47,7 +45,7 @@ int old_time; char line[128]; - vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_OFF); + vlog_set_levels(&VLM_reconnect, VLF_ANY_DESTINATION, VLL_OFF); now = 1000; reconnect = reconnect_create(now); @@ -69,7 +67,11 @@ svec_parse_words(&args, line); svec_terminate(&args); if (!svec_is_empty(&args)) { - run_command(args.n, args.names, get_all_commands()); + struct ovs_cmdl_context ctx = { + .argc = args.n, + .argv = args.names, + }; + ovs_cmdl_run_command(&ctx, get_all_commands()); } svec_destroy(&args); @@ -90,19 +92,19 @@ } static void -do_enable(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_enable(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_enable(reconnect, now); } static void -do_disable(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_disable(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_disable(reconnect, now); } static void -do_force_reconnect(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_force_reconnect(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_force_reconnect(reconnect, now); } @@ -122,42 +124,42 @@ } static void -do_disconnected(int argc OVS_UNUSED, char *argv[]) +do_disconnected(struct ovs_cmdl_context *ctx) { - reconnect_disconnected(reconnect, now, error_from_string(argv[1])); + reconnect_disconnected(reconnect, now, error_from_string(ctx->argv[1])); } static void -do_connecting(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_connecting(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_connecting(reconnect, now); } static void -do_connect_failed(int argc OVS_UNUSED, char *argv[]) +do_connect_failed(struct ovs_cmdl_context *ctx) { - reconnect_connect_failed(reconnect, now, error_from_string(argv[1])); + reconnect_connect_failed(reconnect, now, error_from_string(ctx->argv[1])); } static void -do_connected(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_connected(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_connected(reconnect, now); } static void -do_activity(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_activity(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_activity(reconnect, now); } static void -do_run(int argc, char *argv[]) +do_run(struct ovs_cmdl_context *ctx) { enum reconnect_action action; - if (argc > 1) { - now += atoi(argv[1]); + if (ctx->argc > 1) { + now += atoi(ctx->argv[1]); } action = reconnect_run(reconnect, now); @@ -183,13 +185,13 @@ } static void -do_advance(int argc OVS_UNUSED, char *argv[]) +do_advance(struct ovs_cmdl_context *ctx) { - now += atoi(argv[1]); + now += atoi(ctx->argv[1]); } static void -do_timeout(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_timeout(struct ovs_cmdl_context *ctx OVS_UNUSED) { int timeout = reconnect_timeout(reconnect, now); if (timeout >= 0) { @@ -201,9 +203,9 @@ } static void -do_set_max_tries(int argc OVS_UNUSED, char *argv[]) +do_set_max_tries(struct ovs_cmdl_context *ctx) { - reconnect_set_max_tries(reconnect, atoi(argv[1])); + reconnect_set_max_tries(reconnect, atoi(ctx->argv[1])); } static void @@ -253,43 +255,43 @@ } static void -do_set_passive(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_set_passive(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_set_passive(reconnect, true, now); } static void -do_listening(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +do_listening(struct ovs_cmdl_context *ctx OVS_UNUSED) { reconnect_listening(reconnect, now); } static void -do_listen_error(int argc OVS_UNUSED, char *argv[]) +do_listen_error(struct ovs_cmdl_context *ctx) { - reconnect_listen_error(reconnect, now, atoi(argv[1])); + reconnect_listen_error(reconnect, now, atoi(ctx->argv[1])); } -static const struct command all_commands[] = { - { "enable", 0, 0, do_enable }, - { "disable", 0, 0, do_disable }, - { "force-reconnect", 0, 0, do_force_reconnect }, - { "disconnected", 0, 1, do_disconnected }, - { "connecting", 0, 0, do_connecting }, - { "connect-failed", 0, 1, do_connect_failed }, - { "connected", 0, 0, do_connected }, - { "activity", 0, 0, do_activity }, - { "run", 0, 1, do_run }, - { "advance", 1, 1, do_advance }, - { "timeout", 0, 0, do_timeout }, - { "set-max-tries", 1, 1, do_set_max_tries }, - { "passive", 0, 0, do_set_passive }, - { "listening", 0, 0, do_listening }, - { "listen-error", 1, 1, do_listen_error }, - { NULL, 0, 0, NULL }, +static const struct ovs_cmdl_command all_commands[] = { + { "enable", NULL, 0, 0, do_enable }, + { "disable", NULL, 0, 0, do_disable }, + { "force-reconnect", NULL, 0, 0, do_force_reconnect }, + { "disconnected", NULL, 0, 1, do_disconnected }, + { "connecting", NULL, 0, 0, do_connecting }, + { "connect-failed", NULL, 0, 1, do_connect_failed }, + { "connected", NULL, 0, 0, do_connected }, + { "activity", NULL, 0, 0, do_activity }, + { "run", NULL, 0, 1, do_run }, + { "advance", NULL, 1, 1, do_advance }, + { "timeout", NULL, 0, 0, do_timeout }, + { "set-max-tries", NULL, 1, 1, do_set_max_tries }, + { "passive", NULL, 0, 0, do_set_passive }, + { "listening", NULL, 0, 0, do_listening }, + { "listen-error", NULL, 1, 1, do_listen_error }, + { NULL, NULL, 0, 0, NULL }, }; -static const struct command * +static const struct ovs_cmdl_command * get_all_commands(void) { return all_commands; diff -Nru openvswitch-2.3.1/tests/test-rstp.c openvswitch-2.4.0~git20150623/tests/test-rstp.c --- openvswitch-2.3.1/tests/test-rstp.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-rstp.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,714 @@ +#include +#undef NDEBUG +#include "rstp-common.h" +#include +#include +#include +#include +#include +#include +#include "ofpbuf.h" +#include "ovstest.h" +#include "dp-packet.h" +#include "packets.h" +#include "openvswitch/vlog.h" + +#define MAX_PORTS 10 + +struct bpdu { + int port_no; + void *data; + size_t size; +}; + +struct bridge { + struct test_case *tc; + int id; + bool reached; + + struct rstp *rstp; + + struct lan *ports[RSTP_MAX_PORTS]; + int n_ports; + int n_active_ports; + +#define RXQ_SIZE 16 + struct bpdu rxq[RXQ_SIZE]; + int rxq_head, rxq_tail; +}; + +struct lan_conn { + struct bridge *bridge; + int port_no; +}; + +struct lan { + struct test_case *tc; + const char *name; + bool reached; + struct lan_conn conns[16]; + int n_conns; +}; + +struct test_case { + struct bridge *bridges[16]; + int n_bridges; + struct lan *lans[26]; + int n_lans; +}; + +static const char *file_name; +static int line_number; +static char line[128]; +static char *pos, *token; +static int n_warnings; + +static struct test_case * +new_test_case(void) +{ + struct test_case *tc = xmalloc(sizeof *tc); + + tc->n_bridges = 0; + tc->n_lans = 0; + return tc; +} + +/* This callback is called with rstp_mutex held. */ +static void +send_bpdu(struct dp_packet *pkt, void *port_, void *b_) + OVS_REQUIRES(rstp_mutex) +{ + struct bridge *b = b_; + struct lan *lan; + const struct rstp_port *port = port_; + uint16_t port_no = port->port_number; + + assert(port_no < b->n_ports); + lan = b->ports[port_no]; + if (lan) { + const void *data = dp_packet_l3(pkt); + size_t size = (char *) dp_packet_tail(pkt) - (char *) data; + int i; + + for (i = 0; i < lan->n_conns; i++) { + struct lan_conn *conn = &lan->conns[i]; + + if (conn->bridge != b || conn->port_no != port_no) { + struct bridge *dst = conn->bridge; + struct bpdu *bpdu = &dst->rxq[dst->rxq_head++ % RXQ_SIZE]; + + assert(dst->rxq_head - dst->rxq_tail <= RXQ_SIZE); + bpdu->data = xmemdup(data, size); + bpdu->size = size; + bpdu->port_no = conn->port_no; + } + } + } + dp_packet_delete(pkt); +} + +static struct bridge * +new_bridge(struct test_case *tc, int id) +{ + struct bridge *b = xmalloc(sizeof *b); + char name[16]; + struct rstp_port *p; + int i; + + b->tc = tc; + b->id = id; + snprintf(name, sizeof name, "rstp%x", id); + b->rstp = rstp_create(name, id, send_bpdu, b); + for (i = 1; i < MAX_PORTS; i++) { + p = rstp_add_port(b->rstp); + rstp_port_set_aux(p, p); + rstp_port_set_state(p, RSTP_DISABLED); + rstp_port_set_mac_operational(p, true); + } + + assert(tc->n_bridges < ARRAY_SIZE(tc->bridges)); + b->n_ports = 1; + b->n_active_ports = 1; + b->rxq_head = b->rxq_tail = 0; + tc->bridges[tc->n_bridges++] = b; + return b; +} + +static struct lan * +new_lan(struct test_case *tc, const char *name) +{ + struct lan *lan = xmalloc(sizeof *lan); + lan->tc = tc; + lan->name = xstrdup(name); + lan->n_conns = 0; + assert(tc->n_lans < ARRAY_SIZE(tc->lans)); + tc->lans[tc->n_lans++] = lan; + return lan; +} + +static void +reconnect_port(struct bridge *b, int port_no, struct lan *new_lan) +{ + struct lan *old_lan; + int j; + + assert(port_no < b->n_ports); + old_lan = b->ports[port_no]; + if (old_lan == new_lan) { + return; + } + + /* Disconnect from old_lan. */ + if (old_lan) { + for (j = 0; j < old_lan->n_conns; j++) { + struct lan_conn *c = &old_lan->conns[j]; + + if (c->bridge == b && c->port_no == port_no) { + memmove(c, c + 1, sizeof *c * (old_lan->n_conns - j - 1)); + old_lan->n_conns--; + break; + } + } + } + + /* Connect to new_lan. */ + b->ports[port_no] = new_lan; + if (new_lan) { + int conn_no = new_lan->n_conns++; + + assert(conn_no < ARRAY_SIZE(new_lan->conns)); + new_lan->conns[conn_no].bridge = b; + new_lan->conns[conn_no].port_no = port_no; + } +} + +static void +new_port(struct bridge *b, struct lan *lan, uint32_t path_cost) +{ + int port_no = b->n_ports++; + struct rstp_port *p = rstp_get_port(b->rstp, port_no); + + assert(port_no < ARRAY_SIZE(b->ports)); + b->ports[port_no] = NULL; + /* Enable port. */ + reinitialize_port(p); + rstp_port_set_path_cost(p, path_cost); + rstp_port_set_state(p, RSTP_DISCARDING); + rstp_port_set_mac_operational(p, true); + reconnect_port(b, port_no, lan); +} + +static void +dump(struct test_case *tc) +{ + int i; + + for (i = 0; i < tc->n_bridges; i++) { + struct bridge *b = tc->bridges[i]; + struct rstp *rstp = b->rstp; + int j; + + printf("%s:", rstp_get_name(rstp)); + if (rstp_is_root_bridge(rstp)) { + printf(" root"); + } + printf("\n"); + for (j = 0; j < b->n_ports; j++) { + struct rstp_port *p = rstp_get_port(rstp, j); + enum rstp_state state = rstp_port_get_state(p); + + printf("\tport %d", j); + if (b->ports[j]) { + printf(" (lan %s)", b->ports[j]->name); + } else { + printf(" (disconnected)"); + } + printf(": %s", rstp_state_name(state)); + if (p == rstp_get_root_port(rstp)) { + printf(" (root port, root_path_cost=%u)", + rstp_get_root_path_cost(rstp)); + } + printf("\n"); + } + } +} + +static void dump_lan_tree(struct test_case *, struct lan *, int level); + +static void +dump_bridge_tree(struct test_case *tc, struct bridge *b, int level) +{ + int i; + + if (b->reached) { + return; + } + b->reached = true; + for (i = 0; i < level; i++) { + printf("\t"); + } + printf("%s\n", rstp_get_name(b->rstp)); + for (i = 0; i < b->n_ports; i++) { + struct lan *lan = b->ports[i]; + struct rstp_port *p = rstp_get_port(b->rstp, i); + + if (rstp_port_get_state(p) == RSTP_FORWARDING && lan) { + dump_lan_tree(tc, lan, level + 1); + } + } +} + +static void +dump_lan_tree(struct test_case *tc, struct lan *lan, int level) +{ + int i; + + if (lan->reached) { + return; + } + lan->reached = true; + for (i = 0; i < level; i++) { + printf("\t"); + } + printf("%s\n", lan->name); + for (i = 0; i < lan->n_conns; i++) { + struct bridge *b = lan->conns[i].bridge; + + dump_bridge_tree(tc, b, level + 1); + } +} + +static void +tree(struct test_case *tc) +{ + int i; + + for (i = 0; i < tc->n_bridges; i++) { + struct bridge *b = tc->bridges[i]; + + b->reached = false; + } + for (i = 0; i < tc->n_lans; i++) { + struct lan *lan = tc->lans[i]; + + lan->reached = false; + } + for (i = 0; i < tc->n_bridges; i++) { + struct bridge *b = tc->bridges[i]; + struct rstp *rstp = b->rstp; + + if (rstp_is_root_bridge(rstp)) { + dump_bridge_tree(tc, b, 0); + } + } +} + +static void +simulate(struct test_case *tc, int granularity) +{ + int time, i, round_trips; + + for (time = 0; time < 1000 * 180; time += granularity) { + + for (i = 0; i < tc->n_bridges; i++) { + rstp_tick_timers(tc->bridges[i]->rstp); + } + for (round_trips = 0; round_trips < granularity; round_trips++) { + bool any = false; + + for (i = 0; i < tc->n_bridges; i++) { + struct bridge *b = tc->bridges[i]; + + for (; b->rxq_tail != b->rxq_head; b->rxq_tail++) { + struct bpdu *bpdu = &b->rxq[b->rxq_tail % RXQ_SIZE]; + + rstp_port_received_bpdu(rstp_get_port(b->rstp, + bpdu->port_no), + bpdu->data, bpdu->size); + free(bpdu->data); + any = true; + } + } + if (!any) { + break; + } + } + } +} + +OVS_NO_RETURN static void +err(const char *message, ...) + OVS_PRINTF_FORMAT(1, 2); + +static void +err(const char *message, ...) +{ + va_list args; + + fprintf(stderr, "%s:%d:%"PRIdPTR": ", file_name, line_number, pos - line); + va_start(args, message); + vfprintf(stderr, message, args); + va_end(args); + putc('\n', stderr); + + exit(EXIT_FAILURE); +} + +static void +warn(const char *message, ...) + OVS_PRINTF_FORMAT(1, 2); + +static void +warn(const char *message, ...) +{ + va_list args; + + fprintf(stderr, "%s:%d: ", file_name, line_number); + va_start(args, message); + vfprintf(stderr, message, args); + va_end(args); + putc('\n', stderr); + + n_warnings++; +} + +static bool +get_token(void) +{ + char *start; + + while (isspace((unsigned char) *pos)) { + pos++; + } + if (*pos == '\0') { + free(token); + token = NULL; + return false; + } + + start = pos; + if (isalpha((unsigned char) *pos)) { + while (isalpha((unsigned char) *++pos)) { + continue; + } + } else if (isdigit((unsigned char) *pos)) { + if (*pos == '0' && (pos[1] == 'x' || pos[1] == 'X')) { + pos += 2; + while (isxdigit((unsigned char) *pos)) { + pos++; + } + } else { + while (isdigit((unsigned char) *++pos)) { + continue; + } + } + } else { + pos++; + } + + free(token); + token = xmemdup0(start, pos - start); + return true; +} + +static bool +get_int(int *intp) +{ + char *save_pos = pos; + + if (token && isdigit((unsigned char) *token)) { + *intp = strtol(token, NULL, 0); + get_token(); + return true; + } else { + pos = save_pos; + return false; + } +} + +static bool +match(const char *want) +{ + if (token && !strcmp(want, token)) { + get_token(); + return true; + } else { + return false; + } +} + +static int +must_get_int(void) +{ + int x; + + if (!get_int(&x)) { + err("expected integer"); + } + return x; +} + +static void +must_match(const char *want) +{ + if (!match(want)) { + err("expected \"%s\"", want); + } +} + +static void +test_rstp_main(int argc, char *argv[]) +{ + struct test_case *tc; + FILE *input_file; + int i; + + vlog_set_pattern(VLF_CONSOLE, "%c|%p|%m"); + vlog_set_levels(NULL, VLF_SYSLOG, VLL_OFF); + + if (argc != 2) { + ovs_fatal(0, "usage: test-rstp INPUT.RSTP\n"); + } + file_name = argv[1]; + + input_file = fopen(file_name, "r"); + if (!input_file) { + ovs_fatal(errno, "error opening \"%s\"", file_name); + } + + tc = new_test_case(); + for (i = 0; i < 26; i++) { + char name[2]; + + name[0] = 'a' + i; + name[1] = '\0'; + new_lan(tc, name); + } + + for (line_number = 1; fgets(line, sizeof line, input_file); + line_number++) + { + char *newline, *hash; + + newline = strchr(line, '\n'); + if (newline) { + *newline = '\0'; + } + hash = strchr(line, '#'); + if (hash) { + *hash = '\0'; + } + + pos = line; + if (!get_token()) { + continue; + } + if (match("bridge")) { + struct bridge *bridge; + int bridge_no, port_no; + + bridge_no = must_get_int(); + if (bridge_no < tc->n_bridges) { + bridge = tc->bridges[bridge_no]; + } else if (bridge_no == tc->n_bridges) { + bridge = new_bridge(tc, must_get_int()); + } else { + err("bridges must be numbered consecutively from 0"); + } + if (match("^")) { + rstp_set_bridge_priority(bridge->rstp, must_get_int()); + } + if (match("=")) { + for (port_no = 1; port_no < MAX_PORTS; port_no++) { + struct rstp_port *p = rstp_get_port(bridge->rstp, port_no); + + if (!token || match("X")) { + /* Disable port. */ + reinitialize_port(p); + rstp_port_set_state(p, RSTP_DISABLED); + rstp_port_set_mac_operational(p, false); + } else if (match("_")) { + /* Nothing to do. */ + } else { + struct lan *lan; + uint32_t path_cost; + + if (!strcmp(token, "0")) { + lan = NULL; + } else if (strlen(token) == 1 + && islower((unsigned char)*token)) { + lan = tc->lans[*token - 'a']; + } else { + err("%s is not a valid LAN name " + "(0 or a lowercase letter)", token); + } + get_token(); + + path_cost = match(":") ? must_get_int() : + RSTP_DEFAULT_PORT_PATH_COST; + if (port_no < bridge->n_ports) { + /* Enable port. */ + reinitialize_port(p); + rstp_port_set_path_cost(p, path_cost); + rstp_port_set_state(p, RSTP_DISCARDING); + rstp_port_set_mac_operational(p, true); + reconnect_port(bridge, port_no, lan); + } else if (port_no == bridge->n_ports) { + new_port(bridge, lan, path_cost); + bridge->n_active_ports++; + } else { + err("ports must be numbered consecutively"); + } + if (match("^")) { + rstp_port_set_priority(p, must_get_int()); + } + } + } + } + } else if (match("run")) { + simulate(tc, must_get_int()); + } else if (match("dump")) { + dump(tc); + } else if (match("tree")) { + tree(tc); + } else if (match("check")) { + struct bridge *b; + struct rstp *rstp; + int bridge_no, port_no; + uint32_t cost_value; + + bridge_no = must_get_int(); + if (bridge_no >= tc->n_bridges) { + err("no bridge numbered %d", bridge_no); + } + b = tc->bridges[bridge_no]; + rstp = b->rstp; + + must_match("="); + + if (match("rootid")) { + uint64_t rootid; + + must_match(":"); + rootid = must_get_int(); + if (match("^")) { + rootid |= (uint64_t) must_get_int() << 48; + } else { + rootid |= UINT64_C(0x8000) << 48; + } + if (rstp_get_designated_root(rstp) != rootid) { + warn("%s: root "RSTP_ID_FMT", not %"PRIx64, + rstp_get_name(rstp), + RSTP_ID_ARGS(rstp_get_designated_root(rstp)), + rootid); + } + } + cost_value = rstp_get_root_path_cost(rstp); + if (match("root")) { + if (cost_value != 0) { + warn("%s: root path cost of root is %d instead of 0 \n", + rstp_get_name(rstp), cost_value); + } + if (!rstp_is_root_bridge(rstp)) { + warn("%s: root is "RSTP_ID_FMT", not "RSTP_ID_FMT"", + rstp_get_name(rstp), + RSTP_ID_ARGS(rstp_get_designated_root(rstp)), + RSTP_ID_ARGS(rstp_get_bridge_id(rstp))); + } + for (port_no = 1; port_no < b->n_active_ports; port_no++) { + struct rstp_port *p = rstp_get_port(rstp, port_no); + enum rstp_state state = rstp_port_get_state(p); + + if (state != RSTP_DISABLED && state != RSTP_FORWARDING) { + warn("%s: root port %d in state %s", + rstp_get_name(b->rstp), port_no, + rstp_state_name(state)); + } + } + } else { + for (port_no = 1; port_no < b->n_active_ports; port_no++) { + struct rstp_port *p = rstp_get_port(rstp, port_no); + enum rstp_state state; + + if (token == NULL || match("D")) { + state = RSTP_DISABLED; + } else if (match("Di")) { + state = RSTP_DISCARDING; + } else if (match("Le")) { + state = RSTP_LEARNING; + } else if (match("F")) { + state = RSTP_FORWARDING; + } else if (match("_")) { + continue; + } else { + err("unknown port state %s", token); + } + if (rstp_port_get_state(p) != state) { + warn("%s port %d: state is %s but should be %s", + rstp_get_name(rstp), port_no, + rstp_state_name(rstp_port_get_state(p)), + rstp_state_name(state)); + } + if (state == RSTP_FORWARDING) { + struct rstp_port *root_port = rstp_get_root_port(rstp); + + if (match(":")) { + int root_path_cost = must_get_int(); + + if (p != root_port) { + warn("%s: port %d is not the root port", + rstp_get_name(rstp), port_no); + if (!root_port) { + warn("%s: (there is no root port)", + rstp_get_name(rstp)); + } else { + warn("%s: (port %d is the root port)", + rstp_get_name(rstp), + rstp_port_get_number(root_port)); + } + } else if (cost_value != root_path_cost) { + warn("%s: root path cost is %d, should be %d", + rstp_get_name(rstp), + cost_value, + root_path_cost); + } + } else if (p == root_port) { + warn("%s: port %d is the root port but " + "not expected to be", + rstp_get_name(rstp), port_no); + } + } + } + } + if (n_warnings) { + printf("failing because of %d warnings\n", n_warnings); + exit(EXIT_FAILURE); + } + } + if (get_token()) { + printf("failing because of errors\n"); + err("trailing garbage on line"); + } + } + free(token); + + for (i = 0; i < tc->n_lans; i++) { + struct lan *lan = tc->lans[i]; + + free(CONST_CAST(char *, lan->name)); + free(lan); + } + for (i = 0; i < tc->n_bridges; i++) { + struct bridge *bridge = tc->bridges[i]; + int j; + + for (j = 1; j < MAX_PORTS; j++) { + rstp_port_unref(rstp_get_port(bridge->rstp, j)); + } + rstp_unref(bridge->rstp); + free(bridge); + } + free(tc); +} + +OVSTEST_REGISTER("test-rstp", test_rstp_main); diff -Nru openvswitch-2.3.1/tests/test-sflow.c openvswitch-2.4.0~git20150623/tests/test-sflow.c --- openvswitch-2.3.1/tests/test-sflow.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-sflow.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * Copyright (c) 2013 InMon Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +16,8 @@ */ #include - +#undef NDEBUG +#include "netflow.h" #include #include #include @@ -24,21 +25,19 @@ #include #include #include - #include "command-line.h" #include "daemon.h" #include "dynamic-string.h" -#include "netflow.h" #include "ofpbuf.h" +#include "ovstest.h" #include "packets.h" #include "poll-loop.h" #include "socket-util.h" #include "unixctl.h" #include "util.h" -#include "vlog.h" -#include "ovstest.h" +#include "openvswitch/vlog.h" -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[]); static unixctl_cb_func test_sflow_exit; @@ -55,8 +54,18 @@ /* Structure element tag numbers. */ #define SFLOW_TAG_CTR_IFCOUNTERS 1 +#define SFLOW_TAG_CTR_LACPCOUNTERS 7 +#define SFLOW_TAG_CTR_OPENFLOWPORT 1004 +#define SFLOW_TAG_CTR_PORTNAME 1005 #define SFLOW_TAG_PKT_HEADER 1 #define SFLOW_TAG_PKT_SWITCH 1001 +#define SFLOW_TAG_PKT_TUNNEL4_OUT 1023 +#define SFLOW_TAG_PKT_TUNNEL4_IN 1024 +#define SFLOW_TAG_PKT_TUNNEL_VNI_OUT 1029 +#define SFLOW_TAG_PKT_TUNNEL_VNI_IN 1030 + +/* string sizes */ +#define SFL_MAX_PORTNAME_LEN 255 struct sflow_addr { enum { @@ -100,7 +109,14 @@ struct { uint32_t HEADER; uint32_t SWITCH; + uint32_t TUNNEL4_OUT; + uint32_t TUNNEL4_IN; + uint32_t TUNNEL_VNI_OUT; + uint32_t TUNNEL_VNI_IN; uint32_t IFCOUNTERS; + uint32_t LACPCOUNTERS; + uint32_t OPENFLOWPORT; + uint32_t PORTNAME; } offset; /* Flow sample fields. */ @@ -222,6 +238,63 @@ printf(" promiscuous=%"PRIu32, sflowxdr_next(x)); printf("\n"); } + if (x->offset.LACPCOUNTERS) { + uint8_t *mac; + union { + ovs_be32 all; + struct { + uint8_t actorAdmin; + uint8_t actorOper; + uint8_t partnerAdmin; + uint8_t partnerOper; + } v; + } state; + + sflowxdr_setc(x, x->offset.LACPCOUNTERS); + printf("LACPCOUNTERS"); + mac = (uint8_t *)sflowxdr_str(x); + printf(" sysID="ETH_ADDR_FMT, ETH_ADDR_ARGS(mac)); + sflowxdr_skip(x, 2); + mac = (uint8_t *)sflowxdr_str(x); + printf(" partnerID="ETH_ADDR_FMT, ETH_ADDR_ARGS(mac)); + sflowxdr_skip(x, 2); + printf(" aggID=%"PRIu32, sflowxdr_next(x)); + state.all = sflowxdr_next_n(x); + printf(" actorAdmin=0x%"PRIx32, state.v.actorAdmin); + printf(" actorOper=0x%"PRIx32, state.v.actorOper); + printf(" partnerAdmin=0x%"PRIx32, state.v.partnerAdmin); + printf(" partnerOper=0x%"PRIx32, state.v.partnerOper); + printf(" LACPUDsRx=%"PRIu32, sflowxdr_next(x)); + printf(" markerPDUsRx=%"PRIu32, sflowxdr_next(x)); + printf(" markerRespPDUsRx=%"PRIu32, sflowxdr_next(x)); + printf(" unknownRx=%"PRIu32, sflowxdr_next(x)); + printf(" illegalRx=%"PRIu32, sflowxdr_next(x)); + printf(" LACPUDsTx=%"PRIu32, sflowxdr_next(x)); + printf(" markerPDUsTx=%"PRIu32, sflowxdr_next(x)); + printf(" markerRespPDUsTx=%"PRIu32, sflowxdr_next(x)); + printf("\n"); + } + if (x->offset.OPENFLOWPORT) { + sflowxdr_setc(x, x->offset.OPENFLOWPORT); + printf("OPENFLOWPORT"); + printf(" datapath_id=%"PRIu64, sflowxdr_next_int64(x)); + printf(" port_no=%"PRIu32, sflowxdr_next(x)); + printf("\n"); + } + if (x->offset.PORTNAME) { + uint32_t pnLen; + const char *pnBytes; + char portName[SFL_MAX_PORTNAME_LEN + 1]; + sflowxdr_setc(x, x->offset.PORTNAME); + printf("PORTNAME"); + pnLen = sflowxdr_next(x); + SFLOWXDR_assert(x, (pnLen <= SFL_MAX_PORTNAME_LEN)); + pnBytes = sflowxdr_str(x); + memcpy(portName, pnBytes, pnLen); + portName[pnLen] = '\0'; + printf(" portName=%s", portName); + printf("\n"); + } } static char @@ -252,6 +325,25 @@ return b; } +static void +print_struct_ipv4(struct sflow_xdr *x, const char *prefix) +{ + ovs_be32 src, dst; + + printf(" %s_length=%"PRIu32, prefix, sflowxdr_next(x)); + printf(" %s_protocol=%"PRIu32, prefix, sflowxdr_next(x)); + + src = sflowxdr_next_n(x); + dst = sflowxdr_next_n(x); + printf(" %s_src="IP_FMT, prefix, IP_ARGS(src)); + printf(" %s_dst="IP_FMT, prefix, IP_ARGS(dst)); + + printf(" %s_src_port=%"PRIu32, prefix, sflowxdr_next(x)); + printf(" %s_dst_port=%"PRIu32, prefix, sflowxdr_next(x)); + printf(" %s_tcp_flags=%"PRIu32, prefix, sflowxdr_next(x)); + printf(" %s_tos=%"PRIu32, prefix, sflowxdr_next(x)); +} + #define SFLOW_HEX_SCRATCH 1024 static void @@ -267,6 +359,26 @@ x->agentIPStr, x->dsClass, x->dsIndex); printf(" fsSeqNo=%"PRIu32, x->fsSeqNo); + if (x->offset.TUNNEL4_IN) { + sflowxdr_setc(x, x->offset.TUNNEL4_IN); + print_struct_ipv4(x, "tunnel4_in"); + } + + if (x->offset.TUNNEL4_OUT) { + sflowxdr_setc(x, x->offset.TUNNEL4_OUT); + print_struct_ipv4(x, "tunnel4_out"); + } + + if (x->offset.TUNNEL_VNI_IN) { + sflowxdr_setc(x, x->offset.TUNNEL_VNI_IN); + printf( " tunnel_in_vni=%"PRIu32, sflowxdr_next(x)); + } + + if (x->offset.TUNNEL_VNI_OUT) { + sflowxdr_setc(x, x->offset.TUNNEL_VNI_OUT); + printf( " tunnel_out_vni=%"PRIu32, sflowxdr_next(x)); + } + if (x->offset.SWITCH) { sflowxdr_setc(x, x->offset.SWITCH); printf(" in_vlan=%"PRIu32, sflowxdr_next(x)); @@ -373,6 +485,15 @@ case SFLOW_TAG_CTR_IFCOUNTERS: sflowxdr_mark_unique(x, &x->offset.IFCOUNTERS); break; + case SFLOW_TAG_CTR_LACPCOUNTERS: + sflowxdr_mark_unique(x, &x->offset.LACPCOUNTERS); + break; + case SFLOW_TAG_CTR_PORTNAME: + sflowxdr_mark_unique(x, &x->offset.PORTNAME); + break; + case SFLOW_TAG_CTR_OPENFLOWPORT: + sflowxdr_mark_unique(x, &x->offset.OPENFLOWPORT); + break; /* Add others here... */ } @@ -441,6 +562,22 @@ sflowxdr_mark_unique(x, &x->offset.SWITCH); break; + case SFLOW_TAG_PKT_TUNNEL4_OUT: + sflowxdr_mark_unique(x, &x->offset.TUNNEL4_OUT); + break; + + case SFLOW_TAG_PKT_TUNNEL4_IN: + sflowxdr_mark_unique(x, &x->offset.TUNNEL4_IN); + break; + + case SFLOW_TAG_PKT_TUNNEL_VNI_OUT: + sflowxdr_mark_unique(x, &x->offset.TUNNEL_VNI_OUT); + break; + + case SFLOW_TAG_PKT_TUNNEL_VNI_IN: + sflowxdr_mark_unique(x, &x->offset.TUNNEL_VNI_IN); + break; + /* Add others here... */ } @@ -470,13 +607,13 @@ print_sflow(struct ofpbuf *buf) { char *dgram_buf; - int dgram_len = ofpbuf_size(buf); + int dgram_len = buf->size; struct sflow_xdr xdrDatagram; struct sflow_xdr *x = &xdrDatagram; memset(x, 0, sizeof *x); if (SFLOWXDR_try(x)) { - SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf, ofpbuf_size(buf)))); + SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf, buf->size))); sflowxdr_init(x, dgram_buf, dgram_len); SFLOWXDR_assert(x, dgram_len >= SFLOW_MIN_LEN); process_datagram(x); @@ -497,8 +634,9 @@ int error; int sock; - proctitle_init(argc, argv); + ovs_cmdl_proctitle_init(argc, argv); set_program_name(argv[0]); + service_start(&argc, &argv); parse_options(argc, argv); if (argc - optind != 1) { @@ -507,9 +645,9 @@ } target = argv[optind]; - sock = inet_open_passive(SOCK_DGRAM, target, 0, NULL, 0); + sock = inet_open_passive(SOCK_DGRAM, target, 0, NULL, 0, true); if (sock < 0) { - ovs_fatal(0, "%s: failed to open (%s)", argv[1], ovs_strerror(-sock)); + ovs_fatal(0, "%s: failed to open (%s)", target, ovs_strerror(-sock)); } daemon_save_fd(STDOUT_FILENO); @@ -531,7 +669,7 @@ ofpbuf_clear(&buf); do { - retval = read(sock, ofpbuf_data(&buf), buf.allocated); + retval = recv(sock, buf.data, buf.allocated, 0); } while (retval < 0 && errno == EINTR); if (retval > 0) { ofpbuf_put_uninit(&buf, retval); @@ -563,7 +701,7 @@ VLOG_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { int c = getopt_long(argc, argv, short_options, long_options, NULL); diff -Nru openvswitch-2.3.1/tests/test-sha1.c openvswitch-2.4.0~git20150623/tests/test-sha1.c --- openvswitch-2.3.1/tests/test-sha1.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-sha1.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,17 +15,16 @@ */ #include +#undef NDEBUG #include "sha1.h" +#include #include #include #include #include +#include "ovstest.h" #include "random.h" #include "util.h" -#include "ovstest.h" - -#undef NDEBUG -#include struct test_vector { char *data; diff -Nru openvswitch-2.3.1/tests/test-stp.c openvswitch-2.4.0~git20150623/tests/test-stp.c --- openvswitch-2.3.1/tests/test-stp.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-stp.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,7 +15,7 @@ */ #include - +#undef NDEBUG #include "stp.h" #include #include @@ -23,10 +23,11 @@ #include #include #include +#include "dp-packet.h" #include "ofpbuf.h" -#include "packets.h" -#include "vlog.h" #include "ovstest.h" +#include "packets.h" +#include "openvswitch/vlog.h" struct bpdu { int port_no; @@ -85,7 +86,7 @@ } static void -send_bpdu(struct ofpbuf *pkt, int port_no, void *b_) +send_bpdu(struct dp_packet *pkt, int port_no, void *b_) { struct bridge *b = b_; struct lan *lan; @@ -93,8 +94,8 @@ assert(port_no < b->n_ports); lan = b->ports[port_no]; if (lan) { - const void *data = ofpbuf_l3(pkt); - size_t size = (char *) ofpbuf_tail(pkt) - (char *) data; + const void *data = dp_packet_l3(pkt); + size_t size = (char *) dp_packet_tail(pkt) - (char *) data; int i; for (i = 0; i < lan->n_conns; i++) { @@ -109,7 +110,7 @@ } } } - ofpbuf_delete(pkt); + dp_packet_delete(pkt); } static struct bridge * @@ -316,10 +317,9 @@ } } -static void +OVS_NO_RETURN static void err(const char *message, ...) - PRINTF_FORMAT(1, 2) - NO_RETURN; + OVS_PRINTF_FORMAT(1, 2); static void err(const char *message, ...) @@ -337,7 +337,7 @@ static void warn(const char *message, ...) - PRINTF_FORMAT(1, 2); + OVS_PRINTF_FORMAT(1, 2); static void warn(const char *message, ...) @@ -666,6 +666,7 @@ free(bridge); } free(tc); + fclose(input_file); } OVSTEST_REGISTER("test-stp", test_stp_main); diff -Nru openvswitch-2.3.1/tests/testsuite openvswitch-2.4.0~git20150623/tests/testsuite --- openvswitch-2.3.1/tests/testsuite 2014-12-04 06:00:53.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/testsuite 1970-01-01 00:00:00.000000000 +0000 @@ -1,236298 +0,0 @@ -#! /bin/sh -# Generated from tests/testsuite.at by GNU Autoconf 2.68. -# -# Copyright (C) 2009, 2010 Free Software Foundation, Inc. -# -# This test suite is free software; the Free Software Foundation gives -# unlimited permission to copy, distribute and modify it. -# -# Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - - - -SHELL=${CONFIG_SHELL-/bin/sh} - -# How were we run? -at_cli_args="$@" - - -# Not all shells have the 'times' builtin; the subshell is needed to make -# sure we discard the 'times: not found' message from the shell. -at_times_p=false -(times) >/dev/null 2>&1 && at_times_p=: - -# CLI Arguments to pass to the debugging scripts. -at_debug_args= -# -e sets to true -at_errexit_p=false -# Shall we be verbose? ':' means no, empty means yes. -at_verbose=: -at_quiet= -# Running several jobs in parallel, 0 means as many as test groups. -at_jobs=1 -at_traceon=: -at_trace_echo=: -at_check_filter_trace=: - -# Shall we keep the debug scripts? Must be `:' when the suite is -# run by a debug script, so that the script doesn't remove itself. -at_debug_p=false -# Display help message? -at_help_p=false -# Display the version message? -at_version_p=false -# List test groups? -at_list_p=false -# --clean -at_clean=false -# Test groups to run -at_groups= -# Whether to rerun failed tests. -at_recheck= -# Whether a write failure occurred -at_write_fail=0 - -# The directory we run the suite in. Default to . if no -C option. -at_dir=`pwd` -# An absolute reference to this testsuite script. -case $as_myself in - [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;; - * ) at_myself=$at_dir/$as_myself ;; -esac -# Whether -C is in effect. -at_change_dir=false - -# Whether to enable colored test results. -at_color=no -# List of the tested programs. -at_tested='ovs-vswitchd -ovs-vsctl -perl' -# As many question marks as there are digits in the last test group number. -# Used to normalize the test group numbers so that `ls' lists them in -# numerical order. -at_format='????' -# Description of all the test groups. -at_help_all="1;bfd.at:45;bfd - basic config on different bridges;; -2;bfd.at:87;bfd - Verify tunnel down detection;; -3;bfd.at:167;bfd - concatenated path down;; -4;bfd.at:194;bfd - Edit the Min Tx/Rx values;; -5;bfd.at:225;bfd - check_tnl_key;; -6;bfd.at:260;bfd - bfd decay;; -7;bfd.at:407;bfd - bfd forwarding_if_rx - bfd on one side;; -8;bfd.at:451;bfd - bfd forwarding_if_rx - bfd on both sides;; -9;bfd.at:516;bfd - bfd forwarding_if_rx - with bfd decay;; -10;bfd.at:603;bfd - bfd forwarding_if_rx - demand_rx_bfd;; -11;bfd.at:673;bfd - flap_count;; -12;cfm.at:49;cfm - check update ovsdb 1;; -13;cfm.at:78;cfm - check update ovsdb 2;; -14;cfm.at:112;cfm - demand mode;; -15;cfm.at:154;cfm - demand_rx_ccm;; -16;cfm.at:216;cfm - flap_count;; -17;cfm.at:249;cfm - fault_override;; -18;lacp.at:13;lacp - config;; -19;lacp.at:55;lacp - multi port config;; -20;lacp.at:143;lacp - negotiation;; -21;library.at:3;test flow extractor;; -22;library.at:9;test TCP/IP checksumming;; -23;library.at:14;test hash functions;; -24;library.at:18;test hash map;; -25;library.at:23;test hash index;; -26;library.at:28;test atomic operations;; -27;library.at:32;test linked lists;; -28;library.at:37;test packet library;; -29;library.at:41;test SHA-1;; -30;library.at:46;test type properties;; -31;library.at:50;test strtok_r bug fix;; -32;library.at:55;test byte order conversion;byte order; -33;library.at:60;test random number generator;; -34;library.at:112;ctz() function;ctz; -35;library.at:112;clz() function;clz; -36;library.at:112;round_up_pow2() function;round_up_pow2; -37;library.at:112;round_down_pow2() function;round_down_pow2; -38;library.at:112;count_1bits() function;count_1bits; -39;library.at:112;log_2_floor() function;log_2_floor; -40;library.at:112;bitwise_copy() function;bitwise_copy; -41;library.at:112;bitwise_zero() function;bitwise_zero; -42;library.at:112;bitwise_one() function;bitwise_one; -43;library.at:112;bitwise_is_all_zeros() function;bitwise_is_all_zeros; -44;library.at:112;ovs_scan() function;ovs_scan; -45;library.at:130;test unix socket, short pathname - C;; -46;library.at:140;test unix socket, long pathname - C;; -47;library.at:149;test unix socket, short pathname - Python;; -48;library.at:159;test unix socket, long pathname - Python;; -49;library.at:168;ovs_assert;; -50;library.at:187;snprintf;; -51;heap.at:8;heap library -- insert delete same order;; -52;heap.at:9;heap library -- insert delete reverse order;; -53;heap.at:10;heap library -- insert delete every order;; -54;heap.at:11;heap library -- insert delete same order with dups;; -55;heap.at:12;heap library -- raw insert;; -56;heap.at:13;heap library -- raw delete;; -57;bundle.at:10;hrw bundle link selection;; -58;bundle.at:80;active_backup bundle link selection;; -59;bundle.at:151;hrw bundle single link selection;; -60;bundle.at:159;hrw bundle no link selection;; -61;bundle.at:166;bundle action missing argument;; -62;bundle.at:172;bundle action bad fields;; -63;bundle.at:178;bundle action bad algorithm;; -64;bundle.at:184;bundle action bad slave type;; -65;bundle.at:190;bundle action bad slave delimiter;; -66;classifier.at:2;flow classifier - empty;; -67;classifier.at:2;flow classifier - destroy null;; -68;classifier.at:2;flow classifier - single rule;; -69;classifier.at:2;flow classifier - rule replacement;; -70;classifier.at:2;flow classifier - many rules in one list;; -71;classifier.at:2;flow classifier - many rules in one table;; -72;classifier.at:2;flow classifier - many rules in two tables;; -73;classifier.at:2;flow classifier - many rules in five tables;; -74;classifier.at:17;miniflow - miniflow;; -75;classifier.at:17;miniflow - minimask_has_extra;; -76;classifier.at:17;miniflow - minimask_combine;; -77;classifier.at:27;flow classifier - lookup segmentation;; -78;classifier.at:65;flow classifier - prefix lookup;; -79;check-structs.at:11;check struct tail padding;check-structs; -80;check-structs.at:21;check struct internal alignment;check-structs; -81;check-structs.at:32;check struct declared size;check-structs; -82;check-structs.at:44;check wrong struct's declared size;check-structs; -83;daemon.at:3;daemon;; -84;daemon.at:21;daemon --monitor;; -85;daemon.at:69;daemon --detach;; -86;daemon.at:85;daemon --detach --monitor;; -87;daemon.at:134;daemon --detach startup errors;; -88;daemon.at:143;daemon --detach --monitor startup errors;; -89;daemon-py.at:3;daemon - Python;; -90;daemon-py.at:21;daemon --monitor - Python;; -91;daemon-py.at:64;daemon --monitor restart exit code - Python;; -92;daemon-py.at:107;daemon --detach - Python;; -93;daemon-py.at:123;daemon --detach --monitor - Python;; -94;daemon-py.at:172;daemon --detach startup errors - Python;; -95;daemon-py.at:181;daemon --detach --monitor startup errors - Python;; -96;daemon-py.at:190;daemon --detach closes standard fds - Python;; -97;daemon-py.at:210;daemon --detach --monitor closes standard fds;; -98;ofp-actions.at:3;OpenFlow 1.0 action translation;ofp-actions of1.0; -99;ofp-actions.at:132;OpenFlow 1.1 action translation;ofp-actions of1.1; -100;ofp-actions.at:310;OpenFlow 1.1 instruction translation;of1.1 instruction ofp-actions; -101;ofp-actions.at:481;ofp-actions - inconsistent MPLS actions;; -102;ofp-print.at:3;empty;ofp-print; -103;ofp-print.at:9;too short;ofp-print; -104;ofp-print.at:17;wrong OpenFlow version;ofp-print; -105;ofp-print.at:27;truncated message;ofp-print; -106;ofp-print.at:35;message only uses part of buffer;ofp-print; -107;ofp-print.at:44;OFPT_HELLO - ordinary;ofp-print; -108;ofp-print.at:52;OFPT_HELLO with extra data;ofp-print; -109;ofp-print.at:64;OFPT_HELLO with version bitmap;ofp-print; -110;ofp-print.at:73;OFPT_HELLO with version bitmap and extra data;ofp-print; -111;ofp-print.at:87;OFPT_HELLO with higher than supported version;ofp-print; -112;ofp-print.at:106;OFPT_HELLO with contradictory version bitmaps;ofp-print; -113;ofp-print.at:148;OFPT_ECHO_REQUEST, empty payload;ofp-print; -114;ofp-print.at:155;OFPT_ECHO_REQUEST, 5-byte payload;ofp-print; -115;ofp-print.at:163;OFPT_ECHO_REPLY, empty payload;ofp-print; -116;ofp-print.at:170;OFPT_ECHO_REPLY, 5-byte payload;ofp-print; -117;ofp-print.at:178;OFPT_FEATURES_REQUEST;ofp-print; -118;ofp-print.at:185;OFPT_FEATURES_REPLY - OF1.0;ofp-print; -119;ofp-print.at:235;OFPT_FEATURES_REPLY cut off mid-port - OF1.0;ofp-print; -120;ofp-print.at:274;OFPT_FEATURES_REPLY - OF1.1;ofp-print; -121;ofp-print.at:305;OFPT_FEATURES_REPLY cut off mid-port - OF1.1;ofp-print; -122;ofp-print.at:334;OFPT_FEATURES_REPLY - OF1.2;ofp-print; -123;ofp-print.at:365;OFPT_FEATURES_REPLY cut off mid-port - OF1.2;ofp-print; -124;ofp-print.at:394;OFPT_FEATURES_REPLY - OF1.3;ofp-print; -125;ofp-print.at:406;OFPT_FEATURES_REPLY - with auxiliary_id - OF1.3;ofp-print; -126;ofp-print.at:418;OFPT_GET_CONFIG_REQUEST;ofp-print; -127;ofp-print.at:425;OFPT_GET_CONFIG_REPLY, most common form;ofp-print; -128;ofp-print.at:433;OFPT_GET_CONFIG_REPLY, frags and miss_send_len;ofp-print; -129;ofp-print.at:440;OFPT_PACKET_IN - OF1.0;ofp-print; -130;ofp-print.at:454;OFPT_PACKET_IN - OF1.0, with hex output of packet data;ofp-print; -131;ofp-print.at:472;OFPT_PACKET_IN - OF1.1;ofp-print; -132;ofp-print.at:487;OFPT_PACKET_IN - OF1.2;ofp-print; -133;ofp-print.at:501;OFPT_PACKET_IN - OF1.2, with hex output of packet data;ofp-print; -134;ofp-print.at:518;OFPT_PACKET_IN - OF1.3;ofp-print; -135;ofp-print.at:533;OFPT_PACKET_IN - OF1.3, with hex output of packet data;ofp-print; -136;ofp-print.at:551;OFPT_FLOW_REMOVED - OF1.0;ofp-print; -137;ofp-print.at:565;OFPT_FLOW_REMOVED - OF1.2;ofp-print; -138;ofp-print.at:576;OFPT_FLOW_REMOVED - OF1.3;ofp-print; -139;ofp-print.at:587;OFPT_PORT_STATUS - OF1.0;ofp-print; -140;ofp-print.at:605;OFPT_PORT_STATUS - OF1.1;ofp-print; -141;ofp-print.at:624;OFPT_PORT_STATUS - OF1.4;ofp-print; -142;ofp-print.at:644;OFPT_PACKET_OUT - OF1.0;ofp-print; -143;ofp-print.at:658;OFPT_PACKET_OUT - OF1.0, with packet;ofp-print; -144;ofp-print.at:673;OFPT_PACKET_OUT - OF1.0, with hex output of packet data;ofp-print; -145;ofp-print.at:692;OFPT_PACKET_OUT - OF1.1;ofp-print; -146;ofp-print.at:703;OFPT_PACKET_OUT - OF1.1, with packet;ofp-print; -147;ofp-print.at:720;OFPT_FLOW_MOD - OF1.0 - low verbosity;ofp-print; -148;ofp-print.at:738;OFPT_FLOW_MOD - OF1.1 - low verbosity;ofp-print; -149;ofp-print.at:758;OFPT_FLOW_MOD - OF1.2 - low verbosity;ofp-print; -150;ofp-print.at:778;OFPT_FLOW_MOD - OF1.0 - high verbosity;ofp-print; -151;ofp-print.at:796;OFPT_FLOW_MOD - OF1.2 - low verbosity;ofp-print; -152;ofp-print.at:815;OFPT_FLOW_MOD - OF1.3 - flags - low verbosity;ofp-print; -153;ofp-print.at:833;OFPT_FLOW_MOD - OF1.2 - set-field ip_src;ofp-print; -154;ofp-print.at:848;OFPT_FLOW_MOD - OF1.2 - set-field ip_dst;ofp-print; -155;ofp-print.at:863;OFPT_FLOW_MOD - OF1.2 - set-field sctp_src;ofp-print; -156;ofp-print.at:878;OFPT_FLOW_MOD - OF1.2 - set-field sctp_dst;ofp-print; -157;ofp-print.at:894;OFPT_FLOW_MOD - OF1.3 - meter;ofp-print; -158;ofp-print.at:905;OFPT_FLOW reply - OF1.2 - set-field ip_src;ofp-print; -159;ofp-print.at:922;OFPT_FLOW reply - OF1.2 - set-field ip_dst;ofp-print; -160;ofp-print.at:939;OFPT_FLOW reply - OF1.2 - set-field sctp_src;ofp-print; -161;ofp-print.at:956;OFPT_FLOW reply - OF1.2 - set-field sctp_dst;ofp-print; -162;ofp-print.at:973;OFPT_PORT_MOD - OF1.0;ofp-print; -163;ofp-print.at:986;OFPT_PORT_MOD - OF1.1;ofp-print; -164;ofp-print.at:1000;OFPT_PORT_MOD - OF1.2;ofp-print; -165;ofp-print.at:1014;OFPT_PORT_MOD - OF1.3;ofp-print; -166;ofp-print.at:1028;OFPT_PORT_MOD - OF1.4;ofp-print; -167;ofp-print.at:1042;OFPT_TABLE_MOD - OF1.1;ofp-print; -168;ofp-print.at:1051;OFPT_TABLE_MOD - OF1.2;ofp-print; -169;ofp-print.at:1061;OFPT_TABLE_MOD - OF1.3;ofp-print; -170;ofp-print.at:1070;OFPT_TABLE_MOD - OF1.4;ofp-print; -171;ofp-print.at:1079;OFPST_DESC request;ofp-print ofpt_stats_request; -172;ofp-print.at:1086;OFPST_DESC reply;ofp-print ofpt_stats_reply; -173;ofp-print.at:1166;OFPST_FLOW request - OF1.0;ofp-print ofpt_stats_request; -174;ofp-print.at:1178;OFPST_FLOW request - OF1.2;ofp-print ofpt_stats_request; -175;ofp-print.at:1190;OFPST_FLOW request - OF1.3;ofp-print ofpt_stats_request; -176;ofp-print.at:1202;OFPST_FLOW reply - OF1.0;ofp-print ofpt_stats_reply; -177;ofp-print.at:1246;OFPST_FLOW reply - OF1.2;ofp-print ofpt_stats_reply; -178;ofp-print.at:1281;OFPST_AGGREGATE request - OF1.0;ofp-print ofpt_stats_request; -179;ofp-print.at:1293;OFPST_AGGREGATE request - OF1.2;ofp-print ofpt_stats_request; -180;ofp-print.at:1305;OFPST_AGGREGATE request - OF1.3;ofp-print ofpt_stats_request; -181;ofp-print.at:1317;OFPST_AGGREGATE reply - OF1.0;ofp-print ofpt_stats_reply; -182;ofp-print.at:1328;OFPST_AGGREGATE reply - OF1.2;ofp-print ofpt_stats_reply; -183;ofp-print.at:1339;OFPST_AGGREGATE reply - OF1.3;ofp-print ofpt_stats_reply; -184;ofp-print.at:1350;OFPST_TABLE request - OF1.0;ofp-print ofpt_stats_request; -185;ofp-print.at:1357;OFPST_TABLE request - OF1.1;ofp-print ofpt_stats_request; -186;ofp-print.at:1364;OFPST_TABLE request - OF1.2;ofp-print ofpt_stats_request; -187;ofp-print.at:1371;OFPST_TABLE request - OF1.3;ofp-print ofpt_stats_request; -188;ofp-print.at:1378;OFPST_TABLE reply - OF1.0;ofp-print ofpt_stats_reply; -189;ofp-print.at:1393;OFPST_TABLE reply - OF1.2;ofp-print ofpt_stats_reply; -190;ofp-print.at:1448;OFPST_TABLE reply - OF1.3;ofp-print ofpt_stats_reply; -191;ofp-print.at:1462;OFPST_PORT request - 1.0;ofp-print ofpt_stats_request; -192;ofp-print.at:1472;OFPST_PORT request - 1.1;ofp-print ofpt_stats_request; -193;ofp-print.at:1482;OFPST_PORT request - 1.2;ofp-print ofpt_stats_request; -194;ofp-print.at:1492;OFPST_PORT request - 1.3;ofp-print ofpt_stats_request; -195;ofp-print.at:1502;OFPST_PORT reply - OF1.0;ofp-print ofpt_stats_reply; -196;ofp-print.at:1545;OFPST_PORT reply - OF1.2;ofp-print ofpt_stats_reply; -197;ofp-print.at:1580;OFPST_PORT reply - OF1.3;ofp-print ofpt_stats_reply; -198;ofp-print.at:1619;OFPST_PORT reply - OF1.4;ofp-print ofpt_stats_reply; -199;ofp-print.at:1639;OFPST_QUEUE request - OF1.0;ofp-print ofpt_stats_request; -200;ofp-print.at:1649;OFPST_QUEUE request - OF1.1;ofp-print ofpt_stats_request; -201;ofp-print.at:1659;OFPST_QUEUE request - OF1.2;ofp-print ofpt_stats_request; -202;ofp-print.at:1669;OFPST_QUEUE request - OF1.3;ofp-print ofpt_stats_request; -203;ofp-print.at:1679;OFPST_QUEUE reply - OF1.0;ofp-print ofpt_stats_reply; -204;ofp-print.at:1706;OFPST_QUEUE reply - OF1.1;ofp-print ofpt_stats_reply; -205;ofp-print.at:1733;OFPST_QUEUE reply - OF1.2;ofp-print ofpt_stats_reply; -206;ofp-print.at:1760;OFPST_QUEUE reply - OF1.3;ofp-print ofpt_stats_reply; -207;ofp-print.at:1793;OFPST_QUEUE reply - OF1.4;ofp-print ofpt_stats_reply; -208;ofp-print.at:1827;OFPST_GROUP request;ofp-print ofpt_stats_request; -209;ofp-print.at:1836;OFPST_GROUP reply - OF1.1;ofp-print ofpt_stats_reply; -210;ofp-print.at:1856;OFPST_GROUP reply - OF1.3;ofp-print ofpt_stats_reply; -211;ofp-print.at:1878;OFPST_GROUP_DESC request - OF1.1;ofp-print ofpt_stats_request; -212;ofp-print.at:1886;OFPST_GROUP_DESC request - OF1.5;ofp-print ofpt_stats_request; -213;ofp-print.at:1895;OFPST_GROUP_DESC reply;ofp-print ofpt_stats_request; -214;ofp-print.at:1912;OFPST_GROUP_FEATURES request;ofp-print ofpt_stats_request; -215;ofp-print.at:1920;OFPST_GROUP_FEATURES reply;ofp-print ofpt_stats_reply; -216;ofp-print.at:1943;OFPST_PORT_DESC request - OF1.0;ofp-print ofpt_stats_request; -217;ofp-print.at:1950;OFPST_PORT_DESC request - OF1.5;ofp-print ofpt_stats_request; -218;ofp-print.at:1959;OFPST_PORT_DESC reply - OF1.0;ofp-print ofpt_stats_reply; -219;ofp-print.at:1978;OFPST_PORT_DESC reply - OF1.4;ofp-print ofpt_stats_reply; -220;ofp-print.at:1999;OFPT_METER_MOD request - OF1.3;ofp-print; -221;ofp-print.at:2010;OFPT_METER_MOD request - bad band - OF1.3;ofp-print; -222;ofp-print.at:2020;OFPT_METER_MOD request - bad command - OF1.3;ofp-print; -223;ofp-print.at:2029;OFPT_METER_MOD request - bad flags - OF1.3;ofp-print; -224;ofp-print.at:2039;OFPST_METER request - OF1.3;ofp-print ofpt_stats_request; -225;ofp-print.at:2046;OFPST_METER_CONFIG request - OF1.3;ofp-print ofpt_stats_request; -226;ofp-print.at:2053;OFPST_METER_FEATURES request - OF1.3;ofp-print ofpt_stats_request; -227;ofp-print.at:2060;OFPST_METER_FEATURES reply - OF1.3;ofp-print ofpt_stats_reply; -228;ofp-print.at:2073;OFPST_METER_CONFIG reply - OF1.3;ofp-print ofpt_stats_reply; -229;ofp-print.at:2093;OFPST_METER reply - OF1.3;ofp-print ofpt_stats_reply; -230;ofp-print.at:2117;OFPST_TABLE_FEATURES request - OF1.3;ofp-print ofpt_stats_request; -231;ofp-print.at:2338;OFPT_BARRIER_REQUEST - OF1.0;ofp-print; -232;ofp-print.at:2345;OFPT_BARRIER_REQUEST - OF1.1;ofp-print; -233;ofp-print.at:2352;OFPT_BARRIER_REQUEST - OF1.2;ofp-print; -234;ofp-print.at:2359;OFPT_BARRIER_REQUEST - OF1.3;ofp-print; -235;ofp-print.at:2366;OFPT_BARRIER_REPLY - OF1.0;ofp-print; -236;ofp-print.at:2373;OFPT_BARRIER_REPLY - OF1.1;ofp-print; -237;ofp-print.at:2380;OFPT_BARRIER_REPLY - OF1.2;ofp-print; -238;ofp-print.at:2387;OFPT_BARRIER_REPLY - OF1.3;ofp-print; -239;ofp-print.at:2394;OFPT_QUEUE_GET_CONFIG_REQUEST - OF1.0;ofp-print; -240;ofp-print.at:2401;OFPT_QUEUE_GET_CONFIG_REQUEST - OF1.2;ofp-print; -241;ofp-print.at:2409;OFPT_QUEUE_GET_CONFIG_REPLY - OF1.0;ofp-print; -242;ofp-print.at:2424;OFPT_QUEUE_GET_CONFIG_REPLY - OF1.2;ofp-print; -243;ofp-print.at:2439;OFPT_SET_ASYNC - OF1.3;ofp-print; -244;ofp-print.at:2458;OFPT_ROLE_REQUEST - OF1.2;ofp-print; -245;ofp-print.at:2468;OFPT_ROLE_REQUEST - nochange - OF1.2;ofp-print; -246;ofp-print.at:2478;NXT_ROLE_REQUEST;ofp-print; -247;ofp-print.at:2488;OFPT_ROLE_REPLY - OF1.2;ofp-print; -248;ofp-print.at:2498;NXT_ROLE_REPLY;ofp-print; -249;ofp-print.at:2508;OFP_ROLE_STATUS - master, experimenter - OF1.4;ofp-print; -250;ofp-print.at:2518;OFP_ROLE_STATUS - master, config - OF1.4;ofp-print; -251;ofp-print.at:2528;OFP_ROLE_STATUS - master, config,generation - OF1.4;ofp-print; -252;ofp-print.at:2538;NXT_SET_PACKET_IN;ofp-print; -253;ofp-print.at:2548;NXT_PACKET_IN;ofp-print; -254;ofp-print.at:2569;NXT_PACKET_IN, with hex output of packet data;ofp-print; -255;ofp-print.at:2594;NXT_SET_ASYNC_CONFIG;ofp-print; -256;ofp-print.at:2614;NXT_SET_CONTROLLER_ID;ofp-print; -257;ofp-print.at:2624;NXT_FLOW_MONITOR_CANCEL;ofp-print; -258;ofp-print.at:2634;NXT_FLOW_MONITOR_PAUSED;ofp-print; -259;ofp-print.at:2643;NXT_FLOW_MONITOR_RESUMED;ofp-print; -260;ofp-print.at:2652;NXT_SET_FLOW_FORMAT;ofp-print; -261;ofp-print.at:2663;NXT_FLOW_MOD, low verbosity;ofp-print; -262;ofp-print.at:2679;NXT_FLOW_MOD, high verbosity;ofp-print; -263;ofp-print.at:2693;OFPT_GROUP_MOD;ofp-print; -264;ofp-print.at:2709;NXT_FLOW_REMOVED;ofp-print; -265;ofp-print.at:2725;NXT_FLOW_MOD_TABLE_ID;ofp-print; -266;ofp-print.at:2735;NXST_FLOW request;ofp-print ofpt_stats_request; -267;ofp-print.at:2745;NXST_FLOW reply;ofp-print ofpt_stats_reply; -268;ofp-print.at:2899;NXST_AGGREGATE request;ofp-print ofpt_stats_request; -269;ofp-print.at:2909;NXST_AGGREGATE reply;ofp-print ofpt_stats_reply; -270;ofp-print.at:2920;NXST_FLOW_MONITOR request;ofp-print ofpt_stats_reply; -271;ofp-print.at:2933;NXST_FLOW_MONITOR reply;ofp-print ofpt_stats_reply; -272;ofp-print.at:2948;OFPT_BUNDLE_CONTROL - OPEN_REQUEST;ofp-print; -273;ofp-print.at:2959;OFPT_BUNDLE_CONTROL - OPEN_REQUEST;ofp-print; -274;ofp-print.at:2970;OFPT_BUNDLE_CONTROL - OPEN_REQUEST;ofp-print; -275;ofp-print.at:2981;OFPT_BUNDLE_CONTROL - OPEN_REPLY;ofp-print; -276;ofp-print.at:2992;OFPT_BUNDLE_CONTROL - CLOSE_REQUEST;ofp-print; -277;ofp-print.at:3003;OFPT_BUNDLE_CONTROL - CLOSE_REPLY;ofp-print; -278;ofp-print.at:3014;OFPT_BUNDLE_CONTROL - COMMIT_REQUEST;ofp-print; -279;ofp-print.at:3025;OFPT_BUNDLE_CONTROL - COMMIT_REPLY;ofp-print; -280;ofp-print.at:3036;OFPT_BUNDLE_CONTROL - DISCARD_REQUEST;ofp-print; -281;ofp-print.at:3047;OFPT_BUNDLE_CONTROL - DISCARD_REPLY;ofp-print; -282;ofp-print.at:3058;OFPT_BUNDLE_ADD_MESSAGE - OFPT_HELLO;ofp-print; -283;ofp-util.at:3;encoding hellos;; -284;ofp-errors.at:3;OFPT_ERROR with type OFPET_HELLO_FAILED - OF1.0;ofp-print ofp-errors; -285;ofp-errors.at:11;OFPT_ERROR with type OFPET_HELLO_FAILED - OF1.1;ofp-print ofp-errors; -286;ofp-errors.at:19;OFPT_ERROR with type OFPET_BAD_REQUEST - OF1.0;ofp-print ofp-errors; -287;ofp-errors.at:29;OFPT_ERROR prints type of truncated inner messages;ofp-print ofp-errors; -288;ofp-errors.at:46;OFPT_ERROR with code OFPBMC_BAD_PREREQ - OF1.0;ofp-print ofp-errors; -289;ofp-errors.at:54;OFPT_ERROR with code OFPBMC_BAD_PREREQ - OF1.1;ofp-print ofp-errors; -290;ofp-errors.at:64;OFPT_ERROR with type OFPFMFC_OVERLAP - OF1.0;ofp-print ofp-errors; -291;ofp-errors.at:73;OFPT_ERROR with type OFPBIC_UNSUP_INST - OF1.1;ofp-print ofp-errors; -292;ofp-errors.at:87;encoding OFPBIC_* experimenter errors;ofp-print ofp-errors; -293;ofp-errors.at:107;encoding errors extension that became official;ofp-print ofp-errors; -294;ofp-errors.at:126;decoding OFPBIC_* experimenter errors;ofp-print ofp-errors; -295;ofp-errors.at:142;decoding experimenter errors;ofp-print ofp-errors; -296;ofp-errors.at:158;encoding experimenter errors;ofp-print ofp-errors; -297;ovs-ofctl.at:3;ovs-ofctl parse-flows choice of protocol;; -298;ovs-ofctl.at:128;ovs-ofctl parse-flows (OpenFlow 1.0);; -299;ovs-ofctl.at:165;ovs-ofctl parse-flows (OpenFlow 1.1);; -300;ovs-ofctl.at:202;ovs-ofctl parse-flows (OpenFlow 1.2);; -301;ovs-ofctl.at:247;ovs-ofctl parse-flow with invalid mask;; -302;ovs-ofctl.at:286;ovs-ofctl action inconsistency (OpenFlow 1.1);; -303;ovs-ofctl.at:292;ovs-ofctl parse-flows (With Tunnel-Parameters);; -304;ovs-ofctl.at:304;ovs-ofctl parse-flows (skb_priority);; -305;ovs-ofctl.at:316;ovs-ofctl parse-flows (NXM);; -306;ovs-ofctl.at:387;ovs-ofctl -F nxm parse-flows;; -307;ovs-ofctl.at:454;ovs-ofctl -F nxm -mmm parse-flows;; -308;ovs-ofctl.at:519;ovs-ofctl parse-nx-match;nx-match; -309;ovs-ofctl.at:1120;ovs-ofctl parse-ofp10-match;of1.0; -310;ovs-ofctl.at:1335;ovs-ofctl parse-ofp11-match;of1.1; -311;ovs-ofctl.at:1661;ovs-ofctl parse-nx-match loose;nx-match; -312;ovs-ofctl.at:1676;ovs-ofctl parse-oxm;oxm; -313;ovs-ofctl.at:2120;ovs-ofctl parse-oxm loose;oxm; -314;ovs-ofctl.at:2135;check TCP flags expression in OXM and NXM;; -315;ovs-ofctl.at:2161;ovs-ofctl check-vlan;vlan; -316;ovs-ofctl.at:2258;ovs-ofctl -F option and NXM features;; -317;ovs-ofctl.at:2271;ovs-ofctl -F option with flow_mods;; -318;ovs-ofctl.at:2283;ovs-ofctl dump-flows honors -F option;; -319;ovs-ofctl.at:2295;ovs-ofctl dump-flows rejects bad -F option;; -320;ovs-ofctl.at:2304;ovs-ofctl add-flow reports non-normalized flows;; -321;ovs-ofctl.at:2318;ovs-ofctl dump-flows with sorting;sort; -322;ovs-ofctl.at:2405;ovs-ofctl diff-flows;; -323;ovs-ofctl.at:2437;ovs-ofctl diff-flows - suppress false differences;; -324;ovs-ofctl.at:2454;ovs-ofctl -F and -O interaction;; -325;ovs-ofctl.at:2475;ovs-ofctl ofp-parse;; -326;ovs-ofctl.at:2493;tcp flags - filtering;; -327;odp.at:3;OVS datapath key parsing and formatting - valid forms;; -328;odp.at:98;OVS datapath wildcarded key parsing and formatting - valid forms;; -329;odp.at:164;OVS datapath wildcarded key filtering.;; -330;odp.at:229;OVS datapath actions parsing and formatting - valid forms;; -331;multipath.at:10;modulo_n multipath link selection;; -332;multipath.at:78;hash_threshold multipath link selection;; -333;multipath.at:146;hrw multipath link selection;; -334;multipath.at:214;iter_hash multipath link selection;; -335;multipath.at:282;multipath action missing argument;; -336;multipath.at:288;multipath action bad fields;; -337;multipath.at:294;multipath action bad algorithm;; -338;multipath.at:300;multipath action bad n_links;; -339;multipath.at:306;multipath action destination too narrow;; -340;learn.at:3;learning action - parsing and formatting;; -341;learn.at:18;learning action - parsing and formatting - illegal in_port_oxm;; -342;learn.at:27;learning action - parsing and formatting - OXM;; -343;learn.at:40;learning action - examples;; -344;learn.at:58;learning action - satisfied prerequisites;; -345;learn.at:73;learning action - invalid prerequisites;; -346;learn.at:88;learning action - standard VLAN+MAC learning;; -347;learn.at:157;learning action - learn refreshes hard_age;; -348;learn.at:227;learning action - TCPv4 port learning;; -349;learn.at:253;learning action - TCPv6 port learning;; -350;learn.at:285;learning action - self-modifying flow;; -351;learn.at:327;learning action - self-modifying flow with idle_timeout;; -352;learn.at:385;learning action - self-modifying flow with hard_timeout;; -353;learn.at:469;learning action - fin_timeout feature;; -354;vconn.at:21;unix vconn - refuse connection;; -355;vconn.at:21;unix vconn - accept then close;; -356;vconn.at:21;unix vconn - read hello;; -357;vconn.at:21;unix vconn - send plain hello;; -358;vconn.at:21;unix vconn - send long hello;; -359;vconn.at:21;unix vconn - send echo hello;; -360;vconn.at:21;unix vconn - send short hello;; -361;vconn.at:21;unix vconn - send invalid version hello;; -362;vconn.at:22;tcp vconn - refuse connection;; -363;vconn.at:22;tcp vconn - accept then close;; -364;vconn.at:22;tcp vconn - read hello;; -365;vconn.at:22;tcp vconn - send plain hello;; -366;vconn.at:22;tcp vconn - send long hello;; -367;vconn.at:22;tcp vconn - send echo hello;; -368;vconn.at:22;tcp vconn - send short hello;; -369;vconn.at:22;tcp vconn - send invalid version hello;; -370;vconn.at:23;ssl vconn - refuse connection;; -371;vconn.at:23;ssl vconn - accept then close;; -372;vconn.at:23;ssl vconn - read hello;; -373;vconn.at:23;ssl vconn - send plain hello;; -374;vconn.at:23;ssl vconn - send long hello;; -375;vconn.at:23;ssl vconn - send echo hello;; -376;vconn.at:23;ssl vconn - send short hello;; -377;vconn.at:23;ssl vconn - send invalid version hello;; -378;file_name.at:12;components of \"/usr/lib\" are \"/usr\", \"lib\";dir_name base_name; -379;file_name.at:13;components of \"/usr/\" are \"/\", \"usr\";dir_name base_name; -380;file_name.at:14;components of \"usr\" are \".\", \"usr\";dir_name base_name; -381;file_name.at:15;components of \"/\" are \"/\", \"/\";dir_name base_name; -382;file_name.at:16;components of \".\" are \".\", \".\";dir_name base_name; -383;file_name.at:17;components of \"..\" are \".\", \"..\";dir_name base_name; -384;file_name.at:18;components of \"//\" are \"//\", \"//\";dir_name base_name; -385;file_name.at:19;components of \"//foo\" are \"//\", \"foo\";dir_name base_name; -386;file_name.at:20;components of \"\" are \".\", \".\";dir_name base_name; -387;file_name.at:23;components of \"dir/file\" are \"dir\", \"file\";dir_name base_name; -388;file_name.at:24;components of \"dir/file/\" are \"dir\", \"file\";dir_name base_name; -389;file_name.at:25;components of \"dir/file//\" are \"dir\", \"file\";dir_name base_name; -390;file_name.at:26;components of \"///foo\" are \"/\", \"foo\";dir_name base_name; -391;file_name.at:36;follow_symlinks - relative symlinks;; -392;file_name.at:53;follow_symlinks - absolute symlinks;; -393;file_name.at:70;follow_symlinks - symlinks to directories;; -394;file_name.at:83;follow_symlinks - nonexistent targets;; -395;file_name.at:91;follow_symlinks - regular files;; -396;file_name.at:96;follow_symlinks - device targets;; -397;file_name.at:105;follow_symlinks - nonexistent files;; -398;file_name.at:112;follow_symlinks - symlink loop;; -399;aes128.at:10;wikipedia test vector 1;aes128; -400;aes128.at:16;wikipedia test vector 2;aes128; -401;aes128.at:22;NIST KAT ECBKeySbox128e vector 0;aes128; -402;aes128.at:28;NIST KAT ECBKeySbox128e vector 1;aes128; -403;aes128.at:34;NIST KAT ECBKeySbox128e vector 2;aes128; -404;aes128.at:40;NIST KAT ECBKeySbox128e vector 3;aes128; -405;aes128.at:46;NIST KAT ECBKeySbox128e vector 4;aes128; -406;aes128.at:52;NIST KAT ECBKeySbox128e vector 5;aes128; -407;aes128.at:58;NIST KAT ECBKeySbox128e vector 6;aes128; -408;aes128.at:64;NIST KAT ECBKeySbox128e vector 7;aes128; -409;aes128.at:70;NIST KAT ECBKeySbox128e vector 8;aes128; -410;aes128.at:76;NIST KAT ECBKeySbox128e vector 9;aes128; -411;aes128.at:82;NIST KAT ECBKeySbox128e vector 10;aes128; -412;aes128.at:88;NIST KAT ECBKeySbox128e vector 11;aes128; -413;aes128.at:94;NIST KAT ECBKeySbox128e vector 12;aes128; -414;aes128.at:100;NIST KAT ECBKeySbox128e vector 13;aes128; -415;aes128.at:106;NIST KAT ECBKeySbox128e vector 14;aes128; -416;aes128.at:112;NIST KAT ECBKeySbox128e vector 15;aes128; -417;aes128.at:118;NIST KAT ECBKeySbox128e vector 16;aes128; -418;aes128.at:124;NIST KAT ECBKeySbox128e vector 17;aes128; -419;aes128.at:130;NIST KAT ECBKeySbox128e vector 18;aes128; -420;aes128.at:136;NIST KAT ECBKeySbox128e vector 19;aes128; -421;aes128.at:142;NIST KAT ECBKeySbox128e vector 20;aes128; -422;unixctl-py.at:6;unixctl ovs-vswitchd exit - Python;; -423;unixctl-py.at:17;unixctl ovs-vswitchd help - Python;; -424;unixctl-py.at:32;unixctl ovs-vswitchd arguments - Python;; -425;unixctl-py.at:74;unixctl bad target - Python;; -426;unixctl-py.at:91;unixctl server - Python;; -427;unixctl-py.at:165;unixctl server errors - Python;; -428;uuid.at:15;UUID generation, parsing, serialization;uuid; -429;json.at:65;empty array - C;json positive; -430;json.at:65;empty array - Python;json positive python; -431;json.at:66;single-element array - C;json positive; -432;json.at:66;single-element array - Python;json positive python; -433;json.at:67;2-element array - C;json positive; -434;json.at:67;2-element array - Python;json positive python; -435;json.at:68;many-element array - C;json positive; -436;json.at:68;many-element array - Python;json positive python; -437;json.at:71;missing comma - C;json negative; -438;json.at:71;missing comma - Python;json negative python; -439;json.at:73;trailing comma not allowed - C;json negative; -440;json.at:73;trailing comma not allowed - Python;json negative python; -441;json.at:75;doubled comma not allowed - C;json negative; -442;json.at:75;doubled comma not allowed - Python;json negative python; -443;json.at:80;empty string - C;json positive; -444;json.at:80;empty string - Python;json positive python; -445;json.at:81;1-character strings - C;json positive; -446;json.at:81;1-character strings - Python;json positive python; -447;json.at:84;escape sequences - C;json positive; -448;json.at:84;escape sequences - Python;json positive python; -449;json.at:87;Unicode escape sequences - C;json positive; -450;json.at:87;Unicode escape sequences - Python;json positive python; -451;json.at:90;surrogate pairs - C;json positive; -452;json.at:93;surrogate pairs - Python;json positive python; -453;json.at:96;a string by itself is not valid JSON - C;json negative; -454;json.at:96;a string by itself is not valid JSON - Python;json negative python; -455;json.at:98;end of line in quoted string - C;json negative; -456;json.at:98;end of line in quoted string - Python;json negative python; -457;json.at:102;formfeed in quoted string - C;json negative; -458;json.at:102;formfeed in quoted string - Python;json negative python; -459;json.at:105;bad escape in quoted string - C;json negative; -460;json.at:105;bad escape in quoted string - Python;json negative python; -461;json.at:108;\\u must be followed by 4 hex digits (1) - C;json negative; -462;json.at:108;\\u must be followed by 4 hex digits (1) - Python;json negative python; -463;json.at:111;\\u must be followed by 4 hex digits (2) - C;json negative; -464;json.at:111;\\u must be followed by 4 hex digits (2) - Python;json negative python; -465;json.at:114;isolated leading surrogate not allowed - C;json negative; -466;json.at:114;isolated leading surrogate not allowed - Python;json negative python; -467;json.at:117;surrogatess must paired properly - C;json negative; -468;json.at:117;surrogatess must paired properly - Python;json negative python; -469;json.at:120;null bytes not allowed - C;json negative; -470;json.at:120;null bytes not allowed - Python;json negative python; -471;json.at:124;properly quoted backslash at end of string - C;json positive; -472;json.at:124;properly quoted backslash at end of string - Python;json positive python; -473;json.at:127;stray backslash at end of string - C;json negative; -474;json.at:127;stray backslash at end of string - Python;json negative python; -475;json.at:131;end of input in quoted string - C;json negative; -476;json.at:138;end of input in quoted string - Python;json negative python; -477;json.at:149;empty object - C;json positive; -478;json.at:149;empty object - Python;json positive python; -479;json.at:150;simple object - C;json positive; -480;json.at:150;simple object - Python;json positive python; -481;json.at:153;bad value - C;json negative; -482;json.at:153;bad value - Python;json negative python; -483;json.at:155;missing colon - C;json negative; -484;json.at:155;missing colon - Python;json negative python; -485;json.at:157;missing comma - C;json negative; -486;json.at:157;missing comma - Python;json negative python; -487;json.at:159;trailing comma not allowed - C;json negative; -488;json.at:159;trailing comma not allowed - Python;json negative python; -489;json.at:162;doubled comma not allowed - C;json negative; -490;json.at:162;doubled comma not allowed - Python;json negative python; -491;json.at:165;names must be strings - C;json negative; -492;json.at:165;names must be strings - Python;json negative python; -493;json.at:171;null - C;json positive; -494;json.at:171;null - Python;json positive python; -495;json.at:172;false - C;json positive; -496;json.at:172;false - Python;json positive python; -497;json.at:173;true - C;json positive; -498;json.at:173;true - Python;json positive python; -499;json.at:174;a literal by itself is not valid JSON - C;json negative; -500;json.at:174;a literal by itself is not valid JSON - Python;json negative python; -501;json.at:176;nullify is invalid - C;json negative; -502;json.at:176;nullify is invalid - Python;json negative python; -503;json.at:178;nubs is invalid - C;json negative; -504;json.at:178;nubs is invalid - Python;json negative python; -505;json.at:180;xxx is invalid - C;json negative; -506;json.at:180;xxx is invalid - Python;json negative python; -507;json.at:185;integers expressed as reals - C;json positive; -508;json.at:185;integers expressed as reals - Python;json positive python; -509;json.at:195;large integers - C;json positive; -510;json.at:195;large integers - Python;json positive python; -511;json.at:199;large integers expressed as reals - C;json positive; -512;json.at:199;large integers expressed as reals - Python;json positive python; -513;json.at:207;large integers that overflow to reals - C;json positive; -514;json.at:207;large integers that overflow to reals - Python;json positive python; -515;json.at:212;negative zero - C;json positive; -516;json.at:212;negative zero - Python;json positive python; -517;json.at:217;reals - C;json positive; -518;json.at:217;reals - Python;json positive python; -519;json.at:221;scientific notation - C;json positive; -520;json.at:221;scientific notation - Python;json positive python; -521;json.at:228;+/- DBL_MAX - C;json positive; -522;json.at:228;+/- DBL_MAX - Python;json positive python; -523;json.at:233;negative reals - C;json positive; -524;json.at:233;negative reals - Python;json positive python; -525;json.at:237;negative scientific notation - C;json positive; -526;json.at:237;negative scientific notation - Python;json positive python; -527;json.at:241;1e-9999 underflows to 0 - C;json positive; -528;json.at:241;1e-9999 underflows to 0 - Python;json positive python; -529;json.at:245;a number by itself is not valid JSON - C;json negative; -530;json.at:245;a number by itself is not valid JSON - Python;json negative python; -531;json.at:247;leading zeros not allowed - C;json negative; -532;json.at:247;leading zeros not allowed - Python;json negative python; -533;json.at:251;1e9999 is too big - C;json negative; -534;json.at:251;1e9999 is too big - Python;json negative python; -535;json.at:255;exponent bigger than INT_MAX - C;json negative; -536;json.at:255;exponent bigger than INT_MAX - Python;json negative python; -537;json.at:259;decimal point must be followed by digit - C;json negative; -538;json.at:259;decimal point must be followed by digit - Python;json negative python; -539;json.at:263;exponent must contain at least one digit (1) - C;json negative; -540;json.at:263;exponent must contain at least one digit (1) - Python;json negative python; -541;json.at:267;exponent must contain at least one digit (2) - C;json negative; -542;json.at:267;exponent must contain at least one digit (2) - Python;json negative python; -543;json.at:271;exponent must contain at least one digit (3) - C;json negative; -544;json.at:271;exponent must contain at least one digit (3) - Python;json negative python; -545;json.at:278;RFC 4267 object example - C;json positive; -546;json.at:278;RFC 4267 object example - Python;json positive python; -547;json.at:294;RFC 4267 array example - C;json positive; -548;json.at:294;RFC 4267 array example - Python;json positive python; -549;json.at:321;trailing garbage - C;json negative; -550;json.at:321;trailing garbage - Python;json negative python; -551;json.at:323;formfeeds are not valid white space - C;json negative; -552;json.at:323;formfeeds are not valid white space - Python;json negative python; -553;json.at:325;';' is not a valid token - C;json negative; -554;json.at:325;';' is not a valid token - Python;json negative python; -555;json.at:327;arrays nesting too deep - C;json negative; -556;json.at:327;arrays nesting too deep - Python;json negative python; -557;json.at:331;objects nesting too deep - C;json negative; -558;json.at:331;objects nesting too deep - Python;json negative python; -559;json.at:336;input may not be empty;json negative; -560;json.at:344;multiple adjacent objects - C;json positive; -561;json.at:344;multiple adjacent objects - Python;json positive python; -562;json.at:349;multiple space-separated objects - C;json positive; -563;json.at:349;multiple space-separated objects - Python;json positive python; -564;json.at:354;multiple objects on separate lines - C;json positive; -565;json.at:354;multiple objects on separate lines - Python;json positive python; -566;json.at:361;multiple objects and arrays - C;json positive; -567;json.at:361;multiple objects and arrays - Python;json positive python; -568;json.at:367;garbage between multiple objects - C;json negative; -569;json.at:367;garbage between multiple objects - Python;json negative python; -570;json.at:371;garbage after multiple objects - C;json negative; -571;json.at:371;garbage after multiple objects - Python;json negative python; -572;jsonrpc.at:3;JSON-RPC request and successful reply;; -573;jsonrpc.at:15;JSON-RPC request and error reply;; -574;jsonrpc.at:27;JSON-RPC notification;; -575;jsonrpc-py.at:3;JSON-RPC request and successful reply - Python;; -576;jsonrpc-py.at:16;JSON-RPC request and error reply - Python;; -577;jsonrpc-py.at:29;JSON-RPC notification - Python;; -578;tunnel.at:3;tunnel - input;; -579;tunnel.at:64;tunnel - ECN decapsulation;; -580;tunnel.at:111;tunnel - output;; -581;tunnel.at:143;tunnel - ToS and TTL inheritance;; -582;tunnel.at:181;tunnel - set_tunnel;; -583;tunnel.at:215;tunnel - key;; -584;tunnel.at:264;tunnel - key match;; -585;tunnel.at:313;tunnel - VXLAN;; -586;tunnel.at:325;tunnel - LISP;; -587;tunnel.at:337;tunnel - different VXLAN UDP port;; -588;tunnel.at:366;ofproto-dpif - set_field - tun_src/tun_dst/tun_id;; -589;lockfile.at:12;lock and unlock;lockfile; -590;lockfile.at:14;lock and unlock twice;lockfile; -591;lockfile.at:16;lock blocks same process;lockfile; -592;lockfile.at:20;lock blocks same process twice;lockfile; -593;lockfile.at:25;lock blocks other process;lockfile; -594;lockfile.at:30;lock twice blocks other process;lockfile; -595;lockfile.at:36;lock and unlock allows other process;lockfile; -596;lockfile.at:38;lock multiple;lockfile; -597;lockfile.at:42;lock symlink;lockfile; -598;lockfile.at:49;lock symlink to dir;lockfile; -599;reconnect.at:26;nothing happens if not enabled - C;reconnect; -600;reconnect.at:26;nothing happens if not enabled - Python;reconnect; -601;reconnect.at:37;quick connect, idle disconnect - C;reconnect; -602;reconnect.at:37;quick connect, idle disconnect - Python;reconnect; -603;reconnect.at:93;slow connect, idle disconnect - C;reconnect; -604;reconnect.at:93;slow connect, idle disconnect - Python;reconnect; -605;reconnect.at:163;connect backs off - C;reconnect; -606;reconnect.at:163;connect backs off - Python;reconnect; -607;reconnect.at:362;connections with no data preserve backoff - C;reconnect; -608;reconnect.at:362;connections with no data preserve backoff - Python;reconnect; -609;reconnect.at:526;brief connection preserves backoff - C;reconnect; -610;reconnect.at:526;brief connection preserves backoff - Python;reconnect; -611;reconnect.at:657;brief connection with data preserves backoff - C;reconnect; -612;reconnect.at:657;brief connection with data preserves backoff - Python;reconnect; -613;reconnect.at:818;long connection resets backoff - C;reconnect; -614;reconnect.at:818;long connection resets backoff - Python;reconnect; -615;reconnect.at:979;connection attempt fails quickly - C;reconnect; -616;reconnect.at:979;connection attempt fails quickly - Python;reconnect; -617;reconnect.at:1034;max-tries of 1 honored - C;reconnect; -618;reconnect.at:1034;max-tries of 1 honored - Python;reconnect; -619;reconnect.at:1094;max-tries of 0 honored - C;reconnect; -620;reconnect.at:1094;max-tries of 0 honored - Python;reconnect; -621;reconnect.at:1110;passive mode - C;reconnect; -622;reconnect.at:1110;passive mode - Python;reconnect; -623;ovs-vswitchd.at:7;ovs-vswitchd detaches correctly with empty db;; -624;ovs-vswitchd.at:38;ovs-vswitchd -- stats-update-interval;; -625;ovs-vswitchd.at:71;ovs-vswitchd -- start additional ovs-vswitchd process;; -626;ovs-vswitchd.at:95;ovs-vswitchd -- switch over to another ovs-vswitchd process;; -627;ovs-vswitchd.at:134;ovs-vswitchd -- invalid database path;; -628;ofproto.at:3;ofproto - echo request;; -629;ofproto.at:9;ofproto - handling messages with bad version;; -630;ofproto.at:32;ofproto - feature request, config request;; -631;ofproto.at:49;ofproto - set OpenFlow port number;; -632;ofproto.at:82;ofproto - port stats - (OpenFlow 1.0);; -633;ofproto.at:93;ofproto - port stats - (OpenFlow 1.2);; -634;ofproto.at:104;ofproto - port stats - (OpenFlow 1.4);; -635;ofproto.at:119;ofproto - port-desc stats (OpenFlow 1.0);; -636;ofproto.at:134;ofproto - port-desc stats (OpenFlow 1.2);; -637;ofproto.at:147;ofproto - port-desc stats (OpenFlow 1.5);; -638;ofproto.at:183;ofproto - queue stats - (OpenFlow 1.0);; -639;ofproto.at:200;ofproto - queue stats - (OpenFlow 1.2);; -640;ofproto.at:217;ofproto - queue stats - (OpenFlow 1.4);; -641;ofproto.at:236;ofproto - queue configuration - (OpenFlow 1.0);; -642;ofproto.at:250;ofproto - queue configuration - (OpenFlow 1.2);; -643;ofproto.at:266;ofproto - del group;; -644;ofproto.at:300;ofproto - del group deletes flows;; -645;ofproto.at:340;ofproto - flow mod checks group availability;; -646;ofproto.at:368;ofproto - group description;; -647;ofproto.at:381;ofproto - group description;; -648;ofproto.at:394;ofproto - group features;; -649;ofproto.at:416;ofproto - group stats;; -650;ofproto.at:438;ofproto - mod-port (OpenFlow 1.0);; -651;ofproto.at:472;ofproto - mod-port (OpenFlow 1.2);; -652;ofproto.at:503;ofproto - mod-port (OpenFlow 1.4);; -653;ofproto.at:535;ofproto - basic flow_mod commands (NXM);; -654;ofproto.at:557;ofproto - basic flow_mod commands (OpenFlow 1.0);; -655;ofproto.at:579;ofproto - basic flow_mod commands (OpenFlow 1.1);; -656;ofproto.at:602;ofproto - flow_mod negative test (OpenFlow 1.1);; -657;ofproto.at:616;ofproto - set-field flow_mod commands (NXM);; -658;ofproto.at:627;ofproto - basic flow_mod commands (OpenFlow 1.2);; -659;ofproto.at:646;ofproto - dump flows with cookie;; -660;ofproto.at:670;ofproto - mod flow with cookie change (OpenFlow 1.0);; -661;ofproto.at:686;ofproto - mod flow with cookie change (NXM);; -662;ofproto.at:702;ofproto - no mod flow with cookie change (OpenFlow 1.1);; -663;ofproto.at:718;ofproto - no mod flow with cookie change (OpenFlow 1.2);; -664;ofproto.at:734;ofproto - mod flows based on cookie mask (OpenFlow 1.0);; -665;ofproto.at:756;ofproto - mod flows based on cookie mask (OpenFlow 1.1);; -666;ofproto.at:778;ofproto - mod flows based on cookie mask (OpenFlow 1.2);; -667;ofproto.at:801;ofproto - mod flows based on cookie mask with cookie change;; -668;ofproto.at:823;ofproto - mod flow with cookie miss (mask==0) - NXM;; -669;ofproto.at:833;ofproto - mod flow with cookie miss (mask==0) - OF1.1;; -670;ofproto.at:843;ofproto - mod flow with cookie miss (mask==0) - OF1.2;; -671;ofproto.at:852;ofproto - mod flow with cookie miss (mask!=0) - NXM;; -672;ofproto.at:861;ofproto - mod flow with cookie miss (mask!=0) - OF1.1;; -673;ofproto.at:870;ofproto - mod flow with cookie miss (mask!=0) - OF1.2;; -674;ofproto.at:879;ofproto - del flows with cookies;; -675;ofproto.at:898;ofproto - del flows based on cookie;; -676;ofproto.at:919;ofproto - del flows based on cookie mask;; -677;ofproto.at:938;ofproto - del flows based on table id (NXM);; -678;ofproto.at:970;ofproto - del flows based on table id (OpenFlow 1.1);; -679;ofproto.at:1003;ofproto - del flows based on table id (OpenFlow 1.2);; -680;ofproto.at:1035;ofproto - flow table configuration (OpenFlow 1.0);; -681;ofproto.at:1071;ofproto - flow table configuration (OpenFlow 1.2);; -682;ofproto.at:1113;ofproto - hard limits on flow table size (OpenFlow 1.0);; -683;ofproto.at:1157;ofproto - hard limits on flow table size (OpenFlow 1.2);; -684;ofproto.at:1196;ofproto - eviction upon table overflow (OpenFlow 1.0);; -685;ofproto.at:1254;ofproto - eviction upon table overflow (OpenFlow 1.2);; -686;ofproto.at:1313;ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0);; -687;ofproto.at:1395;ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2);; -688;ofproto.at:1477;ofproto - eviction upon table overflow, with modified hard timeout;; -689;ofproto.at:1521;ofproto - eviction upon table overflow, with modified idle timeout;; -690;ofproto.at:1565;ofproto - asynchronous message control (OpenFlow 1.0);; -691;ofproto.at:1668;ofproto - asynchronous message control (OpenFlow 1.2);; -692;ofproto.at:1772;ofproto - asynchronous message control (OpenFlow 1.3);; -693;ofproto.at:1874;ofproto - controller role (OpenFlow 1.2);; -694;ofproto.at:1939;ofproto - controller role (OpenFlow 1.4);; -695;ofproto.at:2005;ofproto - packet-out from controller (OpenFlow 1.0);; -696;ofproto.at:2041;ofproto - packet-out from controller (OpenFlow 1.2);; -697;ofproto.at:2074;ofproto - packet-out from controller (OpenFlow 1.1);; -698;ofproto.at:2105;ofproto - packet-out with metadata (NXM);; -699;ofproto.at:2133;ofproto - packet-out with metadata (OpenFlow 1.2);; -700;ofproto.at:2160;ofproto - packet-out with tunnel metadata (OpenFlow 1.2);; -701;ofproto.at:2186;ofproto - flow monitoring;monitor; -702;ofproto.at:2339;ofproto - flow monitoring pause and resume;monitor; -703;ofproto.at:2445;ofproto - event filtering (OpenFlow 1.3);monitor; -704;ofproto.at:2479;ofproto - ofport_request;; -705;ofproto.at:2535;ofproto - bundles, open (OpenFlow 1.4);monitor; -706;ofproto.at:2559;ofproto - bundles, double open (OpenFlow 1.4);monitor; -707;ofproto.at:2591;ofproto - bundle close without open (OpenFlow 1.4);monitor; -708;ofproto.at:2615;ofproto - bundle double close (OpenFlow 1.4);monitor; -709;ofproto.at:2654;ofproto - bundle close, different flags (OpenFlow 1.4);monitor; -710;ofproto.at:2686;ofproto - bundle commit without open (OpenFlow 1.4);monitor; -711;ofproto.at:2711;ofproto - bundle commit, different flags (OpenFlow 1.4);monitor; -712;ofproto.at:2743;ofproto - bundle discard without open (OpenFlow 1.4);monitor; -713;ofproto-dpif.at:24;ofproto-dpif - dummy interface;; -714;ofproto-dpif.at:57;ofproto-dpif, active-backup bonding;; -715;ofproto-dpif.at:104;ofproto-dpif, balance-slb bonding;; -716;ofproto-dpif.at:148;ofproto-dpif, balance-tcp bonding;; -717;ofproto-dpif.at:201;ofproto-dpif - resubmit;; -718;ofproto-dpif.at:221;ofproto-dpif - goto table;; -719;ofproto-dpif.at:235;ofproto-dpif - write actions;; -720;ofproto-dpif.at:252;ofproto-dpif - clear actions;; -721;ofproto-dpif.at:268;ofproto-dpif - group chaining not supported;; -722;ofproto-dpif.at:279;ofproto-dpif - all group in action list;; -723;ofproto-dpif.at:292;ofproto-dpif - indirect group in action list;; -724;ofproto-dpif.at:304;ofproto-dpif - all group in action set;; -725;ofproto-dpif.at:317;ofproto-dpif - indirect group in action set;; -726;ofproto-dpif.at:329;ofproto-dpif - select group;; -727;ofproto-dpif.at:349;ofproto-dpif - select group with watch port;; -728;ofproto-dpif.at:361;ofproto-dpif - select group with weight;; -729;ofproto-dpif.at:373;ofproto-dpif - fast failover group;; -730;ofproto-dpif.at:385;ofproto-dpif - registers;; -731;ofproto-dpif.at:420;ofproto-dpif - push-pop;; -732;ofproto-dpif.at:439;ofproto-dpif - output;; -733;ofproto-dpif.at:460;ofproto-dpif - dec_ttl;; -734;ofproto-dpif.at:504;ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts;; -735;ofproto-dpif.at:521;ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts;; -736;ofproto-dpif.at:538;ofproto-dpif - note at offset 24 in ofpacts;; -737;ofproto-dpif.at:548;ofproto-dpif - output, OFPP_NONE ingress port;; -738;ofproto-dpif.at:566;ofproto-dpif - DSCP;; -739;ofproto-dpif.at:594;ofproto-dpif - output/flood flags;; -740;ofproto-dpif.at:652;ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER);; -741;ofproto-dpif.at:686;ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP);; -742;ofproto-dpif.at:714;ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER;; -743;ofproto-dpif.at:751;ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER;; -744;ofproto-dpif.at:780;ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE;; -745;ofproto-dpif.at:840;ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE;; -746;ofproto-dpif.at:905;ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE;; -747;ofproto-dpif.at:952;ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP;; -748;ofproto-dpif.at:980;ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP;; -749;ofproto-dpif.at:1012;ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP;; -750;ofproto-dpif.at:1044;ofproto-dpif - controller;; -751;ofproto-dpif.at:1566;ofproto-dpif - table-miss flow (OpenFlow 1.0);; -752;ofproto-dpif.at:1607;ofproto-dpif - table-miss flow (OpenFlow 1.3);; -753;ofproto-dpif.at:1649;ofproto-dpif - ARP modification slow-path;; -754;ofproto-dpif.at:1678;ofproto-dpif - VLAN handling;; -755;ofproto-dpif.at:1812;ofproto-dpif - MPLS handling;; -756;ofproto-dpif.at:1929;ofproto-dpif - VLAN+MPLS handling;; -757;ofproto-dpif.at:2320;ofproto-dpif - fragment handling;; -758;ofproto-dpif.at:2366;ofproto-dpif - exit;; -759;ofproto-dpif.at:2391;ofproto-dpif - mirroring, select_all;; -760;ofproto-dpif.at:2421;ofproto-dpif - mirroring, select_src;; -761;ofproto-dpif.at:2449;ofproto-dpif - mirroring, OFPP_NONE ingress port;; -762;ofproto-dpif.at:2470;ofproto-dpif - mirroring, select_dst;; -763;ofproto-dpif.at:2500;ofproto-dpif - mirroring, select_vlan;; -764;ofproto-dpif.at:2535;ofproto-dpif - mirroring, output_port;; -765;ofproto-dpif.at:2564;ofproto-dpif - mirroring, output_vlan;; -766;ofproto-dpif.at:2602;ofproto-dpif - ofproto/trace command 1;; -767;ofproto-dpif.at:2743;ofproto-dpif - ofproto/trace command 2;; -768;ofproto-dpif.at:2859;ofproto-dpif - ofproto/trace-packet-out;; -769;ofproto-dpif.at:2889;ofproto-dpif - MAC learning;; -770;ofproto-dpif.at:2978;ofproto-dpif - MAC table overflow;; -771;ofproto-dpif.at:3336;ofproto-dpif - sFlow packet sampling - IPv4 collector;; -772;ofproto-dpif.at:3337;ofproto-dpif - sFlow packet sampling - IPv6 collector;; -773;ofproto-dpif.at:3387;ofproto-dpif - NetFlow flow expiration - IPv4 collector;; -774;ofproto-dpif.at:3388;ofproto-dpif - NetFlow flow expiration - IPv6 collector;; -775;ofproto-dpif.at:3471;ofproto-dpif - NetFlow active expiration - IPv4 collector;; -776;ofproto-dpif.at:3472;ofproto-dpif - NetFlow active expiration - IPv6 collector;; -777;ofproto-dpif.at:3474;ofproto-dpif - flow stats;; -778;ofproto-dpif.at:3496;ofproto-dpif - flow stats, set-n-threads;; -779;ofproto-dpif.at:3519;idle_age and hard_age increase over time;; -780;ofproto-dpif.at:3611;ofproto-dpif - fin_timeout;; -781;ofproto-dpif.at:3649;ofproto-dpif - ovs-appctl dpif/dump-dps;; -782;ofproto-dpif.at:3661;ofproto-dpif - ovs-appctl dpif/show;; -783;ofproto-dpif.at:3679;ofproto-dpif - ovs-appctl dpif/dump-flows;; -784;ofproto-dpif.at:3712;ofproto-dpif - MPLS actions that result in a userspace action;; -785;ofproto-dpif.at:3749;ofproto-dpif - MPLS actions that result in a drop;; -786;ofproto-dpif.at:3788;ofproto-dpif - patch ports;; -787;ofproto-dpif.at:3861;ofproto-dpif - port duration;; -788;ofproto-dpif.at:3881;ofproto-dpif megaflow - port classification;; -789;ofproto-dpif.at:3899;ofproto-dpif megaflow - L2 classification;; -790;ofproto-dpif.at:3917;ofproto-dpif megaflow - L3 classification;; -791;ofproto-dpif.at:3936;ofproto-dpif megaflow - IPv6 classification;; -792;ofproto-dpif.at:3955;ofproto-dpif megaflow - L4 classification;; -793;ofproto-dpif.at:3973;ofproto-dpif megaflow - normal;; -794;ofproto-dpif.at:3988;ofproto-dpif megaflow - mpls;; -795;ofproto-dpif.at:4037;ofproto-dpif megaflow - netflow - IPv4 collector;; -796;ofproto-dpif.at:4038;ofproto-dpif megaflow - netflow - IPv6 collector;; -797;ofproto-dpif.at:4040;ofproto-dpif megaflow - normal, active-backup bonding;; -798;ofproto-dpif.at:4061;ofproto-dpif megaflow - normal, balance-slb bonding;; -799;ofproto-dpif.at:4082;ofproto-dpif megaflow - normal, balance-tcp bonding;; -800;ofproto-dpif.at:4120;ofproto-dpif megaflow - resubmit port action;; -801;ofproto-dpif.at:4139;ofproto-dpif megaflow - resubmit table action;; -802;ofproto-dpif.at:4159;ofproto-dpif megaflow - goto_table action;; -803;ofproto-dpif.at:4178;ofproto-dpif megaflow - mirroring, select_all;; -804;ofproto-dpif.at:4201;ofproto-dpif megaflow - mirroring, select_vlan;; -805;ofproto-dpif.at:4224;ofproto-dpif megaflow - move action;; -806;ofproto-dpif.at:4244;ofproto-dpif megaflow - push action;; -807;ofproto-dpif.at:4262;ofproto-dpif megaflow - learning;; -808;ofproto-dpif.at:4289;ofproto-dpif megaflow - tunnels;; -809;ofproto-dpif.at:4322;ofproto-dpif megaflow - dec_ttl;; -810;ofproto-dpif.at:4341;ofproto-dpif megaflow - set dl_dst;; -811;ofproto-dpif.at:4369;ofproto-dpif megaflow - disabled;; -812;ofproto-dpif.at:4400;ofproto-dpif - datapath port number change;; -813;ofproto-dpif.at:4422;ofproto - bundle with variable bfd/cfm config;; -814;ofproto-dpif.at:4500;ofproto-dpif - ofproto-dpif-monitor 1;; -815;ofproto-dpif.at:4547;ofproto-dpif - ofproto-dpif-monitor 2;; -816;ofproto-dpif.at:4560;ofproto-dpif - infinite resubmit;; -817;ofproto-dpif.at:4573;ofproto-dpif - exponential resubmit chain;; -818;ofproto-dpif.at:4588;ofproto-dpif - too many output actions;; -819;ofproto-dpif.at:4606;ofproto-dpif - stack too deep;; -820;ofproto-dpif.at:4622;ofproto-dpif - ICMPv6;; -821;vlan-splinters.at:3;VLAN splinters;; -822;ovsdb-log.at:3;create empty, reread;ovsdb log; -823;ovsdb-log.at:18;write one, reread;ovsdb log; -824;ovsdb-log.at:35;check that create fails if file exists;ovsdb log; -825;ovsdb-log.at:55;write one, reread;ovsdb log; -826;ovsdb-log.at:76;write one, reread, append;ovsdb log; -827;ovsdb-log.at:106;write, reread one, overwrite;ovsdb log; -828;ovsdb-log.at:132;write, add corrupted data, read;ovsdb log; -829;ovsdb-log.at:154;write, add corrupted data, read, overwrite;ovsdb log; -830;ovsdb-log.at:186;write, corrupt some data, read, overwrite;ovsdb log; -831;ovsdb-log.at:219;write, truncate file, read, overwrite;ovsdb log; -832;ovsdb-log.at:252;write bad JSON, read, overwrite;ovsdb log; -833;ovsdb-types.at:3;integer - C;ovsdb positive; -834;ovsdb-types.at:3;integer - Python;ovsdb positive python; -835;ovsdb-types.at:5;real - C;ovsdb positive; -836;ovsdb-types.at:5;real - Python;ovsdb positive python; -837;ovsdb-types.at:7;boolean - C;ovsdb positive; -838;ovsdb-types.at:7;boolean - Python;ovsdb positive python; -839;ovsdb-types.at:9;string - C;ovsdb positive; -840;ovsdb-types.at:9;string - Python;ovsdb positive python; -841;ovsdb-types.at:11;uuid - C;ovsdb positive; -842;ovsdb-types.at:11;uuid - Python;ovsdb positive python; -843;ovsdb-types.at:13;void is not a valid atomic-type - C;ovsdb negative; -844;ovsdb-types.at:13;void is not a valid atomic-type - Python;ovsdb negative; -845;ovsdb-types.at:18;integer enum - C;ovsdb positive; -846;ovsdb-types.at:18;integer enum - Python;ovsdb positive python; -847;ovsdb-types.at:21;integer >= 5 - C;ovsdb positive; -848;ovsdb-types.at:21;integer >= 5 - Python;ovsdb positive python; -849;ovsdb-types.at:24;integer <= 7 - C;ovsdb positive; -850;ovsdb-types.at:24;integer <= 7 - Python;ovsdb positive python; -851;ovsdb-types.at:27;integer between -5 and 10 - C;ovsdb positive; -852;ovsdb-types.at:27;integer between -5 and 10 - Python;ovsdb positive python; -853;ovsdb-types.at:30;integer max may not be less than min - C;ovsdb negative; -854;ovsdb-types.at:30;integer max may not be less than min - Python;ovsdb negative; -855;ovsdb-types.at:34;real enum - C;ovsdb positive; -856;ovsdb-types.at:34;real enum - Python;ovsdb positive python; -857;ovsdb-types.at:37;real >= -1.5 - C;ovsdb positive; -858;ovsdb-types.at:37;real >= -1.5 - Python;ovsdb positive python; -859;ovsdb-types.at:40;real <= 1e5 - C;ovsdb positive; -860;ovsdb-types.at:40;real <= 1e5 - Python;ovsdb positive python; -861;ovsdb-types.at:43;real between -2.5 and 3.75 - C;ovsdb positive; -862;ovsdb-types.at:43;real between -2.5 and 3.75 - Python;ovsdb positive python; -863;ovsdb-types.at:46;real max may not be less than min - C;ovsdb negative; -864;ovsdb-types.at:46;real max may not be less than min - Python;ovsdb negative; -865;ovsdb-types.at:50;boolean - C;ovsdb positive; -866;ovsdb-types.at:50;boolean - Python;ovsdb positive python; -867;ovsdb-types.at:52;boolean enum - C;ovsdb positive; -868;ovsdb-types.at:52;boolean enum - Python;ovsdb positive python; -869;ovsdb-types.at:56;string enum - C;ovsdb positive; -870;ovsdb-types.at:56;string enum - Python;ovsdb positive python; -871;ovsdb-types.at:59;string minLength - C;ovsdb positive; -872;ovsdb-types.at:59;string minLength - Python;ovsdb positive python; -873;ovsdb-types.at:62;string maxLength - C;ovsdb positive; -874;ovsdb-types.at:62;string maxLength - Python;ovsdb positive python; -875;ovsdb-types.at:65;string minLength and maxLength - C;ovsdb positive; -876;ovsdb-types.at:65;string minLength and maxLength - Python;ovsdb positive python; -877;ovsdb-types.at:68;maxLength must not be less than minLength - C;ovsdb negative; -878;ovsdb-types.at:68;maxLength must not be less than minLength - Python;ovsdb negative; -879;ovsdb-types.at:71;maxLength must not be negative - C;ovsdb negative; -880;ovsdb-types.at:71;maxLength must not be negative - Python;ovsdb negative; -881;ovsdb-types.at:75;uuid enum - C;ovsdb positive; -882;ovsdb-types.at:75;uuid enum - Python;ovsdb positive python; -883;ovsdb-types.at:78;uuid refTable - C;ovsdb positive; -884;ovsdb-types.at:78;uuid refTable - Python;ovsdb positive python; -885;ovsdb-types.at:81;uuid refTable must be valid id - C;ovsdb negative; -886;ovsdb-types.at:81;uuid refTable must be valid id - Python;ovsdb negative; -887;ovsdb-types.at:85;void is not a valid base-type - C;ovsdb negative; -888;ovsdb-types.at:85;void is not a valid base-type - Python;ovsdb negative; -889;ovsdb-types.at:87;\"type\" member must be present - C;ovsdb negative; -890;ovsdb-types.at:87;\"type\" member must be present - Python;ovsdb negative; -891;ovsdb-types.at:92;simple integer - C;ovsdb positive; -892;ovsdb-types.at:92;simple integer - Python;ovsdb positive python; -893;ovsdb-types.at:94;simple real - C;ovsdb positive; -894;ovsdb-types.at:94;simple real - Python;ovsdb positive python; -895;ovsdb-types.at:96;simple boolean - C;ovsdb positive; -896;ovsdb-types.at:96;simple boolean - Python;ovsdb positive python; -897;ovsdb-types.at:98;simple string - C;ovsdb positive; -898;ovsdb-types.at:98;simple string - Python;ovsdb positive python; -899;ovsdb-types.at:100;simple uuid - C;ovsdb positive; -900;ovsdb-types.at:100;simple uuid - Python;ovsdb positive python; -901;ovsdb-types.at:102;integer in object - C;ovsdb positive; -902;ovsdb-types.at:102;integer in object - Python;ovsdb positive python; -903;ovsdb-types.at:104;real in object with explicit min and max - C;ovsdb positive; -904;ovsdb-types.at:104;real in object with explicit min and max - Python;ovsdb positive python; -905;ovsdb-types.at:107;key type is required - C;ovsdb negative; -906;ovsdb-types.at:107;key type is required - Python;ovsdb negative; -907;ovsdb-types.at:109;void is not a valid type - C;ovsdb negative; -908;ovsdb-types.at:109;void is not a valid type - Python;ovsdb negative; -909;ovsdb-types.at:114;optional boolean - C;ovsdb positive set; -910;ovsdb-types.at:114;optional boolean - Python;ovsdb positive python set; -911;ovsdb-types.at:118;set of 1 to 3 uuids - C;ovsdb positive; -912;ovsdb-types.at:118;set of 1 to 3 uuids - Python;ovsdb positive python; -913;ovsdb-types.at:121;set of 0 to 3 strings - C;ovsdb positive; -914;ovsdb-types.at:121;set of 0 to 3 strings - Python;ovsdb positive python; -915;ovsdb-types.at:124;set of 0 or more integers - C;ovsdb positive; -916;ovsdb-types.at:124;set of 0 or more integers - Python;ovsdb positive python; -917;ovsdb-types.at:127;set of 1 or more reals - C;ovsdb positive; -918;ovsdb-types.at:127;set of 1 or more reals - Python;ovsdb positive python; -919;ovsdb-types.at:131;set max cannot be less than min - C;ovsdb negative; -920;ovsdb-types.at:131;set max cannot be less than min - Python;ovsdb negative; -921;ovsdb-types.at:134;set max cannot be negative - C;ovsdb negative; -922;ovsdb-types.at:134;set max cannot be negative - Python;ovsdb negative; -923;ovsdb-types.at:137;set min cannot be negative - C;ovsdb negative; -924;ovsdb-types.at:137;set min cannot be negative - Python;ovsdb negative; -925;ovsdb-types.at:140;set min cannot be greater than one - C;ovsdb negative; -926;ovsdb-types.at:140;set min cannot be greater than one - Python;ovsdb negative; -927;ovsdb-types.at:146;map of 1 integer to boolean - C;ovsdb positive; -928;ovsdb-types.at:146;map of 1 integer to boolean - Python;ovsdb positive python; -929;ovsdb-types.at:149;map of 1 boolean to integer, explicit min and max - C;ovsdb positive; -930;ovsdb-types.at:149;map of 1 boolean to integer, explicit min and max - Python;ovsdb positive python; -931;ovsdb-types.at:152;map of 1 to 5 uuid to real - C;ovsdb positive; -932;ovsdb-types.at:152;map of 1 to 5 uuid to real - Python;ovsdb positive python; -933;ovsdb-types.at:155;map of 0 to 10 string to uuid - C;ovsdb positive; -934;ovsdb-types.at:155;map of 0 to 10 string to uuid - Python;ovsdb positive python; -935;ovsdb-types.at:158;map of 1 to 20 real to string - C;ovsdb positive; -936;ovsdb-types.at:158;map of 1 to 20 real to string - Python;ovsdb positive python; -937;ovsdb-types.at:161;map of 0 or more string to real - C;ovsdb positive; -938;ovsdb-types.at:161;map of 0 or more string to real - Python;ovsdb positive python; -939;ovsdb-types.at:165;map key type is required - C;ovsdb negative; -940;ovsdb-types.at:165;map key type is required - Python;ovsdb negative; -941;ovsdb-data.at:3;default atoms - C;ovsdb positive; -942;ovsdb-data.at:3;default atoms - Python;ovsdb positive python; -943;ovsdb-data.at:11;default data - C;ovsdb positive; -944;ovsdb-data.at:11;default data - Python;ovsdb positive python; -945;ovsdb-data.at:76;integer atom from JSON - C;ovsdb positive; -946;ovsdb-data.at:76;integer atom from JSON - Python;ovsdb positive python; -947;ovsdb-data.at:89;integer atom from string;ovsdb positive; -948;ovsdb-data.at:102;real atom from JSON - C;ovsdb positive; -949;ovsdb-data.at:102;real atom from JSON - Python;ovsdb positive python; -950;ovsdb-data.at:119;real atom from string;ovsdb positive; -951;ovsdb-data.at:136;boolean atom from JSON - C;ovsdb positive; -952;ovsdb-data.at:136;boolean atom from JSON - Python;ovsdb positive python; -953;ovsdb-data.at:141;boolean atom from string;ovsdb positive; -954;ovsdb-data.at:146;string atom from JSON - C;ovsdb positive; -955;ovsdb-data.at:146;string atom from JSON - Python;ovsdb positive python; -956;ovsdb-data.at:152;string atom from string;ovsdb positive; -957;ovsdb-data.at:167;uuid atom from JSON - C;ovsdb positive; -958;ovsdb-data.at:167;uuid atom from JSON - Python;ovsdb positive python; -959;ovsdb-data.at:171;uuid atom from string;ovsdb positive; -960;ovsdb-data.at:175;integer atom sorting - C;ovsdb positive; -961;ovsdb-data.at:175;integer atom sorting - Python;ovsdb positive python; -962;ovsdb-data.at:179;real atom sorting - C;ovsdb positive; -963;ovsdb-data.at:179;real atom sorting - Python;ovsdb positive python; -964;ovsdb-data.at:183;boolean atom sorting - C;ovsdb positive; -965;ovsdb-data.at:183;boolean atom sorting - Python;ovsdb positive python; -966;ovsdb-data.at:187;string atom sorting - C;ovsdb positive; -967;ovsdb-data.at:187;string atom sorting - Python;ovsdb positive python; -968;ovsdb-data.at:191;uuid atom sorting - C;ovsdb positive; -969;ovsdb-data.at:191;uuid atom sorting - Python;ovsdb positive python; -970;ovsdb-data.at:228;real not acceptable integer JSON atom - C;ovsdb positive; -971;ovsdb-data.at:228;real not acceptable integer JSON atom - Python;ovsdb positive python; -972;ovsdb-data.at:234;no invalid UTF-8 sequences in strings;ovsdb positive; -973;ovsdb-data.at:249;no invalid UTF-8 sequences in strings - Python;ovsdb positive python; -974;ovsdb-data.at:257;real not acceptable integer string atom;ovsdb negative; -975;ovsdb-data.at:261;string \"true\" not acceptable boolean JSON atom - C;ovsdb positive; -976;ovsdb-data.at:261;string \"true\" not acceptable boolean JSON atom - Python;ovsdb positive python; -977;ovsdb-data.at:265;string \"true\" not acceptable boolean string atom;ovsdb negative; -978;ovsdb-data.at:269;integer not acceptable string JSON atom - C;ovsdb positive; -979;ovsdb-data.at:269;integer not acceptable string JSON atom - Python;ovsdb positive python; -980;ovsdb-data.at:273;uuid atom must be expressed as JSON array - C;ovsdb positive; -981;ovsdb-data.at:273;uuid atom must be expressed as JSON array - Python;ovsdb positive python; -982;ovsdb-data.at:277;named-uuid requires symbol table - C;ovsdb positive; -983;ovsdb-data.at:277;named-uuid requires symbol table - Python;ovsdb positive python; -984;ovsdb-data.at:281;empty string atom must be quoted;ovsdb negative; -985;ovsdb-data.at:285;quotes must be balanced;ovsdb negative; -986;ovsdb-data.at:289;uuids must be valid;ovsdb negative; -987;ovsdb-data.at:295;integer atom enum - C;ovsdb positive; -988;ovsdb-data.at:295;integer atom enum - Python;ovsdb positive python; -989;ovsdb-data.at:318;real atom enum - C;ovsdb positive; -990;ovsdb-data.at:318;real atom enum - Python;ovsdb positive python; -991;ovsdb-data.at:335;boolean atom enum - C;ovsdb positive; -992;ovsdb-data.at:335;boolean atom enum - Python;ovsdb positive python; -993;ovsdb-data.at:342;string atom enum - C;ovsdb positive; -994;ovsdb-data.at:342;string atom enum - Python;ovsdb positive python; -995;ovsdb-data.at:357;uuid atom enum - C;ovsdb positive; -996;ovsdb-data.at:357;uuid atom enum - Python;ovsdb positive python; -997;ovsdb-data.at:368;integers >= 5 - C;ovsdb positive; -998;ovsdb-data.at:368;integers >= 5 - Python;ovsdb positive python; -999;ovsdb-data.at:381;integers <= -1 - C;ovsdb positive; -1000;ovsdb-data.at:381;integers <= -1 - Python;ovsdb positive python; -1001;ovsdb-data.at:392;integers in range -10 to 10 - C;ovsdb positive; -1002;ovsdb-data.at:392;integers in range -10 to 10 - Python;ovsdb positive python; -1003;ovsdb-data.at:413;reals >= 5 - C;ovsdb positive; -1004;ovsdb-data.at:413;reals >= 5 - Python;ovsdb positive python; -1005;ovsdb-data.at:426;reals <= -1 - C;ovsdb positive; -1006;ovsdb-data.at:426;reals <= -1 - Python;ovsdb positive python; -1007;ovsdb-data.at:437;reals in range -10 to 10 - C;ovsdb positive; -1008;ovsdb-data.at:437;reals in range -10 to 10 - Python;ovsdb positive python; -1009;ovsdb-data.at:458;strings at least 2 characters long - C;ovsdb positive; -1010;ovsdb-data.at:458;strings at least 2 characters long - Python;ovsdb positive python; -1011;ovsdb-data.at:476;strings no more than 2 characters long - C;ovsdb positive; -1012;ovsdb-data.at:476;strings no more than 2 characters long - Python;ovsdb positive python; -1013;ovsdb-data.at:491;integer JSON datum - C;ovsdb positive; -1014;ovsdb-data.at:491;integer JSON datum - Python;ovsdb positive python; -1015;ovsdb-data.at:497;integer string datum;ovsdb positive; -1016;ovsdb-data.at:504;real JSON datum - C;ovsdb positive; -1017;ovsdb-data.at:504;real JSON datum - Python;ovsdb positive python; -1018;ovsdb-data.at:510;real string datum;ovsdb positive; -1019;ovsdb-data.at:516;boolean JSON datum - C;ovsdb positive; -1020;ovsdb-data.at:516;boolean JSON datum - Python;ovsdb positive python; -1021;ovsdb-data.at:521;boolean string datum;ovsdb positive; -1022;ovsdb-data.at:526;string JSON datum - C;ovsdb positive; -1023;ovsdb-data.at:526;string JSON datum - Python;ovsdb positive python; -1024;ovsdb-data.at:532;string string datum;ovsdb positive; -1025;ovsdb-data.at:541;JSON optional boolean - C;ovsdb positive set; -1026;ovsdb-data.at:541;JSON optional boolean - Python;ovsdb positive python set; -1027;ovsdb-data.at:551;string optional boolean;ovsdb positive set; -1028;ovsdb-data.at:561;JSON set of 0 or more integers - C;ovsdb positive; -1029;ovsdb-data.at:561;JSON set of 0 or more integers - Python;ovsdb positive python; -1030;ovsdb-data.at:578;string set of 0 or more integers;ovsdb positive; -1031;ovsdb-data.at:593;JSON set of 1 to 3 uuids - C;ovsdb positive; -1032;ovsdb-data.at:593;JSON set of 1 to 3 uuids - Python;ovsdb positive python; -1033;ovsdb-data.at:604;string set of 1 to 3 uuids;ovsdb positive; -1034;ovsdb-data.at:613;JSON set of 0 to 3 strings - C;ovsdb positive; -1035;ovsdb-data.at:613;JSON set of 0 to 3 strings - Python;ovsdb positive python; -1036;ovsdb-data.at:626;string set of 0 to 3 strings;ovsdb positive; -1037;ovsdb-data.at:637;duplicate boolean not allowed in JSON set - C;ovsdb negative; -1038;ovsdb-data.at:637;duplicate boolean not allowed in JSON set - Python;ovsdb negative; -1039;ovsdb-data.at:641;duplicate boolean not allowed in string set;ovsdb negative; -1040;ovsdb-data.at:645;duplicate integer not allowed in JSON set - C;ovsdb negative; -1041;ovsdb-data.at:645;duplicate integer not allowed in JSON set - Python;ovsdb negative; -1042;ovsdb-data.at:649;duplicate integer not allowed in string set;ovsdb negative; -1043;ovsdb-data.at:653;duplicate real not allowed in JSON set - C;ovsdb negative; -1044;ovsdb-data.at:653;duplicate real not allowed in JSON set - Python;ovsdb negative; -1045;ovsdb-data.at:657;duplicate real not allowed in string set;ovsdb negative; -1046;ovsdb-data.at:661;duplicate string not allowed in JSON set - C;ovsdb negative; -1047;ovsdb-data.at:661;duplicate string not allowed in JSON set - Python;ovsdb negative; -1048;ovsdb-data.at:665;duplicate string not allowed in string set;ovsdb negative; -1049;ovsdb-data.at:669;duplicate uuid not allowed in JSON set - C;ovsdb negative; -1050;ovsdb-data.at:669;duplicate uuid not allowed in JSON set - Python;ovsdb negative; -1051;ovsdb-data.at:676;duplicate uuid not allowed in string set;ovsdb negative; -1052;ovsdb-data.at:685;JSON map of 1 integer to boolean - C;ovsdb positive; -1053;ovsdb-data.at:685;JSON map of 1 integer to boolean - Python;ovsdb positive python; -1054;ovsdb-data.at:690;string map of 1 integer to boolean;ovsdb positive; -1055;ovsdb-data.at:695;JSON map of at least 1 integer to boolean - C;ovsdb positive; -1056;ovsdb-data.at:695;JSON map of at least 1 integer to boolean - Python;ovsdb positive python; -1057;ovsdb-data.at:704;string map of at least 1 integer to boolean;ovsdb positive; -1058;ovsdb-data.at:713;JSON map of 1 boolean to integer - C;ovsdb positive; -1059;ovsdb-data.at:713;JSON map of 1 boolean to integer - Python;ovsdb positive python; -1060;ovsdb-data.at:718;string map of 1 boolean to integer;ovsdb positive; -1061;ovsdb-data.at:723;JSON map of 1 uuid to real - C;ovsdb positive; -1062;ovsdb-data.at:723;JSON map of 1 uuid to real - Python;ovsdb positive python; -1063;ovsdb-data.at:732;string map of 1 uuid to real;ovsdb positive; -1064;ovsdb-data.at:741;JSON map of 10 string to string - C;ovsdb positive; -1065;ovsdb-data.at:741;JSON map of 10 string to string - Python;ovsdb positive python; -1066;ovsdb-data.at:755;string map of 10 string to string;ovsdb positive; -1067;ovsdb-data.at:769;duplicate integer key not allowed in JSON map - C;ovsdb negative; -1068;ovsdb-data.at:769;duplicate integer key not allowed in JSON map - Python;ovsdb negative; -1069;ovsdb-data.at:774;duplicate integer key not allowed in string map;ovsdb negative; -1070;ovsdb-column.at:3;ordinary column - C;ovsdb positive; -1071;ovsdb-column.at:3;ordinary column - Python;ovsdb positive python; -1072;ovsdb-column.at:7;immutable column - C;ovsdb positive; -1073;ovsdb-column.at:7;immutable column - Python;ovsdb positive python; -1074;ovsdb-column.at:11;ephemeral column - C;ovsdb positive; -1075;ovsdb-column.at:11;ephemeral column - Python;ovsdb positive python; -1076;ovsdb-table.at:3;non-root table with one column - C;ovsdb positive; -1077;ovsdb-table.at:3;non-root table with one column - Python;ovsdb positive python; -1078;ovsdb-table.at:7;immutable table with one column - C;ovsdb positive; -1079;ovsdb-table.at:7;immutable table with one column - Python;ovsdb positive python; -1080;ovsdb-table.at:13;root table with one column - C;ovsdb positive; -1081;ovsdb-table.at:13;root table with one column - Python;ovsdb positive python; -1082;ovsdb-table.at:19;non-root table with default_is_root=true - C;ovsdb positive; -1083;ovsdb-table.at:19;non-root table with default_is_root=true - Python;ovsdb positive python; -1084;ovsdb-table.at:23;root table with default_is_root=true - C;ovsdb positive; -1085;ovsdb-table.at:23;root table with default_is_root=true - Python;ovsdb positive python; -1086;ovsdb-table.at:29;table with maxRows of 2 - C;ovsdb positive; -1087;ovsdb-table.at:29;table with maxRows of 2 - Python;ovsdb positive python; -1088;ovsdb-table.at:34;table with index - C;ovsdb positive; -1089;ovsdb-table.at:34;table with index - Python;ovsdb positive python; -1090;ovsdb-table.at:40;table with syntax error in index - C;ovsdb negative; -1091;ovsdb-table.at:40;table with syntax error in index - Python;ovsdb negative; -1092;ovsdb-table.at:46;table with empty index - C;ovsdb negative; -1093;ovsdb-table.at:46;table with empty index - Python;ovsdb negative; -1094;ovsdb-table.at:52;table with index of ephemeral column - C;ovsdb negative; -1095;ovsdb-table.at:52;table with index of ephemeral column - Python;ovsdb negative; -1096;ovsdb-table.at:59;column names may not begin with _ - C;ovsdb negative table; -1097;ovsdb-table.at:59;column names may not begin with _ - Python;ovsdb negative table; -1098;ovsdb-table.at:65;table must have at least one column (1) - C;ovsdb negative; -1099;ovsdb-table.at:65;table must have at least one column (1) - Python;ovsdb negative; -1100;ovsdb-table.at:69;table must have at least one column (2) - C;ovsdb negative; -1101;ovsdb-table.at:69;table must have at least one column (2) - Python;ovsdb negative; -1102;ovsdb-table.at:73;table maxRows must be positive - C;ovsdb negative; -1103;ovsdb-table.at:73;table maxRows must be positive - Python;ovsdb negative; -1104;ovsdb-row.at:3;row with one string column;ovsdb positive; -1105;ovsdb-row.at:19;row with one integer column;ovsdb positive; -1106;ovsdb-row.at:35;row with one real column;ovsdb positive; -1107;ovsdb-row.at:51;row with one boolean column;ovsdb positive; -1108;ovsdb-row.at:64;row with one uuid column;ovsdb positive; -1109;ovsdb-row.at:77;row with set of 1 to 2 elements;ovsdb positive; -1110;ovsdb-row.at:84;row with map of 1 to 2 elements;ovsdb positive; -1111;ovsdb-row.at:91;row with several columns;ovsdb positive; -1112;ovsdb-row.at:113;row hashing (scalars);ovsdb positive; -1113;ovsdb-row.at:182;row hashing (sets);ovsdb positive; -1114;ovsdb-row.at:235;row hashing (maps);ovsdb positive; -1115;ovsdb-schema.at:3;schema with valid refTables - C;ovsdb positive; -1116;ovsdb-schema.at:3;schema with valid refTables - Python;ovsdb positive python; -1117;ovsdb-schema.at:30;schema with ephemeral strong references - C;ovsdb positive; -1118;ovsdb-schema.at:30;schema with ephemeral strong references - Python;ovsdb positive python; -1119;ovsdb-schema.at:61;schema without version number - C;ovsdb positive; -1120;ovsdb-schema.at:61;schema without version number - Python;ovsdb positive python; -1121;ovsdb-schema.at:71;schema with invalid refTables - C;ovsdb negative; -1122;ovsdb-schema.at:71;schema with invalid refTables - Python;ovsdb negative; -1123;ovsdb-schema.at:94;schema with invalid version number - C;ovsdb negative; -1124;ovsdb-schema.at:94;schema with invalid version number - Python;ovsdb negative; -1125;ovsdb-condition.at:3;null condition;ovsdb positive; -1126;ovsdb-condition.at:9;conditions on scalars;ovsdb positive condition; -1127;ovsdb-condition.at:75;disallowed conditions on scalars;ovsdb negative condition; -1128;ovsdb-condition.at:112;conditions on sets;ovsdb positive condition; -1129;ovsdb-condition.at:173;condition sorting;ovsdb positive; -1130;ovsdb-condition.at:187;evaluating null condition;ovsdb positive; -1131;ovsdb-condition.at:196;evaluating conditions on integers;ovsdb positive condition; -1132;ovsdb-condition.at:221;evaluating conditions on reals;ovsdb positive condition; -1133;ovsdb-condition.at:246;evaluating conditions on booleans;ovsdb positive condition; -1134;ovsdb-condition.at:270;evaluating conditions on strings;ovsdb positive condition; -1135;ovsdb-condition.at:295;evaluating conditions on UUIDs;ovsdb positive condition; -1136;ovsdb-condition.at:321;evaluating conditions on sets;ovsdb positive condition; -1137;ovsdb-condition.at:403;evaluating conditions on maps (1);ovsdb positive condition; -1138;ovsdb-condition.at:488;evaluating conditions on maps (2);ovsdb positive condition; -1139;ovsdb-mutation.at:3;null mutation;ovsdb positive; -1140;ovsdb-mutation.at:9;mutations on scalars;ovsdb positive mutation; -1141;ovsdb-mutation.at:37;disallowed mutations on scalars;ovsdb negative mutation; -1142;ovsdb-mutation.at:102;disallowed mutations on immutable columns;ovsdb negative mutation; -1143;ovsdb-mutation.at:114;mutations on sets;ovsdb positive mutation; -1144;ovsdb-mutation.at:166;executing null mutation;ovsdb positive; -1145;ovsdb-mutation.at:179;executing mutations on integers;ovsdb positive mutation; -1146;ovsdb-mutation.at:216;integer overflow detection;ovsdb positive mutation; -1147;ovsdb-mutation.at:297;executing mutations on integers with constraints;ovsdb positive mutation; -1148;ovsdb-mutation.at:336;executing mutations on reals;ovsdb positive mutation; -1149;ovsdb-mutation.at:367;real overflow detection;ovsdb positive mutation; -1150;ovsdb-mutation.at:410;executing mutations on reals with constraints;ovsdb positive mutation; -1151;ovsdb-mutation.at:443;executing mutations on integer sets;ovsdb positive mutation; -1152;ovsdb-mutation.at:517;executing mutations on integer sets with constraints;ovsdb positive mutation; -1153;ovsdb-mutation.at:556;executing mutations on real sets;ovsdb positive mutation; -1154;ovsdb-mutation.at:629;executing mutations on boolean sets;ovsdb positive mutation; -1155;ovsdb-mutation.at:679;executing mutations on string sets;ovsdb positive mutation; -1156;ovsdb-mutation.at:729;executing mutations on uuid sets;ovsdb positive mutation; -1157;ovsdb-mutation.at:779;executing mutations on integer maps;ovsdb positive mutation; -1158;ovsdb-query.at:3;queries on scalars;ovsdb positive query; -1159;ovsdb-query.at:95;queries on sets;ovsdb positive query; -1160;ovsdb-query.at:176;queries on maps (1);ovsdb positive query; -1161;ovsdb-query.at:260;queries on maps (2);ovsdb positive query; -1162;ovsdb-query.at:351;UUID-distinct queries on scalars;ovsdb positive query; -1163;ovsdb-query.at:444;Boolean-distinct queries on scalars;ovsdb positive query; -1164;ovsdb-query.at:537;parse colunn set containing bad name;ovsdb negative; -1165;ovsdb-transaction.at:3;empty table, empty transaction;ovsdb positive; -1166;ovsdb-transaction.at:17;nonempty table, empty transaction;ovsdb positive; -1167;ovsdb-transaction.at:41;insert, commit;ovsdb positive transaction; -1168;ovsdb-transaction.at:70;insert, abort;ovsdb positive transaction; -1169;ovsdb-transaction.at:98;modify, commit;ovsdb positive transaction; -1170;ovsdb-transaction.at:127;modify, abort;ovsdb positive transaction; -1171;ovsdb-transaction.at:156;delete, commit;ovsdb positive transaction; -1172;ovsdb-transaction.at:181;delete, abort;ovsdb positive transaction; -1173;ovsdb-transaction.at:207;modify, delete, commit;ovsdb positive transaction; -1174;ovsdb-transaction.at:234;modify, delete, abort;ovsdb positive transaction; -1175;ovsdb-transaction.at:262;insert, delete, commit;ovsdb positive transaction; -1176;ovsdb-transaction.at:291;insert, delete, abort;ovsdb positive transaction; -1177;ovsdb-transaction.at:322;insert, modify, delete, commit;ovsdb positive transaction; -1178;ovsdb-transaction.at:353;insert, modify, delete, abort;ovsdb positive transaction; -1179;ovsdb-transaction.at:385;deletes are aborted cleanly;ovsdb positive transaction; -1180;ovsdb-execution.at:147;uuid-name must be ;ovsdb execute execution positive; -1181;ovsdb-execution.at:157;named-uuid must be ;ovsdb execute execution positive; -1182;ovsdb-execution.at:166;duplicate uuid-name not allowed;ovsdb execute execution positive; -1183;ovsdb-execution.at:1102;insert default row, query table;ovsdb execute execution positive; -1184;ovsdb-execution.at:1102;insert row, query table;ovsdb execute execution positive; -1185;ovsdb-execution.at:1102;insert rows, query by value;ovsdb execute execution positive; -1186;ovsdb-execution.at:1102;insert rows, query by named-uuid;ovsdb execute execution positive; -1187;ovsdb-execution.at:1102;insert rows, update rows by value;ovsdb execute execution positive; -1188;ovsdb-execution.at:1102;insert rows, mutate rows;ovsdb execute execution positive; -1189;ovsdb-execution.at:1102;insert rows, delete by named-uuid;ovsdb execute execution positive; -1190;ovsdb-execution.at:1102;insert rows, delete rows by value;ovsdb execute execution positive; -1191;ovsdb-execution.at:1102;insert rows, delete by (non-matching) value;ovsdb execute execution positive; -1192;ovsdb-execution.at:1102;insert rows, delete all;ovsdb execute execution positive; -1193;ovsdb-execution.at:1102;insert row, query table, commit;ovsdb execute execution positive; -1194;ovsdb-execution.at:1102;insert row, query table, commit durably;ovsdb execute execution positive; -1195;ovsdb-execution.at:1102;equality wait with correct rows;ovsdb execute execution positive; -1196;ovsdb-execution.at:1102;equality wait with extra row;ovsdb execute execution positive; -1197;ovsdb-execution.at:1102;equality wait with missing row;ovsdb execute execution positive; -1198;ovsdb-execution.at:1102;inequality wait with correct rows;ovsdb execute execution positive; -1199;ovsdb-execution.at:1102;inequality wait with extra row;ovsdb execute execution positive; -1200;ovsdb-execution.at:1102;inequality wait with missing row;ovsdb execute execution positive; -1201;ovsdb-execution.at:1102;insert and update constraints;ovsdb execute execution positive; -1202;ovsdb-execution.at:1102;index uniqueness checking;ovsdb execute execution positive; -1203;ovsdb-execution.at:1102;referential integrity -- simple;ovsdb execute execution positive; -1204;ovsdb-execution.at:1102;referential integrity -- mutual references;ovsdb execute execution positive; -1205;ovsdb-execution.at:1102;weak references;ovsdb execute execution positive; -1206;ovsdb-execution.at:1102;immutable columns;ovsdb execute execution positive; -1207;ovsdb-execution.at:1102;garbage collection;ovsdb execute execution positive; -1208;ovsdb-trigger.at:15;trigger fires immediately;ovsdb execute execution trigger positive; -1209;ovsdb-trigger.at:38;trigger times out;ovsdb execute execution trigger positive; -1210;ovsdb-trigger.at:61;trigger fires after delay;ovsdb execute execution trigger positive; -1211;ovsdb-trigger.at:92;delayed trigger modifies database;ovsdb execute execution trigger positive; -1212;ovsdb-trigger.at:132;one delayed trigger wakes up another;ovsdb execute execution trigger positive; -1213;ovsdb-tool.at:30;insert default row, query table;ovsdb file positive; -1214;ovsdb-tool.at:30;insert row, query table;ovsdb file positive; -1215;ovsdb-tool.at:30;insert rows, query by value;ovsdb file positive; -1216;ovsdb-tool.at:30;insert rows, query by named-uuid;ovsdb file positive; -1217;ovsdb-tool.at:30;insert rows, update rows by value;ovsdb file positive; -1218;ovsdb-tool.at:30;insert rows, mutate rows;ovsdb file positive; -1219;ovsdb-tool.at:30;insert rows, delete by named-uuid;ovsdb file positive; -1220;ovsdb-tool.at:30;insert rows, delete rows by value;ovsdb file positive; -1221;ovsdb-tool.at:30;insert rows, delete by (non-matching) value;ovsdb file positive; -1222;ovsdb-tool.at:30;insert rows, delete all;ovsdb file positive; -1223;ovsdb-tool.at:30;insert row, query table, commit;ovsdb file positive; -1224;ovsdb-tool.at:30;insert row, query table, commit durably;ovsdb file positive; -1225;ovsdb-tool.at:30;equality wait with correct rows;ovsdb file positive; -1226;ovsdb-tool.at:30;equality wait with extra row;ovsdb file positive; -1227;ovsdb-tool.at:30;equality wait with missing row;ovsdb file positive; -1228;ovsdb-tool.at:30;inequality wait with correct rows;ovsdb file positive; -1229;ovsdb-tool.at:30;inequality wait with extra row;ovsdb file positive; -1230;ovsdb-tool.at:30;inequality wait with missing row;ovsdb file positive; -1231;ovsdb-tool.at:30;insert and update constraints;ovsdb file positive; -1232;ovsdb-tool.at:30;index uniqueness checking;ovsdb file positive; -1233;ovsdb-tool.at:30;referential integrity -- simple;ovsdb file positive; -1234;ovsdb-tool.at:30;referential integrity -- mutual references;ovsdb file positive; -1235;ovsdb-tool.at:30;weak references;ovsdb file positive; -1236;ovsdb-tool.at:30;immutable columns;ovsdb file positive; -1237;ovsdb-tool.at:30;garbage collection;ovsdb file positive; -1238;ovsdb-tool.at:32;transaction comments;ovsdb file positive; -1239;ovsdb-tool.at:50;ovsdb-tool compact;ovsdb file positive; -1240;ovsdb-tool.at:158;ovsdb-tool convert -- removing a column;ovsdb file positive; -1241;ovsdb-tool.at:222;ovsdb-tool convert -- adding a column;ovsdb file positive; -1242;ovsdb-tool.at:285;ovsdb-tool schema-version;ovsdb file positive; -1243;ovsdb-tool.at:292;ovsdb-tool db-version;ovsdb file positive; -1244;ovsdb-tool.at:301;ovsdb-tool schema-cksum;ovsdb file positive; -1245;ovsdb-tool.at:308;ovsdb-tool db-cksum;ovsdb file positive; -1246;ovsdb-tool.at:317;ovsdb-tool needs-conversion (no conversion needed);ovsdb file positive; -1247;ovsdb-tool.at:326;ovsdb-tool needs-conversion (conversion needed);ovsdb file positive; -1248;ovsdb-server.at:39;insert default row, query table;ovsdb server positive unix; -1249;ovsdb-server.at:39;insert row, query table;ovsdb server positive unix; -1250;ovsdb-server.at:39;insert rows, query by value;ovsdb server positive unix; -1251;ovsdb-server.at:39;insert rows, query by named-uuid;ovsdb server positive unix; -1252;ovsdb-server.at:39;insert rows, update rows by value;ovsdb server positive unix; -1253;ovsdb-server.at:39;insert rows, mutate rows;ovsdb server positive unix; -1254;ovsdb-server.at:39;insert rows, delete by named-uuid;ovsdb server positive unix; -1255;ovsdb-server.at:39;insert rows, delete rows by value;ovsdb server positive unix; -1256;ovsdb-server.at:39;insert rows, delete by (non-matching) value;ovsdb server positive unix; -1257;ovsdb-server.at:39;insert rows, delete all;ovsdb server positive unix; -1258;ovsdb-server.at:39;insert row, query table, commit;ovsdb server positive unix; -1259;ovsdb-server.at:39;insert row, query table, commit durably;ovsdb server positive unix; -1260;ovsdb-server.at:39;equality wait with correct rows;ovsdb server positive unix; -1261;ovsdb-server.at:39;equality wait with extra row;ovsdb server positive unix; -1262;ovsdb-server.at:39;equality wait with missing row;ovsdb server positive unix; -1263;ovsdb-server.at:39;inequality wait with correct rows;ovsdb server positive unix; -1264;ovsdb-server.at:39;inequality wait with extra row;ovsdb server positive unix; -1265;ovsdb-server.at:39;inequality wait with missing row;ovsdb server positive unix; -1266;ovsdb-server.at:39;insert and update constraints;ovsdb server positive unix; -1267;ovsdb-server.at:39;index uniqueness checking;ovsdb server positive unix; -1268;ovsdb-server.at:39;referential integrity -- simple;ovsdb server positive unix; -1269;ovsdb-server.at:39;referential integrity -- mutual references;ovsdb server positive unix; -1270;ovsdb-server.at:39;weak references;ovsdb server positive unix; -1271;ovsdb-server.at:39;immutable columns;ovsdb server positive unix; -1272;ovsdb-server.at:39;garbage collection;ovsdb server positive unix; -1273;ovsdb-server.at:43;truncating corrupted database log;ovsdb server positive unix; -1274;ovsdb-server.at:90;truncating database log with bad transaction;ovsdb server positive unix; -1275;ovsdb-server.at:138;ovsdb-client get-schema-version;ovsdb server positive; -1276;ovsdb-server.at:149;database multiplexing implementation;ovsdb server positive; -1277;ovsdb-server.at:169;ovsdb-server/add-db and remove-db;ovsdb server positive; -1278;ovsdb-server.at:247;ovsdb-server/add-db with --monitor;ovsdb server positive; -1279;ovsdb-server.at:279;ovsdb-server/add-db and remove-db with --monitor;ovsdb server positive; -1280;ovsdb-server.at:309;--remote=db: implementation;ovsdb server positive; -1281;ovsdb-server.at:374;ovsdb-server/add-remote and remove-remote;ovsdb server positive; -1282;ovsdb-server.at:416;ovsdb-server/add-remote with --monitor;ovsdb server positive; -1283;ovsdb-server.at:446;ovsdb-server/add-remote and remove-remote with --monitor;ovsdb server positive; -1284;ovsdb-server.at:480;SSL db: implementation;ovsdb server positive ssl \$5; -1285;ovsdb-server.at:534;compacting online;ovsdb server compact; -1286;ovsdb-server.at:667;ovsdb-server combines updates on backlogged connections;; -1287;ovsdb-server.at:792;insert default row, query table;ovsdb server positive ssl; -1288;ovsdb-server.at:792;insert row, query table;ovsdb server positive ssl; -1289;ovsdb-server.at:792;insert rows, query by value;ovsdb server positive ssl; -1290;ovsdb-server.at:792;insert rows, query by named-uuid;ovsdb server positive ssl; -1291;ovsdb-server.at:792;insert rows, update rows by value;ovsdb server positive ssl; -1292;ovsdb-server.at:792;insert rows, mutate rows;ovsdb server positive ssl; -1293;ovsdb-server.at:792;insert rows, delete by named-uuid;ovsdb server positive ssl; -1294;ovsdb-server.at:792;insert rows, delete rows by value;ovsdb server positive ssl; -1295;ovsdb-server.at:792;insert rows, delete by (non-matching) value;ovsdb server positive ssl; -1296;ovsdb-server.at:792;insert rows, delete all;ovsdb server positive ssl; -1297;ovsdb-server.at:792;insert row, query table, commit;ovsdb server positive ssl; -1298;ovsdb-server.at:792;insert row, query table, commit durably;ovsdb server positive ssl; -1299;ovsdb-server.at:792;equality wait with correct rows;ovsdb server positive ssl; -1300;ovsdb-server.at:792;equality wait with extra row;ovsdb server positive ssl; -1301;ovsdb-server.at:792;equality wait with missing row;ovsdb server positive ssl; -1302;ovsdb-server.at:792;inequality wait with correct rows;ovsdb server positive ssl; -1303;ovsdb-server.at:792;inequality wait with extra row;ovsdb server positive ssl; -1304;ovsdb-server.at:792;inequality wait with missing row;ovsdb server positive ssl; -1305;ovsdb-server.at:792;insert and update constraints;ovsdb server positive ssl; -1306;ovsdb-server.at:792;index uniqueness checking;ovsdb server positive ssl; -1307;ovsdb-server.at:792;referential integrity -- simple;ovsdb server positive ssl; -1308;ovsdb-server.at:792;referential integrity -- mutual references;ovsdb server positive ssl; -1309;ovsdb-server.at:792;weak references;ovsdb server positive ssl; -1310;ovsdb-server.at:792;immutable columns;ovsdb server positive ssl; -1311;ovsdb-server.at:792;garbage collection;ovsdb server positive ssl; -1312;ovsdb-server.at:831;insert default row, query table;ovsdb server positive ssl6; -1313;ovsdb-server.at:835;ovsdb-client get-schema-version - tcp socket;ovsdb server positive tcp; -1314;ovsdb-server.at:881;insert default row, query table;ovsdb server positive tcp; -1315;ovsdb-server.at:881;insert row, query table;ovsdb server positive tcp; -1316;ovsdb-server.at:881;insert rows, query by value;ovsdb server positive tcp; -1317;ovsdb-server.at:881;insert rows, query by named-uuid;ovsdb server positive tcp; -1318;ovsdb-server.at:881;insert rows, update rows by value;ovsdb server positive tcp; -1319;ovsdb-server.at:881;insert rows, mutate rows;ovsdb server positive tcp; -1320;ovsdb-server.at:881;insert rows, delete by named-uuid;ovsdb server positive tcp; -1321;ovsdb-server.at:881;insert rows, delete rows by value;ovsdb server positive tcp; -1322;ovsdb-server.at:881;insert rows, delete by (non-matching) value;ovsdb server positive tcp; -1323;ovsdb-server.at:881;insert rows, delete all;ovsdb server positive tcp; -1324;ovsdb-server.at:881;insert row, query table, commit;ovsdb server positive tcp; -1325;ovsdb-server.at:881;insert row, query table, commit durably;ovsdb server positive tcp; -1326;ovsdb-server.at:881;equality wait with correct rows;ovsdb server positive tcp; -1327;ovsdb-server.at:881;equality wait with extra row;ovsdb server positive tcp; -1328;ovsdb-server.at:881;equality wait with missing row;ovsdb server positive tcp; -1329;ovsdb-server.at:881;inequality wait with correct rows;ovsdb server positive tcp; -1330;ovsdb-server.at:881;inequality wait with extra row;ovsdb server positive tcp; -1331;ovsdb-server.at:881;inequality wait with missing row;ovsdb server positive tcp; -1332;ovsdb-server.at:881;insert and update constraints;ovsdb server positive tcp; -1333;ovsdb-server.at:881;index uniqueness checking;ovsdb server positive tcp; -1334;ovsdb-server.at:881;referential integrity -- simple;ovsdb server positive tcp; -1335;ovsdb-server.at:881;referential integrity -- mutual references;ovsdb server positive tcp; -1336;ovsdb-server.at:881;weak references;ovsdb server positive tcp; -1337;ovsdb-server.at:881;immutable columns;ovsdb server positive tcp; -1338;ovsdb-server.at:881;garbage collection;ovsdb server positive tcp; -1339;ovsdb-server.at:919;insert default row, query table;ovsdb server positive tcp6; -1340;ovsdb-server.at:955;insert default row, query table;ovsdb server positive transient; -1341;ovsdb-server.at:955;insert row, query table;ovsdb server positive transient; -1342;ovsdb-server.at:955;insert rows, query by value;ovsdb server positive transient; -1343;ovsdb-server.at:955;insert rows, query by named-uuid;ovsdb server positive transient; -1344;ovsdb-server.at:955;insert rows, update rows by value;ovsdb server positive transient; -1345;ovsdb-server.at:955;insert rows, mutate rows;ovsdb server positive transient; -1346;ovsdb-server.at:955;insert rows, delete by named-uuid;ovsdb server positive transient; -1347;ovsdb-server.at:955;insert rows, delete rows by value;ovsdb server positive transient; -1348;ovsdb-server.at:955;insert rows, delete by (non-matching) value;ovsdb server positive transient; -1349;ovsdb-server.at:955;insert rows, delete all;ovsdb server positive transient; -1350;ovsdb-server.at:955;insert row, query table, commit;ovsdb server positive transient; -1351;ovsdb-server.at:955;insert row, query table, commit durably;ovsdb server positive transient; -1352;ovsdb-server.at:955;equality wait with correct rows;ovsdb server positive transient; -1353;ovsdb-server.at:955;equality wait with extra row;ovsdb server positive transient; -1354;ovsdb-server.at:955;equality wait with missing row;ovsdb server positive transient; -1355;ovsdb-server.at:955;inequality wait with correct rows;ovsdb server positive transient; -1356;ovsdb-server.at:955;inequality wait with extra row;ovsdb server positive transient; -1357;ovsdb-server.at:955;inequality wait with missing row;ovsdb server positive transient; -1358;ovsdb-server.at:955;insert and update constraints;ovsdb server positive transient; -1359;ovsdb-server.at:955;index uniqueness checking;ovsdb server positive transient; -1360;ovsdb-server.at:955;referential integrity -- simple;ovsdb server positive transient; -1361;ovsdb-server.at:955;referential integrity -- mutual references;ovsdb server positive transient; -1362;ovsdb-server.at:955;weak references;ovsdb server positive transient; -1363;ovsdb-server.at:955;immutable columns;ovsdb server positive transient; -1364;ovsdb-server.at:955;garbage collection;ovsdb server positive transient; -1365;ovsdb-monitor.at:42;monitor insert into empty table;ovsdb server monitor positive; -1366;ovsdb-monitor.at:54;monitor insert into populated table;ovsdb server monitor positive; -1367;ovsdb-monitor.at:72;monitor delete;ovsdb server monitor positive; -1368;ovsdb-monitor.at:90;monitor row update;ovsdb server monitor positive; -1369;ovsdb-monitor.at:110;monitor no-op row updates;ovsdb server monitor positive; -1370;ovsdb-monitor.at:133;monitor insert-and-update transaction;ovsdb server monitor positive; -1371;ovsdb-monitor.at:156;monitor insert-update-and-delete transaction;ovsdb server monitor positive; -1372;ovsdb-monitor.at:185;monitor weak reference change;ovsdb server monitor positive; -1373;ovsdb-monitor.at:220;monitor insert-update-and-delete transaction;ovsdb server monitor positive; -1374;ovsdb-monitor.at:271;monitor all operations;ovsdb server monitor positive; -1375;ovsdb-monitor.at:291;monitor initial only;ovsdb server monitor positive; -1376;ovsdb-monitor.at:298;monitor insert only;ovsdb server monitor positive; -1377;ovsdb-monitor.at:305;monitor delete only;ovsdb server monitor positive; -1378;ovsdb-monitor.at:313;monitor modify only;ovsdb server monitor positive; -1379;ovsdb-idl.at:103;simple idl, initially empty, no ops - C;ovsdb server idl positive; -1380;ovsdb-idl.at:103;simple idl, initially empty, no ops - Python;ovsdb server idl positive python; -1381;ovsdb-idl.at:103;simple idl, initially empty, no ops - Python tcp;ovsdb server idl positive python with tcp socket; -1382;ovsdb-idl.at:103;simple idl, initially empty, no ops - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1383;ovsdb-idl.at:110;simple idl, initially empty, various ops - C;ovsdb server idl positive; -1384;ovsdb-idl.at:110;simple idl, initially empty, various ops - Python;ovsdb server idl positive python; -1385;ovsdb-idl.at:110;simple idl, initially empty, various ops - Python tcp;ovsdb server idl positive python with tcp socket; -1386;ovsdb-idl.at:110;simple idl, initially empty, various ops - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1387;ovsdb-idl.at:188;simple idl, initially populated - C;ovsdb server idl positive; -1388;ovsdb-idl.at:188;simple idl, initially populated - Python;ovsdb server idl positive python; -1389;ovsdb-idl.at:188;simple idl, initially populated - Python tcp;ovsdb server idl positive python with tcp socket; -1390;ovsdb-idl.at:188;simple idl, initially populated - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1391;ovsdb-idl.at:219;simple idl, writing via IDL - C;ovsdb server idl positive; -1392;ovsdb-idl.at:219;simple idl, writing via IDL - Python;ovsdb server idl positive python; -1393;ovsdb-idl.at:219;simple idl, writing via IDL - Python tcp;ovsdb server idl positive python with tcp socket; -1394;ovsdb-idl.at:219;simple idl, writing via IDL - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1395;ovsdb-idl.at:250;simple idl, handling verification failure - C;ovsdb server idl positive; -1396;ovsdb-idl.at:250;simple idl, handling verification failure - Python;ovsdb server idl positive python; -1397;ovsdb-idl.at:250;simple idl, handling verification failure - Python tcp;ovsdb server idl positive python with tcp socket; -1398;ovsdb-idl.at:250;simple idl, handling verification failure - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1399;ovsdb-idl.at:281;simple idl, increment operation - C;ovsdb server idl positive; -1400;ovsdb-idl.at:281;simple idl, increment operation - Python;ovsdb server idl positive python; -1401;ovsdb-idl.at:281;simple idl, increment operation - Python tcp;ovsdb server idl positive python with tcp socket; -1402;ovsdb-idl.at:281;simple idl, increment operation - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1403;ovsdb-idl.at:293;simple idl, aborting - C;ovsdb server idl positive; -1404;ovsdb-idl.at:293;simple idl, aborting - Python;ovsdb server idl positive python; -1405;ovsdb-idl.at:293;simple idl, aborting - Python tcp;ovsdb server idl positive python with tcp socket; -1406;ovsdb-idl.at:293;simple idl, aborting - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1407;ovsdb-idl.at:307;simple idl, destroy without commit or abort - C;ovsdb server idl positive; -1408;ovsdb-idl.at:307;simple idl, destroy without commit or abort - Python;ovsdb server idl positive python; -1409;ovsdb-idl.at:307;simple idl, destroy without commit or abort - Python tcp;ovsdb server idl positive python with tcp socket; -1410;ovsdb-idl.at:307;simple idl, destroy without commit or abort - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1411;ovsdb-idl.at:321;self-linking idl, consistent ops - C;ovsdb server idl positive; -1412;ovsdb-idl.at:321;self-linking idl, consistent ops - Python;ovsdb server idl positive python; -1413;ovsdb-idl.at:321;self-linking idl, consistent ops - Python tcp;ovsdb server idl positive python with tcp socket; -1414;ovsdb-idl.at:321;self-linking idl, consistent ops - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1415;ovsdb-idl.at:365;self-linking idl, inconsistent ops - C;ovsdb server idl positive; -1416;ovsdb-idl.at:365;self-linking idl, inconsistent ops - Python;ovsdb server idl positive python; -1417;ovsdb-idl.at:365;self-linking idl, inconsistent ops - Python tcp;ovsdb server idl positive python with tcp socket; -1418;ovsdb-idl.at:365;self-linking idl, inconsistent ops - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1419;ovsdb-idl.at:413;self-linking idl, sets - C;ovsdb server idl positive; -1420;ovsdb-idl.at:413;self-linking idl, sets - Python;ovsdb server idl positive python; -1421;ovsdb-idl.at:413;self-linking idl, sets - Python tcp;ovsdb server idl positive python with tcp socket; -1422;ovsdb-idl.at:413;self-linking idl, sets - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1423;ovsdb-idl.at:463;external-linking idl, consistent ops - C;ovsdb server idl positive; -1424;ovsdb-idl.at:463;external-linking idl, consistent ops - Python;ovsdb server idl positive python; -1425;ovsdb-idl.at:463;external-linking idl, consistent ops - Python tcp;ovsdb server idl positive python with tcp socket; -1426;ovsdb-idl.at:463;external-linking idl, consistent ops - Python tcp6;ovsdb server idl positive python with tcp6 socket; -1427;ovsdb-idl.at:481;external-linking idl, insert ops - Python;ovsdb server idl positive python; -1428;ovsdb-idl.at:491;getattr idl, insert ops - Python;ovsdb server idl positive python; -1429;ovs-vsctl.at:145;ovs-vsctl connection retry;; -1430;ovs-vsctl.at:179;add-br a;ovs-vsctl; -1431;ovs-vsctl.at:189;add-br a, add-br a;ovs-vsctl; -1432;ovs-vsctl.at:199;add-br a, add-br b;ovs-vsctl; -1433;ovs-vsctl.at:216;add-br a, add-br b, del-br a;ovs-vsctl; -1434;ovs-vsctl.at:227;add-br a, del-br a, add-br a;ovs-vsctl; -1435;ovs-vsctl.at:247;add-br a, add-port a a1, add-port a a2;ovs-vsctl; -1436;ovs-vsctl.at:261;add-br a, add-port a a1, add-port a a1;ovs-vsctl; -1437;ovs-vsctl.at:273;add-br a b, add-port a a1, add-port b b1, del-br a;ovs-vsctl; -1438;ovs-vsctl.at:295;add-br a, add-bond a bond0 a1 a2 a3;ovs-vsctl; -1439;ovs-vsctl.at:313;add-br a b, add-port a a1, add-port b b1, del-port a a1;ovs-vsctl; -1440;ovs-vsctl.at:344;add-br a, add-bond a bond0 a1 a2 a3, del-port bond0;ovs-vsctl; -1441;ovs-vsctl.at:361;external IDs;ovs-vsctl; -1442;ovs-vsctl.at:417;controllers;controller ovs-vsctl; -1443;ovs-vsctl.at:544;simple fake bridge (VLAN 9);ovs-vsctl fake-bridge; -1444;ovs-vsctl.at:544;list bridges -- real and fake (VLAN 9);ovs-vsctl fake-bridge; -1445;ovs-vsctl.at:544;simple fake bridge + del-br fake bridge (VLAN 9);ovs-vsctl fake-bridge; -1446;ovs-vsctl.at:544;simple fake bridge + del-br real bridge (VLAN 9);ovs-vsctl fake-bridge; -1447;ovs-vsctl.at:544;simple fake bridge + external IDs (VLAN 9);ovs-vsctl fake-bridge; -1448;ovs-vsctl.at:545;simple fake bridge (VLAN 0);ovs-vsctl fake-bridge; -1449;ovs-vsctl.at:545;list bridges -- real and fake (VLAN 0);ovs-vsctl fake-bridge; -1450;ovs-vsctl.at:545;simple fake bridge + del-br fake bridge (VLAN 0);ovs-vsctl fake-bridge; -1451;ovs-vsctl.at:545;simple fake bridge + del-br real bridge (VLAN 0);ovs-vsctl fake-bridge; -1452;ovs-vsctl.at:545;simple fake bridge + external IDs (VLAN 0);ovs-vsctl fake-bridge; -1453;ovs-vsctl.at:557;fake bridge on bond;ovs-vsctl fake-bridge; -1454;ovs-vsctl.at:569;fake bridge on bond + del-br fake bridge;ovs-vsctl fake-bridge; -1455;ovs-vsctl.at:581;fake bridge on bond + del-br real bridge;ovs-vsctl fake-bridge; -1456;ovs-vsctl.at:593;managers;manager ovs-vsctl; -1457;ovs-vsctl.at:619;database commands -- positive checks;ovs-vsctl; -1458;ovs-vsctl.at:725;database commands -- negative checks;ovs-vsctl; -1459;ovs-vsctl.at:850;database commands -- conditions;ovs-vsctl; -1460;ovs-vsctl.at:985;database commands -- wait-until immediately true;ovs-vsctl; -1461;ovs-vsctl.at:1004;database commands -- wait-until must wait;ovs-vsctl; -1462;ovs-vsctl.at:1038;--id option on create, get commands;ovs-vsctl; -1463;ovs-vsctl.at:1087;unreferenced record warnings;ovs-vsctl; -1464;ovs-vsctl.at:1121;created row UUID is wrong in same execution;ovs-vsctl; -1465;ovs-vsctl.at:1153;--all option on destroy command;ovs-vsctl; -1466;ovs-vsctl.at:1201;add-port -- reserved names 1;; -1467;ovs-vsctl.at:1229;add-port -- reserved names 2;; -1468;ovs-monitor-ipsec.at:3;ovs-monitor-ipsec;; -1469;ovs-xapi-sync.at:3;ovs-xapi-sync;; -1470;interface-reconfigure.at:697;non-VLAN, non-bond;interface-reconfigure; -1471;interface-reconfigure.at:773;VLAN, non-bond;interface-reconfigure; -1472;interface-reconfigure.at:847;Bond, non-VLAN;interface-reconfigure; -1473;interface-reconfigure.at:936;VLAN on bond;interface-reconfigure; -1474;interface-reconfigure.at:1036;Re-create port with different types;interface-reconfigure; -1475;stp.at:3;STP example from IEEE 802.1D-1998;stp; -1476;stp.at:27;STP example from IEEE 802.1D-2004 figures 17.4 and 17.5;stp; -1477;stp.at:70;STP example from IEEE 802.1D-2004 figure 17.6;stp; -1478;stp.at:96;STP example from IEEE 802.1D-2004 figure 17.7;stp; -1479;stp.at:125;STP.io.1.1: Link Failure;stp; -1480;stp.at:164;STP.io.1.2: Repeated Network;stp; -1481;stp.at:188;STP.io.1.4: Network Initialization;stp; -1482;stp.at:214;STP.io.1.5: Topology Change;stp; -1483;stp.at:267;STP.op.1.1 and STP.op.1.2;stp; -1484;stp.at:281;STP.op.1.4: All Ports Initialized to Designated Ports;stp; -1485;stp.at:302;STP.op.3.1: Root Bridge Selection: Root ID Values;stp; -1486;stp.at:322;STP.op.3.3: Root Bridge Selection: Bridge ID Values;stp; -1487;stp.at:345;STP.op.3.3: Root Bridge Selection: Bridge ID Values;stp; -1488;vlog.at:3;vlog - Python;; -1489;vlog.at:104;vlog - vlog/reopen - Python;; -1490;vlog.at:133;vlog - vlog/reopen without log file - Python;; -1491;vlog.at:151;vlog - vlog/reopen can't reopen log file - Python;; -1492;vlog.at:183;vlog - vlog/set and vlog/list - Python;; -1493;vtep-ctl.at:136;add-ps a;vtep-ctl; -1494;vtep-ctl.at:144;add-ps a, add-ps a;vtep-ctl; -1495;vtep-ctl.at:154;add-ps a, add-ps b;vtep-ctl; -1496;vtep-ctl.at:163;add-ps a, add-ps b, del-ps a;vtep-ctl; -1497;vtep-ctl.at:172;add-ps a, del-ps a, add-ps a;vtep-ctl; -1498;vtep-ctl.at:186;add-ps a, add-port a a1, add-port a a2;vtep-ctl; -1499;vtep-ctl.at:199;add-ps a, add-port a a1, add-port a a1;vtep-ctl; -1500;vtep-ctl.at:211;add-ps a b, add-port a a1, add-port b b1, del-ps a;vtep-ctl; -1501;vtep-ctl.at:232;add-ps a b, add-port a a1, add-port b b1, del-port a a1;vtep-ctl; -1502;vtep-ctl.at:249;add-ps a b, add-port a p1, add-port b p1, del-port a p1;vtep-ctl; -1503;vtep-ctl.at:272;add-ls a;vtep-ctl; -1504;vtep-ctl.at:280;add-ls a, add-ls a;vtep-ctl; -1505;vtep-ctl.at:290;add-ls a, add-ls b;vtep-ctl; -1506;vtep-ctl.at:299;add-ls a, add-ls b, del-ls a;vtep-ctl; -1507;vtep-ctl.at:308;add-ls a, del-ls a, add-ls a;vtep-ctl; -1508;vtep-ctl.at:326;bind-ls ps1 pp1 300 ls1;vtep-ctl; -1509;vtep-ctl.at:344;bind-ls ps1 pp1 300 ls1, bind-ls ps1 pp1 400 ls2;vtep-ctl; -1510;vtep-ctl.at:366;bind-ls ps1 pp1 300, bind-ls ps2 pp2 300 ls2;vtep-ctl; -1511;vtep-ctl.at:397;add-ucast-local ls1;vtep-ctl; -1512;vtep-ctl.at:424;add-ucast-local ls1, overwrite;vtep-ctl; -1513;vtep-ctl.at:444;add-ucast-local ls1, del-ucast-local ls1;vtep-ctl; -1514;vtep-ctl.at:475;add-ucast-remote ls1;vtep-ctl; -1515;vtep-ctl.at:502;add-ucast-remote ls1, overwrite;vtep-ctl; -1516;vtep-ctl.at:522;add-ucast-remote ls1, del-ucast-remote ls1;vtep-ctl; -1517;vtep-ctl.at:553;add-ucast-local ls1, add-ucast-remote ls1;vtep-ctl; -1518;vtep-ctl.at:584;add-mcast-local ls1;vtep-ctl; -1519;vtep-ctl.at:613;add-mcast-local ls1, del-mcast-local ls1;vtep-ctl; -1520;vtep-ctl.at:650;add-mcast-remote ls1;vtep-ctl; -1521;vtep-ctl.at:679;add-mcast-remote ls1, del-mcast-remote ls1;vtep-ctl; -1522;vtep-ctl.at:716;add-mcast-local ls1, add-mcast-remote ls1;vtep-ctl; -1523;vtep-ctl.at:751;add local and remote macs, clear-local-macs;vtep-ctl; -1524;vtep-ctl.at:808;add local and remote macs, clear-remote-macs;vtep-ctl; -1525;vtep-ctl.at:868;managers;manager vtep-ctl; -" -# List of the all the test groups. -at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` - -# at_fn_validate_ranges NAME... -# ----------------------------- -# Validate and normalize the test group number contained in each variable -# NAME. Leading zeroes are treated as decimal. -at_fn_validate_ranges () -{ - for at_grp - do - eval at_value=\$$at_grp - if test $at_value -lt 1 || test $at_value -gt 1525; then - $as_echo "invalid test group: $at_value" >&2 - exit 1 - fi - case $at_value in - 0*) # We want to treat leading 0 as decimal, like expr and test, but - # AS_VAR_ARITH treats it as octal if it uses $(( )). - # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the - # expr fork, but it is not worth the effort to determine if the - # shell supports XSI when the user can just avoid leading 0. - eval $at_grp='`expr $at_value + 0`' ;; - esac - done -} - -at_prev= -for at_option -do - # If the previous option needs an argument, assign it. - if test -n "$at_prev"; then - at_option=$at_prev=$at_option - at_prev= - fi - - case $at_option in - *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;; - *) at_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $at_option in - --help | -h ) - at_help_p=: - ;; - - --list | -l ) - at_list_p=: - ;; - - --version | -V ) - at_version_p=: - ;; - - --clean | -c ) - at_clean=: - ;; - - --color ) - at_color=always - ;; - --color=* ) - case $at_optarg in - no | never | none) at_color=never ;; - auto | tty | if-tty) at_color=auto ;; - always | yes | force) at_color=always ;; - *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'` - as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;; - esac - ;; - - --debug | -d ) - at_debug_p=: - ;; - - --errexit | -e ) - at_debug_p=: - at_errexit_p=: - ;; - - --verbose | -v ) - at_verbose=; at_quiet=: - ;; - - --trace | -x ) - at_traceon='set -x' - at_trace_echo=echo - at_check_filter_trace=at_fn_filter_trace - ;; - - [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) - at_fn_validate_ranges at_option - as_fn_append at_groups "$at_option$as_nl" - ;; - - # Ranges - [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) - at_range_start=`echo $at_option |tr -d X-` - at_fn_validate_ranges at_range_start - at_range=`$as_echo "$at_groups_all" | \ - sed -ne '/^'$at_range_start'$/,$p'` - as_fn_append at_groups "$at_range$as_nl" - ;; - - -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) - at_range_end=`echo $at_option |tr -d X-` - at_fn_validate_ranges at_range_end - at_range=`$as_echo "$at_groups_all" | \ - sed -ne '1,/^'$at_range_end'$/p'` - as_fn_append at_groups "$at_range$as_nl" - ;; - - [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ - [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ - [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ - [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ - [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ - [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) - at_range_start=`expr $at_option : '\(.*\)-'` - at_range_end=`expr $at_option : '.*-\(.*\)'` - if test $at_range_start -gt $at_range_end; then - at_tmp=$at_range_end - at_range_end=$at_range_start - at_range_start=$at_tmp - fi - at_fn_validate_ranges at_range_start at_range_end - at_range=`$as_echo "$at_groups_all" | \ - sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` - as_fn_append at_groups "$at_range$as_nl" - ;; - - # Directory selection. - --directory | -C ) - at_prev=--directory - ;; - --directory=* ) - at_change_dir=: - at_dir=$at_optarg - if test x- = "x$at_dir" ; then - at_dir=./- - fi - ;; - - # Parallel execution. - --jobs | -j ) - at_jobs=0 - ;; - --jobs=* | -j[0-9]* ) - if test -n "$at_optarg"; then - at_jobs=$at_optarg - else - at_jobs=`expr X$at_option : 'X-j\(.*\)'` - fi - case $at_jobs in *[!0-9]*) - at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'` - as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;; - esac - ;; - - # Keywords. - --keywords | -k ) - at_prev=--keywords - ;; - --keywords=* ) - at_groups_selected=$at_help_all - at_save_IFS=$IFS - IFS=, - set X $at_optarg - shift - IFS=$at_save_IFS - for at_keyword - do - at_invert= - case $at_keyword in - '!'*) - at_invert="-v" - at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'` - ;; - esac - # It is on purpose that we match the test group titles too. - at_groups_selected=`$as_echo "$at_groups_selected" | - grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` - done - # Smash the keywords. - at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'` - as_fn_append at_groups "$at_groups_selected$as_nl" - ;; - --recheck) - at_recheck=: - ;; - - *=*) - at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $at_envvar in - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$at_envvar'" ;; - esac - at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` - # Export now, but save eval for later and for debug scripts. - export $at_envvar - as_fn_append at_debug_args " $at_envvar='$at_value'" - ;; - - *) $as_echo "$as_me: invalid option: $at_option" >&2 - $as_echo "Try \`$0 --help' for more information." >&2 - exit 1 - ;; - esac -done - -# Verify our last option didn't require an argument -if test -n "$at_prev"; then : - as_fn_error $? "\`$at_prev' requires an argument" -fi - -# The file containing the suite. -at_suite_log=$at_dir/$as_me.log - -# Selected test groups. -if test -z "$at_groups$at_recheck"; then - at_groups=$at_groups_all -else - if test -n "$at_recheck" && test -r "$at_suite_log"; then - at_oldfails=`sed -n ' - /^Failed tests:$/,/^Skipped tests:$/{ - s/^[ ]*\([1-9][0-9]*\):.*/\1/p - } - /^Unexpected passes:$/,/^## Detailed failed tests/{ - s/^[ ]*\([1-9][0-9]*\):.*/\1/p - } - /^## Detailed failed tests/q - ' "$at_suite_log"` - as_fn_append at_groups "$at_oldfails$as_nl" - fi - # Sort the tests, removing duplicates. - at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'` -fi - -if test x"$at_color" = xalways \ - || { test x"$at_color" = xauto && test -t 1; }; then - at_red=`printf '\033[0;31m'` - at_grn=`printf '\033[0;32m'` - at_lgn=`printf '\033[1;32m'` - at_blu=`printf '\033[1;34m'` - at_std=`printf '\033[m'` -else - at_red= at_grn= at_lgn= at_blu= at_std= -fi - -# Help message. -if $at_help_p; then - cat <<_ATEOF || at_write_fail=1 -Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] - -Run all the tests, or the selected TESTS, given by numeric ranges, and -save a detailed log file. Upon failure, create debugging scripts. - -Do not change environment variables directly. Instead, set them via -command line arguments. Set \`AUTOTEST_PATH' to select the executables -to exercise. Each relative directory is expanded as build and source -directories relative to the top level of this distribution. -E.g., from within the build directory /tmp/foo-1.0, invoking this: - - $ $0 AUTOTEST_PATH=bin - -is equivalent to the following, assuming the source directory is /src/foo-1.0: - - PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0 -_ATEOF -cat <<_ATEOF || at_write_fail=1 - -Operation modes: - -h, --help print the help message, then exit - -V, --version print version number, then exit - -c, --clean remove all the files this test suite might create and exit - -l, --list describes all the tests, or the selected TESTS -_ATEOF -cat <<_ATEOF || at_write_fail=1 - -Execution tuning: - -C, --directory=DIR - change to directory DIR before starting - --color[=never|auto|always] - enable colored test results on terminal, or always - -j, --jobs[=N] - Allow N jobs at once; infinite jobs with no arg (default 1) - -k, --keywords=KEYWORDS - select the tests matching all the comma-separated KEYWORDS - multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD - --recheck select all tests that failed or passed unexpectedly last time - -e, --errexit abort as soon as a test fails; implies --debug - -v, --verbose force more detailed output - default for debugging scripts - -d, --debug inhibit clean up and top-level logging - default for debugging scripts - -x, --trace enable tests shell tracing -_ATEOF -cat <<_ATEOF || at_write_fail=1 - -Report bugs to . -_ATEOF - exit $at_write_fail -fi - -# List of tests. -if $at_list_p; then - cat <<_ATEOF || at_write_fail=1 -openvswitch 2.3.1 test suite test groups: - - NUM: FILE-NAME:LINE TEST-GROUP-NAME - KEYWORDS - -_ATEOF - # Pass an empty line as separator between selected groups and help. - $as_echo "$at_groups$as_nl$as_nl$at_help_all" | - awk 'NF == 1 && FS != ";" { - selected[$ 1] = 1 - next - } - /^$/ { FS = ";" } - NF > 0 { - if (selected[$ 1]) { - printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 - if ($ 4) { - lmax = 79 - indent = " " - line = indent - len = length (line) - n = split ($ 4, a, " ") - for (i = 1; i <= n; i++) { - l = length (a[i]) + 1 - if (i > 1 && len + l > lmax) { - print line - line = indent " " a[i] - len = length (line) - } else { - line = line " " a[i] - len += l - } - } - if (n) - print line - } - } - }' || at_write_fail=1 - exit $at_write_fail -fi -if $at_version_p; then - $as_echo "$as_me (openvswitch 2.3.1)" && - cat <<\_ATEOF || at_write_fail=1 - -Copyright (C) 2010 Free Software Foundation, Inc. -This test suite is free software; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at: - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -_ATEOF - exit $at_write_fail -fi - -# Should we print banners? Yes if more than one test is run. -case $at_groups in #( - *$as_nl* ) - at_print_banners=: ;; #( - * ) at_print_banners=false ;; -esac -# Text for banner N, set to a single space once printed. -# Banner 1. bfd.at:1 -# Category starts at test group 1. -at_banner_text_1="bfd" -# Banner 2. cfm.at:1 -# Category starts at test group 12. -at_banner_text_2="cfm" -# Banner 3. lacp.at:1 -# Category starts at test group 18. -at_banner_text_3="lacp" -# Banner 4. library.at:1 -# Category starts at test group 21. -at_banner_text_4="library unit tests" -# Banner 5. heap.at:1 -# Category starts at test group 51. -at_banner_text_5="heap library" -# Banner 6. bundle.at:1 -# Category starts at test group 57. -at_banner_text_6="bundle link selection" -# Banner 7. classifier.at:1 -# Category starts at test group 66. -at_banner_text_7="flow classifier unit tests" -# Banner 8. classifier.at:16 -# Category starts at test group 74. -at_banner_text_8="miniflow unit tests" -# Banner 9. classifier.at:26 -# Category starts at test group 77. -at_banner_text_9="flow classifier lookup segmentation" -# Banner 10. classifier.at:64 -# Category starts at test group 78. -at_banner_text_10="flow classifier prefix lookup" -# Banner 11. check-structs.at:1 -# Category starts at test group 79. -at_banner_text_11="struct alignment checker unit tests" -# Banner 12. daemon.at:1 -# Category starts at test group 83. -at_banner_text_12="daemon unit tests - C" -# Banner 13. daemon-py.at:1 -# Category starts at test group 89. -at_banner_text_13="daemon unit tests - Python" -# Banner 14. ofp-actions.at:1 -# Category starts at test group 98. -at_banner_text_14="OpenFlow actions" -# Banner 15. ofp-print.at:1 -# Category starts at test group 102. -at_banner_text_15="ofp-print" -# Banner 16. ofp-util.at:1 -# Category starts at test group 283. -at_banner_text_16="OpenFlow utilities" -# Banner 17. ofp-errors.at:1 -# Category starts at test group 284. -at_banner_text_17="ofp-errors tests" -# Banner 18. ovs-ofctl.at:1 -# Category starts at test group 297. -at_banner_text_18="ovs-ofctl" -# Banner 19. odp.at:1 -# Category starts at test group 327. -at_banner_text_19="datapath parsing and formatting" -# Banner 20. multipath.at:1 -# Category starts at test group 331. -at_banner_text_20="multipath link selection" -# Banner 21. learn.at:1 -# Category starts at test group 340. -at_banner_text_21="learning action" -# Banner 22. vconn.at:21 -# Category starts at test group 354. -at_banner_text_22="vconn library -- unix class" -# Banner 23. vconn.at:22 -# Category starts at test group 362. -at_banner_text_23="vconn library -- tcp class" -# Banner 24. vconn.at:23 -# Category starts at test group 370. -at_banner_text_24="vconn library -- ssl class" -# Banner 25. file_name.at:1 -# Category starts at test group 378. -at_banner_text_25="test dir_name and base_name functions" -# Banner 26. file_name.at:28 -# Category starts at test group 391. -at_banner_text_26="test follow_symlinks function" -# Banner 27. aes128.at:1 -# Category starts at test group 399. -at_banner_text_27="AES-128 unit tests" -# Banner 28. unixctl-py.at:1 -# Category starts at test group 422. -at_banner_text_28="unixctl" -# Banner 29. uuid.at:1 -# Category starts at test group 428. -at_banner_text_29="UUID unit tests" -# Banner 30. json.at:63 -# Category starts at test group 429. -at_banner_text_30="JSON -- arrays" -# Banner 31. json.at:78 -# Category starts at test group 443. -at_banner_text_31="JSON -- strings" -# Banner 32. json.at:147 -# Category starts at test group 477. -at_banner_text_32="JSON -- objects" -# Banner 33. json.at:169 -# Category starts at test group 493. -at_banner_text_33="JSON -- literal names" -# Banner 34. json.at:183 -# Category starts at test group 507. -at_banner_text_34="JSON -- numbers" -# Banner 35. json.at:276 -# Category starts at test group 545. -at_banner_text_35="JSON -- RFC 4627 examples" -# Banner 36. json.at:319 -# Category starts at test group 549. -at_banner_text_36="JSON -- pathological cases" -# Banner 37. json.at:342 -# Category starts at test group 560. -at_banner_text_37="JSON -- multiple inputs" -# Banner 38. jsonrpc.at:1 -# Category starts at test group 572. -at_banner_text_38="JSON-RPC - C" -# Banner 39. jsonrpc-py.at:1 -# Category starts at test group 575. -at_banner_text_39="JSON-RPC - Python" -# Banner 40. tunnel.at:1 -# Category starts at test group 578. -at_banner_text_40="tunnel" -# Banner 41. lockfile.at:1 -# Category starts at test group 589. -at_banner_text_41="lockfile unit tests" -# Banner 42. reconnect.at:1 -# Category starts at test group 599. -at_banner_text_42="reconnect library" -# Banner 43. ovs-vswitchd.at:1 -# Category starts at test group 623. -at_banner_text_43="ovs-vswitchd" -# Banner 44. ofproto.at:1 -# Category starts at test group 628. -at_banner_text_44="ofproto" -# Banner 45. ofproto-dpif.at:1 -# Category starts at test group 713. -at_banner_text_45="ofproto-dpif" -# Banner 46. ofproto-dpif.at:3879 -# Category starts at test group 788. -at_banner_text_46="ofproto-dpif -- megaflows" -# Banner 47. ofproto-dpif.at:4558 -# Category starts at test group 816. -at_banner_text_47="ofproto-dpif - flow translation resource limits" -# Banner 48. vlan-splinters.at:1 -# Category starts at test group 821. -at_banner_text_48="VLAN splinters" -# Banner 49. ovsdb-log.at:1 -# Category starts at test group 822. -at_banner_text_49="OVSDB -- logging" -# Banner 50. ovsdb-types.at:1 -# Category starts at test group 833. -at_banner_text_50="OVSDB -- atomic types" -# Banner 51. ovsdb-types.at:16 -# Category starts at test group 845. -at_banner_text_51="OVSDB -- base types" -# Banner 52. ovsdb-types.at:90 -# Category starts at test group 891. -at_banner_text_52="OVSDB -- simple types" -# Banner 53. ovsdb-types.at:112 -# Category starts at test group 909. -at_banner_text_53="OVSDB -- set types" -# Banner 54. ovsdb-types.at:144 -# Category starts at test group 927. -at_banner_text_54="OVSDB -- map types" -# Banner 55. ovsdb-data.at:1 -# Category starts at test group 941. -at_banner_text_55="OVSDB -- default values" -# Banner 56. ovsdb-data.at:74 -# Category starts at test group 945. -at_banner_text_56="OVSDB -- atoms without constraints" -# Banner 57. ovsdb-data.at:293 -# Category starts at test group 987. -at_banner_text_57="OVSDB -- atoms with enum constraints" -# Banner 58. ovsdb-data.at:366 -# Category starts at test group 997. -at_banner_text_58="OVSDB -- atoms with other constraints" -# Banner 59. ovsdb-data.at:489 -# Category starts at test group 1013. -at_banner_text_59="OSVDB -- simple data" -# Banner 60. ovsdb-data.at:539 -# Category starts at test group 1025. -at_banner_text_60="OVSDB -- set data" -# Banner 61. ovsdb-data.at:683 -# Category starts at test group 1052. -at_banner_text_61="OVSDB -- map data" -# Banner 62. ovsdb-column.at:1 -# Category starts at test group 1070. -at_banner_text_62="OVSDB -- columns" -# Banner 63. ovsdb-table.at:1 -# Category starts at test group 1076. -at_banner_text_63="OVSDB -- tables" -# Banner 64. ovsdb-row.at:1 -# Category starts at test group 1104. -at_banner_text_64="OVSDB -- rows" -# Banner 65. ovsdb-schema.at:1 -# Category starts at test group 1115. -at_banner_text_65="OVSDB -- schemas" -# Banner 66. ovsdb-condition.at:1 -# Category starts at test group 1125. -at_banner_text_66="OVSDB -- conditions" -# Banner 67. ovsdb-mutation.at:1 -# Category starts at test group 1139. -at_banner_text_67="OVSDB -- mutations" -# Banner 68. ovsdb-query.at:1 -# Category starts at test group 1158. -at_banner_text_68="OVSDB -- queries" -# Banner 69. ovsdb-transaction.at:1 -# Category starts at test group 1165. -at_banner_text_69="OVSDB -- transactions" -# Banner 70. ovsdb-execution.at:1 -# Category starts at test group 1180. -at_banner_text_70="OVSDB -- execution" -# Banner 71. ovsdb-trigger.at:1 -# Category starts at test group 1208. -at_banner_text_71="OVSDB -- triggers" -# Banner 72. ovsdb-tool.at:1 -# Category starts at test group 1213. -at_banner_text_72="OVSDB -- ovsdb-tool" -# Banner 73. ovsdb-server.at:1 -# Category starts at test group 1248. -at_banner_text_73="OVSDB -- ovsdb-server transactions (Unix sockets)" -# Banner 74. ovsdb-server.at:41 -# Category starts at test group 1273. -at_banner_text_74="ovsdb-server miscellaneous features" -# Banner 75. ovsdb-server.at:755 -# Category starts at test group 1287. -at_banner_text_75="OVSDB -- ovsdb-server transactions (SSL IPv4 sockets)" -# Banner 76. ovsdb-server.at:794 -# Category starts at test group 1312. -at_banner_text_76="OVSDB -- ovsdb-server transactions (SSL IPv6 sockets)" -# Banner 77. ovsdb-server.at:833 -# Category starts at test group 1313. -at_banner_text_77="OVSDB -- ovsdb-server transactions (TCP IPv4 sockets)" -# Banner 78. ovsdb-server.at:883 -# Category starts at test group 1339. -at_banner_text_78="OVSDB -- ovsdb-server transactions (TCP IPv6 sockets)" -# Banner 79. ovsdb-server.at:921 -# Category starts at test group 1340. -at_banner_text_79="OVSDB -- transactions on transient ovsdb-server" -# Banner 80. ovsdb-monitor.at:1 -# Category starts at test group 1365. -at_banner_text_80="OVSDB -- ovsdb-server monitors" -# Banner 81. ovsdb-monitor.at:249 -# Category starts at test group 1374. -at_banner_text_81="ovsdb -- ovsdb-monitor monitor only some operations" -# Banner 82. ovsdb-idl.at:1 -# Category starts at test group 1379. -at_banner_text_82="OVSDB -- interface description language (IDL)" -# Banner 83. ovs-vsctl.at:143 -# Category starts at test group 1429. -at_banner_text_83="ovs-vsctl unit tests" -# Banner 84. ovs-vsctl.at:177 -# Category starts at test group 1430. -at_banner_text_84="ovs-vsctl unit tests -- real bridges" -# Banner 85. ovs-vsctl.at:544 -# Category starts at test group 1443. -at_banner_text_85="ovs-vsctl unit tests -- fake bridges (VLAN 9)" -# Banner 86. ovs-vsctl.at:545 -# Category starts at test group 1448. -at_banner_text_86="ovs-vsctl unit tests -- fake bridges (VLAN 0)" -# Banner 87. ovs-vsctl.at:591 -# Category starts at test group 1456. -at_banner_text_87="ovs-vsctl unit tests -- manager commands" -# Banner 88. ovs-vsctl.at:617 -# Category starts at test group 1457. -at_banner_text_88="ovs-vsctl unit tests -- database commands" -# Banner 89. ovs-vsctl.at:1199 -# Category starts at test group 1466. -at_banner_text_89="ovs-vsctl add-port -- reserved port names" -# Banner 90. ovs-monitor-ipsec.at:1 -# Category starts at test group 1468. -at_banner_text_90="ovs-monitor-ipsec" -# Banner 91. ovs-xapi-sync.at:1 -# Category starts at test group 1469. -at_banner_text_91="ovs-xapi-sync" -# Banner 92. interface-reconfigure.at:695 -# Category starts at test group 1470. -at_banner_text_92="interface-reconfigure" -# Banner 93. stp.at:1 -# Category starts at test group 1475. -at_banner_text_93="Spanning Tree Protocol unit tests" -# Banner 94. vlog.at:1 -# Category starts at test group 1488. -at_banner_text_94="vlog" -# Banner 95. vtep-ctl.at:134 -# Category starts at test group 1493. -at_banner_text_95="vtep-ctl unit tests -- physical switch tests" -# Banner 96. vtep-ctl.at:270 -# Category starts at test group 1503. -at_banner_text_96="vtep-ctl unit tests -- logical switch tests" -# Banner 97. vtep-ctl.at:324 -# Category starts at test group 1508. -at_banner_text_97="vtep-ctl unit tests -- logical binding tests" -# Banner 98. vtep-ctl.at:395 -# Category starts at test group 1511. -at_banner_text_98="vtep-ctl unit tests -- MAC binding tests" -# Banner 99. vtep-ctl.at:866 -# Category starts at test group 1525. -at_banner_text_99="vtep-ctl unit tests -- manager commands" - -# Take any -C into account. -if $at_change_dir ; then - test x != "x$at_dir" && cd "$at_dir" \ - || as_fn_error $? "unable to change directory" - at_dir=`pwd` -fi - -# Load the config files for any default variable assignments. -for at_file in atconfig atlocal -do - test -r $at_file || continue - . ./$at_file || as_fn_error $? "invalid content: $at_file" -done - -# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: -: "${at_top_build_prefix=$at_top_builddir}" - -# Perform any assignments requested during argument parsing. -eval "$at_debug_args" - -# atconfig delivers names relative to the directory the test suite is -# in, but the groups themselves are run in testsuite-dir/group-dir. -if test -n "$at_top_srcdir"; then - builddir=../.. - for at_dir_var in srcdir top_srcdir top_build_prefix - do - eval at_val=\$at_$at_dir_var - case $at_val in - [\\/$]* | ?:[\\/]* ) at_prefix= ;; - *) at_prefix=../../ ;; - esac - eval "$at_dir_var=\$at_prefix\$at_val" - done -fi - -## -------------------- ## -## Directory structure. ## -## -------------------- ## - -# This is the set of directories and files used by this script -# (non-literals are capitalized): -# -# TESTSUITE - the testsuite -# TESTSUITE.log - summarizes the complete testsuite run -# TESTSUITE.dir/ - created during a run, remains after -d or failed test -# + at-groups/ - during a run: status of all groups in run -# | + NNN/ - during a run: meta-data about test group NNN -# | | + check-line - location (source file and line) of current AT_CHECK -# | | + status - exit status of current AT_CHECK -# | | + stdout - stdout of current AT_CHECK -# | | + stder1 - stderr, including trace -# | | + stderr - stderr, with trace filtered out -# | | + test-source - portion of testsuite that defines group -# | | + times - timestamps for computing duration -# | | + pass - created if group passed -# | | + xpass - created if group xpassed -# | | + fail - created if group failed -# | | + xfail - created if group xfailed -# | | + skip - created if group skipped -# + at-stop - during a run: end the run if this file exists -# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction -# + 0..NNN/ - created for each group NNN, remains after -d or failed test -# | + TESTSUITE.log - summarizes the group results -# | + ... - files created during the group - -# The directory the whole suite works in. -# Should be absolute to let the user `cd' at will. -at_suite_dir=$at_dir/$as_me.dir -# The file containing the suite ($at_dir might have changed since earlier). -at_suite_log=$at_dir/$as_me.log -# The directory containing helper files per test group. -at_helper_dir=$at_suite_dir/at-groups -# Stop file: if it exists, do not start new jobs. -at_stop_file=$at_suite_dir/at-stop -# The fifo used for the job dispatcher. -at_job_fifo=$at_suite_dir/at-job-fifo - -if $at_clean; then - test -d "$at_suite_dir" && - find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; - rm -f -r "$at_suite_dir" "$at_suite_log" - exit $? -fi - -# Don't take risks: use only absolute directories in PATH. -# -# For stand-alone test suites (ie. atconfig was not found), -# AUTOTEST_PATH is relative to `.'. -# -# For embedded test suites, AUTOTEST_PATH is relative to the top level -# of the package. Then expand it into build/src parts, since users -# may create executables in both places. -AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"` -at_path= -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $AUTOTEST_PATH $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR -case $as_dir in - [\\/]* | ?:[\\/]* ) - as_fn_append at_path "$as_dir" - ;; - * ) - if test -z "$at_top_build_prefix"; then - # Stand-alone test suite. - as_fn_append at_path "$as_dir" - else - # Embedded test suite. - as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR" - as_fn_append at_path "$at_top_srcdir/$as_dir" - fi - ;; -esac - done -IFS=$as_save_IFS - - -# Now build and simplify PATH. -# -# There might be directories that don't exist, but don't redirect -# builtins' (eg., cd) stderr directly: Ultrix's sh hates that. -at_new_path= -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $at_path -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -d "$as_dir" || continue -case $as_dir in - [\\/]* | ?:[\\/]* ) ;; - * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;; -esac -case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in - *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;; - $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;; - *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;; -esac - done -IFS=$as_save_IFS - -PATH=$at_new_path -export PATH - -# Setting up the FDs. - - - -# 5 is the log file. Not to be overwritten if `-d'. -if $at_debug_p; then - at_suite_log=/dev/null -else - : >"$at_suite_log" -fi -exec 5>>"$at_suite_log" - -# Banners and logs. -$as_echo "## ----------------------------- ## -## openvswitch 2.3.1 test suite. ## -## ----------------------------- ##" -{ - $as_echo "## ----------------------------- ## -## openvswitch 2.3.1 test suite. ## -## ----------------------------- ##" - echo - - $as_echo "$as_me: command line was:" - $as_echo " \$ $0 $at_cli_args" - echo - - # If ChangeLog exists, list a few lines in case it might help determining - # the exact version. - if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then - $as_echo "## ---------- ## -## ChangeLog. ## -## ---------- ##" - echo - sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" - echo - fi - - { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} - echo - - # Contents of the config files. - for at_file in atconfig atlocal - do - test -r $at_file || continue - $as_echo "$as_me: $at_file:" - sed 's/^/| /' $at_file - echo - done -} >&5 - - -## ------------------------- ## -## Autotest shell functions. ## -## ------------------------- ## - -# at_fn_banner NUMBER -# ------------------- -# Output banner NUMBER, provided the testsuite is running multiple groups and -# this particular banner has not yet been printed. -at_fn_banner () -{ - $at_print_banners || return 0 - eval at_banner_text=\$at_banner_text_$1 - test "x$at_banner_text" = "x " && return 0 - eval "at_banner_text_$1=\" \"" - if test -z "$at_banner_text"; then - $at_first || echo - else - $as_echo "$as_nl$at_banner_text$as_nl" - fi -} # at_fn_banner - -# at_fn_check_prepare_notrace REASON LINE -# --------------------------------------- -# Perform AT_CHECK preparations for the command at LINE for an untraceable -# command; REASON is the reason for disabling tracing. -at_fn_check_prepare_notrace () -{ - $at_trace_echo "Not enabling shell tracing (command contains $1)" - $as_echo "$2" >"$at_check_line_file" - at_check_trace=: at_check_filter=: - : >"$at_stdout"; : >"$at_stderr" -} - -# at_fn_check_prepare_trace LINE -# ------------------------------ -# Perform AT_CHECK preparations for the command at LINE for a traceable -# command. -at_fn_check_prepare_trace () -{ - $as_echo "$1" >"$at_check_line_file" - at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace - : >"$at_stdout"; : >"$at_stderr" -} - -# at_fn_check_prepare_dynamic COMMAND LINE -# ---------------------------------------- -# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate -# preparation function. -at_fn_check_prepare_dynamic () -{ - case $1 in - *$as_nl*) - at_fn_check_prepare_notrace 'an embedded newline' "$2" ;; - *) - at_fn_check_prepare_trace "$2" ;; - esac -} - -# at_fn_filter_trace -# ------------------ -# Remove the lines in the file "$at_stderr" generated by "set -x" and print -# them to stderr. -at_fn_filter_trace () -{ - mv "$at_stderr" "$at_stder1" - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -} - -# at_fn_log_failure FILE-LIST -# --------------------------- -# Copy the files in the list on stdout with a "> " prefix, and exit the shell -# with a failure exit code. -at_fn_log_failure () -{ - for file - do $as_echo "$file:"; sed 's/^/> /' "$file"; done - echo 1 > "$at_status_file" - exit 1 -} - -# at_fn_check_skip EXIT-CODE LINE -# ------------------------------- -# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit -# the test group subshell with that same exit code. Use LINE in any report -# about test failure. -at_fn_check_skip () -{ - case $1 in - 99) echo 99 > "$at_status_file"; at_failed=: - $as_echo "$2: hard failure"; exit 99;; - 77) echo 77 > "$at_status_file"; exit 77;; - esac -} - -# at_fn_check_status EXPECTED EXIT-CODE LINE -# ------------------------------------------ -# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing. -# Otherwise, if it is 77 or 99, exit the test group subshell with that same -# exit code; if it is anything else print an error message referring to LINE, -# and fail the test. -at_fn_check_status () -{ - case $2 in - $1 ) ;; - 77) echo 77 > "$at_status_file"; exit 77;; - 99) echo 99 > "$at_status_file"; at_failed=: - $as_echo "$3: hard failure"; exit 99;; - *) $as_echo "$3: exit code was $2, expected $1" - at_failed=:;; - esac -} - -# at_fn_diff_devnull FILE -# ----------------------- -# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff -# invocations. -at_fn_diff_devnull () -{ - test -s "$1" || return 0 - $at_diff "$at_devnull" "$1" -} - -# at_fn_test NUMBER -# ----------------- -# Parse out test NUMBER from the tail of this file. -at_fn_test () -{ - eval at_sed=\$at_sed$1 - sed "$at_sed" "$at_myself" > "$at_test_source" -} - -# at_fn_create_debugging_script -# ----------------------------- -# Create the debugging script $at_group_dir/run which will reproduce the -# current test group. -at_fn_create_debugging_script () -{ - { - echo "#! /bin/sh" && - echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' && - $as_echo "cd '$at_dir'" && - $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" && - echo 'exit 1' - } >"$at_group_dir/run" && - chmod +x "$at_group_dir/run" -} - -## -------------------------------- ## -## End of autotest shell functions. ## -## -------------------------------- ## -{ - $as_echo "## ---------------- ## -## Tested programs. ## -## ---------------- ##" - echo -} >&5 - -# Report what programs are being tested. -for at_program in : $at_tested -do - test "$at_program" = : && continue - case $at_program in - [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;; - * ) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -f "$as_dir/$at_program" && break - done -IFS=$as_save_IFS - - at_program_=$as_dir/$at_program ;; - esac - if test -f "$at_program_"; then - { - $as_echo "$at_srcdir/testsuite.at:1: $at_program_ --version" - "$at_program_" --version &5 2>&1 - else - as_fn_error $? "cannot find $at_program" "$LINENO" 5 - fi -done - -{ - $as_echo "## ------------------ ## -## Running the tests. ## -## ------------------ ##" -} >&5 - -at_start_date=`date` -at_start_time=`date +%s 2>/dev/null` -$as_echo "$as_me: starting at: $at_start_date" >&5 - - -ovs_wait () { - # First try a quick sleep, so that the test completes very quickly - # in the normal case. POSIX doesn't require fractional times to - # work, so this might not work. - sleep 0.1 - ovs_wait_cond && exit 0 - # Then wait up to 10 seconds. - for d in 0 1 2 3 4 5 6 7 8 9; do - sleep 1 - ovs_wait_cond && exit 0 - done - exit 1 -} - -# Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout. -seq () { - while test $1 -le $2; do - echo $1 - set `expr $1 + ${3-1}` $2 $3 - done -} - -if test "$IS_WIN32" = "yes"; then - pwd () { - command pwd -W "$@" - } - - diff () { - command diff --strip-trailing-cr "$@" - } - - kill () { - case "$1" in - -0) - shift - for i in $*; do - # tasklist will always have return code 0. - # If pid does exist, there will be a line with the pid. - if tasklist //fi "PID eq $i" | grep $i; then - : - else - return 1 - fi - done - return 0 - ;; - -[1-9]*) - shift - for i in $*; do - taskkill //F //PID $i - done - ;; - [1-9][1-9]*) - for i in $*; do - taskkill //F //PID $i - done - ;; - esac - } -fi - - - -# Strips out uninteresting parts of ovs-ofctl output, as well as parts -# that vary from one run to another. -ofctl_strip () { - sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/ duration=[0-9.]*s,// -s/ cookie=0x0,// -s/ table=0,// -s/ n_packets=0,// -s/ n_bytes=0,// -s/ idle_age=[0-9]*,// -s/ hard_age=[0-9]*,// -' -} - -# parse_listening_port [SERVER] -# -# Parses the TCP or SSL port on which a server is listening from the -# log, given that the server was told to listen on a kernel-chosen -# port, file provided on stdin, and prints the port number on stdout. -# You should specify the listening remote as ptcp:0:127.0.0.1 or -# pssl:0:127.0.0.1, or the equivalent with [::1] instead of 127.0.0.1. -# -# Here's an example of how to use this with ovsdb-server: -# -# OVS_LOGDIR=`pwd`; export OVS_LOGDIR -# ovsdb-server --log-file --remote=ptcp:0:127.0.0.1 ... -# TCP_PORT=`parse_listening_port < ovsdb-server.log` -parse_listening_port () { - sed -n 's/.*0:.*: listening on port \([0-9]*\)$/\1/p' -} - -check_logs () { - sed -n "$1 -/timeval.*Unreasonably long [0-9]*ms poll interval/d -/timeval.*faults: [0-9]* minor, [0-9]* major/d -/timeval.*disk: [0-9]* reads, [0-9]* writes/d -/timeval.*context switches: [0-9]* voluntary, [0-9]* involuntary/d -/ovs_rcu.*blocked [0-9]* ms waiting for .* to quiesce/d -/|WARN|/p -/|ERR|/p -/|EMER|/p" ovs-vswitchd.log ovsdb-server.log -} - - - -ordinal_schema () { - cat <<'EOF' - {"name": "ordinals", - "tables": { - "ordinals": { - "columns": { - "number": {"type": "integer"}, - "name": {"type": "string"}}, - "indexes": [["number"]]}}, - "version": "5.1.3", - "cksum": "12345678 9"} -EOF -} - -constraint_schema () { - cat << 'EOF' - {"name": "constraints", - "tables": { - "a": { - "columns": { - "a": {"type": "integer"}, - "a2a": {"type": {"key": {"type": "uuid", "refTable": "a"}, - "min": 0, "max": "unlimited"}}, - "a2b": {"type": {"key": {"type": "uuid", "refTable": "b"}, - "min": 0, "max": "unlimited"}}}}, - "b": { - "columns": { - "b": {"type": "integer"}, - "b2a": {"type": {"key": {"type": "uuid", "refTable": "a"}, - "min": 0, "max": "unlimited"}}, - "b2b": {"type": {"key": {"type": "uuid", "refTable": "b"}, - "min": 0, "max": "unlimited"}}, - "x": {"type": {"key": "integer", "min": 1, "max": 2}}}}, - "constrained": { - "columns": { - "positive": {"type": {"key": {"type": "integer", - "minInteger": 1}}}}, - "maxRows": 1}}} -EOF -} - -weak_schema () { - cat <<'EOF' - {"name": "weak", - "tables": { - "a": { - "columns": { - "a": {"type": "integer"}, - "a2a": {"type": {"key": {"type": "uuid", - "refTable": "a", - "refType": "weak"}, - "min": 0, "max": "unlimited"}}, - "a2a1": {"type": {"key": {"type": "uuid", - "refTable": "a", - "refType": "weak"}}}, - "a2b": {"type": {"key": {"type": "uuid", - "refTable": "b", - "refType": "weak"}}}}}, - "b": { - "columns": { - "b": {"type": "integer"}, - "b2a": {"type": {"key": {"type": "uuid", - "refTable": "a", - "refType": "weak"}, - "min": 0, "max": "unlimited"}}}}}} -EOF -} - -gc_schema () { - cat <<'EOF' - {"name": "gc", - "tables": { - "root": { - "columns": { - "a": {"type": {"key": {"type": "uuid", - "refTable": "a"}, - "min": 0, "max": "unlimited"}}}, - "isRoot": true}, - "a": { - "columns": { - "a": {"type": "integer"}, - "a2a": {"type": {"key": {"type": "uuid", - "refTable": "a"}, - "min": 0, "max": "unlimited"}}, - "a2b": {"type": {"key": {"type": "uuid", - "refTable": "b"}, - "min": 0, "max": "unlimited"}}, - "wa2a": {"type": {"key": {"type": "uuid", - "refTable": "a", - "refType": "weak"}, - "min": 0, "max": "unlimited"}}, - "wa2b": {"type": {"key": {"type": "uuid", - "refTable": "b", - "refType": "weak"}, - "min": 0, "max": "unlimited"}}}}, - "b": { - "columns": { - "b": {"type": "integer"}, - "b2a": {"type": {"key": {"type": "uuid", - "refTable": "a"}, - "min": 0, "max": "unlimited"}}, - "wb2a": {"type": {"key": {"type": "uuid", - "refTable": "a", - "refType": "weak"}, - "min": 0, "max": "unlimited"}}}, - "isRoot": false}}} -EOF -} - -immutable_schema () { - cat <<'EOF' -{"name": "immutable", - "tables": { - "a": { - "columns": {"i": {"type": "integer", "mutable": false}}}}} -EOF -} - - - -# Creates a directory tree for use with "interface-reconfigure --root-dir". -ifr_setup () { - for script in \ - interface-reconfigure \ - InterfaceReconfigure.py \ - InterfaceReconfigureBridge.py \ - InterfaceReconfigureVswitch.py - do - cp $top_srcdir/xenserver/opt_xensource_libexec_$script $script - done - - mkdir -p etc - cat > etc/xensource-inventory < etc/xensource/network.conf - - for utility in \ - sbin/ethtool \ - sbin/ifconfig \ - sbin/ifdown \ - sbin/ifup \ - sbin/ip \ - sbin/update-issue \ - sbin/vconfig \ - usr/sbin/brctl \ - usr/sbin/ovs-vlan-bug-workaround - do - mkdir -p `dirname $utility` - cat > $utility <<'EOF' -#! /bin/sh -echo ${0} ${*} >&2 -EOF - chmod +x $utility - done - - mkdir -p usr/bin - cat > usr/bin/ovs-vsctl <<'EOF' -#! /bin/sh -echo ${0} ${*} >&2 - -while test ${#} -ge 4; do - if test X"${1}" = Xget && \ - test X"${2}" = Xinterface && \ - test X"${4}" = Xofport; then - if test X"${3}" = Xeth2; then - echo 5 - else - echo -1 - fi - fi - - shift -done -EOF - chmod +x usr/bin/ovs-vsctl - - cat > usr/bin/ovs-ofctl <<'EOF' -#! /bin/sh -echo ${0} ${*} >&2 - -# Check that the flow is properly formed. -ovs-ofctl parse-flow "${3}" >/dev/null -EOF - chmod +x usr/bin/ovs-ofctl - - mkdir -p etc/sysconfig/network-scripts - configure_netdev () { - mkdir -p sys/class/net/${1} - echo ${2} > sys/class/net/${1}/address - echo ${3} > sys/class/net/${1}/tx_queue_len - if test ${1} = eth1; then - # No VLAN acceleration. - echo 0x829 > sys/class/net/${1}/features - else - # Supports VLAN acceleration. - echo 0x10b89 > sys/class/net/${1}/features - fi - mkdir sys/class/net/${1}/device - ln -s ../../../bus/pci/drivers/e1000 sys/class/net/${1}/device/driver - - : >> etc/sysconfig/network-scripts/ifcfg-${1} - } - - configure_netdev lo 00:00:00:00:00:00 0 - configure_netdev eth0 00:22:19:22:4b:af 1000 - configure_netdev eth1 00:22:19:22:4b:b1 1000 - configure_netdev eth2 00:15:17:a0:29:80 1000 - configure_netdev eth3 00:15:17:a0:29:81 1000 - configure_netdev eth4 00:1b:21:29:ce:51 1000 - - mkdir -p var/xapi - cat > var/xapi/network.dbcache <<'EOF' - - - - - - - False - - - OpaqueRef:86d81bcf-0d25-90b2-cb11-af2007bd586e - - - bd62a141-091f-3909-e334-0334f67ff3be - - - - - - OpaqueRef:NULL - - - -1 - - - - - - - 00:22:19:22:4b:af - - - None - - - - - - eth0 - - - - False - - - - - - OpaqueRef:83e4a934-aeb5-e6f0-a743-d1c7ef7364c5 - - - - - - - False - - - OpaqueRef:NULL - - - df8d35c2-cc3a-a623-7065-d987a29feb75 - - - - - - OpaqueRef:NULL - - - -1 - - - - - - - 00:1b:21:29:ce:51 - - - None - - - - - - eth4 - - - - False - - - - - - OpaqueRef:bf51b4d3-7bdc-ea55-ba21-539b150b0531 - - - - - - - False - - - OpaqueRef:86d81bcf-0d25-90b2-cb11-af2007bd586e - - - 2f87fc95-5ab4-571a-2487-3f4ac1985663 - - - - - - OpaqueRef:NULL - - - -1 - - - - - - - 00:22:19:22:4b:b1 - - - None - - - - - - eth1 - - - - False - - - - - - OpaqueRef:92b41bf6-aa21-45d3-1c86-c87a5fa98f7d - - - - - - - False - - - OpaqueRef:NULL - - - d2dfdab3-daf4-afea-f055-a25a0d24d714 - - - - - - OpaqueRef:4c0eb823-4d96-da1d-e75f-411b85badb0c - - - 4 - - - - - - - fe:ff:ff:ff:ff:ff - - - None - - - - - - bond0 - - - - True - - - - - - OpaqueRef:a63afad0-fb4c-b4a4-3696-cbb3d88afc47 - - - - - - OpaqueRef:e623e1d6-cd02-be8d-820d-49d65c710297 - - - - - False - - - OpaqueRef:NULL - - - f4ba396e-a993-a592-5fbc-a1d566afb59e - - - 10.0.0.188 - - - OpaqueRef:NULL - - - -1 - - - 255.0.0.0 - - - - 00:15:17:a0:29:81 - - - Static - - - - - - eth3 - - - - True - - - - - - OpaqueRef:d9189da2-d00b-61ba-8a6d-ac42cc868e32 - - - - - - - True - - - OpaqueRef:NULL - - - 646ca9a1-36ad-e2f9-3ecc-1e5622c201c2 - - - 172.18.3.188 - - - OpaqueRef:NULL - - - -1 - - - 255.255.0.0 - - - - 00:15:17:a0:29:80 - - - DHCP - - - - - - eth2 - - - - True - - - - - - OpaqueRef:6e7c6e81-6b5e-b91f-e1f9-9e028567bdfe - - - - - - - False - - - OpaqueRef:NULL - - - 3941edd2-865b-8dd8-61f0-199f5e1fa652 - - - - - - OpaqueRef:e623e1d6-cd02-be8d-820d-49d65c710297 - - - 123 - - - - - - - fe:ff:ff:ff:ff:ff - - - None - - - - - - eth3 - - - - True - - - - - - OpaqueRef:240fb5f8-addc-6ea3-f921-2a42b42acd17 - - - - - - OpaqueRef:4c0eb823-4d96-da1d-e75f-411b85badb0c - - - - - False - - - OpaqueRef:NULL - - - 6c0327a9-afa3-fc19-6798-a1bfe20095ed - - - - - - OpaqueRef:NULL - - - -1 - - - - - - - 00:22:19:22:4b:af - - - None - - - - - - bond0 - - - - OpaqueRef:86d81bcf-0d25-90b2-cb11-af2007bd586e - - - - True - - - - - - OpaqueRef:ec1e5037-60ea-97e5-54b8-39bdb43c071a - - - - - OpaqueRef:69c904bb-8da9-3424-485b-8b47c2d3ef11 - - - dad825f1-6d81-386e-849c-5589281e53e1 - - - - OpaqueRef:e0955887-571f-17fc-a971-61c1ec7d81b6 - - - OpaqueRef:2956e6c8-487e-981c-85ff-c84796418768 - - - - - - OpaqueRef:69c904bb-8da9-3424-485b-8b47c2d3ef11 - - - 841814da-d0d2-9da4-0b2e-b6143480bbfb - - - OpaqueRef:d2d1e51e-4da9-3163-8f57-bb683429335e - - - - - OpaqueRef:2bc0fab5-523a-4125-609d-212391f5f6fc - - - 399279a2-5ccd-5368-9af3-8622a1f1ac82 - - - OpaqueRef:8e3e37e6-ebb9-087e-0201-f6a56bf554c3 - - - - - - OpaqueRef:d2d1e51e-4da9-3163-8f57-bb683429335e - - - - xapi2 - - - - 99be2da4-6c33-6f8e-49ea-3bc592fe3c85 - - - - - - OpaqueRef:2bc0fab5-523a-4125-609d-212391f5f6fc - - - - xenbr3 - - - - 2902ae1b-8013-897a-b697-0b200ea3aaa5 - - - - - - OpaqueRef:69c904bb-8da9-3424-485b-8b47c2d3ef11 - - - - xapi1 - - - - 45cbbb43-113d-a712-3231-c6463f253cef - - - - - - OpaqueRef:2956e6c8-487e-981c-85ff-c84796418768 - - - - xenbr1 - - - - 99f8771a-645a-26a3-e06c-30a401f1d009 - - - - - - OpaqueRef:205d1186-2cd1-d5e6-45e4-ea1698ea6e15 - - - - xenbr2 - - - - d08c8749-0c8f-9e8d-ce25-fd364661ee99 - - - - - - OpaqueRef:e0955887-571f-17fc-a971-61c1ec7d81b6 - - - - xenbr0 - - - - true - - - - c9eecb03-560d-61de-b6a8-56dfc766f67e - - - - - - OpaqueRef:eea8da94-a5e6-18fc-34a7-5e9b5a235806 - - - - xenbr4 - - - - d2c14c89-29cc-51d4-7664-633eff02b2ad - - - - - - xapi0 - - - - dc0f0632-c2aa-1b78-2fea-0d3a23c51740 - - - - - - OpaqueRef:8e3e37e6-ebb9-087e-0201-f6a56bf554c3 - - - - xapi3 - - - - db7bdc03-074d-42ae-fc73-9b06de1d57f6 - - - - - - secure - - - - -EOF -} - -ifr_run () { - ./interface-reconfigure --root-prefix="`pwd`" --no-syslog "$@" -} - -ifr_filter () { - sed -n -e "s,`pwd`,,g" -e 's/ -- /\ - /g' -e '/^Running command:/!p' stderr -} - -# Create the master directory if it doesn't already exist. -as_dir="$at_suite_dir"; as_fn_mkdir_p || - as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5 - -# Can we diff with `/dev/null'? DU 5.0 refuses. -if diff /dev/null /dev/null >/dev/null 2>&1; then - at_devnull=/dev/null -else - at_devnull=$at_suite_dir/devnull - >"$at_devnull" -fi - -# Use `diff -u' when possible. -if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff" -then - at_diff='diff -u' -else - at_diff=diff -fi - -# Get the last needed group. -for at_group in : $at_groups; do :; done - -# Extract the start and end lines of each test group at the tail -# of this file -awk ' -BEGIN { FS="" } -/^#AT_START_/ { - start = NR -} -/^#AT_STOP_/ { - test = substr ($ 0, 10) - print "at_sed" test "=\"1," start "d;" (NR-1) "q\"" - if (test == "'"$at_group"'") exit -}' "$at_myself" > "$at_suite_dir/at-source-lines" && -. "$at_suite_dir/at-source-lines" || - as_fn_error $? "cannot create test line number cache" "$LINENO" 5 -rm -f "$at_suite_dir/at-source-lines" - -# Set number of jobs for `-j'; avoid more jobs than test groups. -set X $at_groups; shift; at_max_jobs=$# -if test $at_max_jobs -eq 0; then - at_jobs=1 -fi -if test $at_jobs -ne 1 && - { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then - at_jobs=$at_max_jobs -fi - -# If parallel mode, don't output banners, don't split summary lines. -if test $at_jobs -ne 1; then - at_print_banners=false - at_quiet=: -fi - -# Set up helper dirs. -rm -rf "$at_helper_dir" && -mkdir "$at_helper_dir" && -cd "$at_helper_dir" && -{ test -z "$at_groups" || mkdir $at_groups; } || -as_fn_error $? "testsuite directory setup failed" "$LINENO" 5 - -# Functions for running a test group. We leave the actual -# test group execution outside of a shell function in order -# to avoid hitting zsh 4.x exit status bugs. - -# at_fn_group_prepare -# ------------------- -# Prepare for running a test group. -at_fn_group_prepare () -{ - # The directory for additional per-group helper files. - at_job_dir=$at_helper_dir/$at_group - # The file containing the location of the last AT_CHECK. - at_check_line_file=$at_job_dir/check-line - # The file containing the exit status of the last command. - at_status_file=$at_job_dir/status - # The files containing the output of the tested commands. - at_stdout=$at_job_dir/stdout - at_stder1=$at_job_dir/stder1 - at_stderr=$at_job_dir/stderr - # The file containing the code for a test group. - at_test_source=$at_job_dir/test-source - # The file containing dates. - at_times_file=$at_job_dir/times - - # Be sure to come back to the top test directory. - cd "$at_suite_dir" - - # Clearly separate the test groups when verbose. - $at_first || $at_verbose echo - - at_group_normalized=$at_group - - eval 'while :; do - case $at_group_normalized in #( - '"$at_format"'*) break;; - esac - at_group_normalized=0$at_group_normalized - done' - - - # Create a fresh directory for the next test group, and enter. - # If one already exists, the user may have invoked ./run from - # within that directory; we remove the contents, but not the - # directory itself, so that we aren't pulling the rug out from - # under the shell's notion of the current directory. - at_group_dir=$at_suite_dir/$at_group_normalized - at_group_log=$at_group_dir/$as_me.log - if test -d "$at_group_dir"; then - find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; - rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* -fi || - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 -$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} - # Be tolerant if the above `rm' was not able to remove the directory. - as_dir="$at_group_dir"; as_fn_mkdir_p - - echo 0 > "$at_status_file" - - # In verbose mode, append to the log file *and* show on - # the standard output; in quiet mode only write to the log. - if test -z "$at_verbose"; then - at_tee_pipe='tee -a "$at_group_log"' - else - at_tee_pipe='cat >> "$at_group_log"' - fi -} - -# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER] -# ------------------------------------------------- -# Declare the test group ORDINAL, located at LINE with group description DESC, -# and residing under BANNER. Use PAD to align the status column. -at_fn_group_banner () -{ - at_setup_line="$2" - test -n "$5" && at_fn_banner $5 - at_desc="$3" - case $1 in - [0-9]) at_desc_line=" $1: ";; - [0-9][0-9]) at_desc_line=" $1: " ;; - *) at_desc_line="$1: " ;; - esac - as_fn_append at_desc_line "$3$4" - $at_quiet $as_echo_n "$at_desc_line" - echo "# -*- compilation -*-" >> "$at_group_log" -} - -# at_fn_group_postprocess -# ----------------------- -# Perform cleanup after running a test group. -at_fn_group_postprocess () -{ - # Be sure to come back to the suite directory, in particular - # since below we might `rm' the group directory we are in currently. - cd "$at_suite_dir" - - if test ! -f "$at_check_line_file"; then - sed "s/^ */$as_me: WARNING: /" <<_ATEOF - A failure happened in a test group before any test could be - run. This means that test suite is improperly designed. Please - report this failure to . -_ATEOF - $as_echo "$at_setup_line" >"$at_check_line_file" - at_status=99 - fi - $at_verbose $as_echo_n "$at_group. $at_setup_line: " - $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log" - case $at_xfail:$at_status in - yes:0) - at_msg="UNEXPECTED PASS" - at_res=xpass - at_errexit=$at_errexit_p - at_color=$at_red - ;; - no:0) - at_msg="ok" - at_res=pass - at_errexit=false - at_color=$at_grn - ;; - *:77) - at_msg='skipped ('`cat "$at_check_line_file"`')' - at_res=skip - at_errexit=false - at_color=$at_blu - ;; - no:* | *:99) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_res=fail - at_errexit=$at_errexit_p - at_color=$at_red - ;; - yes:*) - at_msg='expected failure ('`cat "$at_check_line_file"`')' - at_res=xfail - at_errexit=false - at_color=$at_lgn - ;; - esac - echo "$at_res" > "$at_job_dir/$at_res" - # In parallel mode, output the summary line only afterwards. - if test $at_jobs -ne 1 && test -n "$at_verbose"; then - $as_echo "$at_desc_line $at_color$at_msg$at_std" - else - # Make sure there is a separator even with long titles. - $as_echo " $at_color$at_msg$at_std" - fi - at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" - case $at_status in - 0|77) - # $at_times_file is only available if the group succeeded. - # We're not including the group log, so the success message - # is written in the global log separately. But we also - # write to the group log in case they're using -d. - if test -f "$at_times_file"; then - at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')' - rm -f "$at_times_file" - fi - $as_echo "$at_log_msg" >> "$at_group_log" - $as_echo "$at_log_msg" >&5 - - # Cleanup the group directory, unless the user wants the files - # or the success was unexpected. - if $at_debug_p || test $at_res = xpass; then - at_fn_create_debugging_script - if test $at_res = xpass && $at_errexit; then - echo stop > "$at_stop_file" - fi - else - if test -d "$at_group_dir"; then - find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; - rm -fr "$at_group_dir" - fi - rm -f "$at_test_source" - fi - ;; - *) - # Upon failure, include the log into the testsuite's global - # log. The failure message is written in the group log. It - # is later included in the global log. - $as_echo "$at_log_msg" >> "$at_group_log" - - # Upon failure, keep the group directory for autopsy, and create - # the debugging script. With -e, do not start any further tests. - at_fn_create_debugging_script - if $at_errexit; then - echo stop > "$at_stop_file" - fi - ;; - esac -} - - -## ------------ ## -## Driver loop. ## -## ------------ ## - - -if (set -m && set +m && set +b) >/dev/null 2>&1; then - set +b - at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=- -else - at_job_control_on=: at_job_control_off=: at_job_group= -fi - -for at_signal in 1 2 15; do - trap 'set +x; set +e - $at_job_control_off - at_signal='"$at_signal"' - echo stop > "$at_stop_file" - trap "" $at_signal - at_pgids= - for at_pgid in `jobs -p 2>/dev/null`; do - at_pgids="$at_pgids $at_job_group$at_pgid" - done - test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null - wait - if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then - echo >&2 - fi - at_signame=`kill -l $at_signal 2>&1 || echo $at_signal` - set x $at_signame - test 0 -gt 2 && at_signame=$at_signal - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5 -$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;} - as_fn_arith 128 + $at_signal && exit_status=$as_val - as_fn_exit $exit_status' $at_signal -done - -rm -f "$at_stop_file" -at_first=: - -if test $at_jobs -ne 1 && - rm -f "$at_job_fifo" && - test -n "$at_job_group" && - ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null -then - # FIFO job dispatcher. - - trap 'at_pids= - for at_pid in `jobs -p`; do - at_pids="$at_pids $at_job_group$at_pid" - done - if test -n "$at_pids"; then - at_sig=TSTP - test "${TMOUT+set}" = set && at_sig=STOP - kill -$at_sig $at_pids 2>/dev/null - fi - kill -STOP $$ - test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP - - echo - # Turn jobs into a list of numbers, starting from 1. - at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` - - set X $at_joblist - shift - for at_group in $at_groups; do - $at_job_control_on 2>/dev/null - ( - # Start one test group. - $at_job_control_off - if $at_first; then - exec 7>"$at_job_fifo" - else - exec 6<&- - fi - trap 'set +x; set +e - trap "" PIPE - echo stop > "$at_stop_file" - echo >&7 - as_fn_exit 141' PIPE - at_fn_group_prepare - if cd "$at_group_dir" && - at_fn_test $at_group && - . "$at_test_source" - then :; else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 -$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} - at_failed=: - fi - at_fn_group_postprocess - echo >&7 - ) & - $at_job_control_off - if $at_first; then - at_first=false - exec 6<"$at_job_fifo" 7>"$at_job_fifo" - fi - shift # Consume one token. - if test $# -gt 0; then :; else - read at_token <&6 || break - set x $* - fi - test -f "$at_stop_file" && break - done - exec 7>&- - # Read back the remaining ($at_jobs - 1) tokens. - set X $at_joblist - shift - if test $# -gt 0; then - shift - for at_job - do - read at_token - done <&6 - fi - exec 6<&- - wait -else - # Run serially, avoid forks and other potential surprises. - for at_group in $at_groups; do - at_fn_group_prepare - if cd "$at_group_dir" && - at_fn_test $at_group && - . "$at_test_source"; then :; else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 -$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} - at_failed=: - fi - at_fn_group_postprocess - test -f "$at_stop_file" && break - at_first=false - done -fi - -# Wrap up the test suite with summary statistics. -cd "$at_helper_dir" - -# Use ?..???? when the list must remain sorted, the faster * otherwise. -at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'` -at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'` -at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'` -at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do - echo $f; done | sed '/?/d; s,/xpass,,'` -at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do - echo $f; done | sed '/?/d; s,/fail,,'` - -set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list -shift; at_group_count=$# -set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$* -set X $at_xfail_list; shift; at_xfail_count=$# -set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$* -set X $at_skip_list; shift; at_skip_count=$# - -as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val -as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val -as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val - -# Back to the top directory. -cd "$at_dir" -rm -rf "$at_helper_dir" - -# Compute the duration of the suite. -at_stop_date=`date` -at_stop_time=`date +%s 2>/dev/null` -$as_echo "$as_me: ending at: $at_stop_date" >&5 -case $at_start_time,$at_stop_time in - [0-9]*,[0-9]*) - as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val - as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val - as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val - as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val - as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val - at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" - $as_echo "$as_me: test suite duration: $at_duration" >&5 - ;; -esac - -echo -$as_echo "## ------------- ## -## Test results. ## -## ------------- ##" -echo -{ - echo - $as_echo "## ------------- ## -## Test results. ## -## ------------- ##" - echo -} >&5 - -if test $at_run_count = 1; then - at_result="1 test" - at_were=was -else - at_result="$at_run_count tests" - at_were=were -fi -if $at_errexit_p && test $at_unexpected_count != 0; then - if test $at_xpass_count = 1; then - at_result="$at_result $at_were run, one passed" - else - at_result="$at_result $at_were run, one failed" - fi - at_result="$at_result unexpectedly and inhibited subsequent tests." - at_color=$at_red -else - # Don't you just love exponential explosion of the number of cases? - at_color=$at_red - case $at_xpass_count:$at_fail_count:$at_xfail_count in - # So far, so good. - 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;; - 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;; - - # Some unexpected failures - 0:*:0) at_result="$at_result $at_were run, -$at_fail_count failed unexpectedly." ;; - - # Some failures, both expected and unexpected - 0:*:1) at_result="$at_result $at_were run, -$at_total_fail_count failed ($at_xfail_count expected failure)." ;; - 0:*:*) at_result="$at_result $at_were run, -$at_total_fail_count failed ($at_xfail_count expected failures)." ;; - - # No unexpected failures, but some xpasses - *:0:*) at_result="$at_result $at_were run, -$at_xpass_count passed unexpectedly." ;; - - # No expected failures, but failures and xpasses - *:1:0) at_result="$at_result $at_were run, -$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; - *:*:0) at_result="$at_result $at_were run, -$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; - - # All of them. - *:*:1) at_result="$at_result $at_were run, -$at_xpass_count passed unexpectedly, -$at_total_fail_count failed ($at_xfail_count expected failure)." ;; - *:*:*) at_result="$at_result $at_were run, -$at_xpass_count passed unexpectedly, -$at_total_fail_count failed ($at_xfail_count expected failures)." ;; - esac - - if test $at_skip_count = 0 && test $at_run_count -gt 1; then - at_result="All $at_result" - fi -fi - -# Now put skips in the mix. -case $at_skip_count in - 0) ;; - 1) at_result="$at_result -1 test was skipped." ;; - *) at_result="$at_result -$at_skip_count tests were skipped." ;; -esac - -if test $at_unexpected_count = 0; then - echo "$at_color$at_result$at_std" - echo "$at_result" >&5 -else - echo "${at_color}ERROR: $at_result$at_std" >&2 - echo "ERROR: $at_result" >&5 - { - echo - $as_echo "## ------------------------ ## -## Summary of the failures. ## -## ------------------------ ##" - - # Summary of failed and skipped tests. - if test $at_fail_count != 0; then - echo "Failed tests:" - $SHELL "$at_myself" $at_fail_list --list - echo - fi - if test $at_skip_count != 0; then - echo "Skipped tests:" - $SHELL "$at_myself" $at_skip_list --list - echo - fi - if test $at_xpass_count != 0; then - echo "Unexpected passes:" - $SHELL "$at_myself" $at_xpass_list --list - echo - fi - if test $at_fail_count != 0; then - $as_echo "## ---------------------- ## -## Detailed failed tests. ## -## ---------------------- ##" - echo - for at_group in $at_fail_list - do - at_group_normalized=$at_group - - eval 'while :; do - case $at_group_normalized in #( - '"$at_format"'*) break;; - esac - at_group_normalized=0$at_group_normalized - done' - - cat "$at_suite_dir/$at_group_normalized/$as_me.log" - echo - done - echo - fi - if test -n "$at_top_srcdir"; then - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## ${at_top_build_prefix}config.log ## -_ASBOX - sed 's/^/| /' ${at_top_build_prefix}config.log - echo - fi - } >&5 - - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## $as_me.log was created. ## -_ASBOX - - echo - if $at_debug_p; then - at_msg='per-test log files' - else - at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'" - fi - $as_echo "Please send $at_msg and all information you think might help: - - To: - Subject: [openvswitch 2.3.1] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} - -You may investigate any problem if you feel able to do so, in which -case the test suite provides a good starting point. Its output may -be found below \`${at_testdir+${at_testdir}/}$as_me.dir'. -" - exit 1 -fi - -exit 0 - -## ------------- ## -## Actual tests. ## -## ------------- ## -#AT_START_1 -at_fn_group_banner 1 'bfd.at:45' \ - "bfd - basic config on different bridges" " " 1 -at_xfail=no -( - $as_echo "1. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable BFD -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:47: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:47" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:47: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:47" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:47: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:47" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:47: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:47" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:47" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:47: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:47" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:47" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:47: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:47" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:47" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:47: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 -- \\ - set Interface p0 bfd:enable=true -- \\ - set Interface p1 bfd:enable=true " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:47" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 -- \ - set Interface p0 bfd:enable=true -- \ - set Interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:47" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl time/stop -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -#Verify that BFD has been enabled on both interfaces. - -{ set +x -$as_echo "$at_srcdir/bfd.at:61: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:61" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:62: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:62" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:62" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:64: ovs-vsctl set interface p0 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:64" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:64" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:66: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:66" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:66" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:68: ovs-vsctl set interface p0 bfd:enable=true" -at_fn_check_prepare_trace "bfd.at:68" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:68" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:70: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:70" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:70" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:71: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:71" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:71" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-vsctl del-br br0 -{ set +x -$as_echo "$at_srcdir/bfd.at:74: ovs-appctl bfd/show p0" -at_fn_check_prepare_trace "bfd.at:74" -( $at_check_trace; ovs-appctl bfd/show p0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "no such bfd object -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 2 $at_status "$at_srcdir/bfd.at:74" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl del-br br1 -#Check that the entries are gone. -{ set +x -$as_echo "$at_srcdir/bfd.at:79: ovs-appctl bfd/show p1" -at_fn_check_prepare_trace "bfd.at:79" -( $at_check_trace; ovs-appctl bfd/show p1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "no such bfd object -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 2 $at_status "$at_srcdir/bfd.at:79" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:83: check_logs " -at_fn_check_prepare_trace "bfd.at:83" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:83: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "bfd.at:83" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:83: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "bfd.at:83" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1 -#AT_START_2 -at_fn_group_banner 2 'bfd.at:87' \ - "bfd - Verify tunnel down detection" " " 1 -at_xfail=no -( - $as_echo "2. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 3 bridges - br-bfd0, br-bfd1 and br-sw which is midway between the two. br2 is -#connected to br-bfd0 and br-bfd1 through patch ports p0-2 and p1-2. Enable BFD on -#interfaces in br-bfd0 and br-bfd1. When br-sw is dropping all packets, BFD should detect -# that the tunnel is down, and come back up when br-sw is working fine. - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:93: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:93" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:93" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:93: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:93" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:93" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:93: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:93" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:93" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:93: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:93" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:93" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:93: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:93" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:93" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:93: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:93" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:93" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:93: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br-bfd0 -- \\ - set bridge br-bfd0 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-br br-bfd1 -- \\ - set bridge br-bfd1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:57:00:00 -- \\ - add-br br-sw -- \\ - set bridge br-sw datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:58:00:00 -- \\ - add-port br-sw p1-sw -- set Interface p1-sw type=patch \\ - options:peer=p1 ofport_request=2 -- \\ - add-port br-sw p0-sw -- set Interface p0-sw type=patch \\ - options:peer=p0 ofport_request=1 -- \\ - add-port br-bfd1 p1 -- set Interface p1 type=patch \\ - options:peer=p1-sw bfd:enable=true -- \\ - add-port br-bfd0 p0 -- set Interface p0 type=patch \\ - options:peer=p0-sw bfd:enable=true -- " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:93" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br-bfd0 -- \ - set bridge br-bfd0 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-br br-bfd1 -- \ - set bridge br-bfd1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:57:00:00 -- \ - add-br br-sw -- \ - set bridge br-sw datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:58:00:00 -- \ - add-port br-sw p1-sw -- set Interface p1-sw type=patch \ - options:peer=p1 ofport_request=2 -- \ - add-port br-sw p0-sw -- set Interface p0-sw type=patch \ - options:peer=p0 ofport_request=1 -- \ - add-port br-bfd1 p1 -- set Interface p1 type=patch \ - options:peer=p1-sw bfd:enable=true -- \ - add-port br-bfd0 p0 -- set Interface p0 type=patch \ - options:peer=p0-sw bfd:enable=true -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:93" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop - -#Create 2 bridges connected by patch ports and enable BFD - -{ set +x -$as_echo "$at_srcdir/bfd.at:116: ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL'" -at_fn_check_prepare_trace "bfd.at:116" -( $at_check_trace; ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:116" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -#Verify that BFD is enabled. -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:119: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:119" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:119" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:120: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:120" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:120" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -#Drop all packets in the br-sw bridge so that the tunnel is down. -{ set +x -$as_echo "$at_srcdir/bfd.at:123: ovs-ofctl add-flow br-sw 'priority=5,actions=drop' " -at_fn_check_prepare_trace "bfd.at:123" -( $at_check_trace; ovs-ofctl add-flow br-sw 'priority=5,actions=drop' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:123" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:125: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:125" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:125" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:126: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:126" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:126" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -#Delete the added flow -{ set +x -$as_echo "$at_srcdir/bfd.at:129: ovs-ofctl del-flows br-sw" -at_fn_check_prepare_trace "bfd.at:129" -( $at_check_trace; ovs-ofctl del-flows br-sw -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:129" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:130: ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL'" -at_fn_check_prepare_trace "bfd.at:130" -( $at_check_trace; ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:130" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -#Verify that BFD is back up again. -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - - -{ set +x -$as_echo "$at_srcdir/bfd.at:134: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:134" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:134" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:135: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:135" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:135" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -#Now, Verify one-side tunnel down detection -#When br-sw is dropping packets from one end, BFD should detect -# that the tunnel is down, and come back up when br-sw is working fine. - -#Bring down the br-bfd1 - br-sw link. So BFD packets will be sent from p0, -# but not received by p1. p0 will receive all BFD packets from p1. - -{ set +x -$as_echo "$at_srcdir/bfd.at:144: ovs-ofctl add-flow br-sw 'in_port=1,priority=5,actions=drop'" -at_fn_check_prepare_trace "bfd.at:144" -( $at_check_trace; ovs-ofctl add-flow br-sw 'in_port=1,priority=5,actions=drop' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done -# Make sure p1 BFD state is down since it received no BFD packets. - -{ set +x -$as_echo "$at_srcdir/bfd.at:147: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:147" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done -# p0 will be in init state once it receives "down" BFD message from p1. - -{ set +x -$as_echo "$at_srcdir/bfd.at:150: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:150" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: init - Local Diagnostic: Neighbor Signaled Session Down - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:150" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:152: ovs-ofctl del-flows br-sw" -at_fn_check_prepare_trace "bfd.at:152" -( $at_check_trace; ovs-ofctl del-flows br-sw -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:152" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:153: ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL'" -at_fn_check_prepare_trace "bfd.at:153" -( $at_check_trace; ovs-ofctl add-flow br-sw 'priority=0,actions=NORMAL' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:153" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -#Ensure that BFD is back up again. - -for i in `seq 0 10`; do ovs-appctl time/warp 100; done -#Bring down the br-bfd0 - br-sw link -{ set +x -$as_echo "$at_srcdir/bfd.at:158: ovs-ofctl add-flow br-sw 'in_port=2,priority=5,actions=drop'" -at_fn_check_prepare_trace "bfd.at:158" -( $at_check_trace; ovs-ofctl add-flow br-sw 'in_port=2,priority=5,actions=drop' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:160: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:160" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:160" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:162: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:162" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: init - Local Diagnostic: Neighbor Signaled Session Down - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:162" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:163: check_logs " -at_fn_check_prepare_trace "bfd.at:163" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:163" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:163: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "bfd.at:163" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:163" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:163: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "bfd.at:163" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:163" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_2 -#AT_START_3 -at_fn_group_banner 3 'bfd.at:167' \ - "bfd - concatenated path down" " " 1 -at_xfail=no -( - $as_echo "3. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable BFD -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:169: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:169" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:169" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:169: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:169" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:169" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:169: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:169" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:169" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:169: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:169" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:169" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:169: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:169" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:169" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:169: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:169" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:169" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:169: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "bfd.at:169" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:169" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl time/stop -{ set +x -$as_echo "$at_srcdir/bfd.at:171: ovs-vsctl -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:171" -( $at_check_trace; ovs-vsctl -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:171" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:174: ovs-vsctl -- add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:174" -( $at_check_trace; ovs-vsctl -- add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:174" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:176: ovs-vsctl -- add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:176" -( $at_check_trace; ovs-vsctl -- add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:176" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:178: ovs-vsctl -- set interface p0 bfd:enable=true " -at_fn_check_prepare_trace "bfd.at:178" -( $at_check_trace; ovs-vsctl -- set interface p0 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:179: ovs-vsctl -- set interface p1 bfd:enable=true " -at_fn_check_prepare_trace "bfd.at:179" -( $at_check_trace; ovs-vsctl -- set interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:179" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -#Verify that BFD has been enabled on both interfaces. - -{ set +x -$as_echo "$at_srcdir/bfd.at:183: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:183" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:183" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:184: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:184" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:184" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -#Set cpath_down to true on one interface, make sure the remote interface updates its values. -{ set +x -$as_echo "$at_srcdir/bfd.at:187: ovs-vsctl set interface p0 bfd:cpath_down=true" -at_fn_check_prepare_trace "bfd.at:187" -( $at_check_trace; ovs-vsctl set interface p0 bfd:cpath_down=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:187" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:189: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:189" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: Concatenated Path Down -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:189" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:190: check_logs " -at_fn_check_prepare_trace "bfd.at:190" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:190" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:190: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "bfd.at:190" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:190" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:190: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "bfd.at:190" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:190" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_3 -#AT_START_4 -at_fn_group_banner 4 'bfd.at:194' \ - "bfd - Edit the Min Tx/Rx values" " " 1 -at_xfail=no -( - $as_echo "4. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable BFD -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:196: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:196" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:196" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:196: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:196" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:196" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:196: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:196" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:196" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:196: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:196" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:196" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:196: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:196" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:196" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:196: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:196" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:196" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:196: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "bfd.at:196" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:196" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl time/stop -{ set +x -$as_echo "$at_srcdir/bfd.at:198: ovs-vsctl -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:198" -( $at_check_trace; ovs-vsctl -- add-br br1 -- \ - set bridge br1 datapath-type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:200: ovs-vsctl -- add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:200" -( $at_check_trace; ovs-vsctl -- add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:200" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:202: ovs-vsctl -- add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:202" -( $at_check_trace; ovs-vsctl -- add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:204: ovs-vsctl -- set interface p0 bfd:enable=true " -at_fn_check_prepare_trace "bfd.at:204" -( $at_check_trace; ovs-vsctl -- set interface p0 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:204" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:205: ovs-vsctl -- set interface p1 bfd:enable=true " -at_fn_check_prepare_trace "bfd.at:205" -( $at_check_trace; ovs-vsctl -- set interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 30`; do ovs-appctl time/warp 100; done -#Verify that BFD has been enabled on both interfaces. - -{ set +x -$as_echo "$at_srcdir/bfd.at:208: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:208" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:208" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:209: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:209" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:209" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -#Edit the min Tx value. -{ set +x -$as_echo "$at_srcdir/bfd.at:211: ovs-vsctl set interface p0 bfd:min_tx=200" -at_fn_check_prepare_trace "bfd.at:211" -( $at_check_trace; ovs-vsctl set interface p0 bfd:min_tx=200 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:211" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 20`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:213: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:213" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 1000ms - Local Minimum TX Interval: 200ms - Remote Minimum TX Interval: 100ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:213" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:214: ovs-appctl bfd/show p1 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:214" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 1000ms - Local Minimum TX Interval: 100ms - Remote Minimum TX Interval: 200ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:214" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -#Edit the min Rx value. -{ set +x -$as_echo "$at_srcdir/bfd.at:217: ovs-vsctl set interface p1 bfd:min_rx=300" -at_fn_check_prepare_trace "bfd.at:217" -( $at_check_trace; ovs-vsctl set interface p1 bfd:min_rx=300 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:217" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 20`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:219: ovs-appctl bfd/show p1 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:219" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 300ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 1000ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:219" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:220: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:220" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 1000ms - Local Minimum RX Interval: 1000ms - Remote Minimum RX Interval: 300ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:220" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:222: check_logs " -at_fn_check_prepare_trace "bfd.at:222" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:222: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "bfd.at:222" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:222: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "bfd.at:222" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_4 -#AT_START_5 -at_fn_group_banner 5 'bfd.at:225' \ - "bfd - check_tnl_key" " " 1 -at_xfail=no -( - $as_echo "5. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:226: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:226" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:226" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:226: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:226" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:226" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:226: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:226" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:226" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:226: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:226" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:226: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:226" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:226: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:226" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:226: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \\ - options:remote_ip=2.2.2.2 options:key=1 ofport_request=1 -- \\ - set interface p1 bfd:enable=true -- \\ - set bridge br0 fail-mode=standalone " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:226" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \ - options:remote_ip=2.2.2.2 options:key=1 ofport_request=1 -- \ - set interface p1 bfd:enable=true -- \ - set bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# by default check_tnl_key is false. so we should process a bfd packet with tun_id=1. -{ set +x -$as_echo "$at_srcdir/bfd.at:232: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate" -at_fn_check_prepare_trace "bfd.at:232" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:232" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check that the packet should be handled as BFD packet. -{ set +x -$as_echo "$at_srcdir/bfd.at:234: tail -2 stdout" -at_fn_check_prepare_trace "bfd.at:234" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "This flow is handled by the userspace slow path because it: - - Consists of BFD packets. -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:234" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# turn on the check_tnl_key. -{ set +x -$as_echo "$at_srcdir/bfd.at:240: ovs-vsctl set interface p1 bfd:check_tnl_key=true" -at_fn_check_prepare_trace "bfd.at:240" -( $at_check_trace; ovs-vsctl set interface p1 bfd:check_tnl_key=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:240" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:241: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate" -at_fn_check_prepare_trace "bfd.at:241" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:241" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check that the packet should be handled as normal packet. -{ set +x -$as_echo "$at_srcdir/bfd.at:243: tail -1 stdout" -at_fn_check_prepare_trace "bfd.at:243" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 100 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:243" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# set the tunnel key to 0. -{ set +x -$as_echo "$at_srcdir/bfd.at:248: ovs-vsctl set interface p1 options:key=0" -at_fn_check_prepare_trace "bfd.at:248" -( $at_check_trace; ovs-vsctl set interface p1 options:key=0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:248" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/bfd.at:249: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate" -at_fn_check_prepare_trace "bfd.at:249" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=2.2.2.2,dst=2.2.2.1,tos=0x0,ttl=64,flags(key)),in_port(1),skb_mark(0/0),eth(src=00:11:22:33:44:55,dst=00:23:20:00:00:01),eth_type(0x0800),ipv4(src=169.254.1.0/0.0.0.0,dst=169.254.1.1/0.0.0.0,proto=17/0xff,tos=0/0,ttl=255/0,frag=no/0xff),udp(src=49152/0,dst=3784/0xffff)' -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:249" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check that the packet should be handled as BFD packet. -{ set +x -$as_echo "$at_srcdir/bfd.at:251: tail -2 stdout" -at_fn_check_prepare_trace "bfd.at:251" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "This flow is handled by the userspace slow path because it: - - Consists of BFD packets. -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:256: check_logs " -at_fn_check_prepare_trace "bfd.at:256" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:256" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:256: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "bfd.at:256" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:256" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:256: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "bfd.at:256" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:256" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_5 -#AT_START_6 -at_fn_group_banner 6 'bfd.at:260' \ - "bfd - bfd decay" " " 1 -at_xfail=no -( - $as_echo "6. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:261: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:261" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:261" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:261: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:261" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:261" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:261: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:261" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:261" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:261: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:261" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:261: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:261" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:261: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:261" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:261: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 ofport_request=2 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 ofport_request=1 -- \\ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \\ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:261" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 ofport_request=2 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 ofport_request=1 -- \ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop - -# wait for a while to stablize everything. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:273: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:273" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:273" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:274: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:274" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:274" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:275: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:275" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:275" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:276: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:276" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:276" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Test-1 BFD decay: decay to decay_min_rx -{ set +x -$as_echo "$at_srcdir/bfd.at:279: ovs-vsctl set interface p0 bfd:decay_min_rx=3000" -at_fn_check_prepare_trace "bfd.at:279" -( $at_check_trace; ovs-vsctl set interface p0 bfd:decay_min_rx=3000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:279" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# bfd:decay_min_rx is set to 3000ms after the local state of p0 goes up, -# so for the first 2000ms, there should be no change. -for i in `seq 0 3`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:283: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:283" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:283" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:284: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:284" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# advance the clock by 5000ms. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done -# now, min_rx should decay to 3000ms. - -{ set +x -$as_echo "$at_srcdir/bfd.at:289: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:289" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:289" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:290: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:290" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 3000ms - Local Minimum RX Interval: 3000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# advance clock by 5000ms and check the the flags are all 'none'. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:294: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:294" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:294" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:295: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:295" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:295" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:296: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:296" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:296" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:297: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:297" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 3000ms - Local Minimum RX Interval: 3000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:297" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# End of Test-1 ############################################################### - - -# Test-2 BFD decay: go back to min_rx when there is traffic -# receive packet at 1/100ms rate for 5000ms. -for i in `seq 0 49` -do - ovs-appctl time/warp 100 - { set +x -$as_echo "$at_srcdir/bfd.at:306: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:306" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:306" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done -# after a decay interval (3000ms), the p0 min_rx will go back to -# min_rx. - -{ set +x -$as_echo "$at_srcdir/bfd.at:311: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:311" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:311" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:312: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:312" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:312" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# End of Test-2 ############################################################### - - -# Test-3 BFD decay: set decay_min_rx to 1000ms. -# this should firstly reset the min_rx and then re-decay to 1000ms. -{ set +x -$as_echo "$at_srcdir/bfd.at:318: ovs-vsctl set Interface p0 bfd:decay_min_rx=1000" -at_fn_check_prepare_trace "bfd.at:318" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:decay_min_rx=1000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:318" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock by 10000ms, decay should have happened. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:321: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:321" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:322: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:322" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:322" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:323: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:323" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:323" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:324: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:324" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 1000ms - Local Minimum RX Interval: 1000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:324" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# End of Test-3 ############################################################### - - -# Test-4 BFD decay: set decay_min_rx to 0 to disable bfd decay. -{ set +x -$as_echo "$at_srcdir/bfd.at:329: ovs-vsctl set Interface p0 bfd:decay_min_rx=0" -at_fn_check_prepare_trace "bfd.at:329" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:decay_min_rx=0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:329" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock by 5000ms. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done -# min_rx is reset. - -{ set +x -$as_echo "$at_srcdir/bfd.at:333: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:333" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:333" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:334: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:334" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:334" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -for i in `seq 0 20` -do - ovs-appctl time/warp 500 - -{ set +x -$as_echo "$at_srcdir/bfd.at:339: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:339" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:339" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:340: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:340" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:340" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:341: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:341" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:341" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:342: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:342" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done -# End of Test-4 ################################################################ - - -# Test-5 BFD decay: rmt_min_tx is greater than decay_min_rx -{ set +x -$as_echo "$at_srcdir/bfd.at:348: ovs-vsctl set Interface p0 bfd:decay_min_rx=3000 -- set interface p1 bfd:min_tx=5000" -at_fn_check_prepare_trace "bfd.at:348" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:decay_min_rx=3000 -- set interface p1 bfd:min_tx=5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:348" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock by 10000ms to stable everything. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:351: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:351" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:351" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:352: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:352" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:352" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# p0 rx should show 5000ms even if it is in decay. - -{ set +x -$as_echo "$at_srcdir/bfd.at:354: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:354" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 5000ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:354" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:355: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:355" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 5000ms - Local Minimum RX Interval: 3000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:355" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# then, there should be no change of status, -for i in `seq 0 19` -do - ovs-appctl time/warp 500 - -{ set +x -$as_echo "$at_srcdir/bfd.at:360: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:360" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:360" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:361: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:361" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:361" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:362: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:362" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 5000ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:362" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:363: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:363" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 5000ms - Local Minimum RX Interval: 3000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done -# reset the p1's min_tx to 500ms. -{ set +x -$as_echo "$at_srcdir/bfd.at:366: ovs-vsctl set Interface p1 bfd:min_tx=500" -at_fn_check_prepare_trace "bfd.at:366" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:min_tx=500 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock by 20000ms to stable everything. -# since p0 has been in decay, now the RX will show 3000ms. -for i in `seq 0 39`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:370: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:370" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:371: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:371" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 3000ms - Local Minimum RX Interval: 3000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:371" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# End of Test-5 ############################################################### - - -# Test-6 BFD decay: state up->down->up. -# turn bfd off on p1 -{ set +x -$as_echo "$at_srcdir/bfd.at:377: ovs-vsctl set Interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:377" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:377" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# advance the clock by 15000ms to stable everything. -for i in `seq 0 14`; do ovs-appctl time/warp 1000; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:381: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:381" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:381" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:382: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:382" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 1000ms - Local Minimum TX Interval: 1000ms - Remote Minimum TX Interval: 0ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:383: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:383" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 300ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 1ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:383" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# resume the bfd on p1. the bfd should not go to decay mode direclty. -{ set +x -$as_echo "$at_srcdir/bfd.at:386: ovs-vsctl set Interface p1 bfd:enable=true" -at_fn_check_prepare_trace "bfd.at:386" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 3`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:388: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:388" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:389: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:389" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 300ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:389" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# since the decay_min_rx is still 3000ms, so after 5000ms, p0 should have decayed. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:393: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:393" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:393" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:394: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:394" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 3000ms - Local Minimum RX Interval: 3000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:394" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# End of Test-6 ################################################################ - -{ set +x -$as_echo "$at_srcdir/bfd.at:397: check_logs " -at_fn_check_prepare_trace "bfd.at:397" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:397" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:397: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "bfd.at:397" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:397" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:397: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "bfd.at:397" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:397" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_6 -#AT_START_7 -at_fn_group_banner 7 'bfd.at:407' \ - "bfd - bfd forwarding_if_rx - bfd on one side" " " 1 -at_xfail=no -( - $as_echo "7. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:408: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:408" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:408" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:408: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:408" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:408" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:408: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:408" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:408" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:408: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:408" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:408" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:408: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:408" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:408" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:408: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:408" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:408" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:408: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 ofport_request=2 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 ofport_request=1 -- \\ - set Interface p0 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -- \\ - add-port br1 p2 -- set Interface p2 type=internal ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:408" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 ofport_request=2 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 ofport_request=1 -- \ - set Interface p0 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -- \ - add-port br1 p2 -- set Interface p2 type=internal ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:408" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# check the inital status. - -{ set +x -$as_echo "$at_srcdir/bfd.at:418: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:418" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:418" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:419: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:419" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 1000ms - Local Minimum TX Interval: 1000ms - Remote Minimum TX Interval: 0ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:419" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:420: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:420" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 500ms - Remote Minimum RX Interval: 1ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:420" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# enable forwarding_if_rx. -{ set +x -$as_echo "$at_srcdir/bfd.at:423: ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true" -at_fn_check_prepare_trace "bfd.at:423" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:423" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# there should be no change of forwarding flag, since -# there is no traffic. -for i in `seq 0 3` -do - ovs-appctl time/warp 500 - -{ set +x -$as_echo "$at_srcdir/bfd.at:430: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:430" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:430" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done - -# receive packet at 1/100ms rate for 2000ms. -for i in `seq 0 19` -do - ovs-appctl time/warp 100 - { set +x -$as_echo "$at_srcdir/bfd.at:437: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:437" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:437" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done -# the forwarding flag should be false, due to the demand_rx_bfd. - -{ set +x -$as_echo "$at_srcdir/bfd.at:441: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:441" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:441" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:443: ovs-vsctl del-br br1" -at_fn_check_prepare_trace "bfd.at:443" -( $at_check_trace; ovs-vsctl del-br br1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:443" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_7 -#AT_START_8 -at_fn_group_banner 8 'bfd.at:451' \ - "bfd - bfd forwarding_if_rx - bfd on both sides" " " 1 -at_xfail=no -( - $as_echo "8. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:452: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:452" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:452" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:452: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:452" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:452" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:452: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:452" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:452" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:452: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:452" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:452" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:452: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:452" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:452" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:452: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:452" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:452" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:452: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 ofport_request=2 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 ofport_request=1 -- \\ - set Interface p0 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -- \\ - set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \\ - add-port br1 p2 -- set Interface p2 type=internal ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:452" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 ofport_request=2 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 ofport_request=1 -- \ - set Interface p0 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -- \ - set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \ - add-port br1 p2 -- set Interface p2 type=internal ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:452" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# advance the clock, to stablize the states. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done - -# enable forwarding_if_rx. -{ set +x -$as_echo "$at_srcdir/bfd.at:466: ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true" -at_fn_check_prepare_trace "bfd.at:466" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# there should be no change of the forwarding flag, since -# the bfd on both ends is already up. -for i in `seq 0 5` -do - ovs-appctl time/warp 500 - -{ set +x -$as_echo "$at_srcdir/bfd.at:473: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:473" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done - -# stop the bfd on one side. -{ set +x -$as_echo "$at_srcdir/bfd.at:477: ovs-vsctl set Interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:477" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:477" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# for within 1500ms, the detection timer is not out. -# there is no change to status. -for i in `seq 0 1` -do - ovs-appctl time/warp 500 - -{ set +x -$as_echo "$at_srcdir/bfd.at:483: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:483" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:483" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - for i in `seq 0 4` - do - { set +x -$as_echo "$at_srcdir/bfd.at:486: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:486" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:486" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - done -done - -# at 1500ms, the STATE should go DOWN, due to Control Detection Time Expired. -# but forwarding flag should be still true. -ovs-appctl time/warp 500 - -{ set +x -$as_echo "$at_srcdir/bfd.at:494: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:494" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# reset bfd forwarding_if_rx. -{ set +x -$as_echo "$at_srcdir/bfd.at:497: ovs-vsctl set Interface p0 bfd:forwarding_if_rx=false" -at_fn_check_prepare_trace "bfd.at:497" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:forwarding_if_rx=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# forwarding flag should turn to false since the STATE is DOWN. - -{ set +x -$as_echo "$at_srcdir/bfd.at:499: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:499" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:499" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# re-enable bfd on the other end. the states should be up. -{ set +x -$as_echo "$at_srcdir/bfd.at:502: ovs-vsctl set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300" -at_fn_check_prepare_trace "bfd.at:502" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:502" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock, to stablize the states. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:505: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:505" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:505" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:506: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:506" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:506" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:507: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:507" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 500ms - Remote Minimum TX Interval: 300ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:507" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:508: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:508" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 500ms - Local Minimum RX Interval: 500ms - Remote Minimum RX Interval: 300ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:508" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:510: ovs-vsctl del-br br1" -at_fn_check_prepare_trace "bfd.at:510" -( $at_check_trace; ovs-vsctl del-br br1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:510" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_8 -#AT_START_9 -at_fn_group_banner 9 'bfd.at:516' \ - "bfd - bfd forwarding_if_rx - with bfd decay" " " 1 -at_xfail=no -( - $as_echo "9. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:517: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:517" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:517" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:517: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:517" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:517" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:517: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:517" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:517" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:517: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:517" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:517" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:517: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:517" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:517" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:517: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:517" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:517" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:517: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 ofport_request=2 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 ofport_request=1 -- \\ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 bfd:decay_min_rx=3000 -- \\ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:517" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 ofport_request=2 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 ofport_request=1 -- \ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 bfd:decay_min_rx=3000 -- \ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:517" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# advance the clock, to stablize the states. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:528: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:528" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:528" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:529: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:529" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:529" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:530: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:530" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:530" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:531: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:531" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 3000ms - Local Minimum RX Interval: 3000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# enable forwarding_if_rx. -{ set +x -$as_echo "$at_srcdir/bfd.at:534: ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true" -at_fn_check_prepare_trace "bfd.at:534" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:534" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# there should be no change of the forwarding flag, since -# the bfd on both ends is already up. -for i in `seq 0 9` -do - ovs-appctl time/warp 500 - -{ set +x -$as_echo "$at_srcdir/bfd.at:541: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:541" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:541" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done - -# reconfigure the decay_min_rx to 1000ms. -{ set +x -$as_echo "$at_srcdir/bfd.at:545: ovs-vsctl set interface p0 bfd:decay_min_rx=1000" -at_fn_check_prepare_trace "bfd.at:545" -( $at_check_trace; ovs-vsctl set interface p0 bfd:decay_min_rx=1000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:545" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# wait for 5000ms to decay. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:549: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:549" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:549" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:550: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:550" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:550" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:551: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:551" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 1000ms - Local Minimum RX Interval: 1000ms - Remote Minimum RX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:551" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# stop the bfd on one side. -{ set +x -$as_echo "$at_srcdir/bfd.at:554: ovs-vsctl set Interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:554" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:554" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# advance clock by 4000ms, while receiving packets. -# the STATE should go DOWN, due to Control Detection Time Expired. -# but forwarding flag should be still true. -for i in `seq 0 7` -do - ovs-appctl time/warp 500 - { set +x -$as_echo "$at_srcdir/bfd.at:562: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:562" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/bfd.at:565: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:565" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:565" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# receive packet at 1/100ms rate for 1000ms. -for i in `seq 0 9` -do - { set +x -$as_echo "$at_srcdir/bfd.at:570: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:570" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:570" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - ovs-appctl time/warp 100 - # the forwarding flag should always be true during this time. - -{ set +x -$as_echo "$at_srcdir/bfd.at:574: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:574" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done - -# stop receiving for 5000ms. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:579: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:579" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:579" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# reset bfd forwarding_if_rx. -{ set +x -$as_echo "$at_srcdir/bfd.at:582: ovs-vsctl set Interface p0 bfd:forwarding_if_rx=false" -at_fn_check_prepare_trace "bfd.at:582" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:forwarding_if_rx=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:582" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:583: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:583" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:583" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# re-enable bfd forwarding_if_rx. -{ set +x -$as_echo "$at_srcdir/bfd.at:585: ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true" -at_fn_check_prepare_trace "bfd.at:585" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:585" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:586: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:586" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:586" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# re-enable bfd on the other end. the states should be up. -{ set +x -$as_echo "$at_srcdir/bfd.at:589: ovs-vsctl set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300" -at_fn_check_prepare_trace "bfd.at:589" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:589" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock, to stablize the states. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:592: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:592" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:592" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:593: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:593" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:593" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:594: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:594" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 300ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 300ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:594" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:595: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:595" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 1000ms - Local Minimum RX Interval: 1000ms - Remote Minimum RX Interval: 300ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:597: ovs-vsctl del-br br1" -at_fn_check_prepare_trace "bfd.at:597" -( $at_check_trace; ovs-vsctl del-br br1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:597" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_9 -#AT_START_10 -at_fn_group_banner 10 'bfd.at:603' \ - "bfd - bfd forwarding_if_rx - demand_rx_bfd" " " 1 -at_xfail=no -( - $as_echo "10. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:604: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:604" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:604" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:604: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:604" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:604" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:604: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:604" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:604" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:604: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:604" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:604" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:604: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:604" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:604" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:604: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:604" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:604" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:604: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 ofport_request=2 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 ofport_request=1 -- \\ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 bfd:forwarding_if_rx=true -- \\ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:604" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 ofport_request=2 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 ofport_request=1 -- \ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 bfd:forwarding_if_rx=true -- \ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:604" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# advance the clock, to stablize the states. -for i in `seq 0 19`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:615: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:615" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:615" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:616: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:616" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:616" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:617: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:617" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# disable the bfd on p1. -{ set +x -$as_echo "$at_srcdir/bfd.at:620: ovs-vsctl set Interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:620" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:620" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# advance clock by 4000ms, while receiving packets. -# the STATE should go DOWN, due to Control Detection Time Expired. -# but forwarding flag should be still true. -for i in `seq 0 7` -do - ovs-appctl time/warp 500 - { set +x -$as_echo "$at_srcdir/bfd.at:628: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:628" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/bfd.at:631: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:631" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:631" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# advance clock long enough to trigger the demand_bfd_rx interval -# (100 * bfd->cfm_min_rx), forwarding flag should go down since there -# is no bfd control packet received during the demand_rx_bfd. -for i in `seq 0 120` -do - ovs-appctl time/warp 300 - { set +x -$as_echo "$at_srcdir/bfd.at:639: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:639" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:639" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/bfd.at:642: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:642" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:642" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# now enable the bfd on p1 again. -{ set +x -$as_echo "$at_srcdir/bfd.at:645: ovs-vsctl set Interface p1 bfd:enable=true" -at_fn_check_prepare_trace "bfd.at:645" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:645" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance clock by 5000ms. and p1 and p0 should be all up. -for i in `seq 0 9`; do ovs-appctl time/warp 500; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:648: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:648" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:648" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:649: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:649" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: Control Detection Time Expired -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:649" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:650: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:650" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 500ms - Local Minimum TX Interval: 300ms - Remote Minimum TX Interval: 500ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# disable the bfd on p1 again. -{ set +x -$as_echo "$at_srcdir/bfd.at:653: ovs-vsctl set Interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:653" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:653" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance clock long enough to trigger the demand_rx_bfd, -# forwarding flag should go down since there is no bfd control packet -# received during the demand_rx_bfd. -for i in `seq 0 120` -do - ovs-appctl time/warp 300 - { set +x -$as_echo "$at_srcdir/bfd.at:660: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:660" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:660" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/bfd.at:663: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:663" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:663" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:665: ovs-vsctl del-br br1" -at_fn_check_prepare_trace "bfd.at:665" -( $at_check_trace; ovs-vsctl del-br br1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:665" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_10 -#AT_START_11 -at_fn_group_banner 11 'bfd.at:673' \ - "bfd - flap_count" " " 1 -at_xfail=no -( - $as_echo "11. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable bfd -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/bfd.at:675: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "bfd.at:675" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:675" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:675: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "bfd.at:675" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:675" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:675: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:675" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:675" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/bfd.at:675: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "bfd.at:675" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:675" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:675: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "bfd.at:675" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:675" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:675: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:675" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:675" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/bfd.at:675: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 ofport_request=2 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 ofport_request=1 -- \\ - set Interface p0 bfd:enable=true bfd:min_tx=100 bfd:min_rx=100 -- \\ - set Interface p1 bfd:enable=true bfd:min_tx=100 bfd:min_rx=100 " -at_fn_check_prepare_notrace 'an embedded newline' "bfd.at:675" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 ofport_request=2 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 ofport_request=1 -- \ - set Interface p0 bfd:enable=true bfd:min_tx=100 bfd:min_rx=100 -- \ - set Interface p1 bfd:enable=true bfd:min_tx=100 bfd:min_rx=100 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:675" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop - -# Part-1 wait for a while to stablize bfd. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:689: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:689" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:689" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:690: ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:690" -( $at_check_trace; ovs-appctl bfd/show p1 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: up - Local Diagnostic: No Diagnostic - - Remote Flags: none - Remote Session State: up - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:690" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:691: ovs-appctl bfd/show p0 | sed -n '/TX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:691" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/TX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " TX Interval: Approx 100ms - Local Minimum TX Interval: 100ms - Remote Minimum TX Interval: 100ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:691" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:692: ovs-appctl bfd/show p0 | sed -n '/RX Interval/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:692" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -n '/RX Interval/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " RX Interval: Approx 100ms - Local Minimum RX Interval: 100ms - Remote Minimum RX Interval: 100ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:692" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# both p0 and p1 should have flap_count = "1". since down->up. - -{ set +x -$as_echo "$at_srcdir/bfd.at:694: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:694" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"1\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:694" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:695: ovs-vsctl list interface p1 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:695" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"1\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:695" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# turn bfd on p1 off, should increment the bfd:flap_count on p0. -{ set +x -$as_echo "$at_srcdir/bfd.at:698: ovs-vsctl set interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:698" -( $at_check_trace; ovs-vsctl set interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:698" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 49`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:700: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:700" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:700" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:701: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:701" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"2\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:701" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:702: ovs-vsctl list interface p1 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:702" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:702" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# turn bfd on p1 on again, should increment the bfd:flap_count on p0. -# p1 should still have flap_count = "1", since it is reset. -{ set +x -$as_echo "$at_srcdir/bfd.at:706: ovs-vsctl set interface p1 bfd:enable=true" -at_fn_check_prepare_trace "bfd.at:706" -( $at_check_trace; ovs-vsctl set interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:706" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 49`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:708: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:708" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"3\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:708" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:709: ovs-vsctl list interface p1 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:709" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"1\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:709" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - -# Part-2 now turn on the forwarding_override. -{ set +x -$as_echo "$at_srcdir/bfd.at:713: ovs-appctl bfd/set-forwarding p0 true" -at_fn_check_prepare_trace "bfd.at:713" -( $at_check_trace; ovs-appctl bfd/set-forwarding p0 true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# turn bfd on p1 off, should not increment the bfd:flap_count on p0, since forwarding_override is on. -{ set +x -$as_echo "$at_srcdir/bfd.at:718: ovs-vsctl set interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:718" -( $at_check_trace; ovs-vsctl set interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:718" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 49`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:720: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:720" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:720" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:721: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:721" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"3\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:721" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/bfd.at:722: ovs-vsctl list interface p1 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:722" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:722" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# turn bfd on p1 on again, should not increment the bfd:flap_count on p0, since forwarding override is on. -# p1 should still have flap_count = "1", since it is reset. -{ set +x -$as_echo "$at_srcdir/bfd.at:726: ovs-vsctl set interface p1 bfd:enable=true" -at_fn_check_prepare_trace "bfd.at:726" -( $at_check_trace; ovs-vsctl set interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:726" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 49`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:728: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:728" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"3\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:728" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:729: ovs-vsctl list interface p1 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:729" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"1\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:729" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# turn the forwarding_override back to normal. -{ set +x -$as_echo "$at_srcdir/bfd.at:732: ovs-appctl bfd/set-forwarding p0 normal" -at_fn_check_prepare_trace "bfd.at:732" -( $at_check_trace; ovs-appctl bfd/set-forwarding p0 normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:732" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# turn bfd on p1 off and on, should increment the bfd:flap_count on p0. -{ set +x -$as_echo "$at_srcdir/bfd.at:737: ovs-vsctl set interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:737" -( $at_check_trace; ovs-vsctl set interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:737" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 49`; do ovs-appctl time/warp 100; done -{ set +x -$as_echo "$at_srcdir/bfd.at:739: ovs-vsctl set interface p1 bfd:enable=true" -at_fn_check_prepare_trace "bfd.at:739" -( $at_check_trace; ovs-vsctl set interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:739" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 49`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:741: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:741" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"5\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:741" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:742: ovs-vsctl list interface p1 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:742" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"1\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:742" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Part-3 now turn on forwarding_if_rx. -{ set +x -$as_echo "$at_srcdir/bfd.at:745: ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true" -at_fn_check_prepare_trace "bfd.at:745" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:forwarding_if_rx=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 10`; do ovs-appctl time/warp 100; done -# disable the bfd on p1. -{ set +x -$as_echo "$at_srcdir/bfd.at:748: ovs-vsctl set Interface p1 bfd:enable=false" -at_fn_check_prepare_trace "bfd.at:748" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:748" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# advance clock by 4000ms, while receiving packets. -# the STATE should go DOWN, due to Control Detection Time Expired. -# but forwarding flag should be true. -for i in `seq 0 39` -do - ovs-appctl time/warp 100 - { set +x -$as_echo "$at_srcdir/bfd.at:756: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:756" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:756" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/bfd.at:759: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:759" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: true - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:759" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# flap_count should remain unchanged. - -{ set +x -$as_echo "$at_srcdir/bfd.at:761: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:761" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"5\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:761" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# stop the traffic for more than 100 * bfd->cfm_min_rx ms, the forwarding flag of p0 should turn false. -# and there should be the increment of flap_count. -for i in `seq 0 120`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/bfd.at:766: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:766" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:766" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:767: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:767" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"6\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:767" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# advance clock by 4000ms, and resume the traffic. -for i in `seq 0 39` -do - ovs-appctl time/warp 100 - { set +x -$as_echo "$at_srcdir/bfd.at:773: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "bfd.at:773" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:773" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done -# forwarding should be false, since there is still no bfd control packet received. - -{ set +x -$as_echo "$at_srcdir/bfd.at:777: ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:777" -( $at_check_trace; ovs-appctl bfd/show p0 | sed -e '/Time:/d' | sed -e '/Discriminator/d' | sed -e '/Interval:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Forwarding: false - Detect Multiplier: 3 - Concatenated Path Down: false - - Local Flags: none - Local Session State: down - Local Diagnostic: Control Detection Time Expired - - Remote Flags: none - Remote Session State: down - Remote Diagnostic: No Diagnostic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:777" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:778: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:778" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"6\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:778" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# turn on the bfd on p1. -{ set +x -$as_echo "$at_srcdir/bfd.at:781: ovs-vsctl set interface p1 bfd:enable=true" -at_fn_check_prepare_trace "bfd.at:781" -( $at_check_trace; ovs-vsctl set interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 49`; do ovs-appctl time/warp 100; done -# even though there is no data traffic, since p1 bfd is on again, should increment the flap_count. - -{ set +x -$as_echo "$at_srcdir/bfd.at:784: ovs-vsctl list interface p0 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:784" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"7\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:784" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:785: ovs-vsctl list interface p1 | sed -n \"s/^.*flap_count=\\(.*\\), forwarding.*\$/\\1/p\"" -at_fn_check_prepare_notrace 'a shell pipeline' "bfd.at:785" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n "s/^.*flap_count=\(.*\), forwarding.*$/\1/p" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"1\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:785" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/bfd.at:787: check_logs " -at_fn_check_prepare_trace "bfd.at:787" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:787" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:787: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "bfd.at:787" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:787" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/bfd.at:787: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "bfd.at:787" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bfd.at:787" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_11 -#AT_START_12 -at_fn_group_banner 12 'cfm.at:49' \ - "cfm - check update ovsdb 1" " " 2 -at_xfail=no -( - $as_echo "12. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/cfm.at:50: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "cfm.at:50" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:50: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "cfm.at:50" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:50: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:50" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/cfm.at:50: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "cfm.at:50" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:50: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "cfm.at:50" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:50: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:50" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:50: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p0 -- set Interface p0 type=gre \\ - options:remote_ip=1.2.3.4 -- \\ - set Interface p0 other_config:cfm_interval=300 other_config:cfm_extended=true " -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:50" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p0 -- set Interface p0 type=gre \ - options:remote_ip=1.2.3.4 -- \ - set Interface p0 other_config:cfm_interval=300 other_config:cfm_extended=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop - -{ set +x -$as_echo "$at_srcdir/cfm.at:56: ovs-vsctl set Interface p0 cfm_mpid=1" -at_fn_check_prepare_trace "cfm.at:56" -( $at_check_trace; ovs-vsctl set Interface p0 cfm_mpid=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# at beginning, since the first fault check timeout is not reached -# cfm_fault should be false. -for i in `seq 0 4`; do - ovs-appctl time/warp 100 - - -{ set +x -$as_echo "$at_srcdir/cfm.at:61: ovs-vsctl list interface p0 | sed -n '/cfm_fault /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:61" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault : false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:61: ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:61" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:61: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:61" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:61: ovs-vsctl list interface p0 | sed -n '/cfm_health /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:61" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_health /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_health : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:61: ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:61" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_mpids : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:61: ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:61" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_opstate : up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -done - -# advance clock to pass the fault check timeout and check cfm -# status update in OVSDB. -for i in `seq 0 14`; do ovs-appctl time/warp 100; done - - -{ set +x -$as_echo "$at_srcdir/cfm.at:67: ovs-vsctl list interface p0 | sed -n '/cfm_fault /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:67" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault : true -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:67: ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:67" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [recv] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:67: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:67" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:67: ovs-vsctl list interface p0 | sed -n '/cfm_health /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:67" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_health /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_health : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:67: ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:67" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_mpids : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:67: ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:67" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_opstate : up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - -# remove the cfm on p0 and status should be all empty. -{ set +x -$as_echo "$at_srcdir/cfm.at:70: ovs-vsctl remove int p0 cfm_mpid 1" -at_fn_check_prepare_trace "cfm.at:70" -( $at_check_trace; ovs-vsctl remove int p0 cfm_mpid 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:70" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 4`; do ovs-appctl time/warp 100; done - - -{ set +x -$as_echo "$at_srcdir/cfm.at:72: ovs-vsctl list interface p0 | sed -n '/cfm_fault /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:72" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:72: ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:72" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:72: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:72" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:72: ovs-vsctl list interface p0 | sed -n '/cfm_health /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:72" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_health /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_health : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:72: ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:72" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_mpids : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:72: ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:72" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_opstate : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:74: check_logs " -at_fn_check_prepare_trace "cfm.at:74" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:74" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:74: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "cfm.at:74" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:74" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:74: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "cfm.at:74" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:74" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_12 -#AT_START_13 -at_fn_group_banner 13 'cfm.at:78' \ - "cfm - check update ovsdb 2" " " 2 -at_xfail=no -( - $as_echo "13. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable cfm -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/cfm.at:80: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "cfm.at:80" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:80: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "cfm.at:80" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:80: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:80" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/cfm.at:80: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "cfm.at:80" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:80" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:80: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "cfm.at:80" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:80" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:80: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:80" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:80" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:80: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 -- \\ - set Interface p0 other_config:cfm_interval=300 other_config:cfm_extended=true -- \\ - set Interface p1 other_config:cfm_interval=300 other_config:cfm_extended=true " -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:80" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 -- \ - set Interface p0 other_config:cfm_interval=300 other_config:cfm_extended=true -- \ - set Interface p1 other_config:cfm_interval=300 other_config:cfm_extended=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:80" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop - -{ set +x -$as_echo "$at_srcdir/cfm.at:92: ovs-vsctl set Interface p0 cfm_mpid=1" -at_fn_check_prepare_trace "cfm.at:92" -( $at_check_trace; ovs-vsctl set Interface p0 cfm_mpid=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:92" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check cfm status update in OVSDB. -for i in `seq 0 14`; do ovs-appctl time/warp 100; done - - -{ set +x -$as_echo "$at_srcdir/cfm.at:95: ovs-vsctl list interface p0 | sed -n '/cfm_fault /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:95" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault : true -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:95: ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:95" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [recv] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:95: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:95" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:95: ovs-vsctl list interface p0 | sed -n '/cfm_health /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:95" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_health /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_health : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:95: ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:95" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_mpids : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:95: ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:95" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_opstate : up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - -# turn cfm on p1 on, cfm status of p0 and p1 should all go up. -{ set +x -$as_echo "$at_srcdir/cfm.at:98: ovs-vsctl set interface p1 cfm_mpid=2" -at_fn_check_prepare_trace "cfm.at:98" -( $at_check_trace; ovs-vsctl set interface p1 cfm_mpid=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:98" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 14`; do ovs-appctl time/warp 100; done - - -{ set +x -$as_echo "$at_srcdir/cfm.at:100: ovs-vsctl list interface p0 | sed -n '/cfm_fault /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:100" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault : false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:100: ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:100" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:100: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:100" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:100: ovs-vsctl list interface p0 | sed -n '/cfm_health /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:100" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_health /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_health : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:100: ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:100" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_mpids : [2] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:100: ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:100" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_opstate : up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:101: ovs-vsctl list interface p1 | sed -n '/cfm_fault /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:101" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_fault /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault : false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:101: ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:101" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:101: ovs-vsctl list interface p1 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:101" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:101: ovs-vsctl list interface p1 | sed -n '/cfm_health /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:101" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_health /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_health : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:101: ovs-vsctl list interface p1 | sed -n '/cfm_remote_mpids /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:101" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_remote_mpids /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_mpids : [1] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:101: ovs-vsctl list interface p1 | sed -n '/cfm_remote_opstate /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:101" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_remote_opstate /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_opstate : up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - -# turn cfm on p1 off, cfm status of p0 should go down again. -{ set +x -$as_echo "$at_srcdir/cfm.at:104: ovs-vsctl remove int p1 cfm_mpid 2" -at_fn_check_prepare_trace "cfm.at:104" -( $at_check_trace; ovs-vsctl remove int p1 cfm_mpid 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:104" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 14`; do ovs-appctl time/warp 100; done - - -{ set +x -$as_echo "$at_srcdir/cfm.at:106: ovs-vsctl list interface p0 | sed -n '/cfm_fault /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:106" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault : true -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:106: ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:106" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [recv] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:106: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:106" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:106: ovs-vsctl list interface p0 | sed -n '/cfm_health /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:106" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_health /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_health : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:106: ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:106" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_mpids /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_mpids : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:106: ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:106" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_remote_opstate /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_remote_opstate : up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:108: check_logs " -at_fn_check_prepare_trace "cfm.at:108" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:108: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "cfm.at:108" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:108: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "cfm.at:108" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_13 -#AT_START_14 -at_fn_group_banner 14 'cfm.at:112' \ - "cfm - demand mode" " " 2 -at_xfail=no -( - $as_echo "14. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable cfm -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/cfm.at:114: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "cfm.at:114" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:114: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "cfm.at:114" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:114: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:114" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/cfm.at:114: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "cfm.at:114" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:114: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "cfm.at:114" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:114: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:114" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:114: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 -- \\ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=300 other_config:cfm_extended=true -- \\ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=300 other_config:cfm_extended=true " -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:114" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 -- \ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=300 other_config:cfm_extended=true -- \ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=300 other_config:cfm_extended=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# wait for a while to stablize cfm. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/cfm.at:127: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:127" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:127" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:128: ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:128" -( $at_check_trace; ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- -MPID 2: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 1 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:128" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# turn on demand mode on one end. -{ set +x -$as_echo "$at_srcdir/cfm.at:131: ovs-vsctl set interface p0 other_config:cfm_demand=true" -at_fn_check_prepare_trace "cfm.at:131" -( $at_check_trace; ovs-vsctl set interface p0 other_config:cfm_demand=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:131" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# cfm should never go down. -for i in `seq 0 100` -do - ovs-appctl time/warp 100 - -{ set +x -$as_echo "$at_srcdir/cfm.at:137: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:137" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:137" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:138: ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:138" -( $at_check_trace; ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- -MPID 2: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 1 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:138" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done - -# turn on demand mode on the other end. -{ set +x -$as_echo "$at_srcdir/cfm.at:142: ovs-vsctl set interface p1 other_config:cfm_demand=true" -at_fn_check_prepare_trace "cfm.at:142" -( $at_check_trace; ovs-vsctl set interface p1 other_config:cfm_demand=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:142" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 100` -do - ovs-appctl time/warp 100 - -{ set +x -$as_echo "$at_srcdir/cfm.at:146: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:146" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:146" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:147: ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:147" -( $at_check_trace; ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- -MPID 2: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 1 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -done - -{ set +x -$as_echo "$at_srcdir/cfm.at:150: check_logs " -at_fn_check_prepare_trace "cfm.at:150" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:150" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:150: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "cfm.at:150" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:150" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:150: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "cfm.at:150" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:150" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_14 -#AT_START_15 -at_fn_group_banner 15 'cfm.at:154' \ - "cfm - demand_rx_ccm" " " 2 -at_xfail=no -( - $as_echo "15. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable cfm -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/cfm.at:156: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "cfm.at:156" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:156: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "cfm.at:156" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:156: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:156" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/cfm.at:156: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "cfm.at:156" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:156: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "cfm.at:156" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:156: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:156" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:156: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 ofport_request=2 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 ofport_request=1 -- \\ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=300 other_config:cfm_extended=true other_config:cfm_demand=true -- \\ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=300 other_config:cfm_extended=true other_config:cfm_demand=true " -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:156" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 ofport_request=2 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 ofport_request=1 -- \ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=300 other_config:cfm_extended=true other_config:cfm_demand=true -- \ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=300 other_config:cfm_extended=true other_config:cfm_demand=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# wait for a while to stablize cfm. (need a longer time, since in demand mode -# the fault interval is (MAX(ccm_interval_ms, 500) * 3.5) ms) -for i in `seq 0 200`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/cfm.at:170: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:170" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:170" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:171: ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:171" -( $at_check_trace; ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- -MPID 2: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 1 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:171" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# turn off the cfm on p1. -{ set +x -$as_echo "$at_srcdir/cfm.at:174: ovs-vsctl clear Interface p1 cfm_mpid" -at_fn_check_prepare_trace "cfm.at:174" -( $at_check_trace; ovs-vsctl clear Interface p1 cfm_mpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:174" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# cfm should never go down while receiving data packets. -for i in `seq 0 200` -do - ovs-appctl time/warp 100 - { set +x -$as_echo "$at_srcdir/cfm.at:179: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "cfm.at:179" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:179" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/cfm.at:182: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:182" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 0 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:182" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# wait longer, since the demand_rx_ccm interval is 100 * 300 ms. -# since there is no ccm received, the [recv] fault should be raised. -for i in `seq 0 200` -do - ovs-appctl time/warp 100 - { set +x -$as_echo "$at_srcdir/cfm.at:189: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "cfm.at:189" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:189" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/cfm.at:192: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:192" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - fault: recv - average health: 0 - opstate: up - remote_opstate: up - interval: 300ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:192" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# now turn on the cfm on p1 again, -{ set +x -$as_echo "$at_srcdir/cfm.at:195: ovs-vsctl set Interface p1 cfm_mpid=2" -at_fn_check_prepare_trace "cfm.at:195" -( $at_check_trace; ovs-vsctl set Interface p1 cfm_mpid=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:195" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# cfm should be up for both p0 and p1 -for i in `seq 0 200`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/cfm.at:198: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:198" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:199: ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:199" -( $at_check_trace; ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- -MPID 2: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 300ms -Remote MPID 1 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:199" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# now turn off the cfm on p1 again -{ set +x -$as_echo "$at_srcdir/cfm.at:202: ovs-vsctl clear Interface p1 cfm_mpid" -at_fn_check_prepare_trace "cfm.at:202" -( $at_check_trace; ovs-vsctl clear Interface p1 cfm_mpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# since there is no ccm received, the [recv] fault should be raised. -for i in `seq 0 400` -do - ovs-appctl time/warp 100 - { set +x -$as_echo "$at_srcdir/cfm.at:207: ovs-ofctl packet-out br1 3 2 \"90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202\"" -at_fn_check_prepare_trace "cfm.at:207" -( $at_check_trace; ovs-ofctl packet-out br1 3 2 "90e2ba01475000101856b2e80806000108000604000100101856b2e80202020300000000000002020202" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:207" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/cfm.at:210: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:210" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - fault: recv - average health: 0 - opstate: up - remote_opstate: up - interval: 300ms -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:210" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:212: check_logs " -at_fn_check_prepare_trace "cfm.at:212" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:212" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:212: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "cfm.at:212" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:212" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:212: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "cfm.at:212" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:212" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_15 -#AT_START_16 -at_fn_group_banner 16 'cfm.at:216' \ - "cfm - flap_count" " " 2 -at_xfail=no -( - $as_echo "16. $at_setup_line: testing $at_desc ..." - $at_traceon - -#Create 2 bridges connected by patch ports and enable cfm -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/cfm.at:218: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "cfm.at:218" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:218: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "cfm.at:218" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:218: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:218" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/cfm.at:218: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "cfm.at:218" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:218: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "cfm.at:218" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:218: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:218" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:218: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 -- \\ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=100 other_config:cfm_extended=true -- \\ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=100 other_config:cfm_extended=true " -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:218" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 -- \ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=100 other_config:cfm_extended=true -- \ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=100 other_config:cfm_extended=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop - -# wait for a while to stablize cfm. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/cfm.at:232: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:232" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 100ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:232" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:233: ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:233" -( $at_check_trace; ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- -MPID 2: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 100ms -Remote MPID 1 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:233" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# turn cfm on p1 off, should increment the cfm_flap_count on p0. -{ set +x -$as_echo "$at_srcdir/cfm.at:236: ovs-vsctl remove interface p1 cfm_mpid 2" -at_fn_check_prepare_trace "cfm.at:236" -( $at_check_trace; ovs-vsctl remove interface p1 cfm_mpid 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:236" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 10`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/cfm.at:238: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:238" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:238" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:239: ovs-vsctl list interface p1 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:239" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:239" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# turn cfm on p1 on again, should increment the cfm_flap_count on p0. -{ set +x -$as_echo "$at_srcdir/cfm.at:242: ovs-vsctl set interface p1 cfm_mpid=2" -at_fn_check_prepare_trace "cfm.at:242" -( $at_check_trace; ovs-vsctl set interface p1 cfm_mpid=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 10`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/cfm.at:244: ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:244" -( $at_check_trace; ovs-vsctl list interface p0 | sed -n '/cfm_flap_count /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_flap_count : 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:244" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:246: check_logs " -at_fn_check_prepare_trace "cfm.at:246" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:246" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:246: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "cfm.at:246" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:246" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:246: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "cfm.at:246" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:246" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_16 -#AT_START_17 -at_fn_group_banner 17 'cfm.at:249' \ - "cfm - fault_override" " " 2 -at_xfail=no -( - $as_echo "17. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/cfm.at:250: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "cfm.at:250" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:250: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "cfm.at:250" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:250: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:250" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/cfm.at:250: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "cfm.at:250" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:250: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "cfm.at:250" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:250: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:250" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/cfm.at:250: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy \\ - other-config:hwaddr=aa:55:aa:56:00:00 -- \\ - add-port br1 p1 -- set Interface p1 type=patch \\ - options:peer=p0 -- \\ - add-port br0 p0 -- set Interface p0 type=patch \\ - options:peer=p1 -- \\ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=100 other_config:cfm_extended=true -- \\ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=100 other_config:cfm_extended=true " -at_fn_check_prepare_notrace 'an embedded newline' "cfm.at:250" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy \ - other-config:hwaddr=aa:55:aa:56:00:00 -- \ - add-port br1 p1 -- set Interface p1 type=patch \ - options:peer=p0 -- \ - add-port br0 p0 -- set Interface p0 type=patch \ - options:peer=p1 -- \ - set Interface p0 cfm_mpid=1 other_config:cfm_interval=100 other_config:cfm_extended=true -- \ - set Interface p1 cfm_mpid=2 other_config:cfm_interval=100 other_config:cfm_extended=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# wait for a while to stablize cfm. -for i in `seq 0 100`; do ovs-appctl time/warp 100; done - -{ set +x -$as_echo "$at_srcdir/cfm.at:263: ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:263" -( $at_check_trace; ovs-appctl cfm/show p0 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p0 ---- -MPID 1: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 100ms -Remote MPID 2 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:263" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:264: ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:264" -( $at_check_trace; ovs-appctl cfm/show p1 | sed -e '/next CCM tx:/d' | sed -e '/next fault check:/d' | sed -e '/recv since check:/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- -MPID 2: extended - average health: 100 - opstate: up - remote_opstate: up - interval: 100ms -Remote MPID 1 - opstate: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:264" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/cfm.at:265: ovs-appctl cfm/show p1 | grep 'fault_override'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:265" -( $at_check_trace; ovs-appctl cfm/show p1 | grep 'fault_override' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/cfm.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/cfm.at:266: ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:266" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:266" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# set a fault and see that this is shown in the CFM module and the database -{ set +x -$as_echo "$at_srcdir/cfm.at:269: ovs-appctl cfm/set-fault p1 true" -at_fn_check_prepare_trace "cfm.at:269" -( $at_check_trace; ovs-appctl cfm/set-fault p1 true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:269" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/cfm.at:271: ovs-appctl time/warp 100" -at_fn_check_prepare_trace "cfm.at:271" -( $at_check_trace; ovs-appctl time/warp 100 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:271" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/cfm.at:272: ovs-appctl cfm/show p1 | grep 'fault_override' | sed -e 's/MPID [0-9]*: extended //'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:272" -( $at_check_trace; ovs-appctl cfm/show p1 | grep 'fault_override' | sed -e 's/MPID [0-9]*: extended //' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "fault_override -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:272" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/cfm.at:275: ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:275" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [override] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:275" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# reset and see that it returned to normal -{ set +x -$as_echo "$at_srcdir/cfm.at:278: ovs-appctl cfm/set-fault normal" -at_fn_check_prepare_trace "cfm.at:278" -( $at_check_trace; ovs-appctl cfm/set-fault normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:278" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/cfm.at:280: ovs-appctl time/warp 100" -at_fn_check_prepare_trace "cfm.at:280" -( $at_check_trace; ovs-appctl time/warp 100 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:280" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/cfm.at:281: ovs-appctl cfm/show p1 | grep 'fault_override'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:281" -( $at_check_trace; ovs-appctl cfm/show p1 | grep 'fault_override' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/cfm.at:281" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/cfm.at:282: ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p'" -at_fn_check_prepare_notrace 'a shell pipeline' "cfm.at:282" -( $at_check_trace; ovs-vsctl list interface p1 | sed -n '/cfm_fault_status /p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "cfm_fault_status : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:282" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/cfm.at:284: check_logs " -at_fn_check_prepare_trace "cfm.at:284" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:284: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "cfm.at:284" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/cfm.at:284: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "cfm.at:284" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cfm.at:284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_17 -#AT_START_18 -at_fn_group_banner 18 'lacp.at:13' \ - "lacp - config" " " 3 -at_xfail=no -( - $as_echo "18. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/lacp.at:14: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "lacp.at:14" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:14" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:14: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "lacp.at:14" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:14" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:14: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:14" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:14" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/lacp.at:14: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "lacp.at:14" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:14" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:14: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "lacp.at:14" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:14" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:14: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:14" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:14" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:14: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- \\ - add-port br0 p1 --\\ - set Port p1 lacp=active --\\ - set Interface p1 type=dummy " -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:14" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- \ - add-port br0 p1 --\ - set Port p1 lacp=active --\ - set Interface p1 type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:14" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 - -{ set +x -$as_echo "$at_srcdir/lacp.at:24: ovs-appctl lacp/show" -at_fn_check_prepare_trace "lacp.at:24" -( $at_check_trace; ovs-appctl lacp/show -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- p1 ---- - status: active negotiated - sys_id: aa:55:aa:55:00:00 - sys_priority: 65535 - aggregation key: 1 - lacp_time: slow - -slave: p1: expired attached - port_id: 1 - port_priority: 65535 - may_enable: false - - actor sys_id: aa:55:aa:55:00:00 - actor sys_priority: 65535 - actor port_id: 1 - actor port_priority: 65535 - actor key: 1 - actor state: activity synchronized collecting distributing expired - - partner sys_id: 00:00:00:00:00:00 - partner sys_priority: 0 - partner port_id: 0 - partner port_priority: 0 - partner key: 0 - partner state: timeout -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:24" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:51: ovs-appctl bond/show" -at_fn_check_prepare_trace "lacp.at:51" -( $at_check_trace; ovs-appctl bond/show -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:51" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:52: check_logs " -at_fn_check_prepare_trace "lacp.at:52" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:52" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:52: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "lacp.at:52" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:52" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:52: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "lacp.at:52" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:52" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_18 -#AT_START_19 -at_fn_group_banner 19 'lacp.at:55' \ - "lacp - multi port config" " " 3 -at_xfail=no -( - $as_echo "19. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/lacp.at:56: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "lacp.at:56" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:56" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:56: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "lacp.at:56" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:56" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:56: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:56" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:56" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/lacp.at:56: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "lacp.at:56" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:56: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "lacp.at:56" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:56: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:56" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:56: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond p1 p2 --\\ - set Port bond lacp=active bond-mode=active-backup \\ - other_config:lacp-time=\"fast\" \\ - other_config:lacp-system-id=11:22:33:44:55:66 \\ - other_config:lacp-system-priority=54321 --\\ - set Interface p1 type=dummy \\ - other_config:lacp-port-id=11 \\ - other_config:lacp-port-priority=111 \\ - other_config:lacp-aggregation-key=3333 --\\ - set Interface p2 type=dummy \\ - other_config:lacp-port-id=22 \\ - other_config:lacp-port-priority=222 \\ - other_config:lacp-aggregation-key=3333 " -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:56" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond p1 p2 --\ - set Port bond lacp=active bond-mode=active-backup \ - other_config:lacp-time="fast" \ - other_config:lacp-system-id=11:22:33:44:55:66 \ - other_config:lacp-system-priority=54321 --\ - set Interface p1 type=dummy \ - other_config:lacp-port-id=11 \ - other_config:lacp-port-priority=111 \ - other_config:lacp-aggregation-key=3333 --\ - set Interface p2 type=dummy \ - other_config:lacp-port-id=22 \ - other_config:lacp-port-priority=222 \ - other_config:lacp-aggregation-key=3333 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 - -{ set +x -$as_echo "$at_srcdir/lacp.at:76: ovs-appctl lacp/show" -at_fn_check_prepare_trace "lacp.at:76" -( $at_check_trace; ovs-appctl lacp/show -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:76" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:77: sed -e 's/aggregation key:.*/aggregation key: /' < stdout" -at_fn_check_prepare_trace "lacp.at:77" -( $at_check_trace; sed -e 's/aggregation key:.*/aggregation key: /' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- bond ---- - status: active negotiated - sys_id: 11:22:33:44:55:66 - sys_priority: 54321 - aggregation key: - lacp_time: fast - -slave: p1: expired attached - port_id: 11 - port_priority: 111 - may_enable: false - - actor sys_id: 11:22:33:44:55:66 - actor sys_priority: 54321 - actor port_id: 11 - actor port_priority: 111 - actor key: 3333 - actor state: activity timeout aggregation synchronized collecting distributing expired - - partner sys_id: 00:00:00:00:00:00 - partner sys_priority: 0 - partner port_id: 0 - partner port_priority: 0 - partner key: 0 - partner state: timeout - -slave: p2: expired attached - port_id: 22 - port_priority: 222 - may_enable: false - - actor sys_id: 11:22:33:44:55:66 - actor sys_priority: 54321 - actor port_id: 22 - actor port_priority: 222 - actor key: 3333 - actor state: activity timeout aggregation synchronized collecting distributing expired - - partner sys_id: 00:00:00:00:00:00 - partner sys_priority: 0 - partner port_id: 0 - partner port_priority: 0 - partner key: 0 - partner state: timeout -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:77" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:123: ovs-appctl bond/show" -at_fn_check_prepare_trace "lacp.at:123" -( $at_check_trace; ovs-appctl bond/show -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- bond ---- -bond_mode: active-backup -bond may use recirculation: no, Recirc-ID : -1 -bond-hash-basis: 0 -updelay: 0 ms -downdelay: 0 ms -lacp_status: negotiated -active slave mac: 00:00:00:00:00:00(none) - -slave p1: disabled - may_enable: false - -slave p2: disabled - may_enable: false - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:123" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:140: check_logs " -at_fn_check_prepare_trace "lacp.at:140" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:140: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "lacp.at:140" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:140: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "lacp.at:140" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_19 -#AT_START_20 -at_fn_group_banner 20 'lacp.at:143' \ - "lacp - negotiation" " " 3 -at_xfail=no -( - $as_echo "20. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Create bond0 on br0 with interfaces p0 and p1 -# and bond1 on br1 with interfaces p2 and p3 -# with p0 patched to p2 and p1 patched to p3. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/lacp.at:147: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "lacp.at:147" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:147: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "lacp.at:147" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:147: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:147" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/lacp.at:147: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "lacp.at:147" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:147: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "lacp.at:147" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:147: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:147" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/lacp.at:147: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \\ - other-config:lacp-time=fast \\ - other-config:bond-rebalance-interval=0 -- \\ - set interface p0 type=patch options:peer=p2 ofport_request=1 \\ - other-config:lacp-aggregation-key=2 -- \\ - set interface p1 type=patch options:peer=p3 ofport_request=2 \\ - other-config:lacp-aggregation-key=2 -- \\ - add-br br1 -- \\ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \\ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \\ - fail-mode=secure -- \\ - add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \\ - other-config:lacp-time=fast \\ - other-config:bond-rebalance-interval=0 -- \\ - set interface p2 type=patch options:peer=p0 ofport_request=3 \\ - other-config:lacp-aggregation-key=4 -- \\ - set interface p3 type=patch options:peer=p1 ofport_request=4 \\ - other-config:lacp-aggregation-key=4 -- " -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:147" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \ - other-config:lacp-time=fast \ - other-config:bond-rebalance-interval=0 -- \ - set interface p0 type=patch options:peer=p2 ofport_request=1 \ - other-config:lacp-aggregation-key=2 -- \ - set interface p1 type=patch options:peer=p3 ofport_request=2 \ - other-config:lacp-aggregation-key=2 -- \ - add-br br1 -- \ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ - fail-mode=secure -- \ - add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \ - other-config:lacp-time=fast \ - other-config:bond-rebalance-interval=0 -- \ - set interface p2 type=patch options:peer=p0 ofport_request=3 \ - other-config:lacp-aggregation-key=4 -- \ - set interface p3 type=patch options:peer=p1 ofport_request=4 \ - other-config:lacp-aggregation-key=4 -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/lacp.at:167: ovs-appctl netdev-dummy/set-admin-state up" -at_fn_check_prepare_trace "lacp.at:167" -( $at_check_trace; ovs-appctl netdev-dummy/set-admin-state up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:167" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl time/stop - -# Wait for up to 5 (simulated) seconds, until LACP negotiation finishes. -i=0 -while :; do - ovs-appctl lacp/show bond0 > bond0 - - ovs-appctl lacp/show bond1 > bond1 - - if grep negotiated bond0 && grep negotiated bond1; then - if grep expired bond0 || grep expired bond1; then - : - else - break - fi - fi - i=`expr $i + 1` - if test $i = 50; then - $as_echo "lacp.at:188" >"$at_check_line_file" -at_fn_check_skip 99 "$at_srcdir/lacp.at:188" - fi - ovs-appctl time/warp 100 -done - -# Now check the correctly negotiated configuration. -{ set +x -$as_echo "$at_srcdir/lacp.at:194: ovs-appctl lacp/show bond0 -ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 | sed ' - s/Recirc-ID.*\$// -' | sed ' - s/active slave mac.*\$// -' -ovs-appctl bond/show bond1 | sed ' - s/Recirc-ID.*\$// -' | sed ' - s/active slave mac.*\$// -' " -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:194" -( $at_check_trace; ovs-appctl lacp/show bond0 -ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 | sed ' - s/Recirc-ID.*$// -' | sed ' - s/active slave mac.*$// -' -ovs-appctl bond/show bond1 | sed ' - s/Recirc-ID.*$// -' | sed ' - s/active slave mac.*$// -' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:194" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:199: sed '/active slave/d' stdout" -at_fn_check_prepare_trace "lacp.at:199" -( $at_check_trace; sed '/active slave/d' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- bond0 ---- - status: active negotiated - sys_id: aa:55:aa:55:00:00 - sys_priority: 65534 - aggregation key: 2 - lacp_time: fast - -slave: p0: current attached - port_id: 1 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:55:aa:55:00:00 - actor sys_priority: 65534 - actor port_id: 1 - actor port_priority: 65535 - actor key: 2 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:66:aa:66:00:00 - partner sys_priority: 65534 - partner port_id: 3 - partner port_priority: 65535 - partner key: 4 - partner state: activity timeout aggregation synchronized collecting distributing - -slave: p1: current attached - port_id: 2 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:55:aa:55:00:00 - actor sys_priority: 65534 - actor port_id: 2 - actor port_priority: 65535 - actor key: 2 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:66:aa:66:00:00 - partner sys_priority: 65534 - partner port_id: 4 - partner port_priority: 65535 - partner key: 4 - partner state: activity timeout aggregation synchronized collecting distributing ----- bond1 ---- - status: active negotiated - sys_id: aa:66:aa:66:00:00 - sys_priority: 65534 - aggregation key: 4 - lacp_time: fast - -slave: p2: current attached - port_id: 3 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:66:aa:66:00:00 - actor sys_priority: 65534 - actor port_id: 3 - actor port_priority: 65535 - actor key: 4 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:55:aa:55:00:00 - partner sys_priority: 65534 - partner port_id: 1 - partner port_priority: 65535 - partner key: 2 - partner state: activity timeout aggregation synchronized collecting distributing - -slave: p3: current attached - port_id: 4 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:66:aa:66:00:00 - actor sys_priority: 65534 - actor port_id: 4 - actor port_priority: 65535 - actor key: 4 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:55:aa:55:00:00 - partner sys_priority: 65534 - partner port_id: 2 - partner port_priority: 65535 - partner key: 2 - partner state: activity timeout aggregation synchronized collecting distributing ----- bond0 ---- -bond_mode: balance-tcp -bond may use recirculation: yes, -bond-hash-basis: 0 -updelay: 0 ms -downdelay: 0 ms -lacp_status: negotiated - -slave p0: enabled - may_enable: true - -slave p1: enabled - may_enable: true - ----- bond1 ---- -bond_mode: balance-tcp -bond may use recirculation: yes, -bond-hash-basis: 0 -updelay: 0 ms -downdelay: 0 ms -lacp_status: negotiated - -slave p2: enabled - may_enable: true - -slave p3: enabled - may_enable: true - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:199" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:317: grep 'active slave\$' stdout" -at_fn_check_prepare_dynamic "grep 'active slave$' stdout" "lacp.at:317" -( $at_check_trace; grep 'active slave$' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " active slave - active slave -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:317" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - - -# Redirect the patch link between p0 and p2 so that no packets get -# back and forth across them anymore. Then wait 4 simulated -# seconds. The LACP state should become "expired" for p0 and p2. -{ set +x -$as_echo "$at_srcdir/lacp.at:325: ovs-vsctl \\ --- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \\ --- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1" -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:325" -( $at_check_trace; ovs-vsctl \ --- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \ --- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:325" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - - -for i in `seq 0 40`; do ovs-appctl time/warp 100; done -{ set +x -$as_echo "$at_srcdir/lacp.at:330: ovs-appctl lacp/show bond0 -ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 | sed ' - s/Recirc-ID.*\$// -' | sed ' - s/active slave mac.*\$// -' -ovs-appctl bond/show bond1 | sed ' - s/Recirc-ID.*\$// -' | sed ' - s/active slave mac.*\$// -' " -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:330" -( $at_check_trace; ovs-appctl lacp/show bond0 -ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 | sed ' - s/Recirc-ID.*$// -' | sed ' - s/active slave mac.*$// -' -ovs-appctl bond/show bond1 | sed ' - s/Recirc-ID.*$// -' | sed ' - s/active slave mac.*$// -' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- bond0 ---- - status: active negotiated - sys_id: aa:55:aa:55:00:00 - sys_priority: 65534 - aggregation key: 2 - lacp_time: fast - -slave: p0: expired attached - port_id: 1 - port_priority: 65535 - may_enable: false - - actor sys_id: aa:55:aa:55:00:00 - actor sys_priority: 65534 - actor port_id: 1 - actor port_priority: 65535 - actor key: 2 - actor state: activity timeout aggregation synchronized collecting distributing expired - - partner sys_id: aa:66:aa:66:00:00 - partner sys_priority: 65534 - partner port_id: 3 - partner port_priority: 65535 - partner key: 4 - partner state: activity timeout aggregation collecting distributing - -slave: p1: current attached - port_id: 2 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:55:aa:55:00:00 - actor sys_priority: 65534 - actor port_id: 2 - actor port_priority: 65535 - actor key: 2 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:66:aa:66:00:00 - partner sys_priority: 65534 - partner port_id: 4 - partner port_priority: 65535 - partner key: 4 - partner state: activity timeout aggregation synchronized collecting distributing ----- bond1 ---- - status: active negotiated - sys_id: aa:66:aa:66:00:00 - sys_priority: 65534 - aggregation key: 4 - lacp_time: fast - -slave: p2: expired attached - port_id: 3 - port_priority: 65535 - may_enable: false - - actor sys_id: aa:66:aa:66:00:00 - actor sys_priority: 65534 - actor port_id: 3 - actor port_priority: 65535 - actor key: 4 - actor state: activity timeout aggregation synchronized collecting distributing expired - - partner sys_id: aa:55:aa:55:00:00 - partner sys_priority: 65534 - partner port_id: 1 - partner port_priority: 65535 - partner key: 2 - partner state: activity timeout aggregation collecting distributing - -slave: p3: current attached - port_id: 4 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:66:aa:66:00:00 - actor sys_priority: 65534 - actor port_id: 4 - actor port_priority: 65535 - actor key: 4 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:55:aa:55:00:00 - partner sys_priority: 65534 - partner port_id: 2 - partner port_priority: 65535 - partner key: 2 - partner state: activity timeout aggregation synchronized collecting distributing ----- bond0 ---- -bond_mode: balance-tcp -bond may use recirculation: yes, -bond-hash-basis: 0 -updelay: 0 ms -downdelay: 0 ms -lacp_status: negotiated - - -slave p0: disabled - may_enable: false - -slave p1: enabled - active slave - may_enable: true - ----- bond1 ---- -bond_mode: balance-tcp -bond may use recirculation: yes, -bond-hash-basis: 0 -updelay: 0 ms -downdelay: 0 ms -lacp_status: negotiated - - -slave p2: disabled - may_enable: false - -slave p3: enabled - active slave - may_enable: true - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - - -# Wait 4 more simulated seconds. The LACP state should become -# "defaulted" for p0 and p2. -for i in `seq 0 40`; do ovs-appctl time/warp 100; done -{ set +x -$as_echo "$at_srcdir/lacp.at:460: ovs-appctl lacp/show bond0 -ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 | sed ' - s/Recirc-ID.*\$// -' | sed ' - s/active slave mac.*\$// -' -ovs-appctl bond/show bond1 | sed ' - s/Recirc-ID.*\$// -' | sed ' - s/active slave mac.*\$// -' " -at_fn_check_prepare_notrace 'an embedded newline' "lacp.at:460" -( $at_check_trace; ovs-appctl lacp/show bond0 -ovs-appctl lacp/show bond1 -ovs-appctl bond/show bond0 | sed ' - s/Recirc-ID.*$// -' | sed ' - s/active slave mac.*$// -' -ovs-appctl bond/show bond1 | sed ' - s/Recirc-ID.*$// -' | sed ' - s/active slave mac.*$// -' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "---- bond0 ---- - status: active negotiated - sys_id: aa:55:aa:55:00:00 - sys_priority: 65534 - aggregation key: 2 - lacp_time: fast - -slave: p0: defaulted detached - port_id: 1 - port_priority: 65535 - may_enable: false - - actor sys_id: aa:55:aa:55:00:00 - actor sys_priority: 65534 - actor port_id: 1 - actor port_priority: 65535 - actor key: 2 - actor state: activity timeout aggregation defaulted - - partner sys_id: 00:00:00:00:00:00 - partner sys_priority: 0 - partner port_id: 0 - partner port_priority: 0 - partner key: 0 - partner state: - -slave: p1: current attached - port_id: 2 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:55:aa:55:00:00 - actor sys_priority: 65534 - actor port_id: 2 - actor port_priority: 65535 - actor key: 2 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:66:aa:66:00:00 - partner sys_priority: 65534 - partner port_id: 4 - partner port_priority: 65535 - partner key: 4 - partner state: activity timeout aggregation synchronized collecting distributing ----- bond1 ---- - status: active negotiated - sys_id: aa:66:aa:66:00:00 - sys_priority: 65534 - aggregation key: 4 - lacp_time: fast - -slave: p2: defaulted detached - port_id: 3 - port_priority: 65535 - may_enable: false - - actor sys_id: aa:66:aa:66:00:00 - actor sys_priority: 65534 - actor port_id: 3 - actor port_priority: 65535 - actor key: 4 - actor state: activity timeout aggregation defaulted - - partner sys_id: 00:00:00:00:00:00 - partner sys_priority: 0 - partner port_id: 0 - partner port_priority: 0 - partner key: 0 - partner state: - -slave: p3: current attached - port_id: 4 - port_priority: 65535 - may_enable: true - - actor sys_id: aa:66:aa:66:00:00 - actor sys_priority: 65534 - actor port_id: 4 - actor port_priority: 65535 - actor key: 4 - actor state: activity timeout aggregation synchronized collecting distributing - - partner sys_id: aa:55:aa:55:00:00 - partner sys_priority: 65534 - partner port_id: 2 - partner port_priority: 65535 - partner key: 2 - partner state: activity timeout aggregation synchronized collecting distributing ----- bond0 ---- -bond_mode: balance-tcp -bond may use recirculation: yes, -bond-hash-basis: 0 -updelay: 0 ms -downdelay: 0 ms -lacp_status: negotiated - - -slave p0: disabled - may_enable: false - -slave p1: enabled - active slave - may_enable: true - ----- bond1 ---- -bond_mode: balance-tcp -bond may use recirculation: yes, -bond-hash-basis: 0 -updelay: 0 ms -downdelay: 0 ms -lacp_status: negotiated - - -slave p2: disabled - may_enable: false - -slave p3: enabled - active slave - may_enable: true - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:460" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/lacp.at:586: check_logs " -at_fn_check_prepare_trace "lacp.at:586" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:586" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:586: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "lacp.at:586" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:586" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lacp.at:586: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "lacp.at:586" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lacp.at:586" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"bond0" \ -"bond1" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_20 -#AT_START_21 -at_fn_group_banner 21 'library.at:3' \ - "test flow extractor" " " 4 -at_xfail=no -( - $as_echo "21. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:4: \$PERL \`which flowgen.pl\` >/dev/null 3>flows 4>pcap" -at_fn_check_prepare_notrace 'a `...` command substitution' "library.at:4" -( $at_check_trace; $PERL `which flowgen.pl` >/dev/null 3>flows 4>pcap -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/library.at:5: ovstest test-flows >"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "checked 247 packets, 0 errors -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:5" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_21 -#AT_START_22 -at_fn_group_banner 22 'library.at:9' \ - "test TCP/IP checksumming" " " 4 -at_xfail=no -( - $as_echo "22. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:10: ovstest test-csum" -at_fn_check_prepare_trace "library.at:10" -( $at_check_trace; ovstest test-csum -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "....#....#....###................................#................................# -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:10" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_22 -#AT_START_23 -at_fn_group_banner 23 'library.at:14' \ - "test hash functions" " " 4 -at_xfail=no -( - $as_echo "23. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:15: ovstest test-hash" -at_fn_check_prepare_trace "library.at:15" -( $at_check_trace; ovstest test-hash -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:15" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_23 -#AT_START_24 -at_fn_group_banner 24 'library.at:18' \ - "test hash map" " " 4 -at_xfail=no -( - $as_echo "24. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:19: ovstest test-hmap" -at_fn_check_prepare_trace "library.at:19" -( $at_check_trace; ovstest test-hmap -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "......... -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_24 -#AT_START_25 -at_fn_group_banner 25 'library.at:23' \ - "test hash index" " " 4 -at_xfail=no -( - $as_echo "25. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:24: ovstest test-hindex" -at_fn_check_prepare_trace "library.at:24" -( $at_check_trace; ovstest test-hindex -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "..................... -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:24" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_25 -#AT_START_26 -at_fn_group_banner 26 'library.at:28' \ - "test atomic operations" " " 4 -at_xfail=no -( - $as_echo "26. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:29: ovstest test-atomic" -at_fn_check_prepare_trace "library.at:29" -( $at_check_trace; ovstest test-atomic -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_26 -#AT_START_27 -at_fn_group_banner 27 'library.at:32' \ - "test linked lists" " " 4 -at_xfail=no -( - $as_echo "27. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:33: ovstest test-list" -at_fn_check_prepare_trace "library.at:33" -( $at_check_trace; ovstest test-list -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo ".. -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:33" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_27 -#AT_START_28 -at_fn_group_banner 28 'library.at:37' \ - "test packet library" " " 4 -at_xfail=no -( - $as_echo "28. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:38: ovstest test-packets" -at_fn_check_prepare_trace "library.at:38" -( $at_check_trace; ovstest test-packets -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:38" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_28 -#AT_START_29 -at_fn_group_banner 29 'library.at:41' \ - "test SHA-1" " " 4 -at_xfail=no -( - $as_echo "29. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:42: ovstest test-sha1" -at_fn_check_prepare_trace "library.at:42" -( $at_check_trace; ovstest test-sha1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "......... -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:42" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_29 -#AT_START_30 -at_fn_group_banner 30 'library.at:46' \ - "test type properties" " " 4 -at_xfail=no -( - $as_echo "30. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:47: test-type-props" -at_fn_check_prepare_trace "library.at:47" -( $at_check_trace; test-type-props -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_30 -#AT_START_31 -at_fn_group_banner 31 'library.at:50' \ - "test strtok_r bug fix" " " 4 -at_xfail=no -( - $as_echo "31. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:51: test-strtok_r" -at_fn_check_prepare_trace "library.at:51" -( $at_check_trace; test-strtok_r -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NULL NULL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:51" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_31 -#AT_START_32 -at_fn_group_banner 32 'library.at:55' \ - "test byte order conversion" " " 4 -at_xfail=no -( - $as_echo "32. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/library.at:57: ovstest test-byte-order" -at_fn_check_prepare_trace "library.at:57" -( $at_check_trace; ovstest test-byte-order -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:57" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_32 -#AT_START_33 -at_fn_group_banner 33 'library.at:60' \ - "test random number generator" " " 4 -at_xfail=no -( - $as_echo "33. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:61: ovstest test-random" -at_fn_check_prepare_trace "library.at:61" -( $at_check_trace; ovstest test-random -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "average=7fa2014f - -bit 0 1 - 0 4946 5054 - 1 4939 5061 - 2 4947 5053 - 3 4935 5065 - 4 5004 4996 - 5 4998 5002 - 6 5062 4938 - 7 5009 4991 - 8 5001 4999 - 9 5022 4978 - 10 5006 4994 - 11 5039 4961 - 12 4940 5060 - 13 5048 4952 - 14 4930 5070 - 15 4973 5027 - 16 4954 5046 - 17 5043 4957 - 18 5020 4980 - 19 5104 4896 - 20 5051 4949 - 21 5003 4997 - 22 5110 4890 - 23 4950 5050 - 24 5016 4984 - 25 5019 4981 - 26 4948 5052 - 27 4995 5005 - 28 4995 5005 - 29 4969 5031 - 30 5109 4891 - 31 4984 5016 -(expected values are 5000) - -nibble 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 0 640 589 610 613 588 632 650 613 582 646 627 640 612 650 637 671 - 1 626 642 663 620 630 609 617 602 615 638 614 644 641 597 598 644 - 2 667 611 617 613 609 629 642 651 604 641 594 659 651 610 617 585 - 3 621 662 594 605 618 644 616 613 613 616 611 608 614 660 653 652 - 4 641 668 621 664 619 624 625 642 624 629 607 566 599 639 618 614 - 5 666 629 620 621 581 615 598 620 630 651 671 622 628 603 657 588 - 6 620 640 621 606 603 644 628 633 620 597 653 591 637 658 634 615 - 7 636 645 679 593 598 609 612 612 623 626 638 669 603 629 606 622 -(expected values are 625) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_33 -#AT_START_34 -at_fn_group_banner 34 'library.at:112' \ - "ctz() function" " " 4 -at_xfail=no -( - $as_echo "34. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util ctz" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util ctz -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_34 -#AT_START_35 -at_fn_group_banner 35 'library.at:112' \ - "clz() function" " " 4 -at_xfail=no -( - $as_echo "35. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util clz" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util clz -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_35 -#AT_START_36 -at_fn_group_banner 36 'library.at:112' \ - "round_up_pow2() function" " " 4 -at_xfail=no -( - $as_echo "36. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util round_up_pow2" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util round_up_pow2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_36 -#AT_START_37 -at_fn_group_banner 37 'library.at:112' \ - "round_down_pow2() function" " " 4 -at_xfail=no -( - $as_echo "37. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util round_down_pow2" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util round_down_pow2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_37 -#AT_START_38 -at_fn_group_banner 38 'library.at:112' \ - "count_1bits() function" " " 4 -at_xfail=no -( - $as_echo "38. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util count_1bits" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util count_1bits -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_38 -#AT_START_39 -at_fn_group_banner 39 'library.at:112' \ - "log_2_floor() function" " " 4 -at_xfail=no -( - $as_echo "39. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util log_2_floor" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util log_2_floor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_39 -#AT_START_40 -at_fn_group_banner 40 'library.at:112' \ - "bitwise_copy() function" " " 4 -at_xfail=no -( - $as_echo "40. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util bitwise_copy" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util bitwise_copy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_40 -#AT_START_41 -at_fn_group_banner 41 'library.at:112' \ - "bitwise_zero() function" " " 4 -at_xfail=no -( - $as_echo "41. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util bitwise_zero" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util bitwise_zero -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_41 -#AT_START_42 -at_fn_group_banner 42 'library.at:112' \ - "bitwise_one() function" " " 4 -at_xfail=no -( - $as_echo "42. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util bitwise_one" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util bitwise_one -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_42 -#AT_START_43 -at_fn_group_banner 43 'library.at:112' \ - "bitwise_is_all_zeros() function" " " 4 -at_xfail=no -( - $as_echo "43. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util bitwise_is_all_zeros" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util bitwise_is_all_zeros -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_43 -#AT_START_44 -at_fn_group_banner 44 'library.at:112' \ - "ovs_scan() function" " " 4 -at_xfail=no -( - $as_echo "44. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/library.at:112: ovstest test-util ovs_scan" -at_fn_check_prepare_trace "library.at:112" -( $at_check_trace; ovstest test-util ovs_scan -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_44 -#AT_START_45 -at_fn_group_banner 45 'library.at:130' \ - "test unix socket, short pathname - C" " " 4 -at_xfail=no -( - $as_echo "45. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "library.at:131" >"$at_check_line_file" -(test "$IS_WIN32" = "yes") \ - && at_fn_check_skip 77 "$at_srcdir/library.at:131" -{ set +x -$as_echo "$at_srcdir/library.at:132: ovstest test-unix-socket x" -at_fn_check_prepare_trace "library.at:132" -( $at_check_trace; ovstest test-unix-socket x -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:132" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_45 -#AT_START_46 -at_fn_group_banner 46 'library.at:140' \ - "test unix socket, long pathname - C" " " 4 -at_xfail=no -( - $as_echo "46. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "library.at:141" >"$at_check_line_file" -(test "$IS_WIN32" = "yes") \ - && at_fn_check_skip 77 "$at_srcdir/library.at:141" -longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -mkdir $longname -cd $longname -{ set +x -$as_echo "$at_srcdir/library.at:146: ovstest test-unix-socket ../\$longname/socket socket" -at_fn_check_prepare_dynamic "ovstest test-unix-socket ../$longname/socket socket" "library.at:146" -( $at_check_trace; ovstest test-unix-socket ../$longname/socket socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_46 -#AT_START_47 -at_fn_group_banner 47 'library.at:149' \ - "test unix socket, short pathname - Python" " " 4 -at_xfail=no -( - $as_echo "47. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "library.at:150" >"$at_check_line_file" -(test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes") \ - && at_fn_check_skip 77 "$at_srcdir/library.at:150" -{ set +x -$as_echo "$at_srcdir/library.at:151: \$PYTHON \$srcdir/test-unix-socket.py x" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-unix-socket.py x" "library.at:151" -( $at_check_trace; $PYTHON $srcdir/test-unix-socket.py x -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:151" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_47 -#AT_START_48 -at_fn_group_banner 48 'library.at:159' \ - "test unix socket, long pathname - Python" " " 4 -at_xfail=no -( - $as_echo "48. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "library.at:160" >"$at_check_line_file" -(test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes") \ - && at_fn_check_skip 77 "$at_srcdir/library.at:160" -longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -mkdir $longname -cd $longname -{ set +x -$as_echo "$at_srcdir/library.at:165: \$PYTHON \$abs_srcdir/test-unix-socket.py ../\$longname/socket socket" -at_fn_check_prepare_dynamic "$PYTHON $abs_srcdir/test-unix-socket.py ../$longname/socket socket" "library.at:165" -( $at_check_trace; $PYTHON $abs_srcdir/test-unix-socket.py ../$longname/socket socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_48 -#AT_START_49 -at_fn_group_banner 49 'library.at:168' \ - "ovs_assert" " " 4 -at_xfail=no -( - $as_echo "49. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -{ set +x -$as_echo "$at_srcdir/library.at:170: ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert || kill -l \$?" -at_fn_check_prepare_notrace 'a shell pipeline' "library.at:170" -( $at_check_trace; ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert || kill -l $? -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "ABRT -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:170" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/library.at:174: sed 's/\\(opened log file\\) .*/\\1/ -s/|[^|]*: /|/' test-util.log" -at_fn_check_prepare_notrace 'an embedded newline' "library.at:174" -( $at_check_trace; sed 's/\(opened log file\) .*/\1/ -s/|[^|]*: /|/' test-util.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "vlog|INFO|opened log file -util|EMER|assertion false failed in test_assert() -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:174" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/library.at:180: sed 's/.*: // -1q' stderr" -at_fn_check_prepare_notrace 'an embedded newline' "library.at:180" -( $at_check_trace; sed 's/.*: // -1q' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "assertion false failed in test_assert() -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:180" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_49 -#AT_START_50 -at_fn_group_banner 50 'library.at:187' \ - "snprintf" " " 4 -at_xfail=no -( - $as_echo "50. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/library.at:188: ovstest test-util snprintf" -at_fn_check_prepare_trace "library.at:188" -( $at_check_trace; ovstest test-util snprintf -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/library.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_50 -#AT_START_51 -at_fn_group_banner 51 'heap.at:8' \ - "heap library -- insert delete same order" " " 5 -at_xfail=no -( - $as_echo "51. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/heap.at:8: ovstest test-heap insert-delete-same-order" -at_fn_check_prepare_trace "heap.at:8" -( $at_check_trace; ovstest test-heap insert-delete-same-order -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/heap.at:8" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_51 -#AT_START_52 -at_fn_group_banner 52 'heap.at:9' \ - "heap library -- insert delete reverse order" " " 5 -at_xfail=no -( - $as_echo "52. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/heap.at:9: ovstest test-heap insert-delete-reverse-order" -at_fn_check_prepare_trace "heap.at:9" -( $at_check_trace; ovstest test-heap insert-delete-reverse-order -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/heap.at:9" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_52 -#AT_START_53 -at_fn_group_banner 53 'heap.at:10' \ - "heap library -- insert delete every order" " " 5 -at_xfail=no -( - $as_echo "53. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/heap.at:10: ovstest test-heap insert-delete-every-order" -at_fn_check_prepare_trace "heap.at:10" -( $at_check_trace; ovstest test-heap insert-delete-every-order -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/heap.at:10" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_53 -#AT_START_54 -at_fn_group_banner 54 'heap.at:11' \ - "heap library -- insert delete same order with dups" "" 5 -at_xfail=no -( - $as_echo "54. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/heap.at:11: ovstest test-heap insert-delete-same-order-with-dups" -at_fn_check_prepare_trace "heap.at:11" -( $at_check_trace; ovstest test-heap insert-delete-same-order-with-dups -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/heap.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_54 -#AT_START_55 -at_fn_group_banner 55 'heap.at:12' \ - "heap library -- raw insert" " " 5 -at_xfail=no -( - $as_echo "55. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/heap.at:12: ovstest test-heap raw-insert" -at_fn_check_prepare_trace "heap.at:12" -( $at_check_trace; ovstest test-heap raw-insert -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/heap.at:12" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_55 -#AT_START_56 -at_fn_group_banner 56 'heap.at:13' \ - "heap library -- raw delete" " " 5 -at_xfail=no -( - $as_echo "56. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/heap.at:13: ovstest test-heap raw-delete" -at_fn_check_prepare_trace "heap.at:13" -( $at_check_trace; ovstest test-heap raw-delete -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/heap.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_56 -#AT_START_57 -at_fn_group_banner 57 'bundle.at:10' \ - "hrw bundle link selection" " " 6 -at_xfail=no -( - $as_echo "57. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:11: ovstest test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:1,2,3,4,5'" -at_fn_check_prepare_trace "bundle.at:11" -( $at_check_trace; ovstest test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:1,2,3,4,5' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bundle.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - -# 100000: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -# 110000: disruption=0.50 (perfect=0.50) 0.50 0.50 0.00 0.00 0.00 0.00 -# 010000: disruption=0.50 (perfect=0.50) 0.00 1.00 0.00 0.00 0.00 0.00 -# 011000: disruption=0.50 (perfect=0.50) 0.00 0.50 0.50 0.00 0.00 0.00 -# 111000: disruption=0.33 (perfect=0.33) 0.33 0.33 0.34 0.00 0.00 0.00 -# 101000: disruption=0.33 (perfect=0.33) 0.50 0.00 0.50 0.00 0.00 0.00 -# 001000: disruption=0.50 (perfect=0.50) 0.00 0.00 1.00 0.00 0.00 0.00 -# 001100: disruption=0.50 (perfect=0.50) 0.00 0.00 0.50 0.50 0.00 0.00 -# 101100: disruption=0.33 (perfect=0.33) 0.33 0.00 0.34 0.33 0.00 0.00 -# 111100: disruption=0.25 (perfect=0.25) 0.25 0.25 0.25 0.25 0.00 0.00 -# 011100: disruption=0.25 (perfect=0.25) 0.00 0.33 0.33 0.33 0.00 0.00 -# 010100: disruption=0.33 (perfect=0.33) 0.00 0.50 0.00 0.50 0.00 0.00 -# 110100: disruption=0.33 (perfect=0.33) 0.33 0.33 0.00 0.34 0.00 0.00 -# 100100: disruption=0.33 (perfect=0.33) 0.50 0.00 0.00 0.50 0.00 0.00 -# 000100: disruption=0.50 (perfect=0.50) 0.00 0.00 0.00 1.00 0.00 0.00 -# 000110: disruption=0.50 (perfect=0.50) 0.00 0.00 0.00 0.50 0.50 0.00 -# 100110: disruption=0.33 (perfect=0.33) 0.33 0.00 0.00 0.33 0.33 0.00 -# 110110: disruption=0.25 (perfect=0.25) 0.25 0.25 0.00 0.25 0.25 0.00 -# 010110: disruption=0.25 (perfect=0.25) 0.00 0.34 0.00 0.33 0.33 0.00 -# 011110: disruption=0.25 (perfect=0.25) 0.00 0.25 0.25 0.25 0.25 0.00 -# 111110: disruption=0.20 (perfect=0.20) 0.20 0.20 0.20 0.20 0.20 0.00 -# 101110: disruption=0.20 (perfect=0.20) 0.25 0.00 0.25 0.25 0.25 0.00 -# 001110: disruption=0.25 (perfect=0.25) 0.00 0.00 0.34 0.33 0.33 0.00 -# 001010: disruption=0.33 (perfect=0.33) 0.00 0.00 0.50 0.00 0.50 0.00 -# 101010: disruption=0.33 (perfect=0.33) 0.33 0.00 0.34 0.00 0.33 0.00 -# 111010: disruption=0.25 (perfect=0.25) 0.25 0.25 0.25 0.00 0.25 0.00 -# 011010: disruption=0.25 (perfect=0.25) 0.00 0.33 0.34 0.00 0.33 0.00 -# 010010: disruption=0.34 (perfect=0.33) 0.00 0.50 0.00 0.00 0.50 0.00 -# 110010: disruption=0.33 (perfect=0.33) 0.33 0.33 0.00 0.00 0.33 0.00 -# 100010: disruption=0.33 (perfect=0.33) 0.50 0.00 0.00 0.00 0.50 0.00 -# 000010: disruption=0.50 (perfect=0.50) 0.00 0.00 0.00 0.00 1.00 0.00 -# 000011: disruption=0.50 (perfect=0.50) 0.00 0.00 0.00 0.00 0.50 0.50 -# 100011: disruption=0.33 (perfect=0.33) 0.33 0.00 0.00 0.00 0.33 0.33 -# 110011: disruption=0.25 (perfect=0.25) 0.25 0.25 0.00 0.00 0.25 0.25 -# 010011: disruption=0.25 (perfect=0.25) 0.00 0.33 0.00 0.00 0.33 0.33 -# 011011: disruption=0.25 (perfect=0.25) 0.00 0.25 0.25 0.00 0.25 0.25 -# 111011: disruption=0.20 (perfect=0.20) 0.20 0.20 0.20 0.00 0.20 0.20 -# 101011: disruption=0.20 (perfect=0.20) 0.25 0.00 0.25 0.00 0.25 0.25 -# 001011: disruption=0.25 (perfect=0.25) 0.00 0.00 0.34 0.00 0.33 0.33 -# 001111: disruption=0.25 (perfect=0.25) 0.00 0.00 0.25 0.25 0.25 0.25 -# 101111: disruption=0.20 (perfect=0.20) 0.20 0.00 0.20 0.20 0.20 0.20 -# 111111: disruption=0.17 (perfect=0.17) 0.17 0.17 0.17 0.17 0.17 0.17 -# 011111: disruption=0.17 (perfect=0.17) 0.00 0.20 0.20 0.20 0.20 0.20 -# 010111: disruption=0.20 (perfect=0.20) 0.00 0.25 0.00 0.25 0.25 0.25 -# 110111: disruption=0.20 (perfect=0.20) 0.20 0.20 0.00 0.20 0.20 0.20 -# 100111: disruption=0.20 (perfect=0.20) 0.25 0.00 0.00 0.25 0.25 0.25 -# 000111: disruption=0.25 (perfect=0.25) 0.00 0.00 0.00 0.33 0.33 0.33 -# 000101: disruption=0.33 (perfect=0.33) 0.00 0.00 0.00 0.50 0.00 0.50 -# 100101: disruption=0.33 (perfect=0.33) 0.33 0.00 0.00 0.33 0.00 0.33 -# 110101: disruption=0.25 (perfect=0.25) 0.25 0.25 0.00 0.25 0.00 0.25 -# 010101: disruption=0.25 (perfect=0.25) 0.00 0.33 0.00 0.33 0.00 0.33 -# 011101: disruption=0.25 (perfect=0.25) 0.00 0.25 0.25 0.25 0.00 0.25 -# 111101: disruption=0.20 (perfect=0.20) 0.20 0.20 0.20 0.20 0.00 0.20 -# 101101: disruption=0.20 (perfect=0.20) 0.25 0.00 0.25 0.25 0.00 0.25 -# 001101: disruption=0.25 (perfect=0.25) 0.00 0.00 0.33 0.33 0.00 0.33 -# 001001: disruption=0.33 (perfect=0.33) 0.00 0.00 0.50 0.00 0.00 0.50 -# 101001: disruption=0.33 (perfect=0.33) 0.33 0.00 0.33 0.00 0.00 0.33 -# 111001: disruption=0.25 (perfect=0.25) 0.25 0.25 0.25 0.00 0.00 0.25 -# 011001: disruption=0.25 (perfect=0.25) 0.00 0.33 0.34 0.00 0.00 0.33 -# 010001: disruption=0.34 (perfect=0.33) 0.00 0.50 0.00 0.00 0.00 0.50 -# 110001: disruption=0.33 (perfect=0.33) 0.33 0.33 0.00 0.00 0.00 0.34 -# 100001: disruption=0.33 (perfect=0.33) 0.50 0.00 0.00 0.00 0.00 0.50 -# 000001: disruption=0.50 (perfect=0.50) 0.00 0.00 0.00 0.00 0.00 1.00 -# 000000: disruption=1.00 (perfect=1.00) 0.00 0.00 0.00 0.00 0.00 0.00 -# 100000: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_57 -#AT_START_58 -at_fn_group_banner 58 'bundle.at:80' \ - "active_backup bundle link selection" " " 6 -at_xfail=no -( - $as_echo "58. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:81: ovstest test-bundle 'symmetric_l4,60,active_backup,ofport,NXM_NX_REG0[],slaves:1,2,3,4,5,6'" -at_fn_check_prepare_trace "bundle.at:81" -( $at_check_trace; ovstest test-bundle 'symmetric_l4,60,active_backup,ofport,NXM_NX_REG0[],slaves:1,2,3,4,5,6' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "100000: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -110000: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -010000: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -011000: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -111000: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -101000: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -001000: disruption=1.00 (perfect=1.00) 0.00 0.00 1.00 0.00 0.00 0.00 -001100: disruption=0.00 (perfect=0.00) 0.00 0.00 1.00 0.00 0.00 0.00 -101100: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -111100: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -011100: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -010100: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -110100: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -100100: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -000100: disruption=1.00 (perfect=1.00) 0.00 0.00 0.00 1.00 0.00 0.00 -000110: disruption=0.00 (perfect=0.00) 0.00 0.00 0.00 1.00 0.00 0.00 -100110: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -110110: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -010110: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -011110: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -111110: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -101110: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -001110: disruption=1.00 (perfect=1.00) 0.00 0.00 1.00 0.00 0.00 0.00 -001010: disruption=0.00 (perfect=0.00) 0.00 0.00 1.00 0.00 0.00 0.00 -101010: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -111010: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -011010: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -010010: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -110010: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -100010: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -000010: disruption=1.00 (perfect=1.00) 0.00 0.00 0.00 0.00 1.00 0.00 -000011: disruption=0.00 (perfect=0.00) 0.00 0.00 0.00 0.00 1.00 0.00 -100011: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -110011: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -010011: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -011011: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -111011: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -101011: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -001011: disruption=1.00 (perfect=1.00) 0.00 0.00 1.00 0.00 0.00 0.00 -001111: disruption=0.00 (perfect=0.00) 0.00 0.00 1.00 0.00 0.00 0.00 -101111: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -111111: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -011111: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -010111: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -110111: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -100111: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -000111: disruption=1.00 (perfect=1.00) 0.00 0.00 0.00 1.00 0.00 0.00 -000101: disruption=0.00 (perfect=0.00) 0.00 0.00 0.00 1.00 0.00 0.00 -100101: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -110101: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -010101: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -011101: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -111101: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -101101: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -001101: disruption=1.00 (perfect=1.00) 0.00 0.00 1.00 0.00 0.00 0.00 -001001: disruption=0.00 (perfect=0.00) 0.00 0.00 1.00 0.00 0.00 0.00 -101001: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -111001: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -011001: disruption=1.00 (perfect=1.00) 0.00 1.00 0.00 0.00 0.00 0.00 -010001: disruption=0.00 (perfect=0.00) 0.00 1.00 0.00 0.00 0.00 0.00 -110001: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -100001: disruption=0.00 (perfect=0.00) 1.00 0.00 0.00 0.00 0.00 0.00 -000001: disruption=1.00 (perfect=1.00) 0.00 0.00 0.00 0.00 0.00 1.00 -000000: disruption=1.00 (perfect=1.00) 0.00 0.00 0.00 0.00 0.00 0.00 -100000: disruption=1.00 (perfect=1.00) 1.00 0.00 0.00 0.00 0.00 0.00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/bundle.at:81" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_58 -#AT_START_59 -at_fn_group_banner 59 'bundle.at:151' \ - "hrw bundle single link selection" " " 6 -at_xfail=no -( - $as_echo "59. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:152: ovstest test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:1'" -at_fn_check_prepare_trace "bundle.at:152" -( $at_check_trace; ovstest test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bundle.at:152" -$at_failed && at_fn_log_failure -$at_traceon; } - -# 1: disruption=1.00 (perfect=1.00) 1.00 -# 0: disruption=1.00 (perfect=1.00) 0.00 -# 1: disruption=1.00 (perfect=1.00) 1.00 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_59 -#AT_START_60 -at_fn_group_banner 60 'bundle.at:159' \ - "hrw bundle no link selection" " " 6 -at_xfail=no -( - $as_echo "60. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:160: ovstest test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:'" -at_fn_check_prepare_trace "bundle.at:160" -( $at_check_trace; ovstest test-bundle 'symmetric_l4,60,hrw,ofport,NXM_NX_REG0[],slaves:' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/bundle.at:160" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_60 -#AT_START_61 -at_fn_group_banner 61 'bundle.at:166' \ - "bundle action missing argument" " " 6 -at_xfail=no -( - $as_echo "61. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:167: ovs-ofctl parse-flow actions=bundle" -at_fn_check_prepare_trace "bundle.at:167" -( $at_check_trace; ovs-ofctl parse-flow actions=bundle -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: : not enough arguments to bundle action -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/bundle.at:167" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_61 -#AT_START_62 -at_fn_group_banner 62 'bundle.at:172' \ - "bundle action bad fields" " " 6 -at_xfail=no -( - $as_echo "62. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:173: ovs-ofctl parse-flow 'actions=bundle(xyzzy,60,hrw,ofport,slaves:1,2))'" -at_fn_check_prepare_trace "bundle.at:173" -( $at_check_trace; ovs-ofctl parse-flow 'actions=bundle(xyzzy,60,hrw,ofport,slaves:1,2))' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: xyzzy,60,hrw,ofport,slaves:1,2: unknown fields \`xyzzy' -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/bundle.at:173" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_62 -#AT_START_63 -at_fn_group_banner 63 'bundle.at:178' \ - "bundle action bad algorithm" " " 6 -at_xfail=no -( - $as_echo "63. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:179: ovs-ofctl parse-flow 'actions=bundle(symmetric_l4,60,fubar,ofport,slaves:1,2))'" -at_fn_check_prepare_trace "bundle.at:179" -( $at_check_trace; ovs-ofctl parse-flow 'actions=bundle(symmetric_l4,60,fubar,ofport,slaves:1,2))' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: symmetric_l4,60,fubar,ofport,slaves:1,2: unknown algorithm \`fubar' -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/bundle.at:179" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_63 -#AT_START_64 -at_fn_group_banner 64 'bundle.at:184' \ - "bundle action bad slave type" " " 6 -at_xfail=no -( - $as_echo "64. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:185: ovs-ofctl parse-flow 'actions=bundle(symmetric_l4,60,hrw,robot,slaves:1,2))'" -at_fn_check_prepare_trace "bundle.at:185" -( $at_check_trace; ovs-ofctl parse-flow 'actions=bundle(symmetric_l4,60,hrw,robot,slaves:1,2))' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: symmetric_l4,60,hrw,robot,slaves:1,2: unknown slave_type \`robot' -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/bundle.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_64 -#AT_START_65 -at_fn_group_banner 65 'bundle.at:190' \ - "bundle action bad slave delimiter" " " 6 -at_xfail=no -( - $as_echo "65. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/bundle.at:191: ovs-ofctl parse-flow 'actions=bundle(symmetric_l4,60,hrw,ofport,robot:1,2))'" -at_fn_check_prepare_trace "bundle.at:191" -( $at_check_trace; ovs-ofctl parse-flow 'actions=bundle(symmetric_l4,60,hrw,ofport,robot:1,2))' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: symmetric_l4,60,hrw,ofport,robot:1,2: missing slave delimiter, expected \`slaves' got \`robot' -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/bundle.at:191" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_65 -#AT_START_66 -at_fn_group_banner 66 'classifier.at:2' \ - "flow classifier - empty" " " 7 -at_xfail=no -( - $as_echo "66. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier empty" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier empty -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_66 -#AT_START_67 -at_fn_group_banner 67 'classifier.at:2' \ - "flow classifier - destroy null" " " 7 -at_xfail=no -( - $as_echo "67. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier destroy-null" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier destroy-null -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_67 -#AT_START_68 -at_fn_group_banner 68 'classifier.at:2' \ - "flow classifier - single rule" " " 7 -at_xfail=no -( - $as_echo "68. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier single-rule" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier single-rule -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_68 -#AT_START_69 -at_fn_group_banner 69 'classifier.at:2' \ - "flow classifier - rule replacement" " " 7 -at_xfail=no -( - $as_echo "69. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier rule-replacement" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier rule-replacement -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_69 -#AT_START_70 -at_fn_group_banner 70 'classifier.at:2' \ - "flow classifier - many rules in one list" " " 7 -at_xfail=no -( - $as_echo "70. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier many-rules-in-one-list" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier many-rules-in-one-list -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_70 -#AT_START_71 -at_fn_group_banner 71 'classifier.at:2' \ - "flow classifier - many rules in one table" " " 7 -at_xfail=no -( - $as_echo "71. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier many-rules-in-one-table" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier many-rules-in-one-table -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_71 -#AT_START_72 -at_fn_group_banner 72 'classifier.at:2' \ - "flow classifier - many rules in two tables" " " 7 -at_xfail=no -( - $as_echo "72. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier many-rules-in-two-tables" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier many-rules-in-two-tables -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_72 -#AT_START_73 -at_fn_group_banner 73 'classifier.at:2' \ - "flow classifier - many rules in five tables" " " 7 -at_xfail=no -( - $as_echo "73. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:2: ovstest test-classifier many-rules-in-five-tables" -at_fn_check_prepare_trace "classifier.at:2" -( $at_check_trace; ovstest test-classifier many-rules-in-five-tables -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:2" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_73 -#AT_START_74 -at_fn_group_banner 74 'classifier.at:17' \ - "miniflow - miniflow" " " 8 -at_xfail=no -( - $as_echo "74. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:17: ovstest test-classifier miniflow" -at_fn_check_prepare_trace "classifier.at:17" -( $at_check_trace; ovstest test-classifier miniflow -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:17" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_74 -#AT_START_75 -at_fn_group_banner 75 'classifier.at:17' \ - "miniflow - minimask_has_extra" " " 8 -at_xfail=no -( - $as_echo "75. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:17: ovstest test-classifier minimask_has_extra" -at_fn_check_prepare_trace "classifier.at:17" -( $at_check_trace; ovstest test-classifier minimask_has_extra -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:17" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_75 -#AT_START_76 -at_fn_group_banner 76 'classifier.at:17' \ - "miniflow - minimask_combine" " " 8 -at_xfail=no -( - $as_echo "76. $at_setup_line: testing $at_desc ..." - $at_traceon - - { set +x -$as_echo "$at_srcdir/classifier.at:17: ovstest test-classifier minimask_combine" -at_fn_check_prepare_trace "classifier.at:17" -( $at_check_trace; ovstest test-classifier minimask_combine -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:17" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_76 -#AT_START_77 -at_fn_group_banner 77 'classifier.at:27' \ - "flow classifier - lookup segmentation" " " 9 -at_xfail=no -( - $as_echo "77. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/classifier.at:28: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "classifier.at:28" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:28" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:28: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "classifier.at:28" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:28" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/classifier.at:28: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "classifier.at:28" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:28" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/classifier.at:28: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "classifier.at:28" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:28: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "classifier.at:28" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:28: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "classifier.at:28" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:28: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "classifier.at:28" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 priority=16,tcp,nw_dst=10.1.0.0/255.255.0.0,action=output(3) -table=0 in_port=1 priority=32,tcp,nw_dst=10.1.2.15,action=output(2) -table=0 in_port=1 priority=33,tcp,nw_dst=10.1.2.15,tp_dst=80,action=drop -table=0 in_port=1 priority=0,ip,action=drop -table=0 in_port=2 priority=16,tcp,nw_dst=192.168.0.0/255.255.0.0,action=output(1) -table=0 in_port=2 priority=0,ip,action=drop -table=0 in_port=3 priority=16,tcp,nw_src=10.1.0.0/255.255.0.0,action=output(1) -table=0 in_port=3 priority=0,ip,action=drop -_ATEOF - -{ set +x -$as_echo "$at_srcdir/classifier.at:40: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "classifier.at:40" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:40" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:41: ovs-appctl ofproto/trace br0 'in_port=2,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'" -at_fn_check_prepare_trace "classifier.at:41" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=2,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:41" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:42: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:42" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=2,nw_dst=192.168.0.0/16,nw_frag=no -Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:42" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:46: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'" -at_fn_check_prepare_trace "classifier.at:46" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:46" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:47: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:47" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=192.168.0.2,nw_frag=no -Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:47" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:51: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'" -at_fn_check_prepare_trace "classifier.at:51" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:51" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:52: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:52" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=80 -Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:52" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:56: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79'" -at_fn_check_prepare_trace "classifier.at:56" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:57: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:57" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=0x40/0xfff0 -Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:57" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:61: check_logs " -at_fn_check_prepare_trace "classifier.at:61" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/classifier.at:61: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "classifier.at:61" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/classifier.at:61: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "classifier.at:61" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_77 -#AT_START_78 -at_fn_group_banner 78 'classifier.at:65' \ - "flow classifier - prefix lookup" " " 10 -at_xfail=no -( - $as_echo "78. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/classifier.at:66: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "classifier.at:66" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:66: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "classifier.at:66" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/classifier.at:66: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "classifier.at:66" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/classifier.at:66: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "classifier.at:66" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:66" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:66: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "classifier.at:66" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:66" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:66: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "classifier.at:66" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:66" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/classifier.at:66: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "classifier.at:66" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:66" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -{ set +x -$as_echo "$at_srcdir/classifier.at:68: ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0" -at_fn_check_prepare_trace "classifier.at:68" -( $at_check_trace; ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:68" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:69: ovs-vsctl set Flow_Table t0 prefixes=ipv6_label" -at_fn_check_prepare_trace "classifier.at:69" -( $at_check_trace; ovs-vsctl set Flow_Table t0 prefixes=ipv6_label -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:69" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:70: ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_src,tun_dst,tun_src" -at_fn_check_prepare_trace "classifier.at:70" -( $at_check_trace; ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_src,tun_dst,tun_src -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: nw_dst,nw_src,tun_dst,tun_src: 4 value(s) specified but the maximum number is 3 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/classifier.at:70" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:73: ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_dst" -at_fn_check_prepare_trace "classifier.at:73" -( $at_check_trace; ovs-vsctl set Flow_Table t0 prefixes=nw_dst,nw_dst -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: nw_dst,nw_dst: set contains duplicate value -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/classifier.at:73" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:76: ovs-vsctl set Flow_Table t0 prefixes=nw_dst" -at_fn_check_prepare_trace "classifier.at:76" -( $at_check_trace; ovs-vsctl set Flow_Table t0 prefixes=nw_dst -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:76" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 priority=16,tcp,nw_dst=10.1.0.0/255.255.0.0,action=output(3) -table=0 in_port=1 priority=32,tcp,nw_dst=10.1.2.0/255.255.255.0,tp_src=79,action=output(2) -table=0 in_port=1 priority=33,tcp,nw_dst=10.1.2.15,tp_dst=80,action=drop -table=0 in_port=1 priority=33,tcp,nw_dst=10.1.2.15,tp_dst=8080,action=output(2) -table=0 in_port=1 priority=33,tcp,nw_dst=10.1.2.15,tp_dst=192,action=output(2) -table=0 in_port=1 priority=0,ip,action=drop -table=0 in_port=2 priority=16,tcp,nw_dst=192.168.0.0/255.255.0.0,action=output(1) -table=0 in_port=2 priority=0,ip,action=drop -table=0 in_port=3 priority=16,tcp,nw_src=10.1.0.0/255.255.0.0,action=output(1) -table=0 in_port=3 priority=0,ip,action=drop -_ATEOF - -{ set +x -$as_echo "$at_srcdir/classifier.at:89: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "classifier.at:89" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:89" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:90: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'" -at_fn_check_prepare_trace "classifier.at:90" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:91: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:91" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=192.168.0.0/16,nw_frag=no -Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:91" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:95: ovs-appctl ofproto/trace br0 'in_port=2,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'" -at_fn_check_prepare_trace "classifier.at:95" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=2,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:96: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:96" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=2,nw_dst=192.168.0.0/16,nw_frag=no -Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:96" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:100: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'" -at_fn_check_prepare_trace "classifier.at:100" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:101: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:101" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_dst=80 -Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:105: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79'" -at_fn_check_prepare_trace "classifier.at:105" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:105" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:106: tail -2 stdout" -at_fn_check_prepare_trace "classifier.at:106" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_dst=10.1.2.15,nw_frag=no,tp_src=0x0/0xffc0,tp_dst=0x40/0xfff0 -Datapath actions: 3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/classifier.at:110: check_logs \"/'prefixes' with incompatible field: ipv6_label/d\"" -at_fn_check_prepare_trace "classifier.at:110" -( $at_check_trace; check_logs "/'prefixes' with incompatible field: ipv6_label/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/classifier.at:110: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "classifier.at:110" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/classifier.at:110: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "classifier.at:110" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/classifier.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_78 -#AT_START_79 -at_fn_group_banner 79 'check-structs.at:11' \ - "check struct tail padding" " " 11 -at_xfail=no -( - $as_echo "79. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "check-structs.at:12" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/check-structs.at:12" - cat >test.h <<'_ATEOF' -struct xyz { - ovs_be16 x; -}; -_ATEOF - - { set +x -$as_echo "$at_srcdir/check-structs.at:12: \$PYTHON \$top_srcdir/build-aux/check-structs test.h" -at_fn_check_prepare_dynamic "$PYTHON $top_srcdir/build-aux/check-structs test.h" "check-structs.at:12" -( $at_check_trace; $PYTHON $top_srcdir/build-aux/check-structs test.h -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test.h:3: warning: struct xyz needs 2 bytes of tail padding -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/check-structs.at:12" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_79 -#AT_START_80 -at_fn_group_banner 80 'check-structs.at:21' \ - "check struct internal alignment" " " 11 -at_xfail=no -( - $as_echo "80. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "check-structs.at:22" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/check-structs.at:22" - cat >test.h <<'_ATEOF' -struct xyzzy { - ovs_be16 x; - ovs_be32 y; -}; -_ATEOF - - { set +x -$as_echo "$at_srcdir/check-structs.at:22: \$PYTHON \$top_srcdir/build-aux/check-structs test.h" -at_fn_check_prepare_dynamic "$PYTHON $top_srcdir/build-aux/check-structs test.h" "check-structs.at:22" -( $at_check_trace; $PYTHON $top_srcdir/build-aux/check-structs test.h -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test.h:3: warning: struct xyzzy member y is 2 bytes short of 4-byte alignment -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/check-structs.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_80 -#AT_START_81 -at_fn_group_banner 81 'check-structs.at:32' \ - "check struct declared size" " " 11 -at_xfail=no -( - $as_echo "81. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "check-structs.at:33" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/check-structs.at:33" - cat >test.h <<'_ATEOF' -struct wibble { - ovs_be64 z; -}; -OFP_ASSERT(sizeof(struct wibble) == 12); - -_ATEOF - - { set +x -$as_echo "$at_srcdir/check-structs.at:33: \$PYTHON \$top_srcdir/build-aux/check-structs test.h" -at_fn_check_prepare_dynamic "$PYTHON $top_srcdir/build-aux/check-structs test.h" "check-structs.at:33" -( $at_check_trace; $PYTHON $top_srcdir/build-aux/check-structs test.h -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test.h:4: warning: struct wibble is 8 bytes long but declared as 12 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/check-structs.at:33" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_81 -#AT_START_82 -at_fn_group_banner 82 'check-structs.at:44' \ - "check wrong struct's declared size" " " 11 -at_xfail=no -( - $as_echo "82. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "check-structs.at:45" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/check-structs.at:45" - cat >test.h <<'_ATEOF' -struct moo { - ovs_be64 bar; -}; -OFP_ASSERT(sizeof(struct moo) == 8); -struct wibble { - ovs_be64 z; -}; -OFP_ASSERT(sizeof(struct moo) == 8); - -_ATEOF - - { set +x -$as_echo "$at_srcdir/check-structs.at:45: \$PYTHON \$top_srcdir/build-aux/check-structs test.h" -at_fn_check_prepare_dynamic "$PYTHON $top_srcdir/build-aux/check-structs test.h" "check-structs.at:45" -( $at_check_trace; $PYTHON $top_srcdir/build-aux/check-structs test.h -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test.h:8: warning: checking size of struct moo but struct wibble was most recently defined -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/check-structs.at:45" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_82 -#AT_START_83 -at_fn_group_banner 83 'daemon.at:3' \ - "daemon" " " 12 -at_xfail=no -( - $as_echo "83. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/daemon.at:4: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "daemon.at:4" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/daemon.at:4: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:4" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Start the daemon and wait for the pidfile to get created -# and that its contents are the correct pid. -{ set +x -$as_echo "$at_srcdir/daemon.at:9: ovsdb-server --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db 2>/dev/null & echo \$! > expected" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:9" -( $at_check_trace; ovsdb-server --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db 2>/dev/null & echo $! > expected -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:9" -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:10: ovs_wait_cond () { test -s pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:10" -( $at_check_trace; ovs_wait_cond () { test -s pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:10" -if $at_failed; then : - kill `cat expected` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:11: pid=\`cat pid\` && expected=\`cat expected\` && test \"\$pid\" = \"\$expected\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:11" -( $at_check_trace; pid=`cat pid` && expected=`cat expected` && test "$pid" = "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:11" -if $at_failed; then : - kill `cat expected` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:14: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:14" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:14" -if $at_failed; then : - kill `cat expected` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -# Kill the daemon and make sure that the pidfile gets deleted. -kill `cat expected` -{ set +x -$as_echo "$at_srcdir/daemon.at:17: ovs_wait_cond () { if kill -0 \`cat expected\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:17" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat expected`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:17" -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:18: test ! -e pid" -at_fn_check_prepare_trace "daemon.at:18" -( $at_check_trace; test ! -e pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:18" -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_83 -#AT_START_84 -at_fn_group_banner 84 'daemon.at:21' \ - "daemon --monitor" " " 12 -at_xfail=no -( - $as_echo "84. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/daemon.at:22: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "daemon.at:22" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/daemon.at:22: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:22" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - - -# Start the daemon and wait for the pidfile to get created. -{ set +x -$as_echo "$at_srcdir/daemon.at:28: ovsdb-server --monitor --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db 2>/dev/null & echo \$! > parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:28" -( $at_check_trace; ovsdb-server --monitor --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db 2>/dev/null & echo $! > parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:28" -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:29: ovs_wait_cond () { test -s pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:29" -( $at_check_trace; ovs_wait_cond () { test -s pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:29" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon.at:32: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:32" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:32" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:33: ps -o ppid= -p \`cat pid\` > parentpid" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:33" -( $at_check_trace; ps -o ppid= -p `cat pid` > parentpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:33" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:35: parentpid=\`cat parentpid\` && - parent=\`cat parent\` && - test \$parentpid = \$parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:35" -( $at_check_trace; parentpid=`cat parentpid` && - parent=`cat parent` && - test $parentpid = $parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:35" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Avoid a race between pidfile creation and notifying the parent, -# which can easily trigger if ovsdb-server is slow (e.g. due to valgrind). -{ set +x -$as_echo "$at_srcdir/daemon.at:42: ovs_wait_cond () { ovs-appctl --timeout=10 -t \"\`pwd\`/unixctl\" version -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:42" -( $at_check_trace; ovs_wait_cond () { ovs-appctl --timeout=10 -t "`pwd`/unixctl" version -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:42" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Kill the daemon process, making it look like a segfault, -# and wait for a new child process to get spawned. -{ set +x -$as_echo "$at_srcdir/daemon.at:47: cp pid oldpid" -at_fn_check_prepare_trace "daemon.at:47" -( $at_check_trace; cp pid oldpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:47" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:48: kill -SEGV \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:48" -( $at_check_trace; kill -SEGV `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:48" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:49: ovs_wait_cond () { if kill -0 \`cat oldpid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:49" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat oldpid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:49" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:50: ovs_wait_cond () { test -s pid && test \`cat pid\` != \`cat oldpid\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:50" -( $at_check_trace; ovs_wait_cond () { test -s pid && test `cat pid` != `cat oldpid` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:50" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:52: cp pid newpid" -at_fn_check_prepare_trace "daemon.at:52" -( $at_check_trace; cp pid newpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:52" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon.at:55: ps -o ppid= -p \`cat pid\` > parentpid" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:55" -( $at_check_trace; ps -o ppid= -p `cat pid` > parentpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:55" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:57: parentpid=\`cat parentpid\` && - parent=\`cat parent\` && - test \$parentpid = \$parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:57" -( $at_check_trace; parentpid=`cat parentpid` && - parent=`cat parent` && - test $parentpid = $parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:57" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Kill the daemon process with SIGTERM, and wait for the daemon -# and the monitor processes to go away and the pidfile to get deleted. -{ set +x -$as_echo "$at_srcdir/daemon.at:64: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:64" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:64" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:65: ovs_wait_cond () { if kill -0 \`cat parent\` || kill -0 \`cat newpid\` || test -e pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:65" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat parent` || kill -0 `cat newpid` || test -e pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:65" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_84 -#AT_START_85 -at_fn_group_banner 85 'daemon.at:69' \ - "daemon --detach" " " 12 -at_xfail=no -( - $as_echo "85. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/daemon.at:71: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "daemon.at:71" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:71" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/daemon.at:71: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:71" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:71" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -# Start the daemon and make sure that the pidfile exists immediately. -# We don't wait for the pidfile to get created because the daemon is -# supposed to do so before the parent exits. -{ set +x -$as_echo "$at_srcdir/daemon.at:75: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:75" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:75" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:76: test -s pid" -at_fn_check_prepare_trace "daemon.at:76" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:76" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:77: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:77" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:77" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -# Kill the daemon and make sure that the pidfile gets deleted. -cp pid saved-pid -kill `cat pid` -{ set +x -$as_echo "$at_srcdir/daemon.at:81: ovs_wait_cond () { if kill -0 \`cat saved-pid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:81" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat saved-pid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:81" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:82: test ! -e pid" -at_fn_check_prepare_trace "daemon.at:82" -( $at_check_trace; test ! -e pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:82" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_85 -#AT_START_86 -at_fn_group_banner 86 'daemon.at:85' \ - "daemon --detach --monitor" " " 12 -at_xfail=no -( - $as_echo "86. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/daemon.at:88: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "daemon.at:88" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:88" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/daemon.at:88: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:88" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:88" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - - - - -# Start the daemon and make sure that the pidfile exists immediately. -# We don't wait for the pidfile to get created because the daemon is -# supposed to do so before the parent exits. -{ set +x -$as_echo "$at_srcdir/daemon.at:98: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/daemon --monitor --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:98" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/daemon --monitor --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:98" -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:99: test -s daemon" -at_fn_check_prepare_trace "daemon.at:99" -( $at_check_trace; test -s daemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:99" -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is a running process, -# and that the parent process of that process is init. -{ set +x -$as_echo "$at_srcdir/daemon.at:103: kill -0 \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:103" -( $at_check_trace; kill -0 `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:103" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:104: ps -o ppid= -p \`cat daemon\` > monitor" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:104" -( $at_check_trace; ps -o ppid= -p `cat daemon` > monitor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:104" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:105: kill -0 \`cat monitor\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:105" -( $at_check_trace; kill -0 `cat monitor` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:105" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:106: ps -o ppid= -p \`cat monitor\` > init" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:106" -( $at_check_trace; ps -o ppid= -p `cat monitor` > init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:106" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:107: test \`cat init\` != \$\$" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:107" -( $at_check_trace; test `cat init` != $$ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:107" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Kill the daemon process, making it look like a segfault, -# and wait for a new daemon process to get spawned. -{ set +x -$as_echo "$at_srcdir/daemon.at:110: cp daemon olddaemon" -at_fn_check_prepare_trace "daemon.at:110" -( $at_check_trace; cp daemon olddaemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:110" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:111: kill -SEGV \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:111" -( $at_check_trace; kill -SEGV `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:111" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:112: ovs_wait_cond () { if kill -0 \`cat olddaemon\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:112" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat olddaemon`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:112" -if $at_failed; then : - kill `cat olddaemon daemon` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:113: ovs_wait_cond () { test -s daemon && test \`cat daemon\` != \`cat olddaemon\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:113" -( $at_check_trace; ovs_wait_cond () { test -s daemon && test `cat daemon` != `cat olddaemon` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:113" -if $at_failed; then : - kill `cat olddaemon daemon` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:115: cp daemon newdaemon" -at_fn_check_prepare_trace "daemon.at:115" -( $at_check_trace; cp daemon newdaemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:115" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon.at:118: kill -0 \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:118" -( $at_check_trace; kill -0 `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:118" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:119: diff olddaemon newdaemon" -at_fn_check_prepare_trace "daemon.at:119" -( $at_check_trace; diff olddaemon newdaemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/daemon.at:119" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:120: ps -o ppid= -p \`cat daemon\` > newmonitor" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:120" -( $at_check_trace; ps -o ppid= -p `cat daemon` > newmonitor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:120" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:121: diff monitor newmonitor" -at_fn_check_prepare_trace "daemon.at:121" -( $at_check_trace; diff monitor newmonitor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:121" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:122: kill -0 \`cat newmonitor\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:122" -( $at_check_trace; kill -0 `cat newmonitor` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:122" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:123: ps -o ppid= -p \`cat newmonitor\` > init" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:123" -( $at_check_trace; ps -o ppid= -p `cat newmonitor` > init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:123" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:124: test \`cat init\` != \$\$" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:124" -( $at_check_trace; test `cat init` != $$ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:124" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Kill the daemon process with SIGTERM, and wait for the daemon -# and the monitor processes to go away and the pidfile to get deleted. -{ set +x -$as_echo "$at_srcdir/daemon.at:127: kill \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:127" -( $at_check_trace; kill `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:127" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:128: ovs_wait_cond () { if kill -0 \`cat monitor\` || kill -0 \`cat newdaemon\` || test -e daemon; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:128" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat monitor` || kill -0 `cat newdaemon` || test -e daemon; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:128" -if $at_failed; then : - kill `cat monitor newdaemon` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_86 -#AT_START_87 -at_fn_group_banner 87 'daemon.at:134' \ - "daemon --detach startup errors" " " 12 -at_xfail=no -( - $as_echo "87. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/daemon.at:136: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "daemon.at:136" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:136" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/daemon.at:136: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:136" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:136" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:137: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --unixctl=\"\`pwd\`\"/nonexistent/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:137" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --unixctl="`pwd`"/nonexistent/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/daemon.at:137" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:138: grep 'ovsdb-server: could not initialize control socket' stderr" -at_fn_check_prepare_trace "daemon.at:138" -( $at_check_trace; grep 'ovsdb-server: could not initialize control socket' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:138" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:140: test ! -s pid" -at_fn_check_prepare_trace "daemon.at:140" -( $at_check_trace; test ! -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:140" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_87 -#AT_START_88 -at_fn_group_banner 88 'daemon.at:143' \ - "daemon --detach --monitor startup errors" " " 12 -at_xfail=no -( - $as_echo "88. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/daemon.at:145: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "daemon.at:145" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:145" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/daemon.at:145: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "daemon.at:145" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:145" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:146: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --monitor --unixctl=\"\`pwd\`\"/nonexistent/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon.at:146" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --monitor --unixctl="`pwd`"/nonexistent/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/daemon.at:146" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:147: grep 'ovsdb-server: could not initialize control socket' stderr" -at_fn_check_prepare_trace "daemon.at:147" -( $at_check_trace; grep 'ovsdb-server: could not initialize control socket' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:147" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon.at:149: test ! -s pid" -at_fn_check_prepare_trace "daemon.at:149" -( $at_check_trace; test ! -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon.at:149" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_88 -#AT_START_89 -at_fn_group_banner 89 'daemon-py.at:3' \ - "daemon - Python" " " 13 -at_xfail=no -( - $as_echo "89. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:4" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:4" - - -# Start the daemon and wait for the pidfile to get created -# and that its contents are the correct pid. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:9: \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid& echo \$! > expected" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:9" -( $at_check_trace; $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid& echo $! > expected -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:9" -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:10: ovs_wait_cond () { test -s pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "daemon-py.at:10" -( $at_check_trace; ovs_wait_cond () { test -s pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:10" -if $at_failed; then : - kill `cat expected` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:11: pid=\`cat pid\` && expected=\`cat expected\` && test \"\$pid\" = \"\$expected\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:11" -( $at_check_trace; pid=`cat pid` && expected=`cat expected` && test "$pid" = "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:11" -if $at_failed; then : - kill `cat expected` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:14: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:14" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:14" -if $at_failed; then : - kill `cat expected` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -# Kill the daemon and make sure that the pidfile gets deleted. -kill `cat expected` -{ set +x -$as_echo "$at_srcdir/daemon-py.at:17: ovs_wait_cond () { if kill -0 \`cat expected\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:17" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat expected`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:17" -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:18: test ! -e pid" -at_fn_check_prepare_trace "daemon-py.at:18" -( $at_check_trace; test ! -e pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:18" -$at_failed && at_fn_log_failure \ -"pid" \ -"expected" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_89 -#AT_START_90 -at_fn_group_banner 90 'daemon-py.at:21' \ - "daemon --monitor - Python" " " 13 -at_xfail=no -( - $as_echo "90. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:22" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:22" - - - - -# Start the daemon and wait for the pidfile to get created. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:28: \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid --monitor& echo \$! > parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:28" -( $at_check_trace; $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid --monitor& echo $! > parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:28" -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:29: ovs_wait_cond () { test -s pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "daemon-py.at:29" -( $at_check_trace; ovs_wait_cond () { test -s pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:29" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:32: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:32" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:32" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:33: ps -o ppid= -p \`cat pid\` > parentpid" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:33" -( $at_check_trace; ps -o ppid= -p `cat pid` > parentpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:33" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:35: parentpid=\`cat parentpid\` && - parent=\`cat parent\` && - test \$parentpid = \$parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:35" -( $at_check_trace; parentpid=`cat parentpid` && - parent=`cat parent` && - test $parentpid = $parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:35" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Kill the daemon process, making it look like a segfault, -# and wait for a new child process to get spawned. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:42: cp pid oldpid" -at_fn_check_prepare_trace "daemon-py.at:42" -( $at_check_trace; cp pid oldpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:42" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:43: kill -SEGV \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:43" -( $at_check_trace; kill -SEGV `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:43" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:44: ovs_wait_cond () { if kill -0 \`cat oldpid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:44" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat oldpid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:44" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:45: ovs_wait_cond () { test -s pid && test \`cat pid\` != \`cat oldpid\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:45" -( $at_check_trace; ovs_wait_cond () { test -s pid && test `cat pid` != `cat oldpid` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:45" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:47: cp pid newpid" -at_fn_check_prepare_trace "daemon-py.at:47" -( $at_check_trace; cp pid newpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:47" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:50: ps -o ppid= -p \`cat pid\` > parentpid" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:50" -( $at_check_trace; ps -o ppid= -p `cat pid` > parentpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:50" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:52: parentpid=\`cat parentpid\` && - parent=\`cat parent\` && - test \$parentpid = \$parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:52" -( $at_check_trace; parentpid=`cat parentpid` && - parent=`cat parent` && - test $parentpid = $parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:52" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Kill the daemon process with SIGTERM, and wait for the daemon -# and the monitor processes to go away and the pidfile to get deleted. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:59: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:59" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:59" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:60: ovs_wait_cond () { if kill -0 \`cat parent\` || kill -0 \`cat newpid\` || test -e pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:60" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat parent` || kill -0 `cat newpid` || test -e pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:60" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_90 -#AT_START_91 -at_fn_group_banner 91 'daemon-py.at:64' \ - "daemon --monitor restart exit code - Python" " " 13 -at_xfail=no -( - $as_echo "91. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:65" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:65" - - - - -# Start the daemon and wait for the pidfile to get created. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:71: \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid --monitor& echo \$! > parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:71" -( $at_check_trace; $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid --monitor& echo $! > parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:71" -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:72: ovs_wait_cond () { test -s pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "daemon-py.at:72" -( $at_check_trace; ovs_wait_cond () { test -s pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:72" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:75: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:75" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:75" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:76: ps -o ppid= -p \`cat pid\` > parentpid" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:76" -( $at_check_trace; ps -o ppid= -p `cat pid` > parentpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:76" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:78: parentpid=\`cat parentpid\` && - parent=\`cat parent\` && - test \$parentpid = \$parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:78" -( $at_check_trace; parentpid=`cat parentpid` && - parent=`cat parent` && - test $parentpid = $parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:78" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# HUP the daemon process causing it to throw an exception, -# and wait for a new child process to get spawned. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:85: cp pid oldpid" -at_fn_check_prepare_trace "daemon-py.at:85" -( $at_check_trace; cp pid oldpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:85" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:86: kill -HUP \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:86" -( $at_check_trace; kill -HUP `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:86" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:87: ovs_wait_cond () { if kill -0 \`cat oldpid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:87" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat oldpid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:87" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:88: ovs_wait_cond () { test -s pid && test \`cat pid\` != \`cat oldpid\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:88" -( $at_check_trace; ovs_wait_cond () { test -s pid && test `cat pid` != `cat oldpid` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:88" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:90: cp pid newpid" -at_fn_check_prepare_trace "daemon-py.at:90" -( $at_check_trace; cp pid newpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:90" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:93: ps -o ppid= -p \`cat pid\` > parentpid" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:93" -( $at_check_trace; ps -o ppid= -p `cat pid` > parentpid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:93" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:95: parentpid=\`cat parentpid\` && - parent=\`cat parent\` && - test \$parentpid = \$parent" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:95" -( $at_check_trace; parentpid=`cat parentpid` && - parent=`cat parent` && - test $parentpid = $parent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:95" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -# Kill the daemon process with SIGTERM, and wait for the daemon -# and the monitor processes to go away and the pidfile to get deleted. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:102: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:102" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:102" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:103: ovs_wait_cond () { if kill -0 \`cat parent\` || kill -0 \`cat newpid\` || test -e pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:103" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat parent` || kill -0 `cat newpid` || test -e pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:103" -if $at_failed; then : - kill `cat parent` -fi -$at_failed && at_fn_log_failure \ -"pid" \ -"parent" \ -"parentpid" \ -"newpid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_91 -#AT_START_92 -at_fn_group_banner 92 'daemon-py.at:107' \ - "daemon --detach - Python" " " 13 -at_xfail=no -( - $as_echo "92. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:108" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:108" - -# Start the daemon and make sure that the pidfile exists immediately. -# We don't wait for the pidfile to get created because the daemon is -# supposed to do so before the parent exits. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:113: \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid --detach" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:113" -( $at_check_trace; $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:113" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:114: test -s pid" -at_fn_check_prepare_trace "daemon-py.at:114" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:114" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:115: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:115" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:115" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -# Kill the daemon and make sure that the pidfile gets deleted. -cp pid saved-pid -kill `cat pid` -{ set +x -$as_echo "$at_srcdir/daemon-py.at:119: ovs_wait_cond () { if kill -0 \`cat saved-pid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:119" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat saved-pid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:119" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:120: test ! -e pid" -at_fn_check_prepare_trace "daemon-py.at:120" -( $at_check_trace; test ! -e pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:120" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_92 -#AT_START_93 -at_fn_group_banner 93 'daemon-py.at:123' \ - "daemon --detach --monitor - Python" " " 13 -at_xfail=no -( - $as_echo "93. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:124" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:124" - - - - - - - -# Start the daemon and make sure that the pidfile exists immediately. -# We don't wait for the pidfile to get created because the daemon is -# supposed to do so before the parent exits. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:136: \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/daemon --detach --monitor" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:136" -( $at_check_trace; $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/daemon --detach --monitor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:136" -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:137: test -s daemon" -at_fn_check_prepare_trace "daemon-py.at:137" -( $at_check_trace; test -s daemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:137" -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is a running process, -# and that the parent process of that process is init. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:141: kill -0 \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:141" -( $at_check_trace; kill -0 `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:141" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:142: ps -o ppid= -p \`cat daemon\` > monitor" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:142" -( $at_check_trace; ps -o ppid= -p `cat daemon` > monitor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:142" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:143: kill -0 \`cat monitor\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:143" -( $at_check_trace; kill -0 `cat monitor` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:143" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:144: ps -o ppid= -p \`cat monitor\` > init" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:144" -( $at_check_trace; ps -o ppid= -p `cat monitor` > init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:144" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:145: test \`cat init\` != \$\$" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:145" -( $at_check_trace; test `cat init` != $$ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:145" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Kill the daemon process, making it look like a segfault, -# and wait for a new daemon process to get spawned. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:148: cp daemon olddaemon" -at_fn_check_prepare_trace "daemon-py.at:148" -( $at_check_trace; cp daemon olddaemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:148" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:149: kill -SEGV \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:149" -( $at_check_trace; kill -SEGV `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:149" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:150: ovs_wait_cond () { if kill -0 \`cat olddaemon\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:150" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat olddaemon`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:150" -if $at_failed; then : - kill `cat olddaemon daemon` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:151: ovs_wait_cond () { test -s daemon && test \`cat daemon\` != \`cat olddaemon\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:151" -( $at_check_trace; ovs_wait_cond () { test -s daemon && test `cat daemon` != `cat olddaemon` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:151" -if $at_failed; then : - kill `cat olddaemon daemon` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:153: cp daemon newdaemon" -at_fn_check_prepare_trace "daemon-py.at:153" -( $at_check_trace; cp daemon newdaemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:153" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Check that the pidfile names a running process, -# and that the parent process of that process is our child process. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:156: kill -0 \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:156" -( $at_check_trace; kill -0 `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:156" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:157: diff olddaemon newdaemon" -at_fn_check_prepare_trace "daemon-py.at:157" -( $at_check_trace; diff olddaemon newdaemon -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/daemon-py.at:157" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:158: ps -o ppid= -p \`cat daemon\` > newmonitor" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:158" -( $at_check_trace; ps -o ppid= -p `cat daemon` > newmonitor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:158" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:159: diff monitor newmonitor" -at_fn_check_prepare_trace "daemon-py.at:159" -( $at_check_trace; diff monitor newmonitor -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:159" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:160: kill -0 \`cat newmonitor\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:160" -( $at_check_trace; kill -0 `cat newmonitor` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:160" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:161: ps -o ppid= -p \`cat newmonitor\` > init" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:161" -( $at_check_trace; ps -o ppid= -p `cat newmonitor` > init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:161" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:162: test \`cat init\` != \$\$" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:162" -( $at_check_trace; test `cat init` != $$ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:162" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -# Kill the daemon process with SIGTERM, and wait for the daemon -# and the monitor processes to go away and the pidfile to get deleted. -{ set +x -$as_echo "$at_srcdir/daemon-py.at:165: kill \`cat daemon\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:165" -( $at_check_trace; kill `cat daemon` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:165" -if $at_failed; then : - kill `cat daemon monitor` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:166: ovs_wait_cond () { if kill -0 \`cat monitor\` || kill -0 \`cat newdaemon\` || test -e daemon; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:166" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat monitor` || kill -0 `cat newdaemon` || test -e daemon; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:166" -if $at_failed; then : - kill `cat monitor newdaemon` -fi -$at_failed && at_fn_log_failure \ -"daemon" \ -"olddaemon" \ -"newdaemon" \ -"monitor" \ -"newmonitor" \ -"init" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_93 -#AT_START_94 -at_fn_group_banner 94 'daemon-py.at:172' \ - "daemon --detach startup errors - Python" " " 13 -at_xfail=no -( - $as_echo "94. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:173" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:173" - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:175: \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid --detach --bail" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:175" -( $at_check_trace; $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid --detach --bail -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/daemon-py.at:175" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:176: grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr" -at_fn_check_prepare_trace "daemon-py.at:176" -( $at_check_trace; grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:176" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:178: test ! -s pid" -at_fn_check_prepare_trace "daemon-py.at:178" -( $at_check_trace; test ! -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:178" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_94 -#AT_START_95 -at_fn_group_banner 95 'daemon-py.at:181' \ - "daemon --detach --monitor startup errors - Python" "" 13 -at_xfail=no -( - $as_echo "95. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:182" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:182" - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:184: \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid --detach --monitor --bail" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:184" -( $at_check_trace; $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid --detach --monitor --bail -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/daemon-py.at:184" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:185: grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr" -at_fn_check_prepare_trace "daemon-py.at:185" -( $at_check_trace; grep 'test-daemon.py: exiting after daemonize_start() as requested' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:185" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:187: test ! -s pid" -at_fn_check_prepare_trace "daemon-py.at:187" -( $at_check_trace; test ! -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:187" -$at_failed && at_fn_log_failure \ -"pid" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_95 -#AT_START_96 -at_fn_group_banner 96 'daemon-py.at:190' \ - "daemon --detach closes standard fds - Python" " " 13 -at_xfail=no -( - $as_echo "96. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:191" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:191" - - - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:195: (yes 2>stderr; echo \$? > status) | \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid --detach" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:195" -( $at_check_trace; (yes 2>stderr; echo $? > status) | $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:195" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:196: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:196" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:196" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:197: test -s status" -at_fn_check_prepare_trace "daemon-py.at:197" -( $at_check_trace; test -s status -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:197" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -if grep '[bB]roken pipe' stderr >/dev/null 2>&1; then - # Something in the environment caused SIGPIPE to be ignored, but - # 'yes' at least told us that it got EPIPE. Good enough; we know - # that stdout was closed. - : -else - # Otherwise make sure that 'yes' died from SIGPIPE. - { set +x -$as_echo "$at_srcdir/daemon-py.at:205: kill -l \`cat status\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:205" -( $at_check_trace; kill -l `cat status` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "PIPE -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:205" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -fi - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_96 -#AT_START_97 -at_fn_group_banner 97 'daemon-py.at:210' \ - "daemon --detach --monitor closes standard fds" " " 13 -at_xfail=no -( - $as_echo "97. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "daemon-py.at:211" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/daemon-py.at:211" - - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/daemon-py.at:215: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "daemon-py.at:215" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:215" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/daemon-py.at:215: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "daemon-py.at:215" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:215" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:216: (yes 2>stderr; echo \$? > status) | \$PYTHON \$srcdir/test-daemon.py --pidfile=\`pwd\`/pid --detach" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:216" -( $at_check_trace; (yes 2>stderr; echo $? > status) | $PYTHON $srcdir/test-daemon.py --pidfile=`pwd`/pid --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:216" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:217: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:217" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:217" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/daemon-py.at:218: test -s status" -at_fn_check_prepare_trace "daemon-py.at:218" -( $at_check_trace; test -s status -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:218" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -if grep '[bB]roken pipe' stderr >/dev/null 2>&1; then - # Something in the environment caused SIGPIPE to be ignored, but - # 'yes' at least told us that it got EPIPE. Good enough; we know - # that stdout was closed. - : -else - # Otherwise make sure that 'yes' died from SIGPIPE. - { set +x -$as_echo "$at_srcdir/daemon-py.at:226: kill -l \`cat status\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "daemon-py.at:226" -( $at_check_trace; kill -l `cat status` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "PIPE -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/daemon-py.at:226" -$at_failed && at_fn_log_failure \ -"pid" \ -"status" \ -"stderr" -$at_traceon; } - -fi - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_97 -#AT_START_98 -at_fn_group_banner 98 'ofp-actions.at:3' \ - "OpenFlow 1.0 action translation" " " 14 -at_xfail=no -( - $as_echo "98. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-data <<'_ATEOF' -# actions=LOCAL -0000 0008 fffe 04d2 - -# actions=CONTROLLER:1234 -0000 0008 fffd 04d2 - -# actions=mod_vlan_vid:9 -0001 0008 0009 0000 - -# actions=mod_vlan_pcp:6 -0002 0008 06 000000 - -# actions=strip_vlan -0003 0008 00000000 - -# actions=mod_dl_src:00:11:22:33:44:55 -0004 0010 001122334455 000000000000 - -# actions=mod_dl_dst:10:20:30:40:50:60 -0005 0010 102030405060 000000000000 - -# actions=mod_nw_src:1.2.3.4 -0006 0008 01020304 - -# actions=mod_nw_dst:192.168.0.1 -0007 0008 c0a80001 - -# actions=mod_nw_tos:48 -0008 0008 30 000000 - -# actions=mod_tp_src:80 -0009 0008 0050 0000 - -# actions=mod_tp_dst:443 -000a 0008 01bb 0000 - -# actions=enqueue:10:55 -000b 0010 000a 000000000000 00000037 - -# actions=resubmit:5 -ffff 0010 00002320 0001 0005 00000000 - -# actions=set_tunnel:0x12345678 -ffff 0010 00002320 0002 0000 12345678 - -# actions=set_queue:2309737729 -ffff 0010 00002320 0004 0000 89abcd01 - -# actions=pop_queue -ffff 0010 00002320 0005 000000000000 - -# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[] -ffff 0018 00002320 0006 0010 0000 0000 00000002 00000802 - -# actions=load:0xf009->NXM_OF_VLAN_TCI[] -ffff 0018 00002320 0007 000f 00000802 000000000000f009 - -# actions=note:11.e9.9a.ad.67.f3 -ffff 0010 00002320 0008 11e99aad67f3 - -# actions=set_tunnel64:0xc426384d49c53d60 -ffff 0018 00002320 0009 000000000000 c426384d49c53d60 - -# actions=set_tunnel64:0x885f3298 -ffff 0018 00002320 0009 000000000000 00000000885f3298 - -# actions=write_metadata:0xfedcba9876543210 -ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff - -# actions=write_metadata:0xfedcba9876543210/0xffff0000ffff0000 -ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffff0000ffff0000 - -# actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[]) -ffff 0020 00002320 000a 0000 0032 0000 0000 0000 0000 0000 0000 001f 00010004 - -# actions=bundle(eth_src,0,hrw,ofport,slaves:4,8) -ffff 0028 00002320 000c 0001 0000 0000 00000002 0002 0000 00000000 00000000 0004 0008 00000000 - -# actions=bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[],slaves:4,8) -ffff 0028 00002320 000d 0001 0000 0000 00000002 0002 001f 00010004 00000000 0004 0008 00000000 - -# actions=resubmit(10,5) -ffff 0010 00002320 000e 000a 05 000000 - -# actions=output:NXM_NX_REG1[5..10] -ffff 0018 00002320 000f 0145 00010204 ffff 000000000000 - -# actions=learn(table=2,idle_timeout=10,hard_timeout=20,fin_idle_timeout=2,fin_hard_timeout=4,priority=80,cookie=0x123456789abcdef0,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[]) -ffff 0048 00002320 0010 000a 0014 0050 123456789abcdef0 0000 02 00 0002 0004 000c 00000802 0000 00000802 0000 0030 00000406 0000 00000206 0000 1010 00000002 0000 00000000 - -# actions=exit -ffff 0010 00002320 0011 000000000000 - -# actions=dec_ttl -ffff 0010 00002320 0012 000000000000 - -# actions=fin_timeout(idle_timeout=10,hard_timeout=20) -ffff 0010 00002320 0013 000a 0014 0000 - -# actions=controller(reason=invalid_ttl,max_len=1234,id=5678) -ffff 0010 00002320 0014 04d2 162e 02 00 - -# actions=dec_ttl(32768,12345,90,765,1024) -ffff 0020 00002320 0015 000500000000 80003039005A02fd 0400000000000000 - -# actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -ffff 0018 00002320 001d 3039 00005BA0 00008707 0000B26E - -_ATEOF - -sed '/^[#&]/d' < test-data > input.txt -sed -n 's/^# //p; /^$/p' < test-data > expout -sed -n 's/^& //p' < test-data > experr - - - -{ set +x -$as_echo "$at_srcdir/ofp-actions.at:127: ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-actions < input.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-actions.at:127" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-actions < input.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:127" -$at_failed && at_fn_log_failure \ -"input.txt" \ -"expout" \ -"experr" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_98 -#AT_START_99 -at_fn_group_banner 99 'ofp-actions.at:132' \ - "OpenFlow 1.1 action translation" " " 14 -at_xfail=no -( - $as_echo "99. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-data <<'_ATEOF' -# actions=LOCAL -0000 0010 fffffffe 04d2 000000000000 - -# actions=CONTROLLER:1234 -0000 0010 fffffffd 04d2 000000000000 - -# actions=set_vlan_vid:9 -0001 0008 0009 0000 - -# actions=set_vlan_pcp:6 -0002 0008 06 000000 - -# actions=mod_dl_src:00:11:22:33:44:55 -0003 0010 001122334455 000000000000 - -# actions=mod_dl_dst:10:20:30:40:50:60 -0004 0010 102030405060 000000000000 - -# actions=mod_nw_src:1.2.3.4 -0005 0008 01020304 - -# actions=mod_nw_dst:192.168.0.1 -0006 0008 c0a80001 - -# actions=mod_nw_tos:48 -0007 0008 30 000000 - -# actions=mod_tp_src:80 -0009 0008 0050 0000 - -# actions=mod_tp_dst:443 -000a 0008 01bb 0000 - -# actions=pop_vlan -0012 0008 00000000 - -# actions=set_queue:2309737729 -0015 0008 89abcd01 - -# actions=push_vlan:0x8100 -0011 0008 8100 0000 - -# actions=resubmit:5 -ffff 0010 00002320 0001 0005 00000000 - -# actions=set_tunnel:0x12345678 -ffff 0010 00002320 0002 0000 12345678 - -# actions=pop_queue -ffff 0010 00002320 0005 000000000000 - -# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[] -ffff 0018 00002320 0006 0010 0000 0000 00000002 00000802 - -# actions=load:0xf009->NXM_OF_VLAN_TCI[] -ffff 0018 00002320 0007 000f 00000802 000000000000f009 - -# actions=note:11.e9.9a.ad.67.f3 -ffff 0010 00002320 0008 11e99aad67f3 - -# actions=set_tunnel64:0xc426384d49c53d60 -ffff 0018 00002320 0009 000000000000 c426384d49c53d60 - -# actions=set_tunnel64:0x885f3298 -ffff 0018 00002320 0009 000000000000 00000000885f3298 - -# actions=write_metadata:0xfedcba9876543210 -# 0: ff -> (none) -# 1: ff -> (none) -# 2: 00 -> (none) -# 3: 20 -> (none) -# 4: 00 -> (none) -# 5: 00 -> (none) -# 6: 23 -> (none) -# 7: 20 -> (none) -# 8: 00 -> (none) -# 9: 16 -> (none) -# 10: 00 -> (none) -# 11: 00 -> (none) -# 12: 00 -> (none) -# 13: 00 -> (none) -# 14: 00 -> (none) -# 15: 00 -> (none) -# 16: fe -> (none) -# 17: dc -> (none) -# 18: ba -> (none) -# 19: 98 -> (none) -# 20: 76 -> (none) -# 21: 54 -> (none) -# 22: 32 -> (none) -# 23: 10 -> (none) -# 24: ff -> (none) -# 25: ff -> (none) -# 26: ff -> (none) -# 27: ff -> (none) -# 28: ff -> (none) -# 29: ff -> (none) -# 30: ff -> (none) -# 31: ff -> (none) -ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff - -& ofp_actions|WARN|duplicate write_metadata instruction not allowed, for OpenFlow 1.1+ compatibility -# bad OF1.1 actions: OFPBAC_UNSUPPORTED_ORDER -ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff - -& ofp_actions|WARN|invalid instruction ordering: apply_actions must appear before write_metadata, for OpenFlow 1.1+ compatibility -# bad OF1.1 actions: OFPBAC_UNSUPPORTED_ORDER -ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff ffff 0010 00002320 0002 0000 12345678 - -# actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[]) -ffff 0020 00002320 000a 0000 0032 0000 0000 0000 0000 0000 0000 001f 00010004 - -# actions=bundle(eth_src,0,hrw,ofport,slaves:4,8) -ffff 0028 00002320 000c 0001 0000 0000 00000002 0002 0000 00000000 00000000 0004 0008 00000000 - -# actions=bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[],slaves:4,8) -ffff 0028 00002320 000d 0001 0000 0000 00000002 0002 001f 00010004 00000000 0004 0008 00000000 - -# actions=resubmit(10,5) -ffff 0010 00002320 000e 000a 05 000000 - -# actions=output:NXM_NX_REG1[5..10] -ffff 0018 00002320 000f 0145 00010204 ffff 000000000000 - -# actions=learn(table=2,idle_timeout=10,hard_timeout=20,fin_idle_timeout=2,fin_hard_timeout=4,priority=80,cookie=0x123456789abcdef0,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[]) -ffff 0048 00002320 0010 000a 0014 0050 123456789abcdef0 0000 02 00 0002 0004 000c 00000802 0000 00000802 0000 0030 00000406 0000 00000206 0000 1010 00000002 0000 00000000 - -# actions=exit -ffff 0010 00002320 0011 000000000000 - -# actions=dec_ttl -ffff 0010 00002320 0012 000000000000 - -# actions=dec_ttl -0018 0008 00000000 - -# actions=fin_timeout(idle_timeout=10,hard_timeout=20) -ffff 0010 00002320 0013 000a 0014 0000 - -# actions=controller(reason=invalid_ttl,max_len=1234,id=5678) -ffff 0010 00002320 0014 04d2 162e 02 00 - -# actions=dec_ttl(32768,12345,90,765,1024) -ffff 0020 00002320 0015 000500000000 80003039005A02fd 0400000000000000 - -# actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -ffff 0018 00002320 001d 3039 00005BA0 00008707 0000B26E - -_ATEOF - -sed '/^[#&]/d' < test-data > input.txt -sed -n 's/^# //p; /^$/p' < test-data > expout -sed -n 's/^& //p' < test-data > experr - - - -{ set +x -$as_echo "$at_srcdir/ofp-actions.at:305: ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-actions < input.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-actions.at:305" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-actions < input.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:305" -$at_failed && at_fn_log_failure \ -"input.txt" \ -"expout" \ -"experr" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_99 -#AT_START_100 -at_fn_group_banner 100 'ofp-actions.at:310' \ - "OpenFlow 1.1 instruction translation" " " 14 -at_xfail=no -( - $as_echo "100. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-data <<'_ATEOF' -# actions=LOCAL -0004 0018 00000000 0000 0010 fffffffe 04d2 000000000000 - -# actions=drop -# 0: 00 -> (none) -# 1: 04 -> (none) -# 2: 00 -> (none) -# 3: 08 -> (none) -# 4: 00 -> (none) -# 5: 00 -> (none) -# 6: 00 -> (none) -# 7: 01 -> (none) -0004 0008 00000001 - -# actions=drop -# 0: 00 -> (none) -# 1: 04 -> (none) -# 2: 00 -> (none) -# 3: 08 -> (none) -# 4: 00 -> (none) -# 5: 00 -> (none) -# 6: 00 -> (none) -# 7: 00 -> (none) -0004 0008 00000000 - -# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION -0004 0008 00000000 0004 0008 00000000 - -& ofp_actions|WARN|OpenFlow message instructions length 9 is not a multiple of 8 -# bad OF1.1 instructions: OFPBIC_BAD_LEN -0004 0009 01 00000000 - -# bad OF1.1 instructions: OFPBIC_BAD_LEN -0001 0010 01 000000 0000000000000000 - -# actions=goto_table:1 -# 7: 01 -> 00 -0001 0008 01 000001 - -# bad OF1.1 instructions: OFPBIC_BAD_TABLE_ID -2,0001 0008 01 000000 - -# actions=goto_table:1 -0001 0008 01 000000 - -# actions=write_metadata:0xfedcba9876543210 -0002 0018 00000000 fedcba9876543210 ffffffffffffffff - -# actions=write_metadata:0xfedcba9876543210/0xff00ff00ff00ff00 -0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 - -# bad OF1.1 instructions: OFPBIC_BAD_LEN -0002 0010 00000000 fedcba9876543210 - -# bad OF1.1 instructions: OFPBIC_BAD_LEN -0002 0020 00000000 fedcba9876543210 ffffffffffffffff 0000000000000000 - -# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION -0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 - -# actions=write_metadata:0xfedcba9876543210,goto_table:1 -# 1: 01 -> 02 -# 3: 08 -> 18 -# 4: 01 -> 00 -# 8: 00 -> fe -# 9: 02 -> dc -# 10: 00 -> ba -# 11: 18 -> 98 -# 12: 00 -> 76 -# 13: 00 -> 54 -# 14: 00 -> 32 -# 15: 00 -> 10 -# 16: fe -> ff -# 17: dc -> ff -# 18: ba -> ff -# 19: 98 -> ff -# 20: 76 -> ff -# 21: 54 -> ff -# 22: 32 -> ff -# 23: 10 -> ff -# 24: ff -> 00 -# 25: ff -> 01 -# 26: ff -> 00 -# 27: ff -> 08 -# 28: ff -> 01 -# 29: ff -> 00 -# 30: ff -> 00 -# 31: ff -> 00 -0001 0008 01 000000 0002 0018 00000000 fedcba9876543210 ffffffffffffffff - -# actions=write_actions(drop) -# 0: 00 -> (none) -# 1: 03 -> (none) -# 2: 00 -> (none) -# 3: 08 -> (none) -# 4: 00 -> (none) -# 5: 00 -> (none) -# 6: 00 -> (none) -# 7: 01 -> (none) -0003 0008 00000001 - -# actions=write_actions(drop) -# 0: 00 -> (none) -# 1: 03 -> (none) -# 2: 00 -> (none) -# 3: 08 -> (none) -# 4: 00 -> (none) -# 5: 00 -> (none) -# 6: 00 -> (none) -# 7: 00 -> (none) -0003 0008 00000000 - -# bad OF1.1 instructions: OFPBIC_BAD_LEN -0005 0010 00000000 0000000000000000 - -# actions=clear_actions -# 7: 01 -> 00 -0005 0008 00000001 - -# actions=clear_actions -# 4: 01 -> 00 -0005 0008 01 000000 - -# actions=clear_actions -0005 0008 00000000 - -# bad OF1.1 instructions: OFPBIC_BAD_EXPERIMENTER -ffff 0008 01 000000 - -# bad OF1.1 instructions: OFPBIC_UNKNOWN_INST -0000 0008 01 000000 - -_ATEOF - -sed '/^[#&]/d' < test-data > input.txt -sed -n 's/^# //p; /^$/p' < test-data > expout -sed -n 's/^& //p' < test-data > experr - - - -{ set +x -$as_echo "$at_srcdir/ofp-actions.at:476: ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-instructions < input.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-actions.at:476" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-instructions < input.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:476" -$at_failed && at_fn_log_failure \ -"input.txt" \ -"expout" \ -"experr" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_100 -#AT_START_101 -at_fn_group_banner 101 'ofp-actions.at:481' \ - "ofp-actions - inconsistent MPLS actions" " " 14 -at_xfail=no -( - $as_echo "101. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofp-actions.at:482: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofp-actions.at:482" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:482" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:482: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofp-actions.at:482" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:482" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:482: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-actions.at:482" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:482" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:482: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofp-actions.at:482" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:482" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:482: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofp-actions.at:482" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:482" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:482: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-actions.at:482" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:482" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:482: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofp-actions.at:482" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:482" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofp-actions.at:484: ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=fin_timeout(idle_timeout=1)'" -at_fn_check_prepare_trace "ofp-actions.at:484" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=fin_timeout(idle_timeout=1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:484" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-actions.at:486: ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=push_mpls:0x8847,fin_timeout(idle_timeout=1)'" -at_fn_check_prepare_trace "ofp-actions.at:486" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=push_mpls:0x8847,fin_timeout(idle_timeout=1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OpenFlow11) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofp-actions.at:486" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-actions.at:490: check_logs " -at_fn_check_prepare_trace "ofp-actions.at:490" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:490" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:490: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofp-actions.at:490" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:490" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofp-actions.at:490: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofp-actions.at:490" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-actions.at:490" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_101 -#AT_START_102 -at_fn_group_banner 102 'ofp-print.at:3' \ - "empty" " " 15 -at_xfail=no -( - $as_echo "102. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:5: ovs-ofctl ofp-print ''" -at_fn_check_prepare_trace "ofp-print.at:5" -( $at_check_trace; ovs-ofctl ofp-print '' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OpenFlow message is empty -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:5" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_102 -#AT_START_103 -at_fn_group_banner 103 'ofp-print.at:9' \ - "too short" " " 15 -at_xfail=no -( - $as_echo "103. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:11: ovs-ofctl ofp-print aabb" -at_fn_check_prepare_trace "ofp-print.at:11" -( $at_check_trace; ovs-ofctl ofp-print aabb -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OpenFlow packet too short (only 2 bytes): -00000000 aa bb |.. | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_103 -#AT_START_104 -at_fn_group_banner 104 'ofp-print.at:17' \ - "wrong OpenFlow version" " " 15 -at_xfail=no -( - $as_echo "104. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:19: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print 00bb0008eeff0011" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:19" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print 00bb0008eeff0011 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_msgs|WARN|unknown OpenFlow message (version 0, type 187) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "***decode error: OFPBRC_BAD_TYPE*** -00000000 00 bb 00 08 ee ff 00 11- |........ | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_104 -#AT_START_105 -at_fn_group_banner 105 'ofp-print.at:27' \ - "truncated message" " " 15 -at_xfail=no -( - $as_echo "105. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:29: ovs-ofctl ofp-print 0110ccddeeff0011" -at_fn_check_prepare_trace "ofp-print.at:29" -( $at_check_trace; ovs-ofctl ofp-print 0110ccddeeff0011 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "(***truncated to 8 bytes from 52445***) -00000000 01 10 cc dd ee ff 00 11- |........ | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_105 -#AT_START_106 -at_fn_group_banner 106 'ofp-print.at:35' \ - "message only uses part of buffer" " " 15 -at_xfail=no -( - $as_echo "106. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:37: ovs-ofctl ofp-print 01100009eeff00112233" -at_fn_check_prepare_trace "ofp-print.at:37" -( $at_check_trace; ovs-ofctl ofp-print 01100009eeff00112233 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "(***only uses 9 bytes out of 10***) -00000000 01 10 00 09 ee ff 00 11-22 33 |........\"3 | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:37" -$at_failed && at_fn_log_failure -$at_traceon; } - -# " - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_106 -#AT_START_107 -at_fn_group_banner 107 'ofp-print.at:44' \ - "OFPT_HELLO - ordinary" " " 15 -at_xfail=no -( - $as_echo "107. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:46: ovs-ofctl ofp-print 0100000800000000" -at_fn_check_prepare_trace "ofp-print.at:46" -( $at_check_trace; ovs-ofctl ofp-print 0100000800000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x0): - version bitmap: 0x01 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_107 -#AT_START_108 -at_fn_group_banner 108 'ofp-print.at:52' \ - "OFPT_HELLO with extra data" " " 15 -at_xfail=no -( - $as_echo "108. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:54: ovs-ofctl ofp-print 0100001300000000657874726120646174610a" -at_fn_check_prepare_trace "ofp-print.at:54" -( $at_check_trace; ovs-ofctl ofp-print 0100001300000000657874726120646174610a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x0): - version bitmap: 0x01 - unknown data in hello: -00000000 01 00 00 13 00 00 00 00-65 78 74 72 61 20 64 61 |........extra da| -00000010 74 61 0a |ta. | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:54" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_108 -#AT_START_109 -at_fn_group_banner 109 'ofp-print.at:64' \ - "OFPT_HELLO with version bitmap" " " 15 -at_xfail=no -( - $as_echo "109. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:66: ovs-ofctl ofp-print \"01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 f0\"" -at_fn_check_prepare_trace "ofp-print.at:66" -( $at_check_trace; ovs-ofctl ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 f0" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x0): - version bitmap: 0x04, 0x05, 0x06, 0x07 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_109 -#AT_START_110 -at_fn_group_banner 110 'ofp-print.at:73' \ - "OFPT_HELLO with version bitmap and extra data" " " 15 -at_xfail=no -( - $as_echo "110. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:75: ovs-ofctl ofp-print \"\\ -01 00 00 1b 00 00 00 00 ff ff 00 06 01 02 00 00 \\ -00 01 00 08 00 00 00 f0 61 62 63\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:75" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 00 00 1b 00 00 00 00 ff ff 00 06 01 02 00 00 \ -00 01 00 08 00 00 00 f0 61 62 63" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x0): - version bitmap: 0x04, 0x05, 0x06, 0x07 - unknown data in hello: -00000000 01 00 00 1b 00 00 00 00-ff ff 00 06 01 02 00 00 |................| -00000010 00 01 00 08 00 00 00 f0-61 62 63 |........abc | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_110 -#AT_START_111 -at_fn_group_banner 111 'ofp-print.at:87' \ - "OFPT_HELLO with higher than supported version" " " 15 -at_xfail=no -( - $as_echo "111. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:89: ovs-ofctl ofp-print \"0f 00 00 08 00 00 00 00\"" -at_fn_check_prepare_trace "ofp-print.at:89" -( $at_check_trace; ovs-ofctl ofp-print "0f 00 00 08 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (OF 0x0f) (xid=0x0): - version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:89" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:94: ovs-ofctl ofp-print \"40 00 00 08 00 00 00 00\"" -at_fn_check_prepare_trace "ofp-print.at:94" -( $at_check_trace; ovs-ofctl ofp-print "40 00 00 08 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (OF 0x40) (xid=0x0): - version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:99: ovs-ofctl ofp-print \"3f 00 00 18 00 00 00 00 00 01 00 0c aa aa aa aa aa aa aa aa 00 00 00 00\"" -at_fn_check_prepare_trace "ofp-print.at:99" -( $at_check_trace; ovs-ofctl ofp-print "3f 00 00 18 00 00 00 00 00 01 00 0c aa aa aa aa aa aa aa aa 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (OF 0x3f) (xid=0x0): - version bitmap: 0x01, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f, 0x11, 0x13, 0x15, 0x17, 0x19, 0x1b, 0x1d, 0x1f -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:99" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_111 -#AT_START_112 -at_fn_group_banner 112 'ofp-print.at:106' \ - "OFPT_HELLO with contradictory version bitmaps" " " 15 -at_xfail=no -( - $as_echo "112. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:109: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 00\"" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:109" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_util|WARN|peer does not support any OpenFlow version (between 0x01 and 0x1f) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x0): - version bitmap: 0x01 - unknown data in hello: -00000000 01 00 00 10 00 00 00 00-00 01 00 08 00 00 00 00 |................| -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:118: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"3f 00 00 18 00 00 00 00 00 01 00 0c 00 00 00 00 aa aa aa aa 00 00 00 00\"" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:118" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "3f 00 00 18 00 00 00 00 00 01 00 0c 00 00 00 00 aa aa aa aa 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_util|WARN|peer does not support any OpenFlow version (between 0x01 and 0x1f) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (OF 0x3f) (xid=0x0): - version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f - unknown data in hello: -00000000 3f 00 00 18 00 00 00 00-00 01 00 0c 00 00 00 00 |?...............| -00000010 aa aa aa aa 00 00 00 00- |........ | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:118" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:128: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 f1\"" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:128" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 f1" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_util|WARN|peer claims to support invalid OpenFlow version 0x00 -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x0): - version bitmap: 0x04, 0x05, 0x06, 0x07 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:128" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:135: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 01\"" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:135" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 01" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_util|WARN|peer claims to support invalid OpenFlow version 0x00 -ofp_util|WARN|peer does not support any OpenFlow version (between 0x01 and 0x1f) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x0): - version bitmap: 0x01 - unknown data in hello: -00000000 01 00 00 10 00 00 00 00-00 01 00 08 00 00 00 01 |................| -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:135" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_112 -#AT_START_113 -at_fn_group_banner 113 'ofp-print.at:148' \ - "OFPT_ECHO_REQUEST, empty payload" " " 15 -at_xfail=no -( - $as_echo "113. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:150: ovs-ofctl ofp-print '01 02 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:150" -( $at_check_trace; ovs-ofctl ofp-print '01 02 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ECHO_REQUEST (xid=0x1): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:150" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_113 -#AT_START_114 -at_fn_group_banner 114 'ofp-print.at:155' \ - "OFPT_ECHO_REQUEST, 5-byte payload" " " 15 -at_xfail=no -( - $as_echo "114. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:157: ovs-ofctl ofp-print '0102000d00000001 25 53 54 1a 9d'" -at_fn_check_prepare_trace "ofp-print.at:157" -( $at_check_trace; ovs-ofctl ofp-print '0102000d00000001 25 53 54 1a 9d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ECHO_REQUEST (xid=0x1): 5 bytes of payload -00000000 25 53 54 1a 9d |%ST.. | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:157" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_114 -#AT_START_115 -at_fn_group_banner 115 'ofp-print.at:163' \ - "OFPT_ECHO_REPLY, empty payload" " " 15 -at_xfail=no -( - $as_echo "115. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:165: ovs-ofctl ofp-print '01 03 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:165" -( $at_check_trace; ovs-ofctl ofp-print '01 03 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ECHO_REPLY (xid=0x1): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_115 -#AT_START_116 -at_fn_group_banner 116 'ofp-print.at:170' \ - "OFPT_ECHO_REPLY, 5-byte payload" " " 15 -at_xfail=no -( - $as_echo "116. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:172: ovs-ofctl ofp-print '0103000d0000000ba330efaf9e'" -at_fn_check_prepare_trace "ofp-print.at:172" -( $at_check_trace; ovs-ofctl ofp-print '0103000d0000000ba330efaf9e' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ECHO_REPLY (xid=0xb): 5 bytes of payload -00000000 a3 30 ef af 9e |.0... | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:172" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_116 -#AT_START_117 -at_fn_group_banner 117 'ofp-print.at:178' \ - "OFPT_FEATURES_REQUEST" " " 15 -at_xfail=no -( - $as_echo "117. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:180: ovs-ofctl ofp-print '0105000800000001'" -at_fn_check_prepare_trace "ofp-print.at:180" -( $at_check_trace; ovs-ofctl ofp-print '0105000800000001' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REQUEST (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:180" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_117 -#AT_START_118 -at_fn_group_banner 118 'ofp-print.at:185' \ - "OFPT_FEATURES_REPLY - OF1.0" " " 15 -at_xfail=no -( - $as_echo "118. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:187: ovs-ofctl ofp-print \"\\ -01 06 00 e0 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \\ -ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 03 50 54 00 00 00 01 65 74 68 30 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \\ -00 02 50 54 00 00 00 03 65 74 68 32 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \\ -00 01 50 54 00 00 00 02 65 74 68 31 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:187" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 06 00 e0 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \ -ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 03 50 54 00 00 00 01 65 74 68 30 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \ -00 02 50 54 00 00 00 03 65 74 68 32 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \ -00 01 50 54 00 00 00 02 65 74 68 31 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (xid=0x1): dpid:0000505400000001 -n_tables:2, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE - 1(eth1): addr:50:54:00:00:00:02 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max - 2(eth2): addr:50:54:00:00:00:03 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max - 3(eth0): addr:50:54:00:00:00:01 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max - LOCAL(br0): addr:50:54:00:00:00:01 - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:187" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_118 -#AT_START_119 -at_fn_group_banner 119 'ofp-print.at:235' \ - "OFPT_FEATURES_REPLY cut off mid-port - OF1.0" " " 15 -at_xfail=no -( - $as_echo "119. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:237: ovs-ofctl ofp-print \"\\ -01 06 00 dc 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \\ -ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 03 50 54 00 00 00 01 65 74 68 30 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \\ -00 02 50 54 00 00 00 03 65 74 68 32 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \\ -00 01 50 54 00 00 00 02 65 74 68 31 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 02 08 00 00 02 8f 00 00 02 8f \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:237" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 06 00 dc 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \ -ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 03 50 54 00 00 00 01 65 74 68 30 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \ -00 02 50 54 00 00 00 03 65 74 68 32 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \ -00 01 50 54 00 00 00 02 65 74 68 31 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 02 08 00 00 02 8f 00 00 02 8f \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "***decode error: OFPBRC_BAD_LEN*** -00000000 01 06 00 dc 00 00 00 01-00 00 50 54 00 00 00 01 |..........PT....| -00000010 00 00 01 00 02 00 00 00-00 00 00 87 00 00 0f ff |................| -00000020 ff fe 50 54 00 00 00 01-62 72 30 00 00 00 00 00 |..PT....br0.....| -00000030 00 00 00 00 00 00 00 00-00 00 00 01 00 00 00 01 |................| -00000040 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................| -00000050 00 03 50 54 00 00 00 01-65 74 68 30 00 00 00 00 |..PT....eth0....| -00000060 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................| -00000070 00 00 02 08 00 00 02 8f-00 00 02 8f 00 00 00 00 |................| -00000080 00 02 50 54 00 00 00 03-65 74 68 32 00 00 00 00 |..PT....eth2....| -00000090 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................| -000000a0 00 00 02 08 00 00 02 8f-00 00 02 8f 00 00 00 00 |................| -000000b0 00 01 50 54 00 00 00 02-65 74 68 31 00 00 00 00 |..PT....eth1....| -000000c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................| -000000d0 00 00 02 08 00 00 02 8f-00 00 02 8f |............ | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:237" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:269: sed 's/.*|//' stderr" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:269" -( $at_check_trace; sed 's/.*|//' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "received OFPT_FEATURES_REPLY with incorrect length 220 (must be exactly 32 bytes or longer by an integer multiple of 48 bytes) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:269" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_119 -#AT_START_120 -at_fn_group_banner 120 'ofp-print.at:274' \ - "OFPT_FEATURES_REPLY - OF1.1" " " 15 -at_xfail=no -( - $as_echo "120. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:276: ovs-ofctl ofp-print \"\\ -02 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 00 00 \\ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \\ -62 72 30 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \\ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \\ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \\ -00 00 28 0f 00 00 00 00 00 01 86 a0 00 01 86 a0 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:276" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 00 00 \ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \ -62 72 30 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \ -00 00 28 0f 00 00 00 00 00 01 86 a0 00 01 86 a0 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (OF1.1) (xid=0x1): dpid:0000505400000001 -n_tables:2, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS ARP_MATCH_IP - 3(eth0): addr:50:54:00:00:00:01 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max - LOCAL(br0): addr:50:54:00:00:00:01 - config: PORT_DOWN - state: LINK_DOWN - speed: 100 Mbps now, 100 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:276" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_120 -#AT_START_121 -at_fn_group_banner 121 'ofp-print.at:305' \ - "OFPT_FEATURES_REPLY cut off mid-port - OF1.1" " " 15 -at_xfail=no -( - $as_echo "121. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:307: ovs-ofctl ofp-print \"\\ -02 06 00 90 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 00 00 \\ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \\ -62 72 30 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \\ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \\ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:307" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 06 00 90 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 00 00 \ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \ -62 72 30 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "***decode error: OFPBRC_BAD_LEN*** -00000000 02 06 00 90 00 00 00 01-00 00 50 54 00 00 00 01 |..........PT....| -00000010 00 00 01 00 02 00 00 00-00 00 00 87 00 00 00 00 |................| -00000020 ff ff ff fe 00 00 00 00-50 54 00 00 00 01 00 00 |........PT......| -00000030 62 72 30 00 00 00 00 00-00 00 00 00 00 00 00 00 |br0.............| -00000040 00 00 00 01 00 00 00 01-00 00 00 00 00 00 00 00 |................| -00000050 00 00 00 00 00 00 00 00-00 01 86 a0 00 01 86 a0 |................| -00000060 00 00 00 03 00 00 00 00-50 54 00 00 00 01 00 00 |........PT......| -00000070 65 74 68 30 00 00 00 00-00 00 00 00 00 00 00 00 |eth0............| -00000080 00 00 00 00 00 00 00 00-00 00 20 08 00 00 28 0f |.......... ...(.| -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:329: sed 's/.*|//' stderr" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:329" -( $at_check_trace; sed 's/.*|//' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "received OFPT_FEATURES_REPLY with incorrect length 144 (must be exactly 32 bytes or longer by an integer multiple of 64 bytes) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:329" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_121 -#AT_START_122 -at_fn_group_banner 122 'ofp-print.at:334' \ - "OFPT_FEATURES_REPLY - OF1.2" " " 15 -at_xfail=no -( - $as_echo "122. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:336: ovs-ofctl ofp-print \"\\ -03 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 ff 00 00 00 00 00 01 77 00 00 00 00 \\ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \\ -62 72 30 0a 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \\ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \\ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \\ -00 00 28 0f 00 00 00 00 00 01 86 a0 00 01 86 a0 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:336" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 ff 00 00 00 00 00 01 77 00 00 00 00 \ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \ -62 72 30 0a 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \ -00 00 28 0f 00 00 00 00 00 01 86 a0 00 01 86 a0 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (OF1.2) (xid=0x1): dpid:0000505400000001 -n_tables:255, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS IP_REASM QUEUE_STATS PORT_BLOCKED - 3(eth0): addr:50:54:00:00:00:01 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max - LOCAL(br0): addr:50:54:00:00:00:01 - config: PORT_DOWN - state: LINK_DOWN - speed: 100 Mbps now, 100 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_122 -#AT_START_123 -at_fn_group_banner 123 'ofp-print.at:365' \ - "OFPT_FEATURES_REPLY cut off mid-port - OF1.2" " " 15 -at_xfail=no -( - $as_echo "123. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:367: ovs-ofctl ofp-print \"\\ -03 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 ff 00 00 00 00 00 01 77 00 00 00 00 \\ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \\ -62 72 30 0a 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \\ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \\ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:367" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 ff 00 00 00 00 00 01 77 00 00 00 00 \ -ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \ -62 72 30 0a 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (OF1.2) (xid=0x1): -(***truncated to 144 bytes from 160***) -00000000 03 06 00 a0 00 00 00 01-00 00 50 54 00 00 00 01 |..........PT....| -00000010 00 00 01 00 ff 00 00 00-00 00 01 77 00 00 00 00 |...........w....| -00000020 ff ff ff fe 00 00 00 00-50 54 00 00 00 01 00 00 |........PT......| -00000030 62 72 30 0a 00 00 00 00-00 00 00 00 00 00 00 00 |br0.............| -00000040 00 00 00 01 00 00 00 01-00 00 00 00 00 00 00 00 |................| -00000050 00 00 00 00 00 00 00 00-00 01 86 a0 00 01 86 a0 |................| -00000060 00 00 00 03 00 00 00 00-50 54 00 00 00 01 00 00 |........PT......| -00000070 65 74 68 30 00 00 00 00-00 00 00 00 00 00 00 00 |eth0............| -00000080 00 00 00 00 00 00 00 00-00 00 20 08 00 00 28 0f |.......... ...(.| -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:367" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:390: sed 's/.*|//' stderr" -at_fn_check_prepare_notrace 'a shell pipeline' "ofp-print.at:390" -( $at_check_trace; sed 's/.*|//' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:390" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_123 -#AT_START_124 -at_fn_group_banner 124 'ofp-print.at:394' \ - "OFPT_FEATURES_REPLY - OF1.3" " " 15 -at_xfail=no -( - $as_echo "124. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:396: ovs-ofctl ofp-print \"\\ -04 06 00 20 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 ff 00 00 00 00 00 01 77 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:396" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 06 00 20 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 ff 00 00 00 00 00 01 77 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (OF1.3) (xid=0x1): dpid:0000505400000001 -n_tables:255, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS IP_REASM QUEUE_STATS PORT_BLOCKED -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:396" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_124 -#AT_START_125 -at_fn_group_banner 125 'ofp-print.at:406' \ - "OFPT_FEATURES_REPLY - with auxiliary_id - OF1.3" "" 15 -at_xfail=no -( - $as_echo "125. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:408: ovs-ofctl ofp-print \"\\ -04 06 00 20 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 ff 01 00 00 00 00 01 77 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:408" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 06 00 20 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 ff 01 00 00 00 00 01 77 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (OF1.3) (xid=0x1): dpid:0000505400000001 -n_tables:255, n_buffers:256, auxiliary_id:1 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS IP_REASM QUEUE_STATS PORT_BLOCKED -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:408" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_125 -#AT_START_126 -at_fn_group_banner 126 'ofp-print.at:418' \ - "OFPT_GET_CONFIG_REQUEST" " " 15 -at_xfail=no -( - $as_echo "126. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:420: ovs-ofctl ofp-print '0107000800000001'" -at_fn_check_prepare_trace "ofp-print.at:420" -( $at_check_trace; ovs-ofctl ofp-print '0107000800000001' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_GET_CONFIG_REQUEST (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:420" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_126 -#AT_START_127 -at_fn_group_banner 127 'ofp-print.at:425' \ - "OFPT_GET_CONFIG_REPLY, most common form" " " 15 -at_xfail=no -( - $as_echo "127. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:427: ovs-ofctl ofp-print '01 08 00 0c 00 00 00 03 00 00 00 00'" -at_fn_check_prepare_trace "ofp-print.at:427" -( $at_check_trace; ovs-ofctl ofp-print '01 08 00 0c 00 00 00 03 00 00 00 00' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_GET_CONFIG_REPLY (xid=0x3): frags=normal miss_send_len=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:427" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_127 -#AT_START_128 -at_fn_group_banner 128 'ofp-print.at:433' \ - "OFPT_GET_CONFIG_REPLY, frags and miss_send_len" " " 15 -at_xfail=no -( - $as_echo "128. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:435: ovs-ofctl ofp-print '01 08 00 0c 00 00 00 03 00 02 00 ff'" -at_fn_check_prepare_trace "ofp-print.at:435" -( $at_check_trace; ovs-ofctl ofp-print '01 08 00 0c 00 00 00 03 00 02 00 ff' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_GET_CONFIG_REPLY (xid=0x3): frags=reassemble miss_send_len=255 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:435" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_128 -#AT_START_129 -at_fn_group_banner 129 'ofp-print.at:440' \ - "OFPT_PACKET_IN - OF1.0" " " 15 -at_xfail=no -( - $as_echo "129. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:442: ovs-ofctl ofp-print \"\\ -01 0a 00 4e 00 00 00 00 00 00 01 11 00 3c 00 03 \\ -00 00 50 54 00 00 00 06 50 54 00 00 00 05 08 00 \\ -45 00 00 28 bd 12 00 00 40 06 3c 6a c0 a8 00 01 \\ -c0 a8 00 02 27 2f 00 00 78 50 cc 5b 57 af 42 1e \\ -50 02 02 00 26 e8 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:442" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0a 00 4e 00 00 00 00 00 00 01 11 00 3c 00 03 \ -00 00 50 54 00 00 00 06 50 54 00 00 00 05 08 00 \ -45 00 00 28 bd 12 00 00 40 06 3c 6a c0 a8 00 01 \ -c0 a8 00 02 27 2f 00 00 78 50 cc 5b 57 af 42 1e \ -50 02 02 00 26 e8 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 (via no_match) data_len=60 buffer=0x00000111 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=0x002 tcp_csum:26e8 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:442" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_129 -#AT_START_130 -at_fn_group_banner 130 'ofp-print.at:454' \ - "OFPT_PACKET_IN - OF1.0, with hex output of packet data" "" 15 -at_xfail=no -( - $as_echo "130. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:456: ovs-ofctl ofp-print \"\\ -01 0a 00 4e 00 00 00 00 00 00 01 11 00 3c 00 03 \\ -00 00 50 54 00 00 00 06 50 54 00 00 00 05 08 00 \\ -45 00 00 28 bd 12 00 00 40 06 3c 6a c0 a8 00 01 \\ -c0 a8 00 02 27 2f 00 00 78 50 cc 5b 57 af 42 1e \\ -50 10 02 00 26 e8 00 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:456" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0a 00 4e 00 00 00 00 00 00 01 11 00 3c 00 03 \ -00 00 50 54 00 00 00 06 50 54 00 00 00 05 08 00 \ -45 00 00 28 bd 12 00 00 40 06 3c 6a c0 a8 00 01 \ -c0 a8 00 02 27 2f 00 00 78 50 cc 5b 57 af 42 1e \ -50 10 02 00 26 e8 00 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 (via no_match) data_len=60 buffer=0x00000111 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=0x010 tcp_csum:26e8 -00000000 50 54 00 00 00 06 50 54-00 00 00 05 08 00 45 00 -00000010 00 28 bd 12 00 00 40 06-3c 6a c0 a8 00 01 c0 a8 -00000020 00 02 27 2f 00 00 78 50-cc 5b 57 af 42 1e 50 10 -00000030 02 00 26 e8 00 00 00 00-00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:456" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_130 -#AT_START_131 -at_fn_group_banner 131 'ofp-print.at:472' \ - "OFPT_PACKET_IN - OF1.1" " " 15 -at_xfail=no -( - $as_echo "131. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:474: ovs-ofctl ofp-print \"\\ -02 0a 00 54 00 00 00 00 00 00 01 11 00 00 00 03 \\ -00 00 00 03 00 3c 00 00 \\ -50 54 00 00 00 06 50 54 00 00 00 05 08 00 \\ -45 00 00 28 bd 12 00 00 40 06 3c 6a c0 a8 00 01 \\ -c0 a8 00 02 27 2f 00 00 78 50 cc 5b 57 af 42 1e \\ -50 02 02 00 26 e8 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:474" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 0a 00 54 00 00 00 00 00 00 01 11 00 00 00 03 \ -00 00 00 03 00 3c 00 00 \ -50 54 00 00 00 06 50 54 00 00 00 05 08 00 \ -45 00 00 28 bd 12 00 00 40 06 3c 6a c0 a8 00 01 \ -c0 a8 00 02 27 2f 00 00 78 50 cc 5b 57 af 42 1e \ -50 02 02 00 26 e8 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.1) (xid=0x0): total_len=60 in_port=3 (via no_match) data_len=60 buffer=0x00000111 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=10031,tp_dst=0,tcp_flags=0x002 tcp_csum:26e8 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:474" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_131 -#AT_START_132 -at_fn_group_banner 132 'ofp-print.at:487' \ - "OFPT_PACKET_IN - OF1.2" " " 15 -at_xfail=no -( - $as_echo "132. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:489: ovs-ofctl ofp-print \"\\ -03 0a 00 4c 00 00 00 00 ff ff ff 00 00 2a 00 00 \\ -00 01 00 0c 80 00 00 04 ff ff ff fe 00 00 00 00 \\ -00 00 ff ff ff ff ff ff 00 23 20 83 c1 5f 80 35 \\ -00 01 08 00 06 04 00 01 00 23 20 83 c1 5f 00 00 \\ -00 00 00 23 20 83 c1 5f 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:489" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 0a 00 4c 00 00 00 00 ff ff ff 00 00 2a 00 00 \ -00 01 00 0c 80 00 00 04 ff ff ff fe 00 00 00 00 \ -00 00 ff ff ff ff ff ff 00 23 20 83 c1 5f 80 35 \ -00 01 08 00 06 04 00 01 00 23 20 83 c1 5f 00 00 \ -00 00 00 23 20 83 c1 5f 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=1,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:489" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_132 -#AT_START_133 -at_fn_group_banner 133 'ofp-print.at:501' \ - "OFPT_PACKET_IN - OF1.2, with hex output of packet data" "" 15 -at_xfail=no -( - $as_echo "133. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:503: ovs-ofctl ofp-print \"\\ -03 0a 00 4c 00 00 00 00 ff ff ff 00 00 2a 00 00 \\ -00 01 00 0c 80 00 00 04 ff ff ff fe 00 00 00 00 \\ -00 00 ff ff ff ff ff ff 00 23 20 83 c1 5f 80 35 \\ -00 01 08 00 06 04 00 03 00 23 20 83 c1 5f 00 00 \\ -00 00 00 23 20 83 c1 5f 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:503" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 0a 00 4c 00 00 00 00 ff ff ff 00 00 2a 00 00 \ -00 01 00 0c 80 00 00 04 ff ff ff fe 00 00 00 00 \ -00 00 ff ff ff ff ff ff 00 23 20 83 c1 5f 80 35 \ -00 01 08 00 06 04 00 03 00 23 20 83 c1 5f 00 00 \ -00 00 00 23 20 83 c1 5f 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f -00000000 ff ff ff ff ff ff 00 23-20 83 c1 5f 80 35 00 01 -00000010 08 00 06 04 00 03 00 23-20 83 c1 5f 00 00 00 00 -00000020 00 23 20 83 c1 5f 00 00-00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:503" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_133 -#AT_START_134 -at_fn_group_banner 134 'ofp-print.at:518' \ - "OFPT_PACKET_IN - OF1.3" " " 15 -at_xfail=no -( - $as_echo "134. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:520: ovs-ofctl ofp-print \"\\ -04 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \\ -01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \\ -ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \\ -00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \\ -00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \\ -00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:520" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \ -01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \ -ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \ -00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \ -00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \ -00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:520" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_134 -#AT_START_135 -at_fn_group_banner 135 'ofp-print.at:533' \ - "OFPT_PACKET_IN - OF1.3, with hex output of packet data" "" 15 -at_xfail=no -( - $as_echo "135. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:535: ovs-ofctl ofp-print \"\\ -04 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \\ -01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \\ -ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \\ -00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \\ -00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \\ -00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:535" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \ -01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \ -ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \ -00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \ -00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \ -00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -rarp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f -00000000 ff ff ff ff ff ff 00 23-20 83 c1 5f 80 35 00 01 -00000010 08 00 06 04 00 03 00 23-20 83 c1 5f 00 00 00 00 -00000020 00 23 20 83 c1 5f 00 00-00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:535" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_135 -#AT_START_136 -at_fn_group_banner 136 'ofp-print.at:551' \ - "OFPT_FLOW_REMOVED - OF1.0" " " 15 -at_xfail=no -( - $as_echo "136. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:553: ovs-ofctl ofp-print \"\\ -01 0b 00 58 00 00 00 00 00 00 00 00 00 03 50 54 \\ -00 00 00 05 50 54 00 00 00 06 ff ff 00 00 08 06 \\ -00 02 00 00 c0 a8 00 01 c0 a8 00 02 00 00 00 00 \\ -00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 05 \\ -30 e0 35 00 00 05 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:553" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0b 00 58 00 00 00 00 00 00 00 00 00 03 50 54 \ -00 00 00 05 50 54 00 00 00 06 ff ff 00 00 08 06 \ -00 02 00 00 c0 a8 00 01 c0 a8 00 02 00 00 00 00 \ -00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 05 \ -30 e0 35 00 00 05 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_REMOVED (xid=0x0): priority=65535,arp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0 reason=idle duration5.820s idle5 pkts1 bytes60 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:553" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_136 -#AT_START_137 -at_fn_group_banner 137 'ofp-print.at:565' \ - "OFPT_FLOW_REMOVED - OF1.2" " " 15 -at_xfail=no -( - $as_echo "137. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:567: ovs-ofctl ofp-print \"\\ -03 0b 00 40 00 00 00 00 fe dc ba 98 76 54 32 10 \\ -80 00 01 05 00 00 00 01 00 98 96 80 00 3c 00 78 \\ -00 00 00 00 00 12 d6 87 00 00 00 00 6f 68 ba 66 \\ -00 01 00 0a 80 00 0c 02 10 09 00 00 00 00 00 00\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:567" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 0b 00 40 00 00 00 00 fe dc ba 98 76 54 32 10 \ -80 00 01 05 00 00 00 01 00 98 96 80 00 3c 00 78 \ -00 00 00 00 00 12 d6 87 00 00 00 00 6f 68 ba 66 \ -00 01 00 0a 80 00 0c 02 10 09 00 00 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_REMOVED (OF1.2) (xid=0x0): dl_vlan=9 reason=hard table_id=5 cookie:0xfedcba9876543210 duration1.010s idle60 hard120 pkts1234567 bytes1869134438 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:567" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_137 -#AT_START_138 -at_fn_group_banner 138 'ofp-print.at:576' \ - "OFPT_FLOW_REMOVED - OF1.3" " " 15 -at_xfail=no -( - $as_echo "138. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:578: ovs-ofctl ofp-print \"\\ -04 0b 00 40 00 00 00 00 fe dc ba 98 76 54 32 10 \\ -80 00 01 05 00 00 00 01 00 98 96 80 00 3c 00 78 \\ -00 00 00 00 00 12 d6 87 00 00 00 00 6f 68 ba 66 \\ -00 01 00 0a 80 00 0c 02 10 09 00 00 00 00 00 00\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:578" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 0b 00 40 00 00 00 00 fe dc ba 98 76 54 32 10 \ -80 00 01 05 00 00 00 01 00 98 96 80 00 3c 00 78 \ -00 00 00 00 00 12 d6 87 00 00 00 00 6f 68 ba 66 \ -00 01 00 0a 80 00 0c 02 10 09 00 00 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_REMOVED (OF1.3) (xid=0x0): dl_vlan=9 reason=hard table_id=5 cookie:0xfedcba9876543210 duration1.010s idle60 hard120 pkts1234567 bytes1869134438 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:578" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_138 -#AT_START_139 -at_fn_group_banner 139 'ofp-print.at:587' \ - "OFPT_PORT_STATUS - OF1.0" " " 15 -at_xfail=no -( - $as_echo "139. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:589: ovs-ofctl ofp-print \"\\ -01 0c 00 40 00 00 00 00 02 00 00 00 00 00 00 00 \\ -00 03 50 54 00 00 00 01 65 74 68 30 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 \\ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:589" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0c 00 40 00 00 00 00 02 00 00 00 00 00 00 00 \ -00 03 50 54 00 00 00 01 65 74 68 30 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 \ -00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_STATUS (xid=0x0): MOD: 3(eth0): addr:50:54:00:00:00:01 - config: PORT_DOWN - state: LINK_DOWN - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:589" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_139 -#AT_START_140 -at_fn_group_banner 140 'ofp-print.at:605' \ - "OFPT_PORT_STATUS - OF1.1" " " 15 -at_xfail=no -( - $as_echo "140. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:607: ovs-ofctl ofp-print \"\\ -02 0c 00 50 00 00 00 00 02 00 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \\ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \\ -00 00 28 0f 00 00 00 00 00 01 86 a0 00 01 86 a0 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:607" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 0c 00 50 00 00 00 00 02 00 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \ -00 00 28 0f 00 00 00 00 00 01 86 a0 00 01 86 a0 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_STATUS (OF1.1) (xid=0x0): MOD: 3(eth0): addr:50:54:00:00:00:01 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:607" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_140 -#AT_START_141 -at_fn_group_banner 141 'ofp-print.at:624' \ - "OFPT_PORT_STATUS - OF1.4" " " 15 -at_xfail=no -( - $as_echo "141. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:626: ovs-ofctl ofp-print \"\\ -05 0c 00 58 00 00 00 00 02 00 00 00 00 00 00 00 \\ -00 00 00 03 00 48 00 00 50 54 00 00 00 01 00 00 \\ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 \\ -00 00 20 08 00 00 28 0f 00 00 28 0f 00 00 00 00 \\ -00 01 86 a0 00 01 86 a0 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:626" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 0c 00 58 00 00 00 00 02 00 00 00 00 00 00 00 \ -00 00 00 03 00 48 00 00 50 54 00 00 00 01 00 00 \ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 \ -00 00 20 08 00 00 28 0f 00 00 28 0f 00 00 00 00 \ -00 01 86 a0 00 01 86 a0 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_STATUS (OF1.4) (xid=0x0): MOD: 3(eth0): addr:50:54:00:00:00:01 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:626" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_141 -#AT_START_142 -at_fn_group_banner 142 'ofp-print.at:644' \ - "OFPT_PACKET_OUT - OF1.0" " " 15 -at_xfail=no -( - $as_echo "142. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:646: ovs-ofctl ofp-print \"\\ -01 0d 00 54 00 00 00 00 00 00 01 14 00 01 00 08 \\ -00 00 00 08 00 03 00 00 50 54 00 00 00 05 50 54 \\ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \\ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \\ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \\ -00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:646" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0d 00 54 00 00 00 00 00 00 01 14 00 01 00 08 \ -00 00 00 08 00 03 00 00 50 54 00 00 00 05 50 54 \ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \ -00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_OUT (xid=0x0): in_port=1 actions=output:3 buffer=0x00000114 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:646" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_142 -#AT_START_143 -at_fn_group_banner 143 'ofp-print.at:658' \ - "OFPT_PACKET_OUT - OF1.0, with packet" " " 15 -at_xfail=no -( - $as_echo "143. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:660: ovs-ofctl ofp-print \"\\ -01 0d 00 54 00 00 00 00 ff ff ff ff 00 01 00 08 \\ -00 00 00 08 00 03 00 00 50 54 00 00 00 05 50 54 \\ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \\ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \\ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \\ -00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:660" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0d 00 54 00 00 00 00 ff ff ff ff 00 01 00 08 \ -00 00 00 08 00 03 00 00 50 54 00 00 00 05 50 54 \ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \ -00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_OUT (xid=0x0): in_port=1 actions=output:3 data_len=60 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=0x014 tcp_csum:6d75 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:660" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_143 -#AT_START_144 -at_fn_group_banner 144 'ofp-print.at:673' \ - "OFPT_PACKET_OUT - OF1.0, with hex output of packet data" "" 15 -at_xfail=no -( - $as_echo "144. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:675: ovs-ofctl ofp-print \"\\ -01 0d 00 54 00 00 00 00 ff ff ff ff 00 01 00 08 \\ -00 00 00 08 00 03 00 00 50 54 00 00 00 05 50 54 \\ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \\ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \\ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \\ -00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:675" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0d 00 54 00 00 00 00 ff ff ff ff 00 01 00 08 \ -00 00 00 08 00 03 00 00 50 54 00 00 00 05 50 54 \ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \ -00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_OUT (xid=0x0): in_port=1 actions=output:3 data_len=60 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=0x014 tcp_csum:6d75 -00000000 50 54 00 00 00 05 50 54-00 00 00 06 08 00 45 00 -00000010 00 28 00 00 40 00 40 06-b9 7c c0 a8 00 02 c0 a8 -00000020 00 01 00 00 2b 60 00 00-00 00 6a 4f 2b 58 50 14 -00000030 00 00 6d 75 00 00 00 00-00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:675" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_144 -#AT_START_145 -at_fn_group_banner 145 'ofp-print.at:692' \ - "OFPT_PACKET_OUT - OF1.1" " " 15 -at_xfail=no -( - $as_echo "145. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:694: ovs-ofctl ofp-print \"\\ -03 0d 00 28 88 58 df c5 ff ff ff 00 ff ff ff fe \\ -00 10 00 00 00 00 00 00 00 00 00 10 ff ff ff fb \\ -05 dc 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:694" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 0d 00 28 88 58 df c5 ff ff ff 00 ff ff ff fe \ -00 10 00 00 00 00 00 00 00 00 00 10 ff ff ff fb \ -05 dc 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_OUT (OF1.2) (xid=0x8858dfc5): in_port=LOCAL actions=FLOOD buffer=0xffffff00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:694" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_145 -#AT_START_146 -at_fn_group_banner 146 'ofp-print.at:703' \ - "OFPT_PACKET_OUT - OF1.1, with packet" " " 15 -at_xfail=no -( - $as_echo "146. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:705: ovs-ofctl ofp-print \"\\ -03 0d 00 64 88 58 df c5 ff ff ff ff ff ff ff fe \\ -00 10 00 00 00 00 00 00 00 00 00 10 ff ff ff fb \\ -05 dc 00 00 00 00 00 00 50 54 00 00 00 05 50 54 \\ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \\ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \\ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \\ -00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:705" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 0d 00 64 88 58 df c5 ff ff ff ff ff ff ff fe \ -00 10 00 00 00 00 00 00 00 00 00 10 ff ff ff fb \ -05 dc 00 00 00 00 00 00 50 54 00 00 00 05 50 54 \ -00 00 00 06 08 00 45 00 00 28 00 00 40 00 40 06 \ -b9 7c c0 a8 00 02 c0 a8 00 01 00 00 2b 60 00 00 \ -00 00 6a 4f 2b 58 50 14 00 00 6d 75 00 00 00 00 \ -00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_OUT (OF1.2) (xid=0x8858dfc5): in_port=LOCAL actions=FLOOD data_len=60 -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=11104,tcp_flags=0x014 tcp_csum:6d75 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:705" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_146 -#AT_START_147 -at_fn_group_banner 147 'ofp-print.at:720' \ - "OFPT_FLOW_MOD - OF1.0 - low verbosity" " " 15 -at_xfail=no -( - $as_echo "147. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:722: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -01 0e 00 50 00 00 00 00 00 00 00 00 00 01 50 54 \\ -00 00 00 06 50 54 00 00 00 05 ff ff 00 00 08 06 \\ -00 02 00 00 c0 a8 00 02 c0 a8 00 01 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 \\ -00 00 01 0e 00 00 00 00 00 00 00 08 00 03 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:722" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -01 0e 00 50 00 00 00 00 00 00 00 00 00 01 50 54 \ -00 00 00 06 50 54 00 00 00 05 ff ff 00 00 08 06 \ -00 02 00 00 c0 a8 00 02 c0 a8 00 01 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 \ -00 00 01 0e 00 00 00 00 00 00 00 08 00 03 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_util|INFO|normalization changed ofp_match, details: -ofp_util|INFO| pre: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0 -ofp_util|INFO|post: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (xid=0x0): ADD priority=65535,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 idle:5 buf:0x10e out_port:0 actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:722" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_147 -#AT_START_148 -at_fn_group_banner 148 'ofp-print.at:738' \ - "OFPT_FLOW_MOD - OF1.1 - low verbosity" " " 15 -at_xfail=no -( - $as_echo "148. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:740: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -020e 0090 01020304 \\ -da1aa3e035d87158 ffffffffffffffff \\ -02 01 003c 0078 9c40 ffffffff ffffffff ffffffff 0003 \\ -0000 \\ -\\ -0000 0058 00000000 000003f7 \\ -000000000000ffffffffffff 000000000000ffffffffffff \\ -0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 \\ -00000000 00 000000 0000000000000000ffffffffffffffff \\ -\\ -0001 0008 03 000000 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:740" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -020e 0090 01020304 \ -da1aa3e035d87158 ffffffffffffffff \ -02 01 003c 0078 9c40 ffffffff ffffffff ffffffff 0003 \ -0000 \ -\ -0000 0058 00000000 000003f7 \ -000000000000ffffffffffff 000000000000ffffffffffff \ -0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 \ -00000000 00 000000 0000000000000000ffffffffffffffff \ -\ -0001 0008 03 000000 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.1) (xid=0x1020304): MOD table:2 priority=40000,arp,arp_spa=192.168.128.0/24 cookie:0xda1aa3e035d87158/0xffffffffffffffff idle:60 hard:120 send_flow_rem check_overlap actions=goto_table:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:740" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_148 -#AT_START_149 -at_fn_group_banner 149 'ofp-print.at:758' \ - "OFPT_FLOW_MOD - OF1.2 - low verbosity" " " 15 -at_xfail=no -( - $as_echo "149. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:760: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \\ -50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \\ -80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \\ -00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \\ -00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \\ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:760" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \ -50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \ -80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \ -00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \ -00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.2) (xid=0x2): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:760" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_149 -#AT_START_150 -at_fn_group_banner 150 'ofp-print.at:778' \ - "OFPT_FLOW_MOD - OF1.0 - high verbosity" " " 15 -at_xfail=no -( - $as_echo "150. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:780: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -01 0e 00 50 00 00 00 00 00 00 00 00 00 01 50 54 \\ -00 00 00 06 50 54 00 00 00 05 ff ff 00 00 08 06 \\ -00 02 00 00 c0 a8 00 02 c0 a8 00 01 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 \\ -00 00 01 0e 00 00 00 00 00 00 00 08 00 03 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:780" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -01 0e 00 50 00 00 00 00 00 00 00 00 00 01 50 54 \ -00 00 00 06 50 54 00 00 00 05 ff ff 00 00 08 06 \ -00 02 00 00 c0 a8 00 02 c0 a8 00 01 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 \ -00 00 01 0e 00 00 00 00 00 00 00 08 00 03 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_util|INFO|normalization changed ofp_match, details: -ofp_util|INFO| pre: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0 -ofp_util|INFO|post: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (xid=0x0): ADD arp,in_port=1,dl_vlan=65535,dl_vlan_pcp=0,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0 idle:5 pri:65535 buf:0x10e out_port:0 actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:780" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_150 -#AT_START_151 -at_fn_group_banner 151 'ofp-print.at:796' \ - "OFPT_FLOW_MOD - OF1.2 - low verbosity" " " 15 -at_xfail=no -( - $as_echo "151. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:798: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \\ -50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \\ -80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \\ -00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \\ -00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \\ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:798" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \ -50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \ -80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \ -00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \ -00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.2) (xid=0x2): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:798" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_151 -#AT_START_152 -at_fn_group_banner 152 'ofp-print.at:815' \ - "OFPT_FLOW_MOD - OF1.3 - flags - low verbosity" " " 15 -at_xfail=no -( - $as_echo "152. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:817: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -04 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 1f 00 00 \\ -00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \\ -50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \\ -80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \\ -00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \\ -00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \\ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:817" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -04 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 1f 00 00 \ -00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \ -50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \ -80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \ -00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \ -00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.3) (xid=0x2): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 send_flow_rem check_overlap reset_counts no_packet_counts no_byte_counts actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:817" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_152 -#AT_START_153 -at_fn_group_banner 153 'ofp-print.at:833' \ - "OFPT_FLOW_MOD - OF1.2 - set-field ip_src" " " 15 -at_xfail=no -( - $as_echo "153. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:835: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 0e 00 58 52 33 45 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 16 04 \\ -c0 a8 03 5c 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:835" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 0e 00 58 52 33 45 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 16 04 \ -c0 a8 03 5c 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.2) (xid=0x52334502): ADD priority=255,ip actions=set_field:192.168.3.92->ip_src -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:835" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_153 -#AT_START_154 -at_fn_group_banner 154 'ofp-print.at:848' \ - "OFPT_FLOW_MOD - OF1.2 - set-field ip_dst" " " 15 -at_xfail=no -( - $as_echo "154. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:850: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 0e 00 58 52 33 45 07 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 18 04 \\ -c0 a8 4a 7a 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:850" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 0e 00 58 52 33 45 07 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 18 04 \ -c0 a8 4a 7a 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.2) (xid=0x52334507): ADD priority=255,ip actions=set_field:192.168.74.122->ip_dst -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:850" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_154 -#AT_START_155 -at_fn_group_banner 155 'ofp-print.at:863' \ - "OFPT_FLOW_MOD - OF1.2 - set-field sctp_src" " " 15 -at_xfail=no -( - $as_echo "155. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:865: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 0e 00 58 52 33 45 07 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 22 02 \\ -0d 06 00 00 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:865" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 0e 00 58 52 33 45 07 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 22 02 \ -0d 06 00 00 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.2) (xid=0x52334507): ADD priority=255,sctp actions=set_field:3334->sctp_src -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:865" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_155 -#AT_START_156 -at_fn_group_banner 156 'ofp-print.at:878' \ - "OFPT_FLOW_MOD - OF1.2 - set-field sctp_dst" " " 15 -at_xfail=no -( - $as_echo "156. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:880: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 0e 00 58 52 33 45 07 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 24 02 \\ -11 5d 00 00 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:880" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 0e 00 58 52 33 45 07 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 24 02 \ -11 5d 00 00 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.2) (xid=0x52334507): ADD priority=255,sctp actions=set_field:4445->sctp_dst -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:880" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_156 -#AT_START_157 -at_fn_group_banner 157 'ofp-print.at:894' \ - "OFPT_FLOW_MOD - OF1.3 - meter" " " 15 -at_xfail=no -( - $as_echo "157. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:896: ovs-ofctl ofp-print \"\\ -04 0e 00 40 cf fe 6b 86 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 e8 \\ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 01 00 04 00 00 00 00 00 06 00 08 00 00 00 01\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:896" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 0e 00 40 cf fe 6b 86 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 e8 \ -ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 01 00 04 00 00 00 00 00 06 00 08 00 00 00 01" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FLOW_MOD (OF1.3) (xid=0xcffe6b86): ADD priority=1000 actions=meter:1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:896" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_157 -#AT_START_158 -at_fn_group_banner 158 'ofp-print.at:905' \ - "OFPT_FLOW reply - OF1.2 - set-field ip_src" " " 15 -at_xfail=no -( - $as_echo "158. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:907: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 13 00 68 52 33 45 04 00 01 00 00 00 00 00 00 \\ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 16 04 \\ -c0 a8 03 5c 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:907" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 13 00 68 52 33 45 04 00 01 00 00 00 00 00 00 \ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 16 04 \ -c0 a8 03 5c 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2) (xid=0x52334504): - cookie=0x0, duration=0s, table=0, n_packets=0, n_bytes=0, priority=255,ip actions=set_field:192.168.3.92->ip_src -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:907" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_158 -#AT_START_159 -at_fn_group_banner 159 'ofp-print.at:922' \ - "OFPT_FLOW reply - OF1.2 - set-field ip_dst" " " 15 -at_xfail=no -( - $as_echo "159. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:924: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 13 00 68 52 33 45 09 00 01 00 00 00 00 00 00 \\ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 18 04 \\ -c0 a8 4a 7a 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:924" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 13 00 68 52 33 45 09 00 01 00 00 00 00 00 00 \ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 0a 80 00 0a 02 08 00 00 00 00 00 00 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 18 04 \ -c0 a8 4a 7a 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2) (xid=0x52334509): - cookie=0x0, duration=0s, table=0, n_packets=0, n_bytes=0, priority=255,ip actions=set_field:192.168.74.122->ip_dst -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:924" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_159 -#AT_START_160 -at_fn_group_banner 160 'ofp-print.at:939' \ - "OFPT_FLOW reply - OF1.2 - set-field sctp_src" " " 15 -at_xfail=no -( - $as_echo "160. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:941: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 13 00 68 52 33 45 04 00 01 00 00 00 00 00 00 \\ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 22 02 \\ -0d 06 00 00 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:941" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 13 00 68 52 33 45 04 00 01 00 00 00 00 00 00 \ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 22 02 \ -0d 06 00 00 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2) (xid=0x52334504): - cookie=0x0, duration=0s, table=0, n_packets=0, n_bytes=0, priority=255,sctp actions=set_field:3334->sctp_src -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:941" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_160 -#AT_START_161 -at_fn_group_banner 161 'ofp-print.at:956' \ - "OFPT_FLOW reply - OF1.2 - set-field sctp_dst" " " 15 -at_xfail=no -( - $as_echo "161. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:958: ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print \"\\ -03 13 00 68 52 33 45 09 00 01 00 00 00 00 00 00 \\ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \\ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 24 02 \\ -11 5d 00 00 00 00 00 00 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:958" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\ -03 13 00 68 52 33 45 09 00 01 00 00 00 00 00 00 \ -00 58 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 0f 80 00 0a 02 08 00 80 00 14 01 84 00 \ -00 04 00 18 00 00 00 00 00 19 00 10 80 00 24 02 \ -11 5d 00 00 00 00 00 00 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2) (xid=0x52334509): - cookie=0x0, duration=0s, table=0, n_packets=0, n_bytes=0, priority=255,sctp actions=set_field:4445->sctp_dst -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:958" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_161 -#AT_START_162 -at_fn_group_banner 162 'ofp-print.at:973' \ - "OFPT_PORT_MOD - OF1.0" " " 15 -at_xfail=no -( - $as_echo "162. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:975: ovs-ofctl ofp-print \"\\ -01 0f 00 20 00 00 00 03 00 03 50 54 00 00 00 01 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:975" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 0f 00 20 00 00 00 03 00 03 50 54 00 00 00 01 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_MOD (xid=0x3):port: 3: addr:50:54:00:00:00:01 - config: PORT_DOWN - mask: PORT_DOWN - advertise: UNCHANGED -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:975" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_162 -#AT_START_163 -at_fn_group_banner 163 'ofp-print.at:986' \ - "OFPT_PORT_MOD - OF1.1" " " 15 -at_xfail=no -( - $as_echo "163. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:988: ovs-ofctl ofp-print \"\\ -02 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \\ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \\ -00 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:988" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \ -00 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_MOD (OF1.1) (xid=0x3):port: 3: addr:50:54:00:00:00:01 - config: PORT_DOWN - mask: PORT_DOWN - advertise: UNCHANGED -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:988" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_163 -#AT_START_164 -at_fn_group_banner 164 'ofp-print.at:1000' \ - "OFPT_PORT_MOD - OF1.2" " " 15 -at_xfail=no -( - $as_echo "164. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1002: ovs-ofctl ofp-print \"\\ -03 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \\ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \\ -00 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1002" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \ -00 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_MOD (OF1.2) (xid=0x3):port: 3: addr:50:54:00:00:00:01 - config: PORT_DOWN - mask: PORT_DOWN - advertise: UNCHANGED -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1002" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_164 -#AT_START_165 -at_fn_group_banner 165 'ofp-print.at:1014' \ - "OFPT_PORT_MOD - OF1.3" " " 15 -at_xfail=no -( - $as_echo "165. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1016: ovs-ofctl ofp-print \"\\ -04 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \\ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \\ -00 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1016" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \ -00 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_MOD (OF1.3) (xid=0x3):port: 3: addr:50:54:00:00:00:01 - config: PORT_DOWN - mask: PORT_DOWN - advertise: UNCHANGED -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1016" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_165 -#AT_START_166 -at_fn_group_banner 166 'ofp-print.at:1028' \ - "OFPT_PORT_MOD - OF1.4" " " 15 -at_xfail=no -( - $as_echo "166. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1030: ovs-ofctl ofp-print \"\\ -05 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \\ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \\ -00 00 00 08 00 00 00 01 -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1030" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 10 00 28 00 00 00 03 00 00 00 03 00 00 00 00 \ -50 54 00 00 00 01 00 00 00 00 00 01 00 00 00 01 \ -00 00 00 08 00 00 00 01 -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PORT_MOD (OF1.4) (xid=0x3):port: 3: addr:50:54:00:00:00:01 - config: PORT_DOWN - mask: PORT_DOWN - advertise: 10MB-HD -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1030" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_166 -#AT_START_167 -at_fn_group_banner 167 'ofp-print.at:1042' \ - "OFPT_TABLE_MOD - OF1.1" " " 15 -at_xfail=no -( - $as_echo "167. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1044: ovs-ofctl ofp-print \"\\ -02 11 00 10 00 00 00 02 02 00 00 00 00 00 00 02 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1044" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 11 00 10 00 00 00 02 02 00 00 00 00 00 00 02 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_TABLE_MOD (OF1.1) (xid=0x2): table_id=2, flow_miss_config=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1044" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_167 -#AT_START_168 -at_fn_group_banner 168 'ofp-print.at:1051' \ - "OFPT_TABLE_MOD - OF1.2" " " 15 -at_xfail=no -( - $as_echo "168. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1053: ovs-ofctl ofp-print \"\\ -03 11 00 10 00 00 00 02 02 00 00 00 00 00 00 01 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1053" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 11 00 10 00 00 00 02 02 00 00 00 00 00 00 01 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_TABLE_MOD (OF1.2) (xid=0x2): table_id=2, flow_miss_config=continue -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1053" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_168 -#AT_START_169 -at_fn_group_banner 169 'ofp-print.at:1061' \ - "OFPT_TABLE_MOD - OF1.3" " " 15 -at_xfail=no -( - $as_echo "169. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1063: ovs-ofctl ofp-print \"\\ -04 11 00 10 00 00 00 02 02 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1063" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 11 00 10 00 00 00 02 02 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_TABLE_MOD (OF1.3) (xid=0x2): table_id=2, flow_miss_config=controller -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1063" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_169 -#AT_START_170 -at_fn_group_banner 170 'ofp-print.at:1070' \ - "OFPT_TABLE_MOD - OF1.4" " " 15 -at_xfail=no -( - $as_echo "170. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1072: ovs-ofctl ofp-print \"\\ -05 11 00 10 00 00 00 02 02 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1072" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 11 00 10 00 00 00 02 02 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_TABLE_MOD (OF1.4) (xid=0x2): table_id=2, flow_miss_config=controller -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1072" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_170 -#AT_START_171 -at_fn_group_banner 171 'ofp-print.at:1079' \ - "OFPST_DESC request" " " 15 -at_xfail=no -( - $as_echo "171. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1081: ovs-ofctl ofp-print \"0110000c0000000100000000\"" -at_fn_check_prepare_trace "ofp-print.at:1081" -( $at_check_trace; ovs-ofctl ofp-print "0110000c0000000100000000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_DESC request (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1081" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_171 -#AT_START_172 -at_fn_group_banner 172 'ofp-print.at:1086' \ - "OFPST_DESC reply" " " 15 -at_xfail=no -( - $as_echo "172. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1088: ovs-ofctl ofp-print \"\\ -01 11 04 2c 00 00 00 01 00 00 00 00 4e 69 63 69 \\ -72 61 2c 20 49 6e 63 2e 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 4f 70 65 6e \\ -20 76 53 77 69 74 63 68 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 31 2e 31 2e \\ -30 70 72 65 32 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 4e 6f 6e 65 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 4e 6f 6e 65 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1088" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 04 2c 00 00 00 01 00 00 00 00 4e 69 63 69 \ -72 61 2c 20 49 6e 63 2e 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 4f 70 65 6e \ -20 76 53 77 69 74 63 68 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 31 2e 31 2e \ -30 70 72 65 32 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 4e 6f 6e 65 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 4e 6f 6e 65 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_DESC reply (xid=0x1): -Manufacturer: Nicira, Inc. -Hardware: Open vSwitch -Software: 1.1.0pre2 -Serial Num: None -DP Description: None -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1088" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_172 -#AT_START_173 -at_fn_group_banner 173 'ofp-print.at:1166' \ - "OFPST_FLOW request - OF1.0" " " 15 -at_xfail=no -( - $as_echo "173. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1168: ovs-ofctl ofp-print \"\\ -01 10 00 38 00 00 00 04 00 01 00 00 00 38 20 ff \\ -ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 ff 00 ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1168" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 10 00 38 00 00 00 04 00 01 00 00 00 38 20 ff \ -ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 ff 00 ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW request (xid=0x4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1168" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_173 -#AT_START_174 -at_fn_group_banner 174 'ofp-print.at:1178' \ - "OFPST_FLOW request - OF1.2" " " 15 -at_xfail=no -( - $as_echo "174. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1180: ovs-ofctl ofp-print \"\\ -03 12 00 38 00 00 00 02 00 01 00 00 00 00 00 00 \\ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 04 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1180" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 12 00 38 00 00 00 02 00 01 00 00 00 00 00 00 \ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 04 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW request (OF1.2) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1180" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_174 -#AT_START_175 -at_fn_group_banner 175 'ofp-print.at:1190' \ - "OFPST_FLOW request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "175. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1192: ovs-ofctl ofp-print \"\\ -04 12 00 38 00 00 00 02 00 01 00 00 00 00 00 00 \\ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 04 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1192" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 12 00 38 00 00 00 02 00 01 00 00 00 00 00 00 \ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 04 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW request (OF1.3) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1192" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_175 -#AT_START_176 -at_fn_group_banner 176 'ofp-print.at:1202' \ - "OFPST_FLOW reply - OF1.0" " " 15 -at_xfail=no -( - $as_echo "176. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1204: ovs-ofctl ofp-print \"\\ -01 11 01 e4 00 00 00 04 00 01 00 00 00 60 00 00 \\ -00 00 00 00 00 03 50 54 00 00 00 05 50 54 00 00 \\ -00 06 ff ff 00 00 08 06 00 02 00 00 c0 a8 00 01 \\ -c0 a8 00 02 00 00 00 00 00 00 00 04 0b eb c2 00 \\ -ff ff 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 \\ -00 00 00 3c 00 00 00 08 00 01 00 00 00 60 00 00 \\ -00 00 00 00 00 01 50 54 00 00 00 06 50 54 00 00 \\ -00 05 ff ff 00 00 08 00 00 01 00 00 c0 a8 00 02 \\ -c0 a8 00 01 00 00 00 00 00 00 00 08 35 a4 e9 00 \\ -ff ff 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 00 \\ -00 00 04 fa 00 00 00 08 00 03 00 00 00 60 00 00 \\ -00 00 00 00 00 01 50 54 00 00 00 06 50 54 00 00 \\ -00 05 ff ff 00 00 08 06 00 01 00 00 c0 a8 00 02 \\ -c0 a8 00 01 00 00 00 00 00 00 00 04 10 b0 76 00 \\ -ff ff 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 \\ -00 00 00 3c 00 00 00 08 00 03 00 00 00 60 00 00 \\ -00 00 00 01 00 03 50 54 00 00 00 05 50 54 00 00 \\ -00 06 ff ff 00 00 08 00 00 01 00 00 c0 a8 00 01 \\ -c0 a8 00 02 00 08 00 00 00 00 00 09 05 b8 d8 00 \\ -80 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 00 \\ -00 00 04 fa 00 00 00 08 00 01 00 00 \\ -00 58 02 00 00 3f ff ff 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1204" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 01 e4 00 00 00 04 00 01 00 00 00 60 00 00 \ -00 00 00 00 00 03 50 54 00 00 00 05 50 54 00 00 \ -00 06 ff ff 00 00 08 06 00 02 00 00 c0 a8 00 01 \ -c0 a8 00 02 00 00 00 00 00 00 00 04 0b eb c2 00 \ -ff ff 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 \ -00 00 00 3c 00 00 00 08 00 01 00 00 00 60 00 00 \ -00 00 00 00 00 01 50 54 00 00 00 06 50 54 00 00 \ -00 05 ff ff 00 00 08 00 00 01 00 00 c0 a8 00 02 \ -c0 a8 00 01 00 00 00 00 00 00 00 08 35 a4 e9 00 \ -ff ff 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 00 \ -00 00 04 fa 00 00 00 08 00 03 00 00 00 60 00 00 \ -00 00 00 00 00 01 50 54 00 00 00 06 50 54 00 00 \ -00 05 ff ff 00 00 08 06 00 01 00 00 c0 a8 00 02 \ -c0 a8 00 01 00 00 00 00 00 00 00 04 10 b0 76 00 \ -ff ff 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 \ -00 00 00 3c 00 00 00 08 00 03 00 00 00 60 00 00 \ -00 00 00 01 00 03 50 54 00 00 00 05 50 54 00 00 \ -00 06 ff ff 00 00 08 00 00 01 00 00 c0 a8 00 01 \ -c0 a8 00 02 00 08 00 00 00 00 00 09 05 b8 d8 00 \ -80 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 00 \ -00 00 04 fa 00 00 00 08 00 01 00 00 \ -00 58 02 00 00 3f ff ff 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (xid=0x4): - cookie=0x0, duration=4.200s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,arp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0 actions=output:1 - cookie=0x0, duration=8.900s, table=0, n_packets=13, n_bytes=1274, idle_timeout=5, priority=65535,icmp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,icmp_type=0,icmp_code=0 actions=output:3 - cookie=0x0, duration=4.280s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=1,nw_tos=0,tp_src=0,tp_dst=0 actions=output:3 - cookie=0x0, duration=9.096s, table=0, n_packets=13, n_bytes=1274, idle_timeout=5, icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,icmp_type=8,icmp_code=0 actions=output:1 - cookie=0x0, duration=0s, table=2, n_packets=0, n_bytes=0, actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1204" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_176 -#AT_START_177 -at_fn_group_banner 177 'ofp-print.at:1246' \ - "OFPST_FLOW reply - OF1.2" " " 15 -at_xfail=no -( - $as_echo "177. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1248: ovs-ofctl ofp-print \"\\ -03 13 01 78 00 00 00 02 00 01 00 00 00 00 00 00 \\ -00 78 00 00 00 00 00 03 01 5e f3 c0 80 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 62 \\ -00 01 00 2d 80 00 00 04 00 00 00 02 80 00 06 06 \\ -ca da ad d6 0d 37 80 00 0a 02 08 00 80 00 10 01 \\ -00 80 00 04 08 00 00 00 00 00 00 00 00 00 00 00 \\ -00 04 00 18 00 00 00 00 00 00 00 10 00 00 00 02 \\ -05 dc 00 00 00 00 00 00 00 78 00 00 00 00 00 04 \\ -20 7c 0a 40 80 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 \\ -00 00 00 00 00 00 00 8c 00 01 00 2d 80 00 00 04 \\ -00 00 00 02 80 00 06 06 52 54 00 c3 00 89 80 00 \\ -0a 02 08 00 80 00 10 01 00 80 00 04 08 00 00 00 \\ -00 00 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \\ -00 00 00 10 00 00 00 02 05 dc 00 00 00 00 00 00 \\ -00 78 00 00 00 00 00 04 20 a9 d1 00 80 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 2a \\ -00 01 00 2d 80 00 00 04 00 00 00 02 80 00 06 06 \\ -52 54 00 97 00 69 80 00 0a 02 08 00 80 00 10 01 \\ -00 80 00 04 08 00 00 00 00 00 00 00 00 00 00 00 \\ -00 04 00 18 00 00 00 00 00 00 00 10 00 00 00 02 \\ -05 dc 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1248" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 13 01 78 00 00 00 02 00 01 00 00 00 00 00 00 \ -00 78 00 00 00 00 00 03 01 5e f3 c0 80 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 62 \ -00 01 00 2d 80 00 00 04 00 00 00 02 80 00 06 06 \ -ca da ad d6 0d 37 80 00 0a 02 08 00 80 00 10 01 \ -00 80 00 04 08 00 00 00 00 00 00 00 00 00 00 00 \ -00 04 00 18 00 00 00 00 00 00 00 10 00 00 00 02 \ -05 dc 00 00 00 00 00 00 00 78 00 00 00 00 00 04 \ -20 7c 0a 40 80 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 \ -00 00 00 00 00 00 00 8c 00 01 00 2d 80 00 00 04 \ -00 00 00 02 80 00 06 06 52 54 00 c3 00 89 80 00 \ -0a 02 08 00 80 00 10 01 00 80 00 04 08 00 00 00 \ -00 00 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \ -00 00 00 10 00 00 00 02 05 dc 00 00 00 00 00 00 \ -00 78 00 00 00 00 00 04 20 a9 d1 00 80 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 2a \ -00 01 00 2d 80 00 00 04 00 00 00 02 80 00 06 06 \ -52 54 00 97 00 69 80 00 0a 02 08 00 80 00 10 01 \ -00 80 00 04 08 00 00 00 00 00 00 00 00 00 00 00 \ -00 04 00 18 00 00 00 00 00 00 00 10 00 00 00 02 \ -05 dc 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2) (xid=0x2): - cookie=0x0, duration=3.023s, table=0, n_packets=1, n_bytes=98, ip,metadata=0,in_port=2,dl_dst=ca:da:ad:d6:0d:37,nw_tos=0 actions=output:2 - cookie=0x0, duration=4.545s, table=0, n_packets=2, n_bytes=140, ip,metadata=0,in_port=2,dl_dst=52:54:00:c3:00:89,nw_tos=0 actions=output:2 - cookie=0x0, duration=4.548s, table=0, n_packets=1, n_bytes=42, ip,metadata=0,in_port=2,dl_dst=52:54:00:97:00:69,nw_tos=0 actions=output:2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1248" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_177 -#AT_START_178 -at_fn_group_banner 178 'ofp-print.at:1281' \ - "OFPST_AGGREGATE request - OF1.0" " " 15 -at_xfail=no -( - $as_echo "178. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1283: ovs-ofctl ofp-print \"\\ -01 10 00 38 00 00 00 04 00 02 00 00 00 38 20 ff \\ -ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 ff 00 ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1283" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 10 00 38 00 00 00 04 00 02 00 00 00 38 20 ff \ -ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 ff 00 ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE request (xid=0x4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1283" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_178 -#AT_START_179 -at_fn_group_banner 179 'ofp-print.at:1293' \ - "OFPST_AGGREGATE request - OF1.2" " " 15 -at_xfail=no -( - $as_echo "179. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1295: ovs-ofctl ofp-print \"\\ -03 12 00 38 00 00 00 02 00 02 00 00 00 00 00 00 \\ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 04 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1295" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 12 00 38 00 00 00 02 00 02 00 00 00 00 00 00 \ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 04 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE request (OF1.2) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1295" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_179 -#AT_START_180 -at_fn_group_banner 180 'ofp-print.at:1305' \ - "OFPST_AGGREGATE request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "180. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1307: ovs-ofctl ofp-print \"\\ -04 12 00 38 00 00 00 02 00 02 00 00 00 00 00 00 \\ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 01 00 04 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1307" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 12 00 38 00 00 00 02 00 02 00 00 00 00 00 00 \ -ff 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 01 00 04 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE request (OF1.3) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1307" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_180 -#AT_START_181 -at_fn_group_banner 181 'ofp-print.at:1317' \ - "OFPST_AGGREGATE reply - OF1.0" " " 15 -at_xfail=no -( - $as_echo "181. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1319: ovs-ofctl ofp-print \"\\ -01 11 00 24 00 00 00 04 00 02 00 00 00 00 00 00 \\ -00 00 01 82 00 00 00 00 00 00 93 78 00 00 00 04 \\ -00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1319" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 00 24 00 00 00 04 00 02 00 00 00 00 00 00 \ -00 00 01 82 00 00 00 00 00 00 93 78 00 00 00 04 \ -00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE reply (xid=0x4): packet_count=386 byte_count=37752 flow_count=4 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1319" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_181 -#AT_START_182 -at_fn_group_banner 182 'ofp-print.at:1328' \ - "OFPST_AGGREGATE reply - OF1.2" " " 15 -at_xfail=no -( - $as_echo "182. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1330: ovs-ofctl ofp-print \"\\ -03 13 00 28 00 00 00 02 00 02 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 79 00 00 00 00 00 00 4b 4f \\ -00 00 00 03 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1330" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 13 00 28 00 00 00 02 00 02 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 79 00 00 00 00 00 00 4b 4f \ -00 00 00 03 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE reply (OF1.2) (xid=0x2): packet_count=121 byte_count=19279 flow_count=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1330" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_182 -#AT_START_183 -at_fn_group_banner 183 'ofp-print.at:1339' \ - "OFPST_AGGREGATE reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "183. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1341: ovs-ofctl ofp-print \"\\ -04 13 00 28 00 00 00 02 00 02 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 79 00 00 00 00 00 00 4b 4f \\ -00 00 00 03 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1341" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 00 28 00 00 00 02 00 02 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 79 00 00 00 00 00 00 4b 4f \ -00 00 00 03 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE reply (OF1.3) (xid=0x2): packet_count=121 byte_count=19279 flow_count=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1341" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_183 -#AT_START_184 -at_fn_group_banner 184 'ofp-print.at:1350' \ - "OFPST_TABLE request - OF1.0" " " 15 -at_xfail=no -( - $as_echo "184. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1352: ovs-ofctl ofp-print \"0110000c0000000100030000\"" -at_fn_check_prepare_trace "ofp-print.at:1352" -( $at_check_trace; ovs-ofctl ofp-print "0110000c0000000100030000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_TABLE request (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1352" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_184 -#AT_START_185 -at_fn_group_banner 185 'ofp-print.at:1357' \ - "OFPST_TABLE request - OF1.1" " " 15 -at_xfail=no -( - $as_echo "185. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1359: ovs-ofctl ofp-print \"02120010000000020003000000000000\"" -at_fn_check_prepare_trace "ofp-print.at:1359" -( $at_check_trace; ovs-ofctl ofp-print "02120010000000020003000000000000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_TABLE request (OF1.1) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1359" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_185 -#AT_START_186 -at_fn_group_banner 186 'ofp-print.at:1364' \ - "OFPST_TABLE request - OF1.2" " " 15 -at_xfail=no -( - $as_echo "186. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1366: ovs-ofctl ofp-print \"03120010000000020003000000000000\"" -at_fn_check_prepare_trace "ofp-print.at:1366" -( $at_check_trace; ovs-ofctl ofp-print "03120010000000020003000000000000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_TABLE request (OF1.2) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1366" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_186 -#AT_START_187 -at_fn_group_banner 187 'ofp-print.at:1371' \ - "OFPST_TABLE request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "187. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1373: ovs-ofctl ofp-print \"04120010000000020003000000000000\"" -at_fn_check_prepare_trace "ofp-print.at:1373" -( $at_check_trace; ovs-ofctl ofp-print "04120010000000020003000000000000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_TABLE request (OF1.3) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1373" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_187 -#AT_START_188 -at_fn_group_banner 188 'ofp-print.at:1378' \ - "OFPST_TABLE reply - OF1.0" " " 15 -at_xfail=no -( - $as_echo "188. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1380: ovs-ofctl ofp-print \"\\ -01 11 00 4c 00 00 00 01 00 03 00 00 00 00 00 00 \\ -63 6c 61 73 73 69 66 69 65 72 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 3f ff ff 00 10 00 00 00 00 00 0b 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1380" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 00 4c 00 00 00 01 00 03 00 00 00 00 00 00 \ -63 6c 61 73 73 69 66 69 65 72 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 3f ff ff 00 10 00 00 00 00 00 0b 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_TABLE reply (xid=0x1): 1 tables - 0: classifier: wild=0x3fffff, max=1048576, active=11 - lookup=0, matched=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1380" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_188 -#AT_START_189 -at_fn_group_banner 189 'ofp-print.at:1393' \ - "OFPST_TABLE reply - OF1.2" " " 15 -at_xfail=no -( - $as_echo "189. $at_setup_line: testing $at_desc ..." - $at_traceon - - -(mid="wild=0xfffffffff, max=1000000," - tail=" - match=0xfffffffff, instructions=0x00000007, config=0x00000000 - write_actions=0x00000000, apply_actions=0x00000000 - write_setfields=0x0000000fffffffff - apply_setfields=0x0000000fffffffff - metadata_match=0x0000000000000000 - metadata_write=0x0000000000000000" - echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 255 tables - 0: classifier: $mid active=1 - lookup=74614, matched=106024$tail" - x=1 - while test $x -lt 254; do - printf " %d: %-8s: $mid active=0 - lookup=0, matched=0$tail -" $x table$x - x=`expr $x + 1` - done - echo " 254: table254: $mid active=2 - lookup=0, matched=0$tail") > expout - -(pad32="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - pad7="00 00 00 00 00 00 00 " - mid="00 00 00 0f ff ff ff ff \ -00 00 00 0f ff ff ff ff 00 00 00 00 00 00 00 00 \ -00 00 00 0f ff ff ff ff 00 00 00 0f ff ff ff ff \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 07 00 00 00 00 00 0f 42 40 " - tail="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" - - echo -n "03 13 7f 90 00 00 00 02 00 03 00 00 00 00 00 00 " - - x=0 - printf "%02x $pad7" $x - printf "%s$pad32" "classifier" | od -A n -t x1 -v -N 32 | tr '\n' ' ' - echo -n "$mid 00 00 00 01 " - echo -n "00 00 00 00 00 01 23 76 00 00 00 00 00 01 9e 28 " - - x=1 - while test $x -lt 254; do - printf "%02x $pad7" $x - printf "%s$pad32" "table$x" | od -A n -t x1 -v -N 32 | tr '\n' ' ' - echo -n "$mid 00 00 00 00 $tail " - x=`expr $x + 1` - done - - x=254 - printf "%02x $pad7" $x - printf "%s$pad32" "table$x" | od -A n -t x1 -v -N 32 | tr '\n' ' ' - echo -n "$mid 00 00 00 02 $tail") > in -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1445: ovs-ofctl ofp-print \"\$(cat in)\"" -at_fn_check_prepare_notrace 'a $(...) command substitution' "ofp-print.at:1445" -( $at_check_trace; ovs-ofctl ofp-print "$(cat in)" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1445" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_189 -#AT_START_190 -at_fn_group_banner 190 'ofp-print.at:1448' \ - "OFPST_TABLE reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "190. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1450: ovs-ofctl ofp-print \"\\ -04 13 00 40 00 00 00 01 00 03 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 0b 00 00 00 00 00 00 02 00 \\ -00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 0c \\ -00 00 00 00 00 00 02 01 00 00 00 00 00 00 01 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1450" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 00 40 00 00 00 01 00 03 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 0b 00 00 00 00 00 00 02 00 \ -00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 0c \ -00 00 00 00 00 00 02 01 00 00 00 00 00 00 01 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_TABLE reply (OF1.3) (xid=0x1): 2 tables - 0: active=11, lookup=512, matched=256 - 1: active=12, lookup=513, matched=257 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1450" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_190 -#AT_START_191 -at_fn_group_banner 191 'ofp-print.at:1462' \ - "OFPST_PORT request - 1.0" " " 15 -at_xfail=no -( - $as_echo "191. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1464: ovs-ofctl ofp-print \"\\ -01 10 00 14 00 00 00 01 00 04 00 00 ff ff 00 00 \\ -00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1464" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 10 00 14 00 00 00 01 00 04 00 00 ff ff 00 00 \ -00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT request (xid=0x1): port_no=ANY -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1464" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_191 -#AT_START_192 -at_fn_group_banner 192 'ofp-print.at:1472' \ - "OFPST_PORT request - 1.1" " " 15 -at_xfail=no -( - $as_echo "192. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1474: ovs-ofctl ofp-print \"\\ -02 12 00 18 00 00 00 02 00 04 00 00 00 00 00 00 \\ -ff ff ff ff 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1474" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 12 00 18 00 00 00 02 00 04 00 00 00 00 00 00 \ -ff ff ff ff 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT request (OF1.1) (xid=0x2): port_no=ANY -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1474" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_192 -#AT_START_193 -at_fn_group_banner 193 'ofp-print.at:1482' \ - "OFPST_PORT request - 1.2" " " 15 -at_xfail=no -( - $as_echo "193. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1484: ovs-ofctl ofp-print \"\\ -03 12 00 18 00 00 00 02 00 04 00 00 00 00 00 00 \\ -ff ff ff ff 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1484" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 12 00 18 00 00 00 02 00 04 00 00 00 00 00 00 \ -ff ff ff ff 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT request (OF1.2) (xid=0x2): port_no=ANY -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1484" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_193 -#AT_START_194 -at_fn_group_banner 194 'ofp-print.at:1492' \ - "OFPST_PORT request - 1.3" " " 15 -at_xfail=no -( - $as_echo "194. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1494: ovs-ofctl ofp-print \"\\ -04 12 00 18 00 00 00 02 00 04 00 00 00 00 00 00 \\ -ff ff ff ff 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1494" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 12 00 18 00 00 00 02 00 04 00 00 00 00 00 00 \ -ff ff ff ff 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT request (OF1.3) (xid=0x2): port_no=ANY -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1494" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_194 -#AT_START_195 -at_fn_group_banner 195 'ofp-print.at:1502' \ - "OFPST_PORT reply - OF1.0" " " 15 -at_xfail=no -( - $as_echo "195. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1504: ovs-ofctl ofp-print \"\\ -01 11 01 ac 00 00 00 01 00 04 00 00 00 03 00 00 \\ -00 00 00 00 00 00 00 00 00 00 4d 20 00 00 00 00 \\ -00 00 14 32 00 00 00 00 00 0f 60 4e 00 00 00 00 \\ -00 05 71 bc 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 ff fe 00 00 00 00 00 00 00 00 00 00 \\ -00 00 02 ac 00 00 00 00 00 00 01 f5 00 00 00 00 \\ -00 01 0c 8c 00 00 00 00 00 00 db 1c 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 \\ -00 00 00 00 00 00 00 00 00 00 06 be 00 00 00 00 \\ -00 00 05 84 00 00 00 00 00 02 34 b4 00 00 00 00 \\ -00 02 23 d4 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 \\ -00 00 14 12 00 00 00 00 00 00 14 66 00 00 00 00 \\ -00 04 a2 54 00 00 00 00 00 05 8a 1e 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1504" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 01 ac 00 00 00 01 00 04 00 00 00 03 00 00 \ -00 00 00 00 00 00 00 00 00 00 4d 20 00 00 00 00 \ -00 00 14 32 00 00 00 00 00 0f 60 4e 00 00 00 00 \ -00 05 71 bc 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 ff fe 00 00 00 00 00 00 00 00 00 00 \ -00 00 02 ac 00 00 00 00 00 00 01 f5 00 00 00 00 \ -00 01 0c 8c 00 00 00 00 00 00 db 1c 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 \ -00 00 00 00 00 00 00 00 00 00 06 be 00 00 00 00 \ -00 00 05 84 00 00 00 00 00 02 34 b4 00 00 00 00 \ -00 02 23 d4 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 \ -00 00 14 12 00 00 00 00 00 00 14 66 00 00 00 00 \ -00 04 a2 54 00 00 00 00 00 05 8a 1e 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (xid=0x1): 4 ports - port 3: rx pkts=19744, bytes=1007694, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=5170, bytes=356796, drop=0, errs=0, coll=0 - port LOCAL: rx pkts=684, bytes=68748, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=501, bytes=56092, drop=0, errs=0, coll=0 - port 2: rx pkts=1726, bytes=144564, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=1412, bytes=140244, drop=0, errs=0, coll=0 - port 1: rx pkts=5138, bytes=303700, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=5222, bytes=363038, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1504" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_195 -#AT_START_196 -at_fn_group_banner 196 'ofp-print.at:1545' \ - "OFPST_PORT reply - OF1.2" " " 15 -at_xfail=no -( - $as_echo "196. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1547: ovs-ofctl ofp-print \"\\ -03 13 01 48 00 00 00 02 00 04 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 00 00 00 00 00 00 01 95 56 \\ -00 00 00 00 00 00 00 88 00 00 00 00 02 5d 08 98 \\ -00 00 00 00 00 00 2c f8 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 ff ff ff fe 00 00 00 00 \\ -00 00 00 00 00 00 00 44 00 00 00 00 00 00 9d 2c \\ -00 00 00 00 00 00 16 7c 00 00 00 00 01 1e 36 44 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 44 \\ -00 00 00 00 00 00 9d 2c 00 00 00 00 00 00 16 7c \\ -00 00 00 00 01 1e 36 44 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1547" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 13 01 48 00 00 00 02 00 04 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 00 00 00 00 00 00 01 95 56 \ -00 00 00 00 00 00 00 88 00 00 00 00 02 5d 08 98 \ -00 00 00 00 00 00 2c f8 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 ff ff ff fe 00 00 00 00 \ -00 00 00 00 00 00 00 44 00 00 00 00 00 00 9d 2c \ -00 00 00 00 00 00 16 7c 00 00 00 00 01 1e 36 44 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 44 \ -00 00 00 00 00 00 9d 2c 00 00 00 00 00 00 16 7c \ -00 00 00 00 01 1e 36 44 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (OF1.2) (xid=0x2): 3 ports - port 2: rx pkts=103766, bytes=39651480, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=136, bytes=11512, drop=0, errs=0, coll=0 - port LOCAL: rx pkts=68, bytes=5756, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=40236, bytes=18757188, drop=0, errs=0, coll=0 - port 1: rx pkts=68, bytes=5756, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=40236, bytes=18757188, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1547" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_196 -#AT_START_197 -at_fn_group_banner 197 'ofp-print.at:1580' \ - "OFPST_PORT reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "197. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1582: ovs-ofctl ofp-print \"\\ -04 13 01 60 00 00 00 02 00 04 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 00 00 00 00 00 00 01 95 56 \\ -00 00 00 00 00 00 00 88 00 00 00 00 02 5d 08 98 \\ -00 00 00 00 00 00 2c f8 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 01 00 0f 42 40 \\ -ff ff ff fe 00 00 00 00 \\ -00 00 00 00 00 00 00 44 00 00 00 00 00 00 9d 2c \\ -00 00 00 00 00 00 16 7c 00 00 00 00 01 1e 36 44 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -ff ff ff ff ff ff ff ff \\ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 44 \\ -00 00 00 00 00 00 9d 2c 00 00 00 00 00 00 16 7c \\ -00 00 00 00 01 1e 36 44 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 07 54 d4 c0 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1582" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 01 60 00 00 00 02 00 04 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 00 00 00 00 00 00 01 95 56 \ -00 00 00 00 00 00 00 88 00 00 00 00 02 5d 08 98 \ -00 00 00 00 00 00 2c f8 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 01 00 0f 42 40 \ -ff ff ff fe 00 00 00 00 \ -00 00 00 00 00 00 00 44 00 00 00 00 00 00 9d 2c \ -00 00 00 00 00 00 16 7c 00 00 00 00 01 1e 36 44 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -ff ff ff ff ff ff ff ff \ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 44 \ -00 00 00 00 00 00 9d 2c 00 00 00 00 00 00 16 7c \ -00 00 00 00 01 1e 36 44 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 07 54 d4 c0 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (OF1.3) (xid=0x2): 3 ports - port 2: rx pkts=103766, bytes=39651480, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=136, bytes=11512, drop=0, errs=0, coll=0 - duration=1.001s - port LOCAL: rx pkts=68, bytes=5756, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=40236, bytes=18757188, drop=0, errs=0, coll=0 - port 1: rx pkts=68, bytes=5756, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=40236, bytes=18757188, drop=0, errs=0, coll=0 - duration=0.123s -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1582" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_197 -#AT_START_198 -at_fn_group_banner 198 'ofp-print.at:1619' \ - "OFPST_PORT reply - OF1.4" " " 15 -at_xfail=no -( - $as_echo "198. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1621: ovs-ofctl ofp-print \"\\ -05 13 00 88 00 00 00 02 00 04 00 00 00 00 00 00 \\ -00 78 00 00 00 00 00 02 00 00 00 01 00 0f 42 40 \\ -00 00 00 00 00 01 95 56 00 00 00 00 00 00 00 88 \\ -00 00 00 00 02 5d 08 98 00 00 00 00 00 00 2c f8 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 fc \\ -00 00 00 00 00 00 00 fd 00 00 00 00 00 00 00 fe \\ -00 00 00 00 00 00 00 ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1621" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 13 00 88 00 00 00 02 00 04 00 00 00 00 00 00 \ -00 78 00 00 00 00 00 02 00 00 00 01 00 0f 42 40 \ -00 00 00 00 00 01 95 56 00 00 00 00 00 00 00 88 \ -00 00 00 00 02 5d 08 98 00 00 00 00 00 00 2c f8 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 fc \ -00 00 00 00 00 00 00 fd 00 00 00 00 00 00 00 fe \ -00 00 00 00 00 00 00 ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (OF1.4) (xid=0x2): 1 ports - port 2: rx pkts=103766, bytes=39651480, drop=0, errs=0, frame=252, over=253, crc=254 - tx pkts=136, bytes=11512, drop=0, errs=0, coll=255 - duration=1.001s -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1621" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_198 -#AT_START_199 -at_fn_group_banner 199 'ofp-print.at:1639' \ - "OFPST_QUEUE request - OF1.0" " " 15 -at_xfail=no -( - $as_echo "199. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1641: ovs-ofctl ofp-print \"\\ -01 10 00 14 00 00 00 01 00 05 00 00 ff fc 00 00 \\ -ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1641" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 10 00 14 00 00 00 01 00 05 00 00 ff fc 00 00 \ -ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE request (xid=0x1):port=ANY queue=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1641" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_199 -#AT_START_200 -at_fn_group_banner 200 'ofp-print.at:1649' \ - "OFPST_QUEUE request - OF1.1" " " 15 -at_xfail=no -( - $as_echo "200. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1651: ovs-ofctl ofp-print \"\\ -02 12 00 18 00 00 00 02 00 05 00 00 00 00 00 00 \\ -ff ff ff ff ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1651" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 12 00 18 00 00 00 02 00 05 00 00 00 00 00 00 \ -ff ff ff ff ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE request (OF1.1) (xid=0x2):port=ANY queue=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1651" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_200 -#AT_START_201 -at_fn_group_banner 201 'ofp-print.at:1659' \ - "OFPST_QUEUE request - OF1.2" " " 15 -at_xfail=no -( - $as_echo "201. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1661: ovs-ofctl ofp-print \"\\ -03 12 00 18 00 00 00 02 00 05 00 00 00 00 00 00 \\ -ff ff ff ff ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1661" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 12 00 18 00 00 00 02 00 05 00 00 00 00 00 00 \ -ff ff ff ff ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE request (OF1.2) (xid=0x2):port=ANY queue=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1661" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_201 -#AT_START_202 -at_fn_group_banner 202 'ofp-print.at:1669' \ - "OFPST_QUEUE request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "202. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1671: ovs-ofctl ofp-print \"\\ -04 12 00 18 00 00 00 02 00 05 00 00 00 00 00 00 \\ -ff ff ff ff ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1671" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 12 00 18 00 00 00 02 00 05 00 00 00 00 00 00 \ -ff ff ff ff ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE request (OF1.3) (xid=0x2):port=ANY queue=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1671" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_202 -#AT_START_203 -at_fn_group_banner 203 'ofp-print.at:1679' \ - "OFPST_QUEUE reply - OF1.0" " " 15 -at_xfail=no -( - $as_echo "203. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1681: ovs-ofctl ofp-print \"\\ -01 11 00 cc 00 00 00 01 00 05 00 00 00 03 00 00 \\ -00 00 00 01 00 00 00 00 00 00 01 2e 00 00 00 00 \\ -00 00 00 01 00 00 00 00 00 00 00 00 00 03 00 00 \\ -00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 \\ -00 00 00 01 00 00 00 00 00 00 08 34 00 00 00 00 \\ -00 00 00 14 00 00 00 00 00 00 00 00 00 02 00 00 \\ -00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 \\ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 \\ -00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1681" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 00 cc 00 00 00 01 00 05 00 00 00 03 00 00 \ -00 00 00 01 00 00 00 00 00 00 01 2e 00 00 00 00 \ -00 00 00 01 00 00 00 00 00 00 00 00 00 03 00 00 \ -00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 \ -00 00 00 01 00 00 00 00 00 00 08 34 00 00 00 00 \ -00 00 00 14 00 00 00 00 00 00 00 00 00 02 00 00 \ -00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 \ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 \ -00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply (xid=0x1): 6 queues - port 3 queue 1: bytes=302, pkts=1, errors=0, duration=? - port 3 queue 2: bytes=0, pkts=0, errors=0, duration=? - port 2 queue 1: bytes=2100, pkts=20, errors=0, duration=? - port 2 queue 2: bytes=0, pkts=0, errors=0, duration=? - port 1 queue 1: bytes=0, pkts=0, errors=0, duration=? - port 1 queue 2: bytes=0, pkts=0, errors=0, duration=? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1681" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_203 -#AT_START_204 -at_fn_group_banner 204 'ofp-print.at:1706' \ - "OFPST_QUEUE reply - OF1.1" " " 15 -at_xfail=no -( - $as_echo "204. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1708: ovs-ofctl ofp-print \"\\ -02 13 00 d0 00 00 00 01 00 05 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \\ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1708" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 13 00 d0 00 00 00 01 00 05 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply (OF1.1) (xid=0x1): 6 queues - port 3 queue 1: bytes=302, pkts=1, errors=0, duration=? - port 3 queue 2: bytes=0, pkts=0, errors=0, duration=? - port 2 queue 1: bytes=2100, pkts=20, errors=0, duration=? - port 2 queue 2: bytes=0, pkts=0, errors=0, duration=? - port 1 queue 1: bytes=0, pkts=0, errors=0, duration=? - port 1 queue 2: bytes=0, pkts=0, errors=0, duration=? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1708" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_204 -#AT_START_205 -at_fn_group_banner 205 'ofp-print.at:1733' \ - "OFPST_QUEUE reply - OF1.2" " " 15 -at_xfail=no -( - $as_echo "205. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1735: ovs-ofctl ofp-print \"\\ -03 13 00 d0 00 00 00 01 00 05 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \\ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1735" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 13 00 d0 00 00 00 01 00 05 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply (OF1.2) (xid=0x1): 6 queues - port 3 queue 1: bytes=302, pkts=1, errors=0, duration=? - port 3 queue 2: bytes=0, pkts=0, errors=0, duration=? - port 2 queue 1: bytes=2100, pkts=20, errors=0, duration=? - port 2 queue 2: bytes=0, pkts=0, errors=0, duration=? - port 1 queue 1: bytes=0, pkts=0, errors=0, duration=? - port 1 queue 2: bytes=0, pkts=0, errors=0, duration=? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1735" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_205 -#AT_START_206 -at_fn_group_banner 206 'ofp-print.at:1760' \ - "OFPST_QUEUE reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "206. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1762: ovs-ofctl ofp-print \"\\ -04 13 01 00 00 00 00 01 00 05 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 \\ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 \\ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \\ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 \\ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 \\ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -ff ff ff ff ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1762" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 01 00 00 00 00 01 00 05 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 \ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 \ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 \ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 \ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -ff ff ff ff ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply (OF1.3) (xid=0x1): 6 queues - port 3 queue 1: bytes=302, pkts=1, errors=0, duration=100.500s - port 3 queue 2: bytes=0, pkts=0, errors=0, duration=100.500s - port 2 queue 1: bytes=2100, pkts=20, errors=0, duration=100.500s - port 2 queue 2: bytes=0, pkts=0, errors=0, duration=100.500s - port 1 queue 1: bytes=0, pkts=0, errors=0, duration=100.500s - port 1 queue 2: bytes=0, pkts=0, errors=0, duration=? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1762" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_206 -#AT_START_207 -at_fn_group_banner 207 'ofp-print.at:1793' \ - "OFPST_QUEUE reply - OF1.4" " " 15 -at_xfail=no -( - $as_echo "207. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1795: ovs-ofctl ofp-print \"\\ -05 13 01 30 00 00 00 01 00 05 00 00 00 00 00 00 \\ -00 30 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \\ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \\ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \\ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \\ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -ff ff ff ff ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1795" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 13 01 30 00 00 00 01 00 05 00 00 00 00 00 00 \ -00 30 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 01 00 00 00 00 00 00 01 2e \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \ -00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 01 00 00 00 00 00 00 08 34 \ -00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \ -00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 64 1d cd 65 00 00 30 00 00 00 00 00 00 \ -00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -ff ff ff ff ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply (OF1.4) (xid=0x1): 6 queues - port 3 queue 1: bytes=302, pkts=1, errors=0, duration=100.500s - port 3 queue 2: bytes=0, pkts=0, errors=0, duration=100.500s - port 2 queue 1: bytes=2100, pkts=20, errors=0, duration=100.500s - port 2 queue 2: bytes=0, pkts=0, errors=0, duration=100.500s - port 1 queue 1: bytes=0, pkts=0, errors=0, duration=100.500s - port 1 queue 2: bytes=0, pkts=0, errors=0, duration=? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1795" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_207 -#AT_START_208 -at_fn_group_banner 208 'ofp-print.at:1827' \ - "OFPST_GROUP request" " " 15 -at_xfail=no -( - $as_echo "208. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1829: ovs-ofctl ofp-print \"\\ -02 12 00 18 00 00 00 02 00 06 00 00 00 00 00 00 \\ -ff ff ff ff 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1829" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 12 00 18 00 00 00 02 00 06 00 00 00 00 00 00 \ -ff ff ff ff 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP request (OF1.1) (xid=0x2): group_id=ANY -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1829" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_208 -#AT_START_209 -at_fn_group_banner 209 'ofp-print.at:1836' \ - "OFPST_GROUP reply - OF1.1" " " 15 -at_xfail=no -( - $as_echo "209. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1838: ovs-ofctl ofp-print \"\\ -02 13 00 a0 00 00 00 02 00 06 00 00 00 00 00 00 \\ -00 50 00 00 87 65 43 21 00 00 00 04 00 00 00 00 \\ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -00 00 00 00 00 00 66 66 00 00 00 00 00 33 33 33 \\ -00 40 00 00 00 00 00 05 00 00 00 02 00 00 00 00 \\ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1838" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 13 00 a0 00 00 00 02 00 06 00 00 00 00 00 00 \ -00 50 00 00 87 65 43 21 00 00 00 04 00 00 00 00 \ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -00 00 00 00 00 00 66 66 00 00 00 00 00 33 33 33 \ -00 40 00 00 00 00 00 05 00 00 00 02 00 00 00 00 \ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP reply (OF1.1) (xid=0x2): - group_id=2271560481,ref_count=4,packet_count=34952,byte_count=7829367,bucket0:packet_count=4369,byte_count=2236962,bucket1:packet_count=4369,byte_count=2236962,bucket2:packet_count=26214,byte_count=3355443 - group_id=5,ref_count=2,packet_count=34952,byte_count=7829367,bucket0:packet_count=4369,byte_count=2236962,bucket1:packet_count=4369,byte_count=2236962 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1838" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_209 -#AT_START_210 -at_fn_group_banner 210 'ofp-print.at:1856' \ - "OFPST_GROUP reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "210. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1858: ovs-ofctl ofp-print \"\\ -04 13 00 b0 00 00 00 02 00 06 00 00 00 00 00 00 \\ -00 58 00 00 87 65 43 21 00 00 00 04 00 00 00 00 \\ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \\ -00 00 00 12 1d cd 65 00 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -00 00 00 00 00 00 66 66 00 00 00 00 00 33 33 33 \\ -00 48 00 00 00 00 00 05 00 00 00 02 00 00 00 00 \\ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \\ -00 00 00 10 1d cd 65 00 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1858" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 00 b0 00 00 00 02 00 06 00 00 00 00 00 00 \ -00 58 00 00 87 65 43 21 00 00 00 04 00 00 00 00 \ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \ -00 00 00 12 1d cd 65 00 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -00 00 00 00 00 00 66 66 00 00 00 00 00 33 33 33 \ -00 48 00 00 00 00 00 05 00 00 00 02 00 00 00 00 \ -00 00 00 00 00 00 88 88 00 00 00 00 00 77 77 77 \ -00 00 00 10 1d cd 65 00 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -00 00 00 00 00 00 11 11 00 00 00 00 00 22 22 22 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP reply (OF1.3) (xid=0x2): - group_id=2271560481,duration=18.500s,ref_count=4,packet_count=34952,byte_count=7829367,bucket0:packet_count=4369,byte_count=2236962,bucket1:packet_count=4369,byte_count=2236962,bucket2:packet_count=26214,byte_count=3355443 - group_id=5,duration=16.500s,ref_count=2,packet_count=34952,byte_count=7829367,bucket0:packet_count=4369,byte_count=2236962,bucket1:packet_count=4369,byte_count=2236962 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1858" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_210 -#AT_START_211 -at_fn_group_banner 211 'ofp-print.at:1878' \ - "OFPST_GROUP_DESC request - OF1.1" " " 15 -at_xfail=no -( - $as_echo "211. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1880: ovs-ofctl ofp-print \"\\ -02 12 00 10 00 00 00 02 00 07 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1880" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 12 00 10 00 00 00 02 00 07 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC request (OF1.1) (xid=0x2): group_id=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1880" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_211 -#AT_START_212 -at_fn_group_banner 212 'ofp-print.at:1886' \ - "OFPST_GROUP_DESC request - OF1.5" " " 15 -at_xfail=no -( - $as_echo "212. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1888: ovs-ofctl ofp-print \"\\ -06 12 00 14 00 00 00 02 00 07 00 00 00 00 00 00 \\ -00 00 00 01 -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1888" -( $at_check_trace; ovs-ofctl ofp-print "\ -06 12 00 14 00 00 00 02 00 07 00 00 00 00 00 00 \ -00 00 00 01 -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC request (OF1.5) (xid=0x2): group_id=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1888" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_212 -#AT_START_213 -at_fn_group_banner 213 'ofp-print.at:1895' \ - "OFPST_GROUP_DESC reply" " " 15 -at_xfail=no -( - $as_echo "213. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1897: ovs-ofctl ofp-print \"\\ -02 13 00 78 00 00 00 02 00 07 00 00 00 00 00 00 \\ -00 68 01 00 00 00 20 00 \\ -00 20 00 64 00 00 00 01 ff ff ff ff 00 00 00 00 \\ -00 00 00 10 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 20 00 c8 00 00 00 02 ff ff ff ff 00 00 00 00 \\ -00 00 00 10 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 20 00 c8 00 00 00 03 ff ff ff ff 00 00 00 00 \\ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1897" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 13 00 78 00 00 00 02 00 07 00 00 00 00 00 00 \ -00 68 01 00 00 00 20 00 \ -00 20 00 64 00 00 00 01 ff ff ff ff 00 00 00 00 \ -00 00 00 10 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 20 00 c8 00 00 00 02 ff ff ff ff 00 00 00 00 \ -00 00 00 10 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 20 00 c8 00 00 00 03 ff ff ff ff 00 00 00 00 \ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC reply (OF1.1) (xid=0x2): - group_id=8192,type=select,bucket=weight:100,watch_port:1,actions=output:1,bucket=weight:200,watch_port:2,actions=output:2,bucket=weight:200,watch_port:3,actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1897" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_213 -#AT_START_214 -at_fn_group_banner 214 'ofp-print.at:1912' \ - "OFPST_GROUP_FEATURES request" " " 15 -at_xfail=no -( - $as_echo "214. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1914: ovs-ofctl ofp-print \"\\ -03 12 00 10 00 00 00 02 00 08 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1914" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 12 00 10 00 00 00 02 00 08 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_FEATURES request (OF1.2) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1914" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_214 -#AT_START_215 -at_fn_group_banner 215 'ofp-print.at:1920' \ - "OFPST_GROUP_FEATURES reply" " " 15 -at_xfail=no -( - $as_echo "215. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1922: ovs-ofctl ofp-print \"\\ -03 13 00 38 00 00 00 02 00 08 00 00 00 00 00 00 \\ -00 00 00 0f 00 00 00 0f \\ -00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 \\ -00 00 00 01 00 00 00 03 00 00 00 07 00 00 00 0f \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1922" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 13 00 38 00 00 00 02 00 08 00 00 00 00 00 00 \ -00 00 00 0f 00 00 00 0f \ -00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 \ -00 00 00 01 00 00 00 03 00 00 00 07 00 00 00 0f \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_FEATURES reply (OF1.2) (xid=0x2): - Group table: - Types: 0xf - Capabilities: 0xf - All group : - max_groups = 0x1 actions=0x00000001 - Select group : - max_groups = 0x2 actions=0x00000003 - Indirect group : - max_groups = 0x3 actions=0x00000007 - Fast Failover group : - max_groups = 0x4 actions=0x0000000f -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1922" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_215 -#AT_START_216 -at_fn_group_banner 216 'ofp-print.at:1943' \ - "OFPST_PORT_DESC request - OF1.0" " " 15 -at_xfail=no -( - $as_echo "216. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1945: ovs-ofctl ofp-print \"0110000c00000001000d0000\"" -at_fn_check_prepare_trace "ofp-print.at:1945" -( $at_check_trace; ovs-ofctl ofp-print "0110000c00000001000d0000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC request (xid=0x1): port=ANY -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1945" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_216 -#AT_START_217 -at_fn_group_banner 217 'ofp-print.at:1950' \ - "OFPST_PORT_DESC request - OF1.5" " " 15 -at_xfail=no -( - $as_echo "217. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1952: ovs-ofctl ofp-print \"\\ -06 12 00 14 00 00 00 02 00 0d 00 00 00 00 00 00 \\ -00 00 00 05\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1952" -( $at_check_trace; ovs-ofctl ofp-print "\ -06 12 00 14 00 00 00 02 00 0d 00 00 00 00 00 00 \ -00 00 00 05" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC request (OF1.5) (xid=0x2): port=5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1952" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_217 -#AT_START_218 -at_fn_group_banner 218 'ofp-print.at:1959' \ - "OFPST_PORT_DESC reply - OF1.0" " " 15 -at_xfail=no -( - $as_echo "218. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1961: ovs-ofctl ofp-print \"\\ -01 11 00 3c 00 00 00 00 00 0d 00 00 00 03 50 54 \\ -00 00 00 01 65 74 68 30 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 01 00 00 02 08 \\ -00 00 02 8f 00 00 02 8f 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1961" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 00 3c 00 00 00 00 00 0d 00 00 00 03 50 54 \ -00 00 00 01 65 74 68 30 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 01 00 00 02 08 \ -00 00 02 8f 00 00 02 8f 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC reply (xid=0x0): - 3(eth0): addr:50:54:00:00:00:01 - config: PORT_DOWN - state: LINK_DOWN - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1961" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_218 -#AT_START_219 -at_fn_group_banner 219 'ofp-print.at:1978' \ - "OFPST_PORT_DESC reply - OF1.4" " " 15 -at_xfail=no -( - $as_echo "219. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:1980: ovs-ofctl ofp-print \"\\ -05 13 00 58 00 00 00 02 00 0d 00 00 00 00 00 00 \\ -00 00 00 03 00 48 00 00 50 54 00 00 00 01 00 00 \\ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 \\ -00 00 20 08 00 00 28 0f 00 00 28 0f 00 00 00 00 \\ -00 01 86 a0 00 01 86 a0 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:1980" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 13 00 58 00 00 00 02 00 0d 00 00 00 00 00 00 \ -00 00 00 03 00 48 00 00 50 54 00 00 00 01 00 00 \ -65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 \ -00 00 20 08 00 00 28 0f 00 00 28 0f 00 00 00 00 \ -00 01 86 a0 00 01 86 a0 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC reply (OF1.4) (xid=0x2): - 3(eth0): addr:50:54:00:00:00:01 - config: 0 - state: 0 - current: 100MB-FD AUTO_NEG - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG - speed: 100 Mbps now, 100 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:1980" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_219 -#AT_START_220 -at_fn_group_banner 220 'ofp-print.at:1999' \ - "OFPT_METER_MOD request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "220. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2001: ovs-ofctl ofp-print \"\\ -04 1d 00 20 00 00 00 02 00 00 00 0d 00 00 00 05 \\ -00 01 00 10 00 00 04 00 00 00 00 80 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2001" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 1d 00 20 00 00 00 02 00 00 00 0d 00 00 00 05 \ -00 01 00 10 00 00 04 00 00 00 00 80 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_METER_MOD (OF1.3) (xid=0x2): ADD meter=5 kbps burst stats bands= -type=drop rate=1024 burst_size=128 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2001" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_220 -#AT_START_221 -at_fn_group_banner 221 'ofp-print.at:2010' \ - "OFPT_METER_MOD request - bad band - OF1.3" " " 15 -at_xfail=no -( - $as_echo "221. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2012: ovs-ofctl ofp-print \"\\ -04 1d 00 20 85 01 d7 38 00 00 00 00 00 00 00 01 -00 05 00 10 00 00 00 02 00 00 00 02 00 00 00 00 -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2012" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 1d 00 20 85 01 d7 38 00 00 00 00 00 00 00 01 -00 05 00 10 00 00 00 02 00 00 00 02 00 00 00 00 -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_METER_MOD (OF1.3) (xid=0x8501d738): ***decode error: OFPMMFC_BAD_BAND*** -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2012" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_221 -#AT_START_222 -at_fn_group_banner 222 'ofp-print.at:2020' \ - "OFPT_METER_MOD request - bad command - OF1.3" " " 15 -at_xfail=no -( - $as_echo "222. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2022: ovs-ofctl ofp-print \"\\ -04 1d 00 10 28 a6 26 52 00 08 00 00 00 00 00 01 -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2022" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 1d 00 10 28 a6 26 52 00 08 00 00 00 00 00 01 -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_METER_MOD (OF1.3) (xid=0x28a62652): ***decode error: OFPMMFC_BAD_COMMAND*** -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2022" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_222 -#AT_START_223 -at_fn_group_banner 223 'ofp-print.at:2029' \ - "OFPT_METER_MOD request - bad flags - OF1.3" " " 15 -at_xfail=no -( - $as_echo "223. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2031: ovs-ofctl ofp-print \"\\ -04 1d 00 20 82 b3 a1 a4 00 00 00 03 00 00 00 01 \\ -00 01 00 10 00 00 00 02 00 00 00 02 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2031" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 1d 00 20 82 b3 a1 a4 00 00 00 03 00 00 00 01 \ -00 01 00 10 00 00 00 02 00 00 00 02 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_METER_MOD (OF1.3) (xid=0x82b3a1a4): ***decode error: OFPMMFC_BAD_FLAGS*** -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2031" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_223 -#AT_START_224 -at_fn_group_banner 224 'ofp-print.at:2039' \ - "OFPST_METER request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "224. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2041: ovs-ofctl ofp-print \"041200180000000200090000000000000000000100000000\"" -at_fn_check_prepare_trace "ofp-print.at:2041" -( $at_check_trace; ovs-ofctl ofp-print "041200180000000200090000000000000000000100000000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_METER request (OF1.3) (xid=0x2): meter=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2041" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_224 -#AT_START_225 -at_fn_group_banner 225 'ofp-print.at:2046' \ - "OFPST_METER_CONFIG request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "225. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2048: ovs-ofctl ofp-print \"0412001800000002000a0000000000000000000100000000\"" -at_fn_check_prepare_trace "ofp-print.at:2048" -( $at_check_trace; ovs-ofctl ofp-print "0412001800000002000a0000000000000000000100000000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_METER_CONFIG request (OF1.3) (xid=0x2): meter=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2048" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_225 -#AT_START_226 -at_fn_group_banner 226 'ofp-print.at:2053' \ - "OFPST_METER_FEATURES request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "226. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2055: ovs-ofctl ofp-print \"0412001000000002000b000000000000\"" -at_fn_check_prepare_trace "ofp-print.at:2055" -( $at_check_trace; ovs-ofctl ofp-print "0412001000000002000b000000000000" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_METER_FEATURES request (OF1.3) (xid=0x2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2055" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_226 -#AT_START_227 -at_fn_group_banner 227 'ofp-print.at:2060' \ - "OFPST_METER_FEATURES reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "227. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2062: ovs-ofctl ofp-print \"\\ -04 13 00 20 00 00 00 02 00 0b 00 00 00 00 00 00 \\ -00 01 00 00 00 00 00 06 00 00 00 0F 10 02 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2062" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 00 20 00 00 00 02 00 0b 00 00 00 00 00 00 \ -00 01 00 00 00 00 00 06 00 00 00 0F 10 02 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_METER_FEATURES reply (OF1.3) (xid=0x2): -max_meter:65536 max_bands:16 max_color:2 -band_types: drop dscp_remark -capabilities: kbps pktps burst stats -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2062" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_227 -#AT_START_228 -at_fn_group_banner 228 'ofp-print.at:2073' \ - "OFPST_METER_CONFIG reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "228. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2075: ovs-ofctl ofp-print \"\\ -04 13 00 50 00 00 00 02 00 0a 00 00 00 00 00 00 \\ -00 28 00 05 00 00 00 01 \\ -00 01 00 10 00 01 00 00 00 00 05 00 00 00 00 00 \\ -00 02 00 10 00 10 00 00 00 00 f0 00 00 00 00 00 \\ -00 18 00 09 00 00 00 02 \\ -00 01 00 10 00 02 00 00 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2075" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 00 50 00 00 00 02 00 0a 00 00 00 00 00 00 \ -00 28 00 05 00 00 00 01 \ -00 01 00 10 00 01 00 00 00 00 05 00 00 00 00 00 \ -00 02 00 10 00 10 00 00 00 00 f0 00 00 00 00 00 \ -00 18 00 09 00 00 00 02 \ -00 01 00 10 00 02 00 00 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_METER_CONFIG reply (OF1.3) (xid=0x2): -meter=1 kbps burst bands= -type=drop rate=65536 burst_size=1280 -type=dscp_remark rate=1048576 burst_size=61440 prec_level=0 - -meter=2 kbps stats bands= -type=drop rate=131072 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2075" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_228 -#AT_START_229 -at_fn_group_banner 229 'ofp-print.at:2093' \ - "OFPST_METER reply - OF1.3" " " 15 -at_xfail=no -( - $as_echo "229. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2095: ovs-ofctl ofp-print \"\\ -04 13 00 90 00 00 00 02 00 09 00 00 00 00 00 00 \\ -00 00 00 01 00 48 00 00 00 00 00 00 00 00 00 05 \\ -00 00 00 00 00 00 10 00 00 00 00 00 00 02 30 00 \\ -00 00 01 8a 0a 6e 23 44 \\ -00 00 00 00 00 00 00 7e 00 00 00 00 00 00 34 33 \\ -00 00 00 00 00 00 00 e7 00 00 00 00 00 00 94 2e \\ -00 00 00 02 00 38 00 00 00 00 00 00 00 00 00 02 \\ -00 00 00 00 00 00 02 00 00 00 00 00 00 00 30 00 \\ -00 00 01 87 0a 23 6e 44 \\ -00 00 00 00 00 00 00 2a 00 00 00 00 00 00 04 33 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2095" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 00 90 00 00 00 02 00 09 00 00 00 00 00 00 \ -00 00 00 01 00 48 00 00 00 00 00 00 00 00 00 05 \ -00 00 00 00 00 00 10 00 00 00 00 00 00 02 30 00 \ -00 00 01 8a 0a 6e 23 44 \ -00 00 00 00 00 00 00 7e 00 00 00 00 00 00 34 33 \ -00 00 00 00 00 00 00 e7 00 00 00 00 00 00 94 2e \ -00 00 00 02 00 38 00 00 00 00 00 00 00 00 00 02 \ -00 00 00 00 00 00 02 00 00 00 00 00 00 00 30 00 \ -00 00 01 87 0a 23 6e 44 \ -00 00 00 00 00 00 00 2a 00 00 00 00 00 00 04 33 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_METER reply (OF1.3) (xid=0x2): -meter:1 flow_count:5 packet_in_count:4096 byte_in_count:143360 duration:394.174990148s bands: -0: packet_count:126 byte_count:13363 -1: packet_count:231 byte_count:37934 - -meter:2 flow_count:2 packet_in_count:512 byte_in_count:12288 duration:391.170094148s bands: -0: packet_count:42 byte_count:1075 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2095" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_229 -#AT_START_230 -at_fn_group_banner 230 'ofp-print.at:2117' \ - "OFPST_TABLE_FEATURES request - OF1.3" " " 15 -at_xfail=no -( - $as_echo "230. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2119: ovs-ofctl ofp-print \"\\ -04 13 09 40 00 00 00 d5 00 0c 00 01 00 00 00 00 \\ -09 30 00 00 00 00 00 00 74 61 62 6c 65 30 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff \\ -ff ff ff ff ff ff ff ff 00 00 00 03 00 0f 42 40 \\ -00 00 00 2c 00 01 00 08 00 00 00 00 00 02 00 08 \\ -00 00 00 00 00 03 00 08 00 00 00 00 00 04 00 08 \\ -00 00 00 00 00 05 00 08 00 00 00 00 00 00 00 00 \\ -00 01 00 2c 00 01 00 08 00 00 00 00 00 02 00 08 \\ -00 00 00 00 00 03 00 08 00 00 00 00 00 04 00 08 \\ -00 00 00 00 00 05 00 08 00 00 00 00 00 00 00 00 \\ -00 02 01 01 01 02 03 04 05 06 07 08 09 0a 0b 0c \\ -0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c \\ -1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c \\ -2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c \\ -3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c \\ -4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c \\ -5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c \\ -6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c \\ -7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c \\ -8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c \\ -9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac \\ -ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc \\ -bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc \\ -cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc \\ -dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec \\ -ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc \\ -fd 00 00 00 00 00 00 00 00 03 01 01 01 02 03 04 \\ -05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 \\ -15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 \\ -25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 \\ -35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 \\ -45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 \\ -55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 \\ -65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 \\ -75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 \\ -85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 \\ -95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 \\ -a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 \\ -b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 \\ -c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 \\ -d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 \\ -e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 \\ -f5 f6 f7 f8 f9 fa fb fc fd 00 00 00 00 00 00 00 \\ -00 04 00 84 00 00 00 08 00 00 00 00 00 0b 00 08 \\ -00 00 00 00 00 0c 00 08 00 00 00 00 00 0f 00 08 \\ -00 00 00 00 00 10 00 08 00 00 00 00 00 11 00 08 \\ -00 00 00 00 00 12 00 08 00 00 00 00 00 13 00 08 \\ -00 00 00 00 00 14 00 08 00 00 00 00 00 15 00 08 \\ -00 00 00 00 00 16 00 08 00 00 00 00 00 17 00 08 \\ -00 00 00 00 00 18 00 08 00 00 00 00 00 19 00 08 \\ -00 00 00 00 00 1a 00 08 00 00 00 00 00 1b 00 08 \\ -00 00 00 00 00 00 00 00 00 05 00 84 00 00 00 08 \\ -00 00 00 00 00 0b 00 08 00 00 00 00 00 0c 00 08 \\ -00 00 00 00 00 0f 00 08 00 00 00 00 00 10 00 08 \\ -00 00 00 00 00 11 00 08 00 00 00 00 00 12 00 08 \\ -00 00 00 00 00 13 00 08 00 00 00 00 00 14 00 08 \\ -00 00 00 00 00 15 00 08 00 00 00 00 00 16 00 08 \\ -00 00 00 00 00 17 00 08 00 00 00 00 00 18 00 08 \\ -00 00 00 00 00 19 00 08 00 00 00 00 00 1a 00 08 \\ -00 00 00 00 00 1b 00 08 00 00 00 00 00 00 00 00 \\ -00 06 00 84 00 00 00 08 00 00 00 00 00 0b 00 08 \\ -00 00 00 00 00 0c 00 08 00 00 00 00 00 0f 00 08 \\ -00 00 00 00 00 10 00 08 00 00 00 00 00 11 00 08 \\ -00 00 00 00 00 12 00 08 00 00 00 00 00 13 00 08 \\ -00 00 00 00 00 14 00 08 00 00 00 00 00 15 00 08 \\ -00 00 00 00 00 16 00 08 00 00 00 00 00 17 00 08 \\ -00 00 00 00 00 18 00 08 00 00 00 00 00 19 00 08 \\ -00 00 00 00 00 1a 00 08 00 00 00 00 00 1b 00 08 \\ -00 00 00 00 00 00 00 00 00 07 00 84 00 00 00 08 \\ -00 00 00 00 00 0b 00 08 00 00 00 00 00 0c 00 08 \\ -00 00 00 00 00 0f 00 08 00 00 00 00 00 10 00 08 \\ -00 00 00 00 00 11 00 08 00 00 00 00 00 12 00 08 \\ -00 00 00 00 00 13 00 08 00 00 00 00 00 14 00 08 \\ -00 00 00 00 00 15 00 08 00 00 00 00 00 16 00 08 \\ -00 00 00 00 00 17 00 08 00 00 00 00 00 18 00 08 \\ -00 00 00 00 00 19 00 08 00 00 00 00 00 1a 00 08 \\ -00 00 00 00 00 1b 00 08 00 00 00 00 00 00 00 00 \\ -00 08 00 dc 80 00 4c 08 00 01 3e 04 00 01 40 04 \\ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \\ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \\ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \\ -80 00 08 06 80 00 06 06 80 00 0a 02 00 00 08 02 \\ -80 00 0c 02 80 00 0e 01 80 00 44 04 80 00 46 01 \\ -80 00 48 01 80 00 16 04 80 00 18 04 80 00 34 10 \\ -80 00 36 10 80 00 38 04 80 00 14 01 00 00 0a 01 \\ -80 00 10 01 80 00 12 01 00 01 3a 01 00 01 34 01 \\ -80 00 2a 02 80 00 2c 04 80 00 2e 04 80 00 30 06 \\ -80 00 32 06 80 00 1a 02 80 00 1c 02 00 01 44 02 \\ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \\ -80 00 26 01 80 00 28 01 80 00 3a 01 80 00 3c 01 \\ -80 00 3e 10 80 00 40 06 80 00 42 06 00 00 00 00 \\ -00 0a 00 dc 80 00 4c 08 00 01 3e 04 00 01 40 04 \\ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \\ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \\ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \\ -80 00 08 06 80 00 06 06 80 00 0a 02 00 00 08 02 \\ -80 00 0c 02 80 00 0e 01 80 00 44 04 80 00 46 01 \\ -80 00 48 01 80 00 16 04 80 00 18 04 80 00 34 10 \\ -80 00 36 10 80 00 38 04 80 00 14 01 00 00 0a 01 \\ -80 00 10 01 80 00 12 01 00 01 3a 01 00 01 34 01 \\ -80 00 2a 02 80 00 2c 04 80 00 2e 04 80 00 30 06 \\ -80 00 32 06 80 00 1a 02 80 00 1c 02 00 01 44 02 \\ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \\ -80 00 26 01 80 00 28 01 80 00 3a 01 80 00 3c 01 \\ -80 00 3e 10 80 00 40 06 80 00 42 06 00 00 00 00 \\ -00 0c 00 a8 80 00 4c 08 00 01 3e 04 00 01 40 04 \\ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \\ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \\ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \\ -80 00 08 06 80 00 06 06 00 00 08 02 80 00 0c 02 \\ -80 00 0e 01 80 00 44 04 80 00 46 01 80 00 16 04 \\ -80 00 18 04 80 00 34 10 80 00 36 10 00 00 0a 01 \\ -80 00 10 01 80 00 12 01 00 01 3a 01 80 00 2a 02 \\ -80 00 2c 04 80 00 2e 04 80 00 30 06 80 00 32 06 \\ -80 00 1a 02 80 00 1c 02 80 00 1e 02 80 00 20 02 \\ -80 00 22 02 80 00 24 02 00 0d 00 a8 80 00 4c 08 \\ -00 01 3e 04 00 01 40 04 80 00 04 08 00 00 00 02 \\ -80 00 00 04 00 01 42 04 00 01 00 04 00 01 02 04 \\ -00 01 04 04 00 01 06 04 00 01 08 04 00 01 0a 04 \\ -00 01 0c 04 00 01 0e 04 80 00 08 06 80 00 06 06 \\ -00 00 08 02 80 00 0c 02 80 00 0e 01 80 00 44 04 \\ -80 00 46 01 80 00 16 04 80 00 18 04 80 00 34 10 \\ -80 00 36 10 00 00 0a 01 80 00 10 01 80 00 12 01 \\ -00 01 3a 01 80 00 2a 02 80 00 2c 04 80 00 2e 04 \\ -80 00 30 06 80 00 32 06 80 00 1a 02 80 00 1c 02 \\ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \\ -00 0e 00 a8 80 00 4c 08 00 01 3e 04 00 01 40 04 \\ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \\ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \\ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \\ -80 00 08 06 80 00 06 06 00 00 08 02 80 00 0c 02 \\ -80 00 0e 01 80 00 44 04 80 00 46 01 80 00 16 04 \\ -80 00 18 04 80 00 34 10 80 00 36 10 00 00 0a 01 \\ -80 00 10 01 80 00 12 01 00 01 3a 01 80 00 2a 02 \\ -80 00 2c 04 80 00 2e 04 80 00 30 06 80 00 32 06 \\ -80 00 1a 02 80 00 1c 02 80 00 1e 02 80 00 20 02 \\ -80 00 22 02 80 00 24 02 00 0f 00 a8 80 00 4c 08 \\ -00 01 3e 04 00 01 40 04 80 00 04 08 00 00 00 02 \\ -80 00 00 04 00 01 42 04 00 01 00 04 00 01 02 04 \\ -00 01 04 04 00 01 06 04 00 01 08 04 00 01 0a 04 \\ -00 01 0c 04 00 01 0e 04 80 00 08 06 80 00 06 06 \\ -00 00 08 02 80 00 0c 02 80 00 0e 01 80 00 44 04 \\ -80 00 46 01 80 00 16 04 80 00 18 04 80 00 34 10 \\ -80 00 36 10 00 00 0a 01 80 00 10 01 80 00 12 01 \\ -00 01 3a 01 80 00 2a 02 80 00 2c 04 80 00 2e 04 \\ -80 00 30 06 80 00 32 06 80 00 1a 02 80 00 1c 02 \\ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2119" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 13 09 40 00 00 00 d5 00 0c 00 01 00 00 00 00 \ -09 30 00 00 00 00 00 00 74 61 62 6c 65 30 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff \ -ff ff ff ff ff ff ff ff 00 00 00 03 00 0f 42 40 \ -00 00 00 2c 00 01 00 08 00 00 00 00 00 02 00 08 \ -00 00 00 00 00 03 00 08 00 00 00 00 00 04 00 08 \ -00 00 00 00 00 05 00 08 00 00 00 00 00 00 00 00 \ -00 01 00 2c 00 01 00 08 00 00 00 00 00 02 00 08 \ -00 00 00 00 00 03 00 08 00 00 00 00 00 04 00 08 \ -00 00 00 00 00 05 00 08 00 00 00 00 00 00 00 00 \ -00 02 01 01 01 02 03 04 05 06 07 08 09 0a 0b 0c \ -0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c \ -1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c \ -2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c \ -3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c \ -4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c \ -5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c \ -6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c \ -7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c \ -8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c \ -9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac \ -ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc \ -bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc \ -cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc \ -dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec \ -ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc \ -fd 00 00 00 00 00 00 00 00 03 01 01 01 02 03 04 \ -05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 \ -15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 \ -25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 \ -35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 \ -45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 \ -55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 \ -65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 \ -75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 \ -85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 \ -95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 \ -a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 \ -b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 \ -c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 \ -d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 \ -e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 \ -f5 f6 f7 f8 f9 fa fb fc fd 00 00 00 00 00 00 00 \ -00 04 00 84 00 00 00 08 00 00 00 00 00 0b 00 08 \ -00 00 00 00 00 0c 00 08 00 00 00 00 00 0f 00 08 \ -00 00 00 00 00 10 00 08 00 00 00 00 00 11 00 08 \ -00 00 00 00 00 12 00 08 00 00 00 00 00 13 00 08 \ -00 00 00 00 00 14 00 08 00 00 00 00 00 15 00 08 \ -00 00 00 00 00 16 00 08 00 00 00 00 00 17 00 08 \ -00 00 00 00 00 18 00 08 00 00 00 00 00 19 00 08 \ -00 00 00 00 00 1a 00 08 00 00 00 00 00 1b 00 08 \ -00 00 00 00 00 00 00 00 00 05 00 84 00 00 00 08 \ -00 00 00 00 00 0b 00 08 00 00 00 00 00 0c 00 08 \ -00 00 00 00 00 0f 00 08 00 00 00 00 00 10 00 08 \ -00 00 00 00 00 11 00 08 00 00 00 00 00 12 00 08 \ -00 00 00 00 00 13 00 08 00 00 00 00 00 14 00 08 \ -00 00 00 00 00 15 00 08 00 00 00 00 00 16 00 08 \ -00 00 00 00 00 17 00 08 00 00 00 00 00 18 00 08 \ -00 00 00 00 00 19 00 08 00 00 00 00 00 1a 00 08 \ -00 00 00 00 00 1b 00 08 00 00 00 00 00 00 00 00 \ -00 06 00 84 00 00 00 08 00 00 00 00 00 0b 00 08 \ -00 00 00 00 00 0c 00 08 00 00 00 00 00 0f 00 08 \ -00 00 00 00 00 10 00 08 00 00 00 00 00 11 00 08 \ -00 00 00 00 00 12 00 08 00 00 00 00 00 13 00 08 \ -00 00 00 00 00 14 00 08 00 00 00 00 00 15 00 08 \ -00 00 00 00 00 16 00 08 00 00 00 00 00 17 00 08 \ -00 00 00 00 00 18 00 08 00 00 00 00 00 19 00 08 \ -00 00 00 00 00 1a 00 08 00 00 00 00 00 1b 00 08 \ -00 00 00 00 00 00 00 00 00 07 00 84 00 00 00 08 \ -00 00 00 00 00 0b 00 08 00 00 00 00 00 0c 00 08 \ -00 00 00 00 00 0f 00 08 00 00 00 00 00 10 00 08 \ -00 00 00 00 00 11 00 08 00 00 00 00 00 12 00 08 \ -00 00 00 00 00 13 00 08 00 00 00 00 00 14 00 08 \ -00 00 00 00 00 15 00 08 00 00 00 00 00 16 00 08 \ -00 00 00 00 00 17 00 08 00 00 00 00 00 18 00 08 \ -00 00 00 00 00 19 00 08 00 00 00 00 00 1a 00 08 \ -00 00 00 00 00 1b 00 08 00 00 00 00 00 00 00 00 \ -00 08 00 dc 80 00 4c 08 00 01 3e 04 00 01 40 04 \ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \ -80 00 08 06 80 00 06 06 80 00 0a 02 00 00 08 02 \ -80 00 0c 02 80 00 0e 01 80 00 44 04 80 00 46 01 \ -80 00 48 01 80 00 16 04 80 00 18 04 80 00 34 10 \ -80 00 36 10 80 00 38 04 80 00 14 01 00 00 0a 01 \ -80 00 10 01 80 00 12 01 00 01 3a 01 00 01 34 01 \ -80 00 2a 02 80 00 2c 04 80 00 2e 04 80 00 30 06 \ -80 00 32 06 80 00 1a 02 80 00 1c 02 00 01 44 02 \ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \ -80 00 26 01 80 00 28 01 80 00 3a 01 80 00 3c 01 \ -80 00 3e 10 80 00 40 06 80 00 42 06 00 00 00 00 \ -00 0a 00 dc 80 00 4c 08 00 01 3e 04 00 01 40 04 \ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \ -80 00 08 06 80 00 06 06 80 00 0a 02 00 00 08 02 \ -80 00 0c 02 80 00 0e 01 80 00 44 04 80 00 46 01 \ -80 00 48 01 80 00 16 04 80 00 18 04 80 00 34 10 \ -80 00 36 10 80 00 38 04 80 00 14 01 00 00 0a 01 \ -80 00 10 01 80 00 12 01 00 01 3a 01 00 01 34 01 \ -80 00 2a 02 80 00 2c 04 80 00 2e 04 80 00 30 06 \ -80 00 32 06 80 00 1a 02 80 00 1c 02 00 01 44 02 \ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \ -80 00 26 01 80 00 28 01 80 00 3a 01 80 00 3c 01 \ -80 00 3e 10 80 00 40 06 80 00 42 06 00 00 00 00 \ -00 0c 00 a8 80 00 4c 08 00 01 3e 04 00 01 40 04 \ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \ -80 00 08 06 80 00 06 06 00 00 08 02 80 00 0c 02 \ -80 00 0e 01 80 00 44 04 80 00 46 01 80 00 16 04 \ -80 00 18 04 80 00 34 10 80 00 36 10 00 00 0a 01 \ -80 00 10 01 80 00 12 01 00 01 3a 01 80 00 2a 02 \ -80 00 2c 04 80 00 2e 04 80 00 30 06 80 00 32 06 \ -80 00 1a 02 80 00 1c 02 80 00 1e 02 80 00 20 02 \ -80 00 22 02 80 00 24 02 00 0d 00 a8 80 00 4c 08 \ -00 01 3e 04 00 01 40 04 80 00 04 08 00 00 00 02 \ -80 00 00 04 00 01 42 04 00 01 00 04 00 01 02 04 \ -00 01 04 04 00 01 06 04 00 01 08 04 00 01 0a 04 \ -00 01 0c 04 00 01 0e 04 80 00 08 06 80 00 06 06 \ -00 00 08 02 80 00 0c 02 80 00 0e 01 80 00 44 04 \ -80 00 46 01 80 00 16 04 80 00 18 04 80 00 34 10 \ -80 00 36 10 00 00 0a 01 80 00 10 01 80 00 12 01 \ -00 01 3a 01 80 00 2a 02 80 00 2c 04 80 00 2e 04 \ -80 00 30 06 80 00 32 06 80 00 1a 02 80 00 1c 02 \ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \ -00 0e 00 a8 80 00 4c 08 00 01 3e 04 00 01 40 04 \ -80 00 04 08 00 00 00 02 80 00 00 04 00 01 42 04 \ -00 01 00 04 00 01 02 04 00 01 04 04 00 01 06 04 \ -00 01 08 04 00 01 0a 04 00 01 0c 04 00 01 0e 04 \ -80 00 08 06 80 00 06 06 00 00 08 02 80 00 0c 02 \ -80 00 0e 01 80 00 44 04 80 00 46 01 80 00 16 04 \ -80 00 18 04 80 00 34 10 80 00 36 10 00 00 0a 01 \ -80 00 10 01 80 00 12 01 00 01 3a 01 80 00 2a 02 \ -80 00 2c 04 80 00 2e 04 80 00 30 06 80 00 32 06 \ -80 00 1a 02 80 00 1c 02 80 00 1e 02 80 00 20 02 \ -80 00 22 02 80 00 24 02 00 0f 00 a8 80 00 4c 08 \ -00 01 3e 04 00 01 40 04 80 00 04 08 00 00 00 02 \ -80 00 00 04 00 01 42 04 00 01 00 04 00 01 02 04 \ -00 01 04 04 00 01 06 04 00 01 08 04 00 01 0a 04 \ -00 01 0c 04 00 01 0e 04 80 00 08 06 80 00 06 06 \ -00 00 08 02 80 00 0c 02 80 00 0e 01 80 00 44 04 \ -80 00 46 01 80 00 16 04 80 00 18 04 80 00 34 10 \ -80 00 36 10 00 00 0a 01 80 00 10 01 80 00 12 01 \ -00 01 3a 01 80 00 2a 02 80 00 2c 04 80 00 2e 04 \ -80 00 30 06 80 00 32 06 80 00 1a 02 80 00 1c 02 \ -80 00 1e 02 80 00 20 02 80 00 22 02 80 00 24 02 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_TABLE_FEATURES reply (OF1.3) (xid=0xd5): - table 0: - name=\"table0\" - metadata: match=0xffffffffffffffff write=0xffffffffffffffff - config=Unknown - max_entries=1000000 - instructions (table miss and others): - next tables: 1-253 - instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table - Write-Actions and Apply-Actions features: - actions: output,copy_ttl_out,copy_ttl_in,set_mpls_ttl,dec_mpls_ttl,push_vlan,pop_vlan,push_mpls,pop_mpls,set_queue,group,set_nw_ttl,dec_nw_ttl,set_field,push_pbb,pop_pbb - supported on Set-Field: tun_id,tun_src,tun_dst,metadata,in_port,in_port_oxm,pkt_mark,reg0,reg1,reg2,reg3,reg4,reg5,reg6,reg7,eth_src,eth_dst,vlan_tci,vlan_vid,vlan_pcp,mpls_label,mpls_tc,ip_src,ip_dst,ipv6_src,ipv6_dst,nw_tos,ip_dscp,nw_ecn,nw_ttl,arp_op,arp_spa,arp_tpa,arp_sha,arp_tha,tcp_src,tcp_dst,udp_src,udp_dst,sctp_src,sctp_dst - matching: - tun_id: exact match or wildcard - tun_src: exact match or wildcard - tun_dst: exact match or wildcard - metadata: exact match or wildcard - in_port: exact match or wildcard - in_port_oxm: exact match or wildcard - pkt_mark: exact match or wildcard - reg0: exact match or wildcard - reg1: exact match or wildcard - reg2: exact match or wildcard - reg3: exact match or wildcard - reg4: exact match or wildcard - reg5: exact match or wildcard - reg6: exact match or wildcard - reg7: exact match or wildcard - eth_src: exact match or wildcard - eth_dst: exact match or wildcard - eth_type: exact match or wildcard - vlan_tci: exact match or wildcard - vlan_vid: exact match or wildcard - vlan_pcp: exact match or wildcard - mpls_label: exact match or wildcard - mpls_tc: exact match or wildcard - mpls_bos: exact match or wildcard - ip_src: exact match or wildcard - ip_dst: exact match or wildcard - ipv6_src: exact match or wildcard - ipv6_dst: exact match or wildcard - ipv6_label: exact match or wildcard - nw_proto: exact match or wildcard - nw_tos: exact match or wildcard - ip_dscp: exact match or wildcard - nw_ecn: exact match or wildcard - nw_ttl: exact match or wildcard - ip_frag: exact match or wildcard - arp_op: exact match or wildcard - arp_spa: exact match or wildcard - arp_tpa: exact match or wildcard - arp_sha: exact match or wildcard - arp_tha: exact match or wildcard - tcp_src: exact match or wildcard - tcp_dst: exact match or wildcard - tcp_flags: exact match or wildcard - udp_src: exact match or wildcard - udp_dst: exact match or wildcard - sctp_src: exact match or wildcard - sctp_dst: exact match or wildcard - icmp_type: exact match or wildcard - icmp_code: exact match or wildcard - icmpv6_type: exact match or wildcard - icmpv6_code: exact match or wildcard - nd_target: exact match or wildcard - nd_sll: exact match or wildcard - nd_tll: exact match or wildcard -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2119" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_230 -#AT_START_231 -at_fn_group_banner 231 'ofp-print.at:2338' \ - "OFPT_BARRIER_REQUEST - OF1.0" " " 15 -at_xfail=no -( - $as_echo "231. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2340: ovs-ofctl ofp-print '01 12 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2340" -( $at_check_trace; ovs-ofctl ofp-print '01 12 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REQUEST (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2340" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_231 -#AT_START_232 -at_fn_group_banner 232 'ofp-print.at:2345' \ - "OFPT_BARRIER_REQUEST - OF1.1" " " 15 -at_xfail=no -( - $as_echo "232. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2347: ovs-ofctl ofp-print '02 14 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2347" -( $at_check_trace; ovs-ofctl ofp-print '02 14 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REQUEST (OF1.1) (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2347" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_232 -#AT_START_233 -at_fn_group_banner 233 'ofp-print.at:2352' \ - "OFPT_BARRIER_REQUEST - OF1.2" " " 15 -at_xfail=no -( - $as_echo "233. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2354: ovs-ofctl ofp-print '03 14 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2354" -( $at_check_trace; ovs-ofctl ofp-print '03 14 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REQUEST (OF1.2) (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2354" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_233 -#AT_START_234 -at_fn_group_banner 234 'ofp-print.at:2359' \ - "OFPT_BARRIER_REQUEST - OF1.3" " " 15 -at_xfail=no -( - $as_echo "234. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2361: ovs-ofctl ofp-print '04 14 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2361" -( $at_check_trace; ovs-ofctl ofp-print '04 14 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REQUEST (OF1.3) (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2361" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_234 -#AT_START_235 -at_fn_group_banner 235 'ofp-print.at:2366' \ - "OFPT_BARRIER_REPLY - OF1.0" " " 15 -at_xfail=no -( - $as_echo "235. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2368: ovs-ofctl ofp-print '01 13 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2368" -( $at_check_trace; ovs-ofctl ofp-print '01 13 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REPLY (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2368" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_235 -#AT_START_236 -at_fn_group_banner 236 'ofp-print.at:2373' \ - "OFPT_BARRIER_REPLY - OF1.1" " " 15 -at_xfail=no -( - $as_echo "236. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2375: ovs-ofctl ofp-print '02 15 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2375" -( $at_check_trace; ovs-ofctl ofp-print '02 15 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REPLY (OF1.1) (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2375" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_236 -#AT_START_237 -at_fn_group_banner 237 'ofp-print.at:2380' \ - "OFPT_BARRIER_REPLY - OF1.2" " " 15 -at_xfail=no -( - $as_echo "237. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2382: ovs-ofctl ofp-print '03 15 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2382" -( $at_check_trace; ovs-ofctl ofp-print '03 15 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REPLY (OF1.2) (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2382" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_237 -#AT_START_238 -at_fn_group_banner 238 'ofp-print.at:2387' \ - "OFPT_BARRIER_REPLY - OF1.3" " " 15 -at_xfail=no -( - $as_echo "238. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2389: ovs-ofctl ofp-print '04 15 00 08 00 00 00 01'" -at_fn_check_prepare_trace "ofp-print.at:2389" -( $at_check_trace; ovs-ofctl ofp-print '04 15 00 08 00 00 00 01' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BARRIER_REPLY (OF1.3) (xid=0x1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2389" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_238 -#AT_START_239 -at_fn_group_banner 239 'ofp-print.at:2394' \ - "OFPT_QUEUE_GET_CONFIG_REQUEST - OF1.0" " " 15 -at_xfail=no -( - $as_echo "239. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2396: ovs-ofctl ofp-print \"01 14 00 0c 00 00 00 01 00 01 00 00\"" -at_fn_check_prepare_trace "ofp-print.at:2396" -( $at_check_trace; ovs-ofctl ofp-print "01 14 00 0c 00 00 00 01 00 01 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x1): port=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2396" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_239 -#AT_START_240 -at_fn_group_banner 240 'ofp-print.at:2401' \ - "OFPT_QUEUE_GET_CONFIG_REQUEST - OF1.2" " " 15 -at_xfail=no -( - $as_echo "240. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2403: ovs-ofctl ofp-print \"\\ -03 16 00 10 00 00 00 01 00 00 00 01 00 00 00 00\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2403" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 16 00 10 00 00 00 01 00 00 00 01 00 00 00 00" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2) (xid=0x1): port=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2403" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_240 -#AT_START_241 -at_fn_group_banner 241 'ofp-print.at:2409' \ - "OFPT_QUEUE_GET_CONFIG_REPLY - OF1.0" " " 15 -at_xfail=no -( - $as_echo "241. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2411: ovs-ofctl ofp-print \"01 15 00 40 00 00 00 01 \\ -00 01 00 00 00 00 00 00 \\ -00 00 55 55 00 28 00 00 \\ -00 01 00 10 00 00 00 00 01 f4 00 00 00 00 00 00 \\ -00 02 00 10 00 00 00 00 02 ee 00 00 00 00 00 00 \\ -00 00 44 44 00 08 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2411" -( $at_check_trace; ovs-ofctl ofp-print "01 15 00 40 00 00 00 01 \ -00 01 00 00 00 00 00 00 \ -00 00 55 55 00 28 00 00 \ -00 01 00 10 00 00 00 00 01 f4 00 00 00 00 00 00 \ -00 02 00 10 00 00 00 00 02 ee 00 00 00 00 00 00 \ -00 00 44 44 00 08 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_QUEUE_GET_CONFIG_REPLY (xid=0x1): port=1 -queue 21845: min_rate:50.0% max_rate:75.0% -queue 17476: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2411" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_241 -#AT_START_242 -at_fn_group_banner 242 'ofp-print.at:2424' \ - "OFPT_QUEUE_GET_CONFIG_REPLY - OF1.2" " " 15 -at_xfail=no -( - $as_echo "242. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2426: ovs-ofctl ofp-print \"03 17 00 50 00 00 00 01 \\ -00 00 00 01 00 00 00 00 \\ -00 00 55 55 00 00 00 01 00 30 00 00 00 00 00 00 \\ -00 01 00 10 00 00 00 00 01 f4 00 00 00 00 00 00 \\ -00 02 00 10 00 00 00 00 02 ee 00 00 00 00 00 00 \\ -00 00 44 44 00 08 00 01 00 10 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2426" -( $at_check_trace; ovs-ofctl ofp-print "03 17 00 50 00 00 00 01 \ -00 00 00 01 00 00 00 00 \ -00 00 55 55 00 00 00 01 00 30 00 00 00 00 00 00 \ -00 01 00 10 00 00 00 00 01 f4 00 00 00 00 00 00 \ -00 02 00 10 00 00 00 00 02 ee 00 00 00 00 00 00 \ -00 00 44 44 00 08 00 01 00 10 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2) (xid=0x1): port=1 -queue 21845: min_rate:50.0% max_rate:75.0% -queue 17476: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2426" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_242 -#AT_START_243 -at_fn_group_banner 243 'ofp-print.at:2439' \ - "OFPT_SET_ASYNC - OF1.3" " " 15 -at_xfail=no -( - $as_echo "243. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2441: ovs-ofctl ofp-print \"\\ -04 1c 00 20 00 00 00 00 00 00 10 05 00 00 10 07 \\ -00 00 00 03 00 00 00 07 00 00 00 00 00 00 00 03 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2441" -( $at_check_trace; ovs-ofctl ofp-print "\ -04 1c 00 20 00 00 00 00 00 00 10 05 00 00 10 07 \ -00 00 00 03 00 00 00 07 00 00 00 00 00 00 00 03 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_SET_ASYNC (OF1.3) (xid=0x0): - master: - PACKET_IN: no_match invalid_ttl 12 - PORT_STATUS: add delete - FLOW_REMOVED: (off) - - slave: - PACKET_IN: no_match action invalid_ttl 12 - PORT_STATUS: add delete modify - FLOW_REMOVED: idle hard -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2441" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_243 -#AT_START_244 -at_fn_group_banner 244 'ofp-print.at:2458' \ - "OFPT_ROLE_REQUEST - OF1.2" " " 15 -at_xfail=no -( - $as_echo "244. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2460: ovs-ofctl ofp-print \"\\ -03 18 00 18 00 00 00 02 00 00 00 02 00 00 00 00 \\ -00 00 00 00 00 00 00 03 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2460" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 18 00 18 00 00 00 02 00 00 00 02 00 00 00 00 \ -00 00 00 00 00 00 00 03 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ROLE_REQUEST (OF1.2) (xid=0x2): role=master generation_id=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2460" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_244 -#AT_START_245 -at_fn_group_banner 245 'ofp-print.at:2468' \ - "OFPT_ROLE_REQUEST - nochange - OF1.2" " " 15 -at_xfail=no -( - $as_echo "245. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2470: ovs-ofctl ofp-print \"\\ -03 18 00 18 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2470" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 18 00 18 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ROLE_REQUEST (OF1.2) (xid=0x2): role=nochange -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2470" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_245 -#AT_START_246 -at_fn_group_banner 246 'ofp-print.at:2478' \ - "NXT_ROLE_REQUEST" " " 15 -at_xfail=no -( - $as_echo "246. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2480: ovs-ofctl ofp-print \"\\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 0a \\ -00 00 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2480" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 0a \ -00 00 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_ROLE_REQUEST (xid=0x2): role=master -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2480" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_246 -#AT_START_247 -at_fn_group_banner 247 'ofp-print.at:2488' \ - "OFPT_ROLE_REPLY - OF1.2" " " 15 -at_xfail=no -( - $as_echo "247. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2490: ovs-ofctl ofp-print \"\\ -03 19 00 18 00 00 00 02 00 00 00 03 00 00 00 00 \\ -12 34 56 78 ab cd ef 90 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2490" -( $at_check_trace; ovs-ofctl ofp-print "\ -03 19 00 18 00 00 00 02 00 00 00 03 00 00 00 00 \ -12 34 56 78 ab cd ef 90 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ROLE_REPLY (OF1.2) (xid=0x2): role=slave generation_id=1311768467750121360 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2490" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_247 -#AT_START_248 -at_fn_group_banner 248 'ofp-print.at:2498' \ - "NXT_ROLE_REPLY" " " 15 -at_xfail=no -( - $as_echo "248. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2500: ovs-ofctl ofp-print \"\\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 0b \\ -00 00 00 02 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2500" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 0b \ -00 00 00 02 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_ROLE_REPLY (xid=0x2): role=slave -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2500" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_248 -#AT_START_249 -at_fn_group_banner 249 'ofp-print.at:2508' \ - "OFP_ROLE_STATUS - master, experimenter - OF1.4" " " 15 -at_xfail=no -( - $as_echo "249. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2510: ovs-ofctl ofp-print \"\\ -05 1e 00 18 00 00 00 0a \\ -00 00 00 02 02 00 00 00 ff ff ff ff ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2510" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 1e 00 18 00 00 00 0a \ -00 00 00 02 02 00 00 00 ff ff ff ff ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ROLE_STATUS (OF1.4) (xid=0xa): role=master reason=experimenter_data_changed -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2510" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_249 -#AT_START_250 -at_fn_group_banner 250 'ofp-print.at:2518' \ - "OFP_ROLE_STATUS - master, config - OF1.4" " " 15 -at_xfail=no -( - $as_echo "250. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2520: ovs-ofctl ofp-print \"\\ -05 1e 00 18 00 00 00 0a \\ -00 00 00 02 01 00 00 00 ff ff ff ff ff ff ff ff \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2520" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 1e 00 18 00 00 00 0a \ -00 00 00 02 01 00 00 00 ff ff ff ff ff ff ff ff \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ROLE_STATUS (OF1.4) (xid=0xa): role=master reason=configuration_changed -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2520" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_250 -#AT_START_251 -at_fn_group_banner 251 'ofp-print.at:2528' \ - "OFP_ROLE_STATUS - master, config,generation - OF1.4" "" 15 -at_xfail=no -( - $as_echo "251. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2530: ovs-ofctl ofp-print \"\\ -05 1e 00 18 00 00 00 0a \\ -00 00 00 02 01 00 00 00 00 00 00 00 00 00 00 10 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2530" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 1e 00 18 00 00 00 0a \ -00 00 00 02 01 00 00 00 00 00 00 00 00 00 00 10 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ROLE_STATUS (OF1.4) (xid=0xa): role=master generation_id=16 reason=configuration_changed -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2530" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_251 -#AT_START_252 -at_fn_group_banner 252 'ofp-print.at:2538' \ - "NXT_SET_PACKET_IN" " " 15 -at_xfail=no -( - $as_echo "252. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2540: ovs-ofctl ofp-print \"\\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 10 \\ -00 00 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2540" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 10 \ -00 00 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_SET_PACKET_IN_FORMAT (xid=0x2): format=nxm -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2540" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_252 -#AT_START_253 -at_fn_group_banner 253 'ofp-print.at:2548' \ - "NXT_PACKET_IN" " " 15 -at_xfail=no -( - $as_echo "253. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2550: ovs-ofctl ofp-print \"\\ -01 04 00 ba 00 00 00 00 00 00 23 20 00 00 00 11 \\ -ff ff ff ff 00 40 01 07 00 00 00 00 00 00 00 09 \\ -00 4e 00 00 00 00 00 00 00 00 00 02 00 01 00 01 \\ -20 08 00 00 00 00 00 00 00 06 00 01 00 04 00 00 \\ -00 01 00 01 02 04 00 00 00 02 00 01 04 04 00 00 \\ -00 03 00 01 06 04 00 00 00 04 00 01 08 04 00 00 \\ -00 05 80 00 05 10 5a 5a 5a 5a 5a 5a 5a 5a ff ff \\ -ff ff ff ff ff ff 00 00 00 00 82 82 82 82 82 82 \\ -80 81 81 81 81 81 81 00 00 50 08 00 45 00 00 28 \\ -00 00 00 00 00 06 32 05 53 53 53 53 54 54 54 54 \\ -00 55 00 56 00 00 00 00 00 00 00 00 50 02 00 00 \\ -31 6d 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2550" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 ba 00 00 00 00 00 00 23 20 00 00 00 11 \ -ff ff ff ff 00 40 01 07 00 00 00 00 00 00 00 09 \ -00 4e 00 00 00 00 00 00 00 00 00 02 00 01 00 01 \ -20 08 00 00 00 00 00 00 00 06 00 01 00 04 00 00 \ -00 01 00 01 02 04 00 00 00 02 00 01 04 04 00 00 \ -00 03 00 01 06 04 00 00 00 04 00 01 08 04 00 00 \ -00 05 80 00 05 10 5a 5a 5a 5a 5a 5a 5a 5a ff ff \ -ff ff ff ff ff ff 00 00 00 00 82 82 82 82 82 82 \ -80 81 81 81 81 81 81 00 00 50 08 00 45 00 00 28 \ -00 00 00 00 00 06 32 05 53 53 53 53 54 54 54 54 \ -00 55 00 56 00 00 00 00 00 00 00 00 50 02 00 00 \ -31 6d 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 metadata=0x5a5a5a5a5a5a5a5a reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86,tcp_flags=0x002 tcp_csum:316d -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2550" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_253 -#AT_START_254 -at_fn_group_banner 254 'ofp-print.at:2569' \ - "NXT_PACKET_IN, with hex output of packet data" " " 15 -at_xfail=no -( - $as_echo "254. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2571: ovs-ofctl ofp-print \"\\ -01 04 00 ba 00 00 00 00 00 00 23 20 00 00 00 11 \\ -ff ff ff ff 00 40 01 07 00 00 00 00 00 00 00 09 \\ -00 4e 00 00 00 00 00 00 00 00 00 02 00 01 00 01 \\ -20 08 00 00 00 00 00 00 00 06 00 01 00 04 00 00 \\ -00 01 00 01 02 04 00 00 00 02 00 01 04 04 00 00 \\ -00 03 00 01 06 04 00 00 00 04 00 01 08 04 00 00 \\ -00 05 80 00 05 10 5a 5a 5a 5a 5a 5a 5a 5a ff ff \\ -ff ff ff ff ff ff 00 00 00 00 82 82 82 82 82 82 \\ -80 81 81 81 81 81 81 00 00 50 08 00 45 00 00 28 \\ -00 00 00 00 00 06 32 05 53 53 53 53 54 54 54 54 \\ -00 55 00 56 00 00 00 00 00 00 00 00 50 01 00 00 \\ -31 6d 00 00 00 00 00 00 00 00 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2571" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 ba 00 00 00 00 00 00 23 20 00 00 00 11 \ -ff ff ff ff 00 40 01 07 00 00 00 00 00 00 00 09 \ -00 4e 00 00 00 00 00 00 00 00 00 02 00 01 00 01 \ -20 08 00 00 00 00 00 00 00 06 00 01 00 04 00 00 \ -00 01 00 01 02 04 00 00 00 02 00 01 04 04 00 00 \ -00 03 00 01 06 04 00 00 00 04 00 01 08 04 00 00 \ -00 05 80 00 05 10 5a 5a 5a 5a 5a 5a 5a 5a ff ff \ -ff ff ff ff ff ff 00 00 00 00 82 82 82 82 82 82 \ -80 81 81 81 81 81 81 00 00 50 08 00 45 00 00 28 \ -00 00 00 00 00 06 32 05 53 53 53 53 54 54 54 54 \ -00 55 00 56 00 00 00 00 00 00 00 00 50 01 00 00 \ -31 6d 00 00 00 00 00 00 00 00 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 metadata=0x5a5a5a5a5a5a5a5a reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86,tcp_flags=0x001 tcp_csum:316d -00000000 82 82 82 82 82 82 80 81-81 81 81 81 81 00 00 50 -00000010 08 00 45 00 00 28 00 00-00 00 00 06 32 05 53 53 -00000020 53 53 54 54 54 54 00 55-00 56 00 00 00 00 00 00 -00000030 00 00 50 01 00 00 31 6d-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2571" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_254 -#AT_START_255 -at_fn_group_banner 255 'ofp-print.at:2594' \ - "NXT_SET_ASYNC_CONFIG" " " 15 -at_xfail=no -( - $as_echo "255. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2596: ovs-ofctl ofp-print \"\\ -01 04 00 28 00 00 00 00 00 00 23 20 00 00 00 13 \\ -00 00 10 05 00 00 10 07 00 00 00 03 00 00 00 07 \\ -00 00 00 00 00 00 00 03 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2596" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 28 00 00 00 00 00 00 23 20 00 00 00 13 \ -00 00 10 05 00 00 10 07 00 00 00 03 00 00 00 07 \ -00 00 00 00 00 00 00 03 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_SET_ASYNC_CONFIG (xid=0x0): - master: - PACKET_IN: no_match invalid_ttl 12 - PORT_STATUS: add delete - FLOW_REMOVED: (off) - - slave: - PACKET_IN: no_match action invalid_ttl 12 - PORT_STATUS: add delete modify - FLOW_REMOVED: idle hard -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2596" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_255 -#AT_START_256 -at_fn_group_banner 256 'ofp-print.at:2614' \ - "NXT_SET_CONTROLLER_ID" " " 15 -at_xfail=no -( - $as_echo "256. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2616: ovs-ofctl ofp-print \"\\ -01 04 00 18 00 00 00 03 00 00 23 20 00 00 00 14 \\ -00 00 00 00 00 00 00 7b \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2616" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 18 00 00 00 03 00 00 23 20 00 00 00 14 \ -00 00 00 00 00 00 00 7b \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_SET_CONTROLLER_ID (xid=0x3): id=123 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2616" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_256 -#AT_START_257 -at_fn_group_banner 257 'ofp-print.at:2624' \ - "NXT_FLOW_MONITOR_CANCEL" " " 15 -at_xfail=no -( - $as_echo "257. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2626: ovs-ofctl ofp-print \"\\ -01 04 00 14 00 00 00 03 00 00 23 20 00 00 00 15 \\ -01 02 30 40 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2626" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 14 00 00 00 03 00 00 23 20 00 00 00 15 \ -01 02 30 40 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_MONITOR_CANCEL (xid=0x3): id=16920640 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2626" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_257 -#AT_START_258 -at_fn_group_banner 258 'ofp-print.at:2634' \ - "NXT_FLOW_MONITOR_PAUSED" " " 15 -at_xfail=no -( - $as_echo "258. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2636: ovs-ofctl ofp-print \"\\ -01 04 00 10 00 00 00 03 00 00 23 20 00 00 00 16 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2636" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 10 00 00 00 03 00 00 23 20 00 00 00 16 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_MONITOR_PAUSED (xid=0x3): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2636" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_258 -#AT_START_259 -at_fn_group_banner 259 'ofp-print.at:2643' \ - "NXT_FLOW_MONITOR_RESUMED" " " 15 -at_xfail=no -( - $as_echo "259. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2645: ovs-ofctl ofp-print \"\\ -01 04 00 10 00 00 00 03 00 00 23 20 00 00 00 17 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2645" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 10 00 00 00 03 00 00 23 20 00 00 00 17 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_MONITOR_RESUMED (xid=0x3): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2645" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_259 -#AT_START_260 -at_fn_group_banner 260 'ofp-print.at:2652' \ - "NXT_SET_FLOW_FORMAT" " " 15 -at_xfail=no -( - $as_echo "260. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2654: ovs-ofctl ofp-print \"\\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 0c \\ -00 00 00 02 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2654" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 0c \ -00 00 00 02 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_SET_FLOW_FORMAT (xid=0x2): format=nxm -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2654" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_260 -#AT_START_261 -at_fn_group_banner 261 'ofp-print.at:2663' \ - "NXT_FLOW_MOD, low verbosity" " " 15 -at_xfail=no -( - $as_echo "261. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2665: ovs-ofctl ofp-print \"\\ -01 04 00 60 00 00 00 02 00 00 23 20 00 00 00 0d \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 \\ -ff ff ff ff 00 10 00 00 00 14 00 00 00 00 00 00 \\ -00 01 20 08 00 00 00 00 00 00 01 c8 00 01 00 04 \\ -00 00 00 7b 00 00 00 00 ff ff 00 18 00 00 23 20 \\ -00 07 00 1f 00 01 00 04 00 00 00 00 00 00 00 05 \\ -\" 2" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2665" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 60 00 00 00 02 00 00 23 20 00 00 00 0d \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 \ -ff ff ff ff 00 10 00 00 00 14 00 00 00 00 00 00 \ -00 01 20 08 00 00 00 00 00 00 01 c8 00 01 00 04 \ -00 00 00 7b 00 00 00 00 ff ff 00 18 00 00 23 20 \ -00 07 00 1f 00 01 00 04 00 00 00 00 00 00 00 05 \ -" 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_MOD (xid=0x2): ADD reg0=0x7b,tun_id=0x1c8 out_port:16 actions=load:0x5->NXM_NX_REG0[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2665" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_261 -#AT_START_262 -at_fn_group_banner 262 'ofp-print.at:2679' \ - "NXT_FLOW_MOD, high verbosity" " " 15 -at_xfail=no -( - $as_echo "262. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2681: ovs-ofctl ofp-print \"\\ -01 04 00 60 00 00 00 02 00 00 23 20 00 00 00 0d \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 \\ -ff ff ff ff 01 00 00 00 00 14 00 00 00 00 00 00 \\ -00 01 20 08 00 00 00 00 00 00 01 c8 00 01 00 04 \\ -00 00 00 7b 00 00 00 00 ff ff 00 18 00 00 23 20 \\ -00 07 00 1f 00 01 00 04 00 00 00 00 00 00 00 05 \\ -\" 3" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2681" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 60 00 00 00 02 00 00 23 20 00 00 00 0d \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 \ -ff ff ff ff 01 00 00 00 00 14 00 00 00 00 00 00 \ -00 01 20 08 00 00 00 00 00 00 01 c8 00 01 00 04 \ -00 00 00 7b 00 00 00 00 ff ff 00 18 00 00 23 20 \ -00 07 00 1f 00 01 00 04 00 00 00 00 00 00 00 05 \ -" 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_MOD (xid=0x2): ADD NXM_NX_TUN_ID(00000000000001c8), NXM_NX_REG0(0000007b) out_port:256 actions=load:0x5->NXM_NX_REG0[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2681" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_262 -#AT_START_263 -at_fn_group_banner 263 'ofp-print.at:2693' \ - "OFPT_GROUP_MOD" " " 15 -at_xfail=no -( - $as_echo "263. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2695: ovs-ofctl ofp-print \"\\ -02 0f 00 70 11 22 33 44 00 00 01 00 87 65 43 21 \\ -00 20 00 64 00 00 00 01 ff ff ff ff 00 00 00 00 \\ -00 00 00 10 00 00 00 01 00 00 00 00 00 00 00 00 \\ -00 20 00 c8 00 00 00 02 ff ff ff ff 00 00 00 00 \\ -00 00 00 10 00 00 00 02 00 00 00 00 00 00 00 00 \\ -00 20 00 c8 00 00 00 03 ff ff ff ff 00 00 00 00 \\ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2695" -( $at_check_trace; ovs-ofctl ofp-print "\ -02 0f 00 70 11 22 33 44 00 00 01 00 87 65 43 21 \ -00 20 00 64 00 00 00 01 ff ff ff ff 00 00 00 00 \ -00 00 00 10 00 00 00 01 00 00 00 00 00 00 00 00 \ -00 20 00 c8 00 00 00 02 ff ff ff ff 00 00 00 00 \ -00 00 00 10 00 00 00 02 00 00 00 00 00 00 00 00 \ -00 20 00 c8 00 00 00 03 ff ff ff ff 00 00 00 00 \ -00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_GROUP_MOD (OF1.1) (xid=0x11223344): - ADD group_id=2271560481,type=select,bucket=weight:100,watch_port:1,actions=output:1,bucket=weight:200,watch_port:2,actions=output:2,bucket=weight:200,watch_port:3,actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2695" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_263 -#AT_START_264 -at_fn_group_banner 264 'ofp-print.at:2709' \ - "NXT_FLOW_REMOVED" " " 15 -at_xfail=no -( - $as_echo "264. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2711: ovs-ofctl ofp-print \"\\ -01 04 00 78 00 00 00 00 00 00 23 20 00 00 00 0e \\ -00 00 00 00 00 00 00 00 ff ff 00 02 00 00 00 06 \\ -01 6e 36 00 00 05 00 3c 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \\ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \\ -00 05 00 00 06 02 08 06 00 00 08 02 00 00 00 00 \\ -1e 02 00 02 00 00 20 04 c0 a8 00 01 00 00 22 04 \\ -c0 a8 00 02 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2711" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 78 00 00 00 00 00 00 23 20 00 00 00 0e \ -00 00 00 00 00 00 00 00 ff ff 00 02 00 00 00 06 \ -01 6e 36 00 00 05 00 3c 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \ -00 05 00 00 06 02 08 06 00 00 08 02 00 00 00 00 \ -1e 02 00 02 00 00 20 04 c0 a8 00 01 00 00 22 04 \ -c0 a8 00 02 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_REMOVED (xid=0x0): priority=65535,arp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2 reason=idle table_id=1 duration6.024s idle5 pkts1 bytes60 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2711" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_264 -#AT_START_265 -at_fn_group_banner 265 'ofp-print.at:2725' \ - "NXT_FLOW_MOD_TABLE_ID" " " 15 -at_xfail=no -( - $as_echo "265. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2727: ovs-ofctl ofp-print \"\\ -01 04 00 18 01 02 03 04 00 00 23 20 00 00 00 0f \\ -01 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2727" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 04 00 18 01 02 03 04 00 00 23 20 00 00 00 0f \ -01 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_MOD_TABLE_ID (xid=0x1020304): enable -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2727" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_265 -#AT_START_266 -at_fn_group_banner 266 'ofp-print.at:2735' \ - "NXST_FLOW request" " " 15 -at_xfail=no -( - $as_echo "266. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2737: ovs-ofctl ofp-print \"\\ -01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \\ -00 00 00 00 00 00 00 00 ff ff 00 00 ff 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2737" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \ -00 00 00 00 00 00 00 00 ff ff 00 00 ff 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW request (xid=0x4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2737" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_266 -#AT_START_267 -at_fn_group_banner 267 'ofp-print.at:2745' \ - "NXST_FLOW reply" " " 15 -at_xfail=no -( - $as_echo "267. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2747: ovs-ofctl ofp-print \"\\ -01 11 08 18 00 00 00 04 ff ff 00 00 00 00 23 20 \\ -00 00 00 00 00 00 00 00 00 88 00 00 00 00 00 01 \\ -02 dc 6c 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \\ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \\ -00 05 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \\ -0a 01 00 00 00 0e 04 c0 a8 00 01 00 00 10 04 c0 \\ -a8 00 02 00 00 0c 01 06 00 00 12 02 09 e7 00 00 \\ -14 02 00 00 00 00 00 00 00 00 00 08 00 01 00 00 \\ -00 88 00 00 00 00 00 03 32 11 62 00 ff ff 00 05 \\ -00 00 00 4c 00 03 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \\ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \\ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \\ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \\ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \\ -00 00 12 02 09 e4 00 00 14 02 00 00 00 00 00 00 \\ -00 00 00 08 00 01 00 00 00 88 00 00 00 00 00 02 \\ -33 f9 aa 00 ff ff 00 05 00 00 00 4c 00 05 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \\ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \\ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \\ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \\ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \\ -14 02 09 e5 00 00 00 00 00 00 00 08 00 03 00 00 \\ -00 88 00 00 00 00 00 04 2d 0f a5 00 ff ff 00 05 \\ -00 00 00 4c 00 01 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \\ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \\ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \\ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \\ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \\ -00 00 12 02 09 e3 00 00 14 02 00 00 00 00 00 00 \\ -00 00 00 08 00 01 00 00 00 88 00 00 00 00 00 02 \\ -34 73 bc 00 ff ff 00 05 00 0a 00 4c 00 03 00 03 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \\ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \\ -00 05 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \\ -0a 01 00 00 00 0e 04 c0 a8 00 01 00 00 10 04 c0 \\ -a8 00 02 00 00 0c 01 06 00 00 12 02 09 e5 00 00 \\ -14 02 00 00 00 00 00 00 00 00 00 08 00 01 00 00 \\ -00 88 00 00 00 00 00 05 28 0d e8 00 ff ff 00 05 \\ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \\ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \\ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \\ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \\ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \\ -00 00 12 02 09 e2 00 00 14 02 00 00 00 00 00 00 \\ -00 00 00 08 00 01 00 00 00 88 00 00 00 00 00 01 \\ -02 62 5a 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \\ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \\ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \\ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \\ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \\ -14 02 09 e7 00 00 00 00 00 00 00 08 00 03 00 00 \\ -00 88 00 00 00 00 00 01 38 be 5e 00 ff ff 00 05 \\ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \\ -00 00 00 02 00 01 00 00 02 06 50 54 00 00 00 05 \\ -00 00 04 06 50 54 00 00 00 06 00 00 06 02 08 00 \\ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \\ -a8 00 02 00 00 10 04 c0 a8 00 01 00 00 0c 01 06 \\ -00 00 12 02 00 00 00 00 14 02 09 e6 00 00 00 00 \\ -00 00 00 08 00 03 00 00 00 88 00 00 00 00 00 04 \\ -27 d0 df 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \\ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \\ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \\ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \\ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \\ -14 02 09 e3 00 00 00 00 00 00 00 08 00 03 00 00 \\ -00 88 00 00 00 00 00 03 2c d2 9c 00 ff ff 00 05 \\ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \\ -00 00 00 02 00 01 00 00 02 06 50 54 00 00 00 05 \\ -00 00 04 06 50 54 00 00 00 06 00 00 06 02 08 00 \\ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \\ -a8 00 02 00 00 10 04 c0 a8 00 01 00 00 0c 01 06 \\ -00 00 12 02 00 00 00 00 14 02 09 e4 00 00 00 00 \\ -00 00 00 08 00 03 00 00 00 88 00 00 00 00 00 00 \\ -0a 40 83 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \\ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \\ -00 05 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \\ -0a 01 00 00 00 0e 04 c0 a8 00 01 00 00 10 04 c0 \\ -a8 00 02 00 00 0c 01 06 00 00 12 02 09 e8 00 00 \\ -14 02 00 00 00 00 00 00 00 00 00 08 00 01 00 00 \\ -00 88 00 00 00 00 00 05 25 31 7c 00 ff ff 00 05 \\ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \\ -00 00 00 02 00 01 00 00 02 06 50 54 00 00 00 05 \\ -00 00 04 06 50 54 00 00 00 06 00 00 06 02 08 00 \\ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \\ -a8 00 02 00 00 10 04 c0 a8 00 01 00 00 0c 01 06 \\ -00 00 12 02 00 00 00 00 14 02 09 e2 00 00 00 00 \\ -00 00 00 08 00 03 00 00 00 88 00 00 00 00 00 00 \\ -04 c4 b4 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \\ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \\ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \\ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \\ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \\ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \\ -14 02 09 e8 00 00 00 00 00 00 00 08 00 03 00 00 \\ -00 88 00 00 00 00 00 01 39 38 70 00 ff ff 00 05 \\ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \\ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \\ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \\ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \\ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \\ -00 00 12 02 09 e6 00 00 14 02 00 00 00 00 00 00 \\ -00 00 00 08 00 01 00 00 00 60 00 00 00 00 00 e4 \\ -2e 7d db 00 80 00 00 00 00 00 00 14 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 01 20 08 00 00 00 00 \\ -00 00 01 c8 00 01 00 04 00 00 00 7b 00 00 00 00 \\ -ff ff 00 18 00 00 23 20 00 07 00 1f 00 01 00 04 \\ -00 00 00 00 00 00 00 05 \\ -00 30 01 00 00 00 0e 10 00 07 a1 20 80 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \\ -00 00 00 00 00 00 00 64 00 00 00 00 00 00 19 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2747" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 08 18 00 00 00 04 ff ff 00 00 00 00 23 20 \ -00 00 00 00 00 00 00 00 00 88 00 00 00 00 00 01 \ -02 dc 6c 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \ -00 05 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \ -0a 01 00 00 00 0e 04 c0 a8 00 01 00 00 10 04 c0 \ -a8 00 02 00 00 0c 01 06 00 00 12 02 09 e7 00 00 \ -14 02 00 00 00 00 00 00 00 00 00 08 00 01 00 00 \ -00 88 00 00 00 00 00 03 32 11 62 00 ff ff 00 05 \ -00 00 00 4c 00 03 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \ -00 00 12 02 09 e4 00 00 14 02 00 00 00 00 00 00 \ -00 00 00 08 00 01 00 00 00 88 00 00 00 00 00 02 \ -33 f9 aa 00 ff ff 00 05 00 00 00 4c 00 05 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \ -14 02 09 e5 00 00 00 00 00 00 00 08 00 03 00 00 \ -00 88 00 00 00 00 00 04 2d 0f a5 00 ff ff 00 05 \ -00 00 00 4c 00 01 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \ -00 00 12 02 09 e3 00 00 14 02 00 00 00 00 00 00 \ -00 00 00 08 00 01 00 00 00 88 00 00 00 00 00 02 \ -34 73 bc 00 ff ff 00 05 00 0a 00 4c 00 03 00 03 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \ -00 05 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \ -0a 01 00 00 00 0e 04 c0 a8 00 01 00 00 10 04 c0 \ -a8 00 02 00 00 0c 01 06 00 00 12 02 09 e5 00 00 \ -14 02 00 00 00 00 00 00 00 00 00 08 00 01 00 00 \ -00 88 00 00 00 00 00 05 28 0d e8 00 ff ff 00 05 \ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \ -00 00 12 02 09 e2 00 00 14 02 00 00 00 00 00 00 \ -00 00 00 08 00 01 00 00 00 88 00 00 00 00 00 01 \ -02 62 5a 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \ -14 02 09 e7 00 00 00 00 00 00 00 08 00 03 00 00 \ -00 88 00 00 00 00 00 01 38 be 5e 00 ff ff 00 05 \ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \ -00 00 00 02 00 01 00 00 02 06 50 54 00 00 00 05 \ -00 00 04 06 50 54 00 00 00 06 00 00 06 02 08 00 \ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \ -a8 00 02 00 00 10 04 c0 a8 00 01 00 00 0c 01 06 \ -00 00 12 02 00 00 00 00 14 02 09 e6 00 00 00 00 \ -00 00 00 08 00 03 00 00 00 88 00 00 00 00 00 04 \ -27 d0 df 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \ -14 02 09 e3 00 00 00 00 00 00 00 08 00 03 00 00 \ -00 88 00 00 00 00 00 03 2c d2 9c 00 ff ff 00 05 \ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \ -00 00 00 02 00 01 00 00 02 06 50 54 00 00 00 05 \ -00 00 04 06 50 54 00 00 00 06 00 00 06 02 08 00 \ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \ -a8 00 02 00 00 10 04 c0 a8 00 01 00 00 0c 01 06 \ -00 00 12 02 00 00 00 00 14 02 09 e4 00 00 00 00 \ -00 00 00 08 00 03 00 00 00 88 00 00 00 00 00 00 \ -0a 40 83 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 03 00 00 \ -02 06 50 54 00 00 00 06 00 00 04 06 50 54 00 00 \ -00 05 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \ -0a 01 00 00 00 0e 04 c0 a8 00 01 00 00 10 04 c0 \ -a8 00 02 00 00 0c 01 06 00 00 12 02 09 e8 00 00 \ -14 02 00 00 00 00 00 00 00 00 00 08 00 01 00 00 \ -00 88 00 00 00 00 00 05 25 31 7c 00 ff ff 00 05 \ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \ -00 00 00 02 00 01 00 00 02 06 50 54 00 00 00 05 \ -00 00 04 06 50 54 00 00 00 06 00 00 06 02 08 00 \ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \ -a8 00 02 00 00 10 04 c0 a8 00 01 00 00 0c 01 06 \ -00 00 12 02 00 00 00 00 14 02 09 e2 00 00 00 00 \ -00 00 00 08 00 03 00 00 00 88 00 00 00 00 00 00 \ -04 c4 b4 00 ff ff 00 05 00 00 00 4c 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 \ -00 00 00 00 00 00 00 3c 00 00 00 02 00 01 00 00 \ -02 06 50 54 00 00 00 05 00 00 04 06 50 54 00 00 \ -00 06 00 00 06 02 08 00 00 00 08 02 00 00 00 00 \ -0a 01 00 00 00 0e 04 c0 a8 00 02 00 00 10 04 c0 \ -a8 00 01 00 00 0c 01 06 00 00 12 02 00 00 00 00 \ -14 02 09 e8 00 00 00 00 00 00 00 08 00 03 00 00 \ -00 88 00 00 00 00 00 01 39 38 70 00 ff ff 00 05 \ -00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 3c \ -00 00 00 02 00 03 00 00 02 06 50 54 00 00 00 06 \ -00 00 04 06 50 54 00 00 00 05 00 00 06 02 08 00 \ -00 00 08 02 00 00 00 00 0a 01 00 00 00 0e 04 c0 \ -a8 00 01 00 00 10 04 c0 a8 00 02 00 00 0c 01 06 \ -00 00 12 02 09 e6 00 00 14 02 00 00 00 00 00 00 \ -00 00 00 08 00 01 00 00 00 60 00 00 00 00 00 e4 \ -2e 7d db 00 80 00 00 00 00 00 00 14 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 01 20 08 00 00 00 00 \ -00 00 01 c8 00 01 00 04 00 00 00 7b 00 00 00 00 \ -ff ff 00 18 00 00 23 20 00 07 00 1f 00 01 00 04 \ -00 00 00 00 00 00 00 05 \ -00 30 01 00 00 00 0e 10 00 07 a1 20 80 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ -00 00 00 00 00 00 00 64 00 00 00 00 00 00 19 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply (xid=0x4): - cookie=0x0, duration=1.048s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2535,tp_dst=0 actions=output:1 - cookie=0x0, duration=3.840s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, idle_age=2, priority=65535,tcp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2532,tp_dst=0 actions=output:1 - cookie=0x0, duration=2.872s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, idle_age=4, priority=65535,tcp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2533 actions=output:3 - cookie=0x0, duration=4.756s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, idle_age=0, priority=65535,tcp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2531,tp_dst=0 actions=output:1 - cookie=0x0, duration=2.880s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, hard_timeout=10, idle_age=2, priority=65535,tcp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2533,tp_dst=0 actions=output:1 - cookie=0x0, duration=5.672s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2530,tp_dst=0 actions=output:1 - cookie=0x0, duration=1.040s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2535 actions=output:3 - cookie=0x0, duration=1.952s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2534 actions=output:3 - cookie=0x0, duration=4.668s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2531 actions=output:3 - cookie=0x0, duration=3.752s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2532 actions=output:3 - cookie=0x0, duration=0.172s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2536,tp_dst=0 actions=output:1 - cookie=0x0, duration=5.624s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2530 actions=output:3 - cookie=0x0, duration=0.080s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2536 actions=output:3 - cookie=0x0, duration=1.960s, table=0, n_packets=1, n_bytes=60, idle_timeout=5, priority=65535,tcp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2534,tp_dst=0 actions=output:1 - cookie=0x0, duration=228.780s, table=0, n_packets=0, n_bytes=0, reg0=0x7b,tun_id=0x1c8 actions=load:0x5->NXM_NX_REG0[] - cookie=0x0, duration=3600.0005s, table=1, n_packets=100, n_bytes=6400, actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2747" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_267 -#AT_START_268 -at_fn_group_banner 268 'ofp-print.at:2899' \ - "NXST_AGGREGATE request" " " 15 -at_xfail=no -( - $as_echo "268. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2901: ovs-ofctl ofp-print \"\\ -01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \\ -00 00 00 01 00 00 00 00 ff ff 00 00 ff 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2901" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \ -00 00 00 01 00 00 00 00 ff ff 00 00 ff 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_AGGREGATE request (xid=0x4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2901" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_268 -#AT_START_269 -at_fn_group_banner 269 'ofp-print.at:2909' \ - "NXST_AGGREGATE reply" " " 15 -at_xfail=no -( - $as_echo "269. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2911: ovs-ofctl ofp-print \"\\ -01 11 00 30 00 00 00 04 ff ff 00 00 00 00 23 20 \\ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 07 \\ -00 00 00 00 00 00 01 a4 00 00 00 07 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2911" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 00 30 00 00 00 04 ff ff 00 00 00 00 23 20 \ -00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 07 \ -00 00 00 00 00 00 01 a4 00 00 00 07 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_AGGREGATE reply (xid=0x4): packet_count=7 byte_count=420 flow_count=7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2911" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_269 -#AT_START_270 -at_fn_group_banner 270 'ofp-print.at:2920' \ - "NXST_FLOW_MONITOR request" " " 15 -at_xfail=no -( - $as_echo "270. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2922: ovs-ofctl ofp-print \"\\ -01 10 00 40 00 00 00 04 ff ff 00 00 00 00 23 20 00 00 00 02 00 00 00 00 \\ -00 00 40 00 00 3f ff fe 00 00 01 00 00 00 00 00 \\ -00 00 20 00 00 04 ff ff 00 06 02 00 00 00 00 00 00 00 00 02 00 01 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2922" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 10 00 40 00 00 00 04 ff ff 00 00 00 00 23 20 00 00 00 02 00 00 00 00 \ -00 00 40 00 00 3f ff fe 00 00 01 00 00 00 00 00 \ -00 00 20 00 00 04 ff ff 00 06 02 00 00 00 00 00 00 00 00 02 00 01 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW_MONITOR request (xid=0x4): - id=16384 flags=initial,add,delete,modify,actions,own out_port=LOCAL table=1 - id=8192 flags=delete table=2 in_port=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2922" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_270 -#AT_START_271 -at_fn_group_banner 271 'ofp-print.at:2933' \ - "NXST_FLOW_MONITOR reply" " " 15 -at_xfail=no -( - $as_echo "271. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2935: ovs-ofctl ofp-print \"\\ -01 11 00 40 00 00 00 04 ff ff 00 00 00 00 23 20 00 00 00 02 00 00 00 00 \\ -00 20 00 01 00 05 80 00 00 05 00 10 00 06 01 00 12 34 56 78 9a bc de f0 \\ -00 00 00 02 00 01 00 00 \\ -00 08 00 03 00 01 86 a0 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2935" -( $at_check_trace; ovs-ofctl ofp-print "\ -01 11 00 40 00 00 00 04 ff ff 00 00 00 00 23 20 00 00 00 02 00 00 00 00 \ -00 20 00 01 00 05 80 00 00 05 00 10 00 06 01 00 12 34 56 78 9a bc de f0 \ -00 00 00 02 00 01 00 00 \ -00 08 00 03 00 01 86 a0 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW_MONITOR reply (xid=0x4): - event=DELETED reason=eviction table=1 idle_timeout=5 hard_timeout=16 cookie=0x123456789abcdef0 in_port=1 - event=ABBREV xid=0x186a0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2935" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_271 -#AT_START_272 -at_fn_group_banner 272 'ofp-print.at:2948' \ - "OFPT_BUNDLE_CONTROL - OPEN_REQUEST" " " 15 -at_xfail=no -( - $as_echo "272. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2950: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 00 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2950" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 00 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2950" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_272 -#AT_START_273 -at_fn_group_banner 273 'ofp-print.at:2959' \ - "OFPT_BUNDLE_CONTROL - OPEN_REQUEST" " " 15 -at_xfail=no -( - $as_echo "273. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2961: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 00 00 02 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2961" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 00 00 02 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=OPEN_REQUEST flags=ordered -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2961" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_273 -#AT_START_274 -at_fn_group_banner 274 'ofp-print.at:2970' \ - "OFPT_BUNDLE_CONTROL - OPEN_REQUEST" " " 15 -at_xfail=no -( - $as_echo "274. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2972: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 00 00 03 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2972" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 00 00 03 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2972" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_274 -#AT_START_275 -at_fn_group_banner 275 'ofp-print.at:2981' \ - "OFPT_BUNDLE_CONTROL - OPEN_REPLY" " " 15 -at_xfail=no -( - $as_echo "275. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2983: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 01 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2983" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 01 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=OPEN_REPLY flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2983" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_275 -#AT_START_276 -at_fn_group_banner 276 'ofp-print.at:2992' \ - "OFPT_BUNDLE_CONTROL - CLOSE_REQUEST" " " 15 -at_xfail=no -( - $as_echo "276. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:2994: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 02 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:2994" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 02 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:2994" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_276 -#AT_START_277 -at_fn_group_banner 277 'ofp-print.at:3003' \ - "OFPT_BUNDLE_CONTROL - CLOSE_REPLY" " " 15 -at_xfail=no -( - $as_echo "277. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:3005: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 03 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:3005" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 03 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=CLOSE_REPLY flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:3005" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_277 -#AT_START_278 -at_fn_group_banner 278 'ofp-print.at:3014' \ - "OFPT_BUNDLE_CONTROL - COMMIT_REQUEST" " " 15 -at_xfail=no -( - $as_echo "278. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:3016: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 04 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:3016" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 04 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=COMMIT_REQUEST flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:3016" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_278 -#AT_START_279 -at_fn_group_banner 279 'ofp-print.at:3025' \ - "OFPT_BUNDLE_CONTROL - COMMIT_REPLY" " " 15 -at_xfail=no -( - $as_echo "279. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:3027: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 05 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:3027" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 05 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=COMMIT_REPLY flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:3027" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_279 -#AT_START_280 -at_fn_group_banner 280 'ofp-print.at:3036' \ - "OFPT_BUNDLE_CONTROL - DISCARD_REQUEST" " " 15 -at_xfail=no -( - $as_echo "280. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:3038: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 06 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:3038" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 06 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=DISCARD_REQUEST flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:3038" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_280 -#AT_START_281 -at_fn_group_banner 281 'ofp-print.at:3047' \ - "OFPT_BUNDLE_CONTROL - DISCARD_REPLY" " " 15 -at_xfail=no -( - $as_echo "281. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:3049: ovs-ofctl ofp-print \"\\ -05 21 00 10 00 00 00 00 \\ -00 00 00 01 00 07 00 01 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:3049" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 21 00 10 00 00 00 00 \ -00 00 00 01 00 07 00 01 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_CONTROL (OF1.4) (xid=0x0): - bundle_id=0x1 type=DISCARD_REPLY flags=atomic -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:3049" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_281 -#AT_START_282 -at_fn_group_banner 282 'ofp-print.at:3058' \ - "OFPT_BUNDLE_ADD_MESSAGE - OFPT_HELLO" " " 15 -at_xfail=no -( - $as_echo "282. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-print.at:3060: ovs-ofctl ofp-print \"\\ -05 22 00 20 00 00 00 00 \\ -00 00 00 01 00 01 00 01 02 00 00 08 00 00 00 00 \\ -00 00 00 00 00 00 00 00 \\ -\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-print.at:3060" -( $at_check_trace; ovs-ofctl ofp-print "\ -05 22 00 20 00 00 00 00 \ -00 00 00 01 00 01 00 01 02 00 00 08 00 00 00 00 \ -00 00 00 00 00 00 00 00 \ -" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x0): - bundle_id=0x1 flags=atomic -OFPT_HELLO (OF1.1) (xid=0x0): - version bitmap: 0x01, 0x02 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-print.at:3060" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_282 -#AT_START_283 -at_fn_group_banner 283 'ofp-util.at:3' \ - "encoding hellos" " " 16 -at_xfail=no -( - $as_echo "283. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:5: ovs-ofctl encode-hello 0x2" -at_fn_check_prepare_trace "ofp-util.at:5" -( $at_check_trace; ovs-ofctl encode-hello 0x2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 01 00 00 08 00 00 00 01- -OFPT_HELLO (xid=0x1): - version bitmap: 0x01 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:5" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:10: ovs-ofctl encode-hello 0x6" -at_fn_check_prepare_trace "ofp-util.at:10" -( $at_check_trace; ovs-ofctl encode-hello 0x6 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 02 00 00 08 00 00 00 01- -OFPT_HELLO (OF1.1) (xid=0x1): - version bitmap: 0x01, 0x02 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:10" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:15: ovs-ofctl encode-hello 0xe" -at_fn_check_prepare_trace "ofp-util.at:15" -( $at_check_trace; ovs-ofctl encode-hello 0xe -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 03 00 00 08 00 00 00 01- -OFPT_HELLO (OF1.2) (xid=0x1): - version bitmap: 0x01, 0x02, 0x03 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:15" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:20: ovs-ofctl encode-hello 0x1e" -at_fn_check_prepare_trace "ofp-util.at:20" -( $at_check_trace; ovs-ofctl encode-hello 0x1e -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 04 00 00 08 00 00 00 01- -OFPT_HELLO (OF1.3) (xid=0x1): - version bitmap: 0x01, 0x02, 0x03, 0x04 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:20" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:25: ovs-ofctl encode-hello 0x3e" -at_fn_check_prepare_trace "ofp-util.at:25" -( $at_check_trace; ovs-ofctl encode-hello 0x3e -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 05 00 00 08 00 00 00 01- -OFPT_HELLO (OF1.4) (xid=0x1): - version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:25" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:32: ovs-ofctl encode-hello 0xc" -at_fn_check_prepare_trace "ofp-util.at:32" -( $at_check_trace; ovs-ofctl encode-hello 0xc -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0c -OFPT_HELLO (OF1.2) (xid=0x1): - version bitmap: 0x02, 0x03 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:32" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:37: ovs-ofctl encode-hello 0xa" -at_fn_check_prepare_trace "ofp-util.at:37" -( $at_check_trace; ovs-ofctl encode-hello 0xa -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0a -OFPT_HELLO (OF1.2) (xid=0x1): - version bitmap: 0x01, 0x03 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:37" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:42: ovs-ofctl encode-hello 0x8" -at_fn_check_prepare_trace "ofp-util.at:42" -( $at_check_trace; ovs-ofctl encode-hello 0x8 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 08 -OFPT_HELLO (OF1.2) (xid=0x1): - version bitmap: 0x03 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:42" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-util.at:47: ovs-ofctl encode-hello 0x4" -at_fn_check_prepare_trace "ofp-util.at:47" -( $at_check_trace; ovs-ofctl encode-hello 0x4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 02 00 00 10 00 00 00 01-00 01 00 08 00 00 00 04 -OFPT_HELLO (OF1.1) (xid=0x1): - version bitmap: 0x02 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-util.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_283 -#AT_START_284 -at_fn_group_banner 284 'ofp-errors.at:3' \ - "OFPT_ERROR with type OFPET_HELLO_FAILED - OF1.0" "" 17 -at_xfail=no -( - $as_echo "284. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:5: ovs-ofctl ofp-print 010100170000000000000001657874726120646174610a" -at_fn_check_prepare_trace "ofp-errors.at:5" -( $at_check_trace; ovs-ofctl ofp-print 010100170000000000000001657874726120646174610a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x0): OFPHFC_EPERM -extra data\\012 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:5" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_284 -#AT_START_285 -at_fn_group_banner 285 'ofp-errors.at:11' \ - "OFPT_ERROR with type OFPET_HELLO_FAILED - OF1.1" "" 17 -at_xfail=no -( - $as_echo "285. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:13: ovs-ofctl ofp-print 020100170000000000000001657874726120646174610a" -at_fn_check_prepare_trace "ofp-errors.at:13" -( $at_check_trace; ovs-ofctl ofp-print 020100170000000000000001657874726120646174610a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.1) (xid=0x0): OFPHFC_EPERM -extra data\\012 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_285 -#AT_START_286 -at_fn_group_banner 286 'ofp-errors.at:19' \ - "OFPT_ERROR with type OFPET_BAD_REQUEST - OF1.0" " " 17 -at_xfail=no -( - $as_echo "286. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:21: ovs-ofctl ofp-print 0101001400000000000100060105ccddeeff0011" -at_fn_check_prepare_trace "ofp-errors.at:21" -( $at_check_trace; ovs-ofctl ofp-print 0101001400000000000100060105ccddeeff0011 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x0): OFPBRC_BAD_LEN -OFPT_FEATURES_REQUEST (xid=0xeeff0011): -(***truncated to 8 bytes from 52445***) -00000000 01 05 cc dd ee ff 00 11- |........ | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_286 -#AT_START_287 -at_fn_group_banner 287 'ofp-errors.at:29' \ - "OFPT_ERROR prints type of truncated inner messages" "" 17 -at_xfail=no -( - $as_echo "287. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:31: ovs-ofctl ofp-print \"0101004c092529d500010006 \\ -01 06 00 e0 00 00 00 01 00 00 50 54 00 00 00 01 \\ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \\ -ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \\ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofp-errors.at:31" -( $at_check_trace; ovs-ofctl ofp-print "0101004c092529d500010006 \ -01 06 00 e0 00 00 00 01 00 00 50 54 00 00 00 01 \ -00 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \ -ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \ -00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x92529d5): OFPBRC_BAD_LEN -OFPT_FEATURES_REPLY (xid=0x1): -(***truncated to 64 bytes from 224***) -00000000 01 06 00 e0 00 00 00 01-00 00 50 54 00 00 00 01 |..........PT....| -00000010 00 00 01 00 02 00 00 00-00 00 00 87 00 00 0f ff |................| -00000020 ff fe 50 54 00 00 00 01-62 72 30 00 00 00 00 00 |..PT....br0.....| -00000030 00 00 00 00 00 00 00 00-00 00 00 01 00 00 00 01 |................| -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:31" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_287 -#AT_START_288 -at_fn_group_banner 288 'ofp-errors.at:46' \ - "OFPT_ERROR with code OFPBMC_BAD_PREREQ - OF1.0" " " 17 -at_xfail=no -( - $as_echo "288. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:48: ovs-ofctl ofp-print '0101001c55555555 b0c20000 0000232000010104 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:48" -( $at_check_trace; ovs-ofctl ofp-print '0101001c55555555 b0c20000 0000232000010104 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x55555555): OFPBMC_BAD_PREREQ -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:48" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_288 -#AT_START_289 -at_fn_group_banner 289 'ofp-errors.at:54' \ - "OFPT_ERROR with code OFPBMC_BAD_PREREQ - OF1.1" " " 17 -at_xfail=no -( - $as_echo "289. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:56: ovs-ofctl ofp-print '0201001c55555555 b0c20000 0000232000010104 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:56" -( $at_check_trace; ovs-ofctl ofp-print '0201001c55555555 b0c20000 0000232000010104 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.1) (xid=0x55555555): OFPBMC_BAD_PREREQ -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:56" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_289 -#AT_START_290 -at_fn_group_banner 290 'ofp-errors.at:64' \ - "OFPT_ERROR with type OFPFMFC_OVERLAP - OF1.0" " " 17 -at_xfail=no -( - $as_echo "290. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:66: ovs-ofctl ofp-print 0101001400000000000300010106ccddeeff0011" -at_fn_check_prepare_trace "ofp-errors.at:66" -( $at_check_trace; ovs-ofctl ofp-print 0101001400000000000300010106ccddeeff0011 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x0): OFPFMFC_OVERLAP -OFPT_FEATURES_REPLY (xid=0xeeff0011): -(***truncated to 8 bytes from 52445***) -00000000 01 06 cc dd ee ff 00 11- |........ | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_290 -#AT_START_291 -at_fn_group_banner 291 'ofp-errors.at:73' \ - "OFPT_ERROR with type OFPBIC_UNSUP_INST - OF1.1" " " 17 -at_xfail=no -( - $as_echo "291. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:75: ovs-ofctl ofp-print 0201001400000000000300010206ccddeeff0011" -at_fn_check_prepare_trace "ofp-errors.at:75" -( $at_check_trace; ovs-ofctl ofp-print 0201001400000000000300010206ccddeeff0011 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.1) (xid=0x0): OFPBIC_UNSUP_INST -OFPT_FEATURES_REPLY (OF1.1) (xid=0xeeff0011): -(***truncated to 8 bytes from 52445***) -00000000 02 06 cc dd ee ff 00 11- |........ | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_291 -#AT_START_292 -at_fn_group_banner 292 'ofp-errors.at:87' \ - "encoding OFPBIC_* experimenter errors" " " 17 -at_xfail=no -( - $as_echo "292. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:89: ovs-ofctl print-error OFPBIC_BAD_EXPERIMENTER" -at_fn_check_prepare_trace "ofp-errors.at:89" -( $at_check_trace; ovs-ofctl print-error OFPBIC_BAD_EXPERIMENTER -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OpenFlow 1.1: vendor 0, type 3, code 5 -OpenFlow 1.2: vendor 0, type 3, code 5 -OpenFlow 1.3: vendor 0, type 3, code 5 -OpenFlow 1.4: vendor 0, type 3, code 5 -OpenFlow 1.5: vendor 0, type 3, code 5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:89" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:96: ovs-ofctl print-error OFPBIC_BAD_EXP_TYPE" -at_fn_check_prepare_trace "ofp-errors.at:96" -( $at_check_trace; ovs-ofctl print-error OFPBIC_BAD_EXP_TYPE -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OpenFlow 1.1: vendor 0, type 3, code 5 -OpenFlow 1.2: vendor 0, type 3, code 6 -OpenFlow 1.3: vendor 0, type 3, code 6 -OpenFlow 1.4: vendor 0, type 3, code 6 -OpenFlow 1.5: vendor 0, type 3, code 6 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_292 -#AT_START_293 -at_fn_group_banner 293 'ofp-errors.at:107' \ - "encoding errors extension that became official" " " 17 -at_xfail=no -( - $as_echo "293. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:109: ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0100000812345678" -at_fn_check_prepare_trace "ofp-errors.at:109" -( $at_check_trace; ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0100000812345678 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 -00000010 00 01 02 01 01 00 00 08-12 34 56 78 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:114: ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0200000812345678" -at_fn_check_prepare_trace "ofp-errors.at:114" -( $at_check_trace; ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0200000812345678 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 -00000010 00 01 02 01 02 00 00 08-12 34 56 78 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:119: ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0300000812345678" -at_fn_check_prepare_trace "ofp-errors.at:119" -( $at_check_trace; ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0300000812345678 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 03 01 00 14 12 34 56 78-00 0b 00 02 03 00 00 08 -00000010 12 34 56 78 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:119" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_293 -#AT_START_294 -at_fn_group_banner 294 'ofp-errors.at:126' \ - "decoding OFPBIC_* experimenter errors" " " 17 -at_xfail=no -( - $as_echo "294. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:128: ovs-ofctl ofp-print '0201001455555555 00030005 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:128" -( $at_check_trace; ovs-ofctl ofp-print '0201001455555555 00030005 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.1) (xid=0x55555555): OFPBIC_BAD_EXPERIMENTER -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:128" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:132: ovs-ofctl ofp-print '0301001455555555 00030005 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:132" -( $at_check_trace; ovs-ofctl ofp-print '0301001455555555 00030005 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2) (xid=0x55555555): OFPBIC_BAD_EXPERIMENTER -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:132" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:136: ovs-ofctl ofp-print '0301001455555555 00030006 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:136" -( $at_check_trace; ovs-ofctl ofp-print '0301001455555555 00030006 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2) (xid=0x55555555): OFPBIC_BAD_EXP_TYPE -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_294 -#AT_START_295 -at_fn_group_banner 295 'ofp-errors.at:142' \ - "decoding experimenter errors" " " 17 -at_xfail=no -( - $as_echo "295. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:144: ovs-ofctl ofp-print '0101001c55555555 b0c20000 0000232000010203 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:144" -( $at_check_trace; ovs-ofctl ofp-print '0101001c55555555 b0c20000 0000232000010203 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x55555555): NXBRC_MUST_BE_ZERO -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:144" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:148: ovs-ofctl ofp-print '0201001c55555555 b0c20000 0000232000010203 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:148" -( $at_check_trace; ovs-ofctl ofp-print '0201001c55555555 b0c20000 0000232000010203 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.1) (xid=0x55555555): NXBRC_MUST_BE_ZERO -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:148" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:152: ovs-ofctl ofp-print '0301001855555555 ffff0004 00002320 0102000811111111'" -at_fn_check_prepare_trace "ofp-errors.at:152" -( $at_check_trace; ovs-ofctl ofp-print '0301001855555555 ffff0004 00002320 0102000811111111' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2) (xid=0x55555555): NXBRC_MUST_BE_ZERO -OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:152" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_295 -#AT_START_296 -at_fn_group_banner 296 'ofp-errors.at:158' \ - "encoding experimenter errors" " " 17 -at_xfail=no -( - $as_echo "296. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:160: ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0100000812345678" -at_fn_check_prepare_trace "ofp-errors.at:160" -( $at_check_trace; ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0100000812345678 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 -00000010 00 01 02 03 01 00 00 08-12 34 56 78 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:160" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:165: ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0200000812345678" -at_fn_check_prepare_trace "ofp-errors.at:165" -( $at_check_trace; ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0200000812345678 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 -00000010 00 01 02 03 02 00 00 08-12 34 56 78 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofp-errors.at:170: ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0300000812345678" -at_fn_check_prepare_trace "ofp-errors.at:170" -( $at_check_trace; ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0300000812345678 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00000000 03 01 00 18 12 34 56 78-ff ff 00 04 00 00 23 20 -00000010 03 00 00 08 12 34 56 78- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofp-errors.at:170" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_296 -#AT_START_297 -at_fn_group_banner 297 'ovs-ofctl.at:3' \ - "ovs-ofctl parse-flows choice of protocol" " " 18 -at_xfail=no -( - $as_echo "297. $at_setup_line: testing $at_desc ..." - $at_traceon - -# This doesn't cover some potential vlan_tci test cases. -for test_case in \ - 'tun_id=0 NXM,OXM' \ - 'tun_id=0/0x1 NXM,OXM' \ - 'tun_src=1.2.3.4 NXM,OXM' \ - 'tun_src=1.2.3.4/0.0.0.1 NXM,OXM' \ - 'tun_dst=1.2.3.4 NXM,OXM' \ - 'tun_dst=1.2.3.4/0.0.0.1 NXM,OXM' \ - 'tun_flags=0 none' \ - 'tun_flags=1/1 none' \ - 'tun_tos=0 none' \ - 'tun_ttl=0 none' \ - 'metadata=0 NXM,OXM,OpenFlow11' \ - 'metadata=1/1 NXM,OXM,OpenFlow11' \ - 'in_port=1 any' \ - 'skb_priority=0 none' \ - 'pkt_mark=1 NXM,OXM' \ - 'pkt_mark=1/1 NXM,OXM' \ - 'reg0=0 NXM,OXM' \ - 'reg0=0/1 NXM,OXM' \ - 'reg1=1 NXM,OXM' \ - 'reg1=1/1 NXM,OXM' \ - 'reg2=2 NXM,OXM' \ - 'reg2=2/1 NXM,OXM' \ - 'reg3=3 NXM,OXM' \ - 'reg3=3/1 NXM,OXM' \ - 'reg4=4 NXM,OXM' \ - 'reg4=4/1 NXM,OXM' \ - 'reg5=5 NXM,OXM' \ - 'reg5=5/1 NXM,OXM' \ - 'reg6=6 NXM,OXM' \ - 'reg6=6/1 NXM,OXM' \ - 'reg7=7 NXM,OXM' \ - 'reg7=7/1 NXM,OXM' \ - 'dl_src=00:11:22:33:44:55 any' \ - 'dl_src=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \ - 'dl_dst=00:11:22:33:44:55 any' \ - 'dl_dst=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \ - 'dl_type=0x1234 any' \ - 'dl_type=0x0800 any' \ - 'dl_type=0x0806 any' \ - 'dl_type=0x86dd any' \ - 'vlan_tci=0 any' \ - 'vlan_tci=0x1009 any' \ - 'vlan_tci=0x1009/0x1 NXM,OXM' \ - 'dl_vlan=9 any' \ - 'vlan_vid=11 any' \ - 'vlan_vid=11/0x1 NXM,OXM' \ - 'dl_vlan_pcp=6 any' \ - 'vlan_pcp=5 any' \ - 'mpls,mpls_label=5 NXM,OXM,OpenFlow11' \ - 'mpls,mpls_tc=1 NXM,OXM,OpenFlow11' \ - 'mpls,mpls_bos=0 NXM,OXM' \ - 'ip,ip_src=1.2.3.4 any' \ - 'ip,ip_src=192.168.0.0/24 any' \ - 'ip,ip_src=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \ - 'ip,ip_dst=1.2.3.4 any' \ - 'ip,ip_dst=192.168.0.0/24 any' \ - 'ip,ip_dst=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \ - 'ipv6,ipv6_src=::1 NXM,OXM' \ - 'ipv6,ipv6_src=::1/::1 NXM,OXM' \ - 'ipv6,ipv6_dst=::1 NXM,OXM' \ - 'ipv6,ipv6_dst=::1/::1 NXM,OXM' \ - 'ipv6,ipv6_label=5 NXM,OXM' \ - 'ipv6,ipv6_label=5/1 NXM,OXM' \ - 'ip,nw_proto=1 any' \ - 'ipv6,nw_proto=1 NXM,OXM' \ - 'ip,nw_tos=0xf0 any' \ - 'ipv6,nw_tos=0xf0 NXM,OXM' \ - 'ip,ip_dscp=0x3c any' \ - 'ipv6,ip_dscp=0x3c NXM,OXM' \ - 'ip,nw_ecn=1 NXM,OXM' \ - 'ipv6,nw_ecn=1 NXM,OXM' \ - 'ip,nw_ttl=5 NXM,OXM' \ - 'ipv6,nw_ttl=5 NXM,OXM' \ - 'ip,ip_frag=no NXM,OXM' \ - 'ipv6,ip_frag=no NXM,OXM' \ - 'arp,arp_op=0 any' \ - 'arp,arp_spa=1.2.3.4 any' \ - 'arp,arp_spa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \ - 'arp,arp_tpa=1.2.3.4 any' \ - 'arp,arp_tpa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \ - 'arp,arp_sha=00:11:22:33:44:55 NXM,OXM' \ - 'arp,arp_sha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \ - 'arp,arp_tha=00:11:22:33:44:55 NXM,OXM' \ - 'arp,arp_tha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \ - 'tcp,tcp_src=80 any' \ - 'tcp,tcp_src=0x1000/0x1000 NXM,OXM' \ - 'tcp6,tcp_src=80 NXM,OXM' \ - 'tcp6,tcp_src=0x1000/0x1000 NXM,OXM' \ - 'tcp,tcp_dst=80 any' \ - 'tcp,tcp_dst=0x1000/0x1000 NXM,OXM' \ - 'tcp6,tcp_dst=80 NXM,OXM' \ - 'tcp6,tcp_dst=0x1000/0x1000 NXM,OXM' \ - 'udp,udp_src=80 any' \ - 'udp,udp_src=0x1000/0x1000 NXM,OXM' \ - 'udp6,udp_src=80 NXM,OXM' \ - 'udp6,udp_src=0x1000/0x1000 NXM,OXM' \ - 'udp,udp_dst=80 any' \ - 'udp,udp_dst=0x1000/0x1000 NXM,OXM' \ - 'udp6,udp_dst=80 NXM,OXM' \ - 'udp6,udp_dst=0x1000/0x1000 NXM,OXM' \ - 'icmp,icmp_type=1 any' \ - 'icmp,icmp_code=2 any' \ - 'icmp6,icmpv6_type=1 NXM,OXM' \ - 'icmp6,icmpv6_code=2 NXM,OXM' -do - set $test_case - echo - echo "### test case: '$1' should have usable protocols '$2'" - if test "$2" = none; then - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:115: ovs-ofctl parse-flow \"\$1,actions=drop\"" -at_fn_check_prepare_dynamic "ovs-ofctl parse-flow \"$1,actions=drop\"" "ovs-ofctl.at:115" -( $at_check_trace; ovs-ofctl parse-flow "$1,actions=drop" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: no usable protocol -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: none -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:115" -$at_failed && at_fn_log_failure -$at_traceon; } - - else - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:121: ovs-ofctl parse-flow \"\$1,actions=drop\" | sed 1q" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:121" -( $at_check_trace; ovs-ofctl parse-flow "$1,actions=drop" | sed 1q -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: $2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:121" -$at_failed && at_fn_log_failure -$at_traceon; } - - fi -done - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_297 -#AT_START_298 -at_fn_group_banner 298 'ovs-ofctl.at:128' \ - "ovs-ofctl parse-flows (OpenFlow 1.0)" " " 18 -at_xfail=no -( - $as_echo "298. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -# comment -tcp,tp_src=123,out_port=5,actions=flood -in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop -udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 -tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller -actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note -ip,actions=set_field:10.4.3.77->ip_src -sctp actions=drop -sctp actions=drop -in_port=0 actions=resubmit:0 -actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:145: ovs-ofctl parse-flows flows.txt -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:145" -( $at_check_trace; ovs-ofctl parse-flows flows.txt - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:145" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:147: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:147" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: any -chosen protocol: OpenFlow10-table_id -OFPT_FLOW_MOD: ADD tcp,tp_src=123 out_port:5 actions=FLOOD -OFPT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop -OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 -OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 -OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 -OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77 -OFPT_FLOW_MOD: ADD sctp actions=drop -OFPT_FLOW_MOD: ADD sctp actions=drop -OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0 -OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_298 -#AT_START_299 -at_fn_group_banner 299 'ovs-ofctl.at:165' \ - "ovs-ofctl parse-flows (OpenFlow 1.1)" " " 18 -at_xfail=no -( - $as_echo "299. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -# comment -tcp,tp_src=123,out_port=5,actions=flood -in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop -udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 -tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 -cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller -actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note -ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src -sctp actions=drop -sctp actions=drop -in_port=0 actions=resubmit:0 -actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:182: ovs-ofctl --protocols OpenFlow11 parse-flows flows.txt -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:182" -( $at_check_trace; ovs-ofctl --protocols OpenFlow11 parse-flows flows.txt - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:184: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:184" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: any -chosen protocol: OpenFlow11 -OFPT_FLOW_MOD (OF1.1): ADD tcp,tp_src=123 out_port:5 actions=FLOOD -OFPT_FLOW_MOD (OF1.1): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop -OFPT_FLOW_MOD (OF1.1): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 -OFPT_FLOW_MOD (OF1.1): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 -OFPT_FLOW_MOD (OF1.1): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 -OFPT_FLOW_MOD (OF1.1): ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 -OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77 -OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop -OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop -OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0 -OFPT_FLOW_MOD (OF1.1): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:184" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_299 -#AT_START_300 -at_fn_group_banner 300 'ovs-ofctl.at:202' \ - "ovs-ofctl parse-flows (OpenFlow 1.2)" " " 18 -at_xfail=no -( - $as_echo "300. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -# comment -tcp,tp_src=123,actions=flood -in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=mod_vlan_vid:7,mod_vlan_pcp:2 -udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 -tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller -actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note -ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src -sctp actions=set_field:3334->sctp_src -sctp actions=set_field:4445->sctp_dst -tcp actions=mod_tp_dst:1234 -udp actions=mod_tp_src:1111 -ip actions=mod_nw_src:10.1.1.2,mod_nw_dst:192.168.10.1,mod_nw_ttl:1,mod_nw_tos:16,mod_nw_ecn:2 -in_port=0 actions=mod_dl_src:11:22:33:44:55:66,mod_dl_dst:10:20:30:40:50:60 -in_port=0 actions=resubmit:0 -actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:223: ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:223" -( $at_check_trace; ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:223" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:225: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:225" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: NXM,OXM -chosen protocol: OXM-OpenFlow12 -OFPT_FLOW_MOD (OF1.2): ADD tcp,tp_src=123 actions=FLOOD -OFPT_FLOW_MOD (OF1.2): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=set_field:4103->vlan_vid,set_field:2->vlan_pcp -OFPT_FLOW_MOD (OF1.2): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 -OFPT_FLOW_MOD (OF1.2): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -OFPT_FLOW_MOD (OF1.2): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -OFPT_FLOW_MOD (OF1.2): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 -OFPT_FLOW_MOD (OF1.2): ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 -OFPT_FLOW_MOD (OF1.2): ADD ipv6 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src -OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src -OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst -OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst -OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:1111->udp_src -OFPT_FLOW_MOD (OF1.2): ADD ip actions=set_field:10.1.1.2->ip_src,set_field:192.168.10.1->ip_dst,mod_nw_ttl:1,set_field:4->ip_dscp,set_field:2->nw_ecn -OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=set_field:11:22:33:44:55:66->eth_src,set_field:10:20:30:40:50:60->eth_dst -OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=resubmit:0 -OFPT_FLOW_MOD (OF1.2): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:225" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_300 -#AT_START_301 -at_fn_group_banner 301 'ovs-ofctl.at:247' \ - "ovs-ofctl parse-flow with invalid mask" " " 18 -at_xfail=no -( - $as_echo "301. $at_setup_line: testing $at_desc ..." - $at_traceon - -for test_case in \ - 'tun_tos 1/1' \ - 'tun_ttl 1/1' \ - 'skb_priority 1/1' \ - 'eth_type 0x1234/0x1' \ - 'dl_vlan 9/0x1' \ - 'dl_vlan_pcp 6/0x1' \ - 'vlan_pcp 5/0x1' \ - 'mpls mpls_label 5/0x1' \ - 'mpls mpls_tc 1/0x1' \ - 'mpls mpls_bos 1/0x1' \ - 'ip nw_proto 1/1' \ - 'ipv6 nw_proto 1/1' \ - 'ip nw_tos 0xf0/0xf0' \ - 'ipv6 nw_tos 0xf0/0xf0' \ - 'ip ip_dscp 0x3c/0xf0' \ - 'ipv6 ip_dscp 0x3c/0xf0' \ - 'ip nw_ecn 1/1' \ - 'ipv6 nw_ecn 1/1' \ - 'ip nw_ttl 5/1' \ - 'ipv6 nw_ttl 5/1' \ - 'arp arp_op 0/1' \ - 'icmp icmp_type 1/1' \ - 'icmp icmp_code 2/1' \ - 'icmp6 icmpv6_code 2/1' -do - set $test_case - if test $# = 3; then - prereq=$1, field=$2 value=$3 - else - prereq= field=$1 value=$2 - fi - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:280: ovs-ofctl parse-flow \"\$prereq\$field=\$value,actions=drop\"" -at_fn_check_prepare_dynamic "ovs-ofctl parse-flow \"$prereq$field=$value,actions=drop\"" "ovs-ofctl.at:280" -( $at_check_trace; ovs-ofctl parse-flow "$prereq$field=$value,actions=drop" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: $value: invalid mask for field $field -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:280" -$at_failed && at_fn_log_failure -$at_traceon; } - -done - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_301 -#AT_START_302 -at_fn_group_banner 302 'ovs-ofctl.at:286' \ - "ovs-ofctl action inconsistency (OpenFlow 1.1)" " " 18 -at_xfail=no -( - $as_echo "302. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:287: ovs-ofctl --protocols OpenFlow11 add-flow br0 'ip actions=mod_tp_dst:1234' -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:287" -( $at_check_trace; ovs-ofctl --protocols OpenFlow11 add-flow br0 'ip actions=mod_tp_dst:1234' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OpenFlow11) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:287" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_302 -#AT_START_303 -at_fn_group_banner 303 'ovs-ofctl.at:292' \ - "ovs-ofctl parse-flows (With Tunnel-Parameters)" " " 18 -at_xfail=no -( - $as_echo "303. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -tun_id=0x1234000056780000/0xffff0000ffff0000,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=0x3,tun_ttl=20,tun_flags=key|csum actions=drop -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:297: ovs-ofctl parse-flows flows.txt -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:297" -( $at_check_trace; ovs-ofctl parse-flows flows.txt - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "usable protocols: none -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:297" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_303 -#AT_START_304 -at_fn_group_banner 304 'ovs-ofctl.at:304' \ - "ovs-ofctl parse-flows (skb_priority)" " " 18 -at_xfail=no -( - $as_echo "304. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -skb_priority=0x12341234,tcp,tp_src=123,actions=flood -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:309: ovs-ofctl parse-flows flows.txt -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:309" -( $at_check_trace; ovs-ofctl parse-flows flows.txt - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "usable protocols: none -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:309" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_304 -#AT_START_305 -at_fn_group_banner 305 'ovs-ofctl.at:316' \ - "ovs-ofctl parse-flows (NXM)" " " 18 -at_xfail=no -( - $as_echo "305. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -# comment -tcp,tp_src=123,actions=flood -in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop -pkt_mark=0xbb,actions=set_field:0xaa->pkt_mark -udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 -tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller -actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note -tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood -actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789 -actions=multipath(eth_src, 50, hrw, 12, 0, NXM_NX_REG0[0..3]),multipath(symmetric_l4, 1024, iter_hash, 5000, 5050, NXM_NX_REG0[0..12]) -table=1,actions=drop -tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop -metadata=0x1234ffff5678ffff/0xffff0000ffff0000,actions=drop -actions=bundle(eth_src,50,active_backup,ofport,slaves:1) -actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) -actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) -actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 -actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) -actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) -actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:[2,3]) -actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) -actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2 -actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3) -send_flow_rem,actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3 -check_overlap,actions=output:1,exit,output:2 -tcp,actions=fin_timeout(idle_timeout=5,hard_timeout=15) -actions=controller(max_len=123,reason=invalid_ttl,id=555) -actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:350: ovs-ofctl parse-flows flows.txt -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:350" -( $at_check_trace; ovs-ofctl parse-flows flows.txt - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:350" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:352: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:352" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: OXM,NXM+table_id -chosen protocol: NXM+table_id -NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD -NXT_FLOW_MOD: ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop -NXT_FLOW_MOD: ADD table:255 pkt_mark=0xbb actions=load:0xaa->NXM_NX_PKT_MARK[] -NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 -NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -NXT_FLOW_MOD: ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 -NXT_FLOW_MOD: ADD table:255 actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 -NXT_FLOW_MOD: ADD table:255 tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD -NXT_FLOW_MOD: ADD table:255 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789 -NXT_FLOW_MOD: ADD table:255 actions=multipath(eth_src,50,hrw,12,0,NXM_NX_REG0[0..3]),multipath(symmetric_l4,1024,iter_hash,5000,5050,NXM_NX_REG0[0..12]) -NXT_FLOW_MOD: ADD table:1 actions=drop -NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop -NXT_FLOW_MOD: ADD table:255 metadata=0x1234000056780000/0xffff0000ffff0000 actions=drop -NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1) -NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) -NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) -NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 -NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) -NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) -NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) -NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) -NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2 -NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3) -NXT_FLOW_MOD: ADD table:255 send_flow_rem actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3 -NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2 -NXT_FLOW_MOD: ADD table:255 tcp actions=fin_timeout(idle_timeout=5,hard_timeout=15) -NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555) -NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:352" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_305 -#AT_START_306 -at_fn_group_banner 306 'ovs-ofctl.at:387' \ - "ovs-ofctl -F nxm parse-flows" " " 18 -at_xfail=no -( - $as_echo "306. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -# comment -tcp,tp_src=123,actions=flood -in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop -arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop -ipv6,ipv6_label=0x12345 actions=2 -ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3 -ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4 -ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5 -tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop -udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop -in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop -udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 -tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop -icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4F:0571/112 actions=drop -icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop -icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop -icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE00:0000/96,nd_tll=00:0A:E4:25:6B:B1 actions=drop -cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller -actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note -tun_id=0x1234,cookie=0x5678,actions=flood -actions=drop -tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop -dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop -dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop -dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop -dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop -actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:419: ovs-ofctl -F nxm parse-flows flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:419" -( $at_check_trace; ovs-ofctl -F nxm parse-flows flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:419" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:420: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:420" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: NXM,OXM -chosen protocol: NXM-table_id -NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD -NXT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop -NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop -NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2 -NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3 -NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4 -NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5 -NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop -NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop -NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop -NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 -NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop -NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4f:0/112 actions=drop -NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop -NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571,nd_tll=00:0a:e4:25:6b:b1 actions=drop -NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0:0:1234:f045:8fff:1111::/96,nd_tll=00:0a:e4:25:6b:b1 actions=drop -NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 -NXT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 -NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD -NXT_FLOW_MOD: ADD actions=drop -NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop -NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop -NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop -NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop -NXT_FLOW_MOD: ADD actions=drop -NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:420" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_306 -#AT_START_307 -at_fn_group_banner 307 'ovs-ofctl.at:454' \ - "ovs-ofctl -F nxm -mmm parse-flows" " " 18 -at_xfail=no -( - $as_echo "307. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -# comment -tcp,tp_src=123,actions=flood -in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop -arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop -ipv6,ipv6_label=0x12345 actions=2 -ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3 -ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4 -ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5 -tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop -udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop -sctp6,ipv6_src=2001:db8:3c4d:1::5,tp_dst=309 actions=drop -in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop -udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 -tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 -udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 -sctp,nw_src=192.168.0.3,tp_dst=309 actions=pop_queue,output:1 -icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop -icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop -icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop -cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller -actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note -tun_id=0x1234,cookie=0x5678,actions=flood -actions=drop -reg0=123,actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:55->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[] -actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[] -actions=push:NXM_NX_REG0[0..31],pop:NXM_NX_REG0[] -vlan_tci=0x1123/0x1fff,actions=drop -actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:485: ovs-ofctl -F nxm -mmm parse-flows flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:485" -( $at_check_trace; ovs-ofctl -F nxm -mmm parse-flows flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:485" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:486: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:486" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: NXM,OXM -chosen protocol: NXM-table_id -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD -NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000001), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(0050) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000003), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(0035) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000005), NXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(0135) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(0003), NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000001), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(86) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_VLAN_TCI_W(f000/f000), NXM_OF_IP_PROTO(11) idle:5 actions=strip_vlan,output:0 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(0050) actions=set_queue:37,output:1 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(0035) actions=pop_queue,output:1 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(0135) actions=pop_queue,output:1 -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(fec000001234f0458fff1111fe4e0571) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_SLL(000ae4256bb0) actions=drop -NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(fec000001234f0458fff1111fe4e0571), NXM_NX_ND_TLL(000ae4256bb1) actions=drop -NXT_FLOW_MOD: ADD cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535 -NXT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 -NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD -NXT_FLOW_MOD: ADD actions=drop -NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:0x37->NXM_NX_REG2[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[] -NXT_FLOW_MOD: ADD actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[] -NXT_FLOW_MOD: ADD actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[] -NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop -NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:486" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_307 -#AT_START_308 -at_fn_group_banner 308 'ovs-ofctl.at:519' \ - "ovs-ofctl parse-nx-match" " " 18 -at_xfail=no -( - $as_echo "308. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >nx-match.txt <<'_ATEOF' - - -# in port -NXM_OF_IN_PORT(0000) -NXM_OF_IN_PORT(fffe) - -# eth dst -NXM_OF_ETH_DST(0002e30f80a4) -NXM_OF_ETH_DST_W(010000000000/010000000000) -NXM_OF_ETH_DST_W(000000000000/010000000000) -NXM_OF_ETH_DST_W(ffffffffffff/010000000000) -NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff) -NXM_OF_ETH_DST_W(60175619848f/000000000000) -NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) -NXM_OF_ETH_DST_W(60175619848f/5a5a5a5a5a5a) - -# eth src -NXM_OF_ETH_SRC(020898456ddb) -NXM_OF_ETH_SRC_W(012345abcdef/ffffff555555) -NXM_OF_ETH_SRC_W(020898456ddb/ffffffffffff) -NXM_OF_ETH_SRC_W(020898456ddb/000000000000) - -# eth type -NXM_OF_ETH_TYPE(0800) -NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012) - -# vlan tci -NXM_OF_VLAN_TCI(f009) -NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009) -NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header. -NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1. -NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway) -NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP. -NXM_OF_VLAN_TCI_W(1123/ffff) # Packets with VID=123, PCP=0 -NXM_OF_VLAN_TCI_W(1123/0000) # Packets with or without 802.1Q header -NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7. -NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0 - -# IP TOS -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41) -NXM_OF_IP_TOS(f0) - -# IP ECN -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06) -NXM_NX_IP_ECN(03) - -# IP protocol -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05) -NXM_OF_IP_PROTO(05) - -# IP TTL -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff) -NXM_NX_IP_TTL(80) - -# IP source -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/ffffffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/00000000) -NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014) -NXM_OF_IP_SRC_W(C0D80000/FFFF0000) - -# IP destination -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/ffffffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/00000000) -NXM_OF_IP_DST(ac100014) -NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000) - -# TCP source port -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231) - -# TCP destination port -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231) - -# TCP flags -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS(0131) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00F0/0FF0) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(01E2/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00E1/0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_NX_TCP_FLAGS(4321) - -# UDP source port -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/ffff) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823) - -# UDP destination port -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/FFFF) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/0000) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293) - -# ICMP type -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10) - -# ICMP code -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10) -NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10) -NXM_OF_ICMP_CODE(00) - -# ARP opcode -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111) -NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001) -NXM_OF_ARP_OP(0001) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001) - -# ARP source protocol address -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/00000000) -NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) -NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000) - -# ARP destination protocol address -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/00000000) -NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) -NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) - -# ARP source hardware address -NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4) -NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4) -NXM_NX_ARP_SHA(0002e30f80a4) - -# ARP destination hardware address -NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4) -NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4) -NXM_NX_ARP_THA(0002e30f80a4) - -# RARP opcode -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(1111) -NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0003) -NXM_OF_ARP_OP(0003) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) NXM_OF_ARP_OP(0003) - -# RARP source protocol address -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA(ac100014) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/00000000) -NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) -NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000) - -# RARP destination protocol address -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA(ac100014) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/77777777) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) -NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/00000000) -NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) -NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) - -# RARP source hardware address -NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_SHA(0002e30f80a4) -NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4) -NXM_NX_ARP_SHA(0002e30f80a4) - -# RARP destination hardware address -NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_THA(0002e30f80a4) -NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4) -NXM_NX_ARP_THA(0002e30f80a4) - -# IPv6 source -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) -NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) - -# IPv6 destination -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) -NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) - -# IPv6 Flow Label -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(1000000f) -NXM_NX_IPV6_LABEL(0000000f) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(0000000f) - -# ND target address -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/ffffffffffffffffffffffffffffffff) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/00000000000000000000000000000000) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef) - -# ND source hardware address -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3b) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) - -# ND destination hardware address -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) -NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3b) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) -NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) - -# IPv4 fragments. -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/ff) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/00) -NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3) - -# IPv6 fragments. -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/00) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/ff) -NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3) - -# Flow cookie. -NXM_NX_COOKIE(00000000abcdef01) -NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF) -NXM_NX_COOKIE_W(84200000abcdef01/ffffffffffffffff) -NXM_NX_COOKIE_W(84200000abcdef01/0000000000000000) - -# Tunnel ID. -NXM_NX_TUN_ID(00000000abcdef01) -NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF) -NXM_NX_TUN_ID_W(84200000abcdef01/FFFFFFFFFFFFFFFF) -NXM_NX_TUN_ID_W(84200000abcdef01/0000000000000000) - -# Register 0. -NXM_NX_REG0(acebdf56) -NXM_NX_REG0_W(a0e0d050/f0f0f0f0) -NXM_NX_REG0_W(a0e0d050/ffffffff) -NXM_NX_REG0_W(a0e0d050/00000000) - -# Invalid field number. -01020304(1111/2222) - -# Unimplemented registers. -# -# This test assumes that at least two registers, but fewer than 16, -# registers are implemented. -00010004(12345678) -00010108(12345678/12345678) -00011e04(12345678) -00011f08(12345678/12345678) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:815: ovs-ofctl -vPATTERN:'console:%c|%p|%m' --strict parse-nx-match < nx-match.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:815" -( $at_check_trace; ovs-ofctl -vPATTERN:'console:%c|%p|%m' --strict parse-nx-match < nx-match.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo " - -# in port -NXM_OF_IN_PORT(0000) -NXM_OF_IN_PORT(fffe) - -# eth dst -NXM_OF_ETH_DST(0002e30f80a4) -NXM_OF_ETH_DST_W(010000000000/010000000000) -NXM_OF_ETH_DST_W(000000000000/010000000000) -NXM_OF_ETH_DST_W(010000000000/010000000000) -NXM_OF_ETH_DST(0002e30f80a4) - -NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) -NXM_OF_ETH_DST_W(40125218000a/5a5a5a5a5a5a) - -# eth src -NXM_OF_ETH_SRC(020898456ddb) -NXM_OF_ETH_SRC_W(012345014545/ffffff555555) -NXM_OF_ETH_SRC(020898456ddb) - - -# eth type -NXM_OF_ETH_TYPE(0800) -NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800) - -# vlan tci -NXM_OF_VLAN_TCI(f009) -nx_pull_match() returned error OFPBMC_DUP_FIELD -NXM_OF_VLAN_TCI(0000) -NXM_OF_VLAN_TCI(3123) -NXM_OF_VLAN_TCI(0123) -NXM_OF_VLAN_TCI_W(1123/1fff) -NXM_OF_VLAN_TCI(1123) - -NXM_OF_VLAN_TCI_W(f000/f000) -NXM_OF_VLAN_TCI_W(0000/e000) - -# IP TOS -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0) -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP ECN -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03) -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP protocol -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP TTL -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP source -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(40080000/5a5a5a5a) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80000) -NXM_OF_ETH_TYPE(0800) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP destination -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(40080000/5a5a5a5a) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(c0a80000) -NXM_OF_ETH_TYPE(0800) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# TCP source port -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(5050) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# TCP destination port -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(fde0) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# TCP flags -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0131) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS_W(00f0/0ff0) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(01e2) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# UDP source port -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(0132) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# UDP destination port -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(5005) -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ICMP type -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ICMP code -NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ARP opcode -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001) -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_DUP_FIELD - -# ARP source protocol address -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(80a80200/aaaaaa00) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a81234) -NXM_OF_ETH_TYPE(0806) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ARP destination protocol address -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(40201234/77777777) -NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(c0a81234) -NXM_OF_ETH_TYPE(0806) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ARP source hardware address -NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ARP destination hardware address -NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# RARP opcode -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_OP(0003) -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_DUP_FIELD - -# RARP source protocol address -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(ac100014) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(80a80200/aaaaaa00) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(c0a81234) -NXM_OF_ETH_TYPE(8035) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# RARP destination protocol address -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(ac100014) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(c0a81200/ffffff00) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(40201234/77777777) -NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(c0a81234) -NXM_OF_ETH_TYPE(8035) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# RARP source hardware address -NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_SHA(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# RARP destination hardware address -NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_THA(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IPv6 source -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(00000818184800000000000000000000/5a5a5a5a5a5a5a5a0000000000000000) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000000) -NXM_OF_ETH_TYPE(86dd) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IPv6 destination -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010530344500010000000000000000/77777777777777777777777777777777) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010000000000000000) -NXM_OF_ETH_TYPE(86dd) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IPv6 Flow Label -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ -NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(0000000f) - -# ND target address -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET_W(00010520080900010000000000040000/0123456789abcdeffedcba9876543210) -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87) -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET_W(20000898344400000002000300000005/fedcba98765432100123456789abcdef) - -# ND source hardware address -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005), NXM_NX_ND_SLL(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ND destination hardware address -NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005), NXM_NX_ND_TLL(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IPv4 fragments. -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) -nx_pull_match() returned error OFPBMC_BAD_VALUE - -# IPv6 fragments. -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) -NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) -nx_pull_match() returned error OFPBMC_BAD_VALUE - -# Flow cookie. -NXM_NX_COOKIE(00000000abcdef01) -NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff) -NXM_NX_COOKIE(84200000abcdef01) - - -# Tunnel ID. -NXM_NX_TUN_ID(00000000abcdef01) -NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff) -NXM_NX_TUN_ID(84200000abcdef01) - - -# Register 0. -NXM_NX_REG0(acebdf56) -NXM_NX_REG0_W(a0e0d050/f0f0f0f0) -NXM_NX_REG0(a0e0d050) - - -# Invalid field number. -nx_pull_match() returned error OFPBMC_BAD_FIELD - -# Unimplemented registers. -# -# This test assumes that at least two registers, but fewer than 16, -# registers are implemented. -NXM_NX_REG0(12345678) -NXM_NX_REG0_W(12345678/12345678) -nx_pull_match() returned error OFPBMC_BAD_FIELD -nx_pull_match() returned error OFPBMC_BAD_FIELD -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:815" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check that at least the first warning made it. (It's rate-limited -# so a variable number could show up, especially under valgrind etc.) -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:1112: grep 'has 1-bits in value' stderr | sed 1q" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:1112" -( $at_check_trace; grep 'has 1-bits in value' stderr | sed 1q -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "nx_match|WARN|NXM/OXM entry NXM_OF_ETH_DST_W(ffffffffffff/010000000000) has 1-bits in value for bits wildcarded by the mask. (Future versions of OVS may report this as an OpenFlow error.) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:1112" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check that there wasn't any other stderr output. -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:1117: grep -v 'has 1-bits in value' stderr" -at_fn_check_prepare_trace "ovs-ofctl.at:1117" -( $at_check_trace; grep -v 'has 1-bits in value' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:1117" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_308 -#AT_START_309 -at_fn_group_banner 309 'ovs-ofctl.at:1120' \ - "ovs-ofctl parse-ofp10-match" " " 18 -at_xfail=no -( - $as_echo "309. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-data <<'_ATEOF' -# in_port=LOCAL -003820fe fffe xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_src=00:01:02:03:04:05 -003820fb xxxx 000102030405 xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_dst=10:20:30:40:50:60 -003820f7 xxxx xxxxxxxxxxxx 102030405060 xxxx xx xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_vlan=291 -003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 xx xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_vlan_pcp=5 -002820ff xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx 05 xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_vlan=291,dl_vlan_pcp=4 -002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 04 xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# vlan_tci=0x0000 -003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff xx xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# vlan_tci=0x0000 -# 1: 28 -> 38 -# 20: 05 -> 00 -002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff 05 xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_vlan=256,dl_vlan_pcp=7 -# 18: f1 -> 01 -# 20: ff -> 07 -002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx f100 ff xx xxxx xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_type=0x1234 -003820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# ip,nw_proto=5 -003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 05 xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# dl_type=0x1234,nw_proto=5 -# normal: 3: cf -> ef -# normal: 25: 05 -> 00 -& ofp_util|INFO|normalization changed ofp_match, details: -& ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5 -& ofp_util|INFO|post: dl_type=0x1234 -003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# ip,nw_tos=252 -001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 fc xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# arp,nw_tos=4 -# 24: 05 -> 04 -# normal: 1: 18 -> 38 -# normal: 24: 04 -> 00 -& ofp_util|INFO|normalization changed ofp_match, details: -& ofp_util|INFO| pre: arp,nw_tos=4 -& ofp_util|INFO|post: arp -001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# ip,nw_tos=48 -# 24: 31 -> 30 -001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 31 xx xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# arp,arp_op=2 -003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx 02 xxxx xxxxxxxx xxxxxxxx xxxx xxxx - -# ip,nw_src=192.168.128.85 -003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx c0a88055 xxxxxxxx xxxx xxxx - -# ip,nw_src=192.168.128.0/24 -# 31: 55 -> 00 -003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx c0a88055 xxxxxxxx xxxx xxxx - -# ip,nw_dst=192.168.128.85 -003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx xxxxxxxx c0a88055 xxxx xxxx - -# ip,nw_dst=192.168.128.0/24 -# 35: 55 -> 00 -003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx xxxxxxxx c0a88055 xxxx xxxx - -# arp,arp_spa=192.168.128.85 -003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx c0a88055 xxxxxxxx xxxx xxxx - -# arp,arp_spa=192.168.128.0/24 -# 31: 55 -> 00 -003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx c0a88055 xxxxxxxx xxxx xxxx - -# arp,arp_tpa=192.168.128.85 -003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx xxxxxxxx c0a88055 xxxx xxxx - -# arp,arp_tpa=192.168.128.0/24 -# 35: 55 -> 00 -003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx xxxxxxxx c0a88055 xxxx xxxx - -# dl_type=0x1234,nw_src=192.168.128.0/24 -# 31: 55 -> 00 -# normal: 2: 08 -> 20 -# normal: 28: c0 -> 00 -# normal: 29: a8 -> 00 -# normal: 30: 80 -> 00 -& ofp_util|INFO|normalization changed ofp_match, details: -& ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24 -& ofp_util|INFO|post: dl_type=0x1234 -003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx c0a88055 xxxxxxxx xxxx xxxx - -# dl_type=0x1234,nw_dst=192.168.128.0/24 -# 35: 55 -> 00 -# normal: 1: 32 -> 38 -# normal: 32: c0 -> 00 -# normal: 33: a8 -> 00 -# normal: 34: 80 -> 00 -& ofp_util|INFO|normalization changed ofp_match, details: -& ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24 -& ofp_util|INFO|post: dl_type=0x1234 -003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx xxxxxxxx c0a88055 xxxx xxxx - -# tcp,tp_src=443 -0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx xxxxxxxx xxxxxxxx 01bb xxxx - -# tcp,tp_dst=443 -0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx xxxxxxxx xxxxxxxx xxxx 01bb - -# udp,tp_src=443 -0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx xxxxxxxx xxxxxxxx 01bb xxxx - -# udp,tp_dst=443 -0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx xxxxxxxx xxxxxxxx xxxx 01bb - -# sctp,tp_src=443 -0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx xxxxxxxx xxxxxxxx 01bb xxxx - -# sctp,tp_dst=443 -0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx xxxxxxxx xxxxxxxx xxxx 01bb - -# icmp,icmp_type=5 -0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx xxxxxxxx xxxxxxxx 0005 xxxx - -# icmp,icmp_code=8 -0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx xxxxxxxx xxxxxxxx xxxx 0008 - -# ip,nw_proto=21,tp_src=443 -# normal: 3: 8f -> cf -# normal: 36: 01 -> 00 -# normal: 37: bb -> 00 -& ofp_util|INFO|normalization changed ofp_match, details: -& ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443 -& ofp_util|INFO|post: ip,nw_proto=21 -0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx xxxxxxxx xxxxxxxx 01bb xxxx - -# ip,nw_proto=21,tp_dst=443 -# normal: 3: 4f -> cf -# normal: 38: 01 -> 00 -# normal: 39: bb -> 00 -0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx xxxxxxxx xxxxxxxx xxxx 01bb - -_ATEOF - -sed '/^[#&]/d' < test-data > input.txt -sed -n 's/^# //p; /^$/p' < test-data > expout -sed -n 's/^& //p' < test-data > experr - - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:1330: ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-match < input.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:1330" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-match < input.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:1330" -$at_failed && at_fn_log_failure \ -"input.txt" \ -"expout" \ -"experr" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_309 -#AT_START_310 -at_fn_group_banner 310 'ovs-ofctl.at:1335' \ - "ovs-ofctl parse-ofp11-match" " " 18 -at_xfail=no -( - $as_echo "310. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-data <<'_ATEOF' -# in_port=LOCAL -0000 0058 fffffffe 000003fe 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# bad ofp11_match: OFPBMC_BAD_VALUE -& ofp_util|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff -0000 0058 12345678 000003fe 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_src=00:01:02:03:04:05 -0000 0058 00000000 000003ff 000102030405000000000000 000000000000ffffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_src=55:55:55:55:55:55/55:55:55:55:55:55 -0000 0058 00000000 000003ff 555555555555aaaaaaaaaaaa 000000000000ffffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_dst=00:01:02:03:04:05 -0000 0058 00000000 000003ff 000000000000ffffffffffff 000102030405000000000000 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 -0000 0058 00000000 000003ff 000000000000ffffffffffff 010000000000feffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_dst=00:01:02:03:04:05/fe:ff:ff:ff:ff:ff -0000 0058 00000000 000003ff 000000000000ffffffffffff 000102030405010000000000 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_dst=55:55:55:55:55:55/55:55:55:55:55:55 -0000 0058 00000000 000003ff 000000000000ffffffffffff 555555555555aaaaaaaaaaaa 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# in_port=1 -# 11: fa -> fe -# 38: 03 -> 00 -0000 0058 00000001 000003fa 000000000000ffffffffffff 000000000000ffffffffffff 0000 03 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_vlan=291 -0000 0058 00000000 000003fd 000000000000ffffffffffff 000000000000ffffffffffff 0123 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# vlan_tci=0x0000 -0000 0058 00000000 000003fd 000000000000ffffffffffff 000000000000ffffffffffff ffff 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# vlan_tci=0x0000 -# 11: f9 -> fd -# 38: 05 -> 00 -0000 0058 00000000 000003f9 000000000000ffffffffffff 000000000000ffffffffffff ffff 05 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# vlan_tci=0x1000/0x1000 -0000 0058 00000000 000003fd 000000000000ffffffffffff 000000000000ffffffffffff fffe 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# bad ofp11_match: OFPBMC_BAD_VALUE -0000 0058 00000000 000003fd 000000000000ffffffffffff 000000000000ffffffffffff 1234 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_vlan_pcp=4 -0000 0058 00000000 000003f9 000000000000ffffffffffff 000000000000ffffffffffff fffe 04 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_vlan=10,dl_vlan_pcp=6 -0000 0058 00000000 000003f9 000000000000ffffffffffff 000000000000ffffffffffff 000a 06 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# dl_type=0x1234 -0000 0058 00000000 000003f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_tos=252 -0000 0058 00000000 000003e7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 fc 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# bad ofp11_match: OFPBMC_BAD_VALUE -0000 0058 00000000 000003e7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 01 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_proto=5 -0000 0058 00000000 000003d7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 05 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# arp,arp_op=2 -0000 0058 00000000 000003d7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0806 00 02 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_src=192.168.128.0/24 -0000 0058 00000000 000003f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_src=128.160.128.0/165.165.165.165 -# 44: c0 -> 80 -# 45: a8 -> a0 -0000 0058 00000000 000003f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 00 c0a880005a5a5a5a 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_dst=192.168.128.0/24 -0000 0058 00000000 000003f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 00 00000000ffffffff c0a88000000000ff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_dst=128.160.128.0/165.165.165.165 -# 52: c0 -> 80 -# 53: a8 -> a0 -0000 0058 00000000 000003f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# arp,arp_spa=192.168.128.0/24 -0000 0058 00000000 000003f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# arp,arp_tpa=192.168.128.0/24 -0000 0058 00000000 000003f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# tcp,tp_src=443 -0000 0058 00000000 00000397 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 01bb 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# tcp,tp_dst=443 -0000 0058 00000000 00000357 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 0000 01bb 00000000 00 000000 0000000000000000ffffffffffffffff - -# udp,tp_src=443 -0000 0058 00000000 00000397 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# icmp,icmp_type=5 -0000 0058 00000000 00000397 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0005 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# icmp,icmp_code=8 -0000 0058 00000000 00000357 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0000 0008 00000000 00 000000 0000000000000000ffffffffffffffff - -# udp,tp_src=443 -0000 0058 00000000 00000397 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# udp,tp_dst=443 -0000 0058 00000000 00000357 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 0000 01bb 00000000 00 000000 0000000000000000ffffffffffffffff - -# sctp -0000 0058 00000000 000003d7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# sctp,tp_src=443 -0000 0058 00000000 00000397 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 01bb 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# sctp,tp_dst=443 -0000 0058 00000000 00000357 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 01bb 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_proto=21 -# 11: 97 -> d7 -# 60: 01 -> 00 -# 61: bb -> 00 -0000 0058 00000000 00000397 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 15 00000000ffffffff 00000000ffffffff 01bb 0000 00000000 00 000000 0000000000000000ffffffffffffffff - -# ip,nw_proto=22 -# 11: 57 -> d7 -# 62: 01 -> 00 -# 63: bb -> 00 -0000 0058 00000000 00000357 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0800 00 16 00000000ffffffff 00000000ffffffff 0000 01bb 00000000 00 000000 0000000000000000ffffffffffffffff - -# mpls,mpls_label=284280 -# 64: 12 -> 00 -# 65: 34 -> 04 -0000 0058 00000000 000002f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 8847 00 00 00000000ffffffff 00000000ffffffff 0000 0000 12345678 00 000000 0000000000000000ffffffffffffffff - -# mplsm,mpls_tc=2 -# 68: 5a -> 02 -0000 0058 00000000 000001f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 8848 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 5a 000000 0000000000000000ffffffffffffffff - -# dl_type=0x1234 -# 10: 00 -> 03 -# 64: 12 -> 00 -# 65: 34 -> 00 -# 66: 56 -> 00 -# 67: 78 -> 00 -# 68: 5a -> 00 -0000 0058 00000000 000000f7 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 12345678 5a 000000 0000000000000000ffffffffffffffff - -# metadata=0x1234567890abcdef -0000 0058 00000000 000003ff 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 1234567890abcdef0000000000000000 - -# metadata=0x5555555555555555/0x5555555555555555 -0000 0058 00000000 000003ff 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 5555555555555555aaaaaaaaaaaaaaaa - -# metadata=0x1234000090ab0000/0xffff0000ffff0000 -# 74: 56 -> 00 -# 75: 78 -> 00 -# 78: cd -> 00 -# 79: ef -> 00 -0000 0058 00000000 000003ff 000000000000ffffffffffff 000000000000ffffffffffff 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 00000000 00 000000 1234567890abcdef0000ffff0000ffff - -_ATEOF - -sed '/^[#&]/d' < test-data > input.txt -sed -n 's/^# //p; /^$/p' < test-data > expout -sed -n 's/^& //p' < test-data > experr - - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:1656: ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:1656" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:1656" -$at_failed && at_fn_log_failure \ -"input.txt" \ -"expout" \ -"experr" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_310 -#AT_START_311 -at_fn_group_banner 311 'ovs-ofctl.at:1661' \ - "ovs-ofctl parse-nx-match loose" " " 18 -at_xfail=no -( - $as_echo "311. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >nx-match.txt <<'_ATEOF' -NXM_OF_IN_PORT(0001), 01020304(1111/2222), NXM_OF_ETH_TYPE(0800) -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:1667: ovs-ofctl --strict parse-nx-match < nx-match.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:1667" -( $at_check_trace; ovs-ofctl --strict parse-nx-match < nx-match.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "nx_pull_match() returned error OFPBMC_BAD_FIELD -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:1667" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:1671: ovs-ofctl parse-nx-match < nx-match.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:1671" -( $at_check_trace; ovs-ofctl parse-nx-match < nx-match.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:1671" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_311 -#AT_START_312 -at_fn_group_banner 312 'ovs-ofctl.at:1676' \ - "ovs-ofctl parse-oxm" " " 18 -at_xfail=no -( - $as_echo "312. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >oxm.txt <<'_ATEOF' - - -# in port -OXM_OF_IN_PORT(00000000) -OXM_OF_IN_PORT(fffffffe) - -# metadata -OXM_OF_METADATA(5a5a5a5a5a5a5a5a) -OXM_OF_METADATA_W(0000000000000000/00000000ffffffff) -OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000) -OXM_OF_METADATA_W(1234567890abcdef/ffffffffffffffff) -OXM_OF_METADATA_W(1234567890abcdef/0000000000000000) - -# eth dst -OXM_OF_ETH_DST(0002e30f80a4) -OXM_OF_ETH_DST_W(010000000000/010000000000) -OXM_OF_ETH_DST_W(000000000000/010000000000) -OXM_OF_ETH_DST_W(ffffffffffff/010000000000) -OXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff) -OXM_OF_ETH_DST_W(0002e30f80a4/000000000000) -OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) - -# eth src -OXM_OF_ETH_SRC(020898456ddb) - -# eth type -OXM_OF_ETH_TYPE(0800) -OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012) - -# vlan -OXM_OF_VLAN_VID(1009) OXM_OF_VLAN_VID(1009) # Duplicate Field -OXM_OF_VLAN_VID(f009) # Bad Value -OXM_OF_VLAN_PCP(00) # Bad Pre-Requisite -OXM_OF_VLAN_VID(0000) # Packets without 802.1Q header or with VID=0 -OXM_OF_VLAN_VID(1123) # Packets with VID=123, any PCP -OXM_OF_VLAN_VID(1123) OXM_OF_VLAN_PCP(01) # Packets with VID=123, PCP=1. -OXM_OF_VLAN_VID(0123) # Does not make sense (but supported anyway) -OXM_OF_VLAN_VID_W(0123/0123) # Does not make sense (but supported anyway) -OXM_OF_VLAN_VID_W(1123/0123) # Does not make sense (but supported anyway) -OXM_OF_VLAN_VID_W(0123/1123) # Does not make sense (but supported anyway) -OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01) #Bad Pre-Requisite -OXM_OF_VLAN_VID_W(1123/1fff) # Packets with VID=123, any PCP. -OXM_OF_VLAN_VID_W(1123/ffff) # Packets with VID=123, any PCP. -OXM_OF_VLAN_VID_W(1123/0000) # Packets with or without 802.1Q header -OXM_OF_VLAN_VID_W(1123/1f0f), # Packets with # VID=123 (masked) -OXM_OF_VLAN_VID_W(1123/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP. -OXM_OF_VLAN_VID_W(1000/1000) # Packets with any VID, any PCP -OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) # Packets with any VID, PCP=1. - -# IP TOS -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(f0) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(41) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(3f) -OXM_OF_IP_DSCP(f0) - -# IP ECN -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(06) -OXM_OF_IP_ECN(03) - -# IP protocol -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(05) -OXM_OF_IP_PROTO(05) - -# IP source -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFFFFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/00000000) -OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014) -OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000) - -# IP destination -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFF0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFFFFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/00000000) -OXM_OF_IPV4_DST(ac100014) -OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000) - -# TCP source port -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231) - -# TCP destination port -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231) - -# UDP source port -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823) - -# UDP destination port -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293) - -# SCTP source port -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC(8732) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/01FF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_SCTP_SRC(7823) - -# SCTP destination port -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST(1782) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/F00F) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/FFFF) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/0000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_SCTP_DST(1293) - -# ICMP type -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_TYPE(12) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_TYPE(10) - -# ICMP code -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_CODE(12) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_CODE(10) -OXM_OF_ETH_TYPE(0800) OXM_OF_ICMPV4_CODE(10) -OXM_OF_ICMPV4_CODE(00) - -# ARP opcode -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(1111) -OXM_OF_ETH_TYPE(0000) OXM_OF_ARP_OP(0001) -OXM_OF_ARP_OP(0001) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) OXM_OF_ARP_OP(0001) - -# ARP source protocol address -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFFFF) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/00000000) -OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014) -OXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000) - -# ARP destination protocol address -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFFFF) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/00000000) -OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014) -OXM_OF_ARP_TPA_W(C0D80000/FFFF0000) - -# ARP source hardware address -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA(0002e30f80a4) -OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4) -OXM_OF_ARP_SHA(0002e30f80a4) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/ffffffffffff) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/000000000000) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/00000000000f) - -# ARP destination hardware address -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4) -OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4) -OXM_OF_ARP_THA(0002e30f80a4) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/ffffffffffff) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/000000000000) -OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/00000000000f) - -# IPv6 source -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) - -# IPv6 destination -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) -OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) - -# IPv6 Flow Label -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f) -OXM_OF_IPV6_FLABEL(0000000f) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000ffff0) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/00000000) - -# ND source hardware address -OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3b) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) - -# ND destination hardware address -OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) -OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3b) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) -OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) - -# Invalid field number. -01020304(1111/2222) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:1893: ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:1893" -( $at_check_trace; ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo " - -# in port -OXM_OF_IN_PORT(00000000) -OXM_OF_IN_PORT(fffffffe) - -# metadata -OXM_OF_METADATA(5a5a5a5a5a5a5a5a) -OXM_OF_METADATA_W(0000000000000000/00000000ffffffff) -OXM_OF_METADATA_W(1234000090ab0000/ffff0000ffff0000) -OXM_OF_METADATA(1234567890abcdef) - - -# eth dst -OXM_OF_ETH_DST(0002e30f80a4) -OXM_OF_ETH_DST_W(010000000000/010000000000) -OXM_OF_ETH_DST_W(000000000000/010000000000) -OXM_OF_ETH_DST_W(010000000000/010000000000) -OXM_OF_ETH_DST(0002e30f80a4) - -OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) - -# eth src -OXM_OF_ETH_SRC(020898456ddb) - -# eth type -OXM_OF_ETH_TYPE(0800) -OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800) - -# vlan -nx_pull_match() returned error OFPBMC_DUP_FIELD -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ -OXM_OF_VLAN_VID(0000) -OXM_OF_VLAN_VID(1123) -OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01) -OXM_OF_VLAN_VID(0123) -OXM_OF_VLAN_VID_W(0123/0123) -OXM_OF_VLAN_VID_W(0123/0123) -OXM_OF_VLAN_VID_W(0123/1123) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -OXM_OF_VLAN_VID(1123) -OXM_OF_VLAN_VID(1123) - -OXM_OF_VLAN_VID_W(1103/1f0f) -OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) -OXM_OF_VLAN_VID_W(1000/1000) -OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) - -# IP TOS -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_VALUE -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_DSCP(3f) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP ECN -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03) -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP protocol -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(05) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP source -OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(ac100014) -OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC_W(c0a80000/ffff0000) -OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(c0a80000) -OXM_OF_ETH_TYPE(0800) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IP destination -OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(ac100014) -OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST_W(c0a80000/ffff0000) -OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(c0a88012) -OXM_OF_ETH_TYPE(0800) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# TCP source port -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(4231) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC_W(5050/f0f0) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(5050) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# TCP destination port -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(4231) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST_W(fde0/fff0) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(fde0) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# UDP source port -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(8732) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC_W(0132/01ff) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(0132) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# UDP destination port -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(1782) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST_W(5005/f00f) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(5005) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# SCTP source port -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(8732) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC_W(0132/01ff) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(0132) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# SCTP destination port -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(1782) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST_W(5005/f00f) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(5005) -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ICMP type -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_TYPE(12) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ICMP code -OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_CODE(12) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ARP opcode -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_OP(0001) -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_DUP_FIELD - -# ARP source protocol address -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(ac100014) -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA_W(c0a81200/ffffff00) -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(c0a81234) -OXM_OF_ETH_TYPE(0806) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ARP destination protocol address -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(ac100014) -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA_W(c0a81200/ffffff00) -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(c0a812fe) -OXM_OF_ETH_TYPE(0806) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ARP source hardware address -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4) -OXM_OF_ETH_TYPE(0806) -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA_W(000000000004/00000000000f) - -# ARP destination hardware address -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4) -OXM_OF_ETH_TYPE(0806) -OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA_W(000000000004/00000000000f) - -# IPv6 source -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010000000000000000) -OXM_OF_ETH_TYPE(86dd) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IPv6 destination -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010000000000000000) -OXM_OF_ETH_TYPE(86dd) -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# IPv6 Flow Label -nx_pull_match() returned error OFPBMC_BAD_VALUE -nx_pull_match() returned error OFPBMC_BAD_PREREQ -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(0000000f/0000000f) -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(00000000/000ffff0) -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) -OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) -OXM_OF_ETH_TYPE(86dd) - -# ND source hardware address -OXM_OF_ETH_TYPE(86dd), OXM_OF_IP_PROTO(3a), OXM_OF_ICMPV6_TYPE(87), OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005), OXM_OF_IPV6_ND_SLL(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# ND destination hardware address -OXM_OF_ETH_TYPE(86dd), OXM_OF_IP_PROTO(3a), OXM_OF_ICMPV6_TYPE(88), OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005), OXM_OF_IPV6_ND_TLL(0002e30f80a4) -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ -nx_pull_match() returned error OFPBMC_BAD_PREREQ - -# Invalid field number. -nx_pull_match() returned error OFPBMC_BAD_FIELD -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:1893" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check that at least the first warning made it. (It's rate-limited -# so a variable number could show up, especially under valgrind etc.) -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2112: grep 'has 1-bits in value' stderr | sed 1q" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2112" -( $at_check_trace; grep 'has 1-bits in value' stderr | sed 1q -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "nx_match|WARN|NXM/OXM entry OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000) has 1-bits in value for bits wildcarded by the mask. (Future versions of OVS may report this as an OpenFlow error.) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2112" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check that there wasn't any other stderr output. -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2117: grep -v 'has 1-bits in value' stderr" -at_fn_check_prepare_trace "ovs-ofctl.at:2117" -( $at_check_trace; grep -v 'has 1-bits in value' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2117" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_312 -#AT_START_313 -at_fn_group_banner 313 'ovs-ofctl.at:2120' \ - "ovs-ofctl parse-oxm loose" " " 18 -at_xfail=no -( - $as_echo "313. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >oxm.txt <<'_ATEOF' -OXM_OF_IN_PORT(00000001), 01020304(1111/2222), OXM_OF_ETH_TYPE(0800) -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2126: ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2126" -( $at_check_trace; ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "nx_pull_match() returned error OFPBMC_BAD_FIELD -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2126" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2130: ovs-ofctl parse-oxm OpenFlow12 < oxm.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2130" -( $at_check_trace; ovs-ofctl parse-oxm OpenFlow12 < oxm.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2130" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_313 -#AT_START_314 -at_fn_group_banner 314 'ovs-ofctl.at:2135' \ - "check TCP flags expression in OXM and NXM" " " 18 -at_xfail=no -( - $as_echo "314. $at_setup_line: testing $at_desc ..." - $at_traceon - -# NXM/OXM input for matching on TCP flags. -tcp_flags='OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)' - -# Check that marshaling into NXM gives all NXM headers. -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2140: echo \"\$tcp_flags\" | ovs-ofctl parse-nxm" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2140" -( $at_check_trace; echo "$tcp_flags" | ovs-ofctl parse-nxm -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2140" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check that marshaling in OXM for OF1.2 through OF1.4 gives OXM -# headers except for TCP flags, which didn't have an OXM definition until -# OF1.5. -for version in OpenFlow12 OpenFlow13 OpenFlow14; do - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2148: echo \"\$tcp_flags\" | ovs-ofctl parse-oxm \$version" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2148" -( $at_check_trace; echo "$tcp_flags" | ovs-ofctl parse-oxm $version -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2148" -$at_failed && at_fn_log_failure -$at_traceon; } - -done - -# OpenFlow 1.5 added an OXM header for TCP flags: -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2154: echo \"\$tcp_flags\" | ovs-ofctl parse-oxm OpenFlow15" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2154" -( $at_check_trace; echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2154" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_314 -#AT_START_315 -at_fn_group_banner 315 'ovs-ofctl.at:2161' \ - "ovs-ofctl check-vlan" " " 18 -at_xfail=no -( - $as_echo "315. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2165: ovs-ofctl check-vlan 0000 0000" -at_fn_check_prepare_trace "ovs-ofctl.at:2165" -( $at_check_trace; ovs-ofctl check-vlan 0000 0000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -> 0000/0000 -NXM: -> 0000/0000 -OXM: -> 0000/0000,-- -OF1.0: 0000/1,00/1 -> 0000/0000 -OF1.1: 0000/1,00/1 -> 0000/0000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2165" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2174: ovs-ofctl check-vlan 0000 ffff" -at_fn_check_prepare_trace "ovs-ofctl.at:2174" -( $at_check_trace; ovs-ofctl check-vlan 0000 ffff -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "vlan_tci=0x0000 -> 0000/ffff -NXM: NXM_OF_VLAN_TCI(0000) -> 0000/ffff -OXM: OXM_OF_VLAN_VID(0000) -> 0000/1fff,-- -OF1.0: ffff/0,00/1 -> 0000/ffff -OF1.1: ffff/0,00/1 -> 0000/ffff -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2174" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2183: ovs-ofctl check-vlan 1abc 1fff" -at_fn_check_prepare_trace "ovs-ofctl.at:2183" -( $at_check_trace; ovs-ofctl check-vlan 1abc 1fff -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dl_vlan=2748 -> 1abc/1fff -NXM: NXM_OF_VLAN_TCI_W(1abc/1fff) -> 1abc/1fff -OXM: OXM_OF_VLAN_VID(1abc) -> 1abc/1fff,-- -OF1.0: 0abc/0,00/1 -> 1abc/1fff -OF1.1: 0abc/0,00/1 -> 1abc/1fff -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2183" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2192: ovs-ofctl check-vlan b000 f000" -at_fn_check_prepare_trace "ovs-ofctl.at:2192" -( $at_check_trace; ovs-ofctl check-vlan b000 f000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dl_vlan_pcp=5 -> b000/f000 -NXM: NXM_OF_VLAN_TCI_W(b000/f000) -> b000/f000 -OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(05) -> 1000/1000,05 -OF1.0: 0000/1,05/0 -> b000/f000 -OF1.1: fffe/0,05/0 -> b000/f000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2192" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2201: ovs-ofctl check-vlan babc ffff" -at_fn_check_prepare_trace "ovs-ofctl.at:2201" -( $at_check_trace; ovs-ofctl check-vlan babc ffff -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dl_vlan=2748,dl_vlan_pcp=5 -> babc/ffff -NXM: NXM_OF_VLAN_TCI(babc) -> babc/ffff -OXM: OXM_OF_VLAN_VID(1abc), OXM_OF_VLAN_PCP(05) -> 1abc/1fff,05 -OF1.0: 0abc/0,05/0 -> babc/ffff -OF1.1: 0abc/0,05/0 -> babc/ffff -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2201" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2210: ovs-ofctl check-vlan 0000 0fff" -at_fn_check_prepare_trace "ovs-ofctl.at:2210" -( $at_check_trace; ovs-ofctl check-vlan 0000 0fff -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "vlan_tci=0x0000/0x0fff -> 0000/0fff -NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff -OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- -OF1.0: 0000/0,00/1 -> 1000/1fff -OF1.1: 0000/0,00/1 -> 1000/1fff -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2210" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2219: ovs-ofctl check-vlan 0000 f000" -at_fn_check_prepare_trace "ovs-ofctl.at:2219" -( $at_check_trace; ovs-ofctl check-vlan 0000 f000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "vlan_tci=0x0000/0xf000 -> 0000/f000 -NXM: NXM_OF_VLAN_TCI_W(0000/f000) -> 0000/f000 -OXM: OXM_OF_VLAN_VID_W(0000/1000) -> 0000/1000,-- -OF1.0: ffff/0,00/1 -> 0000/ffff -OF1.1: ffff/0,00/1 -> 0000/ffff -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2219" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2228: ovs-ofctl check-vlan 0000 efff" -at_fn_check_prepare_trace "ovs-ofctl.at:2228" -( $at_check_trace; ovs-ofctl check-vlan 0000 efff -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "vlan_tci=0x0000/0xefff -> 0000/efff -NXM: NXM_OF_VLAN_TCI_W(0000/efff) -> 0000/efff -OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- -OF1.0: 0000/0,00/0 -> 1000/ffff -OF1.1: 0000/0,00/0 -> 1000/ffff -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2228" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2237: ovs-ofctl check-vlan 1001 1001" -at_fn_check_prepare_trace "ovs-ofctl.at:2237" -( $at_check_trace; ovs-ofctl check-vlan 1001 1001 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "vlan_tci=0x1001/0x1001 -> 1001/1001 -NXM: NXM_OF_VLAN_TCI_W(1001/1001) -> 1001/1001 -OXM: OXM_OF_VLAN_VID_W(1001/1001) -> 1001/1001,-- -OF1.0: 0001/0,00/1 -> 1001/1fff -OF1.1: 0001/0,00/1 -> 1001/1fff -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2237" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2246: ovs-ofctl check-vlan 3000 3000" -at_fn_check_prepare_trace "ovs-ofctl.at:2246" -( $at_check_trace; ovs-ofctl check-vlan 3000 3000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "vlan_tci=0x3000/0x3000 -> 3000/3000 -NXM: NXM_OF_VLAN_TCI_W(3000/3000) -> 3000/3000 -OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) -> 1000/1000,01 -OF1.0: 0000/1,01/0 -> 3000/f000 -OF1.1: fffe/0,01/0 -> 3000/f000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2246" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2253: " -at_fn_check_prepare_trace "ovs-ofctl.at:2253" -( $at_check_trace; -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2253" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_315 -#AT_START_316 -at_fn_group_banner 316 'ovs-ofctl.at:2258' \ - "ovs-ofctl -F option and NXM features" " " 18 -at_xfail=no -( - $as_echo "316. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2259: ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop" -at_fn_check_prepare_trace "ovs-ofctl.at:2259" -( $at_check_trace; ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2259" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2262: ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop" -at_fn_check_prepare_trace "ovs-ofctl.at:2262" -( $at_check_trace; ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: none of the usable flow formats (NXM,OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2262" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_316 -#AT_START_317 -at_fn_group_banner 317 'ovs-ofctl.at:2271' \ - "ovs-ofctl -F option with flow_mods" " " 18 -at_xfail=no -( - $as_echo "317. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2272: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2272" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2272" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2272: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2272" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2272" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2272: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2272" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2272" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2272: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2272" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2272" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2272: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2272" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2272" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2272: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2272" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2272" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2272: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-ofctl.at:2272" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2272" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2273: ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop" -at_fn_check_prepare_trace "ovs-ofctl.at:2273" -( $at_check_trace; ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2273" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2274: ovs-ofctl dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2274" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: - tun_id=0x12345678 actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2274" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2278: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2278" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2278" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2278: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2278" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2278" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2278: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2278" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2278" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_317 -#AT_START_318 -at_fn_group_banner 318 'ovs-ofctl.at:2283' \ - "ovs-ofctl dump-flows honors -F option" " " 18 -at_xfail=no -( - $as_echo "318. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2284: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2284" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2284" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2284: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2284" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2284" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2284: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2284" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2284" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2284: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2284" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2284: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2284" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2284: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2284" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2284: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-ofctl.at:2284" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2285: ovs-ofctl add-flow br0 reg0=0x12345,actions=drop" -at_fn_check_prepare_trace "ovs-ofctl.at:2285" -( $at_check_trace; ovs-ofctl add-flow br0 reg0=0x12345,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2285" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2286: ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2286" -( $at_check_trace; ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply: - actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2290: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2290" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2290: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2290" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2290: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2290" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_318 -#AT_START_319 -at_fn_group_banner 319 'ovs-ofctl.at:2295' \ - "ovs-ofctl dump-flows rejects bad -F option" " " 18 -at_xfail=no -( - $as_echo "319. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2296: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2296" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2296" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2296: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2296" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2296" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2296: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2296" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2296" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2296: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2296" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2296" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2296: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2296" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2296" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2296: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2296" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2296" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2296: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-ofctl.at:2296" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2296" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2297: ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef" -at_fn_check_prepare_trace "ovs-ofctl.at:2297" -( $at_check_trace; ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2297" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2300: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2300" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2300" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2300: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2300" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2300" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2300: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2300" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2300" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_319 -#AT_START_320 -at_fn_group_banner 320 'ovs-ofctl.at:2304' \ - "ovs-ofctl add-flow reports non-normalized flows" "" 18 -at_xfail=no -( - $as_echo "320. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2305: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2305" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2305" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2305: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2305" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2305" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2305: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2305" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2305" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2305: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2305" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2305: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2305" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2305: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2305" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2305: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-ofctl.at:2305" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2306: ovs-ofctl -vPATTERN:ANY:'%c|%p|%m' add-flow br0 nw_src=1.2.3.4,actions=5" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2306" -( $at_check_trace; ovs-ofctl -vPATTERN:ANY:'%c|%p|%m' add-flow br0 nw_src=1.2.3.4,actions=5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ofp_util|INFO|normalization changed ofp_match, details: -ofp_util|INFO| pre: nw_src=1.2.3.4 -ofp_util|INFO|post: -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2306" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2312: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2312" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2312" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2312: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2312" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2312" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2312: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2312" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2312" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_320 -#AT_START_321 -at_fn_group_banner 321 'ovs-ofctl.at:2318' \ - "ovs-ofctl dump-flows with sorting" " " 18 -at_xfail=no -( - $as_echo "321. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2319: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2319" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2319" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2319: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2319" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2319" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2319: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2319" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2319" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2319: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2319" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2319: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2319" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2319: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2319" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2319: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-ofctl.at:2319" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -cat >allflows.txt <<'_ATEOF' - -priority=4,in_port=23213 actions=output:42 -priority=5,in_port=1029 actions=output:43 -priority=7,in_port=1029 actions=output:43 -priority=3,in_port=1028 actions=output:44 -priority=1,in_port=1026 actions=output:45 -priority=6,in_port=1027 actions=output:64 -priority=2,in_port=1025 actions=output:47 -priority=8,tcp,tp_src=5 actions=drop -priority=9,tcp,tp_src=6 actions=drop -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2333: ovs-ofctl add-flows br0 allflows.txt -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2333" -( $at_check_trace; ovs-ofctl add-flows br0 allflows.txt - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2333" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2335: ovs-ofctl --sort dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2335" -( $at_check_trace; ovs-ofctl --sort dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " priority=1,in_port=1026 actions=output:45 - priority=2,in_port=1025 actions=output:47 - priority=3,in_port=1028 actions=output:44 - priority=4,in_port=23213 actions=output:42 - priority=5,in_port=1029 actions=output:43 - priority=6,in_port=1027 actions=output:64 - priority=7,in_port=1029 actions=output:43 - priority=8,tcp,tp_src=5 actions=drop - priority=9,tcp,tp_src=6 actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2335" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2346: ovs-ofctl --rsort dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2346" -( $at_check_trace; ovs-ofctl --rsort dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " priority=9,tcp,tp_src=6 actions=drop - priority=8,tcp,tp_src=5 actions=drop - priority=7,in_port=1029 actions=output:43 - priority=6,in_port=1027 actions=output:64 - priority=5,in_port=1029 actions=output:43 - priority=4,in_port=23213 actions=output:42 - priority=3,in_port=1028 actions=output:44 - priority=2,in_port=1025 actions=output:47 - priority=1,in_port=1026 actions=output:45 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2346" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2357: ovs-ofctl --sort=in_port dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2357" -( $at_check_trace; ovs-ofctl --sort=in_port dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " priority=2,in_port=1025 actions=output:47 - priority=1,in_port=1026 actions=output:45 - priority=6,in_port=1027 actions=output:64 - priority=3,in_port=1028 actions=output:44 - priority=7,in_port=1029 actions=output:43 - priority=5,in_port=1029 actions=output:43 - priority=4,in_port=23213 actions=output:42 - priority=9,tcp,tp_src=6 actions=drop - priority=8,tcp,tp_src=5 actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2357" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2368: ovs-ofctl --rsort=in_port dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2368" -( $at_check_trace; ovs-ofctl --rsort=in_port dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " priority=4,in_port=23213 actions=output:42 - priority=7,in_port=1029 actions=output:43 - priority=5,in_port=1029 actions=output:43 - priority=3,in_port=1028 actions=output:44 - priority=6,in_port=1027 actions=output:64 - priority=1,in_port=1026 actions=output:45 - priority=2,in_port=1025 actions=output:47 - priority=9,tcp,tp_src=6 actions=drop - priority=8,tcp,tp_src=5 actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2368" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2379: ovs-ofctl --sort=tcp_src dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2379" -( $at_check_trace; ovs-ofctl --sort=tcp_src dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " priority=8,tcp,tp_src=5 actions=drop - priority=9,tcp,tp_src=6 actions=drop - priority=7,in_port=1029 actions=output:43 - priority=6,in_port=1027 actions=output:64 - priority=5,in_port=1029 actions=output:43 - priority=4,in_port=23213 actions=output:42 - priority=3,in_port=1028 actions=output:44 - priority=2,in_port=1025 actions=output:47 - priority=1,in_port=1026 actions=output:45 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2379" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2390: ovs-ofctl --sort=in_port --sort=tcp_src dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2390" -( $at_check_trace; ovs-ofctl --sort=in_port --sort=tcp_src dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " priority=2,in_port=1025 actions=output:47 - priority=1,in_port=1026 actions=output:45 - priority=6,in_port=1027 actions=output:64 - priority=3,in_port=1028 actions=output:44 - priority=7,in_port=1029 actions=output:43 - priority=5,in_port=1029 actions=output:43 - priority=4,in_port=23213 actions=output:42 - priority=8,tcp,tp_src=5 actions=drop - priority=9,tcp,tp_src=6 actions=drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2390" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2402: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2402" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2402" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2402: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2402" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2402" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2402: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2402" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2402" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_321 -#AT_START_322 -at_fn_group_banner 322 'ovs-ofctl.at:2405' \ - "ovs-ofctl diff-flows" " " 18 -at_xfail=no -( - $as_echo "322. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2406: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2406" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2406" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2406: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2406" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2406" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2406: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2406" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2406" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2406: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2406" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2406" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2406: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2406" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2406" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2406: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2406" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2406" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2406: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-ofctl.at:2406" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2406" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Add tons of flows to br0. -for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2410: ovs-ofctl add-flows br0 add-flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2410" -( $at_check_trace; ovs-ofctl add-flows br0 add-flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2410" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Dump them and compare against what we expect by hand, then with diff-flows. -for i in `seq 0 1023`; do echo " dl_vlan=$i actions=drop"; done | sort > expout -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2414: ovs-ofctl dump-flows br0 | ofctl_strip | sed '/NXST_FLOW/d' | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2414" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sed '/NXST_FLOW/d' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2414" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2416: ovs-ofctl diff-flows br0 add-flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2416" -( $at_check_trace; ovs-ofctl diff-flows br0 add-flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2416" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Remove even-numbered flows, compare again. -for i in `seq 0 1023 2`; do echo "dl_vlan=$i"; done > del-flows.txt -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2420: ovs-ofctl del-flows br0 - < del-flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2420" -( $at_check_trace; ovs-ofctl del-flows br0 - < del-flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2420" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 1023 2`; do echo "+dl_vlan=$i actions=drop"; done | sort > expout -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2422: ovs-ofctl diff-flows br0 add-flows.txt | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2422" -( $at_check_trace; ovs-ofctl diff-flows br0 add-flows.txt | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2422" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 1023 2`; do echo "-dl_vlan=$i actions=drop"; done | sort > expout -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2424: ovs-ofctl diff-flows add-flows.txt br0 | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2424" -( $at_check_trace; ovs-ofctl diff-flows add-flows.txt br0 | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2424" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2426: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2426" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2426" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2426: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2426" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2426" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2426: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2426" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2426" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_322 -#AT_START_323 -at_fn_group_banner 323 'ovs-ofctl.at:2437' \ - "ovs-ofctl diff-flows - suppress false differences" "" 18 -at_xfail=no -( - $as_echo "323. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2438: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2438" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2438" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2438: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2438" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2438" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2438: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2438" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2438" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2438: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2438" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2438" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2438: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2438" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2438" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2438: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2438" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2438" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2438: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-ofctl.at:2438" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2438" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -actions=resubmit(,1) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2441: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2441" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2441" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2442: ovs-ofctl diff-flows br0 flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2442" -( $at_check_trace; ovs-ofctl diff-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2442" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2443: ovs-ofctl add-flow br0 idle_timeout=60,dl_vlan=9,actions=output:1" -at_fn_check_prepare_trace "ovs-ofctl.at:2443" -( $at_check_trace; ovs-ofctl add-flow br0 idle_timeout=60,dl_vlan=9,actions=output:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2443" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2444: ovs-ofctl diff-flows br0 flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2444" -( $at_check_trace; ovs-ofctl diff-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "-dl_vlan=9 idle_timeout=60 actions=output:1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-ofctl.at:2444" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2447: ovs-ofctl add-flow br0 hard_timeout=120,cookie=1234,dl_vlan=9,actions=output:1" -at_fn_check_prepare_trace "ovs-ofctl.at:2447" -( $at_check_trace; ovs-ofctl add-flow br0 hard_timeout=120,cookie=1234,dl_vlan=9,actions=output:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2447" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2448: ovs-ofctl diff-flows flows.txt br0" -at_fn_check_prepare_trace "ovs-ofctl.at:2448" -( $at_check_trace; ovs-ofctl diff-flows flows.txt br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "+dl_vlan=9 cookie=0x4d2 hard_timeout=120 actions=output:1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-ofctl.at:2448" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2451: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2451" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2451" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2451: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2451" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2451" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2451: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2451" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2451" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_323 -#AT_START_324 -at_fn_group_banner 324 'ovs-ofctl.at:2454' \ - "ovs-ofctl -F and -O interaction" " " 18 -at_xfail=no -( - $as_echo "324. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2455: ovs-ofctl -F oxm -O openflow10" -at_fn_check_prepare_trace "ovs-ofctl.at:2455" -( $at_check_trace; ovs-ofctl -F oxm -O openflow10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2455" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2458: ovs-ofctl -F oxm -O openflow11" -at_fn_check_prepare_trace "ovs-ofctl.at:2458" -( $at_check_trace; ovs-ofctl -F oxm -O openflow11 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow11) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2458" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2461: ovs-ofctl -F oxm -O openflow10,openflow11" -at_fn_check_prepare_trace "ovs-ofctl.at:2461" -( $at_check_trace; ovs-ofctl -F oxm -O openflow10,openflow11 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10, OpenFlow11) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2461" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2464: ovs-ofctl -F oxm -O openflow10,openflow12" -at_fn_check_prepare_trace "ovs-ofctl.at:2464" -( $at_check_trace; ovs-ofctl -F oxm -O openflow10,openflow12 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: missing command name; use --help for help -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2464" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2467: ovs-ofctl -F oxm -O openflow12" -at_fn_check_prepare_trace "ovs-ofctl.at:2467" -( $at_check_trace; ovs-ofctl -F oxm -O openflow12 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: missing command name; use --help for help -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2467" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2470: ovs-ofctl -F oxm -O openflow13" -at_fn_check_prepare_trace "ovs-ofctl.at:2470" -( $at_check_trace; ovs-ofctl -F oxm -O openflow13 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: missing command name; use --help for help -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2470" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_324 -#AT_START_325 -at_fn_group_banner 325 'ovs-ofctl.at:2475' \ - "ovs-ofctl ofp-parse" " " 18 -at_xfail=no -( - $as_echo "325. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Test the echo request/reply messages (0 payload). -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2477: printf '\\1\\2\\0\\10\\0\\0\\0\\0\\1\\3\\0\\10\\0\\0\\0\\0' > binary_ofp_msg" -at_fn_check_prepare_trace "ovs-ofctl.at:2477" -( $at_check_trace; printf '\1\2\0\10\0\0\0\0\1\3\0\10\0\0\0\0' > binary_ofp_msg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2477" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2478: ovs-ofctl ofp-parse binary_ofp_msg" -at_fn_check_prepare_trace "ovs-ofctl.at:2478" -( $at_check_trace; ovs-ofctl ofp-parse binary_ofp_msg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload -OFPT_ECHO_REPLY (xid=0x0): 0 bytes of payload -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2478" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Test the hello (xid:1 3-byte payload). -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2484: printf '\\1\\0\\0\\13\\0\\0\\0\\1\\101\\102\\103' > binary_ofp_msg" -at_fn_check_prepare_trace "ovs-ofctl.at:2484" -( $at_check_trace; printf '\1\0\0\13\0\0\0\1\101\102\103' > binary_ofp_msg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2484" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2485: ovs-ofctl ofp-parse - < binary_ofp_msg" -at_fn_check_prepare_trace "ovs-ofctl.at:2485" -( $at_check_trace; ovs-ofctl ofp-parse - < binary_ofp_msg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_HELLO (xid=0x1): - version bitmap: 0x01 - unknown data in hello: -00000000 01 00 00 0b 00 00 00 01-41 42 43 |........ABC | -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2485" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_325 -#AT_START_326 -at_fn_group_banner 326 'ovs-ofctl.at:2493' \ - "tcp flags - filtering" " " 18 -at_xfail=no -( - $as_echo "326. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2494: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-ofctl.at:2494" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2494" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2494: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-ofctl.at:2494" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2494" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2494: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2494" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2494" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2494: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-ofctl.at:2494" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2494: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-ofctl.at:2494" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2494: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2494" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2494: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \\ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 " -at_fn_check_prepare_notrace 'an embedded newline' "ovs-ofctl.at:2494" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' - in_port=1,tcp,tp_dst=80,tcp_flags=+syn-rst-ack-fin,action=2 # Allow outbound web traffic bare-SYN - in_port=1,tcp,tp_dst=80,tcp_flags=+ack,action=2 # Allow outbound web traffic with ACK bit - in_port=1,tcp,tp_dst=80,tcp_flags=+rst,action=2 # Allow outbound web traffic with RST bit - in_port=2,tcp,tp_src=80,tcp_flags=+ack,action=1 # Allow inbound web traffic with ACK bit - in_port=2,tcp,tp_src=80,tcp_flags=+rst,action=1 # Allow inbound web traffic with RST bit - priority=0,in_port=1,action=drop # Default drop outbound - priority=0,in_port=2,action=drop # Default drop inbound -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2506: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ovs-ofctl.at:2506" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2506" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2508: ovs-ofctl add-flow br0 \"tcp,tcp_flags=+ack-ack,action=\"" -at_fn_check_prepare_trace "ovs-ofctl.at:2508" -( $at_check_trace; ovs-ofctl add-flow br0 "tcp,tcp_flags=+ack-ack,action=" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: ack: Each TCP flag can be specified only once -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-ofctl.at:2508" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2512: ovs-appctl dpif/show | tail -n +4" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-ofctl.at:2512" -( $at_check_trace; ovs-appctl dpif/show | tail -n +4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " p1 1/1: (dummy) - p2 2/2: (dummy) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2512" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2518: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x002)'" -at_fn_check_prepare_trace "ovs-ofctl.at:2518" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x002)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2518" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2519: tail -1 stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:2519" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2519" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2524: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x110)'" -at_fn_check_prepare_trace "ovs-ofctl.at:2524" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x110)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2524" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2525: tail -1 stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:2525" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2525" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2530: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x104)'" -at_fn_check_prepare_trace "ovs-ofctl.at:2530" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x104)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2530" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2531: tail -1 stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:2531" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2536: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x010)'" -at_fn_check_prepare_trace "ovs-ofctl.at:2536" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x010)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2537: tail -1 stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:2537" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2537" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2542: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x014)'" -at_fn_check_prepare_trace "ovs-ofctl.at:2542" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x014)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2542" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2543: tail -1 stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:2543" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2543" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2548: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0xfeb)'" -at_fn_check_prepare_trace "ovs-ofctl.at:2548" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0xfeb)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2549: tail -1 stdout" -at_fn_check_prepare_trace "ovs-ofctl.at:2549" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2549" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2553: check_logs " -at_fn_check_prepare_trace "ovs-ofctl.at:2553" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2553" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2553: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2553" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2553" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-ofctl.at:2553: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-ofctl.at:2553" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-ofctl.at:2553" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_326 -#AT_START_327 -at_fn_group_banner 327 'odp.at:3' \ - "OVS datapath key parsing and formatting - valid forms" "" 19 -at_xfail=no -( - $as_echo "327. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >odp-base.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x81,ttl=128,frag=no) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=first) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=later) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80,dst=8080) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81,dst=6632) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1,code=2) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x71,hlimit=128,frag=no) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=first) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=later) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80,dst=8080) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=17,tclass=0,hlimit=128,frag=no),udp(src=6630,dst=22) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=1,code=2) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3,sll=00:05:06:07:08:09) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,tll=00:0a:0b:0c:0d:0e) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=7,ttl=100,bos=1) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=7,ttl=100,bos=0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8848),mpls(label=1000,tc=4,ttl=200,bos=1) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8848),mpls(label=1000,tc=4,ttl=200,bos=0) -_ATEOF - - -(echo '# Valid forms without tun_id or VLAN header.' - set 's/^/skb_priority(0),skb_mark(0),/' odp-base.txt - - set ' -s/^/skb_priority(0),skb_mark(0),/ -' odp-base.txt - - - echo - echo '# Valid forms with tunnel header.' - sed 's/^/skb_priority(0),tunnel(tun_id=0x7f10354,src=10.10.10.10,dst=20.20.20.20,tos=0x0,ttl=64,flags(csum,key)),skb_mark(0x1234),/' odp-base.txt - - echo - echo '# Valid forms with VLAN header.' - sed 's/^/skb_priority(0),skb_mark(0),/ -s/\(eth([^)]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ -s/$/)/' odp-base.txt - - echo - echo '# Valid forms with MPLS header.' - sed 's/^/skb_priority(0),skb_mark(0),/ -s/\(eth([^)]*),?\)/\1,eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt - - echo - echo '# Valid forms with MPLS multicast header.' - sed 's/^/skb_priority(0),skb_mark(0),/ -s/\(eth([^)]*),?\)/\1,eth_type(0x8848),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt - - echo - echo '# Valid forms with tunnel and VLAN headers.' - sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,tos=0x8,ttl=128,flags(key)),skb_mark(0),/ -s/\(eth([^)]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ -s/$/)/' odp-base.txt - - echo - echo '# Valid forms with QOS priority, tunnel, and VLAN headers.' - sed 's/^/skb_priority(0x1234),tunnel(tun_id=0xfedcba9876543210,src=10.10.10.10,dst=20.20.20.20,tos=0x8,ttl=64,flags(key)),skb_mark(0),/ -s/\(eth([^)]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ -s/$/)/' odp-base.txt - - echo - echo '# Valid forms with IP first fragment.' -sed 's/^/skb_priority(0),skb_mark(0),/' odp-base.txt | sed -n 's/,frag=no),/,frag=first),/p' - - echo - echo '# Valid forms with IP later fragment.' -sed 's/^/skb_priority(0),skb_mark(0),/' odp-base.txt | sed -n 's/,frag=no),.*/,frag=later)/p' -) > odp-in.txt - - -sed '/bos=0/{ -s/^/ODP_FIT_TOO_LITTLE: / -s/mpls(label=100,tc=7,ttl=100,bos=0)/mpls(lse0=0x64e64,lse1=0,lse2=0)/ -s/mpls(label=1000,tc=4,ttl=200,bos=0)/mpls(lse0=0x3e88c8,lse1=0,lse2=0)/ -}' < odp-in.txt > odp-out.txt - -{ set +x -$as_echo "$at_srcdir/odp.at:94: ovstest test-odp parse-keys < odp-in.txt" -at_fn_check_prepare_trace "odp.at:94" -( $at_check_trace; ovstest test-odp parse-keys < odp-in.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-out.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:94" -$at_failed && at_fn_log_failure \ -"odp-in.txt" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_327 -#AT_START_328 -at_fn_group_banner 328 'odp.at:98' \ - "OVS datapath wildcarded key parsing and formatting - valid forms" "" 19 -at_xfail=no -( - $as_echo "328. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >odp-base.txt <<'_ATEOF' -in_port(1/0xff),eth(src=00:01:02:03:04:05/ff:ff:ff:ff:ff:f0,dst=10:11:12:13:14:15/ff:ff:ff:ff:ff:f0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff,dst=6632/0xff00) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1/0xf0,code=2/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no/0xf0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=17,tclass=0,hlimit=128,frag=no),udp(src=6630/0xff00,dst=22/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=1/0xf0,code=2/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3/::250) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3/::250,sll=00:05:06:07:08:09/ff:ff:ff:ff:ff:00) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3/::250,tll=00:0a:0b:0c:0d:0e/ff:ff:ff:ff:ff:00) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3/::250,sll=00:05:06:07:08:09/ff:ff:ff:ff:ff:00,tll=00:0a:0b:0c:0d:0e/ff:ff:ff:ff:ff:00) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) -skb_mark(0x1234/0xfff0),in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) -_ATEOF - - -(echo '# Valid forms without tun_id or VLAN header.' - cat odp-base.txt - - echo - echo '# Valid forms with tunnel header.' - sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,tos=0\/0xff,ttl=64\/0xff,flags(csum,key)),/' odp-base.txt - - echo - echo '# Valid forms with VLAN header.' - sed 's/\(eth([^)]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ -s/$/)/' odp-base.txt - - echo - echo '# Valid forms with MPLS header.' - sed 's/\(eth([^)]*),?\)/\1,eth_type(0x8847),mpls(label=100\/0xff,tc=7\/7,ttl=64\/0xff,bos=1\/1)/' odp-base.txt - - echo - echo '# Valid forms with QoS priority.' - sed 's/^/skb_priority(0x1234\/0xff),/' odp-base.txt - - echo - echo '# Valid forms with tunnel and VLAN headers.' - sed 's/^/tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,tos=0x8,ttl=128,flags(key)),/ -s/\(eth([^)]*)\),*/\1,eth_type(0x8100),vlan(vid=99/0xff0,pcp=7/0xe),encap(/ -s/$/)/' odp-base.txt - - echo - echo '# Valid forms with QOS priority, tunnel, and VLAN headers.' - sed 's/^/skb_priority(0x1234),tunnel(tun_id=0xfedcba9876543210,src=10.10.10.10,dst=20.20.20.20,tos=0x8,ttl=64,flags(key)),/ -s/\(eth([^)]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ -s/$/)/' odp-base.txt - - echo - echo '# Valid forms with IP first fragment.' -sed -n 's/,frag=no),/,frag=first),/p' odp-base.txt - - echo - echo '# Valid forms with IP later fragment.' -sed -n 's/,frag=no),.*/,frag=later)/p' odp-base.txt) > odp.txt - -{ set +x -$as_echo "$at_srcdir/odp.at:160: ovstest test-odp parse-wc-keys < odp.txt" -at_fn_check_prepare_trace "odp.at:160" -( $at_check_trace; ovstest test-odp parse-wc-keys < odp.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:160" -$at_failed && at_fn_log_failure \ -"odp.txt" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_328 -#AT_START_329 -at_fn_group_banner 329 'odp.at:164' \ - "OVS datapath wildcarded key filtering." " " 19 -at_xfail=no -( - $as_echo "329. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >odp-base.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff,dst=6632/0xff00) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1/0xf0,code=2/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no/0xf0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) -_ATEOF - -cat >odp-vlan-base.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff)) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=100,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff)) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff)) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=100,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff)) -_ATEOF - -cat >odp-eth-type.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) -_ATEOF - -cat >odp-vlan.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff)) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff)) -_ATEOF - -cat >odp-ipv4.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) -_ATEOF - -cat >odp-icmp.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) -_ATEOF - -cat >odp-arp.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) -_ATEOF - -cat >odp-tcp.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no/0xf0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) -_ATEOF - -cat >odp-tcp6.txt <<'_ATEOF' -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no/0xf0) -in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/odp.at:207: ovstest test-odp parse-filter filter='dl_type=0x1235' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:207" -( $at_check_trace; ovstest test-odp parse-filter filter='dl_type=0x1235' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-eth-type.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:207" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:209: ovstest test-odp parse-filter filter='dl_vlan=99' < odp-vlan-base.txt" -at_fn_check_prepare_trace "odp.at:209" -( $at_check_trace; ovstest test-odp parse-filter filter='dl_vlan=99' < odp-vlan-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-vlan.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:209" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:211: ovstest test-odp parse-filter filter='dl_vlan=99,ip' < odp-vlan-base.txt" -at_fn_check_prepare_trace "odp.at:211" -( $at_check_trace; ovstest test-odp parse-filter filter='dl_vlan=99,ip' < odp-vlan-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-vlan.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:211" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:213: ovstest test-odp parse-filter filter='ip,nw_src=35.8.2.199' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:213" -( $at_check_trace; ovstest test-odp parse-filter filter='ip,nw_src=35.8.2.199' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-ipv4.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:213" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:215: ovstest test-odp parse-filter filter='ip,nw_dst=172.16.0.199' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:215" -( $at_check_trace; ovstest test-odp parse-filter filter='ip,nw_dst=172.16.0.199' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-ipv4.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:215" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:217: ovstest test-odp parse-filter filter='dl_type=0x0800,nw_src=35.8.2.199,nw_dst=172.16.0.199' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:217" -( $at_check_trace; ovstest test-odp parse-filter filter='dl_type=0x0800,nw_src=35.8.2.199,nw_dst=172.16.0.199' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-ipv4.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:217" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:219: ovstest test-odp parse-filter filter='icmp,nw_src=35.8.2.199' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:219" -( $at_check_trace; ovstest test-odp parse-filter filter='icmp,nw_src=35.8.2.199' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-icmp.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:221: ovstest test-odp parse-filter filter='arp,arp_spa=1.2.3.5' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:221" -( $at_check_trace; ovstest test-odp parse-filter filter='arp,arp_spa=1.2.3.5' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-arp.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:223: ovstest test-odp parse-filter filter='tcp,tp_src=90' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:223" -( $at_check_trace; ovstest test-odp parse-filter filter='tcp,tp_src=90' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-tcp.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:223" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/odp.at:225: ovstest test-odp parse-filter filter='tcp6,tp_src=90' < odp-base.txt" -at_fn_check_prepare_trace "odp.at:225" -( $at_check_trace; ovstest test-odp parse-filter filter='tcp6,tp_src=90' < odp-base.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat odp-tcp6.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:225" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_329 -#AT_START_330 -at_fn_group_banner 330 'odp.at:229' \ - "OVS datapath actions parsing and formatting - valid forms" "" 19 -at_xfail=no -( - $as_echo "330. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >actions.txt <<'_ATEOF' -1,2,3 -userspace(pid=555666777) -userspace(pid=6633,sFlow(vid=9,pcp=7,output=10)) -userspace(pid=9765,slow_path()) -userspace(pid=9765,slow_path(cfm)) -userspace(pid=1234567,userdata(0102030405060708090a0b0c0d0e0f)) -userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456)) -userspace(pid=6633,ipfix) -set(in_port(2)) -set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15)) -set(eth_type(0x1234)) -set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) -set(tcp(src=80,dst=8080)) -set(udp(src=81,dst=6632)) -set(sctp(src=82,dst=6633)) -set(icmp(type=1,code=2)) -set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) -set(icmpv6(type=1,code=2)) -push_vlan(vid=12,pcp=0) -push_vlan(vid=13,pcp=5,cfi=0) -push_vlan(tpid=0x9100,vid=13,pcp=5) -push_vlan(tpid=0x9100,vid=13,pcp=5,cfi=0) -pop_vlan -sample(sample=9.7%,actions(1,2,3,push_vlan(vid=1,pcp=2))) -set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,csum,key))) -set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key))) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/odp.at:258: ovstest test-odp parse-actions < actions.txt" -at_fn_check_prepare_trace "odp.at:258" -( $at_check_trace; ovstest test-odp parse-actions < actions.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`cat actions.txt` -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/odp.at:258" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_330 -#AT_START_331 -at_fn_group_banner 331 'multipath.at:10' \ - "modulo_n multipath link selection" " " 20 -at_xfail=no -( - $as_echo "331. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:11: ovstest test-multipath 'eth_src,50,modulo_n,1,0,NXM_NX_REG0[]'" -at_fn_check_prepare_trace "multipath.at:11" -( $at_check_trace; ovstest test-multipath 'eth_src,50,modulo_n,1,0,NXM_NX_REG0[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/multipath.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - -# 1 -> 2: disruption=0.50 (perfect=0.50); stddev/expected=0.0000 -# 2 -> 3: disruption=0.66 (perfect=0.33); stddev/expected=0.0023 -# 3 -> 4: disruption=0.75 (perfect=0.25); stddev/expected=0.0061 -# 4 -> 5: disruption=0.80 (perfect=0.20); stddev/expected=0.0082 -# 5 -> 6: disruption=0.83 (perfect=0.17); stddev/expected=0.0083 -# 6 -> 7: disruption=0.86 (perfect=0.14); stddev/expected=0.0061 -# 7 -> 8: disruption=0.88 (perfect=0.12); stddev/expected=0.0103 -# 8 -> 9: disruption=0.89 (perfect=0.11); stddev/expected=0.0129 -# 9 -> 10: disruption=0.90 (perfect=0.10); stddev/expected=0.0091 -#10 -> 11: disruption=0.91 (perfect=0.09); stddev/expected=0.0114 -#11 -> 12: disruption=0.91 (perfect=0.08); stddev/expected=0.0073 -#12 -> 13: disruption=0.92 (perfect=0.08); stddev/expected=0.0165 -#13 -> 14: disruption=0.93 (perfect=0.07); stddev/expected=0.0149 -#14 -> 15: disruption=0.93 (perfect=0.07); stddev/expected=0.0127 -#15 -> 16: disruption=0.94 (perfect=0.06); stddev/expected=0.0142 -#16 -> 17: disruption=0.94 (perfect=0.06); stddev/expected=0.0098 -#17 -> 18: disruption=0.94 (perfect=0.06); stddev/expected=0.0159 -#18 -> 19: disruption=0.95 (perfect=0.05); stddev/expected=0.0121 -#19 -> 20: disruption=0.95 (perfect=0.05); stddev/expected=0.0195 -#20 -> 21: disruption=0.95 (perfect=0.05); stddev/expected=0.0120 -#21 -> 22: disruption=0.95 (perfect=0.05); stddev/expected=0.0181 -#22 -> 23: disruption=0.96 (perfect=0.04); stddev/expected=0.0222 -#23 -> 24: disruption=0.96 (perfect=0.04); stddev/expected=0.0164 -#24 -> 25: disruption=0.96 (perfect=0.04); stddev/expected=0.0146 -#25 -> 26: disruption=0.96 (perfect=0.04); stddev/expected=0.0175 -#26 -> 27: disruption=0.96 (perfect=0.04); stddev/expected=0.0231 -#27 -> 28: disruption=0.96 (perfect=0.04); stddev/expected=0.0172 -#28 -> 29: disruption=0.97 (perfect=0.03); stddev/expected=0.0211 -#29 -> 30: disruption=0.97 (perfect=0.03); stddev/expected=0.0213 -#30 -> 31: disruption=0.97 (perfect=0.03); stddev/expected=0.0253 -#31 -> 32: disruption=0.97 (perfect=0.03); stddev/expected=0.0208 -#32 -> 33: disruption=0.97 (perfect=0.03); stddev/expected=0.0223 -#33 -> 34: disruption=0.97 (perfect=0.03); stddev/expected=0.0215 -#34 -> 35: disruption=0.97 (perfect=0.03); stddev/expected=0.0201 -#35 -> 36: disruption=0.97 (perfect=0.03); stddev/expected=0.0220 -#36 -> 37: disruption=0.97 (perfect=0.03); stddev/expected=0.0221 -#37 -> 38: disruption=0.97 (perfect=0.03); stddev/expected=0.0201 -#38 -> 39: disruption=0.97 (perfect=0.03); stddev/expected=0.0215 -#39 -> 40: disruption=0.97 (perfect=0.03); stddev/expected=0.0271 -#40 -> 41: disruption=0.98 (perfect=0.02); stddev/expected=0.0272 -#41 -> 42: disruption=0.98 (perfect=0.02); stddev/expected=0.0208 -#42 -> 43: disruption=0.98 (perfect=0.02); stddev/expected=0.0226 -#43 -> 44: disruption=0.98 (perfect=0.02); stddev/expected=0.0264 -#44 -> 45: disruption=0.98 (perfect=0.02); stddev/expected=0.0233 -#45 -> 46: disruption=0.98 (perfect=0.02); stddev/expected=0.0285 -#46 -> 47: disruption=0.98 (perfect=0.02); stddev/expected=0.0246 -#47 -> 48: disruption=0.98 (perfect=0.02); stddev/expected=0.0282 -#48 -> 49: disruption=0.98 (perfect=0.02); stddev/expected=0.0233 -#49 -> 50: disruption=0.98 (perfect=0.02); stddev/expected=0.0197 -#50 -> 51: disruption=0.98 (perfect=0.02); stddev/expected=0.0317 -#51 -> 52: disruption=0.98 (perfect=0.02); stddev/expected=0.0283 -#52 -> 53: disruption=0.98 (perfect=0.02); stddev/expected=0.0282 -#53 -> 54: disruption=0.98 (perfect=0.02); stddev/expected=0.0273 -#54 -> 55: disruption=0.98 (perfect=0.02); stddev/expected=0.0283 -#55 -> 56: disruption=0.98 (perfect=0.02); stddev/expected=0.0288 -#56 -> 57: disruption=0.98 (perfect=0.02); stddev/expected=0.0263 -#57 -> 58: disruption=0.98 (perfect=0.02); stddev/expected=0.0339 -#58 -> 59: disruption=0.98 (perfect=0.02); stddev/expected=0.0262 -#59 -> 60: disruption=0.98 (perfect=0.02); stddev/expected=0.0309 -#60 -> 61: disruption=0.98 (perfect=0.02); stddev/expected=0.0285 -#61 -> 62: disruption=0.98 (perfect=0.02); stddev/expected=0.0288 -#62 -> 63: disruption=0.98 (perfect=0.02); stddev/expected=0.0298 -#63 -> 64: disruption=0.98 (perfect=0.02); stddev/expected=0.0277 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_331 -#AT_START_332 -at_fn_group_banner 332 'multipath.at:78' \ - "hash_threshold multipath link selection" " " 20 -at_xfail=no -( - $as_echo "332. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:79: ovstest test-multipath 'eth_src,50,hash_threshold,1,0,NXM_NX_REG0[]'" -at_fn_check_prepare_trace "multipath.at:79" -( $at_check_trace; ovstest test-multipath 'eth_src,50,hash_threshold,1,0,NXM_NX_REG0[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/multipath.at:79" -$at_failed && at_fn_log_failure -$at_traceon; } - -# 1 -> 2: disruption=0.50 (perfect=0.50); stddev/expected=0.0000 -# 2 -> 3: disruption=0.50 (perfect=0.33); stddev/expected=0.0056 -# 3 -> 4: disruption=0.50 (perfect=0.25); stddev/expected=0.0050 -# 4 -> 5: disruption=0.50 (perfect=0.20); stddev/expected=0.0074 -# 5 -> 6: disruption=0.50 (perfect=0.17); stddev/expected=0.0031 -# 6 -> 7: disruption=0.50 (perfect=0.14); stddev/expected=0.0078 -# 7 -> 8: disruption=0.50 (perfect=0.12); stddev/expected=0.0085 -# 8 -> 9: disruption=0.50 (perfect=0.11); stddev/expected=0.0093 -# 9 -> 10: disruption=0.50 (perfect=0.10); stddev/expected=0.0083 -#10 -> 11: disruption=0.51 (perfect=0.09); stddev/expected=0.0110 -#11 -> 12: disruption=0.50 (perfect=0.08); stddev/expected=0.0124 -#12 -> 13: disruption=0.50 (perfect=0.08); stddev/expected=0.0143 -#13 -> 14: disruption=0.50 (perfect=0.07); stddev/expected=0.0148 -#14 -> 15: disruption=0.50 (perfect=0.07); stddev/expected=0.0099 -#15 -> 16: disruption=0.50 (perfect=0.06); stddev/expected=0.0166 -#16 -> 17: disruption=0.50 (perfect=0.06); stddev/expected=0.0099 -#17 -> 18: disruption=0.50 (perfect=0.06); stddev/expected=0.0194 -#18 -> 19: disruption=0.50 (perfect=0.05); stddev/expected=0.0169 -#19 -> 20: disruption=0.50 (perfect=0.05); stddev/expected=0.0169 -#20 -> 21: disruption=0.50 (perfect=0.05); stddev/expected=0.0185 -#21 -> 22: disruption=0.50 (perfect=0.05); stddev/expected=0.0160 -#22 -> 23: disruption=0.50 (perfect=0.04); stddev/expected=0.0236 -#23 -> 24: disruption=0.50 (perfect=0.04); stddev/expected=0.0147 -#24 -> 25: disruption=0.50 (perfect=0.04); stddev/expected=0.0195 -#25 -> 26: disruption=0.50 (perfect=0.04); stddev/expected=0.0199 -#26 -> 27: disruption=0.50 (perfect=0.04); stddev/expected=0.0227 -#27 -> 28: disruption=0.50 (perfect=0.04); stddev/expected=0.0198 -#28 -> 29: disruption=0.50 (perfect=0.03); stddev/expected=0.0216 -#29 -> 30: disruption=0.50 (perfect=0.03); stddev/expected=0.0233 -#30 -> 31: disruption=0.50 (perfect=0.03); stddev/expected=0.0266 -#31 -> 32: disruption=0.51 (perfect=0.03); stddev/expected=0.0238 -#32 -> 33: disruption=0.50 (perfect=0.03); stddev/expected=0.0194 -#33 -> 34: disruption=0.50 (perfect=0.03); stddev/expected=0.0173 -#34 -> 35: disruption=0.50 (perfect=0.03); stddev/expected=0.0223 -#35 -> 36: disruption=0.50 (perfect=0.03); stddev/expected=0.0220 -#36 -> 37: disruption=0.50 (perfect=0.03); stddev/expected=0.0237 -#37 -> 38: disruption=0.50 (perfect=0.03); stddev/expected=0.0237 -#38 -> 39: disruption=0.50 (perfect=0.03); stddev/expected=0.0251 -#39 -> 40: disruption=0.50 (perfect=0.03); stddev/expected=0.0212 -#40 -> 41: disruption=0.50 (perfect=0.02); stddev/expected=0.0267 -#41 -> 42: disruption=0.50 (perfect=0.02); stddev/expected=0.0242 -#42 -> 43: disruption=0.50 (perfect=0.02); stddev/expected=0.0222 -#43 -> 44: disruption=0.50 (perfect=0.02); stddev/expected=0.0244 -#44 -> 45: disruption=0.50 (perfect=0.02); stddev/expected=0.0231 -#45 -> 46: disruption=0.50 (perfect=0.02); stddev/expected=0.0299 -#46 -> 47: disruption=0.50 (perfect=0.02); stddev/expected=0.0263 -#47 -> 48: disruption=0.50 (perfect=0.02); stddev/expected=0.0307 -#48 -> 49: disruption=0.50 (perfect=0.02); stddev/expected=0.0253 -#49 -> 50: disruption=0.50 (perfect=0.02); stddev/expected=0.0228 -#50 -> 51: disruption=0.50 (perfect=0.02); stddev/expected=0.0273 -#51 -> 52: disruption=0.50 (perfect=0.02); stddev/expected=0.0243 -#52 -> 53: disruption=0.50 (perfect=0.02); stddev/expected=0.0268 -#53 -> 54: disruption=0.50 (perfect=0.02); stddev/expected=0.0251 -#54 -> 55: disruption=0.50 (perfect=0.02); stddev/expected=0.0297 -#55 -> 56: disruption=0.50 (perfect=0.02); stddev/expected=0.0287 -#56 -> 57: disruption=0.50 (perfect=0.02); stddev/expected=0.0299 -#57 -> 58: disruption=0.50 (perfect=0.02); stddev/expected=0.0272 -#58 -> 59: disruption=0.50 (perfect=0.02); stddev/expected=0.0295 -#59 -> 60: disruption=0.50 (perfect=0.02); stddev/expected=0.0312 -#60 -> 61: disruption=0.50 (perfect=0.02); stddev/expected=0.0361 -#61 -> 62: disruption=0.50 (perfect=0.02); stddev/expected=0.0308 -#62 -> 63: disruption=0.50 (perfect=0.02); stddev/expected=0.0283 -#63 -> 64: disruption=0.50 (perfect=0.02); stddev/expected=0.0325 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_332 -#AT_START_333 -at_fn_group_banner 333 'multipath.at:146' \ - "hrw multipath link selection" " " 20 -at_xfail=no -( - $as_echo "333. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:147: ovstest test-multipath 'eth_src,50,hrw,1,0,NXM_NX_REG0[]'" -at_fn_check_prepare_trace "multipath.at:147" -( $at_check_trace; ovstest test-multipath 'eth_src,50,hrw,1,0,NXM_NX_REG0[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/multipath.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - -# 1 -> 2: disruption=0.50 (perfect=0.50); stddev/expected=0.0000 -# 2 -> 3: disruption=0.33 (perfect=0.33); stddev/expected=0.0033 -# 3 -> 4: disruption=0.25 (perfect=0.25); stddev/expected=0.0076 -# 4 -> 5: disruption=0.20 (perfect=0.20); stddev/expected=0.0059 -# 5 -> 6: disruption=0.17 (perfect=0.17); stddev/expected=0.0030 -# 6 -> 7: disruption=0.14 (perfect=0.14); stddev/expected=0.0124 -# 7 -> 8: disruption=0.13 (perfect=0.12); stddev/expected=0.0072 -# 8 -> 9: disruption=0.11 (perfect=0.11); stddev/expected=0.0074 -# 9 -> 10: disruption=0.10 (perfect=0.10); stddev/expected=0.0161 -#10 -> 11: disruption=0.09 (perfect=0.09); stddev/expected=0.0055 -#11 -> 12: disruption=0.08 (perfect=0.08); stddev/expected=0.0092 -#12 -> 13: disruption=0.08 (perfect=0.08); stddev/expected=0.0134 -#13 -> 14: disruption=0.07 (perfect=0.07); stddev/expected=0.0124 -#14 -> 15: disruption=0.07 (perfect=0.07); stddev/expected=0.0156 -#15 -> 16: disruption=0.06 (perfect=0.06); stddev/expected=0.0182 -#16 -> 17: disruption=0.06 (perfect=0.06); stddev/expected=0.0150 -#17 -> 18: disruption=0.06 (perfect=0.06); stddev/expected=0.0109 -#18 -> 19: disruption=0.05 (perfect=0.05); stddev/expected=0.0162 -#19 -> 20: disruption=0.05 (perfect=0.05); stddev/expected=0.0149 -#20 -> 21: disruption=0.05 (perfect=0.05); stddev/expected=0.0148 -#21 -> 22: disruption=0.05 (perfect=0.05); stddev/expected=0.0230 -#22 -> 23: disruption=0.04 (perfect=0.04); stddev/expected=0.0208 -#23 -> 24: disruption=0.04 (perfect=0.04); stddev/expected=0.0210 -#24 -> 25: disruption=0.04 (perfect=0.04); stddev/expected=0.0228 -#25 -> 26: disruption=0.04 (perfect=0.04); stddev/expected=0.0155 -#26 -> 27: disruption=0.04 (perfect=0.04); stddev/expected=0.0208 -#27 -> 28: disruption=0.04 (perfect=0.04); stddev/expected=0.0218 -#28 -> 29: disruption=0.03 (perfect=0.03); stddev/expected=0.0193 -#29 -> 30: disruption=0.03 (perfect=0.03); stddev/expected=0.0169 -#30 -> 31: disruption=0.03 (perfect=0.03); stddev/expected=0.0163 -#31 -> 32: disruption=0.03 (perfect=0.03); stddev/expected=0.0192 -#32 -> 33: disruption=0.03 (perfect=0.03); stddev/expected=0.0212 -#33 -> 34: disruption=0.03 (perfect=0.03); stddev/expected=0.0240 -#34 -> 35: disruption=0.03 (perfect=0.03); stddev/expected=0.0227 -#35 -> 36: disruption=0.03 (perfect=0.03); stddev/expected=0.0230 -#36 -> 37: disruption=0.03 (perfect=0.03); stddev/expected=0.0183 -#37 -> 38: disruption=0.03 (perfect=0.03); stddev/expected=0.0227 -#38 -> 39: disruption=0.03 (perfect=0.03); stddev/expected=0.0255 -#39 -> 40: disruption=0.03 (perfect=0.03); stddev/expected=0.0247 -#40 -> 41: disruption=0.02 (perfect=0.02); stddev/expected=0.0228 -#41 -> 42: disruption=0.02 (perfect=0.02); stddev/expected=0.0247 -#42 -> 43: disruption=0.02 (perfect=0.02); stddev/expected=0.0265 -#43 -> 44: disruption=0.02 (perfect=0.02); stddev/expected=0.0250 -#44 -> 45: disruption=0.02 (perfect=0.02); stddev/expected=0.0258 -#45 -> 46: disruption=0.02 (perfect=0.02); stddev/expected=0.0196 -#46 -> 47: disruption=0.02 (perfect=0.02); stddev/expected=0.0235 -#47 -> 48: disruption=0.02 (perfect=0.02); stddev/expected=0.0314 -#48 -> 49: disruption=0.02 (perfect=0.02); stddev/expected=0.0293 -#49 -> 50: disruption=0.02 (perfect=0.02); stddev/expected=0.0241 -#50 -> 51: disruption=0.02 (perfect=0.02); stddev/expected=0.0291 -#51 -> 52: disruption=0.02 (perfect=0.02); stddev/expected=0.0304 -#52 -> 53: disruption=0.02 (perfect=0.02); stddev/expected=0.0307 -#53 -> 54: disruption=0.02 (perfect=0.02); stddev/expected=0.0250 -#54 -> 55: disruption=0.02 (perfect=0.02); stddev/expected=0.0290 -#55 -> 56: disruption=0.02 (perfect=0.02); stddev/expected=0.0284 -#56 -> 57: disruption=0.02 (perfect=0.02); stddev/expected=0.0272 -#57 -> 58: disruption=0.02 (perfect=0.02); stddev/expected=0.0272 -#58 -> 59: disruption=0.02 (perfect=0.02); stddev/expected=0.0304 -#59 -> 60: disruption=0.02 (perfect=0.02); stddev/expected=0.0345 -#60 -> 61: disruption=0.02 (perfect=0.02); stddev/expected=0.0251 -#61 -> 62: disruption=0.02 (perfect=0.02); stddev/expected=0.0249 -#62 -> 63: disruption=0.02 (perfect=0.02); stddev/expected=0.0285 -#63 -> 64: disruption=0.02 (perfect=0.02); stddev/expected=0.0285 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_333 -#AT_START_334 -at_fn_group_banner 334 'multipath.at:214' \ - "iter_hash multipath link selection" " " 20 -at_xfail=no -( - $as_echo "334. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:215: ovstest test-multipath 'eth_src,50,iter_hash,1,0,NXM_NX_REG0[]'" -at_fn_check_prepare_trace "multipath.at:215" -( $at_check_trace; ovstest test-multipath 'eth_src,50,iter_hash,1,0,NXM_NX_REG0[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/multipath.at:215" -$at_failed && at_fn_log_failure -$at_traceon; } - -# 1 -> 2: disruption=0.50 (perfect=0.50); stddev/expected=0.0000 -# 2 -> 3: disruption=0.42 (perfect=0.33); stddev/expected=0.0034 -# 3 -> 4: disruption=0.25 (perfect=0.25); stddev/expected=0.0082 -# 4 -> 5: disruption=0.42 (perfect=0.20); stddev/expected=0.0073 -# 5 -> 6: disruption=0.17 (perfect=0.17); stddev/expected=0.0040 -# 6 -> 7: disruption=0.14 (perfect=0.14); stddev/expected=0.0069 -# 7 -> 8: disruption=0.13 (perfect=0.12); stddev/expected=0.0131 -# 8 -> 9: disruption=0.45 (perfect=0.11); stddev/expected=0.0093 -# 9 -> 10: disruption=0.10 (perfect=0.10); stddev/expected=0.0127 -#10 -> 11: disruption=0.09 (perfect=0.09); stddev/expected=0.0134 -#11 -> 12: disruption=0.08 (perfect=0.08); stddev/expected=0.0101 -#12 -> 13: disruption=0.08 (perfect=0.08); stddev/expected=0.0127 -#13 -> 14: disruption=0.07 (perfect=0.07); stddev/expected=0.0115 -#14 -> 15: disruption=0.07 (perfect=0.07); stddev/expected=0.0100 -#15 -> 16: disruption=0.06 (perfect=0.06); stddev/expected=0.0111 -#16 -> 17: disruption=0.47 (perfect=0.06); stddev/expected=0.0137 -#17 -> 18: disruption=0.05 (perfect=0.06); stddev/expected=0.0204 -#18 -> 19: disruption=0.05 (perfect=0.05); stddev/expected=0.0082 -#19 -> 20: disruption=0.05 (perfect=0.05); stddev/expected=0.0124 -#20 -> 21: disruption=0.05 (perfect=0.05); stddev/expected=0.0203 -#21 -> 22: disruption=0.05 (perfect=0.05); stddev/expected=0.0196 -#22 -> 23: disruption=0.04 (perfect=0.04); stddev/expected=0.0183 -#23 -> 24: disruption=0.04 (perfect=0.04); stddev/expected=0.0212 -#24 -> 25: disruption=0.04 (perfect=0.04); stddev/expected=0.0176 -#25 -> 26: disruption=0.04 (perfect=0.04); stddev/expected=0.0173 -#26 -> 27: disruption=0.04 (perfect=0.04); stddev/expected=0.0159 -#27 -> 28: disruption=0.03 (perfect=0.04); stddev/expected=0.0168 -#28 -> 29: disruption=0.03 (perfect=0.03); stddev/expected=0.0190 -#29 -> 30: disruption=0.03 (perfect=0.03); stddev/expected=0.0305 -#30 -> 31: disruption=0.03 (perfect=0.03); stddev/expected=0.0282 -#31 -> 32: disruption=0.03 (perfect=0.03); stddev/expected=0.0255 -#32 -> 33: disruption=0.49 (perfect=0.03); stddev/expected=0.0220 -#33 -> 34: disruption=0.03 (perfect=0.03); stddev/expected=0.0188 -#34 -> 35: disruption=0.03 (perfect=0.03); stddev/expected=0.0203 -#35 -> 36: disruption=0.03 (perfect=0.03); stddev/expected=0.0207 -#36 -> 37: disruption=0.03 (perfect=0.03); stddev/expected=0.0261 -#37 -> 38: disruption=0.03 (perfect=0.03); stddev/expected=0.0226 -#38 -> 39: disruption=0.03 (perfect=0.03); stddev/expected=0.0233 -#39 -> 40: disruption=0.03 (perfect=0.03); stddev/expected=0.0161 -#40 -> 41: disruption=0.03 (perfect=0.02); stddev/expected=0.0303 -#41 -> 42: disruption=0.02 (perfect=0.02); stddev/expected=0.0249 -#42 -> 43: disruption=0.02 (perfect=0.02); stddev/expected=0.0262 -#43 -> 44: disruption=0.02 (perfect=0.02); stddev/expected=0.0260 -#44 -> 45: disruption=0.02 (perfect=0.02); stddev/expected=0.0266 -#45 -> 46: disruption=0.02 (perfect=0.02); stddev/expected=0.0287 -#46 -> 47: disruption=0.02 (perfect=0.02); stddev/expected=0.0213 -#47 -> 48: disruption=0.02 (perfect=0.02); stddev/expected=0.0301 -#48 -> 49: disruption=0.02 (perfect=0.02); stddev/expected=0.0230 -#49 -> 50: disruption=0.02 (perfect=0.02); stddev/expected=0.0248 -#50 -> 51: disruption=0.02 (perfect=0.02); stddev/expected=0.0203 -#51 -> 52: disruption=0.02 (perfect=0.02); stddev/expected=0.0235 -#52 -> 53: disruption=0.02 (perfect=0.02); stddev/expected=0.0340 -#53 -> 54: disruption=0.02 (perfect=0.02); stddev/expected=0.0264 -#54 -> 55: disruption=0.02 (perfect=0.02); stddev/expected=0.0292 -#55 -> 56: disruption=0.02 (perfect=0.02); stddev/expected=0.0246 -#56 -> 57: disruption=0.02 (perfect=0.02); stddev/expected=0.0270 -#57 -> 58: disruption=0.02 (perfect=0.02); stddev/expected=0.0299 -#58 -> 59: disruption=0.02 (perfect=0.02); stddev/expected=0.0307 -#59 -> 60: disruption=0.02 (perfect=0.02); stddev/expected=0.0275 -#60 -> 61: disruption=0.02 (perfect=0.02); stddev/expected=0.0289 -#61 -> 62: disruption=0.02 (perfect=0.02); stddev/expected=0.0292 -#62 -> 63: disruption=0.02 (perfect=0.02); stddev/expected=0.0292 -#63 -> 64: disruption=0.02 (perfect=0.02); stddev/expected=0.0307 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_334 -#AT_START_335 -at_fn_group_banner 335 'multipath.at:282' \ - "multipath action missing argument" " " 20 -at_xfail=no -( - $as_echo "335. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:283: ovs-ofctl parse-flow actions=multipath" -at_fn_check_prepare_trace "multipath.at:283" -( $at_check_trace; ovs-ofctl parse-flow actions=multipath -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: : not enough arguments to multipath action -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/multipath.at:283" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_335 -#AT_START_336 -at_fn_group_banner 336 'multipath.at:288' \ - "multipath action bad fields" " " 20 -at_xfail=no -( - $as_echo "336. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:289: ovs-ofctl parse-flow 'actions=multipath(xyzzy,50,modulo_n,1,0,NXM_NX_REG0[])'" -at_fn_check_prepare_trace "multipath.at:289" -( $at_check_trace; ovs-ofctl parse-flow 'actions=multipath(xyzzy,50,modulo_n,1,0,NXM_NX_REG0[])' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: xyzzy,50,modulo_n,1,0,NXM_NX_REG0[]: unknown fields \`xyzzy' -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/multipath.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_336 -#AT_START_337 -at_fn_group_banner 337 'multipath.at:294' \ - "multipath action bad algorithm" " " 20 -at_xfail=no -( - $as_echo "337. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:295: ovs-ofctl parse-flow 'actions=multipath(eth_src,50,fubar,1,0,NXM_NX_REG0[])'" -at_fn_check_prepare_trace "multipath.at:295" -( $at_check_trace; ovs-ofctl parse-flow 'actions=multipath(eth_src,50,fubar,1,0,NXM_NX_REG0[])' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: eth_src,50,fubar,1,0,NXM_NX_REG0[]: unknown algorithm \`fubar' -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/multipath.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_337 -#AT_START_338 -at_fn_group_banner 338 'multipath.at:300' \ - "multipath action bad n_links" " " 20 -at_xfail=no -( - $as_echo "338. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:301: ovs-ofctl parse-flow 'actions=multipath(eth_src,50,modulo_n,0,0,NXM_NX_REG0[])'" -at_fn_check_prepare_trace "multipath.at:301" -( $at_check_trace; ovs-ofctl parse-flow 'actions=multipath(eth_src,50,modulo_n,0,0,NXM_NX_REG0[])' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: eth_src,50,modulo_n,0,0,NXM_NX_REG0[]: n_links 0 is not in valid range 1 to 65536 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/multipath.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_338 -#AT_START_339 -at_fn_group_banner 339 'multipath.at:306' \ - "multipath action destination too narrow" " " 20 -at_xfail=no -( - $as_echo "339. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/multipath.at:307: ovs-ofctl parse-flow 'actions=multipath(eth_src,50,modulo_n,1024,0,NXM_NX_REG0[0..7])'" -at_fn_check_prepare_trace "multipath.at:307" -( $at_check_trace; ovs-ofctl parse-flow 'actions=multipath(eth_src,50,modulo_n,1024,0,NXM_NX_REG0[0..7])' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: eth_src,50,modulo_n,1024,0,NXM_NX_REG0[0..7]: 8-bit destination field has 256 possible values, less than specified n_links 1024 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/multipath.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_339 -#AT_START_340 -at_fn_group_banner 340 'learn.at:3' \ - "learning action - parsing and formatting" " " 21 -at_xfail=no -( - $as_echo "340. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -actions=learn() -actions=learn(NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], output:NXM_OF_IN_PORT[], load:10->NXM_NX_REG0[5..10]) -actions=learn(table=1,idle_timeout=10, hard_timeout=20, fin_idle_timeout=5, fin_hard_timeout=10, priority=10, cookie=0xfedcba9876543210, in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/learn.at:9: ovs-ofctl parse-flows flows.txt" -at_fn_check_prepare_trace "learn.at:9" -( $at_check_trace; ovs-ofctl parse-flows flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: any -chosen protocol: OpenFlow10-table_id -OFPT_FLOW_MOD (xid=0x1): ADD actions=learn(table=1) -OFPT_FLOW_MOD (xid=0x2): ADD actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[],load:0xa->NXM_NX_REG0[5..10]) -OFPT_FLOW_MOD (xid=0x3): ADD actions=learn(table=1,idle_timeout=10,hard_timeout=20,fin_idle_timeout=5,fin_hard_timeout=10,priority=10,cookie=0xfedcba9876543210,in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:9" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_340 -#AT_START_341 -at_fn_group_banner 341 'learn.at:18' \ - "learning action - parsing and formatting - illegal in_port_oxm" "" 21 -at_xfail=no -( - $as_echo "341. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/learn.at:19: ovs-ofctl parse-flow 'actions=learn(table=1, in_port_oxm=123456)'" -at_fn_check_prepare_trace "learn.at:19" -( $at_check_trace; ovs-ofctl parse-flow 'actions=learn(table=1, in_port_oxm=123456)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/learn.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:21: sed -e 's/.*|ofp_util|WARN|//' < stderr" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:21" -( $at_check_trace; sed -e 's/.*|ofp_util|WARN|//' < stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "port 123456 is outside the supported range 0 through ffff or 0xffffff00 through 0xffffffff -ovs-ofctl: 123456: port value out of range for in_port_oxm -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_341 -#AT_START_342 -at_fn_group_banner 342 'learn.at:27' \ - "learning action - parsing and formatting - OXM" " " 21 -at_xfail=no -( - $as_echo "342. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -actions=learn(output:OXM_OF_IN_PORT[]) -actions=learn(table=1, in_port=1, load:OXM_OF_IN_PORT[]->NXM_NX_REG1[], load:0xfffffffe->OXM_OF_IN_PORT[]) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/learn.at:32: ovs-ofctl -O OpenFlow12 parse-flows flows.txt" -at_fn_check_prepare_trace "learn.at:32" -( $at_check_trace; ovs-ofctl -O OpenFlow12 parse-flows flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: any -chosen protocol: OXM-OpenFlow12 -OFPT_FLOW_MOD (OF1.2) (xid=0x1): ADD actions=learn(table=1,output:OXM_OF_IN_PORT[]) -OFPT_FLOW_MOD (OF1.2) (xid=0x2): ADD actions=learn(table=1,in_port=1,load:OXM_OF_IN_PORT[]->NXM_NX_REG1[],load:0xfffffffe->OXM_OF_IN_PORT[]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:32" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_342 -#AT_START_343 -at_fn_group_banner 343 'learn.at:40' \ - "learning action - examples" " " 21 -at_xfail=no -( - $as_echo "343. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' - -# These are the examples from nicira-ext.h. -actions=learn(in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) -actions=learn(NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[]) -table=0 actions=learn(table=1,hard_timeout=10, NXM_OF_VLAN_TCI[0..11],output:NXM_OF_IN_PORT[]), resubmit(,1) -table=1 priority=0 actions=flood -_ATEOF - -{ set +x -$as_echo "$at_srcdir/learn.at:48: ovs-ofctl parse-flows flows.txt" -at_fn_check_prepare_trace "learn.at:48" -( $at_check_trace; ovs-ofctl parse-flows flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: OXM,OpenFlow10+table_id,NXM+table_id,OpenFlow11 -chosen protocol: OpenFlow10+table_id -OFPT_FLOW_MOD (xid=0x1): ADD table:255 actions=learn(table=1,in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) -OFPT_FLOW_MOD (xid=0x2): ADD table:255 actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[]) -OFPT_FLOW_MOD (xid=0x3): ADD actions=learn(table=1,hard_timeout=10,NXM_OF_VLAN_TCI[0..11],output:NXM_OF_IN_PORT[]),resubmit(,1) -OFPT_FLOW_MOD (xid=0x4): ADD table:1 priority=0 actions=FLOOD -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:48" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_343 -#AT_START_344 -at_fn_group_banner 344 'learn.at:58' \ - "learning action - satisfied prerequisites" " " 21 -at_xfail=no -( - $as_echo "344. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >flows.txt <<'_ATEOF' -actions=learn(eth_type=0x800,load:5->NXM_OF_IP_DST[]) -ip,actions=learn(load:NXM_OF_IP_DST[]->NXM_NX_REG1[]) -ip,actions=learn(eth_type=0x800,OXM_OF_IPV4_DST[]) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/learn.at:64: ovs-ofctl parse-flows flows.txt" -at_fn_check_prepare_trace "learn.at:64" -( $at_check_trace; ovs-ofctl parse-flows flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "usable protocols: any -chosen protocol: OpenFlow10-table_id -OFPT_FLOW_MOD (xid=0x1): ADD actions=learn(table=1,eth_type=0x800,load:0x5->NXM_OF_IP_DST[]) -OFPT_FLOW_MOD (xid=0x2): ADD ip actions=learn(table=1,load:NXM_OF_IP_DST[]->NXM_NX_REG1[]) -OFPT_FLOW_MOD (xid=0x3): ADD ip actions=learn(table=1,eth_type=0x800,NXM_OF_IP_DST[]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:64" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_344 -#AT_START_345 -at_fn_group_banner 345 'learn.at:73' \ - "learning action - invalid prerequisites" " " 21 -at_xfail=no -( - $as_echo "345. $at_setup_line: testing $at_desc ..." - $at_traceon - -{ set +x -$as_echo "$at_srcdir/learn.at:74: ovs-ofctl parse-flow 'actions=learn(load:5->NXM_OF_IP_DST[])'" -at_fn_check_prepare_trace "learn.at:74" -( $at_check_trace; ovs-ofctl parse-flow 'actions=learn(load:5->NXM_OF_IP_DST[])' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/learn.at:74" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:76: sed -e 's/.*|meta_flow|WARN|//' < stderr" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:76" -( $at_check_trace; sed -e 's/.*|meta_flow|WARN|//' < stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "destination field ip_dst lacks correct prerequisites -ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:76" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:80: ovs-ofctl parse-flow 'actions=learn(load:NXM_OF_IP_DST[]->NXM_NX_REG1[])'" -at_fn_check_prepare_trace "learn.at:80" -( $at_check_trace; ovs-ofctl parse-flow 'actions=learn(load:NXM_OF_IP_DST[]->NXM_NX_REG1[])' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/learn.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:82: sed -e 's/.*|meta_flow|WARN|//' < stderr" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:82" -( $at_check_trace; sed -e 's/.*|meta_flow|WARN|//' < stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "source field ip_dst lacks correct prerequisites -ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:82" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_345 -#AT_START_346 -at_fn_group_banner 346 'learn.at:88' \ - "learning action - standard VLAN+MAC learning" " " 21 -at_xfail=no -( - $as_echo "346. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:89: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:89" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:89" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:89: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:89" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:89" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:89: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:89" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:89" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:89: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:89" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:89" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:89: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:89" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:89" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:89: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:89" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:89" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:89: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \\ - add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \\ - add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:89" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \ - add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \ - add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:89" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Set up flow table for VLAN+MAC learning. -cat >flows.txt <<'_ATEOF' - -table=0 actions=learn(table=1, hard_timeout=60, NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], output:NXM_OF_IN_PORT[]), resubmit(,1) -table=1 priority=0 actions=flood -_ATEOF - -{ set +x -$as_echo "$at_srcdir/learn.at:98: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "learn.at:98" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:98" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace an ARP packet arriving on port 3, to create a MAC learning entry. -flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)" -{ set +x -$as_echo "$at_srcdir/learn.at:102: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "learn.at:102" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:102" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -actual=`tail -1 stdout | sed 's/Datapath actions: //'` - -expected="1,2,100" -{ set +x -$as_echo "$at_srcdir/learn.at:106: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "learn.at:106" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/learn.at:108: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "learn.at:108" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for the MAC learning entry. -{ set +x -$as_echo "$at_srcdir/learn.at:111: ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:111" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, hard_timeout=60, vlan_tci=0x0000/0x0fff,dl_dst=50:54:00:00:00:05 actions=output:3 - table=1, priority=0 actions=FLOOD -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:111" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace a packet arrival destined for the learned MAC. -# (This will also learn a MAC.) -{ set +x -$as_echo "$at_srcdir/learn.at:119: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),eth_type(0x0806),arp(sip=192.168.0.2,tip=192.168.0.1,op=2,sha=50:54:00:00:00:06,tha=50:54:00:00:00:05)' -generate" -at_fn_check_prepare_trace "learn.at:119" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),eth_type(0x0806),arp(sip=192.168.0.2,tip=192.168.0.1,op=2,sha=50:54:00:00:00:06,tha=50:54:00:00:00:05)' -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:119" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:120: tail -1 stdout" -at_fn_check_prepare_trace "learn.at:120" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:120" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for both MAC learning entries. -{ set +x -$as_echo "$at_srcdir/learn.at:124: ovs-ofctl dump-flows br0 table=1 | ofctl_strip |sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:124" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 | ofctl_strip |sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, hard_timeout=60, vlan_tci=0x0000/0x0fff,dl_dst=50:54:00:00:00:05 actions=output:3 - table=1, hard_timeout=60, vlan_tci=0x0000/0x0fff,dl_dst=50:54:00:00:00:06 actions=output:1 - table=1, priority=0 actions=FLOOD -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:124" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace a packet arrival that updates the first learned MAC entry. -flow="in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)" -{ set +x -$as_echo "$at_srcdir/learn.at:133: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "learn.at:133" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:133" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -actual=`tail -1 stdout | sed 's/Datapath actions: //'` - -expected="1,3,100" -{ set +x -$as_echo "$at_srcdir/learn.at:137: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "learn.at:137" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:137" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/learn.at:139: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "learn.at:139" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:139" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check that the MAC learning entry was updated. -{ set +x -$as_echo "$at_srcdir/learn.at:142: ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:142" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, hard_timeout=60, vlan_tci=0x0000/0x0fff,dl_dst=50:54:00:00:00:05 actions=output:2 - table=1, hard_timeout=60, vlan_tci=0x0000/0x0fff,dl_dst=50:54:00:00:00:06 actions=output:1 - table=1, priority=0 actions=FLOOD -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:142" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:148: check_logs " -at_fn_check_prepare_trace "learn.at:148" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:148: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:148" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:148: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:148" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_346 -#AT_START_347 -at_fn_group_banner 347 'learn.at:157' \ - "learning action - learn refreshes hard_age" " " 21 -at_xfail=no -( - $as_echo "347. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:158: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:158" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:158" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:158: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:158" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:158" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:158: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:158" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:158" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:158: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:158" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:158: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:158" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:158: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:158" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:158: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \\ - add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \\ - add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:158" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \ - add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \ - add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop - -# Set up flow table for MAC learning. -cat >flows.txt <<'_ATEOF' - -table=0 actions=learn(table=1, hard_timeout=10, NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], output:NXM_OF_IN_PORT[]), resubmit(,1) -table=1 priority=0 actions=flood -_ATEOF - -{ set +x -$as_echo "$at_srcdir/learn.at:170: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "learn.at:170" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:170" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace an ICMP packet arriving on port 3, to create a MAC learning entry. -flow="in_port(3),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)" -{ set +x -$as_echo "$at_srcdir/learn.at:174: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "learn.at:174" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:174" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -actual=`tail -1 stdout | sed 's/Datapath actions: //'` - -expected="1,2,100" -{ set +x -$as_echo "$at_srcdir/learn.at:178: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "learn.at:178" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/learn.at:180: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "learn.at:180" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:180" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check that the MAC learning entry appeared. -{ set +x -$as_echo "$at_srcdir/learn.at:183: ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:183" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, hard_timeout=10, dl_dst=50:54:00:00:00:07 actions=output:3 - table=1, priority=0 actions=FLOOD -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:183" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# For 25 seconds, make sure that the MAC learning entry doesn't -# disappear as long as we refresh it every second. -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25; do - ovs-appctl time/warp 1000 - { set +x -$as_echo "$at_srcdir/learn.at:193: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "learn.at:193" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:193" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - # Check that the entry is there. - { set +x -$as_echo "$at_srcdir/learn.at:196: ovs-ofctl dump-flows br0 table=1" -at_fn_check_prepare_trace "learn.at:196" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:196" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:197: ofctl_strip < stdout | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:197" -( $at_check_trace; ofctl_strip < stdout | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, hard_timeout=10, dl_dst=50:54:00:00:00:07 actions=output:3 - table=1, priority=0 actions=FLOOD -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - if test $i != 1; then - # Check that hard_age has appeared. We need to do this separately - # from the above check because ofctl_strip removes it. dump-flows - # only prints hard_age when it is different from the flow's duration - # (that is, the number of seconds from the time it was created), - # so we only check for it after we've refreshed the flow once. - { set +x -$as_echo "$at_srcdir/learn.at:209: grep dl_dst=50:54:00:00:00:07 stdout | grep -c hard_age" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:209" -( $at_check_trace; grep dl_dst=50:54:00:00:00:07 stdout | grep -c hard_age -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:209" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - fi -done - -# Make sure that 15 seconds without refreshing makes the flow time out. -ovs-appctl time/warp 5000 -ovs-appctl time/warp 5000 -ovs-appctl time/warp 5000 -sleep 1 -{ set +x -$as_echo "$at_srcdir/learn.at:220: ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:220" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, priority=0 actions=FLOOD -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:220" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:224: check_logs " -at_fn_check_prepare_trace "learn.at:224" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:224" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:224: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:224" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:224" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:224: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:224" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:224" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_347 -#AT_START_348 -at_fn_group_banner 348 'learn.at:227' \ - "learning action - TCPv4 port learning" " " 21 -at_xfail=no -( - $as_echo "348. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:228: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:228" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:228: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:228" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:228: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:228" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:228: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:228" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:228" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:228: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:228" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:228" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:228: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:228" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:228" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:228: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy -- \\ - add-port br0 p2 -- set Interface p2 type=dummy -- \\ - add-port br0 p3 -- set Interface p3 type=dummy " -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:228" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy -- \ - add-port br0 p2 -- set Interface p2 type=dummy -- \ - add-port br0 p3 -- set Interface p3 type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:228" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Set up flow table for TCPv4 port learning. -{ set +x -$as_echo "$at_srcdir/learn.at:233: ovs-ofctl add-flow br0 'table=0 tcp actions=learn(table=1, hard_timeout=60, eth_type=0x800, nw_proto=6, NXM_OF_IP_SRC[]=NXM_OF_IP_DST[], NXM_OF_IP_DST[]=NXM_OF_IP_SRC[], NXM_OF_TCP_SRC[]=NXM_OF_TCP_DST[], NXM_OF_TCP_DST[]=NXM_OF_TCP_SRC[]), flood'" -at_fn_check_prepare_trace "learn.at:233" -( $at_check_trace; ovs-ofctl add-flow br0 'table=0 tcp actions=learn(table=1, hard_timeout=60, eth_type=0x800, nw_proto=6, NXM_OF_IP_SRC[]=NXM_OF_IP_DST[], NXM_OF_IP_DST[]=NXM_OF_IP_SRC[], NXM_OF_TCP_SRC[]=NXM_OF_TCP_DST[], NXM_OF_TCP_DST[]=NXM_OF_TCP_SRC[]), flood' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:233" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace a TCPv4 packet arriving on port 3. -flow="in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:06),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=40000,dst=80)" -{ set +x -$as_echo "$at_srcdir/learn.at:237: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "learn.at:237" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -actual=`tail -1 stdout | sed 's/Datapath actions: //'` - -expected="1,2,100" -{ set +x -$as_echo "$at_srcdir/learn.at:241: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "learn.at:241" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:241" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/learn.at:243: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "learn.at:243" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:243" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for the learning entry. -{ set +x -$as_echo "$at_srcdir/learn.at:246: ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:246" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, hard_timeout=60, tcp,nw_src=192.168.0.1,nw_dst=192.168.0.2,tp_src=80,tp_dst=40000 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:246" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:250: check_logs " -at_fn_check_prepare_trace "learn.at:250" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:250: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:250" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:250: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:250" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_348 -#AT_START_349 -at_fn_group_banner 349 'learn.at:253' \ - "learning action - TCPv6 port learning" " " 21 -at_xfail=no -( - $as_echo "349. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:254: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:254" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:254" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:254: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:254" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:254" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:254: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:254" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:254" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:254: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:254" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:254" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:254: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:254" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:254" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:254: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:254" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:254" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:254: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy -- \\ - add-port br0 p2 -- set Interface p2 type=dummy -- \\ - add-port br0 p3 -- set Interface p3 type=dummy " -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:254" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy -- \ - add-port br0 p2 -- set Interface p2 type=dummy -- \ - add-port br0 p3 -- set Interface p3 type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:254" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Set up flow table for TCPv6 port learning. -# Also add a 128-bit-wide "load" action and a 128-bit literal match to check -# that they work. -{ set +x -$as_echo "$at_srcdir/learn.at:261: ovs-ofctl add-flow br0 'table=0 tcp6 actions=learn(table=1, hard_timeout=60, eth_type=0x86dd, nw_proto=6, NXM_NX_IPV6_SRC[]=NXM_NX_IPV6_DST[], ipv6_dst=2001:0db8:85a3:0000:0000:8a2e:0370:7334, NXM_OF_TCP_SRC[]=NXM_OF_TCP_DST[], NXM_OF_TCP_DST[]=NXM_OF_TCP_SRC[], load(0x20010db885a308d313198a2e03707348->NXM_NX_IPV6_DST[])), flood'" -at_fn_check_prepare_trace "learn.at:261" -( $at_check_trace; ovs-ofctl add-flow br0 'table=0 tcp6 actions=learn(table=1, hard_timeout=60, eth_type=0x86dd, nw_proto=6, NXM_NX_IPV6_SRC[]=NXM_NX_IPV6_DST[], ipv6_dst=2001:0db8:85a3:0000:0000:8a2e:0370:7334, NXM_OF_TCP_SRC[]=NXM_OF_TCP_DST[], NXM_OF_TCP_DST[]=NXM_OF_TCP_SRC[], load(0x20010db885a308d313198a2e03707348->NXM_NX_IPV6_DST[])), flood' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace a TCPv6 packet arriving on port 3. -flow="in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:06),eth_type(0x86dd),ipv6(src=fec0::2,dst=fec0::1,label=0,proto=6,tclass=0,hlimit=255,frag=no),tcp(src=40000,dst=80)" -{ set +x -$as_echo "$at_srcdir/learn.at:265: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "learn.at:265" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -actual=`tail -1 stdout | sed 's/Datapath actions: //'` - -expected="1,2,100" -{ set +x -$as_echo "$at_srcdir/learn.at:269: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "learn.at:269" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:269" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/learn.at:271: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "learn.at:271" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:271" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for the learning entry. -{ set +x -$as_echo "$at_srcdir/learn.at:274: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:274" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, hard_timeout=60, tcp6,ipv6_src=fec0::1,ipv6_dst=2001:db8:85a3::8a2e:370:7334,tp_src=80,tp_dst=40000 actions=load:0x13198a2e03707348->NXM_NX_IPV6_DST[0..63],load:0x20010db885a308d3->NXM_NX_IPV6_DST[64..127] - tcp6 actions=learn(table=1,hard_timeout=60,eth_type=0x86dd,nw_proto=6,NXM_NX_IPV6_SRC[]=NXM_NX_IPV6_DST[],ipv6_dst=2001:db8:85a3::8a2e:370:7334,NXM_OF_TCP_SRC[]=NXM_OF_TCP_DST[],NXM_OF_TCP_DST[]=NXM_OF_TCP_SRC[],load:0x20010db885a308d313198a2e03707348->NXM_NX_IPV6_DST[]),FLOOD -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:274" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:279: check_logs " -at_fn_check_prepare_trace "learn.at:279" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:279" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:279: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:279" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:279" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:279: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:279" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:279" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_349 -#AT_START_350 -at_fn_group_banner 350 'learn.at:285' \ - "learning action - self-modifying flow" " " 21 -at_xfail=no -( - $as_echo "350. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:286: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:286" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:286" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:286: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:286" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:286" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:286: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:286" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:286" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:286: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:286" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:286: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:286" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:286: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:286" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:286: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "learn.at:286" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -ovs-appctl time/stop -# Set up flow table for TCPv4 port learning. -{ set +x -$as_echo "$at_srcdir/learn.at:291: ovs-ofctl add-flow br0 'actions=load:3->NXM_NX_REG0[0..15],learn(table=0,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2'" -at_fn_check_prepare_trace "learn.at:291" -( $at_check_trace; ovs-ofctl add-flow br0 'actions=load:3->NXM_NX_REG0[0..15],learn(table=0,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:291" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace some packets arriving. The particular packets don't matter. -for i in 1 2 3 4 5 6 7 8 9 10; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' - ovs-appctl time/warp 10 - if [ $i -eq 1 ]; then - sleep 1 - fi -done - -# Check for the learning entry. -ovs-appctl time/warp 1000 -{ set +x -$as_echo "$at_srcdir/learn.at:304: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:304" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=1, n_bytes=60, actions=load:0x3->NXM_NX_REG0[0..15],learn(table=0,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2 - n_packets=9, n_bytes=540, priority=65535,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:05 actions=output:3 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:304" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check that the first packet went out port 2 and the rest out port 3. -{ set +x -$as_echo "$at_srcdir/learn.at:311: (ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:311" -( $at_check_trace; (ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply: 1 ports - port 2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=1, bytes=60, drop=0, errs=0, coll=0 -OFPST_PORT reply: 1 ports - port 3: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=9, bytes=540, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:311" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/learn.at:321: check_logs " -at_fn_check_prepare_trace "learn.at:321" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:321: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:321" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:321: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:321" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_350 -#AT_START_351 -at_fn_group_banner 351 'learn.at:327' \ - "learning action - self-modifying flow with idle_timeout" "" 21 -at_xfail=no -( - $as_echo "351. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:328: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:328" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:328" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:328: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:328" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:328" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:328: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:328" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:328" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:328: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:328" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:328" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:328: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:328" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:328" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:328: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:328" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:328" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:328: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "learn.at:328" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:328" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -ovs-appctl time/stop -# Set up flow table for TCPv4 port learning. -{ set +x -$as_echo "$at_srcdir/learn.at:333: ovs-ofctl add-flow br0 'actions=load:3->NXM_NX_REG0[0..15],learn(table=0,idle_timeout=5,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2'" -at_fn_check_prepare_trace "learn.at:333" -( $at_check_trace; ovs-ofctl add-flow br0 'actions=load:3->NXM_NX_REG0[0..15],learn(table=0,idle_timeout=5,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:333" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace some packets arriving. The particular packets don't matter. -for i in `seq 1 10`; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' - ovs-appctl time/warp 10 - if [ $i -eq 1 ]; then - sleep 1 - fi -done - -# Trace some packets arriving. This is is a different flow from the previous. -# Note that we advance time by 1 second between each packet here. -for i in `seq 1 10`; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' - ovs-appctl time/warp 1000 - # Note: netdev-dummy/receive merely queues the packet. - # We need to wait for other thread to process the packet - # and update the flow's 'used' for the packet. - # (i % 3 == 0) below is somehow arbitrary but chosen to ensure - # that we update the flow's 'used' frequently enough to prevent - # idle_timeout. - if [ $i -eq 1 -o $((i % 3)) -eq 0 ]; then - sleep 1 - fi -done - -# Check that the first packet of each flow went out port 2 and the rest out -# port 3. -{ set +x -$as_echo "$at_srcdir/learn.at:362: (ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:362" -( $at_check_trace; (ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply: 1 ports - port 2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=2, bytes=120, drop=0, errs=0, coll=0 -OFPST_PORT reply: 1 ports - port 3: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=18, bytes=1080, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:362" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for the learning entry. -ovs-appctl time/warp 1000 -{ set +x -$as_echo "$at_srcdir/learn.at:374: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:374" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=2, n_bytes=120, actions=load:0x3->NXM_NX_REG0[0..15],learn(table=0,idle_timeout=5,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2 - n_packets=9, n_bytes=540, idle_timeout=5, priority=65535,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:06 actions=output:3 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:374" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:379: check_logs " -at_fn_check_prepare_trace "learn.at:379" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:379" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:379: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:379" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:379" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:379: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:379" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:379" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_351 -#AT_START_352 -at_fn_group_banner 352 'learn.at:385' \ - "learning action - self-modifying flow with hard_timeout" "" 21 -at_xfail=no -( - $as_echo "352. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:386: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:386" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:386" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:386: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:386" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:386" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:386: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:386" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:386" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:386: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:386" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:386: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:386" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:386: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:386" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:386: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "learn.at:386" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -ovs-appctl time/stop -# Set up flow table for TCPv4 port learning. -{ set +x -$as_echo "$at_srcdir/learn.at:391: ovs-ofctl add-flow br0 'actions=load:3->NXM_NX_REG0[0..15],learn(table=0,hard_timeout=10,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2'" -at_fn_check_prepare_trace "learn.at:391" -( $at_check_trace; ovs-ofctl add-flow br0 'actions=load:3->NXM_NX_REG0[0..15],learn(table=0,hard_timeout=10,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:391" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace some packets arriving. The particular packets don't matter. -for i in `seq 1 10`; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' - if [ $i -eq 1 ]; then - sleep 1 - fi - ovs-appctl time/warp 10 -done - -# Trace some packets arriving. This is is a different flow from the previous. -# Note that we advance time by 2 second between each packet here. -for i in `seq 1 10`; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' - # Note: hard_timeout should fire immediately after #6 packet. - # #7 packet re-install the flow and the following 3 packets - # (#8, #9, #10) use the flow. - # it's difficult to predict the exact timing of rule expiry - # because it's affected by flow dumper thread via udpif_dump_seq. - # hard_timeout value for this test was chosen to overcome the uncertainty. - # - # receive #1 learn, install flow with hard_timeout=10 - # sleep to ensure the flow installation - # (warp, timeout left 8s) - # receive #2 the learned flow - # (warp, timeout left 6s) - # receive #3 - # (warp, timeout left 4s) - # receive #4 - # (warp, timeout left 2s) - # receive #5 - # (warp, timeout left 0s) - # NOTE: OVS does not consider this expired yet. cf. rule_expire() - # receive #6 - # (warp, timeout left -2s) - # sleep to ensure flow expiration - # receive #7 learn, install flow with hard_timeout=10 - # sleep to ensure the flow installation - # (warp, timeout left 8s) - # receive #8 - # (warp, timeout left 6s) - # receive #9 - # (warp, timeout left 4s) - # receive #10 - # (warp, timeout left 2s) - if [ $i -eq 1 -o $i -eq 7 ]; then - sleep 1 - fi - ovs-appctl time/warp 2000 - if [ $i -eq 6 ]; then - sleep 1 - fi -done - -# Check that the first packet of each flow went out port 2 and the rest out -# port 3. -{ set +x -$as_echo "$at_srcdir/learn.at:448: (ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:448" -( $at_check_trace; (ovs-ofctl dump-ports br0 2; ovs-ofctl dump-ports br0 3) | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply: 1 ports - port 2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=3, bytes=180, drop=0, errs=0, coll=0 -OFPST_PORT reply: 1 ports - port 3: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=17, bytes=1020, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:448" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for the learning entry. -ovs-appctl time/warp 1000 -sleep 1 -{ set +x -$as_echo "$at_srcdir/learn.at:461: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:461" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=3, n_bytes=180, actions=load:0x3->NXM_NX_REG0[0..15],learn(table=0,hard_timeout=10,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2 - n_packets=3, n_bytes=180, hard_timeout=10, priority=65535,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:06 actions=output:3 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:466: check_logs " -at_fn_check_prepare_trace "learn.at:466" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:466: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:466" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:466: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:466" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_352 -#AT_START_353 -at_fn_group_banner 353 'learn.at:469' \ - "learning action - fin_timeout feature" " " 21 -at_xfail=no -( - $as_echo "353. $at_setup_line: testing $at_desc ..." - $at_traceon - -# This is a totally artificial use of the "learn" action. The only purpose -# is to check that specifying fin_idle_timeout or fin_hard_timeout causes -# a corresponding fin_timeout action to end up in the learned flows. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/learn.at:473: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "learn.at:473" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:473" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:473: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "learn.at:473" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:473" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:473: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:473" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:473" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/learn.at:473: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "learn.at:473" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:473: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "learn.at:473" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:473: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "learn.at:473" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/learn.at:473: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 " -at_fn_check_prepare_trace "learn.at:473" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/learn.at:475: ovs-ofctl add-flow br0 'actions=learn(fin_hard_timeout=10, fin_idle_timeout=5, NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], output:NXM_OF_IN_PORT[])'" -at_fn_check_prepare_trace "learn.at:475" -( $at_check_trace; ovs-ofctl add-flow br0 'actions=learn(fin_hard_timeout=10, fin_idle_timeout=5, NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], output:NXM_OF_IN_PORT[])' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:475" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:476: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' -generate" -at_fn_check_prepare_trace "learn.at:476" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:476" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:477: ovs-ofctl dump-flows br0 table=1 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "learn.at:477" -( $at_check_trace; ovs-ofctl dump-flows br0 table=1 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: - table=1, dl_dst=50:54:00:00:00:05 actions=fin_timeout(idle_timeout=5,hard_timeout=10),output:1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:477" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/learn.at:481: check_logs " -at_fn_check_prepare_trace "learn.at:481" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:481" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:481: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "learn.at:481" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:481" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/learn.at:481: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "learn.at:481" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/learn.at:481" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_353 -#AT_START_354 -at_fn_group_banner 354 'vconn.at:21' \ - "unix vconn - refuse connection" " " 22 -at_xfail=no -( - $as_echo "354. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn refuse-connection unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn refuse-connection unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_354 -#AT_START_355 -at_fn_group_banner 355 'vconn.at:21' \ - "unix vconn - accept then close" " " 22 -at_xfail=no -( - $as_echo "355. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn accept-then-close unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn accept-then-close unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_355 -#AT_START_356 -at_fn_group_banner 356 'vconn.at:21' \ - "unix vconn - read hello" " " 22 -at_xfail=no -( - $as_echo "356. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn read-hello unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn read-hello unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_356 -#AT_START_357 -at_fn_group_banner 357 'vconn.at:21' \ - "unix vconn - send plain hello" " " 22 -at_xfail=no -( - $as_echo "357. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn send-plain-hello unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn send-plain-hello unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_357 -#AT_START_358 -at_fn_group_banner 358 'vconn.at:21' \ - "unix vconn - send long hello" " " 22 -at_xfail=no -( - $as_echo "358. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn send-long-hello unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn send-long-hello unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_358 -#AT_START_359 -at_fn_group_banner 359 'vconn.at:21' \ - "unix vconn - send echo hello" " " 22 -at_xfail=no -( - $as_echo "359. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn send-echo-hello unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn send-echo-hello unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_359 -#AT_START_360 -at_fn_group_banner 360 'vconn.at:21' \ - "unix vconn - send short hello" " " 22 -at_xfail=no -( - $as_echo "360. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn send-short-hello unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn send-short-hello unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_360 -#AT_START_361 -at_fn_group_banner 361 'vconn.at:21' \ - "unix vconn - send invalid version hello" " " 22 -at_xfail=no -( - $as_echo "361. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:21: ovstest test-vconn send-invalid-version-hello unix" -at_fn_check_prepare_trace "vconn.at:21" -( $at_check_trace; ovstest test-vconn send-invalid-version-hello unix -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_361 -#AT_START_362 -at_fn_group_banner 362 'vconn.at:22' \ - "tcp vconn - refuse connection" " " 23 -at_xfail=no -( - $as_echo "362. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn refuse-connection tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn refuse-connection tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_362 -#AT_START_363 -at_fn_group_banner 363 'vconn.at:22' \ - "tcp vconn - accept then close" " " 23 -at_xfail=no -( - $as_echo "363. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn accept-then-close tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn accept-then-close tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_363 -#AT_START_364 -at_fn_group_banner 364 'vconn.at:22' \ - "tcp vconn - read hello" " " 23 -at_xfail=no -( - $as_echo "364. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn read-hello tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn read-hello tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_364 -#AT_START_365 -at_fn_group_banner 365 'vconn.at:22' \ - "tcp vconn - send plain hello" " " 23 -at_xfail=no -( - $as_echo "365. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn send-plain-hello tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn send-plain-hello tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_365 -#AT_START_366 -at_fn_group_banner 366 'vconn.at:22' \ - "tcp vconn - send long hello" " " 23 -at_xfail=no -( - $as_echo "366. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn send-long-hello tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn send-long-hello tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_366 -#AT_START_367 -at_fn_group_banner 367 'vconn.at:22' \ - "tcp vconn - send echo hello" " " 23 -at_xfail=no -( - $as_echo "367. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn send-echo-hello tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn send-echo-hello tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_367 -#AT_START_368 -at_fn_group_banner 368 'vconn.at:22' \ - "tcp vconn - send short hello" " " 23 -at_xfail=no -( - $as_echo "368. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn send-short-hello tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn send-short-hello tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_368 -#AT_START_369 -at_fn_group_banner 369 'vconn.at:22' \ - "tcp vconn - send invalid version hello" " " 23 -at_xfail=no -( - $as_echo "369. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - { set +x -$as_echo "$at_srcdir/vconn.at:22: ovstest test-vconn send-invalid-version-hello tcp" -at_fn_check_prepare_trace "vconn.at:22" -( $at_check_trace; ovstest test-vconn send-invalid-version-hello tcp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_369 -#AT_START_370 -at_fn_group_banner 370 'vconn.at:23' \ - "ssl vconn - refuse connection" " " 24 -at_xfail=no -( - $as_echo "370. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn refuse-connection ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn refuse-connection ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_370 -#AT_START_371 -at_fn_group_banner 371 'vconn.at:23' \ - "ssl vconn - accept then close" " " 24 -at_xfail=no -( - $as_echo "371. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn accept-then-close ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn accept-then-close ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_371 -#AT_START_372 -at_fn_group_banner 372 'vconn.at:23' \ - "ssl vconn - read hello" " " 24 -at_xfail=no -( - $as_echo "372. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn read-hello ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn read-hello ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_372 -#AT_START_373 -at_fn_group_banner 373 'vconn.at:23' \ - "ssl vconn - send plain hello" " " 24 -at_xfail=no -( - $as_echo "373. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn send-plain-hello ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn send-plain-hello ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_373 -#AT_START_374 -at_fn_group_banner 374 'vconn.at:23' \ - "ssl vconn - send long hello" " " 24 -at_xfail=no -( - $as_echo "374. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn send-long-hello ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn send-long-hello ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_374 -#AT_START_375 -at_fn_group_banner 375 'vconn.at:23' \ - "ssl vconn - send echo hello" " " 24 -at_xfail=no -( - $as_echo "375. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn send-echo-hello ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn send-echo-hello ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_375 -#AT_START_376 -at_fn_group_banner 376 'vconn.at:23' \ - "ssl vconn - send short hello" " " 24 -at_xfail=no -( - $as_echo "376. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn send-short-hello ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn send-short-hello ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_376 -#AT_START_377 -at_fn_group_banner 377 'vconn.at:23' \ - "ssl vconn - send invalid version hello" " " 24 -at_xfail=no -( - $as_echo "377. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - $as_echo "vconn.at:23" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/vconn.at:23" - { set +x -$as_echo "$at_srcdir/vconn.at:23: cp \$abs_top_builddir/tests/testpki*.pem ." -at_fn_check_prepare_dynamic "cp $abs_top_builddir/tests/testpki*.pem ." "vconn.at:23" -( $at_check_trace; cp $abs_top_builddir/tests/testpki*.pem . -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vconn.at:23: ovstest test-vconn send-invalid-version-hello ssl" -at_fn_check_prepare_trace "vconn.at:23" -( $at_check_trace; ovstest test-vconn send-invalid-version-hello ssl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vconn.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_377 -#AT_START_378 -at_fn_group_banner 378 'file_name.at:12' \ - "components of \"/usr/lib\" are \"/usr\", \"lib\"" " " 25 -at_xfail=no -( - $as_echo "378. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:12: ovstest test-file_name \"/usr/lib\"" -at_fn_check_prepare_trace "file_name.at:12" -( $at_check_trace; ovstest test-file_name "/usr/lib" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "/usr -lib -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:12" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_378 -#AT_START_379 -at_fn_group_banner 379 'file_name.at:13' \ - "components of \"/usr/\" are \"/\", \"usr\"" " " 25 -at_xfail=no -( - $as_echo "379. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:13: ovstest test-file_name \"/usr/\"" -at_fn_check_prepare_trace "file_name.at:13" -( $at_check_trace; ovstest test-file_name "/usr/" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "/ -usr -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_379 -#AT_START_380 -at_fn_group_banner 380 'file_name.at:14' \ - "components of \"usr\" are \".\", \"usr\"" " " 25 -at_xfail=no -( - $as_echo "380. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:14: ovstest test-file_name \"usr\"" -at_fn_check_prepare_trace "file_name.at:14" -( $at_check_trace; ovstest test-file_name "usr" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo ". -usr -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:14" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_380 -#AT_START_381 -at_fn_group_banner 381 'file_name.at:15' \ - "components of \"/\" are \"/\", \"/\"" " " 25 -at_xfail=no -( - $as_echo "381. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:15: ovstest test-file_name \"/\"" -at_fn_check_prepare_trace "file_name.at:15" -( $at_check_trace; ovstest test-file_name "/" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "/ -/ -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:15" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_381 -#AT_START_382 -at_fn_group_banner 382 'file_name.at:16' \ - "components of \".\" are \".\", \".\"" " " 25 -at_xfail=no -( - $as_echo "382. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:16: ovstest test-file_name \".\"" -at_fn_check_prepare_trace "file_name.at:16" -( $at_check_trace; ovstest test-file_name "." -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo ". -. -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:16" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_382 -#AT_START_383 -at_fn_group_banner 383 'file_name.at:17' \ - "components of \"..\" are \".\", \"..\"" " " 25 -at_xfail=no -( - $as_echo "383. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:17: ovstest test-file_name \"..\"" -at_fn_check_prepare_trace "file_name.at:17" -( $at_check_trace; ovstest test-file_name ".." -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo ". -.. -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:17" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_383 -#AT_START_384 -at_fn_group_banner 384 'file_name.at:18' \ - "components of \"//\" are \"//\", \"//\"" " " 25 -at_xfail=no -( - $as_echo "384. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:18: ovstest test-file_name \"//\"" -at_fn_check_prepare_trace "file_name.at:18" -( $at_check_trace; ovstest test-file_name "//" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "// -// -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:18" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_384 -#AT_START_385 -at_fn_group_banner 385 'file_name.at:19' \ - "components of \"//foo\" are \"//\", \"foo\"" " " 25 -at_xfail=no -( - $as_echo "385. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:19: ovstest test-file_name \"//foo\"" -at_fn_check_prepare_trace "file_name.at:19" -( $at_check_trace; ovstest test-file_name "//foo" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "// -foo -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_385 -#AT_START_386 -at_fn_group_banner 386 'file_name.at:20' \ - "components of \"\" are \".\", \".\"" " " 25 -at_xfail=no -( - $as_echo "386. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:20: ovstest test-file_name \"\"" -at_fn_check_prepare_trace "file_name.at:20" -( $at_check_trace; ovstest test-file_name "" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo ". -. -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:20" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_386 -#AT_START_387 -at_fn_group_banner 387 'file_name.at:23' \ - "components of \"dir/file\" are \"dir\", \"file\"" " " 25 -at_xfail=no -( - $as_echo "387. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:23: ovstest test-file_name \"dir/file\"" -at_fn_check_prepare_trace "file_name.at:23" -( $at_check_trace; ovstest test-file_name "dir/file" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dir -file -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_387 -#AT_START_388 -at_fn_group_banner 388 'file_name.at:24' \ - "components of \"dir/file/\" are \"dir\", \"file\"" " " 25 -at_xfail=no -( - $as_echo "388. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:24: ovstest test-file_name \"dir/file/\"" -at_fn_check_prepare_trace "file_name.at:24" -( $at_check_trace; ovstest test-file_name "dir/file/" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dir -file -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:24" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_388 -#AT_START_389 -at_fn_group_banner 389 'file_name.at:25' \ - "components of \"dir/file//\" are \"dir\", \"file\"" " " 25 -at_xfail=no -( - $as_echo "389. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:25: ovstest test-file_name \"dir/file//\"" -at_fn_check_prepare_trace "file_name.at:25" -( $at_check_trace; ovstest test-file_name "dir/file//" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dir -file -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:25" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_389 -#AT_START_390 -at_fn_group_banner 390 'file_name.at:26' \ - "components of \"///foo\" are \"/\", \"foo\"" " " 25 -at_xfail=no -( - $as_echo "390. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/file_name.at:26: ovstest test-file_name \"///foo\"" -at_fn_check_prepare_trace "file_name.at:26" -( $at_check_trace; ovstest test-file_name "///foo" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "/ -foo -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:26" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_390 -#AT_START_391 -at_fn_group_banner 391 'file_name.at:36' \ - "follow_symlinks - relative symlinks" " " 26 -at_xfail=no -( - $as_echo "391. $at_setup_line: testing $at_desc ..." - $at_traceon - -: > target -ln -s target source -$as_echo "file_name.at:39" >"$at_check_line_file" -(test ! -h source) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:39" -echo "check source -> target" - { set +x -$as_echo "$at_srcdir/file_name.at:40: ovstest test-util follow-symlinks \"source\"" -at_fn_check_prepare_trace "file_name.at:40" -( $at_check_trace; ovstest test-util follow-symlinks "source" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "target -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - -mkdir dir -ln -s target2 dir/source2 -echo "check dir/source2 -> dir/target2" - { set +x -$as_echo "$at_srcdir/file_name.at:44: ovstest test-util follow-symlinks \"dir/source2\"" -at_fn_check_prepare_trace "file_name.at:44" -( $at_check_trace; ovstest test-util follow-symlinks "dir/source2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dir/target2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:44" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - -mkdir dir/dir2 -ln -s dir/b a -ln -s c dir/b -ln -s dir2/d dir/c -echo "check a -> dir/dir2/d" - { set +x -$as_echo "$at_srcdir/file_name.at:50: ovstest test-util follow-symlinks \"a\"" -at_fn_check_prepare_trace "file_name.at:50" -( $at_check_trace; ovstest test-util follow-symlinks "a" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dir/dir2/d -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_391 -#AT_START_392 -at_fn_group_banner 392 'file_name.at:53' \ - "follow_symlinks - absolute symlinks" " " 26 -at_xfail=no -( - $as_echo "392. $at_setup_line: testing $at_desc ..." - $at_traceon - -: > target -ln -s "`pwd`/target" source -$as_echo "file_name.at:56" >"$at_check_line_file" -(test ! -h source) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:56" -echo "check source -> `pwd`/target" - { set +x -$as_echo "$at_srcdir/file_name.at:57: ovstest test-util follow-symlinks \"source\"" -at_fn_check_prepare_trace "file_name.at:57" -( $at_check_trace; ovstest test-util follow-symlinks "source" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`pwd`/target -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:57" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - -mkdir dir -ln -s "`pwd`/dir/target2" dir/source2 -echo "check dir/source2 -> `pwd`/dir/target2" - { set +x -$as_echo "$at_srcdir/file_name.at:61: ovstest test-util follow-symlinks \"dir/source2\"" -at_fn_check_prepare_trace "file_name.at:61" -( $at_check_trace; ovstest test-util follow-symlinks "dir/source2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`pwd`/dir/target2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - -mkdir dir/dir2 -ln -s "`pwd`/dir/b" a -ln -s "`pwd`/dir/c" dir/b -ln -s "`pwd`/dir/dir2/d" dir/c -echo "check a -> `pwd`/dir/dir2/d" - { set +x -$as_echo "$at_srcdir/file_name.at:67: ovstest test-util follow-symlinks \"a\"" -at_fn_check_prepare_trace "file_name.at:67" -( $at_check_trace; ovstest test-util follow-symlinks "a" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "`pwd`/dir/dir2/d -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:67" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_392 -#AT_START_393 -at_fn_group_banner 393 'file_name.at:70' \ - "follow_symlinks - symlinks to directories" " " 26 -at_xfail=no -( - $as_echo "393. $at_setup_line: testing $at_desc ..." - $at_traceon - -mkdir target -ln -s target source -$as_echo "file_name.at:73" >"$at_check_line_file" -(test ! -h source) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:73" -ln -s target/ source2 -echo "check source -> target" - { set +x -$as_echo "$at_srcdir/file_name.at:75: ovstest test-util follow-symlinks \"source\"" -at_fn_check_prepare_trace "file_name.at:75" -( $at_check_trace; ovstest test-util follow-symlinks "source" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "target -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo -echo "check source2 -> target/" - { set +x -$as_echo "$at_srcdir/file_name.at:76: ovstest test-util follow-symlinks \"source2\"" -at_fn_check_prepare_trace "file_name.at:76" -( $at_check_trace; ovstest test-util follow-symlinks "source2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "target/ -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:76" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - -# follow_symlinks() doesn't expand symlinks in the middle of a name. -: > source/x -echo "check source/x -> source/x" - { set +x -$as_echo "$at_srcdir/file_name.at:80: ovstest test-util follow-symlinks \"source/x\"" -at_fn_check_prepare_trace "file_name.at:80" -( $at_check_trace; ovstest test-util follow-symlinks "source/x" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "source/x -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_393 -#AT_START_394 -at_fn_group_banner 394 'file_name.at:83' \ - "follow_symlinks - nonexistent targets" " " 26 -at_xfail=no -( - $as_echo "394. $at_setup_line: testing $at_desc ..." - $at_traceon - -ln -s target source -$as_echo "file_name.at:85" >"$at_check_line_file" -(test ! -h source) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:85" -echo "check source -> target" - { set +x -$as_echo "$at_srcdir/file_name.at:86: ovstest test-util follow-symlinks \"source\"" -at_fn_check_prepare_trace "file_name.at:86" -( $at_check_trace; ovstest test-util follow-symlinks "source" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "target -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:86" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo -echo "check target -> target" - { set +x -$as_echo "$at_srcdir/file_name.at:87: ovstest test-util follow-symlinks \"target\"" -at_fn_check_prepare_trace "file_name.at:87" -( $at_check_trace; ovstest test-util follow-symlinks "target" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "target -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo -echo "check target -> target" - { set +x -$as_echo "$at_srcdir/file_name.at:88: ovstest test-util follow-symlinks \"target\"" -at_fn_check_prepare_trace "file_name.at:88" -( $at_check_trace; ovstest test-util follow-symlinks "target" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "target -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:88" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_394 -#AT_START_395 -at_fn_group_banner 395 'file_name.at:91' \ - "follow_symlinks - regular files" " " 26 -at_xfail=no -( - $as_echo "395. $at_setup_line: testing $at_desc ..." - $at_traceon - -touch x -echo "check x -> x" - { set +x -$as_echo "$at_srcdir/file_name.at:93: ovstest test-util follow-symlinks \"x\"" -at_fn_check_prepare_trace "file_name.at:93" -( $at_check_trace; ovstest test-util follow-symlinks "x" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "x -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:93" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_395 -#AT_START_396 -at_fn_group_banner 396 'file_name.at:96' \ - "follow_symlinks - device targets" " " 26 -at_xfail=no -( - $as_echo "396. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "file_name.at:97" >"$at_check_line_file" -(test ! -e /dev/null) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:97" -$as_echo "file_name.at:98" >"$at_check_line_file" -(test ! -e /dev/full) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:98" -ln -s /dev/null x -ln -s /dev/full y -echo "check x -> /dev/null" - { set +x -$as_echo "$at_srcdir/file_name.at:101: ovstest test-util follow-symlinks \"x\"" -at_fn_check_prepare_trace "file_name.at:101" -( $at_check_trace; ovstest test-util follow-symlinks "x" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "/dev/null -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:101" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo -echo "check y -> /dev/full" - { set +x -$as_echo "$at_srcdir/file_name.at:102: ovstest test-util follow-symlinks \"y\"" -at_fn_check_prepare_trace "file_name.at:102" -( $at_check_trace; ovstest test-util follow-symlinks "y" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "/dev/full -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_396 -#AT_START_397 -at_fn_group_banner 397 'file_name.at:105' \ - "follow_symlinks - nonexistent files" " " 26 -at_xfail=no -( - $as_echo "397. $at_setup_line: testing $at_desc ..." - $at_traceon - -echo "check nonexistent -> nonexistent" - { set +x -$as_echo "$at_srcdir/file_name.at:106: ovstest test-util follow-symlinks \"nonexistent\"" -at_fn_check_prepare_trace "file_name.at:106" -( $at_check_trace; ovstest test-util follow-symlinks "nonexistent" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "nonexistent -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:106" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo -echo "check a/b/c -> a/b/c" - { set +x -$as_echo "$at_srcdir/file_name.at:107: ovstest test-util follow-symlinks \"a/b/c\"" -at_fn_check_prepare_trace "file_name.at:107" -( $at_check_trace; ovstest test-util follow-symlinks "a/b/c" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a/b/c -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo -echo "check /a/b/c -> /a/b/c" - { set +x -$as_echo "$at_srcdir/file_name.at:108: ovstest test-util follow-symlinks \"/a/b/c\"" -at_fn_check_prepare_trace "file_name.at:108" -( $at_check_trace; ovstest test-util follow-symlinks "/a/b/c" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "/a/b/c -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:108" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo -echo "check //a/b/c -> //a/b/c" - { set +x -$as_echo "$at_srcdir/file_name.at:109: ovstest test-util follow-symlinks \"//a/b/c\"" -at_fn_check_prepare_trace "file_name.at:109" -( $at_check_trace; ovstest test-util follow-symlinks "//a/b/c" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "//a/b/c -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - echo - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_397 -#AT_START_398 -at_fn_group_banner 398 'file_name.at:112' \ - "follow_symlinks - symlink loop" " " 26 -at_xfail=no -( - $as_echo "398. $at_setup_line: testing $at_desc ..." - $at_traceon - -ln -s a b -$as_echo "file_name.at:114" >"$at_check_line_file" -(test ! -h b) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:114" -ln -s b a -$as_echo "file_name.at:116" >"$at_check_line_file" -(test ! -h a) \ - && at_fn_check_skip 77 "$at_srcdir/file_name.at:116" - -{ set +x -$as_echo "$at_srcdir/file_name.at:118: ovstest test-util follow-symlinks a" -at_fn_check_prepare_trace "file_name.at:118" -( $at_check_trace; ovstest test-util follow-symlinks a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:118" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/file_name.at:120: sed 's/^[^|]*|//' stderr" -at_fn_check_prepare_notrace 'a shell pipeline' "file_name.at:120" -( $at_check_trace; sed 's/^[^|]*|//' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "00001|util|WARN|a: too many levels of symlinks -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/file_name.at:120" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_398 -#AT_START_399 -at_fn_group_banner 399 'aes128.at:10' \ - "wikipedia test vector 1" " " 27 -at_xfail=no -( - $as_echo "399. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:10: ovstest test-aes128 00010203050607080a0b0c0d0f101112 506812a45f08c889b97f5980038b8359" -at_fn_check_prepare_trace "aes128.at:10" -( $at_check_trace; ovstest test-aes128 00010203050607080a0b0c0d0f101112 506812a45f08c889b97f5980038b8359 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "d8f532538289ef7d06b506a4fd5be9c9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:10" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_399 -#AT_START_400 -at_fn_group_banner 400 'aes128.at:16' \ - "wikipedia test vector 2" " " 27 -at_xfail=no -( - $as_echo "400. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:16: ovstest test-aes128 95A8EE8E89979B9EFDCBC6EB9797528D 4ec137a426dabf8aa0beb8bc0c2b89d6" -at_fn_check_prepare_trace "aes128.at:16" -( $at_check_trace; ovstest test-aes128 95A8EE8E89979B9EFDCBC6EB9797528D 4ec137a426dabf8aa0beb8bc0c2b89d6 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "d9b65d1232ba0199cdbd487b2a1fd646 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:16" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_400 -#AT_START_401 -at_fn_group_banner 401 'aes128.at:22' \ - "NIST KAT ECBKeySbox128e vector 0" " " 27 -at_xfail=no -( - $as_echo "401. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:22: ovstest test-aes128 10a58869d74be5a374cf867cfb473859 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:22" -( $at_check_trace; ovstest test-aes128 10a58869d74be5a374cf867cfb473859 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "6d251e6944b051e04eaa6fb4dbf78465 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:22" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_401 -#AT_START_402 -at_fn_group_banner 402 'aes128.at:28' \ - "NIST KAT ECBKeySbox128e vector 1" " " 27 -at_xfail=no -( - $as_echo "402. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:28: ovstest test-aes128 caea65cdbb75e9169ecd22ebe6e54675 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:28" -( $at_check_trace; ovstest test-aes128 caea65cdbb75e9169ecd22ebe6e54675 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "6e29201190152df4ee058139def610bb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:28" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_402 -#AT_START_403 -at_fn_group_banner 403 'aes128.at:34' \ - "NIST KAT ECBKeySbox128e vector 2" " " 27 -at_xfail=no -( - $as_echo "403. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:34: ovstest test-aes128 a2e2fa9baf7d20822ca9f0542f764a41 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:34" -( $at_check_trace; ovstest test-aes128 a2e2fa9baf7d20822ca9f0542f764a41 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "c3b44b95d9d2f25670eee9a0de099fa3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_403 -#AT_START_404 -at_fn_group_banner 404 'aes128.at:40' \ - "NIST KAT ECBKeySbox128e vector 3" " " 27 -at_xfail=no -( - $as_echo "404. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:40: ovstest test-aes128 b6364ac4e1de1e285eaf144a2415f7a0 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:40" -( $at_check_trace; ovstest test-aes128 b6364ac4e1de1e285eaf144a2415f7a0 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "5d9b05578fc944b3cf1ccf0e746cd581 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_404 -#AT_START_405 -at_fn_group_banner 405 'aes128.at:46' \ - "NIST KAT ECBKeySbox128e vector 4" " " 27 -at_xfail=no -( - $as_echo "405. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:46: ovstest test-aes128 64cf9c7abc50b888af65f49d521944b2 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:46" -( $at_check_trace; ovstest test-aes128 64cf9c7abc50b888af65f49d521944b2 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "f7efc89d5dba578104016ce5ad659c05 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_405 -#AT_START_406 -at_fn_group_banner 406 'aes128.at:52' \ - "NIST KAT ECBKeySbox128e vector 5" " " 27 -at_xfail=no -( - $as_echo "406. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:52: ovstest test-aes128 47d6742eefcc0465dc96355e851b64d9 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:52" -( $at_check_trace; ovstest test-aes128 47d6742eefcc0465dc96355e851b64d9 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0306194f666d183624aa230a8b264ae7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:52" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_406 -#AT_START_407 -at_fn_group_banner 407 'aes128.at:58' \ - "NIST KAT ECBKeySbox128e vector 6" " " 27 -at_xfail=no -( - $as_echo "407. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:58: ovstest test-aes128 3eb39790678c56bee34bbcdeccf6cdb5 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:58" -( $at_check_trace; ovstest test-aes128 3eb39790678c56bee34bbcdeccf6cdb5 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "858075d536d79ccee571f7d7204b1f67 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:58" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_407 -#AT_START_408 -at_fn_group_banner 408 'aes128.at:64' \ - "NIST KAT ECBKeySbox128e vector 7" " " 27 -at_xfail=no -( - $as_echo "408. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:64: ovstest test-aes128 64110a924f0743d500ccadae72c13427 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:64" -( $at_check_trace; ovstest test-aes128 64110a924f0743d500ccadae72c13427 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "35870c6a57e9e92314bcb8087cde72ce -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:64" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_408 -#AT_START_409 -at_fn_group_banner 409 'aes128.at:70' \ - "NIST KAT ECBKeySbox128e vector 8" " " 27 -at_xfail=no -( - $as_echo "409. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:70: ovstest test-aes128 18d8126516f8a12ab1a36d9f04d68e51 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:70" -( $at_check_trace; ovstest test-aes128 18d8126516f8a12ab1a36d9f04d68e51 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "6c68e9be5ec41e22c825b7c7affb4363 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:70" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_409 -#AT_START_410 -at_fn_group_banner 410 'aes128.at:76' \ - "NIST KAT ECBKeySbox128e vector 9" " " 27 -at_xfail=no -( - $as_echo "410. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:76: ovstest test-aes128 f530357968578480b398a3c251cd1093 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:76" -( $at_check_trace; ovstest test-aes128 f530357968578480b398a3c251cd1093 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "f5df39990fc688f1b07224cc03e86cea -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:76" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_410 -#AT_START_411 -at_fn_group_banner 411 'aes128.at:82' \ - "NIST KAT ECBKeySbox128e vector 10" " " 27 -at_xfail=no -( - $as_echo "411. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:82: ovstest test-aes128 da84367f325d42d601b4326964802e8e 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:82" -( $at_check_trace; ovstest test-aes128 da84367f325d42d601b4326964802e8e 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bba071bcb470f8f6586e5d3add18bc66 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:82" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_411 -#AT_START_412 -at_fn_group_banner 412 'aes128.at:88' \ - "NIST KAT ECBKeySbox128e vector 11" " " 27 -at_xfail=no -( - $as_echo "412. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:88: ovstest test-aes128 e37b1c6aa2846f6fdb413f238b089f23 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:88" -( $at_check_trace; ovstest test-aes128 e37b1c6aa2846f6fdb413f238b089f23 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "43c9f7e62f5d288bb27aa40ef8fe1ea8 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:88" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_412 -#AT_START_413 -at_fn_group_banner 413 'aes128.at:94' \ - "NIST KAT ECBKeySbox128e vector 12" " " 27 -at_xfail=no -( - $as_echo "413. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:94: ovstest test-aes128 6c002b682483e0cabcc731c253be5674 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:94" -( $at_check_trace; ovstest test-aes128 6c002b682483e0cabcc731c253be5674 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "3580d19cff44f1014a7c966a69059de5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_413 -#AT_START_414 -at_fn_group_banner 414 'aes128.at:100' \ - "NIST KAT ECBKeySbox128e vector 13" " " 27 -at_xfail=no -( - $as_echo "414. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:100: ovstest test-aes128 143ae8ed6555aba96110ab58893a8ae1 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:100" -( $at_check_trace; ovstest test-aes128 143ae8ed6555aba96110ab58893a8ae1 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "806da864dd29d48deafbe764f8202aef -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:100" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_414 -#AT_START_415 -at_fn_group_banner 415 'aes128.at:106' \ - "NIST KAT ECBKeySbox128e vector 14" " " 27 -at_xfail=no -( - $as_echo "415. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:106: ovstest test-aes128 b69418a85332240dc82492353956ae0c 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:106" -( $at_check_trace; ovstest test-aes128 b69418a85332240dc82492353956ae0c 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a303d940ded8f0baff6f75414cac5243 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:106" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_415 -#AT_START_416 -at_fn_group_banner 416 'aes128.at:112' \ - "NIST KAT ECBKeySbox128e vector 15" " " 27 -at_xfail=no -( - $as_echo "416. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:112: ovstest test-aes128 71b5c08a1993e1362e4d0ce9b22b78d5 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:112" -( $at_check_trace; ovstest test-aes128 71b5c08a1993e1362e4d0ce9b22b78d5 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "c2dabd117f8a3ecabfbb11d12194d9d0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_416 -#AT_START_417 -at_fn_group_banner 417 'aes128.at:118' \ - "NIST KAT ECBKeySbox128e vector 16" " " 27 -at_xfail=no -( - $as_echo "417. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:118: ovstest test-aes128 e234cdca2606b81f29408d5f6da21206 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:118" -( $at_check_trace; ovstest test-aes128 e234cdca2606b81f29408d5f6da21206 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "fff60a4740086b3b9c56195b98d91a7b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:118" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_417 -#AT_START_418 -at_fn_group_banner 418 'aes128.at:124' \ - "NIST KAT ECBKeySbox128e vector 17" " " 27 -at_xfail=no -( - $as_echo "418. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:124: ovstest test-aes128 13237c49074a3da078dc1d828bb78c6f 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:124" -( $at_check_trace; ovstest test-aes128 13237c49074a3da078dc1d828bb78c6f 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "8146a08e2357f0caa30ca8c94d1a0544 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:124" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_418 -#AT_START_419 -at_fn_group_banner 419 'aes128.at:130' \ - "NIST KAT ECBKeySbox128e vector 18" " " 27 -at_xfail=no -( - $as_echo "419. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:130: ovstest test-aes128 3071a2a48fe6cbd04f1a129098e308f8 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:130" -( $at_check_trace; ovstest test-aes128 3071a2a48fe6cbd04f1a129098e308f8 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "4b98e06d356deb07ebb824e5713f7be3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:130" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_419 -#AT_START_420 -at_fn_group_banner 420 'aes128.at:136' \ - "NIST KAT ECBKeySbox128e vector 19" " " 27 -at_xfail=no -( - $as_echo "420. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:136: ovstest test-aes128 90f42ec0f68385f2ffc5dfc03a654dce 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:136" -( $at_check_trace; ovstest test-aes128 90f42ec0f68385f2ffc5dfc03a654dce 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "7a20a53d460fc9ce0423a7a0764c6cf2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_420 -#AT_START_421 -at_fn_group_banner 421 'aes128.at:142' \ - "NIST KAT ECBKeySbox128e vector 20" " " 27 -at_xfail=no -( - $as_echo "421. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/aes128.at:142: ovstest test-aes128 febd9a24d8b65c1c787d50a4ed3619a9 00000000000000000000000000000000" -at_fn_check_prepare_trace "aes128.at:142" -( $at_check_trace; ovstest test-aes128 febd9a24d8b65c1c787d50a4ed3619a9 00000000000000000000000000000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "f4a70d8af877f9b02b4c40df57d45b17 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/aes128.at:142" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_421 -#AT_START_422 -at_fn_group_banner 422 'unixctl-py.at:6' \ - "unixctl ovs-vswitchd exit - Python" " " 28 -at_xfail=no -( - $as_echo "422. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "unixctl-py.at:7" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/unixctl-py.at:7" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/unixctl-py.at:8: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "unixctl-py.at:8" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:8" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:8: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "unixctl-py.at:8" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:8" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:8: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:8" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:8" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:8: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "unixctl-py.at:8" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:8" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:8: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "unixctl-py.at:8" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:8" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:8: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:8" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:8" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:8: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "unixctl-py.at:8" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:8" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:10: \$PYTHON \$srcdir/appctl.py --timeout 20 -t ovs-vswitchd exit" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t ovs-vswitchd exit" "unixctl-py.at:10" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:10" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:11: ovs_wait_cond () { if test -s ovs-vswitchd.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:11" -( $at_check_trace; ovs_wait_cond () { if test -s ovs-vswitchd.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:11" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:13: \$PYTHON \$srcdir/appctl.py --timeout 20 -t ovsdb-server exit" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t ovsdb-server exit" "unixctl-py.at:13" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:13" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:14: ovs_wait_cond () { if test -s ovsdb-server.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:14" -( $at_check_trace; ovs_wait_cond () { if test -s ovsdb-server.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:14" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_422 -#AT_START_423 -at_fn_group_banner 423 'unixctl-py.at:17' \ - "unixctl ovs-vswitchd help - Python" " " 28 -at_xfail=no -( - $as_echo "423. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "unixctl-py.at:18" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/unixctl-py.at:18" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/unixctl-py.at:19: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "unixctl-py.at:19" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:19: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "unixctl-py.at:19" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:19: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:19" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:19: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "unixctl-py.at:19" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:19" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:19: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "unixctl-py.at:19" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:19" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:19: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:19" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:19" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:19: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "unixctl-py.at:19" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:19" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:21: ovs-appctl --timeout 20 help" -at_fn_check_prepare_trace "unixctl-py.at:21" -( $at_check_trace; ovs-appctl --timeout 20 help -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:21" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:22: head -1 stdout" -at_fn_check_prepare_trace "unixctl-py.at:22" -( $at_check_trace; head -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "The available commands are: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:22" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:26: \$PYTHON \$srcdir/appctl.py --timeout 20 help" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 help" "unixctl-py.at:26" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 help -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:26" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:28: check_logs " -at_fn_check_prepare_trace "unixctl-py.at:28" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:28: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "unixctl-py.at:28" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:28: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "unixctl-py.at:28" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_423 -#AT_START_424 -at_fn_group_banner 424 'unixctl-py.at:32' \ - "unixctl ovs-vswitchd arguments - Python" " " 28 -at_xfail=no -( - $as_echo "424. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "unixctl-py.at:33" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/unixctl-py.at:33" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/unixctl-py.at:34: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "unixctl-py.at:34" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:34: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "unixctl-py.at:34" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:34: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:34" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:34: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "unixctl-py.at:34" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:34" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:34: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "unixctl-py.at:34" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:34" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:34: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "unixctl-py.at:34" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:34" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:34: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "unixctl-py.at:34" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:34" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:36: ovs-appctl --timeout 20 bond/hash" -at_fn_check_prepare_trace "unixctl-py.at:36" -( $at_check_trace; ovs-appctl --timeout 20 bond/hash -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:36" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:37: head -1 stderr" -at_fn_check_prepare_trace "unixctl-py.at:37" -( $at_check_trace; head -1 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"bond/hash\" command requires at least 1 arguments -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:37" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:41: \$PYTHON \$srcdir/appctl.py --timeout 20 bond/hash" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 bond/hash" "unixctl-py.at:41" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 bond/hash -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:41" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:43: ovs-appctl --timeout 20 bond/hash mac" -at_fn_check_prepare_trace "unixctl-py.at:43" -( $at_check_trace; ovs-appctl --timeout 20 bond/hash mac -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:43" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:44: head -1 stderr" -at_fn_check_prepare_trace "unixctl-py.at:44" -( $at_check_trace; head -1 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "invalid mac -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:44" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:48: \$PYTHON \$srcdir/appctl.py --timeout 20 bond/hash mac" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 bond/hash mac" "unixctl-py.at:48" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 bond/hash mac -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:48" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:50: ovs-appctl --timeout 20 bond/hash mac vlan" -at_fn_check_prepare_trace "unixctl-py.at:50" -( $at_check_trace; ovs-appctl --timeout 20 bond/hash mac vlan -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:51: head -1 stderr" -at_fn_check_prepare_trace "unixctl-py.at:51" -( $at_check_trace; head -1 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "invalid vlan -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:51" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:55: \$PYTHON \$srcdir/appctl.py --timeout 20 bond/hash mac vlan" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 bond/hash mac vlan" "unixctl-py.at:55" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 bond/hash mac vlan -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:55" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:57: ovs-appctl --timeout 20 bond/hash mac vlan basis" -at_fn_check_prepare_trace "unixctl-py.at:57" -( $at_check_trace; ovs-appctl --timeout 20 bond/hash mac vlan basis -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:57" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:58: head -1 stderr" -at_fn_check_prepare_trace "unixctl-py.at:58" -( $at_check_trace; head -1 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "invalid vlan -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:58" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:62: \$PYTHON \$srcdir/appctl.py --timeout 20 bond/hash vlan basis" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 bond/hash vlan basis" "unixctl-py.at:62" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 bond/hash vlan basis -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:62" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:64: ovs-appctl --timeout 20 bond/hash mac vlan basis extra" -at_fn_check_prepare_trace "unixctl-py.at:64" -( $at_check_trace; ovs-appctl --timeout 20 bond/hash mac vlan basis extra -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:64" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:65: head -1 stderr" -at_fn_check_prepare_trace "unixctl-py.at:65" -( $at_check_trace; head -1 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"bond/hash\" command takes at most 3 arguments -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:65" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:69: \$PYTHON \$srcdir/appctl.py --timeout 20 bond/hash mac vlan basis extra" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 bond/hash mac vlan basis extra" "unixctl-py.at:69" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 bond/hash mac vlan basis extra -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:69" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:71: check_logs " -at_fn_check_prepare_trace "unixctl-py.at:71" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:71" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:71: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "unixctl-py.at:71" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:71" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/unixctl-py.at:71: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "unixctl-py.at:71" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:71" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_424 -#AT_START_425 -at_fn_group_banner 425 'unixctl-py.at:74' \ - "unixctl bad target - Python" " " 28 -at_xfail=no -( - $as_echo "425. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -$as_echo "unixctl-py.at:77" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/unixctl-py.at:77" - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:79: \$PYTHON \$srcdir/appctl.py --timeout 20 -t bogus doit" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t bogus doit" "unixctl-py.at:79" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t bogus doit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/unixctl-py.at:79" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:80: tail -1 stderr" -at_fn_check_prepare_trace "unixctl-py.at:80" -( $at_check_trace; tail -1 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "appctl.py: cannot read pidfile \"`pwd`/bogus.pid\" (No such file or directory) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:84: \$PYTHON \$srcdir/appctl.py --timeout 20 -t /bogus/path.pid doit" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t /bogus/path.pid doit" "unixctl-py.at:84" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t /bogus/path.pid doit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/unixctl-py.at:84" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:85: tail -1 stderr" -at_fn_check_prepare_trace "unixctl-py.at:85" -( $at_check_trace; tail -1 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "appctl.py: cannot connect to \"/bogus/path.pid\" (No such file or directory) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:85" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_425 -#AT_START_426 -at_fn_group_banner 426 'unixctl-py.at:91' \ - "unixctl server - Python" " " 28 -at_xfail=no -( - $as_echo "426. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "unixctl-py.at:92" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/unixctl-py.at:92" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-unixctl.py.pid` -EOF - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:99: \$PYTHON \$srcdir/test-unixctl.py --log-file --pidfile --detach" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-unixctl.py --log-file --pidfile --detach" "unixctl-py.at:99" -( $at_check_trace; $PYTHON $srcdir/test-unixctl.py --log-file --pidfile --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:99" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:101: ovs-appctl --timeout 20 -t test-unixctl.py help" -at_fn_check_prepare_trace "unixctl-py.at:101" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py help -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:101" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:102: cat stdout" -at_fn_check_prepare_trace "unixctl-py.at:102" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "The available commands are: - block - echo [arg ...] - echo_error [arg ...] - exit - help - log [arg ...] - version - vlog/list - vlog/reopen - vlog/set spec -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:102" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:116: \$PYTHON \$srcdir/appctl.py --timeout 20 -t test-unixctl.py help" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py help" "unixctl-py.at:116" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py help -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:116" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:118: ovs-vsctl --version | sed 's/ovs-vsctl/test-unixctl.py/' | head -1 > expout" -at_fn_check_prepare_notrace 'a shell pipeline' "unixctl-py.at:118" -( $at_check_trace; ovs-vsctl --version | sed 's/ovs-vsctl/test-unixctl.py/' | head -1 > expout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:118" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:119: ovs-appctl --timeout 20 -t test-unixctl.py version" -at_fn_check_prepare_trace "unixctl-py.at:119" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py version -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:119" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:120: \$PYTHON \$srcdir/appctl.py --timeout 20 -t test-unixctl.py version" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py version" "unixctl-py.at:120" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py version -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:120" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:122: ovs-appctl --timeout 20 -t test-unixctl.py echo robot ninja" -at_fn_check_prepare_trace "unixctl-py.at:122" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py echo robot ninja -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:122" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:123: cat stdout" -at_fn_check_prepare_trace "unixctl-py.at:123" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[u'robot', u'ninja'] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:123" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:127: \$PYTHON \$srcdir/appctl.py --timeout 20 -t test-unixctl.py echo robot ninja" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo robot ninja" "unixctl-py.at:127" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo robot ninja -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:127" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:129: ovs-appctl --timeout 20 -t test-unixctl.py echo_error robot ninja" -at_fn_check_prepare_trace "unixctl-py.at:129" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py echo_error robot ninja -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:129" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:130: cat stderr" -at_fn_check_prepare_trace "unixctl-py.at:130" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[u'robot', u'ninja'] -ovs-appctl: test-unixctl.py: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:130" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:135: \$PYTHON \$srcdir/appctl.py --timeout 20 -t test-unixctl.py echo_error robot ninja" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo_error robot ninja" "unixctl-py.at:135" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo_error robot ninja -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:135" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:137: ovs-appctl --timeout 20 -t test-unixctl.py echo" -at_fn_check_prepare_trace "unixctl-py.at:137" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py echo -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:137" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:138: cat stderr" -at_fn_check_prepare_trace "unixctl-py.at:138" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"echo\" command requires at least 1 arguments -ovs-appctl: test-unixctl.py: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:138" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:143: \$PYTHON \$srcdir/appctl.py --timeout 20 -t test-unixctl.py echo" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo" "unixctl-py.at:143" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:143" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:145: ovs-appctl --timeout 20 -t test-unixctl.py echo robot ninja pirates" -at_fn_check_prepare_trace "unixctl-py.at:145" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py echo robot ninja pirates -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:145" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:146: cat stderr" -at_fn_check_prepare_trace "unixctl-py.at:146" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"echo\" command takes at most 2 arguments -ovs-appctl: test-unixctl.py: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:146" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:151: \$PYTHON \$srcdir/appctl.py --timeout 20 -t test-unixctl.py echo robot ninja pirates" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo robot ninja pirates" "unixctl-py.at:151" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py echo robot ninja pirates -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:151" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:153: ovs-appctl --timeout 20 -t test-unixctl.py bogus" -at_fn_check_prepare_trace "unixctl-py.at:153" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py bogus -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:153" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:154: cat stderr" -at_fn_check_prepare_trace "unixctl-py.at:154" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"bogus\" is not a valid command -ovs-appctl: test-unixctl.py: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:154" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - -sed 's/ovs-appctl/appctl.py/' stderr > experr -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:159: \$PYTHON \$srcdir/appctl.py --timeout 20 -t test-unixctl.py bogus" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py bogus" "unixctl-py.at:159" -( $at_check_trace; $PYTHON $srcdir/appctl.py --timeout 20 -t test-unixctl.py bogus -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/unixctl-py.at:159" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:161: ovs-appctl --timeout 20 -t test-unixctl.py exit" -at_fn_check_prepare_trace "unixctl-py.at:161" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/unixctl-py.at:161" -$at_failed && at_fn_log_failure \ -"`pwd`/test-unixctl.py.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_426 -#AT_START_427 -at_fn_group_banner 427 'unixctl-py.at:165' \ - "unixctl server errors - Python" " " 28 -at_xfail=no -( - $as_echo "427. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "unixctl-py.at:166" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/unixctl-py.at:166" -{ set +x -$as_echo "$at_srcdir/unixctl-py.at:167: \$PYTHON \$srcdir/test-unixctl.py --unixctl \"\`pwd\`\"/bogus/path" -at_fn_check_prepare_notrace 'a `...` command substitution' "unixctl-py.at:167" -( $at_check_trace; $PYTHON $srcdir/test-unixctl.py --unixctl "`pwd`"/bogus/path -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/unixctl-py.at:167" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_427 -#AT_START_428 -at_fn_group_banner 428 'uuid.at:15' \ - "UUID generation, parsing, serialization" " " 29 -at_xfail=no -( - $as_echo "428. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/uuid.at:17: - uuids= - for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ; do - # Generate random UUID and check that it is in the expected format. - uuid=\`ovstest test-uuid\` - if expr \"\$uuid\" : '[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-4[0-9a-f]\\{3\\}-[89ab][0-9a-f]\\{3\\}-[0-9a-f]\\{12\\}\$' > /dev/null - then - : - else - echo \"\$uuid: not a random UUID\" - exit 1 - fi - - # Verify that \$uuid does not duplicate any UUID generated so far. - case \$uuids in - *\$uuid*) - echo \"\$uuid: generated duplicate UUID\" - exit 1 - esac - uuids=\"\$uuids \$uuid\" - - # Verify that test-uuid parses and re-serializes this UUID correctly. - serialized=\`ovstest test-uuid \$uuid\` - if test \"\$uuid\" != \"\$serialized\"; then - echo \"\$uuid: test-uuid serialized this as \$serialized\" - exit 1 - fi - done" -at_fn_check_prepare_notrace 'a `...` command substitution' "uuid.at:17" -( $at_check_trace; - uuids= - for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ; do - # Generate random UUID and check that it is in the expected format. - uuid=`ovstest test-uuid` - if expr "$uuid" : '[0-9a-f]\{8\}-[0-9a-f]\{4\}-4[0-9a-f]\{3\}-[89ab][0-9a-f]\{3\}-[0-9a-f]\{12\}$' > /dev/null - then - : - else - echo "$uuid: not a random UUID" - exit 1 - fi - - # Verify that $uuid does not duplicate any UUID generated so far. - case $uuids in - *$uuid*) - echo "$uuid: generated duplicate UUID" - exit 1 - esac - uuids="$uuids $uuid" - - # Verify that test-uuid parses and re-serializes this UUID correctly. - serialized=`ovstest test-uuid $uuid` - if test "$uuid" != "$serialized"; then - echo "$uuid: test-uuid serialized this as $serialized" - exit 1 - fi - done -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/uuid.at:17" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_428 -#AT_START_429 -at_fn_group_banner 429 'json.at:65' \ - "empty array - C" " " 30 -at_xfail=no -( - $as_echo "429. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:65: printf %s \" [ ] \" > input" -at_fn_check_prepare_trace "json.at:65" -( $at_check_trace; printf %s " [ ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:65: ovstest test-json input" -at_fn_check_prepare_trace "json.at:65" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:65" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:65: cat stdout" -at_fn_check_prepare_trace "json.at:65" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:65" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_429 -#AT_START_430 -at_fn_group_banner 430 'json.at:65' \ - "empty array - Python" " " 30 -at_xfail=no -( - $as_echo "430. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:65" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:65" - { set +x -$as_echo "$at_srcdir/json.at:65: printf %s \" [ ] \" > input" -at_fn_check_prepare_trace "json.at:65" -( $at_check_trace; printf %s " [ ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:65: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:65" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:65" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:65: cat stdout" -at_fn_check_prepare_trace "json.at:65" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:65" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_430 -#AT_START_431 -at_fn_group_banner 431 'json.at:66' \ - "single-element array - C" " " 30 -at_xfail=no -( - $as_echo "431. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:66: printf %s \" [ 1 ] \" > input" -at_fn_check_prepare_trace "json.at:66" -( $at_check_trace; printf %s " [ 1 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:66: ovstest test-json input" -at_fn_check_prepare_trace "json.at:66" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:66" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:66: cat stdout" -at_fn_check_prepare_trace "json.at:66" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:66" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_431 -#AT_START_432 -at_fn_group_banner 432 'json.at:66' \ - "single-element array - Python" " " 30 -at_xfail=no -( - $as_echo "432. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:66" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:66" - { set +x -$as_echo "$at_srcdir/json.at:66: printf %s \" [ 1 ] \" > input" -at_fn_check_prepare_trace "json.at:66" -( $at_check_trace; printf %s " [ 1 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:66: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:66" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:66" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:66: cat stdout" -at_fn_check_prepare_trace "json.at:66" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:66" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_432 -#AT_START_433 -at_fn_group_banner 433 'json.at:67' \ - "2-element array - C" " " 30 -at_xfail=no -( - $as_echo "433. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:67: printf %s \" [ 1, 2 ] \" > input" -at_fn_check_prepare_trace "json.at:67" -( $at_check_trace; printf %s " [ 1, 2 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:67" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:67: ovstest test-json input" -at_fn_check_prepare_trace "json.at:67" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:67" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:67: cat stdout" -at_fn_check_prepare_trace "json.at:67" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1,2] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:67" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_433 -#AT_START_434 -at_fn_group_banner 434 'json.at:67' \ - "2-element array - Python" " " 30 -at_xfail=no -( - $as_echo "434. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:67" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:67" - { set +x -$as_echo "$at_srcdir/json.at:67: printf %s \" [ 1, 2 ] \" > input" -at_fn_check_prepare_trace "json.at:67" -( $at_check_trace; printf %s " [ 1, 2 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:67" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:67: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:67" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:67" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:67: cat stdout" -at_fn_check_prepare_trace "json.at:67" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1,2] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:67" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_434 -#AT_START_435 -at_fn_group_banner 435 'json.at:68' \ - "many-element array - C" " " 30 -at_xfail=no -( - $as_echo "435. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:68: printf %s \" [ 1, 2, 3, 4, 5 ] \" > input" -at_fn_check_prepare_trace "json.at:68" -( $at_check_trace; printf %s " [ 1, 2, 3, 4, 5 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:68" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:68: ovstest test-json input" -at_fn_check_prepare_trace "json.at:68" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:68" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:68: cat stdout" -at_fn_check_prepare_trace "json.at:68" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1,2,3,4,5] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:68" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_435 -#AT_START_436 -at_fn_group_banner 436 'json.at:68' \ - "many-element array - Python" " " 30 -at_xfail=no -( - $as_echo "436. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:68" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:68" - { set +x -$as_echo "$at_srcdir/json.at:68: printf %s \" [ 1, 2, 3, 4, 5 ] \" > input" -at_fn_check_prepare_trace "json.at:68" -( $at_check_trace; printf %s " [ 1, 2, 3, 4, 5 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:68" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:68: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:68" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:68" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:68: cat stdout" -at_fn_check_prepare_trace "json.at:68" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1,2,3,4,5] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:68" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_436 -#AT_START_437 -at_fn_group_banner 437 'json.at:71' \ - "missing comma - C" " " 30 -at_xfail=no -( - $as_echo "437. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:71: printf %s \" [ 1, 2, 3 4, 5 ] \" > input" -at_fn_check_prepare_trace "json.at:71" -( $at_check_trace; printf %s " [ 1, 2, 3 4, 5 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:71: ovstest test-json input" -at_fn_check_prepare_trace "json.at:71" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:71" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:71: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:71" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting ']' or ',' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:71" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_437 -#AT_START_438 -at_fn_group_banner 438 'json.at:71' \ - "missing comma - Python" " " 30 -at_xfail=no -( - $as_echo "438. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:71" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:71" - { set +x -$as_echo "$at_srcdir/json.at:71: printf %s \" [ 1, 2, 3 4, 5 ] \" > input" -at_fn_check_prepare_trace "json.at:71" -( $at_check_trace; printf %s " [ 1, 2, 3 4, 5 ] " > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:71: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:71" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:71" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:71: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:71" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting ']' or ',' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:71" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_438 -#AT_START_439 -at_fn_group_banner 439 'json.at:73' \ - "trailing comma not allowed - C" " " 30 -at_xfail=no -( - $as_echo "439. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:73: printf %s \"[1,2,]\" > input" -at_fn_check_prepare_trace "json.at:73" -( $at_check_trace; printf %s "[1,2,]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:73: ovstest test-json input" -at_fn_check_prepare_trace "json.at:73" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:73" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:73: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:73" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting value -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:73" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_439 -#AT_START_440 -at_fn_group_banner 440 'json.at:73' \ - "trailing comma not allowed - Python" " " 30 -at_xfail=no -( - $as_echo "440. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:73" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:73" - { set +x -$as_echo "$at_srcdir/json.at:73: printf %s \"[1,2,]\" > input" -at_fn_check_prepare_trace "json.at:73" -( $at_check_trace; printf %s "[1,2,]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:73: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:73" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:73" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:73: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:73" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting value -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:73" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_440 -#AT_START_441 -at_fn_group_banner 441 'json.at:75' \ - "doubled comma not allowed - C" " " 30 -at_xfail=no -( - $as_echo "441. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:75: printf %s \"[1,,2]\" > input" -at_fn_check_prepare_trace "json.at:75" -( $at_check_trace; printf %s "[1,,2]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:75: ovstest test-json input" -at_fn_check_prepare_trace "json.at:75" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:75" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:75: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:75" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting value -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:75" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_441 -#AT_START_442 -at_fn_group_banner 442 'json.at:75' \ - "doubled comma not allowed - Python" " " 30 -at_xfail=no -( - $as_echo "442. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:75" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:75" - { set +x -$as_echo "$at_srcdir/json.at:75: printf %s \"[1,,2]\" > input" -at_fn_check_prepare_trace "json.at:75" -( $at_check_trace; printf %s "[1,,2]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:75: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:75" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:75" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:75: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:75" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting value -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:75" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_442 -#AT_START_443 -at_fn_group_banner 443 'json.at:80' \ - "empty string - C" " " 31 -at_xfail=no -( - $as_echo "443. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:80: printf %s \"[ \\\"\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:80" -( $at_check_trace; printf %s "[ \"\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:80: ovstest test-json input" -at_fn_check_prepare_trace "json.at:80" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:80" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:80: cat stdout" -at_fn_check_prepare_trace "json.at:80" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:80" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_443 -#AT_START_444 -at_fn_group_banner 444 'json.at:80' \ - "empty string - Python" " " 31 -at_xfail=no -( - $as_echo "444. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:80" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:80" - { set +x -$as_echo "$at_srcdir/json.at:80: printf %s \"[ \\\"\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:80" -( $at_check_trace; printf %s "[ \"\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:80: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:80" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:80" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:80: cat stdout" -at_fn_check_prepare_trace "json.at:80" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:80" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_444 -#AT_START_445 -at_fn_group_banner 445 'json.at:81' \ - "1-character strings - C" " " 31 -at_xfail=no -( - $as_echo "445. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:81: printf %s \"[ \\\"a\\\", \\\"b\\\", \\\"c\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:81" -( $at_check_trace; printf %s "[ \"a\", \"b\", \"c\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:81" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:81: ovstest test-json input" -at_fn_check_prepare_trace "json.at:81" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:81" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:81: cat stdout" -at_fn_check_prepare_trace "json.at:81" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"a\",\"b\",\"c\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:81" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_445 -#AT_START_446 -at_fn_group_banner 446 'json.at:81' \ - "1-character strings - Python" " " 31 -at_xfail=no -( - $as_echo "446. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:81" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:81" - { set +x -$as_echo "$at_srcdir/json.at:81: printf %s \"[ \\\"a\\\", \\\"b\\\", \\\"c\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:81" -( $at_check_trace; printf %s "[ \"a\", \"b\", \"c\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:81" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:81: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:81" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:81" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:81: cat stdout" -at_fn_check_prepare_trace "json.at:81" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"a\",\"b\",\"c\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:81" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_446 -#AT_START_447 -at_fn_group_banner 447 'json.at:84' \ - "escape sequences - C" " " 31 -at_xfail=no -( - $as_echo "447. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:84: printf %s \"[ \\\" \\\\\\\" \\\\\\\\ \\\\/ \\\\b \\\\f \\\\n \\\\r \\\\t\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:84" -( $at_check_trace; printf %s "[ \" \\\" \\\\ \\/ \\b \\f \\n \\r \\t\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:84" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:84: ovstest test-json input" -at_fn_check_prepare_trace "json.at:84" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:84" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:84: cat stdout" -at_fn_check_prepare_trace "json.at:84" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\" \\\" \\\\ / \\b \\f \\n \\r \\t\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:84" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_447 -#AT_START_448 -at_fn_group_banner 448 'json.at:84' \ - "escape sequences - Python" " " 31 -at_xfail=no -( - $as_echo "448. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:84" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:84" - { set +x -$as_echo "$at_srcdir/json.at:84: printf %s \"[ \\\" \\\\\\\" \\\\\\\\ \\\\/ \\\\b \\\\f \\\\n \\\\r \\\\t\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:84" -( $at_check_trace; printf %s "[ \" \\\" \\\\ \\/ \\b \\f \\n \\r \\t\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:84" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:84: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:84" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:84" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:84: cat stdout" -at_fn_check_prepare_trace "json.at:84" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\" \\\" \\\\ / \\b \\f \\n \\r \\t\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:84" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_448 -#AT_START_449 -at_fn_group_banner 449 'json.at:87' \ - "Unicode escape sequences - C" " " 31 -at_xfail=no -( - $as_echo "449. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:87: printf %s \"[ \\\" \\\\u0022 \\\\u005c \\\\u002F \\\\u0008 \\\\u000c \\\\u000A \\\\u000d \\\\u0009\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:87" -( $at_check_trace; printf %s "[ \" \\u0022 \\u005c \\u002F \\u0008 \\u000c \\u000A \\u000d \\u0009\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:87: ovstest test-json input" -at_fn_check_prepare_trace "json.at:87" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:87" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:87: cat stdout" -at_fn_check_prepare_trace "json.at:87" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\" \\\" \\\\ / \\b \\f \\n \\r \\t\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:87" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_449 -#AT_START_450 -at_fn_group_banner 450 'json.at:87' \ - "Unicode escape sequences - Python" " " 31 -at_xfail=no -( - $as_echo "450. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:87" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:87" - { set +x -$as_echo "$at_srcdir/json.at:87: printf %s \"[ \\\" \\\\u0022 \\\\u005c \\\\u002F \\\\u0008 \\\\u000c \\\\u000A \\\\u000d \\\\u0009\\\" ]\" > input" -at_fn_check_prepare_trace "json.at:87" -( $at_check_trace; printf %s "[ \" \\u0022 \\u005c \\u002F \\u0008 \\u000c \\u000A \\u000d \\u0009\" ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:87: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:87" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:87" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:87: cat stdout" -at_fn_check_prepare_trace "json.at:87" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\" \\\" \\\\ / \\b \\f \\n \\r \\t\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:87" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_450 -#AT_START_451 -at_fn_group_banner 451 'json.at:90' \ - "surrogate pairs - C" " " 31 -at_xfail=no -( - $as_echo "451. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:90: printf %s \"[\\\"\\\\ud834\\\\udd1e\\\"]\" > input" -at_fn_check_prepare_trace "json.at:90" -( $at_check_trace; printf %s "[\"\\ud834\\udd1e\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:90" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:90: ovstest test-json input" -at_fn_check_prepare_trace "json.at:90" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:90" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:90: cat stdout" -at_fn_check_prepare_trace "json.at:90" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"𝄞\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:90" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_451 -#AT_START_452 -at_fn_group_banner 452 'json.at:93' \ - "surrogate pairs - Python" " " 31 -at_xfail=no - $PYTHON -c "exit(len(u'\U00010800'))"; test $? -ne 1 && at_xfail=yes -( - $as_echo "452. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:93" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:93" - - { set +x -$as_echo "$at_srcdir/json.at:93: printf %s \"[\\\"\\\\ud834\\\\udd1e\\\"]\" > input" -at_fn_check_prepare_trace "json.at:93" -( $at_check_trace; printf %s "[\"\\ud834\\udd1e\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:93" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:93: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:93" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:93" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:93: cat stdout" -at_fn_check_prepare_trace "json.at:93" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"𝄞\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:93" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_452 -#AT_START_453 -at_fn_group_banner 453 'json.at:96' \ - "a string by itself is not valid JSON - C" " " 31 -at_xfail=no -( - $as_echo "453. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:96: printf %s \"\\\"xxx\\\"\" > input" -at_fn_check_prepare_trace "json.at:96" -( $at_check_trace; printf %s "\"xxx\"" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:96: ovstest test-json input" -at_fn_check_prepare_trace "json.at:96" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:96" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:96: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:96" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error at beginning of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:96" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_453 -#AT_START_454 -at_fn_group_banner 454 'json.at:96' \ - "a string by itself is not valid JSON - Python" " " 31 -at_xfail=no -( - $as_echo "454. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:96" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:96" - { set +x -$as_echo "$at_srcdir/json.at:96: printf %s \"\\\"xxx\\\"\" > input" -at_fn_check_prepare_trace "json.at:96" -( $at_check_trace; printf %s "\"xxx\"" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:96: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:96" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:96" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:96: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:96" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error at beginning of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:96" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_454 -#AT_START_455 -at_fn_group_banner 455 'json.at:98' \ - "end of line in quoted string - C" " " 31 -at_xfail=no -( - $as_echo "455. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:98: printf %s \"[\\\"xxx -\\\"]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:98" -( $at_check_trace; printf %s "[\"xxx -\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:98" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:98: ovstest test-json input" -at_fn_check_prepare_trace "json.at:98" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:98" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:98: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:98" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: U+000A must be escaped in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:98" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_455 -#AT_START_456 -at_fn_group_banner 456 'json.at:98' \ - "end of line in quoted string - Python" " " 31 -at_xfail=no -( - $as_echo "456. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:98" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:98" - { set +x -$as_echo "$at_srcdir/json.at:98: printf %s \"[\\\"xxx -\\\"]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:98" -( $at_check_trace; printf %s "[\"xxx -\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:98" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:98: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:98" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:98" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:98: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:98" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: U+000A must be escaped in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:98" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_456 -#AT_START_457 -at_fn_group_banner 457 'json.at:102' \ - "formfeed in quoted string - C" " " 31 -at_xfail=no -( - $as_echo "457. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:102: printf %s \"[\\\"xxx \\\"]\" > input" -at_fn_check_prepare_trace "json.at:102" -( $at_check_trace; printf %s "[\"xxx \"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:102: ovstest test-json input" -at_fn_check_prepare_trace "json.at:102" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:102" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:102: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:102" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: U+000C must be escaped in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:102" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_457 -#AT_START_458 -at_fn_group_banner 458 'json.at:102' \ - "formfeed in quoted string - Python" " " 31 -at_xfail=no -( - $as_echo "458. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:102" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:102" - { set +x -$as_echo "$at_srcdir/json.at:102: printf %s \"[\\\"xxx \\\"]\" > input" -at_fn_check_prepare_trace "json.at:102" -( $at_check_trace; printf %s "[\"xxx \"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:102: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:102" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:102" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:102: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:102" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: U+000C must be escaped in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:102" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_458 -#AT_START_459 -at_fn_group_banner 459 'json.at:105' \ - "bad escape in quoted string - C" " " 31 -at_xfail=no -( - $as_echo "459. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:105: printf %s \"[\\\"\\\\x12\\\"]\" > input" -at_fn_check_prepare_trace "json.at:105" -( $at_check_trace; printf %s "[\"\\x12\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:105: ovstest test-json input" -at_fn_check_prepare_trace "json.at:105" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:105" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:105: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:105" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: bad escape \\x -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:105" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_459 -#AT_START_460 -at_fn_group_banner 460 'json.at:105' \ - "bad escape in quoted string - Python" " " 31 -at_xfail=no -( - $as_echo "460. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:105" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:105" - { set +x -$as_echo "$at_srcdir/json.at:105: printf %s \"[\\\"\\\\x12\\\"]\" > input" -at_fn_check_prepare_trace "json.at:105" -( $at_check_trace; printf %s "[\"\\x12\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:105: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:105" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:105" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:105: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:105" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: bad escape \\x -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:105" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_460 -#AT_START_461 -at_fn_group_banner 461 'json.at:108' \ - "\\u must be followed by 4 hex digits (1) - C" " " 31 -at_xfail=no -( - $as_echo "461. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:108: printf %s \"[\\\"\\\\u1x\\\"]\" > input" -at_fn_check_prepare_trace "json.at:108" -( $at_check_trace; printf %s "[\"\\u1x\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:108" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:108: ovstest test-json input" -at_fn_check_prepare_trace "json.at:108" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:108" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:108: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:108" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: quoted string ends within \\u escape -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:108" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_461 -#AT_START_462 -at_fn_group_banner 462 'json.at:108' \ - "\\u must be followed by 4 hex digits (1) - Python" "" 31 -at_xfail=no -( - $as_echo "462. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:108" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:108" - { set +x -$as_echo "$at_srcdir/json.at:108: printf %s \"[\\\"\\\\u1x\\\"]\" > input" -at_fn_check_prepare_trace "json.at:108" -( $at_check_trace; printf %s "[\"\\u1x\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:108" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:108: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:108" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:108" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:108: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:108" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: quoted string ends within \\u escape -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:108" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_462 -#AT_START_463 -at_fn_group_banner 463 'json.at:111' \ - "\\u must be followed by 4 hex digits (2) - C" " " 31 -at_xfail=no -( - $as_echo "463. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:111: printf %s \"[\\\"\\\\u1xyz\\\"]\" > input" -at_fn_check_prepare_trace "json.at:111" -( $at_check_trace; printf %s "[\"\\u1xyz\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:111" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:111: ovstest test-json input" -at_fn_check_prepare_trace "json.at:111" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:111" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:111: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:111" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: malformed \\u escape -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:111" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_463 -#AT_START_464 -at_fn_group_banner 464 'json.at:111' \ - "\\u must be followed by 4 hex digits (2) - Python" "" 31 -at_xfail=no -( - $as_echo "464. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:111" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:111" - { set +x -$as_echo "$at_srcdir/json.at:111: printf %s \"[\\\"\\\\u1xyz\\\"]\" > input" -at_fn_check_prepare_trace "json.at:111" -( $at_check_trace; printf %s "[\"\\u1xyz\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:111" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:111: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:111" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:111" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:111: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:111" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: malformed \\u escape -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:111" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_464 -#AT_START_465 -at_fn_group_banner 465 'json.at:114' \ - "isolated leading surrogate not allowed - C" " " 31 -at_xfail=no -( - $as_echo "465. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:114: printf %s \"[\\\"\\\\ud834xxx\\\"]\" > input" -at_fn_check_prepare_trace "json.at:114" -( $at_check_trace; printf %s "[\"\\ud834xxx\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:114: ovstest test-json input" -at_fn_check_prepare_trace "json.at:114" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:114" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:114: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:114" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: malformed escaped surrogate pair -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:114" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_465 -#AT_START_466 -at_fn_group_banner 466 'json.at:114' \ - "isolated leading surrogate not allowed - Python" "" 31 -at_xfail=no -( - $as_echo "466. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:114" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:114" - { set +x -$as_echo "$at_srcdir/json.at:114: printf %s \"[\\\"\\\\ud834xxx\\\"]\" > input" -at_fn_check_prepare_trace "json.at:114" -( $at_check_trace; printf %s "[\"\\ud834xxx\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:114: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:114" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:114" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:114: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:114" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: malformed escaped surrogate pair -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:114" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_466 -#AT_START_467 -at_fn_group_banner 467 'json.at:117' \ - "surrogatess must paired properly - C" " " 31 -at_xfail=no -( - $as_echo "467. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:117: printf %s \"[\\\"\\\\ud834\\\\u1234\\\"]\" > input" -at_fn_check_prepare_trace "json.at:117" -( $at_check_trace; printf %s "[\"\\ud834\\u1234\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:117" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:117: ovstest test-json input" -at_fn_check_prepare_trace "json.at:117" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:117" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:117: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:117" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: second half of escaped surrogate pair is not trailing surrogate -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:117" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_467 -#AT_START_468 -at_fn_group_banner 468 'json.at:117' \ - "surrogatess must paired properly - Python" " " 31 -at_xfail=no -( - $as_echo "468. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:117" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:117" - { set +x -$as_echo "$at_srcdir/json.at:117: printf %s \"[\\\"\\\\ud834\\\\u1234\\\"]\" > input" -at_fn_check_prepare_trace "json.at:117" -( $at_check_trace; printf %s "[\"\\ud834\\u1234\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:117" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:117: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:117" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:117" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:117: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:117" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: second half of escaped surrogate pair is not trailing surrogate -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:117" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_468 -#AT_START_469 -at_fn_group_banner 469 'json.at:120' \ - "null bytes not allowed - C" " " 31 -at_xfail=no -( - $as_echo "469. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:120: printf %s \"[\\\"\\\\u0000\\\"]\" > input" -at_fn_check_prepare_trace "json.at:120" -( $at_check_trace; printf %s "[\"\\u0000\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:120" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:120: ovstest test-json input" -at_fn_check_prepare_trace "json.at:120" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:120" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:120: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:120" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: null bytes not supported in quoted strings -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:120" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_469 -#AT_START_470 -at_fn_group_banner 470 'json.at:120' \ - "null bytes not allowed - Python" " " 31 -at_xfail=no -( - $as_echo "470. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:120" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:120" - { set +x -$as_echo "$at_srcdir/json.at:120: printf %s \"[\\\"\\\\u0000\\\"]\" > input" -at_fn_check_prepare_trace "json.at:120" -( $at_check_trace; printf %s "[\"\\u0000\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:120" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:120: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:120" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:120" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:120: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:120" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: null bytes not supported in quoted strings -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:120" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_470 -#AT_START_471 -at_fn_group_banner 471 'json.at:124' \ - "properly quoted backslash at end of string - C" " " 31 -at_xfail=no -( - $as_echo "471. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:124: printf %s \"[\\\"\\\\\\\\\\\"]\" > input" -at_fn_check_prepare_trace "json.at:124" -( $at_check_trace; printf %s "[\"\\\\\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:124" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:124: ovstest test-json input" -at_fn_check_prepare_trace "json.at:124" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:124" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:124: cat stdout" -at_fn_check_prepare_trace "json.at:124" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"\\\\\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:124" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_471 -#AT_START_472 -at_fn_group_banner 472 'json.at:124' \ - "properly quoted backslash at end of string - Python" "" 31 -at_xfail=no -( - $as_echo "472. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:124" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:124" - { set +x -$as_echo "$at_srcdir/json.at:124: printf %s \"[\\\"\\\\\\\\\\\"]\" > input" -at_fn_check_prepare_trace "json.at:124" -( $at_check_trace; printf %s "[\"\\\\\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:124" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:124: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:124" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:124" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:124: cat stdout" -at_fn_check_prepare_trace "json.at:124" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"\\\\\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:124" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_472 -#AT_START_473 -at_fn_group_banner 473 'json.at:127' \ - "stray backslash at end of string - C" " " 31 -at_xfail=no -( - $as_echo "473. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:127: printf %s \"[\\\"abcd\\\\\\\"]\" > input" -at_fn_check_prepare_trace "json.at:127" -( $at_check_trace; printf %s "[\"abcd\\\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:127: ovstest test-json input" -at_fn_check_prepare_trace "json.at:127" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:127" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:127: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:127" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: unexpected end of input in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:127" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_473 -#AT_START_474 -at_fn_group_banner 474 'json.at:127' \ - "stray backslash at end of string - Python" " " 31 -at_xfail=no -( - $as_echo "474. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:127" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:127" - { set +x -$as_echo "$at_srcdir/json.at:127: printf %s \"[\\\"abcd\\\\\\\"]\" > input" -at_fn_check_prepare_trace "json.at:127" -( $at_check_trace; printf %s "[\"abcd\\\"]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:127: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:127" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:127" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:127: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:127" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: unexpected end of input in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:127" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_474 -#AT_START_475 -at_fn_group_banner 475 'json.at:131' \ - "end of input in quoted string - C" " " 31 -at_xfail=no -( - $as_echo "475. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/json.at:133: printf '\"xxx' | ovstest test-json -" -at_fn_check_prepare_notrace 'a shell pipeline' "json.at:133" -( $at_check_trace; printf '"xxx' | ovstest test-json - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: line 0, column 4, byte 4: unexpected end of input in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/json.at:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_475 -#AT_START_476 -at_fn_group_banner 476 'json.at:138' \ - "end of input in quoted string - Python" " " 31 -at_xfail=no -( - $as_echo "476. $at_setup_line: testing $at_desc ..." - $at_traceon - - -$as_echo "json.at:140" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:140" -{ set +x -$as_echo "$at_srcdir/json.at:141: printf '\"xxx' > input -\$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:141" -( $at_check_trace; printf '"xxx' > input -$PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: line 0, column 4, byte 4: unexpected end of input in quoted string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/json.at:141" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_476 -#AT_START_477 -at_fn_group_banner 477 'json.at:149' \ - "empty object - C" " " 32 -at_xfail=no -( - $as_echo "477. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:149: printf %s \"{ }\" > input" -at_fn_check_prepare_trace "json.at:149" -( $at_check_trace; printf %s "{ }" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:149" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:149: ovstest test-json input" -at_fn_check_prepare_trace "json.at:149" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:149" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:149: cat stdout" -at_fn_check_prepare_trace "json.at:149" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:149" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_477 -#AT_START_478 -at_fn_group_banner 478 'json.at:149' \ - "empty object - Python" " " 32 -at_xfail=no -( - $as_echo "478. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:149" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:149" - { set +x -$as_echo "$at_srcdir/json.at:149: printf %s \"{ }\" > input" -at_fn_check_prepare_trace "json.at:149" -( $at_check_trace; printf %s "{ }" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:149" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:149: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:149" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:149" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:149: cat stdout" -at_fn_check_prepare_trace "json.at:149" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:149" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_478 -#AT_START_479 -at_fn_group_banner 479 'json.at:150' \ - "simple object - C" " " 32 -at_xfail=no -( - $as_echo "479. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:150: printf %s \"{\\\"b\\\": 2, \\\"a\\\": 1, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:150" -( $at_check_trace; printf %s "{\"b\": 2, \"a\": 1, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:150" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:150: ovstest test-json input" -at_fn_check_prepare_trace "json.at:150" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:150" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:150: cat stdout" -at_fn_check_prepare_trace "json.at:150" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"a\":1,\"b\":2,\"c\":3} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:150" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_479 -#AT_START_480 -at_fn_group_banner 480 'json.at:150' \ - "simple object - Python" " " 32 -at_xfail=no -( - $as_echo "480. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:150" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:150" - { set +x -$as_echo "$at_srcdir/json.at:150: printf %s \"{\\\"b\\\": 2, \\\"a\\\": 1, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:150" -( $at_check_trace; printf %s "{\"b\": 2, \"a\": 1, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:150" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:150: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:150" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:150" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:150: cat stdout" -at_fn_check_prepare_trace "json.at:150" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"a\":1,\"b\":2,\"c\":3} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:150" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_480 -#AT_START_481 -at_fn_group_banner 481 'json.at:153' \ - "bad value - C" " " 32 -at_xfail=no -( - $as_echo "481. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:153: printf %s \"{\\\"a\\\": }, \\\"b\\\": 2\" > input" -at_fn_check_prepare_trace "json.at:153" -( $at_check_trace; printf %s "{\"a\": }, \"b\": 2" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:153" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:153: ovstest test-json input" -at_fn_check_prepare_trace "json.at:153" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:153" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:153: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:153" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting value -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:153" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_481 -#AT_START_482 -at_fn_group_banner 482 'json.at:153' \ - "bad value - Python" " " 32 -at_xfail=no -( - $as_echo "482. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:153" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:153" - { set +x -$as_echo "$at_srcdir/json.at:153: printf %s \"{\\\"a\\\": }, \\\"b\\\": 2\" > input" -at_fn_check_prepare_trace "json.at:153" -( $at_check_trace; printf %s "{\"a\": }, \"b\": 2" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:153" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:153: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:153" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:153" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:153: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:153" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting value -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:153" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_482 -#AT_START_483 -at_fn_group_banner 483 'json.at:155' \ - "missing colon - C" " " 32 -at_xfail=no -( - $as_echo "483. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:155: printf %s \"{\\\"b\\\": 2, \\\"a\\\" 1, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:155" -( $at_check_trace; printf %s "{\"b\": 2, \"a\" 1, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:155" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:155: ovstest test-json input" -at_fn_check_prepare_trace "json.at:155" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:155" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:155: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:155" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting ':' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:155" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_483 -#AT_START_484 -at_fn_group_banner 484 'json.at:155' \ - "missing colon - Python" " " 32 -at_xfail=no -( - $as_echo "484. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:155" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:155" - { set +x -$as_echo "$at_srcdir/json.at:155: printf %s \"{\\\"b\\\": 2, \\\"a\\\" 1, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:155" -( $at_check_trace; printf %s "{\"b\": 2, \"a\" 1, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:155" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:155: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:155" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:155" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:155: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:155" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting ':' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:155" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_484 -#AT_START_485 -at_fn_group_banner 485 'json.at:157' \ - "missing comma - C" " " 32 -at_xfail=no -( - $as_echo "485. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:157: printf %s \"{\\\"b\\\": 2 \\\"a\\\" 1, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:157" -( $at_check_trace; printf %s "{\"b\": 2 \"a\" 1, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:157" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:157: ovstest test-json input" -at_fn_check_prepare_trace "json.at:157" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:157" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:157: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:157" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting '}' or ',' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:157" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_485 -#AT_START_486 -at_fn_group_banner 486 'json.at:157' \ - "missing comma - Python" " " 32 -at_xfail=no -( - $as_echo "486. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:157" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:157" - { set +x -$as_echo "$at_srcdir/json.at:157: printf %s \"{\\\"b\\\": 2 \\\"a\\\" 1, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:157" -( $at_check_trace; printf %s "{\"b\": 2 \"a\" 1, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:157" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:157: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:157" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:157" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:157: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:157" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error expecting '}' or ',' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:157" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_486 -#AT_START_487 -at_fn_group_banner 487 'json.at:159' \ - "trailing comma not allowed - C" " " 32 -at_xfail=no -( - $as_echo "487. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:159: printf %s \"{\\\"b\\\": 2, \\\"a\\\": 1, \\\"c\\\": 3, }\" > input" -at_fn_check_prepare_trace "json.at:159" -( $at_check_trace; printf %s "{\"b\": 2, \"a\": 1, \"c\": 3, }" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:159: ovstest test-json input" -at_fn_check_prepare_trace "json.at:159" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:159" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:159: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:159" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:159" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_487 -#AT_START_488 -at_fn_group_banner 488 'json.at:159' \ - "trailing comma not allowed - Python" " " 32 -at_xfail=no -( - $as_echo "488. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:159" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:159" - { set +x -$as_echo "$at_srcdir/json.at:159: printf %s \"{\\\"b\\\": 2, \\\"a\\\": 1, \\\"c\\\": 3, }\" > input" -at_fn_check_prepare_trace "json.at:159" -( $at_check_trace; printf %s "{\"b\": 2, \"a\": 1, \"c\": 3, }" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:159: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:159" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:159" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:159: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:159" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:159" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_488 -#AT_START_489 -at_fn_group_banner 489 'json.at:162' \ - "doubled comma not allowed - C" " " 32 -at_xfail=no -( - $as_echo "489. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:162: printf %s \"{\\\"b\\\": 2, \\\"a\\\": 1,, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:162" -( $at_check_trace; printf %s "{\"b\": 2, \"a\": 1,, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:162" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:162: ovstest test-json input" -at_fn_check_prepare_trace "json.at:162" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:162" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:162: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:162" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:162" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_489 -#AT_START_490 -at_fn_group_banner 490 'json.at:162' \ - "doubled comma not allowed - Python" " " 32 -at_xfail=no -( - $as_echo "490. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:162" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:162" - { set +x -$as_echo "$at_srcdir/json.at:162: printf %s \"{\\\"b\\\": 2, \\\"a\\\": 1,, \\\"c\\\": 3}\" > input" -at_fn_check_prepare_trace "json.at:162" -( $at_check_trace; printf %s "{\"b\": 2, \"a\": 1,, \"c\": 3}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:162" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:162: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:162" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:162" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:162: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:162" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:162" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_490 -#AT_START_491 -at_fn_group_banner 491 'json.at:165' \ - "names must be strings - C" " " 32 -at_xfail=no -( - $as_echo "491. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:165: printf %s \"{1: 2}\" > input" -at_fn_check_prepare_trace "json.at:165" -( $at_check_trace; printf %s "{1: 2}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:165: ovstest test-json input" -at_fn_check_prepare_trace "json.at:165" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:165" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:165: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:165" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:165" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_491 -#AT_START_492 -at_fn_group_banner 492 'json.at:165' \ - "names must be strings - Python" " " 32 -at_xfail=no -( - $as_echo "492. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:165" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:165" - { set +x -$as_echo "$at_srcdir/json.at:165: printf %s \"{1: 2}\" > input" -at_fn_check_prepare_trace "json.at:165" -( $at_check_trace; printf %s "{1: 2}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:165: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:165" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:165" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:165: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:165" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error parsing object expecting string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:165" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_492 -#AT_START_493 -at_fn_group_banner 493 'json.at:171' \ - "null - C" " " 33 -at_xfail=no -( - $as_echo "493. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:171: printf %s \"[ null ]\" > input" -at_fn_check_prepare_trace "json.at:171" -( $at_check_trace; printf %s "[ null ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:171" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:171: ovstest test-json input" -at_fn_check_prepare_trace "json.at:171" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:171" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:171: cat stdout" -at_fn_check_prepare_trace "json.at:171" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[null] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:171" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_493 -#AT_START_494 -at_fn_group_banner 494 'json.at:171' \ - "null - Python" " " 33 -at_xfail=no -( - $as_echo "494. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:171" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:171" - { set +x -$as_echo "$at_srcdir/json.at:171: printf %s \"[ null ]\" > input" -at_fn_check_prepare_trace "json.at:171" -( $at_check_trace; printf %s "[ null ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:171" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:171: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:171" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:171" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:171: cat stdout" -at_fn_check_prepare_trace "json.at:171" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[null] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:171" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_494 -#AT_START_495 -at_fn_group_banner 495 'json.at:172' \ - "false - C" " " 33 -at_xfail=no -( - $as_echo "495. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:172: printf %s \"[ false ]\" > input" -at_fn_check_prepare_trace "json.at:172" -( $at_check_trace; printf %s "[ false ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:172" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:172: ovstest test-json input" -at_fn_check_prepare_trace "json.at:172" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:172" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:172: cat stdout" -at_fn_check_prepare_trace "json.at:172" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[false] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:172" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_495 -#AT_START_496 -at_fn_group_banner 496 'json.at:172' \ - "false - Python" " " 33 -at_xfail=no -( - $as_echo "496. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:172" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:172" - { set +x -$as_echo "$at_srcdir/json.at:172: printf %s \"[ false ]\" > input" -at_fn_check_prepare_trace "json.at:172" -( $at_check_trace; printf %s "[ false ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:172" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:172: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:172" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:172" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:172: cat stdout" -at_fn_check_prepare_trace "json.at:172" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[false] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:172" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_496 -#AT_START_497 -at_fn_group_banner 497 'json.at:173' \ - "true - C" " " 33 -at_xfail=no -( - $as_echo "497. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:173: printf %s \"[ true ]\" > input" -at_fn_check_prepare_trace "json.at:173" -( $at_check_trace; printf %s "[ true ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:173" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:173: ovstest test-json input" -at_fn_check_prepare_trace "json.at:173" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:173" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:173: cat stdout" -at_fn_check_prepare_trace "json.at:173" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[true] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:173" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_497 -#AT_START_498 -at_fn_group_banner 498 'json.at:173' \ - "true - Python" " " 33 -at_xfail=no -( - $as_echo "498. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:173" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:173" - { set +x -$as_echo "$at_srcdir/json.at:173: printf %s \"[ true ]\" > input" -at_fn_check_prepare_trace "json.at:173" -( $at_check_trace; printf %s "[ true ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:173" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:173: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:173" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:173" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:173: cat stdout" -at_fn_check_prepare_trace "json.at:173" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[true] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:173" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_498 -#AT_START_499 -at_fn_group_banner 499 'json.at:174' \ - "a literal by itself is not valid JSON - C" " " 33 -at_xfail=no -( - $as_echo "499. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:174: printf %s \"null\" > input" -at_fn_check_prepare_trace "json.at:174" -( $at_check_trace; printf %s "null" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:174" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:174: ovstest test-json input" -at_fn_check_prepare_trace "json.at:174" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:174" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:174: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:174" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error at beginning of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:174" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_499 -#AT_START_500 -at_fn_group_banner 500 'json.at:174' \ - "a literal by itself is not valid JSON - Python" " " 33 -at_xfail=no -( - $as_echo "500. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:174" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:174" - { set +x -$as_echo "$at_srcdir/json.at:174: printf %s \"null\" > input" -at_fn_check_prepare_trace "json.at:174" -( $at_check_trace; printf %s "null" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:174" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:174: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:174" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:174" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:174: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:174" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error at beginning of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:174" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_500 -#AT_START_501 -at_fn_group_banner 501 'json.at:176' \ - "nullify is invalid - C" " " 33 -at_xfail=no -( - $as_echo "501. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:176: printf %s \"[ nullify ]\" > input" -at_fn_check_prepare_trace "json.at:176" -( $at_check_trace; printf %s "[ nullify ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:176" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:176: ovstest test-json input" -at_fn_check_prepare_trace "json.at:176" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:176" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:176: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:176" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid keyword 'nullify' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:176" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_501 -#AT_START_502 -at_fn_group_banner 502 'json.at:176' \ - "nullify is invalid - Python" " " 33 -at_xfail=no -( - $as_echo "502. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:176" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:176" - { set +x -$as_echo "$at_srcdir/json.at:176: printf %s \"[ nullify ]\" > input" -at_fn_check_prepare_trace "json.at:176" -( $at_check_trace; printf %s "[ nullify ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:176" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:176: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:176" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:176" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:176: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:176" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid keyword 'nullify' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:176" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_502 -#AT_START_503 -at_fn_group_banner 503 'json.at:178' \ - "nubs is invalid - C" " " 33 -at_xfail=no -( - $as_echo "503. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:178: printf %s \"[ nubs ]\" > input" -at_fn_check_prepare_trace "json.at:178" -( $at_check_trace; printf %s "[ nubs ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:178" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:178: ovstest test-json input" -at_fn_check_prepare_trace "json.at:178" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:178" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:178: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:178" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid keyword 'nubs' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:178" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_503 -#AT_START_504 -at_fn_group_banner 504 'json.at:178' \ - "nubs is invalid - Python" " " 33 -at_xfail=no -( - $as_echo "504. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:178" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:178" - { set +x -$as_echo "$at_srcdir/json.at:178: printf %s \"[ nubs ]\" > input" -at_fn_check_prepare_trace "json.at:178" -( $at_check_trace; printf %s "[ nubs ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:178" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:178: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:178" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:178" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:178: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:178" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid keyword 'nubs' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:178" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_504 -#AT_START_505 -at_fn_group_banner 505 'json.at:180' \ - "xxx is invalid - C" " " 33 -at_xfail=no -( - $as_echo "505. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:180: printf %s \"[ xxx ]\" > input" -at_fn_check_prepare_trace "json.at:180" -( $at_check_trace; printf %s "[ xxx ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:180" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:180: ovstest test-json input" -at_fn_check_prepare_trace "json.at:180" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:180" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:180: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:180" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid keyword 'xxx' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:180" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_505 -#AT_START_506 -at_fn_group_banner 506 'json.at:180' \ - "xxx is invalid - Python" " " 33 -at_xfail=no -( - $as_echo "506. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:180" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:180" - { set +x -$as_echo "$at_srcdir/json.at:180: printf %s \"[ xxx ]\" > input" -at_fn_check_prepare_trace "json.at:180" -( $at_check_trace; printf %s "[ xxx ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:180" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:180: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:180" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:180" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:180: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:180" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid keyword 'xxx' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:180" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_506 -#AT_START_507 -at_fn_group_banner 507 'json.at:185' \ - "integers expressed as reals - C" " " 34 -at_xfail=no -( - $as_echo "507. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:185: printf %s \"[1.0000000000, - 2.00000000000000000000000000000000000, - 2e5, - 2.1234e4, - 2.1230e3, - 0e-10000, - 0e10000]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:185" -( $at_check_trace; printf %s "[1.0000000000, - 2.00000000000000000000000000000000000, - 2e5, - 2.1234e4, - 2.1230e3, - 0e-10000, - 0e10000]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:185: ovstest test-json input" -at_fn_check_prepare_trace "json.at:185" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:185" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:185: cat stdout" -at_fn_check_prepare_trace "json.at:185" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1,2,200000,21234,2123,0,0] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:185" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_507 -#AT_START_508 -at_fn_group_banner 508 'json.at:185' \ - "integers expressed as reals - Python" " " 34 -at_xfail=no -( - $as_echo "508. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:185" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:185" - { set +x -$as_echo "$at_srcdir/json.at:185: printf %s \"[1.0000000000, - 2.00000000000000000000000000000000000, - 2e5, - 2.1234e4, - 2.1230e3, - 0e-10000, - 0e10000]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:185" -( $at_check_trace; printf %s "[1.0000000000, - 2.00000000000000000000000000000000000, - 2e5, - 2.1234e4, - 2.1230e3, - 0e-10000, - 0e10000]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:185: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:185" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:185" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:185: cat stdout" -at_fn_check_prepare_trace "json.at:185" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1,2,200000,21234,2123,0,0] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:185" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_508 -#AT_START_509 -at_fn_group_banner 509 'json.at:195' \ - "large integers - C" " " 34 -at_xfail=no -( - $as_echo "509. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:195: printf %s \"[9223372036854775807, -9223372036854775808]\" > input" -at_fn_check_prepare_trace "json.at:195" -( $at_check_trace; printf %s "[9223372036854775807, -9223372036854775808]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:195" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:195: ovstest test-json input" -at_fn_check_prepare_trace "json.at:195" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:195" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:195: cat stdout" -at_fn_check_prepare_trace "json.at:195" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[9223372036854775807,-9223372036854775808] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:195" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_509 -#AT_START_510 -at_fn_group_banner 510 'json.at:195' \ - "large integers - Python" " " 34 -at_xfail=no -( - $as_echo "510. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:195" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:195" - { set +x -$as_echo "$at_srcdir/json.at:195: printf %s \"[9223372036854775807, -9223372036854775808]\" > input" -at_fn_check_prepare_trace "json.at:195" -( $at_check_trace; printf %s "[9223372036854775807, -9223372036854775808]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:195" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:195: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:195" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:195" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:195: cat stdout" -at_fn_check_prepare_trace "json.at:195" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[9223372036854775807,-9223372036854775808] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:195" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_510 -#AT_START_511 -at_fn_group_banner 511 'json.at:199' \ - "large integers expressed as reals - C" " " 34 -at_xfail=no -( - $as_echo "511. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:199: printf %s \"[9223372036854775807.0, -9223372036854775808.0, - 92233720.36854775807e11, -9.223372036854775808e18]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:199" -( $at_check_trace; printf %s "[9223372036854775807.0, -9223372036854775808.0, - 92233720.36854775807e11, -9.223372036854775808e18]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:199" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:199: ovstest test-json input" -at_fn_check_prepare_trace "json.at:199" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:199" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:199: cat stdout" -at_fn_check_prepare_trace "json.at:199" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[9223372036854775807,-9223372036854775808,9223372036854775807,-9223372036854775808] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:199" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_511 -#AT_START_512 -at_fn_group_banner 512 'json.at:199' \ - "large integers expressed as reals - Python" " " 34 -at_xfail=no -( - $as_echo "512. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:199" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:199" - { set +x -$as_echo "$at_srcdir/json.at:199: printf %s \"[9223372036854775807.0, -9223372036854775808.0, - 92233720.36854775807e11, -9.223372036854775808e18]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:199" -( $at_check_trace; printf %s "[9223372036854775807.0, -9223372036854775808.0, - 92233720.36854775807e11, -9.223372036854775808e18]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:199" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:199: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:199" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:199" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:199: cat stdout" -at_fn_check_prepare_trace "json.at:199" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[9223372036854775807,-9223372036854775808,9223372036854775807,-9223372036854775808] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:199" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_512 -#AT_START_513 -at_fn_group_banner 513 'json.at:207' \ - "large integers that overflow to reals - C" " " 34 -at_xfail=no -( - $as_echo "513. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:207: printf %s \"[9223372036854775807000, -92233720368547758080000]\" > input" -at_fn_check_prepare_trace "json.at:207" -( $at_check_trace; printf %s "[9223372036854775807000, -92233720368547758080000]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:207" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:207: ovstest test-json input" -at_fn_check_prepare_trace "json.at:207" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:207" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:207: cat stdout" -at_fn_check_prepare_trace "json.at:207" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[9.22337203685478e+21,-9.22337203685478e+22] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:207" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_513 -#AT_START_514 -at_fn_group_banner 514 'json.at:207' \ - "large integers that overflow to reals - Python" " " 34 -at_xfail=no -( - $as_echo "514. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:207" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:207" - { set +x -$as_echo "$at_srcdir/json.at:207: printf %s \"[9223372036854775807000, -92233720368547758080000]\" > input" -at_fn_check_prepare_trace "json.at:207" -( $at_check_trace; printf %s "[9223372036854775807000, -92233720368547758080000]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:207" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:207: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:207" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:207" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:207: cat stdout" -at_fn_check_prepare_trace "json.at:207" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[9.22337203685478e+21,-9.22337203685478e+22] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:207" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_514 -#AT_START_515 -at_fn_group_banner 515 'json.at:212' \ - "negative zero - C" " " 34 -at_xfail=no -( - $as_echo "515. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:212: printf %s \"[-0, -0.0, 1e-9999, -1e-9999]\" > input" -at_fn_check_prepare_trace "json.at:212" -( $at_check_trace; printf %s "[-0, -0.0, 1e-9999, -1e-9999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:212" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:212: ovstest test-json input" -at_fn_check_prepare_trace "json.at:212" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:212" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:212: cat stdout" -at_fn_check_prepare_trace "json.at:212" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0,0,0,0] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:212" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_515 -#AT_START_516 -at_fn_group_banner 516 'json.at:212' \ - "negative zero - Python" " " 34 -at_xfail=no -( - $as_echo "516. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:212" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:212" - { set +x -$as_echo "$at_srcdir/json.at:212: printf %s \"[-0, -0.0, 1e-9999, -1e-9999]\" > input" -at_fn_check_prepare_trace "json.at:212" -( $at_check_trace; printf %s "[-0, -0.0, 1e-9999, -1e-9999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:212" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:212: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:212" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:212" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:212: cat stdout" -at_fn_check_prepare_trace "json.at:212" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0,0,0,0] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:212" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_516 -#AT_START_517 -at_fn_group_banner 517 'json.at:217' \ - "reals - C" " " 34 -at_xfail=no -( - $as_echo "517. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:217: printf %s \"[0.0, 1.0, 2.0, 3.0, 3.5, 81.250]\" > input" -at_fn_check_prepare_trace "json.at:217" -( $at_check_trace; printf %s "[0.0, 1.0, 2.0, 3.0, 3.5, 81.250]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:217" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:217: ovstest test-json input" -at_fn_check_prepare_trace "json.at:217" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:217" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:217: cat stdout" -at_fn_check_prepare_trace "json.at:217" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0,1,2,3,3.5,81.25] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:217" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_517 -#AT_START_518 -at_fn_group_banner 518 'json.at:217' \ - "reals - Python" " " 34 -at_xfail=no -( - $as_echo "518. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:217" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:217" - { set +x -$as_echo "$at_srcdir/json.at:217: printf %s \"[0.0, 1.0, 2.0, 3.0, 3.5, 81.250]\" > input" -at_fn_check_prepare_trace "json.at:217" -( $at_check_trace; printf %s "[0.0, 1.0, 2.0, 3.0, 3.5, 81.250]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:217" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:217: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:217" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:217" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:217: cat stdout" -at_fn_check_prepare_trace "json.at:217" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0,1,2,3,3.5,81.25] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:217" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_518 -#AT_START_519 -at_fn_group_banner 519 'json.at:221' \ - "scientific notation - C" " " 34 -at_xfail=no -( - $as_echo "519. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:221: printf %s \"[1e3, 1E3, 2.5E2, 1e+3, 125e-3, 3.125e-2, 3125e-05, 1.525878906e-5]\" > input" -at_fn_check_prepare_trace "json.at:221" -( $at_check_trace; printf %s "[1e3, 1E3, 2.5E2, 1e+3, 125e-3, 3.125e-2, 3125e-05, 1.525878906e-5]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:221: ovstest test-json input" -at_fn_check_prepare_trace "json.at:221" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:221" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:221: cat stdout" -at_fn_check_prepare_trace "json.at:221" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1000,1000,250,1000,0.125,0.03125,0.03125,1.525878906e-05] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:221" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_519 -#AT_START_520 -at_fn_group_banner 520 'json.at:221' \ - "scientific notation - Python" " " 34 -at_xfail=no -( - $as_echo "520. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:221" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:221" - { set +x -$as_echo "$at_srcdir/json.at:221: printf %s \"[1e3, 1E3, 2.5E2, 1e+3, 125e-3, 3.125e-2, 3125e-05, 1.525878906e-5]\" > input" -at_fn_check_prepare_trace "json.at:221" -( $at_check_trace; printf %s "[1e3, 1E3, 2.5E2, 1e+3, 125e-3, 3.125e-2, 3125e-05, 1.525878906e-5]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:221: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:221" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:221" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:221: cat stdout" -at_fn_check_prepare_trace "json.at:221" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1000,1000,250,1000,0.125,0.03125,0.03125,1.525878906e-05] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:221" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_520 -#AT_START_521 -at_fn_group_banner 521 'json.at:228' \ - "+/- DBL_MAX - C" " " 34 -at_xfail=no -( - $as_echo "521. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:228: printf %s \"[1.7976931348623157e+308, -1.7976931348623157e+308]\" > input" -at_fn_check_prepare_trace "json.at:228" -( $at_check_trace; printf %s "[1.7976931348623157e+308, -1.7976931348623157e+308]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:228: ovstest test-json input" -at_fn_check_prepare_trace "json.at:228" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:228" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:228: cat stdout" -at_fn_check_prepare_trace "json.at:228" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1.79769313486232e+308,-1.79769313486232e+308] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:228" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_521 -#AT_START_522 -at_fn_group_banner 522 'json.at:228' \ - "+/- DBL_MAX - Python" " " 34 -at_xfail=no -( - $as_echo "522. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:228" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:228" - { set +x -$as_echo "$at_srcdir/json.at:228: printf %s \"[1.7976931348623157e+308, -1.7976931348623157e+308]\" > input" -at_fn_check_prepare_trace "json.at:228" -( $at_check_trace; printf %s "[1.7976931348623157e+308, -1.7976931348623157e+308]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:228: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:228" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:228" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:228: cat stdout" -at_fn_check_prepare_trace "json.at:228" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[1.79769313486232e+308,-1.79769313486232e+308] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:228" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_522 -#AT_START_523 -at_fn_group_banner 523 'json.at:233' \ - "negative reals - C" " " 34 -at_xfail=no -( - $as_echo "523. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:233: printf %s \"[-0, -1.0, -2.0, -3.0, -3.5, -8.1250]\" > input" -at_fn_check_prepare_trace "json.at:233" -( $at_check_trace; printf %s "[-0, -1.0, -2.0, -3.0, -3.5, -8.1250]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:233" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:233: ovstest test-json input" -at_fn_check_prepare_trace "json.at:233" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:233" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:233: cat stdout" -at_fn_check_prepare_trace "json.at:233" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0,-1,-2,-3,-3.5,-8.125] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:233" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_523 -#AT_START_524 -at_fn_group_banner 524 'json.at:233' \ - "negative reals - Python" " " 34 -at_xfail=no -( - $as_echo "524. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:233" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:233" - { set +x -$as_echo "$at_srcdir/json.at:233: printf %s \"[-0, -1.0, -2.0, -3.0, -3.5, -8.1250]\" > input" -at_fn_check_prepare_trace "json.at:233" -( $at_check_trace; printf %s "[-0, -1.0, -2.0, -3.0, -3.5, -8.1250]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:233" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:233: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:233" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:233" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:233: cat stdout" -at_fn_check_prepare_trace "json.at:233" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0,-1,-2,-3,-3.5,-8.125] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:233" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_524 -#AT_START_525 -at_fn_group_banner 525 'json.at:237' \ - "negative scientific notation - C" " " 34 -at_xfail=no -( - $as_echo "525. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:237: printf %s \"[-1e3, -1E3, -2.5E2, -1e+3, -125e-3, -3.125e-2, -3125e-05, -1.525878906e-5]\" > input" -at_fn_check_prepare_trace "json.at:237" -( $at_check_trace; printf %s "[-1e3, -1E3, -2.5E2, -1e+3, -125e-3, -3.125e-2, -3125e-05, -1.525878906e-5]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:237" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:237: ovstest test-json input" -at_fn_check_prepare_trace "json.at:237" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:237" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:237: cat stdout" -at_fn_check_prepare_trace "json.at:237" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[-1000,-1000,-250,-1000,-0.125,-0.03125,-0.03125,-1.525878906e-05] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:237" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_525 -#AT_START_526 -at_fn_group_banner 526 'json.at:237' \ - "negative scientific notation - Python" " " 34 -at_xfail=no -( - $as_echo "526. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:237" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:237" - { set +x -$as_echo "$at_srcdir/json.at:237: printf %s \"[-1e3, -1E3, -2.5E2, -1e+3, -125e-3, -3.125e-2, -3125e-05, -1.525878906e-5]\" > input" -at_fn_check_prepare_trace "json.at:237" -( $at_check_trace; printf %s "[-1e3, -1E3, -2.5E2, -1e+3, -125e-3, -3.125e-2, -3125e-05, -1.525878906e-5]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:237" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:237: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:237" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:237" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:237: cat stdout" -at_fn_check_prepare_trace "json.at:237" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[-1000,-1000,-250,-1000,-0.125,-0.03125,-0.03125,-1.525878906e-05] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:237" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_526 -#AT_START_527 -at_fn_group_banner 527 'json.at:241' \ - "1e-9999 underflows to 0 - C" " " 34 -at_xfail=no -( - $as_echo "527. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:241: printf %s \"[1e-9999]\" > input" -at_fn_check_prepare_trace "json.at:241" -( $at_check_trace; printf %s "[1e-9999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:241: ovstest test-json input" -at_fn_check_prepare_trace "json.at:241" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:241" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:241: cat stdout" -at_fn_check_prepare_trace "json.at:241" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:241" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_527 -#AT_START_528 -at_fn_group_banner 528 'json.at:241' \ - "1e-9999 underflows to 0 - Python" " " 34 -at_xfail=no -( - $as_echo "528. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:241" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:241" - { set +x -$as_echo "$at_srcdir/json.at:241: printf %s \"[1e-9999]\" > input" -at_fn_check_prepare_trace "json.at:241" -( $at_check_trace; printf %s "[1e-9999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:241: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:241" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:241" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:241: cat stdout" -at_fn_check_prepare_trace "json.at:241" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:241" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_528 -#AT_START_529 -at_fn_group_banner 529 'json.at:245' \ - "a number by itself is not valid JSON - C" " " 34 -at_xfail=no -( - $as_echo "529. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:245: printf %s \"1\" > input" -at_fn_check_prepare_trace "json.at:245" -( $at_check_trace; printf %s "1" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:245" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:245: ovstest test-json input" -at_fn_check_prepare_trace "json.at:245" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:245" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:245: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:245" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error at beginning of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:245" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_529 -#AT_START_530 -at_fn_group_banner 530 'json.at:245' \ - "a number by itself is not valid JSON - Python" " " 34 -at_xfail=no -( - $as_echo "530. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:245" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:245" - { set +x -$as_echo "$at_srcdir/json.at:245: printf %s \"1\" > input" -at_fn_check_prepare_trace "json.at:245" -( $at_check_trace; printf %s "1" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:245" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:245: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:245" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:245" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:245: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:245" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: syntax error at beginning of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:245" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_530 -#AT_START_531 -at_fn_group_banner 531 'json.at:247' \ - "leading zeros not allowed - C" " " 34 -at_xfail=no -( - $as_echo "531. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:247: printf %s \"[0123]\" > input" -at_fn_check_prepare_trace "json.at:247" -( $at_check_trace; printf %s "[0123]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:247" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:247: ovstest test-json input" -at_fn_check_prepare_trace "json.at:247" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:247" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:247: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:247" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: leading zeros not allowed -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:247" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_531 -#AT_START_532 -at_fn_group_banner 532 'json.at:247' \ - "leading zeros not allowed - Python" " " 34 -at_xfail=no -( - $as_echo "532. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:247" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:247" - { set +x -$as_echo "$at_srcdir/json.at:247: printf %s \"[0123]\" > input" -at_fn_check_prepare_trace "json.at:247" -( $at_check_trace; printf %s "[0123]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:247" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:247: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:247" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:247" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:247: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:247" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: leading zeros not allowed -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:247" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_532 -#AT_START_533 -at_fn_group_banner 533 'json.at:251' \ - "1e9999 is too big - C" " " 34 -at_xfail=no -( - $as_echo "533. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:251: printf %s \"[1e9999]\" > input" -at_fn_check_prepare_trace "json.at:251" -( $at_check_trace; printf %s "[1e9999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:251: ovstest test-json input" -at_fn_check_prepare_trace "json.at:251" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:251" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:251: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:251" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: number outside valid range -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:251" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_533 -#AT_START_534 -at_fn_group_banner 534 'json.at:251' \ - "1e9999 is too big - Python" " " 34 -at_xfail=no -( - $as_echo "534. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:251" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:251" - { set +x -$as_echo "$at_srcdir/json.at:251: printf %s \"[1e9999]\" > input" -at_fn_check_prepare_trace "json.at:251" -( $at_check_trace; printf %s "[1e9999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:251: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:251" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:251" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:251: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:251" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: number outside valid range -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:251" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_534 -#AT_START_535 -at_fn_group_banner 535 'json.at:255' \ - "exponent bigger than INT_MAX - C" " " 34 -at_xfail=no -( - $as_echo "535. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:255: printf %s \"[1e9999999999999999999]\" > input" -at_fn_check_prepare_trace "json.at:255" -( $at_check_trace; printf %s "[1e9999999999999999999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:255: ovstest test-json input" -at_fn_check_prepare_trace "json.at:255" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:255" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:255: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:255" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent outside valid range -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:255" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_535 -#AT_START_536 -at_fn_group_banner 536 'json.at:255' \ - "exponent bigger than INT_MAX - Python" " " 34 -at_xfail=no -( - $as_echo "536. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:255" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:255" - { set +x -$as_echo "$at_srcdir/json.at:255: printf %s \"[1e9999999999999999999]\" > input" -at_fn_check_prepare_trace "json.at:255" -( $at_check_trace; printf %s "[1e9999999999999999999]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:255: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:255" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:255" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:255: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:255" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent outside valid range -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:255" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_536 -#AT_START_537 -at_fn_group_banner 537 'json.at:259' \ - "decimal point must be followed by digit - C" " " 34 -at_xfail=no -( - $as_echo "537. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:259: printf %s \"[1.]\" > input" -at_fn_check_prepare_trace "json.at:259" -( $at_check_trace; printf %s "[1.]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:259" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:259: ovstest test-json input" -at_fn_check_prepare_trace "json.at:259" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:259" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:259: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:259" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: decimal point must be followed by digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:259" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_537 -#AT_START_538 -at_fn_group_banner 538 'json.at:259' \ - "decimal point must be followed by digit - Python" "" 34 -at_xfail=no -( - $as_echo "538. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:259" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:259" - { set +x -$as_echo "$at_srcdir/json.at:259: printf %s \"[1.]\" > input" -at_fn_check_prepare_trace "json.at:259" -( $at_check_trace; printf %s "[1.]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:259" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:259: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:259" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:259" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:259: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:259" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: decimal point must be followed by digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:259" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_538 -#AT_START_539 -at_fn_group_banner 539 'json.at:263' \ - "exponent must contain at least one digit (1) - C" "" 34 -at_xfail=no -( - $as_echo "539. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:263: printf %s \"[1e]\" > input" -at_fn_check_prepare_trace "json.at:263" -( $at_check_trace; printf %s "[1e]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:263: ovstest test-json input" -at_fn_check_prepare_trace "json.at:263" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:263" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:263: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:263" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent must contain at least one digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:263" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_539 -#AT_START_540 -at_fn_group_banner 540 'json.at:263' \ - "exponent must contain at least one digit (1) - Python" "" 34 -at_xfail=no -( - $as_echo "540. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:263" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:263" - { set +x -$as_echo "$at_srcdir/json.at:263: printf %s \"[1e]\" > input" -at_fn_check_prepare_trace "json.at:263" -( $at_check_trace; printf %s "[1e]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:263: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:263" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:263" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:263: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:263" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent must contain at least one digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:263" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_540 -#AT_START_541 -at_fn_group_banner 541 'json.at:267' \ - "exponent must contain at least one digit (2) - C" "" 34 -at_xfail=no -( - $as_echo "541. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:267: printf %s \"[1e+]\" > input" -at_fn_check_prepare_trace "json.at:267" -( $at_check_trace; printf %s "[1e+]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:267" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:267: ovstest test-json input" -at_fn_check_prepare_trace "json.at:267" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:267" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:267: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:267" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent must contain at least one digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:267" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_541 -#AT_START_542 -at_fn_group_banner 542 'json.at:267' \ - "exponent must contain at least one digit (2) - Python" "" 34 -at_xfail=no -( - $as_echo "542. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:267" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:267" - { set +x -$as_echo "$at_srcdir/json.at:267: printf %s \"[1e+]\" > input" -at_fn_check_prepare_trace "json.at:267" -( $at_check_trace; printf %s "[1e+]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:267" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:267: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:267" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:267" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:267: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:267" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent must contain at least one digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:267" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_542 -#AT_START_543 -at_fn_group_banner 543 'json.at:271' \ - "exponent must contain at least one digit (3) - C" "" 34 -at_xfail=no -( - $as_echo "543. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:271: printf %s \"[1e-]\" > input" -at_fn_check_prepare_trace "json.at:271" -( $at_check_trace; printf %s "[1e-]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:271" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:271: ovstest test-json input" -at_fn_check_prepare_trace "json.at:271" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:271" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:271: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:271" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent must contain at least one digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:271" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_543 -#AT_START_544 -at_fn_group_banner 544 'json.at:271' \ - "exponent must contain at least one digit (3) - Python" "" 34 -at_xfail=no -( - $as_echo "544. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:271" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:271" - { set +x -$as_echo "$at_srcdir/json.at:271: printf %s \"[1e-]\" > input" -at_fn_check_prepare_trace "json.at:271" -( $at_check_trace; printf %s "[1e-]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:271" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:271: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:271" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:271" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:271: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:271" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: exponent must contain at least one digit -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:271" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_544 -#AT_START_545 -at_fn_group_banner 545 'json.at:278' \ - "RFC 4267 object example - C" " " 35 -at_xfail=no -( - $as_echo "545. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:278: printf %s \"{ - \\\"Image\\\": { - \\\"Width\\\": 800, - \\\"Height\\\": 600, - \\\"Title\\\": \\\"View from 15th Floor\\\", - \\\"Thumbnail\\\": { - \\\"Url\\\": \\\"http://www.example.com/image/481989943\\\", - \\\"Height\\\": 125, - \\\"Width\\\": \\\"100\\\" - }, - \\\"IDs\\\": [116, 943, 234, 38793] - } -}\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:278" -( $at_check_trace; printf %s "{ - \"Image\": { - \"Width\": 800, - \"Height\": 600, - \"Title\": \"View from 15th Floor\", - \"Thumbnail\": { - \"Url\": \"http://www.example.com/image/481989943\", - \"Height\": 125, - \"Width\": \"100\" - }, - \"IDs\": [116, 943, 234, 38793] - } -}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:278" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:278: ovstest test-json input" -at_fn_check_prepare_trace "json.at:278" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:278" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:278: cat stdout" -at_fn_check_prepare_trace "json.at:278" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"Image\":{\"Height\":600,\"IDs\":[116,943,234,38793],\"Thumbnail\":{\"Height\":125,\"Url\":\"http://www.example.com/image/481989943\",\"Width\":\"100\"},\"Title\":\"View from 15th Floor\",\"Width\":800}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:278" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_545 -#AT_START_546 -at_fn_group_banner 546 'json.at:278' \ - "RFC 4267 object example - Python" " " 35 -at_xfail=no -( - $as_echo "546. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:278" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:278" - { set +x -$as_echo "$at_srcdir/json.at:278: printf %s \"{ - \\\"Image\\\": { - \\\"Width\\\": 800, - \\\"Height\\\": 600, - \\\"Title\\\": \\\"View from 15th Floor\\\", - \\\"Thumbnail\\\": { - \\\"Url\\\": \\\"http://www.example.com/image/481989943\\\", - \\\"Height\\\": 125, - \\\"Width\\\": \\\"100\\\" - }, - \\\"IDs\\\": [116, 943, 234, 38793] - } -}\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:278" -( $at_check_trace; printf %s "{ - \"Image\": { - \"Width\": 800, - \"Height\": 600, - \"Title\": \"View from 15th Floor\", - \"Thumbnail\": { - \"Url\": \"http://www.example.com/image/481989943\", - \"Height\": 125, - \"Width\": \"100\" - }, - \"IDs\": [116, 943, 234, 38793] - } -}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:278" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:278: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:278" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:278" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:278: cat stdout" -at_fn_check_prepare_trace "json.at:278" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"Image\":{\"Height\":600,\"IDs\":[116,943,234,38793],\"Thumbnail\":{\"Height\":125,\"Url\":\"http://www.example.com/image/481989943\",\"Width\":\"100\"},\"Title\":\"View from 15th Floor\",\"Width\":800}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:278" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_546 -#AT_START_547 -at_fn_group_banner 547 'json.at:294' \ - "RFC 4267 array example - C" " " 35 -at_xfail=no -( - $as_echo "547. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:294: printf %s \"[ - { - \\\"precision\\\": \\\"zip\\\", - \\\"Latitude\\\": 37.7668, - \\\"Longitude\\\": -122.3959, - \\\"Address\\\": \\\"\\\", - \\\"City\\\": \\\"SAN FRANCISCO\\\", - \\\"State\\\": \\\"CA\\\", - \\\"Zip\\\": \\\"94107\\\", - \\\"Country\\\": \\\"US\\\" - }, - { - \\\"precision\\\": \\\"zip\\\", - \\\"Latitude\\\": 37.371991, - \\\"Longitude\\\": -122.026020, - \\\"Address\\\": \\\"\\\", - \\\"City\\\": \\\"SUNNYVALE\\\", - \\\"State\\\": \\\"CA\\\", - \\\"Zip\\\": \\\"94085\\\", - \\\"Country\\\": \\\"US\\\" - } -]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:294" -( $at_check_trace; printf %s "[ - { - \"precision\": \"zip\", - \"Latitude\": 37.7668, - \"Longitude\": -122.3959, - \"Address\": \"\", - \"City\": \"SAN FRANCISCO\", - \"State\": \"CA\", - \"Zip\": \"94107\", - \"Country\": \"US\" - }, - { - \"precision\": \"zip\", - \"Latitude\": 37.371991, - \"Longitude\": -122.026020, - \"Address\": \"\", - \"City\": \"SUNNYVALE\", - \"State\": \"CA\", - \"Zip\": \"94085\", - \"Country\": \"US\" - } -]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:294" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:294: ovstest test-json input" -at_fn_check_prepare_trace "json.at:294" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:294" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:294: cat stdout" -at_fn_check_prepare_trace "json.at:294" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"Address\":\"\",\"City\":\"SAN FRANCISCO\",\"Country\":\"US\",\"Latitude\":37.7668,\"Longitude\":-122.3959,\"State\":\"CA\",\"Zip\":\"94107\",\"precision\":\"zip\"},{\"Address\":\"\",\"City\":\"SUNNYVALE\",\"Country\":\"US\",\"Latitude\":37.371991,\"Longitude\":-122.02602,\"State\":\"CA\",\"Zip\":\"94085\",\"precision\":\"zip\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:294" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_547 -#AT_START_548 -at_fn_group_banner 548 'json.at:294' \ - "RFC 4267 array example - Python" " " 35 -at_xfail=no -( - $as_echo "548. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:294" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:294" - { set +x -$as_echo "$at_srcdir/json.at:294: printf %s \"[ - { - \\\"precision\\\": \\\"zip\\\", - \\\"Latitude\\\": 37.7668, - \\\"Longitude\\\": -122.3959, - \\\"Address\\\": \\\"\\\", - \\\"City\\\": \\\"SAN FRANCISCO\\\", - \\\"State\\\": \\\"CA\\\", - \\\"Zip\\\": \\\"94107\\\", - \\\"Country\\\": \\\"US\\\" - }, - { - \\\"precision\\\": \\\"zip\\\", - \\\"Latitude\\\": 37.371991, - \\\"Longitude\\\": -122.026020, - \\\"Address\\\": \\\"\\\", - \\\"City\\\": \\\"SUNNYVALE\\\", - \\\"State\\\": \\\"CA\\\", - \\\"Zip\\\": \\\"94085\\\", - \\\"Country\\\": \\\"US\\\" - } -]\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:294" -( $at_check_trace; printf %s "[ - { - \"precision\": \"zip\", - \"Latitude\": 37.7668, - \"Longitude\": -122.3959, - \"Address\": \"\", - \"City\": \"SAN FRANCISCO\", - \"State\": \"CA\", - \"Zip\": \"94107\", - \"Country\": \"US\" - }, - { - \"precision\": \"zip\", - \"Latitude\": 37.371991, - \"Longitude\": -122.026020, - \"Address\": \"\", - \"City\": \"SUNNYVALE\", - \"State\": \"CA\", - \"Zip\": \"94085\", - \"Country\": \"US\" - } -]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:294" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:294: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:294" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:294" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:294: cat stdout" -at_fn_check_prepare_trace "json.at:294" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"Address\":\"\",\"City\":\"SAN FRANCISCO\",\"Country\":\"US\",\"Latitude\":37.7668,\"Longitude\":-122.3959,\"State\":\"CA\",\"Zip\":\"94107\",\"precision\":\"zip\"},{\"Address\":\"\",\"City\":\"SUNNYVALE\",\"Country\":\"US\",\"Latitude\":37.371991,\"Longitude\":-122.02602,\"State\":\"CA\",\"Zip\":\"94085\",\"precision\":\"zip\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:294" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_548 -#AT_START_549 -at_fn_group_banner 549 'json.at:321' \ - "trailing garbage - C" " " 36 -at_xfail=no -( - $as_echo "549. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:321: printf %s \"[1]null\" > input" -at_fn_check_prepare_trace "json.at:321" -( $at_check_trace; printf %s "[1]null" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:321: ovstest test-json input" -at_fn_check_prepare_trace "json.at:321" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:321" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:321: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:321" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: trailing garbage at end of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:321" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_549 -#AT_START_550 -at_fn_group_banner 550 'json.at:321' \ - "trailing garbage - Python" " " 36 -at_xfail=no -( - $as_echo "550. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:321" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:321" - { set +x -$as_echo "$at_srcdir/json.at:321: printf %s \"[1]null\" > input" -at_fn_check_prepare_trace "json.at:321" -( $at_check_trace; printf %s "[1]null" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:321: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:321" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:321" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:321: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:321" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: trailing garbage at end of input -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:321" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_550 -#AT_START_551 -at_fn_group_banner 551 'json.at:323' \ - "formfeeds are not valid white space - C" " " 36 -at_xfail=no -( - $as_echo "551. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:323: printf %s \"[ ]\" > input" -at_fn_check_prepare_trace "json.at:323" -( $at_check_trace; printf %s "[ ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:323" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:323: ovstest test-json input" -at_fn_check_prepare_trace "json.at:323" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:323" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:323: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:323" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid character U+000c -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:323" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_551 -#AT_START_552 -at_fn_group_banner 552 'json.at:323' \ - "formfeeds are not valid white space - Python" " " 36 -at_xfail=no -( - $as_echo "552. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:323" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:323" - { set +x -$as_echo "$at_srcdir/json.at:323: printf %s \"[ ]\" > input" -at_fn_check_prepare_trace "json.at:323" -( $at_check_trace; printf %s "[ ]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:323" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:323: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:323" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:323" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:323: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:323" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid character U+000c -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:323" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_552 -#AT_START_553 -at_fn_group_banner 553 'json.at:325' \ - "';' is not a valid token - C" " " 36 -at_xfail=no -( - $as_echo "553. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:325: printf %s \";\" > input" -at_fn_check_prepare_trace "json.at:325" -( $at_check_trace; printf %s ";" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:325" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:325: ovstest test-json input" -at_fn_check_prepare_trace "json.at:325" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:325" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:325: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:325" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid character ';' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:325" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_553 -#AT_START_554 -at_fn_group_banner 554 'json.at:325' \ - "';' is not a valid token - Python" " " 36 -at_xfail=no -( - $as_echo "554. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:325" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:325" - { set +x -$as_echo "$at_srcdir/json.at:325: printf %s \";\" > input" -at_fn_check_prepare_trace "json.at:325" -( $at_check_trace; printf %s ";" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:325" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:325: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:325" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:325" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:325: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:325" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: invalid character ';' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:325" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_554 -#AT_START_555 -at_fn_group_banner 555 'json.at:327' \ - "arrays nesting too deep - C" " " 36 -at_xfail=no -( - $as_echo "555. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:327: printf %s \"[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]\" > input" -at_fn_check_prepare_trace "json.at:327" -( $at_check_trace; printf %s "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:327" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:327: ovstest test-json input" -at_fn_check_prepare_trace "json.at:327" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:327" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:327: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:327" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: input exceeds maximum nesting depth 1000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:327" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_555 -#AT_START_556 -at_fn_group_banner 556 'json.at:327' \ - "arrays nesting too deep - Python" " " 36 -at_xfail=no -( - $as_echo "556. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:327" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:327" - { set +x -$as_echo "$at_srcdir/json.at:327: printf %s \"[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]\" > input" -at_fn_check_prepare_trace "json.at:327" -( $at_check_trace; printf %s "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:327" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:327: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:327" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:327" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:327: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:327" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: input exceeds maximum nesting depth 1000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:327" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_556 -#AT_START_557 -at_fn_group_banner 557 'json.at:331' \ - "objects nesting too deep - C" " " 36 -at_xfail=no -( - $as_echo "557. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:331: printf %s \"{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\": }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\" > input" -at_fn_check_prepare_trace "json.at:331" -( $at_check_trace; printf %s "{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\": }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:331" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:331: ovstest test-json input" -at_fn_check_prepare_trace "json.at:331" -( $at_check_trace; ovstest test-json input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:331" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:331: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:331" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: input exceeds maximum nesting depth 1000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:331" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_557 -#AT_START_558 -at_fn_group_banner 558 'json.at:331' \ - "objects nesting too deep - Python" " " 36 -at_xfail=no -( - $as_echo "558. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:331" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:331" - { set +x -$as_echo "$at_srcdir/json.at:331: printf %s \"{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\":{\\\"x\\\": }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\" > input" -at_fn_check_prepare_trace "json.at:331" -( $at_check_trace; printf %s "{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\":{\"x\": }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:331" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:331: \$PYTHON \$srcdir/test-json.py input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py input" "json.at:331" -( $at_check_trace; $PYTHON $srcdir/test-json.py input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:331" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:331: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:331" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: input exceeds maximum nesting depth 1000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:331" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_558 -#AT_START_559 -at_fn_group_banner 559 'json.at:336' \ - "input may not be empty" " " 36 -at_xfail=no -( - $as_echo "559. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/json.at:338: ovstest test-json /dev/null" -at_fn_check_prepare_trace "json.at:338" -( $at_check_trace; ovstest test-json /dev/null -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "error: line 0, column 0, byte 0: empty input stream -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/json.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_559 -#AT_START_560 -at_fn_group_banner 560 'json.at:344' \ - "multiple adjacent objects - C" " " 37 -at_xfail=no -( - $as_echo "560. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:344: printf %s \"{}{}{}\" > input" -at_fn_check_prepare_trace "json.at:344" -( $at_check_trace; printf %s "{}{}{}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:344" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:344: ovstest test-json --multiple input" -at_fn_check_prepare_trace "json.at:344" -( $at_check_trace; ovstest test-json --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:344" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:344: cat stdout" -at_fn_check_prepare_trace "json.at:344" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:344" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_560 -#AT_START_561 -at_fn_group_banner 561 'json.at:344' \ - "multiple adjacent objects - Python" " " 37 -at_xfail=no -( - $as_echo "561. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:344" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:344" - { set +x -$as_echo "$at_srcdir/json.at:344: printf %s \"{}{}{}\" > input" -at_fn_check_prepare_trace "json.at:344" -( $at_check_trace; printf %s "{}{}{}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:344" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:344: \$PYTHON \$srcdir/test-json.py --multiple input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py --multiple input" "json.at:344" -( $at_check_trace; $PYTHON $srcdir/test-json.py --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:344" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:344: cat stdout" -at_fn_check_prepare_trace "json.at:344" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:344" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_561 -#AT_START_562 -at_fn_group_banner 562 'json.at:349' \ - "multiple space-separated objects - C" " " 37 -at_xfail=no -( - $as_echo "562. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:349: printf %s \"{} {} {}\" > input" -at_fn_check_prepare_trace "json.at:349" -( $at_check_trace; printf %s "{} {} {}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:349" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:349: ovstest test-json --multiple input" -at_fn_check_prepare_trace "json.at:349" -( $at_check_trace; ovstest test-json --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:349" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:349: cat stdout" -at_fn_check_prepare_trace "json.at:349" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:349" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_562 -#AT_START_563 -at_fn_group_banner 563 'json.at:349' \ - "multiple space-separated objects - Python" " " 37 -at_xfail=no -( - $as_echo "563. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:349" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:349" - { set +x -$as_echo "$at_srcdir/json.at:349: printf %s \"{} {} {}\" > input" -at_fn_check_prepare_trace "json.at:349" -( $at_check_trace; printf %s "{} {} {}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:349" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:349: \$PYTHON \$srcdir/test-json.py --multiple input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py --multiple input" "json.at:349" -( $at_check_trace; $PYTHON $srcdir/test-json.py --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:349" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:349: cat stdout" -at_fn_check_prepare_trace "json.at:349" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:349" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_563 -#AT_START_564 -at_fn_group_banner 564 'json.at:354' \ - "multiple objects on separate lines - C" " " 37 -at_xfail=no -( - $as_echo "564. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:354: printf %s \"{} -{} -{}\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:354" -( $at_check_trace; printf %s "{} -{} -{}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:354: ovstest test-json --multiple input" -at_fn_check_prepare_trace "json.at:354" -( $at_check_trace; ovstest test-json --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:354" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:354: cat stdout" -at_fn_check_prepare_trace "json.at:354" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:354" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_564 -#AT_START_565 -at_fn_group_banner 565 'json.at:354' \ - "multiple objects on separate lines - Python" " " 37 -at_xfail=no -( - $as_echo "565. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:354" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:354" - { set +x -$as_echo "$at_srcdir/json.at:354: printf %s \"{} -{} -{}\" > input" -at_fn_check_prepare_notrace 'an embedded newline' "json.at:354" -( $at_check_trace; printf %s "{} -{} -{}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:354: \$PYTHON \$srcdir/test-json.py --multiple input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py --multiple input" "json.at:354" -( $at_check_trace; $PYTHON $srcdir/test-json.py --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:354" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:354: cat stdout" -at_fn_check_prepare_trace "json.at:354" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:354" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_565 -#AT_START_566 -at_fn_group_banner 566 'json.at:361' \ - "multiple objects and arrays - C" " " 37 -at_xfail=no -( - $as_echo "566. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:361: printf %s \"{}[]{}[]\" > input" -at_fn_check_prepare_trace "json.at:361" -( $at_check_trace; printf %s "{}[]{}[]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:361" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:361: ovstest test-json --multiple input" -at_fn_check_prepare_trace "json.at:361" -( $at_check_trace; ovstest test-json --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:361" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:361: cat stdout" -at_fn_check_prepare_trace "json.at:361" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -[] -{} -[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:361" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_566 -#AT_START_567 -at_fn_group_banner 567 'json.at:361' \ - "multiple objects and arrays - Python" " " 37 -at_xfail=no -( - $as_echo "567. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:361" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:361" - { set +x -$as_echo "$at_srcdir/json.at:361: printf %s \"{}[]{}[]\" > input" -at_fn_check_prepare_trace "json.at:361" -( $at_check_trace; printf %s "{}[]{}[]" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:361" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:361: \$PYTHON \$srcdir/test-json.py --multiple input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py --multiple input" "json.at:361" -( $at_check_trace; $PYTHON $srcdir/test-json.py --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/json.at:361" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:361: cat stdout" -at_fn_check_prepare_trace "json.at:361" -( $at_check_trace; cat stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -[] -{} -[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:361" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_567 -#AT_START_568 -at_fn_group_banner 568 'json.at:367' \ - "garbage between multiple objects - C" " " 37 -at_xfail=no -( - $as_echo "568. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:367: printf %s \"{}x{}\" > input" -at_fn_check_prepare_trace "json.at:367" -( $at_check_trace; printf %s "{}x{}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:367" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:367: ovstest test-json --multiple input" -at_fn_check_prepare_trace "json.at:367" -( $at_check_trace; ovstest test-json --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:367" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:367: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:367" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -error: invalid keyword 'x' -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:367" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_568 -#AT_START_569 -at_fn_group_banner 569 'json.at:367' \ - "garbage between multiple objects - Python" " " 37 -at_xfail=no -( - $as_echo "569. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:367" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:367" - { set +x -$as_echo "$at_srcdir/json.at:367: printf %s \"{}x{}\" > input" -at_fn_check_prepare_trace "json.at:367" -( $at_check_trace; printf %s "{}x{}" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:367" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:367: \$PYTHON \$srcdir/test-json.py --multiple input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py --multiple input" "json.at:367" -( $at_check_trace; $PYTHON $srcdir/test-json.py --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:367" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:367: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:367" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -error: invalid keyword 'x' -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:367" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_569 -#AT_START_570 -at_fn_group_banner 570 'json.at:371' \ - "garbage after multiple objects - C" " " 37 -at_xfail=no -( - $as_echo "570. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/json.at:371: printf %s \"{}{}x\" > input" -at_fn_check_prepare_trace "json.at:371" -( $at_check_trace; printf %s "{}{}x" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:371" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:371: ovstest test-json --multiple input" -at_fn_check_prepare_trace "json.at:371" -( $at_check_trace; ovstest test-json --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:371" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:371: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:371" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -error: invalid keyword 'x' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:371" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_570 -#AT_START_571 -at_fn_group_banner 571 'json.at:371' \ - "garbage after multiple objects - Python" " " 37 -at_xfail=no -( - $as_echo "571. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "json.at:371" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/json.at:371" - { set +x -$as_echo "$at_srcdir/json.at:371: printf %s \"{}{}x\" > input" -at_fn_check_prepare_trace "json.at:371" -( $at_check_trace; printf %s "{}{}x" > input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:371" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/json.at:371: \$PYTHON \$srcdir/test-json.py --multiple input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-json.py --multiple input" "json.at:371" -( $at_check_trace; $PYTHON $srcdir/test-json.py --multiple input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/json.at:371" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/json.at:371: sed 's/^error: [^:]*:/error:/' < stdout" -at_fn_check_prepare_trace "json.at:371" -( $at_check_trace; sed 's/^error: [^:]*:/error:/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -{} -error: invalid keyword 'x' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/json.at:371" -$at_failed && at_fn_log_failure \ -"input" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_571 -#AT_START_572 -at_fn_group_banner 572 'jsonrpc.at:3' \ - "JSON-RPC request and successful reply" " " 38 -at_xfail=no -( - $as_echo "572. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:5: ovstest test-jsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/pid listen punix:socket" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:5" -( $at_check_trace; ovstest test-jsonrpc --detach --no-chdir --pidfile="`pwd`"/pid listen punix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:5" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:6: test -s pid" -at_fn_check_prepare_trace "jsonrpc.at:6" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:6" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:7: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:7" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:8: ovstest test-jsonrpc request unix:socket echo '[{\"a\": \"b\", \"x\": null}]'" -at_fn_check_prepare_trace "jsonrpc.at:8" -( $at_check_trace; ovstest test-jsonrpc request unix:socket echo '[{"a": "b", "x": null}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"error\":null,\"id\":0,\"result\":[{\"a\":\"b\",\"x\":null}]} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:8" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:12: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:12" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:12" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_572 -#AT_START_573 -at_fn_group_banner 573 'jsonrpc.at:15' \ - "JSON-RPC request and error reply" " " 38 -at_xfail=no -( - $as_echo "573. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:17: ovstest test-jsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/pid listen punix:socket" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:17" -( $at_check_trace; ovstest test-jsonrpc --detach --no-chdir --pidfile="`pwd`"/pid listen punix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:17" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:18: test -s pid" -at_fn_check_prepare_trace "jsonrpc.at:18" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:18" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:19: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:19" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:20: ovstest test-jsonrpc request unix:socket bad-request '[]'" -at_fn_check_prepare_trace "jsonrpc.at:20" -( $at_check_trace; ovstest test-jsonrpc request unix:socket bad-request '[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"error\":{\"error\":\"unknown method\"},\"id\":0,\"result\":null} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:20" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:24: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:24" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:24" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_573 -#AT_START_574 -at_fn_group_banner 574 'jsonrpc.at:27' \ - "JSON-RPC notification" " " 38 -at_xfail=no -( - $as_echo "574. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:29: ovstest test-jsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/pid listen punix:socket" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:29" -( $at_check_trace; ovstest test-jsonrpc --detach --no-chdir --pidfile="`pwd`"/pid listen punix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:30: test -s pid" -at_fn_check_prepare_trace "jsonrpc.at:30" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -# When a daemon dies it deletes its pidfile, so make a copy. -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:32: cp pid pid2" -at_fn_check_prepare_trace "jsonrpc.at:32" -( $at_check_trace; cp pid pid2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:32" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:33: kill -0 \`cat pid2\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:33" -( $at_check_trace; kill -0 `cat pid2` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:33" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:34: ovstest test-jsonrpc notify unix:socket shutdown '[]'" -at_fn_check_prepare_trace "jsonrpc.at:34" -( $at_check_trace; ovstest test-jsonrpc notify unix:socket shutdown '[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:34" -if $at_failed; then : - kill `cat pid2` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:36: pid=\`cat pid2\` - # First try a quick sleep, so that the test completes very quickly - # in the normal case. POSIX doesn't require fractional times to - # work, so this might not work. - sleep 0.1; if kill -0 \$pid; then :; else echo success; exit 0; fi - # Then wait up to 2 seconds. - sleep 1; if kill -0 \$pid; then :; else echo success; exit 0; fi - sleep 1; if kill -0 \$pid; then :; else echo success; exit 0; fi - echo failure; exit 1" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc.at:36" -( $at_check_trace; pid=`cat pid2` - # First try a quick sleep, so that the test completes very quickly - # in the normal case. POSIX doesn't require fractional times to - # work, so this might not work. - sleep 0.1; if kill -0 $pid; then :; else echo success; exit 0; fi - # Then wait up to 2 seconds. - sleep 1; if kill -0 $pid; then :; else echo success; exit 0; fi - sleep 1; if kill -0 $pid; then :; else echo success; exit 0; fi - echo failure; exit 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "success -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:36" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc.at:47: test ! -e pid" -at_fn_check_prepare_trace "jsonrpc.at:47" -( $at_check_trace; test ! -e pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_574 -#AT_START_575 -at_fn_group_banner 575 'jsonrpc-py.at:3' \ - "JSON-RPC request and successful reply - Python" " " 39 -at_xfail=no -( - $as_echo "575. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "jsonrpc-py.at:4" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/jsonrpc-py.at:4" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:6: \$PYTHON \$srcdir/test-jsonrpc.py --detach --pidfile=\`pwd\`/pid listen punix:socket" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:6" -( $at_check_trace; $PYTHON $srcdir/test-jsonrpc.py --detach --pidfile=`pwd`/pid listen punix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:6" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:7: test -s pid" -at_fn_check_prepare_trace "jsonrpc-py.at:7" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:8: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:8" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:8" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:9: \$PYTHON \$srcdir/test-jsonrpc.py request unix:socket echo '[{\"a\": \"b\", \"x\": null}]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-jsonrpc.py request unix:socket echo '[{\"a\": \"b\", \"x\": null}]'" "jsonrpc-py.at:9" -( $at_check_trace; $PYTHON $srcdir/test-jsonrpc.py request unix:socket echo '[{"a": "b", "x": null}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"error\":null,\"id\":0,\"result\":[{\"a\":\"b\",\"x\":null}]} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:9" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:13: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:13" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_575 -#AT_START_576 -at_fn_group_banner 576 'jsonrpc-py.at:16' \ - "JSON-RPC request and error reply - Python" " " 39 -at_xfail=no -( - $as_echo "576. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "jsonrpc-py.at:17" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/jsonrpc-py.at:17" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:19: \$PYTHON \$srcdir/test-jsonrpc.py --detach --pidfile=\`pwd\`/pid listen punix:socket" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:19" -( $at_check_trace; $PYTHON $srcdir/test-jsonrpc.py --detach --pidfile=`pwd`/pid listen punix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:20: test -s pid" -at_fn_check_prepare_trace "jsonrpc-py.at:20" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:20" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:21: kill -0 \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:21" -( $at_check_trace; kill -0 `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:22: \$PYTHON \$srcdir/test-jsonrpc.py request unix:socket bad-request '[]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-jsonrpc.py request unix:socket bad-request '[]'" "jsonrpc-py.at:22" -( $at_check_trace; $PYTHON $srcdir/test-jsonrpc.py request unix:socket bad-request '[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"error\":{\"error\":\"unknown method\"},\"id\":0,\"result\":null} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:22" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:26: kill \`cat pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:26" -( $at_check_trace; kill `cat pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:26" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_576 -#AT_START_577 -at_fn_group_banner 577 'jsonrpc-py.at:29' \ - "JSON-RPC notification - Python" " " 39 -at_xfail=no -( - $as_echo "577. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "jsonrpc-py.at:30" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/jsonrpc-py.at:30" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:32: \$PYTHON \$srcdir/test-jsonrpc.py --detach --pidfile=\`pwd\`/pid listen punix:socket" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:32" -( $at_check_trace; $PYTHON $srcdir/test-jsonrpc.py --detach --pidfile=`pwd`/pid listen punix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:32" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:33: test -s pid" -at_fn_check_prepare_trace "jsonrpc-py.at:33" -( $at_check_trace; test -s pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:33" -$at_failed && at_fn_log_failure -$at_traceon; } - -# When a daemon dies it deletes its pidfile, so make a copy. -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:35: cp pid pid2" -at_fn_check_prepare_trace "jsonrpc-py.at:35" -( $at_check_trace; cp pid pid2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:35" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:36: kill -0 \`cat pid2\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:36" -( $at_check_trace; kill -0 `cat pid2` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:36" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:37: \$PYTHON \$srcdir/test-jsonrpc.py notify unix:socket shutdown '[]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-jsonrpc.py notify unix:socket shutdown '[]'" "jsonrpc-py.at:37" -( $at_check_trace; $PYTHON $srcdir/test-jsonrpc.py notify unix:socket shutdown '[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:37" -if $at_failed; then : - kill `cat pid2` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:39: pid=\`cat pid2\` - # First try a quick sleep, so that the test completes very quickly - # in the normal case. POSIX doesn't require fractional times to - # work, so this might not work. - sleep 0.1; if kill -0 \$pid; then :; else echo success; exit 0; fi - # Then wait up to 2 seconds. - sleep 1; if kill -0 \$pid; then :; else echo success; exit 0; fi - sleep 1; if kill -0 \$pid; then :; else echo success; exit 0; fi - echo failure; exit 1" -at_fn_check_prepare_notrace 'a `...` command substitution' "jsonrpc-py.at:39" -( $at_check_trace; pid=`cat pid2` - # First try a quick sleep, so that the test completes very quickly - # in the normal case. POSIX doesn't require fractional times to - # work, so this might not work. - sleep 0.1; if kill -0 $pid; then :; else echo success; exit 0; fi - # Then wait up to 2 seconds. - sleep 1; if kill -0 $pid; then :; else echo success; exit 0; fi - sleep 1; if kill -0 $pid; then :; else echo success; exit 0; fi - echo failure; exit 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "success -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/jsonrpc-py.at:50: test ! -e pid" -at_fn_check_prepare_trace "jsonrpc-py.at:50" -( $at_check_trace; test ! -e pid -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/jsonrpc-py.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_577 -#AT_START_578 -at_fn_group_banner 578 'tunnel.at:3' \ - "tunnel - input" " " 40 -at_xfail=no -( - $as_echo "578. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:4: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:4" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:4: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:4" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:4: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:4" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:4: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:4" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:4: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:4" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:4: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:4" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:4: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \\ - options:remote_ip=1.1.1.1 ofport_request=1\\ - -- add-port br0 p2 -- set Interface p2 type=gre \\ - options:local_ip=2.2.2.2 options:remote_ip=1.1.1.1 \\ - ofport_request=2 \\ - -- add-port br0 p3 -- set Interface p3 type=gre \\ - options:remote_ip=2.2.2.2 ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:4" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \ - options:remote_ip=1.1.1.1 ofport_request=1\ - -- add-port br0 p2 -- set Interface p2 type=gre \ - options:local_ip=2.2.2.2 options:remote_ip=1.1.1.1 \ - ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=gre \ - options:remote_ip=2.2.2.2 ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -actions=IN_PORT -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:15: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:15" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:15" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:17: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:17" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: remote_ip=1.1.1.1) - p2 2/1: (gre: local_ip=2.2.2.2, remote_ip=1.1.1.1) - p3 3/1: (gre: remote_ip=2.2.2.2) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:17" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:25: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=1.2.3.4,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:25" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=1.2.3.4,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:25" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:26: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:26" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:26" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:31: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:31" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:31" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:32: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:32" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:32" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:37: ovs-vsctl set Interface p2 type=gre options:local_ip=2.2.2.3 \\ - options:df_default=false options:ttl=1 options:csum=true \\ - -- set Interface p3 type=gre64" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:37" -( $at_check_trace; ovs-vsctl set Interface p2 type=gre options:local_ip=2.2.2.3 \ - options:df_default=false options:ttl=1 options:csum=true \ - -- set Interface p3 type=gre64 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:37" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:40: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:40" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: remote_ip=1.1.1.1) - p2 2/1: (gre: csum=true, df_default=false, local_ip=2.2.2.3, remote_ip=1.1.1.1, ttl=1) - p3 3/64: (gre64: remote_ip=2.2.2.2) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:40" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:46: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:46" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:46" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:47: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:47" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:47" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:50: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.3,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:50" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.3,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:51: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:51" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.3,dst=1.1.1.1,tos=0x0,ttl=1,flags(csum))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:51" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:56: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=5.5.5.5,dst=6.6.6.6,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:56" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=5.5.5.5,dst=6.6.6.6,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "Invalid datapath flow -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 2 $at_status "$at_srcdir/tunnel.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:61: check_logs \"/receive tunnel port not found/d\"" -at_fn_check_prepare_trace "tunnel.at:61" -( $at_check_trace; check_logs "/receive tunnel port not found/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:61: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:61" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:61: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:61" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_578 -#AT_START_579 -at_fn_group_banner 579 'tunnel.at:64' \ - "tunnel - ECN decapsulation" " " 40 -at_xfail=no -( - $as_echo "579. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:65: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:65" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:65: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:65" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:65: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:65" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:65: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:65" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:65" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:65: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:65" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:65" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:65: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:65" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:65" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:65: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \\ - options:remote_ip=1.1.1.1 ofport_request=1 \\ - -- add-port br0 p2 -- set Interface p2 type=dummy \\ - ofport_request=2 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:65" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \ - options:remote_ip=1.1.1.1 ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy \ - ofport_request=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:65" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -actions=2 -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:73: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:73" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:73" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:75: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:75" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: remote_ip=1.1.1.1) - p2 2/2: (dummy) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:75" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:82: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=3,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:82" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=3,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:82" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:83: tail -2 stdout" -at_fn_check_prepare_trace "tunnel.at:83" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=3,nw_frag=no -Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:89: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:89" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:89" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:90: tail -2 stdout" -at_fn_check_prepare_trace "tunnel.at:90" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,tcp,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=1,nw_ttl=64 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0x3,ttl=64,frag=no)),2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:96: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=2,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:96" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=2,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:96" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:97: tail -2 stdout" -at_fn_check_prepare_trace "tunnel.at:97" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,tcp,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=2,nw_ttl=64 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0x3,ttl=64,frag=no)),2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:97" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:103: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:103" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:103" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:104: tail -2 stdout" -at_fn_check_prepare_trace "tunnel.at:104" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=0,nw_frag=no -Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:104" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:108: check_logs \"/dropping tunnel packet marked ECN CE but is not ECN capable/d\"" -at_fn_check_prepare_trace "tunnel.at:108" -( $at_check_trace; check_logs "/dropping tunnel packet marked ECN CE but is not ECN capable/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:108: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:108" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:108: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:108" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_579 -#AT_START_580 -at_fn_group_banner 580 'tunnel.at:111' \ - "tunnel - output" " " 40 -at_xfail=no -( - $as_echo "580. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:112: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:112" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:112: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:112" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:112: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:112" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:112: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:112" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:112" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:112: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:112" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:112" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:112: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:112" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:112" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:112: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \\ - options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \\ - options:key=5 ofport_request=1\\ - -- add-port br0 p2 -- set Interface p2 type=dummy \\ - ofport_request=2 ofport_request=2 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:112" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \ - options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \ - options:key=5 ofport_request=1\ - -- add-port br0 p2 -- set Interface p2 type=dummy \ - ofport_request=2 ofport_request=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:112" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -actions=output:1 -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:121: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:121" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:121" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:123: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:123" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1) - p2 2/2: (dummy) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:123" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:130: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:130" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:130" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:131: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:131" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:131" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:136: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:136" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:136" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:137: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:137" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df,key))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:137" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:140: check_logs " -at_fn_check_prepare_trace "tunnel.at:140" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:140: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:140" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:140: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:140" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_580 -#AT_START_581 -at_fn_group_banner 581 'tunnel.at:143' \ - "tunnel - ToS and TTL inheritance" " " 40 -at_xfail=no -( - $as_echo "581. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:144: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:144" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:144" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:144: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:144" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:144" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:144: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:144" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:144" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:144: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:144" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:144: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:144" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:144: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:144" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:144: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \\ - options:remote_ip=1.1.1.1 options:tos=inherit \\ - options:ttl=inherit ofport_request=1 \\ - -- add-port br0 p2 -- set Interface p2 type=dummy \\ - ofport_request=2 ofport_request=2 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:144" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \ - options:remote_ip=1.1.1.1 options:tos=inherit \ - options:ttl=inherit ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy \ - ofport_request=2 ofport_request=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -actions=output:1 -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:153: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:153" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:153" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:155: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:155" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: remote_ip=1.1.1.1, tos=inherit, ttl=inherit) - p2 2/2: (dummy) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:155" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:162: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:162" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:162" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:163: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:163" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x4,ttl=128,flags(df))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:163" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:168: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=5,ttl=128,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:168" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=5,ttl=128,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:168" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:169: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:169" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x5,ttl=128,flags(df))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:169" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:174: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18)'" -at_fn_check_prepare_trace "tunnel.at:174" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:174" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:175: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:175" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:175" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:178: check_logs " -at_fn_check_prepare_trace "tunnel.at:178" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:178: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:178" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:178: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:178" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_581 -#AT_START_582 -at_fn_group_banner 582 'tunnel.at:181' \ - "tunnel - set_tunnel" " " 40 -at_xfail=no -( - $as_echo "582. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:182: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:182" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:182: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:182" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:182: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:182" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:182: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:182" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:182" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:182: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:182" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:182" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:182: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:182" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:182" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:182: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=flow \\ - options:remote_ip=1.1.1.1 ofport_request=1 \\ - -- add-port br0 p2 -- set Interface p2 type=gre options:key=flow \\ - options:remote_ip=2.2.2.2 ofport_request=2 \\ - -- add-port br0 p3 -- set Interface p3 type=gre options:key=flow \\ - options:remote_ip=3.3.3.3 ofport_request=3 \\ - -- add-port br0 p4 -- set Interface p4 type=gre options:key=flow \\ - options:remote_ip=4.4.4.4 ofport_request=4 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:182" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=flow \ - options:remote_ip=1.1.1.1 ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=gre options:key=flow \ - options:remote_ip=2.2.2.2 ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=gre options:key=flow \ - options:remote_ip=3.3.3.3 ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=gre options:key=flow \ - options:remote_ip=4.4.4.4 ofport_request=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:182" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -actions=set_tunnel:1,output:1,set_tunnel:2,output:2,set_tunnel:3,output:3,set_tunnel:5,output:4 -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:195: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:195" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:195" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:197: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:197" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: key=flow, remote_ip=1.1.1.1) - p2 2/1: (gre: key=flow, remote_ip=2.2.2.2) - p3 3/1: (gre: key=flow, remote_ip=3.3.3.3) - p4 4/1: (gre: key=flow, remote_ip=4.4.4.4) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:205: ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "tunnel.at:205" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:206: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:206" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2,src=0.0.0.0,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x5,src=0.0.0.0,dst=4.4.4.4,tos=0x0,ttl=64,flags(df,key))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:206" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:212: check_logs " -at_fn_check_prepare_trace "tunnel.at:212" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:212" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:212: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:212" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:212" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:212: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:212" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:212" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_582 -#AT_START_583 -at_fn_group_banner 583 'tunnel.at:215' \ - "tunnel - key" " " 40 -at_xfail=no -( - $as_echo "583. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:216: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:216" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:216" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:216: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:216" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:216" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:216: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:216" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:216" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:216: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:216" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:216" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:216: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:216" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:216" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:216: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:216" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:216" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:216: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=1 \\ - options:remote_ip=1.1.1.1 ofport_request=1 \\ - -- add-port br0 p2 -- set Interface p2 type=gre options:in_key=2 \\ - options:out_key=3 options:remote_ip=1.1.1.1 ofport_request=2 \\ - -- add-port br0 p3 -- set Interface p3 type=gre options:out_key=5 \\ - options:remote_ip=1.1.1.1 ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:216" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=1 \ - options:remote_ip=1.1.1.1 ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=gre options:in_key=2 \ - options:out_key=3 options:remote_ip=1.1.1.1 ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=gre options:out_key=5 \ - options:remote_ip=1.1.1.1 ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:216" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -actions=IN_PORT,output:1,output:2,output:3 -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:227: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:227" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:227" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:229: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:229" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: key=1, remote_ip=1.1.1.1) - p2 2/1: (gre: in_key=2, out_key=3, remote_ip=1.1.1.1) - p3 3/1: (gre: out_key=5, remote_ip=1.1.1.1) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:229" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:236: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:236" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:236" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:237: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:237" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:243: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:243" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:243" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:244: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:244" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:244" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:250: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:250" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:251: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:251" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:257: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0xf,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:257" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0xf,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "Invalid datapath flow -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 2 $at_status "$at_srcdir/tunnel.at:257" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:261: check_logs \"/receive tunnel port not found/d\"" -at_fn_check_prepare_trace "tunnel.at:261" -( $at_check_trace; check_logs "/receive tunnel port not found/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:261: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:261" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:261: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:261" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_583 -#AT_START_584 -at_fn_group_banner 584 'tunnel.at:264' \ - "tunnel - key match" " " 40 -at_xfail=no -( - $as_echo "584. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:265: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:265" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:265" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:265: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:265" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:265" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:265: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:265" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:265" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:265: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:265" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:265: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:265" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:265: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:265" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:265: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=flow \\ - options:remote_ip=1.1.1.1 ofport_request=1 \\ - -- add-port br0 p2 -- set Interface p2 type=gre options:key=3 \\ - options:remote_ip=3.3.3.3 ofport_request=2 \\ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \\ - -- add-port br0 p4 -- set Interface p4 type=dummy ofport_request=4 \\ - -- add-port br0 p5 -- set Interface p5 type=dummy ofport_request=5 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:265" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=flow \ - options:remote_ip=1.1.1.1 ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=gre options:key=3 \ - options:remote_ip=3.3.3.3 ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=dummy ofport_request=4 \ - -- add-port br0 p5 -- set Interface p5 type=dummy ofport_request=5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -tun_id=2,actions=output:3 -tun_id=3,actions=output:4,set_tunnel:2,resubmit:99,set_tunnel:4,output:2,resubmit:99 -tun_id=4,actions=output:5 -_ATEOF - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:279: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:279" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:279" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:281: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:281" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/1: (gre: key=flow, remote_ip=1.1.1.1) - p2 2/1: (gre: key=3, remote_ip=3.3.3.3) - p3 3/3: (dummy) - p4 4/4: (dummy) - p5 5/5: (dummy) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:281" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:290: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:290" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:291: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:291" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:291" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:295: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:295" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:295" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:296: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:296" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 4,3,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:296" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:300: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=3.3.3.3,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:300" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=3.3.3.3,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:300" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:301: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:301" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 4,3,5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:305: ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'" -at_fn_check_prepare_trace "tunnel.at:305" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:306: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:306" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:306" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:310: check_logs " -at_fn_check_prepare_trace "tunnel.at:310" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:310: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:310" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:310: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:310" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_584 -#AT_START_585 -at_fn_group_banner 585 'tunnel.at:313' \ - "tunnel - VXLAN" " " 40 -at_xfail=no -( - $as_echo "585. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:314: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:314" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:314" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:314: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:314" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:314" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:314: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:314" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:314" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:314: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:314" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:314: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:314" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:314: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:314" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:314: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=vxlan \\ - options:remote_ip=1.1.1.1 ofport_request=1 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:314" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=vxlan \ - options:remote_ip=1.1.1.1 ofport_request=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:317: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:317" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/4789: (vxlan: remote_ip=1.1.1.1) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:317" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:322: check_logs " -at_fn_check_prepare_trace "tunnel.at:322" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:322" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:322: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:322" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:322" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:322: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:322" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:322" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_585 -#AT_START_586 -at_fn_group_banner 586 'tunnel.at:325' \ - "tunnel - LISP" " " 40 -at_xfail=no -( - $as_echo "586. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:326: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:326" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:326" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:326: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:326" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:326" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:326: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:326" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:326" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:326: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:326" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:326: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:326" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:326: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:326" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:326: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=lisp \\ - options:remote_ip=1.1.1.1 ofport_request=1 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:326" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=lisp \ - options:remote_ip=1.1.1.1 ofport_request=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:329: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:329" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/4341: (lisp: remote_ip=1.1.1.1) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:329" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:334: check_logs " -at_fn_check_prepare_trace "tunnel.at:334" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:334" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:334: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:334" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:334" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:334: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:334" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:334" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_586 -#AT_START_587 -at_fn_group_banner 587 'tunnel.at:337' \ - "tunnel - different VXLAN UDP port" " " 40 -at_xfail=no -( - $as_echo "587. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:338: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:338" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:338: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:338" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:338: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:338" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:338: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:338" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:338: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:338" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:338: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:338" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:338: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=vxlan \\ - options:remote_ip=1.1.1.1 ofport_request=1 options:dst_port=4341 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:338" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=vxlan \ - options:remote_ip=1.1.1.1 ofport_request=1 options:dst_port=4341 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:341: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:341" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/4341: (vxlan: dst_port=4341, remote_ip=1.1.1.1) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:341" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:348: ovs-vsctl -- set Interface p1 options:dst_port=5000" -at_fn_check_prepare_trace "tunnel.at:348" -( $at_check_trace; ovs-vsctl -- set Interface p1 options:dst_port=5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:348" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:350: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:350" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/5000: (vxlan: dst_port=5000, remote_ip=1.1.1.1) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:357: ovs-vsctl -- set Interface p1 options:dst_port=4789" -at_fn_check_prepare_trace "tunnel.at:357" -( $at_check_trace; ovs-vsctl -- set Interface p1 options:dst_port=4789 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:357" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/tunnel.at:359: ovs-appctl dpif/show | tail -n +3" -at_fn_check_prepare_notrace 'a shell pipeline' "tunnel.at:359" -( $at_check_trace; ovs-appctl dpif/show | tail -n +3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " br0 65534/100: (dummy) - p1 1/4789: (vxlan: remote_ip=1.1.1.1) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:359" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:363: check_logs " -at_fn_check_prepare_trace "tunnel.at:363" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:363: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:363" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:363: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:363" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_587 -#AT_START_588 -at_fn_group_banner 588 'tunnel.at:366' \ - "ofproto-dpif - set_field - tun_src/tun_dst/tun_id" "" 40 -at_xfail=no -( - $as_echo "588. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/tunnel.at:367: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "tunnel.at:367" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:367" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:367: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "tunnel.at:367" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:367" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:367: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:367" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:367" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/tunnel.at:367: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "tunnel.at:367" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:367: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "tunnel.at:367" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:367: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:367" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/tunnel.at:367: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=flow \\ - options:remote_ip=1.1.1.1 ofport_request=1 \\ - -- add-port br0 p2 -- set Interface p2 type=gre options:key=flow \\ - options:remote_ip=flow ofport_request=2 \\ - -- add-port br0 p3 -- set Interface p3 type=gre options:key=flow \\ - options:remote_ip=flow options:local_ip=flow ofport_request=3 \\ - -- add-port br0 p4 -- set Interface p4 type=gre options:key=3 \\ - options:remote_ip=flow ofport_request=4 \\ - -- add-port br0 p5 -- set Interface p5 type=gre options:key=flow \\ - options:remote_ip=5.5.5.5 ofport_request=5 " -at_fn_check_prepare_notrace 'an embedded newline' "tunnel.at:367" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre options:key=flow \ - options:remote_ip=1.1.1.1 ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=gre options:key=flow \ - options:remote_ip=flow ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=gre options:key=flow \ - options:remote_ip=flow options:local_ip=flow ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=gre options:key=3 \ - options:remote_ip=flow ofport_request=4 \ - -- add-port br0 p5 -- set Interface p5 type=gre options:key=flow \ - options:remote_ip=5.5.5.5 ofport_request=5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p90 -- set Interface p90 type=dummy ofport_request=90 -cat >flows.txt <<'_ATEOF' -in_port=90 actions=resubmit:1,resubmit:2,resubmit:3,resubmit:4,resubmit:5 -in_port=1 actions=set_field:42->tun_id,output:1 -in_port=2 actions=set_field:3.3.3.3->tun_dst,output:2 -in_port=3 actions=set_field:1.1.1.1->tun_src,set_field:4.4.4.4->tun_dst,output:3 -in_port=4 actions=set_field:2.2.2.2->tun_dst,output:4 -in_port=5 actions=set_field:5->tun_id -_ATEOF - -{ set +x -$as_echo "$at_srcdir/tunnel.at:387: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "tunnel.at:387" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:388: ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "tunnel.at:388" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:389: tail -1 stdout" -at_fn_check_prepare_trace "tunnel.at:389" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(tunnel(tun_id=0x2a,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,src=1.1.1.1,dst=4.4.4.4,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,key))),1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:389" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/tunnel.at:392: check_logs " -at_fn_check_prepare_trace "tunnel.at:392" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:392: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "tunnel.at:392" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/tunnel.at:392: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "tunnel.at:392" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/tunnel.at:392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_588 -#AT_START_589 -at_fn_group_banner 589 'lockfile.at:12' \ - "lock and unlock" " " 41 -at_xfail=no -( - $as_echo "589. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:12: ovstest test-lockfile lock_and_unlock" -at_fn_check_prepare_trace "lockfile.at:12" -( $at_check_trace; ovstest test-lockfile lock_and_unlock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_and_unlock: success (0 children) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:12" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:12: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:12" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:12" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_589 -#AT_START_590 -at_fn_group_banner 590 'lockfile.at:14' \ - "lock and unlock twice" " " 41 -at_xfail=no -( - $as_echo "590. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:14: ovstest test-lockfile lock_and_unlock_twice" -at_fn_check_prepare_trace "lockfile.at:14" -( $at_check_trace; ovstest test-lockfile lock_and_unlock_twice -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_and_unlock_twice: success (0 children) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:14" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:14: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:14" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:14" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_590 -#AT_START_591 -at_fn_group_banner 591 'lockfile.at:16' \ - "lock blocks same process" " " 41 -at_xfail=no -( - $as_echo "591. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:16: ovstest test-lockfile lock_blocks_same_process" -at_fn_check_prepare_trace "lockfile.at:16" -( $at_check_trace; ovstest test-lockfile lock_blocks_same_process -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_blocks_same_process: success (0 children) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:16" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:16: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:16" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "lockfile|WARN|.file.~lock~: cannot lock file because this process has already locked it -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:16" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_591 -#AT_START_592 -at_fn_group_banner 592 'lockfile.at:20' \ - "lock blocks same process twice" " " 41 -at_xfail=no -( - $as_echo "592. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:20: ovstest test-lockfile lock_blocks_same_process_twice" -at_fn_check_prepare_trace "lockfile.at:20" -( $at_check_trace; ovstest test-lockfile lock_blocks_same_process_twice -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_blocks_same_process_twice: success (0 children) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:20" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:20: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:20" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "lockfile|WARN|.file.~lock~: cannot lock file because this process has already locked it -lockfile|WARN|.file.~lock~: cannot lock file because this process has already locked it -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:20" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_592 -#AT_START_593 -at_fn_group_banner 593 'lockfile.at:25' \ - "lock blocks other process" " " 41 -at_xfail=no -( - $as_echo "593. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:25: ovstest test-lockfile lock_blocks_other_process" -at_fn_check_prepare_trace "lockfile.at:25" -( $at_check_trace; ovstest test-lockfile lock_blocks_other_process -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_blocks_other_process: success (1 child) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:25" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:25: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:25" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "lockfile|WARN|.file.~lock~: child does not inherit lock -lockfile|WARN|.file.~lock~: cannot lock file because it is already locked by pid -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:25" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_593 -#AT_START_594 -at_fn_group_banner 594 'lockfile.at:30' \ - "lock twice blocks other process" " " 41 -at_xfail=no -( - $as_echo "594. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:30: ovstest test-lockfile lock_twice_blocks_other_process" -at_fn_check_prepare_trace "lockfile.at:30" -( $at_check_trace; ovstest test-lockfile lock_twice_blocks_other_process -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_twice_blocks_other_process: success (1 child) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:30: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:30" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "lockfile|WARN|.file.~lock~: cannot lock file because this process has already locked it -lockfile|WARN|.file.~lock~: child does not inherit lock -lockfile|WARN|.file.~lock~: cannot lock file because it is already locked by pid -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_594 -#AT_START_595 -at_fn_group_banner 595 'lockfile.at:36' \ - "lock and unlock allows other process" " " 41 -at_xfail=no -( - $as_echo "595. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:36: ovstest test-lockfile lock_and_unlock_allows_other_process" -at_fn_check_prepare_trace "lockfile.at:36" -( $at_check_trace; ovstest test-lockfile lock_and_unlock_allows_other_process -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_and_unlock_allows_other_process: success (1 child) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:36" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:36: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:36" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:36" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_595 -#AT_START_596 -at_fn_group_banner 596 'lockfile.at:38' \ - "lock multiple" " " 41 -at_xfail=no -( - $as_echo "596. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:38: ovstest test-lockfile lock_multiple" -at_fn_check_prepare_trace "lockfile.at:38" -( $at_check_trace; ovstest test-lockfile lock_multiple -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_multiple: success (0 children) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:38" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:38: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:38" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "lockfile|WARN|.a.~lock~: cannot lock file because this process has already locked it -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:38" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_596 -#AT_START_597 -at_fn_group_banner 597 'lockfile.at:42' \ - "lock symlink" " " 41 -at_xfail=no -( - $as_echo "597. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:42: ovstest test-lockfile lock_symlink" -at_fn_check_prepare_trace "lockfile.at:42" -( $at_check_trace; ovstest test-lockfile lock_symlink -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_symlink: success (0 children) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:42" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:42: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:42" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "lockfile|WARN|.a.~lock~: cannot lock file because this process has already locked it -lockfile|WARN|.b.~lock~: cannot lock file because this process has already locked it -lockfile|WARN|.b.~lock~: cannot lock file because this process has already locked it -lockfile|WARN|.a.~lock~: cannot lock file because this process has already locked it -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:42" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_597 -#AT_START_598 -at_fn_group_banner 598 'lockfile.at:49' \ - "lock symlink to dir" " " 41 -at_xfail=no -( - $as_echo "598. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/lockfile.at:49: ovstest test-lockfile lock_symlink_to_dir" -at_fn_check_prepare_trace "lockfile.at:49" -( $at_check_trace; ovstest test-lockfile lock_symlink_to_dir -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "lock_symlink_to_dir: success (0 children) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:49" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/lockfile.at:49: sed 's/pid [0-9]*/pid /' stderr" -at_fn_check_prepare_trace "lockfile.at:49" -( $at_check_trace; sed 's/pid [0-9]*/pid /' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "lockfile|WARN|dir/.b.~lock~: cannot lock file because this process has already locked it -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/lockfile.at:49" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_598 -#AT_START_599 -at_fn_group_banner 599 'reconnect.at:26' \ - "nothing happens if not enabled - C" " " 42 -at_xfail=no -( - $as_echo "599. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -run -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:26: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:26" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -run -timeout - no timeout -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:26" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_599 -#AT_START_600 -at_fn_group_banner 600 'reconnect.at:26' \ - "nothing happens if not enabled - Python" " " 42 -at_xfail=no -( - $as_echo "600. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:26" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:26" - - cat >input <<'_ATEOF' -run -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:26: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:26" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -run -timeout - no timeout -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:26" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_600 -#AT_START_601 -at_fn_group_banner 601 'reconnect.at:37' \ - "quick connect, idle disconnect - C" " " 42 -at_xfail=no -( - $as_echo "601. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# Connection succeeds. -run -connected - -# Send inactivity probe. -timeout -run - -# Idle timeout kills connection. -timeout -run -disconnected -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:37: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:37" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Connection succeeds. -run - should connect -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Send inactivity probe. -timeout - advance 5000 ms - -### t=6000 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) - -# Idle timeout kills connection. -timeout - advance 5000 ms - -### t=11000 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11000 ms (0 ms ago) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:37" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_601 -#AT_START_602 -at_fn_group_banner 602 'reconnect.at:37' \ - "quick connect, idle disconnect - Python" " " 42 -at_xfail=no -( - $as_echo "602. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:37" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:37" - - cat >input <<'_ATEOF' -enable - -# Connection succeeds. -run -connected - -# Send inactivity probe. -timeout -run - -# Idle timeout kills connection. -timeout -run -disconnected -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:37: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:37" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Connection succeeds. -run - should connect -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Send inactivity probe. -timeout - advance 5000 ms - -### t=6000 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) - -# Idle timeout kills connection. -timeout - advance 5000 ms - -### t=11000 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11000 ms (0 ms ago) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:37" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_602 -#AT_START_603 -at_fn_group_banner 603 'reconnect.at:93' \ - "slow connect, idle disconnect - C" " " 42 -at_xfail=no -( - $as_echo "603. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# Start connecting. -run -connecting - -# Connect after 500 ms. -advance 500 -run -connected - -# Send inactivity probe. -timeout -run - -# Idle timeout kills connection. -timeout -run -disconnected -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:93: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:93" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Start connecting. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) - -# Connect after 500 ms. -advance 500 - -### t=1500 ### - in CONNECTING for 500 ms (0 ms backoff) -run -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1500 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Send inactivity probe. -timeout - advance 5000 ms - -### t=6500 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) - -# Idle timeout kills connection. -timeout - advance 5000 ms - -### t=11500 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11500 ms (0 ms ago) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:93" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_603 -#AT_START_604 -at_fn_group_banner 604 'reconnect.at:93' \ - "slow connect, idle disconnect - Python" " " 42 -at_xfail=no -( - $as_echo "604. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:93" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:93" - - cat >input <<'_ATEOF' -enable - -# Start connecting. -run -connecting - -# Connect after 500 ms. -advance 500 -run -connected - -# Send inactivity probe. -timeout -run - -# Idle timeout kills connection. -timeout -run -disconnected -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:93: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:93" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Start connecting. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) - -# Connect after 500 ms. -advance 500 - -### t=1500 ### - in CONNECTING for 500 ms (0 ms backoff) -run -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1500 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Send inactivity probe. -timeout - advance 5000 ms - -### t=6500 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) - -# Idle timeout kills connection. -timeout - advance 5000 ms - -### t=11500 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11500 ms (0 ms ago) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:93" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_604 -#AT_START_605 -at_fn_group_banner 605 'reconnect.at:163' \ - "connect backs off - C" " " 42 -at_xfail=no -( - $as_echo "605. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt fails after 2000 ms. -connecting -timeout -run -connect-failed - -# Back off for 4000 ms. -timeout -run - -# Third connection attempt fails after 4000 ms. -connecting -timeout -run -connect-failed - -# Back off for 8000 ms. -timeout -run - -# Third connection attempt fails after 8000 ms. -connecting -timeout -run -connect-failed - -# Back off for 8000 ms. -timeout -run - -# Fourth connection attempt fails after 8000 ms. -connecting -timeout -run -connect-failed -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:163: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:163" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt fails after 2000 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -timeout - advance 2000 ms - -### t=8000 ### - in CONNECTING for 2000 ms (2000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (4000 ms backoff) - 0 successful connections out of 3 attempts, seqno 0 - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=12000 ### - in BACKOFF for 4000 ms (4000 ms backoff) -run - should connect - -# Third connection attempt fails after 4000 ms. -connecting - in CONNECTING for 0 ms (4000 ms backoff) -timeout - advance 4000 ms - -### t=16000 ### - in CONNECTING for 4000 ms (4000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (8000 ms backoff) - 0 successful connections out of 4 attempts, seqno 0 - -# Back off for 8000 ms. -timeout - advance 8000 ms - -### t=24000 ### - in BACKOFF for 8000 ms (8000 ms backoff) -run - should connect - -# Third connection attempt fails after 8000 ms. -connecting - in CONNECTING for 0 ms (8000 ms backoff) -timeout - advance 8000 ms - -### t=32000 ### - in CONNECTING for 8000 ms (8000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (8000 ms backoff) - 0 successful connections out of 5 attempts, seqno 0 - -# Back off for 8000 ms. -timeout - advance 8000 ms - -### t=40000 ### - in BACKOFF for 8000 ms (8000 ms backoff) -run - should connect - -# Fourth connection attempt fails after 8000 ms. -connecting - in CONNECTING for 0 ms (8000 ms backoff) -timeout - advance 8000 ms - -### t=48000 ### - in CONNECTING for 8000 ms (8000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (8000 ms backoff) - 0 successful connections out of 6 attempts, seqno 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:163" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_605 -#AT_START_606 -at_fn_group_banner 606 'reconnect.at:163' \ - "connect backs off - Python" " " 42 -at_xfail=no -( - $as_echo "606. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:163" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:163" - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt fails after 2000 ms. -connecting -timeout -run -connect-failed - -# Back off for 4000 ms. -timeout -run - -# Third connection attempt fails after 4000 ms. -connecting -timeout -run -connect-failed - -# Back off for 8000 ms. -timeout -run - -# Third connection attempt fails after 8000 ms. -connecting -timeout -run -connect-failed - -# Back off for 8000 ms. -timeout -run - -# Fourth connection attempt fails after 8000 ms. -connecting -timeout -run -connect-failed -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:163: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:163" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt fails after 2000 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -timeout - advance 2000 ms - -### t=8000 ### - in CONNECTING for 2000 ms (2000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (4000 ms backoff) - 0 successful connections out of 3 attempts, seqno 0 - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=12000 ### - in BACKOFF for 4000 ms (4000 ms backoff) -run - should connect - -# Third connection attempt fails after 4000 ms. -connecting - in CONNECTING for 0 ms (4000 ms backoff) -timeout - advance 4000 ms - -### t=16000 ### - in CONNECTING for 4000 ms (4000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (8000 ms backoff) - 0 successful connections out of 4 attempts, seqno 0 - -# Back off for 8000 ms. -timeout - advance 8000 ms - -### t=24000 ### - in BACKOFF for 8000 ms (8000 ms backoff) -run - should connect - -# Third connection attempt fails after 8000 ms. -connecting - in CONNECTING for 0 ms (8000 ms backoff) -timeout - advance 8000 ms - -### t=32000 ### - in CONNECTING for 8000 ms (8000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (8000 ms backoff) - 0 successful connections out of 5 attempts, seqno 0 - -# Back off for 8000 ms. -timeout - advance 8000 ms - -### t=40000 ### - in BACKOFF for 8000 ms (8000 ms backoff) -run - should connect - -# Fourth connection attempt fails after 8000 ms. -connecting - in CONNECTING for 0 ms (8000 ms backoff) -timeout - advance 8000 ms - -### t=48000 ### - in CONNECTING for 8000 ms (8000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (8000 ms backoff) - 0 successful connections out of 6 attempts, seqno 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:163" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_606 -#AT_START_607 -at_fn_group_banner 607 'reconnect.at:362' \ - "connections with no data preserve backoff - C" " " 42 -at_xfail=no -( - $as_echo "607. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# First connect, then idle timeout kills connection. -run -connected -timeout -run -timeout -run -disconnected - -# Back off for 1000 ms. -timeout -run - -# Second connect, then idle timeout kills connection. -run -connected -timeout -run -timeout -run -disconnected - -# Back off for 2000 ms. -timeout -run - -# Third connect, then idle timeout kills connection. -run -connected -timeout -run -timeout -run -disconnected - -# Back off for 4000 ms. -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:362: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:362" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connect, then idle timeout kills connection. -run - should connect -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total -timeout - advance 5000 ms - -### t=6000 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) -timeout - advance 5000 ms - -### t=11000 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11000 ms (0 ms ago) - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=12000 ### - in BACKOFF for 1000 ms (1000 ms backoff) - last connected 11000 ms ago, connected 10000 ms total -run - should connect - -# Second connect, then idle timeout kills connection. -run - should connect -connected - in ACTIVE for 0 ms (1000 ms backoff) - created 1000, last activity 1000, last connected 12000 - 2 successful connections out of 2 attempts, seqno 3 - connected - last connected 0 ms ago, connected 10000 ms total -timeout - advance 5000 ms - -### t=17000 ### - in ACTIVE for 5000 ms (1000 ms backoff) -run - should send probe - in IDLE for 0 ms (1000 ms backoff) -timeout - advance 5000 ms - -### t=22000 ### - in IDLE for 5000 ms (1000 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (2000 ms backoff) - 2 successful connections out of 2 attempts, seqno 4 - disconnected - disconnected at 22000 ms (0 ms ago) - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=24000 ### - in BACKOFF for 2000 ms (2000 ms backoff) - last connected 12000 ms ago, connected 20000 ms total -run - should connect - -# Third connect, then idle timeout kills connection. -run - should connect -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 24000 - 3 successful connections out of 3 attempts, seqno 5 - connected - last connected 0 ms ago, connected 20000 ms total -timeout - advance 5000 ms - -### t=29000 ### - in ACTIVE for 5000 ms (2000 ms backoff) -run - should send probe - in IDLE for 0 ms (2000 ms backoff) -timeout - advance 5000 ms - -### t=34000 ### - in IDLE for 5000 ms (2000 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (4000 ms backoff) - 3 successful connections out of 3 attempts, seqno 6 - disconnected - disconnected at 34000 ms (0 ms ago) - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=38000 ### - in BACKOFF for 4000 ms (4000 ms backoff) - last connected 14000 ms ago, connected 30000 ms total -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:362" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_607 -#AT_START_608 -at_fn_group_banner 608 'reconnect.at:362' \ - "connections with no data preserve backoff - Python" "" 42 -at_xfail=no -( - $as_echo "608. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:362" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:362" - - cat >input <<'_ATEOF' -enable - -# First connect, then idle timeout kills connection. -run -connected -timeout -run -timeout -run -disconnected - -# Back off for 1000 ms. -timeout -run - -# Second connect, then idle timeout kills connection. -run -connected -timeout -run -timeout -run -disconnected - -# Back off for 2000 ms. -timeout -run - -# Third connect, then idle timeout kills connection. -run -connected -timeout -run -timeout -run -disconnected - -# Back off for 4000 ms. -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:362: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:362" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connect, then idle timeout kills connection. -run - should connect -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total -timeout - advance 5000 ms - -### t=6000 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) -timeout - advance 5000 ms - -### t=11000 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11000 ms (0 ms ago) - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=12000 ### - in BACKOFF for 1000 ms (1000 ms backoff) - last connected 11000 ms ago, connected 10000 ms total -run - should connect - -# Second connect, then idle timeout kills connection. -run - should connect -connected - in ACTIVE for 0 ms (1000 ms backoff) - created 1000, last activity 1000, last connected 12000 - 2 successful connections out of 2 attempts, seqno 3 - connected - last connected 0 ms ago, connected 10000 ms total -timeout - advance 5000 ms - -### t=17000 ### - in ACTIVE for 5000 ms (1000 ms backoff) -run - should send probe - in IDLE for 0 ms (1000 ms backoff) -timeout - advance 5000 ms - -### t=22000 ### - in IDLE for 5000 ms (1000 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (2000 ms backoff) - 2 successful connections out of 2 attempts, seqno 4 - disconnected - disconnected at 22000 ms (0 ms ago) - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=24000 ### - in BACKOFF for 2000 ms (2000 ms backoff) - last connected 12000 ms ago, connected 20000 ms total -run - should connect - -# Third connect, then idle timeout kills connection. -run - should connect -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 24000 - 3 successful connections out of 3 attempts, seqno 5 - connected - last connected 0 ms ago, connected 20000 ms total -timeout - advance 5000 ms - -### t=29000 ### - in ACTIVE for 5000 ms (2000 ms backoff) -run - should send probe - in IDLE for 0 ms (2000 ms backoff) -timeout - advance 5000 ms - -### t=34000 ### - in IDLE for 5000 ms (2000 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (4000 ms backoff) - 3 successful connections out of 3 attempts, seqno 6 - disconnected - disconnected at 34000 ms (0 ms ago) - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=38000 ### - in BACKOFF for 4000 ms (4000 ms backoff) - last connected 14000 ms ago, connected 30000 ms total -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:362" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_608 -#AT_START_609 -at_fn_group_banner 609 'reconnect.at:526' \ - "brief connection preserves backoff - C" " " 42 -at_xfail=no -( - $as_echo "609. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt succeeds after 500 ms. -connecting -advance 500 -run -connected - -# Connection drops after another 250 ms. -advance 250 -disconnected -run - -# Back off for 4000 ms. -timeout -run -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:526: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:526" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt succeeds after 500 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -advance 500 - -### t=6500 ### - in CONNECTING for 500 ms (2000 ms backoff) -run -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 6500 - 1 successful connections out of 3 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Connection drops after another 250 ms. -advance 250 - -### t=6750 ### - in ACTIVE for 250 ms (2000 ms backoff) -disconnected - in BACKOFF for 0 ms (4000 ms backoff) - 1 successful connections out of 3 attempts, seqno 2 - disconnected - disconnected at 6750 ms (0 ms ago) -run - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=10750 ### - in BACKOFF for 4000 ms (4000 ms backoff) - last connected 4250 ms ago, connected 250 ms total -run - should connect -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:526" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_609 -#AT_START_610 -at_fn_group_banner 610 'reconnect.at:526' \ - "brief connection preserves backoff - Python" " " 42 -at_xfail=no -( - $as_echo "610. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:526" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:526" - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt succeeds after 500 ms. -connecting -advance 500 -run -connected - -# Connection drops after another 250 ms. -advance 250 -disconnected -run - -# Back off for 4000 ms. -timeout -run -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:526: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:526" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt succeeds after 500 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -advance 500 - -### t=6500 ### - in CONNECTING for 500 ms (2000 ms backoff) -run -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 6500 - 1 successful connections out of 3 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Connection drops after another 250 ms. -advance 250 - -### t=6750 ### - in ACTIVE for 250 ms (2000 ms backoff) -disconnected - in BACKOFF for 0 ms (4000 ms backoff) - 1 successful connections out of 3 attempts, seqno 2 - disconnected - disconnected at 6750 ms (0 ms ago) -run - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=10750 ### - in BACKOFF for 4000 ms (4000 ms backoff) - last connected 4250 ms ago, connected 250 ms total -run - should connect -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:526" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_610 -#AT_START_611 -at_fn_group_banner 611 'reconnect.at:657' \ - "brief connection with data preserves backoff - C" "" 42 -at_xfail=no -( - $as_echo "611. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt succeeds after 500 ms. -connecting -advance 500 -run -connected - -# Connection receives 3 chunks of data spaced 250 ms apart. -advance 250 -run -activity -advance 250 -run -activity -advance 250 -run -activity - -# Connection drops. -disconnected -run - -# Back off for 4000 ms. -timeout -run -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:657: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:657" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt succeeds after 500 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -advance 500 - -### t=6500 ### - in CONNECTING for 500 ms (2000 ms backoff) -run -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 6500 - 1 successful connections out of 3 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Connection receives 3 chunks of data spaced 250 ms apart. -advance 250 - -### t=6750 ### - in ACTIVE for 250 ms (2000 ms backoff) -run -activity - created 1000, last activity 6750, last connected 6500 -advance 250 - -### t=7000 ### - in ACTIVE for 500 ms (2000 ms backoff) -run -activity - created 1000, last activity 7000, last connected 6500 -advance 250 - -### t=7250 ### - in ACTIVE for 750 ms (2000 ms backoff) -run -activity - created 1000, last activity 7250, last connected 6500 - -# Connection drops. -disconnected - in BACKOFF for 0 ms (4000 ms backoff) - 1 successful connections out of 3 attempts, seqno 2 - disconnected - disconnected at 7250 ms (0 ms ago) -run - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=11250 ### - in BACKOFF for 4000 ms (4000 ms backoff) - last connected 4750 ms ago, connected 750 ms total -run - should connect -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:657" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_611 -#AT_START_612 -at_fn_group_banner 612 'reconnect.at:657' \ - "brief connection with data preserves backoff - Python" "" 42 -at_xfail=no -( - $as_echo "612. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:657" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:657" - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt succeeds after 500 ms. -connecting -advance 500 -run -connected - -# Connection receives 3 chunks of data spaced 250 ms apart. -advance 250 -run -activity -advance 250 -run -activity -advance 250 -run -activity - -# Connection drops. -disconnected -run - -# Back off for 4000 ms. -timeout -run -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:657: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:657" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt succeeds after 500 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -advance 500 - -### t=6500 ### - in CONNECTING for 500 ms (2000 ms backoff) -run -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 6500 - 1 successful connections out of 3 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Connection receives 3 chunks of data spaced 250 ms apart. -advance 250 - -### t=6750 ### - in ACTIVE for 250 ms (2000 ms backoff) -run -activity - created 1000, last activity 6750, last connected 6500 -advance 250 - -### t=7000 ### - in ACTIVE for 500 ms (2000 ms backoff) -run -activity - created 1000, last activity 7000, last connected 6500 -advance 250 - -### t=7250 ### - in ACTIVE for 750 ms (2000 ms backoff) -run -activity - created 1000, last activity 7250, last connected 6500 - -# Connection drops. -disconnected - in BACKOFF for 0 ms (4000 ms backoff) - 1 successful connections out of 3 attempts, seqno 2 - disconnected - disconnected at 7250 ms (0 ms ago) -run - -# Back off for 4000 ms. -timeout - advance 4000 ms - -### t=11250 ### - in BACKOFF for 4000 ms (4000 ms backoff) - last connected 4750 ms ago, connected 750 ms total -run - should connect -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:657" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_612 -#AT_START_613 -at_fn_group_banner 613 'reconnect.at:818' \ - "long connection resets backoff - C" " " 42 -at_xfail=no -( - $as_echo "613. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt succeeds after 500 ms. -connecting -advance 500 -run -connected - -# Connection receives 3 chunks of data spaced 2000 ms apart. -advance 2000 -run -activity -advance 2000 -run -activity -advance 2000 -run -activity - -# Connection drops. -disconnected -run - -# Back off for 1000 ms. -timeout -run -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:818: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:818" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt succeeds after 500 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -advance 500 - -### t=6500 ### - in CONNECTING for 500 ms (2000 ms backoff) -run -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 6500 - 1 successful connections out of 3 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Connection receives 3 chunks of data spaced 2000 ms apart. -advance 2000 - -### t=8500 ### - in ACTIVE for 2000 ms (2000 ms backoff) -run -activity - created 1000, last activity 8500, last connected 6500 -advance 2000 - -### t=10500 ### - in ACTIVE for 4000 ms (2000 ms backoff) -run -activity - created 1000, last activity 10500, last connected 6500 -advance 2000 - -### t=12500 ### - in ACTIVE for 6000 ms (2000 ms backoff) -run -activity - created 1000, last activity 12500, last connected 6500 - -# Connection drops. -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 3 attempts, seqno 2 - disconnected - disconnected at 12500 ms (0 ms ago) -run - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=13500 ### - in BACKOFF for 1000 ms (1000 ms backoff) - last connected 7000 ms ago, connected 6000 ms total -run - should connect -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:818" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_613 -#AT_START_614 -at_fn_group_banner 614 'reconnect.at:818' \ - "long connection resets backoff - Python" " " 42 -at_xfail=no -( - $as_echo "614. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:818" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:818" - - cat >input <<'_ATEOF' -enable - -# First connection attempt fails after 1000 ms. -run -connecting -run -timeout -run -connect-failed - -# Back off for 1000 ms. -timeout -run - -# Second connection attempt fails after 1000 ms. -connecting -timeout -run -connect-failed - -# Back off for 2000 ms. -timeout -run - -# Third connection attempt succeeds after 500 ms. -connecting -advance 500 -run -connected - -# Connection receives 3 chunks of data spaced 2000 ms apart. -advance 2000 -run -activity -advance 2000 -run -activity -advance 2000 -run -activity - -# Connection drops. -disconnected -run - -# Back off for 1000 ms. -timeout -run -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:818: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:818" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# First connection attempt fails after 1000 ms. -run - should connect -connecting - in CONNECTING for 0 ms (0 ms backoff) -run -timeout - advance 1000 ms - -### t=2000 ### - in CONNECTING for 1000 ms (0 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=3000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect - -# Second connection attempt fails after 1000 ms. -connecting - in CONNECTING for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=4000 ### - in CONNECTING for 1000 ms (1000 ms backoff) -run - should disconnect -connect-failed - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -timeout - advance 2000 ms - -### t=6000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -run - should connect - -# Third connection attempt succeeds after 500 ms. -connecting - in CONNECTING for 0 ms (2000 ms backoff) -advance 500 - -### t=6500 ### - in CONNECTING for 500 ms (2000 ms backoff) -run -connected - in ACTIVE for 0 ms (2000 ms backoff) - created 1000, last activity 1000, last connected 6500 - 1 successful connections out of 3 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Connection receives 3 chunks of data spaced 2000 ms apart. -advance 2000 - -### t=8500 ### - in ACTIVE for 2000 ms (2000 ms backoff) -run -activity - created 1000, last activity 8500, last connected 6500 -advance 2000 - -### t=10500 ### - in ACTIVE for 4000 ms (2000 ms backoff) -run -activity - created 1000, last activity 10500, last connected 6500 -advance 2000 - -### t=12500 ### - in ACTIVE for 6000 ms (2000 ms backoff) -run -activity - created 1000, last activity 12500, last connected 6500 - -# Connection drops. -disconnected - in BACKOFF for 0 ms (1000 ms backoff) - 1 successful connections out of 3 attempts, seqno 2 - disconnected - disconnected at 12500 ms (0 ms ago) -run - -# Back off for 1000 ms. -timeout - advance 1000 ms - -### t=13500 ### - in BACKOFF for 1000 ms (1000 ms backoff) - last connected 7000 ms ago, connected 6000 ms total -run - should connect -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:818" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_614 -#AT_START_615 -at_fn_group_banner 615 'reconnect.at:979' \ - "connection attempt fails quickly - C" " " 42 -at_xfail=no -( - $as_echo "615. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -enable - -# Connection fails quickly. -run -connect-failed ECONNREFUSED - -# Back off for 1000 ms. -run -timeout - -# Connection fails quickly again. -run -connect-failed ECONNREFUSED - -# Back off for 2000 ms. -run -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:979: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:979" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Connection fails quickly. -run - should connect -connect-failed ECONNREFUSED - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -run -timeout - advance 1000 ms - -### t=2000 ### - in BACKOFF for 1000 ms (1000 ms backoff) - -# Connection fails quickly again. -run - should connect -connect-failed ECONNREFUSED - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -run -timeout - advance 2000 ms - -### t=4000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:979" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_615 -#AT_START_616 -at_fn_group_banner 616 'reconnect.at:979' \ - "connection attempt fails quickly - Python" " " 42 -at_xfail=no -( - $as_echo "616. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:979" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:979" - - cat >input <<'_ATEOF' -enable - -# Connection fails quickly. -run -connect-failed ECONNREFUSED - -# Back off for 1000 ms. -run -timeout - -# Connection fails quickly again. -run -connect-failed ECONNREFUSED - -# Back off for 2000 ms. -run -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:979: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:979" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Connection fails quickly. -run - should connect -connect-failed ECONNREFUSED - in BACKOFF for 0 ms (1000 ms backoff) - 0 successful connections out of 1 attempts, seqno 0 - -# Back off for 1000 ms. -run -timeout - advance 1000 ms - -### t=2000 ### - in BACKOFF for 1000 ms (1000 ms backoff) - -# Connection fails quickly again. -run - should connect -connect-failed ECONNREFUSED - in BACKOFF for 0 ms (2000 ms backoff) - 0 successful connections out of 2 attempts, seqno 0 - -# Back off for 2000 ms. -run -timeout - advance 2000 ms - -### t=4000 ### - in BACKOFF for 2000 ms (2000 ms backoff) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:979" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_616 -#AT_START_617 -at_fn_group_banner 617 'reconnect.at:1034' \ - "max-tries of 1 honored - C" " " 42 -at_xfail=no -( - $as_echo "617. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -set-max-tries 1 -enable - -# Connection succeeds. -run -connected - -# Send inactivity probe. -timeout -run - -# Idle timeout kills connection. -timeout -run -disconnected -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:1034: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:1034" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -set-max-tries 1 - 1 tries left -enable - in BACKOFF for 0 ms (0 ms backoff) - 0 tries left - -# Connection succeeds. -run - should connect -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Send inactivity probe. -timeout - advance 5000 ms - -### t=6000 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) - -# Idle timeout kills connection. -timeout - advance 5000 ms - -### t=11000 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in VOID for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11000 ms (0 ms ago) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:1034" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_617 -#AT_START_618 -at_fn_group_banner 618 'reconnect.at:1034' \ - "max-tries of 1 honored - Python" " " 42 -at_xfail=no -( - $as_echo "618. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:1034" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:1034" - - cat >input <<'_ATEOF' -set-max-tries 1 -enable - -# Connection succeeds. -run -connected - -# Send inactivity probe. -timeout -run - -# Idle timeout kills connection. -timeout -run -disconnected -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:1034: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:1034" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -set-max-tries 1 - 1 tries left -enable - in BACKOFF for 0 ms (0 ms backoff) - 0 tries left - -# Connection succeeds. -run - should connect -connected - in ACTIVE for 0 ms (0 ms backoff) - created 1000, last activity 1000, last connected 1000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total - -# Send inactivity probe. -timeout - advance 5000 ms - -### t=6000 ### - in ACTIVE for 5000 ms (0 ms backoff) -run - should send probe - in IDLE for 0 ms (0 ms backoff) - -# Idle timeout kills connection. -timeout - advance 5000 ms - -### t=11000 ### - in IDLE for 5000 ms (0 ms backoff) -run - should disconnect -disconnected - in VOID for 0 ms (1000 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 11000 ms (0 ms ago) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:1034" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_618 -#AT_START_619 -at_fn_group_banner 619 'reconnect.at:1094' \ - "max-tries of 0 honored - C" " " 42 -at_xfail=no -( - $as_echo "619. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -set-max-tries 0 -enable -run -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:1094: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:1094" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -set-max-tries 0 - 0 tries left -enable -run -timeout - no timeout -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:1094" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_619 -#AT_START_620 -at_fn_group_banner 620 'reconnect.at:1094' \ - "max-tries of 0 honored - Python" " " 42 -at_xfail=no -( - $as_echo "620. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:1094" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:1094" - - cat >input <<'_ATEOF' -set-max-tries 0 -enable -run -timeout -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:1094: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:1094" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -set-max-tries 0 - 0 tries left -enable -run -timeout - no timeout -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:1094" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_620 -#AT_START_621 -at_fn_group_banner 621 'reconnect.at:1110' \ - "passive mode - C" " " 42 -at_xfail=no -( - $as_echo "621. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - cat >input <<'_ATEOF' -passive -enable - -# Start listening. -timeout -run -listening - -# Listening never times out. -timeout -run - -# Listening failed (accept() returned funny error?). Back off and try again. -listen-error 0 -timeout -run -listening - -# Connection accepted. -connected -activity -advance 1000 -activity - -# Connection times out. -timeout -run -timeout -run -disconnected - -# Start listening again. -timeout -run -listening -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:1110: ovstest test-reconnect < input" -at_fn_check_prepare_trace "reconnect.at:1110" -( $at_check_trace; ovstest test-reconnect < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -passive -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Start listening. -timeout - advance 0 ms -run - should connect -listening - in LISTENING for 0 ms (0 ms backoff) - -# Listening never times out. -timeout - no timeout -run - -# Listening failed (accept() returned funny error?). Back off and try again. -listen-error 0 - in BACKOFF for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=2000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect -listening - in LISTENING for 0 ms (1000 ms backoff) - -# Connection accepted. -connected - in ACTIVE for 0 ms (1000 ms backoff) - created 1000, last activity 1000, last connected 2000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total -activity - created 1000, last activity 2000, last connected 2000 -advance 1000 - -### t=3000 ### - in ACTIVE for 1000 ms (1000 ms backoff) -activity - created 1000, last activity 3000, last connected 2000 - -# Connection times out. -timeout - advance 5000 ms - -### t=8000 ### - in ACTIVE for 6000 ms (1000 ms backoff) -run - should send probe - in IDLE for 0 ms (1000 ms backoff) -timeout - advance 5000 ms - -### t=13000 ### - in IDLE for 5000 ms (1000 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (0 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 13000 ms (0 ms ago) - -# Start listening again. -timeout - advance 0 ms -run - should connect -listening - in LISTENING for 0 ms (0 ms backoff) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:1110" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_621 -#AT_START_622 -at_fn_group_banner 622 'reconnect.at:1110' \ - "passive mode - Python" " " 42 -at_xfail=no -( - $as_echo "622. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "reconnect.at:1110" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/reconnect.at:1110" - - cat >input <<'_ATEOF' -passive -enable - -# Start listening. -timeout -run -listening - -# Listening never times out. -timeout -run - -# Listening failed (accept() returned funny error?). Back off and try again. -listen-error 0 -timeout -run -listening - -# Connection accepted. -connected -activity -advance 1000 -activity - -# Connection times out. -timeout -run -timeout -run -disconnected - -# Start listening again. -timeout -run -listening -_ATEOF - - { set +x -$as_echo "$at_srcdir/reconnect.at:1110: \$PYTHON \$srcdir/test-reconnect.py < input" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-reconnect.py < input" "reconnect.at:1110" -( $at_check_trace; $PYTHON $srcdir/test-reconnect.py < input -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "### t=1000 ### -passive -enable - in BACKOFF for 0 ms (0 ms backoff) - -# Start listening. -timeout - advance 0 ms -run - should connect -listening - in LISTENING for 0 ms (0 ms backoff) - -# Listening never times out. -timeout - no timeout -run - -# Listening failed (accept() returned funny error?). Back off and try again. -listen-error 0 - in BACKOFF for 0 ms (1000 ms backoff) -timeout - advance 1000 ms - -### t=2000 ### - in BACKOFF for 1000 ms (1000 ms backoff) -run - should connect -listening - in LISTENING for 0 ms (1000 ms backoff) - -# Connection accepted. -connected - in ACTIVE for 0 ms (1000 ms backoff) - created 1000, last activity 1000, last connected 2000 - 1 successful connections out of 1 attempts, seqno 1 - connected - last connected 0 ms ago, connected 0 ms total -activity - created 1000, last activity 2000, last connected 2000 -advance 1000 - -### t=3000 ### - in ACTIVE for 1000 ms (1000 ms backoff) -activity - created 1000, last activity 3000, last connected 2000 - -# Connection times out. -timeout - advance 5000 ms - -### t=8000 ### - in ACTIVE for 6000 ms (1000 ms backoff) -run - should send probe - in IDLE for 0 ms (1000 ms backoff) -timeout - advance 5000 ms - -### t=13000 ### - in IDLE for 5000 ms (1000 ms backoff) -run - should disconnect -disconnected - in BACKOFF for 0 ms (0 ms backoff) - 1 successful connections out of 1 attempts, seqno 2 - disconnected - disconnected at 13000 ms (0 ms ago) - -# Start listening again. -timeout - advance 0 ms -run - should connect -listening - in LISTENING for 0 ms (0 ms backoff) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/reconnect.at:1110" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_622 -#AT_START_623 -at_fn_group_banner 623 'ovs-vswitchd.at:7' \ - "ovs-vswitchd detaches correctly with empty db" " " 43 -at_xfail=no -( - $as_echo "623. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - -touch .conf.db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:16: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vswitchd.at:16" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:16" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:19: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-vswitchd.at:19" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:23: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file" -at_fn_check_prepare_trace "ovs-vswitchd.at:23" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:23" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_623 -#AT_START_624 -at_fn_group_banner 624 'ovs-vswitchd.at:38' \ - "ovs-vswitchd -- stats-update-interval" " " 43 -at_xfail=no -( - $as_echo "624. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:39: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vswitchd.at:39" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:39: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-vswitchd.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:39: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:39" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:39: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-vswitchd.at:39" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:39" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:39: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-vswitchd.at:39" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:39" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:39: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:39" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:39" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:39: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set int p1 type=internal " -at_fn_check_prepare_trace "ovs-vswitchd.at:39" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set int p1 type=internal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:39" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl time/stop - -for i in `seq 0 10`; do ovs-appctl time/warp 1000; done - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:44: ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\\(rx_packets=[0-9][0-9]*\\).*\$/\\1/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vswitchd.at:44" -( $at_check_trace; ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\(rx_packets=[0-9][0-9]*\).*$/\1/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "rx_packets=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:44" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:45: ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ovs-vswitchd.at:45" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:45" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 10`; do ovs-appctl time/warp 1000; done - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:47: ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\\(rx_packets=[0-9][0-9]*\\).*\$/\\1/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vswitchd.at:47" -( $at_check_trace; ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\(rx_packets=[0-9][0-9]*\).*$/\1/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "rx_packets=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:47" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:50: ovs-vsctl set O . other_config:stats-update-interval=100000" -at_fn_check_prepare_trace "ovs-vswitchd.at:50" -( $at_check_trace; ovs-vsctl set O . other_config:stats-update-interval=100000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 50`; do ovs-appctl time/warp 1000; done -for i in `seq 1 5`; do - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:53: ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ovs-vswitchd.at:53" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:53" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:56: ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\\(rx_packets=[0-9][0-9]*\\).*\$/\\1/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vswitchd.at:56" -( $at_check_trace; ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\(rx_packets=[0-9][0-9]*\).*$/\1/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "rx_packets=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:56" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -for i in `seq 0 99`; do ovs-appctl time/warp 1000; done - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:59: ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\\(rx_packets=[0-9][0-9]*\\).*\$/\\1/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vswitchd.at:59" -( $at_check_trace; ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\(rx_packets=[0-9][0-9]*\).*$/\1/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "rx_packets=6 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:59" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:62: ovs-vsctl clear O . other_config" -at_fn_check_prepare_trace "ovs-vswitchd.at:62" -( $at_check_trace; ovs-vsctl clear O . other_config -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:62" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:63: ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ovs-vswitchd.at:63" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:63" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in `seq 0 10`; do ovs-appctl time/warp 1000; done - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:65: ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\\(rx_packets=[0-9][0-9]*\\).*\$/\\1/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vswitchd.at:65" -( $at_check_trace; ovs-vsctl list int p1 | grep statistics | sed -n 's/^.*\(rx_packets=[0-9][0-9]*\).*$/\1/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "rx_packets=7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:65" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:67: check_logs " -at_fn_check_prepare_trace "ovs-vswitchd.at:67" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:67: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-vswitchd.at:67" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:67: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-vswitchd.at:67" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:67" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_624 -#AT_START_625 -at_fn_group_banner 625 'ovs-vswitchd.at:71' \ - "ovs-vswitchd -- start additional ovs-vswitchd process" "" 43 -at_xfail=no -( - $as_echo "625. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:72: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vswitchd.at:72" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:72" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:72: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-vswitchd.at:72" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:72" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:72: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:72" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:72" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:72: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-vswitchd.at:72" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:72: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-vswitchd.at:72" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:72: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:72" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:72: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-vswitchd.at:72" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# start another ovs-vswitchd process. -ovs-vswitchd --log-file=fakelog --unixctl="`pwd`"/unixctl & - -# sleep for a while -sleep 5 - -# stop the process. -ovs-appctl -t `pwd`/unixctl exit - -# check the fakelog, should only see one ERR for reporting -# the existing ovs-vswitchd process. -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:85: test \`grep ERR fakelog | wc -l\` -eq 1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vswitchd.at:85" -( $at_check_trace; test `grep ERR fakelog | wc -l` -eq 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:85" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:87: tail -n1 fakelog | sed -e 's/^.*ERR|//; s/pid [0-9]*//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vswitchd.at:87" -( $at_check_trace; tail -n1 fakelog | sed -e 's/^.*ERR|//; s/pid [0-9]*//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "another ovs-vswitchd process is running, disabling this process () until it goes away -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:87" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:91: check_logs " -at_fn_check_prepare_trace "ovs-vswitchd.at:91" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:91" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:91: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-vswitchd.at:91" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:91" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:91: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-vswitchd.at:91" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:91" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_625 -#AT_START_626 -at_fn_group_banner 626 'ovs-vswitchd.at:95' \ - "ovs-vswitchd -- switch over to another ovs-vswitchd process" "" 43 -at_xfail=no -( - $as_echo "626. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:96: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vswitchd.at:96" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:96: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-vswitchd.at:96" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:96: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:96" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:96: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-vswitchd.at:96" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:96" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:96: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-vswitchd.at:96" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:96" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:96: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:96" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:96" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:96: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-vswitchd.at:96" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:96" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# start a new ovs-vswitchd process. -ovs-vswitchd --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl & - -# sleep for a while. -sleep 5 - -# kill the current active ovs-vswitchd process. -kill `cat ovs-vswitchd.pid` - -sleep 5 - -# check the creation of br0 on the new ovs-vswitchd process. -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:110: grep \"bridge br0\" fakelog | sed -e 's/port [0-9]*\$/port/; -s/datapath ID [a-z0-9]*\$/datapath ID/;s/^.*INFO|//'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:110" -( $at_check_trace; grep "bridge br0" fakelog | sed -e 's/port [0-9]*$/port/; -s/datapath ID [a-z0-9]*$/datapath ID/;s/^.*INFO|//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bridge br0: added interface br0 on port -bridge br0: using datapath ID -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# stop the process. -ovs-appctl -t `pwd`/unixctl exit - -# check the fakelog, should not see WARN/ERR/EMER log other than the one -# for reporting the existing ovs-vswitchd process and the one for killing -# the process. -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:122: sed -n \" -/|ERR|another ovs-vswitchd process is running/d -/|WARN|/p -/|ERR|/p -/|EMER|/p\" fakelog -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:122" -( $at_check_trace; sed -n " -/|ERR|another ovs-vswitchd process is running/d -/|WARN|/p -/|ERR|/p -/|EMER|/p" fakelog - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:122" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# cleanup. -kill `cat ovsdb-server.pid` - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_626 -#AT_START_627 -at_fn_group_banner 627 'ovs-vswitchd.at:134' \ - "ovs-vswitchd -- invalid database path" " " 43 -at_xfail=no -( - $as_echo "627. $at_setup_line: testing $at_desc ..." - $at_traceon - - -# start an ovs-vswitchd process with invalid db path. -ovs-vswitchd unix:invalid.db.sock --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl & - -# sleep for a while. -sleep 10 - -# stop the process. -ovs-appctl -t `pwd`/unixctl exit - -# should not see this log (which indicates high cpu utilization). -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:146: grep \"wakeup due to\" fakelog" -at_fn_check_prepare_trace "ovs-vswitchd.at:146" -( $at_check_trace; grep "wakeup due to" fakelog -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_skip $at_status "$at_srcdir/ovs-vswitchd.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# check the fakelog, should not see any WARN/ERR/EMER log. -{ set +x -$as_echo "$at_srcdir/ovs-vswitchd.at:149: sed -n \" -/|WARN|/p -/|ERR|/p -/|EMER|/p\" fakelog -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vswitchd.at:149" -( $at_check_trace; sed -n " -/|WARN|/p -/|ERR|/p -/|EMER|/p" fakelog - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vswitchd.at:149" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_627 -#AT_START_628 -at_fn_group_banner 628 'ofproto.at:3' \ - "ofproto - echo request" " " 44 -at_xfail=no -( - $as_echo "628. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:4: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:4" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:4: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:4" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:4: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:4" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:4: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:4" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:4: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:4" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:4: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:4" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:4: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:4" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:5: ovs-ofctl -vwarn probe br0" -at_fn_check_prepare_trace "ofproto.at:5" -( $at_check_trace; ovs-ofctl -vwarn probe br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:5" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:6: check_logs " -at_fn_check_prepare_trace "ofproto.at:6" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:6" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:6: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:6" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:6" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:6: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:6" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:6" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_628 -#AT_START_629 -at_fn_group_banner 629 'ofproto.at:9' \ - "ofproto - handling messages with bad version" " " 44 -at_xfail=no -( - $as_echo "629. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:10: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:10" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:10" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:10: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:10" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:10" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:10: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:10" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:10" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:10: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:10" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:10" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:10: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:10" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:10" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:10: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:10" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:10" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:10: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:10" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:10" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor running OpenFlow 1.0, then send the switch an OF1.1 features -# request -{ set +x -$as_echo "$at_srcdir/ofproto.at:14: ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:14" -( $at_check_trace; ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:14" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - -ovs-appctl -t ovs-ofctl ofctl/send 0205000801234567 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:21: sed 's/ (xid=0x[0-9a-fA-F]*)// -/ECHO/d' monitor.log" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:21" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)// -/ECHO/d' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_FEATURES_REQUEST (OF1.1): -OFPT_ERROR (OF1.1): OFPBRC_BAD_VERSION -OFPT_FEATURES_REQUEST (OF1.1): -OFPT_BARRIER_REPLY: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:21" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:29: check_logs \"/received OpenFlow version 0x02 != expected 01/d\"" -at_fn_check_prepare_trace "ofproto.at:29" -( $at_check_trace; check_logs "/received OpenFlow version 0x02 != expected 01/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:29" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:29: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:29" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:29" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:29: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:29" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:29" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_629 -#AT_START_630 -at_fn_group_banner 630 'ofproto.at:32' \ - "ofproto - feature request, config request" " " 44 -at_xfail=no -( - $as_echo "630. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:33: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:33" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:33" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:33: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:33" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:33" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:33: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:33" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:33" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:33: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:33" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:33" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:33: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:33" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:33" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:33: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:33" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:33" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:33: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:33" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:33" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:34: ovs-ofctl -vwarn show br0" -at_fn_check_prepare_trace "ofproto.at:34" -( $at_check_trace; ovs-ofctl -vwarn show br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:34" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:35: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:35" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY: dpid:fedcba9876543210 -n_tables:254, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE - LOCAL(br0): addr:aa:55:aa:55:00:00 - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max -OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:35" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:46: check_logs " -at_fn_check_prepare_trace "ofproto.at:46" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:46" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:46: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:46" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:46" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:46: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:46" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:46" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_630 -#AT_START_631 -at_fn_group_banner 631 'ofproto.at:49' \ - "ofproto - set OpenFlow port number" " " 44 -at_xfail=no -( - $as_echo "631. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:50: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:50" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:50: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:50" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:50: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:50" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:50: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:50" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:50: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:50" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:50: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:50" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:50: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy --\\ - add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99 " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:50" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy --\ - add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:50" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:53: ovs-ofctl -vwarn show br0" -at_fn_check_prepare_trace "ofproto.at:53" -( $at_check_trace; ovs-ofctl -vwarn show br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:53" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:54: sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/00:0.\$/00:0x/' < stdout" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:54" -( $at_check_trace; sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/00:0.$/00:0x/' < stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY: dpid:fedcba9876543210 -n_tables:254, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE - 1(p1): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max - 99(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max - LOCAL(br0): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max -OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:77: check_logs " -at_fn_check_prepare_trace "ofproto.at:77" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:77" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:77: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:77" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:77" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:77: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:77" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:77" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_631 -#AT_START_632 -at_fn_group_banner 632 'ofproto.at:82' \ - "ofproto - port stats - (OpenFlow 1.0)" " " 44 -at_xfail=no -( - $as_echo "632. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:83: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:83" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:83" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:83: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:83" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:83" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:83: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:83" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:83" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:83: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:83" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:83: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:83" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:83: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:83" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:83: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:83" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:84: ovs-ofctl -vwarn dump-ports br0" -at_fn_check_prepare_trace "ofproto.at:84" -( $at_check_trace; ovs-ofctl -vwarn dump-ports br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:84" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:85: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:85" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply: 1 ports - port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=0, bytes=0, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:85" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:90: check_logs " -at_fn_check_prepare_trace "ofproto.at:90" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:90: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:90" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:90: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:90" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_632 -#AT_START_633 -at_fn_group_banner 633 'ofproto.at:93' \ - "ofproto - port stats - (OpenFlow 1.2)" " " 44 -at_xfail=no -( - $as_echo "633. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:94: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:94" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:94: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:94" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:94: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:94" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:94: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:94" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:94" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:94: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:94" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:94" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:94: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:94" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:94" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:94: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:94" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:94" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:95: ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0" -at_fn_check_prepare_trace "ofproto.at:95" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:95" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:96: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:96" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (OF1.2): 1 ports - port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=0, bytes=0, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:96" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:101: check_logs " -at_fn_check_prepare_trace "ofproto.at:101" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:101: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:101" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:101: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:101" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_633 -#AT_START_634 -at_fn_group_banner 634 'ofproto.at:104' \ - "ofproto - port stats - (OpenFlow 1.4)" " " 44 -at_xfail=no -( - $as_echo "634. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:105: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:105" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:105: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:105" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:105: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:105" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:105: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:105" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:105" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:105: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:105" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:105" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:105: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:105" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:105" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:105: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:105" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:105" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:106: ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0" -at_fn_check_prepare_trace "ofproto.at:106" -( $at_check_trace; ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:107: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed 's/duration=[0-9.]*s/duration=?s/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:107" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed 's/duration=[0-9.]*s/duration=?s/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (OF1.4): 1 ports - port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=0, bytes=0, drop=0, errs=0, coll=0 - duration=?s -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:107" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:114: check_logs " -at_fn_check_prepare_trace "ofproto.at:114" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:114: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:114" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:114: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:114" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_634 -#AT_START_635 -at_fn_group_banner 635 'ofproto.at:119' \ - "ofproto - port-desc stats (OpenFlow 1.0)" " " 44 -at_xfail=no -( - $as_echo "635. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:120: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:120" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:120" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:120: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:120" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:120" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:120: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:120" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:120" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:120: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:120" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:120" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:120: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:120" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:120" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:120: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:120" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:120" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:120: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:120" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:120" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:121: ovs-ofctl -vwarn dump-ports-desc br0" -at_fn_check_prepare_trace "ofproto.at:121" -( $at_check_trace; ovs-ofctl -vwarn dump-ports-desc br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:121" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:122: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:122" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC reply: - LOCAL(br0): addr:aa:55:aa:55:00:00 - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:122" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:129: check_logs " -at_fn_check_prepare_trace "ofproto.at:129" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:129" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:129: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:129" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:129" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:129: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:129" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:129" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_635 -#AT_START_636 -at_fn_group_banner 636 'ofproto.at:134' \ - "ofproto - port-desc stats (OpenFlow 1.2)" " " 44 -at_xfail=no -( - $as_echo "636. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:135: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:135" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:135" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:135: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:135" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:135" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:135: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:135" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:135" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:135: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:135" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:135" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:135: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:135" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:135" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:135: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:135" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:135" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:135: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:135" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:135" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:136: ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0" -at_fn_check_prepare_trace "ofproto.at:136" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:136" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:137: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:137" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC reply (OF1.2): - LOCAL(br0): addr:aa:55:aa:55:00:00 - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:137" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:144: check_logs " -at_fn_check_prepare_trace "ofproto.at:144" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:144: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:144" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:144: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:144" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_636 -#AT_START_637 -at_fn_group_banner 637 'ofproto.at:147' \ - "ofproto - port-desc stats (OpenFlow 1.5)" " " 44 -at_xfail=no -( - $as_echo "637. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:148: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:148" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:148" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:148: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:148" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:148" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:148: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:148" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:148" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:148: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:148" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:148: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:148" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:148: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:148" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:148: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:148" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -{ set +x -$as_echo "$at_srcdir/ofproto.at:150: ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0" -at_fn_check_prepare_trace "ofproto.at:150" -( $at_check_trace; ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:150" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:151: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed 's/00:0./00:0x/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:151" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed 's/00:0./00:0x/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC reply (OF1.5): - 1(p1): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max - 2(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max - 3(p3): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max - LOCAL(br0): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:151" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:170: ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2" -at_fn_check_prepare_trace "ofproto.at:170" -( $at_check_trace; ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:170" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:171: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed 's/00:0./00:0x/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:171" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed 's/00:0./00:0x/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT_DESC reply (OF1.5): - 2(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:171" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:178: check_logs " -at_fn_check_prepare_trace "ofproto.at:178" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:178: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:178" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:178: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:178" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:178" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_637 -#AT_START_638 -at_fn_group_banner 638 'ofproto.at:183' \ - "ofproto - queue stats - (OpenFlow 1.0)" " " 44 -at_xfail=no -( - $as_echo "638. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:184: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:184" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:184" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:184: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:184" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:184" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:184: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:184" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:184" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:184: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:184" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:184" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:184: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:184" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:184" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:184: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:184" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:184" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:184: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:184" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:184" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:185: ovs-ofctl -vwarn queue-stats br0" -at_fn_check_prepare_trace "ofproto.at:185" -( $at_check_trace; ovs-ofctl -vwarn queue-stats br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:185" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:186: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:186" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply: 0 queues -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:186" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:189: ovs-ofctl -vwarn queue-stats br0 ANY 5" -at_fn_check_prepare_trace "ofproto.at:189" -( $at_check_trace; ovs-ofctl -vwarn queue-stats br0 ANY 5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x2): OFPQOFC_BAD_QUEUE -OFPST_QUEUE request (xid=0x2):port=ANY queue=5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:189" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:193: ovs-ofctl -vwarn queue-stats br0 10" -at_fn_check_prepare_trace "ofproto.at:193" -( $at_check_trace; ovs-ofctl -vwarn queue-stats br0 10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT -OFPST_QUEUE request (xid=0x2):port=10 queue=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:193" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:197: check_logs " -at_fn_check_prepare_trace "ofproto.at:197" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:197: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:197" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:197: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:197" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_638 -#AT_START_639 -at_fn_group_banner 639 'ofproto.at:200' \ - "ofproto - queue stats - (OpenFlow 1.2)" " " 44 -at_xfail=no -( - $as_echo "639. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:201: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:201" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:201: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:201" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:201: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:201" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:201: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:201" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:201" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:201: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:201" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:201" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:201: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:201" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:201" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:201: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:201" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:201" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:202: ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0" -at_fn_check_prepare_trace "ofproto.at:202" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:203: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:203" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply (OF1.2): 0 queues -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:203" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:206: ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 ALL 5" -at_fn_check_prepare_trace "ofproto.at:206" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 ALL 5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_QUEUE -OFPST_QUEUE request (OF1.2) (xid=0x2):port=ANY queue=5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:206" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:210: ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 10" -at_fn_check_prepare_trace "ofproto.at:210" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT -OFPST_QUEUE request (OF1.2) (xid=0x2):port=10 queue=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:210" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:214: check_logs " -at_fn_check_prepare_trace "ofproto.at:214" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:214" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:214: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:214" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:214" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:214: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:214" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:214" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_639 -#AT_START_640 -at_fn_group_banner 640 'ofproto.at:217' \ - "ofproto - queue stats - (OpenFlow 1.4)" " " 44 -at_xfail=no -( - $as_echo "640. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:218: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:218" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:218: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:218" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:218: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:218" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:218: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:218" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:218: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:218" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:218: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:218" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:218: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:218" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:219: ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0" -at_fn_check_prepare_trace "ofproto.at:219" -( $at_check_trace; ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:219" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:220: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:220" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_QUEUE reply (OF1.4): 0 queues -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:220" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:223: ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 ALL 5" -at_fn_check_prepare_trace "ofproto.at:223" -( $at_check_trace; ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 ALL 5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_QUEUE -OFPST_QUEUE request (OF1.4) (xid=0x2):port=ANY queue=5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:223" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:227: ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 10" -at_fn_check_prepare_trace "ofproto.at:227" -( $at_check_trace; ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_PORT -OFPST_QUEUE request (OF1.4) (xid=0x2):port=10 queue=ALL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:227" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:231: check_logs " -at_fn_check_prepare_trace "ofproto.at:231" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:231: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:231" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:231: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:231" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_640 -#AT_START_641 -at_fn_group_banner 641 'ofproto.at:236' \ - "ofproto - queue configuration - (OpenFlow 1.0)" " " 44 -at_xfail=no -( - $as_echo "641. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:237: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:237" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:237" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:237: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:237" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:237" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:237: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:237" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:237" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:237: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:237" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:237: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:237" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:237: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:237" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:237: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:237" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -{ set +x -$as_echo "$at_srcdir/ofproto.at:239: ovs-ofctl queue-get-config br0 1" -at_fn_check_prepare_trace "ofproto.at:239" -( $at_check_trace; ovs-ofctl queue-get-config br0 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:239" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:240: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:240" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_QUEUE_GET_CONFIG_REPLY: port=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:240" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:243: ovs-ofctl queue-get-config br0 10" -at_fn_check_prepare_trace "ofproto.at:243" -( $at_check_trace; ovs-ofctl queue-get-config br0 10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT -OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:243" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:247: check_logs " -at_fn_check_prepare_trace "ofproto.at:247" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:247" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:247: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:247" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:247" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:247: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:247" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:247" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_641 -#AT_START_642 -at_fn_group_banner 642 'ofproto.at:250' \ - "ofproto - queue configuration - (OpenFlow 1.2)" " " 44 -at_xfail=no -( - $as_echo "642. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:251: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:251" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:251: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:251" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:251: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:251" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:251: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:251" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:251: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:251" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:251: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:251" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:251: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:251" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -{ set +x -$as_echo "$at_srcdir/ofproto.at:253: ovs-ofctl -O OpenFlow12 queue-get-config br0 1" -at_fn_check_prepare_trace "ofproto.at:253" -( $at_check_trace; ovs-ofctl -O OpenFlow12 queue-get-config br0 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:253" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:254: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:254" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:254" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:257: ovs-ofctl -O OpenFlow12 queue-get-config br0 10" -at_fn_check_prepare_trace "ofproto.at:257" -( $at_check_trace; ovs-ofctl -O OpenFlow12 queue-get-config br0 10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT -OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2) (xid=0x2): port=10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:257" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:261: check_logs " -at_fn_check_prepare_trace "ofproto.at:261" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:261: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:261" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:261: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:261" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_642 -#AT_START_643 -at_fn_group_banner 643 'ofproto.at:266' \ - "ofproto - del group" " " 44 -at_xfail=no -( - $as_echo "643. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:267: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:267" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:267" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:267: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:267" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:267" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:267: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:267" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:267" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:267: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:267" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:267" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:267: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:267" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:267" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:267: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:267" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:267" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:267: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:267" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:267" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >groups.txt <<'_ATEOF' -group_id=1234,type=all,bucket=output:10 -group_id=1235,type=all,bucket=output:10 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto.at:272: ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt" -at_fn_check_prepare_trace "ofproto.at:272" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:272" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:273: ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234" -at_fn_check_prepare_trace "ofproto.at:273" -( $at_check_trace; ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:273" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:274: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:274" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC reply (OF1.5): - group_id=1234,type=all,bucket=actions=output:10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:274" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:278: ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234" -at_fn_check_prepare_trace "ofproto.at:278" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:278" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:279: ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0" -at_fn_check_prepare_trace "ofproto.at:279" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:279" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:280: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:280" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC reply (OF1.1): - group_id=1235,type=all,bucket=actions=output:10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:280" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:284: ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234" -at_fn_check_prepare_trace "ofproto.at:284" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:285: ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0" -at_fn_check_prepare_trace "ofproto.at:285" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:285" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:286: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:286" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC reply (OF1.1): - group_id=1235,type=all,bucket=actions=output:10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:290: ovs-ofctl -O OpenFlow11 -vwarn del-groups br0" -at_fn_check_prepare_trace "ofproto.at:290" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:291: ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0" -at_fn_check_prepare_trace "ofproto.at:291" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:291" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:292: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:292" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:292" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:295: check_logs " -at_fn_check_prepare_trace "ofproto.at:295" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:295" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:295: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:295" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:295" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:295: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:295" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:295" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_643 -#AT_START_644 -at_fn_group_banner 644 'ofproto.at:300' \ - "ofproto - del group deletes flows" " " 44 -at_xfail=no -( - $as_echo "644. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:301: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:301" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:301: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:301" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:301: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:301" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:301: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:301" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:301: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:301" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:301: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:301" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:301: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:301" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >groups.txt <<'_ATEOF' -group_id=1234,type=all,bucket=output:10 -group_id=1235,type=all,bucket=output:10 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto.at:306: ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt" -at_fn_check_prepare_trace "ofproto.at:306" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:306" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -cat >flows.txt <<'_ATEOF' -tcp actions=group:1234 -udp actions=group:1235 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto.at:311: ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto.at:311" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:311" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:312: ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:312" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " tcp actions=group:1234 - udp actions=group:1235 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:312" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:318: ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234" -at_fn_check_prepare_trace "ofproto.at:318" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:318" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:319: ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:319" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " udp actions=group:1235 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:324: ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234" -at_fn_check_prepare_trace "ofproto.at:324" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:324" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:325: ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:325" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " udp actions=group:1235 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:325" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:330: ovs-ofctl -O OpenFlow11 -vwarn del-groups br0" -at_fn_check_prepare_trace "ofproto.at:330" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:331: ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:331" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:331" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:335: check_logs " -at_fn_check_prepare_trace "ofproto.at:335" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:335" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:335: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:335" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:335" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:335: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:335" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:335" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_644 -#AT_START_645 -at_fn_group_banner 645 'ofproto.at:340' \ - "ofproto - flow mod checks group availability" " " 44 -at_xfail=no -( - $as_echo "645. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:341: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:341" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:341" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:341: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:341" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:341" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:341: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:341" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:341" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:341: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:341" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:341" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:341: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:341" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:341" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:341: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:341" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:341" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:341: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:341" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:341" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:342: ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10" -at_fn_check_prepare_trace "ofproto.at:342" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -cat >flows.txt <<'_ATEOF' -tcp actions=group:1234 -udp actions=group:1235 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto.at:347: ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'" -at_fn_check_prepare_trace "ofproto.at:347" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:347" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:348: ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'" -at_fn_check_prepare_trace "ofproto.at:348" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto.at:348" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# The output should look like this: -# -# 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................| -# 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................| -# 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................| -# 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............| -# -# This 'sed' command captures the error message but drops details. -{ set +x -$as_echo "$at_srcdir/ofproto.at:358: sed '/truncated/d -/^000000.0/d' stderr | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:358" -( $at_check_trace; sed '/truncated/d -/^000000.0/d' stderr | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP -OFPT_FLOW_MOD (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:358" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:363: check_logs " -at_fn_check_prepare_trace "ofproto.at:363" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:363: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:363" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:363: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:363" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_645 -#AT_START_646 -at_fn_group_banner 646 'ofproto.at:368' \ - "ofproto - group description" " " 44 -at_xfail=no -( - $as_echo "646. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:369: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:369" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:369" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:369: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:369" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:369" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:369: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:369" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:369" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:369: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:369" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:369" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:369: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:369" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:369" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:369: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:369" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:369" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:369: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:369" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:369" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:370: ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10" -at_fn_check_prepare_trace "ofproto.at:370" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:371: ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0" -at_fn_check_prepare_trace "ofproto.at:371" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:371" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:372: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:372" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC reply (OF1.1): - group_id=1234,type=all,bucket=actions=output:10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:372" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:376: check_logs " -at_fn_check_prepare_trace "ofproto.at:376" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:376" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:376: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:376" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:376" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:376: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:376" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:376" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_646 -#AT_START_647 -at_fn_group_banner 647 'ofproto.at:381' \ - "ofproto - group description" " " 44 -at_xfail=no -( - $as_echo "647. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:382: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:382" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:382" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:382: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:382" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:382" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:382: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:382" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:382" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:382: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:382" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:382: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:382" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:382: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:382" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:382: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:382" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:383: ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10" -at_fn_check_prepare_trace "ofproto.at:383" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:383" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:384: ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0" -at_fn_check_prepare_trace "ofproto.at:384" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:384" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:385: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:385" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_DESC reply (OF1.1): - group_id=1234,type=all,bucket=actions=output:10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:385" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:389: check_logs " -at_fn_check_prepare_trace "ofproto.at:389" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:389" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:389: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:389" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:389" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:389: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:389" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:389" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_647 -#AT_START_648 -at_fn_group_banner 648 'ofproto.at:394' \ - "ofproto - group features" " " 44 -at_xfail=no -( - $as_echo "648. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:395: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:395" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:395" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:395: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:395" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:395" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:395: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:395" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:395" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:395: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:395" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:395" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:395: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:395" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:395" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:395: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:395" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:395" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:395: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:395" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:395" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:396: ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0" -at_fn_check_prepare_trace "ofproto.at:396" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:396" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:397: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:397" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_GROUP_FEATURES reply (OF1.2): - Group table: - Types: 0xf - Capabilities: 0x7 - All group : - max_groups = 0xffffff00 actions=0x03ff9801 - Select group : - max_groups = 0xffffff00 actions=0x00000000 - Indirect group : - max_groups = 0xffffff00 actions=0x00000000 - Fast Failover group : - max_groups = 0xffffff00 actions=0x00000000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:397" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:411: check_logs " -at_fn_check_prepare_trace "ofproto.at:411" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:411" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:411: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:411" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:411" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:411: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:411" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:411" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_648 -#AT_START_649 -at_fn_group_banner 649 'ofproto.at:416' \ - "ofproto - group stats" " " 44 -at_xfail=no -( - $as_echo "649. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:417: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:417" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:417" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:417: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:417" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:417" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:417: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:417" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:417" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:417: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:417" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:417: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:417" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:417: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:417" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:417: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:417" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >groups.txt <<'_ATEOF' -group_id=1234,type=all,bucket=output:10 -group_id=1235,type=all,bucket=output:10 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto.at:422: ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt" -at_fn_check_prepare_trace "ofproto.at:422" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:422" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:423: ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'" -at_fn_check_prepare_trace "ofproto.at:423" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:423" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:424: ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234" -at_fn_check_prepare_trace "ofproto.at:424" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:424" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:425: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:425" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 -OFPST_GROUP reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:425" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:429: ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0" -at_fn_check_prepare_trace "ofproto.at:429" -( $at_check_trace; ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:429" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:430: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:430" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 - group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0 -OFPST_GROUP reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:430" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:435: check_logs " -at_fn_check_prepare_trace "ofproto.at:435" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:435" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:435: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:435" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:435" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:435: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:435" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:435" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_649 -#AT_START_650 -at_fn_group_banner 650 'ofproto.at:438' \ - "ofproto - mod-port (OpenFlow 1.0)" " " 44 -at_xfail=no -( - $as_echo "650. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:439: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:439" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:439" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:439: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:439" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:439" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:439: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:439" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:439" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:439: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:439" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:439" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:439: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:439" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:439" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:439: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:439" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:439" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:439: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:439" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:439" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -for command_config_state in \ - 'up 0 0' \ - 'noflood NO_FLOOD 0' \ - 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \ - 'flood PORT_DOWN LINK_DOWN' \ - 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ - 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ - 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ - 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ - 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ - 'up NO_RECV 0' \ - 'receive 0 0' -do - set $command_config_state - command=$1 config=`echo $2 | sed 's/,/ /g'` state=$3 - { set +x -$as_echo "$at_srcdir/ofproto.at:455: ovs-ofctl -vwarn mod-port br0 br0 \$command" -at_fn_check_prepare_dynamic "ovs-ofctl -vwarn mod-port br0 br0 $command" "ofproto.at:455" -( $at_check_trace; ovs-ofctl -vwarn mod-port br0 br0 $command -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:455" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:456: ovs-ofctl -vwarn show br0" -at_fn_check_prepare_trace "ofproto.at:456" -( $at_check_trace; ovs-ofctl -vwarn show br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:456" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:457: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:457" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY: dpid:fedcba9876543210 -n_tables:254, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP -actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE - LOCAL(br0): addr:aa:55:aa:55:00:00 - config: $config - state: $state - speed: 0 Mbps now, 0 Mbps max -OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:457" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:469: check_logs " -at_fn_check_prepare_trace "ofproto.at:469" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:469" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:469: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:469" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:469" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:469: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:469" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:469" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_650 -#AT_START_651 -at_fn_group_banner 651 'ofproto.at:472' \ - "ofproto - mod-port (OpenFlow 1.2)" " " 44 -at_xfail=no -( - $as_echo "651. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:473: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:473" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:473" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:473: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:473" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:473" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:473: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:473" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:473" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:473: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:473" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:473: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:473" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:473: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:473" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:473: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:473" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -for command_config_state in \ - 'up 0 0' \ - 'down PORT_DOWN LINK_DOWN' \ - 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ - 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ - 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ - 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ - 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ - 'up NO_RECV 0' \ - 'receive 0 0' -do - set $command_config_state - command=$1 config=`echo $2 | sed 's/,/ /g'` state=$3 - { set +x -$as_echo "$at_srcdir/ofproto.at:487: ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 \$command" -at_fn_check_prepare_dynamic "ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command" "ofproto.at:487" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:487" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:488: ovs-ofctl -O OpenFlow12 -vwarn show br0" -at_fn_check_prepare_trace "ofproto.at:488" -( $at_check_trace; ovs-ofctl -O OpenFlow12 -vwarn show br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:488" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:489: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:489" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210 -n_tables:254, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS - LOCAL(br0): addr:aa:55:aa:55:00:00 - config: $config - state: $state - speed: 0 Mbps now, 0 Mbps max -OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:489" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:500: check_logs " -at_fn_check_prepare_trace "ofproto.at:500" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:500" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:500: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:500" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:500" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:500: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:500" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:500" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_651 -#AT_START_652 -at_fn_group_banner 652 'ofproto.at:503' \ - "ofproto - mod-port (OpenFlow 1.4)" " " 44 -at_xfail=no -( - $as_echo "652. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:504: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:504" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:504: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:504" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:504: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:504" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:504: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:504" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:504" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:504: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:504" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:504" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:504: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:504" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:504" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:504: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:504" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:504" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -for command_config_state in \ - 'up 0 0' \ - 'down PORT_DOWN LINK_DOWN' \ - 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ - 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ - 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ - 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ - 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ - 'up NO_RECV 0' \ - 'receive 0 0' -do - set $command_config_state - command=$1 config=`echo $2 | sed 's/,/ /g'` state=$3 - { set +x -$as_echo "$at_srcdir/ofproto.at:518: ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 \$command" -at_fn_check_prepare_dynamic "ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command" "ofproto.at:518" -( $at_check_trace; ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:518" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:519: ovs-ofctl -O OpenFlow14 -vwarn show br0" -at_fn_check_prepare_trace "ofproto.at:519" -( $at_check_trace; ovs-ofctl -O OpenFlow14 -vwarn show br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:519" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:520: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout" -at_fn_check_prepare_trace "ofproto.at:520" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210 -n_tables:254, n_buffers:256 -capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS -OFPST_PORT_DESC reply (OF1.4): - LOCAL(br0): addr:aa:55:aa:55:00:00 - config: $config - state: $state - speed: 0 Mbps now, 0 Mbps max -OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:520" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:532: check_logs " -at_fn_check_prepare_trace "ofproto.at:532" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:532" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:532: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:532" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:532" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:532: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:532" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:532" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_652 -#AT_START_653 -at_fn_group_banner 653 'ofproto.at:535' \ - "ofproto - basic flow_mod commands (NXM)" " " 44 -at_xfail=no -( - $as_echo "653. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:536: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:536" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:536" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:536: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:536" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:536" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:536: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:536" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:536" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:536: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:536" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:536: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:536" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:536: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:536" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:536: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:536" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:537: ovs-ofctl dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:537" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:537" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:539: echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:539" -( $at_check_trace; echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:539" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:540: ovs-ofctl add-flow br0 in_port=1,actions=2" -at_fn_check_prepare_trace "ofproto.at:540" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=1,actions=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:540" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:541: ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3" -at_fn_check_prepare_trace "ofproto.at:541" -( $at_check_trace; ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:541" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:542: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:542" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=output:2 - in_port=2 actions=output:1 - table=1, in_port=4 actions=output:3 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:542" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:548: ovs-ofctl dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:548" -( $at_check_trace; ovs-ofctl dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:551: ovs-ofctl del-flows br0" -at_fn_check_prepare_trace "ofproto.at:551" -( $at_check_trace; ovs-ofctl del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:551" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:552: ovs-ofctl dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:552" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:552" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:554: check_logs " -at_fn_check_prepare_trace "ofproto.at:554" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:554" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:554: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:554" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:554" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:554: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:554" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:554" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_653 -#AT_START_654 -at_fn_group_banner 654 'ofproto.at:557' \ - "ofproto - basic flow_mod commands (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "654. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:558: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:558" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:558" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:558: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:558" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:558" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:558: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:558" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:558" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:558: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:558" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:558" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:558: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:558" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:558" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:558: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:558" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:558" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:558: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:558" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:558" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:559: ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:559" -( $at_check_trace; ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:559" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:561: echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:561" -( $at_check_trace; echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:562: ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2" -at_fn_check_prepare_trace "ofproto.at:562" -( $at_check_trace; ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:563: ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3" -at_fn_check_prepare_trace "ofproto.at:563" -( $at_check_trace; ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:563" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:564: ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:564" -( $at_check_trace; ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=output:2 - in_port=2 actions=output:1 - table=1, in_port=4 actions=output:3 -OFPST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:564" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:570: ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:570" -( $at_check_trace; ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:570" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:573: ovs-ofctl -F openflow10 del-flows br0" -at_fn_check_prepare_trace "ofproto.at:573" -( $at_check_trace; ovs-ofctl -F openflow10 del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:573" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:574: ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:574" -( $at_check_trace; ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:576: check_logs " -at_fn_check_prepare_trace "ofproto.at:576" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:576" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:576: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:576" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:576" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:576: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:576" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:576" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_654 -#AT_START_655 -at_fn_group_banner 655 'ofproto.at:579' \ - "ofproto - basic flow_mod commands (OpenFlow 1.1)" "" 44 -at_xfail=no -( - $as_echo "655. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:580: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:580" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:580" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:580: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:580" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:580" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:580: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:580" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:580" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:580: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:580" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:580" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:580: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:580" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:580" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:580: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:580" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:580" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:580: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:580" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:580" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:581: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:581" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:581" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:583: echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:583" -( $at_check_trace; echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:583" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:584: ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2" -at_fn_check_prepare_trace "ofproto.at:584" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:584" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:585: ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3" -at_fn_check_prepare_trace "ofproto.at:585" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:585" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:586: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:586" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=output:2 - in_port=2 actions=output:1 - table=1, in_port=4 actions=output:3 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:586" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:592: ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:592" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:592" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:595: ovs-ofctl -O OpenFlow11 del-flows br0" -at_fn_check_prepare_trace "ofproto.at:595" -( $at_check_trace; ovs-ofctl -O OpenFlow11 del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:596: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:596" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.1): - table=1, in_port=4 actions=output:3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:596" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:599: check_logs " -at_fn_check_prepare_trace "ofproto.at:599" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:599" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:599: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:599" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:599" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:599: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:599" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:599" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_655 -#AT_START_656 -at_fn_group_banner 656 'ofproto.at:602' \ - "ofproto - flow_mod negative test (OpenFlow 1.1)" "" 44 -at_xfail=no -( - $as_echo "656. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:603: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:603" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:603" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:603: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:603" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:603" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:603: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:603" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:603" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:603: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:603" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:603: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:603" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:603: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:603" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:603: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 " -at_fn_check_prepare_trace "ofproto.at:603" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:605: ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2" -at_fn_check_prepare_trace "ofproto.at:605" -( $at_check_trace; ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:605" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# The error message here actually comes from ovs-ofctl, not from ovs-vswitchd, -# but at least it's the same code in ofpacts_check() that issues the error. -{ set +x -$as_echo "$at_srcdir/ofproto.at:609: ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1" -at_fn_check_prepare_trace "ofproto.at:609" -( $at_check_trace; ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto.at:609" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:613: check_logs " -at_fn_check_prepare_trace "ofproto.at:613" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:613" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:613: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:613" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:613" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:613: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:613" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:613" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_656 -#AT_START_657 -at_fn_group_banner 657 'ofproto.at:616' \ - "ofproto - set-field flow_mod commands (NXM)" " " 44 -at_xfail=no -( - $as_echo "657. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:617: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:617" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:617" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:617: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:617" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:617" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:617: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:617" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:617" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:617: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:617" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:617: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:617" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:617: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:617" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:617: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:617" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:618: ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop" -at_fn_check_prepare_trace "ofproto.at:618" -( $at_check_trace; ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:618" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:619: ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\\>ipv6_src" -at_fn_check_prepare_trace "ofproto.at:619" -( $at_check_trace; ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:619" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:620: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:620" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[0..63],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[64..127] -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:620" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:624: check_logs " -at_fn_check_prepare_trace "ofproto.at:624" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:624" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:624: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:624" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:624" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:624: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:624" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:624" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_657 -#AT_START_658 -at_fn_group_banner 658 'ofproto.at:627' \ - "ofproto - basic flow_mod commands (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "658. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:628: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:628" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:628" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:628: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:628" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:628" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:628: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:628" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:628" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:628: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:628" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:628: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:628" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:628: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:628" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:628: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:628" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:629: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:629" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:629" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:631: echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:631" -( $at_check_trace; echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:631" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:632: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2" -at_fn_check_prepare_trace "ofproto.at:632" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:632" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:633: ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3" -at_fn_check_prepare_trace "ofproto.at:633" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:633" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:634: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:634" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=output:2 - in_port=2 actions=output:1 - table=1, in_port=4 actions=output:3 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:634" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:640: ovs-ofctl -O OpenFlow12 del-flows br0" -at_fn_check_prepare_trace "ofproto.at:640" -( $at_check_trace; ovs-ofctl -O OpenFlow12 del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:640" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:641: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:641" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:641" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:643: check_logs " -at_fn_check_prepare_trace "ofproto.at:643" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:643" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:643: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:643" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:643" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:643: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:643" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:643" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_658 -#AT_START_659 -at_fn_group_banner 659 'ofproto.at:646' \ - "ofproto - dump flows with cookie" " " 44 -at_xfail=no -( - $as_echo "659. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:647: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:647" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:647" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:647: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:647" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:647" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:647: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:647" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:647" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:647: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:647" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:647" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:647: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:647" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:647" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:647: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:647" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:647" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:647: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:647" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:647" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:648: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:648" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:648" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:649: ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:649" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:649" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:650: ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:650" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:651: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:651" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, in_port=2 actions=output:1 - cookie=0x3, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:651" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:657: ovs-ofctl dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:657" -( $at_check_trace; ovs-ofctl dump-aggregate br0 table=0 | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:657" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:660: ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:660" -( $at_check_trace; ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x3, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:660" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:664: ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:664" -( $at_check_trace; ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:664" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:667: check_logs " -at_fn_check_prepare_trace "ofproto.at:667" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:667" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:667: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:667" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:667" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:667: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:667" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:667" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_659 -#AT_START_660 -at_fn_group_banner 660 'ofproto.at:670' \ - "ofproto - mod flow with cookie change (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "660. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:671: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:671" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:671" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:671: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:671" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:671" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:671: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:671" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:671" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:671: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:671" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:671" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:671: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:671" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:671" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:671: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:671" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:671" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:671: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:671" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:671" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:672: ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:672" -( $at_check_trace; ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:672" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:673: ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:673" -( $at_check_trace; ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 -OFPST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:673" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:678: ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:678" -( $at_check_trace; ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:678" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:679: ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:679" -( $at_check_trace; ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x2, in_port=1 actions=output:1 -OFPST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:679" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:683: check_logs " -at_fn_check_prepare_trace "ofproto.at:683" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:683: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:683" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:683: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:683" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_660 -#AT_START_661 -at_fn_group_banner 661 'ofproto.at:686' \ - "ofproto - mod flow with cookie change (NXM)" " " 44 -at_xfail=no -( - $as_echo "661. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:687: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:687" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:687: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:687" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:687: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:687" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:687: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:687" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:687: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:687" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:687: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:687" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:687: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:687" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:688: ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:688" -( $at_check_trace; ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:688" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:689: ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:689" -( $at_check_trace; ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:689" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:694: ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:694" -( $at_check_trace; ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:694" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:695: ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:695" -( $at_check_trace; ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x2, in_port=1 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:695" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:699: check_logs " -at_fn_check_prepare_trace "ofproto.at:699" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:699" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:699: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:699" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:699" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:699: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:699" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:699" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_661 -#AT_START_662 -at_fn_group_banner 662 'ofproto.at:702' \ - "ofproto - no mod flow with cookie change (OpenFlow 1.1)" "" 44 -at_xfail=no -( - $as_echo "662. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:703: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:703" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:703" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:703: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:703" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:703" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:703: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:703" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:703" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:703: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:703" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:703" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:703: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:703" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:703" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:703: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:703" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:703" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:703: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:703" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:703" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:704: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:704" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:704" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:705: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:705" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:705" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:709: ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:709" -( $at_check_trace; ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:709" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:710: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:710" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:710" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:714: check_logs " -at_fn_check_prepare_trace "ofproto.at:714" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:714" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:714: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:714" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:714" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:714: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:714" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:714" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_662 -#AT_START_663 -at_fn_group_banner 663 'ofproto.at:718' \ - "ofproto - no mod flow with cookie change (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "663. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:719: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:719" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:719" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:719: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:719" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:719" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:719: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:719" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:719" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:719: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:719" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:719" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:719: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:719" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:719" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:719: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:719" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:719" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:719: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:719" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:719" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:720: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:720" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:720" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:721: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:721" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:721" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:726: ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:726" -( $at_check_trace; ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:726" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:727: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:727" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:727" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:731: check_logs " -at_fn_check_prepare_trace "ofproto.at:731" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:731" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:731: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:731" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:731" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:731: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:731" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:731" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_663 -#AT_START_664 -at_fn_group_banner 664 'ofproto.at:734' \ - "ofproto - mod flows based on cookie mask (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "664. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:735: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:735" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:735" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:735: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:735" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:735" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:735: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:735" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:735" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:735: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:735" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:735" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:735: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:735" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:735" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:735: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:735" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:735" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:735: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:735" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:735" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:736: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:736" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:736" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:737: ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:737" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:737" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:738: ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:738" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:738" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:739: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:739" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x1, in_port=2 actions=output:1 - cookie=0x2, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:739" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:746: ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4" -at_fn_check_prepare_trace "ofproto.at:746" -( $at_check_trace; ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:746" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:747: ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:747" -( $at_check_trace; ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:4 - cookie=0x1, in_port=2 actions=output:4 - cookie=0x2, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:747" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:753: check_logs " -at_fn_check_prepare_trace "ofproto.at:753" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:753" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:753: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:753" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:753" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:753: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:753" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:753" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_664 -#AT_START_665 -at_fn_group_banner 665 'ofproto.at:756' \ - "ofproto - mod flows based on cookie mask (OpenFlow 1.1)" "" 44 -at_xfail=no -( - $as_echo "665. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:757: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:757" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:757" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:757: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:757" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:757" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:757: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:757" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:757" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:757: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:757" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:757" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:757: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:757" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:757" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:757: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:757" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:757" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:757: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:757" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:757" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:758: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:758" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:758" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:759: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:759" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:759" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:760: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:760" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:760" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:761: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:761" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x1, in_port=2 actions=output:1 - cookie=0x2, in_port=3 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:761" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:768: ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4" -at_fn_check_prepare_trace "ofproto.at:768" -( $at_check_trace; ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:768" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:769: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:769" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:4 - cookie=0x1, in_port=2 actions=output:4 - cookie=0x2, in_port=3 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:769" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:775: check_logs " -at_fn_check_prepare_trace "ofproto.at:775" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:775" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:775: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:775" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:775" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:775: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:775" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:775" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_665 -#AT_START_666 -at_fn_group_banner 666 'ofproto.at:778' \ - "ofproto - mod flows based on cookie mask (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "666. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:779: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:779" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:779" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:779: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:779" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:779" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:779: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:779" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:779" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:779: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:779" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:779" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:779: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:779" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:779" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:779: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:779" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:779" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:779: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:779" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:779" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:780: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:780" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:780" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:781: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:781" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:782: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:782" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:782" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:783: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:783" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x1, in_port=2 actions=output:1 - cookie=0x2, in_port=3 actions=output:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:783" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:790: ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4" -at_fn_check_prepare_trace "ofproto.at:790" -( $at_check_trace; ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:790" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:791: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:791" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:4 - cookie=0x1, in_port=2 actions=output:4 - cookie=0x2, in_port=3 actions=output:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:791" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:797: check_logs " -at_fn_check_prepare_trace "ofproto.at:797" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:797" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:797: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:797" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:797" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:797: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:797" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:797" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_666 -#AT_START_667 -at_fn_group_banner 667 'ofproto.at:801' \ - "ofproto - mod flows based on cookie mask with cookie change" "" 44 -at_xfail=no -( - $as_echo "667. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:802: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:802" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:802" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:802: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:802" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:802" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:802: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:802" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:802" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:802: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:802" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:802" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:802: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:802" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:802" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:802: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:802" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:802" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:802: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:802" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:802" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:803: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:803" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:803" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:804: ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:804" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:804" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:805: ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:805" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:805" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:806: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:806" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x1, in_port=2 actions=output:1 - cookie=0x2, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:806" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:813: ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4" -at_fn_check_prepare_trace "ofproto.at:813" -( $at_check_trace; ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:813" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:814: ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:814" -( $at_check_trace; ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x2, in_port=3 actions=output:1 - cookie=0x4, in_port=1 actions=output:4 - cookie=0x4, in_port=2 actions=output:4 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:814" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:820: check_logs " -at_fn_check_prepare_trace "ofproto.at:820" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:820: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:820" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:820: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:820" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_667 -#AT_START_668 -at_fn_group_banner 668 'ofproto.at:823' \ - "ofproto - mod flow with cookie miss (mask==0) - NXM" "" 44 -at_xfail=no -( - $as_echo "668. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:824: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:824" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:824" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:824: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:824" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:824" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:824: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:824" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:824" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:824: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:824" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:824" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:824: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:824" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:824" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:824: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:824" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:824" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:824: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:824" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:824" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:825: ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:825" -( $at_check_trace; ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:825" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:826: ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:826" -( $at_check_trace; ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:826" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:830: check_logs " -at_fn_check_prepare_trace "ofproto.at:830" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:830" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:830: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:830" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:830" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:830: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:830" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:830" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_668 -#AT_START_669 -at_fn_group_banner 669 'ofproto.at:833' \ - "ofproto - mod flow with cookie miss (mask==0) - OF1.1" "" 44 -at_xfail=no -( - $as_echo "669. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:834: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:834" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:834" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:834: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:834" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:834" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:834: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:834" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:834" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:834: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:834" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:834" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:834: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:834" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:834" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:834: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:834" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:834" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:834: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:834" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:834" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:835: ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:835" -( $at_check_trace; ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:835" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:836: ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:836" -( $at_check_trace; ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:836" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:840: check_logs " -at_fn_check_prepare_trace "ofproto.at:840" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:840" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:840: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:840" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:840" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:840: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:840" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:840" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_669 -#AT_START_670 -at_fn_group_banner 670 'ofproto.at:843' \ - "ofproto - mod flow with cookie miss (mask==0) - OF1.2" "" 44 -at_xfail=no -( - $as_echo "670. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:844: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:844" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:844" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:844: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:844" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:844" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:844: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:844" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:844" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:844: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:844" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:844" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:844: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:844" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:844" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:844: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:844" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:844" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:844: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:844" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:844" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:845: ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:845" -( $at_check_trace; ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:845" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:846: ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:846" -( $at_check_trace; ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:846" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:849: check_logs " -at_fn_check_prepare_trace "ofproto.at:849" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:849" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:849: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:849" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:849" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:849: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:849" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:849" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_670 -#AT_START_671 -at_fn_group_banner 671 'ofproto.at:852' \ - "ofproto - mod flow with cookie miss (mask!=0) - NXM" "" 44 -at_xfail=no -( - $as_echo "671. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:853: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:853" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:853" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:853: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:853" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:853" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:853: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:853" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:853" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:853: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:853" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:853" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:853: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:853" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:853" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:853: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:853" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:853" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:853: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:853" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:853" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:854: ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:854" -( $at_check_trace; ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:854" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:855: ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:855" -( $at_check_trace; ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:855" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:858: check_logs " -at_fn_check_prepare_trace "ofproto.at:858" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:858" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:858: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:858" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:858" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:858: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:858" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:858" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_671 -#AT_START_672 -at_fn_group_banner 672 'ofproto.at:861' \ - "ofproto - mod flow with cookie miss (mask!=0) - OF1.1" "" 44 -at_xfail=no -( - $as_echo "672. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:862: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:862" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:862" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:862: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:862" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:862" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:862: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:862" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:862" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:862: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:862" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:862: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:862" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:862: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:862" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:862: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:862" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:863: ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:863" -( $at_check_trace; ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:863" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:864: ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:864" -( $at_check_trace; ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:864" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:867: check_logs " -at_fn_check_prepare_trace "ofproto.at:867" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:867" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:867: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:867" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:867" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:867: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:867" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:867" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_672 -#AT_START_673 -at_fn_group_banner 673 'ofproto.at:870' \ - "ofproto - mod flow with cookie miss (mask!=0) - OF1.2" "" 44 -at_xfail=no -( - $as_echo "673. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:871: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:871" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:871" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:871: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:871" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:871" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:871: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:871" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:871" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:871: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:871" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:871" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:871: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:871" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:871" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:871: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:871" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:871" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:871: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:871" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:871" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:872: ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:872" -( $at_check_trace; ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:872" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:873: ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:873" -( $at_check_trace; ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:873" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:876: check_logs " -at_fn_check_prepare_trace "ofproto.at:876" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:876" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:876: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:876" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:876" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:876: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:876" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:876" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_673 -#AT_START_674 -at_fn_group_banner 674 'ofproto.at:879' \ - "ofproto - del flows with cookies" " " 44 -at_xfail=no -( - $as_echo "674. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:880: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:880" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:880" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:880: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:880" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:880" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:880: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:880" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:880" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:880: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:880" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:880" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:880: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:880" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:880" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:880: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:880" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:880" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:880: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:880" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:880" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:881: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:881" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:881" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:882: ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:882" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:882" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:883: ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:883" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:883" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:884: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:884" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, in_port=2 actions=output:1 - cookie=0x3, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:884" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:891: ovs-ofctl del-flows br0" -at_fn_check_prepare_trace "ofproto.at:891" -( $at_check_trace; ovs-ofctl del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:891" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:892: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:892" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:892" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:895: check_logs " -at_fn_check_prepare_trace "ofproto.at:895" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:895" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:895: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:895" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:895" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:895: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:895" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:895" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_674 -#AT_START_675 -at_fn_group_banner 675 'ofproto.at:898' \ - "ofproto - del flows based on cookie" " " 44 -at_xfail=no -( - $as_echo "675. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:899: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:899" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:899" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:899: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:899" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:899" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:899: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:899" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:899" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:899: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:899" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:899" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:899: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:899" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:899" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:899: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:899" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:899" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:899: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:899" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:899" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:900: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:900" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:900" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:901: ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:901" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:901" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:902: ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:902" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:902" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:903: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:903" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, in_port=2 actions=output:1 - cookie=0x3, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:903" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:910: ovs-ofctl del-flows br0 cookie=0x3/-1" -at_fn_check_prepare_trace "ofproto.at:910" -( $at_check_trace; ovs-ofctl del-flows br0 cookie=0x3/-1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:910" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:911: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:911" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, in_port=2 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:911" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:916: check_logs " -at_fn_check_prepare_trace "ofproto.at:916" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:916" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:916: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:916" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:916" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:916: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:916" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:916" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_675 -#AT_START_676 -at_fn_group_banner 676 'ofproto.at:919' \ - "ofproto - del flows based on cookie mask" " " 44 -at_xfail=no -( - $as_echo "676. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:920: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:920" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:920" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:920: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:920" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:920" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:920: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:920" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:920" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:920: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:920" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:920" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:920: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:920" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:920" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:920: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:920" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:920" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:920: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:920" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:920" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:921: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:921" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:921" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:922: ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1" -at_fn_check_prepare_trace "ofproto.at:922" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:922" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:923: ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1" -at_fn_check_prepare_trace "ofproto.at:923" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:923" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:924: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:924" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, in_port=2 actions=output:1 - cookie=0x3, in_port=3 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:924" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:930: ovs-ofctl del-flows br0 cookie=0x3/0x1" -at_fn_check_prepare_trace "ofproto.at:930" -( $at_check_trace; ovs-ofctl del-flows br0 cookie=0x3/0x1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:930" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:931: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:931" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x2, in_port=2 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:931" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:935: check_logs " -at_fn_check_prepare_trace "ofproto.at:935" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:935" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:935: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:935" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:935" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:935: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:935" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:935" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_676 -#AT_START_677 -at_fn_group_banner 677 'ofproto.at:938' \ - "ofproto - del flows based on table id (NXM)" " " 44 -at_xfail=no -( - $as_echo "677. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:939: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:939" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:939" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:939: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:939" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:939" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:939: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:939" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:939" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:939: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:939" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:939" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:939: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:939" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:939" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:939: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:939" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:939" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:939: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:939" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:939" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:940: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:940" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:940" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:941: ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:941" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:941" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:942: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:942" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, table=1, in_port=2 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:942" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:947: ovs-ofctl del-flows br0 table=0" -at_fn_check_prepare_trace "ofproto.at:947" -( $at_check_trace; ovs-ofctl del-flows br0 table=0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:947" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:948: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:948" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x2, table=1, in_port=2 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:948" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:952: ovs-ofctl del-flows br0 table=1" -at_fn_check_prepare_trace "ofproto.at:952" -( $at_check_trace; ovs-ofctl del-flows br0 table=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:952" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:953: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:953" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:953" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:956: ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:956" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:956" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:957: ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:957" -( $at_check_trace; ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:957" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:958: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:958" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, table=1, in_port=2 actions=output:1 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:958" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:963: ovs-ofctl del-flows br0" -at_fn_check_prepare_trace "ofproto.at:963" -( $at_check_trace; ovs-ofctl del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:963" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:964: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:964" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:964" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:967: check_logs " -at_fn_check_prepare_trace "ofproto.at:967" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:967" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:967: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:967" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:967" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:967: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:967" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:967" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_677 -#AT_START_678 -at_fn_group_banner 678 'ofproto.at:970' \ - "ofproto - del flows based on table id (OpenFlow 1.1)" "" 44 -at_xfail=no -( - $as_echo "678. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:971: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:971" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:971" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:971: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:971" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:971" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:971: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:971" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:971" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:971: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:971" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:971" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:971: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:971" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:971" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:971: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:971" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:971" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:971: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:971" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:971" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:972: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:972" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:972" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:973: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:973" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:973" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:974: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:974" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, table=1, in_port=2 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:974" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:979: ovs-ofctl -O OpenFlow11 del-flows br0 table=0" -at_fn_check_prepare_trace "ofproto.at:979" -( $at_check_trace; ovs-ofctl -O OpenFlow11 del-flows br0 table=0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:979" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:980: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:980" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x2, table=1, in_port=2 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:980" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:984: ovs-ofctl -O OpenFlow11 del-flows br0 table=1" -at_fn_check_prepare_trace "ofproto.at:984" -( $at_check_trace; ovs-ofctl -O OpenFlow11 del-flows br0 table=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:984" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:985: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:985" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:985" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:988: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:988" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:988" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:989: ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:989" -( $at_check_trace; ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:990: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:990" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, table=1, in_port=2 actions=output:1 -OFPST_FLOW reply (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:990" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:995: ovs-ofctl -O OpenFlow11 del-flows br0" -at_fn_check_prepare_trace "ofproto.at:995" -( $at_check_trace; ovs-ofctl -O OpenFlow11 del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:995" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:996: ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:996" -( $at_check_trace; ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.1): - cookie=0x2, table=1, in_port=2 actions=output:1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:996" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1000: check_logs " -at_fn_check_prepare_trace "ofproto.at:1000" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1000" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1000: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1000" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1000" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1000: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1000" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1000" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_678 -#AT_START_679 -at_fn_group_banner 679 'ofproto.at:1003' \ - "ofproto - del flows based on table id (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "679. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1004: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1004" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1004" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1004: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1004" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1004" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1004: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1004" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1004" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1004: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1004" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1004: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1004" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1004: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1004" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1004: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1004" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1005: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:1005" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1005" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1006: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:1006" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1006" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1007: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1007" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, table=1, in_port=2 actions=output:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1007" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1012: ovs-ofctl -O OpenFlow12 del-flows br0 table=0" -at_fn_check_prepare_trace "ofproto.at:1012" -( $at_check_trace; ovs-ofctl -O OpenFlow12 del-flows br0 table=0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1012" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1013: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1013" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x2, table=1, in_port=2 actions=output:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1013" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1017: ovs-ofctl -O OpenFlow12 del-flows br0 table=1" -at_fn_check_prepare_trace "ofproto.at:1017" -( $at_check_trace; ovs-ofctl -O OpenFlow12 del-flows br0 table=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1017" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1018: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1018" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1018" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1021: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:1021" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1021" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1022: ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1" -at_fn_check_prepare_trace "ofproto.at:1022" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1022" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1023: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1023" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, in_port=1 actions=output:1 - cookie=0x2, table=1, in_port=2 actions=output:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1023" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1028: ovs-ofctl -O OpenFlow12 del-flows br0" -at_fn_check_prepare_trace "ofproto.at:1028" -( $at_check_trace; ovs-ofctl -O OpenFlow12 del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1028" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1029: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1029" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1029" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1032: check_logs " -at_fn_check_prepare_trace "ofproto.at:1032" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1032" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1032: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1032" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1032" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1032: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1032" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1032" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_679 -#AT_START_680 -at_fn_group_banner 680 'ofproto.at:1035' \ - "ofproto - flow table configuration (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "680. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1036: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1036" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1036" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1036: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1036" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1036" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1036: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1036" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1036" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1036: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1036" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1036" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1036: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1036" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1036" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1036: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1036" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1036" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1036: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1036" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1036" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check the default configuration. -(echo "OFPST_TABLE reply (xid=0x2): 254 tables - 0: classifier: wild=0x3fffff, max=1000000, active=0 - lookup=0, matched=0" - x=1 - while test $x -lt 254; do - printf " %d: %-8s: wild=0x3fffff, max=1000000, active=0 - lookup=0, matched=0 -" $x table$x - x=`expr $x + 1` - done) > expout -{ set +x -$as_echo "$at_srcdir/ofproto.at:1048: ovs-ofctl dump-tables br0" -at_fn_check_prepare_trace "ofproto.at:1048" -( $at_check_trace; ovs-ofctl dump-tables br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1048" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Change the configuration. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1050: ovs-vsctl \\ - -- --id=@t0 create Flow_Table name=main \\ - -- --id=@t1 create Flow_Table flow-limit=1024 \\ - -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1050" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table name=main \ - -- --id=@t1 create Flow_Table flow-limit=1024 \ - -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -<1> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1050" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check that the configuration was updated. -mv expout orig-expout -(echo "OFPST_TABLE reply (xid=0x2): 254 tables - 0: main : wild=0x3fffff, max=1000000, active=0 - lookup=0, matched=0 - 1: table1 : wild=0x3fffff, max= 1024, active=0 - lookup=0, matched=0" - tail -n +6 orig-expout) > expout -{ set +x -$as_echo "$at_srcdir/ofproto.at:1067: ovs-ofctl dump-tables br0" -at_fn_check_prepare_trace "ofproto.at:1067" -( $at_check_trace; ovs-ofctl dump-tables br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1067" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1068: check_logs " -at_fn_check_prepare_trace "ofproto.at:1068" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1068" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1068: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1068" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1068" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1068: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1068" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1068" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_680 -#AT_START_681 -at_fn_group_banner 681 'ofproto.at:1071' \ - "ofproto - flow table configuration (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "681. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1072: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1072" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1072" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1072: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1072" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1072" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1072: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1072" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1072" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1072: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1072" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1072" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1072: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1072" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1072" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1072: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1072" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1072" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1072: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1072" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1072" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check the default configuration. -(mid="wild=0xfffffffff, max=1000000," - tail=" - lookup=0, matched=0 - match=0xfffffffff, instructions=0x00000007, config=0x00000003 - write_actions=0x00000000, apply_actions=0x00000000 - write_setfields=0x0000000fffffffff - apply_setfields=0x0000000fffffffff - metadata_match=0xffffffffffffffff - metadata_write=0xffffffffffffffff" - echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables - 0: classifier: $mid active=0$tail" - x=1 - while test $x -lt 254; do - printf " %d: %-8s: $mid active=0$tail -" $x table$x - x=`expr $x + 1` - done) > expout -{ set +x -$as_echo "$at_srcdir/ofproto.at:1091: ovs-ofctl -O OpenFlow12 dump-tables br0" -at_fn_check_prepare_trace "ofproto.at:1091" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-tables br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1091" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Change the configuration. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1093: ovs-vsctl \\ - -- --id=@t0 create Flow_Table name=main \\ - -- --id=@t1 create Flow_Table flow-limit=1024 \\ - -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1093" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table name=main \ - -- --id=@t1 create Flow_Table flow-limit=1024 \ - -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -<1> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1093" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check that the configuration was updated. -mv expout orig-expout -(echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables - 0: main : wild=0xfffffffff, max=1000000, active=0" - tail -n +3 orig-expout | head -7 - echo " 1: table1 : wild=0xfffffffff, max= 1024, active=0" - tail -n +11 orig-expout) > expout -{ set +x -$as_echo "$at_srcdir/ofproto.at:1109: ovs-ofctl -O OpenFlow12 dump-tables br0" -at_fn_check_prepare_trace "ofproto.at:1109" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-tables br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1109" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1110: check_logs " -at_fn_check_prepare_trace "ofproto.at:1110" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1110: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1110" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1110: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1110" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_681 -#AT_START_682 -at_fn_group_banner 682 'ofproto.at:1113' \ - "ofproto - hard limits on flow table size (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "682. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1114: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1114" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1114" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1114: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1114" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1114" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1114: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1114" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1114" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1114: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1114" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1114: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1114" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1114: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1114" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1114: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1114" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1114" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1116: ovs-vsctl \\ - -- --id=@t0 create Flow_Table flow-limit=4 \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1116" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table flow-limit=4 \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1116" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Add 4 flows. -for in_port in 1 2 3 4; do - ovs-ofctl add-flow br0 in_port=$in_port,actions=drop -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:1127: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1127" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=drop - in_port=2 actions=drop - in_port=3 actions=drop - in_port=4 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1127" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will be refused. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1135: ovs-ofctl add-flow br0 in_port=5,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1135" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=5,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto.at:1135" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1136: head -n 1 stderr | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1136" -( $at_check_trace; head -n 1 stderr | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR: OFPFMFC_TABLE_FULL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1136" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Also a mod-flow that would add a flow will be refused. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1140: ovs-ofctl mod-flows br0 in_port=5,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1140" -( $at_check_trace; ovs-ofctl mod-flows br0 in_port=5,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto.at:1140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1141: head -n 1 stderr | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1141" -( $at_check_trace; head -n 1 stderr | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR: OFPFMFC_TABLE_FULL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1141" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Replacing or modifying an existing flow is allowed. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1145: ovs-ofctl add-flow br0 in_port=4,actions=normal" -at_fn_check_prepare_trace "ofproto.at:1145" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=4,actions=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1145" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1146: ovs-ofctl mod-flows br0 in_port=3,actions=output:1" -at_fn_check_prepare_trace "ofproto.at:1146" -( $at_check_trace; ovs-ofctl mod-flows br0 in_port=3,actions=output:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1146" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1147: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1147" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=drop - in_port=2 actions=drop - in_port=3 actions=output:1 - in_port=4 actions=NORMAL -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1154: check_logs " -at_fn_check_prepare_trace "ofproto.at:1154" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1154" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1154: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1154" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1154" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1154: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1154" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1154" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_682 -#AT_START_683 -at_fn_group_banner 683 'ofproto.at:1157' \ - "ofproto - hard limits on flow table size (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "683. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1158: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1158" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1158" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1158: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1158" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1158" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1158: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1158" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1158" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1158: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1158" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1158: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1158" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1158: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1158" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1158: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1158" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1158" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1160: ovs-vsctl \\ - -- --id=@t0 create Flow_Table flow-limit=4 \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1160" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table flow-limit=4 \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1160" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Add 4 flows. -for in_port in 1 2 3 4; do - ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:1171: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1171" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=drop - in_port=2 actions=drop - in_port=3 actions=drop - in_port=4 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1171" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will be refused. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1179: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1179" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto.at:1179" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1180: head -n 1 stderr | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1180" -( $at_check_trace; head -n 1 stderr | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1180" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Replacing or modifying an existing flow is allowed. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1184: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal" -at_fn_check_prepare_trace "ofproto.at:1184" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1184" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1185: ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1" -at_fn_check_prepare_trace "ofproto.at:1185" -( $at_check_trace; ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1185" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1186: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1186" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=1 actions=drop - in_port=2 actions=drop - in_port=3 actions=output:1 - in_port=4 actions=NORMAL -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1186" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1193: check_logs " -at_fn_check_prepare_trace "ofproto.at:1193" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1193" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1193: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1193" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1193" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1193: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1193" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1193" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_683 -#AT_START_684 -at_fn_group_banner 684 'ofproto.at:1196' \ - "ofproto - eviction upon table overflow (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "684. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1197: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1197" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1197" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1197: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1197" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1197" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1197: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1197" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1197" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1197: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1197" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1197: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1197" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1197: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1197" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1197: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1197" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1199: ovs-vsctl \\ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1199" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1199" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Add 4 flows. -for in_port in 4 3 2 1; do - ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:1210: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1210" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=1 actions=drop - idle_timeout=20, in_port=2 actions=drop - idle_timeout=30, in_port=3 actions=drop - idle_timeout=40, in_port=4 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1210" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will cause the one that expires soonest to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1218: ovs-ofctl add-flow br0 in_port=5,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1218" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=5,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1219: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1219" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=20, in_port=2 actions=drop - idle_timeout=30, in_port=3 actions=drop - idle_timeout=40, in_port=4 actions=drop - in_port=5 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1219" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# A mod-flow that adds a flow also causes eviction, but replacing or -# modifying an existing flow doesn't. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1228: ovs-ofctl mod-flows br0 in_port=6,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1228" -( $at_check_trace; ovs-ofctl mod-flows br0 in_port=6,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1228" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1229: ovs-ofctl add-flow br0 in_port=4,actions=normal" -at_fn_check_prepare_trace "ofproto.at:1229" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=4,actions=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1229" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1230: ovs-ofctl mod-flows br0 in_port=3,actions=output:1" -at_fn_check_prepare_trace "ofproto.at:1230" -( $at_check_trace; ovs-ofctl mod-flows br0 in_port=3,actions=output:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1230" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1231: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1231" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=30, in_port=3 actions=output:1 - in_port=4 actions=NORMAL - in_port=5 actions=drop - in_port=6 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Flows with no timeouts at all cannot be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1239: ovs-ofctl add-flow br0 in_port=7,actions=normal" -at_fn_check_prepare_trace "ofproto.at:1239" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=7,actions=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1239" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1240: ovs-ofctl add-flow br0 in_port=8,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1240" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=8,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto.at:1240" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1241: head -n 1 stderr | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1241" -( $at_check_trace; head -n 1 stderr | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR: OFPFMFC_TABLE_FULL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1241" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1244: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1244" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=4 actions=NORMAL - in_port=5 actions=drop - in_port=6 actions=drop - in_port=7 actions=NORMAL -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1244" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1251: check_logs " -at_fn_check_prepare_trace "ofproto.at:1251" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1251: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1251" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1251: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1251" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_684 -#AT_START_685 -at_fn_group_banner 685 'ofproto.at:1254' \ - "ofproto - eviction upon table overflow (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "685. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1255: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1255" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1255" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1255: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1255" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1255: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1255" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1255" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1255: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1255" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1255" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1255: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1255" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1255" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1255: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1255" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1255" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1255: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1255" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1255" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1257: ovs-vsctl \\ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1257" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1257" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Add 4 flows. -for in_port in 4 3 2 1; do - ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:1268: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1268" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=1 actions=drop - idle_timeout=20, in_port=2 actions=drop - idle_timeout=30, in_port=3 actions=drop - idle_timeout=40, in_port=4 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1268" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will cause the one that expires soonest to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1276: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1276" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1276" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1277: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1277" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=20, in_port=2 actions=drop - idle_timeout=30, in_port=3 actions=drop - idle_timeout=40, in_port=4 actions=drop - in_port=5 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1277" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# In Open Flow 1.2 a mod-flow does not ever add a flow and thus -# has no effect on eviction -{ set +x -$as_echo "$at_srcdir/ofproto.at:1286: ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1286" -( $at_check_trace; ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1287: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal" -at_fn_check_prepare_trace "ofproto.at:1287" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1287" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1288: ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1" -at_fn_check_prepare_trace "ofproto.at:1288" -( $at_check_trace; ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1288" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1289: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1289" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=20, in_port=2 actions=drop - idle_timeout=30, in_port=3 actions=output:1 - in_port=4 actions=NORMAL - in_port=5 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1289" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Flows with no timeouts at all cannot be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1297: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1297" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1297" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1298: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal" -at_fn_check_prepare_trace "ofproto.at:1298" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1298" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1299: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1299" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto.at:1299" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1300: head -n 1 stderr | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1300" -( $at_check_trace; head -n 1 stderr | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1300" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1303: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1303" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " in_port=4 actions=NORMAL - in_port=5 actions=drop - in_port=6 actions=drop - in_port=7 actions=NORMAL -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1303" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1310: check_logs " -at_fn_check_prepare_trace "ofproto.at:1310" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1310: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1310" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1310: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1310" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_685 -#AT_START_686 -at_fn_group_banner 686 'ofproto.at:1313' \ - "ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "686. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1314: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1314" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1314" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1314: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1314" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1314" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1314: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1314" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1314" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1314: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1314" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1314: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1314" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1314: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1314" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1314: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1314" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1316: ovs-vsctl \\ - -- --id=@t0 create Flow_Table name=evict flow-limit=4 \\ - overflow-policy=evict \\ - groups='\"NXM_OF_IN_PORT[]\"' \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1316" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table name=evict flow-limit=4 \ - overflow-policy=evict \ - groups='"NXM_OF_IN_PORT[]"' \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1316" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Add 4 flows. -ovs-ofctl add-flows br0 - <>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop - idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop - idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1332" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will cause the one that expires soonest within -# the largest group (those with in_port=1) to be evicted. In this -# case this is not the same as the one that expires soonest overall -# (which is what makes the test interesting): -{ set +x -$as_echo "$at_srcdir/ofproto.at:1343: ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1343" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1343" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1344: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1344" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop - idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1344" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Enlarge the flow limit, change the eviction policy back to strictly -# based on expiration, and and add some flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1353: ovs-vsctl set Flow_Table evict groups='[]' flow-limit=7" -at_fn_check_prepare_trace "ofproto.at:1353" -( $at_check_trace; ovs-vsctl set Flow_Table evict groups='[]' flow-limit=7 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1353" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-ofctl add-flows br0 - <>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop - idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop - idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop - idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop - idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1359" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will cause the one that expires soonest overall -# to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1371: ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'" -at_fn_check_prepare_trace "ofproto.at:1371" -( $at_check_trace; ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1371" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1372: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1372" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop - idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop - idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop - idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop - idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1372" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Reducing the flow limit also causes the flows that expire soonest -# overall to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1384: ovs-vsctl set Flow_Table evict flow-limit=4" -at_fn_check_prepare_trace "ofproto.at:1384" -( $at_check_trace; ovs-vsctl set Flow_Table evict flow-limit=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1384" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1385: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1385" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop - idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop - idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1385" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1392: check_logs " -at_fn_check_prepare_trace "ofproto.at:1392" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1392: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1392" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1392: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1392" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_686 -#AT_START_687 -at_fn_group_banner 687 'ofproto.at:1395' \ - "ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "687. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1396: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1396" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1396" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1396: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1396" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1396" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1396: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1396" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1396" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1396: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1396" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1396" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1396: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1396" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1396" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1396: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1396" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1396" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1396: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1396" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1396" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1398: ovs-vsctl \\ - -- --id=@t0 create Flow_Table name=evict flow-limit=4 \\ - overflow-policy=evict \\ - groups='\"NXM_OF_IN_PORT[]\"' \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1398" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table name=evict flow-limit=4 \ - overflow-policy=evict \ - groups='"NXM_OF_IN_PORT[]"' \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1398" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Add 4 flows. -ovs-ofctl -O OpenFlow12 add-flows br0 - <>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop - idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop - idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1414" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will cause the one that expires soonest within -# the largest group (those with in_port=1) to be evicted. In this -# case this is not the same as the one that expires soonest overall -# (which is what makes the test interesting): -{ set +x -$as_echo "$at_srcdir/ofproto.at:1425: ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1425" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1425" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1426: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1426" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop - idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1426" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Enlarge the flow limit, change the eviction policy back to strictly -# based on expiration, and and add some flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1435: ovs-vsctl set Flow_Table evict groups='[]' flow-limit=7" -at_fn_check_prepare_trace "ofproto.at:1435" -( $at_check_trace; ovs-vsctl set Flow_Table evict groups='[]' flow-limit=7 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1435" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-ofctl -O OpenFlow12 add-flows br0 - <>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop - idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop - idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop - idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop - idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1441" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Adding another flow will cause the one that expires soonest overall -# to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1453: ovs-ofctl -O OpenFlow12 add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'" -at_fn_check_prepare_trace "ofproto.at:1453" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1453" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1454: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1454" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop - idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop - idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop - idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop - idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop - idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1454" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Reducing the flow limit also causes the flows that expire soonest -# overall to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1466: ovs-vsctl set Flow_Table evict flow-limit=4" -at_fn_check_prepare_trace "ofproto.at:1466" -( $at_check_trace; ovs-vsctl set Flow_Table evict flow-limit=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1467: ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1467" -( $at_check_trace; ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop - idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop - idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop - in_port=2,dl_src=00:55:66:77:88:99 actions=drop -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1467" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1474: check_logs " -at_fn_check_prepare_trace "ofproto.at:1474" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1474" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1474: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1474" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1474" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1474: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1474" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1474" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_687 -#AT_START_688 -at_fn_group_banner 688 'ofproto.at:1477' \ - "ofproto - eviction upon table overflow, with modified hard timeout" "" 44 -at_xfail=no -( - $as_echo "688. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1478: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1478" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1478" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1478: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1478" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1478" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1478: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1478" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1478" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1478: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1478" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1478" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1478: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1478" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1478" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1478: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1478" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1478" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1478: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1478" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1478" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1480: ovs-vsctl \\ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1480" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1480" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/stop -# Add 4 flows. -for in_port in 4 3 2 1; do - ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:1492: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1492" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " hard_timeout=13, in_port=1 actions=drop - hard_timeout=16, in_port=2 actions=drop - hard_timeout=19, in_port=3 actions=drop - hard_timeout=22, in_port=4 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1492" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Sleep and modify the one that expires soonest -ovs-appctl time/warp 5000 -{ set +x -$as_echo "$at_srcdir/ofproto.at:1501: ovs-ofctl mod-flows br0 in_port=1,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1501" -( $at_check_trace; ovs-ofctl mod-flows br0 in_port=1,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# At this point the table would looks like: -# in_port seconds to expire -# 1 13 -# 2 11 -# 3 14 -# 4 17 -ovs-appctl time/warp 2000 -# Adding another flow will cause the one that expires soonest to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1510: ovs-ofctl add-flow br0 in_port=5,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1510" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=5,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1510" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1511: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1511" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " hard_timeout=13, in_port=1 actions=drop - hard_timeout=19, in_port=3 actions=drop - hard_timeout=22, in_port=4 actions=drop - in_port=5 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1518: check_logs " -at_fn_check_prepare_trace "ofproto.at:1518" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1518" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1518: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1518" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1518" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1518: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1518" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1518" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_688 -#AT_START_689 -at_fn_group_banner 689 'ofproto.at:1521' \ - "ofproto - eviction upon table overflow, with modified idle timeout" "" 44 -at_xfail=no -( - $as_echo "689. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1522: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1522" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1522" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1522: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1522" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1522" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1522: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1522" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1522" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1522: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1522" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1522: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1522" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1522: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1522" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1522: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set interface p1 type=dummy ofport_request=1 " -at_fn_check_prepare_trace "ofproto.at:1522" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set interface p1 type=dummy ofport_request=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Configure a maximum of 4 flows. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1524: ovs-vsctl \\ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \\ - -- set bridge br0 flow_tables:0=@t0 \\ - | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:1524" -( $at_check_trace; ovs-vsctl \ - -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \ - -- set bridge br0 flow_tables:0=@t0 \ - | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1524" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Add 4 flows. -for in_port in 4 3 2 1; do - ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop -done -ovs-appctl time/stop -{ set +x -$as_echo "$at_srcdir/ofproto.at:1536: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1536" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=13, in_port=1 actions=drop - idle_timeout=16, in_port=2 actions=drop - idle_timeout=19, in_port=3 actions=drop - idle_timeout=22, in_port=4 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Sleep and receive on the flow that expires soonest -ovs-appctl time/warp 5000 -{ set +x -$as_echo "$at_srcdir/ofproto.at:1545: ovs-appctl netdev-dummy/receive p1 'in_port(1)'" -at_fn_check_prepare_trace "ofproto.at:1545" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1545" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# At this point the table would looks like: -# in_port seconds to expire -# 1 13 -# 2 11 -# 3 14 -# 4 17 -ovs-appctl time/warp 2000 -# Adding another flow will cause the one that expires soonest to be evicted. -{ set +x -$as_echo "$at_srcdir/ofproto.at:1554: ovs-ofctl add-flow br0 in_port=5,actions=drop" -at_fn_check_prepare_trace "ofproto.at:1554" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=5,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1554" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1555: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1555" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " idle_timeout=19, in_port=3 actions=drop - idle_timeout=22, in_port=4 actions=drop - in_port=5 actions=drop - n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1555" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1562: check_logs " -at_fn_check_prepare_trace "ofproto.at:1562" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1562: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1562" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1562: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1562" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_689 -#AT_START_690 -at_fn_group_banner 690 'ofproto.at:1565' \ - "ofproto - asynchronous message control (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "690. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1566: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1566" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1566" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1566: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1566" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1566" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1566: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1566" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1566" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1566: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1566" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1566" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1566: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1566" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1566" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1566: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1566" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1566" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1566: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1566" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1566" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1567: ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:1567" -( $at_check_trace; ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -check_async () { - printf '\n\n--- check_async %d ---\n\n\n' $1 - shift - - ovs-appctl -t ovs-ofctl ofctl/barrier - ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - : > expout - - # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0) - ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234' - if test X"$1" = X"OFPR_ACTION"; then shift; - echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" - fi - - # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) - ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234' - if test X"$1" = X"OFPR_NO_MATCH"; then shift; - echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" - fi - - # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) - ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' - if test X"$1" = X"OFPR_INVALID_TTL"; then shift; - echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" - fi - - # OFPT_PORT_STATUS, OFPPR_ADD - ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1 - if test X"$1" = X"OFPPR_ADD"; then shift; - echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max" - fi - - # OFPT_PORT_STATUS, OFPPR_DELETE - ovs-vsctl del-port br0 test - if test X"$1" = X"OFPPR_DELETE"; then shift; - echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max" - fi - - # OFPT_FLOW_REMOVED, OFPRR_DELETE - ovs-ofctl add-flow br0 send_flow_rem,actions=drop - ovs-ofctl --strict del-flows br0 '' - if test X"$1" = X"OFPRR_DELETE"; then shift; - echo >>expout "OFPT_FLOW_REMOVED: reason=delete" - fi - $as_echo "ofproto.at:1621" >"$at_check_line_file" -(test X"$1" != X) \ - && at_fn_check_skip 99 "$at_srcdir/ofproto.at:1621" - - ovs-appctl -t ovs-ofctl ofctl/barrier - echo >>expout "OFPT_BARRIER_REPLY:" - - { set +x -$as_echo "$at_srcdir/ofproto.at:1626: sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/ *duration.*// -s/00:0.\$/00:0x/' < monitor.log" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1626" -( $at_check_trace; sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/ *duration.*// -s/00:0.$/00:0x/' < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1626" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -} - -# It's a service connection so initially there should be no async messages. -check_async 1 - -# Set miss_send_len to 128, turning on packet-ins for our service connection. -ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 -check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE - -# Set miss_send_len to 128 and enable invalid_ttl. -ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080 -check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE - -# Become slave, which should disable everything except port status. -ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002 -check_async 4 OFPPR_ADD OFPPR_DELETE - -# Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages. -ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005 -check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE - -# Set controller ID 123. -ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b -check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE - -# Restore controller ID 0. -ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000 - -# Become master. -ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001 -check_async 7 OFPR_ACTION OFPPR_ADD - -ovs-appctl -t ovs-ofctl exit -{ set +x -$as_echo "$at_srcdir/ofproto.at:1665: check_logs " -at_fn_check_prepare_trace "ofproto.at:1665" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1665" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1665: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1665" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1665" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1665: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1665" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1665" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_690 -#AT_START_691 -at_fn_group_banner 691 'ofproto.at:1668' \ - "ofproto - asynchronous message control (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "691. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1669: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1669" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1669" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1669: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1669" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1669" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1669: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1669" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1669" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1669: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1669" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1669" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1669: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1669" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1669" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1669: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1669" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1669" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1669: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1669" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1669" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1670: ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:1670" -( $at_check_trace; ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1670" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -check_async () { - printf '\n\n--- check_async %d ---\n\n\n' $1 - INDEX=$1 - shift - - ovs-appctl -t ovs-ofctl ofctl/barrier - ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - : > expout - - # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0) - ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234' - if test X"$1" = X"OFPR_ACTION"; then shift; - echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" - fi - - # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) - ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' - if test X"$1" = X"OFPR_NO_MATCH"; then shift; - echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" - fi - - # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) - ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' - if test X"$1" = X"OFPR_INVALID_TTL"; then shift; - echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" - fi - - # OFPT_PORT_STATUS, OFPPR_ADD - ovs-vsctl add-port br0 test -- set Interface test type=dummy - if test X"$1" = X"OFPPR_ADD"; then shift; - echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max" - fi - - # OFPT_PORT_STATUS, OFPPR_DELETE - ovs-vsctl del-port br0 test - if test X"$1" = X"OFPPR_DELETE"; then shift; - echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max" - fi - - # OFPT_FLOW_REMOVED, OFPRR_DELETE - ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop - ovs-ofctl -O OpenFlow12 --strict del-flows br0 '' - if test X"$1" = X"OFPRR_DELETE"; then shift; - echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0" - fi - $as_echo "ofproto.at:1725" >"$at_check_line_file" -(test X"$1" != X) \ - && at_fn_check_skip 99 "$at_srcdir/ofproto.at:1725" - - ovs-appctl -t ovs-ofctl ofctl/barrier - echo >>expout "OFPT_BARRIER_REPLY (OF1.2):" - - { set +x -$as_echo "$at_srcdir/ofproto.at:1730: sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/ *duration.*// -s/00:0.\$/00:0x/' < monitor.log" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1730" -( $at_check_trace; sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/ *duration.*// -s/00:0.$/00:0x/' < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1730" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -} - -# It's a service connection so initially there should be no async messages. -check_async 1 - -# Set miss_send_len to 128, turning on packet-ins for our service connection. -ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 -check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE - -# Set miss_send_len to 128 and enable invalid_ttl. -ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080 -check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE - -# Become slave (OF 1.2), which should disable everything except port status. -ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001 -check_async 4 OFPPR_ADD OFPPR_DELETE - -# Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages. -ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005 -check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE - -# Set controller ID 123. -ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b -check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE - -# Restore controller ID 0. -ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000 - -# Become master (OF 1.2). -ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002 -check_async 7 OFPR_ACTION OFPPR_ADD - -ovs-appctl -t ovs-ofctl exit -{ set +x -$as_echo "$at_srcdir/ofproto.at:1769: check_logs " -at_fn_check_prepare_trace "ofproto.at:1769" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1769" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1769: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1769" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1769" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1769: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1769" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1769" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_691 -#AT_START_692 -at_fn_group_banner 692 'ofproto.at:1772' \ - "ofproto - asynchronous message control (OpenFlow 1.3)" "" 44 -at_xfail=no -( - $as_echo "692. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1773: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1773" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1773" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1773: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1773" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1773" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1773: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1773" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1773" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1773: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1773" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1773" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1773: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1773" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1773" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1773: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1773" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1773" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1773: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1773" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1773" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:1774: ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:1774" -( $at_check_trace; ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1774" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -check_async () { - printf '\n\n--- check_async %d ---\n\n\n' $1 - INDEX=$1 - shift - - ovs-appctl -t ovs-ofctl ofctl/barrier - ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - : > expout - - # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0) - ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234' - if test X"$1" = X"OFPR_ACTION"; then shift; - echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" - fi - - # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) - ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' - if test X"$1" = X"OFPR_NO_MATCH"; then shift; - echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234" - fi - - # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) - ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00' - if test X"$1" = X"OFPR_INVALID_TTL"; then shift; - echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d" - fi - - # OFPT_PORT_STATUS, OFPPR_ADD - ovs-vsctl add-port br0 test -- set Interface test type=dummy - if test X"$1" = X"OFPPR_ADD"; then shift; - echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max" - fi - - # OFPT_PORT_STATUS, OFPPR_DELETE - ovs-vsctl del-port br0 test - if test X"$1" = X"OFPPR_DELETE"; then shift; - echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN - speed: 0 Mbps now, 0 Mbps max" - fi - - # OFPT_FLOW_REMOVED, OFPRR_DELETE - ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop - ovs-ofctl -O OpenFlow13 --strict del-flows br0 '' - if test X"$1" = X"OFPRR_DELETE"; then shift; - echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0" - fi - $as_echo "ofproto.at:1829" >"$at_check_line_file" -(test X"$1" != X) \ - && at_fn_check_skip 99 "$at_srcdir/ofproto.at:1829" - - ovs-appctl -t ovs-ofctl ofctl/barrier - echo >>expout "OFPT_BARRIER_REPLY (OF1.3):" - - { set +x -$as_echo "$at_srcdir/ofproto.at:1834: sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/ *duration.*// -s/00:0.\$/00:0x/' < monitor.log" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1834" -( $at_check_trace; sed ' -s/ (xid=0x[0-9a-fA-F]*)// -s/ *duration.*// -s/00:0.$/00:0x/' < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1834" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -} - -# It's a service connection so initially there should be no async messages. -check_async 1 - -# Set miss_send_len to 128, turning on packet-ins for our service connection. -ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080 -check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE - -# Become slave (OF 1.3), which should disable everything except port status. -ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001 -check_async 3 OFPPR_ADD OFPPR_DELETE - -# Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages. -ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005 -check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE - -# Set controller ID 123. -ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b -check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE - -# Restore controller ID 0. -ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000 - -# Become master (OF 1.3). -ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002 -check_async 6 OFPR_ACTION OFPPR_ADD - -ovs-appctl -t ovs-ofctl exit -{ set +x -$as_echo "$at_srcdir/ofproto.at:1869: check_logs " -at_fn_check_prepare_trace "ofproto.at:1869" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1869" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1869: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1869" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1869" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1869: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1869" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1869" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_692 -#AT_START_693 -at_fn_group_banner 693 'ofproto.at:1874' \ - "ofproto - controller role (OpenFlow 1.2)" " " 44 -at_xfail=no -( - $as_echo "693. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1875: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1875" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1875" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1875: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1875" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1875" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1875: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1875" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1875" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1875: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1875" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1875: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1875" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1875: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1875" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1875: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1875" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat c1.pid c2.pid` -EOF - - -# Start two ovs-ofctl controller processes. - - - - - - -for i in 1 2; do - { set +x -$as_echo "$at_srcdir/ofproto.at:1886: ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=\`pwd\`/c\$i.pid --unixctl=\`pwd\`/c\$i" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto.at:1886" -( $at_check_trace; ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1886" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - ovs-appctl -t `pwd`/c$i ofctl/barrier - ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log - : > expout$i - : > experr$i - - # find out current role - ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000 - echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange" - echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal" -done - -# controller 1: Become slave (generation_id is initially undefined, so -# 2^63+2 should not be stale) -ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002 -echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810" -echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810" - -# controller 2: Become master. -ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003 -echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811" -echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811" - -# controller 1: Try to become the master using a stale generation ID -ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003 -echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3" -echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE" -echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3" - -# controller 1: Become master using a valid generation ID -ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001 -echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1" -echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1" - -for i in 1 2; do - ovs-appctl -t `pwd`/c$i ofctl/barrier - echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):" -done - -# Check output. -for i in 1 2; do - cp expout$i expout - { set +x -$as_echo "$at_srcdir/ofproto.at:1928: grep -v '^send:' monitor\$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1928" -( $at_check_trace; grep -v '^send:' monitor$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1928" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - cp experr$i expout - { set +x -$as_echo "$at_srcdir/ofproto.at:1930: grep '^send:' monitor\$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1930" -( $at_check_trace; grep '^send:' monitor$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1930" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:1932: check_logs " -at_fn_check_prepare_trace "ofproto.at:1932" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1932" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1932: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1932" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1932" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1932: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1932" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1932" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_693 -#AT_START_694 -at_fn_group_banner 694 'ofproto.at:1939' \ - "ofproto - controller role (OpenFlow 1.4)" " " 44 -at_xfail=no -( - $as_echo "694. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:1940: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:1940" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1940" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1940: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:1940" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1940" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1940: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1940" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1940" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1940: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:1940" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1940" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1940: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:1940" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1940" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1940: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:1940" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1940" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:1940: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:1940" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1940" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat c1.pid c2.pid` -EOF - - -# Start two ovs-ofctl controller processes. - - - - - - -for i in 1 2; do - { set +x -$as_echo "$at_srcdir/ofproto.at:1951: ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=\`pwd\`/c\$i.pid --unixctl=\`pwd\`/c\$i" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto.at:1951" -( $at_check_trace; ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1951" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - ovs-appctl -t `pwd`/c$i ofctl/barrier - ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log - : > expout$i - : > experr$i - - # find out current role - ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000 - echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange" - echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal" -done - -# controller 1: Become slave (generation_id is initially undefined, so -# 2^63+2 should not be stale) -ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002 -echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810" -echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810" - -# controller 2: Become master. -ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003 -echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811" -echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811" - -# controller 1: Try to become the master using a stale generation ID -ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003 -echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3" -echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE" -echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3" - -# controller 1: Become master using a valid generation ID -ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001 -echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1" -echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1" -echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request" - -for i in 1 2; do - ovs-appctl -t `pwd`/c$i ofctl/barrier - echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):" -done - -# Check output. -for i in 1 2; do - cp expout$i expout - { set +x -$as_echo "$at_srcdir/ofproto.at:1994: grep -v '^send:' monitor\$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1994" -( $at_check_trace; grep -v '^send:' monitor$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1994" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - cp experr$i expout - { set +x -$as_echo "$at_srcdir/ofproto.at:1996: grep '^send:' monitor\$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:1996" -( $at_check_trace; grep '^send:' monitor$i.log | sed 's/ (xid=0x[0-9a-fA-F]*)//' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1996" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:1998: check_logs " -at_fn_check_prepare_trace "ofproto.at:1998" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1998" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1998: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:1998" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1998" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:1998: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:1998" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:1998" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor1.log" \ -"expout1" \ -"experr1" \ -"monitor2.log" \ -"expout2" \ -"experr2" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_694 -#AT_START_695 -at_fn_group_banner 695 'ofproto.at:2005' \ - "ofproto - packet-out from controller (OpenFlow 1.0)" "" 44 -at_xfail=no -( - $as_echo "695. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2006: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2006" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2006" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2006: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2006" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2006" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2006: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2006" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2006" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2006: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2006" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2006" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2006: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2006" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2006" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2006: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2006" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2006" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2006: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2006" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2006" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 - -# Start a monitor listening for packet-ins. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2010: ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:2010" -( $at_check_trace; ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2010" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - - -# Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2017: ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'" -at_fn_check_prepare_trace "ofproto.at:2017" -( $at_check_trace; ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2017" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2018: ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'" -at_fn_check_prepare_trace "ofproto.at:2018" -( $at_check_trace; ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2018" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Stop the monitor and check its output. -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -ovs-ofctl dump-ports br0 - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2026: sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2026" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 -OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 -OFPT_BARRIER_REPLY: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2026" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2034: check_logs " -at_fn_check_prepare_trace "ofproto.at:2034" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2034" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2034: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2034" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2034" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2034: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2034" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2034" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_695 -#AT_START_696 -at_fn_group_banner 696 'ofproto.at:2041' \ - "ofproto - packet-out from controller (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "696. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2042: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2042" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2042" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2042: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2042" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2042" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2042: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2042" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2042" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2042: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2042" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2042" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2042: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2042" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2042" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2042: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2042" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2042" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2042: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2042" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2042" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor listening for packet-ins. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2045: ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:2045" -( $at_check_trace; ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2045" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - - -# Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2052: ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'" -at_fn_check_prepare_trace "ofproto.at:2052" -( $at_check_trace; ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2052" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2053: ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'" -at_fn_check_prepare_trace "ofproto.at:2053" -( $at_check_trace; ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2053" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Stop the monitor and check its output. -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2059: sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2059" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 -OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 -OFPT_BARRIER_REPLY (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2059" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2067: check_logs " -at_fn_check_prepare_trace "ofproto.at:2067" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2067" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2067: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2067" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2067" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2067: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2067" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2067" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_696 -#AT_START_697 -at_fn_group_banner 697 'ofproto.at:2074' \ - "ofproto - packet-out from controller (OpenFlow 1.1)" "" 44 -at_xfail=no -( - $as_echo "697. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2075: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2075" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2075" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2075: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2075" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2075" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2075: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2075" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2075" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2075: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2075" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2075" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2075: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2075" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2075" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2075: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2075" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2075" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2075: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2075" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2075" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor listening for packet-ins. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2078: ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:2078" -( $at_check_trace; ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2078" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - - -# Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2085: ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'" -at_fn_check_prepare_trace "ofproto.at:2085" -( $at_check_trace; ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2085" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2086: ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'" -at_fn_check_prepare_trace "ofproto.at:2086" -( $at_check_trace; ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2086" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Stop the monitor and check its output. -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2092: sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2092" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 -OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678 -OFPT_BARRIER_REPLY (OF1.1): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2092" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2100: check_logs " -at_fn_check_prepare_trace "ofproto.at:2100" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2100: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2100" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2100: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2100" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_697 -#AT_START_698 -at_fn_group_banner 698 'ofproto.at:2105' \ - "ofproto - packet-out with metadata (NXM)" " " 44 -at_xfail=no -( - $as_echo "698. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2106: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2106" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2106" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2106: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2106" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2106" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2106: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2106" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2106" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2106: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2106" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2106: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2106" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2106: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2106" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2106: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2106" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor listening for packet-ins. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2109: ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:2109" -( $at_check_trace; ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2109" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - - -# Send a packet-out with a load action to set some metadata, and forward to controller -{ set +x -$as_echo "$at_srcdir/ofproto.at:2116: ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[0..63]), load(0xaa->NXM_NX_PKT_MARK[]), controller' '0001020304050010203040501234'" -at_fn_check_prepare_trace "ofproto.at:2116" -( $at_check_trace; ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[0..63]), load(0xaa->NXM_NX_PKT_MARK[]), controller' '0001020304050010203040501234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2116" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Stop the monitor and check its output. -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2122: sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2122" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 -OFPT_BARRIER_REPLY: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2122" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2128: check_logs " -at_fn_check_prepare_trace "ofproto.at:2128" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2128" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2128: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2128" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2128" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2128: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2128" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2128" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_698 -#AT_START_699 -at_fn_group_banner 699 'ofproto.at:2133' \ - "ofproto - packet-out with metadata (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "699. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2134: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2134" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2134" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2134: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2134" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2134" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2134: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2134" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2134" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2134: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2134" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2134" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2134: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2134" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2134" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2134: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2134" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2134" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2134: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2134" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2134" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor listening for packet-ins. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2137: ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:2137" -( $at_check_trace; ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2137" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - - -# Send a packet-out with a load action to set some metadata, and forward to controller -{ set +x -$as_echo "$at_srcdir/ofproto.at:2144: ovs-ofctl -O OpenFlow12 packet-out br0 none 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[0..63]), controller' '0001020304050010203040501234'" -at_fn_check_prepare_trace "ofproto.at:2144" -( $at_check_trace; ovs-ofctl -O OpenFlow12 packet-out br0 none 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[0..63]), controller' '0001020304050010203040501234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Stop the monitor and check its output. -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2150: sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2150" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 -OFPT_BARRIER_REPLY (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2150" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2156: check_logs " -at_fn_check_prepare_trace "ofproto.at:2156" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2156: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2156" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2156: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2156" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_699 -#AT_START_700 -at_fn_group_banner 700 'ofproto.at:2160' \ - "ofproto - packet-out with tunnel metadata (OpenFlow 1.2)" "" 44 -at_xfail=no -( - $as_echo "700. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2161: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2161" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2161" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2161: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2161" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2161" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2161: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2161" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2161" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2161: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2161" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2161" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2161: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2161" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2161" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2161: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2161" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2161" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2161: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2161" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2161" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor listening for packet-ins. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2164: ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile" -at_fn_check_prepare_trace "ofproto.at:2164" -( $at_check_trace; ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2164" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log - - -# Send a packet-out with set field actions to set some tunnel metadata, and forward to controller -{ set +x -$as_echo "$at_srcdir/ofproto.at:2171: ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:127.0.0.1->tun_src,set_field:0x01020304->tun_id,set_field:192.168.0.1->tun_dst, controller' '0001020304050010203040501234'" -at_fn_check_prepare_trace "ofproto.at:2171" -( $at_check_trace; ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:127.0.0.1->tun_src,set_field:0x01020304->tun_id,set_field:192.168.0.1->tun_dst, controller' '0001020304050010203040501234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2171" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Stop the monitor and check its output. -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2177: sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2177" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY tun_id=0x1020304 tun_src=127.0.0.1 tun_dst=192.168.0.1 (via action) data_len=14 (unbuffered) -metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234 -OFPT_BARRIER_REPLY (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2177" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2183: check_logs " -at_fn_check_prepare_trace "ofproto.at:2183" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2183" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2183: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2183" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2183" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2183: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2183" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2183" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_700 -#AT_START_701 -at_fn_group_banner 701 'ofproto.at:2186' \ - "ofproto - flow monitoring" " " 44 -at_xfail=no -( - $as_echo "701. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2188: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2188" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2188" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2188: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2188" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2188: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2188" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2188" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2188: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2188" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2188" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2188: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2188" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2188" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2188: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2188" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2188" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2188: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2188" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2188" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1 - -# Start a monitor watching the flow table and check the initial reply. -ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1 - -ovs-appctl -t ovs-ofctl ofctl/barrier -{ set +x -$as_echo "$at_srcdir/ofproto.at:2196: sed 's/ (xid=0x[1-9a-fA-F][0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2196" -( $at_check_trace; sed 's/ (xid=0x[1-9a-fA-F][0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW_MONITOR reply: - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1 -OFPT_BARRIER_REPLY: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2196" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Add, delete, and modify some flows and check the updates. -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log -ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19 -ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20 -ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21 -ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22 -ovs-ofctl add-flow br0 in_port=0,actions=output:23 -ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3 -ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3 -ovs-ofctl del-flows br0 dl_vlan=123 -ovs-ofctl del-flows br0 -ovs-appctl -t ovs-ofctl ofctl/barrier -sort=' - # Sorts groups of lines that start with a space, without moving them - # past the nearest line that does not start with a space. - use warnings; - use strict; - my @buffer = (); - while () { - if (/^ /) { - push(@buffer, $_); - } else { - print $_ foreach sort(@buffer); - print $_; - @buffer = (); - } - } - print $_ foreach sort(@buffer); -' -{ set +x -$as_echo "$at_srcdir/ofproto.at:2246: sed 's/ (xid=0x[1-9a-fA-F][0-9a-fA-F]*)//' monitor.log | \${PERL} -e \"\$sort\"" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ofproto.at:2246" -( $at_check_trace; sed 's/ (xid=0x[1-9a-fA-F][0-9a-fA-F]*)//' monitor.log | ${PERL} -e "$sort" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=0 actions=output:23 -NXST_FLOW_MONITOR reply (xid=0x0): - event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3 - event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3 - event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3 -NXST_FLOW_MONITOR reply (xid=0x0): - event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3 - event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3 - event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3 -NXST_FLOW_MONITOR reply (xid=0x0): - event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3 - event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3 - event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3 -NXST_FLOW_MONITOR reply (xid=0x0): - event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21 - event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22 - event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11 -OFPT_BARRIER_REPLY: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2246" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Check that our own changes are reported as abbreviations. -ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log -ovs-ofctl add-flow br0 in_port=1,actions=output:2 -ovs-ofctl add-flow br0 in_port=2,actions=output:1 -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000 -ovs-appctl -t ovs-ofctl ofctl/barrier -{ set +x -$as_echo "$at_srcdir/ofproto.at:2321: ovs-ofctl dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto.at:2321" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2323: sed 's/ (xid=0x[1-9a-fA-F][0-9a-fA-F]*)//' monitor.log" -at_fn_check_prepare_trace "ofproto.at:2323" -( $at_check_trace; sed 's/ (xid=0x[1-9a-fA-F][0-9a-fA-F]*)//' monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=1 actions=output:2 -NXST_FLOW_MONITOR reply (xid=0x0): - event=ADDED table=0 cookie=0 in_port=2 actions=output:1 -OFPT_BARRIER_REPLY: -send: OFPT_FLOW_MOD: DEL priority=0 actions=drop -NXST_FLOW_MONITOR reply (xid=0x0): - event=ABBREV xid=0x12345678 -OFPT_BARRIER_REPLY: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2323" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -ovs-appctl -t ovs-ofctl exit -{ set +x -$as_echo "$at_srcdir/ofproto.at:2336: check_logs " -at_fn_check_prepare_trace "ofproto.at:2336" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2336: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2336" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2336: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2336" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_701 -#AT_START_702 -at_fn_group_banner 702 'ofproto.at:2339' \ - "ofproto - flow monitoring pause and resume" " " 44 -at_xfail=no -( - $as_echo "702. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -# The maximum socket receive buffer size is important for this test, which -# tests behavior when the receive buffer overflows. -if test -e /proc/sys/net/core/rmem_max; then - # Linux - rmem_max=`cat /proc/sys/net/core/rmem_max` -elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then - : # FreeBSD, NetBSD -else - # Don't know how to get maximum socket receive buffer on this OS - $as_echo "ofproto.at:2351" >"$at_check_line_file" -at_fn_check_skip 77 "$at_srcdir/ofproto.at:2351" -fi -# Calculate the total amount of queuing: rmem_max in the kernel, 128 kB -# in ofproto sending userspace (see ofmonitor_flush() in connmgr.c). -queue_size=`expr $rmem_max + 128 \* 1024` -echo rmem_max=$rmem_max queue_size=$queue_size - -# If there's too much queuing skip the test to avoid timing out. -$as_echo "ofproto.at:2359" >"$at_check_line_file" -(test $rmem_max -gt 1048576) \ - && at_fn_check_skip 77 "$at_srcdir/ofproto.at:2359" - -# Each flow update message takes up at least 48 bytes of space in queues -# and in practice more than that. -n_msgs=`expr $queue_size / 48` -echo n_msgs=$n_msgs - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2366: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2366" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2366" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2366: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2366" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2366" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2366: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2366" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2366" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2366: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2366" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2366: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2366" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2366: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2366" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2366: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2366" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor watching the flow table, then make it block. -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - -ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1 - -ovs-appctl -t ovs-ofctl ofctl/block - -# Add $n_msgs flows. -(echo "in_port=2,actions=output:2" -${PERL} -e ' - for ($i = 0; $i < '$n_msgs'; $i++) { - print "cookie=1,reg1=$i,actions=drop\n"; - } -') > flows.txt -{ set +x -$as_echo "$at_srcdir/ofproto.at:2381: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto.at:2381" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2381" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -# Check that multipart flow dumps work properly: -{ set +x -$as_echo "$at_srcdir/ofproto.at:2383: ovs-ofctl diff-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto.at:2383" -( $at_check_trace; ovs-ofctl diff-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2383" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2384: ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop" -at_fn_check_prepare_trace "ofproto.at:2384" -( $at_check_trace; ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2384" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2385: ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2" -at_fn_check_prepare_trace "ofproto.at:2385" -( $at_check_trace; ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2385" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2386: ovs-ofctl del-flows br0 cookie=1/-1" -at_fn_check_prepare_trace "ofproto.at:2386" -( $at_check_trace; ovs-ofctl del-flows br0 cookie=1/-1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -ovs-appctl -t ovs-ofctl ofctl/unblock - -# Wait for the connection resumed. -# A barrier doesn't work for this purpose. -# https://www.mail-archive.com/dev@openvswitch.org/msg27013.html -# https://www.mail-archive.com/dev@openvswitch.org/msg27675.html -{ set +x -$as_echo "$at_srcdir/ofproto.at:2394: ovs_wait_cond () { grep NXT_FLOW_MONITOR_RESUMED monitor.log -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2394" -( $at_check_trace; ovs_wait_cond () { grep NXT_FLOW_MONITOR_RESUMED monitor.log -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2394" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -ovs-appctl -t ovs-ofctl exit - -# Check that the flow monitor reported the same number of flows -# added and deleted, but fewer than we actually added and deleted. -adds=`grep -c 'ADDED.*reg1=' monitor.log` -deletes=`grep -c 'DELETED.*reg1=' monitor.log` -echo adds=$adds deletes=$deletes -{ set +x -$as_echo "$at_srcdir/ofproto.at:2403: test \$adds -gt 100 && test \$adds -lt \$n_msgs" -at_fn_check_prepare_dynamic "test $adds -gt 100 && test $adds -lt $n_msgs" "ofproto.at:2403" -( $at_check_trace; test $adds -gt 100 && test $adds -lt $n_msgs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2403" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2404: test \$adds = \$deletes" -at_fn_check_prepare_dynamic "test $adds = $deletes" "ofproto.at:2404" -( $at_check_trace; test $adds = $deletes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2404" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -# Check that the flow monitor reported everything in the expected order: -# -# event=ADDED table=0 cookie=0x1 reg1=0x22 -# ... -# NXT_FLOW_MONITOR_PAUSED: -# ... -# event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22 -# ... -# event=ADDED table=0 cookie=0x3 in_port=1 -# event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2 -# NXT_FLOW_MONITOR_RESUMED: -# -# except that, between the PAUSED and RESUMED, the order of the ADDED -# and MODIFIED lines lines depends on hash order, that is, it varies -# as we change the hash function or change architecture. Therefore, -# we use a couple of tests below to accept both orders. -{ set +x -$as_echo "$at_srcdir/ofproto.at:2422: ofctl_strip < monitor.log | sed -n -e ' -/reg1=0x22\$/p -/cookie=0x[23]/p -/NXT_FLOW_MONITOR_PAUSED:/p -/NXT_FLOW_MONITOR_RESUMED:/p -' > monitor.log.subset" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2422" -( $at_check_trace; ofctl_strip < monitor.log | sed -n -e ' -/reg1=0x22$/p -/cookie=0x[23]/p -/NXT_FLOW_MONITOR_PAUSED:/p -/NXT_FLOW_MONITOR_RESUMED:/p -' > monitor.log.subset -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2422" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2428: grep -v MODIFIED monitor.log.subset" -at_fn_check_prepare_trace "ofproto.at:2428" -( $at_check_trace; grep -v MODIFIED monitor.log.subset -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " event=ADDED table=0 cookie=0x1 reg1=0x22 -NXT_FLOW_MONITOR_PAUSED: - event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22 - event=ADDED table=0 cookie=0x3 in_port=1 -NXT_FLOW_MONITOR_RESUMED: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2428" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2435: grep -v ADDED monitor.log.subset" -at_fn_check_prepare_trace "ofproto.at:2435" -( $at_check_trace; grep -v ADDED monitor.log.subset -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_FLOW_MONITOR_PAUSED: - event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22 - event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2 -NXT_FLOW_MONITOR_RESUMED: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2435" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2442: check_logs " -at_fn_check_prepare_trace "ofproto.at:2442" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2442" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2442: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2442" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2442" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2442: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2442" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2442" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_702 -#AT_START_703 -at_fn_group_banner 703 'ofproto.at:2445' \ - "ofproto - event filtering (OpenFlow 1.3)" " " 44 -at_xfail=no -( - $as_echo "703. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2447: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2447" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2447" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2447: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2447" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2447" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2447: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2447" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2447" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2447: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2447" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2447" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2447: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2447" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2447" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2447: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2447" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2447" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2447: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2447" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2447" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a) -ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a -ovs-appctl -t ovs-ofctl ofctl/barrier - -# Check default setting -read -r -d '' expected <<'EOF' -EOF - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2461: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2461" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_GET_ASYNC_REQUEST (OF1.3): -OFPT_GET_ASYNC_REPLY (OF1.3): - master: - PACKET_IN: no_match action - PORT_STATUS: add delete modify - FLOW_REMOVED: idle hard delete - - slave: - PACKET_IN: (off) - PORT_STATUS: add delete modify - FLOW_REMOVED: (off) -OFPT_BARRIER_REPLY (OF1.3): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2476: check_logs " -at_fn_check_prepare_trace "ofproto.at:2476" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2476" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2476: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2476" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2476" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2476: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2476" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2476" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_703 -#AT_START_704 -at_fn_group_banner 704 'ofproto.at:2479' \ - "ofproto - ofport_request" " " 44 -at_xfail=no -( - $as_echo "704. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2480: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2480" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2480" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2480: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2480" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2480" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2480: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2480" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2480" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2480: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2480" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2480" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2480: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2480" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2480" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2480: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2480" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2480" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2480: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2480" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2480" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -set_and_check_specific_ofports () { - ovs-vsctl set Interface p1 ofport_request="$1" -- \ - set Interface p2 ofport_request="$2" -- \ - set Interface p3 ofport_request="$3" - ofports=`ovs-vsctl get Interface p1 ofport -- \ - get Interface p2 ofport -- \ - get Interface p3 ofport` - { set +x -$as_echo "$at_srcdir/ofproto.at:2490: echo \$ofports" -at_fn_check_prepare_dynamic "echo $ofports" "ofproto.at:2490" -( $at_check_trace; echo $ofports -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "$1 $2 $3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2490" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -} -for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do - for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do - echo ----------------------------------------------------------- - echo "Check changing port numbers from $pre to $post" - set_and_check_ofports $pre - set_and_check_ofports $post - done -done - -ovs-vsctl del-port p3 - -set_and_check_poorly_specified_ofports () { - ovs-vsctl set Interface p1 ofport_request="$1" -- \ - set Interface p2 ofport_request="$2" - p1=`ovs-vsctl get Interface p1 ofport` - p2=`ovs-vsctl get Interface p2 ofport` - echo $p1 $p2 - - { set +x -$as_echo "$at_srcdir/ofproto.at:2511: test \"\$p1\" != \"\$p2\"" -at_fn_check_prepare_dynamic "test \"$p1\" != \"$p2\"" "ofproto.at:2511" -( $at_check_trace; test "$p1" != "$p2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - if test "$1" = "$2" && test "$1" != '[]'; then - # One port number must be the requested one. - { set +x -$as_echo "$at_srcdir/ofproto.at:2514: test \"\$p1\" = \"\$1\" || test \"\$p2\" = \"\$1\"" -at_fn_check_prepare_dynamic "test \"$p1\" = \"$1\" || test \"$p2\" = \"$1\"" "ofproto.at:2514" -( $at_check_trace; test "$p1" = "$1" || test "$p2" = "$1" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2514" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - # The other port number must be different (already tested above). - else - { set +x -$as_echo "$at_srcdir/ofproto.at:2517: test \"\$1\" = '[]' || test \"\$p1\" == \"\$1\"" -at_fn_check_prepare_dynamic "test \"$1\" = '[]' || test \"$p1\" == \"$1\"" "ofproto.at:2517" -( $at_check_trace; test "$1" = '[]' || test "$p1" == "$1" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2517" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2518: test \"\$2\" = '[]' || test \"\$p2\" == \"\$2\"" -at_fn_check_prepare_dynamic "test \"$2\" = '[]' || test \"$p2\" == \"$2\"" "ofproto.at:2518" -( $at_check_trace; test "$2" = '[]' || test "$p2" == "$2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2518" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - fi -} -for pre in '1 2' '[] 2' '1 []' '[] []' '2 1' '[] 1' '2 []' \ - '1 1' '2 2'; do - for post in '1 2' '[] 2' '1 []' '[] []' '2 1' '[] 1' '2 []' \ - '1 1' '2 2'; do - echo ----------------------------------------------------------- - echo "Check changing port numbers from $pre to $post" - set_and_check_poorly_specified_ofports $pre - set_and_check_poorly_specified_ofports $post - done -done -{ set +x -$as_echo "$at_srcdir/ofproto.at:2531: check_logs " -at_fn_check_prepare_trace "ofproto.at:2531" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2531: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2531" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2531: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2531" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_704 -#AT_START_705 -at_fn_group_banner 705 'ofproto.at:2535' \ - "ofproto - bundles, open (OpenFlow 1.4)" " " 44 -at_xfail=no -( - $as_echo "705. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2537: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2537" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2537" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2537: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2537" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2537" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2537: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2537" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2537" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2537: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2537" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2537" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2537: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2537" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2537" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2537: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2537" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2537" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2537: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2537" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2537" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2548: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2548" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REPLY flags=0 -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2556: check_logs " -at_fn_check_prepare_trace "ofproto.at:2556" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2556" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2556: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2556" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2556" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2556: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2556" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2556" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_705 -#AT_START_706 -at_fn_group_banner 706 'ofproto.at:2559' \ - "ofproto - bundles, double open (OpenFlow 1.4)" " " 44 -at_xfail=no -( - $as_echo "706. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2561: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2561" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2561" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2561: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2561" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2561: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2561" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2561" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2561: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2561" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2561: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2561" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2561: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2561" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2561: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2561" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2574: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2574" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REPLY flags=0 -OFPT_BARRIER_REPLY (OF1.4): -send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -OFPT_ERROR (OF1.4): OFPBFC_BAD_ID -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2588: check_logs " -at_fn_check_prepare_trace "ofproto.at:2588" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2588" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2588: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2588" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2588" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2588: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2588" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2588" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_706 -#AT_START_707 -at_fn_group_banner 707 'ofproto.at:2591' \ - "ofproto - bundle close without open (OpenFlow 1.4)" "" 44 -at_xfail=no -( - $as_echo "707. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2593: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2593" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2593" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2593: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2593" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2593" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2593: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2593" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2593" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2593: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2593" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2593" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2593: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2593" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2593" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2593: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2593" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2593" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2593: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2593" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2593" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2603: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2603" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic -OFPT_ERROR (OF1.4): OFPBFC_BAD_ID -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2612: check_logs " -at_fn_check_prepare_trace "ofproto.at:2612" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2612" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2612: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2612" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2612" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2612: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2612" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2612" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_707 -#AT_START_708 -at_fn_group_banner 708 'ofproto.at:2615' \ - "ofproto - bundle double close (OpenFlow 1.4)" " " 44 -at_xfail=no -( - $as_echo "708. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2617: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2617" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2617" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2617: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2617" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2617" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2617: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2617" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2617" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2617: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2617" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2617: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2617" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2617: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2617" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2617: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2617" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2632: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2632" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REPLY flags=0 -OFPT_BARRIER_REPLY (OF1.4): -send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REPLY flags=0 -OFPT_BARRIER_REPLY (OF1.4): -send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic -OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=atomic -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2632" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2651: check_logs " -at_fn_check_prepare_trace "ofproto.at:2651" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2651" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2651: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2651" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2651" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2651: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2651" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2651" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_708 -#AT_START_709 -at_fn_group_banner 709 'ofproto.at:2654' \ - "ofproto - bundle close, different flags (OpenFlow 1.4)" "" 44 -at_xfail=no -( - $as_echo "709. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2656: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2656" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2656" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2656: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2656" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2656" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2656: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2656" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2656" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2656: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2656" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2656" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2656: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2656" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2656" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2656: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2656" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2656" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2656: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2656" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2656" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2669: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2669" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REPLY flags=0 -OFPT_BARRIER_REPLY (OF1.4): -send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=ordered -OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=CLOSE_REQUEST flags=ordered -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2669" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2683: check_logs " -at_fn_check_prepare_trace "ofproto.at:2683" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2683: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2683" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2683: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2683" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_709 -#AT_START_710 -at_fn_group_banner 710 'ofproto.at:2686' \ - "ofproto - bundle commit without open (OpenFlow 1.4)" "" 44 -at_xfail=no -( - $as_echo "710. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2688: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2688" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2688" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2688: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2688" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2688" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2688: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2688" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2688" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2688: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2688" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2688" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2688: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2688" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2688" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2688: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2688" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2688" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2688: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2688" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2688" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2699: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2699" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=atomic -OFPT_ERROR (OF1.4): OFPBFC_BAD_ID -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=atomic -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2699" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2708: check_logs " -at_fn_check_prepare_trace "ofproto.at:2708" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2708" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2708: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2708" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2708" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2708: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2708" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2708" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_710 -#AT_START_711 -at_fn_group_banner 711 'ofproto.at:2711' \ - "ofproto - bundle commit, different flags (OpenFlow 1.4)" "" 44 -at_xfail=no -( - $as_echo "711. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2713: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2713" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2713" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2713: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2713" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2713" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2713: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2713" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2713" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2713: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2713" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2713: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2713" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2713: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2713" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2713: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2713" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2726: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2726" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REQUEST flags=atomic -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=OPEN_REPLY flags=0 -OFPT_BARRIER_REPLY (OF1.4): -send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=ordered -OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=COMMIT_REQUEST flags=ordered -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2726" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2740: check_logs " -at_fn_check_prepare_trace "ofproto.at:2740" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2740" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2740: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2740" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2740" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2740: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2740" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2740" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_711 -#AT_START_712 -at_fn_group_banner 712 'ofproto.at:2743' \ - "ofproto - bundle discard without open (OpenFlow 1.4)" "" 44 -at_xfail=no -( - $as_echo "712. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto.at:2745: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto.at:2745" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2745" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2745: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto.at:2745" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2745" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2745: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2745" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2745" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2745: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto.at:2745" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2745: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto.at:2745" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2745: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto.at:2745" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto.at:2745: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto.at:2745" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Start a monitor, use the required protocol version -ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 - - -# Open, Close, Close -ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01" -ovs-appctl -t ovs-ofctl ofctl/barrier -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2756: ofctl_strip < monitor.log" -at_fn_check_prepare_trace "ofproto.at:2756" -( $at_check_trace; ofctl_strip < monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "send: OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=DISCARD_REQUEST flags=atomic -OFPT_ERROR (OF1.4): OFPBFC_BAD_ID -OFPT_BUNDLE_CONTROL (OF1.4): - bundle_id=0x1 type=DISCARD_REQUEST flags=atomic -OFPT_BARRIER_REPLY (OF1.4): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2756" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto.at:2765: check_logs " -at_fn_check_prepare_trace "ofproto.at:2765" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2765" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2765: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto.at:2765" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2765" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto.at:2765: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto.at:2765" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto.at:2765" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_712 -#AT_START_713 -at_fn_group_banner 713 'ofproto-dpif.at:24' \ - "ofproto-dpif - dummy interface" " " 45 -at_xfail=no -( - $as_echo "713. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Create br0 with interfaces p1 and p7 -# and br1 with interfaces p2 and p8 -# with p1 and p2 connected via unix domain socket -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:28: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:28" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:28" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:28: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:28" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:28" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:28: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:28" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:28" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:28: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:28" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:28: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:28" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:28: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:28" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:28: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:\$OVS_RUNDIR/p0.sock ofport_request=1 -- \\ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \\ - add-br br1 -- \\ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \\ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \\ - fail-mode=secure -- \\ - add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:\$OVS_RUNDIR/p0.sock ofport_request=2 -- \\ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:28" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \ - add-br br1 -- \ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ - fail-mode=secure -- \ - add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:28" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:37: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:37" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:37" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:39: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:39" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:39" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:40: ovs-ofctl add-flow br1 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:40" -( $at_check_trace; ovs-ofctl add-flow br1 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:40" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/stop -ovs-appctl time/warp 5000 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:43: ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:43" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:43" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:44: ovs-appctl netdev-dummy/receive p8 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:44" -( $at_check_trace; ovs-appctl netdev-dummy/receive p8 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:44" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/warp 100 -sleep 1 # wait for forwarders process packets - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:48: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:48" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(2),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:48" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:54: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:54" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:54: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:54" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:54: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:54" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_713 -#AT_START_714 -at_fn_group_banner 714 'ofproto-dpif.at:57' \ - "ofproto-dpif, active-backup bonding" " " 45 -at_xfail=no -( - $as_echo "714. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2 -# and br1 with interfaces p3, p4 and p8. -# toggle p1,p2 of bond0 up and down to test bonding in active-backup mode. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:61: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:61" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:61: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:61" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:61: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:61" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:61: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:61" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:61: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:61" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:61: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:61" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:61: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p1 p2 bond_mode=active-backup --\\ - set interface p1 type=dummy options:pstream=punix:\$OVS_RUNDIR/p1.sock ofport_request=1 -- \\ - set interface p2 type=dummy options:pstream=punix:\$OVS_RUNDIR/p2.sock ofport_request=2 -- \\ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \\ - add-br br1 -- \\ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \\ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \\ - fail-mode=secure -- \\ - add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:\$OVS_RUNDIR/p1.sock ofport_request=3 -- \\ - add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:\$OVS_RUNDIR/p2.sock ofport_request=4 -- \\ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:61" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p1 p2 bond_mode=active-backup --\ - set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \ - set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \ - add-br br1 -- \ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ - fail-mode=secure -- \ - add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \ - add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:61" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:73: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:73" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:73" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:75: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:75" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:75" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:76: ovs-ofctl add-flow br1 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:76" -( $at_check_trace; ovs-ofctl add-flow br1 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:76" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl netdev-dummy/set-admin-state up -ovs-appctl time/warp 100 -ovs-appctl netdev-dummy/set-admin-state p2 down -ovs-appctl time/stop -ovs-appctl time/warp 100 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:82: ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:82" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:82" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:83: ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:83" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:83" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/warp 100 -ovs-appctl netdev-dummy/set-admin-state p2 up -ovs-appctl netdev-dummy/set-admin-state p1 down -ovs-appctl time/warp 100 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:88: ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:88" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:88" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:89: ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:89" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:89" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:93: cat ovs-vswitchd.log | grep 'in_port([348])' | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:93" -( $at_check_trace; cat ovs-vswitchd.log | grep 'in_port([348])' | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:09/00:00:00:00:00:00,tha=50:54:00:00:00:09/00:00:00:00:00:00), actions: -skb_priority(0),skb_mark(0/0),in_port(4),eth(src=50:54:00:00:00:0b,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:0b/00:00:00:00:00:00,tha=50:54:00:00:00:0b/00:00:00:00:00:00), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:93" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:101: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:101" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:101: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:101" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:101: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:101" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_714 -#AT_START_715 -at_fn_group_banner 715 'ofproto-dpif.at:104' \ - "ofproto-dpif, balance-slb bonding" " " 45 -at_xfail=no -( - $as_echo "715. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Create br0 with interfaces bond0(p1, p2, p3) and p7, -# and br1 with interfaces p4, p5, p6 and p8. -# p1 <-> p4, p2 <-> p5, p3 <-> p6 -# Send some traffic, make sure the traffic are spread based on source mac. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:109: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:109" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:109: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:109" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:109: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:109" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:109: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:109" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:109" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:109: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:109" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:109" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:109: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:109" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:109" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:109: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\\ - set interface p1 type=dummy options:pstream=punix:\$OVS_RUNDIR/p1.sock ofport_request=1 -- \\ - set interface p2 type=dummy options:pstream=punix:\$OVS_RUNDIR/p2.sock ofport_request=2 -- \\ - set interface p3 type=dummy options:pstream=punix:\$OVS_RUNDIR/p3.sock ofport_request=3 -- \\ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \\ - add-br br1 -- \\ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \\ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \\ - fail-mode=secure -- \\ - add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:\$OVS_RUNDIR/p1.sock ofport_request=4 -- \\ - add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:\$OVS_RUNDIR/p2.sock ofport_request=5 -- \\ - add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:\$OVS_RUNDIR/p3.sock ofport_request=6 -- \\ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:109" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\ - set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \ - set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \ - set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \ - add-br br1 -- \ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ - fail-mode=secure -- \ - add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \ - add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \ - add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:109" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:124: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:124" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:124" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:125: ovs-ofctl add-flow br1 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:125" -( $at_check_trace; ovs-ofctl add-flow br1 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:125" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:126: ovs-appctl netdev-dummy/set-admin-state up" -at_fn_check_prepare_trace "ofproto-dpif.at:126" -( $at_check_trace; ovs-appctl netdev-dummy/set-admin-state up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:126" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl netdev-dummy/set-admin-state up -ovs-appctl time/stop -ovs-appctl time/warp 100 -( -for i in `seq 0 100 |xargs printf '%02x\n'`; - do - pkt="in_port(7),eth(src=50:54:00:00:00:$i,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:135: ovs-appctl netdev-dummy/receive p7 \$pkt" -at_fn_check_prepare_dynamic "ovs-appctl netdev-dummy/receive p7 $pkt" "ofproto-dpif.at:135" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 $pkt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:135" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - done -) -ovs-appctl time/warp 100 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:139: ovs-appctl dpif/dump-flows br1 > br1_flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:139" -( $at_check_trace; ovs-appctl dpif/dump-flows br1 > br1_flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:139" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Make sure there is resonable distribution to all three ports. -# We don't want to make this check precise, in case hash function changes. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:142: test \`egrep 'in_port\\(4\\)' br1_flows.txt |wc -l\` -gt 3" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:142" -( $at_check_trace; test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:142" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:143: test \`egrep 'in_port\\(5\\)' br1_flows.txt |wc -l\` -gt 3" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:143" -( $at_check_trace; test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:143" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:144: test \`egrep 'in_port\\(6\\)' br1_flows.txt |wc -l\` -gt 3" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:144" -( $at_check_trace; test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:144" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:145: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:145" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:145" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:145: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:145" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:145" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:145: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:145" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:145" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_715 -#AT_START_716 -at_fn_group_banner 716 'ofproto-dpif.at:148' \ - "ofproto-dpif, balance-tcp bonding" " " 45 -at_xfail=no -( - $as_echo "716. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Create br0 with interfaces bond0(p1, p2, p3) and p7, -# and br1 with interfaces bond1(p4, p5, p6) and p8. -# bond0 <-> bond1 -# Send some traffic, make sure the traffic are spread based on L4 headers. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:153: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:153" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:153" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:153: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:153" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:153" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:153: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:153" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:153" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:153: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:153" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:153" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:153: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:153" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:153" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:153: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:153" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:153" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:153: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \\ - other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\\ - set interface p1 type=dummy options:pstream=punix:\$OVS_RUNDIR/p1.sock ofport_request=1 -- \\ - set interface p2 type=dummy options:pstream=punix:\$OVS_RUNDIR/p2.sock ofport_request=2 -- \\ - set interface p3 type=dummy options:pstream=punix:\$OVS_RUNDIR/p3.sock ofport_request=3 -- \\ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \\ - add-br br1 -- \\ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \\ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \\ - fail-mode=secure -- \\ - add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \\ - other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\\ - set interface p4 type=dummy options:stream=unix:\$OVS_RUNDIR/p1.sock ofport_request=4 -- \\ - set interface p5 type=dummy options:stream=unix:\$OVS_RUNDIR/p2.sock ofport_request=5 -- \\ - set interface p6 type=dummy options:stream=unix:\$OVS_RUNDIR/p3.sock ofport_request=6 -- \\ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:153" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \ - other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\ - set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \ - set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \ - set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \ - add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \ - add-br br1 -- \ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ - fail-mode=secure -- \ - add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \ - other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\ - set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \ - set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \ - set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \ - add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:153" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:170: ovs-appctl netdev-dummy/set-admin-state up" -at_fn_check_prepare_trace "ofproto-dpif.at:170" -( $at_check_trace; ovs-appctl netdev-dummy/set-admin-state up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:170" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:172: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:172" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:172" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:173: ovs-ofctl add-flow br1 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:173" -( $at_check_trace; ovs-ofctl add-flow br1 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:173" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:174: ovs-appctl upcall/disable-megaflows" -at_fn_check_prepare_trace "ofproto-dpif.at:174" -( $at_check_trace; ovs-appctl upcall/disable-megaflows -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "megaflows disabled -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:174" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1; -ovs-appctl time/stop -ovs-appctl time/warp 100 -ovs-appctl lacp/show > lacp.txt -ovs-appctl bond/show > bond.txt -( -for i in `seq 0 255` ; - do - pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(0x010)" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:185: ovs-appctl netdev-dummy/receive p7 \$pkt" -at_fn_check_prepare_dynamic "ovs-appctl netdev-dummy/receive p7 $pkt" "ofproto-dpif.at:185" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 $pkt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:185" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - done -) -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -ovs-appctl time/warp 100 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:191: ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:191" -( $at_check_trace; ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:191" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:192: ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:192" -( $at_check_trace; ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:192" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Make sure there is resonable distribution to all three ports. -# We don't want to make this check precise, in case hash function changes. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:195: test \`grep in_port.4 br1_flows.txt |wc -l\` -gt 24" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:195" -( $at_check_trace; test `grep in_port.4 br1_flows.txt |wc -l` -gt 24 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:195" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:196: test \`grep in_port.5 br1_flows.txt |wc -l\` -gt 24" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:196" -( $at_check_trace; test `grep in_port.5 br1_flows.txt |wc -l` -gt 24 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:196" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:197: test \`grep in_port.6 br1_flows.txt |wc -l\` -gt 24" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:197" -( $at_check_trace; test `grep in_port.6 br1_flows.txt |wc -l` -gt 24 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:197" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:198: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:198" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:198: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:198" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:198: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:198" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_716 -#AT_START_717 -at_fn_group_banner 717 'ofproto-dpif.at:201' \ - "ofproto-dpif - resubmit" " " 45 -at_xfail=no -( - $as_echo "717. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:202: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:202" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:202" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:202: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:202" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:202" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:202: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:202" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:202" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:202: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:202" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:202: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:202" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:202: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:202" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:202: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:202" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 \ - -- add-port br0 p12 -- set Interface p12 type=dummy ofport_request=12 \ - -- add-port br0 p13 -- set Interface p13 type=dummy ofport_request=13 \ - -- add-port br0 p14 -- set Interface p14 type=dummy ofport_request=14 \ - -- add-port br0 p15 -- set Interface p15 type=dummy ofport_request=15 \ - -- add-port br0 p16 -- set Interface p16 type=dummy ofport_request=16 \ - -- add-port br0 p17 -- set Interface p17 type=dummy ofport_request=17 \ - -- add-port br0 p18 -- set Interface p18 type=dummy ofport_request=18 \ - -- add-port br0 p19 -- set Interface p19 type=dummy ofport_request=19 \ - -- add-port br0 p20 -- set Interface p20 type=dummy ofport_request=20 \ - -- add-port br0 p21 -- set Interface p21 type=dummy ofport_request=21 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21) -table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18) -table=0 in_port=3 priority=2000 icmp actions=output(20) -table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15) -table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2) -table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:213: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:213" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:213" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:214: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:214" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:214" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:215: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:215" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:215" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:218: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:218" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:218: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:218" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:218: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:218" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:218" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_717 -#AT_START_718 -at_fn_group_banner 718 'ofproto-dpif.at:221' \ - "ofproto-dpif - goto table" " " 45 -at_xfail=no -( - $as_echo "718. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:222: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:222" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:222" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:222: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:222" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:222" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:222: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:222" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:222" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:222: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:222" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:222: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:222" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:222: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:222" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:222: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:222" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 -echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt -for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt -echo "table=64 actions=output(11)" >> flows.txt -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:227: ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:227" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:227" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:228: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:228" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:228" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:229: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:229" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 10,11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:229" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:232: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:232" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:232" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:232: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:232" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:232" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:232: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:232" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:232" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_718 -#AT_START_719 -at_fn_group_banner 719 'ofproto-dpif.at:235' \ - "ofproto-dpif - write actions" " " 45 -at_xfail=no -( - $as_echo "719. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:236: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:236" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:236" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:236: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:236" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:236" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:236: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:236" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:236" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:236: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:236" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:236" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:236: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:236" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:236" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:236: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:236" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:236" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:236: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:236" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:236" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 \ - -- add-port br0 p12 -- set Interface p12 type=dummy ofport_request=12 \ - -- add-port br0 p13 -- set Interface p13 type=dummy ofport_request=13 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1) -table=1 ip actions=write_actions(output(13)),goto_table(2) -table=2 ip actions=set_field:192.168.3.91->ip_src,output(11) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:243: ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:243" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:243" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:244: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:244" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:244" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:245: tail -2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:245" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128 -Datapath actions: 10,set(ipv4(src=192.168.3.91,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11,set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),13 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:245" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:249: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:249" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:249" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:249: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:249" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:249" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:249: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:249" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:249" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_719 -#AT_START_720 -at_fn_group_banner 720 'ofproto-dpif.at:252' \ - "ofproto-dpif - clear actions" " " 45 -at_xfail=no -( - $as_echo "720. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:253: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:253" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:253" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:253: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:253" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:253" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:253: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:253" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:253" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:253: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:253" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:253" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:253: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:253" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:253" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:253: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:253" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:253" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:253: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:253" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:253" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 \ - -- add-port br0 p12 -- set Interface p12 type=dummy ofport_request=12 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1) -table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:259: ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:259" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:259" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:260: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=9'" -at_fn_check_prepare_trace "ofproto-dpif.at:260" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=9' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:260" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:261: tail -2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:261" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_frag=no,tp_src=8,tp_dst=9 -Datapath actions: 10,set(tcp(src=91,dst=9)),11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:265: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:265" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:265: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:265" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:265: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:265" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:265" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_720 -#AT_START_721 -at_fn_group_banner 721 'ofproto-dpif.at:268' \ - "ofproto-dpif - group chaining not supported" " " 45 -at_xfail=no -( - $as_echo "721. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:269: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:269" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:269" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:269: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:269" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:269" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:269: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:269" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:269" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:269: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:269" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:269" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:269: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:269" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:269" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:269: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:269" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:269" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:269: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:269" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:269" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:271: ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,group:123,bucket=output:11'" -at_fn_check_prepare_trace "ofproto-dpif.at:271" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,group:123,bucket=output:11' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ofproto-dpif.at:271" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:273: sed 's/ (xid=0x[0-9a-fA-F]*)//' stderr | sed 1q" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:273" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stderr | sed 1q -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_ERROR (OF1.2): OFPGMFC_CHAINING_UNSUPPORTED -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:273" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:276: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:276" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:276" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:276: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:276" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:276" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:276: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:276" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:276" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_721 -#AT_START_722 -at_fn_group_banner 722 'ofproto-dpif.at:279' \ - "ofproto-dpif - all group in action list" " " 45 -at_xfail=no -( - $as_echo "722. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:280: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:280" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:280" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:280: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:280" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:280" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:280: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:280" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:280" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:280: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:280" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:280" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:280: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:280" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:280" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:280: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:280" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:280" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:280: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:280" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:280" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:282: ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'" -at_fn_check_prepare_trace "ofproto-dpif.at:282" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:282" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:283: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'" -at_fn_check_prepare_trace "ofproto-dpif.at:283" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:283" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:284: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:284" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:284" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:285: tail -2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:285" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128 -Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:285" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:289: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:289" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:289" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:289: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:289" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:289" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:289: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:289" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:289" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_722 -#AT_START_723 -at_fn_group_banner 723 'ofproto-dpif.at:292' \ - "ofproto-dpif - indirect group in action list" " " 45 -at_xfail=no -( - $as_echo "723. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:293: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:293" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:293: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:293" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:293: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:293" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:293: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:293" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:293" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:293: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:293" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:293" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:293: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:293" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:293" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:293: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:293" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:293" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:295: ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10" -at_fn_check_prepare_trace "ofproto-dpif.at:295" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:295" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:296: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'" -at_fn_check_prepare_trace "ofproto-dpif.at:296" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:296" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:297: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:297" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:297" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:298: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:298" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:298" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:301: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:301" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:301: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:301" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:301: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:301" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:301" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_723 -#AT_START_724 -at_fn_group_banner 724 'ofproto-dpif.at:304' \ - "ofproto-dpif - all group in action set" " " 45 -at_xfail=no -( - $as_echo "724. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:305: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:305" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:305" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:305: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:305" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:305" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:305: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:305" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:305" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:305: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:305" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:305: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:305" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:305: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:305" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:305: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:305" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:307: ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'" -at_fn_check_prepare_trace "ofproto-dpif.at:307" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:307" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:308: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'" -at_fn_check_prepare_trace "ofproto-dpif.at:308" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:308" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:309: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:309" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:309" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:310: tail -2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:310" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128 -Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:314: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:314" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:314: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:314" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:314: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:314" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_724 -#AT_START_725 -at_fn_group_banner 725 'ofproto-dpif.at:317' \ - "ofproto-dpif - indirect group in action set" " " 45 -at_xfail=no -( - $as_echo "725. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:318: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:318" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:318: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:318" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:318: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:318" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:318: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:318" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:318" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:318: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:318" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:318" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:318: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:318" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:318" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:318: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:318" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:318" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:320: ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10" -at_fn_check_prepare_trace "ofproto-dpif.at:320" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:320" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:321: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'" -at_fn_check_prepare_trace "ofproto-dpif.at:321" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:322: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:322" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:322" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:323: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:323" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:323" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:326: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:326" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:326: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:326" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:326: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:326" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_725 -#AT_START_726 -at_fn_group_banner 726 'ofproto-dpif.at:329' \ - "ofproto-dpif - select group" " " 45 -at_xfail=no -( - $as_echo "726. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:330: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:330" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:330" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:330: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:330" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:330" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:330: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:330" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:330" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:330: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:330" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:330: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:330" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:330: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:330" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:330: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:330" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:332: ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'" -at_fn_check_prepare_trace "ofproto-dpif.at:332" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:332" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:333: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'" -at_fn_check_prepare_trace "ofproto-dpif.at:333" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:333" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Try a bunch of different flows and make sure that they get distributed -# at least somewhat. -for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:338: ovs-appctl ofproto/trace br0 \"in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0\$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0\"" "ofproto-dpif.at:338" -( $at_check_trace; ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - tail -1 stdout >> results -done -sort results | uniq -c -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:342: sort results | uniq" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:342" -( $at_check_trace; sort results | uniq -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 10 -Datapath actions: 11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:346: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:346" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:346" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:346: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:346" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:346" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:346: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:346" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:346" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_726 -#AT_START_727 -at_fn_group_banner 727 'ofproto-dpif.at:349' \ - "ofproto-dpif - select group with watch port" " " 45 -at_xfail=no -( - $as_echo "727. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:350: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:350" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:350" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:350: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:350" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:350" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:350: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:350" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:350" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:350: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:350" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:350: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:350" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:350: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:350" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:350: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:350" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:352: ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'" -at_fn_check_prepare_trace "ofproto-dpif.at:352" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:352" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:353: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'" -at_fn_check_prepare_trace "ofproto-dpif.at:353" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:353" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:354: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:354" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:354" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:355: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:355" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:355" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:358: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:358" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:358" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:358: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:358" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:358" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:358: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:358" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:358" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_727 -#AT_START_728 -at_fn_group_banner 728 'ofproto-dpif.at:361' \ - "ofproto-dpif - select group with weight" " " 45 -at_xfail=no -( - $as_echo "728. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:362: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:362" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:362" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:362: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:362" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:362" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:362: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:362" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:362" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:362: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:362" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:362" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:362: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:362" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:362" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:362: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:362" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:362" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:362: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:362" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:362" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 \ - -- add-port br0 p12 -- set Interface p12 type=dummy ofport_request=12 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:364: ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11,weight=2000,bucket=output:12,weight=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:364" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11,weight=2000,bucket=output:12,weight=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:364" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:365: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'" -at_fn_check_prepare_trace "ofproto-dpif.at:365" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:365" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:366: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:366" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:367: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:367" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:370: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:370" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:370: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:370" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:370: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:370" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_728 -#AT_START_729 -at_fn_group_banner 729 'ofproto-dpif.at:373' \ - "ofproto-dpif - fast failover group" " " 45 -at_xfail=no -( - $as_echo "729. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:374: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:374" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:374" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:374: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:374" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:374" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:374: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:374" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:374" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:374: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:374" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:374" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:374: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:374" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:374" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:374: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:374" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:374" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:374: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:374" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:374" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:376: ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=ff,bucket=watch_port:10,output:10,bucket=watch_port:11,output:11'" -at_fn_check_prepare_trace "ofproto-dpif.at:376" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=ff,bucket=watch_port:10,output:10,bucket=watch_port:11,output:11' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:376" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:377: ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'" -at_fn_check_prepare_trace "ofproto-dpif.at:377" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:377" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:378: ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'" -at_fn_check_prepare_trace "ofproto-dpif.at:378" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:378" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:379: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:379" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:379" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:382: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:382" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:382: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:382" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:382: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:382" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_729 -#AT_START_730 -at_fn_group_banner 730 'ofproto-dpif.at:385' \ - "ofproto-dpif - registers" " " 45 -at_xfail=no -( - $as_echo "730. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:386: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:386" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:386" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:386: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:386" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:386" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:386: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:386" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:386" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:386: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:386" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:386: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:386" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:386: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:386" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:386: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:386" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:386" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p20 -- set Interface p20 type=dummy ofport_request=20 \ - -- add-port br0 p21 -- set Interface p21 type=dummy ofport_request=21 \ - -- add-port br0 p22 -- set Interface p22 type=dummy ofport_request=22 \ - -- add-port br0 p33 -- set Interface p33 type=dummy ofport_request=33 \ - -- add-port br0 p90 -- set Interface p90 type=dummy ofport_request=90 -cat >flows.txt <<'_ATEOF' -in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91 -in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92 -in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93 -in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15 - -in_port=2 actions=load:0x000db000->NXM_NX_REG0[] -in_port=3 actions=load:0xdea->NXM_NX_REG0[20..31] -in_port=4 actions=load:0xeef->NXM_NX_REG0[0..11] -in_port=5 actions=move:NXM_NX_REG0[]->NXM_NX_REG1[] -in_port=6 actions=load:0x22222222->NXM_NX_REG2[] -in_port=7 actions=move:NXM_NX_REG1[20..31]->NXM_NX_REG2[0..11] -in_port=8 actions=move:NXM_NX_REG1[0..11]->NXM_NX_REG2[20..31] -in_port=9,reg0=0xdeadbeef actions=output:20 -in_port=10,reg1=0xdeadbeef actions=output:21 -in_port=11,reg2=0xeef22dea actions=output:22 - -in_port=12 actions=load:0x10->NXM_NX_REG0[],load:0x11->NXM_NX_REG1[],load:0x12->NXM_NX_REG2[] -in_port=13 actions=load:0x13->NXM_NX_REG3[],load:0x14->NXM_NX_REG4[],load:0x15->NXM_NX_REG5[] -in_port=14 actions=load:0x16->NXM_NX_REG6[],load:0x17->NXM_NX_REG7[] -in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33 - -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:412: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:412" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:412" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:413: ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:413" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:413" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:414: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:414" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 20,21,22,33 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:414" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:417: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:417" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:417: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:417" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:417: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:417" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_730 -#AT_START_731 -at_fn_group_banner 731 'ofproto-dpif.at:420' \ - "ofproto-dpif - push-pop" " " 45 -at_xfail=no -( - $as_echo "731. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:421: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:421" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:421" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:421: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:421" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:421" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:421: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:421" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:421" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:421: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:421" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:421" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:421: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:421" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:421" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:421: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:421" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:421" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:421: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:421" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:421" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p20 -- set Interface p20 type=dummy ofport_request=20 \ - -- add-port br0 p21 -- set Interface p21 type=dummy ofport_request=21 \ - -- add-port br0 p22 -- set Interface p22 type=dummy ofport_request=22 \ - -- add-port br0 p33 -- set Interface p33 type=dummy ofport_request=33 \ - -- add-port br0 p90 -- set Interface p90 type=dummy ofport_request=90 -cat >flows.txt <<'_ATEOF' -in_port=90 actions=load:20->NXM_NX_REG0[0..7],load:21->NXM_NX_REG1[0..7],load:22->NXM_NX_REG2[0..7], load:33->NXM_NX_REG3[0..7], push:NXM_NX_REG0[], push:NXM_NX_REG1[0..7],push:NXM_NX_REG2[0..15], push:NXM_NX_REG3[], resubmit:2, resubmit:3, resubmit:4, resubmit:5 -in_port=2 actions=pop:NXM_NX_REG0[0..7],output:NXM_NX_REG0[] -in_port=3 actions=pop:NXM_NX_REG1[0..7],output:NXM_NX_REG1[] -in_port=4 actions=pop:NXM_NX_REG2[0..15],output:NXM_NX_REG2[] -in_port=5 actions=pop:NXM_NX_REG3[],output:NXM_NX_REG3[] - -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:431: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:431" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:431" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:432: ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:432" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:432" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:433: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:433" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 33,22,21,20 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:433" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:436: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:436" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:436" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:436: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:436" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:436" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:436: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:436" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:436" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_731 -#AT_START_732 -at_fn_group_banner 732 'ofproto-dpif.at:439' \ - "ofproto-dpif - output" " " 45 -at_xfail=no -( - $as_echo "732. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:440: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:440" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:440" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:440: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:440" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:440" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:440: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:440" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:440" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:440: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:440" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:440" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:440: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:440" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:440" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:440: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:440" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:440" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:440: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:440" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:440" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p9 -- set Interface p9 type=dummy ofport_request=9 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 \ - -- add-port br0 p55 -- set Interface p55 type=dummy ofport_request=55 \ - -- add-port br0 p66 -- set Interface p66 type=dummy ofport_request=66 \ - -- add-port br0 p77 -- set Interface p77 type=dummy ofport_request=77 \ - -- add-port br0 p88 -- set Interface p88 type=dummy ofport_request=88 -cat >flows.txt <<'_ATEOF' -in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8 -in_port=2 actions=output:9 -in_port=3 actions=load:55->NXM_NX_REG0[],output:NXM_NX_REG0[],load:66->NXM_NX_REG1[] -in_port=4 actions=output:10,output:NXM_NX_REG0[],output:NXM_NX_REG1[],output:11 -in_port=5 actions=load:77->NXM_NX_REG0[0..15],load:88->NXM_NX_REG0[16..31] -in_port=6 actions=output:NXM_NX_REG0[0..15],output:NXM_NX_REG0[16..31] -in_port=7 actions=load:0x110000ff->NXM_NX_REG0[],output:NXM_NX_REG0[] -in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[],1,9 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:452: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:452" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:452" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:453: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:453" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:453" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:454: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:454" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 9,55,10,55,66,11,77,88,9,1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:454" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:457: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:457" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:457" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:457: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:457" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:457" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:457: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:457" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:457" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_732 -#AT_START_733 -at_fn_group_banner 733 'ofproto-dpif.at:460' \ - "ofproto-dpif - dec_ttl" " " 45 -at_xfail=no -( - $as_echo "733. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:461: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:461" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:461" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:461: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:461" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:461" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:461: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:461" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:461" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:461: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:461" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:461: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:461" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:461: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:461" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:461: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:461" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=dummy ofport_request=4 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4 -table=1 in_port=1 action=dec_ttl,output:3 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:467: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:467" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:467" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:468: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate" -at_fn_check_prepare_trace "ofproto-dpif.at:468" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:468" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:469: tail -4 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:469" -( $at_check_trace; tail -4 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=2 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),2,4 -This flow is handled by the userspace slow path because it: - - Sends \"packet-in\" messages to the OpenFlow controller. -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:469" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:475: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'" -at_fn_check_prepare_trace "ofproto-dpif.at:475" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:475" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:476: tail -2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:476" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=3 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)),2,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),3,4 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:476" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:480: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'" -at_fn_check_prepare_trace "ofproto-dpif.at:480" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:480" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:481: tail -2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:481" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,ipv6,in_port=1,ipv6_src=::1,ipv6_dst=::2,ipv6_label=0x00000,nw_proto=10,nw_tos=112,nw_ecn=0,nw_ttl=128 -Datapath actions: set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=127,frag=no)),2,set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=126,frag=no)),3,4 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:481" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:487: ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:487" -( $at_check_trace; ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:487" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:488: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate" -at_fn_check_prepare_trace "ofproto-dpif.at:488" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:488" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:489: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:489" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:489" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:490: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:490" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:490" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:494: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:494" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:494: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:494" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:494: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:494" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:494" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_733 -#AT_START_734 -at_fn_group_banner 734 'ofproto-dpif.at:504' \ - "ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts" "" 45 -at_xfail=no -( - $as_echo "734. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:505: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:505" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:505" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:505: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:505" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:505" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:505: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:505" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:505" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:505: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:505" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:505" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:505: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:505" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:505" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:505: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:505" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:505" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:505: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:505" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:505" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -(for i in `seq 0 255`; do - printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i - done) > flows.txt -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:510: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:510" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:510" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:511: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:511" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:511: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:511" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:511: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:511" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_734 -#AT_START_735 -at_fn_group_banner 735 'ofproto-dpif.at:521' \ - "ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts" "" 45 -at_xfail=no -( - $as_echo "735. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:522: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:522" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:522" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:522: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:522" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:522" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:522: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:522" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:522" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:522: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:522" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:522: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:522" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:522: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:522" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:522: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:522" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:522" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -(for i in `seq 0 255`; do - printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i - done) > flows.txt -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:527: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:527" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:527" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:528: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:528" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:528" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:528: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:528" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:528" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:528: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:528" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:528" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_735 -#AT_START_736 -at_fn_group_banner 736 'ofproto-dpif.at:538' \ - "ofproto-dpif - note at offset 24 in ofpacts" " " 45 -at_xfail=no -( - $as_echo "736. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:539: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:539" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:539" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:539: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:539" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:539" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:539: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:539" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:539" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:539: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:539" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:539" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:539: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:539" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:539" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:539: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:539" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:539" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:539: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:539" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:539" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -(for i in `seq 0 255`; do - printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i - done) > flows.txt -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:544: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:544" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:544" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:545: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:545" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:545" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:545: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:545" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:545" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:545: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:545" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:545" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_736 -#AT_START_737 -at_fn_group_banner 737 'ofproto-dpif.at:548' \ - "ofproto-dpif - output, OFPP_NONE ingress port" " " 45 -at_xfail=no -( - $as_echo "737. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:549: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:549" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:549" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:549: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:549" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:549" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:549: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:549" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:549" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:549: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:549" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:549" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:549: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:549" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:549" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:549: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:549" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:549" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:549: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:549" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:549" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:552: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:552" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:552" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# "in_port" defaults to OFPP_NONE if it's not specified. -flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,icmp_type=8,icmp_code=0" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:556: ovs-appctl ofproto/trace br0 \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"$flow\"" "ofproto-dpif.at:556" -( $at_check_trace; ovs-appctl ofproto/trace br0 "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:556" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:557: tail -1 stdout | sed 's/Datapath actions: //' | tr \",\" \"\\n\" | sort -n" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:557" -( $at_check_trace; tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -2 -100 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:557" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:563: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:563" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:563" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:563: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:563" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:563" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:563: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:563" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:563" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_737 -#AT_START_738 -at_fn_group_banner 738 'ofproto-dpif.at:566' \ - "ofproto-dpif - DSCP" " " 45 -at_xfail=no -( - $as_echo "738. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:567: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:567" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:567" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:567: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:567" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:567" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:567: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:567" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:567" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:567: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:567" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:567: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:567" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:567: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:567" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:567: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy " -at_fn_check_prepare_trace "ofproto-dpif.at:567" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p9 -- set Interface p9 type=dummy ofport_request=9 -cat >flows.txt <<'_ATEOF' -actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:572: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:572" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:572" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:573: ovs-vsctl -- \\ - set Port p1 qos=@newqos --\\ - --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\\ - --id=@q1 create Queue dscp=1 --\\ - --id=@q2 create Queue dscp=2" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:573" -( $at_check_trace; ovs-vsctl -- \ - set Port p1 qos=@newqos --\ - --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\ - --id=@q1 create Queue dscp=1 --\ - --id=@q2 create Queue dscp=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:573" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:578: ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:578" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:578" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:579: tail -2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:579" -( $at_check_trace; tail -2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=9,nw_src=1.1.1.1,nw_dst=2.2.2.2,nw_tos=252,nw_ecn=3,nw_ttl=128 -Datapath actions: 100,set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xb,ttl=128,frag=no)),set(skb_priority(0x2)),1,1,set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no)),set(skb_priority(0)),1,set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x3,ttl=128,frag=no)),1,100 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:579" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:591: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:591" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:591" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:591: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:591" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:591" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:591: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:591" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:591" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_738 -#AT_START_739 -at_fn_group_banner 739 'ofproto-dpif.at:594' \ - "ofproto-dpif - output/flood flags" " " 45 -at_xfail=no -( - $as_echo "739. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:595: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:595" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:595" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:595: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:595" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:595" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:595: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:595" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:595" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:595: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:595" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:595: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:595" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:595: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:595" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:595: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:595" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=dummy ofport_request=4 \ - -- add-port br0 p5 -- set Interface p5 type=dummy ofport_request=5 \ - -- add-port br0 p6 -- set Interface p6 type=dummy ofport_request=6 \ - -- add-port br0 p7 -- set Interface p7 type=dummy ofport_request=7 - -cat >flows.txt <<'_ATEOF' -in_port=local actions=local,flood -in_port=1 actions=flood -in_port=2 actions=all -in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7 -in_port=4 actions=enqueue:LOCAL:1,enqueue:1:1,enqueue:2:1,enqueue:3:2,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:605: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:605" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:605" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:606: ovs-ofctl mod-port br0 5 noforward" -at_fn_check_prepare_trace "ofproto-dpif.at:606" -( $at_check_trace; ovs-ofctl mod-port br0 5 noforward -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:606" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:607: ovs-ofctl mod-port br0 6 noflood" -at_fn_check_prepare_trace "ofproto-dpif.at:607" -( $at_check_trace; ovs-ofctl mod-port br0 6 noflood -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:607" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:609: ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'" -at_fn_check_prepare_trace "ofproto-dpif.at:609" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:609" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:610: tail -1 stdout \\ -| sed -e 's/Datapath actions: //' | tr ',' '\\n' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:610" -( $at_check_trace; tail -1 stdout \ -| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -2 -3 -4 -7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:610" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:619: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'" -at_fn_check_prepare_trace "ofproto-dpif.at:619" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:619" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:620: tail -1 stdout \\ -| sed -e 's/Datapath actions: //' | tr ',' '\\n' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:620" -( $at_check_trace; tail -1 stdout \ -| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "100 -2 -3 -4 -7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:620" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:629: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'" -at_fn_check_prepare_trace "ofproto-dpif.at:629" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:629" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:630: tail -1 stdout \\ -| sed -e 's/Datapath actions: //' | tr ',' '\\n' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:630" -( $at_check_trace; tail -1 stdout \ -| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -100 -3 -4 -6 -7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:630" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:640: ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'" -at_fn_check_prepare_trace "ofproto-dpif.at:640" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:640" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:641: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:641" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 100,1,2,4,6,7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:641" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:645: ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'" -at_fn_check_prepare_trace "ofproto-dpif.at:645" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:645" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:646: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:646" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:646" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:649: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:649" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:649" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:649: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:649" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:649" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:649: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:649" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:649" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_739 -#AT_START_740 -at_fn_group_banner 740 'ofproto-dpif.at:652' \ - "ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)" "" 45 -at_xfail=no -( - $as_echo "740. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:653: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:653" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:653: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:653" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:653: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:653" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:653: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:653" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:653" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:653: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:653" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:653" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:653: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:653" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:653" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:653: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:653" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:653" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:660: ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:660" -( $at_check_trace; ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:660" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:665: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:665" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:665" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:666: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:666" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:666" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:667: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:667" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:667" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:678: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:678" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:678" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:679: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:679" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:679" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:683: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:683" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:683: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:683" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:683: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:683" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:683" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_740 -#AT_START_741 -at_fn_group_banner 741 'ofproto-dpif.at:686' \ - "ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)" "" 45 -at_xfail=no -( - $as_echo "741. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:687: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:687" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:687: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:687" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:687: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:687" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:687: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:687" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:687: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:687" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:687: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:687" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:687: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:687" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:693: ovs-ofctl del-flows br0" -at_fn_check_prepare_trace "ofproto-dpif.at:693" -( $at_check_trace; ovs-ofctl del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:693" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:695: ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:695" -( $at_check_trace; ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:695" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:701: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:701" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:701" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:703: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:703" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:703" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:706: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:706" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:706" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:707: ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:707" -( $at_check_trace; ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_FLOW reply (OF1.3): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:707" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:711: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:711" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:711" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:711: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:711" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:711" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:711: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:711" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:711" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_741 -#AT_START_742 -at_fn_group_banner 742 'ofproto-dpif.at:714' \ - "ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER" "" 45 -at_xfail=no -( - $as_echo "742. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:715: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:715" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:715" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:715: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:715" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:715" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:715: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:715" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:715" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:715: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:715" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:715" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:715: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:715" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:715" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:715: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:715" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:715" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:715: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:715" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:715" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:721: ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'" -at_fn_check_prepare_trace "ofproto-dpif.at:721" -( $at_check_trace; ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:721" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:723: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:723" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:723" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:728: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:728" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:728" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:729: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:729" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:729" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:730: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:730" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:730" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:741: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:741" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:741" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -sleep 1 # wait for revalidator to update stats -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:743: ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:743" -( $at_check_trace; ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=3, n_bytes=180, actions=goto_table:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:743" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:748: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:748" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:748" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:748: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:748" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:748" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:748: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:748" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:748" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_742 -#AT_START_743 -at_fn_group_banner 743 'ofproto-dpif.at:751' \ - "ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER" "" 45 -at_xfail=no -( - $as_echo "743. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:752: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:752" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:752" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:752: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:752" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:752" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:752: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:752" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:752" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:752: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:752" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:752" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:752: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:752" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:752" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:752: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:752" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:752" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:752: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:752" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:752" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:758: ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'" -at_fn_check_prepare_trace "ofproto-dpif.at:758" -( $at_check_trace; ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:758" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:760: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:760" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:760" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:766: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:766" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:766" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:767: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:767" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:767" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:770: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:770" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:770" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -sleep 1 # wait for revalidator to update stats -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:772: ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:772" -( $at_check_trace; ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=3, n_bytes=180, actions=resubmit(1,1) -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:772" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:777: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:777" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:777" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:777: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:777" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:777" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:777: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:777" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:777" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_743 -#AT_START_744 -at_fn_group_banner 744 'ofproto-dpif.at:780' \ - "ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE" "" 45 -at_xfail=no -( - $as_echo "744. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:781: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:781" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:781" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:781: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:781" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:781" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:781: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:781" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:781" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:781: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:781" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:781: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:781" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:781: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:781" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:781: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:781" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:787: ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'" -at_fn_check_prepare_trace "ofproto-dpif.at:787" -( $at_check_trace; ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:787" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:788: ovs-ofctl -OOpenFlow11 mod-table br0 all continue" -at_fn_check_prepare_trace "ofproto-dpif.at:788" -( $at_check_trace; ovs-ofctl -OOpenFlow11 mod-table br0 all continue -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:788" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:791: ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:791" -( $at_check_trace; ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:791" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:796: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:796" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:796" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:797: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:797" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:797" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:799: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:799" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:799" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:811: ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:811" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:811" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:816: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:816" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:816" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:817: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:817" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:817" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:819: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:819" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:819" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:830: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:830" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:830" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -sleep 1 # wait for revalidator to update stats -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:832: ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:832" -( $at_check_trace; ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:832" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:837: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:837" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:837" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:837: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:837" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:837" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:837: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:837" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:837" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_744 -#AT_START_745 -at_fn_group_banner 745 'ofproto-dpif.at:840' \ - "ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE" "" 45 -at_xfail=no -( - $as_echo "745. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:841: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:841" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:841" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:841: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:841" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:841" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:841: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:841" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:841" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:841: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:841" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:841" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:841: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:841" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:841" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:841: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:841" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:841" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:841: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:841" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:841" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -cat >flows.txt <<'_ATEOF' -table=0 actions=goto_table(1) -table=2 dl_src=10:11:11:11:11:11 actions=controller -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:851: ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:851" -( $at_check_trace; ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:851" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:852: ovs-ofctl -OOpenFlow11 mod-table br0 all continue" -at_fn_check_prepare_trace "ofproto-dpif.at:852" -( $at_check_trace; ovs-ofctl -OOpenFlow11 mod-table br0 all continue -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:852" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:855: ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:855" -( $at_check_trace; ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:855" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:860: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:860" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:860" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:861: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:861" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:861" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:863: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:863" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:863" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:875: ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:875" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:880: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:880" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:880" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:881: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:881" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:881" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:883: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:883" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:883" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:894: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:894" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:894" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -sleep 1 # wait for revalidator to update stats -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:896: ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:896" -( $at_check_trace; ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=6, n_bytes=360, actions=goto_table:1 - table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:896" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:902: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:902" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:902" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:902: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:902" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:902" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:902: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:902" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:902" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_745 -#AT_START_746 -at_fn_group_banner 746 'ofproto-dpif.at:905' \ - "ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE" "" 45 -at_xfail=no -( - $as_echo "746. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:906: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:906" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:906" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:906: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:906" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:906" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:906: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:906" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:906" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:906: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:906" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:906" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:906: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:906" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:906" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:906: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:906" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:906" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:906: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:906" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:906" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -cat >flows.txt <<'_ATEOF' -table=0 actions=resubmit(1,1) -table=2 dl_src=10:11:11:11:11:11 actions=controller -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:916: ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:916" -( $at_check_trace; ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:916" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:917: ovs-ofctl -OOpenFlow11 mod-table br0 all continue" -at_fn_check_prepare_trace "ofproto-dpif.at:917" -( $at_check_trace; ovs-ofctl -OOpenFlow11 mod-table br0 all continue -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:917" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:920: ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:920" -( $at_check_trace; ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:920" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:925: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:925" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:925" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:927: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:927" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:927" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:931: ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:931" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:931" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:936: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:936" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:936" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:938: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:938" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:938" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:941: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:941" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:941" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -sleep 1 # wait for revalidator to update stats -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:943: ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:943" -( $at_check_trace; ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=6, n_bytes=360, actions=resubmit(1,1) - table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:943" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:949: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:949" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:949" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:949: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:949" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:949" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:949: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:949" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:949" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_746 -#AT_START_747 -at_fn_group_banner 747 'ofproto-dpif.at:952' \ - "ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP" "" 45 -at_xfail=no -( - $as_echo "747. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:953: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:953" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:953" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:953: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:953" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:953" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:953: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:953" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:953" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:953: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:953" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:953" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:953: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:953" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:953" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:953: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:953" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:953" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:953: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:953" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:953" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:959: ovs-ofctl -OOpenFlow11 mod-table br0 all drop" -at_fn_check_prepare_trace "ofproto-dpif.at:959" -( $at_check_trace; ovs-ofctl -OOpenFlow11 mod-table br0 all drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:959" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:961: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:961" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:961" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:967: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:967" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:967" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:969: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:969" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:969" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:972: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:972" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:972" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:973: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:973" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:973" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:977: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:977" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:977" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:977: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:977" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:977" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:977: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:977" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:977" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_747 -#AT_START_748 -at_fn_group_banner 748 'ofproto-dpif.at:980' \ - "ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP" "" 45 -at_xfail=no -( - $as_echo "748. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:981: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:981" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:981" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:981: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:981" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:981" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:981: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:981" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:981" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:981: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:981" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:981" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:981: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:981" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:981" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:981: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:981" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:981" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:981: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:981" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:981" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:987: ovs-ofctl del-flows br0" -at_fn_check_prepare_trace "ofproto-dpif.at:987" -( $at_check_trace; ovs-ofctl del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:987" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:988: ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'" -at_fn_check_prepare_trace "ofproto-dpif.at:988" -( $at_check_trace; ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:988" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:989: ovs-ofctl -OOpenFlow11 mod-table br0 all drop" -at_fn_check_prepare_trace "ofproto-dpif.at:989" -( $at_check_trace; ovs-ofctl -OOpenFlow11 mod-table br0 all drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:991: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:991" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:991" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:997: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:997" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:997" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:999: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:999" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:999" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1002: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:1002" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1002" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -sleep 1 # wait for revalidator to update stats -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1004: ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1004" -( $at_check_trace; ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=3, n_bytes=180, actions=goto_table:1 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1009: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1009" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1009" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1009: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1009" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1009" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1009: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1009" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1009" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_748 -#AT_START_749 -at_fn_group_banner 749 'ofproto-dpif.at:1012' \ - "ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP" "" 45 -at_xfail=no -( - $as_echo "749. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1013: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1013" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1013" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1013: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1013" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1013" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1013: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1013" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1013" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1013: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1013" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1013" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1013: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1013" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1013" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1013: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1013" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1013" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1013: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1013" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1013" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1019: ovs-ofctl del-flows br0" -at_fn_check_prepare_trace "ofproto-dpif.at:1019" -( $at_check_trace; ovs-ofctl del-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1019" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1020: ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'" -at_fn_check_prepare_trace "ofproto-dpif.at:1020" -( $at_check_trace; ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1020" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1021: ovs-ofctl -OOpenFlow11 mod-table br0 all drop" -at_fn_check_prepare_trace "ofproto-dpif.at:1021" -( $at_check_trace; ovs-ofctl -OOpenFlow11 mod-table br0 all drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1021" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1023: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1023" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1023" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1029: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1029" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1029" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1031: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1031" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1031" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1034: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:1034" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1034" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -sleep 1 # wait for revalidator to update stats -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1036: ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1036" -( $at_check_trace; ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=3, n_bytes=180, actions=resubmit(1,1) -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1036" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1041: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1041" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1041" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1041: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1041" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1041" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1041: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1041" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1041" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_749 -#AT_START_750 -at_fn_group_banner 750 'ofproto-dpif.at:1044' \ - "ofproto-dpif - controller" " " 45 -at_xfail=no -( - $as_echo "750. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1045: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1045" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1045" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1045: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1045" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1045" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1045: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1045" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1045" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1045: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1045" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1045" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1045: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1045" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1045" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1045: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1045" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1045" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1045: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1045" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1045" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -cat >flows.txt <<'_ATEOF' -cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller -cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1) -cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller - -cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[],mod_vlan_vid:80,controller,resubmit(81,2) -cookie=0x4 table=2 in_port=81 actions=load:2->NXM_NX_REG1[],mod_dl_src:80:81:81:81:81:81,controller,resubmit(82,3) -cookie=0x5 table=3 in_port=82 actions=load:3->NXM_NX_REG2[],mod_dl_dst:82:82:82:82:82:82,controller,resubmit(83,4) -cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[],mod_nw_src:83.83.83.83,controller,resubmit(84,5) -cookie=0x7 table=5 in_port=84 actions=load:5->NXM_NX_REG4[],load:6->NXM_NX_TUN_ID[],mod_nw_dst:84.84.84.84,controller,resubmit(85,6) -cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7) -cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller -cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller -cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],controller -cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],pop_mpls:0x0800,controller -cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],controller -cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],controller -cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],dec_mpls_ttl,controller -cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],set_mpls_ttl(10),controller -cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],dec_mpls_ttl,set_mpls_ttl(10),controller -cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],load:3->OXM_OF_MPLS_TC[],set_mpls_ttl(10),dec_mpls_ttl,controller -cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[],controller -cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller -cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[],load:7->OXM_OF_MPLS_TC[],controller -cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[],controller,load:0xc0a88001->OXM_OF_ARP_SPA[],controller,load:0x404444444441->OXM_OF_ARP_THA[],load:0x01010101->OXM_OF_ARP_SPA[],load:0x02020202->OXM_OF_ARP_TPA[],controller -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1077: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:1077" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1077" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1080: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1080" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1080" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1085: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1085" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1085" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1086: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1086" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1086" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1088: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1088" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=0x010 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1088" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1100: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1100" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1105: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1105" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1105" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1106: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1106" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1108: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1108" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1108" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1120: ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1120" -( $at_check_trace; ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1120" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=30:33:33:33:33:33,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x001)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1125: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1125" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1125" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1126: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1126" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1126" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1128: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1128" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x001 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x001 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x001 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1128" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1140: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1140" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:41,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1145: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1145" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1145" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1146: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1146" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1146" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1148: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1148" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1160: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1160" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1160" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1165: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1165" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1165" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1166: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1166" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1166" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1168: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1168" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1168" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1180: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1180" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1180" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1185: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1185" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1185" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1186: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1186" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1186" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1188: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1188" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -ip,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1188" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1200: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1200" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1200" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:43,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1207: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1207" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1207" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1208: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1208" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1208" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1210: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1210" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1210" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1222: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1222" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1222" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1227: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1227" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1227" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1228: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1228" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1228" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1230: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1230" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1230" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1242: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1242" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:45,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1247: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1247" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1247" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1248: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1248" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1248" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1250: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1250" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1250" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1262: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1262" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1262" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:46,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1267: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1267" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1267" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1268: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1268" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1268" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1270: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1270" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1270" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1282: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1282" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1282" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:47,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1287: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1287" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1287" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1288: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1288" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1288" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1290: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1290" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1302: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1302" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1302" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:48,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1307: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1307" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1307" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1308: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1308" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1308" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1310: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1310" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1322: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1322" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1322" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:55:55:55:55:55,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1327: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1327" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1327" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1328: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1328" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1328" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1330: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1330" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1342: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1342" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=70:77:77:77:77:77,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1347: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1347" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1347" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1348: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1348" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1348" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1350: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1350" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 -NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1367: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1367" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 66 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45' -done -#for i in 2 3; do -# ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=60:66:66:66:66:66,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=100,bos=1)' -#done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1375: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1375" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1375" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1376: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1376" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1376" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1378: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1378" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0x000 tcp_csum:7744 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0x000 tcp_csum:7744 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0x000 tcp_csum:7744 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1378" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1390: ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1390" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1390" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1395: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 18 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1395" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 18 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1395" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1396: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1396" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1396" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1398: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1398" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:0 -NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:1a03 -NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=0x001 tcp_csum:3205 -NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=0x001 tcp_csum:31b8 -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=0x001 tcp_csum:316d -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=0x001 tcp_csum:316d -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1398" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1428: ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1428" -( $at_check_trace; ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1428" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 ; do - ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1433: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 18 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1433" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 18 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1433" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1434: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1434" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1434" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1436: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1436" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234 -NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37 -NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439 -NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1 -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered) -udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1436" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1466: ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1466" -( $at_check_trace; ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1472: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 9 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1472" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 9 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1473: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1473" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1473" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1474: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1474" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -arp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1474" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1495: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:1495" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1495" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1498: ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1498" -( $at_check_trace; ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1498" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 ; do - ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04' -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1504: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 18 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1504" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 18 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1504" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1505: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1505" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1505" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1506: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1506" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered) -sctp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157 -NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:7f12662e -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67 -NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered) -sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1506" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1535: ovs-ofctl dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1535" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1) - cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535 - cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2) - cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3) - cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4) - cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5) - cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[],load:0x6->NXM_NX_TUN_ID[],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6) - cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7) - cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],dec_mpls_ttl,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],set_mpls_ttl(10),CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],load:0x3->OXM_OF_MPLS_TC[],pop_mpls:0x0800,CONTROLLER:65535 - cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[],CONTROLLER:65535 - cookie=0xc, n_packets=3, n_bytes=180, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[],load:0x7->OXM_OF_MPLS_TC[],CONTROLLER:65535 - cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[],load:0x1010101->NXM_OF_ARP_SPA[],load:0x2020202->NXM_OF_ARP_TPA[],CONTROLLER:65535 - cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535 - n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1535" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1562: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1562" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1562: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1562" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1562: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1562" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_750 -#AT_START_751 -at_fn_group_banner 751 'ofproto-dpif.at:1566' \ - "ofproto-dpif - table-miss flow (OpenFlow 1.0)" " " 45 -at_xfail=no -( - $as_echo "751. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1567: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1567" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1567" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1567: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1567" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1567" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1567: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1567" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1567" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1567: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1567" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1567: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1567" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1567: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1567" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1567: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1567" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -# A table-miss flow has priority 0 and no match -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1574: ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'" -at_fn_check_prepare_trace "ofproto-dpif.at:1574" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1577: ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1577" -( $at_check_trace; ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1577" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1582: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1582" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1582" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1585: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1585" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1585" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1596: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:1596" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1596" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1598: ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1598" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 -NXST_FLOW reply: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1598" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1603: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1603" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1603: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1603" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1603: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1603" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_751 -#AT_START_752 -at_fn_group_banner 752 'ofproto-dpif.at:1607' \ - "ofproto-dpif - table-miss flow (OpenFlow 1.3)" " " 45 -at_xfail=no -( - $as_echo "752. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1608: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1608" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1608" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1608: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1608" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1608" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1608: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1608" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1608" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1608: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1608" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1608" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1608: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1608" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1608" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1608: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1608" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1608" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1608: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1608" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1608" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -# A table-miss flow has priority 0 and no match -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1615: ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'" -at_fn_check_prepare_trace "ofproto-dpif.at:1615" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1615" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1618: ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1618" -( $at_check_trace; ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1618" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3 ; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1623: ovs_wait_cond () { test \`wc -l < ofctl_monitor.log\` -ge 6 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1623" -( $at_check_trace; ovs_wait_cond () { test `wc -l < ofctl_monitor.log` -ge 6 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1623" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1626: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:1626" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1626" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1628: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1628" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered) -tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=0x002 tcp_csum:0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1639: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:1639" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1639" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1641: ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1641" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535 -OFPST_FLOW reply (OF1.3): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1641" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1646: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1646" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1646" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1646: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1646" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1646" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1646: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1646" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1646" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_752 -#AT_START_753 -at_fn_group_banner 753 'ofproto-dpif.at:1649' \ - "ofproto-dpif - ARP modification slow-path" " " 45 -at_xfail=no -( - $as_echo "753. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1650: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1650" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1650" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1650: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1650" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1650" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1650: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1650" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1650" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1650: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1650" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1650: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1650" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1650: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1650" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1650: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:1650" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - -ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap -ovs-ofctl add-flow br0 'in_port=1,arp actions=load:2->OXM_OF_ARP_OP[],2,load:0xc0a88001->OXM_OF_ARP_SPA[],2,load:0x404444444441->OXM_OF_ARP_THA[],2' - -# Input some packets that should follow the arp modification slow-path. -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1660: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:1660" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1660" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check the packets that were output. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1663: ovs-ofctl parse-pcap p2.pcap" -at_fn_check_prepare_trace "ofproto-dpif.at:1663" -( $at_check_trace; ovs-ofctl parse-pcap p2.pcap -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00 -arp,metadata=0,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1663" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1675: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1675" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1675" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1675: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1675" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1675" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1675: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1675" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1675" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_753 -#AT_START_754 -at_fn_group_banner 754 'ofproto-dpif.at:1678' \ - "ofproto-dpif - VLAN handling" " " 45 -at_xfail=no -( - $as_echo "754. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1679: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1679" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1679" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1679: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1679" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1679" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1679: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1679" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1679" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1679: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1679" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1679" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1679: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1679" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1679" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1679: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1679" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1679" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1679: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -- \\ - add-port br0 p1 trunks=10,12 -- \\ - add-port br0 p2 tag=10 -- \\ - add-port br0 p3 tag=12 \\ - other-config:priority-tags=true -- \\ - add-port br0 p4 tag=12 -- \\ - add-port br0 p5 vlan_mode=native-tagged tag=10 -- \\ - add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \\ - add-port br0 p7 vlan_mode=native-untagged tag=12 -- \\ - add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \\ - other-config:priority-tags=true -- \\ - set Interface p1 type=dummy -- \\ - set Interface p2 type=dummy -- \\ - set Interface p3 type=dummy -- \\ - set Interface p4 type=dummy -- \\ - set Interface p5 type=dummy -- \\ - set Interface p6 type=dummy -- \\ - set Interface p7 type=dummy -- \\ - set Interface p8 type=dummy -- " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1679" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -- \ - add-port br0 p1 trunks=10,12 -- \ - add-port br0 p2 tag=10 -- \ - add-port br0 p3 tag=12 \ - other-config:priority-tags=true -- \ - add-port br0 p4 tag=12 -- \ - add-port br0 p5 vlan_mode=native-tagged tag=10 -- \ - add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \ - add-port br0 p7 vlan_mode=native-untagged tag=12 -- \ - add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \ - other-config:priority-tags=true -- \ - set Interface p1 type=dummy -- \ - set Interface p2 type=dummy -- \ - set Interface p3 type=dummy -- \ - set Interface p4 type=dummy -- \ - set Interface p5 type=dummy -- \ - set Interface p6 type=dummy -- \ - set Interface p7 type=dummy -- \ - set Interface p8 type=dummy -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1679" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -for tuple in \ - "100 none 0 drop" \ - "100 0 0 drop" \ - "100 0 1 drop" \ - "100 10 0 1,5,6,7,8,pop_vlan,2" \ - "100 10 1 1,5,6,7,8,pop_vlan,2" \ - "100 11 0 5,7" \ - "100 11 1 5,7" \ - "100 12 0 1,5,6,pop_vlan,3,4,7,8" \ - "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \ - "1 none 0 drop" \ - "1 0 0 drop" \ - "1 0 1 drop" \ - "1 10 0 5,6,7,8,100,pop_vlan,2" \ - "1 10 1 5,6,7,8,100,pop_vlan,2" \ - "1 11 0 drop" \ - "1 11 1 drop" \ - "1 12 0 5,6,100,pop_vlan,3,4,7,8" \ - "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \ - "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \ - "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \ - "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \ - "2 10 0 drop" \ - "2 10 1 drop" \ - "2 11 0 drop" \ - "2 11 1 drop" \ - "2 12 0 drop" \ - "2 12 1 drop" \ - "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \ - "3 10 0 drop" \ - "3 10 1 drop" \ - "3 11 0 drop" \ - "3 11 1 drop" \ - "3 12 0 drop" \ - "3 12 1 drop" \ - "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \ - "4 10 0 drop" \ - "4 10 1 drop" \ - "4 11 0 drop" \ - "4 11 1 drop" \ - "4 12 0 drop" \ - "4 12 1 drop" \ - "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \ - "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \ - "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \ - "5 10 0 1,6,7,8,100,pop_vlan,2" \ - "5 10 1 1,6,7,8,100,pop_vlan,2" \ - "5 11 0 7,100" \ - "5 11 1 7,100" \ - "5 12 0 1,6,100,pop_vlan,3,4,7,8" \ - "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \ - "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \ - "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \ - "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \ - "6 10 0 1,5,7,8,100,pop_vlan,2" \ - "6 10 1 1,5,7,8,100,pop_vlan,2" \ - "6 11 0 drop" \ - "6 11 1 drop" \ - "6 12 0 1,5,100,pop_vlan,3,4,7,8" \ - "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \ - "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \ - "7 10 0 1,5,6,8,100,pop_vlan,2" \ - "7 10 1 1,5,6,8,100,pop_vlan,2" \ - "7 11 0 5,100" \ - "7 11 1 5,100" \ - "7 12 0 1,5,6,100,pop_vlan,3,4,8" \ - "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \ - "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \ - "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \ - "8 10 0 1,5,6,7,100,pop_vlan,2" \ - "8 10 1 1,5,6,7,100,pop_vlan,2" \ - "8 11 0 drop" \ - "8 11 1 drop" \ - "8 12 0 1,5,6,100,pop_vlan,3,4,7" \ - "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3" -do - set $tuple - in_port=$1 - vlan=$2 - pcp=$3 - expected=$4 - - if test $vlan = none; then - flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)" - else - flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=$vlan,pcp=$pcp),encap(eth_type(0xabcd))" - fi - - echo "----------------------------------------------------------------------" - echo "in_port=$in_port vlan=$vlan pcp=$pcp" - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1801: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:1801" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1801" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1804: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "ofproto-dpif.at:1804" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1804" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1806: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "ofproto-dpif.at:1806" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1806" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1809: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1809" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1809" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1809: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1809" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1809" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1809: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1809" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1809" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_754 -#AT_START_755 -at_fn_group_banner 755 'ofproto-dpif.at:1812' \ - "ofproto-dpif - MPLS handling" " " 45 -at_xfail=no -( - $as_echo "755. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1813: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1813" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1813" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1813: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1813" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1813" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1813: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1813" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1813" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1813: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1813" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1813" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1813: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1813" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1813" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1813: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1813" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1813" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1813: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1813" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1813" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -cat >flows.txt <<'_ATEOF' -dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller -dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller -dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1824: ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:1824" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1824" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1827: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1827" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1827" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:00,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1832: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1832" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1832" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1833: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1833" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1833" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1835: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1835" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00 -00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8 -00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00 -00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8 -00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00 -00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8 -00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1835" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1860: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1860" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1860" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:01,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1865: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1865" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1865" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1866: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1866" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1866" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1868: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1868" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 -00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 -00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 -00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 -00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 -00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 -00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 -00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 -00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 -00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1868" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1895: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1895" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1895" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:02,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1900: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1900" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1900" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1901: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1901" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1901" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1903: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1903" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 -00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00 -00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 -00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 -00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00 -00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 -00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mplsm,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280 -00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00 -00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00 -00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1903" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1926: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:1926" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1926" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1926: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1926" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1926" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1926: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:1926" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1926" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_755 -#AT_START_756 -at_fn_group_banner 756 'ofproto-dpif.at:1929' \ - "ofproto-dpif - VLAN+MPLS handling" " " 45 -at_xfail=no -( - $as_echo "756. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1930: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:1930" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1930" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1930: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:1930" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1930" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1930: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1930" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1930" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1930: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:1930" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1930" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1930: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:1930" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1930" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1930: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1930" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1930" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1930: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1930" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1930" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -cat >flows.txt <<'_ATEOF' -cookie=0xa dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller -cookie=0xa dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller -cookie=0xa dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[],set_vlan_pcp:1,controller -cookie=0xa dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[],set_vlan_pcp:1,controller -cookie=0xa dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],controller -cookie=0xa dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],controller -cookie=0xa dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],controller -cookie=0xa dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],controller -cookie=0xa dl_src=40:44:44:44:54:58,vlan_tci=0x1000/0x1000 actions=load:99->OXM_OF_VLAN_VID[],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],controller -cookie=0xa dl_src=40:44:44:44:54:59,vlan_tci=0x1000/0x1000 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[],set_vlan_pcp:1,load:99->OXM_OF_VLAN_VID[],controller -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1948: ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:1948" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1948" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1953: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1953" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1953" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:50,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1958: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1958" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1958" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1959: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1959" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1959" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1961: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1961" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1961" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1990: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:1990" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1990" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:51,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1995: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:1995" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1995" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1996: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:1996" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1996" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:1998: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:1998" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:1998" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2024: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2024" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2024" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:52,dst=52:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2029: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2029" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2029" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2030: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2030" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2030" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2032: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2032" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2032" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2061: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2061" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2061" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:53,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2066: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2066" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2066" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2067: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2067" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2067" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2069: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2069" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2069" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2095: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2095" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2095" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:54,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2100: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2100" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2100" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2101: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2101" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2101" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2103: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2103" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2103" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2132: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2132" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2132" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:55,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2137: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2137" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2137" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2138: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2138" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2138" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2140: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2140" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2166: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2166" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2166" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:56,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2171: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2171" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2171" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2172: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2172" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2172" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2174: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2174" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -00000040 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2174" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2203: ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2203" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2203" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:57,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2208: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2208" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2208" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2209: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2209" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2209" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2211: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2211" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2211" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2237: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2237" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:58,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2242: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2242" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2243: ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2243" -( $at_check_trace; ovs_wait_cond () { if test -e ovs-ofctl.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2243" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2245: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2245" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2245" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2271: ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:2271" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2271" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -for i in 1 2 3; do - ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:59,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))' -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2276: ovs_wait_cond () { test \`grep OFPT_PACKET_IN ofctl_monitor.log | wc -l\` -ge 3 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:2276" -( $at_check_trace; ovs_wait_cond () { test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2276" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -ovs-appctl -t ovs-ofctl exit - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2279: cat ofctl_monitor.log | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2279" -( $at_check_trace; cat ofctl_monitor.log | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered) -mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 -00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63 -00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 -00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 -00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2279" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2302: ovs-appctl time/warp 5000" -at_fn_check_prepare_trace "ofproto-dpif.at:2302" -( $at_check_trace; ovs-appctl time/warp 5000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2302" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2303: ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2303" -( $at_check_trace; ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[],set_field:1->vlan_pcp,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[],set_field:1->vlan_pcp,CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:58 actions=load:0x63->OXM_OF_VLAN_VID[],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],CONTROLLER:65535 - cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:59 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[],set_field:1->vlan_pcp,load:0x63->OXM_OF_VLAN_VID[],CONTROLLER:65535 -OFPST_FLOW reply (OF1.2): -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2303" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2317: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2317" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2317" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2317: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2317" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2317" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2317: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2317" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2317" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_756 -#AT_START_757 -at_fn_group_banner 757 'ofproto-dpif.at:2320' \ - "ofproto-dpif - fragment handling" " " 45 -at_xfail=no -( - $as_echo "757. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2321: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2321" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2321" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2321: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2321" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2321: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2321" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2321" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2321: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2321" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2321: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2321" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2321: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2321" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2321: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2321" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2321" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=dummy ofport_request=4 \ - -- add-port br0 p5 -- set Interface p5 type=dummy ofport_request=5 \ - -- add-port br0 p6 -- set Interface p6 type=dummy ofport_request=6 \ - -- add-port br0 p90 -- set Interface p90 type=dummy ofport_request=90 -cat >flows.txt <<'_ATEOF' -priority=75 tcp ip_frag=no tp_dst=80 actions=output:1 -priority=75 tcp ip_frag=first tp_dst=80 actions=output:2 -priority=75 tcp ip_frag=later tp_dst=80 actions=output:3 -priority=50 tcp ip_frag=no actions=output:4 -priority=50 tcp ip_frag=first actions=output:5 -priority=50 tcp ip_frag=later actions=output:6 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2331: ovs-ofctl replace-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2331" -( $at_check_trace; ovs-ofctl replace-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2331" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128" -no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)" -first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)" -later_flow="$base_flow,frag=later)" - - # mode no first later -for tuple in \ - 'normal 1 5 6' \ - 'drop 1 drop drop' \ - 'nx-match 1 2 6' -do - set $tuple - mode=$1 - no=$2 - first=$3 - later=$4 - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2350: ovs-ofctl set-frags br0 \$mode" -at_fn_check_prepare_dynamic "ovs-ofctl set-frags br0 $mode" "ofproto-dpif.at:2350" -( $at_check_trace; ovs-ofctl set-frags br0 $mode -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - for type in no first later; do - eval flow=\$${type}_flow exp_output=\$$type - printf "\n%s\n" "----$mode $type-----" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2354: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2354" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2354" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - : > expout - if test $mode = drop && test $type != no; then - echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout - fi - echo "Datapath actions: $exp_output" >> expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2360: grep 'IP fragments' stdout; tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2360" -( $at_check_trace; grep 'IP fragments' stdout; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2360" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - done -done -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2363: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2363" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2363: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2363" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2363: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2363" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2363" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_757 -#AT_START_758 -at_fn_group_banner 758 'ofproto-dpif.at:2366' \ - "ofproto-dpif - exit" " " 45 -at_xfail=no -( - $as_echo "758. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2367: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2367" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2367" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2367: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2367" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2367" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2367: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2367" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2367" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2367: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2367" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2367: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2367" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2367: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2367" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2367: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2367" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2367" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \ - -- add-port br0 p10 -- set Interface p10 type=dummy ofport_request=10 \ - -- add-port br0 p11 -- set Interface p11 type=dummy ofport_request=11 \ - -- add-port br0 p12 -- set Interface p12 type=dummy ofport_request=12 \ - -- add-port br0 p13 -- set Interface p13 type=dummy ofport_request=13 \ - -- add-port br0 p14 -- set Interface p14 type=dummy ofport_request=14 -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:10,exit,output:11 -in_port=2 actions=output:12,resubmit:1,output:12 -in_port=3 actions=output:13,resubmit:2,output:14 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2374: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2374" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2374" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2375: ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:2375" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2375" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2376: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2376" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2376" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2379: ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:2379" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2379" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2380: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2380" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 12,10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2380" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2383: ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:2383" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2383" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2384: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2384" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 13,12,10 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2384" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2387: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2387" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2387: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2387" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2387: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2387" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_758 -#AT_START_759 -at_fn_group_banner 759 'ofproto-dpif.at:2391' \ - "ofproto-dpif - mirroring, select_all" " " 45 -at_xfail=no -( - $as_echo "759. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2392: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2392" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2392" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2392: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2392" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2392" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2392: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2392" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2392" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2392: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2392" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2392: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2392" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2392: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2392" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2392: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2392" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2392" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p3 get Port p3 --\ - --id=@m create Mirror name=mymirror select_all=true output_port=@p3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -in_port=2 actions=output:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2403: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2403" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2403" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2406: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2406" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2406" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2407: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2407" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2407" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2412: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2412" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2412" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2413: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2413" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2413" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2417: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2417" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2417: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2417" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2417: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2417" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2417" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_759 -#AT_START_760 -at_fn_group_banner 760 'ofproto-dpif.at:2421' \ - "ofproto-dpif - mirroring, select_src" " " 45 -at_xfail=no -( - $as_echo "760. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2422: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2422" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2422" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2422: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2422" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2422" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2422: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2422" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2422" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2422: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2422" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2422" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2422: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2422" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2422" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2422: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2422" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2422" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2422: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2422" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2422" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\ - --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -in_port=2 actions=output:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2433: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2433" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2433" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2436: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2436" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2436" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2437: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2437" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2437" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2442: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2442" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2442" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2443: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2443" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2443" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2446: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2446" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2446" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2446: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2446" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2446" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2446: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2446" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2446" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_760 -#AT_START_761 -at_fn_group_banner 761 'ofproto-dpif.at:2449' \ - "ofproto-dpif - mirroring, OFPP_NONE ingress port" "" 45 -at_xfail=no -( - $as_echo "761. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2450: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2450" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2450" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2450: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2450" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2450" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2450: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2450" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2450" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2450: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2450" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2450" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2450: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2450" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2450" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2450: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2450" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2450" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2450: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2450" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2450" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p2 get Port p2 --\ - --id=@m create Mirror name=mymirror select_all=true output_port=@p2 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2457: ovs-ofctl add-flow br0 action=output:1" -at_fn_check_prepare_trace "ofproto-dpif.at:2457" -( $at_check_trace; ovs-ofctl add-flow br0 action=output:1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2457" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# "in_port" defaults to OFPP_NONE if it's not specified. -flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_ttl=128,icmp_type=8,icmp_code=0" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2461: ovs-appctl ofproto/trace br0 \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"$flow\"" "ofproto-dpif.at:2461" -( $at_check_trace; ovs-appctl ofproto/trace br0 "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2462: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2462" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1,2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2462" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2466: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2466" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2466: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2466" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2466: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2466" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2466" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_761 -#AT_START_762 -at_fn_group_banner 762 'ofproto-dpif.at:2470' \ - "ofproto-dpif - mirroring, select_dst" " " 45 -at_xfail=no -( - $as_echo "762. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2471: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2471" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2471" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2471: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2471" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2471" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2471: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2471" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2471" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2471: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2471" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2471: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2471" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2471: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2471" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2471: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2471" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\ - --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -in_port=2 actions=output:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2482: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2482" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2482" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2485: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2485" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2485" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2486: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2486" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2486" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2491: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2491" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2491" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2492: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2492" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2492" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2496: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2496" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2496" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2496: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2496" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2496" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2496: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2496" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2496" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_762 -#AT_START_763 -at_fn_group_banner 763 'ofproto-dpif.at:2500' \ - "ofproto-dpif - mirroring, select_vlan" " " 45 -at_xfail=no -( - $as_echo "763. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2501: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2501" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2501" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2501: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2501" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2501" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2501: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2501" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2501" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2501: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2501" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2501: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2501" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2501: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2501" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2501: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2501" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\ - --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3 - -cat >flows.txt <<'_ATEOF' -in_port=1, actions=output:2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2511: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2511" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2514: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2514" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2514" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2515: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2515" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2515" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2520: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2520" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2520" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2521: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2521" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2521" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=11,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2526: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2526" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2526" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2527: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2527" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2527" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2531: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2531" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2531: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2531" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2531: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2531" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2531" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_763 -#AT_START_764 -at_fn_group_banner 764 'ofproto-dpif.at:2535' \ - "ofproto-dpif - mirroring, output_port" " " 45 -at_xfail=no -( - $as_echo "764. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2536: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2536" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2536" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2536: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2536" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2536" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2536: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2536" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2536" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2536: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2536" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2536: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2536" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2536: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2536" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2536: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2536" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2536" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p3 get Port p3 --\ - --id=@m create Mirror name=mymirror select_all=true output_port=@p3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=mod_vlan_vid:17,output:2 -in_port=2 actions=output:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2547: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2547" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2547" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2550: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2550" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2550" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2551: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2551" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: push_vlan(vid=17,pcp=0),2,pop_vlan,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2551" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2556: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2556" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2556" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2557: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2557" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2557" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2561: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2561" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2561: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2561" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2561: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2561" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_764 -#AT_START_765 -at_fn_group_banner 765 'ofproto-dpif.at:2564' \ - "ofproto-dpif - mirroring, output_vlan" " " 45 -at_xfail=no -( - $as_echo "765. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2565: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2565" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2565" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2565: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2565" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2565" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2565: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2565" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2565" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2565: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2565" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2565" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2565: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2565" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2565" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2565: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2565" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2565" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2565: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2565" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2565" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@m create Mirror name=mymirror select_all=true output_vlan=12 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -in_port=2 actions=mod_vlan_vid:17,output:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2575: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2575" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2575" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2578: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2578" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2578" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -actual=`tail -1 stdout | sed 's/Datapath actions: //'` - -expected="2,push_vlan(vid=12,pcp=0),1,2,100" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2582: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "ofproto-dpif.at:2582" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2582" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2584: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "ofproto-dpif.at:2584" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2584" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2587: ovs-appctl ofproto/trace ovs-dummy \"\$flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\"" "ofproto-dpif.at:2587" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2587" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -actual=`tail -1 stdout | sed 's/Datapath actions: //'` - -expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100" -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2591: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\"" "ofproto-dpif.at:2591" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2591" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -mv stdout expout -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2593: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\"" -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\"" "ofproto-dpif.at:2593" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2593" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2595: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2595" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2595: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2595" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2595: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2595" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2595" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_765 -#AT_START_766 -at_fn_group_banner 766 'ofproto-dpif.at:2602' \ - "ofproto-dpif - ofproto/trace command 1" " " 45 -at_xfail=no -( - $as_echo "766. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2603: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2603" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2603" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2603: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2603" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2603" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2603: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2603" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2603" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2603: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2603" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2603: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2603" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2603: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2603" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2603: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:2603" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -in_port=2 actions=output:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2610: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2610" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2610" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -odp_flow="in_port(1)" -br_flow="in_port=1" -# Test command: ofproto/trace odp_flow with in_port as a name. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2615: ovs-appctl ofproto/trace \"\$odp_flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"$odp_flow\"" "ofproto-dpif.at:2615" -( $at_check_trace; ovs-appctl ofproto/trace "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2615" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2616: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2616" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2616" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -odp_flow="in_port(1)" -# Test command: ofproto/trace odp_flow -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2622: ovs-appctl ofproto/trace \"\$odp_flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"$odp_flow\"" "ofproto-dpif.at:2622" -( $at_check_trace; ovs-appctl ofproto/trace "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2622" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2623: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2623" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2623" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace dp_name odp_flow -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2628: ovs-appctl ofproto/trace ovs-dummy \"\$odp_flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$odp_flow\"" "ofproto-dpif.at:2628" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2629: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2629" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2629" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Test commmand: ofproto/trace br_name br_flow -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2633: ovs-appctl ofproto/trace br0 \"\$br_flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"$br_flow\"" "ofproto-dpif.at:2633" -( $at_check_trace; ovs-appctl ofproto/trace br0 "$br_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2633" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2634: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2634" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2634" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Delete the inserted flows -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2639: ovs-ofctl del-flows br0 \"in_port=1\"" -at_fn_check_prepare_trace "ofproto-dpif.at:2639" -( $at_check_trace; ovs-ofctl del-flows br0 "in_port=1" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2639" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2640: ovs-ofctl del-flows br0 \"in_port=2\"" -at_fn_check_prepare_trace "ofproto-dpif.at:2640" -( $at_check_trace; ovs-ofctl del-flows br0 "in_port=2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2640" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# This section beflow tests the [-generate] option -odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)" -br_flow="arp,metadata=0,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=ff:ff:ff:ff:ff:ff" - -# Test command: ofproto/trace odp_flow -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2647: ovs-appctl ofproto/trace \"\$odp_flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"$odp_flow\"" "ofproto-dpif.at:2647" -( $at_check_trace; ovs-appctl ofproto/trace "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2647" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check for no MAC learning entry -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2649: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2649" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2649" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace br_name br_flow -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2654: ovs-appctl ofproto/trace br0 \"\$br_flow\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"$br_flow\"" "ofproto-dpif.at:2654" -( $at_check_trace; ovs-appctl ofproto/trace br0 "$br_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2654" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check for no MAC learning entry -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2656: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2656" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2656" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace odp_flow -generate -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2661: ovs-appctl ofproto/trace \"\$odp_flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"$odp_flow\" -generate" "ofproto-dpif.at:2661" -( $at_check_trace; ovs-appctl ofproto/trace "$odp_flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2661" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check for the MAC learning entry -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2663: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2663" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 3 0 50:54:00:00:00:05 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2663" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace dp_name odp_flow -generate -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2669: ovs-appctl ofproto/trace ovs-dummy \\ - \"in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)\" \\ - -generate" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2669" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy \ - "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \ - -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2669" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check for both MAC learning entries -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2673: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2673" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 3 0 50:54:00:00:00:05 ? - 1 0 50:54:00:00:00:06 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2673" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace br_name br_flow -generate -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2680: ovs-appctl ofproto/trace br0 \\ - \"in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06\" \\ - -generate" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2680" -( $at_check_trace; ovs-appctl ofproto/trace br0 \ - "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \ - -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2680" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check for both MAC learning entries. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2684: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2684" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 3 0 50:54:00:00:00:05 ? - 1 0 50:54:00:00:00:06 ? - 2 0 50:54:00:00:00:07 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2684" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# This section beflow tests the [packet] option -# The ovs-tcpundump of packets between port1 and port2 -pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000" -pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000" - -# Construct the MAC learning table -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2697: ovs-appctl ofproto/trace ovs-dummy \\ - \"in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)\" \\ - -generate" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2697" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy \ - "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \ - -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2697" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Construct the MAC learning table -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2702: ovs-appctl ofproto/trace ovs-dummy \\ - \"in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)\" \\ - -generate" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2702" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy \ - "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \ - -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2702" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace odp_flow packet -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2707: ovs-appctl ofproto/trace \\ - \"in_port(1),skb_priority(1),skb_mark(2)\" \"\$pkt1to2\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2707" -( $at_check_trace; ovs-appctl ofproto/trace \ - "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2707" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2709: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2709" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2709" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2712: head -n 2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2712" -( $at_check_trace; head -n 2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Bridge: br0 -Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2712" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace dp_name odp_flow packet -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2718: ovs-appctl ofproto/trace ovs-dummy \\ - \"in_port(1),skb_priority(1),skb_mark(2)\" \"\$pkt1to2\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2718" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy \ - "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2718" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2720: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2720" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2720" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2723: head -n 2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2723" -( $at_check_trace; head -n 2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Bridge: br0 -Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2723" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test command: ofproto/trace br_name br_flow packet -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2729: ovs-appctl ofproto/trace br0 \\ - \"in_port=2,skb_priority=2,pkt_mark=1\" \"\$pkt2to1\"" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2729" -( $at_check_trace; ovs-appctl ofproto/trace br0 \ - "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2729" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2731: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2731" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2731" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2734: head -n 2 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2734" -( $at_check_trace; head -n 2 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Bridge: br0 -Flow: pkt_mark=0x1,skb_priority=0x2,arp,metadata=0,in_port=2,vlan_tci=0x0000,dl_src=50:54:00:00:00:02,dl_dst=50:54:00:00:00:01,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2734" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2739: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2739" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2739" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2739: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2739" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2739" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2739: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2739" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2739" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_766 -#AT_START_767 -at_fn_group_banner 767 'ofproto-dpif.at:2743' \ - "ofproto-dpif - ofproto/trace command 2" " " 45 -at_xfail=no -( - $as_echo "767. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2744: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2744" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2744" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2744: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2744" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2744" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2744: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2744" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2744" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2744: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2744" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2744" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2744: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2744" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2744" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2744: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2744" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2744" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2744: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2744" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2744" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - -# Define flows -odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)" -br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02" -# Define options -generate="-generate" -pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000" - -# Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet] -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2755: ovs-appctl ofproto/trace wrong_name \"\$odp_flow\" " -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace wrong_name \"$odp_flow\" " "ofproto-dpif.at:2755" -( $at_check_trace; ovs-appctl ofproto/trace wrong_name "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2755" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2755: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2755" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2755" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2755: ovs-appctl ofproto/trace wrong_name \"\$odp_flow\" \"\$generate\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace wrong_name \"$odp_flow\" \"$generate\"" "ofproto-dpif.at:2755" -( $at_check_trace; ovs-appctl ofproto/trace wrong_name "$odp_flow" "$generate" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2755" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2755: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2755" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2755" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2755: ovs-appctl ofproto/trace wrong_name \"\$odp_flow\" \"\$pkt\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace wrong_name \"$odp_flow\" \"$pkt\"" "ofproto-dpif.at:2755" -( $at_check_trace; ovs-appctl ofproto/trace wrong_name "$odp_flow" "$pkt" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2755" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2755: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2755" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2755" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet] -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2768: ovs-appctl ofproto/trace \"\" \"\$odp_flow\" " -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"\" \"$odp_flow\" " "ofproto-dpif.at:2768" -( $at_check_trace; ovs-appctl ofproto/trace "" "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2768" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2768: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2768" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2768" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2768: ovs-appctl ofproto/trace \"\" \"\$odp_flow\" \"\$generate\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"\" \"$odp_flow\" \"$generate\"" "ofproto-dpif.at:2768" -( $at_check_trace; ovs-appctl ofproto/trace "" "$odp_flow" "$generate" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2768" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2768: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2768" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2768" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2768: ovs-appctl ofproto/trace \"\" \"\$odp_flow\" \"\$pkt\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"\" \"$odp_flow\" \"$pkt\"" "ofproto-dpif.at:2768" -( $at_check_trace; ovs-appctl ofproto/trace "" "$odp_flow" "$pkt" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2768" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2768: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2768" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2768" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet] -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2781: ovs-appctl ofproto/trace ovs-system \"\$odp_flow\" " -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-system \"$odp_flow\" " "ofproto-dpif.at:2781" -( $at_check_trace; ovs-appctl ofproto/trace ovs-system "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2781: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2781" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2781: ovs-appctl ofproto/trace ovs-system \"\$odp_flow\" \"\$generate\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-system \"$odp_flow\" \"$generate\"" "ofproto-dpif.at:2781" -( $at_check_trace; ovs-appctl ofproto/trace ovs-system "$odp_flow" "$generate" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2781: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2781" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2781: ovs-appctl ofproto/trace ovs-system \"\$odp_flow\" \"\$pkt\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-system \"$odp_flow\" \"$pkt\"" "ofproto-dpif.at:2781" -( $at_check_trace; ovs-appctl ofproto/trace ovs-system "$odp_flow" "$pkt" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2781: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2781" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2781" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet] -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2794: ovs-appctl ofproto/trace br0 \"\$odp_flow\" " -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"$odp_flow\" " "ofproto-dpif.at:2794" -( $at_check_trace; ovs-appctl ofproto/trace br0 "$odp_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2794" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2794: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2794" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2794" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2794: ovs-appctl ofproto/trace br0 \"\$odp_flow\" \"\$generate\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"$odp_flow\" \"$generate\"" "ofproto-dpif.at:2794" -( $at_check_trace; ovs-appctl ofproto/trace br0 "$odp_flow" "$generate" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2794" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2794: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2794" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2794" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2794: ovs-appctl ofproto/trace br0 \"\$odp_flow\" \"\$pkt\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace br0 \"$odp_flow\" \"$pkt\"" "ofproto-dpif.at:2794" -( $at_check_trace; ovs-appctl ofproto/trace br0 "$odp_flow" "$pkt" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2794" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2794: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2794" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Cannot find the datapath -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2794" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet] -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2807: ovs-appctl ofproto/trace ovs-dummy \"\$br_flow\" " -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$br_flow\" " "ofproto-dpif.at:2807" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$br_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2807" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2807: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2807" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Unknown bridge name -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2807" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2807: ovs-appctl ofproto/trace ovs-dummy \"\$br_flow\" \"\$generate\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$br_flow\" \"$generate\"" "ofproto-dpif.at:2807" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$br_flow" "$generate" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2807" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2807: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2807" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Unknown bridge name -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2807" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2807: ovs-appctl ofproto/trace ovs-dummy \"\$br_flow\" \"\$pkt\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$br_flow\" \"$pkt\"" "ofproto-dpif.at:2807" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$br_flow" "$pkt" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2807" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2807: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2807" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Unknown bridge name -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2807" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace br_flow [-generate|packet] -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2820: ovs-appctl ofproto/trace \"\$br_flow\" " -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"$br_flow\" " "ofproto-dpif.at:2820" -( $at_check_trace; ovs-appctl ofproto/trace "$br_flow" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2820: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2820" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Must specify bridge name -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2820: ovs-appctl ofproto/trace \"\$br_flow\" \"\$generate\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"$br_flow\" \"$generate\"" "ofproto-dpif.at:2820" -( $at_check_trace; ovs-appctl ofproto/trace "$br_flow" "$generate" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2820: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2820" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Must specify bridge name -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2820: ovs-appctl ofproto/trace \"\$br_flow\" \"\$pkt\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace \"$br_flow\" \"$pkt\"" "ofproto-dpif.at:2820" -( $at_check_trace; ovs-appctl ofproto/trace "$br_flow" "$pkt" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2820: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2820" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Must specify bridge name -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2820" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace dp_name odp_flow garbage_option -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2833: ovs-appctl ofproto/trace \\ - ovs-dummy \"\$odp_flow\" garbage_option" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2833" -( $at_check_trace; ovs-appctl ofproto/trace \ - ovs-dummy "$odp_flow" garbage_option -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2833" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2836: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2836" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Trailing garbage in packet data -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2836" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace with 4 arguments -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2842: ovs-appctl ofproto/trace \\ - arg1, arg2, arg3, arg4" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2842" -( $at_check_trace; ovs-appctl ofproto/trace \ - arg1, arg2, arg3, arg4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2842" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2844: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2844" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"ofproto/trace\" command takes at most 3 arguments -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2844" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Test incorrect command: ofproto/trace with 0 argument -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2850: ovs-appctl ofproto/trace " -at_fn_check_prepare_trace "ofproto-dpif.at:2850" -( $at_check_trace; ovs-appctl ofproto/trace -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 2 $at_status "$at_srcdir/ofproto-dpif.at:2850" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2851: tail -2 stderr" -at_fn_check_prepare_trace "ofproto-dpif.at:2851" -( $at_check_trace; tail -2 stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"ofproto/trace\" command requires at least 1 arguments -ovs-appctl: ovs-vswitchd: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2851" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2856: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2856" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2856" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2856: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2856" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2856" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2856: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2856" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2856" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_767 -#AT_START_768 -at_fn_group_banner 768 'ofproto-dpif.at:2859' \ - "ofproto-dpif - ofproto/trace-packet-out" " " 45 -at_xfail=no -( - $as_echo "768. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2860: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2860" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2860" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2860: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2860" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2860" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2860: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2860" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2860" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2860: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2860" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2860" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2860: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2860" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2860" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2860: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2860" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2860" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2860: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:2860" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2860" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -in_port=2 actions=output:1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2867: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:2867" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2867" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2869: ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:2869" -( $at_check_trace; ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2869" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2870: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:2870" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: push_vlan(vid=123,pcp=0),2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2870" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2874: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2874" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2874" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2874: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2874" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2874" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2874: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2874" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2874" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_768 -#AT_START_769 -at_fn_group_banner 769 'ofproto-dpif.at:2889' \ - "ofproto-dpif - MAC learning" " " 45 -at_xfail=no -( - $as_echo "769. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2890: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2890" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2890" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2890: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2890" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2890" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2890: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2890" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2890" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2890: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2890" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2890" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2890: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2890" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2890" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2890: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2890" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2890" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2890: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:2890" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2890" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' - -# Trace an ARP packet arriving on p3, to create a MAC learning entry. -flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2896: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "ofproto-dpif.at:2896" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2896" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - expected="1,2,100" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2896: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\" " "ofproto-dpif.at:2896" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2896" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2896: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\" " "ofproto-dpif.at:2896" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2896" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for the MAC learning entry. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2903: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2903" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 3 0 50:54:00:00:00:05 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2903" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace a packet arrival destined for the learned MAC. -# (This will also learn a MAC.) -flow="in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2910: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "ofproto-dpif.at:2910" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2910" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - expected="3" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2910: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\" " "ofproto-dpif.at:2910" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2910" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2910: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\" " "ofproto-dpif.at:2910" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2910" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check for both MAC learning entries. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2917: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2917" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 3 0 50:54:00:00:00:05 ? - 1 0 50:54:00:00:00:06 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2917" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace a packet arrival that updates the first learned MAC entry. -flow="in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2924: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "ofproto-dpif.at:2924" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2924" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - expected="1,3,100" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2924: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\" " "ofproto-dpif.at:2924" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2924" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2924: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\" " "ofproto-dpif.at:2924" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2924" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check that the MAC learning entry was updated. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2931: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2931" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 1 0 50:54:00:00:00:06 ? - 2 0 50:54:00:00:00:05 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2931" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Add another bridge. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2938: ovs-vsctl \\ - -- add-br br1 \\ - -- set bridge br1 datapath-type=dummy" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2938" -( $at_check_trace; ovs-vsctl \ - -- add-br br1 \ - -- set bridge br1 datapath-type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2938" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br1 p4 -- set Interface p4 type=dummy ofport_request=4 \ - -- add-port br1 p5 -- set Interface p5 type=dummy ofport_request=5 - -# Trace some packet arrivals in br1 to create MAC learning entries there too. -flow="in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2945: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "ofproto-dpif.at:2945" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2945" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - expected="5,101" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2945: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\" " "ofproto-dpif.at:2945" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2945" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2945: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\" " "ofproto-dpif.at:2945" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2945" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -flow="in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2950: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "ofproto-dpif.at:2950" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2950" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - expected="4,101" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2950: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\" " "ofproto-dpif.at:2950" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2950" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2950: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\" " "ofproto-dpif.at:2950" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2950" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check that the MAC learning entries were added. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2957: ovs-appctl fdb/show br1 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2957" -( $at_check_trace; ovs-appctl fdb/show br1 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 4 0 50:54:00:00:00:06 ? - 5 0 50:54:00:00:00:07 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2957" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Delete port p1 and see that its MAC learning entry disappeared, and -# that the MAC learning entry for the same MAC was also deleted from br1. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2965: ovs-vsctl del-port p1" -at_fn_check_prepare_trace "ofproto-dpif.at:2965" -( $at_check_trace; ovs-vsctl del-port p1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2965" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2966: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2966" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 2 0 50:54:00:00:00:05 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2966" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2970: ovs-appctl fdb/show br1 | sed 's/[0-9]\\{1,\\}\$/?/'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2970" -( $at_check_trace; ovs-appctl fdb/show br1 | sed 's/[0-9]\{1,\}$/?/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " port VLAN MAC Age - 5 0 50:54:00:00:00:07 ? -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2970" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2975: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:2975" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2975" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2975: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2975" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2975" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2975: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:2975" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2975" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_769 -#AT_START_770 -at_fn_group_banner 770 'ofproto-dpif.at:2978' \ - "ofproto-dpif - MAC table overflow" " " 45 -at_xfail=no -( - $as_echo "770. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2979: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:2979" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2979" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2979: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:2979" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2979" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2979: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2979" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2979" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2979: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:2979" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2979" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2979: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:2979" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2979" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2979: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:2979" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2979" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2979: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 fail-mode=standalone other-config:mac-table-size=10 " -at_fn_check_prepare_trace "ofproto-dpif.at:2979" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set bridge br0 fail-mode=standalone other-config:mac-table-size=10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2979" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 - -arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2985: ovs-appctl time/stop" -at_fn_check_prepare_trace "ofproto-dpif.at:2985" -( $at_check_trace; ovs-appctl time/stop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2985" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace 10 ARP packets arriving on p3, to create MAC learning entries. -for i in 0 1 2 3 4 5 6 7 8 9; do - flow="in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2989: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "ofproto-dpif.at:2989" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - expected="1,2,100" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2989: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\" " "ofproto-dpif.at:2989" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2989: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\" " "ofproto-dpif.at:2989" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - ovs-appctl time/warp 1000 -done - -# Check for the MAC learning entries. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:2998: ovs-appctl fdb/show br0 | sed 's/ *[0-9]\\{1,\\}\$//' | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:2998" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/ *[0-9]\{1,\}$//' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " 3 0 50:54:00:00:00:00 - 3 0 50:54:00:00:00:01 - 3 0 50:54:00:00:00:02 - 3 0 50:54:00:00:00:03 - 3 0 50:54:00:00:00:04 - 3 0 50:54:00:00:00:05 - 3 0 50:54:00:00:00:06 - 3 0 50:54:00:00:00:07 - 3 0 50:54:00:00:00:08 - 3 0 50:54:00:00:00:09 - port VLAN MAC Age -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:2998" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace another ARP packet on another MAC. -flow="in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3014: ovs-appctl ofproto/trace ovs-dummy \"\$flow\" -generate" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"$flow\" -generate" "ofproto-dpif.at:3014" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "$flow" -generate -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3014" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - actual=`tail -1 stdout | sed 's/Datapath actions: //'` - expected="1,2,100" - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3014: ovs-dpctl normalize-actions \"\$flow\" \"\$expected\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$expected\" " "ofproto-dpif.at:3014" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$expected" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3014" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - mv stdout expout - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3014: ovs-dpctl normalize-actions \"\$flow\" \"\$actual\" " -at_fn_check_prepare_dynamic "ovs-dpctl normalize-actions \"$flow\" \"$actual\" " "ofproto-dpif.at:3014" -( $at_check_trace; ovs-dpctl normalize-actions "$flow" "$actual" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3014" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check that the new one chased the oldest one out of the table. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3021: ovs-appctl fdb/show br0 | sed 's/[0-9]\\{1,\\}\$/?/' | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:3021" -( $at_check_trace; ovs-appctl fdb/show br0 | sed 's/[0-9]\{1,\}$/?/' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " 3 0 50:54:00:00:00:01 ? - 3 0 50:54:00:00:00:02 ? - 3 0 50:54:00:00:00:03 ? - 3 0 50:54:00:00:00:04 ? - 3 0 50:54:00:00:00:05 ? - 3 0 50:54:00:00:00:06 ? - 3 0 50:54:00:00:00:07 ? - 3 0 50:54:00:00:00:08 ? - 3 0 50:54:00:00:00:09 ? - 3 0 50:54:00:00:00:10 ? - port VLAN MAC Age -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3021" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3035: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3035" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3035" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3035: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3035" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3035" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3035: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3035" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3035" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_770 -#AT_START_771 -at_fn_group_banner 771 'ofproto-dpif.at:3336' \ - "ofproto-dpif - sFlow packet sampling - IPv4 collector" "" 45 -at_xfail=no -( - $as_echo "771. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3336" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3336" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3336" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3336" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3336" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3336" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:3336" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-sflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:3336" -( $at_check_trace; ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - SFLOW_PORT=`parse_listening_port < test-sflow.log` - ovs-appctl time/stop - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - ovs-vsctl \ - set Interface br0 options:ifindex=1002 -- \ - set Interface p1 options:ifindex=1004 -- \ - set Interface p2 options:ifindex=1003 -- \ - set Bridge br0 sflow=@sf -- \ - --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \ - header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE - - - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.2,tip=192.168.0.1,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' - sleep 1 - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:07,tha=00:00:00:00:00:00)' - sleep 1 - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' - sleep 1 - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)' - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=fe80::1,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)' - - for i in `seq 1 30`; do - ovs-appctl time/warp 100 - done - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3336" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3336" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3336" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - ovs-appctl -t test-sflow exit - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: sort sflow.log | \$EGREP 'HEADER|ERROR' | sed 's/ /\\ - /g'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3336" -( $at_check_trace; sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\ - /g' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=1 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=1 - dropEvents=0 - in_ifindex=1004 - in_format=0 - out_ifindex=2 - out_format=2 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-05-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-05-C0-A8-00-02-00-00-00-00-00-00-C0-A8-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=2 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=2 - dropEvents=0 - in_ifindex=1003 - in_format=0 - out_ifindex=2 - out_format=2 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-07-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-07-C0-A8-00-01-00-00-00-00-00-00-C0-A8-00-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=3 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=3 - dropEvents=0 - in_ifindex=1004 - in_format=0 - out_ifindex=1003 - out_format=0 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-01-C0-A8-00-02-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=4 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=4 - dropEvents=0 - in_ifindex=1003 - in_format=0 - out_ifindex=1004 - out_format=0 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-02-C0-A8-00-01-00-00-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=5 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=5 - dropEvents=0 - in_ifindex=1003 - in_format=0 - out_ifindex=1004 - out_format=0 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-67-00-00-00-00-00-0A-80-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-01-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-02-00-00-00-00-00-00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3336: sort sflow.log | \$EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\\ - /g'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3336" -( $at_check_trace; sort sflow.log | $EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\ - /g' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "IFCOUNTERS - dgramSeqNo=2 - ds=127.0.0.1>0:1002 - csSeqNo=1 - ifindex=1002 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=0 - in_unicasts=0 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=2 - ds=127.0.0.1>0:1003 - csSeqNo=1 - ifindex=1003 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=138 - in_unicasts=3 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=2 - ds=127.0.0.1>0:1004 - csSeqNo=1 - ifindex=1004 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=84 - in_unicasts=2 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=180 - out_unicasts=3 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=3 - ds=127.0.0.1>0:1002 - csSeqNo=2 - ifindex=1002 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=0 - in_unicasts=0 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=3 - ds=127.0.0.1>0:1003 - csSeqNo=2 - ifindex=1003 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=138 - in_unicasts=3 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=3 - ds=127.0.0.1>0:1004 - csSeqNo=2 - ifindex=1004 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=84 - in_unicasts=2 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=180 - out_unicasts=3 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3336" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_771 -#AT_START_772 -at_fn_group_banner 772 'ofproto-dpif.at:3337' \ - "ofproto-dpif - sFlow packet sampling - IPv6 collector" "" 45 -at_xfail=no -( - $as_echo "772. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3337" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3337" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3337" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3337" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3337" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3337" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:3337" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-sflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:[::1] > sflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:3337" -( $at_check_trace; ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:[::1] > sflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - SFLOW_PORT=`parse_listening_port < test-sflow.log` - ovs-appctl time/stop - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - ovs-vsctl \ - set Interface br0 options:ifindex=1002 -- \ - set Interface p1 options:ifindex=1004 -- \ - set Interface p2 options:ifindex=1003 -- \ - set Bridge br0 sflow=@sf -- \ - --id=@sf create sflow targets=\"[::1]:$SFLOW_PORT\" \ - header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE - - - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.2,tip=192.168.0.1,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' - sleep 1 - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:07,tha=00:00:00:00:00:00)' - sleep 1 - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' - sleep 1 - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)' - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=fe80::1,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)' - - for i in `seq 1 30`; do - ovs-appctl time/warp 100 - done - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3337" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3337" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3337" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - ovs-appctl -t test-sflow exit - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: sort sflow.log | \$EGREP 'HEADER|ERROR' | sed 's/ /\\ - /g'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3337" -( $at_check_trace; sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\ - /g' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=1 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=1 - dropEvents=0 - in_ifindex=1004 - in_format=0 - out_ifindex=2 - out_format=2 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-05-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-05-C0-A8-00-02-00-00-00-00-00-00-C0-A8-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=2 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=2 - dropEvents=0 - in_ifindex=1003 - in_format=0 - out_ifindex=2 - out_format=2 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-07-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-07-C0-A8-00-01-00-00-00-00-00-00-C0-A8-00-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=3 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=3 - dropEvents=0 - in_ifindex=1004 - in_format=0 - out_ifindex=1003 - out_format=0 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-01-C0-A8-00-02-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=4 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=4 - dropEvents=0 - in_ifindex=1003 - in_format=0 - out_ifindex=1004 - out_format=0 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-02-C0-A8-00-01-00-00-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 -HEADER - dgramSeqNo=1 - ds=127.0.0.1>2:1000 - fsSeqNo=5 - in_vlan=0 - in_priority=0 - out_vlan=0 - out_priority=0 - meanSkip=1 - samplePool=5 - dropEvents=0 - in_ifindex=1003 - in_format=0 - out_ifindex=1004 - out_format=0 - hdr_prot=1 - pkt_len=64 - stripped=4 - hdr_len=60 - hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-67-00-00-00-00-00-0A-80-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-01-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-02-00-00-00-00-00-00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3337: sort sflow.log | \$EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\\ - /g'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3337" -( $at_check_trace; sort sflow.log | $EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\ - /g' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "IFCOUNTERS - dgramSeqNo=2 - ds=127.0.0.1>0:1002 - csSeqNo=1 - ifindex=1002 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=0 - in_unicasts=0 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=2 - ds=127.0.0.1>0:1003 - csSeqNo=1 - ifindex=1003 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=138 - in_unicasts=3 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=2 - ds=127.0.0.1>0:1004 - csSeqNo=1 - ifindex=1004 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=84 - in_unicasts=2 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=180 - out_unicasts=3 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=3 - ds=127.0.0.1>0:1002 - csSeqNo=2 - ifindex=1002 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=0 - in_unicasts=0 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=3 - ds=127.0.0.1>0:1003 - csSeqNo=2 - ifindex=1003 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=138 - in_unicasts=3 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=120 - out_unicasts=2 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -IFCOUNTERS - dgramSeqNo=3 - ds=127.0.0.1>0:1004 - csSeqNo=2 - ifindex=1004 - type=6 - ifspeed=100000000 - direction=0 - status=0 - in_octets=84 - in_unicasts=2 - in_multicasts=0 - in_broadcasts=4294967295 - in_discards=0 - in_errors=0 - in_unknownprotos=4294967295 - out_octets=180 - out_unicasts=3 - out_multicasts=4294967295 - out_broadcasts=4294967295 - out_discards=0 - out_errors=0 - promiscuous=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3337" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"sflow.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_772 -#AT_START_773 -at_fn_group_banner 773 'ofproto-dpif.at:3387' \ - "ofproto-dpif - NetFlow flow expiration - IPv4 collector" "" 45 -at_xfail=no -( - $as_echo "773. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3387" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3387" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3387" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3387" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3387" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3387" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:3387" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - - ovs-appctl time/stop - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-netflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:3387" -( $at_check_trace; ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - NETFLOW_PORT=`parse_listening_port < test-netflow.log` - - ovs-vsctl \ - set Bridge br0 netflow=@nf -- \ - --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \ - engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false - - for delay in 1000 30000; do - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' - sleep 1 # ensure the order in which these two packets are processed - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)' - - ovs-appctl time/warp $delay - done - - ovs-appctl time/warp 6000 - sleep 1 - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3387" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3387" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3387" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - ovs-appctl -t test-netflow exit - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: test \`grep \"192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0\" netflow.log | wc -l\` -eq 1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:3387" -( $at_check_trace; test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: test \`grep \"192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0\" netflow.log | wc -l\` -eq 1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:3387" -( $at_check_trace; test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l` - separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l` - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3387: test \$separate = 2 || test \$combined = 1" -at_fn_check_prepare_dynamic "test $separate = 2 || test $combined = 1" "ofproto-dpif.at:3387" -( $at_check_trace; test $separate = 2 || test $combined = 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3387" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_773 -#AT_START_774 -at_fn_group_banner 774 'ofproto-dpif.at:3388' \ - "ofproto-dpif - NetFlow flow expiration - IPv6 collector" "" 45 -at_xfail=no -( - $as_echo "774. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3388" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3388" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3388" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3388" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3388" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3388" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:3388" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - - ovs-appctl time/stop - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-netflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:[::1] > netflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:3388" -( $at_check_trace; ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:[::1] > netflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - NETFLOW_PORT=`parse_listening_port < test-netflow.log` - - ovs-vsctl \ - set Bridge br0 netflow=@nf -- \ - --id=@nf create NetFlow targets=\"[::1]:$NETFLOW_PORT\" \ - engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false - - for delay in 1000 30000; do - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' - sleep 1 # ensure the order in which these two packets are processed - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)' - - ovs-appctl time/warp $delay - done - - ovs-appctl time/warp 6000 - sleep 1 - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3388" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3388" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3388" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - ovs-appctl -t test-netflow exit - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: test \`grep \"192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0\" netflow.log | wc -l\` -eq 1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:3388" -( $at_check_trace; test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: test \`grep \"192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0\" netflow.log | wc -l\` -eq 1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ofproto-dpif.at:3388" -( $at_check_trace; test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l` - separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l` - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3388: test \$separate = 2 || test \$combined = 1" -at_fn_check_prepare_dynamic "test $separate = 2 || test $combined = 1" "ofproto-dpif.at:3388" -( $at_check_trace; test $separate = 2 || test $combined = 1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3388" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_774 -#AT_START_775 -at_fn_group_banner 775 'ofproto-dpif.at:3471' \ - "ofproto-dpif - NetFlow active expiration - IPv4 collector" "" 45 -at_xfail=no -( - $as_echo "775. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3471" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3471" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3471" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3471" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-netflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - NETFLOW_PORT=`parse_listening_port < test-netflow.log` - - ovs-vsctl \ - set Bridge br0 netflow=@nf -- \ - --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \ - engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovs-appctl time/stop" -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; ovs-appctl time/stop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - n=1 - while test $n -le 60; do - n=`expr $n + 1` - - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=1234,dst=80)' - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)' - - ovs-appctl time/warp 1000 - done - - ovs-appctl time/warp 10000 - - sleep 1 - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3471" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - ovs-appctl -t test-netflow exit - - # Count the number of reported packets: - # - From source to destination before MAC learning kicks in (just one). - # - From source to destination after that. - # - From destination to source. - n_learn=0 - n_in=0 - n_out=0 - n_other=0 - n_recs=0 - none=0 - while read line; do - pkts=`echo "$line" | sed 's/.*, \([0-9]*\) pkts,.*/\1/'` - case $pkts in - [0-9]*) ;; - *) continue ;; - esac - - case $line in - "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*) - counter=n_learn - ;; - "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*) - counter=n_in - ;; - "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*) - counter=n_out - ;; - *) - counter=n_other - ;; - esac - eval $counter=\`expr \$$counter + \$pkts\` - n_recs=`expr $n_recs + 1` - done < netflow.log - - # There should be exactly 1 MAC learning packet, - # exactly 59 other packets in that direction, - # and exactly 60 packets in the other direction. - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3471: echo \$n_learn \$n_in \$n_out \$n_other" -at_fn_check_prepare_dynamic "echo $n_learn $n_in $n_out $n_other" "ofproto-dpif.at:3471" -( $at_check_trace; echo $n_learn $n_in $n_out $n_other -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 59 60 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3471" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_775 -#AT_START_776 -at_fn_group_banner 776 'ofproto-dpif.at:3472' \ - "ofproto-dpif - NetFlow active expiration - IPv6 collector" "" 45 -at_xfail=no -( - $as_echo "776. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3472" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3472" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3472" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3472" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-netflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:[::1] > netflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:[::1] > netflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - NETFLOW_PORT=`parse_listening_port < test-netflow.log` - - ovs-vsctl \ - set Bridge br0 netflow=@nf -- \ - --id=@nf create NetFlow targets=\"[::1]:$NETFLOW_PORT\" \ - engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovs-appctl time/stop" -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; ovs-appctl time/stop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - n=1 - while test $n -le 60; do - n=`expr $n + 1` - - ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=1234,dst=80)' - ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)' - - ovs-appctl time/warp 1000 - done - - ovs-appctl time/warp 10000 - - sleep 1 - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3472" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - ovs-appctl -t test-netflow exit - - # Count the number of reported packets: - # - From source to destination before MAC learning kicks in (just one). - # - From source to destination after that. - # - From destination to source. - n_learn=0 - n_in=0 - n_out=0 - n_other=0 - n_recs=0 - none=0 - while read line; do - pkts=`echo "$line" | sed 's/.*, \([0-9]*\) pkts,.*/\1/'` - case $pkts in - [0-9]*) ;; - *) continue ;; - esac - - case $line in - "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*) - counter=n_learn - ;; - "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*) - counter=n_in - ;; - "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*) - counter=n_out - ;; - *) - counter=n_other - ;; - esac - eval $counter=\`expr \$$counter + \$pkts\` - n_recs=`expr $n_recs + 1` - done < netflow.log - - # There should be exactly 1 MAC learning packet, - # exactly 59 other packets in that direction, - # and exactly 60 packets in the other direction. - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3472: echo \$n_learn \$n_in \$n_out \$n_other" -at_fn_check_prepare_dynamic "echo $n_learn $n_in $n_out $n_other" "ofproto-dpif.at:3472" -( $at_check_trace; echo $n_learn $n_in $n_out $n_other -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 59 60 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3472" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_776 -#AT_START_777 -at_fn_group_banner 777 'ofproto-dpif.at:3474' \ - "ofproto-dpif - flow stats" " " 45 -at_xfail=no -( - $as_echo "777. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3475: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3475" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3475" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3475: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3475" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3475" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3475: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3475" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3475" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3475: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3475" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3475" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3475: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3475" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3475" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3475: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3475" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3475" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3475: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3475" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3475" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3476: ovs-ofctl add-flow br0 \"ip,actions=NORMAL\"" -at_fn_check_prepare_trace "ofproto-dpif.at:3476" -( $at_check_trace; ovs-ofctl add-flow br0 "ip,actions=NORMAL" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3476" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3477: ovs-ofctl add-flow br0 \"icmp,actions=NORMAL\"" -at_fn_check_prepare_trace "ofproto-dpif.at:3477" -( $at_check_trace; ovs-ofctl add-flow br0 "icmp,actions=NORMAL" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3477" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl time/stop - -for i in `seq 1 10`; do - ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)' -done - -ovs-appctl time/warp 1000 -sleep 1 # wait for revalidator to update stats - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3488: ovs-ofctl dump-flows br0" -at_fn_check_prepare_trace "ofproto-dpif.at:3488" -( $at_check_trace; ovs-ofctl dump-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3488" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3489: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed -n 's/duration=[0-9]*\\.[0-9]*s/duration=0.0s/p' | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:3489" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed -n 's/duration=[0-9]*\.[0-9]*s/duration=0.0s/p' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL - cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3489" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3493: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3493" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3493" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3493: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3493" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3493" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3493: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3493" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3493" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_777 -#AT_START_778 -at_fn_group_banner 778 'ofproto-dpif.at:3496' \ - "ofproto-dpif - flow stats, set-n-threads" " " 45 -at_xfail=no -( - $as_echo "778. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3497: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3497" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3497" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3497: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3497" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3497" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3497: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3497" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3497" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3497: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3497" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3497: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3497" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3497: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3497" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3497: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3497" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3498: ovs-ofctl add-flow br0 \"ip,actions=NORMAL\"" -at_fn_check_prepare_trace "ofproto-dpif.at:3498" -( $at_check_trace; ovs-ofctl add-flow br0 "ip,actions=NORMAL" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3498" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3499: ovs-ofctl add-flow br0 \"icmp,actions=NORMAL\"" -at_fn_check_prepare_trace "ofproto-dpif.at:3499" -( $at_check_trace; ovs-ofctl add-flow br0 "icmp,actions=NORMAL" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3499" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl time/stop - -for i in `seq 1 10`; do - ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)' -done - -ovs-appctl time/warp 100 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3508: ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2" -at_fn_check_prepare_trace "ofproto-dpif.at:3508" -( $at_check_trace; ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3508" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/warp 1000 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3511: ovs-ofctl dump-flows br0" -at_fn_check_prepare_trace "ofproto-dpif.at:3511" -( $at_check_trace; ovs-ofctl dump-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3512: sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed -n 's/duration=[0-9]*\\.[0-9]*s/duration=0.0s/p' | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:3512" -( $at_check_trace; sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout | sed -n 's/duration=[0-9]*\.[0-9]*s/duration=0.0s/p' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL - cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3512" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3516: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3516" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3516" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3516: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3516" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3516" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3516: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3516" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3516" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_778 -#AT_START_779 -at_fn_group_banner 779 'ofproto-dpif.at:3519' \ - "idle_age and hard_age increase over time" " " 45 -at_xfail=no -( - $as_echo "779. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3520: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3520" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3520" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3520: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3520" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3520" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3520: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3520" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3520" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3520: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3520" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3520" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3520: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3520" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3520" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3520: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3520" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3520" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3520: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3520" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3520" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# get_ages DURATION HARD IDLE -# -# Fetch the flow duration, hard age, and idle age into the variables -# whose names are given as arguments. Rounds DURATION down to the -# nearest integer. If hard_age doesn't appear in the output, sets -# HARD to "none". If idle_age doesn't appear in the output, sets IDLE -# to 0. -get_ages () { - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3530: ovs-ofctl dump-flows br0" -at_fn_check_prepare_trace "ofproto-dpif.at:3530" -( $at_check_trace; ovs-ofctl dump-flows br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3530" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - duration=`sed -n 's/.*duration=\([0-9]*\)\(\.[0-9]*\)\{0,1\}s.*/\1/p' stdout` - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3533: expr X\"\$duration\" : 'X[0-9][0-9]*\$'" -at_fn_check_prepare_dynamic "expr X\"$duration\" : 'X[0-9][0-9]*$'" "ofproto-dpif.at:3533" -( $at_check_trace; expr X"$duration" : 'X[0-9][0-9]*$' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3533" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - eval $1=\$duration - - hard=`sed -n 's/.*hard_age=\([0-9]*\),.*/\1/p' stdout` - if test X"$hard" = X; then - hard=none - else - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3540: expr X\"\$hard\" : 'X[0-9][0-9]*\$'" -at_fn_check_prepare_dynamic "expr X\"$hard\" : 'X[0-9][0-9]*$'" "ofproto-dpif.at:3540" -( $at_check_trace; expr X"$hard" : 'X[0-9][0-9]*$' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3540" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - fi - eval $2=\$hard - - idle=`sed -n 's/.*idle_age=\([0-9]*\),.*/\1/p' stdout` - if test X"$idle" = X; then - idle=0 - else - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3548: expr X\"\$idle\" : 'X[0-9][0-9]*\$'" -at_fn_check_prepare_dynamic "expr X\"$idle\" : 'X[0-9][0-9]*$'" "ofproto-dpif.at:3548" -( $at_check_trace; expr X"$idle" : 'X[0-9][0-9]*$' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - fi - eval $3=\$idle -} - -# Add a flow and get its initial hard and idle age. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3554: ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop" -at_fn_check_prepare_trace "ofproto-dpif.at:3554" -( $at_check_trace; ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3554" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -get_ages duration1 hard1 idle1 - -ovs-appctl time/stop -# Warp time forward by 10 seconds, then modify the flow's actions. -ovs-appctl time/warp 10000 -get_ages duration2 hard2 idle2 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3561: ovs-ofctl mod-flows br0 actions=flood" -at_fn_check_prepare_trace "ofproto-dpif.at:3561" -( $at_check_trace; ovs-ofctl mod-flows br0 actions=flood -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Warp time forward by 10 seconds. -ovs-appctl time/warp 10000 -get_ages duration3 hard3 idle3 - -# Warp time forward 10 more seconds, then pass some packets through the flow, -# then warp forward a few more times because idle times are only updated -# occasionally. -ovs-appctl time/warp 10000 -ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)' -ovs-appctl time/warp 1000 -ovs-appctl time/warp 1000 -ovs-appctl time/warp 1000 -sleep 1 -get_ages duration4 hard4 idle4 - -printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4 -printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4 -printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4 - -# Duration should increase steadily over time. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3583: test \$duration1 -lt \$duration2" -at_fn_check_prepare_dynamic "test $duration1 -lt $duration2" "ofproto-dpif.at:3583" -( $at_check_trace; test $duration1 -lt $duration2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3583" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3584: test \$duration2 -lt \$duration3" -at_fn_check_prepare_dynamic "test $duration2 -lt $duration3" "ofproto-dpif.at:3584" -( $at_check_trace; test $duration2 -lt $duration3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3584" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3585: test \$duration3 -lt \$duration4" -at_fn_check_prepare_dynamic "test $duration3 -lt $duration4" "ofproto-dpif.at:3585" -( $at_check_trace; test $duration3 -lt $duration4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3585" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Hard age should be "none" initially because it's the same as flow_duration, -# then it should increase. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3589: test \$hard1 = none" -at_fn_check_prepare_dynamic "test $hard1 = none" "ofproto-dpif.at:3589" -( $at_check_trace; test $hard1 = none -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3589" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3590: test \$hard2 = none" -at_fn_check_prepare_dynamic "test $hard2 = none" "ofproto-dpif.at:3590" -( $at_check_trace; test $hard2 = none -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3590" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3591: test \$hard3 != none" -at_fn_check_prepare_dynamic "test $hard3 != none" "ofproto-dpif.at:3591" -( $at_check_trace; test $hard3 != none -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3591" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3592: test \$hard4 != none" -at_fn_check_prepare_dynamic "test $hard4 != none" "ofproto-dpif.at:3592" -( $at_check_trace; test $hard4 != none -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3592" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3593: test \$hard3 -lt \$hard4" -at_fn_check_prepare_dynamic "test $hard3 -lt $hard4" "ofproto-dpif.at:3593" -( $at_check_trace; test $hard3 -lt $hard4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3593" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Idle age should increase from 1 to 2 to 3, then decrease. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3596: test \$idle1 -lt \$idle2" -at_fn_check_prepare_dynamic "test $idle1 -lt $idle2" "ofproto-dpif.at:3596" -( $at_check_trace; test $idle1 -lt $idle2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3596" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3597: test \$idle2 -lt \$idle3" -at_fn_check_prepare_dynamic "test $idle2 -lt $idle3" "ofproto-dpif.at:3597" -( $at_check_trace; test $idle2 -lt $idle3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3597" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3598: test \$idle3 -gt \$idle4" -at_fn_check_prepare_dynamic "test $idle3 -gt $idle4" "ofproto-dpif.at:3598" -( $at_check_trace; test $idle3 -gt $idle4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3598" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check some invariant relationships. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3601: test \$duration1 = \$idle1" -at_fn_check_prepare_dynamic "test $duration1 = $idle1" "ofproto-dpif.at:3601" -( $at_check_trace; test $duration1 = $idle1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3601" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3602: test \$duration2 = \$idle2" -at_fn_check_prepare_dynamic "test $duration2 = $idle2" "ofproto-dpif.at:3602" -( $at_check_trace; test $duration2 = $idle2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3602" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3603: test \$duration3 = \$idle3" -at_fn_check_prepare_dynamic "test $duration3 = $idle3" "ofproto-dpif.at:3603" -( $at_check_trace; test $duration3 = $idle3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3604: test \$idle3 -gt \$hard3" -at_fn_check_prepare_dynamic "test $idle3 -gt $hard3" "ofproto-dpif.at:3604" -( $at_check_trace; test $idle3 -gt $hard3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3604" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3605: test \$idle4 -lt \$hard4" -at_fn_check_prepare_dynamic "test $idle4 -lt $hard4" "ofproto-dpif.at:3605" -( $at_check_trace; test $idle4 -lt $hard4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3605" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3606: test \$hard4 -lt \$duration4" -at_fn_check_prepare_dynamic "test $hard4 -lt $duration4" "ofproto-dpif.at:3606" -( $at_check_trace; test $hard4 -lt $duration4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3606" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3608: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3608" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3608" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3608: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3608" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3608" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3608: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3608" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3608" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_779 -#AT_START_780 -at_fn_group_banner 780 'ofproto-dpif.at:3611' \ - "ofproto-dpif - fin_timeout" " " 45 -at_xfail=no -( - $as_echo "780. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3612: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3612" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3612" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3612: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3612" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3612" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3612: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3612" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3612" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3612: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3612" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3612" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3612: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3612" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3612" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3612: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3612" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3612" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3612: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3612" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3612" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -in_port=2 actions=mod_vlan_vid:17,output:1 -_ATEOF - -ovs-appctl time/stop -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3618: ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3618" -( $at_check_trace; ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3618" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3619: ovs-ofctl dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:3619" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: - idle_timeout=60, actions=fin_timeout(idle_timeout=5) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3619" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Check that a TCP SYN packet does not change the timeout. (Because -# flow stats updates are mainly what implements the fin_timeout -# feature, we warp forward a couple of times to ensure that flow stats -# run before re-checking the flow table.) -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3628: ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307" -at_fn_check_prepare_trace "ofproto-dpif.at:3628" -( $at_check_trace; ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3629: ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000" -at_fn_check_prepare_trace "ofproto-dpif.at:3629" -( $at_check_trace; ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "warped -warped -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3629" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3633: ovs-ofctl dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:3633" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: - n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3633" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Check that a TCP FIN packet does change the timeout. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3638: ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588" -at_fn_check_prepare_trace "ofproto-dpif.at:3638" -( $at_check_trace; ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3638" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3639: ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000" -at_fn_check_prepare_trace "ofproto-dpif.at:3639" -( $at_check_trace; ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "warped -warped -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3639" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3642: ovs-ofctl dump-flows br0 | ofctl_strip" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:3642" -( $at_check_trace; ovs-ofctl dump-flows br0 | ofctl_strip -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXST_FLOW reply: - n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3642" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3646: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3646" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3646" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3646: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3646" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3646" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3646: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3646" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3646" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_780 -#AT_START_781 -at_fn_group_banner 781 'ofproto-dpif.at:3649' \ - "ofproto-dpif - ovs-appctl dpif/dump-dps" " " 45 -at_xfail=no -( - $as_echo "781. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3650: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3650" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3650" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3650: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3650" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3650" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3650: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3650" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3650" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3650: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3650" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3650: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3650" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3650: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3650" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3650: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy " -at_fn_check_prepare_trace "ofproto-dpif.at:3650" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3650" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -ovs-vsctl \ - -- add-port br1 p3 -- set Interface p3 type=dummy ofport_request=3 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3654: ovs-appctl dpif/dump-dps" -at_fn_check_prepare_trace "ofproto-dpif.at:3654" -( $at_check_trace; ovs-appctl dpif/dump-dps -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dummy@br0 -dummy@br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3654" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3658: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3658" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3658" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3658: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3658" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3658" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3658: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3658" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3658" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_781 -#AT_START_782 -at_fn_group_banner 782 'ofproto-dpif.at:3661' \ - "ofproto-dpif - ovs-appctl dpif/show" " " 45 -at_xfail=no -( - $as_echo "782. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3662: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3662" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3662" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3662: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3662" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3662" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3662: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3662" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3662" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3662: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3662" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3662" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3662: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3662" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3662" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3662: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3662" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3662" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3662: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy " -at_fn_check_prepare_trace "ofproto-dpif.at:3662" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3662" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -ovs-vsctl \ - -- add-port br1 p3 -- set Interface p3 type=dummy ofport_request=3 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3666: ovs-appctl dpif/show" -at_fn_check_prepare_trace "ofproto-dpif.at:3666" -( $at_check_trace; ovs-appctl dpif/show -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dummy@ovs-dummy: hit:0 missed:0 - br0: - br0 65534/100: (dummy) - p1 1/1: (dummy) - p2 2/2: (dummy) - br1: - br1 65534/101: (dummy) - p3 3/3: (dummy) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3666" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3676: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3676" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3676" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3676: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3676" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3676" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3676: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3676" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3676" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_782 -#AT_START_783 -at_fn_group_banner 783 'ofproto-dpif.at:3679' \ - "ofproto-dpif - ovs-appctl dpif/dump-flows" " " 45 -at_xfail=no -( - $as_echo "783. $at_setup_line: testing $at_desc ..." - $at_traceon - -# bump max-idle to avoid the flows being reclaimed behind us -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3681: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3681" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3681" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3681: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3681" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3681" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3681: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3681" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3681" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3681: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3681" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3681" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3681: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3681" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3681" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3681: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3681" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3681" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3681: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \\ - set bridge br1 datapath-type=dummy fail-mode=secure -- \\ - set Open_vSwitch . other_config:max-idle=10000 " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3681" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- \ - set bridge br1 datapath-type=dummy fail-mode=secure -- \ - set Open_vSwitch . other_config:max-idle=10000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3681" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -ovs-vsctl \ - -- add-port br1 p3 -- set Interface p3 type=dummy ofport_request=3 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3687: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3687" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3687" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3688: ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3688" -( $at_check_trace; ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3688" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3689: ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3689" -( $at_check_trace; ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3689" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 # wait for upcall handlers -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3691: ovs-appctl dpif/dump-flows br0 | sort | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3691" -( $at_check_trace; ovs-appctl dpif/dump-flows br0 | sort | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions:drop -skb_priority(0),recirc_id(0),in_port(2),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions:drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3691" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3696: ovs-appctl dpif/dump-flows br1 | sort | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3696" -( $at_check_trace; ovs-appctl dpif/dump-flows br1 | sort | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),recirc_id(0),in_port(3),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions:drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3696" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3700: ovs-appctl dpif/dump-flows -m br0 | sort | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3700" -( $at_check_trace; ovs-appctl dpif/dump-flows -m br0 | sort | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(p1),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop -skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(p2),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3700" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3705: ovs-appctl dpif/dump-flows -m br1 | sort | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3705" -( $at_check_trace; ovs-appctl dpif/dump-flows -m br1 | sort | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(p3),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3705" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3709: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3709" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3709" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3709: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3709" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3709" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3709: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3709" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3709" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_783 -#AT_START_784 -at_fn_group_banner 784 'ofproto-dpif.at:3712' \ - "ofproto-dpif - MPLS actions that result in a userspace action" "" 45 -at_xfail=no -( - $as_echo "784. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3713: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3713" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3713" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3713: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3713" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3713" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3713: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3713" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3713" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3713: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3713" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3713: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3713" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3713: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3713" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3713: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3713" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3713" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3716: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3716" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3716" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -cat >flows.txt <<'_ATEOF' -dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller -dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3724: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3724" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3724" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - - -for dl_src in 00 01; do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3736: ovs-appctl netdev-dummy/receive p1 \"505400000007 6066666666\$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45\"" -at_fn_check_prepare_dynamic "ovs-appctl netdev-dummy/receive p1 \"505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45\"" "ofproto-dpif.at:3736" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3736" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -done -sleep 1 # wait for the datapath flow installed -for dl_src in 00 01; do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3740: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | grep \":\$dl_src/\" | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3740" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | grep ":$dl_src/" | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller)) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3740" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3745: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3745" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3745: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3745" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3745: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3745" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3745" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_784 -#AT_START_785 -at_fn_group_banner 785 'ofproto-dpif.at:3749' \ - "ofproto-dpif - MPLS actions that result in a drop" "" 45 -at_xfail=no -( - $as_echo "785. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3750: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3750" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3750" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3750: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3750" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3750" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3750: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3750" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3750" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3750: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3750" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3750" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3750: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3750" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3750" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3750: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3750" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3750" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3750: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3750" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3750" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3753: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3753" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3753" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovs-ofctl.pid` -EOF - - - -cat >flows.txt <<'_ATEOF' -dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller -dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3761: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3761" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3761" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - - -for dl_src in 00 01; do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3776: ovs-appctl netdev-dummy/receive p1 \"505400000007 6066666666\$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45\"" -at_fn_check_prepare_dynamic "ovs-appctl netdev-dummy/receive p1 \"505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45\"" "ofproto-dpif.at:3776" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3776" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -done -sleep 1 # wait for the datapath flow installed -for dl_src in 00 01; do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3780: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | grep \":\$dl_src/\" | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3780" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | grep ":$dl_src/" | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller)) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3780" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3785: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3785" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3785" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3785: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3785" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3785" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3785: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3785" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3785" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_785 -#AT_START_786 -at_fn_group_banner 786 'ofproto-dpif.at:3788' \ - "ofproto-dpif - patch ports" " " 45 -at_xfail=no -( - $as_echo "786. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3789: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3789" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3789" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3789: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3789" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3789" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3789: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3789" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3789" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3789: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3789" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3789" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3789: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3789" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3789" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3789: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3789" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3789" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3789: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 \\ --- set bridge br1 datapath-type=dummy fail-mode=secure \\ --- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \\ --- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1 " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3789" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 \ --- set bridge br1 datapath-type=dummy fail-mode=secure \ --- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \ --- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3789" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-vsctl \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -ovs-vsctl \ - -- add-port br1 p3 -- set Interface p3 type=dummy ofport_request=3 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3797: ovs-appctl time/stop" -at_fn_check_prepare_trace "ofproto-dpif.at:3797" -( $at_check_trace; ovs-appctl time/stop -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3797" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3798: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3798" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3798" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3800: ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2" -at_fn_check_prepare_trace "ofproto-dpif.at:3800" -( $at_check_trace; ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3800" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3801: ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3" -at_fn_check_prepare_trace "ofproto-dpif.at:3801" -( $at_check_trace; ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3801" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -for i in $(seq 1 10); do - ovs-appctl netdev-dummy/receive br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' - if [ $i -eq 1 ]; then - sleep 1 - fi -done - -for i in $(seq 1 5); do - ovs-appctl netdev-dummy/receive br1 'in_port(101),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' - if [ $i -eq 1 ]; then - sleep 1 - fi -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3817: ovs-appctl time/warp 500" -at_fn_check_prepare_trace "ofproto-dpif.at:3817" -( $at_check_trace; ovs-appctl time/warp 500 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "warped -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3817" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 # wait for log writer - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3822: ovs-appctl dpif/show" -at_fn_check_prepare_trace "ofproto-dpif.at:3822" -( $at_check_trace; ovs-appctl dpif/show -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "dummy@ovs-dummy: hit:13 missed:2 - br0: - br0 65534/100: (dummy) - p2 2/2: (dummy) - pbr0 1/none: (patch: peer=pbr1) - br1: - br1 65534/101: (dummy) - p3 3/3: (dummy) - pbr1 1/none: (patch: peer=pbr0) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3822" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3834: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3834" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(100),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:101,3,2 -skb_priority(0),skb_mark(0/0),in_port(101),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:100,2,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3834" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3839: cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | -grep 'flow_dump ' | sed ' - s/.*flow_dump // - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort | uniq" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3839" -( $at_check_trace; cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | -grep 'flow_dump ' | sed ' - s/.*flow_dump // - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort | uniq -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(100),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:9, bytes:540, used:0.0s, actions:101,3,2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3839" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3842: cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | -grep 'flow_dump ' | sed ' - s/.*flow_dump // - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort | uniq" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3842" -( $at_check_trace; cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | -grep 'flow_dump ' | sed ' - s/.*flow_dump // - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort | uniq -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(101),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), packets:4, bytes:240, used:0.0s, actions:100,2,3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3842" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3846: ovs-ofctl dump-ports br0 pbr0" -at_fn_check_prepare_trace "ofproto-dpif.at:3846" -( $at_check_trace; ovs-ofctl dump-ports br0 pbr0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (xid=0x4): 1 ports - port 1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=10, bytes=600, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3846" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3852: ovs-ofctl dump-ports br1 pbr1" -at_fn_check_prepare_trace "ofproto-dpif.at:3852" -( $at_check_trace; ovs-ofctl dump-ports br1 pbr1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OFPST_PORT reply (xid=0x4): 1 ports - port 1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0 - tx pkts=5, bytes=300, drop=0, errs=0, coll=0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3852" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3858: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3858" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3858" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3858: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3858" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3858" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3858: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3858" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3858" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_786 -#AT_START_787 -at_fn_group_banner 787 'ofproto-dpif.at:3861' \ - "ofproto-dpif - port duration" " " 45 -at_xfail=no -( - $as_echo "787. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3862: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3862" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3862" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3862: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3862" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3862" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3862: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3862" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3862" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3862: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3862" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3862: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3862" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3862: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3862" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3862: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 protocols=OpenFlow13 " -at_fn_check_prepare_trace "ofproto-dpif.at:3862" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 protocols=OpenFlow13 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3862" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - -ovs-appctl time/stop -ovs-appctl time/warp 10000 - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3868: ovs-ofctl -O openflow13 dump-ports br0" -at_fn_check_prepare_trace "ofproto-dpif.at:3868" -( $at_check_trace; ovs-ofctl -O openflow13 dump-ports br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3868" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3869: sed -n 's/=[0-9][0-9]\\(\\.[0-9][0-9]*\\)\\{0,1\\}s/=?s/p' stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:3869" -( $at_check_trace; sed -n 's/=[0-9][0-9]\(\.[0-9][0-9]*\)\{0,1\}s/=?s/p' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " duration=?s - duration=?s - duration=?s -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3869" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3875: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3875" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3875: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3875" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3875: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3875" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3875" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_787 -#AT_START_788 -at_fn_group_banner 788 'ofproto-dpif.at:3881' \ - "ofproto-dpif megaflow - port classification" " " 46 -at_xfail=no -( - $as_echo "788. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3882: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3882" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3882" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3882: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3882" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3882" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3882: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3882" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3882" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3882: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3882" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3882" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3882: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3882" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3882" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3882: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3882" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3882" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3882: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3882" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3882" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3883: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3883" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3883" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3888: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3888" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3888" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3889: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3889" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3889" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3891: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3891" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3891" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3893: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3893" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3893" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3896: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3896" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3896" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3896: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3896" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3896" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3896: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3896" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3896" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_788 -#AT_START_789 -at_fn_group_banner 789 'ofproto-dpif.at:3899' \ - "ofproto-dpif megaflow - L2 classification" " " 46 -at_xfail=no -( - $as_echo "789. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3900: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3900" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3900" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3900: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3900" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3900" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3900: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3900" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3900" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3900: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3900" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3900" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3900: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3900" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3900" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3900: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3900" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3900" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3900: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3900" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3900" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3901: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3901" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3901" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3906: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3906" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3906" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3907: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3907" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3907" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3908: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3908" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3908" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3910: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3910" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3910" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3914: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3914" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3914" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3914: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3914" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3914" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3914: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3914" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3914" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_789 -#AT_START_790 -at_fn_group_banner 790 'ofproto-dpif.at:3917' \ - "ofproto-dpif megaflow - L3 classification" " " 46 -at_xfail=no -( - $as_echo "790. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3918: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3918" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3918" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3918: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3918" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3918" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3918: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3918" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3918" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3918: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3918" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3918" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3918: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3918" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3918" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3918: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3918" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3918" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3918: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3918" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3918" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3919: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3919" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3919" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3921: ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src" -at_fn_check_prepare_trace "ofproto-dpif.at:3921" -( $at_check_trace; ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3921" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3925: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3925" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3925" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3926: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3926" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3926" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3927: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3927" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3927" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3929: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3929" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3929" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3933: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3933" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3933" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3933: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3933" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3933" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3933: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3933" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3933" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_790 -#AT_START_791 -at_fn_group_banner 791 'ofproto-dpif.at:3936' \ - "ofproto-dpif megaflow - IPv6 classification" " " 46 -at_xfail=no -( - $as_echo "791. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3937: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3937" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3937" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3937: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3937" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3937" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3937: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3937" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3937" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3937: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3937" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3937" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3937: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3937" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3937" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3937: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3937" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3937" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3937: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3937" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3937" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3938: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3938" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3938" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3940: ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src" -at_fn_check_prepare_trace "ofproto-dpif.at:3940" -( $at_check_trace; ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3940" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3944: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3944" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3944" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3945: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3945" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3945" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3946: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1,dst=2001:db8:3c4d:1:2:3:4:1,label=0,proto=99,tclass=0x70,hlimit=64,frag=no)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3946" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1,dst=2001:db8:3c4d:1:2:3:4:1,label=0,proto=99,tclass=0x70,hlimit=64,frag=no)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3946" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3948: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3948" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff,dst=fe80::2/::,label=0/0,proto=10/0,tclass=0x70/0,hlimit=128/0,frag=no/0xff), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:ffff:fffc::,dst=2001:db8:3c4d:1:2:3:4:1/::,label=0/0,proto=99/0,tclass=0x70/0,hlimit=64/0,frag=no/0xff), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3948" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3952: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3952" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3952" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3952: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3952" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3952" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3952: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3952" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3952" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_791 -#AT_START_792 -at_fn_group_banner 792 'ofproto-dpif.at:3955' \ - "ofproto-dpif megaflow - L4 classification" " " 46 -at_xfail=no -( - $as_echo "792. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3956: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3956" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3956" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3956: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3956" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3956" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3956: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3956" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3956" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3956: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3956" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3956" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3956: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3956" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3956" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3956: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3956" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3956" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3956: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3956" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3956" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3957: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3957" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3957" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,icmp,icmp_type=8 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3962: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3962" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3962" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3963: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3963" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3963" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3965: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3965" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3965" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3967: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3967" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0xff,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3967" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3970: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3970" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3970" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3970: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3970" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3970" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3970: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3970" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3970" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_792 -#AT_START_793 -at_fn_group_banner 793 'ofproto-dpif.at:3973' \ - "ofproto-dpif megaflow - normal" " " 46 -at_xfail=no -( - $as_echo "793. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3974: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3974" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3974" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3974: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3974" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3974" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3974: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3974" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3974" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3974: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3974" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3974" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3974: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3974" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3974" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3974: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3974" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3974" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3974: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3974" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3974" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3975: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3975" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3975" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3977: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:3977" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3977" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3978: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3978" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3978" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3979: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3979" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3979" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3981: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3981" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3981" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3985: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:3985" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3985" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3985: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3985" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3985" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3985: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:3985" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3985" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_793 -#AT_START_794 -at_fn_group_banner 794 'ofproto-dpif.at:3988' \ - "ofproto-dpif megaflow - mpls" " " 46 -at_xfail=no -( - $as_echo "794. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3989: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:3989" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3989" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3989: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:3989" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3989" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3989: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3989" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3989" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3989: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:3989" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3989: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:3989" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3989: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:3989" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3989: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:3989" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3989" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3990: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:3990" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3990" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2 -table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3996: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:3996" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3996" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3997: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3997" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3997" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:3998: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'" -at_fn_check_prepare_trace "ofproto-dpif.at:3998" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:3998" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4000: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4000" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4000" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4004: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4004" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4004: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4004" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4004: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4004" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4004" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_794 -#AT_START_795 -at_fn_group_banner 795 'ofproto-dpif.at:4037' \ - "ofproto-dpif megaflow - netflow - IPv4 collector" "" 46 -at_xfail=no -( - $as_echo "795. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4037" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4037" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4037" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4037" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-netflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > netflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - NETFLOW_PORT=`parse_listening_port < test-netflow.log` - ovs-vsctl \ - set Bridge br0 netflow=@nf -- \ - --id=@nf create NetFlow targets=\"127.0.0.1:$NETFLOW_PORT\" \ - engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - sleep 1 - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4037" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4037: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4037" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4037" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_795 -#AT_START_796 -at_fn_group_banner 796 'ofproto-dpif.at:4038' \ - "ofproto-dpif megaflow - netflow - IPv6 collector" "" 46 -at_xfail=no -( - $as_echo "796. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4038" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4038" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4038" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4038" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 - - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-netflow.pid` -EOF - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:[::1] > netflow.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:[::1] > netflow.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - NETFLOW_PORT=`parse_listening_port < test-netflow.log` - ovs-vsctl \ - set Bridge br0 netflow=@nf -- \ - --id=@nf create NetFlow targets=\"[::1]:$NETFLOW_PORT\" \ - engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - sleep 1 - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4038" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4038: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4038" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"netflow.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_796 -#AT_START_797 -at_fn_group_banner 797 'ofproto-dpif.at:4040' \ - "ofproto-dpif megaflow - normal, active-backup bonding" "" 46 -at_xfail=no -( - $as_echo "797. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4041: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4041" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4041" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4041: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4041" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4041" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4041: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4041" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4041" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4041: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4041" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4041" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4041: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4041" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4041" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4041: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4041" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4041" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4041: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \\ - add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \\ - set interface p2 type=dummy ofport_request=2 -- \\ - set interface p3 type=dummy ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4041" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \ - add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \ - set interface p2 type=dummy ofport_request=2 -- \ - set interface p3 type=dummy ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4041" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4046: ovs-appctl netdev-dummy/set-admin-state up" -at_fn_check_prepare_trace "ofproto-dpif.at:4046" -( $at_check_trace; ovs-appctl netdev-dummy/set-admin-state up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4046" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4048: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4048" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4048" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4050: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:4050" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4050" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4051: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4051" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4051" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4052: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4052" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4052" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4054: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4054" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4054" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4058: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4058" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4058" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4058: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4058" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4058" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4058: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4058" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4058" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_797 -#AT_START_798 -at_fn_group_banner 798 'ofproto-dpif.at:4061' \ - "ofproto-dpif megaflow - normal, balance-slb bonding" "" 46 -at_xfail=no -( - $as_echo "798. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4062: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4062" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4062" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4062: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4062" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4062" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4062: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4062" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4062" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4062: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4062" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4062" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4062: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4062" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4062" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4062: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4062" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4062" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4062: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \\ - add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \\ - set interface p2 type=dummy ofport_request=2 -- \\ - set interface p3 type=dummy ofport_request=3 " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4062" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \ - add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \ - set interface p2 type=dummy ofport_request=2 -- \ - set interface p3 type=dummy ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4062" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4067: ovs-appctl netdev-dummy/set-admin-state up" -at_fn_check_prepare_trace "ofproto-dpif.at:4067" -( $at_check_trace; ovs-appctl netdev-dummy/set-admin-state up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4067" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4069: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4069" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4069" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4071: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:4071" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4071" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4072: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4072" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4072" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4073: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4073" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4073" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4075: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4075" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4075" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4079: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4079" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4079" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4079: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4079" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4079" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4079: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4079" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4079" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_798 -#AT_START_799 -at_fn_group_banner 799 'ofproto-dpif.at:4082' \ - "ofproto-dpif megaflow - normal, balance-tcp bonding" "" 46 -at_xfail=no -( - $as_echo "799. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Create bond0 on br0 with interfaces p0 and p1 -# and bond1 on br1 with interfaces p2 and p3 -# with p0 patched to p2 and p1 patched to p3. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4086: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4086" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4086" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4086: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4086" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4086" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4086: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4086" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4086" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4086: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4086" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4086" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4086: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4086" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4086" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4086: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4086" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4086" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4086: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \\ - other-config:lacp-time=fast \\ - other-config:bond-rebalance-interval=0 -- \\ - set interface p0 type=patch options:peer=p2 ofport_request=1 -- \\ - set interface p1 type=patch options:peer=p3 ofport_request=2 -- \\ - add-br br1 -- \\ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \\ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \\ - fail-mode=secure -- \\ - add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \\ - other-config:lacp-time=fast \\ - other-config:bond-rebalance-interval=0 -- \\ - set interface p2 type=patch options:peer=p0 ofport_request=3 -- \\ - set interface p3 type=patch options:peer=p1 ofport_request=4 -- " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4086" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \ - other-config:lacp-time=fast \ - other-config:bond-rebalance-interval=0 -- \ - set interface p0 type=patch options:peer=p2 ofport_request=1 -- \ - set interface p1 type=patch options:peer=p3 ofport_request=2 -- \ - add-br br1 -- \ - set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ - set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ - fail-mode=secure -- \ - add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \ - other-config:lacp-time=fast \ - other-config:bond-rebalance-interval=0 -- \ - set interface p2 type=patch options:peer=p0 ofport_request=3 -- \ - set interface p3 type=patch options:peer=p1 ofport_request=4 -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4086" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4102: ovs-appctl netdev-dummy/set-admin-state up" -at_fn_check_prepare_trace "ofproto-dpif.at:4102" -( $at_check_trace; ovs-appctl netdev-dummy/set-admin-state up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4102" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4104: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4104" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4104" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p7 -- set Interface p7 type=dummy ofport_request=7 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4106: ovs-ofctl add-flow br0 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:4106" -( $at_check_trace; ovs-ofctl add-flow br0 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4106" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4107: ovs-ofctl add-flow br1 action=normal" -at_fn_check_prepare_trace "ofproto-dpif.at:4107" -( $at_check_trace; ovs-ofctl add-flow br1 action=normal -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4107" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/stop -ovs-appctl time/warp 5000 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4110: ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4110" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4110" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4111: ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4111" -( $at_check_trace; ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4111" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4113: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4113" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4113" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4117: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4117" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4117" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4117: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4117" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4117" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4117: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4117" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4117" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_799 -#AT_START_800 -at_fn_group_banner 800 'ofproto-dpif.at:4120' \ - "ofproto-dpif megaflow - resubmit port action" " " 46 -at_xfail=no -( - $as_echo "800. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4121: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4121" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4121" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4121: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4121" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4121" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4121: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4121" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4121" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4121: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4121" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4121" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4121: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4121" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4121" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4121: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4121" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4121" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4121: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4121" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4121" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4122: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4122" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4122" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,ip actions=resubmit(90) -table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4128: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4128" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4128" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4129: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4129" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4129" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4130: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4130" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4130" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4132: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4132" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4132" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4136: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4136" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4136" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4136: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4136" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4136" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4136: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4136" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4136" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_800 -#AT_START_801 -at_fn_group_banner 801 'ofproto-dpif.at:4139' \ - "ofproto-dpif megaflow - resubmit table action" " " 46 -at_xfail=no -( - $as_echo "801. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4140: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4140" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4140" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4140: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4140" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4140" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4140: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4140" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4140" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4140: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4140" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4140: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4140" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4140: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4140" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4140: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4140" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4140" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4141: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4141" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4141" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,ip actions=resubmit(,1) -table=1 dl_src=50:54:00:00:00:09 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4147: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4147" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4147" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4148: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4148" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4148" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4149: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto= -1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4149" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto= -1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4149" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4152: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4152" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4152" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4156: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4156" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4156: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4156" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4156: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4156" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4156" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_801 -#AT_START_802 -at_fn_group_banner 802 'ofproto-dpif.at:4159' \ - "ofproto-dpif megaflow - goto_table action" " " 46 -at_xfail=no -( - $as_echo "802. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4160: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4160" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4160" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4160: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4160" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4160: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4160" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4160" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4160: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4160" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4160" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4160: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4160" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4160" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4160: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4160" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4160" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4160: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4160" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4160" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4161: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4161" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4161" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,ip actions=goto_table(1) -table=1 dl_src=50:54:00:00:00:09 actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4167: ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4167" -( $at_check_trace; ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4167" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4168: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4168" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4168" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4169: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4169" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4169" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4171: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4171" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4171" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4175: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4175" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4175" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4175: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4175" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4175" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4175: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4175" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4175" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_802 -#AT_START_803 -at_fn_group_banner 803 'ofproto-dpif.at:4178' \ - "ofproto-dpif megaflow - mirroring, select_all" " " 46 -at_xfail=no -( - $as_echo "803. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4179: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4179" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4179" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4179: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4179" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4179" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4179: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4179" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4179" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4179: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4179" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4179" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4179: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4179" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4179" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4179: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4179" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4179" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4179: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4179" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4179" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4180: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4180" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4180" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p3 get Port p3 --\ - --id=@m create Mirror name=mymirror select_all=true output_port=@p3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4190: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4190" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4190" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4191: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4191" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4191" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4193: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4193" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4193" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4195: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4195" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4195" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4198: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4198" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4198: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4198" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4198: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4198" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4198" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_803 -#AT_START_804 -at_fn_group_banner 804 'ofproto-dpif.at:4201' \ - "ofproto-dpif megaflow - mirroring, select_vlan" " " 46 -at_xfail=no -( - $as_echo "804. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4202: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4202" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4202" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4202: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4202" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4202" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4202: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4202" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4202" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4202: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4202" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4202: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4202" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4202: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4202" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4202: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4202" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4203: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4203" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4203" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 -ovs-vsctl \ - set Bridge br0 mirrors=@m --\ - --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\ - --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3 - -cat >flows.txt <<'_ATEOF' -in_port=1 actions=output:2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4213: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4213" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4213" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4214: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=11,pcp=7),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))'" -at_fn_check_prepare_trace "ofproto-dpif.at:4214" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=11,pcp=7),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4214" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4215: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4215" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4215" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4217: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4217" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8100),vlan(vid=11/0xfff,pcp=7/0x0,cfi=1/1),encap(eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0)), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4217" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4221: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4221" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4221" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4221: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4221" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4221" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4221: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4221" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4221" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_804 -#AT_START_805 -at_fn_group_banner 805 'ofproto-dpif.at:4224' \ - "ofproto-dpif megaflow - move action" " " 46 -at_xfail=no -( - $as_echo "805. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4225: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4225" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4225" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4225: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4225" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4225" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4225: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4225" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4225" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4225: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4225" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4225" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4225: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4225" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4225" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4225: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4225" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4225" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4225: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4225" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4225" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4226: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4226" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[]->NXM_NX_REG0[],resubmit(90) -table=0 in_port=90 ip,actions=move:NXM_NX_REG0[]->NXM_NX_REG1[],resubmit(91) -table=0 in_port=91 reg0=0x0a000002,actions=output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4233: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4233" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4233" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4234: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4234" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4234" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4235: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4235" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4235" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4237: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4237" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4237" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4241: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4241" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4241" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4241: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4241" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4241" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4241: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4241" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4241" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_805 -#AT_START_806 -at_fn_group_banner 806 'ofproto-dpif.at:4244' \ - "ofproto-dpif megaflow - push action" " " 46 -at_xfail=no -( - $as_echo "806. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4245: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4245" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4245" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4245: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4245" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4245" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4245: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4245" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4245" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4245: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4245" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4245" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4245: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4245" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4245" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4245: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4245" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4245" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4245: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4245" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4245" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4246: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4246" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4246" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[],output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4251: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4251" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4251" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4252: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4252" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4252" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4253: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4253" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4253" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4255: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4255" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4255" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4259: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4259" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4259" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4259: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4259" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4259" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4259: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4259" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4259" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_806 -#AT_START_807 -at_fn_group_banner 807 'ofproto-dpif.at:4262' \ - "ofproto-dpif megaflow - learning" " " 46 -at_xfail=no -( - $as_echo "807. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4263: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4263" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4263" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4263: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4263" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4263" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4263: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4263" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4263" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4263: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4263" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4263" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4263: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4263" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4263" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4263: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4263" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4263" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4263: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4263" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4263" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4264: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4264" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4264" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 actions=load:2->NXM_NX_REG0[0..15],learn(table=1,priority=65535,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4269: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4269" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4269" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-appctl time/stop -# We send each packet twice because the first packet in each flow causes the -# flow table to change and thus revalidations, which (depending on timing) -# can keep a megaflow from being installed. The revalidations are done by -# the second iteration, allowing the flows to be installed. -for i in 1 2; do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4276: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4276" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4276" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4277: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4277" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4277" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - ovs-appctl time/warp 100 -done -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4282: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4282" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4282" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4286: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4286" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4286: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4286" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4286: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4286" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4286" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_807 -#AT_START_808 -at_fn_group_banner 808 'ofproto-dpif.at:4289' \ - "ofproto-dpif megaflow - tunnels" " " 46 -at_xfail=no -( - $as_echo "808. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4290: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4290" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4290" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4290: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4290" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4290" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4290: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4290" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4290" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4290: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4290" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4290: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4290" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4290: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4290" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4290: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 " -at_fn_check_prepare_trace "ofproto-dpif.at:4290" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4290" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4292: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4292" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4292" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4293: ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \\ - options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4293" -( $at_check_trace; ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \ - options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4293" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4295: ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \\ - ofport_request=3" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4295" -( $at_check_trace; ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \ - ofport_request=3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4295" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4297: ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \\ - options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \\ - ofport_request=4 options:key=flow" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4297" -( $at_check_trace; ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \ - options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \ - ofport_request=4 options:key=flow -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4297" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -cat >flows.txt <<'_ATEOF' -in_port=1,actions=output(2) -in_port=3,actions=output(4) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4304: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4304" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4304" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4307: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4307" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4307" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4309: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4309" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4309" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4310: ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4310" -( $at_check_trace; ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4310" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4312: ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4312" -( $at_check_trace; ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4312" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4314: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4314" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0xfd/0x3,ttl=128/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0xfd/0xff,ttl=128/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(3),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0x1/0xff,ttl=64/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4314" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4319: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4319" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4319: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4319" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4319: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4319" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4319" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_808 -#AT_START_809 -at_fn_group_banner 809 'ofproto-dpif.at:4322' \ - "ofproto-dpif megaflow - dec_ttl" " " 46 -at_xfail=no -( - $as_echo "809. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4323: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4323" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4323" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4323: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4323" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4323" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4323: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4323" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4323" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4323: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4323" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4323" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4323: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4323" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4323" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4323: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4323" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4323" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4323: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4323" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4323" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4324: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4324" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4324" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4326: ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src" -at_fn_check_prepare_trace "ofproto-dpif.at:4326" -( $at_check_trace; ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4326" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4330: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4330" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4330" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4331: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4331" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4331" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4332: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4332" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4332" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4334: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4334" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ - s/actions:.*/actions: / - s/packets:[0-9]*/packets:0/ - s/bytes:[0-9]*/bytes:0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8/0,code=0/0), actions: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4334" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4338: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4338" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4338: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4338" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4338: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4338" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4338" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_809 -#AT_START_810 -at_fn_group_banner 810 'ofproto-dpif.at:4341' \ - "ofproto-dpif megaflow - set dl_dst" " " 46 -at_xfail=no -( - $as_echo "810. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4342: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4342" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4342" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4342: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4342" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4342" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4342: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4342" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4342" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4342: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4342" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4342: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4342" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4342: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4342" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4342: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4342" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4342" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4343: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4343" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4343" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2) -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4348: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4348" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4348" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4349: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4349" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4349" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4350: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4350" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4350" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4362: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4362" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/ff:ff:ff:ff:ff:ff),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:2 -skb_priority(0),skb_mark(0/0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:set(eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a)),2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4362" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4366: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4366" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4366: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4366" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4366: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4366" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4366" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_810 -#AT_START_811 -at_fn_group_banner 811 'ofproto-dpif.at:4369' \ - "ofproto-dpif megaflow - disabled" " " 46 -at_xfail=no -( - $as_echo "811. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4370: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4370" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4370" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4370: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4370" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4370" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4370: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4370" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4370" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4370: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4370" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4370: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4370" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4370: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4370" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4370: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4370" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4370" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4371: ovs-appctl vlog/set dpif:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4371" -( $at_check_trace; ovs-appctl vlog/set dpif:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4371" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -cat >flows.txt <<'_ATEOF' -table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2) -table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4377: ovs-appctl upcall/disable-megaflows" -at_fn_check_prepare_trace "ofproto-dpif.at:4377" -( $at_check_trace; ovs-appctl upcall/disable-megaflows -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "megaflows disabled -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4377" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4379: ovs-appctl vlog/set dpif_netdev:dbg" -at_fn_check_prepare_trace "ofproto-dpif.at:4379" -( $at_check_trace; ovs-appctl vlog/set dpif_netdev:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4379" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4380: ovs-ofctl add-flows br0 flows.txt" -at_fn_check_prepare_trace "ofproto-dpif.at:4380" -( $at_check_trace; ovs-ofctl add-flows br0 flows.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4380" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -for i in 1 2 3 4; do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4382: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4382" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4382" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4383: ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'" -at_fn_check_prepare_trace "ofproto-dpif.at:4383" -( $at_check_trace; ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4383" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - if [ $i -eq 1 ]; then - sleep 1 - fi -done -sleep 1 -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4389: cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\\[create\\] // -' | sort | uniq | sed ' - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4389" -( $at_check_trace; cat ovs-vswitchd.log | -grep ' put' | sed ' - s/.*put\[create\] // -' | sort | uniq | sed ' - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:2 -skb_priority(0),skb_mark(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4389" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4393: cat ovs-vswitchd.log | -grep 'flow_dump ' | sed ' - s/.*flow_dump // - s/used:[0-9]*\\.[0-9]*/used:0.0/ -' | sort | uniq | grep 'packets:3'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4393" -( $at_check_trace; cat ovs-vswitchd.log | -grep 'flow_dump ' | sed ' - s/.*flow_dump // - s/used:[0-9]*\.[0-9]*/used:0.0/ -' | sort | uniq | grep 'packets:3' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:2 -skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4393" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4397: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4397" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4397" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4397: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4397" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4397" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4397: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4397" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4397" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_811 -#AT_START_812 -at_fn_group_banner 812 'ofproto-dpif.at:4400' \ - "ofproto-dpif - datapath port number change" " " 46 -at_xfail=no -( - $as_echo "812. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4401: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4401" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4401" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4401: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4401" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4401" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4401: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4401" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4401" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4401: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4401" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4401" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4401: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4401" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4401" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4401: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4401" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4401" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4401: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone " -at_fn_check_prepare_trace "ofproto-dpif.at:4401" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- set Bridge br0 fail-mode=standalone -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4401" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 - -# Trace a flow that should output to p1. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4405: ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60" -at_fn_check_prepare_trace "ofproto-dpif.at:4405" -( $at_check_trace; ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4405" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4407: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:4407" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4407" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Change p1's port number to 5. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4411: ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5" -at_fn_check_prepare_trace "ofproto-dpif.at:4411" -( $at_check_trace; ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4411" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# Trace a flow that should output to p1 in its new location. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4414: ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60" -at_fn_check_prepare_trace "ofproto-dpif.at:4414" -( $at_check_trace; ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4414" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4416: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:4416" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: 5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4416" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4418: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4418" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4418" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4418: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4418" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4418" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4418: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4418" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4418" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_812 -#AT_START_813 -at_fn_group_banner 813 'ofproto-dpif.at:4422' \ - "ofproto - bundle with variable bfd/cfm config" " " 46 -at_xfail=no -( - $as_echo "813. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4423: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4423" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4423" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4423: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4423" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4423" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4423: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4423" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4423" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4423: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4423" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4423" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4423: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4423" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4423" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4423: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4423" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4423" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4423: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \\ - add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \\ - add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \\ - set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \\ - set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \\ - set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \\ - set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \\ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \\ - set Interface p0 cfm_mpid=1 -- \\ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 " -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4423" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-br br1 -- set bridge br1 datapath-type=dummy -- \ - add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \ - add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \ - set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \ - set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \ - set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \ - set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \ - set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \ - set Interface p0 cfm_mpid=1 -- \ - set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4423" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -ovs-appctl time/stop -# advance the clock to stablize everything. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done -# cfm/show should show 'recv' fault. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4438: ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4438" -( $at_check_trace; ovs-appctl cfm/show | sed -n '/^.*fault:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " fault: recv -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4438" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# bfd/show should show 'up'. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4442: ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4442" -( $at_check_trace; ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Local Session State: up - Remote Session State: up - Local Session State: up - Remote Session State: up -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4442" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# bond/show should show 'may-enable: true' for all slaves. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4449: ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4449" -( $at_check_trace; ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " may_enable: true - may_enable: true - may_enable: true - may_enable: true -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4449" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# now disable the bfd on p1. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4457: ovs-vsctl set Interface p1 bfd:enable=false" -at_fn_check_prepare_trace "ofproto-dpif.at:4457" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4457" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock to stablize everything. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done -# cfm/show should show 'recv' fault. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4461: ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4461" -( $at_check_trace; ovs-appctl cfm/show | sed -n '/^.*fault:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " fault: recv -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4461" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# bfd/show should show 'down'. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4465: ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4465" -( $at_check_trace; ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Local Session State: down - Remote Session State: down -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4465" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# bond/show should show 'may-enable: false' for p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4470: ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4470" -( $at_check_trace; ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " may_enable: false - may_enable: true -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4470" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# now enable the bfd on p1 and disable bfd on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4476: ovs-vsctl set Interface p1 bfd:enable=true" -at_fn_check_prepare_trace "ofproto-dpif.at:4476" -( $at_check_trace; ovs-vsctl set Interface p1 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4476" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4477: ovs-vsctl set Interface p0 bfd:enable=false" -at_fn_check_prepare_trace "ofproto-dpif.at:4477" -( $at_check_trace; ovs-vsctl set Interface p0 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4477" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# advance the clock to stablize everything. -for i in `seq 0 49`; do ovs-appctl time/warp 100; done -# cfm/show should show 'recv' fault. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4481: ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4481" -( $at_check_trace; ovs-appctl cfm/show | sed -n '/^.*fault:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " fault: recv -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4481" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# bfd/show should show 'down'. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4485: ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4485" -( $at_check_trace; ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Local Session State: down - Remote Session State: down -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4485" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# bond/show should show 'may-enable: false' for p0 and p1. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4490: ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4490" -( $at_check_trace; ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " may_enable: false - may_enable: true - may_enable: false - may_enable: true -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4490" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4497: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4497" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4497: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4497" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4497: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4497" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4497" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_813 -#AT_START_814 -at_fn_group_banner 814 'ofproto-dpif.at:4500' \ - "ofproto-dpif - ofproto-dpif-monitor 1" " " 46 -at_xfail=no -( - $as_echo "814. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4501: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4501" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4501" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4501: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4501" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4501" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4501: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4501" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4501" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4501: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4501" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4501: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4501" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4501: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4501" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4501: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4 " -at_fn_check_prepare_trace "ofproto-dpif.at:4501" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4501" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# enable bfd on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4504: ovs-vsctl set interface p0 bfd:enable=true" -at_fn_check_prepare_trace "ofproto-dpif.at:4504" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4504" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4506: ovs_wait_cond () { grep \"monitor thread created\" ovs-vswitchd.log -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4506" -( $at_check_trace; ovs_wait_cond () { grep "monitor thread created" ovs-vswitchd.log -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4506" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# disable bfd on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4508: ovs-vsctl set interface p0 bfd:enable=false" -at_fn_check_prepare_trace "ofproto-dpif.at:4508" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4508" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4510: ovs_wait_cond () { grep \"monitor thread terminated\" ovs-vswitchd.log -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4510" -( $at_check_trace; ovs_wait_cond () { grep "monitor thread terminated" ovs-vswitchd.log -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4510" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4511: cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*\$/d' > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4511" -( $at_check_trace; cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4511" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# enable cfm on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4514: ovs-vsctl set interface p0 cfm_mpid=10" -at_fn_check_prepare_trace "ofproto-dpif.at:4514" -( $at_check_trace; ovs-vsctl set interface p0 cfm_mpid=10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4514" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4516: ovs_wait_cond () { grep \"monitor thread created\" ovs-vswitchd.log -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4516" -( $at_check_trace; ovs_wait_cond () { grep "monitor thread created" ovs-vswitchd.log -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4516" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# disable cfm on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4518: ovs-vsctl remove interface p0 cfm_mpid 10" -at_fn_check_prepare_trace "ofproto-dpif.at:4518" -( $at_check_trace; ovs-vsctl remove interface p0 cfm_mpid 10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4518" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4520: ovs_wait_cond () { grep \"monitor thread terminated\" ovs-vswitchd.log -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4520" -( $at_check_trace; ovs_wait_cond () { grep "monitor thread terminated" ovs-vswitchd.log -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4520" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4521: cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*\$/d' > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4521" -( $at_check_trace; cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4521" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -# enable both bfd and cfm on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4524: ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10" -at_fn_check_prepare_trace "ofproto-dpif.at:4524" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4524" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4526: ovs_wait_cond () { grep \"monitor thread created\" ovs-vswitchd.log -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4526" -( $at_check_trace; ovs_wait_cond () { grep "monitor thread created" ovs-vswitchd.log -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4526" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# disable bfd on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4528: ovs-vsctl set interface p0 bfd:enable=false" -at_fn_check_prepare_trace "ofproto-dpif.at:4528" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=false -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4528" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log, there should not be the log of thread terminated. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4530: sed -n \"s/^.*|ofproto_dpif_monitor(monitor[0-9]*)|INFO|\\(.* terminated\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4530" -( $at_check_trace; sed -n "s/^.*|ofproto_dpif_monitor(monitor[0-9]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4530" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# reenable bfd on p0. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4533: ovs-vsctl set interface p0 bfd:enable=true" -at_fn_check_prepare_trace "ofproto-dpif.at:4533" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4533" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log, should still be on log of thread created. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4535: sed -n \"s/^.*|ofproto_dpif_monitor(monitor[0-9]*)|INFO|\\(.* created\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ofproto-dpif.at:4535" -( $at_check_trace; sed -n "s/^.*|ofproto_dpif_monitor(monitor[0-9]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "monitor thread created -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4535" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# disable bfd and cfm together. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4539: ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10" -at_fn_check_prepare_trace "ofproto-dpif.at:4539" -( $at_check_trace; ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4539" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# check log. -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4541: ovs_wait_cond () { grep \"monitor thread terminated\" ovs-vswitchd.log -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4541" -( $at_check_trace; ovs_wait_cond () { grep "monitor thread terminated" ovs-vswitchd.log -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4541" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4543: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4543" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4543" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4543: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4543" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4543" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4543: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4543" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4543" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_814 -#AT_START_815 -at_fn_group_banner 815 'ofproto-dpif.at:4547' \ - "ofproto-dpif - ofproto-dpif-monitor 2" " " 46 -at_xfail=no -( - $as_echo "815. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4548: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4548" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4548" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4548: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4548" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4548" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4548: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4548" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4548" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4548: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4548" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4548: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4548" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4548: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4548" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4548: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4548" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4548" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -for i in `seq 1 199` -do - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4552: ovs-vsctl add-port br0 p\$i -- set interface p\$i type=gre options:remote_ip=1.2.3.4 options:key=\$i bfd:enable=true" -at_fn_check_prepare_dynamic "ovs-vsctl add-port br0 p$i -- set interface p$i type=gre options:remote_ip=1.2.3.4 options:key=$i bfd:enable=true" "ofproto-dpif.at:4552" -( $at_check_trace; ovs-vsctl add-port br0 p$i -- set interface p$i type=gre options:remote_ip=1.2.3.4 options:key=$i bfd:enable=true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4552" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4555: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4555" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4555" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4555: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4555" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4555" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4555: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4555" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4555" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_815 -#AT_START_816 -at_fn_group_banner 816 'ofproto-dpif.at:4560' \ - "ofproto-dpif - infinite resubmit" " " 47 -at_xfail=no -( - $as_echo "816. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4561: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4561" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4561" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4561: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4561" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4561: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4561" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4561" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4561: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4561" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4561: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4561" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4561: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4561" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4561: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4561" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4561" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4562: ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3" -at_fn_check_prepare_trace "ofproto-dpif.at:4562" -( $at_check_trace; ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4562" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4563: ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'" -at_fn_check_prepare_trace "ofproto-dpif.at:4563" -( $at_check_trace; ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4563" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4565: tail -1 stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:4565" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: drop -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4565" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4567: grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4567" -( $at_check_trace; grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4567" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4570: check_logs \"/resubmit actions recursed/d\"" -at_fn_check_prepare_trace "ofproto-dpif.at:4570" -( $at_check_trace; check_logs "/resubmit actions recursed/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4570" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4570: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4570" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4570" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4570: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4570" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4570" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_816 -#AT_START_817 -at_fn_group_banner 817 'ofproto-dpif.at:4573' \ - "ofproto-dpif - exponential resubmit chain" " " 47 -at_xfail=no -( - $as_echo "817. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4574: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4574" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4574" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4574: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4574" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4574" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4574: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4574" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4574" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4574: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4574" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4574: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4574" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4574: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4574" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4574: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4574" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4574" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -(for i in `seq 1 64`; do - j=`expr $i + 1` - echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local" - done - echo "in_port=65, actions=local") > flows - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4581: ovs-ofctl add-flows br0 flows" -at_fn_check_prepare_trace "ofproto-dpif.at:4581" -( $at_check_trace; ovs-ofctl add-flows br0 flows -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4581" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4582: ovs-appctl ofproto/trace br0 'in_port=1'" -at_fn_check_prepare_trace "ofproto-dpif.at:4582" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4582" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4583: grep -c 'over 4096 resubmit actions' ovs-vswitchd.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4583" -( $at_check_trace; grep -c 'over 4096 resubmit actions' ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4583" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4585: check_logs \"/over.*resubmit actions/d\"" -at_fn_check_prepare_trace "ofproto-dpif.at:4585" -( $at_check_trace; check_logs "/over.*resubmit actions/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4585" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4585: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4585" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4585" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4585: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4585" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4585" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_817 -#AT_START_818 -at_fn_group_banner 818 'ofproto-dpif.at:4588' \ - "ofproto-dpif - too many output actions" " " 47 -at_xfail=no -( - $as_echo "818. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4589: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4589" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4589" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4589: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4589" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4589" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4589: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4589" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4589" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4589: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4589" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4589" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4589: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4589" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4589" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4589: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4589" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4589" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4589: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4589" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4589" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -(for i in `seq 1 12`; do - j=`expr $i + 1` - echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local" - done - echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4596: ovs-ofctl add-flows br0 flows" -at_fn_check_prepare_trace "ofproto-dpif.at:4596" -( $at_check_trace; ovs-ofctl add-flows br0 flows -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4596" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4597: ovs-appctl ofproto/trace br0 'in_port=1'" -at_fn_check_prepare_trace "ofproto-dpif.at:4597" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4597" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4598: grep -c -e '- Uses action(s) not supported by datapath' stdout" -at_fn_check_prepare_trace "ofproto-dpif.at:4598" -( $at_check_trace; grep -c -e '- Uses action(s) not supported by datapath' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4598" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4601: grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4601" -( $at_check_trace; grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4601" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4603: check_logs \"/resubmits yielded over 64 kB of actions/d\"" -at_fn_check_prepare_trace "ofproto-dpif.at:4603" -( $at_check_trace; check_logs "/resubmits yielded over 64 kB of actions/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4603: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4603" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4603: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4603" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4603" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_818 -#AT_START_819 -at_fn_group_banner 819 'ofproto-dpif.at:4606' \ - "ofproto-dpif - stack too deep" " " 47 -at_xfail=no -( - $as_echo "819. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4607: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4607" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4607" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4607: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4607" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4607" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4607: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4607" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4607" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4607: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4607" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4607" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4607: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4607" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4607" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4607: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4607" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4607" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4607: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4607" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4607" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -(for i in `seq 1 12`; do - j=`expr $i + 1` - echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local" - done - push="push:NXM_NX_REG0[]" - echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4615: ovs-ofctl add-flows br0 flows" -at_fn_check_prepare_trace "ofproto-dpif.at:4615" -( $at_check_trace; ovs-ofctl add-flows br0 flows -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4615" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4616: ovs-appctl ofproto/trace br0 'in_port=1'" -at_fn_check_prepare_trace "ofproto-dpif.at:4616" -( $at_check_trace; ovs-appctl ofproto/trace br0 'in_port=1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4616" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4617: grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4617" -( $at_check_trace; grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4619: check_logs \"/resubmits yielded over 64 kB of stack/d\"" -at_fn_check_prepare_trace "ofproto-dpif.at:4619" -( $at_check_trace; check_logs "/resubmits yielded over 64 kB of stack/d" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4619" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4619: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4619" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4619" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4619: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4619" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4619" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_819 -#AT_START_820 -at_fn_group_banner 820 'ofproto-dpif.at:4622' \ - "ofproto-dpif - ICMPv6" " " 47 -at_xfail=no -( - $as_echo "820. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4623: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ofproto-dpif.at:4623" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4623" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4623: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ofproto-dpif.at:4623" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4623" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4623: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4623" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4623" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4623: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ofproto-dpif.at:4623" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4623" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4623: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ofproto-dpif.at:4623" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4623" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4623: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4623" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4623" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4623: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ofproto-dpif.at:4623" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4623" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 - - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4628: ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4628" -( $at_check_trace; ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4628" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da' - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4632: ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ofproto-dpif.at:4632" -( $at_check_trace; ovs_wait_cond () { ovs-appctl -t ovs-ofctl exit -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4632" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4634: cat ofctl_monitor.log" -at_fn_check_prepare_trace "ofproto-dpif.at:4634" -( $at_check_trace; cat ofctl_monitor.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered) -icmp6,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::260:97ff:fe07:69ea,nd_sll=00:00:86:05:80:da,nd_tll=00:00:00:00:00:00 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4634" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4639: check_logs " -at_fn_check_prepare_trace "ofproto-dpif.at:4639" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4639" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4639: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4639" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4639" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ofproto-dpif.at:4639: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ofproto-dpif.at:4639" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ofproto-dpif.at:4639" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" \ -"ofctl_monitor.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_820 -#AT_START_821 -at_fn_group_banner 821 'vlan-splinters.at:3' \ - "VLAN splinters" " " 48 -at_xfail=no -( - $as_echo "821. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:4: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "vlan-splinters.at:4" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:4: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "vlan-splinters.at:4" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:4: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "vlan-splinters.at:4" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:4" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:4: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "vlan-splinters.at:4" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:4: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy=override --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "vlan-splinters.at:4" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy=override --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:4: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "vlan-splinters.at:4" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:4: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "vlan-splinters.at:4" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:4" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-vsctl \ - -- add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ - -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=dummy ofport_request=4 -{ set +x -$as_echo "$at_srcdir/vlan-splinters.at:6: ovs-vsctl \\ - -- set Bridge br0 fail-mode=standalone flood_vlans=0,9,11,15 \\ - -- set port br0 tag=0 \\ - -- set port p1 trunks=0,9,11,15 \\ - -- set interface p1 other-config:enable-vlan-splinters=true \\ - -- set port p2 tag=9 \\ - -- set port p3 tag=11 \\ - -- set port p4 tag=15" -at_fn_check_prepare_notrace 'an embedded newline' "vlan-splinters.at:6" -( $at_check_trace; ovs-vsctl \ - -- set Bridge br0 fail-mode=standalone flood_vlans=0,9,11,15 \ - -- set port br0 tag=0 \ - -- set port p1 trunks=0,9,11,15 \ - -- set interface p1 other-config:enable-vlan-splinters=true \ - -- set port p2 tag=9 \ - -- set port p3 tag=11 \ - -- set port p4 tag=15 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:6" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - -ovs-appctl dpif/show | sed -n ' -s/\./_/g -s/^[ ]*\([^ ][^ ]*\) [0-9]*\/\([0-9]*\).*/\1=\2/p -' > port-numbers -cat port-numbers -. ./port-numbers - -for args in '9 p2' '11 p3' '15 p4'; do - set $args - vlan=$1 - eval access_port=\$$2 - eval splinter_port=\$p1_$vlan - - # Check that when a packet is received on $splinter_port, it is - # treated as if it had been received on p1 in the correct VLAN. - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:30: ovs-appctl ofproto/trace ovs-dummy \"in_port(\$splinter_port)\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"in_port($splinter_port)\"" "vlan-splinters.at:30" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "in_port($splinter_port)" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:30" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:32: sed -n '/^Flow/p; /^Datapath/p' stdout" -at_fn_check_prepare_trace "vlan-splinters.at:32" -( $at_check_trace; sed -n '/^Flow/p; /^Datapath/p' stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Flow: metadata=0,in_port=$p1,dl_vlan=$vlan,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x05ff -Datapath actions: $access_port -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:32" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - # Check that when an OpenFlow action sends a packet to p1 on - # splintered VLAN $vlan, it is actually output to $splinter_port. - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:39: ovs-appctl ofproto/trace ovs-dummy \"in_port(\$access_port)\"" -at_fn_check_prepare_dynamic "ovs-appctl ofproto/trace ovs-dummy \"in_port($access_port)\"" "vlan-splinters.at:39" -( $at_check_trace; ovs-appctl ofproto/trace ovs-dummy "in_port($access_port)" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:39" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:41: tail -1 stdout" -at_fn_check_prepare_trace "vlan-splinters.at:41" -( $at_check_trace; tail -1 stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Datapath actions: $splinter_port -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:41" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -done - -{ set +x -$as_echo "$at_srcdir/vlan-splinters.at:45: check_logs " -at_fn_check_prepare_trace "vlan-splinters.at:45" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:45" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:45: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "vlan-splinters.at:45" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:45" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vlan-splinters.at:45: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "vlan-splinters.at:45" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlan-splinters.at:45" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_821 -#AT_START_822 -at_fn_group_banner 822 'ovsdb-log.at:3' \ - "create empty, reread" " " 49 -at_xfail=no -( - $as_echo "822. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:6: test-ovsdb log-io file create" -at_fn_check_prepare_trace "ovsdb-log.at:6" -( $at_check_trace; test-ovsdb log-io file create -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:6" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:10: test-ovsdb log-io file read-only read" -at_fn_check_prepare_trace "ovsdb-log.at:10" -( $at_check_trace; test-ovsdb log-io file read-only read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:10" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:15: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:15" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:15" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_822 -#AT_START_823 -at_fn_group_banner 823 'ovsdb-log.at:18' \ - "write one, reread" " " 49 -at_xfail=no -( - $as_echo "823. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:21: test-ovsdb log-io file create 'write:[0]'" -at_fn_check_prepare_trace "ovsdb-log.at:21" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:21" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:26: test-ovsdb log-io file read-only read read" -at_fn_check_prepare_trace "ovsdb-log.at:26" -( $at_check_trace; test-ovsdb log-io file read-only read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:26" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:32: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:32" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:32" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_823 -#AT_START_824 -at_fn_group_banner 824 'ovsdb-log.at:35' \ - "check that create fails if file exists" " " 49 -at_xfail=no -( - $as_echo "824. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:38: test-ovsdb log-io file create 'write:[1]'" -at_fn_check_prepare_trace "ovsdb-log.at:38" -( $at_check_trace; test-ovsdb log-io file create 'write:[1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[1] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:38" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:43: test-ovsdb log-io file read-only read" -at_fn_check_prepare_trace "ovsdb-log.at:43" -( $at_check_trace; test-ovsdb log-io file read-only read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [1] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:43" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:48: test-ovsdb log-io file create read" -at_fn_check_prepare_trace "ovsdb-log.at:48" -( $at_check_trace; test-ovsdb log-io file create read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test-ovsdb: I/O error: create: file failed (File exists) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-log.at:48" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:52: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:52" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:52" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_824 -#AT_START_825 -at_fn_group_banner 825 'ovsdb-log.at:55' \ - "write one, reread" " " 49 -at_xfail=no -( - $as_echo "825. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:58: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:58" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:58" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:65: test-ovsdb log-io file read-only read read read read" -at_fn_check_prepare_trace "ovsdb-log.at:65" -( $at_check_trace; test-ovsdb log-io file read-only read read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:65" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:73: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:73" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:73" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_825 -#AT_START_826 -at_fn_group_banner 826 'ovsdb-log.at:76' \ - "write one, reread, append" " " 49 -at_xfail=no -( - $as_echo "826. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:79: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:79" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:79" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:86: test-ovsdb log-io file read/write read read read 'write:[\"append\"]'" -at_fn_check_prepare_trace "ovsdb-log.at:86" -( $at_check_trace; test-ovsdb log-io file read/write read read read 'write:["append"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: write:[\"append\"] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:86" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:94: test-ovsdb log-io file read-only read read read read read" -at_fn_check_prepare_trace "ovsdb-log.at:94" -( $at_check_trace; test-ovsdb log-io file read-only read read read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: read: [\"append\"] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:94" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:103: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:103" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:103" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_826 -#AT_START_827 -at_fn_group_banner 827 'ovsdb-log.at:106' \ - "write, reread one, overwrite" " " 49 -at_xfail=no -( - $as_echo "827. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:109: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:109" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:109" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:116: test-ovsdb log-io file read/write read 'write:[\"more data\"]'" -at_fn_check_prepare_trace "ovsdb-log.at:116" -( $at_check_trace; test-ovsdb log-io file read/write read 'write:["more data"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: write:[\"more data\"] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:116" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:122: test-ovsdb log-io file read-only read read read" -at_fn_check_prepare_trace "ovsdb-log.at:122" -( $at_check_trace; test-ovsdb log-io file read-only read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [\"more data\"] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:122" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:129: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:129" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:129" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_827 -#AT_START_828 -at_fn_group_banner 828 'ovsdb-log.at:132' \ - "write, add corrupted data, read" " " 49 -at_xfail=no -( - $as_echo "828. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:135: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:135" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:135" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:142: echo 'xxx' >> file" -at_fn_check_prepare_trace "ovsdb-log.at:142" -( $at_check_trace; echo 'xxx' >> file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:142" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:143: test-ovsdb log-io file read-only read read read read" -at_fn_check_prepare_trace "ovsdb-log.at:143" -( $at_check_trace; test-ovsdb log-io file read-only read read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: read failed: syntax error: file: parse error at offset 174 in header line \"xxx\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:143" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:151: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:151" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:151" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_828 -#AT_START_829 -at_fn_group_banner 829 'ovsdb-log.at:154' \ - "write, add corrupted data, read, overwrite" " " 49 -at_xfail=no -( - $as_echo "829. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:157: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:157" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:157" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:164: echo 'xxx' >> file" -at_fn_check_prepare_trace "ovsdb-log.at:164" -( $at_check_trace; echo 'xxx' >> file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:164" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:165: test-ovsdb log-io file read/write read read read read 'write:[3]'" -at_fn_check_prepare_trace "ovsdb-log.at:165" -( $at_check_trace; test-ovsdb log-io file read/write read read read read 'write:[3]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: read failed: syntax error: file: parse error at offset 174 in header line \"xxx\" -file: write:[3] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:165" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:174: test-ovsdb log-io file read-only read read read read read" -at_fn_check_prepare_trace "ovsdb-log.at:174" -( $at_check_trace; test-ovsdb log-io file read-only read read read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: read: [3] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:174" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:183: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:183" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:183" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_829 -#AT_START_830 -at_fn_group_banner 830 'ovsdb-log.at:186' \ - "write, corrupt some data, read, overwrite" " " 49 -at_xfail=no -( - $as_echo "830. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:189: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:189" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:189" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:196: sed 's/\\[2]/[3]/' < file > file.tmp" -at_fn_check_prepare_trace "ovsdb-log.at:196" -( $at_check_trace; sed 's/\[2]/[3]/' < file > file.tmp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:196" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:197: mv file.tmp file" -at_fn_check_prepare_trace "ovsdb-log.at:197" -( $at_check_trace; mv file.tmp file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:197" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:198: grep -c '\\[3]' file" -at_fn_check_prepare_trace "ovsdb-log.at:198" -( $at_check_trace; grep -c '\[3]' file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:198" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:200: test-ovsdb log-io file read/write read read read 'write:[\"longer data\"]'" -at_fn_check_prepare_trace "ovsdb-log.at:200" -( $at_check_trace; test-ovsdb log-io file read/write read read read 'write:["longer data"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read failed: syntax error: file: 4 bytes starting at offset 170 have SHA-1 hash 5c031e5c0d3a9338cc127ebe40bb2748b6a67e78 but should have hash 98f55556e7ffd432381b56a19bd485b3e6446442 -file: write:[\"longer data\"] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:200" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:208: test-ovsdb log-io file read-only read read read read" -at_fn_check_prepare_trace "ovsdb-log.at:208" -( $at_check_trace; test-ovsdb log-io file read-only read read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [\"longer data\"] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:208" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:216: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:216" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:216" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_830 -#AT_START_831 -at_fn_group_banner 831 'ovsdb-log.at:219' \ - "write, truncate file, read, overwrite" " " 49 -at_xfail=no -( - $as_echo "831. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:222: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:222" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:222" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:229: sed 's/\\[2]/2/' < file > file.tmp" -at_fn_check_prepare_trace "ovsdb-log.at:229" -( $at_check_trace; sed 's/\[2]/2/' < file > file.tmp -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:229" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:230: mv file.tmp file" -at_fn_check_prepare_trace "ovsdb-log.at:230" -( $at_check_trace; mv file.tmp file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:230" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:231: grep -c '^2\$' file" -at_fn_check_prepare_dynamic "grep -c '^2$' file" "ovsdb-log.at:231" -( $at_check_trace; grep -c '^2$' file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:231" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:233: test-ovsdb log-io file read/write read read read 'write:[\"longer data\"]'" -at_fn_check_prepare_trace "ovsdb-log.at:233" -( $at_check_trace; test-ovsdb log-io file read/write read read read 'write:["longer data"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read failed: I/O error: file: error reading 4 bytes starting at offset 170 (End of file) -file: write:[\"longer data\"] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:233" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:241: test-ovsdb log-io file read-only read read read read" -at_fn_check_prepare_trace "ovsdb-log.at:241" -( $at_check_trace; test-ovsdb log-io file read-only read read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [\"longer data\"] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:241" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:249: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:249" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:249" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_831 -#AT_START_832 -at_fn_group_banner 832 'ovsdb-log.at:252' \ - "write bad JSON, read, overwrite" " " 49 -at_xfail=no -( - $as_echo "832. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:255: test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]'" -at_fn_check_prepare_trace "ovsdb-log.at:255" -( $at_check_trace; test-ovsdb log-io file create 'write:[0]' 'write:[1]' 'write:[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: write:[0] successful -file: write:[1] successful -file: write:[2] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:255" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:262: printf '%s\\n%s\\n' 'OVSDB JSON 5 d910b02871075d3156ec8675dfc95b7d5d640aa6' 'null' >> file" -at_fn_check_prepare_trace "ovsdb-log.at:262" -( $at_check_trace; printf '%s\n%s\n' 'OVSDB JSON 5 d910b02871075d3156ec8675dfc95b7d5d640aa6' 'null' >> file -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:262" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:263: test-ovsdb log-io file read/write read read read read 'write:[\"replacement data\"]'" -at_fn_check_prepare_trace "ovsdb-log.at:263" -( $at_check_trace; test-ovsdb log-io file read/write read read read read 'write:["replacement data"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: read failed: syntax error: file: 5 bytes starting at offset 228 are not valid JSON (line 0, column 4, byte 4: syntax error at beginning of input) -file: write:[\"replacement data\"] successful -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:263" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:272: test-ovsdb log-io file read-only read read read read read" -at_fn_check_prepare_trace "ovsdb-log.at:272" -( $at_check_trace; test-ovsdb log-io file read-only read read read read read -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "file: open successful -file: read: [0] -file: read: [1] -file: read: [2] -file: read: [\"replacement data\"] -file: read: end of log -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:272" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-log.at:281: test -f .file.~lock~" -at_fn_check_prepare_trace "ovsdb-log.at:281" -( $at_check_trace; test -f .file.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-log.at:281" -$at_failed && at_fn_log_failure \ -"file" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_832 -#AT_START_833 -at_fn_group_banner 833 'ovsdb-types.at:3' \ - "integer - C" " " 50 -at_xfail=no -( - $as_echo "833. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:3: test-ovsdb parse-atomic-type '[\"integer\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:3" -( $at_check_trace; test-ovsdb parse-atomic-type '["integer"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"integer\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_833 -#AT_START_834 -at_fn_group_banner 834 'ovsdb-types.at:3' \ - "integer - Python" " " 50 -at_xfail=no -( - $as_echo "834. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:3" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:3" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:3: \$PYTHON \$srcdir/test-ovsdb.py parse-atomic-type '[\"integer\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atomic-type '[\"integer\"]' " "ovsdb-types.at:3" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atomic-type '["integer"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"integer\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_834 -#AT_START_835 -at_fn_group_banner 835 'ovsdb-types.at:5' \ - "real - C" " " 50 -at_xfail=no -( - $as_echo "835. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:5: test-ovsdb parse-atomic-type '[\"real\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:5" -( $at_check_trace; test-ovsdb parse-atomic-type '["real"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"real\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:5" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_835 -#AT_START_836 -at_fn_group_banner 836 'ovsdb-types.at:5' \ - "real - Python" " " 50 -at_xfail=no -( - $as_echo "836. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:5" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:5" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:5: \$PYTHON \$srcdir/test-ovsdb.py parse-atomic-type '[\"real\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atomic-type '[\"real\"]' " "ovsdb-types.at:5" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atomic-type '["real"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"real\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:5" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_836 -#AT_START_837 -at_fn_group_banner 837 'ovsdb-types.at:7' \ - "boolean - C" " " 50 -at_xfail=no -( - $as_echo "837. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:7: test-ovsdb parse-atomic-type '[\"boolean\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:7" -( $at_check_trace; test-ovsdb parse-atomic-type '["boolean"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"boolean\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_837 -#AT_START_838 -at_fn_group_banner 838 'ovsdb-types.at:7' \ - "boolean - Python" " " 50 -at_xfail=no -( - $as_echo "838. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:7" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:7" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:7: \$PYTHON \$srcdir/test-ovsdb.py parse-atomic-type '[\"boolean\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atomic-type '[\"boolean\"]' " "ovsdb-types.at:7" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atomic-type '["boolean"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"boolean\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_838 -#AT_START_839 -at_fn_group_banner 839 'ovsdb-types.at:9' \ - "string - C" " " 50 -at_xfail=no -( - $as_echo "839. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:9: test-ovsdb parse-atomic-type '[\"string\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:9" -( $at_check_trace; test-ovsdb parse-atomic-type '["string"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"string\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:9" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_839 -#AT_START_840 -at_fn_group_banner 840 'ovsdb-types.at:9' \ - "string - Python" " " 50 -at_xfail=no -( - $as_echo "840. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:9" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:9" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:9: \$PYTHON \$srcdir/test-ovsdb.py parse-atomic-type '[\"string\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atomic-type '[\"string\"]' " "ovsdb-types.at:9" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atomic-type '["string"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"string\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:9" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_840 -#AT_START_841 -at_fn_group_banner 841 'ovsdb-types.at:11' \ - "uuid - C" " " 50 -at_xfail=no -( - $as_echo "841. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:11: test-ovsdb parse-atomic-type '[\"uuid\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:11" -( $at_check_trace; test-ovsdb parse-atomic-type '["uuid"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"uuid\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_841 -#AT_START_842 -at_fn_group_banner 842 'ovsdb-types.at:11' \ - "uuid - Python" " " 50 -at_xfail=no -( - $as_echo "842. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:11" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:11" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:11: \$PYTHON \$srcdir/test-ovsdb.py parse-atomic-type '[\"uuid\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atomic-type '[\"uuid\"]' " "ovsdb-types.at:11" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atomic-type '["uuid"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"uuid\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_842 -#AT_START_843 -at_fn_group_banner 843 'ovsdb-types.at:13' \ - "void is not a valid atomic-type - C" " " 50 -at_xfail=no -( - $as_echo "843. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:13: test-ovsdb parse-atomic-type '[\"void\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:13" -( $at_check_trace; test-ovsdb parse-atomic-type '["void"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:13: if grep -F -e \"\\\"void\\\" is not an atomic-type\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:13" -( $at_check_trace; if grep -F -e "\"void\" is not an atomic-type" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_843 -#AT_START_844 -at_fn_group_banner 844 'ovsdb-types.at:13' \ - "void is not a valid atomic-type - Python" " " 50 -at_xfail=no -( - $as_echo "844. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:13" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:13" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:13: \$PYTHON \$srcdir/test-ovsdb.py parse-atomic-type '[\"void\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atomic-type '[\"void\"]' " "ovsdb-types.at:13" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atomic-type '["void"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:13: if grep -F -e \"\\\"void\\\" is not an atomic-type\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:13" -( $at_check_trace; if grep -F -e "\"void\" is not an atomic-type" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_844 -#AT_START_845 -at_fn_group_banner 845 'ovsdb-types.at:18' \ - "integer enum - C" " " 51 -at_xfail=no -( - $as_echo "845. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:18: test-ovsdb parse-base-type '{\"type\": \"integer\", \"enum\": [\"set\", [-1, 4, 5]]}' " -at_fn_check_prepare_trace "ovsdb-types.at:18" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "integer", "enum": ["set", [-1, 4, 5]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"set\",[-1,4,5]],\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:18" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_845 -#AT_START_846 -at_fn_group_banner 846 'ovsdb-types.at:18' \ - "integer enum - Python" " " 51 -at_xfail=no -( - $as_echo "846. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:18" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:18" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:18: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"enum\": [\"set\", [-1, 4, 5]]}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"enum\": [\"set\", [-1, 4, 5]]}' " "ovsdb-types.at:18" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "integer", "enum": ["set", [-1, 4, 5]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"set\",[-1,4,5]],\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:18" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_846 -#AT_START_847 -at_fn_group_banner 847 'ovsdb-types.at:21' \ - "integer >= 5 - C" " " 51 -at_xfail=no -( - $as_echo "847. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:21: test-ovsdb parse-base-type '{\"type\": \"integer\", \"minInteger\": 5}' " -at_fn_check_prepare_trace "ovsdb-types.at:21" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "integer", "minInteger": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"minInteger\":5,\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_847 -#AT_START_848 -at_fn_group_banner 848 'ovsdb-types.at:21' \ - "integer >= 5 - Python" " " 51 -at_xfail=no -( - $as_echo "848. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:21" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:21" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:21: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"minInteger\": 5}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"minInteger\": 5}' " "ovsdb-types.at:21" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "integer", "minInteger": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"minInteger\":5,\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:21" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_848 -#AT_START_849 -at_fn_group_banner 849 'ovsdb-types.at:24' \ - "integer <= 7 - C" " " 51 -at_xfail=no -( - $as_echo "849. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:24: test-ovsdb parse-base-type '{\"type\": \"integer\", \"maxInteger\": 7}' " -at_fn_check_prepare_trace "ovsdb-types.at:24" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "integer", "maxInteger": 7}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxInteger\":7,\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:24" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_849 -#AT_START_850 -at_fn_group_banner 850 'ovsdb-types.at:24' \ - "integer <= 7 - Python" " " 51 -at_xfail=no -( - $as_echo "850. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:24" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:24" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:24: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"maxInteger\": 7}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"maxInteger\": 7}' " "ovsdb-types.at:24" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "integer", "maxInteger": 7}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxInteger\":7,\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:24" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_850 -#AT_START_851 -at_fn_group_banner 851 'ovsdb-types.at:27' \ - "integer between -5 and 10 - C" " " 51 -at_xfail=no -( - $as_echo "851. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:27: test-ovsdb parse-base-type '{\"type\": \"integer\", \"minInteger\": -5, \"maxInteger\": 10}'" -at_fn_check_prepare_trace "ovsdb-types.at:27" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "integer", "minInteger": -5, "maxInteger": 10}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxInteger\":10,\"minInteger\":-5,\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:27" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_851 -#AT_START_852 -at_fn_group_banner 852 'ovsdb-types.at:27' \ - "integer between -5 and 10 - Python" " " 51 -at_xfail=no -( - $as_echo "852. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:27" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:27" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:27: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"minInteger\": -5, \"maxInteger\": 10}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"minInteger\": -5, \"maxInteger\": 10}'" "ovsdb-types.at:27" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "integer", "minInteger": -5, "maxInteger": 10}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxInteger\":10,\"minInteger\":-5,\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:27" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_852 -#AT_START_853 -at_fn_group_banner 853 'ovsdb-types.at:30' \ - "integer max may not be less than min - C" " " 51 -at_xfail=no -( - $as_echo "853. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:30: test-ovsdb parse-base-type '{\"type\": \"integer\", \"minInteger\": 5, \"maxInteger\": 3}'" -at_fn_check_prepare_trace "ovsdb-types.at:30" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "integer", "minInteger": 5, "maxInteger": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:30: if grep -F -e \"minInteger exceeds maxInteger\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:30" -( $at_check_trace; if grep -F -e "minInteger exceeds maxInteger" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_853 -#AT_START_854 -at_fn_group_banner 854 'ovsdb-types.at:30' \ - "integer max may not be less than min - Python" " " 51 -at_xfail=no -( - $as_echo "854. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:30" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:30" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:30: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"minInteger\": 5, \"maxInteger\": 3}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"integer\", \"minInteger\": 5, \"maxInteger\": 3}'" "ovsdb-types.at:30" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "integer", "minInteger": 5, "maxInteger": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:30: if grep -F -e \"minInteger exceeds maxInteger\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:30" -( $at_check_trace; if grep -F -e "minInteger exceeds maxInteger" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_854 -#AT_START_855 -at_fn_group_banner 855 'ovsdb-types.at:34' \ - "real enum - C" " " 51 -at_xfail=no -( - $as_echo "855. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:34: test-ovsdb parse-base-type '{\"type\": \"real\", \"enum\": [\"set\", [1.5, 0, 2.75]]}' " -at_fn_check_prepare_trace "ovsdb-types.at:34" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "real", "enum": ["set", [1.5, 0, 2.75]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"set\",[0,1.5,2.75]],\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_855 -#AT_START_856 -at_fn_group_banner 856 'ovsdb-types.at:34' \ - "real enum - Python" " " 51 -at_xfail=no -( - $as_echo "856. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:34" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:34" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:34: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"enum\": [\"set\", [1.5, 0, 2.75]]}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"enum\": [\"set\", [1.5, 0, 2.75]]}' " "ovsdb-types.at:34" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "real", "enum": ["set", [1.5, 0, 2.75]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"set\",[0,1.5,2.75]],\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_856 -#AT_START_857 -at_fn_group_banner 857 'ovsdb-types.at:37' \ - "real >= -1.5 - C" " " 51 -at_xfail=no -( - $as_echo "857. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:37: test-ovsdb parse-base-type '{\"type\": \"real\", \"minReal\": -1.5}'" -at_fn_check_prepare_trace "ovsdb-types.at:37" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "real", "minReal": -1.5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"minReal\":-1.5,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:37" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_857 -#AT_START_858 -at_fn_group_banner 858 'ovsdb-types.at:37' \ - "real >= -1.5 - Python" " " 51 -at_xfail=no -( - $as_echo "858. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:37" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:37" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:37: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"minReal\": -1.5}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"minReal\": -1.5}'" "ovsdb-types.at:37" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "real", "minReal": -1.5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"minReal\":-1.5,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:37" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_858 -#AT_START_859 -at_fn_group_banner 859 'ovsdb-types.at:40' \ - "real <= 1e5 - C" " " 51 -at_xfail=no -( - $as_echo "859. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:40: test-ovsdb parse-base-type '{\"type\": \"real\", \"maxReal\": 1e5}'" -at_fn_check_prepare_trace "ovsdb-types.at:40" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "real", "maxReal": 1e5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxReal\":100000,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_859 -#AT_START_860 -at_fn_group_banner 860 'ovsdb-types.at:40' \ - "real <= 1e5 - Python" " " 51 -at_xfail=no -( - $as_echo "860. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:40" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:40" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:40: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"maxReal\": 1e5}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"maxReal\": 1e5}'" "ovsdb-types.at:40" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "real", "maxReal": 1e5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxReal\":100000,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_860 -#AT_START_861 -at_fn_group_banner 861 'ovsdb-types.at:43' \ - "real between -2.5 and 3.75 - C" " " 51 -at_xfail=no -( - $as_echo "861. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:43: test-ovsdb parse-base-type '{\"type\": \"real\", \"minReal\": -2.5, \"maxReal\": 3.75}'" -at_fn_check_prepare_trace "ovsdb-types.at:43" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "real", "minReal": -2.5, "maxReal": 3.75}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxReal\":3.75,\"minReal\":-2.5,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:43" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_861 -#AT_START_862 -at_fn_group_banner 862 'ovsdb-types.at:43' \ - "real between -2.5 and 3.75 - Python" " " 51 -at_xfail=no -( - $as_echo "862. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:43" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:43" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:43: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"minReal\": -2.5, \"maxReal\": 3.75}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"minReal\": -2.5, \"maxReal\": 3.75}'" "ovsdb-types.at:43" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "real", "minReal": -2.5, "maxReal": 3.75}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxReal\":3.75,\"minReal\":-2.5,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:43" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_862 -#AT_START_863 -at_fn_group_banner 863 'ovsdb-types.at:46' \ - "real max may not be less than min - C" " " 51 -at_xfail=no -( - $as_echo "863. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:46: test-ovsdb parse-base-type '{\"type\": \"real\", \"minReal\": 555, \"maxReal\": 444}'" -at_fn_check_prepare_trace "ovsdb-types.at:46" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "real", "minReal": 555, "maxReal": 444}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:46: if grep -F -e \"minReal exceeds maxReal\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:46" -( $at_check_trace; if grep -F -e "minReal exceeds maxReal" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_863 -#AT_START_864 -at_fn_group_banner 864 'ovsdb-types.at:46' \ - "real max may not be less than min - Python" " " 51 -at_xfail=no -( - $as_echo "864. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:46" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:46" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:46: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"minReal\": 555, \"maxReal\": 444}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"real\", \"minReal\": 555, \"maxReal\": 444}'" "ovsdb-types.at:46" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "real", "minReal": 555, "maxReal": 444}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:46: if grep -F -e \"minReal exceeds maxReal\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:46" -( $at_check_trace; if grep -F -e "minReal exceeds maxReal" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_864 -#AT_START_865 -at_fn_group_banner 865 'ovsdb-types.at:50' \ - "boolean - C" " " 51 -at_xfail=no -( - $as_echo "865. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:50: test-ovsdb parse-base-type '[{\"type\": \"boolean\"}]' " -at_fn_check_prepare_trace "ovsdb-types.at:50" -( $at_check_trace; test-ovsdb parse-base-type '[{"type": "boolean"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"boolean\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_865 -#AT_START_866 -at_fn_group_banner 866 'ovsdb-types.at:50' \ - "boolean - Python" " " 51 -at_xfail=no -( - $as_echo "866. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:50" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:50" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:50: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '[{\"type\": \"boolean\"}]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '[{\"type\": \"boolean\"}]' " "ovsdb-types.at:50" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '[{"type": "boolean"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"boolean\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:50" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_866 -#AT_START_867 -at_fn_group_banner 867 'ovsdb-types.at:52' \ - "boolean enum - C" " " 51 -at_xfail=no -( - $as_echo "867. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:52: test-ovsdb parse-base-type '{\"type\": \"boolean\", \"enum\": true}' " -at_fn_check_prepare_trace "ovsdb-types.at:52" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "boolean", "enum": true}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":true,\"type\":\"boolean\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:52" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_867 -#AT_START_868 -at_fn_group_banner 868 'ovsdb-types.at:52' \ - "boolean enum - Python" " " 51 -at_xfail=no -( - $as_echo "868. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:52" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:52" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:52: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"boolean\", \"enum\": true}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"boolean\", \"enum\": true}' " "ovsdb-types.at:52" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "boolean", "enum": true}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":true,\"type\":\"boolean\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:52" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_868 -#AT_START_869 -at_fn_group_banner 869 'ovsdb-types.at:56' \ - "string enum - C" " " 51 -at_xfail=no -( - $as_echo "869. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:56: test-ovsdb parse-base-type '{\"type\": \"string\", \"enum\": [\"set\", [\"def\", \"abc\"]]}'" -at_fn_check_prepare_trace "ovsdb-types.at:56" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "string", "enum": ["set", ["def", "abc"]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"set\",[\"abc\",\"def\"]],\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:56" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_869 -#AT_START_870 -at_fn_group_banner 870 'ovsdb-types.at:56' \ - "string enum - Python" " " 51 -at_xfail=no -( - $as_echo "870. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:56" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:56" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:56: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"enum\": [\"set\", [\"def\", \"abc\"]]}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"enum\": [\"set\", [\"def\", \"abc\"]]}'" "ovsdb-types.at:56" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "string", "enum": ["set", ["def", "abc"]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"set\",[\"abc\",\"def\"]],\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:56" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_870 -#AT_START_871 -at_fn_group_banner 871 'ovsdb-types.at:59' \ - "string minLength - C" " " 51 -at_xfail=no -( - $as_echo "871. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:59: test-ovsdb parse-base-type '{\"type\": \"string\", \"minLength\": 1}'" -at_fn_check_prepare_trace "ovsdb-types.at:59" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "string", "minLength": 1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"minLength\":1,\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:59" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_871 -#AT_START_872 -at_fn_group_banner 872 'ovsdb-types.at:59' \ - "string minLength - Python" " " 51 -at_xfail=no -( - $as_echo "872. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:59" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:59" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:59: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"minLength\": 1}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"minLength\": 1}'" "ovsdb-types.at:59" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "string", "minLength": 1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"minLength\":1,\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:59" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_872 -#AT_START_873 -at_fn_group_banner 873 'ovsdb-types.at:62' \ - "string maxLength - C" " " 51 -at_xfail=no -( - $as_echo "873. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:62: test-ovsdb parse-base-type '{\"type\": \"string\", \"maxLength\": 5}'" -at_fn_check_prepare_trace "ovsdb-types.at:62" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "string", "maxLength": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxLength\":5,\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:62" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_873 -#AT_START_874 -at_fn_group_banner 874 'ovsdb-types.at:62' \ - "string maxLength - Python" " " 51 -at_xfail=no -( - $as_echo "874. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:62" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:62" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:62: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"maxLength\": 5}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"maxLength\": 5}'" "ovsdb-types.at:62" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "string", "maxLength": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxLength\":5,\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:62" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_874 -#AT_START_875 -at_fn_group_banner 875 'ovsdb-types.at:65' \ - "string minLength and maxLength - C" " " 51 -at_xfail=no -( - $as_echo "875. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:65: test-ovsdb parse-base-type '{\"type\": \"string\", \"minLength\": 1, \"maxLength\": 5}'" -at_fn_check_prepare_trace "ovsdb-types.at:65" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "string", "minLength": 1, "maxLength": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxLength\":5,\"minLength\":1,\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_875 -#AT_START_876 -at_fn_group_banner 876 'ovsdb-types.at:65' \ - "string minLength and maxLength - Python" " " 51 -at_xfail=no -( - $as_echo "876. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:65" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:65" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:65: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"minLength\": 1, \"maxLength\": 5}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"minLength\": 1, \"maxLength\": 5}'" "ovsdb-types.at:65" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "string", "minLength": 1, "maxLength": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"maxLength\":5,\"minLength\":1,\"type\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_876 -#AT_START_877 -at_fn_group_banner 877 'ovsdb-types.at:68' \ - "maxLength must not be less than minLength - C" " " 51 -at_xfail=no -( - $as_echo "877. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:68: test-ovsdb parse-base-type '{\"type\": \"string\", \"minLength\": 5, \"maxLength\": 3}'" -at_fn_check_prepare_trace "ovsdb-types.at:68" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "string", "minLength": 5, "maxLength": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:68" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:68: if grep -F -e \"minLength exceeds maxLength\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:68" -( $at_check_trace; if grep -F -e "minLength exceeds maxLength" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:68" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_877 -#AT_START_878 -at_fn_group_banner 878 'ovsdb-types.at:68' \ - "maxLength must not be less than minLength - Python" "" 51 -at_xfail=no -( - $as_echo "878. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:68" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:68" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:68: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"minLength\": 5, \"maxLength\": 3}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"minLength\": 5, \"maxLength\": 3}'" "ovsdb-types.at:68" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "string", "minLength": 5, "maxLength": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:68" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:68: if grep -F -e \"minLength exceeds maxLength\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:68" -( $at_check_trace; if grep -F -e "minLength exceeds maxLength" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:68" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_878 -#AT_START_879 -at_fn_group_banner 879 'ovsdb-types.at:71' \ - "maxLength must not be negative - C" " " 51 -at_xfail=no -( - $as_echo "879. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:71: test-ovsdb parse-base-type '{\"type\": \"string\", \"maxLength\": -1}'" -at_fn_check_prepare_trace "ovsdb-types.at:71" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "string", "maxLength": -1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:71: if grep -F -e \"maxLength out of valid range 0 to 4294967295\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:71" -( $at_check_trace; if grep -F -e "maxLength out of valid range 0 to 4294967295" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_879 -#AT_START_880 -at_fn_group_banner 880 'ovsdb-types.at:71' \ - "maxLength must not be negative - Python" " " 51 -at_xfail=no -( - $as_echo "880. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:71" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:71" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:71: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"maxLength\": -1}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"string\", \"maxLength\": -1}'" "ovsdb-types.at:71" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "string", "maxLength": -1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:71: if grep -F -e \"maxLength out of valid range 0 to 4294967295\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:71" -( $at_check_trace; if grep -F -e "maxLength out of valid range 0 to 4294967295" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_880 -#AT_START_881 -at_fn_group_banner 881 'ovsdb-types.at:75' \ - "uuid enum - C" " " 51 -at_xfail=no -( - $as_echo "881. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:75: test-ovsdb parse-base-type '{\"type\": \"uuid\", \"enum\": [\"uuid\", \"36bf19c0-ad9d-4232-bb85-b3d73dfe2123\"]}' " -at_fn_check_prepare_trace "ovsdb-types.at:75" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "uuid", "enum": ["uuid", "36bf19c0-ad9d-4232-bb85-b3d73dfe2123"]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"uuid\",\"36bf19c0-ad9d-4232-bb85-b3d73dfe2123\"],\"type\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_881 -#AT_START_882 -at_fn_group_banner 882 'ovsdb-types.at:75' \ - "uuid enum - Python" " " 51 -at_xfail=no -( - $as_echo "882. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:75" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:75" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:75: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"uuid\", \"enum\": [\"uuid\", \"36bf19c0-ad9d-4232-bb85-b3d73dfe2123\"]}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"uuid\", \"enum\": [\"uuid\", \"36bf19c0-ad9d-4232-bb85-b3d73dfe2123\"]}' " "ovsdb-types.at:75" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "uuid", "enum": ["uuid", "36bf19c0-ad9d-4232-bb85-b3d73dfe2123"]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"enum\":[\"uuid\",\"36bf19c0-ad9d-4232-bb85-b3d73dfe2123\"],\"type\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_882 -#AT_START_883 -at_fn_group_banner 883 'ovsdb-types.at:78' \ - "uuid refTable - C" " " 51 -at_xfail=no -( - $as_echo "883. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:78: test-ovsdb parse-base-type '{\"type\": \"uuid\", \"refTable\": \"myTable\"}' " -at_fn_check_prepare_trace "ovsdb-types.at:78" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "uuid", "refTable": "myTable"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"refTable\":\"myTable\",\"type\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:78" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_883 -#AT_START_884 -at_fn_group_banner 884 'ovsdb-types.at:78' \ - "uuid refTable - Python" " " 51 -at_xfail=no -( - $as_echo "884. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:78" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:78" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:78: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"uuid\", \"refTable\": \"myTable\"}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"uuid\", \"refTable\": \"myTable\"}' " "ovsdb-types.at:78" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "uuid", "refTable": "myTable"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"refTable\":\"myTable\",\"type\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:78" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_884 -#AT_START_885 -at_fn_group_banner 885 'ovsdb-types.at:81' \ - "uuid refTable must be valid id - C" " " 51 -at_xfail=no -( - $as_echo "885. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:81: test-ovsdb parse-base-type '{\"type\": \"uuid\", \"refTable\": \"a-b-c\"}' " -at_fn_check_prepare_trace "ovsdb-types.at:81" -( $at_check_trace; test-ovsdb parse-base-type '{"type": "uuid", "refTable": "a-b-c"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:81" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:81: if grep -F -e \"Type mismatch for member 'refTable'\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:81" -( $at_check_trace; if grep -F -e "Type mismatch for member 'refTable'" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:81" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_885 -#AT_START_886 -at_fn_group_banner 886 'ovsdb-types.at:81' \ - "uuid refTable must be valid id - Python" " " 51 -at_xfail=no -( - $as_echo "886. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:81" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:81" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:81: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{\"type\": \"uuid\", \"refTable\": \"a-b-c\"}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{\"type\": \"uuid\", \"refTable\": \"a-b-c\"}' " "ovsdb-types.at:81" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{"type": "uuid", "refTable": "a-b-c"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:81" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:81: if grep -F -e \"Type mismatch for member 'refTable'\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:81" -( $at_check_trace; if grep -F -e "Type mismatch for member 'refTable'" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:81" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_886 -#AT_START_887 -at_fn_group_banner 887 'ovsdb-types.at:85' \ - "void is not a valid base-type - C" " " 51 -at_xfail=no -( - $as_echo "887. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:85: test-ovsdb parse-base-type '[\"void\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:85" -( $at_check_trace; test-ovsdb parse-base-type '["void"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:85" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:85: if grep -F -e \"\\\"void\\\" is not an atomic-type\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:85" -( $at_check_trace; if grep -F -e "\"void\" is not an atomic-type" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:85" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_887 -#AT_START_888 -at_fn_group_banner 888 'ovsdb-types.at:85' \ - "void is not a valid base-type - Python" " " 51 -at_xfail=no -( - $as_echo "888. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:85" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:85" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:85: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '[\"void\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '[\"void\"]' " "ovsdb-types.at:85" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '["void"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:85" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:85: if grep -F -e \"\\\"void\\\" is not an atomic-type\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:85" -( $at_check_trace; if grep -F -e "\"void\" is not an atomic-type" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:85" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_888 -#AT_START_889 -at_fn_group_banner 889 'ovsdb-types.at:87' \ - "\"type\" member must be present - C" " " 51 -at_xfail=no -( - $as_echo "889. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:87: test-ovsdb parse-base-type '{}'" -at_fn_check_prepare_trace "ovsdb-types.at:87" -( $at_check_trace; test-ovsdb parse-base-type '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:87: if grep -F -e \"Parsing ovsdb type failed: Required 'type' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:87" -( $at_check_trace; if grep -F -e "Parsing ovsdb type failed: Required 'type' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_889 -#AT_START_890 -at_fn_group_banner 890 'ovsdb-types.at:87' \ - "\"type\" member must be present - Python" " " 51 -at_xfail=no -( - $as_echo "890. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:87" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:87" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:87: \$PYTHON \$srcdir/test-ovsdb.py parse-base-type '{}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-base-type '{}'" "ovsdb-types.at:87" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-base-type '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:87: if grep -F -e \"Parsing ovsdb type failed: Required 'type' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:87" -( $at_check_trace; if grep -F -e "Parsing ovsdb type failed: Required 'type' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_890 -#AT_START_891 -at_fn_group_banner 891 'ovsdb-types.at:92' \ - "simple integer - C" " " 52 -at_xfail=no -( - $as_echo "891. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:92: test-ovsdb parse-type '[\"integer\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:92" -( $at_check_trace; test-ovsdb parse-type '["integer"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"integer\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:92" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_891 -#AT_START_892 -at_fn_group_banner 892 'ovsdb-types.at:92' \ - "simple integer - Python" " " 52 -at_xfail=no -( - $as_echo "892. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:92" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:92" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:92: \$PYTHON \$srcdir/test-ovsdb.py parse-type '[\"integer\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '[\"integer\"]' " "ovsdb-types.at:92" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '["integer"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"integer\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:92" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_892 -#AT_START_893 -at_fn_group_banner 893 'ovsdb-types.at:94' \ - "simple real - C" " " 52 -at_xfail=no -( - $as_echo "893. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:94: test-ovsdb parse-type '[\"real\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:94" -( $at_check_trace; test-ovsdb parse-type '["real"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"real\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_893 -#AT_START_894 -at_fn_group_banner 894 'ovsdb-types.at:94' \ - "simple real - Python" " " 52 -at_xfail=no -( - $as_echo "894. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:94" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:94" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:94: \$PYTHON \$srcdir/test-ovsdb.py parse-type '[\"real\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '[\"real\"]' " "ovsdb-types.at:94" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '["real"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"real\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_894 -#AT_START_895 -at_fn_group_banner 895 'ovsdb-types.at:96' \ - "simple boolean - C" " " 52 -at_xfail=no -( - $as_echo "895. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:96: test-ovsdb parse-type '[\"boolean\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:96" -( $at_check_trace; test-ovsdb parse-type '["boolean"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"boolean\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_895 -#AT_START_896 -at_fn_group_banner 896 'ovsdb-types.at:96' \ - "simple boolean - Python" " " 52 -at_xfail=no -( - $as_echo "896. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:96" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:96" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:96: \$PYTHON \$srcdir/test-ovsdb.py parse-type '[\"boolean\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '[\"boolean\"]' " "ovsdb-types.at:96" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '["boolean"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"boolean\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:96" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_896 -#AT_START_897 -at_fn_group_banner 897 'ovsdb-types.at:98' \ - "simple string - C" " " 52 -at_xfail=no -( - $as_echo "897. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:98: test-ovsdb parse-type '[\"string\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:98" -( $at_check_trace; test-ovsdb parse-type '["string"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"string\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:98" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_897 -#AT_START_898 -at_fn_group_banner 898 'ovsdb-types.at:98' \ - "simple string - Python" " " 52 -at_xfail=no -( - $as_echo "898. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:98" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:98" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:98: \$PYTHON \$srcdir/test-ovsdb.py parse-type '[\"string\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '[\"string\"]' " "ovsdb-types.at:98" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '["string"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"string\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:98" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_898 -#AT_START_899 -at_fn_group_banner 899 'ovsdb-types.at:100' \ - "simple uuid - C" " " 52 -at_xfail=no -( - $as_echo "899. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:100: test-ovsdb parse-type '[\"uuid\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:100" -( $at_check_trace; test-ovsdb parse-type '["uuid"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"uuid\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:100" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_899 -#AT_START_900 -at_fn_group_banner 900 'ovsdb-types.at:100' \ - "simple uuid - Python" " " 52 -at_xfail=no -( - $as_echo "900. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:100" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:100" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:100: \$PYTHON \$srcdir/test-ovsdb.py parse-type '[\"uuid\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '[\"uuid\"]' " "ovsdb-types.at:100" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '["uuid"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"uuid\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:100" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_900 -#AT_START_901 -at_fn_group_banner 901 'ovsdb-types.at:102' \ - "integer in object - C" " " 52 -at_xfail=no -( - $as_echo "901. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:102: test-ovsdb parse-type '{\"key\": \"integer\"}' " -at_fn_check_prepare_trace "ovsdb-types.at:102" -( $at_check_trace; test-ovsdb parse-type '{"key": "integer"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"integer\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_901 -#AT_START_902 -at_fn_group_banner 902 'ovsdb-types.at:102' \ - "integer in object - Python" " " 52 -at_xfail=no -( - $as_echo "902. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:102" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:102" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:102: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"integer\"}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"integer\"}' " "ovsdb-types.at:102" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "integer"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"integer\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_902 -#AT_START_903 -at_fn_group_banner 903 'ovsdb-types.at:104' \ - "real in object with explicit min and max - C" " " 52 -at_xfail=no -( - $as_echo "903. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:104: test-ovsdb parse-type '{\"key\": \"real\", \"min\": 1, \"max\": 1}' " -at_fn_check_prepare_trace "ovsdb-types.at:104" -( $at_check_trace; test-ovsdb parse-type '{"key": "real", "min": 1, "max": 1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"real\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:104" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_903 -#AT_START_904 -at_fn_group_banner 904 'ovsdb-types.at:104' \ - "real in object with explicit min and max - Python" "" 52 -at_xfail=no -( - $as_echo "904. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:104" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:104" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:104: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 1, \"max\": 1}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 1, \"max\": 1}' " "ovsdb-types.at:104" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "real", "min": 1, "max": 1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"real\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:104" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_904 -#AT_START_905 -at_fn_group_banner 905 'ovsdb-types.at:107' \ - "key type is required - C" " " 52 -at_xfail=no -( - $as_echo "905. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:107: test-ovsdb parse-type '{}' " -at_fn_check_prepare_trace "ovsdb-types.at:107" -( $at_check_trace; test-ovsdb parse-type '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:107: if grep -F -e \"Required 'key' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:107" -( $at_check_trace; if grep -F -e "Required 'key' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_905 -#AT_START_906 -at_fn_group_banner 906 'ovsdb-types.at:107' \ - "key type is required - Python" " " 52 -at_xfail=no -( - $as_echo "906. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:107" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:107" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:107: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{}' " "ovsdb-types.at:107" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:107: if grep -F -e \"Required 'key' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:107" -( $at_check_trace; if grep -F -e "Required 'key' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_906 -#AT_START_907 -at_fn_group_banner 907 'ovsdb-types.at:109' \ - "void is not a valid type - C" " " 52 -at_xfail=no -( - $as_echo "907. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:109: test-ovsdb parse-type '[\"void\"]' " -at_fn_check_prepare_trace "ovsdb-types.at:109" -( $at_check_trace; test-ovsdb parse-type '["void"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:109: if grep -F -e \"\\\"void\\\" is not an atomic-type\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:109" -( $at_check_trace; if grep -F -e "\"void\" is not an atomic-type" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_907 -#AT_START_908 -at_fn_group_banner 908 'ovsdb-types.at:109' \ - "void is not a valid type - Python" " " 52 -at_xfail=no -( - $as_echo "908. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:109" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:109" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:109: \$PYTHON \$srcdir/test-ovsdb.py parse-type '[\"void\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '[\"void\"]' " "ovsdb-types.at:109" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '["void"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:109: if grep -F -e \"\\\"void\\\" is not an atomic-type\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:109" -( $at_check_trace; if grep -F -e "\"void\" is not an atomic-type" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_908 -#AT_START_909 -at_fn_group_banner 909 'ovsdb-types.at:114' \ - "optional boolean - C" " " 53 -at_xfail=no -( - $as_echo "909. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:114: test-ovsdb parse-type '{\"key\": \"boolean\", \"min\": 0}' " -at_fn_check_prepare_trace "ovsdb-types.at:114" -( $at_check_trace; test-ovsdb parse-type '{"key": "boolean", "min": 0}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"boolean\",\"min\":0} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_909 -#AT_START_910 -at_fn_group_banner 910 'ovsdb-types.at:114' \ - "optional boolean - Python" " " 53 -at_xfail=no -( - $as_echo "910. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:114" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:114" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:114: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"boolean\", \"min\": 0}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"boolean\", \"min\": 0}' " "ovsdb-types.at:114" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "boolean", "min": 0}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"boolean\",\"min\":0} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_910 -#AT_START_911 -at_fn_group_banner 911 'ovsdb-types.at:118' \ - "set of 1 to 3 uuids - C" " " 53 -at_xfail=no -( - $as_echo "911. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:118: test-ovsdb parse-type '{\"key\": \"uuid\", \"min\": 1, \"max\": 3}' " -at_fn_check_prepare_trace "ovsdb-types.at:118" -( $at_check_trace; test-ovsdb parse-type '{"key": "uuid", "min": 1, "max": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"uuid\",\"max\":3} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:118" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_911 -#AT_START_912 -at_fn_group_banner 912 'ovsdb-types.at:118' \ - "set of 1 to 3 uuids - Python" " " 53 -at_xfail=no -( - $as_echo "912. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:118" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:118" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:118: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"uuid\", \"min\": 1, \"max\": 3}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"uuid\", \"min\": 1, \"max\": 3}' " "ovsdb-types.at:118" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "uuid", "min": 1, "max": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"uuid\",\"max\":3} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:118" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_912 -#AT_START_913 -at_fn_group_banner 913 'ovsdb-types.at:121' \ - "set of 0 to 3 strings - C" " " 53 -at_xfail=no -( - $as_echo "913. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:121: test-ovsdb parse-type '{\"key\": \"string\", \"min\": 0, \"max\": 3}' " -at_fn_check_prepare_trace "ovsdb-types.at:121" -( $at_check_trace; test-ovsdb parse-type '{"key": "string", "min": 0, "max": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"string\",\"max\":3,\"min\":0} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:121" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_913 -#AT_START_914 -at_fn_group_banner 914 'ovsdb-types.at:121' \ - "set of 0 to 3 strings - Python" " " 53 -at_xfail=no -( - $as_echo "914. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:121" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:121" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:121: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"string\", \"min\": 0, \"max\": 3}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"string\", \"min\": 0, \"max\": 3}' " "ovsdb-types.at:121" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "string", "min": 0, "max": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"string\",\"max\":3,\"min\":0} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:121" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_914 -#AT_START_915 -at_fn_group_banner 915 'ovsdb-types.at:124' \ - "set of 0 or more integers - C" " " 53 -at_xfail=no -( - $as_echo "915. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:124: test-ovsdb parse-type '{\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}'" -at_fn_check_prepare_trace "ovsdb-types.at:124" -( $at_check_trace; test-ovsdb parse-type '{"key": "integer", "min": 0, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"integer\",\"max\":\"unlimited\",\"min\":0} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:124" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_915 -#AT_START_916 -at_fn_group_banner 916 'ovsdb-types.at:124' \ - "set of 0 or more integers - Python" " " 53 -at_xfail=no -( - $as_echo "916. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:124" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:124" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:124: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}'" "ovsdb-types.at:124" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "integer", "min": 0, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"integer\",\"max\":\"unlimited\",\"min\":0} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:124" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_916 -#AT_START_917 -at_fn_group_banner 917 'ovsdb-types.at:127' \ - "set of 1 or more reals - C" " " 53 -at_xfail=no -( - $as_echo "917. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:127: test-ovsdb parse-type '{\"key\": \"real\", \"min\": 1, \"max\": \"unlimited\"}'" -at_fn_check_prepare_trace "ovsdb-types.at:127" -( $at_check_trace; test-ovsdb parse-type '{"key": "real", "min": 1, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"real\",\"max\":\"unlimited\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_917 -#AT_START_918 -at_fn_group_banner 918 'ovsdb-types.at:127' \ - "set of 1 or more reals - Python" " " 53 -at_xfail=no -( - $as_echo "918. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:127" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:127" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:127: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 1, \"max\": \"unlimited\"}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 1, \"max\": \"unlimited\"}'" "ovsdb-types.at:127" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "real", "min": 1, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"real\",\"max\":\"unlimited\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_918 -#AT_START_919 -at_fn_group_banner 919 'ovsdb-types.at:131' \ - "set max cannot be less than min - C" " " 53 -at_xfail=no -( - $as_echo "919. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:131: test-ovsdb parse-type '{\"key\": \"real\", \"min\": 5, \"max\": 3}' " -at_fn_check_prepare_trace "ovsdb-types.at:131" -( $at_check_trace; test-ovsdb parse-type '{"key": "real", "min": 5, "max": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:131" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:131: if grep -F -e \"ovsdb type fails constraint checks\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:131" -( $at_check_trace; if grep -F -e "ovsdb type fails constraint checks" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:131" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_919 -#AT_START_920 -at_fn_group_banner 920 'ovsdb-types.at:131' \ - "set max cannot be less than min - Python" " " 53 -at_xfail=no -( - $as_echo "920. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:131" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:131" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:131: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 5, \"max\": 3}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 5, \"max\": 3}' " "ovsdb-types.at:131" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "real", "min": 5, "max": 3}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:131" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:131: if grep -F -e \"ovsdb type fails constraint checks\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:131" -( $at_check_trace; if grep -F -e "ovsdb type fails constraint checks" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:131" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_920 -#AT_START_921 -at_fn_group_banner 921 'ovsdb-types.at:134' \ - "set max cannot be negative - C" " " 53 -at_xfail=no -( - $as_echo "921. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:134: test-ovsdb parse-type '{\"key\": \"real\", \"max\": -1}' " -at_fn_check_prepare_trace "ovsdb-types.at:134" -( $at_check_trace; test-ovsdb parse-type '{"key": "real", "max": -1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:134" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:134: if grep -F -e \"bad min or max value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:134" -( $at_check_trace; if grep -F -e "bad min or max value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:134" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_921 -#AT_START_922 -at_fn_group_banner 922 'ovsdb-types.at:134' \ - "set max cannot be negative - Python" " " 53 -at_xfail=no -( - $as_echo "922. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:134" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:134" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:134: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"max\": -1}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"max\": -1}' " "ovsdb-types.at:134" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "real", "max": -1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:134" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:134: if grep -F -e \"bad min or max value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:134" -( $at_check_trace; if grep -F -e "bad min or max value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:134" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_922 -#AT_START_923 -at_fn_group_banner 923 'ovsdb-types.at:137' \ - "set min cannot be negative - C" " " 53 -at_xfail=no -( - $as_echo "923. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:137: test-ovsdb parse-type '{\"key\": \"real\", \"min\": -1}' " -at_fn_check_prepare_trace "ovsdb-types.at:137" -( $at_check_trace; test-ovsdb parse-type '{"key": "real", "min": -1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:137" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:137: if grep -F -e \"bad min or max value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:137" -( $at_check_trace; if grep -F -e "bad min or max value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:137" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_923 -#AT_START_924 -at_fn_group_banner 924 'ovsdb-types.at:137' \ - "set min cannot be negative - Python" " " 53 -at_xfail=no -( - $as_echo "924. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:137" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:137" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:137: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": -1}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": -1}' " "ovsdb-types.at:137" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "real", "min": -1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:137" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:137: if grep -F -e \"bad min or max value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:137" -( $at_check_trace; if grep -F -e "bad min or max value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:137" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_924 -#AT_START_925 -at_fn_group_banner 925 'ovsdb-types.at:140' \ - "set min cannot be greater than one - C" " " 53 -at_xfail=no -( - $as_echo "925. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:140: test-ovsdb parse-type '{\"key\": \"real\", \"min\": 10, \"max\": \"unlimited\"}'" -at_fn_check_prepare_trace "ovsdb-types.at:140" -( $at_check_trace; test-ovsdb parse-type '{"key": "real", "min": 10, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:140: if grep -F -e \"ovsdb type fails constraint checks\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:140" -( $at_check_trace; if grep -F -e "ovsdb type fails constraint checks" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_925 -#AT_START_926 -at_fn_group_banner 926 'ovsdb-types.at:140' \ - "set min cannot be greater than one - Python" " " 53 -at_xfail=no -( - $as_echo "926. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:140" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:140" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:140: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 10, \"max\": \"unlimited\"}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"min\": 10, \"max\": \"unlimited\"}'" "ovsdb-types.at:140" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "real", "min": 10, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:140: if grep -F -e \"ovsdb type fails constraint checks\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:140" -( $at_check_trace; if grep -F -e "ovsdb type fails constraint checks" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_926 -#AT_START_927 -at_fn_group_banner 927 'ovsdb-types.at:146' \ - "map of 1 integer to boolean - C" " " 54 -at_xfail=no -( - $as_echo "927. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:146: test-ovsdb parse-type '{\"key\": \"integer\", \"value\": \"boolean\"}' " -at_fn_check_prepare_trace "ovsdb-types.at:146" -( $at_check_trace; test-ovsdb parse-type '{"key": "integer", "value": "boolean"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"integer\",\"value\":\"boolean\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_927 -#AT_START_928 -at_fn_group_banner 928 'ovsdb-types.at:146' \ - "map of 1 integer to boolean - Python" " " 54 -at_xfail=no -( - $as_echo "928. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:146" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:146" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:146: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"integer\", \"value\": \"boolean\"}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"integer\", \"value\": \"boolean\"}' " "ovsdb-types.at:146" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "integer", "value": "boolean"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"integer\",\"value\":\"boolean\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_928 -#AT_START_929 -at_fn_group_banner 929 'ovsdb-types.at:149' \ - "map of 1 boolean to integer, explicit min and max - C" "" 54 -at_xfail=no -( - $as_echo "929. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:149: test-ovsdb parse-type '{\"key\": \"boolean\", \"value\": \"integer\", \"min\": 1, \"max\": 1}' " -at_fn_check_prepare_trace "ovsdb-types.at:149" -( $at_check_trace; test-ovsdb parse-type '{"key": "boolean", "value": "integer", "min": 1, "max": 1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"boolean\",\"value\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:149" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_929 -#AT_START_930 -at_fn_group_banner 930 'ovsdb-types.at:149' \ - "map of 1 boolean to integer, explicit min and max - Python" "" 54 -at_xfail=no -( - $as_echo "930. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:149" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:149" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:149: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"boolean\", \"value\": \"integer\", \"min\": 1, \"max\": 1}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"boolean\", \"value\": \"integer\", \"min\": 1, \"max\": 1}' " "ovsdb-types.at:149" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "boolean", "value": "integer", "min": 1, "max": 1}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"boolean\",\"value\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:149" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_930 -#AT_START_931 -at_fn_group_banner 931 'ovsdb-types.at:152' \ - "map of 1 to 5 uuid to real - C" " " 54 -at_xfail=no -( - $as_echo "931. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:152: test-ovsdb parse-type '{\"key\": \"uuid\", \"value\": \"real\", \"min\": 1, \"max\": 5}' " -at_fn_check_prepare_trace "ovsdb-types.at:152" -( $at_check_trace; test-ovsdb parse-type '{"key": "uuid", "value": "real", "min": 1, "max": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"uuid\",\"max\":5,\"value\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:152" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_931 -#AT_START_932 -at_fn_group_banner 932 'ovsdb-types.at:152' \ - "map of 1 to 5 uuid to real - Python" " " 54 -at_xfail=no -( - $as_echo "932. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:152" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:152" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:152: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"uuid\", \"value\": \"real\", \"min\": 1, \"max\": 5}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"uuid\", \"value\": \"real\", \"min\": 1, \"max\": 5}' " "ovsdb-types.at:152" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "uuid", "value": "real", "min": 1, "max": 5}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"uuid\",\"max\":5,\"value\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:152" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_932 -#AT_START_933 -at_fn_group_banner 933 'ovsdb-types.at:155' \ - "map of 0 to 10 string to uuid - C" " " 54 -at_xfail=no -( - $as_echo "933. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:155: test-ovsdb parse-type '{\"key\": \"string\", \"value\": \"uuid\", \"min\": 0, \"max\": 10}' " -at_fn_check_prepare_trace "ovsdb-types.at:155" -( $at_check_trace; test-ovsdb parse-type '{"key": "string", "value": "uuid", "min": 0, "max": 10}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"string\",\"max\":10,\"min\":0,\"value\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:155" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_933 -#AT_START_934 -at_fn_group_banner 934 'ovsdb-types.at:155' \ - "map of 0 to 10 string to uuid - Python" " " 54 -at_xfail=no -( - $as_echo "934. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:155" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:155" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:155: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"string\", \"value\": \"uuid\", \"min\": 0, \"max\": 10}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"string\", \"value\": \"uuid\", \"min\": 0, \"max\": 10}' " "ovsdb-types.at:155" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "string", "value": "uuid", "min": 0, "max": 10}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"string\",\"max\":10,\"min\":0,\"value\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:155" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_934 -#AT_START_935 -at_fn_group_banner 935 'ovsdb-types.at:158' \ - "map of 1 to 20 real to string - C" " " 54 -at_xfail=no -( - $as_echo "935. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:158: test-ovsdb parse-type '{\"key\": \"real\", \"value\": \"string\", \"min\": 1, \"max\": 20}' " -at_fn_check_prepare_trace "ovsdb-types.at:158" -( $at_check_trace; test-ovsdb parse-type '{"key": "real", "value": "string", "min": 1, "max": 20}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"real\",\"max\":20,\"value\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:158" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_935 -#AT_START_936 -at_fn_group_banner 936 'ovsdb-types.at:158' \ - "map of 1 to 20 real to string - Python" " " 54 -at_xfail=no -( - $as_echo "936. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:158" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:158" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:158: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"value\": \"string\", \"min\": 1, \"max\": 20}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"real\", \"value\": \"string\", \"min\": 1, \"max\": 20}' " "ovsdb-types.at:158" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "real", "value": "string", "min": 1, "max": 20}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"real\",\"max\":20,\"value\":\"string\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:158" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_936 -#AT_START_937 -at_fn_group_banner 937 'ovsdb-types.at:161' \ - "map of 0 or more string to real - C" " " 54 -at_xfail=no -( - $as_echo "937. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:161: test-ovsdb parse-type '{\"key\": \"string\", \"value\": \"real\", \"min\": 0, \"max\": \"unlimited\"}' " -at_fn_check_prepare_trace "ovsdb-types.at:161" -( $at_check_trace; test-ovsdb parse-type '{"key": "string", "value": "real", "min": 0, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"string\",\"max\":\"unlimited\",\"min\":0,\"value\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:161" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_937 -#AT_START_938 -at_fn_group_banner 938 'ovsdb-types.at:161' \ - "map of 0 or more string to real - Python" " " 54 -at_xfail=no -( - $as_echo "938. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:161" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:161" - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:161: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"key\": \"string\", \"value\": \"real\", \"min\": 0, \"max\": \"unlimited\"}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"key\": \"string\", \"value\": \"real\", \"min\": 0, \"max\": \"unlimited\"}' " "ovsdb-types.at:161" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"key": "string", "value": "real", "min": 0, "max": "unlimited"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"key\":\"string\",\"max\":\"unlimited\",\"min\":0,\"value\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:161" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_938 -#AT_START_939 -at_fn_group_banner 939 'ovsdb-types.at:165' \ - "map key type is required - C" " " 54 -at_xfail=no -( - $as_echo "939. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:165: test-ovsdb parse-type '{\"value\": \"integer\"}' " -at_fn_check_prepare_trace "ovsdb-types.at:165" -( $at_check_trace; test-ovsdb parse-type '{"value": "integer"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:165: if grep -F -e \"Required 'key' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:165" -( $at_check_trace; if grep -F -e "Required 'key' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_939 -#AT_START_940 -at_fn_group_banner 940 'ovsdb-types.at:165' \ - "map key type is required - Python" " " 54 -at_xfail=no -( - $as_echo "940. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-types.at:165" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-types.at:165" - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:165: \$PYTHON \$srcdir/test-ovsdb.py parse-type '{\"value\": \"integer\"}' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-type '{\"value\": \"integer\"}' " "ovsdb-types.at:165" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-type '{"value": "integer"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-types.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-types.at:165: if grep -F -e \"Required 'key' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-types.at:165" -( $at_check_trace; if grep -F -e "Required 'key' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-types.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_940 -#AT_START_941 -at_fn_group_banner 941 'ovsdb-data.at:3' \ - "default atoms - C" " " 55 -at_xfail=no -( - $as_echo "941. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:3: test-ovsdb default-atoms" -at_fn_check_prepare_trace "ovsdb-data.at:3" -( $at_check_trace; test-ovsdb default-atoms -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "integer: OK -real: OK -boolean: OK -string: OK -uuid: OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_941 -#AT_START_942 -at_fn_group_banner 942 'ovsdb-data.at:3' \ - "default atoms - Python" " " 55 -at_xfail=no -( - $as_echo "942. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:3" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:3" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:3: \$PYTHON \$srcdir/test-ovsdb.py default-atoms" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py default-atoms" "ovsdb-data.at:3" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py default-atoms -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "integer: OK -real: OK -boolean: OK -string: OK -uuid: OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_942 -#AT_START_943 -at_fn_group_banner 943 'ovsdb-data.at:11' \ - "default data - C" " " 55 -at_xfail=no -( - $as_echo "943. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:11: test-ovsdb default-data" -at_fn_check_prepare_trace "ovsdb-data.at:11" -( $at_check_trace; test-ovsdb default-data -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "key integer, value void, n_min 0: OK -key integer, value integer, n_min 0: OK -key integer, value real, n_min 0: OK -key integer, value boolean, n_min 0: OK -key integer, value string, n_min 0: OK -key integer, value uuid, n_min 0: OK -key real, value void, n_min 0: OK -key real, value integer, n_min 0: OK -key real, value real, n_min 0: OK -key real, value boolean, n_min 0: OK -key real, value string, n_min 0: OK -key real, value uuid, n_min 0: OK -key boolean, value void, n_min 0: OK -key boolean, value integer, n_min 0: OK -key boolean, value real, n_min 0: OK -key boolean, value boolean, n_min 0: OK -key boolean, value string, n_min 0: OK -key boolean, value uuid, n_min 0: OK -key string, value void, n_min 0: OK -key string, value integer, n_min 0: OK -key string, value real, n_min 0: OK -key string, value boolean, n_min 0: OK -key string, value string, n_min 0: OK -key string, value uuid, n_min 0: OK -key uuid, value void, n_min 0: OK -key uuid, value integer, n_min 0: OK -key uuid, value real, n_min 0: OK -key uuid, value boolean, n_min 0: OK -key uuid, value string, n_min 0: OK -key uuid, value uuid, n_min 0: OK -key integer, value void, n_min 1: OK -key integer, value integer, n_min 1: OK -key integer, value real, n_min 1: OK -key integer, value boolean, n_min 1: OK -key integer, value string, n_min 1: OK -key integer, value uuid, n_min 1: OK -key real, value void, n_min 1: OK -key real, value integer, n_min 1: OK -key real, value real, n_min 1: OK -key real, value boolean, n_min 1: OK -key real, value string, n_min 1: OK -key real, value uuid, n_min 1: OK -key boolean, value void, n_min 1: OK -key boolean, value integer, n_min 1: OK -key boolean, value real, n_min 1: OK -key boolean, value boolean, n_min 1: OK -key boolean, value string, n_min 1: OK -key boolean, value uuid, n_min 1: OK -key string, value void, n_min 1: OK -key string, value integer, n_min 1: OK -key string, value real, n_min 1: OK -key string, value boolean, n_min 1: OK -key string, value string, n_min 1: OK -key string, value uuid, n_min 1: OK -key uuid, value void, n_min 1: OK -key uuid, value integer, n_min 1: OK -key uuid, value real, n_min 1: OK -key uuid, value boolean, n_min 1: OK -key uuid, value string, n_min 1: OK -key uuid, value uuid, n_min 1: OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_943 -#AT_START_944 -at_fn_group_banner 944 'ovsdb-data.at:11' \ - "default data - Python" " " 55 -at_xfail=no -( - $as_echo "944. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:11" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:11" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:11: \$PYTHON \$srcdir/test-ovsdb.py default-data" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py default-data" "ovsdb-data.at:11" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py default-data -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "key integer, value void, n_min 0: OK -key integer, value integer, n_min 0: OK -key integer, value real, n_min 0: OK -key integer, value boolean, n_min 0: OK -key integer, value string, n_min 0: OK -key integer, value uuid, n_min 0: OK -key real, value void, n_min 0: OK -key real, value integer, n_min 0: OK -key real, value real, n_min 0: OK -key real, value boolean, n_min 0: OK -key real, value string, n_min 0: OK -key real, value uuid, n_min 0: OK -key boolean, value void, n_min 0: OK -key boolean, value integer, n_min 0: OK -key boolean, value real, n_min 0: OK -key boolean, value boolean, n_min 0: OK -key boolean, value string, n_min 0: OK -key boolean, value uuid, n_min 0: OK -key string, value void, n_min 0: OK -key string, value integer, n_min 0: OK -key string, value real, n_min 0: OK -key string, value boolean, n_min 0: OK -key string, value string, n_min 0: OK -key string, value uuid, n_min 0: OK -key uuid, value void, n_min 0: OK -key uuid, value integer, n_min 0: OK -key uuid, value real, n_min 0: OK -key uuid, value boolean, n_min 0: OK -key uuid, value string, n_min 0: OK -key uuid, value uuid, n_min 0: OK -key integer, value void, n_min 1: OK -key integer, value integer, n_min 1: OK -key integer, value real, n_min 1: OK -key integer, value boolean, n_min 1: OK -key integer, value string, n_min 1: OK -key integer, value uuid, n_min 1: OK -key real, value void, n_min 1: OK -key real, value integer, n_min 1: OK -key real, value real, n_min 1: OK -key real, value boolean, n_min 1: OK -key real, value string, n_min 1: OK -key real, value uuid, n_min 1: OK -key boolean, value void, n_min 1: OK -key boolean, value integer, n_min 1: OK -key boolean, value real, n_min 1: OK -key boolean, value boolean, n_min 1: OK -key boolean, value string, n_min 1: OK -key boolean, value uuid, n_min 1: OK -key string, value void, n_min 1: OK -key string, value integer, n_min 1: OK -key string, value real, n_min 1: OK -key string, value boolean, n_min 1: OK -key string, value string, n_min 1: OK -key string, value uuid, n_min 1: OK -key uuid, value void, n_min 1: OK -key uuid, value integer, n_min 1: OK -key uuid, value real, n_min 1: OK -key uuid, value boolean, n_min 1: OK -key uuid, value string, n_min 1: OK -key uuid, value uuid, n_min 1: OK -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_944 -#AT_START_945 -at_fn_group_banner 945 'ovsdb-data.at:76' \ - "integer atom from JSON - C" " " 56 -at_xfail=no -( - $as_echo "945. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:76: test-ovsdb parse-atoms '[\"integer\"]' \\ - '[0]' \\ - '[-1]' \\ - '[1e3]' \\ - '[9223372036854775807]' \\ - '[-9223372036854775808]' " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:76" -( $at_check_trace; test-ovsdb parse-atoms '["integer"]' \ - '[0]' \ - '[-1]' \ - '[1e3]' \ - '[9223372036854775807]' \ - '[-9223372036854775808]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 --1 -1000 -9223372036854775807 --9223372036854775808 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:76" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_945 -#AT_START_946 -at_fn_group_banner 946 'ovsdb-data.at:76' \ - "integer atom from JSON - Python" " " 56 -at_xfail=no -( - $as_echo "946. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:76" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:76" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:76: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"integer\"]' \\ - '[0]' \\ - '[-1]' \\ - '[1e3]' \\ - '[9223372036854775807]' \\ - '[-9223372036854775808]' " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:76" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["integer"]' \ - '[0]' \ - '[-1]' \ - '[1e3]' \ - '[9223372036854775807]' \ - '[-9223372036854775808]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 --1 -1000 -9223372036854775807 --9223372036854775808 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:76" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_946 -#AT_START_947 -at_fn_group_banner 947 'ovsdb-data.at:89' \ - "integer atom from string" " " 56 -at_xfail=no -( - $as_echo "947. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:89: test-ovsdb parse-atom-strings -- '[\"integer\"]' \\ - '0' \\ - '-1' \\ - '+1000' \\ - '9223372036854775807' \\ - '-9223372036854775808' " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:89" -( $at_check_trace; test-ovsdb parse-atom-strings -- '["integer"]' \ - '0' \ - '-1' \ - '+1000' \ - '9223372036854775807' \ - '-9223372036854775808' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 --1 -1000 -9223372036854775807 --9223372036854775808 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:89" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_947 -#AT_START_948 -at_fn_group_banner 948 'ovsdb-data.at:102' \ - "real atom from JSON - C" " " 56 -at_xfail=no -( - $as_echo "948. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:102: test-ovsdb parse-atoms '[\"real\"]' \\ - '[0]' \\ - '[0.0]' \\ - '[-0.0]' \\ - '[-1.25]' \\ - '[1e3]' \\ - '[1e37]' \\ - '[0.00390625]' " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:102" -( $at_check_trace; test-ovsdb parse-atoms '["real"]' \ - '[0]' \ - '[0.0]' \ - '[-0.0]' \ - '[-1.25]' \ - '[1e3]' \ - '[1e37]' \ - '[0.00390625]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -0 -0 --1.25 -1000 -1e+37 -0.00390625 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_948 -#AT_START_949 -at_fn_group_banner 949 'ovsdb-data.at:102' \ - "real atom from JSON - Python" " " 56 -at_xfail=no -( - $as_echo "949. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:102" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:102" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:102: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"real\"]' \\ - '[0]' \\ - '[0.0]' \\ - '[-0.0]' \\ - '[-1.25]' \\ - '[1e3]' \\ - '[1e37]' \\ - '[0.00390625]' " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:102" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["real"]' \ - '[0]' \ - '[0.0]' \ - '[-0.0]' \ - '[-1.25]' \ - '[1e3]' \ - '[1e37]' \ - '[0.00390625]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -0 -0 --1.25 -1000 -1e+37 -0.00390625 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_949 -#AT_START_950 -at_fn_group_banner 950 'ovsdb-data.at:119' \ - "real atom from string" " " 56 -at_xfail=no -( - $as_echo "950. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:119: test-ovsdb parse-atom-strings -- '[\"real\"]' \\ - '0' \\ - '0.0' \\ - '-0.0' \\ - '-1.25' \\ - '1e3' \\ - '1e37' \\ - '0.00390625' " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:119" -( $at_check_trace; test-ovsdb parse-atom-strings -- '["real"]' \ - '0' \ - '0.0' \ - '-0.0' \ - '-1.25' \ - '1e3' \ - '1e37' \ - '0.00390625' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -0 -0 --1.25 -1000 -1e+37 -0.00390625 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:119" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_950 -#AT_START_951 -at_fn_group_banner 951 'ovsdb-data.at:136' \ - "boolean atom from JSON - C" " " 56 -at_xfail=no -( - $as_echo "951. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:136: test-ovsdb parse-atoms '[\"boolean\"]' '[true]' '[false]' " -at_fn_check_prepare_trace "ovsdb-data.at:136" -( $at_check_trace; test-ovsdb parse-atoms '["boolean"]' '[true]' '[false]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_951 -#AT_START_952 -at_fn_group_banner 952 'ovsdb-data.at:136' \ - "boolean atom from JSON - Python" " " 56 -at_xfail=no -( - $as_echo "952. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:136" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:136" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:136: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"boolean\"]' '[true]' '[false]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"boolean\"]' '[true]' '[false]' " "ovsdb-data.at:136" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["boolean"]' '[true]' '[false]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_952 -#AT_START_953 -at_fn_group_banner 953 'ovsdb-data.at:141' \ - "boolean atom from string" " " 56 -at_xfail=no -( - $as_echo "953. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:141: test-ovsdb parse-atom-strings '[\"boolean\"]' 'true' 'false' " -at_fn_check_prepare_trace "ovsdb-data.at:141" -( $at_check_trace; test-ovsdb parse-atom-strings '["boolean"]' 'true' 'false' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:141" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_953 -#AT_START_954 -at_fn_group_banner 954 'ovsdb-data.at:146' \ - "string atom from JSON - C" " " 56 -at_xfail=no -( - $as_echo "954. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:146: test-ovsdb parse-atoms '[\"string\"]' '[\"\"]' '[\"true\"]' '[\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"]'" -at_fn_check_prepare_trace "ovsdb-data.at:146" -( $at_check_trace; test-ovsdb parse-atoms '["string"]' '[""]' '["true"]' '["\"\\\/\b\f\n\r\t"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"\" -\"true\" -\"\\\"\\\\/\\b\\f\\n\\r\\t\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_954 -#AT_START_955 -at_fn_group_banner 955 'ovsdb-data.at:146' \ - "string atom from JSON - Python" " " 56 -at_xfail=no -( - $as_echo "955. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:146" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:146" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:146: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"string\"]' '[\"\"]' '[\"true\"]' '[\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"string\"]' '[\"\"]' '[\"true\"]' '[\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"]'" "ovsdb-data.at:146" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["string"]' '[""]' '["true"]' '["\"\\\/\b\f\n\r\t"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"\" -\"true\" -\"\\\"\\\\/\\b\\f\\n\\r\\t\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_955 -#AT_START_956 -at_fn_group_banner 956 'ovsdb-data.at:152' \ - "string atom from string" " " 56 -at_xfail=no -( - $as_echo "956. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:152: test-ovsdb parse-atom-strings '[\"string\"]' \\ - 'unquoted' \\ - '\"quoted-string\"' \\ - '\"needs quotes\"' \\ - '\"\"' \\ - '\"true\"' \\ - '\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:152" -( $at_check_trace; test-ovsdb parse-atom-strings '["string"]' \ - 'unquoted' \ - '"quoted-string"' \ - '"needs quotes"' \ - '""' \ - '"true"' \ - '"\"\\\/\b\f\n\r\t"' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "unquoted -quoted-string -\"needs quotes\" -\"\" -\"true\" -\"\\\"\\\\/\\b\\f\\n\\r\\t\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:152" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_956 -#AT_START_957 -at_fn_group_banner 957 'ovsdb-data.at:167' \ - "uuid atom from JSON - C" " " 56 -at_xfail=no -( - $as_echo "957. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:167: test-ovsdb parse-atoms '[\"uuid\"]' '[\"uuid\", \"550e8400-e29b-41d4-a716-446655440000\"]'" -at_fn_check_prepare_trace "ovsdb-data.at:167" -( $at_check_trace; test-ovsdb parse-atoms '["uuid"]' '["uuid", "550e8400-e29b-41d4-a716-446655440000"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"uuid\",\"550e8400-e29b-41d4-a716-446655440000\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:167" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_957 -#AT_START_958 -at_fn_group_banner 958 'ovsdb-data.at:167' \ - "uuid atom from JSON - Python" " " 56 -at_xfail=no -( - $as_echo "958. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:167" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:167" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:167: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"uuid\"]' '[\"uuid\", \"550e8400-e29b-41d4-a716-446655440000\"]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"uuid\"]' '[\"uuid\", \"550e8400-e29b-41d4-a716-446655440000\"]'" "ovsdb-data.at:167" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["uuid"]' '["uuid", "550e8400-e29b-41d4-a716-446655440000"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"uuid\",\"550e8400-e29b-41d4-a716-446655440000\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:167" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_958 -#AT_START_959 -at_fn_group_banner 959 'ovsdb-data.at:171' \ - "uuid atom from string" " " 56 -at_xfail=no -( - $as_echo "959. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:171: test-ovsdb parse-atom-strings '[\"uuid\"]' '550e8400-e29b-41d4-a716-446655440000'" -at_fn_check_prepare_trace "ovsdb-data.at:171" -( $at_check_trace; test-ovsdb parse-atom-strings '["uuid"]' '550e8400-e29b-41d4-a716-446655440000' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "550e8400-e29b-41d4-a716-446655440000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:171" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_959 -#AT_START_960 -at_fn_group_banner 960 'ovsdb-data.at:175' \ - "integer atom sorting - C" " " 56 -at_xfail=no -( - $as_echo "960. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:175: test-ovsdb sort-atoms '[\"integer\"]' '[55,0,-1,2,1]'" -at_fn_check_prepare_trace "ovsdb-data.at:175" -( $at_check_trace; test-ovsdb sort-atoms '["integer"]' '[55,0,-1,2,1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[-1,0,1,2,55] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:175" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_960 -#AT_START_961 -at_fn_group_banner 961 'ovsdb-data.at:175' \ - "integer atom sorting - Python" " " 56 -at_xfail=no -( - $as_echo "961. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:175" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:175" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:175: \$PYTHON \$srcdir/test-ovsdb.py sort-atoms '[\"integer\"]' '[55,0,-1,2,1]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py sort-atoms '[\"integer\"]' '[55,0,-1,2,1]'" "ovsdb-data.at:175" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py sort-atoms '["integer"]' '[55,0,-1,2,1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[-1,0,1,2,55] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:175" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_961 -#AT_START_962 -at_fn_group_banner 962 'ovsdb-data.at:179' \ - "real atom sorting - C" " " 56 -at_xfail=no -( - $as_echo "962. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:179: test-ovsdb sort-atoms '[\"real\"]' '[1.25,1.23,0.0,-0.0,-1e99]'" -at_fn_check_prepare_trace "ovsdb-data.at:179" -( $at_check_trace; test-ovsdb sort-atoms '["real"]' '[1.25,1.23,0.0,-0.0,-1e99]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[-1e+99,0,0,1.23,1.25] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:179" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_962 -#AT_START_963 -at_fn_group_banner 963 'ovsdb-data.at:179' \ - "real atom sorting - Python" " " 56 -at_xfail=no -( - $as_echo "963. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:179" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:179" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:179: \$PYTHON \$srcdir/test-ovsdb.py sort-atoms '[\"real\"]' '[1.25,1.23,0.0,-0.0,-1e99]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py sort-atoms '[\"real\"]' '[1.25,1.23,0.0,-0.0,-1e99]'" "ovsdb-data.at:179" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py sort-atoms '["real"]' '[1.25,1.23,0.0,-0.0,-1e99]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[-1e+99,0,0,1.23,1.25] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:179" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_963 -#AT_START_964 -at_fn_group_banner 964 'ovsdb-data.at:183' \ - "boolean atom sorting - C" " " 56 -at_xfail=no -( - $as_echo "964. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:183: test-ovsdb sort-atoms '[\"boolean\"]' '[true,false,true,false,false]'" -at_fn_check_prepare_trace "ovsdb-data.at:183" -( $at_check_trace; test-ovsdb sort-atoms '["boolean"]' '[true,false,true,false,false]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[false,false,false,true,true] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_964 -#AT_START_965 -at_fn_group_banner 965 'ovsdb-data.at:183' \ - "boolean atom sorting - Python" " " 56 -at_xfail=no -( - $as_echo "965. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:183" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:183" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:183: \$PYTHON \$srcdir/test-ovsdb.py sort-atoms '[\"boolean\"]' '[true,false,true,false,false]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py sort-atoms '[\"boolean\"]' '[true,false,true,false,false]'" "ovsdb-data.at:183" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py sort-atoms '["boolean"]' '[true,false,true,false,false]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[false,false,false,true,true] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_965 -#AT_START_966 -at_fn_group_banner 966 'ovsdb-data.at:187' \ - "string atom sorting - C" " " 56 -at_xfail=no -( - $as_echo "966. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:187: test-ovsdb sort-atoms '[\"string\"]' '[\"abd\",\"abc\",\"\\b\",\"xxx\"]'" -at_fn_check_prepare_trace "ovsdb-data.at:187" -( $at_check_trace; test-ovsdb sort-atoms '["string"]' '["abd","abc","\b","xxx"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"\\b\",\"abc\",\"abd\",\"xxx\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:187" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_966 -#AT_START_967 -at_fn_group_banner 967 'ovsdb-data.at:187' \ - "string atom sorting - Python" " " 56 -at_xfail=no -( - $as_echo "967. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:187" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:187" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:187: \$PYTHON \$srcdir/test-ovsdb.py sort-atoms '[\"string\"]' '[\"abd\",\"abc\",\"\\b\",\"xxx\"]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py sort-atoms '[\"string\"]' '[\"abd\",\"abc\",\"\\b\",\"xxx\"]'" "ovsdb-data.at:187" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py sort-atoms '["string"]' '["abd","abc","\b","xxx"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"\\b\",\"abc\",\"abd\",\"xxx\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:187" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_967 -#AT_START_968 -at_fn_group_banner 968 'ovsdb-data.at:191' \ - "uuid atom sorting - C" " " 56 -at_xfail=no -( - $as_echo "968. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:191: test-ovsdb sort-atoms '[\"uuid\"]' '[ - [\"uuid\", \"00000000-0000-0000-0000-000000000001\"], - [\"uuid\", \"00000000-1000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-1000-0000-000000000000\"], - [\"uuid\", \"00010000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000000100\"], - [\"uuid\", \"00000000-0000-0000-0000-000100000000\"], - [\"uuid\", \"00000000-0000-0010-0000-000000000000\"], - [\"uuid\", \"00000100-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0001-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000001000000\"], - [\"uuid\", \"01000000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000001000\"], - [\"uuid\", \"00000000-0000-0000-0000-000010000000\"], - [\"uuid\", \"00000000-0000-0000-0000-010000000000\"], - [\"uuid\", \"00000000-0000-0100-0000-000000000000\"], - [\"uuid\", \"10000000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000000010\"], - [\"uuid\", \"00000000-0100-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0100-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0001-000000000000\"], - [\"uuid\", \"00000010-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0010-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000010000\"], - [\"uuid\", \"00000000-0000-0000-1000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-100000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-001000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000100000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0010-0000-0000-000000000000\"], - [\"uuid\", \"00100000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0001-0000-0000-000000000000\"], - [\"uuid\", \"00000001-0000-0000-0000-000000000000\"], - [\"uuid\", \"00001000-0000-0000-0000-000000000000\"]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:191" -( $at_check_trace; test-ovsdb sort-atoms '["uuid"]' '[ - ["uuid", "00000000-0000-0000-0000-000000000001"], - ["uuid", "00000000-1000-0000-0000-000000000000"], - ["uuid", "00000000-0000-1000-0000-000000000000"], - ["uuid", "00010000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000000100"], - ["uuid", "00000000-0000-0000-0000-000100000000"], - ["uuid", "00000000-0000-0010-0000-000000000000"], - ["uuid", "00000100-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0001-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000001000000"], - ["uuid", "01000000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000001000"], - ["uuid", "00000000-0000-0000-0000-000010000000"], - ["uuid", "00000000-0000-0000-0000-010000000000"], - ["uuid", "00000000-0000-0100-0000-000000000000"], - ["uuid", "10000000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000000010"], - ["uuid", "00000000-0100-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0100-000000000000"], - ["uuid", "00000000-0000-0000-0001-000000000000"], - ["uuid", "00000010-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0010-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000010000"], - ["uuid", "00000000-0000-0000-1000-000000000000"], - ["uuid", "00000000-0000-0000-0000-100000000000"], - ["uuid", "00000000-0000-0000-0000-001000000000"], - ["uuid", "00000000-0000-0000-0000-000000100000"], - ["uuid", "00000000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0010-0000-0000-000000000000"], - ["uuid", "00100000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0001-0000-0000-000000000000"], - ["uuid", "00000001-0000-0000-0000-000000000000"], - ["uuid", "00001000-0000-0000-0000-000000000000"]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],[\"uuid\",\"00000000-0000-0000-0000-000000000001\"],[\"uuid\",\"00000000-0000-0000-0000-000000000010\"],[\"uuid\",\"00000000-0000-0000-0000-000000000100\"],[\"uuid\",\"00000000-0000-0000-0000-000000001000\"],[\"uuid\",\"00000000-0000-0000-0000-000000010000\"],[\"uuid\",\"00000000-0000-0000-0000-000000100000\"],[\"uuid\",\"00000000-0000-0000-0000-000001000000\"],[\"uuid\",\"00000000-0000-0000-0000-000010000000\"],[\"uuid\",\"00000000-0000-0000-0000-000100000000\"],[\"uuid\",\"00000000-0000-0000-0000-001000000000\"],[\"uuid\",\"00000000-0000-0000-0000-010000000000\"],[\"uuid\",\"00000000-0000-0000-0000-100000000000\"],[\"uuid\",\"00000000-0000-0000-0001-000000000000\"],[\"uuid\",\"00000000-0000-0000-0010-000000000000\"],[\"uuid\",\"00000000-0000-0000-0100-000000000000\"],[\"uuid\",\"00000000-0000-0000-1000-000000000000\"],[\"uuid\",\"00000000-0000-0001-0000-000000000000\"],[\"uuid\",\"00000000-0000-0010-0000-000000000000\"],[\"uuid\",\"00000000-0000-0100-0000-000000000000\"],[\"uuid\",\"00000000-0000-1000-0000-000000000000\"],[\"uuid\",\"00000000-0001-0000-0000-000000000000\"],[\"uuid\",\"00000000-0010-0000-0000-000000000000\"],[\"uuid\",\"00000000-0100-0000-0000-000000000000\"],[\"uuid\",\"00000000-1000-0000-0000-000000000000\"],[\"uuid\",\"00000001-0000-0000-0000-000000000000\"],[\"uuid\",\"00000010-0000-0000-0000-000000000000\"],[\"uuid\",\"00000100-0000-0000-0000-000000000000\"],[\"uuid\",\"00001000-0000-0000-0000-000000000000\"],[\"uuid\",\"00010000-0000-0000-0000-000000000000\"],[\"uuid\",\"00100000-0000-0000-0000-000000000000\"],[\"uuid\",\"01000000-0000-0000-0000-000000000000\"],[\"uuid\",\"10000000-0000-0000-0000-000000000000\"]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:191" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_968 -#AT_START_969 -at_fn_group_banner 969 'ovsdb-data.at:191' \ - "uuid atom sorting - Python" " " 56 -at_xfail=no -( - $as_echo "969. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:191" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:191" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:191: \$PYTHON \$srcdir/test-ovsdb.py sort-atoms '[\"uuid\"]' '[ - [\"uuid\", \"00000000-0000-0000-0000-000000000001\"], - [\"uuid\", \"00000000-1000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-1000-0000-000000000000\"], - [\"uuid\", \"00010000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000000100\"], - [\"uuid\", \"00000000-0000-0000-0000-000100000000\"], - [\"uuid\", \"00000000-0000-0010-0000-000000000000\"], - [\"uuid\", \"00000100-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0001-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000001000000\"], - [\"uuid\", \"01000000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000001000\"], - [\"uuid\", \"00000000-0000-0000-0000-000010000000\"], - [\"uuid\", \"00000000-0000-0000-0000-010000000000\"], - [\"uuid\", \"00000000-0000-0100-0000-000000000000\"], - [\"uuid\", \"10000000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000000010\"], - [\"uuid\", \"00000000-0100-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0100-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0001-000000000000\"], - [\"uuid\", \"00000010-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0010-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000010000\"], - [\"uuid\", \"00000000-0000-0000-1000-000000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-100000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-001000000000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000100000\"], - [\"uuid\", \"00000000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0010-0000-0000-000000000000\"], - [\"uuid\", \"00100000-0000-0000-0000-000000000000\"], - [\"uuid\", \"00000000-0001-0000-0000-000000000000\"], - [\"uuid\", \"00000001-0000-0000-0000-000000000000\"], - [\"uuid\", \"00001000-0000-0000-0000-000000000000\"]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:191" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py sort-atoms '["uuid"]' '[ - ["uuid", "00000000-0000-0000-0000-000000000001"], - ["uuid", "00000000-1000-0000-0000-000000000000"], - ["uuid", "00000000-0000-1000-0000-000000000000"], - ["uuid", "00010000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000000100"], - ["uuid", "00000000-0000-0000-0000-000100000000"], - ["uuid", "00000000-0000-0010-0000-000000000000"], - ["uuid", "00000100-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0001-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000001000000"], - ["uuid", "01000000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000001000"], - ["uuid", "00000000-0000-0000-0000-000010000000"], - ["uuid", "00000000-0000-0000-0000-010000000000"], - ["uuid", "00000000-0000-0100-0000-000000000000"], - ["uuid", "10000000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000000010"], - ["uuid", "00000000-0100-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0100-000000000000"], - ["uuid", "00000000-0000-0000-0001-000000000000"], - ["uuid", "00000010-0000-0000-0000-000000000000"], - ["uuid", "00000000-0000-0000-0010-000000000000"], - ["uuid", "00000000-0000-0000-0000-000000010000"], - ["uuid", "00000000-0000-0000-1000-000000000000"], - ["uuid", "00000000-0000-0000-0000-100000000000"], - ["uuid", "00000000-0000-0000-0000-001000000000"], - ["uuid", "00000000-0000-0000-0000-000000100000"], - ["uuid", "00000000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0010-0000-0000-000000000000"], - ["uuid", "00100000-0000-0000-0000-000000000000"], - ["uuid", "00000000-0001-0000-0000-000000000000"], - ["uuid", "00000001-0000-0000-0000-000000000000"], - ["uuid", "00001000-0000-0000-0000-000000000000"]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],[\"uuid\",\"00000000-0000-0000-0000-000000000001\"],[\"uuid\",\"00000000-0000-0000-0000-000000000010\"],[\"uuid\",\"00000000-0000-0000-0000-000000000100\"],[\"uuid\",\"00000000-0000-0000-0000-000000001000\"],[\"uuid\",\"00000000-0000-0000-0000-000000010000\"],[\"uuid\",\"00000000-0000-0000-0000-000000100000\"],[\"uuid\",\"00000000-0000-0000-0000-000001000000\"],[\"uuid\",\"00000000-0000-0000-0000-000010000000\"],[\"uuid\",\"00000000-0000-0000-0000-000100000000\"],[\"uuid\",\"00000000-0000-0000-0000-001000000000\"],[\"uuid\",\"00000000-0000-0000-0000-010000000000\"],[\"uuid\",\"00000000-0000-0000-0000-100000000000\"],[\"uuid\",\"00000000-0000-0000-0001-000000000000\"],[\"uuid\",\"00000000-0000-0000-0010-000000000000\"],[\"uuid\",\"00000000-0000-0000-0100-000000000000\"],[\"uuid\",\"00000000-0000-0000-1000-000000000000\"],[\"uuid\",\"00000000-0000-0001-0000-000000000000\"],[\"uuid\",\"00000000-0000-0010-0000-000000000000\"],[\"uuid\",\"00000000-0000-0100-0000-000000000000\"],[\"uuid\",\"00000000-0000-1000-0000-000000000000\"],[\"uuid\",\"00000000-0001-0000-0000-000000000000\"],[\"uuid\",\"00000000-0010-0000-0000-000000000000\"],[\"uuid\",\"00000000-0100-0000-0000-000000000000\"],[\"uuid\",\"00000000-1000-0000-0000-000000000000\"],[\"uuid\",\"00000001-0000-0000-0000-000000000000\"],[\"uuid\",\"00000010-0000-0000-0000-000000000000\"],[\"uuid\",\"00000100-0000-0000-0000-000000000000\"],[\"uuid\",\"00001000-0000-0000-0000-000000000000\"],[\"uuid\",\"00010000-0000-0000-0000-000000000000\"],[\"uuid\",\"00100000-0000-0000-0000-000000000000\"],[\"uuid\",\"01000000-0000-0000-0000-000000000000\"],[\"uuid\",\"10000000-0000-0000-0000-000000000000\"]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:191" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_969 -#AT_START_970 -at_fn_group_banner 970 'ovsdb-data.at:228' \ - "real not acceptable integer JSON atom - C" " " 56 -at_xfail=no -( - $as_echo "970. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:228: test-ovsdb parse-atoms '[\"integer\"]' '[0.5]' " -at_fn_check_prepare_trace "ovsdb-data.at:228" -( $at_check_trace; test-ovsdb parse-atoms '["integer"]' '[0.5]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"0.5\": syntax error: expected integer -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_970 -#AT_START_971 -at_fn_group_banner 971 'ovsdb-data.at:228' \ - "real not acceptable integer JSON atom - Python" " " 56 -at_xfail=no -( - $as_echo "971. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:228" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:228" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:228: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"integer\"]' '[0.5]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"integer\"]' '[0.5]' " "ovsdb-data.at:228" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["integer"]' '[0.5]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"0.5\": syntax error: expected integer -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_971 -#AT_START_972 -at_fn_group_banner 972 'ovsdb-data.at:234' \ - "no invalid UTF-8 sequences in strings" " " 56 -at_xfail=no -( - $as_echo "972. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:234: test-ovsdb parse-atoms '[\"string\"]' \\ - '[\"\"]' \\ - '[\"\"]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:234" -( $at_check_trace; test-ovsdb parse-atoms '["string"]' \ - '[""]' \ - '[""]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: not a valid UTF-8 string: invalid UTF-8 sequence 0xc0 -constraint violation: not a valid UTF-8 string: invalid UTF-8 sequence 0xed 0xa0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:234" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_972 -#AT_START_973 -at_fn_group_banner 973 'ovsdb-data.at:249' \ - "no invalid UTF-8 sequences in strings - Python" " " 56 -at_xfail=no -( - $as_echo "973. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:249" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:249" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:249: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"string\"]' \\ - '[\"\"]' \\ - '[\"\"]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:249" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["string"]' \ - '[""]' \ - '[""]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"not a valid UTF-8 string: invalid UTF-8 sequence 0xc0\" -\"not a valid UTF-8 string: invalid UTF-8 sequence 0xed 0x80\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:249" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_973 -#AT_START_974 -at_fn_group_banner 974 'ovsdb-data.at:257' \ - "real not acceptable integer string atom" " " 56 -at_xfail=no -( - $as_echo "974. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:257: test-ovsdb parse-atom-strings '[\"integer\"]' '0.5' " -at_fn_check_prepare_trace "ovsdb-data.at:257" -( $at_check_trace; test-ovsdb parse-atom-strings '["integer"]' '0.5' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:257: if grep -F -e \"\\\"0.5\\\" is not a valid integer\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:257" -( $at_check_trace; if grep -F -e "\"0.5\" is not a valid integer" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_974 -#AT_START_975 -at_fn_group_banner 975 'ovsdb-data.at:261' \ - "string \"true\" not acceptable boolean JSON atom - C" "" 56 -at_xfail=no -( - $as_echo "975. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:261: test-ovsdb parse-atoms '[\"boolean\"]' '[\"true\"]' " -at_fn_check_prepare_trace "ovsdb-data.at:261" -( $at_check_trace; test-ovsdb parse-atoms '["boolean"]' '["true"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"\"true\"\": syntax error: expected boolean -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:261" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_975 -#AT_START_976 -at_fn_group_banner 976 'ovsdb-data.at:261' \ - "string \"true\" not acceptable boolean JSON atom - Python" "" 56 -at_xfail=no -( - $as_echo "976. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:261" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:261" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:261: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"boolean\"]' '[\"true\"]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"boolean\"]' '[\"true\"]' " "ovsdb-data.at:261" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["boolean"]' '["true"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"\"true\"\": syntax error: expected boolean -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:261" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_976 -#AT_START_977 -at_fn_group_banner 977 'ovsdb-data.at:265' \ - "string \"true\" not acceptable boolean string atom" "" 56 -at_xfail=no -( - $as_echo "977. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:265: test-ovsdb parse-atom-strings '[\"boolean\"]' '\"true\"' " -at_fn_check_prepare_trace "ovsdb-data.at:265" -( $at_check_trace; test-ovsdb parse-atom-strings '["boolean"]' '"true"' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:265" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:265: if grep -F -e \"\\\"\\\"true\\\"\\\" is not a valid boolean (use \\\"true\\\" or \\\"false\\\")\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:265" -( $at_check_trace; if grep -F -e "\"\"true\"\" is not a valid boolean (use \"true\" or \"false\")" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:265" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_977 -#AT_START_978 -at_fn_group_banner 978 'ovsdb-data.at:269' \ - "integer not acceptable string JSON atom - C" " " 56 -at_xfail=no -( - $as_echo "978. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:269: test-ovsdb parse-atoms '[\"string\"]' '[1]'" -at_fn_check_prepare_trace "ovsdb-data.at:269" -( $at_check_trace; test-ovsdb parse-atoms '["string"]' '[1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"1\": syntax error: expected string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:269" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_978 -#AT_START_979 -at_fn_group_banner 979 'ovsdb-data.at:269' \ - "integer not acceptable string JSON atom - Python" "" 56 -at_xfail=no -( - $as_echo "979. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:269" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:269" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:269: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"string\"]' '[1]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"string\"]' '[1]'" "ovsdb-data.at:269" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["string"]' '[1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"1\": syntax error: expected string -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:269" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_979 -#AT_START_980 -at_fn_group_banner 980 'ovsdb-data.at:273' \ - "uuid atom must be expressed as JSON array - C" " " 56 -at_xfail=no -( - $as_echo "980. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:273: test-ovsdb parse-atoms '[\"uuid\"]' '[\"550e8400-e29b-41d4-a716-446655440000\"]'" -at_fn_check_prepare_trace "ovsdb-data.at:273" -( $at_check_trace; test-ovsdb parse-atoms '["uuid"]' '["550e8400-e29b-41d4-a716-446655440000"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"\"550e8400-e29b-41d4-a716-446655440000\"\": syntax error: expected [\"uuid\", ] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:273" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_980 -#AT_START_981 -at_fn_group_banner 981 'ovsdb-data.at:273' \ - "uuid atom must be expressed as JSON array - Python" "" 56 -at_xfail=no -( - $as_echo "981. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:273" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:273" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:273: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"uuid\"]' '[\"550e8400-e29b-41d4-a716-446655440000\"]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"uuid\"]' '[\"550e8400-e29b-41d4-a716-446655440000\"]'" "ovsdb-data.at:273" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["uuid"]' '["550e8400-e29b-41d4-a716-446655440000"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"\"550e8400-e29b-41d4-a716-446655440000\"\": syntax error: expected [\"uuid\", ] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:273" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_981 -#AT_START_982 -at_fn_group_banner 982 'ovsdb-data.at:277' \ - "named-uuid requires symbol table - C" " " 56 -at_xfail=no -( - $as_echo "982. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:277: test-ovsdb parse-atoms '[\"uuid\"]' '[\"named-uuid\", \"x\"]'" -at_fn_check_prepare_trace "ovsdb-data.at:277" -( $at_check_trace; test-ovsdb parse-atoms '["uuid"]' '["named-uuid", "x"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"[\"named-uuid\",\"x\"]\": syntax error: expected [\"uuid\", ] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:277" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_982 -#AT_START_983 -at_fn_group_banner 983 'ovsdb-data.at:277' \ - "named-uuid requires symbol table - Python" " " 56 -at_xfail=no -( - $as_echo "983. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:277" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:277" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:277: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[\"uuid\"]' '[\"named-uuid\", \"x\"]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-atoms '[\"uuid\"]' '[\"named-uuid\", \"x\"]'" "ovsdb-data.at:277" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '["uuid"]' '["named-uuid", "x"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax \"[\"named-uuid\",\"x\"]\": syntax error: expected [\"uuid\", ] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:277" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_983 -#AT_START_984 -at_fn_group_banner 984 'ovsdb-data.at:281' \ - "empty string atom must be quoted" " " 56 -at_xfail=no -( - $as_echo "984. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:281: test-ovsdb parse-atom-strings '[\"string\"]' ''" -at_fn_check_prepare_trace "ovsdb-data.at:281" -( $at_check_trace; test-ovsdb parse-atom-strings '["string"]' '' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:281: if grep -F -e \"An empty string is not valid as input; use \\\"\\\" to represent the empty string\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:281" -( $at_check_trace; if grep -F -e "An empty string is not valid as input; use \"\" to represent the empty string" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_984 -#AT_START_985 -at_fn_group_banner 985 'ovsdb-data.at:285' \ - "quotes must be balanced" " " 56 -at_xfail=no -( - $as_echo "985. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:285: test-ovsdb parse-atom-strings '[\"string\"]' '\"asdf'" -at_fn_check_prepare_trace "ovsdb-data.at:285" -( $at_check_trace; test-ovsdb parse-atom-strings '["string"]' '"asdf' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:285" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:285: if grep -F -e \"\\\"asdf: missing quote at end of quoted string\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:285" -( $at_check_trace; if grep -F -e "\"asdf: missing quote at end of quoted string" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:285" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_985 -#AT_START_986 -at_fn_group_banner 986 'ovsdb-data.at:289' \ - "uuids must be valid" " " 56 -at_xfail=no -( - $as_echo "986. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:289: test-ovsdb parse-atom-strings '[\"uuid\"]' '1234-5678'" -at_fn_check_prepare_trace "ovsdb-data.at:289" -( $at_check_trace; test-ovsdb parse-atom-strings '["uuid"]' '1234-5678' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:289: if grep -F -e \"\\\"1234-5678\\\" is not a valid UUID\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:289" -( $at_check_trace; if grep -F -e "\"1234-5678\" is not a valid UUID" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_986 -#AT_START_987 -at_fn_group_banner 987 'ovsdb-data.at:295' \ - "integer atom enum - C" " " 57 -at_xfail=no -( - $as_echo "987. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:295: test-ovsdb parse-atoms '[{\"type\": \"integer\", \"enum\": [\"set\", [1, 6, 8, 10]]}]' \\ - '[0]' \\ - '[1]' \\ - '[2]' \\ - '[3]' \\ - '[6]' \\ - '[7]' \\ - '[8]' \\ - '[9]' \\ - '[10]' \\ - '[11]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:295" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "integer", "enum": ["set", [1, 6, 8, 10]]}]' \ - '[0]' \ - '[1]' \ - '[2]' \ - '[3]' \ - '[6]' \ - '[7]' \ - '[8]' \ - '[9]' \ - '[10]' \ - '[11]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is not one of the allowed values ([1, 6, 8, 10]) -1 -constraint violation: 2 is not one of the allowed values ([1, 6, 8, 10]) -constraint violation: 3 is not one of the allowed values ([1, 6, 8, 10]) -6 -constraint violation: 7 is not one of the allowed values ([1, 6, 8, 10]) -8 -constraint violation: 9 is not one of the allowed values ([1, 6, 8, 10]) -10 -constraint violation: 11 is not one of the allowed values ([1, 6, 8, 10]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_987 -#AT_START_988 -at_fn_group_banner 988 'ovsdb-data.at:295' \ - "integer atom enum - Python" " " 57 -at_xfail=no -( - $as_echo "988. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:295" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:295" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:295: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"integer\", \"enum\": [\"set\", [1, 6, 8, 10]]}]' \\ - '[0]' \\ - '[1]' \\ - '[2]' \\ - '[3]' \\ - '[6]' \\ - '[7]' \\ - '[8]' \\ - '[9]' \\ - '[10]' \\ - '[11]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:295" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "integer", "enum": ["set", [1, 6, 8, 10]]}]' \ - '[0]' \ - '[1]' \ - '[2]' \ - '[3]' \ - '[6]' \ - '[7]' \ - '[8]' \ - '[9]' \ - '[10]' \ - '[11]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is not one of the allowed values ([1, 6, 8, 10]) -1 -constraint violation: 2 is not one of the allowed values ([1, 6, 8, 10]) -constraint violation: 3 is not one of the allowed values ([1, 6, 8, 10]) -6 -constraint violation: 7 is not one of the allowed values ([1, 6, 8, 10]) -8 -constraint violation: 9 is not one of the allowed values ([1, 6, 8, 10]) -10 -constraint violation: 11 is not one of the allowed values ([1, 6, 8, 10]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_988 -#AT_START_989 -at_fn_group_banner 989 'ovsdb-data.at:318' \ - "real atom enum - C" " " 57 -at_xfail=no -( - $as_echo "989. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:318: test-ovsdb parse-atoms '[{\"type\": \"real\", \"enum\": [\"set\", [-1.5, 1.5]]}]' \\ - '[-2]' \\ - '[-1]' \\ - '[-1.5]' \\ - '[0]' \\ - '[1]' \\ - '[1.5]' \\ - '[2]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:318" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "real", "enum": ["set", [-1.5, 1.5]]}]' \ - '[-2]' \ - '[-1]' \ - '[-1.5]' \ - '[0]' \ - '[1]' \ - '[1.5]' \ - '[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: -2 is not one of the allowed values ([-1.5, 1.5]) -constraint violation: -1 is not one of the allowed values ([-1.5, 1.5]) --1.5 -constraint violation: 0 is not one of the allowed values ([-1.5, 1.5]) -constraint violation: 1 is not one of the allowed values ([-1.5, 1.5]) -1.5 -constraint violation: 2 is not one of the allowed values ([-1.5, 1.5]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_989 -#AT_START_990 -at_fn_group_banner 990 'ovsdb-data.at:318' \ - "real atom enum - Python" " " 57 -at_xfail=no -( - $as_echo "990. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:318" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:318" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:318: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"real\", \"enum\": [\"set\", [-1.5, 1.5]]}]' \\ - '[-2]' \\ - '[-1]' \\ - '[-1.5]' \\ - '[0]' \\ - '[1]' \\ - '[1.5]' \\ - '[2]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:318" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "real", "enum": ["set", [-1.5, 1.5]]}]' \ - '[-2]' \ - '[-1]' \ - '[-1.5]' \ - '[0]' \ - '[1]' \ - '[1.5]' \ - '[2]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: -2 is not one of the allowed values ([-1.5, 1.5]) -constraint violation: -1 is not one of the allowed values ([-1.5, 1.5]) --1.5 -constraint violation: 0 is not one of the allowed values ([-1.5, 1.5]) -constraint violation: 1 is not one of the allowed values ([-1.5, 1.5]) -1.5 -constraint violation: 2 is not one of the allowed values ([-1.5, 1.5]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_990 -#AT_START_991 -at_fn_group_banner 991 'ovsdb-data.at:335' \ - "boolean atom enum - C" " " 57 -at_xfail=no -( - $as_echo "991. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:335: test-ovsdb parse-atoms '[{\"type\": \"boolean\", \"enum\": false}]' \\ - '[false]' \\ - '[true]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:335" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "boolean", "enum": false}]' \ - '[false]' \ - '[true]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "false -constraint violation: true is not one of the allowed values ([false]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:335" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_991 -#AT_START_992 -at_fn_group_banner 992 'ovsdb-data.at:335' \ - "boolean atom enum - Python" " " 57 -at_xfail=no -( - $as_echo "992. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:335" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:335" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:335: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"boolean\", \"enum\": false}]' \\ - '[false]' \\ - '[true]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:335" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "boolean", "enum": false}]' \ - '[false]' \ - '[true]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "false -constraint violation: true is not one of the allowed values ([false]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:335" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_992 -#AT_START_993 -at_fn_group_banner 993 'ovsdb-data.at:342' \ - "string atom enum - C" " " 57 -at_xfail=no -( - $as_echo "993. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:342: test-ovsdb parse-atoms '[{\"type\": \"string\", \"enum\": [\"set\", [\"abc\", \"def\"]]}]' \\ - '[\"\"]' \\ - '[\"ab\"]' \\ - '[\"abc\"]' \\ - '[\"def\"]' \\ - '[\"defg\"]' \\ - '[\"DEF\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:342" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "string", "enum": ["set", ["abc", "def"]]}]' \ - '[""]' \ - '["ab"]' \ - '["abc"]' \ - '["def"]' \ - '["defg"]' \ - '["DEF"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: \"\" is not one of the allowed values ([abc, def]) -constraint violation: ab is not one of the allowed values ([abc, def]) -\"abc\" -\"def\" -constraint violation: defg is not one of the allowed values ([abc, def]) -constraint violation: DEF is not one of the allowed values ([abc, def]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:342" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_993 -#AT_START_994 -at_fn_group_banner 994 'ovsdb-data.at:342' \ - "string atom enum - Python" " " 57 -at_xfail=no -( - $as_echo "994. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:342" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:342" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:342: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"string\", \"enum\": [\"set\", [\"abc\", \"def\"]]}]' \\ - '[\"\"]' \\ - '[\"ab\"]' \\ - '[\"abc\"]' \\ - '[\"def\"]' \\ - '[\"defg\"]' \\ - '[\"DEF\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:342" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "string", "enum": ["set", ["abc", "def"]]}]' \ - '[""]' \ - '["ab"]' \ - '["abc"]' \ - '["def"]' \ - '["defg"]' \ - '["DEF"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: \"\" is not one of the allowed values ([abc, def]) -constraint violation: ab is not one of the allowed values ([abc, def]) -\"abc\" -\"def\" -constraint violation: defg is not one of the allowed values ([abc, def]) -constraint violation: DEF is not one of the allowed values ([abc, def]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:342" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_994 -#AT_START_995 -at_fn_group_banner 995 'ovsdb-data.at:357' \ - "uuid atom enum - C" " " 57 -at_xfail=no -( - $as_echo "995. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:357: test-ovsdb parse-atoms '[{\"type\": \"uuid\", \"enum\": [\"set\", [[\"uuid\", \"6d53a6dd-2da7-4924-9927-97f613812382\"], [\"uuid\", \"52cbc842-137a-4db5-804f-9f34106a0ba3\"]]]}]' \\ - '[\"uuid\", \"6d53a6dd-2da7-4924-9927-97f613812382\"]' \\ - '[\"uuid\", \"52cbc842-137a-4db5-804f-9f34106a0ba3\"]' \\ - '[\"uuid\", \"dab2a6b2-6094-4f43-a7ef-4c0f0608f176\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:357" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "uuid", "enum": ["set", [["uuid", "6d53a6dd-2da7-4924-9927-97f613812382"], ["uuid", "52cbc842-137a-4db5-804f-9f34106a0ba3"]]]}]' \ - '["uuid", "6d53a6dd-2da7-4924-9927-97f613812382"]' \ - '["uuid", "52cbc842-137a-4db5-804f-9f34106a0ba3"]' \ - '["uuid", "dab2a6b2-6094-4f43-a7ef-4c0f0608f176"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"uuid\",\"6d53a6dd-2da7-4924-9927-97f613812382\"] -[\"uuid\",\"52cbc842-137a-4db5-804f-9f34106a0ba3\"] -constraint violation: dab2a6b2-6094-4f43-a7ef-4c0f0608f176 is not one of the allowed values ([52cbc842-137a-4db5-804f-9f34106a0ba3, 6d53a6dd-2da7-4924-9927-97f613812382]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:357" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_995 -#AT_START_996 -at_fn_group_banner 996 'ovsdb-data.at:357' \ - "uuid atom enum - Python" " " 57 -at_xfail=no -( - $as_echo "996. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:357" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:357" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:357: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"uuid\", \"enum\": [\"set\", [[\"uuid\", \"6d53a6dd-2da7-4924-9927-97f613812382\"], [\"uuid\", \"52cbc842-137a-4db5-804f-9f34106a0ba3\"]]]}]' \\ - '[\"uuid\", \"6d53a6dd-2da7-4924-9927-97f613812382\"]' \\ - '[\"uuid\", \"52cbc842-137a-4db5-804f-9f34106a0ba3\"]' \\ - '[\"uuid\", \"dab2a6b2-6094-4f43-a7ef-4c0f0608f176\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:357" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "uuid", "enum": ["set", [["uuid", "6d53a6dd-2da7-4924-9927-97f613812382"], ["uuid", "52cbc842-137a-4db5-804f-9f34106a0ba3"]]]}]' \ - '["uuid", "6d53a6dd-2da7-4924-9927-97f613812382"]' \ - '["uuid", "52cbc842-137a-4db5-804f-9f34106a0ba3"]' \ - '["uuid", "dab2a6b2-6094-4f43-a7ef-4c0f0608f176"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"uuid\",\"6d53a6dd-2da7-4924-9927-97f613812382\"] -[\"uuid\",\"52cbc842-137a-4db5-804f-9f34106a0ba3\"] -constraint violation: dab2a6b2-6094-4f43-a7ef-4c0f0608f176 is not one of the allowed values ([52cbc842-137a-4db5-804f-9f34106a0ba3, 6d53a6dd-2da7-4924-9927-97f613812382]) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:357" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_996 -#AT_START_997 -at_fn_group_banner 997 'ovsdb-data.at:368' \ - "integers >= 5 - C" " " 58 -at_xfail=no -( - $as_echo "997. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:368: test-ovsdb parse-atoms '[{\"type\": \"integer\", \"minInteger\": 5}]' \\ - '[0]' \\ - '[4]' \\ - '[5]' \\ - '[6]' \\ - '[12345]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:368" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "integer", "minInteger": 5}]' \ - '[0]' \ - '[4]' \ - '[5]' \ - '[6]' \ - '[12345]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is less than minimum allowed value 5 -constraint violation: 4 is less than minimum allowed value 5 -5 -6 -12345 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:368" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_997 -#AT_START_998 -at_fn_group_banner 998 'ovsdb-data.at:368' \ - "integers >= 5 - Python" " " 58 -at_xfail=no -( - $as_echo "998. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:368" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:368" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:368: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"integer\", \"minInteger\": 5}]' \\ - '[0]' \\ - '[4]' \\ - '[5]' \\ - '[6]' \\ - '[12345]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:368" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "integer", "minInteger": 5}]' \ - '[0]' \ - '[4]' \ - '[5]' \ - '[6]' \ - '[12345]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is less than minimum allowed value 5 -constraint violation: 4 is less than minimum allowed value 5 -5 -6 -12345 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:368" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_998 -#AT_START_999 -at_fn_group_banner 999 'ovsdb-data.at:381' \ - "integers <= -1 - C" " " 58 -at_xfail=no -( - $as_echo "999. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:381: test-ovsdb parse-atoms '[{\"type\": \"integer\", \"maxInteger\": -1}]' \\ - '[0]' \\ - '[-1]' \\ - '[-2]' \\ - '[-123]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:381" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "integer", "maxInteger": -1}]' \ - '[0]' \ - '[-1]' \ - '[-2]' \ - '[-123]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is greater than maximum allowed value -1 --1 --2 --123 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:381" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_999 -#AT_START_1000 -at_fn_group_banner 1000 'ovsdb-data.at:381' \ - "integers <= -1 - Python" " " 58 -at_xfail=no -( - $as_echo "1000. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:381" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:381" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:381: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"integer\", \"maxInteger\": -1}]' \\ - '[0]' \\ - '[-1]' \\ - '[-2]' \\ - '[-123]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:381" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "integer", "maxInteger": -1}]' \ - '[0]' \ - '[-1]' \ - '[-2]' \ - '[-123]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is greater than maximum allowed value -1 --1 --2 --123 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:381" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1000 -#AT_START_1001 -at_fn_group_banner 1001 'ovsdb-data.at:392' \ - "integers in range -10 to 10 - C" " " 58 -at_xfail=no -( - $as_echo "1001. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:392: test-ovsdb parse-atoms '[{\"type\": \"integer\", \"minInteger\": -10, \"maxInteger\": 10}]' \\ - '[-20]' \\ - '[-11]' \\ - '[-10]' \\ - '[-9]' \\ - '[1]' \\ - '[9]' \\ - '[10]' \\ - '[11]' \\ - '[123576]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:392" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "integer", "minInteger": -10, "maxInteger": 10}]' \ - '[-20]' \ - '[-11]' \ - '[-10]' \ - '[-9]' \ - '[1]' \ - '[9]' \ - '[10]' \ - '[11]' \ - '[123576]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: -20 is not in the valid range -10 to 10 (inclusive) -constraint violation: -11 is not in the valid range -10 to 10 (inclusive) --10 --9 -1 -9 -10 -constraint violation: 11 is not in the valid range -10 to 10 (inclusive) -constraint violation: 123576 is not in the valid range -10 to 10 (inclusive) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:392" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1001 -#AT_START_1002 -at_fn_group_banner 1002 'ovsdb-data.at:392' \ - "integers in range -10 to 10 - Python" " " 58 -at_xfail=no -( - $as_echo "1002. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:392" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:392" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:392: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"integer\", \"minInteger\": -10, \"maxInteger\": 10}]' \\ - '[-20]' \\ - '[-11]' \\ - '[-10]' \\ - '[-9]' \\ - '[1]' \\ - '[9]' \\ - '[10]' \\ - '[11]' \\ - '[123576]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:392" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "integer", "minInteger": -10, "maxInteger": 10}]' \ - '[-20]' \ - '[-11]' \ - '[-10]' \ - '[-9]' \ - '[1]' \ - '[9]' \ - '[10]' \ - '[11]' \ - '[123576]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: -20 is not in the valid range -10 to 10 (inclusive) -constraint violation: -11 is not in the valid range -10 to 10 (inclusive) --10 --9 -1 -9 -10 -constraint violation: 11 is not in the valid range -10 to 10 (inclusive) -constraint violation: 123576 is not in the valid range -10 to 10 (inclusive) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:392" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1002 -#AT_START_1003 -at_fn_group_banner 1003 'ovsdb-data.at:413' \ - "reals >= 5 - C" " " 58 -at_xfail=no -( - $as_echo "1003. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:413: test-ovsdb parse-atoms '[{\"type\": \"real\", \"minReal\": 5}]' \\ - '[0]' \\ - '[4]' \\ - '[5]' \\ - '[6]' \\ - '[12345]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:413" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "real", "minReal": 5}]' \ - '[0]' \ - '[4]' \ - '[5]' \ - '[6]' \ - '[12345]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is less than minimum allowed value 5 -constraint violation: 4 is less than minimum allowed value 5 -5 -6 -12345 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1003 -#AT_START_1004 -at_fn_group_banner 1004 'ovsdb-data.at:413' \ - "reals >= 5 - Python" " " 58 -at_xfail=no -( - $as_echo "1004. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:413" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:413" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:413: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"real\", \"minReal\": 5}]' \\ - '[0]' \\ - '[4]' \\ - '[5]' \\ - '[6]' \\ - '[12345]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:413" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "real", "minReal": 5}]' \ - '[0]' \ - '[4]' \ - '[5]' \ - '[6]' \ - '[12345]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is less than minimum allowed value 5 -constraint violation: 4 is less than minimum allowed value 5 -5 -6 -12345 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1004 -#AT_START_1005 -at_fn_group_banner 1005 'ovsdb-data.at:426' \ - "reals <= -1 - C" " " 58 -at_xfail=no -( - $as_echo "1005. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:426: test-ovsdb parse-atoms '[{\"type\": \"real\", \"maxReal\": -1}]' \\ - '[0]' \\ - '[-1]' \\ - '[-2]' \\ - '[-123]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:426" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "real", "maxReal": -1}]' \ - '[0]' \ - '[-1]' \ - '[-2]' \ - '[-123]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is greater than maximum allowed value -1 --1 --2 --123 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:426" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1005 -#AT_START_1006 -at_fn_group_banner 1006 'ovsdb-data.at:426' \ - "reals <= -1 - Python" " " 58 -at_xfail=no -( - $as_echo "1006. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:426" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:426" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:426: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"real\", \"maxReal\": -1}]' \\ - '[0]' \\ - '[-1]' \\ - '[-2]' \\ - '[-123]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:426" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "real", "maxReal": -1}]' \ - '[0]' \ - '[-1]' \ - '[-2]' \ - '[-123]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: 0 is greater than maximum allowed value -1 --1 --2 --123 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:426" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1006 -#AT_START_1007 -at_fn_group_banner 1007 'ovsdb-data.at:437' \ - "reals in range -10 to 10 - C" " " 58 -at_xfail=no -( - $as_echo "1007. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:437: test-ovsdb parse-atoms '[{\"type\": \"real\", \"minReal\": -10, \"maxReal\": 10}]' \\ - '[-20]' \\ - '[-11]' \\ - '[-10]' \\ - '[-9]' \\ - '[1]' \\ - '[9]' \\ - '[10]' \\ - '[11]' \\ - '[123576]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:437" -( $at_check_trace; test-ovsdb parse-atoms '[{"type": "real", "minReal": -10, "maxReal": 10}]' \ - '[-20]' \ - '[-11]' \ - '[-10]' \ - '[-9]' \ - '[1]' \ - '[9]' \ - '[10]' \ - '[11]' \ - '[123576]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: -20 is not in the valid range -10 to 10 (inclusive) -constraint violation: -11 is not in the valid range -10 to 10 (inclusive) --10 --9 -1 -9 -10 -constraint violation: 11 is not in the valid range -10 to 10 (inclusive) -constraint violation: 123576 is not in the valid range -10 to 10 (inclusive) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:437" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1007 -#AT_START_1008 -at_fn_group_banner 1008 'ovsdb-data.at:437' \ - "reals in range -10 to 10 - Python" " " 58 -at_xfail=no -( - $as_echo "1008. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:437" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:437" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:437: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '[{\"type\": \"real\", \"minReal\": -10, \"maxReal\": 10}]' \\ - '[-20]' \\ - '[-11]' \\ - '[-10]' \\ - '[-9]' \\ - '[1]' \\ - '[9]' \\ - '[10]' \\ - '[11]' \\ - '[123576]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:437" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '[{"type": "real", "minReal": -10, "maxReal": 10}]' \ - '[-20]' \ - '[-11]' \ - '[-10]' \ - '[-9]' \ - '[1]' \ - '[9]' \ - '[10]' \ - '[11]' \ - '[123576]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: -20 is not in the valid range -10 to 10 (inclusive) -constraint violation: -11 is not in the valid range -10 to 10 (inclusive) --10 --9 -1 -9 -10 -constraint violation: 11 is not in the valid range -10 to 10 (inclusive) -constraint violation: 123576 is not in the valid range -10 to 10 (inclusive) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:437" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1008 -#AT_START_1009 -at_fn_group_banner 1009 'ovsdb-data.at:458' \ - "strings at least 2 characters long - C" " " 58 -at_xfail=no -( - $as_echo "1009. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:458: test-ovsdb parse-atoms '{\"type\": \"string\", \"minLength\": 2}' \\ - '[\"\"]' \\ - '[\"a\"]' \\ - '[\"ab\"]' \\ - '[\"abc\"]' \\ - '[\"\\ud834\\udd1e\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:458" -( $at_check_trace; test-ovsdb parse-atoms '{"type": "string", "minLength": 2}' \ - '[""]' \ - '["a"]' \ - '["ab"]' \ - '["abc"]' \ - '["\ud834\udd1e"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: \"\" length 0 is less than minimum allowed length 2 -constraint violation: \"a\" length 1 is less than minimum allowed length 2 -\"ab\" -\"abc\" -constraint violation: \"𝄞\" length 1 is less than minimum allowed length 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:458" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1009 -#AT_START_1010 -at_fn_group_banner 1010 'ovsdb-data.at:458' \ - "strings at least 2 characters long - Python" " " 58 -at_xfail=no -( - $as_echo "1010. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:458" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:458" - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:458: \$PYTHON -c 'unichr(0x10000)' || exit 77" -at_fn_check_prepare_dynamic "$PYTHON -c 'unichr(0x10000)' || exit 77" "ovsdb-data.at:458" -( $at_check_trace; $PYTHON -c 'unichr(0x10000)' || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:458" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:458: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '{\"type\": \"string\", \"minLength\": 2}' \\ - '[\"\"]' \\ - '[\"a\"]' \\ - '[\"ab\"]' \\ - '[\"abc\"]' \\ - '[\"\\ud834\\udd1e\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:458" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '{"type": "string", "minLength": 2}' \ - '[""]' \ - '["a"]' \ - '["ab"]' \ - '["abc"]' \ - '["\ud834\udd1e"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraint violation: \"\" length 0 is less than minimum allowed length 2 -constraint violation: \"a\" length 1 is less than minimum allowed length 2 -\"ab\" -\"abc\" -constraint violation: \"𝄞\" length 1 is less than minimum allowed length 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:458" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1010 -#AT_START_1011 -at_fn_group_banner 1011 'ovsdb-data.at:476' \ - "strings no more than 2 characters long - C" " " 58 -at_xfail=no -( - $as_echo "1011. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:476: test-ovsdb parse-atoms '{\"type\": \"string\", \"maxLength\": 2}' \\ - '[\"\"]' \\ - '[\"a\"]' \\ - '[\"ab\"]' \\ - '[\"abc\"]' \\ - '[\"de\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:476" -( $at_check_trace; test-ovsdb parse-atoms '{"type": "string", "maxLength": 2}' \ - '[""]' \ - '["a"]' \ - '["ab"]' \ - '["abc"]' \ - '["de"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"\" -\"a\" -\"ab\" -constraint violation: \"abc\" length 3 is greater than maximum allowed length 2 -\"de\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:476" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1011 -#AT_START_1012 -at_fn_group_banner 1012 'ovsdb-data.at:476' \ - "strings no more than 2 characters long - Python" "" 58 -at_xfail=no -( - $as_echo "1012. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:476" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:476" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:476: \$PYTHON \$srcdir/test-ovsdb.py parse-atoms '{\"type\": \"string\", \"maxLength\": 2}' \\ - '[\"\"]' \\ - '[\"a\"]' \\ - '[\"ab\"]' \\ - '[\"abc\"]' \\ - '[\"de\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:476" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-atoms '{"type": "string", "maxLength": 2}' \ - '[""]' \ - '["a"]' \ - '["ab"]' \ - '["abc"]' \ - '["de"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"\" -\"a\" -\"ab\" -constraint violation: \"abc\" length 3 is greater than maximum allowed length 2 -\"de\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:476" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1012 -#AT_START_1013 -at_fn_group_banner 1013 'ovsdb-data.at:491' \ - "integer JSON datum - C" " " 59 -at_xfail=no -( - $as_echo "1013. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:491: test-ovsdb parse-data '[\"integer\"]' '[0]' '[\"set\",[1]]' '[-1]'" -at_fn_check_prepare_trace "ovsdb-data.at:491" -( $at_check_trace; test-ovsdb parse-data '["integer"]' '[0]' '["set",[1]]' '[-1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 --1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:491" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1013 -#AT_START_1014 -at_fn_group_banner 1014 'ovsdb-data.at:491' \ - "integer JSON datum - Python" " " 59 -at_xfail=no -( - $as_echo "1014. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:491" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:491" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:491: \$PYTHON \$srcdir/test-ovsdb.py parse-data '[\"integer\"]' '[0]' '[\"set\",[1]]' '[-1]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '[\"integer\"]' '[0]' '[\"set\",[1]]' '[-1]'" "ovsdb-data.at:491" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '["integer"]' '[0]' '["set",[1]]' '[-1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 --1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:491" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1014 -#AT_START_1015 -at_fn_group_banner 1015 'ovsdb-data.at:497' \ - "integer string datum" " " 59 -at_xfail=no -( - $as_echo "1015. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:497: test-ovsdb parse-data-strings -- '[\"integer\"]' '0' '1' '-1' '+1'" -at_fn_check_prepare_trace "ovsdb-data.at:497" -( $at_check_trace; test-ovsdb parse-data-strings -- '["integer"]' '0' '1' '-1' '+1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 --1 -1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:497" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1015 -#AT_START_1016 -at_fn_group_banner 1016 'ovsdb-data.at:504' \ - "real JSON datum - C" " " 59 -at_xfail=no -( - $as_echo "1016. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:504: test-ovsdb parse-data '[\"real\"]' '[0]' '[\"set\",[1.0]]' '[-1.25]'" -at_fn_check_prepare_trace "ovsdb-data.at:504" -( $at_check_trace; test-ovsdb parse-data '["real"]' '[0]' '["set",[1.0]]' '[-1.25]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 --1.25 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1016 -#AT_START_1017 -at_fn_group_banner 1017 'ovsdb-data.at:504' \ - "real JSON datum - Python" " " 59 -at_xfail=no -( - $as_echo "1017. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:504" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:504" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:504: \$PYTHON \$srcdir/test-ovsdb.py parse-data '[\"real\"]' '[0]' '[\"set\",[1.0]]' '[-1.25]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '[\"real\"]' '[0]' '[\"set\",[1.0]]' '[-1.25]'" "ovsdb-data.at:504" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '["real"]' '[0]' '["set",[1.0]]' '[-1.25]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 --1.25 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1017 -#AT_START_1018 -at_fn_group_banner 1018 'ovsdb-data.at:510' \ - "real string datum" " " 59 -at_xfail=no -( - $as_echo "1018. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:510: test-ovsdb parse-data-strings -- '[\"real\"]' '0' '1.0' '-1.25'" -at_fn_check_prepare_trace "ovsdb-data.at:510" -( $at_check_trace; test-ovsdb parse-data-strings -- '["real"]' '0' '1.0' '-1.25' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 --1.25 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:510" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1018 -#AT_START_1019 -at_fn_group_banner 1019 'ovsdb-data.at:516' \ - "boolean JSON datum - C" " " 59 -at_xfail=no -( - $as_echo "1019. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:516: test-ovsdb parse-data '[\"boolean\"]' '[\"set\", [true]]' '[false]' " -at_fn_check_prepare_trace "ovsdb-data.at:516" -( $at_check_trace; test-ovsdb parse-data '["boolean"]' '["set", [true]]' '[false]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:516" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1019 -#AT_START_1020 -at_fn_group_banner 1020 'ovsdb-data.at:516' \ - "boolean JSON datum - Python" " " 59 -at_xfail=no -( - $as_echo "1020. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:516" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:516" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:516: \$PYTHON \$srcdir/test-ovsdb.py parse-data '[\"boolean\"]' '[\"set\", [true]]' '[false]' " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '[\"boolean\"]' '[\"set\", [true]]' '[false]' " "ovsdb-data.at:516" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '["boolean"]' '["set", [true]]' '[false]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:516" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1020 -#AT_START_1021 -at_fn_group_banner 1021 'ovsdb-data.at:521' \ - "boolean string datum" " " 59 -at_xfail=no -( - $as_echo "1021. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:521: test-ovsdb parse-data-strings '[\"boolean\"]' 'true' 'false' " -at_fn_check_prepare_trace "ovsdb-data.at:521" -( $at_check_trace; test-ovsdb parse-data-strings '["boolean"]' 'true' 'false' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:521" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1021 -#AT_START_1022 -at_fn_group_banner 1022 'ovsdb-data.at:526' \ - "string JSON datum - C" " " 59 -at_xfail=no -( - $as_echo "1022. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:526: test-ovsdb parse-data '[\"string\"]' '[\"set\",[\"\"]]' '[\"true\"]' '[\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"]'" -at_fn_check_prepare_trace "ovsdb-data.at:526" -( $at_check_trace; test-ovsdb parse-data '["string"]' '["set",[""]]' '["true"]' '["\"\\\/\b\f\n\r\t"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"\" -\"true\" -\"\\\"\\\\/\\b\\f\\n\\r\\t\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:526" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1022 -#AT_START_1023 -at_fn_group_banner 1023 'ovsdb-data.at:526' \ - "string JSON datum - Python" " " 59 -at_xfail=no -( - $as_echo "1023. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:526" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:526" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:526: \$PYTHON \$srcdir/test-ovsdb.py parse-data '[\"string\"]' '[\"set\",[\"\"]]' '[\"true\"]' '[\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '[\"string\"]' '[\"set\",[\"\"]]' '[\"true\"]' '[\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"]'" "ovsdb-data.at:526" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '["string"]' '["set",[""]]' '["true"]' '["\"\\\/\b\f\n\r\t"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"\" -\"true\" -\"\\\"\\\\/\\b\\f\\n\\r\\t\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:526" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1023 -#AT_START_1024 -at_fn_group_banner 1024 'ovsdb-data.at:532' \ - "string string datum" " " 59 -at_xfail=no -( - $as_echo "1024. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:532: test-ovsdb parse-data-strings '[\"string\"]' '\"x\"' '\"\"' '\"true\"' '\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"'" -at_fn_check_prepare_trace "ovsdb-data.at:532" -( $at_check_trace; test-ovsdb parse-data-strings '["string"]' '"x"' '""' '"true"' '"\"\\\/\b\f\n\r\t"' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "x -\"\" -\"true\" -\"\\\"\\\\/\\b\\f\\n\\r\\t\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:532" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1024 -#AT_START_1025 -at_fn_group_banner 1025 'ovsdb-data.at:541' \ - "JSON optional boolean - C" " " 60 -at_xfail=no -( - $as_echo "1025. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:541: test-ovsdb parse-data '{\"key\": \"boolean\", \"min\": 0}' \\ - '[true]' \\ - '[\"set\", [false]]' \\ - '[\"set\", []]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:541" -( $at_check_trace; test-ovsdb parse-data '{"key": "boolean", "min": 0}' \ - '[true]' \ - '["set", [false]]' \ - '["set", []]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -[\"set\",[]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:541" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1025 -#AT_START_1026 -at_fn_group_banner 1026 'ovsdb-data.at:541' \ - "JSON optional boolean - Python" " " 60 -at_xfail=no -( - $as_echo "1026. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:541" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:541" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:541: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"boolean\", \"min\": 0}' \\ - '[true]' \\ - '[\"set\", [false]]' \\ - '[\"set\", []]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:541" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "boolean", "min": 0}' \ - '[true]' \ - '["set", [false]]' \ - '["set", []]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -[\"set\",[]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:541" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1026 -#AT_START_1027 -at_fn_group_banner 1027 'ovsdb-data.at:551' \ - "string optional boolean" " " 60 -at_xfail=no -( - $as_echo "1027. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:551: test-ovsdb parse-data-strings '{\"key\": \"boolean\", \"min\": 0}' \\ - 'true' \\ - 'false' \\ - '[]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:551" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "boolean", "min": 0}' \ - 'true' \ - 'false' \ - '[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true -false -[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:551" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1027 -#AT_START_1028 -at_fn_group_banner 1028 'ovsdb-data.at:561' \ - "JSON set of 0 or more integers - C" " " 60 -at_xfail=no -( - $as_echo "1028. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:561: test-ovsdb parse-data '{\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}' \\ - '[\"set\", [0]]' \\ - '[1]' \\ - '[\"set\", [0, 1]]' \\ - '[\"set\", [0, 1, 2]]' \\ - '[\"set\", [0, 1, 2, 3, 4, 5]]' \\ - '[\"set\", [0, 1, 2, 3, 4, 5, 6, 7, 8]]' \\ - '[\"set\", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:561" -( $at_check_trace; test-ovsdb parse-data '{"key": "integer", "min": 0, "max": "unlimited"}' \ - '["set", [0]]' \ - '[1]' \ - '["set", [0, 1]]' \ - '["set", [0, 1, 2]]' \ - '["set", [0, 1, 2, 3, 4, 5]]' \ - '["set", [0, 1, 2, 3, 4, 5, 6, 7, 8]]' \ - '["set", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 -[\"set\",[0,1]] -[\"set\",[0,1,2]] -[\"set\",[0,1,2,3,4,5]] -[\"set\",[0,1,2,3,4,5,6,7,8]] -[\"set\",[0,1,2,3,4,5,6,7,8,9,10]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1028 -#AT_START_1029 -at_fn_group_banner 1029 'ovsdb-data.at:561' \ - "JSON set of 0 or more integers - Python" " " 60 -at_xfail=no -( - $as_echo "1029. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:561" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:561" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:561: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}' \\ - '[\"set\", [0]]' \\ - '[1]' \\ - '[\"set\", [0, 1]]' \\ - '[\"set\", [0, 1, 2]]' \\ - '[\"set\", [0, 1, 2, 3, 4, 5]]' \\ - '[\"set\", [0, 1, 2, 3, 4, 5, 6, 7, 8]]' \\ - '[\"set\", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:561" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "integer", "min": 0, "max": "unlimited"}' \ - '["set", [0]]' \ - '[1]' \ - '["set", [0, 1]]' \ - '["set", [0, 1, 2]]' \ - '["set", [0, 1, 2, 3, 4, 5]]' \ - '["set", [0, 1, 2, 3, 4, 5, 6, 7, 8]]' \ - '["set", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -1 -[\"set\",[0,1]] -[\"set\",[0,1,2]] -[\"set\",[0,1,2,3,4,5]] -[\"set\",[0,1,2,3,4,5,6,7,8]] -[\"set\",[0,1,2,3,4,5,6,7,8,9,10]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1029 -#AT_START_1030 -at_fn_group_banner 1030 'ovsdb-data.at:578' \ - "string set of 0 or more integers" " " 60 -at_xfail=no -( - $as_echo "1030. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:578: test-ovsdb parse-data-strings '{\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}' \\ - '0' \\ - '0,1' \\ - '0, 1, 2' \\ - '[0, 1,2, 3, 4, 5]' \\ - '0, 1,2, 3,4, 5, 6, 7, 8' \\ - '[0, 1, 2, 3, 4,5, 6,7, 8, 9, 10]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:578" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "integer", "min": 0, "max": "unlimited"}' \ - '0' \ - '0,1' \ - '0, 1, 2' \ - '[0, 1,2, 3, 4, 5]' \ - '0, 1,2, 3,4, 5, 6, 7, 8' \ - '[0, 1, 2, 3, 4,5, 6,7, 8, 9, 10]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[0] -[0, 1] -[0, 1, 2] -[0, 1, 2, 3, 4, 5] -[0, 1, 2, 3, 4, 5, 6, 7, 8] -[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:578" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1030 -#AT_START_1031 -at_fn_group_banner 1031 'ovsdb-data.at:593' \ - "JSON set of 1 to 3 uuids - C" " " 60 -at_xfail=no -( - $as_echo "1031. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:593: test-ovsdb parse-data '{\"key\": \"uuid\", \"min\": 1, \"max\": 3}' \\ - '[\"set\", [[\"uuid\", \"550e8400-e29b-41d4-a716-446655440000\"]]]' \\ - '[\"uuid\", \"b5078be0-7664-4299-b836-8bcc03ef941f\"]' \\ - '[\"set\", [[\"uuid\", \"c5051240-30ff-43ed-b4b9-93cf3f050813\"], - [\"uuid\", \"90558331-09af-4d2f-a572-509cad2e9088\"], - [\"uuid\", \"550e8400-e29b-41d4-a716-446655440000\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:593" -( $at_check_trace; test-ovsdb parse-data '{"key": "uuid", "min": 1, "max": 3}' \ - '["set", [["uuid", "550e8400-e29b-41d4-a716-446655440000"]]]' \ - '["uuid", "b5078be0-7664-4299-b836-8bcc03ef941f"]' \ - '["set", [["uuid", "c5051240-30ff-43ed-b4b9-93cf3f050813"], - ["uuid", "90558331-09af-4d2f-a572-509cad2e9088"], - ["uuid", "550e8400-e29b-41d4-a716-446655440000"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"uuid\",\"550e8400-e29b-41d4-a716-446655440000\"] -[\"uuid\",\"b5078be0-7664-4299-b836-8bcc03ef941f\"] -[\"set\",[[\"uuid\",\"550e8400-e29b-41d4-a716-446655440000\"],[\"uuid\",\"90558331-09af-4d2f-a572-509cad2e9088\"],[\"uuid\",\"c5051240-30ff-43ed-b4b9-93cf3f050813\"]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:593" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1031 -#AT_START_1032 -at_fn_group_banner 1032 'ovsdb-data.at:593' \ - "JSON set of 1 to 3 uuids - Python" " " 60 -at_xfail=no -( - $as_echo "1032. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:593" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:593" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:593: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"uuid\", \"min\": 1, \"max\": 3}' \\ - '[\"set\", [[\"uuid\", \"550e8400-e29b-41d4-a716-446655440000\"]]]' \\ - '[\"uuid\", \"b5078be0-7664-4299-b836-8bcc03ef941f\"]' \\ - '[\"set\", [[\"uuid\", \"c5051240-30ff-43ed-b4b9-93cf3f050813\"], - [\"uuid\", \"90558331-09af-4d2f-a572-509cad2e9088\"], - [\"uuid\", \"550e8400-e29b-41d4-a716-446655440000\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:593" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "uuid", "min": 1, "max": 3}' \ - '["set", [["uuid", "550e8400-e29b-41d4-a716-446655440000"]]]' \ - '["uuid", "b5078be0-7664-4299-b836-8bcc03ef941f"]' \ - '["set", [["uuid", "c5051240-30ff-43ed-b4b9-93cf3f050813"], - ["uuid", "90558331-09af-4d2f-a572-509cad2e9088"], - ["uuid", "550e8400-e29b-41d4-a716-446655440000"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"uuid\",\"550e8400-e29b-41d4-a716-446655440000\"] -[\"uuid\",\"b5078be0-7664-4299-b836-8bcc03ef941f\"] -[\"set\",[[\"uuid\",\"550e8400-e29b-41d4-a716-446655440000\"],[\"uuid\",\"90558331-09af-4d2f-a572-509cad2e9088\"],[\"uuid\",\"c5051240-30ff-43ed-b4b9-93cf3f050813\"]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:593" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1032 -#AT_START_1033 -at_fn_group_banner 1033 'ovsdb-data.at:604' \ - "string set of 1 to 3 uuids" " " 60 -at_xfail=no -( - $as_echo "1033. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:604: test-ovsdb parse-data-strings '{\"key\": \"uuid\", \"min\": 1, \"max\": 3}' \\ - '[550e8400-e29b-41d4-a716-446655440000]' \\ - '[c5051240-30ff-43ed-b4b9-93cf3f050813, - 90558331-09af-4d2f-a572-509cad2e9088, - 550e8400-e29b-41d4-a716-446655440000]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:604" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "uuid", "min": 1, "max": 3}' \ - '[550e8400-e29b-41d4-a716-446655440000]' \ - '[c5051240-30ff-43ed-b4b9-93cf3f050813, - 90558331-09af-4d2f-a572-509cad2e9088, - 550e8400-e29b-41d4-a716-446655440000]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[550e8400-e29b-41d4-a716-446655440000] -[550e8400-e29b-41d4-a716-446655440000, 90558331-09af-4d2f-a572-509cad2e9088, c5051240-30ff-43ed-b4b9-93cf3f050813] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:604" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1033 -#AT_START_1034 -at_fn_group_banner 1034 'ovsdb-data.at:613' \ - "JSON set of 0 to 3 strings - C" " " 60 -at_xfail=no -( - $as_echo "1034. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:613: test-ovsdb parse-data '{\"key\": \"string\", \"min\": 0, \"max\": 3}' \\ - '[\"set\", []]' \\ - '[\"a longer string\"]' \\ - '[\"set\", [\"a relatively long string\"]]' \\ - '[\"set\", [\"short string\", \"a relatively long string\"]]' \\ - '[\"set\", [\"zzz\", \"short string\", \"a relatively long string\"]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:613" -( $at_check_trace; test-ovsdb parse-data '{"key": "string", "min": 0, "max": 3}' \ - '["set", []]' \ - '["a longer string"]' \ - '["set", ["a relatively long string"]]' \ - '["set", ["short string", "a relatively long string"]]' \ - '["set", ["zzz", "short string", "a relatively long string"]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"set\",[]] -\"a longer string\" -\"a relatively long string\" -[\"set\",[\"a relatively long string\",\"short string\"]] -[\"set\",[\"a relatively long string\",\"short string\",\"zzz\"]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:613" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1034 -#AT_START_1035 -at_fn_group_banner 1035 'ovsdb-data.at:613' \ - "JSON set of 0 to 3 strings - Python" " " 60 -at_xfail=no -( - $as_echo "1035. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:613" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:613" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:613: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"string\", \"min\": 0, \"max\": 3}' \\ - '[\"set\", []]' \\ - '[\"a longer string\"]' \\ - '[\"set\", [\"a relatively long string\"]]' \\ - '[\"set\", [\"short string\", \"a relatively long string\"]]' \\ - '[\"set\", [\"zzz\", \"short string\", \"a relatively long string\"]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:613" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "string", "min": 0, "max": 3}' \ - '["set", []]' \ - '["a longer string"]' \ - '["set", ["a relatively long string"]]' \ - '["set", ["short string", "a relatively long string"]]' \ - '["set", ["zzz", "short string", "a relatively long string"]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"set\",[]] -\"a longer string\" -\"a relatively long string\" -[\"set\",[\"a relatively long string\",\"short string\"]] -[\"set\",[\"a relatively long string\",\"short string\",\"zzz\"]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:613" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1035 -#AT_START_1036 -at_fn_group_banner 1036 'ovsdb-data.at:626' \ - "string set of 0 to 3 strings" " " 60 -at_xfail=no -( - $as_echo "1036. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:626: test-ovsdb parse-data-strings '{\"key\": \"string\", \"min\": 0, \"max\": 3}' \\ - '[]' \\ - '\"a relatively long string\"' \\ - '[\"short string\", \"a relatively long string\"]' \\ - '\"zzz\",\"short string\",\"a relatively long string\"'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:626" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "string", "min": 0, "max": 3}' \ - '[]' \ - '"a relatively long string"' \ - '["short string", "a relatively long string"]' \ - '"zzz","short string","a relatively long string"' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[] -[\"a relatively long string\"] -[\"a relatively long string\", \"short string\"] -[\"a relatively long string\", \"short string\", zzz] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:626" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1036 -#AT_START_1037 -at_fn_group_banner 1037 'ovsdb-data.at:637' \ - "duplicate boolean not allowed in JSON set - C" " " 60 -at_xfail=no -( - $as_echo "1037. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:637: test-ovsdb parse-data '{\"key\": \"boolean\", \"max\": 5}' '[\"set\", [true, true]]'" -at_fn_check_prepare_trace "ovsdb-data.at:637" -( $at_check_trace; test-ovsdb parse-data '{"key": "boolean", "max": 5}' '["set", [true, true]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:637" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:637: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:637" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:637" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1037 -#AT_START_1038 -at_fn_group_banner 1038 'ovsdb-data.at:637' \ - "duplicate boolean not allowed in JSON set - Python" "" 60 -at_xfail=no -( - $as_echo "1038. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:637" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:637" - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:637: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"boolean\", \"max\": 5}' '[\"set\", [true, true]]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '{\"key\": \"boolean\", \"max\": 5}' '[\"set\", [true, true]]'" "ovsdb-data.at:637" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "boolean", "max": 5}' '["set", [true, true]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:637" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:637: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:637" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:637" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1038 -#AT_START_1039 -at_fn_group_banner 1039 'ovsdb-data.at:641' \ - "duplicate boolean not allowed in string set" " " 60 -at_xfail=no -( - $as_echo "1039. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:641: test-ovsdb parse-data-strings '{\"key\": \"boolean\", \"max\": 5}' 'true, true'" -at_fn_check_prepare_trace "ovsdb-data.at:641" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "boolean", "max": 5}' 'true, true' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:641" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:641: if grep -F -e \"set contains duplicate value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:641" -( $at_check_trace; if grep -F -e "set contains duplicate value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:641" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1039 -#AT_START_1040 -at_fn_group_banner 1040 'ovsdb-data.at:645' \ - "duplicate integer not allowed in JSON set - C" " " 60 -at_xfail=no -( - $as_echo "1040. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:645: test-ovsdb parse-data '{\"key\": \"integer\", \"max\": 5}' '[\"set\", [1, 2, 3, 1]]'" -at_fn_check_prepare_trace "ovsdb-data.at:645" -( $at_check_trace; test-ovsdb parse-data '{"key": "integer", "max": 5}' '["set", [1, 2, 3, 1]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:645" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:645: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:645" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:645" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1040 -#AT_START_1041 -at_fn_group_banner 1041 'ovsdb-data.at:645' \ - "duplicate integer not allowed in JSON set - Python" "" 60 -at_xfail=no -( - $as_echo "1041. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:645" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:645" - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:645: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"integer\", \"max\": 5}' '[\"set\", [1, 2, 3, 1]]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '{\"key\": \"integer\", \"max\": 5}' '[\"set\", [1, 2, 3, 1]]'" "ovsdb-data.at:645" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "integer", "max": 5}' '["set", [1, 2, 3, 1]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:645" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:645: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:645" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:645" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1041 -#AT_START_1042 -at_fn_group_banner 1042 'ovsdb-data.at:649' \ - "duplicate integer not allowed in string set" " " 60 -at_xfail=no -( - $as_echo "1042. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:649: test-ovsdb parse-data-strings '{\"key\": \"integer\", \"max\": 5}' '[1, 2, 3, 1]'" -at_fn_check_prepare_trace "ovsdb-data.at:649" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "integer", "max": 5}' '[1, 2, 3, 1]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:649" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:649: if grep -F -e \"set contains duplicate value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:649" -( $at_check_trace; if grep -F -e "set contains duplicate value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:649" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1042 -#AT_START_1043 -at_fn_group_banner 1043 'ovsdb-data.at:653' \ - "duplicate real not allowed in JSON set - C" " " 60 -at_xfail=no -( - $as_echo "1043. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:653: test-ovsdb parse-data '{\"key\": \"real\", \"max\": 5}' '[\"set\", [0.0, -0.0]]'" -at_fn_check_prepare_trace "ovsdb-data.at:653" -( $at_check_trace; test-ovsdb parse-data '{"key": "real", "max": 5}' '["set", [0.0, -0.0]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:653: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:653" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1043 -#AT_START_1044 -at_fn_group_banner 1044 'ovsdb-data.at:653' \ - "duplicate real not allowed in JSON set - Python" "" 60 -at_xfail=no -( - $as_echo "1044. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:653" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:653" - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:653: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"real\", \"max\": 5}' '[\"set\", [0.0, -0.0]]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '{\"key\": \"real\", \"max\": 5}' '[\"set\", [0.0, -0.0]]'" "ovsdb-data.at:653" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "real", "max": 5}' '["set", [0.0, -0.0]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:653: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:653" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1044 -#AT_START_1045 -at_fn_group_banner 1045 'ovsdb-data.at:657' \ - "duplicate real not allowed in string set" " " 60 -at_xfail=no -( - $as_echo "1045. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:657: test-ovsdb parse-data-strings '{\"key\": \"real\", \"max\": 5}' '0.0, -0.0'" -at_fn_check_prepare_trace "ovsdb-data.at:657" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "real", "max": 5}' '0.0, -0.0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:657" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:657: if grep -F -e \"set contains duplicate value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:657" -( $at_check_trace; if grep -F -e "set contains duplicate value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:657" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1045 -#AT_START_1046 -at_fn_group_banner 1046 'ovsdb-data.at:661' \ - "duplicate string not allowed in JSON set - C" " " 60 -at_xfail=no -( - $as_echo "1046. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:661: test-ovsdb parse-data '{\"key\": \"string\", \"max\": 5}' '[\"set\", [\"asdf\", \"ASDF\", \"asdf\"]]'" -at_fn_check_prepare_trace "ovsdb-data.at:661" -( $at_check_trace; test-ovsdb parse-data '{"key": "string", "max": 5}' '["set", ["asdf", "ASDF", "asdf"]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:661" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:661: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:661" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:661" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1046 -#AT_START_1047 -at_fn_group_banner 1047 'ovsdb-data.at:661' \ - "duplicate string not allowed in JSON set - Python" "" 60 -at_xfail=no -( - $as_echo "1047. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:661" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:661" - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:661: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"string\", \"max\": 5}' '[\"set\", [\"asdf\", \"ASDF\", \"asdf\"]]'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-data '{\"key\": \"string\", \"max\": 5}' '[\"set\", [\"asdf\", \"ASDF\", \"asdf\"]]'" "ovsdb-data.at:661" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "string", "max": 5}' '["set", ["asdf", "ASDF", "asdf"]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:661" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:661: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:661" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:661" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1047 -#AT_START_1048 -at_fn_group_banner 1048 'ovsdb-data.at:665' \ - "duplicate string not allowed in string set" " " 60 -at_xfail=no -( - $as_echo "1048. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:665: test-ovsdb parse-data-strings '{\"key\": \"string\", \"max\": 5}' 'asdf, ASDF, \"asdf\"'" -at_fn_check_prepare_trace "ovsdb-data.at:665" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "string", "max": 5}' 'asdf, ASDF, "asdf"' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:665" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:665: if grep -F -e \"set contains duplicate value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:665" -( $at_check_trace; if grep -F -e "set contains duplicate value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:665" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1048 -#AT_START_1049 -at_fn_group_banner 1049 'ovsdb-data.at:669' \ - "duplicate uuid not allowed in JSON set - C" " " 60 -at_xfail=no -( - $as_echo "1049. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:669: test-ovsdb parse-data '{\"key\": \"uuid\", \"max\": 5}' \\ - '[\"set\", [[\"uuid\", \"7ef21525-0088-4a28-a418-5518413e43ea\"], - [\"uuid\", \"355ad037-f1da-40aa-b47c-ff9c7e8c6a38\"], - [\"uuid\", \"7ef21525-0088-4a28-a418-5518413e43ea\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:669" -( $at_check_trace; test-ovsdb parse-data '{"key": "uuid", "max": 5}' \ - '["set", [["uuid", "7ef21525-0088-4a28-a418-5518413e43ea"], - ["uuid", "355ad037-f1da-40aa-b47c-ff9c7e8c6a38"], - ["uuid", "7ef21525-0088-4a28-a418-5518413e43ea"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:669" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:669: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:669" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:669" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1049 -#AT_START_1050 -at_fn_group_banner 1050 'ovsdb-data.at:669' \ - "duplicate uuid not allowed in JSON set - Python" "" 60 -at_xfail=no -( - $as_echo "1050. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:669" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:669" - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:669: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"uuid\", \"max\": 5}' \\ - '[\"set\", [[\"uuid\", \"7ef21525-0088-4a28-a418-5518413e43ea\"], - [\"uuid\", \"355ad037-f1da-40aa-b47c-ff9c7e8c6a38\"], - [\"uuid\", \"7ef21525-0088-4a28-a418-5518413e43ea\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:669" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "uuid", "max": 5}' \ - '["set", [["uuid", "7ef21525-0088-4a28-a418-5518413e43ea"], - ["uuid", "355ad037-f1da-40aa-b47c-ff9c7e8c6a38"], - ["uuid", "7ef21525-0088-4a28-a418-5518413e43ea"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:669" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:669: if grep -F -e \"ovsdb error: set contains duplicate\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:669" -( $at_check_trace; if grep -F -e "ovsdb error: set contains duplicate" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:669" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1050 -#AT_START_1051 -at_fn_group_banner 1051 'ovsdb-data.at:676' \ - "duplicate uuid not allowed in string set" " " 60 -at_xfail=no -( - $as_echo "1051. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:676: test-ovsdb parse-data-strings '{\"key\": \"uuid\", \"max\": 5}' \\ - '7ef21525-0088-4a28-a418-5518413e43ea, - 355ad037-f1da-40aa-b47c-ff9c7e8c6a38, - 7ef21525-0088-4a28-a418-5518413e43ea'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:676" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "uuid", "max": 5}' \ - '7ef21525-0088-4a28-a418-5518413e43ea, - 355ad037-f1da-40aa-b47c-ff9c7e8c6a38, - 7ef21525-0088-4a28-a418-5518413e43ea' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:676" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:676: if grep -F -e \"set contains duplicate value\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:676" -( $at_check_trace; if grep -F -e "set contains duplicate value" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:676" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1051 -#AT_START_1052 -at_fn_group_banner 1052 'ovsdb-data.at:685' \ - "JSON map of 1 integer to boolean - C" " " 61 -at_xfail=no -( - $as_echo "1052. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:685: test-ovsdb parse-data '{\"key\": \"integer\", \"value\": \"boolean\"}' \\ - '[\"map\", [[1, true]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:685" -( $at_check_trace; test-ovsdb parse-data '{"key": "integer", "value": "boolean"}' \ - '["map", [[1, true]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[1,true]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:685" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1052 -#AT_START_1053 -at_fn_group_banner 1053 'ovsdb-data.at:685' \ - "JSON map of 1 integer to boolean - Python" " " 61 -at_xfail=no -( - $as_echo "1053. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:685" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:685" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:685: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"integer\", \"value\": \"boolean\"}' \\ - '[\"map\", [[1, true]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:685" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "integer", "value": "boolean"}' \ - '["map", [[1, true]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[1,true]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:685" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1053 -#AT_START_1054 -at_fn_group_banner 1054 'ovsdb-data.at:690' \ - "string map of 1 integer to boolean" " " 61 -at_xfail=no -( - $as_echo "1054. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:690: test-ovsdb parse-data-strings '{\"key\": \"integer\", \"value\": \"boolean\"}' \\ - '1=true'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:690" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "integer", "value": "boolean"}' \ - '1=true' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1=true -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:690" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1054 -#AT_START_1055 -at_fn_group_banner 1055 'ovsdb-data.at:695' \ - "JSON map of at least 1 integer to boolean - C" " " 61 -at_xfail=no -( - $as_echo "1055. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:695: test-ovsdb parse-data '{\"key\": \"integer\", \"value\": \"boolean\", \"max\": \"unlimited\"}' \\ - '[\"map\", [[1, true]]]' \\ - '[\"map\", [[0, true], [1, false], [2, true], [3, true], [4, true]]]' \\ - '[\"map\", [[3, false], [0, true], [4, false]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:695" -( $at_check_trace; test-ovsdb parse-data '{"key": "integer", "value": "boolean", "max": "unlimited"}' \ - '["map", [[1, true]]]' \ - '["map", [[0, true], [1, false], [2, true], [3, true], [4, true]]]' \ - '["map", [[3, false], [0, true], [4, false]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[1,true]]] -[\"map\",[[0,true],[1,false],[2,true],[3,true],[4,true]]] -[\"map\",[[0,true],[3,false],[4,false]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:695" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1055 -#AT_START_1056 -at_fn_group_banner 1056 'ovsdb-data.at:695' \ - "JSON map of at least 1 integer to boolean - Python" "" 61 -at_xfail=no -( - $as_echo "1056. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:695" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:695" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:695: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"integer\", \"value\": \"boolean\", \"max\": \"unlimited\"}' \\ - '[\"map\", [[1, true]]]' \\ - '[\"map\", [[0, true], [1, false], [2, true], [3, true], [4, true]]]' \\ - '[\"map\", [[3, false], [0, true], [4, false]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:695" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "integer", "value": "boolean", "max": "unlimited"}' \ - '["map", [[1, true]]]' \ - '["map", [[0, true], [1, false], [2, true], [3, true], [4, true]]]' \ - '["map", [[3, false], [0, true], [4, false]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[1,true]]] -[\"map\",[[0,true],[1,false],[2,true],[3,true],[4,true]]] -[\"map\",[[0,true],[3,false],[4,false]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:695" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1056 -#AT_START_1057 -at_fn_group_banner 1057 'ovsdb-data.at:704' \ - "string map of at least 1 integer to boolean" " " 61 -at_xfail=no -( - $as_echo "1057. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:704: test-ovsdb parse-data-strings '{\"key\": \"integer\", \"value\": \"boolean\", \"max\": \"unlimited\"}' \\ - '1=true' \\ - '0=true 1=false 2=true, 3=true 4=true,' \\ - '3=false,0=true ,4=false'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:704" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "integer", "value": "boolean", "max": "unlimited"}' \ - '1=true' \ - '0=true 1=false 2=true, 3=true 4=true,' \ - '3=false,0=true ,4=false' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{1=true} -{0=true, 1=false, 2=true, 3=true, 4=true} -{0=true, 3=false, 4=false} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:704" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1057 -#AT_START_1058 -at_fn_group_banner 1058 'ovsdb-data.at:713' \ - "JSON map of 1 boolean to integer - C" " " 61 -at_xfail=no -( - $as_echo "1058. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:713: test-ovsdb parse-data '{\"key\": \"boolean\", \"value\": \"integer\"}' \\ - '[\"map\", [[true, 1]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:713" -( $at_check_trace; test-ovsdb parse-data '{"key": "boolean", "value": "integer"}' \ - '["map", [[true, 1]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[true,1]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:713" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1058 -#AT_START_1059 -at_fn_group_banner 1059 'ovsdb-data.at:713' \ - "JSON map of 1 boolean to integer - Python" " " 61 -at_xfail=no -( - $as_echo "1059. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:713" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:713" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:713: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"boolean\", \"value\": \"integer\"}' \\ - '[\"map\", [[true, 1]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:713" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "boolean", "value": "integer"}' \ - '["map", [[true, 1]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[true,1]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:713" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1059 -#AT_START_1060 -at_fn_group_banner 1060 'ovsdb-data.at:718' \ - "string map of 1 boolean to integer" " " 61 -at_xfail=no -( - $as_echo "1060. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:718: test-ovsdb parse-data-strings '{\"key\": \"boolean\", \"value\": \"integer\"}' \\ - 'true=1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:718" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "boolean", "value": "integer"}' \ - 'true=1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "true=1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:718" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1060 -#AT_START_1061 -at_fn_group_banner 1061 'ovsdb-data.at:723' \ - "JSON map of 1 uuid to real - C" " " 61 -at_xfail=no -( - $as_echo "1061. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:723: test-ovsdb parse-data '{\"key\": \"uuid\", \"value\": \"real\", \"min\": 1, \"max\": 5}' \\ - '[\"map\", [[[\"uuid\", \"cad8542b-6ee1-486b-971b-7dcbf6e14979\"], 1.0], - [[\"uuid\", \"6b94b968-2702-4f64-9457-314a34d69b8c\"], 2.0], - [[\"uuid\", \"d2c4a168-24de-47eb-a8a3-c1abfc814979\"], 3.0], - [[\"uuid\", \"25bfa475-d072-4f60-8be1-00f48643e9cb\"], 4.0], - [[\"uuid\", \"1c92b8ca-d5e4-4628-a85d-1dc2d099a99a\"], 5.0]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:723" -( $at_check_trace; test-ovsdb parse-data '{"key": "uuid", "value": "real", "min": 1, "max": 5}' \ - '["map", [[["uuid", "cad8542b-6ee1-486b-971b-7dcbf6e14979"], 1.0], - [["uuid", "6b94b968-2702-4f64-9457-314a34d69b8c"], 2.0], - [["uuid", "d2c4a168-24de-47eb-a8a3-c1abfc814979"], 3.0], - [["uuid", "25bfa475-d072-4f60-8be1-00f48643e9cb"], 4.0], - [["uuid", "1c92b8ca-d5e4-4628-a85d-1dc2d099a99a"], 5.0]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[[\"uuid\",\"1c92b8ca-d5e4-4628-a85d-1dc2d099a99a\"],5],[[\"uuid\",\"25bfa475-d072-4f60-8be1-00f48643e9cb\"],4],[[\"uuid\",\"6b94b968-2702-4f64-9457-314a34d69b8c\"],2],[[\"uuid\",\"cad8542b-6ee1-486b-971b-7dcbf6e14979\"],1],[[\"uuid\",\"d2c4a168-24de-47eb-a8a3-c1abfc814979\"],3]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:723" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1061 -#AT_START_1062 -at_fn_group_banner 1062 'ovsdb-data.at:723' \ - "JSON map of 1 uuid to real - Python" " " 61 -at_xfail=no -( - $as_echo "1062. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:723" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:723" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:723: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"uuid\", \"value\": \"real\", \"min\": 1, \"max\": 5}' \\ - '[\"map\", [[[\"uuid\", \"cad8542b-6ee1-486b-971b-7dcbf6e14979\"], 1.0], - [[\"uuid\", \"6b94b968-2702-4f64-9457-314a34d69b8c\"], 2.0], - [[\"uuid\", \"d2c4a168-24de-47eb-a8a3-c1abfc814979\"], 3.0], - [[\"uuid\", \"25bfa475-d072-4f60-8be1-00f48643e9cb\"], 4.0], - [[\"uuid\", \"1c92b8ca-d5e4-4628-a85d-1dc2d099a99a\"], 5.0]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:723" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "uuid", "value": "real", "min": 1, "max": 5}' \ - '["map", [[["uuid", "cad8542b-6ee1-486b-971b-7dcbf6e14979"], 1.0], - [["uuid", "6b94b968-2702-4f64-9457-314a34d69b8c"], 2.0], - [["uuid", "d2c4a168-24de-47eb-a8a3-c1abfc814979"], 3.0], - [["uuid", "25bfa475-d072-4f60-8be1-00f48643e9cb"], 4.0], - [["uuid", "1c92b8ca-d5e4-4628-a85d-1dc2d099a99a"], 5.0]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[[\"uuid\",\"1c92b8ca-d5e4-4628-a85d-1dc2d099a99a\"],5],[[\"uuid\",\"25bfa475-d072-4f60-8be1-00f48643e9cb\"],4],[[\"uuid\",\"6b94b968-2702-4f64-9457-314a34d69b8c\"],2],[[\"uuid\",\"cad8542b-6ee1-486b-971b-7dcbf6e14979\"],1],[[\"uuid\",\"d2c4a168-24de-47eb-a8a3-c1abfc814979\"],3]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:723" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1062 -#AT_START_1063 -at_fn_group_banner 1063 'ovsdb-data.at:732' \ - "string map of 1 uuid to real" " " 61 -at_xfail=no -( - $as_echo "1063. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:732: test-ovsdb parse-data-strings '{\"key\": \"uuid\", \"value\": \"real\", \"min\": 1, \"max\": 5}' \\ - 'cad8542b-6ee1-486b-971b-7dcbf6e14979=1.0, - 6b94b968-2702-4f64-9457-314a34d69b8c=2.0, - d2c4a168-24de-47eb-a8a3-c1abfc814979=3.0, - 25bfa475-d072-4f60-8be1-00f48643e9cb=4.0, - 1c92b8ca-d5e4-4628-a85d-1dc2d099a99a=5.0'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:732" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "uuid", "value": "real", "min": 1, "max": 5}' \ - 'cad8542b-6ee1-486b-971b-7dcbf6e14979=1.0, - 6b94b968-2702-4f64-9457-314a34d69b8c=2.0, - d2c4a168-24de-47eb-a8a3-c1abfc814979=3.0, - 25bfa475-d072-4f60-8be1-00f48643e9cb=4.0, - 1c92b8ca-d5e4-4628-a85d-1dc2d099a99a=5.0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{1c92b8ca-d5e4-4628-a85d-1dc2d099a99a=5, 25bfa475-d072-4f60-8be1-00f48643e9cb=4, 6b94b968-2702-4f64-9457-314a34d69b8c=2, cad8542b-6ee1-486b-971b-7dcbf6e14979=1, d2c4a168-24de-47eb-a8a3-c1abfc814979=3} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:732" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1063 -#AT_START_1064 -at_fn_group_banner 1064 'ovsdb-data.at:741' \ - "JSON map of 10 string to string - C" " " 61 -at_xfail=no -( - $as_echo "1064. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:741: test-ovsdb parse-data '{\"key\": \"string\", \"value\": \"string\", \"min\": 1, \"max\": 10}' \\ - '[\"map\", [[\"2 gills\", \"1 chopin\"], - [\"2 chopins\", \"1 pint\"], - [\"2 pints\", \"1 quart\"], - [\"2 quarts\", \"1 pottle\"], - [\"2 pottles\", \"1 gallon\"], - [\"2 gallons\", \"1 peck\"], - [\"2 pecks\", \"1 demibushel\"], - [\"2 demibushel\", \"1 firkin\"], - [\"2 firkins\", \"1 kilderkin\"], - [\"2 kilderkins\", \"1 barrel\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:741" -( $at_check_trace; test-ovsdb parse-data '{"key": "string", "value": "string", "min": 1, "max": 10}' \ - '["map", [["2 gills", "1 chopin"], - ["2 chopins", "1 pint"], - ["2 pints", "1 quart"], - ["2 quarts", "1 pottle"], - ["2 pottles", "1 gallon"], - ["2 gallons", "1 peck"], - ["2 pecks", "1 demibushel"], - ["2 demibushel", "1 firkin"], - ["2 firkins", "1 kilderkin"], - ["2 kilderkins", "1 barrel"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[\"2 chopins\",\"1 pint\"],[\"2 demibushel\",\"1 firkin\"],[\"2 firkins\",\"1 kilderkin\"],[\"2 gallons\",\"1 peck\"],[\"2 gills\",\"1 chopin\"],[\"2 kilderkins\",\"1 barrel\"],[\"2 pecks\",\"1 demibushel\"],[\"2 pints\",\"1 quart\"],[\"2 pottles\",\"1 gallon\"],[\"2 quarts\",\"1 pottle\"]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:741" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1064 -#AT_START_1065 -at_fn_group_banner 1065 'ovsdb-data.at:741' \ - "JSON map of 10 string to string - Python" " " 61 -at_xfail=no -( - $as_echo "1065. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:741" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:741" - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:741: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"string\", \"value\": \"string\", \"min\": 1, \"max\": 10}' \\ - '[\"map\", [[\"2 gills\", \"1 chopin\"], - [\"2 chopins\", \"1 pint\"], - [\"2 pints\", \"1 quart\"], - [\"2 quarts\", \"1 pottle\"], - [\"2 pottles\", \"1 gallon\"], - [\"2 gallons\", \"1 peck\"], - [\"2 pecks\", \"1 demibushel\"], - [\"2 demibushel\", \"1 firkin\"], - [\"2 firkins\", \"1 kilderkin\"], - [\"2 kilderkins\", \"1 barrel\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:741" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "string", "value": "string", "min": 1, "max": 10}' \ - '["map", [["2 gills", "1 chopin"], - ["2 chopins", "1 pint"], - ["2 pints", "1 quart"], - ["2 quarts", "1 pottle"], - ["2 pottles", "1 gallon"], - ["2 gallons", "1 peck"], - ["2 pecks", "1 demibushel"], - ["2 demibushel", "1 firkin"], - ["2 firkins", "1 kilderkin"], - ["2 kilderkins", "1 barrel"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[\"map\",[[\"2 chopins\",\"1 pint\"],[\"2 demibushel\",\"1 firkin\"],[\"2 firkins\",\"1 kilderkin\"],[\"2 gallons\",\"1 peck\"],[\"2 gills\",\"1 chopin\"],[\"2 kilderkins\",\"1 barrel\"],[\"2 pecks\",\"1 demibushel\"],[\"2 pints\",\"1 quart\"],[\"2 pottles\",\"1 gallon\"],[\"2 quarts\",\"1 pottle\"]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:741" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1065 -#AT_START_1066 -at_fn_group_banner 1066 'ovsdb-data.at:755' \ - "string map of 10 string to string" " " 61 -at_xfail=no -( - $as_echo "1066. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:755: test-ovsdb parse-data-strings '{\"key\": \"string\", \"value\": \"string\", \"min\": 1, \"max\": 10}' \\ - '{\"2 gills\"=\"1 chopin\", - \"2 chopins\"= \"1 pint\", - \"2 pints\"= \"1 quart\", - \"2 quarts\"= \"1 pottle\", - \"2 pottles\"= \"1 gallon\", - \"2 gallons\"= \"1 peck\", - \"2 pecks\"= \"1 demibushel\", - \"2 demibushel\"= \"1 firkin\", - \"2 firkins\"= \"1 kilderkin\", - \"2 kilderkins\"= \"1 barrel\"}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:755" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "string", "value": "string", "min": 1, "max": 10}' \ - '{"2 gills"="1 chopin", - "2 chopins"= "1 pint", - "2 pints"= "1 quart", - "2 quarts"= "1 pottle", - "2 pottles"= "1 gallon", - "2 gallons"= "1 peck", - "2 pecks"= "1 demibushel", - "2 demibushel"= "1 firkin", - "2 firkins"= "1 kilderkin", - "2 kilderkins"= "1 barrel"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"2 chopins\"=\"1 pint\", \"2 demibushel\"=\"1 firkin\", \"2 firkins\"=\"1 kilderkin\", \"2 gallons\"=\"1 peck\", \"2 gills\"=\"1 chopin\", \"2 kilderkins\"=\"1 barrel\", \"2 pecks\"=\"1 demibushel\", \"2 pints\"=\"1 quart\", \"2 pottles\"=\"1 gallon\", \"2 quarts\"=\"1 pottle\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:755" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1066 -#AT_START_1067 -at_fn_group_banner 1067 'ovsdb-data.at:769' \ - "duplicate integer key not allowed in JSON map - C" "" 61 -at_xfail=no -( - $as_echo "1067. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:769: test-ovsdb parse-data '{\"key\": \"integer\", \"value\": \"boolean\", \"max\": 5}' \\ - '[\"map\", [[1, true], [2, false], [1, false]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:769" -( $at_check_trace; test-ovsdb parse-data '{"key": "integer", "value": "boolean", "max": 5}' \ - '["map", [[1, true], [2, false], [1, false]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:769" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:769: if grep -F -e \"ovsdb error: map contains duplicate key\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:769" -( $at_check_trace; if grep -F -e "ovsdb error: map contains duplicate key" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:769" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1067 -#AT_START_1068 -at_fn_group_banner 1068 'ovsdb-data.at:769' \ - "duplicate integer key not allowed in JSON map - Python" "" 61 -at_xfail=no -( - $as_echo "1068. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-data.at:769" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-data.at:769" - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:769: \$PYTHON \$srcdir/test-ovsdb.py parse-data '{\"key\": \"integer\", \"value\": \"boolean\", \"max\": 5}' \\ - '[\"map\", [[1, true], [2, false], [1, false]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:769" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-data '{"key": "integer", "value": "boolean", "max": 5}' \ - '["map", [[1, true], [2, false], [1, false]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:769" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:769: if grep -F -e \"ovsdb error: map contains duplicate key\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:769" -( $at_check_trace; if grep -F -e "ovsdb error: map contains duplicate key" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:769" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1068 -#AT_START_1069 -at_fn_group_banner 1069 'ovsdb-data.at:774' \ - "duplicate integer key not allowed in string map" "" 61 -at_xfail=no -( - $as_echo "1069. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:774: test-ovsdb parse-data-strings '{\"key\": \"integer\", \"value\": \"boolean\", \"max\": 5}' \\ - '1=true 2=false 1=false'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:774" -( $at_check_trace; test-ovsdb parse-data-strings '{"key": "integer", "value": "boolean", "max": 5}' \ - '1=true 2=false 1=false' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-data.at:774" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-data.at:774: if grep -F -e \"map contains duplicate key\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-data.at:774" -( $at_check_trace; if grep -F -e "map contains duplicate key" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-data.at:774" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1069 -#AT_START_1070 -at_fn_group_banner 1070 'ovsdb-column.at:3' \ - "ordinary column - C" " " 62 -at_xfail=no -( - $as_echo "1070. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-column.at:3: test-ovsdb parse-column mycol '{\"type\": \"integer\"}'" -at_fn_check_prepare_trace "ovsdb-column.at:3" -( $at_check_trace; test-ovsdb parse-column mycol '{"type": "integer"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-column.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1070 -#AT_START_1071 -at_fn_group_banner 1071 'ovsdb-column.at:3' \ - "ordinary column - Python" " " 62 -at_xfail=no -( - $as_echo "1071. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-column.at:3" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-column.at:3" - - - { set +x -$as_echo "$at_srcdir/ovsdb-column.at:3: \$PYTHON \$srcdir/test-ovsdb.py parse-column mycol '{\"type\": \"integer\"}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-column mycol '{\"type\": \"integer\"}'" "ovsdb-column.at:3" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-column mycol '{"type": "integer"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"type\":\"integer\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-column.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1071 -#AT_START_1072 -at_fn_group_banner 1072 'ovsdb-column.at:7' \ - "immutable column - C" " " 62 -at_xfail=no -( - $as_echo "1072. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-column.at:7: test-ovsdb parse-column mycol '{\"type\": \"real\", \"mutable\": false}'" -at_fn_check_prepare_trace "ovsdb-column.at:7" -( $at_check_trace; test-ovsdb parse-column mycol '{"type": "real", "mutable": false}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"mutable\":false,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-column.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1072 -#AT_START_1073 -at_fn_group_banner 1073 'ovsdb-column.at:7' \ - "immutable column - Python" " " 62 -at_xfail=no -( - $as_echo "1073. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-column.at:7" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-column.at:7" - - - { set +x -$as_echo "$at_srcdir/ovsdb-column.at:7: \$PYTHON \$srcdir/test-ovsdb.py parse-column mycol '{\"type\": \"real\", \"mutable\": false}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-column mycol '{\"type\": \"real\", \"mutable\": false}'" "ovsdb-column.at:7" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-column mycol '{"type": "real", "mutable": false}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"mutable\":false,\"type\":\"real\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-column.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1073 -#AT_START_1074 -at_fn_group_banner 1074 'ovsdb-column.at:11' \ - "ephemeral column - C" " " 62 -at_xfail=no -( - $as_echo "1074. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-column.at:11: test-ovsdb parse-column mycol '{\"type\": \"uuid\", \"ephemeral\": true}'" -at_fn_check_prepare_trace "ovsdb-column.at:11" -( $at_check_trace; test-ovsdb parse-column mycol '{"type": "uuid", "ephemeral": true}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"ephemeral\":true,\"type\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-column.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1074 -#AT_START_1075 -at_fn_group_banner 1075 'ovsdb-column.at:11' \ - "ephemeral column - Python" " " 62 -at_xfail=no -( - $as_echo "1075. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-column.at:11" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-column.at:11" - - - { set +x -$as_echo "$at_srcdir/ovsdb-column.at:11: \$PYTHON \$srcdir/test-ovsdb.py parse-column mycol '{\"type\": \"uuid\", \"ephemeral\": true}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-column mycol '{\"type\": \"uuid\", \"ephemeral\": true}'" "ovsdb-column.at:11" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-column mycol '{"type": "uuid", "ephemeral": true}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"ephemeral\":true,\"type\":\"uuid\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-column.at:11" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1075 -#AT_START_1076 -at_fn_group_banner 1076 'ovsdb-table.at:3' \ - "non-root table with one column - C" " " 63 -at_xfail=no -( - $as_echo "1076. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:3: test-ovsdb parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}}'" -at_fn_check_prepare_trace "ovsdb-table.at:3" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"name": {"type": "string"}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1076 -#AT_START_1077 -at_fn_group_banner 1077 'ovsdb-table.at:3' \ - "non-root table with one column - Python" " " 63 -at_xfail=no -( - $as_echo "1077. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:3" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:3" - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:3: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}}'" "ovsdb-table.at:3" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"name": {"type": "string"}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1077 -#AT_START_1078 -at_fn_group_banner 1078 'ovsdb-table.at:7' \ - "immutable table with one column - C" " " 63 -at_xfail=no -( - $as_echo "1078. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:7: test-ovsdb parse-table mytable \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"mutable\": false}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:7" -( $at_check_trace; test-ovsdb parse-table mytable \ - '{"columns": {"name": {"type": "string"}}, - "mutable": false}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"mutable\":false} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1078 -#AT_START_1079 -at_fn_group_banner 1079 'ovsdb-table.at:7' \ - "immutable table with one column - Python" " " 63 -at_xfail=no -( - $as_echo "1079. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:7" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:7" - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:7: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"mutable\": false}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:7" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable \ - '{"columns": {"name": {"type": "string"}}, - "mutable": false}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"mutable\":false} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:7" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1079 -#AT_START_1080 -at_fn_group_banner 1080 'ovsdb-table.at:13' \ - "root table with one column - C" " " 63 -at_xfail=no -( - $as_echo "1080. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:13: test-ovsdb parse-table mytable \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"isRoot\": true}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:13" -( $at_check_trace; test-ovsdb parse-table mytable \ - '{"columns": {"name": {"type": "string"}}, - "isRoot": true}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"isRoot\":true} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1080 -#AT_START_1081 -at_fn_group_banner 1081 'ovsdb-table.at:13' \ - "root table with one column - Python" " " 63 -at_xfail=no -( - $as_echo "1081. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:13" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:13" - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:13: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"isRoot\": true}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:13" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable \ - '{"columns": {"name": {"type": "string"}}, - "isRoot": true}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"isRoot\":true} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:13" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1081 -#AT_START_1082 -at_fn_group_banner 1082 'ovsdb-table.at:19' \ - "non-root table with default_is_root=true - C" " " 63 -at_xfail=no -( - $as_echo "1082. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:19: test-ovsdb parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}}' true" -at_fn_check_prepare_trace "ovsdb-table.at:19" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"name": {"type": "string"}}}' true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"isRoot\":false} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1082 -#AT_START_1083 -at_fn_group_banner 1083 'ovsdb-table.at:19' \ - "non-root table with default_is_root=true - Python" "" 63 -at_xfail=no -( - $as_echo "1083. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:19" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:19" - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:19: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}}' true" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}}' true" "ovsdb-table.at:19" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"name": {"type": "string"}}}' true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"isRoot\":false} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1083 -#AT_START_1084 -at_fn_group_banner 1084 'ovsdb-table.at:23' \ - "root table with default_is_root=true - C" " " 63 -at_xfail=no -( - $as_echo "1084. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:23: test-ovsdb parse-table mytable \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"isRoot\": true}' true" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:23" -( $at_check_trace; test-ovsdb parse-table mytable \ - '{"columns": {"name": {"type": "string"}}, - "isRoot": true}' true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1084 -#AT_START_1085 -at_fn_group_banner 1085 'ovsdb-table.at:23' \ - "root table with default_is_root=true - Python" " " 63 -at_xfail=no -( - $as_echo "1085. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:23" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:23" - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:23: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"isRoot\": true}' true" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:23" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable \ - '{"columns": {"name": {"type": "string"}}, - "isRoot": true}' true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:23" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1085 -#AT_START_1086 -at_fn_group_banner 1086 'ovsdb-table.at:29' \ - "table with maxRows of 2 - C" " " 63 -at_xfail=no -( - $as_echo "1086. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:29: test-ovsdb parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"maxRows\": 2}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:29" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"name": {"type": "string"}}, - "maxRows": 2}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"maxRows\":2} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1086 -#AT_START_1087 -at_fn_group_banner 1087 'ovsdb-table.at:29' \ - "table with maxRows of 2 - Python" " " 63 -at_xfail=no -( - $as_echo "1087. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:29" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:29" - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:29: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"maxRows\": 2}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:29" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"name": {"type": "string"}}, - "maxRows": 2}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"name\":{\"type\":\"string\"}},\"maxRows\":2} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1087 -#AT_START_1088 -at_fn_group_banner 1088 'ovsdb-table.at:34' \ - "table with index - C" " " 63 -at_xfail=no -( - $as_echo "1088. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:34: test-ovsdb parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\"}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[\"b\", \"a\"]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:34" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"a": {"type": "integer"}, - "b": {"type": "string"}}, - "indexes": [["b", "a"]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"a\":{\"type\":\"integer\"},\"b\":{\"type\":\"string\"}},\"indexes\":[[\"b\",\"a\"]]} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1088 -#AT_START_1089 -at_fn_group_banner 1089 'ovsdb-table.at:34' \ - "table with index - Python" " " 63 -at_xfail=no -( - $as_echo "1089. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:34" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:34" - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:34: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\"}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[\"b\", \"a\"]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:34" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"a": {"type": "integer"}, - "b": {"type": "string"}}, - "indexes": [["b", "a"]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"columns\":{\"a\":{\"type\":\"integer\"},\"b\":{\"type\":\"string\"}},\"indexes\":[[\"b\",\"a\"]]} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:34" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1089 -#AT_START_1090 -at_fn_group_banner 1090 'ovsdb-table.at:40' \ - "table with syntax error in index - C" " " 63 -at_xfail=no -( - $as_echo "1090. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:40: test-ovsdb parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\"}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[\"b\", \"a\"], [0]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:40" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"a": {"type": "integer"}, - "b": {"type": "string"}}, - "indexes": [["b", "a"], [0]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:40: if grep -F -e \"array of distinct column names expected\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:40" -( $at_check_trace; if grep -F -e "array of distinct column names expected" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1090 -#AT_START_1091 -at_fn_group_banner 1091 'ovsdb-table.at:40' \ - "table with syntax error in index - Python" " " 63 -at_xfail=no -( - $as_echo "1091. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:40" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:40" - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:40: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\"}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[\"b\", \"a\"], [0]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:40" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"a": {"type": "integer"}, - "b": {"type": "string"}}, - "indexes": [["b", "a"], [0]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:40: if grep -F -e \"array of distinct column names expected\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:40" -( $at_check_trace; if grep -F -e "array of distinct column names expected" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:40" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1091 -#AT_START_1092 -at_fn_group_banner 1092 'ovsdb-table.at:46' \ - "table with empty index - C" " " 63 -at_xfail=no -( - $as_echo "1092. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:46: test-ovsdb parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\"}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:46" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"a": {"type": "integer"}, - "b": {"type": "string"}}, - "indexes": [[]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:46: if grep -F -e \"index must have at least one column\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:46" -( $at_check_trace; if grep -F -e "index must have at least one column" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1092 -#AT_START_1093 -at_fn_group_banner 1093 'ovsdb-table.at:46' \ - "table with empty index - Python" " " 63 -at_xfail=no -( - $as_echo "1093. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:46" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:46" - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:46: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\"}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:46" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"a": {"type": "integer"}, - "b": {"type": "string"}}, - "indexes": [[]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:46: if grep -F -e \"index must have at least one column\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:46" -( $at_check_trace; if grep -F -e "index must have at least one column" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1093 -#AT_START_1094 -at_fn_group_banner 1094 'ovsdb-table.at:52' \ - "table with index of ephemeral column - C" " " 63 -at_xfail=no -( - $as_echo "1094. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:52: test-ovsdb parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\", - \"ephemeral\": true}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[\"b\", \"a\"]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:52" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"a": {"type": "integer", - "ephemeral": true}, - "b": {"type": "string"}}, - "indexes": [["b", "a"]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:52" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:52: if grep -F -e \"ephemeral columns (such as a) may not be indexed\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:52" -( $at_check_trace; if grep -F -e "ephemeral columns (such as a) may not be indexed" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:52" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1094 -#AT_START_1095 -at_fn_group_banner 1095 'ovsdb-table.at:52' \ - "table with index of ephemeral column - Python" " " 63 -at_xfail=no -( - $as_echo "1095. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:52" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:52" - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:52: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"a\": {\"type\": \"integer\", - \"ephemeral\": true}, - \"b\": {\"type\": \"string\"}}, - \"indexes\": [[\"b\", \"a\"]]}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:52" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"a": {"type": "integer", - "ephemeral": true}, - "b": {"type": "string"}}, - "indexes": [["b", "a"]]}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:52" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:52: if grep -F -e \"ephemeral columns (such as a) may not be indexed\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:52" -( $at_check_trace; if grep -F -e "ephemeral columns (such as a) may not be indexed" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:52" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1095 -#AT_START_1096 -at_fn_group_banner 1096 'ovsdb-table.at:59' \ - "column names may not begin with _ - C" " " 63 -at_xfail=no -( - $as_echo "1096. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:59: test-ovsdb parse-table mytable \\ - '{\"columns\": {\"_column\": {\"type\": \"integer\"}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:59" -( $at_check_trace; test-ovsdb parse-table mytable \ - '{"columns": {"_column": {"type": "integer"}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:59" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:59: if grep -F -e \"names beginning with \\\"_\\\" are reserved\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:59" -( $at_check_trace; if grep -F -e "names beginning with \"_\" are reserved" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:59" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1096 -#AT_START_1097 -at_fn_group_banner 1097 'ovsdb-table.at:59' \ - "column names may not begin with _ - Python" " " 63 -at_xfail=no -( - $as_echo "1097. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:59" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:59" - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:59: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable \\ - '{\"columns\": {\"_column\": {\"type\": \"integer\"}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:59" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable \ - '{"columns": {"_column": {"type": "integer"}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:59" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:59: if grep -F -e \"names beginning with \\\"_\\\" are reserved\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:59" -( $at_check_trace; if grep -F -e "names beginning with \"_\" are reserved" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:59" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1097 -#AT_START_1098 -at_fn_group_banner 1098 'ovsdb-table.at:65' \ - "table must have at least one column (1) - C" " " 63 -at_xfail=no -( - $as_echo "1098. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:65: test-ovsdb parse-table mytable '{}'" -at_fn_check_prepare_trace "ovsdb-table.at:65" -( $at_check_trace; test-ovsdb parse-table mytable '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:65: if grep -F -e \"Parsing table schema for table mytable failed: Required 'columns' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:65" -( $at_check_trace; if grep -F -e "Parsing table schema for table mytable failed: Required 'columns' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1098 -#AT_START_1099 -at_fn_group_banner 1099 'ovsdb-table.at:65' \ - "table must have at least one column (1) - Python" "" 63 -at_xfail=no -( - $as_echo "1099. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:65" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:65" - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:65: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-table mytable '{}'" "ovsdb-table.at:65" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:65: if grep -F -e \"Parsing table schema for table mytable failed: Required 'columns' member is missing.\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:65" -( $at_check_trace; if grep -F -e "Parsing table schema for table mytable failed: Required 'columns' member is missing." stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1099 -#AT_START_1100 -at_fn_group_banner 1100 'ovsdb-table.at:69' \ - "table must have at least one column (2) - C" " " 63 -at_xfail=no -( - $as_echo "1100. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:69: test-ovsdb parse-table mytable '{\"columns\": {}}'" -at_fn_check_prepare_trace "ovsdb-table.at:69" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:69" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:69: if grep -F -e \"table must have at least one column\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:69" -( $at_check_trace; if grep -F -e "table must have at least one column" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:69" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1100 -#AT_START_1101 -at_fn_group_banner 1101 'ovsdb-table.at:69' \ - "table must have at least one column (2) - Python" "" 63 -at_xfail=no -( - $as_echo "1101. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:69" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:69" - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:69: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {}}'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {}}'" "ovsdb-table.at:69" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:69" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:69: if grep -F -e \"table must have at least one column\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:69" -( $at_check_trace; if grep -F -e "table must have at least one column" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:69" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1101 -#AT_START_1102 -at_fn_group_banner 1102 'ovsdb-table.at:73' \ - "table maxRows must be positive - C" " " 63 -at_xfail=no -( - $as_echo "1102. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:73: test-ovsdb parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"maxRows\": 0}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:73" -( $at_check_trace; test-ovsdb parse-table mytable '{"columns": {"name": {"type": "string"}}, - "maxRows": 0}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:73: if grep -F -e \"syntax \\\"{\\\"columns\\\":{\\\"name\\\":{\\\"type\\\":\\\"string\\\"}},\\\"maxRows\\\":0}\\\": syntax error: maxRows must be at least 1\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:73" -( $at_check_trace; if grep -F -e "syntax \"{\"columns\":{\"name\":{\"type\":\"string\"}},\"maxRows\":0}\": syntax error: maxRows must be at least 1" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1102 -#AT_START_1103 -at_fn_group_banner 1103 'ovsdb-table.at:73' \ - "table maxRows must be positive - Python" " " 63 -at_xfail=no -( - $as_echo "1103. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-table.at:73" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-table.at:73" - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:73: \$PYTHON \$srcdir/test-ovsdb.py parse-table mytable '{\"columns\": {\"name\": {\"type\": \"string\"}}, - \"maxRows\": 0}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:73" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-table mytable '{"columns": {"name": {"type": "string"}}, - "maxRows": 0}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-table.at:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-table.at:73: if grep -F -e \"syntax \\\"{\\\"columns\\\":{\\\"name\\\":{\\\"type\\\":\\\"string\\\"}},\\\"maxRows\\\":0}\\\": syntax error: maxRows must be at least 1\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-table.at:73" -( $at_check_trace; if grep -F -e "syntax \"{\"columns\":{\"name\":{\"type\":\"string\"}},\"maxRows\":0}\": syntax error: maxRows must be at least 1" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-table.at:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1103 -#AT_START_1104 -at_fn_group_banner 1104 'ovsdb-row.at:3' \ - "row with one string column" " " 64 -at_xfail=no -( - $as_echo "1104. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:3: test-ovsdb parse-rows \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}}' \\ - '{\"name\": \"value\"}' \\ - '{\"name\": \"\"}' \\ - '{\"name\": \"longer string with spaces\"}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:3" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": {"name": {"type": "string"}}}' \ - '{"name": "value"}' \ - '{"name": ""}' \ - '{"name": "longer string with spaces"}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"name\":\"value\"} -name -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"name\":\"\"} -name -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"name\":\"longer string with spaces\"} -name -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"name\":\"\"} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1104 -#AT_START_1105 -at_fn_group_banner 1105 'ovsdb-row.at:19' \ - "row with one integer column" " " 64 -at_xfail=no -( - $as_echo "1105. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:19: test-ovsdb parse-rows \\ - '{\"columns\": {\"count\": {\"type\": \"integer\"}}}' \\ - '{\"count\": 1}' \\ - '{\"count\": -1}' \\ - '{\"count\": 2e10}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:19" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": {"count": {"type": "integer"}}}' \ - '{"count": 1}' \ - '{"count": -1}' \ - '{"count": 2e10}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"count\":1} -count -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"count\":-1} -count -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"count\":20000000000} -count -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"count\":0} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:19" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1105 -#AT_START_1106 -at_fn_group_banner 1106 'ovsdb-row.at:35' \ - "row with one real column" " " 64 -at_xfail=no -( - $as_echo "1106. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:35: test-ovsdb parse-rows \\ - '{\"columns\": {\"cost\": {\"type\": \"real\"}}}' \\ - '{\"cost\": 1.0}' \\ - '{\"cost\": -2.0}' \\ - '{\"cost\": 123000}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:35" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": {"cost": {"type": "real"}}}' \ - '{"cost": 1.0}' \ - '{"cost": -2.0}' \ - '{"cost": 123000}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"cost\":1} -cost -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"cost\":-2} -cost -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"cost\":123000} -cost -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"cost\":0} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:35" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1106 -#AT_START_1107 -at_fn_group_banner 1107 'ovsdb-row.at:51' \ - "row with one boolean column" " " 64 -at_xfail=no -( - $as_echo "1107. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:51: test-ovsdb parse-rows \\ - '{\"columns\": {\"feasible\": {\"type\": \"boolean\"}}}' \\ - '{\"feasible\": true}' \\ - '{\"feasible\": false}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:51" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": {"feasible": {"type": "boolean"}}}' \ - '{"feasible": true}' \ - '{"feasible": false}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"feasible\":true} -feasible -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"feasible\":false} -feasible -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"feasible\":false} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:51" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1107 -#AT_START_1108 -at_fn_group_banner 1108 'ovsdb-row.at:64' \ - "row with one uuid column" " " 64 -at_xfail=no -( - $as_echo "1108. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:64: test-ovsdb parse-rows \\ - '{\"columns\": {\"ref\": {\"type\": \"uuid\"}}}' \\ - '{\"ref\": [\"uuid\", \"f707423d-bf5b-48b5-b6c0-797c900ba4b6\"]}' \\ - '{\"ref\": [\"uuid\", \"33583cc5-d2f4-43de-b1ca-8aac14071b51\"]}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:64" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": {"ref": {"type": "uuid"}}}' \ - '{"ref": ["uuid", "f707423d-bf5b-48b5-b6c0-797c900ba4b6"]}' \ - '{"ref": ["uuid", "33583cc5-d2f4-43de-b1ca-8aac14071b51"]}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"ref\":[\"uuid\",\"f707423d-bf5b-48b5-b6c0-797c900ba4b6\"]} -ref -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"ref\":[\"uuid\",\"33583cc5-d2f4-43de-b1ca-8aac14071b51\"]} -ref -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"ref\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:64" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1108 -#AT_START_1109 -at_fn_group_banner 1109 'ovsdb-row.at:77' \ - "row with set of 1 to 2 elements" " " 64 -at_xfail=no -( - $as_echo "1109. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:77: test-ovsdb parse-rows \\ - '{\"columns\": {\"myset\": {\"type\": {\"key\": \"integer\", \"min\": 1, \"max\": 2}}}}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:77" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": {"myset": {"type": {"key": "integer", "min": 1, "max": 2}}}}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"myset\":0} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:77" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1109 -#AT_START_1110 -at_fn_group_banner 1110 'ovsdb-row.at:84' \ - "row with map of 1 to 2 elements" " " 64 -at_xfail=no -( - $as_echo "1110. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:84: test-ovsdb parse-rows \\ - '{\"columns\": {\"mymap\": {\"type\": {\"key\": \"integer\", \"value\": \"uuid\", \"min\": 1, \"max\": 2}}}}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:84" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": {"mymap": {"type": {"key": "integer", "value": "uuid", "min": 1, "max": 2}}}}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"mymap\":[\"map\",[[0,[\"uuid\",\"00000000-0000-0000-0000-000000000000\"]]]]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:84" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1110 -#AT_START_1111 -at_fn_group_banner 1111 'ovsdb-row.at:91' \ - "row with several columns" " " 64 -at_xfail=no -( - $as_echo "1111. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:91: test-ovsdb parse-rows \\ - '{\"columns\": - {\"vswitch\": {\"type\": \"uuid\"}, - \"name\": {\"type\": \"string\"}, - \"datapath_id\": {\"type\": {\"key\": \"string\", \"min\": 0}}, - \"hwaddr\": {\"type\": \"string\"}, - \"mirrors\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}, - \"netflows\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}, - \"controller\": {\"type\": {\"key\": \"uuid\", \"min\": 0}}, - \"listeners\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}, - \"snoops\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '{\"vswitch\": [\"uuid\", \"1a5c7280-0d4c-4e34-9ec7-c772339f7774\"], - \"name\": \"br0\", - \"datapath_id\": \"000ae4256bb0\", - \"hwaddr\": \"00:0a:e4:25:6b:b0\"}' \\ - '{}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:91" -( $at_check_trace; test-ovsdb parse-rows \ - '{"columns": - {"vswitch": {"type": "uuid"}, - "name": {"type": "string"}, - "datapath_id": {"type": {"key": "string", "min": 0}}, - "hwaddr": {"type": "string"}, - "mirrors": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}, - "netflows": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}, - "controller": {"type": {"key": "uuid", "min": 0}}, - "listeners": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}, - "snoops": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \ - '{"vswitch": ["uuid", "1a5c7280-0d4c-4e34-9ec7-c772339f7774"], - "name": "br0", - "datapath_id": "000ae4256bb0", - "hwaddr": "00:0a:e4:25:6b:b0"}' \ - '{}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"controller\":[\"set\",[]],\"datapath_id\":\"000ae4256bb0\",\"hwaddr\":\"00:0a:e4:25:6b:b0\",\"listeners\":[\"set\",[]],\"mirrors\":[\"set\",[]],\"name\":\"br0\",\"netflows\":[\"set\",[]],\"snoops\":[\"set\",[]],\"vswitch\":[\"uuid\",\"1a5c7280-0d4c-4e34-9ec7-c772339f7774\"]} -datapath_id, hwaddr, name, vswitch -{\"_uuid\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"_version\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"],\"controller\":[\"set\",[]],\"datapath_id\":[\"set\",[]],\"hwaddr\":\"\",\"listeners\":[\"set\",[]],\"mirrors\":[\"set\",[]],\"name\":\"\",\"netflows\":[\"set\",[]],\"snoops\":[\"set\",[]],\"vswitch\":[\"uuid\",\"00000000-0000-0000-0000-000000000000\"]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:91" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1111 -#AT_START_1112 -at_fn_group_banner 1112 'ovsdb-row.at:113' \ - "row hashing (scalars)" " " 64 -at_xfail=no -( - $as_echo "1112. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:113: test-ovsdb compare-rows \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[\"null\", {}]' \\ - '[\"i1\", {\"i\": 1}]' \\ - '[\"i2\", {\"i\": 2}]' \\ - '[\"i4\", {\"i\": 4}]' \\ - '[\"i8\", {\"i\": 8}]' \\ - '[\"i16\", {\"i\": 16}]' \\ - '[\"i32\", {\"i\": 32}]' \\ - '[\"i64\", {\"i\": 64}]' \\ - '[\"i128\", {\"i\": 128}]' \\ - '[\"i256\", {\"i\": 256}]' \\ - '[\"null2\", {\"r\": -0}]' \\ - '[\"r123\", {\"r\": 123}]' \\ - '[\"r0.0625\", {\"r\": 0.0625}]' \\ - '[\"r0.125\", {\"r\": 0.125}]' \\ - '[\"r0.25\", {\"r\": 0.25}]' \\ - '[\"r0.5\", {\"r\": 0.5}]' \\ - '[\"r1\", {\"r\": 1}]' \\ - '[\"r2\", {\"r\": 2}]' \\ - '[\"r4\", {\"r\": 4}]' \\ - '[\"r8\", {\"r\": 8}]' \\ - '[\"r16\", {\"r\": 16}]' \\ - '[\"r32\", {\"r\": 32}]' \\ - '[\"null3\", {\"b\": false}]' \\ - '[\"b1\", {\"b\": true}]' \\ - '[\"null4\", {\"s\": \"\"}]' \\ - '[\"s0\", {\"s\": \"a\"}]' \\ - '[\"s1\", {\"s\": \"b\"}]' \\ - '[\"s2\", {\"s\": \"c\"}]' \\ - '[\"s3\", {\"s\": \"d\"}]' \\ - '[\"s4\", {\"s\": \"e\"}]' \\ - '[\"s5\", {\"s\": \"f\"}]' \\ - '[\"s6\", {\"s\": \"g\"}]' \\ - '[\"s7\", {\"s\": \"h\"}]' \\ - '[\"s8\", {\"s\": \"i\"}]' \\ - '[\"s9\", {\"s\": \"j\"}]' \\ - '[\"null5\", {\"u\": [\"uuid\",\"00000000-0000-0000-0000-000000000000\"]}]' \\ - '[\"u1\", {\"u\": [\"uuid\",\"10000000-0000-0000-0000-000000000000\"]}]' \\ - '[\"u2\", {\"u\": [\"uuid\",\"01000000-0000-0000-0000-000000000000\"]}]' \\ - '[\"u3\", {\"u\": [\"uuid\",\"00100000-0000-0000-0000-000000000000\"]}]' \\ - '[\"u4\", {\"u\": [\"uuid\",\"00010000-0000-0000-0000-000000000000\"]}]' \\ - '[\"u5\", {\"u\": [\"uuid\",\"00001000-0000-0000-0000-000000000000\"]}]' \\ - '[\"u6\", {\"u\": [\"uuid\",\"00000100-0000-0000-0000-000000000000\"]}]' \\ - '[\"u7\", {\"u\": [\"uuid\",\"00000010-0000-0000-0000-000000000000\"]}]' \\ - '[\"u8\", {\"u\": [\"uuid\",\"00000001-0000-0000-0000-000000000000\"]}]' \\ - '[\"null6\", {\"u\": [\"uuid\",\"00000000-c6db-4d22-970f-b41fabd20c4b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:113" -( $at_check_trace; test-ovsdb compare-rows \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '["null", {}]' \ - '["i1", {"i": 1}]' \ - '["i2", {"i": 2}]' \ - '["i4", {"i": 4}]' \ - '["i8", {"i": 8}]' \ - '["i16", {"i": 16}]' \ - '["i32", {"i": 32}]' \ - '["i64", {"i": 64}]' \ - '["i128", {"i": 128}]' \ - '["i256", {"i": 256}]' \ - '["null2", {"r": -0}]' \ - '["r123", {"r": 123}]' \ - '["r0.0625", {"r": 0.0625}]' \ - '["r0.125", {"r": 0.125}]' \ - '["r0.25", {"r": 0.25}]' \ - '["r0.5", {"r": 0.5}]' \ - '["r1", {"r": 1}]' \ - '["r2", {"r": 2}]' \ - '["r4", {"r": 4}]' \ - '["r8", {"r": 8}]' \ - '["r16", {"r": 16}]' \ - '["r32", {"r": 32}]' \ - '["null3", {"b": false}]' \ - '["b1", {"b": true}]' \ - '["null4", {"s": ""}]' \ - '["s0", {"s": "a"}]' \ - '["s1", {"s": "b"}]' \ - '["s2", {"s": "c"}]' \ - '["s3", {"s": "d"}]' \ - '["s4", {"s": "e"}]' \ - '["s5", {"s": "f"}]' \ - '["s6", {"s": "g"}]' \ - '["s7", {"s": "h"}]' \ - '["s8", {"s": "i"}]' \ - '["s9", {"s": "j"}]' \ - '["null5", {"u": ["uuid","00000000-0000-0000-0000-000000000000"]}]' \ - '["u1", {"u": ["uuid","10000000-0000-0000-0000-000000000000"]}]' \ - '["u2", {"u": ["uuid","01000000-0000-0000-0000-000000000000"]}]' \ - '["u3", {"u": ["uuid","00100000-0000-0000-0000-000000000000"]}]' \ - '["u4", {"u": ["uuid","00010000-0000-0000-0000-000000000000"]}]' \ - '["u5", {"u": ["uuid","00001000-0000-0000-0000-000000000000"]}]' \ - '["u6", {"u": ["uuid","00000100-0000-0000-0000-000000000000"]}]' \ - '["u7", {"u": ["uuid","00000010-0000-0000-0000-000000000000"]}]' \ - '["u8", {"u": ["uuid","00000001-0000-0000-0000-000000000000"]}]' \ - '["null6", {"u": ["uuid","00000000-c6db-4d22-970f-b41fabd20c4b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "null == null2 -null == null3 -null == null4 -null == null5 -hash(null) == hash(null6) -null2 == null3 -null2 == null4 -null2 == null5 -hash(null2) == hash(null6) -null3 == null4 -null3 == null5 -hash(null3) == hash(null6) -null4 == null5 -hash(null4) == hash(null6) -hash(null5) == hash(null6) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:113" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1112 -#AT_START_1113 -at_fn_group_banner 1113 'ovsdb-row.at:182' \ - "row hashing (sets)" " " 64 -at_xfail=no -( - $as_echo "1113. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:182: test-ovsdb compare-rows \\ - '{\"columns\": - {\"i\": {\"type\": {\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}}, - \"r\": {\"type\": {\"key\": \"real\", \"min\": 0, \"max\": \"unlimited\"}}, - \"b\": {\"type\": {\"key\": \"boolean\", \"min\": 0, \"max\": \"unlimited\"}}, - \"s\": {\"type\": {\"key\": \"string\", \"min\": 0, \"max\": \"unlimited\"}}, - \"u\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[\"null0\", {\"i\": [\"set\", []]}]' \\ - '[\"i0\", {\"i\": [\"set\", [0]]}]' \\ - '[\"i01\", {\"i\": [\"set\", [0, 1]]}]' \\ - '[\"i012\", {\"i\": [\"set\", [0, 1, 2]]}]' \\ - '[\"i021\", {\"i\": [\"set\", [0, 2, 1]]}]' \\ - '[\"i201\", {\"i\": [\"set\", [2, 0, 1]]}]' \\ - '[\"i102\", {\"i\": [\"set\", [1, 0, 2]]}]' \\ - '[\"i120\", {\"i\": [\"set\", [1, 2, 0]]}]' \\ - '[\"i210\", {\"i\": [\"set\", [2, 1, 0]]}]' \\ - '[\"r0\", {\"r\": [\"set\", [0]]}]' \\ - '[\"r01\", {\"r\": [\"set\", [0, 1]]}]' \\ - '[\"r012\", {\"r\": [\"set\", [0, 1, 2]]}]' \\ - '[\"r201\", {\"r\": [\"set\", [2, 0, 1]]}]' \\ - '[\"null1\", {\"b\": [\"set\", []]}]' \\ - '[\"b0\", {\"b\": [\"set\", [false]]}]' \\ - '[\"b1\", {\"b\": [\"set\", [true]]}]' \\ - '[\"b01\", {\"b\": [\"set\", [false, true]]}]' \\ - '[\"b10\", {\"b\": [\"set\", [true, false]]}]' \\ - '[\"null2\", {\"s\": [\"set\", []]}]' \\ - '[\"sa\", {\"s\": [\"set\", [\"a\"]]}]' \\ - '[\"sb\", {\"s\": [\"set\", [\"b\"]]}]' \\ - '[\"sab\", {\"s\": [\"set\", [\"a\", \"b\"]]}]' \\ - '[\"sba\", {\"s\": [\"set\", [\"b\", \"a\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:182" -( $at_check_trace; test-ovsdb compare-rows \ - '{"columns": - {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}, - "r": {"type": {"key": "real", "min": 0, "max": "unlimited"}}, - "b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}, - "s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}, - "u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \ - '["null0", {"i": ["set", []]}]' \ - '["i0", {"i": ["set", [0]]}]' \ - '["i01", {"i": ["set", [0, 1]]}]' \ - '["i012", {"i": ["set", [0, 1, 2]]}]' \ - '["i021", {"i": ["set", [0, 2, 1]]}]' \ - '["i201", {"i": ["set", [2, 0, 1]]}]' \ - '["i102", {"i": ["set", [1, 0, 2]]}]' \ - '["i120", {"i": ["set", [1, 2, 0]]}]' \ - '["i210", {"i": ["set", [2, 1, 0]]}]' \ - '["r0", {"r": ["set", [0]]}]' \ - '["r01", {"r": ["set", [0, 1]]}]' \ - '["r012", {"r": ["set", [0, 1, 2]]}]' \ - '["r201", {"r": ["set", [2, 0, 1]]}]' \ - '["null1", {"b": ["set", []]}]' \ - '["b0", {"b": ["set", [false]]}]' \ - '["b1", {"b": ["set", [true]]}]' \ - '["b01", {"b": ["set", [false, true]]}]' \ - '["b10", {"b": ["set", [true, false]]}]' \ - '["null2", {"s": ["set", []]}]' \ - '["sa", {"s": ["set", ["a"]]}]' \ - '["sb", {"s": ["set", ["b"]]}]' \ - '["sab", {"s": ["set", ["a", "b"]]}]' \ - '["sba", {"s": ["set", ["b", "a"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "null0 == null1 -null0 == null2 -i012 == i021 -i012 == i201 -i012 == i102 -i012 == i120 -i012 == i210 -i021 == i201 -i021 == i102 -i021 == i120 -i021 == i210 -i201 == i102 -i201 == i120 -i201 == i210 -i102 == i120 -i102 == i210 -i120 == i210 -r012 == r201 -null1 == null2 -b01 == b10 -sab == sba -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1113 -#AT_START_1114 -at_fn_group_banner 1114 'ovsdb-row.at:235' \ - "row hashing (maps)" " " 64 -at_xfail=no -( - $as_echo "1114. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-row.at:235: test-ovsdb compare-rows \\ - '{\"columns\": - {\"ii\": {\"type\": {\"key\": \"integer\", \"value\": \"integer\", - \"min\": 0, \"max\": \"unlimited\"}}, - \"rr\": {\"type\": {\"key\": \"real\", \"value\": \"real\", - \"min\": 0, \"max\": \"unlimited\"}}, - \"bb\": {\"type\": {\"key\": \"boolean\", \"value\": \"boolean\", - \"min\": 0, \"max\": \"unlimited\"}}, - \"ss\": {\"type\": {\"key\": \"string\", \"value\": \"string\", - \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[\"null\", {}]' \\ - '[\"ii0\", {\"ii\": [\"map\", [[0, 0]]]}]' \\ - '[\"ii1\", {\"ii\": [\"map\", [[0, 1]]]}]' \\ - '[\"ii00\", {\"ii\": [\"map\", [[0, 0], [1, 0]]]}]' \\ - '[\"ii01\", {\"ii\": [\"map\", [[0, 0], [1, 1]]]}]' \\ - '[\"ii10\", {\"ii\": [\"map\", [[0, 1], [1, 0]]]}]' \\ - '[\"ii11\", {\"ii\": [\"map\", [[0, 1], [1, 1]]]}]' \\ - '[\"rr0\", {\"rr\": [\"map\", [[0, 0]]]}]' \\ - '[\"rr0\", {\"rr\": [\"map\", [[0, 1]]]}]' \\ - '[\"rr00\", {\"rr\": [\"map\", [[0, 0], [1, 0]]]}]' \\ - '[\"rr01\", {\"rr\": [\"map\", [[0, 0], [1, 1]]]}]' \\ - '[\"rr10\", {\"rr\": [\"map\", [[0, 1], [1, 0]]]}]' \\ - '[\"rr11\", {\"rr\": [\"map\", [[0, 1], [1, 1]]]}]' \\ - '[\"bb0\", {\"bb\": [\"map\", [[false, false]]]}]' \\ - '[\"bb1\", {\"bb\": [\"map\", [[false, true]]]}]' \\ - '[\"bb00\", {\"bb\": [\"map\", [[false, false], [true, false]]]}]' \\ - '[\"bb01\", {\"bb\": [\"map\", [[false, false], [true, true]]]}]' \\ - '[\"bb10\", {\"bb\": [\"map\", [[false, true], [true, false]]]}]' \\ - '[\"bb11\", {\"bb\": [\"map\", [[false, true], [true, true]]]}]' \\ - '[\"ss0\", {\"ss\": [\"map\", [[\"a\", \"a\"]]]}]' \\ - '[\"ss1\", {\"ss\": [\"map\", [[\"a\", \"b\"]]]}]' \\ - '[\"ss00\", {\"ss\": [\"map\", [[\"a\", \"a\"], [\"b\", \"a\"]]]}]' \\ - '[\"ss01\", {\"ss\": [\"map\", [[\"a\", \"a\"], [\"b\", \"b\"]]]}]' \\ - '[\"ss10\", {\"ss\": [\"map\", [[\"a\", \"b\"], [\"b\", \"a\"]]]}]' \\ - '[\"ss11\", {\"ss\": [\"map\", [[\"a\", \"b\"], [\"b\", \"b\"]]]}]'; echo -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-row.at:235" -( $at_check_trace; test-ovsdb compare-rows \ - '{"columns": - {"ii": {"type": {"key": "integer", "value": "integer", - "min": 0, "max": "unlimited"}}, - "rr": {"type": {"key": "real", "value": "real", - "min": 0, "max": "unlimited"}}, - "bb": {"type": {"key": "boolean", "value": "boolean", - "min": 0, "max": "unlimited"}}, - "ss": {"type": {"key": "string", "value": "string", - "min": 0, "max": "unlimited"}}}}' \ - '["null", {}]' \ - '["ii0", {"ii": ["map", [[0, 0]]]}]' \ - '["ii1", {"ii": ["map", [[0, 1]]]}]' \ - '["ii00", {"ii": ["map", [[0, 0], [1, 0]]]}]' \ - '["ii01", {"ii": ["map", [[0, 0], [1, 1]]]}]' \ - '["ii10", {"ii": ["map", [[0, 1], [1, 0]]]}]' \ - '["ii11", {"ii": ["map", [[0, 1], [1, 1]]]}]' \ - '["rr0", {"rr": ["map", [[0, 0]]]}]' \ - '["rr0", {"rr": ["map", [[0, 1]]]}]' \ - '["rr00", {"rr": ["map", [[0, 0], [1, 0]]]}]' \ - '["rr01", {"rr": ["map", [[0, 0], [1, 1]]]}]' \ - '["rr10", {"rr": ["map", [[0, 1], [1, 0]]]}]' \ - '["rr11", {"rr": ["map", [[0, 1], [1, 1]]]}]' \ - '["bb0", {"bb": ["map", [[false, false]]]}]' \ - '["bb1", {"bb": ["map", [[false, true]]]}]' \ - '["bb00", {"bb": ["map", [[false, false], [true, false]]]}]' \ - '["bb01", {"bb": ["map", [[false, false], [true, true]]]}]' \ - '["bb10", {"bb": ["map", [[false, true], [true, false]]]}]' \ - '["bb11", {"bb": ["map", [[false, true], [true, true]]]}]' \ - '["ss0", {"ss": ["map", [["a", "a"]]]}]' \ - '["ss1", {"ss": ["map", [["a", "b"]]]}]' \ - '["ss00", {"ss": ["map", [["a", "a"], ["b", "a"]]]}]' \ - '["ss01", {"ss": ["map", [["a", "a"], ["b", "b"]]]}]' \ - '["ss10", {"ss": ["map", [["a", "b"], ["b", "a"]]]}]' \ - '["ss11", {"ss": ["map", [["a", "b"], ["b", "b"]]]}]'; echo - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-row.at:235" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1114 -#AT_START_1115 -at_fn_group_banner 1115 'ovsdb-schema.at:3' \ - "schema with valid refTables - C" " " 65 -at_xfail=no -( - $as_echo "1115. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:3: test-ovsdb parse-schema \\ - '{\"name\": \"mydb\", - \"version\": \"4.2.1\", - \"tables\": { - \"a\": { - \"columns\": { - \"map\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"b\"}, - \"value\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}, - \"b\": { - \"columns\": { - \"aRef\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:3" -( $at_check_trace; test-ovsdb parse-schema \ - '{"name": "mydb", - "version": "4.2.1", - "tables": { - "a": { - "columns": { - "map": { - "type": { - "key": { - "type": "uuid", - "refTable": "b"}, - "value": { - "type": "uuid", - "refTable": "a"}}}}}, - "b": { - "columns": { - "aRef": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}}}}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"name\":\"mydb\",\"tables\":{\"a\":{\"columns\":{\"map\":{\"type\":{\"key\":{\"refTable\":\"b\",\"type\":\"uuid\"},\"value\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}}},\"b\":{\"columns\":{\"aRef\":{\"type\":{\"key\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}}}},\"version\":\"4.2.1\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1115 -#AT_START_1116 -at_fn_group_banner 1116 'ovsdb-schema.at:3' \ - "schema with valid refTables - Python" " " 65 -at_xfail=no -( - $as_echo "1116. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-schema.at:3" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-schema.at:3" - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:3: \$PYTHON \$srcdir/test-ovsdb.py parse-schema \\ - '{\"name\": \"mydb\", - \"version\": \"4.2.1\", - \"tables\": { - \"a\": { - \"columns\": { - \"map\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"b\"}, - \"value\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}, - \"b\": { - \"columns\": { - \"aRef\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:3" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-schema \ - '{"name": "mydb", - "version": "4.2.1", - "tables": { - "a": { - "columns": { - "map": { - "type": { - "key": { - "type": "uuid", - "refTable": "b"}, - "value": { - "type": "uuid", - "refTable": "a"}}}}}, - "b": { - "columns": { - "aRef": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}}}}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"name\":\"mydb\",\"tables\":{\"a\":{\"columns\":{\"map\":{\"type\":{\"key\":{\"refTable\":\"b\",\"type\":\"uuid\"},\"value\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}}},\"b\":{\"columns\":{\"aRef\":{\"type\":{\"key\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}}}},\"version\":\"4.2.1\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1116 -#AT_START_1117 -at_fn_group_banner 1117 'ovsdb-schema.at:30' \ - "schema with ephemeral strong references - C" " " 65 -at_xfail=no -( - $as_echo "1117. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:30: test-ovsdb parse-schema \\ - '{\"name\": \"mydb\", - \"version\": \"4.2.1\", - \"tables\": { - \"a\": { - \"columns\": { - \"x\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"b\"}}, - \"ephemeral\": true}, - \"y\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}, - \"ephemeral\": true}}}, - \"b\": { - \"columns\": { - \"aRef\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}, - \"isRoot\": true}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:30" -( $at_check_trace; test-ovsdb parse-schema \ - '{"name": "mydb", - "version": "4.2.1", - "tables": { - "a": { - "columns": { - "x": { - "type": { - "key": { - "type": "uuid", - "refTable": "b"}}, - "ephemeral": true}, - "y": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}, - "ephemeral": true}}}, - "b": { - "columns": { - "aRef": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}}}, - "isRoot": true}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"name\":\"mydb\",\"tables\":{\"a\":{\"columns\":{\"x\":{\"ephemeral\":true,\"type\":{\"key\":{\"refTable\":\"b\",\"type\":\"uuid\"}}},\"y\":{\"type\":{\"key\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}}},\"b\":{\"columns\":{\"aRef\":{\"type\":{\"key\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}},\"isRoot\":true}},\"version\":\"4.2.1\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1117 -#AT_START_1118 -at_fn_group_banner 1118 'ovsdb-schema.at:30' \ - "schema with ephemeral strong references - Python" "" 65 -at_xfail=no -( - $as_echo "1118. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-schema.at:30" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-schema.at:30" - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:30: \$PYTHON \$srcdir/test-ovsdb.py parse-schema \\ - '{\"name\": \"mydb\", - \"version\": \"4.2.1\", - \"tables\": { - \"a\": { - \"columns\": { - \"x\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"b\"}}, - \"ephemeral\": true}, - \"y\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}, - \"ephemeral\": true}}}, - \"b\": { - \"columns\": { - \"aRef\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}, - \"isRoot\": true}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:30" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-schema \ - '{"name": "mydb", - "version": "4.2.1", - "tables": { - "a": { - "columns": { - "x": { - "type": { - "key": { - "type": "uuid", - "refTable": "b"}}, - "ephemeral": true}, - "y": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}, - "ephemeral": true}}}, - "b": { - "columns": { - "aRef": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}}}, - "isRoot": true}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"name\":\"mydb\",\"tables\":{\"a\":{\"columns\":{\"x\":{\"ephemeral\":true,\"type\":{\"key\":{\"refTable\":\"b\",\"type\":\"uuid\"}}},\"y\":{\"type\":{\"key\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}}},\"b\":{\"columns\":{\"aRef\":{\"type\":{\"key\":{\"refTable\":\"a\",\"type\":\"uuid\"}}}},\"isRoot\":true}},\"version\":\"4.2.1\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1118 -#AT_START_1119 -at_fn_group_banner 1119 'ovsdb-schema.at:61' \ - "schema without version number - C" " " 65 -at_xfail=no -( - $as_echo "1119. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:61: test-ovsdb parse-schema \\ - '{\"name\": \"mydb\", - \"tables\": { - \"x\": { - \"columns\": { - \"y\": { - \"type\": \"integer\"}}}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:61" -( $at_check_trace; test-ovsdb parse-schema \ - '{"name": "mydb", - "tables": { - "x": { - "columns": { - "y": { - "type": "integer"}}}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"name\":\"mydb\",\"tables\":{\"x\":{\"columns\":{\"y\":{\"type\":\"integer\"}}}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1119 -#AT_START_1120 -at_fn_group_banner 1120 'ovsdb-schema.at:61' \ - "schema without version number - Python" " " 65 -at_xfail=no -( - $as_echo "1120. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-schema.at:61" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-schema.at:61" - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:61: \$PYTHON \$srcdir/test-ovsdb.py parse-schema \\ - '{\"name\": \"mydb\", - \"tables\": { - \"x\": { - \"columns\": { - \"y\": { - \"type\": \"integer\"}}}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:61" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-schema \ - '{"name": "mydb", - "tables": { - "x": { - "columns": { - "y": { - "type": "integer"}}}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"name\":\"mydb\",\"tables\":{\"x\":{\"columns\":{\"y\":{\"type\":\"integer\"}}}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1120 -#AT_START_1121 -at_fn_group_banner 1121 'ovsdb-schema.at:71' \ - "schema with invalid refTables - C" " " 65 -at_xfail=no -( - $as_echo "1121. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:71: test-ovsdb parse-schema \\ - '{\"name\": \"mydb\", - \"tables\": { - \"a\": { - \"columns\": { - \"map\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"c\"}, - \"value\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}, - \"b\": { - \"columns\": { - \"aRef\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:71" -( $at_check_trace; test-ovsdb parse-schema \ - '{"name": "mydb", - "tables": { - "a": { - "columns": { - "map": { - "type": { - "key": { - "type": "uuid", - "refTable": "c"}, - "value": { - "type": "uuid", - "refTable": "a"}}}}}, - "b": { - "columns": { - "aRef": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}}}}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-schema.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:71: if grep -F -e \"syntax error: column map key refers to undefined table c\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:71" -( $at_check_trace; if grep -F -e "syntax error: column map key refers to undefined table c" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1121 -#AT_START_1122 -at_fn_group_banner 1122 'ovsdb-schema.at:71' \ - "schema with invalid refTables - Python" " " 65 -at_xfail=no -( - $as_echo "1122. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-schema.at:71" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-schema.at:71" - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:71: \$PYTHON \$srcdir/test-ovsdb.py parse-schema \\ - '{\"name\": \"mydb\", - \"tables\": { - \"a\": { - \"columns\": { - \"map\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"c\"}, - \"value\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}, - \"b\": { - \"columns\": { - \"aRef\": { - \"type\": { - \"key\": { - \"type\": \"uuid\", - \"refTable\": \"a\"}}}}}}}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:71" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-schema \ - '{"name": "mydb", - "tables": { - "a": { - "columns": { - "map": { - "type": { - "key": { - "type": "uuid", - "refTable": "c"}, - "value": { - "type": "uuid", - "refTable": "a"}}}}}, - "b": { - "columns": { - "aRef": { - "type": { - "key": { - "type": "uuid", - "refTable": "a"}}}}}}}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-schema.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:71: if grep -F -e \"syntax error: column map key refers to undefined table c\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:71" -( $at_check_trace; if grep -F -e "syntax error: column map key refers to undefined table c" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:71" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1122 -#AT_START_1123 -at_fn_group_banner 1123 'ovsdb-schema.at:94' \ - "schema with invalid version number - C" " " 65 -at_xfail=no -( - $as_echo "1123. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:94: test-ovsdb parse-schema \\ - '{\"name\": \"mydb\", - \"tables\": { - \"x\": { - \"columns\": { - \"y\": { - \"type\": \"integer\"}}}}, - \"version\": \"xxx\"}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:94" -( $at_check_trace; test-ovsdb parse-schema \ - '{"name": "mydb", - "tables": { - "x": { - "columns": { - "y": { - "type": "integer"}}}}, - "version": "xxx"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-schema.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:94: if grep -F -e \"schema version \\\"xxx\\\" not in format x.y.z\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:94" -( $at_check_trace; if grep -F -e "schema version \"xxx\" not in format x.y.z" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1123 -#AT_START_1124 -at_fn_group_banner 1124 'ovsdb-schema.at:94' \ - "schema with invalid version number - Python" " " 65 -at_xfail=no -( - $as_echo "1124. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-schema.at:94" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-schema.at:94" - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:94: \$PYTHON \$srcdir/test-ovsdb.py parse-schema \\ - '{\"name\": \"mydb\", - \"tables\": { - \"x\": { - \"columns\": { - \"y\": { - \"type\": \"integer\"}}}}, - \"version\": \"xxx\"}'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:94" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py parse-schema \ - '{"name": "mydb", - "tables": { - "x": { - "columns": { - "y": { - "type": "integer"}}}}, - "version": "xxx"}' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-schema.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-schema.at:94: if grep -F -e \"schema version \\\"xxx\\\" not in format x.y.z\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-schema.at:94" -( $at_check_trace; if grep -F -e "schema version \"xxx\" not in format x.y.z" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-schema.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1124 -#AT_START_1125 -at_fn_group_banner 1125 'ovsdb-condition.at:3' \ - "null condition" " " 66 -at_xfail=no -( - $as_echo "1125. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:3: test-ovsdb parse-conditions \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}}' \\ - '[]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:3" -( $at_check_trace; test-ovsdb parse-conditions \ - '{"columns": {"name": {"type": "string"}}}' \ - '[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1125 -#AT_START_1126 -at_fn_group_banner 1126 'ovsdb-condition.at:9' \ - "conditions on scalars" " " 66 -at_xfail=no -( - $as_echo "1126. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:9: test-ovsdb parse-conditions \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[[\"i\", \"==\", 0]]' \\ - '[[\"i\", \"!=\", 1]]' \\ - '[[\"i\", \"<\", 2]]' \\ - '[[\"i\", \"<=\", 3]]' \\ - '[[\"i\", \">\", 4]]' \\ - '[[\"i\", \">=\", 5]]' \\ - '[[\"i\", \"includes\", 6]]' \\ - '[[\"i\", \"excludes\", 7]]' \\ - '[[\"r\", \"==\", 0.5]]' \\ - '[[\"r\", \"!=\", 1.5]]' \\ - '[[\"r\", \"<\", 2.5]]' \\ - '[[\"r\", \"<=\", 3.5]]' \\ - '[[\"r\", \">\", 4.5]]' \\ - '[[\"r\", \">=\", 5.5]]' \\ - '[[\"r\", \"includes\", 6.5]]' \\ - '[[\"r\", \"excludes\", 7.5]]' \\ - '[[\"b\", \"==\", true]]' \\ - '[[\"b\", \"!=\", false]]' \\ - '[[\"b\", \"includes\", false]]' \\ - '[[\"b\", \"excludes\", true]]' \\ - '[[\"s\", \"==\", \"a\"]]' \\ - '[[\"s\", \"!=\", \"b\"]]' \\ - '[[\"s\", \"includes\", \"c\"]]' \\ - '[[\"s\", \"excludes\", \"d\"]]' \\ - '[[\"u\", \"==\", [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]' \\ - '[[\"u\", \"!=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]' \\ - '[[\"u\", \"includes\", [\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]]' \\ - '[[\"u\", \"excludes\", [\"uuid\", \"62315898-64e0-40b9-b26f-ff74225303e6\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:9" -( $at_check_trace; test-ovsdb parse-conditions \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '[["i", "==", 0]]' \ - '[["i", "!=", 1]]' \ - '[["i", "<", 2]]' \ - '[["i", "<=", 3]]' \ - '[["i", ">", 4]]' \ - '[["i", ">=", 5]]' \ - '[["i", "includes", 6]]' \ - '[["i", "excludes", 7]]' \ - '[["r", "==", 0.5]]' \ - '[["r", "!=", 1.5]]' \ - '[["r", "<", 2.5]]' \ - '[["r", "<=", 3.5]]' \ - '[["r", ">", 4.5]]' \ - '[["r", ">=", 5.5]]' \ - '[["r", "includes", 6.5]]' \ - '[["r", "excludes", 7.5]]' \ - '[["b", "==", true]]' \ - '[["b", "!=", false]]' \ - '[["b", "includes", false]]' \ - '[["b", "excludes", true]]' \ - '[["s", "==", "a"]]' \ - '[["s", "!=", "b"]]' \ - '[["s", "includes", "c"]]' \ - '[["s", "excludes", "d"]]' \ - '[["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \ - '[["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ - '[["u", "includes", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \ - '[["u", "excludes", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[[\"i\",\"==\",0]] -[[\"i\",\"!=\",1]] -[[\"i\",\"<\",2]] -[[\"i\",\"<=\",3]] -[[\"i\",\">\",4]] -[[\"i\",\">=\",5]] -[[\"i\",\"includes\",6]] -[[\"i\",\"excludes\",7]] -[[\"r\",\"==\",0.5]] -[[\"r\",\"!=\",1.5]] -[[\"r\",\"<\",2.5]] -[[\"r\",\"<=\",3.5]] -[[\"r\",\">\",4.5]] -[[\"r\",\">=\",5.5]] -[[\"r\",\"includes\",6.5]] -[[\"r\",\"excludes\",7.5]] -[[\"b\",\"==\",true]] -[[\"b\",\"!=\",false]] -[[\"b\",\"includes\",false]] -[[\"b\",\"excludes\",true]] -[[\"s\",\"==\",\"a\"]] -[[\"s\",\"!=\",\"b\"]] -[[\"s\",\"includes\",\"c\"]] -[[\"s\",\"excludes\",\"d\"]] -[[\"u\",\"==\",[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]] -[[\"u\",\"!=\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]] -[[\"u\",\"includes\",[\"uuid\",\"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]] -[[\"u\",\"excludes\",[\"uuid\",\"62315898-64e0-40b9-b26f-ff74225303e6\"]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:9" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1126 -#AT_START_1127 -at_fn_group_banner 1127 'ovsdb-condition.at:75' \ - "disallowed conditions on scalars" " " 66 -at_xfail=no -( - $as_echo "1127. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ovsdb-condition.at:77: test-ovsdb parse-conditions \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[[\"b\", \">\", true]]' \\ - '[[\"b\", \">=\", false]]' \\ - '[[\"b\", \"<\", false]]' \\ - '[[\"b\", \"<=\", false]]' \\ - '[[\"s\", \">\", \"a\"]]' \\ - '[[\"s\", \">=\", \"b\"]]' \\ - '[[\"s\", \"<\", \"c\"]]' \\ - '[[\"s\", \"<=\", \"d\"]]' \\ - '[[\"u\", \">\", [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]' \\ - '[[\"u\", \">=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]' \\ - '[[\"u\", \"<\", [\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]]' \\ - '[[\"u\", \"<=\", [\"uuid\", \"62315898-64e0-40b9-b26f-ff74225303e6\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:77" -( $at_check_trace; test-ovsdb parse-conditions \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '[["b", ">", true]]' \ - '[["b", ">=", false]]' \ - '[["b", "<", false]]' \ - '[["b", "<=", false]]' \ - '[["s", ">", "a"]]' \ - '[["s", ">=", "b"]]' \ - '[["s", "<", "c"]]' \ - '[["s", "<=", "d"]]' \ - '[["u", ">", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \ - '[["u", ">=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ - '[["u", "<", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \ - '[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test-ovsdb: syntax \"[\"b\",\">\",true]\": syntax error: Type mismatch: \">\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\">=\",false]\": syntax error: Type mismatch: \">=\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"<\",false]\": syntax error: Type mismatch: \"<\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"<=\",false]\": syntax error: Type mismatch: \"<=\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"s\",\">\",\"a\"]\": syntax error: Type mismatch: \">\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\">=\",\"b\"]\": syntax error: Type mismatch: \">=\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"<\",\"c\"]\": syntax error: Type mismatch: \"<\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"<=\",\"d\"]\": syntax error: Type mismatch: \"<=\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"u\",\">\",[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]\": syntax error: Type mismatch: \">\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\">=\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]\": syntax error: Type mismatch: \">=\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\"<\",[\"uuid\",\"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]\": syntax error: Type mismatch: \"<\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\"<=\",[\"uuid\",\"62315898-64e0-40b9-b26f-ff74225303e6\"]]\": syntax error: Type mismatch: \"<=\" operator may not be applied to column u of type uuid. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-condition.at:77" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1127 -#AT_START_1128 -at_fn_group_banner 1128 'ovsdb-condition.at:112' \ - "conditions on sets" " " 66 -at_xfail=no -( - $as_echo "1128. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:112: test-ovsdb parse-conditions \\ - '{\"columns\": - {\"i\": {\"type\": {\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}}, - \"r\": {\"type\": {\"key\": \"real\", \"min\": 0, \"max\": \"unlimited\"}}, - \"b\": {\"type\": {\"key\": \"boolean\", \"min\": 0, \"max\": \"unlimited\"}}, - \"s\": {\"type\": {\"key\": \"string\", \"min\": 0, \"max\": \"unlimited\"}}, - \"u\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[\"i\", \"==\", [\"set\", []]]]' \\ - '[[\"i\", \"!=\", [\"set\", [1]]]]' \\ - '[[\"i\", \"includes\", [\"set\", [1, 2]]]]' \\ - '[[\"i\", \"excludes\", [\"set\", [1, 2, 3]]]]' \\ - '[[\"r\", \"==\", [\"set\", []]]]' \\ - '[[\"r\", \"!=\", [\"set\", [1.5]]]]' \\ - '[[\"r\", \"includes\", [\"set\", [1.5, 2.5]]]]' \\ - '[[\"r\", \"excludes\", [\"set\", [1.5, 2.5, 3.5]]]]' \\ - '[[\"b\", \"==\", [\"set\", [true]]]]' \\ - '[[\"b\", \"!=\", [\"set\", [false]]]]' \\ - '[[\"b\", \"includes\", [\"set\", [false]]]]' \\ - '[[\"b\", \"excludes\", [\"set\", [true, false]]]]' \\ - '[[\"s\", \"==\", [\"set\", [\"a\"]]]]' \\ - '[[\"s\", \"!=\", [\"set\", [\"a\", \"b\"]]]]' \\ - '[[\"s\", \"includes\", [\"set\", [\"c\"]]]]' \\ - '[[\"s\", \"excludes\", [\"set\", [\"c\", \"d\"]]]]' \\ - '[[\"u\", \"==\", - [\"set\", [[\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]]]' \\ - '[[\"u\", \"==\", - [\"set\", [[\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"], - [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]]]' \\ - '[[\"u\", \"includes\", - [\"set\", [[\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"], - [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"], - [\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]]]]' \\ - '[[\"u\", \"excludes\", - [\"set\", [[\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"], - [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"], - [\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"], - [\"uuid\", \"62315898-64e0-40b9-b26f-ff74225303e6\"]]]]]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:112" -( $at_check_trace; test-ovsdb parse-conditions \ - '{"columns": - {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}, - "r": {"type": {"key": "real", "min": 0, "max": "unlimited"}}, - "b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}, - "s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}, - "u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \ - '[["i", "==", ["set", []]]]' \ - '[["i", "!=", ["set", [1]]]]' \ - '[["i", "includes", ["set", [1, 2]]]]' \ - '[["i", "excludes", ["set", [1, 2, 3]]]]' \ - '[["r", "==", ["set", []]]]' \ - '[["r", "!=", ["set", [1.5]]]]' \ - '[["r", "includes", ["set", [1.5, 2.5]]]]' \ - '[["r", "excludes", ["set", [1.5, 2.5, 3.5]]]]' \ - '[["b", "==", ["set", [true]]]]' \ - '[["b", "!=", ["set", [false]]]]' \ - '[["b", "includes", ["set", [false]]]]' \ - '[["b", "excludes", ["set", [true, false]]]]' \ - '[["s", "==", ["set", ["a"]]]]' \ - '[["s", "!=", ["set", ["a", "b"]]]]' \ - '[["s", "includes", ["set", ["c"]]]]' \ - '[["s", "excludes", ["set", ["c", "d"]]]]' \ - '[["u", "==", - ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]' \ - '[["u", "==", - ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], - ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]]]' \ - '[["u", "includes", - ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], - ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"], - ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]]]' \ - '[["u", "excludes", - ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], - ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"], - ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"], - ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]]]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[[\"i\",\"==\",[\"set\",[]]]] -[[\"i\",\"!=\",1]] -[[\"i\",\"includes\",[\"set\",[1,2]]]] -[[\"i\",\"excludes\",[\"set\",[1,2,3]]]] -[[\"r\",\"==\",[\"set\",[]]]] -[[\"r\",\"!=\",1.5]] -[[\"r\",\"includes\",[\"set\",[1.5,2.5]]]] -[[\"r\",\"excludes\",[\"set\",[1.5,2.5,3.5]]]] -[[\"b\",\"==\",true]] -[[\"b\",\"!=\",false]] -[[\"b\",\"includes\",false]] -[[\"b\",\"excludes\",[\"set\",[false,true]]]] -[[\"s\",\"==\",\"a\"]] -[[\"s\",\"!=\",[\"set\",[\"a\",\"b\"]]]] -[[\"s\",\"includes\",\"c\"]] -[[\"s\",\"excludes\",[\"set\",[\"c\",\"d\"]]]] -[[\"u\",\"==\",[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]] -[[\"u\",\"==\",[\"set\",[[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"],[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]]] -[[\"u\",\"includes\",[\"set\",[[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"],[\"uuid\",\"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"],[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]]] -[[\"u\",\"excludes\",[\"set\",[[\"uuid\",\"62315898-64e0-40b9-b26f-ff74225303e6\"],[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"],[\"uuid\",\"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"],[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:112" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1128 -#AT_START_1129 -at_fn_group_banner 1129 'ovsdb-condition.at:173' \ - "condition sorting" " " 66 -at_xfail=no -( - $as_echo "1129. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:173: test-ovsdb parse-conditions \\ - '{\"columns\": {\"i\": {\"type\": \"integer\"}}}' \\ - '[[\"i\", \"excludes\", 7], - [\"i\", \"!=\", 8], - [\"i\", \"==\", 1], - [\"i\", \"includes\", 2], - [\"i\", \"<=\", 3], - [\"i\", \"<\", 4], - [\"i\", \">\", 6], - [\"i\", \">=\", 5], - [\"_uuid\", \"==\", [\"uuid\", \"d50e85c6-8ae7-4b16-b69e-4395928bd9be\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:173" -( $at_check_trace; test-ovsdb parse-conditions \ - '{"columns": {"i": {"type": "integer"}}}' \ - '[["i", "excludes", 7], - ["i", "!=", 8], - ["i", "==", 1], - ["i", "includes", 2], - ["i", "<=", 3], - ["i", "<", 4], - ["i", ">", 6], - ["i", ">=", 5], - ["_uuid", "==", ["uuid", "d50e85c6-8ae7-4b16-b69e-4395928bd9be"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[[\"_uuid\",\"==\",[\"uuid\",\"d50e85c6-8ae7-4b16-b69e-4395928bd9be\"]],[\"i\",\"==\",1],[\"i\",\"includes\",2],[\"i\",\"<=\",3],[\"i\",\"<\",4],[\"i\",\">=\",5],[\"i\",\">\",6],[\"i\",\"excludes\",7],[\"i\",\"!=\",8]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:173" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1129 -#AT_START_1130 -at_fn_group_banner 1130 'ovsdb-condition.at:187' \ - "evaluating null condition" " " 66 -at_xfail=no -( - $as_echo "1130. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:187: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"i\": {\"type\": \"integer\"}}}' \\ - '[[]]' \\ - '[{\"i\": 0}, - {\"i\": 1}, - {\"i\": 2}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:187" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"i": {"type": "integer"}}}' \ - '[[]]' \ - '[{"i": 0}, - {"i": 1}, - {"i": 2}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: TTT -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:187" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1130 -#AT_START_1131 -at_fn_group_banner 1131 'ovsdb-condition.at:196' \ - "evaluating conditions on integers" " " 66 -at_xfail=no -( - $as_echo "1131. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:196: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"i\": {\"type\": \"integer\"}}}' \\ - '[[[\"i\", \"<\", 1]], - [[\"i\", \"<=\", 1]], - [[\"i\", \"==\", 1]], - [[\"i\", \"!=\", 1]], - [[\"i\", \">=\", 1]], - [[\"i\", \">\", 1]], - [[\"i\", \"includes\", 1]], - [[\"i\", \"excludes\", 1]], - [[\"i\", \">\", 0], [\"i\", \"<\", 2]]]' \\ - '[{\"i\": 0}, - {\"i\": 1}, - {\"i\": 2}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:196" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"i": {"type": "integer"}}}' \ - '[[["i", "<", 1]], - [["i", "<=", 1]], - [["i", "==", 1]], - [["i", "!=", 1]], - [["i", ">=", 1]], - [["i", ">", 1]], - [["i", "includes", 1]], - [["i", "excludes", 1]], - [["i", ">", 0], ["i", "<", 2]]]' \ - '[{"i": 0}, - {"i": 1}, - {"i": 2}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T-- -condition 1: TT- -condition 2: -T- -condition 3: T-T -condition 4: -TT -condition 5: --T -condition 6: -T- -condition 7: T-T -condition 8: -T- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:196" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1131 -#AT_START_1132 -at_fn_group_banner 1132 'ovsdb-condition.at:221' \ - "evaluating conditions on reals" " " 66 -at_xfail=no -( - $as_echo "1132. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:221: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"r\": {\"type\": \"real\"}}}' \\ - '[[[\"r\", \"<\", 5.0]], - [[\"r\", \"<=\", 5.0]], - [[\"r\", \"==\", 5.0]], - [[\"r\", \"!=\", 5.0]], - [[\"r\", \">=\", 5.0]], - [[\"r\", \">\", 5.0]], - [[\"r\", \"includes\", 5.0]], - [[\"r\", \"excludes\", 5.0]], - [[\"r\", \"!=\", 0], [\"r\", \"!=\", 5.1]]]' \\ - '[{\"r\": 0}, - {\"r\": 5.0}, - {\"r\": 5.1}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:221" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"r": {"type": "real"}}}' \ - '[[["r", "<", 5.0]], - [["r", "<=", 5.0]], - [["r", "==", 5.0]], - [["r", "!=", 5.0]], - [["r", ">=", 5.0]], - [["r", ">", 5.0]], - [["r", "includes", 5.0]], - [["r", "excludes", 5.0]], - [["r", "!=", 0], ["r", "!=", 5.1]]]' \ - '[{"r": 0}, - {"r": 5.0}, - {"r": 5.1}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T-- -condition 1: TT- -condition 2: -T- -condition 3: T-T -condition 4: -TT -condition 5: --T -condition 6: -T- -condition 7: T-T -condition 8: -T- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1132 -#AT_START_1133 -at_fn_group_banner 1133 'ovsdb-condition.at:246' \ - "evaluating conditions on booleans" " " 66 -at_xfail=no -( - $as_echo "1133. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:246: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"b\": {\"type\": \"boolean\"}}}' \\ - '[[[\"b\", \"==\", true]], - [[\"b\", \"!=\", true]], - [[\"b\", \"includes\", true]], - [[\"b\", \"excludes\", true]], - [[\"b\", \"==\", false]], - [[\"b\", \"!=\", false]], - [[\"b\", \"includes\", false]], - [[\"b\", \"excludes\", false]], - [[\"b\", \"==\", true], [\"b\", \"==\", false]]]' \\ - '[{\"b\": true}, - {\"b\": false}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:246" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"b": {"type": "boolean"}}}' \ - '[[["b", "==", true]], - [["b", "!=", true]], - [["b", "includes", true]], - [["b", "excludes", true]], - [["b", "==", false]], - [["b", "!=", false]], - [["b", "includes", false]], - [["b", "excludes", false]], - [["b", "==", true], ["b", "==", false]]]' \ - '[{"b": true}, - {"b": false}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T- -condition 1: -T -condition 2: T- -condition 3: -T -condition 4: -T -condition 5: T- -condition 6: -T -condition 7: T- -condition 8: -- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:246" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1133 -#AT_START_1134 -at_fn_group_banner 1134 'ovsdb-condition.at:270' \ - "evaluating conditions on strings" " " 66 -at_xfail=no -( - $as_echo "1134. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:270: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"s\": {\"type\": \"string\"}}}' \\ - '[[[\"s\", \"==\", \"\"]], - [[\"s\", \"!=\", \"\"]], - [[\"s\", \"includes\", \"\"]], - [[\"s\", \"excludes\", \"\"]], - [[\"s\", \"==\", \"foo\"]], - [[\"s\", \"!=\", \"foo\"]], - [[\"s\", \"includes\", \"foo\"]], - [[\"s\", \"excludes\", \"foo\"]], - [[\"s\", \"!=\", \"foo\"], [\"s\", \"!=\", \"\"]]]' \\ - '[{\"s\": \"\"}, - {\"s\": \"foo\"}, - {\"s\": \"xxx\"}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:270" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"s": {"type": "string"}}}' \ - '[[["s", "==", ""]], - [["s", "!=", ""]], - [["s", "includes", ""]], - [["s", "excludes", ""]], - [["s", "==", "foo"]], - [["s", "!=", "foo"]], - [["s", "includes", "foo"]], - [["s", "excludes", "foo"]], - [["s", "!=", "foo"], ["s", "!=", ""]]]' \ - '[{"s": ""}, - {"s": "foo"}, - {"s": "xxx"}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T-- -condition 1: -TT -condition 2: T-- -condition 3: -TT -condition 4: -T- -condition 5: T-T -condition 6: -T- -condition 7: T-T -condition 8: --T -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:270" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1134 -#AT_START_1135 -at_fn_group_banner 1135 'ovsdb-condition.at:295' \ - "evaluating conditions on UUIDs" " " 66 -at_xfail=no -( - $as_echo "1135. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:295: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"u\": {\"type\": \"uuid\"}}}' \\ - '[[[\"u\", \"==\", [\"uuid\", \"8a1dbdb8-416f-4ce9-affa-3332691714b6\"]]], - [[\"u\", \"!=\", [\"uuid\", \"8a1dbdb8-416f-4ce9-affa-3332691714b6\"]]], - [[\"u\", \"includes\", [\"uuid\", \"8a1dbdb8-416f-4ce9-affa-3332691714b6\"]]], - [[\"u\", \"excludes\", [\"uuid\", \"8a1dbdb8-416f-4ce9-affa-3332691714b6\"]]], - [[\"u\", \"==\", [\"uuid\", \"06151f9d-62d6-4f59-8504-e9765107faa9\"]]], - [[\"u\", \"!=\", [\"uuid\", \"06151f9d-62d6-4f59-8504-e9765107faa9\"]]], - [[\"u\", \"includes\", [\"uuid\", \"06151f9d-62d6-4f59-8504-e9765107faa9\"]]], - [[\"u\", \"excludes\", [\"uuid\", \"06151f9d-62d6-4f59-8504-e9765107faa9\"]]], - [[\"u\", \"!=\", [\"uuid\", \"06151f9d-62d6-4f59-8504-e9765107faa9\"]], - [\"u\", \"!=\", [\"uuid\", \"cb160ed6-92a6-4503-a6aa-a09a09e01f0d\"]]]]' \\ - '[{\"u\": [\"uuid\", \"8a1dbdb8-416f-4ce9-affa-3332691714b6\"]}, - {\"u\": [\"uuid\", \"06151f9d-62d6-4f59-8504-e9765107faa9\"]}, - {\"u\": [\"uuid\", \"00000000-0000-0000-0000-000000000000\"]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:295" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"u": {"type": "uuid"}}}' \ - '[[["u", "==", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], - [["u", "!=", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], - [["u", "includes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], - [["u", "excludes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], - [["u", "==", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], - [["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], - [["u", "includes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], - [["u", "excludes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], - [["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]], - ["u", "!=", ["uuid", "cb160ed6-92a6-4503-a6aa-a09a09e01f0d"]]]]' \ - '[{"u": ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]}, - {"u": ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]}, - {"u": ["uuid", "00000000-0000-0000-0000-000000000000"]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T-- -condition 1: -TT -condition 2: T-- -condition 3: -TT -condition 4: -T- -condition 5: T-T -condition 6: -T- -condition 7: T-T -condition 8: T-T -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1135 -#AT_START_1136 -at_fn_group_banner 1136 'ovsdb-condition.at:321' \ - "evaluating conditions on sets" " " 66 -at_xfail=no -( - $as_echo "1136. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:321: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[[\"i\", \"==\", [\"set\", []]]], - [[\"i\", \"==\", [\"set\", [0]]]], - [[\"i\", \"==\", [\"set\", [1]]]], - [[\"i\", \"==\", [\"set\", [0, 1]]]], - [[\"i\", \"==\", [\"set\", [2]]]], - [[\"i\", \"==\", [\"set\", [2, 0]]]], - [[\"i\", \"==\", [\"set\", [2, 1]]]], - [[\"i\", \"==\", [\"set\", [2, 1, 0]]]], - [[\"i\", \"!=\", [\"set\", []]]], - [[\"i\", \"!=\", [\"set\", [0]]]], - [[\"i\", \"!=\", [\"set\", [1]]]], - [[\"i\", \"!=\", [\"set\", [0, 1]]]], - [[\"i\", \"!=\", [\"set\", [2]]]], - [[\"i\", \"!=\", [\"set\", [2, 0]]]], - [[\"i\", \"!=\", [\"set\", [2, 1]]]], - [[\"i\", \"!=\", [\"set\", [2, 1, 0]]]], - [[\"i\", \"includes\", [\"set\", []]]], - [[\"i\", \"includes\", [\"set\", [0]]]], - [[\"i\", \"includes\", [\"set\", [1]]]], - [[\"i\", \"includes\", [\"set\", [0, 1]]]], - [[\"i\", \"includes\", [\"set\", [2]]]], - [[\"i\", \"includes\", [\"set\", [2, 0]]]], - [[\"i\", \"includes\", [\"set\", [2, 1]]]], - [[\"i\", \"includes\", [\"set\", [2, 1, 0]]]], - [[\"i\", \"excludes\", [\"set\", []]]], - [[\"i\", \"excludes\", [\"set\", [0]]]], - [[\"i\", \"excludes\", [\"set\", [1]]]], - [[\"i\", \"excludes\", [\"set\", [0, 1]]]], - [[\"i\", \"excludes\", [\"set\", [2]]]], - [[\"i\", \"excludes\", [\"set\", [2, 0]]]], - [[\"i\", \"excludes\", [\"set\", [2, 1]]]], - [[\"i\", \"excludes\", [\"set\", [2, 1, 0]]]], - [[\"i\", \"includes\", [\"set\", [0]]], - [\"i\", \"includes\", [\"set\", [1]]]]]' \\ - '[{\"i\": [\"set\", []]}, - {\"i\": [\"set\", [0]]}, - {\"i\": [\"set\", [1]]}, - {\"i\": [\"set\", [0, 1]]}, - {\"i\": [\"set\", [2]]}, - {\"i\": [\"set\", [2, 0]]}, - {\"i\": [\"set\", [2, 1]]}, - {\"i\": [\"set\", [2, 1, 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:321" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}}}' \ - '[[["i", "==", ["set", []]]], - [["i", "==", ["set", [0]]]], - [["i", "==", ["set", [1]]]], - [["i", "==", ["set", [0, 1]]]], - [["i", "==", ["set", [2]]]], - [["i", "==", ["set", [2, 0]]]], - [["i", "==", ["set", [2, 1]]]], - [["i", "==", ["set", [2, 1, 0]]]], - [["i", "!=", ["set", []]]], - [["i", "!=", ["set", [0]]]], - [["i", "!=", ["set", [1]]]], - [["i", "!=", ["set", [0, 1]]]], - [["i", "!=", ["set", [2]]]], - [["i", "!=", ["set", [2, 0]]]], - [["i", "!=", ["set", [2, 1]]]], - [["i", "!=", ["set", [2, 1, 0]]]], - [["i", "includes", ["set", []]]], - [["i", "includes", ["set", [0]]]], - [["i", "includes", ["set", [1]]]], - [["i", "includes", ["set", [0, 1]]]], - [["i", "includes", ["set", [2]]]], - [["i", "includes", ["set", [2, 0]]]], - [["i", "includes", ["set", [2, 1]]]], - [["i", "includes", ["set", [2, 1, 0]]]], - [["i", "excludes", ["set", []]]], - [["i", "excludes", ["set", [0]]]], - [["i", "excludes", ["set", [1]]]], - [["i", "excludes", ["set", [0, 1]]]], - [["i", "excludes", ["set", [2]]]], - [["i", "excludes", ["set", [2, 0]]]], - [["i", "excludes", ["set", [2, 1]]]], - [["i", "excludes", ["set", [2, 1, 0]]]], - [["i", "includes", ["set", [0]]], - ["i", "includes", ["set", [1]]]]]' \ - '[{"i": ["set", []]}, - {"i": ["set", [0]]}, - {"i": ["set", [1]]}, - {"i": ["set", [0, 1]]}, - {"i": ["set", [2]]}, - {"i": ["set", [2, 0]]}, - {"i": ["set", [2, 1]]}, - {"i": ["set", [2, 1, 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T---- --- -condition 1: -T--- --- -condition 2: --T-- --- -condition 3: ---T- --- -condition 4: ----T --- -condition 5: ----- T-- -condition 6: ----- -T- -condition 7: ----- --T -condition 8: -TTTT TTT -condition 9: T-TTT TTT -condition 10: TT-TT TTT -condition 11: TTT-T TTT -condition 12: TTTT- TTT -condition 13: TTTTT -TT -condition 14: TTTTT T-T -condition 15: TTTTT TT- -condition 16: TTTTT TTT -condition 17: -T-T- T-T -condition 18: --TT- -TT -condition 19: ---T- --T -condition 20: ----T TTT -condition 21: ----- T-T -condition 22: ----- -TT -condition 23: ----- --T -condition 24: TTTTT TTT -condition 25: T-T-T -T- -condition 26: TT--T T-- -condition 27: T---T --- -condition 28: TTTT- --- -condition 29: T-T-- --- -condition 30: TT--- --- -condition 31: T---- --- -condition 32: ---T- --T -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1136 -#AT_START_1137 -at_fn_group_banner 1137 'ovsdb-condition.at:403' \ - "evaluating conditions on maps (1)" " " 66 -at_xfail=no -( - $as_echo "1137. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:403: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", - \"value\": \"boolean\", - \"min\": 0, - \"max\": \"unlimited\"}}}}' \\ - '[[[\"i\", \"==\", [\"map\", []]]], - [[\"i\", \"==\", [\"map\", [[0, true]]]]], - [[\"i\", \"==\", [\"map\", [[1, false]]]]], - [[\"i\", \"==\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", []]]], - [[\"i\", \"!=\", [\"map\", [[0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", []]]], - [[\"i\", \"includes\", [\"map\", [[0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", []]]], - [[\"i\", \"excludes\", [\"map\", [[0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[0, true]]]], - [\"i\", \"includes\", [\"map\", [[1, false]]]]]]' \\ - '[{\"i\": [\"map\", []]}, - {\"i\": [\"map\", [[0, true]]]}, - {\"i\": [\"map\", [[1, false]]]}, - {\"i\": [\"map\", [[0, true], [1, false]]]}, - {\"i\": [\"map\", [[2, true]]]}, - {\"i\": [\"map\", [[2, true], [0, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false]]]}, - {\"i\": [\"map\", [[2, true], [1, false], [0, true]]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:403" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"i": {"type": {"key": "integer", - "value": "boolean", - "min": 0, - "max": "unlimited"}}}}' \ - '[[["i", "==", ["map", []]]], - [["i", "==", ["map", [[0, true]]]]], - [["i", "==", ["map", [[1, false]]]]], - [["i", "==", ["map", [[0, true], [1, false]]]]], - [["i", "==", ["map", [[2, true]]]]], - [["i", "==", ["map", [[2, true], [0, true]]]]], - [["i", "==", ["map", [[2, true], [1, false]]]]], - [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "!=", ["map", []]]], - [["i", "!=", ["map", [[0, true]]]]], - [["i", "!=", ["map", [[1, false]]]]], - [["i", "!=", ["map", [[0, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true]]]]], - [["i", "!=", ["map", [[2, true], [0, true]]]]], - [["i", "!=", ["map", [[2, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "includes", ["map", []]]], - [["i", "includes", ["map", [[0, true]]]]], - [["i", "includes", ["map", [[1, false]]]]], - [["i", "includes", ["map", [[0, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true]]]]], - [["i", "includes", ["map", [[2, true], [0, true]]]]], - [["i", "includes", ["map", [[2, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "excludes", ["map", []]]], - [["i", "excludes", ["map", [[0, true]]]]], - [["i", "excludes", ["map", [[1, false]]]]], - [["i", "excludes", ["map", [[0, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true]]]]], - [["i", "excludes", ["map", [[2, true], [0, true]]]]], - [["i", "excludes", ["map", [[2, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "includes", ["map", [[0, true]]]], - ["i", "includes", ["map", [[1, false]]]]]]' \ - '[{"i": ["map", []]}, - {"i": ["map", [[0, true]]]}, - {"i": ["map", [[1, false]]]}, - {"i": ["map", [[0, true], [1, false]]]}, - {"i": ["map", [[2, true]]]}, - {"i": ["map", [[2, true], [0, true]]]}, - {"i": ["map", [[2, true], [1, false]]]}, - {"i": ["map", [[2, true], [1, false], [0, true]]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T---- --- -condition 1: -T--- --- -condition 2: --T-- --- -condition 3: ---T- --- -condition 4: ----T --- -condition 5: ----- T-- -condition 6: ----- -T- -condition 7: ----- --T -condition 8: -TTTT TTT -condition 9: T-TTT TTT -condition 10: TT-TT TTT -condition 11: TTT-T TTT -condition 12: TTTT- TTT -condition 13: TTTTT -TT -condition 14: TTTTT T-T -condition 15: TTTTT TT- -condition 16: TTTTT TTT -condition 17: -T-T- T-T -condition 18: --TT- -TT -condition 19: ---T- --T -condition 20: ----T TTT -condition 21: ----- T-T -condition 22: ----- -TT -condition 23: ----- --T -condition 24: TTTTT TTT -condition 25: T-T-T -T- -condition 26: TT--T T-- -condition 27: T---T --- -condition 28: TTTT- --- -condition 29: T-T-- --- -condition 30: TT--- --- -condition 31: T---- --- -condition 32: ---T- --T -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:403" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1137 -#AT_START_1138 -at_fn_group_banner 1138 'ovsdb-condition.at:488' \ - "evaluating conditions on maps (2)" " " 66 -at_xfail=no -( - $as_echo "1138. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-condition.at:488: test-ovsdb evaluate-conditions \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", - \"value\": \"boolean\", - \"min\": 0, - \"max\": \"unlimited\"}}}}' \\ - '[[[\"i\", \"==\", [\"map\", []]]], - [[\"i\", \"==\", [\"map\", [[0, true]]]]], - [[\"i\", \"==\", [\"map\", [[1, false]]]]], - [[\"i\", \"==\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", []]]], - [[\"i\", \"!=\", [\"map\", [[0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", []]]], - [[\"i\", \"includes\", [\"map\", [[0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", []]]], - [[\"i\", \"excludes\", [\"map\", [[0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[0, true]]]], - [\"i\", \"includes\", [\"map\", [[1, false]]]]]]' \\ - '[{\"i\": [\"map\", []]}, - {\"i\": [\"map\", [[0, true]]]}, - {\"i\": [\"map\", [[0, false]]]}, - {\"i\": [\"map\", [[1, false]]]}, - {\"i\": [\"map\", [[1, true]]]}, - - {\"i\": [\"map\", [[0, true], [1, false]]]}, - {\"i\": [\"map\", [[0, true], [1, true]]]}, - {\"i\": [\"map\", [[2, true]]]}, - {\"i\": [\"map\", [[2, false]]]}, - {\"i\": [\"map\", [[2, true], [0, true]]]}, - - {\"i\": [\"map\", [[2, false], [0, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false]]]}, - {\"i\": [\"map\", [[2, true], [1, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false], [0, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false], [0, false]]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-condition.at:488" -( $at_check_trace; test-ovsdb evaluate-conditions \ - '{"columns": {"i": {"type": {"key": "integer", - "value": "boolean", - "min": 0, - "max": "unlimited"}}}}' \ - '[[["i", "==", ["map", []]]], - [["i", "==", ["map", [[0, true]]]]], - [["i", "==", ["map", [[1, false]]]]], - [["i", "==", ["map", [[0, true], [1, false]]]]], - [["i", "==", ["map", [[2, true]]]]], - [["i", "==", ["map", [[2, true], [0, true]]]]], - [["i", "==", ["map", [[2, true], [1, false]]]]], - [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "!=", ["map", []]]], - [["i", "!=", ["map", [[0, true]]]]], - [["i", "!=", ["map", [[1, false]]]]], - [["i", "!=", ["map", [[0, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true]]]]], - [["i", "!=", ["map", [[2, true], [0, true]]]]], - [["i", "!=", ["map", [[2, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "includes", ["map", []]]], - [["i", "includes", ["map", [[0, true]]]]], - [["i", "includes", ["map", [[1, false]]]]], - [["i", "includes", ["map", [[0, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true]]]]], - [["i", "includes", ["map", [[2, true], [0, true]]]]], - [["i", "includes", ["map", [[2, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "excludes", ["map", []]]], - [["i", "excludes", ["map", [[0, true]]]]], - [["i", "excludes", ["map", [[1, false]]]]], - [["i", "excludes", ["map", [[0, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true]]]]], - [["i", "excludes", ["map", [[2, true], [0, true]]]]], - [["i", "excludes", ["map", [[2, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "includes", ["map", [[0, true]]]], - ["i", "includes", ["map", [[1, false]]]]]]' \ - '[{"i": ["map", []]}, - {"i": ["map", [[0, true]]]}, - {"i": ["map", [[0, false]]]}, - {"i": ["map", [[1, false]]]}, - {"i": ["map", [[1, true]]]}, - - {"i": ["map", [[0, true], [1, false]]]}, - {"i": ["map", [[0, true], [1, true]]]}, - {"i": ["map", [[2, true]]]}, - {"i": ["map", [[2, false]]]}, - {"i": ["map", [[2, true], [0, true]]]}, - - {"i": ["map", [[2, false], [0, true]]]}, - {"i": ["map", [[2, true], [1, false]]]}, - {"i": ["map", [[2, true], [1, true]]]}, - {"i": ["map", [[2, true], [1, false], [0, true]]]}, - {"i": ["map", [[2, true], [1, false], [0, false]]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "condition 0: T---- ----- ----- -condition 1: -T--- ----- ----- -condition 2: ---T- ----- ----- -condition 3: ----- T---- ----- -condition 4: ----- --T-- ----- -condition 5: ----- ----T ----- -condition 6: ----- ----- -T--- -condition 7: ----- ----- ---T- -condition 8: -TTTT TTTTT TTTTT -condition 9: T-TTT TTTTT TTTTT -condition 10: TTT-T TTTTT TTTTT -condition 11: TTTTT -TTTT TTTTT -condition 12: TTTTT TT-TT TTTTT -condition 13: TTTTT TTTT- TTTTT -condition 14: TTTTT TTTTT T-TTT -condition 15: TTTTT TTTTT TTT-T -condition 16: TTTTT TTTTT TTTTT -condition 17: -T--- TT--T T--T- -condition 18: ---T- T---- -T-TT -condition 19: ----- T---- ---T- -condition 20: ----- --T-T -TTTT -condition 21: ----- ----T ---T- -condition 22: ----- ----- -T-TT -condition 23: ----- ----- ---T- -condition 24: TTTTT TTTTT TTTTT -condition 25: T-TTT --TT- -TT-T -condition 26: TTT-T -TTTT T-T-- -condition 27: T-T-T --TT- --T-- -condition 28: TTTTT TT-T- T---- -condition 29: T-TTT ---T- ----- -condition 30: TTT-T -T-T- T---- -condition 31: T-T-T ---T- ----- -condition 32: ----- T---- ---T- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-condition.at:488" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1138 -#AT_START_1139 -at_fn_group_banner 1139 'ovsdb-mutation.at:3' \ - "null mutation" " " 67 -at_xfail=no -( - $as_echo "1139. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:3: test-ovsdb parse-mutations \\ - '{\"columns\": {\"name\": {\"type\": \"string\"}}}' \\ - '[]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:3" -( $at_check_trace; test-ovsdb parse-mutations \ - '{"columns": {"name": {"type": "string"}}}' \ - '[]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1139 -#AT_START_1140 -at_fn_group_banner 1140 'ovsdb-mutation.at:9' \ - "mutations on scalars" " " 67 -at_xfail=no -( - $as_echo "1140. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:9: test-ovsdb parse-mutations \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[[\"i\", \"+=\", 0]]' \\ - '[[\"i\", \"-=\", 1]]' \\ - '[[\"i\", \"*=\", 2]]' \\ - '[[\"i\", \"/=\", 3]]' \\ - '[[\"i\", \"%=\", 4]]' \\ - '[[\"r\", \"+=\", 0.5]]' \\ - '[[\"r\", \"-=\", 1.5]]' \\ - '[[\"r\", \"*=\", 2.5]]' \\ - '[[\"r\", \"/=\", 3.5]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:9" -( $at_check_trace; test-ovsdb parse-mutations \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '[["i", "+=", 0]]' \ - '[["i", "-=", 1]]' \ - '[["i", "*=", 2]]' \ - '[["i", "/=", 3]]' \ - '[["i", "%=", 4]]' \ - '[["r", "+=", 0.5]]' \ - '[["r", "-=", 1.5]]' \ - '[["r", "*=", 2.5]]' \ - '[["r", "/=", 3.5]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[[\"i\",\"+=\",0]] -[[\"i\",\"-=\",1]] -[[\"i\",\"*=\",2]] -[[\"i\",\"/=\",3]] -[[\"i\",\"%=\",4]] -[[\"r\",\"+=\",0.5]] -[[\"r\",\"-=\",1.5]] -[[\"r\",\"*=\",2.5]] -[[\"r\",\"/=\",3.5]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:9" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1140 -#AT_START_1141 -at_fn_group_banner 1141 'ovsdb-mutation.at:37' \ - "disallowed mutations on scalars" " " 67 -at_xfail=no -( - $as_echo "1141. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:39: test-ovsdb parse-mutations \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[[\"i\", \"xxx\", 1]]' \\ - '[[\"i\", \"insert\", 1]]' \\ - '[[\"i\", \"delete\", 2]]' \\ - '[[\"r\", \"%=\", 0.5]]' \\ - '[[\"r\", \"insert\", 1.5]]' \\ - '[[\"r\", \"delete\", 2.5]]' \\ - '[[\"b\", \"+=\", true]]' \\ - '[[\"b\", \"-=\", false]]' \\ - '[[\"b\", \"*=\", true]]' \\ - '[[\"b\", \"/=\", false]]' \\ - '[[\"b\", \"%=\", true]]' \\ - '[[\"b\", \"insert\", false]]' \\ - '[[\"b\", \"delete\", true]]' \\ - '[[\"s\", \"+=\", \"a\"]]' \\ - '[[\"s\", \"-=\", \"b\"]]' \\ - '[[\"s\", \"*=\", \"c\"]]' \\ - '[[\"s\", \"/=\", \"d\"]]' \\ - '[[\"s\", \"%=\", \"e\"]]' \\ - '[[\"s\", \"insert\", \"f\"]]' \\ - '[[\"s\", \"delete\", \"g\"]]' \\ - '[[\"u\", \"+=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]' \\ - '[[\"u\", \"-=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]' \\ - '[[\"u\", \"*=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]' \\ - '[[\"u\", \"/=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]' \\ - '[[\"u\", \"insert\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]' \\ - '[[\"u\", \"delete\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:39" -( $at_check_trace; test-ovsdb parse-mutations \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '[["i", "xxx", 1]]' \ - '[["i", "insert", 1]]' \ - '[["i", "delete", 2]]' \ - '[["r", "%=", 0.5]]' \ - '[["r", "insert", 1.5]]' \ - '[["r", "delete", 2.5]]' \ - '[["b", "+=", true]]' \ - '[["b", "-=", false]]' \ - '[["b", "*=", true]]' \ - '[["b", "/=", false]]' \ - '[["b", "%=", true]]' \ - '[["b", "insert", false]]' \ - '[["b", "delete", true]]' \ - '[["s", "+=", "a"]]' \ - '[["s", "-=", "b"]]' \ - '[["s", "*=", "c"]]' \ - '[["s", "/=", "d"]]' \ - '[["s", "%=", "e"]]' \ - '[["s", "insert", "f"]]' \ - '[["s", "delete", "g"]]' \ - '[["u", "+=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ - '[["u", "-=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ - '[["u", "*=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ - '[["u", "/=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ - '[["u", "insert", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ - '[["u", "delete", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test-ovsdb: unknown mutator: No mutator named xxx. -test-ovsdb: syntax \"[\"i\",\"insert\",1]\": syntax error: Type mismatch: \"insert\" operator may not be applied to column i of type integer. -test-ovsdb: syntax \"[\"i\",\"delete\",2]\": syntax error: Type mismatch: \"delete\" operator may not be applied to column i of type integer. -test-ovsdb: syntax \"[\"r\",\"%=\",0.5]\": syntax error: Type mismatch: \"%=\" operator may not be applied to column r of type real. -test-ovsdb: syntax \"[\"r\",\"insert\",1.5]\": syntax error: Type mismatch: \"insert\" operator may not be applied to column r of type real. -test-ovsdb: syntax \"[\"r\",\"delete\",2.5]\": syntax error: Type mismatch: \"delete\" operator may not be applied to column r of type real. -test-ovsdb: syntax \"[\"b\",\"+=\",true]\": syntax error: Type mismatch: \"+=\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"-=\",false]\": syntax error: Type mismatch: \"-=\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"*=\",true]\": syntax error: Type mismatch: \"*=\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"/=\",false]\": syntax error: Type mismatch: \"/=\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"%=\",true]\": syntax error: Type mismatch: \"%=\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"insert\",false]\": syntax error: Type mismatch: \"insert\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"b\",\"delete\",true]\": syntax error: Type mismatch: \"delete\" operator may not be applied to column b of type boolean. -test-ovsdb: syntax \"[\"s\",\"+=\",\"a\"]\": syntax error: Type mismatch: \"+=\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"-=\",\"b\"]\": syntax error: Type mismatch: \"-=\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"*=\",\"c\"]\": syntax error: Type mismatch: \"*=\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"/=\",\"d\"]\": syntax error: Type mismatch: \"/=\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"%=\",\"e\"]\": syntax error: Type mismatch: \"%=\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"insert\",\"f\"]\": syntax error: Type mismatch: \"insert\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"s\",\"delete\",\"g\"]\": syntax error: Type mismatch: \"delete\" operator may not be applied to column s of type string. -test-ovsdb: syntax \"[\"u\",\"+=\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]\": syntax error: Type mismatch: \"+=\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\"-=\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]\": syntax error: Type mismatch: \"-=\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\"*=\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]\": syntax error: Type mismatch: \"*=\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\"/=\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]\": syntax error: Type mismatch: \"/=\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\"insert\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]\": syntax error: Type mismatch: \"insert\" operator may not be applied to column u of type uuid. -test-ovsdb: syntax \"[\"u\",\"delete\",[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"]]\": syntax error: Type mismatch: \"delete\" operator may not be applied to column u of type uuid. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-mutation.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1141 -#AT_START_1142 -at_fn_group_banner 1142 'ovsdb-mutation.at:102' \ - "disallowed mutations on immutable columns" " " 67 -at_xfail=no -( - $as_echo "1142. $at_setup_line: testing $at_desc ..." - $at_traceon - - -{ set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:104: test-ovsdb parse-mutations \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\", \"mutable\": false}}}' \\ - '[[\"i\", \"+=\", 1]]' -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:104" -( $at_check_trace; test-ovsdb parse-mutations \ - '{"columns": - {"i": {"type": "integer", "mutable": false}}}' \ - '[["i", "+=", 1]]' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "test-ovsdb: syntax \"[\"i\",\"+=\",1]\": constraint violation: Cannot mutate immutable column i in table mytable. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-mutation.at:104" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1142 -#AT_START_1143 -at_fn_group_banner 1143 'ovsdb-mutation.at:114' \ - "mutations on sets" " " 67 -at_xfail=no -( - $as_echo "1143. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:114: test-ovsdb parse-mutations \\ - '{\"columns\": - {\"i\": {\"type\": {\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}}, - \"r\": {\"type\": {\"key\": \"real\", \"min\": 0, \"max\": \"unlimited\"}}, - \"b\": {\"type\": {\"key\": \"boolean\", \"min\": 0, \"max\": \"unlimited\"}}, - \"s\": {\"type\": {\"key\": \"string\", \"min\": 0, \"max\": \"unlimited\"}}, - \"u\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[\"i\", \"+=\", 1]]' \\ - '[[\"i\", \"-=\", 2]]' \\ - '[[\"i\", \"*=\", 3]]' \\ - '[[\"i\", \"/=\", 4]]' \\ - '[[\"i\", \"%=\", 5]]' \\ - '[[\"i\", \"insert\", [\"set\", [1, 2]]]]' \\ - '[[\"i\", \"delete\", [\"set\", [1, 2, 3]]]]' \\ - '[[\"r\", \"+=\", 1]]' \\ - '[[\"r\", \"-=\", 2]]' \\ - '[[\"r\", \"*=\", 3]]' \\ - '[[\"r\", \"/=\", 4]]' \\ - '[[\"r\", \"insert\", [\"set\", [1, 2]]]]' \\ - '[[\"r\", \"delete\", [\"set\", [1, 2, 3]]]]' \\ - '[[\"b\", \"insert\", [\"set\", [true]]]]' \\ - '[[\"b\", \"delete\", [\"set\", [false]]]]' \\ - '[[\"s\", \"insert\", [\"set\", [\"a\"]]]]' \\ - '[[\"s\", \"delete\", [\"set\", [\"a\", \"b\"]]]]' \\ - '[[\"u\", \"insert\", - [\"set\", [[\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]]]' \\ - '[[\"u\", \"delete\", - [\"set\", [[\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"], - [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]]]]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:114" -( $at_check_trace; test-ovsdb parse-mutations \ - '{"columns": - {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}, - "r": {"type": {"key": "real", "min": 0, "max": "unlimited"}}, - "b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}, - "s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}, - "u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \ - '[["i", "+=", 1]]' \ - '[["i", "-=", 2]]' \ - '[["i", "*=", 3]]' \ - '[["i", "/=", 4]]' \ - '[["i", "%=", 5]]' \ - '[["i", "insert", ["set", [1, 2]]]]' \ - '[["i", "delete", ["set", [1, 2, 3]]]]' \ - '[["r", "+=", 1]]' \ - '[["r", "-=", 2]]' \ - '[["r", "*=", 3]]' \ - '[["r", "/=", 4]]' \ - '[["r", "insert", ["set", [1, 2]]]]' \ - '[["r", "delete", ["set", [1, 2, 3]]]]' \ - '[["b", "insert", ["set", [true]]]]' \ - '[["b", "delete", ["set", [false]]]]' \ - '[["s", "insert", ["set", ["a"]]]]' \ - '[["s", "delete", ["set", ["a", "b"]]]]' \ - '[["u", "insert", - ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]' \ - '[["u", "delete", - ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], - ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]]]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[[\"i\",\"+=\",1]] -[[\"i\",\"-=\",2]] -[[\"i\",\"*=\",3]] -[[\"i\",\"/=\",4]] -[[\"i\",\"%=\",5]] -[[\"i\",\"insert\",[\"set\",[1,2]]]] -[[\"i\",\"delete\",[\"set\",[1,2,3]]]] -[[\"r\",\"+=\",1]] -[[\"r\",\"-=\",2]] -[[\"r\",\"*=\",3]] -[[\"r\",\"/=\",4]] -[[\"r\",\"insert\",[\"set\",[1,2]]]] -[[\"r\",\"delete\",[\"set\",[1,2,3]]]] -[[\"b\",\"insert\",true]] -[[\"b\",\"delete\",false]] -[[\"s\",\"insert\",\"a\"]] -[[\"s\",\"delete\",[\"set\",[\"a\",\"b\"]]]] -[[\"u\",\"insert\",[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]] -[[\"u\",\"delete\",[\"set\",[[\"uuid\",\"9179ca6d-6d65-400a-b455-3ad92783a099\"],[\"uuid\",\"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]]]] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1143 -#AT_START_1144 -at_fn_group_banner 1144 'ovsdb-mutation.at:166' \ - "executing null mutation" " " 67 -at_xfail=no -( - $as_echo "1144. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:166: test-ovsdb execute-mutations \\ - '{\"columns\": {\"i\": {\"type\": \"integer\"}}}' \\ - '[[]]' \\ - '[{\"i\": 0}, - {\"i\": 1}, - {\"i\": 2}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:166" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"i": {"type": "integer"}}}' \ - '[[]]' \ - '[{"i": 0}, - {"i": 1}, - {"i": 2}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: no change -row 1: no change -row 2: no change - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:166" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1144 -#AT_START_1145 -at_fn_group_banner 1145 'ovsdb-mutation.at:179' \ - "executing mutations on integers" " " 67 -at_xfail=no -( - $as_echo "1145. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:179: test-ovsdb execute-mutations \\ - '{\"columns\": {\"i\": {\"type\": \"integer\"}}}' \\ - '[[[\"i\", \"+=\", 1]], - [[\"i\", \"-=\", 2]], - [[\"i\", \"*=\", 3]], - [[\"i\", \"/=\", 4]], - [[\"i\", \"%=\", 2]]]' \\ - '[{\"i\": 0}, - {\"i\": 1}, - {\"i\": 2}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:179" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"i": {"type": "integer"}}}' \ - '[[["i", "+=", 1]], - [["i", "-=", 2]], - [["i", "*=", 3]], - [["i", "/=", 4]], - [["i", "%=", 2]]]' \ - '[{"i": 0}, - {"i": 1}, - {"i": 2}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"i\":1} -row 1: {\"i\":2} -row 2: {\"i\":3} - -mutation 1: -row 0: {\"i\":-2} -row 1: {\"i\":-1} -row 2: {\"i\":0} - -mutation 2: -row 0: no change -row 1: {\"i\":3} -row 2: {\"i\":6} - -mutation 3: -row 0: no change -row 1: {\"i\":0} -row 2: {\"i\":0} - -mutation 4: -row 0: no change -row 1: no change -row 2: {\"i\":0} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:179" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1145 -#AT_START_1146 -at_fn_group_banner 1146 'ovsdb-mutation.at:216' \ - "integer overflow detection" " " 67 -at_xfail=no -( - $as_echo "1146. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:216: test-ovsdb execute-mutations \\ - '{\"columns\": {\"i\": {\"type\": \"integer\"}}}' \\ - '[[[\"i\", \"+=\", 9223372036854775807]], - [[\"i\", \"+=\", -9223372036854775808]], - [[\"i\", \"-=\", -9223372036854775808]], - [[\"i\", \"-=\", 9223372036854775807]], - [[\"i\", \"*=\", 3037000500]], - [[\"i\", \"/=\", -1]], - [[\"i\", \"/=\", 0]]]' \\ - '[{\"i\": 0}, - {\"i\": 1}, - {\"i\": -1}, - {\"i\": 9223372036854775807}, - {\"i\": -9223372036854775808}, - {\"i\": 3037000500}, - {\"i\": -3037000500}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:216" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"i": {"type": "integer"}}}' \ - '[[["i", "+=", 9223372036854775807]], - [["i", "+=", -9223372036854775808]], - [["i", "-=", -9223372036854775808]], - [["i", "-=", 9223372036854775807]], - [["i", "*=", 3037000500]], - [["i", "/=", -1]], - [["i", "/=", 0]]]' \ - '[{"i": 0}, - {"i": 1}, - {"i": -1}, - {"i": 9223372036854775807}, - {"i": -9223372036854775808}, - {"i": 3037000500}, - {"i": -3037000500}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"i\":9223372036854775807} -row 1: range error: Result of \"+=\" operation is out of range. -row 2: {\"i\":9223372036854775806} -row 3: range error: Result of \"+=\" operation is out of range. -row 4: {\"i\":-1} -row 5: range error: Result of \"+=\" operation is out of range. -row 6: {\"i\":9223372033817775307} - -mutation 1: -row 0: {\"i\":-9223372036854775808} -row 1: {\"i\":-9223372036854775807} -row 2: range error: Result of \"+=\" operation is out of range. -row 3: {\"i\":-1} -row 4: range error: Result of \"+=\" operation is out of range. -row 5: {\"i\":-9223372033817775308} -row 6: range error: Result of \"+=\" operation is out of range. - -mutation 2: -row 0: range error: Result of \"-=\" operation is out of range. -row 1: range error: Result of \"-=\" operation is out of range. -row 2: {\"i\":9223372036854775807} -row 3: range error: Result of \"-=\" operation is out of range. -row 4: {\"i\":0} -row 5: range error: Result of \"-=\" operation is out of range. -row 6: {\"i\":9223372033817775308} - -mutation 3: -row 0: {\"i\":-9223372036854775807} -row 1: {\"i\":-9223372036854775806} -row 2: {\"i\":-9223372036854775808} -row 3: {\"i\":0} -row 4: range error: Result of \"-=\" operation is out of range. -row 5: {\"i\":-9223372033817775307} -row 6: range error: Result of \"-=\" operation is out of range. - -mutation 4: -row 0: no change -row 1: {\"i\":3037000500} -row 2: {\"i\":-3037000500} -row 3: range error: Result of \"*=\" operation is out of range. -row 4: range error: Result of \"*=\" operation is out of range. -row 5: range error: Result of \"*=\" operation is out of range. -row 6: range error: Result of \"*=\" operation is out of range. - -mutation 5: -row 0: no change -row 1: {\"i\":-1} -row 2: {\"i\":1} -row 3: {\"i\":-9223372036854775807} -row 4: range error: Result of \"/=\" operation is out of range. -row 5: {\"i\":-3037000500} -row 6: {\"i\":3037000500} - -mutation 6: -row 0: domain error: Division by zero. -row 1: domain error: Division by zero. -row 2: domain error: Division by zero. -row 3: domain error: Division by zero. -row 4: domain error: Division by zero. -row 5: domain error: Division by zero. -row 6: domain error: Division by zero. - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:216" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1146 -#AT_START_1147 -at_fn_group_banner 1147 'ovsdb-mutation.at:297' \ - "executing mutations on integers with constraints" "" 67 -at_xfail=no -( - $as_echo "1147. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:297: test-ovsdb execute-mutations \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": {\"type\": \"integer\", - \"minInteger\": 0, - \"maxInteger\": 2}}}}}' \\ - '[[[\"i\", \"+=\", 1]], - [[\"i\", \"-=\", 2]], - [[\"i\", \"*=\", 3]], - [[\"i\", \"/=\", 4]], - [[\"i\", \"%=\", 2]]]' \\ - '[{\"i\": 0}, - {\"i\": 1}, - {\"i\": 2}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:297" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"i": {"type": {"key": {"type": "integer", - "minInteger": 0, - "maxInteger": 2}}}}}' \ - '[[["i", "+=", 1]], - [["i", "-=", 2]], - [["i", "*=", 3]], - [["i", "/=", 4]], - [["i", "%=", 2]]]' \ - '[{"i": 0}, - {"i": 1}, - {"i": 2}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"i\":1} -row 1: {\"i\":2} -row 2: constraint violation: 3 is not in the valid range 0 to 2 (inclusive) - -mutation 1: -row 0: constraint violation: -2 is not in the valid range 0 to 2 (inclusive) -row 1: constraint violation: -1 is not in the valid range 0 to 2 (inclusive) -row 2: {\"i\":0} - -mutation 2: -row 0: no change -row 1: constraint violation: 3 is not in the valid range 0 to 2 (inclusive) -row 2: constraint violation: 6 is not in the valid range 0 to 2 (inclusive) - -mutation 3: -row 0: no change -row 1: {\"i\":0} -row 2: {\"i\":0} - -mutation 4: -row 0: no change -row 1: no change -row 2: {\"i\":0} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:297" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1147 -#AT_START_1148 -at_fn_group_banner 1148 'ovsdb-mutation.at:336' \ - "executing mutations on reals" " " 67 -at_xfail=no -( - $as_echo "1148. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:336: test-ovsdb execute-mutations \\ - '{\"columns\": {\"r\": {\"type\": \"real\"}}}' \\ - '[[[\"r\", \"+=\", 0.5]], - [[\"r\", \"-=\", 1.5]], - [[\"r\", \"*=\", 2.5]], - [[\"r\", \"/=\", 4]]]' \\ - '[{\"r\": 0}, - {\"r\": -2.5}, - {\"r\": 1.25}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:336" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"r": {"type": "real"}}}' \ - '[[["r", "+=", 0.5]], - [["r", "-=", 1.5]], - [["r", "*=", 2.5]], - [["r", "/=", 4]]]' \ - '[{"r": 0}, - {"r": -2.5}, - {"r": 1.25}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"r\":0.5} -row 1: {\"r\":-2} -row 2: {\"r\":1.75} - -mutation 1: -row 0: {\"r\":-1.5} -row 1: {\"r\":-4} -row 2: {\"r\":-0.25} - -mutation 2: -row 0: no change -row 1: {\"r\":-6.25} -row 2: {\"r\":3.125} - -mutation 3: -row 0: no change -row 1: {\"r\":-0.625} -row 2: {\"r\":0.3125} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1148 -#AT_START_1149 -at_fn_group_banner 1149 'ovsdb-mutation.at:367' \ - "real overflow detection" " " 67 -at_xfail=no -( - $as_echo "1149. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:367: test-ovsdb execute-mutations \\ - '{\"columns\": {\"r\": {\"type\": \"real\"}}}' \\ - '[[[\"r\", \"+=\", 1.7976931348623157e+308]], - [[\"r\", \"-=\", 1.7976931348623157e+308]], - [[\"r\", \"*=\", 2]], - [[\"r\", \"/=\", 4]], - [[\"r\", \"/=\", 0.5]], - [[\"r\", \"/=\", 0]]]' \\ - '[{\"r\": 0}, - {\"r\": 1.7976931348623157e+308}, - {\"r\": -1.7976931348623157e+308}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:367" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"r": {"type": "real"}}}' \ - '[[["r", "+=", 1.7976931348623157e+308]], - [["r", "-=", 1.7976931348623157e+308]], - [["r", "*=", 2]], - [["r", "/=", 4]], - [["r", "/=", 0.5]], - [["r", "/=", 0]]]' \ - '[{"r": 0}, - {"r": 1.7976931348623157e+308}, - {"r": -1.7976931348623157e+308}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"r\":1.79769313486232e+308} -row 1: range error: Result of \"+=\" operation is out of range. -row 2: {\"r\":0} - -mutation 1: -row 0: {\"r\":-1.79769313486232e+308} -row 1: {\"r\":0} -row 2: range error: Result of \"-=\" operation is out of range. - -mutation 2: -row 0: no change -row 1: range error: Result of \"*=\" operation is out of range. -row 2: range error: Result of \"*=\" operation is out of range. - -mutation 3: -row 0: no change -row 1: {\"r\":4.49423283715579e+307} -row 2: {\"r\":-4.49423283715579e+307} - -mutation 4: -row 0: no change -row 1: range error: Result of \"/=\" operation is out of range. -row 2: range error: Result of \"/=\" operation is out of range. - -mutation 5: -row 0: domain error: Division by zero. -row 1: domain error: Division by zero. -row 2: domain error: Division by zero. - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:367" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1149 -#AT_START_1150 -at_fn_group_banner 1150 'ovsdb-mutation.at:410' \ - "executing mutations on reals with constraints" " " 67 -at_xfail=no -( - $as_echo "1150. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:410: test-ovsdb execute-mutations \\ - '{\"columns\": {\"r\": {\"type\": {\"key\": {\"type\": \"real\", - \"minReal\": -2.5, - \"maxReal\": 1.75}}}}}' \\ - '[[[\"r\", \"+=\", 0.5]], - [[\"r\", \"-=\", 1.5]], - [[\"r\", \"*=\", 2.5]], - [[\"r\", \"/=\", 4]]]' \\ - '[{\"r\": 0}, - {\"r\": -2.5}, - {\"r\": 1.25}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:410" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"r": {"type": {"key": {"type": "real", - "minReal": -2.5, - "maxReal": 1.75}}}}}' \ - '[[["r", "+=", 0.5]], - [["r", "-=", 1.5]], - [["r", "*=", 2.5]], - [["r", "/=", 4]]]' \ - '[{"r": 0}, - {"r": -2.5}, - {"r": 1.25}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"r\":0.5} -row 1: {\"r\":-2} -row 2: {\"r\":1.75} - -mutation 1: -row 0: {\"r\":-1.5} -row 1: constraint violation: -4 is not in the valid range -2.5 to 1.75 (inclusive) -row 2: {\"r\":-0.25} - -mutation 2: -row 0: no change -row 1: constraint violation: -6.25 is not in the valid range -2.5 to 1.75 (inclusive) -row 2: constraint violation: 3.125 is not in the valid range -2.5 to 1.75 (inclusive) - -mutation 3: -row 0: no change -row 1: {\"r\":-0.625} -row 2: {\"r\":0.3125} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:410" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1150 -#AT_START_1151 -at_fn_group_banner 1151 'ovsdb-mutation.at:443' \ - "executing mutations on integer sets" " " 67 -at_xfail=no -( - $as_echo "1151. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:443: test-ovsdb execute-mutations \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": {\"type\": \"integer\", - \"maxInteger\": 5}, - \"min\": 0, - \"max\": \"unlimited\"}}}}' \\ - '[[[\"i\", \"+=\", 1]], - [[\"i\", \"-=\", 2]], - [[\"i\", \"*=\", 3]], - [[\"i\", \"/=\", 4]], - [[\"i\", \"%=\", 2]], - [[\"i\", \"insert\", [\"set\", [1]]]], - [[\"i\", \"insert\", [\"set\", [2, 3]]]], - [[\"i\", \"delete\", [\"set\", [1]]]], - [[\"i\", \"delete\", [\"set\", [2, 3]]]]]' \\ - '[{\"i\": [\"set\", []]}, - {\"i\": [\"set\", [0]]}, - {\"i\": [\"set\", [0, 1]]}, - {\"i\": [\"set\", [0, 1, 2]]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:443" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"i": {"type": {"key": {"type": "integer", - "maxInteger": 5}, - "min": 0, - "max": "unlimited"}}}}' \ - '[[["i", "+=", 1]], - [["i", "-=", 2]], - [["i", "*=", 3]], - [["i", "/=", 4]], - [["i", "%=", 2]], - [["i", "insert", ["set", [1]]]], - [["i", "insert", ["set", [2, 3]]]], - [["i", "delete", ["set", [1]]]], - [["i", "delete", ["set", [2, 3]]]]]' \ - '[{"i": ["set", []]}, - {"i": ["set", [0]]}, - {"i": ["set", [0, 1]]}, - {"i": ["set", [0, 1, 2]]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: no change -row 1: {\"i\":1} -row 2: {\"i\":[\"set\",[1,2]]} -row 3: {\"i\":[\"set\",[1,2,3]]} - -mutation 1: -row 0: no change -row 1: {\"i\":-2} -row 2: {\"i\":[\"set\",[-2,-1]]} -row 3: {\"i\":[\"set\",[-2,-1,0]]} - -mutation 2: -row 0: no change -row 1: no change -row 2: {\"i\":[\"set\",[0,3]]} -row 3: constraint violation: 6 is greater than maximum allowed value 5 - -mutation 3: -row 0: no change -row 1: no change -row 2: constraint violation: Result of \"/=\" operation contains duplicates. -row 3: constraint violation: Result of \"/=\" operation contains duplicates. - -mutation 4: -row 0: no change -row 1: no change -row 2: no change -row 3: constraint violation: Result of \"%=\" operation contains duplicates. - -mutation 5: -row 0: {\"i\":1} -row 1: {\"i\":[\"set\",[0,1]]} -row 2: no change -row 3: no change - -mutation 6: -row 0: {\"i\":[\"set\",[2,3]]} -row 1: {\"i\":[\"set\",[0,2,3]]} -row 2: {\"i\":[\"set\",[0,1,2,3]]} -row 3: {\"i\":[\"set\",[0,1,2,3]]} - -mutation 7: -row 0: no change -row 1: no change -row 2: {\"i\":0} -row 3: {\"i\":[\"set\",[0,2]]} - -mutation 8: -row 0: no change -row 1: no change -row 2: no change -row 3: {\"i\":[\"set\",[0,1]]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:443" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1151 -#AT_START_1152 -at_fn_group_banner 1152 'ovsdb-mutation.at:517' \ - "executing mutations on integer sets with constraints" "" 67 -at_xfail=no -( - $as_echo "1152. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:517: test-ovsdb execute-mutations \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", - \"min\": 1, - \"max\": 2}}}}' \\ - '[[[\"i\", \"insert\", [\"set\", [1]]]], - [[\"i\", \"insert\", [\"set\", [2]]]], - [[\"i\", \"delete\", [\"set\", [1]]]], - [[\"i\", \"delete\", [\"set\", [2]]]], - [[\"i\", \"delete\", [\"set\", [0, 1]]]]]' \\ - '[{\"i\": [\"set\", [0]]}, - {\"i\": [\"set\", [2]]}, - {\"i\": [\"set\", [0, 1]]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:517" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"i": {"type": {"key": "integer", - "min": 1, - "max": 2}}}}' \ - '[[["i", "insert", ["set", [1]]]], - [["i", "insert", ["set", [2]]]], - [["i", "delete", ["set", [1]]]], - [["i", "delete", ["set", [2]]]], - [["i", "delete", ["set", [0, 1]]]]]' \ - '[{"i": ["set", [0]]}, - {"i": ["set", [2]]}, - {"i": ["set", [0, 1]]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"i\":[\"set\",[0,1]]} -row 1: {\"i\":[\"set\",[1,2]]} -row 2: no change - -mutation 1: -row 0: {\"i\":[\"set\",[0,2]]} -row 1: no change -row 2: constraint violation: Attempted to store 3 elements in set of 1 to 2 integers. - -mutation 2: -row 0: no change -row 1: no change -row 2: {\"i\":0} - -mutation 3: -row 0: no change -row 1: constraint violation: Attempted to store 0 elements in set of 1 to 2 integers. -row 2: no change - -mutation 4: -row 0: constraint violation: Attempted to store 0 elements in set of 1 to 2 integers. -row 1: no change -row 2: constraint violation: Attempted to store 0 elements in set of 1 to 2 integers. - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:517" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1152 -#AT_START_1153 -at_fn_group_banner 1153 'ovsdb-mutation.at:556' \ - "executing mutations on real sets" " " 67 -at_xfail=no -( - $as_echo "1153. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:556: test-ovsdb execute-mutations \\ - '{\"columns\": {\"r\": {\"type\": {\"key\": {\"type\": \"real\", - \"maxReal\": 6}, - \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[[\"r\", \"+=\", 0.5]], - [[\"r\", \"-=\", 1.5]], - [[\"r\", \"*=\", 2.5]], - [[\"r\", \"/=\", 4]], - [[\"r\", \"*=\", 0]], - [[\"r\", \"insert\", 1.5]], - [[\"r\", \"insert\", 3]], - [[\"r\", \"delete\", [\"set\", [1.5, 3.5]]]], - [[\"r\", \"delete\", [\"set\", [0.5, 1.5, 2.5]]]]]' \\ - '[{\"r\": [\"set\", []]}, - {\"r\": 0.5}, - {\"r\": [\"set\", [0.5, 1.5]]}, - {\"r\": [\"set\", [0.5, 1.5, 2.5]]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:556" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"r": {"type": {"key": {"type": "real", - "maxReal": 6}, - "min": 0, "max": "unlimited"}}}}' \ - '[[["r", "+=", 0.5]], - [["r", "-=", 1.5]], - [["r", "*=", 2.5]], - [["r", "/=", 4]], - [["r", "*=", 0]], - [["r", "insert", 1.5]], - [["r", "insert", 3]], - [["r", "delete", ["set", [1.5, 3.5]]]], - [["r", "delete", ["set", [0.5, 1.5, 2.5]]]]]' \ - '[{"r": ["set", []]}, - {"r": 0.5}, - {"r": ["set", [0.5, 1.5]]}, - {"r": ["set", [0.5, 1.5, 2.5]]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: no change -row 1: {\"r\":1} -row 2: {\"r\":[\"set\",[1,2]]} -row 3: {\"r\":[\"set\",[1,2,3]]} - -mutation 1: -row 0: no change -row 1: {\"r\":-1} -row 2: {\"r\":[\"set\",[-1,0]]} -row 3: {\"r\":[\"set\",[-1,0,1]]} - -mutation 2: -row 0: no change -row 1: {\"r\":1.25} -row 2: {\"r\":[\"set\",[1.25,3.75]]} -row 3: constraint violation: 6.25 is greater than maximum allowed value 6 - -mutation 3: -row 0: no change -row 1: {\"r\":0.125} -row 2: {\"r\":[\"set\",[0.125,0.375]]} -row 3: {\"r\":[\"set\",[0.125,0.375,0.625]]} - -mutation 4: -row 0: no change -row 1: {\"r\":0} -row 2: constraint violation: Result of \"*=\" operation contains duplicates. -row 3: constraint violation: Result of \"*=\" operation contains duplicates. - -mutation 5: -row 0: {\"r\":1.5} -row 1: {\"r\":[\"set\",[0.5,1.5]]} -row 2: no change -row 3: no change - -mutation 6: -row 0: {\"r\":3} -row 1: {\"r\":[\"set\",[0.5,3]]} -row 2: {\"r\":[\"set\",[0.5,1.5,3]]} -row 3: {\"r\":[\"set\",[0.5,1.5,2.5,3]]} - -mutation 7: -row 0: no change -row 1: no change -row 2: {\"r\":0.5} -row 3: {\"r\":[\"set\",[0.5,2.5]]} - -mutation 8: -row 0: no change -row 1: {\"r\":[\"set\",[]]} -row 2: {\"r\":[\"set\",[]]} -row 3: {\"r\":[\"set\",[]]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:556" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1153 -#AT_START_1154 -at_fn_group_banner 1154 'ovsdb-mutation.at:629' \ - "executing mutations on boolean sets" " " 67 -at_xfail=no -( - $as_echo "1154. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:629: test-ovsdb execute-mutations \\ - '{\"columns\": {\"b\": {\"type\": {\"key\": \"boolean\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[[\"b\", \"insert\", [\"set\", [false]]]], - [[\"b\", \"insert\", [\"set\", [true]]]], - [[\"b\", \"insert\", [\"set\", [false, true]]]], - [[\"b\", \"delete\", [\"set\", [false]]]], - [[\"b\", \"delete\", [\"set\", [true]]]], - [[\"b\", \"delete\", [\"set\", [true, false]]]]]' \\ - '[{\"b\": [\"set\", []]}, - {\"b\": [\"set\", [false]]}, - {\"b\": [\"set\", [true]]}, - {\"b\": [\"set\", [false, true]]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:629" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}}}' \ - '[[["b", "insert", ["set", [false]]]], - [["b", "insert", ["set", [true]]]], - [["b", "insert", ["set", [false, true]]]], - [["b", "delete", ["set", [false]]]], - [["b", "delete", ["set", [true]]]], - [["b", "delete", ["set", [true, false]]]]]' \ - '[{"b": ["set", []]}, - {"b": ["set", [false]]}, - {"b": ["set", [true]]}, - {"b": ["set", [false, true]]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"b\":false} -row 1: no change -row 2: {\"b\":[\"set\",[false,true]]} -row 3: no change - -mutation 1: -row 0: {\"b\":true} -row 1: {\"b\":[\"set\",[false,true]]} -row 2: no change -row 3: no change - -mutation 2: -row 0: {\"b\":[\"set\",[false,true]]} -row 1: {\"b\":[\"set\",[false,true]]} -row 2: {\"b\":[\"set\",[false,true]]} -row 3: no change - -mutation 3: -row 0: no change -row 1: {\"b\":[\"set\",[]]} -row 2: no change -row 3: {\"b\":true} - -mutation 4: -row 0: no change -row 1: no change -row 2: {\"b\":[\"set\",[]]} -row 3: {\"b\":false} - -mutation 5: -row 0: no change -row 1: {\"b\":[\"set\",[]]} -row 2: {\"b\":[\"set\",[]]} -row 3: {\"b\":[\"set\",[]]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:629" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1154 -#AT_START_1155 -at_fn_group_banner 1155 'ovsdb-mutation.at:679' \ - "executing mutations on string sets" " " 67 -at_xfail=no -( - $as_echo "1155. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:679: test-ovsdb execute-mutations \\ - '{\"columns\": {\"s\": {\"type\": {\"key\": \"string\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[[\"s\", \"insert\", [\"set\", [\"a\"]]]], - [[\"s\", \"insert\", [\"set\", [\"b\"]]]], - [[\"s\", \"insert\", [\"set\", [\"c\", \"d\"]]]], - [[\"s\", \"delete\", [\"set\", [\"a\"]]]], - [[\"s\", \"delete\", [\"set\", [\"b\"]]]], - [[\"s\", \"delete\", [\"set\", [\"c\", \"d\"]]]]]' \\ - '[{\"s\": [\"set\", []]}, - {\"s\": [\"set\", [\"a\"]]}, - {\"s\": [\"set\", [\"a\", \"b\"]]}, - {\"s\": [\"set\", [\"a\", \"b\", \"c\", \"d\"]]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:679" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}}}' \ - '[[["s", "insert", ["set", ["a"]]]], - [["s", "insert", ["set", ["b"]]]], - [["s", "insert", ["set", ["c", "d"]]]], - [["s", "delete", ["set", ["a"]]]], - [["s", "delete", ["set", ["b"]]]], - [["s", "delete", ["set", ["c", "d"]]]]]' \ - '[{"s": ["set", []]}, - {"s": ["set", ["a"]]}, - {"s": ["set", ["a", "b"]]}, - {"s": ["set", ["a", "b", "c", "d"]]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"s\":\"a\"} -row 1: no change -row 2: no change -row 3: no change - -mutation 1: -row 0: {\"s\":\"b\"} -row 1: {\"s\":[\"set\",[\"a\",\"b\"]]} -row 2: no change -row 3: no change - -mutation 2: -row 0: {\"s\":[\"set\",[\"c\",\"d\"]]} -row 1: {\"s\":[\"set\",[\"a\",\"c\",\"d\"]]} -row 2: {\"s\":[\"set\",[\"a\",\"b\",\"c\",\"d\"]]} -row 3: no change - -mutation 3: -row 0: no change -row 1: {\"s\":[\"set\",[]]} -row 2: {\"s\":\"b\"} -row 3: {\"s\":[\"set\",[\"b\",\"c\",\"d\"]]} - -mutation 4: -row 0: no change -row 1: no change -row 2: {\"s\":\"a\"} -row 3: {\"s\":[\"set\",[\"a\",\"c\",\"d\"]]} - -mutation 5: -row 0: no change -row 1: no change -row 2: no change -row 3: {\"s\":[\"set\",[\"a\",\"b\"]]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:679" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1155 -#AT_START_1156 -at_fn_group_banner 1156 'ovsdb-mutation.at:729' \ - "executing mutations on uuid sets" " " 67 -at_xfail=no -( - $as_echo "1156. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:729: test-ovsdb execute-mutations \\ - '{\"columns\": {\"u\": {\"type\": {\"key\": \"uuid\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[[\"u\", \"insert\", [\"set\", [[\"uuid\", \"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]]]]], - [[\"u\", \"insert\", [\"set\", [[\"uuid\", \"a60fe7ff-317b-4568-9106-892b37445313\"]]]]], - [[\"u\", \"insert\", [\"set\", [[\"uuid\", \"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"]]]]], - [[\"u\", \"delete\", [\"set\", [[\"uuid\", \"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]]]]], - [[\"u\", \"delete\", [\"set\", [[\"uuid\", \"a60fe7ff-317b-4568-9106-892b37445313\"]]]]], - [[\"u\", \"delete\", [\"set\", [[\"uuid\", \"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"]]]]]]' \\ - '[{\"u\": [\"set\", []]}, - {\"u\": [\"set\", [[\"uuid\", \"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]]]}, - {\"u\": [\"set\", [[\"uuid\", \"a60fe7ff-317b-4568-9106-892b37445313\"]]]}, - {\"u\": [\"set\", [[\"uuid\", \"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"]]]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:729" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \ - '[[["u", "insert", ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]]], - [["u", "insert", ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]]], - [["u", "insert", ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]]], - [["u", "delete", ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]]], - [["u", "delete", ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]]], - [["u", "delete", ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]]]]' \ - '[{"u": ["set", []]}, - {"u": ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}, - {"u": ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]}, - {"u": ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"u\":[\"uuid\",\"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]} -row 1: no change -row 2: {\"u\":[\"set\",[[\"uuid\",\"a60fe7ff-317b-4568-9106-892b37445313\"],[\"uuid\",\"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]]]} -row 3: {\"u\":[\"set\",[[\"uuid\",\"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"],[\"uuid\",\"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]]]} - -mutation 1: -row 0: {\"u\":[\"uuid\",\"a60fe7ff-317b-4568-9106-892b37445313\"]} -row 1: {\"u\":[\"set\",[[\"uuid\",\"a60fe7ff-317b-4568-9106-892b37445313\"],[\"uuid\",\"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]]]} -row 2: no change -row 3: {\"u\":[\"set\",[[\"uuid\",\"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"],[\"uuid\",\"a60fe7ff-317b-4568-9106-892b37445313\"]]]} - -mutation 2: -row 0: {\"u\":[\"uuid\",\"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"]} -row 1: {\"u\":[\"set\",[[\"uuid\",\"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"],[\"uuid\",\"ddd9e79d-7782-414c-8b22-1046c60b6ec2\"]]]} -row 2: {\"u\":[\"set\",[[\"uuid\",\"2607d30e-e652-4927-9fec-8bbf1b60c7e9\"],[\"uuid\",\"a60fe7ff-317b-4568-9106-892b37445313\"]]]} -row 3: no change - -mutation 3: -row 0: no change -row 1: {\"u\":[\"set\",[]]} -row 2: no change -row 3: no change - -mutation 4: -row 0: no change -row 1: no change -row 2: {\"u\":[\"set\",[]]} -row 3: no change - -mutation 5: -row 0: no change -row 1: no change -row 2: no change -row 3: {\"u\":[\"set\",[]]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:729" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1156 -#AT_START_1157 -at_fn_group_banner 1157 'ovsdb-mutation.at:779' \ - "executing mutations on integer maps" " " 67 -at_xfail=no -( - $as_echo "1157. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-mutation.at:779: test-ovsdb execute-mutations \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", \"value\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[[[\"i\", \"insert\", [\"map\", [[1, 2]]]]], - [[\"i\", \"insert\", [\"map\", [[2, 4], [3, 5]]]]], - [[\"i\", \"delete\", [\"map\", [[1, 2]]]]], - [[\"i\", \"delete\", [\"map\", [[2, 3]]]]], - [[\"i\", \"delete\", [\"set\", [1]]]], - [[\"i\", \"delete\", [\"set\", [2, 3]]]]]' \\ - '[{\"i\": [\"map\", []]}, - {\"i\": [\"map\", [[1, 2]]]}, - {\"i\": [\"map\", [[1, 3], [2, 3]]]}, - {\"i\": [\"map\", [[3, 5]]]}']" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-mutation.at:779" -( $at_check_trace; test-ovsdb execute-mutations \ - '{"columns": {"i": {"type": {"key": "integer", "value": "integer", "min": 0, "max": "unlimited"}}}}' \ - '[[["i", "insert", ["map", [[1, 2]]]]], - [["i", "insert", ["map", [[2, 4], [3, 5]]]]], - [["i", "delete", ["map", [[1, 2]]]]], - [["i", "delete", ["map", [[2, 3]]]]], - [["i", "delete", ["set", [1]]]], - [["i", "delete", ["set", [2, 3]]]]]' \ - '[{"i": ["map", []]}, - {"i": ["map", [[1, 2]]]}, - {"i": ["map", [[1, 3], [2, 3]]]}, - {"i": ["map", [[3, 5]]]}'] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "mutation 0: -row 0: {\"i\":[\"map\",[[1,2]]]} -row 1: no change -row 2: no change -row 3: {\"i\":[\"map\",[[1,2],[3,5]]]} - -mutation 1: -row 0: {\"i\":[\"map\",[[2,4],[3,5]]]} -row 1: {\"i\":[\"map\",[[1,2],[2,4],[3,5]]]} -row 2: {\"i\":[\"map\",[[1,3],[2,3],[3,5]]]} -row 3: {\"i\":[\"map\",[[2,4],[3,5]]]} - -mutation 2: -row 0: no change -row 1: {\"i\":[\"map\",[]]} -row 2: no change -row 3: no change - -mutation 3: -row 0: no change -row 1: no change -row 2: {\"i\":[\"map\",[[1,3]]]} -row 3: no change - -mutation 4: -row 0: no change -row 1: {\"i\":[\"map\",[]]} -row 2: {\"i\":[\"map\",[[2,3]]]} -row 3: no change - -mutation 5: -row 0: no change -row 1: no change -row 2: {\"i\":[\"map\",[[1,3]]]} -row 3: {\"i\":[\"map\",[]]} - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-mutation.at:779" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1157 -#AT_START_1158 -at_fn_group_banner 1158 'ovsdb-query.at:3' \ - "queries on scalars" " " 68 -at_xfail=no -( - $as_echo "1158. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:3: test-ovsdb query \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[{\"i\": 0, - \"r\": 0.5, - \"b\": true, - \"s\": \"a\", - \"u\": [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]}, - {\"i\": 1, - \"r\": 1.5, - \"b\": false, - \"s\": \"b\", - \"u\": [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]}, - {\"i\": 2, - \"r\": 2.5, - \"b\": true, - \"s\": \"c\", - \"u\": [\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]}, - {\"i\": 3, - \"r\": 3.5, - \"b\": false, - \"s\": \"d\", - \"u\": [\"uuid\", \"62315898-64e0-40b9-b26f-ff74225303e6\"]}, - {\"i\": 4, - \"r\": 4.5, - \"b\": true, - \"s\": \"e\", - \"u\": [\"uuid\", \"4a5127e2-0256-4a72-a7dc-6246213967c7\"]}]' \\ - '[[], - [[\"i\", \"==\", 0]], - [[\"i\", \"!=\", 1]], - [[\"i\", \"<\", 2]], - [[\"i\", \"<=\", 3]], - [[\"i\", \">\", 2]], - [[\"i\", \">=\", 4]], - [[\"i\", \"includes\", 3]], - [[\"i\", \"excludes\", 2]], - [[\"r\", \"==\", 0.5]], - [[\"r\", \"!=\", 1.5]], - [[\"r\", \"<\", 2.5]], - [[\"r\", \"<=\", 3.5]], - [[\"r\", \">\", 4.5]], - [[\"r\", \">=\", 5.5]], - [[\"r\", \"includes\", 1]], - [[\"r\", \"excludes\", 3]], - [[\"b\", \"==\", true]], - [[\"b\", \"!=\", true]], - [[\"b\", \"includes\", false]], - [[\"b\", \"excludes\", true]], - [[\"s\", \"==\", \"a\"]], - [[\"s\", \"!=\", \"b\"]], - [[\"s\", \"includes\", \"c\"]], - [[\"s\", \"excludes\", \"d\"]], - [[\"u\", \"==\", [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]], - [[\"u\", \"!=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]], - [[\"u\", \"includes\",[\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:3" -( $at_check_trace; test-ovsdb query \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '[{"i": 0, - "r": 0.5, - "b": true, - "s": "a", - "u": ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]}, - {"i": 1, - "r": 1.5, - "b": false, - "s": "b", - "u": ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]}, - {"i": 2, - "r": 2.5, - "b": true, - "s": "c", - "u": ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]}, - {"i": 3, - "r": 3.5, - "b": false, - "s": "d", - "u": ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]}, - {"i": 4, - "r": 4.5, - "b": true, - "s": "e", - "u": ["uuid", "4a5127e2-0256-4a72-a7dc-6246213967c7"]}]' \ - '[[], - [["i", "==", 0]], - [["i", "!=", 1]], - [["i", "<", 2]], - [["i", "<=", 3]], - [["i", ">", 2]], - [["i", ">=", 4]], - [["i", "includes", 3]], - [["i", "excludes", 2]], - [["r", "==", 0.5]], - [["r", "!=", 1.5]], - [["r", "<", 2.5]], - [["r", "<=", 3.5]], - [["r", ">", 4.5]], - [["r", ">=", 5.5]], - [["r", "includes", 1]], - [["r", "excludes", 3]], - [["b", "==", true]], - [["b", "!=", true]], - [["b", "includes", false]], - [["b", "excludes", true]], - [["s", "==", "a"]], - [["s", "!=", "b"]], - [["s", "includes", "c"]], - [["s", "excludes", "d"]], - [["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]], - [["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]], - [["u", "includes",["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "query 0: 11111 -query 1: 1---- -query 2: 1-111 -query 3: 11--- -query 4: 1111- -query 5: ---11 -query 6: ----1 -query 7: ---1- -query 8: 11-11 -query 9: 1---- -query 10: 1-111 -query 11: 11--- -query 12: 1111- -query 13: ----- -query 14: ----- -query 15: ----- -query 16: 11111 -query 17: 1-1-1 -query 18: -1-1- -query 19: -1-1- -query 20: -1-1- -query 21: 1---- -query 22: 1-111 -query 23: --1-- -query 24: 111-1 -query 25: 1---- -query 26: 1-111 -query 27: --1-- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-query.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1158 -#AT_START_1159 -at_fn_group_banner 1159 'ovsdb-query.at:95' \ - "queries on sets" " " 68 -at_xfail=no -( - $as_echo "1159. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:95: test-ovsdb query \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", \"min\": 0, \"max\": \"unlimited\"}}}}' \\ - '[{\"i\": [\"set\", []]}, - {\"i\": [\"set\", [0]]}, - {\"i\": [\"set\", [1]]}, - {\"i\": [\"set\", [0, 1]]}, - {\"i\": [\"set\", [2]]}, - {\"i\": [\"set\", [2, 0]]}, - {\"i\": [\"set\", [2, 1]]}, - {\"i\": [\"set\", [2, 1, 0]]}]' \\ - '[[], - [[\"i\", \"==\", [\"set\", []]]], - [[\"i\", \"==\", [\"set\", [0]]]], - [[\"i\", \"==\", [\"set\", [1]]]], - [[\"i\", \"==\", [\"set\", [0, 1]]]], - [[\"i\", \"==\", [\"set\", [2]]]], - [[\"i\", \"==\", [\"set\", [2, 0]]]], - [[\"i\", \"==\", [\"set\", [2, 1]]]], - [[\"i\", \"==\", [\"set\", [2, 1, 0]]]], - [[\"i\", \"!=\", [\"set\", []]]], - [[\"i\", \"!=\", [\"set\", [0]]]], - [[\"i\", \"!=\", [\"set\", [1]]]], - [[\"i\", \"!=\", [\"set\", [0, 1]]]], - [[\"i\", \"!=\", [\"set\", [2]]]], - [[\"i\", \"!=\", [\"set\", [2, 0]]]], - [[\"i\", \"!=\", [\"set\", [2, 1]]]], - [[\"i\", \"!=\", [\"set\", [2, 1, 0]]]], - [[\"i\", \"includes\", [\"set\", []]]], - [[\"i\", \"includes\", [\"set\", [0]]]], - [[\"i\", \"includes\", [\"set\", [1]]]], - [[\"i\", \"includes\", [\"set\", [0, 1]]]], - [[\"i\", \"includes\", [\"set\", [2]]]], - [[\"i\", \"includes\", [\"set\", [2, 0]]]], - [[\"i\", \"includes\", [\"set\", [2, 1]]]], - [[\"i\", \"includes\", [\"set\", [2, 1, 0]]]], - [[\"i\", \"excludes\", [\"set\", []]]], - [[\"i\", \"excludes\", [\"set\", [0]]]], - [[\"i\", \"excludes\", [\"set\", [1]]]], - [[\"i\", \"excludes\", [\"set\", [0, 1]]]], - [[\"i\", \"excludes\", [\"set\", [2]]]], - [[\"i\", \"excludes\", [\"set\", [2, 0]]]], - [[\"i\", \"excludes\", [\"set\", [2, 1]]]], - [[\"i\", \"excludes\", [\"set\", [2, 1, 0]]]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:95" -( $at_check_trace; test-ovsdb query \ - '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}}}' \ - '[{"i": ["set", []]}, - {"i": ["set", [0]]}, - {"i": ["set", [1]]}, - {"i": ["set", [0, 1]]}, - {"i": ["set", [2]]}, - {"i": ["set", [2, 0]]}, - {"i": ["set", [2, 1]]}, - {"i": ["set", [2, 1, 0]]}]' \ - '[[], - [["i", "==", ["set", []]]], - [["i", "==", ["set", [0]]]], - [["i", "==", ["set", [1]]]], - [["i", "==", ["set", [0, 1]]]], - [["i", "==", ["set", [2]]]], - [["i", "==", ["set", [2, 0]]]], - [["i", "==", ["set", [2, 1]]]], - [["i", "==", ["set", [2, 1, 0]]]], - [["i", "!=", ["set", []]]], - [["i", "!=", ["set", [0]]]], - [["i", "!=", ["set", [1]]]], - [["i", "!=", ["set", [0, 1]]]], - [["i", "!=", ["set", [2]]]], - [["i", "!=", ["set", [2, 0]]]], - [["i", "!=", ["set", [2, 1]]]], - [["i", "!=", ["set", [2, 1, 0]]]], - [["i", "includes", ["set", []]]], - [["i", "includes", ["set", [0]]]], - [["i", "includes", ["set", [1]]]], - [["i", "includes", ["set", [0, 1]]]], - [["i", "includes", ["set", [2]]]], - [["i", "includes", ["set", [2, 0]]]], - [["i", "includes", ["set", [2, 1]]]], - [["i", "includes", ["set", [2, 1, 0]]]], - [["i", "excludes", ["set", []]]], - [["i", "excludes", ["set", [0]]]], - [["i", "excludes", ["set", [1]]]], - [["i", "excludes", ["set", [0, 1]]]], - [["i", "excludes", ["set", [2]]]], - [["i", "excludes", ["set", [2, 0]]]], - [["i", "excludes", ["set", [2, 1]]]], - [["i", "excludes", ["set", [2, 1, 0]]]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "query 0: 11111 111 -query 1: 1---- --- -query 2: -1--- --- -query 3: --1-- --- -query 4: ---1- --- -query 5: ----1 --- -query 6: ----- 1-- -query 7: ----- -1- -query 8: ----- --1 -query 9: -1111 111 -query 10: 1-111 111 -query 11: 11-11 111 -query 12: 111-1 111 -query 13: 1111- 111 -query 14: 11111 -11 -query 15: 11111 1-1 -query 16: 11111 11- -query 17: 11111 111 -query 18: -1-1- 1-1 -query 19: --11- -11 -query 20: ---1- --1 -query 21: ----1 111 -query 22: ----- 1-1 -query 23: ----- -11 -query 24: ----- --1 -query 25: 11111 111 -query 26: 1-1-1 -1- -query 27: 11--1 1-- -query 28: 1---1 --- -query 29: 1111- --- -query 30: 1-1-- --- -query 31: 11--- --- -query 32: 1---- --- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-query.at:95" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1159 -#AT_START_1160 -at_fn_group_banner 1160 'ovsdb-query.at:176' \ - "queries on maps (1)" " " 68 -at_xfail=no -( - $as_echo "1160. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:176: test-ovsdb query \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", - \"value\": \"boolean\", - \"min\": 0, - \"max\": \"unlimited\"}}}}' \\ - '[{\"i\": [\"map\", []]}, - {\"i\": [\"map\", [[0, true]]]}, - {\"i\": [\"map\", [[1, false]]]}, - {\"i\": [\"map\", [[0, true], [1, false]]]}, - {\"i\": [\"map\", [[2, true]]]}, - {\"i\": [\"map\", [[2, true], [0, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false]]]}, - {\"i\": [\"map\", [[2, true], [1, false], [0, true]]]}]' \\ - '[[], - [[\"i\", \"==\", [\"map\", []]]], - [[\"i\", \"==\", [\"map\", [[0, true]]]]], - [[\"i\", \"==\", [\"map\", [[1, false]]]]], - [[\"i\", \"==\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", []]]], - [[\"i\", \"!=\", [\"map\", [[0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", []]]], - [[\"i\", \"includes\", [\"map\", [[0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", []]]], - [[\"i\", \"excludes\", [\"map\", [[0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false], [0, true]]]]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:176" -( $at_check_trace; test-ovsdb query \ - '{"columns": {"i": {"type": {"key": "integer", - "value": "boolean", - "min": 0, - "max": "unlimited"}}}}' \ - '[{"i": ["map", []]}, - {"i": ["map", [[0, true]]]}, - {"i": ["map", [[1, false]]]}, - {"i": ["map", [[0, true], [1, false]]]}, - {"i": ["map", [[2, true]]]}, - {"i": ["map", [[2, true], [0, true]]]}, - {"i": ["map", [[2, true], [1, false]]]}, - {"i": ["map", [[2, true], [1, false], [0, true]]]}]' \ - '[[], - [["i", "==", ["map", []]]], - [["i", "==", ["map", [[0, true]]]]], - [["i", "==", ["map", [[1, false]]]]], - [["i", "==", ["map", [[0, true], [1, false]]]]], - [["i", "==", ["map", [[2, true]]]]], - [["i", "==", ["map", [[2, true], [0, true]]]]], - [["i", "==", ["map", [[2, true], [1, false]]]]], - [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "!=", ["map", []]]], - [["i", "!=", ["map", [[0, true]]]]], - [["i", "!=", ["map", [[1, false]]]]], - [["i", "!=", ["map", [[0, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true]]]]], - [["i", "!=", ["map", [[2, true], [0, true]]]]], - [["i", "!=", ["map", [[2, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "includes", ["map", []]]], - [["i", "includes", ["map", [[0, true]]]]], - [["i", "includes", ["map", [[1, false]]]]], - [["i", "includes", ["map", [[0, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true]]]]], - [["i", "includes", ["map", [[2, true], [0, true]]]]], - [["i", "includes", ["map", [[2, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "excludes", ["map", []]]], - [["i", "excludes", ["map", [[0, true]]]]], - [["i", "excludes", ["map", [[1, false]]]]], - [["i", "excludes", ["map", [[0, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true]]]]], - [["i", "excludes", ["map", [[2, true], [0, true]]]]], - [["i", "excludes", ["map", [[2, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "query 0: 11111 111 -query 1: 1---- --- -query 2: -1--- --- -query 3: --1-- --- -query 4: ---1- --- -query 5: ----1 --- -query 6: ----- 1-- -query 7: ----- -1- -query 8: ----- --1 -query 9: -1111 111 -query 10: 1-111 111 -query 11: 11-11 111 -query 12: 111-1 111 -query 13: 1111- 111 -query 14: 11111 -11 -query 15: 11111 1-1 -query 16: 11111 11- -query 17: 11111 111 -query 18: -1-1- 1-1 -query 19: --11- -11 -query 20: ---1- --1 -query 21: ----1 111 -query 22: ----- 1-1 -query 23: ----- -11 -query 24: ----- --1 -query 25: 11111 111 -query 26: 1-1-1 -1- -query 27: 11--1 1-- -query 28: 1---1 --- -query 29: 1111- --- -query 30: 1-1-- --- -query 31: 11--- --- -query 32: 1---- --- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-query.at:176" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1160 -#AT_START_1161 -at_fn_group_banner 1161 'ovsdb-query.at:260' \ - "queries on maps (2)" " " 68 -at_xfail=no -( - $as_echo "1161. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:260: test-ovsdb query \\ - '{\"columns\": {\"i\": {\"type\": {\"key\": \"integer\", - \"value\": \"boolean\", - \"min\": 0, - \"max\": \"unlimited\"}}}}' \\ - '[{\"i\": [\"map\", []]}, - {\"i\": [\"map\", [[0, true]]]}, - {\"i\": [\"map\", [[0, false]]]}, - {\"i\": [\"map\", [[1, false]]]}, - {\"i\": [\"map\", [[1, true]]]}, - - {\"i\": [\"map\", [[0, true], [1, false]]]}, - {\"i\": [\"map\", [[0, true], [1, true]]]}, - {\"i\": [\"map\", [[2, true]]]}, - {\"i\": [\"map\", [[2, false]]]}, - {\"i\": [\"map\", [[2, true], [0, true]]]}, - - {\"i\": [\"map\", [[2, false], [0, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false]]]}, - {\"i\": [\"map\", [[2, true], [1, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false], [0, true]]]}, - {\"i\": [\"map\", [[2, true], [1, false], [0, false]]]}]' \\ - '[[], - [[\"i\", \"==\", [\"map\", []]]], - [[\"i\", \"==\", [\"map\", [[0, true]]]]], - [[\"i\", \"==\", [\"map\", [[1, false]]]]], - [[\"i\", \"==\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"==\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", []]]], - [[\"i\", \"!=\", [\"map\", [[0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"!=\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", []]]], - [[\"i\", \"includes\", [\"map\", [[0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"includes\", [\"map\", [[2, true], [1, false], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", []]]], - [[\"i\", \"excludes\", [\"map\", [[0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[0, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [0, true]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false]]]]], - [[\"i\", \"excludes\", [\"map\", [[2, true], [1, false], [0, true]]]]]]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:260" -( $at_check_trace; test-ovsdb query \ - '{"columns": {"i": {"type": {"key": "integer", - "value": "boolean", - "min": 0, - "max": "unlimited"}}}}' \ - '[{"i": ["map", []]}, - {"i": ["map", [[0, true]]]}, - {"i": ["map", [[0, false]]]}, - {"i": ["map", [[1, false]]]}, - {"i": ["map", [[1, true]]]}, - - {"i": ["map", [[0, true], [1, false]]]}, - {"i": ["map", [[0, true], [1, true]]]}, - {"i": ["map", [[2, true]]]}, - {"i": ["map", [[2, false]]]}, - {"i": ["map", [[2, true], [0, true]]]}, - - {"i": ["map", [[2, false], [0, true]]]}, - {"i": ["map", [[2, true], [1, false]]]}, - {"i": ["map", [[2, true], [1, true]]]}, - {"i": ["map", [[2, true], [1, false], [0, true]]]}, - {"i": ["map", [[2, true], [1, false], [0, false]]]}]' \ - '[[], - [["i", "==", ["map", []]]], - [["i", "==", ["map", [[0, true]]]]], - [["i", "==", ["map", [[1, false]]]]], - [["i", "==", ["map", [[0, true], [1, false]]]]], - [["i", "==", ["map", [[2, true]]]]], - [["i", "==", ["map", [[2, true], [0, true]]]]], - [["i", "==", ["map", [[2, true], [1, false]]]]], - [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "!=", ["map", []]]], - [["i", "!=", ["map", [[0, true]]]]], - [["i", "!=", ["map", [[1, false]]]]], - [["i", "!=", ["map", [[0, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true]]]]], - [["i", "!=", ["map", [[2, true], [0, true]]]]], - [["i", "!=", ["map", [[2, true], [1, false]]]]], - [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "includes", ["map", []]]], - [["i", "includes", ["map", [[0, true]]]]], - [["i", "includes", ["map", [[1, false]]]]], - [["i", "includes", ["map", [[0, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true]]]]], - [["i", "includes", ["map", [[2, true], [0, true]]]]], - [["i", "includes", ["map", [[2, true], [1, false]]]]], - [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], - [["i", "excludes", ["map", []]]], - [["i", "excludes", ["map", [[0, true]]]]], - [["i", "excludes", ["map", [[1, false]]]]], - [["i", "excludes", ["map", [[0, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true]]]]], - [["i", "excludes", ["map", [[2, true], [0, true]]]]], - [["i", "excludes", ["map", [[2, true], [1, false]]]]], - [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]]]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "query 0: 11111 11111 11111 -query 1: 1---- ----- ----- -query 2: -1--- ----- ----- -query 3: ---1- ----- ----- -query 4: ----- 1---- ----- -query 5: ----- --1-- ----- -query 6: ----- ----1 ----- -query 7: ----- ----- -1--- -query 8: ----- ----- ---1- -query 9: -1111 11111 11111 -query 10: 1-111 11111 11111 -query 11: 111-1 11111 11111 -query 12: 11111 -1111 11111 -query 13: 11111 11-11 11111 -query 14: 11111 1111- 11111 -query 15: 11111 11111 1-111 -query 16: 11111 11111 111-1 -query 17: 11111 11111 11111 -query 18: -1--- 11--1 1--1- -query 19: ---1- 1---- -1-11 -query 20: ----- 1---- ---1- -query 21: ----- --1-1 -1111 -query 22: ----- ----1 ---1- -query 23: ----- ----- -1-11 -query 24: ----- ----- ---1- -query 25: 11111 11111 11111 -query 26: 1-111 --11- -11-1 -query 27: 111-1 -1111 1-1-- -query 28: 1-1-1 --11- --1-- -query 29: 11111 11-1- 1---- -query 30: 1-111 ---1- ----- -query 31: 111-1 -1-1- 1---- -query 32: 1-1-1 ---1- ----- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-query.at:260" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1161 -#AT_START_1162 -at_fn_group_banner 1162 'ovsdb-query.at:351' \ - "UUID-distinct queries on scalars" " " 68 -at_xfail=no -( - $as_echo "1162. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:351: test-ovsdb query-distinct \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[{\"i\": 0, - \"r\": 0.5, - \"b\": true, - \"s\": \"a\", - \"u\": [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]}, - {\"i\": 1, - \"r\": 1.5, - \"b\": false, - \"s\": \"b\", - \"u\": [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]}, - {\"i\": 2, - \"r\": 2.5, - \"b\": true, - \"s\": \"c\", - \"u\": [\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]}, - {\"i\": 3, - \"r\": 3.5, - \"b\": false, - \"s\": \"d\", - \"u\": [\"uuid\", \"62315898-64e0-40b9-b26f-ff74225303e6\"]}, - {\"i\": 4, - \"r\": 4.5, - \"b\": true, - \"s\": \"e\", - \"u\": [\"uuid\", \"4a5127e2-0256-4a72-a7dc-6246213967c7\"]}]' \\ - '[[], - [[\"i\", \"==\", 0]], - [[\"i\", \"!=\", 1]], - [[\"i\", \"<\", 2]], - [[\"i\", \"<=\", 3]], - [[\"i\", \">\", 2]], - [[\"i\", \">=\", 4]], - [[\"i\", \"includes\", 3]], - [[\"i\", \"excludes\", 2]], - [[\"r\", \"==\", 0.5]], - [[\"r\", \"!=\", 1.5]], - [[\"r\", \"<\", 2.5]], - [[\"r\", \"<=\", 3.5]], - [[\"r\", \">\", 4.5]], - [[\"r\", \">=\", 5.5]], - [[\"r\", \"includes\", 1]], - [[\"r\", \"excludes\", 3]], - [[\"b\", \"==\", true]], - [[\"b\", \"!=\", true]], - [[\"b\", \"includes\", false]], - [[\"b\", \"excludes\", true]], - [[\"s\", \"==\", \"a\"]], - [[\"s\", \"!=\", \"b\"]], - [[\"s\", \"includes\", \"c\"]], - [[\"s\", \"excludes\", \"d\"]], - [[\"u\", \"==\", [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]], - [[\"u\", \"!=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]], - [[\"u\", \"includes\",[\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]]]' \\ - '[\"_uuid\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:351" -( $at_check_trace; test-ovsdb query-distinct \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '[{"i": 0, - "r": 0.5, - "b": true, - "s": "a", - "u": ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]}, - {"i": 1, - "r": 1.5, - "b": false, - "s": "b", - "u": ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]}, - {"i": 2, - "r": 2.5, - "b": true, - "s": "c", - "u": ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]}, - {"i": 3, - "r": 3.5, - "b": false, - "s": "d", - "u": ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]}, - {"i": 4, - "r": 4.5, - "b": true, - "s": "e", - "u": ["uuid", "4a5127e2-0256-4a72-a7dc-6246213967c7"]}]' \ - '[[], - [["i", "==", 0]], - [["i", "!=", 1]], - [["i", "<", 2]], - [["i", "<=", 3]], - [["i", ">", 2]], - [["i", ">=", 4]], - [["i", "includes", 3]], - [["i", "excludes", 2]], - [["r", "==", 0.5]], - [["r", "!=", 1.5]], - [["r", "<", 2.5]], - [["r", "<=", 3.5]], - [["r", ">", 4.5]], - [["r", ">=", 5.5]], - [["r", "includes", 1]], - [["r", "excludes", 3]], - [["b", "==", true]], - [["b", "!=", true]], - [["b", "includes", false]], - [["b", "excludes", true]], - [["s", "==", "a"]], - [["s", "!=", "b"]], - [["s", "includes", "c"]], - [["s", "excludes", "d"]], - [["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]], - [["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]], - [["u", "includes",["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]]' \ - '["_uuid"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "query 0: abcde -query 1: a---- -query 2: a-cde -query 3: ab--- -query 4: abcd- -query 5: ---de -query 6: ----e -query 7: ---d- -query 8: ab-de -query 9: a---- -query 10: a-cde -query 11: ab--- -query 12: abcd- -query 13: ----- -query 14: ----- -query 15: ----- -query 16: abcde -query 17: a-c-e -query 18: -b-d- -query 19: -b-d- -query 20: -b-d- -query 21: a---- -query 22: a-cde -query 23: --c-- -query 24: abc-e -query 25: a---- -query 26: a-cde -query 27: --c-- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-query.at:351" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1162 -#AT_START_1163 -at_fn_group_banner 1163 'ovsdb-query.at:444' \ - "Boolean-distinct queries on scalars" " " 68 -at_xfail=no -( - $as_echo "1163. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:444: test-ovsdb query-distinct \\ - '{\"columns\": - {\"i\": {\"type\": \"integer\"}, - \"r\": {\"type\": \"real\"}, - \"b\": {\"type\": \"boolean\"}, - \"s\": {\"type\": \"string\"}, - \"u\": {\"type\": \"uuid\"}}}' \\ - '[{\"i\": 0, - \"r\": 0.5, - \"b\": true, - \"s\": \"a\", - \"u\": [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]}, - {\"i\": 1, - \"r\": 1.5, - \"b\": false, - \"s\": \"b\", - \"u\": [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]}, - {\"i\": 2, - \"r\": 2.5, - \"b\": true, - \"s\": \"c\", - \"u\": [\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]}, - {\"i\": 3, - \"r\": 3.5, - \"b\": false, - \"s\": \"d\", - \"u\": [\"uuid\", \"62315898-64e0-40b9-b26f-ff74225303e6\"]}, - {\"i\": 4, - \"r\": 4.5, - \"b\": true, - \"s\": \"e\", - \"u\": [\"uuid\", \"4a5127e2-0256-4a72-a7dc-6246213967c7\"]}]' \\ - '[[], - [[\"i\", \"==\", 0]], - [[\"i\", \"!=\", 1]], - [[\"i\", \"<\", 2]], - [[\"i\", \"<=\", 3]], - [[\"i\", \">\", 2]], - [[\"i\", \">=\", 4]], - [[\"i\", \"includes\", 3]], - [[\"i\", \"excludes\", 2]], - [[\"r\", \"==\", 0.5]], - [[\"r\", \"!=\", 1.5]], - [[\"r\", \"<\", 2.5]], - [[\"r\", \"<=\", 3.5]], - [[\"r\", \">\", 4.5]], - [[\"r\", \">=\", 5.5]], - [[\"r\", \"includes\", 1]], - [[\"r\", \"excludes\", 3]], - [[\"b\", \"==\", true]], - [[\"b\", \"!=\", true]], - [[\"b\", \"includes\", false]], - [[\"b\", \"excludes\", true]], - [[\"s\", \"==\", \"a\"]], - [[\"s\", \"!=\", \"b\"]], - [[\"s\", \"includes\", \"c\"]], - [[\"s\", \"excludes\", \"d\"]], - [[\"u\", \"==\", [\"uuid\", \"b10d28f7-af18-4a67-9e78-2a6394516c59\"]]], - [[\"u\", \"!=\", [\"uuid\", \"9179ca6d-6d65-400a-b455-3ad92783a099\"]]], - [[\"u\", \"includes\",[\"uuid\", \"ad0fa355-8b84-4a36-a4b5-b2c1bfd91758\"]]]]' \\ - '[\"b\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:444" -( $at_check_trace; test-ovsdb query-distinct \ - '{"columns": - {"i": {"type": "integer"}, - "r": {"type": "real"}, - "b": {"type": "boolean"}, - "s": {"type": "string"}, - "u": {"type": "uuid"}}}' \ - '[{"i": 0, - "r": 0.5, - "b": true, - "s": "a", - "u": ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]}, - {"i": 1, - "r": 1.5, - "b": false, - "s": "b", - "u": ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]}, - {"i": 2, - "r": 2.5, - "b": true, - "s": "c", - "u": ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]}, - {"i": 3, - "r": 3.5, - "b": false, - "s": "d", - "u": ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]}, - {"i": 4, - "r": 4.5, - "b": true, - "s": "e", - "u": ["uuid", "4a5127e2-0256-4a72-a7dc-6246213967c7"]}]' \ - '[[], - [["i", "==", 0]], - [["i", "!=", 1]], - [["i", "<", 2]], - [["i", "<=", 3]], - [["i", ">", 2]], - [["i", ">=", 4]], - [["i", "includes", 3]], - [["i", "excludes", 2]], - [["r", "==", 0.5]], - [["r", "!=", 1.5]], - [["r", "<", 2.5]], - [["r", "<=", 3.5]], - [["r", ">", 4.5]], - [["r", ">=", 5.5]], - [["r", "includes", 1]], - [["r", "excludes", 3]], - [["b", "==", true]], - [["b", "!=", true]], - [["b", "includes", false]], - [["b", "excludes", true]], - [["s", "==", "a"]], - [["s", "!=", "b"]], - [["s", "includes", "c"]], - [["s", "excludes", "d"]], - [["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]], - [["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]], - [["u", "includes",["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]]' \ - '["b"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "query 0: ababa -query 1: a-a-a -query 2: ababa -query 3: ababa -query 4: ababa -query 5: ababa -query 6: a-a-a -query 7: -b-b- -query 8: ababa -query 9: a-a-a -query 10: ababa -query 11: ababa -query 12: ababa -query 13: ----- -query 14: ----- -query 15: ----- -query 16: ababa -query 17: a-a-a -query 18: -b-b- -query 19: -b-b- -query 20: -b-b- -query 21: a-a-a -query 22: ababa -query 23: a-a-a -query 24: ababa -query 25: a-a-a -query 26: ababa -query 27: a-a-a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-query.at:444" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1163 -#AT_START_1164 -at_fn_group_banner 1164 'ovsdb-query.at:537' \ - "parse colunn set containing bad name" " " 68 -at_xfail=no -( - $as_echo "1164. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:537: test-ovsdb query-distinct \\ - '{\"columns\": {\"i\": {\"type\": \"integer\"}}}' \\ - '[{\"i\": 0}]' \\ - '[[]]' \\ - '[\"i\", \"bad\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:537" -( $at_check_trace; test-ovsdb query-distinct \ - '{"columns": {"i": {"type": "integer"}}}' \ - '[{"i": 0}]' \ - '[[]]' \ - '["i", "bad"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-query.at:537" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-query.at:537: if grep -F -e \"bad is not a valid column name\" stderr - then - : - else - exit 99 - fi" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-query.at:537" -( $at_check_trace; if grep -F -e "bad is not a valid column name" stderr - then - : - else - exit 99 - fi -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-query.at:537" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1164 -#AT_START_1165 -at_fn_group_banner 1165 'ovsdb-transaction.at:3' \ - "empty table, empty transaction" " " 69 -at_xfail=no -( - $as_echo "1165. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:3: test-ovsdb transact \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:3" -( $at_check_trace; test-ovsdb transact \ - '["print"]' \ - '["commit"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "print: -commit: -print: -abort: -print: -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:3" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1165 -#AT_START_1166 -at_fn_group_banner 1166 'ovsdb-transaction.at:17' \ - "nonempty table, empty transaction" " " 69 -at_xfail=no -( - $as_echo "1166. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:17: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:17" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["print"]' \ - '["commit"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -print: -1: i=2, j=3 -2: i=2, j=3 -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -abort: -print: -1: i=2, j=3 -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:17" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1166 -#AT_START_1167 -at_fn_group_banner 1167 'ovsdb-transaction.at:41' \ - "insert, commit" " " 69 -at_xfail=no -( - $as_echo "1167. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:41: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"insert\", \"3\", \"1\", \"2\"]' \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:41" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["insert", "3", "1", "2"]' \ - '["print"]' \ - '["commit"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -insert 3 1 2: -print: -1: i=2, j=3 -2: i=2, j=3 -3: i=1, j=2 -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -3: i=1, j=2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:41" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1167 -#AT_START_1168 -at_fn_group_banner 1168 'ovsdb-transaction.at:70' \ - "insert, abort" " " 69 -at_xfail=no -( - $as_echo "1168. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:70: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"insert\", \"3\", \"1\", \"2\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:70" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["insert", "3", "1", "2"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -insert 3 1 2: -print: -1: i=2, j=3 -2: i=2, j=3 -3: i=1, j=2 -abort: -print: -1: i=2, j=3 -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:70" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1168 -#AT_START_1169 -at_fn_group_banner 1169 'ovsdb-transaction.at:98' \ - "modify, commit" " " 69 -at_xfail=no -( - $as_echo "1169. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:98: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"modify\", \"2\", \"5\", \"-1\"]' \\ - '[\"modify\", \"1\", \"-1\", \"4\"]' \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:98" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["modify", "2", "5", "-1"]' \ - '["modify", "1", "-1", "4"]' \ - '["print"]' \ - '["commit"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -modify 2 5 -1: -modify 1 -1 4: -print: -1: i=2, j=4 -2: i=5, j=3 -commit: -print: -1: i=2, j=4 -2: i=5, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:98" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1169 -#AT_START_1170 -at_fn_group_banner 1170 'ovsdb-transaction.at:127' \ - "modify, abort" " " 69 -at_xfail=no -( - $as_echo "1170. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:127: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"modify\", \"2\", \"5\", \"-1\"]' \\ - '[\"modify\", \"1\", \"-1\", \"4\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:127" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["modify", "2", "5", "-1"]' \ - '["modify", "1", "-1", "4"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -modify 2 5 -1: -modify 1 -1 4: -print: -1: i=2, j=4 -2: i=5, j=3 -abort: -print: -1: i=2, j=3 -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1170 -#AT_START_1171 -at_fn_group_banner 1171 'ovsdb-transaction.at:156' \ - "delete, commit" " " 69 -at_xfail=no -( - $as_echo "1171. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:156: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:156" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["delete", "1"]' \ - '["print"]' \ - '["commit"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -delete 1: -print: -2: i=2, j=3 -commit: -print: -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1171 -#AT_START_1172 -at_fn_group_banner 1172 'ovsdb-transaction.at:181' \ - "delete, abort" " " 69 -at_xfail=no -( - $as_echo "1172. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:181: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:181" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["delete", "1"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -delete 1: -print: -2: i=2, j=3 -abort: -print: -1: i=2, j=3 -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:181" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1172 -#AT_START_1173 -at_fn_group_banner 1173 'ovsdb-transaction.at:207' \ - "modify, delete, commit" " " 69 -at_xfail=no -( - $as_echo "1173. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:207: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"modify\", \"1\", \"5\", \"6\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:207" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["modify", "1", "5", "6"]' \ - '["delete", "1"]' \ - '["print"]' \ - '["commit"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -modify 1 5 6: -delete 1: -print: -2: i=2, j=3 -commit: -print: -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:207" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1173 -#AT_START_1174 -at_fn_group_banner 1174 'ovsdb-transaction.at:234' \ - "modify, delete, abort" " " 69 -at_xfail=no -( - $as_echo "1174. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:234: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"modify\", \"1\", \"5\", \"6\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:234" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["modify", "1", "5", "6"]' \ - '["delete", "1"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -modify 1 5 6: -delete 1: -print: -2: i=2, j=3 -abort: -print: -1: i=2, j=3 -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:234" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1174 -#AT_START_1175 -at_fn_group_banner 1175 'ovsdb-transaction.at:262' \ - "insert, delete, commit" " " 69 -at_xfail=no -( - $as_echo "1175. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:262: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"insert\", \"3\", \"5\", \"6\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"delete\", \"3\"]' \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:262" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["insert", "3", "5", "6"]' \ - '["delete", "1"]' \ - '["delete", "3"]' \ - '["print"]' \ - '["commit"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -insert 3 5 6: -delete 1: -delete 3: -print: -2: i=2, j=3 -commit: -print: -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:262" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1175 -#AT_START_1176 -at_fn_group_banner 1176 'ovsdb-transaction.at:291' \ - "insert, delete, abort" " " 69 -at_xfail=no -( - $as_echo "1176. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:291: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"insert\", \"3\", \"5\", \"6\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"delete\", \"3\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:291" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["insert", "3", "5", "6"]' \ - '["delete", "1"]' \ - '["delete", "3"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -insert 3 5 6: -delete 1: -delete 3: -print: -2: i=2, j=3 -abort: -print: -1: i=2, j=3 -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:291" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1176 -#AT_START_1177 -at_fn_group_banner 1177 'ovsdb-transaction.at:322' \ - "insert, modify, delete, commit" " " 69 -at_xfail=no -( - $as_echo "1177. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:322: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"insert\", \"3\", \"5\", \"6\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"modify\", \"3\", \"7\", \"8\"]' \\ - '[\"delete\", \"3\"]' \\ - '[\"print\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:322" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["insert", "3", "5", "6"]' \ - '["delete", "1"]' \ - '["modify", "3", "7", "8"]' \ - '["delete", "3"]' \ - '["print"]' \ - '["commit"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -insert 3 5 6: -delete 1: -modify 3 7 8: -delete 3: -print: -2: i=2, j=3 -commit: -print: -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:322" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1177 -#AT_START_1178 -at_fn_group_banner 1178 'ovsdb-transaction.at:353' \ - "insert, modify, delete, abort" " " 69 -at_xfail=no -( - $as_echo "1178. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:353: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"insert\", \"2\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"insert\", \"3\", \"5\", \"6\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"modify\", \"3\", \"7\", \"8\"]' \\ - '[\"delete\", \"3\"]' \\ - '[\"print\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:353" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["insert", "2", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["insert", "3", "5", "6"]' \ - '["delete", "1"]' \ - '["modify", "3", "7", "8"]' \ - '["delete", "3"]' \ - '["print"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -insert 2 2 3: -commit: -print: -1: i=2, j=3 -2: i=2, j=3 -insert 3 5 6: -delete 1: -modify 3 7 8: -delete 3: -print: -2: i=2, j=3 -abort: -print: -1: i=2, j=3 -2: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:353" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1178 -#AT_START_1179 -at_fn_group_banner 1179 'ovsdb-transaction.at:385' \ - "deletes are aborted cleanly" " " 69 -at_xfail=no -( - $as_echo "1179. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-transaction.at:385: test-ovsdb transact \\ - '[\"insert\", \"1\", \"2\", \"3\"]' \\ - '[\"commit\"]' \\ - '[\"print\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]' \\ - '[\"delete\", \"1\"]' \\ - '[\"abort\"]' \\ - '[\"print\"]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-transaction.at:385" -( $at_check_trace; test-ovsdb transact \ - '["insert", "1", "2", "3"]' \ - '["commit"]' \ - '["print"]' \ - '["delete", "1"]' \ - '["abort"]' \ - '["print"]' \ - '["delete", "1"]' \ - '["abort"]' \ - '["print"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "insert 1 2 3: -commit: -print: -1: i=2, j=3 -delete 1: -abort: -print: -1: i=2, j=3 -delete 1: -abort: -print: -1: i=2, j=3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-transaction.at:385" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1179 -#AT_START_1180 -at_fn_group_banner 1180 'ovsdb-execution.at:147' \ - "uuid-name must be " " " 70 -at_xfail=no -( - $as_echo "1180. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:147: test-ovsdb execute \"\`constraint_schema\`\" '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {}, - \"uuid-name\": \"0\"}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:147" -( $at_check_trace; test-ovsdb execute "`constraint_schema`" '["constraints", - {"op": "insert", - "table": "a", - "row": {}, - "uuid-name": "0"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:147: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:147" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"details\":\"Parsing ovsdb operation 1 of 1 failed: Type mismatch for member 'uuid-name'.\",\"error\":\"syntax error\",\"syntax\":\"{\\\"op\\\":\\\"insert\\\",\\\"row\\\":{},\\\"table\\\":\\\"a\\\",\\\"uuid-name\\\":\\\"0\\\"}\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1180 -#AT_START_1181 -at_fn_group_banner 1181 'ovsdb-execution.at:157' \ - "named-uuid must be " " " 70 -at_xfail=no -( - $as_echo "1181. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:157: test-ovsdb execute \"\`constraint_schema\`\" '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2a\": [\"named-uuid\", \"0\"]}}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:157" -( $at_check_trace; test-ovsdb execute "`constraint_schema`" '["constraints", - {"op": "insert", - "table": "a", - "row": {"a2a": ["named-uuid", "0"]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:157" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:157: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:157" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"details\":\"named-uuid string is not a valid \",\"error\":\"syntax error\",\"syntax\":\"[\\\"named-uuid\\\",\\\"0\\\"]\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:157" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1181 -#AT_START_1182 -at_fn_group_banner 1182 'ovsdb-execution.at:166' \ - "duplicate uuid-name not allowed" " " 70 -at_xfail=no -( - $as_echo "1182. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:166: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}, - \"uuid-name\": \"x\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}, - \"uuid-name\": \"x\"}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:166" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}, - "uuid-name": "x"}, - {"op": "insert", - "table": "ordinals", - "row": {}, - "uuid-name": "x"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:166" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:166: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:166" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"details\":\"This \\\"uuid-name\\\" appeared on an earlier \\\"insert\\\" operation.\",\"error\":\"duplicate uuid-name\",\"syntax\":\"\\\"x\\\"\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:166" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1182 -#AT_START_1183 -at_fn_group_banner 1183 'ovsdb-execution.at:1102' \ - "insert default row, query table" " " 70 -at_xfail=no -( - $as_echo "1183. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1183 -#AT_START_1184 -at_fn_group_banner 1184 'ovsdb-execution.at:1102' \ - "insert row, query table" " " 70 -at_xfail=no -( - $as_echo "1184. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1184 -#AT_START_1185 -at_fn_group_banner 1185 'ovsdb-execution.at:1102' \ - "insert rows, query by value" " " 70 -at_xfail=no -( - $as_echo "1185. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]' '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1185 -#AT_START_1186 -at_fn_group_banner 1186 'ovsdb-execution.at:1102' \ - "insert rows, query by named-uuid" " " 70 -at_xfail=no -( - $as_echo "1186. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"second\"]]]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "second"]]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1186 -#AT_START_1187 -at_fn_group_banner 1187 'ovsdb-execution.at:1102' \ - "insert rows, update rows by value" " " 70 -at_xfail=no -( - $as_echo "1187. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"row\": {\"name\": \"nought\"}}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "row": {"name": "nought"}}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"nought\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1187 -#AT_START_1188 -at_fn_group_banner 1188 'ovsdb-execution.at:1102' \ - "insert rows, mutate rows" " " 70 -at_xfail=no -( - $as_echo "1188. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"mutations\": [[\"number\", \"+=\", 2]]}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "mutations": [["number", "+=", 2]]}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1},{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"zero\",\"number\":2}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1188 -#AT_START_1189 -at_fn_group_banner 1189 'ovsdb-execution.at:1102' \ - "insert rows, delete by named-uuid" " " 70 -at_xfail=no -( - $as_echo "1189. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":1},{\"rows\":[{\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1189 -#AT_START_1190 -at_fn_group_banner 1190 'ovsdb-execution.at:1102' \ - "insert rows, delete rows by value" " " 70 -at_xfail=no -( - $as_echo "1190. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1190 -#AT_START_1191 -at_fn_group_banner 1191 'ovsdb-execution.at:1102' \ - "insert rows, delete by (non-matching) value" " " 70 -at_xfail=no -( - $as_echo "1191. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]' '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"nought\"]]}]' '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "nought"]]}]' '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":0}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1191 -#AT_START_1192 -at_fn_group_banner 1192 'ovsdb-execution.at:1102' \ - "insert rows, delete all" " " 70 -at_xfail=no -( - $as_echo "1192. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":2},{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1192 -#AT_START_1193 -at_fn_group_banner 1193 'ovsdb-execution.at:1102' \ - "insert row, query table, commit" " " 70 -at_xfail=no -( - $as_echo "1193. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": false}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": false}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1193 -#AT_START_1194 -at_fn_group_banner 1194 'ovsdb-execution.at:1102' \ - "insert row, query table, commit durably" " " 70 -at_xfail=no -( - $as_echo "1194. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": true}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": true}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1194 -#AT_START_1195 -at_fn_group_banner 1195 'ovsdb-execution.at:1102' \ - "equality wait with correct rows" " " 70 -at_xfail=no -( - $as_echo "1195. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1195 -#AT_START_1196 -at_fn_group_banner 1196 'ovsdb-execution.at:1102' \ - "equality wait with extra row" " " 70 -at_xfail=no -( - $as_echo "1196. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1196 -#AT_START_1197 -at_fn_group_banner 1197 'ovsdb-execution.at:1102' \ - "equality wait with missing row" " " 70 -at_xfail=no -( - $as_echo "1197. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1197 -#AT_START_1198 -at_fn_group_banner 1198 'ovsdb-execution.at:1102' \ - "inequality wait with correct rows" " " 70 -at_xfail=no -( - $as_echo "1198. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1198 -#AT_START_1199 -at_fn_group_banner 1199 'ovsdb-execution.at:1102' \ - "inequality wait with extra row" " " 70 -at_xfail=no -( - $as_echo "1199. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1199 -#AT_START_1200 -at_fn_group_banner 1200 'ovsdb-execution.at:1102' \ - "inequality wait with missing row" " " 70 -at_xfail=no -( - $as_echo "1200. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1200 -#AT_START_1201 -at_fn_group_banner 1201 'ovsdb-execution.at:1102' \ - "insert and update constraints" " " 70 -at_xfail=no -( - $as_echo "1201. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`constraint_schema\`\" '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {}}]' '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": -1}}]' '[\"constraints\", - {\"op\": \"update\", - \"table\": \"constrained\", - \"where\": [], - \"row\": {\"positive\": -2}}]' '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 1}}]' '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 2}}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`constraint_schema`" '["constraints", - {"op": "insert", - "table": "constrained", - "row": {}}]' '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": -1}}]' '["constraints", - {"op": "update", - "table": "constrained", - "where": [], - "row": {"positive": -2}}]' '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 1}}]' '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"details\":\"0 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-1 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-2 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"transaction causes \\\"constrained\\\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)\",\"error\":\"constraint violation\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1201 -#AT_START_1202 -at_fn_group_banner 1202 'ovsdb-execution.at:1102' \ - "index uniqueness checking" " " 70 -at_xfail=no -( - $as_echo "1202. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`ordinal_schema\`\" '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]' ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}]' ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]' ' [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"still another one\"}}]' ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]' ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [], - \"row\": {\"number\": 3}}]' ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 1]], - \"row\": {\"number\": 2, \"name\": \"old two\"}}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"two\"]], - \"row\": {\"number\": 1, \"name\": \"old one\"}}]' ' [\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [], - \"mutations\": [[\"number\", \"*=\", 10]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"new one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"new two\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"number\", \"name\"], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`ordinal_schema`" '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}]' ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}, - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' ' ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "still another one"}}]' ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [], - "row": {"number": 3}}]' ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 1]], - "row": {"number": 2, "name": "old two"}}, - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "two"]], - "row": {"number": 1, "name": "old one"}}]' ' ["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [], - "mutations": [["number", "*=", 10]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "new one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "new two"}}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["number", "name"], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <0>, existed in the database before this transaction and was not modified by the transaction. Second row, with UUID <1>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"count\":1}] -[{\"count\":1},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <4>, was inserted by this transaction. Second row, with UUID <3>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<5>\"]}] -[{\"count\":2},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (3) for index on column \\\"number\\\". First row, with UUID <5>, had the following index values before the transaction: 2. Second row, with UUID <2>, had the following index values before the transaction: 1.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"count\":1}] -[{\"count\":2},{\"uuid\":[\"uuid\",\"<6>\"]},{\"uuid\":[\"uuid\",\"<7>\"]},{\"rows\":[{\"name\":\"new one\",\"number\":1},{\"name\":\"new two\",\"number\":2},{\"name\":\"old one\",\"number\":10},{\"name\":\"old two\",\"number\":20}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1202 -#AT_START_1203 -at_fn_group_banner 1203 'ovsdb-execution.at:1102' \ - "referential integrity -- simple" " " 70 -at_xfail=no -( - $as_echo "1203. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`constraint_schema\`\" '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1}, - \"uuid-name\": \"brow\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]' ' [\"constraints\", - {\"op\": \"mutate\", - \"table\": \"b\", - \"where\": [], - \"mutations\": [[\"x\", \"delete\", 0]]}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`constraint_schema`" '["constraints", - {"op": "insert", - "table": "b", - "row": {"b": 1}, - "uuid-name": "brow"}, - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2b": ["set", [["named-uuid", "brow"]]]}}]' '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' ' ["constraints", - {"op": "mutate", - "table": "b", - "where": [], - "mutations": [["x", "delete", 0]]}]' '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 3 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"details\":\"Attempted to store 0 elements in set of 1 to 2 integers.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 2 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1203 -#AT_START_1204 -at_fn_group_banner 1204 'ovsdb-execution.at:1102' \ - "referential integrity -- mutual references" " " 70 -at_xfail=no -( - $as_echo "1204. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`constraint_schema\`\" '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1, - \"b2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"b2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row2\"}]' '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2b\": [\"set\", [[\"uuid\", \"b516b960-5b19-4fc2-bb82-fe1cbd6d0241\"]]]}}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]' ' [\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]' '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}, - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`constraint_schema`" '["constraints", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "row2"]]], - "a2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "b", - "row": {"b": 1, - "b2b": ["set", [["named-uuid", "row2"]]], - "b2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row2"}]' '["constraints", - {"op": "insert", - "table": "a", - "row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]' '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' ' ["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}, - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"details\":\"Table a column a2b row <2> references nonexistent row <3> in table b.\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1204 -#AT_START_1205 -at_fn_group_banner 1205 'ovsdb-execution.at:1102' \ - "weak references" " " 70 -at_xfail=no -( - $as_echo "1205. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`weak_schema\`\" '[\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"], - [\"uuid\", \"0e767b36-6822-4044-8307-d58467e04669\"]]], - \"a2a1\": [\"named-uuid\", \"row1\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row4\"]}}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 2, - \"b2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row3\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 3, - \"b2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row4\"}]' ' [\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]' '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]' ' [\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2a1\": [\"named-uuid\", \"me\"]}, - \"uuid-name\": \"me\"}]' ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 3]]}]' ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]' ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]' '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]' '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]' ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]' '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]' '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]' ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]' '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]' '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`weak_schema`" '["weak", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"], - ["uuid", "0e767b36-6822-4044-8307-d58467e04669"]]], - "a2a1": ["named-uuid", "row1"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row4"]}}, - {"op": "insert", - "table": "b", - "row": {"b": 2, - "b2a": ["named-uuid", "row1"]}, - "uuid-name": "row3"}, - {"op": "insert", - "table": "b", - "row": {"b": 3, - "b2a": ["named-uuid", "row2"]}, - "uuid-name": "row4"}]' ' ["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' ' ["weak", - {"op": "insert", - "table": "a", - "row": {"a2a1": ["named-uuid", "me"]}, - "uuid-name": "me"}]' ' ["weak", - {"op": "delete", - "table": "b", - "where": [["b", "==", 3]]}]' ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<2>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<4>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"details\":\"Weak reference column \\\"a2b\\\" in \\\"a\\\" row <5> (inserted within this transaction) contained all-zeros UUID (probably as the default value for this column) but deleting this value caused a constraint volation because this column is not allowed to be empty.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2b\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2a1\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"uuid\",\"<1>\"],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"set\",[]]}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1205 -#AT_START_1206 -at_fn_group_banner 1206 'ovsdb-execution.at:1102' \ - "immutable columns" " " 70 -at_xfail=no -( - $as_echo "1206. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`immutable_schema\`\" '[\"immutable\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"uuid-name\": \"row1\"}]' '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 10}, - \"where\": []}]' '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"where\": []}]' '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"-=\", 5]]}]' '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"*=\", 1]]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`immutable_schema`" '["immutable", - {"op": "insert", - "table": "a", - "row": {"i": 5}, - "uuid-name": "row1"}]' '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 10}, - "where": []}]' '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 5}, - "where": []}]' '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "-=", 5]]}]' '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "*=", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":10},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":5},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"-=\\\",5]\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"*=\\\",1]\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1206 -#AT_START_1207 -at_fn_group_banner 1207 'ovsdb-execution.at:1102' \ - "garbage collection" " " 70 -at_xfail=no -( - $as_echo "1207. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: test-ovsdb execute \"\`gc_schema\`\" ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0}}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]' ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, \"a2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, \"a2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, \"a2a\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 3}, - \"uuid-name\": \"row3\"}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]' ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 4, \"a2a\": [\"named-uuid\", \"row5\"]}, - \"uuid-name\": \"row4\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 5, \"a2a\": [\"named-uuid\", \"row4\"]}, - \"uuid-name\": \"row5\"}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]' ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 4]], - \"row\": {\"a2a\": [\"set\", []]}}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]' ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 6, \"wa2a\": [\"named-uuid\", \"row7\"]}, - \"uuid-name\": \"row6\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 7, \"wa2a\": [\"named-uuid\", \"row6\"]}, - \"uuid-name\": \"row7\"}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]' ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 8, \"a2a\": [\"named-uuid\", \"row9\"]}, - \"uuid-name\": \"row8\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 9, \"a2a\": [\"named-uuid\", \"row10\"]}, - \"uuid-name\": \"row9\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 10, \"a2a\": [\"named-uuid\", \"row11\"]}, - \"uuid-name\": \"row10\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 11, \"a2a\": [\"named-uuid\", \"row8\"]}, - \"uuid-name\": \"row11\"}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]' ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 9]], - \"row\": {\"a2a\": [\"set\", []]}}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]' ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 12, \"a2a\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]' '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-execution.at:1102" -( $at_check_trace; test-ovsdb execute "`gc_schema`" ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0}}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0, "a2a": ["named-uuid", "row1"]}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, "a2a": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, "a2a": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 3}, - "uuid-name": "row3"}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 4, "a2a": ["named-uuid", "row5"]}, - "uuid-name": "row4"}, - {"op": "insert", - "table": "a", - "row": {"a": 5, "a2a": ["named-uuid", "row4"]}, - "uuid-name": "row5"}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 4]], - "row": {"a2a": ["set", []]}}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 6, "wa2a": ["named-uuid", "row7"]}, - "uuid-name": "row6"}, - {"op": "insert", - "table": "a", - "row": {"a": 7, "wa2a": ["named-uuid", "row6"]}, - "uuid-name": "row7"}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 8, "a2a": ["named-uuid", "row9"]}, - "uuid-name": "row8"}, - {"op": "insert", - "table": "a", - "row": {"a": 9, "a2a": ["named-uuid", "row10"]}, - "uuid-name": "row9"}, - {"op": "insert", - "table": "a", - "row": {"a": 10, "a2a": ["named-uuid", "row11"]}, - "uuid-name": "row10"}, - {"op": "insert", - "table": "a", - "row": {"a": 11, "a2a": ["named-uuid", "row8"]}, - "uuid-name": "row11"}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 9]], - "row": {"a2a": ["set", []]}}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 12, "a2a": ["named-uuid", "self"]}, - "uuid-name": "self"}]' '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-execution.at:1102: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-execution.at:1102" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"uuid\":[\"uuid\",\"<6>\"]}] -[{\"rows\":[{\"a\":4},{\"a\":5}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<7>\"]},{\"uuid\":[\"uuid\",\"<8>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<9>\"]},{\"uuid\":[\"uuid\",\"<10>\"]},{\"uuid\":[\"uuid\",\"<11>\"]},{\"uuid\":[\"uuid\",\"<12>\"]}] -[{\"rows\":[{\"a\":8},{\"a\":9},{\"a\":10},{\"a\":11}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<13>\"]}] -[{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-execution.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1207 -#AT_START_1208 -at_fn_group_banner 1208 'ovsdb-trigger.at:15' \ - "trigger fires immediately" " " 71 -at_xfail=no -( - $as_echo "1208. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:15: test-ovsdb trigger \"\`ordinal_schema\`\" \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 10, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-trigger.at:15" -( $at_check_trace; test-ovsdb trigger "`ordinal_schema`" \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 10, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:15" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:15: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-trigger.at:15" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "t=0: trigger 0 (immediate): [{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{},{\"uuid\":[\"uuid\",\"<2>\"]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:15" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1208 -#AT_START_1209 -at_fn_group_banner 1209 'ovsdb-trigger.at:38' \ - "trigger times out" " " 71 -at_xfail=no -( - $as_echo "1209. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:38: test-ovsdb trigger \"\`ordinal_schema\`\" \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 10, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]' \\ - '[\"advance\", 10]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-trigger.at:38" -( $at_check_trace; test-ovsdb trigger "`ordinal_schema`" \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 10, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' \ - '["advance", 10]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:38" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:38: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-trigger.at:38" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "t=0: new trigger 0 -t=10: trigger 0 (delayed): [{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out after 10 ms\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:38" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1209 -#AT_START_1210 -at_fn_group_banner 1210 'ovsdb-trigger.at:61' \ - "trigger fires after delay" " " 71 -at_xfail=no -( - $as_echo "1210. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:61: test-ovsdb trigger \"\`ordinal_schema\`\" \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"wait\", - \"timeout\": 10, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-trigger.at:61" -( $at_check_trace; test-ovsdb trigger "`ordinal_schema`" \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "wait", - "timeout": 10, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:61: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-trigger.at:61" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "t=0: trigger 0 (immediate): [{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -t=5: new trigger 1 -t=10: trigger 2 (immediate): [{\"uuid\":[\"uuid\",\"<2>\"]}] -t=10: trigger 1 (delayed): [{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1210 -#AT_START_1211 -at_fn_group_banner 1211 'ovsdb-trigger.at:92' \ - "delayed trigger modifies database" " " 71 -at_xfail=no -( - $as_echo "1211. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:92: test-ovsdb trigger \"\`ordinal_schema\`\" \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"wait\", - \"timeout\": 10, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"<\", 2]]}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-trigger.at:92" -( $at_check_trace; test-ovsdb trigger "`ordinal_schema`" \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "wait", - "timeout": 10, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}, - {"op": "delete", - "table": "ordinals", - "where": [["number", "<", 2]]}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:92" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:92: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-trigger.at:92" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "t=0: trigger 0 (immediate): [{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -t=5: new trigger 1 -t=10: trigger 2 (immediate): [{\"uuid\":[\"uuid\",\"<2>\"]}] -t=10: trigger 1 (delayed): [{},{\"count\":2}] -t=15: trigger 3 (immediate): [{\"rows\":[{\"_uuid\":[\"uuid\",\"<2>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"two\",\"number\":2}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:92" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1211 -#AT_START_1212 -at_fn_group_banner 1212 'ovsdb-trigger.at:132' \ - "one delayed trigger wakes up another" " " 71 -at_xfail=no -( - $as_echo "1212. $at_setup_line: testing $at_desc ..." - $at_traceon - - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:132: test-ovsdb trigger \"\`ordinal_schema\`\" \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"wait\", - \"timeout\": 10, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"two\", \"number\": 2}]}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 2]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 3, \"name\": \"three\"}}]' \\ - '[\"ordinals\", - {\"op\": \"wait\", - \"timeout\": 10, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"<\", 2]]}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]' \\ - '[\"advance\", 5]' \\ - '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-trigger.at:132" -( $at_check_trace; test-ovsdb trigger "`ordinal_schema`" \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "wait", - "timeout": 10, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "two", "number": 2}]}, - {"op": "delete", - "table": "ordinals", - "where": [["number", "==", 2]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 3, "name": "three"}}]' \ - '["ordinals", - {"op": "wait", - "timeout": 10, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}, - {"op": "delete", - "table": "ordinals", - "where": [["number", "<", 2]]}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' \ - '["advance", 5]' \ - '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:132" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-trigger.at:132: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-trigger.at:132" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "t=0: trigger 0 (immediate): [{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -t=5: new trigger 1 -t=5: new trigger 2 -t=10: trigger 3 (immediate): [{\"uuid\":[\"uuid\",\"<2>\"]}] -t=10: trigger 2 (delayed): [{},{\"count\":2}] -t=15: trigger 1 (delayed): [{},{\"count\":1},{\"uuid\":[\"uuid\",\"<3>\"]}] -t=15: trigger 4 (immediate): [{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"_version\":[\"uuid\",\"<4>\"],\"name\":\"three\",\"number\":3}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-trigger.at:132" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1212 -#AT_START_1213 -at_fn_group_banner 1213 'ovsdb-tool.at:30' \ - "insert default row, query table" " " 72 -at_xfail=no -( - $as_echo "1213. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1213 -#AT_START_1214 -at_fn_group_banner 1214 'ovsdb-tool.at:30' \ - "insert row, query table" " " 72 -at_xfail=no -( - $as_echo "1214. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1214 -#AT_START_1215 -at_fn_group_banner 1215 'ovsdb-tool.at:30' \ - "insert rows, query by value" " " 72 -at_xfail=no -( - $as_echo "1215. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1215 -#AT_START_1216 -at_fn_group_banner 1216 'ovsdb-tool.at:30' \ - "insert rows, query by named-uuid" " " 72 -at_xfail=no -( - $as_echo "1216. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"second\"]]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "second"]]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1216 -#AT_START_1217 -at_fn_group_banner 1217 'ovsdb-tool.at:30' \ - "insert rows, update rows by value" " " 72 -at_xfail=no -( - $as_echo "1217. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"row\": {\"name\": \"nought\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "row": {"name": "nought"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"nought\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1217 -#AT_START_1218 -at_fn_group_banner 1218 'ovsdb-tool.at:30' \ - "insert rows, mutate rows" " " 72 -at_xfail=no -( - $as_echo "1218. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"mutations\": [[\"number\", \"+=\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "mutations": [["number", "+=", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1},{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"zero\",\"number\":2}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1218 -#AT_START_1219 -at_fn_group_banner 1219 'ovsdb-tool.at:30' \ - "insert rows, delete by named-uuid" " " 72 -at_xfail=no -( - $as_echo "1219. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":1},{\"rows\":[{\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1219 -#AT_START_1220 -at_fn_group_banner 1220 'ovsdb-tool.at:30' \ - "insert rows, delete rows by value" " " 72 -at_xfail=no -( - $as_echo "1220. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1220 -#AT_START_1221 -at_fn_group_banner 1221 'ovsdb-tool.at:30' \ - "insert rows, delete by (non-matching) value" " " 72 -at_xfail=no -( - $as_echo "1221. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"nought\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "nought"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":0}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1221 -#AT_START_1222 -at_fn_group_banner 1222 'ovsdb-tool.at:30' \ - "insert rows, delete all" " " 72 -at_xfail=no -( - $as_echo "1222. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":2},{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1222 -#AT_START_1223 -at_fn_group_banner 1223 'ovsdb-tool.at:30' \ - "insert row, query table, commit" " " 72 -at_xfail=no -( - $as_echo "1223. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": false}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": false}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1223 -#AT_START_1224 -at_fn_group_banner 1224 'ovsdb-tool.at:30' \ - "insert row, query table, commit durably" " " 72 -at_xfail=no -( - $as_echo "1224. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": true}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": true}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1224 -#AT_START_1225 -at_fn_group_banner 1225 'ovsdb-tool.at:30' \ - "equality wait with correct rows" " " 72 -at_xfail=no -( - $as_echo "1225. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1225 -#AT_START_1226 -at_fn_group_banner 1226 'ovsdb-tool.at:30' \ - "equality wait with extra row" " " 72 -at_xfail=no -( - $as_echo "1226. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1226 -#AT_START_1227 -at_fn_group_banner 1227 'ovsdb-tool.at:30' \ - "equality wait with missing row" " " 72 -at_xfail=no -( - $as_echo "1227. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1227 -#AT_START_1228 -at_fn_group_banner 1228 'ovsdb-tool.at:30' \ - "inequality wait with correct rows" " " 72 -at_xfail=no -( - $as_echo "1228. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1228 -#AT_START_1229 -at_fn_group_banner 1229 'ovsdb-tool.at:30' \ - "inequality wait with extra row" " " 72 -at_xfail=no -( - $as_echo "1229. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1229 -#AT_START_1230 -at_fn_group_banner 1230 'ovsdb-tool.at:30' \ - "inequality wait with missing row" " " 72 -at_xfail=no -( - $as_echo "1230. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1230 -#AT_START_1231 -at_fn_group_banner 1231 'ovsdb-tool.at:30' \ - "insert and update constraints" " " 72 -at_xfail=no -( - $as_echo "1231. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - constraint_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "insert", - "table": "constrained", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": -1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": -1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"update\", - \"table\": \"constrained\", - \"where\": [], - \"row\": {\"positive\": -2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "update", - "table": "constrained", - "where": [], - "row": {"positive": -2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"details\":\"0 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-1 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-2 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"transaction causes \\\"constrained\\\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)\",\"error\":\"constraint violation\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1231 -#AT_START_1232 -at_fn_group_banner 1232 'ovsdb-tool.at:30' \ - "index uniqueness checking" " " 72 -at_xfail=no -( - $as_echo "1232. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}, - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"still another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "still another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [], - \"row\": {\"number\": 3}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [], - "row": {"number": 3}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 1]], - \"row\": {\"number\": 2, \"name\": \"old two\"}}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"two\"]], - \"row\": {\"number\": 1, \"name\": \"old one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 1]], - "row": {"number": 2, "name": "old two"}}, - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "two"]], - "row": {"number": 1, "name": "old one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [], - \"mutations\": [[\"number\", \"*=\", 10]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"new one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"new two\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"number\", \"name\"], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [], - "mutations": [["number", "*=", 10]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "new one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "new two"}}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["number", "name"], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <0>, existed in the database before this transaction and was not modified by the transaction. Second row, with UUID <1>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"count\":1}] -[{\"count\":1},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <4>, was inserted by this transaction. Second row, with UUID <3>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<5>\"]}] -[{\"count\":2},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (3) for index on column \\\"number\\\". First row, with UUID <5>, had the following index values before the transaction: 2. Second row, with UUID <2>, had the following index values before the transaction: 1.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"count\":1}] -[{\"count\":2},{\"uuid\":[\"uuid\",\"<6>\"]},{\"uuid\":[\"uuid\",\"<7>\"]},{\"rows\":[{\"name\":\"new one\",\"number\":1},{\"name\":\"new two\",\"number\":2},{\"name\":\"old one\",\"number\":10},{\"name\":\"old two\",\"number\":20}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1232 -#AT_START_1233 -at_fn_group_banner 1233 'ovsdb-tool.at:30' \ - "referential integrity -- simple" " " 72 -at_xfail=no -( - $as_echo "1233. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - constraint_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1}, - \"uuid-name\": \"brow\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "insert", - "table": "b", - "row": {"b": 1}, - "uuid-name": "brow"}, - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2b": ["set", [["named-uuid", "brow"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"constraints\", - {\"op\": \"mutate\", - \"table\": \"b\", - \"where\": [], - \"mutations\": [[\"x\", \"delete\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["constraints", - {"op": "mutate", - "table": "b", - "where": [], - "mutations": [["x", "delete", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 3 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"details\":\"Attempted to store 0 elements in set of 1 to 2 integers.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 2 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1233 -#AT_START_1234 -at_fn_group_banner 1234 'ovsdb-tool.at:30' \ - "referential integrity -- mutual references" " " 72 -at_xfail=no -( - $as_echo "1234. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - constraint_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1, - \"b2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"b2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row2\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "row2"]]], - "a2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "b", - "row": {"b": 1, - "b2b": ["set", [["named-uuid", "row2"]]], - "b2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row2"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2b\": [\"set\", [[\"uuid\", \"b516b960-5b19-4fc2-bb82-fe1cbd6d0241\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "insert", - "table": "a", - "row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}, - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}, - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"details\":\"Table a column a2b row <2> references nonexistent row <3> in table b.\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1234 -#AT_START_1235 -at_fn_group_banner 1235 'ovsdb-tool.at:30' \ - "weak references" " " 72 -at_xfail=no -( - $as_echo "1235. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - weak_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"], - [\"uuid\", \"0e767b36-6822-4044-8307-d58467e04669\"]]], - \"a2a1\": [\"named-uuid\", \"row1\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row4\"]}}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 2, - \"b2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row3\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 3, - \"b2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row4\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"], - ["uuid", "0e767b36-6822-4044-8307-d58467e04669"]]], - "a2a1": ["named-uuid", "row1"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row4"]}}, - {"op": "insert", - "table": "b", - "row": {"b": 2, - "b2a": ["named-uuid", "row1"]}, - "uuid-name": "row3"}, - {"op": "insert", - "table": "b", - "row": {"b": 3, - "b2a": ["named-uuid", "row2"]}, - "uuid-name": "row4"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2a1\": [\"named-uuid\", \"me\"]}, - \"uuid-name\": \"me\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["weak", - {"op": "insert", - "table": "a", - "row": {"a2a1": ["named-uuid", "me"]}, - "uuid-name": "me"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 3]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["weak", - {"op": "delete", - "table": "b", - "where": [["b", "==", 3]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<2>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<4>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"details\":\"Weak reference column \\\"a2b\\\" in \\\"a\\\" row <5> (inserted within this transaction) contained all-zeros UUID (probably as the default value for this column) but deleting this value caused a constraint volation because this column is not allowed to be empty.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2b\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2a1\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"uuid\",\"<1>\"],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"set\",[]]}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1235 -#AT_START_1236 -at_fn_group_banner 1236 'ovsdb-tool.at:30' \ - "immutable columns" " " 72 -at_xfail=no -( - $as_echo "1236. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - immutable_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"immutable\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["immutable", - {"op": "insert", - "table": "a", - "row": {"i": 5}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 10}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 10}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 5}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"-=\", 5]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "-=", 5]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"*=\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "*=", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":10},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":5},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"-=\\\",5]\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"*=\\\",1]\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1236 -#AT_START_1237 -at_fn_group_banner 1237 'ovsdb-tool.at:30' \ - "garbage collection" " " 72 -at_xfail=no -( - $as_echo "1237. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - gc_schema > schema - touch .db.~lock~ - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, \"a2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, \"a2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, \"a2a\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 3}, - \"uuid-name\": \"row3\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0, "a2a": ["named-uuid", "row1"]}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, "a2a": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, "a2a": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 3}, - "uuid-name": "row3"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 4, \"a2a\": [\"named-uuid\", \"row5\"]}, - \"uuid-name\": \"row4\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 5, \"a2a\": [\"named-uuid\", \"row4\"]}, - \"uuid-name\": \"row5\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 4, "a2a": ["named-uuid", "row5"]}, - "uuid-name": "row4"}, - {"op": "insert", - "table": "a", - "row": {"a": 5, "a2a": ["named-uuid", "row4"]}, - "uuid-name": "row5"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 4]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 4]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 6, \"wa2a\": [\"named-uuid\", \"row7\"]}, - \"uuid-name\": \"row6\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 7, \"wa2a\": [\"named-uuid\", \"row6\"]}, - \"uuid-name\": \"row7\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 6, "wa2a": ["named-uuid", "row7"]}, - "uuid-name": "row6"}, - {"op": "insert", - "table": "a", - "row": {"a": 7, "wa2a": ["named-uuid", "row6"]}, - "uuid-name": "row7"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 8, \"a2a\": [\"named-uuid\", \"row9\"]}, - \"uuid-name\": \"row8\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 9, \"a2a\": [\"named-uuid\", \"row10\"]}, - \"uuid-name\": \"row9\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 10, \"a2a\": [\"named-uuid\", \"row11\"]}, - \"uuid-name\": \"row10\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 11, \"a2a\": [\"named-uuid\", \"row8\"]}, - \"uuid-name\": \"row11\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 8, "a2a": ["named-uuid", "row9"]}, - "uuid-name": "row8"}, - {"op": "insert", - "table": "a", - "row": {"a": 9, "a2a": ["named-uuid", "row10"]}, - "uuid-name": "row9"}, - {"op": "insert", - "table": "a", - "row": {"a": 10, "a2a": ["named-uuid", "row11"]}, - "uuid-name": "row10"}, - {"op": "insert", - "table": "a", - "row": {"a": 11, "a2a": ["named-uuid", "row8"]}, - "uuid-name": "row11"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 9]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 9]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 12, \"a2a\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 12, "a2a": ["named-uuid", "self"]}, - "uuid-name": "self"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: ovsdb-tool transact db '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:30" -( $at_check_trace; ovsdb-tool transact db '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-tool.at:30: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:30" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"uuid\":[\"uuid\",\"<6>\"]}] -[{\"rows\":[{\"a\":4},{\"a\":5}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<7>\"]},{\"uuid\":[\"uuid\",\"<8>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<9>\"]},{\"uuid\":[\"uuid\",\"<10>\"]},{\"uuid\":[\"uuid\",\"<11>\"]},{\"uuid\":[\"uuid\",\"<12>\"]}] -[{\"rows\":[{\"a\":8},{\"a\":9},{\"a\":10},{\"a\":11}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<13>\"]}] -[{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:30" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1237 -#AT_START_1238 -at_fn_group_banner 1238 'ovsdb-tool.at:32' \ - "transaction comments" " " 72 -at_xfail=no -( - $as_echo "1238. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -touch .db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:36: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:36" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:36" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:37: ovsdb-tool transact db ' - [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"name\": \"five\", \"number\": 5}}, - {\"op\": \"comment\", - \"comment\": \"add row for 5\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:37" -( $at_check_trace; ovsdb-tool transact db ' - ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"name": "five", "number": 5}}, - {"op": "comment", - "comment": "add row for 5"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:37" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:44: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:44" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:44" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:47: grep \"add row for 5\" db" -at_fn_check_prepare_trace "ovsdb-tool.at:47" -( $at_check_trace; grep "add row for 5" db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1238 -#AT_START_1239 -at_fn_group_banner 1239 'ovsdb-tool.at:50' \ - "ovsdb-tool compact" " " 72 -at_xfail=no -( - $as_echo "1239. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -ordinal_schema > schema -mkdir dir -: > dir/.db.~lock~ -ln -s dir/db db -$as_echo "ovsdb-tool.at:61" >"$at_check_line_file" -(test ! -h db) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-tool.at:61" -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:62: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:62" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:62" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:63: test ! -e .db.~lock" -at_fn_check_prepare_trace "ovsdb-tool.at:63" -( $at_check_trace; test ! -e .db.~lock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:63" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:64: test -h db" -at_fn_check_prepare_trace "ovsdb-tool.at:64" -( $at_check_trace; test -h db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:64" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:65: test -f dir/db" -at_fn_check_prepare_trace "ovsdb-tool.at:65" -( $at_check_trace; test -f dir/db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:65" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:67: for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do - set -- \$pair - ovsdb-tool transact db ' - [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"name\": \"'\$1'\", \"number\": '\$2'}}, - {\"op\": \"comment\", - \"comment\": \"add row for '\"\$pair\"'\"}]' - ovsdb-tool transact db ' - [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", '\$2']]}, - {\"op\": \"comment\", - \"comment\": \"delete row for '\"\$2\"'\"}]' - ovsdb-tool transact db ' - [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"name\": \"'\$1'\", \"number\": '\$2'}}, - {\"op\": \"comment\", - \"comment\": \"add back row for '\"\$pair\"'\"}]' - done" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:67" -( $at_check_trace; for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do - set -- $pair - ovsdb-tool transact db ' - ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"name": "'$1'", "number": '$2'}}, - {"op": "comment", - "comment": "add row for '"$pair"'"}]' - ovsdb-tool transact db ' - ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["number", "==", '$2']]}, - {"op": "comment", - "comment": "delete row for '"$2"'"}]' - ovsdb-tool transact db ' - ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"name": "'$1'", "number": '$2'}}, - {"op": "comment", - "comment": "add back row for '"$pair"'"}]' - done -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:67" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:94: \${PERL} \$srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/\"_date\":[0-9]*/\"_date\":0/' | ovstest test-json --multiple -" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:94" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"cksum\":\"12345678 9\",\"name\":\"ordinals\",\"tables\":{\"ordinals\":{\"columns\":{\"name\":{\"type\":\"string\"},\"number\":{\"type\":\"integer\"}},\"indexes\":[[\"number\"]]}},\"version\":\"5.1.3\"} -{\"_comment\":\"add row for zero 0\",\"_date\":0,\"ordinals\":{\"<0>\":{\"name\":\"zero\"}}} -{\"_comment\":\"delete row for 0\",\"_date\":0,\"ordinals\":{\"<0>\":null}} -{\"_comment\":\"add back row for zero 0\",\"_date\":0,\"ordinals\":{\"<1>\":{\"name\":\"zero\"}}} -{\"_comment\":\"add row for one 1\",\"_date\":0,\"ordinals\":{\"<2>\":{\"name\":\"one\",\"number\":1}}} -{\"_comment\":\"delete row for 1\",\"_date\":0,\"ordinals\":{\"<2>\":null}} -{\"_comment\":\"add back row for one 1\",\"_date\":0,\"ordinals\":{\"<3>\":{\"name\":\"one\",\"number\":1}}} -{\"_comment\":\"add row for two 2\",\"_date\":0,\"ordinals\":{\"<4>\":{\"name\":\"two\",\"number\":2}}} -{\"_comment\":\"delete row for 2\",\"_date\":0,\"ordinals\":{\"<4>\":null}} -{\"_comment\":\"add back row for two 2\",\"_date\":0,\"ordinals\":{\"<5>\":{\"name\":\"two\",\"number\":2}}} -{\"_comment\":\"add row for three 3\",\"_date\":0,\"ordinals\":{\"<6>\":{\"name\":\"three\",\"number\":3}}} -{\"_comment\":\"delete row for 3\",\"_date\":0,\"ordinals\":{\"<6>\":null}} -{\"_comment\":\"add back row for three 3\",\"_date\":0,\"ordinals\":{\"<7>\":{\"name\":\"three\",\"number\":3}}} -{\"_comment\":\"add row for four 4\",\"_date\":0,\"ordinals\":{\"<8>\":{\"name\":\"four\",\"number\":4}}} -{\"_comment\":\"delete row for 4\",\"_date\":0,\"ordinals\":{\"<8>\":null}} -{\"_comment\":\"add back row for four 4\",\"_date\":0,\"ordinals\":{\"<9>\":{\"name\":\"four\",\"number\":4}}} -{\"_comment\":\"add row for five 5\",\"_date\":0,\"ordinals\":{\"<10>\":{\"name\":\"five\",\"number\":5}}} -{\"_comment\":\"delete row for 5\",\"_date\":0,\"ordinals\":{\"<10>\":null}} -{\"_comment\":\"add back row for five 5\",\"_date\":0,\"ordinals\":{\"<11>\":{\"name\":\"five\",\"number\":5}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:116: ovsdb-server --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket --run \"ovsdb-client dump unix:socket ordinals\" db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:116" -( $at_check_trace; ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:116" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:118: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:118" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid name number ------------------------------------- ----- ------ -<0> five 5 -<1> four 4 -<2> one 1 -<3> three 3 -<4> two 2 -<5> zero 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:118" -$at_failed && at_fn_log_failure -$at_traceon; } - -touch .db.tmp.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:131: ovsdb-tool compact db" -at_fn_check_prepare_trace "ovsdb-tool.at:131" -( $at_check_trace; ovsdb-tool compact db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:131" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:134: test ! -e .db.~lock" -at_fn_check_prepare_trace "ovsdb-tool.at:134" -( $at_check_trace; test ! -e .db.~lock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:134" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:135: test -h db" -at_fn_check_prepare_trace "ovsdb-tool.at:135" -( $at_check_trace; test -h db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:135" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:136: test -f dir/db" -at_fn_check_prepare_trace "ovsdb-tool.at:136" -( $at_check_trace; test -f dir/db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:141: test \`wc -l < db\` -eq 4" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:141" -( $at_check_trace; test `wc -l < db` -eq 4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:141" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:143: ovsdb-server --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket --run \"ovsdb-client dump unix:socket ordinals\" db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:143" -( $at_check_trace; ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:143" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:145: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:145" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid name number ------------------------------------- ----- ------ -<0> five 5 -<1> four 4 -<2> one 1 -<3> three 3 -<4> two 2 -<5> zero 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:145" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1239 -#AT_START_1240 -at_fn_group_banner 1240 'ovsdb-tool.at:158' \ - "ovsdb-tool convert -- removing a column" " " 72 -at_xfail=no -( - $as_echo "1240. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -ordinal_schema > schema -cat >new-schema <<'_ATEOF' -{"name": "ordinals", - "tables": { - "ordinals": { - "columns": { - "number": {"type": "integer"}}}}} -_ATEOF - -touch .db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:170: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:170" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:170" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:172: for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do - set -- \$pair - ovsdb-tool transact db ' - [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"name\": \"'\$1'\", \"number\": '\$2'}}, - {\"op\": \"comment\", - \"comment\": \"add row for '\"\$pair\"'\"}]' - done" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:172" -( $at_check_trace; for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do - set -- $pair - ovsdb-tool transact db ' - ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"name": "'$1'", "number": '$2'}}, - {"op": "comment", - "comment": "add row for '"$pair"'"}]' - done -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:172" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:185: ovsdb-server --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket --run \"ovsdb-client dump unix:socket ordinals\" db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:185" -( $at_check_trace; ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:187: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:187" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid name number ------------------------------------- ----- ------ -<0> five 5 -<1> four 4 -<2> one 1 -<3> three 3 -<4> two 2 -<5> zero 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:187" -$at_failed && at_fn_log_failure -$at_traceon; } - -touch .db.tmp.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:200: ovsdb-tool convert db new-schema" -at_fn_check_prepare_trace "ovsdb-tool.at:200" -( $at_check_trace; ovsdb-tool convert db new-schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:200" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:205: test \`wc -l < db\` -eq 4" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:205" -( $at_check_trace; test `wc -l < db` -eq 4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:205" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:207: ovsdb-server --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket --run \"ovsdb-client dump unix:socket ordinals\" db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:207" -( $at_check_trace; ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:207" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:209: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:209" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid number ------------------------------------- ------ -<0> 0 -<1> 1 -<2> 2 -<3> 3 -<4> 4 -<5> 5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:209" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1240 -#AT_START_1241 -at_fn_group_banner 1241 'ovsdb-tool.at:222' \ - "ovsdb-tool convert -- adding a column" " " 72 -at_xfail=no -( - $as_echo "1241. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -cat >schema <<'_ATEOF' -{"name": "ordinals", - "tables": { - "ordinals": { - "columns": { - "number": {"type": "integer"}}}}} -_ATEOF - -ordinal_schema > new-schema -touch .db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:234: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:234" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:234" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:236: for number in 0 1 2 3 4 5; do - ovsdb-tool transact db ' - [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": '\$number'}}, - {\"op\": \"comment\", - \"comment\": \"add row for '\"\$number\"'\"}]' - done" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-tool.at:236" -( $at_check_trace; for number in 0 1 2 3 4 5; do - ovsdb-tool transact db ' - ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": '$number'}}, - {"op": "comment", - "comment": "add row for '"$number"'"}]' - done -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:236" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:248: ovsdb-server --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket --run \"ovsdb-client dump unix:socket ordinals\" db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:248" -( $at_check_trace; ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:248" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:250: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:250" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid number ------------------------------------- ------ -<0> 0 -<1> 1 -<2> 2 -<3> 3 -<4> 4 -<5> 5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - -touch .db.tmp.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:263: ovsdb-tool convert db new-schema" -at_fn_check_prepare_trace "ovsdb-tool.at:263" -( $at_check_trace; ovsdb-tool convert db new-schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:268: test \`wc -l < db\` -eq 4" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:268" -( $at_check_trace; test `wc -l < db` -eq 4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:268" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:270: ovsdb-server --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket --run \"ovsdb-client dump unix:socket ordinals\" db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-tool.at:270" -( $at_check_trace; ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:270" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:272: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-tool.at:272" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid name number ------------------------------------- ---- ------ -<0> \"\" 0 -<1> \"\" 1 -<2> \"\" 2 -<3> \"\" 3 -<4> \"\" 4 -<5> \"\" 5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:272" -$at_failed && at_fn_log_failure \ -"db" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1241 -#AT_START_1242 -at_fn_group_banner 1242 'ovsdb-tool.at:285' \ - "ovsdb-tool schema-version" " " 72 -at_xfail=no -( - $as_echo "1242. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:288: ovsdb-tool schema-version schema" -at_fn_check_prepare_trace "ovsdb-tool.at:288" -( $at_check_trace; ovsdb-tool schema-version schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "5.1.3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:288" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1242 -#AT_START_1243 -at_fn_group_banner 1243 'ovsdb-tool.at:292' \ - "ovsdb-tool db-version" " " 72 -at_xfail=no -( - $as_echo "1243. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -touch .db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:296: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:296" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:296" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:297: ovsdb-tool db-version db" -at_fn_check_prepare_trace "ovsdb-tool.at:297" -( $at_check_trace; ovsdb-tool db-version db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "5.1.3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:297" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1243 -#AT_START_1244 -at_fn_group_banner 1244 'ovsdb-tool.at:301' \ - "ovsdb-tool schema-cksum" " " 72 -at_xfail=no -( - $as_echo "1244. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:304: ovsdb-tool schema-cksum schema" -at_fn_check_prepare_trace "ovsdb-tool.at:304" -( $at_check_trace; ovsdb-tool schema-cksum schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "12345678 9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:304" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1244 -#AT_START_1245 -at_fn_group_banner 1245 'ovsdb-tool.at:308' \ - "ovsdb-tool db-cksum" " " 72 -at_xfail=no -( - $as_echo "1245. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -touch .db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:312: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:312" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:312" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:313: ovsdb-tool db-cksum db" -at_fn_check_prepare_trace "ovsdb-tool.at:313" -( $at_check_trace; ovsdb-tool db-cksum db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "12345678 9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:313" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1245 -#AT_START_1246 -at_fn_group_banner 1246 'ovsdb-tool.at:317' \ - "ovsdb-tool needs-conversion (no conversion needed)" "" 72 -at_xfail=no -( - $as_echo "1246. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -touch .db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:321: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:321" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:322: ovsdb-tool needs-conversion db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:322" -( $at_check_trace; ovsdb-tool needs-conversion db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "no -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:322" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1246 -#AT_START_1247 -at_fn_group_banner 1247 'ovsdb-tool.at:326' \ - "ovsdb-tool needs-conversion (conversion needed)" "" 72 -at_xfail=no -( - $as_echo "1247. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -touch .db.~lock~ -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:330: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-tool.at:330" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:330" -$at_failed && at_fn_log_failure -$at_traceon; } - -sed 's/5\.1\.3/5.1.4/' < schema > schema2 -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:332: diff schema schema2" -at_fn_check_prepare_trace "ovsdb-tool.at:332" -( $at_check_trace; diff schema schema2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-tool.at:332" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-tool.at:333: ovsdb-tool needs-conversion db schema2" -at_fn_check_prepare_trace "ovsdb-tool.at:333" -( $at_check_trace; ovsdb-tool needs-conversion db schema2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "yes -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-tool.at:333" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1247 -#AT_START_1248 -at_fn_group_banner 1248 'ovsdb-server.at:39' \ - "insert default row, query table" " " 73 -at_xfail=no -( - $as_echo "1248. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1248 -#AT_START_1249 -at_fn_group_banner 1249 'ovsdb-server.at:39' \ - "insert row, query table" " " 73 -at_xfail=no -( - $as_echo "1249. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1249 -#AT_START_1250 -at_fn_group_banner 1250 'ovsdb-server.at:39' \ - "insert rows, query by value" " " 73 -at_xfail=no -( - $as_echo "1250. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1250 -#AT_START_1251 -at_fn_group_banner 1251 'ovsdb-server.at:39' \ - "insert rows, query by named-uuid" " " 73 -at_xfail=no -( - $as_echo "1251. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"second\"]]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "second"]]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1251 -#AT_START_1252 -at_fn_group_banner 1252 'ovsdb-server.at:39' \ - "insert rows, update rows by value" " " 73 -at_xfail=no -( - $as_echo "1252. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"row\": {\"name\": \"nought\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "row": {"name": "nought"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"nought\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1252 -#AT_START_1253 -at_fn_group_banner 1253 'ovsdb-server.at:39' \ - "insert rows, mutate rows" " " 73 -at_xfail=no -( - $as_echo "1253. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"mutations\": [[\"number\", \"+=\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "mutations": [["number", "+=", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1},{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"zero\",\"number\":2}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1253 -#AT_START_1254 -at_fn_group_banner 1254 'ovsdb-server.at:39' \ - "insert rows, delete by named-uuid" " " 73 -at_xfail=no -( - $as_echo "1254. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":1},{\"rows\":[{\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1254 -#AT_START_1255 -at_fn_group_banner 1255 'ovsdb-server.at:39' \ - "insert rows, delete rows by value" " " 73 -at_xfail=no -( - $as_echo "1255. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1255 -#AT_START_1256 -at_fn_group_banner 1256 'ovsdb-server.at:39' \ - "insert rows, delete by (non-matching) value" " " 73 -at_xfail=no -( - $as_echo "1256. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"nought\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "nought"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":0}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1256 -#AT_START_1257 -at_fn_group_banner 1257 'ovsdb-server.at:39' \ - "insert rows, delete all" " " 73 -at_xfail=no -( - $as_echo "1257. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":2},{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1257 -#AT_START_1258 -at_fn_group_banner 1258 'ovsdb-server.at:39' \ - "insert row, query table, commit" " " 73 -at_xfail=no -( - $as_echo "1258. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": false}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": false}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1258 -#AT_START_1259 -at_fn_group_banner 1259 'ovsdb-server.at:39' \ - "insert row, query table, commit durably" " " 73 -at_xfail=no -( - $as_echo "1259. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": true}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": true}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1259 -#AT_START_1260 -at_fn_group_banner 1260 'ovsdb-server.at:39' \ - "equality wait with correct rows" " " 73 -at_xfail=no -( - $as_echo "1260. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1260 -#AT_START_1261 -at_fn_group_banner 1261 'ovsdb-server.at:39' \ - "equality wait with extra row" " " 73 -at_xfail=no -( - $as_echo "1261. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1261 -#AT_START_1262 -at_fn_group_banner 1262 'ovsdb-server.at:39' \ - "equality wait with missing row" " " 73 -at_xfail=no -( - $as_echo "1262. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1262 -#AT_START_1263 -at_fn_group_banner 1263 'ovsdb-server.at:39' \ - "inequality wait with correct rows" " " 73 -at_xfail=no -( - $as_echo "1263. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1263 -#AT_START_1264 -at_fn_group_banner 1264 'ovsdb-server.at:39' \ - "inequality wait with extra row" " " 73 -at_xfail=no -( - $as_echo "1264. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1264 -#AT_START_1265 -at_fn_group_banner 1265 'ovsdb-server.at:39' \ - "inequality wait with missing row" " " 73 -at_xfail=no -( - $as_echo "1265. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1265 -#AT_START_1266 -at_fn_group_banner 1266 'ovsdb-server.at:39' \ - "insert and update constraints" " " 73 -at_xfail=no -( - $as_echo "1266. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - constraint_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": -1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": -1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"update\", - \"table\": \"constrained\", - \"where\": [], - \"row\": {\"positive\": -2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "update", - "table": "constrained", - "where": [], - "row": {"positive": -2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"details\":\"0 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-1 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-2 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"transaction causes \\\"constrained\\\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)\",\"error\":\"constraint violation\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1266 -#AT_START_1267 -at_fn_group_banner 1267 'ovsdb-server.at:39' \ - "index uniqueness checking" " " 73 -at_xfail=no -( - $as_echo "1267. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}, - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"still another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "still another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [], - \"row\": {\"number\": 3}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [], - "row": {"number": 3}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 1]], - \"row\": {\"number\": 2, \"name\": \"old two\"}}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"two\"]], - \"row\": {\"number\": 1, \"name\": \"old one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 1]], - "row": {"number": 2, "name": "old two"}}, - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "two"]], - "row": {"number": 1, "name": "old one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [], - \"mutations\": [[\"number\", \"*=\", 10]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"new one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"new two\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"number\", \"name\"], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [], - "mutations": [["number", "*=", 10]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "new one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "new two"}}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["number", "name"], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <0>, existed in the database before this transaction and was not modified by the transaction. Second row, with UUID <1>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"count\":1}] -[{\"count\":1},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <4>, was inserted by this transaction. Second row, with UUID <3>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<5>\"]}] -[{\"count\":2},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (3) for index on column \\\"number\\\". First row, with UUID <5>, had the following index values before the transaction: 2. Second row, with UUID <2>, had the following index values before the transaction: 1.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"count\":1}] -[{\"count\":2},{\"uuid\":[\"uuid\",\"<6>\"]},{\"uuid\":[\"uuid\",\"<7>\"]},{\"rows\":[{\"name\":\"new one\",\"number\":1},{\"name\":\"new two\",\"number\":2},{\"name\":\"old one\",\"number\":10},{\"name\":\"old two\",\"number\":20}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1267 -#AT_START_1268 -at_fn_group_banner 1268 'ovsdb-server.at:39' \ - "referential integrity -- simple" " " 73 -at_xfail=no -( - $as_echo "1268. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - constraint_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1}, - \"uuid-name\": \"brow\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "b", - "row": {"b": 1}, - "uuid-name": "brow"}, - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2b": ["set", [["named-uuid", "brow"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"constraints\", - {\"op\": \"mutate\", - \"table\": \"b\", - \"where\": [], - \"mutations\": [[\"x\", \"delete\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["constraints", - {"op": "mutate", - "table": "b", - "where": [], - "mutations": [["x", "delete", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 3 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"details\":\"Attempted to store 0 elements in set of 1 to 2 integers.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 2 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1268 -#AT_START_1269 -at_fn_group_banner 1269 'ovsdb-server.at:39' \ - "referential integrity -- mutual references" " " 73 -at_xfail=no -( - $as_echo "1269. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - constraint_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1, - \"b2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"b2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row2\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "row2"]]], - "a2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "b", - "row": {"b": 1, - "b2b": ["set", [["named-uuid", "row2"]]], - "b2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row2"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2b\": [\"set\", [[\"uuid\", \"b516b960-5b19-4fc2-bb82-fe1cbd6d0241\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "a", - "row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}, - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}, - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"details\":\"Table a column a2b row <2> references nonexistent row <3> in table b.\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1269 -#AT_START_1270 -at_fn_group_banner 1270 'ovsdb-server.at:39' \ - "weak references" " " 73 -at_xfail=no -( - $as_echo "1270. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - weak_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"], - [\"uuid\", \"0e767b36-6822-4044-8307-d58467e04669\"]]], - \"a2a1\": [\"named-uuid\", \"row1\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row4\"]}}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 2, - \"b2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row3\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 3, - \"b2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row4\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"], - ["uuid", "0e767b36-6822-4044-8307-d58467e04669"]]], - "a2a1": ["named-uuid", "row1"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row4"]}}, - {"op": "insert", - "table": "b", - "row": {"b": 2, - "b2a": ["named-uuid", "row1"]}, - "uuid-name": "row3"}, - {"op": "insert", - "table": "b", - "row": {"b": 3, - "b2a": ["named-uuid", "row2"]}, - "uuid-name": "row4"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2a1\": [\"named-uuid\", \"me\"]}, - \"uuid-name\": \"me\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["weak", - {"op": "insert", - "table": "a", - "row": {"a2a1": ["named-uuid", "me"]}, - "uuid-name": "me"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 3]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "b", - "where": [["b", "==", 3]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<2>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<4>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"details\":\"Weak reference column \\\"a2b\\\" in \\\"a\\\" row <5> (inserted within this transaction) contained all-zeros UUID (probably as the default value for this column) but deleting this value caused a constraint volation because this column is not allowed to be empty.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2b\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2a1\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"uuid\",\"<1>\"],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"set\",[]]}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1270 -#AT_START_1271 -at_fn_group_banner 1271 'ovsdb-server.at:39' \ - "immutable columns" " " 73 -at_xfail=no -( - $as_echo "1271. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - immutable_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"immutable\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["immutable", - {"op": "insert", - "table": "a", - "row": {"i": 5}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 10}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 10}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 5}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"-=\", 5]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "-=", 5]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"*=\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "*=", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":10},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":5},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"-=\\\",5]\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"*=\\\",1]\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1271 -#AT_START_1272 -at_fn_group_banner 1272 'ovsdb-server.at:39' \ - "garbage collection" " " 73 -at_xfail=no -( - $as_echo "1272. $at_setup_line: testing $at_desc ..." - $at_traceon - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - - gc_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:39" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, \"a2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, \"a2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, \"a2a\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 3}, - \"uuid-name\": \"row3\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0, "a2a": ["named-uuid", "row1"]}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, "a2a": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, "a2a": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 3}, - "uuid-name": "row3"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 4, \"a2a\": [\"named-uuid\", \"row5\"]}, - \"uuid-name\": \"row4\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 5, \"a2a\": [\"named-uuid\", \"row4\"]}, - \"uuid-name\": \"row5\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 4, "a2a": ["named-uuid", "row5"]}, - "uuid-name": "row4"}, - {"op": "insert", - "table": "a", - "row": {"a": 5, "a2a": ["named-uuid", "row4"]}, - "uuid-name": "row5"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 4]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 4]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 6, \"wa2a\": [\"named-uuid\", \"row7\"]}, - \"uuid-name\": \"row6\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 7, \"wa2a\": [\"named-uuid\", \"row6\"]}, - \"uuid-name\": \"row7\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 6, "wa2a": ["named-uuid", "row7"]}, - "uuid-name": "row6"}, - {"op": "insert", - "table": "a", - "row": {"a": 7, "wa2a": ["named-uuid", "row6"]}, - "uuid-name": "row7"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 8, \"a2a\": [\"named-uuid\", \"row9\"]}, - \"uuid-name\": \"row8\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 9, \"a2a\": [\"named-uuid\", \"row10\"]}, - \"uuid-name\": \"row9\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 10, \"a2a\": [\"named-uuid\", \"row11\"]}, - \"uuid-name\": \"row10\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 11, \"a2a\": [\"named-uuid\", \"row8\"]}, - \"uuid-name\": \"row11\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 8, "a2a": ["named-uuid", "row9"]}, - "uuid-name": "row8"}, - {"op": "insert", - "table": "a", - "row": {"a": 9, "a2a": ["named-uuid", "row10"]}, - "uuid-name": "row9"}, - {"op": "insert", - "table": "a", - "row": {"a": 10, "a2a": ["named-uuid", "row11"]}, - "uuid-name": "row10"}, - {"op": "insert", - "table": "a", - "row": {"a": 11, "a2a": ["named-uuid", "row8"]}, - "uuid-name": "row11"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 9]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 9]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 12, \"a2a\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 12, "a2a": ["named-uuid", "self"]}, - "uuid-name": "self"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovsdb-client transact unix:socket '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:39" -( $at_check_trace; ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:39" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"uuid\":[\"uuid\",\"<6>\"]}] -[{\"rows\":[{\"a\":4},{\"a\":5}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<7>\"]},{\"uuid\":[\"uuid\",\"<8>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<9>\"]},{\"uuid\":[\"uuid\",\"<10>\"]},{\"uuid\":[\"uuid\",\"<11>\"]},{\"uuid\":[\"uuid\",\"<12>\"]}] -[{\"rows\":[{\"a\":8},{\"a\":9},{\"a\":10},{\"a\":11}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<13>\"]}] -[{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:39: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:39" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:39" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1272 -#AT_START_1273 -at_fn_group_banner 1273 'ovsdb-server.at:43' \ - "truncating corrupted database log" " " 74 -at_xfail=no -( - $as_echo "1273. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:47: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:47" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:47" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket \ -'["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:55: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:55" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:55" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -echo 'xxx' >> db -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket \ -'["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:66: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:66" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:66" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:67: grep 'syntax error: db: parse error.* in header line \"xxx\"' stderr" -at_fn_check_prepare_trace "ovsdb-server.at:67" -( $at_check_trace; grep 'syntax error: db: parse error.* in header line "xxx"' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:67" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket \ -'["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:80: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:80" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:80" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:82: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:82" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:82" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1273 -#AT_START_1274 -at_fn_group_banner 1274 'ovsdb-server.at:90' \ - "truncating database log with bad transaction" " " 74 -at_xfail=no -( - $as_echo "1274. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:94: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:94" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:94" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket \ -'["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:102: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:102" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:102" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -echo 'OVSDB JSON 15 ffbcdae4b0386265f9ea3280dd7c8f0b72a20e56 -{"invalid":{}}' >> db -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket \ -'["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:114: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:114" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:114" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:115: grep 'syntax \"{\"invalid\":{}}\": unknown table: No table named invalid.' stderr" -at_fn_check_prepare_trace "ovsdb-server.at:115" -( $at_check_trace; grep 'syntax "{"invalid":{}}": unknown table: No table named invalid.' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:115" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket \ -'["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:128: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:128" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:128" -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:130: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:130" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:130" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1274 -#AT_START_1275 -at_fn_group_banner 1275 'ovsdb-server.at:138' \ - "ovsdb-client get-schema-version" " " 74 -at_xfail=no -( - $as_echo "1275. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:142: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:142" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:142" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:143: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:143" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --unixctl="`pwd`"/unixctl --remote=punix:socket db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:143" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:144: ovsdb-client get-schema-version unix:socket ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:144" -( $at_check_trace; ovsdb-client get-schema-version unix:socket ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "5.1.3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:144" -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:146: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:146" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:146: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:146" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:146" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1275 -#AT_START_1276 -at_fn_group_banner 1276 'ovsdb-server.at:149' \ - "database multiplexing implementation" " " 74 -at_xfail=no -( - $as_echo "1276. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -ordinal_schema > schema1 -constraint_schema > schema2 -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:154: ovsdb-tool create db1 schema1" -at_fn_check_prepare_trace "ovsdb-server.at:154" -( $at_check_trace; ovsdb-tool create db1 schema1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:154" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:155: ovsdb-tool create db2 schema2" -at_fn_check_prepare_trace "ovsdb-server.at:155" -( $at_check_trace; ovsdb-tool create db2 schema2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:155" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:156: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket db1 db2" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:156" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --unixctl="`pwd`"/unixctl --remote=punix:socket db1 db2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:157: ovsdb-client list-dbs unix:socket" -at_fn_check_prepare_trace "ovsdb-server.at:157" -( $at_check_trace; ovsdb-client list-dbs unix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "constraints -ordinals -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:157" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:162: ovstest test-jsonrpc request unix:socket get_schema [\\\"nonexistent\\\"]" -at_fn_check_prepare_trace "ovsdb-server.at:162" -( $at_check_trace; ovstest test-jsonrpc request unix:socket get_schema [\"nonexistent\"] -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"error\":null,\"id\":0,\"result\":{\"details\":\"get_schema request specifies unknown database nonexistent\",\"error\":\"unknown database\",\"syntax\":\"[\\\"nonexistent\\\"]\"}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:162" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:166: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:166" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:166" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:166: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:166" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:166" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1276 -#AT_START_1277 -at_fn_group_banner 1277 'ovsdb-server.at:169' \ - "ovsdb-server/add-db and remove-db" " " 74 -at_xfail=no -( - $as_echo "1277. $at_setup_line: testing $at_desc ..." - $at_traceon - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid` -EOF - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -ordinal_schema > schema1 -constraint_schema > schema2 -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:176: ovsdb-tool create db1 schema1" -at_fn_check_prepare_trace "ovsdb-server.at:176" -( $at_check_trace; ovsdb-tool create db1 schema1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:176" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:177: ovsdb-tool create db2 schema2" -at_fn_check_prepare_trace "ovsdb-server.at:177" -( $at_check_trace; ovsdb-tool create db2 schema2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:177" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Start ovsdb-server with just a single database - db1. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:180: ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db1" -at_fn_check_prepare_trace "ovsdb-server.at:180" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:180" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:181: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:181" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:181" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add the second database. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:186: ovs-appctl -t ovsdb-server ovsdb-server/add-db db2" -at_fn_check_prepare_trace "ovsdb-server.at:186" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-db db2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:186" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:187: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:187" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraints -ordinals -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:187" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# The databases are responsive. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:193: ovsdb-client list-tables unix:socket constraints" -at_fn_check_prepare_trace "ovsdb-server.at:193" -( $at_check_trace; ovsdb-client list-tables unix:socket constraints -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:193" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:194: ovsdb-client list-tables unix:socket ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:194" -( $at_check_trace; ovsdb-client list-tables unix:socket ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:194" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add an already added database. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:197: ovs-appctl -t ovsdb-server ovsdb-server/add-db db2" -at_fn_check_prepare_trace "ovsdb-server.at:197" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-db db2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "db2: already open -ovs-appctl: ovsdb-server: server returned an error -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovsdb-server.at:197" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add a non-existing database. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:203: ovs-appctl -t ovsdb-server ovsdb-server/add-db db3" -at_fn_check_prepare_trace "ovsdb-server.at:203" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-db db3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovsdb-server.at:203" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:204: sed 's/(.*)/(...)/' stderr" -at_fn_check_prepare_trace "ovsdb-server.at:204" -( $at_check_trace; sed 's/(.*)/(...)/' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "I/O error: open: db3 failed (...) -ovs-appctl: ovsdb-server: server returned an error -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:204" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add a remote through a db path in db1. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:210: ovs-appctl -t ovsdb-server ovsdb-server/add-remote db:ordinals,ordinals,name" -at_fn_check_prepare_trace "ovsdb-server.at:210" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-remote db:ordinals,ordinals,name -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:210" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:211: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:211" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "db:ordinals,ordinals,name -punix:socket -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:211" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Removing db1 has no effect on its remote. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:217: ovs-appctl -t ovsdb-server ovsdb-server/remove-db ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:217" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/remove-db ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:217" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:218: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:218" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraints -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:221: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:221" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "db:ordinals,ordinals,name -punix:socket -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:225: ovsdb-client list-tables unix:socket ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:225" -( $at_check_trace; ovsdb-client list-tables unix:socket ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-server.at:225" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Remove db2. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:228: ovs-appctl -t ovsdb-server ovsdb-server/remove-db constraints" -at_fn_check_prepare_trace "ovsdb-server.at:228" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/remove-db constraints -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:229: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:229" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:229" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:231: ovsdb-client list-tables unix:socket constraints" -at_fn_check_prepare_trace "ovsdb-server.at:231" -( $at_check_trace; ovsdb-client list-tables unix:socket constraints -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/ovsdb-server.at:231" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Remove a non-existent database. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:234: ovs-appctl -t ovsdb-server ovsdb-server/remove-db ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:234" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/remove-db ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "Failed to find the database. -ovs-appctl: ovsdb-server: server returned an error -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovsdb-server.at:234" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add a removed database. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:240: ovs-appctl -t ovsdb-server ovsdb-server/add-db db2" -at_fn_check_prepare_trace "ovsdb-server.at:240" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-db db2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:240" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:241: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:241" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraints -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:244: ovsdb-client list-tables unix:socket constraints" -at_fn_check_prepare_trace "ovsdb-server.at:244" -( $at_check_trace; ovsdb-client list-tables unix:socket constraints -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:244" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1277 -#AT_START_1278 -at_fn_group_banner 1278 'ovsdb-server.at:247' \ - "ovsdb-server/add-db with --monitor" " " 74 -at_xfail=no -( - $as_echo "1278. $at_setup_line: testing $at_desc ..." - $at_traceon - - -# Start ovsdb-server, initially with one db. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:253: ovsdb-tool create db1 schema" -at_fn_check_prepare_trace "ovsdb-server.at:253" -( $at_check_trace; ovsdb-tool create db1 schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:253" -$at_failed && at_fn_log_failure -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat *.pid` -EOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:255: ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db1" -at_fn_check_prepare_trace "ovsdb-server.at:255" -( $at_check_trace; ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add the second database. -constraint_schema > schema2 -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:259: ovsdb-tool create db2 schema2" -at_fn_check_prepare_trace "ovsdb-server.at:259" -( $at_check_trace; ovsdb-tool create db2 schema2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:259" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:260: ovs-appctl -t ovsdb-server ovsdb-server/add-db db2" -at_fn_check_prepare_trace "ovsdb-server.at:260" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-db db2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:260" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:261: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:261" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraints -ordinals -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:261" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Kill the daemon process, making it look like a segfault, -# and wait for a new daemon process to get spawned. -cp ovsdb-server.pid old.pid -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:269: kill -SEGV \`cat ovsdb-server.pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:269" -( $at_check_trace; kill -SEGV `cat ovsdb-server.pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:269" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:270: ovs_wait_cond () { if kill -0 \`cat old.pid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:270" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat old.pid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:270" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:271: ovs_wait_cond () { test -s ovsdb-server.pid && test \`cat ovsdb-server.pid\` != \`cat old.pid\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:271" -( $at_check_trace; ovs_wait_cond () { test -s ovsdb-server.pid && test `cat ovsdb-server.pid` != `cat old.pid` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:271" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:273: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:273" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "constraints -ordinals -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:273" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1278 -#AT_START_1279 -at_fn_group_banner 1279 'ovsdb-server.at:279' \ - "ovsdb-server/add-db and remove-db with --monitor" "" 74 -at_xfail=no -( - $as_echo "1279. $at_setup_line: testing $at_desc ..." - $at_traceon - - -# Start ovsdb-server, initially with one db. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:285: ovsdb-tool create db1 schema" -at_fn_check_prepare_trace "ovsdb-server.at:285" -( $at_check_trace; ovsdb-tool create db1 schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:285" -$at_failed && at_fn_log_failure -$at_traceon; } - -constraint_schema > schema2 -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:287: ovsdb-tool create db2 schema2" -at_fn_check_prepare_trace "ovsdb-server.at:287" -( $at_check_trace; ovsdb-tool create db2 schema2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:287" -$at_failed && at_fn_log_failure -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat *.pid` -EOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:289: ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db1 db2" -at_fn_check_prepare_trace "ovsdb-server.at:289" -( $at_check_trace; ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db1 db2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Remove the second database. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:292: ovs-appctl -t ovsdb-server ovsdb-server/remove-db constraints" -at_fn_check_prepare_trace "ovsdb-server.at:292" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/remove-db constraints -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:292" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:293: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:293" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Kill the daemon process, making it look like a segfault, -# and wait for a new daemon process to get spawned. -cp ovsdb-server.pid old.pid -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:300: kill -SEGV \`cat ovsdb-server.pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:300" -( $at_check_trace; kill -SEGV `cat ovsdb-server.pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:300" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:301: ovs_wait_cond () { if kill -0 \`cat old.pid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:301" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat old.pid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:302: ovs_wait_cond () { test -s ovsdb-server.pid && test \`cat ovsdb-server.pid\` != \`cat old.pid\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:302" -( $at_check_trace; ovs_wait_cond () { test -s ovsdb-server.pid && test `cat ovsdb-server.pid` != `cat old.pid` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:302" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:304: ovs-appctl -t ovsdb-server ovsdb-server/list-dbs" -at_fn_check_prepare_trace "ovsdb-server.at:304" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-dbs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:304" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1279 -#AT_START_1280 -at_fn_group_banner 1280 'ovsdb-server.at:309' \ - "--remote=db: implementation" " " 74 -at_xfail=no -( - $as_echo "1280. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -cat >schema <<'_ATEOF' -{"name": "mydb", - "tables": { - "Root": { - "columns": { - "managers": { - "type": { - "key": "string", - "min": 0, - "max": "unlimited"}}, - "manager_options": { - "type": { - "key": {"type": "uuid", "refTable": "Manager"}, - "min": 0, - "max": "unlimited"}}}}, - "Manager": { - "columns": { - "target": { - "type": "string"}, - "is_connected": { - "type": { - "key": "boolean", - "min": 0, - "max": 1}}}}}} -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:338: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:338" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:339: ovsdb-tool transact db \\ - '[\"mydb\", - {\"op\": \"insert\", - \"table\": \"Root\", - \"row\": { - \"managers\": \"punix:socket1\", - \"manager_options\": [\"set\", [[\"named-uuid\", \"x\"]]]}}, - {\"op\": \"insert\", - \"table\": \"Manager\", - \"uuid-name\": \"x\", - \"row\": {\"target\": \"punix:socket2\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:339" -( $at_check_trace; ovsdb-tool transact db \ - '["mydb", - {"op": "insert", - "table": "Root", - "row": { - "managers": "punix:socket1", - "manager_options": ["set", [["named-uuid", "x"]]]}}, - {"op": "insert", - "table": "Manager", - "uuid-name": "x", - "row": {"target": "punix:socket2"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:339" -$at_failed && at_fn_log_failure -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid` -EOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:352: ovsdb-server --enable-dummy --detach --no-chdir --pidfile --remote=db:mydb,Root,managers --remote=db:mydb,Root,manager_options --log-file db" -at_fn_check_prepare_trace "ovsdb-server.at:352" -( $at_check_trace; ovsdb-server --enable-dummy --detach --no-chdir --pidfile --remote=db:mydb,Root,managers --remote=db:mydb,Root,manager_options --log-file db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:352" -$at_failed && at_fn_log_failure -$at_traceon; } - -for i in 1 2 3 4 5 6; do ovs-appctl -t ovsdb-server time/warp 1000; done -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:354: ovsdb-client transact unix:socket1 \\ - '[\"mydb\", - {\"op\": \"select\", - \"table\": \"Root\", - \"where\": [], - \"columns\": [\"managers\"]}, - {\"op\": \"select\", - \"table\": \"Manager\", - \"where\": [], - \"columns\": [\"target\", \"is_connected\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:354" -( $at_check_trace; ovsdb-client transact unix:socket1 \ - '["mydb", - {"op": "select", - "table": "Root", - "where": [], - "columns": ["managers"]}, - {"op": "select", - "table": "Manager", - "where": [], - "columns": ["target", "is_connected"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:366: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:366" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"rows\":[{\"managers\":\"punix:socket1\"}]},{\"rows\":[{\"is_connected\":false,\"target\":\"punix:socket2\"}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:366" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1280 -#AT_START_1281 -at_fn_group_banner 1281 'ovsdb-server.at:374' \ - "ovsdb-server/add-remote and remove-remote" " " 74 -at_xfail=no -( - $as_echo "1281. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:379: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:379" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:379" -$at_failed && at_fn_log_failure -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat *.pid` -EOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:381: ovsdb-server --detach --no-chdir --pidfile db" -at_fn_check_prepare_trace "ovsdb-server.at:381" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:381" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:383: test ! -e socket1" -at_fn_check_prepare_trace "ovsdb-server.at:383" -( $at_check_trace; test ! -e socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:383" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:384: ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket1" -at_fn_check_prepare_trace "ovsdb-server.at:384" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:384" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:385: ovs_wait_cond () { test -S socket1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:385" -( $at_check_trace; ovs_wait_cond () { test -S socket1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:385" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:386: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:386" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "punix:socket1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:386" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:390: test ! -e socket2" -at_fn_check_prepare_trace "ovsdb-server.at:390" -( $at_check_trace; test ! -e socket2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:390" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:391: ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket2" -at_fn_check_prepare_trace "ovsdb-server.at:391" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:391" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:392: ovs_wait_cond () { test -S socket2 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:392" -( $at_check_trace; ovs_wait_cond () { test -S socket2 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:392" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:393: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:393" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "punix:socket1 -punix:socket2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:393" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:398: ovs-appctl -t ovsdb-server ovsdb-server/add-remote db:x,y,z" -at_fn_check_prepare_trace "ovsdb-server.at:398" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-remote db:x,y,z -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "\"db:x,y,z\": no database named x -ovs-appctl: ovsdb-server: server returned an error -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovsdb-server.at:398" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:403: ovs-appctl -t ovsdb-server ovsdb-server/remove-remote punix:socket1" -at_fn_check_prepare_trace "ovsdb-server.at:403" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/remove-remote punix:socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:403" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:404: ovs_wait_cond () { test ! -e socket1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:404" -( $at_check_trace; ovs_wait_cond () { test ! -e socket1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:404" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:405: test -S socket2" -at_fn_check_prepare_trace "ovsdb-server.at:405" -( $at_check_trace; test -S socket2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:405" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:406: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:406" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "punix:socket2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:406" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:410: ovs-appctl -t ovsdb-server ovsdb-server/remove-remote punix:socket2" -at_fn_check_prepare_trace "ovsdb-server.at:410" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/remove-remote punix:socket2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:410" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:411: ovs_wait_cond () { test ! -e socket2 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:411" -( $at_check_trace; ovs_wait_cond () { test ! -e socket2 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:412: test ! -e socket1" -at_fn_check_prepare_trace "ovsdb-server.at:412" -( $at_check_trace; test ! -e socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:412" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:413: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:413" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1281 -#AT_START_1282 -at_fn_group_banner 1282 'ovsdb-server.at:416' \ - "ovsdb-server/add-remote with --monitor" " " 74 -at_xfail=no -( - $as_echo "1282. $at_setup_line: testing $at_desc ..." - $at_traceon - - -# Start ovsdb-server, initially with no remotes. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:422: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:422" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:422" -$at_failed && at_fn_log_failure -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat *.pid` -EOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:424: ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db" -at_fn_check_prepare_trace "ovsdb-server.at:424" -( $at_check_trace; ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:424" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add a remote. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:427: test ! -e socket1" -at_fn_check_prepare_trace "ovsdb-server.at:427" -( $at_check_trace; test ! -e socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:427" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:428: ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket1" -at_fn_check_prepare_trace "ovsdb-server.at:428" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:428" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:429: ovs_wait_cond () { test -S socket1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:429" -( $at_check_trace; ovs_wait_cond () { test -S socket1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:429" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:430: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:430" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "punix:socket1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:430" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Kill the daemon process, making it look like a segfault, -# and wait for a new daemon process to get spawned and for it to -# start listening on 'socket1'. -cp ovsdb-server.pid old.pid -rm socket1 -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:439: kill -SEGV \`cat ovsdb-server.pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:439" -( $at_check_trace; kill -SEGV `cat ovsdb-server.pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:439" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:440: ovs_wait_cond () { if kill -0 \`cat old.pid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:440" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat old.pid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:440" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:441: ovs_wait_cond () { test -s ovsdb-server.pid && test \`cat ovsdb-server.pid\` != \`cat old.pid\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:441" -( $at_check_trace; ovs_wait_cond () { test -s ovsdb-server.pid && test `cat ovsdb-server.pid` != `cat old.pid` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:441" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:443: ovs_wait_cond () { test -S socket1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:443" -( $at_check_trace; ovs_wait_cond () { test -S socket1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:443" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1282 -#AT_START_1283 -at_fn_group_banner 1283 'ovsdb-server.at:446' \ - "ovsdb-server/add-remote and remove-remote with --monitor" "" 74 -at_xfail=no -( - $as_echo "1283. $at_setup_line: testing $at_desc ..." - $at_traceon - - -# Start ovsdb-server, initially with no remotes. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:452: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:452" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:452" -$at_failed && at_fn_log_failure -$at_traceon; } - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat *.pid` -EOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:454: ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db" -at_fn_check_prepare_trace "ovsdb-server.at:454" -( $at_check_trace; ovsdb-server -v -vvlog:off --monitor --detach --no-chdir --pidfile --log-file db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:454" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Add a remote. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:457: test ! -e socket1" -at_fn_check_prepare_trace "ovsdb-server.at:457" -( $at_check_trace; test ! -e socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:457" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:458: ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket1" -at_fn_check_prepare_trace "ovsdb-server.at:458" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/add-remote punix:socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:458" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:459: ovs_wait_cond () { test -S socket1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:459" -( $at_check_trace; ovs_wait_cond () { test -S socket1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:459" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:460: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:460" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "punix:socket1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:460" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Remove the remote. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:465: ovs-appctl -t ovsdb-server ovsdb-server/remove-remote punix:socket1" -at_fn_check_prepare_trace "ovsdb-server.at:465" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/remove-remote punix:socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:465" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:466: ovs_wait_cond () { test ! -e socket1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:466" -( $at_check_trace; ovs_wait_cond () { test ! -e socket1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:466" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:467: ovs-appctl -t ovsdb-server ovsdb-server/list-remotes" -at_fn_check_prepare_trace "ovsdb-server.at:467" -( $at_check_trace; ovs-appctl -t ovsdb-server ovsdb-server/list-remotes -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:467" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Kill the daemon process, making it look like a segfault, -# and wait for a new daemon process to get spawned and make sure that it -# does not listen on 'socket1'. -cp ovsdb-server.pid old.pid -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:473: kill -SEGV \`cat ovsdb-server.pid\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:473" -( $at_check_trace; kill -SEGV `cat ovsdb-server.pid` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:473" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:474: ovs_wait_cond () { if kill -0 \`cat old.pid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:474" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat old.pid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:474" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:475: ovs_wait_cond () { test -s ovsdb-server.pid && test \`cat ovsdb-server.pid\` != \`cat old.pid\` -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:475" -( $at_check_trace; ovs_wait_cond () { test -s ovsdb-server.pid && test `cat ovsdb-server.pid` != `cat old.pid` -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:475" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:477: test ! -e socket1" -at_fn_check_prepare_trace "ovsdb-server.at:477" -( $at_check_trace; test ! -e socket1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:477" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1283 -#AT_START_1284 -at_fn_group_banner 1284 'ovsdb-server.at:480' \ - "SSL db: implementation" " " 74 -at_xfail=no -( - $as_echo "1284. $at_setup_line: testing $at_desc ..." - $at_traceon - - -$as_echo "ovsdb-server.at:482" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:482" -PKIDIR=$abs_top_builddir/tests -$as_echo "ovsdb-server.at:484" >"$at_check_line_file" -(expr "$PKIDIR" : ".* '\" -\\") \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:484" -cat >schema <<'_ATEOF' -{"name": "mydb", - "tables": { - "SSL": { - "columns": { - "private_key": {"type": "string"}, - "certificate": {"type": "string"}, - "ca_cert": {"type": "string"}}}}} -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:495: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:495" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:495" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:496: ovsdb-tool transact db \\ - '[\"mydb\", - {\"op\": \"insert\", - \"table\": \"SSL\", - \"row\": {\"private_key\": \"'\"\$PKIDIR/testpki-privkey2.pem\"'\", - \"certificate\": \"'\"\$PKIDIR/testpki-cert2.pem\"'\", - \"ca_cert\": \"'\"\$PKIDIR/testpki-cacert.pem\"'\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:496" -( $at_check_trace; ovsdb-tool transact db \ - '["mydb", - {"op": "insert", - "table": "SSL", - "row": {"private_key": "'"$PKIDIR/testpki-privkey2.pem"'", - "certificate": "'"$PKIDIR/testpki-cert2.pem"'", - "ca_cert": "'"$PKIDIR/testpki-cacert.pem"'"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:496" -$at_failed && at_fn_log_failure -$at_traceon; } - -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:506: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid \\ - --private-key=db:mydb,SSL,private_key \\ - --certificate=db:mydb,SSL,certificate \\ - --ca-cert=db:mydb,SSL,ca_cert \\ - --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:506" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid \ - --private-key=db:mydb,SSL,private_key \ - --certificate=db:mydb,SSL,certificate \ - --ca-cert=db:mydb,SSL,ca_cert \ - --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:506" -$at_failed && at_fn_log_failure -$at_traceon; } - -SSL_PORT=`parse_listening_port < ovsdb-server.log` -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:514: ovsdb-client \\ - --private-key=\$PKIDIR/testpki-privkey.pem \\ - --certificate=\$PKIDIR/testpki-cert.pem \\ - --ca-cert=\$PKIDIR/testpki-cacert.pem \\ - transact ssl:127.0.0.1:\$SSL_PORT \\ - '[\"mydb\", - {\"op\": \"select\", - \"table\": \"SSL\", - \"where\": [], - \"columns\": [\"private_key\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:514" -( $at_check_trace; ovsdb-client \ - --private-key=$PKIDIR/testpki-privkey.pem \ - --certificate=$PKIDIR/testpki-cert.pem \ - --ca-cert=$PKIDIR/testpki-cacert.pem \ - transact ssl:127.0.0.1:$SSL_PORT \ - '["mydb", - {"op": "select", - "table": "SSL", - "where": [], - "columns": ["private_key"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:514" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:527: cat output" -at_fn_check_prepare_trace "ovsdb-server.at:527" -( $at_check_trace; cat output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"rows\":[{\"private_key\":\"$PKIDIR/testpki-privkey2.pem\"}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:527" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:531: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:531" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:531" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:531: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:531" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:531" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1284 -#AT_START_1285 -at_fn_group_banner 1285 'ovsdb-server.at:534' \ - "compacting online" " " 74 -at_xfail=no -( - $as_echo "1285. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -ordinal_schema > schema -mkdir dir -ln -s dir/db db -ln -s dir/.db.~lock~ .db.~lock~ -$as_echo "ovsdb-server.at:544" >"$at_check_line_file" -(test ! -h db || test ! -h .db.~lock~) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:544" -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:545: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:545" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:547: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --unixctl=\"\`pwd\`\"/unixctl --remote=punix:socket --log-file=\"\`pwd\`\"/ovsdb-server.log db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:547" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --unixctl="`pwd`"/unixctl --remote=punix:socket --log-file="`pwd`"/ovsdb-server.log db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:547" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:550: for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do - set -- \$pair - ovsdb-client transact unix:socket ' - [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"name\": \"'\$1'\", \"number\": '\$2'}}, - {\"op\": \"comment\", - \"comment\": \"add row for '\"\$pair\"'\"}]' - ovsdb-client transact unix:socket ' - [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", '\$2']]}, - {\"op\": \"comment\", - \"comment\": \"delete row for '\"\$2\"'\"}]' - ovsdb-client transact unix:socket ' - [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"name\": \"'\$1'\", \"number\": '\$2'}}, - {\"op\": \"comment\", - \"comment\": \"add back row for '\"\$pair\"'\"}]' - done" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:550" -( $at_check_trace; for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do - set -- $pair - ovsdb-client transact unix:socket ' - ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"name": "'$1'", "number": '$2'}}, - {"op": "comment", - "comment": "add row for '"$pair"'"}]' - ovsdb-client transact unix:socket ' - ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["number", "==", '$2']]}, - {"op": "comment", - "comment": "delete row for '"$2"'"}]' - ovsdb-client transact unix:socket ' - ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"name": "'$1'", "number": '$2'}}, - {"op": "comment", - "comment": "add back row for '"$pair"'"}]' - done -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:550" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:577: \${PERL} \$srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/\"_date\":[0-9]*/\"_date\":0/' | ovstest test-json --multiple -" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:577" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{\"cksum\":\"12345678 9\",\"name\":\"ordinals\",\"tables\":{\"ordinals\":{\"columns\":{\"name\":{\"type\":\"string\"},\"number\":{\"type\":\"integer\"}},\"indexes\":[[\"number\"]]}},\"version\":\"5.1.3\"} -{\"_comment\":\"add row for zero 0\",\"_date\":0,\"ordinals\":{\"<0>\":{\"name\":\"zero\"}}} -{\"_comment\":\"delete row for 0\",\"_date\":0,\"ordinals\":{\"<0>\":null}} -{\"_comment\":\"add back row for zero 0\",\"_date\":0,\"ordinals\":{\"<1>\":{\"name\":\"zero\"}}} -{\"_comment\":\"add row for one 1\",\"_date\":0,\"ordinals\":{\"<2>\":{\"name\":\"one\",\"number\":1}}} -{\"_comment\":\"delete row for 1\",\"_date\":0,\"ordinals\":{\"<2>\":null}} -{\"_comment\":\"add back row for one 1\",\"_date\":0,\"ordinals\":{\"<3>\":{\"name\":\"one\",\"number\":1}}} -{\"_comment\":\"add row for two 2\",\"_date\":0,\"ordinals\":{\"<4>\":{\"name\":\"two\",\"number\":2}}} -{\"_comment\":\"delete row for 2\",\"_date\":0,\"ordinals\":{\"<4>\":null}} -{\"_comment\":\"add back row for two 2\",\"_date\":0,\"ordinals\":{\"<5>\":{\"name\":\"two\",\"number\":2}}} -{\"_comment\":\"add row for three 3\",\"_date\":0,\"ordinals\":{\"<6>\":{\"name\":\"three\",\"number\":3}}} -{\"_comment\":\"delete row for 3\",\"_date\":0,\"ordinals\":{\"<6>\":null}} -{\"_comment\":\"add back row for three 3\",\"_date\":0,\"ordinals\":{\"<7>\":{\"name\":\"three\",\"number\":3}}} -{\"_comment\":\"add row for four 4\",\"_date\":0,\"ordinals\":{\"<8>\":{\"name\":\"four\",\"number\":4}}} -{\"_comment\":\"delete row for 4\",\"_date\":0,\"ordinals\":{\"<8>\":null}} -{\"_comment\":\"add back row for four 4\",\"_date\":0,\"ordinals\":{\"<9>\":{\"name\":\"four\",\"number\":4}}} -{\"_comment\":\"add row for five 5\",\"_date\":0,\"ordinals\":{\"<10>\":{\"name\":\"five\",\"number\":5}}} -{\"_comment\":\"delete row for 5\",\"_date\":0,\"ordinals\":{\"<10>\":null}} -{\"_comment\":\"add back row for five 5\",\"_date\":0,\"ordinals\":{\"<11>\":{\"name\":\"five\",\"number\":5}}} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:577" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:599: ovsdb-client dump unix:socket ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:599" -( $at_check_trace; ovsdb-client dump unix:socket ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:599" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:601: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:601" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid name number ------------------------------------- ----- ------ -<0> five 5 -<1> four 4 -<2> one 1 -<3> three 3 -<4> two 2 -<5> zero 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:601" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:613: ovs-appctl -t \"\`pwd\`\"/unixctl ovsdb-server/compact" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:613" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl ovsdb-server/compact -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:613" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:617: test -h db" -at_fn_check_prepare_trace "ovsdb-server.at:617" -( $at_check_trace; test -h db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:617" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:618: test -h .db.~lock~" -at_fn_check_prepare_trace "ovsdb-server.at:618" -( $at_check_trace; test -h .db.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:618" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:619: test -f dir/db" -at_fn_check_prepare_trace "ovsdb-server.at:619" -( $at_check_trace; test -f dir/db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:619" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:620: test -f dir/.db.~lock~" -at_fn_check_prepare_trace "ovsdb-server.at:620" -( $at_check_trace; test -f dir/.db.~lock~ -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:620" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:625: test \`wc -l < db\` -eq 4" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:625" -( $at_check_trace; test `wc -l < db` -eq 4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:625" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:628: ovsdb-client dump unix:socket ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:628" -( $at_check_trace; ovsdb-client dump unix:socket ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:628" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:630: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:630" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid name number ------------------------------------- ----- ------ -<0> five 5 -<1> four 4 -<2> one 1 -<3> three 3 -<4> two 2 -<5> zero 0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:630" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:642: ovsdb-client transact unix:socket ' - [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"<\", 3]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:642" -( $at_check_trace; ovsdb-client transact unix:socket ' - ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["number", "<", 3]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"count\":3}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:642" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:651: test \`wc -l < db\` -eq 6" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:651" -( $at_check_trace; test `wc -l < db` -eq 6 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:651" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:654: ovsdb-client dump unix:socket ordinals" -at_fn_check_prepare_trace "ovsdb-server.at:654" -( $at_check_trace; ovsdb-client dump unix:socket ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:654" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:656: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:656" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ordinals table -_uuid name number ------------------------------------- ----- ------ -<0> five 5 -<1> four 4 -<2> three 3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:656" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:664: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:664" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:664" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:664: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:664" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:664" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"db" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1285 -#AT_START_1286 -at_fn_group_banner 1286 'ovsdb-server.at:667' \ - "ovsdb-server combines updates on backlogged connections" "" 74 -at_xfail=no -( - $as_echo "1286. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat *.pid` -EOF - - -# The maximum socket receive buffer size is important for this test, which -# tests behavior when the receive buffer overflows. -if test -e /proc/sys/net/core/rmem_max; then - # Linux - rmem_max=`cat /proc/sys/net/core/rmem_max` -elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then - : # FreeBSD, NetBSD -else - # Don't know how to get maximum socket receive buffer on this OS - $as_echo "ovsdb-server.at:681" >"$at_check_line_file" -at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:681" -fi - -# Calculate the number of iterations we need to queue. Each of the -# iterations we execute, by itself, yields a monitor update of about -# 25 kB, so fill up that much space plus a few for luck. -n_iterations=`expr $rmem_max / 25000 + 5` -echo rmem_max=$rmem_max n_iterations=$n_iterations - -# If there's too much queuing skip the test to avoid timing out. -$as_echo "ovsdb-server.at:691" >"$at_check_line_file" -(test $rmem_max -gt 1048576) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:691" - -# Calculate the exact number of monitor updates expected for $n_iterations, -# assuming no updates are combined. The "extra" update is for the initial -# contents of the database. -n_updates=`expr $n_iterations \* 3 + 1` - -# Start an ovsdb-server with the vswitchd schema. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:699: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovsdb-server.at:699" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:699" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:699: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:699" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:699" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:700: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:db.sock db" -at_fn_check_prepare_trace "ovsdb-server.at:700" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:db.sock db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:700" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Executes a set of transactions that add a bridge with 100 ports, and -# then deletes that bridge. This yields three monitor updates that -# add up to about 25 kB in size. -# -# The update also increments a counter held in the database so that we can -# verify that the overall effect of the transactions took effect (e.g. -# monitor updates at the end weren't just dropped). We add an arbitrary -# string to the counter to make grepping for it more reliable. -counter=0 -trigger_big_update () { - counter=`expr $counter + 1` - ovs-vsctl --no-wait -- set open_vswitch . system_version=xyzzy$counter - ovs-vsctl --no-wait -- add-br br0 $add - ovs-vsctl --no-wait -- del-br br0 -} -add_ports () { - for j in `seq 1 100`; do - printf " -- add-port br0 p%d" $j - done -} -add=`add_ports` - - - -# Start an ovsdb-client monitoring all changes to the database, -# make it block to force the buffers to fill up, and then execute -# enough iterations that ovsdb-server starts combining updates. -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:730: ovsdb-client --detach --no-chdir --pidfile monitor ALL >ovsdb-client.out 2>ovsdb-client.err" -at_fn_check_prepare_trace "ovsdb-server.at:730" -( $at_check_trace; ovsdb-client --detach --no-chdir --pidfile monitor ALL >ovsdb-client.out 2>ovsdb-client.err -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:730" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:731: ovs-appctl -t ovsdb-client ovsdb-client/block" -at_fn_check_prepare_trace "ovsdb-server.at:731" -( $at_check_trace; ovs-appctl -t ovsdb-client ovsdb-client/block -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:731" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - -for i in `seq 1 $n_iterations`; do - echo "blocked update ($i of $n_iterations)" - trigger_big_update $i -done -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:736: ovs-appctl -t ovsdb-client ovsdb-client/unblock" -at_fn_check_prepare_trace "ovsdb-server.at:736" -( $at_check_trace; ovs-appctl -t ovsdb-client ovsdb-client/unblock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:736" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:737: ovs_wait_cond () { grep \"\\\"xyzzy\$counter\\\"\" ovsdb-client.out -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:737" -( $at_check_trace; ovs_wait_cond () { grep "\"xyzzy$counter\"" ovsdb-client.out -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:737" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:738: ovs-appctl -t ovsdb-client exit" -at_fn_check_prepare_trace "ovsdb-server.at:738" -( $at_check_trace; ovs-appctl -t ovsdb-client exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:738" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:739: ovs_wait_cond () { if test -e ovsdb-client.pid; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:739" -( $at_check_trace; ovs_wait_cond () { if test -e ovsdb-client.pid; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:739" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - - -# Count the number of updates in the ovsdb-client output, by counting -# the number of changes to the Open_vSwitch table. (All of our -# transactions modify the Open_vSwitch table.) It should be less than -# $n_updates updates. -# -# Check that the counter is what we expect. -logged_updates=`grep -c '^Open_vSwitch' ovsdb-client.out` -echo "logged_updates=$logged_updates (expected less than $n_updates)" -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:749: test \$logged_updates -lt \$n_updates" -at_fn_check_prepare_dynamic "test $logged_updates -lt $n_updates" "ovsdb-server.at:749" -( $at_check_trace; test $logged_updates -lt $n_updates -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:749" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:750: ovs-vsctl get open_vswitch . system_version" -at_fn_check_prepare_trace "ovsdb-server.at:750" -( $at_check_trace; ovs-vsctl get open_vswitch . system_version -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"xyzzy$counter\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:750" -$at_failed && at_fn_log_failure \ -"ovsdb-client.err" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1286 -#AT_START_1287 -at_fn_group_banner 1287 'ovsdb-server.at:792' \ - "insert default row, query table" " " 75 -at_xfail=no -( - $as_echo "1287. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1287 -#AT_START_1288 -at_fn_group_banner 1288 'ovsdb-server.at:792' \ - "insert row, query table" " " 75 -at_xfail=no -( - $as_echo "1288. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1288 -#AT_START_1289 -at_fn_group_banner 1289 'ovsdb-server.at:792' \ - "insert rows, query by value" " " 75 -at_xfail=no -( - $as_echo "1289. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1289 -#AT_START_1290 -at_fn_group_banner 1290 'ovsdb-server.at:792' \ - "insert rows, query by named-uuid" " " 75 -at_xfail=no -( - $as_echo "1290. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"second\"]]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "second"]]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1290 -#AT_START_1291 -at_fn_group_banner 1291 'ovsdb-server.at:792' \ - "insert rows, update rows by value" " " 75 -at_xfail=no -( - $as_echo "1291. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"row\": {\"name\": \"nought\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "row": {"name": "nought"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"nought\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1291 -#AT_START_1292 -at_fn_group_banner 1292 'ovsdb-server.at:792' \ - "insert rows, mutate rows" " " 75 -at_xfail=no -( - $as_echo "1292. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"mutations\": [[\"number\", \"+=\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "mutations": [["number", "+=", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1},{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"zero\",\"number\":2}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1292 -#AT_START_1293 -at_fn_group_banner 1293 'ovsdb-server.at:792' \ - "insert rows, delete by named-uuid" " " 75 -at_xfail=no -( - $as_echo "1293. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":1},{\"rows\":[{\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1293 -#AT_START_1294 -at_fn_group_banner 1294 'ovsdb-server.at:792' \ - "insert rows, delete rows by value" " " 75 -at_xfail=no -( - $as_echo "1294. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1294 -#AT_START_1295 -at_fn_group_banner 1295 'ovsdb-server.at:792' \ - "insert rows, delete by (non-matching) value" " " 75 -at_xfail=no -( - $as_echo "1295. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"nought\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "nought"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":0}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1295 -#AT_START_1296 -at_fn_group_banner 1296 'ovsdb-server.at:792' \ - "insert rows, delete all" " " 75 -at_xfail=no -( - $as_echo "1296. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":2},{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1296 -#AT_START_1297 -at_fn_group_banner 1297 'ovsdb-server.at:792' \ - "insert row, query table, commit" " " 75 -at_xfail=no -( - $as_echo "1297. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": false}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": false}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1297 -#AT_START_1298 -at_fn_group_banner 1298 'ovsdb-server.at:792' \ - "insert row, query table, commit durably" " " 75 -at_xfail=no -( - $as_echo "1298. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": true}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": true}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1298 -#AT_START_1299 -at_fn_group_banner 1299 'ovsdb-server.at:792' \ - "equality wait with correct rows" " " 75 -at_xfail=no -( - $as_echo "1299. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1299 -#AT_START_1300 -at_fn_group_banner 1300 'ovsdb-server.at:792' \ - "equality wait with extra row" " " 75 -at_xfail=no -( - $as_echo "1300. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1300 -#AT_START_1301 -at_fn_group_banner 1301 'ovsdb-server.at:792' \ - "equality wait with missing row" " " 75 -at_xfail=no -( - $as_echo "1301. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1301 -#AT_START_1302 -at_fn_group_banner 1302 'ovsdb-server.at:792' \ - "inequality wait with correct rows" " " 75 -at_xfail=no -( - $as_echo "1302. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1302 -#AT_START_1303 -at_fn_group_banner 1303 'ovsdb-server.at:792' \ - "inequality wait with extra row" " " 75 -at_xfail=no -( - $as_echo "1303. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1303 -#AT_START_1304 -at_fn_group_banner 1304 'ovsdb-server.at:792' \ - "inequality wait with missing row" " " 75 -at_xfail=no -( - $as_echo "1304. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1304 -#AT_START_1305 -at_fn_group_banner 1305 'ovsdb-server.at:792' \ - "insert and update constraints" " " 75 -at_xfail=no -( - $as_echo "1305. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - constraint_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": -1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": -1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"update\", - \"table\": \"constrained\", - \"where\": [], - \"row\": {\"positive\": -2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "update", - "table": "constrained", - "where": [], - "row": {"positive": -2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"details\":\"0 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-1 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-2 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"transaction causes \\\"constrained\\\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)\",\"error\":\"constraint violation\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1305 -#AT_START_1306 -at_fn_group_banner 1306 'ovsdb-server.at:792' \ - "index uniqueness checking" " " 75 -at_xfail=no -( - $as_echo "1306. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}, - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"still another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "still another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [], - \"row\": {\"number\": 3}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [], - "row": {"number": 3}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 1]], - \"row\": {\"number\": 2, \"name\": \"old two\"}}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"two\"]], - \"row\": {\"number\": 1, \"name\": \"old one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 1]], - "row": {"number": 2, "name": "old two"}}, - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "two"]], - "row": {"number": 1, "name": "old one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [], - \"mutations\": [[\"number\", \"*=\", 10]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"new one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"new two\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"number\", \"name\"], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [], - "mutations": [["number", "*=", 10]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "new one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "new two"}}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["number", "name"], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <0>, existed in the database before this transaction and was not modified by the transaction. Second row, with UUID <1>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"count\":1}] -[{\"count\":1},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <4>, was inserted by this transaction. Second row, with UUID <3>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<5>\"]}] -[{\"count\":2},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (3) for index on column \\\"number\\\". First row, with UUID <5>, had the following index values before the transaction: 2. Second row, with UUID <2>, had the following index values before the transaction: 1.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"count\":1}] -[{\"count\":2},{\"uuid\":[\"uuid\",\"<6>\"]},{\"uuid\":[\"uuid\",\"<7>\"]},{\"rows\":[{\"name\":\"new one\",\"number\":1},{\"name\":\"new two\",\"number\":2},{\"name\":\"old one\",\"number\":10},{\"name\":\"old two\",\"number\":20}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1306 -#AT_START_1307 -at_fn_group_banner 1307 'ovsdb-server.at:792' \ - "referential integrity -- simple" " " 75 -at_xfail=no -( - $as_echo "1307. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - constraint_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1}, - \"uuid-name\": \"brow\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "insert", - "table": "b", - "row": {"b": 1}, - "uuid-name": "brow"}, - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2b": ["set", [["named-uuid", "brow"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"constraints\", - {\"op\": \"mutate\", - \"table\": \"b\", - \"where\": [], - \"mutations\": [[\"x\", \"delete\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["constraints", - {"op": "mutate", - "table": "b", - "where": [], - "mutations": [["x", "delete", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 3 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"details\":\"Attempted to store 0 elements in set of 1 to 2 integers.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 2 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1307 -#AT_START_1308 -at_fn_group_banner 1308 'ovsdb-server.at:792' \ - "referential integrity -- mutual references" " " 75 -at_xfail=no -( - $as_echo "1308. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - constraint_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1, - \"b2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"b2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row2\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "row2"]]], - "a2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "b", - "row": {"b": 1, - "b2b": ["set", [["named-uuid", "row2"]]], - "b2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row2"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2b\": [\"set\", [[\"uuid\", \"b516b960-5b19-4fc2-bb82-fe1cbd6d0241\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "insert", - "table": "a", - "row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}, - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}, - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"details\":\"Table a column a2b row <2> references nonexistent row <3> in table b.\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1308 -#AT_START_1309 -at_fn_group_banner 1309 'ovsdb-server.at:792' \ - "weak references" " " 75 -at_xfail=no -( - $as_echo "1309. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - weak_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"], - [\"uuid\", \"0e767b36-6822-4044-8307-d58467e04669\"]]], - \"a2a1\": [\"named-uuid\", \"row1\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row4\"]}}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 2, - \"b2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row3\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 3, - \"b2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row4\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"], - ["uuid", "0e767b36-6822-4044-8307-d58467e04669"]]], - "a2a1": ["named-uuid", "row1"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row4"]}}, - {"op": "insert", - "table": "b", - "row": {"b": 2, - "b2a": ["named-uuid", "row1"]}, - "uuid-name": "row3"}, - {"op": "insert", - "table": "b", - "row": {"b": 3, - "b2a": ["named-uuid", "row2"]}, - "uuid-name": "row4"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2a1\": [\"named-uuid\", \"me\"]}, - \"uuid-name\": \"me\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["weak", - {"op": "insert", - "table": "a", - "row": {"a2a1": ["named-uuid", "me"]}, - "uuid-name": "me"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 3]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["weak", - {"op": "delete", - "table": "b", - "where": [["b", "==", 3]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<2>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<4>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"details\":\"Weak reference column \\\"a2b\\\" in \\\"a\\\" row <5> (inserted within this transaction) contained all-zeros UUID (probably as the default value for this column) but deleting this value caused a constraint volation because this column is not allowed to be empty.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2b\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2a1\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"uuid\",\"<1>\"],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"set\",[]]}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1309 -#AT_START_1310 -at_fn_group_banner 1310 'ovsdb-server.at:792' \ - "immutable columns" " " 75 -at_xfail=no -( - $as_echo "1310. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - immutable_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"immutable\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["immutable", - {"op": "insert", - "table": "a", - "row": {"i": 5}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 10}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 10}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 5}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"-=\", 5]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "-=", 5]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"*=\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "*=", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":10},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":5},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"-=\\\",5]\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"*=\\\",1]\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1310 -#AT_START_1311 -at_fn_group_banner 1311 'ovsdb-server.at:792' \ - "garbage collection" " " 75 -at_xfail=no -( - $as_echo "1311. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:792" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:792" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - gc_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:792" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, \"a2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, \"a2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, \"a2a\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 3}, - \"uuid-name\": \"row3\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0, "a2a": ["named-uuid", "row1"]}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, "a2a": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, "a2a": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 3}, - "uuid-name": "row3"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 4, \"a2a\": [\"named-uuid\", \"row5\"]}, - \"uuid-name\": \"row4\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 5, \"a2a\": [\"named-uuid\", \"row4\"]}, - \"uuid-name\": \"row5\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 4, "a2a": ["named-uuid", "row5"]}, - "uuid-name": "row4"}, - {"op": "insert", - "table": "a", - "row": {"a": 5, "a2a": ["named-uuid", "row4"]}, - "uuid-name": "row5"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 4]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 4]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 6, \"wa2a\": [\"named-uuid\", \"row7\"]}, - \"uuid-name\": \"row6\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 7, \"wa2a\": [\"named-uuid\", \"row6\"]}, - \"uuid-name\": \"row7\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 6, "wa2a": ["named-uuid", "row7"]}, - "uuid-name": "row6"}, - {"op": "insert", - "table": "a", - "row": {"a": 7, "wa2a": ["named-uuid", "row6"]}, - "uuid-name": "row7"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 8, \"a2a\": [\"named-uuid\", \"row9\"]}, - \"uuid-name\": \"row8\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 9, \"a2a\": [\"named-uuid\", \"row10\"]}, - \"uuid-name\": \"row9\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 10, \"a2a\": [\"named-uuid\", \"row11\"]}, - \"uuid-name\": \"row10\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 11, \"a2a\": [\"named-uuid\", \"row8\"]}, - \"uuid-name\": \"row11\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 8, "a2a": ["named-uuid", "row9"]}, - "uuid-name": "row8"}, - {"op": "insert", - "table": "a", - "row": {"a": 9, "a2a": ["named-uuid", "row10"]}, - "uuid-name": "row9"}, - {"op": "insert", - "table": "a", - "row": {"a": 10, "a2a": ["named-uuid", "row11"]}, - "uuid-name": "row10"}, - {"op": "insert", - "table": "a", - "row": {"a": 11, "a2a": ["named-uuid", "row8"]}, - "uuid-name": "row11"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 9]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 9]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 12, \"a2a\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 12, "a2a": ["named-uuid", "self"]}, - "uuid-name": "self"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:\$SSL_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:792" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:792" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"uuid\":[\"uuid\",\"<6>\"]}] -[{\"rows\":[{\"a\":4},{\"a\":5}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<7>\"]},{\"uuid\":[\"uuid\",\"<8>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<9>\"]},{\"uuid\":[\"uuid\",\"<10>\"]},{\"uuid\":[\"uuid\",\"<11>\"]},{\"uuid\":[\"uuid\",\"<12>\"]}] -[{\"rows\":[{\"a\":8},{\"a\":9},{\"a\":10},{\"a\":11}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<13>\"]}] -[{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:792: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:792" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:792" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1311 -#AT_START_1312 -at_fn_group_banner 1312 'ovsdb-server.at:831' \ - "insert default row, query table" " " 76 -at_xfail=no -( - $as_echo "1312. $at_setup_line: testing $at_desc ..." - $at_traceon - - - $as_echo "ovsdb-server.at:831" >"$at_check_line_file" -(test "$HAVE_OPENSSL" = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-server.at:831" - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:831: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:831" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:831" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:831: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --private-key=\$PKIDIR/testpki-privkey2.pem --certificate=\$PKIDIR/testpki-cert2.pem --ca-cert=\$PKIDIR/testpki-cacert.pem --remote=pssl:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:831" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:831" -$at_failed && at_fn_log_failure -$at_traceon; } - - SSL_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:831: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:[::1]:\$SSL_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:831" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:[::1]:$SSL_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:831" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:831: ovsdb-client --private-key=\$PKIDIR/testpki-privkey.pem --certificate=\$PKIDIR/testpki-cert.pem --ca-cert=\$PKIDIR/testpki-cacert.pem transact ssl:[::1]:\$SSL_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:831" -( $at_check_trace; ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:[::1]:$SSL_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:831" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:831: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:831" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:831" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:831: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:831" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:831" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:831: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:831" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:831" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1312 -#AT_START_1313 -at_fn_group_banner 1313 'ovsdb-server.at:835' \ - "ovsdb-client get-schema-version - tcp socket" " " 77 -at_xfail=no -( - $as_echo "1313. $at_setup_line: testing $at_desc ..." - $at_traceon - - -ordinal_schema > schema -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:838: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:838" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:838" -$at_failed && at_fn_log_failure -$at_traceon; } - -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:840: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --unixctl=\"\`pwd\`\"/unixctl --remote=ptcp:0:127.0.0.1 db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:840" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --unixctl="`pwd`"/unixctl --remote=ptcp:0:127.0.0.1 db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:840" -$at_failed && at_fn_log_failure -$at_traceon; } - -TCP_PORT=`parse_listening_port < ovsdb-server.log` -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:842: ovsdb-client get-schema-version tcp:127.0.0.1:\$TCP_PORT ordinals" -at_fn_check_prepare_dynamic "ovsdb-client get-schema-version tcp:127.0.0.1:$TCP_PORT ordinals" "ovsdb-server.at:842" -( $at_check_trace; ovsdb-client get-schema-version tcp:127.0.0.1:$TCP_PORT ordinals -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "5.1.3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:842" -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:844: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:844" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:844" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:844: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:844" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:844" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1313 -#AT_START_1314 -at_fn_group_banner 1314 'ovsdb-server.at:881' \ - "insert default row, query table" " " 77 -at_xfail=no -( - $as_echo "1314. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1314 -#AT_START_1315 -at_fn_group_banner 1315 'ovsdb-server.at:881' \ - "insert row, query table" " " 77 -at_xfail=no -( - $as_echo "1315. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1315 -#AT_START_1316 -at_fn_group_banner 1316 'ovsdb-server.at:881' \ - "insert rows, query by value" " " 77 -at_xfail=no -( - $as_echo "1316. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1316 -#AT_START_1317 -at_fn_group_banner 1317 'ovsdb-server.at:881' \ - "insert rows, query by named-uuid" " " 77 -at_xfail=no -( - $as_echo "1317. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"second\"]]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "second"]]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1317 -#AT_START_1318 -at_fn_group_banner 1318 'ovsdb-server.at:881' \ - "insert rows, update rows by value" " " 77 -at_xfail=no -( - $as_echo "1318. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"row\": {\"name\": \"nought\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "row": {"name": "nought"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"nought\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1318 -#AT_START_1319 -at_fn_group_banner 1319 'ovsdb-server.at:881' \ - "insert rows, mutate rows" " " 77 -at_xfail=no -( - $as_echo "1319. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]], - \"mutations\": [[\"number\", \"+=\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "mutations": [["number", "+=", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1},{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"zero\",\"number\":2}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1319 -#AT_START_1320 -at_fn_group_banner 1320 'ovsdb-server.at:881' \ - "insert rows, delete by named-uuid" " " 77 -at_xfail=no -( - $as_echo "1320. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"first\"]]]}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":1},{\"rows\":[{\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1320 -#AT_START_1321 -at_fn_group_banner 1321 'ovsdb-server.at:881' \ - "insert rows, delete rows by value" " " 77 -at_xfail=no -( - $as_echo "1321. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"zero\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1321 -#AT_START_1322 -at_fn_group_banner 1322 'ovsdb-server.at:881' \ - "insert rows, delete by (non-matching) value" " " 77 -at_xfail=no -( - $as_echo "1322. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"first\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"nought\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "nought"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":0}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1322 -#AT_START_1323 -at_fn_group_banner 1323 'ovsdb-server.at:881' \ - "insert rows, delete all" " " 77 -at_xfail=no -( - $as_echo "1323. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}, - \"uuid-name\": \"first\"}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}, - \"uuid-name\": \"second\"}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\",\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":2},{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1323 -#AT_START_1324 -at_fn_group_banner 1324 'ovsdb-server.at:881' \ - "insert row, query table, commit" " " 77 -at_xfail=no -( - $as_echo "1324. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": false}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": false}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1324 -#AT_START_1325 -at_fn_group_banner 1325 'ovsdb-server.at:881' \ - "insert row, query table, commit durably" " " 77 -at_xfail=no -( - $as_echo "1325. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"commit\", - \"durable\": true}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": true}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1325 -#AT_START_1326 -at_fn_group_banner 1326 'ovsdb-server.at:881' \ - "equality wait with correct rows" " " 77 -at_xfail=no -( - $as_echo "1326. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1326 -#AT_START_1327 -at_fn_group_banner 1327 'ovsdb-server.at:881' \ - "equality wait with extra row" " " 77 -at_xfail=no -( - $as_echo "1327. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1327 -#AT_START_1328 -at_fn_group_banner 1328 'ovsdb-server.at:881' \ - "equality wait with missing row" " " 77 -at_xfail=no -( - $as_echo "1328. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"==\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1328 -#AT_START_1329 -at_fn_group_banner 1329 'ovsdb-server.at:881' \ - "inequality wait with correct rows" " " 77 -at_xfail=no -( - $as_echo "1329. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1329 -#AT_START_1330 -at_fn_group_banner 1330 'ovsdb-server.at:881' \ - "inequality wait with extra row" " " 77 -at_xfail=no -( - $as_echo "1330. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"zero\", \"number\": 0}, - {\"name\": \"one\", \"number\": 1}, - {\"name\": \"two\", \"number\": 2}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1330 -#AT_START_1331 -at_fn_group_banner 1331 'ovsdb-server.at:881' \ - "inequality wait with missing row" " " 77 -at_xfail=no -( - $as_echo "1331. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"wait\", - \"timeout\": 0, - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"name\", \"number\"], - \"until\": \"!=\", - \"rows\": [{\"name\": \"one\", \"number\": 1}]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "one", "number": 1}]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1331 -#AT_START_1332 -at_fn_group_banner 1332 'ovsdb-server.at:881' \ - "insert and update constraints" " " 77 -at_xfail=no -( - $as_echo "1332. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - constraint_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": -1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": -1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"update\", - \"table\": \"constrained\", - \"where\": [], - \"row\": {\"positive\": -2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "update", - "table": "constrained", - "where": [], - "row": {"positive": -2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 1}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 1}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"constrained\", - \"row\": {\"positive\": 2}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 2}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"details\":\"0 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-1 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-2 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"transaction causes \\\"constrained\\\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)\",\"error\":\"constraint violation\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1332 -#AT_START_1333 -at_fn_group_banner 1333 'ovsdb-server.at:881' \ - "index uniqueness checking" " " 77 -at_xfail=no -( - $as_echo "1333. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"another one\"}}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"one\"]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}, - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"still another one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "still another one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"two\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [], - \"row\": {\"number\": 3}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [], - "row": {"number": 3}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 1]], - \"row\": {\"number\": 2, \"name\": \"old two\"}}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"two\"]], - \"row\": {\"number\": 1, \"name\": \"old one\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 1]], - "row": {"number": 2, "name": "old two"}}, - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "two"]], - "row": {"number": 1, "name": "old one"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"ordinals\", - {\"op\": \"mutate\", - \"table\": \"ordinals\", - \"where\": [], - \"mutations\": [[\"number\", \"*=\", 10]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 1, \"name\": \"new one\"}}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 2, \"name\": \"new two\"}}, - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": [], - \"columns\": [\"number\", \"name\"], - \"sort\": [\"number\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [], - "mutations": [["number", "*=", 10]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "new one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "new two"}}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["number", "name"], - "sort": ["number"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <0>, existed in the database before this transaction and was not modified by the transaction. Second row, with UUID <1>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"count\":1}] -[{\"count\":1},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <4>, was inserted by this transaction. Second row, with UUID <3>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<5>\"]}] -[{\"count\":2},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (3) for index on column \\\"number\\\". First row, with UUID <5>, had the following index values before the transaction: 2. Second row, with UUID <2>, had the following index values before the transaction: 1.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"count\":1}] -[{\"count\":2},{\"uuid\":[\"uuid\",\"<6>\"]},{\"uuid\":[\"uuid\",\"<7>\"]},{\"rows\":[{\"name\":\"new one\",\"number\":1},{\"name\":\"new two\",\"number\":2},{\"name\":\"old one\",\"number\":10},{\"name\":\"old two\",\"number\":20}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1333 -#AT_START_1334 -at_fn_group_banner 1334 'ovsdb-server.at:881' \ - "referential integrity -- simple" " " 77 -at_xfail=no -( - $as_echo "1334. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - constraint_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1}, - \"uuid-name\": \"brow\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2b\": [\"set\", [[\"named-uuid\", \"brow\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "insert", - "table": "b", - "row": {"b": 1}, - "uuid-name": "brow"}, - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2b": ["set", [["named-uuid", "brow"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"constraints\", - {\"op\": \"mutate\", - \"table\": \"b\", - \"where\": [], - \"mutations\": [[\"x\", \"delete\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["constraints", - {"op": "mutate", - "table": "b", - "where": [], - "mutations": [["x", "delete", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 3 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"details\":\"Attempted to store 0 elements in set of 1 to 2 integers.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 2 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1334 -#AT_START_1335 -at_fn_group_banner 1335 'ovsdb-server.at:881' \ - "referential integrity -- mutual references" " " 77 -at_xfail=no -( - $as_echo "1335. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - constraint_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 1, - \"b2b\": [\"set\", [[\"named-uuid\", \"row2\"]]], - \"b2a\": [\"set\", [[\"named-uuid\", \"row1\"]]]}, - \"uuid-name\": \"row2\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "row2"]]], - "a2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "b", - "row": {"b": 1, - "b2b": ["set", [["named-uuid", "row2"]]], - "b2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row2"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2b\": [\"set\", [[\"uuid\", \"b516b960-5b19-4fc2-bb82-fe1cbd6d0241\"]]]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "insert", - "table": "a", - "row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"constraints\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}, - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}, - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"details\":\"Table a column a2b row <2> references nonexistent row <3> in table b.\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1335 -#AT_START_1336 -at_fn_group_banner 1336 'ovsdb-server.at:881' \ - "weak references" " " 77 -at_xfail=no -( - $as_echo "1336. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - weak_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"], - [\"uuid\", \"0e767b36-6822-4044-8307-d58467e04669\"]]], - \"a2a1\": [\"named-uuid\", \"row1\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, - \"a2a\": [\"set\", [[\"named-uuid\", \"row1\"], - [\"named-uuid\", \"row2\"]]], - \"a2a1\": [\"named-uuid\", \"row2\"], - \"a2b\": [\"named-uuid\", \"row4\"]}}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 2, - \"b2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row3\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 3, - \"b2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row4\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"], - ["uuid", "0e767b36-6822-4044-8307-d58467e04669"]]], - "a2a1": ["named-uuid", "row1"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row4"]}}, - {"op": "insert", - "table": "b", - "row": {"b": 2, - "b2a": ["named-uuid", "row1"]}, - "uuid-name": "row3"}, - {"op": "insert", - "table": "b", - "row": {"b": 3, - "b2a": ["named-uuid", "row2"]}, - "uuid-name": "row4"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a2a1\": [\"named-uuid\", \"me\"]}, - \"uuid-name\": \"me\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["weak", - {"op": "insert", - "table": "a", - "row": {"a2a1": ["named-uuid", "me"]}, - "uuid-name": "me"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"b\", - \"where\": [[\"b\", \"==\", 3]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["weak", - {"op": "delete", - "table": "b", - "where": [["b", "==", 3]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 2]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"_uuid\", \"a2a\", \"a2a1\", \"a2b\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"weak\", - {\"op\": \"select\", - \"table\": \"b\", - \"where\": [], - \"columns\": [\"_uuid\", \"b\", \"b2a\"], - \"sort\": [\"b\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<2>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<4>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"details\":\"Weak reference column \\\"a2b\\\" in \\\"a\\\" row <5> (inserted within this transaction) contained all-zeros UUID (probably as the default value for this column) but deleting this value caused a constraint volation because this column is not allowed to be empty.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2b\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2a1\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"uuid\",\"<1>\"],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"set\",[]]}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1336 -#AT_START_1337 -at_fn_group_banner 1337 'ovsdb-server.at:881' \ - "immutable columns" " " 77 -at_xfail=no -( - $as_echo "1337. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - immutable_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"immutable\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["immutable", - {"op": "insert", - "table": "a", - "row": {"i": 5}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 10}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 10}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"immutable\", - {\"op\": \"update\", - \"table\": \"a\", - \"row\": {\"i\": 5}, - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 5}, - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"-=\", 5]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "-=", 5]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"immutable\", - {\"op\": \"mutate\", - \"table\": \"a\", - \"where\": [], - \"mutations\": [[\"i\", \"*=\", 1]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "*=", 1]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":10},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":5},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"-=\\\",5]\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"*=\\\",1]\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1337 -#AT_START_1338 -at_fn_group_banner 1338 'ovsdb-server.at:881' \ - "garbage collection" " " 77 -at_xfail=no -( - $as_echo "1338. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - gc_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:881" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, \"a2a\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, \"a2a\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 2, \"a2a\": [\"named-uuid\", \"row3\"]}, - \"uuid-name\": \"row2\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 3}, - \"uuid-name\": \"row3\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0, "a2a": ["named-uuid", "row1"]}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, "a2a": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, "a2a": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 3}, - "uuid-name": "row3"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 4, \"a2a\": [\"named-uuid\", \"row5\"]}, - \"uuid-name\": \"row4\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 5, \"a2a\": [\"named-uuid\", \"row4\"]}, - \"uuid-name\": \"row5\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 4, "a2a": ["named-uuid", "row5"]}, - "uuid-name": "row4"}, - {"op": "insert", - "table": "a", - "row": {"a": 5, "a2a": ["named-uuid", "row4"]}, - "uuid-name": "row5"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 4]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 4]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 6, \"wa2a\": [\"named-uuid\", \"row7\"]}, - \"uuid-name\": \"row6\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 7, \"wa2a\": [\"named-uuid\", \"row6\"]}, - \"uuid-name\": \"row7\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 6, "wa2a": ["named-uuid", "row7"]}, - "uuid-name": "row6"}, - {"op": "insert", - "table": "a", - "row": {"a": 7, "wa2a": ["named-uuid", "row6"]}, - "uuid-name": "row7"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 8, \"a2a\": [\"named-uuid\", \"row9\"]}, - \"uuid-name\": \"row8\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 9, \"a2a\": [\"named-uuid\", \"row10\"]}, - \"uuid-name\": \"row9\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 10, \"a2a\": [\"named-uuid\", \"row11\"]}, - \"uuid-name\": \"row10\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 11, \"a2a\": [\"named-uuid\", \"row8\"]}, - \"uuid-name\": \"row11\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 8, "a2a": ["named-uuid", "row9"]}, - "uuid-name": "row8"}, - {"op": "insert", - "table": "a", - "row": {"a": 9, "a2a": ["named-uuid", "row10"]}, - "uuid-name": "row9"}, - {"op": "insert", - "table": "a", - "row": {"a": 10, "a2a": ["named-uuid", "row11"]}, - "uuid-name": "row10"}, - {"op": "insert", - "table": "a", - "row": {"a": 11, "a2a": ["named-uuid", "row8"]}, - "uuid-name": "row11"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"], - \"sort\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"update\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 9]], - \"row\": {\"a2a\": [\"set\", []]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 9]], - "row": {"a2a": ["set", []]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT ' [\"gc\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 12, \"a2a\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 12, "a2a": ["named-uuid", "self"]}, - "uuid-name": "self"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"gc\", - {\"op\": \"select\", - \"table\": \"a\", - \"where\": [], - \"columns\": [\"a\"]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:881" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:881" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"uuid\":[\"uuid\",\"<6>\"]}] -[{\"rows\":[{\"a\":4},{\"a\":5}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<7>\"]},{\"uuid\":[\"uuid\",\"<8>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<9>\"]},{\"uuid\":[\"uuid\",\"<10>\"]},{\"uuid\":[\"uuid\",\"<11>\"]},{\"uuid\":[\"uuid\",\"<12>\"]}] -[{\"rows\":[{\"a\":8},{\"a\":9},{\"a\":10},{\"a\":11}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<13>\"]}] -[{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:881: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:881" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:881" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1338 -#AT_START_1339 -at_fn_group_banner 1339 'ovsdb-server.at:919' \ - "insert default row, query table" " " 78 -at_xfail=no -( - $as_echo "1339. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - ordinal_schema > schema - PKIDIR=$abs_top_builddir/tests - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:919: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:919" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:919" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:919: ovsdb-server --log-file --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:919" -( $at_check_trace; ovsdb-server --log-file --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:919" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:919: ovsdb-client transact tcp:[::1]:\$TCP_PORT '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:919" -( $at_check_trace; ovsdb-client transact tcp:[::1]:$TCP_PORT '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:919" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output -{ set +x -$as_echo "$at_srcdir/ovsdb-server.at:919: ovsdb-client transact tcp:[::1]:\$TCP_PORT '[\"ordinals\", - {\"op\": \"select\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-server.at:919" -( $at_check_trace; ovsdb-client transact tcp:[::1]:$TCP_PORT '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:919" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:919: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:919" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:919" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:919: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:919" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:919" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:919: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:919" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:919" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1339 -#AT_START_1340 -at_fn_group_banner 1340 'ovsdb-server.at:955' \ - "insert default row, query table" " " 79 -at_xfail=no -( - $as_echo "1340. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1340 -#AT_START_1341 -at_fn_group_banner 1341 'ovsdb-server.at:955' \ - "insert row, query table" " " 79 -at_xfail=no -( - $as_echo "1341. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1341 -#AT_START_1342 -at_fn_group_banner 1342 'ovsdb-server.at:955' \ - "insert rows, query by value" " " 79 -at_xfail=no -( - $as_echo "1342. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1342 -#AT_START_1343 -at_fn_group_banner 1343 'ovsdb-server.at:955' \ - "insert rows, query by named-uuid" " " 79 -at_xfail=no -( - $as_echo "1343. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "second"]]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0}]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1343 -#AT_START_1344 -at_fn_group_banner 1344 'ovsdb-server.at:955' \ - "insert rows, update rows by value" " " 79 -at_xfail=no -( - $as_echo "1344. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "row": {"name": "nought"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"nought\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1344 -#AT_START_1345 -at_fn_group_banner 1345 'ovsdb-server.at:955' \ - "insert rows, mutate rows" " " 79 -at_xfail=no -( - $as_echo "1345. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [["name", "==", "zero"]], - "mutations": [["number", "+=", 2]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1},{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"zero\",\"number\":2}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1345 -#AT_START_1346 -at_fn_group_banner 1346 'ovsdb-server.at:955' \ - "insert rows, delete by named-uuid" " " 79 -at_xfail=no -( - $as_echo "1346. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "first"]]]}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":1},{\"rows\":[{\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1346 -#AT_START_1347 -at_fn_group_banner 1347 'ovsdb-server.at:955' \ - "insert rows, delete rows by value" " " 79 -at_xfail=no -( - $as_echo "1347. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "zero"]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1347 -#AT_START_1348 -at_fn_group_banner 1348 'ovsdb-server.at:955' \ - "insert rows, delete by (non-matching) value" " " 79 -at_xfail=no -( - $as_echo "1348. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "first"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "nought"]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "select", - "table": "ordinals", - "where": [], - "sort": ["number"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"count\":0}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<2>\"],\"name\":\"zero\",\"number\":0},{\"_uuid\":[\"uuid\",\"<1>\"],\"_version\":[\"uuid\",\"<3>\"],\"name\":\"one\",\"number\":1}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1348 -#AT_START_1349 -at_fn_group_banner 1349 'ovsdb-server.at:955' \ - "insert rows, delete all" " " 79 -at_xfail=no -( - $as_echo "1349. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}, - "uuid-name": "first"}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}, - "uuid-name": "second"}, - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["name","number"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"count\":2},{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1349 -#AT_START_1350 -at_fn_group_banner 1350 'ovsdb-server.at:955' \ - "insert row, query table, commit" " " 79 -at_xfail=no -( - $as_echo "1350. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": false}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1350 -#AT_START_1351 -at_fn_group_banner 1351 'ovsdb-server.at:955' \ - "insert row, query table, commit durably" " " 79 -at_xfail=no -( - $as_echo "1351. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "select", - "table": "ordinals", - "where": []}, - {"op": "commit", - "durable": true}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"_version\":[\"uuid\",\"<1>\"],\"name\":\"zero\",\"number\":0}]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1351 -#AT_START_1352 -at_fn_group_banner 1352 'ovsdb-server.at:955' \ - "equality wait with correct rows" " " 79 -at_xfail=no -( - $as_echo "1352. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1352 -#AT_START_1353 -at_fn_group_banner 1353 'ovsdb-server.at:955' \ - "equality wait with extra row" " " 79 -at_xfail=no -( - $as_echo "1353. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1353 -#AT_START_1354 -at_fn_group_banner 1354 'ovsdb-server.at:955' \ - "equality wait with missing row" " " 79 -at_xfail=no -( - $as_echo "1354. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "==", - "rows": [{"name": "one", "number": 1}]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1354 -#AT_START_1355 -at_fn_group_banner 1355 'ovsdb-server.at:955' \ - "inequality wait with correct rows" " " 79 -at_xfail=no -( - $as_echo "1355. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"\\\"wait\\\" timed out\",\"error\":\"timed out\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1355 -#AT_START_1356 -at_fn_group_banner 1356 'ovsdb-server.at:955' \ - "inequality wait with extra row" " " 79 -at_xfail=no -( - $as_echo "1356. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "zero", "number": 0}, - {"name": "one", "number": 1}, - {"name": "two", "number": 2}]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1356 -#AT_START_1357 -at_fn_group_banner 1357 'ovsdb-server.at:955' \ - "inequality wait with missing row" " " 79 -at_xfail=no -( - $as_echo "1357. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "wait", - "timeout": 0, - "table": "ordinals", - "where": [], - "columns": ["name", "number"], - "until": "!=", - "rows": [{"name": "one", "number": 1}]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1357 -#AT_START_1358 -at_fn_group_banner 1358 'ovsdb-server.at:955' \ - "insert and update constraints" " " 79 -at_xfail=no -( - $as_echo "1358. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - constraint_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": -1}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "update", - "table": "constrained", - "where": [], - "row": {"positive": -2}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 1}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "constrained", - "row": {"positive": 2}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"details\":\"0 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-1 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"details\":\"-2 is less than minimum allowed value 1\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"transaction causes \\\"constrained\\\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)\",\"error\":\"constraint violation\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1358 -#AT_START_1359 -at_fn_group_banner 1359 'ovsdb-server.at:955' \ - "index uniqueness checking" " " 79 -at_xfail=no -( - $as_echo "1359. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "another one"}}, - {"op": "delete", - "table": "ordinals", - "where": [["name", "==", "one"]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "still another one"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "two"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [], - "row": {"number": 3}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 1]], - "row": {"number": 2, "name": "old two"}}, - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "two"]], - "row": {"number": 1, "name": "old one"}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["ordinals", - {"op": "mutate", - "table": "ordinals", - "where": [], - "mutations": [["number", "*=", 10]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 1, "name": "new one"}}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 2, "name": "new two"}}, - {"op": "select", - "table": "ordinals", - "where": [], - "columns": ["number", "name"], - "sort": ["number"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <0>, existed in the database before this transaction and was not modified by the transaction. Second row, with UUID <1>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"count\":1}] -[{\"count\":1},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (1) for index on column \\\"number\\\". First row, with UUID <4>, was inserted by this transaction. Second row, with UUID <3>, was inserted by this transaction.\",\"error\":\"constraint violation\"}] -[{\"uuid\":[\"uuid\",\"<5>\"]}] -[{\"count\":2},{\"details\":\"Transaction causes multiple rows in \\\"ordinals\\\" table to have identical values (3) for index on column \\\"number\\\". First row, with UUID <5>, had the following index values before the transaction: 2. Second row, with UUID <2>, had the following index values before the transaction: 1.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"count\":1}] -[{\"count\":2},{\"uuid\":[\"uuid\",\"<6>\"]},{\"uuid\":[\"uuid\",\"<7>\"]},{\"rows\":[{\"name\":\"new one\",\"number\":1},{\"name\":\"new two\",\"number\":2},{\"name\":\"old one\",\"number\":10},{\"name\":\"old two\",\"number\":20}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1359 -#AT_START_1360 -at_fn_group_banner 1360 'ovsdb-server.at:955' \ - "referential integrity -- simple" " " 79 -at_xfail=no -( - $as_echo "1360. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - constraint_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "b", - "row": {"b": 1}, - "uuid-name": "brow"}, - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2b": ["set", [["named-uuid", "brow"]]]}}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2b": ["set", [["named-uuid", "brow"]]]}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["constraints", - {"op": "mutate", - "table": "b", - "where": [], - "mutations": [["x", "delete", 0]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 3 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"details\":\"Attempted to store 0 elements in set of 1 to 2 integers.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 2 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1},{\"details\":\"cannot delete b row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1}] -[{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1360 -#AT_START_1361 -at_fn_group_banner 1361 'ovsdb-server.at:955' \ - "referential integrity -- mutual references" " " 79 -at_xfail=no -( - $as_echo "1361. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - constraint_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2b": ["set", [["named-uuid", "row2"]]], - "a2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "b", - "row": {"b": 1, - "b2b": ["set", [["named-uuid", "row2"]]], - "b2a": ["set", [["named-uuid", "row1"]]]}, - "uuid-name": "row2"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "insert", - "table": "a", - "row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["constraints", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}, - {"op": "delete", - "table": "b", - "where": [["b", "==", 1]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}] -[{\"uuid\":[\"uuid\",\"<2>\"]},{\"details\":\"Table a column a2b row <2> references nonexistent row <3> in table b.\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete a row <0> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"details\":\"cannot delete b row <1> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}] -[{\"count\":1},{\"count\":1}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1361 -#AT_START_1362 -at_fn_group_banner 1362 'ovsdb-server.at:955' \ - "weak references" " " 79 -at_xfail=no -( - $as_echo "1362. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - weak_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"], - ["uuid", "0e767b36-6822-4044-8307-d58467e04669"]]], - "a2a1": ["named-uuid", "row1"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, - "a2a": ["set", [["named-uuid", "row1"], - ["named-uuid", "row2"]]], - "a2a1": ["named-uuid", "row2"], - "a2b": ["named-uuid", "row4"]}}, - {"op": "insert", - "table": "b", - "row": {"b": 2, - "b2a": ["named-uuid", "row1"]}, - "uuid-name": "row3"}, - {"op": "insert", - "table": "b", - "row": {"b": 3, - "b2a": ["named-uuid", "row2"]}, - "uuid-name": "row4"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["weak", - {"op": "insert", - "table": "a", - "row": {"a2a1": ["named-uuid", "me"]}, - "uuid-name": "me"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "b", - "where": [["b", "==", 3]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 2]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 1]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "a", - "where": [], - "columns": ["_uuid", "a2a", "a2a1", "a2b"], - "sort": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["weak", - {"op": "select", - "table": "b", - "where": [], - "columns": ["_uuid", "b", "b2a"], - "sort": ["b"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<2>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<4>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"details\":\"Weak reference column \\\"a2b\\\" in \\\"a\\\" row <5> (inserted within this transaction) contained all-zeros UUID (probably as the default value for this column) but deleting this value caused a constraint volation because this column is not allowed to be empty.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2b\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1},{\"details\":\"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \\\"a2a1\\\" in \\\"a\\\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.\",\"error\":\"constraint violation\"}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<0>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<0>\"],\"a2b\":[\"uuid\",\"<3>\"]},{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"set\",[[\"uuid\",\"<0>\"],[\"uuid\",\"<1>\"]]],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"uuid\",\"<0>\"]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<1>\"],\"a2a\":[\"uuid\",\"<1>\"],\"a2a1\":[\"uuid\",\"<1>\"],\"a2b\":[\"uuid\",\"<3>\"]}]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"uuid\",\"<1>\"]}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"rows\":[{\"_uuid\":[\"uuid\",\"<3>\"],\"b\":2,\"b2a\":[\"set\",[]]},{\"_uuid\":[\"uuid\",\"<4>\"],\"b\":3,\"b2a\":[\"set\",[]]}]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1362 -#AT_START_1363 -at_fn_group_banner 1363 'ovsdb-server.at:955' \ - "immutable columns" " " 79 -at_xfail=no -( - $as_echo "1363. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - immutable_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["immutable", - {"op": "insert", - "table": "a", - "row": {"i": 5}, - "uuid-name": "row1"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 10}, - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["immutable", - {"op": "update", - "table": "a", - "row": {"i": 5}, - "where": []}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "-=", 5]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["immutable", - {"op": "mutate", - "table": "a", - "where": [], - "mutations": [["i", "*=", 1]]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":10},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot update immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"{\\\"op\\\":\\\"update\\\",\\\"row\\\":{\\\"i\\\":5},\\\"table\\\":\\\"a\\\",\\\"where\\\":[]}\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"-=\\\",5]\"}] -[{\"details\":\"Cannot mutate immutable column i in table a.\",\"error\":\"constraint violation\",\"syntax\":\"[\\\"i\\\",\\\"*=\\\",1]\"}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1363 -#AT_START_1364 -at_fn_group_banner 1364 'ovsdb-server.at:955' \ - "garbage collection" " " 79 -at_xfail=no -( - $as_echo "1364. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - gc_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-server.at:955" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 0, "a2a": ["named-uuid", "row1"]}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, "a2a": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "a", - "row": {"a": 2, "a2a": ["named-uuid", "row3"]}, - "uuid-name": "row2"}, - {"op": "insert", - "table": "a", - "row": {"a": 3}, - "uuid-name": "row3"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 4, "a2a": ["named-uuid", "row5"]}, - "uuid-name": "row4"}, - {"op": "insert", - "table": "a", - "row": {"a": 5, "a2a": ["named-uuid", "row4"]}, - "uuid-name": "row5"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 4]], - "row": {"a2a": ["set", []]}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 6, "wa2a": ["named-uuid", "row7"]}, - "uuid-name": "row6"}, - {"op": "insert", - "table": "a", - "row": {"a": 7, "wa2a": ["named-uuid", "row6"]}, - "uuid-name": "row7"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 8, "a2a": ["named-uuid", "row9"]}, - "uuid-name": "row8"}, - {"op": "insert", - "table": "a", - "row": {"a": 9, "a2a": ["named-uuid", "row10"]}, - "uuid-name": "row9"}, - {"op": "insert", - "table": "a", - "row": {"a": 10, "a2a": ["named-uuid", "row11"]}, - "uuid-name": "row10"}, - {"op": "insert", - "table": "a", - "row": {"a": 11, "a2a": ["named-uuid", "row8"]}, - "uuid-name": "row11"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"], - "sort": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "update", - "table": "a", - "where": [["a", "==", 9]], - "row": {"a2a": ["set", []]}}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket ' ["gc", - {"op": "insert", - "table": "a", - "row": {"a": 12, "a2a": ["named-uuid", "self"]}, - "uuid-name": "self"}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output -cat >txnfile <<'_ATEOF' -ovsdb-client transact unix:socket '["gc", - {"op": "select", - "table": "a", - "where": [], - "columns": ["a"]}]' -_ATEOF - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: ovsdb-server --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db --run=\"sh txnfile\"" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-server.at:955" -( $at_check_trace; ovsdb-server --remote=punix:socket --unixctl="`pwd`"/unixctl db --run="sh txnfile" -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - cat stdout >> output - - { set +x -$as_echo "$at_srcdir/ovsdb-server.at:955: \${PERL} \$srcdir/uuidfilt.pl output" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-server.at:955" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "[{\"uuid\":[\"uuid\",\"<0>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]},{\"uuid\":[\"uuid\",\"<4>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<5>\"]},{\"uuid\":[\"uuid\",\"<6>\"]}] -[{\"rows\":[{\"a\":4},{\"a\":5}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<7>\"]},{\"uuid\":[\"uuid\",\"<8>\"]}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<9>\"]},{\"uuid\":[\"uuid\",\"<10>\"]},{\"uuid\":[\"uuid\",\"<11>\"]},{\"uuid\":[\"uuid\",\"<12>\"]}] -[{\"rows\":[{\"a\":8},{\"a\":9},{\"a\":10},{\"a\":11}]}] -[{\"count\":1}] -[{\"rows\":[]}] -[{\"uuid\":[\"uuid\",\"<13>\"]}] -[{\"rows\":[]}] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-server.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1364 -#AT_START_1365 -at_fn_group_banner 1365 'ovsdb-monitor.at:42' \ - "monitor insert into empty table" " " 80 -at_xfail=no -( - $as_echo "1365. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:42" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:42" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:42" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:42" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:42" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:42" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:42" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:42: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:42" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,insert,\"\"\"zero\"\"\",0,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:42" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1365 -#AT_START_1366 -at_fn_group_banner 1366 'ovsdb-monitor.at:54' \ - "monitor insert into populated table" " " 80 -at_xfail=no -( - $as_echo "1366. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:54" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:54" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:54" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:54" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 0, \"name\": \"zero\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:54" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 0, "name": "zero"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:54" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:54" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:54" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:54: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:54" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<2>,insert,\"\"\"zero\"\"\",0,\"[\"\"uuid\"\",\"\"<3>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:54" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1366 -#AT_START_1367 -at_fn_group_banner 1367 'ovsdb-monitor.at:72' \ - "monitor delete" " " 80 -at_xfail=no -( - $as_echo "1367. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:72" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:72" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:72" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:72" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 10]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:72" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": [["number", "==", 10]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:72" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:72" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:72" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:72: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:72" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<0>,delete,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:72" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1367 -#AT_START_1368 -at_fn_group_banner 1368 'ovsdb-monitor.at:90' \ - "monitor row update" " " 80 -at_xfail=no -( - $as_echo "1368. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:90" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:90" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:90" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:90" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 10]], - \"row\": {\"name\": \"five plus five\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:90" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 10]], - "row": {"name": "five plus five"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:90" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:90" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:90" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:90: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:90" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<0>,old,\"\"\"ten\"\"\",,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -,new,\"\"\"five plus five\"\"\",10,\"[\"\"uuid\"\",\"\"<2>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:90" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1368 -#AT_START_1369 -at_fn_group_banner 1369 'ovsdb-monitor.at:110' \ - "monitor no-op row updates" " " 80 -at_xfail=no -( - $as_echo "1369. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:110" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:110" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:110" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:110" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"number\", \"==\", 10]], - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:110" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["number", "==", 10]], - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 9, \"name\": \"nine\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:110" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 9, "name": "nine"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:110" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:110" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:110" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:110: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:110" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<2>,insert,\"\"\"nine\"\"\",9,\"[\"\"uuid\"\",\"\"<3>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:110" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1369 -#AT_START_1370 -at_fn_group_banner 1370 'ovsdb-monitor.at:133' \ - "monitor insert-and-update transaction" " " 80 -at_xfail=no -( - $as_echo "1370. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:133" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:133" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:133" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:133" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 9, \"name\": \"nine\"}, - \"uuid-name\": \"nine\"}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"nine\"]]], - \"row\": {\"name\": \"three squared\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:133" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 9, "name": "nine"}, - "uuid-name": "nine"}, - {"op": "update", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "nine"]]], - "row": {"name": "three squared"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:133" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:133" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:133" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:133: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:133" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<2>,insert,\"\"\"three squared\"\"\",9,\"[\"\"uuid\"\",\"\"<3>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:133" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1370 -#AT_START_1371 -at_fn_group_banner 1371 'ovsdb-monitor.at:156' \ - "monitor insert-update-and-delete transaction" " " 80 -at_xfail=no -( - $as_echo "1371. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:156" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:156" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:156" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:156" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 9, \"name\": \"nine\"}, - \"uuid-name\": \"nine\"}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"nine\"]]], - \"row\": {\"name\": \"three squared\"}}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"nine\"]]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 7, \"name\": \"seven\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:156" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 9, "name": "nine"}, - "uuid-name": "nine"}, - {"op": "update", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "nine"]]], - "row": {"name": "three squared"}}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "nine"]]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 7, "name": "seven"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:156" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:156" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:156" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:156: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:156" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<2>,insert,\"\"\"seven\"\"\",7,\"[\"\"uuid\"\",\"\"<3>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:156" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1371 -#AT_START_1372 -at_fn_group_banner 1372 'ovsdb-monitor.at:185' \ - "monitor weak reference change" " " 80 -at_xfail=no -( - $as_echo "1372. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - weak_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:185" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovsdb-tool transact db '[\"weak\", - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 0, - \"a2a1\": [\"named-uuid\", \"a0\"], - \"a2b\": [\"named-uuid\", \"b2\"]}, - \"uuid-name\": \"a0\"}, - {\"op\": \"insert\", - \"table\": \"a\", - \"row\": {\"a\": 1, - \"a2a\": [\"named-uuid\", \"a0\"], - \"a2a1\": [\"named-uuid\", \"a1\"], - \"a2b\": [\"named-uuid\", \"b2\"]}, - \"uuid-name\": \"a1\"}, - {\"op\": \"insert\", - \"table\": \"b\", - \"row\": {\"b\": 2}, - \"uuid-name\": \"b2\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:185" -( $at_check_trace; ovsdb-tool transact db '["weak", - {"op": "insert", - "table": "a", - "row": {"a": 0, - "a2a1": ["named-uuid", "a0"], - "a2b": ["named-uuid", "b2"]}, - "uuid-name": "a0"}, - {"op": "insert", - "table": "a", - "row": {"a": 1, - "a2a": ["named-uuid", "a0"], - "a2a1": ["named-uuid", "a1"], - "a2b": ["named-uuid", "b2"]}, - "uuid-name": "a1"}, - {"op": "insert", - "table": "b", - "row": {"b": 2}, - "uuid-name": "b2"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:185" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket weak a > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:185" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket weak a > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovsdb-client transact unix:socket '[\"weak\", - {\"op\": \"delete\", - \"table\": \"a\", - \"where\": [[\"a\", \"==\", 0]]}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:185" -( $at_check_trace; ovsdb-client transact unix:socket '["weak", - {"op": "delete", - "table": "a", - "where": [["a", "==", 0]]}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovsdb-client transact unix:socket '[\"weak\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:185" -( $at_check_trace; ovsdb-client transact unix:socket '["weak"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:185" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:185" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:185: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:185" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,a,a2a,a2a1,a2b,_version -<0>,initial,0,\"[\"\"set\"\",[]]\",\"[\"\"uuid\"\",\"\"<0>\"\"]\",\"[\"\"uuid\"\",\"\"<1>\"\"]\",\"[\"\"uuid\"\",\"\"<2>\"\"]\" -<3>,initial,1,\"[\"\"uuid\"\",\"\"<0>\"\"]\",\"[\"\"uuid\"\",\"\"<3>\"\"]\",\"[\"\"uuid\"\",\"\"<1>\"\"]\",\"[\"\"uuid\"\",\"\"<4>\"\"]\" - -row,action,a,a2a,a2a1,a2b,_version -<0>,delete,0,\"[\"\"set\"\",[]]\",\"[\"\"uuid\"\",\"\"<0>\"\"]\",\"[\"\"uuid\"\",\"\"<1>\"\"]\",\"[\"\"uuid\"\",\"\"<2>\"\"]\" -<3>,old,,\"[\"\"uuid\"\",\"\"<0>\"\"]\",,,\"[\"\"uuid\"\",\"\"<4>\"\"]\" -,new,1,\"[\"\"set\"\",[]]\",\"[\"\"uuid\"\",\"\"<3>\"\"]\",\"[\"\"uuid\"\",\"\"<1>\"\"]\",\"[\"\"uuid\"\",\"\"<5>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:185" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1372 -#AT_START_1373 -at_fn_group_banner 1373 'ovsdb-monitor.at:220' \ - "monitor insert-update-and-delete transaction" " " 80 -at_xfail=no -( - $as_echo "1373. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:220" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:220" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:220" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:220" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 9, \"name\": \"nine\"}, - \"uuid-name\": \"nine\"}, - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"nine\"]]], - \"row\": {\"name\": \"three squared\"}}, - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": [[\"_uuid\", \"==\", [\"named-uuid\", \"nine\"]]]}, - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 7, \"name\": \"seven\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:220" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 9, "name": "nine"}, - "uuid-name": "nine"}, - {"op": "update", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "nine"]]], - "row": {"name": "three squared"}}, - {"op": "delete", - "table": "ordinals", - "where": [["_uuid", "==", ["named-uuid", "nine"]]]}, - {"op": "insert", - "table": "ordinals", - "row": {"number": 7, "name": "seven"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:220" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:220" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:220" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:220: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:220" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<2>,insert,\"\"\"seven\"\"\",7,\"[\"\"uuid\"\",\"\"<3>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:220" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1373 -#AT_START_1374 -at_fn_group_banner 1374 'ovsdb-monitor.at:271' \ - "monitor all operations" " " 81 -at_xfail=no -( - $as_echo "1374. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 5, \"name\": \"five\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 5, "name": "five"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"five\"]], - \"row\": {\"name\": \"FIVE\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "five"]], - "row": {"name": "FIVE"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:271" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:271" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:271" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:271: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:271" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" - -row,action,name,number,_version -<2>,insert,\"\"\"five\"\"\",5,\"[\"\"uuid\"\",\"\"<3>\"\"]\" - -row,action,name,number,_version -<2>,old,\"\"\"five\"\"\",,\"[\"\"uuid\"\",\"\"<3>\"\"]\" -,new,\"\"\"FIVE\"\"\",5,\"[\"\"uuid\"\",\"\"<4>\"\"]\" - -row,action,name,number,_version -<2>,delete,\"\"\"FIVE\"\"\",5,\"[\"\"uuid\"\",\"\"<4>\"\"]\" -<0>,delete,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:271" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1374 -#AT_START_1375 -at_fn_group_banner 1375 'ovsdb-monitor.at:291' \ - "monitor initial only" " " 81 -at_xfail=no -( - $as_echo "1375. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !insert,!delete,!modify > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !insert,!delete,!modify > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 5, \"name\": \"five\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 5, "name": "five"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"five\"]], - \"row\": {\"name\": \"FIVE\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "five"]], - "row": {"name": "FIVE"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:291" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:291" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:291" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:291: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:291" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,initial,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:291" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1375 -#AT_START_1376 -at_fn_group_banner 1376 'ovsdb-monitor.at:298' \ - "monitor insert only" " " 81 -at_xfail=no -( - $as_echo "1376. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !initial,!delete,!modify > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !initial,!delete,!modify > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 5, \"name\": \"five\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 5, "name": "five"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"five\"]], - \"row\": {\"name\": \"FIVE\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "five"]], - "row": {"name": "FIVE"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:298" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:298" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:298" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:298: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:298" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,insert,\"\"\"five\"\"\",5,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:298" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1376 -#AT_START_1377 -at_fn_group_banner 1377 'ovsdb-monitor.at:305' \ - "monitor delete only" " " 81 -at_xfail=no -( - $as_echo "1377. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !initial,!insert,!modify > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !initial,!insert,!modify > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 5, \"name\": \"five\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 5, "name": "five"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"five\"]], - \"row\": {\"name\": \"FIVE\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "five"]], - "row": {"name": "FIVE"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:305" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:305" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:305" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:305: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:305" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,delete,\"\"\"FIVE\"\"\",5,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -<2>,delete,\"\"\"ten\"\"\",10,\"[\"\"uuid\"\",\"\"<3>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:305" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1377 -#AT_START_1378 -at_fn_group_banner 1378 'ovsdb-monitor.at:313' \ - "monitor modify only" " " 81 -at_xfail=no -( - $as_echo "1378. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - ordinal_schema > schema - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-tool create db schema" -at_fn_check_prepare_trace "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-tool create db schema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-tool transact db '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 10, \"name\": \"ten\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-tool transact db '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 10, "name": "ten"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/server-pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl --log-file=\"\`pwd\`\"/ovsdb-server-log db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/server-pid --remote=punix:socket --unixctl="`pwd`"/unixctl --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-client -vjsonrpc --detach --no-chdir --pidfile=\"\`pwd\`\"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !initial,!insert,!delete > output" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-client -vjsonrpc --detach --no-chdir --pidfile="`pwd`"/client-pid -d json monitor --format=csv unix:socket ordinals ordinals !initial,!insert,!delete > output -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -if $at_failed; then : - kill `cat server-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"insert\", - \"table\": \"ordinals\", - \"row\": {\"number\": 5, \"name\": \"five\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "insert", - "table": "ordinals", - "row": {"number": 5, "name": "five"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"update\", - \"table\": \"ordinals\", - \"where\": [[\"name\", \"==\", \"five\"]], - \"row\": {\"name\": \"FIVE\"}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "update", - "table": "ordinals", - "where": [["name", "==", "five"]], - "row": {"name": "FIVE"}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-client transact unix:socket '[\"ordinals\", - {\"op\": \"delete\", - \"table\": \"ordinals\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals", - {"op": "delete", - "table": "ordinals", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovsdb-client transact unix:socket '[\"ordinals\"]'" -at_fn_check_prepare_trace "ovsdb-monitor.at:313" -( $at_check_trace; ovsdb-client transact unix:socket '["ordinals"]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -if $at_failed; then : - kill `cat server-pid client-pid` -fi -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-monitor.at:313" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-monitor.at:313" -( $at_check_trace; ovs_wait_cond () { test ! -e server-pid && test ! -e client-pid -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-monitor.at:313: \${PERL} \$srcdir/ovsdb-monitor-sort.pl < output | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-monitor.at:313" -( $at_check_trace; ${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "row,action,name,number,_version -<0>,old,\"\"\"five\"\"\",,\"[\"\"uuid\"\",\"\"<1>\"\"]\" -,new,\"\"\"FIVE\"\"\",5,\"[\"\"uuid\"\",\"\"<2>\"\"]\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-monitor.at:313" -$at_failed && at_fn_log_failure \ -"ovsdb-server-log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1378 -#AT_START_1379 -at_fn_group_banner 1379 'ovsdb-idl.at:103' \ - "simple idl, initially empty, no ops - C" " " 82 -at_xfail=no -( - $as_echo "1379. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket " -at_fn_check_prepare_notrace 'a shell pipeline' "ovsdb-idl.at:103" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:103" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1379 -#AT_START_1380 -at_fn_group_banner 1380 'ovsdb-idl.at:103' \ - "simple idl, initially empty, no ops - Python" " " 82 -at_xfail=no -( - $as_echo "1380. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:103" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:103" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket " "ovsdb-idl.at:103" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:103" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1380 -#AT_START_1381 -at_fn_group_banner 1381 'ovsdb-idl.at:103' \ - "simple idl, initially empty, no ops - Python tcp" "" 82 -at_xfail=no -( - $as_echo "1381. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:103" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:103" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT " "ovsdb-idl.at:103" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:103" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1381 -#AT_START_1382 -at_fn_group_banner 1382 'ovsdb-idl.at:103' \ - "simple idl, initially empty, no ops - Python tcp6" "" 82 -at_xfail=no -( - $as_echo "1382. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:103" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:103" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT " -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT " "ovsdb-idl.at:103" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:103" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:103: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:103" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:103" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1382 -#AT_START_1383 -at_fn_group_banner 1383 'ovsdb-idl.at:110' \ - "simple idl, initially empty, various ops - C" " " 82 -at_xfail=no -( - $as_echo "1383. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"r\": 123.5}}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": -1, - \"r\": 125, - \"b\": false, - \"s\": \"\", - \"ia\": [\"set\", [1]], - \"ra\": [\"set\", [1.5]], - \"ba\": [\"set\", [false]], - \"sa\": [\"set\", []], - \"ua\": [\"set\", []]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"<\", 1]], - \"row\": {\"s\": \"newstring\"}}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 0]]}]' \\ - 'reconnect'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:110" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"r": 123.5}}]' \ - '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": -1, - "r": 125, - "b": false, - "s": "", - "ia": ["set", [1]], - "ra": ["set", [1.5]], - "ba": ["set", [false]], - "sa": ["set", []], - "ua": ["set", []]}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "<", 1]], - "row": {"s": "newstring"}}]' \ - '["idltest", - {"op": "delete", - "table": "simple", - "where": [["i", "==", 0]]}]' \ - 'reconnect' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:110" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -003: {\"error\":null,\"result\":[{\"count\":2}]} -004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -005: {\"error\":null,\"result\":[{\"count\":2}]} -006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -007: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<6>\"]}]} -008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -009: {\"error\":null,\"result\":[{\"count\":2}]} -010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -011: {\"error\":null,\"result\":[{\"count\":1}]} -012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -013: reconnect -014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -015: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1383 -#AT_START_1384 -at_fn_group_banner 1384 'ovsdb-idl.at:110' \ - "simple idl, initially empty, various ops - Python" "" 82 -at_xfail=no -( - $as_echo "1384. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:110" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:110" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"r\": 123.5}}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": -1, - \"r\": 125, - \"b\": false, - \"s\": \"\", - \"ia\": [\"set\", [1]], - \"ra\": [\"set\", [1.5]], - \"ba\": [\"set\", [false]], - \"sa\": [\"set\", []], - \"ua\": [\"set\", []]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"<\", 1]], - \"row\": {\"s\": \"newstring\"}}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 0]]}]' \\ - 'reconnect'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:110" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"r": 123.5}}]' \ - '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": -1, - "r": 125, - "b": false, - "s": "", - "ia": ["set", [1]], - "ra": ["set", [1.5]], - "ba": ["set", [false]], - "sa": ["set", []], - "ua": ["set", []]}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "<", 1]], - "row": {"s": "newstring"}}]' \ - '["idltest", - {"op": "delete", - "table": "simple", - "where": [["i", "==", 0]]}]' \ - 'reconnect' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:110" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -003: {\"error\":null,\"result\":[{\"count\":2}]} -004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -005: {\"error\":null,\"result\":[{\"count\":2}]} -006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -007: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<6>\"]}]} -008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -009: {\"error\":null,\"result\":[{\"count\":2}]} -010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -011: {\"error\":null,\"result\":[{\"count\":1}]} -012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -013: reconnect -014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -015: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1384 -#AT_START_1385 -at_fn_group_banner 1385 'ovsdb-idl.at:110' \ - "simple idl, initially empty, various ops - Python tcp" "" 82 -at_xfail=no -( - $as_echo "1385. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:110" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:110" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"r\": 123.5}}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": -1, - \"r\": 125, - \"b\": false, - \"s\": \"\", - \"ia\": [\"set\", [1]], - \"ra\": [\"set\", [1.5]], - \"ba\": [\"set\", [false]], - \"sa\": [\"set\", []], - \"ua\": [\"set\", []]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"<\", 1]], - \"row\": {\"s\": \"newstring\"}}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 0]]}]' \\ - 'reconnect'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:110" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"r": 123.5}}]' \ - '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": -1, - "r": 125, - "b": false, - "s": "", - "ia": ["set", [1]], - "ra": ["set", [1.5]], - "ba": ["set", [false]], - "sa": ["set", []], - "ua": ["set", []]}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "<", 1]], - "row": {"s": "newstring"}}]' \ - '["idltest", - {"op": "delete", - "table": "simple", - "where": [["i", "==", 0]]}]' \ - 'reconnect' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:110" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -003: {\"error\":null,\"result\":[{\"count\":2}]} -004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -005: {\"error\":null,\"result\":[{\"count\":2}]} -006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -007: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<6>\"]}]} -008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -009: {\"error\":null,\"result\":[{\"count\":2}]} -010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -011: {\"error\":null,\"result\":[{\"count\":1}]} -012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -013: reconnect -014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -015: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1385 -#AT_START_1386 -at_fn_group_banner 1386 'ovsdb-idl.at:110' \ - "simple idl, initially empty, various ops - Python tcp6" "" 82 -at_xfail=no -( - $as_echo "1386. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:110" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:110" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"r\": 123.5}}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": -1, - \"r\": 125, - \"b\": false, - \"s\": \"\", - \"ia\": [\"set\", [1]], - \"ra\": [\"set\", [1.5]], - \"ba\": [\"set\", [false]], - \"sa\": [\"set\", []], - \"ua\": [\"set\", []]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"<\", 1]], - \"row\": {\"s\": \"newstring\"}}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 0]]}]' \\ - 'reconnect'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:110" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"r": 123.5}}]' \ - '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": -1, - "r": 125, - "b": false, - "s": "", - "ia": ["set", [1]], - "ra": ["set", [1.5]], - "ba": ["set", [false]], - "sa": ["set", []], - "ua": ["set", []]}}]' \ - '["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "<", 1]], - "row": {"s": "newstring"}}]' \ - '["idltest", - {"op": "delete", - "table": "simple", - "where": [["i", "==", 0]]}]' \ - 'reconnect' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:110" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -003: {\"error\":null,\"result\":[{\"count\":2}]} -004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -005: {\"error\":null,\"result\":[{\"count\":2}]} -006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -007: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<6>\"]}]} -008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -009: {\"error\":null,\"result\":[{\"count\":2}]} -010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -011: {\"error\":null,\"result\":[{\"count\":1}]} -012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -013: reconnect -014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> -015: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:110: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:110" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:110" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1386 -#AT_START_1387 -at_fn_group_banner 1387 'ovsdb-idl.at:188' \ - "simple idl, initially populated - C" " " 82 -at_xfail=no -( - $as_echo "1387. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:188" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: {\"error\":null,\"result\":[{\"count\":2}]} -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1387 -#AT_START_1388 -at_fn_group_banner 1388 'ovsdb-idl.at:188' \ - "simple idl, initially populated - Python" " " 82 -at_xfail=no -( - $as_echo "1388. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:188" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:188" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:188" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: {\"error\":null,\"result\":[{\"count\":2}]} -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1388 -#AT_START_1389 -at_fn_group_banner 1389 'ovsdb-idl.at:188' \ - "simple idl, initially populated - Python tcp" " " 82 -at_xfail=no -( - $as_echo "1389. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:188" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:188" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:188" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: {\"error\":null,\"result\":[{\"count\":2}]} -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1389 -#AT_START_1390 -at_fn_group_banner 1390 'ovsdb-idl.at:188' \ - "simple idl, initially populated - Python tcp6" " " 82 -at_xfail=no -( - $as_echo "1390. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:188" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:188" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovsdb-client transact \"tcp:[::1]:\$TCP_PORT\" '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; ovsdb-client transact "tcp:[::1]:$TCP_PORT" '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT '[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [], - \"row\": {\"b\": true}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:188" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT '["idltest", - {"op": "update", - "table": "simple", - "where": [], - "row": {"b": true}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:188" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: {\"error\":null,\"result\":[{\"count\":2}]} -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:188: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:188" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:188" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1390 -#AT_START_1391 -at_fn_group_banner 1391 'ovsdb-idl.at:219' \ - "simple idl, writing via IDL - C" " " 82 -at_xfail=no -( - $as_echo "1391. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \\ - 'insert 2, verify 2 i, verify 1 b, delete 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \ - 'insert 2, verify 2 i, verify 1 b, delete 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:219" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: commit, status=success -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: commit, status=success -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6> -005: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1391 -#AT_START_1392 -at_fn_group_banner 1392 'ovsdb-idl.at:219' \ - "simple idl, writing via IDL - Python" " " 82 -at_xfail=no -( - $as_echo "1392. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:219" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:219" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \\ - 'insert 2, verify 2 i, verify 1 b, delete 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \ - 'insert 2, verify 2 i, verify 1 b, delete 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:219" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: commit, status=success -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: commit, status=success -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6> -005: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1392 -#AT_START_1393 -at_fn_group_banner 1393 'ovsdb-idl.at:219' \ - "simple idl, writing via IDL - Python tcp" " " 82 -at_xfail=no -( - $as_echo "1393. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:219" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:219" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \\ - 'insert 2, verify 2 i, verify 1 b, delete 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \ - 'insert 2, verify 2 i, verify 1 b, delete 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:219" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: commit, status=success -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: commit, status=success -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6> -005: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1393 -#AT_START_1394 -at_fn_group_banner 1394 'ovsdb-idl.at:219' \ - "simple idl, writing via IDL - Python tcp6" " " 82 -at_xfail=no -( - $as_echo "1394. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:219" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:219" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovsdb-client transact \"tcp:[::1]:\$TCP_PORT\" '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0, - \"b\": true, - \"s\": \"mystring\", - \"u\": [\"uuid\", \"84f5c8f5-ac76-4dbc-a24f-8860eb407fc1\"], - \"ia\": [\"set\", [1, 2, 3]], - \"ra\": [\"set\", [-0.5]], - \"ba\": [\"set\", [true]], - \"sa\": [\"set\", [\"abc\", \"def\"]], - \"ua\": [\"set\", [[\"uuid\", \"69443985-7806-45e2-b35f-574a04e720f9\"], - [\"uuid\", \"aad11ef0-816a-4b01-93e6-03b8b4256b98\"]]]}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; ovsdb-client transact "tcp:[::1]:$TCP_PORT" '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0, - "b": true, - "s": "mystring", - "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"], - "ia": ["set", [1, 2, 3]], - "ra": ["set", [-0.5]], - "ba": ["set", [true]], - "sa": ["set", ["abc", "def"]], - "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"], - ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \\ - 'insert 2, verify 2 i, verify 1 b, delete 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:219" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT 'verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \ - 'insert 2, verify 2 i, verify 1 b, delete 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:219" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -001: commit, status=success -002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> -003: commit, status=success -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6> -005: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:219: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:219" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:219" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1394 -#AT_START_1395 -at_fn_group_banner 1395 'ovsdb-idl.at:250' \ - "simple idl, handling verification failure - C" " " 82 -at_xfail=no -( - $as_echo "1395. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 b 1' \\ - '+[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"r\": 5.0}}]' \\ - '+verify 1 r, set 1 r 3' \\ - 'verify 1 r, set 1 r 3' \\ - " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 b 1' \ - '+["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "==", 1]], - "row": {"r": 5.0}}]' \ - '+verify 1 r, set 1 r 3' \ - 'verify 1 r, set 1 r 3' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:250" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -001: commit, status=success -002: {\"error\":null,\"result\":[{\"count\":1}]} -003: commit, status=try again -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -005: commit, status=success -006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -007: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1395 -#AT_START_1396 -at_fn_group_banner 1396 'ovsdb-idl.at:250' \ - "simple idl, handling verification failure - Python" "" 82 -at_xfail=no -( - $as_echo "1396. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:250" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:250" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket 'set 0 b 1' \\ - '+[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"r\": 5.0}}]' \\ - '+verify 1 r, set 1 r 3' \\ - 'verify 1 r, set 1 r 3' \\ - " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'set 0 b 1' \ - '+["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "==", 1]], - "row": {"r": 5.0}}]' \ - '+verify 1 r, set 1 r 3' \ - 'verify 1 r, set 1 r 3' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:250" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -001: commit, status=success -002: {\"error\":null,\"result\":[{\"count\":1}]} -003: commit, status=try again -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -005: commit, status=success -006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -007: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1396 -#AT_START_1397 -at_fn_group_banner 1397 'ovsdb-idl.at:250' \ - "simple idl, handling verification failure - Python tcp" "" 82 -at_xfail=no -( - $as_echo "1397. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:250" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:250" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT 'set 0 b 1' \\ - '+[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"r\": 5.0}}]' \\ - '+verify 1 r, set 1 r 3' \\ - 'verify 1 r, set 1 r 3' \\ - " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT 'set 0 b 1' \ - '+["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "==", 1]], - "row": {"r": 5.0}}]' \ - '+verify 1 r, set 1 r 3' \ - 'verify 1 r, set 1 r 3' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:250" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -001: commit, status=success -002: {\"error\":null,\"result\":[{\"count\":1}]} -003: commit, status=try again -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -005: commit, status=success -006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -007: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1397 -#AT_START_1398 -at_fn_group_banner 1398 'ovsdb-idl.at:250' \ - "simple idl, handling verification failure - Python tcp6" "" 82 -at_xfail=no -( - $as_echo "1398. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:250" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:250" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovsdb-client transact \"tcp:[::1]:\$TCP_PORT\" '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {\"i\": 1, - \"r\": 2.0}}, - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; ovsdb-client transact "tcp:[::1]:$TCP_PORT" '["idltest", - {"op": "insert", - "table": "simple", - "row": {"i": 1, - "r": 2.0}}, - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT 'set 0 b 1' \\ - '+[\"idltest\", - {\"op\": \"update\", - \"table\": \"simple\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"r\": 5.0}}]' \\ - '+verify 1 r, set 1 r 3' \\ - 'verify 1 r, set 1 r 3' \\ - " -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:250" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT 'set 0 b 1' \ - '+["idltest", - {"op": "update", - "table": "simple", - "where": [["i", "==", 1]], - "row": {"r": 5.0}}]' \ - '+verify 1 r, set 1 r 3' \ - 'verify 1 r, set 1 r 3' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:250" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -001: commit, status=success -002: {\"error\":null,\"result\":[{\"count\":1}]} -003: commit, status=try again -004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -005: commit, status=success -006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -007: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:250: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:250" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:250" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1398 -#AT_START_1399 -at_fn_group_banner 1399 'ovsdb-idl.at:281' \ - "simple idl, increment operation - C" " " 82 -at_xfail=no -( - $as_echo "1399. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 r 2.0, increment 0'" -at_fn_check_prepare_notrace 'a shell pipeline' "ovsdb-idl.at:281" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 r 2.0, increment 0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:281" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=success, increment=1 -002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1399 -#AT_START_1400 -at_fn_group_banner 1400 'ovsdb-idl.at:281' \ - "simple idl, increment operation - Python" " " 82 -at_xfail=no -( - $as_echo "1400. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:281" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:281" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket 'set 0 r 2.0, increment 0'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'set 0 r 2.0, increment 0'" "ovsdb-idl.at:281" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'set 0 r 2.0, increment 0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:281" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=success, increment=1 -002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1400 -#AT_START_1401 -at_fn_group_banner 1401 'ovsdb-idl.at:281' \ - "simple idl, increment operation - Python tcp" " " 82 -at_xfail=no -( - $as_echo "1401. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:281" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:281" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT 'set 0 r 2.0, increment 0'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT 'set 0 r 2.0, increment 0'" "ovsdb-idl.at:281" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT 'set 0 r 2.0, increment 0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:281" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=success, increment=1 -002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1401 -#AT_START_1402 -at_fn_group_banner 1402 'ovsdb-idl.at:281' \ - "simple idl, increment operation - Python tcp6" " " 82 -at_xfail=no -( - $as_echo "1402. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:281" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:281" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovsdb-client transact \"tcp:[::1]:\$TCP_PORT\" '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:281" -( $at_check_trace; ovsdb-client transact "tcp:[::1]:$TCP_PORT" '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT 'set 0 r 2.0, increment 0'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT 'set 0 r 2.0, increment 0'" "ovsdb-idl.at:281" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT 'set 0 r 2.0, increment 0' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:281" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=success, increment=1 -002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:281: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:281" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:281" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1402 -#AT_START_1403 -at_fn_group_banner 1403 'ovsdb-idl.at:293' \ - "simple idl, aborting - C" " " 82 -at_xfail=no -( - $as_echo "1403. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 r 2.0, abort' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 r 2.0, abort' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:293" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=aborted -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1403 -#AT_START_1404 -at_fn_group_banner 1404 'ovsdb-idl.at:293' \ - "simple idl, aborting - Python" " " 82 -at_xfail=no -( - $as_echo "1404. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:293" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:293" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket 'set 0 r 2.0, abort' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'set 0 r 2.0, abort' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:293" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=aborted -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1404 -#AT_START_1405 -at_fn_group_banner 1405 'ovsdb-idl.at:293' \ - "simple idl, aborting - Python tcp" " " 82 -at_xfail=no -( - $as_echo "1405. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:293" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:293" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT 'set 0 r 2.0, abort' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT 'set 0 r 2.0, abort' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:293" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=aborted -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1405 -#AT_START_1406 -at_fn_group_banner 1406 'ovsdb-idl.at:293' \ - "simple idl, aborting - Python tcp6" " " 82 -at_xfail=no -( - $as_echo "1406. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:293" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:293" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovsdb-client transact \"tcp:[::1]:\$TCP_PORT\" '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; ovsdb-client transact "tcp:[::1]:$TCP_PORT" '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT 'set 0 r 2.0, abort' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:293" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT 'set 0 r 2.0, abort' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:293" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: commit, status=aborted -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:293: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:293" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:293" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1406 -#AT_START_1407 -at_fn_group_banner 1407 'ovsdb-idl.at:307' \ - "simple idl, destroy without commit or abort - C" "" 82 -at_xfail=no -( - $as_echo "1407. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 r 2.0, destroy' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket 'set 0 r 2.0, destroy' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:307" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: destroy -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1407 -#AT_START_1408 -at_fn_group_banner 1408 'ovsdb-idl.at:307' \ - "simple idl, destroy without commit or abort - Python" "" 82 -at_xfail=no -( - $as_echo "1408. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:307" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:307" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-client transact unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-client transact unix:socket '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket 'set 0 r 2.0, destroy' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'set 0 r 2.0, destroy' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:307" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: destroy -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1408 -#AT_START_1409 -at_fn_group_banner 1409 'ovsdb-idl.at:307' \ - "simple idl, destroy without commit or abort - Python tcp" "" 82 -at_xfail=no -( - $as_echo "1409. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:307" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:307" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-client transact tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-client transact tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT 'set 0 r 2.0, destroy' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT 'set 0 r 2.0, destroy' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:307" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: destroy -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1409 -#AT_START_1410 -at_fn_group_banner 1410 'ovsdb-idl.at:307' \ - "simple idl, destroy without commit or abort - Python tcp6" "" 82 -at_xfail=no -( - $as_echo "1410. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:307" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:307" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovsdb-client transact \"tcp:[::1]:\$TCP_PORT\" '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"simple\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; ovsdb-client transact "tcp:[::1]:$TCP_PORT" '["idltest", - {"op": "insert", - "table": "simple", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT 'set 0 r 2.0, destroy' \\ -'+set 0 b 1'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:307" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT 'set 0 r 2.0, destroy' \ -'+set 0 b 1' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:307" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -001: destroy -002: commit, status=success -003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -004: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1410 -#AT_START_1411 -at_fn_group_banner 1411 'ovsdb-idl.at:321' \ - "self-linking idl, consistent ops - C" " " 82 -at_xfail=no -( - $as_echo "1411. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row2\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"k\": [\"uuid\", \"#1#\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"#0#\"]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:321" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "self"]}, - "uuid-name": "self"}]' \ - '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "row1"]}, - "uuid-name": "row2"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 1]], - "row": {"k": ["uuid", "#1#"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "#0#"]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:321" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]}]} -002: i=0 k=0 ka=[] l2= uuid=<0> -003: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]}]} -004: i=0 k=0 ka=[] l2= uuid=<0> -004: i=1 k=2 ka=[] l2= uuid=<1> -004: i=2 k=1 ka=[] l2= uuid=<2> -005: {\"error\":null,\"result\":[{\"count\":1}]} -006: i=0 k=0 ka=[] l2= uuid=<0> -006: i=1 k=1 ka=[] l2= uuid=<1> -006: i=2 k=1 ka=[] l2= uuid=<2> -007: {\"error\":null,\"result\":[{\"count\":3}]} -008: i=0 k=0 ka=[] l2= uuid=<0> -008: i=1 k=0 ka=[] l2= uuid=<1> -008: i=2 k=0 ka=[] l2= uuid=<2> -009: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1411 -#AT_START_1412 -at_fn_group_banner 1412 'ovsdb-idl.at:321' \ - "self-linking idl, consistent ops - Python" " " 82 -at_xfail=no -( - $as_echo "1412. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:321" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:321" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row2\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"k\": [\"uuid\", \"#1#\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"#0#\"]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:321" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "self"]}, - "uuid-name": "self"}]' \ - '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "row1"]}, - "uuid-name": "row2"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 1]], - "row": {"k": ["uuid", "#1#"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "#0#"]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:321" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]}]} -002: i=0 k=0 ka=[] l2= uuid=<0> -003: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]}]} -004: i=0 k=0 ka=[] l2= uuid=<0> -004: i=1 k=2 ka=[] l2= uuid=<1> -004: i=2 k=1 ka=[] l2= uuid=<2> -005: {\"error\":null,\"result\":[{\"count\":1}]} -006: i=0 k=0 ka=[] l2= uuid=<0> -006: i=1 k=1 ka=[] l2= uuid=<1> -006: i=2 k=1 ka=[] l2= uuid=<2> -007: {\"error\":null,\"result\":[{\"count\":3}]} -008: i=0 k=0 ka=[] l2= uuid=<0> -008: i=1 k=0 ka=[] l2= uuid=<1> -008: i=2 k=0 ka=[] l2= uuid=<2> -009: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1412 -#AT_START_1413 -at_fn_group_banner 1413 'ovsdb-idl.at:321' \ - "self-linking idl, consistent ops - Python tcp" " " 82 -at_xfail=no -( - $as_echo "1413. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:321" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:321" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row2\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"k\": [\"uuid\", \"#1#\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"#0#\"]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:321" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "self"]}, - "uuid-name": "self"}]' \ - '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "row1"]}, - "uuid-name": "row2"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 1]], - "row": {"k": ["uuid", "#1#"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "#0#"]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:321" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]}]} -002: i=0 k=0 ka=[] l2= uuid=<0> -003: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]}]} -004: i=0 k=0 ka=[] l2= uuid=<0> -004: i=1 k=2 ka=[] l2= uuid=<1> -004: i=2 k=1 ka=[] l2= uuid=<2> -005: {\"error\":null,\"result\":[{\"count\":1}]} -006: i=0 k=0 ka=[] l2= uuid=<0> -006: i=1 k=1 ka=[] l2= uuid=<1> -006: i=2 k=1 ka=[] l2= uuid=<2> -007: {\"error\":null,\"result\":[{\"count\":3}]} -008: i=0 k=0 ka=[] l2= uuid=<0> -008: i=1 k=0 ka=[] l2= uuid=<1> -008: i=2 k=0 ka=[] l2= uuid=<2> -009: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1413 -#AT_START_1414 -at_fn_group_banner 1414 'ovsdb-idl.at:321' \ - "self-linking idl, consistent ops - Python tcp6" " " 82 -at_xfail=no -( - $as_echo "1414. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:321" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:321" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"self\"]}, - \"uuid-name\": \"self\"}]' \\ - '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row2\"]}, - \"uuid-name\": \"row1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"row1\"]}, - \"uuid-name\": \"row2\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 1]], - \"row\": {\"k\": [\"uuid\", \"#1#\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"#0#\"]}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:321" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "self"]}, - "uuid-name": "self"}]' \ - '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row2"]}, - "uuid-name": "row1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "row1"]}, - "uuid-name": "row2"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 1]], - "row": {"k": ["uuid", "#1#"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "#0#"]}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:321" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]}]} -002: i=0 k=0 ka=[] l2= uuid=<0> -003: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]}]} -004: i=0 k=0 ka=[] l2= uuid=<0> -004: i=1 k=2 ka=[] l2= uuid=<1> -004: i=2 k=1 ka=[] l2= uuid=<2> -005: {\"error\":null,\"result\":[{\"count\":1}]} -006: i=0 k=0 ka=[] l2= uuid=<0> -006: i=1 k=1 ka=[] l2= uuid=<1> -006: i=2 k=1 ka=[] l2= uuid=<2> -007: {\"error\":null,\"result\":[{\"count\":3}]} -008: i=0 k=0 ka=[] l2= uuid=<0> -008: i=1 k=0 ka=[] l2= uuid=<1> -008: i=2 k=0 ka=[] l2= uuid=<2> -009: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:321: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:321" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:321" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1414 -#AT_START_1415 -at_fn_group_banner 1415 'ovsdb-idl.at:365' \ - "self-linking idl, inconsistent ops - C" " " 82 -at_xfail=no -( - $as_echo "1415. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"uuid\", \"cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"uuid-name\": \"one\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"one\"]}}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"one\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"c2fca39a-e69a-42a4-9c56-5eca85839ce9\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#1#\"]]]}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#2#\"]]]}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:365" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \ - '+["idltest", - {"op": "insert", - "table": "link1", - "uuid-name": "one", - "row": {"i": 1, "k": ["named-uuid", "one"]}}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \ - '["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: sort stdout | \${PERL} \$srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/'" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:365" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"details\":\"Table link1 column k row <0> references nonexistent row <1> in table link1.\",\"error\":\"referential integrity violation\"}]} -002: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -003: i=1 k=1 ka=[] l2= uuid=<2> -003: i=2 k=1 ka=[] l2= uuid=<3> -004: {\"error\":null,\"result\":[{\"count\":2},{\"details\":\"Table link1 column k row references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"cannot delete link1 row <2> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":1}]} -007: i=1 k=1 ka=[] l2= uuid=<2> -008: {\"error\":null,\"result\":[{\"count\":1}]} -009: empty -010: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1415 -#AT_START_1416 -at_fn_group_banner 1416 'ovsdb-idl.at:365' \ - "self-linking idl, inconsistent ops - Python" " " 82 -at_xfail=no -( - $as_echo "1416. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:365" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:365" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"uuid\", \"cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"uuid-name\": \"one\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"one\"]}}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"one\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"c2fca39a-e69a-42a4-9c56-5eca85839ce9\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#1#\"]]]}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#2#\"]]]}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:365" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \ - '+["idltest", - {"op": "insert", - "table": "link1", - "uuid-name": "one", - "row": {"i": 1, "k": ["named-uuid", "one"]}}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \ - '["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: sort stdout | \${PERL} \$srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/'" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:365" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"details\":\"Table link1 column k row <0> references nonexistent row <1> in table link1.\",\"error\":\"referential integrity violation\"}]} -002: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -003: i=1 k=1 ka=[] l2= uuid=<2> -003: i=2 k=1 ka=[] l2= uuid=<3> -004: {\"error\":null,\"result\":[{\"count\":2},{\"details\":\"Table link1 column k row references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"cannot delete link1 row <2> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":1}]} -007: i=1 k=1 ka=[] l2= uuid=<2> -008: {\"error\":null,\"result\":[{\"count\":1}]} -009: empty -010: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1416 -#AT_START_1417 -at_fn_group_banner 1417 'ovsdb-idl.at:365' \ - "self-linking idl, inconsistent ops - Python tcp" "" 82 -at_xfail=no -( - $as_echo "1417. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:365" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:365" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"uuid\", \"cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"uuid-name\": \"one\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"one\"]}}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"one\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"c2fca39a-e69a-42a4-9c56-5eca85839ce9\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#1#\"]]]}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#2#\"]]]}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:365" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \ - '+["idltest", - {"op": "insert", - "table": "link1", - "uuid-name": "one", - "row": {"i": 1, "k": ["named-uuid", "one"]}}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \ - '["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: sort stdout | \${PERL} \$srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/'" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:365" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"details\":\"Table link1 column k row <0> references nonexistent row <1> in table link1.\",\"error\":\"referential integrity violation\"}]} -002: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -003: i=1 k=1 ka=[] l2= uuid=<2> -003: i=2 k=1 ka=[] l2= uuid=<3> -004: {\"error\":null,\"result\":[{\"count\":2},{\"details\":\"Table link1 column k row references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"cannot delete link1 row <2> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":1}]} -007: i=1 k=1 ka=[] l2= uuid=<2> -008: {\"error\":null,\"result\":[{\"count\":1}]} -009: empty -010: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1417 -#AT_START_1418 -at_fn_group_banner 1418 'ovsdb-idl.at:365' \ - "self-linking idl, inconsistent ops - Python tcp6" "" 82 -at_xfail=no -( - $as_echo "1418. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:365" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:365" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"uuid\", \"cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"uuid-name\": \"one\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"one\"]}}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"one\"]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"k\": [\"uuid\", \"c2fca39a-e69a-42a4-9c56-5eca85839ce9\"]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#1#\"]]]}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": [[\"_uuid\", \"==\", [\"uuid\", \"#2#\"]]]}]' \\ - '[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]' \\ -" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:365" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \ - '+["idltest", - {"op": "insert", - "table": "link1", - "uuid-name": "one", - "row": {"i": 1, "k": ["named-uuid", "one"]}}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \ - '["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' \ - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: sort stdout | \${PERL} \$srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/'" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:365" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl| sed -e '/004:/s/row <[23]> references/row references/' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"details\":\"Table link1 column k row <0> references nonexistent row <1> in table link1.\",\"error\":\"referential integrity violation\"}]} -002: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -003: i=1 k=1 ka=[] l2= uuid=<2> -003: i=2 k=1 ka=[] l2= uuid=<3> -004: {\"error\":null,\"result\":[{\"count\":2},{\"details\":\"Table link1 column k row references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"cannot delete link1 row <2> because of 1 remaining reference(s)\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":1}]} -007: i=1 k=1 ka=[] l2= uuid=<2> -008: {\"error\":null,\"result\":[{\"count\":1}]} -009: empty -010: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:365: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:365" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:365" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1418 -#AT_START_1419 -at_fn_group_banner 1419 'ovsdb-idl.at:413' \ - "self-linking idl, sets - C" " " 82 -at_xfail=no -( - $as_echo "1419. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i0\"]]]}, - \"uuid-name\": \"i0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i1\"]]]}, - \"uuid-name\": \"i1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i2\"]]]}, - \"uuid-name\": \"i2\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 3, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i3\"]]]}, - \"uuid-name\": \"i3\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"#1#\"], [\"uuid\", \"#2#\"], [\"uuid\", \"#3#\"]]]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 2]], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"88702e78-845b-4a6e-ad08-cf68922ae84a\"], [\"uuid\", \"#2#\"]]]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:413" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]}, - "uuid-name": "i0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]}, - "uuid-name": "i1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]}, - "uuid-name": "i2"}, - {"op": "insert", - "table": "link1", - "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]}, - "uuid-name": "i3"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 2]], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:413" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -002: i=0 k=0 ka=[0] l2= uuid=<0> -002: i=1 k=0 ka=[1] l2= uuid=<1> -002: i=2 k=0 ka=[2] l2= uuid=<2> -002: i=3 k=0 ka=[3] l2= uuid=<3> -003: {\"error\":null,\"result\":[{\"count\":4}]} -004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0> -004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1> -004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2> -004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3> -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"Table link1 column ka row <2> references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":4}]} -007: empty -008: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1419 -#AT_START_1420 -at_fn_group_banner 1420 'ovsdb-idl.at:413' \ - "self-linking idl, sets - Python" " " 82 -at_xfail=no -( - $as_echo "1420. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:413" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:413" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i0\"]]]}, - \"uuid-name\": \"i0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i1\"]]]}, - \"uuid-name\": \"i1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i2\"]]]}, - \"uuid-name\": \"i2\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 3, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i3\"]]]}, - \"uuid-name\": \"i3\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"#1#\"], [\"uuid\", \"#2#\"], [\"uuid\", \"#3#\"]]]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 2]], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"88702e78-845b-4a6e-ad08-cf68922ae84a\"], [\"uuid\", \"#2#\"]]]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:413" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]}, - "uuid-name": "i0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]}, - "uuid-name": "i1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]}, - "uuid-name": "i2"}, - {"op": "insert", - "table": "link1", - "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]}, - "uuid-name": "i3"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 2]], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:413" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -002: i=0 k=0 ka=[0] l2= uuid=<0> -002: i=1 k=0 ka=[1] l2= uuid=<1> -002: i=2 k=0 ka=[2] l2= uuid=<2> -002: i=3 k=0 ka=[3] l2= uuid=<3> -003: {\"error\":null,\"result\":[{\"count\":4}]} -004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0> -004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1> -004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2> -004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3> -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"Table link1 column ka row <2> references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":4}]} -007: empty -008: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1420 -#AT_START_1421 -at_fn_group_banner 1421 'ovsdb-idl.at:413' \ - "self-linking idl, sets - Python tcp" " " 82 -at_xfail=no -( - $as_echo "1421. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:413" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:413" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i0\"]]]}, - \"uuid-name\": \"i0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i1\"]]]}, - \"uuid-name\": \"i1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i2\"]]]}, - \"uuid-name\": \"i2\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 3, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i3\"]]]}, - \"uuid-name\": \"i3\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"#1#\"], [\"uuid\", \"#2#\"], [\"uuid\", \"#3#\"]]]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 2]], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"88702e78-845b-4a6e-ad08-cf68922ae84a\"], [\"uuid\", \"#2#\"]]]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:413" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]}, - "uuid-name": "i0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]}, - "uuid-name": "i1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]}, - "uuid-name": "i2"}, - {"op": "insert", - "table": "link1", - "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]}, - "uuid-name": "i3"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 2]], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:413" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -002: i=0 k=0 ka=[0] l2= uuid=<0> -002: i=1 k=0 ka=[1] l2= uuid=<1> -002: i=2 k=0 ka=[2] l2= uuid=<2> -002: i=3 k=0 ka=[3] l2= uuid=<3> -003: {\"error\":null,\"result\":[{\"count\":4}]} -004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0> -004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1> -004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2> -004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3> -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"Table link1 column ka row <2> references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":4}]} -007: empty -008: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1421 -#AT_START_1422 -at_fn_group_banner 1422 'ovsdb-idl.at:413' \ - "self-linking idl, sets - Python tcp6" " " 82 -at_xfail=no -( - $as_echo "1422. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:413" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:413" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 0, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i0\"]]]}, - \"uuid-name\": \"i0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i1\"]]]}, - \"uuid-name\": \"i1\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 2, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i2\"]]]}, - \"uuid-name\": \"i2\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 3, \"k\": [\"named-uuid\", \"i0\"], \"ka\": [\"set\", [[\"named-uuid\", \"i3\"]]]}, - \"uuid-name\": \"i3\"}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"#1#\"], [\"uuid\", \"#2#\"], [\"uuid\", \"#3#\"]]]}}]' \\ - '[\"idltest\", - {\"op\": \"update\", - \"table\": \"link1\", - \"where\": [[\"i\", \"==\", 2]], - \"row\": {\"ka\": [\"set\", [[\"uuid\", \"#0#\"], [\"uuid\", \"88702e78-845b-4a6e-ad08-cf68922ae84a\"], [\"uuid\", \"#2#\"]]]}}]' \\ - '+[\"idltest\", - {\"op\": \"delete\", - \"table\": \"link1\", - \"where\": []}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:413" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link1", - "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]}, - "uuid-name": "i0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]}, - "uuid-name": "i1"}, - {"op": "insert", - "table": "link1", - "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]}, - "uuid-name": "i2"}, - {"op": "insert", - "table": "link1", - "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]}, - "uuid-name": "i3"}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \ - '["idltest", - {"op": "update", - "table": "link1", - "where": [["i", "==", 2]], - "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \ - '+["idltest", - {"op": "delete", - "table": "link1", - "where": []}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:413" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]},{\"uuid\":[\"uuid\",\"<2>\"]},{\"uuid\":[\"uuid\",\"<3>\"]}]} -002: i=0 k=0 ka=[0] l2= uuid=<0> -002: i=1 k=0 ka=[1] l2= uuid=<1> -002: i=2 k=0 ka=[2] l2= uuid=<2> -002: i=3 k=0 ka=[3] l2= uuid=<3> -003: {\"error\":null,\"result\":[{\"count\":4}]} -004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0> -004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1> -004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2> -004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3> -005: {\"error\":null,\"result\":[{\"count\":1},{\"details\":\"Table link1 column ka row <2> references nonexistent row <4> in table link1.\",\"error\":\"referential integrity violation\"}]} -006: {\"error\":null,\"result\":[{\"count\":4}]} -007: empty -008: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1422 -#AT_START_1423 -at_fn_group_banner 1423 'ovsdb-idl.at:463' \ - "external-linking idl, consistent ops - C" " " 82 -at_xfail=no -( - $as_echo "1423. $at_setup_line: testing $at_desc ..." - $at_traceon - - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link2\", - \"row\": {\"i\": 0}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row1\"], \"l2\": [\"set\", [[\"named-uuid\", \"row0\"]]]}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:463" -( $at_check_trace; test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket '["idltest", - {"op": "insert", - "table": "link2", - "row": {"i": 0}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:463" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 l1= uuid=<0> -002: i=1 k=1 ka=[] l2=0 uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1423 -#AT_START_1424 -at_fn_group_banner 1424 'ovsdb-idl.at:463' \ - "external-linking idl, consistent ops - Python" " " 82 -at_xfail=no -( - $as_echo "1424. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:463" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:463" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link2\", - \"row\": {\"i\": 0}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row1\"], \"l2\": [\"set\", [[\"named-uuid\", \"row0\"]]]}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:463" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket '["idltest", - {"op": "insert", - "table": "link2", - "row": {"i": 0}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:463" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 l1= uuid=<0> -002: i=1 k=1 ka=[] l2=0 uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1424 -#AT_START_1425 -at_fn_group_banner 1425 'ovsdb-idl.at:463' \ - "external-linking idl, consistent ops - Python tcp" "" 82 -at_xfail=no -( - $as_echo "1425. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:463" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:463" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:127.0.0.1:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link2\", - \"row\": {\"i\": 0}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row1\"], \"l2\": [\"set\", [[\"named-uuid\", \"row0\"]]]}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:463" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link2", - "row": {"i": 0}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:463" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 l1= uuid=<0> -002: i=1 k=1 ka=[] l2=0 uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1425 -#AT_START_1426 -at_fn_group_banner 1426 'ovsdb-idl.at:463' \ - "external-linking idl, consistent ops - Python tcp6" "" 82 -at_xfail=no -( - $as_echo "1426. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:463" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:463" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=ptcp:0:[::1] --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[::1] --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - TCP_PORT=`parse_listening_port < ovsdb-server.log` - echo "TCP_PORT=$TCP_PORT" - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema tcp:[::1]:\$TCP_PORT '[\"idltest\", - {\"op\": \"insert\", - \"table\": \"link2\", - \"row\": {\"i\": 0}, - \"uuid-name\": \"row0\"}, - {\"op\": \"insert\", - \"table\": \"link1\", - \"row\": {\"i\": 1, \"k\": [\"named-uuid\", \"row1\"], \"l2\": [\"set\", [[\"named-uuid\", \"row0\"]]]}, - \"uuid-name\": \"row1\"}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovsdb-idl.at:463" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[::1]:$TCP_PORT '["idltest", - {"op": "insert", - "table": "link2", - "row": {"i": 0}, - "uuid-name": "row0"}, - {"op": "insert", - "table": "link1", - "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]}, - "uuid-name": "row1"}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:463" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: {\"error\":null,\"result\":[{\"uuid\":[\"uuid\",\"<0>\"]},{\"uuid\":[\"uuid\",\"<1>\"]}]} -002: i=0 l1= uuid=<0> -002: i=1 k=1 ka=[] l2=0 uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:463: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:463" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:463" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1426 -#AT_START_1427 -at_fn_group_banner 1427 'ovsdb-idl.at:481' \ - "external-linking idl, insert ops - Python" " " 82 -at_xfail=no -( - $as_echo "1427. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:481" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:481" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:481: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:481" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:481" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:481: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:481" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:481" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:481: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket 'linktest'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'linktest'" "ovsdb-idl.at:481" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'linktest' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:481" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:481: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:481" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: commit, status=success -002: i=1 k=1 ka=[1] l2= uuid=<0> -002: i=2 k=1 ka=[1 2] l2= uuid=<1> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:481" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:481: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:481" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:481" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:481: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:481" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:481" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1427 -#AT_START_1428 -at_fn_group_banner 1428 'ovsdb-idl.at:491' \ - "getattr idl, insert ops - Python" " " 82 -at_xfail=no -( - $as_echo "1428. $at_setup_line: testing $at_desc ..." - $at_traceon - - $as_echo "ovsdb-idl.at:491" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovsdb-idl.at:491" - - OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:491: ovsdb-tool create db \$abs_srcdir/idltest.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_srcdir/idltest.ovsschema" "ovsdb-idl.at:491" -( $at_check_trace; ovsdb-tool create db $abs_srcdir/idltest.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:491" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:491: ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:491" -( $at_check_trace; ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:491" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:491: \$PYTHON \$srcdir/test-ovsdb.py -t10 idl \$srcdir/idltest.ovsschema unix:socket 'getattrtest'" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'getattrtest'" "ovsdb-idl.at:491" -( $at_check_trace; $PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket 'getattrtest' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:491" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:491: sort stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovsdb-idl.at:491" -( $at_check_trace; sort stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "000: empty -001: commit, status=success -002: i=2 k=2 ka=[] l2= uuid=<0> -003: done -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:491" -if $at_failed; then : - kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:491: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:491" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:491" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovsdb-idl.at:491: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovsdb-idl.at:491" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovsdb-idl.at:491" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1428 -#AT_START_1429 -at_fn_group_banner 1429 'ovs-vsctl.at:145' \ - "ovs-vsctl connection retry" " " 83 -at_xfail=no -( - $as_echo "1429. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=$PWD; export OVS_RUNDIR - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:149: ovs-vsctl --db=unix:foo --timeout=10 -vreconnect:emer -- init" -at_fn_check_prepare_trace "ovs-vsctl.at:149" -( $at_check_trace; ovs-vsctl --db=unix:foo --timeout=10 -vreconnect:emer -- init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:149" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:151: sed 's/([^()]*)/(...reason...)/' stderr" -at_fn_check_prepare_trace "ovs-vsctl.at:151" -( $at_check_trace; sed 's/([^()]*)/(...reason...)/' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ovs-vsctl: unix:foo: database connection failed (...reason...) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:151" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:156: ovs-vsctl --db=unix:foo --timeout=1 --retry -vreconnect:emer -vPATTERN:console:'%c|%p|%m' -- init - echo \$? > status" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:156" -( $at_check_trace; ovs-vsctl --db=unix:foo --timeout=1 --retry -vreconnect:emer -vPATTERN:console:'%c|%p|%m' -- init - echo $? > status -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:160: grep -c 'terminating with signal' stderr" -at_fn_check_prepare_trace "ovs-vsctl.at:160" -( $at_check_trace; grep -c 'terminating with signal' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:160" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:162: kill -l \`cat status\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:162" -( $at_check_trace; kill -l `cat status` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ALRM -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:162" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:166: ovs-vsctl --db=punix:foo --timeout=1 -vreconnect:emer -vPATTERN:console:'%c|%p|%m' -- init - echo \$? > status" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:166" -( $at_check_trace; ovs-vsctl --db=punix:foo --timeout=1 -vreconnect:emer -vPATTERN:console:'%c|%p|%m' -- init - echo $? > status -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:166" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:170: grep -c 'terminating with signal' stderr" -at_fn_check_prepare_trace "ovs-vsctl.at:170" -( $at_check_trace; grep -c 'terminating with signal' stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:170" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:172: kill -l \`cat status\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:172" -( $at_check_trace; kill -l `cat status` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ALRM -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:172" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1429 -#AT_START_1430 -at_fn_group_banner 1430 'ovs-vsctl.at:179' \ - "add-br a" " " 84 -at_xfail=no -( - $as_echo "1430. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:181: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:181" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:181" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:181: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:181" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:181" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:181: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:181" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:181" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:182: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:182" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:182" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:182: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:182" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:182: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:182" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:182" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:183" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:184" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:184" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:184" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:184" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:184" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:184" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:184" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:184" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:184" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:184: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:184" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:184" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:185: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:185" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:185" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:185: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:185" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:185: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:185" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:185" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:185: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:185" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:185" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:185: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:185" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:185" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:185: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:185" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:185" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:186: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:186" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:186" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:186: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:186" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:186" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1430 -#AT_START_1431 -at_fn_group_banner 1431 'ovs-vsctl.at:189' \ - "add-br a, add-br a" " " 84 -at_xfail=no -( - $as_echo "1431. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:191: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:191" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:191" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:191: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:191" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:191" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:191: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:191" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:191" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:192: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:192" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:192" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:192: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:192" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:192" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:192: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:192" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:192" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:193: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:193" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot create a bridge named a because a bridge named a already exists -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:193" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:193: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:193" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:193" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:193: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:193" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:193" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:196: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:196" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:196" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:196: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:196" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:196" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1431 -#AT_START_1432 -at_fn_group_banner 1432 'ovs-vsctl.at:199' \ - "add-br a, add-br b" " " 84 -at_xfail=no -( - $as_echo "1432. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:201: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:201" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:201: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:201" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:201: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:201" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:202: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:202" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:202" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:202: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:202" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:202" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:202: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:202" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:202" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:204: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br a b 9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:204" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br a b 9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-br a b 9\" but a is not a VLAN bridge -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:204" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:204: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:204" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:204" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:204: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:204" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:204" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a\\nb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b" -at_fn_check_prepare_trace "ovs-vsctl.at:208" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:209" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:209" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:209" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:209" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:209" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:209" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:209" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:209" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:209" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:209: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:209" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:209" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:210: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:210" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:210" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:210: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:210" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:210" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:210: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:210" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:210" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:210: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:210" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:210" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:210: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:210" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:210" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:210: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:210" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:210" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:211" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:211" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:211" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:211" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:211" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:211" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:211" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:211" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:211" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:211: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:211" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:211" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:212: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:212" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:212" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:212: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:212" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:212" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:212: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:212" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:212" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:212: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:212" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:212" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:212: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:212" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:212" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:212: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:212" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:212" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:213: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:213" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:213" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:213: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:213" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:213" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1432 -#AT_START_1433 -at_fn_group_banner 1433 'ovs-vsctl.at:216' \ - "add-br a, add-br b, del-br a" " " 84 -at_xfail=no -( - $as_echo "1433. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:218: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:218" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:218: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:218" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:218: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:218" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:218" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:219: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br b -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:219" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br b -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:219" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:219: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:219" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:219" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:219: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:219" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:219" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b" -at_fn_check_prepare_trace "ovs-vsctl.at:221" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:221: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:221" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:221" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:222" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:222" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:222" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:222" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:222" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:222" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:222" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:222" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:222" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:222: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:222" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:222" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:223: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:223" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:223" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:223: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:223" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:223" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:223: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:223" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:223" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:223: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:223" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:223" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:223: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:223" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:223" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:223: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:223" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:223" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:224: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:224" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:224" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:224: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:224" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:224" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1433 -#AT_START_1434 -at_fn_group_banner 1434 'ovs-vsctl.at:227' \ - "add-br a, del-br a, add-br a" " " 84 -at_xfail=no -( - $as_echo "1434. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:229: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:229" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:229" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:229: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:229" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:229" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:229: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:229" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:229" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:230: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -- del-br a -- add-br a -- set Interface a other_config:key=value -- get Interface a other_config:key" -at_fn_check_prepare_trace "ovs-vsctl.at:230" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -- del-br a -- add-br a -- set Interface a other_config:key=value -- get Interface a other_config:key -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - - -value -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:230" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:230: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:230" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:230" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:230: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:230" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:230" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:241" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:242" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:242" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:242" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:242" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:242" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:242" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:242" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:242" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:242" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:242: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:242" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:242" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:243: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:243" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:243" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:243: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:243" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:243" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:243: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:243" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:243" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:243: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:243" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:243" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:243: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:243" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:243" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:243: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:243" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:243" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:244: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:244" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:244" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:244: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:244" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:244" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1434 -#AT_START_1435 -at_fn_group_banner 1435 'ovs-vsctl.at:247' \ - "add-br a, add-port a a1, add-port a a2" " " 84 -at_xfail=no -( - $as_echo "1435. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:249: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:249" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:249" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:249: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:249" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:249" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:249: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:249" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:249" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:250: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists del-br b -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:250" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists del-br b -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:250" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:250: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:250" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:250" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:250: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:250" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:250" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:255" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:255: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:255" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:255" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:256" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -a2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:256" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1\\na2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:256" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:256" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:256" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:256: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:256" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:256" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:257" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -a2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:257" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:257" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:257" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:258: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:258" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:258" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:258: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:258" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:258" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1435 -#AT_START_1436 -at_fn_group_banner 1436 'ovs-vsctl.at:261' \ - "add-br a, add-port a a1, add-port a a1" " " 84 -at_xfail=no -( - $as_echo "1436. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:263: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:263" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:263: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:263" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:263: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:263" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:264: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:264" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:264" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:264: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:264" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:264" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:264: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:264" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:264" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:267: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:267" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot create a port named a1 because a port named a1 already exists on bridge a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:267" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:267: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:267" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:267" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:267: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:267" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:267" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:270: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:270" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:270" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:270: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:270" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:270" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1436 -#AT_START_1437 -at_fn_group_banner 1437 'ovs-vsctl.at:273' \ - "add-br a b, add-port a a1, add-port b b1, del-br a" "" 84 -at_xfail=no -( - $as_echo "1437. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:275: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:275" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:275" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:275: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:275" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:275" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:275: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:275" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:275" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:276: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -- add-br b -- add-port a a1 -- add-port b b1 -- --if-exists del-port b b2 -- del-br a" -at_fn_check_prepare_trace "ovs-vsctl.at:276" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -- add-br b -- add-port a a1 -- add-port b b1 -- --if-exists del-port b b2 -- del-br a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - - - - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:276" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:276: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:276" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:276" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:276: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:276" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:276" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b" -at_fn_check_prepare_trace "ovs-vsctl.at:289" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:289: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:289" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:289" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:290" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:290" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:290" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:290" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:290: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:290" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:290" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:291" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:291" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:291" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:291" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:291" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:291" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:291" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:291" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:291" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:291: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:291" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:291" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:292: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:292" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:292" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:292: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:292" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:292" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1437 -#AT_START_1438 -at_fn_group_banner 1438 'ovs-vsctl.at:295' \ - "add-br a, add-bond a bond0 a1 a2 a3" " " 84 -at_xfail=no -( - $as_echo "1438. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:297: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:297" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:297" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:297: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:297" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:297" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:297: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:297" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:297" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:298: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond a bond0 a1 a2 a3 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:298" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond a bond0 a1 a2 a3 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:298" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:298: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:298" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:298" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:298: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:298" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:298" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:301: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-bond a bond0 a3 a1 a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:301" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-bond a bond0 a3 a1 a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:301" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:301: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:301" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:301: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:301" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:301" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:303: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-bond a bond0 a2 a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:303" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-bond a bond0 a2 a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-bond a bond0 a2 a1\" but bond0 actually has interface(s) a1, a2, a3 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:303" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:303: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:303" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:303" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:303: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:303" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:303" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:307" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:307: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:307" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:307" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:308" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:308" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:308" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:308" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:308: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:308" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:308" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:309" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -a2 -a3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:309" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:309" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:309" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a3 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:309" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a3 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:309: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:309" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:309" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:310: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:310" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:310" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:310: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:310" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:310" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1438 -#AT_START_1439 -at_fn_group_banner 1439 'ovs-vsctl.at:313' \ - "add-br a b, add-port a a1, add-port b b1, del-port a a1" "" 84 -at_xfail=no -( - $as_echo "1439. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:315: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:315" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:315" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:315: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:315" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:315" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:315: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:315" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:315" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:316: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br b -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 tag=9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get port a1 tag -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port b b1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-port a a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:316" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br b -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 tag=9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get port a1 tag -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port b b1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-port a a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:316" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:316: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:316" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:316" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:316: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:316" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:316" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:324: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port b b1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:324" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port b b1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:324" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:324: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:324" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:324" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:324: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:324" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:324" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:326: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-port a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:326" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-port a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot delete port a because it is the local port for bridge a (deleting this port requires deleting the entire bridge) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:326" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:326: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:326" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:326" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:326: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:326" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:326" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:330: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists del-port a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:330" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists del-port a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:330" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:330: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:330" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:330" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:330: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:330" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:330" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:332: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port a b1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:332" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port a b1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-port a b1\" but b1 is actually attached to bridge b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:332" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:332: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:332" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:332" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:332: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:332" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:332" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a\\nb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b" -at_fn_check_prepare_trace "ovs-vsctl.at:336" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent b -- br-to-vlan b -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:337" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:337" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:337" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:337" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:337" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:337" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:337" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:337" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:337" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:337: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:337" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:337" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:338: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:338" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:338" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:338: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:338" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:338: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:338" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:338" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:338: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:338" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:338" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:338: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:338" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:338: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:338" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:338" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:339" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:339" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:339" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:339" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br b1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:339: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:339" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:339" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:340" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:340" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:340" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:340" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named b -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:340" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:340" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:340" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:340" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br b1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:340" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:340: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:340" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:340" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:341: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:341" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:341" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:341: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:341" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:341" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1439 -#AT_START_1440 -at_fn_group_banner 1440 'ovs-vsctl.at:344' \ - "add-br a, add-bond a bond0 a1 a2 a3, del-port bond0" "" 84 -at_xfail=no -( - $as_echo "1440. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:346: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:346" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:346" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:346: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:346" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:346" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:346: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:346" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:346" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:347: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -- add-bond a bond0 a1 a2 a3 tag=9 -- get Port bond0 tag -- del-port bond0" -at_fn_check_prepare_trace "ovs-vsctl.at:347" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -- add-bond a bond0 a1 a2 a3 tag=9 -- get Port bond0 tag -- del-port bond0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - -9 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:347" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:347: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:347" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:347" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:347: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:347" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:347" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:356" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:356: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:356" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:356" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:357" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:357" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:357" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:357" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:357" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:357" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:357" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:357" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:357" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:357: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:357" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:357" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:358: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:358" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:358" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:358: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:358" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:358" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1440 -#AT_START_1441 -at_fn_group_banner 1441 'ovs-vsctl.at:361' \ - "external IDs" " " 84 -at_xfail=no -( - $as_echo "1441. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:363: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:363" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:363" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:363: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:363" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:363" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:363: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:363" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:363" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:364: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-port a a1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-bond a bond0 a2 a3 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id a key0 value0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set port a1 external-ids:key1=value1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set interface a2 external-ids:key2=value2 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set interface a2 external-ids:key3=value3 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set interface a3 external-ids:key4=value4 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a key0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a key1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id a key0 othervalue -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id a key0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get port a1 external-ids -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get interface a2 external-ids -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get interface a3 external-ids -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:364" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-port a a1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-bond a bond0 a2 a3 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id a key0 value0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set port a1 external-ids:key1=value1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set interface a2 external-ids:key2=value2 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set interface a2 external-ids:key3=value3 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set interface a3 external-ids:key4=value4 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a key0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a key1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id a key0 othervalue -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id a key0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get port a1 external-ids -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get interface a2 external-ids -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get interface a3 external-ids - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - - - - - - -key0=value0 -value0 - - -key0=othervalue - - -{\"key1\"=\"value1\"} -{\"key2\"=\"value2\", \"key3\"=\"value3\"} -{\"key4\"=\"value4\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:364" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:364: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:364" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:364" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:364: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:364" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:364" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:401: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -- get port a1 external-ids -- get interface a2 external-ids -- get interface a3 external-ids" -at_fn_check_prepare_trace "ovs-vsctl.at:401" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-get-external-id a -- get port a1 external-ids -- get interface a2 external-ids -- get interface a3 external-ids -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -{\"key1\"=\"value1\"} -{\"key2\"=\"value2\", \"key3\"=\"value3\"} -{\"key4\"=\"value4\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:401" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:401: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:401" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:401" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:401: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:401" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:401" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:411" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:411: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:411" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:411" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:412" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -bond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:412" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1\\nbond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:412" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:412" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:412" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:412: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:412" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:412" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:413" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -a2 -a3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:413" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:413" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:413" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a3 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:413" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a3 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:413: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:413" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:413" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:414: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:414" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:414" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:414: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:414" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:414" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1441 -#AT_START_1442 -at_fn_group_banner 1442 'ovs-vsctl.at:417' \ - "controllers" " " 84 -at_xfail=no -( - $as_echo "1442. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:419: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:419" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:419" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:419: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:419" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:419" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:419: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:419" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:419" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:420: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br br0 -- get-controller br0 -- set-controller br0 tcp:4.5.6.7 -- get-controller br0 -- del-controller br0 -- get-controller br0 -- set-controller br0 tcp:8.9.10.11 tcp:5.4.3.2 -- get-controller br0" -at_fn_check_prepare_trace "ovs-vsctl.at:420" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br br0 -- get-controller br0 -- set-controller br0 tcp:4.5.6.7 -- get-controller br0 -- del-controller br0 -- get-controller br0 -- set-controller br0 tcp:8.9.10.11 tcp:5.4.3.2 -- get-controller br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - -tcp:4.5.6.7 - - - -tcp:5.4.3.2\\ntcp:8.9.10.11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:420" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:420: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:420" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:420" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:420: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:420" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:420" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:440: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:440" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:440" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:440: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:440" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:440" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1442 -#AT_START_1443 -at_fn_group_banner 1443 'ovs-vsctl.at:544' \ - "simple fake bridge (VLAN 9)" " " 85 -at_xfail=no -( - $as_echo "1443. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-br xapi1\" but xapi1 is a VLAN bridge for VLAN 9 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xxx 9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xxx 9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-br xapi1 xxx 9\" but xapi1 has the wrong parent xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 10 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 10 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-br xapi1 xenbr0 10\" but xapi1 is a VLAN bridge for the wrong VLAN 9 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1\\nxenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1" -at_fn_check_prepare_trace "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0" -at_fn_check_prepare_trace "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1443 -#AT_START_1444 -at_fn_group_banner 1444 'ovs-vsctl.at:544' \ - "list bridges -- real and fake (VLAN 9)" " " 85 -at_xfail=no -( - $as_echo "1444. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1\\nxenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --real list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --real list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --fake list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --fake list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1444 -#AT_START_1445 -at_fn_group_banner 1445 'ovs-vsctl.at:544' \ - "simple fake bridge + del-br fake bridge (VLAN 9)" "" 85 -at_xfail=no -( - $as_echo "1445. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0" -at_fn_check_prepare_trace "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1445 -#AT_START_1446 -at_fn_group_banner 1446 'ovs-vsctl.at:544' \ - "simple fake bridge + del-br real bridge (VLAN 9)" "" 85 -at_xfail=no -( - $as_echo "1446. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1446 -#AT_START_1447 -at_fn_group_banner 1447 'ovs-vsctl.at:544' \ - "simple fake bridge + external IDs (VLAN 9)" " " 85 -at_xfail=no -( - $as_echo "1447. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 9 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id xenbr0 key0 value0 -- br-set-external-id xapi1 key1 value1 -- br-get-external-id xenbr0 -- br-get-external-id xenbr0 key0 -- br-get-external-id xapi1 -- br-get-external-id xapi1 key1" -at_fn_check_prepare_trace "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id xenbr0 key0 value0 -- br-set-external-id xapi1 key1 value1 -- br-get-external-id xenbr0 -- br-get-external-id xenbr0 key0 -- br-get-external-id xapi1 -- br-get-external-id xapi1 key1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - -key0=value0 -value0 -key1=value1 -value1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1\\nxenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1" -at_fn_check_prepare_trace "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0" -at_fn_check_prepare_trace "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.9 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.9 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:544" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.9 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:544: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:544" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:544" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1447 -#AT_START_1448 -at_fn_group_banner 1448 'ovs-vsctl.at:545' \ - "simple fake bridge (VLAN 0)" " " 86 -at_xfail=no -( - $as_echo "1448. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-br xapi1\" but xapi1 is a VLAN bridge for VLAN 0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xxx 0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xxx 0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-br xapi1 xxx 0\" but xapi1 has the wrong parent xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 10 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 10 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"--may-exist add-br xapi1 xenbr0 10\" but xapi1 is a VLAN bridge for the wrong VLAN 0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1\\nxenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1" -at_fn_check_prepare_trace "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0" -at_fn_check_prepare_trace "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1448 -#AT_START_1449 -at_fn_group_banner 1449 'ovs-vsctl.at:545' \ - "list bridges -- real and fake (VLAN 0)" " " 86 -at_xfail=no -( - $as_echo "1449. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1\\nxenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --real list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --real list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --fake list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- -- --fake list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1449 -#AT_START_1450 -at_fn_group_banner 1450 'ovs-vsctl.at:545' \ - "simple fake bridge + del-br fake bridge (VLAN 0)" "" 86 -at_xfail=no -( - $as_echo "1450. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0" -at_fn_check_prepare_trace "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1450 -#AT_START_1451 -at_fn_group_banner 1451 'ovs-vsctl.at:545' \ - "simple fake bridge + del-br real bridge (VLAN 0)" "" 86 -at_xfail=no -( - $as_echo "1451. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1451 -#AT_START_1452 -at_fn_group_banner 1452 'ovs-vsctl.at:545' \ - "simple fake bridge + external IDs (VLAN 0)" " " 86 -at_xfail=no -( - $as_echo "1452. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xenbr0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-port xenbr0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --may-exist add-br xapi1 xenbr0 0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi1 eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id xenbr0 key0 value0 -- br-set-external-id xapi1 key1 value1 -- br-get-external-id xenbr0 -- br-get-external-id xenbr0 key0 -- br-get-external-id xapi1 -- br-get-external-id xapi1 key1" -at_fn_check_prepare_trace "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-set-external-id xenbr0 key0 value0 -- br-set-external-id xapi1 key1 value1 -- br-get-external-id xenbr0 -- br-get-external-id xenbr0 key0 -- br-get-external-id xapi1 -- br-get-external-id xapi1 key1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - -key0=value0 -value0 -key1=value1 -value1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1\\nxenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1" -at_fn_check_prepare_trace "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0" -at_fn_check_prepare_trace "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xenbr0 -- br-to-vlan xenbr0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xenbr0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xenbr0 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xenbr0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0.0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:545" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0.0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:545: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:545" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:545" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1452 -#AT_START_1453 -at_fn_group_banner 1453 'ovs-vsctl.at:557' \ - "fake bridge on bond" " " 86 -at_xfail=no -( - $as_echo "1453. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:559: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:559" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:559" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:559: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:559" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:559" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:559: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:559" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:559" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:560: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond xapi1 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi2 xapi1 11 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi2 bond0.11 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:560" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond xapi1 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi2 xapi1 11 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi2 bond0.11 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:560" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:560: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:560" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:560" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:560: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:560" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:560" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -xapi2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1\\nxapi2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1" -at_fn_check_prepare_trace "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi2 -- br-to-vlan xapi2" -at_fn_check_prepare_trace "ovs-vsctl.at:561" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi2 -- br-to-vlan xapi2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:561: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:561" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:561" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:562" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:562" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:562" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:562" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:562: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:562" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:562" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:563" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -eth1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:563" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:563" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:563" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:563: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:563" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:563" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:564" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0.11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:564" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0.11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:564" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xapi2 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0.11 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:564" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0.11 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:564: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:564" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:564" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:565" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0.11 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:565" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:565" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:565" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xapi2 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:565" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:565" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:565" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br bond0.11 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:565" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br bond0.11 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:565" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:565: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:565" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:565" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:566: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:566" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:566" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:566: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:566" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:566" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1453 -#AT_START_1454 -at_fn_group_banner 1454 'ovs-vsctl.at:569' \ - "fake bridge on bond + del-br fake bridge" " " 86 -at_xfail=no -( - $as_echo "1454. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:571: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:571" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:571" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:571: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:571" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:571" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:571: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:571" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:571" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:572: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond xapi1 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi2 xapi1 11 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi2 bond0.11 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:572" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond xapi1 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi2 xapi1 11 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi2 bond0.11 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:572" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:572: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:572" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:572" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:572: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:572" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:572" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:573: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- del-br xapi2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:573" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- del-br xapi2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:573" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:573: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:573" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:573" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:573: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:573" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:573" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1" -at_fn_check_prepare_trace "ovs-vsctl.at:575" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent xapi1 -- br-to-vlan xapi1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:575: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:575" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:575" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:576" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:576" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "bond0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:576" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:576" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br bond0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:576: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:576" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:576" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:577" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "eth0 -eth1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:577" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named xapi1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:577" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:577" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br eth1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:577: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:577" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:577" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:578: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:578" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:578" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:578: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:578" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:578" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1454 -#AT_START_1455 -at_fn_group_banner 1455 'ovs-vsctl.at:581' \ - "fake bridge on bond + del-br real bridge" " " 86 -at_xfail=no -( - $as_echo "1455. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:583: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:583" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:583" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:583: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:583" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:583" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:583: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:583" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:583" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:584: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond xapi1 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi2 xapi1 11 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi2 bond0.11 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:584" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond xapi1 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br xapi2 xapi1 11 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port xapi2 bond0.11 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:584" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:584: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:584" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:584" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:584: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:584" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:584" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:585: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xapi1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:585" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket del-br xapi1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:585" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:586" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:586" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:586" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:586" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:586" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:586" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:586" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:586" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:586" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:586: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:586" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:586" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:587: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:587" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:587" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:587: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:587" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:587" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1455 -#AT_START_1456 -at_fn_group_banner 1456 'ovs-vsctl.at:593' \ - "managers" " " 87 -at_xfail=no -( - $as_echo "1456. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:595: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:595" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:595" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:595: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:595" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:595" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:595: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:595" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:595" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:596: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- del-manager -- get-manager -- set-manager tcp:4.5.6.7 -- get-manager -- set-manager tcp:8.9.10.11 tcp:5.4.3.2 -- get-manager -- del-manager -- get-manager" -at_fn_check_prepare_trace "ovs-vsctl.at:596" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- del-manager -- get-manager -- set-manager tcp:4.5.6.7 -- get-manager -- set-manager tcp:8.9.10.11 tcp:5.4.3.2 -- get-manager -- del-manager -- get-manager -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - -tcp:4.5.6.7 - -tcp:5.4.3.2\\ntcp:8.9.10.11 - - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:596" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:596: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:596" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:596" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:596: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:596" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:596" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:613: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:613" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:613" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:613: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:613" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:613" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1456 -#AT_START_1457 -at_fn_group_banner 1457 'ovs-vsctl.at:619' \ - "database commands -- positive checks" " " 88 -at_xfail=no -( - $as_echo "1457. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:621: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:621" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:621" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:621: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:621" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:621" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:621: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:621" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:621" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:622: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- --id=@br0 create bridge name=br0 -- set o . bridges=@br0" -at_fn_check_prepare_trace "ovs-vsctl.at:622" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- --id=@br0 create bridge name=br0 -- set o . bridges=@br0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:622" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:622: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:622" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:622" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:622: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:622" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:622" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp stdout out1 -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:627: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 _uuid -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:627" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 _uuid - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:627" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:627: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:627" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:627" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:627: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:627" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:627" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp stdout out2 -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:630: \${PERL} \$srcdir/uuidfilt.pl out1 out2" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:630" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl out1 out2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "<0> - -_uuid : <0> -controller : [] -datapath_id : [] -datapath_type : \"\" -external_ids : {} -fail_mode : [] -flood_vlans : [] -flow_tables : {} -ipfix : [] -mirrors : [] -name : \"br0\" -netflow : [] -other_config : {} -ports : [] -protocols : [] -sflow : [] -status : {} -stp_enable : false -<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:630" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:653: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=fail_mode,name,datapath_type list bridge -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:653" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=fail_mode,name,datapath_type list bridge - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "fail_mode : [] -name : \"br0\" -datapath_type : \"\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:653" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:660: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=fail_mode,name,datapath_type find bridge -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:660" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=fail_mode,name,datapath_type find bridge - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "fail_mode : [] -name : \"br0\" -datapath_type : \"\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:660" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:667: - ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- --id=@br1 create bridge name=br1 datapath_type=\"foo\" -- --id=@br2 create bridge name=br2 external-ids:bar=quux -- add o . bridges @br1 @br2" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:667" -( $at_check_trace; - ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- --id=@br1 create bridge name=br1 datapath_type="foo" -- --id=@br2 create bridge name=br2 external-ids:bar=quux -- add o . bridges @br1 @br2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:667" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:667: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:667" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:667" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:667: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:667" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:667" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:672: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=name find bridge datapath_type!=foo -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:672" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=name find bridge datapath_type!=foo - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:672" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:675: sed -n '/./p' stdout | sort" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:675" -( $at_check_trace; sed -n '/./p' stdout | sort -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "name : \"br0\" -name : \"br2\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:675" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:679: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 \\ - 'other_config:datapath_id=\"0123456789ab\"' \\ - 'other_config:hwaddr=\"00:11:22:33:44:55\"' \\ - 'external-ids={\"uuids\"=\"9c45f225-a7cf-439d-976d-83db6271fda1\"}' -- \\ - add bridge br0 external_ids '\"roles\"=\"local; remote; cloud\"' -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:679" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 \ - 'other_config:datapath_id="0123456789ab"' \ - 'other_config:hwaddr="00:11:22:33:44:55"' \ - 'external-ids={"uuids"="9c45f225-a7cf-439d-976d-83db6271fda1"}' -- \ - add bridge br0 external_ids '"roles"="local; remote; cloud"' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:679" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:679: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:679" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:679" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:679: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:679" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:679" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:687: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get bridge br0 other_config external-ids -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:687" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- get bridge br0 other_config external-ids - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{datapath_id=\"0123456789ab\", hwaddr=\"00:11:22:33:44:55\"}\\n{roles=\"local; remote; cloud\", uuids=\"9c45f225-a7cf-439d-976d-83db6271fda1\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:687" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:687: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:687" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:687: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:687" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:687" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:690: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 other_config:hwaddr -- --if-exists get bridge br0 other-config:nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:690" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 other_config:hwaddr -- --if-exists get bridge br0 other-config:nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "\"00:11:22:33:44:55\" - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:690" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:690: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:690" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:690" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:690: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:690" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:690" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:694: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br0 other_config hwaddr 'datapath_id=\"\"' -- get bridge br0 other_config -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:694" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br0 other_config hwaddr 'datapath_id=""' -- get bridge br0 other_config - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{datapath_id=\"0123456789ab\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:694" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:694: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:694" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:694" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:694: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:694" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:694" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:697: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br0 other_config 'datapath_id=\"0123456789ab\"' -- get bridge br0 other_config -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:697" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br0 other_config 'datapath_id="0123456789ab"' -- get bridge br0 other_config - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:697" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:697: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:697" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:697" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:697: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:697" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:697" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:700: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear bridge br0 external-ids -- get bridge br0 external_ids -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:700" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear bridge br0 external-ids -- get bridge br0 external_ids - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:700" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:700: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:700" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:700" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:700: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:700" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:700" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:703: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- destroy bridge br0 -- destroy bridge br1 -- destroy bridge br2 -- clear o . bridges" -at_fn_check_prepare_trace "ovs-vsctl.at:703" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- destroy bridge br0 -- destroy bridge br1 -- destroy bridge br2 -- clear o . bridges -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:703" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:703: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:703" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:703" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:703: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:703" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:703" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:708: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:708" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:708" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:708: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:708" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:708" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:708: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:708" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:708" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:710: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists get bridge x datapath_id -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:710" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists get bridge x datapath_id - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:710" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:710: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:710" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:710" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:710: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:710" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:710" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:712: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists list bridge x -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:712" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists list bridge x - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:712" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:712: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:712" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:712" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:712: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:712" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:712" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:714: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists set controller x connection_mode=standalone -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:714" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists set controller x connection_mode=standalone - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:714" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:714: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:714" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:714" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:714: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:714" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:714" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:716: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists remove netflow x targets '\"1.2.3.4:567\"' -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:716" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists remove netflow x targets '"1.2.3.4:567"' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:716" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:716: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:716" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:716" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:716: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:716" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:716" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:719: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists clear netflow x targets -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:719" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --if-exists clear netflow x targets - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:719" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:719: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:719" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:719" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:719: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:719" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:719" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:722: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:722" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:722" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:722: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:722" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:722" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1457 -#AT_START_1458 -at_fn_group_banner 1458 'ovs-vsctl.at:725' \ - "database commands -- negative checks" " " 88 -at_xfail=no -( - $as_echo "1458. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:727: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:727" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:727" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:727: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:727" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:727" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:727: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:727" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:727" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:729: ovs-vsctl --may-exist" -at_fn_check_prepare_trace "ovs-vsctl.at:729" -( $at_check_trace; ovs-vsctl --may-exist -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: missing command name (use --help for help) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:729" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:729: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:729" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:729" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:729: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:729" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:729" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:732: ovs-vsctl --may-exist --" -at_fn_check_prepare_trace "ovs-vsctl.at:732" -( $at_check_trace; ovs-vsctl --may-exist -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: missing command name (use --help for help) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:732" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:732: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:732" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:732" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:732: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:732" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:732" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:735: ovs-vsctl -- --may-exist" -at_fn_check_prepare_trace "ovs-vsctl.at:735" -( $at_check_trace; ovs-vsctl -- --may-exist -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: missing command name (use --help for help) -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:735" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:735: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:735" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:735" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:735: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:735" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:735" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:739: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:739" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:739" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:739: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:739" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:739" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:739: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:739" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:739" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:741: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:741" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:741" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:741: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:741" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:741" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:741: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:741" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:741" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:743: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set-controller br1 tcp:127.0.0.1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:743" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set-controller br1 tcp:127.0.0.1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:743" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:743: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:743" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:743" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:743: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:743" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:743" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:745: - ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- --id=@n create netflow targets='\"1.2.3.4:567\"' -- set bridge br0 netflow=@n" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:745" -( $at_check_trace; - ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- --id=@n create netflow targets='"1.2.3.4:567"' -- set bridge br0 netflow=@n -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:745" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:745: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:745" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:745" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:745: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:745" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:745" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp stdout netflow-uuid -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:750: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list netflow \`cat netflow-uuid\` -" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:750" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list netflow `cat netflow-uuid` - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:750" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:750: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:750" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:750" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:750: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:750" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:750" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:752: \${PERL} \$srcdir/uuidfilt.pl netflow-uuid stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:752" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl netflow-uuid stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "<0> - -_uuid : <0> -active_timeout : 0 -add_id_to_interface : false -engine_id : [] -engine_type : [] -external_ids : {} -targets : [\"1.2.3.4:567\"] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:752" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:763: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list interx x -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:763" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list interx x - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: unknown table \"interx\" -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:763" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:763: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:763" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:763" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:763: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:763" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:763" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:766: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge x -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:766" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge x - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no row \"x\" in table Bridge -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:766" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:766: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:766" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:766" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:766: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:766" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:766" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:769: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge x datapath_id -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:769" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge x datapath_id - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no row \"x\" in table Bridge -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:769" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:769: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:769" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:769" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:769: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:769" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:769" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:772: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 d -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:772" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 d - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Bridge contains more than one column whose name matches \"d\" -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:772" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:772: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:772" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:772" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:772: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:772" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:772" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:775: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 x -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:775" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 x - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Bridge does not contain a column whose name matches \"x\" -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:775" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:775: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:775" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:775" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:775: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:775" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:775" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:778: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 :y=z -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:778" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 :y=z - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: :y=z: missing column name -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:778" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:778: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:778" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:778" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:778: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:778" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:778" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:781: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 datapath_id:y=z -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:781" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 datapath_id:y=z - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: datapath_id:y=z: trailing garbage \"=z\" in argument -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:781" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:781: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:781" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:781" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:781: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:781" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:781" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:784: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 'datapath_id:y>=z' -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:784" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 'datapath_id:y>=z' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: datapath_id:y>=z: argument does not end in \"=\" followed by a value. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:784" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:784: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:784" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:784" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:784: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:784" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:784" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:787: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set controller x connection_mode=standalone -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:787" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set controller x connection_mode=standalone - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no row \"x\" in table Controller -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:787" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:787: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:787" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:787" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:787: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:787" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:787" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:790: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until bridge br0 datapath_id:y,z -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:790" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until bridge br0 datapath_id:y,z - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: datapath_id:y,z: argument does not end in \"=\", \"!=\", \"<\", \">\", \"<=\", \">=\", \"{=}\", \"{!=}\", \"{<}\", \"{>}\", \"{<=}\", or \"{>=}\" followed by a value. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:790" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:790: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:790" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:790" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:790: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:790" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:790" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:793: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 datapath_id:: -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:793" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 datapath_id:: - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: datapath_id::: trailing garbage \":\" in argument -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:793" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:793: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:793" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:793" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:793: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:793" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:793" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:796: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 datapath_id:x -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:796" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 datapath_id:x - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot specify key to get for non-map column datapath_id -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:796" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:796: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:796" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:796" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:796: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:796" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:796" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:799: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 external_ids:x -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:799" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket get bridge br0 external_ids:x - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no key \"x\" in Bridge record \"br0\" column external_ids -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:799" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:799: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:799" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:799" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:799: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:799" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:799" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:802: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 flood_vlans=-1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:802" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 flood_vlans=-1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: constraint violation: -1 is not in the valid range 0 to 4095 (inclusive) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:802" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:802: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:802" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:802" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:802: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:802" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:802" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:805: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 flood_vlans=4096 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:805" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set bridge br0 flood_vlans=4096 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: constraint violation: 4096 is not in the valid range 0 to 4095 (inclusive) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:805" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:805: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:805" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:805" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:805: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:805" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:805" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:808: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set c br1 'connection-mode=xyz' -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:808" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set c br1 'connection-mode=xyz' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: constraint violation: xyz is not one of the allowed values ([in-band, out-of-band]) -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:808" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:808: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:808" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:808" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:808: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:808" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:808" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:811: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set c br1 connection-mode:x=y -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:811" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set c br1 connection-mode:x=y - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot specify key to set for non-map column connection_mode -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:811" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:811: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:811" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:811" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:811: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:811" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:811" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:814: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add bridge br1 datapath_id x y -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:814" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add bridge br1 datapath_id x y - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"add\" operation would put 2 values in column datapath_id of table Bridge but the maximum number is 1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:814" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:814: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:814" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:814" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:814: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:814" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:814" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:817: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove netflow \`cat netflow-uuid\` targets '\"1.2.3.4:567\"' -" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:817" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove netflow `cat netflow-uuid` targets '"1.2.3.4:567"' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"remove\" operation would put 0 values in column targets of table NetFlow but the minimum number is 1 -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:817" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:817: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:817" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:817" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:817: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:817" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:817" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:820: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove netflow x targets '\"1.2.3.4:567\"' -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:820" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove netflow x targets '"1.2.3.4:567"' - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no row \"x\" in table NetFlow -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:820" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:820: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:820" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:820" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:820: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:820" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:820" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:823: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear netflow x targets -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:823" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear netflow x targets - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no row \"x\" in table NetFlow -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:823" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:823: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:823" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:823" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:823: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:823" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:823" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:826: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear netflow \`cat netflow-uuid\` targets -" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:826" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear netflow `cat netflow-uuid` targets - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"clear\" operation cannot be applied to column targets of table NetFlow, which is not allowed to be empty -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:826" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:826: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:826" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:826" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:826: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:826" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:826" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:829: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket destroy bridge br2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:829" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket destroy bridge br2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no row \"br2\" in table Bridge -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:829" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:829: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:829" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:829" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:829: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:829" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:829" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:832: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add in br1 name x -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:832" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add in br1 name x - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot modify read-only column name in table Interface -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:832" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:832: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:832" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:832" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:832: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:832" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:832" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:835: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set port br1 name br2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:835" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set port br1 name br2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot modify read-only column name in table Port -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:835" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:835: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:835" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:835" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:835: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:835" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:835" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:838: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br1 name br1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:838" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br1 name br1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot modify read-only column name in table Bridge -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:838" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:838: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:838" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:838" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:838: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:838" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:838" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:841: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br1 flood-vlans true -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:841" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket remove bridge br1 flood-vlans true - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: \"true\" is not a valid integer -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:841" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:841: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:841" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:841" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:841: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:841" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:841" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:844: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear bridge br1 name -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:844" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear bridge br1 name - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: cannot modify read-only column name in table Bridge -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:844" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:844: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:844" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:844" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:844: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:844" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:844" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:847: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:847" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:847" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:847: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:847" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:847" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1458 -#AT_START_1459 -at_fn_group_banner 1459 'ovs-vsctl.at:850' \ - "database commands -- conditions" " " 88 -at_xfail=no -( - $as_echo "1459. $at_setup_line: testing $at_desc ..." - $at_traceon - - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat pid` -EOF - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:853: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:853" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:853" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:853: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:853" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:853" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:853: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:853" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:853" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:854: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br br0 -- add-br br1 -- set bridge br1 flood_vlans=0 other-config:x='\"\"' -- add-br br2 -- set bridge br2 flood_vlans=1 other-config:x=y -- add-br br3 -- set bridge br3 flood_vlans=0,1 other-config:x=z -- add-br br4 -- set bridge br4 flood_vlans=2 -- add-br br5 -- set bridge br5 flood_vlans=0,2 -- add-br br6 -- set bridge br6 flood_vlans=1,2 -- add-br br7 -- set bridge br7 flood_vlans=0,1,2" -at_fn_check_prepare_trace "ovs-vsctl.at:854" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- add-br br0 -- add-br br1 -- set bridge br1 flood_vlans=0 other-config:x='""' -- add-br br2 -- set bridge br2 flood_vlans=1 other-config:x=y -- add-br br3 -- set bridge br3 flood_vlans=0,1 other-config:x=z -- add-br br4 -- set bridge br4 flood_vlans=2 -- add-br br5 -- set bridge br5 flood_vlans=0,2 -- add-br br6 -- set bridge br6 flood_vlans=1,2 -- add-br br7 -- set bridge br7 flood_vlans=0,1,2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - - - - - - - - - - - - - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:854" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Arithmetic relational operators without keys. -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:884: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:884" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:884" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:885: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:885" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:885" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:886: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:886" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:886" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:887: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=0,1,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:887" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=0,1,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:887" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:888: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=3' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:888" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans=3' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:888" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:890: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:890" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:890" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:891: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:891" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:891" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:892: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:892" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:892" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:893: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=0,1,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:893" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=0,1,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br5 br6 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:893" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:894: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=3' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:894" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans!=3' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:894" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:896: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:896" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:896" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:897: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:897" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:897" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:898: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:898" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:898" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:899: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>0,1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:899" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>0,1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:899" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:900: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<=2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:900" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<=2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br4 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:900" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:901: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<=0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:901" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans<=0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:901" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:902: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>=1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:902" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>=1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:902" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:903: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>=0,1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:903" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans>=0,1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br3 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:903" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Set relational operators without keys. -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:906: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:906" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:906" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:907: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:907" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:907" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:908: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:908" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br5 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:908" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:909: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}0,1,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:909" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}0,1,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:909" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:910: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}3' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:910" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{=}3' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:910" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:912: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:912" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:912" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:913: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}1' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:913" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}1' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:913" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:914: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:914" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:914" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:915: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}0,1,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:915" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}0,1,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br5 br6 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:915" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:916: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}3' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:916" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{!=}3' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:916" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:918: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:918" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:918" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:919: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<=}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:919" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<=}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:919" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:920: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<}0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:920" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<}0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:920" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:921: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<=}0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:921" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<=}0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:921" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:922: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<}1,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:922" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<}1,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br2 br4 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:922" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:923: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<=}1,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:923" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{<=}1,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br2 br4 br6 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:923" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:925: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:925" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:925" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:926: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:926" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:926" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:927: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>}0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:927" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>}0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br3 br5 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:927" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:928: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}0' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:928" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}0' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 br3 br5 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:928" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:929: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>}0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:929" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>}0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:929" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:930: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}1,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:930" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}1,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:930" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:931: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}0,2' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:931" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'flood_vlans{>=}0,2' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br5 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:931" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Arithmetic relational operators with keys. -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:934: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x=\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:934" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x=""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:934" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:935: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x=y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:935" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x=y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:935" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:936: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x=z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:936" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x=z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:936" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:938: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x!=\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:938" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x!=""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:938" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:939: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x!=y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:939" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x!=y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:939" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:940: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x!=z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:940" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x!=z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:940" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:942: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x>y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:942" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x>y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:942" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:943: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x>=y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:943" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x>=y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:943" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:944: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:944" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:945: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x<=y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:945" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x<=y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:945" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Set relational operators with keys. -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:948: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:948" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:948" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:949: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:949" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:949" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:950: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:950" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:950" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:951: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:951" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{=}z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:951" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:953: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:953" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 br2 br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:953" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:954: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:954" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:954" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:955: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:955" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:955" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:956: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:956" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{!=}z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:956" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:958: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:958" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:958" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:959: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}x' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:959" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}x' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:959" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:960: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:960" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:960" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:961: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:961" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br2 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:961" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:962: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:962" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:962" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:963: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}x,y,z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:963" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<=}x,y,z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:963" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:965: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:965" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:965" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:966: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}x' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:966" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}x' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:966" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:967: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:967" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:967" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:968: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:968" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:968" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:969: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:969" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{<}z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:969" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:971: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:971" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br0 br1 br2 br3 br4 br5 br6 br7 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:971" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:972: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}x' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:972" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}x' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:972" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:973: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:973" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:973" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:974: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:974" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:974" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:975: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:975" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>=}z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:975" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:977: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}[]' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:977" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}[]' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "br1 br2 br3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:977" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:978: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}x' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:978" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}x' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:978" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:979: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}\"\"' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:979" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}""' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:979" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:980: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}y' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:980" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}y' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:980" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:981: echo \`ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}z' | sort\`" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:981" -( $at_check_trace; echo `ovs-vsctl --bare --no-wait -vreconnect:emer --db=unix:socket -- --columns=name find bridge 'other-config:x{>}z' | sort` -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:981" -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:982: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:982" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:982" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:982: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:982" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:982" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1459 -#AT_START_1460 -at_fn_group_banner 1460 'ovs-vsctl.at:985' \ - "database commands -- wait-until immediately true" "" 88 -at_xfail=no -( - $as_echo "1460. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:987: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:987" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:987" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:987: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:987" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:987" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:987: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:987" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:987" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:988: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond br0 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set port bond0 bond_updelay=500 other-config:abc=def -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:988" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-bond br0 bond0 eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket set port bond0 bond_updelay=500 other-config:abc=def - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:988" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:988: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:988" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:988" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:988: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:988" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:988" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:993: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until Open_vSwitch . manager_options=[] -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:993" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until Open_vSwitch . manager_options=[] - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:993" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:993: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:993" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:993" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:993: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:993" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:993" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:995: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until Open_vSwitch . bridges!=[] -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:995" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until Open_vSwitch . bridges!=[] - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:995" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:995: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:995" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:995" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:995: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:995" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:995" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:997: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until Port bond0 other-config:abc=def -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:997" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until Port bond0 other-config:abc=def - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:997" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:997: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:997" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:997" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:997: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:997" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:997" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:999: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until port bond0 'bond_updelay>50' 'other-config:abc>d' 'other-config:abc50' 'other-config:abc>d' 'other-config:abc>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:999" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:999: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:999" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:999" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:999: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:999" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:999" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1001: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1001" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1001" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1001: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1001" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1001" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1460 -#AT_START_1461 -at_fn_group_banner 1461 'ovs-vsctl.at:1004' \ - "database commands -- wait-until must wait" " " 88 -at_xfail=no -( - $as_echo "1461. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1007: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:1007" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1007" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1007: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1007" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1007" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1007: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1007" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1007" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Start ovs-vsctls in background. -(ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until o . bridges!=[] -- get bridge br10 other-config:abc -) > stdout1 & -(ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until bridge br1 -- get bridge br1 other-config:abc -) > stdout2 & -(ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until bridge br1 other-config={abc=def} -- get bridge br1 other-config -) > stdout3 & -(ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket wait-until port bond0 'bond_updelay>50' -- get port bond0 bond-updelay -) > stdout4 & - -# Give the ovs-vsctls a chance to read the database -sleep 1 - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1018: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br10 -- set bridge br10 other-config:abc=quux - -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br1 -- set bridge br1 other-config:abc=def -- add-bond br1 bond0 eth0 eth1 -- set port bond0 bond_updelay=500 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1018" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br10 -- set bridge br10 other-config:abc=quux - -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br1 -- set bridge br1 other-config:abc=def -- add-bond br1 bond0 eth0 eth1 -- set port bond0 bond_updelay=500 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1018" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1018: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1018" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1018" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1018: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1018" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1018" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Wait for the ovs-vsctls to finish. -wait - -# Check output -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1026: cat stdout1" -at_fn_check_prepare_trace "ovs-vsctl.at:1026" -( $at_check_trace; cat stdout1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "quux -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1026" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1026: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1026" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1026" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1026: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1026" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1026" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1028: cat stdout2" -at_fn_check_prepare_trace "ovs-vsctl.at:1028" -( $at_check_trace; cat stdout2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "def -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1028" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1028: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1028" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1028" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1028: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1028" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1028" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1030: cat stdout3" -at_fn_check_prepare_trace "ovs-vsctl.at:1030" -( $at_check_trace; cat stdout3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{abc=def} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1030" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1030: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1030" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1030" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1030: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1030" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1030" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1032: cat stdout4" -at_fn_check_prepare_trace "ovs-vsctl.at:1032" -( $at_check_trace; cat stdout4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "500 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1032" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1032: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1032" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1032" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1032: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1032" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1032" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1035: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1035" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1035" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1035: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1035" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1035" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1461 -#AT_START_1462 -at_fn_group_banner 1462 'ovs-vsctl.at:1038' \ - "--id option on create, get commands" " " 88 -at_xfail=no -( - $as_echo "1462. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1040: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:1040" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1040" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1040: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1040" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1040" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1040: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1040" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1040" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1041: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port br0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port br0 eth1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1041" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br br0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port br0 eth0 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port br0 eth1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1041" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1044: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set bridge br0 mirrors=@m -- --id=@eth0 get port eth0 -- --id=@eth1 get port eth1 -- --id=@m create mirror name=mymirror select-dst-port=@eth0 select-src-port=@eth0 output-port=@eth1" -at_fn_check_prepare_trace "ovs-vsctl.at:1044" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set bridge br0 mirrors=@m -- --id=@eth0 get port eth0 -- --id=@eth1 get port eth1 -- --id=@m create mirror name=mymirror select-dst-port=@eth0 select-src-port=@eth0 output-port=@eth1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1044" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1044: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1044" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1044" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1044: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1044" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1044" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1051: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:1051" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - -<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1051" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1051: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1051" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1051" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1051: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1051" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1051" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1059: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list port eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list mirror -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge br0 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1059" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list port eth0 eth1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list mirror -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list bridge br0 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1059" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1059: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1059" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1059" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1059: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1059" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1059" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1065: sed -n -e '/uuid/p' -e '/name/p' -e '/mirrors/p' -e '/select/p' -e '/output/p' < stdout | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:1065" -( $at_check_trace; sed -n -e '/uuid/p' -e '/name/p' -e '/mirrors/p' -e '/select/p' -e '/output/p' < stdout | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "_uuid : <0> -name : \"eth0\" -_uuid : <1> -name : \"eth1\" -_uuid : <2> -name : mymirror -output_port : <1> -output_vlan : [] -select_all : false -select_dst_port : [<0>] -select_src_port : [<0>] -select_vlan : [] -_uuid : <3> -mirrors : [<2>] -name : \"br0\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1065" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1065: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1065" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1065" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1065: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1065" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1065" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1084: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1084" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1084" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1084: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1084" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1084" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1462 -#AT_START_1463 -at_fn_group_banner 1463 'ovs-vsctl.at:1087' \ - "unreferenced record warnings" " " 88 -at_xfail=no -( - $as_echo "1463. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1089: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:1089" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1089" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1089: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1089" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1089" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1089: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1089" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1089" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1090: ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \\ - -- create Bridge name=br0 | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:1090" -( $at_check_trace; ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \ - -- create Bridge name=br0 | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "vsctl|WARN|applying \"create\" command to table Bridge without --id option will have no effect -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1090" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1090: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1090" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1090" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1090: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1090" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1090" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1096: ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \\ - -- --id=@br0 create Bridge name=br0 | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:1096" -( $at_check_trace; ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \ - -- --id=@br0 create Bridge name=br0 | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "vsctl|WARN|row id \"@br0\" was created but no reference to it was inserted, so it will not actually appear in the database -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1096" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1096: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1096" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1096" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1096: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1096" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1096" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1102: ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \\ - -- --id=@eth0_iface create Interface name=eth0 \\ - -- --id=@eth0 create Port name=eth0 interfaces=@eth0_iface \\ - -- --id=@m0 create Mirror name=m0 output_port=@eth0 \\ - -- --id=@br0 create Bridge name=br0 mirrors=@m0 \\ - -- set Open_vSwitch . bridges=@br0 | \${PERL} \$srcdir/uuidfilt.pl" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:1102" -( $at_check_trace; ovs-vsctl -vPATTERN:console:'%c|%p|%m' --no-wait -vreconnect:emer --db=unix:socket \ - -- --id=@eth0_iface create Interface name=eth0 \ - -- --id=@eth0 create Port name=eth0 interfaces=@eth0_iface \ - -- --id=@m0 create Mirror name=m0 output_port=@eth0 \ - -- --id=@br0 create Bridge name=br0 mirrors=@m0 \ - -- set Open_vSwitch . bridges=@br0 | ${PERL} $srcdir/uuidfilt.pl -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "vsctl|WARN|row id \"@eth0\" was created but only a weak reference to it was inserted, so it will not actually appear in the database -" | \ - $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "<0> -<1> -<2> -<3> -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1102" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1102: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1102" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1102" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1102: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1102" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1102" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1115: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1115" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1115" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1115: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1115" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1115" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1463 -#AT_START_1464 -at_fn_group_banner 1464 'ovs-vsctl.at:1121' \ - "created row UUID is wrong in same execution" " " 88 -at_xfail=no -( - $as_echo "1464. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1123: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:1123" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1123" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1123: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1123" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1123" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1123: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1123" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1123" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1124: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --id=@br0 create Bridge name=br0 -- add Open_vSwitch . bridges @br0 -- list bridge -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1124" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --id=@br0 create Bridge name=br0 -- add Open_vSwitch . bridges @br0 -- list bridge - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1124" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1124: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1124" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1124" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1124: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1124" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1124" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1126: \${PERL} \$srcdir/uuidfilt.pl stdout" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "ovs-vsctl.at:1126" -( $at_check_trace; ${PERL} $srcdir/uuidfilt.pl stdout -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo >>"$at_stdout"; $as_echo "<0> -_uuid : <1> -controller : [] -datapath_id : [] -datapath_type : \"\" -external_ids : {} -fail_mode : [] -flood_vlans : [] -flow_tables : {} -ipfix : [] -mirrors : [] -name : \"br0\" -netflow : [] -other_config : {} -ports : [] -protocols : [] -sflow : [] -status : {} -stp_enable : false -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1126" -if $at_failed; then : - test ! -e pid || kill `cat pid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1147: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1147" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1147" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1147: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1147" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1147" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1464 -#AT_START_1465 -at_fn_group_banner 1465 'ovs-vsctl.at:1153' \ - "--all option on destroy command" " " 88 -at_xfail=no -( - $as_echo "1465. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1155: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:1155" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1155" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1155: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1155" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1155" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1155: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1155" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1155" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1156: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1156" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-br a -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a1 -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket add-port a a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1156" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1156: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1156" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1156" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1156: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1156" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1156" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-br - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-parent a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check br-to-vlan, without --oneline. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - # Check br-to-vlan, with --oneline. - # (This particular test is interesting with --oneline because it returns - # an integer instead of a string and that can cause type mismatches inside - # python if not done carefully.) - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-vlan a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Check multiple queries in a single run. - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a" -at_fn_check_prepare_trace "ovs-vsctl.at:1160" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- br-to-parent a -- br-to-vlan a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -0 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -a2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1\\na2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no port named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket port-to-br a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1161: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1161" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1161" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket list-ifaces a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -a2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: no interface named a -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket iface-to-br a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1162: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1162" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1162" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1163: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set Port a1 qos=@newqos -- set Port a2 qos=@newqos -- --id=@newqos create QoS type=linux-htb other-config:max-rate=1000000000 queues=0=@q0,1=@q1 -- --id=@q0 create Queue other-config:min-rate=100000000 other-config:max-rate=100000000 -- --id=@q1 create Queue other-config:min-rate=500000000" -at_fn_check_prepare_trace "ovs-vsctl.at:1163" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --oneline -- set Port a1 qos=@newqos -- set Port a2 qos=@newqos -- --id=@newqos create QoS type=linux-htb other-config:max-rate=1000000000 queues=0=@q0,1=@q1 -- --id=@q0 create Queue other-config:min-rate=100000000 other-config:max-rate=100000000 -- --id=@q1 create Queue other-config:min-rate=500000000 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1163" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1163: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1163" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1163" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1163: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1163" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1163" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1169: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=other_config,type list Qos -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1169" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=other_config,type list Qos - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "other_config : {max-rate=\"1000000000\"} -type : linux-htb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1169" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1169: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1169" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1169" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1169: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1169" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1169" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1174: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=other_config list Queue | sort | xargs echo -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1174" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=other_config list Queue | sort | xargs echo - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "other_config : {max-rate=100000000, min-rate=100000000} other_config : {min-rate=500000000} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1174" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1174: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1174" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1174" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1174: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1174" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1174" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1178: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear Port a1 qos -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear Port a2 qos -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1178" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear Port a1 qos -ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket clear Port a2 qos - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1178" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1178: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1178" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1178" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1178: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1178" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1178" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1181: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=qos list Port a1 a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1181" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --columns=qos list Port a1 a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "qos : [] - -qos : [] -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1181" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1181: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1181" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1181" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1181: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1181" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1181" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1187: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --all destroy Qos -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1187" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --all destroy Qos - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1187" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1187: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1187" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1187" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1187: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1187" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1187" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1189: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket -- list Qos -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1189" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket -- list Qos - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1189" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1189: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1189" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1189" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1189: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1189" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1189" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1191: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --all destroy Queue -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1191" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket --all destroy Queue - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1191" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1191: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1191" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1191" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1191: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1191" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1191" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1193: ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket -- list Queue -" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1193" -( $at_check_trace; ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket -- list Queue - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1193" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1193: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1193" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1193" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1193: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1193" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1193" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1195: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1195" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1195" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1195: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-vsctl.at:1195" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1195" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1465 -#AT_START_1466 -at_fn_group_banner 1466 'ovs-vsctl.at:1201' \ - "add-port -- reserved names 1" " " 89 -at_xfail=no -( - $as_echo "1466. $at_setup_line: testing $at_desc ..." - $at_traceon - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1202: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:1202" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1202" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1202: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-vsctl.at:1202" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1202" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1202: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1202" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1202" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1202: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-vsctl.at:1202" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1202: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-vsctl.at:1202" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1202: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1202" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1202: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- " -at_fn_check_prepare_trace "ovs-vsctl.at:1202" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1202" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Test creating all reserved port names - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl add-port br0 ovs-netdev" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl add-port br0 ovs-netdev -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'ovs-netdev'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface ovs-netdev, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl del-port br0 ovs-netdev" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl del-port br0 ovs-netdev -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl add-port br0 ovs-dummy" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl add-port br0 ovs-dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'ovs-dummy'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface ovs-dummy, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl del-port br0 ovs-dummy" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl del-port br0 ovs-dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl add-port br0 gre_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl add-port br0 gre_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'gre_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface gre_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl del-port br0 gre_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl del-port br0 gre_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl add-port br0 gre64_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl add-port br0 gre64_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'gre64_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface gre64_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl del-port br0 gre64_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl del-port br0 gre64_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl add-port br0 lisp_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl add-port br0 lisp_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'lisp_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface lisp_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl del-port br0 lisp_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl del-port br0 lisp_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl add-port br0 vxlan_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl add-port br0 vxlan_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'vxlan_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface vxlan_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1205" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1205: ovs-vsctl del-port br0 vxlan_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1205" -( $at_check_trace; ovs-vsctl del-port br0 vxlan_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1205" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1226: check_logs " -at_fn_check_prepare_trace "ovs-vsctl.at:1226" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1226: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-vsctl.at:1226" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1226: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-vsctl.at:1226" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1226" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1466 -#AT_START_1467 -at_fn_group_banner 1467 'ovs-vsctl.at:1229' \ - "add-port -- reserved names 2" " " 89 -at_xfail=no -( - $as_echo "1467. $at_setup_line: testing $at_desc ..." - $at_traceon - -# Creates all type of tunnel ports -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1231: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-vsctl.at:1231" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1231" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1231: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "ovs-vsctl.at:1231" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1231" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1231: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1231" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1231" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1231: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "ovs-vsctl.at:1231" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1231: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "ovs-vsctl.at:1231" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1231: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1231" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1231: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \\ - options:remote_ip=1.1.1.1 ofport_request=1\\ - -- add-port br0 p2 -- set Interface p2 type=gre64 \\ - options:local_ip=2.2.2.2 options:remote_ip=1.1.1.1 \\ - ofport_request=2 \\ - -- add-port br0 p3 -- set Interface p3 type=lisp \\ - options:remote_ip=2.2.2.2 ofport_request=3 \\ - -- add-port br0 p4 -- set Interface p4 type=vxlan \\ - options:remote_ip=2.2.2.2 ofport_request=4 " -at_fn_check_prepare_notrace 'an embedded newline' "ovs-vsctl.at:1231" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p1 -- set Interface p1 type=gre \ - options:remote_ip=1.1.1.1 ofport_request=1\ - -- add-port br0 p2 -- set Interface p2 type=gre64 \ - options:local_ip=2.2.2.2 options:remote_ip=1.1.1.1 \ - ofport_request=2 \ - -- add-port br0 p3 -- set Interface p3 type=lisp \ - options:remote_ip=2.2.2.2 ofport_request=3 \ - -- add-port br0 p4 -- set Interface p4 type=vxlan \ - options:remote_ip=2.2.2.2 ofport_request=4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1231" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -# Test creating all reserved tunnel port names - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl add-port br0 gre_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl add-port br0 gre_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'gre_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface gre_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl del-port br0 gre_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl del-port br0 gre_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl add-port br0 gre64_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl add-port br0 gre64_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'gre64_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface gre64_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl del-port br0 gre64_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl del-port br0 gre64_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl add-port br0 lisp_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl add-port br0 lisp_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'lisp_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface lisp_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl del-port br0 lisp_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl del-port br0 lisp_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Try creating the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl add-port br0 vxlan_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl add-port br0 vxlan_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "ovs-vsctl: Error detected while setting up 'vxlan_system'. See ovs-vswitchd log for details. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Detect the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed -n \"s/^.*\\(|bridge|WARN|.*\\)\$/\\1/p\" ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed -n "s/^.*\(|bridge|WARN|.*\)$/\1/p" ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "|bridge|WARN|could not create interface vxlan_system, name is reserved -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the warning log message -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: sed \"/|bridge|WARN|/d\" ovs-vswitchd.log > ovs-vswitchd.log" -at_fn_check_prepare_notrace 'a shell pipeline' "ovs-vsctl.at:1242" -( $at_check_trace; sed "/|bridge|WARN|/d" ovs-vswitchd.log > ovs-vswitchd.log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -# Delete the port -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1242: ovs-vsctl del-port br0 vxlan_system" -at_fn_check_prepare_trace "ovs-vsctl.at:1242" -( $at_check_trace; ovs-vsctl del-port br0 vxlan_system -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1242" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1261: check_logs " -at_fn_check_prepare_trace "ovs-vsctl.at:1261" -( $at_check_trace; check_logs -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1261: ovs-appctl -t ovs-vswitchd exit" -at_fn_check_prepare_trace "ovs-vsctl.at:1261" -( $at_check_trace; ovs-appctl -t ovs-vswitchd exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-vsctl.at:1261: ovs-appctl -t ovsdb-server exit" -at_fn_check_prepare_trace "ovs-vsctl.at:1261" -( $at_check_trace; ovs-appctl -t ovsdb-server exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-vsctl.at:1261" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1467 -#AT_START_1468 -at_fn_group_banner 1468 'ovs-monitor-ipsec.at:3' \ - "ovs-monitor-ipsec" " " 90 -at_xfail=no -( - $as_echo "1468. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "ovs-monitor-ipsec.at:4" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovs-monitor-ipsec.at:4" -$as_echo "ovs-monitor-ipsec.at:5" >"$at_check_line_file" -($non_ascii_cwd) \ - && at_fn_check_skip 77 "$at_srcdir/ovs-monitor-ipsec.at:5" - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR -cp "$top_srcdir/vswitchd/vswitch.ovsschema" . - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat pid ovs-monitor-ipsec.pid` -EOF - - -mkdir etc etc/init.d etc/racoon etc/racoon/certs -mkdir usr usr/sbin - -cat >etc/init.d/racoon <<'_ATEOF' -#! /bin/sh -echo "racoon: $@" >&3 -exit 0 -_ATEOF - -chmod +x etc/init.d/racoon - -cat >usr/sbin/setkey <<'_ATEOF' -#! /bin/sh -exec >&3 -echo "setkey:" -while read line; do - echo "> $line" -done -_ATEOF - -chmod +x usr/sbin/setkey - -touch etc/racoon/certs/ovs-stale.pem - -ovs_vsctl () { - ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket "$@" -} -trim () { # Removes blank lines and lines starting with # from input. - sed -e '/^#/d' -e '/^[ ]*$/d' "$@" -} - -### -### Start ovsdb-server. -### -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:46: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-monitor-ipsec.at:46" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:46: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-monitor-ipsec.at:46" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:46: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:46" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:46" -$at_failed && at_fn_log_failure -$at_traceon; } - - -### -### Start ovs-monitor-ipsec and wait for it to delete the stale cert. -### -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:51: \$PYTHON \$top_srcdir/debian/ovs-monitor-ipsec \"--root-prefix=\`pwd\`\" \\ - \"--pidfile=\`pwd\`/ovs-monitor-ipsec.pid\" \\ - unix:socket 2>log 3>actions &" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:51" -( $at_check_trace; $PYTHON $top_srcdir/debian/ovs-monitor-ipsec "--root-prefix=`pwd`" \ - "--pidfile=`pwd`/ovs-monitor-ipsec.pid" \ - unix:socket 2>log 3>actions & -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:51" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:57: ovs_wait_cond () { test ! -f etc/racoon/certs/ovs-stale.pem -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-monitor-ipsec.at:57" -( $at_check_trace; ovs_wait_cond () { test ! -f etc/racoon/certs/ovs-stale.pem -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:57" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - -### -### Add an ipsec_gre psk interface and check what ovs-monitor-ipsec does -### -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:62: ovs_vsctl \\ - -- add-br br0 \\ - -- add-port br0 gre0 \\ - -- set interface gre0 type=ipsec_gre \\ - options:remote_ip=1.2.3.4 \\ - options:psk=swordfish" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-monitor-ipsec.at:62" -( $at_check_trace; ovs_vsctl \ - -- add-br br0 \ - -- add-port br0 gre0 \ - -- set interface gre0 type=ipsec_gre \ - options:remote_ip=1.2.3.4 \ - options:psk=swordfish -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:62" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:68: ovs_wait_cond () { test -f actions && grep 'spdadd 1.2.3.4' actions >/dev/null -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-monitor-ipsec.at:68" -( $at_check_trace; ovs_wait_cond () { test -f actions && grep 'spdadd 1.2.3.4' actions >/dev/null -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:68" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:69: cat actions" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:69" -( $at_check_trace; cat actions -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "setkey: -> flush; -setkey: -> spdflush; -racoon: reload -racoon: reload -setkey: -> spdadd 0.0.0.0/0 1.2.3.4 gre -P out ipsec esp/transport//require; -> spdadd 1.2.3.4 0.0.0.0/0 gre -P in ipsec esp/transport//require; -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:69" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:80: trim etc/racoon/psk.txt" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:80" -( $at_check_trace; trim etc/racoon/psk.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1.2.3.4 swordfish -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:80" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:82: trim etc/racoon/racoon.conf" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:82" -( $at_check_trace; trim etc/racoon/racoon.conf -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "path pre_shared_key \"/etc/racoon/psk.txt\"; -path certificate \"/etc/racoon/certs\"; -remote 1.2.3.4 { - exchange_mode main; - nat_traversal on; - proposal { - encryption_algorithm aes; - hash_algorithm sha1; - authentication_method pre_shared_key; - dh_group 2; - } -} -sainfo anonymous { - pfs_group 2; - lifetime time 1 hour; - encryption_algorithm aes; - authentication_algorithm hmac_sha1, hmac_md5; - compression_algorithm deflate; -} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:82" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - -### -### Delete the ipsec_gre interface and check what ovs-monitor-ipsec does -### -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:107: ovs_vsctl del-port gre0" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:107" -( $at_check_trace; ovs_vsctl del-port gre0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:107" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:108: ovs_wait_cond () { test \`wc -l < actions\` -ge 17 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:108" -( $at_check_trace; ovs_wait_cond () { test `wc -l < actions` -ge 17 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:108" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:109: sed '1,9d' actions" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:109" -( $at_check_trace; sed '1,9d' actions -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "racoon: reload -setkey: -> spddelete 0.0.0.0/0 1.2.3.4 gre -P out; -> spddelete 1.2.3.4 0.0.0.0/0 gre -P in; -setkey: -> dump ; -setkey: -> dump ; -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:109" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:119: trim etc/racoon/psk.txt" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:119" -( $at_check_trace; trim etc/racoon/psk.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:119" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:120: trim etc/racoon/racoon.conf" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:120" -( $at_check_trace; trim etc/racoon/racoon.conf -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "path pre_shared_key \"/etc/racoon/psk.txt\"; -path certificate \"/etc/racoon/certs\"; -sainfo anonymous { - pfs_group 2; - lifetime time 1 hour; - encryption_algorithm aes; - authentication_algorithm hmac_sha1, hmac_md5; - compression_algorithm deflate; -} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:120" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - -### -### Add ipsec_gre certificate interface and check what ovs-monitor-ipsec does -### -cat >cert.pem <<'_ATEOF' ------BEGIN CERTIFICATE----- -(not a real certificate) ------END CERTIFICATE----- -_ATEOF - -cat >key.pem <<'_ATEOF' ------BEGIN RSA PRIVATE KEY----- -(not a real private key) ------END RSA PRIVATE KEY----- -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:145: ovs_vsctl \\ - -- add-port br0 gre1 \\ - -- set Interface gre1 type=ipsec_gre \\ - options:remote_ip=2.3.4.5 \\ - options:peer_cert='\"-----BEGIN CERTIFICATE----- -(not a real peer certificate) ------END CERTIFICATE----- -\"' \\ - options:certificate='\"/cert.pem\"' \\ - options:private_key='\"/key.pem\"'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-monitor-ipsec.at:145" -( $at_check_trace; ovs_vsctl \ - -- add-port br0 gre1 \ - -- set Interface gre1 type=ipsec_gre \ - options:remote_ip=2.3.4.5 \ - options:peer_cert='"-----BEGIN CERTIFICATE----- -(not a real peer certificate) ------END CERTIFICATE----- -"' \ - options:certificate='"/cert.pem"' \ - options:private_key='"/key.pem"' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:145" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:155: ovs_wait_cond () { test \`wc -l < actions\` -ge 21 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:155" -( $at_check_trace; ovs_wait_cond () { test `wc -l < actions` -ge 21 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:155" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:156: sed '1,17d' actions" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:156" -( $at_check_trace; sed '1,17d' actions -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "racoon: reload -setkey: -> spdadd 0.0.0.0/0 2.3.4.5 gre -P out ipsec esp/transport//require; -> spdadd 2.3.4.5 0.0.0.0/0 gre -P in ipsec esp/transport//require; -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:156" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:162: trim etc/racoon/psk.txt" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:162" -( $at_check_trace; trim etc/racoon/psk.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:162" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:163: trim etc/racoon/racoon.conf" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:163" -( $at_check_trace; trim etc/racoon/racoon.conf -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "path pre_shared_key \"/etc/racoon/psk.txt\"; -path certificate \"/etc/racoon/certs\"; -remote 2.3.4.5 { - exchange_mode main; - nat_traversal on; - ike_frag on; - certificate_type x509 \"/cert.pem\" \"/key.pem\"; - my_identifier asn1dn; - peers_identifier asn1dn; - peers_certfile x509 \"/etc/racoon/certs/ovs-2.3.4.5.pem\"; - verify_identifier on; - proposal { - encryption_algorithm aes; - hash_algorithm sha1; - authentication_method rsasig; - dh_group 2; - } -} -sainfo anonymous { - pfs_group 2; - lifetime time 1 hour; - encryption_algorithm aes; - authentication_algorithm hmac_sha1, hmac_md5; - compression_algorithm deflate; -} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:163" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:190: cat etc/racoon/certs/ovs-2.3.4.5.pem" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:190" -( $at_check_trace; cat etc/racoon/certs/ovs-2.3.4.5.pem -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "-----BEGIN CERTIFICATE----- -(not a real peer certificate) ------END CERTIFICATE----- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:190" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - -### -### Delete the ipsec_gre certificate interface. -### -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:199: ovs_vsctl del-port gre1" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:199" -( $at_check_trace; ovs_vsctl del-port gre1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:199" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:200: ovs_wait_cond () { test \`wc -l < actions\` -ge 29 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:200" -( $at_check_trace; ovs_wait_cond () { test `wc -l < actions` -ge 29 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:200" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:201: sed '1,21d' actions" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:201" -( $at_check_trace; sed '1,21d' actions -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "racoon: reload -setkey: -> spddelete 0.0.0.0/0 2.3.4.5 gre -P out; -> spddelete 2.3.4.5 0.0.0.0/0 gre -P in; -setkey: -> dump ; -setkey: -> dump ; -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:201" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:211: trim etc/racoon/psk.txt" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:211" -( $at_check_trace; trim etc/racoon/psk.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:211" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:212: trim etc/racoon/racoon.conf" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:212" -( $at_check_trace; trim etc/racoon/racoon.conf -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "path pre_shared_key \"/etc/racoon/psk.txt\"; -path certificate \"/etc/racoon/certs\"; -sainfo anonymous { - pfs_group 2; - lifetime time 1 hour; - encryption_algorithm aes; - authentication_algorithm hmac_sha1, hmac_md5; - compression_algorithm deflate; -} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:212" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:223: test ! -f etc/racoon/certs/ovs-2.3.4.5.pem" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:223" -( $at_check_trace; test ! -f etc/racoon/certs/ovs-2.3.4.5.pem -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:223" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - -### -### Add an SSL certificate interface. -### -cp cert.pem ssl-cert.pem -cp key.pem ssl-key.pem -cat >ssl-cacert.pem <<'_ATEOF' ------BEGIN CERTIFICATE----- -(not a real CA certificate) ------END CERTIFICATE----- -_ATEOF - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:235: ovs_vsctl set-ssl /ssl-key.pem /ssl-cert.pem /ssl-cacert.pem \\ - -- add-port br0 gre2 \\ - -- set Interface gre2 type=ipsec_gre \\ - options:remote_ip=3.4.5.6 \\ - options:peer_cert='\"-----BEGIN CERTIFICATE----- -(not a real peer certificate) ------END CERTIFICATE----- -\"' \\ - options:use_ssl_cert='\"true\"'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-monitor-ipsec.at:235" -( $at_check_trace; ovs_vsctl set-ssl /ssl-key.pem /ssl-cert.pem /ssl-cacert.pem \ - -- add-port br0 gre2 \ - -- set Interface gre2 type=ipsec_gre \ - options:remote_ip=3.4.5.6 \ - options:peer_cert='"-----BEGIN CERTIFICATE----- -(not a real peer certificate) ------END CERTIFICATE----- -"' \ - options:use_ssl_cert='"true"' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:235" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:244: ovs_wait_cond () { test \`wc -l < actions\` -ge 33 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:244" -( $at_check_trace; ovs_wait_cond () { test `wc -l < actions` -ge 33 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:244" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:245: sed '1,29d' actions" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:245" -( $at_check_trace; sed '1,29d' actions -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "racoon: reload -setkey: -> spdadd 0.0.0.0/0 3.4.5.6 gre -P out ipsec esp/transport//require; -> spdadd 3.4.5.6 0.0.0.0/0 gre -P in ipsec esp/transport//require; -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:245" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:251: trim etc/racoon/psk.txt" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:251" -( $at_check_trace; trim etc/racoon/psk.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:251" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:252: trim etc/racoon/racoon.conf" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:252" -( $at_check_trace; trim etc/racoon/racoon.conf -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "path pre_shared_key \"/etc/racoon/psk.txt\"; -path certificate \"/etc/racoon/certs\"; -remote 3.4.5.6 { - exchange_mode main; - nat_traversal on; - ike_frag on; - certificate_type x509 \"/ssl-cert.pem\" \"/ssl-key.pem\"; - my_identifier asn1dn; - peers_identifier asn1dn; - peers_certfile x509 \"/etc/racoon/certs/ovs-3.4.5.6.pem\"; - verify_identifier on; - proposal { - encryption_algorithm aes; - hash_algorithm sha1; - authentication_method rsasig; - dh_group 2; - } -} -sainfo anonymous { - pfs_group 2; - lifetime time 1 hour; - encryption_algorithm aes; - authentication_algorithm hmac_sha1, hmac_md5; - compression_algorithm deflate; -} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:252" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:279: cat etc/racoon/certs/ovs-3.4.5.6.pem" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:279" -( $at_check_trace; cat etc/racoon/certs/ovs-3.4.5.6.pem -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "-----BEGIN CERTIFICATE----- -(not a real peer certificate) ------END CERTIFICATE----- -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:279" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - -### -### Delete the SSL certificate interface. -### -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:288: ovs_vsctl del-port gre2" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:288" -( $at_check_trace; ovs_vsctl del-port gre2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:288" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:289: ovs_wait_cond () { test \`wc -l < actions\` -ge 41 -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:289" -( $at_check_trace; ovs_wait_cond () { test `wc -l < actions` -ge 41 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:289" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:290: sed '1,33d' actions" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:290" -( $at_check_trace; sed '1,33d' actions -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "racoon: reload -setkey: -> spddelete 0.0.0.0/0 3.4.5.6 gre -P out; -> spddelete 3.4.5.6 0.0.0.0/0 gre -P in; -setkey: -> dump ; -setkey: -> dump ; -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:290" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:300: trim etc/racoon/psk.txt" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:300" -( $at_check_trace; trim etc/racoon/psk.txt -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:300" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:301: trim etc/racoon/racoon.conf" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:301" -( $at_check_trace; trim etc/racoon/racoon.conf -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "path pre_shared_key \"/etc/racoon/psk.txt\"; -path certificate \"/etc/racoon/certs\"; -sainfo anonymous { - pfs_group 2; - lifetime time 1 hour; - encryption_algorithm aes; - authentication_algorithm hmac_sha1, hmac_md5; - compression_algorithm deflate; -} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:301" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:312: test ! -f etc/racoon/certs/ovs-3.4.5.6.pem" -at_fn_check_prepare_trace "ovs-monitor-ipsec.at:312" -( $at_check_trace; test ! -f etc/racoon/certs/ovs-3.4.5.6.pem -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:312" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:314: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:314" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:314" -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-monitor-ipsec.at:314: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-monitor-ipsec.at:314" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-monitor-ipsec.at:314" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure \ -"log" \ -"actions" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1468 -#AT_START_1469 -at_fn_group_banner 1469 'ovs-xapi-sync.at:3' \ - "ovs-xapi-sync" " " 91 -at_xfail=no -( - $as_echo "1469. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "ovs-xapi-sync.at:4" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/ovs-xapi-sync.at:4" - -# Mock up the XenAPI. -cp "$top_srcdir/tests/MockXenAPI.py" XenAPI.py -PYTHONPATH=`pwd`:$PYTHONPATH -export PYTHONPATH - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR -cp "$top_srcdir/vswitchd/vswitch.ovsschema" . - -cp "$top_srcdir/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync" \ - ovs-xapi-sync - -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat pid ovs-xapi-sync.pid` -EOF - - -mkdir var var/run -touch var/run/xapi_init_complete.cookie - -ovs_vsctl () { - ovs-vsctl --no-wait -vreconnect:emer --db=unix:socket "$@" -} - -# Start ovsdb-server. -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:29: ovsdb-tool create db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "ovs-xapi-sync.at:29" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:29: ovsdb-tool transact db \\ - '[\"Open_vSwitch\", - {\"op\": \"insert\", - \"table\": \"Open_vSwitch\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-xapi-sync.at:29" -( $at_check_trace; ovsdb-tool transact db \ - '["Open_vSwitch", - {"op": "insert", - "table": "Open_vSwitch", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:29: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-xapi-sync.at:29" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:29" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Start ovs-xapi-sync. -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:32: \$PYTHON ./ovs-xapi-sync \"--pidfile=\`pwd\`/ovs-xapi-sync.pid\" \\ - \"--root-prefix=\`pwd\`\" unix:socket >log 2>&1 &" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-xapi-sync.at:32" -( $at_check_trace; $PYTHON ./ovs-xapi-sync "--pidfile=`pwd`/ovs-xapi-sync.pid" \ - "--root-prefix=`pwd`" unix:socket >log 2>&1 & -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:32" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Add bridges and check ovs-xapi-sync's work. -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:37: ovs_vsctl -- add-br xenbr0 -- add-br xenbr1" -at_fn_check_prepare_trace "ovs-xapi-sync.at:37" -( $at_check_trace; ovs_vsctl -- add-br xenbr0 -- add-br xenbr1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:37" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:38: ovs_wait_cond () { test \"X\`ovs_vsctl get bridge xenbr0 fail-mode\`\" != \"X[]\" -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-xapi-sync.at:38" -( $at_check_trace; ovs_wait_cond () { test "X`ovs_vsctl get bridge xenbr0 fail-mode`" != "X[]" -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:38" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:39: ovs_vsctl \\ - -- get bridge xenbr0 fail-mode other-config external-ids \\ - -- get bridge xenbr1 fail-mode other-config external-ids" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-xapi-sync.at:39" -( $at_check_trace; ovs_vsctl \ - -- get bridge xenbr0 fail-mode other-config external-ids \ - -- get bridge xenbr1 fail-mode other-config external-ids -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "secure -{} -{bridge-id=\"custom bridge ID\"} -secure -{disable-in-band=\"true\"} -{} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:39" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - -# Add vif and check daemon's work. -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:51: ovs_vsctl \\ - -- add-port xenbr0 vif1.0 \\ - -- set Interface vif1.0 'external-ids={attached-mac=\"00:11:22:33:44:55\", xs-network-uuid=\"9b66c68b-a74e-4d34-89a5-20a8ab352d1e\", xs-vif-uuid=\"6ab1b260-398e-49ba-827b-c7696108964c\", xs-vm-uuid=\"fcb8a3f6-dc04-41d2-8b8a-55afd2b755b8\"'}" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-xapi-sync.at:51" -( $at_check_trace; ovs_vsctl \ - -- add-port xenbr0 vif1.0 \ - -- set Interface vif1.0 'external-ids={attached-mac="00:11:22:33:44:55", xs-network-uuid="9b66c68b-a74e-4d34-89a5-20a8ab352d1e", xs-vif-uuid="6ab1b260-398e-49ba-827b-c7696108964c", xs-vm-uuid="fcb8a3f6-dc04-41d2-8b8a-55afd2b755b8"'} -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:51" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:54: ovs_wait_cond () { ovs_vsctl get interface vif1.0 external-ids:iface-id >/dev/null 2>&1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-xapi-sync.at:54" -( $at_check_trace; ovs_wait_cond () { ovs_vsctl get interface vif1.0 external-ids:iface-id >/dev/null 2>&1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:54" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:55: ovs_vsctl get interface vif1.0 external-ids" -at_fn_check_prepare_trace "ovs-xapi-sync.at:55" -( $at_check_trace; ovs_vsctl get interface vif1.0 external-ids -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{attached-mac=\"00:11:22:33:44:55\", iface-id=\"custom iface ID\", iface-status=active, vm-id=\"custom vm ID\", xs-network-uuid=\"9b66c68b-a74e-4d34-89a5-20a8ab352d1e\", xs-vif-uuid=\"6ab1b260-398e-49ba-827b-c7696108964c\", xs-vm-uuid=\"fcb8a3f6-dc04-41d2-8b8a-55afd2b755b8\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:55" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - -# Add corresponding tap and check daemon's work. -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:60: ovs_vsctl add-port xenbr0 tap1.0" -at_fn_check_prepare_trace "ovs-xapi-sync.at:60" -( $at_check_trace; ovs_vsctl add-port xenbr0 tap1.0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:60" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:61: ovs_wait_cond () { ovs_vsctl get interface tap1.0 external-ids:iface-id >/dev/null 2>&1 -} -ovs_wait" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-xapi-sync.at:61" -( $at_check_trace; ovs_wait_cond () { ovs_vsctl get interface tap1.0 external-ids:iface-id >/dev/null 2>&1 -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:61" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:62: ovs_vsctl \\ - -- get interface vif1.0 external-ids \\ - -- get interface tap1.0 external-ids" -at_fn_check_prepare_notrace 'an embedded newline' "ovs-xapi-sync.at:62" -( $at_check_trace; ovs_vsctl \ - -- get interface vif1.0 external-ids \ - -- get interface tap1.0 external-ids -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{attached-mac=\"00:11:22:33:44:55\", iface-id=\"custom iface ID\", iface-status=inactive, vm-id=\"custom vm ID\", xs-network-uuid=\"9b66c68b-a74e-4d34-89a5-20a8ab352d1e\", xs-vif-uuid=\"6ab1b260-398e-49ba-827b-c7696108964c\", xs-vm-uuid=\"fcb8a3f6-dc04-41d2-8b8a-55afd2b755b8\"} -{attached-mac=\"00:11:22:33:44:55\", iface-id=\"custom iface ID\", iface-status=active, vm-id=\"custom vm ID\", xs-network-uuid=\"9b66c68b-a74e-4d34-89a5-20a8ab352d1e\", xs-vif-uuid=\"6ab1b260-398e-49ba-827b-c7696108964c\", xs-vm-uuid=\"fcb8a3f6-dc04-41d2-8b8a-55afd2b755b8\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:62" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - -# Remove corresponding tap and check daemon's work. -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:70: ovs_vsctl del-port tap1.0" -at_fn_check_prepare_trace "ovs-xapi-sync.at:70" -( $at_check_trace; ovs_vsctl del-port tap1.0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:70" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:71: ovs_wait_cond () { test \`ovs_vsctl get interface vif1.0 external-ids:iface-status\` = active -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-xapi-sync.at:71" -( $at_check_trace; ovs_wait_cond () { test `ovs_vsctl get interface vif1.0 external-ids:iface-status` = active -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:71" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:72: ovs_vsctl get interface vif1.0 external-ids" -at_fn_check_prepare_trace "ovs-xapi-sync.at:72" -( $at_check_trace; ovs_vsctl get interface vif1.0 external-ids -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "{attached-mac=\"00:11:22:33:44:55\", iface-id=\"custom iface ID\", iface-status=active, vm-id=\"custom vm ID\", xs-network-uuid=\"9b66c68b-a74e-4d34-89a5-20a8ab352d1e\", xs-vif-uuid=\"6ab1b260-398e-49ba-827b-c7696108964c\", xs-vm-uuid=\"fcb8a3f6-dc04-41d2-8b8a-55afd2b755b8\"} -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:72" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - -cp pid savepid - { set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:76: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-xapi-sync.at:76" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:76" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/ovs-xapi-sync.at:76: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "ovs-xapi-sync.at:76" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/ovs-xapi-sync.at:76" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1469 -#AT_START_1470 -at_fn_group_banner 1470 'interface-reconfigure.at:697' \ - "non-VLAN, non-bond" " " 92 -at_xfail=no -( - $as_echo "1470. $at_setup_line: testing $at_desc ..." - $at_traceon - - -$as_echo "interface-reconfigure.at:699" >"$at_check_line_file" -($non_ascii_cwd) \ - && at_fn_check_skip 77 "$at_srcdir/interface-reconfigure.at:699" -ifr_setup - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:702: ifr_run --force xenbr2 up" -at_fn_check_prepare_trace "interface-reconfigure.at:702" -( $at_check_trace; ifr_run --force xenbr2 up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:702" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:703: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:703" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xenbr2 up -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_up: xenbr2 -Writing network configuration for xenbr2 -Configuring xenbr2 using DHCP configuration -configure_datapath: bridge - xenbr2 -configure_datapath: physical - [u'eth2'] -configure_datapath: extra ports - [] -configure_datapath: extra bonds - [] -/usr/bin/ovs-vsctl -vconsole:off get-fail-mode xenbr2 -Applying changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration -Applying changes to /etc/sysconfig/network configuration -Applying changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration -/sbin/ifconfig eth2 up mtu 1500 -/sbin/ethtool -K eth2 gro off lro off -/usr/sbin/ovs-vlan-bug-workaround eth2 on -/usr/bin/ovs-vsctl --timeout=20 - --with-iface --if-exists del-port eth2 - --may-exist add-br xenbr2 - --may-exist add-port xenbr2 eth2 - set Bridge xenbr2 other-config:hwaddr=\"00:15:17:a0:29:80\" - set Bridge xenbr2 fail_mode=secure - remove Bridge xenbr2 other_config disable-in-band - br-set-external-id xenbr2 xs-network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99 -/usr/bin/ovs-vsctl -vconsole:off get interface eth2 ofport -/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=5,arp,nw_proto=1,actions=local -/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=local,arp,dl_src=00:15:17:a0:29:80,actions=5 -/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=5,dl_dst=00:15:17:a0:29:80,actions=local -/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=local,dl_src=00:15:17:a0:29:80,actions=5 -/sbin/ifup xenbr2 -/sbin/update-issue -Committing changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration -Committing changes to /etc/sysconfig/network configuration -Committing changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:703" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:740: cat etc/sysconfig/network-scripts/ifcfg-xenbr2" -at_fn_check_prepare_trace "interface-reconfigure.at:740" -( $at_check_trace; cat etc/sysconfig/network-scripts/ifcfg-xenbr2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "# DO NOT EDIT: This file (ifcfg-xenbr2) was autogenerated by interface-reconfigure -XEMANAGED=yes -DEVICE=xenbr2 -ONBOOT=no -NOZEROCONF=yes -TYPE=Ethernet -BOOTPROTO=dhcp -PERSISTENT_DHCLIENT=yes -MTU=1500 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:740" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Simulate interface-reconfigure creating xenbr2, so that we can tell -# interface-reconfigure to take it back down. -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:754: configure_netdev xenbr2 00:15:17:a0:29:80 0" -at_fn_check_prepare_trace "interface-reconfigure.at:754" -( $at_check_trace; configure_netdev xenbr2 00:15:17:a0:29:80 0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:754" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:756: ifr_run --force xenbr2 down" -at_fn_check_prepare_trace "interface-reconfigure.at:756" -( $at_check_trace; ifr_run --force xenbr2 down -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:756" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:757: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:757" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xenbr2 down -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_down: xenbr2 -/sbin/ifdown xenbr2 -deconfigure ipdev xenbr2 on xenbr2 -deconfigure_bridge: bridge - xenbr2 -action_down: bring down physical devices - [u'eth2'] -/sbin/ifconfig eth2 down -/usr/bin/ovs-vsctl --timeout=20 - --with-iface --if-exists del-port xenbr2 - --if-exists del-br xenbr2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:757" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1470 -#AT_START_1471 -at_fn_group_banner 1471 'interface-reconfigure.at:773' \ - "VLAN, non-bond" " " 92 -at_xfail=no -( - $as_echo "1471. $at_setup_line: testing $at_desc ..." - $at_traceon - - -$as_echo "interface-reconfigure.at:775" >"$at_check_line_file" -($non_ascii_cwd) \ - && at_fn_check_skip 77 "$at_srcdir/interface-reconfigure.at:775" -ifr_setup - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:778: ifr_run --force xapi3 up" -at_fn_check_prepare_trace "interface-reconfigure.at:778" -( $at_check_trace; ifr_run --force xapi3 up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:778" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:779: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:779" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xapi3 up -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_up: xapi3 -Writing network configuration for xapi3 -Configuring xapi3 using None configuration -configure_datapath: bridge - xenbr3 -configure_datapath: physical - [u'eth3'] -configure_datapath: extra ports - [] -configure_datapath: extra bonds - [] -Applying changes to /etc/sysconfig/network-scripts/route-xapi3 configuration -Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration -/sbin/ifconfig eth3 up mtu 1500 -/sbin/ethtool -K eth3 gro off lro off -/usr/sbin/ovs-vlan-bug-workaround eth3 on -/usr/bin/ovs-vsctl --timeout=20 - --with-iface --if-exists del-port eth3 - --may-exist add-br xenbr3 - --may-exist add-port xenbr3 eth3 - set Bridge xenbr3 other-config:hwaddr=\"00:15:17:a0:29:81\" - set Bridge xenbr3 fail_mode=secure - remove Bridge xenbr3 other_config disable-in-band - br-set-external-id xenbr3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 - --if-exists del-br xapi3 - --may-exist add-br xapi3 xenbr3 123 - br-set-external-id xapi3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 - set Interface xapi3 MAC=\"00:15:17:a0:29:81\" -/sbin/ifup xapi3 -/sbin/update-issue -Committing changes to /etc/sysconfig/network-scripts/route-xapi3 configuration -Committing changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:779" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:812: cat etc/sysconfig/network-scripts/ifcfg-xapi3" -at_fn_check_prepare_trace "interface-reconfigure.at:812" -( $at_check_trace; cat etc/sysconfig/network-scripts/ifcfg-xapi3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "# DO NOT EDIT: This file (ifcfg-xapi3) was autogenerated by interface-reconfigure -XEMANAGED=yes -DEVICE=xapi3 -ONBOOT=no -NOZEROCONF=yes -TYPE=Ethernet -BOOTPROTO=none -MTU=1500 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:812" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Simulate interface-reconfigure creating xapi3, so that we can tell -# interface-reconfigure to take it back down. -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:825: configure_netdev xapi3 00:23:20:AC:AF:02 0" -at_fn_check_prepare_trace "interface-reconfigure.at:825" -( $at_check_trace; configure_netdev xapi3 00:23:20:AC:AF:02 0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:825" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:827: ifr_run --force xapi3 down" -at_fn_check_prepare_trace "interface-reconfigure.at:827" -( $at_check_trace; ifr_run --force xapi3 down -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:827" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:828: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:828" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xapi3 down -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_down: xapi3 -/sbin/ifdown xapi3 -deconfigure ipdev xapi3 on xenbr3 -deconfigure_bridge: bridge - xapi3 -action_down: no more masters, bring down slave xenbr3 -deconfigure_bridge: bridge - xenbr3 -action_down: bring down physical devices - [u'eth3'] -/sbin/ifconfig eth3 down -/usr/bin/ovs-vsctl --timeout=20 - --with-iface --if-exists del-port xapi3 - --if-exists del-br xapi3 - --if-exists del-br xenbr3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:828" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1471 -#AT_START_1472 -at_fn_group_banner 1472 'interface-reconfigure.at:847' \ - "Bond, non-VLAN" " " 92 -at_xfail=no -( - $as_echo "1472. $at_setup_line: testing $at_desc ..." - $at_traceon - - -$as_echo "interface-reconfigure.at:849" >"$at_check_line_file" -($non_ascii_cwd) \ - && at_fn_check_skip 77 "$at_srcdir/interface-reconfigure.at:849" -ifr_setup - -# Pretend that bond0 exists, even though it would really be created by -# a "create-bond" call in an ovs-vsctl invocation within -# interface-reconfigure, because otherwise interface-reconfigure will -# die with "failed to apply changes: netdev: up: device bond0 does not -# exist" after it thinks it created bond0. -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:857: configure_netdev bond0 00:23:20:e6:39:75 0" -at_fn_check_prepare_trace "interface-reconfigure.at:857" -( $at_check_trace; configure_netdev bond0 00:23:20:e6:39:75 0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:857" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:859: ifr_run --force xapi1 up" -at_fn_check_prepare_trace "interface-reconfigure.at:859" -( $at_check_trace; ifr_run --force xapi1 up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:859" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:860: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:860" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xapi1 up -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_up: xapi1 -Writing network configuration for xapi1 -Configuring xapi1 using None configuration -configure_datapath: leaving bond bond0 up -configure_datapath: leaving bond bond0 up -configure_datapath: bridge - xapi1 -configure_datapath: physical - [u'eth0', u'eth1'] -configure_datapath: extra ports - [] -configure_datapath: extra bonds - [] -netdev: down: device xenbr0 does not exist, ignoring -netdev: down: device xenbr1 does not exist, ignoring -Applying changes to /etc/sysconfig/network-scripts/route-xapi1 configuration -Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration -/sbin/ifconfig eth0 up mtu 1500 -/sbin/ethtool -K eth0 gro off lro off -/usr/sbin/ovs-vlan-bug-workaround eth0 on -/sbin/ifconfig eth1 up mtu 1500 -/sbin/ethtool -K eth1 gro off lro off -/usr/sbin/ovs-vlan-bug-workaround eth1 off -/usr/bin/ovs-vsctl --timeout=20 - --if-exists del-br xenbr0 - --if-exists del-br xenbr1 - --with-iface --if-exists del-port eth0 - --with-iface --if-exists del-port eth1 - --may-exist add-br xapi1 - --with-iface --if-exists del-port bond0 - --fake-iface add-bond xapi1 bond0 eth0 eth1 - set Port bond0 MAC=\"00:22:19:22:4b:af\" other-config:bond-miimon-interval=100 bond_downdelay=200 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb - set Bridge xapi1 other-config:hwaddr=\"00:22:19:22:4b:af\" - set Bridge xapi1 fail_mode=secure - remove Bridge xapi1 other_config disable-in-band - br-set-external-id xapi1 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85 -/sbin/ifup xapi1 -action_up: bring up bond0 -/sbin/ifconfig bond0 up -/sbin/update-issue -Committing changes to /etc/sysconfig/network-scripts/route-xapi1 configuration -Committing changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:860" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:903: cat etc/sysconfig/network-scripts/ifcfg-xapi1" -at_fn_check_prepare_trace "interface-reconfigure.at:903" -( $at_check_trace; cat etc/sysconfig/network-scripts/ifcfg-xapi1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "# DO NOT EDIT: This file (ifcfg-xapi1) was autogenerated by interface-reconfigure -XEMANAGED=yes -DEVICE=xapi1 -ONBOOT=no -NOZEROCONF=yes -TYPE=Ethernet -BOOTPROTO=none -MTU=1500 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:903" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Simulate interface-reconfigure creating xapi1, so that we can tell -# interface-reconfigure to take it back down. -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:916: configure_netdev xapi1 00:22:19:22:4B:AF 0" -at_fn_check_prepare_trace "interface-reconfigure.at:916" -( $at_check_trace; configure_netdev xapi1 00:22:19:22:4B:AF 0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:916" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:918: ifr_run --force xapi1 down" -at_fn_check_prepare_trace "interface-reconfigure.at:918" -( $at_check_trace; ifr_run --force xapi1 down -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:918" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:919: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:919" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xapi1 down -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_down: xapi1 -/sbin/ifdown xapi1 -deconfigure ipdev xapi1 on xapi1 -deconfigure_bridge: bridge - xapi1 -action_down: bring down physical devices - [u'eth0', u'eth1'] -/sbin/ifconfig eth0 down -/sbin/ifconfig eth1 down -/usr/bin/ovs-vsctl --timeout=20 - --with-iface --if-exists del-port xapi1 - --if-exists del-br xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:919" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1472 -#AT_START_1473 -at_fn_group_banner 1473 'interface-reconfigure.at:936' \ - "VLAN on bond" " " 92 -at_xfail=no -( - $as_echo "1473. $at_setup_line: testing $at_desc ..." - $at_traceon - - -$as_echo "interface-reconfigure.at:938" >"$at_check_line_file" -($non_ascii_cwd) \ - && at_fn_check_skip 77 "$at_srcdir/interface-reconfigure.at:938" -ifr_setup - -# Pretend that bond0 exists, even though it would really be created by -# a "create-bond" call in an ovs-vsctl invocation within -# interface-reconfigure, because otherwise interface-reconfigure will -# die with "failed to apply changes: netdev: up: device bond0 does not -# exist" after it thinks it created bond0. -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:946: configure_netdev bond0 00:23:20:e6:39:75 0" -at_fn_check_prepare_trace "interface-reconfigure.at:946" -( $at_check_trace; configure_netdev bond0 00:23:20:e6:39:75 0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:946" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:948: ifr_run --force xapi2 up" -at_fn_check_prepare_trace "interface-reconfigure.at:948" -( $at_check_trace; ifr_run --force xapi2 up -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:948" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:949: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:949" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xapi2 up -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_up: xapi2 -Writing network configuration for xapi2 -Configuring xapi2 using None configuration -configure_datapath: leaving bond bond0 up -configure_datapath: leaving bond bond0 up -configure_datapath: bridge - xapi1 -configure_datapath: physical - [u'eth0', u'eth1'] -configure_datapath: extra ports - [] -configure_datapath: extra bonds - [] -netdev: down: device xenbr0 does not exist, ignoring -netdev: down: device xenbr1 does not exist, ignoring -Applying changes to /etc/sysconfig/network-scripts/route-xapi2 configuration -Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration -/sbin/ifconfig eth0 up mtu 1500 -/sbin/ethtool -K eth0 gro off lro off -/usr/sbin/ovs-vlan-bug-workaround eth0 on -/sbin/ifconfig eth1 up mtu 1500 -/sbin/ethtool -K eth1 gro off lro off -/usr/sbin/ovs-vlan-bug-workaround eth1 off -/usr/bin/ovs-vsctl --timeout=20 - --if-exists del-br xenbr0 - --if-exists del-br xenbr1 - --with-iface --if-exists del-port eth0 - --with-iface --if-exists del-port eth1 - --may-exist add-br xapi1 - --with-iface --if-exists del-port bond0 - --fake-iface add-bond xapi1 bond0 eth0 eth1 - set Port bond0 MAC=\"00:22:19:22:4b:af\" other-config:bond-miimon-interval=100 bond_downdelay=200 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb - set Bridge xapi1 other-config:hwaddr=\"00:22:19:22:4b:af\" - set Bridge xapi1 fail_mode=secure - remove Bridge xapi1 other_config disable-in-band - br-set-external-id xapi1 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85 - --if-exists del-br xapi2 - --may-exist add-br xapi2 xapi1 4 - br-set-external-id xapi2 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85 - set Interface xapi2 MAC=\"00:22:19:22:4b:af\" -/sbin/ifup xapi2 -action_up: bring up bond0 -/sbin/ifconfig bond0 up -/sbin/update-issue -Committing changes to /etc/sysconfig/network-scripts/route-xapi2 configuration -Committing changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:949" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:996: cat etc/sysconfig/network-scripts/ifcfg-xapi2" -at_fn_check_prepare_trace "interface-reconfigure.at:996" -( $at_check_trace; cat etc/sysconfig/network-scripts/ifcfg-xapi2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "# DO NOT EDIT: This file (ifcfg-xapi2) was autogenerated by interface-reconfigure -XEMANAGED=yes -DEVICE=xapi2 -ONBOOT=no -NOZEROCONF=yes -TYPE=Ethernet -BOOTPROTO=none -MTU=1500 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:996" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Simulate interface-reconfigure creating xapi2, so that we can tell -# interface-reconfigure to take it back down. -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1009: configure_netdev xapi2 00:23:20:A4:71:C2 0" -at_fn_check_prepare_trace "interface-reconfigure.at:1009" -( $at_check_trace; configure_netdev xapi2 00:23:20:A4:71:C2 0 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1009" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1011: ifr_run --force xapi2 down" -at_fn_check_prepare_trace "interface-reconfigure.at:1011" -( $at_check_trace; ifr_run --force xapi2 down -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1011" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1012: ifr_filter" -at_fn_check_prepare_trace "interface-reconfigure.at:1012" -( $at_check_trace; ifr_filter -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Force interface xapi2 down -Loading xapi database cache from /var/xapi/network.dbcache -Configured for Vswitch datapath -action_down: xapi2 -/sbin/ifdown xapi2 -deconfigure ipdev xapi2 on xapi1 -deconfigure_bridge: bridge - xapi2 -action_down: no more masters, bring down slave xapi1 -deconfigure_bridge: bridge - xapi1 -action_down: bring down physical devices - [u'eth0', u'eth1'] -/sbin/ifconfig eth0 down -/sbin/ifconfig eth1 down -/usr/bin/ovs-vsctl --timeout=20 - --with-iface --if-exists del-port xapi2 - --if-exists del-br xapi2 - --if-exists del-br xapi1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1012" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1473 -#AT_START_1474 -at_fn_group_banner 1474 'interface-reconfigure.at:1036' \ - "Re-create port with different types" " " 92 -at_xfail=no -( - $as_echo "1474. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - OVS_LOGDIR=`pwd`; export OVS_LOGDIR - OVS_DBDIR=`pwd`; export OVS_DBDIR - OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR - trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat ovsdb-server.pid ovs-vswitchd.pid` -EOF - - - touch .conf.db.~lock~ - { set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1038: ovsdb-tool create conf.db \$abs_top_srcdir/vswitchd/vswitch.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema" "interface-reconfigure.at:1038" -( $at_check_trace; ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1038" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1038: ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:\$OVS_RUNDIR/db.sock" -at_fn_check_prepare_dynamic "ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock" "interface-reconfigure.at:1038" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1038" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1038: sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'" -at_fn_check_prepare_notrace 'an embedded newline' "interface-reconfigure.at:1038" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1038" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1038: ovs-vsctl --no-wait init" -at_fn_check_prepare_trace "interface-reconfigure.at:1038" -( $at_check_trace; ovs-vsctl --no-wait init -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1038: ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif" -at_fn_check_prepare_trace "interface-reconfigure.at:1038" -( $at_check_trace; ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy --disable-system --log-file -vvconn -vofproto_dpif -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1038: sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d'" -at_fn_check_prepare_notrace 'an embedded newline' "interface-reconfigure.at:1038" -( $at_check_trace; sed < stderr ' -/vlog|INFO|opened log file/d -/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d -/reconnect|INFO|/d -/ofproto|INFO|using datapath ID/d -/ofproto|INFO|datapath ID changed to fedcba9876543210/d' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1038: ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p0 -- set int p0 type=gre options:remote_ip=127.0.0.1 -- \\ - add-port br0 p1 -- set int p1 type=dummy -- \\ - add-port br0 p2 -- set int p2 type=dummy " -at_fn_check_prepare_notrace 'an embedded newline' "interface-reconfigure.at:1038" -( $at_check_trace; ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 protocols=[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15] fail-mode=secure -- add-port br0 p0 -- set int p0 type=gre options:remote_ip=127.0.0.1 -- \ - add-port br0 p1 -- set int p1 type=dummy -- \ - add-port br0 p2 -- set int p2 type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1038" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1043: ovs-vsctl set int p1 type=gre options:remote_ip=127.0.0.1" -at_fn_check_prepare_trace "interface-reconfigure.at:1043" -( $at_check_trace; ovs-vsctl set int p1 type=gre options:remote_ip=127.0.0.1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1043" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1044: ovs-vsctl del-port p1" -at_fn_check_prepare_trace "interface-reconfigure.at:1044" -( $at_check_trace; ovs-vsctl del-port p1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1044" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/interface-reconfigure.at:1045: ovs-vsctl add-port br0 p1 -- set int p1 type=dummy" -at_fn_check_prepare_trace "interface-reconfigure.at:1045" -( $at_check_trace; ovs-vsctl add-port br0 p1 -- set int p1 type=dummy -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/interface-reconfigure.at:1045" -$at_failed && at_fn_log_failure \ -"ovsdb-server.log" \ -"ovs-vswitchd.log" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1474 -#AT_START_1475 -at_fn_group_banner 1475 'stp.at:3' \ - "STP example from IEEE 802.1D-1998" " " 93 -at_xfail=no -( - $as_echo "1475. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-ieee802.1d-1998 <<'_ATEOF' -bridge 0 0x42 = a b -bridge 1 0x97 = c:5 a d:5 -bridge 2 0x45 = b e -bridge 3 0x57 = b:5 e:5 -bridge 4 0x83 = a:5 e:5 -run 1000 -check 0 = root -check 1 = F F:10 F -check 2 = F:10 B -check 3 = F:5 F -check 4 = F:5 B -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:18: ovstest test-stp test-stp-ieee802.1d-1998" -at_fn_check_prepare_trace "stp.at:18" -( $at_check_trace; ovstest test-stp test-stp-ieee802.1d-1998 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp42: detected topology change. -stp|INFO|stp42: detected topology change. -stp|INFO|stp97: detected topology change. -stp|INFO|stp97: detected topology change. -stp|INFO|stp97: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:18" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1475 -#AT_START_1476 -at_fn_group_banner 1476 'stp.at:27' \ - "STP example from IEEE 802.1D-2004 figures 17.4 and 17.5" "" 93 -at_xfail=no -( - $as_echo "1476. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-ieee802.1d-2004-fig17.4 <<'_ATEOF' -bridge 0 0x111 = a b e c -bridge 1 0x222 = a b d f -bridge 2 0x333 = c d l j h g -bridge 3 0x444 = e f n m k i -bridge 4 0x555 = g i 0 0 -bridge 5 0x666 = h k 0 0 -bridge 6 0x777 = j m 0 0 -bridge 7 0x888 = l n 0 0 -run 1000 -check 0 = root -check 1 = F:10 B F F -check 2 = F:10 B F F F F -check 3 = F:10 B F F F F -check 4 = F:20 B F F -check 5 = F:20 B F F -check 6 = F:20 B F F -check 7 = F:20 B F F - -# Now connect two ports of bridge 7 to the same LAN. -bridge 7 = l n o o -# Same results except for bridge 7: -run 1000 -check 0 = root -check 1 = F:10 B F F -check 2 = F:10 B F F F F -check 3 = F:10 B F F F F -check 4 = F:20 B F F -check 5 = F:20 B F F -check 6 = F:20 B F F -check 7 = F:20 B F B -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:61: ovstest test-stp test-stp-ieee802.1d-2004-fig17.4" -at_fn_check_prepare_trace "stp.at:61" -( $at_check_trace; ovstest test-stp test-stp-ieee802.1d-2004-fig17.4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp222: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:61" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1476 -#AT_START_1477 -at_fn_group_banner 1477 'stp.at:70' \ - "STP example from IEEE 802.1D-2004 figure 17.6" " " 93 -at_xfail=no -( - $as_echo "1477. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-ieee802.1d-2004-fig17.6 <<'_ATEOF' -bridge 0 0x111 = a b l -bridge 1 0x222 = b c d -bridge 2 0x333 = d e f -bridge 3 0x444 = f g h -bridge 4 0x555 = j h i -bridge 5 0x666 = l j k -run 1000 -check 0 = root -check 1 = F:10 F F -check 2 = F:20 F F -check 3 = F:30 F B -check 4 = F:20 F F -check 5 = F:10 F F -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:87: ovstest test-stp test-stp-ieee802.1d-2004-fig17.6" -at_fn_check_prepare_trace "stp.at:87" -( $at_check_trace; ovstest test-stp test-stp-ieee802.1d-2004-fig17.6 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp222: detected topology change. -stp|INFO|stp222: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:87" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1477 -#AT_START_1478 -at_fn_group_banner 1478 'stp.at:96' \ - "STP example from IEEE 802.1D-2004 figure 17.7" " " 93 -at_xfail=no -( - $as_echo "1478. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-ieee802.1d-2004-fig17.7 <<'_ATEOF' -bridge 0 0xaa = b -bridge 1 0x111 = a b d f h g e c -bridge 2 0x222 = g h j l n m k i -run 1000 -check 0 = root -check 1 = F F:10 F F F F F F -check 2 = B F:20 F F F F F F - -# This is not the port priority change described in that figure, -# but I don't understand what port priority change would cause -# that change. -bridge 2 = g X j l n m k i -run 1000 -check 0 = root -check 1 = F F:10 F F F F F F -check 2 = F:20 D F F F F F F -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:116: ovstest test-stp test-stp-ieee802.1d-2004-fig17.7" -at_fn_check_prepare_trace "stp.at:116" -( $at_check_trace; ovstest test-stp test-stp-ieee802.1d-2004-fig17.7 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stpaa: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:116" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1478 -#AT_START_1479 -at_fn_group_banner 1479 'stp.at:125' \ - "STP.io.1.1: Link Failure" " " 93 -at_xfail=no -( - $as_echo "1479. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-io-1.1 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Interoperability Test Suite -# Version 1.5": -# -# STP.io.1.1: Link Failure -bridge 0 0x111 = a b c -bridge 1 0x222 = a b c -run 1000 -check 0 = root -check 1 = F:10 B B -bridge 1 = 0 _ _ -run 1000 -check 0 = root -check 1 = F F:10 B -bridge 1 = X _ _ -run 1000 -check 0 = root -check 1 = D F:10 B -bridge 1 = _ 0 _ -run 1000 -check 0 = root -check 1 = D F F:10 -bridge 1 = _ X _ -run 1000 -check 0 = root -check 1 = D D F:10 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:155: ovstest test-stp test-stp-iol-io-1.1" -at_fn_check_prepare_trace "stp.at:155" -( $at_check_trace; ovstest test-stp test-stp-iol-io-1.1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp222: detected topology change. -stp|INFO|stp111: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:155" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1479 -#AT_START_1480 -at_fn_group_banner 1480 'stp.at:164' \ - "STP.io.1.2: Repeated Network" " " 93 -at_xfail=no -( - $as_echo "1480. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-io-1.2 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Interoperability Test Suite -# Version 1.5": -# STP.io.1.2: Repeated Network -bridge 0 0x111 = a a -bridge 1 0x222 = a a -run 1000 -check 0 = rootid:0x111 F B -check 1 = rootid:0x111 F:10 B -bridge 1 = a^0x90 _ -run 1000 -check 0 = rootid:0x111 F B -check 1 = rootid:0x111 B F:10 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:181: ovstest test-stp test-stp-iol-io-1.2" -at_fn_check_prepare_trace "stp.at:181" -( $at_check_trace; ovstest test-stp test-stp-iol-io-1.2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp111: detected topology change. -stp|INFO|stp222: detected topology change. -stp|INFO|stp111: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:181" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1480 -#AT_START_1481 -at_fn_group_banner 1481 'stp.at:188' \ - "STP.io.1.4: Network Initialization" " " 93 -at_xfail=no -( - $as_echo "1481. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-io-1.4 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Interoperability Test Suite -# Version 1.5": -# STP.io.1.4: Network Initialization -bridge 0 0x111 = a b c -bridge 1 0x222 = b d e -bridge 2 0x333 = a d f -bridge 3 0x444 = c e f -run 1000 -check 0 = root -check 1 = F:10 F F -check 2 = F:10 B F -check 3 = F:10 B B -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:205: ovstest test-stp test-stp-iol-io-1.4" -at_fn_check_prepare_trace "stp.at:205" -( $at_check_trace; ovstest test-stp test-stp-iol-io-1.4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp222: detected topology change. -stp|INFO|stp222: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:205" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1481 -#AT_START_1482 -at_fn_group_banner 1482 'stp.at:214' \ - "STP.io.1.5: Topology Change" " " 93 -at_xfail=no -( - $as_echo "1482. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-io-1.5 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Interoperability Test Suite -# Version 1.5": -# STP.io.1.5: Topology Change -bridge 0 0x111 = a b d c -bridge 1 0x222 = a b f e -bridge 2 0x333 = c d g h -bridge 3 0x444 = e f g h -run 1000 -check 0 = root -check 1 = F:10 B F F -check 2 = B F:10 F F -check 3 = B F:20 B B -bridge 1^0x7000 -run 1000 -check 0 = F:10 B F F -check 1 = root -check 2 = B F:20 B B -check 3 = B F:10 F F -bridge 2^0x6000 -run 1000 -check 0 = F F B F:10 -check 1 = F:20 B B B -check 2 = root -check 3 = F F F:10 B -bridge 3^0x5000 -run 1000 -check 0 = B B B F:20 -check 1 = F F B F:10 -check 2 = F F F:10 B -check 3 = root -bridge 0^0x4000 -bridge 1^0x4001 -bridge 2^0x4002 -bridge 3^0x4003 -run 1000 -check 0 = root -check 1 = F:10 B F F -check 2 = B F:10 F F -check 3 = B F:20 B B -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:258: ovstest test-stp test-stp-iol-io-1.5" -at_fn_check_prepare_trace "stp.at:258" -( $at_check_trace; ovstest test-stp test-stp-iol-io-1.5 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp222: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:258" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1482 -#AT_START_1483 -at_fn_group_banner 1483 'stp.at:267' \ - "STP.op.1.1 and STP.op.1.2" " " 93 -at_xfail=no -( - $as_echo "1483. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-op-1.1 <<'_ATEOF' -# This test file approximates the following tests from "Bridge -# Functions Consortium Spanning Tree Protocol Operations Test Suite -# Version 2.3": -# Test STP.op.1.1: Root ID Initialized to Bridge ID -# Test STP.op.1.2: Root Path Cost Initialized to Zero -bridge 0 0x123 = -check 0 = root -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:278: ovstest test-stp test-stp-iol-op-1.1" -at_fn_check_prepare_trace "stp.at:278" -( $at_check_trace; ovstest test-stp test-stp-iol-op-1.1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:278" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1483 -#AT_START_1484 -at_fn_group_banner 1484 'stp.at:281' \ - "STP.op.1.4: All Ports Initialized to Designated Ports" "" 93 -at_xfail=no -( - $as_echo "1484. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-op-1.4 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Protocol Operations Test Suite -# Version 2.3": -# Test STP.op.1.4: All Ports Initialized to Designated Ports -bridge 0 0x123 = a b c d e f -check 0 = Li Li Li Li Li Li -run 1000 -check 0 = F F F F F F -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:293: ovstest test-stp test-stp-iol-op-1.4" -at_fn_check_prepare_trace "stp.at:293" -( $at_check_trace; ovstest test-stp test-stp-iol-op-1.4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp123: detected topology change. -stp|INFO|stp123: detected topology change. -stp|INFO|stp123: detected topology change. -stp|INFO|stp123: detected topology change. -stp|INFO|stp123: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1484 -#AT_START_1485 -at_fn_group_banner 1485 'stp.at:302' \ - "STP.op.3.1: Root Bridge Selection: Root ID Values" "" 93 -at_xfail=no -( - $as_echo "1485. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-op-3.1 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Protocol Operations Test Suite -# Version 2.3": -# Test STP.op.3.1: Root Bridge Selection: Root ID Values -bridge 0 0x111 = a -bridge 1 0x222 = a -check 0 = rootid:0x111 Li -check 1 = rootid:0x222 Li -run 1000 -check 0 = rootid:0x111 root -check 1 = rootid:0x111 F:10 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:317: ovstest test-stp test-stp-iol-op-3.1" -at_fn_check_prepare_trace "stp.at:317" -( $at_check_trace; ovstest test-stp test-stp-iol-op-3.1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp111: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:317" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1485 -#AT_START_1486 -at_fn_group_banner 1486 'stp.at:322' \ - "STP.op.3.3: Root Bridge Selection: Bridge ID Values" "" 93 -at_xfail=no -( - $as_echo "1486. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-op-3.3 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Protocol Operations Test Suite -# Version 2.3": -# Test STP.op.3.3: Root Bridge Selection: Bridge ID Values -bridge 0 0x333^0x6000 = a -bridge 1 0x222^0x7000 = b -bridge 2 0x111 = a b -run 1000 -check 0 = rootid:0x333^0x6000 root -check 1 = rootid:0x333^0x6000 F:20 -check 2 = rootid:0x333^0x6000 F:10 F -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:337: ovstest test-stp test-stp-iol-op-3.3" -at_fn_check_prepare_trace "stp.at:337" -( $at_check_trace; ovstest test-stp test-stp-iol-op-3.3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp333: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp333: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:337" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1486 -#AT_START_1487 -at_fn_group_banner 1487 'stp.at:345' \ - "STP.op.3.3: Root Bridge Selection: Bridge ID Values" "" 93 -at_xfail=no -( - $as_echo "1487. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >test-stp-iol-op-3.4 <<'_ATEOF' -# This test file approximates the following test from "Bridge -# Functions Consortium Spanning Tree Protocol Operations Test Suite -# Version 2.3": -# Test STP.op.3.3: Root Bridge Selection: Bridge ID Values -bridge 0 0x333^0x6000 = a -bridge 1 0x222^0x7000 = b -bridge 2 0x111 = a b -run 1000 -check 0 = rootid:0x333^0x6000 root -check 1 = rootid:0x333^0x6000 F:20 -check 2 = rootid:0x333^0x6000 F:10 F -_ATEOF - -{ set +x -$as_echo "$at_srcdir/stp.at:360: ovstest test-stp test-stp-iol-op-3.4" -at_fn_check_prepare_trace "stp.at:360" -( $at_check_trace; ovstest test-stp test-stp-iol-op-3.4 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "stp|INFO|stp333: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp111: detected topology change. -stp|INFO|stp333: detected topology change. -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/stp.at:360" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1487 -#AT_START_1488 -at_fn_group_banner 1488 'vlog.at:3' \ - "vlog - Python" " " 94 -at_xfail=no -( - $as_echo "1488. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "vlog.at:4" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/vlog.at:4" - - -{ set +x -$as_echo "$at_srcdir/vlog.at:7: \$PYTHON \$srcdir/test-vlog.py --log-file log_file \\ --v dbg module_1:info module_2:warn syslog:off 2>stderr_log" -at_fn_check_prepare_notrace 'an embedded newline' "vlog.at:7" -( $at_check_trace; $PYTHON $srcdir/test-vlog.py --log-file log_file \ --v dbg module_1:info module_2:warn syslog:off 2>stderr_log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:7" -$at_failed && at_fn_log_failure \ -"log_file" \ -"stderr_log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/vlog.at:10: sed -e 's/.*-.*-.*T..:..:..Z |//' \\ --e 's/File \".*\", line [0-9][0-9]*,/File , line ,/' \\ -stderr_log" -at_fn_check_prepare_notrace 'an embedded newline' "vlog.at:10" -( $at_check_trace; sed -e 's/.*-.*-.*T..:..:..Z |//' \ --e 's/File ".*", line [0-9][0-9]*,/File , line ,/' \ -stderr_log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " 0 | module_0 | EMER | emergency - 1 | module_0 | ERR | error - 2 | module_0 | WARN | warning - 3 | module_0 | INFO | information - 4 | module_0 | DBG | debug - 5 | module_0 | EMER | emergency exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 6 | module_0 | ERR | error exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 7 | module_0 | WARN | warn exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 8 | module_0 | INFO | information exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 9 | module_0 | DBG | debug exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 10 | module_0 | ERR | exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 11 | module_1 | EMER | emergency - 12 | module_1 | ERR | error - 13 | module_1 | WARN | warning - 14 | module_1 | INFO | information - 16 | module_1 | EMER | emergency exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 17 | module_1 | ERR | error exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 18 | module_1 | WARN | warn exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 19 | module_1 | INFO | information exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 21 | module_1 | ERR | exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 22 | module_2 | EMER | emergency - 23 | module_2 | ERR | error - 24 | module_2 | WARN | warning - 27 | module_2 | EMER | emergency exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 28 | module_2 | ERR | error exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 29 | module_2 | WARN | warn exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError - 32 | module_2 | ERR | exception -Traceback (most recent call last): - File , line , in main - assert fail -AssertionError -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:10" -$at_failed && at_fn_log_failure \ -"log_file" \ -"stderr_log" -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1488 -#AT_START_1489 -at_fn_group_banner 1489 'vlog.at:104' \ - "vlog - vlog/reopen - Python" " " 94 -at_xfail=no -( - $as_echo "1489. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "vlog.at:105" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/vlog.at:105" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-unixctl.py.pid` -EOF - - - - -{ set +x -$as_echo "$at_srcdir/vlog.at:114: \$PYTHON \$srcdir/test-unixctl.py --log-file=\`pwd\`/log --pidfile --detach" -at_fn_check_prepare_notrace 'a `...` command substitution' "vlog.at:114" -( $at_check_trace; $PYTHON $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:114" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/vlog.at:116: ovs-appctl --timeout 20 -t test-unixctl.py log message" -at_fn_check_prepare_trace "vlog.at:116" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py log message -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:116" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - -mv log log.old -{ set +x -$as_echo "$at_srcdir/vlog.at:118: ovs-appctl --timeout 20 -t test-unixctl.py log message2" -at_fn_check_prepare_trace "vlog.at:118" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py log message2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:118" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:119: ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen" -at_fn_check_prepare_trace "vlog.at:119" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:119" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:120: ovs-appctl --timeout 20 -t test-unixctl.py log message3" -at_fn_check_prepare_trace "vlog.at:120" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py log message3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:120" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:121: ovs-appctl --timeout 20 -t test-unixctl.py exit" -at_fn_check_prepare_trace "vlog.at:121" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:121" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/vlog.at:123: sed 's/.*|//' log.old" -at_fn_check_prepare_notrace 'a shell pipeline' "vlog.at:123" -( $at_check_trace; sed 's/.*|//' log.old -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Entering run loop. - message - message2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:123" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:128: sed 's/.*|//' log" -at_fn_check_prepare_notrace 'a shell pipeline' "vlog.at:128" -( $at_check_trace; sed 's/.*|//' log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " message3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:128" -$at_failed && at_fn_log_failure \ -"log" \ -"log.old" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1489 -#AT_START_1490 -at_fn_group_banner 1490 'vlog.at:133' \ - "vlog - vlog/reopen without log file - Python" " " 94 -at_xfail=no -( - $as_echo "1490. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "vlog.at:134" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/vlog.at:134" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-unixctl.py.pid` -EOF - - -{ set +x -$as_echo "$at_srcdir/vlog.at:141: \$PYTHON \$srcdir/test-unixctl.py --pidfile --detach" -at_fn_check_prepare_dynamic "$PYTHON $srcdir/test-unixctl.py --pidfile --detach" "vlog.at:141" -( $at_check_trace; $PYTHON $srcdir/test-unixctl.py --pidfile --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:141" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/vlog.at:143: ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen" -at_fn_check_prepare_trace "vlog.at:143" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Logging to file not configured -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:143" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1490 -#AT_START_1491 -at_fn_group_banner 1491 'vlog.at:151' \ - "vlog - vlog/reopen can't reopen log file - Python" "" 94 -at_xfail=no -( - $as_echo "1491. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "vlog.at:152" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/vlog.at:152" - -# Verify that /dev/full is a character device that fails writes. -$as_echo "vlog.at:155" >"$at_check_line_file" -(test ! -c /dev/full) \ - && at_fn_check_skip 77 "$at_srcdir/vlog.at:155" -$as_echo "vlog.at:156" >"$at_check_line_file" -(echo > /dev/full) \ - && at_fn_check_skip 77 "$at_srcdir/vlog.at:156" - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-unixctl.py.pid` -EOF - - -{ set +x -$as_echo "$at_srcdir/vlog.at:164: \$PYTHON \$srcdir/test-unixctl.py --log-file=\`pwd\`/log --pidfile --detach" -at_fn_check_prepare_notrace 'a `...` command substitution' "vlog.at:164" -( $at_check_trace; $PYTHON $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:164" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:165: ovs-appctl --timeout 20 -t test-unixctl.py log message" -at_fn_check_prepare_trace "vlog.at:165" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py log message -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - -mv log log.old -ln -s /dev/full log -{ set +x -$as_echo "$at_srcdir/vlog.at:168: ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen" -at_fn_check_prepare_trace "vlog.at:168" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:168" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:169: ovs-appctl --timeout 20 -t test-unixctl.py log message2" -at_fn_check_prepare_trace "vlog.at:169" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py log message2 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:169" -$at_failed && at_fn_log_failure -$at_traceon; } - -rm log -{ set +x -$as_echo "$at_srcdir/vlog.at:171: ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen" -at_fn_check_prepare_trace "vlog.at:171" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/reopen -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:171" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:172: ovs-appctl --timeout 20 -t test-unixctl.py log message3" -at_fn_check_prepare_trace "vlog.at:172" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py log message3 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:172" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:173: ovs-appctl --timeout 20 -t test-unixctl.py exit" -at_fn_check_prepare_trace "vlog.at:173" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:173" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:174: sed 's/.*|//' log.old" -at_fn_check_prepare_notrace 'a shell pipeline' "vlog.at:174" -( $at_check_trace; sed 's/.*|//' log.old -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " Entering run loop. - message -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:174" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:178: sed 's/.*|//' log" -at_fn_check_prepare_notrace 'a shell pipeline' "vlog.at:178" -( $at_check_trace; sed 's/.*|//' log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " message3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:178" -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1491 -#AT_START_1492 -at_fn_group_banner 1492 'vlog.at:183' \ - "vlog - vlog/set and vlog/list - Python" " " 94 -at_xfail=no -( - $as_echo "1492. $at_setup_line: testing $at_desc ..." - $at_traceon - -$as_echo "vlog.at:184" >"$at_check_line_file" -(test $HAVE_PYTHON = no) \ - && at_fn_check_skip 77 "$at_srcdir/vlog.at:184" -OVS_RUNDIR=`pwd`; export OVS_RUNDIR -OVS_LOGDIR=`pwd`; export OVS_LOGDIR -OVS_DBDIR=`pwd`; export OVS_DBDIR -OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR -trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -kill `cat test-unixctl.py.pid` -EOF - - - -{ set +x -$as_echo "$at_srcdir/vlog.at:192: \$PYTHON \$srcdir/test-unixctl.py --log-file=\`pwd\`/log --pidfile --detach" -at_fn_check_prepare_notrace 'a `...` command substitution' "vlog.at:192" -( $at_check_trace; $PYTHON $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile --detach -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:192" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/vlog.at:194: ovs-appctl --timeout 20 -t test-unixctl.py vlog/list" -at_fn_check_prepare_trace "vlog.at:194" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/list -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " console syslog file - ------- ------ ------ -daemon info info info -fatal-signal info info info -jsonrpc info info info -poller info info info -reconnect info info info -socket_util info info info -stream info info info -test-unixctl info info info -unixctl_server info info info -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:194" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/vlog.at:208: ovs-appctl --timeout 20 -t test-unixctl.py vlog/set daemon:syslog:err" -at_fn_check_prepare_trace "vlog.at:208" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/set daemon:syslog:err -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:208" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:209: ovs-appctl --timeout 20 -t test-unixctl.py vlog/set file:dbg" -at_fn_check_prepare_trace "vlog.at:209" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/set file:dbg -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:209" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:210: ovs-appctl --timeout 20 -t test-unixctl.py vlog/set nonexistent" -at_fn_check_prepare_trace "vlog.at:210" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/set nonexistent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "no facility, level, or module \"nonexistent\" -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:210" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:213: ovs-appctl --timeout 20 -t test-unixctl.py vlog/list" -at_fn_check_prepare_trace "vlog.at:213" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/list -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " console syslog file - ------- ------ ------ -daemon info err dbg -fatal-signal info info dbg -jsonrpc info info dbg -poller info info dbg -reconnect info info dbg -socket_util info info dbg -stream info info dbg -test-unixctl info info dbg -unixctl_server info info dbg -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:213" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/vlog.at:227: ovs-appctl --timeout 20 -t test-unixctl.py vlog/set pattern" -at_fn_check_prepare_trace "vlog.at:227" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/set pattern -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Please supply a valid pattern and facility -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:227" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:230: ovs-appctl --timeout 20 -t test-unixctl.py vlog/set pattern:nonexistent" -at_fn_check_prepare_trace "vlog.at:230" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/set pattern:nonexistent -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Facility nonexistent does not exist -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:230" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:233: ovs-appctl --timeout 20 -t test-unixctl.py vlog/set pattern:file:'I<3OVS|%m'" -at_fn_check_prepare_notrace 'a shell pipeline' "vlog.at:233" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py vlog/set pattern:file:'I<3OVS|%m' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:233" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:234: ovs-appctl --timeout 20 -t test-unixctl.py log patterntest" -at_fn_check_prepare_trace "vlog.at:234" -( $at_check_trace; ovs-appctl --timeout 20 -t test-unixctl.py log patterntest -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:234" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vlog.at:235: grep -q 'I<3OVS' log" -at_fn_check_prepare_trace "vlog.at:235" -( $at_check_trace; grep -q 'I<3OVS' log -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vlog.at:235" -$at_failed && at_fn_log_failure \ -"log" -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1492 -#AT_START_1493 -at_fn_group_banner 1493 'vtep-ctl.at:136' \ - "add-ps a" " " 95 -at_xfail=no -( - $as_echo "1493. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:138: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:138" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:138" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:138: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:138" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:138" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:138: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:138" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:138" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:139: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:139" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:139" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:139: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:139" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:139" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:139: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:139" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:139" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:140" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:140" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:140" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:140" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:140: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:140" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:140" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:141: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:141" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:141" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:141: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:141" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:141" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1493 -#AT_START_1494 -at_fn_group_banner 1494 'vtep-ctl.at:144' \ - "add-ps a, add-ps a" " " 95 -at_xfail=no -( - $as_echo "1494. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:146: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:146" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:146: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:146" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:146: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:146" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:146" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:147: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:147" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:147" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:147: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:147" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:147" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:147: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:147" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:147" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:148: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:148" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "vtep-ctl: cannot create physical switch a because it already exists -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/vtep-ctl.at:148" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:148: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:148" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:148" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:148: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:148" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:148" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:151: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:151" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:151" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:151: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:151" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:151" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1494 -#AT_START_1495 -at_fn_group_banner 1495 'vtep-ctl.at:154' \ - "add-ps a, add-ps b" " " 95 -at_xfail=no -( - $as_echo "1495. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:156: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:156" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:156: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:156" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:156: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:156" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:156" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:157: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:157" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:157" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:157: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:157" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:157" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:157: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:157" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:157" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:159" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:159" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a\\nb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:159" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:159" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:159" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:159: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:159" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:159" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:160: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:160" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:160" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:160: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:160" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:160" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1495 -#AT_START_1496 -at_fn_group_banner 1496 'vtep-ctl.at:163' \ - "add-ps a, add-ps b, del-ps a" " " 95 -at_xfail=no -( - $as_echo "1496. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:165: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:165" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:165: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:165" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:165: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:165" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:165" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:166: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ps a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:166" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ps a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:166" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:166: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:166" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:166" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:166: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:166" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:166" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:168" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:168" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:168" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:168" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:168: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:168" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:168" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:169: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:169" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:169" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:169: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:169" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:169" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1496 -#AT_START_1497 -at_fn_group_banner 1497 'vtep-ctl.at:172' \ - "add-ps a, del-ps a, add-ps a" " " 95 -at_xfail=no -( - $as_echo "1497. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:174: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:174" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:174" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:174: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:174" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:174" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:174: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:174" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:174" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:175: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- add-ps a -- del-ps a -- add-ps a" -at_fn_check_prepare_trace "vtep-ctl.at:175" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- add-ps a -- del-ps a -- add-ps a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:175" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:175: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:175" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:175" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:175: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:175" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:175" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:182" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:182" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:182" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:182" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:182: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:182" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:182" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:183: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:183" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:183" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:183: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:183" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:183" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1497 -#AT_START_1498 -at_fn_group_banner 1498 'vtep-ctl.at:186' \ - "add-ps a, add-port a a1, add-port a a2" " " 95 -at_xfail=no -( - $as_echo "1498. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:188: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:188" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:188: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:188" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:188: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:188" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:188" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:189: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --if-exists del-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:189" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --if-exists del-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:189" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:189: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:189" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:189" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:189: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:189" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:189" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:194" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:194" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:194" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:194" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:194: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:194" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:194" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:195: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:195" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1 -a2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:195" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:195: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:195" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:195" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:195: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:195" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:195" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:195: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:195" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a1\\na2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:195" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:195: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:195" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:195" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:195: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:195" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:195" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:196: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:196" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:196" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:196: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:196" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:196" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1498 -#AT_START_1499 -at_fn_group_banner 1499 'vtep-ctl.at:199' \ - "add-ps a, add-port a a1, add-port a a1" " " 95 -at_xfail=no -( - $as_echo "1499. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:201: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:201" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:201: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:201" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:201: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:201" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:201" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:202: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:202" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:202" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:202: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:202" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:202" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:202: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:202" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:202" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:205: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:205" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "vtep-ctl: cannot create a port named a1 on a because a port with that name already exists -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/vtep-ctl.at:205" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:205: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:205" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:205" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:205: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:205" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:205" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:208: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:208" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:208" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:208: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:208" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:208" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1499 -#AT_START_1500 -at_fn_group_banner 1500 'vtep-ctl.at:211' \ - "add-ps a b, add-port a a1, add-port b b1, del-ps a" "" 95 -at_xfail=no -( - $as_echo "1500. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:213: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:213" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:213" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:213: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:213" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:213" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:213: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:213" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:213" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:214: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- add-ps a -- add-ps b -- add-port a a1 -- add-port b b1 -- --if-exists del-port b b2 -- del-ps a" -at_fn_check_prepare_trace "vtep-ctl.at:214" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- add-ps a -- add-ps b -- add-port a a1 -- add-port b b1 -- --if-exists del-port b b2 -- del-ps a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - - - - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:214" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:214: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:214" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:214" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:214: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:214" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:214" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:227" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:227" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:227" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:227" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:227: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:227" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:227" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:228: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:228" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:228" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:228: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:228" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:228: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:228" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:228" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:228: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:228" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:228" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:228: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:228" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:228" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:228: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:228" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:228" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:229: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:229" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:229" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:229: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:229" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:229" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1500 -#AT_START_1501 -at_fn_group_banner 1501 'vtep-ctl.at:232' \ - "add-ps a b, add-port a a1, add-port b b1, del-port a a1" "" 95 -at_xfail=no -( - $as_echo "1501. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:234: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:234" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:234" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:234: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:234" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:234" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:234: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:234" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:234" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:235: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --may-exist add-port b b1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-port a a1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:235" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a a1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --may-exist add-port b b1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-port a a1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:235" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:235: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:235" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:235" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:235: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:235" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:235" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:241: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --may-exist add-port b b1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:241" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --may-exist add-port b b1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:241" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:241: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:241" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:241" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:241: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:241" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:241" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:243" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:243" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a\\nb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:243" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:243" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:243" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:243: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:243" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:243" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:244: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:244" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:244" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:244: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:244" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:244" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:244: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:244" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:244" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:244: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:244" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:244" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:244: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:244" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:244" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:244: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:244" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:244" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:245: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:245" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:245" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:245: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:245" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:245" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:245: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:245" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:245" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:245: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:245" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:245" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:245: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:245" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:245" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:245: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:245" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:245" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:246: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:246" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:246" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:246: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:246" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:246" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1501 -#AT_START_1502 -at_fn_group_banner 1502 'vtep-ctl.at:249' \ - "add-ps a b, add-port a p1, add-port b p1, del-port a p1" "" 95 -at_xfail=no -( - $as_echo "1502. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:251: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:251" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:251: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:251" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:251: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:251" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:251" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:252: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a p1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port b p1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:252" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port a p1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port b p1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:252" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:252: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:252" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:252" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:252: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:252" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:252" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:257" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:257" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a\\nb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:257" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:257" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:257" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:257: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:257" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:257" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:258: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:258" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "p1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:258" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:258: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:258" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:258" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:258: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:258" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:258" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:258: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:258" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "p1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:258" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:258: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:258" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:258" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:258: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:258" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:258" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:259: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:259" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "p1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:259" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:259: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:259" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:259" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:259: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:259" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:259" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:259: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:259" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "p1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:259" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:259: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:259" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:259" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:259: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:259" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:259" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:260: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-port a p1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:260" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-port a p1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:260" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:260: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:260" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:260" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:260: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:260" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:260" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:262" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:262" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a\\nb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:262" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:262" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:262" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:262: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:262" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:262" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:263: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:263" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:263" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:263: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:263" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:263: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:263" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:263" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:263: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:263" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:263" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:263: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:263" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:263" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:263: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:263" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:263" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:264: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:264" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "p1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:264" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:264: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:264" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:264" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:264: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:264" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:264" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:264: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:264" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "p1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:264" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:264: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:264" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:264" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:264: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:264" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:264" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:265: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:265" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:265" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:265: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:265" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:265" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1502 -#AT_START_1503 -at_fn_group_banner 1503 'vtep-ctl.at:272' \ - "add-ls a" " " 96 -at_xfail=no -( - $as_echo "1503. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:274: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:274" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:274" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:274: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:274" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:274" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:274: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:274" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:274" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:275: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:275" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:275" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:275: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:275" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:275" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:275: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:275" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:275" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:276" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:276" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:276" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:276" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:276: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:276" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:276" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:277: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:277" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:277" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:277: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:277" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:277" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1503 -#AT_START_1504 -at_fn_group_banner 1504 'vtep-ctl.at:280' \ - "add-ls a, add-ls a" " " 96 -at_xfail=no -( - $as_echo "1504. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:282: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:282" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:282" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:282: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:282" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:282" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:282: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:282" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:282" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:283: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:283" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:283" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:283: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:283" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:283" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:283: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:283" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:283" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:284: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:284" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "vtep-ctl: cannot create logical switch a because it already exists -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/vtep-ctl.at:284" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:284: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:284" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:284" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:284: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:284" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:284" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:287: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:287" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:287" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:287: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:287" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:287" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1504 -#AT_START_1505 -at_fn_group_banner 1505 'vtep-ctl.at:290' \ - "add-ls a, add-ls b" " " 96 -at_xfail=no -( - $as_echo "1505. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:292: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:292" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:292" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:292: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:292" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:292" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:292: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:292" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:292" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:293: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:293" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:293" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:293: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:293" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:293" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:293: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:293" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:293" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:295" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:295" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a\\nb -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:295" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:295" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:295" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:295: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:295" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:295" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:296: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:296" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:296" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:296: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:296" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:296" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1505 -#AT_START_1506 -at_fn_group_banner 1506 'vtep-ctl.at:299' \ - "add-ls a, add-ls b, del-ls a" " " 96 -at_xfail=no -( - $as_echo "1506. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:301: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:301" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:301: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:301" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:301: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:301" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:301" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:302: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ls a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:302" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls a -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls b -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ls a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:302" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:302: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:302" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:302" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:302: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:302" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:302" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:304" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:304" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "b -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists b -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:304" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists b - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:304" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:304: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:304" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:304" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:305: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:305" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:305" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:305: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:305" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:305" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1506 -#AT_START_1507 -at_fn_group_banner 1507 'vtep-ctl.at:308' \ - "add-ls a, del-ls a, add-ls a" " " 96 -at_xfail=no -( - $as_echo "1507. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:310: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:310" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:310" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:310: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:310" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:310" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:310: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:310" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:310" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:311: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- add-ls a -- del-ls a -- add-ls a" -at_fn_check_prepare_trace "vtep-ctl.at:311" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- add-ls a -- del-ls a -- add-ls a -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:311" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:311: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:311" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:311" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:311: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:311" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:311" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:318" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:318" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "a -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists a -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:318" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists a - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:318" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:318: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:318" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:318" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:319: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:319" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:319" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:319: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:319" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:319" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1507 -#AT_START_1508 -at_fn_group_banner 1508 'vtep-ctl.at:326' \ - "bind-ls ps1 pp1 300 ls1" " " 97 -at_xfail=no -( - $as_echo "1508. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:328: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:328" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:328" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:328: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:328" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:328" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:328: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:328" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:328" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:329: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps1 pp1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:329" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps1 pp1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:329" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:329: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:329" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:329" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:329: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:329" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:329" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:333" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ps1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:333" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ps1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:333" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:333" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:333: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:333" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:333" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:334: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:334" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:334" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:334: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:334" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:334" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:334: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:334" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:334" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:334: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:334" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:334" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:334: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:334" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:334" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:334: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:334" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:334" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:335" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:335" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:335" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:335" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:335: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:335" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:335" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:336: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 300 ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:336" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 300 ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:336" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:336: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:336" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:336" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:336: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:336" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:336" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:338: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps1 pp1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:338" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps1 pp1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0300 ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:338" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:338: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:338" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:338" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:338: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:338" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:338" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:341: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:341" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:341" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:341: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:341" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:341" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1508 -#AT_START_1509 -at_fn_group_banner 1509 'vtep-ctl.at:344' \ - "bind-ls ps1 pp1 300 ls1, bind-ls ps1 pp1 400 ls2" "" 97 -at_xfail=no -( - $as_echo "1509. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:346: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:346" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:346" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:346: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:346" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:346" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:346: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:346" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:346" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:347: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps1 pp1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:347" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps1 pp1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:347" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:347: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:347" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:347" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:347: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:347" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:347" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:352" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ps1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:352" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ps1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:352" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:352" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:352: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:352" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:352" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:353: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:353" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:353" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:353: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:353" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:353" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:353: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:353" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:353" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:353: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:353" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:353" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:353: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:353" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:353" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:353: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:353" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:353" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:354" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -ls2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:354" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1\\nls2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:354" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:354" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:354" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:354: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:354" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:354" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:355: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 300 ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:355" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 300 ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:355" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:355: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:355" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:355" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:355: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:355" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:355" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:357: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 400 ls2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:357" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 400 ls2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:357" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:357: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:357" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:357" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:357: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:357" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:357" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:359: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps1 pp1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:359" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps1 pp1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0300 ls1 -0400 ls2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:359" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:359: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:359" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:359" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:359: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:359" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:359" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:363: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:363" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:363" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:363: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:363" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:363" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1509 -#AT_START_1510 -at_fn_group_banner 1510 'vtep-ctl.at:366' \ - "bind-ls ps1 pp1 300, bind-ls ps2 pp2 300 ls2" " " 97 -at_xfail=no -( - $as_echo "1510. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:368: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:368" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:368" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:368: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:368" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:368" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:368: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:368" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:368" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:369: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps2 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps1 pp1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps2 pp2 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:369" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ps ps2 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps1 pp1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-port ps2 pp2 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:369" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:369: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:369" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:369" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:369: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:369" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:369" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:376" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ps1 -ps2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:376" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ps - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ps1\\nps2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:376" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:376" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists ps2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:376" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ps-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:376: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:376" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:376" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:377: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:377" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:377" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:377: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:377" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:377" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:377: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:377" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:377" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:377: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:377" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:377" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:377: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:377" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:377" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:377: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:377" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:377" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:378: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:378" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ports ps2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:378" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:378: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:378" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:378" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:378: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:378" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:378" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:378: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:378" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ports ps2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "pp2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:378" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:378: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:378" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:378" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:378: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:378" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:378" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:379" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -ls2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:379" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1\\nls2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:379" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:379" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:379" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:379: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:379" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:379" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:380: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 300 ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:380" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps1 pp1 300 ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:380" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:380: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:380" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:380" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:380: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:380" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:380" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:382: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps2 pp2 300 ls2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:382" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket bind-ls ps2 pp2 300 ls2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:382" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:382: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:382" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:382" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:382: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:382" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:382" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:384: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps1 pp1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:384" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps1 pp1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0300 ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:384" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:384: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:384" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:384" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:384: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:384" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:384" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:387: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps2 pp2 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:387" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-bindings ps2 pp2 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "0300 ls2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:387" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:387: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:387" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:387" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:387: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:387" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:387" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:390: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:390" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:390" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:390: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:390" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:390" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1510 -#AT_START_1511 -at_fn_group_banner 1511 'vtep-ctl.at:397' \ - "add-ucast-local ls1" " " 98 -at_xfail=no -( - $as_echo "1511. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:399: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:399" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:399" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:399: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:399" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:399" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:399: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:399" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:399" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:400: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:400" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:400" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:400: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:400" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:400" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:400: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:400" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:400" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:402" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:402" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:402" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:402" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:402: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:402" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:402" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:403: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:403" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:403" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:403: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:403" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:403" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:403: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:403" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:403" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:407: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:407" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:407" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:407: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:407" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:407" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:407: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:407" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:407" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:415: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:415" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:415" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:415: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:415" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:415" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:415: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:415" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:415" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:421: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:421" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:421" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:421: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:421" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:421" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1511 -#AT_START_1512 -at_fn_group_banner 1512 'vtep-ctl.at:424' \ - "add-ucast-local ls1, overwrite" " " 98 -at_xfail=no -( - $as_echo "1512. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:426: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:426" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:426" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:426: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:426" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:426" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:426: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:426" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:426" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:427: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:427" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:427" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:427: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:427" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:427" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:427: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:427" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:427" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:429" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:429" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:429" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:429" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:429: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:429" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:429" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:430: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.11 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:430" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.11 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:430" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:430: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:430" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:430" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:430: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:430" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:430" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:434: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:434" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:434" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:434: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:434" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:434" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:434: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:434" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:434" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:441: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:441" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:441" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:441: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:441" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:441" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1512 -#AT_START_1513 -at_fn_group_banner 1513 'vtep-ctl.at:444' \ - "add-ucast-local ls1, del-ucast-local ls1" " " 98 -at_xfail=no -( - $as_echo "1513. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:446: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:446" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:446" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:446: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:446" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:446" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:446: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:446" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:446" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:447: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:447" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:447" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:447: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:447" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:447" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:447: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:447" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:447" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:449" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:449" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:449" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:449" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:449: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:449" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:449" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:450: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:450" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:450" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:450: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:450" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:450" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:450: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:450" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:450" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:454: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:454" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:454" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:454: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:454" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:454" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:454: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:454" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:454" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:462: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ucast-local ls1 00:11:22:33:44:55 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:462" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ucast-local ls1 00:11:22:33:44:55 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:462" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:462: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:462" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:462" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:462: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:462" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:462" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:465: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:465" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:465" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:465: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:465" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:465" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:465: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:465" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:465" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:472: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:472" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:472" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:472: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:472" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:472" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1513 -#AT_START_1514 -at_fn_group_banner 1514 'vtep-ctl.at:475' \ - "add-ucast-remote ls1" " " 98 -at_xfail=no -( - $as_echo "1514. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:477: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:477" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:477" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:477: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:477" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:477" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:477: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:477" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:477" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:478: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:478" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:478" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:478: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:478" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:478" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:478: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:478" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:478" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:480" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:480" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:480" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:480" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:480: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:480" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:480" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:481: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:481" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:481" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:481: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:481" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:481" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:481: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:481" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:481" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:485: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:485" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:485" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:485: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:485" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:485" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:485: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:485" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:485" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:493: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:493" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:493" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:493: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:493" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:493" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:493: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:493" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:493" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:499: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:499" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:499" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:499: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:499" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:499" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1514 -#AT_START_1515 -at_fn_group_banner 1515 'vtep-ctl.at:502' \ - "add-ucast-remote ls1, overwrite" " " 98 -at_xfail=no -( - $as_echo "1515. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:504: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:504" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:504: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:504" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:504: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:504" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:504" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:505: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:505" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:505" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:505: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:505" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:505" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:505: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:505" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:505" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:507" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:507" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:507" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:507" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:507: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:507" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:507" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:508: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.11 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:508" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.11 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:508" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:508: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:508" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:508" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:508: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:508" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:508" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:512: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:512" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:512" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:512: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:512" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:512" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:512: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:512" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:512" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:519: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:519" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:519" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:519: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:519" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:519" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1515 -#AT_START_1516 -at_fn_group_banner 1516 'vtep-ctl.at:522' \ - "add-ucast-remote ls1, del-ucast-remote ls1" " " 98 -at_xfail=no -( - $as_echo "1516. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:524: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:524" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:524" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:524: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:524" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:524" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:524: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:524" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:524" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:525: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:525" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:525" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:525: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:525" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:525" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:525: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:525" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:525" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:527" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:527" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:527" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:527" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:527: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:527" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:527" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:528: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:528" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:528" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:528: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:528" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:528" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:528: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:528" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:528" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:532: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:532" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:532" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:532: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:532" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:532" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:532: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:532" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:532" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:540: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ucast-remote ls1 00:11:22:33:44:55 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:540" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-ucast-remote ls1 00:11:22:33:44:55 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:540" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:540: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:540" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:540" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:540: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:540" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:540" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:543: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:543" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:543" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:543: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:543" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:543" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:543: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:543" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:543" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:550: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:550" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:550" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:550: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:550" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:550" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1516 -#AT_START_1517 -at_fn_group_banner 1517 'vtep-ctl.at:553' \ - "add-ucast-local ls1, add-ucast-remote ls1" " " 98 -at_xfail=no -( - $as_echo "1517. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:555: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:555" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:555" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:555: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:555" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:555" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:555: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:555" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:555" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:556: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:556" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:556" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:556: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:556" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:556" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:556: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:556" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:556" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:558" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:558" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:558" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:558" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:558: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:558" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:558" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:559: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:66 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 02:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 02:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:559" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:66 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 02:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 02:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:559" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:559: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:559" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:559" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:559: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:559" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:559" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:565: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:565" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:565" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:565: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:565" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:565" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:565: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:565" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:565" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:573: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:573" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 02:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 02:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:573" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:573: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:573" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:573" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:573: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:573" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:573" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:581: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:581" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:581" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:581: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:581" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:581" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1517 -#AT_START_1518 -at_fn_group_banner 1518 'vtep-ctl.at:584' \ - "add-mcast-local ls1" " " 98 -at_xfail=no -( - $as_echo "1518. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:586: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:586" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:586" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:586: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:586" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:586" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:586: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:586" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:586" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:587: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:587" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:587" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:587: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:587" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:587" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:587: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:587" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:587" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:589" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:589" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:589" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:589" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:589: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:589" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:589" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:590: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:590" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:590" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:590: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:590" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:590" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:590: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:590" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:590" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:595: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:595" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - -mcast-mac-local - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:595" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:595: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:595" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:595" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:595: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:595" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:595" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:604: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:604" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:604" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:604: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:604" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:604" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:604: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:604" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:604" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:610: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:610" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:610" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:610: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:610" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:610" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1518 -#AT_START_1519 -at_fn_group_banner 1519 'vtep-ctl.at:613' \ - "add-mcast-local ls1, del-mcast-local ls1" " " 98 -at_xfail=no -( - $as_echo "1519. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:615: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:615" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:615" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:615: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:615" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:615" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:615: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:615" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:615" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:616: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:616" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:616" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:616: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:616" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:616" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:616: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:616" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:616" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:618" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:618" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:618" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:618" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:618: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:618" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:618" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:619: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.13 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:619" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.13 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:619" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:619: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:619" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:619" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:619: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:619" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:619" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:625: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:625" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - -mcast-mac-local - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:625" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:625: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:625" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:625" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:625: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:625" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:625" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:635: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:635" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:635" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:635: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:635" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:635" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:635: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:635" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:635" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:638: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:638" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - -mcast-mac-local - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:638" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:638: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:638" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:638" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:638: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:638" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:638" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:647: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:647" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:647" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:647: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:647" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:647" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1519 -#AT_START_1520 -at_fn_group_banner 1520 'vtep-ctl.at:650' \ - "add-mcast-remote ls1" " " 98 -at_xfail=no -( - $as_echo "1520. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:652: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:652" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:652" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:652: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:652" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:652" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:652: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:652" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:652" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:653: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:653" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:653" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:653: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:653" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:653" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:653: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:653" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:653" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:655" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:655" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:655" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:655" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:655: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:655" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:655" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:656: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:656" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:656" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:656: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:656" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:656" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:656: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:656" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:656" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:661: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:661" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - -mcast-mac-remote - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:661" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:661: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:661" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:661" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:661: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:661" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:661" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:670: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:670" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:670" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:670: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:670" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:670" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:670: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:670" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:670" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:676: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:676" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:676" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:676: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:676" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:676" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1520 -#AT_START_1521 -at_fn_group_banner 1521 'vtep-ctl.at:679' \ - "add-mcast-remote ls1, del-mcast-remote ls1" " " 98 -at_xfail=no -( - $as_echo "1521. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:681: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:681" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:681" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:681: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:681" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:681" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:681: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:681" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:681" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:682: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:682" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:682" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:682: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:682" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:682" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:682: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:682" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:682" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:684" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:684" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:684" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:684" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:684: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:684" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:684" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:685: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.13 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:685" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.13 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:685" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:685: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:685" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:685" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:685: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:685" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:685" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:691: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:691" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - -mcast-mac-remote - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:691" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:691: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:691" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:691" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:691: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:691" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:691" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:701: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:701" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket del-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:701" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:701: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:701" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:701" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:701: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:701" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:701" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:704: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:704" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - -mcast-mac-remote - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:704" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:704: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:704" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:704" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:704: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:704" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:704" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:713: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:713" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:713" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:713: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:713" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:713" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1521 -#AT_START_1522 -at_fn_group_banner 1522 'vtep-ctl.at:716' \ - "add-mcast-local ls1, add-mcast-remote ls1" " " 98 -at_xfail=no -( - $as_echo "1522. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:718: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:718" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:718" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:718: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:718" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:718" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:718: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:718" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:718" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:719: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:719" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:719" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:719: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:719" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:719" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:719: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:719" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:719" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:721" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:721" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:721" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:721" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:721: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:721" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:721" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:722: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 03:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.12 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:722" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 03:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.12 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:722" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:722: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:722" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:722" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:722: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:722" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:722" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:730: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:730" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - -mcast-mac-local - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:730" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:730: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:730" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:730" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:730: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:730" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:730" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:739: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:739" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - -mcast-mac-remote - 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 03:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:739" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:739: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:739" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:739" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:739: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:739" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:739" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:748: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:748" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:748" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:748: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:748" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:748" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1522 -#AT_START_1523 -at_fn_group_banner 1523 'vtep-ctl.at:751' \ - "add local and remote macs, clear-local-macs" " " 98 -at_xfail=no -( - $as_echo "1523. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:753: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:753" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:753" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:753: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:753" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:753" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:753: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:753" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:753" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:754: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:754" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:754" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:754: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:754" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:754" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:754: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:754" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:754" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:756" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:756" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:756" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:756" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:756: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:756" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:756" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:757: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:757" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:757" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:757: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:757" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:757" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:757: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:757" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:757" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:767: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:767" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - -mcast-mac-local - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:767" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:767: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:767" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:767" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:767: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:767" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:767" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:777: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:777" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - -mcast-mac-remote - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:777" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:777: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:777" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:777" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:777: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:777" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:777" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:787: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket clear-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:787" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket clear-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:787" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:787: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:787" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:787" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:787: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:787" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:787" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:789: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:789" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - -mcast-mac-local - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:789" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:789: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:789" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:789" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:789: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:789" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:789" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:795: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:795" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - -mcast-mac-remote - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:795" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:795: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:795" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:795" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:795: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:795" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:795" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:805: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:805" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:805" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:805: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:805" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:805" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1523 -#AT_START_1524 -at_fn_group_banner 1524 'vtep-ctl.at:808' \ - "add local and remote macs, clear-remote-macs" " " 98 -at_xfail=no -( - $as_echo "1524. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:810: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:810" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:810" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:810: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:810" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:810" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:810: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:810" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:810" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:811: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:811" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ls ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:811" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:811: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:811" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:811" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:811: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:811" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:811" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:813" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:813" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- list-ls - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ls1 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:813" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:813" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket ls-exists nonexistent - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:813: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:813" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:813" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:814: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:814" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11 -vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12 - - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:814" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:814: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:814" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:814" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:814: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:814" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:814" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:824: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:824" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - -mcast-mac-local - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:824" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:824: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:824" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:824" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:824: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:824" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:824" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:834: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:834" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - -mcast-mac-remote - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:834" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:834: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:834" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:834" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:834: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:834" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:834" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:844: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket clear-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:844" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket clear-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:844" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:844: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:844" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:844" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:844: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:844" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:844" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:846: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:846" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-local-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-local - 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - -mcast-mac-local - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 - 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 - 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:846" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:846: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:846" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:846" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:846: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:846" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:846" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:856: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 -" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:856" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket list-remote-macs ls1 - -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "ucast-mac-remote - -mcast-mac-remote - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:856" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:856: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:856" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:856" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:856: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:856" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:856" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:862: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:862" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:862" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:862: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:862" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:862" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1524 -#AT_START_1525 -at_fn_group_banner 1525 'vtep-ctl.at:868' \ - "managers" " " 99 -at_xfail=no -( - $as_echo "1525. $at_setup_line: testing $at_desc ..." - $at_traceon - - -OVS_RUNDIR=`pwd`; export OVS_RUNDIR - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:870: ovsdb-tool create db \$abs_top_srcdir/vtep/vtep.ovsschema" -at_fn_check_prepare_dynamic "ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema" "vtep-ctl.at:870" -( $at_check_trace; ovsdb-tool create db $abs_top_srcdir/vtep/vtep.ovsschema -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:870" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:870: ovsdb-tool transact db \\ - '[\"hardware_vtep\", - {\"op\": \"insert\", - \"table\": \"Global\", - \"row\": {}}]'" -at_fn_check_prepare_notrace 'an embedded newline' "vtep-ctl.at:870" -( $at_check_trace; ovsdb-tool transact db \ - '["hardware_vtep", - {"op": "insert", - "table": "Global", - "row": {}}]' -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:870" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:870: ovsdb-server --detach --no-chdir --pidfile=\"\`pwd\`\"/pid --remote=punix:socket --unixctl=\"\`pwd\`\"/unixctl db >/dev/null 2>&1" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:870" -( $at_check_trace; ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1 -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:870" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/vtep-ctl.at:871: vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- del-manager -- get-manager -- set-manager tcp:4.5.6.7 -- get-manager -- set-manager tcp:8.9.10.11 tcp:5.4.3.2 -- get-manager -- del-manager -- get-manager" -at_fn_check_prepare_trace "vtep-ctl.at:871" -( $at_check_trace; vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- del-manager -- get-manager -- set-manager tcp:4.5.6.7 -- get-manager -- set-manager tcp:8.9.10.11 tcp:5.4.3.2 -- get-manager -- del-manager -- get-manager -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo " - - -tcp:4.5.6.7 - -tcp:5.4.3.2\\ntcp:8.9.10.11 - - -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:871" -if $at_failed; then : - cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:871: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:871" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:871" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:871: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:871" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:871" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -fi -$at_failed && at_fn_log_failure -$at_traceon; } - -cp pid savepid - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:888: ovs-appctl -t \"\`pwd\`\"/unixctl -e exit" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:888" -( $at_check_trace; ovs-appctl -t "`pwd`"/unixctl -e exit -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:888" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/vtep-ctl.at:888: ovs_wait_cond () { if kill -0 \`cat savepid\`; then return 1; else return 0; fi -} -ovs_wait" -at_fn_check_prepare_notrace 'a `...` command substitution' "vtep-ctl.at:888" -( $at_check_trace; ovs_wait_cond () { if kill -0 `cat savepid`; then return 1; else return 0; fi -} -ovs_wait -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; cat "$at_stderr" -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/vtep-ctl.at:888" -if $at_failed; then : - kill `cat savepid` -fi -$at_failed && at_fn_log_failure -$at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_1525 diff -Nru openvswitch-2.3.1/tests/testsuite.at openvswitch-2.4.0~git20150623/tests/testsuite.at --- openvswitch-2.3.1/tests/testsuite.at 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/testsuite.at 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ AT_INIT -AT_COPYRIGHT([Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +AT_COPYRIGHT([Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,108 +14,11 @@ See the License for the specific language governing permissions and limitations under the License.]) -AT_TESTED([ovs-vswitchd]) -AT_TESTED([ovs-vsctl]) -AT_TESTED([perl]) - -m4_include([m4/compat.at]) - -m4_divert_push([PREPARE_TESTS]) -[ -ovs_wait () { - # First try a quick sleep, so that the test completes very quickly - # in the normal case. POSIX doesn't require fractional times to - # work, so this might not work. - sleep 0.1 - ovs_wait_cond && exit 0 - # Then wait up to 10 seconds. - for d in 0 1 2 3 4 5 6 7 8 9; do - sleep 1 - ovs_wait_cond && exit 0 - done - exit 1 -} - -# Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout. -seq () { - while test $1 -le $2; do - echo $1 - set `expr $1 + ${3-1}` $2 $3 - done -} - -if test "$IS_WIN32" = "yes"; then - pwd () { - command pwd -W "$@" - } - - diff () { - command diff --strip-trailing-cr "$@" - } - - kill () { - case "$1" in - -0) - shift - for i in $*; do - # tasklist will always have return code 0. - # If pid does exist, there will be a line with the pid. - if tasklist //fi "PID eq $i" | grep $i; then - : - else - return 1 - fi - done - return 0 - ;; - -[1-9]*) - shift - for i in $*; do - taskkill //F //PID $i - done - ;; - [1-9][1-9]*) - for i in $*; do - taskkill //F //PID $i - done - ;; - esac - } -fi -] -m4_divert_pop([PREPARE_TESTS]) - -m4_define([OVS_WAIT], - [AT_CHECK( - [ovs_wait_cond () { $1 -} -ovs_wait], [0], [ignore], [ignore], [$2])]) -m4_define([OVS_WAIT_UNTIL], [OVS_WAIT([$1], [$2])]) -m4_define([OVS_WAIT_WHILE], - [OVS_WAIT([if $1; then return 1; else return 0; fi], [$2])]) - -dnl OVS_APP_EXIT_AND_WAIT(DAEMON) -dnl -dnl Ask the daemon named DAEMON to exit, via ovs-appctl, and then waits for it -dnl to exit. -m4_define([OVS_APP_EXIT_AND_WAIT], - [ovs-appctl -t $1 exit - OVS_WAIT_WHILE([test -e $1.pid])]) - -dnl ON_EXIT([COMMANDS]) -dnl -dnl Adds the shell COMMANDS to a collection executed when the current test -dnl completes, as a cleanup action. (The most common use is to kill a -dnl daemon started by the test. This is important to prevent tests that -dnl start daemons from hanging at exit.) -m4_define([ON_EXIT], [trap '. ./cleanup' 0; cat >>cleanup <<'EOF' -$1 -EOF -]) - +m4_include([tests/ovs-macros.at]) m4_include([tests/ovsdb-macros.at]) m4_include([tests/ofproto-macros.at]) +m4_include([tests/completion.at]) m4_include([tests/bfd.at]) m4_include([tests/cfm.at]) m4_include([tests/lacp.at]) @@ -132,6 +35,7 @@ m4_include([tests/ofp-errors.at]) m4_include([tests/ovs-ofctl.at]) m4_include([tests/odp.at]) +m4_include([tests/mpls-xlate.at]) m4_include([tests/multipath.at]) m4_include([tests/learn.at]) m4_include([tests/vconn.at]) @@ -143,11 +47,15 @@ m4_include([tests/jsonrpc.at]) m4_include([tests/jsonrpc-py.at]) m4_include([tests/tunnel.at]) +m4_include([tests/tunnel-push-pop.at]) m4_include([tests/lockfile.at]) m4_include([tests/reconnect.at]) m4_include([tests/ovs-vswitchd.at]) m4_include([tests/ofproto.at]) +m4_include([tests/dpif-netdev.at]) +m4_include([tests/dpctl.at]) m4_include([tests/ofproto-dpif.at]) +m4_include([tests/bridge.at]) m4_include([tests/vlan-splinters.at]) m4_include([tests/ovsdb.at]) m4_include([tests/ovs-vsctl.at]) @@ -155,5 +63,7 @@ m4_include([tests/ovs-xapi-sync.at]) m4_include([tests/interface-reconfigure.at]) m4_include([tests/stp.at]) +m4_include([tests/rstp.at]) m4_include([tests/vlog.at]) m4_include([tests/vtep-ctl.at]) +m4_include([tests/auto-attach.at]) diff -Nru openvswitch-2.3.1/tests/testsuite.patch openvswitch-2.4.0~git20150623/tests/testsuite.patch --- openvswitch-2.3.1/tests/testsuite.patch 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/testsuite.patch 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,76 @@ +--- testsuite 2015-02-11 17:19:21.654646439 -0800 ++++ testsuite 2015-02-11 17:15:03.810653032 -0800 +@@ -4669,6 +4669,73 @@ + fi + exec 6<&- + wait ++elif test $at_jobs -ne 1 && ++ test "$IS_WIN32" = "yes"; then ++ # FIFO job dispatcher. ++ trap 'at_pids= ++ for at_pid in `jobs -p`; do ++ at_pids="$at_pids $at_job_group$at_pid" ++ done ++ if test -n "$at_pids"; then ++ at_sig=TSTP ++ test "${TMOUT+set}" = set && at_sig=STOP ++ kill -$at_sig $at_pids 2>/dev/null ++ fi ++ kill -STOP $$ ++ test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP ++ ++ echo ++ # Turn jobs into a list of numbers, starting from 1. ++ running_jobs="`pwd`/tests/jobdispatcher" ++ mkdir -p $running_jobs ++ at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` ++ ++ set X $at_joblist ++ shift ++ for at_group in $at_groups; do ++ $at_job_control_on 2>/dev/null ++ ( ++ # Start one test group. ++ $at_job_control_off ++ touch $running_jobs/$at_group ++ trap 'set +x; set +e ++ trap "" PIPE ++ echo stop > "$at_stop_file" ++ rm -f $running_jobs/$at_group ++ as_fn_exit 141' PIPE ++ at_fn_group_prepare ++ if cd "$at_group_dir" && ++ at_fn_test $at_group && ++ . "$at_test_source" ++ then :; else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 ++$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} ++ at_failed=: ++ fi ++ rm -f $running_jobs/$at_group ++ at_fn_group_postprocess ++ ) & ++ $at_job_control_off ++ shift # Consume one token. ++ if test $# -gt 0; then :; else ++ while [ "`ls -l $running_jobs 2>/dev/null | wc -l`" -gt "$at_jobs" ]; do ++ sleep 0.1 ++ done ++ set x $* ++ fi ++ test -f "$at_stop_file" && break ++ done ++ # Read back the remaining ($at_jobs - 1) tokens. ++ set X $at_joblist ++ shift ++ if test $# -gt 0; then ++ shift ++ while [ "`ls -l $running_jobs | wc -l`" -gt 1 ]; do ++ sleep 0.1 ++ done ++ fi ++ rmdir $running_jobs ++ wait + else + # Run serially, avoid forks and other potential surprises. + for at_group in $at_groups; do diff -Nru openvswitch-2.3.1/tests/test-unix-socket.c openvswitch-2.4.0~git20150623/tests/test-unix-socket.c --- openvswitch-2.3.1/tests/test-unix-socket.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-unix-socket.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,14 +15,13 @@ */ #include - +#undef NDEBUG +#include "socket-util.h" #include #include #include - -#include "util.h" -#include "socket-util.h" #include "ovstest.h" +#include "util.h" static void test_unix_socket_main(int argc, char *argv[]) diff -Nru openvswitch-2.3.1/tests/test-util.c openvswitch-2.4.0~git20150623/tests/test-util.c --- openvswitch-2.3.1/tests/test-util.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-util.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,22 +15,19 @@ */ #include - +#undef NDEBUG +#include "util.h" +#include #include #include #include #include #include - #include "byte-order.h" #include "command-line.h" -#include "random.h" -#include "util.h" -#include "vlog.h" #include "ovstest.h" - -#undef NDEBUG -#include +#include "random.h" +#include "openvswitch/vlog.h" static void check_log_2_floor(uint32_t x, int n) @@ -43,7 +40,7 @@ } static void -test_log_2_floor(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_log_2_floor(struct ovs_cmdl_context *ctx OVS_UNUSED) { int n; @@ -82,7 +79,7 @@ } static void -test_ctz(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_ctz(struct ovs_cmdl_context *ctx OVS_UNUSED) { int n; @@ -135,7 +132,7 @@ } static void -test_clz(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_clz(struct ovs_cmdl_context *ctx OVS_UNUSED) { int n; @@ -185,7 +182,7 @@ } static void -test_round_up_pow2(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_round_up_pow2(struct ovs_cmdl_context *ctx OVS_UNUSED) { int n; @@ -213,7 +210,7 @@ } static void -test_round_down_pow2(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_round_down_pow2(struct ovs_cmdl_context *ctx OVS_UNUSED) { int n; @@ -251,7 +248,7 @@ } static void -test_count_1bits(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_count_1bits(struct ovs_cmdl_context *ctx OVS_UNUSED) { uint64_t bits[64]; int i; @@ -290,7 +287,7 @@ } static void -test_bitwise_copy(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_bitwise_copy(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned int n_loops; int src_ofs; @@ -340,7 +337,7 @@ } static void -test_bitwise_zero(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_bitwise_zero(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned int n_loops; int dst_ofs; @@ -381,7 +378,7 @@ } static void -test_bitwise_one(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_bitwise_one(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned int n_loops; int dst_ofs; @@ -422,7 +419,7 @@ } static void -test_bitwise_is_all_zeros(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_bitwise_is_all_zeros(struct ovs_cmdl_context *ctx OVS_UNUSED) { int n_loops; @@ -466,25 +463,25 @@ } static void -test_follow_symlinks(int argc, char *argv[]) +test_follow_symlinks(struct ovs_cmdl_context *ctx) { int i; - for (i = 1; i < argc; i++) { - char *target = follow_symlinks(argv[i]); + for (i = 1; i < ctx->argc; i++) { + char *target = follow_symlinks(ctx->argv[i]); puts(target); free(target); } } static void -test_assert(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_assert(struct ovs_cmdl_context *ctx OVS_UNUSED) { ovs_assert(false); } static void -test_ovs_scan(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_ovs_scan(struct ovs_cmdl_context *ctx OVS_UNUSED) { char str[16], str2[16], str3[16]; long double ld, ld2; @@ -500,7 +497,6 @@ long l, l2; int i, i2; - ovs_assert(ovs_scan("", "")); ovs_assert(ovs_scan("", " ")); ovs_assert(ovs_scan(" ", " ")); ovs_assert(ovs_scan(" ", " ")); @@ -1016,7 +1012,7 @@ } static void -test_snprintf(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +test_snprintf(struct ovs_cmdl_context *ctx OVS_UNUSED) { char s[16]; @@ -1031,23 +1027,46 @@ ovs_assert(snprintf(NULL, 0, "abcde") == 5); } + +#ifndef _WIN32 +static void +test_file_name(struct ovs_cmdl_context *ctx) +{ + int i; + + for (i = 1; i < ctx->argc; i++) { + char *dir, *base; + + dir = dir_name(ctx->argv[i]); + puts(dir); + free(dir); + + base = base_name(ctx->argv[i]); + puts(base); + free(base); + } +} +#endif /* _WIN32 */ -static const struct command commands[] = { - {"ctz", 0, 0, test_ctz}, - {"clz", 0, 0, test_clz}, - {"round_up_pow2", 0, 0, test_round_up_pow2}, - {"round_down_pow2", 0, 0, test_round_down_pow2}, - {"count_1bits", 0, 0, test_count_1bits}, - {"log_2_floor", 0, 0, test_log_2_floor}, - {"bitwise_copy", 0, 0, test_bitwise_copy}, - {"bitwise_zero", 0, 0, test_bitwise_zero}, - {"bitwise_one", 0, 0, test_bitwise_one}, - {"bitwise_is_all_zeros", 0, 0, test_bitwise_is_all_zeros}, - {"follow-symlinks", 1, INT_MAX, test_follow_symlinks}, - {"assert", 0, 0, test_assert}, - {"ovs_scan", 0, 0, test_ovs_scan}, - {"snprintf", 0, 0, test_snprintf}, - {NULL, 0, 0, NULL}, +static const struct ovs_cmdl_command commands[] = { + {"ctz", NULL, 0, 0, test_ctz}, + {"clz", NULL, 0, 0, test_clz}, + {"round_up_pow2", NULL, 0, 0, test_round_up_pow2}, + {"round_down_pow2", NULL, 0, 0, test_round_down_pow2}, + {"count_1bits", NULL, 0, 0, test_count_1bits}, + {"log_2_floor", NULL, 0, 0, test_log_2_floor}, + {"bitwise_copy", NULL, 0, 0, test_bitwise_copy}, + {"bitwise_zero", NULL, 0, 0, test_bitwise_zero}, + {"bitwise_one", NULL, 0, 0, test_bitwise_one}, + {"bitwise_is_all_zeros", NULL, 0, 0, test_bitwise_is_all_zeros}, + {"follow-symlinks", NULL, 1, INT_MAX, test_follow_symlinks}, + {"assert", NULL, 0, 0, test_assert}, + {"ovs_scan", NULL, 0, 0, test_ovs_scan}, + {"snprintf", NULL, 0, 0, test_snprintf}, +#ifndef _WIN32 + {"file_name", NULL, 1, INT_MAX, test_file_name}, +#endif + {NULL, NULL, 0, 0, NULL}, }; static void @@ -1060,7 +1079,7 @@ VLOG_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { int c = getopt_long(argc, argv, short_options, long_options, NULL); @@ -1084,9 +1103,17 @@ static void test_util_main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { .argc = 0, }; set_program_name(argv[0]); parse_options(argc, argv); - run_command(argc - optind, argv + optind, commands); + /* On Windows, stderr is fully buffered if connected to a pipe. + * Make it _IONBF so that an abort does not miss log contents. + * POSIX doesn't define the circumstances in which stderr is + * fully buffered either. */ + setvbuf(stderr, NULL, _IONBF, 0); + ctx.argc = argc - optind; + ctx.argv = argv + optind; + ovs_cmdl_run_command(&ctx, commands); } OVSTEST_REGISTER("test-util", test_util_main); diff -Nru openvswitch-2.3.1/tests/test-uuid.c openvswitch-2.4.0~git20150623/tests/test-uuid.c --- openvswitch-2.3.1/tests/test-uuid.c 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-uuid.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,6 +15,7 @@ */ #include +#undef NDEBUG #include "uuid.h" #include #include "ovstest.h" diff -Nru openvswitch-2.3.1/tests/test-vconn.c openvswitch-2.4.0~git20150623/tests/test-vconn.c --- openvswitch-2.3.1/tests/test-vconn.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/test-vconn.c 2015-06-23 18:46:21.000000000 +0000 @@ -15,7 +15,9 @@ */ #include -#include "vconn.h" +#undef NDEBUG +#include "openvswitch/vconn.h" +#include #include #include #include @@ -27,17 +29,14 @@ #include "ofp-util.h" #include "ofpbuf.h" #include "openflow/openflow.h" +#include "ovstest.h" #include "poll-loop.h" #include "socket-util.h" #include "stream.h" #include "stream-ssl.h" #include "timeval.h" #include "util.h" -#include "vlog.h" -#include "ovstest.h" - -#undef NDEBUG -#include +#include "openvswitch/vlog.h" struct fake_pvconn { const char *type; @@ -61,7 +60,7 @@ check_errno(int a, int b, const char *as, const char *file, int line) { if (a != b) { - char *str_b = strdup(ovs_strerror(abs(b))); + char *str_b = xstrdup(ovs_strerror(abs(b))); ovs_fatal(0, "%s:%d: %s is %d (%s) but should be %d (%s)", file, line, as, a, ovs_strerror(abs(a)), b, str_b); } @@ -142,9 +141,9 @@ /* Connects to a fake_pvconn with vconn_open(), then closes the listener and * verifies that vconn_connect() reports 'expected_error'. */ static void -test_refuse_connection(int argc OVS_UNUSED, char *argv[]) +test_refuse_connection(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct fake_pvconn fpv; struct vconn *vconn; int error; @@ -156,12 +155,20 @@ error = vconn_connect_block(vconn); if (!strcmp(type, "tcp")) { - if (error != ECONNRESET && error != EPIPE) { + if (error != ECONNRESET && error != EPIPE +#ifdef _WIN32 + && error != WSAECONNRESET +#endif + ) { ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)", error, ovs_strerror(error)); } } else if (!strcmp(type, "unix")) { +#ifndef _WIN32 CHECK_ERRNO(error, EPIPE); +#else + CHECK_ERRNO(error, WSAECONNRESET); +#endif } else if (!strcmp(type, "ssl")) { if (error != EPROTO && error != ECONNRESET) { ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)", @@ -179,9 +186,9 @@ * closes it immediately, and verifies that vconn_connect() reports * 'expected_error'. */ static void -test_accept_then_close(int argc OVS_UNUSED, char *argv[]) +test_accept_then_close(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct fake_pvconn fpv; struct vconn *vconn; int error; @@ -194,7 +201,11 @@ error = vconn_connect_block(vconn); if (!strcmp(type, "tcp") || !strcmp(type, "unix")) { - if (error != ECONNRESET && error != EPIPE) { + if (error != ECONNRESET && error != EPIPE +#ifdef _WIN32 + && error != WSAECONNRESET +#endif + ) { ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)", error, ovs_strerror(error)); } @@ -210,9 +221,9 @@ * reads the hello message from it, then closes the connection and verifies * that vconn_connect() reports 'expected_error'. */ static void -test_read_hello(int argc OVS_UNUSED, char *argv[]) +test_read_hello(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct fake_pvconn fpv; struct vconn *vconn; struct stream *stream; @@ -350,14 +361,14 @@ /* Try connecting and sending a normal hello, which should succeed. */ static void -test_send_plain_hello(int argc OVS_UNUSED, char *argv[]) +test_send_plain_hello(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct ofpbuf *hello; hello = ofpraw_alloc_xid(OFPRAW_OFPT_HELLO, OFP13_VERSION, htonl(0x12345678), 0); - test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), 0); + test_send_hello(type, hello->data, hello->size, 0); ofpbuf_delete(hello); } @@ -365,9 +376,9 @@ * the specification says that implementations must accept and ignore extra * data). */ static void -test_send_long_hello(int argc OVS_UNUSED, char *argv[]) +test_send_long_hello(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct ofpbuf *hello; enum { EXTRA_BYTES = 8 }; @@ -375,30 +386,30 @@ htonl(0x12345678), EXTRA_BYTES); ofpbuf_put_zeros(hello, EXTRA_BYTES); ofpmsg_update_length(hello); - test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), 0); + test_send_hello(type, hello->data, hello->size, 0); ofpbuf_delete(hello); } /* Try connecting and sending an echo request instead of a hello, which should * fail with EPROTO. */ static void -test_send_echo_hello(int argc OVS_UNUSED, char *argv[]) +test_send_echo_hello(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct ofpbuf *echo; echo = ofpraw_alloc_xid(OFPRAW_OFPT_ECHO_REQUEST, OFP13_VERSION, htonl(0x12345678), 0); - test_send_hello(type, ofpbuf_data(echo), ofpbuf_size(echo), EPROTO); + test_send_hello(type, echo->data, echo->size, EPROTO); ofpbuf_delete(echo); } /* Try connecting and sending a hello packet that has its length field as 0, * which should fail with EPROTO. */ static void -test_send_short_hello(int argc OVS_UNUSED, char *argv[]) +test_send_short_hello(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct ofp_header hello; memset(&hello, 0, sizeof hello); @@ -408,41 +419,46 @@ /* Try connecting and sending a hello packet that has a bad version, which * should fail with EPROTO. */ static void -test_send_invalid_version_hello(int argc OVS_UNUSED, char *argv[]) +test_send_invalid_version_hello(struct ovs_cmdl_context *ctx) { - const char *type = argv[1]; + const char *type = ctx->argv[1]; struct ofpbuf *hello; hello = ofpraw_alloc_xid(OFPRAW_OFPT_HELLO, OFP13_VERSION, htonl(0x12345678), 0); - ((struct ofp_header *) ofpbuf_data(hello))->version = 0; - test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), EPROTO); + ((struct ofp_header *) hello->data)->version = 0; + test_send_hello(type, hello->data, hello->size, EPROTO); ofpbuf_delete(hello); } -static const struct command commands[] = { - {"refuse-connection", 1, 1, test_refuse_connection}, - {"accept-then-close", 1, 1, test_accept_then_close}, - {"read-hello", 1, 1, test_read_hello}, - {"send-plain-hello", 1, 1, test_send_plain_hello}, - {"send-long-hello", 1, 1, test_send_long_hello}, - {"send-echo-hello", 1, 1, test_send_echo_hello}, - {"send-short-hello", 1, 1, test_send_short_hello}, - {"send-invalid-version-hello", 1, 1, test_send_invalid_version_hello}, - {NULL, 0, 0, NULL}, +static const struct ovs_cmdl_command commands[] = { + {"refuse-connection", NULL, 1, 1, test_refuse_connection}, + {"accept-then-close", NULL, 1, 1, test_accept_then_close}, + {"read-hello", NULL, 1, 1, test_read_hello}, + {"send-plain-hello", NULL, 1, 1, test_send_plain_hello}, + {"send-long-hello", NULL, 1, 1, test_send_long_hello}, + {"send-echo-hello", NULL, 1, 1, test_send_echo_hello}, + {"send-short-hello", NULL, 1, 1, test_send_short_hello}, + {"send-invalid-version-hello", NULL, 1, 1, test_send_invalid_version_hello}, + {NULL, NULL, 0, 0, NULL}, }; static void test_vconn_main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { + .argc = argc - 1, + .argv = argv + 1, + }; + set_program_name(argv[0]); - vlog_set_levels(NULL, VLF_ANY_FACILITY, VLL_EMER); + vlog_set_levels(NULL, VLF_ANY_DESTINATION, VLL_EMER); vlog_set_levels(NULL, VLF_CONSOLE, VLL_DBG); fatal_ignore_sigpipe(); time_alarm(10); - run_command(argc - 1, argv + 1, commands); + ovs_cmdl_run_command(&ctx, commands); } OVSTEST_REGISTER("test-vconn", test_vconn_main); diff -Nru openvswitch-2.3.1/tests/tunnel.at openvswitch-2.4.0~git20150623/tests/tunnel.at --- openvswitch-2.3.1/tests/tunnel.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/tunnel.at 2015-06-23 18:46:21.000000000 +0000 @@ -11,6 +11,7 @@ AT_DATA([flows.txt], [dnl actions=IN_PORT ]) +OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) @@ -22,15 +23,15 @@ ]) dnl remote_ip -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=1.2.3.4,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=1.2.3.4,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 + [Datapath actions: set(tunnel(dst=1.1.1.1,ttl=64,flags(df))),1 ]) dnl local_ip, remote_ip -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.2,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 + [Datapath actions: set(tunnel(src=2.2.2.2,dst=1.1.1.1,ttl=64,flags(df))),1 ]) dnl reconfigure, local_ip, remote_ip @@ -43,17 +44,17 @@ p2 2/1: (gre: csum=true, df_default=false, local_ip=2.2.2.3, remote_ip=1.1.1.1, ttl=1) p3 3/64: (gre64: remote_ip=2.2.2.2) ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.2,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 + [Datapath actions: set(tunnel(dst=1.1.1.1,ttl=64,flags(df))),1 ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.3,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.3,dst=1.1.1.1,tos=0x0,ttl=1,flags(csum))),1 + [Datapath actions: set(tunnel(src=2.2.2.3,dst=1.1.1.1,ttl=1,flags(csum))),1 ]) dnl nonexistent tunnel -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=5.5.5.5,dst=6.6.6.6,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=5.5.5.5,dst=6.6.6.6,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl Invalid datapath flow ovs-appctl: ovs-vswitchd: server returned an error ]) @@ -79,30 +80,30 @@ ]) dnl Tunnel CE and encapsulated packet CE -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=3,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=3,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=3,nw_frag=no + [Megaflow: pkt_mark=0,recirc_id=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=3,nw_frag=no Datapath actions: 2 ]) dnl Tunnel CE and encapsulated packet ECT(1) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,tcp,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=1,nw_ttl=64 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0x3,ttl=64,frag=no)),2 + [Megaflow: pkt_mark=0,recirc_id=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=1,nw_frag=no +Datapath actions: set(ipv4(tos=0x3/0x3)),2 ]) dnl Tunnel CE and encapsulated packet ECT(2) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=2,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=2,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,tcp,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=2,nw_ttl=64 -Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0x3,ttl=64,frag=no)),2 + [Megaflow: pkt_mark=0,recirc_id=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=2,nw_frag=no +Datapath actions: set(ipv4(tos=0x3/0x3)),2 ]) dnl Tunnel CE and encapsulated packet Non-ECT -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], - [Megaflow: pkt_mark=0,recirc_id=0,skb_priority=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=0,nw_frag=no + [Megaflow: pkt_mark=0,recirc_id=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=3,tun_ttl=64,,in_port=1,nw_ecn=0,nw_frag=no Datapath actions: drop ]) OVS_VSWITCHD_STOP(["/dropping tunnel packet marked ECN CE but is not ECN capable/d"]) @@ -118,6 +119,7 @@ actions=output:1 ]) +OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl @@ -129,7 +131,7 @@ dnl Basic AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 + [Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,ttl=64,flags(df,key))),1 ]) dnl ECN @@ -150,6 +152,7 @@ actions=output:1 ]) +OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl @@ -161,19 +164,19 @@ dnl Basic AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x4,ttl=128,flags(df))),1 + [Datapath actions: set(tunnel(dst=1.1.1.1,tos=0x4,ttl=128,flags(df))),1 ]) dnl ECN AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=5,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x5,ttl=128,flags(df))),1 + [Datapath actions: set(tunnel(dst=1.1.1.1,tos=0x5,ttl=128,flags(df))),1 ]) dnl non-IP AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1 + [Datapath actions: set(tunnel(dst=1.1.1.1,ttl=64,flags(df))),1 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -192,6 +195,7 @@ actions=set_tunnel:1,output:1,set_tunnel:2,output:2,set_tunnel:3,output:3,set_tunnel:5,output:4 ]) +OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl @@ -204,10 +208,10 @@ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl -set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x2,src=0.0.0.0,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x3,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x5,src=0.0.0.0,dst=4.4.4.4,tos=0x0,ttl=64,flags(df,key))),1 +set(tunnel(tun_id=0x1,dst=1.1.1.1,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x2,dst=2.2.2.2,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x3,dst=3.3.3.3,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x5,dst=4.4.4.4,ttl=64,flags(df,key))),1 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -224,6 +228,7 @@ actions=IN_PORT,output:1,output:2,output:3 ]) +OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl @@ -233,28 +238,28 @@ p3 3/1: (gre: out_key=5, remote_ip=1.1.1.1) ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl -set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 +set(tunnel(tun_id=0x1,dst=1.1.1.1,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x3,dst=1.1.1.1,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x5,dst=1.1.1.1,ttl=64,flags(df,key))),1 ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl -set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 +set(tunnel(tun_id=0x3,dst=1.1.1.1,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x1,dst=1.1.1.1,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x5,dst=1.1.1.1,ttl=64,flags(df,key))),1 ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(src=1.1.1.1,dst=2.2.2.2,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl -set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl -set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1 +set(tunnel(tun_id=0x5,dst=1.1.1.1,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x1,dst=1.1.1.1,ttl=64,flags(df,key))),1,dnl +set(tunnel(tun_id=0x3,dst=1.1.1.1,ttl=64,flags(df,key))),1 ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0xf,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0xf,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl Invalid datapath flow ovs-appctl: ovs-vswitchd: server returned an error ]) @@ -276,6 +281,7 @@ tun_id=4,actions=output:5 ]) +OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl @@ -287,22 +293,22 @@ p5 5/5: (dummy) ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [dnl Datapath actions: 3 ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [dnl -Datapath actions: 4,3,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,5 +Datapath actions: 4,3,set(tunnel(tun_id=0x3,dst=3.3.3.3,ttl=64,flags(df,key))),1,5 ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=3.3.3.3,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=3.3.3.3,dst=2.2.2.2,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [dnl Datapath actions: 4,3,5 ]) -AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], [dnl Datapath actions: drop ]) @@ -310,6 +316,18 @@ OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([tunnel - Geneve]) +OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=geneve \ + options:remote_ip=1.1.1.1 ofport_request=1 options:dst_port=5000]) + +AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl + br0 65534/100: (dummy) + p1 1/5000: (geneve: dst_port=5000, remote_ip=1.1.1.1) +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([tunnel - VXLAN]) OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=vxlan \ options:remote_ip=1.1.1.1 ofport_request=1]) @@ -375,6 +393,8 @@ options:remote_ip=flow ofport_request=4 \ -- add-port br0 p5 -- set Interface p5 type=gre options:key=flow \ options:remote_ip=5.5.5.5 ofport_request=5]) + +OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP ADD_OF_PORTS([br0], [90]) AT_DATA([flows.txt], [dnl in_port=90 actions=resubmit:1,resubmit:2,resubmit:3,resubmit:4,resubmit:5 @@ -387,7 +407,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(tunnel(tun_id=0x2a,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,src=1.1.1.1,dst=4.4.4.4,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,key))),1 + [Datapath actions: set(tunnel(tun_id=0x2a,dst=1.1.1.1,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,dst=3.3.3.3,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,src=1.1.1.1,dst=4.4.4.4,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x3,dst=2.2.2.2,ttl=64,flags(df,key))),1 ]) OVS_VSWITCHD_STOP AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/tunnel-push-pop.at openvswitch-2.4.0~git20150623/tests/tunnel-push-pop.at --- openvswitch-2.3.1/tests/tunnel-push-pop.at 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/tunnel-push-pop.at 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,119 @@ +AT_BANNER([tunnel_push_pop]) + +AT_SETUP([tunnel_push_pop - action]) + +OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1]) +AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0]) +AT_CHECK([ovs-vsctl add-port int-br t2 -- set Interface t2 type=vxlan \ + options:remote_ip=1.1.2.92 options:key=123 ofport_request=2\ + -- add-port int-br t1 -- set Interface t1 type=gre \ + options:remote_ip=1.1.2.92 options:key=456 ofport_request=3\ + -- add-port int-br t3 -- set Interface t3 type=vxlan \ + options:remote_ip=1.1.2.93 options:out_key=flow options:csum=true ofport_request=4\ + -- add-port int-br t4 -- set Interface t4 type=geneve \ + options:remote_ip=1.1.2.92 options:key=123 ofport_request=5\ + ], [0]) + +AT_CHECK([ovs-appctl dpif/show], [0], [dnl +dummy@ovs-dummy: hit:0 missed:0 + br0: + br0 65534/100: (dummy) + p0 1/1: (dummy) + int-br: + int-br 65534/2: (dummy) + t1 3/3: (gre: key=456, remote_ip=1.1.2.92) + t2 2/4789: (vxlan: key=123, remote_ip=1.1.2.92) + t3 4/4789: (vxlan: csum=true, out_key=flow, remote_ip=1.1.2.93) + t4 5/6081: (geneve: key=123, remote_ip=1.1.2.92) +]) + +AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK +]) +AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK +]) + +AT_CHECK([ovs-ofctl add-flow br0 action=normal]) + +dnl Check ARP Snoop +AT_CHECK([ovs-appctl netdev-dummy/receive br0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=1,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)']) +AT_CHECK([ovs-appctl netdev-dummy/receive br0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b7,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.93,tip=1.1.2.88,op=1,sha=f8:bc:12:44:34:b7,tha=00:00:00:00:00:00)']) + +AT_CHECK([ovs-appctl tnl/arp/show], [0], [dnl +IP MAC Bridge +============================================= +1.1.2.92 f8:bc:12:44:34:b6 br0 +1.1.2.93 f8:bc:12:44:34:b7 br0 +]) + +AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl +Listening ports: +genev_sys_6081 (6081) : eth_type(0x0800),ipv4(src=1.1.2.92,proto=17,frag=no),udp(dst=6081) +gre_sys (3) : eth_type(0x0800),ipv4(src=1.1.2.92,proto=47,frag=no) +vxlan_sys_4789 (4789) : eth_type(0x0800),ipv4(src=1.1.2.92,proto=17,frag=no),udp(dst=4789) +vxlan_sys_4789 (4789) : eth_type(0x0800),ipv4(src=1.1.2.93,proto=17,frag=no),udp(dst=4789) +]) + +dnl Check VXLAN tunnel pop +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=4789)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: tnl_pop(4789) +]) + +dnl Check GRE tunnel pop +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: tnl_pop(3) +]) + +dnl Check Geneve tunnel pop +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=1.1.2.92,dst=1.1.2.88,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=6081)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: tnl_pop(6081) +]) + +dnl Check VXLAN tunnel push +AT_CHECK([ovs-ofctl add-flow int-br action=2]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x40),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0x8000000,vni=0x7b)),out_port(100)) +]) + +dnl Check VXLAN tunnel push set tunnel id by flow and checksum +AT_CHECK([ovs-ofctl add-flow int-br "actions=set_tunnel:124,4"]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.93,proto=17,tos=0,ttl=64,frag=0x40),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x7c)),out_port(100)) +]) + +dnl Check GRE tunnel push +AT_CHECK([ovs-ofctl add-flow int-br action=3]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: tnl_push(tnl_port(3),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x40),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)) +]) + +dnl Check Geneve tunnel push +AT_CHECK([ovs-ofctl add-flow int-br action=5]) +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: tnl_push(tnl_port(6081),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x40),udp(src=0,dst=6081,csum=0x0),geneve(vni=0x7b)),out_port(100)) +]) + +dnl Check decapsulation of GRE packet +AT_CHECK([ovs-appctl netdev-dummy/receive p0 '001b213cac30001b213cab6408004500007e79464000402f99080101025c0101025820006558000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637']) +ovs-appctl time/warp 1000 + +AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 3'], [0], [dnl + port 3: rx pkts=1, bytes=98, drop=0, errs=0, frame=0, over=0, crc=0 +]) + +dnl Check GRE only accepts encapsulated Ethernet frames +AT_CHECK([ovs-appctl netdev-dummy/receive p0 '001b213cac30001b213cab6408004500007e79464000402f99080101025c0101025820000800000001c8fe71d883724fbeb6f4e1494a080045000054ba200000400184861e0000011e00000200004227e75400030af3195500000000f265010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637']) +ovs-appctl time/warp 1000 + +AT_CHECK([ovs-ofctl dump-ports int-br | grep 'port 3'], [0], [dnl + port 3: rx pkts=1, bytes=98, drop=0, errs=0, frame=0, over=0, crc=0 +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/unixctl-py.at openvswitch-2.4.0~git20150623/tests/unixctl-py.at --- openvswitch-2.3.1/tests/unixctl-py.at 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/unixctl-py.at 2015-06-23 18:46:21.000000000 +0000 @@ -14,16 +14,16 @@ OVS_WAIT_WHILE([test -s ovsdb-server.pid]) AT_CLEANUP -AT_SETUP([unixctl ovs-vswitchd help - Python]) +AT_SETUP([unixctl ovs-vswitchd list-commands - Python]) AT_SKIP_IF([test $HAVE_PYTHON = no]) OVS_VSWITCHD_START -AT_CHECK([APPCTL help], [0], [stdout]) +AT_CHECK([APPCTL list-commands], [0], [stdout]) AT_CHECK([head -1 stdout], [0], [dnl The available commands are: ]) mv stdout expout -AT_CHECK([PYAPPCTL help], [0], [expout]) +AT_CHECK([PYAPPCTL list-commands], [0], [expout]) OVS_VSWITCHD_STOP AT_CLEANUP diff -Nru openvswitch-2.3.1/tests/vlan-splinters.at openvswitch-2.4.0~git20150623/tests/vlan-splinters.at --- openvswitch-2.3.1/tests/vlan-splinters.at 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/vlan-splinters.at 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,7 @@ AT_BANNER([VLAN splinters]) AT_SETUP([VLAN splinters]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) OVS_VSWITCHD_START([], [], [=override]) ADD_OF_PORTS([br0], 1, 2, 3, 4) AT_CHECK([ovs-vsctl \ @@ -30,7 +31,7 @@ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "in_port($splinter_port)"], [0], [stdout]) AT_CHECK_UNQUOTED([sed -n '/^Flow/p; /^Datapath/p' stdout], [0], [dnl -Flow: metadata=0,in_port=$p1,dl_vlan=$vlan,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x05ff +Flow: in_port=$p1,dl_vlan=$vlan,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x05ff Datapath actions: $access_port ]) diff -Nru openvswitch-2.3.1/tests/vlog.at openvswitch-2.4.0~git20150623/tests/vlog.at --- openvswitch-2.3.1/tests/vlog.at 2014-10-09 20:14:02.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tests/vlog.at 2015-06-23 18:46:21.000000000 +0000 @@ -208,7 +208,7 @@ AT_CHECK([APPCTL -t test-unixctl.py vlog/set daemon:syslog:err]) AT_CHECK([APPCTL -t test-unixctl.py vlog/set file:dbg]) AT_CHECK([APPCTL -t test-unixctl.py vlog/set nonexistent], [0], - [no facility, level, or module "nonexistent" + [no destination, level, or module "nonexistent" ]) AT_CHECK([APPCTL -t test-unixctl.py vlog/list], [0], [dnl console syslog file @@ -225,12 +225,75 @@ ]) AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern], [0], - [Please supply a valid pattern and facility + [Please supply a valid pattern and destination ]) AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern:nonexistent], [0], - [Facility nonexistent does not exist + [Destination nonexistent does not exist ]) AT_CHECK([APPCTL -t test-unixctl.py vlog/set pattern:file:'I<3OVS|%m']) AT_CHECK([APPCTL -t test-unixctl.py log patterntest]) AT_CHECK([grep -q 'I<3OVS' log]) AT_CLEANUP + +AT_SETUP([vlog - RFC5424 facility]) +OVS_RUNDIR=`pwd`; export OVS_RUNDIR +OVS_LOGDIR=`pwd`; export OVS_LOGDIR +OVS_DBDIR=`pwd`; export OVS_DBDIR +OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR +ON_EXIT([kill `cat ovsdb-server.pid`]) + +dnl Create database. +touch .conf.db.~lock~ +AT_CHECK([ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema]) + +AT_CHECK([ovsdb-server --detach --no-chdir --pidfile \ + --remote=punix:$OVS_RUNDIR/db.sock -vPATTERN:file:"<%B>1 %A %m" \ + --log-file], [0], [], [stderr]) +AT_CHECK([ovs-appctl -t ovsdb-server exit]) + +# A default facility of LOG_LOCAL0 while writing to file. +AT_CHECK([cat ovsdb-server.log | head -1 | awk '{print $1}'], [0], [<133>1 +]) +rm ovsdb-server.log + +AT_CHECK([ovsdb-server --detach --no-chdir --pidfile \ + --remote=punix:$OVS_RUNDIR/db.sock -vPATTERN:file:"<%B>1 %A %m" \ + -vFACILITY:daemon --log-file], [0], [], [stderr]) + +AT_CHECK([cat ovsdb-server.log | head -1 | awk '{print $1}'], [0], [<29>1 +]) + +AT_CHECK([ovs-appctl -t ovsdb-server vlog/set FACILITY:invalid], [2], [], +[invalid facility +ovs-appctl: ovsdb-server: server returned an error +]) + +AT_CHECK([ovs-appctl -t ovsdb-server vlog/set FACILITY:local7]) +AT_CHECK([ovs-appctl -t ovsdb-server vlog/set ANY:file:DBG]) +AT_CHECK([ovs-appctl -t ovsdb-server exit]) + +AT_CHECK([cat ovsdb-server.log | tail -1 | awk '{print $1}'], [0], [<191>1 +]) +AT_CLEANUP + +AT_SETUP([vlog - RFC5424 facility - Python]) +AT_SKIP_IF([test $HAVE_PYTHON = no]) +OVS_RUNDIR=`pwd`; export OVS_RUNDIR +OVS_LOGDIR=`pwd`; export OVS_LOGDIR +OVS_DBDIR=`pwd`; export OVS_DBDIR +OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR +ON_EXIT([kill `cat test-unixctl.py.pid`]) + +AT_CHECK([$PYTHON $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \ +-vFACILITY:invalid --detach], [1], [], [test-unixctl.py: processing "FACILITY:invalid": Facility invalid is invalid +]) + +AT_CHECK([$PYTHON $srcdir/test-unixctl.py --log-file=`pwd`/log --pidfile \ +-vFACILITY:daemon --detach]) + +AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:invalid], [0], +[Facility invalid is invalid +]) + +AT_CHECK([ovs-appctl -t test-unixctl.py vlog/set FACILITY:local0]) +AT_CLEANUP diff -Nru openvswitch-2.3.1/third-party/automake.mk openvswitch-2.4.0~git20150623/third-party/automake.mk --- openvswitch-2.3.1/third-party/automake.mk 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/third-party/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,3 +1,2 @@ -EXTRA_DIST += \ - third-party/README \ - third-party/ofp-tcpdump.patch +docs += third-party/README.md +EXTRA_DIST += third-party/ofp-tcpdump.patch diff -Nru openvswitch-2.3.1/third-party/.gitignore openvswitch-2.4.0~git20150623/third-party/.gitignore --- openvswitch-2.3.1/third-party/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/third-party/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff -Nru openvswitch-2.3.1/third-party/ofp-tcpdump.patch openvswitch-2.4.0~git20150623/third-party/ofp-tcpdump.patch --- openvswitch-2.3.1/third-party/ofp-tcpdump.patch 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/third-party/ofp-tcpdump.patch 2015-06-23 18:46:21.000000000 +0000 @@ -125,7 +125,7 @@ else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) { ldp_print(bp, length); - } -+ } else if (sport == OFP_OLD_PORT || dport == OFP_OLD_PORT) { ++ } else if (sport == OFP_PORT || dport == OFP_PORT) { + openflow_print(bp, length); + } diff -Nru openvswitch-2.3.1/third-party/README openvswitch-2.4.0~git20150623/third-party/README --- openvswitch-2.3.1/third-party/README 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/third-party/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -This directory contains third-party software that may be useful for -debugging. - -tcpdump -------- -The "ofp-tcpdump.patch" patch adds the ability to parse OpenFlow -messages to tcpdump. These instructions assume that tcpdump 4.3.0 -is going to be used, but it should work with other versions that are not -substantially different. To begin, download tcpdump and apply the -patch: - - wget http://www.tcpdump.org/release/tcpdump-4.3.0.tar.gz - tar xzf tcpdump-4.3.0.tar.gz - ln -s tcpdump-4.3.0 tcpdump - patch -p0 < ofp-tcpdump.patch - -Then build the new version of tcpdump: - - cd tcpdump - ./configure - make - -Clearly, tcpdump can only parse unencrypted packets, so you will need to -connect the controller and datapath using plain TCP. To look at the -traffic, tcpdump will be started in a manner similar to the following: - - sudo ./tcpdump -s0 -i eth0 port 6633 - -The "-s0" flag indicates that tcpdump should capture the entire packet. -If the OpenFlow message is not received in its entirety, "[|openflow]" will -be printed instead of the OpenFlow message contents. - -The verbosity of the output may be increased by adding additional "-v" -flags. If "-vvv" is used, the raw OpenFlow data is also printed in -hex and ASCII. diff -Nru openvswitch-2.3.1/third-party/README.md openvswitch-2.4.0~git20150623/third-party/README.md --- openvswitch-2.3.1/third-party/README.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/third-party/README.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,38 @@ +Third-party software integration +================================ + +This directory contains third-party software that may be useful for +debugging. + +tcpdump +------- +The "ofp-tcpdump.patch" patch adds the ability to parse OpenFlow +messages to tcpdump. These instructions assume that tcpdump 4.3.0 +is going to be used, but it should work with other versions that are not +substantially different. To begin, download tcpdump and apply the +patch: + + wget http://www.tcpdump.org/release/tcpdump-4.3.0.tar.gz + tar xzf tcpdump-4.3.0.tar.gz + ln -s tcpdump-4.3.0 tcpdump + patch -p0 < ofp-tcpdump.patch + +Then build the new version of tcpdump: + + cd tcpdump + ./configure + make + +Clearly, tcpdump can only parse unencrypted packets, so you will need to +connect the controller and datapath using plain TCP. To look at the +traffic, tcpdump will be started in a manner similar to the following: + + sudo ./tcpdump -s0 -i eth0 port 6653 + +The "-s0" flag indicates that tcpdump should capture the entire packet. +If the OpenFlow message is not received in its entirety, "[|openflow]" will +be printed instead of the OpenFlow message contents. + +The verbosity of the output may be increased by adding additional "-v" +flags. If "-vvv" is used, the raw OpenFlow data is also printed in +hex and ASCII. diff -Nru openvswitch-2.3.1/TODO openvswitch-2.4.0~git20150623/TODO --- openvswitch-2.3.1/TODO 2014-12-04 05:21:55.000000000 +0000 +++ openvswitch-2.4.0~git20150623/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,302 +0,0 @@ - Open vSwitch Project Ideas - ========================== - -This file lists a number of project ideas for Open vSwitch. The ideas -here overlap somewhat with those in the OPENFLOW-1.1+ file. - - -Programming Project Ideas -========================= - -Each of these projects would ideally result in a patch or a short -series of them posted to ovs-dev. - -Please read CONTRIBUTING and CodingStyle in the top of the source tree -before you begin work. The OPENFLOW-1.1+ file also has an -introduction to how OpenFlow is implemented in Open vSwitch. It is -also a good idea to look around the source tree for related code, and -back through the Git history for commits on related subjects, to allow -you to follow existing patterns and conventions. - -Meters ------- - -Open vSwitch has OpenFlow protocol support for meters, but it does not -have an implementation in the kernel or userspace datapaths. An -implementation was proposed some time ago (I recommend looking for the -discussion in the ovs-dev mailing list archives), but for a few -different reasons it was not accepted. Some of those reasons apply -only to a kernel implementation of meters. At the time, a userspace -implementation wasn't as interesting, because the userspace switch -did not perform at a production speed, but with the advent of -multithreaded forwarding and, now, DPDK support, userspace-only meters -would be a great way to get started. - -Improve SSL/TLS Security ------------------------- - -Open vSwitch allows some weak ciphers to be used for its secure -connections. Security audits often suggest that the project remove -those ciphers, but there's not a clean way to modify the acceptable -ciphers. At the very least, the cipher list should be audited, but it -would be nice to make it configurable. - -Open vSwitch does not insist on perfect forward security via ephemeral -Diffie-Hellman key exchange when it establishes an SSL/TLS connection. -Given the wiretapping revelations over the last year, it seems wise to -turn this on. (This would probably amount to finding the right -OpenSSL function to call or just reducing the acceptable ciphers -further.) - -These changes might have backward-compatibility implications; one -would have to test the behavior of the reduced cipher list OVS against -older versions. - -OpenFlow Group Bucket Stats ---------------------------- - -When OpenFlow group support was added, we forgot to support statistics -for individual buckets. xlate_group_bucket() in -ofproto/ofproto-dpif-xlate.c appears to be where we need to increment -the counters, in the case where ctx->xin->resubmit_stats is -nonnull. See the ovs-dev thread starting here: -http://openvswitch.org/pipermail/dev/2014-January/036107.html - -Joe Stringer adds: If this involves resubmit_stats, then it would also -need a new xc_type. The xlate_group_bucket() code would add an entry -to ctx->xin->xcache if it is nonnull. This would also need to follow -the code in xlate_push_stats() and xlate_cache_clear() for the new -xc_type. - - -Bash Command Completion ------------------------ - -ovs-vsctl and other programs would be easier to use if bash command -completion (with ``tab'', etc.) were supported. Alex Wang - is leading a team for this project. - -Auxiliary Connections ---------------------- - -Auxiliary connections are a feature of OpenFlow 1.3 and later that -allow OpenFlow messages to be carried over datagram channels such as -UDP or DTLS. One place to start would be to implement a datagram -abstraction library for OVS analogous to the ``stream'' library -that already abstracts TCP, SSL, and other stream protocols. - -Controller connection logging to pcap file ------------------------------------------- - -http://patchwork.openvswitch.org/patch/2249/ is an RFC patch that -allows the switch to record the traffic on OpenFlow controller -connections to a pcap file for later analysis. The patch lacks a good -way to enable and disable the feature. The task here would be to add -that and repost the patch. - -Basic OpenFlow 1.4 support --------------------------- - -Some basic support for OpenFlow 1.4 is missing and needs to be -implemented. These can be found by looking through lib/ofp-util.c for -mentions of OFP14_VERSION followed by a call to OVS_NOT_REACHED (which -aborts the program). - -OpenFlow 1.4: Flow monitoring ------------------------------ - -OpenFlow 1.4 introduces OFPMP_FLOW_MONITOR for notifying a controller -of changes to selected flow tables. This feature is based on -NXST_FLOW_MONITOR that is already part of Open vSwitch, so to -implement this feature would be to extend that code to handle the -OpenFlow 1.4 wire protocol. - -OpenFlow 1.3 also includes this feature as a ONF-defined extension, so -ideally OVS would support that too. - -OpenFlow 1.4 Role Status Message --------------------------------- - -OpenFlow 1.4 section 7.4.4 ``Controller Role Status Message'' -defines a new message sent by a switch to notify the controller that -its role (whether it is a master or a slave) has changed. OVS should -implement this. - -OpenFlow 1.3 also includes this feature as a ONF-defined extension, so -ideally OVS would support that too. - -OpenFlow 1.4 Vacancy Events ---------------------------- - -OpenFlow 1.4 section 7.4.5 ``Table Status Message'' defines a new -message sent by a switch to notify the controller that a flow table is -close to filling up (or that it is no longer close to filling up). -OVS should implement this. - -OpenFlow 1.3 also includes this feature as a ONF-defined extension, so -ideally OVS would support that too. - -OpenFlow 1.4 Group and Meter Change Notification ------------------------------------------------- - -OpenFlow 1.4 adds a feature whereby a controller can ask the switch to -send it copies of messages that change groups and meters. (This is -only useful in the presence of multiple controllers.) OVS should -implement this. - -OpenFlow 1.3 also includes this feature as a ONF-defined extension, so -ideally OVS would support that too. - - -Testing Project Ideas -===================== - -Each of these projects would ideally result in confirmation that -features work or bug reports explaining how they do not. Please sent -bug reports to dev at openvswitch.org, with as many details as you have. - -ONF Plugfest Results Analysis ------------------------------ - -Ben Pfaff has a collection of files reporting Open vSwitch conformance -to OpenFlow 1.3 provided by one of the vendors at the ONF plugfest -last year. Some of the reported failures have been fixed, some of the -other failures probably result from differing interpretations of -OpenFlow 1.3, and others are probably genuine bugs in Open vSwitch. -Open vSwitch has also improved in the meantime. Ben can provide the -results, privately, to some person or team who wishes to check them -out and try to pick out the genuine bugs. - -OpenFlow Fuzzer ---------------- - -Build a ``fuzzer'' for the OpenFlow protocol (or use an existing -one, if there is one) and run it against the Open vSwitch -implementation. One could also build a fuzzer for the OSVDB protocol. - -Ryu Certification Tests Analysis --------------------------------- - -The Ryu controller comes with a suite of ``certification tests'' -that check the correctness of a switch's implementation of various -OpenFlow 1.3 features. The INSTALL file in the OVS source tree has a -section that explains how to easily run these tests against an OVS -source tree. Run the tests and figure out whether any tests fail but -should pass. (Some tests fail and should fail because OVS does not -implement the particular feature; for example, OVS does not implement -PBB encapsulation, so related tests fail.) - -OFTest Results Analysis ------------------------ - -OFTest is a test suite for OpenFlow 1.0 compliance. The INSTALL file -in the OVS source tree has a section that explains how to easily run -these tests against an OVS source tree. Run the tests and figure out -whether any tests fail but should pass, and ideally why. OFTest is -not particularly well vetted--in the past, at least, some tests have -failed against OVS due to bugs in OFTest, not in OVS--so some care is -warranted. - - -Documentation Project Ideas -=========================== - -Each of these projects would ideally result in creating some new -documentation for users. Some documentation might be suitable to -accompany Open vSwitch as part of its source tree most likely either -in plain text or ``nroff'' (manpage) format. - -OpenFlow Basics Tutorial ------------------------- - -Open vSwitch has a tutorial that covers its advanced features, but it -does not have a basic tutorial. There are several tutorials on the -Internet already, so a new tutorial would have to distinguish itself -in some way. One way would be to use the Open vSwitch ``sandbox'' -environment already used in the advanced tutorial. The sandbox does -not require any real network or even supervisor privilege on the -machine where it runs, and thus it is easy to use with hardly any -up-front setup, so it is a gentle way to get started. - -FlowVisor via patch ports -------------------------- - -FlowVisor is a proxy that sits between OpenFlow controllers and a -switch. It divides up switch resources, allowing each controller to -control a ``slice'' of the network. For example, it can break up a -network based on VLAN, allowing different controllers to handle -packets with different VLANs. - -It seems that Open vSwitch has features that allow it to implement at -least simple forms of FlowVisor control without any need for -FlowVisor. Consider an Open vSwitch instance with three bridges. -Bridge br0 has physical ports eth0 and eth1. Bridge v9 has no -physical ports, but it has two ``patch ports'' that connect it to -br0. Bridge v11 has the same setup. Flows in br0 match packets -received on vlan 9, strip the vlan header, and direct them to the -appropriate patch port leading to v9. Additional flows in br0 match -packets received from v9, attach a VLAN 9 tag to them, and direct them -out eth0 or eth1 as appropriate. Other flows in br0 treat packets on -VLAN 11 similarly. Controllers attached to bridge v9 or v11 may thus -work as if they had full control of a network. - -It seems to me that this is a good example of the power of OpenFlow -and Open vSwitch. The point of this project is to explain how to do -this, with detailed examples, in case someone finds it handy and to -open eyes toward the generality of Open vSwitch usefulness. - -``Cookbooks'' -------------- - -The Open vSwitch website has a few ``cookbook'' entries that -describe how to use Open vSwitch in a few scenarios. There are only a -few of these and all of them are dated. It would be a good idea to -come up with ideas for some more and write them. These could be added -to the Open vSwitch website or the source tree or somewhere else. - -Demos ------ - -Record a demo of Open vSwitch functionality in use (or something else -relevant) and post it to youtube or another video site so that we can -link to it from openvswitch.org. - - -How to contribute -================= - -If you plan to contribute code for a feature, please let everyone know -on ovs-dev before you start work. This will help avoid duplicating -work. - -Please consider the following: - - * Testing. Please test your code. - - * Unit tests. Please consider writing some. The tests directory - has many examples that you can use as a starting point. - - * ovs-ofctl. If you add a feature that is useful for some - ovs-ofctl command then you should add support for it there. - - * Documentation. If you add a user-visible feature, then you - should document it in the appropriate manpage and mention it in - NEWS as well. - - * Coding style (see the CodingStyle file at the top of the source - tree). - - * The patch submission guidelines (see CONTRIBUTING). I - recommend using "git send-email", which automatically follows a - lot of those guidelines. - - -Bug Reporting -============= - -Please report problems to bugs@openvswitch.org. - - -Local Variables: -mode: text -End: diff -Nru openvswitch-2.3.1/TODO.md openvswitch-2.4.0~git20150623/TODO.md --- openvswitch-2.3.1/TODO.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/TODO.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,289 @@ +Open vSwitch Project Ideas +========================== + +This file lists a number of project ideas for Open vSwitch. The ideas +here overlap somewhat with those in the [OPENFLOW-1.1+.md] file. + + +Programming Project Ideas +========================= + +Each of these projects would ideally result in a patch or a short +series of them posted to ovs-dev. + +Please read [CONTRIBUTING.md] and [CodingStyle.md] in the top of the +source tree before you begin work. The [OPENFLOW-1.1+.md] file also has +an introduction to how OpenFlow is implemented in Open vSwitch. It is +also a good idea to look around the source tree for related code, and +back through the Git history for commits on related subjects, to allow +you to follow existing patterns and conventions. + +Meters +------ + +Open vSwitch has OpenFlow protocol support for meters, but it does not +have an implementation in the kernel or userspace datapaths. An +implementation was proposed some time ago (I recommend looking for the +discussion in the ovs-dev mailing list archives), but for a few +different reasons it was not accepted. Some of those reasons apply +only to a kernel implementation of meters. At the time, a userspace +implementation wasn't as interesting, because the userspace switch +did not perform at a production speed, but with the advent of +multithreaded forwarding and, now, DPDK support, userspace-only meters +would be a great way to get started. + +Improve SSL/TLS Security +------------------------ + +Open vSwitch allows some weak ciphers to be used for its secure +connections. Security audits often suggest that the project remove +those ciphers, but there's not a clean way to modify the acceptable +ciphers. At the very least, the cipher list should be audited, but it +would be nice to make it configurable. + +Open vSwitch does not insist on perfect forward security via ephemeral +Diffie-Hellman key exchange when it establishes an SSL/TLS connection. +Given the wiretapping revelations over the last year, it seems wise to +turn this on. (This would probably amount to finding the right +OpenSSL function to call or just reducing the acceptable ciphers +further.) + +These changes might have backward-compatibility implications; one +would have to test the behavior of the reduced cipher list OVS against +older versions. + +Bash Command Completion +----------------------- + +ovs-vsctl and other programs would be easier to use if bash command +completion (with ``tab'', etc.) were supported. Alex Wang + is leading a team for this project. + +Auxiliary Connections +--------------------- + +Auxiliary connections are a feature of OpenFlow 1.3 and later that +allow OpenFlow messages to be carried over datagram channels such as +UDP or DTLS. One place to start would be to implement a datagram +abstraction library for OVS analogous to the ``stream'' library +that already abstracts TCP, SSL, and other stream protocols. + +Controller connection logging to pcap file +------------------------------------------ + +http://patchwork.openvswitch.org/patch/2249/ is an RFC patch that +allows the switch to record the traffic on OpenFlow controller +connections to a pcap file for later analysis. The patch lacks a good +way to enable and disable the feature. The task here would be to add +that and repost the patch. + +Basic OpenFlow 1.4 support +-------------------------- + +Some basic support for OpenFlow 1.4 is missing and needs to be +implemented. These can be found by looking through lib/ofp-util.c for +mentions of OFP14_VERSION followed by a call to OVS_NOT_REACHED (which +aborts the program). + +OpenFlow 1.4: Flow monitoring +----------------------------- + +OpenFlow 1.4 introduces OFPMP_FLOW_MONITOR for notifying a controller +of changes to selected flow tables. This feature is based on +NXST_FLOW_MONITOR that is already part of Open vSwitch, so to +implement this feature would be to extend that code to handle the +OpenFlow 1.4 wire protocol. + +OpenFlow 1.3 also includes this feature as a ONF-defined extension, so +ideally OVS would support that too. + +OpenFlow 1.4 Role Status Message +-------------------------------- + +OpenFlow 1.4 section 7.4.4 ``Controller Role Status Message'' +defines a new message sent by a switch to notify the controller that +its role (whether it is a master or a slave) has changed. OVS should +implement this. + +OpenFlow 1.3 also includes this feature as a ONF-defined extension, so +ideally OVS would support that too. + +OpenFlow 1.4 Vacancy Events +--------------------------- + +OpenFlow 1.4 section 7.4.5 ``Table Status Message'' defines a new +message sent by a switch to notify the controller that a flow table is +close to filling up (or that it is no longer close to filling up). +OVS should implement this. + +OpenFlow 1.3 also includes this feature as a ONF-defined extension, so +ideally OVS would support that too. + +OpenFlow 1.4 Group and Meter Change Notification +------------------------------------------------ + +OpenFlow 1.4 adds a feature whereby a controller can ask the switch to +send it copies of messages that change groups and meters. (This is +only useful in the presence of multiple controllers.) OVS should +implement this. + +OpenFlow 1.3 also includes this feature as a ONF-defined extension, so +ideally OVS would support that too. + + +Testing Project Ideas +===================== + +Each of these projects would ideally result in confirmation that +features work or bug reports explaining how they do not. Please sent +bug reports to dev at openvswitch.org, with as many details as you have. + +ONF Plugfest Results Analysis +----------------------------- + +Ben Pfaff has a collection of files reporting Open vSwitch conformance +to OpenFlow 1.3 provided by one of the vendors at the ONF plugfest +last year. Some of the reported failures have been fixed, some of the +other failures probably result from differing interpretations of +OpenFlow 1.3, and others are probably genuine bugs in Open vSwitch. +Open vSwitch has also improved in the meantime. Ben can provide the +results, privately, to some person or team who wishes to check them +out and try to pick out the genuine bugs. + +OpenFlow Fuzzer +--------------- + +Build a ``fuzzer'' for the OpenFlow protocol (or use an existing +one, if there is one) and run it against the Open vSwitch +implementation. One could also build a fuzzer for the OSVDB protocol. + +Ryu Certification Tests Analysis +-------------------------------- + +The Ryu controller comes with a suite of ``certification tests'' +that check the correctness of a switch's implementation of various +OpenFlow 1.3 features. The INSTALL file in the OVS source tree has a +section that explains how to easily run these tests against an OVS +source tree. Run the tests and figure out whether any tests fail but +should pass. (Some tests fail and should fail because OVS does not +implement the particular feature; for example, OVS does not implement +PBB encapsulation, so related tests fail.) + +OFTest Results Analysis +----------------------- + +OFTest is a test suite for OpenFlow 1.0 compliance. The INSTALL file +in the OVS source tree has a section that explains how to easily run +these tests against an OVS source tree. Run the tests and figure out +whether any tests fail but should pass, and ideally why. OFTest is +not particularly well vetted--in the past, at least, some tests have +failed against OVS due to bugs in OFTest, not in OVS--so some care is +warranted. + + +Documentation Project Ideas +=========================== + +Each of these projects would ideally result in creating some new +documentation for users. Some documentation might be suitable to +accompany Open vSwitch as part of its source tree most likely either +in plain text or ``nroff'' (manpage) format. + +OpenFlow Basics Tutorial +------------------------ + +Open vSwitch has a tutorial that covers its advanced features, but it +does not have a basic tutorial. There are several tutorials on the +Internet already, so a new tutorial would have to distinguish itself +in some way. One way would be to use the Open vSwitch ``sandbox'' +environment already used in the advanced tutorial. The sandbox does +not require any real network or even supervisor privilege on the +machine where it runs, and thus it is easy to use with hardly any +up-front setup, so it is a gentle way to get started. + +FlowVisor via patch ports +------------------------- + +FlowVisor is a proxy that sits between OpenFlow controllers and a +switch. It divides up switch resources, allowing each controller to +control a ``slice'' of the network. For example, it can break up a +network based on VLAN, allowing different controllers to handle +packets with different VLANs. + +It seems that Open vSwitch has features that allow it to implement at +least simple forms of FlowVisor control without any need for +FlowVisor. Consider an Open vSwitch instance with three bridges. +Bridge br0 has physical ports eth0 and eth1. Bridge v9 has no +physical ports, but it has two ``patch ports'' that connect it to +br0. Bridge v11 has the same setup. Flows in br0 match packets +received on vlan 9, strip the vlan header, and direct them to the +appropriate patch port leading to v9. Additional flows in br0 match +packets received from v9, attach a VLAN 9 tag to them, and direct them +out eth0 or eth1 as appropriate. Other flows in br0 treat packets on +VLAN 11 similarly. Controllers attached to bridge v9 or v11 may thus +work as if they had full control of a network. + +It seems to me that this is a good example of the power of OpenFlow +and Open vSwitch. The point of this project is to explain how to do +this, with detailed examples, in case someone finds it handy and to +open eyes toward the generality of Open vSwitch usefulness. + +``Cookbooks'' +------------- + +The Open vSwitch website has a few ``cookbook'' entries that +describe how to use Open vSwitch in a few scenarios. There are only a +few of these and all of them are dated. It would be a good idea to +come up with ideas for some more and write them. These could be added +to the Open vSwitch website or the source tree or somewhere else. + +Demos +----- + +Record a demo of Open vSwitch functionality in use (or something else +relevant) and post it to youtube or another video site so that we can +link to it from openvswitch.org. + + +How to contribute +================= + +If you plan to contribute code for a feature, please let everyone know +on ovs-dev before you start work. This will help avoid duplicating +work. + +Please consider the following: + + * Testing. Please test your code. + + * Unit tests. Please consider writing some. The tests directory + has many examples that you can use as a starting point. + + * ovs-ofctl. If you add a feature that is useful for some + ovs-ofctl command then you should add support for it there. + + * Documentation. If you add a user-visible feature, then you + should document it in the appropriate manpage and mention it in + NEWS as well. + + * Coding style (see the [CodingStyle.md] file at the top of the + source tree). + + * The patch submission guidelines (see [CONTRIBUTING.md]). I + recommend using "git send-email", which automatically follows a + lot of those guidelines. + + +Bug Reporting +============= + +Please report problems to bugs@openvswitch.org. + + +Local Variables: +mode: text +End: + +[OPENFLOW-1.1+.md]:OPENFLOW-1.1+.md +[CONTRIBUTING.md]:CONTRIBUTING.md +[CodingStyle.md]:CodingStyle.md diff -Nru openvswitch-2.3.1/.travis/build.sh openvswitch-2.4.0~git20150623/.travis/build.sh --- openvswitch-2.3.1/.travis/build.sh 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/.travis/build.sh 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,111 @@ +#!/bin/bash + +set -o errexit + +KERNELSRC="" +CFLAGS="-Werror" +SPARSE_FLAGS="" +EXTRA_OPTS="" + +function install_kernel() +{ + if [[ "$1" =~ ^4.* ]]; then + PREFIX="v4.x" + elif [[ "$1" =~ ^3.* ]]; then + PREFIX="v3.x" + else + PREFIX="v2.6/longterm/v2.6.32" + fi + + wget https://www.kernel.org/pub/linux/kernel/${PREFIX}/linux-${1}.tar.gz + tar xzvf linux-${1}.tar.gz > /dev/null + cd linux-${1} + make allmodconfig + + # Older kernels do not include openvswitch + if [ -d "net/openvswitch" ]; then + make net/openvswitch/ + else + make net/bridge/ + fi + + KERNELSRC=$(pwd) + if [ ! "$DPDK" ]; then + EXTRA_OPTS="--with-linux=$(pwd)" + fi + echo "Installed kernel source in $(pwd)" + cd .. +} + +function install_dpdk() +{ + if [ -n "$DPDK_GIT" ]; then + git clone $DPDK_GIT dpdk-$1 + cd dpdk-$1 + git checkout v$1 + else + wget http://www.dpdk.org/browse/dpdk/snapshot/dpdk-$1.tar.gz + tar xzvf dpdk-$1.tar.gz > /dev/null + cd dpdk-$1 + fi + find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/' + sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' config/common_linuxapp + sed -ri 's,(CONFIG_RTE_LIBRTE_VHOST=).*,\1y,' config/common_linuxapp + sed -ri 's,(CONFIG_RTE_LIBRTE_VHOST_USER=).*,\1n,' config/common_linuxapp + sed -ri '/CONFIG_RTE_LIBNAME/a CONFIG_RTE_BUILD_FPIC=y' config/common_linuxapp + sed -ri '/EXECENV_CFLAGS = -pthread -fPIC/{s/$/\nelse ifeq ($(CONFIG_RTE_BUILD_FPIC),y)/;s/$/\nEXECENV_CFLAGS = -pthread -fPIC/}' mk/exec-env/linuxapp/rte.vars.mk + make config CC=gcc T=x86_64-native-linuxapp-gcc + make CC=gcc RTE_KERNELDIR=$KERNELSRC + echo "Installed DPDK source in $(pwd)" + cd .. +} + +function configure_ovs() +{ + ./boot.sh && ./configure $* +} + +if [ "$KERNEL" ] || [ "$DPDK" ]; then + install_kernel $KERNEL +fi + +if [ "$DPDK" ]; then + if [ -z "$DPDK_VER" ]; then + DPDK_VER="2.0.0" + fi + install_dpdk $DPDK_VER + if [ "$CC" = "clang" ]; then + # Disregard cast alignment errors until DPDK is fixed + CFLAGS="$CFLAGS -Wno-cast-align" + fi + EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=./dpdk-$DPDK_VER/build" +elif [ "$CC" != "clang" ]; then + # DPDK headers currently trigger sparse errors + SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error" +fi + +configure_ovs $EXTRA_OPTS $* + +# Only build datapath if we are testing kernel w/o running testsuite +if [ "$KERNEL" ] && [ ! "$TESTSUITE" ] && [ ! "$DPDK" ]; then + cd datapath +fi + +if [ "$CC" = "clang" ]; then + make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument" +elif [[ $BUILD_ENV =~ "-m32" ]]; then + # Disable sparse for 32bit builds on 64bit machine + make CFLAGS="$CFLAGS $BUILD_ENV" +else + make CFLAGS="$CFLAGS $BUILD_ENV $SPARSE_FLAGS" C=1 +fi + +if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then + if ! make distcheck; then + # testsuite.log is necessary for debugging. + cat */_build/tests/testsuite.log + exit 1 + fi +fi + +exit 0 diff -Nru openvswitch-2.3.1/.travis/prepare.sh openvswitch-2.4.0~git20150623/.travis/prepare.sh --- openvswitch-2.3.1/.travis/prepare.sh 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/.travis/prepare.sh 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,11 @@ +#!/bin/bash + +sudo -E apt-get update -qq +sudo -E apt-get install -qq libssl-dev llvm-dev +sudo -E apt-get install -qq gcc-multilib +if [ "$DPDK" ]; then + sudo -E apt-get install -qq libfuse-dev +fi + +git clone git://git.kernel.org/pub/scm/devel/sparse/chrisl/sparse.git +cd sparse && make && sudo -E make install PREFIX=/usr && cd .. diff -Nru openvswitch-2.3.1/.travis.yml openvswitch-2.4.0~git20150623/.travis.yml --- openvswitch-2.3.1/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/.travis.yml 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,29 @@ +language: c +compiler: + - gcc + - clang + +before_install: ./.travis/prepare.sh + +env: + - OPTS="--disable-ssl" + - TESTSUITE=1 KERNEL=3.18.1 + - TESTSUITE=1 OPTS="--enable-shared" + - BUILD_ENV="-m32" OPTS="--disable-ssl" + - KERNEL=4.0.2 + - KERNEL=3.17.7 DPDK=1 + - KERNEL=3.17.7 DPDK=1 OPTS="--enable-shared" + - KERNEL=3.17.7 + - KERNEL=3.16.7 + - KERNEL=3.14.27 + - KERNEL=3.12.35 + - KERNEL=3.10.63 + - KERNEL=3.4.105 + - KERNEL=2.6.32.65 + +script: ./.travis/build.sh $OPTS + +notifications: + email: + recipients: + - secure: KnZ6yDXDcC4VoiI04ZYR4sRTln7q16aXA7gVBa/M1jPWxl3BiTi+4idVE5bgrB1AK5iUwUXN6LQpjOdFDw1U/D+sKt+xmVG5MyLaTYIFp1TUOgtSGeiG3IUhpu125PN1i2EhXNqANyWyStCiISDvJkDe4D/tbBehip1AEBuQONk= diff -Nru openvswitch-2.3.1/tutorial/automake.mk openvswitch-2.4.0~git20150623/tutorial/automake.mk --- openvswitch-2.3.1/tutorial/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tutorial/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ +docs += tutorial/Tutorial.md EXTRA_DIST += \ - tutorial/Tutorial \ tutorial/ovs-sandbox \ tutorial/t-setup \ tutorial/t-stage0 \ @@ -9,4 +9,4 @@ tutorial/t-stage4 sandbox: all - cd $(srcdir)/tutorial && ./ovs-sandbox -b $(abs_builddir) + cd $(srcdir)/tutorial && MAKE=$(MAKE) ./ovs-sandbox -b $(abs_builddir) $(SANDBOXFLAGS) diff -Nru openvswitch-2.3.1/tutorial/.gitignore openvswitch-2.4.0~git20150623/tutorial/.gitignore --- openvswitch-2.3.1/tutorial/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tutorial/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1 @@ +sandbox/ diff -Nru openvswitch-2.3.1/tutorial/ovs-sandbox openvswitch-2.4.0~git20150623/tutorial/ovs-sandbox --- openvswitch-2.3.1/tutorial/ovs-sandbox 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tutorial/ovs-sandbox 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2013 Nicira, Inc. +# Copyright (c) 2013, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,16 +16,51 @@ set -e -run () { - echo "$@" +run() { (cd "$sandbox" && "$@") || exit 1 } +run_xterm() { + title=$1; + shift + run xterm -T "$title" -e "$@" & +} + +rungdb() { + under_gdb=$1 + gdb_run=$2 + shift + shift + + # Remove the --detach and to put the process under gdb control. + # Also remove --vconsole:off to allow error message to show up + # on the console. + # Use "DISPLAY" variable to determine out if X is supported + if $under_gdb && [ "$DISPLAY" ]; then + args=`echo $@ |sed s/--detach//g | sed s/--vconsole:off//g` + xterm_title=$1 + + gdb_cmd="" + if $gdb_run; then + gdb_cmd="-ex run" + fi + + run_xterm $xterm_title gdb $gdb_cmd --args $args + else + run $@ + fi +} + +gdb_vswitchd=false +gdb_ovsdb=false +gdb_vswitchd_ex=false +gdb_ovsdb_ex=false builddir= srcdir= schema= installed=false built=false + for option; do # This option-parsing mechanism borrowed from a Autoconf-generated # configure script under the following license: @@ -63,6 +98,8 @@ -s, --srcdir=DIR specify Open vSwitch source directory These options force ovs-sandbox to use an installed Open vSwitch: -i, --installed use installed Open vSwitch + -g, --gdb-vswitchd run ovs-vswitchd under gdb + -d, --gdb-ovsdb run ovsdb-server under gdb -S, --schema=FILE use FILE as vswitch.ovsschema Other options: @@ -98,6 +135,22 @@ prev=schema installed=: ;; + -g|--gdb-v*) + gdb_vswitchd=true + gdb_vswitchd_ex=false + ;; + -e|--gdb-ex-v*) + gdb_vswitchd=true + gdb_vswitchd_ex=true + ;; + -d|--gdb-o*) + gdb_ovsdb=true + gdb_ovsdb_ex=false + ;; + -r|--gdb-ex-o*) + gdb_ovsdb=true + gdb_ovsdb_ex=true + ;; -*) echo "unrecognized option $option (use --help for help)" >&2 exit 1 @@ -136,7 +189,7 @@ case $srcdir in '') srcdir=$builddir - if test ! -e "$srcdir"/WHY-OVS; then + if test ! -e "$srcdir"/WHY-OVS.md; then srcdir=`cd $builddir/.. && pwd` fi ;; @@ -190,7 +243,7 @@ if $built; then # Easy access to OVS manpages. - (cd "$builddir" && make install-man mandir="$sandbox"/man) + (cd "$builddir" && ${MAKE} install-man mandir="$sandbox"/man) MANPATH=$sandbox/man:; export MANPATH fi @@ -200,11 +253,26 @@ # Create database and start ovsdb-server. touch "$sandbox"/.conf.db.~lock~ run ovsdb-tool create conf.db "$schema" -run ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \ +rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \ --remote=punix:"$sandbox"/db.sock +#Add a small delay to allow ovsdb-server to launch. +sleep 0.1 + +#Wait for ovsdb-server to finish launching. +if test ! -e "$sandbox"/db.sock; then + echo -n "Waiting for ovsdb-server to start..." + while test ! -e "$sandbox"/db.sock; do + sleep 1; + done + echo " Done" +fi + +# Initialize database. +run ovs-vsctl --no-wait -- init + # Start ovs-vswitchd. -run ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file \ +rungdb $gdb_vswitchd $gdb_vswitchd_ex ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file \ --enable-dummy=override -vvconn -vnetdev_dummy cat <>> In this tutorial, paragraphs set off like this designate notes - with additional information that readers may wish to skip on a - first read. - - -Getting Started -=============== - -This is a hands-on tutorial. To get the most out of it, you will need -Open vSwitch binaries. You do not, on the other hand, need any -physical networking hardware or even supervisor privilege on your -system. Instead, we will use a script called "ovs-sandbox", which -accompanies the tutorial, that constructs a software simulated network -environment based on Open vSwitch. - -You can use "ovs-sandbox" three ways: - - * If you have already installed Open vSwitch on your system, then - you should be able to just run "ovs-sandbox" from this directory - without any options. - - * If you have not installed Open vSwitch (and you do not want to - install it), then you can build Open vSwitch according to the - instructions in INSTALL, without installing it. Then run - "./ovs-sandbox -b DIRECTORY" from this directory, substituting - the Open vSwitch build directory for DIRECTORY. - - * As a slight variant on the latter, you can run "make sandbox" - from an Open vSwitch build directory. - -When you run ovs-sandbox, it does the following: - - 1. CAUTION: Deletes any subdirectory of the current directory - named "sandbox" and any files in that directory. - - 2. Creates a new directory "sandbox" in the current directory. - - 3. Sets up special environment variables that ensure that Open - vSwitch programs will look inside the "sandbox" directory - instead of in the Open vSwitch installation directory. - - 4. If you are using a built but not installed Open vSwitch, - installs the Open vSwitch manpages in a subdirectory of - "sandbox" and adjusts the MANPATH environment variable to point - to this directory. This means that you can use, for example, - "man ovs-vsctl" to see a manpage for the ovs-vsctl program that - you built. - - 5. Creates an empty Open vSwitch configuration database under - "sandbox". - - 6. Starts ovsdb-server running under "sandbox". - - 7. Starts ovs-vswitchd running under "sandbox", passing special - options that enable a special "dummy" mode for testing. - - 8. Starts a nested interactive shell inside "sandbox". - -At this point, you can run all the usual Open vSwitch utilities from -the nested shell environment. You can, for example, use ovs-vsctl to -create a bridge: - - ovs-vsctl add-br br0 - -From Open vSwitch's perspective, the bridge that you create this way -is as real as any other. You can, for example, connect it to an -OpenFlow controller or use "ovs-ofctl" to examine and modify it and -its OpenFlow flow table. On the other hand, the bridge is not visible -to the operating system's network stack, so "ifconfig" or "ip" cannot -see it or affect it, which means that utilities like "ping" and -"tcpdump" will not work either. (That has its good side, too: you -can't screw up your computer's network stack by manipulating a -sandboxed OVS.) - -When you're done using OVS from the sandbox, exit the nested shell (by -entering the "exit" shell command or pressing Control+D). This will -kill the daemons that ovs-sandbox started, but it leaves the "sandbox" -directory and its contents in place. - -The sandbox directory contains log files for the Open vSwitch dameons. -You can examine them while you're running in the sandboxed environment -or after you exit. - - -Motivation -========== - -The goal of this tutorial is to demonstrate the power of Open vSwitch -flow tables. The tutorial works through the implementation of a -MAC-learning switch with VLAN trunk and access ports. Outside of the -Open vSwitch features that we will discuss, OpenFlow provides at least -two ways to implement such a switch: - - 1. An OpenFlow controller to implement MAC learning in a - "reactive" fashion. Whenever a new MAC appears on the switch, - or a MAC moves from one switch port to another, the controller - adjusts the OpenFlow flow table to match. - - 2. The "normal" action. OpenFlow defines this action to submit a - packet to "the traditional non-OpenFlow pipeline of the - switch". That is, if a flow uses this action, then the packets - in the flow go through the switch in the same way that they - would if OpenFlow was not configured on the switch. - -Each of these approaches has unfortunate pitfalls. In the first -approach, using an OpenFlow controller to implement MAC learning, has -a significant cost in terms of network bandwidth and latency. It also -makes the controller more difficult to scale to large numbers of -switches, which is especially important in environments with thousands -of hypervisors (each of which contains a virtual OpenFlow switch). -MAC learning at an OpenFlow controller also behaves poorly if the -OpenFlow controller fails, slows down, or becomes unavailable due to -network problems. - -The second approach, using the "normal" action, has different -problems. First, little about the "normal" action is standardized, so -it behaves differently on switches from different vendors, and the -available features and how those features are configured (usually not -through OpenFlow) varies widely. Second, "normal" does not work well -with other OpenFlow actions. It is "all-or-nothing", with little -potential to adjust its behavior slightly or to compose it with other -features. - - -Scenario -======== - -We will construct Open vSwitch flow tables for a VLAN-capable, -MAC-learning switch that has four ports: - - * p1, a trunk port that carries all VLANs, on OpenFlow port 1. - - * p2, an access port for VLAN 20, on OpenFlow port 2. - - * p3 and p4, both access ports for VLAN 30, on OpenFlow ports 3 - and 4, respectively. - ->>> The ports' names are not significant. You could call them eth1 - through eth4, or any other names you like. - ->>> An OpenFlow switch always has a "local" port as well. This - scenario won't use the local port. - -Our switch design will consist of five main flow tables, each of which -implements one stage in the switch pipeline: - - Table 0: Admission control. - - Table 1: VLAN input processing. - - Table 2: Learn source MAC and VLAN for ingress port. - - Table 3: Look up learned port for destination MAC and VLAN. - - Table 4: Output processing. - -The section below describes how to set up the scenario, followed by a -section for each OpenFlow table. - -You can cut and paste the "ovs-vsctl" and "ovs-ofctl" commands in each -of the sections below into your "ovs-sandbox" shell. They are also -available as shell scripts in this directory, named t-setup, t-stage0, -t-stage1, ..., t-stage4. The "ovs-appctl" test commands are intended -for cutting and pasting and are not supplied separately. - - -Setup -===== - -To get started, start "ovs-sandbox". Inside the interactive shell -that it starts, run this command: - - ovs-vsctl add-br br0 -- set Bridge br0 fail-mode=secure - -This command creates a new bridge "br0" and puts "br0" into so-called -"fail-secure" mode. For our purpose, this just means that the -OpenFlow flow table starts out empty. - ->>> If we did not do this, then the flow table would start out with a - single flow that executes the "normal" action. We could use that - feature to yield a switch that behaves the same as the switch we - are currently building, but with the caveats described under - "Motivation" above.) - -The new bridge has only one port on it so far, the "local port" br0. -We need to add p1, p2, p3, and p4. A shell "for" loop is one way to -do it: - - for i in 1 2 3 4; do - ovs-vsctl add-port br0 p$i -- set Interface p$i ofport_request=$i - ovs-ofctl mod-port br0 p$i up - done - -In addition to adding a port, the ovs-vsctl command above sets its -"ofport_request" column to ensure that port p1 is assigned OpenFlow -port 1, p2 is assigned OpenFlow port 2, and so on. - ->>> We could omit setting the ofport_request and let Open vSwitch - choose port numbers for us, but it's convenient for the purposes - of this tutorial because we can talk about OpenFlow port 1 and - know that it corresponds to p1. - -The ovs-ofctl command above brings up the simulated interfaces, which -are down initially, using an OpenFlow request. The effect is similar -to "ifconfig up", but the sandbox's interfaces are not visible to the -operating system and therefore "ifconfig" would not affect them. - -We have not configured anything related to VLANs or MAC learning. -That's because we're going to implement those features in the flow -table. - -To see what we've done so far to set up the scenario, you can run a -command like "ovs-vsctl show" or "ovs-ofctl show br0". - - -Implementing Table 0: Admission control -======================================= - -Table 0 is where packets enter the switch. We use this stage to -discard packets that for one reason or another are invalid. For -example, packets with a multicast source address are not valid, so we -can add a flow to drop them at ingress to the switch with: - - ovs-ofctl add-flow br0 \ - "table=0, dl_src=01:00:00:00:00:00/01:00:00:00:00:00, actions=drop" - -A switch should also not forward IEEE 802.1D Spanning Tree Protocol -(STP) packets, so we can also add a flow to drop those and other -packets with reserved multicast protocols: - - ovs-ofctl add-flow br0 \ - "table=0, dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0, actions=drop" - -We could add flows to drop other protocols, but these demonstrate the -pattern. - -We need one more flow, with a priority lower than the default, so that -flows that don't match either of the "drop" flows we added above go on -to pipeline stage 1 in OpenFlow table 1: - - ovs-ofctl add-flow br0 "table=0, priority=0, actions=resubmit(,1)" - -(The "resubmit" action is an Open vSwitch extension to OpenFlow.) - - -Testing Table 0 ---------------- - -If we were using Open vSwitch to set up a physical or a virtual -switch, then we would naturally test it by sending packets through it -one way or another, perhaps with common network testing tools like -"ping" and "tcpdump" or more specialized tools like Scapy. That's -difficult with our simulated switch, since it's not visible to the -operating system. - -But our simulated switch has a few specialized testing tools. The -most powerful of these tools is "ofproto/trace". Given a switch and -the specification of a flow, "ofproto/trace" shows, step-by-step, how -such a flow would be treated as it goes through the switch. - - -== EXAMPLE 1 == - -Try this command: - - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=01:80:c2:00:00:05 - -The output should look something like this: - - Flow: metadata=0,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=01:80:c2:00:00:05,dl_type=0x0000 - Rule: table=0 cookie=0 dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0 - OpenFlow actions=drop - - Final flow: unchanged - Datapath actions: drop - -The first block of lines describes an OpenFlow table lookup. The -first line shows the fields used for the table lookup (which is mostly -zeros because that's the default if we don't specify everything). The -second line gives the OpenFlow flow that the fields matched (called a -"rule" because that is the name used inside Open vSwitch for an -OpenFlow flow). In this case, we see that this packet that has a -reserved multicast destination address matches the rule that drops -those packets. The third line gives the rule's OpenFlow actions. - -The second block of lines summarizes the results, which are not very -interesting here. - - -== EXAMPLE 2 == - -Try another command: - - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=01:80:c2:00:00:10 - -The output should be: - - Flow: metadata=0,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=01:80:c2:00:00:10,dl_type=0x0000 - Rule: table=0 cookie=0 priority=0 - OpenFlow actions=resubmit(,1) - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - No match - - Final flow: unchanged - Datapath actions: drop - -This time the flow we handed to "ofproto/trace" doesn't match any of -our "drop" rules, so it falls through to the low-priority "resubmit" -rule, which we see in the rule and the actions selected in the first -block. The "resubmit" causes a second lookup in OpenFlow table 1, -described by the additional block of indented text in the output. We -haven't yet added any flows to OpenFlow table 1, so no flow actually -matches in the second lookup. Therefore, the packet is still actually -dropped, which means that the externally observable results would be -identical to our first example. - - -Implementing Table 1: VLAN Input Processing -=========================================== - -A packet that enters table 1 has already passed basic validation in -table 0. The purpose of table 1 is validate the packet's VLAN, based -on the VLAN configuration of the switch port through which the packet -entered the switch. We will also use it to attach a VLAN header to -packets that arrive on an access port, which allows later processing -stages to rely on the packet's VLAN always being part of the VLAN -header, reducing special cases. - -Let's start by adding a low-priority flow that drops all packets, -before we add flows that pass through acceptable packets. You can -think of this as a "default drop" rule: - - ovs-ofctl add-flow br0 "table=1, priority=0, actions=drop" - -Our trunk port p1, on OpenFlow port 1, is an easy case. p1 accepts -any packet regardless of whether it has a VLAN header or what the VLAN -was, so we can add a flow that resubmits everything on input port 1 to -the next table: - - ovs-ofctl add-flow br0 \ - "table=1, priority=99, in_port=1, actions=resubmit(,2)" - -On the access ports, we want to accept any packet that has no VLAN -header, tag it with the access port's VLAN number, and then pass it -along to the next stage: - - ovs-ofctl add-flows br0 - <<'EOF' - table=1, priority=99, in_port=2, vlan_tci=0, actions=mod_vlan_vid:20, resubmit(,2) - table=1, priority=99, in_port=3, vlan_tci=0, actions=mod_vlan_vid:30, resubmit(,2) - table=1, priority=99, in_port=4, vlan_tci=0, actions=mod_vlan_vid:30, resubmit(,2) -EOF - -We don't write any rules that match packets with 802.1Q that enter -this stage on any of the access ports, so the "default drop" rule we -added earlier causes them to be dropped, which is ordinarily what we -want for access ports. - ->>> Another variation of access ports allows ingress of packets tagged - with VLAN 0 (aka 802.1p priority tagged packets). To allow such - packets, replace "vlan_tci=0" by "vlan_tci=0/0xfff" above. - - -Testing Table 1 ---------------- - -"ofproto/trace" allows us to test the ingress VLAN rules that we added -above. - - -== EXAMPLE 1: Packet on Trunk Port == - -Here's a test of a packet coming in on the trunk port: - - ovs-appctl ofproto/trace br0 in_port=1,vlan_tci=5 - -The output shows the lookup in table 0, the resubmit to table 1, and -the resubmit to table 2 (which does nothing because we haven't put -anything there yet): - - Flow: metadata=0,in_port=1,vlan_tci=0x0005,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 - Rule: table=0 cookie=0 priority=0 - OpenFlow actions=resubmit(,1) - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - Rule: table=1 cookie=0 priority=99,in_port=1 - OpenFlow actions=resubmit(,2) - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - No match - - Final flow: unchanged - Datapath actions: drop - - -== EXAMPLE 2: Valid Packet on Access Port == - -Here's a test of a valid packet (a packet without an 802.1Q header) -coming in on access port p2: - - ovs-appctl ofproto/trace br0 in_port=2 - -The output is similar to that for the previous case, except that it -additionally tags the packet with p2's VLAN 20 before it passes it -along to table 2: - - Flow: metadata=0,in_port=2,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 - Rule: table=0 cookie=0 priority=0 - OpenFlow actions=resubmit(,1) - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - Rule: table=1 cookie=0 priority=99,in_port=2,vlan_tci=0x0000 - OpenFlow actions=mod_vlan_vid:20,resubmit(,2) - - Resubmitted flow: metadata=0,in_port=2,dl_vlan=20,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - No match - - Final flow: unchanged - Datapath actions: drop - - -== EXAMPLE 3: Invalid Packet on Access Port == - -This tests an invalid packet (one that includes an 802.1Q header) -coming in on access port p2: - - ovs-appctl ofproto/trace br0 in_port=2,vlan_tci=5 - -The output shows the packet matching the default drop rule: - - Flow: metadata=0,in_port=2,vlan_tci=0x0005,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 - Rule: table=0 cookie=0 priority=0 - OpenFlow actions=resubmit(,1) - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - Rule: table=1 cookie=0 priority=0 - OpenFlow actions=drop - - Final flow: unchanged - Datapath actions: drop - - -Implementing Table 2: MAC+VLAN Learning for Ingress Port -======================================================== - -This table allows the switch we're implementing to learn that the -packet's source MAC is located on the packet's ingress port in the -packet's VLAN. - ->>> This table is a good example why table 1 added a VLAN tag to - packets that entered the switch through an access port. We want - to associate a MAC+VLAN with a port regardless of whether the VLAN - in question was originally part of the packet or whether it was an - assumed VLAN associated with an access port. - -It only takes a single flow to do this. The following command adds -it: - - ovs-ofctl add-flow br0 \ - "table=2 actions=learn(table=10, NXM_OF_VLAN_TCI[0..11], \ - NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ - load:NXM_OF_IN_PORT[]->NXM_NX_REG0[0..15]), \ - resubmit(,3)" - -The "learn" action (an Open vSwitch extension to OpenFlow) modifies a -flow table based on the content of the flow currently being processed. -Here's how you can interpret each part of the "learn" action above: - - table=10 - - Modify flow table 10. This will be the MAC learning table. - - NXM_OF_VLAN_TCI[0..11] - - Make the flow that we add to flow table 10 match the same VLAN - ID that the packet we're currently processing contains. This - effectively scopes the MAC learning entry to a single VLAN, - which is the ordinary behavior for a VLAN-aware switch. - - NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[] - - Make the flow that we add to flow table 10 match, as Ethernet - destination, the Ethernet source address of the packet we're - currently processing. - - load:NXM_OF_IN_PORT[]->NXM_NX_REG0[0..15] - - Whereas the preceding parts specify fields for the new flow to - match, this specifies an action for the flow to take when it - matches. The action is for the flow to load the ingress port - number of the current packet into register 0 (a special field - that is an Open vSwitch extension to OpenFlow). - ->>> A real use of "learn" for MAC learning would probably involve two - additional elements. First, the "learn" action would specify a - hard_timeout for the new flow, to enable a learned MAC to - eventually expire if no new packets were seen from a given source - within a reasonable interval. Second, one would usually want to - limit resource consumption by using the Flow_Table table in the - Open vSwitch configuration database to specify a maximum number of - flows in table 10. - -This definitely calls for examples. - - -Testing Table 2 ---------------- - -== EXAMPLE 1 == - -Try the following test command: - - ovs-appctl ofproto/trace br0 in_port=1,vlan_tci=20,dl_src=50:00:00:00:00:01 -generate - -The output shows that "learn" was executed, but it isn't otherwise -informative, so we won't include it here. - -The "-generate" keyword is new. Ordinarily, "ofproto/trace" has no -side effects: "output" actions do not actually output packets, "learn" -actions do not actually modify the flow table, and so on. With -"-generate", though, "ofproto/trace" does execute "learn" actions. -That's important now, because we want to see the effect of the "learn" -action on table 10. You can see that by running: - - ovs-ofctl dump-flows br0 table=10 - -which (omitting the "duration" and "idle_age" fields, which will vary -based on how soon you ran this command after the previous one, as well -as some other uninteresting fields) prints something like: - - NXST_FLOW reply (xid=0x4): - table=10, vlan_tci=0x0014/0x0fff,dl_dst=50:00:00:00:00:01 actions=load:0x1->NXM_NX_REG0[0..15] - -You can see that the packet coming in on VLAN 20 with source MAC -50:00:00:00:00:01 became a flow that matches VLAN 20 (written in -hexadecimal) and destination MAC 50:00:00:00:00:01. The flow loads -port number 1, the input port for the flow we tested, into register 0. - - -== EXAMPLE 2 == - -Here's a second test command: - - ovs-appctl ofproto/trace br0 in_port=2,dl_src=50:00:00:00:00:01 -generate - -The flow that this command tests has the same source MAC and VLAN as -example 1, although the VLAN comes from an access port VLAN rather -than an 802.1Q header. If we again dump the flows for table 10 with: - - ovs-ofctl dump-flows br0 table=10 - -then we see that the flow we saw previously has changed to indicate -that the learned port is port 2, as we would expect: - - NXST_FLOW reply (xid=0x4): - table=10, vlan_tci=0x0014/0x0fff,dl_dst=50:00:00:00:00:01 actions=load:0x2->NXM_NX_REG0[0..15] - - -Implementing Table 3: Look Up Destination Port -============================================== - -This table figures out what port we should send the packet to based on -the destination MAC and VLAN. That is, if we've learned the location -of the destination (from table 2 processing some previous packet with -that destination as its source), then we want to send the packet -there. - -We need only one flow to do the lookup: - - ovs-ofctl add-flow br0 \ - "table=3 priority=50 actions=resubmit(,10), resubmit(,4)" - -The flow's first action resubmits to table 10, the table that the -"learn" action modifies. As you saw previously, the learned flows in -this table write the learned port into register 0. If the destination -for our packet hasn't been learned, then there will be no matching -flow, and so the "resubmit" turns into a no-op. Because registers are -initialized to 0, we can use a register 0 value of 0 in our next -pipeline stage as a signal to flood the packet. - -The second action resubmits to table 4, continuing to the next -pipeline stage. - -We can add another flow to skip the learning table lookup for -multicast and broadcast packets, since those should always be flooded: - - ovs-ofctl add-flow br0 \ - "table=3 priority=99 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 \ - actions=resubmit(,4)" - ->>> We don't strictly need to add this flow, because multicast - addresses will never show up in our learning table. (In turn, - that's because we put a flow into table 0 to drop packets that - have a multicast source address.) - - -Testing Table 3 ---------------- - -== EXAMPLE == - -Here's a command that should cause OVS to learn that f0:00:00:00:00:01 -is on p1 in VLAN 20: - - ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=20,dl_src=f0:00:00:00:00:01,dl_dst=90:00:00:00:00:01 -generate - -Here's an excerpt from the output that shows (from the "no match" -looking up the resubmit to table 10) that the flow's destination was -unknown: - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - Rule: table=3 cookie=0 priority=50 - OpenFlow actions=resubmit(,10),resubmit(,4) - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - No match - -You can verify that the packet's source was learned two ways. The -most direct way is to dump the learning table with: - - ovs-ofctl dump-flows br0 table=10 - -which ought to show roughly the following, with extraneous details -removed: - - table=10, vlan_tci=0x0014/0x0fff,dl_dst=f0:00:00:00:00:01 actions=load:0x1->NXM_NX_REG0[0..15] - ->>> If you tried the examples for the previous step, or if you did - some of your own experiments, then you might see additional flows - there. These additional flows are harmless. If they bother you, - then you can remove them with "ovs-ofctl del-flows br0 table=10". - -The other way is to inject a packet to take advantage of the learning -entry. For example, we can inject a packet on p2 whose destination is -the MAC address that we just learned on p1: - - ovs-appctl ofproto/trace br0 in_port=2,dl_src=90:00:00:00:00:01,dl_dst=f0:00:00:00:00:01 -generate - -Here's an interesting excerpt from that command's output. This group -of lines traces the "resubmit(,10)", showing that the packet matched -the learned flow for the first MAC we used, loading the OpenFlow port -number for the learned port p1 into register 0: - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - Rule: table=10 cookie=0 vlan_tci=0x0014/0x0fff,dl_dst=f0:00:00:00:00:01 - OpenFlow actions=load:0x1->NXM_NX_REG0[0..15] - - -If you read the commands above carefully, then you might have noticed -that they simply have the Ethernet source and destination addresses -exchanged. That means that if we now rerun the first ovs-appctl -command above, e.g.: - - ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=20,dl_src=f0:00:00:00:00:01,dl_dst=90:00:00:00:00:01 -generate - -then we see in the output that the destination has now been learned: - - Resubmitted flow: unchanged - Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 - Resubmitted odp: drop - Rule: table=10 cookie=0 vlan_tci=0x0014/0x0fff,dl_dst=90:00:00:00:00:01 - OpenFlow actions=load:0x2->NXM_NX_REG0[0..15] - - -Implementing Table 4: Output Processing -======================================= - -At entry to stage 4, we know that register 0 contains either the -desired output port or is zero if the packet should be flooded. We -also know that the packet's VLAN is in its 802.1Q header, even if the -VLAN was implicit because the packet came in on an access port. - -The job of the final pipeline stage is to actually output packets. -The job is trivial for output to our trunk port p1: - - ovs-ofctl add-flow br0 "table=4 reg0=1 actions=1" - -For output to the access ports, we just have to strip the VLAN header -before outputting the packet: - - ovs-ofctl add-flows br0 - <<'EOF' - table=4 reg0=2 actions=strip_vlan,2 - table=4 reg0=3 actions=strip_vlan,3 - table=4 reg0=4 actions=strip_vlan,4 -EOF - -The only slightly tricky part is flooding multicast and broadcast -packets and unicast packets with unlearned destinations. For those, -we need to make sure that we only output the packets to the ports that -carry our packet's VLAN, and that we include the 802.1Q header in the -copy output to the trunk port but not in copies output to access -ports: - - ovs-ofctl add-flows br0 - <<'EOF' - table=4 reg0=0 priority=99 dl_vlan=20 actions=1,strip_vlan,2 - table=4 reg0=0 priority=99 dl_vlan=30 actions=1,strip_vlan,3,4 - table=4 reg0=0 priority=50 actions=1 -EOF - ->>> Our rules rely on the standard OpenFlow behavior that an output - action will not forward a packet back out the port it came in on. - That is, if a packet comes in on p1, and we've learned that the - packet's destination MAC is also on p1, so that we end up with - "actions=1" as our actions, the switch will not forward the packet - back out its input port. The multicast/broadcast/unknown - destination cases above also rely on this behavior. - - -Testing Table 4 ---------------- - -== EXAMPLE 1: Broadcast, Multicast, and Unknown Destination == - -Try tracing a broadcast packet arriving on p1 in VLAN 30: - - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff,dl_vlan=30 - -The interesting part of the output is the final line, which shows that -the switch would remove the 802.1Q header and then output the packet to -p3 and p4, which are access ports for VLAN 30: - - Datapath actions: pop_vlan,3,4 - -Similarly, if we trace a broadcast packet arriving on p3: - - ovs-appctl ofproto/trace br0 in_port=3,dl_dst=ff:ff:ff:ff:ff:ff - -then we see that it is output to p1 with an 802.1Q tag and then to p4 -without one: - - Datapath actions: push_vlan(vid=30,pcp=0),1,pop_vlan,4 - ->>> Open vSwitch could simplify the datapath actions here to just - "4,push_vlan(vid=30,pcp=0),1" but it is not smart enough to do so. - -The following are also broadcasts, but the result is to drop the -packets because the VLAN only belongs to the input port: - - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff,dl_vlan=55 - -Try some other broadcast cases on your own: - - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff,dl_vlan=20 - ovs-appctl ofproto/trace br0 in_port=2,dl_dst=ff:ff:ff:ff:ff:ff - ovs-appctl ofproto/trace br0 in_port=4,dl_dst=ff:ff:ff:ff:ff:ff - -You can see the same behavior with multicast packets and with unicast -packets whose destination has not been learned, e.g.: - - ovs-appctl ofproto/trace br0 in_port=4,dl_dst=01:00:00:00:00:00 - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=90:12:34:56:78:90,dl_vlan=20 - ovs-appctl ofproto/trace br0 in_port=1,dl_dst=90:12:34:56:78:90,dl_vlan=30 - - -== EXAMPLE 2: MAC Learning == - -Let's follow the same pattern as we did for table 3. First learn a -MAC on port p1 in VLAN 30: - - ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=30,dl_src=10:00:00:00:00:01,dl_dst=20:00:00:00:00:01 -generate - -You can see from the last line of output that the packet's destination -is unknown, so it gets flooded to both p3 and p4, the other ports in -VLAN 30: - - Datapath actions: pop_vlan,3,4 - -Then reverse the MACs and learn the first flow's destination on port -p4: - - ovs-appctl ofproto/trace br0 in_port=4,dl_src=20:00:00:00:00:01,dl_dst=10:00:00:00:00:01 -generate - -The last line of output shows that the this packet's destination is -known to be p1, as learned from our previous command: - - Datapath actions: push_vlan(vid=30,pcp=0),1 - -Now, if we rerun our first command: - - ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=30,dl_src=10:00:00:00:00:01,dl_dst=20:00:00:00:00:01 -generate - -we can see that the result is no longer a flood but to the specified -learned destination port p4: - - Datapath actions: pop_vlan,4 - - -Contact -======= - -bugs@openvswitch.org -http://openvswitch.org/ diff -Nru openvswitch-2.3.1/tutorial/Tutorial.md openvswitch-2.4.0~git20150623/tutorial/Tutorial.md --- openvswitch-2.3.1/tutorial/Tutorial.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/tutorial/Tutorial.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,858 @@ +Open vSwitch Advanced Features Tutorial +======================================= + +Many tutorials cover the basics of OpenFlow. This is not such a +tutorial. Rather, a knowledge of the basics of OpenFlow is a +prerequisite. If you do not already understand how an OpenFlow flow +table works, please go read a basic tutorial and then continue reading +here afterward. + +It is also important to understand the basics of Open vSwitch before +you begin. If you have never used `ovs-vsctl` or `ovs-ofctl` before, +you should learn a little about them before proceeding. + +Most of the features covered in this tutorial are Open vSwitch +extensions to OpenFlow. Also, most of the features in this tutorial +are specific to the software Open vSwitch implementation. If you are +using an Open vSwitch port to an ASIC-based hardware switch, this +tutorial will not help you. + +This tutorial does not cover every aspect of the features that it +mentions. You can find the details elsewhere in the Open vSwitch +documentation, especially `ovs-ofctl(8)` and the comments in the +`include/openflow/nicira-ext.h` header file. + +> In this tutorial, paragraphs set off like this designate notes +> with additional information that readers may wish to skip on a +> first read. + +Getting Started +--------------- + +This is a hands-on tutorial. To get the most out of it, you will need +Open vSwitch binaries. You do not, on the other hand, need any +physical networking hardware or even supervisor privilege on your +system. Instead, we will use a script called `ovs-sandbox`, which +accompanies the tutorial, that constructs a software simulated network +environment based on Open vSwitch. + +You can use `ovs-sandbox` three ways: + + * If you have already installed Open vSwitch on your system, then + you should be able to just run `ovs-sandbox` from this directory + without any options. + + * If you have not installed Open vSwitch (and you do not want to + install it), then you can build Open vSwitch according to the + instructions in [INSTALL.md], without installing it. Then run + `./ovs-sandbox -b DIRECTORY` from this directory, substituting + the Open vSwitch build directory for `DIRECTORY`. + + * As a slight variant on the latter, you can run `make sandbox` + from an Open vSwitch build directory. + +When you run `ovs-sandbox`, it does the following: + + 1. **CAUTION:** Deletes any subdirectory of the current directory + named "sandbox" and any files in that directory. + + 2. Creates a new directory "sandbox" in the current directory. + + 3. Sets up special environment variables that ensure that Open + vSwitch programs will look inside the "sandbox" directory + instead of in the Open vSwitch installation directory. + + 4. If you are using a built but not installed Open vSwitch, + installs the Open vSwitch manpages in a subdirectory of + "sandbox" and adjusts the `MANPATH` environment variable to point + to this directory. This means that you can use, for example, + `man ovs-vsctl` to see a manpage for the `ovs-vsctl` program that + you built. + + 5. Creates an empty Open vSwitch configuration database under + "sandbox". + + 6. Starts `ovsdb-server` running under "sandbox". + + 7. Starts `ovs-vswitchd` running under "sandbox", passing special + options that enable a special "dummy" mode for testing. + + 8. Starts a nested interactive shell inside "sandbox". + +At this point, you can run all the usual Open vSwitch utilities from +the nested shell environment. You can, for example, use `ovs-vsctl` +to create a bridge: + + ovs-vsctl add-br br0 + +From Open vSwitch's perspective, the bridge that you create this way +is as real as any other. You can, for example, connect it to an +OpenFlow controller or use `ovs-ofctl` to examine and modify it and +its OpenFlow flow table. On the other hand, the bridge is not visible +to the operating system's network stack, so `ifconfig` or `ip` cannot +see it or affect it, which means that utilities like `ping` and +`tcpdump` will not work either. (That has its good side, too: you +can't screw up your computer's network stack by manipulating a +sandboxed OVS.) + +When you're done using OVS from the sandbox, exit the nested shell (by +entering the "exit" shell command or pressing Control+D). This will +kill the daemons that `ovs-sandbox` started, but it leaves the "sandbox" +directory and its contents in place. + +The sandbox directory contains log files for the Open vSwitch dameons. +You can examine them while you're running in the sandboxed environment +or after you exit. + +Using GDB +--------- + +GDB support is not required to go through the tutorial. It is added in case +user wants to explore the internals of OVS programs. + +GDB can already be used to debug any running process, with the usual +'gdb ' command. + +'ovs-sandbox' also has a '-g' option for launching ovs-vswitchd under GDB. +This option can be handy for setting break points before ovs-vswitchd runs, +or for catching early segfaults. Similarly, a '-d' option can be used to +run ovsdb-server under GDB. Both options can be specified at the same time. + +In addition, a '-e' option also launches ovs-vswitchd under GDB. However, +instead of displaying a 'gdb>' prompt and waiting for user input, ovs-vswitchd +will start to execute immediately. '-r' option is the corresponding option +for running ovsdb-server under gdb with immediate execution. + +To avoid GDB mangling with the sandbox sub shell terminal, 'ovs-sandbox' +starts a new xterm to run each GDB session. For systems that do not support +X windows, GDB support is effectively disabled. + +When launching sandbox through the build tree's make file, the '-g' option +can be passed via the 'SANDBOXFLAGS' environment variable. +'make sandbox SANDBOXFLAGS=-g' will start the sandbox with ovs-vswitchd +running under GDB in its own xterm if X is available. + +Motivation +---------- + +The goal of this tutorial is to demonstrate the power of Open vSwitch +flow tables. The tutorial works through the implementation of a +MAC-learning switch with VLAN trunk and access ports. Outside of the +Open vSwitch features that we will discuss, OpenFlow provides at least +two ways to implement such a switch: + + 1. An OpenFlow controller to implement MAC learning in a + "reactive" fashion. Whenever a new MAC appears on the switch, + or a MAC moves from one switch port to another, the controller + adjusts the OpenFlow flow table to match. + + 2. The "normal" action. OpenFlow defines this action to submit a + packet to "the traditional non-OpenFlow pipeline of the + switch". That is, if a flow uses this action, then the packets + in the flow go through the switch in the same way that they + would if OpenFlow was not configured on the switch. + +Each of these approaches has unfortunate pitfalls. In the first +approach, using an OpenFlow controller to implement MAC learning, has +a significant cost in terms of network bandwidth and latency. It also +makes the controller more difficult to scale to large numbers of +switches, which is especially important in environments with thousands +of hypervisors (each of which contains a virtual OpenFlow switch). +MAC learning at an OpenFlow controller also behaves poorly if the +OpenFlow controller fails, slows down, or becomes unavailable due to +network problems. + +The second approach, using the "normal" action, has different +problems. First, little about the "normal" action is standardized, so +it behaves differently on switches from different vendors, and the +available features and how those features are configured (usually not +through OpenFlow) varies widely. Second, "normal" does not work well +with other OpenFlow actions. It is "all-or-nothing", with little +potential to adjust its behavior slightly or to compose it with other +features. + + +Scenario +-------- + +We will construct Open vSwitch flow tables for a VLAN-capable, +MAC-learning switch that has four ports: + + * p1, a trunk port that carries all VLANs, on OpenFlow port 1. + + * p2, an access port for VLAN 20, on OpenFlow port 2. + + * p3 and p4, both access ports for VLAN 30, on OpenFlow ports 3 + and 4, respectively. + +> The ports' names are not significant. You could call them eth1 +> through eth4, or any other names you like. + +> An OpenFlow switch always has a "local" port as well. This +> scenario won't use the local port. + +Our switch design will consist of five main flow tables, each of which +implements one stage in the switch pipeline: + + Table 0: Admission control. + + Table 1: VLAN input processing. + + Table 2: Learn source MAC and VLAN for ingress port. + + Table 3: Look up learned port for destination MAC and VLAN. + + Table 4: Output processing. + +The section below describes how to set up the scenario, followed by a +section for each OpenFlow table. + +You can cut and paste the `ovs-vsctl` and `ovs-ofctl` commands in each +of the sections below into your `ovs-sandbox` shell. They are also +available as shell scripts in this directory, named `t-setup`, `t-stage0`, +`t-stage1`, ..., `t-stage4`. The `ovs-appctl` test commands are intended +for cutting and pasting and are not supplied separately. + + +Setup +----- + +To get started, start `ovs-sandbox`. Inside the interactive shell +that it starts, run this command: + + ovs-vsctl add-br br0 -- set Bridge br0 fail-mode=secure + +This command creates a new bridge "br0" and puts "br0" into so-called +"fail-secure" mode. For our purpose, this just means that the +OpenFlow flow table starts out empty. + +> If we did not do this, then the flow table would start out with a +> single flow that executes the "normal" action. We could use that +> feature to yield a switch that behaves the same as the switch we +> are currently building, but with the caveats described under +> "Motivation" above.) + +The new bridge has only one port on it so far, the "local port" br0. +We need to add p1, p2, p3, and p4. A shell "for" loop is one way to +do it: + + for i in 1 2 3 4; do + ovs-vsctl add-port br0 p$i -- set Interface p$i ofport_request=$i + ovs-ofctl mod-port br0 p$i up + done + +In addition to adding a port, the `ovs-vsctl` command above sets its +"ofport_request" column to ensure that port p1 is assigned OpenFlow +port 1, p2 is assigned OpenFlow port 2, and so on. + +> We could omit setting the ofport_request and let Open vSwitch +> choose port numbers for us, but it's convenient for the purposes +> of this tutorial because we can talk about OpenFlow port 1 and +> know that it corresponds to p1. + +The `ovs-ofctl` command above brings up the simulated interfaces, which +are down initially, using an OpenFlow request. The effect is similar +to `ifconfig up`, but the sandbox's interfaces are not visible to the +operating system and therefore `ifconfig` would not affect them. + +We have not configured anything related to VLANs or MAC learning. +That's because we're going to implement those features in the flow +table. + +To see what we've done so far to set up the scenario, you can run a +command like `ovs-vsctl show` or `ovs-ofctl show br0`. + + +Implementing Table 0: Admission control +--------------------------------------- + +Table 0 is where packets enter the switch. We use this stage to +discard packets that for one reason or another are invalid. For +example, packets with a multicast source address are not valid, so we +can add a flow to drop them at ingress to the switch with: + + ovs-ofctl add-flow br0 \ + "table=0, dl_src=01:00:00:00:00:00/01:00:00:00:00:00, actions=drop" + +A switch should also not forward IEEE 802.1D Spanning Tree Protocol +(STP) packets, so we can also add a flow to drop those and other +packets with reserved multicast protocols: + + ovs-ofctl add-flow br0 \ + "table=0, dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0, actions=drop" + +We could add flows to drop other protocols, but these demonstrate the +pattern. + +We need one more flow, with a priority lower than the default, so that +flows that don't match either of the "drop" flows we added above go on +to pipeline stage 1 in OpenFlow table 1: + + ovs-ofctl add-flow br0 "table=0, priority=0, actions=resubmit(,1)" + +(The "resubmit" action is an Open vSwitch extension to OpenFlow.) + + +### Testing Table 0 + +If we were using Open vSwitch to set up a physical or a virtual +switch, then we would naturally test it by sending packets through it +one way or another, perhaps with common network testing tools like +`ping` and `tcpdump` or more specialized tools like Scapy. That's +difficult with our simulated switch, since it's not visible to the +operating system. + +But our simulated switch has a few specialized testing tools. The +most powerful of these tools is `ofproto/trace`. Given a switch and +the specification of a flow, `ofproto/trace` shows, step-by-step, how +such a flow would be treated as it goes through the switch. + + +### EXAMPLE 1 + +Try this command: + + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=01:80:c2:00:00:05 + +The output should look something like this: + + Flow: metadata=0,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=01:80:c2:00:00:05,dl_type=0x0000 + Rule: table=0 cookie=0 dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0 + OpenFlow actions=drop + + Final flow: unchanged + Datapath actions: drop + +The first block of lines describes an OpenFlow table lookup. The +first line shows the fields used for the table lookup (which is mostly +zeros because that's the default if we don't specify everything). The +second line gives the OpenFlow flow that the fields matched (called a +"rule" because that is the name used inside Open vSwitch for an +OpenFlow flow). In this case, we see that this packet that has a +reserved multicast destination address matches the rule that drops +those packets. The third line gives the rule's OpenFlow actions. + +The second block of lines summarizes the results, which are not very +interesting here. + + +### EXAMPLE 2 + +Try another command: + + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=01:80:c2:00:00:10 + +The output should be: + + Flow: metadata=0,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=01:80:c2:00:00:10,dl_type=0x0000 + Rule: table=0 cookie=0 priority=0 + OpenFlow actions=resubmit(,1) + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + No match + + Final flow: unchanged + Datapath actions: drop + +This time the flow we handed to `ofproto/trace` doesn't match any of +our "drop" rules, so it falls through to the low-priority "resubmit" +rule, which we see in the rule and the actions selected in the first +block. The "resubmit" causes a second lookup in OpenFlow table 1, +described by the additional block of indented text in the output. We +haven't yet added any flows to OpenFlow table 1, so no flow actually +matches in the second lookup. Therefore, the packet is still actually +dropped, which means that the externally observable results would be +identical to our first example. + + +Implementing Table 1: VLAN Input Processing +------------------------------------------- + +A packet that enters table 1 has already passed basic validation in +table 0. The purpose of table 1 is validate the packet's VLAN, based +on the VLAN configuration of the switch port through which the packet +entered the switch. We will also use it to attach a VLAN header to +packets that arrive on an access port, which allows later processing +stages to rely on the packet's VLAN always being part of the VLAN +header, reducing special cases. + +Let's start by adding a low-priority flow that drops all packets, +before we add flows that pass through acceptable packets. You can +think of this as a "default drop" rule: + + ovs-ofctl add-flow br0 "table=1, priority=0, actions=drop" + +Our trunk port p1, on OpenFlow port 1, is an easy case. p1 accepts +any packet regardless of whether it has a VLAN header or what the VLAN +was, so we can add a flow that resubmits everything on input port 1 to +the next table: + + ovs-ofctl add-flow br0 \ + "table=1, priority=99, in_port=1, actions=resubmit(,2)" + +On the access ports, we want to accept any packet that has no VLAN +header, tag it with the access port's VLAN number, and then pass it +along to the next stage: + + ovs-ofctl add-flows br0 - <<'EOF' + table=1, priority=99, in_port=2, vlan_tci=0, actions=mod_vlan_vid:20, resubmit(,2) + table=1, priority=99, in_port=3, vlan_tci=0, actions=mod_vlan_vid:30, resubmit(,2) + table=1, priority=99, in_port=4, vlan_tci=0, actions=mod_vlan_vid:30, resubmit(,2) + EOF + +We don't write any rules that match packets with 802.1Q that enter +this stage on any of the access ports, so the "default drop" rule we +added earlier causes them to be dropped, which is ordinarily what we +want for access ports. + +> Another variation of access ports allows ingress of packets tagged +> with VLAN 0 (aka 802.1p priority tagged packets). To allow such +> packets, replace "vlan_tci=0" by "vlan_tci=0/0xfff" above. + + +### Testing Table 1 + +`ofproto/trace` allows us to test the ingress VLAN rules that we added +above. + + +### EXAMPLE 1: Packet on Trunk Port + +Here's a test of a packet coming in on the trunk port: + + ovs-appctl ofproto/trace br0 in_port=1,vlan_tci=5 + +The output shows the lookup in table 0, the resubmit to table 1, and +the resubmit to table 2 (which does nothing because we haven't put +anything there yet): + + Flow: metadata=0,in_port=1,vlan_tci=0x0005,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 + Rule: table=0 cookie=0 priority=0 + OpenFlow actions=resubmit(,1) + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + Rule: table=1 cookie=0 priority=99,in_port=1 + OpenFlow actions=resubmit(,2) + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + No match + + Final flow: unchanged + Datapath actions: drop + + +### EXAMPLE 2: Valid Packet on Access Port + +Here's a test of a valid packet (a packet without an 802.1Q header) +coming in on access port p2: + + ovs-appctl ofproto/trace br0 in_port=2 + +The output is similar to that for the previous case, except that it +additionally tags the packet with p2's VLAN 20 before it passes it +along to table 2: + + Flow: metadata=0,in_port=2,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 + Rule: table=0 cookie=0 priority=0 + OpenFlow actions=resubmit(,1) + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + Rule: table=1 cookie=0 priority=99,in_port=2,vlan_tci=0x0000 + OpenFlow actions=mod_vlan_vid:20,resubmit(,2) + + Resubmitted flow: metadata=0,in_port=2,dl_vlan=20,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + No match + + Final flow: unchanged + Datapath actions: drop + + +### EXAMPLE 3: Invalid Packet on Access Port + +This tests an invalid packet (one that includes an 802.1Q header) +coming in on access port p2: + + ovs-appctl ofproto/trace br0 in_port=2,vlan_tci=5 + +The output shows the packet matching the default drop rule: + + Flow: metadata=0,in_port=2,vlan_tci=0x0005,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 + Rule: table=0 cookie=0 priority=0 + OpenFlow actions=resubmit(,1) + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + Rule: table=1 cookie=0 priority=0 + OpenFlow actions=drop + + Final flow: unchanged + Datapath actions: drop + + +Implementing Table 2: MAC+VLAN Learning for Ingress Port +-------------------------------------------------------- + +This table allows the switch we're implementing to learn that the +packet's source MAC is located on the packet's ingress port in the +packet's VLAN. + +> This table is a good example why table 1 added a VLAN tag to +> packets that entered the switch through an access port. We want +> to associate a MAC+VLAN with a port regardless of whether the VLAN +> in question was originally part of the packet or whether it was an +> assumed VLAN associated with an access port. + +It only takes a single flow to do this. The following command adds +it: + + ovs-ofctl add-flow br0 \ + "table=2 actions=learn(table=10, NXM_OF_VLAN_TCI[0..11], \ + NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ + load:NXM_OF_IN_PORT[]->NXM_NX_REG0[0..15]), \ + resubmit(,3)" + +The "learn" action (an Open vSwitch extension to OpenFlow) modifies a +flow table based on the content of the flow currently being processed. +Here's how you can interpret each part of the "learn" action above: + + table=10 + + Modify flow table 10. This will be the MAC learning table. + + NXM_OF_VLAN_TCI[0..11] + + Make the flow that we add to flow table 10 match the same VLAN + ID that the packet we're currently processing contains. This + effectively scopes the MAC learning entry to a single VLAN, + which is the ordinary behavior for a VLAN-aware switch. + + NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[] + + Make the flow that we add to flow table 10 match, as Ethernet + destination, the Ethernet source address of the packet we're + currently processing. + + load:NXM_OF_IN_PORT[]->NXM_NX_REG0[0..15] + + Whereas the preceding parts specify fields for the new flow to + match, this specifies an action for the flow to take when it + matches. The action is for the flow to load the ingress port + number of the current packet into register 0 (a special field + that is an Open vSwitch extension to OpenFlow). + +> A real use of "learn" for MAC learning would probably involve two +> additional elements. First, the "learn" action would specify a +> hard_timeout for the new flow, to enable a learned MAC to +> eventually expire if no new packets were seen from a given source +> within a reasonable interval. Second, one would usually want to +> limit resource consumption by using the Flow_Table table in the +> Open vSwitch configuration database to specify a maximum number of +> flows in table 10. + +This definitely calls for examples. + + +### Testing Table 2 + +### EXAMPLE 1 + +Try the following test command: + + ovs-appctl ofproto/trace br0 in_port=1,vlan_tci=20,dl_src=50:00:00:00:00:01 -generate + +The output shows that "learn" was executed, but it isn't otherwise +informative, so we won't include it here. + +The `-generate` keyword is new. Ordinarily, `ofproto/trace` has no +side effects: "output" actions do not actually output packets, "learn" +actions do not actually modify the flow table, and so on. With +`-generate`, though, `ofproto/trace` does execute "learn" actions. +That's important now, because we want to see the effect of the "learn" +action on table 10. You can see that by running: + + ovs-ofctl dump-flows br0 table=10 + +which (omitting the "duration" and "idle_age" fields, which will vary +based on how soon you ran this command after the previous one, as well +as some other uninteresting fields) prints something like: + + NXST_FLOW reply (xid=0x4): + table=10, vlan_tci=0x0014/0x0fff,dl_dst=50:00:00:00:00:01 actions=load:0x1->NXM_NX_REG0[0..15] + +You can see that the packet coming in on VLAN 20 with source MAC +50:00:00:00:00:01 became a flow that matches VLAN 20 (written in +hexadecimal) and destination MAC 50:00:00:00:00:01. The flow loads +port number 1, the input port for the flow we tested, into register 0. + + +### EXAMPLE 2 + +Here's a second test command: + + ovs-appctl ofproto/trace br0 in_port=2,dl_src=50:00:00:00:00:01 -generate + +The flow that this command tests has the same source MAC and VLAN as +example 1, although the VLAN comes from an access port VLAN rather +than an 802.1Q header. If we again dump the flows for table 10 with: + + ovs-ofctl dump-flows br0 table=10 + +then we see that the flow we saw previously has changed to indicate +that the learned port is port 2, as we would expect: + + NXST_FLOW reply (xid=0x4): + table=10, vlan_tci=0x0014/0x0fff,dl_dst=50:00:00:00:00:01 actions=load:0x2->NXM_NX_REG0[0..15] + + +Implementing Table 3: Look Up Destination Port +---------------------------------------------- + +This table figures out what port we should send the packet to based on +the destination MAC and VLAN. That is, if we've learned the location +of the destination (from table 2 processing some previous packet with +that destination as its source), then we want to send the packet +there. + +We need only one flow to do the lookup: + + ovs-ofctl add-flow br0 \ + "table=3 priority=50 actions=resubmit(,10), resubmit(,4)" + +The flow's first action resubmits to table 10, the table that the +"learn" action modifies. As you saw previously, the learned flows in +this table write the learned port into register 0. If the destination +for our packet hasn't been learned, then there will be no matching +flow, and so the "resubmit" turns into a no-op. Because registers are +initialized to 0, we can use a register 0 value of 0 in our next +pipeline stage as a signal to flood the packet. + +The second action resubmits to table 4, continuing to the next +pipeline stage. + +We can add another flow to skip the learning table lookup for +multicast and broadcast packets, since those should always be flooded: + + ovs-ofctl add-flow br0 \ + "table=3 priority=99 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 \ + actions=resubmit(,4)" + +> We don't strictly need to add this flow, because multicast +> addresses will never show up in our learning table. (In turn, +> that's because we put a flow into table 0 to drop packets that +> have a multicast source address.) + + +### Testing Table 3 + +### EXAMPLE + +Here's a command that should cause OVS to learn that f0:00:00:00:00:01 +is on p1 in VLAN 20: + + ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=20,dl_src=f0:00:00:00:00:01,dl_dst=90:00:00:00:00:01 -generate + +Here's an excerpt from the output that shows (from the "no match" +looking up the resubmit to table 10) that the flow's destination was +unknown: + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + Rule: table=3 cookie=0 priority=50 + OpenFlow actions=resubmit(,10),resubmit(,4) + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + No match + +You can verify that the packet's source was learned two ways. The +most direct way is to dump the learning table with: + + ovs-ofctl dump-flows br0 table=10 + +which ought to show roughly the following, with extraneous details +removed: + + table=10, vlan_tci=0x0014/0x0fff,dl_dst=f0:00:00:00:00:01 actions=load:0x1->NXM_NX_REG0[0..15] + +> If you tried the examples for the previous step, or if you did +> some of your own experiments, then you might see additional flows +> there. These additional flows are harmless. If they bother you, +> then you can remove them with `ovs-ofctl del-flows br0 table=10`. + +The other way is to inject a packet to take advantage of the learning +entry. For example, we can inject a packet on p2 whose destination is +the MAC address that we just learned on p1: + + ovs-appctl ofproto/trace br0 in_port=2,dl_src=90:00:00:00:00:01,dl_dst=f0:00:00:00:00:01 -generate + +Here's an interesting excerpt from that command's output. This group +of lines traces the "resubmit(,10)", showing that the packet matched +the learned flow for the first MAC we used, loading the OpenFlow port +number for the learned port p1 into register 0: + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + Rule: table=10 cookie=0 vlan_tci=0x0014/0x0fff,dl_dst=f0:00:00:00:00:01 + OpenFlow actions=load:0x1->NXM_NX_REG0[0..15] + + +If you read the commands above carefully, then you might have noticed +that they simply have the Ethernet source and destination addresses +exchanged. That means that if we now rerun the first `ovs-appctl` +command above, e.g.: + + ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=20,dl_src=f0:00:00:00:00:01,dl_dst=90:00:00:00:00:01 -generate + +then we see in the output that the destination has now been learned: + + Resubmitted flow: unchanged + Resubmitted regs: reg0=0x0 reg1=0x0 reg2=0x0 reg3=0x0 reg4=0x0 reg5=0x0 reg6=0x0 reg7=0x0 + Resubmitted odp: drop + Rule: table=10 cookie=0 vlan_tci=0x0014/0x0fff,dl_dst=90:00:00:00:00:01 + OpenFlow actions=load:0x2->NXM_NX_REG0[0..15] + + +Implementing Table 4: Output Processing +--------------------------------------- + +At entry to stage 4, we know that register 0 contains either the +desired output port or is zero if the packet should be flooded. We +also know that the packet's VLAN is in its 802.1Q header, even if the +VLAN was implicit because the packet came in on an access port. + +The job of the final pipeline stage is to actually output packets. +The job is trivial for output to our trunk port p1: + + ovs-ofctl add-flow br0 "table=4 reg0=1 actions=1" + +For output to the access ports, we just have to strip the VLAN header +before outputting the packet: + + ovs-ofctl add-flows br0 - <<'EOF' + table=4 reg0=2 actions=strip_vlan,2 + table=4 reg0=3 actions=strip_vlan,3 + table=4 reg0=4 actions=strip_vlan,4 + EOF + +The only slightly tricky part is flooding multicast and broadcast +packets and unicast packets with unlearned destinations. For those, +we need to make sure that we only output the packets to the ports that +carry our packet's VLAN, and that we include the 802.1Q header in the +copy output to the trunk port but not in copies output to access +ports: + + ovs-ofctl add-flows br0 - <<'EOF' + table=4 reg0=0 priority=99 dl_vlan=20 actions=1,strip_vlan,2 + table=4 reg0=0 priority=99 dl_vlan=30 actions=1,strip_vlan,3,4 + table=4 reg0=0 priority=50 actions=1 + EOF + +> Our rules rely on the standard OpenFlow behavior that an output +> action will not forward a packet back out the port it came in on. +> That is, if a packet comes in on p1, and we've learned that the +> packet's destination MAC is also on p1, so that we end up with +> "actions=1" as our actions, the switch will not forward the packet +> back out its input port. The multicast/broadcast/unknown +> destination cases above also rely on this behavior. + + +### Testing Table 4 + +### EXAMPLE 1: Broadcast, Multicast, and Unknown Destination + +Try tracing a broadcast packet arriving on p1 in VLAN 30: + + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff,dl_vlan=30 + +The interesting part of the output is the final line, which shows that +the switch would remove the 802.1Q header and then output the packet to +p3 and p4, which are access ports for VLAN 30: + + Datapath actions: pop_vlan,3,4 + +Similarly, if we trace a broadcast packet arriving on p3: + + ovs-appctl ofproto/trace br0 in_port=3,dl_dst=ff:ff:ff:ff:ff:ff + +then we see that it is output to p1 with an 802.1Q tag and then to p4 +without one: + + Datapath actions: push_vlan(vid=30,pcp=0),1,pop_vlan,4 + +> Open vSwitch could simplify the datapath actions here to just +> "4,push_vlan(vid=30,pcp=0),1" but it is not smart enough to do so. + +The following are also broadcasts, but the result is to drop the +packets because the VLAN only belongs to the input port: + + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff,dl_vlan=55 + +Try some other broadcast cases on your own: + + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff,dl_vlan=20 + ovs-appctl ofproto/trace br0 in_port=2,dl_dst=ff:ff:ff:ff:ff:ff + ovs-appctl ofproto/trace br0 in_port=4,dl_dst=ff:ff:ff:ff:ff:ff + +You can see the same behavior with multicast packets and with unicast +packets whose destination has not been learned, e.g.: + + ovs-appctl ofproto/trace br0 in_port=4,dl_dst=01:00:00:00:00:00 + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=90:12:34:56:78:90,dl_vlan=20 + ovs-appctl ofproto/trace br0 in_port=1,dl_dst=90:12:34:56:78:90,dl_vlan=30 + + +### EXAMPLE 2: MAC Learning + +Let's follow the same pattern as we did for table 3. First learn a +MAC on port p1 in VLAN 30: + + ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=30,dl_src=10:00:00:00:00:01,dl_dst=20:00:00:00:00:01 -generate + +You can see from the last line of output that the packet's destination +is unknown, so it gets flooded to both p3 and p4, the other ports in +VLAN 30: + + Datapath actions: pop_vlan,3,4 + +Then reverse the MACs and learn the first flow's destination on port +p4: + + ovs-appctl ofproto/trace br0 in_port=4,dl_src=20:00:00:00:00:01,dl_dst=10:00:00:00:00:01 -generate + +The last line of output shows that the this packet's destination is +known to be p1, as learned from our previous command: + + Datapath actions: push_vlan(vid=30,pcp=0),1 + +Now, if we rerun our first command: + + ovs-appctl ofproto/trace br0 in_port=1,dl_vlan=30,dl_src=10:00:00:00:00:01,dl_dst=20:00:00:00:00:01 -generate + +we can see that the result is no longer a flood but to the specified +learned destination port p4: + + Datapath actions: pop_vlan,4 + + +Contact +======= + +bugs@openvswitch.org +http://openvswitch.org/ + +[INSTALL.md]:../INSTALL.md diff -Nru openvswitch-2.3.1/utilities/automake.mk openvswitch-2.4.0~git20150623/utilities/automake.mk --- openvswitch-2.3.1/utilities/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -1,9 +1,11 @@ bin_PROGRAMS += \ utilities/ovs-appctl \ + utilities/ovs-testcontroller \ utilities/ovs-dpctl \ utilities/ovs-ofctl \ utilities/ovs-vsctl -bin_SCRIPTS += utilities/ovs-pki +bin_SCRIPTS += utilities/ovs-docker \ + utilities/ovs-pki if HAVE_PYTHON bin_SCRIPTS += \ utilities/ovs-dpctl-top \ @@ -20,25 +22,41 @@ utilities/ovs-save scripts_DATA += utilities/ovs-lib +completion_SCRIPTS += \ + utilities/ovs-appctl-bashcomp.bash \ + utilities/ovs-vsctl-bashcomp.bash + +check_SCRIPTS += \ + utilities/ovs-appctl-bashcomp.bash \ + utilities/ovs-vsctl-bashcomp.bash + utilities/ovs-lib: $(top_builddir)/config.status +docs += utilities/ovs-command-bashcomp.INSTALL.md EXTRA_DIST += \ + utilities/ovs-appctl-bashcomp.bash \ utilities/ovs-check-dead-ifs.in \ + utilities/ovs-command-bashcomp.INSTALL.md \ utilities/ovs-ctl.in \ utilities/ovs-dev.py \ + utilities/ovs-docker \ utilities/ovs-dpctl-top.in \ utilities/ovs-l3ping.in \ utilities/ovs-lib.in \ utilities/ovs-parse-backtrace.in \ utilities/ovs-pcap.in \ + utilities/ovs-pipegen.py \ utilities/ovs-pki.in \ utilities/ovs-save \ utilities/ovs-tcpundump.in \ utilities/ovs-test.in \ - utilities/ovs-vlan-test.in + utilities/ovs-vlan-test.in \ + utilities/ovs-vsctl-bashcomp.bash \ + utilities/qemu-wrap.py MAN_ROOTS += \ utilities/ovs-appctl.8.in \ utilities/ovs-benchmark.1.in \ + utilities/ovs-testcontroller.8.in \ utilities/ovs-ctl.8 \ utilities/ovs-dpctl.8.in \ utilities/ovs-dpctl-top.8.in \ @@ -58,6 +76,7 @@ utilities/ovs-ctl \ utilities/ovs-benchmark.1 \ utilities/ovs-check-dead-ifs \ + utilities/ovs-testcontroller.8 \ utilities/ovs-dpctl.8 \ utilities/ovs-dpctl-top \ utilities/ovs-dpctl-top.8 \ @@ -83,6 +102,7 @@ utilities/ovs-appctl.8 \ utilities/ovs-benchmark.1 \ utilities/ovs-ctl.8 \ + utilities/ovs-testcontroller.8 \ utilities/ovs-dpctl.8 \ utilities/ovs-dpctl-top.8 \ utilities/ovs-l3ping.8 \ @@ -99,6 +119,9 @@ utilities_ovs_appctl_SOURCES = utilities/ovs-appctl.c utilities_ovs_appctl_LDADD = lib/libopenvswitch.la +utilities_ovs_testcontroller_SOURCES = utilities/ovs-testcontroller.c +utilities_ovs_testcontroller_LDADD = lib/libopenvswitch.la $(SSL_LIBS) + utilities_ovs_dpctl_SOURCES = utilities/ovs-dpctl.c utilities_ovs_dpctl_LDADD = lib/libopenvswitch.la diff -Nru openvswitch-2.3.1/utilities/bugtool/automake.mk openvswitch-2.4.0~git20150623/utilities/bugtool/automake.mk --- openvswitch-2.3.1/utilities/bugtool/automake.mk 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/bugtool/automake.mk 2015-06-23 18:46:21.000000000 +0000 @@ -17,6 +17,7 @@ utilities/bugtool/ovs-bugtool-bfd-show \ utilities/bugtool/ovs-bugtool-cfm-show \ utilities/bugtool/ovs-bugtool-coverage-show \ + utilities/bugtool/ovs-bugtool-fdb-show \ utilities/bugtool/ovs-bugtool-lacp-show \ utilities/bugtool/ovs-bugtool-list-dbs \ utilities/bugtool/ovs-bugtool-memory-show \ diff -Nru openvswitch-2.3.1/utilities/bugtool/.gitignore openvswitch-2.4.0~git20150623/utilities/bugtool/.gitignore --- openvswitch-2.3.1/utilities/bugtool/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/bugtool/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,2 @@ +/ovs-bugtool +/ovs-bugtool.8 diff -Nru openvswitch-2.3.1/utilities/bugtool/ovs-bugtool.8.in openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool.8.in --- openvswitch-2.3.1/utilities/bugtool/ovs-bugtool.8.in 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool.8.in 2015-06-23 18:46:21.000000000 +0000 @@ -15,44 +15,66 @@ .B ovs\-bugtool . .SH DESCRIPTION -Generate a debug bundle with useful information about Open vSwitch on this +Generates a debug bundle with useful information about Open vSwitch on this system and places it in \fB/var/log/ovs-bugtool\fR. . -.SH OPTIONS -. -.IP "\fB\-\-all\fR" -Use all available capabilities. -. -.IP "\fB\-\-capabilities\fR" -List \fBovs\-bugtool\fR capabilities. -. -.IP "\fB\-\-debug\fR" -Print verbose debugging output. +.SH "COLLECTION OPTIONS" +.PP +These options influence what categories of data \fBovs\-bugtool\fR +collects. . .IP "\fB\-\-entries=\fIlist\fR" -Use the capabilities specified in a comma-separated list. -. +Collect the capabilities specified in the comma-separated \fIlist\fR. +.IP "\fB\-\-all\fR" +Collect all available capabilities. +.IP "\fB\-\-ovs\fR" +In addition to Open vSwitch configuration and status, +\fBovs\-bugtool\fR can collect a variety of relevant system +information. This option limits collection to Open vSwitch-specific +categories. .IP "\fB\-\-log\-days=\fIdays\fR" Include the logs with last modification time in the previous \fIdays\fR days in the debug bundle. The number of log files included has a big impact on the eventual bundle size. The default value is 20 days. +.IP "\fB\-y\fR" +.IQ "\fB\-\-yestoall\fR" +Answer yes to all prompts. +.IP "\fB\-\-capabilities\fR" +Writes the categories that \fBovs\-bugtool\fR can collect on stdout in +XML, then exits. +. +.SH "OUTPUT OPTIONS" +.PP +These options influence the format and destination of +\fBovs\-bugtool\fR output. . .IP "\fB\-\-output=\fIfiletype\fR" -Generate a debug bundle with the specified file type. Options include +Generates a debug bundle with the specified file type. Options include \fBtar\fR, \fBtar.gz\fR, \fBtar.bz2\fR, and \fBzip\fR. -. -.IP "\fB\-\-ovs\fR" -Use only Open vSwitch relevant capabilities. -. -.IP "\fB\-\-silent\fR" -Suppress output. -. +.IP "\fB\-\-outfile=\fIfile\fR" +Write output to \fIfile\fR. Mutually exclusive with \fB\-\-outfd\fR. +.IP "\fB\-\-outfd=\fIfd\fR" +Write output to file descriptor \fIfd\fR. This option must be used +with \fB\-\-output=tar\fR. .IP "\fB\-\-unlimited\fR" Do not exclude files which are too large. Also skip checking free disk space. By default up to 90 percent of the free disk space can be used. +.IP "\fB\-\-debug\fR" +Print verbose debugging output. . -.IP "\fB\-\-yestoall\fR" -Answer yes to all prompts. +.SH "OTHER OPTIONS" +. +.IP "\fB\-s\fR" +.IQ "\fB\-\-silent\fR" +Suppress most output to stdout. +.IP "\fB\-\-help\fR" +Print a summary of \fBovs\-bugtool\fR usage to stdout, then exit. +. +.SH EXAMPLES +.PP +Here's a collection of some commonly useful options: +.PP +\fBovs\-bugtool \-y \-s \-\-output=tar.gz \-\-outfile=/var/log/bugtool-report.tgz\fR . .SH BUGS \fBovs\-bugtool\fR makes many assumptions about file locations and the diff -Nru openvswitch-2.3.1/utilities/bugtool/ovs-bugtool-fdb-show openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool-fdb-show --- openvswitch-2.3.1/utilities/bugtool/ovs-bugtool-fdb-show 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool-fdb-show 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,24 @@ +#! /bin/sh + +# This library is free software; you can redistribute it and/or +# modify it under the terms of version 2.1 of the GNU Lesser General +# Public License as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Copyright (C) 2014 Nicira, Inc. + +for bridge in `ovs-vsctl -- --real list-br` +do + echo "ovs-appctl fdb/show ${bridge}" + ovs-appctl fdb/show "${bridge}" + echo "" +done diff -Nru openvswitch-2.3.1/utilities/bugtool/ovs-bugtool.in openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool.in --- openvswitch-2.3.1/utilities/bugtool/ovs-bugtool.in 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool.in 2015-06-23 18:46:21.000000000 +0000 @@ -14,7 +14,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Copyright (c) 2005, 2007 XenSource Ltd. -# Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. +# Copyright (c) 2010, 2011, 2012, 2013, 2015 Nicira, Inc. # # To add new entries to the bugtool, you need to: @@ -383,6 +383,35 @@ only_ovs_info = False collect_all_info = True + if '--help' in sys.argv: + print """\ +%(argv0)s: create status report bundles to assist in problem diagnosis +usage: %(argv0)s OPTIONS + +By default, %(argv0)s prompts for permission to collect each form of status +information and produces a .tar.gz file as output. + +The following options are available. + --help display this help message, then exit + -s, --silent suppress most output to stdout + +Options for categories of data to collect: + --entries=CAP_A,CAP_B,... set categories of data to collect + --all collect all categories + --ovs collect only directly OVS-related info + --log-days=DAYS collect DAYS worth of old logs + -y, --yestoall suppress prompts to confirm collection + --capabilities print categories as XML on stdout, then exit + +Output options: + --output=FORMAT set output format to one of tar tar.bz2 tar.gz zip + --outfile=FILE write output to FILE + --outfd=FD write output to FD (requires --output=tar) + --unlimited ignore default limits on sizes of data collected + --debug print ovs-bugtool debug info on stdout\ +""" % {'argv0': sys.argv[0]} + sys.exit(0) + # we need access to privileged files, exit if we are not running as root if os.getuid() != 0: print >>sys.stderr, "Error: ovs-bugtool must be run as root" @@ -586,7 +615,7 @@ if os.path.exists(OPENVSWITCH_VSWITCHD_PID): cmd_output(CAP_NETWORK_STATUS, [OVS_DPCTL, 'show', '-s']) for d in dp_list(): - cmd_output(CAP_NETWORK_STATUS, [OVS_DPCTL, 'dump-flows', d]) + cmd_output(CAP_NETWORK_STATUS, [OVS_DPCTL, 'dump-flows', '-m', d]) cmd_output(CAP_PROCESS_LIST, [PS, 'wwwaxf', '-eo', 'pid,tty,stat,time,nice,psr,pcpu,pmem,nwchan,wchan:25,args'], label='process-tree') func_output(CAP_PROCESS_LIST, 'fd_usage', fd_usage) diff -Nru openvswitch-2.3.1/utilities/bugtool/ovs-bugtool-ovs-appctl-dpif openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool-ovs-appctl-dpif --- openvswitch-2.3.1/utilities/bugtool/ovs-bugtool-ovs-appctl-dpif 2014-07-14 10:28:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/bugtool/ovs-bugtool-ovs-appctl-dpif 2015-06-23 18:46:21.000000000 +0000 @@ -20,7 +20,7 @@ do echo "ovs-appctl dpif/show ${bridge}" ovs-appctl dpif/show "${bridge}" - echo "ovs-appctl dpif/dump-flows ${bridge}" - ovs-appctl dpif/dump-flows "$bridge" + echo "ovs-appctl dpif/dump-flows -m ${bridge}" + ovs-appctl dpif/dump-flows -m "$bridge" echo "" done diff -Nru openvswitch-2.3.1/utilities/bugtool/plugins/network-status/openvswitch.xml openvswitch-2.4.0~git20150623/utilities/bugtool/plugins/network-status/openvswitch.xml --- openvswitch-2.3.1/utilities/bugtool/plugins/network-status/openvswitch.xml 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/bugtool/plugins/network-status/openvswitch.xml 2015-06-23 18:46:21.000000000 +0000 @@ -20,6 +20,7 @@ /usr/share/openvswitch/scripts/ovs-bugtool-tc-class-show /usr/share/openvswitch/scripts/ovs-bugtool-vsctl-show /usr/share/openvswitch/scripts/ovs-bugtool-ovsdb-dump + /usr/share/openvswitch/scripts/ovs-bugtool-fdb-show /usr/share/openvswitch/scripts/ovs-bugtool-lacp-show /usr/share/openvswitch/scripts/ovs-bugtool-cfm-show /usr/share/openvswitch/scripts/ovs-bugtool-bfd-show diff -Nru openvswitch-2.3.1/utilities/.gitignore openvswitch-2.4.0~git20150623/utilities/.gitignore --- openvswitch-2.3.1/utilities/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/.gitignore 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,38 @@ +/Makefile +/Makefile.in +/nlmon +/ovs-appctl +/ovs-appctl.8 +/ovs-benchmark +/ovs-benchmark.1 +/ovs-cfg-mod +/ovs-cfg-mod.8 +/ovs-check-dead-ifs +/ovs-testcontroller +/ovs-testcontroller.8 +/ovs-ctl +/ovs-dpctl +/ovs-dpctl.8 +/ovs-dpctl-top +/ovs-dpctl-top.8 +/ovs-l3ping +/ovs-l3ping.8 +/ovs-lib +/ovs-ofctl +/ovs-ofctl.8 +/ovs-parse-backtrace +/ovs-pcap +/ovs-pcap.1 +/ovs-pki +/ovs-pki-cgi +/ovs-pki.8 +/ovs-test +/ovs-test.8 +/ovs-tcpundump +/ovs-tcpundump.1 +/ovs-vlan-bug-workaround +/ovs-vlan-bug-workaround.8 +/ovs-vlan-test +/ovs-vlan-test.8 +/ovs-vsctl +/ovs-vsctl.8 diff -Nru openvswitch-2.3.1/utilities/nlmon.c openvswitch-2.4.0~git20150623/utilities/nlmon.c --- openvswitch-2.3.1/utilities/nlmon.c 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/nlmon.c 2015-06-23 18:46:21.000000000 +0000 @@ -29,7 +29,7 @@ #include "poll-loop.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" static const struct nl_policy rtnlgrp_link_policy[] = { [IFLA_IFNAME] = { .type = NL_A_STRING, .optional = false }, @@ -45,7 +45,7 @@ int error; set_program_name(argv[0]); - vlog_set_levels(NULL, VLF_ANY_FACILITY, VLL_DBG); + vlog_set_levels(NULL, VLF_ANY_DESTINATION, VLL_DBG); error = nl_sock_create(NETLINK_ROUTE, &sock); if (error) { diff -Nru openvswitch-2.3.1/utilities/ovs-appctl.8.in openvswitch-2.4.0~git20150623/utilities/ovs-appctl.8.in --- openvswitch-2.3.1/utilities/ovs-appctl.8.in 2014-11-25 23:12:51.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-appctl.8.in 2015-06-23 18:46:21.000000000 +0000 @@ -73,7 +73,7 @@ \fB\-\-version\fR options that return information about the \fBovs\-appctl\fR utility itself. . -.IP "\fBhelp\fR" +.IP "\fBlist-commands\fR" Lists the commands supported by the target. . .IP "\fBversion\fR" @@ -84,7 +84,7 @@ . .IP "\fBoff\fR" No message is ever logged at this level, so setting a logging -facility's log level to \fBoff\fR disables logging to that facility. +destination's log level to \fBoff\fR disables logging to that destination. . .PP The following log levels, in order of descending severity, are @@ -114,7 +114,7 @@ . .IP "\fBvlog/set\fR [\fIspec\fR]" Sets logging levels. Without any \fIspec\fR, sets the log level for -every module and facility to \fBdbg\fR. Otherwise, \fIspec\fR is a +every module and destination to \fBdbg\fR. Otherwise, \fIspec\fR is a list of words separated by spaces or commas or colons, up to one from each category below: . @@ -150,9 +150,9 @@ For compatibility with older versions of OVS, \fBany\fR is accepted as a word but has no effect. . -.IP "\fBvlog/set PATTERN:\fIfacility\fB:\fIpattern\fR" -Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Each time a -message is logged to \fIfacility\fR, \fIpattern\fR determines the +.IP "\fBvlog/set PATTERN:\fIdestination\fB:\fIpattern\fR" +Sets the log pattern for \fIdestination\fR to \fIpattern\fR. Each time a +message is logged to \fIdestination\fR, \fIpattern\fR determines the message's formatting. Most characters in \fIpattern\fR are copied literally to the log, but special escapes beginning with \fB%\fR are expanded as follows: @@ -254,6 +254,14 @@ Daemons written in Python (e.g. \fBovs\-xapi\-sync\fR, \fBovs\-monitor\-ipsec) do not allow control over the log pattern. . +.IP "\fBvlog/set\fR FACILITY:\fIfacility\fR" +Sets the RFC5424 facility of the log message. \fIfacility\fR can be one of +\fBkern\fR, \fBuser\fR, \fBmail\fR, \fBdaemon\fR, \fBauth\fR, \fBsyslog\fR, +\fBlpr\fR, \fBnews\fR, \fBuucp\fR, \fBclock\fR, \fBftp\fR, \fBntp\fR, +\fBaudit\fR, \fBalert\fR, \fBclock2\fR, \fBlocal0\fR, \fBlocal1\fR, +\fBlocal2\fR, \fBlocal3\fR, \fBlocal4\fR, \fBlocal5\fR, \fBlocal6\fR or +\fBlocal7\fR. +. .IP "\fBvlog/reopen\fR" Causes the daemon to close and reopen its log file. (This is useful after rotating log files, to cause a new log file to be diff -Nru openvswitch-2.3.1/utilities/ovs-appctl-bashcomp.bash openvswitch-2.4.0~git20150623/utilities/ovs-appctl-bashcomp.bash --- openvswitch-2.3.1/utilities/ovs-appctl-bashcomp.bash 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-appctl-bashcomp.bash 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,624 @@ +#!/bin/bash +# +# A bash command completion script for ovs-appctl. +# +# +# Right now, the script can do the following: +# +# - display available completion or complete on unfinished user input +# (long option, subcommand, and argument). +# +# - once the subcommand (e.g. ofproto/trace) has been given, the +# script will print the subcommand format. +# +# - the script can convert between keywords like 'bridge/port/interface/dp' +# and the available record in ovsdb. +# +# The limitation are: +# +# - only support small set of important keywords +# (dp, datapath, bridge, switch, port, interface, iface). +# +# - does not support parsing of nested option +# (e.g. ovsdb-tool create [db [schema]]). +# +# - does not support expansion on repeatitive argument +# (e.g. ovs-dpctl show [dp...]). +# +# - only support matching on long options, and only in the format +# (--option [arg], i.e. should not use --option=[arg]). +# +# +# +# Keywords +# ======== +# +# +# +# Expandable keywords. +_KWORDS=(bridge switch port interface iface dp_name dp) +# Command name. +_COMMAND= +# Printf enabler. +_PRINTF_ENABLE= +# Bash prompt. +_BASH_PROMPT= +# Output to the compgen. +_COMP_WORDLIST= + +# +# For ovs-appctl command only. +# +# Target in the current completion, default ovs-vswitchd. +_APPCTL_TARGET= +# Possible targets. +_POSSIBLE_TARGETS="ovs-vswitchd ovsdb-server ovs-ofctl" + +# Command Extraction +# ================== +# +# +# +# Extracts all subcommands of 'command'. +# If fails, returns nothing. +extract_subcmds() { + local command=$_COMMAND + local target= + local subcmds error + + if [ -n "$_APPCTL_TARGET" ]; then + target="--target $_APPCTL_TARGET" + fi + + subcmds="$($command $target list-commands 2>/dev/null | tail -n +2 | cut -c3- \ + | cut -d ' ' -f1)" || error="TRUE" + + if [ -z "$error" ]; then + echo "$subcmds" + fi +} + +# Extracts all long options of ovs-appctl. +# If fails, returns nothing. +extract_options() { + local command=$_COMMAND + local options error + + options="$($command --option 2>/dev/null | sort | sed -n '/^--.*/p' | cut -d '=' -f1)" \ + || error="TRUE" + + if [ -z "$error" ]; then + echo "$options" + fi +} + +# Returns the option format, if the option asks for an argument. +# If fails, returns nothing. +option_require_arg() { + local command=$_COMMAND + local option=$1 + local require_arg error + + require_arg="$($command --option | sort | sed -n '/^--.*/p' | grep -- "$option" | grep -- "=")" \ + || error="TRUE" + + if [ -z "$error" ]; then + echo "$require_arg" + fi +} + +# Combination Discovery +# ===================== +# +# +# +# Given the subcommand formats, finds all possible completions +# at current completion level. +find_possible_comps() { + local combs="$@" + local comps= + local line + + while read line; do + local arg= + + for arg in $line; do + # If it is an optional argument, gets all completions, + # and continues. + if [ -n "$(sed -n '/^\[.*\]$/p' <<< "$arg")" ]; then + local opt_arg="$(sed -e 's/^\[\(.*\)\]$/\1/' <<< "$arg")" + local opt_args=() + + IFS='|' read -a opt_args <<< "$opt_arg" + comps="${opt_args[@]} $comps" + # If it is in format "\[*", it is a start of nested + # option, do not parse. + elif [ -n "$(sed -n "/^\[.*$/p" <<< "$arg")" ]; then + break; + # If it is a compulsory argument, adds it to the comps + # and break, since all following args are for next stage. + else + local args=() + + IFS='|' read -a args <<< "$arg" + comps="${args[@]} $comps" + break; + fi + done + done <<< "$combs" + + echo "$comps" +} + +# Given the subcommand format, and the current command line input, +# finds keywords of all possible completions. +subcmd_find_keyword_based_on_input() { + local format="$1" + local cmd_line=($2) + local mult= + local combs= + local comps= + local arg line + + # finds all combinations by searching for '{}'. + # there should only be one '{}', otherwise, the + # command format should be changed to multiple commands. + mult="$(sed -n 's/^.*{\(.*\)}.*$/ \1/p' <<< "$format" | tr '|' '\n' | cut -c1-)" + if [ -n "$mult" ]; then + while read line; do + local tmp= + + tmp="$(sed -e "s@{\(.*\)}@$line@" <<< "$format")" + combs="$combs@$tmp" + done <<< "$mult" + combs="$(tr '@' '\n' <<< "$combs")" + else + combs="$format" + fi + + # Now, starts from the first argument, narrows down the + # subcommand format combinations. + for arg in "${subcmd_line[@]}"; do + local kword possible_comps + + # Finds next level possible comps. + possible_comps=$(find_possible_comps "$combs") + # Finds the kword. + kword="$(arg_to_kwords "$arg" "$possible_comps")" + # Returns if could not find 'kword' + if [ -z "$kword" ]; then + return + fi + # Trims the 'combs', keeps context only after 'kword'. + if [ -n "$combs" ]; then + combs="$(sed -n "s@^.*\[\{0,1\}$kword|\{0,1\}[a-z_]*\]\{0,1\} @@p" <<< "$combs")" + fi + done + comps="$(find_possible_comps "$combs")" + + echo "$comps" +} + + + +# Helper +# ====== +# +# +# +# Prints the input to stderr. $_PRINTF_ENABLE must be filled. +printf_stderr() { + local stderr_out="$@" + + if [ -n "$_PRINTF_ENABLE" ]; then + printf "\n$stderr_out" 1>&2 + fi +} + +# Extracts the bash prompt PS1, outputs it with the input argument +# via 'printf_stderr'. +# +# Original idea inspired by: +# http://stackoverflow.com/questions/10060500/bash-how-to-evaluate-ps1-ps2 +# +# The code below is taken from Peter Amidon. His change makes it more +# robust. +extract_bash_prompt() { + local myPS1 v + + myPS1="$(sed 's/Begin prompt/\\Begin prompt/; s/End prompt/\\End prompt/' <<< "$PS1")" + v="$(bash --norc --noprofile -i 2>&1 <<< $'PS1=\"'"$myPS1"$'\" \n# Begin prompt\n# End prompt')" + v="${v##*# Begin prompt}" + _BASH_PROMPT="$(tail -n +2 <<< "${v%# End prompt*}" | sed 's/\\Begin prompt/Begin prompt/; s/\\End prompt/End prompt/')" +} + + + +# Keyword Conversion +# ================== +# +# +# +# All completion functions. +complete_bridge () { + local result error + + result=$(ovs-vsctl list-br 2>/dev/null | grep -- "^$1") || error="TRUE" + + if [ -z "$error" ]; then + echo "${result}" + fi +} + +complete_port () { + local ports result error + local all_ports + + all_ports=$(ovs-vsctl --format=table \ + --no-headings \ + --columns=name \ + list Port 2>/dev/null) || error="TRUE" + ports=$(printf "$all_ports" | sort | tr -d '"' | uniq -u) + result=$(grep -- "^$1" <<< "$ports") + + if [ -z "$error" ]; then + echo "${result}" + fi +} + +complete_iface () { + local bridge bridges result error + + bridges=$(ovs-vsctl list-br 2>/dev/null) || error="TRUE" + for bridge in $bridges; do + local ifaces + + ifaces=$(ovs-vsctl list-ifaces "${bridge}" 2>/dev/null) || error="TRUE" + result="${result} ${ifaces}" + done + + if [ -z "$error" ]; then + echo "${result}" + fi +} + +complete_dp () { + local dps result error + + dps=$(ovs-appctl dpctl/dump-dps 2>/dev/null | cut -d '@' -f2) || error="TRUE" + result=$(grep -- "^$1" <<< "$dps") + + if [ -z "$error" ]; then + echo "${result}" + fi +} + +# Converts the argument (e.g. bridge/port/interface/dp name) to +# the corresponding keywords. +# Returns empty string if could not map the arg to any keyword. +arg_to_kwords() { + local arg="$1" + local possible_kwords=($2) + local non_parsables=() + local match= + local kword + + for kword in ${possible_kwords[@]}; do + case "$kword" in + bridge|switch) + match="$(complete_bridge "$arg")" + ;; + port) + match="$(complete_port "$arg")" + ;; + interface|iface) + match="$(complete_iface "$arg")" + ;; + dp_name|dp) + match="$(complete_dp "$arg")" + ;; + *) + if [ "$arg" = "$kword" ]; then + match="$kword" + else + non_parsables+=("$kword") + continue + fi + ;; + esac + + if [ -n "$match" ]; then + echo "$kword" + return + fi + done + + # If there is only one non-parsable kword, + # just assumes the user input it. + if [ "${#non_parsables[@]}" -eq "1" ]; then + echo "$non_parsables" + return + fi +} + +# Expands the keywords to the corresponding instance names. +kwords_to_args() { + local possible_kwords=($@) + local args=() + local printf_expand_once= + local kword + + for kword in ${possible_kwords[@]}; do + local match= + + case "${kword}" in + bridge|switch) + match="$(complete_bridge "")" + ;; + port) + match="$(complete_port "")" + ;; + interface|iface) + match="$(complete_iface "")" + ;; + dp_name|dp) + match="$(complete_dp "")" + ;; + -*) + # Treats option as kword as well. + match="$kword" + ;; + *) + match= + ;; + esac + match=$(echo "$match" | tr '\n' ' ' | tr -s ' ' | sed -e 's/^[ \t]*//') + args+=( $match ) + if [ -n "$_PRINTF_ENABLE" ]; then + local output_stderr= + + if [ -z "$printf_expand_once" ]; then + printf_expand_once="once" + printf -v output_stderr "\nArgument expansion:\n" + fi + printf -v output_stderr "$output_stderr available completions \ +for keyword \"%s\": %s " "$kword" "$match" + + printf_stderr "$output_stderr" + fi + done + + echo "${args[@]}" +} + + + + +# Parse and Compgen +# ================= +# +# +# +# This function takes the current command line arguments as input, +# finds the command format and returns the possible completions. +parse_and_compgen() { + local command=$_COMMAND + local subcmd_line=($@) + local subcmd=${subcmd_line[0]} + local target= + local subcmd_format= + local comp_keywords= + local comp_wordlist= + + if [ -n "$_APPCTL_TARGET" ]; then + target="--target $_APPCTL_TARGET" + fi + + # Extracts the subcommand format. + subcmd_format="$($command $target list-commands 2>/dev/null | tail -n +2 | cut -c3- \ + | awk -v opt=$subcmd '$1 == opt {print $0}' | tr -s ' ' )" + + # Finds the possible completions based on input argument. + comp_keyword="$(subcmd_find_keyword_based_on_input "$subcmd_format" \ + "${subcmd_line[@]}")" + + # Prints subcommand format and expands the keywords if 'comp_keyword' + # is not empty. + if [ -n "$comp_keyword" ]; then + printf_stderr "$(printf "\nCommand format:\n%s" "$subcmd_format")" + comp_wordlist="$(kwords_to_args "$comp_keyword")" + # If there is no expanded completions, returns "NO_EXPAN" to + # distinguish from the case of no available completions. + if [ -z "$comp_wordlist" ]; then + echo "NO_EXPAN" + else + echo "$comp_wordlist" + fi + fi +} + + + +# Compgen Helper +# ============== +# +# +# +# Takes the current command line arguments and returns the possible +# completions. +# +# At the beginning, the options are checked and completed. For ovs-appctl +# completion, The function looks for the --target option which gives the +# target daemon name. If it is not provided, by default, 'ovs-vswitchd' +# is used. +# +# Then, tries to locate and complete the subcommand. If the subcommand +# is provided, the following arguments are passed to the 'parse_and_compgen' +# function to figure out the corresponding completion of the subcommand. +# +# Returns the completion arguments on success. +ovs_comp_helper() { + local cmd_line_so_far=($@) + local comp_wordlist _subcmd options i + local j=-1 + + # Parse the command-line args till we find the subcommand. + for i in "${!cmd_line_so_far[@]}"; do + # if $i is not greater than $j, it means the previous iteration + # skips not-visited args. so, do nothing and catch up. + if [ $i -le $j ]; then continue; fi + j=$i + if [[ "${cmd_line_so_far[i]}" =~ ^--* ]]; then + # If --target is found, locate the target daemon. + # Else, it is an option command, fill the comp_wordlist with + # all options. + if [ "$_COMMAND" = "ovs-appctl" ] \ + && [[ "${cmd_line_so_far[i]}" =~ ^--target$ ]]; then + _APPCTL_TARGET="ovs-vswitchd" + + if [ -n "${cmd_line_so_far[j+1]}" ]; then + local daemon + + for daemon in $_POSSIBLE_TARGETS; do + # Greps "$daemon" in argument, since the argument may + # be the path to the pid file. + if [ "$daemon" = "${cmd_line_so_far[j+1]}" ]; then + _APPCTL_TARGET="$daemon" + ((j++)) + break + fi + done + continue + else + comp_wordlist="$_POSSIBLE_TARGETS" + break + fi + else + options="$(extract_options $_COMMAND)" + # See if we could find the exact option. + if [ "${cmd_line_so_far[i]}" = "$(grep -- "${cmd_line_so_far[i]}" <<< "$options")" ]; then + # If an argument is required and next argument is non-empty, + # skip it. Else, return directly. + if [ -n "$(option_require_arg "${cmd_line_so_far[i]}")" ]; then + ((j++)) + if [ -z "${cmd_line_so_far[j]}" ]; then + printf_stderr "\nOption requires an arugment." + return + fi + fi + continue + # Else, need to keep completing on option. + else + comp_wordlist="$options" + break + fi + fi + fi + # Takes the first non-option argument as subcmd. + _subcmd="${cmd_line_so_far[i]}" + break + done + + if [ -z "$comp_wordlist" ]; then + # If the subcommand is not found, provides all subcmds and options. + if [ -z "$_subcmd" ]; then + comp_wordlist="$(extract_subcmds) $(extract_options)" + # Else parses the current arguments and finds the possible completions. + else + # $j stores the index of the subcmd in cmd_line_so_far. + comp_wordlist="$(parse_and_compgen "${cmd_line_so_far[@]:$j}")" + fi + fi + + echo "$comp_wordlist" +} + +# Compgen +# ======= +# +# +# +# The compgen function. +_ovs_command_complete() { + local cur prev + + _COMMAND=${COMP_WORDS} # element 0 is the command. + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + + # Do not print anything at first [TAB] execution. + if [ "$COMP_TYPE" -eq "9" ]; then + _PRINTF_ENABLE= + else + _PRINTF_ENABLE="enabled" + fi + + # Extracts bash prompt PS1. + if [ "$1" != "debug" ]; then + extract_bash_prompt + fi + + # Invokes the helper function to get all available completions. + # Always not input the 'COMP_WORD' at 'COMP_CWORD', since it is + # the one to be completed. + _COMP_WORDLIST="$(ovs_comp_helper \ + ${COMP_WORDS[@]:1:COMP_CWORD-1})" + + # This is a hack to prevent autocompleting when there is only one + # available completion and printf disabled. + if [ -z "$_PRINTF_ENABLE" ] && [ -n "$_COMP_WORDLIST" ]; then + _COMP_WORDLIST="$_COMP_WORDLIST none void no-op" + fi + + if [ -n "$_PRINTF_ENABLE" ] && [ -n "$_COMP_WORDLIST" ]; then + if [ -n "$(echo $_COMP_WORDLIST | tr ' ' '\n' | sed -e '/NO_EXPAN/d' | grep -- "^$cur")" ]; then + printf_stderr "\nAvailable completions:\n" + else + if [ "$1" != "debug" ]; then + # If there is no match between '$cur' and the '$_COMP_WORDLIST' + # prints a bash prompt since the 'complete' will not print it. + printf_stderr "\n$_BASH_PROMPT${COMP_WORDS[@]}" + fi + fi + fi + + if [ "$1" = "debug" ]; then + printf_stderr "$(echo $_COMP_WORDLIST | tr ' ' '\n' | sort -u | sed -e '/NO_EXPAN/d' | grep -- "$cur")\n" + else + if [ -n "$_COMP_WORDLIST" ]; then + COMPREPLY=( $(compgen -W "$(echo $_COMP_WORDLIST | tr ' ' '\n' \ + | sort -u | sed -e '/NO_EXPAN/d')" -- $cur) ) + else + compopt -o nospace + # If there is no completions, just complete on file path. + _filedir + fi + fi + + return 0 +} + +# Debug mode. +if [ "$1" = "debug" ]; then + shift + COMP_TYPE=0 + COMP_WORDS=($@) + COMP_CWORD="$(expr $# - 1)" + + # If the last argument is TAB, it means that the previous + # argument is already complete and script should complete + # next argument which is not input yet. This hack is for + # compromising the fact that bash cannot take unquoted + # empty argument. + if [ "${COMP_WORDS[$COMP_CWORD]}" = "TAB" ]; then + COMP_WORDS[$COMP_CWORD]="" + fi + + _ovs_command_complete "debug" +# Normal compgen mode. +else + complete -F _ovs_command_complete ovs-appctl + complete -F _ovs_command_complete ovs-ofctl + complete -F _ovs_command_complete ovs-dpctl + complete -F _ovs_command_complete ovsdb-tool +fi diff -Nru openvswitch-2.3.1/utilities/ovs-appctl.c openvswitch-2.4.0~git20150623/utilities/ovs-appctl.c --- openvswitch-2.3.1/utilities/ovs-appctl.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-appctl.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ #include "timeval.h" #include "unixctl.h" #include "util.h" +#include "openvswitch/vlog.h" static void usage(void); static const char *parse_command_line(int argc, char *argv[]); @@ -88,13 +89,13 @@ Targets:\n\ -t, --target=TARGET pidfile or socket to contact\n\ Common commands:\n\ - help List commands supported by the target\n\ + list-commands List commands supported by the target\n\ version Print version of the target\n\ vlog/list List current logging levels\n\ vlog/set [SPEC]\n\ Set log levels as detailed in SPEC, which may include:\n\ A valid module name (all modules, by default)\n\ - 'syslog', 'console', 'file' (all facilities, by default))\n\ + 'syslog', 'console', 'file' (all destinations, by default))\n\ 'off', 'emer', 'err', 'warn', 'info', or 'dbg' ('dbg', bydefault)\n\ vlog/reopen Make the program reopen its log file\n\ Other options:\n\ @@ -108,14 +109,22 @@ static const char * parse_command_line(int argc, char *argv[]) { + enum { + OPT_START = UCHAR_MAX + 1, + VLOG_OPTION_ENUMS + }; static const struct option long_options[] = { {"target", required_argument, NULL, 't'}, {"execute", no_argument, NULL, 'e'}, {"help", no_argument, NULL, 'h'}, + {"option", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, {"timeout", required_argument, NULL, 'T'}, + VLOG_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; + char *short_options_ = ovs_cmdl_long_options_to_short_options(long_options); + char *short_options = xasprintf("+%s", short_options_); const char *target; int e_options; @@ -124,7 +133,7 @@ for (;;) { int option; - option = getopt_long(argc, argv, "+t:hVe", long_options, NULL); + option = getopt_long(argc, argv, short_options, long_options, NULL); if (option == -1) { break; } @@ -150,6 +159,10 @@ usage(); break; + case 'o': + ovs_cmdl_print_options(long_options); + exit(EXIT_SUCCESS); + case 'T': time_alarm(atoi(optarg)); break; @@ -158,6 +171,8 @@ ovs_print_version(0, 0); exit(EXIT_SUCCESS); + VLOG_OPTION_HANDLERS + case '?': exit(EXIT_FAILURE); @@ -165,6 +180,8 @@ OVS_NOT_REACHED(); } } + free(short_options_); + free(short_options); if (optind >= argc) { ovs_fatal(0, "at least one non-option argument is required " diff -Nru openvswitch-2.3.1/utilities/ovs-benchmark.c openvswitch-2.4.0~git20150623/utilities/ovs-benchmark.c --- openvswitch-2.3.1/utilities/ovs-benchmark.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-benchmark.c 2015-06-23 18:46:21.000000000 +0000 @@ -31,7 +31,7 @@ #include "socket-util.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" #define DEFAULT_PORT 6630 @@ -49,19 +49,31 @@ static double timeout; -static const struct command *get_all_commands(void); +static const struct ovs_cmdl_command *get_all_commands(void); static void parse_options(int argc, char *argv[]); static void usage(void); +static int +do_poll(struct pollfd *fds, int nfds, int timeout) +{ + int retval; +#ifndef _WIN32 + do { + retval = poll(fds, nfds, timeout); + } while (retval < 0 && errno == EINTR); +#else + retval = WSAPoll(fds, nfds, timeout); +#endif + return retval; +} + static long long int time_in_msec(void) { struct timeval tv; - if (gettimeofday(&tv, NULL) < 0) { - ovs_fatal(errno, "gettimeofday"); - } + xgettimeofday(&tv); return tv.tv_sec * 1000LL + tv.tv_usec / 1000; } @@ -69,10 +81,13 @@ int main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { .argc = 0, }; set_program_name(argv[0]); - vlog_set_levels(NULL, VLF_ANY_FACILITY, VLL_EMER); + vlog_set_levels(NULL, VLF_ANY_DESTINATION, VLL_EMER); parse_options(argc, argv); - run_command(argc - optind, argv + optind, get_all_commands()); + ctx.argc = argc - optind; + ctx.argv = argv + optind; + ovs_cmdl_run_command(&ctx, get_all_commands()); return 0; } @@ -129,7 +144,7 @@ {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); local_addr.s_addr = htonl(INADDR_ANY); local_min_port = local_max_port = 0; @@ -232,7 +247,7 @@ } static void -cmd_listen(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +cmd_listen(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct pollfd *fds; int n_fds; @@ -284,9 +299,7 @@ for (;;) { int retval; - do { - retval = poll(fds, n_fds, -1); - } while (retval < 0 && errno == EINTR); + retval = do_poll(fds, n_fds, -1); if (retval < 0) { ovs_fatal(errno, "poll failed"); } @@ -360,7 +373,7 @@ } static void -cmd_rate(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +cmd_rate(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned short int local_port; unsigned short int remote_port; @@ -445,9 +458,7 @@ delay = 1000; } - do { - error = poll(fds, n_fds, delay) < 0 ? errno : 0; - } while (error == EINTR); + error = do_poll(fds, n_fds, delay); if (error) { ovs_fatal(errno, "poll"); } @@ -512,7 +523,7 @@ } static void -cmd_latency(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +cmd_latency(struct ovs_cmdl_context *ctx OVS_UNUSED) { unsigned short int local_port; unsigned short int remote_port; @@ -578,9 +589,7 @@ while (n_fds > 0) { int error; - do { - error = poll(fds, n_fds, -1) < 0 ? errno : 0; - } while (error == EINTR); + error = do_poll(fds, n_fds, -1); if (error) { ovs_fatal(errno, "poll"); } @@ -605,20 +614,20 @@ } static void -cmd_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +cmd_help(struct ovs_cmdl_context *ctx OVS_UNUSED) { usage(); } -static const struct command all_commands[] = { - { "listen", 0, 0, cmd_listen }, - { "rate", 0, 0, cmd_rate }, - { "latency", 0, 0, cmd_latency }, - { "help", 0, 0, cmd_help }, - { NULL, 0, 0, NULL }, +static const struct ovs_cmdl_command all_commands[] = { + { "listen", NULL, 0, 0, cmd_listen }, + { "rate", NULL, 0, 0, cmd_rate }, + { "latency", NULL, 0, 0, cmd_latency }, + { "help", NULL, 0, 0, cmd_help }, + { NULL, NULL, 0, 0, NULL }, }; -static const struct command *get_all_commands(void) +static const struct ovs_cmdl_command *get_all_commands(void) { return all_commands; } diff -Nru openvswitch-2.3.1/utilities/ovs-command-bashcomp.INSTALL.md openvswitch-2.4.0~git20150623/utilities/ovs-command-bashcomp.INSTALL.md --- openvswitch-2.3.1/utilities/ovs-command-bashcomp.INSTALL.md 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-command-bashcomp.INSTALL.md 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,88 @@ +Using bash command-line completion scripts +------------------------------------------ + +There are two completion scripts available, ovs-appctl-bashcomp.bash +and ovs-vsctl-bashcomp.bash respectively. + +ovs-appctl-bashcomp +------------------- + + ovs-appctl-bashcomp.bash adds bash command-line completion support + for ovs-appctl, ovs-dpctl, ovs-ofctl and ovsdb-tool commands. + + Features: + --------- + + display available completion or complete on unfinished user input + (long option, subcommand, and argument). + + once the subcommand (e.g. ofproto/trace) has been given, the + script will print the subcommand format. + + the script can convert between keywords like 'bridge/port/interface/dp' + and the available record in ovsdb. + + Limitations: + ------------ + + only support small set of important keywords + (dp, datapath, bridge, switch, port, interface, iface). + + does not support parsing of nested options + (e.g. ovsdb-tool create [db [schema]]). + + does not support expansion on repeatitive argument + (e.g. ovs-dpctl show [dp...]). + + only support matching on long options, and only in the format + (--option [arg], i.e. should not use --option=[arg]). + +ovs-vsctl-bashcomp +------------------- + + ovs-vsctl-bashcomp.bash adds bash command-line completion support + for ovs-vsctl command. + + Features: + --------- + + display available completion and complete on user input for + global/local options, command, and argument. + + query database and expand keywords like 'table/record/column/key' + to available completions. + + deal with argument relations like 'one and more', 'zero or one'. + + complete multiple ovs-vsctl commands cascaded via '--'. + + Limitations: + ------------ + + completion of very long ovs-vsctl command can take up to several + seconds. + +How to use: +----------- + + The bashcomp scripts should be placed at /etc/bash_completion.d/ + to be available for all bash sessions. Running 'make install' + will place the scripts to $(sysconfdir)/bash_completion.d/. So user + should specify --sysconfdir=/etc at configuration. Meanwhile, if OVS is + installed from packages, the scripts will automatically be placed inside + /etc/bash_completion.d/. + + If you just want to run the scripts in one bash, you can remove them from + /etc/bash_completion.d/ and run the scripts via '. ovs-appctl-bashcomp.bash' + or '. ovs-vsctl-bashcomp.bash'. + +Test: +----- + + Unit tests are added in tests/completion.at and integrated into autotest + framework. To run the tests, just do make check. + +Bug Reporting: +-------------- + +Please report problems to bugs@openvswitch.org. \ No newline at end of file diff -Nru openvswitch-2.3.1/utilities/ovs-ctl.8 openvswitch-2.4.0~git20150623/utilities/ovs-ctl.8 --- openvswitch-2.3.1/utilities/ovs-ctl.8 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-ctl.8 2015-06-23 18:46:21.000000000 +0000 @@ -22,6 +22,9 @@ .br \fBovs\-ctl stop .br +\fBovs\-ctl\fR \fB\-\-system\-id=random\fR|\fIuuid\fR +[\fIoptions\fR] \fBrestart +.br \fBovs\-ctl status .br \fBovs\-ctl version @@ -237,7 +240,7 @@ .PP The \fBrestart\fR command performs a \fBstop\fR followed by a \fBstart\fR command. The command can take the same options as that of the \fBstart\fR -command. In addition, it saves and restores Openflow flows for each +command. In addition, it saves and restores OpenFlow flows for each individual bridge. . .SH "The ``status'' command" @@ -267,7 +270,7 @@ bridge ``local ports''. . .IP 2. -Saves the Openflow flows of each bridge. +Saves the OpenFlow flows of each bridge. . .IP 3. Stops the Open vSwitch daemons, as if by a call to \fBovs\-ctl @@ -285,7 +288,7 @@ .IP 6. Starts OVS back up, as if by a call to \fBovs\-ctl start\fR. This reloads the kernel module, restarts the OVS daemons and finally -restores the saved Openflow flows. +restores the saved OpenFlow flows. . .IP 7. Restores the kernel configuration state that was saved in step 4. @@ -441,5 +444,5 @@ . .SH "SEE ALSO" . -\fBREADME\fR, \fBINSTALL.Linux\fR, \fBovsdb\-server\fR(8), +\fBREADME.md\fR, \fBINSTALL.Linux.md\fR, \fBovsdb\-server\fR(8), \fBovs\-vswitchd\fR(8). diff -Nru openvswitch-2.3.1/utilities/ovs-ctl.in openvswitch-2.4.0~git20150623/utilities/ovs-ctl.in --- openvswitch-2.3.1/utilities/ovs-ctl.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-ctl.in 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,33 @@ ## start ## ## ----- ## +# Keep track of removed vports so we can reload them if needed +removed_vports="" + +insert_mods () { + # Try loading openvswitch again. + action "Inserting openvswitch module" modprobe openvswitch + + for vport in $removed_vports; do + # Don't treat failures to load vports as fatal error + action "Inserting $vport module" modprobe $vport || true + done +} + insert_mod_if_required () { + # If this kernel has no module support, expect we're done. + if test ! -e /proc/modules + then + log_success_msg "Kernel has no loadable module support. Skipping modprobe" + return 0 + fi + # If openvswitch is already loaded then we're done. test -e /sys/module/openvswitch -o -e /sys/module/openvswitch_mod && \ return 0 # Load openvswitch. If that's successful then we're done. - action "Inserting openvswitch module" modprobe openvswitch && return 0 + insert_mods && return 0 # If the bridge module is loaded, then that might be blocking # openvswitch. Try to unload it, if there are no bridges. @@ -49,7 +69,7 @@ action "removing bridge module" rmmod bridge || return 1 # Try loading openvswitch again. - action "Inserting openvswitch module" modprobe openvswitch + insert_mods } ovs_vsctl () { @@ -290,7 +310,10 @@ } save_ofports_if_required () { - # Save ofports if we are upgrading from a pre-1.10 branch. + # Save OpenFlow port numbers if we are upgrading from a pre-1.10 branch. + # + # (Versions 1.10 and later save OpenFlow port numbers without assistance, + # so we don't have to do anything for them. case `ovs-appctl version | sed 1q` in "ovs-vswitchd (Open vSwitch) 1."[0-9].*) action "Saving ofport values" ovs_save save-ofports \ @@ -378,6 +401,13 @@ action "Removing datapath: $dp" ovs-dpctl del-dp "$dp" done + for vport in `awk '/^vport_/ { print $1 }' /proc/modules`; do + action "Removing $vport module" rmmod $vport + if ! grep -q $vport /proc/modules; then + removed_vports="$removed_vports $vport" + fi + done + # try both old and new names in case this is post upgrade if test -e /sys/module/openvswitch_mod; then action "Removing openvswitch module" rmmod openvswitch_mod @@ -687,7 +717,7 @@ done case $command in start) - start_ovsdb + start_ovsdb || exit 1 start_forwarding add_managers ;; diff -Nru openvswitch-2.3.1/utilities/ovs-dev.py openvswitch-2.4.0~git20150623/utilities/ovs-dev.py --- openvswitch-2.3.1/utilities/ovs-dev.py 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-dev.py 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright (c) 2013, 2014 Nicira, Inc. +# Copyright (c) 2013, 2014, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,14 +26,15 @@ ROOT = HOME + "/root" BUILD_GCC = OVS_SRC + "/_build-gcc" BUILD_CLANG = OVS_SRC + "/_build-clang" -PATH = "%(ovs)s/utilities:%(ovs)s/ovsdb:%(ovs)s/vswitchd" % {"ovs": BUILD_GCC} - -ENV["PATH"] = PATH + ":" + ENV["PATH"] options = None parser = None commands = [] +def set_path(build): + PATH = "%(ovs)s/utilities:%(ovs)s/ovsdb:%(ovs)s/vswitchd" % {"ovs": build} + + ENV["PATH"] = PATH + ":" + ENV["PATH"] def _sh(*args, **kwargs): print "------> " + " ".join(args) @@ -81,7 +82,7 @@ if options.optimize is None: options.optimize = 0 - cflags += " -O%d" % options.optimize + cflags += " -O%s" % str(options.optimize) ENV["CFLAGS"] = cflags @@ -131,6 +132,7 @@ if clang: mf.write(make_str % BUILD_CLANG) mf.write("\t$(MAKE) -C %s %s $@\n" % (BUILD_GCC, c1)) + mf.write("\ncheck-valgrind:\n") mf.write("\ncheck:\n") mf.write(make_str % BUILD_GCC) mf.close() @@ -144,6 +146,18 @@ def check(): + flags = "" + if options.jobs: + flags += "-j%d " % options.jobs + else: + flags += "-j8 " + if options.tests: + for arg in str.split(options.tests): + if arg[0].isdigit(): + flags += "%s " % arg + else: + flags += "-k %s " % arg + ENV["TESTSUITEFLAGS"] = flags make("check") commands.append(check) @@ -203,7 +217,7 @@ _sh("ovsdb-tool", "create", ROOT + "/conf.db", OVS_SRC + "/vswitchd/vswitch.ovsschema") - opts = ["--pidfile", "--log-file", "--enable-dummy"] + opts = ["--pidfile", "--log-file"] _sh(*(["ovsdb-server", "--remote=punix:%s/run/db.sock" % ROOT, @@ -223,7 +237,14 @@ _sh("ovs-vsctl --no-wait set Open_vSwitch %s ovs_version=%s" % (root_uuid, version)) - cmd = [BUILD_GCC + "/vswitchd/ovs-vswitchd"] + build = BUILD_CLANG if options.clang else BUILD_GCC + cmd = [build + "/vswitchd/ovs-vswitchd"] + + if options.dpdk: + cmd.append("--dpdk") + cmd.extend(options.dpdk) + cmd.append("--") + if options.gdb: cmd = ["gdb", "--args"] + cmd elif options.valgrind: @@ -232,7 +253,7 @@ "--suppressions=%s/tests/openssl.supp" % OVS_SRC] + cmd else: cmd = ["sudo"] + cmd - opts = opts + ["-vconsole:off", "--detach"] + opts = opts + ["-vconsole:off", "--detach", "--enable-dummy"] _sh(*(cmd + opts)) commands.append(run) @@ -248,7 +269,8 @@ pass # Module isn't loaded try: - _sh("rm /lib/modules/%s/extra/openvswitch.ko" % uname()) + _sh("rm -f /lib/modules/%s/extra/openvswitch.ko" % uname()) + _sh("rm -f /lib/modules/%s/extra/vport-*.ko" % uname()) except subprocess.CalledProcessError, e: pass # Module isn't installed @@ -258,6 +280,7 @@ _sh("modprobe", "openvswitch") _sh("dmesg | grep openvswitch | tail -1") + _sh("find /lib/modules/%s/ -iname vport-*.ko -exec insmod '{}' \;" % uname()) commands.append(modinst) @@ -294,6 +317,11 @@ # Install the kernel module sudo insmod %(ovs)s/datapath/linux/openvswitch.ko + # If needed, manually load all required vport modules: + sudo insmod %(ovs)s/datapath/linux/vport-vxlan.ko + sudo insmod %(ovs)s/datapath/linux/vport-geneve.ko + [...] + # Run the switch. %(v)s run @@ -312,6 +340,16 @@ sys.exit(0) commands.append(doc) +def parse_subargs(option, opt_str, value, parser): + subopts = [] + + while parser.rargs: + dpdkarg = parser.rargs.pop(0) + if dpdkarg == "--": + break + subopts.append(dpdkarg) + + setattr(parser.values, option.dest, subopts) def main(): global options @@ -333,10 +371,21 @@ help="configure the man documentation install directory") group.add_option("--with-dpdk", dest="with_dpdk", metavar="DPDK_BUILD", help="built with dpdk libraries located at DPDK_BUILD"); + parser.add_option_group(group) + + group = optparse.OptionGroup(parser, "Optimization Flags") + for i in ["s", "g"] + range(4) + ["fast"]: + group.add_option("--O%s" % str(i), dest="optimize", + action="store_const", const=i, + help="compile with -O%s" % str(i)) + parser.add_option_group(group) - for i in range(4): - group.add_option("--O%d" % i, dest="optimize", action="store_const", - const=i, help="compile with -O%d" % i) + group = optparse.OptionGroup(parser, "check") + group.add_option("-j", "--jobs", dest="jobs", metavar="N", type="int", + help="Run N tests in parallel") + group.add_option("--tests", dest="tests", metavar="FILTER", + help="""run specific tests and/or a test category + eg, --tests=\"1-10 megaflow\"""") parser.add_option_group(group) group = optparse.OptionGroup(parser, "run") @@ -344,6 +393,12 @@ help="run ovs-vswitchd under gdb") group.add_option("--valgrind", dest="valgrind", action="store_true", help="run ovs-vswitchd under valgrind") + group.add_option("--dpdk", dest="dpdk", action="callback", + callback=parse_subargs, + help="run ovs-vswitchd with dpdk subopts (ended by --)") + group.add_option("--clang", dest="clang", action="store_true", + help="Use binaries built by clang") + parser.add_option_group(group) options, args = parser.parse_args() @@ -353,6 +408,11 @@ print "Unknown argument " + arg doc() + if options.clang: + set_path(BUILD_CLANG) + else: + set_path(BUILD_GCC) + try: os.chdir(OVS_SRC) except OSError: diff -Nru openvswitch-2.3.1/utilities/ovs-docker openvswitch-2.4.0~git20150623/utilities/ovs-docker --- openvswitch-2.3.1/utilities/ovs-docker 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-docker 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,297 @@ +#!/bin/bash +# Copyright (C) 2014 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Check for programs we'll need. +search_path () { + save_IFS=$IFS + IFS=: + for dir in $PATH; do + IFS=$save_IFS + if test -x "$dir/$1"; then + return 0 + fi + done + IFS=$save_IFS + echo >&2 "$0: $1 not found in \$PATH, please install and try again" + exit 1 +} + +ovs_vsctl () { + ovs-vsctl --timeout=60 "$@" +} + +create_netns_link () { + mkdir -p /var/run/netns + if [ ! -e /var/run/netns/"$PID" ]; then + ln -s /proc/"$PID"/ns/net /var/run/netns/"$PID" + trap 'delete_netns_link' 0 + for signal in 1 2 3 13 14 15; do + trap 'delete_netns_link; trap - $signal; kill -$signal $$' $signal + done + fi +} + +delete_netns_link () { + rm -f /var/run/netns/"$PID" +} + +get_port_for_container_interface () { + CONTAINER="$1" + INTERFACE="$2" + + PORT=`ovs_vsctl --data=bare --no-heading --columns=name find interface \ + external_ids:container_id="$CONTAINER" \ + external_ids:container_iface="$INTERFACE"` + if [ -z "$PORT" ]; then + echo >&2 "$UTIL: Failed to find any attached port" \ + "for CONTAINER=$CONTAINER and INTERFACE=$INTERFACE" + fi + echo "$PORT" +} + +add_port () { + BRIDGE="$1" + INTERFACE="$2" + CONTAINER="$3" + + if [ -z "$BRIDGE" ] || [ -z "$INTERFACE" ] || [ -z "$CONTAINER" ]; then + echo >&2 "$UTIL add-port: not enough arguments (use --help for help)" + exit 1 + fi + + shift 3 + while [ $# -ne 0 ]; do + case $1 in + --ipaddress=*) + ADDRESS=`expr X"$1" : 'X[^=]*=\(.*\)'` + shift + ;; + --macaddress=*) + MACADDRESS=`expr X"$1" : 'X[^=]*=\(.*\)'` + shift + ;; + --gateway=*) + GATEWAY=`expr X"$1" : 'X[^=]*=\(.*\)'` + shift + ;; + --mtu=*) + MTU=`expr X"$1" : 'X[^=]*=\(.*\)'` + shift + ;; + *) + echo >&2 "$UTIL add-port: unknown option \"$1\"" + exit 1 + ;; + esac + done + + # Check if a port is already attached for the given container and interface + PORT=`get_port_for_container_interface "$CONTAINER" "$INTERFACE" \ + 2>/dev/null` + if [ -n "$PORT" ]; then + echo >&2 "$UTIL: Port already attached" \ + "for CONTAINER=$CONTAINER and INTERFACE=$INTERFACE" + exit 1 + fi + + if ovs_vsctl br-exists "$BRIDGE" || \ + ovs_vsctl add-br "$BRIDGE"; then :; else + echo >&2 "$UTIL: Failed to create bridge $BRIDGE" + exit 1 + fi + + if PID=`docker inspect -f '{{.State.Pid}}' "$CONTAINER"`; then :; else + echo >&2 "$UTIL: Failed to get the PID of the container" + exit 1 + fi + + create_netns_link + + # Create a veth pair. + ID=`uuidgen | sed 's/-//g'` + PORTNAME="${ID:0:13}" + ip link add "${PORTNAME}_l" type veth peer name "${PORTNAME}_c" + + # Add one end of veth to OVS bridge. + if ovs_vsctl --may-exist add-port "$BRIDGE" "${PORTNAME}_l" \ + -- set interface "${PORTNAME}_l" \ + external_ids:container_id="$CONTAINER" \ + external_ids:container_iface="$INTERFACE"; then :; else + echo >&2 "$UTIL: Failed to add "${PORTNAME}_l" port to bridge $BRIDGE" + ip link delete "${PORTNAME}_l" + exit 1 + fi + + ip link set "${PORTNAME}_l" up + + # Move "${PORTNAME}_c" inside the container and changes its name. + ip link set "${PORTNAME}_c" netns "$PID" + ip netns exec "$PID" ip link set dev "${PORTNAME}_c" name "$INTERFACE" + ip netns exec "$PID" ip link set "$INTERFACE" up + + if [ -n "$MTU" ]; then + ip netns exec "$PID" ip link set dev "$INTERFACE" mtu "$MTU" + fi + + if [ -n "$ADDRESS" ]; then + ip netns exec "$PID" ip addr add "$ADDRESS" dev "$INTERFACE" + fi + + if [ -n "$MACADDRESS" ]; then + ip netns exec "$PID" ip link set dev "$INTERFACE" address "$MACADDRESS" + fi + + if [ -n "$GATEWAY" ]; then + ip netns exec "$PID" ip route add default via "$GATEWAY" + fi +} + +del_port () { + BRIDGE="$1" + INTERFACE="$2" + CONTAINER="$3" + + if [ "$#" -lt 3 ]; then + usage + exit 1 + fi + + PORT=`get_port_for_container_interface "$CONTAINER" "$INTERFACE"` + if [ -z "$PORT" ]; then + exit 1 + fi + + ovs_vsctl --if-exists del-port "$PORT" + + ip link delete "$PORT" +} + +del_ports () { + BRIDGE="$1" + CONTAINER="$2" + if [ "$#" -lt 2 ]; then + usage + exit 1 + fi + + PORTS=`ovs_vsctl --data=bare --no-heading --columns=name find interface \ + external_ids:container_id="$CONTAINER"` + if [ -z "$PORTS" ]; then + exit 0 + fi + + for PORT in $PORTS; do + ovs_vsctl --if-exists del-port "$PORT" + ip link delete "$PORT" + done +} + +set_vlan () { + BRIDGE="$1" + INTERFACE="$2" + CONTAINER_ID="$3" + VLAN="$4" + + if [ "$#" -lt 4 ]; then + usage + exit 1 + fi + + PORT=`get_port_for_container_interface "$CONTAINER_ID" "$INTERFACE"` + if [ -z "$PORT" ]; then + exit 1 + fi + ovs_vsctl set port "$PORT" tag="$VLAN" +} + +usage() { + cat << EOF +${UTIL}: Performs integration of Open vSwitch with Docker. +usage: ${UTIL} COMMAND + +Commands: + add-port BRIDGE INTERFACE CONTAINER [--ipaddress="ADDRESS"] + [--gateway=GATEWAY] [--macaddress="MACADDRESS"] + [--mtu=MTU] + Adds INTERFACE inside CONTAINER and connects it as a port + in Open vSwitch BRIDGE. Optionally, sets ADDRESS on + INTERFACE. ADDRESS can include a '/' to represent network + prefix length. Optionally, sets a GATEWAY, MACADDRESS + and MTU. e.g.: + ${UTIL} add-port br-int eth1 c474a0e2830e + --ipaddress=192.168.1.2/24 --gateway=192.168.1.1 + --macaddress="a2:c3:0d:49:7f:f8" --mtu=1450 + del-port BRIDGE INTERFACE CONTAINER + Deletes INTERFACE inside CONTAINER and removes its + connection to Open vSwitch BRIDGE. e.g.: + ${UTIL} del-port br-int eth1 c474a0e2830e + del-ports BRIDGE CONTAINER + Removes all Open vSwitch interfaces from CONTAINER. e.g.: + ${UTIL} del-ports br-int c474a0e2830e + set-vlan BRIDGE INTERFACE CONTAINER VLAN + Configures the INTERFACE of CONTAINER attached to BRIDGE + to become an access port of VLAN. e.g.: + ${UTIL} set-vlan br-int eth1 c474a0e2830e 5 +Options: + -h, --help display this help message. +EOF +} + +UTIL=$(basename $0) +search_path ovs-vsctl +search_path docker +search_path uuidgen + +if (ip netns) > /dev/null 2>&1; then :; else + echo >&2 "$UTIL: ip utility not found (or it does not support netns),"\ + "cannot proceed" + exit 1 +fi + +if [ $# -eq 0 ]; then + usage + exit 0 +fi + +case $1 in + "add-port") + shift + add_port "$@" + exit 0 + ;; + "del-port") + shift + del_port "$@" + exit 0 + ;; + "del-ports") + shift + del_ports "$@" + exit 0 + ;; + "set-vlan") + shift + set_vlan "$@" + exit 0 + ;; + -h | --help) + usage + exit 0 + ;; + *) + echo >&2 "$UTIL: unknown command \"$1\" (use --help for help)" + exit 1 + ;; +esac diff -Nru openvswitch-2.3.1/utilities/ovs-dpctl.8.in openvswitch-2.4.0~git20150623/utilities/ovs-dpctl.8.in --- openvswitch-2.3.1/utilities/ovs-dpctl.8.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-dpctl.8.in 2015-06-23 18:46:21.000000000 +0000 @@ -18,6 +18,13 @@ The \fBovs\-dpctl\fR program can create, modify, and delete Open vSwitch datapaths. A single machine may host any number of datapaths. .PP +This program works only with datapaths that are implemented outside of +\fBovs\-vswitchd\fR itself, such as the Linux and Windows kernel-based +datapaths. To manage datapaths that are integrated into +\fBovs\-vswitchd\fR, such as the userspace (\fBnetdev\fR) datapath, +use \fBovs\-appctl\fR(8) to invoke the \fBdpctl/*\fR commands, which +are documented in \fBovs\-vswitchd\fR(8). +.PP A newly created datapath is associated with only one network device, a virtual network device sometimes called the datapath's ``local port''. A newly created datapath is not, however, associated with any of the @@ -37,150 +44,11 @@ .PP The following commands manage datapaths. . -.TP -\fBadd\-dp \fIdp\fR [\fInetdev\fR[\fB,\fIoption\fR]...] -Creates datapath \fIdp\fR, with a local port also named \fIdp\fR. -This will fail if a network device \fIdp\fR already exists. -.IP -If \fInetdev\fRs are specified, \fBovs\-dpctl\fR adds them to the -new datapath, just as if \fBadd\-if\fR was specified. -. -.TP -\fBdel\-dp \fIdp\fR -Deletes datapath \fIdp\fR. If \fIdp\fR is associated with any network -devices, they are automatically removed. -. -.TP -\fBadd\-if \fIdp netdev\fR[\fB,\fIoption\fR]... -Adds each \fInetdev\fR to the set of network devices datapath -\fIdp\fR monitors, where \fIdp\fR is the name of an existing -datapath, and \fInetdev\fR is the name of one of the host's -network devices, e.g. \fBeth0\fR. Once a network device has been added -to a datapath, the datapath has complete ownership of the network device's -traffic and the network device appears silent to the rest of the -system. -.IP -A \fInetdev\fR may be followed by a comma-separated list of options. -The following options are currently supported: -. -.RS -.IP "\fBtype=\fItype\fR" -Specifies the type of port to add. The default type is \fBsystem\fR. -.IP "\fBport_no=\fIport\fR" -Requests a specific port number within the datapath. If this option is -not specified then one will be automatically assigned. -.IP "\fIkey\fB=\fIvalue\fR" -Adds an arbitrary key-value option to the port's configuration. -.RE -.IP -\fBovs\-vswitchd.conf.db\fR(5) documents the available port types and -options. -. -.IP "\fBset\-if \fIdp port\fR[\fB,\fIoption\fR]..." -Reconfigures each \fIport\fR in \fIdp\fR as specified. An -\fIoption\fR of the form \fIkey\fB=\fIvalue\fR adds the specified -key-value option to the port or overrides an existing key's value. An -\fIoption\fR of the form \fIkey\fB=\fR, that is, without a value, -deletes the key-value named \fIkey\fR. The type and port number of a -port cannot be changed, so \fBtype\fR and \fBport_no\fR are only allowed if -they match the existing configuration. -.TP -\fBdel\-if \fIdp netdev\fR... -Removes each \fInetdev\fR from the list of network devices datapath -\fIdp\fR monitors. -. -.TP -\fBdump\-dps\fR -Prints the name of each configured datapath on a separate line. -. -.TP -[\fB\-s\fR | \fB\-\-statistics\fR] \fBshow \fR[\fIdp\fR...] -Prints a summary of configured datapaths, including their datapath -numbers and a list of ports connected to each datapath. (The local -port is identified as port 0.) If \fB\-s\fR or \fB\-\-statistics\fR -is specified, then packet and byte counters are also printed for each -port. -.IP -The datapath numbers consists of flow stats and mega flow mask stats. -.IP -The "lookups" row displays three stats related to flow lookup triggered -by processing incoming packets in the datapath. "hit" displays number -of packets matches existing flows. "missed" displays the number of -packets not matching any existing flow and require user space processing. -"lost" displays number of packets destined for user space process but -subsequently dropped before reaching userspace. The sum of "hit" and "miss" -equals to the total number of packets datapath processed. -.IP -The "flows" row displays the number of flows in datapath. -.IP -The "masks" row displays the mega flow mask stats. This row is omitted -for datapath not implementing mega flow. "hit" displays the total number -of masks visited for matching incoming packets. "total" displays number of -masks in the datapath. "hit/pkt" displays the average number of masks -visited per packet; the ratio between "hit" and total number of -packets processed by the datapath". -.IP -If one or more datapaths are specified, information on only those -datapaths are displayed. Otherwise, \fBovs\-dpctl\fR displays information -about all configured datapaths. -.SS "DEBUGGING COMMANDS" -The following commands are primarily useful for debugging Open -vSwitch. The flow table entries (both matches and actions) that they -work with are not OpenFlow flow entries. Instead, they are different -and considerably simpler flows maintained by the Open vSwitch kernel -module. Use \fBovs\-ofctl\fR(8), instead, to work with OpenFlow flow -entries. -. -.PP -The \fIdp\fR argument to each of these commands is optional when -exactly one datapath exists, in which case that datapath is the -default. When multiple datapaths exist, then a datapath name is -required. -. -.IP "[\fB\-m \fR| \fB\-\-more\fR] \fBdump\-flows\fR [\fIdp\fR] [\fBfilter=\fIfilter\fR]" -Prints to the console all flow entries in datapath \fIdp\fR's flow -table. Without \fB\-m\fR or \fB\-\-more\fR, output omits match fields -that a flow wildcards entirely; with \fB\-m\fR or \fB\-\-more\fR, -output includes all wildcarded fields. -.IP -If \fBfilter=\fIfilter\fR is specified, only displays the flows -that match the \fIfilter\fR. \fIfilter\fR is a flow in the form similiar -to that accepted by \fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command. (This is -not an OpenFlow flow: besides other differences, it never contains wildcards.) -The \fIfilter\fR is also useful to match wildcarded fields in the datapath -flow. As an example, \fBfilter='tcp,tp_src=100'\fR will match the -datapath flow containing '\fBtcp(src=80/0xff00,dst=8080/0xff)\fR'. -. -.IP "\fBadd\-flow\fR [\fIdp\fR] \fIflow actions\fR" -.IQ "[\fB\-\-clear\fR] [\fB\-\-may-create\fR] [\fB\-s\fR | \fB\-\-statistics\fR] \fBmod\-flow\fR [\fIdp\fR] \fIflow actions\fR" -Adds or modifies a flow in \fIdp\fR's flow table that, when a packet -matching \fIflow\fR arrives, causes \fIactions\fR to be executed. -.IP -The \fBadd\-flow\fR command succeeds only if \fIflow\fR does not -already exist in \fIdp\fR. Contrariwise, \fBmod\-flow\fR without -\fB\-\-may\-create\fR only modifies the actions for an existing flow. -With \fB\-\-may\-create\fR, \fBmod\-flow\fR will add a new flow or -modify an existing one. -.IP -If \fB\-s\fR or \fB\-\-statistics\fR is specified, then -\fBmod\-flows\fR prints the modified flow's statistics. A flow's -statistics are the number of packets and bytes that have passed -through the flow, the elapsed time since the flow last processed a -packet (if ever), and (for TCP flows) the union of the TCP flags -processed through the flow. -.IP -With \fB\-\-clear\fR, \fBmod\-flows\fR zeros out the flow's -statistics. The statistics printed if \fB\-s\fR or -\fB\-\-statistics\fR is also specified are those from just before -clearing the statistics. -. -.IP "[\fB\-s\fR | \fB\-\-statistics\fR] \fBdel\-flow\fR [\fIdp\fR] \fIflow\fR" -Deletes the flow from \fIdp\fR's flow table that matches \fIflow\fR. -If \fB\-s\fR or \fB\-\-statistics\fR is specified, then -\fBmod\-flows\fR prints the deleted flow's statistics. -. -.IP "\fBdel\-flows\fR [\fIdp\fR]" -Deletes all flow entries from datapath \fIdp\fR's flow table. +.ds DX +.de DO +\\$1 \\$2 \\$3 +.. +.so lib/dpctl.man . .SH OPTIONS .IP "\fB\-s\fR" diff -Nru openvswitch-2.3.1/utilities/ovs-dpctl.c openvswitch-2.4.0~git20150623/utilities/ovs-dpctl.c --- openvswitch-2.3.1/utilities/ovs-dpctl.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-dpctl.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,50 +33,42 @@ #include "command-line.h" #include "compiler.h" #include "dirs.h" -#include "dpif.h" -#include "dynamic-string.h" +#include "dpctl.h" #include "fatal-signal.h" -#include "flow.h" -#include "match.h" -#include "netdev.h" -#include "netlink.h" #include "odp-util.h" #include "ofp-parse.h" -#include "ofpbuf.h" #include "packets.h" -#include "shash.h" -#include "simap.h" -#include "smap.h" -#include "sset.h" #include "timeval.h" #include "util.h" -#include "vlog.h" +#include "openvswitch/vlog.h" -/* -s, --statistics: Print port/flow statistics? */ -static bool print_statistics; +static struct dpctl_params dpctl_p; -/* --clear: Reset existing statistics to zero when modifying a flow? */ -static bool zero_statistics; - -/* --may-create: Allow mod-flows command to create a new flow? */ -static bool may_create; - -/* -m, --more: Increase output verbosity. */ -static int verbosity; - -static const struct command *get_all_commands(void); - -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void *userdata OVS_UNUSED); static void parse_options(int argc, char *argv[]); +static void +dpctl_print(void *userdata OVS_UNUSED, bool error, const char *msg) +{ + FILE *outfile = error ? stderr : stdout; + fputs(msg, outfile); +} + int main(int argc, char *argv[]) { + int error; set_program_name(argv[0]); parse_options(argc, argv); fatal_ignore_sigpipe(); - run_command(argc - optind, argv + optind, get_all_commands()); - return 0; + + dpctl_p.is_appctl = false; + dpctl_p.output = dpctl_print; + dpctl_p.usage = usage; + + error = dpctl_run_command(argc - optind, (const char **) argv + optind, + &dpctl_p); + return error ? EXIT_FAILURE : EXIT_SUCCESS; } static void @@ -94,11 +86,12 @@ {"more", no_argument, NULL, 'm'}, {"timeout", required_argument, NULL, 't'}, {"help", no_argument, NULL, 'h'}, + {"option", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, VLOG_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { unsigned long int timeout; @@ -111,19 +104,19 @@ switch (c) { case 's': - print_statistics = true; + dpctl_p.print_statistics = true; break; case OPT_CLEAR: - zero_statistics = true; + dpctl_p.zero_statistics = true; break; case OPT_MAY_CREATE: - may_create = true; + dpctl_p.may_create = true; break; case 'm': - verbosity++; + dpctl_p.verbosity++; break; case 't': @@ -137,7 +130,11 @@ break; case 'h': - usage(); + usage(NULL); + + case 'o': + ovs_cmdl_print_options(long_options); + exit(EXIT_SUCCESS); case 'V': ovs_print_version(0, 0); @@ -156,7 +153,7 @@ } static void -usage(void) +usage(void *userdata OVS_UNUSED) { printf("%s: Open vSwitch datapath management utility\n" "usage: %s [OPTIONS] COMMAND [ARG...]\n" @@ -171,6 +168,7 @@ " dump-flows [DP] display flows in DP\n" " add-flow [DP] FLOW ACTIONS add FLOW with ACTIONS to DP\n" " mod-flow [DP] FLOW ACTIONS change FLOW actions to ACTIONS in DP\n" + " get-flow [DP] ufid:UFID fetch flow corresponding to UFID\n" " del-flow [DP] FLOW delete FLOW from DP\n" " del-flows [DP] delete all flows from DP\n" "Each IFACE on add-dp, add-if, and set-if may be followed by\n" @@ -193,1055 +191,3 @@ " -V, --version display version information\n"); exit(EXIT_SUCCESS); } - -static void run(int retval, const char *message, ...) - PRINTF_FORMAT(2, 3); - -static void run(int retval, const char *message, ...) -{ - if (retval) { - va_list args; - - va_start(args, message); - ovs_fatal_valist(retval, message, args); - } -} - -static void dpctl_add_if(int argc, char *argv[]); - -static int if_up(const char *netdev_name) -{ - struct netdev *netdev; - int retval; - - retval = netdev_open(netdev_name, "system", &netdev); - if (!retval) { - retval = netdev_turn_flags_on(netdev, NETDEV_UP, NULL); - netdev_close(netdev); - } - return retval; -} - -/* Retrieve the name of the datapath if exactly one exists. The caller - * is responsible for freeing the returned string. If there is not one - * datapath, aborts with an error message. */ -static char * -get_one_dp(void) -{ - struct sset types; - const char *type; - char *dp_name = NULL; - size_t count = 0; - - sset_init(&types); - dp_enumerate_types(&types); - SSET_FOR_EACH (type, &types) { - struct sset names; - - sset_init(&names); - if (!dp_enumerate_names(type, &names)) { - count += sset_count(&names); - if (!dp_name && count == 1) { - dp_name = xasprintf("%s@%s", type, SSET_FIRST(&names)); - } - } - sset_destroy(&names); - } - sset_destroy(&types); - - if (!count) { - ovs_fatal(0, "no datapaths exist"); - } else if (count > 1) { - ovs_fatal(0, "multiple datapaths, specify one"); - } - - return dp_name; -} - -static int -parsed_dpif_open(const char *arg_, bool create, struct dpif **dpifp) -{ - int result; - char *name, *type; - - dp_parse_name(arg_, &name, &type); - - if (create) { - result = dpif_create(name, type, dpifp); - } else { - result = dpif_open(name, type, dpifp); - } - - free(name); - free(type); - return result; -} - -static void -dpctl_add_dp(int argc OVS_UNUSED, char *argv[]) -{ - struct dpif *dpif; - run(parsed_dpif_open(argv[1], true, &dpif), "add_dp"); - dpif_close(dpif); - if (argc > 2) { - dpctl_add_if(argc, argv); - } -} - -static void -dpctl_del_dp(int argc OVS_UNUSED, char *argv[]) -{ - struct dpif *dpif; - run(parsed_dpif_open(argv[1], false, &dpif), "opening datapath"); - run(dpif_delete(dpif), "del_dp"); - dpif_close(dpif); -} - -static void -dpctl_add_if(int argc OVS_UNUSED, char *argv[]) -{ - bool failure = false; - struct dpif *dpif; - int i; - - run(parsed_dpif_open(argv[1], false, &dpif), "opening datapath"); - for (i = 2; i < argc; i++) { - const char *name, *type; - char *save_ptr = NULL; - struct netdev *netdev = NULL; - struct smap args; - odp_port_t port_no = ODPP_NONE; - char *option; - int error; - - name = strtok_r(argv[i], ",", &save_ptr); - type = "system"; - - if (!name) { - ovs_error(0, "%s is not a valid network device name", argv[i]); - failure = true; - continue; - } - - smap_init(&args); - while ((option = strtok_r(NULL, ",", &save_ptr)) != NULL) { - char *save_ptr_2 = NULL; - char *key, *value; - - key = strtok_r(option, "=", &save_ptr_2); - value = strtok_r(NULL, "", &save_ptr_2); - if (!value) { - value = ""; - } - - if (!strcmp(key, "type")) { - type = value; - } else if (!strcmp(key, "port_no")) { - port_no = u32_to_odp(atoi(value)); - } else if (!smap_add_once(&args, key, value)) { - ovs_error(0, "duplicate \"%s\" option", key); - } - } - - error = netdev_open(name, type, &netdev); - if (error) { - ovs_error(error, "%s: failed to open network device", name); - goto next; - } - - error = netdev_set_config(netdev, &args); - if (error) { - goto next; - } - - error = dpif_port_add(dpif, netdev, &port_no); - if (error) { - ovs_error(error, "adding %s to %s failed", name, argv[1]); - goto next; - } - - error = if_up(name); - -next: - netdev_close(netdev); - if (error) { - failure = true; - } - } - dpif_close(dpif); - if (failure) { - exit(EXIT_FAILURE); - } -} - -static void -dpctl_set_if(int argc, char *argv[]) -{ - bool failure = false; - struct dpif *dpif; - int i; - - run(parsed_dpif_open(argv[1], false, &dpif), "opening datapath"); - for (i = 2; i < argc; i++) { - struct netdev *netdev = NULL; - struct dpif_port dpif_port; - char *save_ptr = NULL; - char *type = NULL; - const char *name; - struct smap args; - odp_port_t port_no; - char *option; - int error; - - name = strtok_r(argv[i], ",", &save_ptr); - if (!name) { - ovs_error(0, "%s is not a valid network device name", argv[i]); - failure = true; - continue; - } - - /* Get the port's type from the datapath. */ - error = dpif_port_query_by_name(dpif, name, &dpif_port); - if (error) { - ovs_error(error, "%s: failed to query port in %s", name, argv[1]); - goto next; - } - type = xstrdup(dpif_port.type); - port_no = dpif_port.port_no; - dpif_port_destroy(&dpif_port); - - /* Retrieve its existing configuration. */ - error = netdev_open(name, type, &netdev); - if (error) { - ovs_error(error, "%s: failed to open network device", name); - goto next; - } - - smap_init(&args); - error = netdev_get_config(netdev, &args); - if (error) { - ovs_error(error, "%s: failed to fetch configuration", name); - goto next; - } - - /* Parse changes to configuration. */ - while ((option = strtok_r(NULL, ",", &save_ptr)) != NULL) { - char *save_ptr_2 = NULL; - char *key, *value; - - key = strtok_r(option, "=", &save_ptr_2); - value = strtok_r(NULL, "", &save_ptr_2); - if (!value) { - value = ""; - } - - if (!strcmp(key, "type")) { - if (strcmp(value, type)) { - ovs_error(0, "%s: can't change type from %s to %s", - name, type, value); - failure = true; - } - } else if (!strcmp(key, "port_no")) { - if (port_no != u32_to_odp(atoi(value))) { - ovs_error(0, "%s: can't change port number from " - "%"PRIu32" to %d", - name, port_no, atoi(value)); - failure = true; - } - } else if (value[0] == '\0') { - smap_remove(&args, key); - } else { - smap_replace(&args, key, value); - } - } - - /* Update configuration. */ - error = netdev_set_config(netdev, &args); - smap_destroy(&args); - if (error) { - goto next; - } - -next: - free(type); - netdev_close(netdev); - if (error) { - failure = true; - } - } - dpif_close(dpif); - if (failure) { - exit(EXIT_FAILURE); - } -} - -static bool -get_port_number(struct dpif *dpif, const char *name, odp_port_t *port) -{ - struct dpif_port dpif_port; - - if (!dpif_port_query_by_name(dpif, name, &dpif_port)) { - *port = dpif_port.port_no; - dpif_port_destroy(&dpif_port); - return true; - } else { - ovs_error(0, "no port named %s", name); - return false; - } -} - -static void -dpctl_del_if(int argc OVS_UNUSED, char *argv[]) -{ - bool failure = false; - struct dpif *dpif; - int i; - - run(parsed_dpif_open(argv[1], false, &dpif), "opening datapath"); - for (i = 2; i < argc; i++) { - const char *name = argv[i]; - odp_port_t port; - int error; - - if (!name[strspn(name, "0123456789")]) { - port = u32_to_odp(atoi(name)); - } else if (!get_port_number(dpif, name, &port)) { - failure = true; - continue; - } - - error = dpif_port_del(dpif, port); - if (error) { - ovs_error(error, "deleting port %s from %s failed", name, argv[1]); - failure = true; - } - } - dpif_close(dpif); - if (failure) { - exit(EXIT_FAILURE); - } -} - -static void -print_stat(const char *leader, uint64_t value) -{ - fputs(leader, stdout); - if (value != UINT64_MAX) { - printf("%"PRIu64, value); - } else { - putchar('?'); - } -} - -static void -print_human_size(uint64_t value) -{ - if (value == UINT64_MAX) { - /* Nothing to do. */ - } else if (value >= 1024ULL * 1024 * 1024 * 1024) { - printf(" (%.1f TiB)", value / (1024.0 * 1024 * 1024 * 1024)); - } else if (value >= 1024ULL * 1024 * 1024) { - printf(" (%.1f GiB)", value / (1024.0 * 1024 * 1024)); - } else if (value >= 1024ULL * 1024) { - printf(" (%.1f MiB)", value / (1024.0 * 1024)); - } else if (value >= 1024) { - printf(" (%.1f KiB)", value / 1024.0); - } -} - -static void -show_dpif(struct dpif *dpif) -{ - struct dpif_port_dump dump; - struct dpif_port dpif_port; - struct dpif_dp_stats stats; - struct netdev *netdev; - - printf("%s:\n", dpif_name(dpif)); - if (!dpif_get_dp_stats(dpif, &stats)) { - printf("\tlookups: hit:%"PRIu64" missed:%"PRIu64" lost:%"PRIu64"\n" - "\tflows: %"PRIu64"\n", - stats.n_hit, stats.n_missed, stats.n_lost, stats.n_flows); - if (stats.n_masks != UINT32_MAX) { - uint64_t n_pkts = stats.n_hit + stats.n_missed; - double avg = n_pkts ? (double) stats.n_mask_hit / n_pkts : 0.0; - - printf("\tmasks: hit:%"PRIu64" total:%"PRIu32" hit/pkt:%.2f\n", - stats.n_mask_hit, stats.n_masks, avg); - } - } - - DPIF_PORT_FOR_EACH (&dpif_port, &dump, dpif) { - printf("\tport %u: %s", dpif_port.port_no, dpif_port.name); - - if (strcmp(dpif_port.type, "system")) { - int error; - - printf (" (%s", dpif_port.type); - - error = netdev_open(dpif_port.name, dpif_port.type, &netdev); - if (!error) { - struct smap config; - - smap_init(&config); - error = netdev_get_config(netdev, &config); - if (!error) { - const struct smap_node **nodes; - size_t i; - - nodes = smap_sort(&config); - for (i = 0; i < smap_count(&config); i++) { - const struct smap_node *node = nodes[i]; - printf("%c %s=%s", i ? ',' : ':', node->key, - node->value); - } - free(nodes); - } else { - printf(", could not retrieve configuration (%s)", - ovs_strerror(error)); - } - smap_destroy(&config); - - netdev_close(netdev); - } else { - printf(": open failed (%s)", ovs_strerror(error)); - } - putchar(')'); - } - putchar('\n'); - - if (print_statistics) { - struct netdev_stats s; - int error; - - error = netdev_open(dpif_port.name, dpif_port.type, &netdev); - if (error) { - printf(", open failed (%s)", ovs_strerror(error)); - continue; - } - error = netdev_get_stats(netdev, &s); - if (error) { - printf(", could not retrieve stats (%s)", ovs_strerror(error)); - continue; - } - - netdev_close(netdev); - print_stat("\t\tRX packets:", s.rx_packets); - print_stat(" errors:", s.rx_errors); - print_stat(" dropped:", s.rx_dropped); - print_stat(" overruns:", s.rx_over_errors); - print_stat(" frame:", s.rx_frame_errors); - printf("\n"); - - print_stat("\t\tTX packets:", s.tx_packets); - print_stat(" errors:", s.tx_errors); - print_stat(" dropped:", s.tx_dropped); - print_stat(" aborted:", s.tx_aborted_errors); - print_stat(" carrier:", s.tx_carrier_errors); - printf("\n"); - - print_stat("\t\tcollisions:", s.collisions); - printf("\n"); - - print_stat("\t\tRX bytes:", s.rx_bytes); - print_human_size(s.rx_bytes); - print_stat(" TX bytes:", s.tx_bytes); - print_human_size(s.tx_bytes); - printf("\n"); - } - } - dpif_close(dpif); -} - -static void -dpctl_show(int argc, char *argv[]) -{ - bool failure = false; - if (argc > 1) { - int i; - for (i = 1; i < argc; i++) { - const char *name = argv[i]; - struct dpif *dpif; - int error; - - error = parsed_dpif_open(name, false, &dpif); - if (!error) { - show_dpif(dpif); - } else { - ovs_error(error, "opening datapath %s failed", name); - failure = true; - } - } - } else { - struct sset types; - const char *type; - - sset_init(&types); - dp_enumerate_types(&types); - SSET_FOR_EACH (type, &types) { - struct sset names; - const char *name; - - sset_init(&names); - if (dp_enumerate_names(type, &names)) { - failure = true; - continue; - } - SSET_FOR_EACH (name, &names) { - struct dpif *dpif; - int error; - - error = dpif_open(name, type, &dpif); - if (!error) { - show_dpif(dpif); - } else { - ovs_error(error, "opening datapath %s failed", name); - failure = true; - } - } - sset_destroy(&names); - } - sset_destroy(&types); - } - if (failure) { - exit(EXIT_FAILURE); - } -} - -static void -dpctl_dump_dps(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) -{ - struct sset dpif_names, dpif_types; - const char *type; - int error = 0; - - sset_init(&dpif_names); - sset_init(&dpif_types); - dp_enumerate_types(&dpif_types); - - SSET_FOR_EACH (type, &dpif_types) { - const char *name; - int retval; - - retval = dp_enumerate_names(type, &dpif_names); - if (retval) { - error = retval; - } - - SSET_FOR_EACH (name, &dpif_names) { - struct dpif *dpif; - if (!dpif_open(name, type, &dpif)) { - printf("%s\n", dpif_name(dpif)); - dpif_close(dpif); - } - } - } - - sset_destroy(&dpif_names); - sset_destroy(&dpif_types); - if (error) { - exit(EXIT_FAILURE); - } -} - -static void -dpctl_dump_flows(int argc, char *argv[]) -{ - const struct dpif_flow_stats *stats; - const struct nlattr *actions; - struct dpif_flow_dump flow_dump; - const struct nlattr *key; - const struct nlattr *mask; - struct dpif_port dpif_port; - struct dpif_port_dump port_dump; - struct hmap portno_names; - struct simap names_portno; - size_t actions_len; - struct dpif *dpif; - size_t key_len; - size_t mask_len; - struct ds ds; - char *name, *filter = NULL; - struct flow flow_filter; - struct flow_wildcards wc_filter; - void *state = NULL; - int error; - - if (argc > 1 && !strncmp(argv[argc - 1], "filter=", 7)) { - filter = xstrdup(argv[--argc] + 7); - } - name = (argc == 2) ? xstrdup(argv[1]) : get_one_dp(); - - run(parsed_dpif_open(name, false, &dpif), "opening datapath"); - free(name); - - hmap_init(&portno_names); - simap_init(&names_portno); - DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) { - odp_portno_names_set(&portno_names, dpif_port.port_no, dpif_port.name); - simap_put(&names_portno, dpif_port.name, - odp_to_u32(dpif_port.port_no)); - } - - if (filter) { - char *err = parse_ofp_exact_flow(&flow_filter, &wc_filter.masks, - filter, &names_portno); - if (err) { - ovs_fatal(0, "Failed to parse filter (%s)", err); - } - } - - ds_init(&ds); - error = dpif_flow_dump_start(&flow_dump, dpif); - if (error) { - goto exit; - } - dpif_flow_dump_state_init(dpif, &state); - while (dpif_flow_dump_next(&flow_dump, state, &key, &key_len, - &mask, &mask_len, &actions, &actions_len, - &stats)) { - if (filter) { - struct flow flow; - struct flow_wildcards wc; - struct match match, match_filter; - struct minimatch minimatch; - - odp_flow_key_to_flow(key, key_len, &flow); - odp_flow_key_to_mask(mask, mask_len, &wc.masks, &flow); - match_init(&match, &flow, &wc); - - match_init(&match_filter, &flow_filter, &wc); - match_init(&match_filter, &match_filter.flow, &wc_filter); - minimatch_init(&minimatch, &match_filter); - - if (!minimatch_matches_flow(&minimatch, &match.flow)) { - minimatch_destroy(&minimatch); - continue; - } - minimatch_destroy(&minimatch); - } - ds_clear(&ds); - odp_flow_format(key, key_len, mask, mask_len, &portno_names, &ds, - verbosity); - ds_put_cstr(&ds, ", "); - - dpif_flow_stats_format(stats, &ds); - ds_put_cstr(&ds, ", actions:"); - format_odp_actions(&ds, actions, actions_len); - printf("%s\n", ds_cstr(&ds)); - } - dpif_flow_dump_state_uninit(dpif, state); - error = dpif_flow_dump_done(&flow_dump); - -exit: - if (error) { - ovs_fatal(error, "Failed to dump flows from datapath"); - } - free(filter); - odp_portno_names_destroy(&portno_names); - hmap_destroy(&portno_names); - simap_destroy(&names_portno); - ds_destroy(&ds); - dpif_close(dpif); -} - -static void -dpctl_put_flow(int argc, char *argv[], enum dpif_flow_put_flags flags) -{ - const char *key_s = argv[argc - 2]; - const char *actions_s = argv[argc - 1]; - struct dpif_flow_stats stats; - struct dpif_port dpif_port; - struct dpif_port_dump port_dump; - struct ofpbuf actions; - struct ofpbuf key; - struct ofpbuf mask; - struct dpif *dpif; - struct ds s; - char *dp_name; - struct simap port_names; - - dp_name = argc == 4 ? xstrdup(argv[1]) : get_one_dp(); - run(parsed_dpif_open(dp_name, false, &dpif), "opening datapath"); - free(dp_name); - - - simap_init(&port_names); - DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) { - simap_put(&port_names, dpif_port.name, odp_to_u32(dpif_port.port_no)); - } - - ds_init(&s); - ofpbuf_init(&key, 0); - ofpbuf_init(&mask, 0); - run(odp_flow_from_string(key_s, &port_names, &key, &mask), - "parsing flow key"); - - simap_destroy(&port_names); - - ofpbuf_init(&actions, 0); - run(odp_actions_from_string(actions_s, NULL, &actions), "parsing actions"); - - run(dpif_flow_put(dpif, flags, - ofpbuf_data(&key), ofpbuf_size(&key), - ofpbuf_size(&mask) == 0 ? NULL : ofpbuf_data(&mask), - ofpbuf_size(&mask), - ofpbuf_data(&actions), ofpbuf_size(&actions), - print_statistics ? &stats : NULL), - "updating flow table"); - - ofpbuf_uninit(&key); - ofpbuf_uninit(&mask); - ofpbuf_uninit(&actions); - - if (print_statistics) { - struct ds s; - - ds_init(&s); - dpif_flow_stats_format(&stats, &s); - puts(ds_cstr(&s)); - ds_destroy(&s); - } -} - -static void -dpctl_add_flow(int argc, char *argv[]) -{ - dpctl_put_flow(argc, argv, DPIF_FP_CREATE); -} - -static void -dpctl_mod_flow(int argc OVS_UNUSED, char *argv[]) -{ - enum dpif_flow_put_flags flags; - - flags = DPIF_FP_MODIFY; - if (may_create) { - flags |= DPIF_FP_CREATE; - } - if (zero_statistics) { - flags |= DPIF_FP_ZERO_STATS; - } - - dpctl_put_flow(argc, argv, flags); -} - -static void -dpctl_del_flow(int argc, char *argv[]) -{ - const char *key_s = argv[argc - 1]; - struct dpif_flow_stats stats; - struct dpif_port dpif_port; - struct dpif_port_dump port_dump; - struct ofpbuf key; - struct ofpbuf mask; /* To be ignored. */ - struct dpif *dpif; - char *dp_name; - struct simap port_names; - - dp_name = argc == 3 ? xstrdup(argv[1]) : get_one_dp(); - run(parsed_dpif_open(dp_name, false, &dpif), "opening datapath"); - free(dp_name); - - simap_init(&port_names); - DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) { - simap_put(&port_names, dpif_port.name, odp_to_u32(dpif_port.port_no)); - } - - ofpbuf_init(&key, 0); - ofpbuf_init(&mask, 0); - run(odp_flow_from_string(key_s, &port_names, &key, &mask), "parsing flow key"); - - run(dpif_flow_del(dpif, - ofpbuf_data(&key), ofpbuf_size(&key), - print_statistics ? &stats : NULL), "deleting flow"); - - simap_destroy(&port_names); - ofpbuf_uninit(&key); - ofpbuf_uninit(&mask); - - if (print_statistics) { - struct ds s; - - ds_init(&s); - dpif_flow_stats_format(&stats, &s); - puts(ds_cstr(&s)); - ds_destroy(&s); - } -} - -static void -dpctl_del_flows(int argc, char *argv[]) -{ - struct dpif *dpif; - char *name; - - name = (argc == 2) ? xstrdup(argv[1]) : get_one_dp(); - run(parsed_dpif_open(name, false, &dpif), "opening datapath"); - free(name); - - run(dpif_flow_flush(dpif), "deleting all flows"); - dpif_close(dpif); -} - -static void -dpctl_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) -{ - usage(); -} - -/* Undocumented commands for unit testing. */ - -static void -dpctl_parse_actions(int argc, char *argv[]) -{ - int i; - - for (i = 1; i < argc; i++) { - struct ofpbuf actions; - struct ds s; - - ofpbuf_init(&actions, 0); - run(odp_actions_from_string(argv[i], NULL, &actions), - "odp_actions_from_string"); - - ds_init(&s); - format_odp_actions(&s, ofpbuf_data(&actions), ofpbuf_size(&actions)); - puts(ds_cstr(&s)); - ds_destroy(&s); - - ofpbuf_uninit(&actions); - } -} - -struct actions_for_flow { - struct hmap_node hmap_node; - struct flow flow; - struct ofpbuf actions; -}; - -static struct actions_for_flow * -get_actions_for_flow(struct hmap *actions_per_flow, const struct flow *flow) -{ - uint32_t hash = flow_hash(flow, 0); - struct actions_for_flow *af; - - HMAP_FOR_EACH_WITH_HASH (af, hmap_node, hash, actions_per_flow) { - if (flow_equal(&af->flow, flow)) { - return af; - } - } - - af = xmalloc(sizeof *af); - af->flow = *flow; - ofpbuf_init(&af->actions, 0); - hmap_insert(actions_per_flow, &af->hmap_node, hash); - return af; -} - -static int -compare_actions_for_flow(const void *a_, const void *b_) -{ - struct actions_for_flow *const *a = a_; - struct actions_for_flow *const *b = b_; - - return flow_compare_3way(&(*a)->flow, &(*b)->flow); -} - -static int -compare_output_actions(const void *a_, const void *b_) -{ - const struct nlattr *a = a_; - const struct nlattr *b = b_; - uint32_t a_port = nl_attr_get_u32(a); - uint32_t b_port = nl_attr_get_u32(b); - - return a_port < b_port ? -1 : a_port > b_port; -} - -static void -sort_output_actions__(struct nlattr *first, struct nlattr *end) -{ - size_t bytes = (uint8_t *) end - (uint8_t *) first; - size_t n = bytes / NL_A_U32_SIZE; - - ovs_assert(bytes % NL_A_U32_SIZE == 0); - qsort(first, n, NL_A_U32_SIZE, compare_output_actions); -} - -static void -sort_output_actions(struct nlattr *actions, size_t length) -{ - struct nlattr *first_output = NULL; - struct nlattr *a; - int left; - - NL_ATTR_FOR_EACH (a, left, actions, length) { - if (nl_attr_type(a) == OVS_ACTION_ATTR_OUTPUT) { - if (!first_output) { - first_output = a; - } - } else { - if (first_output) { - sort_output_actions__(first_output, a); - first_output = NULL; - } - } - } - if (first_output) { - uint8_t *end = (uint8_t *) actions + length; - sort_output_actions__(first_output, - ALIGNED_CAST(struct nlattr *, end)); - } -} - -/* usage: "ovs-dpctl normalize-actions FLOW ACTIONS" where FLOW and ACTIONS - * have the syntax used by "ovs-dpctl dump-flows". - * - * This command prints ACTIONS in a format that shows what happens for each - * VLAN, independent of the order of the ACTIONS. For example, there is more - * than one way to output a packet on VLANs 9 and 11, but this command will - * print the same output for any form. - * - * The idea here generalizes beyond VLANs (e.g. to setting other fields) but - * so far the implementation only covers VLANs. */ -static void -dpctl_normalize_actions(int argc, char *argv[]) -{ - struct simap port_names; - struct ofpbuf keybuf; - struct flow flow; - struct ofpbuf odp_actions; - struct hmap actions_per_flow; - struct actions_for_flow **afs; - struct actions_for_flow *af; - struct nlattr *a; - size_t n_afs; - struct ds s; - int left; - int i; - - ds_init(&s); - - simap_init(&port_names); - for (i = 3; i < argc; i++) { - char name[16]; - int number; - - if (ovs_scan(argv[i], "%15[^=]=%d", name, &number)) { - uintptr_t n = number; - simap_put(&port_names, name, n); - } else { - ovs_fatal(0, "%s: expected NAME=NUMBER", argv[i]); - } - } - - /* Parse flow key. */ - ofpbuf_init(&keybuf, 0); - run(odp_flow_from_string(argv[1], &port_names, &keybuf, NULL), - "odp_flow_key_from_string"); - - ds_clear(&s); - odp_flow_format(ofpbuf_data(&keybuf), ofpbuf_size(&keybuf), NULL, 0, NULL, &s, verbosity); - printf("input flow: %s\n", ds_cstr(&s)); - - run(odp_flow_key_to_flow(ofpbuf_data(&keybuf), ofpbuf_size(&keybuf), &flow), - "odp_flow_key_to_flow"); - ofpbuf_uninit(&keybuf); - - /* Parse actions. */ - ofpbuf_init(&odp_actions, 0); - run(odp_actions_from_string(argv[2], &port_names, &odp_actions), - "odp_actions_from_string"); - simap_destroy(&port_names); - - if (verbosity) { - ds_clear(&s); - format_odp_actions(&s, ofpbuf_data(&odp_actions), ofpbuf_size(&odp_actions)); - printf("input actions: %s\n", ds_cstr(&s)); - } - - hmap_init(&actions_per_flow); - NL_ATTR_FOR_EACH (a, left, ofpbuf_data(&odp_actions), ofpbuf_size(&odp_actions)) { - const struct ovs_action_push_vlan *push; - switch(nl_attr_type(a)) { - case OVS_ACTION_ATTR_POP_VLAN: - flow.vlan_tci = htons(0); - continue; - - case OVS_ACTION_ATTR_PUSH_VLAN: - push = nl_attr_get_unspec(a, sizeof *push); - flow.vlan_tci = push->vlan_tci; - continue; - } - - af = get_actions_for_flow(&actions_per_flow, &flow); - nl_msg_put_unspec(&af->actions, nl_attr_type(a), - nl_attr_get(a), nl_attr_get_size(a)); - } - - n_afs = hmap_count(&actions_per_flow); - afs = xmalloc(n_afs * sizeof *afs); - i = 0; - HMAP_FOR_EACH (af, hmap_node, &actions_per_flow) { - afs[i++] = af; - } - ovs_assert(i == n_afs); - - qsort(afs, n_afs, sizeof *afs, compare_actions_for_flow); - - for (i = 0; i < n_afs; i++) { - const struct actions_for_flow *af = afs[i]; - - sort_output_actions(ofpbuf_data(&af->actions), ofpbuf_size(&af->actions)); - - if (af->flow.vlan_tci != htons(0)) { - printf("vlan(vid=%"PRIu16",pcp=%d): ", - vlan_tci_to_vid(af->flow.vlan_tci), - vlan_tci_to_pcp(af->flow.vlan_tci)); - } else { - printf("no vlan: "); - } - - if (eth_type_mpls(af->flow.dl_type)) { - printf("mpls(label=%"PRIu32",tc=%d,ttl=%d): ", - mpls_lse_to_label(af->flow.mpls_lse[0]), - mpls_lse_to_tc(af->flow.mpls_lse[0]), - mpls_lse_to_ttl(af->flow.mpls_lse[0])); - } else { - printf("no mpls: "); - } - - ds_clear(&s); - format_odp_actions(&s, ofpbuf_data(&af->actions), ofpbuf_size(&af->actions)); - puts(ds_cstr(&s)); - } - ds_destroy(&s); -} - -static const struct command all_commands[] = { - { "add-dp", 1, INT_MAX, dpctl_add_dp }, - { "del-dp", 1, 1, dpctl_del_dp }, - { "add-if", 2, INT_MAX, dpctl_add_if }, - { "del-if", 2, INT_MAX, dpctl_del_if }, - { "set-if", 2, INT_MAX, dpctl_set_if }, - { "dump-dps", 0, 0, dpctl_dump_dps }, - { "show", 0, INT_MAX, dpctl_show }, - { "dump-flows", 0, 2, dpctl_dump_flows }, - { "add-flow", 2, 3, dpctl_add_flow }, - { "mod-flow", 2, 3, dpctl_mod_flow }, - { "del-flow", 1, 2, dpctl_del_flow }, - { "del-flows", 0, 1, dpctl_del_flows }, - { "help", 0, INT_MAX, dpctl_help }, - - /* Undocumented commands for testing. */ - { "parse-actions", 1, INT_MAX, dpctl_parse_actions }, - { "normalize-actions", 2, INT_MAX, dpctl_normalize_actions }, - - { NULL, 0, 0, NULL }, -}; - -static const struct command *get_all_commands(void) -{ - return all_commands; -} diff -Nru openvswitch-2.3.1/utilities/ovs-lib.in openvswitch-2.4.0~git20150623/utilities/ovs-lib.in --- openvswitch-2.3.1/utilities/ovs-lib.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-lib.in 2015-06-23 18:46:21.000000000 +0000 @@ -128,6 +128,10 @@ test -d /proc/"$1" } +pid_comm_check () { + [ "$1" = "`cat /proc/$2/comm`" ] +} + start_daemon () { priority=$1 wrapper=$2 @@ -244,5 +248,5 @@ daemon_is_running () { pidfile=$rundir/$1.pid - test -e "$pidfile" && pid=`cat "$pidfile"` && pid_exists "$pid" + test -e "$pidfile" && pid=`cat "$pidfile"` && pid_exists "$pid" && pid_comm_check $1 $pid } >/dev/null 2>&1 diff -Nru openvswitch-2.3.1/utilities/ovs-ofctl.8.in openvswitch-2.4.0~git20150623/utilities/ovs-ofctl.8.in --- openvswitch-2.3.1/utilities/ovs-ofctl.8.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-ofctl.8.in 2015-06-23 18:46:21.000000000 +0000 @@ -63,6 +63,31 @@ Prints to the console features for each of the flow tables used by \fIswitch\fR. . +.IP "\fBmod\-table \fIswitch\fR \fItable_id\fR \fIflow_miss_handling\fR" +An OpenFlow 1.0 switch looks up each packet that arrives at the switch +in table 0, then in table 1 if there is no match in table 0, then in +table 2, and so on until the packet finds a match in some table. +Finally, if no match was found, the switch sends the packet to the +controller +.IP +OpenFlow 1.1 and later offer more flexibility. This command +configures the flow table miss handling configuration for table +\fItable_id\fR in \fIswitch\fR. \fItable_id\fR may be an OpenFlow +table number between 0 and 254, inclusive, or the keyword \fBALL\fR to +modify all tables. \fIflow_miss_handling\fR may be any one of the +following: +.RS +.IP \fBdrop\fR +Drop the packet. +.IP \fBcontinue\fR +Continue to the next table in the pipeline. (This is how an OpenFlow +1.0 switch always handles packets that do not match any flow, in +tables other than the last one.) +.IP \fBcontroller\fR +Send to controller. (This is how an OpenFlow 1.0 switch always +handles packets that do not match any flow in the last table.) +.RE +. .TP \fBdump\-ports \fIswitch\fR [\fInetdev\fR] Prints to the console statistics for network devices associated with @@ -231,31 +256,6 @@ groups are printed. See \fBGroup Syntax\fR, below, for the syntax of \fIgroups\fR. . -.IP "\fBmod\-table \fIswitch\fR \fItable_id\fR \fIflow_miss_handling\fR" -An OpenFlow 1.0 switch looks up each packet that arrives at the switch -in table 0, then in table 1 if there is no match in table 0, then in -table 2, and so on until the packet finds a match in some table. -Finally, if no match was found, the switch sends the packet to the -controller -.IP -OpenFlow 1.1 and later offer more flexibility. This command -configures the flow table miss handling configuration for table -\fItable_id\fR in \fIswitch\fR. \fItable_id\fR may be an OpenFlow -table number between 0 and 254, inclusive, or the keyword \fBALL\fR to -modify all tables. \fIflow_miss_handling\fR may be any one of the -following: -.RS -.IP \fBdrop\fR -Drop the packet. -.IP \fBcontinue\fR -Continue to the next table in the pipeline. (This is how an OpenFlow -1.0 switch always handles packets that do not match any flow, in -tables other than the last one.) -.IP \fBcontroller\fR -Send to controller. (This is how an OpenFlow 1.0 switch always -handles packets that do not match any flow in the last table.) -.RE -. .SS "OpenFlow 1.3+ Switch Meter Table Commands" . These commands manage the meter table in an OpenFlow switch. In each @@ -296,29 +296,39 @@ . These commands manage the flow table in an OpenFlow switch. In each case, \fIflow\fR specifies a flow entry in the format described in -\fBFlow Syntax\fR, below, and \fIfile\fR is a text file that contains -zero or more flows in the same syntax, one per line. -. -.IP "\fBadd\-flow \fIswitch flow\fR" -.IQ "\fBadd\-flow \fIswitch \fB\- < \fIfile\fR" -.IQ "\fBadd\-flows \fIswitch file\fR" +\fBFlow Syntax\fR, below, \fIfile\fR is a text file that contains zero +or more flows in the same syntax, one per line, and the optional +\fB\-\-bundle\fR option operates the command as a single atomic +transation, see option \fB\-\-bundle\fR, below. +. +.IP "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch flow\fR" +.IQ "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch \fB\- < \fIfile\fR" +.IQ "[\fB\-\-bundle\fR] \fBadd\-flows \fIswitch file\fR" Add each flow entry to \fIswitch\fR's tables. . -.IP "[\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR" -.IQ "[\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR" +Each flow specification (e.g., each line in \fIfile\fR) may start with +\fBadd\fR, \fBmodify\fR, \fBdelete\fR, \fBmodify_strict\fR, or +\fBdelete_strict\fR keyword to specify whether a flow is to be added, +modified, or deleted, and whether the modify or delete is strict or +not. For backwards compatibility a flow specification without one of +these keywords is treated as a flow add. All flow mods are executed +in the order specified. +. +.IP "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR" +.IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR" Modify the actions in entries from \fIswitch\fR's tables that match the specified flows. With \fB\-\-strict\fR, wildcards are not treated as active for matching purposes. . -.IP "\fBdel\-flows \fIswitch\fR" -.IQ "[\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]" -.IQ "[\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR" +.IP "[\fB\-\-bundle\fR] \fBdel\-flows \fIswitch\fR" +.IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]" +.IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR" Deletes entries from \fIswitch\fR's flow table. With only a \fIswitch\fR argument, deletes all flows. Otherwise, deletes flow entries that match the specified flows. With \fB\-\-strict\fR, wildcards are not treated as active for matching purposes. . -.IP "[\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR" +.IP "[\fB\-\-bundle\fR] [\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR" Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is \fB\-\fR) and queries the flow table from \fIswitch\fR. Then it fixes up any differences, adding flows from \fIflow\fR that are missing on @@ -353,7 +363,8 @@ . .IP "\fBpacket\-out \fIswitch in_port actions packet\fR..." Connects to \fIswitch\fR and instructs it to execute the OpenFlow -\fIactions\fR on each \fIpacket\fR. For the purpose of executing the +\fIactions\fR on each \fIpacket\fR. Each \fBpacket\fR is specified as a +series of hex digits. For the purpose of executing the actions, the packets are considered to have arrived on \fIin_port\fR, which may be an OpenFlow port number or name (e.g. \fBeth0\fR), the keyword \fBLOCAL\fR (the preferred way to refer to the OpenFlow @@ -384,6 +395,18 @@ \fIswitch\fR argument, deletes all groups. Otherwise, deletes the group for each group entry. . +.IP "\fBinsert\-buckets \fIswitch group\fR" +.IQ "\fBinsert\-buckets \fIswitch \fB\- < \fIfile\fR" +Add buckets to an existing group present in the \fIswitch\fR's group table. +If no \fIcommand_bucket_id\fR is present in the group specification then all +buckets of the group are removed. +. +.IP "\fBremove\-buckets \fIswitch group\fR" +.IQ "\fBremove\-buckets \fIswitch \fB\- < \fIfile\fR" +Remove buckets to an existing group present in the \fIswitch\fR's group table. +If no \fIcommand_bucket_id\fR is present in the group specification then all +buckets of the group are removed. +. .SS "OpenFlow Switch Monitoring Commands" . .IP "\fBsnoop \fIswitch\fR" @@ -536,8 +559,8 @@ example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3 fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be wildcarded. Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3 -protocol type) is wildcarded, so must be \fBtp_dst\fR and -\fBtp_src\fR, which are L4 fields. \fBovs\-ofctl\fR will warn about +protocol type) is wildcarded, so must be the L4 fields \fBtcp_dst\fR and +\fBtcp_src\fR. \fBovs\-ofctl\fR will warn about flows not in normal form. .PP The following field assignments describe how a flow matches a packet. @@ -687,21 +710,27 @@ above). .IP . -.IP \fBtp_src=\fIport\fR -.IQ \fBtp_dst=\fIport\fR -When \fBdl_type\fR and \fBnw_proto\fR specify TCP or UDP or SCTP, \fBtp_src\fR -and \fBtp_dst\fR match the UDP or TCP or SCTP source or destination port -\fIport\fR, respectively, which is specified as a decimal number -between 0 and 65535, inclusive (e.g. 80 to match packets originating -from a HTTP server). -.IP -When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of -these settings are ignored (see \fBFlow Syntax\fR above). -. -.IP \fBtp_src=\fIport\fB/\fImask\fR -.IQ \fBtp_dst=\fIport\fB/\fImask\fR -Bitwise match on TCP (or UDP or SCTP) source or destination port, -respectively. The \fIport\fR and \fImask\fR are 16-bit numbers +.IP \fBtcp_src=\fIport\fR +.IQ \fBtcp_dst=\fIport\fR +.IQ \fBudp_src=\fIport\fR +.IQ \fBudp_dst=\fIport\fR +.IQ \fBsctp_src=\fIport\fR +.IQ \fBsctp_dst=\fIport\fR +Matches a TCP, UDP, or SCTP source or destination port \fIport\fR, +which is specified as a decimal number between 0 and 65535, inclusive. +.IP +When \fBdl_type\fR and \fBnw_proto\fR are wildcarded or set to values +that do not indicate an appropriate protocol, the values of these +settings are ignored (see \fBFlow Syntax\fR above). +. +.IP \fBtcp_src=\fIport\fB/\fImask\fR +.IQ \fBtcp_dst=\fIport\fB/\fImask\fR +.IQ \fBudp_src=\fIport\fB/\fImask\fR +.IQ \fBudp_dst=\fIport\fB/\fImask\fR +.IQ \fBsctp_src=\fIport\fB/\fImask\fR +.IQ \fBsctp_dst=\fIport\fB/\fImask\fR +Bitwise match on TCP (or UDP or SCTP) source or destination port. +The \fIport\fR and \fImask\fR are 16-bit numbers written in decimal or in hexadecimal prefixed by \fB0x\fR. Each 1-bit in \fImask\fR requires that the corresponding bit in \fIport\fR must match. Each 0-bit in \fImask\fR causes the corresponding bit to be @@ -739,27 +768,32 @@ which become the following when written in the syntax required by \fBovs\-ofctl\fR: .br -.B "tcp,tp_src=0x03e8/0xfff8" +.B "tcp,tcp_src=0x03e8/0xfff8" .br -.B "tcp,tp_src=0x03f0/0xfff0" +.B "tcp,tcp_src=0x03f0/0xfff0" .br -.B "tcp,tp_src=0x0400/0xfe00" +.B "tcp,tcp_src=0x0400/0xfe00" .br -.B "tcp,tp_src=0x0600/0xff00" +.B "tcp,tcp_src=0x0600/0xff00" .br -.B "tcp,tp_src=0x0700/0xff80" +.B "tcp,tcp_src=0x0700/0xff80" .br -.B "tcp,tp_src=0x0780/0xffc0" +.B "tcp,tcp_src=0x0780/0xffc0" .br -.B "tcp,tp_src=0x07c0/0xfff0" +.B "tcp,tcp_src=0x07c0/0xfff0" .IP Only Open vSwitch 1.6 and later supports bitwise matching on transport ports. .IP -Like the exact-match forms of \fBtp_src\fR and \fBtp_dst\fR described +Like the exact-match forms described above, the bitwise match forms apply only when \fBdl_type\fR and \fBnw_proto\fR specify TCP or UDP or SCTP. . +.IP \fBtp_src=\fIport\fR +.IQ \fBtp_dst=\fIport\fR +These are deprecated generic forms of L4 port matches. In new code, +please use the TCP-, UDP-, or SCTP-specific forms described above. +. .IP \fBtcp_flags=\fIflags\fB/\fImask\fR .IQ \fBtcp_flags=\fR[\fB+\fIflag\fR...][\fB-\fIflag\fR...] Bitwise match on TCP flags. The \fIflags\fR and \fImask\fR are 16-bit @@ -1073,6 +1107,40 @@ (e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block (e.g. \fB192.168.1.0/24\fR). . +.IP \fBtun_gbp_id=\fIvalue\fR[\fB/\fImask\fR] +.IQ \fBtun_gbp_flags=\fIvalue\fR[\fB/\fImask\fR] +Matches the group policy identifier and flags in the VXLAN header. Only +packets that arrive over a VXLAN tunnel with the "gbp" extension +enabled can have this field set. The fields may also be referred to by +NXM_NX_TUN_GBP_ID[] (16 bits) and NXM_NX_TUN_GBP_FLAGS[] (8 bits) in +the context of field manipulation actions. If these fields are set and +the packet matched by the flow is encapsulated in a VXLAN-GBP tunnel, +then the policy identifier and flags are transmitted to the destination +VXLAN tunnel endpoint. +.IP +The \fBtun_gbp_flags\fR field has the following format: +.IP +.in +2 +\f(CR+-+-+-+-+-+-+-+-+\fR +.br +\f(CR|-|D|-|-|A|-|-|-|\fR +.br +\f(CR+-+-+-+-+-+-+-+-+\fR + +.B D := +Don't Learn bit. When set, this bit indicates that the egress +tunnel endpoint MUST NOT learn the source address of the encapsulated +frame. + +.B A := +Indicates that the group policy has already been applied to +this packet. Policies MUST NOT be applied by devices when the A bit is +set. +.in -2 +.IP +For more information, please see the corresponding IETF draft: +https://tools.ietf.org/html/draft-smith-vxlan-group-policy +. .IP "\fBreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]" Matches \fIvalue\fR either exactly or with optional \fImask\fR in register number \fIidx\fR. The valid range of \fIidx\fR depends on @@ -1083,7 +1151,22 @@ exactly, and a 0-bit wildcards that bit. .IP When a packet enters an OpenFlow switch, all of the registers are set -to 0. Only explicit Nicira extension actions change register values. +to 0. Only explicit actions change register values. +. +.IP "\fBxreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]" +Matches \fIvalue\fR either exactly or with optional \fImask\fR in +64-bit ``extended register'' number \fIidx\fR. Each of the 64-bit +extended registers overlays two of the 32-bit registers: \fBxreg0\fR +overlays \fBreg0\fR and \fBreg1\fR, with \fBreg0\fR supplying the +most-significant bits of \fBxreg0\fR and \fBreg1\fR the +least-significant. \fBxreg1\fR similarly overlays \fBreg2\fR and +\fBreg3\fR, and so on. +.IP +These fields were added in Open vSwitch 2.3 to conform with the +OpenFlow 1.5 specification. OpenFlow 1.5 calls these fields +just the ``packet registers,'' but Open vSwitch already had 32-bit +registers by that name, which is why Open vSwitch refers to the +standard registers as ``extended registers''. . .IP \fBpkt_mark=\fIvalue\fR[\fB/\fImask\fR] Matches packet metadata mark \fIvalue\fR either exactly or with optional @@ -1092,6 +1175,23 @@ On Linux this corresponds to the skb mark but the exact implementation is platform-dependent. . +.IP \fBactset_output=\fIport\fR +Matches the output port currently in the OpenFlow action set, where +\fIport\fR may be an OpenFlow port number or keyword +(e.g. \fBLOCAL\fR). If there is no output port in the OpenFlow action +set, or if the output port will be ignored (e.g. because there is an +output group in the OpenFlow action set), then the value will be +\fBUNSET\fR. +.IP +This field was introduced in Open vSwitch 2.4 to conform with the +OpenFlow 1.5 specification. +. +.IP \fBconj_id=\fIvalue\fR +Matches the given 32-bit \fIvalue\fR against the conjunction ID. This +is used only with the \fBconjunction\fR action (see below). +.IP +This field was introduced in Open vSwitch 2.4. +. .PP Defining IPv6 flows (those with \fBdl_type\fR equal to 0x86dd) requires support for NXM. The following shorthand notations are available for @@ -1144,6 +1244,10 @@ of \fBoutput\fR uses an OpenFlow extension that is not supported by standard OpenFlow switches. . +.IP \fBgroup:\fIgroup_id\fR +Outputs the packet to the OpenFlow group \fIgroup_id\fR. Group tables +are only supported in OpenFlow 1.1+. See Group Syntax for more details. +. .IP \fBnormal\fR Subjects the packet to the device's normal L2/L3 processing. (This action is not implemented by all OpenFlow switches.) @@ -1388,13 +1492,40 @@ through 31, inclusive; \fBmove:NXM_NX_REG0[0..15]\->NXM_OF_VLAN_TCI[]\fR copies the least significant 16 bits of register 0 into the VLAN TCI field. -. -.IP "\fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]" -Writes \fIvalue\fR to bits \fIstart\fR through \fIend\fR, inclusive, -in field \fIdst\fR. .IP -Example: \fBload:55\->NXM_NX_REG2[0..5]\fR loads value 55 (bit pattern -\fB110111\fR) into bits 0 through 5, inclusive, in register 2. +In OpenFlow 1.0 through 1.4, \fBmove\fR ordinarily uses an Open +vSwitch extension to OpenFlow. In OpenFlow 1.5, \fBmove\fR uses the +OpenFlow 1.5 standard \fBcopy_field\fR action. The ONF has +also made \fBcopy_field\fR available as an extension to OpenFlow 1.3. +Open vSwitch 2.4 and later understands this extension and uses it if a +controller uses it, but for backward compatibility with older versions +of Open vSwitch, \fBovs\-ofctl\fR does not use it. +. +.IP "\fBset_field:\fIvalue\fR[/\fImask\fR]\fB\->\fIdst" +.IQ "\fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]" +Loads a literal value into a field or part of a field. With +\fBset_field\fR, \fBvalue\fR and the optional \fBmask\fR are given in +the customary syntax for field \fIdst\fR, which is expressed as a +field name. For example, \fBset_field:00:11:22:33:44:55->eth_src\fR +sets the Ethernet source address to 00:11:22:33:44:55. With +\fBload\fR, \fIvalue\fR must be an integer value (in decimal or +prefixed by \fB0x\fR for hexadecimal) and \fIdst\fR is the NXM or OXM +name for the field. For example, +\fBload:0x001122334455->OXM_OF_ETH_DST[]\fR has the same effect as the +prior \fBset_field\fR example. +.IP +The two forms exist for historical reasons. Open vSwitch 1.1 +introduced \fBNXAST_REG_LOAD\fR as a Nicira extension to OpenFlow 1.0 +and used \fBload\fR to express it. Later, OpenFlow 1.2 introduced a +standard \fBOFPAT_SET_FIELD\fR action that was restricted to loading +entire fields, so Open vSwitch added the form \fBset_field\fR with +this restriction. OpenFlow 1.5 extended \fBOFPAT_SET_FIELD\fR to the +point that it became a superset of \fBNXAST_REG_LOAD\fR. Open vSwitch +translates either syntax as necessary for the OpenFlow version in use: +in OpenFlow 1.0 and 1.1, \fBNXAST_REG_LOAD\fR; in OpenFlow 1.2, 1.3, +and 1.4, \fBNXAST_REG_LOAD\fR for \fBload\fR or for loading a +subfield, \fBOFPAT_SET_FIELD\fR otherwise; and OpenFlow 1.5 and later, +\fBOFPAT_SET_FIELD\fR. . .IP "\fBpush:\fIsrc\fB[\fIstart\fB..\fIend\fB]" Pushes \fIstart\fR to \fIend\fR bits inclusive, in fields @@ -1413,14 +1544,6 @@ Set register 2 bits 0 through 5, inclusive, based on bits 0 through 5 from the value just popped. . -.IP "\fBset_field:\fIvalue\fB\->\fIdst" -Writes the literal \fIvalue\fR into the field \fIdst\fR, which should -be specified as a name used for matching. (This is similar to -\fBload\fR but more closely matches the set-field action defined in -OpenFlow 1.2 and above.) -. -.IP -Example: \fBset_field:00:11:22:33:44:55->eth_src\fR. . .IP "\fBmultipath(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIn_links\fB, \fIarg\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR" Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter, @@ -1476,8 +1599,10 @@ .IP \fBidle_timeout=\fIseconds\fR .IQ \fBhard_timeout=\fIseconds\fR .IQ \fBpriority=\fIvalue\fR -These key-value pairs have the same meaning as in the usual -\fBovs\-ofctl\fR flow syntax. +.IQ \fBcookie=\fIvalue\fR +.IQ \fBsend_flow_rem\fR +These arguments have the same meaning as in the usual \fBovs\-ofctl\fR +flow syntax. . .IP \fBfin_idle_timeout=\fIseconds\fR .IQ \fBfin_hard_timeout=\fIseconds\fR @@ -1489,6 +1614,16 @@ number between 0 and 254. The default, if \fBtable\fR is unspecified, is table 1. . +.IP \fBdelete_learned\fR +This flag enables deletion of the learned flows when the flow with the +\fBlearn\fR action is removed. Specifically, when the last +\fBlearn\fR action with this flag and particular \fBtable\fR and +\fBcookie\fR values is removed, the switch deletes all of the flows in +the specified table with the specified cookie. +. +.IP +This flag was added in Open vSwitch 2.4. +. .IP \fIfield\fB=\fIvalue\fR .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]=\fIsrc\fB[\fIstart\fB..\fIend\fB]\fR .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]\fR @@ -1535,9 +1670,6 @@ .RE . .RS -.IP \fBapply_actions(\fR[\fIaction\fR][\fB,\fIaction\fR...]\fB) -Applies the specific action(s) immediately. The syntax of actions are same -to \fBactions=\fR field. . .IP \fBclear_actions\fR Clears all the actions in the action set immediately. @@ -1576,6 +1708,8 @@ .IP 5. \fBload\fR .IQ +\fBmove\fR +.IQ \fBmod_dl_dst\fR .IQ \fBmod_dl_src\fR @@ -1605,9 +1739,10 @@ \fBset_tunnel64\fR .IQ The action set can contain any number of these actions, with -cumulative effect. That is, when multiple actions modify the same -part of a field, the later modification takes effect, and when they -modify different parts of a field (or different fields), then both +cumulative effect. They will be applied in the order as added. +That is, when multiple actions modify the same part of a field, +the later modification takes effect, and when they modify +different parts of a field (or different fields), then both modifications are applied. . .IP 6. @@ -1618,11 +1753,14 @@ .IQ \fBoutput\fR .IQ -If both actions are present, then \fBgroup\fR is executed and -\fBoutput\fR is ignored, regardless of the order in which they were -added to the action set. (If neither action is present, the action -set has no real effect, because the modified packet is not sent -anywhere and thus the modifications are not visible.) +\fBresubmit\fR +.IQ +If more than one of these actions is present, then the one listed +earliest above is executed and the others are ignored, regardless of +the order in which they were added to the action set. (If none of these +actions is present, the action set has no real effect, because the +modified packet is not sent anywhere and thus the modifications are +not visible.) .RE .IP Only the actions listed above may be written to the action set. @@ -1696,6 +1834,209 @@ other tables, or different levels of the \fBresubmit\fR call stack, are ignored. Actions in the action set is still executed (specify \fBclear_actions\fR before \fBexit\fR to discard them). +. +.IP "\fBconjunction(\fIid\fB, \fIk\fB/\fIn\fR\fB)\fR" +An individual OpenFlow flow can match only a single value for each +field. However, situations often arise where one wants to match one +of a set of values within a field or fields. For matching a single +field against a set, it is straightforward and efficient to add +multiple flows to the flow table, one for each value in the set. For +example, one might use the following flows to send packets with IP +source address \fIa\fR, \fIb\fR, \fIc\fR, or \fId\fR to the OpenFlow +controller: +.RS +1in +.br +\fBip,ip_src=\fIa\fB actions=controller\fR +.br +\fBip,ip_src=\fIb\fB actions=controller\fR +.br +\fBip,ip_src=\fIc\fB actions=controller\fR +.br +\fBip,ip_src=\fId\fB actions=controller\fR +.br +.RE +.IP +Similarly, these flows send packets with IP destination address +\fIe\fR, \fIf\fR, \fIg\fR, or \fIh\fR to the OpenFlow controller: +.RS +1in +.br +\fBip,ip_dst=\fIe\fB actions=controller\fR +.br +\fBip,ip_dst=\fIf\fB actions=controller\fR +.br +\fBip,ip_dst=\fIg\fB actions=controller\fR +.br +\fBip,ip_dst=\fIh\fB actions=controller\fR +.br +.RE +.IP +Installing all of the above flows in a single flow table yields a +disjunctive effect: a packet is sent to the controller if \fBip_src\fR +\[mo] {\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} or \fBip_dst\fR \[mo] +{\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR} (or both). (Pedantically, if both +of the above sets of flows are present in the flow table, they should +have different priorities, because OpenFlow says that the results are +undefined when two flows with same priority can both match a single +packet.) +.IP +Suppose, on the other hand, one wishes to match conjunctively, that +is, to send a packet to the controller only if both \fBip_src\fR \[mo] +{\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} and \fBip_dst\fR \[mo] +{\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR}. This requires 4 \[mu] 4 = 16 +flows, one for each possible pairing of \fBip_src\fR and \fBip_dst\fR. +That is acceptable for our small example, but it does not gracefully +extend to larger sets or greater numbers of dimensions. +.IP +The \fBconjunction\fR action is a solution for conjunctive matches +that is built into Open vSwitch. A \fBconjunction\fR action ties +groups of individual OpenFlow flows into higher-level ``conjunctive +flows''. Each group corresponds to one dimension, and each flow +within the group matches one possible value for the dimension. A +packet that matches one flow from each group matches the conjunctive +flow. +.IP +To implement a conjunctive flow with \fBconjunction\fR, assign the +conjunctive flow a 32-bit \fIid\fR, which must be unique within an +OpenFlow table. Assign each of the \fIn\fR \[>=] 2 dimensions a +unique number from 1 to \fIn\fR; the ordering is unimportant. Add one +flow to the OpenFlow flow table for each possible value of each +dimension with \fBconjunction(\fIid, \fIk\fB/\fIn\fB)\fR as the flow's +actions, where \fIk\fR is the number assigned to the flow's dimension. +Together, these flows specify the conjunctive flow's match condition. +When the conjunctive match condition is met, Open vSwitch looks up one +more flow that specifies the conjunctive flow's actions and receives +its statistics. This flow is found by setting \fBconj_id\fR to the +specified \fIid\fR and then again searching the flow table. +.IP +The following flows provide an example. Whenever the IP source is one +of the values in the flows that match on the IP source (dimension 1 of +2), \fIand\fR the IP destination is one of the values in the flows +that match on IP destination (dimension 2 of 2), Open vSwitch searches +for a flow that matches \fBconj_id\fR against the conjunction ID +(1234), finding the first flow listed below. +.RS +1in +.br +.B "conj_id=1234 actions=controller" +.br +.B "ip,ip_src=10.0.0.1 actions=conjunction(1234, 1/2)" +.br +.B "ip,ip_src=10.0.0.4 actions=conjunction(1234, 1/2)" +.br +.B "ip,ip_src=10.0.0.6 actions=conjunction(1234, 1/2)" +.br +.B "ip,ip_src=10.0.0.7 actions=conjunction(1234, 1/2)" +.br +.B "ip,ip_dst=10.0.0.2 actions=conjunction(1234, 2/2)" +.br +.B "ip,ip_dst=10.0.0.5 actions=conjunction(1234, 2/2)" +.br +.B "ip,ip_dst=10.0.0.7 actions=conjunction(1234, 2/2)" +.br +.B "ip,ip_dst=10.0.0.8 actions=conjunction(1234, 2/2)" +.RE +.IP +Many subtleties exist: +.RS +.IP \(bu +In the example above, every flow in a single dimension has the same +form, that is, dimension 1 matches on \fBip_src\fR, dimension 2 on +\fBip_dst\fR, but this is not a requirement. Different flows within a +dimension may match on different bits within a field (e.g. IP network +prefixes of different lengths, or TCP/UDP port ranges as bitwise +matches), or even on entirely different fields (e.g. to match packets +for TCP source port 80 or TCP destination port 80). +.IP \(bu +The flows within a dimension can vary their matches across more than +one field, e.g. to match only specific pairs of IP source and +destination addresses or L4 port numbers. +.IP \(bu +A flow may have multiple \fBconjunction\fR actions, with different +\fIid\fR values. This is useful for multiple conjunctive flows with +overlapping sets. If one conjunctive flow matches packets with both +\fBip_src\fR \[mo] {\fIa\fR,\fIb\fR} and \fBip_dst\fR \[mo] +{\fId\fR,\fIe\fR} and a second conjunctive flow matches \fBip_src\fR +\[mo] {\fIb\fR,\fIc\fR} and \fBip_dst\fR \[mo] {\fIf\fR,\fIg\fR}, for +example, then the flow that matches \fBip_src=\fIb\fR would have two +\fBconjunction\fR actions, one for each conjunctive flow. The order +of \fBconjunction\fR actions within a list of actions is not +significant. +.IP \(bu +A flow with \fBconjunction\fR actions may not have any other actions. +(It would not be useful.) +.IP \(bu +All of the flows that constitute a conjunctive flow with a given +\fIid\fR must have the same priority. (Flows with the same \fIid\fR +but different priorities are currently treated as different +conjunctive flows, that is, currently \fIid\fR values need only be +unique within an OpenFlow table at a given priority. This behavior +isn't guaranteed to stay the same in later releases, so please use +\fIid\fR values unique within an OpenFlow table.) +.IP \(bu +Conjunctive flows must not overlap with each other, at a given +priority, that is, any given packet must be able to match at most one +conjunctive flow at a given priority. Overlapping conjunctive flows +yield unpredictable results. +.IP \(bu +Following a conjunctive flow match, the search for the flow with +\fBconj_id=\fIid\fR is done in the same general-purpose way as other flow +table searches, so one can use flows with \fBconj_id=\fIid\fR to act +differently depending on circumstances. (One exception is that the +search for the \fBconj_id=\fIid\fR flow itself ignores conjunctive flows, +to avoid recursion.) If the search with \fBconj_id=\fIid\fR fails, Open +vSwitch acts as if the conjunctive flow had not matched at all, and +continues searching the flow table for other matching flows. +.IP \(bu +OpenFlow prerequisite checking occurs for the flow with +\fBconj_id=\fIid\fR in the same way as any other flow, e.g. in an +OpenFlow 1.1+ context, putting a \fBmod_nw_src\fR action into the +example above would require adding an \fBip\fR match, like this: +.RS +1in +.br +.B "conj_id=1234,ip actions=mod_nw_src:1.2.3.4,controller" +.br +.RE +.IP \(bu +OpenFlow prerequisite checking also occurs for the individual flows +that comprise a conjunctive match in the same way as any other flow. +.IP \(bu +The flows that constitute a conjunctive flow do not have useful +statistics. They are never updated with byte or packet counts, and so +on. (For such a flow, therefore, the idle and hard timeouts work much +the same way.) +.IP \(bu +Conjunctive flows can be a useful building block for negation, that +is, inequality matches like \fBtcp_src\fR \[!=] 80. To implement an +inequality match, convert it to a pair of range matches, e.g. 0 \[<=] +\fBtcp_src\ < 80 and 80 < \fBtcp_src\fR \[<=] 65535, then convert each +of the range matches into a collection of bitwise matches as explained +above in the description of \fBtcp_src\fR. +.IP \(bu +Sometimes there is a choice of which flows include a particular match. +For example, suppose that we added an extra constraint to our example, +to match on \fBip_src\fR \[mo] {\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} and +\fBip_dst\fR \[mo] {\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR} and \fBtcp_dst\fR += \fIi\fR. One way to implement this is to add the new constraint to +the \fBconj_id\fR flow, like this: +.RS +1in +.br +\fBconj_id=1234,tcp,tcp_dst=\fIi\fB actions=mod_nw_src:1.2.3.4,controller\fR +.br +.RE +.IP +\fIbut this is not recommended\fR because of the cost of the extra +flow table lookup. Instead, add the constraint to the individual +flows, either in one of the dimensions or (slightly better) all of +them. +.IP \(bu +A conjunctive match must have \fIn\fR \[>=] 2 dimensions (otherwise a +conjunctive match is not necessary). Open vSwitch enforces this. +.IP \(bu +Each dimension within a conjunctive match should ordinarily have more +than one flow. Open vSwitch does not enforce this. +.RE +.IP +The \fBconjunction\fR action and \fBconj_id\fR field were introduced +in Open vSwitch 2.4. .RE . .PP @@ -1776,6 +2117,14 @@ regardless of activity. A value of 0 (the default) gives the flow no hard expiration deadline. . +.IP "\fBimportance=\fIvalue\fR" +Sets the importance of a flow. The flow entry eviction mechanism can +use importance as a factor in deciding which flow to evict. A value +of 0 (the default) makes the flow non-evictable on the basis of +importance. Specify a value between 0 and 65535. +.IP +Only OpenFlow 1.4 and later support \fBimportance\fR. +. .IP "\fBsend_flow_rem\fR" Marks the flow with a flag that causes the switch to generate a ``flow removed'' message and send it to interested controllers when the flow @@ -1851,9 +2200,9 @@ .IP \fBtype=\fItype\fR -The type of the group. This \fBadd-group\fR, \fBadd-groups\fR and -\fBdel-groups\fR command require this field. The following keywords -designated the allowed types: +The type of the group. The \fBadd-group\fR, \fBadd-groups\fR and +\fBmod-groups\fR commands require this field. It is prohibited for +other commands. The following keywords designated the allowed types: .RS .IP \fBall\fR Execute all buckets in the group. @@ -1870,6 +2219,79 @@ a live port or group. .RE +.IP \fBcommand_bucket_id=\fIid\fR +The bucket to operate on. The \fBinsert-buckets\fR and \fBremove-buckets\fR +commands require this field. It is prohibited for other commands. +\fIid\fR may be an integer or one of the following keywords: +.RS +.IP \fBall\fR +Operate on all buckets in the group. +Only valid when used with the \fBremove-buckets\fR command in which +case the effect is to remove all buckets from the group. +.IP \fBfirst\fR +Operate on the first bucket present in the group. +In the case of the \fBinsert-buckets\fR command the effect is to +insert new bucets just before the first bucket already present in the group; +or to replace the buckets of the group if there are no buckets already present +in the group. +In the case of the \fBremove-buckets\fR command the effect is to +remove the first bucket of the group; or do nothing if there are no +buckets present in the group. +.IP \fBlast\fR +Operate on the last bucket present in the group. +In the case of the \fBinsert-buckets\fR command the effect is to +insert new bucets just after the last bucket already present in the group; +or to replace the buckets of the group if there are no buckets already present +in the group. +In the case of the \fBremove-buckets\fR command the effect is to +remove the last bucket of the group; or do nothing if there are no +buckets present in the group. +.RE +.IP +If \fIid\fR is an integer then it should correspond to the \fBbucket_id\fR +of a bucket present in the group. +In case of the \fBinsert-buckets\fR command the effect is to +insert buckets just before the bucket in the group whose \fBbucket_id\fR is +\fIid\fR. +In case of the \fBiremove-buckets\fR command the effect is to +remove the in the group whose \fBbucket_id\fR is \fIid\fR. +It is an error if there is no bucket persent group in whose \fBbucket_id\fR is +\fIid\fR. + +.IP \fBselection_method\fR=\fImethod\fR +The selection method used to select a bucket for a select group. +This is a string of 1 to 15 bytes in length known to lower layers. +This field is optional for \fBadd\-group\fR, \fBadd\-groups\fR and +\fBmod\-group\fR commands on groups of type \fBselect\fR. Prohibited +otherwise. The default value is the empty string. +.IP +This option will use a Netronome OpenFlow extension which is only supported +when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later. + +.IP \fBselection_method_param\fR=\fIparam\fR +64-bit integer parameter to the selection method selected by the +\fBselection_method\fR field. The parameter's use is defined by the +lower-layer that implements the \fBselection_method\fR. It is optional if +the \fBselection_method\fR field is specified as a non-empty string. +Prohibited otherwise. The default value is zero. +.IP +This option will use a Netronome OpenFlow extension which is only supported +when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later. + +.IP \fBfields\fR=\fIparam\fR +The field parameters to selection method selected by the +\fBselection_method\fR field. The syntax is described in \fBFlow Syntax\fR +with the additional restrictions that if a value is provided it is +treated as a wildcard mask and wildcard masks following a slash are +prohibited. The pre-requisites of fields must be provided by any flows that +output to the group. The use of the fields is defined by the lower-layer +that implements the \fBselection_method\fR. They are optional if the +\fBselection_method\fR field is specified as a non-empty string. +Prohibited otherwise. The default is no fields. +.IP +This option will use a Netronome OpenFlow extension which is only supported +when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later. + .IP \fBbucket\fR=\fIbucket_parameters\fR The \fBadd-group\fR, \fBadd-groups\fR and \fBmod-group\fR commands require at least one bucket field. Bucket fields must appear after @@ -1883,11 +2305,21 @@ \fIbucket_parameters\fR consists of a list of \fIfield\fB=\fIvalue\fR assignments, separated by commas or white space followed by a comma-separated list of actions. -The syntax of actions are same -to \fBactions=\fR field described in \fBFlow Syntax\fR above. The fields for \fIbucket_parameters\fR are: . .RS +.IP \fBbucket_id=\fIid\fR +The 32-bit integer group id of the bucket. Values greater than +0xffffff00 are reserved. +. +This field was added in Open vSwitch 2.4 to conform with the OpenFlow +1.5 specification. It is not supported when earlier versions +of OpenFlow are used. Open vSwitch will automatically allocate bucket +ids when they are not specified. +.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR +The syntax of actions are identical to the \fBactions=\fR field described in +\fBFlow Syntax\fR above. Specyfing \fBactions=\fR is optional, any unknown +bucket parameter will be interpreted as an action. .IP \fBweight=\fIvalue\fR The relative weight of the bucket as an integer. This may be used by the switch during bucket select for groups whose \fBtype\fR is \fBselect\fR. @@ -1952,9 +2384,11 @@ .IP \fBrate=\fIvalue\fR The relative rate limit for this band, in kilobits per second or packets per second, depending on the meter flags defined above. -.IP \fBburst_size=\fIport\fR -The maximum burst allowed for the band. If unspecified, the switch is free to -select some reasonable value depending on it's configuration. +.IP \fBburst_size=\fIsize\fR +The maximum burst allowed for the band. If \fBpktps\fR is specified, +then \fIsize\fR is a packet count, otherwise it is in kilobits. If +unspecified, the switch is free to select some reasonable value +depending on its configuration. .RE . .SH OPTIONS @@ -1962,6 +2396,31 @@ \fB\-\-strict\fR Uses strict matching when running flow modification commands. . +.IP "\fB\-\-bundle\fR" +Execute flow mods as an OpenFlow 1.4 atomic bundle transaction. +.RS +.IP \(bu +Within a bundle, all flow mods are processed in the order they appear +and as a single atomic transaction, meaning that if one of them fails, +the whole transaction fails and none of the changes are made to the +\fIswitch\fR's flow table, and that each given datapath packet +traversing the OpenFlow tables sees the flow tables either as before +the transaction, or after all the flow mods in the bundle have been +successfully applied. +.IP \(bu +The beginning and the end of the flow table modification commands in a +bundle are delimited with OpenFlow 1.4 bundle control messages, which +makes it possible to stream the included commands without explicit +OpenFlow barriers, which are otherwise used after each flow table +modification command. This may make large modifications execute +faster as a bundle. +.IP \(bu +Bundles require OpenFlow 1.4 or higher. An explicit \fB-O +OpenFlow14\fR option is not needed, but you may need to enable +OpenFlow 1.4 support for OVS by setting the OVSDB \fIprotocols\fR +column in the \fIbridge\fR table. +.RE +. .so lib/ofp-version.man . .IP "\fB\-F \fIformat\fR[\fB,\fIformat\fR...]" diff -Nru openvswitch-2.3.1/utilities/ovs-ofctl.c openvswitch-2.4.0~git20150623/utilities/ovs-ofctl.c --- openvswitch-2.3.1/utilities/ovs-ofctl.c 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-ofctl.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ #include "ofproto/ofproto.h" #include "openflow/nicira-ext.h" #include "openflow/openflow.h" +#include "dp-packet.h" #include "packets.h" #include "pcap-file.h" #include "poll-loop.h" @@ -59,13 +60,19 @@ #include "timeval.h" #include "unixctl.h" #include "util.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" #include "meta-flow.h" #include "sort.h" VLOG_DEFINE_THIS_MODULE(ofctl); +/* --bundle: Use OpenFlow 1.4 bundle for making the flow table change atomic. + * NOTE: Also the flow mod will use OpenFlow 1.4, so the semantics may be + * different (see the comment in parse_options() for details). + */ +static bool bundle = false; + /* --strict: Use strict matching for flow mod commands? Additionally governs * use of nx_pull_match() instead of nx_pull_match_loose() in parse-nx-match. */ @@ -104,9 +111,9 @@ static struct sort_criterion *criteria; static size_t n_criteria, allocated_criteria; -static const struct command *get_all_commands(void); +static const struct ovs_cmdl_command *get_all_commands(void); -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[]); static bool recv_flow_stats_reply(struct vconn *, ovs_be32 send_xid, @@ -116,10 +123,14 @@ int main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { .argc = 0, }; set_program_name(argv[0]); + service_start(&argc, &argv); parse_options(argc, argv); fatal_ignore_sigpipe(); - run_command(argc - optind, argv + optind, get_all_commands()); + ctx.argc = argc - optind; + ctx.argv = argv + optind; + ovs_cmdl_run_command(&ctx, get_all_commands()); return 0; } @@ -154,6 +165,7 @@ OPT_SORT, OPT_RSORT, OPT_UNIXCTL, + OPT_BUNDLE, DAEMON_OPTION_ENUMS, OFP_VERSION_OPTION_ENUMS, VLOG_OPTION_ENUMS @@ -170,13 +182,15 @@ {"rsort", optional_argument, NULL, OPT_RSORT}, {"unixctl", required_argument, NULL, OPT_UNIXCTL}, {"help", no_argument, NULL, 'h'}, + {"option", no_argument, NULL, 'o'}, + {"bundle", no_argument, NULL, OPT_BUNDLE}, DAEMON_LONG_OPTIONS, OFP_VERSION_LONG_OPTIONS, VLOG_LONG_OPTIONS, STREAM_SSL_LONG_OPTIONS, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); uint32_t versions; enum ofputil_protocol version_protocols; @@ -239,6 +253,14 @@ case 'h': usage(); + case 'o': + ovs_cmdl_print_options(long_options); + exit(EXIT_SUCCESS); + + case OPT_BUNDLE: + bundle = true; + break; + case OPT_STRICT: strict = true; break; @@ -283,6 +305,12 @@ free(short_options); + /* Implicit OpenFlow 1.4 with the '--bundle' option. */ + if (bundle) { + /* Add implicit allowance for OpenFlow 1.4. */ + add_allowed_ofp_versions(ofputil_protocols_to_version_bitmap( + OFPUTIL_P_OF14_OXM)); + } versions = get_allowed_ofp_versions(); version_protocols = ofputil_protocols_from_version_bitmap(versions); if (!(allowed_protocols & version_protocols)) { @@ -333,9 +361,11 @@ " print packets received from SWITCH\n" " snoop SWITCH snoop on SWITCH and its controller\n" " add-group SWITCH GROUP add group described by GROUP\n" - " add-group SWITCH FILE add group from FILE\n" + " add-groups SWITCH FILE add group from FILE\n" " mod-group SWITCH GROUP modify specific group\n" " del-groups SWITCH [GROUP] delete matching GROUPs\n" + " insert-buckets SWITCH [GROUP] add buckets to GROUP\n" + " remove-buckets SWITCH [GROUP] remove buckets from GROUP\n" " dump-group-features SWITCH print group features\n" " dump-groups SWITCH [GROUP] print group description\n" " dump-group-stats SWITCH [GROUP] print group statistics\n" @@ -387,7 +417,7 @@ } static void run(int retval, const char *message, ...) - PRINTF_FORMAT(2, 3); + OVS_PRINTF_FORMAT(2, 3); static void run(int retval, const char *message, ...) @@ -484,7 +514,6 @@ static void send_openflow_buffer(struct vconn *vconn, struct ofpbuf *buffer) { - ofpmsg_update_length(buffer); run(vconn_send_block(vconn, buffer), "failed to send packet to switch"); } @@ -493,10 +522,9 @@ { struct ofpbuf *reply; - ofpmsg_update_length(request); run(vconn_transact(vconn, request, &reply), "talking to %s", vconn_get_name(vconn)); - ofp_print(stdout, ofpbuf_data(reply), ofpbuf_size(reply), verbosity + 1); + ofp_print(stdout, reply->data, reply->size, verbosity + 1); ofpbuf_delete(reply); } @@ -515,13 +543,13 @@ static void dump_stats_transaction(struct vconn *vconn, struct ofpbuf *request) { - const struct ofp_header *request_oh = ofpbuf_data(request); + const struct ofp_header *request_oh = request->data; ovs_be32 send_xid = request_oh->xid; enum ofpraw request_raw; enum ofpraw reply_raw; bool done = false; - ofpraw_decode_partial(&request_raw, ofpbuf_data(request), ofpbuf_size(request)); + ofpraw_decode_partial(&request_raw, request->data, request->size); reply_raw = ofpraw_stats_request_to_reply(request_raw, request_oh->version); @@ -531,20 +559,20 @@ struct ofpbuf *reply; run(vconn_recv_block(vconn, &reply), "OpenFlow packet receive failed"); - recv_xid = ((struct ofp_header *) ofpbuf_data(reply))->xid; + recv_xid = ((struct ofp_header *) reply->data)->xid; if (send_xid == recv_xid) { enum ofpraw raw; - ofp_print(stdout, ofpbuf_data(reply), ofpbuf_size(reply), verbosity + 1); + ofp_print(stdout, reply->data, reply->size, verbosity + 1); - ofpraw_decode(&raw, ofpbuf_data(reply)); + ofpraw_decode(&raw, reply->data); if (ofptype_from_ofpraw(raw) == OFPTYPE_ERROR) { done = true; } else if (raw == reply_raw) { - done = !ofpmp_more(ofpbuf_data(reply)); + done = !ofpmp_more(reply->data); } else { ovs_fatal(0, "received bad reply: %s", - ofp_to_string(ofpbuf_data(reply), ofpbuf_size(reply), + ofp_to_string(reply->data, reply->size, verbosity + 1)); } } else { @@ -573,23 +601,33 @@ * * Destroys all of the 'requests'. */ static void -transact_multiple_noreply(struct vconn *vconn, struct list *requests) +transact_multiple_noreply(struct vconn *vconn, struct ovs_list *requests) { - struct ofpbuf *request, *reply; - - LIST_FOR_EACH (request, list_node, requests) { - ofpmsg_update_length(request); - } + struct ofpbuf *reply; run(vconn_transact_multiple_noreply(vconn, requests, &reply), "talking to %s", vconn_get_name(vconn)); if (reply) { - ofp_print(stderr, ofpbuf_data(reply), ofpbuf_size(reply), verbosity + 2); + ofp_print(stderr, reply->data, reply->size, verbosity + 2); exit(1); } ofpbuf_delete(reply); } +static void +bundle_error_reporter(const struct ofp_header *oh) +{ + ofp_print(stderr, oh, ntohs(oh->length), verbosity + 1); + fflush(stderr); +} + +static void +bundle_transact(struct vconn *vconn, struct ovs_list *requests, uint16_t flags) +{ + run(vconn_bundle_transact(vconn, requests, flags, bundle_error_reporter), + "talking to %s", vconn_get_name(vconn)); +} + /* Sends 'request', which should be a request that only has a reply if an error * occurs, and waits for it to succeed or fail. If an error does occur, prints * it and exits with an error. @@ -598,7 +636,7 @@ static void transact_noreply(struct vconn *vconn, struct ofpbuf *request) { - struct list requests; + struct ovs_list requests; list_init(&requests); list_push_back(&requests, &request->list_node); @@ -640,9 +678,9 @@ } static void -ofctl_show(int argc OVS_UNUSED, char *argv[]) +ofctl_show(struct ovs_cmdl_context *ctx) { - const char *vconn_name = argv[1]; + const char *vconn_name = ctx->argv[1]; enum ofp_version version; struct vconn *vconn; struct ofpbuf *request; @@ -655,7 +693,7 @@ run(vconn_transact(vconn, request, &reply), "talking to %s", vconn_name); has_ports = ofputil_switch_features_has_ports(reply); - ofp_print(stdout, ofpbuf_data(reply), ofpbuf_size(reply), verbosity + 1); + ofp_print(stdout, reply->data, reply->size, verbosity + 1); ofpbuf_delete(reply); if (!has_ports) { @@ -667,24 +705,24 @@ } static void -ofctl_dump_desc(int argc OVS_UNUSED, char *argv[]) +ofctl_dump_desc(struct ovs_cmdl_context *ctx) { - dump_trivial_stats_transaction(argv[1], OFPRAW_OFPST_DESC_REQUEST); + dump_trivial_stats_transaction(ctx->argv[1], OFPRAW_OFPST_DESC_REQUEST); } static void -ofctl_dump_tables(int argc OVS_UNUSED, char *argv[]) +ofctl_dump_tables(struct ovs_cmdl_context *ctx) { - dump_trivial_stats_transaction(argv[1], OFPRAW_OFPST_TABLE_REQUEST); + dump_trivial_stats_transaction(ctx->argv[1], OFPRAW_OFPST_TABLE_REQUEST); } static void -ofctl_dump_table_features(int argc OVS_UNUSED, char *argv[]) +ofctl_dump_table_features(struct ovs_cmdl_context *ctx) { struct ofpbuf *request; struct vconn *vconn; - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); request = ofputil_encode_table_features_request(vconn_get_version(vconn)); if (request) { dump_stats_transaction(vconn, request); @@ -722,8 +760,8 @@ run(vconn_transact(vconn, request, &reply), "talking to %s", vconn_get_name(vconn)); - oh = ofpbuf_data(reply); - if (ofptype_decode(&type, ofpbuf_data(reply)) + oh = reply->data; + if (ofptype_decode(&type, reply->data) || type != OFPTYPE_FEATURES_REPLY) { ovs_fatal(0, "%s: received bad features reply", vconn_get_name(vconn)); } @@ -774,7 +812,7 @@ request = ofputil_encode_port_desc_stats_request(vconn_get_version(vconn), port_no); - send_xid = ((struct ofp_header *) ofpbuf_data(request))->xid; + send_xid = ((struct ofp_header *) request->data)->xid; send_openflow_buffer(vconn, request); while (!done) { @@ -782,9 +820,9 @@ struct ofpbuf *reply; run(vconn_recv_block(vconn, &reply), "OpenFlow packet receive failed"); - recv_xid = ((struct ofp_header *) ofpbuf_data(reply))->xid; + recv_xid = ((struct ofp_header *) reply->data)->xid; if (send_xid == recv_xid) { - struct ofp_header *oh = ofpbuf_data(reply); + struct ofp_header *oh = reply->data; enum ofptype type; struct ofpbuf b; uint16_t flags; @@ -793,7 +831,7 @@ if (ofptype_pull(&type, &b) || type != OFPTYPE_PORT_DESC_STATS_REPLY) { ovs_fatal(0, "received bad reply: %s", - ofp_to_string(ofpbuf_data(reply), ofpbuf_size(reply), + ofp_to_string(reply->data, reply->size, verbosity + 1)); } @@ -897,7 +935,7 @@ run(vconn_transact_noreply(vconn, request, &reply), "talking to %s", vconn_get_name(vconn)); if (reply) { - char *s = ofp_to_string(ofpbuf_data(reply), ofpbuf_size(reply), 2); + char *s = ofp_to_string(reply->data, reply->size, 2); VLOG_DBG("%s: failed to set protocol, switch replied: %s", vconn_get_name(vconn), s); free(s); @@ -983,8 +1021,8 @@ int ret; if (!f) { - unsigned int a_pri = afs->priority; - unsigned int b_pri = bfs->priority; + int a_pri = afs->priority; + int b_pri = bfs->priority; ret = a_pri < b_pri ? -1 : a_pri > b_pri; } else { bool ina, inb; @@ -1014,10 +1052,11 @@ } static void -ofctl_dump_flows(int argc, char *argv[]) +ofctl_dump_flows(struct ovs_cmdl_context *ctx) { if (!n_criteria) { - return ofctl_dump_flows__(argc, argv, false); + ofctl_dump_flows__(ctx->argc, ctx->argv, false); + return; } else { struct ofputil_flow_stats *fses; size_t n_fses, allocated_fses; @@ -1029,8 +1068,8 @@ struct ds s; size_t i; - vconn = prepare_dump_flows(argc, argv, false, &request); - send_xid = ((struct ofp_header *) ofpbuf_data(request))->xid; + vconn = prepare_dump_flows(ctx->argc, ctx->argv, false, &request); + send_xid = ((struct ofp_header *) request->data)->xid; send_openflow_buffer(vconn, request); fses = NULL; @@ -1074,27 +1113,27 @@ } static void -ofctl_dump_aggregate(int argc, char *argv[]) +ofctl_dump_aggregate(struct ovs_cmdl_context *ctx) { - return ofctl_dump_flows__(argc, argv, true); + ofctl_dump_flows__(ctx->argc, ctx->argv, true); } static void -ofctl_queue_stats(int argc, char *argv[]) +ofctl_queue_stats(struct ovs_cmdl_context *ctx) { struct ofpbuf *request; struct vconn *vconn; struct ofputil_queue_stats_request oqs; - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); - if (argc > 2 && argv[2][0] && strcasecmp(argv[2], "all")) { - oqs.port_no = str_to_port_no(argv[1], argv[2]); + if (ctx->argc > 2 && ctx->argv[2][0] && strcasecmp(ctx->argv[2], "all")) { + oqs.port_no = str_to_port_no(ctx->argv[1], ctx->argv[2]); } else { oqs.port_no = OFPP_ANY; } - if (argc > 3 && argv[3][0] && strcasecmp(argv[3], "all")) { - oqs.queue_id = atoi(argv[3]); + if (ctx->argc > 3 && ctx->argv[3][0] && strcasecmp(ctx->argv[3], "all")) { + oqs.queue_id = atoi(ctx->argv[3]); } else { oqs.queue_id = OFPQ_ALL; } @@ -1105,10 +1144,10 @@ } static void -ofctl_queue_get_config(int argc OVS_UNUSED, char *argv[]) +ofctl_queue_get_config(struct ovs_cmdl_context *ctx) { - const char *vconn_name = argv[1]; - const char *port_name = argv[2]; + const char *vconn_name = ctx->argv[1]; + const char *port_name = ctx->argv[2]; enum ofputil_protocol protocol; enum ofp_version version; struct ofpbuf *request; @@ -1162,6 +1201,33 @@ } static void +bundle_flow_mod__(const char *remote, struct ofputil_flow_mod *fms, + size_t n_fms, enum ofputil_protocol usable_protocols) +{ + enum ofputil_protocol protocol; + struct vconn *vconn; + struct ovs_list requests; + size_t i; + + list_init(&requests); + + /* Bundles need OpenFlow 1.4+. */ + usable_protocols &= OFPUTIL_P_OF14_UP; + protocol = open_vconn_for_flow_mod(remote, &vconn, usable_protocols); + + for (i = 0; i < n_fms; i++) { + struct ofputil_flow_mod *fm = &fms[i]; + struct ofpbuf *request = ofputil_encode_flow_mod(fm, protocol); + + list_push_back(&requests, &request->list_node); + free(CONST_CAST(struct ofpact *, fm->ofpacts)); + } + + bundle_transact(vconn, &requests, OFPBF_ORDERED | OFPBF_ATOMIC); + vconn_close(vconn); +} + +static void ofctl_flow_mod__(const char *remote, struct ofputil_flow_mod *fms, size_t n_fms, enum ofputil_protocol usable_protocols) { @@ -1169,6 +1235,11 @@ struct vconn *vconn; size_t i; + if (bundle) { + bundle_flow_mod__(remote, fms, n_fms, usable_protocols); + return; + } + protocol = open_vconn_for_flow_mod(remote, &vconn, usable_protocols); for (i = 0; i < n_fms; i++) { @@ -1181,13 +1252,19 @@ } static void -ofctl_flow_mod_file(int argc OVS_UNUSED, char *argv[], uint16_t command) +ofctl_flow_mod_file(int argc OVS_UNUSED, char *argv[], int command) { enum ofputil_protocol usable_protocols; struct ofputil_flow_mod *fms = NULL; size_t n_fms = 0; char *error; + if (command == OFPFC_ADD) { + /* Allow the file to specify a mix of commands. If none specified at + * the beginning of any given line, then the default is OFPFC_ADD, so + * this is backwards compatible. */ + command = -2; + } error = parse_ofp_flow_mod_file(argv[2], command, &fms, &n_fms, &usable_protocols); if (error) { @@ -1217,27 +1294,27 @@ } static void -ofctl_add_flow(int argc, char *argv[]) +ofctl_add_flow(struct ovs_cmdl_context *ctx) { - ofctl_flow_mod(argc, argv, OFPFC_ADD); + ofctl_flow_mod(ctx->argc, ctx->argv, OFPFC_ADD); } static void -ofctl_add_flows(int argc, char *argv[]) +ofctl_add_flows(struct ovs_cmdl_context *ctx) { - ofctl_flow_mod_file(argc, argv, OFPFC_ADD); + ofctl_flow_mod_file(ctx->argc, ctx->argv, OFPFC_ADD); } static void -ofctl_mod_flows(int argc, char *argv[]) +ofctl_mod_flows(struct ovs_cmdl_context *ctx) { - ofctl_flow_mod(argc, argv, strict ? OFPFC_MODIFY_STRICT : OFPFC_MODIFY); + ofctl_flow_mod(ctx->argc, ctx->argv, strict ? OFPFC_MODIFY_STRICT : OFPFC_MODIFY); } static void -ofctl_del_flows(int argc, char *argv[]) +ofctl_del_flows(struct ovs_cmdl_context *ctx) { - ofctl_flow_mod(argc, argv, strict ? OFPFC_DELETE_STRICT : OFPFC_DELETE); + ofctl_flow_mod(ctx->argc, ctx->argv, strict ? OFPFC_DELETE_STRICT : OFPFC_DELETE); } static void @@ -1300,13 +1377,13 @@ return "Trailing garbage in hex data"; } - if (ofpbuf_size(msg) < sizeof(struct ofp_header)) { + if (msg->size < sizeof(struct ofp_header)) { ofpbuf_delete(msg); return "Message too short for OpenFlow"; } - oh = ofpbuf_data(msg); - if (ofpbuf_size(msg) != ntohs(oh->length)) { + oh = msg->data; + if (msg->size != ntohs(oh->length)) { ofpbuf_delete(msg); return "Message size does not match length in OpenFlow header"; } @@ -1339,7 +1416,7 @@ } fprintf(stderr, "send: "); - ofp_print(stderr, ofpbuf_data(msg), ofpbuf_size(msg), verbosity); + ofp_print(stderr, msg->data, msg->size, verbosity); error = vconn_send_block(vconn, msg); if (error) { @@ -1488,8 +1565,9 @@ free(s); } - ofptype_decode(&type, ofpbuf_data(b)); - ofp_print(stderr, ofpbuf_data(b), ofpbuf_size(b), verbosity + 2); + ofptype_decode(&type, b->data); + ofp_print(stderr, b->data, b->size, verbosity + 2); + fflush(stderr); switch ((int) type) { case OFPTYPE_BARRIER_REPLY: @@ -1503,7 +1581,7 @@ if (reply_to_echo_requests) { struct ofpbuf *reply; - reply = make_echo_reply(ofpbuf_data(b)); + reply = make_echo_reply(b->data); retval = vconn_send_block(vconn, reply); if (retval) { ovs_fatal(retval, "failed to send echo reply"); @@ -1531,15 +1609,15 @@ } static void -ofctl_monitor(int argc, char *argv[]) +ofctl_monitor(struct ovs_cmdl_context *ctx) { struct vconn *vconn; int i; enum ofputil_protocol usable_protocols; - open_vconn(argv[1], &vconn); - for (i = 2; i < argc; i++) { - const char *arg = argv[i]; + open_vconn(ctx->argv[1], &vconn); + for (i = 2; i < ctx->argc; i++) { + const char *arg = ctx->argv[i]; if (isdigit((unsigned char) *arg)) { struct ofp_switch_config config; @@ -1563,6 +1641,7 @@ msg = ofpbuf_new(0); ofputil_append_flow_monitor_request(&fmr, msg); dump_stats_transaction(vconn, msg); + fflush(stdout); } else { ovs_fatal(0, "%s: unsupported \"monitor\" argument", arg); } @@ -1582,7 +1661,7 @@ run(vconn_transact_noreply(vconn, spif, &reply), "talking to %s", vconn_get_name(vconn)); if (reply) { - char *s = ofp_to_string(ofpbuf_data(reply), ofpbuf_size(reply), 2); + char *s = ofp_to_string(reply->data, reply->size, 2); VLOG_DBG("%s: failed to set packet in format to nxm, controller" " replied: %s. Falling back to the switch default.", vconn_get_name(vconn), s); @@ -1606,37 +1685,37 @@ } static void -ofctl_snoop(int argc OVS_UNUSED, char *argv[]) +ofctl_snoop(struct ovs_cmdl_context *ctx) { struct vconn *vconn; - open_vconn__(argv[1], SNOOP, &vconn); + open_vconn__(ctx->argv[1], SNOOP, &vconn); monitor_vconn(vconn, false); } static void -ofctl_dump_ports(int argc, char *argv[]) +ofctl_dump_ports(struct ovs_cmdl_context *ctx) { struct ofpbuf *request; struct vconn *vconn; ofp_port_t port; - open_vconn(argv[1], &vconn); - port = argc > 2 ? str_to_port_no(argv[1], argv[2]) : OFPP_ANY; + open_vconn(ctx->argv[1], &vconn); + port = ctx->argc > 2 ? str_to_port_no(ctx->argv[1], ctx->argv[2]) : OFPP_ANY; request = ofputil_encode_dump_ports_request(vconn_get_version(vconn), port); dump_stats_transaction(vconn, request); vconn_close(vconn); } static void -ofctl_dump_ports_desc(int argc OVS_UNUSED, char *argv[]) +ofctl_dump_ports_desc(struct ovs_cmdl_context *ctx) { struct ofpbuf *request; struct vconn *vconn; ofp_port_t port; - open_vconn(argv[1], &vconn); - port = argc > 2 ? str_to_port_no(argv[1], argv[2]) : OFPP_ANY; + open_vconn(ctx->argv[1], &vconn); + port = ctx->argc > 2 ? str_to_port_no(ctx->argv[1], ctx->argv[2]) : OFPP_ANY; request = ofputil_encode_port_desc_stats_request(vconn_get_version(vconn), port); dump_stats_transaction(vconn, request); @@ -1644,16 +1723,16 @@ } static void -ofctl_probe(int argc OVS_UNUSED, char *argv[]) +ofctl_probe(struct ovs_cmdl_context *ctx) { struct ofpbuf *request; struct vconn *vconn; struct ofpbuf *reply; - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); request = make_echo_request(vconn_get_version(vconn)); - run(vconn_transact(vconn, request, &reply), "talking to %s", argv[1]); - if (ofpbuf_size(reply) != sizeof(struct ofp_header)) { + run(vconn_transact(vconn, request, &reply), "talking to %s", ctx->argv[1]); + if (reply->size != sizeof(struct ofp_header)) { ovs_fatal(0, "reply does not match request"); } ofpbuf_delete(reply); @@ -1661,7 +1740,7 @@ } static void -ofctl_packet_out(int argc, char *argv[]) +ofctl_packet_out(struct ovs_cmdl_context *ctx) { enum ofputil_protocol protocol; struct ofputil_packet_out po; @@ -1672,38 +1751,39 @@ enum ofputil_protocol usable_protocols; /* XXX: Use in proto selection */ ofpbuf_init(&ofpacts, 64); - error = parse_ofpacts(argv[3], &ofpacts, &usable_protocols); + error = ofpacts_parse_actions(ctx->argv[3], &ofpacts, &usable_protocols); if (error) { ovs_fatal(0, "%s", error); } po.buffer_id = UINT32_MAX; - po.in_port = str_to_port_no(argv[1], argv[2]); - po.ofpacts = ofpbuf_data(&ofpacts); - po.ofpacts_len = ofpbuf_size(&ofpacts); - - protocol = open_vconn(argv[1], &vconn); - for (i = 4; i < argc; i++) { - struct ofpbuf *packet, *opo; + po.in_port = str_to_port_no(ctx->argv[1], ctx->argv[2]); + po.ofpacts = ofpacts.data; + po.ofpacts_len = ofpacts.size; + + protocol = open_vconn(ctx->argv[1], &vconn); + for (i = 4; i < ctx->argc; i++) { + struct dp_packet *packet; + struct ofpbuf *opo; const char *error_msg; - error_msg = eth_from_hex(argv[i], &packet); + error_msg = eth_from_hex(ctx->argv[i], &packet); if (error_msg) { ovs_fatal(0, "%s", error_msg); } - po.packet = ofpbuf_data(packet); - po.packet_len = ofpbuf_size(packet); + po.packet = dp_packet_data(packet); + po.packet_len = dp_packet_size(packet); opo = ofputil_encode_packet_out(&po, protocol); transact_noreply(vconn, opo); - ofpbuf_delete(packet); + dp_packet_delete(packet); } vconn_close(vconn); ofpbuf_uninit(&ofpacts); } static void -ofctl_mod_port(int argc OVS_UNUSED, char *argv[]) +ofctl_mod_port(struct ovs_cmdl_context *ctx) { struct ofp_config_flag { const char *name; /* The flag's name. */ @@ -1729,7 +1809,7 @@ const char *command; bool not; - fetch_ofputil_phy_port(argv[1], argv[2], &pp); + fetch_ofputil_phy_port(ctx->argv[1], ctx->argv[2], &pp); pm.port_no = pp.port_no; memcpy(pm.hw_addr, pp.hw_addr, ETH_ADDR_LEN); @@ -1737,14 +1817,14 @@ pm.mask = 0; pm.advertise = 0; - if (!strncasecmp(argv[3], "no-", 3)) { - command = argv[3] + 3; + if (!strncasecmp(ctx->argv[3], "no-", 3)) { + command = ctx->argv[3] + 3; not = true; - } else if (!strncasecmp(argv[3], "no", 2)) { - command = argv[3] + 2; + } else if (!strncasecmp(ctx->argv[3], "no", 2)) { + command = ctx->argv[3] + 2; not = true; } else { - command = argv[3]; + command = ctx->argv[3]; not = false; } for (flag = flags; flag < &flags[ARRAY_SIZE(flags)]; flag++) { @@ -1754,16 +1834,16 @@ goto found; } } - ovs_fatal(0, "unknown mod-port command '%s'", argv[3]); + ovs_fatal(0, "unknown mod-port command '%s'", ctx->argv[3]); found: - protocol = open_vconn(argv[1], &vconn); + protocol = open_vconn(ctx->argv[1], &vconn); transact_noreply(vconn, ofputil_encode_port_mod(&pm, protocol)); vconn_close(vconn); } static void -ofctl_mod_table(int argc OVS_UNUSED, char *argv[]) +ofctl_mod_table(struct ovs_cmdl_context *ctx) { enum ofputil_protocol protocol, usable_protocols; struct ofputil_table_mod tm; @@ -1771,12 +1851,12 @@ char *error; int i; - error = parse_ofp_table_mod(&tm, argv[2], argv[3], &usable_protocols); + error = parse_ofp_table_mod(&tm, ctx->argv[2], ctx->argv[3], &usable_protocols); if (error) { ovs_fatal(0, "%s", error); } - protocol = open_vconn(argv[1], &vconn); + protocol = open_vconn(ctx->argv[1], &vconn); if (!(protocol & usable_protocols)) { for (i = 0; i < sizeof(enum ofputil_protocol) * CHAR_BIT; i++) { enum ofputil_protocol f = 1 << i; @@ -1799,30 +1879,30 @@ } static void -ofctl_get_frags(int argc OVS_UNUSED, char *argv[]) +ofctl_get_frags(struct ovs_cmdl_context *ctx) { struct ofp_switch_config config; struct vconn *vconn; - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); fetch_switch_config(vconn, &config); puts(ofputil_frag_handling_to_string(ntohs(config.flags))); vconn_close(vconn); } static void -ofctl_set_frags(int argc OVS_UNUSED, char *argv[]) +ofctl_set_frags(struct ovs_cmdl_context *ctx) { struct ofp_switch_config config; enum ofp_config_flags mode; struct vconn *vconn; ovs_be16 flags; - if (!ofputil_frag_handling_from_string(argv[2], &mode)) { - ovs_fatal(0, "%s: unknown fragment handling mode", argv[2]); + if (!ofputil_frag_handling_from_string(ctx->argv[2], &mode)) { + ovs_fatal(0, "%s: unknown fragment handling mode", ctx->argv[2]); } - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); fetch_switch_config(vconn, &config); flags = htons(mode) | (config.flags & htons(~OFPC_FRAG_MASK)); if (flags != config.flags) { @@ -1837,16 +1917,16 @@ if (flags != config.flags) { ovs_fatal(0, "%s: setting fragment handling mode failed (this " "switch probably doesn't support mode \"%s\")", - argv[1], ofputil_frag_handling_to_string(mode)); + ctx->argv[1], ofputil_frag_handling_to_string(mode)); } } vconn_close(vconn); } static void -ofctl_ofp_parse(int argc OVS_UNUSED, char *argv[]) +ofctl_ofp_parse(struct ovs_cmdl_context *ctx) { - const char *filename = argv[1]; + const char *filename = ctx->argv[1]; struct ofpbuf b; FILE *file; @@ -1884,7 +1964,7 @@ ovs_fatal(0, "%s: unexpected end of file mid-message", filename); } - ofp_print(stdout, ofpbuf_data(&b), ofpbuf_size(&b), verbosity + 2); + ofp_print(stdout, b.data, b.size, verbosity + 2); } ofpbuf_uninit(&b); @@ -1912,48 +1992,48 @@ } static void -ofctl_ofp_parse_pcap(int argc OVS_UNUSED, char *argv[]) +ofctl_ofp_parse_pcap(struct ovs_cmdl_context *ctx) { struct tcp_reader *reader; FILE *file; int error; bool first; - file = ovs_pcap_open(argv[1], "rb"); + file = ovs_pcap_open(ctx->argv[1], "rb"); if (!file) { - ovs_fatal(errno, "%s: open failed", argv[1]); + ovs_fatal(errno, "%s: open failed", ctx->argv[1]); } reader = tcp_reader_open(); first = true; for (;;) { - struct ofpbuf *packet; + struct dp_packet *packet; long long int when; struct flow flow; - const struct pkt_metadata md = PKT_METADATA_INITIALIZER(ODPP_NONE); error = ovs_pcap_read(file, &packet, &when); if (error) { break; } - flow_extract(packet, &md, &flow); + packet->md = PKT_METADATA_INITIALIZER(ODPP_NONE); + flow_extract(packet, &flow); if (flow.dl_type == htons(ETH_TYPE_IP) && flow.nw_proto == IPPROTO_TCP - && (is_openflow_port(flow.tp_src, argv + 2) || - is_openflow_port(flow.tp_dst, argv + 2))) { - struct ofpbuf *payload = tcp_reader_run(reader, &flow, packet); + && (is_openflow_port(flow.tp_src, ctx->argv + 2) || + is_openflow_port(flow.tp_dst, ctx->argv + 2))) { + struct dp_packet *payload = tcp_reader_run(reader, &flow, packet); if (payload) { - while (ofpbuf_size(payload) >= sizeof(struct ofp_header)) { + while (dp_packet_size(payload) >= sizeof(struct ofp_header)) { const struct ofp_header *oh; - void *data = ofpbuf_data(payload); + void *data = dp_packet_data(payload); int length; /* Align OpenFlow on 8-byte boundary for safe access. */ - ofpbuf_shift(payload, -((intptr_t) data & 7)); + dp_packet_shift(payload, -((intptr_t) data & 7)); - oh = ofpbuf_data(payload); + oh = dp_packet_data(payload); length = ntohs(oh->length); - if (ofpbuf_size(payload) < length) { + if (dp_packet_size(payload) < length) { break; } @@ -1971,30 +2051,30 @@ printf(IP_FMT".%"PRIu16" > "IP_FMT".%"PRIu16":\n", IP_ARGS(flow.nw_src), ntohs(flow.tp_src), IP_ARGS(flow.nw_dst), ntohs(flow.tp_dst)); - ofp_print(stdout, ofpbuf_data(payload), length, verbosity + 1); - ofpbuf_pull(payload, length); + ofp_print(stdout, dp_packet_data(payload), length, verbosity + 1); + dp_packet_pull(payload, length); } } } - ofpbuf_delete(packet); + dp_packet_delete(packet); } tcp_reader_close(reader); } static void -ofctl_ping(int argc, char *argv[]) +ofctl_ping(struct ovs_cmdl_context *ctx) { size_t max_payload = 65535 - sizeof(struct ofp_header); unsigned int payload; struct vconn *vconn; int i; - payload = argc > 2 ? atoi(argv[2]) : 64; + payload = ctx->argc > 2 ? atoi(ctx->argv[2]) : 64; if (payload > max_payload) { ovs_fatal(0, "payload must be between 0 and %"PRIuSIZE" bytes", max_payload); } - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); for (i = 0; i < 10; i++) { struct timeval start, end; struct ofpbuf *request, *reply; @@ -2009,18 +2089,18 @@ run(vconn_transact(vconn, ofpbuf_clone(request), &reply), "transact"); xgettimeofday(&end); - rpy_hdr = ofpbuf_data(reply); + rpy_hdr = reply->data; if (ofptype_pull(&type, reply) || type != OFPTYPE_ECHO_REPLY - || ofpbuf_size(reply) != payload - || memcmp(ofpbuf_l3(request), ofpbuf_l3(reply), payload)) { + || reply->size != payload + || memcmp(request->msg, reply->msg, payload)) { printf("Reply does not match request. Request:\n"); - ofp_print(stdout, request, ofpbuf_size(request), verbosity + 2); + ofp_print(stdout, request, request->size, verbosity + 2); printf("Reply:\n"); - ofp_print(stdout, reply, ofpbuf_size(reply), verbosity + 2); + ofp_print(stdout, reply, reply->size, verbosity + 2); } printf("%"PRIu32" bytes from %s: xid=%08"PRIx32" time=%.1f ms\n", - ofpbuf_size(reply), argv[1], ntohl(rpy_hdr->xid), + reply->size, ctx->argv[1], ntohl(rpy_hdr->xid), (1000*(double)(end.tv_sec - start.tv_sec)) + (.001*(end.tv_usec - start.tv_usec))); ofpbuf_delete(request); @@ -2030,7 +2110,7 @@ } static void -ofctl_benchmark(int argc OVS_UNUSED, char *argv[]) +ofctl_benchmark(struct ovs_cmdl_context *ctx) { size_t max_payload = 65535 - sizeof(struct ofp_header); struct timeval start, end; @@ -2040,18 +2120,18 @@ int count; int i; - payload_size = atoi(argv[2]); + payload_size = atoi(ctx->argv[2]); if (payload_size > max_payload) { ovs_fatal(0, "payload must be between 0 and %"PRIuSIZE" bytes", max_payload); } message_size = sizeof(struct ofp_header) + payload_size; - count = atoi(argv[3]); + count = atoi(ctx->argv[3]); printf("Sending %d packets * %u bytes (with header) = %u bytes total\n", count, message_size, count * message_size); - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); xgettimeofday(&start); for (i = 0; i < count; i++) { struct ofpbuf *request, *reply; @@ -2074,19 +2154,22 @@ static void ofctl_group_mod__(const char *remote, struct ofputil_group_mod *gms, - size_t n_gms) + size_t n_gms, enum ofputil_protocol usable_protocols) { + enum ofputil_protocol protocol; struct ofputil_group_mod *gm; + enum ofp_version version; struct ofpbuf *request; struct vconn *vconn; size_t i; - open_vconn(remote, &vconn); + protocol = open_vconn_for_flow_mod(remote, &vconn, usable_protocols); + version = ofputil_protocol_to_ofp_version(protocol); for (i = 0; i < n_gms; i++) { gm = &gms[i]; - request = ofputil_encode_group_mod(vconn_get_version(vconn), gm); + request = ofputil_encode_group_mod(version, gm); if (request) { transact_noreply(vconn, request); } @@ -2104,13 +2187,17 @@ enum ofputil_protocol usable_protocols; size_t n_gms = 0; char *error; + int i; error = parse_ofp_group_mod_file(argv[2], command, &gms, &n_gms, &usable_protocols); if (error) { ovs_fatal(0, "%s", error); } - ofctl_group_mod__(argv[1], gms, n_gms); + ofctl_group_mod__(argv[1], gms, n_gms, usable_protocols); + for (i = 0; i < n_gms; i++) { + ofputil_bucket_list_destroy(&gms[i].buckets); + } free(gms); } @@ -2129,36 +2216,49 @@ if (error) { ovs_fatal(0, "%s", error); } - ofctl_group_mod__(argv[1], &gm, 1); + ofctl_group_mod__(argv[1], &gm, 1, usable_protocols); + ofputil_bucket_list_destroy(&gm.buckets); } } static void -ofctl_add_group(int argc, char *argv[]) +ofctl_add_group(struct ovs_cmdl_context *ctx) +{ + ofctl_group_mod(ctx->argc, ctx->argv, OFPGC11_ADD); +} + +static void +ofctl_add_groups(struct ovs_cmdl_context *ctx) +{ + ofctl_group_mod_file(ctx->argc, ctx->argv, OFPGC11_ADD); +} + +static void +ofctl_mod_group(struct ovs_cmdl_context *ctx) { - ofctl_group_mod(argc, argv, OFPGC11_ADD); + ofctl_group_mod(ctx->argc, ctx->argv, OFPGC11_MODIFY); } static void -ofctl_add_groups(int argc, char *argv[]) +ofctl_del_groups(struct ovs_cmdl_context *ctx) { - ofctl_group_mod_file(argc, argv, OFPGC11_ADD); + ofctl_group_mod(ctx->argc, ctx->argv, OFPGC11_DELETE); } static void -ofctl_mod_group(int argc, char *argv[]) +ofctl_insert_bucket(struct ovs_cmdl_context *ctx) { - ofctl_group_mod(argc, argv, OFPGC11_MODIFY); + ofctl_group_mod(ctx->argc, ctx->argv, OFPGC15_INSERT_BUCKET); } static void -ofctl_del_groups(int argc, char *argv[]) +ofctl_remove_bucket(struct ovs_cmdl_context *ctx) { - ofctl_group_mod(argc, argv, OFPGC11_DELETE); + ofctl_group_mod(ctx->argc, ctx->argv, OFPGC15_REMOVE_BUCKET); } static void -ofctl_dump_group_stats(int argc, char *argv[]) +ofctl_dump_group_stats(struct ovs_cmdl_context *ctx) { enum ofputil_protocol usable_protocols; struct ofputil_group_mod gm; @@ -2170,7 +2270,7 @@ memset(&gm, 0, sizeof gm); error = parse_ofp_group_mod_str(&gm, OFPGC11_DELETE, - argc > 2 ? argv[2] : "", + ctx->argc > 2 ? ctx->argv[2] : "", &usable_protocols); if (error) { ovs_fatal(0, "%s", error); @@ -2178,7 +2278,7 @@ group_id = gm.group_id; - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); request = ofputil_encode_group_stats_request(vconn_get_version(vconn), group_id); if (request) { @@ -2189,15 +2289,15 @@ } static void -ofctl_dump_group_desc(int argc OVS_UNUSED, char *argv[]) +ofctl_dump_group_desc(struct ovs_cmdl_context *ctx) { struct ofpbuf *request; struct vconn *vconn; uint32_t group_id; - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); - if (argc < 3 || !ofputil_group_from_string(argv[2], &group_id)) { + if (ctx->argc < 3 || !ofputil_group_from_string(ctx->argv[2], &group_id)) { group_id = OFPG11_ALL; } @@ -2211,12 +2311,12 @@ } static void -ofctl_dump_group_features(int argc OVS_UNUSED, char *argv[]) +ofctl_dump_group_features(struct ovs_cmdl_context *ctx) { struct ofpbuf *request; struct vconn *vconn; - open_vconn(argv[1], &vconn); + open_vconn(ctx->argv[1], &vconn); request = ofputil_encode_group_features_request(vconn_get_version(vconn)); if (request) { dump_stats_transaction(vconn, request); @@ -2226,10 +2326,16 @@ } static void -ofctl_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +ofctl_help(struct ovs_cmdl_context *ctx OVS_UNUSED) { usage(); } + +static void +ofctl_list_commands(struct ovs_cmdl_context *ctx OVS_UNUSED) +{ + ovs_cmdl_print_commands(get_all_commands()); +} /* replace-flows and diff-flows commands. */ @@ -2244,6 +2350,7 @@ ovs_be64 cookie; uint16_t idle_timeout; uint16_t hard_timeout; + uint16_t importance; uint16_t flags; struct ofpact *ofpacts; size_t ofpacts_len; @@ -2269,6 +2376,7 @@ return (a->cookie == b->cookie && a->idle_timeout == b->idle_timeout && a->hard_timeout == b->hard_timeout + && a->importance == b->importance && ofpacts_equal(a->ofpacts, a->ofpacts_len, b->ofpacts, b->ofpacts_len)); } @@ -2295,6 +2403,9 @@ if (version->hard_timeout != OFP_FLOW_PERMANENT) { ds_put_format(s, " hard_timeout=%"PRIu16, version->hard_timeout); } + if (version->importance != 0) { + ds_put_format(s, " importance=%"PRIu16, version->importance); + } ds_put_cstr(s, " actions="); ofpacts_format(version->ofpacts, version->ofpacts_len, s); @@ -2324,16 +2435,13 @@ static void fte_free_all(struct classifier *cls) { - struct cls_cursor cursor; - struct fte *fte, *next; + struct fte *fte; - fat_rwlock_wrlock(&cls->rwlock); - cls_cursor_init(&cursor, cls, NULL); - CLS_CURSOR_FOR_EACH_SAFE (fte, next, rule, &cursor) { + classifier_defer(cls); + CLS_FOR_EACH (fte, rule, cls) { classifier_remove(cls, &fte->rule); - fte_free(fte); + ovsrcu_postpone(fte_free, fte); } - fat_rwlock_unlock(&cls->rwlock); classifier_destroy(cls); } @@ -2344,22 +2452,20 @@ * Takes ownership of 'version'. */ static void fte_insert(struct classifier *cls, const struct match *match, - unsigned int priority, struct fte_version *version, int index) + int priority, struct fte_version *version, int index) { struct fte *old, *fte; fte = xzalloc(sizeof *fte); - cls_rule_init(&fte->rule, match, priority); + cls_rule_init(&fte->rule, match, priority, CLS_MIN_VERSION); fte->versions[index] = version; - fat_rwlock_wrlock(&cls->rwlock); - old = fte_from_cls_rule(classifier_replace(cls, &fte->rule)); - fat_rwlock_unlock(&cls->rwlock); + old = fte_from_cls_rule(classifier_replace(cls, &fte->rule, NULL, 0)); if (old) { - fte_version_free(old->versions[index]); fte->versions[!index] = old->versions[!index]; - cls_rule_destroy(&old->rule); - free(old); + old->versions[!index] = NULL; + + ovsrcu_postpone(fte_free, old); } } @@ -2382,6 +2488,7 @@ ds_init(&s); usable_protocols = OFPUTIL_P_ANY; line_number = 0; + classifier_defer(cls); while (!ds_get_preprocessed_line(&s, file, &line_number)) { struct fte_version *version; struct ofputil_flow_mod fm; @@ -2398,6 +2505,7 @@ version->cookie = fm.new_cookie; version->idle_timeout = fm.idle_timeout; version->hard_timeout = fm.hard_timeout; + version->importance = fm.importance; version->flags = fm.flags & (OFPUTIL_FF_SEND_FLOW_REM | OFPUTIL_FF_EMERG); version->ofpacts = fm.ofpacts; @@ -2405,6 +2513,7 @@ fte_insert(cls, &fm.match, fm.priority, version, index); } + classifier_publish(cls); ds_destroy(&s); if (file != stdin) { @@ -2433,12 +2542,12 @@ do { run(vconn_recv_block(vconn, &reply), "OpenFlow packet receive failed"); - } while (((struct ofp_header *) ofpbuf_data(reply))->xid != send_xid); + } while (((struct ofp_header *) reply->data)->xid != send_xid); - error = ofptype_decode(&type, ofpbuf_data(reply)); + error = ofptype_decode(&type, reply->data); if (error || type != OFPTYPE_FLOW_STATS_REPLY) { ovs_fatal(0, "received bad reply: %s", - ofp_to_string(ofpbuf_data(reply), ofpbuf_size(reply), + ofp_to_string(reply->data, reply->size, verbosity + 1)); } } @@ -2451,7 +2560,7 @@ return true; case EOF: - more = ofpmp_more(reply->frame); + more = ofpmp_more(reply->header); ofpbuf_delete(reply); reply = NULL; if (!more) { @@ -2488,11 +2597,12 @@ fsr.table_id = 0xff; fsr.cookie = fsr.cookie_mask = htonll(0); request = ofputil_encode_flow_stats_request(&fsr, protocol); - send_xid = ((struct ofp_header *) ofpbuf_data(request))->xid; + send_xid = ((struct ofp_header *) request->data)->xid; send_openflow_buffer(vconn, request); reply = NULL; ofpbuf_init(&ofpacts, 0); + classifier_defer(cls); while (recv_flow_stats_reply(vconn, send_xid, &reply, &fs, &ofpacts)) { struct fte_version *version; @@ -2500,18 +2610,20 @@ version->cookie = fs.cookie; version->idle_timeout = fs.idle_timeout; version->hard_timeout = fs.hard_timeout; + version->importance = fs.importance; version->flags = 0; version->ofpacts_len = fs.ofpacts_len; version->ofpacts = xmemdup(fs.ofpacts, fs.ofpacts_len); fte_insert(cls, &fs.match, fs.priority, version, index); } + classifier_publish(cls); ofpbuf_uninit(&ofpacts); } static void fte_make_flow_mod(const struct fte *fte, int index, uint16_t command, - enum ofputil_protocol protocol, struct list *packets) + enum ofputil_protocol protocol, struct ovs_list *packets) { const struct fte_version *version = fte->versions[index]; struct ofputil_flow_mod fm; @@ -2527,6 +2639,7 @@ fm.command = command; fm.idle_timeout = version->idle_timeout; fm.hard_timeout = version->hard_timeout; + fm.importance = version->importance; fm.buffer_id = UINT32_MAX; fm.out_port = OFPP_ANY; fm.flags = version->flags; @@ -2538,26 +2651,26 @@ fm.ofpacts = NULL; fm.ofpacts_len = 0; } + fm.delete_reason = OFPRR_DELETE; ofm = ofputil_encode_flow_mod(&fm, protocol); list_push_back(packets, &ofm->list_node); } static void -ofctl_replace_flows(int argc OVS_UNUSED, char *argv[]) +ofctl_replace_flows(struct ovs_cmdl_context *ctx) { enum { FILE_IDX = 0, SWITCH_IDX = 1 }; enum ofputil_protocol usable_protocols, protocol; - struct cls_cursor cursor; struct classifier cls; - struct list requests; + struct ovs_list requests; struct vconn *vconn; struct fte *fte; classifier_init(&cls, NULL); - usable_protocols = read_flows_from_file(argv[2], &cls, FILE_IDX); + usable_protocols = read_flows_from_file(ctx->argv[2], &cls, FILE_IDX); - protocol = open_vconn(argv[1], &vconn); + protocol = open_vconn(ctx->argv[1], &vconn); protocol = set_protocol_for_flow_dump(vconn, protocol, usable_protocols); read_flows_from_switch(vconn, protocol, &cls, SWITCH_IDX); @@ -2565,9 +2678,7 @@ list_init(&requests); /* Delete flows that exist on the switch but not in the file. */ - fat_rwlock_rdlock(&cls.rwlock); - cls_cursor_init(&cursor, &cls, NULL); - CLS_CURSOR_FOR_EACH (fte, rule, &cursor) { + CLS_FOR_EACH (fte, rule, &cls) { struct fte_version *file_ver = fte->versions[FILE_IDX]; struct fte_version *sw_ver = fte->versions[SWITCH_IDX]; @@ -2579,8 +2690,7 @@ /* Add flows that exist in the file but not on the switch. * Update flows that exist in both places but differ. */ - cls_cursor_init(&cursor, &cls, NULL); - CLS_CURSOR_FOR_EACH (fte, rule, &cursor) { + CLS_FOR_EACH (fte, rule, &cls) { struct fte_version *file_ver = fte->versions[FILE_IDX]; struct fte_version *sw_ver = fte->versions[SWITCH_IDX]; @@ -2589,8 +2699,11 @@ fte_make_flow_mod(fte, FILE_IDX, OFPFC_ADD, protocol, &requests); } } - fat_rwlock_unlock(&cls.rwlock); - transact_multiple_noreply(vconn, &requests); + if (bundle) { + bundle_transact(vconn, &requests, OFPBF_ORDERED | OFPBF_ATOMIC); + } else { + transact_multiple_noreply(vconn, &requests); + } vconn_close(vconn); fte_free_all(&cls); @@ -2616,24 +2729,21 @@ } static void -ofctl_diff_flows(int argc OVS_UNUSED, char *argv[]) +ofctl_diff_flows(struct ovs_cmdl_context *ctx) { bool differences = false; - struct cls_cursor cursor; struct classifier cls; struct ds a_s, b_s; struct fte *fte; classifier_init(&cls, NULL); - read_flows_from_source(argv[1], &cls, 0); - read_flows_from_source(argv[2], &cls, 1); + read_flows_from_source(ctx->argv[1], &cls, 0); + read_flows_from_source(ctx->argv[2], &cls, 1); ds_init(&a_s); ds_init(&b_s); - fat_rwlock_rdlock(&cls.rwlock); - cls_cursor_init(&cursor, &cls, NULL); - CLS_CURSOR_FOR_EACH (fte, rule, &cursor) { + CLS_FOR_EACH (fte, rule, &cls) { struct fte_version *a = fte->versions[0]; struct fte_version *b = fte->versions[1]; @@ -2651,7 +2761,6 @@ } } } - fat_rwlock_unlock(&cls.rwlock); ds_destroy(&a_s); ds_destroy(&b_s); @@ -2721,41 +2830,41 @@ static void -ofctl_add_meter(int argc OVS_UNUSED, char *argv[]) +ofctl_add_meter(struct ovs_cmdl_context *ctx) { - ofctl_meter_mod__(argv[1], argv[2], OFPMC13_ADD); + ofctl_meter_mod__(ctx->argv[1], ctx->argv[2], OFPMC13_ADD); } static void -ofctl_mod_meter(int argc OVS_UNUSED, char *argv[]) +ofctl_mod_meter(struct ovs_cmdl_context *ctx) { - ofctl_meter_mod__(argv[1], argv[2], OFPMC13_MODIFY); + ofctl_meter_mod__(ctx->argv[1], ctx->argv[2], OFPMC13_MODIFY); } static void -ofctl_del_meters(int argc, char *argv[]) +ofctl_del_meters(struct ovs_cmdl_context *ctx) { - ofctl_meter_mod__(argv[1], argc > 2 ? argv[2] : NULL, OFPMC13_DELETE); + ofctl_meter_mod__(ctx->argv[1], ctx->argc > 2 ? ctx->argv[2] : NULL, OFPMC13_DELETE); } static void -ofctl_dump_meters(int argc, char *argv[]) +ofctl_dump_meters(struct ovs_cmdl_context *ctx) { - ofctl_meter_request__(argv[1], argc > 2 ? argv[2] : NULL, + ofctl_meter_request__(ctx->argv[1], ctx->argc > 2 ? ctx->argv[2] : NULL, OFPUTIL_METER_CONFIG); } static void -ofctl_meter_stats(int argc, char *argv[]) +ofctl_meter_stats(struct ovs_cmdl_context *ctx) { - ofctl_meter_request__(argv[1], argc > 2 ? argv[2] : NULL, + ofctl_meter_request__(ctx->argv[1], ctx->argc > 2 ? ctx->argv[2] : NULL, OFPUTIL_METER_STATS); } static void -ofctl_meter_features(int argc OVS_UNUSED, char *argv[]) +ofctl_meter_features(struct ovs_cmdl_context *ctx) { - ofctl_meter_request__(argv[1], NULL, OFPUTIL_METER_FEATURES); + ofctl_meter_request__(ctx->argv[1], NULL, OFPUTIL_METER_FEATURES); } @@ -2791,7 +2900,7 @@ struct ofpbuf *msg; msg = ofputil_encode_flow_mod(fm, protocol); - ofp_print(stdout, ofpbuf_data(msg), ofpbuf_size(msg), verbosity); + ofp_print(stdout, msg->data, msg->size, verbosity); ofpbuf_delete(msg); free(CONST_CAST(struct ofpact *, fm->ofpacts)); @@ -2801,13 +2910,13 @@ /* "parse-flow FLOW": parses the argument as a flow (like add-flow) and prints * it back to stdout. */ static void -ofctl_parse_flow(int argc OVS_UNUSED, char *argv[]) +ofctl_parse_flow(struct ovs_cmdl_context *ctx) { enum ofputil_protocol usable_protocols; struct ofputil_flow_mod fm; char *error; - error = parse_ofp_flow_mod_str(&fm, argv[1], OFPFC_ADD, &usable_protocols); + error = parse_ofp_flow_mod_str(&fm, ctx->argv[1], OFPFC_ADD, &usable_protocols); if (error) { ovs_fatal(0, "%s", error); } @@ -2817,14 +2926,14 @@ /* "parse-flows FILENAME": reads the named file as a sequence of flows (like * add-flows) and prints each of the flows back to stdout. */ static void -ofctl_parse_flows(int argc OVS_UNUSED, char *argv[]) +ofctl_parse_flows(struct ovs_cmdl_context *ctx) { enum ofputil_protocol usable_protocols; struct ofputil_flow_mod *fms = NULL; size_t n_fms = 0; char *error; - error = parse_ofp_flow_mod_file(argv[1], OFPFC_ADD, &fms, &n_fms, + error = parse_ofp_flow_mod_file(ctx->argv[1], OFPFC_ADD, &fms, &n_fms, &usable_protocols); if (error) { ovs_fatal(0, "%s", error); @@ -2884,11 +2993,15 @@ } else { match_len = nx_put_match(&nx_match, &match, cookie, cookie_mask); - out = nx_match_to_string(ofpbuf_data(&nx_match), match_len); + out = nx_match_to_string(nx_match.data, match_len); } puts(out); free(out); + + if (verbosity > 0) { + ovs_hex_dump(stdout, nx_match.data, nx_match.size, 0, false); + } } else { printf("nx_pull_match() returned error %s\n", ofperr_get_name(error)); @@ -2903,9 +3016,9 @@ * stdin, does some internal fussing with them, and then prints them back as * strings on stdout. */ static void -ofctl_parse_nxm(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +ofctl_parse_nxm(struct ovs_cmdl_context *ctx OVS_UNUSED) { - return ofctl_parse_nxm__(false, 0); + ofctl_parse_nxm__(false, 0); } /* "parse-oxm VERSION": reads a series of OXM nx_match specifications as @@ -2913,14 +3026,14 @@ * them back as strings on stdout. VERSION must specify an OpenFlow version, * e.g. "OpenFlow12". */ static void -ofctl_parse_oxm(int argc OVS_UNUSED, char *argv[]) +ofctl_parse_oxm(struct ovs_cmdl_context *ctx) { - enum ofp_version version = ofputil_version_from_string(argv[1]); + enum ofp_version version = ofputil_version_from_string(ctx->argv[1]); if (version < OFP12_VERSION) { - ovs_fatal(0, "%s: not a valid version for OXM", argv[1]); + ovs_fatal(0, "%s: not a valid version for OXM", ctx->argv[1]); } - return ofctl_parse_nxm__(true, version); + ofctl_parse_nxm__(true, version); } static void @@ -2946,66 +3059,119 @@ } } -/* "parse-ofp10-actions": reads a series of OpenFlow 1.0 action specifications - * as hex bytes from stdin, converts them to ofpacts, prints them as strings - * on stdout, and then converts them back to hex bytes and prints any - * differences from the input. */ static void -ofctl_parse_ofp10_actions(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +ofctl_parse_actions__(const char *version_s, bool instructions) { + enum ofp_version version; struct ds in; + version = ofputil_version_from_string(version_s); + if (!version) { + ovs_fatal(0, "%s: not a valid OpenFlow version", version_s); + } + ds_init(&in); while (!ds_get_preprocessed_line(&in, stdin, NULL)) { - struct ofpbuf of10_out; - struct ofpbuf of10_in; + struct ofpbuf of_out; + struct ofpbuf of_in; struct ofpbuf ofpacts; + const char *table_id; + char *actions; enum ofperr error; size_t size; struct ds s; + /* Parse table_id separated with the follow-up actions by ",", if + * any. */ + actions = ds_cstr(&in); + table_id = NULL; + if (strstr(actions, ",")) { + table_id = strsep(&actions, ","); + } + /* Parse hex bytes. */ - ofpbuf_init(&of10_in, 0); - if (ofpbuf_put_hex(&of10_in, ds_cstr(&in), NULL)[0] != '\0') { + ofpbuf_init(&of_in, 0); + if (ofpbuf_put_hex(&of_in, actions, NULL)[0] != '\0') { ovs_fatal(0, "Trailing garbage in hex data"); } /* Convert to ofpacts. */ ofpbuf_init(&ofpacts, 0); - size = ofpbuf_size(&of10_in); - error = ofpacts_pull_openflow_actions(&of10_in, ofpbuf_size(&of10_in), - OFP10_VERSION, &ofpacts); + size = of_in.size; + error = (instructions + ? ofpacts_pull_openflow_instructions + : ofpacts_pull_openflow_actions)( + &of_in, of_in.size, version, &ofpacts); + if (!error && instructions) { + /* Verify actions, enforce consistency. */ + enum ofputil_protocol protocol; + struct flow flow; + + memset(&flow, 0, sizeof flow); + protocol = ofputil_protocols_from_ofp_version(version); + error = ofpacts_check_consistency(ofpacts.data, ofpacts.size, + &flow, OFPP_MAX, + table_id ? atoi(table_id) : 0, + 255, protocol); + } if (error) { - printf("bad OF1.1 actions: %s\n\n", ofperr_get_name(error)); + printf("bad %s %s: %s\n\n", + version_s, instructions ? "instructions" : "actions", + ofperr_get_name(error)); ofpbuf_uninit(&ofpacts); - ofpbuf_uninit(&of10_in); + ofpbuf_uninit(&of_in); continue; } - ofpbuf_push_uninit(&of10_in, size); + ofpbuf_push_uninit(&of_in, size); /* Print cls_rule. */ ds_init(&s); ds_put_cstr(&s, "actions="); - ofpacts_format(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &s); + ofpacts_format(ofpacts.data, ofpacts.size, &s); puts(ds_cstr(&s)); ds_destroy(&s); /* Convert back to ofp10 actions and print differences from input. */ - ofpbuf_init(&of10_out, 0); - ofpacts_put_openflow_actions(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &of10_out, - OFP10_VERSION); + ofpbuf_init(&of_out, 0); + if (instructions) { + ofpacts_put_openflow_instructions(ofpacts.data, ofpacts.size, + &of_out, version); + } else { + ofpacts_put_openflow_actions(ofpacts.data, ofpacts.size, + &of_out, version); + } - print_differences("", ofpbuf_data(&of10_in), ofpbuf_size(&of10_in), - ofpbuf_data(&of10_out), ofpbuf_size(&of10_out)); + print_differences("", of_in.data, of_in.size, + of_out.data, of_out.size); putchar('\n'); ofpbuf_uninit(&ofpacts); - ofpbuf_uninit(&of10_in); - ofpbuf_uninit(&of10_out); + ofpbuf_uninit(&of_in); + ofpbuf_uninit(&of_out); } ds_destroy(&in); } +/* "parse-actions VERSION": reads a series of action specifications for the + * given OpenFlow VERSION as hex bytes from stdin, converts them to ofpacts, + * prints them as strings on stdout, and then converts them back to hex bytes + * and prints any differences from the input. */ +static void +ofctl_parse_actions(struct ovs_cmdl_context *ctx) +{ + ofctl_parse_actions__(ctx->argv[1], false); +} + +/* "parse-actions VERSION": reads a series of instruction specifications for + * the given OpenFlow VERSION as hex bytes from stdin, converts them to + * ofpacts, prints them as strings on stdout, and then converts them back to + * hex bytes and prints any differences from the input. */ +static void +ofctl_parse_instructions(struct ovs_cmdl_context *ctx) +{ + ofctl_parse_actions__(ctx->argv[1], true); +} + /* "parse-ofp10-match": reads a series of ofp10_match specifications as hex * bytes from stdin, converts them to cls_rules, prints them as strings on * stdout, and then converts them back to hex bytes and prints any differences @@ -3016,7 +3182,7 @@ * them back to hex bytes. ovs-ofctl actually sets "x"s to random bits when * it does the conversion to hex, to ensure that in fact they are ignored. */ static void -ofctl_parse_ofp10_match(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +ofctl_parse_ofp10_match(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct ds expout; struct ds in; @@ -3042,9 +3208,9 @@ if (ofpbuf_put_hex(&match_expout, ds_cstr(&expout), NULL)[0] != '\0') { ovs_fatal(0, "Trailing garbage in hex data"); } - if (ofpbuf_size(&match_expout) != sizeof(struct ofp10_match)) { + if (match_expout.size != sizeof(struct ofp10_match)) { ovs_fatal(0, "Input is %"PRIu32" bytes, expected %"PRIuSIZE, - ofpbuf_size(&match_expout), sizeof(struct ofp10_match)); + match_expout.size, sizeof(struct ofp10_match)); } /* Parse hex bytes for input. */ @@ -3057,18 +3223,18 @@ if (ofpbuf_put_hex(&match_in, ds_cstr(&in), NULL)[0] != '\0') { ovs_fatal(0, "Trailing garbage in hex data"); } - if (ofpbuf_size(&match_in) != sizeof(struct ofp10_match)) { + if (match_in.size != sizeof(struct ofp10_match)) { ovs_fatal(0, "Input is %"PRIu32" bytes, expected %"PRIuSIZE, - ofpbuf_size(&match_in), sizeof(struct ofp10_match)); + match_in.size, sizeof(struct ofp10_match)); } /* Convert to cls_rule and print. */ - ofputil_match_from_ofp10_match(ofpbuf_data(&match_in), &match); + ofputil_match_from_ofp10_match(match_in.data, &match); match_print(&match); /* Convert back to ofp10_match and print differences from input. */ ofputil_match_to_ofp10_match(&match, &match_out); - print_differences("", ofpbuf_data(&match_expout), ofpbuf_size(&match_expout), + print_differences("", match_expout.data, match_expout.size, &match_out, sizeof match_out); /* Normalize, then convert and compare again. */ @@ -3090,7 +3256,7 @@ * on stdout, and then converts them back to hex bytes and prints any * differences from the input. */ static void -ofctl_parse_ofp11_match(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +ofctl_parse_ofp11_match(struct ovs_cmdl_context *ctx OVS_UNUSED) { struct ds in; @@ -3106,13 +3272,13 @@ if (ofpbuf_put_hex(&match_in, ds_cstr(&in), NULL)[0] != '\0') { ovs_fatal(0, "Trailing garbage in hex data"); } - if (ofpbuf_size(&match_in) != sizeof(struct ofp11_match)) { + if (match_in.size != sizeof(struct ofp11_match)) { ovs_fatal(0, "Input is %"PRIu32" bytes, expected %"PRIuSIZE, - ofpbuf_size(&match_in), sizeof(struct ofp11_match)); + match_in.size, sizeof(struct ofp11_match)); } /* Convert to match. */ - error = ofputil_match_from_ofp11_match(ofpbuf_data(&match_in), &match); + error = ofputil_match_from_ofp11_match(match_in.data, &match); if (error) { printf("bad ofp11_match: %s\n\n", ofperr_get_name(error)); ofpbuf_uninit(&match_in); @@ -3125,7 +3291,7 @@ /* Convert back to ofp11_match and print differences from input. */ ofputil_match_to_ofp11_match(&match, &match_out); - print_differences("", ofpbuf_data(&match_in), ofpbuf_size(&match_in), + print_differences("", match_in.data, match_in.size, &match_out, sizeof match_out); putchar('\n'); @@ -3134,181 +3300,41 @@ ds_destroy(&in); } -/* "parse-ofp11-actions": reads a series of OpenFlow 1.1 action specifications - * as hex bytes from stdin, converts them to ofpacts, prints them as strings - * on stdout, and then converts them back to hex bytes and prints any - * differences from the input. */ -static void -ofctl_parse_ofp11_actions(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) -{ - struct ds in; - - ds_init(&in); - while (!ds_get_preprocessed_line(&in, stdin, NULL)) { - struct ofpbuf of11_out; - struct ofpbuf of11_in; - struct ofpbuf ofpacts; - enum ofperr error; - size_t size; - struct ds s; - - /* Parse hex bytes. */ - ofpbuf_init(&of11_in, 0); - if (ofpbuf_put_hex(&of11_in, ds_cstr(&in), NULL)[0] != '\0') { - ovs_fatal(0, "Trailing garbage in hex data"); - } - - /* Convert to ofpacts. */ - ofpbuf_init(&ofpacts, 0); - size = ofpbuf_size(&of11_in); - error = ofpacts_pull_openflow_actions(&of11_in, ofpbuf_size(&of11_in), - OFP11_VERSION, &ofpacts); - if (error) { - printf("bad OF1.1 actions: %s\n\n", ofperr_get_name(error)); - ofpbuf_uninit(&ofpacts); - ofpbuf_uninit(&of11_in); - continue; - } - ofpbuf_push_uninit(&of11_in, size); - - /* Print cls_rule. */ - ds_init(&s); - ds_put_cstr(&s, "actions="); - ofpacts_format(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &s); - puts(ds_cstr(&s)); - ds_destroy(&s); - - /* Convert back to ofp11 actions and print differences from input. */ - ofpbuf_init(&of11_out, 0); - ofpacts_put_openflow_actions(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &of11_out, - OFP11_VERSION); - - print_differences("", ofpbuf_data(&of11_in), ofpbuf_size(&of11_in), - ofpbuf_data(&of11_out), ofpbuf_size(&of11_out)); - putchar('\n'); - - ofpbuf_uninit(&ofpacts); - ofpbuf_uninit(&of11_in); - ofpbuf_uninit(&of11_out); - } - ds_destroy(&in); -} - -/* "parse-ofp11-instructions": reads a series of OpenFlow 1.1 instruction - * specifications as hex bytes from stdin, converts them to ofpacts, prints - * them as strings on stdout, and then converts them back to hex bytes and - * prints any differences from the input. */ -static void -ofctl_parse_ofp11_instructions(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) -{ - struct ds in; - - ds_init(&in); - while (!ds_get_preprocessed_line(&in, stdin, NULL)) { - struct ofpbuf of11_out; - struct ofpbuf of11_in; - struct ofpbuf ofpacts; - enum ofperr error; - size_t size; - struct ds s; - const char *table_id; - char *instructions; - - /* Parse table_id separated with the follow-up instructions by ",", if - * any. */ - instructions = ds_cstr(&in); - table_id = NULL; - if (strstr(instructions, ",")) { - table_id = strsep(&instructions, ","); - } - - /* Parse hex bytes. */ - ofpbuf_init(&of11_in, 0); - if (ofpbuf_put_hex(&of11_in, instructions, NULL)[0] != '\0') { - ovs_fatal(0, "Trailing garbage in hex data"); - } - - /* Convert to ofpacts. */ - ofpbuf_init(&ofpacts, 0); - size = ofpbuf_size(&of11_in); - error = ofpacts_pull_openflow_instructions(&of11_in, ofpbuf_size(&of11_in), - OFP11_VERSION, &ofpacts); - if (!error) { - /* Verify actions, enforce consistency. */ - struct flow flow; - memset(&flow, 0, sizeof flow); - error = ofpacts_check_consistency(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), - &flow, OFPP_MAX, - table_id ? atoi(table_id) : 0, - 255, OFPUTIL_P_OF11_STD); - } - if (error) { - printf("bad OF1.1 instructions: %s\n\n", ofperr_get_name(error)); - ofpbuf_uninit(&ofpacts); - ofpbuf_uninit(&of11_in); - continue; - } - ofpbuf_push_uninit(&of11_in, size); - - /* Print cls_rule. */ - ds_init(&s); - ds_put_cstr(&s, "actions="); - ofpacts_format(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), &s); - puts(ds_cstr(&s)); - ds_destroy(&s); - - /* Convert back to ofp11 instructions and print differences from - * input. */ - ofpbuf_init(&of11_out, 0); - ofpacts_put_openflow_instructions(ofpbuf_data(&ofpacts), ofpbuf_size(&ofpacts), - &of11_out, OFP13_VERSION); - - print_differences("", ofpbuf_data(&of11_in), ofpbuf_size(&of11_in), - ofpbuf_data(&of11_out), ofpbuf_size(&of11_out)); - putchar('\n'); - - ofpbuf_uninit(&ofpacts); - ofpbuf_uninit(&of11_in); - ofpbuf_uninit(&of11_out); - } - ds_destroy(&in); -} - /* "parse-pcap PCAP": read packets from PCAP and print their flows. */ static void -ofctl_parse_pcap(int argc OVS_UNUSED, char *argv[]) +ofctl_parse_pcap(struct ovs_cmdl_context *ctx) { FILE *pcap; - pcap = ovs_pcap_open(argv[1], "rb"); + pcap = ovs_pcap_open(ctx->argv[1], "rb"); if (!pcap) { - ovs_fatal(errno, "%s: open failed", argv[1]); + ovs_fatal(errno, "%s: open failed", ctx->argv[1]); } for (;;) { - struct ofpbuf *packet; + struct dp_packet *packet; struct flow flow; - const struct pkt_metadata md = PKT_METADATA_INITIALIZER(ODPP_NONE); int error; error = ovs_pcap_read(pcap, &packet, NULL); if (error == EOF) { break; } else if (error) { - ovs_fatal(error, "%s: read failed", argv[1]); + ovs_fatal(error, "%s: read failed", ctx->argv[1]); } - flow_extract(packet, &md, &flow); + packet->md = PKT_METADATA_INITIALIZER(ODPP_NONE); + flow_extract(packet, &flow); flow_print(stdout, &flow); putchar('\n'); - ofpbuf_delete(packet); + dp_packet_delete(packet); } } /* "check-vlan VLAN_TCI VLAN_TCI_MASK": converts the specified vlan_tci and * mask values to and from various formats and prints the results. */ static void -ofctl_check_vlan(int argc OVS_UNUSED, char *argv[]) +ofctl_check_vlan(struct ovs_cmdl_context *ctx) { struct match match; @@ -3332,8 +3358,8 @@ enum ofputil_protocol usable_protocols; /* Unused for now. */ match_init_catchall(&match); - match.flow.vlan_tci = htons(strtoul(argv[1], NULL, 16)); - match.wc.masks.vlan_tci = htons(strtoul(argv[2], NULL, 16)); + match.flow.vlan_tci = htons(strtoul(ctx->argv[1], NULL, 16)); + match.wc.masks.vlan_tci = htons(strtoul(ctx->argv[2], NULL, 16)); /* Convert to and from string. */ string_s = match_to_string(&match, OFP_DEFAULT_PRIORITY); @@ -3351,7 +3377,7 @@ /* Convert to and from NXM. */ ofpbuf_init(&nxm, 0); nxm_match_len = nx_put_match(&nxm, &match, htonll(0), htonll(0)); - nxm_s = nx_match_to_string(ofpbuf_data(&nxm), nxm_match_len); + nxm_s = nx_match_to_string(nxm.data, nxm_match_len); error = nx_pull_match(&nxm, nxm_match_len, &nxm_match, NULL, NULL); printf("NXM: %s -> ", nxm_s); if (error) { @@ -3414,14 +3440,14 @@ /* "print-error ENUM": Prints the type and code of ENUM for every OpenFlow * version. */ static void -ofctl_print_error(int argc OVS_UNUSED, char *argv[]) +ofctl_print_error(struct ovs_cmdl_context *ctx) { enum ofperr error; int version; - error = ofperr_from_name(argv[1]); + error = ofperr_from_name(ctx->argv[1]); if (!error) { - ovs_fatal(0, "unknown error \"%s\"", argv[1]); + ovs_fatal(0, "unknown error \"%s\"", ctx->argv[1]); } for (version = 0; version <= UINT8_MAX; version++) { @@ -3442,137 +3468,207 @@ /* "encode-error-reply ENUM REQUEST": Encodes an error reply to REQUEST for the * error named ENUM and prints the error reply in hex. */ static void -ofctl_encode_error_reply(int argc OVS_UNUSED, char *argv[]) +ofctl_encode_error_reply(struct ovs_cmdl_context *ctx) { const struct ofp_header *oh; struct ofpbuf request, *reply; enum ofperr error; - error = ofperr_from_name(argv[1]); + error = ofperr_from_name(ctx->argv[1]); if (!error) { - ovs_fatal(0, "unknown error \"%s\"", argv[1]); + ovs_fatal(0, "unknown error \"%s\"", ctx->argv[1]); } ofpbuf_init(&request, 0); - if (ofpbuf_put_hex(&request, argv[2], NULL)[0] != '\0') { + if (ofpbuf_put_hex(&request, ctx->argv[2], NULL)[0] != '\0') { ovs_fatal(0, "Trailing garbage in hex data"); } - if (ofpbuf_size(&request) < sizeof(struct ofp_header)) { + if (request.size < sizeof(struct ofp_header)) { ovs_fatal(0, "Request too short"); } - oh = ofpbuf_data(&request); - if (ofpbuf_size(&request) != ntohs(oh->length)) { + oh = request.data; + if (request.size != ntohs(oh->length)) { ovs_fatal(0, "Request size inconsistent"); } - reply = ofperr_encode_reply(error, ofpbuf_data(&request)); + reply = ofperr_encode_reply(error, request.data); ofpbuf_uninit(&request); - ovs_hex_dump(stdout, ofpbuf_data(reply), ofpbuf_size(reply), 0, false); + ovs_hex_dump(stdout, reply->data, reply->size, 0, false); ofpbuf_delete(reply); } /* "ofp-print HEXSTRING [VERBOSITY]": Converts the hex digits in HEXSTRING into * binary data, interpreting them as an OpenFlow message, and prints the - * OpenFlow message on stdout, at VERBOSITY (level 2 by default). */ + * OpenFlow message on stdout, at VERBOSITY (level 2 by default). + * + * Alternative usage: "ofp-print [VERBOSITY] - < HEXSTRING_FILE", where + * HEXSTRING_FILE contains the HEXSTRING. */ static void -ofctl_ofp_print(int argc, char *argv[]) +ofctl_ofp_print(struct ovs_cmdl_context *ctx) { struct ofpbuf packet; + char *buffer; + int verbosity = 2; + struct ds line; + + ds_init(&line); + + if (!strcmp(ctx->argv[ctx->argc-1], "-")) { + if (ds_get_line(&line, stdin)) { + VLOG_FATAL("Failed to read stdin"); + } + + buffer = line.string; + verbosity = ctx->argc > 2 ? atoi(ctx->argv[1]) : verbosity; + } else if (ctx->argc > 2) { + buffer = ctx->argv[1]; + verbosity = atoi(ctx->argv[2]); + } else { + buffer = ctx->argv[1]; + } - ofpbuf_init(&packet, strlen(argv[1]) / 2); - if (ofpbuf_put_hex(&packet, argv[1], NULL)[0] != '\0') { + ofpbuf_init(&packet, strlen(buffer) / 2); + if (ofpbuf_put_hex(&packet, buffer, NULL)[0] != '\0') { ovs_fatal(0, "trailing garbage following hex bytes"); } - ofp_print(stdout, ofpbuf_data(&packet), ofpbuf_size(&packet), argc > 2 ? atoi(argv[2]) : 2); + ofp_print(stdout, packet.data, packet.size, verbosity); ofpbuf_uninit(&packet); + ds_destroy(&line); } /* "encode-hello BITMAP...": Encodes each BITMAP as an OpenFlow hello message * and dumps each message in hex. */ static void -ofctl_encode_hello(int argc OVS_UNUSED, char *argv[]) +ofctl_encode_hello(struct ovs_cmdl_context *ctx) { - uint32_t bitmap = strtol(argv[1], NULL, 0); + uint32_t bitmap = strtol(ctx->argv[1], NULL, 0); struct ofpbuf *hello; hello = ofputil_encode_hello(bitmap); - ovs_hex_dump(stdout, ofpbuf_data(hello), ofpbuf_size(hello), 0, false); - ofp_print(stdout, ofpbuf_data(hello), ofpbuf_size(hello), verbosity); + ovs_hex_dump(stdout, hello->data, hello->size, 0, false); + ofp_print(stdout, hello->data, hello->size, verbosity); ofpbuf_delete(hello); } -static const struct command all_commands[] = { - { "show", 1, 1, ofctl_show }, - { "monitor", 1, 3, ofctl_monitor }, - { "snoop", 1, 1, ofctl_snoop }, - { "dump-desc", 1, 1, ofctl_dump_desc }, - { "dump-tables", 1, 1, ofctl_dump_tables }, - { "dump-table-features", 1, 1, ofctl_dump_table_features }, - { "dump-flows", 1, 2, ofctl_dump_flows }, - { "dump-aggregate", 1, 2, ofctl_dump_aggregate }, - { "queue-stats", 1, 3, ofctl_queue_stats }, - { "queue-get-config", 2, 2, ofctl_queue_get_config }, - { "add-flow", 2, 2, ofctl_add_flow }, - { "add-flows", 2, 2, ofctl_add_flows }, - { "mod-flows", 2, 2, ofctl_mod_flows }, - { "del-flows", 1, 2, ofctl_del_flows }, - { "replace-flows", 2, 2, ofctl_replace_flows }, - { "diff-flows", 2, 2, ofctl_diff_flows }, - { "add-meter", 2, 2, ofctl_add_meter }, - { "mod-meter", 2, 2, ofctl_mod_meter }, - { "del-meter", 2, 2, ofctl_del_meters }, - { "del-meters", 1, 1, ofctl_del_meters }, - { "dump-meter", 2, 2, ofctl_dump_meters }, - { "dump-meters", 1, 1, ofctl_dump_meters }, - { "meter-stats", 1, 2, ofctl_meter_stats }, - { "meter-features", 1, 1, ofctl_meter_features }, - { "packet-out", 4, INT_MAX, ofctl_packet_out }, - { "dump-ports", 1, 2, ofctl_dump_ports }, - { "dump-ports-desc", 1, 2, ofctl_dump_ports_desc }, - { "mod-port", 3, 3, ofctl_mod_port }, - { "mod-table", 3, 3, ofctl_mod_table }, - { "get-frags", 1, 1, ofctl_get_frags }, - { "set-frags", 2, 2, ofctl_set_frags }, - { "probe", 1, 1, ofctl_probe }, - { "ping", 1, 2, ofctl_ping }, - { "benchmark", 3, 3, ofctl_benchmark }, - - { "ofp-parse", 1, 1, ofctl_ofp_parse }, - { "ofp-parse-pcap", 1, INT_MAX, ofctl_ofp_parse_pcap }, - - { "add-group", 1, 2, ofctl_add_group }, - { "add-groups", 1, 2, ofctl_add_groups }, - { "mod-group", 1, 2, ofctl_mod_group }, - { "del-groups", 1, 2, ofctl_del_groups }, - { "dump-groups", 1, 2, ofctl_dump_group_desc }, - { "dump-group-stats", 1, 2, ofctl_dump_group_stats }, - { "dump-group-features", 1, 1, ofctl_dump_group_features }, - { "help", 0, INT_MAX, ofctl_help }, +static const struct ovs_cmdl_command all_commands[] = { + { "show", "switch", + 1, 1, ofctl_show }, + { "monitor", "switch [misslen] [invalid_ttl] [watch:[...]]", + 1, 3, ofctl_monitor }, + { "snoop", "switch", + 1, 1, ofctl_snoop }, + { "dump-desc", "switch", + 1, 1, ofctl_dump_desc }, + { "dump-tables", "switch", + 1, 1, ofctl_dump_tables }, + { "dump-table-features", "switch", + 1, 1, ofctl_dump_table_features }, + { "dump-flows", "switch", + 1, 2, ofctl_dump_flows }, + { "dump-aggregate", "switch", + 1, 2, ofctl_dump_aggregate }, + { "queue-stats", "switch [port [queue]]", + 1, 3, ofctl_queue_stats }, + { "queue-get-config", "switch port", + 2, 2, ofctl_queue_get_config }, + { "add-flow", "switch flow", + 2, 2, ofctl_add_flow }, + { "add-flows", "switch file", + 2, 2, ofctl_add_flows }, + { "mod-flows", "switch flow", + 2, 2, ofctl_mod_flows }, + { "del-flows", "switch [flow]", + 1, 2, ofctl_del_flows }, + { "replace-flows", "switch file", + 2, 2, ofctl_replace_flows }, + { "diff-flows", "source1 source2", + 2, 2, ofctl_diff_flows }, + { "add-meter", "switch meter", + 2, 2, ofctl_add_meter }, + { "mod-meter", "switch meter", + 2, 2, ofctl_mod_meter }, + { "del-meter", "switch meter", + 2, 2, ofctl_del_meters }, + { "del-meters", "switch", + 1, 1, ofctl_del_meters }, + { "dump-meter", "switch meter", + 2, 2, ofctl_dump_meters }, + { "dump-meters", "switch", + 1, 1, ofctl_dump_meters }, + { "meter-stats", "switch [meter]", + 1, 2, ofctl_meter_stats }, + { "meter-features", "switch", + 1, 1, ofctl_meter_features }, + { "packet-out", "switch in_port actions packet...", + 4, INT_MAX, ofctl_packet_out }, + { "dump-ports", "switch [port]", + 1, 2, ofctl_dump_ports }, + { "dump-ports-desc", "switch [port]", + 1, 2, ofctl_dump_ports_desc }, + { "mod-port", "switch iface act", + 3, 3, ofctl_mod_port }, + { "mod-table", "switch mod", + 3, 3, ofctl_mod_table }, + { "get-frags", "switch", + 1, 1, ofctl_get_frags }, + { "set-frags", "switch frag_mode", + 2, 2, ofctl_set_frags }, + { "probe", "target", + 1, 1, ofctl_probe }, + { "ping", "target [n]", + 1, 2, ofctl_ping }, + { "benchmark", "target n count", + 3, 3, ofctl_benchmark }, + + { "ofp-parse", "file", + 1, 1, ofctl_ofp_parse }, + { "ofp-parse-pcap", "pcap", + 1, INT_MAX, ofctl_ofp_parse_pcap }, + + { "add-group", "switch group", + 1, 2, ofctl_add_group }, + { "add-groups", "switch file", + 1, 2, ofctl_add_groups }, + { "mod-group", "switch group", + 1, 2, ofctl_mod_group }, + { "del-groups", "switch [group]", + 1, 2, ofctl_del_groups }, + { "insert-buckets", "switch [group]", + 1, 2, ofctl_insert_bucket }, + { "remove-buckets", "switch [group]", + 1, 2, ofctl_remove_bucket }, + { "dump-groups", "switch [group]", + 1, 2, ofctl_dump_group_desc }, + { "dump-group-stats", "switch [group]", + 1, 2, ofctl_dump_group_stats }, + { "dump-group-features", "switch", + 1, 1, ofctl_dump_group_features }, + { "help", NULL, 0, INT_MAX, ofctl_help }, + { "list-commands", NULL, 0, INT_MAX, ofctl_list_commands }, /* Undocumented commands for testing. */ - { "parse-flow", 1, 1, ofctl_parse_flow }, - { "parse-flows", 1, 1, ofctl_parse_flows }, - { "parse-nx-match", 0, 0, ofctl_parse_nxm }, - { "parse-nxm", 0, 0, ofctl_parse_nxm }, - { "parse-oxm", 1, 1, ofctl_parse_oxm }, - { "parse-ofp10-actions", 0, 0, ofctl_parse_ofp10_actions }, - { "parse-ofp10-match", 0, 0, ofctl_parse_ofp10_match }, - { "parse-ofp11-match", 0, 0, ofctl_parse_ofp11_match }, - { "parse-ofp11-actions", 0, 0, ofctl_parse_ofp11_actions }, - { "parse-ofp11-instructions", 0, 0, ofctl_parse_ofp11_instructions }, - { "parse-pcap", 1, 1, ofctl_parse_pcap }, - { "check-vlan", 2, 2, ofctl_check_vlan }, - { "print-error", 1, 1, ofctl_print_error }, - { "encode-error-reply", 2, 2, ofctl_encode_error_reply }, - { "ofp-print", 1, 2, ofctl_ofp_print }, - { "encode-hello", 1, 1, ofctl_encode_hello }, + { "parse-flow", NULL, 1, 1, ofctl_parse_flow }, + { "parse-flows", NULL, 1, 1, ofctl_parse_flows }, + { "parse-nx-match", NULL, 0, 0, ofctl_parse_nxm }, + { "parse-nxm", NULL, 0, 0, ofctl_parse_nxm }, + { "parse-oxm", NULL, 1, 1, ofctl_parse_oxm }, + { "parse-actions", NULL, 1, 1, ofctl_parse_actions }, + { "parse-instructions", NULL, 1, 1, ofctl_parse_instructions }, + { "parse-ofp10-match", NULL, 0, 0, ofctl_parse_ofp10_match }, + { "parse-ofp11-match", NULL, 0, 0, ofctl_parse_ofp11_match }, + { "parse-pcap", NULL, 1, 1, ofctl_parse_pcap }, + { "check-vlan", NULL, 2, 2, ofctl_check_vlan }, + { "print-error", NULL, 1, 1, ofctl_print_error }, + { "encode-error-reply", NULL, 2, 2, ofctl_encode_error_reply }, + { "ofp-print", NULL, 1, 2, ofctl_ofp_print }, + { "encode-hello", NULL, 1, 1, ofctl_encode_hello }, - { NULL, 0, 0, NULL }, + { NULL, NULL, 0, 0, NULL }, }; -static const struct command *get_all_commands(void) +static const struct ovs_cmdl_command *get_all_commands(void) { return all_commands; } diff -Nru openvswitch-2.3.1/utilities/ovs-pipegen.py openvswitch-2.4.0~git20150623/utilities/ovs-pipegen.py --- openvswitch-2.3.1/utilities/ovs-pipegen.py 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-pipegen.py 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,122 @@ +#!/usr/bin/python +# Copyright (c) 2013, 2014, 2015 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import random +import sys +import textwrap + +def flow_str(stage, match, action, priority=32768): + mtd_match = "metadata=%d" % stage + if match: + mtd_match += "," + match + + return "priority=%d %s,actions=%s" % (priority, mtd_match, action) + + +def resubmit(nxt): + return "load:%d->OXM_OF_METADATA[],resubmit(,0)" % nxt + + +def rand_ip_mask(): + return ("%d.%d.%d.%d" % (random.randint(0, 255), random.randint(0, 255), + random.randint(0, 255), random.randint(0, 255)), + random.choice([8, 16, 24, 32])) + + +def rand_bool(): + return bool(random.randint(0, 1)) + + +def l2(stage, action): + mac = ["%x" % random.randint(0, 2 ** 8 - 1) for x in range(6)] + mac = [x.zfill(2) for x in mac] + mac = ":".join(mac) + return flow_str(stage, "dl_dst=%s" % mac, action) + + +def l3(stage, action): + ip, mask = rand_ip_mask() + return flow_str(stage, "ip,ip_dst=%s/%d" % (ip, mask), action, + priority=mask) + + +def l4(stage, action): + match = "tcp" + + if rand_bool(): + match += ",ip_src=%s/%d" % rand_ip_mask() + + if rand_bool(): + match += ",ip_dst=%s/%d" % rand_ip_mask() + + src_dst = "tp_src" if rand_bool() else "tp_dst" + match += ",%s=%d" % (src_dst, random.randint(1024, 2**16 - 1)) + return flow_str(stage, match, action) + + +def pipeline(size): + pipeline = [l2, l3, l4, l2] + + flows = [] + for stage in xrange(len(pipeline)): + action = resubmit(stage + 1) + flows += [pipeline[stage](stage, action) for _ in xrange(size)] + flows.append(flow_str(stage, "", action, priority=1)) + + flows.append(flow_str(len(pipeline), "", "in_port")) + + for f in flows: + print f + + +def main(): + description = textwrap.dedent( + """ + Generate a test OpenFlow pipeline. + + Open vSwitch relies heavily on flow caching to get good performance for + packet processing. While on average, this produces good results, + performance is heavily depedent on the slow path OpenFlow tables, and + how they're translated into datapath megaflows. For this reason, when + doing performance testing it's important to run with "realistic" + OpenFlow tables to ensure results will stand up in the real world. + + This script generates a simple OpenFlow pipeline intended to simulate + realistic network virtualization workloads. All traffic received is + run through a series of OpenFlow tables designed to simulate a logical + switch, router, and firewall, before forwarded back on the in_port. + """) + + epilog = textwrap.dedent( + """ + typical usage: + ovs-ofctl del-flows bridge \\ + && %s | ovs-ofctl add-flows bridge - \\ + && ovs-ofctl dump-flows bridge + """ % sys.argv[0]) + + parser = argparse.ArgumentParser(description=description, epilog=epilog, + formatter_class=\ + argparse.RawDescriptionHelpFormatter) + parser.add_argument("--size", dest="size", default=1000, + help="Size (rules) of each OpenFlow table.") + args=parser.parse_args() + + pipeline(int(args.size)) + + +if __name__ == "__main__": + main() diff -Nru openvswitch-2.3.1/utilities/ovs-pki.in openvswitch-2.4.0~git20150623/utilities/ovs-pki.in --- openvswitch-2.3.1/utilities/ovs-pki.in 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-pki.in 2015-06-23 18:46:21.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff -Nru openvswitch-2.3.1/utilities/ovs-save openvswitch-2.4.0~git20150623/utilities/ovs-save --- openvswitch-2.3.1/utilities/ovs-save 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-save 2015-06-23 18:46:21.000000000 +0000 @@ -26,7 +26,7 @@ network interfaces, as well as the system iptables configuration. save-flows Outputs a shell script on stdout that will restore - Openflow flows of each Open vSwitch bridge. + OpenFlow flows of each Open vSwitch bridge. save-ofports Outputs a shell script on stdout that will restore the ofport value across a force-reload-kmod. This script is meant as a helper for the Open vSwitch init script commands. @@ -100,9 +100,10 @@ continue 2 ;; scope) - if test "$2" = link; then + if test "$2" = link -a "$family" != inet6; then # Omit route derived from IP address, e.g. - # 172.16.0.0/16 derived from 172.16.12.34. + # 172.16.0.0/16 derived from 172.16.12.34, + # but preserve IPv6 link-local address. continue 2 fi ;; diff -Nru openvswitch-2.3.1/utilities/ovs-tcpundump.in openvswitch-2.4.0~git20150623/utilities/ovs-tcpundump.in --- openvswitch-2.3.1/utilities/ovs-tcpundump.in 2013-04-09 08:38:09.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-tcpundump.in 2015-06-23 18:46:21.000000000 +0000 @@ -44,7 +44,7 @@ if key in ['-h', '--help']: usage() elif key in ['-V', '--version']: - print "ovs-pcap (Open vSwitch) @VERSION@" + print "ovs-tcpundump (Open vSwitch) @VERSION@" else: sys.exit(0) diff -Nru openvswitch-2.3.1/utilities/ovs-testcontroller.8.in openvswitch-2.4.0~git20150623/utilities/ovs-testcontroller.8.in --- openvswitch-2.3.1/utilities/ovs-testcontroller.8.in 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-testcontroller.8.in 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,173 @@ +.\" -*- nroff -*- +.de IQ +. br +. ns +. IP "\\$1" +.. +.TH ovs\-testcontroller 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual" +.ds PN ovs\-testcontroller +. +.SH NAME +ovs\-testcontroller \- simple OpenFlow controller for testing +. +.SH SYNOPSIS +.B ovs\-testcontroller +[\fIoptions\fR] \fImethod\fR \fB[\fImethod\fR]\&... +. +.SH DESCRIPTION +\fBovs\-testcontroller\fR is a simple OpenFlow controller that manages +any number of switches over the OpenFlow protocol, causing them to +function as L2 MAC-learning switches or hubs. It is suitable for +initial testing of OpenFlow networks. It is not a necessary or +desirable part of a production OpenFlow deployment. +.PP +\fBovs\-testcontroller\fR controls one or more OpenFlow switches, specified as +one or more of the following OpenFlow connection methods: +. +.RS +.so lib/vconn-passive.man +.so lib/vconn-active.man +.RE +. +.SH OPTIONS +.IP "\fB\-n\fR" +.IQ "\fB\-\-noflow\fR" +By default, \fBovs\-testcontroller\fR sets up a flow in each OpenFlow switch +whenever it receives a packet whose destination is known due through +MAC learning. This option disables flow setup, so that every packet +in the network passes through the controller. +.IP +This option is most useful for debugging. It reduces switching +performance, so it should not be used in production. +. +.TP +\fB\-\-max\-idle=\fIsecs\fR|\fBpermanent\fR +Sets \fIsecs\fR as the number of seconds that a flow set up by the +controller will remain in the switch's flow table without any matching +packets being seen. If \fBpermanent\fR is specified, which is not +recommended, flows will never expire. The default is 60 seconds. +.IP +This option has no effect when \fB\-n\fR (or \fB\-\-noflow\fR) is in use +(because the controller does not set up flows in that case). +. +.IP "\fB\-H\fR" +.IQ "\fB\-\-hub\fR" +By default, the controller acts as an L2 MAC-learning switch. This +option changes its behavior to that of a hub that floods packets on +all but the incoming port. +.IP +If \fB\-H\fR (or \fB\-\-hub\fR) and \fB\-n\fR (or \fB\-\-noflow\fR) are used +together, then the cumulative effect is that every packet passes +through the controller and every packet is flooded. +.IP +This option is most useful for debugging. It reduces switching +performance, so it should not be used in production. +. +.IP "\fB\-w\fR[\fIwildcard_mask\fR]" +.IQ "\fB\-\-wildcards\fR[\fB=\fIwildcard_mask\fR]\fR" +By default, \fBovs\-testcontroller\fR sets up exact-match flows. This +option allows it to set up wildcarded flows, which may reduce +flow setup latency by causing less traffic to be sent up to the +controller. +.IP +The optional \fIwildcard_mask\fR is an OpenFlow wildcard bitmask in +hexadecimal that specifies the fields to wildcard. If no +\fIwildcard_mask\fR is specified, the default value 0x2820F0 is used +which specifies L2-only switching and wildcards L3 and L4 fields. +Another interesting value is 0x2000EC, which specifies L3-only +switching and wildcards L2 and L4 fields. +.IP +This option has no effect when \fB\-n\fR (or \fB\-\-noflow\fR) is in use +(because the controller does not set up flows in that case). +. +.IP "\fB\-N\fR" +.IQ "\fB\-\-normal\fR" +By default, \fBovs\-testcontroller\fR directs packets to a particular port +or floods them. This option causes it to direct non-flooded packets +to the OpenFlow \fBOFPP_NORMAL\fR port. This allows the switch itself +to make decisions about packet destinations. Support for +\fBOFPP_NORMAL\fR is optional in OpenFlow, so this option may not well +with some non-Open vSwitch switches. +. +.IP "\fB\-\-mute\fR" +Prevents ovs\-testcontroller from replying to any OpenFlow messages sent +to it by switches. +.IP +This option is only for debugging the Open vSwitch implementation of +``fail open'' mode. It must not be used in production. +. +.IP "\fB\-q \fIid\fR" +.IQ "\fB\-\-queue=\fIid\fR" +By default, \fBovs\-testcontroller\fR uses the default OpenFlow queue for +sending packets and setting up flows. Use one of these options, +supplying \fIid\fR as an OpenFlow queue ID as a decimal number, to +instead use that specific queue. +.IP +This option is incompatible with \fB\-N\fR or \fB\-\-normal\fR and +with \fB\-H\fR or \fB\-\-hub\fR. If more than one is specified then +this option takes precedence. +.IP +This option may be useful for testing or debugging quality of service +setups. +. +.IP "\fB\-Q \fIport-name\fB:\fIqueue-id\fR" +.IP "\fB\-\-port\-queue \fIport-name\fB:\fIqueue-id\fR" +Configures packets received on the port named \fIport-name\fR +(e.g. \fBeth0\fR) to be output on OpenFlow queue ID \fIqueue-id\fR +(specified as a decimal number). For the specified port, this option +overrides the default specified on \fB\-q\fR or \fB\-\-queue\fR. +.IP +This option may be specified any number of times with different +\fIport-name\fR arguments. +.IP +This option is incompatible with \fB\-N\fR or \fB\-\-normal\fR and +with \fB\-H\fR or \fB\-\-hub\fR. If more than one is specified then +this option takes precedence. +.IP +This option may be useful for testing or debugging quality of service +setups. +. +.IP "\fB\-\-with\-flows \fIfile\fR" +When a switch connects, push the flow entries as described in +\fIfile\fR. Each line in \fIfile\fR is a flow entry in the format +described for the \fBadd\-flows\fR command in the \fBFlow Syntax\fR +section of the \fBovs\-ofctl\fR(8) man page. +.IP +Use this option more than once to add flows from multiple files. +. +.SS "Public Key Infrastructure Options" +.so lib/ssl.man +.so lib/ssl-peer-ca-cert.man +.ds DD +.so lib/daemon.man +.so lib/vlog.man +.so lib/unixctl.man +.so lib/common.man +.so lib/ofp-version.man +. +.SH EXAMPLES +.PP +To bind locally to port 6653 (the default) and wait for incoming +connections from OpenFlow switches: +.IP +\fB% ovs\-testcontroller ptcp:\fR +.SH "BUGS" +.PP +Configuring a Citrix XenServer to connect to a particular controller +only points the remote OVSDB management connection to that controller. +It does not also configure OpenFlow connections, because the manager +is expected to do that over the management protocol. +\fBovs\-testcontroller\fR is not an Open vSwitch manager and does not know +how to do that. +.PP +As a stopgap workaround, \fBovs\-vsctl\fR can wait for an OVSDB +connection and set the controller, e.g.: +.IP +\fB% ovs\-vsctl \-t0 \-\-db=pssl: \-\-certificate=cert.pem +\-\-ca\-cert=none \-\-private\-key=privkey.pem +\-\-peer\-ca\-cert=cacert.pem set\-controller ssl:\fIip\fR +.SH "SEE ALSO" +. +.BR ovs\-appctl (8), +.BR ovs\-ofctl (8), +.BR ovs\-dpctl (8) diff -Nru openvswitch-2.3.1/utilities/ovs-testcontroller.c openvswitch-2.4.0~git20150623/utilities/ovs-testcontroller.c --- openvswitch-2.3.1/utilities/ovs-testcontroller.c 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-testcontroller.c 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,407 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "command-line.h" +#include "compiler.h" +#include "daemon.h" +#include "fatal-signal.h" +#include "learning-switch.h" +#include "ofp-parse.h" +#include "ofp-version-opt.h" +#include "ofpbuf.h" +#include "openflow/openflow.h" +#include "poll-loop.h" +#include "rconn.h" +#include "simap.h" +#include "stream-ssl.h" +#include "timeval.h" +#include "unixctl.h" +#include "util.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" +#include "socket-util.h" +#include "ofp-util.h" + +VLOG_DEFINE_THIS_MODULE(controller); + +#define MAX_SWITCHES 16 +#define MAX_LISTENERS 16 + +struct switch_ { + struct lswitch *lswitch; +}; + +/* -H, --hub: Learn the ports on which MAC addresses appear? */ +static bool learn_macs = true; + +/* -n, --noflow: Set up flows? (If not, every packet is processed at the + * controller.) */ +static bool set_up_flows = true; + +/* -N, --normal: Use "NORMAL" action instead of explicit port? */ +static bool action_normal = false; + +/* -w, --wildcard: 0 to disable wildcard flow entries, an OFPFW10_* bitmask to + * enable specific wildcards, or UINT32_MAX to use the default wildcards. */ +static uint32_t wildcards = 0; + +/* --max-idle: Maximum idle time, in seconds, before flows expire. */ +static int max_idle = 60; + +/* --mute: If true, accept connections from switches but do not reply to any + * of their messages (for debugging fail-open mode). */ +static bool mute = false; + +/* -q, --queue: default OpenFlow queue, none if UINT32_MAX. */ +static uint32_t default_queue = UINT32_MAX; + +/* -Q, --port-queue: map from port name to port number. */ +static struct simap port_queues = SIMAP_INITIALIZER(&port_queues); + +/* --with-flows: Flows to send to switch. */ +static struct ofputil_flow_mod *default_flows; +static size_t n_default_flows; +static enum ofputil_protocol usable_protocols; + +/* --unixctl: Name of unixctl socket, or null to use the default. */ +static char *unixctl_path = NULL; + +static void new_switch(struct switch_ *, struct vconn *); +static void parse_options(int argc, char *argv[]); +OVS_NO_RETURN static void usage(void); + +int +main(int argc, char *argv[]) +{ + struct unixctl_server *unixctl; + struct switch_ switches[MAX_SWITCHES]; + struct pvconn *listeners[MAX_LISTENERS]; + int n_switches, n_listeners; + int retval; + int i; + + ovs_cmdl_proctitle_init(argc, argv); + set_program_name(argv[0]); + parse_options(argc, argv); + fatal_ignore_sigpipe(); + + if (argc - optind < 1) { + ovs_fatal(0, "at least one vconn argument required; " + "use --help for usage"); + } + + n_switches = n_listeners = 0; + for (i = optind; i < argc; i++) { + const char *name = argv[i]; + struct vconn *vconn; + + retval = vconn_open(name, get_allowed_ofp_versions(), DSCP_DEFAULT, + &vconn); + if (!retval) { + if (n_switches >= MAX_SWITCHES) { + ovs_fatal(0, "max %d switch connections", n_switches); + } + new_switch(&switches[n_switches++], vconn); + continue; + } else if (retval == EAFNOSUPPORT) { + struct pvconn *pvconn; + retval = pvconn_open(name, get_allowed_ofp_versions(), + DSCP_DEFAULT, &pvconn); + if (!retval) { + if (n_listeners >= MAX_LISTENERS) { + ovs_fatal(0, "max %d passive connections", n_listeners); + } + listeners[n_listeners++] = pvconn; + } + } + if (retval) { + VLOG_ERR("%s: connect: %s", name, ovs_strerror(retval)); + } + } + if (n_switches == 0 && n_listeners == 0) { + ovs_fatal(0, "no active or passive switch connections"); + } + + daemonize_start(); + + retval = unixctl_server_create(unixctl_path, &unixctl); + if (retval) { + exit(EXIT_FAILURE); + } + + daemonize_complete(); + + while (n_switches > 0 || n_listeners > 0) { + /* Accept connections on listening vconns. */ + for (i = 0; i < n_listeners && n_switches < MAX_SWITCHES; ) { + struct vconn *new_vconn; + + retval = pvconn_accept(listeners[i], &new_vconn); + if (!retval || retval == EAGAIN) { + if (!retval) { + new_switch(&switches[n_switches++], new_vconn); + } + i++; + } else { + pvconn_close(listeners[i]); + listeners[i] = listeners[--n_listeners]; + } + } + + /* Do some switching work. . */ + for (i = 0; i < n_switches; ) { + struct switch_ *this = &switches[i]; + lswitch_run(this->lswitch); + if (lswitch_is_alive(this->lswitch)) { + i++; + } else { + lswitch_destroy(this->lswitch); + switches[i] = switches[--n_switches]; + } + } + + unixctl_server_run(unixctl); + + /* Wait for something to happen. */ + if (n_switches < MAX_SWITCHES) { + for (i = 0; i < n_listeners; i++) { + pvconn_wait(listeners[i]); + } + } + for (i = 0; i < n_switches; i++) { + struct switch_ *sw = &switches[i]; + lswitch_wait(sw->lswitch); + } + unixctl_server_wait(unixctl); + poll_block(); + } + + return 0; +} + +static void +new_switch(struct switch_ *sw, struct vconn *vconn) +{ + struct lswitch_config cfg; + struct rconn *rconn; + + rconn = rconn_create(60, 0, DSCP_DEFAULT, get_allowed_ofp_versions()); + rconn_connect_unreliably(rconn, vconn, NULL); + + cfg.mode = (action_normal ? LSW_NORMAL + : learn_macs ? LSW_LEARN + : LSW_FLOOD); + cfg.wildcards = wildcards; + cfg.max_idle = set_up_flows ? max_idle : -1; + cfg.default_flows = default_flows; + cfg.n_default_flows = n_default_flows; + cfg.usable_protocols = usable_protocols; + cfg.default_queue = default_queue; + cfg.port_queues = &port_queues; + cfg.mute = mute; + sw->lswitch = lswitch_create(rconn, &cfg); +} + +static void +add_port_queue(char *s) +{ + char *save_ptr = NULL; + char *port_name; + char *queue_id; + + port_name = strtok_r(s, ":", &save_ptr); + queue_id = strtok_r(NULL, "", &save_ptr); + if (!queue_id) { + ovs_fatal(0, "argument to -Q or --port-queue should take the form " + "\":\""); + } + + if (!simap_put(&port_queues, port_name, atoi(queue_id))) { + ovs_fatal(0, " arguments for -Q or --port-queue must " + "be unique"); + } +} + +static void +parse_options(int argc, char *argv[]) +{ + enum { + OPT_MAX_IDLE = UCHAR_MAX + 1, + OPT_PEER_CA_CERT, + OPT_MUTE, + OPT_WITH_FLOWS, + OPT_UNIXCTL, + VLOG_OPTION_ENUMS, + DAEMON_OPTION_ENUMS, + OFP_VERSION_OPTION_ENUMS + }; + static const struct option long_options[] = { + {"hub", no_argument, NULL, 'H'}, + {"noflow", no_argument, NULL, 'n'}, + {"normal", no_argument, NULL, 'N'}, + {"wildcards", optional_argument, NULL, 'w'}, + {"max-idle", required_argument, NULL, OPT_MAX_IDLE}, + {"mute", no_argument, NULL, OPT_MUTE}, + {"queue", required_argument, NULL, 'q'}, + {"port-queue", required_argument, NULL, 'Q'}, + {"with-flows", required_argument, NULL, OPT_WITH_FLOWS}, + {"unixctl", required_argument, NULL, OPT_UNIXCTL}, + {"help", no_argument, NULL, 'h'}, + DAEMON_LONG_OPTIONS, + OFP_VERSION_LONG_OPTIONS, + VLOG_LONG_OPTIONS, + STREAM_SSL_LONG_OPTIONS, + {"peer-ca-cert", required_argument, NULL, OPT_PEER_CA_CERT}, + {NULL, 0, NULL, 0}, + }; + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); + + for (;;) { + int indexptr; + char *error; + int c; + + c = getopt_long(argc, argv, short_options, long_options, &indexptr); + if (c == -1) { + break; + } + + switch (c) { + case 'H': + learn_macs = false; + break; + + case 'n': + set_up_flows = false; + break; + + case OPT_MUTE: + mute = true; + break; + + case 'N': + action_normal = true; + break; + + case 'w': + wildcards = optarg ? strtol(optarg, NULL, 16) : UINT32_MAX; + break; + + case OPT_MAX_IDLE: + if (!strcmp(optarg, "permanent")) { + max_idle = OFP_FLOW_PERMANENT; + } else { + max_idle = atoi(optarg); + if (max_idle < 1 || max_idle > 65535) { + ovs_fatal(0, "--max-idle argument must be between 1 and " + "65535 or the word 'permanent'"); + } + } + break; + + case 'q': + default_queue = atoi(optarg); + break; + + case 'Q': + add_port_queue(optarg); + break; + + case OPT_WITH_FLOWS: + error = parse_ofp_flow_mod_file(optarg, OFPFC_ADD, &default_flows, + &n_default_flows, + &usable_protocols); + if (error) { + ovs_fatal(0, "%s", error); + } + break; + + case OPT_UNIXCTL: + unixctl_path = optarg; + break; + + case 'h': + usage(); + + VLOG_OPTION_HANDLERS + OFP_VERSION_OPTION_HANDLERS + DAEMON_OPTION_HANDLERS + + STREAM_SSL_OPTION_HANDLERS + + case OPT_PEER_CA_CERT: + stream_ssl_set_peer_ca_cert_file(optarg); + break; + + case '?': + exit(EXIT_FAILURE); + + default: + abort(); + } + } + free(short_options); + + if (!simap_is_empty(&port_queues) || default_queue != UINT32_MAX) { + if (action_normal) { + ovs_error(0, "queue IDs are incompatible with -N or --normal; " + "not using OFPP_NORMAL"); + action_normal = false; + } + + if (!learn_macs) { + ovs_error(0, "queue IDs are incompatible with -H or --hub; " + "not acting as hub"); + learn_macs = true; + } + } +} + +static void +usage(void) +{ + printf("%s: OpenFlow controller\n" + "usage: %s [OPTIONS] METHOD\n" + "where METHOD is any OpenFlow connection method.\n", + program_name, program_name); + vconn_usage(true, true, false); + daemon_usage(); + ofp_version_usage(); + vlog_usage(); + printf("\nOther options:\n" + " -H, --hub act as hub instead of learning switch\n" + " -n, --noflow pass traffic, but don't add flows\n" + " --max-idle=SECS max idle time for new flows\n" + " -N, --normal use OFPP_NORMAL action\n" + " -w, --wildcards[=MASK] wildcard (specified) bits in flows\n" + " -q, --queue=QUEUE-ID OpenFlow queue ID to use for output\n" + " -Q PORT-NAME:QUEUE-ID use QUEUE-ID for frames from PORT-NAME\n" + " --with-flows FILE use the flows from FILE\n" + " --unixctl=SOCKET override default control socket name\n" + " -h, --help display this help message\n" + " -V, --version display version information\n"); + exit(EXIT_SUCCESS); +} diff -Nru openvswitch-2.3.1/utilities/ovs-vlan-bug-workaround.c openvswitch-2.4.0~git20150623/utilities/ovs-vlan-bug-workaround.c --- openvswitch-2.3.1/utilities/ovs-vlan-bug-workaround.c 2014-08-14 20:28:37.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-vlan-bug-workaround.c 2015-06-23 18:46:21.000000000 +0000 @@ -116,7 +116,7 @@ {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0}, }; - char *short_options = long_options_to_short_options(long_options); + char *short_options = ovs_cmdl_long_options_to_short_options(long_options); for (;;) { int option; diff -Nru openvswitch-2.3.1/utilities/ovs-vsctl.8.in openvswitch-2.4.0~git20150623/utilities/ovs-vsctl.8.in --- openvswitch-2.3.1/utilities/ovs-vsctl.8.in 2014-12-04 05:21:56.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-vsctl.8.in 2015-06-23 18:46:21.000000000 +0000 @@ -192,7 +192,8 @@ Creates a ``fake bridge'' named \fIbridge\fR within the existing Open vSwitch bridge \fIparent\fR, which must already exist and must not itself be a fake bridge. The new fake bridge will be on 802.1Q VLAN -\fIvlan\fR, which must be an integer between 0 and 4095. Initially +\fIvlan\fR, which must be an integer between 0 and 4095. The parent +bridge must not already have a fake bridge for \fIvlan\fR. Initially \fIbridge\fR will have no ports (other than \fIbridge\fR itself). .IP Without \fB\-\-may\-exist\fR, attempting to create a bridge that @@ -281,7 +282,9 @@ .IP "[\fB\-\-fake\-iface\fR] \fBadd\-bond \fIbridge port iface\fR\&... [\fIcolumn\fR[\fB:\fIkey\fR]\fR=\fIvalue\fR]\&...\fR" Creates on \fIbridge\fR a new port named \fIport\fR that bonds together the network devices given as each \fIiface\fR. At least two -interfaces must be named. +interfaces must be named. If the interfaces are DPDK enabled then +the transaction will need to include operations to explicitly set the +interface type to 'dpdk'. .IP Optional arguments set values of column in the Port record created by the command. The syntax is the same as that for the \fBset\fR command @@ -446,7 +449,7 @@ Deletes the current SSL configuration. . .IP "[\fB\-\-bootstrap\fR] \fBset\-ssl\fR \fIprivate-key\fR \fIcertificate\fR \fIca-cert\fR" -Sets the SSL configuration. The \fB\-\-bootstrap\fR option is described +Sets the SSL configuration. The \fB\-\-bootstrap\fR option is described below. . .ST "CA Certificate Bootstrap" @@ -469,6 +472,27 @@ as part of the SSL certificate chain. The SSL protocol does not require the controller to send the CA certificate. . +.SS "Auto-Attach Commands" +. +The IETF Auto-Attach SPBM draft standard describes a compact method of using +IEEE 802.1AB Link Layer Discovery Protocol (LLDP) together with a IEEE 802.1aq +Shortest Path Bridging (SPB) network to automatically attach network devices to +individual services in a SPB network. The intent here is to allow network +applications and devices using OVS to be able to easily take advantage of +features offered by industry standard SPB networks. A fundamental element of +the Auto-Attach feature is to map traditional VLANs onto SPB I_SIDs. These +commands manage the Auto-Attach I-SID/VLAN mappings. +. +.IP "\fBadd\-aa\-mapping \fIbridge i-sid vlan\fR" +Creates a new Auto-Attach mapping on \fIbridge\fR for \fIi-sid\fR +and \fIvlan\fR. +. +.IP "\fBdel\-aa\-mapping \fIbridge i-sid vlan\fR" +Deletes an Auto-Attach mapping on \fIbridge\fR for \fIi-sid\fR +and \fIvlan\fR. +.IP "\fBget\-aa\-mapping \fIbridge\fR" +Lists all of the Auto-Attach mappings within \fIbridge\fR on standard output. +. .SS "Database Commands" . These commands query and modify the contents of \fBovsdb\fR tables. @@ -532,6 +556,8 @@ .IP "\fBFlow_Sample_Collector_Set\fR" An IPFIX exporter configuration attached to a bridge for sampling packets on a per-flow basis using OpenFlow \fBsample\fR actions. +.IP "\fBAutoAttach\fR" +Configuration for Auto Attach within a bridge. .PP Record names must be specified in full and with correct capitalization. Names of tables and columns are not case-sensitive, @@ -805,7 +831,7 @@ .B "ovs\-vsctl add\-port br0 eth0" .PP Alternatively, perform both operations in a single atomic transaction: -.IP +.IP .B "ovs\-vsctl add\-br br0 \-\- add\-port br0 eth0" .PP Delete bridge \fBbr0\fR, reporting an error if it does not exist: @@ -940,11 +966,15 @@ Configure bridge \fBbr0\fR to send one IPFIX flow record per packet sample to UDP port 4739 on host 192.168.0.34, with Observation Domain ID 123 and Observation Point ID 456, a flow cache active timeout of 1 -minute (60 seconds), and a maximum flow cache size of 13 flows: +minute (60 seconds), maximum flow cache size of 13 flows, and flows +sampled on output port with tunnel info(sampling on input and output +port is enabled by default if not disabled) : .IP .B "ovs\-vsctl \-\- set Bridge br0 ipfix=@i \(rs" .IP -.B "\-\- \-\-id=@i create IPFIX targets=\(rs\(dq192.168.0.34:4739\(rs\(dq obs_domain_id=123 obs_point_id=456 cache_active_timeout=60 cache_max_flows=13" +.B "\-\- \-\-id=@i create IPFIX targets=\(rs\(dq192.168.0.34:4739\(rs\(dq obs_domain_id=123 obs_point_id=456 cache_active_timeout=60 cache_max_flows=13 \(rs" +.IP +.B "other_config:enable-input-sampling=false other_config:enable-tunnel-sampling=true" .PP Deconfigure the IPFIX settings from \fBbr0\fR, which also destroys the IPFIX record (since it is now unreferenced): @@ -968,13 +998,143 @@ .IP .B "ovs\-vsctl set Bridge br0 stp_enable=false" .PP +.SS "Multicast Snooping" +.PP +Configure bridge \fBbr0\fR to enable multicast snooping: +.IP +.B "ovs\-vsctl set Bridge br0 mcast_snooping_enable=true" +.PP +Set the multicast snooping aging time \fBbr0\fR to 300 seconds: +.IP +.B "ovs\-vsctl set Bridge br0 other_config:mcast-snooping-aging-time=300" +.PP +Set the multicast snooping table size \fBbr0\fR to 2048 entries: +.IP +.B "ovs\-vsctl set Bridge br0 other_config:mcast-snooping-table-size=2048" +.PP +Disable flooding of unregistered multicast packets to all ports. When +set to \fBtrue\fR, the switch will send unregistered multicast packets only +to ports connected to multicast routers. When it is set to \fBfalse\fR, the +switch will send them to all ports. This command disables the flood of +unregistered packets on bridge \fBbr0\fR. +.IP +.B "ovs\-vsctl set Bridge br0 other_config:mcast-snooping-disable-flood-unregistered=true" +.PP +Enable flooding of multicast packets (except Reports) on a specific port. +.IP +.B "ovs\-vsctl set Port eth1 other_config:mcast-snooping-flood=true" +.PP +Enable flooding of Reports on a specific port. +.IP +.B "ovs\-vsctl set Port eth1 other_config:mcast-snooping-flood-reports=true" +.PP +Deconfigure multicasting snooping from above: +.IP +.B "ovs\-vsctl set Bridge br0 mcast_snooping_enable=false" +.PP +.SS "802.1D-2004 Rapid Spanning Tree Protocol (RSTP)" +.PP +Configure bridge \fBbr0\fR to participate in an 802.1D-2004 Rapid Spanning Tree: +.IP +.B "ovs\-vsctl set Bridge br0 rstp_enable=true" +.PP +Set the bridge address of \fBbr0\fR to 00:aa:aa:aa:aa:aa : +.IP +.B "ovs\-vsctl set Bridge br0 other_config:rstp-address=00:aa:aa:aa:aa:aa" +.PP +Set the bridge priority of \fBbr0\fR to 0x7000. The value must be specified in +decimal notation and should be a multiple of 4096 (if not, it is rounded down to +the nearest multiple of 4096). The default priority value is 0x800 (32768). +.IP +.B "ovs\-vsctl set Bridge br0 other_config:rstp-priority=28672" +.PP +Set the bridge ageing time of \fBbr0\fR to 1000 s. The ageing time value should be +between 10 s and 1000000 s. The default value is 300 s. +.IP +.B "ovs\-vsctl set Bridge br0 other_config:rstp-ageing-time=1000" +.PP +Set the bridge force protocol version of \fBbr0\fR to 0. The force protocol version +has two acceptable values: 0 (STP compatibility mode) and 2 (normal operation). +.IP +.B "ovs\-vsctl set Bridge br0 other_config:rstp-force-protocol-version=0" +.PP +Set the bridge max age of \fBbr0\fR to 10 s. The max age value should be between 6 s +and 40 s. The default value is 20 s. +.IP +.B "ovs\-vsctl set Bridge br0 other_config:rstp-max-age=10" +.PP +Set the bridge forward delay of \fBbr0\fR to 15 s. +This value should be between 4 s and 30 s. The default value is 15 s. +.IP +.B "ovs\-vsctl set Bridge br0 other_config:rstp-forward-delay=15" +.PP +Set the bridge transmit hold count of \fBbr0\fR to 7 s. This value should be between +1 s and 10 s. The default value is 6 s. +.IP +.B "ovs\-vsctl set Bridge br0 other_config:rstp-transmit-hold-count=7" +.PP +Enable RSTP on the Port \fBeth0\fR: +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-enable=true" +.PP +Disable RSTP on the Port \fBeth0\fR: +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-enable=false" +.PP +Set the priority of port \fBeth0\fR to 32. The value must be specified in +decimal notation and should be a multiple of 16 (if not, it is rounded down to the +nearest multiple of 16). The default priority value is 0x80 (128). +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-port-priority=32" +.PP +Set the port number of port \fBeth0\fR to 3: +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-port-num=3" +.PP +Set the path cost of port \fBeth0\fR to 150: +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-path-cost=150" +.PP +Set the admin edge value of port \fBeth0\fR: +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-port-admin-edge=true" +.PP +Set the auto edge value of port \fBeth0\fR: +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-port-auto-edge=true" +.PP +Set the admin point to point MAC value of port \fBeth0\fR. Acceptable +values are \fB0\fR (not point-to-point), \fB1\fR (point-to-point, the +default value) or \fB2\fR (automatic detection). The auto-detection +mode is not currently implemented, and the value \fB2\fR has the same +effect of \fB0\fR (not point-to-point). +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-admin-p2p-mac=1" +.PP +Set the admin port state value of port \fBeth0\fR. \fBtrue\fR is the +default value. +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-admin-port-state=false" +.PP +Set the mcheck value of port \fBeth0\fR: +.IP +.B "ovs\-vsctl set Port eth0 other_config:rstp-port-mcheck=true" +.PP +Deconfigure RSTP from above: +.IP +.B "ovs\-vsctl set Bridge br0 rstp_enable=false" +.PP .SS "OpenFlow Version" .PP Configure bridge \fBbr0\fR to support OpenFlow versions 1.0, 1.2, and 1.3: .IP -.B "ovs\-vsctl set bridge br0 protocols=openflow10,openflow12,openflow13" +.B "ovs\-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow12,OpenFlow13" . +.SS "Flow Table Configuration" +Limit flow table 0 on bridge br0 to a maximum of 100 flows: +.IP +.B "ovs\-vsctl \-\- \-\-id=@ft create Flow_Table flow_limit=100 overflow_policy=refuse \-\- set Bridge br0 flow_tables=0=@ft" .SH "EXIT STATUS" .IP "0" Successful program execution. diff -Nru openvswitch-2.3.1/utilities/ovs-vsctl-bashcomp.bash openvswitch-2.4.0~git20150623/utilities/ovs-vsctl-bashcomp.bash --- openvswitch-2.3.1/utilities/ovs-vsctl-bashcomp.bash 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-vsctl-bashcomp.bash 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,825 @@ +SAVE_IFS=$IFS +IFS=" +" +_OVSDB_SERVER_LOCATION="" + +# Run ovs-vsctl and make sure that ovs-vsctl is always called with +# the correct --db argument. +_ovs_vsctl () { + local _db + + if [ -n "$_OVSDB_SERVER_LOCATION" ]; then + _db="--db=$_OVSDB_SERVER_LOCATION" + fi + ovs-vsctl ${_db} "$@" +} + +# ovs-vsctl --commands outputs in this format: +# +# main = ,, +# localopts = ([] )* +# localopt = --[^]]* +# name = [^,]* +# arguments = ((!argument|?argument|*argument|+argument) )* +# argument = ([^ ]*|argument\|argument) +# +# The [] characters in local options are just delimiters. The +# argument prefixes mean: +# !argument :: The argument is required +# ?argument :: The argument is optional +# *argument :: The argument may appear any number (0 or more) times +# +argument :: The argument may appear one or more times +# A bar (|) character in an argument means thing before bar OR thing +# after bar; for example, del-port can take a port or an interface. + +_OVS_VSCTL_COMMANDS="$(_ovs_vsctl --commands)" + +# This doesn't complete on short arguments, so it filters them out. +_OVS_VSCTL_OPTIONS="$(_ovs_vsctl --options | awk '/^--/ { print $0 }' \ + | sed -e 's/\(.*\)=ARG/\1=/')" +IFS=$SAVE_IFS + +declare -A _OVS_VSCTL_PARSED_ARGS +declare -A _OVS_VSCTL_NEW_RECORDS + +# This is a convenience function to make sure that user input is +# looked at as a fixed string when being compared to something. $1 is +# the input; this behaves like 'grep "^$1"' but deals with regex +# metacharacters in $1. +_ovs_vsctl_check_startswith_string () { + awk 'index($0, thearg)==1' thearg="$1" +} + +# $1 = word to complete on. +# Complete on global options. +_ovs_vsctl_bashcomp_globalopt () { + local options result + + options="" + result=$(printf "%s\n" "${_OVS_VSCTL_OPTIONS}" \ + | _ovs_vsctl_check_startswith_string "${1%=*}") + if [[ $result =~ "=" ]]; then + options="NOSPACE" + fi + printf -- "${options}\nEO\n${result}" +} + +# $1 = word to complete on. +# Complete on local options. +_ovs_vsctl_bashcomp_localopt () { + local options result possible_opts + + possible_opts=$(printf "%s\n" "${_OVS_VSCTL_COMMANDS}" | cut -f1 -d',') + # This finds all options that could go together with the + # already-seen ones + for prefix_arg in $1; do + possible_opts=$(printf "%s\n" "$possible_opts" \ + | grep -- "\[${prefix_arg%%=*}=\?\]") + done + result=$(printf "%s\n" "${possible_opts}" \ + | tr ' ' '\n' | tr -s '\n' | sort | uniq) + # This removes the already-seen options from the list so that + # users aren't completed for the same option twice. + for prefix_arg in $1; do + result=$(printf "%s\n" "${result}" \ + | grep -v -- "\[${prefix_arg%%=*}=\?\]") + done + result=$(printf "%s\n" "${result}" | sed -ne 's/\[\(.*\)\]/\1/p' \ + | _ovs_vsctl_check_startswith_string "$2") + if [[ $result =~ "=" ]]; then + options="NOSPACE" + fi + printf -- "${options}\nEO\n${result}" +} + +# $1 = given local options. +# $2 = word to complete on. +# Complete on command that could contain the given local options. +_ovs_vsctl_bashcomp_command () { + local result possible_cmds + + possible_cmds=$(printf "%s\n" "${_OVS_VSCTL_COMMANDS}") + for prefix_arg in $1; do + possible_cmds=$(printf "%s\n" "$possible_cmds" \ + | grep -- "\[$prefix_arg=\?\]") + done + result=$(printf "%s\n" "${possible_cmds}" \ + | cut -f2 -d',' \ + | _ovs_vsctl_check_startswith_string "$2") + printf -- "${result}" +} + +# $1 = completion result to check. +# Return 0 if the completion result is non-empty, otherwise return 1. +_ovs_vsctl_detect_nonzero_completions () { + local tmp newarg + + newarg=${1#*EO} + readarray tmp <<< "$newarg" + if [ "${#tmp[@]}" -eq 1 ] && [ "${#newarg}" -eq 0 ]; then + return 1 + fi + return 0 +} + +# $1 = argument format to expand. +# Expand '+ARGUMENT' in argument format to '!ARGUMENT *ARGUMENT'. +_ovs_vsctl_expand_command () { + result=$(printf "%s\n" "${_OVS_VSCTL_COMMANDS}" \ + | grep -- ",$1," | cut -f3 -d',' | tr ' ' '\n' \ + | awk '/\+.*/ { name=substr($0,2); + print "!"name; print "*"name; next; } + 1') + printf -- "${result}\n!--" +} + +# $1 = word to complete on. +# Complete on table. +_ovs_vsctl_complete_table () { + local result + + result=$(ovsdb-client --no-heading list-tables $_OVSDB_SERVER_LOCATION Open_vSwitch \ + | _ovs_vsctl_check_startswith_string "$1") + printf -- "EO\n%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on record. Provide both the name and uuid. +_ovs_vsctl_complete_record () { + local table uuids names new_record + + table="${_OVS_VSCTL_PARSED_ARGS[TABLE]}" + new_record="${_OVS_VSCTL_NEW_RECORDS[${table^^}]}" + # Tables should always have an _uuid column + uuids=$(_ovs_vsctl --no-heading -f table -d bare --columns=_uuid \ + list $table | _ovs_vsctl_check_startswith_string "$1") + # Names don't always exist, silently ignore if the name column is + # unavailable. + names=$(_ovs_vsctl --no-heading -f table -d bare \ + --columns=name list $table \ + 2>/dev/null \ + | _ovs_vsctl_check_startswith_string "$1") + printf -- "EO\n%s\n%s\n%s\n" "${uuids}" "${names}" "${new_record}" +} + +# $1 = word to complete on. +# Complete on bridge. +_ovs_vsctl_complete_bridge () { + local result + + result=$(_ovs_vsctl list-br | _ovs_vsctl_check_startswith_string "$1") + printf -- "EO\n%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on port. If a bridge has already been specified, +# just complete for that bridge. +_ovs_vsctl_complete_port () { + local ports result + + if [ -n "${_OVS_VSCTL_PARSED_ARGS[BRIDGE]}" ]; then + ports=$(_ovs_vsctl list-ports "${_OVS_VSCTL_PARSED_ARGS[BRIDGE]}") + else + local all_ports + all_ports=$(_ovs_vsctl --format=table \ + --no-headings \ + --columns=name \ + list Port) + ports=$(printf "$all_ports" | tr -d '" ' | sort -u) + fi + result=$(_ovs_vsctl_check_startswith_string "$1" <<< "$ports") + printf -- "EO\n%s\n" "${result}" +} + +# $1: Atom to complete (as usual) +# $2: Table to complete the key in +# $3: Column to find keys in +# $4: Prefix for each completion +# Complete on key based on given table and column info. +_ovs_vsctl_complete_key_given_table_column () { + local keys + + keys=$(_ovs_vsctl --no-heading --columns="$3" list \ + "$2" \ + | tr -d '{\"}' | tr -s ', ' '\n' | cut -d'=' -f1 \ + | xargs printf "$4%s\n" | _ovs_vsctl_check_startswith_string "$4$1") + result="${keys}" + printf -- "%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on key. +__complete_key () { + # KEY is used in both br-set-external-id/br-get-external id (in + # which case it is implicitly a key in the external-id column) and + # in remove, where it is a table key. This checks to see if table + # is set (the remove scenario), and then decides what to do. + local result + + if [ -n "${_OVS_VSCTL_PARSED_ARGS[TABLE]}" ]; then + local column=$(tr -d '\n' <<< ${_OVS_VSCTL_PARSED_ARGS["COLUMN"]}) + result=$(_ovs_vsctl_complete_key_given_table_column \ + "$1" \ + ${_OVS_VSCTL_PARSED_ARGS["TABLE"]} \ + $column \ + "") + else + result=$(_ovs_vsctl br-get-external-id \ + ${_OVS_VSCTL_PARSED_ARGS["BRIDGE"]} \ + | cut -d'=' -f1 | _ovs_vsctl_check_startswith_string "$1") + fi + printf -- "%s" "${result}" +} + +# $1 = word to complete on. +# Complete on key. +_ovs_vsctl_complete_key () { + # KEY is used in both br-set-external-id/br-get-external id (in + # which case it is implicitly a key in the external-id column) and + # in remove, where it is a table key. This checks to see if table + # is set (the remove scenario), and then decides what to do. + local result + + result="$(__complete_key $1)" + # If result is empty, just use user input as result. + if [ -z "$result" ]; then + result=$1 + fi + printf -- "EO\n%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on value. +_ovs_vsctl_complete_value () { + local result + + # Just use user input as result. + result=$1 + + printf -- "EO\n%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on key=value. +_ovs_vsctl_complete_key_value () { + local orig_completions new_completions + + orig_completions=$(__complete_key "$1") + for completion in ${orig_completions#*EO}; do + new_completions="${new_completions} ${completion}=" + done + # If 'new_completions' is empty, just use user input as result. + if [ -z "$new_completions" ]; then + new_completions=$1 + fi + printf -- "NOSPACE\nEO\n%s" "${new_completions}" +} + +# $1 = word to complete on. +# Complete on column. +_ovs_vsctl_complete_column () { + local columns result + + columns=$(ovsdb-client --no-headings list-columns $_OVSDB_SERVER_LOCATION \ + Open_vSwitch ${_OVS_VSCTL_PARSED_ARGS["TABLE"]}) + result=$(printf "%s\n" "${columns}" \ + | tr -d ':' | cut -d' ' -f1 \ + | _ovs_vsctl_check_startswith_string "$1" | sort | uniq) + printf -- "EO\n%s\n" "${result}" +} + +# Extract all system interfaces. +_ovs_vsctl_get_sys_intf () { + local result + + case "$(uname -o)" in + *Linux*) + result=$(ip -o link 2>/dev/null | cut -d':' -f2 \ + | sed -e 's/^ \(.*\)/\1/') + ;; + *) + result=$(ifconfig -a -s 2>/dev/null | cut -f1 -d' ' | tail -n +2) + ;; + esac + printf "%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on system interface. +_ovs_vsctl_complete_sysiface () { + local result + + result=$(_ovs_vsctl_get_sys_intf | _ovs_vsctl_check_startswith_string "$1") + printf -- "EO\n%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on interface. If a bridge has already been specified, +# just complete for that bridge. +_ovs_vsctl_complete_iface () { + local result + + if [ -n "${_OVS_VSCTL_PARSED_ARGS[BRIDGE]}" ]; then + result=$(_ovs_vsctl list-ifaces "${_OVS_VSCTL_PARSED_ARGS[BRIDGE]}") + else + for bridge in $(_ovs_vsctl list-br); do + local ifaces + + ifaces=$(_ovs_vsctl list-ifaces "${bridge}") + result="${result} ${ifaces}" + done + fi + printf "EO\n%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on COLUMN?:KEY=VALUE. +_ovs_vsctl_complete_column_optkey_value () { + local result column key value completion + + column=$(printf "%s\n" "$1" | cut -d '=' -f1 | cut -d':' -f1) + key=$(printf "%s\n" "$1" | cut -d '=' -f1 | cut -s -d':' -f2) + # The tr -d '\n' <<< makes sure that there are no leading or + # trailing accidental newlines. + table=$(tr -d '\n' <<< ${_OVS_VSCTL_PARSED_ARGS["TABLE"]}) + # This might also be called after add-port or add-bond; in those + # cases, the table should implicitly be assumed to be "Port". + # This is done by checking if a NEW- parameter has been + # encountered and, if it has, using that type without the NEW- as + # the table. + if [ -z "$table" ]; then + if [ -n ${_OVS_VSCTL_PARSED_ARGS["NEW-PORT"]} ] \ + || [ -n ${_OVS_VSCTL_PARSED_ARGS["NEW-BOND-PORT"]} ]; then + table="Port" + fi + fi + if [ -z "$key" ]; then + local columns=$(ovsdb-client --no-headings list-columns \ + $_OVSDB_SERVER_LOCATION Open_vSwitch $table) + + result=$(printf "%s\n" "${columns}" \ + | awk '/key.*value/ { print $1":"; next } + { print $1; next }' \ + | _ovs_vsctl_check_startswith_string "$1" | sort | uniq) + fi + if [[ $1 =~ ":" ]]; then + result=$(_ovs_vsctl_complete_key_given_table_column \ + "$key" "$table" "$column" "$column:") + fi + # If result is empty, just use user input as result. + if [ -z "$result" ]; then + result=$1 + fi + printf -- "NOSPACE\nEO\n%s\n" "${result}" +} + +# $1 = word to complete on. +# Complete on filename. +_ovs_vsctl_complete_filename () { + local result + + result=$(compgen -o filenames -A file "$1") + printf -- "EO\n%s\n" "${result}" +} + +_ovs_vsctl_complete_bridge_fail_mode () { + printf -- "EO\nstandalone\nsecure" +} + +# $1 = word to complete on. +# Complete on target. +_ovs_vsctl_complete_target () { + local result + + if [[ "$1" =~ ^p?u ]]; then + local protocol pathname expansion_base result + + protocol=$(cut -d':' -f1 <<< "$1") + pathname=$(cut -s -d':' -f2 <<< "$1") + expansion_base=$(compgen -W "unix punix" "$protocol") + expansion_base="$expansion_base:" + result=$(compgen -o filenames -A file \ + -P $expansion_base "${pathname}") + printf -- "NOSPACE\nEO\n%s\n" "${result}" + else + printf -- "NOSPACE\nEO\nssl:\ntcp:\nunix:\npssl:\nptcp:\npunix:" + fi +} + +# Extract PS1 prompt. +_ovs_vsctl_get_PS1 () { + if [ "$test" = "true" ]; then + printf -- "> " + return; + fi + + # Original inspiration from + # http://stackoverflow.com/questions/10060500/bash-how-to-evaluate-ps1-ps2, + # but changed quite a lot to make it more robust. + + # Make sure the PS1 used doesn't include any of the special + # strings used to identify the prompt + myPS1="$(sed 's/Begin prompt/\\Begin prompt/; s/End prompt/\\End prompt/' <<< "$PS1")" + # Export the current environment in case the prompt uses any + vars="$(env | cut -d'=' -f1)" + for var in $vars; do export $var; done + funcs="$(declare -F | cut -d' ' -f3)" + for func in $funcs; do export -f $func; done + # Get the prompt + v="$(bash --norc --noprofile -i 2>&1 <<< $'PS1=\"'"$myPS1"$'\" \n# Begin prompt\n# End prompt')" + v="${v##*# Begin prompt}" + printf -- "$(tail -n +2 <<< "${v%# End prompt*}" | sed 's/\\Begin prompt/Begin prompt/; s/\\End prompt/End prompt/')" + +} + +# Request a new value from user. Nothing to complete on. +_ovs_vsctl_complete_new () { + local two_word_type message result + + if [ ! "$1" = "--" ]; then + two_word_type="${2/-/ }" + message="\nEnter a ${two_word_type,,}:\n$(_ovs_vsctl_get_PS1)$COMP_LINE" + if [ -n "$1" ]; then + result="$1" + fi + printf -- "NOCOMP\nBM%sEM\nEO\n%s\n" "${message}" "${result}" + fi +} + +_ovs_vsctl_complete_dashdash () { + printf -- "EO\n%s\n" "--" +} + + +# These functions are given two arguments: +# +# $1 is the word being completed +# +# $2 is the type of completion --- only currently useful for the +# NEW-* functions. +# +# Note that the NEW-* functions actually are ``completed''; currently +# the completions are just used to save the fact that they have +# appeared for later use (i.e. implicit table calculation). +# +# The output is of the form EO, where EO stands +# for end options. Currently available options are: +# - NOSPACE: Do not add a space at the end of each completion +# - NOCOMP: Do not complete, but store the output of the completion +# func in _OVS_VSCTL_PARSED_ARGS for later usage. +# - BMEM: Print the +declare -A _OVS_VSCTL_ARG_COMPLETION_FUNCS=( + ["TABLE"]=_ovs_vsctl_complete_table + ["RECORD"]=_ovs_vsctl_complete_record + ["BRIDGE"]=_ovs_vsctl_complete_bridge + ["PARENT"]=_ovs_vsctl_complete_bridge + ["PORT"]=_ovs_vsctl_complete_port + ["KEY"]=_ovs_vsctl_complete_key + ["VALUE"]=_ovs_vsctl_complete_value + ["ARG"]=_ovs_vsctl_complete_value + ["IFACE"]=_ovs_vsctl_complete_iface + ["SYSIFACE"]=_ovs_vsctl_complete_sysiface + ["COLUMN"]=_ovs_vsctl_complete_column + ["COLUMN?:KEY"]=_ovs_vsctl_complete_column_optkey_value + ["COLUMN?:KEY=VALUE"]=_ovs_vsctl_complete_column_optkey_value + ["KEY=VALUE"]=_ovs_vsctl_complete_key_value + ["?KEY=VALUE"]=_ovs_vsctl_complete_key_value + ["PRIVATE-KEY"]=_ovs_vsctl_complete_filename + ["CERTIFICATE"]=_ovs_vsctl_complete_filename + ["CA-CERT"]=_ovs_vsctl_complete_filename + ["MODE"]=_ovs_vsctl_complete_bridge_fail_mode + ["TARGET"]=_ovs_vsctl_complete_target + ["NEW-BRIDGE"]=_ovs_vsctl_complete_new + ["NEW-PORT"]=_ovs_vsctl_complete_new + ["NEW-BOND-PORT"]=_ovs_vsctl_complete_new + ["NEW-VLAN"]=_ovs_vsctl_complete_new + ["--"]=_ovs_vsctl_complete_dashdash +) + +# $1: Argument type, may include vertical bars to mean OR +# $2: Beginning of completion +# +# Note that this checks for existance in +# _OVS_VSCTL_ARG_COMPLETION_FUNCS; if the argument type ($1) is not +# there it will fail gracefully. +_ovs_vsctl_possible_completions_of_argument () { + local possible_types completions tmp + + completions="EO" + + possible_types=$(printf "%s\n" "$1" | tr '|' '\n') + for type in $possible_types; do + if [ ${_OVS_VSCTL_ARG_COMPLETION_FUNCS["${type^^}"]} ]; then + tmp=$(${_OVS_VSCTL_ARG_COMPLETION_FUNCS["${type^^}"]} \ + "$2" "${type^^}") + tmp_noEO="${tmp#*EO}" + tmp_EO="${tmp%%EO*}" + completions=$(printf "%s%s\n%s" "${tmp_EO}" \ + "${completions}" "${tmp_noEO}") + fi + done + printf "%s\n" "${completions}" +} + +# $1 = List of argument types +# $2 = current pointer into said list +# $3 = word to complete on +# Outputs list of possible completions +# The return value is the index in the cmd_args($1) list that should +# next be matched, if only one of them did, or 254 if there are no +# matches, so it doesn't know what comes next. +_ovs_vsctl_complete_argument() { + local cmd_args arg expansion index + + new=$(printf "%s\n" "$1" | grep -- '.\+') + readarray -t cmd_args <<< "$new"; + arg=${cmd_args[$2]} + case ${arg:0:1} in + !) + expansion=$(_ovs_vsctl_possible_completions_of_argument \ + "${arg:1}" $3) + index=$(($2+1)) + ;; + \?|\*) + local tmp1 tmp2 arg2_index tmp2_noEO tmp2_EO + tmp1=$(_ovs_vsctl_possible_completions_of_argument "${arg:1}" $3) + tmp2=$(_ovs_vsctl_complete_argument "$1" "$(($2+1))" "$3") + arg2_index=$? + if _ovs_vsctl_detect_nonzero_completions "$tmp1" \ + && _ovs_vsctl_detect_nonzero_completions "$tmp2"; then + if [ "${arg:0:1}" = "*" ]; then + index=$2; + else + index=$(($2+1)); + fi + fi + if _ovs_vsctl_detect_nonzero_completions "$tmp1" \ + && (! _ovs_vsctl_detect_nonzero_completions "$tmp2"); then + if [ "${arg:0:1}" = "*" ]; then + index=$2; + else + index=$(($2+1)); + fi + fi + if (! _ovs_vsctl_detect_nonzero_completions "$tmp1") \ + && _ovs_vsctl_detect_nonzero_completions "$tmp2"; then + index=$arg2_index + fi + if (! _ovs_vsctl_detect_nonzero_completions "$tmp1") \ + && (! _ovs_vsctl_detect_nonzero_completions "$tmp2"); then + index=254 + fi + # Don't allow secondary completions to inhibit primary + # completions: + if [[ $tmp2 =~ ^([^E]|E[^O])*NOCOMP ]]; then + tmp2="" + fi + tmp2_noEO="${tmp2#*EO}" + tmp2_EO="${tmp2%%EO*}" + expansion=$(printf "%s%s\n%s" "${tmp2_EO}" \ + "${tmp1}" "${tmp2_noEO}") + ;; + esac + printf "%s\n" "$expansion" + return $index +} + +_ovs_vsctl_detect_nospace () { + if [[ $1 =~ ^([^E]|E[^O])*NOSPACE ]]; then + _OVS_VSCTL_COMP_NOSPACE=true + fi +} + +_ovs_vsctl_process_messages () { + local message + + message="${1#*BM}" + message="${message%%EM*}" + if [ "$test" = "true" ]; then + printf -- "--- BEGIN MESSAGE" + fi + printf "${message}" + if [ "$test" = "true" ]; then + printf -- "--- END MESSAGE" + fi +} + +# colon, equal sign will mess up the completion output, just +# removes the colon-word and equal-word prefix from COMPREPLY items. +# +# Implementation of this function refers to the __ltrim_colon_completions +# function defined in bash_completion module. +# +# $1: Current argument +# $2: $COMP_WORDBREAKS +# $3: ${COMPREPLY[@]} +_ovs_vsctl_trim_compreply() { + local cur comp_wordbreaks + local compreply + + cur=$1 && shift + comp_wordbreaks=$1 && shift + compreply=( $@ ) + + if [[ "$cur" == *:* && "$comp_wordbreaks" == *:* ]]; then + local colon_word=${cur%${cur##*:}} + local i=${#compreply[*]} + cur=${cur##*:} + while [ $((--i)) -ge 0 ]; do + compreply[$i]=${compreply[$i]#"$colon_word"} + done + fi + + if [[ "$cur" == *=* && "$comp_wordbreaks" == *=* ]]; then + local equal_word=${cur%${cur##*=}} + local i=${#compreply[*]} + while [ $((--i)) -ge 0 ]; do + compreply[$i]=${compreply[$i]#"$equal_word"} + done + fi + + printf "%s " "${compreply[@]}" +} + +# The general strategy here is that the same functions that decide +# completions can also capture the necessary context for later +# completions. This means that there is no distinction between the +# processing for words that are not the current word and words that +# are the current word. +# +# Parsing up until the command word happens starts with everything +# valid; as the syntax order of ovs-vsctl is fairly strict, when types +# of words that preclude other words from happending can turn them +# off; this is controlled by valid_globals, valid_opts, and +# valid_commands. given_opts is used to narrow down which commands +# are valid based on the previously given options. +# +# After the command has been detected, the parsing becomes more +# complicated. The cmd_pos variable is set to 0 when the command is +# detected; it is used as a pointer into an array of the argument +# types for that given command. The argument types are stored in both +# cmd_args and raw_cmd as the main loop uses properties of arrays to +# detect certain conditions, but arrays cannot be passed to functions. +# To be able to deal with optional or repeatable arguments, the exit +# status of the function _ovs_vsctl_complete_argument represents where +# it has determined that the next argument will be. +_ovs_vsctl_bashcomp () { + local words cword valid_globals cmd_args raw_cmd cmd_pos valid_globals valid_opts + local test="false" + + # Does not support BASH_VERSION < 4.0 + if [ ${BASH_VERSINFO[0]} -lt 4 ]; then + return 0 + fi + + # Prepare the COMP_* variables based on input. + if [ "$1" = "test" ]; then + test="true" + export COMP_LINE="ovs-vsctl $2" + tmp="ovs-vsctl"$'\n'"$(tr ' ' '\n' <<< "${COMP_LINE}x")" + tmp="${tmp%x}" + readarray -t COMP_WORDS \ + <<< "$tmp" + export COMP_WORDS + export COMP_CWORD="$((${#COMP_WORDS[@]}-1))" + else + # If not in test mode, reassembles the COMP_WORDS and COMP_CWORD + # using just space as word break. + _get_comp_words_by_ref -n "\"'><=;|&(:" -w words -i cword + COMP_WORDS=( "${words[@]}" ) + COMP_CWORD=${cword} + fi + + # Extract the conf.db path. + db=$(sed -n 's/.*--db=\([^ ]*\).*/\1/p' <<< "$COMP_LINE") + if [ -n "$db" ]; then + _OVSDB_SERVER_LOCATION="$db" + fi + + # If having trouble accessing the database, return. + if ! _ovs_vsctl get-manager 1>/dev/null 2>/dev/null; then + return 1; + fi + + _OVS_VSCTL_PARSED_ARGS=() + _OVS_VSCTL_NEW_RECORDS=() + cmd_pos=-1 + valid_globals=true + valid_opts=true + valid_commands=true + given_opts="" + index=1 + for word in "${COMP_WORDS[@]:1:${COMP_CWORD}} "; do + _OVS_VSCTL_COMP_NOSPACE=false + local completion + completion="" + if [ $cmd_pos -gt -1 ]; then + local tmp tmp_noop arg possible_newindex + tmp=$(_ovs_vsctl_complete_argument "$raw_cmd" "$cmd_pos" "$word") + possible_newindex=$? + # Check for nospace. + _ovs_vsctl_detect_nospace $tmp + # Remove all options. + tmp_noop="${tmp#*EO}" + + # Allow commands to specify that they should not be + # completed + if ! [[ $tmp =~ ^([^E]|E[^O])*NOCOMP ]]; then + # Directly assignment, since 'completion' is guaranteed to + # to be empty. + completion="$tmp_noop" + # If intermediate completion is empty, it means that the current + # argument is invalid. And we should not continue. + if [ $index -lt $COMP_CWORD ] \ + && (! _ovs_vsctl_detect_nonzero_completions "$completion"); then + _ovs_vsctl_process_messages "BM\nCannot complete \'${COMP_WORDS[$index]}\' at index ${index}:\n$(_ovs_vsctl_get_PS1)${COMP_LINE}EM\nEO\n" + return 1 + fi + else + # Only allow messages when there is no completion + # printout and when on the current word. + if [ $index -eq $COMP_CWORD ]; then + _ovs_vsctl_process_messages "${tmp}" + fi + # Append the new record to _OVS_VSCTL_NEW_RECORDS. + _OVS_VSCTL_NEW_RECORDS["${cmd_args[$cmd_pos]##*-}"]="${_OVS_VSCTL_NEW_RECORDS["${cmd_args[$cmd_pos]##*-}"]} $tmp_noop" + fi + if [[ $cmd_pos -lt ${#cmd_args} ]]; then + _OVS_VSCTL_PARSED_ARGS["${cmd_args[$cmd_pos]:1}"]=$word + fi + if [ $possible_newindex -lt 254 ]; then + cmd_pos=$possible_newindex + fi + fi + + if [ $valid_globals == true ]; then + tmp=$(_ovs_vsctl_bashcomp_globalopt $word) + _ovs_vsctl_detect_nospace $tmp + completion="${completion} ${tmp#*EO}" + fi + if [ $valid_opts == true ]; then + tmp=$(_ovs_vsctl_bashcomp_localopt "$given_opts" $word) + _ovs_vsctl_detect_nospace $tmp + completion="${completion} ${tmp#*EO}" + if [ $index -lt $COMP_CWORD ] \ + && _ovs_vsctl_detect_nonzero_completions "$tmp"; then + valid_globals=false + given_opts="${given_opts} ${word}" + fi + fi + if [ $valid_commands = true ]; then + tmp=$(_ovs_vsctl_bashcomp_command "$given_opts" $word) + _ovs_vsctl_detect_nospace $tmp + completion="${completion} ${tmp#*EO}" + if [ $index -lt $COMP_CWORD ] \ + && _ovs_vsctl_detect_nonzero_completions "$tmp"; then + valid_globals=false + valid_opts=false + valid_commands=false + cmd_pos=0 + raw_cmd=$(_ovs_vsctl_expand_command "$word") + readarray -t cmd_args <<< "$raw_cmd" + fi + fi + if [ "$word" = "--" ] && [ $index -lt $COMP_CWORD ]; then + # Empty the parsed args array. + _OVS_VSCTL_PARSED_AGS=() + cmd_pos=-1 + # No longer allow global options after '--'. + valid_globals=false + valid_opts=true + valid_commands=true + given_opts="" + fi + completion="$(sort -u <<< "$(tr ' ' '\n' <<< ${completion})")" + if [ $index -eq $COMP_CWORD ]; then + if [ "$test" = "true" ]; then + completion="$(_ovs_vsctl_trim_compreply "$word" ":=" ${completion} | \ + tr ' ' '\n')" + if [ "${_OVS_VSCTL_COMP_NOSPACE}" = "true" ]; then + printf "%s" "$completion" | sed -e '/^$/d' + else + printf "%s" "$completion" | sed -e '/^$/d; s/$/ /g' + fi + printf "\n" + else + if [ "${_OVS_VSCTL_COMP_NOSPACE}" = "true" ]; then + compopt -o nospace + COMPREPLY=( $(compgen -W "${completion}" -- $word) ) + else + compopt +o nospace + COMPREPLY=( $(compgen -W "${completion}" -- $word) ) + fi + COMPREPLY=( $(_ovs_vsctl_trim_compreply "$word" \ + "${COMP_WORDBREAKS}" ${COMPREPLY[@]}) ) + fi + fi + index=$(($index+1)) + done +} + +if [ "$1" = "test" ]; then + _ovs_vsctl_bashcomp "$@" +else + complete -F _ovs_vsctl_bashcomp ovs-vsctl +fi diff -Nru openvswitch-2.3.1/utilities/ovs-vsctl.c openvswitch-2.4.0~git20150623/utilities/ovs-vsctl.c --- openvswitch-2.3.1/utilities/ovs-vsctl.c 2014-12-04 05:22:18.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/ovs-vsctl.c 2015-06-23 18:46:21.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,8 +47,8 @@ #include "table.h" #include "timeval.h" #include "util.h" -#include "vconn.h" -#include "vlog.h" +#include "openvswitch/vconn.h" +#include "openvswitch/vlog.h" VLOG_DEFINE_THIS_MODULE(vsctl); @@ -63,6 +63,11 @@ int min_args; /* Min number of arguments following name. */ int max_args; /* Max number of arguments following name. */ + /* Names that roughly describe the arguments that the command + * uses. These should be similar to the names displayed in the + * man page or in the help output. */ + const char *arguments; + /* If nonnull, calls ovsdb_idl_add_column() or ovsdb_idl_add_table() for * each column or table in ctx->idl that it uses. */ void (*prerequisites)(struct vsctl_context *ctx); @@ -85,6 +90,7 @@ /* A comma-separated list of supported options, e.g. "--a,--b", or the * empty string if the command does not support any options. */ const char *options; + enum { RO, RW } mode; /* Does this command modify the database? */ }; @@ -137,10 +143,12 @@ static struct ovsdb_idl *the_idl; static struct ovsdb_idl_txn *the_idl_txn; -static void vsctl_exit(int status) NO_RETURN; -static void vsctl_fatal(const char *, ...) PRINTF_FORMAT(1, 2) NO_RETURN; +OVS_NO_RETURN static void vsctl_exit(int status); +OVS_NO_RETURN static void vsctl_fatal(const char *, ...) OVS_PRINTF_FORMAT(1, 2); static char *default_db(void); -static void usage(void) NO_RETURN; +OVS_NO_RETURN static void usage(void); +OVS_NO_RETURN static void print_vsctl_commands(void); +OVS_NO_RETURN static void print_vsctl_options(const struct option *options); static void parse_options(int argc, char *argv[], struct shash *local_options); static bool might_write_to_db(char **argv); @@ -207,7 +215,7 @@ set_program_name(argv[0]); fatal_ignore_sigpipe(); vlog_set_levels(NULL, VLF_CONSOLE, VLL_WARN); - vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_WARN); + vlog_set_levels(&VLM_reconnect, VLF_ANY_DESTINATION, VLL_WARN); ovsrec_init(); /* Log our arguments. This is often valuable for debugging systems. */ @@ -292,6 +300,8 @@ OPT_PEER_CA_CERT, OPT_LOCAL, OPT_RETRY, + OPT_COMMANDS, + OPT_OPTIONS, VLOG_OPTION_ENUMS, TABLE_OPTION_ENUMS }; @@ -304,6 +314,8 @@ {"timeout", required_argument, NULL, 't'}, {"retry", no_argument, NULL, OPT_RETRY}, {"help", no_argument, NULL, 'h'}, + {"commands", no_argument, NULL, OPT_COMMANDS}, + {"options", no_argument, NULL, OPT_OPTIONS}, {"version", no_argument, NULL, 'V'}, VLOG_LONG_OPTIONS, TABLE_LONG_OPTIONS, @@ -320,7 +332,7 @@ size_t n_options; size_t i; - tmp = long_options_to_short_options(global_long_options); + tmp = ovs_cmdl_long_options_to_short_options(global_long_options); short_options = xasprintf("+%s", tmp); free(tmp); @@ -418,6 +430,12 @@ case 'h': usage(); + case OPT_COMMANDS: + print_vsctl_commands(); + + case OPT_OPTIONS: + print_vsctl_options(global_long_options); + case 'V': ovs_print_version(0, 0); printf("DB Schema %s\n", ovsrec_get_db_version()); @@ -693,6 +711,11 @@ del-ssl delete the SSL configuration\n\ set-ssl PRIV-KEY CERT CA-CERT set the SSL configuration\n\ \n\ +Auto Attach commands:\n\ + add-aa-mapping BRIDGE I-SID VLAN add Auto Attach mapping to BRIDGE\n\ + del-aa-mapping BRIDGE I-SID VLAN delete Auto Attach mapping VLAN from BRIDGE\n\ + get-aa-mapping BRIDGE get Auto Attach mappings from BRIDGE\n\ +\n\ Switch commands:\n\ emer-reset reset switch to known good state\n\ \n\ @@ -729,6 +752,132 @@ exit(EXIT_SUCCESS); } +/* Converts the command arguments into format that can be parsed by + * bash completion script. + * + * Therein, arguments will be attached with following prefixes: + * + * !argument :: The argument is required + * ?argument :: The argument is optional + * *argument :: The argument may appear any number (0 or more) times + * +argument :: The argument may appear one or more times + * + */ +static void +print_command_arguments(const struct vsctl_command_syntax *command) +{ + /* + * The argument string is parsed in reverse. We use a stack 'oew_stack' to + * keep track of nested optionals. Whenever a ']' is encountered, we push + * a bit to 'oew_stack'. The bit is set to 1 if the ']' is not nested. + * Subsequently, we pop an entry everytime '[' is met. + * + * We use 'whole_word_is_optional' value to decide whether or not a ! or + + * should be added on encountering a space: if the optional surrounds the + * whole word then it shouldn't be, but if it is only a part of the word + * (i.e. [key=]value), it should be. + */ + uint32_t oew_stack = 0; + + const char *arguments = command->arguments; + int length = strlen(arguments); + if (!length) { + return; + } + + /* Output buffer, written backward from end. */ + char *output = xmalloc(2 * length); + char *outp = output + 2 * length; + *--outp = '\0'; + + bool in_repeated = false; + bool whole_word_is_optional = false; + + for (const char *inp = arguments + length; inp > arguments; ) { + switch (*--inp) { + case ']': + oew_stack <<= 1; + if (inp[1] == '\0' || inp[1] == ' ' || inp[1] == '.') { + oew_stack |= 1; + } + break; + case '[': + /* Checks if the whole word is optional, and sets the + * 'whole_word_is_optional' accordingly. */ + if ((inp == arguments || inp[-1] == ' ') && oew_stack & 1) { + *--outp = in_repeated ? '*' : '?'; + whole_word_is_optional = true; + } else { + *--outp = '?'; + whole_word_is_optional = false; + } + oew_stack >>= 1; + break; + case ' ': + if (!whole_word_is_optional) { + *--outp = in_repeated ? '+' : '!'; + } + *--outp = ' '; + in_repeated = false; + whole_word_is_optional = false; + break; + case '.': + in_repeated = true; + break; + default: + *--outp = *inp; + break; + } + } + if (arguments[0] != '[' && outp != output + 2 * length - 1) { + *--outp = in_repeated ? '+' : '!'; + } + printf("%s", outp); + free(output); +} + +static void +print_vsctl_commands(void) +{ + const struct vsctl_command_syntax *p; + + for (p = get_all_commands(); p->name; p++) { + char *options = xstrdup(p->options); + char *options_begin = options; + char *item; + + for (item = strsep(&options, ","); item != NULL; + item = strsep(&options, ",")) { + if (item[0] != '\0') { + printf("[%s] ", item); + } + } + printf(",%s,", p->name); + print_command_arguments(p); + printf("\n"); + + free(options_begin); + } + + exit(EXIT_SUCCESS); +} + +static void +print_vsctl_options(const struct option *options) +{ + for (; options->name; options++) { + const struct option *o = options; + + printf("--%s%s\n", o->name, o->has_arg ? "=ARG" : ""); + if (o->flag == NULL && o->val > 0 && o->val <= UCHAR_MAX) { + printf("-%c%s\n", o->val, o->has_arg ? " ARG" : ""); + } + } + + exit(EXIT_SUCCESS); +} + + static char * default_db(void) { @@ -789,7 +938,7 @@ struct vsctl_bridge { struct ovsrec_bridge *br_cfg; char *name; - struct list ports; /* Contains "struct vsctl_port"s. */ + struct ovs_list ports; /* Contains "struct vsctl_port"s. */ /* VLAN ("fake") bridge support. * @@ -802,18 +951,21 @@ }; struct vsctl_port { - struct list ports_node; /* In struct vsctl_bridge's 'ports' list. */ - struct list ifaces; /* Contains "struct vsctl_iface"s. */ + struct ovs_list ports_node; /* In struct vsctl_bridge's 'ports' list. */ + struct ovs_list ifaces; /* Contains "struct vsctl_iface"s. */ struct ovsrec_port *port_cfg; struct vsctl_bridge *bridge; }; struct vsctl_iface { - struct list ifaces_node; /* In struct vsctl_port's 'ifaces' list. */ + struct ovs_list ifaces_node; /* In struct vsctl_port's 'ifaces' list. */ struct ovsrec_interface *iface_cfg; struct vsctl_port *port; }; +static struct vsctl_bridge *find_vlan_bridge(struct vsctl_bridge *parent, + int vlan); + static char * vsctl_context_to_string(const struct vsctl_context *ctx) { @@ -870,7 +1022,15 @@ br->vlan = vlan; hmap_init(&br->children); if (parent) { - hmap_insert(&parent->children, &br->children_node, hash_int(vlan, 0)); + struct vsctl_bridge *conflict = find_vlan_bridge(parent, vlan); + if (conflict) { + VLOG_WARN("%s: bridge has multiple VLAN bridges (%s and %s) " + "for VLAN %d, but only one is allowed", + parent->name, name, conflict->name, vlan); + } else { + hmap_insert(&parent->children, &br->children_node, + hash_int(vlan, 0)); + } } shash_add(&ctx->bridges, br->name, br); return br; @@ -1032,6 +1192,7 @@ ovsdb_idl_add_column(ctx->idl, &ovsrec_port_col_interfaces); ovsdb_idl_add_column(ctx->idl, &ovsrec_interface_col_name); + ovsdb_idl_add_column(ctx->idl, &ovsrec_interface_col_ofport); } @@ -1326,7 +1487,7 @@ &ovsrec_interface_col_name, {&ovsrec_interface_col_type, &ovsrec_interface_col_options, - NULL}, + &ovsrec_interface_col_error}, false}, {&ovsrec_table_controller, @@ -1660,6 +1821,7 @@ ovs_insert_bridge(ctx->ovs, br); } else { + struct vsctl_bridge *conflict; struct vsctl_bridge *parent; struct ovsrec_port *port; struct ovsrec_bridge *br; @@ -1672,6 +1834,11 @@ if (!parent) { vsctl_fatal("parent bridge %s does not exist", parent_name); } + conflict = find_vlan_bridge(parent, vlan); + if (conflict) { + vsctl_fatal("bridge %s already has a child VLAN bridge %s " + "on VLAN %d", parent_name, conflict->name, vlan); + } br = parent->br_cfg; iface = ovsrec_interface_insert(ctx->txn); @@ -2506,6 +2673,180 @@ ovsrec_open_vswitch_set_ssl(ctx->ovs, ssl); } + +static void +autoattach_insert_mapping(struct ovsrec_autoattach *aa, + int64_t isid, + int64_t vlan) +{ + int64_t *key_mappings, *value_mappings; + size_t i; + + key_mappings = xmalloc(sizeof *aa->key_mappings * (aa->n_mappings + 1)); + value_mappings = xmalloc(sizeof *aa->value_mappings * (aa->n_mappings + 1)); + + for (i = 0; i < aa->n_mappings; i++) { + key_mappings[i] = aa->key_mappings[i]; + value_mappings[i] = aa->value_mappings[i]; + } + key_mappings[aa->n_mappings] = isid; + value_mappings[aa->n_mappings] = vlan; + + ovsrec_autoattach_set_mappings(aa, key_mappings, value_mappings, + aa->n_mappings + 1); + + free(key_mappings); + free(value_mappings); +} + +static void +cmd_add_aa_mapping(struct vsctl_context *ctx) +{ + struct vsctl_bridge *br; + int64_t isid, vlan; + char *nptr = NULL; + + isid = strtoull(ctx->argv[2], &nptr, 10); + if (nptr == ctx->argv[2] || nptr == NULL) { + vsctl_fatal("Invalid argument %s", ctx->argv[2]); + return; + } + + vlan = strtoull(ctx->argv[3], &nptr, 10); + if (nptr == ctx->argv[3] || nptr == NULL) { + vsctl_fatal("Invalid argument %s", ctx->argv[3]); + return; + } + + vsctl_context_populate_cache(ctx); + + br = find_bridge(ctx, ctx->argv[1], true); + if (br->parent) { + br = br->parent; + } + + if (br && br->br_cfg) { + if (!br->br_cfg->auto_attach) { + struct ovsrec_autoattach *aa = ovsrec_autoattach_insert(ctx->txn); + ovsrec_bridge_set_auto_attach(br->br_cfg, aa); + } + autoattach_insert_mapping(br->br_cfg->auto_attach, isid, vlan); + } +} + +static void +del_aa_mapping(struct ovsrec_autoattach *aa, + int64_t isid, + int64_t vlan) +{ + int64_t *key_mappings, *value_mappings; + size_t i, n; + + key_mappings = xmalloc(sizeof *aa->key_mappings * (aa->n_mappings)); + value_mappings = xmalloc(sizeof *value_mappings * (aa->n_mappings)); + + for (i = n = 0; i < aa->n_mappings; i++) { + if (aa->key_mappings[i] != isid && aa->value_mappings[i] != vlan) { + key_mappings[n] = aa->key_mappings[i]; + value_mappings[n++] = aa->value_mappings[i]; + } + } + + ovsrec_autoattach_set_mappings(aa, key_mappings, value_mappings, n); + + free(key_mappings); + free(value_mappings); +} + +static void +cmd_del_aa_mapping(struct vsctl_context *ctx) +{ + struct vsctl_bridge *br; + int64_t isid, vlan; + char *nptr = NULL; + + isid = strtoull(ctx->argv[2], &nptr, 10); + if (nptr == ctx->argv[2] || nptr == NULL) { + vsctl_fatal("Invalid argument %s", ctx->argv[2]); + return; + } + + vlan = strtoull(ctx->argv[3], &nptr, 10); + if (nptr == ctx->argv[3] || nptr == NULL) { + vsctl_fatal("Invalid argument %s", ctx->argv[3]); + return; + } + + vsctl_context_populate_cache(ctx); + + br = find_bridge(ctx, ctx->argv[1], true); + if (br->parent) { + br = br->parent; + } + + if (br && br->br_cfg && br->br_cfg->auto_attach && + br->br_cfg->auto_attach->key_mappings && + br->br_cfg->auto_attach->value_mappings) { + size_t i; + + for (i = 0; i < br->br_cfg->auto_attach->n_mappings; i++) { + if (br->br_cfg->auto_attach->key_mappings[i] == isid && + br->br_cfg->auto_attach->value_mappings[i] == vlan) { + del_aa_mapping(br->br_cfg->auto_attach, isid, vlan); + break; + } + } + } +} + +static void +pre_aa_mapping(struct vsctl_context *ctx) +{ + pre_get_info(ctx); + + ovsdb_idl_add_column(ctx->idl, &ovsrec_bridge_col_auto_attach); + ovsdb_idl_add_column(ctx->idl, &ovsrec_autoattach_col_mappings); +} + +static void +verify_auto_attach(struct ovsrec_bridge *bridge) +{ + if (bridge) { + ovsrec_bridge_verify_auto_attach(bridge); + + if (bridge->auto_attach) { + ovsrec_autoattach_verify_mappings(bridge->auto_attach); + } + } +} + +static void +cmd_get_aa_mapping(struct vsctl_context *ctx) +{ + struct vsctl_bridge *br; + + vsctl_context_populate_cache(ctx); + + br = find_bridge(ctx, ctx->argv[1], true); + if (br->parent) { + br = br->parent; + } + + verify_auto_attach(br->br_cfg); + + if (br && br->br_cfg && br->br_cfg->auto_attach && + br->br_cfg->auto_attach->key_mappings && + br->br_cfg->auto_attach->value_mappings) { + size_t i; + + for (i = 0; i < br->br_cfg->auto_attach->n_mappings; i++) { + ds_put_format(&ctx->output, "%"PRId64" %"PRId64"\n", + br->br_cfg->auto_attach->key_mappings[i], + br->br_cfg->auto_attach->value_mappings[i]); + } + } +} + /* Parameter commands. */ @@ -2585,6 +2926,12 @@ {&ovsrec_table_flow_sample_collector_set, NULL, &ovsrec_flow_sample_collector_set_col_ipfix}}}, + {&ovsrec_table_autoattach, + {{&ovsrec_table_bridge, + &ovsrec_bridge_col_name, + &ovsrec_bridge_col_auto_attach}, + {NULL, NULL, NULL}}}, + {&ovsrec_table_flow_sample_collector_set, {{NULL, NULL, NULL}, {NULL, NULL, NULL}}}, @@ -2744,9 +3091,11 @@ const struct ovsdb_idl_row *row; struct uuid uuid; + row = NULL; if (uuid_from_string(&uuid, record_id)) { row = ovsdb_idl_get_row_for_uuid(ctx->idl, table->class, &uuid); - } else { + } + if (!row) { int i; for (i = 0; i < ARRAY_SIZE(table->row_ids); i++) { @@ -2867,7 +3216,7 @@ * * On success, returns NULL. On failure, returned a malloc()'d string error * message and stores NULL into all of the nonnull output arguments. */ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT parse_column_key_value(const char *arg, const struct vsctl_table_class *table, const struct ovsdb_idl_column **columnp, char **keyp, @@ -2987,12 +3336,12 @@ } static void -check_mutable(const struct vsctl_table_class *table, +check_mutable(const struct ovsdb_idl_row *row, const struct ovsdb_idl_column *column) { - if (!column->mutable) { + if (!ovsdb_idl_is_mutable(row, column)) { vsctl_fatal("cannot modify read-only column %s in table %s", - column->name, table->class->name); + column->name, row->table->class->name); } } @@ -3339,10 +3688,7 @@ table = pre_get_table(ctx, table_name); for (i = 3; i < ctx->argc; i++) { - const struct ovsdb_idl_column *column; - - column = pre_parse_column_key_value(ctx, ctx->argv[i], table); - check_mutable(table, column); + pre_parse_column_key_value(ctx, ctx->argv[i], table); } } @@ -3361,6 +3707,7 @@ if (!value_string) { vsctl_fatal("%s: missing value", arg); } + check_mutable(row, column); if (key_string) { union ovsdb_atom key, value; @@ -3431,7 +3778,6 @@ table = pre_get_table(ctx, table_name); pre_get_column(ctx, table, column_name, &column); - check_mutable(table, column); } static void @@ -3454,6 +3800,7 @@ if (!row) { return; } + check_mutable(row, column); type = &column->type; ovsdb_datum_clone(&old, ovsdb_idl_read(row, column), &column->type); @@ -3492,7 +3839,6 @@ table = pre_get_table(ctx, table_name); pre_get_column(ctx, table, column_name, &column); - check_mutable(table, column); } static void @@ -3515,6 +3861,7 @@ if (!row) { return; } + check_mutable(row, column); type = &column->type; ovsdb_datum_clone(&old, ovsdb_idl_read(row, column), &column->type); @@ -3528,6 +3875,7 @@ rm_type.n_max = UINT_MAX; error = ovsdb_datum_from_string(&rm, &rm_type, ctx->argv[i], ctx->symtab); + if (error) { if (ovsdb_type_is_map(&rm_type)) { rm_type.value.type = OVSDB_TYPE_VOID; @@ -3566,7 +3914,6 @@ const struct ovsdb_idl_column *column; pre_get_column(ctx, table, ctx->argv[i], &column); - check_mutable(table, column); } } @@ -3592,6 +3939,7 @@ struct ovsdb_datum datum; die_if_error(get_column(table, ctx->argv[i], &column)); + check_mutable(row, column); type = &column->type; if (type->n_min > 0) { @@ -4244,77 +4592,125 @@ free(error); } +/* + * Developers who add new commands to the 'struct vsctl_command_syntax' must + * define the 'arguments' member of the struct. The following keywords are + * available for composing the argument format: + * + * TABLE RECORD BRIDGE PARENT PORT + * KEY VALUE ARG KEY=VALUE ?KEY=VALUE + * IFACE SYSIFACE COLUMN COLUMN?:KEY COLUMN?:KEY=VALUE + * MODE CA-CERT CERTIFICATE PRIVATE-KEY + * TARGET NEW-* (e.g. NEW-PORT) + * + * For argument types not listed above, just uses 'ARG' as place holder. + * + * Encloses the keyword with '[]' if it is optional. Appends '...' to + * keyword or enclosed keyword to indicate that the argument can be specified + * multiple times. + * + * */ static const struct vsctl_command_syntax all_commands[] = { /* Open vSwitch commands. */ - {"init", 0, 0, NULL, cmd_init, NULL, "", RW}, - {"show", 0, 0, pre_cmd_show, cmd_show, NULL, "", RO}, + {"init", 0, 0, "", NULL, cmd_init, NULL, "", RW}, + {"show", 0, 0, "", pre_cmd_show, cmd_show, NULL, "", RO}, /* Bridge commands. */ - {"add-br", 1, 3, pre_get_info, cmd_add_br, NULL, "--may-exist", RW}, - {"del-br", 1, 1, pre_get_info, cmd_del_br, NULL, "--if-exists", RW}, - {"list-br", 0, 0, pre_get_info, cmd_list_br, NULL, "--real,--fake", RO}, - {"br-exists", 1, 1, pre_get_info, cmd_br_exists, NULL, "", RO}, - {"br-to-vlan", 1, 1, pre_get_info, cmd_br_to_vlan, NULL, "", RO}, - {"br-to-parent", 1, 1, pre_get_info, cmd_br_to_parent, NULL, "", RO}, - {"br-set-external-id", 2, 3, pre_cmd_br_set_external_id, - cmd_br_set_external_id, NULL, "", RW}, - {"br-get-external-id", 1, 2, pre_cmd_br_get_external_id, + {"add-br", 1, 3, "NEW-BRIDGE [PARENT] [NEW-VLAN]", pre_get_info, + cmd_add_br, NULL, "--may-exist", RW}, + {"del-br", 1, 1, "BRIDGE", pre_get_info, cmd_del_br, + NULL, "--if-exists", RW}, + {"list-br", 0, 0, "", pre_get_info, cmd_list_br, NULL, "--real,--fake", + RO}, + {"br-exists", 1, 1, "BRIDGE", pre_get_info, cmd_br_exists, NULL, "", RO}, + {"br-to-vlan", 1, 1, "BRIDGE", pre_get_info, cmd_br_to_vlan, NULL, "", + RO}, + {"br-to-parent", 1, 1, "BRIDGE", pre_get_info, cmd_br_to_parent, NULL, + "", RO}, + {"br-set-external-id", 2, 3, "BRIDGE KEY [VALUE]", + pre_cmd_br_set_external_id, cmd_br_set_external_id, NULL, "", RW}, + {"br-get-external-id", 1, 2, "BRIDGE [KEY]", pre_cmd_br_get_external_id, cmd_br_get_external_id, NULL, "", RO}, /* Port commands. */ - {"list-ports", 1, 1, pre_get_info, cmd_list_ports, NULL, "", RO}, - {"add-port", 2, INT_MAX, pre_get_info, cmd_add_port, NULL, "--may-exist", - RW}, - {"add-bond", 4, INT_MAX, pre_get_info, cmd_add_bond, NULL, - "--may-exist,--fake-iface", RW}, - {"del-port", 1, 2, pre_get_info, cmd_del_port, NULL, + {"list-ports", 1, 1, "BRIDGE", pre_get_info, cmd_list_ports, NULL, "", + RO}, + {"add-port", 2, INT_MAX, "BRIDGE NEW-PORT [COLUMN[:KEY]=VALUE]...", + pre_get_info, cmd_add_port, NULL, "--may-exist", RW}, + {"add-bond", 4, INT_MAX, + "BRIDGE NEW-BOND-PORT SYSIFACE... [COLUMN[:KEY]=VALUE]...", pre_get_info, + cmd_add_bond, NULL, "--may-exist,--fake-iface", RW}, + {"del-port", 1, 2, "[BRIDGE] PORT|IFACE", pre_get_info, cmd_del_port, NULL, "--if-exists,--with-iface", RW}, - {"port-to-br", 1, 1, pre_get_info, cmd_port_to_br, NULL, "", RO}, + {"port-to-br", 1, 1, "PORT", pre_get_info, cmd_port_to_br, NULL, "", RO}, /* Interface commands. */ - {"list-ifaces", 1, 1, pre_get_info, cmd_list_ifaces, NULL, "", RO}, - {"iface-to-br", 1, 1, pre_get_info, cmd_iface_to_br, NULL, "", RO}, + {"list-ifaces", 1, 1, "BRIDGE", pre_get_info, cmd_list_ifaces, NULL, "", + RO}, + {"iface-to-br", 1, 1, "IFACE", pre_get_info, cmd_iface_to_br, NULL, "", + RO}, /* Controller commands. */ - {"get-controller", 1, 1, pre_controller, cmd_get_controller, NULL, "", RO}, - {"del-controller", 1, 1, pre_controller, cmd_del_controller, NULL, "", RW}, - {"set-controller", 1, INT_MAX, pre_controller, cmd_set_controller, NULL, + {"get-controller", 1, 1, "BRIDGE", pre_controller, cmd_get_controller, + NULL, "", RO}, + {"del-controller", 1, 1, "BRIDGE", pre_controller, cmd_del_controller, + NULL, "", RW}, + {"set-controller", 1, INT_MAX, "BRIDGE TARGET...", pre_controller, + cmd_set_controller, NULL, "", RW}, + {"get-fail-mode", 1, 1, "BRIDGE", pre_get_info, cmd_get_fail_mode, NULL, + "", RO}, + {"del-fail-mode", 1, 1, "BRIDGE", pre_get_info, cmd_del_fail_mode, NULL, "", RW}, - {"get-fail-mode", 1, 1, pre_get_info, cmd_get_fail_mode, NULL, "", RO}, - {"del-fail-mode", 1, 1, pre_get_info, cmd_del_fail_mode, NULL, "", RW}, - {"set-fail-mode", 2, 2, pre_get_info, cmd_set_fail_mode, NULL, "", RW}, + {"set-fail-mode", 2, 2, "BRIDGE MODE", pre_get_info, cmd_set_fail_mode, + NULL, "", RW}, /* Manager commands. */ - {"get-manager", 0, 0, pre_manager, cmd_get_manager, NULL, "", RO}, - {"del-manager", 0, 0, pre_manager, cmd_del_manager, NULL, "", RW}, - {"set-manager", 1, INT_MAX, pre_manager, cmd_set_manager, NULL, "", RW}, + {"get-manager", 0, 0, "", pre_manager, cmd_get_manager, NULL, "", RO}, + {"del-manager", 0, 0, "", pre_manager, cmd_del_manager, NULL, "", RW}, + {"set-manager", 1, INT_MAX, "TARGET...", pre_manager, cmd_set_manager, + NULL, "", RW}, /* SSL commands. */ - {"get-ssl", 0, 0, pre_cmd_get_ssl, cmd_get_ssl, NULL, "", RO}, - {"del-ssl", 0, 0, pre_cmd_del_ssl, cmd_del_ssl, NULL, "", RW}, - {"set-ssl", 3, 3, pre_cmd_set_ssl, cmd_set_ssl, NULL, "--bootstrap", RW}, + {"get-ssl", 0, 0, "", pre_cmd_get_ssl, cmd_get_ssl, NULL, "", RO}, + {"del-ssl", 0, 0, "", pre_cmd_del_ssl, cmd_del_ssl, NULL, "", RW}, + {"set-ssl", 3, 3, "PRIVATE-KEY CERTIFICATE CA-CERT", pre_cmd_set_ssl, + cmd_set_ssl, NULL, "--bootstrap", RW}, + + /* Auto Attach commands. */ + {"add-aa-mapping", 3, 3, "BRIDGE ARG ARG", pre_aa_mapping, cmd_add_aa_mapping, + NULL, "", RW}, + {"del-aa-mapping", 3, 3, "BRIDGE ARG ARG", pre_aa_mapping, cmd_del_aa_mapping, + NULL, "", RW}, + {"get-aa-mapping", 1, 1, "BRIDGE", pre_aa_mapping, cmd_get_aa_mapping, + NULL, "", RO}, /* Switch commands. */ - {"emer-reset", 0, 0, pre_cmd_emer_reset, cmd_emer_reset, NULL, "", RW}, + {"emer-reset", 0, 0, "", pre_cmd_emer_reset, cmd_emer_reset, NULL, "", RW}, /* Database commands. */ - {"comment", 0, INT_MAX, NULL, NULL, NULL, "", RO}, - {"get", 2, INT_MAX, pre_cmd_get, cmd_get, NULL, "--if-exists,--id=", RO}, - {"list", 1, INT_MAX, pre_cmd_list, cmd_list, NULL, + {"comment", 0, INT_MAX, "[ARG]...", NULL, NULL, NULL, "", RO}, + {"get", 2, INT_MAX, "TABLE RECORD [COLUMN[:KEY]]...",pre_cmd_get, cmd_get, + NULL, "--if-exists,--id=", RO}, + {"list", 1, INT_MAX, "TABLE [RECORD]...", pre_cmd_list, cmd_list, NULL, "--if-exists,--columns=", RO}, - {"find", 1, INT_MAX, pre_cmd_find, cmd_find, NULL, "--columns=", RO}, - {"set", 3, INT_MAX, pre_cmd_set, cmd_set, NULL, "--if-exists", RW}, - {"add", 4, INT_MAX, pre_cmd_add, cmd_add, NULL, "--if-exists", RW}, - {"remove", 4, INT_MAX, pre_cmd_remove, cmd_remove, NULL, "--if-exists", - RW}, - {"clear", 3, INT_MAX, pre_cmd_clear, cmd_clear, NULL, "--if-exists", RW}, - {"create", 2, INT_MAX, pre_create, cmd_create, post_create, "--id=", RW}, - {"destroy", 1, INT_MAX, pre_cmd_destroy, cmd_destroy, NULL, - "--if-exists,--all", RW}, - {"wait-until", 2, INT_MAX, pre_cmd_wait_until, cmd_wait_until, NULL, "", - RO}, + {"find", 1, INT_MAX, "TABLE [COLUMN[:KEY]=VALUE]...", pre_cmd_find, + cmd_find, NULL, "--columns=", RO}, + {"set", 3, INT_MAX, "TABLE RECORD COLUMN[:KEY]=VALUE...", pre_cmd_set, + cmd_set, NULL, "--if-exists", RW}, + {"add", 4, INT_MAX, "TABLE RECORD COLUMN [KEY=]VALUE...", pre_cmd_add, + cmd_add, NULL, "--if-exists", RW}, + {"remove", 4, INT_MAX, "TABLE RECORD COLUMN KEY|VALUE|KEY=VALUE...", + pre_cmd_remove, cmd_remove, NULL, "--if-exists", RW}, + {"clear", 3, INT_MAX, "TABLE RECORD COLUMN...", pre_cmd_clear, cmd_clear, + NULL, "--if-exists", RW}, + {"create", 2, INT_MAX, "TABLE COLUMN[:KEY]=VALUE...", pre_create, + cmd_create, post_create, "--id=", RW}, + {"destroy", 1, INT_MAX, "TABLE [RECORD]...", pre_cmd_destroy, cmd_destroy, + NULL, "--if-exists,--all", RW}, + {"wait-until", 2, INT_MAX, "TABLE RECORD [COLUMN[:KEY]=VALUE]...", + pre_cmd_wait_until, cmd_wait_until, NULL, "", RO}, - {NULL, 0, 0, NULL, NULL, NULL, NULL, RO}, + {NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, RO}, }; static const struct vsctl_command_syntax *get_all_commands(void) diff -Nru openvswitch-2.3.1/utilities/qemu-wrap.py openvswitch-2.4.0~git20150623/utilities/qemu-wrap.py --- openvswitch-2.3.1/utilities/qemu-wrap.py 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/utilities/qemu-wrap.py 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,389 @@ +#!/usr/bin/python +# +# BSD LICENSE +# +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +##################################################################### +# This script is designed to modify the call to the QEMU emulator +# to support userspace vhost when starting a guest machine through +# libvirt with vhost enabled. The steps to enable this are as follows +# and should be run as root: +# +# 1. Place this script in a libvirtd's binary search PATH ($PATH) +# A good location would be in the same directory that the QEMU +# binary is located +# +# 2. Ensure that the script has the same owner/group and file +# permissions as the QEMU binary +# +# 3. Update the VM xml file using "virsh edit VM.xml" +# +# 3.a) Set the VM to use the launch script +# +# Set the emulator path contained in the +# tags +# +# e.g replace /usr/bin/qemu-kvm +# with /usr/bin/qemu-wrap.py +# +# 3.b) Set the VM's device's to use vhost-net offload +# +# +# +# +# +# +# 4. Enable libvirt to access our userpace device file by adding it to +# controllers cgroup for libvirtd using the following steps +# +# 4.a) In /etc/libvirt/qemu.conf add/edit the following lines: +# 1) cgroup_controllers = [ ... "devices", ... ] +# 2) clear_emulator_capabilities = 0 +# 3) user = "root" +# 4) group = "root" +# 5) cgroup_device_acl = [ +# "/dev/null", "/dev/full", "/dev/zero", +# "/dev/random", "/dev/urandom", +# "/dev/ptmx", "/dev/kvm", "/dev/kqemu", +# "/dev/rtc", "/dev/hpet", "/dev/net/tun", +# "/dev/-", +# "/dev/hugepages" +# ] +# +# 4.b) Disable SELinux or set to permissive mode +# +# 4.c) Mount cgroup device controller +# "mkdir /dev/cgroup" +# "mount -t cgroup none /dev/cgroup -o devices" +# +# 4.d) Set hugetlbfs_mount variable - ( Optional ) +# VMs using userspace vhost must use hugepage backed +# memory. This can be enabled in the libvirt XML +# config by adding a memory backing section to the +# XML config e.g. +# +# +# +# This memory backing section should be added after the +# and sections. This will add +# flags "-mem-prealloc -mem-path " to the QEMU +# command line. The hugetlbfs_mount variable can be used +# to override the default passed through by libvirt. +# +# if "-mem-prealloc" or "-mem-path " are not passed +# through and a vhost device is detected then these options will +# be automatically added by this script. This script will detect +# the system hugetlbfs mount point to be used for . The +# default for this script can be overidden by the +# hugetlbfs_dir variable in the configuration section of this script. +# +# +# 4.e) Restart the libvirtd system process +# e.g. on Fedora "systemctl restart libvirtd.service" +# +# +# 4.f) Edit the Configuration Parameters section of this script +# to point to the correct emulator location and set any +# addition options +# +# The script modifies the libvirtd Qemu call by modifying/adding +# options based on the configuration parameters below. +# NOTE: +# emul_path and us_vhost_path must be set +# All other parameters are optional +##################################################################### + + +############################################# +# Configuration Parameters +############################################# +#Path to QEMU binary +emul_path = "/usr/local/bin/qemu-system-x86_64" + +#Path to userspace vhost device file +# This filename should match the --dev-basename --dev-index parameters of +# the command used to launch the userspace vhost sample application e.g. +# if the sample app lauch command is: +# ./build/vhost-switch ..... --dev-basename usvhost --dev-index 1 +# then this variable should be set to: +# us_vhost_path = "/dev/usvhost-1" +us_vhost_path = "/dev/usvhost-1" + +#List of additional user defined emulation options. These options will +#be added to all Qemu calls +emul_opts_user = [] + +#List of additional user defined emulation options for vhost only. +#These options will only be added to vhost enabled guests +emul_opts_user_vhost = [] + +#For all VHOST enabled VMs, the VM memory is preallocated from hugetlbfs +# Set this variable to one to enable this option for all VMs +use_huge_all = 0 + +#Instead of autodetecting, override the hugetlbfs directory by setting +#this variable +hugetlbfs_dir = "" + +############################################# + + +############################################# +# ****** Do Not Modify Below this Line ****** +############################################# + +import sys, os, subprocess +import time +import signal + + +#List of open userspace vhost file descriptors +fd_list = [] + +#additional virtio device flags when using userspace vhost +vhost_flags = [ "csum=off", + "gso=off", + "guest_tso4=off", + "guest_tso6=off", + "guest_ecn=off" + ] + +#String of the path to the Qemu process pid +qemu_pid = "/tmp/%d-qemu.pid" % os.getpid() + +############################################# +# Signal haldler to kill Qemu subprocess +############################################# +def kill_qemu_process(signum, stack): + pidfile = open(qemu_pid, 'r') + pid = int(pidfile.read()) + os.killpg(pid, signal.SIGTERM) + pidfile.close() + + +############################################# +# Find the system hugefile mount point. +# Note: +# if multiple hugetlbfs mount points exist +# then the first one found will be used +############################################# +def find_huge_mount(): + + if (len(hugetlbfs_dir)): + return hugetlbfs_dir + + huge_mount = "" + + if (os.access("/proc/mounts", os.F_OK)): + f = open("/proc/mounts", "r") + line = f.readline() + while line: + line_split = line.split(" ") + if line_split[2] == 'hugetlbfs': + huge_mount = line_split[1] + break + line = f.readline() + else: + print "/proc/mounts not found" + exit (1) + + f.close + if len(huge_mount) == 0: + print "Failed to find hugetlbfs mount point" + exit (1) + + return huge_mount + + +############################################# +# Get a userspace Vhost file descriptor +############################################# +def get_vhost_fd(): + + if (os.access(us_vhost_path, os.F_OK)): + fd = os.open( us_vhost_path, os.O_RDWR) + else: + print ("US-Vhost file %s not found" %us_vhost_path) + exit (1) + + return fd + + +############################################# +# Check for vhostfd. if found then replace +# with our own vhost fd and append any vhost +# flags onto the end +############################################# +def modify_netdev_arg(arg): + + global fd_list + vhost_in_use = 0 + s = '' + new_opts = [] + netdev_opts = arg.split(",") + + for opt in netdev_opts: + #check if vhost is used + if "vhost" == opt[:5]: + vhost_in_use = 1 + else: + new_opts.append(opt) + + #if using vhost append vhost options + if vhost_in_use == 1: + #append vhost on option + new_opts.append('vhost=on') + #append vhostfd ption + new_fd = get_vhost_fd() + new_opts.append('vhostfd=' + str(new_fd)) + fd_list.append(new_fd) + + #concatenate all options + for opt in new_opts: + if len(s) > 0: + s+=',' + + s+=opt + + return s + + +############################################# +# Main +############################################# +def main(): + + global fd_list + global vhost_in_use + new_args = [] + num_cmd_args = len(sys.argv) + emul_call = '' + mem_prealloc_set = 0 + mem_path_set = 0 + num = 0; + + #parse the parameters + while (num < num_cmd_args): + arg = sys.argv[num] + + #Check netdev +1 parameter for vhostfd + if arg == '-netdev': + num_vhost_devs = len(fd_list) + new_args.append(arg) + + num+=1 + arg = sys.argv[num] + mod_arg = modify_netdev_arg(arg) + new_args.append(mod_arg) + + #append vhost flags if this is a vhost device + # and -device is the next arg + # i.e -device -opt1,-opt2,...,-opt3,%vhost + if (num_vhost_devs < len(fd_list)): + num+=1 + arg = sys.argv[num] + if arg == '-device': + new_args.append(arg) + num+=1 + new_arg = sys.argv[num] + for flag in vhost_flags: + new_arg = ''.join([new_arg,',',flag]) + new_args.append(new_arg) + else: + new_args.append(arg) + elif arg == '-mem-prealloc': + mem_prealloc_set = 1 + new_args.append(arg) + elif arg == '-mem-path': + mem_path_set = 1 + new_args.append(arg) + + else: + new_args.append(arg) + + num+=1 + + #Set Qemu binary location + emul_call+=emul_path + emul_call+=" " + + #Add prealloc mem options if using vhost and not already added + if ((len(fd_list) > 0) and (mem_prealloc_set == 0)): + emul_call += "-mem-prealloc " + + #Add mempath mem options if using vhost and not already added + if ((len(fd_list) > 0) and (mem_path_set == 0)): + #Detect and add hugetlbfs mount point + mp = find_huge_mount() + mp = "".join(["-mem-path ", mp]) + emul_call += mp + emul_call += " " + + #add user options + for opt in emul_opts_user: + emul_call += opt + emul_call += " " + + #Add add user vhost only options + if len(fd_list) > 0: + for opt in emul_opts_user_vhost: + emul_call += opt + emul_call += " " + + #Add updated libvirt options + iter_args = iter(new_args) + #skip 1st arg i.e. call to this script + next(iter_args) + for arg in iter_args: + emul_call+=str(arg) + emul_call+= " " + + emul_call += "-pidfile %s " % qemu_pid + #Call QEMU + process = subprocess.Popen(emul_call, shell=True, preexec_fn=os.setsid) + + for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]: + signal.signal(sig, kill_qemu_process) + + process.wait() + + #Close usvhost files + for fd in fd_list: + os.close(fd) + #Cleanup temporary files + if os.access(qemu_pid, os.F_OK): + os.remove(qemu_pid) + + + +if __name__ == "__main__": + main() diff -Nru openvswitch-2.3.1/Vagrantfile openvswitch-2.4.0~git20150623/Vagrantfile --- openvswitch-2.3.1/Vagrantfile 1970-01-01 00:00:00.000000000 +0000 +++ openvswitch-2.4.0~git20150623/Vagrantfile 2015-06-23 18:46:21.000000000 +0000 @@ -0,0 +1,59 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" +Vagrant.require_version ">=1.7.0" + +$bootstrap_fedora = <
  • $namePDF, HTML, plain text